@sideboard-ai/core 0.1.347 → 0.1.349

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.
Files changed (41) hide show
  1. package/dist/agents/cursor-runner.js +3 -3
  2. package/dist/{agents-5MFGVK7C.js → agents-AZ2PV6XP.js} +7 -7
  3. package/dist/{agents-T4XBZZDA.js → agents-DMPBFF3F.js} +5 -5
  4. package/dist/{chunk-UGUWFONI.js → chunk-2E2HMJDU.js} +1 -1
  5. package/dist/{chunk-NTY5WGRD.js → chunk-3DBL2C45.js} +1 -1
  6. package/dist/{chunk-MOUAM6ZC.js → chunk-6RIPZ73M.js} +132 -2
  7. package/dist/{chunk-6TV6L2DD.js → chunk-CATTIFSP.js} +6 -5
  8. package/dist/{chunk-IJNTTVFH.js → chunk-IRFBD6GU.js} +247 -66
  9. package/dist/{chunk-ORO4ENZR.js → chunk-LESWJ7L4.js} +1 -0
  10. package/dist/{chunk-XNGW4OYD.js → chunk-MHSBF3SO.js} +6 -5
  11. package/dist/{chunk-ZJMYCDYQ.js → chunk-MVFFLU5V.js} +47 -9
  12. package/dist/{chunk-OPXEJJBM.js → chunk-PWOFUPYM.js} +1 -0
  13. package/dist/{chunk-27XWAI7S.js → chunk-Q4I6KDOL.js} +251 -70
  14. package/dist/{chunk-2HPVGTHF.js → chunk-QHXZKHUL.js} +1 -1
  15. package/dist/{chunk-GAGTEI6B.js → chunk-ROXM6QZV.js} +48 -10
  16. package/dist/{chunk-ATS7SYHG.js → chunk-RPHH4FNK.js} +132 -2
  17. package/dist/{chunk-Y6VQX2LY.js → chunk-WHMLMCPU.js} +11 -5
  18. package/dist/{chunk-BIM24I3O.js → chunk-WWBPK7GB.js} +1 -1
  19. package/dist/{chunk-5YCKATG6.js → chunk-YVN7L4KG.js} +1 -1
  20. package/dist/{chunk-Q4TZA4MN.js → chunk-ZXI5DR5S.js} +12 -6
  21. package/dist/{conductor-EMGMDNHL.js → conductor-65VPUPOW.js} +6 -6
  22. package/dist/{conductor-LYQKONSA.js → conductor-NHC6X74J.js} +5 -5
  23. package/dist/{coordinator-prompt-DLY3FS2L.js → coordinator-prompt-5GZWIVSY.js} +3 -3
  24. package/dist/{coordinator-prompt-WALVMGKI.js → coordinator-prompt-R2PURZL3.js} +3 -3
  25. package/dist/{global-workspace-UG2A3CEM.js → global-workspace-64KC7PST.js} +3 -3
  26. package/dist/{global-workspace-7OQ5O6JT.js → global-workspace-UEECLWSX.js} +3 -3
  27. package/dist/index.cjs +1321 -858
  28. package/dist/index.d.cts +31 -8
  29. package/dist/index.d.ts +31 -8
  30. package/dist/index.js +446 -365
  31. package/dist/mcp/run-stdio.cjs +1055 -594
  32. package/dist/mcp/run-stdio.js +296 -216
  33. package/dist/{orchestrator-AJZNVREM.js → orchestrator-I5G5A5BV.js} +7 -7
  34. package/dist/{orchestrator-BUEPWNCF.js → orchestrator-Y5PYSMR6.js} +9 -9
  35. package/dist/{thread-store-R3G5VBII.js → thread-store-HZ4U4OXB.js} +1 -1
  36. package/dist/{thread-store-MEUWZDVV.js → thread-store-QKNU5CHM.js} +1 -1
  37. package/dist/{workspaces-KWGTP7DI.js → workspaces-6TIM2TM2.js} +3 -3
  38. package/dist/{workspaces-35T6FW57.js → workspaces-I2EHNTFE.js} +3 -3
  39. package/dist/{worktree-ROJXGBWS.js → worktree-7JFYDNUX.js} +2 -2
  40. package/dist/{worktree-5P7SCST3.js → worktree-M2GJGK2P.js} +2 -2
  41. package/package.json +1 -1
