clawvault 3.2.1 → 3.4.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 (161) hide show
  1. package/README.md +56 -16
  2. package/bin/clawvault.js +0 -2
  3. package/bin/command-registration.test.js +15 -2
  4. package/bin/help-contract.test.js +16 -0
  5. package/bin/register-core-commands.js +88 -0
  6. package/bin/register-core-commands.test.js +80 -0
  7. package/bin/register-maintenance-commands.js +84 -7
  8. package/bin/register-query-commands.js +45 -28
  9. package/bin/register-query-commands.test.js +15 -0
  10. package/bin/test-helpers/cli-command-fixtures.js +1 -0
  11. package/dist/chunk-2PKBIKDH.js +130 -0
  12. package/dist/{chunk-U67V476Y.js → chunk-2ZDO52B4.js} +18 -1
  13. package/dist/{chunk-ZZA73MFY.js → chunk-33DOSHTA.js} +176 -36
  14. package/dist/chunk-35JCYSRR.js +158 -0
  15. package/dist/{chunk-AZYOKJYC.js → chunk-4PY655YM.js} +13 -1
  16. package/dist/{chunk-2JQ3O2YL.js → chunk-5EFSWZO6.js} +3 -3
  17. package/dist/{chunk-Y3TIJEBP.js → chunk-7SWP5FKU.js} +34 -613
  18. package/dist/{chunk-4VQTUVH7.js → chunk-7YZWHM36.js} +52 -26
  19. package/dist/{chunk-URXDAUVH.js → chunk-AXSJIFOJ.js} +174 -1
  20. package/dist/{chunk-4ITRXIVT.js → chunk-BLQXXX7Q.js} +6 -6
  21. package/dist/chunk-CSHO3PJB.js +684 -0
  22. package/dist/chunk-D5U3Q4N5.js +872 -0
  23. package/dist/chunk-DCF4KMFD.js +158 -0
  24. package/dist/{chunk-S5OJEGFG.js → chunk-DOIUYIXV.js} +2 -2
  25. package/dist/{chunk-YXQCA6B7.js → chunk-DVOUSOR3.js} +112 -7
  26. package/dist/{chunk-YDWHS4LJ.js → chunk-ECGJYWNA.js} +205 -33
  27. package/dist/{chunk-QMHPQYUV.js → chunk-EL6UBSX5.js} +7 -6
  28. package/dist/chunk-FZ5I2NF7.js +352 -0
  29. package/dist/{chunk-WJVWINEM.js → chunk-GFCHWMGD.js} +55 -6
  30. package/dist/{chunk-GNJL4YGR.js → chunk-GJO3CFUN.js} +30 -6
  31. package/dist/chunk-H3JZIB5O.js +322 -0
  32. package/dist/chunk-HEHO7SMV.js +51 -0
  33. package/dist/{chunk-UCQAOZHW.js → chunk-HGDDW24U.js} +3 -3
  34. package/dist/chunk-J3YUXVID.js +907 -0
  35. package/dist/{chunk-Y6VJKXGL.js → chunk-KCYWJDDW.js} +1 -1
  36. package/dist/{chunk-P5EPF6MB.js → chunk-MW5C6ZQA.js} +110 -13
  37. package/dist/chunk-NSXYM6EZ.js +255 -0
  38. package/dist/{chunk-YNIPYN4F.js → chunk-OFOCU2V4.js} +6 -5
  39. package/dist/{chunk-42MXU7A6.js → chunk-P62WHA27.js} +58 -47
  40. package/dist/chunk-PTWPPVC7.js +972 -0
  41. package/dist/{chunk-FAKNOB7Y.js → chunk-QFWERBDP.js} +2 -2
  42. package/dist/chunk-QYQAGBTM.js +2097 -0
  43. package/dist/chunk-RL2L6I6K.js +223 -0
  44. package/dist/{chunk-IIOU45CK.js → chunk-S7N7HI5E.js} +2 -2
  45. package/dist/{chunk-ECRZL5XR.js → chunk-T7E764W3.js} +23 -7
  46. package/dist/{chunk-MNPUYCHQ.js → chunk-TWMI3SNN.js} +6 -5
  47. package/dist/{chunk-2RAZ4ZFE.js → chunk-VBILES4B.js} +1 -1
  48. package/dist/{chunk-PI4WMLMG.js → chunk-VXAGOLDP.js} +1 -1
  49. package/dist/{chunk-SS4B7P7V.js → chunk-YIDV4VV2.js} +1 -1
  50. package/dist/chunk-YTRZNA64.js +37 -0
  51. package/dist/chunk-ZKWPCBYT.js +600 -0
  52. package/dist/cli/index.js +28 -21
  53. package/dist/commands/archive.js +3 -3
  54. package/dist/commands/backlog.js +1 -1
  55. package/dist/commands/benchmark.d.ts +12 -0
  56. package/dist/commands/benchmark.js +12 -0
  57. package/dist/commands/blocked.js +1 -1
  58. package/dist/commands/canvas.js +2 -2
  59. package/dist/commands/checkpoint.js +1 -1
  60. package/dist/commands/compat.js +1 -1
  61. package/dist/commands/context.js +8 -7
  62. package/dist/commands/doctor.d.ts +8 -3
  63. package/dist/commands/doctor.js +8 -22
  64. package/dist/commands/embed.js +6 -5
  65. package/dist/commands/entities.d.ts +8 -1
  66. package/dist/commands/entities.js +46 -3
  67. package/dist/commands/graph.js +4 -4
  68. package/dist/commands/inbox.d.ts +23 -0
  69. package/dist/commands/inbox.js +11 -0
  70. package/dist/commands/inject.d.ts +1 -1
  71. package/dist/commands/inject.js +5 -5
  72. package/dist/commands/kanban.js +1 -1
  73. package/dist/commands/link.js +5 -5
  74. package/dist/commands/maintain.d.ts +32 -0
  75. package/dist/commands/maintain.js +13 -0
  76. package/dist/commands/migrate-observations.js +3 -3
  77. package/dist/commands/observe.js +11 -10
  78. package/dist/commands/project.js +2 -2
  79. package/dist/commands/rebuild-embeddings.js +48 -17
  80. package/dist/commands/rebuild.js +9 -8
  81. package/dist/commands/recall.d.ts +14 -0
  82. package/dist/commands/recall.js +15 -0
  83. package/dist/commands/recover.js +1 -1
  84. package/dist/commands/reflect.js +6 -6
  85. package/dist/commands/repair-session.js +1 -1
  86. package/dist/commands/replay.js +10 -9
  87. package/dist/commands/session-recap.js +1 -1
  88. package/dist/commands/setup.js +4 -3
  89. package/dist/commands/shell-init.js +1 -1
  90. package/dist/commands/sleep.d.ts +1 -1
  91. package/dist/commands/sleep.js +20 -18
  92. package/dist/commands/status.js +40 -26
  93. package/dist/commands/sync-bd.js +3 -3
  94. package/dist/commands/tailscale.js +3 -3
  95. package/dist/commands/task.js +1 -1
  96. package/dist/commands/template.js +1 -1
  97. package/dist/commands/wake.d.ts +1 -1
  98. package/dist/commands/wake.js +10 -9
  99. package/dist/index.d.ts +233 -16
  100. package/dist/index.js +325 -111
  101. package/dist/{inject-DYUrDqQO.d.ts → inject-DEb_jpLi.d.ts} +3 -1
  102. package/dist/lib/auto-linker.js +2 -2
  103. package/dist/lib/canvas-layout.js +1 -1
  104. package/dist/lib/config.js +2 -2
  105. package/dist/lib/entity-index.js +1 -1
  106. package/dist/lib/project-utils.js +2 -2
  107. package/dist/lib/session-repair.js +1 -1
  108. package/dist/lib/session-utils.js +1 -1
  109. package/dist/lib/tailscale.js +1 -1
  110. package/dist/lib/task-utils.js +1 -1
  111. package/dist/lib/template-engine.js +1 -1
  112. package/dist/lib/webdav.js +1 -1
  113. package/dist/onnxruntime_binding-5QEF3SUC.node +0 -0
  114. package/dist/onnxruntime_binding-BKPKNEGC.node +0 -0
  115. package/dist/onnxruntime_binding-FMOXGIUT.node +0 -0
  116. package/dist/onnxruntime_binding-OI2KMXC5.node +0 -0
  117. package/dist/onnxruntime_binding-UX44MLAZ.node +0 -0
  118. package/dist/onnxruntime_binding-Y2W7N7WY.node +0 -0
  119. package/dist/openclaw-plugin--gqA2BZw.d.ts +267 -0
  120. package/dist/openclaw-plugin.d.ts +4 -0
  121. package/dist/openclaw-plugin.js +20 -0
  122. package/dist/transformers.node-A2ZRORSQ.js +46775 -0
  123. package/dist/types-CbL-wIKi.d.ts +36 -0
  124. package/dist/{types-BbWJoC1c.d.ts → types-DslKvCaj.d.ts} +51 -1
  125. package/hooks/clawvault/HOOK.md +25 -8
  126. package/hooks/clawvault/handler.js +215 -78
  127. package/hooks/clawvault/handler.test.js +109 -43
  128. package/hooks/clawvault/integrity.js +112 -0
  129. package/hooks/clawvault/integrity.test.js +32 -0
  130. package/hooks/clawvault/openclaw.plugin.json +133 -15
  131. package/openclaw.plugin.json +161 -194
  132. package/package.json +8 -5
  133. package/bin/register-workgraph-commands.js +0 -451
  134. package/dist/chunk-5PJ4STIC.js +0 -465
  135. package/dist/chunk-ERNE2FZ5.js +0 -189
  136. package/dist/chunk-HR4KN6S2.js +0 -152
  137. package/dist/chunk-IJBFGPCS.js +0 -33
  138. package/dist/chunk-K7PNYS45.js +0 -93
  139. package/dist/chunk-NTOPJI7W.js +0 -207
  140. package/dist/chunk-PG56HX5T.js +0 -154
  141. package/dist/chunk-QPDDIHXE.js +0 -501
  142. package/dist/chunk-WIOLLGAD.js +0 -190
  143. package/dist/chunk-WMGIIABP.js +0 -15
  144. package/dist/ledger-B7g7jhqG.d.ts +0 -44
  145. package/dist/plugin/index.d.ts +0 -352
  146. package/dist/plugin/index.js +0 -4264
  147. package/dist/registry-BR4326o0.d.ts +0 -30
  148. package/dist/store-CA-6sKCJ.d.ts +0 -34
  149. package/dist/thread-B9LhXNU0.d.ts +0 -41
  150. package/dist/workgraph/index.d.ts +0 -5
  151. package/dist/workgraph/index.js +0 -23
  152. package/dist/workgraph/ledger.d.ts +0 -2
  153. package/dist/workgraph/ledger.js +0 -25
  154. package/dist/workgraph/registry.d.ts +0 -2
  155. package/dist/workgraph/registry.js +0 -19
  156. package/dist/workgraph/store.d.ts +0 -2
  157. package/dist/workgraph/store.js +0 -25
  158. package/dist/workgraph/thread.d.ts +0 -2
  159. package/dist/workgraph/thread.js +0 -25
  160. package/dist/workgraph/types.d.ts +0 -54
  161. package/dist/workgraph/types.js +0 -7
