@sideboard-ai/core 0.1.348 → 0.1.350

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 (84) 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/cursor-runner.js +3 -3
  12. package/dist/{agents-T4XBZZDA.js → agents-P5QIV24I.js} +38 -8
  13. package/dist/{agents-5MFGVK7C.js → agents-RGAV5OHD.js} +44 -13
  14. package/dist/{app-settings-SNOPJ7P5.js → app-settings-IA7ZZKWQ.js} +2 -2
  15. package/dist/{app-settings-PPIMYJKS.js → app-settings-XILTSD6L.js} +1 -1
  16. package/dist/{chunk-UGUWFONI.js → chunk-2E2HMJDU.js} +1 -1
  17. package/dist/{chunk-OH3BAUMC.js → chunk-2MESZ5XR.js} +273 -84
  18. package/dist/{chunk-RUIHNWRV.js → chunk-37ZBEBP6.js} +6 -6
  19. package/dist/{chunk-Y6VQX2LY.js → chunk-5AHWUJRT.js} +1927 -1718
  20. package/dist/{chunk-7B2OUQON.js → chunk-5TCMXEYL.js} +48 -3
  21. package/dist/{chunk-FDYMVJFU.js → chunk-5WF54R3B.js} +5 -5
  22. package/dist/{chunk-PVCECFJK.js → chunk-7ZD4OK6G.js} +1 -1
  23. package/dist/{chunk-RYPD7XWV.js → chunk-B4EFQTMP.js} +5 -5
  24. package/dist/chunk-BF6INES4.js +144 -0
  25. package/dist/{chunk-IVRWRYTH.js → chunk-BZK62VPT.js} +2 -2
  26. package/dist/{chunk-AJMERXZP.js → chunk-CCWQ65VD.js} +2 -2
  27. package/dist/{chunk-62ALWH3T.js → chunk-DL4OHDBV.js} +3 -3
  28. package/dist/{chunk-6TV6L2DD.js → chunk-EZ2MUWNW.js} +7 -6
  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-NTY5WGRD.js → chunk-FQ3JYUKI.js} +2 -2
  32. package/dist/{chunk-CEQ4Z32M.js → chunk-J4EA5SHF.js} +3 -3
  33. package/dist/{chunk-ORO4ENZR.js → chunk-LESWJ7L4.js} +1 -0
  34. package/dist/{chunk-XNGW4OYD.js → chunk-LFSTOECH.js} +7 -6
  35. package/dist/{chunk-OHUAAX3O.js → chunk-M45WGODR.js} +2 -2
  36. package/dist/{chunk-ZJMYCDYQ.js → chunk-MANERA6F.js} +55 -10
  37. package/dist/{chunk-Q4TZA4MN.js → chunk-NDEVAA34.js} +1629 -1486
  38. package/dist/{chunk-OPXEJJBM.js → chunk-PWOFUPYM.js} +1 -0
  39. package/dist/{chunk-UJMCTGV7.js → chunk-PXSWVZIL.js} +2 -2
  40. package/dist/{chunk-MOUAM6ZC.js → chunk-SMSD6U3N.js} +135 -3
  41. package/dist/{chunk-ATS7SYHG.js → chunk-TCEUNSLX.js} +135 -3
  42. package/dist/chunk-TRMPDDVL.js +232 -0
  43. package/dist/{chunk-6WMNIX2U.js → chunk-UFUAIVNV.js} +9 -5
  44. package/dist/{chunk-2HPVGTHF.js → chunk-VHQ6OG3U.js} +2 -2
  45. package/dist/{chunk-WWU4SYZR.js → chunk-VL6F2KRE.js} +5 -1
  46. package/dist/{chunk-WMD77UCY.js → chunk-W5GHFT7E.js} +279 -87
  47. package/dist/{chunk-5FUAOU3G.js → chunk-WB3G2LQO.js} +1 -1
  48. package/dist/{chunk-JCYGQKER.js → chunk-WFX4ZVSZ.js} +1 -1
  49. package/dist/{chunk-F7WP2U5I.js → chunk-WJURGCBR.js} +1 -1
  50. package/dist/{chunk-BIM24I3O.js → chunk-WWBPK7GB.js} +1 -1
  51. package/dist/chunk-YE7Z5WH3.js +142 -0
  52. package/dist/{chunk-5YCKATG6.js → chunk-YVN7L4KG.js} +1 -1
  53. package/dist/{chunk-GAGTEI6B.js → chunk-ZBSEJIOV.js} +56 -11
  54. package/dist/{conductor-LYQKONSA.js → conductor-HVOGBK63.js} +7 -6
  55. package/dist/{conductor-EMGMDNHL.js → conductor-VGCXUUG6.js} +9 -8
  56. package/dist/connected-teams-2YDE2EZ2.js +1 -1
  57. package/dist/{coordinator-prompt-DLY3FS2L.js → coordinator-prompt-DPO7L2JO.js} +5 -5
  58. package/dist/{coordinator-prompt-WALVMGKI.js → coordinator-prompt-E736TJBS.js} +4 -4
  59. package/dist/{global-workspace-UG2A3CEM.js → global-workspace-4RDPAOTT.js} +5 -5
  60. package/dist/{global-workspace-7OQ5O6JT.js → global-workspace-TG2TVLUF.js} +4 -4
  61. package/dist/index.cjs +2881 -1761
  62. package/dist/index.d.cts +140 -877
  63. package/dist/index.d.ts +140 -877
  64. package/dist/index.js +865 -559
  65. package/dist/{linear-PKYJH4WK.js → linear-E3BX5PX5.js} +2 -2
  66. package/dist/{linear-MIJO6DCV.js → linear-WG23LBCX.js} +3 -3
  67. package/dist/{linear-list-JPQ27RXG.js → linear-list-OINZWVV5.js} +1 -1
  68. package/dist/{linear-list-N57PR6JM.js → linear-list-VU47BNUV.js} +1 -1
  69. package/dist/mcp/run-stdio.cjs +2112 -1287
  70. package/dist/mcp/run-stdio.js +318 -230
  71. package/dist/{optional-cli-4GTEDEYJ.js → optional-cli-K6HX2X5O.js} +4 -3
  72. package/dist/{optional-cli-RPJIQBDX.js → optional-cli-SA3EQYML.js} +6 -5
  73. package/dist/{orchestrator-KNOMW5CZ.js → orchestrator-3I2FLEZL.js} +20 -18
  74. package/dist/{orchestrator-4SXTORD2.js → orchestrator-QDHZ56LA.js} +12 -11
  75. package/dist/thread-CJRchYLj.d.cts +856 -0
  76. package/dist/thread-CJRchYLj.d.ts +856 -0
  77. package/dist/{thread-store-R3G5VBII.js → thread-store-4YTOV2HL.js} +3 -3
  78. package/dist/{thread-store-MEUWZDVV.js → thread-store-LME2ICZP.js} +2 -2
  79. package/dist/{workspaces-KWGTP7DI.js → workspaces-4PA24IX6.js} +4 -4
  80. package/dist/{workspaces-35T6FW57.js → workspaces-6TMYV4N2.js} +5 -5
  81. package/dist/{worktree-ROJXGBWS.js → worktree-4ATMCYIE.js} +3 -3
  82. package/dist/{worktree-5P7SCST3.js → worktree-DA6SKIU5.js} +4 -4
  83. package/package.json +3 -3
  84. /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;
