codekin 0.6.5 → 0.7.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/README.md +6 -3
- package/dist/assets/index-CLuQVRRb.css +1 -0
- package/dist/assets/index-JVnFWiSw.js +185 -0
- package/dist/index.html +2 -2
- package/package.json +4 -2
- package/server/dist/anthropic-models.d.ts +40 -0
- package/server/dist/anthropic-models.js +212 -0
- package/server/dist/anthropic-models.js.map +1 -0
- package/server/dist/claude-process.d.ts +31 -3
- package/server/dist/claude-process.js +126 -9
- package/server/dist/claude-process.js.map +1 -1
- package/server/dist/codex-process.d.ts +147 -0
- package/server/dist/codex-process.js +741 -0
- package/server/dist/codex-process.js.map +1 -0
- package/server/dist/coding-process.d.ts +16 -4
- package/server/dist/coding-process.js +10 -0
- package/server/dist/coding-process.js.map +1 -1
- package/server/dist/config.d.ts +13 -0
- package/server/dist/config.js +18 -0
- package/server/dist/config.js.map +1 -1
- package/server/dist/opencode-process.d.ts +142 -5
- package/server/dist/opencode-process.js +664 -84
- package/server/dist/opencode-process.js.map +1 -1
- package/server/dist/orchestrator-children.d.ts +53 -6
- package/server/dist/orchestrator-children.js +292 -68
- package/server/dist/orchestrator-children.js.map +1 -1
- package/server/dist/orchestrator-manager.d.ts +10 -0
- package/server/dist/orchestrator-manager.js +70 -18
- package/server/dist/orchestrator-manager.js.map +1 -1
- package/server/dist/orchestrator-monitor.d.ts +7 -1
- package/server/dist/orchestrator-monitor.js +49 -19
- package/server/dist/orchestrator-monitor.js.map +1 -1
- package/server/dist/orchestrator-notify.d.ts +16 -3
- package/server/dist/orchestrator-notify.js +22 -7
- package/server/dist/orchestrator-notify.js.map +1 -1
- package/server/dist/orchestrator-outbox.d.ts +48 -0
- package/server/dist/orchestrator-outbox.js +154 -0
- package/server/dist/orchestrator-outbox.js.map +1 -0
- package/server/dist/orchestrator-session-router.js +40 -1
- package/server/dist/orchestrator-session-router.js.map +1 -1
- package/server/dist/prompt-router.d.ts +22 -1
- package/server/dist/prompt-router.js +94 -11
- package/server/dist/prompt-router.js.map +1 -1
- package/server/dist/session-archive.js +11 -1
- package/server/dist/session-archive.js.map +1 -1
- package/server/dist/session-lifecycle.js +36 -0
- package/server/dist/session-lifecycle.js.map +1 -1
- package/server/dist/session-manager.d.ts +19 -2
- package/server/dist/session-manager.js +116 -27
- package/server/dist/session-manager.js.map +1 -1
- package/server/dist/session-naming.d.ts +4 -0
- package/server/dist/session-naming.js +26 -5
- package/server/dist/session-naming.js.map +1 -1
- package/server/dist/session-routes.js +38 -1
- package/server/dist/session-routes.js.map +1 -1
- package/server/dist/stepflow-handler.js +2 -2
- package/server/dist/stepflow-handler.js.map +1 -1
- package/server/dist/tsconfig.tsbuildinfo +1 -1
- package/server/dist/types.d.ts +24 -3
- package/server/dist/types.js +1 -9
- package/server/dist/types.js.map +1 -1
- package/server/dist/upload-routes.d.ts +7 -0
- package/server/dist/upload-routes.js +53 -24
- package/server/dist/upload-routes.js.map +1 -1
- package/server/dist/webhook-handler.js +3 -3
- package/server/dist/webhook-handler.js.map +1 -1
- package/server/dist/workflow-config.d.ts +2 -2
- package/server/dist/workflow-engine.d.ts +19 -0
- package/server/dist/workflow-engine.js +27 -3
- package/server/dist/workflow-engine.js.map +1 -1
- package/server/dist/workflow-loader.d.ts +5 -5
- package/server/dist/workflow-loader.js +90 -59
- package/server/dist/workflow-loader.js.map +1 -1
- package/server/dist/ws-message-handler.js +19 -8
- package/server/dist/ws-message-handler.js.map +1 -1
- package/server/dist/ws-server.js +25 -1
- package/server/dist/ws-server.js.map +1 -1
- package/dist/assets/index-B0xIzdCK.js +0 -187
- package/dist/assets/index-Q2WSVlHo.css +0 -1
|
@@ -29,7 +29,16 @@ Agent ${AGENT_DISPLAY_NAME} tracks repositories you work with in Codekin.
|
|
|
29
29
|
## Active Repos
|
|
30
30
|
(none yet — ${AGENT_DISPLAY_NAME} will populate this as you work)
|
|
31
31
|
`;
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Bump this whenever CLAUDE_MD_TEMPLATE changes. Already-seeded CLAUDE.md
|
|
34
|
+
* files carrying an older (or no) version stamp are refreshed on boot —
|
|
35
|
+
* without this, installs keep running on stale orchestrator instructions
|
|
36
|
+
* forever. CLAUDE.md is system-managed; user memory lives in PROFILE.md,
|
|
37
|
+
* REPOS.md and journal/, which are never overwritten.
|
|
38
|
+
*/
|
|
39
|
+
export const CLAUDE_MD_TEMPLATE_VERSION = 2;
|
|
40
|
+
const CLAUDE_MD_TEMPLATE = `<!-- codekin-template-version: ${CLAUDE_MD_TEMPLATE_VERSION} -->
|
|
41
|
+
# Agent ${AGENT_DISPLAY_NAME} — Codekin Orchestrator
|
|
33
42
|
|
|
34
43
|
You are ${AGENT_DISPLAY_NAME}, a calm and friendly ops manager inside Codekin.
|
|
35
44
|
You help users keep their repositories healthy, their workflows running
|
|
@@ -129,6 +138,13 @@ Fields:
|
|
|
129
138
|
- **useWorktree**: true (default) — runs in an isolated git worktree
|
|
130
139
|
- **model**: Optional model override (e.g. "claude-sonnet-4-6")
|
|
131
140
|
- **allowedTools**: Optional array of tool patterns to override defaults (advanced)
|
|
141
|
+
- **timeoutMs**: Optional working-time budget in ms (default 1800000 = 30 min,
|
|
142
|
+
range 1 min – 4 h). Time spent blocked on an approval does not count.
|
|
143
|
+
Raise this for large tasks (big refactors, full test suites).
|
|
144
|
+
|
|
145
|
+
The spawn response includes a \`worktree\` field ("active", "failed", or
|
|
146
|
+
"none") and \`worktreePath\`. If worktree is "failed", the child works
|
|
147
|
+
directly in the main repo directory — watch it more closely.
|
|
132
148
|
|
|
133
149
|
### What Child Sessions Can Do Automatically
|
|
134
150
|
Child sessions have a broad set of pre-approved tools for standard dev work:
|
|
@@ -136,6 +152,9 @@ Child sessions have a broad set of pre-approved tools for standard dev work:
|
|
|
136
152
|
- **Git & GitHub**: git (all subcommands), gh (PRs, issues, runs)
|
|
137
153
|
- **Package managers**: npm, npx, yarn, pnpm, bun
|
|
138
154
|
- **Build tools**: node, tsc, eslint, prettier, cargo, go, make, pip
|
|
155
|
+
- **Python**: python3, pytest
|
|
156
|
+
- **Text/data**: sed, rg, jq
|
|
157
|
+
- **File management** (non-destructive): mkdir, cp, mv, touch
|
|
139
158
|
- **Filesystem** (read-only): ls, cat, head, tail, sort, diff, tree, wc, which, file
|
|
140
159
|
|
|
141
160
|
They do NOT have access to destructive commands (rm, sudo, docker,
|
|
@@ -158,6 +177,12 @@ curl -s "http://localhost:$CODEKIN_PORT/api/orchestrator/children" \\
|
|
|
158
177
|
# Get specific child session
|
|
159
178
|
curl -s "http://localhost:$CODEKIN_PORT/api/orchestrator/children/SESSION_ID" \\
|
|
160
179
|
-H "Authorization: Bearer $CODEKIN_AUTH_TOKEN"
|
|
180
|
+
|
|
181
|
+
# Read the tail of a child's transcript (what Claude actually output).
|
|
182
|
+
# Useful when a child stops with "Completion not verified" or gets stuck.
|
|
183
|
+
# ?limit caps the returned characters (default 5000, max 50000).
|
|
184
|
+
curl -s "http://localhost:$CODEKIN_PORT/api/orchestrator/children/SESSION_ID/transcript?limit=10000" \\
|
|
185
|
+
-H "Authorization: Bearer $CODEKIN_AUTH_TOKEN"
|
|
161
186
|
\`\`\`
|
|
162
187
|
|
|
163
188
|
## Scheduling Reminders & Recurring Tasks
|
|
@@ -171,16 +196,26 @@ You have access to CronCreate, CronDelete, and CronList tools for in-session sch
|
|
|
171
196
|
Examples:
|
|
172
197
|
- Every morning at 9am: \`cron: "3 9 * * *"\`, \`prompt: "Check for new reports"\`
|
|
173
198
|
- One-shot reminder: \`cron: "0 14 22 3 *"\`, \`prompt: "Follow up on deploy"\`, \`recurring: false\`
|
|
174
|
-
|
|
199
|
+
|
|
200
|
+
You do NOT need a recurring cron to watch child sessions — the server
|
|
201
|
+
pushes you a notification the moment a child blocks on an approval,
|
|
202
|
+
finishes, fails, or times out. Use crons for reminders and scheduled
|
|
203
|
+
work, not for polling.
|
|
175
204
|
|
|
176
205
|
Important: The \`cron\` parameter must be a plain string like \`"0 9 * * *"\`, NOT an object.
|
|
177
206
|
Jobs only live in this session — they are lost when the session restarts. Recurring jobs auto-expire after 7 days.
|
|
178
207
|
|
|
179
208
|
## Monitoring Sessions
|
|
180
|
-
|
|
181
|
-
-
|
|
182
|
-
|
|
183
|
-
|
|
209
|
+
You receive push notifications about your child sessions automatically:
|
|
210
|
+
- **Blocked**: the child is waiting on a tool approval or question — the
|
|
211
|
+
notification includes the requestId and the exact curl to respond
|
|
212
|
+
- **Stopped**: the child completed, failed, or timed out
|
|
213
|
+
|
|
214
|
+
The server also verifies completion against ground truth (does the PR /
|
|
215
|
+
pushed branch actually exist?) and nudges the child once if the final
|
|
216
|
+
step is missing. When a "Stopped" notification carries a
|
|
217
|
+
"Completion not verified" note, the final step still didn't land —
|
|
218
|
+
inspect the worktree and finish it or respawn.
|
|
184
219
|
- If the session gets stuck or fails, inform the user and suggest next steps
|
|
185
220
|
- When done, summarize what was accomplished
|
|
186
221
|
|
|
@@ -188,31 +223,31 @@ After spawning a session:
|
|
|
188
223
|
Sessions can get stuck waiting for tool approvals or user answers. You can
|
|
189
224
|
discover and unblock them:
|
|
190
225
|
|
|
191
|
-
|
|
226
|
+
\`\`\`bash
|
|
192
227
|
# List all sessions with pending prompts
|
|
193
228
|
curl -s "http://localhost:$CODEKIN_PORT/api/orchestrator/sessions/pending-prompts" \\
|
|
194
229
|
-H "Authorization: Bearer $CODEKIN_AUTH_TOKEN"
|
|
195
|
-
|
|
230
|
+
\`\`\`
|
|
196
231
|
|
|
197
|
-
Returns sessions with their pending prompts, including the
|
|
198
|
-
|
|
232
|
+
Returns sessions with their pending prompts, including the \`requestId\`,
|
|
233
|
+
\`toolName\`, and \`promptType\` ("permission" or "question").
|
|
199
234
|
|
|
200
235
|
### Giving Approvals to Stuck Sessions
|
|
201
236
|
If a child session is blocked on a tool approval and you're confident it's
|
|
202
237
|
safe, you can approve it directly:
|
|
203
238
|
|
|
204
|
-
|
|
239
|
+
\`\`\`bash
|
|
205
240
|
curl -s -X POST "http://localhost:$CODEKIN_PORT/api/orchestrator/sessions/SESSION_ID/respond" \\
|
|
206
241
|
-H "Authorization: Bearer $CODEKIN_AUTH_TOKEN" \\
|
|
207
242
|
-H "Content-Type: application/json" \\
|
|
208
243
|
-d '{"requestId": "REQUEST_ID", "value": "allow"}'
|
|
209
|
-
|
|
244
|
+
\`\`\`
|
|
210
245
|
|
|
211
|
-
Values:
|
|
246
|
+
Values: \`"allow"\`, \`"deny"\`, \`"always_allow"\`, or free text for question prompts.
|
|
212
247
|
|
|
213
248
|
**Guidelines for giving approvals:**
|
|
214
249
|
- Only approve tools you understand — if unsure, ask the user
|
|
215
|
-
- Prefer
|
|
250
|
+
- Prefer \`"allow"\` over \`"always_allow"\` for child sessions
|
|
216
251
|
- Never approve destructive commands (rm -rf, git push --force, DROP TABLE)
|
|
217
252
|
without user confirmation
|
|
218
253
|
- For question prompts, provide a reasonable answer or ask the user
|
|
@@ -273,9 +308,9 @@ Users can manage trust directly in chat:
|
|
|
273
308
|
4. Read skill-profile.json for guidance style adaptation
|
|
274
309
|
5. Check for new audit reports that may have landed
|
|
275
310
|
6. Check for decisions pending outcome assessment
|
|
276
|
-
7. **Re-establish cron jobs** — cron jobs do not survive session restarts, so
|
|
311
|
+
7. **Re-establish cron jobs** — cron jobs do not survive session restarts, so re-create your scheduled work on startup:
|
|
277
312
|
- Report check: \`cron: "3 9 * * *"\`, \`prompt: "Check for new audit reports across all managed repos and triage any new findings"\`
|
|
278
|
-
-
|
|
313
|
+
- Do NOT create a child-session polling cron — the server pushes blocked/terminal notifications to you in realtime.
|
|
279
314
|
8. Greet the user with a brief, friendly status update
|
|
280
315
|
|
|
281
316
|
### Greeting Guidelines
|
|
@@ -294,16 +329,33 @@ export function ensureOrchestratorDir() {
|
|
|
294
329
|
const journalDir = join(ORCHESTRATOR_DIR, 'journal');
|
|
295
330
|
if (!existsSync(journalDir))
|
|
296
331
|
mkdirSync(journalDir, { recursive: true });
|
|
297
|
-
// Seed files only if they don't exist (preserve user edits)
|
|
332
|
+
// Seed memory files only if they don't exist (preserve user edits)
|
|
298
333
|
const seeds = [
|
|
299
334
|
[join(ORCHESTRATOR_DIR, 'PROFILE.md'), PROFILE_TEMPLATE],
|
|
300
335
|
[join(ORCHESTRATOR_DIR, 'REPOS.md'), REPOS_TEMPLATE],
|
|
301
|
-
[join(ORCHESTRATOR_DIR, 'CLAUDE.md'), CLAUDE_MD_TEMPLATE],
|
|
302
336
|
];
|
|
303
337
|
for (const [path, content] of seeds) {
|
|
304
338
|
if (!existsSync(path))
|
|
305
339
|
writeFileSync(path, content, 'utf-8');
|
|
306
340
|
}
|
|
341
|
+
// CLAUDE.md is system-managed: refresh it whenever the embedded template
|
|
342
|
+
// version is older than the current one (or missing entirely).
|
|
343
|
+
const claudeMdPath = join(ORCHESTRATOR_DIR, 'CLAUDE.md');
|
|
344
|
+
if (readTemplateVersion(claudeMdPath) < CLAUDE_MD_TEMPLATE_VERSION) {
|
|
345
|
+
writeFileSync(claudeMdPath, CLAUDE_MD_TEMPLATE, 'utf-8');
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
/** Parse the template version stamp from a seeded CLAUDE.md; 0 when absent. */
|
|
349
|
+
export function readTemplateVersion(path) {
|
|
350
|
+
try {
|
|
351
|
+
if (!existsSync(path))
|
|
352
|
+
return 0;
|
|
353
|
+
const match = /<!-- codekin-template-version: (\d+) -->/.exec(readFileSync(path, 'utf-8'));
|
|
354
|
+
return match ? parseInt(match[1], 10) : 0;
|
|
355
|
+
}
|
|
356
|
+
catch {
|
|
357
|
+
return 0;
|
|
358
|
+
}
|
|
307
359
|
}
|
|
308
360
|
/** Get or create a stable session UUID that persists across restarts. */
|
|
309
361
|
export function getOrCreateOrchestratorId() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator-manager.js","sourceRoot":"","sources":["../orchestrator-manager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI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U,CAAC,eAAe,CAAC;QAC1C,CAAC,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE;QAC/C,CAAC,CAAC,IAAI,CAAA;IACR,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAA;IAC1B,OAAO,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAA;AACjD,CAAC"}
|
|
@@ -55,9 +55,15 @@ export declare class OrchestratorMonitor {
|
|
|
55
55
|
private addNotification;
|
|
56
56
|
/** Deliver a notification to the orchestrator chat session. */
|
|
57
57
|
private deliverToOrchestrator;
|
|
58
|
-
/** Discover repo paths from REPOS_ROOT. */
|
|
58
|
+
/** Discover repo paths from REPOS_ROOT (see discoverRepoPathsUnder). */
|
|
59
59
|
private discoverRepoPaths;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Discover git repositories under a root directory, recursing one level into
|
|
63
|
+
* non-repo directories so org-style layouts (root/org/repo) are picked up
|
|
64
|
+
* alongside flat ones (root/repo). Unreadable entries are skipped.
|
|
65
|
+
*/
|
|
66
|
+
export declare function discoverRepoPathsUnder(root: string): string[];
|
|
61
67
|
/**
|
|
62
68
|
* Suppress passive-repo alerts unless at least one workflow is enabled for the
|
|
63
69
|
* repo — there's nothing to "de-schedule" otherwise, so the nag is noise.
|
|
@@ -10,6 +10,7 @@ import { join } from 'path';
|
|
|
10
10
|
import { scanRepoReports } from './orchestrator-reports.js';
|
|
11
11
|
import { runAgingCycle, getPendingOutcomeAssessments } from './orchestrator-learning.js';
|
|
12
12
|
import { getOrchestratorSessionId } from './orchestrator-manager.js';
|
|
13
|
+
import { getOrchestratorOutbox } from './orchestrator-outbox.js';
|
|
13
14
|
import { REPOS_ROOT, getAgentDisplayName } from './config.js';
|
|
14
15
|
import { loadWorkflowConfig } from './workflow-config.js';
|
|
15
16
|
// ---------------------------------------------------------------------------
|
|
@@ -224,37 +225,66 @@ export class OrchestratorMonitor {
|
|
|
224
225
|
if (!orchestratorId)
|
|
225
226
|
return;
|
|
226
227
|
const session = this.sessions.get(orchestratorId);
|
|
227
|
-
if (!session?.claudeProcess?.isAlive())
|
|
228
|
+
if (!session?.claudeProcess?.isAlive()) {
|
|
229
|
+
// Orchestrator not running — hand the notification to the persistent
|
|
230
|
+
// outbox so it is replayed (as a digest) when the session comes back,
|
|
231
|
+
// instead of rotting in the in-memory buffer forever.
|
|
232
|
+
getOrchestratorOutbox().enqueue({
|
|
233
|
+
label: notification.severity.toUpperCase(),
|
|
234
|
+
title: notification.title,
|
|
235
|
+
body: notification.body,
|
|
236
|
+
});
|
|
237
|
+
notification.delivered = true;
|
|
228
238
|
return;
|
|
239
|
+
}
|
|
229
240
|
// Send as a system message that the orchestrator will see and respond to
|
|
230
241
|
const message = `[Agent ${getAgentDisplayName()} Notification — ${notification.severity.toUpperCase()}]\n${notification.title}\n${notification.body}`;
|
|
231
242
|
this.sessions.sendInput(orchestratorId, message);
|
|
232
243
|
notification.delivered = true;
|
|
233
244
|
}
|
|
234
|
-
/** Discover repo paths from REPOS_ROOT. */
|
|
245
|
+
/** Discover repo paths from REPOS_ROOT (see discoverRepoPathsUnder). */
|
|
235
246
|
discoverRepoPaths() {
|
|
236
|
-
|
|
237
|
-
return [];
|
|
238
|
-
try {
|
|
239
|
-
return readdirSync(REPOS_ROOT)
|
|
240
|
-
.map(name => join(REPOS_ROOT, name))
|
|
241
|
-
.filter(p => {
|
|
242
|
-
try {
|
|
243
|
-
return statSync(p).isDirectory() && existsSync(join(p, '.git'));
|
|
244
|
-
}
|
|
245
|
-
catch {
|
|
246
|
-
return false;
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
catch {
|
|
251
|
-
return [];
|
|
252
|
-
}
|
|
247
|
+
return discoverRepoPathsUnder(REPOS_ROOT);
|
|
253
248
|
}
|
|
254
249
|
}
|
|
255
250
|
// ---------------------------------------------------------------------------
|
|
256
251
|
// Helpers
|
|
257
252
|
// ---------------------------------------------------------------------------
|
|
253
|
+
/**
|
|
254
|
+
* Discover git repositories under a root directory, recursing one level into
|
|
255
|
+
* non-repo directories so org-style layouts (root/org/repo) are picked up
|
|
256
|
+
* alongside flat ones (root/repo). Unreadable entries are skipped.
|
|
257
|
+
*/
|
|
258
|
+
export function discoverRepoPathsUnder(root) {
|
|
259
|
+
if (!existsSync(root))
|
|
260
|
+
return [];
|
|
261
|
+
const repos = [];
|
|
262
|
+
const scan = (dir, depth) => {
|
|
263
|
+
let entries;
|
|
264
|
+
try {
|
|
265
|
+
entries = readdirSync(dir);
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
for (const name of entries) {
|
|
271
|
+
const p = join(dir, name);
|
|
272
|
+
try {
|
|
273
|
+
if (!statSync(p).isDirectory())
|
|
274
|
+
continue;
|
|
275
|
+
if (existsSync(join(p, '.git')))
|
|
276
|
+
repos.push(p);
|
|
277
|
+
else if (depth < 2)
|
|
278
|
+
scan(p, depth + 1);
|
|
279
|
+
}
|
|
280
|
+
catch {
|
|
281
|
+
// unreadable entry — skip
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
scan(root, 1);
|
|
286
|
+
return repos;
|
|
287
|
+
}
|
|
258
288
|
/**
|
|
259
289
|
* Suppress passive-repo alerts unless at least one workflow is enabled for the
|
|
260
290
|
* repo — there's nothing to "de-schedule" otherwise, so the nag is noise.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator-monitor.js","sourceRoot":"","sources":["../orchestrator-monitor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA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AAK,GAAG,CAAC;oBAAE,IAAI,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAA;YACxC,CAAC;YAAC,MAAM,CAAC;gBACP,0BAA0B;YAC5B,CAAC;QACH,CAAC;IACH,CAAC,CAAA;IACD,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACb,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CACvC,QAAgB,EAChB,WAA+B;IAE/B,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,CAAA;AACpE,CAAC"}
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
*
|
|
10
10
|
* which is the established style used by the proactive monitor and surfaced
|
|
11
11
|
* inside the orchestrator chat.
|
|
12
|
+
*
|
|
13
|
+
* When the recipient session cannot be reached (missing or its Claude
|
|
14
|
+
* process is not running), the notification is queued in the persistent
|
|
15
|
+
* outbox and replayed as a digest once the orchestrator is back.
|
|
12
16
|
*/
|
|
13
17
|
import type { SessionManager } from './session-manager.js';
|
|
14
18
|
export interface OrchestratorNotifyArgs {
|
|
@@ -21,9 +25,18 @@ export interface OrchestratorNotifyArgs {
|
|
|
21
25
|
/** Remaining body — multi-line is fine. */
|
|
22
26
|
body: string;
|
|
23
27
|
}
|
|
28
|
+
/** Minimal outbox surface needed by this helper (injectable for tests). */
|
|
29
|
+
export interface NotificationOutbox {
|
|
30
|
+
enqueue(args: {
|
|
31
|
+
label: string;
|
|
32
|
+
title: string;
|
|
33
|
+
body: string;
|
|
34
|
+
}): void;
|
|
35
|
+
}
|
|
24
36
|
/**
|
|
25
37
|
* Send a notification to the parent session via Claude stdin.
|
|
26
|
-
* Returns true when delivered
|
|
27
|
-
* (
|
|
38
|
+
* Returns true when delivered immediately OR queued in the outbox for
|
|
39
|
+
* replay (the outbox owns delivery from that point on). Returns false only
|
|
40
|
+
* when queueing itself failed.
|
|
28
41
|
*/
|
|
29
|
-
export declare function sendOrchestratorNotification(sessions: SessionManager, args: OrchestratorNotifyArgs): boolean;
|
|
42
|
+
export declare function sendOrchestratorNotification(sessions: SessionManager, args: OrchestratorNotifyArgs, outbox?: NotificationOutbox): boolean;
|
|
@@ -9,19 +9,34 @@
|
|
|
9
9
|
*
|
|
10
10
|
* which is the established style used by the proactive monitor and surfaced
|
|
11
11
|
* inside the orchestrator chat.
|
|
12
|
+
*
|
|
13
|
+
* When the recipient session cannot be reached (missing or its Claude
|
|
14
|
+
* process is not running), the notification is queued in the persistent
|
|
15
|
+
* outbox and replayed as a digest once the orchestrator is back.
|
|
12
16
|
*/
|
|
13
17
|
import { getAgentDisplayName } from './config.js';
|
|
18
|
+
import { getOrchestratorOutbox } from './orchestrator-outbox.js';
|
|
14
19
|
/**
|
|
15
20
|
* Send a notification to the parent session via Claude stdin.
|
|
16
|
-
* Returns true when delivered
|
|
17
|
-
* (
|
|
21
|
+
* Returns true when delivered immediately OR queued in the outbox for
|
|
22
|
+
* replay (the outbox owns delivery from that point on). Returns false only
|
|
23
|
+
* when queueing itself failed.
|
|
18
24
|
*/
|
|
19
|
-
export function sendOrchestratorNotification(sessions, args) {
|
|
25
|
+
export function sendOrchestratorNotification(sessions, args, outbox = getOrchestratorOutbox()) {
|
|
20
26
|
const session = sessions.get(args.parentSessionId);
|
|
21
|
-
if (
|
|
27
|
+
if (session?.claudeProcess?.isAlive()) {
|
|
28
|
+
const message = `[Agent ${getAgentDisplayName()} Notification — ${args.label}]\n${args.title}\n${args.body}`;
|
|
29
|
+
sessions.sendInput(args.parentSessionId, message);
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
// Parent unreachable — queue for replay when the orchestrator comes back.
|
|
33
|
+
try {
|
|
34
|
+
outbox.enqueue({ label: args.label, title: args.title, body: args.body });
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
console.warn('[orchestrator-notify] failed to queue notification:', err);
|
|
22
39
|
return false;
|
|
23
|
-
|
|
24
|
-
sessions.sendInput(args.parentSessionId, message);
|
|
25
|
-
return true;
|
|
40
|
+
}
|
|
26
41
|
}
|
|
27
42
|
//# sourceMappingURL=orchestrator-notify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator-notify.js","sourceRoot":"","sources":["../orchestrator-notify.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"orchestrator-notify.js","sourceRoot":"","sources":["../orchestrator-notify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAkBhE;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAC1C,QAAwB,EACxB,IAA4B,EAC5B,SAA6B,qBAAqB,EAAE;IAEpD,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;IAClD,IAAI,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,CAAC;QACtC,MAAM,OAAO,GAAG,UAAU,mBAAmB,EAAE,mBAAmB,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,EAAE,CAAA;QAC5G,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;QACjD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,0EAA0E;IAC1E,IAAI,CAAC;QACH,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QACzE,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,qDAAqD,EAAE,GAAG,CAAC,CAAA;QACxE,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persistent outbox for orchestrator notifications.
|
|
3
|
+
*
|
|
4
|
+
* When a notification cannot be delivered to the orchestrator session
|
|
5
|
+
* (Claude process not running), it is queued here and replayed as a single
|
|
6
|
+
* digest message once the orchestrator is back. The queue survives server
|
|
7
|
+
* restarts via a JSON file in the orchestrator workspace.
|
|
8
|
+
*/
|
|
9
|
+
import type { SessionManager } from './session-manager.js';
|
|
10
|
+
export interface OutboxItem {
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
title: string;
|
|
14
|
+
body: string;
|
|
15
|
+
queuedAt: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class OrchestratorOutbox {
|
|
18
|
+
private items;
|
|
19
|
+
private filePath;
|
|
20
|
+
private flushTimer;
|
|
21
|
+
constructor(filePath?: string);
|
|
22
|
+
/** Number of queued (undelivered) notifications. */
|
|
23
|
+
size(): number;
|
|
24
|
+
/** Queue a notification for later delivery. Oldest items are dropped at the cap. */
|
|
25
|
+
enqueue(args: {
|
|
26
|
+
label: string;
|
|
27
|
+
title: string;
|
|
28
|
+
body: string;
|
|
29
|
+
}): void;
|
|
30
|
+
/**
|
|
31
|
+
* Attempt to deliver all queued items to the orchestrator session as a
|
|
32
|
+
* single digest message. No-op when the queue is empty, the orchestrator
|
|
33
|
+
* session is missing / not running, or the rate-limit circuit breaker is
|
|
34
|
+
* open. Returns the number of items delivered.
|
|
35
|
+
*/
|
|
36
|
+
flush(sessions: SessionManager): number;
|
|
37
|
+
/** Start a background timer that periodically attempts a flush. */
|
|
38
|
+
startFlusher(sessions: SessionManager, intervalMs?: number): void;
|
|
39
|
+
/** Stop the background flusher. */
|
|
40
|
+
stopFlusher(): void;
|
|
41
|
+
private buildDigest;
|
|
42
|
+
private load;
|
|
43
|
+
private persist;
|
|
44
|
+
}
|
|
45
|
+
/** Get the process-wide outbox instance. */
|
|
46
|
+
export declare function getOrchestratorOutbox(): OrchestratorOutbox;
|
|
47
|
+
/** Test-only: replace the singleton (pass null to reset). */
|
|
48
|
+
export declare function setOrchestratorOutboxForTest(outbox: OrchestratorOutbox | null): void;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persistent outbox for orchestrator notifications.
|
|
3
|
+
*
|
|
4
|
+
* When a notification cannot be delivered to the orchestrator session
|
|
5
|
+
* (Claude process not running), it is queued here and replayed as a single
|
|
6
|
+
* digest message once the orchestrator is back. The queue survives server
|
|
7
|
+
* restarts via a JSON file in the orchestrator workspace.
|
|
8
|
+
*/
|
|
9
|
+
import { dirname, join } from 'path';
|
|
10
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
11
|
+
import { randomUUID } from 'crypto';
|
|
12
|
+
import { DATA_DIR, getAgentDisplayName } from './config.js';
|
|
13
|
+
import { getOrchestratorSessionId } from './orchestrator-manager.js';
|
|
14
|
+
/** Hard cap on queued items — oldest entries are dropped beyond this. */
|
|
15
|
+
const MAX_QUEUED_ITEMS = 200;
|
|
16
|
+
/** Default interval for the background flusher. */
|
|
17
|
+
const FLUSH_INTERVAL_MS = 60_000;
|
|
18
|
+
export class OrchestratorOutbox {
|
|
19
|
+
items = [];
|
|
20
|
+
filePath;
|
|
21
|
+
flushTimer = null;
|
|
22
|
+
constructor(filePath = join(DATA_DIR, 'orchestrator', 'outbox.json')) {
|
|
23
|
+
this.filePath = filePath;
|
|
24
|
+
this.load();
|
|
25
|
+
}
|
|
26
|
+
/** Number of queued (undelivered) notifications. */
|
|
27
|
+
size() {
|
|
28
|
+
return this.items.length;
|
|
29
|
+
}
|
|
30
|
+
/** Queue a notification for later delivery. Oldest items are dropped at the cap. */
|
|
31
|
+
enqueue(args) {
|
|
32
|
+
this.items.push({
|
|
33
|
+
id: randomUUID(),
|
|
34
|
+
label: args.label,
|
|
35
|
+
title: args.title,
|
|
36
|
+
body: args.body,
|
|
37
|
+
queuedAt: new Date().toISOString(),
|
|
38
|
+
});
|
|
39
|
+
if (this.items.length > MAX_QUEUED_ITEMS) {
|
|
40
|
+
this.items = this.items.slice(-MAX_QUEUED_ITEMS);
|
|
41
|
+
}
|
|
42
|
+
this.persist();
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Attempt to deliver all queued items to the orchestrator session as a
|
|
46
|
+
* single digest message. No-op when the queue is empty, the orchestrator
|
|
47
|
+
* session is missing / not running, or the rate-limit circuit breaker is
|
|
48
|
+
* open. Returns the number of items delivered.
|
|
49
|
+
*/
|
|
50
|
+
flush(sessions) {
|
|
51
|
+
if (this.items.length === 0)
|
|
52
|
+
return 0;
|
|
53
|
+
if (sessions.isRateLimited())
|
|
54
|
+
return 0;
|
|
55
|
+
const orchestratorId = getOrchestratorSessionId(sessions);
|
|
56
|
+
if (!orchestratorId)
|
|
57
|
+
return 0;
|
|
58
|
+
const session = sessions.get(orchestratorId);
|
|
59
|
+
if (!session?.claudeProcess?.isAlive())
|
|
60
|
+
return 0;
|
|
61
|
+
const count = this.items.length;
|
|
62
|
+
const digest = this.buildDigest();
|
|
63
|
+
// Clear before sending: if sendInput throws we'd rather drop than
|
|
64
|
+
// double-deliver on the next flush tick.
|
|
65
|
+
this.items = [];
|
|
66
|
+
this.persist();
|
|
67
|
+
sessions.sendInput(orchestratorId, digest);
|
|
68
|
+
return count;
|
|
69
|
+
}
|
|
70
|
+
/** Start a background timer that periodically attempts a flush. */
|
|
71
|
+
startFlusher(sessions, intervalMs = FLUSH_INTERVAL_MS) {
|
|
72
|
+
if (this.flushTimer)
|
|
73
|
+
return;
|
|
74
|
+
this.flushTimer = setInterval(() => {
|
|
75
|
+
try {
|
|
76
|
+
const delivered = this.flush(sessions);
|
|
77
|
+
if (delivered > 0) {
|
|
78
|
+
console.log(`[orchestrator-outbox] replayed ${delivered} queued notification(s)`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
console.error('[orchestrator-outbox] flush error:', err);
|
|
83
|
+
}
|
|
84
|
+
}, intervalMs);
|
|
85
|
+
if (this.flushTimer.unref)
|
|
86
|
+
this.flushTimer.unref();
|
|
87
|
+
}
|
|
88
|
+
/** Stop the background flusher. */
|
|
89
|
+
stopFlusher() {
|
|
90
|
+
if (this.flushTimer) {
|
|
91
|
+
clearInterval(this.flushTimer);
|
|
92
|
+
this.flushTimer = null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// -------------------------------------------------------------------------
|
|
96
|
+
// Internal
|
|
97
|
+
// -------------------------------------------------------------------------
|
|
98
|
+
buildDigest() {
|
|
99
|
+
const agent = getAgentDisplayName();
|
|
100
|
+
const header = this.items.length === 1
|
|
101
|
+
? `[Agent ${agent} Notification — ${this.items[0].label} (queued while you were away)]`
|
|
102
|
+
: `[Agent ${agent} Notifications — ${this.items.length} queued while you were away]`;
|
|
103
|
+
const sections = this.items.map(item => {
|
|
104
|
+
const ts = item.queuedAt.replace('T', ' ').slice(0, 16);
|
|
105
|
+
return this.items.length === 1
|
|
106
|
+
? `${item.title}\n${item.body}`
|
|
107
|
+
: `--- [${item.label}] ${ts} ---\n${item.title}\n${item.body}`;
|
|
108
|
+
});
|
|
109
|
+
return [header, ...sections].join('\n');
|
|
110
|
+
}
|
|
111
|
+
load() {
|
|
112
|
+
try {
|
|
113
|
+
if (!existsSync(this.filePath))
|
|
114
|
+
return;
|
|
115
|
+
const parsed = JSON.parse(readFileSync(this.filePath, 'utf-8'));
|
|
116
|
+
if (Array.isArray(parsed)) {
|
|
117
|
+
this.items = parsed.filter((it) => !!it && typeof it === 'object'
|
|
118
|
+
&& typeof it.label === 'string'
|
|
119
|
+
&& typeof it.title === 'string'
|
|
120
|
+
&& typeof it.body === 'string').slice(-MAX_QUEUED_ITEMS);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
console.warn('[orchestrator-outbox] failed to load outbox file, starting empty:', err);
|
|
125
|
+
this.items = [];
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
persist() {
|
|
129
|
+
try {
|
|
130
|
+
const dir = dirname(this.filePath);
|
|
131
|
+
if (!existsSync(dir))
|
|
132
|
+
mkdirSync(dir, { recursive: true });
|
|
133
|
+
writeFileSync(this.filePath, JSON.stringify(this.items, null, 2), 'utf-8');
|
|
134
|
+
}
|
|
135
|
+
catch (err) {
|
|
136
|
+
console.warn('[orchestrator-outbox] failed to persist outbox file:', err);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// ---------------------------------------------------------------------------
|
|
141
|
+
// Singleton
|
|
142
|
+
// ---------------------------------------------------------------------------
|
|
143
|
+
let singleton = null;
|
|
144
|
+
/** Get the process-wide outbox instance. */
|
|
145
|
+
export function getOrchestratorOutbox() {
|
|
146
|
+
if (!singleton)
|
|
147
|
+
singleton = new OrchestratorOutbox();
|
|
148
|
+
return singleton;
|
|
149
|
+
}
|
|
150
|
+
/** Test-only: replace the singleton (pass null to reset). */
|
|
151
|
+
export function setOrchestratorOutboxForTest(outbox) {
|
|
152
|
+
singleton = outbox;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=orchestrator-outbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator-outbox.js","sourceRoot":"","sources":["../orchestrator-outbox.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,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