@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
@@ -1,5 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ import {
4
+ ACP_HARNESSES,
5
+ isAcpHarnessId
6
+ } from "./chunk-BF6INES4.js";
3
7
  import {
4
8
  enrichPathWithNpmGlobalBin,
5
9
  isConductorBundledCli,
@@ -9,7 +13,7 @@ import {
9
13
  } from "./chunk-TL2HK6LZ.js";
10
14
  import {
11
15
  resolveAgentExecutable
12
- } from "./chunk-WWU4SYZR.js";
16
+ } from "./chunk-VL6F2KRE.js";
13
17
 
14
18
  // src/agents/install.ts
15
19
  import { chmodSync, existsSync } from "fs";
@@ -133,6 +137,14 @@ var SETUP = {
133
137
  installCommand: "npm install -g @brightsy/cli",
134
138
  loginCommand: "brightsy login",
135
139
  npmPackage: "@brightsy/cli"
140
+ },
141
+ acp: {
142
+ agent: "acp",
143
+ kind: "cli",
144
+ summary: "One adapter for every ACP harness. Install Gemini CLI or Copilot CLI from Settings \u2014 there is no separate ACP binary, and no interactive attach.",
145
+ docsUrl: "https://agentclientprotocol.com",
146
+ installCommand: null,
147
+ loginCommand: null
136
148
  }
137
149
  };
