@sideboard-ai/core 0.1.135 → 0.1.139

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 (35) hide show
  1. package/dist/{agents-RTQFF7PY.js → agents-665S7Z3R.js} +5 -5
  2. package/dist/{agents-O3AJMI2Y.js → agents-OC3XM7UE.js} +5 -5
  3. package/dist/{chunk-KBBXNS2V.js → chunk-23KCPND2.js} +49 -6
  4. package/dist/{chunk-2ESCEK2Q.js → chunk-5XH5M6RA.js} +244 -5
  5. package/dist/{chunk-57GIFU3X.js → chunk-7SYFWPOZ.js} +5 -5
  6. package/dist/{chunk-N62K3KXX.js → chunk-CDJISVKN.js} +79 -6
  7. package/dist/{chunk-QAV3HGVS.js → chunk-DJJ3DTT4.js} +1 -1
  8. package/dist/{chunk-HQQNLDVC.js → chunk-DKXZCIB2.js} +1 -1
  9. package/dist/{chunk-XUEI4GCF.js → chunk-E2RE7P2S.js} +286 -5
  10. package/dist/{chunk-J5IBSVB3.js → chunk-EUXOHTUK.js} +42 -25
  11. package/dist/{chunk-RDULVW3E.js → chunk-HLIHBGVO.js} +2 -2
  12. package/dist/{chunk-K7EX47QG.js → chunk-RTX3AY42.js} +5 -5
  13. package/dist/{chunk-LOKXPQ4U.js → chunk-SSBM4GZX.js} +2 -2
  14. package/dist/{chunk-PM3C2J6K.js → chunk-TUGKX5BD.js} +42 -25
  15. package/dist/{chunk-Z5LYMW7M.js → chunk-YZQEJOAU.js} +189 -248
  16. package/dist/{chunk-XIKEUCNC.js → chunk-ZCLHAOFR.js} +211 -299
  17. package/dist/{coordinator-prompt-FYMWE33S.js → coordinator-prompt-43O6EPA2.js} +3 -3
  18. package/dist/{coordinator-prompt-Y737IIFR.js → coordinator-prompt-4TXU6Q3R.js} +3 -3
  19. package/dist/{global-workspace-6KH6BSKL.js → global-workspace-VIU57E3Y.js} +4 -4
  20. package/dist/{global-workspace-ZFKNLBZA.js → global-workspace-ZDYKHQ4O.js} +4 -4
  21. package/dist/index.cjs +1019 -670
  22. package/dist/index.d.cts +41 -3
  23. package/dist/index.d.ts +41 -3
  24. package/dist/index.js +83 -24
  25. package/dist/mcp/run-stdio.cjs +831 -544
  26. package/dist/mcp/run-stdio.js +55 -16
  27. package/dist/{orchestrator-3YDPPZHZ.js → orchestrator-WEFXUHFX.js} +7 -7
  28. package/dist/{orchestrator-2BRAPJ47.js → orchestrator-ZCMYSDTC.js} +7 -7
  29. package/dist/{thread-store-FADXSMEJ.js → thread-store-57ZLHR3A.js} +1 -1
  30. package/dist/{thread-store-CRLQJ2HM.js → thread-store-WGASXXXR.js} +1 -1
  31. package/dist/{workspaces-3RRF3LVF.js → workspaces-4HYGNH4B.js} +5 -5
  32. package/dist/{workspaces-AYI5DHK4.js → workspaces-ALCTB65T.js} +5 -5
  33. package/dist/{worktree-MX7XBX6Z.js → worktree-GXD2NGOZ.js} +2 -2
  34. package/dist/{worktree-BC6XDMQK.js → worktree-NSNZODAM.js} +2 -2
  35. package/package.json +1 -1
@@ -32,14 +32,14 @@ import {
32
32
  slackTokenFor,
33
33
  syncBoardPins,
34
34
  updateSchedule
35
- } from "../chunk-Z5LYMW7M.js";
35
+ } from "../chunk-YZQEJOAU.js";
36
36
  import {
37
37
  listModelsForAgent,
38
38
  sideboardMcpProfile
39
- } from "../chunk-KBBXNS2V.js";
39
+ } from "../chunk-23KCPND2.js";
40
40
  import "../chunk-ED4UPEJX.js";
