clawvault 3.2.1 → 3.3.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 (150) hide show
  1. package/README.md +56 -16
  2. package/bin/clawvault.js +0 -2
  3. package/bin/command-registration.test.js +13 -1
  4. package/bin/help-contract.test.js +14 -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 +57 -6
  8. package/bin/register-query-commands.js +10 -28
  9. package/bin/test-helpers/cli-command-fixtures.js +1 -0
  10. package/dist/chunk-2PKBIKDH.js +130 -0
  11. package/dist/{chunk-U67V476Y.js → chunk-2ZDO52B4.js} +18 -1
  12. package/dist/{chunk-ZZA73MFY.js → chunk-33DOSHTA.js} +176 -36
  13. package/dist/{chunk-AZYOKJYC.js → chunk-4PY655YM.js} +13 -1
  14. package/dist/{chunk-2JQ3O2YL.js → chunk-5EFSWZO6.js} +3 -3
  15. package/dist/{chunk-Y3TIJEBP.js → chunk-7SWP5FKU.js} +34 -613
  16. package/dist/{chunk-4VQTUVH7.js → chunk-7YZWHM36.js} +52 -26
  17. package/dist/{chunk-URXDAUVH.js → chunk-AXSJIFOJ.js} +174 -1
  18. package/dist/{chunk-4ITRXIVT.js → chunk-BLQXXX7Q.js} +6 -6
  19. package/dist/chunk-CSHO3PJB.js +684 -0
  20. package/dist/{chunk-S5OJEGFG.js → chunk-DOIUYIXV.js} +2 -2
  21. package/dist/{chunk-YXQCA6B7.js → chunk-DVOUSOR3.js} +112 -7
  22. package/dist/{chunk-YDWHS4LJ.js → chunk-ECGJYWNA.js} +205 -33
  23. package/dist/{chunk-QMHPQYUV.js → chunk-EL6UBSX5.js} +7 -6
  24. package/dist/chunk-FZ5I2NF7.js +352 -0
  25. package/dist/{chunk-WJVWINEM.js → chunk-GFCHWMGD.js} +55 -6
  26. package/dist/{chunk-GNJL4YGR.js → chunk-GJO3CFUN.js} +30 -6
  27. package/dist/chunk-H3JZIB5O.js +322 -0
  28. package/dist/chunk-HEHO7SMV.js +51 -0
  29. package/dist/{chunk-UCQAOZHW.js → chunk-HGDDW24U.js} +3 -3
  30. package/dist/chunk-J3YUXVID.js +907 -0
  31. package/dist/{chunk-Y6VJKXGL.js → chunk-KCYWJDDW.js} +1 -1
  32. package/dist/{chunk-P5EPF6MB.js → chunk-MW5C6ZQA.js} +110 -13
  33. package/dist/{chunk-YNIPYN4F.js → chunk-OFOCU2V4.js} +6 -5
  34. package/dist/{chunk-42MXU7A6.js → chunk-P62WHA27.js} +58 -47
  35. package/dist/chunk-PTWPPVC7.js +972 -0
  36. package/dist/{chunk-FAKNOB7Y.js → chunk-QFWERBDP.js} +2 -2
  37. package/dist/{chunk-IIOU45CK.js → chunk-S7N7HI5E.js} +2 -2
  38. package/dist/{chunk-ECRZL5XR.js → chunk-T7E764W3.js} +23 -7
  39. package/dist/chunk-TDWFBDAQ.js +1016 -0
  40. package/dist/{chunk-MNPUYCHQ.js → chunk-TWMI3SNN.js} +6 -5
  41. package/dist/{chunk-2RAZ4ZFE.js → chunk-VBILES4B.js} +1 -1
  42. package/dist/{chunk-PI4WMLMG.js → chunk-VXAGOLDP.js} +1 -1
  43. package/dist/chunk-YCUVAOFC.js +158 -0
  44. package/dist/{chunk-SS4B7P7V.js → chunk-YIDV4VV2.js} +1 -1
  45. package/dist/chunk-ZKWPCBYT.js +600 -0
  46. package/dist/cli/index.js +27 -21
  47. package/dist/commands/archive.js +3 -3
  48. package/dist/commands/backlog.js +1 -1
  49. package/dist/commands/benchmark.d.ts +12 -0
  50. package/dist/commands/benchmark.js +12 -0
  51. package/dist/commands/blocked.js +1 -1
  52. package/dist/commands/canvas.js +2 -2
  53. package/dist/commands/checkpoint.js +1 -1
  54. package/dist/commands/compat.js +1 -1
  55. package/dist/commands/context.js +8 -7
  56. package/dist/commands/doctor.d.ts +8 -3
  57. package/dist/commands/doctor.js +8 -22
  58. package/dist/commands/embed.js +6 -5
  59. package/dist/commands/entities.js +2 -2
  60. package/dist/commands/graph.js +4 -4
  61. package/dist/commands/inbox.d.ts +23 -0
  62. package/dist/commands/inbox.js +11 -0
  63. package/dist/commands/inject.d.ts +1 -1
  64. package/dist/commands/inject.js +5 -5
  65. package/dist/commands/kanban.js +1 -1
  66. package/dist/commands/link.js +9 -9
  67. package/dist/commands/maintain.d.ts +32 -0
  68. package/dist/commands/maintain.js +12 -0
  69. package/dist/commands/migrate-observations.js +3 -3
  70. package/dist/commands/observe.js +11 -10
  71. package/dist/commands/project.js +2 -2
  72. package/dist/commands/rebuild-embeddings.js +48 -17
  73. package/dist/commands/rebuild.js +9 -8
  74. package/dist/commands/recover.js +1 -1
  75. package/dist/commands/reflect.js +6 -6
  76. package/dist/commands/repair-session.js +1 -1
  77. package/dist/commands/replay.js +10 -9
  78. package/dist/commands/session-recap.js +1 -1
  79. package/dist/commands/setup.js +4 -3
  80. package/dist/commands/shell-init.js +1 -1
  81. package/dist/commands/sleep.d.ts +1 -1
  82. package/dist/commands/sleep.js +20 -18
  83. package/dist/commands/status.js +40 -26
  84. package/dist/commands/sync-bd.js +3 -3
  85. package/dist/commands/tailscale.js +3 -3
  86. package/dist/commands/task.js +1 -1
  87. package/dist/commands/template.js +1 -1
  88. package/dist/commands/wake.d.ts +1 -1
  89. package/dist/commands/wake.js +10 -9
  90. package/dist/index.d.ts +175 -16
  91. package/dist/index.js +277 -108
  92. package/dist/{inject-DYUrDqQO.d.ts → inject-DEb_jpLi.d.ts} +3 -1
  93. package/dist/lib/auto-linker.js +2 -2
  94. package/dist/lib/canvas-layout.js +1 -1
  95. package/dist/lib/config.js +2 -2
  96. package/dist/lib/entity-index.js +1 -1
  97. package/dist/lib/project-utils.js +2 -2
  98. package/dist/lib/session-repair.js +1 -1
  99. package/dist/lib/session-utils.js +1 -1
  100. package/dist/lib/tailscale.js +1 -1
  101. package/dist/lib/task-utils.js +1 -1
  102. package/dist/lib/template-engine.js +1 -1
  103. package/dist/lib/webdav.js +1 -1
  104. package/dist/onnxruntime_binding-5QEF3SUC.node +0 -0
  105. package/dist/onnxruntime_binding-BKPKNEGC.node +0 -0
  106. package/dist/onnxruntime_binding-FMOXGIUT.node +0 -0
  107. package/dist/onnxruntime_binding-OI2KMXC5.node +0 -0
  108. package/dist/onnxruntime_binding-UX44MLAZ.node +0 -0
  109. package/dist/onnxruntime_binding-Y2W7N7WY.node +0 -0
  110. package/dist/openclaw-plugin.d.ts +8 -0
  111. package/dist/openclaw-plugin.js +14 -0
  112. package/dist/transformers.node-A2ZRORSQ.js +46775 -0
  113. package/dist/{types-BbWJoC1c.d.ts → types-DslKvCaj.d.ts} +51 -1
  114. package/hooks/clawvault/HOOK.md +25 -8
  115. package/hooks/clawvault/handler.js +215 -78
  116. package/hooks/clawvault/handler.test.js +109 -43
  117. package/hooks/clawvault/integrity.js +112 -0
  118. package/hooks/clawvault/integrity.test.js +32 -0
  119. package/hooks/clawvault/openclaw.plugin.json +133 -15
  120. package/openclaw.plugin.json +131 -203
  121. package/package.json +10 -7
  122. package/bin/register-workgraph-commands.js +0 -451
  123. package/dist/chunk-5PJ4STIC.js +0 -465
  124. package/dist/chunk-ERNE2FZ5.js +0 -189
  125. package/dist/chunk-HR4KN6S2.js +0 -152
  126. package/dist/chunk-IJBFGPCS.js +0 -33
  127. package/dist/chunk-K7PNYS45.js +0 -93
  128. package/dist/chunk-NTOPJI7W.js +0 -207
  129. package/dist/chunk-PG56HX5T.js +0 -154
  130. package/dist/chunk-QPDDIHXE.js +0 -501
  131. package/dist/chunk-WIOLLGAD.js +0 -190
  132. package/dist/chunk-WMGIIABP.js +0 -15
  133. package/dist/ledger-B7g7jhqG.d.ts +0 -44
  134. package/dist/plugin/index.d.ts +0 -352
  135. package/dist/plugin/index.js +0 -4264
  136. package/dist/registry-BR4326o0.d.ts +0 -30
  137. package/dist/store-CA-6sKCJ.d.ts +0 -34
  138. package/dist/thread-B9LhXNU0.d.ts +0 -41
  139. package/dist/workgraph/index.d.ts +0 -5
  140. package/dist/workgraph/index.js +0 -23
  141. package/dist/workgraph/ledger.d.ts +0 -2
  142. package/dist/workgraph/ledger.js +0 -25
  143. package/dist/workgraph/registry.d.ts +0 -2
  144. package/dist/workgraph/registry.js +0 -19
  145. package/dist/workgraph/store.d.ts +0 -2
  146. package/dist/workgraph/store.js +0 -25
  147. package/dist/workgraph/thread.d.ts +0 -2
  148. package/dist/workgraph/thread.js +0 -25
  149. package/dist/workgraph/types.d.ts +0 -54
  150. package/dist/workgraph/types.js +0 -7
