Files
skills/orchestrator/templates/page-spawn.js
T
Kevin Veen-BirkenbachandClaude Opus 5.5 0fad1bfae3 feat: hub and skills requirements 032 to 063
Hub: send in the field (032), coherent speak box (033), stream head band (034), Match at full width with its pile (035, 036), Home without the outer box (037), badge to Match (038), rejects that survive a changed or withdrawn card (039), the release card (040), code marks in the review diff (041), why Deny is off (042), the undo window clock (043), widgets without inner boxes (044), the Artifacts head on one line (045), accepting a red gate's risk (046), one code box (047), done rows greyed and folded (048), one control height (049), menus that stay open (050), radio settings in the Device card (051), bubbles beside the modes (052), agent settings on every face and name (053), pin only by menu (054), WASD in Match (055), the flowing card edge (056), Schedules in Controls (057) and the hub poll cost (059).

Skills: the coach leaves for its own repository kevinveenbirkenbach/coach (058; test_install pins its four skills in skills-lock.json and stays red until that repository is published and pinned), hooks and timers start fewer processes (060), council files on hot paths stay bounded and mirror by marker instead of mtime (061), scripts and hooks hand agents less output (062), and block.py builds the commit table and message block in one run (063). Requirement documents 032 to 063 with their implementation amendments.

MEDUSA false positives accepted after kvb-think-criticize (36 lines): MM-SCAN-058 (pla inside replace or plan), JB-SCAN-616/641 (the local clip helper), CODEGEN-SCAN-001 (drop-in paths), CGS-SCAN-029 (systemctl argv from constants), CGS-SCAN-040 (runner poll loop), FLA-SCAN-055 (feedback), WM-SCAN-354, AI-BACKDOOR-006, GENAI-SCAN-1270, B604 (runner shell path for passkey-verified commands), TC004, EXA002, EXA006, EXA010 and WEB-SSRF.

🎯 Fix: 92 %
💥 Break: 8 %
💸 Tokens: 89 %
⏱️ Velocity: –
🛡️ Security: ~100 %
🏆 Score: 95
🚦 Gate: ⛔ break 8 % > 5

Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 08:44:15 +00:00

123 lines
5.3 KiB
JavaScript

const spawn = {subs: new Map(), loading: false, dom: null};
const SPAWN_KINDS = {operator: "bi-person-circle", chair: "bi-award", session: "bi-robot", subagent: "bi-cpu", twig: "bi-cpu"};
function sessionRunning(node) {
const life = (spawn.subs.get(node.id) || {}).data;
if (life && life.died) {
return false;
}
return node.claims.some((claim) => claim.beat !== null && claim.beat >= state.now - ACTIVE_BEAT);
}
function twigs(session) {
const data = (spawn.subs.get(session) || {}).data;
const rows = data ? data.subagents : [];
const roots = [];
const open = [];
for (const row of rows) {
const twig = {id: `${session}/${row.id}`, kind: "twig", label: `${row.type}: ${row.description}`, running: !row.finished, row, session, children: []};
open.length = Math.min(open.length, Math.max(row.depth - 1, 0));
(open.length ? open[open.length - 1].children : roots).push(twig);
open.push(twig);
}
return roots;
}
function spawnTree() {
const nodes = state.graph.nodes;
const chair = nodes.find((node) => node.kind === "chair");
const entry = (node) => ({
id: node.id, kind: node.kind, label: node.label, node,
running: node.kind === "operator" ? null : node.kind === "subagent" ? node.tasks.some((task) => task.status === "running") : sessionRunning(node),
children: [],
});
const root = entry(nodes.find((node) => node.kind === "operator"));
const byId = new Map([[root.id, root]]);
if (chair) {
byId.set(chair.id, entry(chair));
root.children.push(byId.get(chair.id));
}
for (const node of nodes.filter((item) => item.kind === "session")) {
byId.set(node.id, entry(node));
(byId.get(chairKey()) || root).children.push(byId.get(node.id));
}
for (const node of nodes.filter((item) => item.kind === "subagent")) {
(byId.get(node.parent) || byId.get(chairKey()) || root).children.push(entry(node));
}
for (const [id, held] of byId) {
if (held.kind === "session" || held.kind === "chair") {
held.children.push(...twigs(id));
}
}
return root;
}
function spawnFlat(root) {
const found = [];
const walk = (entry, depth, parent) => {
found.push({entry, depth, parent});
entry.children.forEach((child) => walk(child, depth + 1, entry));
};
walk(root, 0, null);
return found;
}
async function loadSpawn() {
if (spawn.loading) {
return;
}
const due = state.graph.nodes.filter((node) => (node.kind === "session" || node.kind === "chair") && SESSION_ID.test(node.id))
.filter((node) => !spawn.subs.has(node.id) || Date.now() - spawn.subs.get(node.id).at > SUBS_TTL);
if (!due.length) {
return;
}
spawn.loading = true;
await Promise.all(due.map(async (node) => {
let data = null;
try {
const response = await fetch(`/api/subagents?session=${encodeURIComponent(node.id)}`, {cache: "no-store"});
data = response.ok ? await response.json() : null;
} catch {
data = null;
}
spawn.subs.set(node.id, {at: Date.now(), data});
}));
spawn.loading = false;
drawSpawn();
stage();
}
function spawnItem(entry) {
const running = entry.running === null ? null : entry.running ? chip("bi-play-circle", "running", "ok") : chip("bi-check-circle", "finished", "neutral");
const open = entry.kind === "twig" ? () => focusSub(entry.session, entry.row.id) : entry.kind === "operator" ? null : () => select(entry.id);
const name = open ? h("button", {type: "button", class: "linkish", title: entry.kind === "twig" ? "Show transcript in the stream" : `Open ${entry.label}`, "data-pick": entry.kind === "twig" ? null : entry.id, on: {click: open}}, entry.label) : h("strong", {}, entry.label);
const meta = entry.kind === "twig" ? h("span", {class: "muted"}, `Depth ${entry.row.depth} · `, when(entry.row.started)) : h("span", {class: "muted"}, NODE_KINDS[entry.kind]);
return h("li", {"data-kind": entry.kind, "data-running": entry.running === null ? null : String(entry.running)},
h("div", {class: "spawn-row"}, h("span", {class: "state", role: "img", ...named(NODE_KINDS[entry.kind] || "Subagent")}, icon(SPAWN_KINDS[entry.kind])), name, entry.kind === "session" || entry.kind === "chair" ? presenceMark(entry.id, false) : null, running, meta),
entry.children.length ? h("ul", {class: "spawn-tree"}, entry.children.map(spawnItem)) : null);
}
function spawnScreen() {
const list = h("div", {class: "card spawn", "data-panel": "agents/tree"});
spawn.dom = {list};
window.setTimeout(() => {
drawSpawn();
loadSpawn();
}, 0);
return list;
}
function drawSpawn() {
if (!spawn.dom || !spawn.dom.list.isConnected) {
spawn.dom = null;
return;
}
const root = spawnTree();
const all = spawnFlat(root).map(({entry}) => entry).filter((entry) => entry.running !== null);
const running = all.filter((entry) => entry.running).length;
spawn.dom.list.replaceChildren(
h("div", {class: "inbox-head"}, h("h2", {class: "group-title"}, "Spawn tree", counter(all.length)), h("span", {class: "muted"}, `${running} running · ${all.length - running} finished · Operator → Chair → Sessions → Subagents`)),
agentAncestry(root),
h("ul", {class: "spawn-tree root"}, spawnItem(root)));
}