@volter/supercode-orchestrator 0.4.20 → 0.4.22
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/board/cli.mjs +2 -2
- package/board/dispatch.mjs +10 -3
- package/package.json +1 -1
package/board/cli.mjs
CHANGED
|
@@ -512,11 +512,11 @@ export async function runWorkflow(argv) {
|
|
|
512
512
|
const results = [];
|
|
513
513
|
for (const t of targets) {
|
|
514
514
|
if (verb === 'specify' && (args.title !== undefined || args.body !== undefined)) {
|
|
515
|
-
withBoard((b) => engine.specify(b, t, { title: args.title ?? null, body: args.body ?? null, author: args.author ?? callerName() }));
|
|
515
|
+
withBoard((b) => engine.specify(b, t, { title: args.title ?? null, body: args.body ?? null, author: args.author ?? callerAddress() ?? callerName() }));
|
|
516
516
|
results.push({ id: t, specified: true });
|
|
517
517
|
} else if (verb === 'decompose' && args.child?.length) {
|
|
518
518
|
const children = args.child.map((c) => { const [title, assignee] = c.split(/@(?=[^@]*$)/); return { title: title.trim(), assignee: assignee?.trim() || undefined }; });
|
|
519
|
-
results.push({ id: t, children: withBoard((b) => engine.decompose(b, t, children, { author: args.author ?? callerName() })) });
|
|
519
|
+
results.push({ id: t, children: withBoard((b) => engine.decompose(b, t, children, { author: args.author ?? callerAddress() ?? callerName() })) });
|
|
520
520
|
} else {
|
|
521
521
|
const session = withBoard((b) => startTriageSession(b, t, lanes, settings, verb));
|
|
522
522
|
results.push({ id: t, session: session.address, mode: session.mode });
|
package/board/dispatch.mjs
CHANGED
|
@@ -31,7 +31,7 @@ const WORKER = fileURLToPath(new URL('../bin/hermes-worker.mjs', import.meta.url
|
|
|
31
31
|
const MAIL_KINDS = {
|
|
32
32
|
creator: ['completed', 'blocked', 'gave_up', 'crashed', 'timed_out', 'status', 'archived', 'block_loop_detected', 'review_requested',
|
|
33
33
|
'changes_requested', 'session_started', 'session_resumed', 'session_replaced', 'session_adopted', 'session_lost', 'spawn_failed'],
|
|
34
|
-
worker: ['commented', 'assigned', 'machine_set', 'blocked', 'unblocked', 'completed', 'archived', 'changes_requested', 'linked', 'unlinked', 'promoted_manual', 'subtask_added'],
|
|
34
|
+
worker: ['commented', 'assigned', 'machine_set', 'blocked', 'unblocked', 'completed', 'archived', 'changes_requested', 'linked', 'unlinked', 'promoted_manual', 'subtask_added', 'session_adopted'],
|
|
35
35
|
// a card the session's own card depends on: it sees it change
|
|
36
36
|
dependency: ['completed', 'blocked', 'unblocked', 'archived', 'review_requested', 'changes_requested', 'commented'],
|
|
37
37
|
};
|
|
@@ -61,7 +61,7 @@ export const supercodeBin = () => process.env.SUPERCODE_BIN || 'supercode';
|
|
|
61
61
|
|
|
62
62
|
function sc(args, { input = null, timeout = 120_000 } = {}) {
|
|
63
63
|
// a neutral directory: `supercode teams …` resolves its entry from a checkout at the cwd
|
|
64
|
-
const r = spawnSync(supercodeBin(), args, { cwd: tmpdir(), input: input ?? undefined, encoding: 'utf8', timeout, env: process.env });
|
|
64
|
+
const r = spawnSync(supercodeBin(), args, { cwd: tmpdir(), input: input ?? undefined, encoding: 'utf8', timeout, env: process.env, maxBuffer: 512 * 1024 * 1024 });
|
|
65
65
|
return { code: r.status, stdout: r.stdout ?? '', stderr: (r.stderr ?? '') + (r.error ? r.error.message : '') };
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -590,7 +590,12 @@ export function adoptSession(board, id, who, { workspace = null, ttl, assignee =
|
|
|
590
590
|
if (!found) throw new Error(`the fleet lists no live session ${who}`);
|
|
591
591
|
const [, host, harness, sessionId] = found.address.split(':');
|
|
592
592
|
if (harness !== 'claude-code') throw new Error(`${found.address} is ${harness}; the board resumes claude-code sessions by id`);
|
|
593
|
+
// the session's own working directory, as discovery records it (where `--resume` finds it), else its pane's
|
|
593
594
|
let dir = workspace;
|
|
595
|
+
if (!dir) {
|
|
596
|
+
const r = sc(['discover', '--on', host, '--harness', harness, '--limit', '2000'], { timeout: 120_000 });
|
|
597
|
+
dir = (json(r.stdout.trim(), {})?.sessions ?? []).find((x) => x.locator?.session_id === sessionId)?.cwd ?? null;
|
|
598
|
+
}
|
|
594
599
|
if (!dir && found.pane) {
|
|
595
600
|
const r = sc(['teams', 'panes', 'ls', '--machine', host], { timeout: 60_000 });
|
|
596
601
|
dir = (json(r.stdout.trim(), []) ?? []).find((p) => p.pane === found.pane)?.cwd ?? null;
|
|
@@ -634,7 +639,9 @@ function notice(kind, task, p, role) {
|
|
|
634
639
|
const verb = { session_started: 'started', session_resumed: 'resumed', session_replaced: 'could not resume the card\'s last session and started' }[kind];
|
|
635
640
|
return `▶ ${who}card ${tid} — ${title}: the board ${verb} session ${p.session_id} on ${p.machine} (pane ${p.pane}; ${p.address}).`;
|
|
636
641
|
}
|
|
637
|
-
case 'session_adopted': return
|
|
642
|
+
case 'session_adopted': return role === 'worker'
|
|
643
|
+
? `▶ card ${tid} — ${title} is running again, with you: carry it on from where it stands (\`supercode workflow show ${tid}\` reads it).`
|
|
644
|
+
: `▶ ${who}card ${tid} — ${title}: the board found session ${p.session_id} still live on ${p.machine} and kept it (${p.address}).`;
|
|
638
645
|
case 'session_lost': return `✖ ${who}card ${tid}: session ${p.session_id} is gone from ${p.machine}; the board resumes it, and replaces it from the card only when it cannot.`;
|
|
639
646
|
case 'spawn_failed': return `✖ ${who}card ${tid}: its session did not start: ${String(p.error ?? '').slice(0, 300)}`;
|
|
640
647
|
case 'completed': return `✔ ${who}card ${tid} done — ${title}${p.summary ? `\n${String(p.summary).slice(0, 300)}` : ''}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-orchestrator",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The orchestrator runtime over the Volter Harness ontology: one typed operational model whose folder is its serialization, read and written through the harness orchestration doors (docs/ORCHESTRATOR-IR.md)",
|
|
6
6
|
"exports": {
|