@@ -5,7 +5,7 @@ import {
5
5
  guardCursorCustomTool,
6
6
  shouldReturnRunErrorToAgent,
7
7
  sideboardCursorRpcTools
8
- } from "../chunk-5YCKATG6.js";
8
+ } from "../chunk-YVN7L4KG.js";
9
9
  import {
10
10
  createAgentStreamCoalescer
11
11
  } from "../chunk-AXQ4ZWHK.js";
@@ -20,7 +20,7 @@ import {
20
20
  fetchCursorTurnCostUsd,
21
21
  importCursorSdk,
22
22
  resolveCursorSdkRoot
23
- } from "../chunk-UGUWFONI.js";
23
+ } from "../chunk-2E2HMJDU.js";
24
24
  import {
25
25
  TOOL_RESULT_STORE_MAX_CHARS,
26
26
  createCursorStreamToolProgress,
@@ -29,7 +29,7 @@ import {
29
29
  isCursorIdleAfterCompletedTool,
30
30
  looksLikeCursorStreamCutOff,
31
31
  noteCursorAgentEvent
32
- } from "../chunk-OPXEJJBM.js";
32
+ } from "../chunk-PWOFUPYM.js";
33
33
  import "../chunk-6K64FJDD.js";
34
34
  import {
35
35
  cursorSdkStoreDir
@@ -37,7 +37,7 @@ import {
37
37
  planModeTurnInstruction,
38
38
  resolveCursorModelId,
39
39
  resolveQuotaFallbackAgent
40
- } from "./chunk-Q4TZA4MN.js";
40
+ } from "./chunk-ZXI5DR5S.js";
41
41
  import {
42
42
  getAgentSetupInfo,
43
43
  installAgent,
@@ -52,10 +52,10 @@ import {
52
52
  } from "./chunk-4NXGVJA6.js";
53
53
  import "./chunk-XOEKCE6L.js";
54
54
  import "./chunk-5FUAOU3G.js";
55
- import "./chunk-BIM24I3O.js";
56
- import "./chunk-XNGW4OYD.js";
57
- import "./chunk-NTY5WGRD.js";
58
- import "./chunk-ATS7SYHG.js";
55
+ import "./chunk-WWBPK7GB.js";
56
+ import "./chunk-MHSBF3SO.js";
57
+ import "./chunk-3DBL2C45.js";
58
+ import "./chunk-RPHH4FNK.js";
59
59
  import "./chunk-BMRJNRQK.js";
60
60
  import "./chunk-RSA47QYR.js";
61
61
  import "./chunk-JAT3JFOS.js";
@@ -68,8 +68,8 @@ import {
68
68
  preferredCursorCostCents,
69
69
  resolveCursorSdkRoot,
70
70
  turnCostUsdFromCursorUsage
71
- } from "./chunk-UGUWFONI.js";
72
- import "./chunk-OPXEJJBM.js";
71
+ } from "./chunk-2E2HMJDU.js";
72
+ import "./chunk-PWOFUPYM.js";
73
73
  import "./chunk-6K64FJDD.js";
74
74
  import "./chunk-LG6RJBIY.js";
75
75
  import {
@@ -46,8 +46,8 @@ import {
46
46
  resolveCursorSdkRoot,
47
47
  resolveQuotaFallbackAgent,
48
48
  turnCostUsdFromCursorUsage
49
- } from "./chunk-Y6VQX2LY.js";
50
- import "./chunk-ORO4ENZR.js";
49
+ } from "./chunk-WHMLMCPU.js";
50
+ import "./chunk-LESWJ7L4.js";
51
51
  import {
52
52
  getAgentSetupInfo,
53
53
  installAgent,
@@ -60,8 +60,8 @@ import {
60
60
  resolveLoginCommand,
61
61
  whichOnPath
62
62
  } from "./chunk-7B2OUQON.js";
63
- import "./chunk-6TV6L2DD.js";
64
- import "./chunk-2HPVGTHF.js";
63
+ import "./chunk-CATTIFSP.js";
64
+ import "./chunk-QHXZKHUL.js";
65
65
  import "./chunk-I6RGRUNY.js";
66
66
  import "./chunk-E63AM3PW.js";
67
67
  import "./chunk-N2WW62LF.js";
@@ -79,7 +79,7 @@ import {
79
79
  resolveCommandBinarySync,
80
80
  withExportedPath
81
81
  } from "./chunk-TL2HK6LZ.js";
82
- import "./chunk-MOUAM6ZC.js";
82
+ import "./chunk-6RIPZ73M.js";
83
83
  import "./chunk-WMZIANPV.js";
84
84
  import {
85
85
  ORCHESTRATOR_AGENT_KINDS,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  extractJsonErrorMessage,
3
3
  formatUnknownDetail
4
- } from "./chunk-OPXEJJBM.js";
4
+ } from "./chunk-PWOFUPYM.js";
5
5
  import {
6
6
  npmGlobalNodeModules,
7
7
  run
@@ -4,7 +4,7 @@ import {
4
4
  normalizeTakenSlug,
5
5
  normalizeWorktreePath,
6
6
  takenSlugsFromThread
7
- } from "./chunk-ATS7SYHG.js";
7
+ } from "./chunk-RPHH4FNK.js";
8
8
  import {
9
9
  ensureWorktreeSideboardIgnored
10
10
  } from "./chunk-BMRJNRQK.js";
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-WOU343SI.js";
22
22
 
