@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
@@ -11,11 +11,11 @@ import {
11
11
  isGlobalThread,
12
12
  isOrchestratorThread,
13
13
  isSlackCoordinatorThread
14
- } from "./chunk-Q4UPRQOS.js";
14
+ } from "./chunk-G45SGI57.js";
15
15
  import {
16
16
  mergeAgentGitAuthEnv,
17
17
  resolveAgentGitAuthEnv
18
- } from "./chunk-JKHCADKB.js";
18
+ } from "./chunk-U7EANR52.js";
19
19
  import {
20
20
  ATTACHMENTS_DIR,
21
21
  DETACHED_JOBS_DIR,
@@ -40,11 +40,11 @@ import {
40
40
  updateThread,
41
41
  worktreeNameFromPath,
42
42
  writeThread
43
- } from "./chunk-5Y2C7Q55.js";
43
+ } from "./chunk-EW5D53VB.js";
44
44
  import {
45
45
  assertOrchestratorCapableAgent,
46
46
  contextTokens
47
- } from "./chunk-EJRCHCXM.js";
47
+ } from "./chunk-7BAS6DF7.js";
48
48
  import {
49
49
  stripNestedElectronEnv
50
50
  } from "./chunk-WWUABK6B.js";
@@ -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-D62Q2XJC.js");
1699
+ const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-6DIR7A4N.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,
@@ -10,7 +10,7 @@ import {
10
10
  isOrchestratorCapableAgent,
11
11
  normalizeThinkingEffort,
12
12
  updateAdvancedSettings
13
- } from "./chunk-D446IWPP.js";
13
+ } from "./chunk-EY5BJAPV.js";
14
14
  import {
15
15
  writePrivateFile
16
16
  } from "./chunk-JT7R45JB.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  getAbleTimeHost,
6
6
  isAbleTimeConnected
7
- } from "./chunk-D446IWPP.js";
7
+ } from "./chunk-EY5BJAPV.js";
8
8
 
9
9
  // src/integrations/abletime-mcp.ts
10
10
  var DEFAULT_ABLETIME_HOST = "https://track.abletime.com";
@@ -153,7 +153,7 @@ function textsFromUnknown(value) {
153
153
  return "";
154
154
  }
155
155
  async function abletimeMcpRequest(method, params, opts) {
156
- const rawToken = opts?.token ?? await import("./abletime-oauth-KWQQRHOQ.js").then((m) => m.ensureAbleTimeAccessToken());
156
+ const rawToken = opts?.token ?? await import("./abletime-oauth-I34WZZZL.js").then((m) => m.ensureAbleTimeAccessToken());
157
157
  if (!rawToken?.trim()) {
158
158
  throw new Error("AbleTime is not connected \u2014 paste a personal access token in Account settings");
159
159
  }
@@ -224,9 +224,9 @@ async function callAbleTimeTool(name, args = {}, opts) {
224
224
  if (!opts?.token && !isAbleTimeConnected()) {
225
225
  throw new Error("AbleTime is not connected \u2014 paste a personal access token in Account settings");
226
226
  }
227
- const rawToken = opts?.token ?? await import("./abletime-oauth-KWQQRHOQ.js").then((m) => m.ensureAbleTimeAccessToken());
227
+ const rawToken = opts?.token ?? await import("./abletime-oauth-I34WZZZL.js").then((m) => m.ensureAbleTimeAccessToken());
228
228
  if (rawToken && ableTimeUsesRest(rawToken)) {
229
- const { callAbleTimeRestTool } = await import("./abletime-rest-UJ6SXDBN.js");
229
+ const { callAbleTimeRestTool } = await import("./abletime-rest-HEQXSZAQ.js");
230
230
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
231
231
  }
232
232
  const requestOpts = { ...opts, pm: opts?.pm ?? abletimeToolUsesPm(name) };
@@ -242,7 +242,7 @@ async function callAbleTimeTool(name, args = {}, opts) {
242
242
  return await call();
243
243
  }
244
244
  if (rawToken && ableTimeUsesRest(rawToken) && isAbleTimeRejectedCredential(message)) {
245
- const { callAbleTimeRestTool } = await import("./abletime-rest-UJ6SXDBN.js");
245
+ const { callAbleTimeRestTool } = await import("./abletime-rest-HEQXSZAQ.js");
246
246
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
247
247
  }
248
248
  throw err instanceof Error ? new Error(rewriteAbleTimeError(err.message)) : err;
@@ -23,11 +23,11 @@ import {
23
23
  normalizeTakenSlug,
24
24
  normalizeWorktreePath,
25
25
  takenSlugsFromThread
26
- } from "./chunk-5Y2C7Q55.js";
26
+ } from "./chunk-EW5D53VB.js";
27
27
  import {
28
28
  getGithubGitAuthMode,
29
29
  getGithubPat
30
- } from "./chunk-EJRCHCXM.js";
30
+ } from "./chunk-7BAS6DF7.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-D446IWPP.js";
10
+ } from "./chunk-EY5BJAPV.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-A5D364JD.js");
268
+ const { loadAppSettings } = await import("./app-settings-JAEV53LB.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) {
@@ -10,13 +10,13 @@ import {
10
10
  import {
11
11
  abletimeRestUrl,
12
12
  textFromAbleTimeDoc
13
- } from "./chunk-EUIVQAPK.js";
13
+ } from "./chunk-HJIA4X3L.js";
14
14
  import {
15
15
  assertAbleTimeCredential,
16
16
  callAbleTimeTool,
17
17
  normalizeAbleTimeHost,
18
18
  rewriteAbleTimeError
19
- } from "./chunk-DACWFN4O.js";
19
+ } from "./chunk-SKPX66MO.js";
20
20
  import {
21
21
  httpFetch
22
22
  } from "./chunk-JAT3JFOS.js";