package/dist/index.d.ts CHANGED
@@ -1,28 +1,36 @@
1
1
  import { Command } from 'commander';
2
- import { V as VaultConfig, a as StoreOptions, D as Document, b as SearchOptions, c as SearchResult, d as SyncOptions, e as SyncResult, C as Category, M as MemoryType, H as HandoffDocument, S as SessionRecap } from './types-BbWJoC1c.js';
3
- export { f as DEFAULT_CATEGORIES, g as DEFAULT_CONFIG, h as MEMORY_TYPES, T as TYPE_TO_CATEGORY, i as VaultMeta } from './types-BbWJoC1c.js';
2
+ import { V as VaultConfig, S as StoreOptions, D as Document, P as PatchOptions, a as SearchOptions, b as SearchResult, c as SyncOptions, d as SyncResult, C as Category, M as MemoryType, H as HandoffDocument, e as SessionRecap, f as VaultSearchConfig } from './types-DslKvCaj.js';
3
+ export { g as DEFAULT_CATEGORIES, h as DEFAULT_CONFIG, E as EmbeddingProvider, i as MEMORY_TYPES, j as PatchMode, R as RerankProvider, k as SearchBackend, T as TYPE_TO_CATEGORY, l as VaultMeta } from './types-DslKvCaj.js';
4
+ import { C as CaptureOptions, a as CaptureStoreResult, b as CaptureCandidate } from './openclaw-plugin--gqA2BZw.js';
5
+ export { c as CaptureMessage, d as CaptureRejection, e as CapturedMemoryType, M as MemorySlot, f as MemorySlotInitOptions, g as MemorySlotRecallOptions, h as MemorySlotSearchOptions, i as MemorySlotStoreOptions, j as MemoryStoreMetadata, k as createMemorySlot, l as createMemorySlotPlugin, m as openclawHookPlugin, r as registerMemorySlot } from './openclaw-plugin--gqA2BZw.js';
4
6
  export { setupCommand } from './commands/setup.js';
