@sideboard-ai/core 0.1.326 → 0.1.328

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 (73) hide show
  1. package/dist/{abletime-RYYFGKMU.js → abletime-NW4PJGHN.js} +4 -5
  2. package/dist/{abletime-RDHYSZL2.js → abletime-OW7LTFQD.js} +4 -5
  3. package/dist/{abletime-oauth-OYGS2DAU.js → abletime-oauth-KWQQRHOQ.js} +3 -4
  4. package/dist/{abletime-oauth-QR2QDVMK.js → abletime-oauth-TPR2QDRI.js} +3 -4
  5. package/dist/{abletime-rest-QDPTWNS4.js → abletime-rest-5DCWN3P4.js} +3 -4
  6. package/dist/{abletime-rest-BKYKNPTC.js → abletime-rest-UJ6SXDBN.js} +3 -4
  7. package/dist/agents/claude-runner.cjs +11 -0
  8. package/dist/agents/claude-runner.js +7 -1
  9. package/dist/{agents-QO7GKBYT.js → agents-IYBY3JT5.js} +8 -9
  10. package/dist/{agents-HANWZNI6.js → agents-XWIPONJR.js} +8 -9
  11. package/dist/{app-settings-RXBH7KY4.js → app-settings-A5D364JD.js} +1 -2
  12. package/dist/{app-settings-TUVLZNDE.js → app-settings-SA4HX3ZQ.js} +1 -2
  13. package/dist/{chunk-3Q4XNYHY.js → chunk-2GEUFPQQ.js} +1 -1
  14. package/dist/{chunk-MAW7DIG7.js → chunk-4F7THWIO.js} +2 -2
  15. package/dist/{chunk-K7M7MIWL.js → chunk-4G3W23X3.js} +3 -3
  16. package/dist/{chunk-Q3FHTGIW.js → chunk-5Y2C7Q55.js} +441 -20
  17. package/dist/{chunk-TMCK5TLA.js → chunk-ATQLP22S.js} +1 -1
  18. package/dist/{chunk-PB6HW7SA.js → chunk-CHYUUETG.js} +3 -3
  19. package/dist/{chunk-QPSKQP6E.js → chunk-D446IWPP.js} +48 -3
  20. package/dist/{chunk-C7HUCBX7.js → chunk-DACWFN4O.js} +5 -5
  21. package/dist/{chunk-B244TJWC.js → chunk-ECY7WL6T.js} +2 -2
  22. package/dist/{chunk-D744HOI5.js → chunk-EJRCHCXM.js} +18 -3
  23. package/dist/{chunk-KXRF6RNL.js → chunk-EUIVQAPK.js} +2 -2
  24. package/dist/{chunk-XLVLMQKN.js → chunk-EYDLXVED.js} +40 -25
  25. package/dist/{chunk-75RPUXJS.js → chunk-JKHCADKB.js} +5 -5
  26. package/dist/{chunk-4H5MWZ6J.js → chunk-KLVW3J2B.js} +2 -2
  27. package/dist/{chunk-QG4CYRA3.js → chunk-MO46K6WK.js} +14 -14
  28. package/dist/{chunk-F2PVRF3B.js → chunk-N6ZF3XRP.js} +2 -1
  29. package/dist/chunk-NJV5YEKI.js +194 -0
  30. package/dist/{chunk-BBNWKL4I.js → chunk-NQGLDQYB.js} +8 -8
  31. package/dist/{chunk-YGVGXQA7.js → chunk-Q4UPRQOS.js} +12 -12
  32. package/dist/{chunk-ZUAYA57W.js → chunk-QMLDR63X.js} +2 -2
  33. package/dist/{chunk-KECHK3ZT.js → chunk-R2C45NHT.js} +2 -2
  34. package/dist/{chunk-FWVUGLBG.js → chunk-RDXODLEN.js} +4 -4
  35. package/dist/{chunk-JM2TGOHP.js → chunk-SB5ADEZZ.js} +5 -5
  36. package/dist/{chunk-SO7G6O24.js → chunk-SFXGD5KJ.js} +1 -1
  37. package/dist/{chunk-LRHUBGEM.js → chunk-TUH4ICHQ.js} +1 -1
  38. package/dist/{chunk-WUCAVIIP.js → chunk-UMXBH344.js} +1 -1
  39. package/dist/{chunk-GP3RLZ6A.js → chunk-WD222BVP.js} +109 -491
  40. package/dist/{chunk-46FECFZU.js → chunk-X3XTO45Y.js} +39 -196
  41. package/dist/{chunk-RZVOX2MT.js → chunk-XBBZZHJY.js} +3 -3
  42. package/dist/{chunk-2EOLWHXH.js → chunk-XOMVOBPU.js} +127 -477
  43. package/dist/{chunk-ZSHS46V5.js → chunk-Y6OHM672.js} +476 -20
  44. package/dist/{chunk-YWQF7WAG.js → chunk-ZPBOWO64.js} +2 -2
  45. package/dist/{conductor-4GVTHUUB.js → conductor-G6GH5ZMU.js} +7 -7
  46. package/dist/{conductor-TGWI6ETZ.js → conductor-U5LGJZUJ.js} +6 -7
  47. package/dist/{coordinator-prompt-3E6SIDTM.js → coordinator-prompt-3PJLU3UH.js} +5 -6
  48. package/dist/{coordinator-prompt-WEYJREV6.js → coordinator-prompt-J7O7JB26.js} +5 -6
  49. package/dist/{global-workspace-UIEXAG2B.js → global-workspace-4CTLU2BV.js} +5 -6
  50. package/dist/{global-workspace-FPDZKUPF.js → global-workspace-Y3UDZYJX.js} +5 -6
  51. package/dist/index.cjs +605 -508
  52. package/dist/index.d.cts +23 -11
  53. package/dist/index.d.ts +23 -11
  54. package/dist/index.js +67 -65
  55. package/dist/{linear-6S7MK5YK.js → linear-CXWGH2TW.js} +2 -3
  56. package/dist/{linear-Z2T4KUAQ.js → linear-WLDCJ3AF.js} +2 -3
  57. package/dist/{linear-list-Q4M7AZO2.js → linear-list-52LEDEWO.js} +1 -1
  58. package/dist/{linear-list-A37WLUBO.js → linear-list-FGVN65JU.js} +1 -1
  59. package/dist/mcp/run-stdio.cjs +19762 -19682
  60. package/dist/mcp/run-stdio.js +33 -34
  61. package/dist/{optional-cli-CA4LL322.js → optional-cli-FN4MGB6W.js} +4 -5
  62. package/dist/{optional-cli-AANBL4U5.js → optional-cli-INRVBBBG.js} +3 -4
  63. package/dist/{orchestrator-RQXRZW7Z.js → orchestrator-3F53AZEN.js} +11 -12
  64. package/dist/{orchestrator-7FVDBE7Y.js → orchestrator-YY2JUYKD.js} +12 -12
  65. package/dist/{thread-store-4ZN3DS2W.js → thread-store-4WE24XA2.js} +6 -2
  66. package/dist/{thread-store-IC4BQXDW.js → thread-store-K2ZNGUSM.js} +7 -3
  67. package/dist/{workspaces-LEW4UP56.js → workspaces-MM7CQYR6.js} +5 -6
  68. package/dist/{workspaces-QONNLHNR.js → workspaces-WYCVZ6XH.js} +5 -6
  69. package/dist/{worktree-KFEJAQ2H.js → worktree-JBNEMJ5Z.js} +7 -8
  70. package/dist/{worktree-6GIONDQO.js → worktree-NNVRGPP4.js} +4 -5
  71. package/package.json +1 -1
  72. package/dist/chunk-77WWLBCI.js +0 -50
  73. package/dist/chunk-KGZBYWZ3.js +0 -23
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  loadAppSettings,
6
6
  saveAppSettings
