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,14 +1,14 @@
1
- import {
2
- normalizeObservationContent,
3
- parseObservationMarkdown
4
- } from "./chunk-FHFUXL6G.js";
5
1
  import {
6
2
  requestLlmCompletion,
7
3
  resolveLlmProvider
8
- } from "./chunk-YXQCA6B7.js";
4
+ } from "./chunk-DVOUSOR3.js";
9
5
  import {
10
6
  archiveObservations
11
7
  } from "./chunk-MQUJNOHK.js";
8
+ import {
9
+ normalizeObservationContent,
10
+ parseObservationMarkdown
11
+ } from "./chunk-FHFUXL6G.js";
12
12
  import {
13
13
  formatIsoWeekKey,
14
14
  getIsoWeek,
@@ -235,6 +235,7 @@ async function maybeGenerateLlmReflection(weekKey, sections) {
235
235
  const output = await requestLlmCompletion({
236
236
  provider,
237
237
  prompt,
238
+ tier: "default",
238
239
  temperature: 0.1,
239
240
  maxTokens: 1200
240
241
  });
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-MQUJNOHK.js";
4
4
  import {
5
5
  resolveVaultPath
6
- } from "./chunk-GNJL4YGR.js";
6
+ } from "./chunk-GJO3CFUN.js";
7
7
 
8
8
  // src/commands/archive.ts
9
9
  function parsePositiveInteger(raw, label) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Observer
3
- } from "./chunk-Y3TIJEBP.js";
3
+ } from "./chunk-7SWP5FKU.js";
4
4
  import {
5
5
  getSessionsDir
6
6
  } from "./chunk-HRLWZGMA.js";
