clawvault 2.4.6 → 2.5.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/bin/clawvault.js +5 -0
- package/bin/command-registration.test.js +1 -1
- package/bin/help-contract.test.js +1 -0
- package/bin/register-config-route-commands.test.js +8 -1
- package/bin/register-core-commands.js +3 -3
- package/bin/register-project-commands.js +209 -0
- package/bin/register-project-commands.test.js +201 -0
- package/bin/register-query-commands.js +40 -0
- package/bin/register-task-commands.js +2 -18
- package/bin/register-task-commands.test.js +3 -4
- package/bin/test-helpers/cli-command-fixtures.js +5 -0
- package/dist/{chunk-3PJIGGWV.js → chunk-2CDEETQN.js} +1 -0
- package/dist/{chunk-FD2ZA65C.js → chunk-2RK2AG32.js} +5 -5
- package/dist/chunk-5GZFTAL7.js +340 -0
- package/dist/{chunk-P2ZH6AN5.js → chunk-6RQPD7X6.js} +3 -4
- package/dist/{chunk-HNMFXFYP.js → chunk-7OHQFMJK.js} +2 -1
- package/dist/{chunk-FKQJB6XC.js → chunk-C3PF7WBA.js} +2 -2
- package/dist/{chunk-JXY6T5R7.js → chunk-FW465EEA.js} +1 -1
- package/dist/{chunk-BI6SGGZP.js → chunk-G3OQJ2NQ.js} +1 -1
- package/dist/chunk-GSD4ALSI.js +724 -0
- package/dist/{chunk-6QLRSPLZ.js → chunk-IOALNTAN.js} +268 -47
- package/dist/chunk-ITPEXLHA.js +528 -0
- package/dist/{chunk-LLN5SPGL.js → chunk-J5EMBUPK.js} +1 -1
- package/dist/chunk-K3CDT7IH.js +122 -0
- package/dist/{chunk-AHGUJG76.js → chunk-KCCHROBR.js} +13 -69
- package/dist/{chunk-JTO7NZLS.js → chunk-LMCC5OC7.js} +2 -2
- package/dist/{chunk-QALB2V3E.js → chunk-MQUJNOHK.js} +1 -1
- package/dist/{chunk-H6WQUUNK.js → chunk-TMZMN7OS.js} +334 -457
- package/dist/{chunk-HVTTYDCJ.js → chunk-VR5NE7PZ.js} +1 -1
- package/dist/{chunk-22WE3J4F.js → chunk-WIICLBNF.js} +35 -4
- package/dist/chunk-YCVDVI5B.js +273 -0
- package/dist/{chunk-NAMFB7ZA.js → chunk-Z2XBWN7A.js} +0 -2
- package/dist/commands/archive.js +3 -3
- package/dist/commands/backlog.js +1 -1
- package/dist/commands/blocked.js +1 -1
- package/dist/commands/canvas.d.ts +1 -14
- package/dist/commands/canvas.js +123 -1543
- package/dist/commands/context.js +5 -6
- package/dist/commands/doctor.js +2 -2
- package/dist/commands/inject.d.ts +2 -0
- package/dist/commands/inject.js +14 -0
- package/dist/commands/kanban.js +2 -2
- package/dist/commands/migrate-observations.js +2 -2
- package/dist/commands/observe.js +8 -6
- package/dist/commands/project.d.ts +85 -0
- package/dist/commands/project.js +411 -0
- package/dist/commands/rebuild.js +7 -5
- package/dist/commands/reflect.js +5 -4
- package/dist/commands/replay.js +10 -7
- package/dist/commands/setup.d.ts +1 -1
- package/dist/commands/setup.js +2 -2
- package/dist/commands/sleep.d.ts +1 -1
- package/dist/commands/sleep.js +11 -8
- package/dist/commands/status.js +2 -2
- package/dist/commands/task.d.ts +2 -2
- package/dist/commands/task.js +11 -301
- package/dist/commands/wake.d.ts +1 -1
- package/dist/commands/wake.js +4 -4
- package/dist/index.d.ts +75 -107
- package/dist/index.js +78 -36
- package/dist/inject-x65KXWPk.d.ts +137 -0
- package/dist/lib/project-utils.d.ts +97 -0
- package/dist/lib/project-utils.js +19 -0
- package/dist/lib/task-utils.d.ts +8 -3
- package/dist/lib/task-utils.js +1 -1
- package/dist/{types-DMU3SuAV.d.ts → types-jjuYN2Xn.d.ts} +1 -1
- package/package.json +2 -2
- package/dist/chunk-L3DJ36BZ.js +0 -40
- package/dist/chunk-UMMCYTJV.js +0 -105
package/dist/commands/sleep.d.ts
CHANGED
package/dist/commands/sleep.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runReflection
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-KCCHROBR.js";
|
|
4
|
+
import "../chunk-K3CDT7IH.js";
|
|
4
5
|
import {
|
|
5
6
|
parseSessionFile
|
|
6
7
|
} from "../chunk-P5EPF6MB.js";
|
|
7
8
|
import {
|
|
8
9
|
Observer
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-TMZMN7OS.js";
|
|
11
|
+
import "../chunk-5GZFTAL7.js";
|
|
12
|
+
import "../chunk-ITPEXLHA.js";
|
|
13
|
+
import "../chunk-MQUJNOHK.js";
|
|
14
|
+
import "../chunk-IOALNTAN.js";
|
|
12
15
|
import {
|
|
13
16
|
clearDirtyFlag
|
|
14
17
|
} from "../chunk-F55HGNU4.js";
|
|
15
18
|
import {
|
|
16
19
|
ClawVault
|
|
17
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-7OHQFMJK.js";
|
|
18
21
|
import {
|
|
19
22
|
qmdUpdate
|
|
20
23
|
} from "../chunk-6B3JWM7J.js";
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-ZZA73MFY.js";
|
|
24
|
+
import "../chunk-2CDEETQN.js";
|
|
23
25
|
import "../chunk-FHFUXL6G.js";
|
|
24
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-ZZA73MFY.js";
|
|
27
|
+
import "../chunk-Z2XBWN7A.js";
|
|
25
28
|
|
|
26
29
|
// src/commands/sleep.ts
|
|
27
30
|
import * as fs from "fs";
|
package/dist/commands/status.js
CHANGED
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
import "../chunk-J7ZWCI2C.js";
|
|
8
8
|
import {
|
|
9
9
|
ClawVault
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-7OHQFMJK.js";
|
|
11
11
|
import {
|
|
12
12
|
QmdUnavailableError,
|
|
13
13
|
hasQmd
|
|
14
14
|
} from "../chunk-6B3JWM7J.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-2CDEETQN.js";
|
|
16
16
|
import {
|
|
17
17
|
loadMemoryGraphIndex
|
|
18
18
|
} from "../chunk-ZZA73MFY.js";
|
package/dist/commands/task.d.ts
CHANGED
|
@@ -59,11 +59,11 @@ declare function taskAdd(vaultPath: string, title: string, options?: TaskAddOpti
|
|
|
59
59
|
*/
|
|
60
60
|
declare function taskList(vaultPath: string, options?: TaskListOptions): Task[];
|
|
61
61
|
/**
|
|
62
|
-
* Update a task
|
|
62
|
+
* Update a task
|
|
63
63
|
*/
|
|
64
64
|
declare function taskUpdate(vaultPath: string, slug: string, options: TaskUpdateOptions): Task;
|
|
65
65
|
/**
|
|
66
|
-
* Mark a task as done
|
|
66
|
+
* Mark a task as done
|
|
67
67
|
*/
|
|
68
68
|
declare function taskDone(vaultPath: string, slug: string, options?: {
|
|
69
69
|
confidence?: number;
|
package/dist/commands/task.js
CHANGED
|
@@ -1,305 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
listTasks,
|
|
14
|
-
readTask,
|
|
15
|
-
updateTask
|
|
16
|
-
} from "../chunk-6QLRSPLZ.js";
|
|
17
|
-
|
|
18
|
-
// src/commands/task.ts
|
|
19
|
-
import matter from "gray-matter";
|
|
20
|
-
import * as fs from "fs";
|
|
21
|
-
function taskAdd(vaultPath, title, options = {}) {
|
|
22
|
-
return createTask(vaultPath, title, {
|
|
23
|
-
owner: options.owner,
|
|
24
|
-
project: options.project,
|
|
25
|
-
priority: options.priority,
|
|
26
|
-
due: options.due,
|
|
27
|
-
content: options.content,
|
|
28
|
-
tags: options.tags,
|
|
29
|
-
description: options.description,
|
|
30
|
-
estimate: options.estimate,
|
|
31
|
-
parent: options.parent,
|
|
32
|
-
depends_on: options.dependsOn
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function taskList(vaultPath, options = {}) {
|
|
36
|
-
const filters = {};
|
|
37
|
-
if (options.status) filters.status = options.status;
|
|
38
|
-
if (options.owner) filters.owner = options.owner;
|
|
39
|
-
if (options.project) filters.project = options.project;
|
|
40
|
-
if (options.priority) filters.priority = options.priority;
|
|
41
|
-
if (options.due) filters.due = true;
|
|
42
|
-
if (options.tag) filters.tag = options.tag;
|
|
43
|
-
if (options.overdue) filters.overdue = true;
|
|
44
|
-
const listed = listTasks(vaultPath, filters);
|
|
45
|
-
if (!options.status && !options.overdue) {
|
|
46
|
-
return listed.filter((t) => t.frontmatter.status !== "done");
|
|
47
|
-
}
|
|
48
|
-
return listed;
|
|
49
|
-
}
|
|
50
|
-
function taskUpdate(vaultPath, slug, options) {
|
|
51
|
-
const before = readTask(vaultPath, slug);
|
|
52
|
-
const oldStatus = before?.frontmatter.status;
|
|
53
|
-
const task = updateTask(vaultPath, slug, {
|
|
54
|
-
status: options.status,
|
|
55
|
-
owner: options.owner,
|
|
56
|
-
project: options.project,
|
|
57
|
-
priority: options.priority,
|
|
58
|
-
blocked_by: options.blockedBy,
|
|
59
|
-
due: options.due,
|
|
60
|
-
tags: options.tags,
|
|
61
|
-
description: options.description,
|
|
62
|
-
estimate: options.estimate,
|
|
63
|
-
parent: options.parent,
|
|
64
|
-
depends_on: options.dependsOn,
|
|
65
|
-
confidence: options.confidence,
|
|
66
|
-
reason: options.reason
|
|
67
|
-
});
|
|
68
|
-
if (options.status && oldStatus && options.status !== oldStatus) {
|
|
69
|
-
emitTransition(vaultPath, slug, oldStatus, options.status, {
|
|
70
|
-
confidence: options.confidence,
|
|
71
|
-
reason: options.reason ?? void 0
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
return task;
|
|
75
|
-
}
|
|
76
|
-
function taskDone(vaultPath, slug, options = {}) {
|
|
77
|
-
const before = readTask(vaultPath, slug);
|
|
78
|
-
const oldStatus = before?.frontmatter.status;
|
|
79
|
-
const task = completeTask(vaultPath, slug);
|
|
80
|
-
if (oldStatus && oldStatus !== "done") {
|
|
81
|
-
emitTransition(vaultPath, slug, oldStatus, "done", options);
|
|
82
|
-
}
|
|
83
|
-
return task;
|
|
84
|
-
}
|
|
85
|
-
function emitTransition(vaultPath, slug, fromStatus, toStatus, options = {}) {
|
|
86
|
-
const event = buildTransitionEvent(slug, fromStatus, toStatus, {
|
|
87
|
-
confidence: options.confidence,
|
|
88
|
-
reason: options.reason
|
|
89
|
-
});
|
|
90
|
-
appendTransition(vaultPath, event);
|
|
91
|
-
if (toStatus === "blocked") {
|
|
92
|
-
const blockedCount = countBlockedTransitions(vaultPath, slug);
|
|
93
|
-
if (blockedCount >= 3) {
|
|
94
|
-
markEscalation(vaultPath, slug);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function markEscalation(vaultPath, slug) {
|
|
99
|
-
const task = readTask(vaultPath, slug);
|
|
100
|
-
if (!task) return;
|
|
101
|
-
const raw = fs.readFileSync(task.path, "utf-8");
|
|
102
|
-
const { data, content } = matter(raw);
|
|
103
|
-
if (data.escalation) return;
|
|
104
|
-
data.escalation = true;
|
|
105
|
-
fs.writeFileSync(task.path, matter.stringify(content, data));
|
|
106
|
-
}
|
|
107
|
-
function taskTransitions(vaultPath, taskId, options = {}) {
|
|
108
|
-
const events = queryTransitions(vaultPath, {
|
|
109
|
-
taskId,
|
|
110
|
-
agent: options.agent,
|
|
111
|
-
failed: options.failed
|
|
112
|
-
});
|
|
113
|
-
if (options.json) {
|
|
114
|
-
return JSON.stringify(events, null, 2);
|
|
115
|
-
}
|
|
116
|
-
return formatTransitionsTable(events);
|
|
117
|
-
}
|
|
118
|
-
function taskShow(vaultPath, slug) {
|
|
119
|
-
return readTask(vaultPath, slug);
|
|
120
|
-
}
|
|
121
|
-
function formatTaskList(tasks) {
|
|
122
|
-
if (tasks.length === 0) {
|
|
123
|
-
return "No tasks found.\n";
|
|
124
|
-
}
|
|
125
|
-
const headers = ["STATUS", "OWNER", "PRIORITY", "PROJECT", "META", "TITLE"];
|
|
126
|
-
const widths = [10, 12, 8, 14, 64, 32];
|
|
127
|
-
const truncate = (value, width) => {
|
|
128
|
-
if (value.length <= width) return value;
|
|
129
|
-
return value.slice(0, width - 3) + "...";
|
|
130
|
-
};
|
|
131
|
-
let output = headers.map((h, i) => h.padEnd(widths[i])).join(" ") + "\n";
|
|
132
|
-
for (const task of tasks) {
|
|
133
|
-
const icon = getStatusIcon(task.frontmatter.status);
|
|
134
|
-
const statusDisplay = getStatusDisplay(task.frontmatter.status);
|
|
135
|
-
const status = `${icon} ${statusDisplay}`;
|
|
136
|
-
const owner = task.frontmatter.owner || "-";
|
|
137
|
-
const priority = task.frontmatter.priority || "low";
|
|
138
|
-
const project = task.frontmatter.project || "-";
|
|
139
|
-
const metaParts = [];
|
|
140
|
-
if (task.frontmatter.due) metaParts.push(`due:${task.frontmatter.due.split("T")[0]}`);
|
|
141
|
-
if (task.frontmatter.tags?.length) metaParts.push(task.frontmatter.tags.map((tag) => `#${tag}`).join(","));
|
|
142
|
-
if (task.frontmatter.parent) metaParts.push(`parent:${task.frontmatter.parent}`);
|
|
143
|
-
if (task.frontmatter.depends_on?.length) {
|
|
144
|
-
metaParts.push(`deps:${task.frontmatter.depends_on.join("|")}`);
|
|
145
|
-
}
|
|
146
|
-
const meta = metaParts.length > 0 ? metaParts.join(" ") : "-";
|
|
147
|
-
const title = truncate(task.title, widths[5]);
|
|
148
|
-
const row = [
|
|
149
|
-
status.padEnd(widths[0]),
|
|
150
|
-
owner.padEnd(widths[1]),
|
|
151
|
-
priority.padEnd(widths[2]),
|
|
152
|
-
project.padEnd(widths[3]),
|
|
153
|
-
truncate(meta, widths[4]).padEnd(widths[4]),
|
|
154
|
-
title
|
|
155
|
-
];
|
|
156
|
-
output += row.join(" ") + "\n";
|
|
157
|
-
}
|
|
158
|
-
return output;
|
|
159
|
-
}
|
|
160
|
-
function formatTaskDetails(task) {
|
|
161
|
-
let output = "";
|
|
162
|
-
output += `# ${task.title}
|
|
163
|
-
`;
|
|
164
|
-
output += "-".repeat(40) + "\n";
|
|
165
|
-
output += `Status: ${getStatusIcon(task.frontmatter.status)} ${getStatusDisplay(task.frontmatter.status)}
|
|
166
|
-
`;
|
|
167
|
-
if (task.frontmatter.owner) {
|
|
168
|
-
output += `Owner: ${task.frontmatter.owner}
|
|
169
|
-
`;
|
|
170
|
-
}
|
|
171
|
-
if (task.frontmatter.project) {
|
|
172
|
-
output += `Project: ${task.frontmatter.project}
|
|
173
|
-
`;
|
|
174
|
-
}
|
|
175
|
-
if (task.frontmatter.priority) {
|
|
176
|
-
output += `Priority: ${task.frontmatter.priority}
|
|
177
|
-
`;
|
|
178
|
-
}
|
|
179
|
-
if (task.frontmatter.description) {
|
|
180
|
-
output += `Description: ${task.frontmatter.description}
|
|
181
|
-
`;
|
|
182
|
-
}
|
|
183
|
-
if (task.frontmatter.estimate) {
|
|
184
|
-
output += `Estimate: ${task.frontmatter.estimate}
|
|
185
|
-
`;
|
|
186
|
-
}
|
|
187
|
-
if (task.frontmatter.parent) {
|
|
188
|
-
output += `Parent: ${task.frontmatter.parent}
|
|
189
|
-
`;
|
|
190
|
-
}
|
|
191
|
-
if (task.frontmatter.depends_on && task.frontmatter.depends_on.length > 0) {
|
|
192
|
-
output += `Depends on: ${task.frontmatter.depends_on.join(", ")}
|
|
193
|
-
`;
|
|
194
|
-
}
|
|
195
|
-
if (task.frontmatter.due) {
|
|
196
|
-
output += `Due: ${task.frontmatter.due}
|
|
197
|
-
`;
|
|
198
|
-
}
|
|
199
|
-
if (task.frontmatter.blocked_by) {
|
|
200
|
-
output += `Blocked by: ${task.frontmatter.blocked_by}
|
|
201
|
-
`;
|
|
202
|
-
}
|
|
203
|
-
if (task.frontmatter.tags && task.frontmatter.tags.length > 0) {
|
|
204
|
-
output += `Tags: ${task.frontmatter.tags.join(", ")}
|
|
205
|
-
`;
|
|
206
|
-
}
|
|
207
|
-
if (task.frontmatter.escalation) {
|
|
208
|
-
output += "Escalation: true\n";
|
|
209
|
-
}
|
|
210
|
-
if (task.frontmatter.confidence !== void 0) {
|
|
211
|
-
output += `Confidence: ${task.frontmatter.confidence}
|
|
212
|
-
`;
|
|
213
|
-
}
|
|
214
|
-
if (task.frontmatter.reason) {
|
|
215
|
-
output += `Reason: ${task.frontmatter.reason}
|
|
216
|
-
`;
|
|
217
|
-
}
|
|
218
|
-
output += `Created: ${task.frontmatter.created}
|
|
219
|
-
`;
|
|
220
|
-
output += `Updated: ${task.frontmatter.updated}
|
|
221
|
-
`;
|
|
222
|
-
if (task.frontmatter.completed) {
|
|
223
|
-
output += `Completed: ${task.frontmatter.completed}
|
|
224
|
-
`;
|
|
225
|
-
}
|
|
226
|
-
output += `File: ${task.path}
|
|
227
|
-
`;
|
|
228
|
-
output += "-".repeat(40) + "\n";
|
|
229
|
-
const contentWithoutTitle = task.content.replace(/^#\s+.+\n/, "").trim();
|
|
230
|
-
if (contentWithoutTitle) {
|
|
231
|
-
output += "\n" + contentWithoutTitle + "\n";
|
|
232
|
-
}
|
|
233
|
-
return output;
|
|
234
|
-
}
|
|
235
|
-
async function taskCommand(vaultPath, action, args) {
|
|
236
|
-
const options = args.options || {};
|
|
237
|
-
switch (action) {
|
|
238
|
-
case "add": {
|
|
239
|
-
if (!args.title) {
|
|
240
|
-
throw new Error("Title is required for task add");
|
|
241
|
-
}
|
|
242
|
-
const task = taskAdd(vaultPath, args.title, options);
|
|
243
|
-
console.log(`\u2713 Created task: ${task.slug}`);
|
|
244
|
-
console.log(` Path: ${task.path}`);
|
|
245
|
-
break;
|
|
246
|
-
}
|
|
247
|
-
case "list": {
|
|
248
|
-
const tasks = taskList(vaultPath, options);
|
|
249
|
-
if (options.json) {
|
|
250
|
-
console.log(JSON.stringify(tasks, null, 2));
|
|
251
|
-
} else {
|
|
252
|
-
console.log(formatTaskList(tasks));
|
|
253
|
-
}
|
|
254
|
-
break;
|
|
255
|
-
}
|
|
256
|
-
case "update": {
|
|
257
|
-
if (!args.slug) {
|
|
258
|
-
throw new Error("Task slug is required for update");
|
|
259
|
-
}
|
|
260
|
-
const task = taskUpdate(vaultPath, args.slug, options);
|
|
261
|
-
console.log(`\u2713 Updated task: ${task.slug}`);
|
|
262
|
-
break;
|
|
263
|
-
}
|
|
264
|
-
case "done": {
|
|
265
|
-
if (!args.slug) {
|
|
266
|
-
throw new Error("Task slug is required for done");
|
|
267
|
-
}
|
|
268
|
-
const task = taskDone(vaultPath, args.slug, {
|
|
269
|
-
confidence: options.confidence,
|
|
270
|
-
reason: options.reason ?? void 0
|
|
271
|
-
});
|
|
272
|
-
console.log(`\u2713 Completed task: ${task.slug}`);
|
|
273
|
-
break;
|
|
274
|
-
}
|
|
275
|
-
case "transitions": {
|
|
276
|
-
const output = taskTransitions(vaultPath, args.slug, {
|
|
277
|
-
agent: options.agent,
|
|
278
|
-
failed: options.failed,
|
|
279
|
-
json: options.json
|
|
280
|
-
});
|
|
281
|
-
console.log(output);
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
case "show": {
|
|
285
|
-
if (!args.slug) {
|
|
286
|
-
throw new Error("Task slug is required for show");
|
|
287
|
-
}
|
|
288
|
-
const task = taskShow(vaultPath, args.slug);
|
|
289
|
-
if (!task) {
|
|
290
|
-
throw new Error(`Task not found: ${args.slug}`);
|
|
291
|
-
}
|
|
292
|
-
if (options.json) {
|
|
293
|
-
console.log(JSON.stringify(task, null, 2));
|
|
294
|
-
} else {
|
|
295
|
-
console.log(formatTaskDetails(task));
|
|
296
|
-
}
|
|
297
|
-
break;
|
|
298
|
-
}
|
|
299
|
-
default:
|
|
300
|
-
throw new Error(`Unknown task action: ${action}`);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
2
|
+
formatTaskDetails,
|
|
3
|
+
formatTaskList,
|
|
4
|
+
taskAdd,
|
|
5
|
+
taskCommand,
|
|
6
|
+
taskDone,
|
|
7
|
+
taskList,
|
|
8
|
+
taskShow,
|
|
9
|
+
taskTransitions,
|
|
10
|
+
taskUpdate
|
|
11
|
+
} from "../chunk-YCVDVI5B.js";
|
|
12
|
+
import "../chunk-IOALNTAN.js";
|
|
303
13
|
export {
|
|
304
14
|
formatTaskDetails,
|
|
305
15
|
formatTaskList,
|
package/dist/commands/wake.d.ts
CHANGED
package/dist/commands/wake.js
CHANGED
|
@@ -7,16 +7,16 @@ import {
|
|
|
7
7
|
} from "../chunk-F55HGNU4.js";
|
|
8
8
|
import {
|
|
9
9
|
ClawVault
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-7OHQFMJK.js";
|
|
11
11
|
import "../chunk-6B3JWM7J.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-ZZA73MFY.js";
|
|
12
|
+
import "../chunk-2CDEETQN.js";
|
|
14
13
|
import {
|
|
15
14
|
parseObservationMarkdown
|
|
16
15
|
} from "../chunk-FHFUXL6G.js";
|
|
16
|
+
import "../chunk-ZZA73MFY.js";
|
|
17
17
|
import {
|
|
18
18
|
listObservationFiles
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-Z2XBWN7A.js";
|
|
20
20
|
|
|
21
21
|
// src/commands/wake.ts
|
|
22
22
|
import * as fs from "fs";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import { V as VaultConfig, S as StoreOptions, D as Document, a as SearchOptions, b as SearchResult, c as SyncOptions, d as SyncResult, C as Category, M as MemoryType, H as HandoffDocument, e as SessionRecap } from './types-
|
|
3
|
-
export { f as DEFAULT_CATEGORIES, g as DEFAULT_CONFIG, h as MEMORY_TYPES, T as TYPE_TO_CATEGORY, i as VaultMeta } from './types-
|
|
2
|
+
import { V as VaultConfig, S as StoreOptions, D as Document, a as SearchOptions, b as SearchResult, c as SyncOptions, d as SyncResult, C as Category, M as MemoryType, H as HandoffDocument, e as SessionRecap } from './types-jjuYN2Xn.js';
|
|
3
|
+
export { f as DEFAULT_CATEGORIES, g as DEFAULT_CONFIG, h as MEMORY_TYPES, T as TYPE_TO_CATEGORY, i as VaultMeta } from './types-jjuYN2Xn.js';
|
|
4
4
|
export { setupCommand } from './commands/setup.js';
|
|
5
5
|
export { CompatCheck, CompatCommandOptions, CompatReport, CompatStatus, checkOpenClawCompatibility, compatCommand, compatibilityExitCode } from './commands/compat.js';
|
|
6
6
|
export { GraphSummary, graphCommand, graphSummary } from './commands/graph.js';
|
|
7
7
|
export { KanbanGroupBy, KanbanImportChange, KanbanImportOptions, KanbanImportResult, KanbanLane, KanbanSyncOptions, KanbanSyncResult, ParsedKanbanBoard, ParsedKanbanLane, buildKanbanLanes, extractCardSlug, formatKanbanCard, generateKanbanMarkdown, importKanbanBoard, kanbanCommand, parseKanbanMarkdown, syncKanbanBoard } from './commands/kanban.js';
|
|
8
8
|
export { C as ContextEntry, a as ContextFormat, b as ContextOptions, c as ContextProfile, d as ContextProfileInput, e as ContextProfileOption, f as ContextResult, R as ResolvedContextProfile, g as buildContext, h as contextCommand, i as formatContextMarkdown, j as inferContextProfile, n as normalizeContextProfileInput, r as registerContextCommand, k as resolveContextProfile } from './context-BUGaWpyL.js';
|
|
9
|
+
export { I as InjectCommandOptions, a as InjectFormat, b as InjectMatch, c as InjectMatchReason, d as InjectMatchSource, e as InjectResult, f as InjectRuntimeOptions, g as InjectSourceCategory, h as InjectableItem, L as LlmCompletionOptions, i as LlmProvider, M as MEMORY_GRAPH_SCHEMA_VERSION, j as MemoryGraph, k as MemoryGraphEdge, l as MemoryGraphEdgeType, m as MemoryGraphIndex, n as MemoryGraphNode, o as MemoryGraphNodeType, p as MemoryGraphStats, q as buildInjectionResult, r as buildOrUpdateMemoryGraphIndex, s as deterministicInjectMatches, t as getMemoryGraph, u as indexInjectableItems, v as injectCommand, w as loadMemoryGraphIndex, x as registerInjectCommand, y as requestLlmCompletion, z as resolveLlmProvider, A as runPromptInjection } from './inject-x65KXWPk.js';
|
|
9
10
|
export { ObserveCommandOptions, observeCommand, registerObserveCommand } from './commands/observe.js';
|
|
10
11
|
export { ReflectCommandOptions, reflectCommand, registerReflectCommand } from './commands/reflect.js';
|
|
11
12
|
export { ArchiveCommandOptions, archiveCommand, registerArchiveCommand } from './commands/archive.js';
|
|
@@ -16,10 +17,11 @@ export { SyncBdCommandOptions, registerSyncBdCommand, syncBdCommand } from './co
|
|
|
16
17
|
export { SessionRecapFormat, SessionRecapOptions, SessionRecapResult, SessionTurn, buildSessionRecap, formatSessionRecapMarkdown, sessionRecapCommand } from './commands/session-recap.js';
|
|
17
18
|
export { findNearestVaultPath, getVaultPath, resolveVaultPath } from './lib/config.js';
|
|
18
19
|
import { TaskStatus } from './lib/task-utils.js';
|
|
19
|
-
export { listDependentTasks, listSubtasks } from './lib/task-utils.js';
|
|
20
|
+
export { completeTask, listDependentTasks, listSubtasks, updateTask } from './lib/task-utils.js';
|
|
20
21
|
export { CLAWVAULT_SERVE_PATH, DEFAULT_SERVE_PORT, ServeInstance, TailscalePeer, TailscaleServeConfig, TailscaleStatus, TailscaleSyncOptions, TailscaleSyncResult, VaultFileEntry, VaultManifest, checkPeerClawVault, compareManifests, configureTailscaleServe, discoverClawVaultPeers, fetchRemoteFile, fetchRemoteManifest, findPeer, generateVaultManifest, getOnlinePeers, getTailscaleStatus, getTailscaleVersion, hasTailscale, pushFileToRemote, resolvePeerIP, serveVault, stopTailscaleServe, syncWithPeer } from './lib/tailscale.js';
|
|
21
22
|
export { TailscaleDiscoverCommandOptions, TailscaleServeCommandOptions, TailscaleStatusCommandOptions, TailscaleSyncCommandOptions, registerTailscaleCommands, registerTailscaleDiscoverCommand, registerTailscaleServeCommand, registerTailscaleStatusCommand, registerTailscaleSyncCommand, tailscaleDiscoverCommand, tailscaleServeCommand, tailscaleStatusCommand, tailscaleSyncCommand } from './commands/tailscale.js';
|
|
22
23
|
export { TemplateVariables, buildTemplateVariables, renderTemplate } from './lib/template-engine.js';
|
|
24
|
+
export { Project, ProjectFrontmatter, ProjectStatus, archiveProject, createProject, getProjectActivity, getProjectTasks, listProjects, readProject, updateProject } from './lib/project-utils.js';
|
|
23
25
|
import 'child_process';
|
|
24
26
|
import 'http';
|
|
25
27
|
|
|
@@ -291,12 +293,14 @@ declare function extractWikiLinks(content: string): string[];
|
|
|
291
293
|
declare function extractTags(content: string): string[];
|
|
292
294
|
|
|
293
295
|
declare const OBSERVE_PROVIDERS: readonly ["anthropic", "openai", "gemini"];
|
|
296
|
+
declare const OBSERVER_COMPRESSION_PROVIDERS: readonly ["anthropic", "openai", "gemini", "openai-compatible", "ollama"];
|
|
294
297
|
declare const THEMES: readonly ["neural", "minimal", "none"];
|
|
295
298
|
declare const CONTEXT_PROFILES: readonly ["default", "planning", "incident", "handoff", "auto"];
|
|
296
299
|
type ObserveProvider = (typeof OBSERVE_PROVIDERS)[number];
|
|
300
|
+
type ObserverCompressionProvider = (typeof OBSERVER_COMPRESSION_PROVIDERS)[number];
|
|
297
301
|
type Theme = (typeof THEMES)[number];
|
|
298
302
|
type ContextProfile = (typeof CONTEXT_PROFILES)[number];
|
|
299
|
-
type ManagedConfigKey = 'name' | 'categories' | 'theme' | 'observe.model' | 'observe.provider' | 'context.maxResults' | 'context.defaultProfile' | 'graph.maxHops';
|
|
303
|
+
type ManagedConfigKey = 'name' | 'categories' | 'theme' | 'observe.model' | 'observe.provider' | 'observer.compression.provider' | 'observer.compression.model' | 'observer.compression.baseUrl' | 'observer.compression.apiKey' | 'context.maxResults' | 'context.defaultProfile' | 'graph.maxHops' | 'inject.maxResults' | 'inject.useLlm' | 'inject.scope';
|
|
300
304
|
interface RouteRule {
|
|
301
305
|
pattern: string;
|
|
302
306
|
target: string;
|
|
@@ -304,6 +308,7 @@ interface RouteRule {
|
|
|
304
308
|
}
|
|
305
309
|
declare const SUPPORTED_CONFIG_KEYS: ManagedConfigKey[];
|
|
306
310
|
declare function listConfig(vaultPath: string): Record<string, unknown>;
|
|
311
|
+
declare function getConfig(vaultPath: string): Record<string, unknown>;
|
|
307
312
|
declare function getConfigValue(vaultPath: string, key: ManagedConfigKey): unknown;
|
|
308
313
|
declare function setConfigValue(vaultPath: string, key: ManagedConfigKey, value: unknown): {
|
|
309
314
|
value: unknown;
|
|
@@ -316,63 +321,6 @@ declare function removeRouteRule(vaultPath: string, pattern: string): boolean;
|
|
|
316
321
|
declare function matchRouteRule(text: string, routes: RouteRule[]): RouteRule | null;
|
|
317
322
|
declare function testRouteRule(vaultPath: string, text: string): RouteRule | null;
|
|
318
323
|
|
|
319
|
-
declare const MEMORY_GRAPH_SCHEMA_VERSION = 1;
|
|
320
|
-
type NodeCategory = 'note' | 'daily' | 'observation' | 'handoff' | 'decision' | 'lesson' | 'project' | 'person' | 'commitment' | 'tag' | 'unresolved';
|
|
321
|
-
type MemoryGraphNodeType = NodeCategory;
|
|
322
|
-
type MemoryGraphEdgeType = 'wiki_link' | 'tag' | 'frontmatter_relation';
|
|
323
|
-
interface MemoryGraphNode {
|
|
324
|
-
id: string;
|
|
325
|
-
title: string;
|
|
326
|
-
type: MemoryGraphNodeType;
|
|
327
|
-
category: string;
|
|
328
|
-
path: string | null;
|
|
329
|
-
tags: string[];
|
|
330
|
-
missing: boolean;
|
|
331
|
-
degree: number;
|
|
332
|
-
modifiedAt: string | null;
|
|
333
|
-
}
|
|
334
|
-
interface MemoryGraphEdge {
|
|
335
|
-
id: string;
|
|
336
|
-
source: string;
|
|
337
|
-
target: string;
|
|
338
|
-
type: MemoryGraphEdgeType;
|
|
339
|
-
label?: string;
|
|
340
|
-
}
|
|
341
|
-
interface MemoryGraphStats {
|
|
342
|
-
generatedAt: string;
|
|
343
|
-
nodeCount: number;
|
|
344
|
-
edgeCount: number;
|
|
345
|
-
nodeTypeCounts: Record<string, number>;
|
|
346
|
-
edgeTypeCounts: Record<string, number>;
|
|
347
|
-
}
|
|
348
|
-
interface MemoryGraph {
|
|
349
|
-
schemaVersion: number;
|
|
350
|
-
nodes: MemoryGraphNode[];
|
|
351
|
-
edges: MemoryGraphEdge[];
|
|
352
|
-
stats: MemoryGraphStats;
|
|
353
|
-
}
|
|
354
|
-
interface MemoryGraphFileFragment {
|
|
355
|
-
relativePath: string;
|
|
356
|
-
mtimeMs: number;
|
|
357
|
-
nodes: MemoryGraphNode[];
|
|
358
|
-
edges: MemoryGraphEdge[];
|
|
359
|
-
}
|
|
360
|
-
interface MemoryGraphIndex {
|
|
361
|
-
schemaVersion: number;
|
|
362
|
-
vaultPath: string;
|
|
363
|
-
generatedAt: string;
|
|
364
|
-
files: Record<string, MemoryGraphFileFragment>;
|
|
365
|
-
graph: MemoryGraph;
|
|
366
|
-
}
|
|
367
|
-
interface BuildGraphIndexOptions {
|
|
368
|
-
forceFull?: boolean;
|
|
369
|
-
}
|
|
370
|
-
declare function loadMemoryGraphIndex(vaultPath: string): MemoryGraphIndex | null;
|
|
371
|
-
declare function buildOrUpdateMemoryGraphIndex(vaultPathInput: string, options?: BuildGraphIndexOptions): Promise<MemoryGraphIndex>;
|
|
372
|
-
declare function getMemoryGraph(vaultPath: string, options?: {
|
|
373
|
-
refresh?: boolean;
|
|
374
|
-
}): Promise<MemoryGraph>;
|
|
375
|
-
|
|
376
324
|
/**
|
|
377
325
|
* Transition Ledger for ClawVault
|
|
378
326
|
* Logs task status transitions to JSONL files and supports querying.
|
|
@@ -421,6 +369,68 @@ declare function countBlockedTransitions(vaultPath: string, taskId: string): num
|
|
|
421
369
|
*/
|
|
422
370
|
declare function formatTransitionsTable(events: TransitionEvent[]): string;
|
|
423
371
|
|
|
372
|
+
interface CompressorOptions {
|
|
373
|
+
provider?: CompressionProvider;
|
|
374
|
+
model?: string;
|
|
375
|
+
baseUrl?: string;
|
|
376
|
+
apiKey?: string;
|
|
377
|
+
now?: () => Date;
|
|
378
|
+
fetchImpl?: typeof fetch;
|
|
379
|
+
}
|
|
380
|
+
type CompressionProvider = 'anthropic' | 'openai' | 'gemini' | 'openai-compatible' | 'ollama';
|
|
381
|
+
declare class Compressor {
|
|
382
|
+
private readonly provider?;
|
|
383
|
+
private readonly model?;
|
|
384
|
+
private readonly baseUrl?;
|
|
385
|
+
private readonly apiKey?;
|
|
386
|
+
private readonly now;
|
|
387
|
+
private readonly fetchImpl;
|
|
388
|
+
constructor(options?: CompressorOptions);
|
|
389
|
+
compress(messages: string[], existingObservations: string): Promise<string>;
|
|
390
|
+
private resolveProvider;
|
|
391
|
+
private resolveConfiguredProvider;
|
|
392
|
+
private resolveProviderFromEnv;
|
|
393
|
+
private resolveModel;
|
|
394
|
+
private resolveApiKey;
|
|
395
|
+
private resolveBaseUrl;
|
|
396
|
+
private readEnvValue;
|
|
397
|
+
private buildPrompt;
|
|
398
|
+
private buildOpenAICompatibleUrl;
|
|
399
|
+
private buildOpenAICompatibleHeaders;
|
|
400
|
+
private extractOpenAIContent;
|
|
401
|
+
private callAnthropic;
|
|
402
|
+
private callOpenAI;
|
|
403
|
+
private callOpenAICompatible;
|
|
404
|
+
private callGemini;
|
|
405
|
+
private normalizeLlmOutput;
|
|
406
|
+
/**
|
|
407
|
+
* Fix wiki-link corruption from LLM compression.
|
|
408
|
+
* LLMs often fuse preceding word fragments into wiki-links during rewriting:
|
|
409
|
+
* "reque[[people/pedro]]" → "[[people/pedro]]"
|
|
410
|
+
* "Linke[[agents/zeca]]" → "[[agents/zeca]]"
|
|
411
|
+
* "taske[[people/pedro]]a" → "[[people/pedro]]"
|
|
412
|
+
* Also fixes trailing word fragments fused after closing brackets.
|
|
413
|
+
*/
|
|
414
|
+
private sanitizeWikiLinks;
|
|
415
|
+
private enforceImportanceRules;
|
|
416
|
+
private enforceImportanceForRecord;
|
|
417
|
+
private fallbackCompression;
|
|
418
|
+
private mergeObservations;
|
|
419
|
+
private mergeRecord;
|
|
420
|
+
private renderSections;
|
|
421
|
+
private inferImportance;
|
|
422
|
+
private inferConfidence;
|
|
423
|
+
private isCriticalContent;
|
|
424
|
+
private isNotableContent;
|
|
425
|
+
private inferTaskType;
|
|
426
|
+
private normalizeText;
|
|
427
|
+
private extractDate;
|
|
428
|
+
private extractTime;
|
|
429
|
+
private formatDate;
|
|
430
|
+
private formatTime;
|
|
431
|
+
private clamp01;
|
|
432
|
+
}
|
|
433
|
+
|
|
424
434
|
interface ObserverCompressor {
|
|
425
435
|
compress(messages: string[], existingObservations: string): Promise<string>;
|
|
426
436
|
}
|
|
@@ -431,6 +441,9 @@ interface ObserverOptions {
|
|
|
431
441
|
tokenThreshold?: number;
|
|
432
442
|
reflectThreshold?: number;
|
|
433
443
|
model?: string;
|
|
444
|
+
compressionProvider?: CompressionProvider;
|
|
445
|
+
compressionBaseUrl?: string;
|
|
446
|
+
compressionApiKey?: string;
|
|
434
447
|
compressor?: ObserverCompressor;
|
|
435
448
|
reflector?: ObserverReflector;
|
|
436
449
|
now?: () => Date;
|
|
@@ -478,51 +491,6 @@ declare class Observer {
|
|
|
478
491
|
private mergeRouteContext;
|
|
479
492
|
}
|
|
480
493
|
|
|
481
|
-
interface CompressorOptions {
|
|
482
|
-
model?: string;
|
|
483
|
-
now?: () => Date;
|
|
484
|
-
fetchImpl?: typeof fetch;
|
|
485
|
-
}
|
|
486
|
-
declare class Compressor {
|
|
487
|
-
private readonly model?;
|
|
488
|
-
private readonly now;
|
|
489
|
-
private readonly fetchImpl;
|
|
490
|
-
constructor(options?: CompressorOptions);
|
|
491
|
-
compress(messages: string[], existingObservations: string): Promise<string>;
|
|
492
|
-
private resolveProvider;
|
|
493
|
-
private buildPrompt;
|
|
494
|
-
private callAnthropic;
|
|
495
|
-
private callOpenAI;
|
|
496
|
-
private callGemini;
|
|
497
|
-
private normalizeLlmOutput;
|
|
498
|
-
/**
|
|
499
|
-
* Fix wiki-link corruption from LLM compression.
|
|
500
|
-
* LLMs often fuse preceding word fragments into wiki-links during rewriting:
|
|
501
|
-
* "reque[[people/pedro]]" → "[[people/pedro]]"
|
|
502
|
-
* "Linke[[agents/zeca]]" → "[[agents/zeca]]"
|
|
503
|
-
* "taske[[people/pedro]]a" → "[[people/pedro]]"
|
|
504
|
-
* Also fixes trailing word fragments fused after closing brackets.
|
|
505
|
-
*/
|
|
506
|
-
private sanitizeWikiLinks;
|
|
507
|
-
private enforceImportanceRules;
|
|
508
|
-
private enforceImportanceForRecord;
|
|
509
|
-
private fallbackCompression;
|
|
510
|
-
private mergeObservations;
|
|
511
|
-
private mergeRecord;
|
|
512
|
-
private renderSections;
|
|
513
|
-
private inferImportance;
|
|
514
|
-
private inferConfidence;
|
|
515
|
-
private isCriticalContent;
|
|
516
|
-
private isNotableContent;
|
|
517
|
-
private inferTaskType;
|
|
518
|
-
private normalizeText;
|
|
519
|
-
private extractDate;
|
|
520
|
-
private extractTime;
|
|
521
|
-
private formatDate;
|
|
522
|
-
private formatTime;
|
|
523
|
-
private clamp01;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
494
|
interface ReflectorOptions {
|
|
527
495
|
now?: () => Date;
|
|
528
496
|
}
|
|
@@ -625,4 +593,4 @@ declare function runReflection(options: ReflectOptions): Promise<ReflectResult>;
|
|
|
625
593
|
declare const VERSION: string;
|
|
626
594
|
declare function registerCommanderCommands(program: Command): Command;
|
|
627
595
|
|
|
628
|
-
export { type ArchiveObservationsOptions, type ArchiveObservationsResult, Category, ClawVault, Compressor, type CompressorOptions, type ContextProfile as ConfigDefaultProfile, Document, HandoffDocument,
|
|
596
|
+
export { type ArchiveObservationsOptions, type ArchiveObservationsResult, Category, ClawVault, type CompressionProvider, Compressor, type CompressorOptions, type ContextProfile as ConfigDefaultProfile, Document, HandoffDocument, type ManagedConfigKey, MemoryType, type ObserveProvider, Observer, type ObserverCompressionProvider, type ObserverCompressor, type ObserverOptions, type ObserverReflector, QMD_INSTALL_COMMAND, QMD_INSTALL_URL, QmdUnavailableError, type ReflectOptions, type ReflectResult, Reflector, type ReflectorOptions, type RouteRule, SUPPORTED_CONFIG_KEYS, SearchEngine, SearchOptions, SearchResult, SessionRecap, SessionWatcher, type SessionWatcherOptions, StoreOptions, SyncOptions, SyncResult, type Theme, type TransitionEvent, VERSION, VaultConfig, addRouteRule, appendTransition, archiveObservations, buildTransitionEvent, countBlockedTransitions, createVault, extractTags, extractWikiLinks, findVault, formatTransitionsTable, getConfig, getConfigValue, hasQmd, isRegression, listConfig, listRouteRules, matchRouteRule, parseSessionFile, qmdEmbed, qmdUpdate, queryTransitions, readAllTransitions, registerCommanderCommands, removeRouteRule, resetConfig, runReflection, setConfigValue, testRouteRule };
|