@@ -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";
@@ -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;
@@ -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;
@@ -4,14 +4,14 @@ import {
4
4
  normalizeAbleTimeCredential,
5
5
  normalizeAbleTimeHost,
6
6
  rewriteAbleTimeError
7
- } from "./chunk-FDYMVJFU.js";
7
+ } from "./chunk-5WF54R3B.js";
8
8
  import {
9
9
  httpFetch
10
10
  } from "./chunk-JAT3JFOS.js";
11
11
  import {
12
12
  getAbleTimeAccessToken,
13
13
  getAbleTimeHost
14
- } from "./chunk-6WMNIX2U.js";
14
+ } from "./chunk-UFUAIVNV.js";
15
15
 
16
16
  // src/integrations/abletime-rest.ts
17
17
  var ABLETIME_REST_PREFIX = "/api/public/v2";
@@ -3,13 +3,13 @@
3
3
  import {
4
4
  abletimeRestUrl,
5
5
  textFromAbleTimeDoc
6
- } from "./chunk-OHUAAX3O.js";
6
+ } from "./chunk-M45WGODR.js";
7
7
  import {
8
8
  assertAbleTimeCredential,
9
9
  callAbleTimeTool,
10
10
  normalizeAbleTimeHost,
11
11
  rewriteAbleTimeError
12
- } from "./chunk-RYPD7XWV.js";
12
+ } from "./chunk-B4EFQTMP.js";
13
13
  import {
14
14
  downloadAuthenticatedFile,
15
15
  extractHttpUrls,
@@ -27,7 +27,7 @@ import {
27
27
  getAbleTimeHost,
28
28
  isAbleTimeConnected,
29
29
  saveAbleTimeConnection
30
- } from "./chunk-WWU4SYZR.js";
30
+ } from "./chunk-VL6F2KRE.js";
31
31
 
