@hyperwindmill/caretaker-cli 0.22.0 → 0.24.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/dist/cli/web/scheduler/locks.d.ts +3 -3
- package/dist/cli/web/scheduler/memory_extract.d.ts +55 -0
- package/dist/cli/web/scheduler/memory_extract.d.ts.map +1 -0
- package/dist/cli/web/scheduler/memory_extract.js +112 -0
- package/dist/cli/web/scheduler/memory_sweep.d.ts +68 -0
- package/dist/cli/web/scheduler/memory_sweep.d.ts.map +1 -0
- package/dist/cli/web/scheduler/memory_sweep.js +329 -0
- package/dist/cli/web/scheduler/task_review.d.ts +3 -0
- package/dist/cli/web/scheduler/task_review.d.ts.map +1 -1
- package/dist/cli/web/scheduler/task_review.js +1 -0
- package/dist/cli/web/scheduler/task_roles.js +1 -1
- package/dist/cli/web/scheduler/task_strategy.d.ts.map +1 -1
- package/dist/cli/web/scheduler/task_strategy.js +8 -4
- package/dist/cli/web/scheduler.d.ts.map +1 -1
- package/dist/cli/web/scheduler.js +5 -0
- package/dist/cli/web/server.d.ts.map +1 -1
- package/dist/cli/web/server.js +67 -27
- package/dist/harness/claude_code_runner.d.ts.map +1 -1
- package/dist/harness/claude_code_runner.js +5 -0
- package/dist/harness/loop.d.ts +9 -0
- package/dist/harness/loop.d.ts.map +1 -1
- package/dist/harness/loop.js +10 -0
- package/dist/harness/memory_recall.d.ts +23 -0
- package/dist/harness/memory_recall.d.ts.map +1 -0
- package/dist/harness/memory_recall.js +70 -0
- package/dist/harness/tools/builtin/index.d.ts +2 -1
- package/dist/harness/tools/builtin/index.d.ts.map +1 -1
- package/dist/harness/tools/builtin/index.js +4 -1
- package/dist/harness/tools/builtin/memory_tools.d.ts +3 -0
- package/dist/harness/tools/builtin/memory_tools.d.ts.map +1 -0
- package/dist/harness/tools/builtin/memory_tools.js +60 -0
- package/dist/harness/tools/builtin/task_tools.js +37 -37
- package/dist/harness/tools/resolve.d.ts.map +1 -1
- package/dist/harness/tools/resolve.js +15 -0
- package/dist/harness/tools/types.d.ts +6 -0
- package/dist/harness/tools/types.d.ts.map +1 -1
- package/dist/lib/docker.d.ts +1 -1
- package/dist/lib/docker.d.ts.map +1 -1
- package/dist/lib/docker.js +2 -2
- package/dist/lib/project_resolve.d.ts +5 -0
- package/dist/lib/project_resolve.d.ts.map +1 -0
- package/dist/lib/project_resolve.js +23 -0
- package/dist/lib/project_slug.d.ts +29 -0
- package/dist/lib/project_slug.d.ts.map +1 -0
- package/dist/lib/project_slug.js +41 -0
- package/dist/lib/task_git.d.ts +5 -5
- package/dist/lib/task_git.d.ts.map +1 -1
- package/dist/lib/task_git.js +8 -6
- package/dist/mcp/builtin_server.d.ts +1 -0
- package/dist/mcp/builtin_server.d.ts.map +1 -1
- package/dist/mcp/builtin_server.js +6 -5
- package/dist/store/db.d.ts +78 -7
- package/dist/store/db.d.ts.map +1 -1
- package/dist/store/db.js +127 -15
- package/dist/store/json.d.ts +1 -0
- package/dist/store/json.d.ts.map +1 -1
- package/dist/store/json.js +6 -1
- package/dist/tui/agents.js +5 -2
- package/dist/webview/standalone.js +602 -434
- package/dist/webview/standalone.js.map +4 -4
- package/package.json +3 -3
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Agent-facing memory tools. Named `mcp__memory__*` so the shared builtin MCP
|
|
2
|
+
// server (mcp/builtin_server.ts) picks them up by prefix and serves them over
|
|
3
|
+
// both the stdio subcommand and the per-task HTTP bridge, exactly like the
|
|
4
|
+
// `mcp__task__*` set. Native agents opt in via allowedTools (the
|
|
5
|
+
// `mcp__<ns>__*` wildcard is generic in resolveAgentTools and the pickers).
|
|
6
|
+
//
|
|
7
|
+
// memory_read is THE recall event of the memory subsystem: every delivered id
|
|
8
|
+
// bumps the memory's acquired strength (recallCount / lastRecalledAt) — the
|
|
9
|
+
// signal the future consolidation/decay feeds on. That is why the prelude
|
|
10
|
+
// injects titles only: a system that always injects bodies never learns what
|
|
11
|
+
// mattered. Read-only w.r.t. content — no planner deny needed.
|
|
12
|
+
// See docs/superpowers/specs/2026-08-25-memory-daemon-step3-recall-design.md
|
|
13
|
+
import { listMemories, bumpMemoryRecall } from '../../../store/db.js';
|
|
14
|
+
export const memoryReadTool = {
|
|
15
|
+
name: 'mcp__memory__memory_read',
|
|
16
|
+
// Auto-included by resolveAgentTools when MemoryConfig is present (the
|
|
17
|
+
// same gate as the <memories> prelude block) — never a picker choice.
|
|
18
|
+
hidden: true,
|
|
19
|
+
description: 'Read the full content of stored memories by id. Ids come from the <memories> block in the system prompt. Reading a memory reinforces it (recall statistics are updated), so read the ones actually relevant, not all of them.',
|
|
20
|
+
parameters: {
|
|
21
|
+
type: 'object',
|
|
22
|
+
properties: {
|
|
23
|
+
ids: {
|
|
24
|
+
type: 'array',
|
|
25
|
+
items: { type: 'string' },
|
|
26
|
+
description: 'Memory ids to read.',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
required: ['ids'],
|
|
30
|
+
additionalProperties: false,
|
|
31
|
+
},
|
|
32
|
+
execute: async (args, _ctx) => {
|
|
33
|
+
const ids = Array.isArray(args?.ids)
|
|
34
|
+
? args.ids.filter((v) => typeof v === 'string' && v.trim() !== '')
|
|
35
|
+
: [];
|
|
36
|
+
if (ids.length === 0)
|
|
37
|
+
throw new Error('memory_read requires a non-empty `ids` array');
|
|
38
|
+
const byId = new Map((await listMemories()).map((m) => [m.id, m]));
|
|
39
|
+
const memories = [];
|
|
40
|
+
const missing = [];
|
|
41
|
+
for (const id of ids) {
|
|
42
|
+
const m = byId.get(id);
|
|
43
|
+
if (!m) {
|
|
44
|
+
missing.push(id);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
await bumpMemoryRecall(id);
|
|
48
|
+
memories.push({
|
|
49
|
+
id: m.id,
|
|
50
|
+
title: m.title,
|
|
51
|
+
body: m.body,
|
|
52
|
+
kind: m.kind,
|
|
53
|
+
importance: m.importance,
|
|
54
|
+
projectId: m.projectId,
|
|
55
|
+
createdAt: m.createdAt,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return { content: JSON.stringify({ memories, missing }) };
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -17,19 +17,19 @@ export const getTaskStateTool = {
|
|
|
17
17
|
parameters: {
|
|
18
18
|
type: 'object',
|
|
19
19
|
properties: {
|
|
20
|
-
task_id: { type: '
|
|
20
|
+
task_id: { type: 'string' },
|
|
21
21
|
},
|
|
22
22
|
required: ['task_id'],
|
|
23
23
|
},
|
|
24
24
|
execute: async (args) => {
|
|
25
25
|
const db = getDb();
|
|
26
|
-
const taskId =
|
|
26
|
+
const taskId = String(args.task_id);
|
|
27
27
|
const task = await getTaskById(taskId);
|
|
28
28
|
if (!task)
|
|
29
29
|
return err(`Task ${taskId} not found`);
|
|
30
30
|
const config = await loadConfig();
|
|
31
31
|
const project = (config.projects || []).find((p) => p.id === task.projectId) || null;
|
|
32
|
-
const messages = (await db.query(`SELECT * FROM task_messages WHERE taskId = ${taskId}`));
|
|
32
|
+
const messages = (await db.query(`SELECT * FROM task_messages WHERE taskId = '${taskId}'`));
|
|
33
33
|
messages.sort((a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime());
|
|
34
34
|
return {
|
|
35
35
|
content: JSON.stringify({
|
|
@@ -66,7 +66,7 @@ export const updateChecklistItemTool = {
|
|
|
66
66
|
parameters: {
|
|
67
67
|
type: 'object',
|
|
68
68
|
properties: {
|
|
69
|
-
task_id: { type: '
|
|
69
|
+
task_id: { type: 'string' },
|
|
70
70
|
item_id: { type: 'string' },
|
|
71
71
|
status: { type: 'string', enum: ['pending', 'in_progress', 'done', 'skipped'] },
|
|
72
72
|
},
|
|
@@ -74,7 +74,7 @@ export const updateChecklistItemTool = {
|
|
|
74
74
|
},
|
|
75
75
|
execute: async (args) => {
|
|
76
76
|
const db = getDb();
|
|
77
|
-
const taskId =
|
|
77
|
+
const taskId = String(args.task_id);
|
|
78
78
|
const itemId = String(args.item_id);
|
|
79
79
|
const statusInput = args.status;
|
|
80
80
|
const status = tryNormalizeChecklistStatus(statusInput);
|
|
@@ -97,7 +97,7 @@ export const updateChecklistTool = {
|
|
|
97
97
|
parameters: {
|
|
98
98
|
type: 'object',
|
|
99
99
|
properties: {
|
|
100
|
-
task_id: { type: '
|
|
100
|
+
task_id: { type: 'string' },
|
|
101
101
|
checklist: {
|
|
102
102
|
type: 'array',
|
|
103
103
|
items: {
|
|
@@ -115,7 +115,7 @@ export const updateChecklistTool = {
|
|
|
115
115
|
},
|
|
116
116
|
execute: async (args) => {
|
|
117
117
|
const db = getDb();
|
|
118
|
-
const taskId =
|
|
118
|
+
const taskId = String(args.task_id);
|
|
119
119
|
const checklistInput = args.checklist;
|
|
120
120
|
const task = await getTaskById(taskId);
|
|
121
121
|
if (!task)
|
|
@@ -146,14 +146,14 @@ export const taskUpdateDetailsTool = {
|
|
|
146
146
|
parameters: {
|
|
147
147
|
type: 'object',
|
|
148
148
|
properties: {
|
|
149
|
-
task_id: { type: '
|
|
149
|
+
task_id: { type: 'string' },
|
|
150
150
|
title: { type: 'string' },
|
|
151
151
|
objective: { type: 'string' },
|
|
152
152
|
},
|
|
153
153
|
required: ['task_id'],
|
|
154
154
|
},
|
|
155
155
|
execute: async (args) => {
|
|
156
|
-
const taskId =
|
|
156
|
+
const taskId = String(args.task_id);
|
|
157
157
|
const hasTitle = args.title !== undefined;
|
|
158
158
|
const hasObjective = args.objective !== undefined;
|
|
159
159
|
if (!hasTitle && !hasObjective)
|
|
@@ -214,14 +214,14 @@ export const addMessageTool = {
|
|
|
214
214
|
parameters: {
|
|
215
215
|
type: 'object',
|
|
216
216
|
properties: {
|
|
217
|
-
task_id: { type: '
|
|
217
|
+
task_id: { type: 'string' },
|
|
218
218
|
content: { type: 'string' },
|
|
219
219
|
},
|
|
220
220
|
required: ['task_id', 'content'],
|
|
221
221
|
},
|
|
222
222
|
execute: async (args) => {
|
|
223
223
|
const db = getDb();
|
|
224
|
-
const taskId =
|
|
224
|
+
const taskId = String(args.task_id);
|
|
225
225
|
const content = String(args.content);
|
|
226
226
|
await addTaskMessage({
|
|
227
227
|
taskId,
|
|
@@ -245,14 +245,14 @@ export const completeTaskTool = {
|
|
|
245
245
|
parameters: {
|
|
246
246
|
type: 'object',
|
|
247
247
|
properties: {
|
|
248
|
-
task_id: { type: '
|
|
248
|
+
task_id: { type: 'string' },
|
|
249
249
|
summary: { type: 'string' },
|
|
250
250
|
},
|
|
251
251
|
required: ['task_id'],
|
|
252
252
|
},
|
|
253
253
|
execute: async (args) => {
|
|
254
254
|
const db = getDb();
|
|
255
|
-
const taskId =
|
|
255
|
+
const taskId = String(args.task_id);
|
|
256
256
|
const summary = args.summary ? String(args.summary) : '';
|
|
257
257
|
const task = await getTaskById(taskId);
|
|
258
258
|
if (!task)
|
|
@@ -287,14 +287,14 @@ export const blockTaskTool = {
|
|
|
287
287
|
parameters: {
|
|
288
288
|
type: 'object',
|
|
289
289
|
properties: {
|
|
290
|
-
task_id: { type: '
|
|
290
|
+
task_id: { type: 'string' },
|
|
291
291
|
reason: { type: 'string' },
|
|
292
292
|
},
|
|
293
293
|
required: ['task_id', 'reason'],
|
|
294
294
|
},
|
|
295
295
|
execute: async (args) => {
|
|
296
296
|
const db = getDb();
|
|
297
|
-
const taskId =
|
|
297
|
+
const taskId = String(args.task_id);
|
|
298
298
|
const reason = String(args.reason);
|
|
299
299
|
const task = await getTaskById(taskId);
|
|
300
300
|
if (!task)
|
|
@@ -320,14 +320,14 @@ export const yieldTaskTool = {
|
|
|
320
320
|
parameters: {
|
|
321
321
|
type: 'object',
|
|
322
322
|
properties: {
|
|
323
|
-
task_id: { type: '
|
|
323
|
+
task_id: { type: 'string' },
|
|
324
324
|
notes: { type: 'string' },
|
|
325
325
|
},
|
|
326
326
|
required: ['task_id'],
|
|
327
327
|
},
|
|
328
328
|
execute: async (args) => {
|
|
329
329
|
const db = getDb();
|
|
330
|
-
const taskId =
|
|
330
|
+
const taskId = String(args.task_id);
|
|
331
331
|
const notes = args.notes ? String(args.notes) : '';
|
|
332
332
|
const task = await getTaskById(taskId);
|
|
333
333
|
if (!task)
|
|
@@ -380,7 +380,7 @@ export const taskCreateTool = {
|
|
|
380
380
|
parameters: {
|
|
381
381
|
type: 'object',
|
|
382
382
|
properties: {
|
|
383
|
-
project_id: { type: '
|
|
383
|
+
project_id: { type: 'string' },
|
|
384
384
|
title: { type: 'string' },
|
|
385
385
|
objective: { type: 'string' },
|
|
386
386
|
checklist: {
|
|
@@ -402,7 +402,7 @@ export const taskCreateTool = {
|
|
|
402
402
|
},
|
|
403
403
|
execute: async (args) => {
|
|
404
404
|
const db = getDb();
|
|
405
|
-
const projectId =
|
|
405
|
+
const projectId = String(args.project_id);
|
|
406
406
|
const title = String(args.title);
|
|
407
407
|
const objective = String(args.objective);
|
|
408
408
|
const checklistInput = args.checklist;
|
|
@@ -496,14 +496,14 @@ export const taskUnblockTool = {
|
|
|
496
496
|
parameters: {
|
|
497
497
|
type: 'object',
|
|
498
498
|
properties: {
|
|
499
|
-
task_id: { type: '
|
|
499
|
+
task_id: { type: 'string' },
|
|
500
500
|
message: { type: 'string' },
|
|
501
501
|
},
|
|
502
502
|
required: ['task_id'],
|
|
503
503
|
},
|
|
504
504
|
execute: async (args) => {
|
|
505
505
|
const db = getDb();
|
|
506
|
-
const taskId =
|
|
506
|
+
const taskId = String(args.task_id);
|
|
507
507
|
const message = args.message ? String(args.message) : '';
|
|
508
508
|
const task = await getTaskById(taskId);
|
|
509
509
|
if (!task)
|
|
@@ -533,13 +533,13 @@ export const taskActivateTool = {
|
|
|
533
533
|
parameters: {
|
|
534
534
|
type: 'object',
|
|
535
535
|
properties: {
|
|
536
|
-
task_id: { type: '
|
|
536
|
+
task_id: { type: 'string' },
|
|
537
537
|
},
|
|
538
538
|
required: ['task_id'],
|
|
539
539
|
},
|
|
540
540
|
execute: async (args) => {
|
|
541
541
|
const db = getDb();
|
|
542
|
-
const taskId =
|
|
542
|
+
const taskId = String(args.task_id);
|
|
543
543
|
const task = await getTaskById(taskId);
|
|
544
544
|
if (!task)
|
|
545
545
|
return err(`Task ${taskId} not found`);
|
|
@@ -566,14 +566,14 @@ export const taskUnpauseTool = {
|
|
|
566
566
|
parameters: {
|
|
567
567
|
type: 'object',
|
|
568
568
|
properties: {
|
|
569
|
-
task_id: { type: '
|
|
569
|
+
task_id: { type: 'string' },
|
|
570
570
|
message: { type: 'string' },
|
|
571
571
|
},
|
|
572
572
|
required: ['task_id'],
|
|
573
573
|
},
|
|
574
574
|
execute: async (args) => {
|
|
575
575
|
const db = getDb();
|
|
576
|
-
const taskId =
|
|
576
|
+
const taskId = String(args.task_id);
|
|
577
577
|
const message = args.message ? String(args.message) : '';
|
|
578
578
|
const task = await getTaskById(taskId);
|
|
579
579
|
if (!task)
|
|
@@ -603,12 +603,12 @@ export const taskDiscardWorktreeTool = {
|
|
|
603
603
|
parameters: {
|
|
604
604
|
type: 'object',
|
|
605
605
|
properties: {
|
|
606
|
-
task_id: { type: '
|
|
606
|
+
task_id: { type: 'string' },
|
|
607
607
|
},
|
|
608
608
|
required: ['task_id'],
|
|
609
609
|
},
|
|
610
610
|
execute: async (args) => {
|
|
611
|
-
const taskId =
|
|
611
|
+
const taskId = String(args.task_id);
|
|
612
612
|
const task = await getTaskById(taskId);
|
|
613
613
|
if (!task)
|
|
614
614
|
return err(`Task ${taskId} not found`);
|
|
@@ -646,12 +646,12 @@ export const taskArchiveTool = {
|
|
|
646
646
|
parameters: {
|
|
647
647
|
type: 'object',
|
|
648
648
|
properties: {
|
|
649
|
-
task_id: { type: '
|
|
649
|
+
task_id: { type: 'string' },
|
|
650
650
|
},
|
|
651
651
|
required: ['task_id'],
|
|
652
652
|
},
|
|
653
653
|
execute: async (args) => {
|
|
654
|
-
const taskId =
|
|
654
|
+
const taskId = String(args.task_id);
|
|
655
655
|
const task = await getTaskById(taskId);
|
|
656
656
|
if (!task)
|
|
657
657
|
return err(`Task ${taskId} not found`);
|
|
@@ -678,12 +678,12 @@ export const taskUnarchiveTool = {
|
|
|
678
678
|
parameters: {
|
|
679
679
|
type: 'object',
|
|
680
680
|
properties: {
|
|
681
|
-
task_id: { type: '
|
|
681
|
+
task_id: { type: 'string' },
|
|
682
682
|
},
|
|
683
683
|
required: ['task_id'],
|
|
684
684
|
},
|
|
685
685
|
execute: async (args) => {
|
|
686
|
-
const taskId =
|
|
686
|
+
const taskId = String(args.task_id);
|
|
687
687
|
const task = await getTaskById(taskId);
|
|
688
688
|
if (!task)
|
|
689
689
|
return err(`Task ${taskId} not found`);
|
|
@@ -706,12 +706,12 @@ export const taskDeleteTool = {
|
|
|
706
706
|
parameters: {
|
|
707
707
|
type: 'object',
|
|
708
708
|
properties: {
|
|
709
|
-
task_id: { type: '
|
|
709
|
+
task_id: { type: 'string' },
|
|
710
710
|
},
|
|
711
711
|
required: ['task_id'],
|
|
712
712
|
},
|
|
713
713
|
execute: async (args) => {
|
|
714
|
-
const taskId =
|
|
714
|
+
const taskId = String(args.task_id);
|
|
715
715
|
const task = await getTaskById(taskId);
|
|
716
716
|
if (!task)
|
|
717
717
|
return err(`Task ${taskId} not found`);
|
|
@@ -764,7 +764,7 @@ export const taskSetAgentTool = {
|
|
|
764
764
|
parameters: {
|
|
765
765
|
type: 'object',
|
|
766
766
|
properties: {
|
|
767
|
-
task_id: { type: '
|
|
767
|
+
task_id: { type: 'string' },
|
|
768
768
|
agent_id: { type: 'string', description: 'The agent ID to assign, or null to clear the override.' },
|
|
769
769
|
role: {
|
|
770
770
|
type: 'string',
|
|
@@ -775,7 +775,7 @@ export const taskSetAgentTool = {
|
|
|
775
775
|
required: ['task_id'],
|
|
776
776
|
},
|
|
777
777
|
execute: async (args) => {
|
|
778
|
-
const taskId =
|
|
778
|
+
const taskId = String(args.task_id);
|
|
779
779
|
const agentId = args.agent_id != null ? String(args.agent_id) : null;
|
|
780
780
|
const role = args.role === 'planner' || args.role === 'reviewer' ? args.role : 'developer';
|
|
781
781
|
const task = await getTaskById(taskId);
|
|
@@ -810,13 +810,13 @@ export const submitPlanTool = {
|
|
|
810
810
|
parameters: {
|
|
811
811
|
type: 'object',
|
|
812
812
|
properties: {
|
|
813
|
-
task_id: { type: '
|
|
813
|
+
task_id: { type: 'string' },
|
|
814
814
|
plan: { type: 'string', description: 'The full implementation plan, markdown.' },
|
|
815
815
|
},
|
|
816
816
|
required: ['task_id', 'plan'],
|
|
817
817
|
},
|
|
818
818
|
execute: async (args) => {
|
|
819
|
-
const taskId =
|
|
819
|
+
const taskId = String(args.task_id);
|
|
820
820
|
const plan = String(args.plan ?? '').trim();
|
|
821
821
|
if (!plan)
|
|
822
822
|
return err('Plan must not be empty.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/harness/tools/resolve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/harness/tools/resolve.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAkBvC,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,IAAI,EAAE,CAAC,CAqCjB"}
|
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
// (`list_commands`/`invoke_command`) access tools are added even if
|
|
9
9
|
// the user did not list them in allowedTools — they are useless
|
|
10
10
|
// without an active plugin and noisy if shown without one.
|
|
11
|
+
// - Memory-gated builtin: when `MemoryConfig` is present in caretaker.json,
|
|
12
|
+
// `mcp__memory__memory_read` is added. Same gate as the `<memories>`
|
|
13
|
+
// prelude block — the tool is the other half of that harness channel,
|
|
14
|
+
// not an agent capability. It is hidden from the pickers (Tool.hidden),
|
|
15
|
+
// so there is no user-chosen off state to contradict; the user-visible
|
|
16
|
+
// switch is MemoryConfig itself.
|
|
11
17
|
// - MCP tools: when the agent references MCP servers, their tools/list
|
|
12
18
|
// output is fetched via the adapter and appended (names already
|
|
13
19
|
// namespaced as `mcp__<id>__<toolName>`).
|
|
@@ -22,9 +28,11 @@
|
|
|
22
28
|
// them per-run because the remote tool list can change between runs and we
|
|
23
29
|
// don't want stale entries cluttering autocomplete or test fixtures.
|
|
24
30
|
import { mcpToolsForServers } from '../../mcp/adapter.js';
|
|
31
|
+
import { loadConfig } from '../../store/json.js';
|
|
25
32
|
const SKILL_TOOL_NAMES = ['list_skills', 'read_skill'];
|
|
26
33
|
const COMMAND_TOOL_NAMES = ['list_commands', 'invoke_command'];
|
|
27
34
|
const ALWAYS_ON_TOOL_NAMES = ['get_agent_context'];
|
|
35
|
+
const MEMORY_TOOL_NAMES = ['mcp__memory__memory_read'];
|
|
28
36
|
function autoInclude(tools, registry, names) {
|
|
29
37
|
const have = new Set(tools.map((t) => t.name));
|
|
30
38
|
for (const name of names) {
|
|
@@ -56,6 +64,13 @@ export async function resolveAgentTools(agent, registry) {
|
|
|
56
64
|
autoInclude(tools, registry, SKILL_TOOL_NAMES);
|
|
57
65
|
autoInclude(tools, registry, COMMAND_TOOL_NAMES);
|
|
58
66
|
}
|
|
67
|
+
try {
|
|
68
|
+
if ((await loadConfig()).memory)
|
|
69
|
+
autoInclude(tools, registry, MEMORY_TOOL_NAMES);
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
// Unreadable config → no memory tier this run; never fail tool resolution.
|
|
73
|
+
}
|
|
59
74
|
const mcpIds = agent.mcpServers ?? [];
|
|
60
75
|
if (mcpIds.length > 0) {
|
|
61
76
|
const mcp = await mcpToolsForServers(mcpIds);
|
|
@@ -65,6 +65,12 @@ export interface Tool {
|
|
|
65
65
|
/** Resolves the tool. Throws are caught by the loop and surfaced as
|
|
66
66
|
* "Error: <msg>" tool results. */
|
|
67
67
|
execute: (args: unknown, ctx: ToolContext) => Promise<ToolResult>;
|
|
68
|
+
/** Harness infrastructure, not an agent capability: excluded from the
|
|
69
|
+
* tool pickers because resolveAgentTools auto-includes it behind its own
|
|
70
|
+
* gate (e.g. memory_read behind MemoryConfig) — offering a checkbox the
|
|
71
|
+
* runtime overrides would be the UI/runtime mismatch the pickers exist
|
|
72
|
+
* to prevent. */
|
|
73
|
+
hidden?: boolean;
|
|
68
74
|
/** Marks tools whose action mutates the system or has side effects
|
|
69
75
|
* (file write, command exec, network mutation). The harness may surface
|
|
70
76
|
* a confirm prompt for these in a future iteration; today purely
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/harness/tools/types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC3D,MAAM,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;AAoBhG,MAAM,WAAW,WAAW;IAC1B;6EACyE;IACzE,MAAM,EAAE,WAAW,CAAC;IACpB,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IACnB;;;yCAGqC;IACrC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB;;;kFAG8E;IAC9E,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;;gFAG4E;IAC5E,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;kDAE8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;oCAEgC;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;wEAEoE;IACpE,SAAS,CAAC,EAAE;QAAE,QAAQ,CAAC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I,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAClE;;;;sBAIkB;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;yBAGqB;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACrC,CAAC;CACH;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,kBAAkB,CAS3D"}
|
package/dist/lib/docker.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Deterministic container name for a task — the caller's naming policy. */
|
|
2
|
-
export declare function containerName(
|
|
2
|
+
export declare function containerName(taskId: string): string;
|
|
3
3
|
/** `docker run` argv. Mount is identical-path (`-v <root>:<root>`) so host and
|
|
4
4
|
* container agree on absolute paths. `--user` keeps written files owned by the
|
|
5
5
|
* host user (else root-owned files break the host WIP commit / review diff).
|
package/dist/lib/docker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docker.d.ts","sourceRoot":"","sources":["../../src/lib/docker.ts"],"names":[],"mappings":"AASA,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"docker.d.ts","sourceRoot":"","sources":["../../src/lib/docker.ts"],"names":[],"mappings":"AASA,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;;;;;;;;;;;;;gHAegH;AAChH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,OAAO,E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tB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,IAAI,CAAC,CAWf;AAKD,eAAO,MAAM,uBAAuB,ojBAYnC,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,GACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWzB;AAED;;;;;;wFAMwF;AACxF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAY5D"}
|
package/dist/lib/docker.js
CHANGED
|
@@ -6,8 +6,8 @@ import { promisify } from 'node:util';
|
|
|
6
6
|
import { commandEnv } from '../harness/tools/builtin/shell-env.js';
|
|
7
7
|
const exec = promisify(execFile);
|
|
8
8
|
/** Deterministic container name for a task — the caller's naming policy. */
|
|
9
|
-
export function containerName(
|
|
10
|
-
return `caretaker-task-${
|
|
9
|
+
export function containerName(taskId) {
|
|
10
|
+
return `caretaker-task-${taskId}`;
|
|
11
11
|
}
|
|
12
12
|
/** `docker run` argv. Mount is identical-path (`-v <root>:<root>`) so host and
|
|
13
13
|
* container agree on absolute paths. `--user` keeps written files owned by the
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ProjectConfig } from '../types.js';
|
|
2
|
+
/** Path-aware prefix match of `dir` against the configured projects'
|
|
3
|
+
* workingDir. Longest match wins (nested projects). '' = no project. */
|
|
4
|
+
export declare function resolveProjectIdForDir(dir: string, projects: ProjectConfig[]): string;
|
|
5
|
+
//# sourceMappingURL=project_resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project_resolve.d.ts","sourceRoot":"","sources":["../../src/lib/project_resolve.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;yEACyE;AACzE,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,MAAM,CAYrF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Host-side project resolution — scope ids are never chosen by a model.
|
|
2
|
+
// Shared by the memory write path (sweep extraction, via the session agent's
|
|
3
|
+
// workingDir) and the read path (recall, via the run's workingDir).
|
|
4
|
+
// See docs/superpowers/specs/2026-08-25-memory-daemon-step3-recall-design.md
|
|
5
|
+
import { isAbsolute, resolve, sep } from 'node:path';
|
|
6
|
+
/** Path-aware prefix match of `dir` against the configured projects'
|
|
7
|
+
* workingDir. Longest match wins (nested projects). '' = no project. */
|
|
8
|
+
export function resolveProjectIdForDir(dir, projects) {
|
|
9
|
+
if (!dir || !isAbsolute(dir))
|
|
10
|
+
return '';
|
|
11
|
+
const target = resolve(dir);
|
|
12
|
+
let best = null;
|
|
13
|
+
for (const p of projects) {
|
|
14
|
+
if (!p.workingDir || !isAbsolute(p.workingDir))
|
|
15
|
+
continue;
|
|
16
|
+
const projDir = resolve(p.workingDir);
|
|
17
|
+
if (target === projDir || target.startsWith(projDir + sep)) {
|
|
18
|
+
if (!best || projDir.length > best.len)
|
|
19
|
+
best = { id: p.id, len: projDir.length };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return best?.id ?? '';
|
|
23
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authoritative validation for project ids (slugs).
|
|
3
|
+
*
|
|
4
|
+
* Same contract as validateRepositoryUrl (lib/repo_url.ts): the webview may
|
|
5
|
+
* keep a copy of the regex for form feedback, but every write path into
|
|
6
|
+
* caretaker.json — POST /api/projects, the web server's saveConfig websocket
|
|
7
|
+
* handler, and the VSCode sidebar's saveConfig handler — must call THIS one,
|
|
8
|
+
* because clients can send any payload.
|
|
9
|
+
*
|
|
10
|
+
* The slug is embedded verbatim in docker container/image names, git ref
|
|
11
|
+
* names, and filesystem paths under ~/.caretaker/ (a trust boundary: the
|
|
12
|
+
* charset is what makes `..` and `/` unrepresentable). It must start AND end
|
|
13
|
+
* alphanumeric — the docker image reference grammar
|
|
14
|
+
* `[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*` rejects a component ending in a hyphen,
|
|
15
|
+
* so `foo-` would make `caretaker-project-foo-:latest` an invalid reference.
|
|
16
|
+
*
|
|
17
|
+
* Slugs are immutable after creation by construction: the two forms never
|
|
18
|
+
* change the id of an existing project and POST /api/projects only creates.
|
|
19
|
+
* A changed id arriving via saveConfig is indistinguishable from a
|
|
20
|
+
* delete+create, so it cannot be rejected here; the web handler additionally
|
|
21
|
+
* refuses to drop a project that still has tasks (Task 4).
|
|
22
|
+
*/
|
|
23
|
+
export declare const PROJECT_SLUG_RE: RegExp;
|
|
24
|
+
export declare function validateProjectSlug(id: string): string | null;
|
|
25
|
+
export declare function validateProjectIds(incoming: Array<{
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
}>): string | null;
|
|
29
|
+
//# sourceMappingURL=project_slug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project_slug.d.ts","sourceRoot":"","sources":["../../src/lib/project_slug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,eAAe,QAA2C,CAAC;AAExE,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK7D;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,MAAM,GAAG,IAAI,CAS/F"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authoritative validation for project ids (slugs).
|
|
3
|
+
*
|
|
4
|
+
* Same contract as validateRepositoryUrl (lib/repo_url.ts): the webview may
|
|
5
|
+
* keep a copy of the regex for form feedback, but every write path into
|
|
6
|
+
* caretaker.json — POST /api/projects, the web server's saveConfig websocket
|
|
7
|
+
* handler, and the VSCode sidebar's saveConfig handler — must call THIS one,
|
|
8
|
+
* because clients can send any payload.
|
|
9
|
+
*
|
|
10
|
+
* The slug is embedded verbatim in docker container/image names, git ref
|
|
11
|
+
* names, and filesystem paths under ~/.caretaker/ (a trust boundary: the
|
|
12
|
+
* charset is what makes `..` and `/` unrepresentable). It must start AND end
|
|
13
|
+
* alphanumeric — the docker image reference grammar
|
|
14
|
+
* `[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*` rejects a component ending in a hyphen,
|
|
15
|
+
* so `foo-` would make `caretaker-project-foo-:latest` an invalid reference.
|
|
16
|
+
*
|
|
17
|
+
* Slugs are immutable after creation by construction: the two forms never
|
|
18
|
+
* change the id of an existing project and POST /api/projects only creates.
|
|
19
|
+
* A changed id arriving via saveConfig is indistinguishable from a
|
|
20
|
+
* delete+create, so it cannot be rejected here; the web handler additionally
|
|
21
|
+
* refuses to drop a project that still has tasks (Task 4).
|
|
22
|
+
*/
|
|
23
|
+
export const PROJECT_SLUG_RE = /^[a-z0-9](?:[a-z0-9-]{0,37}[a-z0-9])?$/;
|
|
24
|
+
export function validateProjectSlug(id) {
|
|
25
|
+
if (!PROJECT_SLUG_RE.test(id)) {
|
|
26
|
+
return 'Project id must be 1-39 characters of a-z, 0-9 and hyphens, starting and ending with a letter or digit.';
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
export function validateProjectIds(incoming) {
|
|
31
|
+
const seen = new Set();
|
|
32
|
+
for (const p of incoming) {
|
|
33
|
+
const err = validateProjectSlug(String(p.id));
|
|
34
|
+
if (err)
|
|
35
|
+
return `Project "${p.name}": ${err}`;
|
|
36
|
+
if (seen.has(p.id))
|
|
37
|
+
return `Duplicate project id "${p.id}".`;
|
|
38
|
+
seen.add(p.id);
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
}
|
package/dist/lib/task_git.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare function pushBranch(worktreePath: string, branch: string, repo: {
|
|
|
6
6
|
token?: string | null;
|
|
7
7
|
}): Promise<void>;
|
|
8
8
|
export declare function projectWorkingDir(project: {
|
|
9
|
-
id:
|
|
9
|
+
id: string;
|
|
10
10
|
workingDir?: string | null;
|
|
11
11
|
repositoryUrl?: string | null;
|
|
12
12
|
}): string;
|
|
@@ -17,7 +17,7 @@ export declare function projectWorkingDir(project: {
|
|
|
17
17
|
* anything null must never be touched.
|
|
18
18
|
*/
|
|
19
19
|
export declare function managedRepoDir(project: {
|
|
20
|
-
id:
|
|
20
|
+
id: string;
|
|
21
21
|
workingDir?: string | null;
|
|
22
22
|
repositoryUrl?: string | null;
|
|
23
23
|
}): string | null;
|
|
@@ -27,7 +27,7 @@ export type ProjectRepoStatus = {
|
|
|
27
27
|
commit?: string;
|
|
28
28
|
};
|
|
29
29
|
export declare function projectRepoStatus(project: {
|
|
30
|
-
id:
|
|
30
|
+
id: string;
|
|
31
31
|
workingDir?: string | null;
|
|
32
32
|
repositoryUrl?: string | null;
|
|
33
33
|
}): Promise<ProjectRepoStatus>;
|
|
@@ -42,7 +42,7 @@ export type SyncProgress = {
|
|
|
42
42
|
* callers turn that into a blocked task / in-band error line.
|
|
43
43
|
*/
|
|
44
44
|
export declare function syncProjectRepo(project: {
|
|
45
|
-
id:
|
|
45
|
+
id: string;
|
|
46
46
|
workingDir?: string | null;
|
|
47
47
|
repositoryUrl?: string | null;
|
|
48
48
|
repositoryToken?: string | null;
|
|
@@ -56,7 +56,7 @@ export declare function syncProjectRepo(project: {
|
|
|
56
56
|
*/
|
|
57
57
|
export declare function gitCommonDir(worktreePath: string): Promise<string | null>;
|
|
58
58
|
export declare function agentDirIn(worktreePath: string, projectWorkingDir: string): Promise<string>;
|
|
59
|
-
export declare function ensureWorktree(projectWorkingDir: string,
|
|
59
|
+
export declare function ensureWorktree(projectWorkingDir: string, taskId: string, title: string, existingBranch?: string | null): Promise<{
|
|
60
60
|
branch: string;
|
|
61
61
|
worktreePath: string;
|
|
62
62
|
agentWorkingDir: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task_git.d.ts","sourceRoot":"","sources":["../../src/lib/task_git.ts"],"names":[],"mappings":"AA2BA,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAM7D;AAOD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,EAAE,CAKvD;AAED,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxE;AA8CD,wBAAsB,UAAU,CAC9B,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC3C,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,GAAG,MAAM,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,GAAG,MAAM,GAAG,IAAI,CAGhB;AAED,MAAM,MAAM,iBAAiB,GAAE;IAAE,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3G,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