@sideboard-ai/core 0.1.287 → 0.1.289
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-D3PU4UCP.js → agents-4BBCKITL.js} +20 -18
- package/dist/{agents-KU4QPB3Y.js → agents-XAKSP653.js} +18 -16
- 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-K5XSTHHP.js → chunk-2IXKTAIT.js} +2 -2
- package/dist/{chunk-YNTXWFXT.js → chunk-36J3IZBS.js} +12 -12
- package/dist/{chunk-IJMUYHPT.js → chunk-3E4NOIXN.js} +3 -3
- package/dist/chunk-4BXRRHDC.js +139 -0
- package/dist/{chunk-5MGLNVNK.js → chunk-5HPMKLJ7.js} +2 -2
- 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-LKVP7JCB.js → chunk-C546EOEF.js} +35 -315
- package/dist/{chunk-QPBR5SAL.js → chunk-EBGJXOXT.js} +27 -129
- package/dist/{chunk-RFPMTOV2.js → chunk-G74TSBJ3.js} +6 -6
- package/dist/{chunk-L65YT2SC.js → chunk-GBAACE3C.js} +7 -7
- package/dist/{chunk-VQEARG5H.js → chunk-GU6DT6NO.js} +5 -5
- package/dist/{chunk-S2OOM7AU.js → chunk-K6IOJI3L.js} +1 -1
- package/dist/{chunk-UFJLNCOF.js → chunk-LUQ7MIVD.js} +8 -298
- 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-KLAQ4G34.js → chunk-O4324MXE.js} +4 -4
- package/dist/chunk-OH4EN323.js +89 -0
- package/dist/{chunk-ZGAMETNF.js → chunk-V3BSO2O6.js} +4 -4
- package/dist/{chunk-Z3EE3PUZ.js → chunk-VNCPRMIK.js} +10 -300
- package/dist/chunk-W2KZTDET.js +302 -0
- package/dist/{chunk-TMM4FEZ5.js → chunk-Y67TBJD5.js} +3 -3
- package/dist/{chunk-XSDCLM3F.js → chunk-YSLCWCMJ.js} +1 -1
- package/dist/{conductor-FOKYVMUE.js → conductor-5MNGC25D.js} +6 -6
- package/dist/{conductor-KDUL6AMD.js → conductor-UFJXJPTF.js} +7 -7
- package/dist/{coordinator-prompt-GU5PGLG6.js → coordinator-prompt-5Q66Y5KW.js} +4 -4
- package/dist/{coordinator-prompt-YARYX53V.js → coordinator-prompt-BYPEW6DE.js} +4 -4
- package/dist/{global-workspace-SMCPOWE5.js → global-workspace-BTH2YGDZ.js} +4 -4
- package/dist/{global-workspace-C5HMC66E.js → global-workspace-YKOYXSB2.js} +4 -4
- package/dist/index.cjs +618 -323
- package/dist/index.d.cts +42 -10
- package/dist/index.d.ts +42 -10
- package/dist/index.js +494 -281
- package/dist/mcp/run-stdio.cjs +602 -225
- package/dist/mcp/run-stdio.js +334 -188
- package/dist/optional-cli-6SW4OOX3.js +23 -0
- package/dist/optional-cli-FRUZSZ3U.js +98 -0
- package/dist/{orchestrator-2UAVOXTN.js → orchestrator-IG4VU7MT.js} +13 -11
- package/dist/{orchestrator-NWKE56BW.js → orchestrator-MKF3YBNK.js} +10 -8
- package/dist/{thread-store-7XBOUQ5K.js → thread-store-DPKESDFR.js} +1 -1
- package/dist/{thread-store-ZQZDREVH.js → thread-store-X6S2GIR5.js} +1 -1
- package/dist/{workspaces-KHQ5ETSQ.js → workspaces-ELO2YVTU.js} +4 -4
- package/dist/{workspaces-DQMDCRB2.js → workspaces-RFD6I4FM.js} +4 -4
- package/dist/{worktree-NKLNVNXX.js → worktree-ADVQ6X6C.js} +3 -3
- package/dist/{worktree-YTZC3UQN.js → worktree-TN7DZDJZ.js} +3 -3
- package/package.json +1 -1
- /package/dist/{chunk-N5UGX3JL.js → chunk-QB5MDOHL.js} +0 -0
- /package/dist/{chunk-JPH7PYSK.js → chunk-YRXV3E7J.js} +0 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import {
|
|
2
|
+
enrichPathWithNpmGlobalBin,
|
|
3
|
+
isConductorBundledCli,
|
|
4
|
+
resolveCommandBinarySync,
|
|
5
|
+
run,
|
|
6
|
+
withExportedPath
|
|
7
|
+
} from "./chunk-QVN2WOKJ.js";
|
|
8
|
+
import {
|
|
9
|
+
resolveAgentExecutable
|
|
10
|
+
} from "./chunk-36J3IZBS.js";
|
|
11
|
+
|
|
12
|
+
// src/agents/install.ts
|
|
13
|
+
import { existsSync } from "fs";
|
|
14
|
+
var SETUP = {
|
|
15
|
+
claude: {
|
|
16
|
+
agent: "claude",
|
|
17
|
+
kind: "cli",
|
|
18
|
+
summary: "Install the Claude Code CLI, then complete login in a terminal.",
|
|
19
|
+
docsUrl: "https://code.claude.com/docs/en/install",
|
|
20
|
+
installCommand: "npm install -g @anthropic-ai/claude-code",
|
|
21
|
+
loginCommand: "claude auth login",
|
|
22
|
+
npmPackage: "@anthropic-ai/claude-code",
|
|
23
|
+
updateArgs: ["update"]
|
|
24
|
+
},
|
|
25
|
+
codex: {
|
|
26
|
+
agent: "codex",
|
|
27
|
+
kind: "cli",
|
|
28
|
+
summary: "Install the Codex CLI, then run login in a terminal.",
|
|
29
|
+
docsUrl: "https://github.com/openai/codex",
|
|
30
|
+
installCommand: "npm install -g @openai/codex",
|
|
31
|
+
loginCommand: "codex login",
|
|
32
|
+
npmPackage: "@openai/codex",
|
|
33
|
+
updateArgs: ["update"]
|
|
34
|
+
},
|
|
35
|
+
opencode: {
|
|
36
|
+
agent: "opencode",
|
|
37
|
+
kind: "cli",
|
|
38
|
+
summary: "Install OpenCode (curl installer or npm), then authenticate providers.",
|
|
39
|
+
docsUrl: "https://opencode.ai/docs",
|
|
40
|
+
// Prefer the official installer; npm package name is opencode-ai.
|
|
41
|
+
installCommand: "curl -fsSL https://opencode.ai/install | bash",
|
|
42
|
+
loginCommand: "opencode auth login",
|
|
43
|
+
npmPackage: "opencode-ai@latest",
|
|
44
|
+
updateArgs: ["upgrade"]
|
|
45
|
+
},
|
|
46
|
+
cursor: {
|
|
47
|
+
agent: "cursor",
|
|
48
|
+
kind: "cli",
|
|
49
|
+
summary: "Install (or update) @cursor/sdk with npm \u2014 Sideboard does not pin it in the app. Then add a CURSOR_API_KEY.",
|
|
50
|
+
docsUrl: "https://www.npmjs.com/package/@cursor/sdk",
|
|
51
|
+
installCommand: "npm install -g @cursor/sdk",
|
|
52
|
+
loginCommand: null,
|
|
53
|
+
npmPackage: "@cursor/sdk"
|
|
54
|
+
},
|
|
55
|
+
brightsy: {
|
|
56
|
+
agent: "brightsy",
|
|
57
|
+
kind: "cli",
|
|
58
|
+
summary: "Install (or update) the Brightsy CLI with npm, then run `brightsy login`.",
|
|
59
|
+
docsUrl: "https://www.npmjs.com/package/@brightsy/cli",
|
|
60
|
+
installCommand: "npm install -g @brightsy/cli",
|
|
61
|
+
loginCommand: "brightsy login",
|
|
62
|
+
npmPackage: "@brightsy/cli"
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var CLI_BIN = {
|
|
66
|
+
claude: "claude",
|
|
67
|
+
codex: "codex",
|
|
68
|
+
opencode: "opencode",
|
|
69
|
+
brightsy: "brightsy"
|
|
70
|
+
};
|
|
71
|
+
function getAgentSetupInfo(agent) {
|
|
72
|
+
return SETUP[agent];
|
|
73
|
+
}
|
|
74
|
+
function listAgentSetupInfo() {
|
|
75
|
+
return Object.values(SETUP);
|
|
76
|
+
}
|
|
77
|
+
var CLI_LOGIN_AGENTS = /* @__PURE__ */ new Set([
|
|
78
|
+
"claude",
|
|
79
|
+
"codex",
|
|
80
|
+
"opencode",
|
|
81
|
+
"brightsy"
|
|
82
|
+
]);
|
|
83
|
+
function resolveLoginCommand(agent) {
|
|
84
|
+
const info = getAgentSetupInfo(agent);
|
|
85
|
+
if (!info.loginCommand) return null;
|
|
86
|
+
if (!CLI_LOGIN_AGENTS.has(agent)) return info.loginCommand;
|
|
87
|
+
const exe = resolveAgentExecutable(agent);
|
|
88
|
+
return info.loginCommand.replace(/^\S+/, exe);
|
|
89
|
+
}
|
|
90
|
+
async function prepareTerminalCommand(command) {
|
|
91
|
+
enrichPathWithNpmGlobalBin();
|
|
92
|
+
const trimmed = command.trim();
|
|
93
|
+
if (!trimmed) return trimmed;
|
|
94
|
+
if (/^(export\s+PATH=|PATH=)/.test(trimmed)) return trimmed;
|
|
95
|
+
const match = /^(\S+)(\s[\s\S]*)?$/.exec(trimmed);
|
|
96
|
+
const bin = match?.[1];
|
|
97
|
+
let whichPath = null;
|
|
98
|
+
if (bin && !bin.includes("/") && !bin.includes("\\")) {
|
|
99
|
+
const which = await run("which", [bin], { reject: false, timeoutMs: 3e3 });
|
|
100
|
+
whichPath = which.exitCode === 0 ? which.stdout.trim() : null;
|
|
101
|
+
}
|
|
102
|
+
const resolved = resolveCommandBinarySync(trimmed, whichPath);
|
|
103
|
+
return withExportedPath(resolved, process.env.PATH ?? "");
|
|
104
|
+
}
|
|
105
|
+
async function openInSystemTerminal(command) {
|
|
106
|
+
const trimmed = (await prepareTerminalCommand(command)).trim();
|
|
107
|
+
if (!trimmed) throw new Error("Command is empty");
|
|
108
|
+
if (process.platform === "darwin") {
|
|
109
|
+
const escaped = trimmed.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
110
|
+
const script = `tell application "Terminal" to do script "${escaped}"`;
|
|
111
|
+
const result = await run("osascript", ["-e", script], { reject: false });
|
|
112
|
+
if (result.exitCode !== 0) {
|
|
113
|
+
throw new Error(result.stderr.trim() || result.stdout.trim() || "Failed to open Terminal");
|
|
114
|
+
}
|
|
115
|
+
await run("osascript", ["-e", 'tell application "Terminal" to activate'], {
|
|
116
|
+
reject: false
|
|
117
|
+
});
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (process.platform === "win32") {
|
|
121
|
+
const result = await run(
|
|
122
|
+
"cmd.exe",
|
|
123
|
+
["/c", "start", "cmd.exe", "/k", trimmed],
|
|
124
|
+
{ reject: false }
|
|
125
|
+
);
|
|
126
|
+
if (result.exitCode !== 0) {
|
|
127
|
+
throw new Error(result.stderr.trim() || result.stdout.trim() || "Failed to open cmd");
|
|
128
|
+
}
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const candidates = [
|
|
132
|
+
{ file: "gnome-terminal", args: ["--", "bash", "-lc", `${trimmed}; exec bash`] },
|
|
133
|
+
{ file: "x-terminal-emulator", args: ["-e", "bash", "-lc", `${trimmed}; exec bash`] },
|
|
134
|
+
{ file: "konsole", args: ["-e", "bash", "-lc", `${trimmed}; exec bash`] },
|
|
135
|
+
{ file: "xterm", args: ["-e", "bash", "-lc", `${trimmed}; exec bash`] }
|
|
136
|
+
];
|
|
137
|
+
for (const c of candidates) {
|
|
138
|
+
const which = await run("which", [c.file], { reject: false });
|
|
139
|
+
if (which.exitCode !== 0 || !which.stdout.trim()) continue;
|
|
140
|
+
const result = await run(c.file, c.args, { reject: false });
|
|
141
|
+
if (result.exitCode === 0) return;
|
|
142
|
+
}
|
|
143
|
+
throw new Error(
|
|
144
|
+
`No terminal found to run: ${trimmed}. Install gnome-terminal (or similar), or run the command manually.`
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
async function whichOnPath(bin) {
|
|
148
|
+
const which = await run("which", [bin], { reject: false, timeoutMs: 3e3 });
|
|
149
|
+
if (which.exitCode !== 0) return null;
|
|
150
|
+
return which.stdout.trim().split(/\r?\n/).find(Boolean) ?? null;
|
|
151
|
+
}
|
|
152
|
+
async function installNpmGlobalPackage(opts) {
|
|
153
|
+
enrichPathWithNpmGlobalBin();
|
|
154
|
+
const result = await run("npm", ["install", "-g", opts.npmPackage], { reject: false });
|
|
155
|
+
const ok = result.exitCode === 0;
|
|
156
|
+
if (!ok) {
|
|
157
|
+
try {
|
|
158
|
+
await openInSystemTerminal(opts.installCommand);
|
|
159
|
+
return {
|
|
160
|
+
ok: false,
|
|
161
|
+
openedTerminal: true,
|
|
162
|
+
command: opts.installCommand,
|
|
163
|
+
exitCode: result.exitCode,
|
|
164
|
+
stdout: result.stdout,
|
|
165
|
+
stderr: result.stderr,
|
|
166
|
+
message: `npm install failed (exit ${result.exitCode}). Opened Terminal with: ${opts.installCommand}`
|
|
167
|
+
};
|
|
168
|
+
} catch {
|
|
169
|
+
return {
|
|
170
|
+
ok: false,
|
|
171
|
+
command: opts.installCommand,
|
|
172
|
+
exitCode: result.exitCode,
|
|
173
|
+
stdout: result.stdout,
|
|
174
|
+
stderr: result.stderr,
|
|
175
|
+
message: result.stderr.trim() || result.stdout.trim() || `npm install failed (exit ${result.exitCode})`
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
enrichPathWithNpmGlobalBin();
|
|
180
|
+
const binPath = opts.cliBin ? await whichOnPath(opts.cliBin) : null;
|
|
181
|
+
return {
|
|
182
|
+
ok: true,
|
|
183
|
+
command: opts.installCommand,
|
|
184
|
+
exitCode: 0,
|
|
185
|
+
stdout: result.stdout,
|
|
186
|
+
stderr: result.stderr,
|
|
187
|
+
// Library-only packages (`@cursor/sdk`) have no CLI to look for.
|
|
188
|
+
message: !opts.cliBin ? `Installed ${opts.npmPackage}` : binPath ? `Installed ${opts.npmPackage} \u2192 ${binPath}` : `Installed ${opts.npmPackage} (CLI not yet on PATH)`
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
async function resolveExistingCli(agent) {
|
|
192
|
+
if (agent === "cursor") return null;
|
|
193
|
+
const exe = resolveAgentExecutable(agent);
|
|
194
|
+
if ((exe.includes("/") || exe.includes("\\")) && existsSync(exe)) return exe;
|
|
195
|
+
enrichPathWithNpmGlobalBin();
|
|
196
|
+
return whichOnPath(CLI_BIN[agent]);
|
|
197
|
+
}
|
|
198
|
+
async function runVendorUpdate(existing, updateArgs) {
|
|
199
|
+
const result = await run(existing, updateArgs, {
|
|
200
|
+
reject: false,
|
|
201
|
+
timeoutMs: 12e4
|
|
202
|
+
});
|
|
203
|
+
const command = `${existing} ${updateArgs.join(" ")}`;
|
|
204
|
+
const ok = result.exitCode === 0;
|
|
205
|
+
const detail = result.stdout.trim() || result.stderr.trim() || `exit ${result.exitCode}`;
|
|
206
|
+
return {
|
|
207
|
+
ok,
|
|
208
|
+
command,
|
|
209
|
+
exitCode: result.exitCode,
|
|
210
|
+
stdout: result.stdout,
|
|
211
|
+
stderr: result.stderr,
|
|
212
|
+
message: ok ? isConductorBundledCli(existing) ? `Updated Conductor\u2019s CLI at ${existing}. ${detail}` : `Updated ${command}. ${detail}` : `Update failed (${command}): ${detail}`
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
function isCurlInstaller(command) {
|
|
216
|
+
return /curl\s| \|\s*bash/.test(command);
|
|
217
|
+
}
|
|
218
|
+
async function installAgent(agent) {
|
|
219
|
+
const info = getAgentSetupInfo(agent);
|
|
220
|
+
if (info.kind === "bundled-sdk" || info.kind === "api-key") {
|
|
221
|
+
return {
|
|
222
|
+
ok: true,
|
|
223
|
+
message: info.summary
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
if (!info.installCommand) {
|
|
227
|
+
return { ok: false, message: `No install command for ${agent}` };
|
|
228
|
+
}
|
|
229
|
+
const existing = await resolveExistingCli(agent);
|
|
230
|
+
if (existing && info.updateArgs?.length) {
|
|
231
|
+
return runVendorUpdate(existing, info.updateArgs);
|
|
232
|
+
}
|
|
233
|
+
if (info.npmPackage && !isCurlInstaller(info.installCommand)) {
|
|
234
|
+
const cliBin = agent === "cursor" ? null : CLI_BIN[agent];
|
|
235
|
+
return installNpmGlobalPackage({
|
|
236
|
+
npmPackage: info.npmPackage,
|
|
237
|
+
installCommand: info.installCommand,
|
|
238
|
+
cliBin
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
await openInSystemTerminal(info.installCommand);
|
|
242
|
+
return {
|
|
243
|
+
ok: true,
|
|
244
|
+
openedTerminal: true,
|
|
245
|
+
command: info.installCommand,
|
|
246
|
+
message: `Opened Terminal to run: ${info.installCommand}`
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
async function loginAgent(agent) {
|
|
250
|
+
const info = getAgentSetupInfo(agent);
|
|
251
|
+
const loginCommand = resolveLoginCommand(agent);
|
|
252
|
+
if (!loginCommand) {
|
|
253
|
+
return {
|
|
254
|
+
ok: true,
|
|
255
|
+
message: info.kind === "bundled-sdk" || info.kind === "api-key" ? info.summary : `No login command for ${agent}`
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
const prepared = await prepareTerminalCommand(loginCommand);
|
|
259
|
+
await openInSystemTerminal(prepared);
|
|
260
|
+
return {
|
|
261
|
+
ok: true,
|
|
262
|
+
openedTerminal: true,
|
|
263
|
+
command: prepared,
|
|
264
|
+
message: `Opened Terminal to run: ${prepared}`
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
async function loginManagedAccount(accountId) {
|
|
268
|
+
const { loadAppSettings } = await import("./app-settings-MR2U6AXN.js");
|
|
269
|
+
const { loginEnvPrefix } = await import("./managed-accounts-2AK5RIAF.js");
|
|
270
|
+
const account = loadAppSettings().accounts.accounts.find((a) => a.id === accountId);
|
|
271
|
+
if (!account) {
|
|
272
|
+
return { ok: false, message: `Account not found: ${accountId}` };
|
|
273
|
+
}
|
|
274
|
+
const loginCommand = resolveLoginCommand(account.kind);
|
|
275
|
+
if (!loginCommand) {
|
|
276
|
+
return { ok: false, message: `No login command for ${account.kind}` };
|
|
277
|
+
}
|
|
278
|
+
const prepared = await prepareTerminalCommand(loginCommand);
|
|
279
|
+
const prefixed = `${loginEnvPrefix(account)} && ${prepared}`;
|
|
280
|
+
await openInSystemTerminal(prefixed);
|
|
281
|
+
return {
|
|
282
|
+
ok: true,
|
|
283
|
+
openedTerminal: true,
|
|
284
|
+
command: prefixed,
|
|
285
|
+
message: `Opened Terminal to run: ${prefixed}`
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export {
|
|
290
|
+
getAgentSetupInfo,
|
|
291
|
+
listAgentSetupInfo,
|
|
292
|
+
resolveLoginCommand,
|
|
293
|
+
prepareTerminalCommand,
|
|
294
|
+
openInSystemTerminal,
|
|
295
|
+
whichOnPath,
|
|
296
|
+
installNpmGlobalPackage,
|
|
297
|
+
installAgent,
|
|
298
|
+
loginAgent,
|
|
299
|
+
loginManagedAccount
|
|
300
|
+
};
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
ensureGhPreferOrigin,
|
|
6
6
|
resolveGithubRepoSlug,
|
|
7
7
|
resolveRepoRoot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5HPMKLJ7.js";
|
|
9
9
|
import {
|
|
10
10
|
ATTACHMENTS_DIR,
|
|
11
11
|
attachmentsGitignoreBody
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
resolveThreadDefaults,
|
|
23
23
|
resolveViewerProfile,
|
|
24
24
|
resolveViewerProfileForRepo
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-MVZO7QZ2.js";
|
|
26
26
|
import {
|
|
27
27
|
allocateTeamName,
|
|
28
28
|
createEmptyThread,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
teamSlugFromName,
|
|
32
32
|
updateThread,
|
|
33
33
|
writeThread
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-YRXV3E7J.js";
|
|
35
35
|
import {
|
|
36
36
|
appDataDir,
|
|
37
37
|
globalAgentCwd,
|
|
@@ -346,7 +346,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
|
|
|
346
346
|
"- linear_* (when Linear is connected) \u2014 list_teams for team key/states; linear_list_projects for project names; get/search include the project a ticket is on; get/create/update/comment with ENG-123. Worktree agents have the same Account tools \u2014 prefer they comment, update status, and create spin-offs (parent=) on their own ticket when they were asked to do the work. When reviewing a PR or ticket, do not comment or update until the user types a next step \u2014 they should work through the feedback in chat first. Do not tell the child to ask_user after the review. Scope errors: reconnect Linear in Account settings. Prefer these over any Linear MCP the CLI may still list.",
|
|
347
347
|
"- github_* \u2014 get/comment/update/create GitHub issues via Account `gh` (#123). github_list_projects and get/search include GitHub Projects. projectsError or a missing read:project scope \u2192 `gh auth refresh -s read:project`. Worktree agents have these too. Prefer over any vendor GitHub MCP. Pass parent= for spin-offs. When reviewing a PR or ticket, do not comment, submit `gh pr review`, or update the PR/ticket until the user types a next step.",
|
|
348
348
|
"- abletime_* (when AbleTime is connected) \u2014 orientation first; abletime_list_projects lists projects; get/list include the project a task is on; get/comment/update/create (parent= for spin-offs); ensure_task when work has no ticket (or create_workspace from the default branch auto-creates one). Worktree agents have the same Account tools. Same review-write gate as Linear/GitHub.",
|
|
349
|
-
"- Optional connectors (Vercel, Supabase,
|
|
349
|
+
"- Optional connectors (Vercel, Supabase, Sentry) in Settings \u2192 Connectors inject tokens into worktree agent env when connected. Prefer official CLIs (`vercel`, `supabase`, `sentry-cli`). PostHog is the Sideboard tool `posthog_api` (GET by default; POST `/api/projects/:id/query/` or `/api/environments/:id/query/` is a read and does not need write=true; other POST and PATCH need write=true only when the user asked to change data). The PostHog key stays in the vault \u2014 do not read it from the environment. If a connector MCP needsAuth or is unauthorized, do not sign in \u2014 use the native CLI or `posthog_api`. Tell any worktree agent (Claude / Cursor / Codex / OpenCode) to write CLI output to `.context/cli/` and read a slice. If a CLI is missing, the user presses Install CLI on that row. Do not add vendor MCPs. Git (`gh`) stays Settings \u2192 Git; issue tracking stays Settings \u2192 Issues. The phone remote is Settings \u2192 Remote \u2014 do not look up Slack users.",
|
|
350
350
|
"- get_pr_stack / open_pr_stack_layers / add_stack_layer / create_pr_stack \u2014 GitHub stacked PRs (`gh stack`); one worktree per layer",
|
|
351
351
|
"- list_models \u2014 only when you need a specific model (rare); otherwise omit model so Account defaults apply",
|
|
352
352
|
"- list_chats / get_chat \u2014 live thread list (parent id + last message preview). get_chat on this orchestration chat lists child worktree agents (status + lastText). blockedReason is why that agent is waiting on a person. Also includes usage / lastTurnUsage.",
|
|
@@ -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
|
+
};
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ensureGhPreferOrigin,
|
|
4
4
|
resolveGithubRepoSlug,
|
|
5
5
|
resolveRepoRoot
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2IXKTAIT.js";
|
|
7
7
|
import {
|
|
8
8
|
allocateTeamName,
|
|
9
9
|
createEmptyThread,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
teamSlugFromName,
|
|
13
13
|
updateThread,
|
|
14
14
|
writeThread
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QB5MDOHL.js";
|
|
16
16
|
import {
|
|
17
17
|
ATTACHMENTS_DIR,
|
|
18
18
|
attachmentsGitignoreBody
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
resolveThreadDefaults,
|
|
30
30
|
resolveViewerProfile,
|
|
31
31
|
resolveViewerProfileForRepo
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-36J3IZBS.js";
|
|
33
33
|
import {
|
|
34
34
|
appDataDir,
|
|
35
35
|
globalAgentCwd,
|
|
@@ -391,7 +391,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
|
|
|
391
391
|
"- linear_* (when Linear is connected) \u2014 list_teams for team key/states; linear_list_projects for project names; get/search include the project a ticket is on; get/create/update/comment with ENG-123. Worktree agents have the same Account tools \u2014 prefer they comment, update status, and create spin-offs (parent=) on their own ticket when they were asked to do the work. When reviewing a PR or ticket, do not comment or update until the user types a next step \u2014 they should work through the feedback in chat first. Do not tell the child to ask_user after the review. Scope errors: reconnect Linear in Account settings. Prefer these over any Linear MCP the CLI may still list.",
|
|
392
392
|
"- github_* \u2014 get/comment/update/create GitHub issues via Account `gh` (#123). github_list_projects and get/search include GitHub Projects. projectsError or a missing read:project scope \u2192 `gh auth refresh -s read:project`. Worktree agents have these too. Prefer over any vendor GitHub MCP. Pass parent= for spin-offs. When reviewing a PR or ticket, do not comment, submit `gh pr review`, or update the PR/ticket until the user types a next step.",
|
|
393
393
|
"- abletime_* (when AbleTime is connected) \u2014 orientation first; abletime_list_projects lists projects; get/list include the project a task is on; get/comment/update/create (parent= for spin-offs); ensure_task when work has no ticket (or create_workspace from the default branch auto-creates one). Worktree agents have the same Account tools. Same review-write gate as Linear/GitHub.",
|
|
394
|
-
"- Optional connectors (Vercel, Supabase,
|
|
394
|
+
"- Optional connectors (Vercel, Supabase, Sentry) in Settings \u2192 Connectors inject tokens into worktree agent env when connected. Prefer official CLIs (`vercel`, `supabase`, `sentry-cli`). PostHog is the Sideboard tool `posthog_api` (GET by default; POST `/api/projects/:id/query/` or `/api/environments/:id/query/` is a read and does not need write=true; other POST and PATCH need write=true only when the user asked to change data). The PostHog key stays in the vault \u2014 do not read it from the environment. If a connector MCP needsAuth or is unauthorized, do not sign in \u2014 use the native CLI or `posthog_api`. Tell any worktree agent (Claude / Cursor / Codex / OpenCode) to write CLI output to `.context/cli/` and read a slice. If a CLI is missing, the user presses Install CLI on that row. Do not add vendor MCPs. Git (`gh`) stays Settings \u2192 Git; issue tracking stays Settings \u2192 Issues. The phone remote is Settings \u2192 Remote \u2014 do not look up Slack users.",
|
|
395
395
|
"- get_pr_stack / open_pr_stack_layers / add_stack_layer / create_pr_stack \u2014 GitHub stacked PRs (`gh stack`); one worktree per layer",
|
|
396
396
|
"- list_models \u2014 only when you need a specific model (rare); otherwise omit model so Account defaults apply",
|
|
397
397
|
"- list_chats / get_chat \u2014 live thread list (parent id + last message preview). get_chat on this orchestration chat lists child worktree agents (status + lastText). blockedReason is why that agent is waiting on a person. Also includes usage / lastTurnUsage.",
|