@sideboard-ai/core 0.1.250 → 0.1.252

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-7IIUQLCC.js → agents-B66CNEPB.js} +3 -3
  2. package/dist/{agents-72QLUO4L.js → agents-C7T4US6D.js} +3 -3
  3. package/dist/{chunk-IJIMEK2K.js → chunk-4DGYMF7H.js} +24 -13
  4. package/dist/{chunk-W4BGLHA3.js → chunk-6IP4FWMK.js} +1 -1
  5. package/dist/{chunk-RLJHH6T7.js → chunk-AQQWP2TL.js} +23 -11
  6. package/dist/{chunk-DMT62X6L.js → chunk-BHPGORIY.js} +25 -13
  7. package/dist/{chunk-EV4QJNR7.js → chunk-FKGVQKRX.js} +25 -12
  8. package/dist/{chunk-566W54AN.js → chunk-NYXDZCMP.js} +50 -14
  9. package/dist/{chunk-WSOFNJPD.js → chunk-PV4KCI2S.js} +50 -14
  10. package/dist/{chunk-SJPK5Y5U.js → chunk-SJ3IUYG2.js} +1 -1
  11. package/dist/{coordinator-prompt-Q53MIP2G.js → coordinator-prompt-A2JJ5X7B.js} +2 -2
  12. package/dist/{coordinator-prompt-ON5YI463.js → coordinator-prompt-BX2R5EMW.js} +2 -2
  13. package/dist/{global-workspace-MTBVW6GW.js → global-workspace-JJRPZNTY.js} +2 -2
  14. package/dist/{global-workspace-VWF5AOYN.js → global-workspace-PUJEGSOB.js} +2 -2
  15. package/dist/index.cjs +88 -26
  16. package/dist/index.d.cts +25 -1
  17. package/dist/index.d.ts +25 -1
  18. package/dist/index.js +7 -5
  19. package/dist/mcp/run-stdio.cjs +85 -26
  20. package/dist/mcp/run-stdio.js +5 -5
  21. package/dist/{orchestrator-NKG4R6TX.js → orchestrator-O3TVI7SN.js} +4 -4
  22. package/dist/{orchestrator-HEFTR7RA.js → orchestrator-O3V4UH73.js} +4 -4
  23. package/dist/{workspaces-QWGSPLMF.js → workspaces-FUOZIR3V.js} +2 -2
  24. package/dist/{workspaces-24YJWKJQ.js → workspaces-V3PZRTY5.js} +2 -2
  25. package/dist/{worktree-RYZOFNY7.js → worktree-4DNK2CK6.js} +1 -1
  26. package/dist/{worktree-VED7K2UL.js → worktree-UK62JCYF.js} +1 -1
  27. package/package.json +1 -1
@@ -5888,6 +5888,23 @@ function prIsInMergeQueue(gate) {
5888
5888
  if (gate.isInMergeQueue) return true;
5889
5889
  return (gate.mergeStateStatus ?? "").toUpperCase() === "QUEUED";
5890
5890
  }
