@sideboard-ai/core 0.1.327 → 0.1.329

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 (69) hide show
  1. package/dist/{abletime-OW7LTFQD.js → abletime-5FBKBO3R.js} +4 -4
  2. package/dist/{abletime-NW4PJGHN.js → abletime-SO2YHMEI.js} +4 -4
  3. package/dist/{abletime-oauth-TPR2QDRI.js → abletime-oauth-EUC5FFMD.js} +5 -5
  4. package/dist/{abletime-oauth-KWQQRHOQ.js → abletime-oauth-I34WZZZL.js} +3 -3
  5. package/dist/{abletime-rest-5DCWN3P4.js → abletime-rest-EI5ZJ72Z.js} +3 -3
  6. package/dist/{abletime-rest-UJ6SXDBN.js → abletime-rest-HEQXSZAQ.js} +3 -3
  7. package/dist/agents/claude-runner.js +1 -1
  8. package/dist/{agents-XWIPONJR.js → agents-JH4WV2ZH.js} +7 -7
  9. package/dist/{agents-IYBY3JT5.js → agents-JXQKHY7Q.js} +7 -7
  10. package/dist/{app-settings-A5D364JD.js → app-settings-JAEV53LB.js} +1 -1
  11. package/dist/{app-settings-SA4HX3ZQ.js → app-settings-SHZWNJBV.js} +1 -1
  12. package/dist/{chunk-TUH4ICHQ.js → chunk-277I5IBI.js} +1 -1
  13. package/dist/{chunk-QMLDR63X.js → chunk-3DJQLQWU.js} +2 -2
  14. package/dist/{chunk-EJRCHCXM.js → chunk-7BAS6DF7.js} +2 -1
  15. package/dist/{chunk-ECY7WL6T.js → chunk-7L36GZA4.js} +2 -2
  16. package/dist/{chunk-SFXGD5KJ.js → chunk-7MPRTC6X.js} +1 -1
  17. package/dist/{chunk-ZPBOWO64.js → chunk-BAIPCN34.js} +2 -2
  18. package/dist/{chunk-SB5ADEZZ.js → chunk-D6V6F74A.js} +5 -5
  19. package/dist/{chunk-MO46K6WK.js → chunk-DBRQ5NNB.js} +8 -8
  20. package/dist/{chunk-NQGLDQYB.js → chunk-DFKLWWLY.js} +7 -7
  21. package/dist/{chunk-YUHZEIVG.js → chunk-E6LONPQH.js} +78 -24
  22. package/dist/{chunk-5Y2C7Q55.js → chunk-EW5D53VB.js} +1 -1
  23. package/dist/{chunk-D446IWPP.js → chunk-EY5BJAPV.js} +2 -1
  24. package/dist/{chunk-XBBZZHJY.js → chunk-F4OUZDIB.js} +5 -5
  25. package/dist/{chunk-Q4UPRQOS.js → chunk-G45SGI57.js} +3 -3
  26. package/dist/{chunk-DEB47BII.js → chunk-HCK3UCBJ.js} +80 -26
  27. package/dist/{chunk-EUIVQAPK.js → chunk-HJIA4X3L.js} +2 -2
  28. package/dist/{chunk-4F7THWIO.js → chunk-JQWCZGSO.js} +2 -2
  29. package/dist/{chunk-IXWPCOLQ.js → chunk-KUD24QYI.js} +37 -7
  30. package/dist/{chunk-4G3W23X3.js → chunk-MXQ66CLO.js} +3 -3
  31. package/dist/{chunk-UMXBH344.js → chunk-NCFYUUSC.js} +1 -1
  32. package/dist/{chunk-ULWPSBAB.js → chunk-NJV5YEKI.js} +13 -11
  33. package/dist/{chunk-2GEUFPQQ.js → chunk-NQHTYX35.js} +1 -1
  34. package/dist/{chunk-RDXODLEN.js → chunk-O7JSWISN.js} +3 -3
  35. package/dist/{chunk-R2C45NHT.js → chunk-P4QRDXRY.js} +2 -2
  36. package/dist/{chunk-RZJ3QJZT.js → chunk-PZ5MVD27.js} +34 -19
  37. package/dist/{chunk-Y6OHM672.js → chunk-QVLDZWHZ.js} +1 -1
  38. package/dist/{chunk-DACWFN4O.js → chunk-SKPX66MO.js} +5 -5
  39. package/dist/{chunk-JKHCADKB.js → chunk-U7EANR52.js} +2 -2
  40. package/dist/{chunk-KLVW3J2B.js → chunk-XOIJJRAQ.js} +2 -2
  41. package/dist/{chunk-CHYUUETG.js → chunk-YMV5O7KY.js} +3 -3
  42. package/dist/{chunk-ATQLP22S.js → chunk-ZT5YPYZE.js} +1 -1
  43. package/dist/{conductor-D62Q2XJC.js → conductor-6DIR7A4N.js} +5 -5
  44. package/dist/{conductor-CP7TW6TN.js → conductor-FA27ZGCV.js} +6 -6
  45. package/dist/{coordinator-prompt-J7O7JB26.js → coordinator-prompt-B6RHGEJK.js} +4 -4
  46. package/dist/{coordinator-prompt-3PJLU3UH.js → coordinator-prompt-KAZXK5FZ.js} +4 -4
  47. package/dist/{global-workspace-Y3UDZYJX.js → global-workspace-IOKHZCXD.js} +4 -4
  48. package/dist/{global-workspace-4CTLU2BV.js → global-workspace-JKINHUY3.js} +4 -4
  49. package/dist/index.cjs +107 -22
  50. package/dist/index.d.cts +30 -18
  51. package/dist/index.d.ts +30 -18
  52. package/dist/index.js +27 -25
  53. package/dist/{linear-CXWGH2TW.js → linear-7HSIGV5S.js} +2 -2
  54. package/dist/{linear-WLDCJ3AF.js → linear-FRJRK6KI.js} +2 -2
  55. package/dist/{linear-list-52LEDEWO.js → linear-list-I6DNJC6V.js} +1 -1
  56. package/dist/{linear-list-FGVN65JU.js → linear-list-LDMBSKYI.js} +1 -1
  57. package/dist/mcp/run-stdio.cjs +89 -21
  58. package/dist/mcp/run-stdio.js +16 -16
  59. package/dist/{optional-cli-INRVBBBG.js → optional-cli-FOSC4NVE.js} +3 -3
  60. package/dist/{optional-cli-FN4MGB6W.js → optional-cli-NSQZ2DYK.js} +4 -4
  61. package/dist/{orchestrator-EN3ZKD73.js → orchestrator-LI6EBD2Y.js} +11 -11
  62. package/dist/{orchestrator-W4TZBBDO.js → orchestrator-V35TLMXB.js} +10 -10
  63. package/dist/{thread-store-K2ZNGUSM.js → thread-store-NVFWKJFH.js} +2 -2
  64. package/dist/{thread-store-4WE24XA2.js → thread-store-PCIMS6RA.js} +2 -2
  65. package/dist/{workspaces-MM7CQYR6.js → workspaces-FJL3TL3K.js} +4 -4
  66. package/dist/{workspaces-WYCVZ6XH.js → workspaces-OLONQF2C.js} +4 -4
  67. package/dist/{worktree-JBNEMJ5Z.js → worktree-QSQJ2POO.js} +3 -3
  68. package/dist/{worktree-NNVRGPP4.js → worktree-TX4WXQZV.js} +3 -3
  69. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  formatOptionalServicesDirectiveForTurn,
