clawvault 2.5.2 → 2.5.3

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 (55) hide show
  1. package/README.md +159 -200
  2. package/bin/clawvault.js +111 -111
  3. package/bin/command-registration.test.js +166 -166
  4. package/bin/command-runtime.js +93 -93
  5. package/bin/command-runtime.test.js +154 -154
  6. package/bin/help-contract.test.js +39 -39
  7. package/bin/register-config-commands.js +153 -153
  8. package/bin/register-config-route-commands.test.js +121 -121
  9. package/bin/register-core-commands.js +237 -237
  10. package/bin/register-kanban-commands.js +56 -56
  11. package/bin/register-kanban-commands.test.js +83 -83
  12. package/bin/register-maintenance-commands.js +282 -282
  13. package/bin/register-project-commands.js +209 -209
  14. package/bin/register-project-commands.test.js +206 -206
  15. package/bin/register-query-commands.js +317 -317
  16. package/bin/register-query-commands.test.js +65 -65
  17. package/bin/register-resilience-commands.js +182 -182
  18. package/bin/register-resilience-commands.test.js +81 -81
  19. package/bin/register-route-commands.js +114 -114
  20. package/bin/register-session-lifecycle-commands.js +206 -206
  21. package/bin/register-tailscale-commands.js +106 -106
  22. package/bin/register-task-commands.js +348 -348
  23. package/bin/register-task-commands.test.js +69 -69
  24. package/bin/register-template-commands.js +72 -72
  25. package/bin/register-vault-operations-commands.js +300 -300
  26. package/bin/test-helpers/cli-command-fixtures.js +119 -119
  27. package/dashboard/lib/graph-diff.js +104 -104
  28. package/dashboard/lib/graph-diff.test.js +75 -75
  29. package/dashboard/lib/vault-parser.js +556 -556
  30. package/dashboard/lib/vault-parser.test.js +254 -254
  31. package/dashboard/public/app.js +796 -796
  32. package/dashboard/public/index.html +52 -52
  33. package/dashboard/public/styles.css +221 -221
  34. package/dashboard/server.js +374 -374
  35. package/dist/{chunk-HWUNREDJ.js → chunk-FG6RJMCN.js} +1 -1
  36. package/dist/{chunk-HRTPQQF2.js → chunk-IZEY5S74.js} +1 -1
  37. package/dist/{chunk-BHO7WSAY.js → chunk-LMEMZGUV.js} +1 -1
  38. package/dist/{chunk-PLZKZW4I.js → chunk-OSMS7QIG.js} +1 -1
  39. package/dist/cli/index.js +3 -3
  40. package/dist/commands/doctor.js +2 -2
  41. package/dist/commands/observe.js +2 -2
  42. package/dist/commands/status.js +1 -1
  43. package/dist/index.js +4 -4
  44. package/hooks/clawvault/HOOK.md +83 -74
  45. package/hooks/clawvault/handler.js +816 -816
  46. package/hooks/clawvault/handler.test.js +263 -263
  47. package/package.json +94 -125
  48. package/templates/checkpoint.md +19 -19
  49. package/templates/daily-note.md +19 -19
  50. package/templates/daily.md +19 -19
  51. package/templates/decision.md +17 -17
  52. package/templates/handoff.md +19 -19
  53. package/templates/lesson.md +16 -16
  54. package/templates/person.md +19 -19
  55. package/templates/project.md +23 -23
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-NZ4ZZNSR.js";
4
4
  import {
5
5
  registerObserveCommand
6
- } from "./chunk-PLZKZW4I.js";
6
+ } from "./chunk-OSMS7QIG.js";
7
7
  import {
8
8
  registerReflectCommand
9
9
  } from "./chunk-2YDBJS7M.js";
@@ -13,7 +13,7 @@ var ONE_MIB = ONE_KIB * ONE_KIB;
13
13
  var SMALL_SESSION_THRESHOLD_BYTES = 50 * ONE_KIB;
14
14
  var MEDIUM_SESSION_THRESHOLD_BYTES = 150 * ONE_KIB;