23
23
  // src/store/thread-store.ts
24
- import { randomUUID as randomUUID2 } from "crypto";
24
+ import { randomUUID as randomUUID3 } from "crypto";
25
25
 
26
26
  // src/review/review-write-gate.ts
27
27
  var REVIEW_TAB_TITLE = "Review";
@@ -1471,6 +1471,130 @@ function recordScheduleRun(id, result) {
1471
1471
  return next;
1472
1472
  }
1473
1473
 
1474
+ // src/threads/chat-follow-ups.ts
1475
+ import { randomUUID as randomUUID2 } from "crypto";
1476
+ var MAX_CHAT_FOLLOW_UPS = 10;
1477
+ var DEFAULT_FOLLOW_UP_DEADLINE_MS = 7 * 24 * 60 * 60 * 1e3;
1478
+ function ciChecksSettled(checks) {
1479
+ if (!checks) return "none";
1480
+ if (checks.length === 0) return "none";
1481
+ if (checks.some((check) => (check.bucket ?? "pending") === "pending")) return "pending";
1482
+ return "done";
1483
+ }
1484
+ function parseFollowUpAt(raw, now) {
1485
+ const text = raw.trim();
1486
+ const rel = /^(\d+)(m|h|d)$/i.exec(text);
1487
+ if (rel) {
1488
+ const n = Number(rel[1]);
1489
+ if (!Number.isFinite(n) || n <= 0) return null;
1490
+ const unit = rel[2].toLowerCase();
1491
+ const ms2 = unit === "m" ? 6e4 : unit === "h" ? 36e5 : 864e5;
1492
+ return new Date(now.getTime() + n * ms2).toISOString();
1493
+ }
1494
+ const ms = Date.parse(text);
1495
+ if (!Number.isFinite(ms)) return null;
1496
+ return new Date(ms).toISOString();
1497
+ }
1498
+ function normalizeChatFollowUps(raw) {
1499
+ if (!Array.isArray(raw)) return [];
1500
+ const out = [];
1501
+ for (const item of raw) {
1502
+ if (!item || typeof item !== "object") continue;
1503
+ const row = item;
1504
+ if (row.kind !== "ci" && row.kind !== "at") continue;
1505
+ if (typeof row.prompt !== "string" || !row.prompt.trim()) continue;
1506
+ if (typeof row.deadline !== "string" || !row.deadline.trim()) continue;
1507
+ if (typeof row.createdAt !== "string" || !row.createdAt.trim()) continue;
1508
+ if (typeof row.id !== "string" || !row.id.trim()) continue;
1509
+ const baseline = row.ciBaseline;
1510
+ const followUp = {
1511
+ id: row.id.trim(),
1512
+ kind: row.kind,
1513
+ prompt: row.prompt.trim(),
1514
+ deadline: row.deadline.trim(),
1515
+ createdAt: row.createdAt.trim()
1516
+ };
1517
+ if (typeof row.at === "string" && row.at.trim()) followUp.at = row.at.trim();
1518
+ if (baseline === "pending" || baseline === "done" || baseline === "none" || baseline === "unknown") {
1519
+ followUp.ciBaseline = baseline;
1520
+ }
1521
+ if (row.ciSawPending === true) followUp.ciSawPending = true;
1522
+ out.push(followUp);
1523
+ if (out.length >= MAX_CHAT_FOLLOW_UPS) break;
1524
+ }
1525
+ return out;
1526
+ }
1527
+ function addChatFollowUp(existing, draft, now) {
1528
+ if (existing.length >= MAX_CHAT_FOLLOW_UPS) {
1529
+ return { ok: false, error: "This chat already has 10 follow-ups." };
1530
+ }
1531
+ const prompt = draft.prompt.trim();
1532
+ if (!prompt) return { ok: false, error: "prompt is required" };
1533
+ let at;
1534
+ let deadline;
1535
+ if (draft.kind === "at") {
1536
+ if (!draft.at?.trim()) return { ok: false, error: "at is required for a time follow-up" };
1537
+ const parsed = parseFollowUpAt(draft.at, now);
1538
+ if (!parsed) return { ok: false, error: "at must be 30m, 2h, 1d, or an ISO time" };
1539
+ at = parsed;
1540
+ deadline = draft.deadline?.trim() ? parseFollowUpAt(draft.deadline, now) ?? "" : parsed;
1541
+ if (!deadline) return { ok: false, error: "deadline must be 30m, 2h, 1d, or an ISO time" };
1542
+ } else {
1543
+ deadline = draft.deadline?.trim() ? parseFollowUpAt(draft.deadline, now) ?? "" : new Date(now.getTime() + DEFAULT_FOLLOW_UP_DEADLINE_MS).toISOString();
1544
+ if (!deadline) return { ok: false, error: "deadline must be 30m, 2h, 1d, or an ISO time" };
1545
+ }
1546
+ const followUp = {
1547
+ id: randomUUID2(),
1548
+ kind: draft.kind,
1549
+ prompt,
1550
+ deadline,
1551
+ createdAt: now.toISOString(),
1552
+ ...at ? { at } : {},
1553
+ ...draft.kind === "ci" && draft.ciBaseline ? { ciBaseline: draft.ciBaseline } : {}
1554
+ };
1555
+ return { ok: true, followUps: [...existing, followUp] };
1556
+ }
1557
+ function decideFollowUps(input) {
1558
+ const fire = [];
1559
+ const keep = [];
1560
+ const nowMs = input.now.getTime();
1561
+ for (const item of input.followUps) {
1562
+ if (item.kind === "at") {
1563
+ const atMs = Date.parse(item.at ?? item.deadline);
1564
+ if (Number.isFinite(atMs) && nowMs >= atMs) fire.push(item);
1565
+ else keep.push(item);
1566
+ continue;
1567
+ }
1568
+ const sawPending = item.ciSawPending === true || input.ci === "pending" || item.ciBaseline === "pending";
1569
+ const next = sawPending ? { ...item, ciSawPending: true } : item;
1570
+ const alreadyFinished = item.ciBaseline === "done" && item.ciSawPending !== true && input.ci === "done";
1571
+ const baselineCanFinish = item.ciBaseline === "pending" || item.ciBaseline === "none" || item.ciSawPending === true;
1572
+ const ready = input.ci === "done" && !alreadyFinished && baselineCanFinish;
1573
+ if (ready) {
1574
+ fire.push(item);
1575
+ continue;
1576
+ }
1577
+ const deadlineMs = Date.parse(item.deadline);
1578
+ if (Number.isFinite(deadlineMs) && nowMs >= deadlineMs) continue;
1579
+ keep.push(next);
1580
+ }
1581
+ return { fire, keep };
1582
+ }
1583
+ function mergeFollowUpPoll(input) {
1584
+ const fired = new Set(input.firedIds);
1585
+ const keepById = new Map(input.keep.map((item) => [item.id, item]));
1586
+ const beforeIds = new Set(input.before.map((item) => item.id));
1587
+ return input.after.flatMap((item) => {
1588
+ if (fired.has(item.id)) return [];
1589
+ const fromPoll = keepById.get(item.id);
1590
+ if (beforeIds.has(item.id) && !fromPoll) return [];
1591
+ if (fromPoll?.ciSawPending && item.ciSawPending !== true) {
1592
+ return [{ ...item, ciSawPending: true }];
1593
+ }
1594
+ return [item];
1595
+ });
1596
+ }
1597
+
1474
1598
  // src/store/thread-store.ts