3
3
  formatOptionalServicesReminderForTurn
4
- } from "./chunk-ECY7WL6T.js";
4
+ } from "./chunk-7L36GZA4.js";
5
5
  import {
6
6
  extractPresentedPlan,
7
7
  isPresentPlanToolName,
@@ -21,7 +21,7 @@ import {
21
21
  parseSessionQuotaResetAt,
22
22
  planModeTurnInstruction,
23
23
  resolveQuotaFallbackAgent
24
- } from "./chunk-NQGLDQYB.js";
24
+ } from "./chunk-DFKLWWLY.js";
25
25
  import {
26
26
  applyWorktreePkgCacheEnv,
27
27
  buildBrightsySessionSeed,
@@ -51,10 +51,11 @@ import {
51
51
  startDevServer,
52
52
  threadsSharingWorktree,
53
53
  turnWatchedDetachedJob,
54
+ userRepliedAfterAgent,
54
55
  worktreeDevProcessKey,
55
56
  worktreeRunProcessKey,
56
57
  worktreeSetupProcessKey
57
- } from "./chunk-IXWPCOLQ.js";
58
+ } from "./chunk-KUD24QYI.js";
58
59
  import {
59
60
  applyAgentEvent,
60
61
  clipAgentEventForPaint,
@@ -97,7 +98,7 @@ import {
97
98
  stageAbsolutePathsAsAttachments,
98
99
  stageBuffersAsAttachments,
99
100
  syncWorkspacesFromThreads
100
- } from "./chunk-RDXODLEN.js";
101
+ } from "./chunk-O7JSWISN.js";
101
102
  import {
102
103
  addPrStackLayer,
103
104
  allocateTeamSlug,
@@ -148,7 +149,7 @@ import {
148
149
  resolveRepoRoot,
149
150
  switchWorktreeBranch,
150
151
  withRepoGitLock
151
- } from "./chunk-R2C45NHT.js";
152
+ } from "./chunk-P4QRDXRY.js";
152
153
  import {
153
154
  REVIEW_TAB_TITLE,
154
155
  agentNicknameFromWorktreePath,
@@ -180,14 +181,14 @@ import {
180
181
  worktreeNameFromPath,
181
182
  worktreeSlugForTicket,
182
183
  writeThread
183
- } from "./chunk-Y6OHM672.js";
184
+ } from "./chunk-QVLDZWHZ.js";
184
185
  import {
185
186
  askBlockStillWaiting,
186
187
  extractPendingPlanQuestions,
187
188
  isAskUserToolName,
188
189
  parsePlanQuestionsInput,
189
190
  planQuestionsSignature
190
- } from "./chunk-ULWPSBAB.js";
191
+ } from "./chunk-NJV5YEKI.js";
191
192
  import {
192
193
  mcpServerIdForPermission,
193
194
  mcpServerPermissionUpdate
@@ -256,7 +257,7 @@ import {
256
257
  usageOnLimit,
257
258
  withTurnScopedCost,
258
259
  writeViewerContext
259
- } from "./chunk-D446IWPP.js";
260
+ } from "./chunk-EY5BJAPV.js";
260
261
  import {
261
262
  examplePrefixedBranch,
262
263
  sanitizeGitBranchPrefix
@@ -516,9 +517,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
516
517
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
517
518
  );
