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.
- package/README.md +56 -16
- package/bin/clawvault.js +0 -2
- package/bin/command-registration.test.js +13 -1
- package/bin/help-contract.test.js +14 -0
- package/bin/register-core-commands.js +88 -0
- package/bin/register-core-commands.test.js +80 -0
- package/bin/register-maintenance-commands.js +57 -6
- package/bin/register-query-commands.js +10 -28
- package/bin/test-helpers/cli-command-fixtures.js +1 -0
- package/dist/chunk-2PKBIKDH.js +130 -0
- package/dist/{chunk-U67V476Y.js → chunk-2ZDO52B4.js} +18 -1
- package/dist/{chunk-ZZA73MFY.js → chunk-33DOSHTA.js} +176 -36
- package/dist/{chunk-AZYOKJYC.js → chunk-4PY655YM.js} +13 -1
- package/dist/{chunk-2JQ3O2YL.js → chunk-5EFSWZO6.js} +3 -3
- package/dist/{chunk-Y3TIJEBP.js → chunk-7SWP5FKU.js} +34 -613
- package/dist/{chunk-4VQTUVH7.js → chunk-7YZWHM36.js} +52 -26
- package/dist/{chunk-URXDAUVH.js → chunk-AXSJIFOJ.js} +174 -1
- package/dist/{chunk-4ITRXIVT.js → chunk-BLQXXX7Q.js} +6 -6
- package/dist/chunk-CSHO3PJB.js +684 -0
- package/dist/{chunk-S5OJEGFG.js → chunk-DOIUYIXV.js} +2 -2
- package/dist/{chunk-YXQCA6B7.js → chunk-DVOUSOR3.js} +112 -7
- package/dist/{chunk-YDWHS4LJ.js → chunk-ECGJYWNA.js} +205 -33
- package/dist/{chunk-QMHPQYUV.js → chunk-EL6UBSX5.js} +7 -6
- package/dist/chunk-FZ5I2NF7.js +352 -0
- package/dist/{chunk-WJVWINEM.js → chunk-GFCHWMGD.js} +55 -6
- package/dist/{chunk-GNJL4YGR.js → chunk-GJO3CFUN.js} +30 -6
- package/dist/chunk-H3JZIB5O.js +322 -0
- package/dist/chunk-HEHO7SMV.js +51 -0
- package/dist/{chunk-UCQAOZHW.js → chunk-HGDDW24U.js} +3 -3
- package/dist/chunk-J3YUXVID.js +907 -0
- package/dist/{chunk-Y6VJKXGL.js → chunk-KCYWJDDW.js} +1 -1
- package/dist/{chunk-P5EPF6MB.js → chunk-MW5C6ZQA.js} +110 -13
- package/dist/{chunk-YNIPYN4F.js → chunk-OFOCU2V4.js} +6 -5
- package/dist/{chunk-42MXU7A6.js → chunk-P62WHA27.js} +58 -47
- package/dist/chunk-PTWPPVC7.js +972 -0
- package/dist/{chunk-FAKNOB7Y.js → chunk-QFWERBDP.js} +2 -2
- package/dist/{chunk-IIOU45CK.js → chunk-S7N7HI5E.js} +2 -2
- package/dist/{chunk-ECRZL5XR.js → chunk-T7E764W3.js} +23 -7
- package/dist/chunk-TDWFBDAQ.js +1016 -0
- package/dist/{chunk-MNPUYCHQ.js → chunk-TWMI3SNN.js} +6 -5
- package/dist/{chunk-2RAZ4ZFE.js → chunk-VBILES4B.js} +1 -1
- package/dist/{chunk-PI4WMLMG.js → chunk-VXAGOLDP.js} +1 -1
- package/dist/chunk-YCUVAOFC.js +158 -0
- package/dist/{chunk-SS4B7P7V.js → chunk-YIDV4VV2.js} +1 -1
- package/dist/chunk-ZKWPCBYT.js +600 -0
- package/dist/cli/index.js +27 -21
- package/dist/commands/archive.js +3 -3
- package/dist/commands/backlog.js +1 -1
- package/dist/commands/benchmark.d.ts +12 -0
- package/dist/commands/benchmark.js +12 -0
- package/dist/commands/blocked.js +1 -1
- package/dist/commands/canvas.js +2 -2
- package/dist/commands/checkpoint.js +1 -1
- package/dist/commands/compat.js +1 -1
- package/dist/commands/context.js +8 -7
- package/dist/commands/doctor.d.ts +8 -3
- package/dist/commands/doctor.js +8 -22
- package/dist/commands/embed.js +6 -5
- package/dist/commands/entities.js +2 -2
- package/dist/commands/graph.js +4 -4
- package/dist/commands/inbox.d.ts +23 -0
- package/dist/commands/inbox.js +11 -0
- package/dist/commands/inject.d.ts +1 -1
- package/dist/commands/inject.js +5 -5
- package/dist/commands/kanban.js +1 -1
- package/dist/commands/link.js +9 -9
- package/dist/commands/maintain.d.ts +32 -0
- package/dist/commands/maintain.js +12 -0
- package/dist/commands/migrate-observations.js +3 -3
- package/dist/commands/observe.js +11 -10
- package/dist/commands/project.js +2 -2
- package/dist/commands/rebuild-embeddings.js +48 -17
- package/dist/commands/rebuild.js +9 -8
- package/dist/commands/recover.js +1 -1
- package/dist/commands/reflect.js +6 -6
- package/dist/commands/repair-session.js +1 -1
- package/dist/commands/replay.js +10 -9
- package/dist/commands/session-recap.js +1 -1
- package/dist/commands/setup.js +4 -3
- package/dist/commands/shell-init.js +1 -1
- package/dist/commands/sleep.d.ts +1 -1
- package/dist/commands/sleep.js +20 -18
- package/dist/commands/status.js +40 -26
- package/dist/commands/sync-bd.js +3 -3
- package/dist/commands/tailscale.js +3 -3
- package/dist/commands/task.js +1 -1
- package/dist/commands/template.js +1 -1
- package/dist/commands/wake.d.ts +1 -1
- package/dist/commands/wake.js +10 -9
- package/dist/index.d.ts +175 -16
- package/dist/index.js +277 -108
- package/dist/{inject-DYUrDqQO.d.ts → inject-DEb_jpLi.d.ts} +3 -1
- package/dist/lib/auto-linker.js +2 -2
- package/dist/lib/canvas-layout.js +1 -1
- package/dist/lib/config.js +2 -2
- package/dist/lib/entity-index.js +1 -1
- package/dist/lib/project-utils.js +2 -2
- package/dist/lib/session-repair.js +1 -1
- package/dist/lib/session-utils.js +1 -1
- package/dist/lib/tailscale.js +1 -1
- package/dist/lib/task-utils.js +1 -1
- package/dist/lib/template-engine.js +1 -1
- package/dist/lib/webdav.js +1 -1
- package/dist/onnxruntime_binding-5QEF3SUC.node +0 -0
- package/dist/onnxruntime_binding-BKPKNEGC.node +0 -0
- package/dist/onnxruntime_binding-FMOXGIUT.node +0 -0
- package/dist/onnxruntime_binding-OI2KMXC5.node +0 -0
- package/dist/onnxruntime_binding-UX44MLAZ.node +0 -0
- package/dist/onnxruntime_binding-Y2W7N7WY.node +0 -0
- package/dist/openclaw-plugin.d.ts +8 -0
- package/dist/openclaw-plugin.js +14 -0
- package/dist/transformers.node-A2ZRORSQ.js +46775 -0
- package/dist/{types-BbWJoC1c.d.ts → types-DslKvCaj.d.ts} +51 -1
- package/hooks/clawvault/HOOK.md +25 -8
- package/hooks/clawvault/handler.js +215 -78
- package/hooks/clawvault/handler.test.js +109 -43
- package/hooks/clawvault/integrity.js +112 -0
- package/hooks/clawvault/integrity.test.js +32 -0
- package/hooks/clawvault/openclaw.plugin.json +133 -15
- package/openclaw.plugin.json +131 -203
- package/package.json +10 -7
- package/bin/register-workgraph-commands.js +0 -451
- package/dist/chunk-5PJ4STIC.js +0 -465
- package/dist/chunk-ERNE2FZ5.js +0 -189
- package/dist/chunk-HR4KN6S2.js +0 -152
- package/dist/chunk-IJBFGPCS.js +0 -33
- package/dist/chunk-K7PNYS45.js +0 -93
- package/dist/chunk-NTOPJI7W.js +0 -207
- package/dist/chunk-PG56HX5T.js +0 -154
- package/dist/chunk-QPDDIHXE.js +0 -501
- package/dist/chunk-WIOLLGAD.js +0 -190
- package/dist/chunk-WMGIIABP.js +0 -15
- package/dist/ledger-B7g7jhqG.d.ts +0 -44
- package/dist/plugin/index.d.ts +0 -352
- package/dist/plugin/index.js +0 -4264
- package/dist/registry-BR4326o0.d.ts +0 -30
- package/dist/store-CA-6sKCJ.d.ts +0 -34
- package/dist/thread-B9LhXNU0.d.ts +0 -41
- package/dist/workgraph/index.d.ts +0 -5
- package/dist/workgraph/index.js +0 -23
- package/dist/workgraph/ledger.d.ts +0 -2
- package/dist/workgraph/ledger.js +0 -25
- package/dist/workgraph/registry.d.ts +0 -2
- package/dist/workgraph/registry.js +0 -19
- package/dist/workgraph/store.d.ts +0 -2
- package/dist/workgraph/store.js +0 -25
- package/dist/workgraph/thread.d.ts +0 -2
- package/dist/workgraph/thread.js +0 -25
- package/dist/workgraph/types.d.ts +0 -54
- package/dist/workgraph/types.js +0 -7
package/dist/index.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
registerSyncBdCommand,
|
|
3
|
+
syncBdCommand
|
|
4
|
+
} from "./chunk-YIDV4VV2.js";
|
|
5
|
+
import {
|
|
6
|
+
rebuildCommand,
|
|
7
|
+
registerRebuildCommand
|
|
8
|
+
} from "./chunk-QFWERBDP.js";
|
|
1
9
|
import {
|
|
2
10
|
registerReplayCommand,
|
|
3
11
|
replayCommand
|
|
4
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HGDDW24U.js";
|
|
5
13
|
import {
|
|
6
14
|
buildSessionRecap,
|
|
7
15
|
formatSessionRecapMarkdown,
|
|
@@ -9,52 +17,37 @@ import {
|
|
|
9
17
|
} from "./chunk-ZKGY7WTT.js";
|
|
10
18
|
import {
|
|
11
19
|
setupCommand
|
|
12
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-EL6UBSX5.js";
|
|
13
21
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
buildKanbanLanes,
|
|
23
|
+
extractCardSlug,
|
|
24
|
+
formatKanbanCard,
|
|
25
|
+
generateKanbanMarkdown,
|
|
26
|
+
importKanbanBoard,
|
|
27
|
+
kanbanCommand,
|
|
28
|
+
parseKanbanMarkdown,
|
|
29
|
+
syncKanbanBoard
|
|
30
|
+
} from "./chunk-4OXMU5S2.js";
|
|
17
31
|
import {
|
|
18
32
|
migrateObservations,
|
|
19
33
|
migrateObservationsCommand,
|
|
20
34
|
registerMigrateObservationsCommand
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import {
|
|
23
|
-
EmbeddingCache,
|
|
24
|
-
cosineSimilarity,
|
|
25
|
-
embed,
|
|
26
|
-
embedBatch,
|
|
27
|
-
hybridSearch,
|
|
28
|
-
reciprocalRankFusion,
|
|
29
|
-
semanticSearch
|
|
30
|
-
} from "./chunk-PG56HX5T.js";
|
|
35
|
+
} from "./chunk-5EFSWZO6.js";
|
|
31
36
|
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
checkOpenClawCompatibility,
|
|
38
|
+
compatCommand,
|
|
39
|
+
compatibilityExitCode
|
|
40
|
+
} from "./chunk-X3SPPUFG.js";
|
|
35
41
|
import {
|
|
36
42
|
doctor
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-7ZRP733D.js";
|
|
43
|
+
} from "./chunk-CSHO3PJB.js";
|
|
39
44
|
import {
|
|
40
45
|
graphCommand,
|
|
41
46
|
graphSummary
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import {
|
|
44
|
-
buildKanbanLanes,
|
|
45
|
-
extractCardSlug,
|
|
46
|
-
formatKanbanCard,
|
|
47
|
-
generateKanbanMarkdown,
|
|
48
|
-
importKanbanBoard,
|
|
49
|
-
kanbanCommand,
|
|
50
|
-
parseKanbanMarkdown,
|
|
51
|
-
syncKanbanBoard
|
|
52
|
-
} from "./chunk-4OXMU5S2.js";
|
|
53
|
-
import "./chunk-4VQTUVH7.js";
|
|
54
|
-
import "./chunk-J7ZWCI2C.js";
|
|
47
|
+
} from "./chunk-S7N7HI5E.js";
|
|
55
48
|
import {
|
|
56
49
|
registerCliCommands
|
|
57
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-YCUVAOFC.js";
|
|
58
51
|
import {
|
|
59
52
|
registerTailscaleCommands,
|
|
60
53
|
registerTailscaleDiscoverCommand,
|
|
@@ -65,7 +58,7 @@ import {
|
|
|
65
58
|
tailscaleServeCommand,
|
|
66
59
|
tailscaleStatusCommand,
|
|
67
60
|
tailscaleSyncCommand
|
|
68
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-KCYWJDDW.js";
|
|
69
62
|
import {
|
|
70
63
|
CLAWVAULT_SERVE_PATH,
|
|
71
64
|
DEFAULT_SERVE_PORT,
|
|
@@ -88,38 +81,37 @@ import {
|
|
|
88
81
|
syncWithPeer
|
|
89
82
|
} from "./chunk-TIGW564L.js";
|
|
90
83
|
import "./chunk-IVRIKYFE.js";
|
|
91
|
-
import {
|
|
92
|
-
SessionWatcher,
|
|
93
|
-
observeCommand,
|
|
94
|
-
registerObserveCommand
|
|
95
|
-
} from "./chunk-4ITRXIVT.js";
|
|
96
|
-
import {
|
|
97
|
-
parseSessionFile
|
|
98
|
-
} from "./chunk-P5EPF6MB.js";
|
|
99
84
|
import {
|
|
100
85
|
reflectCommand,
|
|
101
86
|
registerReflectCommand
|
|
102
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-DOIUYIXV.js";
|
|
103
88
|
import {
|
|
104
89
|
runReflection
|
|
105
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-TWMI3SNN.js";
|
|
106
91
|
import {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
92
|
+
buildInjectionResult,
|
|
93
|
+
deterministicInjectMatches,
|
|
94
|
+
indexInjectableItems,
|
|
95
|
+
injectCommand,
|
|
96
|
+
registerInjectCommand,
|
|
97
|
+
runPromptInjection
|
|
98
|
+
} from "./chunk-OFOCU2V4.js";
|
|
99
|
+
import {
|
|
100
|
+
maintainCommand,
|
|
101
|
+
registerMaintainCommand
|
|
102
|
+
} from "./chunk-TDWFBDAQ.js";
|
|
103
|
+
import {
|
|
104
|
+
SessionWatcher,
|
|
105
|
+
observeCommand,
|
|
106
|
+
registerObserveCommand
|
|
107
|
+
} from "./chunk-BLQXXX7Q.js";
|
|
115
108
|
import {
|
|
116
109
|
getObserverStaleness,
|
|
117
110
|
getScaledObservationThresholdBytes,
|
|
118
111
|
observeActiveSessions,
|
|
119
112
|
parseSessionSourceLabel
|
|
120
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-VXAGOLDP.js";
|
|
121
114
|
import {
|
|
122
|
-
Compressor,
|
|
123
115
|
Observer,
|
|
124
116
|
Reflector,
|
|
125
117
|
createDefaultAdapter,
|
|
@@ -127,7 +119,12 @@ import {
|
|
|
127
119
|
createGeminiFlashAdapter,
|
|
128
120
|
createLlmFunction,
|
|
129
121
|
resolveFactExtractionMode
|
|
130
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-7SWP5FKU.js";
|
|
123
|
+
import "./chunk-HRLWZGMA.js";
|
|
124
|
+
import {
|
|
125
|
+
requestLlmCompletion,
|
|
126
|
+
resolveLlmProvider
|
|
127
|
+
} from "./chunk-DVOUSOR3.js";
|
|
131
128
|
import {
|
|
132
129
|
archiveProject,
|
|
133
130
|
createProject,
|
|
@@ -136,13 +133,29 @@ import {
|
|
|
136
133
|
listProjects,
|
|
137
134
|
readProject,
|
|
138
135
|
updateProject
|
|
139
|
-
} from "./chunk-
|
|
140
|
-
import "./chunk-HRLWZGMA.js";
|
|
136
|
+
} from "./chunk-4PY655YM.js";
|
|
141
137
|
import {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
138
|
+
SUPPORTED_CONFIG_KEYS,
|
|
139
|
+
addRouteRule,
|
|
140
|
+
getConfig,
|
|
141
|
+
getConfigValue,
|
|
142
|
+
listConfig,
|
|
143
|
+
listRouteRules,
|
|
144
|
+
matchRouteRule,
|
|
145
|
+
removeRouteRule,
|
|
146
|
+
resetConfig,
|
|
147
|
+
setConfigValue,
|
|
148
|
+
testRouteRule
|
|
149
|
+
} from "./chunk-AXSJIFOJ.js";
|
|
150
|
+
import {
|
|
151
|
+
buildContext,
|
|
152
|
+
contextCommand,
|
|
153
|
+
formatContextMarkdown,
|
|
154
|
+
inferContextProfile,
|
|
155
|
+
normalizeContextProfileInput,
|
|
156
|
+
registerContextCommand,
|
|
157
|
+
resolveContextProfile
|
|
158
|
+
} from "./chunk-GFCHWMGD.js";
|
|
146
159
|
import {
|
|
147
160
|
FactStore,
|
|
148
161
|
extractFactsLlm,
|
|
@@ -150,15 +163,25 @@ import {
|
|
|
150
163
|
factId,
|
|
151
164
|
normalizeEntity
|
|
152
165
|
} from "./chunk-BSJ6RIT7.js";
|
|
153
|
-
import
|
|
166
|
+
import {
|
|
167
|
+
ClawVault,
|
|
168
|
+
createVault,
|
|
169
|
+
findVault
|
|
170
|
+
} from "./chunk-ECGJYWNA.js";
|
|
171
|
+
import {
|
|
172
|
+
DEFAULT_CATEGORIES,
|
|
173
|
+
DEFAULT_CONFIG,
|
|
174
|
+
MEMORY_TYPES,
|
|
175
|
+
TYPE_TO_CATEGORY
|
|
176
|
+
} from "./chunk-2CDEETQN.js";
|
|
154
177
|
import {
|
|
155
178
|
embedCommand,
|
|
156
179
|
registerEmbedCommand
|
|
157
|
-
} from "./chunk-
|
|
180
|
+
} from "./chunk-T7E764W3.js";
|
|
158
181
|
import {
|
|
159
182
|
loadVaultQmdConfig,
|
|
160
183
|
removeQmdCollection
|
|
161
|
-
} from "./chunk-
|
|
184
|
+
} from "./chunk-FZ5I2NF7.js";
|
|
162
185
|
import {
|
|
163
186
|
QMD_INSTALL_COMMAND,
|
|
164
187
|
QMD_INSTALL_URL,
|
|
@@ -171,42 +194,17 @@ import {
|
|
|
171
194
|
hasQmd,
|
|
172
195
|
qmdEmbed,
|
|
173
196
|
qmdUpdate
|
|
174
|
-
} from "./chunk-
|
|
175
|
-
import
|
|
176
|
-
buildInjectionResult,
|
|
177
|
-
deterministicInjectMatches,
|
|
178
|
-
indexInjectableItems,
|
|
179
|
-
injectCommand,
|
|
180
|
-
registerInjectCommand,
|
|
181
|
-
runPromptInjection
|
|
182
|
-
} from "./chunk-YNIPYN4F.js";
|
|
183
|
-
import {
|
|
184
|
-
SUPPORTED_CONFIG_KEYS,
|
|
185
|
-
addRouteRule,
|
|
186
|
-
getConfig,
|
|
187
|
-
getConfigValue,
|
|
188
|
-
listConfig,
|
|
189
|
-
listRouteRules,
|
|
190
|
-
matchRouteRule,
|
|
191
|
-
removeRouteRule,
|
|
192
|
-
resetConfig,
|
|
193
|
-
setConfigValue,
|
|
194
|
-
testRouteRule
|
|
195
|
-
} from "./chunk-URXDAUVH.js";
|
|
197
|
+
} from "./chunk-PTWPPVC7.js";
|
|
198
|
+
import "./chunk-H3JZIB5O.js";
|
|
196
199
|
import {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
} from "./chunk-
|
|
200
|
-
import
|
|
201
|
-
DEFAULT_CATEGORIES,
|
|
202
|
-
DEFAULT_CONFIG,
|
|
203
|
-
MEMORY_TYPES,
|
|
204
|
-
TYPE_TO_CATEGORY
|
|
205
|
-
} from "./chunk-2CDEETQN.js";
|
|
200
|
+
inboxAddCommand,
|
|
201
|
+
registerInboxCommand
|
|
202
|
+
} from "./chunk-HEHO7SMV.js";
|
|
203
|
+
import "./chunk-2PKBIKDH.js";
|
|
206
204
|
import {
|
|
207
205
|
archiveCommand,
|
|
208
206
|
registerArchiveCommand
|
|
209
|
-
} from "./chunk-
|
|
207
|
+
} from "./chunk-VBILES4B.js";
|
|
210
208
|
import {
|
|
211
209
|
archiveObservations
|
|
212
210
|
} from "./chunk-MQUJNOHK.js";
|
|
@@ -214,13 +212,31 @@ import {
|
|
|
214
212
|
findNearestVaultPath,
|
|
215
213
|
getVaultPath,
|
|
216
214
|
resolveVaultPath
|
|
217
|
-
} from "./chunk-
|
|
215
|
+
} from "./chunk-GJO3CFUN.js";
|
|
216
|
+
import {
|
|
217
|
+
benchmarkObserverCommand,
|
|
218
|
+
compareObservationText,
|
|
219
|
+
extractKeywordSetFromTranscript,
|
|
220
|
+
formatObserverBenchmarkSummary,
|
|
221
|
+
loadObserverBenchmarkFixtures,
|
|
222
|
+
matchObservationRecords,
|
|
223
|
+
registerBenchmarkCommand,
|
|
224
|
+
runObserverBenchmark,
|
|
225
|
+
scoreFixtureObservations
|
|
226
|
+
} from "./chunk-ZKWPCBYT.js";
|
|
227
|
+
import {
|
|
228
|
+
parseSessionFile
|
|
229
|
+
} from "./chunk-MW5C6ZQA.js";
|
|
230
|
+
import {
|
|
231
|
+
Compressor
|
|
232
|
+
} from "./chunk-J3YUXVID.js";
|
|
233
|
+
import "./chunk-FHFUXL6G.js";
|
|
218
234
|
import {
|
|
219
235
|
MEMORY_GRAPH_SCHEMA_VERSION,
|
|
220
236
|
buildOrUpdateMemoryGraphIndex,
|
|
221
237
|
getMemoryGraph,
|
|
222
238
|
loadMemoryGraphIndex
|
|
223
|
-
} from "./chunk-
|
|
239
|
+
} from "./chunk-33DOSHTA.js";
|
|
224
240
|
import "./chunk-Z2XBWN7A.js";
|
|
225
241
|
import {
|
|
226
242
|
appendTransition,
|
|
@@ -240,22 +256,17 @@ import {
|
|
|
240
256
|
buildTemplateVariables,
|
|
241
257
|
renderTemplate
|
|
242
258
|
} from "./chunk-7766SIJP.js";
|
|
243
|
-
import
|
|
244
|
-
checkOpenClawCompatibility,
|
|
245
|
-
compatCommand,
|
|
246
|
-
compatibilityExitCode
|
|
247
|
-
} from "./chunk-X3SPPUFG.js";
|
|
248
|
-
import "./chunk-U67V476Y.js";
|
|
259
|
+
import "./chunk-2ZDO52B4.js";
|
|
249
260
|
|
|
250
261
|
// src/index.ts
|
|
251
|
-
import * as
|
|
262
|
+
import * as fs3 from "fs";
|
|
252
263
|
|
|
253
264
|
// src/commands/migrate.ts
|
|
254
265
|
import * as fs from "fs";
|
|
255
266
|
import * as path from "path";
|
|
256
267
|
import { execFileSync } from "child_process";
|
|
257
268
|
function addQmdCollection(name, rootPath) {
|
|
258
|
-
execFileSync("qmd", ["collection", "add", name, rootPath], { stdio: "ignore" });
|
|
269
|
+
execFileSync("qmd", ["collection", "add", name, rootPath], { stdio: "ignore", shell: process.platform === "win32" });
|
|
259
270
|
}
|
|
260
271
|
function updateVaultConfig(vaultPath, updates) {
|
|
261
272
|
const configPath = path.join(vaultPath, ".clawvault.json");
|
|
@@ -487,11 +498,156 @@ function registerMigrateCommand(program) {
|
|
|
487
498
|
});
|
|
488
499
|
}
|
|
489
500
|
|
|
501
|
+
// src/lib/hybrid-search.ts
|
|
502
|
+
import * as fs2 from "fs";
|
|
503
|
+
import * as path2 from "path";
|
|
504
|
+
var embeddingPipeline = null;
|
|
505
|
+
var pipelineLoading = null;
|
|
506
|
+
async function getEmbeddingPipeline() {
|
|
507
|
+
if (embeddingPipeline) return embeddingPipeline;
|
|
508
|
+
if (pipelineLoading) return pipelineLoading;
|
|
509
|
+
pipelineLoading = (async () => {
|
|
510
|
+
const { pipeline } = await import("./transformers.node-A2ZRORSQ.js");
|
|
511
|
+
embeddingPipeline = await pipeline("feature-extraction", "Xenova/all-MiniLM-L6-v2", {
|
|
512
|
+
dtype: "fp32"
|
|
513
|
+
});
|
|
514
|
+
return embeddingPipeline;
|
|
515
|
+
})();
|
|
516
|
+
return pipelineLoading;
|
|
517
|
+
}
|
|
518
|
+
async function embed(text) {
|
|
519
|
+
const pipe = await getEmbeddingPipeline();
|
|
520
|
+
const result = await pipe(text, { pooling: "mean", normalize: true });
|
|
521
|
+
return new Float32Array(result.data);
|
|
522
|
+
}
|
|
523
|
+
async function embedBatch(texts) {
|
|
524
|
+
const pipe = await getEmbeddingPipeline();
|
|
525
|
+
const results = [];
|
|
526
|
+
const batchSize = 32;
|
|
527
|
+
for (let i = 0; i < texts.length; i += batchSize) {
|
|
528
|
+
const batch = texts.slice(i, i + batchSize);
|
|
529
|
+
for (const text of batch) {
|
|
530
|
+
const result = await pipe(text, { pooling: "mean", normalize: true });
|
|
531
|
+
results.push(new Float32Array(result.data));
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
return results;
|
|
535
|
+
}
|
|
536
|
+
function cosineSimilarity(a, b) {
|
|
537
|
+
let dot = 0;
|
|
538
|
+
for (let i = 0; i < a.length; i++) {
|
|
539
|
+
dot += a[i] * b[i];
|
|
540
|
+
}
|
|
541
|
+
return dot;
|
|
542
|
+
}
|
|
543
|
+
var EmbeddingCache = class {
|
|
544
|
+
cachePath;
|
|
545
|
+
cache = /* @__PURE__ */ new Map();
|
|
546
|
+
dirty = false;
|
|
547
|
+
constructor(vaultPath) {
|
|
548
|
+
this.cachePath = path2.join(vaultPath, ".clawvault", "embeddings.bin");
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Load cache from disk
|
|
552
|
+
*/
|
|
553
|
+
load() {
|
|
554
|
+
try {
|
|
555
|
+
if (!fs2.existsSync(this.cachePath)) return;
|
|
556
|
+
const data = JSON.parse(fs2.readFileSync(this.cachePath + ".json", "utf-8"));
|
|
557
|
+
for (const [key, arr] of Object.entries(data)) {
|
|
558
|
+
this.cache.set(key, new Float32Array(arr));
|
|
559
|
+
}
|
|
560
|
+
} catch {
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Save cache to disk
|
|
565
|
+
*/
|
|
566
|
+
save() {
|
|
567
|
+
if (!this.dirty) return;
|
|
568
|
+
const dir = path2.dirname(this.cachePath);
|
|
569
|
+
if (!fs2.existsSync(dir)) fs2.mkdirSync(dir, { recursive: true });
|
|
570
|
+
const data = {};
|
|
571
|
+
for (const [key, arr] of this.cache.entries()) {
|
|
572
|
+
data[key] = Array.from(arr);
|
|
573
|
+
}
|
|
574
|
+
fs2.writeFileSync(this.cachePath + ".json", JSON.stringify(data));
|
|
575
|
+
this.dirty = false;
|
|
576
|
+
}
|
|
577
|
+
get(key) {
|
|
578
|
+
return this.cache.get(key);
|
|
579
|
+
}
|
|
580
|
+
set(key, embedding) {
|
|
581
|
+
this.cache.set(key, embedding);
|
|
582
|
+
this.dirty = true;
|
|
583
|
+
}
|
|
584
|
+
has(key) {
|
|
585
|
+
return this.cache.has(key);
|
|
586
|
+
}
|
|
587
|
+
entries() {
|
|
588
|
+
return this.cache.entries();
|
|
589
|
+
}
|
|
590
|
+
get size() {
|
|
591
|
+
return this.cache.size;
|
|
592
|
+
}
|
|
593
|
+
};
|
|
594
|
+
function reciprocalRankFusion(list1, list2, k = 60) {
|
|
595
|
+
const scores = /* @__PURE__ */ new Map();
|
|
596
|
+
for (let rank = 0; rank < list1.length; rank++) {
|
|
597
|
+
const { id } = list1[rank];
|
|
598
|
+
scores.set(id, (scores.get(id) || 0) + 1 / (k + rank + 1));
|
|
599
|
+
}
|
|
600
|
+
for (let rank = 0; rank < list2.length; rank++) {
|
|
601
|
+
const { id } = list2[rank];
|
|
602
|
+
scores.set(id, (scores.get(id) || 0) + 1 / (k + rank + 1));
|
|
603
|
+
}
|
|
604
|
+
return Array.from(scores.entries()).map(([id, score]) => ({ id, score })).sort((a, b) => b.score - a.score);
|
|
605
|
+
}
|
|
606
|
+
async function semanticSearch(query, cache, topK = 20) {
|
|
607
|
+
const queryEmb = await embed(query);
|
|
608
|
+
const results = [];
|
|
609
|
+
for (const [id, docEmb] of cache.entries()) {
|
|
610
|
+
results.push({ id, score: cosineSimilarity(queryEmb, docEmb) });
|
|
611
|
+
}
|
|
612
|
+
results.sort((a, b) => b.score - a.score);
|
|
613
|
+
return results.slice(0, topK);
|
|
614
|
+
}
|
|
615
|
+
async function hybridSearch(query, bm25Results, cache, options = {}) {
|
|
616
|
+
const { topK = 20, rrfK = 60 } = options;
|
|
617
|
+
const bm25Ranked = bm25Results.map((r) => ({ id: r.document.path || r.document.id, score: r.score }));
|
|
618
|
+
const semanticRanked = await semanticSearch(query, cache, topK);
|
|
619
|
+
const fused = reciprocalRankFusion(bm25Ranked, semanticRanked, rrfK);
|
|
620
|
+
const bm25Map = new Map(bm25Results.map((r) => [r.document.path || r.document.id, r]));
|
|
621
|
+
return fused.slice(0, topK).map(({ id, score }) => {
|
|
622
|
+
const existing = bm25Map.get(id);
|
|
623
|
+
if (existing) {
|
|
624
|
+
return { ...existing, score };
|
|
625
|
+
}
|
|
626
|
+
const minimalDoc = {
|
|
627
|
+
id: id.replace(/\.md$/, ""),
|
|
628
|
+
path: id.endsWith(".md") ? id : id + ".md",
|
|
629
|
+
title: (id.split("/").pop() || id).replace(/\.md$/, ""),
|
|
630
|
+
content: "",
|
|
631
|
+
category: id.split("/")[0] || "root",
|
|
632
|
+
frontmatter: {},
|
|
633
|
+
links: [],
|
|
634
|
+
tags: [],
|
|
635
|
+
modified: /* @__PURE__ */ new Date()
|
|
636
|
+
};
|
|
637
|
+
return {
|
|
638
|
+
document: minimalDoc,
|
|
639
|
+
score,
|
|
640
|
+
snippet: "",
|
|
641
|
+
matchedTerms: []
|
|
642
|
+
};
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
|
|
490
646
|
// src/index.ts
|
|
491
647
|
function readPackageVersion() {
|
|
492
648
|
try {
|
|
493
649
|
const pkgUrl = new URL("../package.json", import.meta.url);
|
|
494
|
-
const pkg = JSON.parse(
|
|
650
|
+
const pkg = JSON.parse(fs3.readFileSync(pkgUrl, "utf-8"));
|
|
495
651
|
return pkg.version ?? "0.0.0";
|
|
496
652
|
} catch {
|
|
497
653
|
return "0.0.0";
|
|
@@ -528,6 +684,7 @@ export {
|
|
|
528
684
|
archiveCommand,
|
|
529
685
|
archiveObservations,
|
|
530
686
|
archiveProject,
|
|
687
|
+
benchmarkObserverCommand,
|
|
531
688
|
buildContext,
|
|
532
689
|
buildInjectionResult,
|
|
533
690
|
buildKanbanLanes,
|
|
@@ -538,6 +695,7 @@ export {
|
|
|
538
695
|
checkOpenClawCompatibility,
|
|
539
696
|
checkPeerClawVault,
|
|
540
697
|
compareManifests,
|
|
698
|
+
compareObservationText,
|
|
541
699
|
compatCommand,
|
|
542
700
|
compatibilityExitCode,
|
|
543
701
|
completeTask,
|
|
@@ -560,6 +718,7 @@ export {
|
|
|
560
718
|
extractCardSlug,
|
|
561
719
|
extractFactsLlm,
|
|
562
720
|
extractFactsRuleBased,
|
|
721
|
+
extractKeywordSetFromTranscript,
|
|
563
722
|
extractTags,
|
|
564
723
|
extractWikiLinks,
|
|
565
724
|
factId,
|
|
@@ -570,6 +729,7 @@ export {
|
|
|
570
729
|
findVault,
|
|
571
730
|
formatContextMarkdown,
|
|
572
731
|
formatKanbanCard,
|
|
732
|
+
formatObserverBenchmarkSummary,
|
|
573
733
|
formatSessionRecapMarkdown,
|
|
574
734
|
formatTransitionsTable,
|
|
575
735
|
generateKanbanMarkdown,
|
|
@@ -592,6 +752,7 @@ export {
|
|
|
592
752
|
hasTailscale,
|
|
593
753
|
hybridSearch,
|
|
594
754
|
importKanbanBoard,
|
|
755
|
+
inboxAddCommand,
|
|
595
756
|
indexInjectableItems,
|
|
596
757
|
inferContextProfile,
|
|
597
758
|
injectCommand,
|
|
@@ -603,6 +764,9 @@ export {
|
|
|
603
764
|
listRouteRules,
|
|
604
765
|
listSubtasks,
|
|
605
766
|
loadMemoryGraphIndex,
|
|
767
|
+
loadObserverBenchmarkFixtures,
|
|
768
|
+
maintainCommand,
|
|
769
|
+
matchObservationRecords,
|
|
606
770
|
matchRouteRule,
|
|
607
771
|
migrate,
|
|
608
772
|
migrateCommand,
|
|
@@ -625,11 +789,14 @@ export {
|
|
|
625
789
|
reciprocalRankFusion,
|
|
626
790
|
reflectCommand,
|
|
627
791
|
registerArchiveCommand,
|
|
792
|
+
registerBenchmarkCommand,
|
|
628
793
|
registerCliCommands,
|
|
629
794
|
registerCommanderCommands,
|
|
630
795
|
registerContextCommand,
|
|
631
796
|
registerEmbedCommand,
|
|
797
|
+
registerInboxCommand,
|
|
632
798
|
registerInjectCommand,
|
|
799
|
+
registerMaintainCommand,
|
|
633
800
|
registerMigrateCommand,
|
|
634
801
|
registerMigrateObservationsCommand,
|
|
635
802
|
registerObserveCommand,
|
|
@@ -652,8 +819,10 @@ export {
|
|
|
652
819
|
resolveLlmProvider,
|
|
653
820
|
resolvePeerIP,
|
|
654
821
|
resolveVaultPath,
|
|
822
|
+
runObserverBenchmark,
|
|
655
823
|
runPromptInjection,
|
|
656
824
|
runReflection,
|
|
825
|
+
scoreFixtureObservations,
|
|
657
826
|
semanticSearch,
|
|
658
827
|
serveVault,
|
|
659
828
|
sessionRecapCommand,
|
|
@@ -58,10 +58,12 @@ declare function getMemoryGraph(vaultPath: string, options?: {
|
|
|
58
58
|
}): Promise<MemoryGraph>;
|
|
59
59
|
|
|
60
60
|
type LlmProvider = 'anthropic' | 'openai' | 'gemini' | 'xai' | 'openclaw';
|
|
61
|
+
type LlmModelTier = 'background' | 'default' | 'complex';
|
|
61
62
|
interface LlmCompletionOptions {
|
|
62
63
|
prompt: string;
|
|
63
64
|
provider?: LlmProvider | null;
|
|
64
65
|
model?: string;
|
|
66
|
+
tier?: LlmModelTier;
|
|
65
67
|
systemPrompt?: string;
|
|
66
68
|
temperature?: number;
|
|
67
69
|
maxTokens?: number;
|
|
@@ -134,4 +136,4 @@ declare function buildInjectionResult(message: string, options: InjectCommandOpt
|
|
|
134
136
|
declare function injectCommand(message: string, options: InjectCommandOptions): Promise<void>;
|
|
135
137
|
declare function registerInjectCommand(program: Command): void;
|
|
136
138
|
|
|
137
|
-
export {
|
|
139
|
+
export { resolveLlmProvider as A, runPromptInjection as B, type InjectCommandOptions as I, type LlmProvider as L, MEMORY_GRAPH_SCHEMA_VERSION as M, type LlmModelTier as a, type InjectFormat as b, type InjectMatch as c, type InjectMatchReason as d, type InjectMatchSource as e, type InjectResult as f, type InjectRuntimeOptions as g, type InjectSourceCategory as h, type InjectableItem as i, type LlmCompletionOptions as j, type MemoryGraph as k, type MemoryGraphEdge as l, type MemoryGraphEdgeType as m, type MemoryGraphIndex as n, type MemoryGraphNode as o, type MemoryGraphNodeType as p, type MemoryGraphStats as q, buildInjectionResult as r, buildOrUpdateMemoryGraphIndex as s, deterministicInjectMatches as t, getMemoryGraph as u, indexInjectableItems as v, injectCommand as w, loadMemoryGraphIndex as x, registerInjectCommand as y, requestLlmCompletion as z };
|
package/dist/lib/auto-linker.js
CHANGED
package/dist/lib/config.js
CHANGED
package/dist/lib/entity-index.js
CHANGED
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
listProjects,
|
|
7
7
|
readProject,
|
|
8
8
|
updateProject
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-4PY655YM.js";
|
|
10
10
|
import "../chunk-QWQ3TIKS.js";
|
|
11
11
|
import "../chunk-MFAWT5O5.js";
|
|
12
12
|
import "../chunk-7766SIJP.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-2ZDO52B4.js";
|
|
14
14
|
export {
|
|
15
15
|
archiveProject,
|
|
16
16
|
createProject,
|
package/dist/lib/tailscale.js
CHANGED
package/dist/lib/task-utils.js
CHANGED