@sideboard-ai/core 0.1.330 → 0.1.332

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 (52) hide show
  1. package/dist/agents/cursor-runner.js +2 -2
  2. package/dist/{agents-JXQKHY7Q.js → agents-5FB756FF.js} +8 -8
  3. package/dist/{agents-JH4WV2ZH.js → agents-XEVZ6RY2.js} +7 -7
  4. package/dist/{chunk-NQHTYX35.js → chunk-25KXB7W6.js} +1 -1
  5. package/dist/{chunk-DFKLWWLY.js → chunk-3MOUHIA2.js} +6 -6
  6. package/dist/{chunk-PZ5MVD27.js → chunk-5G5DTQ5N.js} +5 -5
  7. package/dist/{chunk-O7JSWISN.js → chunk-5MJ7FCZ2.js} +1 -1
  8. package/dist/{chunk-DBRQ5NNB.js → chunk-6HGTYZGL.js} +5 -5
  9. package/dist/{chunk-QKHEVSB5.js → chunk-BMRJNRQK.js} +1 -1
  10. package/dist/{chunk-JQWCZGSO.js → chunk-CS6LQUL6.js} +110 -11
  11. package/dist/{chunk-E6LONPQH.js → chunk-E5DFGOAA.js} +39 -27
  12. package/dist/{chunk-KUD24QYI.js → chunk-EHZ24J7U.js} +5 -5
  13. package/dist/{chunk-4YXZOXMT.js → chunk-GK7H3SY7.js} +1 -1
  14. package/dist/{chunk-6U6QRUHY.js → chunk-I6RGRUNY.js} +1 -1
  15. package/dist/{chunk-P4QRDXRY.js → chunk-JJRTVB7D.js} +2 -2
  16. package/dist/{chunk-HCK3UCBJ.js → chunk-KYHW5WYT.js} +42 -29
  17. package/dist/{chunk-U7EANR52.js → chunk-P7S3XGKL.js} +2 -2
  18. package/dist/{chunk-XOIJJRAQ.js → chunk-QNKJCD7B.js} +110 -11
  19. package/dist/{chunk-2TUE6JKQ.js → chunk-R4W4VQJZ.js} +2 -0
  20. package/dist/{chunk-7L36GZA4.js → chunk-RCRDNOAT.js} +1 -1
  21. package/dist/{chunk-YBTSZ2SW.js → chunk-TL2HK6LZ.js} +2 -0
  22. package/dist/{chunk-G45SGI57.js → chunk-UEPTL7UG.js} +1 -1
  23. package/dist/{chunk-NURZOXGN.js → chunk-UGUWFONI.js} +1 -1
  24. package/dist/{chunk-3DJQLQWU.js → chunk-UV33UCV6.js} +3 -3
  25. package/dist/{chunk-S5CJUIPY.js → chunk-XOEKCE6L.js} +5 -5
  26. package/dist/{conductor-FA27ZGCV.js → conductor-5OTVFON5.js} +5 -5
  27. package/dist/{conductor-6DIR7A4N.js → conductor-CVQJEAKE.js} +5 -5
  28. package/dist/{connected-teams-H4LZOJDC.js → connected-teams-2YDE2EZ2.js} +2 -2
  29. package/dist/{connected-teams-XYRZMQO4.js → connected-teams-6756SMAW.js} +2 -2
  30. package/dist/{coordinator-prompt-B6RHGEJK.js → coordinator-prompt-OD6VYETQ.js} +4 -4
  31. package/dist/{coordinator-prompt-KAZXK5FZ.js → coordinator-prompt-XU5KFYI5.js} +4 -4
  32. package/dist/{global-workspace-JKINHUY3.js → global-workspace-EW54B2P4.js} +4 -4
  33. package/dist/{global-workspace-IOKHZCXD.js → global-workspace-P2BW6MJ3.js} +4 -4
  34. package/dist/index.cjs +300 -178
  35. package/dist/index.d.cts +6 -1
  36. package/dist/index.d.ts +6 -1
  37. package/dist/index.js +17 -15
  38. package/dist/mcp/run-stdio.cjs +210 -159
  39. package/dist/mcp/run-stdio.js +10 -10
  40. package/dist/{optional-cli-FOSC4NVE.js → optional-cli-KWIII44P.js} +3 -3
  41. package/dist/{optional-cli-NSQZ2DYK.js → optional-cli-XJE4BELL.js} +4 -4
  42. package/dist/{orchestrator-LI6EBD2Y.js → orchestrator-5X62LJ2T.js} +11 -11
  43. package/dist/{orchestrator-V35TLMXB.js → orchestrator-UKAXA5ZW.js} +10 -10
  44. package/dist/{run-7QMRYP3F.js → run-ARDGUXUN.js} +1 -1
  45. package/dist/{run-UPNCCRCN.js → run-ZKK3VGO5.js} +1 -1
  46. package/dist/{workspaces-OLONQF2C.js → workspaces-CB4SCKVH.js} +4 -4
  47. package/dist/{workspaces-FJL3TL3K.js → workspaces-OY7JIPDE.js} +4 -4
  48. package/dist/{worktree-TX4WXQZV.js → worktree-6WWUWH4K.js} +3 -3
  49. package/dist/{worktree-QSQJ2POO.js → worktree-N435EXSP.js} +3 -3
  50. package/dist/{worktree-exclude-P5NJODWP.js → worktree-exclude-KMZQXZKP.js} +2 -2
  51. package/dist/{worktree-exclude-INRDQFWV.js → worktree-exclude-YQBN43QD.js} +2 -2
  52. package/package.json +1 -1
