@hyperwindmill/caretaker-cli 0.23.0 → 0.25.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/acp/index.d.ts +3 -0
- package/dist/acp/index.d.ts.map +1 -0
- package/dist/acp/index.js +2 -0
- package/dist/acp/install.d.ts +12 -0
- package/dist/acp/install.d.ts.map +1 -0
- package/dist/acp/install.js +110 -0
- package/dist/acp/registry.d.ts +10 -0
- package/dist/acp/registry.d.ts.map +1 -0
- package/dist/acp/registry.js +116 -0
- package/dist/cli/web/mcp_bridge.d.ts +7 -1
- package/dist/cli/web/mcp_bridge.d.ts.map +1 -1
- package/dist/cli/web/mcp_bridge.js +10 -6
- 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 +330 -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 +26 -0
- package/dist/cli/web/scheduler/task_roles.d.ts +1 -1
- package/dist/cli/web/scheduler/task_roles.d.ts.map +1 -1
- package/dist/cli/web/scheduler/task_roles.js +6 -6
- package/dist/cli/web/scheduler/task_strategy.d.ts.map +1 -1
- package/dist/cli/web/scheduler/task_strategy.js +27 -2
- 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 +1 -1
- package/dist/cli/web/server.d.ts.map +1 -1
- package/dist/cli/web/server.js +33 -6
- package/dist/harness/acp_policy.d.ts +41 -0
- package/dist/harness/acp_policy.d.ts.map +1 -0
- package/dist/harness/acp_policy.js +59 -0
- package/dist/harness/acp_pool.d.ts +33 -0
- package/dist/harness/acp_pool.d.ts.map +1 -0
- package/dist/harness/acp_pool.js +148 -0
- package/dist/harness/acp_runner.d.ts +4 -0
- package/dist/harness/acp_runner.d.ts.map +1 -0
- package/dist/harness/acp_runner.js +347 -0
- package/dist/harness/claude_code_runner.d.ts +2 -0
- package/dist/harness/claude_code_runner.d.ts.map +1 -1
- package/dist/harness/claude_code_runner.js +6 -1
- package/dist/harness/confirm_gate.d.ts +12 -0
- package/dist/harness/confirm_gate.d.ts.map +1 -0
- package/dist/harness/confirm_gate.js +33 -0
- package/dist/harness/index.d.ts +1 -0
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js +1 -0
- package/dist/harness/loop.d.ts +12 -0
- package/dist/harness/loop.d.ts.map +1 -1
- package/dist/harness/loop.js +16 -0
- package/dist/harness/memory_recall.d.ts +28 -0
- package/dist/harness/memory_recall.d.ts.map +1 -0
- package/dist/harness/memory_recall.js +74 -0
- package/dist/harness/title.js +1 -1
- 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 +2 -0
- package/dist/mcp/builtin_server.d.ts.map +1 -1
- package/dist/mcp/builtin_server.js +9 -7
- package/dist/mcp/run_command_tool.d.ts +13 -0
- package/dist/mcp/run_command_tool.d.ts.map +1 -0
- package/dist/mcp/run_command_tool.js +51 -0
- package/dist/session/store.d.ts +1 -0
- package/dist/session/store.d.ts.map +1 -1
- package/dist/session/store.js +6 -0
- package/dist/session/types.d.ts +3 -0
- package/dist/session/types.d.ts.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/tui/agents.js +62 -25
- package/dist/tui/chat.d.ts.map +1 -1
- package/dist/tui/chat.js +7 -8
- package/dist/tui/providers.d.ts.map +1 -1
- package/dist/tui/providers.js +116 -17
- package/dist/webview/standalone.css +18 -0
- package/dist/webview/standalone.css.map +2 -2
- package/dist/webview/standalone.js +792 -440
- package/dist/webview/standalone.js.map +4 -4
- package/package.json +8 -3
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { readdir, stat } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { sessionsRoot, readSession, dataDir } from '../../../session/store.js';
|
|
5
|
+
import { loadConfig, loadAgents } from '../../../store/json.js';
|
|
6
|
+
import { run } from '../../../harness/loop.js';
|
|
7
|
+
import { deleteSessionDigest, listMemories, listSessionDigests, saveMemory, saveSessionDigest, } from '../../../store/db.js';
|
|
8
|
+
import { buildCombinedPrompt, formatDedupBlock, parseCombinedResponse, resolveProjectId, validateMemories, } from './memory_extract.js';
|
|
9
|
+
export const DEFAULT_SWEEP_MINUTES = 5;
|
|
10
|
+
export const DEFAULT_MIN_NEW_MESSAGES = 4;
|
|
11
|
+
export const MAX_CALLS_PER_SWEEP = 10;
|
|
12
|
+
export const MAX_CHUNK_CHARS = 20_000;
|
|
13
|
+
export const MAX_TOOL_RESULT_CHARS = 500;
|
|
14
|
+
export const MAX_SUMMARY_CHARS = 4_000;
|
|
15
|
+
export const SUMMARIZE_TIMEOUT_MS = 120_000;
|
|
16
|
+
/** null = subsystem off (unset config, deleted agent, or the agent's provider
|
|
17
|
+
* no longer exists). Any provider type works — the summarize call launches
|
|
18
|
+
* through the harness loop, which already dispatches claude-code. */
|
|
19
|
+
export function resolveMemoryConfig(config, agents) {
|
|
20
|
+
const m = config.memory;
|
|
21
|
+
if (!m?.agentId)
|
|
22
|
+
return null;
|
|
23
|
+
const agent = agents.find((a) => a.id === m.agentId);
|
|
24
|
+
if (!agent)
|
|
25
|
+
return null;
|
|
26
|
+
const provider = (config.providers || []).find((p) => p.name === agent.provider);
|
|
27
|
+
if (!provider)
|
|
28
|
+
return null;
|
|
29
|
+
return {
|
|
30
|
+
agent,
|
|
31
|
+
provider,
|
|
32
|
+
sweepMinutes: m.sweepMinutes ?? DEFAULT_SWEEP_MINUTES,
|
|
33
|
+
minNewMessages: m.minNewMessages ?? DEFAULT_MIN_NEW_MESSAGES,
|
|
34
|
+
agents,
|
|
35
|
+
projects: config.projects ?? [],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** One role-labelled line per message. Thinking parts are dropped (never fed
|
|
39
|
+
* to the memory model); tool results are hard-truncated — they are the
|
|
40
|
+
* largest strings in a session and carry the least durable meaning. */
|
|
41
|
+
export function formatMessage(m) {
|
|
42
|
+
if (m.role === 'tool') {
|
|
43
|
+
const body = m.content.length > MAX_TOOL_RESULT_CHARS
|
|
44
|
+
? m.content.slice(0, MAX_TOOL_RESULT_CHARS) + '…'
|
|
45
|
+
: m.content;
|
|
46
|
+
return `[tool result] ${body}`;
|
|
47
|
+
}
|
|
48
|
+
if (m.role === 'assistant' && m.parts?.length) {
|
|
49
|
+
const parts = [];
|
|
50
|
+
for (const p of m.parts) {
|
|
51
|
+
if (p.type === 'text' && p.text.trim())
|
|
52
|
+
parts.push(p.text);
|
|
53
|
+
else if (p.type === 'tool_use')
|
|
54
|
+
parts.push(`[calls tool: ${p.name}]`);
|
|
55
|
+
}
|
|
56
|
+
return `assistant: ${parts.join('\n')}`;
|
|
57
|
+
}
|
|
58
|
+
return `${m.role}: ${m.content}`;
|
|
59
|
+
}
|
|
60
|
+
/** Index of the cursor message; -1 when lastMessageId is '' or not found
|
|
61
|
+
* (both mean: process from the beginning). */
|
|
62
|
+
export function locateCursor(messages, lastMessageId) {
|
|
63
|
+
if (!lastMessageId)
|
|
64
|
+
return -1;
|
|
65
|
+
return messages.findIndex((m) => m.id === lastMessageId);
|
|
66
|
+
}
|
|
67
|
+
/** Consecutive chunks whose formatted text stays under MAX_CHUNK_CHARS. A
|
|
68
|
+
* single oversized message becomes its own chunk with its text truncated —
|
|
69
|
+
* the cursor must always be able to advance past it. */
|
|
70
|
+
export function chunkMessages(messages) {
|
|
71
|
+
const chunks = [];
|
|
72
|
+
let cur = [];
|
|
73
|
+
let curTexts = [];
|
|
74
|
+
let curLen = 0;
|
|
75
|
+
for (const m of messages) {
|
|
76
|
+
let t = formatMessage(m);
|
|
77
|
+
if (t.length > MAX_CHUNK_CHARS)
|
|
78
|
+
t = t.slice(0, MAX_CHUNK_CHARS) + '…';
|
|
79
|
+
if (curLen + t.length > MAX_CHUNK_CHARS && cur.length > 0) {
|
|
80
|
+
chunks.push({ messages: cur, text: curTexts.join('\n') });
|
|
81
|
+
cur = [];
|
|
82
|
+
curTexts = [];
|
|
83
|
+
curLen = 0;
|
|
84
|
+
}
|
|
85
|
+
cur.push(m);
|
|
86
|
+
curTexts.push(t);
|
|
87
|
+
curLen += t.length + 1;
|
|
88
|
+
}
|
|
89
|
+
if (cur.length > 0)
|
|
90
|
+
chunks.push({ messages: cur, text: curTexts.join('\n') });
|
|
91
|
+
return chunks;
|
|
92
|
+
}
|
|
93
|
+
/** The summarize call launches through the harness loop with the memory
|
|
94
|
+
* agent's identity: every provider type works (claude-code spawns a one-shot
|
|
95
|
+
* `claude -p`, no session persisted), and the agent's systemPrompt shapes
|
|
96
|
+
* the summaries. Always a fresh conversation — never the agent's sessions.
|
|
97
|
+
* `tools: []` plus `dontAsk` (auto-denies every claude-side tool call) keep
|
|
98
|
+
* it pure text generation; workingDir is pinned to CARETAKER_HOME so the
|
|
99
|
+
* project AGENTS.md walk stays out of the prompt. */
|
|
100
|
+
export function makeSummarizer(resolved) {
|
|
101
|
+
return async (ctx) => {
|
|
102
|
+
const ac = new AbortController();
|
|
103
|
+
const timer = setTimeout(() => ac.abort(), SUMMARIZE_TIMEOUT_MS);
|
|
104
|
+
try {
|
|
105
|
+
const result = await run({
|
|
106
|
+
agent: resolved.agent,
|
|
107
|
+
provider: resolved.provider,
|
|
108
|
+
tools: [],
|
|
109
|
+
prompt: buildCombinedPrompt(ctx),
|
|
110
|
+
signal: ac.signal,
|
|
111
|
+
workingDir: dataDir(),
|
|
112
|
+
claudeCode: { permissionMode: 'dontAsk' },
|
|
113
|
+
acp: { mode: 'deny-all' },
|
|
114
|
+
skipMemoryRecall: true,
|
|
115
|
+
});
|
|
116
|
+
if (result.stop !== 'done')
|
|
117
|
+
return null;
|
|
118
|
+
const parsed = parseCombinedResponse(result.text);
|
|
119
|
+
if (!parsed)
|
|
120
|
+
return null;
|
|
121
|
+
const summary = parsed.summary.length > MAX_SUMMARY_CHARS
|
|
122
|
+
? parsed.summary.slice(0, MAX_SUMMARY_CHARS) + '…'
|
|
123
|
+
: parsed.summary;
|
|
124
|
+
return { summary, memories: validateMemories(parsed.memories, ctx.hasProject) };
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
finally {
|
|
130
|
+
clearTimeout(timer);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/** One full pass over every session on disk. Sessions written by any surface
|
|
135
|
+
* are picked up — the sweep reads shared state, it is not wired per surface.
|
|
136
|
+
* Failures are per-session and best-effort: warn, skip, retry next sweep. */
|
|
137
|
+
export async function sweepMemory(resolved, summarize) {
|
|
138
|
+
const result = { scanned: 0, summarized: 0, memories: 0, calls: 0, budgetSkipped: 0 };
|
|
139
|
+
const root = sessionsRoot();
|
|
140
|
+
let agentIds = [];
|
|
141
|
+
try {
|
|
142
|
+
agentIds = await readdir(root);
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
return result; // no sessions dir yet — nothing to do
|
|
146
|
+
}
|
|
147
|
+
const digests = new Map((await listSessionDigests()).map((d) => [d.id, d]));
|
|
148
|
+
const seen = new Set();
|
|
149
|
+
for (const agentId of agentIds) {
|
|
150
|
+
let files = [];
|
|
151
|
+
try {
|
|
152
|
+
files = (await readdir(join(root, agentId))).filter((f) => f.endsWith('.jsonl'));
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
continue; // stray non-directory entry
|
|
156
|
+
}
|
|
157
|
+
for (const file of files) {
|
|
158
|
+
const sessionId = file.slice(0, -'.jsonl'.length);
|
|
159
|
+
seen.add(sessionId);
|
|
160
|
+
const digest = digests.get(sessionId) ?? null;
|
|
161
|
+
const path = join(root, agentId, file);
|
|
162
|
+
// The whole per-session body is guarded: a digest save that throws (a
|
|
163
|
+
// hand-copied file whose name fails safeId, a store write error) must
|
|
164
|
+
// cost only that session this sweep — never the sessions after it.
|
|
165
|
+
try {
|
|
166
|
+
// mtime gate: scannedAt is only ever written when the digest was fully
|
|
167
|
+
// caught up (see invariant below), so mtime < scannedAt ⇒ nothing new.
|
|
168
|
+
try {
|
|
169
|
+
const st = await stat(path);
|
|
170
|
+
if (digest && st.mtime.getTime() < new Date(digest.scannedAt).getTime())
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
continue; // vanished between readdir and stat; cleanup pass handles the digest
|
|
175
|
+
}
|
|
176
|
+
// Captured BEFORE the read: an append racing the read keeps
|
|
177
|
+
// mtime ≥ scannedAt, so the session is re-read next sweep.
|
|
178
|
+
const scannedAt = new Date().toISOString();
|
|
179
|
+
let session;
|
|
180
|
+
try {
|
|
181
|
+
session = await readSession(agentId, sessionId);
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
console.warn(`[memory] failed to read session ${sessionId}:`, err);
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
result.scanned++;
|
|
188
|
+
let record = digest ?? {
|
|
189
|
+
id: sessionId,
|
|
190
|
+
agentId,
|
|
191
|
+
lastMessageId: '',
|
|
192
|
+
messageCount: 0,
|
|
193
|
+
summary: '',
|
|
194
|
+
model: '',
|
|
195
|
+
scannedAt: '',
|
|
196
|
+
updatedAt: '',
|
|
197
|
+
};
|
|
198
|
+
const idx = locateCursor(session.messages, record.lastMessageId);
|
|
199
|
+
if (record.lastMessageId && idx === -1) {
|
|
200
|
+
// Cursor lost (rewritten/truncated file): restart from message zero.
|
|
201
|
+
record = { ...record, lastMessageId: '', messageCount: 0, summary: '', model: '' };
|
|
202
|
+
}
|
|
203
|
+
const fresh = session.messages.slice(idx + 1);
|
|
204
|
+
if (fresh.length < resolved.minNewMessages) {
|
|
205
|
+
// Debounce: arm the mtime gate and wait for the next append.
|
|
206
|
+
await saveSessionDigest({ ...record, agentId, scannedAt });
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
// Scope + dedup context, once per session. `dedup` is mutated as new
|
|
210
|
+
// memories are saved so the NEXT chunk of this session sees them too;
|
|
211
|
+
// across sessions the fresh listMemories() covers it.
|
|
212
|
+
const projectId = resolveProjectId(agentId, resolved.agents, resolved.projects);
|
|
213
|
+
const dedup = (await listMemories())
|
|
214
|
+
.filter((m) => m.projectId === '' || m.projectId === projectId)
|
|
215
|
+
.sort((a, b) => b.createdAt.localeCompare(a.createdAt));
|
|
216
|
+
// INVARIANT: per-chunk saves keep the OLD scannedAt. The new one is
|
|
217
|
+
// only persisted when every chunk succeeded — a budget stop or model
|
|
218
|
+
// failure must leave the session mtime-gate-open for the next sweep.
|
|
219
|
+
let caughtUp = true;
|
|
220
|
+
for (const chunk of chunkMessages(fresh)) {
|
|
221
|
+
if (result.calls >= MAX_CALLS_PER_SWEEP) {
|
|
222
|
+
result.budgetSkipped++;
|
|
223
|
+
caughtUp = false;
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
result.calls++;
|
|
227
|
+
const res = await summarize({
|
|
228
|
+
prevSummary: record.summary,
|
|
229
|
+
chunkText: chunk.text,
|
|
230
|
+
dedupBlock: formatDedupBlock(dedup),
|
|
231
|
+
hasProject: projectId !== '',
|
|
232
|
+
});
|
|
233
|
+
if (res === null) {
|
|
234
|
+
caughtUp = false;
|
|
235
|
+
break; // cursor stays; next sweep retries
|
|
236
|
+
}
|
|
237
|
+
// Memories BEFORE the digest record: a crash between the two
|
|
238
|
+
// re-extracts this chunk next sweep, but the titles just saved are
|
|
239
|
+
// then in the dedup block, so the model omits them — duplicates
|
|
240
|
+
// with a dedup guard beat silent loss.
|
|
241
|
+
for (const em of res.memories) {
|
|
242
|
+
const memory = {
|
|
243
|
+
id: randomUUID(),
|
|
244
|
+
projectId: em.level === 'project' && projectId ? projectId : '',
|
|
245
|
+
kind: em.kind,
|
|
246
|
+
importance: em.importance,
|
|
247
|
+
title: em.title,
|
|
248
|
+
body: em.body,
|
|
249
|
+
keywords: em.keywords,
|
|
250
|
+
sourceSessionId: sessionId,
|
|
251
|
+
sourceAgentId: agentId,
|
|
252
|
+
model: resolved.agent.model,
|
|
253
|
+
createdAt: new Date().toISOString(),
|
|
254
|
+
};
|
|
255
|
+
await saveMemory(memory);
|
|
256
|
+
result.memories++;
|
|
257
|
+
dedup.unshift({ title: memory.title, keywords: memory.keywords });
|
|
258
|
+
}
|
|
259
|
+
const last = chunk.messages[chunk.messages.length - 1];
|
|
260
|
+
record = {
|
|
261
|
+
...record,
|
|
262
|
+
agentId,
|
|
263
|
+
lastMessageId: last.id,
|
|
264
|
+
messageCount: record.messageCount + chunk.messages.length,
|
|
265
|
+
summary: res.summary,
|
|
266
|
+
model: resolved.agent.model,
|
|
267
|
+
};
|
|
268
|
+
await saveSessionDigest(record); // crash loses at most one chunk
|
|
269
|
+
result.summarized++;
|
|
270
|
+
}
|
|
271
|
+
if (caughtUp) {
|
|
272
|
+
await saveSessionDigest({ ...record, agentId, scannedAt });
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
catch (err) {
|
|
276
|
+
console.warn(`[memory] sweep of session ${sessionId} failed:`, err);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
// Regenerable-cache hygiene: drop digests whose session no longer exists.
|
|
281
|
+
for (const [id] of digests) {
|
|
282
|
+
if (!seen.has(id))
|
|
283
|
+
await deleteSessionDigest(id);
|
|
284
|
+
}
|
|
285
|
+
return result;
|
|
286
|
+
}
|
|
287
|
+
let lastSweepStartedAt = 0;
|
|
288
|
+
let sweepInFlight = false;
|
|
289
|
+
let warnedUnusable = false;
|
|
290
|
+
/** The scheduler-facing entry: called every 15 s tick, does work at most once
|
|
291
|
+
* per sweepMinutes, never overlapping. `summarizeOverride` is test-only. */
|
|
292
|
+
export async function runMemorySweepTick(now, summarizeOverride) {
|
|
293
|
+
const config = await loadConfig();
|
|
294
|
+
if (!config.memory)
|
|
295
|
+
return; // subsystem off — zero cost
|
|
296
|
+
const resolved = resolveMemoryConfig(config, await loadAgents());
|
|
297
|
+
if (!resolved) {
|
|
298
|
+
if (!warnedUnusable) {
|
|
299
|
+
warnedUnusable = true;
|
|
300
|
+
console.warn("[memory] memory config is set but unusable (deleted agent, or the agent's provider no longer exists) — sweeps disabled until fixed");
|
|
301
|
+
}
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
warnedUnusable = false;
|
|
305
|
+
if (sweepInFlight)
|
|
306
|
+
return;
|
|
307
|
+
if (now.getTime() - lastSweepStartedAt < resolved.sweepMinutes * 60_000)
|
|
308
|
+
return;
|
|
309
|
+
lastSweepStartedAt = now.getTime();
|
|
310
|
+
sweepInFlight = true;
|
|
311
|
+
try {
|
|
312
|
+
const res = await sweepMemory(resolved, summarizeOverride ?? makeSummarizer(resolved));
|
|
313
|
+
if (res.calls > 0 || res.budgetSkipped > 0) {
|
|
314
|
+
console.log(`[memory] sweep: scanned=${res.scanned} calls=${res.calls} summarized=${res.summarized} memories=${res.memories} budget-skipped=${res.budgetSkipped}`);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
catch (err) {
|
|
318
|
+
console.error('[memory] sweep failed:', err);
|
|
319
|
+
}
|
|
320
|
+
finally {
|
|
321
|
+
sweepInFlight = false;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
export const __memorySweepTesting = {
|
|
325
|
+
reset() {
|
|
326
|
+
lastSweepStartedAt = 0;
|
|
327
|
+
sweepInFlight = false;
|
|
328
|
+
warnedUnusable = false;
|
|
329
|
+
},
|
|
330
|
+
};
|
|
@@ -10,6 +10,9 @@ export declare function runDoneReview(opts: {
|
|
|
10
10
|
objective: string;
|
|
11
11
|
branch: string;
|
|
12
12
|
workingDir: string;
|
|
13
|
+
/** The task's project — explicit memory-recall scope (the worktree the
|
|
14
|
+
* review runs in never prefix-matches the project's workingDir). */
|
|
15
|
+
projectId?: string;
|
|
13
16
|
round: number;
|
|
14
17
|
signal?: AbortSignal;
|
|
15
18
|
/** Wall-clock budget (seconds) for the review run. Defaults to the claude-code default. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task_review.d.ts","sourceRoot":"","sources":["../../../../src/cli/web/scheduler/task_review.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"task_review.d.ts","sourceRoot":"","sources":["../../../../src/cli/web/scheduler/task_review.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AAK5D,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CA2BrF;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMnE;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB;yEACqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,2FAA2F;IAC3F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;wDAEoD;IACpD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CA+EzD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as harness from '../../../harness/index.js';
|
|
2
2
|
import { CLAUDE_CODE_DEFAULT_RUN_SECONDS } from './task_roles.js';
|
|
3
3
|
import { dockerDevAllowlist } from '../../../lib/docker.js';
|
|
4
|
+
import { getTaskBridgeUrl, issueBridgeToken, revokeBridgeToken } from '../mcp_bridge.js';
|
|
4
5
|
export const MAX_REVIEW_ROUNDS = 3;
|
|
5
6
|
export function reviewPrompt(objective, branch, round) {
|
|
6
7
|
return `You are an INDEPENDENT code reviewer. You did not write this code, and your job is to find real problems — not to be agreeable. Do not rubber-stamp.
|
|
@@ -54,6 +55,27 @@ export async function runDoneReview(opts) {
|
|
|
54
55
|
}
|
|
55
56
|
: { permissionMode: 'bypassPermissions' }
|
|
56
57
|
: undefined;
|
|
58
|
+
const isAcp = opts.provider.type === 'acp';
|
|
59
|
+
let acp;
|
|
60
|
+
let reviewBridgeToken;
|
|
61
|
+
if (isAcp) {
|
|
62
|
+
const exec = opts.dockerContainer
|
|
63
|
+
? { container: opts.dockerContainer, workdir: opts.workingDir }
|
|
64
|
+
: undefined;
|
|
65
|
+
let extraMcpServers;
|
|
66
|
+
if (exec) {
|
|
67
|
+
// The reviewer needs shell in the container but must NOT see the task
|
|
68
|
+
// state tools: an exec-only bridge token serves run_command alone.
|
|
69
|
+
const bridgeUrl = getTaskBridgeUrl();
|
|
70
|
+
reviewBridgeToken = bridgeUrl ? issueBridgeToken(opts.agent.id, { exec, execOnly: true }) : undefined;
|
|
71
|
+
if (bridgeUrl && reviewBridgeToken) {
|
|
72
|
+
extraMcpServers = {
|
|
73
|
+
task: { type: 'http', url: bridgeUrl, headers: { Authorization: `Bearer ${reviewBridgeToken}` } },
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
acp = { mode: 'unattended', docker: exec, extraMcpServers };
|
|
78
|
+
}
|
|
57
79
|
// Wall-clock backstop for the review pass, enforced for every provider (the
|
|
58
80
|
// Claude Code CLI has no --max-turns equivalent). Combined with any external
|
|
59
81
|
// signal (a Pause landing mid-review) so either can abort the run.
|
|
@@ -78,9 +100,11 @@ export async function runDoneReview(opts) {
|
|
|
78
100
|
prompt,
|
|
79
101
|
history: [],
|
|
80
102
|
workingDir: opts.workingDir,
|
|
103
|
+
memoryProjectId: opts.projectId,
|
|
81
104
|
signal,
|
|
82
105
|
dockerContainer: opts.dockerContainer,
|
|
83
106
|
...(claudeCode ? { claudeCode } : {}),
|
|
107
|
+
...(acp ? { acp } : {}),
|
|
84
108
|
}, {
|
|
85
109
|
confirmTool: async () => 'once', // unattended
|
|
86
110
|
});
|
|
@@ -88,5 +112,7 @@ export async function runDoneReview(opts) {
|
|
|
88
112
|
}
|
|
89
113
|
finally {
|
|
90
114
|
clearTimeout(runTimer);
|
|
115
|
+
if (reviewBridgeToken)
|
|
116
|
+
revokeBridgeToken(reviewBridgeToken);
|
|
91
117
|
}
|
|
92
118
|
}
|
|
@@ -5,7 +5,7 @@ export type TaskRole = 'planner' | 'developer' | 'reviewer';
|
|
|
5
5
|
export declare const DEFAULT_RUN_SECONDS = 120;
|
|
6
6
|
export declare const CLAUDE_CODE_DEFAULT_RUN_SECONDS: number;
|
|
7
7
|
/** Resolve the per-invocation budget (seconds): task → project → provider default. */
|
|
8
|
-
export declare function resolveMaxRunSeconds(task: Pick<Task, 'maxRunSeconds'>, project: Pick<ProjectConfig, 'maxRunSeconds'> | null | undefined,
|
|
8
|
+
export declare function resolveMaxRunSeconds(task: Pick<Task, 'maxRunSeconds'>, project: Pick<ProjectConfig, 'maxRunSeconds'> | null | undefined, isExternalRunner: boolean): number;
|
|
9
9
|
/**
|
|
10
10
|
* Resolve the docker image for a task's runs. Phase-1: project-level only, so
|
|
11
11
|
* the task arg is accepted (for a future per-task override tier) but unused.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task_roles.d.ts","sourceRoot":"","sources":["../../../../src/cli/web/scheduler/task_roles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,IAAI,EAAe,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AAE5D,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAO5D,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,+BAA+B,QAAU,CAAC;AAEvD,sFAAsF;AACtF,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC,EACjC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,GAAG,IAAI,GAAG,SAAS,EAChE,
|
|
1
|
+
{"version":3,"file":"task_roles.d.ts","sourceRoot":"","sources":["../../../../src/cli/web/scheduler/task_roles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,IAAI,EAAe,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AAE5D,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAO5D,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,+BAA+B,QAAU,CAAC;AAEvD,sFAAsF;AACtF,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC,EACjC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,GAAG,IAAI,GAAG,SAAS,EAChE,gBAAgB,EAAE,OAAO,GACxB,MAAM,CAIR;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,EAC9B,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,GAAG,IAAI,GAAG,SAAS,GAC7D,MAAM,GAAG,IAAI,CAGf;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,MAAM,EAAE,WAAW,EAAE,GACpB,WAAW,GAAG,SAAS,CAOzB;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,EACnC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,iBAAiB,CAAC,GAAG,IAAI,GACtD,OAAO,CAET;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC,EACjC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,GAAG,IAAI,GACpD,OAAO,CAET;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,EAC9B,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,GAAG,IAAI,GACjD,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,aAAa,GAAG,SAAS,GACjC,OAAO,CAAC,UAAU,GAAG,QAAQ,CAAC,CAIhC;AAYD,eAAO,MAAM,qBAAqB,aAKhC,CAAC;AAsBH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,UAAQ,GAAG,IAAI,EAAE,CAOrE"}
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
// developer role; planner/reviewer optionally override and degrade onto it.
|
|
4
4
|
import { runQuery } from '../../../store/db.js';
|
|
5
5
|
// Per-invocation wall-clock budget defaults, in seconds. A run is aborted when
|
|
6
|
-
// it exceeds the resolved budget — for every provider.
|
|
7
|
-
//
|
|
8
|
-
// turn-bounded by agent.maxTurns), so without a generous
|
|
9
|
-
// run would stall the heartbeat (and, for reviews, the review gate).
|
|
6
|
+
// it exceeds the resolved budget — for every provider. External runners
|
|
7
|
+
// (claude-code, acp) get a larger default because they manage their own loop
|
|
8
|
+
// (native runs are also turn-bounded by agent.maxTurns), so without a generous
|
|
9
|
+
// backstop an external runner run would stall the heartbeat (and, for reviews, the review gate).
|
|
10
10
|
export const DEFAULT_RUN_SECONDS = 120;
|
|
11
11
|
export const CLAUDE_CODE_DEFAULT_RUN_SECONDS = 15 * 60;
|
|
12
12
|
/** Resolve the per-invocation budget (seconds): task → project → provider default. */
|
|
13
|
-
export function resolveMaxRunSeconds(task, project,
|
|
13
|
+
export function resolveMaxRunSeconds(task, project, isExternalRunner) {
|
|
14
14
|
const configured = task.maxRunSeconds ?? project?.maxRunSeconds;
|
|
15
15
|
if (typeof configured === 'number' && configured > 0)
|
|
16
16
|
return configured;
|
|
17
|
-
return
|
|
17
|
+
return isExternalRunner ? CLAUDE_CODE_DEFAULT_RUN_SECONDS : DEFAULT_RUN_SECONDS;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Resolve the docker image for a task's runs. Phase-1: project-level only, so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task_strategy.d.ts","sourceRoot":"","sources":["../../../../src/cli/web/scheduler/task_strategy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"task_strategy.d.ts","sourceRoot":"","sources":["../../../../src/cli/web/scheduler/task_strategy.ts"],"names":[],"mappings":"AA0HA,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA4enE"}
|
|
@@ -6,6 +6,7 @@ import { runningTasks, runningTaskControllers, syncingProjects } from './locks.j
|
|
|
6
6
|
import { isGitRepo, ensureWorktree, agentDirIn, commitWip, finalizeDone, runBootstrap, gitCommonDir, syncProjectRepo, projectWorkingDir, pushBranch } from '../../../lib/task_git.js';
|
|
7
7
|
import { runDoneReview, MAX_REVIEW_ROUNDS } from './task_review.js';
|
|
8
8
|
import { claudeCodeTaskExtras } from '../../../harness/claude_code_runner.js';
|
|
9
|
+
import { acpTaskExtras } from '../../../harness/acp_policy.js';
|
|
9
10
|
import { issueBridgeToken, revokeBridgeToken, getTaskBridgeUrl } from '../mcp_bridge.js';
|
|
10
11
|
import { resolveRoleAgent, resolveReviewEnabled, resolveSddEnabled, resolveMaxRunSeconds, filterPlannerTools, resolveDockerImage, } from './task_roles.js';
|
|
11
12
|
import { resolve as resolvePath, dirname } from 'node:path';
|
|
@@ -299,9 +300,10 @@ export async function runTaskHeartbeatTick(now) {
|
|
|
299
300
|
// Max turns: standard sonnet settings or maxTurns
|
|
300
301
|
const maxTurns = agent.maxTurns || 30;
|
|
301
302
|
const isClaudeCode = provider.type === 'claude-code';
|
|
303
|
+
const isAcp = provider.type === 'acp';
|
|
302
304
|
// Per-invocation wall-clock budget (task → project → provider default),
|
|
303
305
|
// enforced below via the abort timer for every provider.
|
|
304
|
-
const maxRunSeconds = resolveMaxRunSeconds(task, project, isClaudeCode);
|
|
306
|
+
const maxRunSeconds = resolveMaxRunSeconds(task, project, isClaudeCode || isAcp);
|
|
305
307
|
// 5. Construct prompt
|
|
306
308
|
const prompt = planning
|
|
307
309
|
? buildPlanningPrompt(agent.systemPrompt, task.id, task.title, maxRunSeconds, maxTurns, workingDir, sdd)
|
|
@@ -311,6 +313,9 @@ export async function runTaskHeartbeatTick(now) {
|
|
|
311
313
|
let effectivePrompt = prompt;
|
|
312
314
|
if (dockerContainer && !planning) {
|
|
313
315
|
let env = `\n\n**Execution environment:** your shell commands run inside a Docker container (image \`${dockerImage}\`) mounted at \`${workingDir}\`. File reads/writes are confined to this directory.`;
|
|
316
|
+
if (isAcp) {
|
|
317
|
+
env += ` Shell commands MUST go through the \`run_command\` tool — direct shell/execute tool calls are denied in this run.`;
|
|
318
|
+
}
|
|
314
319
|
if (!dockerHasGit) {
|
|
315
320
|
env += ` Note: \`git\` is NOT available in this container — do not run git commands (commits are handled automatically for you).`;
|
|
316
321
|
}
|
|
@@ -361,6 +366,7 @@ export async function runTaskHeartbeatTick(now) {
|
|
|
361
366
|
// still call task_get_state/task_submit_plan/etc despite --strict-mcp-config.
|
|
362
367
|
let bridgeToken;
|
|
363
368
|
let claudeCode;
|
|
369
|
+
let acp;
|
|
364
370
|
// Same handle Pause aborts; the wall-clock budget (resolved above) also
|
|
365
371
|
// aborts it. Enforced for every provider — native runs stay additionally
|
|
366
372
|
// turn-bounded by maxTurns.
|
|
@@ -395,6 +401,20 @@ export async function runTaskHeartbeatTick(now) {
|
|
|
395
401
|
console.warn('[tasks] claude-code agent without task bridge URL — task tools unavailable this run');
|
|
396
402
|
}
|
|
397
403
|
}
|
|
404
|
+
if (isAcp) {
|
|
405
|
+
const bridgeUrl = getTaskBridgeUrl();
|
|
406
|
+
const exec = dockerContainer && !planning ? { container: dockerContainer, workdir: workingDir } : undefined;
|
|
407
|
+
bridgeToken = bridgeUrl ? issueBridgeToken(effectiveAgent.id, { exec }) : undefined;
|
|
408
|
+
acp = acpTaskExtras({
|
|
409
|
+
planning,
|
|
410
|
+
sdd,
|
|
411
|
+
bridge: bridgeUrl && bridgeToken ? { url: bridgeUrl, token: bridgeToken } : undefined,
|
|
412
|
+
docker: exec,
|
|
413
|
+
});
|
|
414
|
+
if (!bridgeUrl) {
|
|
415
|
+
console.warn('[tasks] acp agent without task bridge URL — task tools unavailable this run');
|
|
416
|
+
}
|
|
417
|
+
}
|
|
398
418
|
try {
|
|
399
419
|
await harness.run({
|
|
400
420
|
agent: effectiveAgent,
|
|
@@ -403,7 +423,11 @@ export async function runTaskHeartbeatTick(now) {
|
|
|
403
423
|
prompt: effectivePrompt,
|
|
404
424
|
history: historyRecords,
|
|
405
425
|
workingDir,
|
|
426
|
+
// The worktree never prefix-matches the project's workingDir, so
|
|
427
|
+
// the recall block gets the project scope explicitly.
|
|
428
|
+
memoryProjectId: task.projectId,
|
|
406
429
|
claudeCode,
|
|
430
|
+
acp,
|
|
407
431
|
dockerContainer,
|
|
408
432
|
signal,
|
|
409
433
|
}, {
|
|
@@ -558,7 +582,7 @@ async function pushOrBlock(task, project) {
|
|
|
558
582
|
}
|
|
559
583
|
async function runReviewCycle(opts) {
|
|
560
584
|
const { task, project, agent, provider, tools, workingDir, signal, dockerContainer, dockerHasGit } = opts;
|
|
561
|
-
const maxRunSeconds = resolveMaxRunSeconds(task, project, provider.type === 'claude-code');
|
|
585
|
+
const maxRunSeconds = resolveMaxRunSeconds(task, project, provider.type === 'claude-code' || provider.type === 'acp');
|
|
562
586
|
if (!task.worktreePath)
|
|
563
587
|
return; // reviewing implies a worktree; nothing to review otherwise
|
|
564
588
|
// Review gate disabled (task or project level): finalize directly, no review.
|
|
@@ -596,6 +620,7 @@ async function runReviewCycle(opts) {
|
|
|
596
620
|
objective: task.objective,
|
|
597
621
|
branch: task.branch || '(unknown)',
|
|
598
622
|
workingDir,
|
|
623
|
+
projectId: task.projectId,
|
|
599
624
|
round,
|
|
600
625
|
signal,
|
|
601
626
|
maxRunSeconds,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../src/cli/web/scheduler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../src/cli/web/scheduler.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EACZ,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAOpD;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CA4BtD;AAKD;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAQ/C;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAM9C"}
|
|
@@ -2,6 +2,7 @@ import { loadConfig } from '../../store/json.js';
|
|
|
2
2
|
import { HeartbeatStrategy } from './scheduler/heartbeat.js';
|
|
3
3
|
import { TelegramStrategy } from './scheduler/telegram.js';
|
|
4
4
|
import { runTaskHeartbeatTick } from './scheduler/task_strategy.js';
|
|
5
|
+
import { runMemorySweepTick } from './scheduler/memory_sweep.js';
|
|
5
6
|
// Re-exported for backwards compatibility with existing consumers (server.ts, tests).
|
|
6
7
|
export { schedulerLogsDir, schedulerLogPath, ensureSchedulerLogsDir, loadTaskRuns, saveTaskRun, } from './scheduler/logs.js';
|
|
7
8
|
export { runningTasks } from './scheduler/locks.js';
|
|
@@ -30,6 +31,10 @@ export async function runSchedulerTick() {
|
|
|
30
31
|
await runTaskHeartbeatTick(now).catch((err) => {
|
|
31
32
|
console.error('[scheduler] Autonomous Task Heartbeat Tick failed:', err);
|
|
32
33
|
});
|
|
34
|
+
// Memory sweep (session digests) — self-gated to at most one run per sweepMinutes.
|
|
35
|
+
await runMemorySweepTick(now).catch((err) => {
|
|
36
|
+
console.error('[scheduler] Memory sweep tick failed:', err);
|
|
37
|
+
});
|
|
33
38
|
}
|
|
34
39
|
catch (err) {
|
|
35
40
|
console.error('[scheduler] Error evaluating scheduler tasks tick:', err);
|
package/dist/cli/web/server.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/cli/web/server.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AA0ClD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAgC,MAAM,gBAAgB,CAAC;AAChG,OAAO,KAAK,EAAE,eAAe,EAA0B,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/cli/web/server.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AA0ClD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAgC,MAAM,gBAAgB,CAAC;AAChG,OAAO,KAAK,EAAE,eAAe,EAA0B,MAAM,mBAAmB,CAAC;AAiBjF,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9D,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACtF,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD;AAED,qBAAa,oBAAoB;IAQ7B,OAAO,CAAC,QAAQ,CAAC,IAAI;IAPvB,OAAO,CAAC,UAAU,CAAkC;IACpD,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA2B;IACvD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAS;gBAGjB,IAAI,EAAE;QACrB,KAAK,EAAE,WAAW,CAAC;QACnB,QAAQ,EAAE,cAAc,CAAC;QACzB,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAMH,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,eAAe,IAAI,GAAG;IAIhB,KAAK,CACT,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,aAAa,EACjB,cAAc,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,EACtE,iBAAiB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,IAAI,CAAC;IAgFhB,KAAK,IAAI,IAAI;CAGd;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqpC3E"}
|