How triggeredcode/lucid works
Lucid is a local-first desktop app for turning dictated or typed thoughts into structured notes, diagrams, tables, and PDFs. The main flow is input through the page workspace, local-model interpretation, structured document changes, and history-backed editing. Separate branches cover guided diagram/table building, note management and export, and the optional MCP agent interface. The README documents user-visible capabilities; source-index references and excerpts support only some internal calls, so uncertain runtime links are omitted or marked unverified.
Main entry points: commandPipeline.ts Command pipeline · Workspace.tsx Page workspace · compile.ts Document operations · index.ts Desktop services
Components 22
Desktop app
- Page workspace
apps/desktop/src/pages/Workspace.tsx - Page editor
apps/desktop/src/editor/PageEditor.tsx - Page management
apps/desktop/src/pages/usePages.ts - Settings
apps/desktop/src/settings/SettingsDialog.tsx - Guided builder
apps/desktop/src/guided/useBuilder.ts - Desktop services
apps/desktop/electron/ipc/index.ts - Note files
apps/desktop/electron/library.ts
Interpretation
- Local model client
packages/llm/src/client.ts - Command pipeline
packages/llm/src/commandPipeline.ts - Command prompts
packages/llm/src/prompts/command.ts
Document model
- Graph operations
packages/core/src/model/graphOps.ts - Diagram builder logic
packages/core/src/guided/diagram.ts - Document model
packages/core/src/model/graph.ts - Document operations
packages/kit/src/ops/compile.ts
Formats and output
- Lucid Markdown
packages/kit/src/lmd/parse.ts - PDF export
apps/desktop/electron/pdf.ts
Agent access
- MCP server
packages/mcp/src/server.ts - Agent tools
packages/mcp/src/tools.ts - Agent backend
packages/mcp/src/backend.ts
Other components
- Voice or keyboard user
- External AI agent
- LM Studio
Connections 18
- Voice or keyboard user → Page workspace: dictates or types
README.md - Page workspace → Local model client: sends page context
- Command pipeline → Command prompts: builds messages
packages/llm/src/commandPipeline.ts - Command pipeline → Local model client: requests completion
packages/llm/src/commandPipeline.ts - Local model client → LM Studio: calls local model
README.md - Command pipeline → Document operations: compiles proposed edits
packages/llm/src/commandPipeline.ts - Document operations → Lucid Markdown: parses note text
packages/kit/src/ops/compile.ts - Document operations → Document model: diffs document
packages/kit/src/ops/compile.ts - Guided builder → Diagram builder logic: edits diagram draft
packages/core/src/guided/diagram.ts - Guided builder → Command pipeline: runs commands
apps/desktop/src/guided/useBuilder.ts - Page editor → Page workspace: edits page
- Page management → Desktop services: loads and saves pages
- Desktop services → Note files: manages note files
- Settings → Desktop services: configures app services
- Page workspace → PDF export: exports PDF
- External AI agent → MCP server: connects to tools
packages/mcp/src/server.ts - MCP server → Agent tools: registers tools
packages/mcp/src/server.ts - Agent tools → Agent backend: runs page actions