@hyperwindmill/caretaker-cli 0.23.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/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_strategy.d.ts.map +1 -1
- package/dist/cli/web/scheduler/task_strategy.js +4 -0
- 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 +6 -1
- 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/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/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/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 +66 -0
- package/dist/store/db.d.ts.map +1 -1
- package/dist/store/db.js +68 -0
- package/dist/tui/agents.js +5 -2
- package/dist/webview/standalone.js +557 -415
- package/dist/webview/standalone.js.map +4 -4
- package/package.json +3 -3
package/dist/store/db.js
CHANGED
|
@@ -149,3 +149,71 @@ export async function deleteTask(taskId) {
|
|
|
149
149
|
await runQuery(`DELETE FROM task_messages WHERE taskId = '${taskId}'`);
|
|
150
150
|
await runQuery(`DELETE FROM tasks WHERE id = '${taskId}'`);
|
|
151
151
|
}
|
|
152
|
+
export async function getSessionDigest(sessionId) {
|
|
153
|
+
if (!safeId(sessionId))
|
|
154
|
+
return null;
|
|
155
|
+
try {
|
|
156
|
+
const rows = (await runQuery(`SELECT * FROM session_digests WHERE id = '${sessionId}'`));
|
|
157
|
+
return rows[0] || null;
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
export async function listSessionDigests() {
|
|
164
|
+
try {
|
|
165
|
+
return (await runQuery('SELECT * FROM session_digests'));
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
return [];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
export async function saveSessionDigest(d) {
|
|
172
|
+
if (!safeId(d.id))
|
|
173
|
+
throw new Error(`Invalid session id: ${d.id}`);
|
|
174
|
+
// Delete + insert = upsert; summary goes through JSON.stringify, so quotes
|
|
175
|
+
// and newlines never touch the interpolated SQL string.
|
|
176
|
+
await runQuery(`DELETE FROM session_digests WHERE id = '${d.id}'`);
|
|
177
|
+
await runQuery(`INSERT INTO session_digests ${JSON.stringify({ ...d, updatedAt: new Date().toISOString() })}`);
|
|
178
|
+
}
|
|
179
|
+
export async function deleteSessionDigest(sessionId) {
|
|
180
|
+
if (!safeId(sessionId))
|
|
181
|
+
return;
|
|
182
|
+
await runQuery(`DELETE FROM session_digests WHERE id = '${sessionId}'`);
|
|
183
|
+
}
|
|
184
|
+
export async function saveMemory(m) {
|
|
185
|
+
if (!safeId(m.id))
|
|
186
|
+
throw new Error(`Invalid memory id: ${m.id}`);
|
|
187
|
+
// Insert-only: memories are append-only; there is deliberately no upsert.
|
|
188
|
+
await runQuery(`INSERT INTO memories ${JSON.stringify(m)}`);
|
|
189
|
+
}
|
|
190
|
+
export async function listMemories() {
|
|
191
|
+
try {
|
|
192
|
+
return (await runQuery('SELECT * FROM memories'));
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
return [];
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
export async function deleteMemory(id) {
|
|
199
|
+
if (!safeId(id))
|
|
200
|
+
return;
|
|
201
|
+
await runQuery(`DELETE FROM memories WHERE id = '${id}'`);
|
|
202
|
+
}
|
|
203
|
+
/** Recall event: memory_read delivered this memory to an agent. Delete +
|
|
204
|
+
* insert (saveSessionDigest pattern — the store has no UPDATE). No-op on
|
|
205
|
+
* unknown ids: a stale id in a prelude block is not an error. */
|
|
206
|
+
export async function bumpMemoryRecall(id) {
|
|
207
|
+
if (!safeId(id))
|
|
208
|
+
return;
|
|
209
|
+
const rows = (await runQuery(`SELECT * FROM memories WHERE id = '${id}'`));
|
|
210
|
+
const m = rows[0];
|
|
211
|
+
if (!m)
|
|
212
|
+
return;
|
|
213
|
+
await runQuery(`DELETE FROM memories WHERE id = '${id}'`);
|
|
214
|
+
await runQuery(`INSERT INTO memories ${JSON.stringify({
|
|
215
|
+
...m,
|
|
216
|
+
recallCount: (m.recallCount ?? 0) + 1,
|
|
217
|
+
lastRecalledAt: new Date().toISOString(),
|
|
218
|
+
})}`);
|
|
219
|
+
}
|
package/dist/tui/agents.js
CHANGED
|
@@ -257,8 +257,11 @@ const NAMESPACE_DESCRIPTIONS = {
|
|
|
257
257
|
mcp__email__: 'List the configured email accounts and send mail',
|
|
258
258
|
};
|
|
259
259
|
/** The picker's tool list: one synthetic entry per `mcp__<ns>__` namespace in
|
|
260
|
-
* place of its individual tools, everything else as-is.
|
|
261
|
-
|
|
260
|
+
* place of its individual tools, everything else as-is. Hidden tools
|
|
261
|
+
* (memory_read) are harness infrastructure, auto-included by
|
|
262
|
+
* resolveAgentTools behind their own gate — never a picker choice. */
|
|
263
|
+
function namespacedToolList(allTools) {
|
|
264
|
+
const tools = allTools.filter((t) => !t.hidden);
|
|
262
265
|
const namespaces = [
|
|
263
266
|
...new Set(tools.map((t) => /^mcp__[a-z]+__/.exec(t.name)?.[0]).filter((p) => !!p)),
|
|
264
267
|
];
|