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.
- package/README.md +159 -200
- package/bin/clawvault.js +111 -111
- package/bin/command-registration.test.js +166 -166
- package/bin/command-runtime.js +93 -93
- package/bin/command-runtime.test.js +154 -154
- package/bin/help-contract.test.js +39 -39
- package/bin/register-config-commands.js +153 -153
- package/bin/register-config-route-commands.test.js +121 -121
- package/bin/register-core-commands.js +237 -237
- package/bin/register-kanban-commands.js +56 -56
- package/bin/register-kanban-commands.test.js +83 -83
- package/bin/register-maintenance-commands.js +282 -282
- package/bin/register-project-commands.js +209 -209
- package/bin/register-project-commands.test.js +206 -206
- package/bin/register-query-commands.js +317 -317
- package/bin/register-query-commands.test.js +65 -65
- package/bin/register-resilience-commands.js +182 -182
- package/bin/register-resilience-commands.test.js +81 -81
- package/bin/register-route-commands.js +114 -114
- package/bin/register-session-lifecycle-commands.js +206 -206
- package/bin/register-tailscale-commands.js +106 -106
- package/bin/register-task-commands.js +348 -348
- package/bin/register-task-commands.test.js +69 -69
- package/bin/register-template-commands.js +72 -72
- package/bin/register-vault-operations-commands.js +300 -300
- package/bin/test-helpers/cli-command-fixtures.js +119 -119
- package/dashboard/lib/graph-diff.js +104 -104
- package/dashboard/lib/graph-diff.test.js +75 -75
- package/dashboard/lib/vault-parser.js +556 -556
- package/dashboard/lib/vault-parser.test.js +254 -254
- package/dashboard/public/app.js +796 -796
- package/dashboard/public/index.html +52 -52
- package/dashboard/public/styles.css +221 -221
- package/dashboard/server.js +374 -374
- package/dist/{chunk-HWUNREDJ.js → chunk-FG6RJMCN.js} +1 -1
- package/dist/{chunk-HRTPQQF2.js → chunk-IZEY5S74.js} +1 -1
- package/dist/{chunk-BHO7WSAY.js → chunk-LMEMZGUV.js} +1 -1
- package/dist/{chunk-PLZKZW4I.js → chunk-OSMS7QIG.js} +1 -1
- package/dist/cli/index.js +3 -3
- package/dist/commands/doctor.js +2 -2
- package/dist/commands/observe.js +2 -2
- package/dist/commands/status.js +1 -1
- package/dist/index.js +4 -4
- package/hooks/clawvault/HOOK.md +83 -74
- package/hooks/clawvault/handler.js +816 -816
- package/hooks/clawvault/handler.test.js +263 -263
- package/package.json +94 -125
- package/templates/checkpoint.md +19 -19
- package/templates/daily-note.md +19 -19
- package/templates/daily.md +19 -19
- package/templates/decision.md +17 -17
- package/templates/handoff.md +19 -19
- package/templates/lesson.md +16 -16
- package/templates/person.md +19 -19
- package/templates/project.md +23 -23
|
@@ -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 = "
|
|
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";
|
package/dist/cli/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerCliCommands
|
|
3
|
-
} from "../chunk-
|
|
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-
|
|
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-
|
|
12
|
+
import "../chunk-IZEY5S74.js";
|
|
13
13
|
import "../chunk-HRLWZGMA.js";
|
|
14
14
|
import "../chunk-S2IG7VNM.js";
|
|
15
15
|
import "../chunk-5GZFTAL7.js";
|
package/dist/commands/doctor.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
doctor
|
|
3
|
-
} from "../chunk-
|
|
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-
|
|
7
|
+
import "../chunk-IZEY5S74.js";
|
|
8
8
|
import "../chunk-HRLWZGMA.js";
|
|
9
9
|
import "../chunk-S2IG7VNM.js";
|
|
10
10
|
import "../chunk-5GZFTAL7.js";
|
package/dist/commands/observe.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
observeCommand,
|
|
3
3
|
registerObserveCommand
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-OSMS7QIG.js";
|
|
5
5
|
import "../chunk-P5EPF6MB.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-IZEY5S74.js";
|
|
7
7
|
import "../chunk-HRLWZGMA.js";
|
|
8
8
|
import "../chunk-S2IG7VNM.js";
|
|
9
9
|
import "../chunk-5GZFTAL7.js";
|
package/dist/commands/status.js
CHANGED
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-
|
|
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-
|
|
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-
|
|
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-
|
|
115
|
+
} from "./chunk-IZEY5S74.js";
|
|
116
116
|
import "./chunk-HRLWZGMA.js";
|
|
117
117
|
import {
|
|
118
118
|
Compressor,
|
package/hooks/clawvault/HOOK.md
CHANGED
|
@@ -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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
3.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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`.
|