@sideboard-ai/core 0.1.349 → 0.1.351

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 (78) hide show
  1. package/dist/{abletime-CGFJZB7L.js → abletime-TX7BTTR2.js} +5 -5
  2. package/dist/{abletime-3HRWLQZJ.js → abletime-URSRZW7P.js} +4 -4
  3. package/dist/{abletime-oauth-QNJQLHR4.js → abletime-oauth-QS3WPSCC.js} +3 -3
  4. package/dist/{abletime-oauth-JQDSH5OL.js → abletime-oauth-SL3NMNEC.js} +4 -4
  5. package/dist/{abletime-rest-TANL5TMY.js → abletime-rest-GGQLUO55.js} +3 -3
  6. package/dist/{abletime-rest-UQA2CRZN.js → abletime-rest-JZU6JJCV.js} +4 -4
  7. package/dist/agents/acp-runner.cjs +491 -0
  8. package/dist/agents/acp-runner.d.cts +46 -0
  9. package/dist/agents/acp-runner.d.ts +46 -0
  10. package/dist/agents/acp-runner.js +323 -0
  11. package/dist/{agents-DMPBFF3F.js → agents-D5CL4CR4.js} +37 -7
  12. package/dist/{agents-AZ2PV6XP.js → agents-INTH7J3F.js} +42 -11
  13. package/dist/{app-settings-SNOPJ7P5.js → app-settings-IA7ZZKWQ.js} +2 -2
  14. package/dist/{app-settings-PPIMYJKS.js → app-settings-XILTSD6L.js} +1 -1
  15. package/dist/{chunk-RUIHNWRV.js → chunk-37ZBEBP6.js} +6 -6
  16. package/dist/{chunk-7B2OUQON.js → chunk-5TCMXEYL.js} +48 -3
  17. package/dist/{chunk-FDYMVJFU.js → chunk-5WF54R3B.js} +5 -5
  18. package/dist/{chunk-Q4I6KDOL.js → chunk-7WPQAVS5.js} +60 -39
  19. package/dist/{chunk-PVCECFJK.js → chunk-7ZD4OK6G.js} +1 -1
  20. package/dist/{chunk-ZXI5DR5S.js → chunk-AAKQU4UZ.js} +1624 -1487
  21. package/dist/{chunk-MVFFLU5V.js → chunk-AEEOYLVK.js} +12 -5
  22. package/dist/{chunk-RYPD7XWV.js → chunk-B4EFQTMP.js} +5 -5
  23. package/dist/{chunk-IRFBD6GU.js → chunk-BDWVBEKN.js} +71 -47
  24. package/dist/chunk-BF6INES4.js +144 -0
  25. package/dist/{chunk-IVRWRYTH.js → chunk-BZK62VPT.js} +2 -2
  26. package/dist/{chunk-ROXM6QZV.js → chunk-C3E2DGDF.js} +12 -5
  27. package/dist/{chunk-AJMERXZP.js → chunk-CCWQ65VD.js} +2 -2
  28. package/dist/{chunk-62ALWH3T.js → chunk-DL4OHDBV.js} +3 -3
  29. package/dist/{chunk-4NXGVJA6.js → chunk-F4RFFE2H.js} +48 -3
  30. package/dist/{chunk-E77SRVVO.js → chunk-FCKTBE26.js} +1 -1
  31. package/dist/{chunk-3DBL2C45.js → chunk-FQ3JYUKI.js} +2 -2
  32. package/dist/{chunk-MHSBF3SO.js → chunk-HISSQICH.js} +4 -4
  33. package/dist/{chunk-CEQ4Z32M.js → chunk-J4EA5SHF.js} +3 -3
  34. package/dist/{chunk-OHUAAX3O.js → chunk-M45WGODR.js} +2 -2
  35. package/dist/{chunk-UJMCTGV7.js → chunk-PXSWVZIL.js} +2 -2
  36. package/dist/{chunk-6RIPZ73M.js → chunk-SMSD6U3N.js} +3 -1
  37. package/dist/{chunk-CATTIFSP.js → chunk-SZY23KGS.js} +4 -4
  38. package/dist/{chunk-RPHH4FNK.js → chunk-TCEUNSLX.js} +3 -1
  39. package/dist/chunk-TRMPDDVL.js +232 -0
  40. package/dist/{chunk-6WMNIX2U.js → chunk-UFUAIVNV.js} +9 -5
  41. package/dist/{chunk-WHMLMCPU.js → chunk-UXAKH4AW.js} +1925 -1722
  42. package/dist/{chunk-QHXZKHUL.js → chunk-VHQ6OG3U.js} +2 -2
  43. package/dist/{chunk-WWU4SYZR.js → chunk-VL6F2KRE.js} +5 -1
  44. package/dist/{chunk-5FUAOU3G.js → chunk-WB3G2LQO.js} +1 -1
  45. package/dist/{chunk-JCYGQKER.js → chunk-WFX4ZVSZ.js} +1 -1
  46. package/dist/{chunk-F7WP2U5I.js → chunk-WJURGCBR.js} +1 -1
  47. package/dist/chunk-YE7Z5WH3.js +142 -0
  48. package/dist/{conductor-65VPUPOW.js → conductor-FWYWIHEW.js} +7 -6
  49. package/dist/{conductor-NHC6X74J.js → conductor-W2X7QUKZ.js} +6 -5
  50. package/dist/connected-teams-2YDE2EZ2.js +1 -1
  51. package/dist/{coordinator-prompt-R2PURZL3.js → coordinator-prompt-J57Q4Z4W.js} +4 -4
  52. package/dist/{coordinator-prompt-5GZWIVSY.js → coordinator-prompt-KIHNLENN.js} +5 -5
  53. package/dist/{global-workspace-UEECLWSX.js → global-workspace-CGB5CY4U.js} +4 -4
  54. package/dist/{global-workspace-64KC7PST.js → global-workspace-WXDWFZAN.js} +5 -5
  55. package/dist/index.cjs +1750 -950
  56. package/dist/index.d.cts +151 -895
  57. package/dist/index.d.ts +151 -895
  58. package/dist/index.js +582 -227
  59. package/dist/{linear-PKYJH4WK.js → linear-E3BX5PX5.js} +2 -2
  60. package/dist/{linear-MIJO6DCV.js → linear-WG23LBCX.js} +3 -3
  61. package/dist/{linear-list-JPQ27RXG.js → linear-list-OINZWVV5.js} +1 -1
  62. package/dist/{linear-list-N57PR6JM.js → linear-list-VU47BNUV.js} +1 -1
  63. package/dist/mcp/run-stdio.cjs +1247 -741
  64. package/dist/mcp/run-stdio.js +181 -44
  65. package/dist/{optional-cli-4GTEDEYJ.js → optional-cli-K6HX2X5O.js} +4 -3
  66. package/dist/{optional-cli-RPJIQBDX.js → optional-cli-SA3EQYML.js} +6 -5
  67. package/dist/{orchestrator-I5G5A5BV.js → orchestrator-DMEE7CEW.js} +11 -10
  68. package/dist/{orchestrator-Y5PYSMR6.js → orchestrator-MUD4FY7Q.js} +17 -15
  69. package/dist/thread-CJRchYLj.d.cts +856 -0
  70. package/dist/thread-CJRchYLj.d.ts +856 -0
  71. package/dist/{thread-store-HZ4U4OXB.js → thread-store-4YTOV2HL.js} +3 -3
  72. package/dist/{thread-store-QKNU5CHM.js → thread-store-LME2ICZP.js} +2 -2
  73. package/dist/{workspaces-6TIM2TM2.js → workspaces-7DPHDXNY.js} +4 -4
  74. package/dist/{workspaces-I2EHNTFE.js → workspaces-ZCTF4ECL.js} +5 -5
  75. package/dist/{worktree-7JFYDNUX.js → worktree-4ATMCYIE.js} +3 -3
  76. package/dist/{worktree-M2GJGK2P.js → worktree-DA6SKIU5.js} +4 -4
  77. package/package.json +3 -3
  78. /package/dist/{chunk-XOEKCE6L.js → chunk-OHXNGBC4.js} +0 -0
