@sideboard-ai/core 0.1.325 → 0.1.327

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 (76) hide show
  1. package/dist/{abletime-M7STTMZT.js → abletime-NW4PJGHN.js} +4 -5
  2. package/dist/{abletime-VL234MCP.js → abletime-OW7LTFQD.js} +4 -5
  3. package/dist/{abletime-oauth-LMMGMAPA.js → abletime-oauth-KWQQRHOQ.js} +3 -4
  4. package/dist/{abletime-oauth-P4ZFBEAL.js → abletime-oauth-TPR2QDRI.js} +3 -4
  5. package/dist/{abletime-rest-DLV7EIWS.js → abletime-rest-5DCWN3P4.js} +3 -4
  6. package/dist/{abletime-rest-GOI7HELR.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/cursor-runner.cjs +1 -1
  10. package/dist/agents/cursor-runner.js +1 -1
  11. package/dist/{agents-MBIEAETM.js → agents-IYBY3JT5.js} +9 -10
  12. package/dist/{agents-LDRM3BTY.js → agents-XWIPONJR.js} +8 -9
  13. package/dist/{app-settings-UQHUNOLV.js → app-settings-A5D364JD.js} +1 -2
  14. package/dist/{app-settings-E7DMMEKC.js → app-settings-SA4HX3ZQ.js} +1 -2
  15. package/dist/{chunk-BOFYI6LC.js → chunk-2GEUFPQQ.js} +1 -1
  16. package/dist/{chunk-F65JMKUR.js → chunk-4F7THWIO.js} +2 -2
  17. package/dist/{chunk-A76MKMSF.js → chunk-4G3W23X3.js} +3 -3
  18. package/dist/{chunk-Q3FHTGIW.js → chunk-5Y2C7Q55.js} +441 -20
  19. package/dist/{chunk-PPTJMBUY.js → chunk-ATQLP22S.js} +1 -1
  20. package/dist/{chunk-NWGINMEA.js → chunk-CHYUUETG.js} +3 -3
  21. package/dist/{chunk-RZJTGBXY.js → chunk-D446IWPP.js} +50 -4
  22. package/dist/{chunk-ZEUMWHOH.js → chunk-DACWFN4O.js} +5 -5
  23. package/dist/{chunk-SACHHTBJ.js → chunk-DEB47BII.js} +52 -488
  24. package/dist/{chunk-2UP3XD2D.js → chunk-ECY7WL6T.js} +2 -2
  25. package/dist/{chunk-CI4M54LS.js → chunk-EJRCHCXM.js} +21 -4
  26. package/dist/{chunk-H36GKGU2.js → chunk-EUIVQAPK.js} +2 -2
  27. package/dist/{chunk-WYEST76H.js → chunk-IXWPCOLQ.js} +19 -203
  28. package/dist/{chunk-EO6ZFLG6.js → chunk-JKHCADKB.js} +5 -5
  29. package/dist/{chunk-SK6NYGPD.js → chunk-KLVW3J2B.js} +2 -2
  30. package/dist/{chunk-HG6KS7OT.js → chunk-MO46K6WK.js} +22 -18
  31. package/dist/{chunk-F2PVRF3B.js → chunk-N6ZF3XRP.js} +2 -1
  32. package/dist/{chunk-MFMDZAA6.js → chunk-NQGLDQYB.js} +16 -12
  33. package/dist/{chunk-U5WO6MEB.js → chunk-NURZOXGN.js} +1 -1
  34. package/dist/{chunk-ZHDXLDLA.js → chunk-Q4UPRQOS.js} +12 -12
  35. package/dist/{chunk-SQQBU7Z6.js → chunk-QMLDR63X.js} +2 -2
  36. package/dist/{chunk-BTF3ATST.js → chunk-R2C45NHT.js} +2 -2
  37. package/dist/{chunk-APKUI4BP.js → chunk-RDXODLEN.js} +4 -4
  38. package/dist/{chunk-7G27TB4M.js → chunk-RZJ3QJZT.js} +18 -14
  39. package/dist/{chunk-AQEKPJWU.js → chunk-SB5ADEZZ.js} +5 -5
  40. package/dist/{chunk-7LUOLYFM.js → chunk-SFXGD5KJ.js} +1 -1
  41. package/dist/{chunk-EZR6W4B3.js → chunk-TUH4ICHQ.js} +1 -1
  42. package/dist/chunk-ULWPSBAB.js +192 -0
  43. package/dist/{chunk-MBT6WDAB.js → chunk-UMXBH344.js} +1 -1
  44. package/dist/{chunk-SS6CYGLF.js → chunk-XBBZZHJY.js} +3 -3
  45. package/dist/{chunk-ZSHS46V5.js → chunk-Y6OHM672.js} +476 -20
  46. package/dist/{chunk-GNLKBS3U.js → chunk-YUHZEIVG.js} +69 -473
  47. package/dist/{chunk-VAFQS4D2.js → chunk-ZPBOWO64.js} +2 -2
  48. package/dist/{conductor-KB7L7NQN.js → conductor-CP7TW6TN.js} +7 -7
  49. package/dist/{conductor-D4KFZF54.js → conductor-D62Q2XJC.js} +6 -7
  50. package/dist/{coordinator-prompt-OBXEC63K.js → coordinator-prompt-3PJLU3UH.js} +5 -6
  51. package/dist/{coordinator-prompt-SUO4FRY3.js → coordinator-prompt-J7O7JB26.js} +5 -6
  52. package/dist/{global-workspace-Z2SURNHA.js → global-workspace-4CTLU2BV.js} +5 -6
  53. package/dist/{global-workspace-UHU2FXTY.js → global-workspace-Y3UDZYJX.js} +5 -6
  54. package/dist/index.cjs +527 -506
  55. package/dist/index.d.cts +16 -10
  56. package/dist/index.d.ts +16 -10
  57. package/dist/index.js +68 -66
  58. package/dist/{linear-SIHEBU3X.js → linear-CXWGH2TW.js} +2 -3
  59. package/dist/{linear-HFUOUJ5H.js → linear-WLDCJ3AF.js} +2 -3
  60. package/dist/{linear-list-JFV3EES6.js → linear-list-52LEDEWO.js} +1 -1
  61. package/dist/{linear-list-63I7QUC6.js → linear-list-FGVN65JU.js} +1 -1
  62. package/dist/mcp/run-stdio.cjs +19655 -19635
  63. package/dist/mcp/run-stdio.js +33 -34
  64. package/dist/{optional-cli-ULDP3O5S.js → optional-cli-FN4MGB6W.js} +4 -5
  65. package/dist/{optional-cli-U2GUA2X6.js → optional-cli-INRVBBBG.js} +3 -4
  66. package/dist/{orchestrator-3H4KNGPN.js → orchestrator-EN3ZKD73.js} +13 -13
  67. package/dist/{orchestrator-6ROMEWBP.js → orchestrator-W4TZBBDO.js} +11 -12
  68. package/dist/{thread-store-4ZN3DS2W.js → thread-store-4WE24XA2.js} +6 -2
  69. package/dist/{thread-store-IC4BQXDW.js → thread-store-K2ZNGUSM.js} +7 -3
  70. package/dist/{workspaces-MG5JHRKW.js → workspaces-MM7CQYR6.js} +5 -6
  71. package/dist/{workspaces-QJNKEGEM.js → workspaces-WYCVZ6XH.js} +5 -6
  72. package/dist/{worktree-MYJYUHZM.js → worktree-JBNEMJ5Z.js} +7 -8
  73. package/dist/{worktree-KSJPTHGZ.js → worktree-NNVRGPP4.js} +4 -5
  74. package/package.json +1 -1
  75. package/dist/chunk-77WWLBCI.js +0 -50
  76. package/dist/chunk-KGZBYWZ3.js +0 -23
@@ -7,11 +7,20 @@ import {
7
7
  resolveGithubRepoSlug,
8
8
  resolveOriginRemote,
9
9
  resolveRepoRoot
10
- } from "./chunk-EO6ZFLG6.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-CI4M54LS.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-2UP3XD2D.js";
5
+ } from "./chunk-ECY7WL6T.js";
6
6
  import {
7
7
  installNpmGlobalPackage,
8
8
  whichOnPath
9
- } from "./chunk-SK6NYGPD.js";
9
+ } from "./chunk-KLVW3J2B.js";
10
10
  import {
11
11
  enrichPathWithNpmGlobalBin
12
12
  } from "./chunk-2TUE6JKQ.js";
