clawvault 2.6.1 → 2.6.4
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 +352 -20
- package/bin/clawvault.js +8 -2
- package/bin/command-runtime.js +9 -1
- package/bin/register-maintenance-commands.js +19 -0
- package/bin/register-query-commands.js +58 -6
- package/bin/register-workgraph-commands.js +451 -0
- package/dist/{chunk-VXEOHTSL.js → chunk-2JQ3O2YL.js} +1 -1
- package/dist/{chunk-VR5NE7PZ.js → chunk-2RAZ4ZFE.js} +1 -1
- package/dist/chunk-2ZDO52B4.js +52 -0
- package/dist/chunk-4BQTQMJP.js +93 -0
- package/dist/{chunk-MAKNAHAW.js → chunk-5PJ4STIC.js} +98 -8
- package/dist/{chunk-IEVLHNLU.js → chunk-627Q3QWK.js} +3 -3
- package/dist/{chunk-R6SXNSFD.js → chunk-6NYYDNNG.js} +3 -3
- package/dist/chunk-ECRZL5XR.js +50 -0
- package/dist/chunk-GNJL4YGR.js +79 -0
- package/dist/{chunk-OZ7RIXTO.js → chunk-IIOU45CK.js} +1 -1
- package/dist/chunk-L4HSSQ6T.js +152 -0
- package/dist/{chunk-XAVB4GB4.js → chunk-LIGHWOH6.js} +1 -1
- package/dist/{chunk-PBEE567J.js → chunk-LUBZXECN.js} +2 -2
- package/dist/{chunk-UEOUADMO.js → chunk-MFL6EEPF.js} +204 -35
- package/dist/chunk-MM6QGW3P.js +207 -0
- package/dist/{chunk-T76H47ZS.js → chunk-MNPUYCHQ.js} +1 -1
- package/dist/{chunk-TLGBDTYT.js → chunk-MPOSMDMU.js} +6 -6
- package/dist/{chunk-RVYA52PY.js → chunk-NJYJL5AA.js} +1 -1
- package/dist/{chunk-Q2J5YTUF.js → chunk-OQGYFZ4A.js} +669 -33
- package/dist/{chunk-ME37YNW3.js → chunk-P7SY3D4E.js} +3 -3
- package/dist/chunk-RHISK3SZ.js +189 -0
- package/dist/{chunk-3BTHWPMB.js → chunk-S5OJEGFG.js} +2 -2
- package/dist/{chunk-MGDEINGP.js → chunk-SS4B7P7V.js} +1 -1
- package/dist/chunk-U4O6C46S.js +154 -0
- package/dist/{chunk-ITPEXLHA.js → chunk-URXDAUVH.js} +24 -5
- package/dist/chunk-WIOLLGAD.js +190 -0
- package/dist/chunk-WMGIIABP.js +15 -0
- package/dist/{chunk-QVMXF7FY.js → chunk-X3SPPUFG.js} +50 -0
- package/dist/{chunk-THRJVD4L.js → chunk-Y6VJKXGL.js} +1 -1
- package/dist/{chunk-KL4NAOMO.js → chunk-YDWHS4LJ.js} +49 -9
- package/dist/{chunk-4VRIMU4O.js → chunk-YNIPYN4F.js} +4 -4
- package/dist/{chunk-HIHOUSXS.js → chunk-YXQCA6B7.js} +105 -1
- package/dist/cli/index.js +18 -16
- package/dist/commands/archive.js +3 -2
- package/dist/commands/backlog.js +1 -0
- package/dist/commands/blocked.js +1 -0
- package/dist/commands/canvas.js +1 -0
- package/dist/commands/checkpoint.js +1 -0
- package/dist/commands/compat.js +2 -1
- package/dist/commands/context.js +5 -3
- package/dist/commands/doctor.d.ts +10 -1
- package/dist/commands/doctor.js +11 -8
- package/dist/commands/embed.js +5 -3
- package/dist/commands/entities.js +2 -1
- package/dist/commands/graph.js +3 -2
- package/dist/commands/inject.d.ts +1 -1
- package/dist/commands/inject.js +4 -3
- package/dist/commands/kanban.js +1 -0
- package/dist/commands/link.js +2 -1
- package/dist/commands/migrate-observations.js +3 -2
- package/dist/commands/observe.js +8 -6
- package/dist/commands/project.js +1 -0
- package/dist/commands/rebuild-embeddings.d.ts +21 -0
- package/dist/commands/rebuild-embeddings.js +91 -0
- package/dist/commands/rebuild.js +6 -4
- package/dist/commands/recover.js +1 -0
- package/dist/commands/reflect.js +5 -4
- package/dist/commands/repair-session.js +1 -0
- package/dist/commands/replay.js +7 -6
- package/dist/commands/session-recap.js +1 -0
- package/dist/commands/setup.js +3 -2
- package/dist/commands/shell-init.js +2 -0
- package/dist/commands/sleep.d.ts +1 -1
- package/dist/commands/sleep.js +8 -6
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.js +35 -24
- package/dist/commands/sync-bd.js +3 -2
- package/dist/commands/tailscale.js +3 -2
- package/dist/commands/task.js +1 -0
- package/dist/commands/template.js +1 -0
- package/dist/commands/wake.d.ts +1 -1
- package/dist/commands/wake.js +4 -2
- package/dist/index.d.ts +333 -10
- package/dist/index.js +320 -33
- package/dist/{inject-x65KXWPk.d.ts → inject-DYUrDqQO.d.ts} +2 -2
- package/dist/ledger-B7g7jhqG.d.ts +44 -0
- package/dist/lib/auto-linker.js +1 -0
- package/dist/lib/canvas-layout.js +1 -0
- package/dist/lib/config.d.ts +27 -3
- package/dist/lib/config.js +4 -1
- package/dist/lib/entity-index.js +1 -0
- package/dist/lib/project-utils.js +1 -0
- package/dist/lib/session-repair.js +1 -0
- package/dist/lib/session-utils.js +1 -0
- package/dist/lib/tailscale.js +1 -0
- package/dist/lib/task-utils.js +1 -0
- package/dist/lib/template-engine.js +1 -0
- package/dist/lib/webdav.js +1 -0
- 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/registry-BR4326o0.d.ts +30 -0
- package/dist/store-CA-6sKCJ.d.ts +34 -0
- package/dist/thread-B9LhXNU0.d.ts +41 -0
- package/dist/transformers.node-A2ZRORSQ.js +46775 -0
- package/dist/{types-C74wgGL1.d.ts → types-BbWJoC1c.d.ts} +1 -1
- package/dist/workgraph/index.d.ts +5 -0
- package/dist/workgraph/index.js +23 -0
- package/dist/workgraph/ledger.d.ts +2 -0
- package/dist/workgraph/ledger.js +25 -0
- package/dist/workgraph/registry.d.ts +2 -0
- package/dist/workgraph/registry.js +19 -0
- package/dist/workgraph/store.d.ts +2 -0
- package/dist/workgraph/store.js +25 -0
- package/dist/workgraph/thread.d.ts +2 -0
- package/dist/workgraph/thread.js +25 -0
- package/dist/workgraph/types.d.ts +54 -0
- package/dist/workgraph/types.js +7 -0
- package/hooks/clawvault/HOOK.md +34 -4
- package/hooks/clawvault/handler.js +751 -8
- package/hooks/clawvault/handler.test.js +247 -0
- package/hooks/clawvault/openclaw.plugin.json +72 -0
- package/openclaw.plugin.json +84 -0
- package/package.json +8 -4
- package/dist/chunk-4QYGFWRM.js +0 -88
- package/dist/chunk-MXSSG3QU.js +0 -42
|
@@ -260,4 +260,251 @@ describe('clawvault hook handler', () => {
|
|
|
260
260
|
|
|
261
261
|
fs.rmSync(vaultPath, { recursive: true, force: true });
|
|
262
262
|
});
|
|
263
|
+
|
|
264
|
+
it('uses vaultPath from plugin config when provided in event', async () => {
|
|
265
|
+
const vaultPath = makeVaultFixture();
|
|
266
|
+
|
|
267
|
+
execFileSyncMock.mockImplementation((_command, args) => {
|
|
268
|
+
if (args[0] === 'recover') {
|
|
269
|
+
return 'Clean startup';
|
|
270
|
+
}
|
|
271
|
+
return '';
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
const handler = await loadHandler();
|
|
275
|
+
const event = {
|
|
276
|
+
type: 'gateway',
|
|
277
|
+
action: 'startup',
|
|
278
|
+
pluginConfig: {
|
|
279
|
+
vaultPath
|
|
280
|
+
},
|
|
281
|
+
messages: []
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
await handler(event);
|
|
285
|
+
|
|
286
|
+
expect(execFileSyncMock).toHaveBeenCalledWith(
|
|
287
|
+
'clawvault',
|
|
288
|
+
expect.arrayContaining(['recover', '--clear', '-v', vaultPath]),
|
|
289
|
+
expect.objectContaining({ shell: false })
|
|
290
|
+
);
|
|
291
|
+
|
|
292
|
+
fs.rmSync(vaultPath, { recursive: true, force: true });
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
it('uses vaultPath from context.pluginConfig when provided', async () => {
|
|
296
|
+
const vaultPath = makeVaultFixture();
|
|
297
|
+
|
|
298
|
+
execFileSyncMock.mockImplementation((_command, args) => {
|
|
299
|
+
if (args[0] === 'recover') {
|
|
300
|
+
return 'Clean startup';
|
|
301
|
+
}
|
|
302
|
+
return '';
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
const handler = await loadHandler();
|
|
306
|
+
const event = {
|
|
307
|
+
type: 'gateway',
|
|
308
|
+
action: 'startup',
|
|
309
|
+
context: {
|
|
310
|
+
pluginConfig: {
|
|
311
|
+
vaultPath
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
messages: []
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
await handler(event);
|
|
318
|
+
|
|
319
|
+
expect(execFileSyncMock).toHaveBeenCalledWith(
|
|
320
|
+
'clawvault',
|
|
321
|
+
expect.arrayContaining(['recover', '--clear', '-v', vaultPath]),
|
|
322
|
+
expect.objectContaining({ shell: false })
|
|
323
|
+
);
|
|
324
|
+
|
|
325
|
+
fs.rmSync(vaultPath, { recursive: true, force: true });
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
it('uses vaultPath from OPENCLAW_PLUGIN_CLAWVAULT_VAULTPATH env var', async () => {
|
|
329
|
+
const vaultPath = makeVaultFixture();
|
|
330
|
+
process.env.OPENCLAW_PLUGIN_CLAWVAULT_VAULTPATH = vaultPath;
|
|
331
|
+
|
|
332
|
+
execFileSyncMock.mockImplementation((_command, args) => {
|
|
333
|
+
if (args[0] === 'recover') {
|
|
334
|
+
return 'Clean startup';
|
|
335
|
+
}
|
|
336
|
+
return '';
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
const handler = await loadHandler();
|
|
340
|
+
const event = {
|
|
341
|
+
type: 'gateway',
|
|
342
|
+
action: 'startup',
|
|
343
|
+
messages: []
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
await handler(event);
|
|
347
|
+
|
|
348
|
+
expect(execFileSyncMock).toHaveBeenCalledWith(
|
|
349
|
+
'clawvault',
|
|
350
|
+
expect.arrayContaining(['recover', '--clear', '-v', vaultPath]),
|
|
351
|
+
expect.objectContaining({ shell: false })
|
|
352
|
+
);
|
|
353
|
+
|
|
354
|
+
delete process.env.OPENCLAW_PLUGIN_CLAWVAULT_VAULTPATH;
|
|
355
|
+
fs.rmSync(vaultPath, { recursive: true, force: true });
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
it('uses per-agent vault path from agentVaults config', async () => {
|
|
359
|
+
const agent1Vault = makeVaultFixture();
|
|
360
|
+
const agent2Vault = makeVaultFixture();
|
|
361
|
+
const fallbackVault = makeVaultFixture();
|
|
362
|
+
|
|
363
|
+
execFileSyncMock.mockImplementation((_command, args) => {
|
|
364
|
+
if (args[0] === 'recover') {
|
|
365
|
+
return 'Clean startup';
|
|
366
|
+
}
|
|
367
|
+
return '';
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
const handler = await loadHandler();
|
|
371
|
+
const event = {
|
|
372
|
+
type: 'gateway',
|
|
373
|
+
action: 'startup',
|
|
374
|
+
sessionKey: 'agent:agent1:main',
|
|
375
|
+
pluginConfig: {
|
|
376
|
+
vaultPath: fallbackVault,
|
|
377
|
+
agentVaults: {
|
|
378
|
+
agent1: agent1Vault,
|
|
379
|
+
agent2: agent2Vault
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
messages: []
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
await handler(event);
|
|
386
|
+
|
|
387
|
+
expect(execFileSyncMock).toHaveBeenCalledWith(
|
|
388
|
+
'clawvault',
|
|
389
|
+
expect.arrayContaining(['recover', '--clear', '-v', agent1Vault]),
|
|
390
|
+
expect.objectContaining({ shell: false })
|
|
391
|
+
);
|
|
392
|
+
|
|
393
|
+
fs.rmSync(agent1Vault, { recursive: true, force: true });
|
|
394
|
+
fs.rmSync(agent2Vault, { recursive: true, force: true });
|
|
395
|
+
fs.rmSync(fallbackVault, { recursive: true, force: true });
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
it('falls back to vaultPath when agent not in agentVaults', async () => {
|
|
399
|
+
const agent1Vault = makeVaultFixture();
|
|
400
|
+
const fallbackVault = makeVaultFixture();
|
|
401
|
+
|
|
402
|
+
execFileSyncMock.mockImplementation((_command, args) => {
|
|
403
|
+
if (args[0] === 'recover') {
|
|
404
|
+
return 'Clean startup';
|
|
405
|
+
}
|
|
406
|
+
return '';
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
const handler = await loadHandler();
|
|
410
|
+
const event = {
|
|
411
|
+
type: 'gateway',
|
|
412
|
+
action: 'startup',
|
|
413
|
+
sessionKey: 'agent:unknown-agent:main',
|
|
414
|
+
pluginConfig: {
|
|
415
|
+
vaultPath: fallbackVault,
|
|
416
|
+
agentVaults: {
|
|
417
|
+
agent1: agent1Vault
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
messages: []
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
await handler(event);
|
|
424
|
+
|
|
425
|
+
expect(execFileSyncMock).toHaveBeenCalledWith(
|
|
426
|
+
'clawvault',
|
|
427
|
+
expect.arrayContaining(['recover', '--clear', '-v', fallbackVault]),
|
|
428
|
+
expect.objectContaining({ shell: false })
|
|
429
|
+
);
|
|
430
|
+
|
|
431
|
+
fs.rmSync(agent1Vault, { recursive: true, force: true });
|
|
432
|
+
fs.rmSync(fallbackVault, { recursive: true, force: true });
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
it('uses agentVaults from context.pluginConfig', async () => {
|
|
436
|
+
const agent1Vault = makeVaultFixture();
|
|
437
|
+
const fallbackVault = makeVaultFixture();
|
|
438
|
+
|
|
439
|
+
execFileSyncMock.mockImplementation((_command, args) => {
|
|
440
|
+
if (args[0] === 'recover') {
|
|
441
|
+
return 'Clean startup';
|
|
442
|
+
}
|
|
443
|
+
return '';
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
const handler = await loadHandler();
|
|
447
|
+
const event = {
|
|
448
|
+
type: 'gateway',
|
|
449
|
+
action: 'startup',
|
|
450
|
+
sessionKey: 'agent:agent1:main',
|
|
451
|
+
context: {
|
|
452
|
+
pluginConfig: {
|
|
453
|
+
vaultPath: fallbackVault,
|
|
454
|
+
agentVaults: {
|
|
455
|
+
agent1: agent1Vault
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
messages: []
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
await handler(event);
|
|
463
|
+
|
|
464
|
+
expect(execFileSyncMock).toHaveBeenCalledWith(
|
|
465
|
+
'clawvault',
|
|
466
|
+
expect.arrayContaining(['recover', '--clear', '-v', agent1Vault]),
|
|
467
|
+
expect.objectContaining({ shell: false })
|
|
468
|
+
);
|
|
469
|
+
|
|
470
|
+
fs.rmSync(agent1Vault, { recursive: true, force: true });
|
|
471
|
+
fs.rmSync(fallbackVault, { recursive: true, force: true });
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
it('uses OPENCLAW_AGENT_ID env var for agent resolution when session key not available', async () => {
|
|
475
|
+
const agent1Vault = makeVaultFixture();
|
|
476
|
+
const fallbackVault = makeVaultFixture();
|
|
477
|
+
process.env.OPENCLAW_AGENT_ID = 'agent1';
|
|
478
|
+
|
|
479
|
+
execFileSyncMock.mockImplementation((_command, args) => {
|
|
480
|
+
if (args[0] === 'recover') {
|
|
481
|
+
return 'Clean startup';
|
|
482
|
+
}
|
|
483
|
+
return '';
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
const handler = await loadHandler();
|
|
487
|
+
const event = {
|
|
488
|
+
type: 'gateway',
|
|
489
|
+
action: 'startup',
|
|
490
|
+
pluginConfig: {
|
|
491
|
+
vaultPath: fallbackVault,
|
|
492
|
+
agentVaults: {
|
|
493
|
+
agent1: agent1Vault
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
messages: []
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
await handler(event);
|
|
500
|
+
|
|
501
|
+
expect(execFileSyncMock).toHaveBeenCalledWith(
|
|
502
|
+
'clawvault',
|
|
503
|
+
expect.arrayContaining(['recover', '--clear', '-v', agent1Vault]),
|
|
504
|
+
expect.objectContaining({ shell: false })
|
|
505
|
+
);
|
|
506
|
+
|
|
507
|
+
fs.rmSync(agent1Vault, { recursive: true, force: true });
|
|
508
|
+
fs.rmSync(fallbackVault, { recursive: true, force: true });
|
|
509
|
+
});
|
|
263
510
|
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "clawvault",
|
|
3
|
+
"name": "ClawVault",
|
|
4
|
+
"version": "2.6.1",
|
|
5
|
+
"description": "Structured memory system for AI agents with context death resilience",
|
|
6
|
+
"kind": "memory",
|
|
7
|
+
"configSchema": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"vaultPath": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "Path to the ClawVault vault directory. If not set, auto-discovered from CLAWVAULT_PATH or by walking up from cwd."
|
|
13
|
+
},
|
|
14
|
+
"autoCheckpoint": {
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"description": "Enable automatic checkpointing on session events",
|
|
17
|
+
"default": true
|
|
18
|
+
},
|
|
19
|
+
"contextProfile": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": ["default", "planning", "incident", "handoff", "auto"],
|
|
22
|
+
"description": "Default context profile for session start injection",
|
|
23
|
+
"default": "auto"
|
|
24
|
+
},
|
|
25
|
+
"maxContextResults": {
|
|
26
|
+
"type": "integer",
|
|
27
|
+
"minimum": 1,
|
|
28
|
+
"maximum": 20,
|
|
29
|
+
"description": "Maximum number of context results to inject on session start",
|
|
30
|
+
"default": 4
|
|
31
|
+
},
|
|
32
|
+
"observeOnHeartbeat": {
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"description": "Enable observation threshold checks on gateway heartbeat",
|
|
35
|
+
"default": true
|
|
36
|
+
},
|
|
37
|
+
"weeklyReflection": {
|
|
38
|
+
"type": "boolean",
|
|
39
|
+
"description": "Enable weekly reflection on Sunday midnight UTC",
|
|
40
|
+
"default": true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"additionalProperties": false
|
|
44
|
+
},
|
|
45
|
+
"uiHints": {
|
|
46
|
+
"vaultPath": {
|
|
47
|
+
"label": "Vault Path",
|
|
48
|
+
"placeholder": "~/my-vault",
|
|
49
|
+
"description": "Path to your ClawVault memory vault"
|
|
50
|
+
},
|
|
51
|
+
"autoCheckpoint": {
|
|
52
|
+
"label": "Auto Checkpoint",
|
|
53
|
+
"description": "Automatically checkpoint before session resets"
|
|
54
|
+
},
|
|
55
|
+
"contextProfile": {
|
|
56
|
+
"label": "Context Profile",
|
|
57
|
+
"description": "Profile used for context injection at session start"
|
|
58
|
+
},
|
|
59
|
+
"maxContextResults": {
|
|
60
|
+
"label": "Max Context Results",
|
|
61
|
+
"description": "Number of vault memories to inject"
|
|
62
|
+
},
|
|
63
|
+
"observeOnHeartbeat": {
|
|
64
|
+
"label": "Observe on Heartbeat",
|
|
65
|
+
"description": "Check observation thresholds during heartbeat events"
|
|
66
|
+
},
|
|
67
|
+
"weeklyReflection": {
|
|
68
|
+
"label": "Weekly Reflection",
|
|
69
|
+
"description": "Run weekly reflection on Sunday midnight UTC"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "clawvault",
|
|
3
|
+
"name": "ClawVault",
|
|
4
|
+
"version": "2.6.1",
|
|
5
|
+
"description": "Structured memory system for AI agents with context death resilience",
|
|
6
|
+
"kind": "memory",
|
|
7
|
+
"configSchema": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"vaultPath": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "Path to the ClawVault vault directory. If not set, auto-discovered from CLAWVAULT_PATH or by walking up from cwd. Used as fallback when agentVaults is not set or agent not found."
|
|
13
|
+
},
|
|
14
|
+
"agentVaults": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"description": "Mapping of agent names to vault paths. Allows each agent to have its own vault. Falls back to vaultPath if agent not found.",
|
|
17
|
+
"additionalProperties": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Path to the vault directory for this agent"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"autoCheckpoint": {
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"description": "Enable automatic checkpointing on session events",
|
|
25
|
+
"default": true
|
|
26
|
+
},
|
|
27
|
+
"contextProfile": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"enum": ["default", "planning", "incident", "handoff", "auto"],
|
|
30
|
+
"description": "Default context profile for session start injection",
|
|
31
|
+
"default": "auto"
|
|
32
|
+
},
|
|
33
|
+
"maxContextResults": {
|
|
34
|
+
"type": "integer",
|
|
35
|
+
"minimum": 1,
|
|
36
|
+
"maximum": 20,
|
|
37
|
+
"description": "Maximum number of context results to inject on session start",
|
|
38
|
+
"default": 4
|
|
39
|
+
},
|
|
40
|
+
"observeOnHeartbeat": {
|
|
41
|
+
"type": "boolean",
|
|
42
|
+
"description": "Enable observation threshold checks on gateway heartbeat",
|
|
43
|
+
"default": true
|
|
44
|
+
},
|
|
45
|
+
"weeklyReflection": {
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"description": "Enable weekly reflection on Sunday midnight UTC",
|
|
48
|
+
"default": true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"additionalProperties": false
|
|
52
|
+
},
|
|
53
|
+
"uiHints": {
|
|
54
|
+
"vaultPath": {
|
|
55
|
+
"label": "Vault Path",
|
|
56
|
+
"placeholder": "~/my-vault",
|
|
57
|
+
"description": "Path to your ClawVault memory vault (fallback when agentVaults not set)"
|
|
58
|
+
},
|
|
59
|
+
"agentVaults": {
|
|
60
|
+
"label": "Agent Vaults",
|
|
61
|
+
"description": "Per-agent vault paths (e.g., {\"agent1\": \"/path/to/vault1\", \"agent2\": \"/path/to/vault2\"})"
|
|
62
|
+
},
|
|
63
|
+
"autoCheckpoint": {
|
|
64
|
+
"label": "Auto Checkpoint",
|
|
65
|
+
"description": "Automatically checkpoint before session resets"
|
|
66
|
+
},
|
|
67
|
+
"contextProfile": {
|
|
68
|
+
"label": "Context Profile",
|
|
69
|
+
"description": "Profile used for context injection at session start"
|
|
70
|
+
},
|
|
71
|
+
"maxContextResults": {
|
|
72
|
+
"label": "Max Context Results",
|
|
73
|
+
"description": "Number of vault memories to inject"
|
|
74
|
+
},
|
|
75
|
+
"observeOnHeartbeat": {
|
|
76
|
+
"label": "Observe on Heartbeat",
|
|
77
|
+
"description": "Check observation thresholds during heartbeat events"
|
|
78
|
+
},
|
|
79
|
+
"weeklyReflection": {
|
|
80
|
+
"label": "Weekly Reflection",
|
|
81
|
+
"description": "Run weekly reflection on Sunday midnight UTC"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawvault",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.4",
|
|
4
4
|
"description": "Structured memory system for AI agents — typed storage, knowledge graph, context profiles, canvas dashboards, neural graph themes, and Obsidian-native task views. An elephant never forgets. 🐘",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -21,15 +21,17 @@
|
|
|
21
21
|
"bin",
|
|
22
22
|
"dashboard",
|
|
23
23
|
"templates",
|
|
24
|
-
"hooks"
|
|
24
|
+
"hooks",
|
|
25
|
+
"openclaw.plugin.json"
|
|
25
26
|
],
|
|
26
27
|
"openclaw": {
|
|
28
|
+
"plugin": "./openclaw.plugin.json",
|
|
27
29
|
"hooks": [
|
|
28
30
|
"./hooks/clawvault"
|
|
29
31
|
]
|
|
30
32
|
},
|
|
31
33
|
"scripts": {
|
|
32
|
-
"build": "tsup src/commands/archive.ts src/commands/backlog.ts src/commands/blocked.ts src/commands/canvas.ts src/commands/checkpoint.ts src/commands/compat.ts src/commands/context.ts src/commands/doctor.ts src/commands/embed.ts src/commands/entities.ts src/commands/graph.ts src/commands/inject.ts src/commands/kanban.ts src/commands/link.ts src/commands/migrate-observations.ts src/commands/observe.ts src/commands/project.ts src/commands/rebuild.ts src/commands/recover.ts src/commands/reflect.ts src/commands/repair-session.ts src/commands/replay.ts src/commands/session-recap.ts src/commands/setup.ts src/commands/shell-init.ts src/commands/sleep.ts src/commands/status.ts src/commands/sync-bd.ts src/commands/tailscale.ts src/commands/task.ts src/commands/template.ts src/commands/wake.ts src/cli/index.ts src/index.ts src/lib/auto-linker.ts src/lib/canvas-layout.ts src/lib/config.ts src/lib/entity-index.ts src/lib/project-utils.ts src/lib/session-repair.ts src/lib/session-utils.ts src/lib/tailscale.ts src/lib/task-utils.ts src/lib/template-engine.ts src/lib/webdav.ts --format esm --dts --clean",
|
|
34
|
+
"build": "tsup src/commands/archive.ts src/commands/backlog.ts src/commands/blocked.ts src/commands/canvas.ts src/commands/checkpoint.ts src/commands/compat.ts src/commands/context.ts src/commands/doctor.ts src/commands/embed.ts src/commands/entities.ts src/commands/graph.ts src/commands/inject.ts src/commands/kanban.ts src/commands/link.ts src/commands/migrate-observations.ts src/commands/observe.ts src/commands/project.ts src/commands/rebuild.ts src/commands/rebuild-embeddings.ts src/commands/recover.ts src/commands/reflect.ts src/commands/repair-session.ts src/commands/replay.ts src/commands/session-recap.ts src/commands/setup.ts src/commands/shell-init.ts src/commands/sleep.ts src/commands/status.ts src/commands/sync-bd.ts src/commands/tailscale.ts src/commands/task.ts src/commands/template.ts src/commands/wake.ts src/cli/index.ts src/index.ts src/lib/auto-linker.ts src/lib/canvas-layout.ts src/lib/config.ts src/lib/entity-index.ts src/lib/project-utils.ts src/lib/session-repair.ts src/lib/session-utils.ts src/lib/tailscale.ts src/lib/task-utils.ts src/lib/template-engine.ts src/lib/webdav.ts src/workgraph/index.ts src/workgraph/types.ts src/workgraph/registry.ts src/workgraph/ledger.ts src/workgraph/store.ts src/workgraph/thread.ts --format esm --dts --clean",
|
|
33
35
|
"dev": "tsup src/index.ts src/commands/*.ts src/lib/*.ts --format esm --dts --watch",
|
|
34
36
|
"lint": "eslint src",
|
|
35
37
|
"typecheck": "tsc --noEmit",
|
|
@@ -73,7 +75,8 @@
|
|
|
73
75
|
"glob": "^10.3.10",
|
|
74
76
|
"gray-matter": "^4.0.3",
|
|
75
77
|
"natural": "^6.10.4",
|
|
76
|
-
"ws": "^8.19.0"
|
|
78
|
+
"ws": "^8.19.0",
|
|
79
|
+
"yaml": "^2.8.2"
|
|
77
80
|
},
|
|
78
81
|
"peerDependencies": {
|
|
79
82
|
"qmd": "*"
|
|
@@ -84,6 +87,7 @@
|
|
|
84
87
|
}
|
|
85
88
|
},
|
|
86
89
|
"devDependencies": {
|
|
90
|
+
"@huggingface/transformers": "^3.8.1",
|
|
87
91
|
"@types/node": "^20.11.0",
|
|
88
92
|
"ajv": "^8.17.1",
|
|
89
93
|
"puppeteer": "^24.37.2",
|
package/dist/chunk-4QYGFWRM.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
QmdUnavailableError,
|
|
3
|
-
hasQmd,
|
|
4
|
-
qmdEmbed
|
|
5
|
-
} from "./chunk-MAKNAHAW.js";
|
|
6
|
-
import {
|
|
7
|
-
resolveVaultPath
|
|
8
|
-
} from "./chunk-MXSSG3QU.js";
|
|
9
|
-
|
|
10
|
-
// src/lib/vault-qmd-config.ts
|
|
11
|
-
import * as fs from "fs";
|
|
12
|
-
import * as path from "path";
|
|
13
|
-
var CONFIG_FILE = ".clawvault.json";
|
|
14
|
-
function readTrimmedString(value) {
|
|
15
|
-
if (typeof value !== "string") return void 0;
|
|
16
|
-
const trimmed = value.trim();
|
|
17
|
-
return trimmed.length > 0 ? trimmed : void 0;
|
|
18
|
-
}
|
|
19
|
-
function loadVaultQmdConfig(vaultPath) {
|
|
20
|
-
const resolvedVaultPath = path.resolve(vaultPath);
|
|
21
|
-
const fallbackName = path.basename(resolvedVaultPath);
|
|
22
|
-
const fallbackRoot = resolvedVaultPath;
|
|
23
|
-
const configPath = path.join(resolvedVaultPath, CONFIG_FILE);
|
|
24
|
-
if (!fs.existsSync(configPath)) {
|
|
25
|
-
return {
|
|
26
|
-
vaultPath: resolvedVaultPath,
|
|
27
|
-
qmdCollection: fallbackName,
|
|
28
|
-
qmdRoot: fallbackRoot
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
try {
|
|
32
|
-
const raw = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
33
|
-
const configuredName = readTrimmedString(raw.name) ?? fallbackName;
|
|
34
|
-
const qmdCollection = readTrimmedString(raw.qmdCollection) ?? configuredName;
|
|
35
|
-
const rawRoot = readTrimmedString(raw.qmdRoot) ?? fallbackRoot;
|
|
36
|
-
const qmdRoot = path.isAbsolute(rawRoot) ? path.resolve(rawRoot) : path.resolve(resolvedVaultPath, rawRoot);
|
|
37
|
-
return {
|
|
38
|
-
vaultPath: resolvedVaultPath,
|
|
39
|
-
qmdCollection,
|
|
40
|
-
qmdRoot
|
|
41
|
-
};
|
|
42
|
-
} catch {
|
|
43
|
-
return {
|
|
44
|
-
vaultPath: resolvedVaultPath,
|
|
45
|
-
qmdCollection: fallbackName,
|
|
46
|
-
qmdRoot: fallbackRoot
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// src/commands/embed.ts
|
|
52
|
-
async function embedCommand(options = {}) {
|
|
53
|
-
if (!hasQmd()) {
|
|
54
|
-
throw new QmdUnavailableError();
|
|
55
|
-
}
|
|
56
|
-
const vaultPath = resolveVaultPath({ explicitPath: options.vaultPath });
|
|
57
|
-
const qmdConfig = loadVaultQmdConfig(vaultPath);
|
|
58
|
-
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
59
|
-
if (!options.quiet) {
|
|
60
|
-
console.log(
|
|
61
|
-
`Embedding pending documents for collection "${qmdConfig.qmdCollection}" (root: ${qmdConfig.qmdRoot})...`
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
qmdEmbed(qmdConfig.qmdCollection);
|
|
65
|
-
const finishedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
66
|
-
if (!options.quiet) {
|
|
67
|
-
console.log(`\u2713 Embedding complete for "${qmdConfig.qmdCollection}"`);
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
vaultPath,
|
|
71
|
-
qmdCollection: qmdConfig.qmdCollection,
|
|
72
|
-
qmdRoot: qmdConfig.qmdRoot,
|
|
73
|
-
startedAt,
|
|
74
|
-
finishedAt
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
function registerEmbedCommand(program) {
|
|
78
|
-
program.command("embed").description("Run qmd embedding for pending vault documents").option("-v, --vault <path>", "Vault path").action(async (rawOptions) => {
|
|
79
|
-
await embedCommand({
|
|
80
|
-
vaultPath: rawOptions.vault
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export {
|
|
86
|
-
embedCommand,
|
|
87
|
-
registerEmbedCommand
|
|
88
|
-
};
|
package/dist/chunk-MXSSG3QU.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// src/lib/config.ts
|
|
2
|
-
import * as fs from "fs";
|
|
3
|
-
import * as path from "path";
|
|
4
|
-
function getVaultPath() {
|
|
5
|
-
const vaultPath = process.env.CLAWVAULT_PATH;
|
|
6
|
-
if (!vaultPath) {
|
|
7
|
-
throw new Error("CLAWVAULT_PATH environment variable not set");
|
|
8
|
-
}
|
|
9
|
-
return path.resolve(vaultPath);
|
|
10
|
-
}
|
|
11
|
-
function findNearestVaultPath(startPath = process.cwd()) {
|
|
12
|
-
let current = path.resolve(startPath);
|
|
13
|
-
while (true) {
|
|
14
|
-
if (fs.existsSync(path.join(current, ".clawvault.json"))) {
|
|
15
|
-
return current;
|
|
16
|
-
}
|
|
17
|
-
const parent = path.dirname(current);
|
|
18
|
-
if (parent === current) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
current = parent;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function resolveVaultPath(options = {}) {
|
|
25
|
-
if (options.explicitPath) {
|
|
26
|
-
return path.resolve(options.explicitPath);
|
|
27
|
-
}
|
|
28
|
-
if (process.env.CLAWVAULT_PATH) {
|
|
29
|
-
return path.resolve(process.env.CLAWVAULT_PATH);
|
|
30
|
-
}
|
|
31
|
-
const discovered = findNearestVaultPath(options.cwd ?? process.cwd());
|
|
32
|
-
if (discovered) {
|
|
33
|
-
return discovered;
|
|
34
|
-
}
|
|
35
|
-
throw new Error("No vault path found. Set CLAWVAULT_PATH, use --vault, or run inside a vault.");
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export {
|
|
39
|
-
getVaultPath,
|
|
40
|
-
findNearestVaultPath,
|
|
41
|
-
resolveVaultPath
|
|
42
|
-
};
|