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
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { Command } from 'commander';
|
|
3
|
-
import { registerTaskCommands } from './register-task-commands.js';
|
|
4
|
-
import { chalkStub, stubResolveVaultPath } from './test-helpers/cli-command-fixtures.js';
|
|
5
|
-
|
|
6
|
-
describe('register-task-commands', () => {
|
|
7
|
-
it('adds enriched task add/list/update options', () => {
|
|
8
|
-
const program = new Command();
|
|
9
|
-
registerTaskCommands(program, {
|
|
10
|
-
chalk: chalkStub,
|
|
11
|
-
resolveVaultPath: stubResolveVaultPath
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const taskCommand = program.commands.find((command) => command.name() === 'task');
|
|
15
|
-
expect(taskCommand).toBeDefined();
|
|
16
|
-
|
|
17
|
-
const addCommand = taskCommand?.commands.find((command) => command.name() === 'add');
|
|
18
|
-
const addFlags = addCommand?.options.map((option) => option.flags) ?? [];
|
|
19
|
-
expect(addFlags).toEqual(expect.arrayContaining([
|
|
20
|
-
'--due <date>',
|
|
21
|
-
'--tags <tags>',
|
|
22
|
-
'--description <description>',
|
|
23
|
-
'--estimate <estimate>',
|
|
24
|
-
'--parent <slug>',
|
|
25
|
-
'--depends-on <slugs>'
|
|
26
|
-
]));
|
|
27
|
-
|
|
28
|
-
const listCommand = taskCommand?.commands.find((command) => command.name() === 'list');
|
|
29
|
-
const listFlags = listCommand?.options.map((option) => option.flags) ?? [];
|
|
30
|
-
expect(listFlags).toEqual(expect.arrayContaining([
|
|
31
|
-
'--due',
|
|
32
|
-
'--tag <tag>',
|
|
33
|
-
'--overdue'
|
|
34
|
-
]));
|
|
35
|
-
|
|
36
|
-
const updateCommand = taskCommand?.commands.find((command) => command.name() === 'update');
|
|
37
|
-
const updateFlags = updateCommand?.options.map((option) => option.flags) ?? [];
|
|
38
|
-
expect(updateFlags).toEqual(expect.arrayContaining([
|
|
39
|
-
'--tags <tags>',
|
|
40
|
-
'--description <description>',
|
|
41
|
-
'--estimate <estimate>',
|
|
42
|
-
'--parent <slug>',
|
|
43
|
-
'--depends-on <slugs>',
|
|
44
|
-
'--clear-due',
|
|
45
|
-
'--clear-tags',
|
|
46
|
-
'--clear-description',
|
|
47
|
-
'--clear-estimate',
|
|
48
|
-
'--clear-parent',
|
|
49
|
-
'--clear-depends-on'
|
|
50
|
-
]));
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('adds simplified canvas flags', () => {
|
|
54
|
-
const program = new Command();
|
|
55
|
-
registerTaskCommands(program, {
|
|
56
|
-
chalk: chalkStub,
|
|
57
|
-
resolveVaultPath: stubResolveVaultPath
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
const canvasCommand = program.commands.find((command) => command.name() === 'canvas');
|
|
61
|
-
expect(canvasCommand).toBeDefined();
|
|
62
|
-
|
|
63
|
-
const optionFlags = canvasCommand?.options.map((option) => option.flags) ?? [];
|
|
64
|
-
expect(optionFlags).toEqual(expect.arrayContaining([
|
|
65
|
-
'-v, --vault <path>',
|
|
66
|
-
'--output <path>'
|
|
67
|
-
]));
|
|
68
|
-
});
|
|
69
|
-
});
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { registerTaskCommands } from './register-task-commands.js';
|
|
4
|
+
import { chalkStub, stubResolveVaultPath } from './test-helpers/cli-command-fixtures.js';
|
|
5
|
+
|
|
6
|
+
describe('register-task-commands', () => {
|
|
7
|
+
it('adds enriched task add/list/update options', () => {
|
|
8
|
+
const program = new Command();
|
|
9
|
+
registerTaskCommands(program, {
|
|
10
|
+
chalk: chalkStub,
|
|
11
|
+
resolveVaultPath: stubResolveVaultPath
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const taskCommand = program.commands.find((command) => command.name() === 'task');
|
|
15
|
+
expect(taskCommand).toBeDefined();
|
|
16
|
+
|
|
17
|
+
const addCommand = taskCommand?.commands.find((command) => command.name() === 'add');
|
|
18
|
+
const addFlags = addCommand?.options.map((option) => option.flags) ?? [];
|
|
19
|
+
expect(addFlags).toEqual(expect.arrayContaining([
|
|
20
|
+
'--due <date>',
|
|
21
|
+
'--tags <tags>',
|
|
22
|
+
'--description <description>',
|
|
23
|
+
'--estimate <estimate>',
|
|
24
|
+
'--parent <slug>',
|
|
25
|
+
'--depends-on <slugs>'
|
|
26
|
+
]));
|
|
27
|
+
|
|
28
|
+
const listCommand = taskCommand?.commands.find((command) => command.name() === 'list');
|
|
29
|
+
const listFlags = listCommand?.options.map((option) => option.flags) ?? [];
|
|
30
|
+
expect(listFlags).toEqual(expect.arrayContaining([
|
|
31
|
+
'--due',
|
|
32
|
+
'--tag <tag>',
|
|
33
|
+
'--overdue'
|
|
34
|
+
]));
|
|
35
|
+
|
|
36
|
+
const updateCommand = taskCommand?.commands.find((command) => command.name() === 'update');
|
|
37
|
+
const updateFlags = updateCommand?.options.map((option) => option.flags) ?? [];
|
|
38
|
+
expect(updateFlags).toEqual(expect.arrayContaining([
|
|
39
|
+
'--tags <tags>',
|
|
40
|
+
'--description <description>',
|
|
41
|
+
'--estimate <estimate>',
|
|
42
|
+
'--parent <slug>',
|
|
43
|
+
'--depends-on <slugs>',
|
|
44
|
+
'--clear-due',
|
|
45
|
+
'--clear-tags',
|
|
46
|
+
'--clear-description',
|
|
47
|
+
'--clear-estimate',
|
|
48
|
+
'--clear-parent',
|
|
49
|
+
'--clear-depends-on'
|
|
50
|
+
]));
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('adds simplified canvas flags', () => {
|
|
54
|
+
const program = new Command();
|
|
55
|
+
registerTaskCommands(program, {
|
|
56
|
+
chalk: chalkStub,
|
|
57
|
+
resolveVaultPath: stubResolveVaultPath
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const canvasCommand = program.commands.find((command) => command.name() === 'canvas');
|
|
61
|
+
expect(canvasCommand).toBeDefined();
|
|
62
|
+
|
|
63
|
+
const optionFlags = canvasCommand?.options.map((option) => option.flags) ?? [];
|
|
64
|
+
expect(optionFlags).toEqual(expect.arrayContaining([
|
|
65
|
+
'-v, --vault <path>',
|
|
66
|
+
'--output <path>'
|
|
67
|
+
]));
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Template command registrations split from main CLI entrypoint.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export function registerTemplateCommands(program, { chalk }) {
|
|
6
|
-
const template = program
|
|
7
|
-
.command('template')
|
|
8
|
-
.description('Manage document templates');
|
|
9
|
-
|
|
10
|
-
template
|
|
11
|
-
.command('list')
|
|
12
|
-
.description('List available templates')
|
|
13
|
-
.option('-v, --vault <path>', 'Vault path')
|
|
14
|
-
.action(async (options) => {
|
|
15
|
-
try {
|
|
16
|
-
const { listTemplates } = await import('../dist/commands/template.js');
|
|
17
|
-
const templates = listTemplates({ vaultPath: options.vault });
|
|
18
|
-
if (templates.length === 0) {
|
|
19
|
-
console.log(chalk.yellow('No templates found.'));
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
console.log(chalk.cyan('\n📄 Templates:\n'));
|
|
23
|
-
for (const name of templates) {
|
|
24
|
-
console.log(`- ${name}`);
|
|
25
|
-
}
|
|
26
|
-
console.log();
|
|
27
|
-
} catch (err) {
|
|
28
|
-
console.error(chalk.red(`Error: ${err.message}`));
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
template
|
|
34
|
-
.command('create <name>')
|
|
35
|
-
.description('Create a file from a template')
|
|
36
|
-
.option('-t, --title <title>', 'Document title')
|
|
37
|
-
.option('-v, --vault <path>', 'Vault path')
|
|
38
|
-
.action(async (name, options) => {
|
|
39
|
-
try {
|
|
40
|
-
const { createFromTemplate } = await import('../dist/commands/template.js');
|
|
41
|
-
const result = createFromTemplate(name, {
|
|
42
|
-
title: options.title,
|
|
43
|
-
vaultPath: options.vault
|
|
44
|
-
});
|
|
45
|
-
console.log(chalk.green(`✓ Created from template: ${name}`));
|
|
46
|
-
console.log(chalk.dim(` Output: ${result.outputPath}`));
|
|
47
|
-
} catch (err) {
|
|
48
|
-
console.error(chalk.red(`Error: ${err.message}`));
|
|
49
|
-
process.exit(1);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
template
|
|
54
|
-
.command('add <file>')
|
|
55
|
-
.description('Add a custom template')
|
|
56
|
-
.requiredOption('--name <name>', 'Template name')
|
|
57
|
-
.option('-v, --vault <path>', 'Vault path')
|
|
58
|
-
.action(async (file, options) => {
|
|
59
|
-
try {
|
|
60
|
-
const { addTemplate } = await import('../dist/commands/template.js');
|
|
61
|
-
const result = addTemplate(file, {
|
|
62
|
-
name: options.name,
|
|
63
|
-
vaultPath: options.vault
|
|
64
|
-
});
|
|
65
|
-
console.log(chalk.green(`✓ Template added: ${result.name}`));
|
|
66
|
-
console.log(chalk.dim(` Path: ${result.templatePath}`));
|
|
67
|
-
} catch (err) {
|
|
68
|
-
console.error(chalk.red(`Error: ${err.message}`));
|
|
69
|
-
process.exit(1);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Template command registrations split from main CLI entrypoint.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export function registerTemplateCommands(program, { chalk }) {
|
|
6
|
+
const template = program
|
|
7
|
+
.command('template')
|
|
8
|
+
.description('Manage document templates');
|
|
9
|
+
|
|
10
|
+
template
|
|
11
|
+
.command('list')
|
|
12
|
+
.description('List available templates')
|
|
13
|
+
.option('-v, --vault <path>', 'Vault path')
|
|
14
|
+
.action(async (options) => {
|
|
15
|
+
try {
|
|
16
|
+
const { listTemplates } = await import('../dist/commands/template.js');
|
|
17
|
+
const templates = listTemplates({ vaultPath: options.vault });
|
|
18
|
+
if (templates.length === 0) {
|
|
19
|
+
console.log(chalk.yellow('No templates found.'));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
console.log(chalk.cyan('\n📄 Templates:\n'));
|
|
23
|
+
for (const name of templates) {
|
|
24
|
+
console.log(`- ${name}`);
|
|
25
|
+
}
|
|
26
|
+
console.log();
|
|
27
|
+
} catch (err) {
|
|
28
|
+
console.error(chalk.red(`Error: ${err.message}`));
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
template
|
|
34
|
+
.command('create <name>')
|
|
35
|
+
.description('Create a file from a template')
|
|
36
|
+
.option('-t, --title <title>', 'Document title')
|
|
37
|
+
.option('-v, --vault <path>', 'Vault path')
|
|
38
|
+
.action(async (name, options) => {
|
|
39
|
+
try {
|
|
40
|
+
const { createFromTemplate } = await import('../dist/commands/template.js');
|
|
41
|
+
const result = createFromTemplate(name, {
|
|
42
|
+
title: options.title,
|
|
43
|
+
vaultPath: options.vault
|
|
44
|
+
});
|
|
45
|
+
console.log(chalk.green(`✓ Created from template: ${name}`));
|
|
46
|
+
console.log(chalk.dim(` Output: ${result.outputPath}`));
|
|
47
|
+
} catch (err) {
|
|
48
|
+
console.error(chalk.red(`Error: ${err.message}`));
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
template
|
|
54
|
+
.command('add <file>')
|
|
55
|
+
.description('Add a custom template')
|
|
56
|
+
.requiredOption('--name <name>', 'Template name')
|
|
57
|
+
.option('-v, --vault <path>', 'Vault path')
|
|
58
|
+
.action(async (file, options) => {
|
|
59
|
+
try {
|
|
60
|
+
const { addTemplate } = await import('../dist/commands/template.js');
|
|
61
|
+
const result = addTemplate(file, {
|
|
62
|
+
name: options.name,
|
|
63
|
+
vaultPath: options.vault
|
|
64
|
+
});
|
|
65
|
+
console.log(chalk.green(`✓ Template added: ${result.name}`));
|
|
66
|
+
console.log(chalk.dim(` Path: ${result.templatePath}`));
|
|
67
|
+
} catch (err) {
|
|
68
|
+
console.error(chalk.red(`Error: ${err.message}`));
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|