@sideboard-ai/core 0.1.168 → 0.1.170

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 (35) hide show
  1. package/dist/{abletime-BMS53RIZ.js → abletime-ESVTHTFH.js} +2 -2
  2. package/dist/{abletime-AGF54TNA.js → abletime-IC2V7CNB.js} +2 -2
  3. package/dist/{agents-TSO4MB3X.js → agents-GOBVOXFG.js} +9 -9
  4. package/dist/{agents-KWJXZAHB.js → agents-ZCIMZHXZ.js} +9 -9
  5. package/dist/{app-settings-BRLZQA7N.js → app-settings-LF3TS7XS.js} +5 -1
  6. package/dist/{app-settings-JJQDWPEK.js → app-settings-VMOTQORT.js} +5 -1
  7. package/dist/{chunk-74TWOSQP.js → chunk-3C4B52TS.js} +78 -42
  8. package/dist/{chunk-CVZ4KXVP.js → chunk-7IUO67CW.js} +122 -2
  9. package/dist/{chunk-HSGSQA42.js → chunk-DHPZW2EA.js} +8 -34
  10. package/dist/{chunk-KJFFQAMA.js → chunk-DKLGWRWC.js} +1 -1
  11. package/dist/{chunk-NYMFNUT5.js → chunk-GQHVICNT.js} +194 -147
  12. package/dist/{chunk-ILXKJ4ZD.js → chunk-NB7TEKCF.js} +1 -1
  13. package/dist/{chunk-RS756MKF.js → chunk-P2VCMIZU.js} +8 -34
  14. package/dist/{chunk-UIR4VDYA.js → chunk-SAZIRJR4.js} +30 -10
  15. package/dist/{chunk-UVLPL2FJ.js → chunk-TEI72FYD.js} +198 -216
  16. package/dist/{chunk-3A54S244.js → chunk-UDEWGTP6.js} +29 -10
  17. package/dist/{chunk-TW5A2HFY.js → chunk-Y7DJA3UW.js} +78 -42
  18. package/dist/{chunk-LTXS26K5.js → chunk-YMF5WCIA.js} +122 -2
  19. package/dist/{coordinator-prompt-75N74HAO.js → coordinator-prompt-JTDCEU74.js} +3 -3
  20. package/dist/{coordinator-prompt-Y372QRFE.js → coordinator-prompt-RRUU2OYO.js} +3 -3
  21. package/dist/{global-workspace-JNNFVSP7.js → global-workspace-4SI3CRRT.js} +3 -3
  22. package/dist/{global-workspace-TPE4LKVM.js → global-workspace-ZF6EJAM3.js} +3 -3
  23. package/dist/index.cjs +421 -278
  24. package/dist/index.d.cts +135 -37
  25. package/dist/index.d.ts +135 -37
  26. package/dist/index.js +33 -19
  27. package/dist/mcp/run-stdio.cjs +401 -207
  28. package/dist/mcp/run-stdio.js +8 -8
  29. package/dist/{orchestrator-XG3QCMOS.js → orchestrator-LE6L6MJC.js} +5 -5
  30. package/dist/{orchestrator-IIME6KXQ.js → orchestrator-UZSFTDKA.js} +5 -5
  31. package/dist/{workspaces-2IGQNFPL.js → workspaces-A7C3WA54.js} +3 -3
  32. package/dist/{workspaces-BWZSDSGG.js → workspaces-NOC2MWQV.js} +3 -3
  33. package/dist/{worktree-7X7XNSYL.js → worktree-GXO2VDQF.js} +12 -4
  34. package/dist/{worktree-5BFEK6PF.js → worktree-PODE23PD.js} +12 -4
  35. package/package.json +1 -1
@@ -16,9 +16,9 @@ import {
16
16
  toAbleTimeIssueInfo,
17
17
  updateAbleTimeTask,
18
18
  verifyAbleTimeConnection
19
- } from "./chunk-KJFFQAMA.js";
19
+ } from "./chunk-DKLGWRWC.js";
20
20
  import "./chunk-6GN5WPYZ.js";
21
- import "./chunk-LTXS26K5.js";
21
+ import "./chunk-YMF5WCIA.js";
22
22
  import "./chunk-NSTQ6QKD.js";
23
23
  import "./chunk-KGZBYWZ3.js";
