@sideboard-ai/core 0.1.62 → 0.1.67
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/{agents-KF3J3C53.js → agents-OTBZVTZO.js} +27 -7
- package/dist/{agents-QLSFIQAO.js → agents-TS3EI2YI.js} +27 -7
- package/dist/{app-settings-LTSFG7QJ.js → app-settings-GJVZGU3M.js} +13 -3
- package/dist/{app-settings-HK4KAM4R.js → app-settings-ONKMFSEJ.js} +13 -3
- package/dist/{chunk-UGXSSBFJ.js → chunk-4BUCGNZS.js} +1 -1
- package/dist/chunk-4UIYN56C.js +173 -0
- package/dist/{chunk-NVU7EC2E.js → chunk-57WWNMFP.js} +2 -2
- package/dist/{chunk-A6FOKNOU.js → chunk-5HTTCYWA.js} +2 -2
- package/dist/{chunk-DXTGDXO2.js → chunk-7ZOQY4A7.js} +31 -6
- package/dist/{chunk-ZF5YJCXO.js → chunk-B4PRRKMA.js} +284 -93
- package/dist/{chunk-DDN3UF4R.js → chunk-BPOTVI5J.js} +115 -3
- package/dist/{chunk-MBAL5FE6.js → chunk-DB3I75FI.js} +4 -4
- package/dist/chunk-FGDJOJ2L.js +176 -0
- package/dist/{chunk-2FEA4LDA.js → chunk-JWZNK3CQ.js} +31 -6
- package/dist/{chunk-2MCNURQV.js → chunk-K7LM4CLD.js} +279 -93
- package/dist/{chunk-3KKNTHUC.js → chunk-LW5CMQGZ.js} +1 -1
- package/dist/{chunk-JB2H7E7V.js → chunk-M5V4QIWF.js} +1 -1
- package/dist/{chunk-6CUJQKTJ.js → chunk-MHR4OGZ4.js} +115 -3
- package/dist/{chunk-46KMKHSD.js → chunk-WAFIF22N.js} +2 -2
- package/dist/{chunk-27MAWNKY.js → chunk-ZRFAZVGL.js} +2 -2
- package/dist/{connected-teams-MKIYKOYA.js → connected-teams-OMDHTL6A.js} +2 -2
- package/dist/{connected-teams-RSL4VB3X.js → connected-teams-RUNMOCG5.js} +2 -2
- package/dist/{coordinator-prompt-N2R6FGZK.js → coordinator-prompt-3BSMKZL4.js} +4 -4
- package/dist/{coordinator-prompt-LKG3SHMI.js → coordinator-prompt-6HMTOX4G.js} +4 -4
- package/dist/{global-workspace-LALWQWRJ.js → global-workspace-QS7A23CB.js} +5 -6
- package/dist/{global-workspace-YOAUQCMA.js → global-workspace-YZ2NJVLL.js} +5 -6
- package/dist/index.cjs +1345 -933
- package/dist/index.d.cts +96 -1
- package/dist/index.d.ts +96 -1
- package/dist/index.js +750 -715
- package/dist/mcp/run-stdio.cjs +1293 -977
- package/dist/mcp/run-stdio.js +691 -748
- package/dist/{run-GPSVV5OH.js → run-JLD2Y52J.js} +1 -1
- package/dist/{run-HZTBWGQR.js → run-Y2MI3EVV.js} +1 -1
- package/dist/{workspaces-E75POJXP.js → workspaces-AIUYUXB7.js} +6 -7
- package/dist/{workspaces-VCAIHVIE.js → workspaces-EBFW7I7S.js} +6 -7
- package/dist/{worktree-MV4WRW6G.js → worktree-7NBPIVFZ.js} +2 -2
- package/dist/{worktree-LZEGVQSN.js → worktree-WMDJW2BL.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-73AT5K4A.js +0 -104
- package/dist/chunk-GI7E5733.js +0 -30
- package/dist/chunk-RIWUU7FO.js +0 -107
- package/dist/chunk-S2LL5HA4.js +0 -33
|
@@ -50,16 +50,33 @@ var CLOUD_CONNECT_AGENTS = /* @__PURE__ */ new Set([
|
|
|
50
50
|
"opencode",
|
|
51
51
|
"cursor"
|
|
52
52
|
]);
|
|
53
|
+
function normalizeCliExecutable(raw) {
|
|
54
|
+
if (!raw || typeof raw !== "object") return {};
|
|
55
|
+
const source = raw;
|
|
56
|
+
const out = {};
|
|
57
|
+
if (typeof source.executablePath === "string") {
|
|
58
|
+
const path = source.executablePath.trim();
|
|
59
|
+
if (path) out.executablePath = path;
|
|
60
|
+
}
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
53
63
|
function normalizeBrightsy(raw) {
|
|
54
64
|
if (!raw || typeof raw !== "object") return {};
|
|
55
65
|
const source = raw;
|
|
56
66
|
const out = {};
|
|
67
|
+
if (typeof source.executablePath === "string") {
|
|
68
|
+
const path = source.executablePath.trim();
|
|
69
|
+
if (path) out.executablePath = path;
|
|
70
|
+
}
|
|
57
71
|
if (typeof source.cloudConnectEnabled === "boolean") {
|
|
58
72
|
out.cloudConnectEnabled = source.cloudConnectEnabled;
|
|
59
73
|
}
|
|
60
74
|
if (typeof source.cloudConnectAgent === "string" && CLOUD_CONNECT_AGENTS.has(source.cloudConnectAgent)) {
|
|
61
75
|
out.cloudConnectAgent = source.cloudConnectAgent;
|
|
62
76
|
}
|
|
77
|
+
if (typeof source.injectWorktreeMcp === "boolean") {
|
|
78
|
+
out.injectWorktreeMcp = source.injectWorktreeMcp;
|
|
79
|
+
}
|
|
63
80
|
return out;
|
|
64
81
|
}
|
|
65
82
|
var ISSUE_SOURCES = /* @__PURE__ */ new Set(["linear", "github"]);
|
|
@@ -146,6 +163,8 @@ function normalizeAdvanced(raw) {
|
|
|
146
163
|
function normalizeSettings(raw) {
|
|
147
164
|
const env = {};
|
|
148
165
|
let claude = {};
|
|
166
|
+
let codex = {};
|
|
167
|
+
let opencode = {};
|
|
149
168
|
let brightsy = {};
|
|
150
169
|
let integrations = {};
|
|
151
170
|
let defaults = {};
|
|
@@ -164,6 +183,12 @@ function normalizeSettings(raw) {
|
|
|
164
183
|
if ("claude" in raw) {
|
|
165
184
|
claude = normalizeClaude(raw.claude);
|
|
166
185
|
}
|
|
186
|
+
if ("codex" in raw) {
|
|
187
|
+
codex = normalizeCliExecutable(raw.codex);
|
|
188
|
+
}
|
|
189
|
+
if ("opencode" in raw) {
|
|
190
|
+
opencode = normalizeCliExecutable(raw.opencode);
|
|
191
|
+
}
|
|
167
192
|
if ("brightsy" in raw) {
|
|
168
193
|
brightsy = normalizeBrightsy(raw.brightsy);
|
|
169
194
|
}
|
|
@@ -179,11 +204,22 @@ function normalizeSettings(raw) {
|
|
|
179
204
|
advanced = normalizeAdvanced(raw.advanced);
|
|
180
205
|
}
|
|
181
206
|
}
|
|
182
|
-
return {
|
|
207
|
+
return {
|
|
208
|
+
environment: env,
|
|
209
|
+
claude,
|
|
210
|
+
codex,
|
|
211
|
+
opencode,
|
|
212
|
+
brightsy,
|
|
213
|
+
integrations,
|
|
214
|
+
defaults,
|
|
215
|
+
advanced
|
|
216
|
+
};
|
|
183
217
|
}
|
|
184
218
|
var EMPTY_SETTINGS = {
|
|
185
219
|
environment: {},
|
|
186
220
|
claude: {},
|
|
221
|
+
codex: {},
|
|
222
|
+
opencode: {},
|
|
187
223
|
brightsy: {},
|
|
188
224
|
integrations: {},
|
|
189
225
|
defaults: {},
|
|
@@ -240,6 +276,13 @@ function updateClaudeSettings(patch) {
|
|
|
240
276
|
function updateBrightsySettings(patch) {
|
|
241
277
|
const current = loadAppSettings();
|
|
242
278
|
const brightsy = { ...current.brightsy };
|
|
279
|
+
if ("executablePath" in patch) {
|
|
280
|
+
if (patch.executablePath == null || patch.executablePath.trim() === "") {
|
|
281
|
+
delete brightsy.executablePath;
|
|
282
|
+
} else {
|
|
283
|
+
brightsy.executablePath = patch.executablePath.trim();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
243
286
|
if (typeof patch.cloudConnectEnabled === "boolean") {
|
|
244
287
|
brightsy.cloudConnectEnabled = patch.cloudConnectEnabled;
|
|
245
288
|
}
|
|
@@ -250,8 +293,35 @@ function updateBrightsySettings(patch) {
|
|
|
250
293
|
brightsy.cloudConnectAgent = patch.cloudConnectAgent;
|
|
251
294
|
}
|
|
252
295
|
}
|
|
296
|
+
if (typeof patch.injectWorktreeMcp === "boolean") {
|
|
297
|
+
brightsy.injectWorktreeMcp = patch.injectWorktreeMcp;
|
|
298
|
+
}
|
|
253
299
|
return saveAppSettings({ ...current, brightsy });
|
|
254
300
|
}
|
|
301
|
+
function updateCodexSettings(patch) {
|
|
302
|
+
const current = loadAppSettings();
|
|
303
|
+
const codex = { ...current.codex };
|
|
304
|
+
if ("executablePath" in patch) {
|
|
305
|
+
if (patch.executablePath == null || patch.executablePath.trim() === "") {
|
|
306
|
+
delete codex.executablePath;
|
|
307
|
+
} else {
|
|
308
|
+
codex.executablePath = patch.executablePath.trim();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return saveAppSettings({ ...current, codex });
|
|
312
|
+
}
|
|
313
|
+
function updateOpencodeSettings(patch) {
|
|
314
|
+
const current = loadAppSettings();
|
|
315
|
+
const opencode = { ...current.opencode };
|
|
316
|
+
if ("executablePath" in patch) {
|
|
317
|
+
if (patch.executablePath == null || patch.executablePath.trim() === "") {
|
|
318
|
+
delete opencode.executablePath;
|
|
319
|
+
} else {
|
|
320
|
+
opencode.executablePath = patch.executablePath.trim();
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return saveAppSettings({ ...current, opencode });
|
|
324
|
+
}
|
|
255
325
|
function updateIntegrationsSettings(patch) {
|
|
256
326
|
const current = loadAppSettings();
|
|
257
327
|
const integrations = { ...current.integrations };
|
|
@@ -359,6 +429,9 @@ function getLinearApiKey(settings = loadAppSettings()) {
|
|
|
359
429
|
function brightsyCloudConnectEnabled(settings = loadAppSettings()) {
|
|
360
430
|
return Boolean(settings.brightsy.cloudConnectEnabled);
|
|
361
431
|
}
|
|
432
|
+
function brightsyInjectWorktreeMcpEnabled(settings = loadAppSettings()) {
|
|
433
|
+
return Boolean(settings.brightsy.injectWorktreeMcp);
|
|
434
|
+
}
|
|
362
435
|
function brightsyCloudConnectAgent(settings = loadAppSettings()) {
|
|
363
436
|
const fallback = settings.brightsy.cloudConnectAgent && CLOUD_CONNECT_AGENTS.has(settings.brightsy.cloudConnectAgent) ? settings.brightsy.cloudConnectAgent : "claude";
|
|
364
437
|
const preferred = getDefaultAgent(settings);
|
|
@@ -453,8 +526,42 @@ function maxConcurrentAgents(settings = loadAppSettings()) {
|
|
|
453
526
|
return 3;
|
|
454
527
|
}
|
|
455
528
|
function resolveClaudeExecutable(settings = loadAppSettings()) {
|
|
456
|
-
|
|
457
|
-
|
|
529
|
+
return resolveAgentExecutable("claude", settings);
|
|
530
|
+
}
|
|
531
|
+
var DEFAULT_CLI_BIN = {
|
|
532
|
+
claude: "claude",
|
|
533
|
+
codex: "codex",
|
|
534
|
+
opencode: "opencode",
|
|
535
|
+
brightsy: "brightsy"
|
|
536
|
+
};
|
|
537
|
+
function resolveAgentExecutable(agent, settings = loadAppSettings()) {
|
|
538
|
+
const fallback = DEFAULT_CLI_BIN[agent];
|
|
539
|
+
if (agent === "claude") {
|
|
540
|
+
const override2 = settings.claude.executablePath?.trim();
|
|
541
|
+
return override2 || fallback;
|
|
542
|
+
}
|
|
543
|
+
if (agent === "codex") {
|
|
544
|
+
const override2 = settings.codex.executablePath?.trim();
|
|
545
|
+
return override2 || fallback;
|
|
546
|
+
}
|
|
547
|
+
if (agent === "opencode") {
|
|
548
|
+
const override2 = settings.opencode.executablePath?.trim();
|
|
549
|
+
return override2 || fallback;
|
|
550
|
+
}
|
|
551
|
+
const override = settings.brightsy.executablePath?.trim();
|
|
552
|
+
return override || fallback;
|
|
553
|
+
}
|
|
554
|
+
function updateAgentExecutable(agent, executablePath) {
|
|
555
|
+
if (agent === "claude") {
|
|
556
|
+
return updateClaudeSettings({ executablePath });
|
|
557
|
+
}
|
|
558
|
+
if (agent === "codex") {
|
|
559
|
+
return updateCodexSettings({ executablePath });
|
|
560
|
+
}
|
|
561
|
+
if (agent === "opencode") {
|
|
562
|
+
return updateOpencodeSettings({ executablePath });
|
|
563
|
+
}
|
|
564
|
+
return updateBrightsySettings({ executablePath });
|
|
458
565
|
}
|
|
459
566
|
function claudeChromeEnabled(settings = loadAppSettings()) {
|
|
460
567
|
return Boolean(settings.claude.chromeEnabled);
|
|
@@ -492,6 +599,8 @@ export {
|
|
|
492
599
|
updateAppEnvironment,
|
|
493
600
|
updateClaudeSettings,
|
|
494
601
|
updateBrightsySettings,
|
|
602
|
+
updateCodexSettings,
|
|
603
|
+
updateOpencodeSettings,
|
|
495
604
|
updateIntegrationsSettings,
|
|
496
605
|
updateDefaultsSettings,
|
|
497
606
|
getDefaultAgent,
|
|
@@ -505,6 +614,7 @@ export {
|
|
|
505
614
|
resolveEffectiveIssueSource,
|
|
506
615
|
getLinearApiKey,
|
|
507
616
|
brightsyCloudConnectEnabled,
|
|
617
|
+
brightsyInjectWorktreeMcpEnabled,
|
|
508
618
|
brightsyCloudConnectAgent,
|
|
509
619
|
updateAdvancedSettings,
|
|
510
620
|
autoRenameBranchEnabled,
|
|
@@ -518,6 +628,8 @@ export {
|
|
|
518
628
|
orchestrationQuotaFallbackAgent,
|
|
519
629
|
maxConcurrentAgents,
|
|
520
630
|
resolveClaudeExecutable,
|
|
631
|
+
resolveAgentExecutable,
|
|
632
|
+
updateAgentExecutable,
|
|
521
633
|
claudeChromeEnabled,
|
|
522
634
|
applyAppEnvironment,
|
|
523
635
|
childEnvWithAppSettings,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-M37RITA6.js";
|
|
4
4
|
import {
|
|
5
5
|
run
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4UIYN56C.js";
|
|
7
7
|
|
|
8
8
|
// src/brightsy/connected-teams.ts
|
|
9
9
|
import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
@@ -36,7 +36,7 @@ function saveBrightsyConfig(cfg) {
|
|
|
36
36
|
|
|
37
37
|
// src/brightsy/accounts.ts
|
|
38
38
|
async function loadConnectedTeams() {
|
|
39
|
-
const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-
|
|
39
|
+
const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-OMDHTL6A.js");
|
|
40
40
|
return listConnectedBrightsyTeams2();
|
|
41
41
|
}
|
|
42
42
|
async function runBrightsyTeamsJson(args) {
|
|
@@ -68,7 +68,7 @@ async function getBrightsySession() {
|
|
|
68
68
|
const data = await runBrightsyTeamsJson([]);
|
|
69
69
|
const accounts = Array.isArray(data.teams) ? data.teams : [];
|
|
70
70
|
const active = data.active ?? accounts.find((a) => a.active) ?? null;
|
|
71
|
-
const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-
|
|
71
|
+
const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-OMDHTL6A.js");
|
|
72
72
|
const connectedTeams = ensureCliTeamTracked2(
|
|
73
73
|
active ? { id: active.id, slug: active.slug, name: active.name } : void 0
|
|
74
74
|
);
|
|
@@ -108,7 +108,7 @@ async function performBrightsyAccountSwitch(accountIdOrSlug) {
|
|
|
108
108
|
return { cfg, target: data.active };
|
|
109
109
|
}
|
|
110
110
|
async function switchBrightsyAccount(accountIdOrSlug) {
|
|
111
|
-
const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-
|
|
111
|
+
const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-OMDHTL6A.js");
|
|
112
112
|
await connectBrightsyTeam2(accountIdOrSlug);
|
|
113
113
|
return getBrightsySession();
|
|
114
114
|
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// src/git/run.ts
|
|
5
|
+
import { execa } from "execa";
|
|
6
|
+
|
|
7
|
+
// src/agents/path.ts
|
|
8
|
+
import { existsSync } from "fs";
|
|
9
|
+
import { execFileSync } from "child_process";
|
|
10
|
+
import { homedir } from "os";
|
|
11
|
+
import { delimiter, join } from "path";
|
|
12
|
+
var EXTRA_BIN_DIRS = [
|
|
13
|
+
".local/bin",
|
|
14
|
+
".cargo/bin",
|
|
15
|
+
".nvm/current/bin",
|
|
16
|
+
".asdf/shims",
|
|
17
|
+
".volta/bin",
|
|
18
|
+
".npm-global/bin",
|
|
19
|
+
// fnm default alias (common when shell init is skipped)
|
|
20
|
+
".local/share/fnm/aliases/default/bin",
|
|
21
|
+
// pnpm / npm global bins (where `@brightsy/cli` typically lands)
|
|
22
|
+
"Library/pnpm",
|
|
23
|
+
".pnpm"
|
|
24
|
+
];
|
|
25
|
+
function prependPathDir(env, dir) {
|
|
26
|
+
if (!dir || !existsSync(dir)) return;
|
|
27
|
+
const current = env.PATH ?? "";
|
|
28
|
+
const parts = current.split(delimiter).filter(Boolean);
|
|
29
|
+
if (parts.includes(dir)) {
|
|
30
|
+
env.PATH = current;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
env.PATH = [dir, ...parts].join(delimiter);
|
|
34
|
+
}
|
|
35
|
+
function conductorBundledBinDir(home = process.env.HOME || process.env.USERPROFILE || homedir()) {
|
|
36
|
+
return join(home, "Library", "Application Support", "com.conductor.app", "bin");
|
|
37
|
+
}
|
|
38
|
+
function isConductorBundledCli(filePath) {
|
|
39
|
+
const p = (filePath ?? "").replace(/\\/g, "/");
|
|
40
|
+
return p.includes("/com.conductor.app/bin/") || p.endsWith("/com.conductor.app/bin");
|
|
41
|
+
}
|
|
42
|
+
function ensureAgentPath(env = process.env) {
|
|
43
|
+
const home = env.HOME || env.USERPROFILE || homedir();
|
|
44
|
+
const current = env.PATH ?? "";
|
|
45
|
+
const parts = current.split(delimiter).filter(Boolean);
|
|
46
|
+
const seen = new Set(parts);
|
|
47
|
+
const extras = [
|
|
48
|
+
...EXTRA_BIN_DIRS.map((rel) => join(home, rel)),
|
|
49
|
+
"/opt/homebrew/bin",
|
|
50
|
+
"/usr/local/bin",
|
|
51
|
+
// Keep after Homebrew/npm so a user-installed CLI still wins.
|
|
52
|
+
conductorBundledBinDir(home)
|
|
53
|
+
];
|
|
54
|
+
for (const dir of extras.reverse()) {
|
|
55
|
+
if (!dir || seen.has(dir) || !existsSync(dir)) continue;
|
|
56
|
+
parts.unshift(dir);
|
|
57
|
+
seen.add(dir);
|
|
58
|
+
}
|
|
59
|
+
const next = parts.join(delimiter);
|
|
60
|
+
env.PATH = next;
|
|
61
|
+
return next;
|
|
62
|
+
}
|
|
63
|
+
function enrichPathWithNpmGlobalBin(env = process.env) {
|
|
64
|
+
ensureAgentPath(env);
|
|
65
|
+
try {
|
|
66
|
+
const prefix = execFileSync("npm", ["prefix", "-g"], {
|
|
67
|
+
encoding: "utf8",
|
|
68
|
+
env: { ...process.env, ...env },
|
|
69
|
+
timeout: 8e3,
|
|
70
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
71
|
+
}).trim().split(/\r?\n/).find(Boolean);
|
|
72
|
+
if (prefix) {
|
|
73
|
+
const binDir = process.platform === "win32" ? prefix : join(prefix, "bin");
|
|
74
|
+
prependPathDir(env, binDir);
|
|
75
|
+
}
|
|
76
|
+
} catch {
|
|
77
|
+
}
|
|
78
|
+
return env.PATH ?? "";
|
|
79
|
+
}
|
|
80
|
+
function posixShellSingleQuote(value) {
|
|
81
|
+
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
82
|
+
}
|
|
83
|
+
function resolveCommandBinarySync(command, whichPath) {
|
|
84
|
+
const trimmed = command.trim();
|
|
85
|
+
if (!trimmed) return trimmed;
|
|
86
|
+
const match = /^(\S+)(\s[\s\S]*)?$/.exec(trimmed);
|
|
87
|
+
if (!match) return trimmed;
|
|
88
|
+
const bin = match[1];
|
|
89
|
+
const rest = match[2] ?? "";
|
|
90
|
+
if (bin.includes("/") || bin.includes("\\")) return trimmed;
|
|
91
|
+
const abs = whichPath?.trim().split(/\r?\n/).find(Boolean);
|
|
92
|
+
if (!abs) return trimmed;
|
|
93
|
+
return `${abs}${rest}`;
|
|
94
|
+
}
|
|
95
|
+
function withExportedPath(command, pathValue) {
|
|
96
|
+
const trimmed = command.trim();
|
|
97
|
+
if (!trimmed) return trimmed;
|
|
98
|
+
if (/^(export\s+PATH=|PATH=)/.test(trimmed)) return trimmed;
|
|
99
|
+
return `export PATH=${posixShellSingleQuote(pathValue)} && ${trimmed}`;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// src/git/run.ts
|
|
103
|
+
async function run(file, args, opts) {
|
|
104
|
+
ensureAgentPath();
|
|
105
|
+
try {
|
|
106
|
+
const result = await execa(file, args, {
|
|
107
|
+
cwd: opts?.cwd,
|
|
108
|
+
env: { ...process.env, ...opts?.env },
|
|
109
|
+
reject: opts?.reject ?? true,
|
|
110
|
+
...opts?.timeoutMs != null ? { timeout: opts.timeoutMs } : {}
|
|
111
|
+
});
|
|
112
|
+
return {
|
|
113
|
+
stdout: result.stdout ?? "",
|
|
114
|
+
stderr: result.stderr ?? "",
|
|
115
|
+
exitCode: result.exitCode ?? 0
|
|
116
|
+
};
|
|
117
|
+
} catch (err) {
|
|
118
|
+
const e = err;
|
|
119
|
+
if (opts?.reject === false) {
|
|
120
|
+
return {
|
|
121
|
+
stdout: String(e.stdout ?? ""),
|
|
122
|
+
stderr: String(e.stderr ?? ""),
|
|
123
|
+
exitCode: e.exitCode ?? 1
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
throw err;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async function git(args, cwd, opts) {
|
|
130
|
+
const prefix = [];
|
|
131
|
+
if (opts?.config) {
|
|
132
|
+
for (const [key, value] of Object.entries(opts.config)) {
|
|
133
|
+
if (!key) continue;
|
|
134
|
+
prefix.push("-c", `${key}=${value}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return run("git", [...prefix, ...args], {
|
|
138
|
+
cwd,
|
|
139
|
+
reject: opts?.reject,
|
|
140
|
+
timeoutMs: opts?.timeoutMs,
|
|
141
|
+
// Never block forever on a credential/SSH prompt inside MCP / Electron.
|
|
142
|
+
env: {
|
|
143
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
144
|
+
GIT_ASKPASS: process.env.GIT_ASKPASS || "echo",
|
|
145
|
+
GIT_SSH_COMMAND: process.env.GIT_SSH_COMMAND || "ssh -o BatchMode=yes -o ConnectTimeout=15",
|
|
146
|
+
...opts?.env
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
async function gh(args, cwd, opts) {
|
|
151
|
+
return run("gh", args, {
|
|
152
|
+
cwd,
|
|
153
|
+
reject: opts?.reject,
|
|
154
|
+
timeoutMs: opts?.timeoutMs
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
async function resolveGhAuthToken(cwd) {
|
|
158
|
+
const result = await gh(["auth", "token"], cwd, { reject: false });
|
|
159
|
+
if (result.exitCode !== 0) return null;
|
|
160
|
+
const token = result.stdout.trim();
|
|
161
|
+
return token || null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export {
|
|
165
|
+
conductorBundledBinDir,
|
|
166
|
+
isConductorBundledCli,
|
|
167
|
+
ensureAgentPath,
|
|
168
|
+
enrichPathWithNpmGlobalBin,
|
|
169
|
+
posixShellSingleQuote,
|
|
170
|
+
resolveCommandBinarySync,
|
|
171
|
+
withExportedPath,
|
|
172
|
+
run,
|
|
173
|
+
git,
|
|
174
|
+
gh,
|
|
175
|
+
resolveGhAuthToken
|
|
176
|
+
};
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
assertOrchestratorCapableAgent
|
|
5
|
-
} from "./chunk-S2LL5HA4.js";
|
|
6
3
|
import {
|
|
7
4
|
ensureGlobalCoordinatorCwd
|
|
8
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-57WWNMFP.js";
|
|
9
6
|
import {
|
|
10
7
|
allocateTeamName,
|
|
11
8
|
takenSlugsFromThread,
|
|
12
9
|
teamSlugFromName
|
|
13
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LW5CMQGZ.js";
|
|
14
11
|
import {
|
|
15
12
|
createEmptyThread,
|
|
16
13
|
listThreads,
|
|
@@ -20,7 +17,7 @@ import {
|
|
|
20
17
|
import {
|
|
21
18
|
resolveNewThreadOptions,
|
|
22
19
|
resolveThreadDefaults
|
|
23
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-BPOTVI5J.js";
|
|
24
21
|
import {
|
|
25
22
|
globalAgentCwd
|
|
26
23
|
} from "./chunk-7MV3RXSC.js";
|
|
@@ -47,6 +44,30 @@ var CLOUD_COORDINATOR_TIMEOUT_REPLY = [
|
|
|
47
44
|
"What do you want me to do? (retry later, wait, force-stop, rephrase, or cancel)"
|
|
48
45
|
].join(" ");
|
|
49
46
|
|
|
47
|
+
// src/agents/orchestrator-capable.ts
|
|
48
|
+
var ORCHESTRATOR_AGENT_KINDS = [
|
|
49
|
+
"claude",
|
|
50
|
+
"codex",
|
|
51
|
+
"opencode",
|
|
52
|
+
"cursor"
|
|
53
|
+
];
|
|
54
|
+
function isOrchestratorCapableAgent(agent) {
|
|
55
|
+
return Boolean(
|
|
56
|
+
agent && ORCHESTRATOR_AGENT_KINDS.includes(agent)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
function assertOrchestratorCapableAgent(agent, context = "orchestration") {
|
|
60
|
+
if (!isOrchestratorCapableAgent(agent)) {
|
|
61
|
+
throw new Error(
|
|
62
|
+
`${agent} cannot run ${context} \u2014 it does not support Sideboard MCP. Use Claude, Cursor, Codex, or OpenCode.`
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return agent;
|
|
66
|
+
}
|
|
67
|
+
function coerceOrchestratorAgent(agent, fallback = "claude") {
|
|
68
|
+
return isOrchestratorCapableAgent(agent) ? agent : fallback;
|
|
69
|
+
}
|
|
70
|
+
|
|
50
71
|
// src/store/global-workspace.ts
|
|
51
72
|
var GLOBAL_WORKSPACE_ID = "__global__";
|
|
52
73
|
function isGlobalThread(thread) {
|
|
@@ -201,6 +222,10 @@ function ensureCloudCoordinator(agent) {
|
|
|
201
222
|
}
|
|
202
223
|
|
|
203
224
|
export {
|
|
225
|
+
ORCHESTRATOR_AGENT_KINDS,
|
|
226
|
+
isOrchestratorCapableAgent,
|
|
227
|
+
assertOrchestratorCapableAgent,
|
|
228
|
+
coerceOrchestratorAgent,
|
|
204
229
|
GLOBAL_WORKSPACE_ID,
|
|
205
230
|
isGlobalThread,
|
|
206
231
|
isGlobalRepoPath,
|