@sideboard-ai/core 0.1.53 → 0.1.56

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 (30) hide show
  1. package/dist/agents/cursor-runner.cjs +83 -7
  2. package/dist/agents/cursor-runner.js +1 -1
  3. package/dist/{agents-KYACODJ3.js → agents-2YYWW723.js} +3 -3
  4. package/dist/{agents-KP7UJEHJ.js → agents-AQFEFKBL.js} +2 -2
  5. package/dist/{app-settings-LZP632KI.js → app-settings-2LQNRTBE.js} +3 -1
  6. package/dist/{app-settings-7XVDQJ7F.js → app-settings-73DI4B6T.js} +3 -1
  7. package/dist/{chunk-VG22SETP.js → chunk-3WJAUKIL.js} +83 -7
  8. package/dist/{chunk-GNML24AW.js → chunk-5DMYULLC.js} +1 -1
  9. package/dist/{chunk-A6HVEMIB.js → chunk-7F454EE2.js} +86 -11
  10. package/dist/{chunk-BZST4HMJ.js → chunk-C3J4GDW4.js} +172 -21
  11. package/dist/{chunk-HBJSHRY2.js → chunk-C4BCC5X5.js} +17 -1
  12. package/dist/{chunk-T5QQVXK3.js → chunk-DIOF73S2.js} +17 -1
  13. package/dist/{chunk-UEAHMGHW.js → chunk-DQJ5D42H.js} +16 -2
  14. package/dist/{chunk-YOWIYAVA.js → chunk-EBWEKG52.js} +36 -11
  15. package/dist/{chunk-XX5BB7NV.js → chunk-S42XDFKF.js} +36 -11
  16. package/dist/{chunk-LRLKJM3O.js → chunk-UA5NDAHL.js} +16 -2
  17. package/dist/{chunk-YDXQ72MD.js → chunk-V2DUTUNC.js} +1 -1
  18. package/dist/{coordinator-prompt-S6JZD5EF.js → coordinator-prompt-ICF36NUQ.js} +2 -1
  19. package/dist/{coordinator-prompt-6FXVTSFN.js → coordinator-prompt-RBKUNRPR.js} +2 -1
  20. package/dist/{global-workspace-EV4G2WMQ.js → global-workspace-667XLBW6.js} +3 -2
  21. package/dist/{global-workspace-MSX2K27Y.js → global-workspace-S7VLWPWG.js} +3 -2
  22. package/dist/index.cjs +298 -50
  23. package/dist/index.d.cts +24 -2
  24. package/dist/index.d.ts +24 -2
  25. package/dist/index.js +81 -35
  26. package/dist/mcp/run-stdio.cjs +292 -46
  27. package/dist/mcp/run-stdio.js +81 -36
  28. package/dist/{workspaces-AYTBR6KQ.js → workspaces-FPJJXXAE.js} +4 -3
  29. package/dist/{workspaces-3RQQZQRO.js → workspaces-LYIDE2VR.js} +4 -3
  30. package/package.json +1 -1
@@ -16,29 +16,19 @@ import {
16
16
  pushTurnStderr,
17
17
  resolveQuotaFallbackAgent,
18
18
  summarizeTurnStderr
19
- } from "../chunk-BZST4HMJ.js";
19
+ } from "../chunk-C3J4GDW4.js";
20
20
  import "../chunk-H6GGDLYS.js";
21
21
  import {
22
22
  addWorkspace,
23
23
  ensureWorkspace,
24
24
  removeWorkspace,
25
25
  syncWorkspacesFromThreads
26
- } from "../chunk-YDXQ72MD.js";
26
+ } from "../chunk-V2DUTUNC.js";
27
27
  import {
28
28
  extractPresentedPlan,
29
29
  readPlanFile,
30
30
  writePlanFile
31
31
  } from "../chunk-N5PM7HGQ.js";