@@ -0,0 +1,158 @@
1
+ import {
2
+ registerTailscaleCommands
3
+ } from "./chunk-KCYWJDDW.js";
4
+ import {
5
+ registerReflectCommand
6
+ } from "./chunk-DOIUYIXV.js";
7
+ import {
8
+ registerInjectCommand
9
+ } from "./chunk-OFOCU2V4.js";
10
+ import {
11
+ registerMaintainCommand
12
+ } from "./chunk-TDWFBDAQ.js";
13
+ import {
14
+ registerObserveCommand
15
+ } from "./chunk-BLQXXX7Q.js";
16
+ import {
17
+ registerContextCommand
18
+ } from "./chunk-GFCHWMGD.js";
19
+ import {
20
+ ClawVault
21
+ } from "./chunk-ECGJYWNA.js";
22
+ import {
23
+ registerEmbedCommand
24
+ } from "./chunk-T7E764W3.js";
25
+ import {
26
+ registerInboxCommand
27
+ } from "./chunk-HEHO7SMV.js";
28
+ import {
29
+ resolveVaultPath
30
+ } from "./chunk-GJO3CFUN.js";
31
+ import {
32
+ registerBenchmarkCommand
33
+ } from "./chunk-ZKWPCBYT.js";
34
+
35
+ // src/commands/patch.ts
36
+ function normalizeSectionHeading(heading) {
37
+ const trimmed = heading.trim();
38
+ if (!trimmed) {
39
+ throw new Error("Section heading cannot be empty.");
40
+ }
41
+ if (trimmed.startsWith("#")) {
42
+ return trimmed;
43
+ }
44
+ return `## ${trimmed}`;
45
+ }
46
+ function buildSectionAppendText(heading, content) {
47
+ const headingLine = normalizeSectionHeading(heading);
48
+ return `
49
+ ${headingLine}
50
+ ${content}`;
51
+ }
52
+ function isSectionNotFoundError(error) {
53
+ return error instanceof Error && error.message.startsWith("Section not found:");
54
+ }
55
+ function resolvePatchOptions(idOrPath, options) {
56
+ const appendSelected = typeof options.append === "string";
57
+ const replaceSelected = typeof options.replace === "string" || typeof options.with === "string";
58
+ const sectionSelected = typeof options.section === "string" || typeof options.content === "string";
59
+ const selectedModeCount = [appendSelected, replaceSelected, sectionSelected].filter(Boolean).length;
60
+ if (selectedModeCount !== 1) {
61
+ throw new Error(
62
+ "Select exactly one patch mode: --append, --replace with --with, or --section with --content."
63
+ );
64
+ }
65
+ if (appendSelected) {
66
+ return {
67
+ idOrPath,
68
+ mode: "append",
69
+ append: options.append
70
+ };
71
+ }
72
+ if (replaceSelected) {
73
+ if (typeof options.replace !== "string" || typeof options.with !== "string") {
74
+ throw new Error("Replace mode requires both --replace and --with.");
75
+ }
76
+ return {
77
+ idOrPath,
78
+ mode: "replace",
79
+ replace: options.replace,
80
+ with: options.with
81
+ };
82
+ }
83
+ if (typeof options.section !== "string" || typeof options.content !== "string") {
84
+ throw new Error("Section mode requires both --section and --content.");
85
+ }
86
+ return {
87
+ idOrPath,
88
+ mode: "content",
89
+ section: options.section,
90
+ content: options.content
91
+ };
92
+ }
93
+ async function runSectionUpsert(vault, idOrPath, section, content) {
94
+ try {
95
+ return await vault.patch({
96
+ idOrPath,
97
+ mode: "content",
98
+ section,
99
+ content
100
+ });
101
+ } catch (error) {
102
+ if (!isSectionNotFoundError(error)) {
103
+ throw error;
104
+ }
105
+ return vault.patch({
106
+ idOrPath,
107
+ mode: "append",
108
+ append: buildSectionAppendText(section, content)
109
+ });
110
+ }
111
+ }
112
+ async function patchCommand(idOrPath, options) {
113
+ const patchOptions = resolvePatchOptions(idOrPath, options);
114
+ const vaultPath = resolveVaultPath({ explicitPath: options.vaultPath });
115
+ const vault = new ClawVault(vaultPath);
116
+ await vault.load();
117
+ if (patchOptions.mode === "content") {
118
+ return runSectionUpsert(
119
+ vault,
120
+ patchOptions.idOrPath,
121
+ patchOptions.section,
122
+ patchOptions.content
123
+ );
124
+ }
125
+ return vault.patch(patchOptions);
126
+ }
127
+ function registerPatchCommand(program) {
128
+ program.command("patch <path>").description("Patch an existing memory document").option("--append <content>", "Append text to the end of a document").option("--replace <old>", "Text to find for replacement").option("--with <new>", "Replacement text used with --replace").option("--section <heading>", "Markdown heading to upsert").option("--content <body>", "Section body content used with --section").option("-v, --vault <path>", "Vault path").action(async (pathArg, rawOptions) => {
129
+ const doc = await patchCommand(pathArg, {
130
+ vaultPath: rawOptions.vault,
131
+ append: rawOptions.append,
132
+ replace: rawOptions.replace,
133
+ with: rawOptions.with,
134
+ section: rawOptions.section,
135
+ content: rawOptions.content
136
+ });
137
+ console.log(`Patched: ${doc.id}`);
138
+ });
139
+ }
140
+
141
+ // src/cli/index.ts
142
+ function registerCliCommands(program) {
143
+ registerBenchmarkCommand(program);
144
+ registerContextCommand(program);
145
+ registerInjectCommand(program);
146
+ registerObserveCommand(program);
147
+ registerReflectCommand(program);
148
+ registerEmbedCommand(program);
149
+ registerInboxCommand(program);
150
+ registerMaintainCommand(program);
151
+ registerPatchCommand(program);
152
+ registerTailscaleCommands(program);
153
+ return program;
154
+ }
155
+
156
+ export {
157
+ registerCliCommands
158
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveVaultPath
3
- } from "./chunk-GNJL4YGR.js";
3
+ } from "./chunk-GJO3CFUN.js";
4
4
 
5
5
  // src/commands/sync-bd.ts
6
6
  import * as fs from "fs";