clawvault 3.1.0 → 3.2.1

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 (273) hide show
  1. package/README.md +422 -141
  2. package/bin/clawvault.js +10 -2
  3. package/bin/command-registration.test.js +3 -1
  4. package/bin/command-runtime.js +9 -1
  5. package/bin/register-core-commands.js +23 -28
  6. package/bin/register-maintenance-commands.js +39 -3
  7. package/bin/register-query-commands.js +58 -29
  8. package/bin/register-tailscale-commands.js +106 -0
  9. package/bin/register-task-commands.js +18 -1
  10. package/bin/register-task-commands.test.js +16 -0
  11. package/bin/register-vault-operations-commands.js +29 -1
  12. package/bin/register-workgraph-commands.js +451 -0
  13. package/dashboard/lib/graph-diff.js +104 -0
  14. package/dashboard/lib/graph-diff.test.js +75 -0
  15. package/dashboard/lib/vault-parser.js +556 -0
  16. package/dashboard/lib/vault-parser.test.js +254 -0
  17. package/dashboard/public/app.js +796 -0
  18. package/dashboard/public/index.html +52 -0
  19. package/dashboard/public/styles.css +221 -0
  20. package/dashboard/server.js +374 -0
  21. package/dist/{chunk-C7OK5WKP.js → chunk-2JQ3O2YL.js} +4 -4
  22. package/dist/{chunk-VR5NE7PZ.js → chunk-2RAZ4ZFE.js} +1 -1
  23. package/dist/{chunk-F2JEUD4J.js → chunk-4ITRXIVT.js} +5 -7
  24. package/dist/{chunk-GUKMRGM7.js → chunk-4OXMU5S2.js} +1 -1
  25. package/dist/chunk-5PJ4STIC.js +465 -0
  26. package/dist/{chunk-62YTUT6J.js → chunk-AZYOKJYC.js} +2 -2
  27. package/dist/chunk-BSJ6RIT7.js +447 -0
  28. package/dist/chunk-ECRZL5XR.js +50 -0
  29. package/dist/chunk-ERNE2FZ5.js +189 -0
  30. package/dist/{chunk-WAZ3NLWL.js → chunk-F55HGNU4.js} +0 -47
  31. package/dist/{chunk-VGLOTGAS.js → chunk-FAKNOB7Y.js} +2 -2
  32. package/dist/{chunk-QK3UCXWL.js → chunk-FHFUXL6G.js} +2 -2
  33. package/dist/chunk-GNJL4YGR.js +79 -0
  34. package/dist/chunk-HR4KN6S2.js +152 -0
  35. package/dist/{chunk-OZ7RIXTO.js → chunk-IIOU45CK.js} +1 -1
  36. package/dist/chunk-IJBFGPCS.js +33 -0
  37. package/dist/chunk-IVRIKYFE.js +520 -0
  38. package/dist/chunk-K7PNYS45.js +93 -0
  39. package/dist/chunk-MDIH26GC.js +183 -0
  40. package/dist/{chunk-LYHGEHXG.js → chunk-MFAWT5O5.js} +0 -1
  41. package/dist/{chunk-H34S76MB.js → chunk-MNPUYCHQ.js} +6 -6
  42. package/dist/chunk-NTOPJI7W.js +207 -0
  43. package/dist/{chunk-QBLMXKF2.js → chunk-OIWVQYQF.js} +1 -1
  44. package/dist/chunk-PG56HX5T.js +154 -0
  45. package/dist/{chunk-LNJA2UGL.js → chunk-PI4WMLMG.js} +7 -84
  46. package/dist/chunk-QMHPQYUV.js +363 -0
  47. package/dist/{chunk-H62BP7RI.js → chunk-QPDDIHXE.js} +209 -43
  48. package/dist/{chunk-N2AXRYLC.js → chunk-QWQ3TIKS.js} +1 -1
  49. package/dist/{chunk-3DHXQHYG.js → chunk-R2MIW5G7.js} +1 -1
  50. package/dist/{chunk-SJSFRIYS.js → chunk-S5OJEGFG.js} +2 -2
  51. package/dist/chunk-SS4B7P7V.js +99 -0
  52. package/dist/chunk-TIGW564L.js +628 -0
  53. package/dist/chunk-U67V476Y.js +35 -0
  54. package/dist/{chunk-JY6FYXIT.js → chunk-UCQAOZHW.js} +6 -11
  55. package/dist/{chunk-ITPEXLHA.js → chunk-URXDAUVH.js} +24 -5
  56. package/dist/chunk-WIOLLGAD.js +190 -0
  57. package/dist/{chunk-3WRJEKN4.js → chunk-WJVWINEM.js} +72 -8
  58. package/dist/chunk-WMGIIABP.js +15 -0
  59. package/dist/{chunk-33UGEQRT.js → chunk-X3SPPUFG.js} +151 -64
  60. package/dist/{chunk-3NSBOUT3.js → chunk-Y3TIJEBP.js} +314 -79
  61. package/dist/chunk-Y6VJKXGL.js +373 -0
  62. package/dist/{chunk-LI4O6NVK.js → chunk-YDWHS4LJ.js} +49 -9
  63. package/dist/{chunk-U55BGUAU.js → chunk-YNIPYN4F.js} +5 -5
  64. package/dist/chunk-YXQCA6B7.js +226 -0
  65. package/dist/cli/index.js +26 -22
  66. package/dist/commands/archive.js +3 -3
  67. package/dist/commands/backlog.js +3 -3
  68. package/dist/commands/blocked.js +3 -3
  69. package/dist/commands/canvas.d.ts +15 -0
  70. package/dist/commands/canvas.js +200 -0
  71. package/dist/commands/checkpoint.js +2 -2
  72. package/dist/commands/compat.js +2 -2
  73. package/dist/commands/context.js +7 -5
  74. package/dist/commands/doctor.d.ts +11 -7
  75. package/dist/commands/doctor.js +16 -14
  76. package/dist/commands/embed.js +5 -6
  77. package/dist/commands/entities.js +2 -2
  78. package/dist/commands/graph.js +3 -3
  79. package/dist/commands/inject.d.ts +1 -1
  80. package/dist/commands/inject.js +4 -5
  81. package/dist/commands/kanban.js +4 -4
  82. package/dist/commands/link.js +2 -2
  83. package/dist/commands/migrate-observations.js +4 -4
  84. package/dist/commands/observe.d.ts +0 -1
  85. package/dist/commands/observe.js +13 -12
  86. package/dist/commands/project.js +5 -5
  87. package/dist/commands/rebuild-embeddings.d.ts +21 -0
  88. package/dist/commands/rebuild-embeddings.js +91 -0
  89. package/dist/commands/rebuild.js +12 -11
  90. package/dist/commands/recover.js +3 -3
  91. package/dist/commands/reflect.js +6 -7
  92. package/dist/commands/repair-session.js +1 -1
  93. package/dist/commands/replay.js +14 -14
  94. package/dist/commands/session-recap.js +1 -1
  95. package/dist/commands/setup.d.ts +2 -89
  96. package/dist/commands/setup.js +3 -21
  97. package/dist/commands/shell-init.js +1 -1
  98. package/dist/commands/sleep.d.ts +1 -1
  99. package/dist/commands/sleep.js +18 -17
  100. package/dist/commands/status.d.ts +2 -0
  101. package/dist/commands/status.js +40 -30
  102. package/dist/commands/sync-bd.d.ts +10 -0
  103. package/dist/commands/sync-bd.js +10 -0
  104. package/dist/commands/tailscale.d.ts +52 -0
  105. package/dist/commands/tailscale.js +26 -0
  106. package/dist/commands/task.js +4 -4
  107. package/dist/commands/template.js +2 -2
  108. package/dist/commands/wake.d.ts +1 -1
  109. package/dist/commands/wake.js +11 -10
  110. package/dist/index.d.ts +334 -191
  111. package/dist/index.js +432 -108
  112. package/dist/{inject-Bzi5E-By.d.ts → inject-DYUrDqQO.d.ts} +3 -3
  113. package/dist/ledger-B7g7jhqG.d.ts +44 -0
  114. package/dist/lib/auto-linker.js +1 -1
  115. package/dist/lib/canvas-layout.d.ts +115 -0
  116. package/dist/lib/canvas-layout.js +35 -0
  117. package/dist/lib/config.d.ts +27 -3
  118. package/dist/lib/config.js +4 -2
  119. package/dist/lib/entity-index.js +1 -1
  120. package/dist/lib/project-utils.js +4 -4
  121. package/dist/lib/session-repair.js +1 -1
  122. package/dist/lib/session-utils.js +1 -1
  123. package/dist/lib/tailscale.d.ts +225 -0
  124. package/dist/lib/tailscale.js +50 -0
  125. package/dist/lib/task-utils.js +3 -3
  126. package/dist/lib/template-engine.js +1 -1
  127. package/dist/lib/webdav.d.ts +109 -0
  128. package/dist/lib/webdav.js +35 -0
  129. package/dist/plugin/index.d.ts +344 -28
  130. package/dist/plugin/index.js +3919 -227
  131. package/dist/registry-BR4326o0.d.ts +30 -0
  132. package/dist/store-CA-6sKCJ.d.ts +34 -0
  133. package/dist/thread-B9LhXNU0.d.ts +41 -0
  134. package/dist/{types-Y2_Um2Ls.d.ts → types-BbWJoC1c.d.ts} +1 -44
  135. package/dist/workgraph/index.d.ts +5 -0
  136. package/dist/workgraph/index.js +23 -0
  137. package/dist/workgraph/ledger.d.ts +2 -0
  138. package/dist/workgraph/ledger.js +25 -0
  139. package/dist/workgraph/registry.d.ts +2 -0
  140. package/dist/workgraph/registry.js +19 -0
  141. package/dist/workgraph/store.d.ts +2 -0
  142. package/dist/workgraph/store.js +25 -0
  143. package/dist/workgraph/thread.d.ts +2 -0
  144. package/dist/workgraph/thread.js +25 -0
  145. package/dist/workgraph/types.d.ts +54 -0
  146. package/dist/workgraph/types.js +7 -0
  147. package/hooks/clawvault/HOOK.md +113 -0
  148. package/hooks/clawvault/handler.js +1559 -0
  149. package/hooks/clawvault/handler.test.js +510 -0
  150. package/hooks/clawvault/openclaw.plugin.json +72 -0
  151. package/openclaw.plugin.json +235 -30
  152. package/package.json +20 -20
  153. package/dist/chunk-3RG5ZIWI.js +0 -10
  154. package/dist/chunk-3ZIH425O.js +0 -871
  155. package/dist/chunk-6U6MK36V.js +0 -205
  156. package/dist/chunk-CMB7UL7C.js +0 -327
  157. package/dist/chunk-D2H45LON.js +0 -1074
  158. package/dist/chunk-E7MFQB6D.js +0 -163
  159. package/dist/chunk-GQSLDZTS.js +0 -560
  160. package/dist/chunk-MFM6K7PU.js +0 -374
  161. package/dist/chunk-MXSSG3QU.js +0 -42
  162. package/dist/chunk-OCGVIN3L.js +0 -88
  163. package/dist/chunk-PAH27GSN.js +0 -108
  164. package/dist/chunk-YCUNCH2I.js +0 -78
  165. package/dist/cli/index.cjs +0 -8584
  166. package/dist/cli/index.d.cts +0 -5
  167. package/dist/commands/archive.cjs +0 -287
  168. package/dist/commands/archive.d.cts +0 -11
  169. package/dist/commands/backlog.cjs +0 -721
  170. package/dist/commands/backlog.d.cts +0 -53
  171. package/dist/commands/blocked.cjs +0 -204
  172. package/dist/commands/blocked.d.cts +0 -26
  173. package/dist/commands/checkpoint.cjs +0 -244
  174. package/dist/commands/checkpoint.d.cts +0 -41
  175. package/dist/commands/compat.cjs +0 -294
  176. package/dist/commands/compat.d.cts +0 -28
  177. package/dist/commands/context.cjs +0 -2990
  178. package/dist/commands/context.d.cts +0 -2
  179. package/dist/commands/doctor.cjs +0 -2986
  180. package/dist/commands/doctor.d.cts +0 -21
  181. package/dist/commands/embed.cjs +0 -232
  182. package/dist/commands/embed.d.cts +0 -17
  183. package/dist/commands/entities.cjs +0 -141
  184. package/dist/commands/entities.d.cts +0 -7
  185. package/dist/commands/graph.cjs +0 -501
  186. package/dist/commands/graph.d.cts +0 -21
  187. package/dist/commands/inject.cjs +0 -1636
  188. package/dist/commands/inject.d.cts +0 -2
  189. package/dist/commands/kanban.cjs +0 -884
  190. package/dist/commands/kanban.d.cts +0 -63
  191. package/dist/commands/link.cjs +0 -965
  192. package/dist/commands/link.d.cts +0 -11
  193. package/dist/commands/migrate-observations.cjs +0 -362
  194. package/dist/commands/migrate-observations.d.cts +0 -19
  195. package/dist/commands/observe.cjs +0 -4099
  196. package/dist/commands/observe.d.cts +0 -23
  197. package/dist/commands/project.cjs +0 -1341
  198. package/dist/commands/project.d.cts +0 -85
  199. package/dist/commands/rebuild.cjs +0 -3136
  200. package/dist/commands/rebuild.d.cts +0 -11
  201. package/dist/commands/recover.cjs +0 -361
  202. package/dist/commands/recover.d.cts +0 -38
  203. package/dist/commands/reflect.cjs +0 -1008
  204. package/dist/commands/reflect.d.cts +0 -11
  205. package/dist/commands/repair-session.cjs +0 -457
  206. package/dist/commands/repair-session.d.cts +0 -38
  207. package/dist/commands/replay.cjs +0 -4103
  208. package/dist/commands/replay.d.cts +0 -16
  209. package/dist/commands/session-recap.cjs +0 -353
  210. package/dist/commands/session-recap.d.cts +0 -27
  211. package/dist/commands/setup.cjs +0 -1278
  212. package/dist/commands/setup.d.cts +0 -99
  213. package/dist/commands/shell-init.cjs +0 -75
  214. package/dist/commands/shell-init.d.cts +0 -7
  215. package/dist/commands/sleep.cjs +0 -6029
  216. package/dist/commands/sleep.d.cts +0 -36
  217. package/dist/commands/status.cjs +0 -2737
  218. package/dist/commands/status.d.cts +0 -52
  219. package/dist/commands/task.cjs +0 -1236
  220. package/dist/commands/task.d.cts +0 -97
  221. package/dist/commands/template.cjs +0 -457
  222. package/dist/commands/template.d.cts +0 -36
  223. package/dist/commands/wake.cjs +0 -2627
  224. package/dist/commands/wake.d.cts +0 -22
  225. package/dist/context-BUGaWpyL.d.cts +0 -46
  226. package/dist/index.cjs +0 -12373
  227. package/dist/index.d.cts +0 -854
  228. package/dist/inject-Bzi5E-By.d.cts +0 -137
  229. package/dist/lib/auto-linker.cjs +0 -176
  230. package/dist/lib/auto-linker.d.cts +0 -26
  231. package/dist/lib/config.cjs +0 -78
  232. package/dist/lib/config.d.cts +0 -11
  233. package/dist/lib/entity-index.cjs +0 -84
  234. package/dist/lib/entity-index.d.cts +0 -26
  235. package/dist/lib/project-utils.cjs +0 -864
  236. package/dist/lib/project-utils.d.cts +0 -97
  237. package/dist/lib/session-repair.cjs +0 -239
  238. package/dist/lib/session-repair.d.cts +0 -110
  239. package/dist/lib/session-utils.cjs +0 -209
  240. package/dist/lib/session-utils.d.cts +0 -63
  241. package/dist/lib/task-utils.cjs +0 -1137
  242. package/dist/lib/task-utils.d.cts +0 -208
  243. package/dist/lib/template-engine.cjs +0 -47
  244. package/dist/lib/template-engine.d.cts +0 -11
  245. package/dist/plugin/index.cjs +0 -1907
  246. package/dist/plugin/index.d.cts +0 -36
  247. package/dist/plugin/inject.cjs +0 -356
  248. package/dist/plugin/inject.d.cts +0 -54
  249. package/dist/plugin/inject.d.ts +0 -54
  250. package/dist/plugin/inject.js +0 -17
  251. package/dist/plugin/observe.cjs +0 -631
  252. package/dist/plugin/observe.d.cts +0 -39
  253. package/dist/plugin/observe.d.ts +0 -39
  254. package/dist/plugin/observe.js +0 -18
  255. package/dist/plugin/templates.cjs +0 -593
  256. package/dist/plugin/templates.d.cts +0 -52
  257. package/dist/plugin/templates.d.ts +0 -52
  258. package/dist/plugin/templates.js +0 -25
  259. package/dist/plugin/types.cjs +0 -18
  260. package/dist/plugin/types.d.cts +0 -209
  261. package/dist/plugin/types.d.ts +0 -209
  262. package/dist/plugin/types.js +0 -0
  263. package/dist/plugin/vault.cjs +0 -927
  264. package/dist/plugin/vault.d.cts +0 -68
  265. package/dist/plugin/vault.d.ts +0 -68
  266. package/dist/plugin/vault.js +0 -22
  267. package/dist/types-Y2_Um2Ls.d.cts +0 -205
  268. package/templates/memory-event.md +0 -67
  269. package/templates/party.md +0 -63
  270. package/templates/primitive-registry.yaml +0 -551
  271. package/templates/run.md +0 -68
  272. package/templates/trigger.md +0 -68
  273. package/templates/workspace.md +0 -50