@@ -1,4 +1,4 @@
1
- import { H as HandoffDocument, D as Document } from '../types-BbWJoC1c.js';
1
+ import { H as HandoffDocument, D as Document } from '../types-DslKvCaj.js';
2
2
 
3
3
  type PromptFn = (question: string) => Promise<string>;
4
4
  interface SleepOptions {
@@ -1,35 +1,37 @@
1
1
  import {
2
- parseSessionFile
3
- } from "../chunk-P5EPF6MB.js";
2
+ clearDirtyFlag
3
+ } from "../chunk-F55HGNU4.js";
4
4
  import {
5
5
  runReflection
6
- } from "../chunk-MNPUYCHQ.js";
6
+ } from "../chunk-TWMI3SNN.js";
7
7
  import {
8
8
  Observer
9
- } from "../chunk-Y3TIJEBP.js";
10
- import "../chunk-AZYOKJYC.js";
9
+ } from "../chunk-7SWP5FKU.js";
10
+ import "../chunk-DVOUSOR3.js";
11
+ import "../chunk-4PY655YM.js";
12
+ import "../chunk-AXSJIFOJ.js";
13
+ import "../chunk-BSJ6RIT7.js";
11
14
  import {
12
15
  ClawVault
13
- } from "../chunk-YDWHS4LJ.js";
14
- import "../chunk-BSJ6RIT7.js";
15
- import "../chunk-FHFUXL6G.js";
16
- import "../chunk-WIOLLGAD.js";
16
+ } from "../chunk-ECGJYWNA.js";
17
+ import "../chunk-2CDEETQN.js";
18
+ import "../chunk-FZ5I2NF7.js";
17
19
  import {
18
20
  qmdUpdate
19
- } from "../chunk-5PJ4STIC.js";
20
- import "../chunk-URXDAUVH.js";
21
- import "../chunk-YXQCA6B7.js";
22
- import "../chunk-2CDEETQN.js";
21
+ } from "../chunk-PTWPPVC7.js";
22
+ import "../chunk-H3JZIB5O.js";
23
23
  import "../chunk-MQUJNOHK.js";