@@ -9,16 +9,19 @@ import {
9
9
  looksLikeRetryableRunnerCrash,
10
10
  looksLikeV8Oom
11
11
  } from "./chunk-LESWJ7L4.js";
12
+ import {
13
+ defaultAcpHarness
14
+ } from "./chunk-BF6INES4.js";
12
15
  import {
13
16
  isCloudCoordinatorThread,
14
17
  isGlobalThread,
15
18
  isOrchestratorThread,
16
19
  isSlackCoordinatorThread
17
- } from "./chunk-CATTIFSP.js";
20
+ } from "./chunk-SZY23KGS.js";
18
21
  import {
19
22
  mergeAgentGitAuthEnv,
20
23
  resolveAgentGitAuthEnv
21
- } from "./chunk-QHXZKHUL.js";
24
+ } from "./chunk-VHQ6OG3U.js";
22
25
  import {
23
26
  ATTACHMENTS_DIR,
24
27
  DETACHED_JOBS_DIR,
@@ -43,11 +46,11 @@ import {
43
46
  updateThread,
44
47
  worktreeNameFromPath,
45
48
  writeThread
46
- } from "./chunk-6RIPZ73M.js";
49
+ } from "./chunk-SMSD6U3N.js";
47
50
  import {
48
51
  assertOrchestratorCapableAgent,
49
52
  contextTokens
50
- } from "./chunk-WWU4SYZR.js";
53
+ } from "./chunk-VL6F2KRE.js";
51
54
  import {
52
55
  stripNestedElectronEnv
53
56
  } from "./chunk-WWUABK6B.js";