@@ -25,7 +25,7 @@ import {
25
25
  getAbleTimeHost,
26
26
  isAbleTimeConnected,
27
27
  saveAbleTimeConnection
28
- } from "./chunk-D446IWPP.js";
28
+ } from "./chunk-EY5BJAPV.js";
29
29
 
30
30
  // src/integrations/abletime-attachments.ts
31
31
  function asRecord(value) {
@@ -2,7 +2,7 @@
2
2
  var LIST_TIMEOUT_MS = 15e3;
3
3
  async function listAssignedLinearIssues(opts) {
4
4
  try {
5
- const { listLinearIssuesDirect } = await import("./linear-WLDCJ3AF.js");
5
+ const { listLinearIssuesDirect } = await import("./linear-FRJRK6KI.js");
6
6
  const listed = listLinearIssuesDirect({ limit: 50 }).catch(() => []);
7
7
  let timer;
8
8
  try {
@@ -34,16 +34,16 @@ import {
34
34
  tryReservePort,
35
35
  tryReservePorts,
36
36
  worktreeRunPortsPath
37
- } from "./chunk-RZJ3QJZT.js";
37
+ } from "./chunk-PZ5MVD27.js";
38
38
  import "./chunk-5MXLDDYF.js";
39
- import "./chunk-Q4UPRQOS.js";
40
- import "./chunk-JKHCADKB.js";
39
+ import "./chunk-G45SGI57.js";
40
+ import "./chunk-U7EANR52.js";
41
41
  import "./chunk-N2WW62LF.js";
42
42
  import "./chunk-4YXZOXMT.js";
43
43
  import "./chunk-YBTSZ2SW.js";
44
- import "./chunk-5Y2C7Q55.js";
44
+ import "./chunk-EW5D53VB.js";
45
45
  import "./chunk-WMZIANPV.js";
46
- import "./chunk-EJRCHCXM.js";
46
+ import "./chunk-7BAS6DF7.js";
47
47
  import "./chunk-NSTQ6QKD.js";
48
48
  import {
49
49
  stripNestedElectronEnv
@@ -32,19 +32,19 @@ import {
32
32
  tryReservePort,
33
33
  tryReservePorts,
34
34
  worktreeRunPortsPath
35
- } from "./chunk-IXWPCOLQ.js";
35
+ } from "./chunk-KUD24QYI.js";
36
36
  import "./chunk-OOXRMTU6.js";
37
- import "./chunk-RDXODLEN.js";
38
- import "./chunk-R2C45NHT.js";
39
- import "./chunk-Y6OHM672.js";
37
+ import "./chunk-O7JSWISN.js";
38
+ import "./chunk-P4QRDXRY.js";
39
+ import "./chunk-QVLDZWHZ.js";
40
40
  import "./chunk-QKHEVSB5.js";
41
- import "./chunk-ULWPSBAB.js";
41
+ import "./chunk-NJV5YEKI.js";
42
42
  import "./chunk-N6ZF3XRP.js";
43
43
  import "./chunk-OPXEJJBM.js";
44
44
  import "./chunk-6K64FJDD.js";
45
45
  import "./chunk-LG6RJBIY.js";
46
46
  import "./chunk-2TUE6JKQ.js";
47
- import "./chunk-D446IWPP.js";
47
+ import "./chunk-EY5BJAPV.js";
48
48
  import {
49
49
  stripNestedElectronEnv
50
50
  } from "./chunk-4TR3HZFT.js";
@@ -9,14 +9,14 @@ import {
9
9
  enrichWorkspacesWithGithub,
10
10
  ensureGlobalCoordinatorCwd,
11
11
  formatWorkspaceInventory
12
- } from "./chunk-Q4UPRQOS.js";
13
- import "./chunk-JKHCADKB.js";
12
+ } from "./chunk-G45SGI57.js";
13
+ import "./chunk-U7EANR52.js";
14
14
  import "./chunk-N2WW62LF.js";
15
15
  import "./chunk-4YXZOXMT.js";
16
16
  import "./chunk-YBTSZ2SW.js";
17
- import "./chunk-5Y2C7Q55.js";
17
+ import "./chunk-EW5D53VB.js";
18
18
  import "./chunk-WMZIANPV.js";
19
- import "./chunk-EJRCHCXM.js";
19
+ import "./chunk-7BAS6DF7.js";
20
20
  import "./chunk-NSTQ6QKD.js";
21
21
  import "./chunk-WWUABK6B.js";
22
22
  import "./chunk-FJZWM2ON.js";
@@ -7,15 +7,15 @@ import {
7
7
  enrichWorkspacesWithGithub,
8
8
  ensureGlobalCoordinatorCwd,
9
9
  formatWorkspaceInventory
10
- } from "./chunk-RDXODLEN.js";
11
- import "./chunk-R2C45NHT.js";
12
- import "./chunk-Y6OHM672.js";
10
+ } from "./chunk-O7JSWISN.js";
11
+ import "./chunk-P4QRDXRY.js";
12
+ import "./chunk-QVLDZWHZ.js";
13
13
  import "./chunk-QKHEVSB5.js";
14
14
  import "./chunk-N6ZF3XRP.js";
15
15
  import "./chunk-6K64FJDD.js";
16
16
  import "./chunk-LG6RJBIY.js";
17
17
  import "./chunk-2TUE6JKQ.js";
18
- import "./chunk-D446IWPP.js";
18
+ import "./chunk-EY5BJAPV.js";
19
19
  import "./chunk-4TR3HZFT.js";
20
20
  import "./chunk-WDRMZKVB.js";
21
21
  import "./chunk-KI45T4DI.js";
@@ -20,14 +20,14 @@ import {
20
20
  remoteCoordinatorSourceRef,
21
21
  slackCoordinatorSourceRef,
22
22
  takenTeamSlugsForOrchestration
23
- } from "./chunk-Q4UPRQOS.js";
24
- import "./chunk-JKHCADKB.js";
23
+ } from "./chunk-G45SGI57.js";
24
+ import "./chunk-U7EANR52.js";
25
25
  import "./chunk-N2WW62LF.js";