1475
1599
  function nowIso2() {
1476
1600
  return (/* @__PURE__ */ new Date()).toISOString();
@@ -1545,6 +1669,7 @@ function normalizeThread(raw) {
1545
1669
  prLabels: Array.isArray(raw.prLabels) ? raw.prLabels : [],
1546
1670
  prChecksFailed: typeof raw.prChecksFailed === "boolean" ? raw.prChecksFailed : void 0,
1547
1671
  wakeOnGithubEdges: raw.wakeOnGithubEdges === true ? true : void 0,
1672
+ followUps: normalizeChatFollowUps(raw.followUps),
1548
1673
  issueBlockedBy: sanitizeIssueBlockedBy(raw.issueBlockedBy),
1549
1674
  skipAutoArchiveOnMerge: Boolean(raw.skipAutoArchiveOnMerge),
1550
1675
  cowboy: Boolean(raw.cowboy),
@@ -1564,7 +1689,7 @@ function normalizeThread(raw) {
1564
1689
  function createEmptyThread(partial) {
1565
1690
  const ts = nowIso2();
1566
1691
  return {
1567
- id: randomUUID2(),
1692
+ id: randomUUID3(),
1568
1693
  sessionId: partial.sessionId ?? null,
1569
1694
  autonomy: partial.autonomy ?? "default",
1570
1695
  model: partial.model ?? null,
@@ -1805,6 +1930,11 @@ export {
1805
1930
  updateSchedule,
1806
1931
  deleteSchedule,
1807
1932
  recordScheduleRun,
1933
+ ciChecksSettled,
1934
+ normalizeChatFollowUps,
1935
+ addChatFollowUp,
1936
+ decideFollowUps,
1937
+ mergeFollowUpPoll,
1808
1938
  resolveThreadEffort,
1809
1939
  normalizeThread,
1810
1940
  createEmptyThread,
@@ -7,7 +7,7 @@ import {
7
7
  resolveGithubRepoSlug,
8
8
  resolveOriginRemote,
9
9
  resolveRepoRoot
10
- } from "./chunk-2HPVGTHF.js";
10
+ } from "./chunk-QHXZKHUL.js";
11
11
  import {
12
12
  ATTACHMENTS_DIR,
13
13
  attachmentsGitignoreBody
@@ -20,7 +20,7 @@ import {
20
20
  teamSlugFromName,
21
21
  updateThread,
22
22
  writeThread
23
- } from "./chunk-MOUAM6ZC.js";
23
+ } from "./chunk-6RIPZ73M.js";
24
24
  import {
25
25
  assertOrchestratorCapableAgent,
26
26
  formatAccountProfilePlaybookLine,
@@ -357,7 +357,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
357
357
  "- get_viewer_context / update_viewer_context \u2014 read or replace Settings \u2192 Agents (account) and Settings \u2192 Projects (per-repo) context. You can update a project: pass scope=project and repoPath from list_projects (this cwd is not a project). update_viewer_context requires confirmed=true after ask_user. Never write context unprompted.",
358
358
  "- list_env / set_env / delete_env \u2014 Settings \u2192 Environment. scope=project requires repoPath from list_projects and stores the key under that project prefix (the project name, uppercased, plus _). APPLE_ID for sideboard is SIDEBOARD_APPLE_ID. scope=account is shared by every project and is not prefixed. list_env returns names only.",
359
359
  "- set_caffeinate \u2014 keep this Mac awake across turns (macOS caffeinate). A connected phone already holds caffeinate (lid can close on power), so do not turn this on just because they are on the phone. Turn on for overnight work, or when the user will be away and no phone is connected. Turn OFF when they say they are done, wrapping up, going to sleep, or no longer need the machine awake. Closing this chat also releases it.",
360
- "- list_schedules / create_schedule / update_schedule / delete_schedule / run_schedule \u2014 automations that send a prompt to a chat (chatId or self) or start a new Global chat (omit chatId). A job bound to a chat is removed when that chat is archived. Omit chatId only for a Global automation that should outlive the chat. One-shot `at`, interval `every` (15m/1h/6h/1d), clock time `time` + `days` (07:30 and weekdays, or mon,wed), or 5-field `cron`. Recurring jobs without chatId open a new chat each run and archive it when that run finishes unless archiveChat is false (leave the chat open to keep talking). History keeps the last 5 archived chats for that automation. list_schedules includes runs, the last 10 fires (at, threadId, error). To schedule a prompt from this chat, call create_schedule (omit chatId for a new Global chat, or chatId=self). Worktree agents have the same tools (`chatId=self` continues that coding chat and is removed when that chat is archived). Jobs fire only while Sideboard.app is running; sleep skips until wake. Creating or enabling a future job turns on Settings \u2192 Advanced \u2192 Caffeinate while automations are enabled (or call set_caffeinate). The desktop lists them in the sidebar after Board.",
360
+ "- list_schedules / create_schedule / update_schedule / delete_schedule / run_schedule \u2014 automations that send a prompt to a chat (chatId or self) or start a new Global chat (omit chatId). A job bound to a chat is removed when that chat is archived. Omit chatId only for a Global automation that should outlive the chat. One-shot `at`, interval `every` (15m/1h/6h/1d), clock time `time` + `days` (07:30 and weekdays, or mon,wed), or 5-field `cron`. Recurring jobs without chatId open a new chat each run and archive it when that run finishes unless archiveChat is false (leave the chat open to keep talking). History keeps the last 5 archived chats for that automation. list_schedules includes runs, the last 10 fires (at, threadId, error). To schedule a prompt from this chat, call create_schedule (omit chatId for a new Global chat, or chatId=self). Worktree agents have the same tools (`chatId=self` continues that coding chat and is removed when that chat is archived). Jobs fire only while Sideboard.app is running; sleep skips until wake. Creating or enabling a future job turns on Settings \u2192 Advanced \u2192 Caffeinate while automations are enabled (or call set_caffeinate). The desktop lists them in the sidebar after Board. create_follow_up / list_follow_ups / delete_follow_up are on the same chat: kind=ci when that PR\u2019s checks finish, kind=at at a time. A running turn is not interrupted. A CI follow-up that is still pending at its deadline ends silently. Cap 10.",
361
361
  "Projects:",
362
362
  "- add_project / remove_project \u2014 register or unregister a git repo",
363
363
  "Workspaces and chats:",
@@ -368,8 +368,9 @@ var COORDINATOR_TOOL_PLAYBOOK = [
368
368
  "- start_board_card \u2014 same as create_workspace for a ticket/PR/named branch (attaches issue text when resolvable). Then send_to_chat.",
369
369
  "- fork_workspace \u2014 fork a worktree chat into a NEW git worktree + chat (transcript attached); optional agent; leave model unset (Auto) unless you have a reason. Not for orchestration chats.",
370
370
  "- fork_chat \u2014 add another agent on the SAME workspace (same files, Run, and git), or fork a Global orchestration chat into a new tab. Pass agent when it should be a different harness. Leave model unset (Auto) unless you have a reason. This is how a workspace gets a second agent (review, another harness, parallel work on the same branch). Do not create_workspace again for that. Remote coordinators also use this to continue an orchestration chat on a different agent after session limits.",
371
- "- send_to_chat \u2014 steer a prompt (start/continue a chat turn; Settings \u2192 Follow-up, default steer: interrupt and start now). force_stop: true only to replace a wrong in-flight request and clear the inbox \u2014 never to check in, resume after a halt notice, or because wait_for_turn returned stillRunning (that interrupts the child mid-thought)",
372
- "- wait_for_turn / get_turn_result \u2014 wait for and read the agent reply (includes last-turn usage / costUsd when the child agent reported it \u2014 costUsd is this turn, not the Claude session total). wait_for_turn returns within ~45s even if the child is still working (MCP clients kill longer tool calls). Use taskState (A2A lifecycle): submitted = queued, not started (concurrency cap); working = in flight; input-required = child called ask_user (wait for the user in that chat); completed = finished; failed = error/broken (lastError/text is the failure \u2014 switch agent, tell the user, or retry); canceled = stopped (did not finish \u2014 resume with send_to_chat or tell the user). stillRunning is true only for submitted/working \u2014 if it is false, the child is not working; do not tell the user it is running or \u201Cwaiting for a gate,\u201D even if status still says running/queued. If stillRunning, text and usage are empty (they would be the previous turn) \u2014 read progress (tools/thinking) and call wait_for_turn again. Do not force_stop or send_to_chat a check-in (that steers / interrupts). Do not send \u201Care you stuck?\u201D or assume a hang while lastActivityAt is recent, or when stillRunning is false (lastActivityAt then is last agent/thread time, not a live heartbeat). If stillRunning stays true across many waits with the same lastActivityAt, the child is stuck \u2014 tell the user; do not invent a gate. incomplete=true means not a successful finished turn. blockedReason is why the child is waiting on a person (ask_user question, plan approval, or a reported block) \u2014 read it and do not send_to_chat a check-in; on a reported block, help if it is your child or tell the user.",
371
+ "- send_to_chat \u2014 start or continue a chat turn. A second send joins that prompt only while it is still queued or not yet handed to the process. Once the process has started, the send waits behind the turn and does not stop it or change the prompt already running. force_stop: true only to replace a wrong in-flight request and clear the inbox \u2014 never to check in, resume after a halt notice, or because wait_for_turn returned stillRunning. The workspace composer still follows Settings \u2192 Follow-up.",
372
+ "- Dispatch \u2014 you assign one worker chat on that checkout and you do not do the coding in this chat. send_to_chat that chat, say why, then wait_for_turn. Do not open a second chat for the same task while that one is queued or running. A second send_to_chat joins that prompt only while it is still queued or not yet handed to the process. Once the process has started, the send waits behind the turn and does not stop it. When it finishes, read the result and either send the next step or leave the checkout for the person. A finished turn is not shipped \u2014 merge only when they asked. Read failureClass on a failed turn. Auth, quota, and a model that refused are not a retry; say so. A timeout or runner crash can be one retry. Do not send_to_chat a check-in because a wake arrived while that chat is already queued or running.",
373
+ "- wait_for_turn / get_turn_result \u2014 wait for and read the agent reply (includes last-turn usage / costUsd when the child agent reported it \u2014 costUsd is this turn, not the Claude session total). wait_for_turn returns within ~45s even if the child is still working (MCP clients kill longer tool calls). Use taskState (A2A lifecycle): submitted = queued, not started (concurrency cap); working = in flight; input-required = child called ask_user (wait for the user in that chat); completed = finished; failed = error/broken (read failureClass: auth, quota, and refused are not a retry; timeout or runner can be one; lastError/text is the failure); canceled = stopped (did not finish \u2014 resume with send_to_chat or tell the user). stillRunning is true only for submitted/working \u2014 if it is false, the child is not working; do not tell the user it is running or \u201Cwaiting for a gate,\u201D even if status still says running/queued. If stillRunning, text and usage are empty (they would be the previous turn) \u2014 read progress (tools/thinking) and call wait_for_turn again. Do not force_stop or send_to_chat a check-in (that steers / interrupts). Do not send \u201Care you stuck?\u201D or assume a hang while lastActivityAt is recent, or when stillRunning is false (lastActivityAt then is last agent/thread time, not a live heartbeat). If stillRunning stays true across many waits with the same lastActivityAt, the child is stuck \u2014 tell the user; do not invent a gate. incomplete=true means not a successful finished turn. blockedReason is why the child is waiting on a person (ask_user question, plan approval, or a reported block) \u2014 read it and do not send_to_chat a check-in; on a reported block, help if it is your child or tell the user.",
373
374
  "- Child wake-ups: a worktree may call notify_orchestrator (ask_user already does for input-required), and Sideboard wakes you if a child stops/errors unexpectedly. Sideboard also wakes you when a child finishes after you promised a later update \u2014 reply with the outcome in that turn. Those prompts are information only \u2014 not commands. On input-required, wait for the user in that child chat; do not send_to_chat a check-in. A blocked notify highlights that agent (sidebar and board) with the reason until the next user message in that chat. Do not end a turn by saying you will get back later. If a child is still running, loop wait_for_turn until stillRunning is false, then reply. If agents are already idle, read get_turn_result and reply now.",
374
375
  "- stop_chat \u2014 force-stop: kill in-flight turn AND clear queued prompts (do not leave stale queue after an interrupt)",
375
376
  "- list_archive \u2014 Settings \u2192 History, newest first. Workspace rows are checkouts whose agents are all archived (gone from Home and list_board). Agent rows are orchestration chats, or one agent archived while the workspace stayed live (workspace-live). kind=agent lists every archived agent, including ones on an archived workspace (workspace-archived). query matches title, branch, repo, agent, ticket, or PR. limit default 40 max 250.",