@sideboard-ai/core 0.1.350 → 0.1.351

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 (27) hide show
  1. package/dist/{agents-P5QIV24I.js → agents-D5CL4CR4.js} +2 -2
  2. package/dist/{agents-RGAV5OHD.js → agents-INTH7J3F.js} +2 -2
  3. package/dist/{chunk-2MESZ5XR.js → chunk-7WPQAVS5.js} +10 -10
  4. package/dist/{chunk-NDEVAA34.js → chunk-AAKQU4UZ.js} +2 -2
  5. package/dist/{chunk-MANERA6F.js → chunk-AEEOYLVK.js} +2 -2
  6. package/dist/{chunk-W5GHFT7E.js → chunk-BDWVBEKN.js} +11 -11
  7. package/dist/{chunk-ZBSEJIOV.js → chunk-C3E2DGDF.js} +2 -2
  8. package/dist/{chunk-LFSTOECH.js → chunk-HISSQICH.js} +1 -1
  9. package/dist/{chunk-EZ2MUWNW.js → chunk-SZY23KGS.js} +1 -1
  10. package/dist/{chunk-5AHWUJRT.js → chunk-UXAKH4AW.js} +2 -2
  11. package/dist/{conductor-VGCXUUG6.js → conductor-FWYWIHEW.js} +2 -2
  12. package/dist/{conductor-HVOGBK63.js → conductor-W2X7QUKZ.js} +2 -2
  13. package/dist/{coordinator-prompt-E736TJBS.js → coordinator-prompt-J57Q4Z4W.js} +1 -1
  14. package/dist/{coordinator-prompt-DPO7L2JO.js → coordinator-prompt-KIHNLENN.js} +1 -1
  15. package/dist/{global-workspace-TG2TVLUF.js → global-workspace-CGB5CY4U.js} +1 -1
  16. package/dist/{global-workspace-4RDPAOTT.js → global-workspace-WXDWFZAN.js} +1 -1
  17. package/dist/index.cjs +150 -21
  18. package/dist/index.d.cts +19 -4
  19. package/dist/index.d.ts +19 -4
  20. package/dist/index.js +156 -27
  21. package/dist/mcp/run-stdio.cjs +150 -21
  22. package/dist/mcp/run-stdio.js +153 -24
  23. package/dist/{orchestrator-QDHZ56LA.js → orchestrator-DMEE7CEW.js} +4 -4
  24. package/dist/{orchestrator-3I2FLEZL.js → orchestrator-MUD4FY7Q.js} +4 -4
  25. package/dist/{workspaces-4PA24IX6.js → workspaces-7DPHDXNY.js} +1 -1
  26. package/dist/{workspaces-6TMYV4N2.js → workspaces-ZCTF4ECL.js} +1 -1
  27. package/package.json +1 -1
@@ -44,7 +44,7 @@ import {
44
44
  syncBoardPins,
45
45
  workspaceTagTargetRef,
46
46
  writeAgentBlock
47
- } from "../chunk-2MESZ5XR.js";
47
+ } from "../chunk-7WPQAVS5.js";
48
48
  import "../chunk-DC3VZXMA.js";
49
49
  import {
50
50
  SIDEBOARD_THREAD_ID_ENV,
@@ -54,7 +54,7 @@ import {
54
54
  shouldRegisterMcpWaitForTurn,
55
55
  sideboardMcpProfile,
56
56
  worktreeMcpToolNames
57
- } from "../chunk-5AHWUJRT.js";
57
+ } from "../chunk-UXAKH4AW.js";
58
58
  import {
59
59
  classifyTurnFailure,
60
60
  mcpWaitForJobTimeoutMs,
@@ -66,7 +66,7 @@ import {
66
66
  waitForDetachedJob,
67
67
  waitForTurnToolResult,
68
68
  workspaceAgentChatSummaries
69
- } from "../chunk-MANERA6F.js";
69
+ } from "../chunk-AEEOYLVK.js";
70
70
  import {
71
71
  HUGE_TOOL_RESULT_SUMMARY,
72
72
  clipToolResultForStore,
@@ -107,7 +107,7 @@ import {
107
107
  isCloudCoordinatorThread,
108
108
  isGlobalThread,
109
109
  isOrchestratorThread
110
- } from "../chunk-EZ2MUWNW.js";
110
+ } from "../chunk-SZY23KGS.js";
111
111
  import {
112
112
  canonicalizeRepoPath,
113
113
  formatGhLandError,
@@ -3191,6 +3191,53 @@ function buildWaterfall(rows) {
3191
3191
  )
3192
3192
  })).sort((a, b) => (a.nodes[0]?.label ?? "").localeCompare(b.nodes[0]?.label ?? ""));