15
15
  var LARGE_SESSION_THRESHOLD_BYTES = 300 * ONE_KIB;
16
- var DEFAULT_AGENT_ID = "clawdious";
16
+ var DEFAULT_AGENT_ID = "main";
17
17
  var AGENT_ID_RE = /^[a-zA-Z0-9_-]{1,100}$/;
18
18
  var SESSION_ID_RE = /^[a-zA-Z0-9._-]{1,200}$/;
19
19
  var CURSOR_FILE_NAME = "observe-cursors.json";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-4VQTUVH7.js";
7
7
  import {
8
8
  getObserverStaleness
9
- } from "./chunk-HRTPQQF2.js";
9
+ } from "./chunk-IZEY5S74.js";
10
10
  import {
11
11
  ClawVault,
12
12
  findVault
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-P5EPF6MB.js";
4
4
  import {
5
5
  observeActiveSessions
6
- } from "./chunk-HRTPQQF2.js";
6
+ } from "./chunk-IZEY5S74.js";
7
7
  import {
8
8
  Observer
9
9
  } from "./chunk-S2IG7VNM.js";
package/dist/cli/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  registerCliCommands
3
- } from "../chunk-HWUNREDJ.js";
3
+ } from "../chunk-FG6RJMCN.js";
4
4
  import "../chunk-NZ4ZZNSR.js";
5
5
  import "../chunk-4GBPTBFJ.js";
6
6
  import "../chunk-CLE2HHNT.js";
7
- import "../chunk-PLZKZW4I.js";
7
+ import "../chunk-OSMS7QIG.js";
8
8
  import "../chunk-P5EPF6MB.js";
9
9
  import "../chunk-2YDBJS7M.js";
10
10
  import "../chunk-YOSEUUNB.js";
11
11
  import "../chunk-GFJ3LIIB.js";
12
- import "../chunk-HRTPQQF2.js";
12
+ import "../chunk-IZEY5S74.js";
13
13
  import "../chunk-HRLWZGMA.js";
14
14
  import "../chunk-S2IG7VNM.js";
15
15
  import "../chunk-5GZFTAL7.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  doctor
3
- } from "../chunk-BHO7WSAY.js";
3
+ } from "../chunk-LMEMZGUV.js";
4
4
  import "../chunk-7ZRP733D.js";
5
5
  import "../chunk-4VQTUVH7.js";
6
6
  import "../chunk-J7ZWCI2C.js";
7
- import "../chunk-HRTPQQF2.js";
7
+ import "../chunk-IZEY5S74.js";
8
8
  import "../chunk-HRLWZGMA.js";
9
9
  import "../chunk-S2IG7VNM.js";
10
10
  import "../chunk-5GZFTAL7.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  observeCommand,
3
3
  registerObserveCommand
4
- } from "../chunk-PLZKZW4I.js";
4
+ } from "../chunk-OSMS7QIG.js";
5
5
  import "../chunk-P5EPF6MB.js";
6
- import "../chunk-HRTPQQF2.js";
6
+ import "../chunk-IZEY5S74.js";
7
7
  import "../chunk-HRLWZGMA.js";
8
8
  import "../chunk-S2IG7VNM.js";
9
9
  import "../chunk-5GZFTAL7.js";
@@ -7,7 +7,7 @@ import {
7
7
  import "../chunk-J7ZWCI2C.js";
8
8
  import {
9
9
  getObserverStaleness
10
- } from "../chunk-HRTPQQF2.js";
10
+ } from "../chunk-IZEY5S74.js";
11
11
  import "../chunk-HRLWZGMA.js";
12
12
  import "../chunk-S2IG7VNM.js";
13
13
  import "../chunk-5GZFTAL7.js";
package/dist/index.js CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-4IV3R2F5.js";
30
30
  import {
31
31
  doctor
32
- } from "./chunk-BHO7WSAY.js";
32
+ } from "./chunk-LMEMZGUV.js";
33
33
  import "./chunk-7ZRP733D.js";
