clawvault 2.5.4 → 2.6.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.
- package/README.md +159 -159
- 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 +75 -72
- package/bin/register-template-commands.test.js +87 -0
- 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-J5EMBUPK.js → chunk-4OXMU5S2.js} +1 -1
- package/dist/{chunk-4IV3R2F5.js → chunk-4TE4JMLA.js} +1 -1
- package/dist/{chunk-5GZFTAL7.js → chunk-AZYOKJYC.js} +128 -42
- package/dist/{chunk-JDLOL2PL.js → chunk-HA5M6KJB.js} +1 -1
- package/dist/{chunk-IZEY5S74.js → chunk-IEVLHNLU.js} +1 -1
- package/dist/{chunk-OSMS7QIG.js → chunk-ME37YNW3.js} +2 -2
- package/dist/chunk-MFAWT5O5.js +301 -0
- package/dist/{chunk-TPDH3JPP.js → chunk-PBEE567J.js} +1 -1
- package/dist/{chunk-S2IG7VNM.js → chunk-Q2J5YTUF.js} +2 -2
- package/dist/{chunk-IOALNTAN.js → chunk-QWQ3TIKS.js} +103 -29
- package/dist/{chunk-YCVDVI5B.js → chunk-R2MIW5G7.js} +1 -1
- package/dist/{chunk-W2HNZC22.js → chunk-UEOUADMO.js} +1 -1
- package/dist/cli/index.js +8 -6
- package/dist/commands/backlog.js +3 -1
- package/dist/commands/blocked.js +3 -1
- package/dist/commands/canvas.js +3 -1
- package/dist/commands/doctor.js +7 -5
- package/dist/commands/kanban.js +4 -2
- package/dist/commands/observe.js +7 -5
- package/dist/commands/project.js +5 -3
- package/dist/commands/rebuild.js +6 -4
- package/dist/commands/replay.js +6 -4
- package/dist/commands/setup.js +1 -1
- package/dist/commands/sleep.js +5 -3
- package/dist/commands/status.js +6 -4
- package/dist/commands/task.js +4 -2
- package/dist/commands/template.d.ts +10 -1
- package/dist/commands/template.js +47 -55
- package/dist/index.js +16 -15
- package/dist/lib/project-utils.js +4 -2
- package/dist/lib/task-utils.d.ts +14 -13
- package/dist/lib/task-utils.js +3 -1
- package/dist/lib/template-engine.d.ts +1 -0
- package/hooks/clawvault/HOOK.md +83 -83
- package/hooks/clawvault/handler.js +816 -816
- package/hooks/clawvault/handler.test.js +263 -263
- package/package.json +94 -94
- package/templates/checkpoint.md +34 -19
- package/templates/daily-note.md +34 -19
- package/templates/daily.md +34 -19
- package/templates/decision.md +39 -17
- package/templates/handoff.md +34 -19
- package/templates/lesson.md +31 -16
- package/templates/person.md +37 -19
- package/templates/project.md +84 -23
- package/templates/task.md +81 -0
- /package/dist/{chunk-AXKYDCNN.js → chunk-RVYA52PY.js} +0 -0
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadSchemaTemplateDefinition,
|
|
3
|
+
renderDocumentFromTemplate
|
|
4
|
+
} from "./chunk-MFAWT5O5.js";
|
|
5
|
+
|
|
1
6
|
// src/lib/task-utils.ts
|
|
2
7
|
import * as fs2 from "fs";
|
|
3
8
|
import * as path2 from "path";
|
|
@@ -192,6 +197,79 @@ function startOfToday() {
|
|
|
192
197
|
const now = /* @__PURE__ */ new Date();
|
|
193
198
|
return new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime();
|
|
194
199
|
}
|
|
200
|
+
function buildTaskFrontmatterFallback(now, options) {
|
|
201
|
+
const frontmatter = {
|
|
202
|
+
status: "open",
|
|
203
|
+
created: now,
|
|
204
|
+
updated: now
|
|
205
|
+
};
|
|
206
|
+
if (options.source) frontmatter.source = options.source;
|
|
207
|
+
if (options.owner) frontmatter.owner = options.owner;
|
|
208
|
+
if (options.project) frontmatter.project = options.project;
|
|
209
|
+
if (options.priority) frontmatter.priority = options.priority;
|
|
210
|
+
if (options.due) frontmatter.due = options.due;
|
|
211
|
+
if (options.tags && options.tags.length > 0) frontmatter.tags = options.tags;
|
|
212
|
+
if (options.description) frontmatter.description = options.description;
|
|
213
|
+
if (options.estimate) frontmatter.estimate = options.estimate;
|
|
214
|
+
if (options.parent) frontmatter.parent = options.parent;
|
|
215
|
+
if (options.depends_on && options.depends_on.length > 0) frontmatter.depends_on = options.depends_on;
|
|
216
|
+
return frontmatter;
|
|
217
|
+
}
|
|
218
|
+
function buildTaskContentFallback(title, options) {
|
|
219
|
+
let content = `# ${title}
|
|
220
|
+
`;
|
|
221
|
+
const links = [];
|
|
222
|
+
if (options.owner) links.push(`[[${options.owner}]]`);
|
|
223
|
+
if (options.project) links.push(`[[${options.project}]]`);
|
|
224
|
+
if (links.length > 0) {
|
|
225
|
+
content += `
|
|
226
|
+
${links.join(" | ")}
|
|
227
|
+
`;
|
|
228
|
+
}
|
|
229
|
+
if (options.content) {
|
|
230
|
+
content += `
|
|
231
|
+
${options.content}
|
|
232
|
+
`;
|
|
233
|
+
}
|
|
234
|
+
return content;
|
|
235
|
+
}
|
|
236
|
+
function buildTaskTemplateOverrides(options) {
|
|
237
|
+
const overrides = {};
|
|
238
|
+
if (options.source) overrides.source = options.source;
|
|
239
|
+
if (options.owner) overrides.owner = options.owner;
|
|
240
|
+
if (options.project) overrides.project = options.project;
|
|
241
|
+
if (options.priority) overrides.priority = options.priority;
|
|
242
|
+
if (options.due) overrides.due = options.due;
|
|
243
|
+
if (options.tags && options.tags.length > 0) overrides.tags = options.tags;
|
|
244
|
+
if (options.description) overrides.description = options.description;
|
|
245
|
+
if (options.estimate) overrides.estimate = options.estimate;
|
|
246
|
+
if (options.parent) overrides.parent = options.parent;
|
|
247
|
+
if (options.depends_on && options.depends_on.length > 0) overrides.depends_on = options.depends_on;
|
|
248
|
+
return overrides;
|
|
249
|
+
}
|
|
250
|
+
function buildTaskTemplateVariables(title, slug, options) {
|
|
251
|
+
const ownerLink = options.owner ? `[[${options.owner}]]` : "";
|
|
252
|
+
const projectLink = options.project ? `[[${options.project}]]` : "";
|
|
253
|
+
const linksLine = [ownerLink, projectLink].filter(Boolean).join(" | ");
|
|
254
|
+
return {
|
|
255
|
+
title,
|
|
256
|
+
slug,
|
|
257
|
+
source: options.source ?? "",
|
|
258
|
+
owner: options.owner ?? "",
|
|
259
|
+
project: options.project ?? "",
|
|
260
|
+
priority: options.priority ?? "",
|
|
261
|
+
due: options.due ?? "",
|
|
262
|
+
tags_csv: (options.tags || []).join(", "),
|
|
263
|
+
description: options.description ?? "",
|
|
264
|
+
estimate: options.estimate ?? "",
|
|
265
|
+
parent: options.parent ?? "",
|
|
266
|
+
depends_on_csv: (options.depends_on || []).join(", "),
|
|
267
|
+
content: options.content ?? "",
|
|
268
|
+
owner_link: ownerLink,
|
|
269
|
+
project_link: projectLink,
|
|
270
|
+
links_line: linksLine
|
|
271
|
+
};
|
|
272
|
+
}
|
|
195
273
|
var VALID_TASK_STATUSES = /* @__PURE__ */ new Set([
|
|
196
274
|
"open",
|
|
197
275
|
"in-progress",
|
|
@@ -387,35 +465,31 @@ function createTask(vaultPath, title, options = {}) {
|
|
|
387
465
|
throw new Error(`Task already exists: ${slug}`);
|
|
388
466
|
}
|
|
389
467
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
390
|
-
const
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
if (
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
content
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
if (options.content) {
|
|
416
|
-
content += `
|
|
417
|
-
${options.content}
|
|
418
|
-
`;
|
|
468
|
+
const template = loadSchemaTemplateDefinition("task", {
|
|
469
|
+
vaultPath: path2.resolve(vaultPath)
|
|
470
|
+
});
|
|
471
|
+
let frontmatter;
|
|
472
|
+
let content;
|
|
473
|
+
if (template) {
|
|
474
|
+
const rendered = renderDocumentFromTemplate(template, {
|
|
475
|
+
title,
|
|
476
|
+
type: "task",
|
|
477
|
+
now: new Date(now),
|
|
478
|
+
variables: buildTaskTemplateVariables(title, slug, options),
|
|
479
|
+
overrides: buildTaskTemplateOverrides(options),
|
|
480
|
+
frontmatter: { pruneEmpty: true }
|
|
481
|
+
});
|
|
482
|
+
const templateFrontmatter = rendered.frontmatter;
|
|
483
|
+
frontmatter = {
|
|
484
|
+
...templateFrontmatter,
|
|
485
|
+
status: isTaskStatus(templateFrontmatter.status) ? templateFrontmatter.status : "open",
|
|
486
|
+
created: typeof templateFrontmatter.created === "string" && templateFrontmatter.created ? templateFrontmatter.created : now,
|
|
487
|
+
updated: typeof templateFrontmatter.updated === "string" && templateFrontmatter.updated ? templateFrontmatter.updated : now
|
|
488
|
+
};
|
|
489
|
+
content = rendered.content;
|
|
490
|
+
} else {
|
|
491
|
+
frontmatter = buildTaskFrontmatterFallback(now, options);
|
|
492
|
+
content = buildTaskContentFallback(title, options);
|
|
419
493
|
}
|
|
420
494
|
const fileContent = matter.stringify(content, frontmatter);
|
|
421
495
|
fs2.writeFileSync(taskPath, fileContent);
|
package/dist/cli/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerCliCommands
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-HA5M6KJB.js";
|
|
4
4
|
import "../chunk-THRJVD4L.js";
|
|
5
5
|
import "../chunk-TIGW564L.js";
|
|
6
6
|
import "../chunk-IVRIKYFE.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-ME37YNW3.js";
|
|
8
8
|
import "../chunk-P5EPF6MB.js";
|
|
9
9
|
import "../chunk-2YDBJS7M.js";
|
|
10
10
|
import "../chunk-YOSEUUNB.js";
|
|
11
11
|
import "../chunk-XAVB4GB4.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-IEVLHNLU.js";
|
|
13
13
|
import "../chunk-HRLWZGMA.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-Q2J5YTUF.js";
|
|
15
|
+
import "../chunk-AZYOKJYC.js";
|
|
16
16
|
import "../chunk-KL4NAOMO.js";
|
|
17
17
|
import "../chunk-FHFUXL6G.js";
|
|
18
18
|
import "../chunk-4QYGFWRM.js";
|
|
@@ -25,7 +25,9 @@ import "../chunk-MQUJNOHK.js";
|
|
|
25
25
|
import "../chunk-MXSSG3QU.js";
|
|
26
26
|
import "../chunk-ZZA73MFY.js";
|
|
27
27
|
import "../chunk-Z2XBWN7A.js";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-QWQ3TIKS.js";
|
|
29
|
+
import "../chunk-MFAWT5O5.js";
|
|
30
|
+
import "../chunk-7766SIJP.js";
|
|
29
31
|
export {
|
|
30
32
|
registerCliCommands
|
|
31
33
|
};
|
package/dist/commands/backlog.js
CHANGED
package/dist/commands/blocked.js
CHANGED
package/dist/commands/canvas.js
CHANGED
|
@@ -15,7 +15,9 @@ import {
|
|
|
15
15
|
} from "../chunk-Z2XBWN7A.js";
|
|
16
16
|
import {
|
|
17
17
|
listTasks
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-QWQ3TIKS.js";
|
|
19
|
+
import "../chunk-MFAWT5O5.js";
|
|
20
|
+
import "../chunk-7766SIJP.js";
|
|
19
21
|
|
|
20
22
|
// src/commands/canvas.ts
|
|
21
23
|
import * as fs2 from "fs";
|
package/dist/commands/doctor.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
doctor
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-UEOUADMO.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-IEVLHNLU.js";
|
|
8
8
|
import "../chunk-HRLWZGMA.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-Q2J5YTUF.js";
|
|
10
|
+
import "../chunk-AZYOKJYC.js";
|
|
11
11
|
import "../chunk-KL4NAOMO.js";
|
|
12
12
|
import "../chunk-FHFUXL6G.js";
|
|
13
13
|
import "../chunk-MAKNAHAW.js";
|
|
@@ -15,7 +15,9 @@ import "../chunk-ITPEXLHA.js";
|
|
|
15
15
|
import "../chunk-2CDEETQN.js";
|
|
16
16
|
import "../chunk-ZZA73MFY.js";
|
|
17
17
|
import "../chunk-Z2XBWN7A.js";
|
|
18
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-QWQ3TIKS.js";
|
|
19
|
+
import "../chunk-MFAWT5O5.js";
|
|
20
|
+
import "../chunk-7766SIJP.js";
|
|
19
21
|
import "../chunk-QVMXF7FY.js";
|
|
20
22
|
export {
|
|
21
23
|
doctor
|
package/dist/commands/kanban.js
CHANGED
|
@@ -7,8 +7,10 @@ import {
|
|
|
7
7
|
kanbanCommand,
|
|
8
8
|
parseKanbanMarkdown,
|
|
9
9
|
syncKanbanBoard
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-4OXMU5S2.js";
|
|
11
|
+
import "../chunk-QWQ3TIKS.js";
|
|
12
|
+
import "../chunk-MFAWT5O5.js";
|
|
13
|
+
import "../chunk-7766SIJP.js";
|
|
12
14
|
export {
|
|
13
15
|
buildKanbanLanes,
|
|
14
16
|
extractCardSlug,
|
package/dist/commands/observe.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
observeCommand,
|
|
3
3
|
registerObserveCommand
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-ME37YNW3.js";
|
|
5
5
|
import "../chunk-P5EPF6MB.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-IEVLHNLU.js";
|
|
7
7
|
import "../chunk-HRLWZGMA.js";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-Q2J5YTUF.js";
|
|
9
|
+
import "../chunk-AZYOKJYC.js";
|
|
10
10
|
import "../chunk-FHFUXL6G.js";
|
|
11
11
|
import "../chunk-ITPEXLHA.js";
|
|
12
12
|
import "../chunk-2CDEETQN.js";
|
|
13
13
|
import "../chunk-MXSSG3QU.js";
|
|
14
14
|
import "../chunk-Z2XBWN7A.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-QWQ3TIKS.js";
|
|
16
|
+
import "../chunk-MFAWT5O5.js";
|
|
17
|
+
import "../chunk-7766SIJP.js";
|
|
16
18
|
export {
|
|
17
19
|
observeCommand,
|
|
18
20
|
registerObserveCommand
|
package/dist/commands/project.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatTaskList,
|
|
3
3
|
taskList
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-R2MIW5G7.js";
|
|
5
5
|
import {
|
|
6
6
|
archiveProject,
|
|
7
7
|
createProject,
|
|
@@ -10,8 +10,10 @@ import {
|
|
|
10
10
|
listProjects,
|
|
11
11
|
readProject,
|
|
12
12
|
updateProject
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-
|
|
13
|
+
} from "../chunk-AZYOKJYC.js";
|
|
14
|
+
import "../chunk-QWQ3TIKS.js";
|
|
15
|
+
import "../chunk-MFAWT5O5.js";
|
|
16
|
+
import "../chunk-7766SIJP.js";
|
|
15
17
|
|
|
16
18
|
// src/commands/project.ts
|
|
17
19
|
import * as fs from "fs";
|
package/dist/commands/rebuild.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rebuildCommand,
|
|
3
3
|
registerRebuildCommand
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-PBEE567J.js";
|
|
5
|
+
import "../chunk-Q2J5YTUF.js";
|
|
6
|
+
import "../chunk-AZYOKJYC.js";
|
|
7
7
|
import "../chunk-FHFUXL6G.js";
|
|
8
8
|
import "../chunk-ITPEXLHA.js";
|
|
9
9
|
import "../chunk-2CDEETQN.js";
|
|
10
10
|
import "../chunk-MXSSG3QU.js";
|
|
11
11
|
import "../chunk-Z2XBWN7A.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-QWQ3TIKS.js";
|
|
13
|
+
import "../chunk-MFAWT5O5.js";
|
|
14
|
+
import "../chunk-7766SIJP.js";
|
|
13
15
|
export {
|
|
14
16
|
rebuildCommand,
|
|
15
17
|
registerRebuildCommand
|
package/dist/commands/replay.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerReplayCommand,
|
|
3
3
|
replayCommand
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-4TE4JMLA.js";
|
|
5
5
|
import "../chunk-YOSEUUNB.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-Q2J5YTUF.js";
|
|
7
|
+
import "../chunk-AZYOKJYC.js";
|
|
8
8
|
import "../chunk-FHFUXL6G.js";
|
|
9
9
|
import "../chunk-K3CDT7IH.js";
|
|
10
10
|
import "../chunk-ITPEXLHA.js";
|
|
@@ -12,7 +12,9 @@ import "../chunk-2CDEETQN.js";
|
|
|
12
12
|
import "../chunk-MQUJNOHK.js";
|
|
13
13
|
import "../chunk-MXSSG3QU.js";
|
|
14
14
|
import "../chunk-Z2XBWN7A.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-QWQ3TIKS.js";
|
|
16
|
+
import "../chunk-MFAWT5O5.js";
|
|
17
|
+
import "../chunk-7766SIJP.js";
|
|
16
18
|
export {
|
|
17
19
|
registerReplayCommand,
|
|
18
20
|
replayCommand
|
package/dist/commands/setup.js
CHANGED
package/dist/commands/sleep.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "../chunk-YOSEUUNB.js";
|
|
7
7
|
import {
|
|
8
8
|
Observer
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-Q2J5YTUF.js";
|
|
10
|
+
import "../chunk-AZYOKJYC.js";
|
|
11
11
|
import {
|
|
12
12
|
ClawVault
|
|
13
13
|
} from "../chunk-KL4NAOMO.js";
|
|
@@ -21,7 +21,9 @@ import "../chunk-2CDEETQN.js";
|
|
|
21
21
|
import "../chunk-MQUJNOHK.js";
|
|
22
22
|
import "../chunk-ZZA73MFY.js";
|
|
23
23
|
import "../chunk-Z2XBWN7A.js";
|
|
24
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-QWQ3TIKS.js";
|
|
25
|
+
import "../chunk-MFAWT5O5.js";
|
|
26
|
+
import "../chunk-7766SIJP.js";
|
|
25
27
|
import {
|
|
26
28
|
clearDirtyFlag
|
|
27
29
|
} from "../chunk-F55HGNU4.js";
|
package/dist/commands/status.js
CHANGED
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
import "../chunk-J7ZWCI2C.js";
|
|
8
8
|
import {
|
|
9
9
|
getObserverStaleness
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-IEVLHNLU.js";
|
|
11
11
|
import "../chunk-HRLWZGMA.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-Q2J5YTUF.js";
|
|
13
|
+
import "../chunk-AZYOKJYC.js";
|
|
14
14
|
import {
|
|
15
15
|
ClawVault
|
|
16
16
|
} from "../chunk-KL4NAOMO.js";
|
|
@@ -26,7 +26,9 @@ import {
|
|
|
26
26
|
loadMemoryGraphIndex
|
|
27
27
|
} from "../chunk-ZZA73MFY.js";
|
|
28
28
|
import "../chunk-Z2XBWN7A.js";
|
|
29
|
-
import "../chunk-
|
|
29
|
+
import "../chunk-QWQ3TIKS.js";
|
|
30
|
+
import "../chunk-MFAWT5O5.js";
|
|
31
|
+
import "../chunk-7766SIJP.js";
|
|
30
32
|
|
|
31
33
|
// src/commands/status.ts
|
|
32
34
|
import * as fs from "fs";
|
package/dist/commands/task.js
CHANGED
|
@@ -8,8 +8,10 @@ import {
|
|
|
8
8
|
taskShow,
|
|
9
9
|
taskTransitions,
|
|
10
10
|
taskUpdate
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
11
|
+
} from "../chunk-R2MIW5G7.js";
|
|
12
|
+
import "../chunk-QWQ3TIKS.js";
|
|
13
|
+
import "../chunk-MFAWT5O5.js";
|
|
14
|
+
import "../chunk-7766SIJP.js";
|
|
13
15
|
export {
|
|
14
16
|
formatTaskDetails,
|
|
15
17
|
formatTaskList,
|
|
@@ -13,6 +13,15 @@ interface TemplateAddOptions extends TemplateCommandContext {
|
|
|
13
13
|
name: string;
|
|
14
14
|
overwrite?: boolean;
|
|
15
15
|
}
|
|
16
|
+
interface TemplateDefinitionInfo {
|
|
17
|
+
name: string;
|
|
18
|
+
primitive: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
fields: string[];
|
|
21
|
+
path: string;
|
|
22
|
+
format: 'schema' | 'legacy';
|
|
23
|
+
}
|
|
24
|
+
declare function listTemplateDefinitions(options?: TemplateCommandContext): TemplateDefinitionInfo[];
|
|
16
25
|
declare function listTemplates(options?: TemplateCommandContext): string[];
|
|
17
26
|
declare function createFromTemplate(name: string, options?: TemplateCreateOptions): {
|
|
18
27
|
outputPath: string;
|
|
@@ -24,4 +33,4 @@ declare function addTemplate(file: string, options: TemplateAddOptions): {
|
|
|
24
33
|
name: string;
|
|
25
34
|
};
|
|
26
35
|
|
|
27
|
-
export { type TemplateAddOptions, type TemplateCommandContext, type TemplateCreateOptions, addTemplate, createFromTemplate, listTemplates };
|
|
36
|
+
export { type TemplateAddOptions, type TemplateCommandContext, type TemplateCreateOptions, type TemplateDefinitionInfo, addTemplate, createFromTemplate, listTemplateDefinitions, listTemplates };
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TEMPLATE_EXTENSION,
|
|
3
|
+
buildTemplateIndex,
|
|
4
|
+
listTemplateDefinitions,
|
|
5
|
+
normalizeTemplateName,
|
|
6
|
+
parseTemplateDefinition,
|
|
7
|
+
renderDocumentFromTemplate
|
|
8
|
+
} from "../chunk-MFAWT5O5.js";
|
|
1
9
|
import {
|
|
2
10
|
buildTemplateVariables,
|
|
3
11
|
renderTemplate
|
|
@@ -6,26 +14,8 @@ import {
|
|
|
6
14
|
// src/commands/template.ts
|
|
7
15
|
import * as fs from "fs";
|
|
8
16
|
import * as path from "path";
|
|
9
|
-
import { fileURLToPath } from "url";
|
|
10
17
|
var VAULT_CONFIG_FILE = ".clawvault.json";
|
|
11
|
-
var
|
|
12
|
-
function resolveBuiltinTemplatesDir(override) {
|
|
13
|
-
if (override) {
|
|
14
|
-
const resolved = path.resolve(override);
|
|
15
|
-
return fs.existsSync(resolved) ? resolved : null;
|
|
16
|
-
}
|
|
17
|
-
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
18
|
-
const candidates = [
|
|
19
|
-
path.resolve(moduleDir, "../templates"),
|
|
20
|
-
path.resolve(moduleDir, "../../templates")
|
|
21
|
-
];
|
|
22
|
-
for (const candidate of candidates) {
|
|
23
|
-
if (fs.existsSync(candidate) && fs.statSync(candidate).isDirectory()) {
|
|
24
|
-
return candidate;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
18
|
+
var TEMPLATE_LIST_IGNORED_BUILTINS = /* @__PURE__ */ new Set(["daily"]);
|
|
29
19
|
function findVaultRoot(start) {
|
|
30
20
|
let current = path.resolve(start);
|
|
31
21
|
while (true) {
|
|
@@ -48,53 +38,41 @@ function resolveVaultPath(options) {
|
|
|
48
38
|
const cwd = options.cwd ?? process.cwd();
|
|
49
39
|
return findVaultRoot(cwd);
|
|
50
40
|
}
|
|
51
|
-
function normalizeTemplateName(name) {
|
|
52
|
-
const base = path.basename(name, path.extname(name));
|
|
53
|
-
return base.trim();
|
|
54
|
-
}
|
|
55
41
|
function slugify(text) {
|
|
56
42
|
return text.toLowerCase().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").trim();
|
|
57
43
|
}
|
|
58
|
-
function
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (ignore?.has(name)) continue;
|
|
66
|
-
entries.set(name, path.join(dir, entry.name));
|
|
67
|
-
}
|
|
68
|
-
return entries;
|
|
44
|
+
function buildTemplateIndexForContext(options) {
|
|
45
|
+
const vaultPath = resolveVaultPath(options) ?? void 0;
|
|
46
|
+
return buildTemplateIndex({
|
|
47
|
+
vaultPath,
|
|
48
|
+
builtinDir: options.builtinDir,
|
|
49
|
+
ignoreBuiltinNames: TEMPLATE_LIST_IGNORED_BUILTINS
|
|
50
|
+
});
|
|
69
51
|
}
|
|
70
|
-
function
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return index;
|
|
52
|
+
function listTemplateDefinitions2(options = {}) {
|
|
53
|
+
const vaultPath = resolveVaultPath(options) ?? void 0;
|
|
54
|
+
return listTemplateDefinitions({
|
|
55
|
+
vaultPath,
|
|
56
|
+
builtinDir: options.builtinDir,
|
|
57
|
+
ignoreBuiltinNames: TEMPLATE_LIST_IGNORED_BUILTINS
|
|
58
|
+
}).map((definition) => ({
|
|
59
|
+
name: definition.name,
|
|
60
|
+
primitive: definition.primitive,
|
|
61
|
+
description: definition.description,
|
|
62
|
+
fields: Object.keys(definition.fields),
|
|
63
|
+
path: definition.path,
|
|
64
|
+
format: definition.format
|
|
65
|
+
}));
|
|
87
66
|
}
|
|
88
67
|
function listTemplates(options = {}) {
|
|
89
|
-
|
|
90
|
-
return [...index.keys()].sort();
|
|
68
|
+
return listTemplateDefinitions2(options).map((definition) => definition.name);
|
|
91
69
|
}
|
|
92
70
|
function createFromTemplate(name, options = {}) {
|
|
93
71
|
const templateName = normalizeTemplateName(name);
|
|
94
72
|
if (!templateName) {
|
|
95
73
|
throw new Error("Template name is required.");
|
|
96
74
|
}
|
|
97
|
-
const index =
|
|
75
|
+
const index = buildTemplateIndexForContext(options);
|
|
98
76
|
const templatePath = index.get(templateName);
|
|
99
77
|
if (!templatePath) {
|
|
100
78
|
const available = [...index.keys()].sort();
|
|
@@ -107,7 +85,20 @@ function createFromTemplate(name, options = {}) {
|
|
|
107
85
|
const type = options.type ?? templateName;
|
|
108
86
|
const title = options.title ?? `${type} ${date}`.trim();
|
|
109
87
|
const variables = buildTemplateVariables({ title, type, date }, now);
|
|
110
|
-
const
|
|
88
|
+
const parsedTemplate = parseTemplateDefinition(raw, templateName, templatePath);
|
|
89
|
+
const rendered = parsedTemplate.format === "schema" ? renderDocumentFromTemplate(parsedTemplate, {
|
|
90
|
+
title,
|
|
91
|
+
type,
|
|
92
|
+
now,
|
|
93
|
+
variables: {
|
|
94
|
+
...variables,
|
|
95
|
+
content: "",
|
|
96
|
+
links_line: "",
|
|
97
|
+
owner_link: "",
|
|
98
|
+
project_link: "",
|
|
99
|
+
team_links_line: ""
|
|
100
|
+
}
|
|
101
|
+
}).markdown : renderTemplate(raw, variables);
|
|
111
102
|
const cwd = options.cwd ?? process.cwd();
|
|
112
103
|
const slug = slugify(title) || slugify(templateName) || `template-${date}`;
|
|
113
104
|
const outputPath = path.join(cwd, `${slug}${TEMPLATE_EXTENSION}`);
|
|
@@ -143,5 +134,6 @@ function addTemplate(file, options) {
|
|
|
143
134
|
export {
|
|
144
135
|
addTemplate,
|
|
145
136
|
createFromTemplate,
|
|
137
|
+
listTemplateDefinitions2 as listTemplateDefinitions,
|
|
146
138
|
listTemplates
|
|
147
139
|
};
|