@@ -4,7 +4,7 @@ import {
4
4
  normalizeTakenSlug,
5
5
  normalizeWorktreePath,
6
6
  takenSlugsFromThread
7
- } from "./chunk-ZSHS46V5.js";
7
+ } from "./chunk-Y6OHM672.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-RZJTGBXY.js";
28
+ } from "./chunk-D446IWPP.js";
29
29
  import {
30
30
  worktreesRoot
31
31
  } from "./chunk-H4UEFJRI.js";
@@ -5,7 +5,7 @@ import {
5
5
  resolveGithubRepoSlug,
6
6
  resolveOriginRemote,
7
7
  resolveRepoRoot
8
- } from "./chunk-BTF3ATST.js";
8
+ } from "./chunk-R2C45NHT.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-ZSHS46V5.js";
17
+ } from "./chunk-Y6OHM672.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-RZJTGBXY.js";
34
+ } from "./chunk-D446IWPP.js";
35
35
  import {
36
36
  appDataDir,
37
37
  globalAgentCwd,
@@ -402,7 +402,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
402
402
  "- 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.",
403
403
  "- 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.",
404
404
  "- 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.",
405
- "- 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.",
405
+ "- 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.",
406
406
  "Projects:",
407
407
  "- add_project / remove_project \u2014 register or unregister a git repo",
408
408
  "Workspaces and chats:",
@@ -11,11 +11,11 @@ import {
11
11
  isGlobalThread,
12
12
  isOrchestratorThread,
13
13
  isSlackCoordinatorThread
14
- } from "./chunk-ZHDXLDLA.js";
14
+ } from "./chunk-Q4UPRQOS.js";
15
15
  import {
16
16
  mergeAgentGitAuthEnv,
17
17
  resolveAgentGitAuthEnv
18
- } from "./chunk-EO6ZFLG6.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-CI4M54LS.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,
@@ -528,11 +528,15 @@ function applyCompaction(messages, summaryText, thresholds = {}) {
528
528
  return [summary, ...recent];
529
529
  }