5
7
  export { CompatCheck, CompatCommandOptions, CompatReport, CompatStatus, checkOpenClawCompatibility, compatCommand, compatibilityExitCode } from './commands/compat.js';
6
8
  export { GraphSummary, graphCommand, graphSummary } from './commands/graph.js';
7
9
  export { KanbanGroupBy, KanbanImportChange, KanbanImportOptions, KanbanImportResult, KanbanLane, KanbanSyncOptions, KanbanSyncResult, ParsedKanbanBoard, ParsedKanbanLane, buildKanbanLanes, extractCardSlug, formatKanbanCard, generateKanbanMarkdown, importKanbanBoard, kanbanCommand, parseKanbanMarkdown, syncKanbanBoard } from './commands/kanban.js';
10
+ export { BenchmarkObserverCommandOptions, benchmarkObserverCommand, registerBenchmarkCommand } from './commands/benchmark.js';
8
11
  export { C as ContextEntry, a as ContextFormat, b as ContextOptions, c as ContextProfile, d as ContextProfileInput, e as ContextProfileOption, f as ContextResult, R as ResolvedContextProfile, g as buildContext, h as contextCommand, i as formatContextMarkdown, j as inferContextProfile, n as normalizeContextProfileInput, r as registerContextCommand, k as resolveContextProfile } from './context-BUGaWpyL.js';
9
- import { L as LlmProvider } from './inject-DYUrDqQO.js';
10
- export { I as InjectCommandOptions, a as InjectFormat, b as InjectMatch, c as InjectMatchReason, d as InjectMatchSource, e as InjectResult, f as InjectRuntimeOptions, g as InjectSourceCategory, h as InjectableItem, i as LlmCompletionOptions, M as MEMORY_GRAPH_SCHEMA_VERSION, j as MemoryGraph, k as MemoryGraphEdge, l as MemoryGraphEdgeType, m as MemoryGraphIndex, n as MemoryGraphNode, o as MemoryGraphNodeType, p as MemoryGraphStats, q as buildInjectionResult, r as buildOrUpdateMemoryGraphIndex, s as deterministicInjectMatches, t as getMemoryGraph, u as indexInjectableItems, v as injectCommand, w as loadMemoryGraphIndex, x as registerInjectCommand, y as requestLlmCompletion, z as resolveLlmProvider, A as runPromptInjection } from './inject-DYUrDqQO.js';
12
+ import { L as LlmProvider, a as LlmModelTier } from './inject-DEb_jpLi.js';
13
+ export { I as InjectCommandOptions, b as InjectFormat, c as InjectMatch, d as InjectMatchReason, e as InjectMatchSource, f as InjectResult, g as InjectRuntimeOptions, h as InjectSourceCategory, i as InjectableItem, j as LlmCompletionOptions, M as MEMORY_GRAPH_SCHEMA_VERSION, k as MemoryGraph, l as MemoryGraphEdge, m as MemoryGraphEdgeType, n as MemoryGraphIndex, o as MemoryGraphNode, p as MemoryGraphNodeType, q as MemoryGraphStats, r as buildInjectionResult, s as buildOrUpdateMemoryGraphIndex, t as deterministicInjectMatches, u as getMemoryGraph, v as indexInjectableItems, w as injectCommand, x as loadMemoryGraphIndex, y as registerInjectCommand, z as requestLlmCompletion, A as resolveLlmProvider, B as runPromptInjection } from './inject-DEb_jpLi.js';
11
14
  export { ObserveCommandOptions, observeCommand, registerObserveCommand } from './commands/observe.js';
