@sideboard-ai/core 0.1.174 → 0.1.176

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 (40) hide show
  1. package/dist/{abletime-PCLL36HW.js → abletime-BFIDZR3O.js} +2 -2
  2. package/dist/{abletime-7VW4EGPT.js → abletime-INEHQH6K.js} +2 -2
  3. package/dist/agents/cursor-runner.cjs +91 -62
  4. package/dist/agents/cursor-runner.js +1 -1
  5. package/dist/{agents-ZWYRGFZB.js → agents-544IX5KA.js} +8 -6
  6. package/dist/{agents-LMPVUPOH.js → agents-UENEQ6J2.js} +7 -5
  7. package/dist/{chunk-ZY7K4T37.js → chunk-3ZFGZ7RT.js} +5 -5
  8. package/dist/{chunk-HJPGIETB.js → chunk-4ELBAYFW.js} +19 -14
  9. package/dist/{chunk-M267JPEA.js → chunk-AN3THU7F.js} +1 -1
  10. package/dist/{chunk-AQPVBVJE.js → chunk-BBNUL4IE.js} +1 -1
  11. package/dist/{chunk-VCVBICMZ.js → chunk-FJWQCZ74.js} +5 -5
  12. package/dist/{chunk-LZ6QMEQC.js → chunk-HVIEYTUK.js} +1 -1
  13. package/dist/{chunk-XD2BAANL.js → chunk-IEEAVWAP.js} +6 -6
  14. package/dist/{chunk-YEPVWJ3R.js → chunk-JUA7XEXR.js} +16 -11
  15. package/dist/{chunk-ELBYOGVA.js → chunk-N7WZ6NIN.js} +10 -1
  16. package/dist/{chunk-CUA4S537.js → chunk-NIB6BTC6.js} +9 -5
  17. package/dist/{chunk-XXIH6XYR.js → chunk-NQTKRAUF.js} +167 -35
  18. package/dist/{chunk-CMJ2FBBV.js → chunk-RE2YWFUQ.js} +1 -1
  19. package/dist/{chunk-6GN5WPYZ.js → chunk-VKQGAWHY.js} +10 -1
  20. package/dist/{chunk-TPPZXZTA.js → chunk-W44EKPIR.js} +228 -95
  21. package/dist/{chunk-S42XV45P.js → chunk-Y4MIXGPA.js} +1 -1
  22. package/dist/{connected-teams-DBWAMP7G.js → connected-teams-ON2KIKQX.js} +3 -3
  23. package/dist/{connected-teams-WGONUQOF.js → connected-teams-WOYCH7FR.js} +3 -3
  24. package/dist/{coordinator-prompt-K3HXEPFD.js → coordinator-prompt-BE2FERYE.js} +1 -1
  25. package/dist/{coordinator-prompt-LJKA2ODR.js → coordinator-prompt-PRM5ARWG.js} +1 -1
  26. package/dist/{global-workspace-VDFSU3DD.js → global-workspace-3HIWNQ3B.js} +1 -1
  27. package/dist/{global-workspace-KA7T26F5.js → global-workspace-J737XNUX.js} +1 -1
  28. package/dist/index.cjs +584 -379
  29. package/dist/index.d.cts +53 -10
  30. package/dist/index.d.ts +53 -10
  31. package/dist/index.js +76 -27
  32. package/dist/mcp/run-stdio.cjs +778 -576
  33. package/dist/mcp/run-stdio.js +78 -27
  34. package/dist/{oauth-A7XXI2TM.js → oauth-6ZQ4Q4XN.js} +2 -2
  35. package/dist/{oauth-YJBAURIJ.js → oauth-O7UGLZOY.js} +2 -2
  36. package/dist/{orchestrator-DMSSC4SV.js → orchestrator-2KZD7N4X.js} +6 -6
  37. package/dist/{orchestrator-VMUZJFTZ.js → orchestrator-GDKEVLFK.js} +7 -7
  38. package/dist/{workspaces-GOGBPATJ.js → workspaces-DR4UNOQC.js} +1 -1
  39. package/dist/{workspaces-UR7YEFMZ.js → workspaces-ULHYXM4Y.js} +1 -1
  40. package/package.json +1 -1
