@sideboard-ai/core 0.1.279 → 0.1.281

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 (52) hide show
  1. package/dist/{abletime-VCVPSLSU.js → abletime-WLDBJJUI.js} +3 -3
  2. package/dist/{abletime-VRATUMDO.js → abletime-X64E3GUJ.js} +3 -3
  3. package/dist/{abletime-oauth-4K7MICAD.js → abletime-oauth-AXR676W5.js} +2 -2
  4. package/dist/{abletime-oauth-4C4G2J3R.js → abletime-oauth-UWOCEICP.js} +2 -2
  5. package/dist/{abletime-rest-PIBCNHF3.js → abletime-rest-LPUDJUEP.js} +2 -2
  6. package/dist/{abletime-rest-6N63ZVQ3.js → abletime-rest-S4XWEXV2.js} +2 -2
  7. package/dist/{agents-DYCFLDNL.js → agents-2IE4HKHA.js} +5 -5
  8. package/dist/{agents-RXP5NZBC.js → agents-XA2E64AW.js} +5 -5
  9. package/dist/{chunk-V5DMHB6Y.js → chunk-2KNO2GJQ.js} +781 -159
  10. package/dist/{chunk-TZ5JHIYK.js → chunk-2SJXQ4UX.js} +68 -21
  11. package/dist/{chunk-K7MWJLR7.js → chunk-5MGLNVNK.js} +6 -906
  12. package/dist/{chunk-RK5PIWCW.js → chunk-ADXVTKLC.js} +12 -4
  13. package/dist/{chunk-Y7JPL4WA.js → chunk-BDAUPNHL.js} +3 -4
  14. package/dist/{chunk-R7HLXD4I.js → chunk-BS3QLVPL.js} +93 -57
  15. package/dist/{chunk-CPGJ5ICZ.js → chunk-BYZ7F2BQ.js} +766 -148
  16. package/dist/{chunk-2J34G3WJ.js → chunk-DGPROCE5.js} +93 -57
  17. package/dist/{chunk-HQXBBUQX.js → chunk-DQZPF6WL.js} +12 -11
  18. package/dist/{chunk-YDXNCBA2.js → chunk-EIEAR62M.js} +12 -11
  19. package/dist/{chunk-XKZAVGTT.js → chunk-I6HSGKMZ.js} +1 -1
  20. package/dist/chunk-JPH7PYSK.js +1241 -0
  21. package/dist/{chunk-IPPY3FG5.js → chunk-K5XSTHHP.js} +6 -906
  22. package/dist/chunk-N5UGX3JL.js +1239 -0
  23. package/dist/{chunk-HNNS25SG.js → chunk-OCUIZD4Y.js} +14 -4
  24. package/dist/{chunk-IJDQKC5A.js → chunk-PY4UCMRI.js} +4 -4
  25. package/dist/{chunk-NQ7JMVSU.js → chunk-U7HAVAGJ.js} +1 -1
  26. package/dist/{chunk-PZURG3XN.js → chunk-VA55JG2I.js} +4 -4
  27. package/dist/{chunk-CPA43FBK.js → chunk-W7HIK2A6.js} +3 -4
  28. package/dist/{chunk-SKSOCIJT.js → chunk-WY2IAB7J.js} +68 -21
  29. package/dist/{chunk-QINJKNLR.js → chunk-XTPQEZZA.js} +2 -2
  30. package/dist/{conductor-J6WDOXWM.js → conductor-CNSCOC54.js} +5 -5
  31. package/dist/{conductor-OW6NAK3N.js → conductor-U776JSXQ.js} +5 -5
  32. package/dist/{coordinator-prompt-Z2D32HWK.js → coordinator-prompt-4DJIHSE6.js} +3 -3
  33. package/dist/{coordinator-prompt-ERTHREGJ.js → coordinator-prompt-SVVGU6AZ.js} +3 -3
  34. package/dist/{global-workspace-5PJXO45Z.js → global-workspace-UPUDWIS6.js} +3 -3
  35. package/dist/{global-workspace-AK5PSPQ2.js → global-workspace-XON4YZXE.js} +3 -3
  36. package/dist/index.cjs +3819 -2995
  37. package/dist/index.d.cts +103 -30
  38. package/dist/index.d.ts +103 -30
  39. package/dist/index.js +1013 -1001
  40. package/dist/mcp/run-stdio.cjs +2075 -1313
  41. package/dist/mcp/run-stdio.js +743 -785
  42. package/dist/{orchestrator-KY2KBBE2.js → orchestrator-FPGVKEID.js} +7 -7
  43. package/dist/{orchestrator-E5WK57DA.js → orchestrator-HWJHK5NL.js} +7 -7
  44. package/dist/{thread-store-B3ZM4QEZ.js → thread-store-7XBOUQ5K.js} +1 -1
  45. package/dist/{thread-store-SHCUBWB3.js → thread-store-ZQZDREVH.js} +1 -1
  46. package/dist/{workspaces-UP6DQ3WL.js → workspaces-7AJ5RZ3P.js} +7 -3
  47. package/dist/{workspaces-WU2RNLDV.js → workspaces-F76BWCSI.js} +7 -3
  48. package/dist/{worktree-L57T3KH7.js → worktree-NKLNVNXX.js} +20 -15
  49. package/dist/{worktree-Q6UJHG25.js → worktree-YTZC3UQN.js} +14 -9
  50. package/package.json +1 -1
  51. package/dist/chunk-FWNL62VA.js +0 -308
  52. package/dist/chunk-JANCPF7Z.js +0 -310