530
530
  function lastRequestOccupancy(thread) {
531
+ if (thread.agent === "cursor") return estimateOccupancyTokens(thread.messages);
531
532
  for (let i = thread.messages.length - 1; i >= 0; i--) {
532
533
  const usage = thread.messages[i]?.usage;
533
- if (usage) return contextTokens(usage);
534
+ if (!usage) continue;
535
+ const n = usage.lastRequestTokens;
536
+ if (n != null && n > 0) return n;
537
+ if (thread.agent === "codex") return estimateOccupancyTokens(thread.messages);
534
538
  }
535
- return 0;
539
+ return thread.agent === "codex" ? estimateOccupancyTokens(thread.messages) : 0;
536
540
  }
537
541
  function shouldResetSessionForOccupancy(thread, occupancyTokens = SESSION_RESET_OCCUPANCY_TOKENS) {
538
542
  return lastRequestOccupancy(thread) >= occupancyTokens;
@@ -551,7 +555,7 @@ async function maybeCompactContext(thread, thresholds = {}, summarize = summariz
551
555
  });
552
556
  let messages = applyCompaction(thread.messages, summary, thresholds);
553
557
  const compactedMessages = appendCompactedMessages(thread.compactedMessages, older);
554
- const resetSession = shouldResetSessionForOccupancy({ messages: thread.messages });
558
+ const resetSession = shouldResetSessionForOccupancy(thread);
555
559
  if (resetSession) {
556
560
  messages = applyForwardOccupancy(messages);
557
561
  }