12
15
  export { ReflectCommandOptions, reflectCommand, registerReflectCommand } from './commands/reflect.js';
13
16
  export { ArchiveCommandOptions, archiveCommand, registerArchiveCommand } from './commands/archive.js';
14
17
  export { RebuildCommandOptions, rebuildCommand, registerRebuildCommand } from './commands/rebuild.js';
15
18
  import { MigrationIssueType } from './commands/doctor.js';
16
- export { DoctorCheck, DoctorReport, DoctorStatus, MigrationIssue, doctor } from './commands/doctor.js';
19
+ export { DoctorCheck, DoctorOptions, DoctorReport, DoctorStatus, MigrationIssue, doctor } from './commands/doctor.js';
17
20
  export { EmbedCommandOptions, EmbedCommandResult, embedCommand, registerEmbedCommand } from './commands/embed.js';
21
+ export { InboxAddCommandOptions, inboxAddCommand, registerInboxCommand } from './commands/inbox.js';
22
+ export { MaintainCommandOptions, maintainCommand, registerMaintainCommand } from './commands/maintain.js';
18
23
  export { ReplayCommandOptions, registerReplayCommand, replayCommand } from './commands/replay.js';
19
24
  export { MigrateObservationsOptions, MigrateObservationsResult, migrateObservations, migrateObservationsCommand, registerMigrateObservationsCommand } from './commands/migrate-observations.js';
25
+ export { RecallCommandOptions, recallCommand } from './commands/recall.js';
20
26
  export { SyncBdCommandOptions, registerSyncBdCommand, syncBdCommand } from './commands/sync-bd.js';
21
27
  export { SessionRecapFormat, SessionRecapOptions, SessionRecapResult, SessionTurn, buildSessionRecap, formatSessionRecapMarkdown, sessionRecapCommand } from './commands/session-recap.js';
22
28
  export { findNearestVaultPath, getVaultPath, resolveVaultPath } from './lib/config.js';
23
29
  export { registerCliCommands } from './cli/index.js';
24
30
  import { TaskStatus } from './lib/task-utils.js';
25
31
  export { completeTask, listDependentTasks, listSubtasks, updateTask } from './lib/task-utils.js';
32
+ import { R as RecallStrategy, a as RecallQueryClassification, b as RecallOptions, c as RecallResult } from './types-CbL-wIKi.js';
33
+ export { d as RecallSource } from './types-CbL-wIKi.js';
26
34
  export { CLAWVAULT_SERVE_PATH, DEFAULT_SERVE_PORT, ServeInstance, TailscalePeer, TailscaleServeConfig, TailscaleStatus, TailscaleSyncOptions, TailscaleSyncResult, VaultFileEntry, VaultManifest, checkPeerClawVault, compareManifests, configureTailscaleServe, discoverClawVaultPeers, fetchRemoteFile, fetchRemoteManifest, findPeer, generateVaultManifest, getOnlinePeers, getTailscaleStatus, getTailscaleVersion, hasTailscale, pushFileToRemote, resolvePeerIP, serveVault, stopTailscaleServe, syncWithPeer } from './lib/tailscale.js';
27
35
  export { TailscaleDiscoverCommandOptions, TailscaleServeCommandOptions, TailscaleStatusCommandOptions, TailscaleSyncCommandOptions, registerTailscaleCommands, registerTailscaleDiscoverCommand, registerTailscaleServeCommand, registerTailscaleStatusCommand, registerTailscaleSyncCommand, tailscaleDiscoverCommand, tailscaleServeCommand, tailscaleStatusCommand, tailscaleSyncCommand } from './commands/tailscale.js';
28
36
  export { TemplateVariables, buildTemplateVariables, renderTemplate } from './lib/template-engine.js';