@@ -5,13 +5,13 @@ import {
5
5
  brightsyMcpServerName,
6
6
  ensureCliTeamTracked,
7
7
  ensureConnectedBrightsyTeamTokens
8
- } from "./chunk-LZ6QMEQC.js";
8
+ } from "./chunk-HVIEYTUK.js";
9
9
  import {
10
10
  loadBrightsyConfig
11
- } from "./chunk-S42XV45P.js";
11
+ } from "./chunk-Y4MIXGPA.js";
12
12
  import {
13
13
  isOrchestratorThread
14
- } from "./chunk-VCVBICMZ.js";
14
+ } from "./chunk-FJWQCZ74.js";
15
15
  import {
16
16
  codexUnattendedGitConfigArgs,
17
17
  mergeAgentGitAuthEnv,
@@ -782,7 +782,7 @@ var brightsyAdapter = {
782
782
  };
783
783
 
784
784
  // src/agents/claude.ts
785
- import { existsSync as existsSync5 } from "fs";
785
+ import { existsSync as existsSync6 } from "fs";
786
786
 
787
787
  // src/agents/claude-mcp.ts
788
788
  function parseMcpList(text) {
@@ -1270,10 +1270,10 @@ function normalizeParseResult(parsed) {
1270
1270
  }
1271
1271
 
1272
1272
  // src/agents/injected-mcp.ts
1273
- import { existsSync as existsSync4, mkdtempSync, writeFileSync } from "fs";
1273
+ import { existsSync as existsSync5, mkdtempSync, writeFileSync as writeFileSync2 } from "fs";
1274
1274
  import { createRequire } from "module";
1275
1275
  import { tmpdir } from "os";
1276
- import { dirname, join as join3 } from "path";
1276
+ import { dirname as dirname2, join as join4 } from "path";
1277
1277
  import { fileURLToPath } from "url";
1278
1278
 
1279
1279
  // src/mcp/profile.ts
@@ -1283,13 +1283,138 @@ function sideboardMcpProfile(env = process.env) {
1283
1283
  }
1284
1284
 
1285
1285
  // src/agents/node-launch.ts
1286
- import { existsSync as existsSync3, readdirSync, realpathSync } from "fs";
1286
+ import { existsSync as existsSync4, readdirSync, realpathSync } from "fs";
1287
1287
  import { homedir } from "os";
1288
- import { join as join2 } from "path";
1288
+ import { join as join3 } from "path";
1289
+
1290
+ // src/http/system-ca.ts
1291
+ import { spawnSync } from "child_process";
1292
+ import { existsSync as existsSync2, mkdirSync, readFileSync, statSync, writeFileSync } from "fs";
1293
+ import { dirname, join } from "path";
1294
+ import tls from "tls";
1295
+ var NODE_USE_SYSTEM_CA = "NODE_USE_SYSTEM_CA";
1296
+ var NODE_EXTRA_CA_CERTS = "NODE_EXTRA_CA_CERTS";
1297
+ var BUNDLE_NAME = "system-ca.pem";
1298
+ var BUNDLE_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
1299
+ var LINUX_CA_FILES = [
1300
+ "/etc/ssl/certs/ca-certificates.crt",
1301
+ "/etc/pki/tls/certs/ca-bundle.crt",
1302
+ "/etc/ssl/ca-bundle.pem",
1303
+ "/etc/ssl/cert.pem"
1304
+ ];
1305
+ var PEM_CERT_RE = /-----BEGIN CERTIFICATE-----[\s\S]*?-----END CERTIFICATE-----/g;
1306
+ function splitPemCertificates(pem) {
1307
+ return pem.match(PEM_CERT_RE) ?? [];
1308
+ }
1309
+ function readExistingFile(path) {
1310
+ try {
1311
+ return existsSync2(path) ? readFileSync(path, "utf8") : "";
1312
+ } catch {
1313
+ return "";
1314
+ }
1315
+ }
1316
+ function darwinKeychainPem(spawn) {
1317
+ const result = spawn("/usr/bin/security", ["find-certificate", "-a", "-p"], {
1318
+ encoding: "utf8",
1319
+ maxBuffer: 32 * 1024 * 1024,
1320
+ timeout: 15e3
1321
+ });
1322
+ if (result.status !== 0) return "";
1323
+ return typeof result.stdout === "string" ? result.stdout : "";
1324
+ }
1325
+ function linuxSystemCaPem() {
1326
+ for (const path of LINUX_CA_FILES) {
1327
+ const pem = readExistingFile(path);
1328
+ if (splitPemCertificates(pem).length > 0) return pem;
1329
+ }
1330
+ return "";
1331
+ }
1332
+ function collectSystemCaPem(io = {}) {
1333
+ const platform = io.platform ?? process.platform;
1334
+ if (platform === "darwin") {
1335
+ return darwinKeychainPem(io.spawn ?? spawnSync);
1336
+ }
1337
+ if (platform === "linux") {
1338
+ return linuxSystemCaPem();
1339
+ }
1340
+ return "";
1341
+ }
1342
+ function systemCaBundlePath(io = {}) {
1343
+ return join((io.appData ?? appDataDir)(), BUNDLE_NAME);
1344
+ }
1345
+ function bundleIsFresh(path, now) {
1346
+ try {
1347
+ if (!existsSync2(path)) return false;
1348
+ if (splitPemCertificates(readFileSync(path, "utf8")).length === 0) return false;
1349
+ return now - statSync(path).mtimeMs < BUNDLE_MAX_AGE_MS;
1350
+ } catch {
1351
+ return false;
1352
+ }
1353
+ }
1354
+ function materializeSystemCaBundle(io = {}) {
1355
+ const inherited = process.env.NODE_EXTRA_CA_CERTS?.trim();
1356
+ if (inherited && splitPemCertificates(readExistingFile(inherited)).length > 0) {
1357
+ return inherited;
1358
+ }
1359
+ const platform = io.platform ?? process.platform;
1360
+ if (platform === "linux") {
1361
+ for (const path of LINUX_CA_FILES) {
1362
+ if (splitPemCertificates(readExistingFile(path)).length > 0) return path;
1363
+ }
1364
+ }
1365
+ const dest = systemCaBundlePath(io);
1366
+ const now = (io.now ?? Date.now)();
1367
+ if (bundleIsFresh(dest, now)) return dest;
1368
+ const pem = collectSystemCaPem(io);
1369
+ if (splitPemCertificates(pem).length === 0) {
1370
+ return existsSync2(dest) && splitPemCertificates(readExistingFile(dest)).length > 0 ? dest : void 0;
1371
+ }
1372
+ try {
1373
+ mkdirSync(dirname(dest), { recursive: true });
1374
+ writeFileSync(dest, pem.endsWith("\n") ? pem : `${pem}
1375
+ `, { mode: 384 });
1376
+ return dest;
1377
+ } catch {
1378
+ return void 0;
1379
+ }
1380
+ }
1381
+ function applySystemCaEnv(env) {
1382
+ if (!String(env[NODE_USE_SYSTEM_CA] ?? "").trim()) {
1383
+ env[NODE_USE_SYSTEM_CA] = "1";
1384
+ }
1385
+ if (String(env[NODE_EXTRA_CA_CERTS] ?? "").trim()) return;
1386
+ const inherited = process.env.NODE_EXTRA_CA_CERTS?.trim();
1387
+ if (inherited) env[NODE_EXTRA_CA_CERTS] = inherited;
1388
+ }
1389
+ function extraCertsFromBundle() {
1390
+ const path = process.env.NODE_EXTRA_CA_CERTS?.trim();
1391
+ if (path) return splitPemCertificates(readExistingFile(path));
1392
+ const dest = systemCaBundlePath();
1393
+ return splitPemCertificates(readExistingFile(dest));
1394
+ }
1395
+ function trustSystemCertificates(io = {}) {
1396
+ try {
1397
+ const api = tls;
1398
+ if (typeof api.getCACertificates !== "function" || typeof api.setDefaultCACertificates !== "function") {
1399
+ return false;
1400
+ }
1401
+ const current = api.getCACertificates("default");
1402
+ const system = api.getCACertificates("system");
1403
+ let extra = extraCertsFromBundle();
1404
+ if (system.length === 0 && extra.length === 0) {
1405
+ extra = splitPemCertificates(collectSystemCaPem(io));
1406
+ }
1407
+ if (system.length === 0 && extra.length === 0) return false;
1408
+ api.setDefaultCACertificates([...current, ...system, ...extra]);
1409
+ return true;
1410
+ } catch {
1411
+ return false;
1412
+ }
1413
+ }
1289
1414
 
1290
1415
  // src/agents/packaged-runtime.ts
1291
- import { existsSync as existsSync2 } from "fs";
1292
- import { join } from "path";
1416
+ import { existsSync as existsSync3 } from "fs";
1417
+ import { join as join2 } from "path";
1293
1418
  function electronResourcesPath() {
1294
1419
  const resources = process.resourcesPath;
1295
1420
  if (typeof resources !== "string" || !resources) return null;
@@ -1298,36 +1423,36 @@ function electronResourcesPath() {
1298
1423
  function packagedCursorRuntimeDir() {
1299
1424
  const resources = electronResourcesPath();
1300
1425
  if (!resources) return null;
1301
- const dir = join(resources, "cursor-runtime");
1302
- if (!existsSync2(join(dir, "core-dist", "agents", "cursor-runner.js"))) return null;
1426
+ const dir = join2(resources, "cursor-runtime");
1427
+ if (!existsSync3(join2(dir, "core-dist", "agents", "cursor-runner.js"))) return null;
1303
1428
  return dir;
1304
1429
  }
1305
1430
  function packagedCursorRunnerPath() {
1306
1431
  const dir = packagedCursorRuntimeDir();
1307
- return dir ? join(dir, "core-dist", "agents", "cursor-runner.js") : null;
1432
+ return dir ? join2(dir, "core-dist", "agents", "cursor-runner.js") : null;
1308
1433
  }
1309
1434
  function packagedMcpDir() {
1310
1435
  const resources = electronResourcesPath();
1311
1436
  if (!resources) return null;
1312
- const dir = join(resources, "sideboard-mcp");
1313
- if (!existsSync2(join(dir, "core-dist", "mcp", "run-stdio.js"))) return null;
1437
+ const dir = join2(resources, "sideboard-mcp");
1438
+ if (!existsSync3(join2(dir, "core-dist", "mcp", "run-stdio.js"))) return null;
1314
1439
  return dir;
1315
1440
  }
1316
1441
  function packagedMcpStdioPath() {
1317
1442
  const dir = packagedMcpDir();
1318
- return dir ? join(dir, "core-dist", "mcp", "run-stdio.js") : null;
1443
+ return dir ? join2(dir, "core-dist", "mcp", "run-stdio.js") : null;
1319
1444
  }
1320
1445
  function packagedBundledNodePath() {
1321
1446
  const resources = electronResourcesPath();
1322
1447
  if (!resources) return null;
1323
- const bin = join(resources, "node", "bin", "node");
1324
- if (!existsSync2(bin)) return null;
1448
+ const bin = join2(resources, "node", "bin", "node");
1449
+ if (!existsSync3(bin)) return null;
1325
1450
  return bin;
1326
1451
  }
1327
1452
  function packagedCursorRipgrepCandidate(platformPkg, binName) {
1328
1453
  const dir = packagedCursorRuntimeDir();
1329
1454
  if (!dir) return null;
1330
- return join(dir, "node_modules", platformPkg, "bin", binName);
1455
+ return join2(dir, "node_modules", platformPkg, "bin", binName);
1331
1456
  }
1332
1457
 
1333
1458
  // src/agents/node-launch.ts
@@ -1348,6 +1473,7 @@ function applyAgentRunnerHeapEnv(env) {
1348
1473
  env.NODE_OPTIONS,
1349
1474
  AGENT_RUNNER_MAX_OLD_SPACE_MB
1350
1475
  );
1476
+ applySystemCaEnv(env);
1351
1477
  }
1352
1478
  function envWithAgentHeap(env) {
1353
1479
  const next = { ...env };
@@ -1362,7 +1488,7 @@ function unpackedAsarPath(filePath) {
1362
1488
  if (!isAsarPath(filePath)) return null;
1363
1489
  const unpacked = filePath.replace(/\.asar(?=[/\\])/, ".asar.unpacked");
1364
1490
  if (unpacked === filePath) return null;
1365
- return existsSync3(unpacked) ? unpacked : null;
1491
+ return existsSync4(unpacked) ? unpacked : null;
1366
1492
  }
1367
1493
  function nodeReadableScriptPath(scriptPath) {
1368
1494
  return unpackedAsarPath(scriptPath) ?? scriptPath;
@@ -1403,7 +1529,7 @@ function pickPreferredNode(candidates) {
1403
1529
  return best;
1404
1530
  }
1405
1531
  function versionDirNodeBins(root, toBin) {
1406
- if (!existsSync3(root)) return [];
1532
+ if (!existsSync4(root)) return [];
1407
1533
  try {
1408
1534
  return readdirSync(root).map(toBin);
1409
1535
  } catch {
@@ -1412,28 +1538,28 @@ function versionDirNodeBins(root, toBin) {
1412
1538
  }
1413
1539
  function defaultNodeBinCandidates(home = homedir()) {
1414
1540
  const kegs = ["/opt/homebrew", "/usr/local"].flatMap(
1415
- (prefix) => PREFERRED_LTS_MAJORS.map((major) => join2(prefix, "opt", `node@${major}`, "bin", "node"))
1541
+ (prefix) => PREFERRED_LTS_MAJORS.map((major) => join3(prefix, "opt", `node@${major}`, "bin", "node"))
1416
1542
  );
1417
1543
  return [
1418
1544
  ...kegs,
1419
1545
  "/opt/homebrew/bin/node",
1420
1546
  "/usr/local/bin/node",
1421
- join2(home, ".local/share/fnm/aliases/default/bin/node"),
1422
- join2(home, ".nvm/current/bin/node"),
1423
- join2(home, ".volta/bin/node"),
1424
- join2(home, ".asdf/shims/node"),
1425
- join2(home, ".local/share/mise/shims/node"),
1547
+ join3(home, ".local/share/fnm/aliases/default/bin/node"),
1548
+ join3(home, ".nvm/current/bin/node"),
1549
+ join3(home, ".volta/bin/node"),
1550
+ join3(home, ".asdf/shims/node"),
1551
+ join3(home, ".local/share/mise/shims/node"),
1426
1552
  ...versionDirNodeBins(
1427
- join2(home, ".nvm", "versions", "node"),
1428
- (name) => join2(home, ".nvm", "versions", "node", name, "bin", "node")
1553
+ join3(home, ".nvm", "versions", "node"),
1554
+ (name) => join3(home, ".nvm", "versions", "node", name, "bin", "node")
1429
1555
  ),
1430
1556
  ...versionDirNodeBins(
1431
- join2(home, ".local/share/fnm", "node-versions"),
1432
- (name) => join2(home, ".local/share/fnm", "node-versions", name, "installation", "bin", "node")
1557
+ join3(home, ".local/share/fnm", "node-versions"),
1558
+ (name) => join3(home, ".local/share/fnm", "node-versions", name, "installation", "bin", "node")
1433
1559
  ),
1434
1560
  ...versionDirNodeBins(
1435
- join2(home, ".volta", "tools", "image", "node"),
1436
- (name) => join2(home, ".volta", "tools", "image", "node", name, "bin", "node")
1561
+ join3(home, ".volta", "tools", "image", "node"),
1562
+ (name) => join3(home, ".volta", "tools", "image", "node", name, "bin", "node")
1437
1563
  )
1438
1564
  ];
1439
1565
  }
@@ -1442,7 +1568,7 @@ function uniqueExistingNodeBins(paths) {
1442
1568
  const out = [];
1443
1569
  for (const raw of paths) {
1444
1570
  const p = raw.trim();
1445
- if (!p || !existsSync3(p) || isElectronLikeCommand(p)) continue;
1571
+ if (!p || !existsSync4(p) || isElectronLikeCommand(p)) continue;
1446
1572
  let key = p;
1447
1573
  try {
1448
1574
  key = realpathSync(p);
@@ -1637,37 +1763,37 @@ function corePackageDir() {
1637
1763
  try {
1638
1764
  const url = import.meta.url;
1639
1765
  if (typeof url === "string" && url.length > 0) {
1640
- return dirname(fileURLToPath(url));
1766
+ return dirname2(fileURLToPath(url));
1641
1767
  }
1642
1768
  } catch {
1643
1769
  }
1644
1770
  try {
1645
- const req = createRequire(join3(process.cwd(), "package.json"));
1646
- return dirname(req.resolve("@sideboard-ai/core"));
1771
+ const req = createRequire(join4(process.cwd(), "package.json"));
1772
+ return dirname2(req.resolve("@sideboard-ai/core"));
1647
1773
  } catch {
1648
1774
  return process.cwd();
1649
1775
  }
1650
1776
  }
1651
1777
  function findSideboardMcpJsEntry() {
1652
1778
  const override = process.env.SIDEBOARD_MCP_ENTRY?.trim() || process.env.SIDEBOARD_CLI?.trim();
1653
- if (override && existsSync4(override)) return override;
1779
+ if (override && existsSync5(override)) return override;
1654
1780
  const packaged = packagedMcpStdioPath();
1655
1781
  if (packaged) return packaged;
1656
1782
  let dir = corePackageDir();
1657
1783
  for (let i = 0; i < 10; i++) {
1658
1784
  const candidates = [
1659
- join3(dir, "mcp/run-stdio.js"),
1660
- join3(dir, "mcp/run-stdio.cjs"),
1661
- join3(dir, "dist/mcp/run-stdio.js"),
1662
- join3(dir, "dist/mcp/run-stdio.cjs"),
1663
- join3(dir, "packages/core/dist/mcp/run-stdio.js"),
1664
- join3(dir, "packages/cli/dist/index.js"),
1665
- join3(dir, "cli/dist/index.js")
1785
+ join4(dir, "mcp/run-stdio.js"),
1786
+ join4(dir, "mcp/run-stdio.cjs"),
1787
+ join4(dir, "dist/mcp/run-stdio.js"),
1788
+ join4(dir, "dist/mcp/run-stdio.cjs"),
1789
+ join4(dir, "packages/core/dist/mcp/run-stdio.js"),
1790
+ join4(dir, "packages/cli/dist/index.js"),
1791
+ join4(dir, "cli/dist/index.js")
1666
1792
  ];
1667
1793
  for (const p of candidates) {
1668
- if (existsSync4(p) && !isAsarPath(p)) return p;
1794
+ if (existsSync5(p) && !isAsarPath(p)) return p;
1669
1795
  }
1670
- const parent = dirname(dir);
1796
+ const parent = dirname2(dir);
1671
1797
  if (parent === dir) break;
1672
1798
  dir = parent;
1673
1799
  }
@@ -1814,9 +1940,9 @@ function writeMcpServersConfig(servers) {
1814
1940
  ...env ? { env } : {}
1815
1941
  };
1816
1942
  }
1817
- const dir = mkdtempSync(join3(tmpdir(), "sideboard-mcp-"));
1818
- const cfgPath = join3(dir, "mcp.json");
1819
- writeFileSync(cfgPath, JSON.stringify({ mcpServers }, null, 2));
1943
+ const dir = mkdtempSync(join4(tmpdir(), "sideboard-mcp-"));
1944
+ const cfgPath = join4(dir, "mcp.json");
1945
+ writeFileSync2(cfgPath, JSON.stringify({ mcpServers }, null, 2));
1820
1946
  return cfgPath;
1821
1947
  }
1822
1948
 
@@ -2167,7 +2293,7 @@ var claudeAdapter = {
2167
2293
  async detect() {
2168
2294
  const claude = resolveClaudeExecutable();
2169
2295
  if (claude !== "claude") {
2170
- if (!existsSync5(claude)) {
2296
+ if (!existsSync6(claude)) {
2171
2297
  return {
2172
2298
  agent: "claude",
2173
2299
  installed: false,
@@ -2216,7 +2342,7 @@ var claudeAdapter = {
2216
2342
  );
2217
2343
  }
2218
2344
  const mode = permissionMode(thread);
2219
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-KA7T26F5.js");
2345
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-J737XNUX.js");
2220
2346
  const isOrchestrator = isOrchestratorThread2(thread);
2221
2347
  const injectedServers = await buildInjectedMcpServers({
2222
2348
  includeSideboard: true,
@@ -2449,20 +2575,20 @@ function parseIssuesJson(raw) {
2449
2575
  }
2450
2576
 
2451
2577
  // src/agents/codex.ts
2452
- import { existsSync as existsSync8, readFileSync as readFileSync3, statSync } from "fs";
2578
+ import { existsSync as existsSync9, readFileSync as readFileSync4, statSync as statSync2 } from "fs";
2453
2579
  import { homedir as homedir4 } from "os";
2454
- import { join as join6 } from "path";
2580
+ import { join as join7 } from "path";
2455
2581
 
2456
2582
  // src/agents/orch-mcp-isolation.ts
2457
- import { existsSync as existsSync7, readFileSync as readFileSync2 } from "fs";
2583
+ import { existsSync as existsSync8, readFileSync as readFileSync3 } from "fs";
2458
2584
  import { homedir as homedir3 } from "os";
2459
- import { join as join5 } from "path";
2585
+ import { join as join6 } from "path";
2460
2586
  import { parse as parseToml } from "smol-toml";
2461
2587
 
2462
2588
  // src/agents/user-mcp-config.ts
2463
- import { existsSync as existsSync6, mkdirSync, readFileSync, writeFileSync as writeFileSync2 } from "fs";
2589
+ import { existsSync as existsSync7, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync3 } from "fs";
2464
2590
  import { homedir as homedir2 } from "os";
2465
- import { dirname as dirname2, join as join4 } from "path";
2591
+ import { dirname as dirname3, join as join5 } from "path";
2466
2592
 
2467
2593
  // src/agents/orch-mcp-isolation.ts
2468
2594
  function isInjectedOrchMcpName(name) {
@@ -2486,25 +2612,25 @@ function listMcpNamesFromCodexToml(text) {
2486
2612
  }
2487
2613
  function readJsonObject(path) {
2488
2614
  try {
2489
- return JSON.parse(readFileSync2(path, "utf8"));
2615
+ return JSON.parse(readFileSync3(path, "utf8"));
2490
2616
  } catch {
2491
2617
  return {};
2492
2618
  }
2493
2619
  }
2494
2620
  function readText(path) {
2495
2621
  try {
2496
- return readFileSync2(path, "utf8");
2622
+ return readFileSync3(path, "utf8");
2497
2623
  } catch {
2498
2624
  return "";
2499
2625
  }
2500
2626
  }
2501
2627
  function userCodexConfigPaths(home = homedir3()) {
2502
- return [join5(home, ".codex", "config.toml"), join5(home, ".config", "codex", "config.toml")];
2628
+ return [join6(home, ".codex", "config.toml"), join6(home, ".config", "codex", "config.toml")];
2503
2629
  }
2504
2630
  function userOpencodeConfigPaths(home = homedir3()) {
2505
2631
  return [
2506
- join5(home, ".config", "opencode", "opencode.json"),
2507
- join5(home, ".config", "opencode", "opencode.jsonc")
2632
+ join6(home, ".config", "opencode", "opencode.json"),
2633
+ join6(home, ".config", "opencode", "opencode.jsonc")
2508
2634
  ];
2509
2635
  }
2510
2636
  function userMcpNamesToDisable(opts) {
@@ -2526,7 +2652,7 @@ function userMcpNamesToDisable(opts) {
2526
2652
  function listUserCodexMcpNames(home = homedir3()) {
2527
2653
  const names = [];
2528
2654
  for (const path of userCodexConfigPaths(home)) {
2529
- if (!existsSync7(path)) continue;
2655
+ if (!existsSync8(path)) continue;
2530
2656
  names.push(...listMcpNamesFromCodexToml(readText(path)));
2531
2657
  }
2532
2658
  return names;
@@ -2534,7 +2660,7 @@ function listUserCodexMcpNames(home = homedir3()) {
2534
2660
  function listUserOpencodeMcpNames(home = homedir3()) {
2535
2661
  const names = [];
2536
2662
  for (const path of userOpencodeConfigPaths(home)) {
2537
- if (!existsSync7(path)) continue;
2663
+ if (!existsSync8(path)) continue;
2538
2664
  names.push(...listMcpNamesFromJsonMap(readJsonObject(path), "mcp"));
2539
2665
  }
2540
2666
  return names;
@@ -2568,7 +2694,7 @@ async function listCodexModels() {
2568
2694
  if (codex === "codex") {
2569
2695
  const which = await run("which", ["codex"], { reject: false });
2570
2696
  if (which.exitCode !== 0) return FALLBACK_CODEX_MODELS;
2571
- } else if (!existsSync8(codex)) {
2697
+ } else if (!existsSync9(codex)) {
2572
2698
  return FALLBACK_CODEX_MODELS;
2573
2699
  }
2574
2700
  const listed = await run(codex, ["debug", "models"], { reject: false });
@@ -2603,12 +2729,12 @@ function usageFromCodex(usage) {
2603
2729
  }
2604
2730
  function codexConfigHasNetworkAccess() {
2605
2731
  const candidates = [
2606
- join6(homedir4(), ".codex", "config.toml"),
2607
- join6(homedir4(), ".config", "codex", "config.toml")
2732
+ join7(homedir4(), ".codex", "config.toml"),
2733
+ join7(homedir4(), ".config", "codex", "config.toml")
2608
2734
  ];
2609
2735
  for (const path of candidates) {
2610
- if (!existsSync8(path)) continue;
2611
- const text = readFileSync3(path, "utf8");
2736
+ if (!existsSync9(path)) continue;
2737
+ const text = readFileSync4(path, "utf8");
2612
2738
  if (/network_access\s*=\s*true/.test(text)) return true;
2613
2739
  }
2614
2740
  return false;
@@ -2640,10 +2766,10 @@ function asRecord2(value) {
2640
2766
  return void 0;
2641
2767
  }
2642
2768
  function codexLooksAuthenticated() {
2643
- const authPath = join6(homedir4(), ".codex", "auth.json");
2644
- if (!existsSync8(authPath)) return false;
2769
+ const authPath = join7(homedir4(), ".codex", "auth.json");
2770
+ if (!existsSync9(authPath)) return false;
2645
2771
  try {
2646
- return statSync(authPath).size > 2;
2772
+ return statSync2(authPath).size > 2;
2647
2773
  } catch {
2648
2774
  return false;
2649
2775
  }
@@ -2653,7 +2779,7 @@ var codexAdapter = {
2653
2779
  async detect() {
2654
2780
  const codex = resolveAgentExecutable("codex");
2655
2781
  if (codex !== "codex") {
2656
- if (!existsSync8(codex)) {
2782
+ if (!existsSync9(codex)) {
2657
2783
  return {
2658
2784
  agent: "codex",
2659
2785
  installed: false,
@@ -2921,9 +3047,9 @@ var codexAdapter = {
2921
3047
  };
2922
3048
 
2923
3049
  // src/agents/cursor.ts
2924
- import { existsSync as existsSync10 } from "fs";
3050
+ import { existsSync as existsSync11 } from "fs";
2925
3051
  import { createRequire as createRequire3 } from "module";
2926
- import { dirname as dirname4, join as join8 } from "path";
3052
+ import { dirname as dirname5, join as join9 } from "path";
2927
3053
  import { fileURLToPath as fileURLToPath2 } from "url";
2928
3054
  import { Cursor } from "@cursor/sdk";
2929
3055
 
@@ -3139,9 +3265,9 @@ function parseCursorRunnerLine(line) {
3139
3265
  }
3140
3266
 
3141
3267
  // src/agents/cursor-ripgrep.ts
3142
- import { existsSync as existsSync9 } from "fs";
3268
+ import { existsSync as existsSync10 } from "fs";
3143
3269
  import { createRequire as createRequire2 } from "module";
3144
- import { dirname as dirname3, isAbsolute, join as join7, parse, resolve as resolvePath } from "path";
3270
+ import { dirname as dirname4, isAbsolute, join as join8, parse, resolve as resolvePath } from "path";
3145
3271
  var RIPGREP_ENV = "CURSOR_RIPGREP_PATH";
3146
3272
  function rgBinaryName() {
3147
3273
  return process.platform === "win32" ? "rg.exe" : "rg";
@@ -3153,19 +3279,19 @@ function usableRipgrepPath(candidate) {
3153
3279
  const raw = candidate?.trim();
3154
3280
  if (!raw || !isAbsolute(raw)) return null;
3155
3281
  const readable = nodeReadableScriptPath(raw);
3156
- if (!existsSync9(readable) || isAsarPath(readable)) return null;
3282
+ if (!existsSync10(readable) || isAsarPath(readable)) return null;
3157
3283
  return readable;
3158
3284
  }
3159
3285
  function walkForBundledRipgrep(startFile) {
3160
3286
  if (!startFile) return null;
3161
3287
  const pkg = platformRipgrepPackage();
3162
3288
  const name = rgBinaryName();
3163
- let dir = dirname3(resolvePath(startFile));
3289
+ let dir = dirname4(resolvePath(startFile));
3164
3290
  const root = parse(dir).root;
3165
3291
  while (dir !== root) {
3166
- const hit = usableRipgrepPath(join7(dir, "node_modules", pkg, "bin", name));
3292
+ const hit = usableRipgrepPath(join8(dir, "node_modules", pkg, "bin", name));
3167
3293
  if (hit) return hit;
3168
- const next = dirname3(dir);
3294
+ const next = dirname4(dir);
3169
3295
  if (next === dir) break;
3170
3296
  dir = next;
3171
3297
  }
@@ -3175,7 +3301,7 @@ function requireResolveBundledRipgrep(fromFile) {
3175
3301
  try {
3176
3302
  const req = createRequire2(fromFile);
3177
3303
  const pkgJson = req.resolve(`${platformRipgrepPackage()}/package.json`);
3178
- return usableRipgrepPath(join7(dirname3(pkgJson), "bin", rgBinaryName()));
3304
+ return usableRipgrepPath(join8(dirname4(pkgJson), "bin", rgBinaryName()));
3179
3305
  } catch {
3180
3306
  return null;
3181
3307
  }
@@ -3211,6 +3337,9 @@ function resolveCursorApiKey() {
3211
3337
  if (fromEnv) return fromEnv;
3212
3338
  return (loadAppSettings().environment.CURSOR_API_KEY || "").trim();
3213
3339
  }
3340
+ function isCursorApiKeyConfigured() {
3341
+ return Boolean(resolveCursorApiKey());
3342
+ }
3214
3343
  function isCursorAutoModel(model) {
3215
3344
  const id = (model ?? "").trim().toLowerCase();
3216
3345
  return !id || id === "default" || id === "auto";
@@ -3244,11 +3373,11 @@ function entryDir() {
3244
3373
  const cjsDir = typeof __dirname !== "undefined" ? __dirname : "";
3245
3374
  if (cjsDir) return cjsDir;
3246
3375
  try {
3247
- return dirname4(fileURLToPath2(import.meta.url));
3376
+ return dirname5(fileURLToPath2(import.meta.url));
3248
3377
  } catch {
3249
3378
  try {
3250
3379
  const req = createRequire3(process.cwd() + "/");
3251
- return dirname4(req.resolve("@sideboard-ai/core"));
3380
+ return dirname5(req.resolve("@sideboard-ai/core"));
3252
3381
  } catch {
3253
3382
  return process.cwd();
3254
3383
  }
@@ -3259,17 +3388,17 @@ function cursorRunnerPath() {
3259
3388
  if (packaged) return packaged;
3260
3389
  const root = entryDir();
3261
3390
  const candidates = [
3262
- join8(root, "agents", "cursor-runner.js"),
3263
- join8(root, "agents", "cursor-runner.cjs"),
3391
+ join9(root, "agents", "cursor-runner.js"),
3392
+ join9(root, "agents", "cursor-runner.cjs"),
3264
3393
  // If somehow resolved from package root instead of dist/
3265
- join8(root, "dist", "agents", "cursor-runner.js"),
3266
- join8(root, "dist", "agents", "cursor-runner.cjs"),
3394
+ join9(root, "dist", "agents", "cursor-runner.js"),
3395
+ join9(root, "dist", "agents", "cursor-runner.cjs"),
3267
3396
  // Source tree (dev): packages/core/src/agents/cursor-runner.ts
3268
- join8(root, "cursor-runner.ts"),
3269
- join8(root, "src", "agents", "cursor-runner.ts")
3397
+ join9(root, "cursor-runner.ts"),
3398
+ join9(root, "src", "agents", "cursor-runner.ts")
3270
3399
  ];
3271
3400
  for (const candidate of candidates) {
3272
- if (existsSync10(candidate)) return candidate;
3401
+ if (existsSync11(candidate)) return candidate;
3273
3402
  }
3274
3403
  return candidates[0];
3275
3404
  }
@@ -3357,7 +3486,7 @@ var cursorAdapter = {
3357
3486
  };
3358
3487
 
3359
3488
  // src/agents/opencode.ts
3360
- import { existsSync as existsSync11 } from "fs";
3489
+ import { existsSync as existsSync12 } from "fs";
3361
3490
  var FALLBACK_OPENCODE_MODELS = [
3362
3491
  { id: "opencode/big-pickle", displayName: "opencode \xB7 big-pickle" },
3363
3492
  {
@@ -3416,7 +3545,7 @@ async function listOpencodeModels() {
3416
3545
  if (opencode === "opencode") {
3417
3546
  const which = await run("which", ["opencode"], { reject: false });
3418
3547
  if (which.exitCode !== 0) return FALLBACK_OPENCODE_MODELS;
3419
- } else if (!existsSync11(opencode)) {
3548
+ } else if (!existsSync12(opencode)) {
3420
3549
  return FALLBACK_OPENCODE_MODELS;
3421
3550
  }
3422
3551
  const listed = await run(opencode, ["models"], { reject: false });
@@ -3451,7 +3580,7 @@ var opencodeAdapter = {
3451
3580
  async detect() {
3452
3581
  const opencode = resolveAgentExecutable("opencode");
3453
3582
  if (opencode !== "opencode") {
3454
- if (!existsSync11(opencode)) {
3583
+ if (!existsSync12(opencode)) {
3455
3584
  return {
3456
3585
  agent: "opencode",
3457
3586
  installed: false,
@@ -4156,6 +4285,9 @@ function allAdapters() {
4156
4285
  }
4157
4286
 
4158
4287
  export {
4288
+ materializeSystemCaBundle,
4289
+ applySystemCaEnv,
4290
+ trustSystemCertificates,
4159
4291
  pushTurnStderr,
4160
4292
  looksLikeV8Oom,
4161
4293
  summarizeTurnStderr,
@@ -4198,6 +4330,7 @@ export {
4198
4330
  turnCostUsdFromCursorUsage,
4199
4331
  cursorSdkMessageToEvents,
4200
4332
  parseCursorRunnerLine,
4333
+ isCursorApiKeyConfigured,
4201
4334
  isCursorAutoModel,
4202
4335
  resolveCursorModelId,
4203
4336
  listCursorModels,
@@ -2,7 +2,7 @@
2
2
 
3
3
  import {
4
4
  formatFetchError
5
- } from "./chunk-6GN5WPYZ.js";
5
+ } from "./chunk-VKQGAWHY.js";
6
6
 
7
7
  // src/brightsy/config.ts
8
8
  import { existsSync, readFileSync, writeFileSync } from "fs";
@@ -7,9 +7,9 @@ import {
7
7
  ensureConnectedBrightsyTeamTokens,
8
8
  getConnectedBrightsyTeamsRaw,
9
9
  listConnectedBrightsyTeams
10
- } from "./chunk-XD2BAANL.js";
11
- import "./chunk-M267JPEA.js";
12
- import "./chunk-ELBYOGVA.js";
10
+ } from "./chunk-IEEAVWAP.js";
11
+ import "./chunk-AN3THU7F.js";
12
+ import "./chunk-N7WZ6NIN.js";
13
13
  import "./chunk-EFVFB2AH.js";
14
14
  import "./chunk-UFHNSFAS.js";
15
15
  export {