41
41
  import "../chunk-S42XV45P.js";
42
- import "../chunk-RDULVW3E.js";
42
+ import "../chunk-HLIHBGVO.js";
43
43
  import {
44
44
  createAbleTimeTask,
45
45
  ensureAbleTimeTask,
@@ -59,8 +59,8 @@ import "../chunk-KLBOWJ74.js";
59
59
  import {
60
60
  GLOBAL_WORKSPACE_ID,
61
61
  isCloudCoordinatorThread
62
- } from "../chunk-2ESCEK2Q.js";
63
- import "../chunk-K7EX47QG.js";
62
+ } from "../chunk-5XH5M6RA.js";
63
+ import "../chunk-RTX3AY42.js";
64
64
  import {
65
65
  canonicalizeRepoPath,
66
66
  listBranches,
@@ -68,9 +68,9 @@ import {
68
68
  resolveGithubRepoSlug,
69
69
  resolveRepoRoot,
70
70
  warmGithubAgentAuth
71
- } from "../chunk-QAV3HGVS.js";
71
+ } from "../chunk-DJJ3DTT4.js";
72
72
  import "../chunk-B3SJXYIJ.js";
73
- import "../chunk-J5IBSVB3.js";
73
+ import "../chunk-EUXOHTUK.js";
74
74
  import {
75
75
  gh
76
76
  } from "../chunk-KPIYENTF.js";
@@ -654,6 +654,36 @@ var MCP_WAIT_QUEUED_HINT = "Child is queued waiting for a concurrency slot \u201
654
654
  function mcpWaitStillRunningHint(status) {
655
655
  return status === "queued" ? MCP_WAIT_QUEUED_HINT : MCP_WAIT_STILL_RUNNING_HINT;
656
656
  }
657
+ var MCP_WAIT_STOPPED_HINT = "Child was stopped before the turn finished. Do not treat this as success. send_to_thread to resume, or tell the user.";
658
+ var MCP_WAIT_BROKEN_HINT = "Child worktree is broken (missing on disk). Tell the user \u2014 do not treat this as success.";
659
+ var MCP_WAIT_ERROR_HINT = "Child turn failed. lastError/text is the failure \u2014 switch agent, tell the user, or retry. Do not treat empty text as success.";
660
+ function mcpWaitFinishedHint(status) {
661
+ if (status === "stopped") return MCP_WAIT_STOPPED_HINT;
662
+ if (status === "broken") return MCP_WAIT_BROKEN_HINT;
663
+ if (status === "error") return MCP_WAIT_ERROR_HINT;
664
+ return void 0;
665
+ }
666
+
667
+ // src/mcp/thread-visibility.ts
668
+ function lastMessagePreview(messages, max = 160) {
669
+ if (!messages?.length) return null;
670
+ for (let i = messages.length - 1; i >= 0; i--) {
671
+ const text5 = messages[i]?.text?.trim();
672
+ if (!text5) continue;
673
+ const flat = text5.replace(/\s+/g, " ");
674
+ return flat.length > max ? `${flat.slice(0, max)}\u2026` : flat;
675
+ }
676
+ return null;
677
+ }
678
+ function childThreadRefs(parentId, threads) {
679
+ return threads.filter((t) => t.parentThreadId === parentId).map((t) => ({
680
+ id: t.id,
681
+ title: t.title,
682
+ status: t.status,
683
+ agent: t.agent,
684
+ lastText: lastMessagePreview(t.messages, 120)
685
+ }));
686
+ }
657
687
 
658
688
  // src/mcp/slack-tools.ts
659
689
  import { z } from "zod";
@@ -1906,15 +1936,19 @@ async function startMcpServer() {
1906
1936
  );