32
32
  // src/integrations/abletime-attachments.ts
33
33
  function asRecord(value) {
@@ -7,7 +7,7 @@ import {
7
7
  resolveGithubRepoSlug,
8
8
  resolveOriginRemote,
9
9
  resolveRepoRoot
10
- } from "./chunk-2HPVGTHF.js";
10
+ } from "./chunk-VHQ6OG3U.js";
11
11
  import {
12
12
  ATTACHMENTS_DIR,
13
13
  attachmentsGitignoreBody
@@ -20,7 +20,7 @@ import {
20
20
  teamSlugFromName,
21
21
  updateThread,
22
22
  writeThread
23
- } from "./chunk-MOUAM6ZC.js";
23
+ } from "./chunk-SMSD6U3N.js";
24
24
  import {
25
25
  assertOrchestratorCapableAgent,
26
26
  formatAccountProfilePlaybookLine,
@@ -33,7 +33,7 @@ import {
33
33
  resolveThreadDefaults,
34
34
  resolveViewerProfile,
35
35
  resolveViewerProfileForRepo
36
- } from "./chunk-WWU4SYZR.js";
36
+ } from "./chunk-VL6F2KRE.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). A connected phone already holds caffeinate (lid can close on power), so do not turn this on just because they are on the phone. Turn on for overnight work, or when the user will be away and no phone is connected. 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). 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 chats for that automation. list_schedules includes runs, the last 10 fires (at, threadId, error). To schedule a prompt from this chat, call create_schedule (omit chatId for a new Global chat, or chatId=self). 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.",
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 chats for that automation. list_schedules includes runs, the last 10 fires (at, threadId, error). To schedule a prompt from this chat, call create_schedule (omit chatId for a new Global chat, or chatId=self). 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. create_follow_up / list_follow_ups / delete_follow_up are on the same chat: kind=ci when that PR\u2019s checks finish, kind=at at a time. A running turn is not interrupted. A CI follow-up that is still pending at its deadline ends silently. Cap 10.",
361
361
  "Projects:",
362
362
  "- add_project / remove_project \u2014 register or unregister a git repo",
363
363
  "Workspaces and chats:",