24
- import "../chunk-ZZA73MFY.js";
24
+ import {
25
+ parseSessionFile
26
+ } from "../chunk-MW5C6ZQA.js";
27
+ import "../chunk-J3YUXVID.js";
28
+ import "../chunk-FHFUXL6G.js";
29
+ import "../chunk-33DOSHTA.js";
25
30
  import "../chunk-Z2XBWN7A.js";
26
31
  import "../chunk-QWQ3TIKS.js";
27
32
  import "../chunk-MFAWT5O5.js";
28
33
  import "../chunk-7766SIJP.js";
29
- import {
30
- clearDirtyFlag
31
- } from "../chunk-F55HGNU4.js";
32
- import "../chunk-U67V476Y.js";
34
+ import "../chunk-2ZDO52B4.js";
33
35
 
34
36
  // src/commands/sleep.ts
35
37
  import * as fs from "fs";
@@ -3,38 +3,39 @@ import {
3
3
  } from "../chunk-7ZRP733D.js";
4
4
  import {
5
5
  scanVaultLinks
6
- } from "../chunk-4VQTUVH7.js";
6
+ } from "../chunk-7YZWHM36.js";
7
7
  import "../chunk-J7ZWCI2C.js";
8
8
  import {
9
9
  getObserverStaleness
10
- } from "../chunk-PI4WMLMG.js";
11
- import "../chunk-Y3TIJEBP.js";
12
- import "../chunk-AZYOKJYC.js";
10
+ } from "../chunk-VXAGOLDP.js";
11
+ import "../chunk-7SWP5FKU.js";
13
12
  import "../chunk-HRLWZGMA.js";
13
+ import "../chunk-DVOUSOR3.js";
14
+ import "../chunk-4PY655YM.js";
15
+ import "../chunk-AXSJIFOJ.js";
16
+ import "../chunk-BSJ6RIT7.js";
14
17
  import {
15
18
  ClawVault
16
- } from "../chunk-YDWHS4LJ.js";
17
- import "../chunk-BSJ6RIT7.js";
18
- import "../chunk-FHFUXL6G.js";
19
+ } from "../chunk-ECGJYWNA.js";
20
+ import "../chunk-2CDEETQN.js";
19
21
  import {
20
22
  parseQmdCollectionList
21
- } from "../chunk-WIOLLGAD.js";
23
+ } from "../chunk-FZ5I2NF7.js";
22
24
  import {
23
- QmdUnavailableError,
24
25
  hasQmd,
25
26
  withQmdIndexArgs
26
- } from "../chunk-5PJ4STIC.js";
27
- import "../chunk-URXDAUVH.js";
28
- import "../chunk-YXQCA6B7.js";
29
- import "../chunk-2CDEETQN.js";
27
+ } from "../chunk-PTWPPVC7.js";
28
+ import "../chunk-H3JZIB5O.js";
29
+ import "../chunk-J3YUXVID.js";
30
+ import "../chunk-FHFUXL6G.js";
30
31
  import {
31
32
  loadMemoryGraphIndex
32
- } from "../chunk-ZZA73MFY.js";
33
+ } from "../chunk-33DOSHTA.js";
33
34
  import "../chunk-Z2XBWN7A.js";