1907
1937
  server.tool(
1908
1938
  "list_threads",
1909
- "List Sideboard threads across all workspaces (one summary line each \u2014 token-frugal). Each line ends with sideboard://thread/<id> \u2014 use that URL in markdown links so the UI can open the chat.",
1939
+ "List Sideboard threads across all workspaces (one summary line each \u2014 token-frugal). Includes parent id, last message preview, and live progress so you can see worktree children. Each line ends with sideboard://thread/<id> \u2014 use that URL in markdown links so the UI can open the chat.",
1910
1940
  {},
1911
1941
  async () => {
1912
1942
  const threads = orch.getThreads(true);
1913
1943
  const lines = threads.map((t) => {
1914
1944
  const repo = t.repoPath === GLOBAL_WORKSPACE_ID ? "Orchestration" : basename(t.repoPath) || t.repoPath;
1915
1945
  const live = t.status === "running" || t.status === "queued" ? readTurnLive(t.id) : null;
1946
+ const parent = t.parentThreadId ? ` parent:${t.parentThreadId.slice(0, 8)}` : "";
1947
+ const preview = lastMessagePreview(t.messages, 80);
1948
+ const previewBit = preview ? ` ${preview}` : "";
1949
+ const err = t.lastError ? ` error:${t.lastError.replace(/\s+/g, " ").slice(0, 60)}` : "";
1916
1950
  const progress = live?.summary ? ` ${live.summary}` : "";
1917
- return `${t.id.slice(0, 8)} ${t.status.padEnd(9)} ${t.agent.padEnd(8)} ${repo} ${t.sourceType}:${t.sourceRef} ${t.title} sideboard://thread/${t.id}${t.devPort ? ` http://localhost:${t.devPort}` : ""}${progress}`;
1951
+ return `${t.id.slice(0, 8)} ${t.status.padEnd(9)} ${t.agent.padEnd(8)} ${repo} ${t.sourceType}:${t.sourceRef} ${t.title}${parent}${previewBit}${err} sideboard://thread/${t.id}${t.devPort ? ` http://localhost:${t.devPort}` : ""}${progress}`;
1918
1952
  });
1919
1953
  return {
1920
1954
  content: [{ type: "text", text: lines.join("\n") || "(no threads)" }]
@@ -1968,7 +2002,7 @@ async function startMcpServer() {
1968
2002
  );
1969
2003
  server.tool(
1970
2004
  "get_thread",
1971
- "Get a compact thread summary by id/ref. While running, includes progress (last tool/thinking) and lastActivityAt. Includes usage (thread billed token + costUsd totals when providers reported cost) and lastTurnUsage.",
2005
+ "Get a compact thread summary by id/ref. Includes last message preview, parentThreadId, and child worktree threads (status + lastText). While running, includes progress (last tool/thinking) and lastActivityAt. Includes usage (thread billed token + costUsd totals when providers reported cost) and lastTurnUsage.",
1972
2006
  { ref: z5.string() },
1973
2007
  async ({ ref }) => {
1974
2008
  const t = orch.getThread(ref);
@@ -1987,8 +2021,11 @@ async function startMcpServer() {
1987
2021
  branchName: t.branchName,
1988
2022
  worktreePath: t.worktreePath,
1989
2023
  sessionId: t.sessionId,
2024
+ parentThreadId: t.parentThreadId,
2025
+ children: childThreadRefs(t.id, orch.getThreads(false)),
1990
2026
  queueLength: t.queue.length,
1991
2027
  messageCount: t.messages.length,
2028
+ lastText: lastMessagePreview(t.messages, 240),
1992
2029
  devPort: t.devPort,
1993
2030
  prUrl: t.prUrl,
1994
2031
  lastError: t.lastError ?? null,
@@ -2319,7 +2356,7 @@ async function startMcpServer() {
2319
2356
  );
2320
2357
  server.tool(
2321
2358
  "send_to_thread",
2322
- 'Queue a prompt on a worktree thread chat (runs under concurrency cap). Use after create_thread to start or continue a conversation. For commit/push/PR, prefer ask_git (canonical desktop-button phrases). Send "Merge PR." / ask_git merge only when the user explicitly asked to merge. Set force_stop=true to interrupt an in-flight/queued turn (kill + clear queue) before queueing this prompt \u2014 use when the thread is mid-turn or has stale queued prompts you need to replace.',
2359
+ 'Queue a prompt on a worktree thread chat (runs under concurrency cap). Use after create_thread to start or continue a conversation. For commit/push/PR, prefer ask_git (canonical desktop-button phrases). Send "Merge PR." / ask_git merge only when the user explicitly asked to merge. force_stop=true kills the in-flight turn and clears the queue before this prompt \u2014 only when the current request is wrong and must be replaced. Do not force_stop to check in, resume after a halt notice, or because wait_for_turn returned stillRunning; that stops the child mid-thought. Call wait_for_turn again instead.',
2323
2360
  {
2324
2361
  ref: z5.string(),
2325
2362
  prompt: z5.string(),
@@ -2329,7 +2366,7 @@ async function startMcpServer() {
2329
2366
  if (force_stop) {
2330
2367
  const existing = orch.getThread(ref);
2331
2368
  if (existing) {
2332
- orch.stop(ref, { clearQueue: true });
2369
+ orch.stop(ref, { clearQueue: true, notifyParent: false });
2333
2370
  }
2334
2371
  }
2335
2372
  const thread = await orch.send(ref, prompt);
@@ -2350,7 +2387,7 @@ async function startMcpServer() {
2350
2387
  );
2351
2388
  server.tool(
2352
2389
  "wait_for_turn",
2353
- "Wait until the thread finishes its current/queued turn, or return early with a live progress snapshot. MCP clients often kill tools around 60s, so this returns within 45s even while the child is still working. If stillRunning is true, progress is tools/thinking (or \u201Cqueued, waiting for a concurrency slot\u201D if it has not started). Call wait_for_turn again. Do not send a check-in prompt, force_stop, or assume a hang. On status error, lastError/text is the failure. When finished, usage is the last agent turn\u2019s tokens + costUsd (when the provider reported cost).",
2390
+ "Wait until the thread finishes its current/queued turn, or return early with a live progress snapshot. MCP clients often kill tools around 60s, so this returns within 45s even while the child is still working. If stillRunning is true, progress is tools/thinking (or \u201Cqueued, waiting for a concurrency slot\u201D if it has not started). Call wait_for_turn again. Do not send a check-in prompt, force_stop, or assume a hang. On status error, lastError/text is the failure. On status stopped or broken, the child did not finish \u2014 resume with send_to_thread or tell the user; do not treat that as success. When finished, usage is the last agent turn\u2019s tokens + costUsd (when the provider reported cost).",
2354
2391
  {
2355
2392
  ref: z5.string(),
2356
2393
  timeoutMs: z5.number().optional()
@@ -2372,7 +2409,8 @@ async function startMcpServer() {
2372
2409
  stillRunning: result.stillRunning,
2373
2410
  progress: result.progress,
2374
2411
  lastActivityAt: result.lastActivityAt,
2375
- hint: result.stillRunning ? mcpWaitStillRunningHint(result.status) : void 0
2412
+ hint: result.stillRunning ? mcpWaitStillRunningHint(result.status) : mcpWaitFinishedHint(result.status),
2413
+ incomplete: !result.stillRunning && Boolean(mcpWaitFinishedHint(result.status))
2376
2414
  })
2377
2415
  }
2378
2416
  ]
@@ -2391,7 +2429,8 @@ async function startMcpServer() {
2391
2429
  type: "text",
2392
2430
  text: JSON.stringify({
2393
2431
  ...result,
2394
- hint: result.stillRunning ? mcpWaitStillRunningHint(result.status) : void 0
2432
+ hint: result.stillRunning ? mcpWaitStillRunningHint(result.status) : mcpWaitFinishedHint(result.status),
2433
+ incomplete: !result.stillRunning && Boolean(mcpWaitFinishedHint(result.status))
2395
2434
  })
2396
2435
  }
2397
2436
  ]
@@ -2415,7 +2454,7 @@ async function startMcpServer() {
2415
2454
  }
2416
2455
  const clearQueue = force !== false;
2417
2456
  const hadQueued = t.queue.length > 0;
2418
- const stopped = orch.stop(ref, { clearQueue });
2457
+ const stopped = orch.stop(ref, { clearQueue, notifyParent: false });
2419
2458
  return {
2420
2459
  content: [
2421
2460
  {
@@ -4,24 +4,24 @@ import {
4
4
  isPidAlive,
5
5
  startOrchestration,
6
6
  waitForPidExit
7
- } from "./chunk-XIKEUCNC.js";
8
- import "./chunk-N62K3KXX.js";
7
+ } from "./chunk-ZCLHAOFR.js";
8
+ import "./chunk-CDJISVKN.js";
9
9
  import "./chunk-KBWND62T.js";
10
10
  import "./chunk-M267JPEA.js";
11
- import "./chunk-LOKXPQ4U.js";
12
- import "./chunk-XUEI4GCF.js";
13
- import "./chunk-57GIFU3X.js";
11
+ import "./chunk-SSBM4GZX.js";
12
+ import "./chunk-E2RE7P2S.js";
13
+ import "./chunk-7SYFWPOZ.js";
14
14
  import "./chunk-ELBYOGVA.js";
15
15
  import "./chunk-QTUESPAW.js";
16
16
  import "./chunk-AXQ4ZWHK.js";
17
17
  import "./chunk-FSCQXMGI.js";
18
18
  import "./chunk-DCOZABNT.js";
19
- import "./chunk-HQQNLDVC.js";
19
+ import "./chunk-DKXZCIB2.js";
20
20
  import "./chunk-FKOIHGKV.js";
21
21
  import "./chunk-GJBHOJCZ.js";
22
22
  import "./chunk-4TR3HZFT.js";
23
23
  import "./chunk-JT7R45JB.js";
24
- import "./chunk-PM3C2J6K.js";
24
+ import "./chunk-TUGKX5BD.js";
25
25
  import "./chunk-77WWLBCI.js";
26
26
  import "./chunk-QZQEXME2.js";
27
27
  import "./chunk-DVM4ID64.js";
@@ -6,19 +6,19 @@ import {
6
6
  isPidAlive,
7
7
  startOrchestration,
8
8
  waitForPidExit
9
- } from "./chunk-Z5LYMW7M.js";
10
- import "./chunk-KBBXNS2V.js";
9
+ } from "./chunk-YZQEJOAU.js";
10
+ import "./chunk-23KCPND2.js";
11
11
  import "./chunk-ED4UPEJX.js";
12
12
  import "./chunk-S42XV45P.js";
13
- import "./chunk-RDULVW3E.js";
13
+ import "./chunk-HLIHBGVO.js";
14
14
  import "./chunk-6GN5WPYZ.js";
15
15
  import "./chunk-N5PM7HGQ.js";
16
16
  import "./chunk-KLBOWJ74.js";
17
- import "./chunk-2ESCEK2Q.js";
18
- import "./chunk-K7EX47QG.js";
19
- import "./chunk-QAV3HGVS.js";
17
+ import "./chunk-5XH5M6RA.js";
18
+ import "./chunk-RTX3AY42.js";
19
+ import "./chunk-DJJ3DTT4.js";
20
20
  import "./chunk-B3SJXYIJ.js";
21
- import "./chunk-J5IBSVB3.js";
21
+ import "./chunk-EUXOHTUK.js";
22
22
  import "./chunk-KPIYENTF.js";
23
23
  import "./chunk-GKKHXZCT.js";
24
24
  import "./chunk-NSTQ6QKD.js";
@@ -15,7 +15,7 @@ import {
15
15
  updateThread,
16
16
  withThreadLock,
17
17
  writeThread
18
- } from "./chunk-J5IBSVB3.js";
18
+ } from "./chunk-EUXOHTUK.js";
19
19
  import "./chunk-KGZBYWZ3.js";
20
20
  import "./chunk-BD2ICC4D.js";
21
21
  export {
@@ -13,7 +13,7 @@ import {
13
13
  updateThread,
14
14
  withThreadLock,
15
15
  writeThread
16
- } from "./chunk-PM3C2J6K.js";
16
+ } from "./chunk-TUGKX5BD.js";
17
17
  import "./chunk-77WWLBCI.js";
18
18
  import "./chunk-QZQEXME2.js";
19
19
  export {
@@ -6,12 +6,12 @@ import {
6
6
  listWorkspaces,
7
7
  removeWorkspace,
8
8
  syncWorkspacesFromThreads
9
- } from "./chunk-RDULVW3E.js";
10
- import "./chunk-2ESCEK2Q.js";
11
- import "./chunk-K7EX47QG.js";
12
- import "./chunk-QAV3HGVS.js";
9
+ } from "./chunk-HLIHBGVO.js";
10
+ import "./chunk-5XH5M6RA.js";
11
+ import "./chunk-RTX3AY42.js";
12
+ import "./chunk-DJJ3DTT4.js";
13
13
  import "./chunk-B3SJXYIJ.js";
14
- import "./chunk-J5IBSVB3.js";
14
+ import "./chunk-EUXOHTUK.js";
15
15
  import "./chunk-KPIYENTF.js";
16
16
  import "./chunk-GKKHXZCT.js";
17
17
  import "./chunk-NSTQ6QKD.js";
@@ -4,15 +4,15 @@ import {
4
4
  listWorkspaces,
5
5
  removeWorkspace,
6
6
  syncWorkspacesFromThreads
7
- } from "./chunk-LOKXPQ4U.js";
8
- import "./chunk-XUEI4GCF.js";
9
- import "./chunk-57GIFU3X.js";
10
- import "./chunk-HQQNLDVC.js";
7
+ } from "./chunk-SSBM4GZX.js";
8
+ import "./chunk-E2RE7P2S.js";
9
+ import "./chunk-7SYFWPOZ.js";
10
+ import "./chunk-DKXZCIB2.js";
11
11
  import "./chunk-FKOIHGKV.js";
12
12
  import "./chunk-GJBHOJCZ.js";
13
13
  import "./chunk-4TR3HZFT.js";
14
14
  import "./chunk-JT7R45JB.js";
15
- import "./chunk-PM3C2J6K.js";
15
+ import "./chunk-TUGKX5BD.js";
16
16
  import "./chunk-77WWLBCI.js";
17
17
  import "./chunk-QZQEXME2.js";
18
18
  import "./chunk-DVM4ID64.js";
@@ -48,12 +48,12 @@ import {
48
48
  worktreeDisplayLabel,
49
49
  worktreeDisplayLabelForGroup,
50
50
  worktreeNameFromPath
51
- } from "./chunk-HQQNLDVC.js";
51
+ } from "./chunk-DKXZCIB2.js";
52
52
  import "./chunk-FKOIHGKV.js";
53
53
  import "./chunk-GJBHOJCZ.js";
54
54
  import "./chunk-4TR3HZFT.js";
55
55
  import "./chunk-JT7R45JB.js";
56
- import "./chunk-PM3C2J6K.js";
56
+ import "./chunk-TUGKX5BD.js";
57
57
  import "./chunk-77WWLBCI.js";
58
58
  import "./chunk-QZQEXME2.js";
59
59
  import "./chunk-DVM4ID64.js";
@@ -50,9 +50,9 @@ import {
50
50
  worktreeDisplayLabel,
51
51
  worktreeDisplayLabelForGroup,
52
52
  worktreeNameFromPath
53
- } from "./chunk-QAV3HGVS.js";
53
+ } from "./chunk-DJJ3DTT4.js";
54
54
  import "./chunk-B3SJXYIJ.js";
55
- import "./chunk-J5IBSVB3.js";
55
+ import "./chunk-EUXOHTUK.js";
56
56
  import "./chunk-KPIYENTF.js";
57
57
  import "./chunk-GKKHXZCT.js";
58
58
  import "./chunk-NSTQ6QKD.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sideboard-ai/core",
3
- "version": "0.1.135",
3
+ "version": "0.1.139",
4
4
  "description": "Sideboard core — orchestration, agents, git worktrees, MCP server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",