@@ -20,7 +20,7 @@ import {
20
20
  fetchCursorTurnCostUsd,
21
21
  importCursorSdk,
22
22
  resolveCursorSdkRoot
23
- } from "../chunk-NURZOXGN.js";
23
+ } from "../chunk-UGUWFONI.js";
24
24
  import {
25
25
  TOOL_RESULT_STORE_MAX_CHARS,
26
26
  createCursorStreamToolProgress,
@@ -34,7 +34,7 @@ import "../chunk-6K64FJDD.js";
34
34
  import {
35
35
  cursorSdkStoreDir
36
36
  } from "../chunk-LG6RJBIY.js";
37
- import "../chunk-2TUE6JKQ.js";
37
+ import "../chunk-R4W4VQJZ.js";
38
38
  import "../chunk-SUZOPJZC.js";
39
39
  import {
40
40
  dropNestedElectronEnvFromProcess
@@ -37,7 +37,7 @@ import {
37
37
  planModeTurnInstruction,
38
38
  resolveCursorModelId,
39
39
  resolveQuotaFallbackAgent
40
- } from "./chunk-DFKLWWLY.js";
40
+ } from "./chunk-3MOUHIA2.js";
41
41
  import {
42
42
  getAgentSetupInfo,
43
43
  installAgent,
@@ -49,14 +49,14 @@ import {
49
49
  prepareTerminalCommand,
50
50
  resolveLoginCommand,
51
51
  whichOnPath
52
- } from "./chunk-XOIJJRAQ.js";
53
- import "./chunk-S5CJUIPY.js";
52
+ } from "./chunk-QNKJCD7B.js";
53
+ import "./chunk-XOEKCE6L.js";
54
54
  import "./chunk-ZT5YPYZE.js";
55
55
  import "./chunk-OOXRMTU6.js";
56
- import "./chunk-O7JSWISN.js";
57
- import "./chunk-P4QRDXRY.js";
56
+ import "./chunk-5MJ7FCZ2.js";
57
+ import "./chunk-JJRTVB7D.js";
58
58
  import "./chunk-QVLDZWHZ.js";
59
- import "./chunk-QKHEVSB5.js";
59
+ import "./chunk-BMRJNRQK.js";
60
60
  import "./chunk-RSA47QYR.js";
61
61
  import "./chunk-JAT3JFOS.js";
62
62
  import "./chunk-N6ZF3XRP.js";
@@ -68,7 +68,7 @@ import {
68
68
  preferredCursorCostCents,
69
69
  resolveCursorSdkRoot,
70
70
  turnCostUsdFromCursorUsage
71
- } from "./chunk-NURZOXGN.js";
71
+ } from "./chunk-UGUWFONI.js";
72
72
  import "./chunk-OPXEJJBM.js";
73
73
  import "./chunk-6K64FJDD.js";
74
74
  import "./chunk-LG6RJBIY.js";
@@ -82,7 +82,7 @@ import {
82
82
  posixShellSingleQuote,
83
83
  resolveCommandBinarySync,
84
84
  withExportedPath
85
- } from "./chunk-2TUE6JKQ.js";
85
+ } from "./chunk-R4W4VQJZ.js";
86
86
  import "./chunk-SUZOPJZC.js";
87
87
  import {
88
88
  ORCHESTRATOR_AGENT_KINDS,
@@ -46,7 +46,7 @@ import {
46
46
  resolveCursorSdkRoot,
47
47
  resolveQuotaFallbackAgent,
48
48
  turnCostUsdFromCursorUsage
49
- } from "./chunk-DBRQ5NNB.js";
49
+ } from "./chunk-6HGTYZGL.js";
50
50
  import "./chunk-5MXLDDYF.js";