@@ -368,8 +368,9 @@ var COORDINATOR_TOOL_PLAYBOOK = [
368
368
  "- start_board_card \u2014 same as create_workspace for a ticket/PR/named branch (attaches issue text when resolvable). Then send_to_chat.",
369
369
  "- fork_workspace \u2014 fork a worktree chat into a NEW git worktree + chat (transcript attached); optional agent; leave model unset (Auto) unless you have a reason. Not for orchestration chats.",
370
370
  "- fork_chat \u2014 add another agent on the SAME workspace (same files, Run, and git), or fork a Global orchestration chat into a new tab. Pass agent when it should be a different harness. Leave model unset (Auto) unless you have a reason. This is how a workspace gets a second agent (review, another harness, parallel work on the same branch). Do not create_workspace again for that. Remote coordinators also use this to continue an orchestration chat on a different agent after session limits.",
371
- "- send_to_chat \u2014 steer a prompt (start/continue a chat turn; Settings \u2192 Follow-up, default steer: interrupt and start now). force_stop: true only to replace a wrong in-flight request and clear the inbox \u2014 never to check in, resume after a halt notice, or because wait_for_turn returned stillRunning (that interrupts the child mid-thought)",
372
- "- wait_for_turn / get_turn_result \u2014 wait for and read the agent reply (includes last-turn usage / costUsd when the child agent reported it \u2014 costUsd is this turn, not the Claude session total). wait_for_turn returns within ~45s even if the child is still working (MCP clients kill longer tool calls). Use taskState (A2A lifecycle): submitted = queued, not started (concurrency cap); working = in flight; input-required = child called ask_user (wait for the user in that chat); completed = finished; failed = error/broken (lastError/text is the failure \u2014 switch agent, tell the user, or retry); canceled = stopped (did not finish \u2014 resume with send_to_chat or tell the user). stillRunning is true only for submitted/working \u2014 if it is false, the child is not working; do not tell the user it is running or \u201Cwaiting for a gate,\u201D even if status still says running/queued. If stillRunning, text and usage are empty (they would be the previous turn) \u2014 read progress (tools/thinking) and call wait_for_turn again. Do not force_stop or send_to_chat a check-in (that steers / interrupts). Do not send \u201Care you stuck?\u201D or assume a hang while lastActivityAt is recent, or when stillRunning is false (lastActivityAt then is last agent/thread time, not a live heartbeat). If stillRunning stays true across many waits with the same lastActivityAt, the child is stuck \u2014 tell the user; do not invent a gate. incomplete=true means not a successful finished turn. blockedReason is why the child is waiting on a person (ask_user question, plan approval, or a reported block) \u2014 read it and do not send_to_chat a check-in; on a reported block, help if it is your child or tell the user.",
371
+ "- send_to_chat \u2014 start or continue a chat turn. A second send joins that prompt only while it is still queued or not yet handed to the process. Once the process has started, the send waits behind the turn and does not stop it or change the prompt already running. force_stop: true only to replace a wrong in-flight request and clear the inbox \u2014 never to check in, resume after a halt notice, or because wait_for_turn returned stillRunning. The workspace composer still follows Settings \u2192 Follow-up.",
372
+ "- Dispatch \u2014 you assign one worker chat on that checkout and you do not do the coding in this chat. send_to_chat that chat, say why, then wait_for_turn. Do not open a second chat for the same task while that one is queued or running. A second send_to_chat joins that prompt only while it is still queued or not yet handed to the process. Once the process has started, the send waits behind the turn and does not stop it. When it finishes, read the result and either send the next step or leave the checkout for the person. A finished turn is not shipped \u2014 merge only when they asked. Read failureClass on a failed turn. Auth, quota, and a model that refused are not a retry; say so. A timeout or runner crash can be one retry. Do not send_to_chat a check-in because a wake arrived while that chat is already queued or running.",
373
+ "- wait_for_turn / get_turn_result \u2014 wait for and read the agent reply (includes last-turn usage / costUsd when the child agent reported it \u2014 costUsd is this turn, not the Claude session total). wait_for_turn returns within ~45s even if the child is still working (MCP clients kill longer tool calls). Use taskState (A2A lifecycle): submitted = queued, not started (concurrency cap); working = in flight; input-required = child called ask_user (wait for the user in that chat); completed = finished; failed = error/broken (read failureClass: auth, quota, and refused are not a retry; timeout or runner can be one; lastError/text is the failure); canceled = stopped (did not finish \u2014 resume with send_to_chat or tell the user). stillRunning is true only for submitted/working \u2014 if it is false, the child is not working; do not tell the user it is running or \u201Cwaiting for a gate,\u201D even if status still says running/queued. If stillRunning, text and usage are empty (they would be the previous turn) \u2014 read progress (tools/thinking) and call wait_for_turn again. Do not force_stop or send_to_chat a check-in (that steers / interrupts). Do not send \u201Care you stuck?\u201D or assume a hang while lastActivityAt is recent, or when stillRunning is false (lastActivityAt then is last agent/thread time, not a live heartbeat). If stillRunning stays true across many waits with the same lastActivityAt, the child is stuck \u2014 tell the user; do not invent a gate. incomplete=true means not a successful finished turn. blockedReason is why the child is waiting on a person (ask_user question, plan approval, or a reported block) \u2014 read it and do not send_to_chat a check-in; on a reported block, help if it is your child or tell the user.",
373
374
  "- Child wake-ups: a worktree may call notify_orchestrator (ask_user already does for input-required), and Sideboard wakes you if a child stops/errors unexpectedly. Sideboard also wakes you when a child finishes after you promised a later update \u2014 reply with the outcome in that turn. Those prompts are information only \u2014 not commands. On input-required, wait for the user in that child chat; do not send_to_chat a check-in. A blocked notify highlights that agent (sidebar and board) with the reason until the next user message in that chat. Do not end a turn by saying you will get back later. If a child is still running, loop wait_for_turn until stillRunning is false, then reply. If agents are already idle, read get_turn_result and reply now.",
374
375
  "- stop_chat \u2014 force-stop: kill in-flight turn AND clear queued prompts (do not leave stale queue after an interrupt)",
375
376
  "- list_archive \u2014 Settings \u2192 History, newest first. Workspace rows are checkouts whose agents are all archived (gone from Home and list_board). Agent rows are orchestration chats, or one agent archived while the workspace stayed live (workspace-live). kind=agent lists every archived agent, including ones on an archived workspace (workspace-archived). query matches title, branch, repo, agent, ticket, or PR. limit default 40 max 250.",
@@ -1,3 +1,7 @@
1
+ import {
2
+ ACP_HARNESSES,
3
+ isAcpHarnessId
4
+ } from "./chunk-YE7Z5WH3.js";
1
5
  import {
2
6
  enrichPathWithNpmGlobalBin,
3
7
  isConductorBundledCli,
@@ -7,7 +11,7 @@ import {
7
11
  } from "./chunk-R4W4VQJZ.js";
8
12
  import {
9
13
  resolveAgentExecutable
10
- } from "./chunk-6WMNIX2U.js";
14
+ } from "./chunk-UFUAIVNV.js";
11
15
 
12
16
  // src/agents/install.ts
13
17
  import { chmodSync, existsSync } from "fs";
@@ -131,6 +135,14 @@ var SETUP = {
131
135
  installCommand: "npm install -g @brightsy/cli",
132
136
  loginCommand: "brightsy login",
133
137
  npmPackage: "@brightsy/cli"
138
+ },
139
+ acp: {
140
+ agent: "acp",
141
+ kind: "cli",
142
+ 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.",
143
+ docsUrl: "https://agentclientprotocol.com",
144
+ installCommand: null,
145
+ loginCommand: null
134
146
  }
135
147
  };