32
- import {
33
- childEnvWithAppSettings,
34
- getLinearApiKey,
35
- isLinearConnected,
36
- loadAppSettings,
37
- orchestrationQuotaFallbackAgent,
38
- orchestrationQuotaOnLimit,
39
- resolveEffectiveIssueSource,
40
- updateAdvancedSettings
41
- } from "../chunk-HBJSHRY2.js";
42
32
  import {
43
33
  GLOBAL_WORKSPACE_ID,
44
34
  healOrchestrationSoccerTitles,
@@ -47,7 +37,7 @@ import {
47
37
  isGlobalThread,
48
38
  isOrchestratorThread,
49
39
  orchestratorSessionPoisonedByBuiltins
50
- } from "../chunk-YOWIYAVA.js";
40
+ } from "../chunk-EBWEKG52.js";
51
41
  import {
52
42
  assertOrchestratorCapableAgent
53
43
  } from "../chunk-S2LL5HA4.js";
@@ -56,7 +46,7 @@ import {
56
46
  coordinatorTurnReminder,
57
47
  enrichWorkspacesWithGithub,
58
48
  ensureGlobalCoordinatorCwd
59
- } from "../chunk-UEAHMGHW.js";
49
+ } from "../chunk-DQJ5D42H.js";
60
50
  import {
61
51
  addPrStackLayer,
62
52
  allocateTeamName,
@@ -117,6 +107,17 @@ import {
117
107
  git,
118
108
  run
119
109
  } from "../chunk-ZNM4MAN4.js";
110
+ import {
111
+ childEnvWithAppSettings,
112
+ getLinearApiKey,
113
+ isLinearConnected,
114
+ loadAppSettings,
115
+ orchestrationQuotaFallbackAgent,
116
+ orchestrationQuotaOnLimit,
117
+ resolveEffectiveIssueSource,
118
+ resolveNewThreadOptions,
119
+ updateAdvancedSettings
120
+ } from "../chunk-C4BCC5X5.js";
120
121
  import "../chunk-KGZBYWZ3.js";
121
122
  import {
122
123
  loadRepoSettings,
@@ -311,9 +312,25 @@ function applyAgentEvent(parts, event) {
311
312
  ];
312
313
  }
313
314
  if (event.type === "tool_result") {
314
- const next = parts.map((p) => {
315
- if (p.type !== "tool" || p.id !== event.id) return p;
316
- const fromResult = parseDiffStat(event.content);
315
+ const existing = parts.findIndex((p) => p.type === "tool" && p.id === event.id);
316
+ const fromResult = parseDiffStat(event.content);
317
+ if (existing < 0) {
318
+ return [
319
+ ...parts,
320
+ {
321
+ type: "tool",
322
+ id: event.id,
323
+ name: "tool",
324
+ description: "tool",
325
+ status: event.isError ? "error" : "done",
326
+ result: event.content,
327
+ ...fromResult.additions != null ? { additions: fromResult.additions } : {},
328
+ ...fromResult.deletions != null ? { deletions: fromResult.deletions } : {}
329
+ }
330
+ ];
331
+ }
332
+ return parts.map((p, i) => {
333
+ if (i !== existing || p.type !== "tool") return p;
317
334
  return {
318
335
  ...p,
319
336
  status: event.isError ? "error" : "done",
@@ -322,7 +339,6 @@ function applyAgentEvent(parts, event) {
322
339
  ...fromResult.deletions != null ? { deletions: fromResult.deletions } : {}
323
340
  };
324
341
  });
325
- return next;
326
342
  }
327
343
  return parts;
328
344
  }
@@ -376,9 +392,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
376
392
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
377
393
  );
378
394
  }
379
- const { isGlobalThread: isGlobalThread2 } = await import("../global-workspace-EV4G2WMQ.js");
395
+ const { isGlobalThread: isGlobalThread2 } = await import("../global-workspace-667XLBW6.js");
380
396
  if (isGlobalThread2(thread)) {
381
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("../coordinator-prompt-6FXVTSFN.js");
397
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("../coordinator-prompt-RBKUNRPR.js");
382
398
  ensureGlobalCoordinatorCwd2();
383
399
  }
384
400
  if (isOrchestratorThread(thread)) {
@@ -1103,7 +1119,13 @@ async function requireAgent(agent, opts) {
1103
1119
 
1104
1120
  // src/threads/create.ts
1105
1121
  async function createThread(input, _onSetupLine) {
1106
- await requireAgent(input.agent);
1122
+ const resolved = resolveNewThreadOptions({
1123
+ agent: input.agent,
1124
+ model: input.model,
1125
+ effort: input.effort,
1126
+ fast: input.fast
1127
+ });
1128
+ await requireAgent(resolved.agent);
1107
1129
  const repoPath = await resolveRepoRoot(input.repoPath);
1108
1130
  if (!existsSync5(repoPath)) {
1109
1131
  throw new Error(`Repo not found: ${repoPath}`);
@@ -1146,11 +1168,11 @@ async function createThread(input, _onSetupLine) {
1146
1168
  branchName,
1147
1169
  worktreePath,
1148
1170
  repoPath,
1149
- agent: input.agent,
1171
+ agent: resolved.agent,
1150
1172
  autonomy: input.autonomy ?? "default",
1151
- model: input.model ?? null,
1152
- effort: input.effort ?? "high",
1153
- fast: Boolean(input.fast),
1173
+ model: resolved.model,
1174
+ effort: resolved.effort,
1175
+ fast: resolved.fast,
1154
1176
  planMode: Boolean(input.planMode),
1155
1177
  attachments: input.attachments ?? [],
1156
1178
  sourceIsFork,
@@ -1163,7 +1185,7 @@ async function createThread(input, _onSetupLine) {
1163
1185
  return readThread(thread.id) ?? thread;
1164
1186
  }
1165
1187
  async function listLinearIssues(agent, repoPath) {
1166
- const { getAdapter: getAdapter2 } = await import("../agents-KP7UJEHJ.js");
1188
+ const { getAdapter: getAdapter2 } = await import("../agents-AQFEFKBL.js");
1167
1189
  await requireAgent(agent, { requireLinear: true });
1168
1190
  const adapter = getAdapter2(agent);
1169
1191
  if (!adapter.listLinearIssues) {
@@ -2025,7 +2047,7 @@ async function adoptThread(input) {
2025
2047
  messages: input.messages ?? []
2026
2048
  });
2027
2049
  writeThread(thread);
2028
- const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-3RQQZQRO.js");
2050
+ const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-LYIDE2VR.js");
2029
2051
  await ensureWorkspace2(repoPath);
2030
2052
  return thread;
2031
2053
  }
@@ -3912,7 +3934,7 @@ var Orchestrator = class {
3912
3934
  orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
3913
3935
  });
3914
3936
  }
3915
- const { autoCleanupOrphansEnabled } = await import("../app-settings-7XVDQJ7F.js");
3937
+ const { autoCleanupOrphansEnabled } = await import("../app-settings-73DI4B6T.js");
3916
3938
  if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
3917
3939
  await cleanupOrphanWorktrees({ repoPaths });
3918
3940
  }
@@ -4045,7 +4067,7 @@ var Orchestrator = class {
4045
4067
  }
4046
4068
  async finishCreateThread(threadId, prompt) {
4047
4069
  await this.runSetupAfterCreate(threadId);
4048
- const { autoRunAfterSetupEnabled } = await import("../app-settings-7XVDQJ7F.js");
4070
+ const { autoRunAfterSetupEnabled } = await import("../app-settings-73DI4B6T.js");
4049
4071
  if (autoRunAfterSetupEnabled()) {
4050
4072
  try {
4051
4073
  await this.startDev(threadId);
@@ -4077,7 +4099,7 @@ var Orchestrator = class {
4077
4099
  }
4078
4100
  }
4079
4101
  listWorkspaces() {
4080
- const fromThreads = listThreads({ includeArchived: false }).map((t) => t.repoPath);
4102
+ const fromThreads = listThreads({ includeArchived: true }).map((t) => t.repoPath);
4081
4103
  return syncWorkspacesFromThreads(fromThreads);
4082
4104
  }
4083
4105
  async addWorkspace(repoPath) {
@@ -4311,7 +4333,7 @@ var Orchestrator = class {
4311
4333
  });
4312
4334
  const artifactDirective = isBrightsy ? null : formatArtifactDirective();
4313
4335
  const settings = loadWorkspaceSettings(fresh.worktreePath, fresh.repoPath);
4314
- const { autoRenameBranchEnabled } = await import("../app-settings-7XVDQJ7F.js");
4336
+ const { autoRenameBranchEnabled } = await import("../app-settings-73DI4B6T.js");
4315
4337
  const renameBranchDirective = !isBrightsy && !isOrchestration && autoRenameBranchEnabled() ? formatRenameBranchDirective(fresh, {
4316
4338
  customPrompt: settings?.prompts?.renameBranch
4317
4339
  }) : null;
@@ -5177,7 +5199,15 @@ var Orchestrator = class {
5177
5199
  }
5178
5200
  await removeWorktree(thread.repoPath, thread.worktreePath);
5179
5201
  }
5180
- return setStatus(thread.id, "archived");
5202
+ const archived = setStatus(thread.id, "archived");
5203
+ if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
5204
+ try {
5205
+ const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-LYIDE2VR.js");
5206
+ await ensureWorkspace2(thread.repoPath);
5207
+ } catch {
5208
+ }
5209
+ }
5210
+ return archived;
5181
5211
  }
5182
5212
  async purge(threadRef, opts) {
5183
5213
  const thread = this.requireThread(threadRef);
@@ -5193,7 +5223,7 @@ var Orchestrator = class {
5193
5223
  await runArchiveScript(thread.repoPath, thread.worktreePath);
5194
5224
  } catch {
5195
5225
  }
5196
- const { deleteBranchOnPurgeEnabled } = await import("../app-settings-7XVDQJ7F.js");
5226
+ const { deleteBranchOnPurgeEnabled } = await import("../app-settings-73DI4B6T.js");
5197
5227
  const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
5198
5228
  await removeWorktree(thread.repoPath, thread.worktreePath, {
5199
5229
  deleteBranch: deleteBranch ? thread.branchName : void 0
@@ -5585,13 +5615,19 @@ async function startMcpServer() {
5585
5615
  return { content: [{ type: "text", text: JSON.stringify(payload) }] };
5586
5616
  }
5587
5617
  );
5618
+ const { resolveNewThreadOptions: resolveNewThreadOptions2, resolveThreadDefaults } = await import("../app-settings-73DI4B6T.js");
5619
+ const accountDefaults = resolveThreadDefaults();
5620
+ const accountDefaultsHint = `Account defaults: agent=${accountDefaults.agent}, model=${accountDefaults.model?.trim() || "Auto"}, effort=${accountDefaults.effort}`;
5588
5621
  server.tool(
5589
5622
  "create_thread",
5590
- "Create a new worktree thread (chat) from branch, pr, or ticket. Pass repoPath from list_workspaces and parentThreadId when spawning from an orchestrator. Then use send_to_thread to chat.",
5623
+ `Create a new worktree thread (chat) from branch, pr, or ticket. Pass repoPath from list_workspaces and parentThreadId when spawning from an orchestrator. Prefer omitting agent/model so Sideboard applies ${accountDefaultsHint}. Then use send_to_thread to chat.`,
5591
5624
  {
5592
5625
  sourceType: z.enum(["branch", "pr", "ticket"]),
5593
5626
  sourceRef: z.string(),
5594
- agent: z.enum(["claude", "codex", "opencode", "brightsy", "cursor"]),
5627
+ agent: z.enum(["claude", "codex", "opencode", "brightsy", "cursor"]).optional().describe(`Omit to use Account default agent (${accountDefaults.agent})`),
5628
+ model: z.string().nullable().optional().describe(
5629
+ `Usually omit to use Account default model (${accountDefaults.model?.trim() || "Auto"}). Pass null only to force Auto / agent-default.`
5630
+ ),
5595
5631
  repoPath: z.string(),
5596
5632
  title: z.string().optional(),
5597
5633
  parentThreadId: z.string().optional()
@@ -5611,10 +5647,17 @@ async function startMcpServer() {
5611
5647
  };
5612
5648
  }
5613
5649
  }
5650
+ const opts = resolveNewThreadOptions2({
5651
+ agent: args.agent,
5652
+ model: args.model
5653
+ });
5614
5654
  const thread = await orch.createThread({
5615
5655
  sourceType: args.sourceType,
5616
5656
  sourceRef: args.sourceRef,
5617
- agent: args.agent,
5657
+ agent: opts.agent,
5658
+ model: opts.model,
5659
+ effort: opts.effort,
5660
+ fast: opts.fast,
5618
5661
  repoPath: args.repoPath,
5619
5662
  title: args.title,
5620
5663
  parentThreadId: args.parentThreadId ?? null
@@ -5628,6 +5671,8 @@ async function startMcpServer() {
5628
5671
  title: thread.title,
5629
5672
  branchName: thread.branchName,
5630
5673
  worktreePath: thread.worktreePath,
5674
+ agent: thread.agent,
5675
+ model: thread.model,
5631
5676
  status: thread.status,
5632
5677
  link: `sideboard://thread/${thread.id}`
5633
5678
  })
@@ -4,10 +4,11 @@ import {
4
4
  listWorkspaces,
5
5
  removeWorkspace,
6
6
  syncWorkspacesFromThreads
7
- } from "./chunk-GNML24AW.js";
8
- import "./chunk-XX5BB7NV.js";
7
+ } from "./chunk-5DMYULLC.js";
8
+ import "./chunk-S42XDFKF.js";
9
9
  import "./chunk-GI7E5733.js";
10
- import "./chunk-LRLKJM3O.js";
10
+ import "./chunk-UA5NDAHL.js";
11
+ import "./chunk-DIOF73S2.js";
11
12
  import "./chunk-DZFH2KLT.js";
12
13
  import "./chunk-FKOIHGKV.js";
13
14
  import "./chunk-TSRXOSVD.js";
@@ -6,14 +6,15 @@ import {
6
6
  listWorkspaces,
7
7
  removeWorkspace,
8
8
  syncWorkspacesFromThreads
9
- } from "./chunk-YDXQ72MD.js";
10
- import "./chunk-YOWIYAVA.js";
9
+ } from "./chunk-V2DUTUNC.js";
10
+ import "./chunk-EBWEKG52.js";
11
11
  import "./chunk-S2LL5HA4.js";
12
- import "./chunk-UEAHMGHW.js";
12
+ import "./chunk-DQJ5D42H.js";
13
13
  import "./chunk-XOU6HNQJ.js";
14
14
  import "./chunk-B3SJXYIJ.js";
15
15
  import "./chunk-HLEX5AQ6.js";
16
16
  import "./chunk-ZNM4MAN4.js";
17
+ import "./chunk-C4BCC5X5.js";
17
18
  import "./chunk-KGZBYWZ3.js";
18
19
  import "./chunk-7MV3RXSC.js";
19
20
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sideboard-ai/core",
3
- "version": "0.1.53",
3
+ "version": "0.1.56",
4
4
  "description": "Sideboard core — orchestration, agents, git worktrees, MCP server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",