clawvault 3.2.1 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -16
- package/bin/clawvault.js +0 -2
- package/bin/command-registration.test.js +15 -2
- package/bin/help-contract.test.js +16 -0
- package/bin/register-core-commands.js +88 -0
- package/bin/register-core-commands.test.js +80 -0
- package/bin/register-maintenance-commands.js +84 -7
- package/bin/register-query-commands.js +45 -28
- package/bin/register-query-commands.test.js +15 -0
- 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-35JCYSRR.js +158 -0
- 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-D5U3Q4N5.js +872 -0
- package/dist/chunk-DCF4KMFD.js +158 -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-NSXYM6EZ.js +255 -0
- 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-QYQAGBTM.js +2097 -0
- package/dist/chunk-RL2L6I6K.js +223 -0
- package/dist/{chunk-IIOU45CK.js → chunk-S7N7HI5E.js} +2 -2
- package/dist/{chunk-ECRZL5XR.js → chunk-T7E764W3.js} +23 -7
- 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-SS4B7P7V.js → chunk-YIDV4VV2.js} +1 -1
- package/dist/chunk-YTRZNA64.js +37 -0
- package/dist/chunk-ZKWPCBYT.js +600 -0
- package/dist/cli/index.js +28 -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.d.ts +8 -1
- package/dist/commands/entities.js +46 -3
- 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 +5 -5
- package/dist/commands/maintain.d.ts +32 -0
- package/dist/commands/maintain.js +13 -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/recall.d.ts +14 -0
- package/dist/commands/recall.js +15 -0
- 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 +233 -16
- package/dist/index.js +325 -111
- 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--gqA2BZw.d.ts +267 -0
- package/dist/openclaw-plugin.d.ts +4 -0
- package/dist/openclaw-plugin.js +20 -0
- package/dist/transformers.node-A2ZRORSQ.js +46775 -0
- package/dist/types-CbL-wIKi.d.ts +36 -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 +161 -194
- package/package.json +8 -5
- 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,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
registerSyncBdCommand,
|
|
3
|
+
syncBdCommand
|
|
4
|
+
} from "./chunk-YIDV4VV2.js";
|
|
5
|
+
import {
|
|
6
|
+
rebuildCommand,
|
|
7
|
+
registerRebuildCommand
|
|
8
|
+
} from "./chunk-QFWERBDP.js";
|
|
9
|
+
import {
|
|
10
|
+
recallCommand
|
|
11
|
+
} from "./chunk-YTRZNA64.js";
|
|
1
12
|
import {
|
|
2
13
|
registerReplayCommand,
|
|
3
14
|
replayCommand
|
|
4
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HGDDW24U.js";
|
|
5
16
|
import {
|
|
6
17
|
buildSessionRecap,
|
|
7
18
|
formatSessionRecapMarkdown,
|
|
@@ -9,52 +20,60 @@ import {
|
|
|
9
20
|
} from "./chunk-ZKGY7WTT.js";
|
|
10
21
|
import {
|
|
11
22
|
setupCommand
|
|
12
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-EL6UBSX5.js";
|
|
13
24
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
25
|
+
buildKanbanLanes,
|
|
26
|
+
extractCardSlug,
|
|
27
|
+
formatKanbanCard,
|
|
28
|
+
generateKanbanMarkdown,
|
|
29
|
+
importKanbanBoard,
|
|
30
|
+
kanbanCommand,
|
|
31
|
+
parseKanbanMarkdown,
|
|
32
|
+
syncKanbanBoard
|
|
33
|
+
} from "./chunk-4OXMU5S2.js";
|
|
17
34
|
import {
|
|
18
35
|
migrateObservations,
|
|
19
36
|
migrateObservationsCommand,
|
|
20
37
|
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";
|
|
38
|
+
} from "./chunk-5EFSWZO6.js";
|
|
31
39
|
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
checkOpenClawCompatibility,
|
|
41
|
+
compatCommand,
|
|
42
|
+
compatibilityExitCode
|
|
43
|
+
} from "./chunk-X3SPPUFG.js";
|
|
35
44
|
import {
|
|
36
45
|
doctor
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-7ZRP733D.js";
|
|
46
|
+
} from "./chunk-CSHO3PJB.js";
|
|
39
47
|
import {
|
|
40
48
|
graphCommand,
|
|
41
49
|
graphSummary
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
} from "./chunk-S7N7HI5E.js";
|
|
51
|
+
import {
|
|
52
|
+
LiveCaptureService,
|
|
53
|
+
createMemorySlot,
|
|
54
|
+
createMemorySlotPlugin,
|
|
55
|
+
evaluateCandidateQuality,
|
|
56
|
+
extractHeuristicMemories,
|
|
57
|
+
extractMemoriesFromAssistantResponse,
|
|
58
|
+
extractTaggedMemoryNotes,
|
|
59
|
+
isLikelyJunkMemory,
|
|
60
|
+
openclaw_plugin_default,
|
|
61
|
+
plausibilityScore,
|
|
62
|
+
registerMemorySlot
|
|
63
|
+
} from "./chunk-QYQAGBTM.js";
|
|
64
|
+
import {
|
|
65
|
+
buildRecallResult,
|
|
66
|
+
classifyRecallQuery
|
|
67
|
+
} from "./chunk-RL2L6I6K.js";
|
|
68
|
+
import {
|
|
69
|
+
ensureEntityProfiles,
|
|
70
|
+
readEntityProfile,
|
|
71
|
+
readEntityProfiles,
|
|
72
|
+
synthesizeEntityProfiles
|
|
73
|
+
} from "./chunk-NSXYM6EZ.js";
|
|
55
74
|
import {
|
|
56
75
|
registerCliCommands
|
|
57
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-DCF4KMFD.js";
|
|
58
77
|
import {
|
|
59
78
|
registerTailscaleCommands,
|
|
60
79
|
registerTailscaleDiscoverCommand,
|
|
@@ -65,7 +84,7 @@ import {
|
|
|
65
84
|
tailscaleServeCommand,
|
|
66
85
|
tailscaleStatusCommand,
|
|
67
86
|
tailscaleSyncCommand
|
|
68
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-KCYWJDDW.js";
|
|
69
88
|
import {
|
|
70
89
|
CLAWVAULT_SERVE_PATH,
|
|
71
90
|
DEFAULT_SERVE_PORT,
|
|
@@ -88,38 +107,37 @@ import {
|
|
|
88
107
|
syncWithPeer
|
|
89
108
|
} from "./chunk-TIGW564L.js";
|
|
90
109
|
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
110
|
import {
|
|
100
111
|
reflectCommand,
|
|
101
112
|
registerReflectCommand
|
|
102
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-DOIUYIXV.js";
|
|
103
114
|
import {
|
|
104
115
|
runReflection
|
|
105
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-TWMI3SNN.js";
|
|
106
117
|
import {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
buildInjectionResult,
|
|
119
|
+
deterministicInjectMatches,
|
|
120
|
+
indexInjectableItems,
|
|
121
|
+
injectCommand,
|
|
122
|
+
registerInjectCommand,
|
|
123
|
+
runPromptInjection
|
|
124
|
+
} from "./chunk-OFOCU2V4.js";
|
|
125
|
+
import {
|
|
126
|
+
maintainCommand,
|
|
127
|
+
registerMaintainCommand
|
|
128
|
+
} from "./chunk-D5U3Q4N5.js";
|
|
129
|
+
import {
|
|
130
|
+
SessionWatcher,
|
|
131
|
+
observeCommand,
|
|
132
|
+
registerObserveCommand
|
|
133
|
+
} from "./chunk-BLQXXX7Q.js";
|
|
115
134
|
import {
|
|
116
135
|
getObserverStaleness,
|
|
117
136
|
getScaledObservationThresholdBytes,
|
|
118
137
|
observeActiveSessions,
|
|
119
138
|
parseSessionSourceLabel
|
|
120
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-VXAGOLDP.js";
|
|
121
140
|
import {
|
|
122
|
-
Compressor,
|
|
123
141
|
Observer,
|
|
124
142
|
Reflector,
|
|
125
143
|
createDefaultAdapter,
|
|
@@ -127,7 +145,12 @@ import {
|
|
|
127
145
|
createGeminiFlashAdapter,
|
|
128
146
|
createLlmFunction,
|
|
129
147
|
resolveFactExtractionMode
|
|
130
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-7SWP5FKU.js";
|
|
149
|
+
import "./chunk-HRLWZGMA.js";
|
|
150
|
+
import {
|
|
151
|
+
requestLlmCompletion,
|
|
152
|
+
resolveLlmProvider
|
|
153
|
+
} from "./chunk-DVOUSOR3.js";
|
|
131
154
|
import {
|
|
132
155
|
archiveProject,
|
|
133
156
|
createProject,
|
|
@@ -136,13 +159,39 @@ import {
|
|
|
136
159
|
listProjects,
|
|
137
160
|
readProject,
|
|
138
161
|
updateProject
|
|
139
|
-
} from "./chunk-
|
|
140
|
-
import "./chunk-HRLWZGMA.js";
|
|
162
|
+
} from "./chunk-4PY655YM.js";
|
|
141
163
|
import {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
164
|
+
SUPPORTED_CONFIG_KEYS,
|
|
165
|
+
addRouteRule,
|
|
166
|
+
getConfig,
|
|
167
|
+
getConfigValue,
|
|
168
|
+
listConfig,
|
|
169
|
+
listRouteRules,
|
|
170
|
+
matchRouteRule,
|
|
171
|
+
removeRouteRule,
|
|
172
|
+
resetConfig,
|
|
173
|
+
setConfigValue,
|
|
174
|
+
testRouteRule
|
|
175
|
+
} from "./chunk-AXSJIFOJ.js";
|
|
176
|
+
import {
|
|
177
|
+
buildContext,
|
|
178
|
+
contextCommand,
|
|
179
|
+
formatContextMarkdown,
|
|
180
|
+
inferContextProfile,
|
|
181
|
+
normalizeContextProfileInput,
|
|
182
|
+
registerContextCommand,
|
|
183
|
+
resolveContextProfile
|
|
184
|
+
} from "./chunk-GFCHWMGD.js";
|
|
185
|
+
import {
|
|
186
|
+
embedCommand,
|
|
187
|
+
registerEmbedCommand
|
|
188
|
+
} from "./chunk-T7E764W3.js";
|
|
189
|
+
import {
|
|
190
|
+
inboxAddCommand,
|
|
191
|
+
registerInboxCommand
|
|
192
|
+
} from "./chunk-HEHO7SMV.js";
|
|
193
|
+
import "./chunk-2PKBIKDH.js";
|
|
194
|
+
import "./chunk-35JCYSRR.js";
|
|
146
195
|
import {
|
|
147
196
|
FactStore,
|
|
148
197
|
extractFactsLlm,
|
|
@@ -150,15 +199,21 @@ import {
|
|
|
150
199
|
factId,
|
|
151
200
|
normalizeEntity
|
|
152
201
|
} from "./chunk-BSJ6RIT7.js";
|
|
153
|
-
import "./chunk-FHFUXL6G.js";
|
|
154
202
|
import {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
203
|
+
ClawVault,
|
|
204
|
+
createVault,
|
|
205
|
+
findVault
|
|
206
|
+
} from "./chunk-ECGJYWNA.js";
|
|
207
|
+
import {
|
|
208
|
+
DEFAULT_CATEGORIES,
|
|
209
|
+
DEFAULT_CONFIG,
|
|
210
|
+
MEMORY_TYPES,
|
|
211
|
+
TYPE_TO_CATEGORY
|
|
212
|
+
} from "./chunk-2CDEETQN.js";
|
|
158
213
|
import {
|
|
159
214
|
loadVaultQmdConfig,
|
|
160
215
|
removeQmdCollection
|
|
161
|
-
} from "./chunk-
|
|
216
|
+
} from "./chunk-FZ5I2NF7.js";
|
|
162
217
|
import {
|
|
163
218
|
QMD_INSTALL_COMMAND,
|
|
164
219
|
QMD_INSTALL_URL,
|
|
@@ -171,42 +226,12 @@ import {
|
|
|
171
226
|
hasQmd,
|
|
172
227
|
qmdEmbed,
|
|
173
228
|
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";
|
|
196
|
-
import {
|
|
197
|
-
requestLlmCompletion,
|
|
198
|
-
resolveLlmProvider
|
|
199
|
-
} from "./chunk-YXQCA6B7.js";
|
|
200
|
-
import {
|
|
201
|
-
DEFAULT_CATEGORIES,
|
|
202
|
-
DEFAULT_CONFIG,
|
|
203
|
-
MEMORY_TYPES,
|
|
204
|
-
TYPE_TO_CATEGORY
|
|
205
|
-
} from "./chunk-2CDEETQN.js";
|
|
229
|
+
} from "./chunk-PTWPPVC7.js";
|
|
230
|
+
import "./chunk-H3JZIB5O.js";
|
|
206
231
|
import {
|
|
207
232
|
archiveCommand,
|
|
208
233
|
registerArchiveCommand
|
|
209
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-VBILES4B.js";
|
|
210
235
|
import {
|
|
211
236
|
archiveObservations
|
|
212
237
|
} from "./chunk-MQUJNOHK.js";
|
|
@@ -214,13 +239,31 @@ import {
|
|
|
214
239
|
findNearestVaultPath,
|
|
215
240
|
getVaultPath,
|
|
216
241
|
resolveVaultPath
|
|
217
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-GJO3CFUN.js";
|
|
243
|
+
import {
|
|
244
|
+
benchmarkObserverCommand,
|
|
245
|
+
compareObservationText,
|
|
246
|
+
extractKeywordSetFromTranscript,
|
|
247
|
+
formatObserverBenchmarkSummary,
|
|
248
|
+
loadObserverBenchmarkFixtures,
|
|
249
|
+
matchObservationRecords,
|
|
250
|
+
registerBenchmarkCommand,
|
|
251
|
+
runObserverBenchmark,
|
|
252
|
+
scoreFixtureObservations
|
|
253
|
+
} from "./chunk-ZKWPCBYT.js";
|
|
254
|
+
import {
|
|
255
|
+
parseSessionFile
|
|
256
|
+
} from "./chunk-MW5C6ZQA.js";
|
|
257
|
+
import {
|
|
258
|
+
Compressor
|
|
259
|
+
} from "./chunk-J3YUXVID.js";
|
|
260
|
+
import "./chunk-FHFUXL6G.js";
|
|
218
261
|
import {
|
|
219
262
|
MEMORY_GRAPH_SCHEMA_VERSION,
|
|
220
263
|
buildOrUpdateMemoryGraphIndex,
|
|
221
264
|
getMemoryGraph,
|
|
222
265
|
loadMemoryGraphIndex
|
|
223
|
-
} from "./chunk-
|
|
266
|
+
} from "./chunk-33DOSHTA.js";
|
|
224
267
|
import "./chunk-Z2XBWN7A.js";
|
|
225
268
|
import {
|
|
226
269
|
appendTransition,
|
|
@@ -240,22 +283,17 @@ import {
|
|
|
240
283
|
buildTemplateVariables,
|
|
241
284
|
renderTemplate
|
|
242
285
|
} from "./chunk-7766SIJP.js";
|
|
243
|
-
import
|
|
244
|
-
checkOpenClawCompatibility,
|
|
245
|
-
compatCommand,
|
|
246
|
-
compatibilityExitCode
|
|
247
|
-
} from "./chunk-X3SPPUFG.js";
|
|
248
|
-
import "./chunk-U67V476Y.js";
|
|
286
|
+
import "./chunk-2ZDO52B4.js";
|
|
249
287
|
|
|
250
288
|
// src/index.ts
|
|
251
|
-
import * as
|
|
289
|
+
import * as fs3 from "fs";
|
|
252
290
|
|
|
253
291
|
// src/commands/migrate.ts
|
|
254
292
|
import * as fs from "fs";
|
|
255
293
|
import * as path from "path";
|
|
256
294
|
import { execFileSync } from "child_process";
|
|
257
295
|
function addQmdCollection(name, rootPath) {
|
|
258
|
-
execFileSync("qmd", ["collection", "add", name, rootPath], { stdio: "ignore" });
|
|
296
|
+
execFileSync("qmd", ["collection", "add", name, rootPath], { stdio: "ignore", shell: process.platform === "win32" });
|
|
259
297
|
}
|
|
260
298
|
function updateVaultConfig(vaultPath, updates) {
|
|
261
299
|
const configPath = path.join(vaultPath, ".clawvault.json");
|
|
@@ -487,11 +525,156 @@ function registerMigrateCommand(program) {
|
|
|
487
525
|
});
|
|
488
526
|
}
|
|
489
527
|
|
|
528
|
+
// src/lib/hybrid-search.ts
|
|
529
|
+
import * as fs2 from "fs";
|
|
530
|
+
import * as path2 from "path";
|
|
531
|
+
var embeddingPipeline = null;
|
|
532
|
+
var pipelineLoading = null;
|
|
533
|
+
async function getEmbeddingPipeline() {
|
|
534
|
+
if (embeddingPipeline) return embeddingPipeline;
|
|
535
|
+
if (pipelineLoading) return pipelineLoading;
|
|
536
|
+
pipelineLoading = (async () => {
|
|
537
|
+
const { pipeline } = await import("./transformers.node-A2ZRORSQ.js");
|
|
538
|
+
embeddingPipeline = await pipeline("feature-extraction", "Xenova/all-MiniLM-L6-v2", {
|
|
539
|
+
dtype: "fp32"
|
|
540
|
+
});
|
|
541
|
+
return embeddingPipeline;
|
|
542
|
+
})();
|
|
543
|
+
return pipelineLoading;
|
|
544
|
+
}
|
|
545
|
+
async function embed(text) {
|
|
546
|
+
const pipe = await getEmbeddingPipeline();
|
|
547
|
+
const result = await pipe(text, { pooling: "mean", normalize: true });
|
|
548
|
+
return new Float32Array(result.data);
|
|
549
|
+
}
|
|
550
|
+
async function embedBatch(texts) {
|
|
551
|
+
const pipe = await getEmbeddingPipeline();
|
|
552
|
+
const results = [];
|
|
553
|
+
const batchSize = 32;
|
|
554
|
+
for (let i = 0; i < texts.length; i += batchSize) {
|
|
555
|
+
const batch = texts.slice(i, i + batchSize);
|
|
556
|
+
for (const text of batch) {
|
|
557
|
+
const result = await pipe(text, { pooling: "mean", normalize: true });
|
|
558
|
+
results.push(new Float32Array(result.data));
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
return results;
|
|
562
|
+
}
|
|
563
|
+
function cosineSimilarity(a, b) {
|
|
564
|
+
let dot = 0;
|
|
565
|
+
for (let i = 0; i < a.length; i++) {
|
|
566
|
+
dot += a[i] * b[i];
|
|
567
|
+
}
|
|
568
|
+
return dot;
|
|
569
|
+
}
|
|
570
|
+
var EmbeddingCache = class {
|
|
571
|
+
cachePath;
|
|
572
|
+
cache = /* @__PURE__ */ new Map();
|
|
573
|
+
dirty = false;
|
|
574
|
+
constructor(vaultPath) {
|
|
575
|
+
this.cachePath = path2.join(vaultPath, ".clawvault", "embeddings.bin");
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Load cache from disk
|
|
579
|
+
*/
|
|
580
|
+
load() {
|
|
581
|
+
try {
|
|
582
|
+
if (!fs2.existsSync(this.cachePath)) return;
|
|
583
|
+
const data = JSON.parse(fs2.readFileSync(this.cachePath + ".json", "utf-8"));
|
|
584
|
+
for (const [key, arr] of Object.entries(data)) {
|
|
585
|
+
this.cache.set(key, new Float32Array(arr));
|
|
586
|
+
}
|
|
587
|
+
} catch {
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Save cache to disk
|
|
592
|
+
*/
|
|
593
|
+
save() {
|
|
594
|
+
if (!this.dirty) return;
|
|
595
|
+
const dir = path2.dirname(this.cachePath);
|
|
596
|
+
if (!fs2.existsSync(dir)) fs2.mkdirSync(dir, { recursive: true });
|
|
597
|
+
const data = {};
|
|
598
|
+
for (const [key, arr] of this.cache.entries()) {
|
|
599
|
+
data[key] = Array.from(arr);
|
|
600
|
+
}
|
|
601
|
+
fs2.writeFileSync(this.cachePath + ".json", JSON.stringify(data));
|
|
602
|
+
this.dirty = false;
|
|
603
|
+
}
|
|
604
|
+
get(key) {
|
|
605
|
+
return this.cache.get(key);
|
|
606
|
+
}
|
|
607
|
+
set(key, embedding) {
|
|
608
|
+
this.cache.set(key, embedding);
|
|
609
|
+
this.dirty = true;
|
|
610
|
+
}
|
|
611
|
+
has(key) {
|
|
612
|
+
return this.cache.has(key);
|
|
613
|
+
}
|
|
614
|
+
entries() {
|
|
615
|
+
return this.cache.entries();
|
|
616
|
+
}
|
|
617
|
+
get size() {
|
|
618
|
+
return this.cache.size;
|
|
619
|
+
}
|
|
620
|
+
};
|
|
621
|
+
function reciprocalRankFusion(list1, list2, k = 60) {
|
|
622
|
+
const scores = /* @__PURE__ */ new Map();
|
|
623
|
+
for (let rank = 0; rank < list1.length; rank++) {
|
|
624
|
+
const { id } = list1[rank];
|
|
625
|
+
scores.set(id, (scores.get(id) || 0) + 1 / (k + rank + 1));
|
|
626
|
+
}
|
|
627
|
+
for (let rank = 0; rank < list2.length; rank++) {
|
|
628
|
+
const { id } = list2[rank];
|
|
629
|
+
scores.set(id, (scores.get(id) || 0) + 1 / (k + rank + 1));
|
|
630
|
+
}
|
|
631
|
+
return Array.from(scores.entries()).map(([id, score]) => ({ id, score })).sort((a, b) => b.score - a.score);
|
|
632
|
+
}
|
|
633
|
+
async function semanticSearch(query, cache, topK = 20) {
|
|
634
|
+
const queryEmb = await embed(query);
|
|
635
|
+
const results = [];
|
|
636
|
+
for (const [id, docEmb] of cache.entries()) {
|
|
637
|
+
results.push({ id, score: cosineSimilarity(queryEmb, docEmb) });
|
|
638
|
+
}
|
|
639
|
+
results.sort((a, b) => b.score - a.score);
|
|
640
|
+
return results.slice(0, topK);
|
|
641
|
+
}
|
|
642
|
+
async function hybridSearch(query, bm25Results, cache, options = {}) {
|
|
643
|
+
const { topK = 20, rrfK = 60 } = options;
|
|
644
|
+
const bm25Ranked = bm25Results.map((r) => ({ id: r.document.path || r.document.id, score: r.score }));
|
|
645
|
+
const semanticRanked = await semanticSearch(query, cache, topK);
|
|
646
|
+
const fused = reciprocalRankFusion(bm25Ranked, semanticRanked, rrfK);
|
|
647
|
+
const bm25Map = new Map(bm25Results.map((r) => [r.document.path || r.document.id, r]));
|
|
648
|
+
return fused.slice(0, topK).map(({ id, score }) => {
|
|
649
|
+
const existing = bm25Map.get(id);
|
|
650
|
+
if (existing) {
|
|
651
|
+
return { ...existing, score };
|
|
652
|
+
}
|
|
653
|
+
const minimalDoc = {
|
|
654
|
+
id: id.replace(/\.md$/, ""),
|
|
655
|
+
path: id.endsWith(".md") ? id : id + ".md",
|
|
656
|
+
title: (id.split("/").pop() || id).replace(/\.md$/, ""),
|
|
657
|
+
content: "",
|
|
658
|
+
category: id.split("/")[0] || "root",
|
|
659
|
+
frontmatter: {},
|
|
660
|
+
links: [],
|
|
661
|
+
tags: [],
|
|
662
|
+
modified: /* @__PURE__ */ new Date()
|
|
663
|
+
};
|
|
664
|
+
return {
|
|
665
|
+
document: minimalDoc,
|
|
666
|
+
score,
|
|
667
|
+
snippet: "",
|
|
668
|
+
matchedTerms: []
|
|
669
|
+
};
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
|
|
490
673
|
// src/index.ts
|
|
491
674
|
function readPackageVersion() {
|
|
492
675
|
try {
|
|
493
676
|
const pkgUrl = new URL("../package.json", import.meta.url);
|
|
494
|
-
const pkg = JSON.parse(
|
|
677
|
+
const pkg = JSON.parse(fs3.readFileSync(pkgUrl, "utf-8"));
|
|
495
678
|
return pkg.version ?? "0.0.0";
|
|
496
679
|
} catch {
|
|
497
680
|
return "0.0.0";
|
|
@@ -510,6 +693,7 @@ export {
|
|
|
510
693
|
DEFAULT_SERVE_PORT,
|
|
511
694
|
EmbeddingCache,
|
|
512
695
|
FactStore,
|
|
696
|
+
LiveCaptureService,
|
|
513
697
|
MEMORY_GRAPH_SCHEMA_VERSION,
|
|
514
698
|
MEMORY_TYPES,
|
|
515
699
|
Observer,
|
|
@@ -528,16 +712,20 @@ export {
|
|
|
528
712
|
archiveCommand,
|
|
529
713
|
archiveObservations,
|
|
530
714
|
archiveProject,
|
|
715
|
+
benchmarkObserverCommand,
|
|
531
716
|
buildContext,
|
|
532
717
|
buildInjectionResult,
|
|
533
718
|
buildKanbanLanes,
|
|
534
719
|
buildOrUpdateMemoryGraphIndex,
|
|
720
|
+
buildRecallResult,
|
|
535
721
|
buildSessionRecap,
|
|
536
722
|
buildTemplateVariables,
|
|
537
723
|
buildTransitionEvent,
|
|
538
724
|
checkOpenClawCompatibility,
|
|
539
725
|
checkPeerClawVault,
|
|
726
|
+
classifyRecallQuery,
|
|
540
727
|
compareManifests,
|
|
728
|
+
compareObservationText,
|
|
541
729
|
compatCommand,
|
|
542
730
|
compatibilityExitCode,
|
|
543
731
|
completeTask,
|
|
@@ -549,6 +737,8 @@ export {
|
|
|
549
737
|
createFactExtractionAdapter,
|
|
550
738
|
createGeminiFlashAdapter,
|
|
551
739
|
createLlmFunction,
|
|
740
|
+
createMemorySlot,
|
|
741
|
+
createMemorySlotPlugin,
|
|
552
742
|
createProject,
|
|
553
743
|
createVault,
|
|
554
744
|
deterministicInjectMatches,
|
|
@@ -557,9 +747,15 @@ export {
|
|
|
557
747
|
embed,
|
|
558
748
|
embedBatch,
|
|
559
749
|
embedCommand,
|
|
750
|
+
ensureEntityProfiles,
|
|
751
|
+
evaluateCandidateQuality,
|
|
560
752
|
extractCardSlug,
|
|
561
753
|
extractFactsLlm,
|
|
562
754
|
extractFactsRuleBased,
|
|
755
|
+
extractHeuristicMemories,
|
|
756
|
+
extractKeywordSetFromTranscript,
|
|
757
|
+
extractMemoriesFromAssistantResponse,
|
|
758
|
+
extractTaggedMemoryNotes,
|
|
563
759
|
extractTags,
|
|
564
760
|
extractWikiLinks,
|
|
565
761
|
factId,
|
|
@@ -570,6 +766,7 @@ export {
|
|
|
570
766
|
findVault,
|
|
571
767
|
formatContextMarkdown,
|
|
572
768
|
formatKanbanCard,
|
|
769
|
+
formatObserverBenchmarkSummary,
|
|
573
770
|
formatSessionRecapMarkdown,
|
|
574
771
|
formatTransitionsTable,
|
|
575
772
|
generateKanbanMarkdown,
|
|
@@ -592,9 +789,11 @@ export {
|
|
|
592
789
|
hasTailscale,
|
|
593
790
|
hybridSearch,
|
|
594
791
|
importKanbanBoard,
|
|
792
|
+
inboxAddCommand,
|
|
595
793
|
indexInjectableItems,
|
|
596
794
|
inferContextProfile,
|
|
597
795
|
injectCommand,
|
|
796
|
+
isLikelyJunkMemory,
|
|
598
797
|
isRegression,
|
|
599
798
|
kanbanCommand,
|
|
600
799
|
listConfig,
|
|
@@ -603,6 +802,9 @@ export {
|
|
|
603
802
|
listRouteRules,
|
|
604
803
|
listSubtasks,
|
|
605
804
|
loadMemoryGraphIndex,
|
|
805
|
+
loadObserverBenchmarkFixtures,
|
|
806
|
+
maintainCommand,
|
|
807
|
+
matchObservationRecords,
|
|
606
808
|
matchRouteRule,
|
|
607
809
|
migrate,
|
|
608
810
|
migrateCommand,
|
|
@@ -612,24 +814,33 @@ export {
|
|
|
612
814
|
normalizeEntity,
|
|
613
815
|
observeActiveSessions,
|
|
614
816
|
observeCommand,
|
|
817
|
+
openclaw_plugin_default as openclawHookPlugin,
|
|
615
818
|
parseKanbanMarkdown,
|
|
616
819
|
parseSessionFile,
|
|
617
820
|
parseSessionSourceLabel,
|
|
821
|
+
plausibilityScore,
|
|
618
822
|
pushFileToRemote,
|
|
619
823
|
qmdEmbed,
|
|
620
824
|
qmdUpdate,
|
|
621
825
|
queryTransitions,
|
|
622
826
|
readAllTransitions,
|
|
827
|
+
readEntityProfile,
|
|
828
|
+
readEntityProfiles,
|
|
623
829
|
readProject,
|
|
624
830
|
rebuildCommand,
|
|
831
|
+
recallCommand,
|
|
625
832
|
reciprocalRankFusion,
|
|
626
833
|
reflectCommand,
|
|
627
834
|
registerArchiveCommand,
|
|
835
|
+
registerBenchmarkCommand,
|
|
628
836
|
registerCliCommands,
|
|
629
837
|
registerCommanderCommands,
|
|
630
838
|
registerContextCommand,
|
|
631
839
|
registerEmbedCommand,
|
|
840
|
+
registerInboxCommand,
|
|
632
841
|
registerInjectCommand,
|
|
842
|
+
registerMaintainCommand,
|
|
843
|
+
registerMemorySlot,
|
|
633
844
|
registerMigrateCommand,
|
|
634
845
|
registerMigrateObservationsCommand,
|
|
635
846
|
registerObserveCommand,
|
|
@@ -652,8 +863,10 @@ export {
|
|
|
652
863
|
resolveLlmProvider,
|
|
653
864
|
resolvePeerIP,
|
|
654
865
|
resolveVaultPath,
|
|
866
|
+
runObserverBenchmark,
|
|
655
867
|
runPromptInjection,
|
|
656
868
|
runReflection,
|
|
869
|
+
scoreFixtureObservations,
|
|
657
870
|
semanticSearch,
|
|
658
871
|
serveVault,
|
|
659
872
|
sessionRecapCommand,
|
|
@@ -663,6 +876,7 @@ export {
|
|
|
663
876
|
syncBdCommand,
|
|
664
877
|
syncKanbanBoard,
|
|
665
878
|
syncWithPeer,
|
|
879
|
+
synthesizeEntityProfiles,
|
|
666
880
|
tailscaleDiscoverCommand,
|
|
667
881
|
tailscaleServeCommand,
|
|
668
882
|
tailscaleStatusCommand,
|
|
@@ -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