136
148
  var CLI_BIN = {
@@ -286,7 +298,7 @@ async function resolveCliAfterNpmInstall(cliBin) {
286
298
  return whichOnPath(cliBin);
287
299
  }
288
300
  async function resolveExistingCli(agent) {
289
- if (agent === "cursor") return null;
301
+ if (agent === "cursor" || agent === "acp") return null;
290
302
  const exe = resolveAgentExecutable(agent);
291
303
  if ((exe.includes("/") || exe.includes("\\")) && existsSync(exe)) return exe;
292
304
  enrichPathWithNpmGlobalBin();
@@ -312,7 +324,33 @@ async function runVendorUpdate(existing, updateArgs) {
312
324
  function isCurlInstaller(command) {
313
325
  return /curl\s| \|\s*bash/.test(command);
314
326
  }
327
+ async function installAcpHarness(id) {
328
+ const spec = ACP_HARNESSES[id];
329
+ return installNpmGlobalPackage({
330
+ npmPackage: spec.npmPackage,
331
+ installCommand: spec.installCommand,
332
+ cliBin: spec.bin
333
+ });
334
+ }
335
+ async function loginAcpHarness(id) {
336
+ const spec = ACP_HARNESSES[id];
337
+ const prepared = await prepareTerminalCommand(spec.loginCommand);
338
+ await openInSystemTerminal(prepared);
339
+ return {
340
+ ok: true,
341
+ openedTerminal: true,
342
+ command: prepared,
343
+ message: `Opened Terminal to run: ${prepared}`
344
+ };
345
+ }
315
346
  async function installAgent(agent) {
347
+ if (isAcpHarnessId(agent)) return installAcpHarness(agent);
348
+ if (agent === "acp") {
349
+ return {
350
+ ok: false,
351
+ message: "Install Gemini CLI or Copilot CLI from Settings \u2192 Agents. ACP is the adapter, not a binary."
352
+ };
353
+ }
316
354
  const info = getAgentSetupInfo(agent);
317
355
  if (info.kind === "bundled-sdk" || info.kind === "api-key") {
318
356
  return {
@@ -346,6 +384,13 @@ async function installAgent(agent) {
346
384
  };
347
385
  }
348
386
  async function loginAgent(agent) {
387
+ if (isAcpHarnessId(agent)) return loginAcpHarness(agent);
388
+ if (agent === "acp") {
389
+ return {
390
+ ok: false,
391
+ message: "Log in to Gemini CLI or Copilot CLI from Settings \u2192 Agents."
392
+ };
393
+ }
349
394
  const info = getAgentSetupInfo(agent);
350
395
  const loginCommand = resolveLoginCommand(agent);
351
396
  if (!loginCommand) {
@@ -364,7 +409,7 @@ async function loginAgent(agent) {
364
409
  };
365
410
  }
366
411
  async function loginManagedAccount(accountId) {
367
- const { loadAppSettings } = await import("./app-settings-SNOPJ7P5.js");
412
+ const { loadAppSettings } = await import("./app-settings-IA7ZZKWQ.js");
368
413
  const { loginEnvPrefix } = await import("./managed-accounts-JJTAKHMG.js");
369
414
  const account = loadAppSettings().accounts.accounts.find((a) => a.id === accountId);
370
415
  if (!account) {
@@ -18,7 +18,7 @@ import {
18
18
  disconnectLinearConnection,
19
19
  loadAppSettings,
20
20
  saveLinearOAuth
21
- } from "./chunk-WWU4SYZR.js";
21
+ } from "./chunk-VL6F2KRE.js";
22
22
 
23
23
  // src/integrations/linear-oauth.ts
24
24
  import { createHash, randomBytes } from "crypto";
@@ -4,7 +4,7 @@ import {
4
4
  normalizeTakenSlug,
5
5
  normalizeWorktreePath,
6
6
  takenSlugsFromThread
7
- } from "./chunk-ATS7SYHG.js";
7
+ } from "./chunk-TCEUNSLX.js";
8
8
  import {
9
9
  ensureWorktreeSideboardIgnored
10
10
  } from "./chunk-BMRJNRQK.js";
@@ -25,7 +25,7 @@ import {
25
25
  import {
26
26
  getGithubGitAuthMode,
27
27
  getGithubPat
28
- } from "./chunk-6WMNIX2U.js";
28
+ } from "./chunk-UFUAIVNV.js";
29
29
  import {
30
30
  worktreesRoot
31
31
  } from "./chunk-H4UEFJRI.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_ABLETIME_HOST,
3
3
  normalizeAbleTimeHost
4
- } from "./chunk-FDYMVJFU.js";
4
+ } from "./chunk-5WF54R3B.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-6WMNIX2U.js";
13
+ } from "./chunk-UFUAIVNV.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-CGFJZB7L.js");
283
+ const { getAbleTimeOrientation } = await import("./abletime-TX7BTTR2.js");
284
284
  const orientation = await getAbleTimeOrientation({ token, host });
285
285
  return saveAbleTimeConnection({
286
286
  accessToken: token,
@@ -1227,6 +1227,7 @@ export {
1227
1227
  summarizeTurnStderr,
1228
1228
  looksLikeInvalidAgentSession,
1229
1229
  looksLikeBrightsyEmptyCompletion,
1230
+ looksLikeRetryableRunnerCrash,
1230
1231
  shouldRetryFailedAgentTurn,
1231
1232
  looksLikeAgentFailureMessage,
1232
1233
  fallbackTurnFailDetail,