clawvault 3.4.0 → 3.5.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +543 -0
  2. package/LICENSE +21 -0
  3. package/README.md +26 -26
  4. package/SKILL.md +369 -0
  5. package/dist/{chunk-X3SPPUFG.js → chunk-JI7VUQV7.js} +118 -132
  6. package/dist/{chunk-QYQAGBTM.js → chunk-QUFQBAHP.js} +148 -125
  7. package/dist/cli/index.js +1 -1
  8. package/dist/commands/compat.js +1 -1
  9. package/dist/commands/observe.js +1 -1
  10. package/dist/commands/status.js +4 -4
  11. package/dist/index.js +11 -8
  12. package/dist/openclaw-plugin.js +6 -1
  13. package/docs/clawhub-security-release-playbook.md +75 -0
  14. package/docs/getting-started/installation.md +99 -0
  15. package/docs/openclaw-plugin-usage.md +152 -0
  16. package/openclaw.plugin.json +1 -1
  17. package/package.json +26 -8
  18. package/bin/command-registration.test.js +0 -179
  19. package/bin/command-runtime.test.js +0 -154
  20. package/bin/help-contract.test.js +0 -55
  21. package/bin/register-config-route-commands.test.js +0 -121
  22. package/bin/register-core-commands.test.js +0 -80
  23. package/bin/register-kanban-commands.test.js +0 -83
  24. package/bin/register-project-commands.test.js +0 -206
  25. package/bin/register-query-commands.test.js +0 -80
  26. package/bin/register-resilience-commands.test.js +0 -81
  27. package/bin/register-task-commands.test.js +0 -69
  28. package/bin/register-template-commands.test.js +0 -87
  29. package/bin/test-helpers/cli-command-fixtures.js +0 -120
  30. package/dashboard/lib/graph-diff.test.js +0 -75
  31. package/dashboard/lib/vault-parser.test.js +0 -254
  32. package/hooks/clawvault/HOOK.md +0 -130
  33. package/hooks/clawvault/handler.js +0 -1696
  34. package/hooks/clawvault/handler.test.js +0 -576
  35. package/hooks/clawvault/integrity.js +0 -112
  36. package/hooks/clawvault/integrity.test.js +0 -32
  37. package/hooks/clawvault/openclaw.plugin.json +0 -190
@@ -1,130 +0,0 @@
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
77
-
78
- ### Plugin Configuration (Recommended)
79
-
80
- Configure the plugin via OpenClaw's config system:
81
-
82
- ```bash
83
- # Set vault path
84
- openclaw config set plugins.entries.clawvault.config.vaultPath ~/my-vault
85
-
86
- # View current config
87
- openclaw config get plugins.entries.clawvault
88
- ```
89
-
90
- Available configuration options (all privileged actions are opt-in):
91
-
92
- | Key | Type | Default | Description |
93
- |-----|------|---------|-------------|
94
- | `vaultPath` | string | (auto-detected) | Path to the ClawVault vault directory |
95
- | `agentVaults` | object | `{}` | Per-agent vault mapping |
96
- | `allowClawvaultExec` | boolean | `false` | Required gate for all `child_process` calls |
97
- | `clawvaultBinaryPath` | string | (PATH lookup) | Optional absolute path to `clawvault` binary |
98
- | `clawvaultBinarySha256` | string | (unset) | Optional SHA-256 executable integrity check |
99
- | `allowEnvAccess` | boolean | `false` | Allow env fallbacks (`OPENCLAW_*`, `CLAWVAULT_PATH`) |
100
- | `enableStartupRecovery` | boolean | `false` | Enable `gateway:startup` recovery check |
101
- | `enableSessionContextInjection` | boolean | `false` | Enable `session:start` recap/context injection |
102
- | `enableAutoCheckpoint` | boolean | `false` | Enable checkpoint on `command:new` |
103
- | `enableObserveOnNew` | boolean | `false` | Enable observer flush on `command:new` |
104
- | `enableHeartbeatObservation` | boolean | `false` | Enable heartbeat-driven observation |
105
- | `enableCompactionObservation` | boolean | `false` | Enable observer flush on compaction |
106
- | `enableWeeklyReflection` | boolean | `false` | Enable weekly reflection cron |
107
- | `enableFactExtraction` | boolean | `false` | Enable local fact extraction/entity graph updates |
108
- | `autoCheckpoint` | boolean | `false` | Deprecated alias for `enableAutoCheckpoint` |
109
- | `contextProfile` | string | `"auto"` | Default context profile (`default`, `planning`, `incident`, `handoff`, `auto`) |
110
- | `maxContextResults` | integer | `4` | Maximum context results to inject on session start |
111
- | `observeOnHeartbeat` | boolean | `false` | Deprecated alias for `enableHeartbeatObservation` |
112
- | `weeklyReflection` | boolean | `false` | Deprecated alias for `enableWeeklyReflection` |
113
-
114
- Security details and threat model: see [SECURITY.md](../../SECURITY.md).
115
-
116
- ### Vault Path Resolution
117
-
118
- When `allowEnvAccess=true`, the hook resolves the vault path in this order:
119
-
120
- 1. Plugin config (`plugins.entries.clawvault.config.vaultPath` set via `openclaw config`)
121
- 2. `OPENCLAW_PLUGIN_CLAWVAULT_VAULTPATH` environment variable
122
- 3. `CLAWVAULT_PATH` environment variable
123
- 4. Walking up from cwd to find `.clawvault.json`
124
- 5. Checking `memory/` subdirectory (OpenClaw convention)
125
-
126
- When `allowEnvAccess=false` (default), steps 2 and 3 are skipped.
127
-
128
- ### Troubleshooting
129
-
130
- If `openclaw hooks enable clawvault` fails with hook-not-found, run `openclaw hooks install clawvault` first and verify discovery with `openclaw hooks list --verbose`.