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.
- package/README.md +159 -199
- package/bin/clawvault.js +111 -111
- package/bin/command-registration.test.js +166 -165
- package/bin/command-runtime.js +93 -77
- package/bin/command-runtime.test.js +154 -102
- package/bin/help-contract.test.js +39 -28
- 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 -248
- package/bin/register-project-commands.js +209 -209
- package/bin/register-project-commands.test.js +206 -201
- package/bin/register-query-commands.js +317 -312
- package/bin/register-query-commands.test.js +65 -0
- 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-G3OQJ2NQ.js → chunk-2YDBJS7M.js} +1 -1
- package/dist/chunk-3FP5BJ42.js +88 -0
- package/dist/{chunk-C3PF7WBA.js → chunk-4IV3R2F5.js} +2 -2
- package/dist/{chunk-7OHQFMJK.js → chunk-AY4PGUVL.js} +5 -4
- package/dist/chunk-FG6RJMCN.js +33 -0
- package/dist/{chunk-WIICLBNF.js → chunk-GFJ3LIIB.js} +1 -1
- package/dist/chunk-IZEY5S74.js +541 -0
- package/dist/chunk-LMEMZGUV.js +332 -0
- package/dist/{chunk-6RQPD7X6.js → chunk-M25QVSJM.js} +4 -3
- package/dist/{chunk-6B3JWM7J.js → chunk-O7XHXF7F.js} +34 -7
- package/dist/chunk-OSMS7QIG.js +406 -0
- package/dist/{chunk-PAYUH64O.js → chunk-QVMXF7FY.js} +11 -1
- package/dist/{chunk-TMZMN7OS.js → chunk-S2IG7VNM.js} +24 -12
- package/dist/{chunk-LMCC5OC7.js → chunk-TPDH3JPP.js} +1 -1
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.js +31 -0
- package/dist/commands/canvas.js +3 -3
- package/dist/commands/compat.js +1 -1
- package/dist/commands/context.js +4 -4
- package/dist/commands/doctor.js +16 -309
- package/dist/commands/embed.d.ts +17 -0
- package/dist/commands/embed.js +10 -0
- package/dist/commands/migrate-observations.js +2 -2
- package/dist/commands/observe.d.ts +1 -0
- package/dist/commands/observe.js +7 -6
- package/dist/commands/rebuild.js +5 -5
- package/dist/commands/reflect.js +3 -3
- package/dist/commands/replay.js +7 -7
- package/dist/commands/setup.d.ts +1 -0
- package/dist/commands/setup.js +2 -2
- package/dist/commands/sleep.d.ts +2 -1
- package/dist/commands/sleep.js +15 -15
- package/dist/commands/status.d.ts +9 -1
- package/dist/commands/status.js +33 -8
- package/dist/commands/wake.d.ts +1 -1
- package/dist/commands/wake.js +6 -6
- package/dist/index.d.ts +82 -5
- package/dist/index.js +127 -105
- package/dist/{types-jjuYN2Xn.d.ts → types-C74wgGL1.d.ts} +2 -0
- package/hooks/clawvault/HOOK.md +83 -74
- package/hooks/clawvault/handler.js +816 -812
- 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
- package/dist/chunk-2RK2AG32.js +0 -743
- package/dist/{chunk-FW465EEA.js → chunk-VXEOHTSL.js} +3 -3
- package/dist/{chunk-KCCHROBR.js → chunk-YOSEUUNB.js} +4 -4
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
QmdUnavailableError,
|
|
3
|
+
hasQmd,
|
|
4
|
+
qmdEmbed
|
|
5
|
+
} from "./chunk-O7XHXF7F.js";
|
|
6
|
+
import {
|
|
7
|
+
resolveVaultPath
|
|
8
|
+
} from "./chunk-MXSSG3QU.js";
|
|
9
|
+
|
|
10
|
+
// src/lib/vault-qmd-config.ts
|
|
11
|
+
import * as fs from "fs";
|
|
12
|
+
import * as path from "path";
|
|
13
|
+
var CONFIG_FILE = ".clawvault.json";
|
|
14
|
+
function readTrimmedString(value) {
|
|
15
|
+
if (typeof value !== "string") return void 0;
|
|
16
|
+
const trimmed = value.trim();
|
|
17
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
18
|
+
}
|
|
19
|
+
function loadVaultQmdConfig(vaultPath) {
|
|
20
|
+
const resolvedVaultPath = path.resolve(vaultPath);
|
|
21
|
+
const fallbackName = path.basename(resolvedVaultPath);
|
|
22
|
+
const fallbackRoot = resolvedVaultPath;
|
|
23
|
+
const configPath = path.join(resolvedVaultPath, CONFIG_FILE);
|
|
24
|
+
if (!fs.existsSync(configPath)) {
|
|
25
|
+
return {
|
|
26
|
+
vaultPath: resolvedVaultPath,
|
|
27
|
+
qmdCollection: fallbackName,
|
|
28
|
+
qmdRoot: fallbackRoot
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const raw = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
33
|
+
const configuredName = readTrimmedString(raw.name) ?? fallbackName;
|
|
34
|
+
const qmdCollection = readTrimmedString(raw.qmdCollection) ?? configuredName;
|
|
35
|
+
const rawRoot = readTrimmedString(raw.qmdRoot) ?? fallbackRoot;
|
|
36
|
+
const qmdRoot = path.isAbsolute(rawRoot) ? path.resolve(rawRoot) : path.resolve(resolvedVaultPath, rawRoot);
|
|
37
|
+
return {
|
|
38
|
+
vaultPath: resolvedVaultPath,
|
|
39
|
+
qmdCollection,
|
|
40
|
+
qmdRoot
|
|
41
|
+
};
|
|
42
|
+
} catch {
|
|
43
|
+
return {
|
|
44
|
+
vaultPath: resolvedVaultPath,
|
|
45
|
+
qmdCollection: fallbackName,
|
|
46
|
+
qmdRoot: fallbackRoot
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// src/commands/embed.ts
|
|
52
|
+
async function embedCommand(options = {}) {
|
|
53
|
+
if (!hasQmd()) {
|
|
54
|
+
throw new QmdUnavailableError();
|
|
55
|
+
}
|
|
56
|
+
const vaultPath = resolveVaultPath({ explicitPath: options.vaultPath });
|
|
57
|
+
const qmdConfig = loadVaultQmdConfig(vaultPath);
|
|
58
|
+
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
59
|
+
if (!options.quiet) {
|
|
60
|
+
console.log(
|
|
61
|
+
`Embedding pending documents for collection "${qmdConfig.qmdCollection}" (root: ${qmdConfig.qmdRoot})...`
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
qmdEmbed(qmdConfig.qmdCollection);
|
|
65
|
+
const finishedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
66
|
+
if (!options.quiet) {
|
|
67
|
+
console.log(`\u2713 Embedding complete for "${qmdConfig.qmdCollection}"`);
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
vaultPath,
|
|
71
|
+
qmdCollection: qmdConfig.qmdCollection,
|
|
72
|
+
qmdRoot: qmdConfig.qmdRoot,
|
|
73
|
+
startedAt,
|
|
74
|
+
finishedAt
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function registerEmbedCommand(program) {
|
|
78
|
+
program.command("embed").description("Run qmd embedding for pending vault documents").option("-v, --vault <path>", "Vault path").action(async (rawOptions) => {
|
|
79
|
+
await embedCommand({
|
|
80
|
+
vaultPath: rawOptions.vault
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export {
|
|
86
|
+
embedCommand,
|
|
87
|
+
registerEmbedCommand
|
|
88
|
+
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
hasQmd,
|
|
7
7
|
qmdEmbed,
|
|
8
8
|
qmdUpdate
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-O7XHXF7F.js";
|
|
10
10
|
import {
|
|
11
11
|
DEFAULT_CATEGORIES,
|
|
12
12
|
TYPE_TO_CATEGORY
|
|
@@ -279,7 +279,8 @@ var ClawVault = class {
|
|
|
279
279
|
frontmatter = {},
|
|
280
280
|
overwrite = false,
|
|
281
281
|
qmdUpdate: triggerUpdate = false,
|
|
282
|
-
qmdEmbed: triggerEmbed = false
|
|
282
|
+
qmdEmbed: triggerEmbed = false,
|
|
283
|
+
qmdIndexName
|
|
283
284
|
} = options;
|
|
284
285
|
const filename = this.slugify(title) + ".md";
|
|
285
286
|
const relativePath = path.join(category, filename);
|
|
@@ -305,9 +306,9 @@ var ClawVault = class {
|
|
|
305
306
|
await this.syncMemoryGraphIndex();
|
|
306
307
|
}
|
|
307
308
|
if (triggerUpdate || triggerEmbed) {
|
|
308
|
-
qmdUpdate(this.getQmdCollection());
|
|
309
|
+
qmdUpdate(this.getQmdCollection(), qmdIndexName);
|
|
309
310
|
if (triggerEmbed) {
|
|
310
|
-
qmdEmbed(this.getQmdCollection());
|
|
311
|
+
qmdEmbed(this.getQmdCollection(), qmdIndexName);
|
|
311
312
|
}
|
|
312
313
|
}
|
|
313
314
|
return doc;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
registerTailscaleCommands
|
|
3
|
+
} from "./chunk-NZ4ZZNSR.js";
|
|
4
|
+
import {
|
|
5
|
+
registerObserveCommand
|
|
6
|
+
} from "./chunk-OSMS7QIG.js";
|
|
7
|
+
import {
|
|
8
|
+
registerReflectCommand
|
|
9
|
+
} from "./chunk-2YDBJS7M.js";
|
|
10
|
+
import {
|
|
11
|
+
registerContextCommand
|
|
12
|
+
} from "./chunk-GFJ3LIIB.js";
|
|
13
|
+
import {
|
|
14
|
+
registerEmbedCommand
|
|
15
|
+
} from "./chunk-3FP5BJ42.js";
|
|
16
|
+
import {
|
|
17
|
+
registerInjectCommand
|
|
18
|
+
} from "./chunk-GSD4ALSI.js";
|
|
19
|
+
|
|
20
|
+
// src/cli/index.ts
|
|
21
|
+
function registerCliCommands(program) {
|
|
22
|
+
registerContextCommand(program);
|
|
23
|
+
registerInjectCommand(program);
|
|
24
|
+
registerObserveCommand(program);
|
|
25
|
+
registerReflectCommand(program);
|
|
26
|
+
registerEmbedCommand(program);
|
|
27
|
+
registerTailscaleCommands(program);
|
|
28
|
+
return program;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
registerCliCommands
|
|
33
|
+
};
|