7
- } from "./chunk-QPSKQP6E.js";
7
+ } from "./chunk-D446IWPP.js";
8
8
 
9
9
  // src/integrations/optional-services.ts
10
10
  var OPTIONAL_SERVICE_IDS = ["vercel", "supabase", "posthog", "sentry"];
@@ -273,7 +273,7 @@ async function connectedCliPresence(integrations) {
273
273
  const ids = connectedOptionalServices(integrations).filter((spec) => spec.cli).map((spec) => spec.id);
274
274
  if (ids.length === 0) return void 0;
275
275
  try {
276
- const { optionalCliPresence } = await import("./optional-cli-CA4LL322.js");
276
+ const { optionalCliPresence } = await import("./optional-cli-FN4MGB6W.js");
277
277
  return await optionalCliPresence(ids);
278
278
  } catch {
279
279
  return void 0;
@@ -18,9 +18,6 @@ import {
18
18
  withRemovedAccount,
19
19
  withSelectedAccount
20
20
  } from "./chunk-J2LNLI4S.js";
21
- import {
22
- normalizeThinkingEffort
23
- } from "./chunk-KGZBYWZ3.js";
24
21
  import {
25
22
  appDataDir
26
23
  } from "./chunk-WOU343SI.js";
@@ -55,6 +52,23 @@ function coerceOrchestratorAgent(agent, fallback = "claude") {
55
52
  return isOrchestratorCapableAgent(agent) ? agent : fallback;
56
53
  }
57
54
 
55
+ // src/types/thinking-effort.ts
56
+ var THINKING_EFFORTS = [
57
+ "low",
58
+ "medium",
59
+ "high",
60
+ "xhigh",
61
+ "max"
62
+ ];
63
+ var EFFORT_SET = new Set(THINKING_EFFORTS);
64
+ function normalizeThinkingEffort(value) {
65
+ if (typeof value !== "string") return null;
66
+ const v = value.trim().toLowerCase();
67
+ if (v === "normal") return "medium";
68
+ if (EFFORT_SET.has(v)) return v;
69
+ return null;
70
+ }
71
+
58
72
  // src/store/thread-option-defaults.ts
59
73
  function normalizeAutonomy(value) {
60
74
  return value === "default" || value === "full" ? value : void 0;
@@ -2372,6 +2386,7 @@ export {
2372
2386
  isOrchestratorCapableAgent,
2373
2387
  assertOrchestratorCapableAgent,
2374
2388
  coerceOrchestratorAgent,
2389
+ normalizeThinkingEffort,
2375
2390
  getDefaultAgent,
2376
2391
  getDefaultModel,
2377
2392
  getDefaultEffort,
@@ -4,14 +4,14 @@ import {
4
4
  normalizeAbleTimeCredential,
5
5
  normalizeAbleTimeHost,
6
6
  rewriteAbleTimeError
7
- } from "./chunk-C7HUCBX7.js";
7
+ } from "./chunk-DACWFN4O.js";
8
8
  import {
9
9
  httpFetch
10
10
  } from "./chunk-JAT3JFOS.js";
11
11
  import {
12
12
  getAbleTimeAccessToken,
13
13
  getAbleTimeHost
14
- } from "./chunk-QPSKQP6E.js";
14
+ } from "./chunk-D446IWPP.js";
15
15
 
16
16
  // src/integrations/abletime-rest.ts
17
17
  var ABLETIME_REST_PREFIX = "/api/public/v2";
@@ -11,11 +11,11 @@ import {
11
11
  isGlobalThread,
12
12
  isOrchestratorThread,
13
13
  isSlackCoordinatorThread
14
- } from "./chunk-YGVGXQA7.js";
14
+ } from "./chunk-Q4UPRQOS.js";
15
15
  import {
16
16
  mergeAgentGitAuthEnv,
17
17
  resolveAgentGitAuthEnv
18
- } from "./chunk-75RPUXJS.js";
18
+ } from "./chunk-JKHCADKB.js";
19
19
  import {
20
20
  ATTACHMENTS_DIR,
21
21
  DETACHED_JOBS_DIR,
@@ -29,13 +29,6 @@ import {
29
29
  ensureAgentPath,
30
30
  run
31
31
  } from "./chunk-YBTSZ2SW.js";
32
- import {
33
- assertOrchestratorCapableAgent,
34
- contextTokens
35
- } from "./chunk-D744HOI5.js";
36
- import {
37
- stripNestedElectronEnv
38
- } from "./chunk-WWUABK6B.js";
39
32
  import {
40
33
  REVIEW_TAB_TITLE,
41
34
  allocateTeamName,
@@ -47,7 +40,14 @@ import {
47
40
  updateThread,
48
41
  worktreeNameFromPath,
49
42
  writeThread
50
- } from "./chunk-Q3FHTGIW.js";
43
+ } from "./chunk-5Y2C7Q55.js";
44
+ import {
45
+ assertOrchestratorCapableAgent,
46
+ contextTokens
47
+ } from "./chunk-EJRCHCXM.js";
48
+ import {
49
+ stripNestedElectronEnv
50
+ } from "./chunk-WWUABK6B.js";
51
51
  import {
52
52
  findConventionSetup,
53
53
  loadRepoSettings,
@@ -1215,16 +1215,6 @@ function isAskUserToolName(name) {
1215
1215
  const base = name.replace(/^mcp__sideboard__/i, "");
1216
1216
  return ASK_USER_TOOL_RE.test(name) || /^ask_user$/i.test(base);
1217
1217
  }
1218
- function lastTopLevelToolIsAskUser(parts) {
1219
- if (!parts?.length) return false;
1220
- for (let i = parts.length - 1; i >= 0; i--) {
1221
- const part = parts[i];
1222
- if (part.type === "tool" && !part.parentId) {
1223
- return isAskUserToolName(part.name);
1224
- }
1225
- }
1226
- return false;
1227
- }
1228
1218
  function questionsFromToolPart(part) {
1229
1219
  const fromInput = parsePlanQuestionsInput(part.input);
1230
1220
  if (fromInput.length) return fromInput;
@@ -1240,7 +1230,7 @@ function extractPendingPlanQuestions(parts) {
1240
1230
  if (!parts?.length) return null;
1241
1231
  for (let i = parts.length - 1; i >= 0; i--) {
1242
1232
  const p = parts[i];
1243
- if (p.type !== "tool" || !isAskUserToolName(p.name)) continue;
1233
+ if (p.type !== "tool" || p.parentId || !isAskUserToolName(p.name)) continue;
1244
1234
  const questions = questionsFromToolPart(p);
1245
1235
  if (!questions.length) continue;
1246
1236
  return {
@@ -1272,8 +1262,32 @@ function isIncompleteTaskState(state) {
1272
1262
  function needsCoordinatorAction(state) {
1273
1263
  return isIncompleteTaskState(state) || state === "input-required";
1274
1264
  }
1275
- function endedOnAskUser(parts) {
1276
- return lastTopLevelToolIsAskUser(parts);
1265
+ function turnWaitingOnAskUser(parts, dismissedQuestionSignature) {
1266
+ if (!parts?.length) return false;
1267
+ let ask = null;
1268
+ for (let i = parts.length - 1; i >= 0; i--) {
1269
+ const part = parts[i];
1270
+ if (part.type === "tool" && !part.parentId && isAskUserToolName(part.name)) {
1271
+ ask = part;
1272
+ break;
1273
+ }
1274
+ }
1275
+ if (!ask) return false;
1276
+ const dismissed = dismissedQuestionSignature?.trim();
1277
+ if (!dismissed) return true;
1278
+ const pending = extractPendingPlanQuestions([ask]);
1279
+ if (!pending?.signature) return false;
1280
+ return pending.signature !== dismissed;
1281
+ }
1282
+ function userRepliedAfterAgent(messages, lastAgent) {
1283
+ if (!messages || !lastAgent) return false;
1284
+ const index = messages.lastIndexOf(lastAgent);
1285
+ if (index < 0) return false;
1286
+ for (let i = index + 1; i < messages.length; i++) {
1287
+ const message = messages[i];
1288
+ if (message.role === "user" && message.origin !== "continue") return true;
1289
+ }
1290
+ return false;
1277
1291
  }
1278
1292
  function deriveTaskState(input) {
1279
1293
  if (input.stillRunning) {
@@ -1286,7 +1300,7 @@ function deriveTaskState(input) {
1286
1300
  case "stopped":
1287
1301
  return "canceled";
1288
1302
  default:
1289
- return endedOnAskUser(input.lastAgentParts) ? "input-required" : "completed";
1303
+ return !input.userAnswered && turnWaitingOnAskUser(input.lastAgentParts, input.dismissedQuestionSignature) ? "input-required" : "completed";
1290
1304
  }
1291
1305
  }
1292
1306
 
@@ -1682,7 +1696,7 @@ var PORT_RANGE_SIZE = 10;
1682
1696
  var RECLAIM_RETRY_DELAY_MS = 40;
1683
1697
  var RECLAIM_TRIES = 8;
1684
1698
  async function killReclaimable(ports, worktreePath, signal) {
1685
- const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-TGWI6ETZ.js");
1699
+ const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-U5LGJZUJ.js");
1686
1700
  if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
1687
1701
  else killListenersOnPorts2(ports);
1688
1702
  }
@@ -2369,6 +2383,7 @@ export {
2369
2383
  extractPendingPlanQuestions,
2370
2384
  askBlockStillWaiting,
2371
2385
  needsCoordinatorAction,
2386
+ userRepliedAfterAgent,
2372
2387
  deriveTaskState,
2373
2388
  mcpWaitForTurnTimeoutMs,
2374
2389
  mcpWaitTaskHint,
@@ -17,17 +17,17 @@ import {
17
17
  originCli,
18
18
  resolveGhAuthToken
19
19
  } from "./chunk-YBTSZ2SW.js";
20
- import {
21
- getGithubGitAuthMode,
22
- getGithubPat
23
- } from "./chunk-D744HOI5.js";
24
20
  import {
25
21
  allocateTeamName,
26
22
  listThreads,
27
23
  normalizeTakenSlug,
28
24
  normalizeWorktreePath,
29
25
  takenSlugsFromThread
30
- } from "./chunk-Q3FHTGIW.js";
26
+ } from "./chunk-5Y2C7Q55.js";
27
+ import {
28
+ getGithubGitAuthMode,
29
+ getGithubPat
30
+ } from "./chunk-EJRCHCXM.js";
31
31
  import {
32
32
  worktreesRoot
33
33
  } from "./chunk-WOU343SI.js";
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-2TUE6JKQ.js";
8
8
  import {
9
9
  resolveAgentExecutable
10
- } from "./chunk-QPSKQP6E.js";
10
+ } from "./chunk-D446IWPP.js";
11
11
 
12
12
  // src/agents/install.ts
13
13
  import { existsSync } from "fs";
@@ -265,7 +265,7 @@ async function loginAgent(agent) {
265
265
  };
266
266
  }
267
267
  async function loginManagedAccount(accountId) {
268
- const { loadAppSettings } = await import("./app-settings-RXBH7KY4.js");
268
+ const { loadAppSettings } = await import("./app-settings-A5D364JD.js");
269
269
  const { loginEnvPrefix } = await import("./managed-accounts-JJTAKHMG.js");
270
270
  const account = loadAppSettings().accounts.accounts.find((a) => a.id === accountId);
271
271
  if (!account) {
@@ -12,13 +12,13 @@ import {
12
12
  } from "./chunk-5MXLDDYF.js";
13
13
  import {
14
14
  isOrchestratorThread
15
- } from "./chunk-YGVGXQA7.js";
15
+ } from "./chunk-Q4UPRQOS.js";
16
16
  import {
17
17
  codexUnattendedGitConfigArgs,
18
18
  mergeAgentGitAuthEnv,
19
19
  resolveAgentGitAuthEnv,
20
20
  resolveCodexGitWritableRoots
21
- } from "./chunk-75RPUXJS.js";
21
+ } from "./chunk-JKHCADKB.js";
22
22
  import {
23
23
  applyConnectedTeamToCli,
24
24
  brightsyMcpServerName,
@@ -33,12 +33,19 @@ import {
33
33
  } from "./chunk-2GPQZZLY.js";
34
34
  import {
35
35
  listAssignedLinearIssues
36
- } from "./chunk-WUCAVIIP.js";
36
+ } from "./chunk-UMXBH344.js";
37
37
  import {
38
38
  githubAgentAuthReady,
39
39
  npmGlobalNodeModules,
40
40
  run
41
41
  } from "./chunk-YBTSZ2SW.js";
42
+ import {
43
+ BASE_ALLOWED_TOOLS,
44
+ CLAUDE_CHROME_ALLOWED_TOOLS,
45
+ CLAUDE_POSTHOG_CONNECTOR_ALLOWED_TOOLS,
46
+ CLAUDE_PRINT_BG_WAIT_CEILING_MS,
47
+ mcpAllowToolsFromNames
48
+ } from "./chunk-5Y2C7Q55.js";
42
49
  import {
43
50
  claudeChromeEnabled,
44
51
  fromInclusiveInputUsage,
@@ -49,19 +56,12 @@ import {
49
56
  requestOccupancy,
50
57
  resolveAgentExecutable,
51
58
  resolveClaudeExecutable
52
- } from "./chunk-D744HOI5.js";
59
+ } from "./chunk-EJRCHCXM.js";
53
60
  import {
54
61
  isElectronLikeCommand,
55
62
  unwrapStrippedElectronLaunch,
56
63
  wrapElectronAsNodeLaunch
57
64
  } from "./chunk-WWUABK6B.js";
58
- import {
59
- BASE_ALLOWED_TOOLS,
60
- CLAUDE_CHROME_ALLOWED_TOOLS,
61
- CLAUDE_POSTHOG_CONNECTOR_ALLOWED_TOOLS,
62
- CLAUDE_PRINT_BG_WAIT_CEILING_MS,
63
- mcpAllowToolsFromNames
64
- } from "./chunk-Q3FHTGIW.js";
65
65
  import {
66
66
  appDataDir
67
67
  } from "./chunk-WOU343SI.js";
@@ -2966,7 +2966,7 @@ var claudeAdapter = {
2966
2966
  );
2967
2967
  }
2968
2968
  const mode = permissionMode(thread);
2969
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-FPDZKUPF.js");
2969
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-Y3UDZYJX.js");
2970
2970
  const isOrchestrator = isOrchestratorThread2(thread);
2971
2971
  const rpc = worktreeAgentRpc(isOrchestrator);
2972
2972
  const injectedServers = await buildInjectedMcpServers({
@@ -3193,7 +3193,7 @@ var claudeAdapter = {
3193
3193
  return { file: claude, args, cwd: thread.worktreePath };
3194
3194
  },
3195
3195
  async listLinearIssues(_repoPath) {
3196
- const { listAssignedLinearIssues: listAssignedLinearIssues2 } = await import("./linear-list-Q4M7AZO2.js");
3196
+ const { listAssignedLinearIssues: listAssignedLinearIssues2 } = await import("./linear-list-52LEDEWO.js");
3197
3197
  return listAssignedLinearIssues2();
3198
3198
  }
3199
3199
  };
@@ -4667,7 +4667,7 @@ var opencodeAdapter = {
4667
4667
  };
4668
4668
  },
4669
4669
  async listLinearIssues(_repoPath) {
4670
- const { listAssignedLinearIssues: listAssignedLinearIssues2 } = await import("./linear-list-Q4M7AZO2.js");
4670
+ const { listAssignedLinearIssues: listAssignedLinearIssues2 } = await import("./linear-list-52LEDEWO.js");
4671
4671
  return listAssignedLinearIssues2();
4672
4672
  }
4673
4673
  };
@@ -84,7 +84,8 @@ var BASE_ALLOWED_TOOLS = [
84
84
  "TaskStop",
85
85
  "EnterWorktree",
86
86
  "ExitWorktree",
87
- "Skill"
87
+ "Skill",
88
+ "AskUserQuestion"
88
89
  ];
89
90
  var CLAUDE_PRINT_BG_WAIT_CEILING_MS = 72e5;
90
91
  var CLAUDE_CHROME_ALLOWED_TOOLS = [
@@ -0,0 +1,194 @@
1
+ // src/plan/ask-user.ts
2
+ function planQuestionsSignature(questions) {
3
+ return questions.map((q) => {
4
+ const opts = q.options.map((o) => o.label).join("");
5
+ return `${q.question}${opts}`;
6
+ }).join("");
7
+ }
8
+ function asRecord(v) {
9
+ return v != null && typeof v === "object" && !Array.isArray(v) ? v : null;
10
+ }
11
+ function parseOptions(raw) {
12
+ if (!Array.isArray(raw)) return [];
13
+ const out = [];
14
+ for (const item of raw) {
15
+ if (typeof item === "string" && item.trim()) {
16
+ out.push({ label: item.trim() });
17
+ continue;
18
+ }
19
+ const o = asRecord(item);
20
+ if (!o) continue;
21
+ const label = typeof o.label === "string" ? o.label.trim() : typeof o.text === "string" ? o.text.trim() : typeof o.title === "string" ? o.title.trim() : "";
22
+ if (!label) continue;
23
+ const description = typeof o.description === "string" && o.description.trim() ? o.description.trim() : void 0;
24
+ out.push({ label, description });
25
+ }
26
+ return out;
27
+ }
28
+ function parseOneQuestion(raw) {
29
+ const o = asRecord(raw);
30
+ if (!o) return null;
31
+ const question = typeof o.question === "string" ? o.question.trim() : typeof o.text === "string" ? o.text.trim() : typeof o.prompt === "string" ? o.prompt.trim() : "";
32
+ if (!question) return null;
33
+ const options = parseOptions(o.options);
34
+ if (options.length < 1) return null;
35
+ const header = typeof o.header === "string" && o.header.trim() ? o.header.trim() : void 0;
36
+ const multiSelect = Boolean(o.multiSelect ?? o.multi_select);
37
+ return { question, header, multiSelect, options };
38
+ }
39
+ function parsePlanQuestionsInput(input) {
40
+ const root = asRecord(input);
41
+ if (!root) return [];
42
+ const list = Array.isArray(root.questions) ? root.questions : Array.isArray(root.question) ? root.question : root.question || root.prompt ? [root] : [];
43
+ const out = [];
44
+ for (const item of list) {
45
+ const q = parseOneQuestion(item);
46
+ if (q) out.push(q);
47
+ }
48
+ return out;
49
+ }
50
+ var ASK_USER_TOOL_RE = /^(AskUserQuestion|ask_user|mcp__sideboard__ask_user)$/i;
51
+ function isAskUserToolName(name) {
52
+ if (!name) return false;
53
+ const base = name.replace(/^mcp__sideboard__/i, "");
54
+ return ASK_USER_TOOL_RE.test(name) || /^ask_user$/i.test(base);
55
+ }
56
+ function lastTopLevelToolIsAskUser(parts) {
57
+ if (!parts?.length) return false;
58
+ for (let i = parts.length - 1; i >= 0; i--) {
59
+ const part = parts[i];
60
+ if (part.type === "tool" && !part.parentId) {
61
+ return isAskUserToolName(part.name);
62
+ }
63
+ }
64
+ return false;
65
+ }
66
+ function questionsFromToolPart(part) {
67
+ const fromInput = parsePlanQuestionsInput(part.input);
68
+ if (fromInput.length) return fromInput;
69
+ const raw = part.result?.trim();
70
+ if (!raw || !raw.startsWith("{")) return [];
71
+ try {
72
+ return parsePlanQuestionsInput(JSON.parse(raw));
73
+ } catch {
74
+ return [];
75
+ }
76
+ }
77
+ function extractPendingPlanQuestions(parts) {
78
+ if (!parts?.length) return null;
79
+ for (let i = parts.length - 1; i >= 0; i--) {
80
+ const p = parts[i];
81
+ if (p.type !== "tool" || p.parentId || !isAskUserToolName(p.name)) continue;
82
+ const questions = questionsFromToolPart(p);
83
+ if (!questions.length) continue;
84
+ return {
85
+ id: p.id || `ask-${i}`,
86
+ signature: planQuestionsSignature(questions),
87
+ questions,
88
+ source: p.name || "ask_user"
89
+ };
90
+ }
91
+ return null;
92
+ }
93
+ function pendingFromAskBlock(block, dismissedQuestionSignature) {
94
+ if (!block || block.source !== "ask_user" || !block.questions?.length) return null;
95
+ const dismissed = dismissedQuestionSignature?.trim();
96
+ if (dismissed && (!block.questionSignature || block.questionSignature === dismissed)) {
97
+ return null;
98
+ }
99
+ const signature = block.questionSignature?.trim() || planQuestionsSignature(block.questions);
100
+ return {
101
+ id: `ask-block:${signature}`,
102
+ signature,
103
+ questions: block.questions,
104
+ source: "ask_user"
105
+ };
106
+ }
107
+ function askBlockStillWaiting(block, messages) {
108
+ if (!messages?.length) return Boolean(block?.at);
109
+ const askedAt = block?.at;
110
+ if (!askedAt) return false;
111
+ for (let i = messages.length - 1; i >= 0; i--) {
112
+ const message = messages[i];
113
+ if (message.role !== "user" || message.origin === "continue") continue;
114
+ if (!message.ts) return true;
115
+ return askedAt > message.ts;
116
+ }
117
+ return true;
118
+ }
119
+ function latestPendingPlanQuestions(input) {
120
+ if (input.userReplied) return null;
121
+ const dismissed = input.dismissedQuestionSignature?.trim();
122
+ const accept = (pending) => {
123
+ if (!pending) return null;
124
+ if (dismissed && pending.signature === dismissed) return null;
125
+ return pending;
126
+ };
127
+ const fromBlock = () => pendingFromAskBlock(input.agentBlock, input.dismissedQuestionSignature);
128
+ const liveAsk = accept(extractPendingPlanQuestions(input.liveParts));
129
+ if (liveAsk) return liveAsk;
130
+ const last = input.messages[input.messages.length - 1];
131
+ if (last?.role === "agent") {
132
+ const fromTranscript = accept(extractPendingPlanQuestions(last.parts));
133
+ if (fromTranscript) return fromTranscript;
134
+ }
135
+ if ((input.status === "running" || input.status === "queued") && !input.agentBlock?.onScreen) {
136
+ return null;
137
+ }
138
+ const stamped = fromBlock();
139
+ if (stamped && askBlockStillWaiting(input.agentBlock, input.messages)) {
140
+ return stamped;
141
+ }
142
+ return null;
143
+ }
144
+ var PLAN_QUESTION_ANSWERS_PREFIX = "Answers to your questions:";
145
+ function isPlanQuestionAnswersMessage(text) {
146
+ return text.startsWith(PLAN_QUESTION_ANSWERS_PREFIX);
147
+ }
148
+ function formatPlanQuestionAnswers(questions, answers) {
149
+ const lines = [PLAN_QUESTION_ANSWERS_PREFIX, ""];
150
+ for (let i = 0; i < questions.length; i++) {
151
+ const q = questions[i];
152
+ const a = answers.find((x) => x.questionIndex === i);
153
+ const header = q.header ? `**${q.header}** \u2014 ` : "";
154
+ const parts = [];
155
+ if (a?.selected.length) parts.push(a.selected.join(", "));
156
+ if (a?.other?.trim()) parts.push(a.other.trim());
157
+ const body = parts.length ? parts.join(" \xB7 ") : "(no answer)";
158
+ lines.push(`${i + 1}. ${header}${q.question} `);
159
+ lines.push(` \u2192 ${body}`);
160
+ }
161
+ return lines.join("\n");
162
+ }
163
+ function formatPlanQuestionsForChat(questions) {
164
+ const lines = ["### Questions for you", ""];
165
+ for (let i = 0; i < questions.length; i++) {
166
+ const q = questions[i];
167
+ const header = q.header ? `**${q.header}** \u2014 ` : "";
168
+ lines.push(`${i + 1}. ${header}${q.question}`);
169
+ for (let oi = 0; oi < q.options.length; oi++) {
170
+ const opt = q.options[oi];
171
+ const desc = opt.description?.trim();
172
+ lines.push(
173
+ desc ? ` - **${opt.label}** \u2014 ${desc}` : ` - **${opt.label}**`
174
+ );
175
+ }
176
+ lines.push("");
177
+ }
178
+ lines.push("_Answer in the composer below._");
179
+ return lines.join("\n").trimEnd();
180
+ }
181
+
182
+ export {
183
+ planQuestionsSignature,
184
+ parsePlanQuestionsInput,
185
+ isAskUserToolName,
186
+ lastTopLevelToolIsAskUser,
187
+ extractPendingPlanQuestions,
188
+ askBlockStillWaiting,
189
+ latestPendingPlanQuestions,
190
+ PLAN_QUESTION_ANSWERS_PREFIX,
191
+ isPlanQuestionAnswersMessage,
192
+ formatPlanQuestionAnswers,
193
+ formatPlanQuestionsForChat
194
+ };
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-S5CJUIPY.js";
7
7
  import {
8
8
  listAssignedLinearIssues
9
- } from "./chunk-TMCK5TLA.js";
9
+ } from "./chunk-ATQLP22S.js";
10
10
  import {
11
11
  looksLikeConversationSummary,
12
12
  looksLikeSkillBody,
@@ -15,13 +15,13 @@ import {
15
15
  } from "./chunk-OOXRMTU6.js";
16
16
  import {
17
17
  isOrchestratorThread
18
- } from "./chunk-FWVUGLBG.js";
18
+ } from "./chunk-RDXODLEN.js";
19
19
  import {
20
20
  codexUnattendedGitConfigArgs,
21
21
  mergeAgentGitAuthEnv,
22
22
  resolveAgentGitAuthEnv,
23
23
  resolveCodexGitWritableRoots
24
- } from "./chunk-KECHK3ZT.js";
24
+ } from "./chunk-R2C45NHT.js";
25
25
  import {
26
26
  loadBrightsyConfig
27
27
  } from "./chunk-RSA47QYR.js";
@@ -34,7 +34,7 @@ import {
34
34
  CLAUDE_POSTHOG_CONNECTOR_ALLOWED_TOOLS,
35
35
  CLAUDE_PRINT_BG_WAIT_CEILING_MS,
36
36
  mcpAllowToolsFromNames
37
- } from "./chunk-F2PVRF3B.js";
37
+ } from "./chunk-N6ZF3XRP.js";
38
38
  import {
39
39
  CURSOR_SDK_INSTALL_HINT,
40
40
  applyAgentRunnerHeapEnv,
@@ -80,7 +80,7 @@ import {
80
80
  requestOccupancy,
81
81
  resolveAgentExecutable,
82
82
  resolveClaudeExecutable
83
- } from "./chunk-QPSKQP6E.js";
83
+ } from "./chunk-D446IWPP.js";
84
84
  import {
85
85
  isElectronLikeCommand,
86
86
  unwrapStrippedElectronLaunch
@@ -2659,7 +2659,7 @@ var claudeAdapter = {
2659
2659
  );
2660
2660
  }
2661
2661
  const mode = permissionMode(thread);
2662
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-UIEXAG2B.js");
2662
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-4CTLU2BV.js");
2663
2663
  const isOrchestrator = isOrchestratorThread2(thread);
2664
2664
  const rpc = worktreeAgentRpc(isOrchestrator);
2665
2665
  const injectedServers = await buildInjectedMcpServers({
@@ -2886,7 +2886,7 @@ var claudeAdapter = {
2886
2886
  return { file: claude, args, cwd: thread.worktreePath };
2887
2887
  },
2888
2888
  async listLinearIssues(_repoPath) {
2889
- const { listAssignedLinearIssues: listAssignedLinearIssues2 } = await import("./linear-list-A37WLUBO.js");
2889
+ const { listAssignedLinearIssues: listAssignedLinearIssues2 } = await import("./linear-list-FGVN65JU.js");
2890
2890
  return listAssignedLinearIssues2();
2891
2891
  }
2892
2892
  };
@@ -3977,7 +3977,7 @@ var opencodeAdapter = {
3977
3977
  };
3978
3978
  },
3979
3979
  async listLinearIssues(_repoPath) {
3980
- const { listAssignedLinearIssues: listAssignedLinearIssues2 } = await import("./linear-list-A37WLUBO.js");
3980
+ const { listAssignedLinearIssues: listAssignedLinearIssues2 } = await import("./linear-list-FGVN65JU.js");
3981
3981
  return listAssignedLinearIssues2();
3982
3982
  }
3983
3983
  };
@@ -7,11 +7,20 @@ import {
7
7
  resolveGithubRepoSlug,
8
8
  resolveOriginRemote,
9
9
  resolveRepoRoot
10
- } from "./chunk-75RPUXJS.js";
10
+ } from "./chunk-JKHCADKB.js";
11
11
  import {
12
12
  ATTACHMENTS_DIR,
13
13
  attachmentsGitignoreBody
14
14
  } from "./chunk-N2WW62LF.js";
15
+ import {
16
+ allocateTeamName,
17
+ createEmptyThread,
18
+ listThreads,
19
+ takenSlugsFromThread,
20
+ teamSlugFromName,
21
+ updateThread,
22
+ writeThread
23
+ } from "./chunk-5Y2C7Q55.js";
15
24
  import {
16
25
  assertOrchestratorCapableAgent,
17
26
  formatAccountProfilePlaybookLine,
@@ -24,16 +33,7 @@ import {
24
33
  resolveThreadDefaults,
25
34
  resolveViewerProfile,
26
35
  resolveViewerProfileForRepo
27
- } from "./chunk-D744HOI5.js";
28
- import {
29
- allocateTeamName,
30
- createEmptyThread,
31
- listThreads,
32
- takenSlugsFromThread,
33
- teamSlugFromName,
34
- updateThread,
35
- writeThread
36
- } from "./chunk-Q3FHTGIW.js";
36
+ } from "./chunk-EJRCHCXM.js";
37
37
  import {
38
38
  appDataDir,
39
39
  globalAgentCwd,
@@ -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). Turn on for phone remote / away-from-keyboard work, overnight schedules, or when the user will be away. 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). 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 runs for that automation. Worktree agents have the same tools (`chatId=self` continues that coding chat). 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 runs for that automation. 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.",
361
361
  "Projects:",
362
362
  "- add_project / remove_project \u2014 register or unregister a git repo",
363
363
  "Workspaces and chats:",
@@ -2,11 +2,11 @@ import {
2
2
  OPTIONAL_SERVICES,
3
3
  isOptionalServiceId,
4
4
  optionalServiceSpec
5
- } from "./chunk-B244TJWC.js";
5
+ } from "./chunk-ECY7WL6T.js";
6
6
  import {
7
7
  installNpmGlobalPackage,
8
8
  whichOnPath
9
- } from "./chunk-4H5MWZ6J.js";
9
+ } from "./chunk-KLVW3J2B.js";
10
10
  import {
11
11
  enrichPathWithNpmGlobalBin
12
12
  } from "./chunk-2TUE6JKQ.js";