51
51
  import {
52
52
  getAgentSetupInfo,
@@ -59,15 +59,15 @@ import {
59
59
  prepareTerminalCommand,
60
60
  resolveLoginCommand,
61
61
  whichOnPath
62
- } from "./chunk-JQWCZGSO.js";
63
- import "./chunk-G45SGI57.js";
64
- import "./chunk-U7EANR52.js";
65
- import "./chunk-6U6QRUHY.js";
62
+ } from "./chunk-CS6LQUL6.js";
63
+ import "./chunk-UEPTL7UG.js";
64
+ import "./chunk-P7S3XGKL.js";
65
+ import "./chunk-I6RGRUNY.js";
66
66
  import "./chunk-E63AM3PW.js";
67
67
  import "./chunk-N2WW62LF.js";
68
68
  import "./chunk-2GPQZZLY.js";
69
69
  import "./chunk-NCFYUUSC.js";
70
- import "./chunk-4YXZOXMT.js";
70
+ import "./chunk-GK7H3SY7.js";
71
71
  import {
72
72
  conductorBundledBinDir,
73
73
  enrichPathWithNpmGlobalBin,
@@ -78,7 +78,7 @@ import {
78
78
  posixShellSingleQuote,
79
79
  resolveCommandBinarySync,
80
80
  withExportedPath
81
- } from "./chunk-YBTSZ2SW.js";
81
+ } from "./chunk-TL2HK6LZ.js";
82
82
  import "./chunk-EW5D53VB.js";
83
83
  import "./chunk-WMZIANPV.js";
84
84
  import {
@@ -125,7 +125,7 @@ async function connectedCliPresence(integrations) {
125
125
  const ids = connectedOptionalServices(integrations).filter((spec) => spec.cli).map((spec) => spec.id);
126
126
  if (ids.length === 0) return void 0;
127
127
  try {
128
- const { optionalCliPresence } = await import("./optional-cli-FOSC4NVE.js");
128
+ const { optionalCliPresence } = await import("./optional-cli-KWIII44P.js");
129
129
  return await optionalCliPresence(ids);
130
130
  } catch {
131
131
  return void 0;
@@ -3,7 +3,7 @@ import {
3
3
  brightsyMcpServerName,
4
4
  ensureCliTeamTracked,
5
5
  ensureConnectedBrightsyTeamTokens
6
- } from "./chunk-S5CJUIPY.js";
6
+ } from "./chunk-XOEKCE6L.js";
7
7
  import {
8
8
  listAssignedLinearIssues
9
9
  } from "./chunk-ZT5YPYZE.js";
@@ -15,13 +15,13 @@ import {
15
15
  } from "./chunk-OOXRMTU6.js";
16
16
  import {
17
17
  isOrchestratorThread
18
- } from "./chunk-O7JSWISN.js";
18
+ } from "./chunk-5MJ7FCZ2.js";
19
19
  import {
20
20
  codexUnattendedGitConfigArgs,
21
21
  mergeAgentGitAuthEnv,
22
22
  resolveAgentGitAuthEnv,
23
23
  resolveCodexGitWritableRoots
24
- } from "./chunk-P4QRDXRY.js";
24
+ } from "./chunk-JJRTVB7D.js";
25
25
  import {
26
26
  loadBrightsyConfig
27
27
  } from "./chunk-RSA47QYR.js";