3193
3193
  }
3194
+ function joinCapped(lines, max = 3) {
3195
+ if (lines.length <= max) return lines.join(". ");
3196
+ const extra = lines.length - max;
3197
+ return `${lines.slice(0, max).join(". ")}. ${extra} more`;
3198
+ }
3199
+ function planWatchCopy(chains) {
3200
+ const start = [];
3201
+ const waiting = [];
3202
+ const ready = [];
3203
+ for (const chain of chains) {
3204
+ const incoming = chain.nodes.flatMap((node) => node.incoming);
3205
+ for (const node of chain.nodes) {
3206
+ const gating = node.incoming.filter((edge) => !edge.loop);
3207
+ const blocked = gating.filter((edge) => !edge.met);
3208
+ if (blocked.length > 0) {
3209
+ const verb = blocked.some((edge2) => edge2.hold === "start") ? "start" : "merge";
3210
+ const edge = blocked.find((row) => row.hold === verb) ?? blocked[0];
3211
+ waiting.push(
3212
+ `${node.label} can ${verb} once ${edge.fromLabel} is ${gatePhrase(edge.gate)}`
3213
+ );
3214
+ if (verb === "merge") start.push(`${node.label} can start`);
3215
+ continue;
3216
+ }
3217
+ if (gating.length > 0) {
3218
+ const verb = gating.every((edge) => edge.hold === "merge") ? "merge" : "start";
3219
+ ready.push(`${node.label} can ${verb}`);
3220
+ continue;
3221
+ }
3222
+ const outgoing = incoming.filter((edge) => edge.fromKey === node.key && !edge.loop);
3223
+ if (outgoing.length > 0 && outgoing.every((edge) => edge.met)) continue;
3224
+ start.push(`${node.label} can start`);
3225
+ }
3226
+ }
3227
+ if (start.length === 0 && waiting.length === 0 && ready.length === 0) {
3228
+ return "Later steps wait until the one above reaches its gate. In main clears when that pull request is merged. In production stays waiting until you mark it.";
3229
+ }
3230
+ const sentences = [];
3231
+ if (start.length) sentences.push(joinCapped(start));
3232
+ if (ready.length) sentences.push(joinCapped(ready));
3233
+ if (waiting.length) {
3234
+ sentences.push(
3235
+ start.length || ready.length ? `Still waiting: ${joinCapped(waiting)}` : `Running and idle. ${joinCapped(waiting)}. A merge or a production mark is what moves the next step`
3236
+ );
3237
+ }
3238
+ const text6 = sentences.join(". ");
3239
+ return text6.endsWith(".") ? text6 : `${text6}.`;
3240
+ }
3194
3241
  function gatePhrase(gate) {
3195
3242
  return gate === "in-prod" ? "in production" : "in main";
3196
3243
  }
@@ -3266,10 +3313,72 @@ function formatOrderPlace(rows, you) {
3266
3313
  return lines.join("\n");
3267
3314
  }