138
150
  var CLI_BIN = {
@@ -288,7 +300,7 @@ async function resolveCliAfterNpmInstall(cliBin) {
288
300
  return whichOnPath(cliBin);
289
301
  }
290
302
  async function resolveExistingCli(agent) {
291
- if (agent === "cursor") return null;
303
+ if (agent === "cursor" || agent === "acp") return null;
292
304
  const exe = resolveAgentExecutable(agent);
293
305
  if ((exe.includes("/") || exe.includes("\\")) && existsSync(exe)) return exe;
294
306
  enrichPathWithNpmGlobalBin();
@@ -314,7 +326,33 @@ async function runVendorUpdate(existing, updateArgs) {
314
326
  function isCurlInstaller(command) {
315
327
  return /curl\s| \|\s*bash/.test(command);
316
328
  }
329
+ async function installAcpHarness(id) {
330
+ const spec = ACP_HARNESSES[id];
331
+ return installNpmGlobalPackage({
332
+ npmPackage: spec.npmPackage,
333
+ installCommand: spec.installCommand,
334
+ cliBin: spec.bin
335
+ });
336
+ }
337
+ async function loginAcpHarness(id) {
338
+ const spec = ACP_HARNESSES[id];
339
+ const prepared = await prepareTerminalCommand(spec.loginCommand);
340
+ await openInSystemTerminal(prepared);
341
+ return {
342
+ ok: true,
343
+ openedTerminal: true,
344
+ command: prepared,
345
+ message: `Opened Terminal to run: ${prepared}`
346
+ };
347
+ }
317
348
  async function installAgent(agent) {
349
+ if (isAcpHarnessId(agent)) return installAcpHarness(agent);
350
+ if (agent === "acp") {
351
+ return {
352
+ ok: false,
353
+ message: "Install Gemini CLI or Copilot CLI from Settings \u2192 Agents. ACP is the adapter, not a binary."
354
+ };
355
+ }
318
356
  const info = getAgentSetupInfo(agent);
319
357
  if (info.kind === "bundled-sdk" || info.kind === "api-key") {
320
358
  return {
@@ -348,6 +386,13 @@ async function installAgent(agent) {
348
386
  };
349
387
  }
350
388
  async function loginAgent(agent) {
389
+ if (isAcpHarnessId(agent)) return loginAcpHarness(agent);
390
+ if (agent === "acp") {
391
+ return {
392
+ ok: false,
393
+ message: "Log in to Gemini CLI or Copilot CLI from Settings \u2192 Agents."
394
+ };
395
+ }
351
396
  const info = getAgentSetupInfo(agent);
352
397
  const loginCommand = resolveLoginCommand(agent);
353
398
  if (!loginCommand) {
@@ -366,7 +411,7 @@ async function loginAgent(agent) {
366
411
  };
367
412
  }
368
413
  async function loginManagedAccount(accountId) {
369
- const { loadAppSettings } = await import("./app-settings-PPIMYJKS.js");
414
+ const { loadAppSettings } = await import("./app-settings-XILTSD6L.js");
370
415
  const { loginEnvPrefix } = await import("./managed-accounts-PITLFLKU.js");
371
416
  const account = loadAppSettings().accounts.accounts.find((a) => a.id === accountId);
372
417
  if (!account) {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  getAbleTimeHost,
6
6
  isAbleTimeConnected
7
- } from "./chunk-6WMNIX2U.js";
7
+ } from "./chunk-UFUAIVNV.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-JQDSH5OL.js").then((m) => m.ensureAbleTimeAccessToken());
156
+ const rawToken = opts?.token ?? await import("./abletime-oauth-SL3NMNEC.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-JQDSH5OL.js").then((m) => m.ensureAbleTimeAccessToken());
227
+ const rawToken = opts?.token ?? await import("./abletime-oauth-SL3NMNEC.js").then((m) => m.ensureAbleTimeAccessToken());
228
228
  if (rawToken && ableTimeUsesRest(rawToken)) {
229
- const { callAbleTimeRestTool } = await import("./abletime-rest-UQA2CRZN.js");
229
+ const { callAbleTimeRestTool } = await import("./abletime-rest-JZU6JJCV.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-UQA2CRZN.js");
245
+ const { callAbleTimeRestTool } = await import("./abletime-rest-JZU6JJCV.js");
246
246
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
247
247
  }
248
248
  throw err instanceof Error ? new Error(rewriteAbleTimeError(err.message)) : err;
@@ -14,7 +14,7 @@ import {
14
14
  parseSessionQuotaResetAt,
15
15
  planModeTurnInstruction,
16
16
  resolveQuotaFallbackAgent
17
- } from "./chunk-WHMLMCPU.js";
17
+ } from "./chunk-UXAKH4AW.js";
18
18
  import {
19
19
  applyWorktreePkgCacheEnv,
20
20
  askBlockStillWaiting,
@@ -54,7 +54,7 @@ import {
54
54
  worktreeDevProcessKey,
55
55
  worktreeRunProcessKey,
56
56
  worktreeSetupProcessKey
57
- } from "./chunk-MVFFLU5V.js";
57
+ } from "./chunk-AEEOYLVK.js";
58
58
  import {
59
59
  applyAgentEvent,
60
60
  clipAgentEventForPaint,
@@ -88,7 +88,11 @@ import {
88
88
  import {
89
89
  formatOptionalServicesDirectiveForTurn,
90
90
  formatOptionalServicesReminderForTurn
91
- } from "./chunk-F7WP2U5I.js";
91
+ } from "./chunk-WJURGCBR.js";
92
+ import {
93
+ defaultAcpHarness,
94
+ detectAcpHarness
95
+ } from "./chunk-BF6INES4.js";
92
96
  import {
93
97
  extractPresentedPlan,
94
98
  isPresentPlanToolName,
@@ -121,7 +125,7 @@ import {
121
125
  stageAbsolutePathsAsAttachments,
122
126
  stageBuffersAsAttachments,
123
127
  syncWorkspacesFromThreads
124
- } from "./chunk-CATTIFSP.js";
128
+ } from "./chunk-SZY23KGS.js";
125
129
  import {
126
130
  addPrStackLayer,
127
131
  allocateTeamSlug,
@@ -172,7 +176,7 @@ import {
172
176
  resolveRepoRoot,
173
177
  switchWorktreeBranch,
174
178
  withRepoGitLock
175
- } from "./chunk-QHXZKHUL.js";
179
+ } from "./chunk-VHQ6OG3U.js";
176
180
  import {
177
181
  issueActivityKind
178
182
  } from "./chunk-OYRN356W.js";
@@ -219,7 +223,7 @@ import {
219
223
  worktreeNameFromPath,
220
224
  worktreeSlugForTicket,
221
225
  writeThread
222
- } from "./chunk-6RIPZ73M.js";
226
+ } from "./chunk-SMSD6U3N.js";
223
227
  import {
224
228
  HISTORY_CLEANUP_INTERVAL_HOURS_DEFAULT,
225
229
  applyTurnUsage,
@@ -256,7 +260,7 @@ import {
256
260
  wakeOrchestratorOnGithubEdgesEnabled,
257
261
  withTurnScopedCost,
258
262
  writeViewerContext
259
- } from "./chunk-WWU4SYZR.js";
263
+ } from "./chunk-VL6F2KRE.js";
260
264
  import {
261
265
  writePrivateFile
262
266
  } from "./chunk-NSTQ6QKD.js";
@@ -575,9 +579,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
575
579
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
576
580
  );
577
581
  }
578
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-UEECLWSX.js");
582
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-CGB5CY4U.js");
579
583
  if (isGlobalThread2(thread)) {
580
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-R2PURZL3.js");
584
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-J57Q4Z4W.js");
581
585
  ensureGlobalCoordinatorCwd2(
582
586
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
583
587
  );
@@ -2454,7 +2458,7 @@ async function requireAgent(agent, opts) {
2454
2458
  ensureAgentPath();
2455
2459
  enrichPathWithNpmGlobalBin();
2456
2460
  const status = await Promise.race([
2457
- getAdapter(agent).detect(),
2461
+ agent === "acp" ? detectAcpHarness(opts?.acpHarness ?? defaultAcpHarness()) : getAdapter(agent).detect(),
2458
2462
  new Promise((_, reject) => {
2459
2463
  setTimeout(() => {
2460
2464
  reject(
@@ -3095,9 +3099,10 @@ async function createThread(input, _onSetupLine) {
3095
3099
  fast: input.fast,
3096
3100
  autonomy: input.autonomy
3097
3101
  });
3098
- await requireAgent(resolved.agent);
3102
+ const acpHarness = resolved.agent === "acp" ? input.acpHarness === "gemini" || input.acpHarness === "copilot" ? input.acpHarness : defaultAcpHarness() : void 0;
3103
+ await requireAgent(resolved.agent, { acpHarness });
3099
3104
  if (input.cowboy) {
3100
- const { cowboyModeEnabled } = await import("./app-settings-PPIMYJKS.js");
3105
+ const { cowboyModeEnabled } = await import("./app-settings-XILTSD6L.js");
3101
3106
  if (!cowboyModeEnabled()) {
3102
3107
  throw new Error(
3103
3108
  "Cowboy mode is off. Enable it in Settings \u2192 Advanced."
@@ -3132,6 +3137,7 @@ async function createThread(input, _onSetupLine) {
3132
3137
  worktreePath: repoPath,
3133
3138
  repoPath,
3134
3139
  agent: resolved.agent,
3140
+ ...acpHarness ? { acpHarness } : {},
3135
3141
  autonomy: resolved.autonomy,
3136
3142
  model: resolved.model,
3137
3143
  effort: resolved.effort,
@@ -3156,7 +3162,7 @@ async function createThread(input, _onSetupLine) {
3156
3162
  let sourceIsFork = false;
3157
3163
  if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
3158
3164
  if (isAbleTimeConnected() && getIssueSource() === "abletime") {
3159
- const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-3HRWLQZJ.js");
3165
+ const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-URSRZW7P.js");
3160
3166
  const task = await ensureAbleTimeTask({
3161
3167
  title: title?.trim() || "Untitled work",
3162
3168
  description: input.prompt?.trim() || void 0
@@ -3246,6 +3252,7 @@ async function createThread(input, _onSetupLine) {
3246
3252
  worktreePath,
3247
3253
  repoPath,
3248
3254
  agent: resolved.agent,
3255
+ ...acpHarness ? { acpHarness } : {},
3249
3256
  autonomy: resolved.autonomy,
3250
3257
  model: resolved.model,
3251
3258
  effort: resolved.effort,
@@ -3290,6 +3297,28 @@ function shouldRemoveWorktreeOnTeardown(thread) {
3290
3297
  return !isCowboyThread(thread) && !isPrimaryCheckoutThread(thread);
3291
3298
  }
3292
3299
 
3300
+ // src/orchestrator/thread-agent-patch.ts
3301
+ function applyThreadAgentPatch(thread, patch, next) {
3302
+ const agent = patch.agent ?? thread.agent;
3303
+ const harness = agent === "acp" ? patch.acpHarness === "gemini" || patch.acpHarness === "copilot" ? patch.acpHarness : thread.acpHarness === "gemini" || thread.acpHarness === "copilot" ? thread.acpHarness : defaultAcpHarness() : null;
3304
+ const providerChanged = agent !== thread.agent || agent === "acp" && harness !== (thread.acpHarness ?? null);
3305
+ if (providerChanged) {
3306
+ if (thread.messages.length > 0) {
3307
+ const from = thread.agent === "acp" ? thread.acpHarness === "copilot" ? "copilot" : "gemini" : thread.agent;
3308
+ const to = agent === "acp" ? harness === "copilot" ? "copilot" : "gemini" : agent;
3309
+ throw new Error(
3310
+ `Cannot switch agent provider mid-chat (${from} \u2192 ${to}). Start a new chat tab instead.`
3311
+ );
3312
+ }
3313
+ if (isOrchestratorThread(thread)) assertOrchestratorCapableAgent(agent);
3314
+ next.agent = agent;
3315
+ if (agent !== "claude" && patch.model === void 0) next.model = null;
3316
+ next.sessionId = null;
3317
+ }
3318
+ if (agent === "acp") next.acpHarness = harness;
3319
+ else if (thread.acpHarness) next.acpHarness = null;
3320
+ }
3321
+
3293
3322
  // src/archive/fleet-archive.ts
3294
3323
  import { basename as basename2 } from "path";
3295
3324
  var DEFAULT_LIMIT = 40;
@@ -3755,6 +3784,7 @@ async function forkThreadWorktree(input, onSetupLine) {
3755
3784
  sourceRef: from.branchName,
3756
3785
  repoPath: from.repoPath,
3757
3786
  agent: nextAgent,
3787
+ acpHarness: nextAgent === "acp" ? input.acpHarness === "gemini" || input.acpHarness === "copilot" ? input.acpHarness : from.acpHarness : void 0,
3758
3788
  autonomy: from.autonomy,
3759
3789
  model: nextModel,
3760
3790
  effort: from.effort,
@@ -4034,11 +4064,14 @@ async function adoptThread(input) {
4034
4064
  worktreePath: input.worktreePath,
4035
4065
  repoPath,
4036
4066
  agent: input.agent,
4067
+ ...input.agent === "acp" ? {
4068
+ acpHarness: input.acpHarness === "gemini" || input.acpHarness === "copilot" ? input.acpHarness : void 0
4069
+ } : {},
4037
4070
  sessionId: input.sessionId ?? null,
4038
4071
  messages: input.messages ?? []
4039
4072
  });
4040
4073
  writeThread(thread);
4041
- const { addWorkspace: addWorkspace2 } = await import("./workspaces-6TIM2TM2.js");
4074
+ const { addWorkspace: addWorkspace2 } = await import("./workspaces-7DPHDXNY.js");
4042
4075
  await addWorkspace2(repoPath);
4043
4076
  const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-KMZQXZKP.js");
4044
4077
  await ensureWorktreeSideboardIgnored(input.worktreePath);
@@ -7640,11 +7673,11 @@ function realDeps() {
7640
7673
  parentIdForThread,
7641
7674
  designatedId: designatedOrchestratorId,
7642
7675
  send: async (threadId, prompt) => {
7643
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-I5G5A5BV.js");
7676
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-DMEE7CEW.js");
7644
7677
  await getOrchestrator2().send(threadId, prompt, { followUp: "queue" });
7645
7678
  },
7646
7679
  startOrchestration: async (prompt) => {
7647
- const { startOrchestration: startOrchestration2 } = await import("./orchestrator-I5G5A5BV.js");
7680
+ const { startOrchestration: startOrchestration2 } = await import("./orchestrator-DMEE7CEW.js");
7648
7681
  const defaults = resolveOrchestratorDefaults();
7649
7682
  await startOrchestration2({
7650
7683
  goal: prompt,
@@ -7671,7 +7704,7 @@ function formatScheduledPrompt(name, prompt) {
7671
7704
  ${prompt}`;
7672
7705
  }
7673
7706
  async function defaultDeps() {
7674
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-I5G5A5BV.js");
7707
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-DMEE7CEW.js");
7675
7708
  const orch = getOrchestrator2();
7676
7709
  return {
7677
7710
  findThread: (id) => findThreadByRef(id),
@@ -7872,7 +7905,7 @@ ${item.prompt}`);
7872
7905
  }
7873
7906
  }
7874
7907
  async function defaultSend(id, prompt) {
7875
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-I5G5A5BV.js");
7908
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-DMEE7CEW.js");
7876
7909
  await getOrchestrator2().send(id, prompt, { followUp: "join" });
7877
7910
  }
7878
7911
  function armChatFollowUps() {
@@ -8097,7 +8130,7 @@ var Orchestrator = class {
8097
8130
  orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
8098
8131
  });
8099
8132
  }
8100
- const { autoCleanupOrphansEnabled } = await import("./app-settings-PPIMYJKS.js");
8133
+ const { autoCleanupOrphansEnabled } = await import("./app-settings-XILTSD6L.js");
8101
8134
  if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
8102
8135
  await cleanupOrphanWorktrees({ repoPaths });
8103
8136
  }
@@ -8487,7 +8520,7 @@ var Orchestrator = class {
8487
8520
  }
8488
8521
  await setup;
8489
8522
  if (skipSetup) return;
8490
- const { autoRunAfterSetupEnabled } = await import("./app-settings-PPIMYJKS.js");
8523
+ const { autoRunAfterSetupEnabled } = await import("./app-settings-XILTSD6L.js");
8491
8524
  if (autoRunAfterSetupEnabled()) {
8492
8525
  try {
8493
8526
  await this.startDev(threadId);
@@ -8871,7 +8904,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
8871
8904
  }
8872
8905
  const isBrightsy = fresh.agent === "brightsy";
8873
8906
  const isOrchestration = isOrchestratorThread(fresh);
8874
- const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-PPIMYJKS.js");
8907
+ const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-XILTSD6L.js");
8875
8908
  const gitAuthMode = getGithubGitAuthMode();
8876
8909
  const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
8877
8910
  githubSlug: turnOrigin?.forge === "github" ? turnOrigin.slug : await withTimeout(resolveGithubRepoSlug(fresh.worktreePath), 8e3, "resolveGithubRepoSlug").catch(() => null),
@@ -10212,7 +10245,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
10212
10245
  if (Object.keys(patch).length === 0) continue;
10213
10246
  updateThread(t.id, patch);
10214
10247
  }
10215
- const { autoArchiveOnMergeEnabled } = await import("./app-settings-PPIMYJKS.js");
10248
+ const { autoArchiveOnMergeEnabled } = await import("./app-settings-XILTSD6L.js");
10216
10249
  const latest = this.requireThread(thread.id);
10217
10250
  if (!shouldAutoArchiveOnPrMerge({
10218
10251
  previousPrState: prevState || null,
@@ -10386,20 +10419,8 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
10386
10419
  if (patch.fast !== void 0) next.fast = patch.fast;
10387
10420
  if (patch.planMode !== void 0) next.planMode = patch.planMode;
10388
10421
  if (patch.model !== void 0) next.model = patch.model;
10389
- if (patch.agent !== void 0) {
10390
- if (patch.agent !== thread.agent) {
10391
- if (thread.messages.length > 0) {
10392
- throw new Error(
10393
- `Cannot switch agent provider mid-chat (${thread.agent} \u2192 ${patch.agent}). Start a new chat tab instead.`
10394
- );
10395
- }
10396
- if (isOrchestratorThread(thread)) {
10397
- assertOrchestratorCapableAgent(patch.agent);
10398
- }
10399
- next.agent = patch.agent;
10400
- if (patch.agent !== "claude" && patch.model === void 0) next.model = null;
10401
- next.sessionId = null;
10402
- }
10422
+ if (patch.agent !== void 0 || patch.acpHarness !== void 0) {
10423
+ applyThreadAgentPatch(thread, patch, next);
10403
10424
  }
10404
10425
  return updateThread(thread.id, next);
10405
10426
  }
@@ -10536,7 +10557,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
10536
10557
  await runArchiveScript(thread.repoPath, thread.worktreePath);
10537
10558
  } catch {
10538
10559
  }
10539
- const { deleteBranchOnPurgeEnabled } = await import("./app-settings-PPIMYJKS.js");
10560
+ const { deleteBranchOnPurgeEnabled } = await import("./app-settings-XILTSD6L.js");
10540
10561
  const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
10541
10562
  await removeWorktreeDroppingLeftovers(thread, deleteBranch ? thread.branchName : void 0);
10542
10563
  }
@@ -10673,7 +10694,7 @@ async function startOrchestration(opts) {
10673
10694
  sourceRef: "default",
10674
10695
  ...createOpts
10675
10696
  }).catch(async () => {
10676
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-7JFYDNUX.js");
10697
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-4ATMCYIE.js");
10677
10698
  const repo = await resolveRepoRoot2(repoPath);
10678
10699
  const def = await resolveDefaultBranch2(repo);
10679
10700
  return orch.createThread({
@@ -10683,7 +10704,7 @@ async function startOrchestration(opts) {
10683
10704
  repoPath: repo
10684
10705
  });
10685
10706
  });
10686
- const { updateThread: upd } = await import("./thread-store-QKNU5CHM.js");
10707
+ const { updateThread: upd } = await import("./thread-store-LME2ICZP.js");
10687
10708
  const updated = upd(thread.id, {
10688
10709
  sourceType: "orchestration",
10689
10710
  sourceRef: goal
@@ -16,7 +16,7 @@ import {
16
16
  disconnectLinearConnection,
17
17
  loadAppSettings,
18
18
  saveLinearOAuth
19
- } from "./chunk-6WMNIX2U.js";
19
+ } from "./chunk-UFUAIVNV.js";
20
20
 
21
21
  // src/integrations/linear-oauth.ts
22
22
  import { createHash, randomBytes } from "crypto";