26
26
  import "./chunk-4YXZOXMT.js";
27
27
  import "./chunk-YBTSZ2SW.js";
28
- import "./chunk-5Y2C7Q55.js";
28
+ import "./chunk-EW5D53VB.js";
29
29
  import "./chunk-WMZIANPV.js";
30
- import "./chunk-EJRCHCXM.js";
30
+ import "./chunk-7BAS6DF7.js";
31
31
  import "./chunk-NSTQ6QKD.js";
32
32
  import "./chunk-WWUABK6B.js";
33
33
  import "./chunk-FJZWM2ON.js";
@@ -18,15 +18,15 @@ import {
18
18
  remoteCoordinatorSourceRef,
19
19
  slackCoordinatorSourceRef,
20
20
  takenTeamSlugsForOrchestration
21
- } from "./chunk-RDXODLEN.js";
22
- import "./chunk-R2C45NHT.js";
23
- import "./chunk-Y6OHM672.js";
21
+ } from "./chunk-O7JSWISN.js";
22
+ import "./chunk-P4QRDXRY.js";
23
+ import "./chunk-QVLDZWHZ.js";
24
24
  import "./chunk-QKHEVSB5.js";
25
25
  import "./chunk-N6ZF3XRP.js";
26
26
  import "./chunk-6K64FJDD.js";
