clawvault 3.0.0 → 3.1.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 (60) hide show
  1. package/README.md +156 -105
  2. package/bin/clawvault.js +0 -2
  3. package/bin/register-core-commands.js +20 -2
  4. package/dist/{chunk-3D6BCTP6.js → chunk-33UGEQRT.js} +70 -145
  5. package/dist/{chunk-ZVVFWOLW.js → chunk-3WRJEKN4.js} +1 -1
  6. package/dist/{chunk-DEFFDRVP.js → chunk-3ZIH425O.js} +3 -70
  7. package/dist/{chunk-K234IDRJ.js → chunk-D2H45LON.js} +1 -0
  8. package/dist/{chunk-YKTA5JOJ.js → chunk-H62BP7RI.js} +3 -3
  9. package/dist/{chunk-WGRQ6HDV.js → chunk-LI4O6NVK.js} +1 -1
  10. package/dist/{chunk-7R7O6STJ.js → chunk-OCGVIN3L.js} +1 -1
  11. package/dist/{chunk-GAJV4IGR.js → chunk-YCUNCH2I.js} +3 -7
  12. package/dist/cli/index.cjs +10 -1459
  13. package/dist/cli/index.js +5 -8
  14. package/dist/commands/compat.cjs +70 -145
  15. package/dist/commands/compat.js +1 -1
  16. package/dist/commands/context.cjs +1 -0
  17. package/dist/commands/context.js +3 -3
  18. package/dist/commands/doctor.cjs +68 -144
  19. package/dist/commands/doctor.js +4 -4
  20. package/dist/commands/embed.js +2 -2
  21. package/dist/commands/setup.cjs +2 -69
  22. package/dist/commands/setup.d.cts +0 -1
  23. package/dist/commands/setup.d.ts +0 -1
  24. package/dist/commands/setup.js +2 -2
  25. package/dist/commands/sleep.cjs +1 -0
  26. package/dist/commands/sleep.js +2 -2
  27. package/dist/commands/status.cjs +1 -0
  28. package/dist/commands/status.js +2 -2
  29. package/dist/commands/wake.cjs +1 -0
  30. package/dist/commands/wake.js +2 -2
  31. package/dist/index.cjs +447 -2600
  32. package/dist/index.d.cts +0 -4
  33. package/dist/index.d.ts +0 -4
  34. package/dist/index.js +8 -69
  35. package/dist/plugin/index.cjs +3 -3
  36. package/dist/plugin/index.js +10 -10
  37. package/package.json +11 -17
  38. package/bin/register-tailscale-commands.js +0 -106
  39. package/dist/chunk-IVRIKYFE.js +0 -520
  40. package/dist/chunk-THRJVD4L.js +0 -373
  41. package/dist/chunk-TIGW564L.js +0 -628
  42. package/dist/commands/tailscale.cjs +0 -1532
  43. package/dist/commands/tailscale.d.cts +0 -52
  44. package/dist/commands/tailscale.d.ts +0 -52
  45. package/dist/commands/tailscale.js +0 -26
  46. package/dist/lib/canvas-layout.cjs +0 -136
  47. package/dist/lib/canvas-layout.d.cts +0 -31
  48. package/dist/lib/canvas-layout.d.ts +0 -31
  49. package/dist/lib/canvas-layout.js +0 -92
  50. package/dist/lib/tailscale.cjs +0 -1183
  51. package/dist/lib/tailscale.d.cts +0 -225
  52. package/dist/lib/tailscale.d.ts +0 -225
  53. package/dist/lib/tailscale.js +0 -50
  54. package/dist/lib/webdav.cjs +0 -568
  55. package/dist/lib/webdav.d.cts +0 -109
  56. package/dist/lib/webdav.d.ts +0 -109
  57. package/dist/lib/webdav.js +0 -35
  58. package/hooks/clawvault/HOOK.md +0 -83
  59. package/hooks/clawvault/handler.js +0 -879
  60. package/hooks/clawvault/handler.test.js +0 -354