5891
+ function applyCleanLocalMergeTree(gate) {
5892
+ const mergeable = (gate.mergeable ?? "").toUpperCase();
5893
+ const mergeState = (gate.mergeStateStatus ?? "").toUpperCase();
5894
+ const githubConflicting = mergeable === "CONFLICTING" || mergeState === "DIRTY";
5895
+ if (githubConflicting) {
5896
+ return {
5897
+ ...gate,
5898
+ mergeable: "MERGEABLE",
5899
+ mergeStateStatus: mergeState === "BEHIND" ? "BEHIND" : "CLEAN"
5900
+ };
5901
+ }
5902
+ return {
5903
+ ...gate,
5904
+ mergeable: mergeable === "UNKNOWN" || !mergeable ? "MERGEABLE" : gate.mergeable,
5905
+ mergeStateStatus: mergeState === "BEHIND" ? "BEHIND" : mergeState === "UNKNOWN" || !mergeState ? "CLEAN" : gate.mergeStateStatus
5906
+ };
5907
+ }
5891
5908
  function ciChecksFailed(checks) {
5892
5909
  if (!checks?.length) return false;
5893
5910
  return checks.some(
@@ -6511,6 +6528,21 @@ async function listPrs(repoPath, opts) {
6511
6528
  if (exitCode !== 0 || !stdout.trim()) return [];
6512
6529
  return applyPrListResponse(stdout, { ...resolved, limit, viewerTeams });
6513
6530
  }
6531
+ function prInfoFromGhView(view) {
6532
+ const author = view.author;
6533
+ const login = author?.login?.trim();
6534
+ return {
6535
+ number: Number(view.number),
6536
+ title: String(view.title ?? ""),
6537
+ headRefName: String(view.headRefName ?? ""),
6538
+ url: String(view.url ?? ""),
6539
+ isCrossRepository: Boolean(view.isCrossRepository),
6540
+ author: login ? { login } : null,
6541
+ isDraft: Boolean(view.isDraft),
6542
+ state: typeof view.state === "string" ? view.state : void 0,
6543
+ labels: labelNames(view.labels)
6544
+ };
6545
+ }
6514
6546
  async function getPr(repoPath, number) {
6515
6547
  const slug = await resolveGithubRepoSlug(repoPath);
6516
6548
  const args = [
@@ -6518,12 +6550,16 @@ async function getPr(repoPath, number) {
6518
6550
  "view",
6519
6551
  String(number),
6520
6552
  "--json",
6521
- "number,title,headRefName,url,isCrossRepository,author"
6553
+ PR_INFO_JSON_FIELDS
6522
6554
  ];
6523
6555
  if (slug) args.push("--repo", slug);
6524
6556
  const { stdout, exitCode } = await gh(args, repoPath, { reject: false });
6525
6557
  if (exitCode !== 0 || !stdout.trim()) return null;
6526
- return JSON.parse(stdout);
6558
+ try {
6559
+ return prInfoFromGhView(JSON.parse(stdout));
6560
+ } catch {
6561
+ return null;
6562
+ }
6527
6563
  }
6528
6564
  function normalizeGitBranchName(ref) {
6529
6565
  return ref.trim().replace(/^refs\/heads\//, "").replace(/^origin\//, "");
@@ -6577,7 +6613,7 @@ async function getPrForHeadBranch(repoPath, branch) {
6577
6613
  "--head",
6578
6614
  listHead,
6579
6615
  "--json",
6580
- "number,title,headRefName,url,isCrossRepository,author",
6616
+ PR_INFO_JSON_FIELDS,
6581
6617
  "--limit",
6582
6618
  "1",
6583
6619
  "--state",
@@ -6588,7 +6624,7 @@ async function getPrForHeadBranch(repoPath, branch) {
6588
6624
  if (listed.exitCode === 0 && listed.stdout.trim()) {
6589
6625
  try {
6590
6626
  const rows = JSON.parse(listed.stdout);
6591
- if (rows[0]) return rows[0];
6627
+ if (rows[0]) return prInfoFromGhView(rows[0]);
6592
6628
  } catch {
6593
6629
  }
6594
6630
  }
@@ -6597,13 +6633,13 @@ async function getPrForHeadBranch(repoPath, branch) {
6597
6633
  "view",
6598
6634
  head,
6599
6635
  "--json",
6600
- "number,title,headRefName,url,isCrossRepository,author,state"
6636
+ `${PR_INFO_JSON_FIELDS},state`
6601
6637
  ];
6602
6638
  if (slug) viewArgs.push("--repo", slug);
6603
6639
  const viewed = await gh(viewArgs, repoPath, { reject: false });
6604
6640
  if (viewed.exitCode !== 0 || !viewed.stdout.trim()) return null;
6605
6641
  try {
6606
- const info = JSON.parse(viewed.stdout);
6642
+ const info = prInfoFromGhView(JSON.parse(viewed.stdout));
6607
6643
  const state = (info.state ?? "OPEN").trim().toUpperCase();
6608
6644
  if (state !== "OPEN") return null;
6609
6645
  return info;
@@ -6703,9 +6739,10 @@ ${result.stderr}`;
6703
6739
  async function probeLocalMergeGate(cwd, gate) {
6704
6740
  const mergeable = (gate?.mergeable ?? "").toUpperCase();
6705
6741
  const mergeState = (gate?.mergeStateStatus ?? "").toUpperCase();
6706
- const alreadyConflicting = mergeable === "CONFLICTING" || mergeState === "DIRTY";
6742
+ const githubConflicting = mergeable === "CONFLICTING" || mergeState === "DIRTY";
6743
+ const githubUnknown = mergeable === "UNKNOWN" || mergeState === "UNKNOWN";
6707
6744
  const inQueue = gate ? prIsInMergeQueue(gate) : false;
6708
- if (alreadyConflicting || inQueue) return { gate, files: [] };
6745
+ if (inQueue) return { gate, files: [] };
6709
6746
  try {
6710
6747
  const local = await detectLocalMergeConflicts(cwd, gate?.baseRefName ?? null);
6711
6748
  if (local.conflicting) {
@@ -6721,13 +6758,9 @@ async function probeLocalMergeGate(cwd, gate) {
6721
6758
  files: local.files
6722
6759
  };
6723
6760
  }
6724
- if (gate && (mergeable === "UNKNOWN" || mergeState === "UNKNOWN")) {
6761
+ if (gate && (githubConflicting || githubUnknown)) {
6725
6762
  return {
6726
- gate: {
6727
- ...gate,
6728
- mergeable: gate.mergeable === "UNKNOWN" ? "MERGEABLE" : gate.mergeable,
6729
- mergeStateStatus: gate.mergeStateStatus === "UNKNOWN" ? "CLEAN" : gate.mergeStateStatus
6730
- },
6763
+ gate: applyCleanLocalMergeTree(gate),
6731
6764
  files: []
6732
6765
  };
6733
6766
  }
@@ -6867,6 +6900,7 @@ function parsePrDetailsView(view) {
6867
6900
  isDraft: Boolean(view.isDraft),
6868
6901
  reviewDecision: typeof view.reviewDecision === "string" && view.reviewDecision ? view.reviewDecision : null,
6869
6902
  author: { login: author.login ?? "unknown", name: author.name ?? null },
6903
+ createdAt: typeof view.createdAt === "string" && view.createdAt ? view.createdAt : null,
6870
6904
  baseRefName: String(view.baseRefName ?? ""),
6871
6905
  headRefName: String(view.headRefName ?? ""),
6872
6906
  additions: Number(view.additions ?? 0),
@@ -7642,7 +7676,7 @@ function allocateTeamSlug(repoPath) {
7642
7676
  }
7643
7677
  throw new Error("No available soccer team worktree directories left");
7644
7678
  }
7645
- var import_node_crypto4, import_node_fs15, import_node_os6, import_node_path18, PR_DETAILS_JSON_FIELDS;
7679
+ var import_node_crypto4, import_node_fs15, import_node_os6, import_node_path18, PR_INFO_JSON_FIELDS, PR_DETAILS_JSON_FIELDS;
7646
7680
  var init_worktree = __esm({
7647
7681
  "src/git/worktree.ts"() {
7648
7682
  "use strict";
@@ -7668,6 +7702,7 @@ var init_worktree = __esm({
7668
7702
  init_git_auth_mode();
7669
7703
  init_workspace_scratch();
7670
7704
  init_worktree_labels();
7705
+ PR_INFO_JSON_FIELDS = "number,title,headRefName,url,isCrossRepository,author,isDraft,labels";
7671
7706
  PR_DETAILS_JSON_FIELDS = [
7672
7707
  "number",
7673
7708
  "title",
@@ -7677,6 +7712,7 @@ var init_worktree = __esm({
7677
7712
  "isDraft",
7678
7713
  "reviewDecision",
7679
7714
  "author",
7715
+ "createdAt",
7680
7716
  "baseRefName",
7681
7717
  "headRefName",
7682
7718
  "additions",
@@ -10345,6 +10381,15 @@ function isContextCompactInProgress(text7) {
10345
10381
  if (isContextCompactDone(t)) return false;
10346
10382
  return /^Compressing context/i.test(t);
10347
10383
  }
10384
+ function isSystemStatusThinking(event) {
10385
+ if (event.replace) return true;
10386
+ const t = (event.data ?? "").trim();
10387
+ if (!t) return true;
10388
+ if (/^API retry\b/i.test(t)) return true;
10389
+ if (/^MCP:/i.test(t)) return true;
10390
+ if (isContextCompactInProgress(t) || isContextCompactDone(t)) return true;
10391
+ return false;
10392
+ }
10348
10393
  function looksLikeConversationSummary(text7) {
10349
10394
  const t = text7.trim();
10350
10395
  if (t.length < 80) return false;
@@ -10796,15 +10841,6 @@ function applyAgentEvent(parts, event) {
10796
10841
  );
10797
10842
  return next2;
10798
10843
  }
10799
- if (contextCompactInProgress(parts, event.parentId)) {
10800
- return [
10801
- ...parts,
10802
- compactToolPart(data, `compact-${parts.length}`, {
10803
- parentId: event.parentId,
10804
- status: "running"
10805
- })
10806
- ];
10807
- }
10808
10844
  const runningSkillIdx = lastRunningSkillIndex(parts, event.parentId);
10809
10845
  if (runningSkillIdx >= 0) {
10810
10846
  const prev = parts[runningSkillIdx];
@@ -10823,6 +10859,15 @@ function applyAgentEvent(parts, event) {
10823
10859
  );
10824
10860
  return next2;
10825
10861
  }
10862
+ if (contextCompactInProgress(parts, event.parentId)) {
10863
+ return [
10864
+ ...parts,
10865
+ compactToolPart(data, `compact-${parts.length}`, {
10866
+ parentId: event.parentId,
10867
+ status: "running"
10868
+ })
10869
+ ];
10870
+ }
10826
10871
  const next = [...parts];
10827
10872
  const last = next[next.length - 1];
10828
10873
  if (last?.type === "text" && sameParentId(last.parentId, event.parentId)) {
@@ -10859,7 +10904,9 @@ function applyAgentEvent(parts, event) {
10859
10904
  if (event.type === "thinking") {
10860
10905
  const data = event.data;
10861
10906
  if (!data) return parts;
10862
- parts = markRunningSkillsDone(parts, event.parentId);
10907
+ if (!isSystemStatusThinking(event)) {
10908
+ parts = markRunningSkillsDone(parts, event.parentId);
10909
+ }
10863
10910
  const next = [...parts];
10864
10911
  if (event.replace) {
10865
10912
  for (let i = next.length - 1; i >= 0; i--) {
@@ -18691,6 +18738,7 @@ async function createThread(input, _onSetupLine) {
18691
18738
  let prTitle = null;
18692
18739
  let prAuthorLogin2 = null;
18693
18740
  let prLabels = [];
18741
+ let prIsDraft = false;
18694
18742
  if (sourceType === "pr") {
18695
18743
  const num2 = Number(input.sourceRef.replace(/^#/, ""));
18696
18744
  if (!Number.isFinite(num2)) throw new Error(`Invalid PR number: ${input.sourceRef}`);
@@ -18708,6 +18756,7 @@ async function createThread(input, _onSetupLine) {
18708
18756
  prUrl = pr.url;
18709
18757
  prAuthorLogin2 = pr.author?.login?.trim() || null;
18710
18758
  prLabels = pr.labels ?? [];
18759
+ prIsDraft = Boolean(pr.isDraft);
18711
18760
  const localFetchBranch = `sideboard-pr-${pr.number}`;
18712
18761
  await fetchPrHead(repoPath, pr.number, localFetchBranch);
18713
18762
  sourceRef = localFetchBranch;
@@ -18732,6 +18781,7 @@ async function createThread(input, _onSetupLine) {
18732
18781
  prTitle = existing.title;
18733
18782
  prAuthorLogin2 = existing.author?.login?.trim() || null;
18734
18783
  prLabels = existing.labels ?? [];
18784
+ prIsDraft = Boolean(existing.isDraft);
18735
18785
  }
18736
18786
  }
18737
18787
  }
@@ -18768,7 +18818,8 @@ async function createThread(input, _onSetupLine) {
18768
18818
  prUrl,
18769
18819
  prTitle,
18770
18820
  prAuthorLogin: prAuthorLogin2,
18771
- prLabels
18821
+ prLabels,
18822
+ prIsDraft
18772
18823
  });
18773
18824
  writeThread(thread);
18774
18825
  await ensureWorkspace(repoPath);
@@ -24654,6 +24705,14 @@ var init_orchestrator = __esm({
24654
24705
  const thread = this.requireThread(threadRef);
24655
24706
  return discoverSkills(thread.worktreePath);
24656
24707
  }
24708
+ /** Skills for a project folder before a worktree exists (create modal). */
24709
+ listSkillsForRepo(repoPath) {
24710
+ const root = repoPath.trim();
24711
+ if (!root || root === "/" || root === ".") {
24712
+ return discoverSkills("/__sideboard_no_workspace__");
24713
+ }
24714
+ return discoverSkills(root);
24715
+ }
24657
24716
  async previewLand(threadRef) {
24658
24717
  const thread = this.requireThread(threadRef);
24659
24718
  this.assertNotGlobal(thread, "Land");
@@ -49,7 +49,7 @@ import {
49
49
  threadsSharingWorktree,
50
50
  updateSchedule,
51
51
  waitForDetachedJob
52
- } from "../chunk-RLJHH6T7.js";
52
+ } from "../chunk-AQQWP2TL.js";
53
53
  import {
54
54
  PRESENT_PLAN_REQUIRES_PLAN_MODE,
55
55
  PRESENT_PLAN_TOOL_DESCRIPTION,
@@ -66,13 +66,13 @@ import {
66
66
  materializeSystemCaBundle,
67
67
  sideboardMcpProfile,
68
68
  trustSystemCertificates
69
- } from "../chunk-IJIMEK2K.js";
69
+ } from "../chunk-4DGYMF7H.js";
70
70
  import {
71
71
  GLOBAL_WORKSPACE_ID,
72
72
  isCloudCoordinatorThread,
73
73
  isOrchestratorThread,
74
74
  listWorkspaces
75
- } from "../chunk-W4BGLHA3.js";
75
+ } from "../chunk-6IP4FWMK.js";
76
76
  import "../chunk-XAISOBBG.js";
77
77
  import "../chunk-P2BSMNHB.js";
78
78
  import "../chunk-XIEDFRBP.js";
@@ -90,7 +90,7 @@ import {
90
90
  resolveListPrsOptions,
91
91
  resolveRepoRoot,
92
92
  warmGithubAgentAuth
93
- } from "../chunk-WSOFNJPD.js";
93
+ } from "../chunk-PV4KCI2S.js";
94
94
  import "../chunk-D6JWYJ4P.js";
95
95
  import {
96
96
  appendMessage,
@@ -2367,7 +2367,7 @@ async function continueSourceThread(threadId, prompt) {
2367
2367
  await continueOnReply(threadId, prompt);
2368
2368
  return;
2369
2369
  }
2370
- const { getOrchestrator: getOrchestrator2 } = await import("../orchestrator-NKG4R6TX.js");
2370
+ const { getOrchestrator: getOrchestrator2 } = await import("../orchestrator-O3TVI7SN.js");
2371
2371
  await getOrchestrator2().send(threadId, prompt);
2372
2372
  } catch {
2373
2373
  }
@@ -11,15 +11,15 @@ import {
11
11
  resolveSendFollowUp,
12
12
  startOrchestration,
13
13
  waitForPidExit
14
- } from "./chunk-RLJHH6T7.js";
14
+ } from "./chunk-AQQWP2TL.js";
15
15
  import "./chunk-WDDUIGFK.js";
16
16
  import "./chunk-QN5DL2QO.js";
17
- import "./chunk-IJIMEK2K.js";
18
- import "./chunk-W4BGLHA3.js";
17
+ import "./chunk-4DGYMF7H.js";
18
+ import "./chunk-6IP4FWMK.js";
19
19
  import "./chunk-XAISOBBG.js";
20
20
  import "./chunk-P2BSMNHB.js";
21
21
  import "./chunk-VKQGAWHY.js";
22
- import "./chunk-WSOFNJPD.js";
22
+ import "./chunk-PV4KCI2S.js";
23
23
  import "./chunk-D6JWYJ4P.js";
24
24
  import "./chunk-RJC2MKXN.js";
25
25
  import "./chunk-H547WSSZ.js";
@@ -9,11 +9,11 @@ import {
9
9
  resolveSendFollowUp,
10
10
  startOrchestration,
11
11
  waitForPidExit
12
- } from "./chunk-EV4QJNR7.js";
12
+ } from "./chunk-FKGVQKRX.js";
13
13
  import "./chunk-PGPSIEMW.js";
14
- import "./chunk-DMT62X6L.js";
15
- import "./chunk-SJPK5Y5U.js";
16
- import "./chunk-566W54AN.js";
14
+ import "./chunk-BHPGORIY.js";
15
+ import "./chunk-SJ3IUYG2.js";
16
+ import "./chunk-NYXDZCMP.js";
17
17
  import "./chunk-6K64FJDD.js";
18
18
  import "./chunk-2P4XKWV2.js";
19
19
  import "./chunk-5F4YFGHL.js";
@@ -5,8 +5,8 @@ import {
5
5
  primaryCheckoutFromLinkedWorktree,
6
6
  removeWorkspace,
7
7
  syncWorkspacesFromThreads
8
- } from "./chunk-SJPK5Y5U.js";
9
- import "./chunk-566W54AN.js";
8
+ } from "./chunk-SJ3IUYG2.js";
9
+ import "./chunk-NYXDZCMP.js";
10
10
  import "./chunk-6K64FJDD.js";
11
11
  import "./chunk-2P4XKWV2.js";
12
12
  import "./chunk-KJM3E3NF.js";
@@ -7,8 +7,8 @@ import {
7
7
  primaryCheckoutFromLinkedWorktree,
8
8
  removeWorkspace,
9
9
  syncWorkspacesFromThreads
10
- } from "./chunk-W4BGLHA3.js";
11
- import "./chunk-WSOFNJPD.js";
10
+ } from "./chunk-6IP4FWMK.js";
11
+ import "./chunk-PV4KCI2S.js";
12
12
  import "./chunk-D6JWYJ4P.js";
13
13
  import "./chunk-RJC2MKXN.js";
14
14
  import "./chunk-H547WSSZ.js";
@@ -59,7 +59,7 @@ import {
59
59
  worktreeDisplayLabelForGroup,
60
60
  worktreeNameFromPath,
61
61
  worktreeSlugForTicket
62
- } from "./chunk-566W54AN.js";
62
+ } from "./chunk-NYXDZCMP.js";
63
63
  import "./chunk-6K64FJDD.js";
64
64
  import "./chunk-2P4XKWV2.js";
65
65
  import "./chunk-KJM3E3NF.js";
@@ -61,7 +61,7 @@ import {
61
61
  worktreeDisplayLabelForGroup,
62
62
  worktreeNameFromPath,
63
63
  worktreeSlugForTicket
64
- } from "./chunk-WSOFNJPD.js";
64
+ } from "./chunk-PV4KCI2S.js";
65
65
  import "./chunk-D6JWYJ4P.js";
66
66
  import "./chunk-RJC2MKXN.js";
67
67
  import "./chunk-H547WSSZ.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sideboard-ai/core",
3
- "version": "0.1.250",
3
+ "version": "0.1.252",
4
4
  "description": "Sideboard core — orchestration, agents, git worktrees, MCP server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",