24
24
  import "./chunk-JTJHOYCU.js";
@@ -14,9 +14,9 @@ import {
14
14
  toAbleTimeIssueInfo,
15
15
  updateAbleTimeTask,
16
16
  verifyAbleTimeConnection
17
- } from "./chunk-ILXKJ4ZD.js";
17
+ } from "./chunk-NB7TEKCF.js";
18
18
  import "./chunk-ELBYOGVA.js";
19
- import "./chunk-CVZ4KXVP.js";
19
+ import "./chunk-7IUO67CW.js";
20
20
  import "./chunk-4TR3HZFT.js";
21
21
  import "./chunk-JT7R45JB.js";
22
22
  import "./chunk-77WWLBCI.js";
@@ -31,14 +31,9 @@ import {
31
31
  resolveLoginCommand,
32
32
  resolveQuotaFallbackAgent,
33
33
  whichOnPath
34
- } from "./chunk-UIR4VDYA.js";
35
- import {
36
- ORCHESTRATOR_AGENT_KINDS,
37
- assertOrchestratorCapableAgent,
38
- coerceOrchestratorAgent,
39
- isOrchestratorCapableAgent
40
- } from "./chunk-HSGSQA42.js";
41
- import "./chunk-74TWOSQP.js";
34
+ } from "./chunk-SAZIRJR4.js";
35
+ import "./chunk-DHPZW2EA.js";
36
+ import "./chunk-3C4B52TS.js";
42
37
  import "./chunk-6K64FJDD.js";
43
38
  import "./chunk-XD2BAANL.js";
44
39
  import "./chunk-M267JPEA.js";
@@ -49,7 +44,12 @@ import {
49
44
  preferredCursorCostCents,
50
45
  turnCostUsdFromCursorUsage
51
46
  } from "./chunk-XXIH6XYR.js";
52
- import "./chunk-CVZ4KXVP.js";
47
+ import {
48
+ ORCHESTRATOR_AGENT_KINDS,
49
+ assertOrchestratorCapableAgent,
50
+ coerceOrchestratorAgent,
51
+ isOrchestratorCapableAgent
52
+ } from "./chunk-7IUO67CW.js";
53
53
  import "./chunk-4TR3HZFT.js";
54
54
  import "./chunk-JT7R45JB.js";
55
55
  import "./chunk-7UURXPKD.js";
@@ -37,17 +37,12 @@ import {
37
37
  resolveQuotaFallbackAgent,
38
38
  turnCostUsdFromCursorUsage,
39
39
  whichOnPath
40
- } from "./chunk-3A54S244.js";
40
+ } from "./chunk-UDEWGTP6.js";
41
41
  import "./chunk-LZ6QMEQC.js";
42
42
  import "./chunk-S42XV45P.js";
43
43
  import "./chunk-6GN5WPYZ.js";
44
- import {
45
- ORCHESTRATOR_AGENT_KINDS,
46
- assertOrchestratorCapableAgent,
47
- coerceOrchestratorAgent,
48
- isOrchestratorCapableAgent
49
- } from "./chunk-RS756MKF.js";
50
- import "./chunk-TW5A2HFY.js";
44
+ import "./chunk-P2VCMIZU.js";
45
+ import "./chunk-Y7DJA3UW.js";
51
46
  import "./chunk-D6JWYJ4P.js";
52
47
  import "./chunk-LZQULFIT.js";
53
48
  import "./chunk-SYFVUF2C.js";
@@ -60,7 +55,12 @@ import {
60
55
  resolveCommandBinarySync,
61
56
  withExportedPath
62
57
  } from "./chunk-FNQNJOHY.js";
63
- import "./chunk-LTXS26K5.js";
58
+ import {
59
+ ORCHESTRATOR_AGENT_KINDS,
60
+ assertOrchestratorCapableAgent,
61
+ coerceOrchestratorAgent,
62
+ isOrchestratorCapableAgent
63
+ } from "./chunk-YMF5WCIA.js";
64
64
  import "./chunk-NSTQ6QKD.js";
65
65
  import "./chunk-KGZBYWZ3.js";
66
66
  import "./chunk-JTJHOYCU.js";