@@ -695,6 +698,7 @@ function workspaceAgentChatSummaries(worktreePath) {
695
698
  id: t.id,
696
699
  title: t.title,
697
700
  agent: t.agent,
701
+ ...t.acpHarness ? { acpHarness: t.acpHarness } : {},
698
702
  status: t.status,
699
703
  link: `sideboard://chat/${t.id}`,
700
704
  ...t.agentBlock?.reason ? { blockedReason: t.agentBlock.reason, blockedSource: t.agentBlock.source } : {}
@@ -723,6 +727,7 @@ function createChatTab(input) {
723
727
  const explicitTitle = input.title?.trim();
724
728
  const title = explicitTitle || allocateTeamName(takenTeamSlugsForChatTab(binding.worktreePath)).name;
725
729
  const nextAgent = input.agent ?? from.agent;
730
+ const nextHarness = nextAgent === "acp" ? input.acpHarness === "gemini" || input.acpHarness === "copilot" ? input.acpHarness : from.agent === "acp" && (from.acpHarness === "gemini" || from.acpHarness === "copilot") ? from.acpHarness : defaultAcpHarness() : void 0;
726
731
  if (isOrchestratorThread(from) || binding.sourceType === "orchestration") {
727
732
  assertOrchestratorCapableAgent(nextAgent);
728
733
  }
@@ -739,6 +744,7 @@ function createChatTab(input) {
739
744
  // the connected chat.
740
745
  sourceRef: singletonInbox ? title : binding.sourceRef,
741
746
  agent: nextAgent,
747
+ ...nextHarness ? { acpHarness: nextHarness } : {},
742
748
  model: input.model !== void 0 ? input.model : input.agent && input.agent !== from.agent ? null : from.model,
743
749
  effort: input.effort !== void 0 ? input.effort : from.effort,
744
750
  fast: input.fast !== void 0 ? Boolean(input.fast) : from.fast,
@@ -759,6 +765,7 @@ function forkChatTab(input) {
759
765
  const tab = createChatTab({
760
766
  fromThreadId: input.threadId,
761
767
  agent: input.agent ?? from.agent,
768
+ acpHarness: input.acpHarness,
762
769
  model: input.model,
763
770
  title: input.title?.trim() || void 0,
764
771
  attachments: [attachment]
@@ -1774,7 +1781,7 @@ var PORT_RANGE_SIZE = 10;
1774
1781
  var RECLAIM_RETRY_DELAY_MS = 40;
1775
1782
  var RECLAIM_TRIES = 8;
1776
1783
  async function killReclaimable(ports, worktreePath, signal) {
1777
- const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-NHC6X74J.js");
1784
+ const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-W2X7QUKZ.js");
1778
1785
  if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
1779
1786
  else killListenersOnPorts2(ports);
1780
1787
  }
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  getAbleTimeHost,
8
8
  isAbleTimeConnected
9
- } from "./chunk-WWU4SYZR.js";
9
+ } from "./chunk-VL6F2KRE.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-QNJQLHR4.js").then((m) => m.ensureAbleTimeAccessToken());
158
+ const rawToken = opts?.token ?? await import("./abletime-oauth-QS3WPSCC.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-QNJQLHR4.js").then((m) => m.ensureAbleTimeAccessToken());
229
+ const rawToken = opts?.token ?? await import("./abletime-oauth-QS3WPSCC.js").then((m) => m.ensureAbleTimeAccessToken());
230
230
  if (rawToken && ableTimeUsesRest(rawToken)) {
231
- const { callAbleTimeRestTool } = await import("./abletime-rest-TANL5TMY.js");
231
+ const { callAbleTimeRestTool } = await import("./abletime-rest-GGQLUO55.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-TANL5TMY.js");
247
+ const { callAbleTimeRestTool } = await import("./abletime-rest-GGQLUO55.js");
248
248
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
249
249
  }
250
250
  throw err instanceof Error ? new Error(rewriteAbleTimeError(err.message)) : err;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  formatOptionalServicesDirectiveForTurn,
3
3
  formatOptionalServicesReminderForTurn
4
- } from "./chunk-IVRWRYTH.js";
4
+ } from "./chunk-BZK62VPT.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-ZXI5DR5S.js";
24
+ } from "./chunk-AAKQU4UZ.js";
25
25
  import {
26
26
  applyWorktreePkgCacheEnv,
27
27
  buildBrightsySessionSeed,
@@ -56,7 +56,7 @@ import {
56
56
  worktreeDevProcessKey,
57
57
  worktreeRunProcessKey,
58
58
  worktreeSetupProcessKey
59
- } from "./chunk-ROXM6QZV.js";
59
+ } from "./chunk-C3E2DGDF.js";
60
60
  import {
61
61
  applyAgentEvent,
62
62
  clipAgentEventForPaint,
@@ -72,9 +72,17 @@ import {
72
72
  stripBrightsyNdjsonNoise,
73
73
  toolDescription
74
74
  } from "./chunk-WWBPK7GB.js";
75
+ import {
76
+ defaultAcpHarness,
77
+ detectAcpHarness,
78
+ detectAcpHarnesses
79
+ } from "./chunk-YE7Z5WH3.js";
75
80
  import {
76
81
  titleFromPrompt
77
82
  } from "./chunk-7H655NEW.js";
83
+ import {
84
+ releaseCaffeinateHoldForThread
85
+ } from "./chunk-LAWLUOWQ.js";
78
86
  import {
79
87
  SLACK_REPLY_FORMATTING,
80
88
  addWorkspace,
@@ -101,7 +109,7 @@ import {
101
109
  stageAbsolutePathsAsAttachments,
102
110
  stageBuffersAsAttachments,
103
111
  syncWorkspacesFromThreads
104
- } from "./chunk-MHSBF3SO.js";
112
+ } from "./chunk-HISSQICH.js";
105
113
  import {
106
114
  addPrStackLayer,
107
115
  allocateTeamSlug,
@@ -154,7 +162,7 @@ import {
154
162
  resolveRepoRoot,
155
163
  switchWorktreeBranch,
156
164
  withRepoGitLock
157
- } from "./chunk-3DBL2C45.js";
165
+ } from "./chunk-FQ3JYUKI.js";
158
166
  import {
159
167
  REVIEW_TAB_TITLE,
160
168
  agentNicknameFromWorktreePath,
@@ -190,7 +198,7 @@ import {
190
198
  worktreeNameFromPath,
191
199
  worktreeSlugForTicket,
192
200
  writeThread
193
- } from "./chunk-RPHH4FNK.js";
201
+ } from "./chunk-TCEUNSLX.js";
194
202
  import {
195
203
  askBlockStillWaiting,
196
204
  extractPendingPlanQuestions,
@@ -268,7 +276,10 @@ import {
268
276
  wakeOrchestratorOnGithubEdgesEnabled,
269
277
  withTurnScopedCost,
270
278
  writeViewerContext
271
- } from "./chunk-6WMNIX2U.js";
279
+ } from "./chunk-UFUAIVNV.js";
280
+ import {
281
+ writePrivateFile
282
+ } from "./chunk-JT7R45JB.js";
272
283
  import {
273
284
  examplePrefixedBranch,
274
285
  sanitizeGitBranchPrefix
@@ -279,12 +290,6 @@ import {
279
290
  nextManagedAccount,
280
291
  resolveAccountForThread
281
292
  } from "./chunk-KI45T4DI.js";
282
- import {
283
- releaseCaffeinateHoldForThread
284
- } from "./chunk-LAWLUOWQ.js";
285
- import {
286
- writePrivateFile
287
- } from "./chunk-JT7R45JB.js";
288
293
  import {
289
294
  annotateDevAccessRuns,
290
295
  appDataDir,
@@ -531,9 +536,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
531
536
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
532
537
  );
533
538
  }
534
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-64KC7PST.js");
539
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-WXDWFZAN.js");
535
540
  if (isGlobalThread2(thread)) {
536
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-5GZWIVSY.js");
541
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-KIHNLENN.js");
537
542
  ensureGlobalCoordinatorCwd2(
538
543
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
539
544
  );
@@ -2576,14 +2581,16 @@ import { existsSync as existsSync5 } from "fs";
2576
2581
  async function detectAgents() {
2577
2582
  ensureAgentPath();
2578
2583
  enrichPathWithNpmGlobalBin();
2579
- return Promise.all(allAdapters().map((a) => a.detect()));
2584
+ const adapters = allAdapters().filter((adapter) => adapter.kind !== "acp");
2585
+ const rows = await Promise.all(adapters.map((adapter) => adapter.detect()));
2586
+ return [...rows, ...await detectAcpHarnesses()];
2580
2587
  }
2581
2588
  var REQUIRE_AGENT_TIMEOUT_MS = 8e3;
2582
2589
  async function requireAgent(agent, opts) {
2583
2590
  ensureAgentPath();
2584
2591
  enrichPathWithNpmGlobalBin();
2585
2592
  const status = await Promise.race([
2586
- getAdapter(agent).detect(),
2593
+ agent === "acp" ? detectAcpHarness(opts?.acpHarness ?? defaultAcpHarness()) : getAdapter(agent).detect(),
2587
2594
  new Promise((_, reject) => {
2588
2595
  setTimeout(() => {
2589
2596
  reject(
@@ -3398,9 +3405,10 @@ async function createThread(input, _onSetupLine) {
3398
3405
  fast: input.fast,
3399
3406
  autonomy: input.autonomy
3400
3407
  });
3401
- await requireAgent(resolved.agent);
3408
+ const acpHarness = resolved.agent === "acp" ? input.acpHarness === "gemini" || input.acpHarness === "copilot" ? input.acpHarness : defaultAcpHarness() : void 0;
3409
+ await requireAgent(resolved.agent, { acpHarness });
3402
3410
  if (input.cowboy) {
3403
- const { cowboyModeEnabled } = await import("./app-settings-SNOPJ7P5.js");
3411
+ const { cowboyModeEnabled } = await import("./app-settings-IA7ZZKWQ.js");
3404
3412
  if (!cowboyModeEnabled()) {
3405
3413
  throw new Error(
3406
3414
  "Cowboy mode is off. Enable it in Settings \u2192 Advanced."
@@ -3435,6 +3443,7 @@ async function createThread(input, _onSetupLine) {
3435
3443
  worktreePath: repoPath,
3436
3444
  repoPath,
3437
3445
  agent: resolved.agent,
3446
+ ...acpHarness ? { acpHarness } : {},
3438
3447
  autonomy: resolved.autonomy,
3439
3448
  model: resolved.model,
3440
3449
  effort: resolved.effort,
@@ -3459,7 +3468,7 @@ async function createThread(input, _onSetupLine) {
3459
3468
  let sourceIsFork = false;
3460
3469
  if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
3461
3470
  if (isAbleTimeConnected() && getIssueSource() === "abletime") {
3462
- const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-CGFJZB7L.js");
3471
+ const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-TX7BTTR2.js");
3463
3472
  const task = await ensureAbleTimeTask({
3464
3473
  title: title?.trim() || "Untitled work",
3465
3474
  description: input.prompt?.trim() || void 0
@@ -3549,6 +3558,7 @@ async function createThread(input, _onSetupLine) {
3549
3558
  worktreePath,
3550
3559
  repoPath,
3551
3560
  agent: resolved.agent,
3561
+ ...acpHarness ? { acpHarness } : {},
3552
3562
  autonomy: resolved.autonomy,
3553
3563
  model: resolved.model,
3554
3564
  effort: resolved.effort,
@@ -3570,7 +3580,7 @@ async function createThread(input, _onSetupLine) {
3570
3580
  return readThread(thread.id) ?? thread;
3571
3581
  }
3572
3582
  async function listLinearIssues(agent, repoPath) {
3573
- const { getAdapter: getAdapter2 } = await import("./agents-AZ2PV6XP.js");
3583
+ const { getAdapter: getAdapter2 } = await import("./agents-INTH7J3F.js");
3574
3584
  await requireAgent(agent, { requireLinear: true });
3575
3585
  const adapter = getAdapter2(agent);
3576
3586
  if (!adapter.listLinearIssues) {
@@ -3602,6 +3612,28 @@ function shouldRemoveWorktreeOnTeardown(thread) {
3602
3612
  return !isCowboyThread(thread) && !isPrimaryCheckoutThread(thread);
3603
3613
  }
3604
3614
 
3615
+ // src/orchestrator/thread-agent-patch.ts
3616
+ function applyThreadAgentPatch(thread, patch, next) {
3617
+ const agent = patch.agent ?? thread.agent;
3618
+ const harness = agent === "acp" ? patch.acpHarness === "gemini" || patch.acpHarness === "copilot" ? patch.acpHarness : thread.acpHarness === "gemini" || thread.acpHarness === "copilot" ? thread.acpHarness : defaultAcpHarness() : null;
3619
+ const providerChanged = agent !== thread.agent || agent === "acp" && harness !== (thread.acpHarness ?? null);
3620
+ if (providerChanged) {
3621
+ if (thread.messages.length > 0) {
3622
+ const from = thread.agent === "acp" ? thread.acpHarness === "copilot" ? "copilot" : "gemini" : thread.agent;
3623
+ const to = agent === "acp" ? harness === "copilot" ? "copilot" : "gemini" : agent;
3624
+ throw new Error(
3625
+ `Cannot switch agent provider mid-chat (${from} \u2192 ${to}). Start a new chat tab instead.`
3626
+ );
3627
+ }
3628
+ if (isOrchestratorThread(thread)) assertOrchestratorCapableAgent(agent);
3629
+ next.agent = agent;
3630
+ if (agent !== "claude" && patch.model === void 0) next.model = null;
3631
+ next.sessionId = null;
3632
+ }
3633
+ if (agent === "acp") next.acpHarness = harness;
3634
+ else if (thread.acpHarness) next.acpHarness = null;
3635
+ }
3636
+
3605
3637
  // src/archive/fleet-archive.ts
3606
3638
  import { basename as basename2 } from "path";
3607
3639
  var DEFAULT_LIMIT = 40;
@@ -4070,6 +4102,7 @@ async function forkThreadWorktree(input, onSetupLine) {
4070
4102
  sourceRef: from.branchName,
4071
4103
  repoPath: from.repoPath,
4072
4104
  agent: nextAgent,
4105
+ acpHarness: nextAgent === "acp" ? input.acpHarness === "gemini" || input.acpHarness === "copilot" ? input.acpHarness : from.acpHarness : void 0,
4073
4106
  autonomy: from.autonomy,
4074
4107
  model: nextModel,
4075
4108
  effort: from.effort,
@@ -4349,11 +4382,14 @@ async function adoptThread(input) {
4349
4382
  worktreePath: input.worktreePath,
4350
4383
  repoPath,
4351
4384
  agent: input.agent,
4385
+ ...input.agent === "acp" ? {
4386
+ acpHarness: input.acpHarness === "gemini" || input.acpHarness === "copilot" ? input.acpHarness : void 0
4387
+ } : {},
4352
4388
  sessionId: input.sessionId ?? null,
4353
4389
  messages: input.messages ?? []
4354
4390
  });
4355
4391
  writeThread(thread);
4356
- const { addWorkspace: addWorkspace2 } = await import("./workspaces-I2EHNTFE.js");
4392
+ const { addWorkspace: addWorkspace2 } = await import("./workspaces-ZCTF4ECL.js");
4357
4393
  await addWorkspace2(repoPath);
4358
4394
  const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-YQBN43QD.js");
4359
4395
  await ensureWorktreeSideboardIgnored(input.worktreePath);
@@ -7990,11 +8026,11 @@ function realDeps() {
7990
8026
  parentIdForThread,
7991
8027
  designatedId: designatedOrchestratorId,
7992
8028
  send: async (threadId, prompt) => {
7993
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-Y5PYSMR6.js");
8029
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-MUD4FY7Q.js");
7994
8030
  await getOrchestrator2().send(threadId, prompt, { followUp: "queue" });
7995
8031
  },
7996
8032
  startOrchestration: async (prompt) => {
7997
- const { startOrchestration: startOrchestration2 } = await import("./orchestrator-Y5PYSMR6.js");
8033
+ const { startOrchestration: startOrchestration2 } = await import("./orchestrator-MUD4FY7Q.js");
7998
8034
  const defaults = resolveOrchestratorDefaults();
7999
8035
  await startOrchestration2({
8000
8036
  goal: prompt,
@@ -8021,7 +8057,7 @@ function formatScheduledPrompt(name, prompt) {
8021
8057
  ${prompt}`;
8022
8058
  }
8023
8059
  async function defaultDeps() {
8024
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-Y5PYSMR6.js");
8060
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-MUD4FY7Q.js");
8025
8061
  const orch = getOrchestrator2();
8026
8062
  return {
8027
8063
  findThread: (id) => findThreadByRef(id),
@@ -8222,7 +8258,7 @@ ${item.prompt}`);
8222
8258
  }
8223
8259
  }
8224
8260
  async function defaultSend(id, prompt) {
8225
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-Y5PYSMR6.js");
8261
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-MUD4FY7Q.js");
8226
8262
  await getOrchestrator2().send(id, prompt, { followUp: "join" });
8227
8263
  }
8228
8264
  function armChatFollowUps() {
@@ -8447,7 +8483,7 @@ var Orchestrator = class {
8447
8483
  orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
8448
8484
  });
8449
8485
  }
8450
- const { autoCleanupOrphansEnabled } = await import("./app-settings-SNOPJ7P5.js");
8486
+ const { autoCleanupOrphansEnabled } = await import("./app-settings-IA7ZZKWQ.js");
8451
8487
  if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
8452
8488
  await cleanupOrphanWorktrees({ repoPaths });
8453
8489
  }
@@ -8837,7 +8873,7 @@ var Orchestrator = class {
8837
8873
  }
8838
8874
  await setup;
8839
8875
  if (skipSetup) return;
8840
- const { autoRunAfterSetupEnabled } = await import("./app-settings-SNOPJ7P5.js");
8876
+ const { autoRunAfterSetupEnabled } = await import("./app-settings-IA7ZZKWQ.js");
8841
8877
  if (autoRunAfterSetupEnabled()) {
8842
8878
  try {
8843
8879
  await this.startDev(threadId);
@@ -9221,7 +9257,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
9221
9257
  }
9222
9258
  const isBrightsy = fresh.agent === "brightsy";
9223
9259
  const isOrchestration = isOrchestratorThread(fresh);
9224
- const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-SNOPJ7P5.js");
9260
+ const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-IA7ZZKWQ.js");
9225
9261
  const gitAuthMode = getGithubGitAuthMode();
9226
9262
  const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
9227
9263
  githubSlug: turnOrigin?.forge === "github" ? turnOrigin.slug : await withTimeout(resolveGithubRepoSlug(fresh.worktreePath), 8e3, "resolveGithubRepoSlug").catch(() => null),
@@ -10562,7 +10598,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
10562
10598
  if (Object.keys(patch).length === 0) continue;
10563
10599
  updateThread(t.id, patch);
10564
10600
  }
10565
- const { autoArchiveOnMergeEnabled } = await import("./app-settings-SNOPJ7P5.js");
10601
+ const { autoArchiveOnMergeEnabled } = await import("./app-settings-IA7ZZKWQ.js");
10566
10602
  const latest = this.requireThread(thread.id);
10567
10603
  if (!shouldAutoArchiveOnPrMerge({
10568
10604
  previousPrState: prevState || null,
@@ -10736,20 +10772,8 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
10736
10772
  if (patch.fast !== void 0) next.fast = patch.fast;
10737
10773
  if (patch.planMode !== void 0) next.planMode = patch.planMode;
10738
10774
  if (patch.model !== void 0) next.model = patch.model;
10739
- if (patch.agent !== void 0) {
10740
- if (patch.agent !== thread.agent) {
10741
- if (thread.messages.length > 0) {
10742
- throw new Error(
10743
- `Cannot switch agent provider mid-chat (${thread.agent} \u2192 ${patch.agent}). Start a new chat tab instead.`
10744
- );
10745
- }
10746
- if (isOrchestratorThread(thread)) {
10747
- assertOrchestratorCapableAgent(patch.agent);
10748
- }
10749
- next.agent = patch.agent;
10750
- if (patch.agent !== "claude" && patch.model === void 0) next.model = null;
10751
- next.sessionId = null;
10752
- }
10775
+ if (patch.agent !== void 0 || patch.acpHarness !== void 0) {
10776
+ applyThreadAgentPatch(thread, patch, next);
10753
10777
  }
10754
10778
  return updateThread(thread.id, next);
10755
10779
  }
@@ -10886,7 +10910,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
10886
10910
  await runArchiveScript(thread.repoPath, thread.worktreePath);
10887
10911
  } catch {
10888
10912
  }
10889
- const { deleteBranchOnPurgeEnabled } = await import("./app-settings-SNOPJ7P5.js");
10913
+ const { deleteBranchOnPurgeEnabled } = await import("./app-settings-IA7ZZKWQ.js");
10890
10914
  const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
10891
10915
  await removeWorktreeDroppingLeftovers(thread, deleteBranch ? thread.branchName : void 0);
10892
10916
  }
@@ -11023,7 +11047,7 @@ async function startOrchestration(opts) {
11023
11047
  sourceRef: "default",
11024
11048
  ...createOpts
11025
11049
  }).catch(async () => {
11026
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-M2GJGK2P.js");
11050
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-DA6SKIU5.js");
11027
11051
  const repo = await resolveRepoRoot2(repoPath);
11028
11052
  const def = await resolveDefaultBranch2(repo);
11029
11053
  return orch.createThread({
@@ -11033,7 +11057,7 @@ async function startOrchestration(opts) {
11033
11057
  repoPath: repo
11034
11058
  });
11035
11059
  });
11036
- const { updateThread: upd } = await import("./thread-store-HZ4U4OXB.js");
11060
+ const { updateThread: upd } = await import("./thread-store-4YTOV2HL.js");
11037
11061
  const updated = upd(thread.id, {
11038
11062
  sourceType: "orchestration",
11039
11063
  sourceRef: goal
@@ -0,0 +1,144 @@
1
+ #!/usr/bin/env node
2
+
3
+ import {
4
+ run
5
+ } from "./chunk-TL2HK6LZ.js";
6
+ import {
7
+ loadAppSettings
8
+ } from "./chunk-VL6F2KRE.js";
9
+
10
+ // src/agents/acp-harness.ts
11
+ import { existsSync, readFileSync } from "fs";
12
+ import { homedir } from "os";
13
+ import { join } from "path";
14
+ var ACP_HARNESSES = {
15
+ gemini: {
16
+ id: "gemini",
17
+ label: "Gemini CLI",
18
+ bin: "gemini",
19
+ args: ["--acp"],
20
+ npmPackage: "@google/gemini-cli",
21
+ installCommand: "npm install -g @google/gemini-cli",
22
+ loginCommand: "gemini",
23
+ docsUrl: "https://geminicli.com/docs/cli/acp-mode/",
24
+ authHint: "Gemini CLI is on PATH but no API key or ~/.gemini login was found. Set GEMINI_API_KEY or run `gemini` once to sign in."
25
+ },
26
+ copilot: {
27
+ id: "copilot",
28
+ label: "Copilot CLI",
29
+ bin: "copilot",
30
+ args: ["--acp", "--stdio"],
31
+ npmPackage: "@github/copilot",
32
+ installCommand: "npm install -g @github/copilot",
33
+ loginCommand: "copilot",
34
+ docsUrl: "https://docs.github.com/en/copilot/reference/copilot-cli-reference/acp-server",
35
+ authHint: "Copilot CLI is on PATH but no GitHub login was found. Run `gh auth login` or `copilot`, or set GH_TOKEN."
36
+ }
37
+ };
38
+ var ACP_HARNESS_IDS = Object.keys(ACP_HARNESSES);
39
+ function isAcpHarnessId(value) {
40
+ return value === "gemini" || value === "copilot";
41
+ }
42
+ function acpHarnessLabel(id) {
43
+ if (isAcpHarnessId(id)) return ACP_HARNESSES[id].label;
44
+ return "ACP";
45
+ }
46
+ function defaultAcpHarness() {
47
+ const stored = loadAppSettings().defaults?.acpHarness;
48
+ return isAcpHarnessId(stored) ? stored : "gemini";
49
+ }
50
+ function agentSupportsAttach(agent) {
51
+ return agent !== "acp";
52
+ }
53
+ var AUTH_READ_MAX = 64e3;
54
+ function envSet(env, ...keys) {
55
+ return keys.some((key) => Boolean(env[key]?.trim()));
56
+ }
57
+ function fileMentionsCredential(path) {
58
+ try {
59
+ if (!existsSync(path)) return false;
60
+ const text = readFileSync(path, "utf8").slice(0, AUTH_READ_MAX);
61
+ return /"(access_token|refresh_token|oauth_token|api_key|apiKey)"\s*:/i.test(text) || /oauth_token\s*:/i.test(text);
62
+ } catch {
63
+ return false;
64
+ }
65
+ }
66
+ function acpHarnessLooksAuthenticated(id, env = process.env, home = homedir(), opts) {
67
+ if (id === "gemini") {
68
+ if (envSet(env, "GEMINI_API_KEY", "GOOGLE_API_KEY", "GOOGLE_GENAI_API_KEY")) return true;
69
+ return fileMentionsCredential(join(home, ".gemini", "oauth_creds.json")) || fileMentionsCredential(join(home, ".gemini", "google_accounts.json"));
70
+ }
71
+ if (envSet(env, "COPILOT_GITHUB_TOKEN", "GH_TOKEN", "GITHUB_TOKEN")) return true;
72
+ if (fileMentionsCredential(join(home, ".copilot", "config.json")) || fileMentionsCredential(join(home, ".config", "gh", "hosts.yml"))) {
73
+ return true;
74
+ }
75
+ return opts?.ghLoggedIn === true;
76
+ }
77
+ async function copilotGhLoggedIn() {
78
+ const status = await run("gh", ["auth", "status"], { reject: false, timeoutMs: 5e3 });
79
+ return status.exitCode === 0;
80
+ }
81
+ function acpHarnessStatus(input) {
82
+ const spec = ACP_HARNESSES[input.id];
83
+ if (!input.binPath) {
84
+ return {
85
+ agent: "acp",
86
+ acpHarness: input.id,
87
+ label: spec.label,
88
+ installed: false,
89
+ authenticated: false,
90
+ linearMcp: false,
91
+ warnings: [],
92
+ reason: `${spec.label} is not on PATH (\`${spec.bin}\`). ${spec.installCommand}`
93
+ };
94
+ }
95
+ const authenticated = acpHarnessLooksAuthenticated(
96
+ input.id,
97
+ input.env ?? process.env,
98
+ input.home ?? homedir(),
99
+ { ghLoggedIn: input.ghLoggedIn }
100
+ );
101
+ return {
102
+ agent: "acp",
103
+ acpHarness: input.id,
104
+ label: spec.label,
105
+ installed: true,
106
+ authenticated,
107
+ linearMcp: false,
108
+ warnings: [],
109
+ ...authenticated ? {} : { reason: spec.authHint }
110
+ };
111
+ }
112
+ async function resolveAcpHarnessCommand(id) {
113
+ const spec = ACP_HARNESSES[id];
114
+ const which = await run("which", [spec.bin], { reject: false, timeoutMs: 3e3 });
115
+ const file = which.exitCode === 0 ? which.stdout.trim().split("\n")[0]?.trim() ?? "" : "";
116
+ if (!file) {
117
+ throw new Error(`${spec.label} is not on PATH. ${spec.installCommand}`);
118
+ }
119
+ return { file, args: [...spec.args] };
120
+ }
121
+ async function detectAcpHarness(id) {
122
+ const spec = ACP_HARNESSES[id];
123
+ const which = await run("which", [spec.bin], { reject: false, timeoutMs: 3e3 });
124
+ const file = which.exitCode === 0 ? which.stdout.trim().split("\n")[0]?.trim() ?? "" : "";
125
+ const ghLoggedIn = id === "copilot" && file && !acpHarnessLooksAuthenticated(id) ? await copilotGhLoggedIn() : false;
126
+ return acpHarnessStatus({ id, binPath: file || null, ghLoggedIn });
127
+ }
128
+ async function detectAcpHarnesses() {
129
+ return Promise.all(ACP_HARNESS_IDS.map((id) => detectAcpHarness(id)));
130
+ }
131
+
132
+ export {
133
+ ACP_HARNESSES,
134
+ ACP_HARNESS_IDS,
135
+ isAcpHarnessId,
136
+ acpHarnessLabel,
137
+ defaultAcpHarness,
138
+ agentSupportsAttach,
139
+ acpHarnessLooksAuthenticated,
140
+ acpHarnessStatus,
141
+ resolveAcpHarnessCommand,
142
+ detectAcpHarness,
143
+ detectAcpHarnesses
144
+ };
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  loadAppSettings,
6
6
  saveAppSettings
7
- } from "./chunk-6WMNIX2U.js";
7
+ } from "./chunk-UFUAIVNV.js";
8
8
 
9
9
  // src/integrations/optional-services.ts
10
10
  var OPTIONAL_SERVICE_IDS = ["vercel", "supabase", "posthog", "sentry"];
@@ -282,7 +282,7 @@ async function connectedCliPresence(integrations) {
282
282
  const ids = connectedOptionalServices(integrations).filter((spec) => spec.cli).map((spec) => spec.id);
283
283
  if (ids.length === 0) return void 0;
284
284
  try {
285
- const { optionalCliPresence } = await import("./optional-cli-RPJIQBDX.js");
285
+ const { optionalCliPresence } = await import("./optional-cli-SA3EQYML.js");
286
286
  return await optionalCliPresence(ids);
287
287
  } catch {
288
288
  return void 0;