clawvault 2.5.1 → 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 (88) hide show
  1. package/README.md +159 -199
  2. package/bin/clawvault.js +111 -111
  3. package/bin/command-registration.test.js +166 -165
  4. package/bin/command-runtime.js +93 -77
  5. package/bin/command-runtime.test.js +154 -102
  6. package/bin/help-contract.test.js +39 -28
  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 -248
  13. package/bin/register-project-commands.js +209 -209
  14. package/bin/register-project-commands.test.js +206 -201
  15. package/bin/register-query-commands.js +317 -312
  16. package/bin/register-query-commands.test.js +65 -0
  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-G3OQJ2NQ.js → chunk-2YDBJS7M.js} +1 -1
  36. package/dist/chunk-3FP5BJ42.js +88 -0
  37. package/dist/{chunk-C3PF7WBA.js → chunk-4IV3R2F5.js} +2 -2
  38. package/dist/{chunk-7OHQFMJK.js → chunk-AY4PGUVL.js} +5 -4
  39. package/dist/chunk-FG6RJMCN.js +33 -0
  40. package/dist/{chunk-WIICLBNF.js → chunk-GFJ3LIIB.js} +1 -1
  41. package/dist/chunk-IZEY5S74.js +541 -0
  42. package/dist/chunk-LMEMZGUV.js +332 -0
  43. package/dist/{chunk-6RQPD7X6.js → chunk-M25QVSJM.js} +4 -3
  44. package/dist/{chunk-6B3JWM7J.js → chunk-O7XHXF7F.js} +34 -7
  45. package/dist/chunk-OSMS7QIG.js +406 -0
  46. package/dist/{chunk-PAYUH64O.js → chunk-QVMXF7FY.js} +11 -1
  47. package/dist/{chunk-TMZMN7OS.js → chunk-S2IG7VNM.js} +24 -12
  48. package/dist/{chunk-LMCC5OC7.js → chunk-TPDH3JPP.js} +1 -1
  49. package/dist/cli/index.d.ts +5 -0
  50. package/dist/cli/index.js +31 -0
  51. package/dist/commands/canvas.js +3 -3
  52. package/dist/commands/compat.js +1 -1
  53. package/dist/commands/context.js +4 -4
  54. package/dist/commands/doctor.js +16 -309
  55. package/dist/commands/embed.d.ts +17 -0
  56. package/dist/commands/embed.js +10 -0
  57. package/dist/commands/migrate-observations.js +2 -2
  58. package/dist/commands/observe.d.ts +1 -0
  59. package/dist/commands/observe.js +7 -6
  60. package/dist/commands/rebuild.js +5 -5
  61. package/dist/commands/reflect.js +3 -3
  62. package/dist/commands/replay.js +7 -7
  63. package/dist/commands/setup.d.ts +1 -0
  64. package/dist/commands/setup.js +2 -2
  65. package/dist/commands/sleep.d.ts +2 -1
  66. package/dist/commands/sleep.js +15 -15
  67. package/dist/commands/status.d.ts +9 -1
  68. package/dist/commands/status.js +33 -8
  69. package/dist/commands/wake.d.ts +1 -1
  70. package/dist/commands/wake.js +6 -6
  71. package/dist/index.d.ts +82 -5
  72. package/dist/index.js +127 -105
  73. package/dist/{types-jjuYN2Xn.d.ts → types-C74wgGL1.d.ts} +2 -0
  74. package/hooks/clawvault/HOOK.md +83 -74
  75. package/hooks/clawvault/handler.js +816 -812
  76. package/hooks/clawvault/handler.test.js +263 -263
  77. package/package.json +94 -125
  78. package/templates/checkpoint.md +19 -19
  79. package/templates/daily-note.md +19 -19
  80. package/templates/daily.md +19 -19
  81. package/templates/decision.md +17 -17
  82. package/templates/handoff.md +19 -19
  83. package/templates/lesson.md +16 -16
  84. package/templates/person.md +19 -19
  85. package/templates/project.md +23 -23
  86. package/dist/chunk-2RK2AG32.js +0 -743
  87. package/dist/{chunk-FW465EEA.js → chunk-VXEOHTSL.js} +3 -3
  88. package/dist/{chunk-KCCHROBR.js → chunk-YOSEUUNB.js} +4 -4