@@ -61,7 +61,9 @@ import {
61
61
  resolveAgentExecutable,
62
62
  resolveClaudeExecutable,
63
63
  resolveEffectiveIssueSource,
64
+ resolveNewOrchestratorOptions,
64
65
  resolveNewThreadOptions,
66
+ resolveOrchestratorDefaults,
65
67
  resolveThreadDefaults,
66
68
  resolveViewerProfile,
67
69
  resolveViewerProfileForRepo,
@@ -83,7 +85,7 @@ import {
83
85
  updateOpencodeSettings,
84
86
  updateProjectProfileSettings,
85
87
  writeViewerContext
86
- } from "./chunk-LTXS26K5.js";
88
+ } from "./chunk-YMF5WCIA.js";
87
89
  import "./chunk-NSTQ6QKD.js";
88
90
  import "./chunk-KGZBYWZ3.js";
89
91
  import "./chunk-JTJHOYCU.js";
@@ -148,7 +150,9 @@ export {
148
150
  resolveAgentExecutable,
149
151
  resolveClaudeExecutable,
150
152
  resolveEffectiveIssueSource,
153
+ resolveNewOrchestratorOptions,
151
154
  resolveNewThreadOptions,
155
+ resolveOrchestratorDefaults,
152
156
  resolveThreadDefaults,
153
157
  resolveViewerProfile,
154
158
  resolveViewerProfileForRepo,
@@ -59,7 +59,9 @@ import {
59
59
  resolveAgentExecutable,
60
60
  resolveClaudeExecutable,
61
61
  resolveEffectiveIssueSource,
62
+ resolveNewOrchestratorOptions,
62
63
  resolveNewThreadOptions,
64
+ resolveOrchestratorDefaults,
63
65
  resolveThreadDefaults,
64
66
  resolveViewerProfile,
65
67
  resolveViewerProfileForRepo,
@@ -81,7 +83,7 @@ import {
81
83
  updateOpencodeSettings,
82
84
  updateProjectProfileSettings,
83
85
  writeViewerContext
84
- } from "./chunk-CVZ4KXVP.js";
86
+ } from "./chunk-7IUO67CW.js";
85
87
  import "./chunk-4TR3HZFT.js";
86
88
  import "./chunk-JT7R45JB.js";
87
89
  import "./chunk-77WWLBCI.js";
@@ -147,7 +149,9 @@ export {
147
149
  resolveAgentExecutable,
148
150
  resolveClaudeExecutable,
149
151
  resolveEffectiveIssueSource,
152
+ resolveNewOrchestratorOptions,
150
153
  resolveNewThreadOptions,
154
+ resolveOrchestratorDefaults,
151
155
  resolveThreadDefaults,
152
156
  resolveViewerProfile,
153
157
  resolveViewerProfileForRepo,
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  getGithubGitAuthMode,
6
6
  getGithubPat
7
- } from "./chunk-CVZ4KXVP.js";
7
+ } from "./chunk-7IUO67CW.js";
8
8
  import {
9
9
  listThreads
10
10
  } from "./chunk-7UURXPKD.js";
@@ -736,8 +736,10 @@ function lookupSoccerTeam(titleOrSlug) {
736
736
  }