27
27
  import "./chunk-LG6RJBIY.js";
28
28
  import "./chunk-2TUE6JKQ.js";
29
- import "./chunk-D446IWPP.js";
29
+ import "./chunk-EY5BJAPV.js";
30
30
  import "./chunk-4TR3HZFT.js";
31
31
  import "./chunk-WDRMZKVB.js";
32
32
  import "./chunk-KI45T4DI.js";
package/dist/index.cjs CHANGED
@@ -1232,6 +1232,7 @@ function normalizeRemoteRelayUrl(raw) {
1232
1232
  url.pathname = REMOTE_RELAY_PATH;
1233
1233
  url.search = "";
1234
1234
  url.hash = "";
1235
+ if (url.hostname === "relay.sideboard.cloud") url.hostname = "relay.sideboard.build";
1235
1236
  return url.toString();
1236
1237
  }
1237
1238
  function remoteRelayUrl(configured) {
@@ -1435,7 +1436,7 @@ var init_protocol = __esm({
1435
1436
  REMOTE_RELAY_PATH = "/remote";
1436
1437
  REMOTE_PING_INTERVAL_MS = 2e4;
1437
1438
  REMOTE_PONG_TIMEOUT_MS = 15e3;
1438
- BAKED_REMOTE_RELAY_URL = `wss://relay.sideboard.cloud${REMOTE_RELAY_PATH}`;
1439
+ BAKED_REMOTE_RELAY_URL = `wss://relay.sideboard.build${REMOTE_RELAY_PATH}`;
1439
1440
  }
1440
1441
  });
1441
1442
 
@@ -7383,9 +7384,6 @@ function lastTopLevelToolIsAskUser(parts) {
7383
7384
  }
7384
7385
  return false;
7385
7386
  }