@@ -1,201 +1,206 @@
1
- import { beforeEach, describe, expect, it, vi } from 'vitest';
2
- import { Command } from 'commander';
3
- import { registerProjectCommands } from './register-project-commands.js';
4
- import { chalkStub } from './test-helpers/cli-command-fixtures.js';
5
-
6
- const { projectCommandMock } = vi.hoisted(() => ({
7
- projectCommandMock: vi.fn()
8
- }));
9
-
10
- vi.mock('../dist/commands/project.js', () => ({
11
- projectCommand: projectCommandMock
12
- }));
13
-
14
- function buildProgram() {
15
- const program = new Command();
16
- registerProjectCommands(program, {
17
- chalk: chalkStub,
18
- resolveVaultPath: (value) => value ?? '/vault'
19
- });
20
- return program;
21
- }
22
-
23
- async function runCommand(args) {
24
- const program = buildProgram();
25
- await program.parseAsync(args, { from: 'user' });
26
- }
27
-
28
- describe('register-project-commands', () => {
29
- beforeEach(() => {
30
- vi.clearAllMocks();
31
- });
32
-
33
- it('registers add/update/archive/list/show/tasks/board subcommands', () => {
34
- const program = buildProgram();
35
- const projectCommand = program.commands.find((command) => command.name() === 'project');
36
- expect(projectCommand).toBeDefined();
37
-
38
- const subcommandNames = projectCommand?.commands.map((command) => command.name()) ?? [];
39
- expect(subcommandNames).toEqual(expect.arrayContaining([
40
- 'add',
41
- 'update',
42
- 'archive',
43
- 'list',
44
- 'show',
45
- 'tasks',
46
- 'board'
47
- ]));
48
-
49
- const addCommand = projectCommand?.commands.find((command) => command.name() === 'add');
50
- const addFlags = addCommand?.options.map((option) => option.flags) ?? [];
51
- expect(addFlags).toEqual(expect.arrayContaining([
52
- '--owner <owner>',
53
- '--status <status>',
54
- '--team <team>',
55
- '--client <client>',
56
- '--tags <tags>',
57
- '--description <description>',
58
- '--deadline <date>',
59
- '--repo <url>',
60
- '--url <url>'
61
- ]));
62
-
63
- const listCommand = projectCommand?.commands.find((command) => command.name() === 'list');
64
- const listFlags = listCommand?.options.map((option) => option.flags) ?? [];
65
- expect(listFlags).toEqual(expect.arrayContaining([
66
- '--status <status>',
67
- '--owner <owner>',
68
- '--client <client>',
69
- '--tag <tag>',
70
- '--json'
71
- ]));
72
-
73
- const boardCommand = projectCommand?.commands.find((command) => command.name() === 'board');
74
- const boardFlags = boardCommand?.options.map((option) => option.flags) ?? [];
75
- expect(boardFlags).toEqual(expect.arrayContaining([
76
- '--output <path>',
77
- '--group-by <field>'
78
- ]));
79
- });
80
-
81
- it('dispatches project subcommands to project command handler', async () => {
82
- await runCommand([
83
- 'project',
84
- 'add',
85
- 'Apollo Launch',
86
- '--owner',
87
- 'alice',
88
- '--status',
89
- 'active',
90
- '--team',
91
- 'alice,bob',
92
- '--client',
93
- 'Acme',
94
- '--tags',
95
- 'platform,release',
96
- '--description',
97
- 'Launch project',
98
- '--deadline',
99
- '2026-03-01',
100
- '--repo',
101
- 'https://github.com/acme/apollo',
102
- '--url',
103
- 'https://apollo.acme.dev'
104
- ]);
105
- expect(projectCommandMock).toHaveBeenCalledWith('/vault', 'add', {
106
- title: 'Apollo Launch',
107
- options: {
108
- owner: 'alice',
109
- status: 'active',
110
- team: ['alice', 'bob'],
111
- client: 'Acme',
112
- tags: ['platform', 'release'],
113
- description: 'Launch project',
114
- deadline: '2026-03-01',
115
- repo: 'https://github.com/acme/apollo',
116
- url: 'https://apollo.acme.dev'
117
- }
118
- });
119
-
120
- await runCommand([
121
- 'project',
122
- 'update',
123
- 'apollo-launch',
124
- '--status',
125
- 'paused',
126
- '--owner',
127
- 'carol',
128
- '--team',
129
- 'carol,dave',
130
- '--client',
131
- 'Acme',
132
- '--tags',
133
- 'ops',
134
- '--description',
135
- 'Paused pending review',
136
- '--deadline',
137
- '2026-03-10',
138
- '--repo',
139
- 'https://github.com/acme/apollo-v2',
140
- '--url',
141
- 'https://staging.acme.dev'
142
- ]);
143
- expect(projectCommandMock).toHaveBeenCalledWith('/vault', 'update', {
144
- slug: 'apollo-launch',
145
- options: {
146
- status: 'paused',
147
- owner: 'carol',
148
- team: ['carol', 'dave'],
149
- client: 'Acme',
150
- tags: ['ops'],
151
- description: 'Paused pending review',
152
- deadline: '2026-03-10',
153
- repo: 'https://github.com/acme/apollo-v2',
154
- url: 'https://staging.acme.dev'
155
- }
156
- });
157
-
158
- await runCommand(['project', 'archive', 'apollo-launch', '--reason', 'Client offboarded']);
159
- expect(projectCommandMock).toHaveBeenCalledWith('/vault', 'archive', {
160
- slug: 'apollo-launch',
161
- options: {
162
- reason: 'Client offboarded'
163
- }
164
- });
165
-
166
- await runCommand(['project', 'list', '--status', 'active', '--owner', 'alice', '--client', 'Acme', '--tag', 'platform', '--json']);
167
- expect(projectCommandMock).toHaveBeenCalledWith('/vault', 'list', {
168
- options: {
169
- status: 'active',
170
- owner: 'alice',
171
- client: 'Acme',
172
- tag: 'platform',
173
- json: true
174
- }
175
- });
176
-
177
- await runCommand(['project', 'show', 'apollo-launch']);
178
- expect(projectCommandMock).toHaveBeenCalledWith('/vault', 'show', {
179
- slug: 'apollo-launch',
180
- options: {
181
- json: undefined
182
- }
183
- });
184
-
185
- await runCommand(['project', 'tasks', 'apollo-launch', '--json']);
186
- expect(projectCommandMock).toHaveBeenCalledWith('/vault', 'tasks', {
187
- slug: 'apollo-launch',
188
- options: {
189
- json: true
190
- }
191
- });
192
-
193
- await runCommand(['project', 'board', '--output', 'Projects-Board.md', '--group-by', 'client']);
194
- expect(projectCommandMock).toHaveBeenCalledWith('/vault', 'board', {
195
- options: {
196
- output: 'Projects-Board.md',
197
- groupBy: 'client'
198
- }
199
- });
200
- });
201
- });
1
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
2
+ import { Command } from 'commander';
3
+ import { registerProjectCommands } from './register-project-commands.js';
4
+ import { chalkStub } from './test-helpers/cli-command-fixtures.js';
5
+
6
+ const { projectCommandMock } = vi.hoisted(() => ({
7
+ projectCommandMock: vi.fn()
8
+ }));
9
+
10
+ vi.mock('../dist/commands/project.js', () => ({
11
+ projectCommand: projectCommandMock
12
+ }));
13
+
14
+ function buildProgram() {
15
+ const program = new Command();
16
+ registerProjectCommands(program, {
17
+ chalk: chalkStub,
18
+ resolveVaultPath: (value) => value ?? '/vault'
19
+ });
20
+ return program;
21
+ }
22
+
23
+ async function runCommand(args) {
24
+ const program = buildProgram();
25
+ await program.parseAsync(args, { from: 'user' });
26
+ }
27
+
28
+ describe('register-project-commands', () => {
29
+ beforeEach(() => {
30
+ vi.clearAllMocks();
31
+ });
32
+
33
+ it('registers add/update/archive/list/show/tasks/board subcommands', () => {
34
+ const program = buildProgram();
35
+ const projectCommand = program.commands.find((command) => command.name() === 'project');
36
+ expect(projectCommand).toBeDefined();
37
+
38
+ const subcommandNames = projectCommand?.commands.map((command) => command.name()) ?? [];
39
+ expect(subcommandNames).toEqual(expect.arrayContaining([
40
+ 'add',
41
+ 'update',
42
+ 'archive',
43
+ 'list',
44
+ 'show',
45
+ 'tasks',
46
+ 'board'
47
+ ]));
48
+
49
+ const addCommand = projectCommand?.commands.find((command) => command.name() === 'add');
50
+ const addFlags = addCommand?.options.map((option) => option.flags) ?? [];
51
+ expect(addFlags).toEqual(expect.arrayContaining([
52
+ '--owner <owner>',
53
+ '--status <status>',
54
+ '--team <team>',
55
+ '--client <client>',
56
+ '--tags <tags>',
57
+ '--description <description>',
58
+ '--deadline <date>',
59
+ '--repo <url>',
60
+ '--url <url>'
61
+ ]));
62
+
63
+ const listCommand = projectCommand?.commands.find((command) => command.name() === 'list');
64
+ const listFlags = listCommand?.options.map((option) => option.flags) ?? [];
65
+ expect(listFlags).toEqual(expect.arrayContaining([
66
+ '--status <status>',
67
+ '--owner <owner>',
68
+ '--client <client>',
69
+ '--tag <tag>',
70
+ '--json'
71
+ ]));
72
+
73
+ const boardCommand = projectCommand?.commands.find((command) => command.name() === 'board');
74
+ const boardFlags = boardCommand?.options.map((option) => option.flags) ?? [];
75
+ expect(boardFlags).toEqual(expect.arrayContaining([
76
+ '--output <path>',
77
+ '--group-by <field>'
78
+ ]));
79
+
80
+ expect(listCommand?.description()).toContain('archived projects are hidden');
81
+
82
+ const boardGroupByOption = boardCommand?.options.find((option) => option.flags === '--group-by <field>');
83
+ expect(boardGroupByOption?.description).toContain('default: status');
84
+ });
85
+
86
+ it('dispatches project subcommands to project command handler', async () => {
87
+ await runCommand([
88
+ 'project',
89
+ 'add',
90
+ 'Apollo Launch',
91
+ '--owner',
92
+ 'alice',
93
+ '--status',
94
+ 'active',
95
+ '--team',
96
+ 'alice,bob',
97
+ '--client',
98
+ 'Acme',
99
+ '--tags',
100
+ 'platform,release',
101
+ '--description',
102
+ 'Launch project',
103
+ '--deadline',
104
+ '2026-03-01',
105
+ '--repo',
106
+ 'https://github.com/acme/apollo',
107
+ '--url',
108
+ 'https://apollo.acme.dev'
109
+ ]);
110
+ expect(projectCommandMock).toHaveBeenCalledWith('/vault', 'add', {
111
+ title: 'Apollo Launch',
112
+ options: {
113
+ owner: 'alice',
114
+ status: 'active',
115
+ team: ['alice', 'bob'],
116
+ client: 'Acme',
117
+ tags: ['platform', 'release'],
118
+ description: 'Launch project',
119
+ deadline: '2026-03-01',
120
+ repo: 'https://github.com/acme/apollo',
121
+ url: 'https://apollo.acme.dev'
122
+ }
123
+ });
124
+
125
+ await runCommand([
126
+ 'project',
127
+ 'update',
128
+ 'apollo-launch',
129
+ '--status',
130
+ 'paused',
131
+ '--owner',
132
+ 'carol',
133
+ '--team',
134
+ 'carol,dave',
135
+ '--client',
136
+ 'Acme',
137
+ '--tags',
138
+ 'ops',
139
+ '--description',
140
+ 'Paused pending review',
141
+ '--deadline',
142
+ '2026-03-10',
143
+ '--repo',
144
+ 'https://github.com/acme/apollo-v2',
145
+ '--url',
146
+ 'https://staging.acme.dev'
147
+ ]);
148
+ expect(projectCommandMock).toHaveBeenCalledWith('/vault', 'update', {
149
+ slug: 'apollo-launch',
150
+ options: {
151
+ status: 'paused',
152
+ owner: 'carol',
153
+ team: ['carol', 'dave'],
154
+ client: 'Acme',
155
+ tags: ['ops'],
156
+ description: 'Paused pending review',
157
+ deadline: '2026-03-10',
158
+ repo: 'https://github.com/acme/apollo-v2',
159
+ url: 'https://staging.acme.dev'
160
+ }
161
+ });
162
+
163
+ await runCommand(['project', 'archive', 'apollo-launch', '--reason', 'Client offboarded']);
164
+ expect(projectCommandMock).toHaveBeenCalledWith('/vault', 'archive', {
165
+ slug: 'apollo-launch',
166
+ options: {
167
+ reason: 'Client offboarded'
168
+ }
169
+ });
170
+
171
+ await runCommand(['project', 'list', '--status', 'active', '--owner', 'alice', '--client', 'Acme', '--tag', 'platform', '--json']);
172
+ expect(projectCommandMock).toHaveBeenCalledWith('/vault', 'list', {
173
+ options: {
174
+ status: 'active',
175
+ owner: 'alice',
176
+ client: 'Acme',
177
+ tag: 'platform',
178
+ json: true
179
+ }
180
+ });
181
+
182
+ await runCommand(['project', 'show', 'apollo-launch']);
183
+ expect(projectCommandMock).toHaveBeenCalledWith('/vault', 'show', {
184
+ slug: 'apollo-launch',
185
+ options: {
186
+ json: undefined
187
+ }
188
+ });
189
+
190
+ await runCommand(['project', 'tasks', 'apollo-launch', '--json']);
191
+ expect(projectCommandMock).toHaveBeenCalledWith('/vault', 'tasks', {
192
+ slug: 'apollo-launch',
193
+ options: {
194
+ json: true
195
+ }
196
+ });
197
+
198
+ await runCommand(['project', 'board', '--output', 'Projects-Board.md', '--group-by', 'client']);
199
+ expect(projectCommandMock).toHaveBeenCalledWith('/vault', 'board', {
200
+ options: {
201
+ output: 'Projects-Board.md',
202
+ groupBy: 'client'
203
+ }
204
+ });
205
+ });
206
+ });