@@ -1678,7 +1682,7 @@ var PORT_RANGE_SIZE = 10;
1678
1682
  var RECLAIM_RETRY_DELAY_MS = 40;
1679
1683
  var RECLAIM_TRIES = 8;
1680
1684
  async function killReclaimable(ports, worktreePath, signal) {
1681
- const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-D4KFZF54.js");
1685
+ const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-D62Q2XJC.js");
1682
1686
  if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
1683
1687
  else killListenersOnPorts2(ports);
1684
1688
  }
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  getAbleTimeHost,
8
8
  isAbleTimeConnected
9
- } from "./chunk-CI4M54LS.js";
9
+ } from "./chunk-EJRCHCXM.js";
10
10
 
11
11
  // src/integrations/abletime-mcp.ts
12
12
  var DEFAULT_ABLETIME_HOST = "https://track.abletime.com";
@@ -155,7 +155,7 @@ function textsFromUnknown(value) {
155
155
  return "";
156
156
  }
157
157
  async function abletimeMcpRequest(method, params, opts) {
158
- const rawToken = opts?.token ?? await import("./abletime-oauth-P4ZFBEAL.js").then((m) => m.ensureAbleTimeAccessToken());
158
+ const rawToken = opts?.token ?? await import("./abletime-oauth-TPR2QDRI.js").then((m) => m.ensureAbleTimeAccessToken());
159
159
  if (!rawToken?.trim()) {
160
160
  throw new Error("AbleTime is not connected \u2014 paste a personal access token in Account settings");
161
161
  }
@@ -226,9 +226,9 @@ async function callAbleTimeTool(name, args = {}, opts) {
226
226
  if (!opts?.token && !isAbleTimeConnected()) {
227
227
  throw new Error("AbleTime is not connected \u2014 paste a personal access token in Account settings");
228
228
  }
229
- const rawToken = opts?.token ?? await import("./abletime-oauth-P4ZFBEAL.js").then((m) => m.ensureAbleTimeAccessToken());
229
+ const rawToken = opts?.token ?? await import("./abletime-oauth-TPR2QDRI.js").then((m) => m.ensureAbleTimeAccessToken());
230
230
  if (rawToken && ableTimeUsesRest(rawToken)) {
231
- const { callAbleTimeRestTool } = await import("./abletime-rest-DLV7EIWS.js");
231
+ const { callAbleTimeRestTool } = await import("./abletime-rest-5DCWN3P4.js");
232
232
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
233
233
  }
234
234
  const requestOpts = { ...opts, pm: opts?.pm ?? abletimeToolUsesPm(name) };
@@ -244,7 +244,7 @@ async function callAbleTimeTool(name, args = {}, opts) {
244
244
  return await call();
245
245
  }
246
246
  if (rawToken && ableTimeUsesRest(rawToken) && isAbleTimeRejectedCredential(message)) {
247
- const { callAbleTimeRestTool } = await import("./abletime-rest-DLV7EIWS.js");
247
+ const { callAbleTimeRestTool } = await import("./abletime-rest-5DCWN3P4.js");
248
248
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
249
249
  }
250
250
  throw err instanceof Error ? new Error(rewriteAbleTimeError(err.message)) : err;
@@ -16,7 +16,7 @@ import {
16
16
  disconnectLinearConnection,
17
17
  loadAppSettings,
18
18
  saveLinearOAuth
19
- } from "./chunk-RZJTGBXY.js";
19
+ } from "./chunk-D446IWPP.js";
20
20
 
21
21
  // src/integrations/linear-oauth.ts
22
22
  import { createHash, randomBytes } from "crypto";
@@ -18,7 +18,7 @@ import {
18
18
  disconnectLinearConnection,
19
19
  loadAppSettings,
20
20
  saveLinearOAuth
21
- } from "./chunk-CI4M54LS.js";
21
+ } from "./chunk-EJRCHCXM.js";
22
22
 