@@ -1,14 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import {
4
- allocateTeamName,
5
4
  canonicalizeRepoPath,
6
5
  ensureGhPreferOrigin,
7
6
  resolveGithubRepoSlug,
8
- resolveRepoRoot,
9
- takenSlugsFromThread,
10
- teamSlugFromName
11
- } from "./chunk-K7MWJLR7.js";
7
+ resolveRepoRoot
8
+ } from "./chunk-5MGLNVNK.js";
12
9
  import {
13
10
  ATTACHMENTS_DIR,
14
11
  attachmentsGitignoreBody
@@ -27,11 +24,14 @@ import {
27
24
  resolveViewerProfileForRepo
28
25
  } from "./chunk-WRIMAEF2.js";
29
26
  import {
27
+ allocateTeamName,
30
28
  createEmptyThread,
31
29
  listThreads,
30
+ takenSlugsFromThread,
31
+ teamSlugFromName,
32
32
  updateThread,
33
33
  writeThread
34
- } from "./chunk-JANCPF7Z.js";
34
+ } from "./chunk-JPH7PYSK.js";
35
35
  import {
36
36
  appDataDir,
37
37
  globalAgentCwd,
@@ -341,21 +341,23 @@ var COORDINATOR_TOOL_PLAYBOOK = [
341
341
  `- list_branches / list_prs / list_issues \u2014 pass repoPath from list_projects. Review is PRs (the surface for assigned ticket work), not the tickets: "Get me N tickets to review" \u2192 list_prs(queue=review, limit=N) then create_workspace sourceType=pr. That is open non-draft PRs labeled with this project's ready-for-review GitHub label (Settings \u2192 Projects; default eng-review) with no individual user reviewer yet. A team request (engineering-team) is not a claim \u2014 the viewer is on that team and can pick it up; claimed means an individual account is the reviewer. Bots ignored. Use Settings \u2192 Agents / Projects context (roles, teams, labels \u2014 freeform text; project adds to account) to prefer the right queues. queue=mine is review-requested:@me; queue=approved|changes uses those labels. Also: state, label, reviewer=me|unassigned|login, query, limit default 40 max 250; raise limit or tighten when truncated. list_issues (query, assignee=me|unassigned|all|user, limit default 40 max 250) lists Linear, AbleTime, or GitHub tickets \u2014 do not use it for that review-inbox ask. When they ask for tickets to work on, follow their context (assignee=me or unassigned as it says).`,
342
342
  "- Find work: when they ask to find work, pick up tickets, or list reviews, use Settings \u2192 Agents (account) plus Settings \u2192 Projects (per-repo) context. Tickets \u2192 Sideboard list_issues / linear_* (Account Linear). Reviews \u2192 list_prs(queue=review). Do not call Claude Linear MCP or any other vendor Linear MCP \u2014 those HTTP connectors hang or flap on the first turn. If a vendor MCP is down or reconnecting, ignore it and keep going with Sideboard tools. Show the options \u2014 do not create_workspace or start unless they also asked to start (e.g. \u201Cfind me work and start it\u201D). Do not start this unprompted. To change that context, show the proposed text, ask_user (Save this context / Do not save), wait, then update_viewer_context with confirmed=true. Never write it without confirmation.",
343
343
  "- Ticket updates: list_issues / linear_search_issues / github_search_issues with updatedSince (yesterday, 2d, or ISO). One call returns new assignments, ticket edits, and new comments \u2014 do not get_issue every ticket just to check for comments. kind=created vs updated distinguishes new tickets from existing ones.",
344
- "- linear_* (when Linear is connected) \u2014 list_teams for team key/states; get/create/update/comment with ENG-123. Worktree agents have the same Account tools \u2014 prefer they comment, update status, and create spin-offs (parent=) on their own ticket when they were asked to do the work. When reviewing a PR or ticket, do not comment or update until the user types a next step \u2014 they should work through the feedback in chat first. Do not tell the child to ask_user after the review. Scope errors: reconnect Linear in Account settings. Prefer these over any Linear MCP the CLI may still list.",
345
- "- github_* \u2014 get/comment/update/create GitHub issues via Account `gh` (#123). Worktree agents have these too. Prefer over any vendor GitHub MCP. Pass parent= for spin-offs. When reviewing a PR or ticket, do not comment, submit `gh pr review`, or update the PR/ticket until the user types a next step.",
346
- "- abletime_* (when AbleTime is connected) \u2014 orientation first; get/comment/update/create (parent= for spin-offs); ensure_task when work has no ticket (or create_workspace from the default branch auto-creates one). Worktree agents have the same Account tools. Same review-write gate as Linear/GitHub.",
347
- "- Optional connectors (Vercel, Supabase, PostHog, Sentry) in Settings \u2192 Connectors inject tokens into worktree agent env when connected. Prefer official CLIs (`vercel`, `supabase`, `sentry-cli`) with those env vars. PostHog has no first-class CLI \u2014 use the HTTP API (`POSTHOG_PERSONAL_API_KEY`). Tell any worktree agent (Claude / Cursor / Codex / OpenCode) to write CLI output to `.context/cli/` (not `.context/attachments/`) and read a slice \u2014 never stream raw `--json` / `--expand` into a tool result (that crashes the turn). They can `stop_job` if a detached fetch hangs. If a CLI is missing, the user can Install CLI on that row (not auto-installed on Connect). Do not add vendor MCPs or ask the user to paste tokens again. Git (`gh`) stays Settings \u2192 Git; issue tracking stays Settings \u2192 Issues. The phone remote is Settings \u2192 Remote \u2014 do not look up Slack users.",
344
+ "- linear_* (when Linear is connected) \u2014 list_teams for team key/states; linear_list_projects for project names; get/search include the project a ticket is on; get/create/update/comment with ENG-123. Worktree agents have the same Account tools \u2014 prefer they comment, update status, and create spin-offs (parent=) on their own ticket when they were asked to do the work. When reviewing a PR or ticket, do not comment or update until the user types a next step \u2014 they should work through the feedback in chat first. Do not tell the child to ask_user after the review. Scope errors: reconnect Linear in Account settings. Prefer these over any Linear MCP the CLI may still list.",
345
+ "- github_* \u2014 get/comment/update/create GitHub issues via Account `gh` (#123). github_list_projects and get/search include GitHub Projects. projectsError or a missing read:project scope \u2192 `gh auth refresh -s read:project`. Worktree agents have these too. Prefer over any vendor GitHub MCP. Pass parent= for spin-offs. When reviewing a PR or ticket, do not comment, submit `gh pr review`, or update the PR/ticket until the user types a next step.",
346
+ "- abletime_* (when AbleTime is connected) \u2014 orientation first; abletime_list_projects lists projects; get/list include the project a task is on; get/comment/update/create (parent= for spin-offs); ensure_task when work has no ticket (or create_workspace from the default branch auto-creates one). Worktree agents have the same Account tools. Same review-write gate as Linear/GitHub.",
347
+ "- Optional connectors (Vercel, Supabase, PostHog, Sentry) in Settings \u2192 Connectors inject tokens into worktree agent env when connected. Prefer official CLIs (`vercel`, `supabase`, `sentry-cli`) with those env vars. PostHog has no first-class CLI \u2014 use the HTTP API (`POSTHOG_PERSONAL_API_KEY`). If a connector MCP is listed but needsAuth or unauthorized, do not sign in \u2014 check that native CLI or HTTP API. Tell any worktree agent (Claude / Cursor / Codex / OpenCode) to write CLI output to `.context/cli/` (not `.context/attachments/`) and read a slice \u2014 never stream raw `--json` / `--expand` into a tool result (that crashes the turn). They can `stop_job` if a detached fetch hangs. If a CLI is missing, the user can Install CLI on that row (not auto-installed on Connect). Do not add vendor MCPs or ask the user to paste tokens again. Git (`gh`) stays Settings \u2192 Git; issue tracking stays Settings \u2192 Issues. The phone remote is Settings \u2192 Remote \u2014 do not look up Slack users.",
348
348
  "- get_pr_stack / open_pr_stack_layers / add_stack_layer / create_pr_stack \u2014 GitHub stacked PRs (`gh stack`); one worktree per layer",
349
349
  "- list_models \u2014 only when you need a specific model (rare); otherwise omit model so Account defaults apply",
350
350
  "- list_chats / get_chat \u2014 live thread list (parent id + last message preview). get_chat on this orchestration chat lists child worktree agents (status + lastText). blockedReason is why that agent is waiting on a person. Also includes usage / lastTurnUsage.",
351
351
  "- ask_user \u2014 composer multiple-choice only when blocked on a concrete choice (approach fork, which API, Save this context / Do not save). Never for hellos, check-ins, invented \u201Cwhat should we do?\u201D menus, or after a review \u2014 reply in chat. Explain options first, description on every option, then wait.",
352
352
  "- get_viewer_context / update_viewer_context \u2014 read or replace Settings \u2192 Agents (account) and Settings \u2192 Projects (per-repo) context. You can update a project: pass scope=project and repoPath from list_projects (this cwd is not a project). update_viewer_context requires confirmed=true after ask_user. Never write context unprompted.",
353
+ "- list_env / set_env / delete_env \u2014 Settings \u2192 Environment. scope=project requires repoPath from list_projects and stores the key under that project prefix (the project name, uppercased, plus _). APPLE_ID for sideboard is SIDEBOARD_APPLE_ID. scope=account is shared by every project and is not prefixed. list_env returns names only.",
353
354
  "- set_caffeinate \u2014 keep this Mac awake across turns (macOS caffeinate). Turn on for phone remote / away-from-keyboard work, overnight schedules, or when the user will be away. Turn OFF when they say they are done, wrapping up, going to sleep, or no longer need the machine awake. Closing this chat also releases it.",
354
355
  "- list_schedules / create_schedule / update_schedule / delete_schedule / run_schedule \u2014 local jobs that send a prompt to a chat (chatId or self) or start a new Global chat (omit chatId). One-shot `at`, interval `every` (15m/1h/6h/1d), or 5-field `cron`. Recurring jobs without chatId open a new chat each run. Worktree agents have the same tools (`chatId=self` continues that coding chat). Jobs fire only while Sideboard.app is running; sleep skips until wake. Creating or enabling a future job turns on Settings \u2192 Advanced \u2192 Caffeinate while schedules are enabled (or call set_caffeinate).",
355
356
  "Projects:",
356
357
  "- add_project / remove_project \u2014 register or unregister a git repo",
357
358
  "Workspaces and chats:",
358
- "- create_workspace \u2014 create a workspace (isolated checkout + first chat) from branch | pr | ticket (appears on Home). A ticket, PR, or named branch has one checkout: a second call returns that workspace (alreadyStarted=true) and chats for every agent already on it. That is not one agent. To put another agent on that checkout, fork_chat. send_to_chat only the chat that should do this job. Creating from the default branch still opens a new isolated workspace. Pass repoPath + parentChatId; omit agent and model so Sideboard applies Settings \u2192 Default agent, model & effort (never pass your own agent or agent=cursor). If the repo has a setup script, Sideboard runs it in the background (does not block send_to_chat). Nested Codex (you are Codex and the child would be Codex) can deadlock on ~/.codex locks \u2014 omit agent; Sideboard switches the child to Cursor when a CURSOR_API_KEY is set, otherwise keeps the Account default",
359
+ '- create_workspace \u2014 create a workspace (isolated checkout + first chat) from branch | pr | ticket (appears on Home). A ticket, PR, or named branch has one checkout: a second call returns that workspace (alreadyStarted=true) and chats for every agent already on it. That is not one agent. To put another agent on that checkout, fork_chat. send_to_chat only the chat that should do this job. Creating from the default branch still opens a new isolated workspace. Pass repoPath + parentChatId; omit agent and model so Sideboard applies Settings \u2192 Default agent, model & effort (never pass your own agent or agent=cursor). Pass the same tags (short labels, e.g. "phone-sync") on every workspace you open for one task so they group in the sidebar; reusing a checkout adds those tags. If the repo has a setup script, Sideboard runs it in the background (does not block send_to_chat). Nested Codex (you are Codex and the child would be Codex) can deadlock on ~/.codex locks \u2014 omit agent; Sideboard switches the child to Cursor when a CURSOR_API_KEY is set, otherwise keeps the Account default',
360
+ "- set_workspace_tags \u2014 set, add, or remove labels on a workspace after create. Pass any chat id on that checkout. Same tags on every workspace from one task. Worktree agents can update tags on their own checkout (they omit ref).",
359
361
  "- start_board_card \u2014 same as create_workspace for a ticket/PR/named branch (attaches issue text when resolvable). Then send_to_chat.",
360
362
  "- fork_workspace \u2014 fork a worktree chat into a NEW git worktree + chat (transcript attached); optional agent; leave model unset (Auto) unless you have a reason. Not for orchestration chats.",
361
363
  "- fork_chat \u2014 add another agent on the SAME workspace (same files, Run, and git), or fork a Global orchestration chat into a new tab. Pass agent when it should be a different harness. Leave model unset (Auto) unless you have a reason. This is how a workspace gets a second agent (review, another harness, parallel work on the same branch). Do not create_workspace again for that. Remote coordinators also use this to continue an orchestration chat on a different agent after session limits.",
@@ -813,20 +815,55 @@ function writeRemoved(paths) {
813
815
  mkdirSync3(appDataDir(), { recursive: true });
814
816
  writeFileSync3(removedWorkspacesFile(), JSON.stringify([...paths].sort(), null, 2), "utf8");
815
817
  }
818
+ function canonicalWorkspacePath(repoPath) {
819
+ return canonicalizeRepoPath(repoPath);
820
+ }
821
+ function sameWorkspacePath(a, b) {
822
+ if (!a || !b) return false;
823
+ const left = canonicalWorkspacePath(a);
824
+ const right = canonicalWorkspacePath(b);
825
+ if (left === right) return true;
826
+ const primaryA = primaryCheckoutFromLinkedWorktree(a);
827
+ const primaryB = primaryCheckoutFromLinkedWorktree(b);
828
+ if (primaryA && (primaryA === right || primaryA === primaryB)) return true;
829
+ if (primaryB && primaryB === left) return true;
830
+ return false;
831
+ }
832
+ function removedMatches(saved, repoPath) {
833
+ if (saved === repoPath || sameWorkspacePath(saved, repoPath)) return true;
834
+ const primary = primaryCheckoutFromLinkedWorktree(repoPath);
835
+ return Boolean(primary && sameWorkspacePath(saved, primary));
836
+ }
837
+ function isRemovedWorkspace(repoPath) {
838
+ if (!repoPath) return false;
839
+ for (const saved of readRemoved()) {
840
+ if (removedMatches(saved, repoPath)) return true;
841
+ }
842
+ return false;
843
+ }
816
844
  function rememberRemoved(repoPath) {
817
845
  const next = readRemoved();
818
- next.add(repoPath);
819
- writeRemoved(next);
846
+ const before = next.size;
847
+ const canon = canonicalWorkspacePath(repoPath);
848
+ next.add(canon);
849
+ const raw = repoPath.replace(/\/+$/, "");
850
+ if (raw && raw !== canon) next.add(raw);
851
+ if (next.size !== before) writeRemoved(next);
820
852
  }
821
853
  function forgetRemoved(repoPath) {
822
854
  const next = readRemoved();
823
- if (!next.delete(repoPath)) return;
824
- writeRemoved(next);
855
+ let changed = false;
856
+ for (const saved of [...next]) {
857
+ if (!removedMatches(saved, repoPath)) continue;
858
+ next.delete(saved);
859
+ changed = true;
860
+ }
861
+ if (changed) writeRemoved(next);
825
862
  }
826
863
  function listWorkspaces() {
827
864
  const all = readAll();
828
865
  const valid = all.filter(
829
- (w) => Boolean(w.path) && w.path !== "/" && w.path !== "." && !isGlobalRepoPath(w.path)
866
+ (w) => Boolean(w.path) && w.path !== "/" && w.path !== "." && !isGlobalRepoPath(w.path) && !isRemovedWorkspace(w.path)
830
867
  );
831
868
  if (valid.length !== all.length) writeAll(valid);
832
869
  return valid.sort((a, b) => a.name.localeCompare(b.name));
@@ -871,6 +908,9 @@ async function addWorkspace(repoPath) {
871
908
  if (!root || root === "/") throw new Error(`Invalid repo path: ${repoPath}`);
872
909
  if (!existsSync2(root)) throw new Error(`Repo not found: ${root}`);
873
910
  forgetRemoved(root);
911
+ return registerWorkspace(root);
912
+ }
913
+ async function registerWorkspace(root) {
874
914
  await ensureGhPreferOrigin(root);
875
915
  const current = readAll();
876
916
  const existing = current.find((w) => w.path === root);
@@ -885,21 +925,26 @@ async function addWorkspace(repoPath) {
885
925
  return next;
886
926
  }
887
927
  function removeWorkspace(repoPath) {
888
- writeAll(readAll().filter((w) => w.path !== repoPath));
889
928
  rememberRemoved(repoPath);
929
+ const canon = canonicalWorkspacePath(repoPath);
930
+ writeAll(readAll().filter((w) => !sameWorkspacePath(w.path, canon)));
890
931
  }
891
932
  async function ensureWorkspace(repoPath) {
892
- return addWorkspace(repoPath);
933
+ const root = await resolveRepoRoot(repoPath);
934
+ if (!root || root === "/" || !existsSync2(root)) {
935
+ throw new Error(`Invalid repo path: ${repoPath}`);
936
+ }
937
+ if (isRemovedWorkspace(root)) throw new Error(`Project was removed: ${root}`);
938
+ return registerWorkspace(root);
893
939
  }
894
940
  function syncWorkspacesFromThreads(repoPaths) {
895
941
  const current = readAll();
896
- const removed = readRemoved();
897
942
  const byPath = /* @__PURE__ */ new Map();
898
943
  let dirty = false;
899
944
  for (const w of current) {
900
945
  const resolved = resolveSyncWorkspacePath(w.path) ?? w.path;
901
946
  if (resolved !== w.path) dirty = true;
902
- if (!resolved || resolved === "/" || isGlobalRepoPath(resolved) || removed.has(resolved)) {
947
+ if (!resolved || resolved === "/" || isGlobalRepoPath(resolved) || isRemovedWorkspace(resolved)) {
903
948
  dirty = true;
904
949
  continue;
905
950
  }
@@ -912,7 +957,7 @@ function syncWorkspacesFromThreads(repoPaths) {
912
957
  }
913
958
  for (const raw of repoPaths) {
914
959
  const path = resolveSyncWorkspacePath(raw);
915
- if (!path || path === "/" || isGlobalRepoPath(path) || byPath.has(path) || removed.has(path)) {
960
+ if (!path || path === "/" || isGlobalRepoPath(path) || byPath.has(path) || isRemovedWorkspace(path)) {
916
961
  continue;
917
962
  }
918
963
  if (!existsSync2(path)) continue;
@@ -941,6 +986,8 @@ export {
941
986
  stageBuffersAsAttachments,
942
987
  persistPendingFileAttachments,
943
988
  attachmentsFromWorktreePaths,
989
+ sameWorkspacePath,
990
+ isRemovedWorkspace,
944
991
  listWorkspaces,
945
992
  primaryCheckoutFromLinkedWorktree,
946
993
  addWorkspace,