@@ -64,20 +72,24 @@ declare class ClawVault {
64
72
  * Store a new document
65
73
  */
66
74
  store(options: StoreOptions): Promise<Document>;
75
+ /**
76
+ * Patch an existing document and incrementally refresh index state for that file only.
77
+ */
78
+ patch(options: PatchOptions): Promise<Document>;
67
79
  /**
68
80
  * Quick store to inbox
69
81
  */
70
82
  capture(note: string, title?: string): Promise<Document>;
71
83
  /**
72
- * Search the vault (BM25 via qmd)
84
+ * Search the vault (in-process hybrid by default, qmd fallback optional)
73
85
  */
74
86
  find(query: string, options?: SearchOptions): Promise<SearchResult[]>;
75
87
  /**
76
- * Semantic/vector search (via qmd vsearch)
88
+ * Semantic/vector search (hosted embeddings, qmd fallback optional)
77
89
  */
78
90
  vsearch(query: string, options?: SearchOptions): Promise<SearchResult[]>;
79
91
  /**
80
- * Combined search with query expansion (via qmd query)
92
+ * Combined search entrypoint (currently aliases hybrid search)
81
93
  */
82
94
  query(query: string, options?: SearchOptions): Promise<SearchResult[]>;
83
95
  /**
@@ -164,6 +176,13 @@ declare class ClawVault {
164
176
  * Handles Date objects, strings, and undefined values.
165
177
  */
166
178
  private toDateString;
179
+ private reindexDocument;
180
+ private resolveDocumentRelativePath;
181
+ private splitFrontmatter;
182
+ private applyPatchToBody;
183
+ private appendText;
184
+ private replaceAllOccurrences;
185
+ private patchMarkdownSection;
167
186
  /**
168
187
  * Extract the date portion (YYYY-MM-DD) from an ISO date string or Date object.
169
188
  * Provides safe handling for various date formats.
@@ -215,8 +234,8 @@ declare function migrateCommand(options?: MigrateCommandOptions): Promise<Migrat
215
234
  declare function registerMigrateCommand(program: Command): void;
216
235
 
217
236
  /**
218
- * ClawVault Search Engine - qmd Backend
219
- * Uses qmd CLI for BM25 and vector search
237
+ * ClawVault Search Engine
238
+ * In-process hybrid retrieval is default; qmd remains optional fallback.
220
239
  */
221
240
 
222
241
  declare const QMD_INSTALL_URL = "https://github.com/tobi/qmd";
@@ -254,11 +273,13 @@ declare function qmdEmbed(collection?: string, indexName?: string): void;
254
273
  * QMD Search Engine - wraps qmd CLI
255
274
  */
256
275
  declare class SearchEngine {
257
- private documents;
276
+ private readonly inProcess;
258
277
  private collection;
259
278
  private vaultPath;
260
279
  private collectionRoot;
261
280
  private qmdIndexName?;
281
+ private searchConfig;
282
+ setSearchConfig(config?: VaultSearchConfig): void;
262
283
  /**
263
284
  * Set the collection name (usually vault name)
264
285
  */
@@ -295,15 +316,17 @@ declare class SearchEngine {
295
316
  /**
296
317
  * BM25 search via qmd
297
318
  */
298
- search(query: string, options?: SearchOptions): SearchResult[];
319
+ search(query: string, options?: SearchOptions): Promise<SearchResult[]>;
299
320
  /**
300
321
  * Vector/semantic search via qmd vsearch
301
322
  */
302
- vsearch(query: string, options?: SearchOptions): SearchResult[];
323
+ vsearch(query: string, options?: SearchOptions): Promise<SearchResult[]>;
303
324
  /**
304
325
  * Combined search with query expansion (qmd query command)
305
326
  */
306
- query(query: string, options?: SearchOptions): SearchResult[];
327
+ query(query: string, options?: SearchOptions): Promise<SearchResult[]>;
328
+ private runSearchWithFallback;
329
+ private runInProcessQuery;
307
330
  private runQmdQuery;
308
331
  /**
309
332
  * Convert qmd results to ClawVault SearchResult format
@@ -434,12 +457,18 @@ declare const OBSERVER_COMPRESSION_PROVIDERS: readonly ["anthropic", "openai", "
434
457
  declare const THEMES: readonly ["neural", "minimal", "none"];
435
458
  declare const CONTEXT_PROFILES: readonly ["default", "planning", "incident", "handoff", "auto"];
436
459
  declare const FACT_EXTRACTION_MODES: readonly ["off", "rule", "llm", "hybrid"];
460
+ declare const SEARCH_BACKENDS: readonly ["in-process", "qmd"];
461
+ declare const SEARCH_EMBEDDING_PROVIDERS: readonly ["none", "openai", "gemini", "ollama"];
462
+ declare const SEARCH_RERANK_PROVIDERS: readonly ["none", "jina", "voyage", "siliconflow", "pinecone"];
437
463
  type ObserveProvider = (typeof OBSERVE_PROVIDERS)[number];
438
464
  type ObserverCompressionProvider = (typeof OBSERVER_COMPRESSION_PROVIDERS)[number];
439
465
  type Theme = (typeof THEMES)[number];
440
466
  type ContextProfile = (typeof CONTEXT_PROFILES)[number];
441
467
  type FactExtractionMode$1 = (typeof FACT_EXTRACTION_MODES)[number];
442
- type ManagedConfigKey = 'name' | 'categories' | 'theme' | 'observe.model' | 'observe.provider' | 'observer.compression.provider' | 'observer.compression.model' | 'observer.compression.baseUrl' | 'observer.compression.apiKey' | 'observer.factExtractionMode' | 'context.maxResults' | 'context.defaultProfile' | 'graph.maxHops' | 'inject.maxResults' | 'inject.useLlm' | 'inject.scope';
468
+ type SearchBackend = (typeof SEARCH_BACKENDS)[number];
469
+ type SearchEmbeddingProvider = (typeof SEARCH_EMBEDDING_PROVIDERS)[number];
470
+ type SearchRerankProvider = (typeof SEARCH_RERANK_PROVIDERS)[number];
471
+ type ManagedConfigKey = 'name' | 'categories' | 'theme' | 'models.background' | 'models.default' | 'models.complex' | 'observe.model' | 'observe.provider' | 'observer.compression.provider' | 'observer.compression.model' | 'observer.compression.baseUrl' | 'observer.compression.apiKey' | 'observer.factExtractionMode' | 'context.maxResults' | 'context.defaultProfile' | 'graph.maxHops' | 'inject.maxResults' | 'inject.useLlm' | 'inject.scope' | 'search.backend' | 'search.qmdFallback' | 'search.chunkSize' | 'search.chunkOverlap' | 'search.embeddings.provider' | 'search.embeddings.model' | 'search.embeddings.baseUrl' | 'search.embeddings.apiKey' | 'search.rerank.provider' | 'search.rerank.model' | 'search.rerank.endpoint' | 'search.rerank.apiKey' | 'search.rerank.weight';
443
472
  interface RouteRule {
444
473
  pattern: string;
445
474
  target: string;
@@ -472,6 +501,7 @@ type FactExtractionMode = 'off' | 'rule' | 'llm' | 'hybrid';
472
501
  interface LlmAdapterOptions {
473
502
  provider?: LlmProvider | null;
474
503
  model?: string;
504
+ tier?: LlmModelTier;
475
505
  temperature?: number;
476
506
  maxTokens?: number;
477
507
  fetchImpl?: typeof fetch;
@@ -718,6 +748,13 @@ declare class Compressor {
718
748
  private readonly fetchImpl;
719
749
  constructor(options?: CompressorOptions);
720
750
  compress(messages: string[], existingObservations: string): Promise<string>;
751
+ private sanitizeIncomingMessages;
752
+ private sanitizeIncomingMessage;
753
+ private normalizeMessageRole;
754
+ private isConversationRolePrefix;
755
+ private shouldDropMessageRole;
756
+ private stripNoisyData;
757
+ private isLikelyStructuredNoise;
721
758
  private resolveProvider;
722
759
  private resolveConfiguredProvider;
723
760
  private resolveProviderFromEnv;
@@ -744,9 +781,18 @@ declare class Compressor {
744
781
  * Also fixes trailing word fragments fused after closing brackets.
745
782
  */
746
783
  private sanitizeWikiLinks;
784
+ private static readonly SCENE_SETTER_RE;
785
+ private static readonly ACK_NOISE_RE;
786
+ private isNoiseObservation;
747
787
  private enforceImportanceRules;
748
788
  private enforceImportanceForRecord;
749
789
  private fallbackCompression;
790
+ private toFallbackCandidate;
791
+ private shouldDropLowSignalCandidate;
792
+ private stripConversationLeadIn;
793
+ private stripTimePrefix;
794
+ private calibrateFallbackCandidate;
795
+ private buildRoutineMaintenanceSummary;
750
796
  private mergeObservations;
751
797
  private mergeRecord;
752
798
  private renderSections;
@@ -936,6 +982,124 @@ declare class SessionWatcher {
936
982
 
937
983
  declare function parseSessionFile(filePath: string): string[];
938
984
 
985
+ declare const OBSERVATION_TYPES: readonly ["decision", "preference", "fact", "commitment", "task", "todo", "commitment-unresolved", "milestone", "lesson", "relationship", "project"];
986
+ type ObservationType = typeof OBSERVATION_TYPES[number];
987
+ type LegacyObservationPriority = '🔴' | '🟡' | '🟢';
988
+ type ObservationLineKind = 'scored' | 'emoji';
989
+ interface ParsedObservationRecord {
990
+ date: string;
991
+ type: ObservationType;
992
+ confidence: number;
993
+ importance: number;
994
+ content: string;
995
+ format: ObservationLineKind;
996
+ priority?: LegacyObservationPriority;
997
+ time?: string;
998
+ rawLine: string;
999
+ }
1000
+
1001
+ type ObserverBenchmarkProvider = CompressionProvider | 'mock';
1002
+ type ObserverBenchmarkReportFormat = 'json' | 'text';
1003
+ interface ObserverBenchmarkFixtureConfig {
1004
+ now?: string;
1005
+ existingObservations?: string;
1006
+ compression?: {
1007
+ provider?: ObserverBenchmarkProvider;
1008
+ model?: string;
1009
+ baseUrl?: string;
1010
+ apiKey?: string;
1011
+ };
1012
+ scoring?: {
1013
+ matchThreshold?: number;
1014
+ minimumImportanceForRecall?: number;
1015
+ keywordHints?: string[];
1016
+ };
1017
+ }
1018
+ interface ObserverBenchmarkFixture {
1019
+ id: string;
1020
+ dir: string;
1021
+ transcriptPath: string;
1022
+ expectedPath: string;
1023
+ transcript: string;
1024
+ expected: string;
1025
+ config: ObserverBenchmarkFixtureConfig;
1026
+ }
1027
+ interface ObservationMatch {
1028
+ expectedIndex: number;
1029
+ actualIndex: number;
1030
+ similarity: number;
1031
+ }
1032
+ interface KeywordRewriteFlag {
1033
+ expected: string;
1034
+ actual: string;
1035
+ missingTerms: string[];
1036
+ }
1037
+ interface FixtureScoringMetrics {
1038
+ precision: number;
1039
+ noiseRatio: number;
1040
+ recall: number;
1041
+ typeAccuracy: number;
1042
+ keywordPreservation: number;
1043
+ overall: number;
1044
+ }
1045
+ interface FixtureScoringResult {
1046
+ metrics: FixtureScoringMetrics;
1047
+ matches: ObservationMatch[];
1048
+ missedImportant: ParsedObservationRecord[];
1049
+ noiseObservations: ParsedObservationRecord[];
1050
+ keywordSet: string[];
1051
+ missingKeywords: string[];
1052
+ keywordRewriteFlags: KeywordRewriteFlag[];
1053
+ }
1054
+ interface BenchmarkFixtureResult {
1055
+ fixtureId: string;
1056
+ transcriptPath: string;
1057
+ expectedPath: string;
1058
+ provider: ObserverBenchmarkProvider;
1059
+ model?: string;
1060
+ outputObservations: string;
1061
+ expectedCount: number;
1062
+ actualCount: number;
1063
+ expectedTypes: ObservationType[];
1064
+ actualTypes: ObservationType[];
1065
+ scoring: FixtureScoringResult;
1066
+ }
1067
+ interface ObserverBenchmarkReport {
1068
+ generatedAt: string;
1069
+ fixturesDir: string;
1070
+ provider: ObserverBenchmarkProvider;
1071
+ model?: string;
1072
+ fixtureCount: number;
1073
+ aggregate: FixtureScoringMetrics;
1074
+ fixtures: BenchmarkFixtureResult[];
1075
+ }
1076
+ interface ObserverBenchmarkRunOptions {
1077
+ fixturesDir: string;
1078
+ provider?: ObserverBenchmarkProvider;
1079
+ model?: string;
1080
+ }
1081
+ interface ScoreFixtureOptions {
1082
+ minimumImportanceForRecall?: number;
1083
+ matchThreshold?: number;
1084
+ keywordHints?: string[];
1085
+ }
1086
+
1087
+ declare function loadObserverBenchmarkFixtures(fixturesDir: string): ObserverBenchmarkFixture[];
1088
+
1089
+ declare function runObserverBenchmark(options: ObserverBenchmarkRunOptions): Promise<ObserverBenchmarkReport>;
1090
+
1091
+ declare function extractKeywordSetFromTranscript(transcript: string, hints?: string[]): string[];
1092
+ declare function matchObservationRecords(expected: ParsedObservationRecord[], actual: ParsedObservationRecord[], threshold?: number): ObservationMatch[];
1093
+ declare function scoreFixtureObservations(input: {
1094
+ transcript: string;
1095
+ expectedMarkdown: string;
1096
+ actualMarkdown: string;
1097
+ options?: ScoreFixtureOptions;
1098
+ }): FixtureScoringResult;
1099
+ declare function compareObservationText(left: string, right: string): boolean;
1100
+
1101
+ declare function formatObserverBenchmarkSummary(report: ObserverBenchmarkReport): string;
1102
+
939
1103
  interface ArchiveObservationsOptions {
940
1104
  olderThanDays?: number;
941
1105
  dryRun?: boolean;
@@ -965,6 +1129,59 @@ interface ReflectResult {
965
1129
  }
966
1130
  declare function runReflection(options: ReflectOptions): Promise<ReflectResult>;
967
1131
 
1132
+ declare class LiveCaptureService {
1133
+ captureTurn(messages: unknown[], options?: CaptureOptions): Promise<CaptureStoreResult>;
1134
+ private persistCandidate;
1135
+ }
1136
+
1137
+ declare function extractTaggedMemoryNotes(text: string): CaptureCandidate[];
1138
+ declare function extractHeuristicMemories(text: string): CaptureCandidate[];
1139
+ declare function extractMemoriesFromAssistantResponse(text: string): CaptureCandidate[];
1140
+
1141
+ interface QualityGateOptions {
1142
+ minConfidence?: number;
1143
+ minQualityScore?: number;
1144
+ dedupThreshold?: number;
1145
+ }
1146
+ interface QualityGateResult {
1147
+ accepted: boolean;
1148
+ reason?: string;
1149
+ qualityScore: number;
1150
+ plausibilityScore: number;
1151
+ confidenceScore: number;
1152
+ maxSimilarity: number;
1153
+ }
1154
+ declare function isLikelyJunkMemory(content: string): boolean;
1155
+ declare function plausibilityScore(content: string): number;
1156
+ declare function evaluateCandidateQuality(candidate: CaptureCandidate, existingContents: string[], stagedContents?: string[], options?: QualityGateOptions): QualityGateResult;
1157
+
1158
+ declare function classifyRecallQuery(query: string, knownEntityNames?: string[], forcedStrategy?: RecallStrategy): RecallQueryClassification;
1159
+
1160
+ declare function buildRecallResult(vault: ClawVault, query: string, options?: RecallOptions): Promise<RecallResult>;
1161
+
1162
+ type EntityKind = 'person' | 'project' | 'org' | 'place' | 'unknown';
1163
+ interface EntityRelationship {
1164
+ target: string;
1165
+ strength: number;
1166
+ evidence: string[];
1167
+ }
1168
+ interface EntityProfile {
1169
+ name: string;
1170
+ aliases: string[];
1171
+ kind: EntityKind;
1172
+ summary: string;
1173
+ relationships: EntityRelationship[];
1174
+ lastMentioned: string;
1175
+ }
1176
+
1177
+ interface SynthesizeEntityProfilesOptions {
1178
+ writeFiles?: boolean;
1179
+ }
1180
+ declare function synthesizeEntityProfiles(vaultPath: string, options?: SynthesizeEntityProfilesOptions): Promise<EntityProfile[]>;
1181
+ declare function readEntityProfiles(vaultPath: string): EntityProfile[];
1182
+ declare function ensureEntityProfiles(vaultPath: string): Promise<EntityProfile[]>;
1183
+ declare function readEntityProfile(vaultPath: string, name: string): Promise<EntityProfile | null>;
1184
+
968
1185
  /**
969
1186
  * ClawVault 🐘 — An Elephant Never Forgets
970
1187
  *
@@ -994,4 +1211,4 @@ declare function runReflection(options: ReflectOptions): Promise<ReflectResult>;
994
1211
  declare const VERSION: string;
995
1212
  declare function registerCommanderCommands(program: Command): Command;
996
1213
 
997
- export { type ActiveObservationCandidate, type ActiveObservationFailure, type ActiveObserveOptions, type ActiveObserveResult, type ArchiveObservationsOptions, type ArchiveObservationsResult, Category, ClawVault, type CompressionProvider, Compressor, type CompressorOptions, type ContextProfile as ConfigDefaultProfile, Document, EmbeddingCache, type ExtractedFact, type ExtractionResult, type FactExtractionMode$1 as FactExtractionMode, FactStore, type FactStoreStats, HandoffDocument, type LlmAdapter, type LlmAdapterOptions, LlmProvider, type ManagedConfigKey, MemoryType, type MigrateCommandOptions, type MigrateResult, type MigrationAction, MigrationIssueType, type ObserveCursorEntry, type ObserveCursorStore, type ObserveProvider, Observer, type ObserverCompressionProvider, type ObserverCompressor, type ObserverOptions, type ObserverReflector, type ObserverStalenessResult, QMD_INSTALL_COMMAND, QMD_INSTALL_URL, QmdConfigurationError, type QmdErrorCode, type QmdErrorDetails, QmdUnavailableError, type ReflectOptions, type ReflectResult, Reflector, type ReflectorOptions, type RouteRule, SUPPORTED_CONFIG_KEYS, SearchEngine, SearchOptions, SearchResult, SessionRecap, SessionWatcher, type SessionWatcherOptions, StoreOptions, SyncOptions, SyncResult, type Theme, type TransitionEvent, VERSION, VaultConfig, addRouteRule, appendTransition, archiveObservations, buildTransitionEvent, cosineSimilarity, countBlockedTransitions, createDefaultAdapter, createFactExtractionAdapter, createGeminiFlashAdapter, createLlmFunction, createVault, embed, embedBatch, extractFactsLlm, extractFactsRuleBased, extractTags, extractWikiLinks, factId, findVault, formatTransitionsTable, getConfig, getConfigValue, getObserverStaleness, getQmdErrorDetails, getScaledObservationThresholdBytes, hasQmd, hybridSearch, isRegression, listConfig, listRouteRules, matchRouteRule, migrate, migrateCommand, normalizeEntity, observeActiveSessions, parseSessionFile, parseSessionSourceLabel, qmdEmbed, qmdUpdate, queryTransitions, readAllTransitions, reciprocalRankFusion, registerCommanderCommands, registerMigrateCommand, removeRouteRule, resetConfig, resolveFactExtractionMode, runReflection, semanticSearch, setConfigValue, testRouteRule };
1214
+ export { type ActiveObservationCandidate, type ActiveObservationFailure, type ActiveObserveOptions, type ActiveObserveResult, type ArchiveObservationsOptions, type ArchiveObservationsResult, type BenchmarkFixtureResult, CaptureCandidate, CaptureOptions, CaptureStoreResult, Category, ClawVault, type CompressionProvider, Compressor, type CompressorOptions, type ContextProfile as ConfigDefaultProfile, type SearchBackend as ConfigSearchBackend, type SearchEmbeddingProvider as ConfigSearchEmbeddingProvider, type SearchRerankProvider as ConfigSearchRerankProvider, Document, EmbeddingCache, type EntityKind, type EntityProfile, type EntityRelationship, type ExtractedFact, type ExtractionResult, type FactExtractionMode$1 as FactExtractionMode, FactStore, type FactStoreStats, type FixtureScoringMetrics, type FixtureScoringResult, HandoffDocument, type KeywordRewriteFlag, LiveCaptureService, type LlmAdapter, type LlmAdapterOptions, LlmProvider, type ManagedConfigKey, MemoryType, type MigrateCommandOptions, type MigrateResult, type MigrationAction, MigrationIssueType, type ObservationMatch, type ObserveCursorEntry, type ObserveCursorStore, type ObserveProvider, Observer, type ObserverBenchmarkFixture, type ObserverBenchmarkFixtureConfig, type ObserverBenchmarkProvider, type ObserverBenchmarkReport, type ObserverBenchmarkReportFormat, type ObserverBenchmarkRunOptions, type ObserverCompressionProvider, type ObserverCompressor, type ObserverOptions, type ObserverReflector, type ObserverStalenessResult, PatchOptions, QMD_INSTALL_COMMAND, QMD_INSTALL_URL, QmdConfigurationError, type QmdErrorCode, type QmdErrorDetails, QmdUnavailableError, RecallOptions, RecallQueryClassification, RecallResult, RecallStrategy, type ReflectOptions, type ReflectResult, Reflector, type ReflectorOptions, type RouteRule, SUPPORTED_CONFIG_KEYS, type ScoreFixtureOptions, SearchEngine, SearchOptions, SearchResult, SessionRecap, SessionWatcher, type SessionWatcherOptions, StoreOptions, SyncOptions, SyncResult, type Theme, type TransitionEvent, VERSION, VaultConfig, VaultSearchConfig, addRouteRule, appendTransition, archiveObservations, buildRecallResult, buildTransitionEvent, classifyRecallQuery, compareObservationText, cosineSimilarity, countBlockedTransitions, createDefaultAdapter, createFactExtractionAdapter, createGeminiFlashAdapter, createLlmFunction, createVault, embed, embedBatch, ensureEntityProfiles, evaluateCandidateQuality, extractFactsLlm, extractFactsRuleBased, extractHeuristicMemories, extractKeywordSetFromTranscript, extractMemoriesFromAssistantResponse, extractTaggedMemoryNotes, extractTags, extractWikiLinks, factId, findVault, formatObserverBenchmarkSummary, formatTransitionsTable, getConfig, getConfigValue, getObserverStaleness, getQmdErrorDetails, getScaledObservationThresholdBytes, hasQmd, hybridSearch, isLikelyJunkMemory, isRegression, listConfig, listRouteRules, loadObserverBenchmarkFixtures, matchObservationRecords, matchRouteRule, migrate, migrateCommand, normalizeEntity, observeActiveSessions, parseSessionFile, parseSessionSourceLabel, plausibilityScore, qmdEmbed, qmdUpdate, queryTransitions, readAllTransitions, readEntityProfile, readEntityProfiles, reciprocalRankFusion, registerCommanderCommands, registerMigrateCommand, removeRouteRule, resetConfig, resolveFactExtractionMode, runObserverBenchmark, runReflection, scoreFixtureObservations, semanticSearch, setConfigValue, synthesizeEntityProfiles, testRouteRule };