34
34
  import {
35
35
  graphCommand,
@@ -49,7 +49,7 @@ import "./chunk-4VQTUVH7.js";
49
49
  import "./chunk-J7ZWCI2C.js";
50
50
  import {
51
51
  registerCliCommands
52
- } from "./chunk-HWUNREDJ.js";
52
+ } from "./chunk-FG6RJMCN.js";
53
53
  import {
54
54
  registerTailscaleCommands,
55
55
  registerTailscaleDiscoverCommand,
@@ -87,7 +87,7 @@ import {
87
87
  SessionWatcher,
88
88
  observeCommand,
89
89
  registerObserveCommand
90
- } from "./chunk-PLZKZW4I.js";
90
+ } from "./chunk-OSMS7QIG.js";
91
91
  import {
92
92
  parseSessionFile
93
93
  } from "./chunk-P5EPF6MB.js";
@@ -112,7 +112,7 @@ import {
112
112
  getScaledObservationThresholdBytes,
113
113
  observeActiveSessions,
114
114
  parseSessionSourceLabel
115
- } from "./chunk-HRTPQQF2.js";
115
+ } from "./chunk-IZEY5S74.js";
116
116
  import "./chunk-HRLWZGMA.js";
117
117
  import {
118
118
  Compressor,
@@ -1,74 +1,83 @@
1
- ---
2
- name: clawvault
3
- description: "Context resilience - recovery detection, auto-checkpoint, and session context injection"
4
- metadata:
5
- openclaw:
6
- emoji: "🐘"
7
- events: ["gateway:startup", "gateway:heartbeat", "command:new", "session:start", "compaction:memoryFlush", "cron.weekly"]
8
- requires:
9
- bins: ["clawvault"]
10
- ---
11
-
12
- # ClawVault Hook
13
-
14
- Integrates ClawVault's context death resilience into OpenClaw:
15
-
16
- - **On gateway startup**: Checks for context death, alerts agent
17
- - **On heartbeat**: Runs cheap threshold checks and observes active sessions when needed
18
- - **On /new command**: Auto-checkpoints before session reset
19
- - **On context compaction**: Forces incremental observation flush before context is lost
20
- - **On session start**: Injects relevant vault context for the initial prompt
21
- - **On weekly cron**: Runs `clawvault reflect` every Sunday midnight (UTC)
22
-
23
- ## Installation
24
-
25
- ```bash
26
- npm install -g clawvault
27
- openclaw hooks install clawvault
28
- openclaw hooks enable clawvault
29
- ```
30
-
31
- ## Requirements
32
-
33
- - ClawVault CLI installed globally
34
- - Vault initialized (`clawvault setup` or `CLAWVAULT_PATH` set)
35
-
36
- ## What It Does
37
-
38
- ### Gateway Startup
39
-
40
- 1. Runs `clawvault recover --clear`
41
- 2. If context death detected, injects warning into first agent turn
42
- 3. Clears dirty death flag for clean session start
43
-
44
- ### Command: /new
45
-
46
- 1. Creates automatic checkpoint with session info
47
- 2. Captures state even if agent forgot to handoff
48
- 3. Ensures continuity across session resets
49
-
50
- ### Session Start
51
-
52
- 1. Extracts the initial user prompt (`context.initialPrompt` or first user message)
53
- 2. Runs `clawvault context "<prompt>" --format json --profile auto -v <vaultPath>`
54
- - Delegates profile selection to the shared context intent policy (`incident`, `planning`, `handoff`, or `default`)
55
- 3. Injects up to 4 relevant context bullets into session messages
56
-
57
- Injection format:
58
-
59
- ```text
60
- [ClawVault] Relevant context for this task:
61
- - <title> (<age>): <snippet>
62
- - <title> (<age>): <snippet>
63
- ```
64
-
65
- ### Event Compatibility
66
-
67
- The hook accepts canonical OpenClaw events (`gateway:startup`, `gateway:heartbeat`, `command:new`, `session:start`, `compaction:memoryFlush`, `cron.weekly`) and tolerates alias payload shapes (`event`, `eventName`, `name`, `hook`, `trigger`) to remain robust across runtime wrappers.
68
-
69
- ## No Configuration Needed
70
-
71
- Just enable the hook. It auto-detects vault path via:
72
-
73
- 1. `CLAWVAULT_PATH` environment variable
74
- 2. Walking up from cwd to find `.clawvault.json`
1
+ ---
2
+ name: clawvault
3
+ description: "Context resilience - recovery detection, auto-checkpoint, and session context injection"
4
+ metadata:
5
+ openclaw:
6
+ emoji: "🐘"
7
+ events: ["gateway:startup", "gateway:heartbeat", "command:new", "session:start", "compaction:memoryFlush", "cron.weekly"]
8
+ requires:
9
+ bins: ["clawvault"]
10
+ ---
11
+
12
+ # ClawVault Hook
13
+
14
+ Integrates ClawVault's context death resilience into OpenClaw:
15
+
16
+ - **On gateway startup**: Checks for context death, alerts agent
17
+ - **On heartbeat**: Runs cheap threshold checks and observes active sessions when needed
18
+ - **On /new command**: Auto-checkpoints before session reset
19
+ - **On context compaction**: Forces incremental observation flush before context is lost
20
+ - **On session start**: Injects relevant vault context for the initial prompt
21
+ - **On weekly cron**: Runs `clawvault reflect` every Sunday midnight (UTC)
22
+
23
+ ## Installation
24
+
25
+ ```bash
26
+ npm install -g clawvault
27
+ openclaw hooks install clawvault
28
+ openclaw hooks enable clawvault
29
+
30
+ # Verify
31
+ openclaw hooks list --verbose
32
+ openclaw hooks info clawvault
33
+ openclaw hooks check
34
+ ```
35
+
36
+ After enabling, restart your OpenClaw gateway process so hook registration reloads.
37
+
38
+ ## Requirements
39
+
40
+ - ClawVault CLI installed globally
41
+ - Vault initialized (`clawvault setup` or `CLAWVAULT_PATH` set)
42
+
43
+ ## What It Does
44
+
45
+ ### Gateway Startup
46
+
47
+ 1. Runs `clawvault recover --clear`
48
+ 2. If context death detected, injects warning into first agent turn
49
+ 3. Clears dirty death flag for clean session start
50
+
51
+ ### Command: /new
52
+
53
+ 1. Creates automatic checkpoint with session info
54
+ 2. Captures state even if agent forgot to handoff
55
+ 3. Ensures continuity across session resets
56
+
57
+ ### Session Start
58
+
59
+ 1. Extracts the initial user prompt (`context.initialPrompt` or first user message)
60
+ 2. Runs `clawvault context "<prompt>" --format json --profile auto -v <vaultPath>`
61
+ - Delegates profile selection to the shared context intent policy (`incident`, `planning`, `handoff`, or `default`)
62
+ 3. Injects up to 4 relevant context bullets into session messages
63
+
64
+ Injection format:
65
+
66
+ ```text
67
+ [ClawVault] Relevant context for this task:
68
+ - <title> (<age>): <snippet>
69
+ - <title> (<age>): <snippet>
70
+ ```
71
+
72
+ ### Event Compatibility
73
+
74
+ The hook accepts canonical OpenClaw events (`gateway:startup`, `gateway:heartbeat`, `command:new`, `session:start`, `compaction:memoryFlush`, `cron.weekly`) and tolerates alias payload shapes (`event`, `eventName`, `name`, `hook`, `trigger`) to remain robust across runtime wrappers.
75
+
76
+ ## Configuration Notes
77
+
78
+ The hook auto-detects vault path via:
79
+
80
+ 1. `CLAWVAULT_PATH` environment variable
81
+ 2. Walking up from cwd to find `.clawvault.json`
82
+
83
+ If `openclaw hooks enable clawvault` fails with hook-not-found, run `openclaw hooks install clawvault` first and verify discovery with `openclaw hooks list --verbose`.