@@ -1,109 +0,0 @@
1
- import * as fs from 'fs';
2
- import { IncomingMessage, ServerResponse } from 'http';
3
-
4
- /**
5
- * WebDAV Handler for ClawVault
6
- *
7
- * Implements WebDAV protocol support for Obsidian mobile sync via Remotely Save plugin.
8
- * Uses only Node built-in modules (http, fs, path) - zero external dependencies.
9
- *
10
- * Supported methods:
11
- * - GET: Serve file contents
12
- * - PUT: Write/create file (creates parent dirs if needed)
13
- * - DELETE: Delete file or directory
14
- * - MKCOL: Create directory
15
- * - PROPFIND: List directory contents or file properties (XML response)
16
- * - OPTIONS: Return allowed methods + DAV header
17
- * - HEAD: File metadata without body
18
- * - MOVE: Rename/move file (uses Destination header)
19
- * - COPY: Copy file
20
- */
21
-
22
- interface WebDAVConfig {
23
- /** Root path for WebDAV files (vault path) */
24
- rootPath: string;
25
- /** URL prefix for WebDAV routes (default: /webdav) */
26
- prefix?: string;
27
- /** Optional Basic Auth credentials */
28
- auth?: {
29
- username: string;
30
- password: string;
31
- };
32
- }
33
- interface WebDAVRequest {
34
- method: string;
35
- path: string;
36
- headers: Record<string, string | string[] | undefined>;
37
- body?: string;
38
- }
39
- interface WebDAVResponse {
40
- status: number;
41
- headers: Record<string, string>;
42
- body?: string;
43
- }
44
- declare const WEBDAV_PREFIX = "/webdav";
45
- /**
46
- * Check if a path is safe (no traversal attacks, not blocked)
47
- */
48
- declare function isPathSafe(requestPath: string, rootPath: string): boolean;
49
- /**
50
- * Resolve a WebDAV path to filesystem path
51
- */
52
- declare function resolveWebDAVPath(requestPath: string, rootPath: string): string | null;
53
- /**
54
- * Check Basic Auth credentials
55
- */
56
- declare function checkAuth(req: IncomingMessage, auth?: {
57
- username: string;
58
- password: string;
59
- }): boolean;
60
- /**
61
- * Generate full PROPFIND response XML
62
- */
63
- declare function generatePropfindResponse(entries: Array<{
64
- href: string;
65
- stats: fs.Stats | null;
66
- isCollection: boolean;
67
- }>): string;
68
- /**
69
- * Handle OPTIONS request
70
- */
71
- declare function handleOptions(res: ServerResponse, prefix: string): void;
72
- /**
73
- * Handle HEAD request
74
- */
75
- declare function handleHead(res: ServerResponse, filePath: string): void;
76
- /**
77
- * Handle GET request
78
- */
79
- declare function handleGet(res: ServerResponse, filePath: string): void;
80
- /**
81
- * Handle PUT request
82
- */
83
- declare function handlePut(res: ServerResponse, filePath: string, body: Buffer): void;
84
- /**
85
- * Handle DELETE request
86
- */
87
- declare function handleDelete(res: ServerResponse, filePath: string): void;
88
- /**
89
- * Handle MKCOL request (create directory)
90
- */
91
- declare function handleMkcol(res: ServerResponse, filePath: string): void;
92
- /**
93
- * Handle PROPFIND request
94
- */
95
- declare function handlePropfind(res: ServerResponse, filePath: string, webdavPath: string, prefix: string, depth: string): void;
96
- /**
97
- * Handle MOVE request
98
- */
99
- declare function handleMove(res: ServerResponse, sourcePath: string, destinationPath: string | null, overwrite: boolean): void;
100
- /**
101
- * Handle COPY request
102
- */
103
- declare function handleCopy(res: ServerResponse, sourcePath: string, destinationPath: string | null, overwrite: boolean): void;
104
- /**
105
- * Create WebDAV request handler
106
- */
107
- declare function createWebDAVHandler(config: WebDAVConfig): (req: IncomingMessage, res: ServerResponse) => Promise<boolean>;
108
-
109
- export { WEBDAV_PREFIX, type WebDAVConfig, type WebDAVRequest, type WebDAVResponse, checkAuth, createWebDAVHandler, generatePropfindResponse, handleCopy, handleDelete, handleGet, handleHead, handleMkcol, handleMove, handleOptions, handlePropfind, handlePut, isPathSafe, resolveWebDAVPath };
@@ -1,35 +0,0 @@
1
- import {
2
- WEBDAV_PREFIX,
3
- checkAuth,
4
- createWebDAVHandler,
5
- generatePropfindResponse,
6
- handleCopy,
7
- handleDelete,
8
- handleGet,
9
- handleHead,
10
- handleMkcol,
11
- handleMove,
12
- handleOptions,
13
- handlePropfind,
14
- handlePut,
15
- isPathSafe,
16
- resolveWebDAVPath
17
- } from "../chunk-IVRIKYFE.js";
18
- import "../chunk-3RG5ZIWI.js";
19
- export {
20
- WEBDAV_PREFIX,
21
- checkAuth,
22
- createWebDAVHandler,
23
- generatePropfindResponse,
24
- handleCopy,
25
- handleDelete,
26
- handleGet,
27
- handleHead,
28
- handleMkcol,
29
- handleMove,
30
- handleOptions,
31
- handlePropfind,
32
- handlePut,
33
- isPathSafe,
34
- resolveWebDAVPath
35
- };
@@ -1,83 +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 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`.