23
23
  // src/integrations/linear-oauth.ts
24
24
  import { createHash, randomBytes } from "crypto";
@@ -0,0 +1,192 @@
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 hasTopLevelTool(parts) {
67
+ return Boolean(parts?.some((part) => part.type === "tool" && !part.parentId));
68
+ }
69
+ function questionsFromToolPart(part) {
70
+ const fromInput = parsePlanQuestionsInput(part.input);
71
+ if (fromInput.length) return fromInput;
72
+ const raw = part.result?.trim();
73
+ if (!raw || !raw.startsWith("{")) return [];
74
+ try {
75
+ return parsePlanQuestionsInput(JSON.parse(raw));
76
+ } catch {
77
+ return [];
78
+ }
79
+ }
80
+ function extractPendingPlanQuestions(parts) {
81
+ if (!parts?.length) return null;
82
+ for (let i = parts.length - 1; i >= 0; i--) {
83
+ const p = parts[i];
84
+ if (p.type !== "tool" || !isAskUserToolName(p.name)) continue;
85
+ const questions = questionsFromToolPart(p);
86
+ if (!questions.length) continue;
87
+ return {
88
+ id: p.id || `ask-${i}`,
89
+ signature: planQuestionsSignature(questions),
90
+ questions,
91
+ source: p.name || "ask_user"
92
+ };
93
+ }
94
+ return null;
95
+ }
96
+ function pendingFromAskBlock(block, dismissedQuestionSignature) {
97
+ if (!block || block.source !== "ask_user" || !block.questions?.length) return null;
98
+ const dismissed = dismissedQuestionSignature?.trim();
99
+ if (dismissed && (!block.questionSignature || block.questionSignature === dismissed)) {
100
+ return null;
101
+ }
102
+ const signature = block.questionSignature?.trim() || planQuestionsSignature(block.questions);
103
+ return {
104
+ id: `ask-block:${signature}`,
105
+ signature,
106
+ questions: block.questions,
107
+ source: "ask_user"
108
+ };
109
+ }
110
+ function askBlockStillWaiting(block, messages) {
111
+ if (!messages?.length) return Boolean(block?.at);
112
+ const askedAt = block?.at;
113
+ if (!askedAt) return false;
114
+ for (let i = messages.length - 1; i >= 0; i--) {
115
+ const message = messages[i];
116
+ if (message.role !== "user" || message.origin === "continue") continue;
117
+ if (!message.ts) return true;
118
+ return askedAt > message.ts;
119
+ }
120
+ return true;
121
+ }
122
+ function latestPendingPlanQuestions(input) {
123
+ if (input.userReplied) return null;
124
+ const fromBlock = () => pendingFromAskBlock(input.agentBlock, input.dismissedQuestionSignature);
125
+ if (lastTopLevelToolIsAskUser(input.liveParts)) {
126
+ return extractPendingPlanQuestions(input.liveParts) ?? fromBlock();
127
+ }
128
+ const last = input.messages[input.messages.length - 1];
129
+ if (last?.role === "agent" && lastTopLevelToolIsAskUser(last.parts)) {
130
+ return extractPendingPlanQuestions(last.parts) ?? fromBlock();
131
+ }
132
+ if (hasTopLevelTool(input.liveParts) || last?.role === "agent" && hasTopLevelTool(last.parts)) {
133
+ return null;
134
+ }
135
+ if (input.status === "running" || input.status === "queued") return null;
136
+ const stamped = fromBlock();
137
+ if (stamped && askBlockStillWaiting(input.agentBlock, input.messages)) {
138
+ return stamped;
139
+ }
140
+ return null;
141
+ }
142
+ var PLAN_QUESTION_ANSWERS_PREFIX = "Answers to your questions:";
143
+ function isPlanQuestionAnswersMessage(text) {
144
+ return text.startsWith(PLAN_QUESTION_ANSWERS_PREFIX);
145
+ }
146
+ function formatPlanQuestionAnswers(questions, answers) {
147
+ const lines = [PLAN_QUESTION_ANSWERS_PREFIX, ""];
148
+ for (let i = 0; i < questions.length; i++) {
149
+ const q = questions[i];
150
+ const a = answers.find((x) => x.questionIndex === i);
151
+ const header = q.header ? `**${q.header}** \u2014 ` : "";
152
+ const parts = [];
153
+ if (a?.selected.length) parts.push(a.selected.join(", "));
154
+ if (a?.other?.trim()) parts.push(a.other.trim());
155
+ const body = parts.length ? parts.join(" \xB7 ") : "(no answer)";
156
+ lines.push(`${i + 1}. ${header}${q.question} `);
157
+ lines.push(` \u2192 ${body}`);
158
+ }
159
+ return lines.join("\n");
160
+ }
161
+ function formatPlanQuestionsForChat(questions) {
162
+ const lines = ["### Questions for you", ""];
163
+ for (let i = 0; i < questions.length; i++) {
164
+ const q = questions[i];
165
+ const header = q.header ? `**${q.header}** \u2014 ` : "";
166
+ lines.push(`${i + 1}. ${header}${q.question}`);
167
+ for (let oi = 0; oi < q.options.length; oi++) {
168
+ const opt = q.options[oi];
169
+ const desc = opt.description?.trim();
170
+ lines.push(
171
+ desc ? ` - **${opt.label}** \u2014 ${desc}` : ` - **${opt.label}**`
172
+ );
173
+ }
174
+ lines.push("");
175
+ }
176
+ lines.push("_Answer in the composer below._");
177
+ return lines.join("\n").trimEnd();
178
+ }
179
+
180
+ export {
181
+ planQuestionsSignature,
182
+ parsePlanQuestionsInput,
183
+ isAskUserToolName,
184
+ lastTopLevelToolIsAskUser,
185
+ extractPendingPlanQuestions,
186
+ askBlockStillWaiting,
187
+ latestPendingPlanQuestions,
188
+ PLAN_QUESTION_ANSWERS_PREFIX,
189
+ isPlanQuestionAnswersMessage,
190
+ formatPlanQuestionAnswers,
191
+ formatPlanQuestionsForChat
192
+ };
@@ -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-SIHEBU3X.js");
8
+ const { listLinearIssuesDirect } = await import("./linear-CXWGH2TW.js");
9
9
  const listed = listLinearIssuesDirect({ limit: 50 }).catch(() => []);
