Update note management from db vector to index
This commit is contained in:
@@ -68,7 +68,6 @@ Preload (contextBridge: window.electronTRPC + window.electronAI)
|
||||
Main Process (Node.js)
|
||||
├── tRPC router (all CRUD + AI procedures)
|
||||
├── SQLite (better-sqlite3 + Drizzle ORM, WAL mode)
|
||||
├── LanceDB (vector embeddings, 1536-dim text-embedding-3-small)
|
||||
└── LangGraph orchestrator (3 specialist agents, pluggable LLM providers)
|
||||
```
|
||||
|
||||
@@ -83,7 +82,7 @@ Main Process (Node.js)
|
||||
- `src/main/ipc.ts` — Custom tRPC↔IPC bridge
|
||||
- `src/main/router/index.ts` — All tRPC routers (~600 LOC)
|
||||
- `src/main/ai/orchestrator.ts` — LangGraph intent routing + 3 agents (~991 LOC)
|
||||
- `src/main/db/schema.ts` — 6 tables (clients, projects, tasks, checkpoints, notes, taskComments)
|
||||
- `src/main/db/schema.ts` — 7 tables (clients, projects, tasks, checkpoints, notes, noteEdits, taskComments)
|
||||
- `src/renderer/routes/` — File-based routing (TanStack Router auto-generates `routeTree.gen.ts`)
|
||||
- `src/renderer/components/ui/` — shadcn/ui primitives (new-york theme, neutral colors)
|
||||
- `src/main/auth/auth-manager.ts` — Login, register, logout, OAuth flow (singleton)
|
||||
@@ -95,10 +94,11 @@ Main Process (Node.js)
|
||||
**Non-obvious details**:
|
||||
- `electron-trpc` NOT used — custom IPC bridge in `ipc.ts` + `ipcLink.ts` because electron-trpc bundles tRPC v10 internals
|
||||
- Vite configs use `.mts` extension to avoid ESM/CJS conflicts with electron-forge
|
||||
- `forge.config.ts` has complex cross-compilation hooks (downloads platform-specific native binaries for better-sqlite3 and LanceDB)
|
||||
- `forge.config.ts` has complex cross-compilation hooks (downloads platform-specific native binaries for better-sqlite3)
|
||||
- DB has no foreign key constraints — cascade deletes in tRPC procedures
|
||||
- Timestamps are milliseconds (`Date.getTime()`), not ISO strings
|
||||
- Notes auto-embed to LanceDB on create/update (fire-and-forget, errors swallowed)
|
||||
- Notes use `aiSummary` index (≤250 char, backend gpt-4o-mini) for AI navigation — LanceDB fully removed
|
||||
- AI note edits go through `noteEdits` HITL table; AI calls `propose_note_edit`, user approves/rejects in UI
|
||||
|
||||
**Settings Page (shared Electron + Web)**:
|
||||
- Settings page runs in **both** Electron and standalone web SPA (future landing-page portal). Same React components — no duplication.
|
||||
|
||||
Reference in New Issue
Block a user