3268
3315
  function executionSlice(rows) {
3269
- return {
3270
- ready: rows.filter((row) => row.met || row.loop),
3271
- waiting: rows.filter((row) => !row.met && !row.loop)
3316
+ const byKey = /* @__PURE__ */ new Map();
3317
+ const touch = (target, label, depth, asSubject) => {
3318
+ const key = targetKey(target);
3319
+ const found = byKey.get(key);
3320
+ if (!found) {
3321
+ byKey.set(key, {
3322
+ target,
3323
+ label,
3324
+ depth: asSubject ? depth : Number.POSITIVE_INFINITY,
3325
+ asSubject,
3326
+ incoming: [],
3327
+ outgoing: []
3328
+ });
3329
+ return;
3330
+ }
3331
+ if (asSubject || !found.asSubject) found.label = label;
3332
+ if (asSubject) {
3333
+ found.asSubject = true;
3334
+ found.depth = Math.min(found.depth, depth);
3335
+ }
3272
3336
  };
3337
+ for (const row of rows) {
3338
+ touch(row.subject, row.subjectLabel, row.depth, true);
3339
+ touch(row.waitsOn, row.waitsOnLabel, row.depth, false);
3340
+ if (row.loop) continue;
3341
+ byKey.get(targetKey(row.subject)).incoming.push(row);
3342
+ byKey.get(targetKey(row.waitsOn)).outgoing.push(row);
3343
+ }
3344
+ const start = [];
3345
+ const waiting = [];
3346
+ const mergeHeld = [];
3347
+ const gateName = (row) => row.gate === "in-prod" ? "in prod" : "in main";
3348
+ const items = [...byKey.values()].sort((a, b) => {
3349
+ const depthA = Number.isFinite(a.depth) ? a.depth : 0;
3350
+ const depthB = Number.isFinite(b.depth) ? b.depth : 0;
3351
+ return depthA - depthB || a.label.localeCompare(b.label);
3352
+ });
3353
+ for (const item of items) {
3354
+ const startBlocked = item.incoming.filter((row) => !row.met && row.hold === "start");
3355
+ const mergeBlocked = item.incoming.filter((row) => !row.met && row.hold === "merge");
3356
+ const settled = item.outgoing.length > 0 && item.outgoing.every((row) => row.met) && startBlocked.length === 0 && mergeBlocked.length === 0;
3357
+ if (startBlocked.length > 0) {
3358
+ const edge = startBlocked[0];
3359
+ waiting.push({
3360
+ target: item.target,
3361
+ label: item.label,
3362
+ detail: `${edge.waitsOnLabel} must be ${gateName(edge)} before this can start`
3363
+ });
3364
+ } else if (!settled) {
3365
+ const pending = item.outgoing.find((row) => !row.met);
3366
+ start.push({
3367
+ target: item.target,
3368
+ label: item.label,
3369
+ detail: pending ? `Start this so it can reach ${pending.gate === "in-prod" ? "production" : "main"}` : "Start this"
3370
+ });
3371
+ }
3372
+ if (mergeBlocked.length > 0 && startBlocked.length === 0) {
3373
+ const edge = mergeBlocked[0];
3374
+ mergeHeld.push({
3375
+ target: item.target,
3376
+ label: item.label,
3377
+ detail: `Do not merge until ${edge.waitsOnLabel} is ${gateName(edge)}`
3378
+ });
3379
+ }
3380
+ }
3381
+ return { start, waiting, mergeHeld };
3273
3382
  }
3274
3383
  function orderEdgeTouches(edge, you) {
3275
3384
  return orderTargetMatches(edge.subject, you) || orderTargetMatches(edge.waitsOn, you);
@@ -3290,7 +3399,7 @@ function formatOrderText(rows, plan) {
3290
3399
  rows.forEach((row, index) => {
3291
3400
  const gate = row.gate === "in-prod" ? "in prod" : "in main";
3292
3401
  const hold = row.hold === "merge" ? "merge" : "start";
3293
- const state = row.loop ? "loop" : row.met ? "clear" : "waiting";
3402
+ const state = row.loop ? "loop" : row.met ? "clear" : row.hold === "merge" ? "merge" : "waiting";
3294
3403
  lines.push(
3295
3404
  row.loop ? `${index + 1}. ${state} ${row.subjectLabel} returns to ${row.waitsOnLabel} once it is ${gate}` : `${index + 1}. ${state} ${row.waitsOnLabel} must be ${gate} before ${row.subjectLabel} can ${hold}`
3296
3405
  );
@@ -3298,6 +3407,17 @@ function formatOrderText(rows, plan) {
3298
3407
  if (row.note) lines.push(` ${row.note}`);
3299
3408
  lines.push(` id: ${row.id.slice(0, 8)}`);
3300
3409
  });
3410
+ if (plan?.status === "active") {
3411
+ const slice = executionSlice(rows);
3412
+ const section = (title, items) => {
3413
+ if (!items.length) return;
3414
+ lines.push("", title);
3415
+ for (const item of items) lines.push(`- ${item.label}. ${item.detail}`);
3416
+ };
3417
+ section("Start now:", slice.start);
3418
+ section("Do not start:", slice.waiting);
3419
+ section("Do not merge:", slice.mergeHeld);
3420
+ }
3301
3421
  return lines.join("\n");
3302
3422
  }
3303
3423
  function escapeHtml(value) {
@@ -3330,6 +3450,15 @@ function markWorkingChains(chains, threads) {
3330
3450
  })
3331
3451
  }));
