@sideboard-ai/core 0.1.286 → 0.1.288
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.
- package/dist/{abletime-I4RODUKT.js → abletime-4WJUVE64.js} +4 -4
- package/dist/{abletime-4CH2IOX5.js → abletime-VFKYNSJT.js} +4 -4
- package/dist/{abletime-oauth-7OZZ3ABX.js → abletime-oauth-FW24YHYX.js} +3 -3
- package/dist/{abletime-oauth-C2HN2Q6F.js → abletime-oauth-ICMB2XV2.js} +3 -3
- package/dist/{abletime-rest-E4LBRFLM.js → abletime-rest-HFMRTUDT.js} +3 -3
- package/dist/{abletime-rest-WFI2HWBU.js → abletime-rest-OGWC7BC6.js} +3 -3
- package/dist/agents/cursor-runner.js +3 -3
- package/dist/{agents-BHUXZ7XO.js → agents-GZLTMGSH.js} +19 -17
- package/dist/{agents-QNIFTZPN.js → agents-UQMHFZSM.js} +17 -15
- package/dist/{app-settings-EQQZQNYD.js → app-settings-EHMXHNG5.js} +1 -1
- package/dist/{app-settings-NI4X5HW3.js → app-settings-MR2U6AXN.js} +1 -1
- package/dist/{chunk-3H5U4QLD.js → chunk-2N77CLRQ.js} +8 -298
- package/dist/{chunk-YNTXWFXT.js → chunk-36J3IZBS.js} +12 -12
- package/dist/{chunk-IJMUYHPT.js → chunk-3E4NOIXN.js} +3 -3
- package/dist/{chunk-5MGLNVNK.js → chunk-3W5SL5EW.js} +1 -1
- package/dist/{chunk-CBIUGGPI.js → chunk-442O6OXM.js} +25 -127
- package/dist/chunk-4BXRRHDC.js +139 -0
- package/dist/{chunk-ETZPTOK7.js → chunk-4NM72HJZ.js} +5 -5
- package/dist/{chunk-PCNH74SF.js → chunk-6NVQNTJO.js} +10 -300
- package/dist/{chunk-VOIWX5HA.js → chunk-7UUILVMV.js} +1 -1
- package/dist/chunk-AF2DMY3K.js +295 -0
- package/dist/{chunk-5QOLFOAX.js → chunk-AFLNFGGB.js} +1 -1
- package/dist/{chunk-5T4YWFLD.js → chunk-AHH5USEA.js} +2 -2
- package/dist/{chunk-6CVVNAIU.js → chunk-B3BPLPKQ.js} +2 -2
- package/dist/{chunk-MGJ7R7UX.js → chunk-DBOFDEQ7.js} +4 -4
- package/dist/{chunk-VQEARG5H.js → chunk-GU6DT6NO.js} +5 -5
- package/dist/{chunk-K5XSTHHP.js → chunk-HNB2HTCV.js} +1 -1
- package/dist/{chunk-ULSY2BJF.js → chunk-IA4MPG7F.js} +4 -4
- package/dist/{chunk-S2OOM7AU.js → chunk-K6IOJI3L.js} +1 -1
- package/dist/{chunk-U6QDXT4K.js → chunk-MIVX7QKI.js} +1 -1
- package/dist/{chunk-WRIMAEF2.js → chunk-MVZO7QZ2.js} +12 -12
- package/dist/{chunk-LS4FFCPL.js → chunk-MYJYINTS.js} +3 -3
- package/dist/{chunk-DEJALWKM.js → chunk-NFPWLDCH.js} +5 -5
- package/dist/chunk-NXXQFLNQ.js +300 -0
- package/dist/chunk-OH4EN323.js +89 -0
- package/dist/chunk-W2KZTDET.js +302 -0
- package/dist/{chunk-ABOH7GBG.js → chunk-WQSIUZEB.js} +6 -6
- package/dist/{chunk-HJNFK5SP.js → chunk-WW5XGEMY.js} +33 -313
- package/dist/{chunk-TMM4FEZ5.js → chunk-Y67TBJD5.js} +3 -3
- package/dist/{chunk-XSDCLM3F.js → chunk-YSLCWCMJ.js} +1 -1
- package/dist/{conductor-RBJYEF7L.js → conductor-MCU63Z5U.js} +5 -5
- package/dist/{conductor-WYOWFB7I.js → conductor-ZLYZVIAV.js} +6 -6
- package/dist/{coordinator-prompt-R42WEL3T.js → coordinator-prompt-KHCXXDRO.js} +3 -3
- package/dist/{coordinator-prompt-5DE3XBNT.js → coordinator-prompt-UV6THLMD.js} +3 -3
- package/dist/{global-workspace-IPIEC6FM.js → global-workspace-AXTSYVAE.js} +3 -3
- package/dist/{global-workspace-NXMYLS34.js → global-workspace-GDHZSFP6.js} +3 -3
- package/dist/index.cjs +470 -275
- package/dist/index.d.cts +29 -9
- package/dist/index.d.ts +29 -9
- package/dist/index.js +369 -256
- package/dist/mcp/run-stdio.cjs +603 -226
- package/dist/mcp/run-stdio.js +333 -187
- package/dist/optional-cli-6SW4OOX3.js +23 -0
- package/dist/optional-cli-FRUZSZ3U.js +98 -0
- package/dist/{orchestrator-YEZV35G7.js → orchestrator-5ZBHR6BJ.js} +9 -7
- package/dist/{orchestrator-65QGA6BB.js → orchestrator-SDH6W6ZL.js} +12 -10
- package/dist/{workspaces-LIFFWK23.js → workspaces-L2UR4KC2.js} +3 -3
- package/dist/{workspaces-5C5ESWPU.js → workspaces-Q2R2XGO3.js} +3 -3
- package/dist/{worktree-NKLNVNXX.js → worktree-2GOK4VYT.js} +2 -2
- package/dist/{worktree-YTZC3UQN.js → worktree-YEUTJ7MZ.js} +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OPTIONAL_SERVICES,
|
|
3
|
+
isOptionalServiceId,
|
|
4
|
+
optionalServiceSpec
|
|
5
|
+
} from "./chunk-AF2DMY3K.js";
|
|
6
|
+
import {
|
|
7
|
+
installNpmGlobalPackage,
|
|
8
|
+
whichOnPath
|
|
9
|
+
} from "./chunk-NXXQFLNQ.js";
|
|
10
|
+
import {
|
|
11
|
+
enrichPathWithNpmGlobalBin
|
|
12
|
+
} from "./chunk-QVN2WOKJ.js";
|
|
13
|
+
|
|
14
|
+
// src/integrations/optional-cli.ts
|
|
15
|
+
async function detectOptionalServiceClis() {
|
|
16
|
+
enrichPathWithNpmGlobalBin();
|
|
17
|
+
return Promise.all(
|
|
18
|
+
OPTIONAL_SERVICES.map(async (spec) => {
|
|
19
|
+
if (!spec.cli) {
|
|
20
|
+
return { id: spec.id, cli: null, installed: false, path: null };
|
|
21
|
+
}
|
|
22
|
+
const path = await whichOnPath(spec.cli);
|
|
23
|
+
return {
|
|
24
|
+
id: spec.id,
|
|
25
|
+
cli: spec.cli,
|
|
26
|
+
installed: Boolean(path),
|
|
27
|
+
path
|
|
28
|
+
};
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
var CLI_PRESENCE_TTL_MS = 6e4;
|
|
33
|
+
var cliPresenceCache = /* @__PURE__ */ new Map();
|
|
34
|
+
function clearOptionalCliPresenceCache() {
|
|
35
|
+
cliPresenceCache.clear();
|
|
36
|
+
}
|
|
37
|
+
async function optionalCliPresence(ids) {
|
|
38
|
+
const presence = {};
|
|
39
|
+
const now = Date.now();
|
|
40
|
+
await Promise.all(
|
|
41
|
+
ids.map(async (id) => {
|
|
42
|
+
const spec = optionalServiceSpec(id);
|
|
43
|
+
if (!spec.cli) return;
|
|
44
|
+
const hit = cliPresenceCache.get(id);
|
|
45
|
+
if (hit && now - hit.at < CLI_PRESENCE_TTL_MS) {
|
|
46
|
+
presence[id] = hit.installed;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const path = await whichOnPath(spec.cli);
|
|
50
|
+
const installed = Boolean(path);
|
|
51
|
+
cliPresenceCache.set(id, { at: now, installed });
|
|
52
|
+
presence[id] = installed;
|
|
53
|
+
})
|
|
54
|
+
);
|
|
55
|
+
return presence;
|
|
56
|
+
}
|
|
57
|
+
async function installOptionalServiceCli(id) {
|
|
58
|
+
if (!isOptionalServiceId(id)) {
|
|
59
|
+
return { ok: false, message: "Unknown optional service" };
|
|
60
|
+
}
|
|
61
|
+
const spec = optionalServiceSpec(id);
|
|
62
|
+
if (!spec.cli || !spec.npmPackage) {
|
|
63
|
+
return {
|
|
64
|
+
ok: false,
|
|
65
|
+
message: `${spec.label} has no CLI to install. Agents call posthog_api.`
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
enrichPathWithNpmGlobalBin();
|
|
69
|
+
const existing = await whichOnPath(spec.cli);
|
|
70
|
+
if (existing) {
|
|
71
|
+
return {
|
|
72
|
+
ok: true,
|
|
73
|
+
command: existing,
|
|
74
|
+
message: `Already on PATH: ${existing}`
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return installNpmGlobalPackage({
|
|
78
|
+
npmPackage: spec.npmPackage,
|
|
79
|
+
installCommand: `npm install -g ${spec.npmPackage}`,
|
|
80
|
+
cliBin: spec.cli
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
detectOptionalServiceClis,
|
|
86
|
+
clearOptionalCliPresenceCache,
|
|
87
|
+
optionalCliPresence,
|
|
88
|
+
installOptionalServiceCli
|
|
89
|
+
};
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
enrichPathWithNpmGlobalBin,
|
|
5
|
+
isConductorBundledCli,
|
|
6
|
+
resolveCommandBinarySync,
|
|
7
|
+
run,
|
|
8
|
+
withExportedPath
|
|
9
|
+
} from "./chunk-2UG25RMK.js";
|
|
10
|
+
import {
|
|
11
|
+
resolveAgentExecutable
|
|
12
|
+
} from "./chunk-MVZO7QZ2.js";
|
|
13
|
+
|
|
14
|
+
// src/agents/install.ts
|
|
15
|
+
import { existsSync } from "fs";
|
|
16
|
+
var SETUP = {
|
|
17
|
+
claude: {
|
|
18
|
+
agent: "claude",
|
|
19
|
+
kind: "cli",
|
|
20
|
+
summary: "Install the Claude Code CLI, then complete login in a terminal.",
|
|
21
|
+
docsUrl: "https://code.claude.com/docs/en/install",
|
|
22
|
+
installCommand: "npm install -g @anthropic-ai/claude-code",
|
|
23
|
+
loginCommand: "claude auth login",
|
|
24
|
+
npmPackage: "@anthropic-ai/claude-code",
|
|
25
|
+
updateArgs: ["update"]
|
|
26
|
+
},
|
|
27
|
+
codex: {
|
|
28
|
+
agent: "codex",
|
|
29
|
+
kind: "cli",
|
|
30
|
+
summary: "Install the Codex CLI, then run login in a terminal.",
|
|
31
|
+
docsUrl: "https://github.com/openai/codex",
|
|
32
|
+
installCommand: "npm install -g @openai/codex",
|
|
33
|
+
loginCommand: "codex login",
|
|
34
|
+
npmPackage: "@openai/codex",
|
|
35
|
+
updateArgs: ["update"]
|
|
36
|
+
},
|
|
37
|
+
opencode: {
|
|
38
|
+
agent: "opencode",
|
|
39
|
+
kind: "cli",
|
|
40
|
+
summary: "Install OpenCode (curl installer or npm), then authenticate providers.",
|
|
41
|
+
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",
|
|
44
|
+
loginCommand: "opencode auth login",
|
|
45
|
+
npmPackage: "opencode-ai@latest",
|
|
46
|
+
updateArgs: ["upgrade"]
|
|
47
|
+
},
|
|
48
|
+
cursor: {
|
|
49
|
+
agent: "cursor",
|
|
50
|
+
kind: "cli",
|
|
51
|
+
summary: "Install (or update) @cursor/sdk with npm \u2014 Sideboard does not pin it in the app. Then add a CURSOR_API_KEY.",
|
|
52
|
+
docsUrl: "https://www.npmjs.com/package/@cursor/sdk",
|
|
53
|
+
installCommand: "npm install -g @cursor/sdk",
|
|
54
|
+
loginCommand: null,
|
|
55
|
+
npmPackage: "@cursor/sdk"
|
|
56
|
+
},
|
|
57
|
+
brightsy: {
|
|
58
|
+
agent: "brightsy",
|
|
59
|
+
kind: "cli",
|
|
60
|
+
summary: "Install (or update) the Brightsy CLI with npm, then run `brightsy login`.",
|
|
61
|
+
docsUrl: "https://www.npmjs.com/package/@brightsy/cli",
|
|
62
|
+
installCommand: "npm install -g @brightsy/cli",
|
|
63
|
+
loginCommand: "brightsy login",
|
|
64
|
+
npmPackage: "@brightsy/cli"
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var CLI_BIN = {
|
|
68
|
+
claude: "claude",
|
|
69
|
+
codex: "codex",
|
|
70
|
+
opencode: "opencode",
|
|
71
|
+
brightsy: "brightsy"
|
|
72
|
+
};
|
|
73
|
+
function getAgentSetupInfo(agent) {
|
|
74
|
+
return SETUP[agent];
|
|
75
|
+
}
|
|
76
|
+
function listAgentSetupInfo() {
|
|
77
|
+
return Object.values(SETUP);
|
|
78
|
+
}
|
|
79
|
+
var CLI_LOGIN_AGENTS = /* @__PURE__ */ new Set([
|
|
80
|
+
"claude",
|
|
81
|
+
"codex",
|
|
82
|
+
"opencode",
|
|
83
|
+
"brightsy"
|
|
84
|
+
]);
|
|
85
|
+
function resolveLoginCommand(agent) {
|
|
86
|
+
const info = getAgentSetupInfo(agent);
|
|
87
|
+
if (!info.loginCommand) return null;
|
|
88
|
+
if (!CLI_LOGIN_AGENTS.has(agent)) return info.loginCommand;
|
|
89
|
+
const exe = resolveAgentExecutable(agent);
|
|
90
|
+
return info.loginCommand.replace(/^\S+/, exe);
|
|
91
|
+
}
|
|
92
|
+
async function prepareTerminalCommand(command) {
|
|
93
|
+
enrichPathWithNpmGlobalBin();
|
|
94
|
+
const trimmed = command.trim();
|
|
95
|
+
if (!trimmed) return trimmed;
|
|
96
|
+
if (/^(export\s+PATH=|PATH=)/.test(trimmed)) return trimmed;
|
|
97
|
+
const match = /^(\S+)(\s[\s\S]*)?$/.exec(trimmed);
|
|
98
|
+
const bin = match?.[1];
|
|
99
|
+
let whichPath = null;
|
|
100
|
+
if (bin && !bin.includes("/") && !bin.includes("\\")) {
|
|
101
|
+
const which = await run("which", [bin], { reject: false, timeoutMs: 3e3 });
|
|
102
|
+
whichPath = which.exitCode === 0 ? which.stdout.trim() : null;
|
|
103
|
+
}
|
|
104
|
+
const resolved = resolveCommandBinarySync(trimmed, whichPath);
|
|
105
|
+
return withExportedPath(resolved, process.env.PATH ?? "");
|
|
106
|
+
}
|
|
107
|
+
async function openInSystemTerminal(command) {
|
|
108
|
+
const trimmed = (await prepareTerminalCommand(command)).trim();
|
|
109
|
+
if (!trimmed) throw new Error("Command is empty");
|
|
110
|
+
if (process.platform === "darwin") {
|
|
111
|
+
const escaped = trimmed.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
112
|
+
const script = `tell application "Terminal" to do script "${escaped}"`;
|
|
113
|
+
const result = await run("osascript", ["-e", script], { reject: false });
|
|
114
|
+
if (result.exitCode !== 0) {
|
|
115
|
+
throw new Error(result.stderr.trim() || result.stdout.trim() || "Failed to open Terminal");
|
|
116
|
+
}
|
|
117
|
+
await run("osascript", ["-e", 'tell application "Terminal" to activate'], {
|
|
118
|
+
reject: false
|
|
119
|
+
});
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (process.platform === "win32") {
|
|
123
|
+
const result = await run(
|
|
124
|
+
"cmd.exe",
|
|
125
|
+
["/c", "start", "cmd.exe", "/k", trimmed],
|
|
126
|
+
{ reject: false }
|
|
127
|
+
);
|
|
128
|
+
if (result.exitCode !== 0) {
|
|
129
|
+
throw new Error(result.stderr.trim() || result.stdout.trim() || "Failed to open cmd");
|
|
130
|
+
}
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const candidates = [
|
|
134
|
+
{ file: "gnome-terminal", args: ["--", "bash", "-lc", `${trimmed}; exec bash`] },
|
|
135
|
+
{ file: "x-terminal-emulator", args: ["-e", "bash", "-lc", `${trimmed}; exec bash`] },
|
|
136
|
+
{ file: "konsole", args: ["-e", "bash", "-lc", `${trimmed}; exec bash`] },
|
|
137
|
+
{ file: "xterm", args: ["-e", "bash", "-lc", `${trimmed}; exec bash`] }
|
|
138
|
+
];
|
|
139
|
+
for (const c of candidates) {
|
|
140
|
+
const which = await run("which", [c.file], { reject: false });
|
|
141
|
+
if (which.exitCode !== 0 || !which.stdout.trim()) continue;
|
|
142
|
+
const result = await run(c.file, c.args, { reject: false });
|
|
143
|
+
if (result.exitCode === 0) return;
|
|
144
|
+
}
|
|
145
|
+
throw new Error(
|
|
146
|
+
`No terminal found to run: ${trimmed}. Install gnome-terminal (or similar), or run the command manually.`
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
async function whichOnPath(bin) {
|
|
150
|
+
const which = await run("which", [bin], { reject: false, timeoutMs: 3e3 });
|
|
151
|
+
if (which.exitCode !== 0) return null;
|
|
152
|
+
return which.stdout.trim().split(/\r?\n/).find(Boolean) ?? null;
|
|
153
|
+
}
|
|
154
|
+
async function installNpmGlobalPackage(opts) {
|
|
155
|
+
enrichPathWithNpmGlobalBin();
|
|
156
|
+
const result = await run("npm", ["install", "-g", opts.npmPackage], { reject: false });
|
|
157
|
+
const ok = result.exitCode === 0;
|
|
158
|
+
if (!ok) {
|
|
159
|
+
try {
|
|
160
|
+
await openInSystemTerminal(opts.installCommand);
|
|
161
|
+
return {
|
|
162
|
+
ok: false,
|
|
163
|
+
openedTerminal: true,
|
|
164
|
+
command: opts.installCommand,
|
|
165
|
+
exitCode: result.exitCode,
|
|
166
|
+
stdout: result.stdout,
|
|
167
|
+
stderr: result.stderr,
|
|
168
|
+
message: `npm install failed (exit ${result.exitCode}). Opened Terminal with: ${opts.installCommand}`
|
|
169
|
+
};
|
|
170
|
+
} catch {
|
|
171
|
+
return {
|
|
172
|
+
ok: false,
|
|
173
|
+
command: opts.installCommand,
|
|
174
|
+
exitCode: result.exitCode,
|
|
175
|
+
stdout: result.stdout,
|
|
176
|
+
stderr: result.stderr,
|
|
177
|
+
message: result.stderr.trim() || result.stdout.trim() || `npm install failed (exit ${result.exitCode})`
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
enrichPathWithNpmGlobalBin();
|
|
182
|
+
const binPath = opts.cliBin ? await whichOnPath(opts.cliBin) : null;
|
|
183
|
+
return {
|
|
184
|
+
ok: true,
|
|
185
|
+
command: opts.installCommand,
|
|
186
|
+
exitCode: 0,
|
|
187
|
+
stdout: result.stdout,
|
|
188
|
+
stderr: result.stderr,
|
|
189
|
+
// 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)`
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
async function resolveExistingCli(agent) {
|
|
194
|
+
if (agent === "cursor") return null;
|
|
195
|
+
const exe = resolveAgentExecutable(agent);
|
|
196
|
+
if ((exe.includes("/") || exe.includes("\\")) && existsSync(exe)) return exe;
|
|
197
|
+
enrichPathWithNpmGlobalBin();
|
|
198
|
+
return whichOnPath(CLI_BIN[agent]);
|
|
199
|
+
}
|
|
200
|
+
async function runVendorUpdate(existing, updateArgs) {
|
|
201
|
+
const result = await run(existing, updateArgs, {
|
|
202
|
+
reject: false,
|
|
203
|
+
timeoutMs: 12e4
|
|
204
|
+
});
|
|
205
|
+
const command = `${existing} ${updateArgs.join(" ")}`;
|
|
206
|
+
const ok = result.exitCode === 0;
|
|
207
|
+
const detail = result.stdout.trim() || result.stderr.trim() || `exit ${result.exitCode}`;
|
|
208
|
+
return {
|
|
209
|
+
ok,
|
|
210
|
+
command,
|
|
211
|
+
exitCode: result.exitCode,
|
|
212
|
+
stdout: result.stdout,
|
|
213
|
+
stderr: result.stderr,
|
|
214
|
+
message: ok ? isConductorBundledCli(existing) ? `Updated Conductor\u2019s CLI at ${existing}. ${detail}` : `Updated ${command}. ${detail}` : `Update failed (${command}): ${detail}`
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function isCurlInstaller(command) {
|
|
218
|
+
return /curl\s| \|\s*bash/.test(command);
|
|
219
|
+
}
|
|
220
|
+
async function installAgent(agent) {
|
|
221
|
+
const info = getAgentSetupInfo(agent);
|
|
222
|
+
if (info.kind === "bundled-sdk" || info.kind === "api-key") {
|
|
223
|
+
return {
|
|
224
|
+
ok: true,
|
|
225
|
+
message: info.summary
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
if (!info.installCommand) {
|
|
229
|
+
return { ok: false, message: `No install command for ${agent}` };
|
|
230
|
+
}
|
|
231
|
+
const existing = await resolveExistingCli(agent);
|
|
232
|
+
if (existing && info.updateArgs?.length) {
|
|
233
|
+
return runVendorUpdate(existing, info.updateArgs);
|
|
234
|
+
}
|
|
235
|
+
if (info.npmPackage && !isCurlInstaller(info.installCommand)) {
|
|
236
|
+
const cliBin = agent === "cursor" ? null : CLI_BIN[agent];
|
|
237
|
+
return installNpmGlobalPackage({
|
|
238
|
+
npmPackage: info.npmPackage,
|
|
239
|
+
installCommand: info.installCommand,
|
|
240
|
+
cliBin
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
await openInSystemTerminal(info.installCommand);
|
|
244
|
+
return {
|
|
245
|
+
ok: true,
|
|
246
|
+
openedTerminal: true,
|
|
247
|
+
command: info.installCommand,
|
|
248
|
+
message: `Opened Terminal to run: ${info.installCommand}`
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
async function loginAgent(agent) {
|
|
252
|
+
const info = getAgentSetupInfo(agent);
|
|
253
|
+
const loginCommand = resolveLoginCommand(agent);
|
|
254
|
+
if (!loginCommand) {
|
|
255
|
+
return {
|
|
256
|
+
ok: true,
|
|
257
|
+
message: info.kind === "bundled-sdk" || info.kind === "api-key" ? info.summary : `No login command for ${agent}`
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
const prepared = await prepareTerminalCommand(loginCommand);
|
|
261
|
+
await openInSystemTerminal(prepared);
|
|
262
|
+
return {
|
|
263
|
+
ok: true,
|
|
264
|
+
openedTerminal: true,
|
|
265
|
+
command: prepared,
|
|
266
|
+
message: `Opened Terminal to run: ${prepared}`
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
async function loginManagedAccount(accountId) {
|
|
270
|
+
const { loadAppSettings } = await import("./app-settings-EHMXHNG5.js");
|
|
271
|
+
const { loginEnvPrefix } = await import("./managed-accounts-46A4KRUE.js");
|
|
272
|
+
const account = loadAppSettings().accounts.accounts.find((a) => a.id === accountId);
|
|
273
|
+
if (!account) {
|
|
274
|
+
return { ok: false, message: `Account not found: ${accountId}` };
|
|
275
|
+
}
|
|
276
|
+
const loginCommand = resolveLoginCommand(account.kind);
|
|
277
|
+
if (!loginCommand) {
|
|
278
|
+
return { ok: false, message: `No login command for ${account.kind}` };
|
|
279
|
+
}
|
|
280
|
+
const prepared = await prepareTerminalCommand(loginCommand);
|
|
281
|
+
const prefixed = `${loginEnvPrefix(account)} && ${prepared}`;
|
|
282
|
+
await openInSystemTerminal(prefixed);
|
|
283
|
+
return {
|
|
284
|
+
ok: true,
|
|
285
|
+
openedTerminal: true,
|
|
286
|
+
command: prefixed,
|
|
287
|
+
message: `Opened Terminal to run: ${prefixed}`
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export {
|
|
292
|
+
getAgentSetupInfo,
|
|
293
|
+
listAgentSetupInfo,
|
|
294
|
+
resolveLoginCommand,
|
|
295
|
+
prepareTerminalCommand,
|
|
296
|
+
openInSystemTerminal,
|
|
297
|
+
whichOnPath,
|
|
298
|
+
installNpmGlobalPackage,
|
|
299
|
+
installAgent,
|
|
300
|
+
loginAgent,
|
|
301
|
+
loginManagedAccount
|
|
302
|
+
};
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
compactSummaryPart,
|
|
3
3
|
isInternalAgentStatusText,
|
|
4
4
|
lastAssistantMessageText
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YSLCWCMJ.js";
|
|
6
6
|
import {
|
|
7
7
|
isCloudCoordinatorThread,
|
|
8
8
|
isGlobalThread,
|
|
9
9
|
isOrchestratorThread,
|
|
10
10
|
isSlackCoordinatorThread
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DBOFDEQ7.js";
|
|
12
12
|
import {
|
|
13
13
|
mergeAgentGitAuthEnv,
|
|
14
14
|
resolveAgentGitAuthEnv
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HNB2HTCV.js";
|
|
16
16
|
import {
|
|
17
17
|
allocateTeamName,
|
|
18
18
|
createEmptyThread,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-2P4XKWV2.js";
|
|
30
30
|
import {
|
|
31
31
|
clipToolResultForStore
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-MIVX7QKI.js";
|
|
33
33
|
import {
|
|
34
34
|
ATTACHMENTS_DIR,
|
|
35
35
|
DETACHED_JOBS_DIR,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
import {
|
|
44
44
|
assertOrchestratorCapableAgent,
|
|
45
45
|
contextTokens
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-36J3IZBS.js";
|
|
47
47
|
import {
|
|
48
48
|
stripNestedElectronEnv
|
|
49
49
|
} from "./chunk-4TR3HZFT.js";
|
|
@@ -1776,7 +1776,7 @@ var PORT_RANGE_SIZE = 10;
|
|
|
1776
1776
|
var RECLAIM_RETRY_DELAY_MS = 40;
|
|
1777
1777
|
var RECLAIM_TRIES = 8;
|
|
1778
1778
|
async function killReclaimable(ports, worktreePath, signal) {
|
|
1779
|
-
const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-
|
|
1779
|
+
const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-ZLYZVIAV.js");
|
|
1780
1780
|
if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
|
|
1781
1781
|
else killListenersOnPorts2(ports);
|
|
1782
1782
|
}
|