package/dist/index.d.cts DELETED
@@ -1,854 +0,0 @@
1
- import { Command } from 'commander';
2
- import { V as VaultConfig, S as StoreOptions, D as Document, a as SearchOptions, b as SearchResult, c as SyncOptions, d as SyncResult, C as Category, M as MemoryType, H as HandoffDocument, e as SessionRecap, E as ExtractedDate, f as ExtractedPreference } from './types-Y2_Um2Ls.cjs';
3
- export { g as DEFAULT_CATEGORIES, h as DEFAULT_CONFIG, i as MEMORY_TYPES, T as TYPE_TO_CATEGORY, j as VaultMeta } from './types-Y2_Um2Ls.cjs';
4
- export { setupCommand } from './commands/setup.cjs';
5
- export { CompatCheck, CompatCommandOptions, CompatReport, CompatStatus, checkOpenClawCompatibility, compatCommand, compatibilityExitCode } from './commands/compat.cjs';
6
- export { GraphSummary, graphCommand, graphSummary } from './commands/graph.cjs';
7
- export { KanbanGroupBy, KanbanImportChange, KanbanImportOptions, KanbanImportResult, KanbanLane, KanbanSyncOptions, KanbanSyncResult, ParsedKanbanBoard, ParsedKanbanLane, buildKanbanLanes, extractCardSlug, formatKanbanCard, generateKanbanMarkdown, importKanbanBoard, kanbanCommand, parseKanbanMarkdown, syncKanbanBoard } from './commands/kanban.cjs';
8
- 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.cjs';
9
- 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, L as LlmCompletionOptions, i as LlmProvider, 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-Bzi5E-By.cjs';
10
- export { ObserveCommandOptions, observeCommand, registerObserveCommand } from './commands/observe.cjs';
11
- export { ReflectCommandOptions, reflectCommand, registerReflectCommand } from './commands/reflect.cjs';
12
- export { ArchiveCommandOptions, archiveCommand, registerArchiveCommand } from './commands/archive.cjs';
13
- export { RebuildCommandOptions, rebuildCommand, registerRebuildCommand } from './commands/rebuild.cjs';
14
- export { DoctorCheck, DoctorReport, DoctorStatus, doctor } from './commands/doctor.cjs';
15
- export { EmbedCommandOptions, EmbedCommandResult, embedCommand, registerEmbedCommand } from './commands/embed.cjs';
16
- export { ReplayCommandOptions, registerReplayCommand, replayCommand } from './commands/replay.cjs';
17
- export { MigrateObservationsOptions, MigrateObservationsResult, migrateObservations, migrateObservationsCommand, registerMigrateObservationsCommand } from './commands/migrate-observations.cjs';
18
- export { SessionRecapFormat, SessionRecapOptions, SessionRecapResult, SessionTurn, buildSessionRecap, formatSessionRecapMarkdown, sessionRecapCommand } from './commands/session-recap.cjs';
19
- export { findNearestVaultPath, getVaultPath, resolveVaultPath } from './lib/config.cjs';
20
- export { registerCliCommands } from './cli/index.cjs';
21
- import { TaskStatus } from './lib/task-utils.cjs';
22
- export { completeTask, listDependentTasks, listSubtasks, updateTask } from './lib/task-utils.cjs';
23
- export { TemplateVariables, buildTemplateVariables, renderTemplate } from './lib/template-engine.cjs';
24
- export { Project, ProjectFrontmatter, ProjectStatus, archiveProject, createProject, getProjectActivity, getProjectTasks, listProjects, readProject, updateProject } from './lib/project-utils.cjs';
25
-
26
- /**
27
- * ClawVault - The elephant's memory
28
- */
29
-
30
- declare class ClawVault {
31
- private config;
32
- private search;
33
- private initialized;
34
- constructor(vaultPath: string);
35
- /**
36
- * Initialize a new vault
37
- */
38
- init(options?: Partial<VaultConfig>, initFlags?: {
39
- skipBases?: boolean;
40
- skipTasks?: boolean;
41
- skipGraph?: boolean;
42
- }): Promise<void>;
43
- private createBasesFiles;
44
- /**
45
- * Load an existing vault
46
- */
47
- load(): Promise<void>;
48
- /**
49
- * Reindex all documents
50
- */
51
- reindex(): Promise<number>;
52
- /**
53
- * Load a document from disk
54
- */
55
- private loadDocument;
56
- /**
57
- * Store a new document
58
- */
59
- store(options: StoreOptions): Promise<Document>;
60
- /**
61
- * Quick store to inbox
62
- */
63
- capture(note: string, title?: string): Promise<Document>;
64
- /**
65
- * Search the vault (BM25 via qmd)
66
- */
67
- find(query: string, options?: SearchOptions): Promise<SearchResult[]>;
68
- /**
69
- * Semantic/vector search (via qmd vsearch)
70
- */
71
- vsearch(query: string, options?: SearchOptions): Promise<SearchResult[]>;
72
- /**
73
- * Combined search with query expansion (via qmd query)
74
- */
75
- query(query: string, options?: SearchOptions): Promise<SearchResult[]>;
76
- /**
77
- * Get a document by ID or path
78
- */
79
- get(idOrPath: string): Promise<Document | null>;
80
- /**
81
- * List documents in a category
82
- */
83
- list(category?: string): Promise<Document[]>;
84
- /**
85
- * Sync vault to another location (for Obsidian on Windows, etc.)
86
- */
87
- sync(options: SyncOptions): Promise<SyncResult>;
88
- /**
89
- * Get vault statistics
90
- */
91
- stats(): Promise<{
92
- documents: number;
93
- categories: {
94
- [key: string]: number;
95
- };
96
- links: number;
97
- tags: string[];
98
- }>;
99
- /**
100
- * Get all categories
101
- */
102
- getCategories(): Category[];
103
- /**
104
- * Check if vault is initialized
105
- */
106
- isInitialized(): boolean;
107
- /**
108
- * Get vault path
109
- */
110
- getPath(): string;
111
- /**
112
- * Get vault name
113
- */
114
- getName(): string;
115
- /**
116
- * Get qmd collection name
117
- */
118
- getQmdCollection(): string;
119
- /**
120
- * Get qmd collection root
121
- */
122
- getQmdRoot(): string;
123
- /**
124
- * Store a memory with type classification
125
- * Automatically routes to correct category based on type
126
- */
127
- remember(type: MemoryType, title: string, content: string, frontmatter?: Record<string, unknown>): Promise<Document>;
128
- /**
129
- * Create a session handoff document
130
- * Call this before context death or long pauses
131
- */
132
- createHandoff(handoff: Omit<HandoffDocument, 'created'>): Promise<Document>;
133
- /**
134
- * Format handoff as readable markdown
135
- */
136
- private formatHandoff;
137
- /**
138
- * Generate a session recap - who I was
139
- * Call this on bootstrap to restore context
140
- */
141
- generateRecap(options?: {
142
- handoffLimit?: number;
143
- brief?: boolean;
144
- }): Promise<SessionRecap>;
145
- /**
146
- * Format recap as readable markdown for injection
147
- */
148
- formatRecap(recap: SessionRecap, options?: {
149
- brief?: boolean;
150
- }): string;
151
- /**
152
- * Parse a handoff document back into structured form
153
- */
154
- private parseHandoff;
155
- private applyQmdConfig;
156
- private slugify;
157
- private saveIndex;
158
- private createTemplates;
159
- private createWelcomeNote;
160
- private syncMemoryGraphIndex;
161
- private generateReadme;
162
- private getCategoryDescription;
163
- }
164
- /**
165
- * Find and open the nearest vault (walks up directory tree)
166
- */
167
- declare function findVault(startPath?: string): Promise<ClawVault | null>;
168
- /**
169
- * Create a new vault
170
- */
171
- declare function createVault(vaultPath: string, options?: Partial<VaultConfig>, initFlags?: {
172
- skipBases?: boolean;
173
- skipTasks?: boolean;
174
- skipGraph?: boolean;
175
- }): Promise<ClawVault>;
176
-
177
- interface ReweaveCommandOptions {
178
- vaultPath?: string;
179
- since?: string;
180
- dryRun?: boolean;
181
- threshold?: number;
182
- }
183
- declare function reweaveCommand(options: ReweaveCommandOptions): Promise<void>;
184
- declare function registerReweaveCommand(program: Command): void;
185
-
186
- declare const OBSERVATION_TYPES: readonly ["decision", "preference", "fact", "commitment", "task", "todo", "commitment-unresolved", "milestone", "lesson", "relationship", "project"];
187
- type ObservationType = typeof OBSERVATION_TYPES[number];
188
- type LegacyObservationPriority = '🔴' | '🟡' | '🟢';
189
- type ObservationLineKind = 'scored' | 'emoji';
190
- interface ParsedObservationRecord {
191
- date: string;
192
- type: ObservationType;
193
- confidence: number;
194
- importance: number;
195
- content: string;
196
- format: ObservationLineKind;
197
- priority?: LegacyObservationPriority;
198
- time?: string;
199
- rawLine: string;
200
- }
201
-
202
- /**
203
- * Reweave — Backward memory consolidation for ClawVault
204
- *
205
- * When new observations are written, reweave performs a backward pass over
206
- * existing observations to detect knowledge updates (same entity, new value).
207
- * Older observations are marked as superseded so search always returns the
208
- * latest version of a fact.
209
- *
210
- * Design inspired by Ars Contexta's "notes are hypotheses" philosophy —
211
- * every observation is a claim that can be superseded by newer evidence.
212
- */
213
-
214
- interface SupersessionRecord {
215
- /** The older observation that was superseded */
216
- oldObservation: ParsedObservationRecord;
217
- /** The newer observation that supersedes it */
218
- newObservation: ParsedObservationRecord;
219
- /** File path of the older observation */
220
- oldFile: string;
221
- /** File path of the newer observation */
222
- newFile: string;
223
- /** Reason for supersession */
224
- reason: string;
225
- /** Timestamp of detection */
226
- detectedAt: string;
227
- }
228
- interface ReweaveResult {
229
- /** Number of observation files scanned */
230
- filesScanned: number;
231
- /** Number of individual observations checked */
232
- observationsChecked: number;
233
- /** Supersession records found/applied */
234
- supersessions: SupersessionRecord[];
235
- /** Whether this was a dry run */
236
- dryRun: boolean;
237
- }
238
- interface ReweaveOptions {
239
- vaultPath: string;
240
- /** Only process observations since this date (YYYY-MM-DD) */
241
- since?: string;
242
- /** Dry run — report but don't write */
243
- dryRun?: boolean;
244
- /** Similarity threshold for entity matching (0-1). Default 0.6 */
245
- similarityThreshold?: number;
246
- }
247
- declare function isSuperseded(line: string): boolean;
248
- declare function getSupersessionInfo(line: string): {
249
- supersededBy: string;
250
- detectedAt: string;
251
- } | null;
252
- /**
253
- * Extract key entities/subjects from an observation for matching.
254
- * Returns normalized tokens that represent the "what" of the observation.
255
- */
256
- declare function extractEntities(content: string): string[];
257
- /**
258
- * Compute similarity between two observations based on entity overlap.
259
- * Returns 0-1 where 1 = identical entities.
260
- */
261
- declare function entitySimilarity(a: string[], b: string[]): number;
262
- /**
263
- * Check if two observations represent a knowledge update.
264
- * Both must be about the same entity/subject but with different values.
265
- *
266
- * Heuristic: high entity overlap + different observation content = update.
267
- * Same content = duplicate, not update.
268
- */
269
- declare function isKnowledgeUpdate(older: ParsedObservationRecord, newer: ParsedObservationRecord, threshold?: number): {
270
- isUpdate: boolean;
271
- reason: string;
272
- };
273
- /**
274
- * Run backward consolidation across observations.
275
- *
276
- * For each newer observation, check all older observations for knowledge updates.
277
- * When found, mark the older one as superseded.
278
- */
279
- declare function reweave(options: ReweaveOptions): ReweaveResult;
280
- /**
281
- * Filter search results to prefer latest versions of superseded observations.
282
- * When multiple observations cover the same entity, only keep the newest.
283
- *
284
- * This is called from the search pipeline to boost knowledge update accuracy.
285
- */
286
- declare function filterSuperseded(lines: string[]): string[];
287
- /**
288
- * Given observation markdown content, return only non-superseded lines.
289
- * Preserves date headings and structure.
290
- */
291
- declare function stripSupersededObservations(markdown: string): string;
292
-
293
- /**
294
- * ClawVault Search Engine - qmd Backend
295
- * Uses qmd CLI for BM25 and vector search
296
- *
297
- * v2.7.0 enhancements:
298
- * 1. Chunk-level BM25 pre-filtering (from eval v4 adapter)
299
- * 2. Exhaustive threshold-based retrieval (from eval v6 adapter)
300
- * 3. Preference extraction pipeline (from eval v3 adapter)
301
- * 4. Temporal date indexing at ingest time (from eval v8 design)
302
- */
303
-
304
- declare const QMD_INSTALL_URL = "https://github.com/tobi/qmd";
305
- declare const QMD_INSTALL_COMMAND = "bun install -g github:tobi/qmd";
306
- declare class QmdUnavailableError extends Error {
307
- constructor(message?: string);
308
- }
309
- /**
310
- * Check if qmd is available
311
- */
312
- declare function hasQmd(): boolean;
313
- /**
314
- * Trigger qmd update (reindex)
315
- */
316
- declare function qmdUpdate(collection?: string, indexName?: string): void;
317
- /**
318
- * Trigger qmd embed (create/update vector embeddings)
319
- */
320
- declare function qmdEmbed(collection?: string, indexName?: string): void;
321
- /**
322
- * Split text into ~maxChars sentence-aligned chunks with overlap.
323
- */
324
- declare function sentenceChunk(text: string, maxChars?: number, overlapSentences?: number): string[];
325
- /**
326
- * BM25-rank chunks within a document by keyword overlap.
327
- * Returns the top `max` chunks sorted by relevance, always including the
328
- * first chunk (session context) when available.
329
- */
330
- declare function bm25RankChunks(chunks: string[], terms: string[], max?: number): {
331
- text: string;
332
- score: number;
333
- }[];
334
- /**
335
- * Extract all date references from text content. Designed to run at ingest
336
- * time so temporal queries can use structured dates + JS arithmetic instead
337
- * of relying on LLM date math at query time.
338
- */
339
- declare function extractDates(text: string, sessionDateStr?: string): ExtractedDate[];
340
- /**
341
- * Extract user preferences from conversation text. Runs at ingest time to
342
- * build a structured preference index for personalised recommendations.
343
- */
344
- declare function extractPreferences(text: string, documentId?: string): ExtractedPreference[];
345
- declare function classifyQuestion(q: string): 'preference' | 'temporal' | 'aggregation' | 'default';
346
- /**
347
- * QMD Search Engine - wraps qmd CLI
348
- */
349
- declare class SearchEngine {
350
- private documents;
351
- private collection;
352
- private vaultPath;
353
- private collectionRoot;
354
- private qmdIndexName?;
355
- /** v2.7 — Per-document date index built at ingest time */
356
- private dateIndex;
357
- /** v2.7 — Per-document preference index built at ingest time */
358
- private preferenceIndex;
359
- /** v2.7 — Per-document chunk cache for BM25 pre-filtering */
360
- private chunkCache;
361
- /**
362
- * Set the collection name (usually vault name)
363
- */
364
- setCollection(name: string): void;
365
- /**
366
- * Set the vault path for file resolution
367
- */
368
- setVaultPath(vaultPath: string): void;
369
- /**
370
- * Set the collection root for qmd:// URI resolution
371
- */
372
- setCollectionRoot(root: string): void;
373
- /**
374
- * Set qmd index name (defaults to qmd global default when omitted)
375
- */
376
- setIndexName(indexName?: string): void;
377
- /**
378
- * Add or update a document in the local cache.
379
- * v2.7: also extracts dates, preferences, and chunks at ingest time.
380
- * Note: qmd indexing happens via qmd update command
381
- */
382
- addDocument(doc: Document): void;
383
- /**
384
- * Remove a document from the local cache
385
- */
386
- removeDocument(id: string): void;
387
- /**
388
- * No-op for qmd - indexing is managed externally
389
- */
390
- rebuildIDF(): void;
391
- /**
392
- * BM25 search via qmd
393
- */
394
- search(query: string, options?: SearchOptions): SearchResult[];
395
- /**
396
- * Vector/semantic search via qmd vsearch
397
- */
398
- vsearch(query: string, options?: SearchOptions): SearchResult[];
399
- /**
400
- * Combined search with query expansion (qmd query command)
401
- */
402
- query(query: string, options?: SearchOptions): SearchResult[];
403
- private runQmdQuery;
404
- /**
405
- * v2.7 — Chunk-level BM25 pre-filtered search. Ranks chunks within each
406
- * document by keyword relevance before semantic ranking, so relevant
407
- * content deep in long documents isn't missed.
408
- *
409
- * Returns results with snippets from the best-matching chunks.
410
- */
411
- chunkPrefilterSearch(query: string, options?: SearchOptions): SearchResult[];
412
- /**
413
- * v2.7 — Exhaustive threshold-based search for aggregation queries.
414
- * Keeps pulling results until relevance drops below threshold.
415
- */
416
- exhaustiveSearch(query: string, threshold?: number, maxResults?: number): SearchResult[];
417
- /**
418
- * v2.7 — Get all extracted dates, optionally filtered by document ids.
419
- */
420
- getDates(documentIds?: string[]): ExtractedDate[];
421
- /**
422
- * v2.7 — Get all extracted preferences, optionally filtered by document ids.
423
- */
424
- getPreferences(documentIds?: string[]): ExtractedPreference[];
425
- /**
426
- * v2.7 — Search with automatic strategy selection based on question type.
427
- * Classifies the query and routes to the appropriate pipeline.
428
- */
429
- smartQuery(query: string, options?: SearchOptions): SearchResult[];
430
- /**
431
- * Convert qmd results to ClawVault SearchResult format
432
- */
433
- private convertResults;
434
- private resolveModifiedAt;
435
- private getRecencyFactor;
436
- /**
437
- * Convert qmd:// URI to file path
438
- */
439
- private qmdUriToPath;
440
- /**
441
- * v2.8 — Filter superseded observation lines from snippet text.
442
- * Ensures search results prefer the latest version of knowledge.
443
- */
444
- private stripSupersededFromSnippet;
445
- /**
446
- * Clean up qmd snippet format
447
- */
448
- private cleanSnippet;
449
- /**
450
- * Get all cached documents
451
- */
452
- getAllDocuments(): Document[];
453
- /**
454
- * Get document count
455
- */
456
- get size(): number;
457
- /**
458
- * Clear the local document cache and all v2.7 indices
459
- */
460
- clear(): void;
461
- /**
462
- * Export documents for persistence
463
- */
464
- export(): {
465
- documents: Document[];
466
- };
467
- /**
468
- * Import from persisted data
469
- */
470
- import(data: {
471
- documents: Document[];
472
- }): void;
473
- }
474
- /**
475
- * Find wiki-links in content
476
- */
477
- declare function extractWikiLinks(content: string): string[];
478
- /**
479
- * Find tags in content (#tag format)
480
- */
481
- declare function extractTags(content: string): string[];
482
-
483
- declare const OBSERVE_PROVIDERS: readonly ["anthropic", "openai", "gemini"];
484
- declare const OBSERVER_COMPRESSION_PROVIDERS: readonly ["anthropic", "openai", "gemini", "openai-compatible", "ollama"];
485
- declare const THEMES: readonly ["neural", "minimal", "none"];
486
- declare const CONTEXT_PROFILES: readonly ["default", "planning", "incident", "handoff", "auto"];
487
- type ObserveProvider = (typeof OBSERVE_PROVIDERS)[number];
488
- type ObserverCompressionProvider = (typeof OBSERVER_COMPRESSION_PROVIDERS)[number];
489
- type Theme = (typeof THEMES)[number];
490
- type ContextProfile = (typeof CONTEXT_PROFILES)[number];
491
- type ManagedConfigKey = 'name' | 'categories' | 'theme' | 'observe.model' | 'observe.provider' | 'observer.compression.provider' | 'observer.compression.model' | 'observer.compression.baseUrl' | 'observer.compression.apiKey' | 'context.maxResults' | 'context.defaultProfile' | 'graph.maxHops' | 'inject.maxResults' | 'inject.useLlm' | 'inject.scope';
492
- interface RouteRule {
493
- pattern: string;
494
- target: string;
495
- priority: number;
496
- }
497
- declare const SUPPORTED_CONFIG_KEYS: ManagedConfigKey[];
498
- declare function listConfig(vaultPath: string): Record<string, unknown>;
499
- declare function getConfig(vaultPath: string): Record<string, unknown>;
500
- declare function getConfigValue(vaultPath: string, key: ManagedConfigKey): unknown;
501
- declare function setConfigValue(vaultPath: string, key: ManagedConfigKey, value: unknown): {
502
- value: unknown;
503
- config: Record<string, unknown>;
504
- };
505
- declare function resetConfig(vaultPath: string): Record<string, unknown>;
506
- declare function listRouteRules(vaultPath: string): RouteRule[];
507
- declare function addRouteRule(vaultPath: string, pattern: string, target: string): RouteRule;
508
- declare function removeRouteRule(vaultPath: string, pattern: string): boolean;
509
- declare function matchRouteRule(text: string, routes: RouteRule[]): RouteRule | null;
510
- declare function testRouteRule(vaultPath: string, text: string): RouteRule | null;
511
-
512
- /**
513
- * Transition Ledger for ClawVault
514
- * Logs task status transitions to JSONL files and supports querying.
515
- */
516
-
517
- interface TransitionEvent {
518
- task_id: string;
519
- agent_id: string;
520
- from_status: TaskStatus;
521
- to_status: TaskStatus;
522
- timestamp: string;
523
- confidence: number;
524
- cost_tokens: number | null;
525
- reason: string | null;
526
- }
527
- declare function isRegression(from: TaskStatus, to: TaskStatus): boolean;
528
- /**
529
- * Append a transition event to the ledger
530
- */
531
- declare function appendTransition(vaultPath: string, event: TransitionEvent): void;
532
- /**
533
- * Build a transition event from context
534
- */
535
- declare function buildTransitionEvent(taskId: string, fromStatus: TaskStatus, toStatus: TaskStatus, options?: {
536
- confidence?: number;
537
- reason?: string;
538
- }): TransitionEvent;
539
- /**
540
- * Read all transition events from all ledger files
541
- */
542
- declare function readAllTransitions(vaultPath: string): TransitionEvent[];
543
- /**
544
- * Query transitions with filters
545
- */
546
- declare function queryTransitions(vaultPath: string, filters?: {
547
- taskId?: string;
548
- agent?: string;
549
- failed?: boolean;
550
- }): TransitionEvent[];
551
- /**
552
- * Count blocked transitions for a task
553
- */
554
- declare function countBlockedTransitions(vaultPath: string, taskId: string): number;
555
- /**
556
- * Format transitions as a table string
557
- */
558
- declare function formatTransitionsTable(events: TransitionEvent[]): string;
559
-
560
- interface CompressorOptions {
561
- provider?: CompressionProvider;
562
- model?: string;
563
- baseUrl?: string;
564
- apiKey?: string;
565
- now?: () => Date;
566
- fetchImpl?: typeof fetch;
567
- }
568
- type CompressionProvider = 'anthropic' | 'openai' | 'gemini' | 'openai-compatible' | 'ollama';
569
- declare class Compressor {
570
- private readonly provider?;
571
- private readonly model?;
572
- private readonly baseUrl?;
573
- private readonly apiKey?;
574
- private readonly now;
575
- private readonly fetchImpl;
576
- constructor(options?: CompressorOptions);
577
- compress(messages: string[], existingObservations: string): Promise<string>;
578
- private resolveProvider;
579
- private resolveConfiguredProvider;
580
- private resolveProviderFromEnv;
581
- private resolveModel;
582
- private resolveApiKey;
583
- private resolveBaseUrl;
584
- private readEnvValue;
585
- private buildPrompt;
586
- private buildOpenAICompatibleUrl;
587
- private buildOpenAICompatibleHeaders;
588
- private extractOpenAIContent;
589
- private callAnthropic;
590
- private callOpenAI;
591
- private callOpenAICompatible;
592
- private callGemini;
593
- private normalizeLlmOutput;
594
- /**
595
- * Fix wiki-link corruption from LLM compression.
596
- * LLMs often fuse preceding word fragments into wiki-links during rewriting:
597
- * "reque[[people/pedro]]" → "[[people/pedro]]"
598
- * "Linke[[agents/zeca]]" → "[[agents/zeca]]"
599
- * "taske[[people/pedro]]a" → "[[people/pedro]]"
600
- * Also fixes trailing word fragments fused after closing brackets.
601
- */
602
- private sanitizeWikiLinks;
603
- private enforceImportanceRules;
604
- private enforceImportanceForRecord;
605
- private fallbackCompression;
606
- private mergeObservations;
607
- private mergeRecord;
608
- private renderSections;
609
- private inferImportance;
610
- private inferConfidence;
611
- private isCriticalContent;
612
- private isNotableContent;
613
- private inferTaskType;
614
- private normalizeText;
615
- private extractDate;
616
- private extractTime;
617
- private formatDate;
618
- private formatTime;
619
- private clamp01;
620
- }
621
-
622
- interface ObserverCompressor {
623
- compress(messages: string[], existingObservations: string): Promise<string>;
624
- }
625
- interface ObserverReflector {
626
- reflect(observations: string): string;
627
- }
628
- interface ObserverOptions {
629
- tokenThreshold?: number;
630
- reflectThreshold?: number;
631
- model?: string;
632
- compressionProvider?: CompressionProvider;
633
- compressionBaseUrl?: string;
634
- compressionApiKey?: string;
635
- compressor?: ObserverCompressor;
636
- reflector?: ObserverReflector;
637
- now?: () => Date;
638
- rawCapture?: boolean;
639
- extractTasks?: boolean;
640
- }
641
- interface ObserverProcessOptions {
642
- source?: string;
643
- sessionKey?: string;
644
- transcriptId?: string;
645
- timestamp?: Date;
646
- }
647
- declare class Observer {
648
- private readonly vaultPath;
649
- private readonly tokenThreshold;
650
- private readonly reflectThreshold;
651
- private readonly compressor;
652
- private readonly reflector;
653
- private readonly now;
654
- private readonly rawCapture;
655
- private readonly router;
656
- private pendingMessages;
657
- private pendingRouteContext;
658
- private observationsCache;
659
- private lastRoutingSummary;
660
- constructor(vaultPath: string, options?: ObserverOptions);
661
- processMessages(messages: string[], options?: ObserverProcessOptions): Promise<void>;
662
- /**
663
- * Force-flush pending messages regardless of threshold.
664
- * Call this on session end to capture everything.
665
- */
666
- flush(): Promise<{
667
- observations: string;
668
- routingSummary: string;
669
- }>;
670
- getObservations(): string;
671
- private estimateTokens;
672
- private readTodayObservations;
673
- private readObservationForDate;
674
- private readObservationFile;
675
- private writeObservationFile;
676
- private deduplicateObservationMarkdown;
677
- private persistRawMessages;
678
- private sanitizeSource;
679
- private mergeRouteContext;
680
- }
681
-
682
- interface ObserveCursorEntry {
683
- lastObservedOffset: number;
684
- lastObservedAt: string;
685
- sessionKey: string;
686
- lastFileSize: number;
687
- }
688
- type ObserveCursorStore = Record<string, ObserveCursorEntry>;
689
- interface ActiveObserveOptions {
690
- vaultPath: string;
691
- agentId?: string;
692
- minNewBytes?: number;
693
- sessionsDir?: string;
694
- dryRun?: boolean;
695
- threshold?: number;
696
- reflectThreshold?: number;
697
- model?: string;
698
- extractTasks?: boolean;
699
- maxSessions?: number;
700
- }
701
- interface ActiveObservationCandidate {
702
- sessionId: string;
703
- sessionKey: string;
704
- sourceLabel: string;
705
- filePath: string;
706
- fileSize: number;
707
- startOffset: number;
708
- newBytes: number;
709
- thresholdBytes: number;
710
- }
711
- interface ActiveObservationFailure {
712
- sessionId: string;
713
- sessionKey: string;
714
- sourceLabel: string;
715
- error: string;
716
- }
717
- interface ActiveObserveResult {
718
- agentId: string;
719
- sessionsDir: string;
720
- checkedSessions: number;
721
- candidateSessions: number;
722
- observedSessions: number;
723
- cursorUpdates: number;
724
- dryRun: boolean;
725
- totalNewBytes: number;
726
- observedNewBytes: number;
727
- routedCounts: Record<string, number>;
728
- failedSessionCount: number;
729
- failedSessions: ActiveObservationFailure[];
730
- candidates: ActiveObservationCandidate[];
731
- }
732
- interface ObserverStalenessResult {
733
- staleCount: number;
734
- oldestMs: number;
735
- newestMs: number;
736
- }
737
- type MinimalObserver = Pick<Observer, 'processMessages' | 'flush'>;
738
- type ObserverFactory = (vaultPath: string, options: ObserverOptions) => MinimalObserver;
739
- interface ActiveObserveDependencies {
740
- createObserver?: ObserverFactory;
741
- now?: () => Date;
742
- }
743
- interface ObserverStalenessOptions {
744
- sessionsDir?: string;
745
- now?: () => Date;
746
- }
747
- declare function getScaledObservationThresholdBytes(fileSizeBytes: number): number;
748
- declare function getObserverStaleness(vaultPath: string, options?: ObserverStalenessOptions): ObserverStalenessResult;
749
- declare function parseSessionSourceLabel(sessionKey: string): string;
750
- declare function observeActiveSessions(options: ActiveObserveOptions, dependencies?: ActiveObserveDependencies): Promise<ActiveObserveResult>;
751
-
752
- interface ReflectorOptions {
753
- now?: () => Date;
754
- }
755
- declare class Reflector {
756
- private readonly now;
757
- constructor(options?: ReflectorOptions);
758
- reflect(observations: string): string;
759
- private buildCutoffDate;
760
- private parseDate;
761
- private parseSections;
762
- private renderSections;
763
- private normalizeText;
764
- private isSimilar;
765
- }
766
-
767
- interface SessionWatcherOptions {
768
- ignoreInitial?: boolean;
769
- debounceMs?: number;
770
- flushThresholdChars?: number;
771
- }
772
- declare class SessionWatcher {
773
- private readonly watchPath;
774
- private readonly observer;
775
- private readonly ignoreInitial;
776
- private readonly debounceMs;
777
- private readonly flushThresholdChars;
778
- private watcher;
779
- private fileOffsets;
780
- private pendingPaths;
781
- private debounceTimer;
782
- private processingQueue;
783
- private bufferedChars;
784
- constructor(watchPath: string, observer: Observer, options?: SessionWatcherOptions);
785
- start(): Promise<void>;
786
- stop(): Promise<void>;
787
- private scheduleDrain;
788
- private drainPendingPaths;
789
- private consumeFile;
790
- private primeInitialOffsets;
791
- private collectFiles;
792
- }
793
-
794
- declare function parseSessionFile(filePath: string): string[];
795
-
796
- interface ArchiveObservationsOptions {
797
- olderThanDays?: number;
798
- dryRun?: boolean;
799
- now?: () => Date;
800
- }
801
- interface ArchiveObservationsResult {
802
- scanned: number;
803
- archived: number;
804
- skipped: number;
805
- dryRun: boolean;
806
- archivedDates: string[];
807
- }
808
- declare function archiveObservations(vaultPath: string, options?: ArchiveObservationsOptions): ArchiveObservationsResult;
809
-
810
- interface ReflectOptions {
811
- vaultPath: string;
812
- days?: number;
813
- dryRun?: boolean;
814
- now?: () => Date;
815
- }
816
- interface ReflectResult {
817
- processedWeeks: number;
818
- writtenWeeks: number;
819
- dryRun: boolean;
820
- files: string[];
821
- archive: ArchiveObservationsResult | null;
822
- }
823
- declare function runReflection(options: ReflectOptions): Promise<ReflectResult>;
824
-
825
- /**
826
- * ClawVault 🐘 — An Elephant Never Forgets
827
- *
828
- * Structured memory system for AI agents with Obsidian-compatible markdown
829
- * and embedded semantic search.
830
- *
831
- * @example
832
- * ```typescript
833
- * import { ClawVault, createVault, findVault } from 'clawvault';
834
- *
835
- * // Create a new vault
836
- * const vault = await createVault('./my-memory');
837
- *
838
- * // Store a memory
839
- * await vault.store({
840
- * category: 'decisions',
841
- * title: 'Use ClawVault',
842
- * content: 'Decided to use ClawVault for memory management.'
843
- * });
844
- *
845
- * // Search memories
846
- * const results = await vault.find('memory management');
847
- * console.log(results);
848
- * ```
849
- */
850
-
851
- declare const VERSION: string;
852
- declare function registerCommanderCommands(program: Command): Command;
853
-
854
- 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, ExtractedDate, ExtractedPreference, HandoffDocument, type ManagedConfigKey, MemoryType, type ObserveCursorEntry, type ObserveCursorStore, type ObserveProvider, Observer, type ObserverCompressionProvider, type ObserverCompressor, type ObserverOptions, type ObserverReflector, type ObserverStalenessResult, QMD_INSTALL_COMMAND, QMD_INSTALL_URL, QmdUnavailableError, type ReflectOptions, type ReflectResult, Reflector, type ReflectorOptions, type ReweaveOptions, type ReweaveResult, type RouteRule, SUPPORTED_CONFIG_KEYS, SearchEngine, SearchOptions, SearchResult, SessionRecap, SessionWatcher, type SessionWatcherOptions, StoreOptions, type SupersessionRecord, SyncOptions, SyncResult, type Theme, type TransitionEvent, VERSION, VaultConfig, addRouteRule, appendTransition, archiveObservations, bm25RankChunks, buildTransitionEvent, classifyQuestion, countBlockedTransitions, createVault, entitySimilarity, extractDates, extractEntities, extractPreferences, extractTags, extractWikiLinks, filterSuperseded, findVault, formatTransitionsTable, getConfig, getConfigValue, getObserverStaleness, getScaledObservationThresholdBytes, getSupersessionInfo, hasQmd, isKnowledgeUpdate, isRegression, isSuperseded, listConfig, listRouteRules, matchRouteRule, observeActiveSessions, parseSessionFile, parseSessionSourceLabel, qmdEmbed, qmdUpdate, queryTransitions, readAllTransitions, registerCommanderCommands, registerReweaveCommand, removeRouteRule, resetConfig, reweave, reweaveCommand, runReflection, sentenceChunk, setConfigValue, stripSupersededObservations, testRouteRule };