# 0xbiel/notes architecture

> Architecture diagram of the GitHub repository 0xbiel/notes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/0xbiel/notes
- Repository: https://github.com/0xbiel/notes

## Overview

Palladium is a native macOS notebook for Markdown documents, notebook-scoped assistant chats, and dictation. The main workflow runs from workspace navigation into editing or chat: the assistant can use notebook files and attachments, consult web sources, and propose document edits; users can also dictate into the composer and review the transcript. The graph preserves documented export/print, LaTeX, appearance, and provider configuration capabilities. Edges are limited to relationships visible in excerpts, indexed references, or README statements; unsampled feature links are omitted where their callers are unknown.

Main entry points: [`Sources/Notes/MediaController.swift`](https://github.com/0xbiel/notes/blob/main/Sources/Notes/MediaController.swift) (Dictation controller), [`Sources/LectureCore/NotebookAssistant.swift`](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/NotebookAssistant.swift) (Notebook assistant), [`Sources/LectureCore/OpenRouterHarness.swift`](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/OpenRouterHarness.swift) (Provider runtime), [`Sources/Notes/WorkspaceView.swift`](https://github.com/0xbiel/notes/blob/main/Sources/Notes/WorkspaceView.swift) (Workspace navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Notebook workspace"]
  node_app["App entry<br/>[NotesApp.swift]"]
  node_workspace_ui["Workspace navigation"]
  node_notebook_ui["Notebook and chat views"]
  node_assistant_ui["Assistant controller"]
  node_media_ui["Dictation controller"]
  node_appearance["Theme and appearance"]
end

subgraph group_docs["Documents and library"]
  node_notebook_model["Notebook and edit history<br/>[Notebook.swift]"]
  node_markdown_editor["Markdown editor"]
  node_markdown_render["Markdown math and tables"]
  node_document_output["Document export and print"]
  node_latex["LaTeX editing<br/>[LaTeXEditor.swift]"]
  node_library_context["File and attachment context"]
  node_file_library["Notebook file library"]
end

subgraph group_assistant["Assistant and providers"]
  node_assistant_logic["Notebook assistant"]
  node_web["Web search<br/>[NotebookWeb.swift]"]
  node_provider_harness["Provider runtime"]
  node_provider_env["Provider configuration"]
  node_progress["Provider activity events"]
  node_ai_controller["Transcript edit proposals<br/>[AIController.swift]"]
  node_ai_outbox[("Proposal outbox<br/>[AIOutbox.swift]")]
end

subgraph group_dictation["Dictation pipeline"]
  node_speech_capture["Microphone capture"]
  node_transcriber["Whisper transcription"]
  node_media_store["Local media preparation<br/>[LocalMedia.swift]"]
end

subgraph group_runtime["Workspace runtime"]
  node_workspace[("Safe workspace storage")]
end

node_user(("Notebook user"))
node_external_ai{{"Configured AI provider"}}
node_external_web{{"Search and source sites"}}
node_openai_asr{{"OpenAI dictation API"}}

node_user -->|"opens"| node_app
node_app -.->|"presents"| node_workspace_ui
node_workspace_ui -->|"uses notebooks"| node_notebook_model
node_workspace_ui -->|"presents"| node_notebook_ui
node_notebook_ui -->|"routes chat"| node_assistant_ui
node_notebook_ui -->|"hosts dictation"| node_media_ui
node_user -->|"writes notes"| node_markdown_editor
node_markdown_editor -->|"renders tables"| node_markdown_render
node_workspace_ui -->|"opens documents"| node_markdown_editor
node_user -->|"exports or prints"| node_document_output
node_user -->|"edits TeX"| node_latex
node_assistant_ui -->|"runs requests"| node_assistant_logic
node_assistant_logic -->|"reads notebook"| node_notebook_model
node_assistant_logic -->|"reads sources"| node_library_context
node_assistant_logic -->|"calls provider"| node_provider_harness
node_assistant_logic -.->|"searches web"| node_web
node_web -.->|"queries sources"| node_external_web
node_provider_harness -->|"applies settings"| node_provider_env
node_provider_harness -->|"streams events"| node_progress
node_provider_harness -.->|"sends requests"| node_external_ai
node_assistant_ui -->|"imports attachments"| node_file_library
node_library_context -->|"reads library files"| node_file_library
node_user -->|"dictates"| node_media_ui
node_media_ui -->|"captures audio"| node_speech_capture
node_media_ui -->|"prepares recordings"| node_media_store
node_media_ui -->|"transcribes audio"| node_transcriber
node_transcriber -.->|"sends API audio"| node_openai_asr
node_media_ui -->|"offers transcript"| node_ai_controller
node_ai_controller -->|"queues proposals"| node_ai_outbox
node_ai_controller -->|"sends proposals"| node_provider_harness
node_ai_outbox -->|"persists batches"| node_workspace
node_notebook_model -->|"saves edits"| node_workspace
node_file_library -->|"stores notebook files"| node_workspace

click node_app "https://github.com/0xbiel/notes/blob/main/Sources/Notes/NotesApp.swift"
click node_workspace_ui "https://github.com/0xbiel/notes/blob/main/Sources/Notes/WorkspaceView.swift"
click node_notebook_ui "https://github.com/0xbiel/notes/blob/main/Sources/Notes/NotebookWorkspaceViews.swift"
click node_assistant_ui "https://github.com/0xbiel/notes/blob/main/Sources/Notes/NotebookAssistantController.swift"
click node_media_ui "https://github.com/0xbiel/notes/blob/main/Sources/Notes/MediaController.swift"
click node_appearance "https://github.com/0xbiel/notes/blob/main/Sources/Notes/NotebookAccent.swift"
click node_notebook_model "https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/Notebook.swift"
click node_markdown_editor "https://github.com/0xbiel/notes/blob/main/Sources/Notes/LiveMarkdownEditor.swift"
click node_markdown_render "https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/MarkdownTable.swift"
click node_document_output "https://github.com/0xbiel/notes/blob/main/Sources/Notes/DocumentOutput.swift"
click node_latex "https://github.com/0xbiel/notes/blob/main/Sources/Notes/LaTeXEditor.swift"
click node_library_context "https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/NotebookLibraryContext.swift"
click node_file_library "https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/NotebookFileLibrary.swift"
click node_assistant_logic "https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/NotebookAssistant.swift"
click node_web "https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/NotebookWeb.swift"
click node_provider_harness "https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/OpenRouterHarness.swift"
click node_provider_env "https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/ProviderEnvironment.swift"
click node_progress "https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/NotebookProviderProgress.swift"
click node_ai_controller "https://github.com/0xbiel/notes/blob/main/Sources/Notes/AIController.swift"
click node_ai_outbox "https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/AIOutbox.swift"
click node_speech_capture "https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/MicrophoneStream.swift"
click node_transcriber "https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/WhisperTranscriber.swift"
click node_media_store "https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/LocalMedia.swift"
click node_workspace "https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/SafeWorkspace.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_workspace_ui,node_notebook_ui,node_assistant_ui,node_media_ui,node_appearance,node_user toneBlue
class node_notebook_model,node_markdown_editor,node_markdown_render,node_document_output,node_latex,node_library_context,node_file_library toneAmber
class node_assistant_logic,node_web,node_provider_harness,node_provider_env,node_progress,node_ai_controller,node_ai_outbox,node_openai_asr toneMint
class node_speech_capture,node_transcriber,node_media_store toneRose
class node_workspace,node_external_ai,node_external_web toneIndigo
```

## Components

### Notebook workspace

- [App entry](https://github.com/0xbiel/notes/blob/main/Sources/Notes/NotesApp.swift): `Sources/Notes/NotesApp.swift`
- [Workspace navigation](https://github.com/0xbiel/notes/blob/main/Sources/Notes/WorkspaceView.swift): `Sources/Notes/WorkspaceView.swift`
- [Notebook and chat views](https://github.com/0xbiel/notes/blob/main/Sources/Notes/NotebookWorkspaceViews.swift): `Sources/Notes/NotebookWorkspaceViews.swift`
- [Assistant controller](https://github.com/0xbiel/notes/blob/main/Sources/Notes/NotebookAssistantController.swift): `Sources/Notes/NotebookAssistantController.swift`
- [Dictation controller](https://github.com/0xbiel/notes/blob/main/Sources/Notes/MediaController.swift): `Sources/Notes/MediaController.swift`
- [Theme and appearance](https://github.com/0xbiel/notes/blob/main/Sources/Notes/NotebookAccent.swift): `Sources/Notes/NotebookAccent.swift`

### Documents and library

- [Notebook and edit history](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/Notebook.swift): `Sources/LectureCore/Notebook.swift`
- [Markdown editor](https://github.com/0xbiel/notes/blob/main/Sources/Notes/LiveMarkdownEditor.swift): `Sources/Notes/LiveMarkdownEditor.swift`
- [Markdown math and tables](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/MarkdownTable.swift): `Sources/LectureCore/MarkdownTable.swift`
- [Document export and print](https://github.com/0xbiel/notes/blob/main/Sources/Notes/DocumentOutput.swift): `Sources/Notes/DocumentOutput.swift`
- [LaTeX editing](https://github.com/0xbiel/notes/blob/main/Sources/Notes/LaTeXEditor.swift): `Sources/Notes/LaTeXEditor.swift`
- [File and attachment context](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/NotebookLibraryContext.swift): `Sources/LectureCore/NotebookLibraryContext.swift`
- [Notebook file library](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/NotebookFileLibrary.swift): `Sources/LectureCore/NotebookFileLibrary.swift`

### Assistant and providers

- [Notebook assistant](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/NotebookAssistant.swift): `Sources/LectureCore/NotebookAssistant.swift`
- [Web search](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/NotebookWeb.swift): `Sources/LectureCore/NotebookWeb.swift`
- [Provider runtime](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/OpenRouterHarness.swift): `Sources/LectureCore/OpenRouterHarness.swift`
- [Provider configuration](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/ProviderEnvironment.swift): `Sources/LectureCore/ProviderEnvironment.swift`
- [Provider activity events](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/NotebookProviderProgress.swift): `Sources/LectureCore/NotebookProviderProgress.swift`
- [Transcript edit proposals](https://github.com/0xbiel/notes/blob/main/Sources/Notes/AIController.swift): `Sources/Notes/AIController.swift`
- [Proposal outbox](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/AIOutbox.swift): `Sources/LectureCore/AIOutbox.swift`

### Dictation pipeline

- [Microphone capture](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/MicrophoneStream.swift): `Sources/LectureCore/MicrophoneStream.swift`
- [Whisper transcription](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/WhisperTranscriber.swift): `Sources/LectureCore/WhisperTranscriber.swift`
- [Local media preparation](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/LocalMedia.swift): `Sources/LectureCore/LocalMedia.swift`

### Workspace runtime

- [Safe workspace storage](https://github.com/0xbiel/notes/blob/main/Sources/LectureCore/SafeWorkspace.swift): `Sources/LectureCore/SafeWorkspace.swift`

### Other components

- **Notebook user**
- **Configured AI provider**
- **Search and source sites**
- **OpenAI dictation API**

## Connections

- Notebook user → App entry: opens (evidence: `README.md`)
- App entry → Workspace navigation: presents
- Workspace navigation → Notebook and edit history: uses notebooks (evidence: `Sources/Notes/WorkspaceView.swift`)
- Workspace navigation → Notebook and chat views: presents (evidence: `Sources/Notes/WorkspaceView.swift`)
- Notebook and chat views → Assistant controller: routes chat (evidence: `Sources/Notes/NotebookWorkspaceViews.swift`)
- Notebook and chat views → Dictation controller: hosts dictation (evidence: `Sources/Notes/NotebookWorkspaceViews.swift`)
- Notebook user → Markdown editor: writes notes (evidence: `README.md`)
- Markdown editor → Markdown math and tables: renders tables (evidence: `Sources/Notes/LiveMarkdownEditor.swift`)
- Workspace navigation → Markdown editor: opens documents (evidence: `Sources/Notes/WorkspaceView.swift`)
- Notebook user → Document export and print: exports or prints (evidence: `README.md`)
- Notebook user → LaTeX editing: edits TeX (evidence: `README.md`)
- Assistant controller → Notebook assistant: runs requests (evidence: `Sources/LectureCore/NotebookAssistant.swift`)
- Notebook assistant → Notebook and edit history: reads notebook (evidence: `Sources/LectureCore/NotebookAssistant.swift`)
- Notebook assistant → File and attachment context: reads sources (evidence: `Sources/LectureCore/NotebookLibraryContext.swift`)
- Notebook assistant → Provider runtime: calls provider (evidence: `Sources/LectureCore/NotebookAssistant.swift`)
- Notebook assistant → Web search: searches web
- Web search → Search and source sites: queries sources (evidence: `README.md`)
- Provider runtime → Provider configuration: applies settings (evidence: `Sources/LectureCore/OpenRouterHarness.swift`)
- Provider runtime → Provider activity events: streams events (evidence: `Sources/LectureCore/OpenCodeStreamingSession.swift`)
- Provider runtime → Configured AI provider: sends requests (evidence: `README.md`)
- Assistant controller → Notebook file library: imports attachments (evidence: `Sources/Notes/NotebookAssistantController.swift`)
- File and attachment context → Notebook file library: reads library files (evidence: `Sources/LectureCore/NotebookLibraryContext.swift`)
- Notebook user → Dictation controller: dictates (evidence: `README.md`)
- Dictation controller → Microphone capture: captures audio (evidence: `Sources/Notes/MediaController.swift`)
- Dictation controller → Local media preparation: prepares recordings (evidence: `Sources/Notes/MediaController.swift`)
- Dictation controller → Whisper transcription: transcribes audio (evidence: `Sources/Notes/MediaController.swift`)
- Whisper transcription → OpenAI dictation API: sends API audio (evidence: `README.md`)
- Dictation controller → Transcript edit proposals: offers transcript (evidence: `Sources/Notes/AIController.swift`)
- Transcript edit proposals → Proposal outbox: queues proposals (evidence: `Sources/Notes/AIController.swift`)
- Transcript edit proposals → Provider runtime: sends proposals (evidence: `Sources/Notes/AIController.swift`)
- Proposal outbox → Safe workspace storage: persists batches (evidence: `Sources/LectureCore/AIOutbox.swift`)
- Notebook and edit history → Safe workspace storage: saves edits (evidence: `Sources/LectureCore/Notebook.swift`)
- Notebook file library → Safe workspace storage: stores notebook files (evidence: `Sources/LectureCore/NotebookFileLibrary.swift`)