34
35
  import "../chunk-QWQ3TIKS.js";
35
36
  import "../chunk-MFAWT5O5.js";
36
37
  import "../chunk-7766SIJP.js";
37
- import "../chunk-U67V476Y.js";
38
+ import "../chunk-2ZDO52B4.js";
38
39
 
39
40
  // src/commands/status.ts
40
41
  import * as fs from "fs";
@@ -87,7 +88,19 @@ function getLatestVaultMarkdownMtime(vaultPath) {
87
88
  return latest;
88
89
  }
89
90
  function getQmdIndexStatus(collection, root, indexName) {
90
- const output = execFileSync("qmd", withQmdIndexArgs(["collection", "list"], indexName), { encoding: "utf-8" });
91
+ let output;
92
+ try {
93
+ output = execFileSync("qmd", withQmdIndexArgs(["collection", "list"], indexName), {
94
+ encoding: "utf-8",
95
+ shell: process.platform === "win32"
96
+ });
97
+ } catch (err) {
98
+ if (err?.status === 1 && err?.stdout) {
99
+ output = err.stdout;
100
+ } else {
101
+ throw err;
102
+ }
103
+ }
91
104
  const collections = parseQmdCollectionList(output);
92
105
  const collectionInfo = collections.find((c) => c.name === collection);
93
106
  if (collectionInfo) {
@@ -112,9 +125,6 @@ function loadCheckpoint(vaultPath) {
112
125
  }
113
126
  }
114
127
  async function getStatus(vaultPath, options = {}) {
115
- if (!hasQmd()) {
116
- throw new QmdUnavailableError();
117
- }
118
128
  const vault = new ClawVault(path.resolve(vaultPath));
119
129
  await vault.load();
120
130
  const stats = await vault.stats();
@@ -144,14 +154,18 @@ async function getStatus(vaultPath, options = {}) {
144
154
  const qmdRoot = vault.getQmdRoot();
145
155
  let qmdIndexResult = { status: "missing" };
146
156
  let qmdError;
147
- try {
148
- qmdIndexResult = getQmdIndexStatus(qmdCollection, qmdRoot, options.qmdIndexName);
149
- if (qmdIndexResult.status !== "present") {
150
- issues.push(`qmd collection ${qmdIndexResult.status.replace("-", " ")}`);
157
+ if (hasQmd()) {
158
+ try {
159
+ qmdIndexResult = getQmdIndexStatus(qmdCollection, qmdRoot, options.qmdIndexName);
160
+ if (qmdIndexResult.status !== "present") {
161
+ issues.push(`qmd collection ${qmdIndexResult.status.replace("-", " ")}`);
162
+ }
163
+ } catch (err) {
164
+ qmdError = err?.message || "Failed to check qmd index";
165
+ issues.push(`qmd status error: ${qmdError}`);
151
166
  }
152
- } catch (err) {
153
- qmdError = err?.message || "Failed to check qmd index";
154
- issues.push(`qmd status error: ${qmdError}`);
167
+ } else {
168
+ qmdError = "qmd not installed (optional)";
155
169
  }
156
170
  let gitStatus;
157
171
  const gitRoot = findGitRoot(vault.getPath());
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  registerSyncBdCommand,
3
3
  syncBdCommand
4
- } from "../chunk-SS4B7P7V.js";
5
- import "../chunk-GNJL4YGR.js";
6
- import "../chunk-U67V476Y.js";
4
+ } from "../chunk-YIDV4VV2.js";
5
+ import "../chunk-GJO3CFUN.js";
6
+ import "../chunk-2ZDO52B4.js";
7
7
  export {
8
8
  registerSyncBdCommand,
9
9
  syncBdCommand
@@ -8,11 +8,11 @@ import {
8
8
  tailscaleServeCommand,
9
9
  tailscaleStatusCommand,
10
10
  tailscaleSyncCommand
11
- } from "../chunk-Y6VJKXGL.js";
11
+ } from "../chunk-KCYWJDDW.js";
12
12
  import "../chunk-TIGW564L.js";
13
13
  import "../chunk-IVRIKYFE.js";
14
- import "../chunk-GNJL4YGR.js";
15
- import "../chunk-U67V476Y.js";
14
+ import "../chunk-GJO3CFUN.js";
15
+ import "../chunk-2ZDO52B4.js";
16
16
  export {
17
17
  registerTailscaleCommands,
18
18
  registerTailscaleDiscoverCommand,
@@ -12,7 +12,7 @@ import {
12
12
  import "../chunk-QWQ3TIKS.js";
13
13
  import "../chunk-MFAWT5O5.js";
14
14
  import "../chunk-7766SIJP.js";
15
- import "../chunk-U67V476Y.js";
15
+ import "../chunk-2ZDO52B4.js";
16
16
  export {
17
17
  formatTaskDetails,
18
18
  formatTaskList,
@@ -10,7 +10,7 @@ import {
10
10
  buildTemplateVariables,
11
11
  renderTemplate
12
12
  } from "../chunk-7766SIJP.js";
13
- import "../chunk-U67V476Y.js";
13
+ import "../chunk-2ZDO52B4.js";
14
14
 
15
15
  // src/commands/template.ts
16
16
  import * as fs from "fs";
@@ -1,4 +1,4 @@
1
- import { S as SessionRecap } from '../types-BbWJoC1c.js';
1
+ import { e as SessionRecap } from '../types-DslKvCaj.js';
2
2
  import { RecoveryInfo } from './recover.js';
3
3
  import './checkpoint.js';
4
4
 
@@ -2,23 +2,24 @@ import {
2
2
  recover
3
3
  } from "../chunk-OIWVQYQF.js";
4
4
  import "../chunk-7ZRP733D.js";
5
+ import {
6
+ clearDirtyFlag
7
+ } from "../chunk-F55HGNU4.js";
5
8
  import {
6
9
  ClawVault
7
- } from "../chunk-YDWHS4LJ.js";
10
+ } from "../chunk-ECGJYWNA.js";
11
+ import "../chunk-2CDEETQN.js";
12
+ import "../chunk-FZ5I2NF7.js";
13
+ import "../chunk-PTWPPVC7.js";
14
+ import "../chunk-H3JZIB5O.js";
8
15
  import {
9
16
  parseObservationMarkdown
10
17
  } from "../chunk-FHFUXL6G.js";
11
- import "../chunk-WIOLLGAD.js";
12
- import "../chunk-5PJ4STIC.js";
13
- import "../chunk-2CDEETQN.js";
14
- import "../chunk-ZZA73MFY.js";
18
+ import "../chunk-33DOSHTA.js";
15
19
  import {
16
20
  listObservationFiles
17
21
  } from "../chunk-Z2XBWN7A.js";
18
- import {
19
- clearDirtyFlag
20
- } from "../chunk-F55HGNU4.js";
21
- import "../chunk-U67V476Y.js";
22
+ import "../chunk-2ZDO52B4.js";
22
23
 
23
24
  // src/commands/wake.ts
24
25
  import * as fs from "fs";
package/dist/index.d.ts CHANGED
@@ -1,20 +1,23 @@
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
4
  export { setupCommand } from './commands/setup.js';
5
5
  export { CompatCheck, CompatCommandOptions, CompatReport, CompatStatus, checkOpenClawCompatibility, compatCommand, compatibilityExitCode } from './commands/compat.js';
6
6
  export { GraphSummary, graphCommand, graphSummary } from './commands/graph.js';
7
7
  export { KanbanGroupBy, KanbanImportChange, KanbanImportOptions, KanbanImportResult, KanbanLane, KanbanSyncOptions, KanbanSyncResult, ParsedKanbanBoard, ParsedKanbanLane, buildKanbanLanes, extractCardSlug, formatKanbanCard, generateKanbanMarkdown, importKanbanBoard, kanbanCommand, parseKanbanMarkdown, syncKanbanBoard } from './commands/kanban.js';
8
+ export { BenchmarkObserverCommandOptions, benchmarkObserverCommand, registerBenchmarkCommand } from './commands/benchmark.js';
8
9
  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';
10
+ import { L as LlmProvider, a as LlmModelTier } from './inject-DEb_jpLi.js';
11
+ 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
12
  export { ObserveCommandOptions, observeCommand, registerObserveCommand } from './commands/observe.js';
12
13
  export { ReflectCommandOptions, reflectCommand, registerReflectCommand } from './commands/reflect.js';
13
14
  export { ArchiveCommandOptions, archiveCommand, registerArchiveCommand } from './commands/archive.js';
14
15
  export { RebuildCommandOptions, rebuildCommand, registerRebuildCommand } from './commands/rebuild.js';
15
16
  import { MigrationIssueType } from './commands/doctor.js';
16
- export { DoctorCheck, DoctorReport, DoctorStatus, MigrationIssue, doctor } from './commands/doctor.js';
17
+ export { DoctorCheck, DoctorOptions, DoctorReport, DoctorStatus, MigrationIssue, doctor } from './commands/doctor.js';
17
18
  export { EmbedCommandOptions, EmbedCommandResult, embedCommand, registerEmbedCommand } from './commands/embed.js';
19
+ export { InboxAddCommandOptions, inboxAddCommand, registerInboxCommand } from './commands/inbox.js';
20
+ export { MaintainCommandOptions, maintainCommand, registerMaintainCommand } from './commands/maintain.js';
18
21
  export { ReplayCommandOptions, registerReplayCommand, replayCommand } from './commands/replay.js';
19
22
  export { MigrateObservationsOptions, MigrateObservationsResult, migrateObservations, migrateObservationsCommand, registerMigrateObservationsCommand } from './commands/migrate-observations.js';
20
23
  export { SyncBdCommandOptions, registerSyncBdCommand, syncBdCommand } from './commands/sync-bd.js';
@@ -64,20 +67,24 @@ declare class ClawVault {
64
67
  * Store a new document
65
68
  */
66
69
  store(options: StoreOptions): Promise<Document>;
70
+ /**
71
+ * Patch an existing document and incrementally refresh index state for that file only.
72
+ */
73
+ patch(options: PatchOptions): Promise<Document>;
67
74
  /**
68
75
  * Quick store to inbox
69
76
  */
70
77
  capture(note: string, title?: string): Promise<Document>;
71
78
  /**
72
- * Search the vault (BM25 via qmd)
79
+ * Search the vault (in-process hybrid by default, qmd fallback optional)
73
80
  */
74
81
  find(query: string, options?: SearchOptions): Promise<SearchResult[]>;
75
82
  /**
76
- * Semantic/vector search (via qmd vsearch)
83
+ * Semantic/vector search (hosted embeddings, qmd fallback optional)
77
84
  */
78
85
  vsearch(query: string, options?: SearchOptions): Promise<SearchResult[]>;
79
86
  /**
80
- * Combined search with query expansion (via qmd query)
87
+ * Combined search entrypoint (currently aliases hybrid search)
81
88
  */
82
89
  query(query: string, options?: SearchOptions): Promise<SearchResult[]>;
83
90
  /**
@@ -164,6 +171,13 @@ declare class ClawVault {
164
171
  * Handles Date objects, strings, and undefined values.
165
172
  */
166
173
  private toDateString;
174
+ private reindexDocument;
175
+ private resolveDocumentRelativePath;
176
+ private splitFrontmatter;
177
+ private applyPatchToBody;
178
+ private appendText;
179
+ private replaceAllOccurrences;
180
+ private patchMarkdownSection;
167
181
  /**
168
182
  * Extract the date portion (YYYY-MM-DD) from an ISO date string or Date object.
169
183
  * Provides safe handling for various date formats.
@@ -215,8 +229,8 @@ declare function migrateCommand(options?: MigrateCommandOptions): Promise<Migrat
215
229
  declare function registerMigrateCommand(program: Command): void;
216
230
 
217
231
  /**
218
- * ClawVault Search Engine - qmd Backend
219
- * Uses qmd CLI for BM25 and vector search
232
+ * ClawVault Search Engine
233
+ * In-process hybrid retrieval is default; qmd remains optional fallback.
220
234
  */
221
235
 
222
236
  declare const QMD_INSTALL_URL = "https://github.com/tobi/qmd";
@@ -254,11 +268,13 @@ declare function qmdEmbed(collection?: string, indexName?: string): void;
254
268
  * QMD Search Engine - wraps qmd CLI
255
269
  */
256
270
  declare class SearchEngine {
257
- private documents;
271
+ private readonly inProcess;
258
272
  private collection;
259
273
  private vaultPath;
260
274
  private collectionRoot;
261
275
  private qmdIndexName?;
276
+ private searchConfig;
277
+ setSearchConfig(config?: VaultSearchConfig): void;
262
278
  /**
263
279
  * Set the collection name (usually vault name)
264
280
  */
@@ -295,15 +311,17 @@ declare class SearchEngine {
295
311
  /**
296
312
  * BM25 search via qmd
297
313
  */
298
- search(query: string, options?: SearchOptions): SearchResult[];
314
+ search(query: string, options?: SearchOptions): Promise<SearchResult[]>;
299
315
  /**
300
316
  * Vector/semantic search via qmd vsearch
301
317
  */
302
- vsearch(query: string, options?: SearchOptions): SearchResult[];
318
+ vsearch(query: string, options?: SearchOptions): Promise<SearchResult[]>;
303
319
  /**
304
320
  * Combined search with query expansion (qmd query command)
305
321
  */
306
- query(query: string, options?: SearchOptions): SearchResult[];
322
+ query(query: string, options?: SearchOptions): Promise<SearchResult[]>;
323
+ private runSearchWithFallback;
324
+ private runInProcessQuery;
307
325
  private runQmdQuery;
308
326
  /**
309
327
  * Convert qmd results to ClawVault SearchResult format
@@ -434,12 +452,18 @@ declare const OBSERVER_COMPRESSION_PROVIDERS: readonly ["anthropic", "openai", "
434
452
  declare const THEMES: readonly ["neural", "minimal", "none"];
435
453
  declare const CONTEXT_PROFILES: readonly ["default", "planning", "incident", "handoff", "auto"];
436
454
  declare const FACT_EXTRACTION_MODES: readonly ["off", "rule", "llm", "hybrid"];
455
+ declare const SEARCH_BACKENDS: readonly ["in-process", "qmd"];
456
+ declare const SEARCH_EMBEDDING_PROVIDERS: readonly ["none", "openai", "gemini", "ollama"];
457
+ declare const SEARCH_RERANK_PROVIDERS: readonly ["none", "jina", "voyage", "siliconflow", "pinecone"];
437
458
  type ObserveProvider = (typeof OBSERVE_PROVIDERS)[number];
438
459
  type ObserverCompressionProvider = (typeof OBSERVER_COMPRESSION_PROVIDERS)[number];
439
460
  type Theme = (typeof THEMES)[number];
440
461
  type ContextProfile = (typeof CONTEXT_PROFILES)[number];
441
462
  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';
463
+ type SearchBackend = (typeof SEARCH_BACKENDS)[number];
464
+ type SearchEmbeddingProvider = (typeof SEARCH_EMBEDDING_PROVIDERS)[number];
465
+ type SearchRerankProvider = (typeof SEARCH_RERANK_PROVIDERS)[number];
466
+ 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
467
  interface RouteRule {
444
468
  pattern: string;
445
469
  target: string;
@@ -472,6 +496,7 @@ type FactExtractionMode = 'off' | 'rule' | 'llm' | 'hybrid';
472
496
  interface LlmAdapterOptions {
473
497
  provider?: LlmProvider | null;
474
498
  model?: string;
499
+ tier?: LlmModelTier;
475
500
  temperature?: number;
476
501
  maxTokens?: number;
477
502
  fetchImpl?: typeof fetch;
@@ -718,6 +743,13 @@ declare class Compressor {
718
743
  private readonly fetchImpl;
719
744
  constructor(options?: CompressorOptions);
720
745
  compress(messages: string[], existingObservations: string): Promise<string>;
746
+ private sanitizeIncomingMessages;
747
+ private sanitizeIncomingMessage;
748
+ private normalizeMessageRole;
749
+ private isConversationRolePrefix;
750
+ private shouldDropMessageRole;
751
+ private stripNoisyData;
752
+ private isLikelyStructuredNoise;
721
753
  private resolveProvider;
722
754
  private resolveConfiguredProvider;
723
755
  private resolveProviderFromEnv;
@@ -744,9 +776,18 @@ declare class Compressor {
744
776
  * Also fixes trailing word fragments fused after closing brackets.
745
777
  */
746
778
  private sanitizeWikiLinks;
779
+ private static readonly SCENE_SETTER_RE;
780
+ private static readonly ACK_NOISE_RE;
781
+ private isNoiseObservation;
747
782
  private enforceImportanceRules;
748
783
  private enforceImportanceForRecord;
749
784
  private fallbackCompression;
785
+ private toFallbackCandidate;
786
+ private shouldDropLowSignalCandidate;
787
+ private stripConversationLeadIn;
788
+ private stripTimePrefix;
789
+ private calibrateFallbackCandidate;
790
+ private buildRoutineMaintenanceSummary;
750
791
  private mergeObservations;
751
792
  private mergeRecord;
752
793
  private renderSections;
@@ -936,6 +977,124 @@ declare class SessionWatcher {
936
977
 
937
978
  declare function parseSessionFile(filePath: string): string[];
938
979
 
980
+ declare const OBSERVATION_TYPES: readonly ["decision", "preference", "fact", "commitment", "task", "todo", "commitment-unresolved", "milestone", "lesson", "relationship", "project"];
981
+ type ObservationType = typeof OBSERVATION_TYPES[number];
982
+ type LegacyObservationPriority = '🔴' | '🟡' | '🟢';
983
+ type ObservationLineKind = 'scored' | 'emoji';
984
+ interface ParsedObservationRecord {
985
+ date: string;
986
+ type: ObservationType;
987
+ confidence: number;
988
+ importance: number;
989
+ content: string;
990
+ format: ObservationLineKind;
991
+ priority?: LegacyObservationPriority;
992
+ time?: string;
993
+ rawLine: string;
994
+ }
995
+
996
+ type ObserverBenchmarkProvider = CompressionProvider | 'mock';
997
+ type ObserverBenchmarkReportFormat = 'json' | 'text';
998
+ interface ObserverBenchmarkFixtureConfig {
999
+ now?: string;
1000
+ existingObservations?: string;
1001
+ compression?: {
1002
+ provider?: ObserverBenchmarkProvider;
1003
+ model?: string;
1004
+ baseUrl?: string;
1005
+ apiKey?: string;
1006
+ };
1007
+ scoring?: {
1008
+ matchThreshold?: number;
1009
+ minimumImportanceForRecall?: number;
1010
+ keywordHints?: string[];
1011
+ };
1012
+ }
1013
+ interface ObserverBenchmarkFixture {
1014
+ id: string;
1015
+ dir: string;
1016
+ transcriptPath: string;
1017
+ expectedPath: string;
1018
+ transcript: string;
1019
+ expected: string;
1020
+ config: ObserverBenchmarkFixtureConfig;
1021
+ }
1022
+ interface ObservationMatch {
1023
+ expectedIndex: number;
1024
+ actualIndex: number;
1025
+ similarity: number;
1026
+ }
1027
+ interface KeywordRewriteFlag {
1028
+ expected: string;
1029
+ actual: string;
1030
+ missingTerms: string[];
1031
+ }
1032
+ interface FixtureScoringMetrics {
1033
+ precision: number;
1034
+ noiseRatio: number;
1035
+ recall: number;
1036
+ typeAccuracy: number;
1037
+ keywordPreservation: number;
1038
+ overall: number;
1039
+ }
1040
+ interface FixtureScoringResult {
1041
+ metrics: FixtureScoringMetrics;
1042
+ matches: ObservationMatch[];
1043
+ missedImportant: ParsedObservationRecord[];
1044
+ noiseObservations: ParsedObservationRecord[];
1045
+ keywordSet: string[];
1046
+ missingKeywords: string[];
1047
+ keywordRewriteFlags: KeywordRewriteFlag[];
1048
+ }
1049
+ interface BenchmarkFixtureResult {
1050
+ fixtureId: string;
1051
+ transcriptPath: string;
1052
+ expectedPath: string;
1053
+ provider: ObserverBenchmarkProvider;
1054
+ model?: string;
1055
+ outputObservations: string;
1056
+ expectedCount: number;
1057
+ actualCount: number;
1058
+ expectedTypes: ObservationType[];
1059
+ actualTypes: ObservationType[];
1060
+ scoring: FixtureScoringResult;
1061
+ }
1062
+ interface ObserverBenchmarkReport {
1063
+ generatedAt: string;
1064
+ fixturesDir: string;
1065
+ provider: ObserverBenchmarkProvider;
1066
+ model?: string;
1067
+ fixtureCount: number;
1068
+ aggregate: FixtureScoringMetrics;
1069
+ fixtures: BenchmarkFixtureResult[];
1070
+ }
1071
+ interface ObserverBenchmarkRunOptions {
1072
+ fixturesDir: string;
1073
+ provider?: ObserverBenchmarkProvider;
1074
+ model?: string;
1075
+ }
1076
+ interface ScoreFixtureOptions {
1077
+ minimumImportanceForRecall?: number;
1078
+ matchThreshold?: number;
1079
+ keywordHints?: string[];
1080
+ }
1081
+
1082
+ declare function loadObserverBenchmarkFixtures(fixturesDir: string): ObserverBenchmarkFixture[];
1083
+
1084
+ declare function runObserverBenchmark(options: ObserverBenchmarkRunOptions): Promise<ObserverBenchmarkReport>;
1085
+
1086
+ declare function extractKeywordSetFromTranscript(transcript: string, hints?: string[]): string[];
1087
+ declare function matchObservationRecords(expected: ParsedObservationRecord[], actual: ParsedObservationRecord[], threshold?: number): ObservationMatch[];
1088
+ declare function scoreFixtureObservations(input: {
1089
+ transcript: string;
1090
+ expectedMarkdown: string;
1091
+ actualMarkdown: string;
1092
+ options?: ScoreFixtureOptions;
1093
+ }): FixtureScoringResult;
1094
+ declare function compareObservationText(left: string, right: string): boolean;
1095
+
1096
+ declare function formatObserverBenchmarkSummary(report: ObserverBenchmarkReport): string;
1097
+
939
1098
  interface ArchiveObservationsOptions {
940
1099
  olderThanDays?: number;
941
1100
  dryRun?: boolean;
@@ -994,4 +1153,4 @@ declare function runReflection(options: ReflectOptions): Promise<ReflectResult>;
994
1153
  declare const VERSION: string;
995
1154
  declare function registerCommanderCommands(program: Command): Command;
996
1155
 
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 };
1156
+ export { type ActiveObservationCandidate, type ActiveObservationFailure, type ActiveObserveOptions, type ActiveObserveResult, type ArchiveObservationsOptions, type ArchiveObservationsResult, type BenchmarkFixtureResult, 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 ExtractedFact, type ExtractionResult, type FactExtractionMode$1 as FactExtractionMode, FactStore, type FactStoreStats, type FixtureScoringMetrics, type FixtureScoringResult, HandoffDocument, type KeywordRewriteFlag, 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, 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, buildTransitionEvent, compareObservationText, cosineSimilarity, countBlockedTransitions, createDefaultAdapter, createFactExtractionAdapter, createGeminiFlashAdapter, createLlmFunction, createVault, embed, embedBatch, extractFactsLlm, extractFactsRuleBased, extractKeywordSetFromTranscript, extractTags, extractWikiLinks, factId, findVault, formatObserverBenchmarkSummary, formatTransitionsTable, getConfig, getConfigValue, getObserverStaleness, getQmdErrorDetails, getScaledObservationThresholdBytes, hasQmd, hybridSearch, isRegression, listConfig, listRouteRules, loadObserverBenchmarkFixtures, matchObservationRecords, matchRouteRule, migrate, migrateCommand, normalizeEntity, observeActiveSessions, parseSessionFile, parseSessionSourceLabel, qmdEmbed, qmdUpdate, queryTransitions, readAllTransitions, reciprocalRankFusion, registerCommanderCommands, registerMigrateCommand, removeRouteRule, resetConfig, resolveFactExtractionMode, runObserverBenchmark, runReflection, scoreFixtureObservations, semanticSearch, setConfigValue, testRouteRule };