3332
3452
  }
3453
+ function waterfallBar(node, chain) {
3454
+ const gating = node.incoming.filter((edge) => !edge.loop);
3455
+ const startBlocked = gating.some((edge) => !edge.met && edge.hold === "start");
3456
+ const outgoing = chain.nodes.flatMap((other) => other.incoming).filter((edge) => edge.fromKey === node.key && !edge.loop);
3457
+ const settled = outgoing.length > 0 && outgoing.every((edge) => edge.met) && !startBlocked;
3458
+ if (startBlocked) return " waiting";
3459
+ if (settled || gating.length > 0 && gating.every((edge) => edge.met)) return " clear";
3460
+ return " start";
3461
+ }
3333
3462
  function nodeIsYou(node, you) {
3334
3463
  if (!you) return false;
3335
3464
  return orderTargetMatches(
@@ -3345,20 +3474,20 @@ function formatWaterfallHtml(chains, opts) {
3345
3474
  const plan = opts?.plan ?? null;
3346
3475
  const you = opts?.you ?? null;
3347
3476
  const title = plan?.title?.trim() || "Planner";
3348
- const status = plan ? plan.status === "active" ? "Running. Ready steps can start. Waiting steps stay held." : "Draft. Discuss this and change it. Nothing runs until you agree." : "Later steps wait until the one above reaches its gate. In main clears when that pull request is merged. In production stays waiting until it is marked.";
3477
+ const watch = chains.length ? planWatchCopy(chains) : "";
3478
+ const status = plan ? plan.status === "active" ? watch || "Running. Start the steps that are free. Leave held steps alone." : watch ? `Draft. Nothing runs until you agree. ${watch}` : "Draft. Discuss this and change it. Nothing runs until you agree." : watch || "Later steps wait until the one above reaches its gate. In main clears when that pull request is merged. In production stays waiting until it is marked.";
3349
3479
  const body = chains.length === 0 ? '<p class="empty">No order yet.</p>' : chains.map((chain) => {
3350
3480
  const nodes = chain.nodes.map((node) => {
3351
- const waiting = node.incoming.some((edge) => !edge.met && !edge.loop);
3352
- const clear = node.incoming.some((edge) => !edge.loop) && !waiting;
3353
3481
  const yours = nodeIsYou(node, you);
3354
3482
  const working = node.working === true;
3355
- const state = `${waiting ? " waiting" : clear ? " clear" : ""}${yours ? " you" : ""}${working ? " current" : ""}`;
3483
+ const bar = waterfallBar(node, chain);
3484
+ const state = `${working ? " current" : ""}${bar}${yours ? " you" : ""}`;
3356
3485
  const drops = node.incoming.map((edge) => {
3357
3486
  const tone = edge.loop ? "loop" : edge.met ? "clear" : "waiting";
3358
3487
  const note = edge.note ? `<span>${escapeHtml(edge.note)}</span>` : "";
3359
3488
  return `<div class="drop"><span>After ${escapeHtml(edge.fromLabel)} is ${escapeHtml(gatePhrase(edge.gate))}, this ${escapeHtml(holdPhrase(edge.hold))}</span><span class="${tone}">${escapeHtml(edge.detail)}</span>${note}</div>`;
3360
3489
  }).join("");
3361
- const kicker = `${WATERFALL_KIND[node.kind]}${working ? " \xB7 Working" : ""}${yours ? " \xB7 You" : ""}`;
3490
+ const kicker = `${WATERFALL_KIND[node.kind]}${bar === " start" ? " \xB7 Start" : ""}${working ? " \xB7 Working" : ""}${yours ? " \xB7 You" : ""}`;
3362
3491
  return `<li class="node" style="margin-left:${node.depth * 28}px">${drops}<div class="bar${state}"><span class="kicker">${kicker}</span><strong>${escapeHtml(node.label)}</strong></div></li>`;
3363
3492
  }).join("");
3364
3493
  return `<ol class="chain">${nodes}</ol>`;
@@ -3381,6 +3510,7 @@ h1 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
3381
3510
  .bar { border: 1px solid #333; border-radius: 10px; padding: 10px 12px; background: #1c1c1c; display: flex; flex-direction: column; gap: 2px; }
3382
3511
  .bar.waiting { border-color: #6a5420; background: #221c10; }
3383
3512
  .bar.clear { border-color: #2d5a32; background: #142016; }
3513
+ .bar.start { border-color: #2a4a7a; background: #141c28; }
3384
3514
  .bar.you { outline: 1px solid #8ab4ff; }
3385
3515
  .bar.current { border-color: #8ab4ff; box-shadow: inset 3px 0 0 #8ab4ff; }
3386
3516
  .bar.current .kicker { color: #ececec; }
@@ -3589,7 +3719,7 @@ function executeOrderPlan(ownerThreadId) {
3589
3719
  const ids = new Set(edges.map((edge) => edge.id));
3590
3720
  const rows = resolveOrchestrationGates(file.plans, file.edges, threadSnapshots(), file.marks);
3591
3721
  const slice = executionSlice(rows.filter((row) => ids.has(row.id)));
3592
- return { plan, ready: slice.ready, waiting: slice.waiting };
3722
+ return { plan, start: slice.start, waiting: slice.waiting, mergeHeld: slice.mergeHeld };
3593
3723
  }
3594
3724
  function threadSnapshots() {
3595
3725
  try {
@@ -3867,7 +3997,7 @@ function registerOrderTools(server) {
3867
3997
  );
3868
3998
  server.tool(
3869
3999
  "execute_plan",
3870
- "Mark the plan active after the user has seen it and told you to run it. Returns ready steps (start those with create_workspace or send_to_chat) and waiting steps (leave them alone). Does not create workspaces. Pass agreed: true only after they agree. Merge only if they asked.",
4000
+ "Mark the plan active after the user has seen it and told you to run it. Returns start (open or continue these, including the first step others wait on), waiting (hold=start is still unmet; leave them alone), and mergeHeld (work may proceed; do not merge). Does not create workspaces. Pass agreed: true only after they agree. Merge only if they asked.",
3871
4001
  {
3872
4002
  agreed: z9.literal(true).describe("True only after the user has seen the plan and told you to run it")
3873
4003
  },
@@ -3875,21 +4005,20 @@ function registerOrderTools(server) {
3875
4005
  try {
3876
4006
  const result = executeOrderPlan(orchestrationOwnerId(false));
3877
4007
  const brief = (row) => ({
3878
- id: row.id,
3879
- hold: row.hold,
3880
- gate: row.gate,
3881
- waitsOn: row.waitsOnLabel,
3882
- subject: row.subjectLabel,
3883
- detail: row.detail,
3884
- ...row.loop ? { loop: true } : {}
4008
+ kind: row.target.kind,
4009
+ ref: row.target.ref,
4010
+ ...row.target.repoPath ? { repoPath: row.target.repoPath } : {},
4011
+ label: row.label,
4012
+ detail: row.detail
3885
4013
  });
3886
4014
  return mcpJson({
3887
4015
  ok: true,
3888
4016
  status: result.plan.status,
3889
4017
  title: result.plan.title,
3890
- ready: result.ready.map(brief),
4018
+ start: result.start.map(brief),
3891
4019
  waiting: result.waiting.map(brief),
3892
- message: "Plan is active. Start ready steps with create_workspace or send_to_chat. Leave waiting steps alone. Merge only if the user asked."
4020
+ mergeHeld: result.mergeHeld.map(brief),
4021
+ message: "Plan is active. Start every step in start with create_workspace (kind pr or issue; pass repoPath when set) or send_to_chat (kind workspace or orchestration). create_workspace returns a checkout that already exists. Leave waiting alone. Steps in mergeHeld can proceed; do not merge them. Merge only if the user asked."
3893
4022
  });
3894
4023
  } catch (err) {
3895
4024
  return mcpJson({ error: err instanceof Error ? err.message : String(err) }, true);
@@ -11,17 +11,17 @@ import {
11
11
  resolveSendFollowUp,
12
12
  startOrchestration,
13
13
  waitForPidExit
14
- } from "./chunk-2MESZ5XR.js";
14
+ } from "./chunk-7WPQAVS5.js";
15
15
  import "./chunk-DC3VZXMA.js";
16
- import "./chunk-5AHWUJRT.js";
17
- import "./chunk-MANERA6F.js";
16
+ import "./chunk-UXAKH4AW.js";
17
+ import "./chunk-AEEOYLVK.js";
18
18
  import "./chunk-LESWJ7L4.js";
19
19
  import "./chunk-LX5R5JOR.js";
20
20
  import "./chunk-WJURGCBR.js";
21
21
  import "./chunk-5TCMXEYL.js";
22
22
  import "./chunk-BF6INES4.js";
23
23
  import "./chunk-4GK32AYX.js";
24
- import "./chunk-EZ2MUWNW.js";
24
+ import "./chunk-SZY23KGS.js";
25
25
  import "./chunk-VHQ6OG3U.js";
26
26
  import "./chunk-I6RGRUNY.js";
27
27
  import "./chunk-E63AM3PW.js";
@@ -9,22 +9,22 @@ import {
9
9
  resolveSendFollowUp,
10
10
  startOrchestration,
11
11
  waitForPidExit
12
- } from "./chunk-W5GHFT7E.js";
12
+ } from "./chunk-BDWVBEKN.js";
13
13
  import "./chunk-BZK62VPT.js";
14
14
  import "./chunk-PGPSIEMW.js";
15
15
  import "./chunk-W3ZLE4PO.js";
16
- import "./chunk-NDEVAA34.js";
16
+ import "./chunk-AAKQU4UZ.js";
17
17
  import "./chunk-F4RFFE2H.js";
18
18
  import "./chunk-OHXNGBC4.js";
19
19
  import "./chunk-RSA47QYR.js";
20
20
  import "./chunk-WB3G2LQO.js";
21
- import "./chunk-ZBSEJIOV.js";
21
+ import "./chunk-C3E2DGDF.js";
22
22
  import "./chunk-WWBPK7GB.js";
23
23
  import "./chunk-YE7Z5WH3.js";
24
24
  import "./chunk-7H655NEW.js";
25
25
  import "./chunk-JAT3JFOS.js";
26
26
  import "./chunk-LAWLUOWQ.js";
27
- import "./chunk-LFSTOECH.js";
27
+ import "./chunk-HISSQICH.js";
28
28
  import "./chunk-FQ3JYUKI.js";
29
29
  import "./chunk-TCEUNSLX.js";
30
30
  import "./chunk-BMRJNRQK.js";
@@ -11,7 +11,7 @@ import {
11
11
  removeWorkspace,
12
12
  sameWorkspacePath,
13
13
  syncWorkspacesFromThreads
14
- } from "./chunk-EZ2MUWNW.js";
14
+ } from "./chunk-SZY23KGS.js";
15
15
  import "./chunk-VHQ6OG3U.js";
16
16
  import "./chunk-N2WW62LF.js";
17
17
  import "./chunk-GK7H3SY7.js";
@@ -9,7 +9,7 @@ import {
9
9
  removeWorkspace,
10
10
  sameWorkspacePath,
11
11
  syncWorkspacesFromThreads
12
- } from "./chunk-LFSTOECH.js";
12
+ } from "./chunk-HISSQICH.js";
13
13
  import "./chunk-FQ3JYUKI.js";
14
14
  import "./chunk-TCEUNSLX.js";
15
15
  import "./chunk-BMRJNRQK.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sideboard-ai/core",
3
- "version": "0.1.350",
3
+ "version": "0.1.351",
4
4
  "description": "Sideboard core — orchestration, agents, git worktrees, MCP server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",