open-mem 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +73 -6
  3. package/dist/adapters/http/server.d.ts.map +1 -1
  4. package/dist/adapters/mcp/server.d.ts.map +1 -1
  5. package/dist/adapters/opencode/tools.d.ts.map +1 -1
  6. package/dist/ai/compressor.d.ts +1 -0
  7. package/dist/ai/compressor.d.ts.map +1 -1
  8. package/dist/ai/conflict-evaluator.d.ts +1 -0
  9. package/dist/ai/conflict-evaluator.d.ts.map +1 -1
  10. package/dist/ai/entity-extractor.d.ts +1 -0
  11. package/dist/ai/entity-extractor.d.ts.map +1 -1
  12. package/dist/ai/errors.d.ts +14 -0
  13. package/dist/ai/errors.d.ts.map +1 -0
  14. package/dist/ai/fallback.d.ts +26 -0
  15. package/dist/ai/fallback.d.ts.map +1 -0
  16. package/dist/ai/prompts.d.ts +3 -2
  17. package/dist/ai/prompts.d.ts.map +1 -1
  18. package/dist/ai/provider.d.ts +4 -0
  19. package/dist/ai/provider.d.ts.map +1 -1
  20. package/dist/ai/summarizer.d.ts +1 -0
  21. package/dist/ai/summarizer.d.ts.map +1 -1
  22. package/dist/claude-code.js +75 -68
  23. package/dist/config.d.ts.map +1 -1
  24. package/dist/contracts/api.d.ts +3 -0
  25. package/dist/contracts/api.d.ts.map +1 -1
  26. package/dist/core/contracts.d.ts +3 -0
  27. package/dist/core/contracts.d.ts.map +1 -1
  28. package/dist/core/memory-engine.d.ts +3 -0
  29. package/dist/core/memory-engine.d.ts.map +1 -1
  30. package/dist/cursor.js +75 -68
  31. package/dist/daemon.js +45 -38
  32. package/dist/db/observations.d.ts +2 -0
  33. package/dist/db/observations.d.ts.map +1 -1
  34. package/dist/hooks/compaction.d.ts +5 -1
  35. package/dist/hooks/compaction.d.ts.map +1 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +111 -100
  38. package/dist/maintenance.js +44 -32
  39. package/dist/mcp.js +56 -44
  40. package/dist/modes/loader.d.ts +7 -0
  41. package/dist/modes/loader.d.ts.map +1 -0
  42. package/dist/store/ports.d.ts +1 -0
  43. package/dist/store/ports.d.ts.map +1 -1
  44. package/dist/types.d.ts +12 -0
  45. package/dist/types.d.ts.map +1 -1
  46. package/dist/utils/agents-md.d.ts.map +1 -1
  47. package/package.json +11 -7