518
519
  }
519
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-4CTLU2BV.js");
520
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-JKINHUY3.js");
520
521
  if (isGlobalThread2(thread)) {
521
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-3PJLU3UH.js");
522
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-KAZXK5FZ.js");
522
523
  ensureGlobalCoordinatorCwd2(
523
524
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
524
525
  );
@@ -2011,6 +2012,9 @@ function decisionBlockFromParts(parts, planMode, at = (/* @__PURE__ */ new Date(
2011
2012
  at
2012
2013
  );
2013
2014
  }
2015
+ function attentionOutranksAsk(existing) {
2016
+ return existing?.source === "reported" || existing?.source === "permission";
2017
+ }
2014
2018
  function withStampedQuestions(decision, existing) {
2015
2019
  if (decision.source !== "ask_user" || decision.questions?.length) return decision;
2016
2020
  if (existing?.source !== "ask_user" || !existing.questions?.length) return decision;
@@ -2024,12 +2028,37 @@ function agentBlockAfterTurn(input) {
2024
2028
  if (input.failed) return null;
2025
2029
  const decision = decisionBlockFromParts(input.parts, input.planMode);
2026
2030
  if (decision) {
2031
+ if (decision.source === "ask_user" && attentionOutranksAsk(input.existing)) {
2032
+ return input.existing ?? null;
2033
+ }
2027
2034
  const next = withStampedQuestions(decision, input.existing);
2028
2035
  if (isDismissedAskUserBlock(next, input.dismissedQuestionSignature)) {
2029
2036
  return input.existing?.source === "reported" ? input.existing : null;
2030
2037
  }
2031
2038
  return next;
2032
2039
  }
2040
+ const pending = extractPendingPlanQuestions(input.parts);
2041
+ if (pending && attentionOutranksAsk(input.existing)) {
2042
+ return input.existing ?? null;
2043
+ }
2044
+ if (pending) {
2045
+ const kept = withStampedQuestions(
2046
+ {
2047
+ ...makeAgentBlock(
2048
+ "ask_user",
2049
+ formatAskUserNotifyMessage(pending.questions),
2050
+ input.existing?.source === "ask_user" ? input.existing.at : void 0
2051
+ ),
2052
+ onScreen: true,
2053
+ questionSignature: pending.signature,
2054
+ questions: pending.questions
2055
+ },
2056
+ input.existing
2057
+ );
2058
+ if (!isDismissedAskUserBlock(kept, input.dismissedQuestionSignature)) return kept;
2059
+ } else if (input.existing?.source === "ask_user" && input.existing.onScreen && input.existing.questions?.length && !isDismissedAskUserBlock(input.existing, input.dismissedQuestionSignature)) {
2060
+ return input.existing;
2061
+ }
2033
2062
  if (input.existing && input.existing.source !== "reported" && lastTopLevelTool(input.parts)) {
2034
2063
  return null;
2035
2064
  }
@@ -2058,11 +2087,15 @@ function askBlocksEqual(a, b) {
2058
2087
  if (!a || !b) return false;
2059
2088
  return a.source === b.source && a.reason === b.reason && a.at === b.at && a.onScreen === b.onScreen && a.questionSignature === b.questionSignature;
2060
2089
  }
2061
- function askBlockAfterLiveParts(existing, parts) {
2090
+ function askBlockAfterLiveParts(existing, parts, dismissedQuestionSignature) {
2091
+ if (attentionOutranksAsk(existing)) return existing ?? null;
2092
+ if (isDismissedAskUserBlock(existing, dismissedQuestionSignature)) return null;
2093
+ const dismissed = dismissedQuestionSignature?.trim() ?? "";
2094
+ let pending = extractPendingPlanQuestions(parts);
2095
+ if (dismissed && pending?.signature === dismissed) pending = null;
2062
2096
  const last = lastTopLevelTool(parts);
2063
2097
  if (last?.type === "tool" && isAskUserToolName(last.name)) {
2064
2098
  if (existing?.source === "ask_user" && existing.onScreen) return existing;
2065
- const pending = extractPendingPlanQuestions(parts);
2066
2099
  const questions = pending?.questions ?? existing?.questions;
2067
2100
  if (!questions?.length) {
2068
2101
  return existing?.source === "ask_user" ? { ...existing, onScreen: true } : existing ?? null;
@@ -2075,13 +2108,32 @@ function askBlockAfterLiveParts(existing, parts) {
2075
2108
  questions
2076
2109
  };
2077
2110
  }
2111
+ if (pending) {
2112
+ if (existing?.source === "ask_user" && existing.onScreen && existing.questions?.length) {
2113
+ return existing;
2114
+ }
2115
+ const at = existing?.source === "ask_user" ? existing.at : void 0;
2116
+ return {
2117
+ ...makeAgentBlock("ask_user", formatAskUserNotifyMessage(pending.questions), at),
2118
+ onScreen: true,
2119
+ questionSignature: pending.signature,
2120
+ questions: pending.questions
2121
+ };
2122
+ }
2123
+ if (existing?.source === "ask_user" && existing.onScreen && existing.questions?.length) {
2124
+ return existing;
2125
+ }
2078
2126
  if (last && existing?.source === "ask_user") return null;
2079
2127
  return existing ?? null;
2080
2128
  }
2081
2129
  function syncAskUserBlockFromLive(threadId, parts) {
2082
2130
  const thread = readThread(threadId);
2083
2131
  if (!thread || thread.status === "archived") return;
2084
- const next = askBlockAfterLiveParts(thread.agentBlock, parts);
2132
+ const next = askBlockAfterLiveParts(
2133
+ thread.agentBlock,
2134
+ parts,
2135
+ thread.dismissedQuestionSignature
2136
+ );
2085
2137
  if (askBlocksEqual(thread.agentBlock, next)) return;
2086
2138
  updateThread(threadId, { agentBlock: next });
2087
2139
  }
@@ -3161,7 +3213,7 @@ async function createThread(input, _onSetupLine) {
3161
3213
  });
3162
3214
  await requireAgent(resolved.agent);
3163
3215
  if (input.cowboy) {
3164
- const { cowboyModeEnabled } = await import("./app-settings-A5D364JD.js");
3216
+ const { cowboyModeEnabled } = await import("./app-settings-JAEV53LB.js");
3165
3217
  if (!cowboyModeEnabled()) {
3166
3218
  throw new Error(
3167
3219
  "Cowboy mode is off. Enable it in Settings \u2192 Advanced."
@@ -3220,7 +3272,7 @@ async function createThread(input, _onSetupLine) {
3220
3272
  let sourceIsFork = false;
3221
3273
  if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
3222
3274
  if (isAbleTimeConnected() && getIssueSource() === "abletime") {
3223
- const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-OW7LTFQD.js");
3275
+ const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-5FBKBO3R.js");
3224
3276
  const task = await ensureAbleTimeTask({
3225
3277
  title: title?.trim() || "Untitled work",
3226
3278
  description: input.prompt?.trim() || void 0
@@ -3331,7 +3383,7 @@ async function createThread(input, _onSetupLine) {
3331
3383
  return readThread(thread.id) ?? thread;
3332
3384
  }
3333
3385
  async function listLinearIssues(agent, repoPath) {
3334
- const { getAdapter: getAdapter2 } = await import("./agents-IYBY3JT5.js");
3386
+ const { getAdapter: getAdapter2 } = await import("./agents-JXQKHY7Q.js");
3335
3387
  await requireAgent(agent, { requireLinear: true });
3336
3388
  const adapter = getAdapter2(agent);
3337
3389
  if (!adapter.listLinearIssues) {
@@ -4114,7 +4166,7 @@ async function adoptThread(input) {
4114
4166
  messages: input.messages ?? []
4115
4167
  });
4116
4168
  writeThread(thread);
4117
- const { addWorkspace: addWorkspace2 } = await import("./workspaces-WYCVZ6XH.js");
4169
+ const { addWorkspace: addWorkspace2 } = await import("./workspaces-OLONQF2C.js");
4118
4170
  await addWorkspace2(repoPath);
4119
4171
  const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-INRDQFWV.js");
4120
4172
  await ensureWorktreeSideboardIgnored(input.worktreePath);
@@ -7091,7 +7143,7 @@ function formatScheduledPrompt(name, prompt) {
7091
7143
  ${prompt}`;
7092
7144
  }
7093
7145
  async function defaultDeps() {
7094
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-EN3ZKD73.js");
7146
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-LI6EBD2Y.js");
7095
7147
  const orch = getOrchestrator2();
7096
7148
  return {
7097
7149
  findThread: (id) => findThreadByRef(id),
@@ -7446,7 +7498,7 @@ var Orchestrator = class {
7446
7498
  orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
7447
7499
  });
7448
7500
  }
7449
- const { autoCleanupOrphansEnabled } = await import("./app-settings-A5D364JD.js");
7501
+ const { autoCleanupOrphansEnabled } = await import("./app-settings-JAEV53LB.js");
7450
7502
  if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
7451
7503
  await cleanupOrphanWorktrees({ repoPaths });
7452
7504
  }
@@ -7840,7 +7892,7 @@ var Orchestrator = class {
7840
7892
  }
7841
7893
  await setup;
7842
7894
  if (skipSetup) return;
7843
- const { autoRunAfterSetupEnabled } = await import("./app-settings-A5D364JD.js");
7895
+ const { autoRunAfterSetupEnabled } = await import("./app-settings-JAEV53LB.js");
7844
7896
  if (autoRunAfterSetupEnabled()) {
7845
7897
  try {
7846
7898
  await this.startDev(threadId);
@@ -8225,7 +8277,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
8225
8277
  }
8226
8278
  const isBrightsy = fresh.agent === "brightsy";
8227
8279
  const isOrchestration = isOrchestratorThread(fresh);
8228
- const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-A5D364JD.js");
8280
+ const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-JAEV53LB.js");
8229
8281
  const gitAuthMode = getGithubGitAuthMode();
8230
8282
  const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
8231
8283
  githubSlug: turnOrigin?.forge === "github" ? turnOrigin.slug : await withTimeout(resolveGithubRepoSlug(fresh.worktreePath), 8e3, "resolveGithubRepoSlug").catch(() => null),
@@ -9311,7 +9363,9 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
9311
9363
  const taskState = deriveTaskState({
9312
9364
  status: thread.status,
9313
9365
  stillRunning,
9314
- lastAgentParts: lastAgent?.parts
9366
+ lastAgentParts: lastAgent?.parts,
9367
+ dismissedQuestionSignature: thread.dismissedQuestionSignature,
9368
+ userAnswered: userRepliedAfterAgent(thread.messages, lastAgent)
9315
9369
  });
9316
9370
  const block = thread.agentBlock?.reason?.trim() ? thread.agentBlock : null;
9317
9371
  return {
@@ -9565,7 +9619,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
9565
9619
  if (Object.keys(patch).length === 0) continue;
9566
9620
  updateThread(t.id, patch);
9567
9621
  }
9568
- const { autoArchiveOnMergeEnabled } = await import("./app-settings-A5D364JD.js");
9622
+ const { autoArchiveOnMergeEnabled } = await import("./app-settings-JAEV53LB.js");
9569
9623
  const latest = this.requireThread(thread.id);
9570
9624
  if (!shouldAutoArchiveOnPrMerge({
9571
9625
  previousPrState: prevState || null,
@@ -9889,7 +9943,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
9889
9943
  await runArchiveScript(thread.repoPath, thread.worktreePath);
9890
9944
  } catch {
9891
9945
  }
9892
- const { deleteBranchOnPurgeEnabled } = await import("./app-settings-A5D364JD.js");
9946
+ const { deleteBranchOnPurgeEnabled } = await import("./app-settings-JAEV53LB.js");
9893
9947
  const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
9894
9948
  await removeWorktree(thread.repoPath, thread.worktreePath, {
9895
9949
  deleteBranch: deleteBranch ? thread.branchName : void 0
@@ -10027,7 +10081,7 @@ async function startOrchestration(opts) {
10027
10081
  sourceRef: "default",
10028
10082
  ...createOpts
10029
10083
  }).catch(async () => {
10030
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-NNVRGPP4.js");
10084
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-TX4WXQZV.js");
10031
10085
  const repo = await resolveRepoRoot2(repoPath);
10032
10086
  const def = await resolveDefaultBranch2(repo);
10033
10087
  return orch.createThread({
@@ -10037,7 +10091,7 @@ async function startOrchestration(opts) {
10037
10091
  repoPath: repo
10038
10092
  });
10039
10093
  });
10040
- const { updateThread: upd } = await import("./thread-store-K2ZNGUSM.js");
10094
+ const { updateThread: upd } = await import("./thread-store-NVFWKJFH.js");
10041
10095
  const updated = upd(thread.id, {
10042
10096
  sourceType: "orchestration",
10043
10097
  sourceRef: goal
@@ -4,14 +4,14 @@ import {
4
4
  normalizeAbleTimeCredential,
5
5
  normalizeAbleTimeHost,
6
6
  rewriteAbleTimeError
7
- } from "./chunk-DACWFN4O.js";
7
+ } from "./chunk-SKPX66MO.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-D446IWPP.js";
14
+ } from "./chunk-EY5BJAPV.js";
15
15
 
16
16
  // src/integrations/abletime-rest.ts
17
17
  var ABLETIME_REST_PREFIX = "/api/public/v2";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-YBTSZ2SW.js";
10
10
  import {
11
11
  resolveAgentExecutable
12
- } from "./chunk-EJRCHCXM.js";
12
+ } from "./chunk-7BAS6DF7.js";
13
13
 
14
14
  // src/agents/install.ts
15
15
  import { existsSync } from "fs";
@@ -267,7 +267,7 @@ async function loginAgent(agent) {
267
267
  };
268
268
  }
269
269
  async function loginManagedAccount(accountId) {
270
- const { loadAppSettings } = await import("./app-settings-SA4HX3ZQ.js");
270
+ const { loadAppSettings } = await import("./app-settings-SHZWNJBV.js");
271
271
  const { loginEnvPrefix } = await import("./managed-accounts-PITLFLKU.js");
272
272
  const account = loadAppSettings().accounts.accounts.find((a) => a.id === accountId);
273
273
  if (!account) {
@@ -8,11 +8,11 @@ import {
8
8
  isGlobalThread,
9
9
  isOrchestratorThread,
10
10
  isSlackCoordinatorThread
11
- } from "./chunk-RDXODLEN.js";
11
+ } from "./chunk-O7JSWISN.js";
12
12
  import {
13
13
  mergeAgentGitAuthEnv,
14
14
  resolveAgentGitAuthEnv
15
- } from "./chunk-R2C45NHT.js";
15
+ } from "./chunk-P4QRDXRY.js";
16
16
  import {
17
17
  REVIEW_TAB_TITLE,
18
18
  allocateTeamName,
@@ -24,13 +24,15 @@ import {
24
24
  updateThread,
25
25
  worktreeNameFromPath,
26
26
  writeThread
27
- } from "./chunk-Y6OHM672.js";
27
+ } from "./chunk-QVLDZWHZ.js";
28
28
  import {
29
29
  ensureWorktreeSideboardIgnored
30
30
  } from "./chunk-QKHEVSB5.js";
31
31
  import {
32
+ extractPendingPlanQuestions,
33
+ isAskUserToolName,
32
34
  lastTopLevelToolIsAskUser
33
- } from "./chunk-ULWPSBAB.js";
35
+ } from "./chunk-NJV5YEKI.js";
34
36
  import {
35
37
  clipToolResultForStore
36
38
  } from "./chunk-OPXEJJBM.js";
@@ -47,7 +49,7 @@ import {
47
49
  import {
48
50
  assertOrchestratorCapableAgent,
49
51
  contextTokens
50
- } from "./chunk-D446IWPP.js";
52
+ } from "./chunk-EY5BJAPV.js";
51
53
  import {
52
54
  stripNestedElectronEnv
53
55
  } from "./chunk-4TR3HZFT.js";
@@ -1228,6 +1230,33 @@ function needsCoordinatorAction(state) {
1228
1230
  function endedOnAskUser(parts) {
1229
1231
  return lastTopLevelToolIsAskUser(parts);
1230
1232
  }
1233
+ function turnWaitingOnAskUser(parts, dismissedQuestionSignature) {
1234
+ if (!parts?.length) return false;
1235
+ let ask = null;
1236
+ for (let i = parts.length - 1; i >= 0; i--) {
1237
+ const part = parts[i];
1238
+ if (part.type === "tool" && !part.parentId && isAskUserToolName(part.name)) {
1239
+ ask = part;
1240
+ break;
1241
+ }
1242
+ }
1243
+ if (!ask) return false;
1244
+ const dismissed = dismissedQuestionSignature?.trim();
1245
+ if (!dismissed) return true;
1246
+ const pending = extractPendingPlanQuestions([ask]);
1247
+ if (!pending?.signature) return false;
1248
+ return pending.signature !== dismissed;
1249
+ }
1250
+ function userRepliedAfterAgent(messages, lastAgent) {
1251
+ if (!messages || !lastAgent) return false;
1252
+ const index = messages.lastIndexOf(lastAgent);
1253
+ if (index < 0) return false;
1254
+ for (let i = index + 1; i < messages.length; i++) {
1255
+ const message = messages[i];
1256
+ if (message.role === "user" && message.origin !== "continue") return true;
1257
+ }
1258
+ return false;
1259
+ }
1231
1260
  function deriveTaskState(input) {
1232
1261
  if (input.stillRunning) {
1233
1262
  return input.status === "queued" ? "submitted" : "working";
@@ -1239,7 +1268,7 @@ function deriveTaskState(input) {
1239
1268
  case "stopped":
1240
1269
  return "canceled";
1241
1270
  default:
1242
- return endedOnAskUser(input.lastAgentParts) ? "input-required" : "completed";
1271
+ return !input.userAnswered && turnWaitingOnAskUser(input.lastAgentParts, input.dismissedQuestionSignature) ? "input-required" : "completed";
1243
1272
  }
1244
1273
  }
1245
1274
 
@@ -1635,7 +1664,7 @@ var PORT_RANGE_SIZE = 10;
1635
1664
  var RECLAIM_RETRY_DELAY_MS = 40;
1636
1665
  var RECLAIM_TRIES = 8;
1637
1666
  async function killReclaimable(ports, worktreePath, signal) {
1638
- const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-CP7TW6TN.js");
1667
+ const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-FA27ZGCV.js");
1639
1668
  if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
1640
1669
  else killListenersOnPorts2(ports);
1641
1670
  }
@@ -2320,6 +2349,7 @@ export {
2320
2349
  isIncompleteTaskState,
2321
2350
  needsCoordinatorAction,
2322
2351
  endedOnAskUser,
2352
+ userRepliedAfterAgent,
2323
2353
  deriveTaskState,
2324
2354
  mcpWaitForTurnTimeoutMs,
2325
2355
  mcpWaitTaskHint,
@@ -3,13 +3,13 @@
3
3
  import {
4
4
  abletimeRestUrl,
5
5
  textFromAbleTimeDoc
6
- } from "./chunk-ZPBOWO64.js";
6
+ } from "./chunk-BAIPCN34.js";
7
7
  import {
8
8
  assertAbleTimeCredential,
9
9
  callAbleTimeTool,
10
10
  normalizeAbleTimeHost,
11
11
  rewriteAbleTimeError
12
- } from "./chunk-SB5ADEZZ.js";
12
+ } from "./chunk-D6V6F74A.js";
13
13
  import {
14
14
  downloadAuthenticatedFile,
15
15
  extractHttpUrls,
@@ -27,7 +27,7 @@ import {
27
27
  getAbleTimeHost,
28
28
  isAbleTimeConnected,
29
29
  saveAbleTimeConnection
30
- } from "./chunk-EJRCHCXM.js";
30
+ } from "./chunk-7BAS6DF7.js";
31
31
 
32
32
  // src/integrations/abletime-attachments.ts
33
33
  function asRecord(value) {
@@ -5,7 +5,7 @@
5
5
  var LIST_TIMEOUT_MS = 15e3;
6
6
  async function listAssignedLinearIssues(opts) {
7
7
  try {
8
- const { listLinearIssuesDirect } = await import("./linear-CXWGH2TW.js");
8
+ const { listLinearIssuesDirect } = await import("./linear-7HSIGV5S.js");
9
9
  const listed = listLinearIssuesDirect({ limit: 50 }).catch(() => []);
10
10
  let timer;
11
11
  try {
@@ -63,9 +63,6 @@ function lastTopLevelToolIsAskUser(parts) {
63
63
  }
64
64
  return false;
65
65
  }
66
- function hasTopLevelTool(parts) {
67
- return Boolean(parts?.some((part) => part.type === "tool" && !part.parentId));
68
- }
69
66
  function questionsFromToolPart(part) {
70
67
  const fromInput = parsePlanQuestionsInput(part.input);
71
68
  if (fromInput.length) return fromInput;
@@ -81,7 +78,7 @@ function extractPendingPlanQuestions(parts) {
81
78
  if (!parts?.length) return null;
82
79
  for (let i = parts.length - 1; i >= 0; i--) {
83
80
  const p = parts[i];
84
- if (p.type !== "tool" || !isAskUserToolName(p.name)) continue;
81
+ if (p.type !== "tool" || p.parentId || !isAskUserToolName(p.name)) continue;
85
82
  const questions = questionsFromToolPart(p);
86
83
  if (!questions.length) continue;
87
84
  return {
@@ -121,18 +118,23 @@ function askBlockStillWaiting(block, messages) {
121
118
  }
122
119
  function latestPendingPlanQuestions(input) {
123
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
+ };
124
127
  const fromBlock = () => pendingFromAskBlock(input.agentBlock, input.dismissedQuestionSignature);
125
- if (lastTopLevelToolIsAskUser(input.liveParts)) {
126
- return extractPendingPlanQuestions(input.liveParts) ?? fromBlock();
127
- }
128
+ const liveAsk = accept(extractPendingPlanQuestions(input.liveParts));
129
+ if (liveAsk) return liveAsk;
128
130
  const last = input.messages[input.messages.length - 1];
129
- if (last?.role === "agent" && lastTopLevelToolIsAskUser(last.parts)) {
130
- return extractPendingPlanQuestions(last.parts) ?? fromBlock();
131
+ if (last?.role === "agent") {
132
+ const fromTranscript = accept(extractPendingPlanQuestions(last.parts));
133
+ if (fromTranscript) return fromTranscript;
131
134
  }
132
- if (hasTopLevelTool(input.liveParts) || last?.role === "agent" && hasTopLevelTool(last.parts)) {
135
+ if ((input.status === "running" || input.status === "queued") && !input.agentBlock?.onScreen) {
133
136
  return null;
134
137
  }
135
- if (input.status === "running" || input.status === "queued") return null;
136
138
  const stamped = fromBlock();
137
139
  if (stamped && askBlockStillWaiting(input.agentBlock, input.messages)) {
138
140
  return stamped;
@@ -125,7 +125,7 @@ async function connectedCliPresence(integrations) {
125
125
  const ids = connectedOptionalServices(integrations).filter((spec) => spec.cli).map((spec) => spec.id);
126
126
  if (ids.length === 0) return void 0;
127
127
  try {
128
- const { optionalCliPresence } = await import("./optional-cli-INRVBBBG.js");
128
+ const { optionalCliPresence } = await import("./optional-cli-FOSC4NVE.js");
129
129
  return await optionalCliPresence(ids);
130
130
  } catch {
131
131
  return void 0;
@@ -5,7 +5,7 @@ import {
5
5
  resolveGithubRepoSlug,
6
6
  resolveOriginRemote,
7
7
  resolveRepoRoot
8
- } from "./chunk-R2C45NHT.js";
8
+ } from "./chunk-P4QRDXRY.js";
9
9
  import {
10
10
  allocateTeamName,
11
11
  createEmptyThread,
@@ -14,7 +14,7 @@ import {
14
14
  teamSlugFromName,
15
15
  updateThread,
16
16
  writeThread
17
- } from "./chunk-Y6OHM672.js";
17
+ } from "./chunk-QVLDZWHZ.js";
18
18
  import {
19
19
  ATTACHMENTS_DIR,
20
20
  attachmentsGitignoreBody
@@ -31,7 +31,7 @@ import {
31
31
  resolveThreadDefaults,
32
32
  resolveViewerProfile,
33
33
  resolveViewerProfileForRepo
34
- } from "./chunk-D446IWPP.js";
34
+ } from "./chunk-EY5BJAPV.js";
35
35
  import {
36
36
  appDataDir,
37
37
  globalAgentCwd,
@@ -4,7 +4,7 @@ import {
4
4
  normalizeTakenSlug,
5
5
  normalizeWorktreePath,
6
6
  takenSlugsFromThread
7
- } from "./chunk-Y6OHM672.js";
7
+ } from "./chunk-QVLDZWHZ.js";
8
8
  import {
9
9
  ensureWorktreeSideboardIgnored
10
10
  } from "./chunk-QKHEVSB5.js";
@@ -25,7 +25,7 @@ import {
25
25
  import {
26
26
  getGithubGitAuthMode,
27
27
  getGithubPat
28
- } from "./chunk-D446IWPP.js";
28
+ } from "./chunk-EY5BJAPV.js";
29
29
  import {
30
30
  worktreesRoot
31
31
  } from "./chunk-H4UEFJRI.js";