737
737
  function teamNameFromSlug(slug) {
738
738
  const normalized = slug.toLowerCase().replace(/^thread\//, "");
739
- const suffixMatch = normalized.match(/^(.+)-(\d+)$/);
740
- const base = suffixMatch?.[1] ?? normalized;
739
+ const withoutTicket = normalized.replace(/^[a-z]{2,8}-\d{1,6}-/, "").replace(/^\d{1,8}-/, "");
740
+ const lookup = withoutTicket || normalized;
741
+ const suffixMatch = lookup.match(/^(.+)-(\d+)$/);
742
+ const base = suffixMatch?.[1] ?? lookup;
741
743
  const suffix = suffixMatch?.[2];
742
744
  const team = FAMOUS_SOCCER_TEAM_SEEDS.find((t) => t.slug === base);
743
745
  if (team) return suffix ? `${team.name} ${suffix}` : team.name;
@@ -813,6 +815,25 @@ function worktreeNameFromPath(worktreePath) {
813
815
  const parts = normalized.split("/");
814
816
  return parts[parts.length - 1] || worktreePath;
815
817
  }
818
+ function ticketSlugForBranch(sourceRef) {
819
+ const raw = sourceRef.trim();
820
+ if (!raw) return null;
821
+ const linear = raw.match(/\b([A-Za-z]{2,8}-\d{1,6})\b/);
822
+ if (linear) return linear[1].toLowerCase();
823
+ const hashed = raw.match(/^#(\d{1,8})$/);
824
+ if (hashed) return hashed[1];
825
+ const digits = raw.match(/^(\d{1,8})$/);
826
+ if (digits) return digits[1];
827
+ const slug = raw.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 48);
828
+ return slug || null;
829
+ }
830
+ function worktreeSlugForTicket(ticketRef, teamSlug) {
831
+ const ticket = ticketSlugForBranch(ticketRef);
832
+ const team = teamSlug.trim().replace(/^thread\//, "");
833
+ if (!ticket) return team;
834
+ if (!team) return ticket;
835
+ return `${ticket}-${team}`;
836
+ }
816
837
  function isPlaceholderBranch(branchName, worktreePath) {
817
838
  const branch = branchName.trim();
818
839
  if (!branch || branch === "HEAD") return true;
@@ -2393,48 +2414,35 @@ async function getPrMeta(cwd, selector) {
2393
2414
  return null;
2394
2415
  }
2395
2416
  }
2396
- async function getPrDetails(cwd, selector) {
2397
- const slug = await resolveGithubRepoSlug(cwd);
2398
- const viewArgs = [
2399
- "pr",
2400
- "view",
2401
- selector,
2402
- "--json",
2403
- [
2404
- "number",
2405
- "title",
2406
- "body",
2407
- "url",
2408
- "state",
2409
- "isDraft",
2410
- "reviewDecision",
2411
- "author",
2412
- "baseRefName",
2413
- "headRefName",
2414
- "additions",
2415
- "deletions",
2416
- "changedFiles",
2417
- "comments",
2418
- "reviews"
2419
- ].join(",")
2420
- ];
2421
- if (slug) viewArgs.push("--repo", slug);
2422
- const { stdout, exitCode, stderr } = await gh(viewArgs, cwd, { reject: false });
2423
- if (exitCode !== 0 || !stdout.trim()) {
2424
- if (stderr.trim()) {
2425
- if (/no pull requests found/i.test(stderr)) return null;
2426
- }
2427
- return null;
2428
- }
2429
- let view;
2430
- try {
2431
- view = JSON.parse(stdout);
2432
- } catch {
2433
- throw new Error(stderr.trim() || "gh pr view returned invalid JSON");
2434
- }
2417
+ var PR_DETAILS_JSON_FIELDS = [
2418
+ "number",
2419
+ "title",
2420
+ "body",
2421
+ "url",
2422
+ "state",
2423
+ "isDraft",
2424
+ "reviewDecision",
2425
+ "author",
2426
+ "baseRefName",
2427
+ "headRefName",
2428
+ "additions",
2429
+ "deletions",
2430
+ "changedFiles",
2431
+ "comments",
2432
+ "reviews",
2433
+ "assignees",
2434
+ "labels",
2435
+ "reviewRequests"
2436
+ ].join(",");
2437
+ function parsePrDetailsView(view) {
2435
2438
  const author = view.author ?? {};
2436
2439
  const comments = Array.isArray(view.comments) ? view.comments : [];
2437
2440
  const reviews = Array.isArray(view.reviews) ? view.reviews : [];
2441
+ const requested = {
2442
+ ids: reviewerIdentities(view.reviewRequests),
2443
+ users: humanReviewerLogins(view.reviewRequests),
2444
+ teams: teamReviewerSlugs(view.reviewRequests)
2445
+ };
2438
2446
  return {
2439
2447
  number: Number(view.number),
2440
2448
  title: String(view.title ?? ""),
@@ -2470,10 +2478,34 @@ async function getPrDetails(cwd, selector) {
2470
2478
  submittedAt: normalizeGhTime(row.submittedAt)
2471
2479
  };
2472
2480
  }),
2481
+ assignees: reviewerIdentities(view.assignees),
2482
+ labels: labelNames(view.labels),
2483
+ reviewRequests: requested.ids,
2484
+ reviewers: requested.users,
2485
+ teams: requested.teams,
2473
2486
  // CI lives in Checks tab via getPrChecks — nesting burned GraphQL points.
2474
2487
  checks: []
2475
2488
  };
2476
2489
  }
2490
+ async function getPrDetails(cwd, selector) {
2491
+ const slug = await resolveGithubRepoSlug(cwd);
2492
+ const viewArgs = ["pr", "view", selector, "--json", PR_DETAILS_JSON_FIELDS];
2493
+ if (slug) viewArgs.push("--repo", slug);
2494
+ const { stdout, exitCode, stderr } = await gh(viewArgs, cwd, { reject: false });
2495
+ if (exitCode !== 0 || !stdout.trim()) {
2496
+ if (stderr.trim()) {
2497
+ if (/no pull requests found/i.test(stderr)) return null;
2498
+ }
2499
+ return null;
2500
+ }
2501
+ let view;
2502
+ try {
2503
+ view = JSON.parse(stdout);
2504
+ } catch {
2505
+ throw new Error(stderr.trim() || "gh pr view returned invalid JSON");
2506
+ }
2507
+ return parsePrDetailsView(view);
2508
+ }
2477
2509
  async function fetchPrHead(repoPath, number, localBranch) {
2478
2510
  const slug = await resolveGithubRepoSlug(repoPath);
2479
2511
  const refspec = `+pull/${number}/head:${localBranch}`;
@@ -3193,6 +3225,8 @@ export {
3193
3225
  allocateTeamName,
3194
3226
  normalizeWorktreePath,
3195
3227
  worktreeNameFromPath,
3228
+ ticketSlugForBranch,
3229
+ worktreeSlugForTicket,
3196
3230
  isPlaceholderBranch,
3197
3231
  branchDisplayLabel,
3198
3232
  threadDisplayLabel,
@@ -3259,6 +3293,8 @@ export {
3259
3293
  detectLocalMergeConflicts,
3260
3294
  getPrChecks,
3261
3295
  getPrMeta,
3296
+ PR_DETAILS_JSON_FIELDS,
3297
+ parsePrDetailsView,
3262
3298
  getPrDetails,
3263
3299
  fetchPrHead,
3264
3300
  resolveWorktreeStartPoint,
@@ -18,6 +18,30 @@ import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
18
18
  import { homedir, hostname } from "os";
19
19
  import { join as join2 } from "path";
20
20
 
21
+ // src/agents/orchestrator-capable.ts
22
+ var ORCHESTRATOR_AGENT_KINDS = [
23
+ "claude",
24
+ "codex",
25
+ "opencode",
26
+ "cursor"
27
+ ];
28
+ function isOrchestratorCapableAgent(agent) {
29
+ return Boolean(
30
+ agent && ORCHESTRATOR_AGENT_KINDS.includes(agent)
31
+ );
32
+ }
33
+ function assertOrchestratorCapableAgent(agent, context = "orchestration") {
34
+ if (!isOrchestratorCapableAgent(agent)) {
35
+ throw new Error(
36
+ `${agent} cannot run ${context} \u2014 it does not support Sideboard MCP. Use Claude, Cursor, Codex, or OpenCode.`
37
+ );
38
+ }
39
+ return agent;
40
+ }
41
+ function coerceOrchestratorAgent(agent, fallback = "claude") {
42
+ return isOrchestratorCapableAgent(agent) ? agent : fallback;
43
+ }
44
+
21
45
  // src/store/account-profile.ts
22
46
  var PROFILE_NOTES_MAX = 2e3;
23
47
  var LEGACY_ROLE_LABELS = {
@@ -603,6 +627,25 @@ function normalizeIntegrations(raw) {
603
627
  }
604
628
  return out;
605
629
  }
630
+ function normalizeOrchestratorDefaults(raw) {
631
+ if (!raw || typeof raw !== "object") return void 0;
632
+ const source = raw;
633
+ const out = {};
634
+ if (typeof source.agent === "string" && isOrchestratorCapableAgent(source.agent)) {
635
+ out.agent = source.agent;
636
+ }
637
+ if (typeof source.model === "string") {
638
+ const model = source.model.trim();
639
+ if (model) out.model = model;
640
+ }
641
+ if (normalizeThinkingEffort(source.effort)) {
642
+ out.effort = normalizeThinkingEffort(source.effort);
643
+ }
644
+ if (typeof source.fast === "boolean") {
645
+ out.fast = source.fast;
646
+ }
647
+ return Object.keys(out).length > 0 ? out : void 0;
648
+ }
606
649
  function normalizeDefaults(raw) {
607
650
  if (!raw || typeof raw !== "object") return {};
608
651
  const source = raw;
@@ -622,6 +665,8 @@ function normalizeDefaults(raw) {
622
665
  }
623
666
  const notes = foldLegacyRolesIntoNotes(source.roles, source.role, source.notes);
624
667
  if (notes) out.notes = notes;
668
+ const orchestrator = normalizeOrchestratorDefaults(source.orchestrator);
669
+ if (orchestrator) out.orchestrator = orchestrator;
625
670
  return out;
626
671
  }
627
672
  function profileRepoKey(path) {
@@ -1176,6 +1221,39 @@ function updateIntegrationsSettings(patch) {
1176
1221
  }
1177
1222
  return saveAppSettings({ ...current, integrations });
1178
1223
  }
1224
+ function applyOrchestratorDefaultsPatch(current, patch) {
1225
+ const next = { ...current };
1226
+ if ("agent" in patch) {
1227
+ if (patch.agent == null) {
1228
+ delete next.agent;
1229
+ } else if (isOrchestratorCapableAgent(patch.agent)) {
1230
+ next.agent = patch.agent;
1231
+ }
1232
+ }
1233
+ if ("model" in patch) {
1234
+ if (patch.model == null || patch.model.trim() === "") {
1235
+ delete next.model;
1236
+ } else {
1237
+ next.model = patch.model.trim();
1238
+ }
1239
+ }
1240
+ if ("effort" in patch) {
1241
+ if (patch.effort == null) {
1242
+ delete next.effort;
1243
+ } else {
1244
+ const effort = normalizeThinkingEffort(patch.effort);
1245
+ if (effort) next.effort = effort;
1246
+ }
1247
+ }
1248
+ if ("fast" in patch) {
1249
+ if (patch.fast == null) {
1250
+ delete next.fast;
1251
+ } else {
1252
+ next.fast = Boolean(patch.fast);
1253
+ }
1254
+ }
1255
+ return Object.keys(next).length > 0 ? next : void 0;
1256
+ }
1179
1257
  function updateDefaultsSettings(patch) {
1180
1258
  const current = loadAppSettings();
1181
1259
  const defaults = { ...current.defaults };
@@ -1213,6 +1291,18 @@ function updateDefaultsSettings(patch) {
1213
1291
  if (!notes) delete defaults.notes;
1214
1292
  else defaults.notes = notes;
1215
1293
  }
1294
+ if ("orchestrator" in patch) {
1295
+ if (patch.orchestrator == null) {
1296
+ delete defaults.orchestrator;
1297
+ } else {
1298
+ const orchestrator = applyOrchestratorDefaultsPatch(
1299
+ defaults.orchestrator,
1300
+ patch.orchestrator
1301
+ );
1302
+ if (orchestrator) defaults.orchestrator = orchestrator;
1303
+ else delete defaults.orchestrator;
1304
+ }
1305
+ }
1216
1306
  delete defaults.roles;
1217
1307
  delete defaults.role;
1218
1308
  return saveAppSettings({ ...current, defaults });
@@ -1320,8 +1410,22 @@ function resolveThreadDefaults(settings = loadAppSettings()) {
1320
1410
  fast: getDefaultFast(settings)
1321
1411
  };
1322
1412
  }
1323
- function resolveNewThreadOptions(overrides = {}, settings = loadAppSettings()) {
1324
- const defaults = resolveThreadDefaults(settings);
1413
+ function resolveOrchestratorDefaults(settings = loadAppSettings()) {
1414
+ const account = resolveThreadDefaults(settings);
1415
+ const orch = settings.defaults.orchestrator;
1416
+ const agent = coerceOrchestratorAgent(orch?.agent ?? account.agent);
1417
+ let model = orch ? orch.model?.trim() || null : account.model;
1418
+ if (model && agent !== "cursor" && /^(default|auto)$/i.test(model.trim())) {
1419
+ model = null;
1420
+ }
1421
+ return {
1422
+ agent,
1423
+ model,
1424
+ effort: orch?.effort ?? account.effort,
1425
+ fast: orch?.fast ?? account.fast
1426
+ };
1427
+ }
1428
+ function mergeThreadOptionOverrides(defaults, overrides) {
1325
1429
  const effort = overrides.effort === void 0 || overrides.effort === null ? defaults.effort : normalizeThinkingEffort(overrides.effort) ?? defaults.effort;
1326
1430
  const agent = overrides.agent ?? defaults.agent;
1327
1431
  let model = overrides.model === void 0 ? defaults.model : overrides.model?.trim() || null;
@@ -1335,6 +1439,12 @@ function resolveNewThreadOptions(overrides = {}, settings = loadAppSettings()) {
1335
1439
  fast: overrides.fast === void 0 || overrides.fast === null ? defaults.fast : Boolean(overrides.fast)
1336
1440
  };
1337
1441
  }
1442
+ function resolveNewThreadOptions(overrides = {}, settings = loadAppSettings()) {
1443
+ return mergeThreadOptionOverrides(resolveThreadDefaults(settings), overrides);
1444
+ }
1445
+ function resolveNewOrchestratorOptions(overrides = {}, settings = loadAppSettings()) {
1446
+ return mergeThreadOptionOverrides(resolveOrchestratorDefaults(settings), overrides);
1447
+ }
1338
1448
  function isLinearConnected(settings = loadAppSettings()) {
1339
1449
  return hasLinearCredentials(settings.integrations);
1340
1450
  }
@@ -1456,6 +1566,10 @@ function brightsyInjectWorktreeMcpEnabled(settings = loadAppSettings()) {
1456
1566
  }
1457
1567
  function brightsyCloudConnectAgent(settings = loadAppSettings()) {
1458
1568
  const fallback = settings.brightsy.cloudConnectAgent && CLOUD_CONNECT_AGENTS.has(settings.brightsy.cloudConnectAgent) ? settings.brightsy.cloudConnectAgent : "claude";
1569
+ const orchAgent = settings.defaults.orchestrator?.agent;
1570
+ if (orchAgent && CLOUD_CONNECT_AGENTS.has(orchAgent)) {
1571
+ return orchAgent;
1572
+ }
1459
1573
  const preferred = getDefaultAgent(settings);
1460
1574
  if (CLOUD_CONNECT_AGENTS.has(preferred)) {
1461
1575
  return preferred;
@@ -1666,6 +1780,10 @@ function harnessEnvKey(harness) {
1666
1780
  }
1667
1781
 
1668
1782
  export {
1783
+ ORCHESTRATOR_AGENT_KINDS,
1784
+ isOrchestratorCapableAgent,
1785
+ assertOrchestratorCapableAgent,
1786
+ coerceOrchestratorAgent,
1669
1787
  PROFILE_NOTES_MAX,
1670
1788
  foldLegacyRolesIntoNotes,
1671
1789
  resolveAccountProfile,
@@ -1712,7 +1830,9 @@ export {
1712
1830
  readViewerContext,
1713
1831
  writeViewerContext,
1714
1832
  resolveThreadDefaults,
1833
+ resolveOrchestratorDefaults,
1715
1834
  resolveNewThreadOptions,
1835
+ resolveNewOrchestratorOptions,
1716
1836
  isLinearConnected,
1717
1837
  saveLinearOAuth,
1718
1838
  disconnectLinearConnection,
@@ -5,22 +5,24 @@ import {
5
5
  resolveRepoRoot,
6
6
  takenSlugsFromThread,
7
7
  teamSlugFromName
8
- } from "./chunk-74TWOSQP.js";
8
+ } from "./chunk-3C4B52TS.js";
9
9
  import {
10
10
  ATTACHMENTS_DIR,
11
11
  attachmentsGitignoreBody
12
12
  } from "./chunk-6K64FJDD.js";
13
13
  import {
14
+ assertOrchestratorCapableAgent,
14
15
  formatAccountProfilePlaybookLine,
15
16
  formatProjectProfilePlaybookLines,
16
17
  formatWorkspaceProfileSuffix,
17
18
  loadAppSettings,
18
19
  resolveAccountProfileFromSettings,
19
- resolveNewThreadOptions,
20
+ resolveNewOrchestratorOptions,
21
+ resolveOrchestratorDefaults,
20
22
  resolveThreadDefaults,
21
23
  resolveViewerProfile,
22
24
  resolveViewerProfileForRepo
23
- } from "./chunk-CVZ4KXVP.js";
25
+ } from "./chunk-7IUO67CW.js";
24
26
  import {
25
27
  createEmptyThread,
26
28
  listThreads,
@@ -333,30 +335,6 @@ function attachmentsFromWorktreePaths(worktreePath, relativePaths) {
333
335
  return out;
334
336
  }
335
337
 
336
- // src/agents/orchestrator-capable.ts
337
- var ORCHESTRATOR_AGENT_KINDS = [
338
- "claude",
339
- "codex",
340
- "opencode",
341
- "cursor"
342
- ];
343
- function isOrchestratorCapableAgent(agent) {
344
- return Boolean(
345
- agent && ORCHESTRATOR_AGENT_KINDS.includes(agent)
346
- );
347
- }
348
- function assertOrchestratorCapableAgent(agent, context = "orchestration") {
349
- if (!isOrchestratorCapableAgent(agent)) {
350
- throw new Error(
351
- `${agent} cannot run ${context} \u2014 it does not support Sideboard MCP. Use Claude, Cursor, Codex, or OpenCode.`
352
- );
353
- }
354
- return agent;
355
- }
356
- function coerceOrchestratorAgent(agent, fallback = "claude") {
357
- return isOrchestratorCapableAgent(agent) ? agent : fallback;
358
- }
359
-
360
338
  // src/orchestrator/coordinator-prompt.ts
361
339
  import { mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
362
340
  import { join as join2 } from "path";
@@ -662,7 +640,7 @@ function createGlobalChat(opts) {
662
640
  const explicit = opts.title?.trim();
663
641
  const title = explicit && explicit !== CLOUD_ORCHESTRATOR_GOAL ? explicit : allocateTeamName(takenTeamSlugsForOrchestration()).name;
664
642
  const sourceRef = opts.sourceRef?.trim() || (isCloud ? CLOUD_ORCHESTRATOR_GOAL : title);
665
- const resolved = resolveNewThreadOptions({
643
+ const resolved = resolveNewOrchestratorOptions({
666
644
  agent: opts.agent,
667
645
  model: opts.model,
668
646
  effort: opts.effort,
@@ -738,7 +716,7 @@ function findSlackCoordinator(teamId, userId) {
738
716
  );
739
717
  }
740
718
  function ensureSlackCoordinator(teamId, userId, agent, opts) {
741
- const defaults = resolveThreadDefaults();
719
+ const defaults = resolveOrchestratorDefaults();
742
720
  const desired = assertOrchestratorCapableAgent(agent);
743
721
  const ref = slackCoordinatorSourceRef(teamId, userId);
744
722
  if (!opts?.forceNew) {
@@ -773,7 +751,7 @@ function ensureSlackCoordinator(teamId, userId, agent, opts) {
773
751
  });
774
752
  }
775
753
  function ensureCloudCoordinator(agent) {
776
- const defaults = resolveThreadDefaults();
754
+ const defaults = resolveOrchestratorDefaults();
777
755
  const desired = assertOrchestratorCapableAgent(agent);
778
756
  const existing = findCloudCoordinator();
779
757
  if (existing) {
@@ -910,10 +888,6 @@ function syncWorkspacesFromThreads(repoPaths) {
910
888
  }
911
889
 
912
890
  export {
913
- ORCHESTRATOR_AGENT_KINDS,
914
- isOrchestratorCapableAgent,
915
- assertOrchestratorCapableAgent,
916
- coerceOrchestratorAgent,
917
891
  CLOUD_ORCHESTRATOR_GOAL,
918
892
  SIDEBOARD_FORCE_STOP,
919
893
  CLOUD_COORDINATOR_BUSY_REPLY,
@@ -8,7 +8,7 @@ import {
8
8
  getAbleTimeHost,
9
9
  isAbleTimeConnected,
10
10
  saveAbleTimeConnection
11
- } from "./chunk-LTXS26K5.js";
11
+ } from "./chunk-YMF5WCIA.js";
12
12
 
13
13
  // src/integrations/abletime-mcp.ts
14
14
  var DEFAULT_ABLETIME_HOST = "https://track.abletime.com";