@@ -48,7 +48,7 @@ import {
48
48
  packagedMcpStdioPath,
49
49
  parseCursorRunnerLine,
50
50
  resolveNodeLaunch
51
- } from "./chunk-NURZOXGN.js";
51
+ } from "./chunk-UGUWFONI.js";
52
52
  import {
53
53
  extractJsonErrorMessage,
54
54
  formatUnknownDetail,
@@ -58,7 +58,7 @@ import {
58
58
  import {
59
59
  githubAgentAuthReady,
60
60
  run
61
- } from "./chunk-2TUE6JKQ.js";
61
+ } from "./chunk-R4W4VQJZ.js";
62
62
  import {
63
63
  AGENT_RPC_CLAUDE_SDK_SERVER,
64
64
  AGENT_RPC_CWD_ENV,
@@ -2659,7 +2659,7 @@ var claudeAdapter = {
2659
2659
  );
2660
2660
  }
2661
2661
  const mode = permissionMode(thread);
2662
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-JKINHUY3.js");
2662
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-EW54B2P4.js");
2663
2663
  const isOrchestrator = isOrchestratorThread2(thread);
2664
2664
  const rpc = worktreeAgentRpc(isOrchestrator);
2665
2665
  const injectedServers = await buildInjectedMcpServers({
@@ -11,11 +11,11 @@ import {
11
11
  isGlobalThread,
12
12
  isOrchestratorThread,
13
13
  isSlackCoordinatorThread
14
- } from "./chunk-G45SGI57.js";
14
+ } from "./chunk-UEPTL7UG.js";
15
15
  import {
16
16
  mergeAgentGitAuthEnv,
17
17
  resolveAgentGitAuthEnv
18
- } from "./chunk-U7EANR52.js";
18
+ } from "./chunk-P7S3XGKL.js";
19
19
  import {
20
20
  ATTACHMENTS_DIR,
21
21
  DETACHED_JOBS_DIR,
@@ -24,11 +24,11 @@ import {
24
24
  } from "./chunk-N2WW62LF.js";
25
25
  import {
26
26
  ensureWorktreeSideboardIgnored
27
- } from "./chunk-4YXZOXMT.js";
27
+ } from "./chunk-GK7H3SY7.js";
28
28
  import {
29
29
  ensureAgentPath,
30
30
  run
31
- } from "./chunk-YBTSZ2SW.js";
31
+ } from "./chunk-TL2HK6LZ.js";
32
32
  import {
33
33
  REVIEW_TAB_TITLE,
34
34
  allocateTeamName,
@@ -1696,7 +1696,7 @@ var PORT_RANGE_SIZE = 10;
1696
1696
  var RECLAIM_RETRY_DELAY_MS = 40;
1697
1697
  var RECLAIM_TRIES = 8;
1698
1698
  async function killReclaimable(ports, worktreePath, signal) {
1699
- const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-6DIR7A4N.js");
1699
+ const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-CVQJEAKE.js");
1700
1700
  if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
1701
1701
  else killListenersOnPorts2(ports);
1702
1702
  }
@@ -5,7 +5,7 @@ import {
5
5
  resolveGithubRepoSlug,
6
6
  resolveOriginRemote,
7
7
  resolveRepoRoot
8
- } from "./chunk-P4QRDXRY.js";
8
+ } from "./chunk-JJRTVB7D.js";
9
9
  import {
10
10
  allocateTeamName,
11
11
  createEmptyThread,
@@ -12,19 +12,19 @@ import {
12
12
  } from "./chunk-5MXLDDYF.js";
13
13
  import {
14
14
  isOrchestratorThread
15
- } from "./chunk-G45SGI57.js";
15
+ } from "./chunk-UEPTL7UG.js";
16
16
  import {
17
17
  codexUnattendedGitConfigArgs,
18
18
  mergeAgentGitAuthEnv,
19
19
  resolveAgentGitAuthEnv,
20
20
  resolveCodexGitWritableRoots
21
- } from "./chunk-U7EANR52.js";
21
+ } from "./chunk-P7S3XGKL.js";
22
22
  import {
23
23
  applyConnectedTeamToCli,
24
24
  brightsyMcpServerName,
25
25
  ensureCliTeamTracked,
26
26
  ensureConnectedBrightsyTeamTokens
27
- } from "./chunk-6U6QRUHY.js";
27
+ } from "./chunk-I6RGRUNY.js";
28
28
  import {
29
29
  loadBrightsyConfig
30
30
  } from "./chunk-E63AM3PW.js";
@@ -38,7 +38,7 @@ import {
38
38
  githubAgentAuthReady,
39
39
  npmGlobalNodeModules,
40
40
  run
41
- } from "./chunk-YBTSZ2SW.js";
41
+ } from "./chunk-TL2HK6LZ.js";
42
42
  import {
43
43
  BASE_ALLOWED_TOOLS,
44
44
  CLAUDE_CHROME_ALLOWED_TOOLS,
@@ -2966,7 +2966,7 @@ var claudeAdapter = {
2966
2966
  );
2967
2967
  }
2968
2968
  const mode = permissionMode(thread);
2969
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-IOKHZCXD.js");
2969
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-P2BW6MJ3.js");
2970
2970
  const isOrchestrator = isOrchestratorThread2(thread);
2971
2971
  const rpc = worktreeAgentRpc(isOrchestrator);
2972
2972
  const injectedServers = await buildInjectedMcpServers({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  git
3
- } from "./chunk-2TUE6JKQ.js";
3
+ } from "./chunk-R4W4VQJZ.js";
4
4
 
5
5
  // src/git/worktree-exclude.ts
6
6
  import { mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -6,22 +6,93 @@ import {
6
6
  resolveCommandBinarySync,
7
7
  run,
8
8
  withExportedPath
9
- } from "./chunk-YBTSZ2SW.js";
9
+ } from "./chunk-TL2HK6LZ.js";
10
10
  import {
11
11
  resolveAgentExecutable
12
12
  } from "./chunk-7BAS6DF7.js";
13
13
 
14
14
  // src/agents/install.ts