7386
- function hasTopLevelTool(parts) {
7387
- return Boolean(parts?.some((part) => part.type === "tool" && !part.parentId));
7388
- }
7389
7387
  function questionsFromToolPart(part) {
7390
7388
  const fromInput = parsePlanQuestionsInput(part.input);
7391
7389
  if (fromInput.length) return fromInput;
@@ -7401,7 +7399,7 @@ function extractPendingPlanQuestions(parts) {
7401
7399
  if (!parts?.length) return null;
7402
7400
  for (let i = parts.length - 1; i >= 0; i--) {
7403
7401
  const p = parts[i];
7404
- if (p.type !== "tool" || !isAskUserToolName(p.name)) continue;
7402
+ if (p.type !== "tool" || p.parentId || !isAskUserToolName(p.name)) continue;
7405
7403
  const questions2 = questionsFromToolPart(p);
7406
7404
  if (!questions2.length) continue;
7407
7405
  return {
@@ -7441,18 +7439,23 @@ function askBlockStillWaiting(block, messages) {
7441
7439
  }
7442
7440
  function latestPendingPlanQuestions(input) {
7443
7441
  if (input.userReplied) return null;
7442
+ const dismissed = input.dismissedQuestionSignature?.trim();
7443
+ const accept = (pending) => {
7444
+ if (!pending) return null;
7445
+ if (dismissed && pending.signature === dismissed) return null;
7446
+ return pending;
7447
+ };
7444
7448
  const fromBlock = () => pendingFromAskBlock(input.agentBlock, input.dismissedQuestionSignature);
7445
- if (lastTopLevelToolIsAskUser(input.liveParts)) {
7446
- return extractPendingPlanQuestions(input.liveParts) ?? fromBlock();
7447
- }
7449
+ const liveAsk = accept(extractPendingPlanQuestions(input.liveParts));
7450
+ if (liveAsk) return liveAsk;
7448
7451
  const last = input.messages[input.messages.length - 1];
7449
- if (last?.role === "agent" && lastTopLevelToolIsAskUser(last.parts)) {
7450
- return extractPendingPlanQuestions(last.parts) ?? fromBlock();
7452
+ if (last?.role === "agent") {
7453
+ const fromTranscript = accept(extractPendingPlanQuestions(last.parts));
7454
+ if (fromTranscript) return fromTranscript;
7451
7455
  }
7452
- if (hasTopLevelTool(input.liveParts) || last?.role === "agent" && hasTopLevelTool(last.parts)) {
7456
+ if ((input.status === "running" || input.status === "queued") && !input.agentBlock?.onScreen) {
7453
7457
  return null;
7454
7458
  }
7455
- if (input.status === "running" || input.status === "queued") return null;
7456
7459
  const stamped = fromBlock();
7457
7460
  if (stamped && askBlockStillWaiting(input.agentBlock, input.messages)) {
7458
7461
  return stamped;
@@ -9174,6 +9177,33 @@ function needsCoordinatorAction(state) {
9174
9177
  function endedOnAskUser(parts) {
9175
9178
  return lastTopLevelToolIsAskUser(parts);
9176
9179
  }
9180
+ function turnWaitingOnAskUser(parts, dismissedQuestionSignature) {
9181
+ if (!parts?.length) return false;
9182
+ let ask = null;
9183
+ for (let i = parts.length - 1; i >= 0; i--) {
9184
+ const part = parts[i];
9185
+ if (part.type === "tool" && !part.parentId && isAskUserToolName(part.name)) {
9186
+ ask = part;
9187
+ break;
9188
+ }
9189
+ }
9190
+ if (!ask) return false;
9191
+ const dismissed = dismissedQuestionSignature?.trim();
9192
+ if (!dismissed) return true;
9193
+ const pending = extractPendingPlanQuestions([ask]);
9194
+ if (!pending?.signature) return false;
9195
+ return pending.signature !== dismissed;
9196
+ }
9197
+ function userRepliedAfterAgent(messages, lastAgent) {
9198
+ if (!messages || !lastAgent) return false;
9199
+ const index = messages.lastIndexOf(lastAgent);
9200
+ if (index < 0) return false;
9201
+ for (let i = index + 1; i < messages.length; i++) {
9202
+ const message = messages[i];
9203
+ if (message.role === "user" && message.origin !== "continue") return true;
9204
+ }
9205
+ return false;
9206
+ }
9177
9207
  function deriveTaskState(input) {
9178
9208
  if (input.stillRunning) {
9179
9209
  return input.status === "queued" ? "submitted" : "working";
@@ -9185,7 +9215,7 @@ function deriveTaskState(input) {
9185
9215
  case "stopped":
9186
9216
  return "canceled";
9187
9217
  default:
9188
- return endedOnAskUser(input.lastAgentParts) ? "input-required" : "completed";
9218
+ return !input.userAnswered && turnWaitingOnAskUser(input.lastAgentParts, input.dismissedQuestionSignature) ? "input-required" : "completed";
9189
9219
  }
9190
9220
  }
9191
9221
  var init_task_state = __esm({
@@ -25625,6 +25655,9 @@ function decisionBlockFromParts(parts, planMode, at = (/* @__PURE__ */ new Date(
25625
25655
  at
25626
25656
  );
25627
25657
  }
25658
+ function attentionOutranksAsk(existing) {
25659
+ return existing?.source === "reported" || existing?.source === "permission";
25660
+ }
25628
25661
  function withStampedQuestions(decision, existing) {
25629
25662
  if (decision.source !== "ask_user" || decision.questions?.length) return decision;
25630
25663
  if (existing?.source !== "ask_user" || !existing.questions?.length) return decision;
@@ -25638,12 +25671,37 @@ function agentBlockAfterTurn(input) {
25638
25671
  if (input.failed) return null;
25639
25672
  const decision = decisionBlockFromParts(input.parts, input.planMode);
25640
25673
  if (decision) {
25674
+ if (decision.source === "ask_user" && attentionOutranksAsk(input.existing)) {
25675
+ return input.existing ?? null;
25676
+ }
25641
25677
  const next = withStampedQuestions(decision, input.existing);
25642
25678
  if (isDismissedAskUserBlock(next, input.dismissedQuestionSignature)) {
25643
25679
  return input.existing?.source === "reported" ? input.existing : null;
25644
25680
  }
25645
25681
  return next;
25646
25682
  }
25683
+ const pending = extractPendingPlanQuestions(input.parts);
25684
+ if (pending && attentionOutranksAsk(input.existing)) {
25685
+ return input.existing ?? null;
25686
+ }
25687
+ if (pending) {
25688
+ const kept = withStampedQuestions(
25689
+ {
25690
+ ...makeAgentBlock(
25691
+ "ask_user",
25692
+ formatAskUserNotifyMessage(pending.questions),
25693
+ input.existing?.source === "ask_user" ? input.existing.at : void 0
25694
+ ),
25695
+ onScreen: true,
25696
+ questionSignature: pending.signature,
25697
+ questions: pending.questions
25698
+ },
25699
+ input.existing
25700
+ );
25701
+ if (!isDismissedAskUserBlock(kept, input.dismissedQuestionSignature)) return kept;
25702
+ } else if (input.existing?.source === "ask_user" && input.existing.onScreen && input.existing.questions?.length && !isDismissedAskUserBlock(input.existing, input.dismissedQuestionSignature)) {
25703
+ return input.existing;
25704
+ }
25647
25705
  if (input.existing && input.existing.source !== "reported" && lastTopLevelTool(input.parts)) {
25648
25706
  return null;
25649
25707
  }
@@ -25672,11 +25730,15 @@ function askBlocksEqual(a, b) {
25672
25730
  if (!a || !b) return false;
25673
25731
  return a.source === b.source && a.reason === b.reason && a.at === b.at && a.onScreen === b.onScreen && a.questionSignature === b.questionSignature;
25674
25732
  }
25675
- function askBlockAfterLiveParts(existing, parts) {
25733
+ function askBlockAfterLiveParts(existing, parts, dismissedQuestionSignature) {
25734
+ if (attentionOutranksAsk(existing)) return existing ?? null;
25735
+ if (isDismissedAskUserBlock(existing, dismissedQuestionSignature)) return null;
25736
+ const dismissed = dismissedQuestionSignature?.trim() ?? "";
25737
+ let pending = extractPendingPlanQuestions(parts);
25738
+ if (dismissed && pending?.signature === dismissed) pending = null;
25676
25739
  const last = lastTopLevelTool(parts);
25677
25740
  if (last?.type === "tool" && isAskUserToolName(last.name)) {
25678
25741
  if (existing?.source === "ask_user" && existing.onScreen) return existing;
25679
- const pending = extractPendingPlanQuestions(parts);
25680
25742
  const questions2 = pending?.questions ?? existing?.questions;
25681
25743
  if (!questions2?.length) {
25682
25744
  return existing?.source === "ask_user" ? { ...existing, onScreen: true } : existing ?? null;
@@ -25689,13 +25751,32 @@ function askBlockAfterLiveParts(existing, parts) {
25689
25751
  questions: questions2
25690
25752
  };
25691
25753
  }
25754
+ if (pending) {
25755
+ if (existing?.source === "ask_user" && existing.onScreen && existing.questions?.length) {
25756
+ return existing;
25757
+ }
25758
+ const at = existing?.source === "ask_user" ? existing.at : void 0;
25759
+ return {
25760
+ ...makeAgentBlock("ask_user", formatAskUserNotifyMessage(pending.questions), at),
25761
+ onScreen: true,
25762
+ questionSignature: pending.signature,
25763
+ questions: pending.questions
25764
+ };
25765
+ }
25766
+ if (existing?.source === "ask_user" && existing.onScreen && existing.questions?.length) {
25767
+ return existing;
25768
+ }
25692
25769
  if (last && existing?.source === "ask_user") return null;
25693
25770
  return existing ?? null;
25694
25771
  }
25695
25772
  function syncAskUserBlockFromLive(threadId, parts) {
25696
25773
  const thread = readThread(threadId);
25697
25774
  if (!thread || thread.status === "archived") return;
25698
- const next = askBlockAfterLiveParts(thread.agentBlock, parts);
25775
+ const next = askBlockAfterLiveParts(
25776
+ thread.agentBlock,
25777
+ parts,
25778
+ thread.dismissedQuestionSignature
25779
+ );
25699
25780
  if (askBlocksEqual(thread.agentBlock, next)) return;
25700
25781
  updateThread(threadId, { agentBlock: next });
25701
25782
  }
@@ -26420,9 +26501,9 @@ var init_abletime_oauth = __esm({
26420
26501
  ABLETIME_OAUTH_CALLBACK_PATH = "/oauth/abletime/callback";
26421
26502
  ABLETIME_OAUTH_PORT = 19849;
26422
26503
  ABLETIME_OAUTH_LOCAL_CALLBACK = `http://127.0.0.1:${ABLETIME_OAUTH_PORT}/callback`;
26423
- ABLETIME_OAUTH_REDIRECT = `https://www.sideboard.cloud${ABLETIME_OAUTH_CALLBACK_PATH}`;
26504
+ ABLETIME_OAUTH_REDIRECT = `https://www.sideboard.build${ABLETIME_OAUTH_CALLBACK_PATH}`;
26424
26505
  BOUNCE_QUERY_KEYS = ["code", "state", "error", "error_description"];
26425
- BAKED_ABLETIME_OAUTH_CLIENT_ID = "https://www.sideboard.cloud/oauth/abletime-client.json";
26506
+ BAKED_ABLETIME_OAUTH_CLIENT_ID = "https://www.sideboard.build/oauth/abletime-client.json";
26426
26507
  ABLETIME_OAUTH_RESOURCE = `${DEFAULT_ABLETIME_HOST}/api/public/v2/mcp`;
26427
26508
  REFRESH_SKEW_MS3 = 5 * 6e4;
26428
26509
  refreshInFlight3 = null;
@@ -34724,7 +34805,9 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
34724
34805
  const taskState2 = deriveTaskState({
34725
34806
  status: thread.status,
34726
34807
  stillRunning,
34727
- lastAgentParts: lastAgent?.parts
34808
+ lastAgentParts: lastAgent?.parts,
34809
+ dismissedQuestionSignature: thread.dismissedQuestionSignature,
34810
+ userAnswered: userRepliedAfterAgent(thread.messages, lastAgent)
34728
34811
  });
34729
34812
  const block = thread.agentBlock?.reason?.trim() ? thread.agentBlock : null;
34730
34813
  return {
@@ -40852,7 +40935,7 @@ var SLACK_OAUTH_RESULT_PATH = "/slack/oauth/result";
40852
40935
  var SLACK_RELAY_DESKTOP_PATH = "/slack/desktop";
40853
40936
  var SLACK_OAUTH_LOCAL_PORT = 19847;
40854
40937
  var SLACK_OAUTH_LOCAL_CALLBACK = `http://127.0.0.1:${SLACK_OAUTH_LOCAL_PORT}${SLACK_OAUTH_CALLBACK_PATH}`;
40855
- var SLACK_OAUTH_REDIRECT = `https://relay.sideboard.cloud${SLACK_OAUTH_CALLBACK_PATH}`;
40938
+ var SLACK_OAUTH_REDIRECT = `https://relay.sideboard.build${SLACK_OAUTH_CALLBACK_PATH}`;
40856
40939
  function slackOAuthRedirectUri() {
40857
40940
  return process.env.SIDEBOARD_SLACK_OAUTH_REDIRECT?.trim() || SLACK_OAUTH_REDIRECT;
40858
40941
  }
@@ -40887,7 +40970,7 @@ function parseSlackOAuthResultUrl(reqUrl) {
40887
40970
 
40888
40971
  // src/slack/baked-app.ts
40889
40972
  var BAKED_SLACK_CLIENT_ID = "7592788819232.11813536272562";
40890
- var BAKED_SLACK_RELAY_URL = "wss://relay.sideboard.cloud/slack/desktop";
40973
+ var BAKED_SLACK_RELAY_URL = "wss://relay.sideboard.build/slack/desktop";
40891
40974
  function hasBakedSlackOAuth() {
40892
40975
  return Boolean(BAKED_SLACK_CLIENT_ID.trim());
40893
40976
  }
@@ -43115,7 +43198,9 @@ async function startRelayServer(opts) {
43115
43198
  }
43116
43199
  const hostname2 = requestHostname(req);
43117
43200
  const canonical = (opts.canonicalSiteHost ?? "www.sideboard.cloud").toLowerCase();
43118
- if (opts.redirectHosts?.includes(hostname2) && hostname2 !== canonical) {
43201
+ const staticHosts = opts.staticHosts ?? [];
43202
+ const servesSite = staticHosts.length > 0 && staticHosts.includes(hostname2);
43203
+ if (opts.redirectHosts?.includes(hostname2) && hostname2 !== canonical && !servesSite) {
43119
43204
  res.writeHead(301, { Location: `https://${canonical}${reqUrl}` });
43120
43205
  res.end();
43121
43206
  return;