10
10
  let timer;
11
11
  try {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_ABLETIME_HOST,
3
3
  normalizeAbleTimeHost
4
- } from "./chunk-ZEUMWHOH.js";
4
+ } from "./chunk-DACWFN4O.js";
5
5
  import {
6
6
  httpFetch
7
7
  } from "./chunk-JAT3JFOS.js";
@@ -10,7 +10,7 @@ import {
10
10
  getAbleTimeHost,
11
11
  loadAppSettings,
12
12
  saveAbleTimeConnection
13
- } from "./chunk-RZJTGBXY.js";
13
+ } from "./chunk-D446IWPP.js";
14
14
 
15
15
  // src/integrations/abletime-oauth.ts
16
16
  import { createHash, randomBytes } from "crypto";
@@ -280,7 +280,7 @@ async function startAbleTimeOAuth(opts) {
280
280
  persistAbleTimeTokens(data, { host });
281
281
  const token = data.access_token.trim();
282
282
  try {
283
- const { getAbleTimeOrientation } = await import("./abletime-VL234MCP.js");
283
+ const { getAbleTimeOrientation } = await import("./abletime-OW7LTFQD.js");
284
284
  const orientation = await getAbleTimeOrientation({ token, host });
285
285
  return saveAbleTimeConnection({
286
286
  accessToken: token,