15
- import { existsSync } from "fs";
15
+ import { chmodSync, existsSync } from "fs";
16
+ import { join } from "path";
17
+
18
+ // src/agents/install-native.ts
19
+ var CLAUDE_NATIVE_INSTALL = "curl -fsSL https://claude.ai/install.sh | bash";
20
+ var OPENCODE_NATIVE_INSTALL = "curl -fsSL https://opencode.ai/install | bash";
21
+ async function installCurlScript(opts) {
22
+ const result = await run("bash", ["-c", opts.command], {
23
+ reject: false,
24
+ timeoutMs: 3e5
25
+ });
26
+ if (result.exitCode === 0) {
27
+ const binPath = await whichOnPath(opts.bin);
28
+ if (binPath) {
29
+ return {
30
+ ok: true,
31
+ command: opts.command,
32
+ exitCode: 0,
33
+ stdout: result.stdout,
34
+ stderr: result.stderr,
35
+ message: `Installed ${opts.label} \u2192 ${binPath}`
36
+ };
37
+ }
38
+ return {
39
+ ok: false,
40
+ command: opts.command,
41
+ exitCode: result.exitCode,
42
+ stdout: result.stdout,
43
+ stderr: result.stderr,
44
+ message: `${opts.label} installer finished, but \`${opts.bin}\` is not on PATH. Expected ${opts.expected}.`
45
+ };
46
+ }
47
+ const detail = result.stderr.trim() || result.stdout.trim();
48
+ try {
49
+ await openInSystemTerminal(opts.command);
50
+ return {
51
+ ok: false,
52
+ openedTerminal: true,
53
+ command: opts.command,
54
+ exitCode: result.exitCode,
55
+ stdout: result.stdout,
56
+ stderr: result.stderr,
57
+ message: `${opts.label} install failed (exit ${result.exitCode}). Opened Terminal with: ${opts.command}`
58
+ };
59
+ } catch {
60
+ return {
61
+ ok: false,
62
+ command: opts.command,
63
+ exitCode: result.exitCode,
64
+ stdout: result.stdout,
65
+ stderr: result.stderr,
66
+ message: detail ? `${opts.label} install failed (exit ${result.exitCode}). ${detail}` : `${opts.label} install failed (exit ${result.exitCode})`
67
+ };
68
+ }
69
+ }
70
+ function installClaudeNative() {
71
+ return installCurlScript({
72
+ command: CLAUDE_NATIVE_INSTALL,
73
+ bin: "claude",
74
+ label: "Claude Code",
75
+ expected: "~/.local/bin/claude"
76
+ });
77
+ }
78
+ function installOpenCodeNative() {
79
+ return installCurlScript({
80
+ command: OPENCODE_NATIVE_INSTALL,
81
+ bin: "opencode",
82
+ label: "OpenCode",
83
+ expected: "~/.opencode/bin/opencode"
84
+ });
85
+ }
86
+
87
+ // src/agents/install.ts
16
88
  var SETUP = {
17
89
  claude: {
18
90
  agent: "claude",
19
91
  kind: "cli",
20
- summary: "Install the Claude Code CLI, then complete login in a terminal.",
92
+ summary: "Install Claude Code, then complete login in a terminal.",
21
93
  docsUrl: "https://code.claude.com/docs/en/install",
22
- installCommand: "npm install -g @anthropic-ai/claude-code",
94
+ installCommand: CLAUDE_NATIVE_INSTALL,
23
95
  loginCommand: "claude auth login",
24
- npmPackage: "@anthropic-ai/claude-code",
25
96
  updateArgs: ["update"]
26
97
  },
27
98
  codex: {
@@ -37,12 +108,12 @@ var SETUP = {
37
108
  opencode: {
38
109
  agent: "opencode",
39
110
  kind: "cli",
40
- summary: "Install OpenCode (curl installer or npm), then authenticate providers.",
111
+ summary: "Install OpenCode, then authenticate providers.",
41
112
  docsUrl: "https://opencode.ai/docs",
42
- // Prefer the official installer; npm package name is opencode-ai.
43
- installCommand: "curl -fsSL https://opencode.ai/install | bash",
113
+ // npm package `opencode-ai` ships the same kind of non-executable native stub
114
+ // as Claude. The curl installer writes ~/.opencode/bin/opencode.
115
+ installCommand: OPENCODE_NATIVE_INSTALL,
44
116
  loginCommand: "opencode auth login",
45
- npmPackage: "opencode-ai@latest",
46
117
  updateArgs: ["upgrade"]
47
118
  },
48
119
  cursor: {
@@ -179,7 +250,17 @@ async function installNpmGlobalPackage(opts) {
179
250
  }
180
251
  }
181
252
  enrichPathWithNpmGlobalBin();
182
- const binPath = opts.cliBin ? await whichOnPath(opts.cliBin) : null;
253
+ const binPath = opts.cliBin ? await resolveCliAfterNpmInstall(opts.cliBin) : null;
254
+ if (opts.cliBin && !binPath) {
255
+ return {
256
+ ok: false,
257
+ command: opts.installCommand,
258
+ exitCode: 0,
259
+ stdout: result.stdout,
260
+ stderr: result.stderr,
261
+ message: `Installed ${opts.npmPackage}, but \`${opts.cliBin}\` is not on PATH.`
262
+ };
263
+ }
183
264
  return {
184
265
  ok: true,
185
266
  command: opts.installCommand,
@@ -187,9 +268,25 @@ async function installNpmGlobalPackage(opts) {
187
268
  stdout: result.stdout,
188
269
  stderr: result.stderr,
189
270
  // Library-only packages (`@cursor/sdk`) have no CLI to look for.
190
- message: !opts.cliBin ? `Installed ${opts.npmPackage}` : binPath ? `Installed ${opts.npmPackage} \u2192 ${binPath}` : `Installed ${opts.npmPackage} (CLI not yet on PATH)`
271
+ message: !opts.cliBin ? `Installed ${opts.npmPackage}` : `Installed ${opts.npmPackage} \u2192 ${binPath}`
191
272
  };
192
273
  }
274
+ async function resolveCliAfterNpmInstall(cliBin) {
275
+ const found = await whichOnPath(cliBin);
276
+ if (found) return found;
277
+ const prefix = await run("npm", ["prefix", "-g"], { reject: false, timeoutMs: 8e3 });
278
+ if (prefix.exitCode !== 0) return null;
279
+ const root = prefix.stdout.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.startsWith("/")).pop();
280
+ if (!root) return null;
281
+ const candidate = join(root, "bin", cliBin);
282
+ if (!existsSync(candidate)) return null;
283
+ try {
284
+ chmodSync(candidate, 493);
285
+ } catch {
286
+ }
287
+ enrichPathWithNpmGlobalBin();
288
+ return whichOnPath(cliBin);
289
+ }
193
290
  async function resolveExistingCli(agent) {
194
291
  if (agent === "cursor") return null;
195
292
  const exe = resolveAgentExecutable(agent);
@@ -232,6 +329,8 @@ async function installAgent(agent) {
232
329
  if (existing && info.updateArgs?.length) {
233
330
  return runVendorUpdate(existing, info.updateArgs);
234
331
  }
332
+ if (agent === "claude") return installClaudeNative();
333
+ if (agent === "opencode") return installOpenCodeNative();
235
334
  if (info.npmPackage && !isCurlInstaller(info.installCommand)) {
236
335
  const cliBin = agent === "cursor" ? null : CLI_BIN[agent];
237
336
  return installNpmGlobalPackage({
@@ -14,7 +14,7 @@ import {
14
14
  parseSessionQuotaResetAt,
15
15
  planModeTurnInstruction,
16
16
  resolveQuotaFallbackAgent
17
- } from "./chunk-DBRQ5NNB.js";
17
+ } from "./chunk-6HGTYZGL.js";
18
18
  import {
19
19
  applyWorktreePkgCacheEnv,
20
20
  askBlockStillWaiting,
@@ -53,7 +53,7 @@ import {
53
53
  worktreeDevProcessKey,
54
54
  worktreeRunProcessKey,
55
55
  worktreeSetupProcessKey
56
- } from "./chunk-PZ5MVD27.js";
56
+ } from "./chunk-5G5DTQ5N.js";
57
57
  import {
58
58
  applyAgentEvent,
59
59
  clipAgentEventForPaint,
@@ -87,7 +87,7 @@ import {
87
87
  import {
88
88
  formatOptionalServicesDirectiveForTurn,
89
89
  formatOptionalServicesReminderForTurn
90
- } from "./chunk-NQHTYX35.js";
90
+ } from "./chunk-25KXB7W6.js";
91
91
  import {
92
92
  extractPresentedPlan,
93
93
  isPresentPlanToolName,
@@ -118,7 +118,7 @@ import {
118
118
  stageAbsolutePathsAsAttachments,
119
119
  stageBuffersAsAttachments,
120
120
  syncWorkspacesFromThreads
121
- } from "./chunk-G45SGI57.js";
121
+ } from "./chunk-UEPTL7UG.js";
122
122
  import {
123
123
  addPrStackLayer,
124
124
  allocateTeamSlug,
@@ -167,7 +167,7 @@ import {
167
167
  resolveRepoRoot,
168
168
  switchWorktreeBranch,
169
169
  withRepoGitLock
170
- } from "./chunk-U7EANR52.js";
170
+ } from "./chunk-P7S3XGKL.js";
171
171
  import {
172
172
  issueActivityKind
173
173
  } from "./chunk-OYRN356W.js";
@@ -178,7 +178,7 @@ import {
178
178
  gh,
179
179
  git,
180
180
  resolveGitDirsForLockRecovery
181
- } from "./chunk-YBTSZ2SW.js";
181
+ } from "./chunk-TL2HK6LZ.js";
182
182
  import {
183
183
  REVIEW_TAB_TITLE,
184
184
  agentNicknameFromWorktreePath,
@@ -561,9 +561,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
561
561
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
562
562
  );
563
563
  }
564
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-IOKHZCXD.js");
564
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-P2BW6MJ3.js");
565
565
  if (isGlobalThread2(thread)) {
566
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-B6RHGEJK.js");
566
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-OD6VYETQ.js");
567
567
  ensureGlobalCoordinatorCwd2(
568
568
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
569
569
  );
@@ -3836,7 +3836,7 @@ async function adoptThread(input) {
3836
3836
  throw new Error(`Worktree not found: ${input.worktreePath}`);
3837
3837
  }
3838
3838
  const repoPath = await resolveRepoRoot(input.worktreePath);
3839
- const { stdout: branch } = await import("./run-UPNCCRCN.js").then(
3839
+ const { stdout: branch } = await import("./run-ZKK3VGO5.js").then(
3840
3840
  ({ git: git2 }) => git2(["rev-parse", "--abbrev-ref", "HEAD"], input.worktreePath)
3841
3841
  );
3842
3842
  const thread = createEmptyThread({
@@ -3851,9 +3851,9 @@ async function adoptThread(input) {
3851
3851
  messages: input.messages ?? []
3852
3852
  });
3853
3853
  writeThread(thread);
3854
- const { addWorkspace: addWorkspace2 } = await import("./workspaces-FJL3TL3K.js");
3854
+ const { addWorkspace: addWorkspace2 } = await import("./workspaces-OY7JIPDE.js");
3855
3855
  await addWorkspace2(repoPath);
3856
- const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-P5NJODWP.js");
3856
+ const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-KMZQXZKP.js");
3857
3857
  await ensureWorktreeSideboardIgnored(input.worktreePath);
3858
3858
  return thread;
3859
3859
  }
@@ -5424,7 +5424,7 @@ async function confirmLand(thread, opts) {
5424
5424
  if (preview.dirty) {
5425
5425
  committed = await commitAll(thread.worktreePath, meta.commitMessage);
5426
5426
  }
5427
- const { git: git2 } = await import("./run-UPNCCRCN.js");
5427
+ const { git: git2 } = await import("./run-ZKK3VGO5.js");
5428
5428
  const { stdout: headOut } = await git2(
5429
5429
  ["rev-parse", "--abbrev-ref", "HEAD"],
5430
5430
  thread.worktreePath,
@@ -5848,6 +5848,19 @@ function joinSteerPrompt(base, addition) {
5848
5848
  return `${head}
5849
5849
  ${next}`;
5850
5850
  }
5851
+ function messagesWithRewrittenUserPrompt(messages, from, to) {
5852
+ if (from === to) return null;
5853
+ const next = messages.slice();
5854
+ for (let i = next.length - 1; i >= 0; i--) {
5855
+ const message = next[i];
5856
+ if (!message || message.origin === "continue" || message.role === "summary") continue;
5857
+ if (message.role !== "user") continue;
5858
+ if (message.text !== from) return null;
5859
+ next[i] = { ...message, text: to };
5860
+ return next;
5861
+ }
5862
+ return null;
5863
+ }
5851
5864
  function trailingUnansweredUserText(messages) {
5852
5865
  for (let i = messages.length - 1; i >= 0; i--) {
5853
5866
  const message = messages[i];
@@ -5927,22 +5940,21 @@ function resolveSendFollowUp(thread, requested) {
5927
5940
  return isOrchestratorThread(thread) ? followUpBehavior() : "queue";
5928
5941
  }
5929
5942
  function rewriteTrailingUserPrompt(threadId, from, to) {
5930
- if (from === to) return;
5931
5943
  const thread = readThread(threadId);
5932
5944
  if (!thread) return;
5933
- const messages = thread.messages.slice();
5945
+ const messages = messagesWithRewrittenUserPrompt(thread.messages, from, to);
5946
+ if (!messages) return;
5947
+ updateThread(threadId, { messages });
5948
+ }
5949
+ function reuseJoinedUserBubble(reused, threadId, messages, promptText) {
5950
+ if (!reused.delete(threadId)) return false;
5934
5951
  for (let i = messages.length - 1; i >= 0; i--) {
5935
5952
  const message = messages[i];
5936
5953
  if (!message || message.origin === "continue" || message.role === "summary") continue;
5937
- if (message.role === "user" && message.text === from) {
5938
- messages[i] = { ...message, text: to };
5939
- updateThread(threadId, { messages });
5940
- }
5941
- return;
5954
+ if (message.role !== "user") continue;
5955
+ return message.text === promptText;
5942
5956
  }
5943
- }
5944
- function reuseJoinedUserBubble(reused, threadId, last, promptText) {
5945
- return reused.delete(threadId) && last?.role === "user" && last.origin !== "continue" && last.text === promptText;
5957
+ return false;
5946
5958
  }
5947
5959
  function promptForJoinedSteer(input) {
5948
5960
  if (input.latestPrompt === input.promptText) return input.agentPrompt;
@@ -6793,7 +6805,7 @@ function formatScheduledPrompt(name, prompt) {
6793
6805
  ${prompt}`;
6794
6806
  }
6795
6807
  async function defaultDeps() {
6796
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-V35TLMXB.js");
6808
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-UKAXA5ZW.js");
6797
6809
  const orch = getOrchestrator2();
6798
6810
  return {
6799
6811
  findThread: (id) => findThreadByRef(id),
@@ -7809,8 +7821,8 @@ var Orchestrator = class {
7809
7821
  const parked = takePendingTurnAttachments(thread);
7810
7822
  const sentAttachments = !autoContinue && parked.length > 0 ? parked : void 0;
7811
7823
  if (!autoContinue) clearAgentBlock(threadId);
7812
- const lastShown = this.requireThread(threadId).messages.at(-1);
7813
- if (!reuseJoinedUserBubble(this.reusedUserPrompt, threadId, lastShown, promptText)) {
7824
+ const shown = this.requireThread(threadId).messages;
7825
+ if (!reuseJoinedUserBubble(this.reusedUserPrompt, threadId, shown, promptText)) {
7814
7826
  appendMessage(threadId, {
7815
7827
  role: "user",
7816
7828
  text: promptText,
@@ -9625,7 +9637,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
9625
9637
  await withRepoGitLock(thread.repoPath, async () => {
9626
9638
  await git(["worktree", "add", dest, thread.branchName], thread.repoPath);
9627
9639
  });
9628
- const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-P5NJODWP.js");
9640
+ const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-KMZQXZKP.js");
9629
9641
  await ensureWorktreeSideboardIgnored(dest);
9630
9642
  }
9631
9643
  const restorePatch = {};
@@ -9731,7 +9743,7 @@ async function startOrchestration(opts) {
9731
9743
  sourceRef: "default",
9732
9744
  ...createOpts
9733
9745
  }).catch(async () => {
9734
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-QSQJ2POO.js");
9746
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-N435EXSP.js");
9735
9747
  const repo = await resolveRepoRoot2(repoPath);
9736
9748
  const def = await resolveDefaultBranch2(repo);
9737
9749
  return orch.createThread({
@@ -8,11 +8,11 @@ import {
8
8
  isGlobalThread,
9
9
  isOrchestratorThread,
10
10
  isSlackCoordinatorThread
11
- } from "./chunk-O7JSWISN.js";
11
+ } from "./chunk-5MJ7FCZ2.js";
12
12
  import {
13
13
  mergeAgentGitAuthEnv,
14
14
  resolveAgentGitAuthEnv
15
- } from "./chunk-P4QRDXRY.js";
15
+ } from "./chunk-JJRTVB7D.js";
16
16
  import {
17
17
  REVIEW_TAB_TITLE,
18
18
  allocateTeamName,
@@ -27,7 +27,7 @@ import {
27
27
  } from "./chunk-QVLDZWHZ.js";
28
28
  import {
29
29
  ensureWorktreeSideboardIgnored
30
- } from "./chunk-QKHEVSB5.js";
30
+ } from "./chunk-BMRJNRQK.js";
31
31
  import {
32
32
  extractPendingPlanQuestions,
33
33
  isAskUserToolName,
@@ -45,7 +45,7 @@ import {
45
45
  import {
46
46
  ensureAgentPath,
47
47
  run
48
- } from "./chunk-2TUE6JKQ.js";
48
+ } from "./chunk-R4W4VQJZ.js";
49
49
  import {
50
50
  assertOrchestratorCapableAgent,
51
51
  contextTokens
@@ -1664,7 +1664,7 @@ var PORT_RANGE_SIZE = 10;
1664
1664
  var RECLAIM_RETRY_DELAY_MS = 40;
1665
1665
  var RECLAIM_TRIES = 8;
1666
1666
  async function killReclaimable(ports, worktreePath, signal) {
1667
- const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-FA27ZGCV.js");
1667
+ const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-5OTVFON5.js");
1668
1668
  if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
1669
1669
  else killListenersOnPorts2(ports);
1670
1670
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  import {
4
4
  git
5
- } from "./chunk-YBTSZ2SW.js";
5
+ } from "./chunk-TL2HK6LZ.js";
6
6
 
7
7
  // src/git/worktree-exclude.ts
8
8
  import { mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-E63AM3PW.js";
11
11
  import {
12
12
  run
13
- } from "./chunk-YBTSZ2SW.js";
13
+ } from "./chunk-TL2HK6LZ.js";
14
14
  import {
15
15
  appDataDir
16
16
  } from "./chunk-WOU343SI.js";