package/CHANGELOG.md CHANGED
@@ -5,6 +5,35 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.11.0] - 2026-02-08
9
+
10
+ ### Added
11
+ - **Pluggable workflow modes** — JSON-based mode definitions that customize observation types, concept vocabulary, entity types, and AI prompt templates. Ships with `code` (default) and `research` modes. Configure via `OPEN_MEM_MODE` env var. New `/v1/workflow-modes` API endpoint.
12
+ - **Enhanced session compaction** — compaction hook now injects compressed recent observation narratives, facts, and key decisions with smart budget allocation (40% summaries/index, 40% observation details, 20% decisions). Graceful degradation when full observations unavailable.
13
+ - **VitePress documentation website** — 11-page docs site covering getting started, architecture, tools reference, search guide, configuration, platforms, privacy, API, troubleshooting, and changelog. Build with `bun run docs:build`.
14
+ - **Dashboard documentation** in README — "Web Dashboard" section describing all 6 pages (Timeline, Sessions, Search, Stats, Operations, Settings) with enable/access instructions.
15
+ - **"Why open-mem?" section** in README — competitive positioning highlighting native vector search, knowledge graph, 5 AI providers, revision lineage, and MIT license.
16
+ - **Feature highlights comparison table** in README — side-by-side comparison vs typical alternatives.
17
+
18
+ ### Fixed
19
+ - CI platform worker tests now use portable bun path and project root.
20
+
21
+ ## [0.10.0] - 2026-02-08
22
+
23
+ ### Added
24
+ - **OpenRouter provider support** — access 100+ models via `OPEN_MEM_PROVIDER=openrouter` + `OPENROUTER_API_KEY`. Auto-detected from env vars, default model `google/gemini-2.5-flash-lite`. Embeddings correctly return null (OpenRouter doesn't support them).
25
+ - **Provider fallback chain** — automatic failover when primary AI provider returns retryable errors (429/500/503). Configure with `OPEN_MEM_FALLBACK_PROVIDERS=google,anthropic,openai`. Config errors (400/401/403) throw immediately without fallback. Applies only to language models, never to embeddings.
26
+ - **Timeline anchor navigation** — `mem-history` tool now accepts `anchor` (observation ID), `depthBefore`, and `depthAfter` parameters for cross-session chronological navigation around a specific observation.
27
+ - `src/ai/errors.ts` — shared `isRetryable()`, `isConfigError()`, and `sleep()` utilities extracted from 3 duplicated locations.
28
+ - `src/ai/fallback.ts` — `FallbackLanguageModel` wrapper implementing Vercel AI SDK `LanguageModel` interface with try→fail→next semantics.
29
+ - `@openrouter/ai-sdk-provider` dependency for OpenRouter integration.
30
+
31
+ ### Changed
32
+ - All AI consumers (compressor, summarizer, entity-extractor, conflict-evaluator, reranker) now use `createModelWithFallback()` instead of `createModel()` — transparent fallback when configured.
33
+ - `AGENTS.md` generation now includes observation IDs, key concepts, and decision summaries in tables.
34
+ - `mem-create` tool description improved for clarity.
35
+ - Context injection now includes "When to Save" guidance with `mem-create` reference.
36
+
8
37
  ## [0.7.0] - 2026-02-08
9
38
 
10
39
  ### Added (Interop & Ops)
package/README.md CHANGED
@@ -64,10 +64,30 @@ export OPENAI_API_KEY=sk-...
64
64
  export OPEN_MEM_MODEL=gpt-4o
65
65
  ```
66
66
 
67
- **Auto-detection:** open-mem detects your provider from environment variables: `GOOGLE_GENERATIVE_AI_API_KEY` → Google, `ANTHROPIC_API_KEY` → Anthropic, AWS credentials → Bedrock.
67
+ **OpenRouter (100+ models):**
68
+ ```bash
69
+ export OPEN_MEM_PROVIDER=openrouter
70
+ export OPENROUTER_API_KEY=sk-or-...
71
+ export OPEN_MEM_MODEL=google/gemini-2.5-flash-lite
72
+ ```
73
+
74
+ **Auto-detection:** open-mem detects your provider from environment variables: `GOOGLE_GENERATIVE_AI_API_KEY` → Google, `ANTHROPIC_API_KEY` → Anthropic, AWS credentials → Bedrock, `OPENROUTER_API_KEY` → OpenRouter.
68
75
 
69
76
  Without any provider configured, open-mem still works — it falls back to a basic metadata extractor that captures tool names, file paths, and output snippets.
70
77
 
78
+ ## Why open-mem?
79
+
80
+ - **Native vector search** — sqlite-vec embedded directly in SQLite, no external vector database required
81
+ - **Knowledge graph** — automatic entity extraction with relationships, graph-augmented search via traversal
82
+ - **5 AI providers + fallback chain** — Google, Anthropic, AWS Bedrock, OpenAI, OpenRouter with automatic failover
83
+ - **Advanced search** — FTS5 full-text + vector similarity + Reciprocal Rank Fusion + graph traversal + reranking
84
+ - **Revision lineage** — immutable history with audit trail; revisions never overwrite, they supersede
85
+ - **User-level memory** — cross-project memories stored in a separate user-scoped database
86
+ - **Web dashboard** — 6-page management UI with real-time SSE streaming and config control plane
87
+ - **Multi-platform** — native adapters for OpenCode, Claude Code, and Cursor
88
+ - **MIT license** — enterprise-friendly, no AGPL restrictions
89
+ - **Well-tested** — 71 test files covering core logic, adapters, and integration scenarios
90
+
71
91
  ## Key Features
72
92
 
73
93
  - 🧠 **Automatic observation capture** from tool executions and user prompts
@@ -77,8 +97,11 @@ Without any provider configured, open-mem still works — it falls back to a bas
77
97
  - 🔒 **Privacy controls** with `<private>` tag support
78
98
  - 🛠️ **Nine custom tools**: memory.find, memory.create, memory.history, memory.get, memory.transfer.export, memory.transfer.import, memory.revise, memory.remove, memory.help
79
99
  - 🌐 **MCP server mode** — expose memory tools to any MCP-compatible AI client
100
+ - 🔗 **Knowledge graph** — entity extraction with relationships, graph-augmented search
101
+ - 🔄 **Multi-platform** — native adapters for OpenCode, Claude Code, and Cursor
80
102
  - 🌳 **Git worktree support** — shared memory across all worktrees
81
103
  - 📂 **AGENTS.md generation** — auto-generated folder-level context on session end
104
+ - 📊 **Web dashboard** — 6-page management UI with real-time streaming
82
105
  - 📦 **Import/export** — portable JSON for backup and transfer between machines
83
106
  - ⚡ **Zero-config setup** — works out of the box
84
107
  - 📁 **All data stored locally** in your project directory
@@ -190,6 +213,29 @@ Configure via `OPEN_MEM_FOLDER_CONTEXT_MODE=single` or `OPEN_MEM_FOLDER_CONTEXT_
190
213
 
191
214
  The context injector includes a "Memory Economics" footer showing how much context compression saves: read cost vs. original discovery cost, with a savings percentage. This helps you understand the value of AI compression at a glance.
192
215
 
216
+ ## Web Dashboard
217
+
218
+ open-mem includes a built-in web dashboard for memory management and observability. It provides six pages:
219
+
220
+ | Page | Description |
221
+ |------|-------------|
222
+ | **Timeline** | Chronological view of all observations with type filtering |
223
+ | **Sessions** | Browse past coding sessions and their observations |
224
+ | **Search** | Full-text and semantic search across all memories |
225
+ | **Stats** | Database statistics, observation counts, and memory economics |
226
+ | **Operations** | Queue status, maintenance actions, folder context management |
227
+ | **Settings** | Config control plane with live preview, mode presets, and audit log |
228
+
229
+ ### Enable the Dashboard
230
+
231
+ ```bash
232
+ export OPEN_MEM_DASHBOARD=true
233
+ ```
234
+
235
+ Access at `http://localhost:3737` (configurable via `OPEN_MEM_DASHBOARD_PORT`). The dashboard streams real-time updates via Server-Sent Events — new observations appear as they are captured.
236
+
237
+ The [Config Control Plane](#config-control-plane) is accessible through the Settings page, allowing you to preview, apply, and roll back configuration changes without restarting.
238
+
193
239
  ## Custom Tools
194
240
 
195
241
  ### memory.find
@@ -216,12 +262,15 @@ Manually save an important observation to memory.
216
262
 
217
263
  ### memory.history
218
264
 
219
- View a timeline of past coding sessions for the current project.
265
+ View a timeline of past coding sessions, or center the view around a specific observation for cross-session navigation.
220
266
 
221
267
  | Argument | Type | Required | Description |
222
268
  |----------|------|----------|-------------|
223
269
  | `limit` | number | no | Number of recent sessions (1–20, default: 5) |
224
270
  | `sessionId` | string | no | Show details for a specific session |
271
+ | `anchor` | string | no | Observation ID to center the timeline around (cross-session view) |
272
+ | `depthBefore` | number | no | Observations to show before anchor (0–20, default: 5) |
273
+ | `depthAfter` | number | no | Observations to show after anchor (0–20, default: 5) |
225
274
 
226
275
  ### memory.get
227
276
 
@@ -310,9 +359,9 @@ Lifecycle behavior:
310
359
  - `notifications/initialized` is supported
311
360
  - strict mode requires initialize before `tools/list`/`tools/call`
312
361
 
313
- ## Platform Adapter Workers (Claude Code / Cursor)
362
+ ## Platform Adapters (Claude Code / Cursor)
314
363
 
315
- open-mem now includes dedicated adapter workers that ingest JSON events over stdin:
364
+ open-mem works beyond OpenCode. Dedicated adapter workers bring the same memory capabilities to Claude Code and Cursor, ingesting JSON events over stdin:
316
365
 
317
366
  ```bash
318
367
  # Claude Code adapter worker
@@ -384,10 +433,12 @@ open-mem works out of the box with zero configuration. All settings can be custo
384
433
 
385
434
  | Variable | Default | Description |
386
435
  |----------|---------|-------------|
387
- | `OPEN_MEM_PROVIDER` | `google` | AI provider: `google`, `anthropic`, `bedrock`, `openai` |
436
+ | `OPEN_MEM_PROVIDER` | `google` | AI provider: `google`, `anthropic`, `bedrock`, `openai`, `openrouter` |
388
437
  | `GOOGLE_GENERATIVE_AI_API_KEY` | — | API key for Google Gemini provider ([free](https://aistudio.google.com/apikey)) |
389
438
  | `ANTHROPIC_API_KEY` | — | API key for Anthropic provider |
390
439
  | `OPENAI_API_KEY` | — | API key for OpenAI provider |
440
+ | `OPENROUTER_API_KEY` | — | API key for OpenRouter provider |
441
+ | `OPEN_MEM_FALLBACK_PROVIDERS` | — | Comma-separated fallback providers (e.g., `google,anthropic,openai`) |
391
442
  | `OPEN_MEM_DB_PATH` | `.open-mem/memory.db` | Path to SQLite database |
392
443
  | `OPEN_MEM_MODEL` | `gemini-2.5-flash-lite` | Model for AI compression |
393
444
  | `OPEN_MEM_MAX_CONTEXT_TOKENS` | `4000` | Token budget for injected context |
@@ -411,6 +462,8 @@ open-mem works out of the box with zero configuration. All settings can be custo
411
462
  | `OPEN_MEM_MCP_COMPAT_MODE` | `strict` | MCP mode: `strict` or `legacy` |
412
463
  | `OPEN_MEM_MCP_PROTOCOL_VERSION` | `2024-11-05` | Preferred MCP protocol version |
413
464
  | `OPEN_MEM_MCP_SUPPORTED_PROTOCOLS` | `2024-11-05` | Comma-separated supported protocol versions |
465
+ | `OPEN_MEM_DASHBOARD` | `false` | Set to `true` to enable the web dashboard |
466
+ | `OPEN_MEM_DASHBOARD_PORT` | `3737` | Dashboard HTTP port |
414
467
 
415
468
  <details>
416
469
  <summary><strong>Programmatic Configuration Reference</strong></summary>
@@ -420,7 +473,7 @@ If you need to configure open-mem programmatically (e.g. for testing or custom i
420
473
  | Option | Type | Default | Description |
421
474
  |--------|------|---------|-------------|
422
475
  | `dbPath` | string | `.open-mem/memory.db` | SQLite database file path |
423
- | `provider` | string | `google` | AI provider: `google`, `anthropic`, `bedrock`, `openai` |
476
+ | `provider` | string | `google` | AI provider: `google`, `anthropic`, `bedrock`, `openai`, `openrouter` |
424
477
  | `apiKey` | string | `undefined` | Provider API key |
425
478
  | `model` | string | `gemini-2.5-flash-lite` | Model for compression |
426
479
  | `maxTokensPerCompression` | number | `1024` | Max tokens per compression response |
@@ -440,6 +493,7 @@ If you need to configure open-mem programmatically (e.g. for testing or custom i
440
493
  | `folderContextMaxDepth` | number | `5` | Max folder depth from project root |
441
494
  | `folderContextMode` | string | `dispersed` | Context file mode: `dispersed` (per-folder) or `single` (one root file) |
442
495
  | `folderContextFilename` | string | `AGENTS.md` | Filename for context files (e.g. `CLAUDE.md` for Claude Code) |
496
+ | `fallbackProviders` | string[] | `undefined` | Comma-separated provider names for automatic failover (e.g., `["google","anthropic"]`) |
443
497
 
444
498
  </details>
445
499
 
@@ -543,6 +597,19 @@ export OPEN_MEM_MAX_CONTEXT_TOKENS=2000
543
597
  - [Getting Started](docs/getting-started.md) — installation, configuration, and first steps
544
598
  - [Architecture](docs/architecture.md) — internal design, data flow, and source layout
545
599
 
600
+ ## Feature Highlights
601
+
602
+ | Feature | open-mem | Typical alternatives |
603
+ |---------|----------|---------------------|
604
+ | Vector search | Native (sqlite-vec) | External service (Chroma) |
605
+ | AI providers | 5 with fallback chain | 1–3 |
606
+ | Search | FTS5 + Vector + RRF + Graph | FTS5 only |
607
+ | Knowledge graph | Entities + relationships | No |
608
+ | Revision history | Immutable lineage | No |
609
+ | Dashboard | 6-page web UI with SSE | No |
610
+ | License | MIT | AGPL / proprietary |
611
+ | Data locality | Project-local `.open-mem/` | Global |
612
+
546
613
  ## Contributing
547
614
 
548
615
  See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, code style, and submission guidelines.
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/adapters/http/server.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAS5B,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,aAAa,CAAC;AAElE,MAAM,WAAW,aAAa;IAC7B,MAAM,EAAE,aAAa,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,YAAY,EAAE,YAAY,CAAC;IAC3B,qBAAqB,CAAC,EAAE,MAAM,qBAAqB,CAAC;IACpD,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAoCD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,CA0e5D"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/adapters/http/server.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC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BAE7B,IAAI,EAAE,aAAa;IAW/B,KAAK,IAAI,IAAI;IA0Bb,OAAO,CAAC,MAAM;IA8Cd,OAAO,CAAC,gBAAgB;IAmCxB,OAAO,CAAC,kBAAkB;YAgEZ,cAAc;YA8Cd,WAAW;IA8IzB,OAAO,CAAC,IAAI;CAGZ"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/adapters/mcp/server.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAgCzD,MAAM,WAAW,aAAa;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC;CACrC;AAkCD,qBAAa,SAAS;IACrB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAsB;IACxD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAW;IACrD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,UAAU,CAAuB;gBAE7B,IAAI,EAAE,aAAa;IAW/B,KAAK,IAAI,IAAI;IA0Bb,OAAO,CAAC,MAAM;IA8Cd,OAAO,CAAC,gBAAgB;IAmCxB,OAAO,CAAC,kBAAkB;YAgEZ,cAAc;YA8Cd,WAAW;IAiJzB,OAAO,CAAC,IAAI;CAGZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/adapters/opencode/tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAC;AAuBhE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA2JxF"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/adapters/opencode/tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAC;AAuBhE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAiKxF"}
@@ -9,6 +9,7 @@ export interface CompressorConfig {
9
9
  compressionEnabled: boolean;
10
10
  minOutputLength: number;
11
11
  rateLimitingEnabled: boolean;
12
+ fallbackProviders?: string[];
12
13
  }
13
14
  /**
14
15
  * Compresses raw tool output into structured observations using the
@@ -1 +1 @@
1
- {"version":3,"file":"compressor.d.ts","sourceRoot":"","sources":["../../src/ai/compressor.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAsB,MAAM,IAAI,CAAC;AACtD,OAAO,EAAkB,KAAK,iBAAiB,EAA4B,MAAM,UAAU,CAAC;AAS5F,uDAAuD;AACvD,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB,EAAE,MAAM,CAAC;IAChC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;CAC7B;AAMD;;;;GAIG;AACH,qBAAa,qBAAqB;IACjC,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,MAAM,CAAmB;IAGjC,SAAS,sBAAgB;gBAEb,MAAM,EAAE,gBAAgB;IAsBp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mB;IAGjC,SAAS,sBAAgB;gBAEb,MAAM,EAAE,gBAAgB;IAyBpC,+DAA+D;IAC/D,MAAM,CAAC,QAAQ,CAAC,gBAAgB,SAAU;IAE1C;;;;OAIG;IACG,QAAQ,CACb,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAqDpC;;;OAGG;IACG,aAAa,CAClB,KAAK,EAAE,aAAa,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,cAAc,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC,GACA,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAqBjD;;;OAGG;IACH,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,iBAAiB;IAuB5E,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;CAarC"}
@@ -11,6 +11,7 @@ export interface ConflictEvaluatorConfig {
11
11
  apiKey: string | undefined;
12
12
  model: string;
13
13
  rateLimitingEnabled: boolean;
14
+ fallbackProviders?: string[];
14
15
  }
15
16
  /**
16
17
  * Uses an LLM to determine whether a new observation conflicts with,
@@ -1 +1 @@
1
- {"version":3,"file":"conflict-evaluator.d.ts","sourceRoot":"","sources":["../../src/ai/conflict-evaluator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,MAAM,IAAI,CAAC;AACtD,OAAO,EAAE,KAAK,kBAAkB,EAAmC,MAAM,UAAU,CAAC;AACpF,OAAO,EAEN,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,MAAM,WAAW,CAAC;AAInB,6CAA6C;AAC7C,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,CAAC;AAC9E,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AC7B,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,MAAM,CAA0B;IAExC,SAAS,sBAAgB;gBAEb,MAAM,EAAE,uBAAuB;IAqB3C;;;OAGG;IACG,QAAQ,CACb,MAAM,EAAE,sBAAsB,EAC9B,UAAU,EAAE,aAAa,CAAC,iBAAiB,CAAC,GAC1C,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;CAgCrC"}
@@ -11,6 +11,7 @@ export interface EntityExtractorConfig {
11
11
  apiKey: string | undefined;
12
12
  model: string;
13
13
  rateLimitingEnabled: boolean;
14
+ fallbackProviders?: string[];
14
15
  }
15
16
  /**
16
17
  * Uses an LLM to extract entities (technologies, libraries, patterns) and
@@ -1 +1 @@
1
- {"version":3,"file":"entity-extractor.d.ts","sourceRoot":"","sources":["../../src/ai/entity-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,MAAM,IAAI,CAAC;AACtD,OAAO,EAAE,KAAK,sBAAsB,EAAiC,MAAM,UAAU,CAAC;AACtF,OAAO,EAA+B,KAAK,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAI1F,kDAAkD;AAClD,YAAY,EAAE,sBAAsB,IAAI,sBAAsB,EAAE,2BAA2B,EAAE,CAAC;AAC9F,6CAA6C;AAC7C,YAAY,EACX,UAAU,EACV,YAAY,IAAI,eAAe,EAC/B,cAAc,IAAI,iBAAiB,EACnC,gBAAgB,GAChB,MAAM,UAAU,CAAC;AAElB,yDAAyD;AACzD,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,OAAO,CAAC;CAC7B;AAED;;;GAGG;AACH,qBAAa,eAAe;IAC3B,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,MAAM,CAAwB;IAEtC,SAAS,sBAAgB;gBAEb,MAAM,EAAE,qBAAqB;IAkBzC;;;OAGG;IACG,OAAO,CAAC,WAAW,EAAE,2BAA2B,GAAG,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;CAgC/F"}
1
+ {"version":3,"file":"entity-extractor.d.ts","sourceRoot":"","sources":["../../src/ai/entity-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,MAAM,IAAI,CAAC;AAEtD,OAAO,EAAE,KAAK,sBAAsB,EAAiC,MAAM,UAAU,CAAC;AACtF,OAAO,EAA+B,KAAK,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAI1F,kDAAkD;AAClD,YAAY,EAAE,sBAAsB,IAAI,sBAAsB,EAAE,2BAA2B,EAAE,CAAC;AAC9F,6CAA6C;AAC7C,YAAY,EACX,UAAU,EACV,YAAY,IAAI,eAAe,EAC/B,cAAc,IAAI,iBAAiB,EACnC,gBAAgB,GAChB,MAAM,UAAU,CAAC;AAElB,yDAAyD;AACzD,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;GAGG;AACH,qBAAa,eAAe;IAC3B,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,MAAM,CAAwB;IAEtC,SAAS,sBAAgB;gBAEb,MAAM,EAAE,qBAAqB;IAqBzC;;;OAGG;IACG,OAAO,CAAC,WAAW,EAAE,2BAA2B,GAAG,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;CAgC/F"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Check if an error is retryable (429/500/503 or overloaded).
3
+ */
4
+ export declare function isRetryable(error: unknown): boolean;
5
+ /**
6
+ * Check if an error is a config error that should NOT trigger fallback.
7
+ * Returns true for 400/401/403 errors.
8
+ */
9
+ export declare function isConfigError(error: unknown): boolean;
10
+ /**
11
+ * Sleep utility for retry delays.
12
+ */
13
+ export declare function sleep(ms: number): Promise<void>;
14
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/ai/errors.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAcnD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQrD;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C"}
@@ -0,0 +1,26 @@
1
+ import type { LanguageModelV2, LanguageModelV3 } from "@ai-sdk/provider";
2
+ /** Concrete model type (excludes string model IDs from the LanguageModel union). */
3
+ type ConcreteLanguageModel = LanguageModelV2 | LanguageModelV3;
4
+ export interface FallbackProvider {
5
+ name: string;
6
+ model: ConcreteLanguageModel;
7
+ }
8
+ /**
9
+ * Wraps multiple LanguageModel instances and automatically fails over to
10
+ * backup providers when the primary returns retryable errors (429/500/503).
11
+ *
12
+ * Config errors (400/401/403) are thrown immediately — they indicate
13
+ * misconfiguration, not transient failures.
14
+ */
15
+ export declare class FallbackLanguageModel {
16
+ readonly specificationVersion: string;
17
+ readonly provider: string;
18
+ readonly modelId: string;
19
+ readonly supportedUrls: ConcreteLanguageModel["supportedUrls"];
20
+ private providers;
21
+ constructor(providers: FallbackProvider[]);
22
+ doGenerate(options: unknown): Promise<unknown>;
23
+ doStream(options: unknown): Promise<unknown>;
24
+ }
25
+ export {};
26
+ //# sourceMappingURL=fallback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fallback.d.ts","sourceRoot":"","sources":["../../src/ai/fallback.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAOzE,oFAAoF;AACpF,KAAK,qBAAqB,GAAG,eAAe,GAAG,eAAe,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,qBAAqB,CAAC;CAC7B;AAMD;;;;;;GAMG;AACH,qBAAa,qBAAqB;IACjC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,aAAa,EAAE,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAE/D,OAAO,CAAC,SAAS,CAAqB;gBAE1B,SAAS,EAAE,gBAAgB,EAAE;IAiBnC,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAkC9C,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CA6BlD"}
@@ -1,8 +1,9 @@
1
+ import type { ModeConfig } from "../types";
1
2
  /**
2
3
  * Build a prompt that instructs the AI to compress raw tool output into a
3
4
  * structured observation (type, title, facts, narrative, concepts, files).
4
5
  */
5
- export declare function buildCompressionPrompt(toolName: string, toolOutput: string, sessionContext?: string): string;
6
+ export declare function buildCompressionPrompt(toolName: string, toolOutput: string, sessionContext?: string, modeConfig?: ModeConfig): string;
6
7
  /**
7
8
  * Build a prompt that instructs the AI to produce a session summary from
8
9
  * a list of observations.
@@ -46,7 +47,7 @@ export interface EntityExtractionObservation {
46
47
  * Build a prompt that instructs the AI to extract entities and relationships
47
48
  * from an observation.
48
49
  */
49
- export declare function buildEntityExtractionPrompt(obs: EntityExtractionObservation): string;
50
+ export declare function buildEntityExtractionPrompt(obs: EntityExtractionObservation, modeConfig?: ModeConfig): string;
50
51
  /**
51
52
  * Build a prompt that instructs the AI to reorder search result candidates
52
53
  * by relevance to the query.
@@ -1 +1 @@
1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;AAUD,4DAA4D;AAC5D,MAAM,WAAW,2BAA2B;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAC1C,GAAG,EAAE,2BAA2B,EAChC,UAAU,CAAC,EAAE,UAAU,GACrB,MAAM,CAuCR;AAMD;;;GAGG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,aAAa,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,GAC7D,MAAM,CAuBR"}
@@ -22,4 +22,8 @@ export declare function createModel(config: ModelConfig): LanguageModel;
22
22
  * Returns null for providers that don't support embeddings (e.g., Anthropic).
23
23
  */
24
24
  export declare function createEmbeddingModel(config: ModelConfig): EmbeddingModel | null;
25
+ export declare function buildFallbackConfigs(config: {
26
+ fallbackProviders?: string[];
27
+ }): ModelConfig[];
28
+ export declare function createModelWithFallback(primaryConfig: ModelConfig, fallbackConfigs?: ModelConfig[]): LanguageModel;
25
29
  //# sourceMappingURL=provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/ai/provider.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAMxD,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAElF,uDAAuD;AACvD,MAAM,WAAW,WAAW;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAcD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGzD;AAMD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa,CA6B9D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,cAAc,GAAG,IAAI,CA0B/E"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/ai/provider.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAOxD,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAElF,uDAAuD;AACvD,MAAM,WAAW,WAAW;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAcD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGzD;AAMD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa,CAkC9D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,cAAc,GAAG,IAAI,CA4B/E;AA+BD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,WAAW,EAAE,CAU5F;AAED,wBAAgB,uBAAuB,CACtC,aAAa,EAAE,WAAW,EAC1B,eAAe,GAAE,WAAW,EAAO,GACjC,aAAa,CAYf"}
@@ -9,6 +9,7 @@ export interface SummarizerConfig {
9
9
  maxTokensPerCompression: number;
10
10
  compressionEnabled: boolean;
11
11
  rateLimitingEnabled: boolean;
12
+ fallbackProviders?: string[];
12
13
  }
13
14
  /**
14
15
  * Generates a concise summary of a coding session from its observations.
@@ -1 +1 @@
1
- {"version":3,"file":"summarizer.d.ts","sourceRoot":"","sources":["../../src/ai/summarizer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAsB,MAAM,IAAI,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,aAAa,EAAwB,MAAM,UAAU,CAAC;AASpE,mDAAmD;AACnD,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB,EAAE,MAAM,CAAC;IAChC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;CAC7B;AAMD;;;GAGG;AACH,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,MAAM,CAAmB;IAGjC,SAAS,sBAAgB;gBAEb,MAAM,EAAE,gBAAgB;IAsBpC;;;;OAIG;IACG,SAAS,CACd,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,aAAa,CAAC,WAAW,CAAC,GACtC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAyChC;;OAEG;IACH,qBAAqB,CAAC,YAAY,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,aAAa;IAqC9E,yEAAyE;IACzE,eAAe,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO;CAGlD"}
1
+ {"version":3,"file":"summarizer.d.ts","sourceRoot":"","sources":["../../src/ai/summarizer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAsB,MAAM,IAAI,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;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