@sideboard-ai/core 0.1.217 → 0.1.218

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 (59) hide show
  1. package/dist/{abletime-QGGYL2G4.js → abletime-BF253OZT.js} +5 -4
  2. package/dist/{abletime-GDZLZRMY.js → abletime-D6773P33.js} +5 -5
  3. package/dist/{abletime-oauth-F335TWKY.js → abletime-oauth-H4672PRH.js} +4 -3
  4. package/dist/{abletime-oauth-3X3BAPTF.js → abletime-oauth-KQPVVBKA.js} +4 -4
  5. package/dist/{abletime-rest-PLJVY3H3.js → abletime-rest-DAFPXZ7H.js} +4 -4
  6. package/dist/{abletime-rest-LAGTPAJL.js → abletime-rest-OPEVV3XC.js} +4 -3
  7. package/dist/agents/cursor-runner.js +5 -5
  8. package/dist/{agents-WBDDLRBY.js → agents-NWJ7DFJD.js} +8 -7
  9. package/dist/{agents-HETHRRZJ.js → agents-YABJUV3V.js} +9 -9
  10. package/dist/{app-settings-XCRNCEEE.js → app-settings-5RQMQKSB.js} +2 -1
  11. package/dist/{app-settings-2TN3WLZV.js → app-settings-V2BBCX2H.js} +2 -2
  12. package/dist/{chunk-MN6YUD4O.js → chunk-3NWUHXU3.js} +3 -3
  13. package/dist/{chunk-G4TANQC3.js → chunk-646I442S.js} +5 -5
  14. package/dist/{chunk-FNQNJOHY.js → chunk-ABOBTSO6.js} +4 -1
  15. package/dist/{chunk-YVE4PXCJ.js → chunk-CLI5DVU4.js} +2 -2
  16. package/dist/{chunk-7MTVRNP4.js → chunk-FSIJGLSV.js} +1173 -1186
  17. package/dist/{chunk-LS6TSOCE.js → chunk-HSYE5ID6.js} +5 -5
  18. package/dist/{chunk-UFHNSFAS.js → chunk-HVUVQXZ2.js} +5 -1
  19. package/dist/{chunk-SALM35KD.js → chunk-IILG7DPX.js} +5 -5
  20. package/dist/{chunk-D2IKXMF3.js → chunk-JWBPSD7Q.js} +453 -289
  21. package/dist/{chunk-NI243N27.js → chunk-KTZESHYH.js} +15 -7
  22. package/dist/{chunk-KFD2OXCE.js → chunk-MW57SKKR.js} +19 -6
  23. package/dist/{chunk-XYKVRRC2.js → chunk-NFWPDEN4.js} +15 -7
  24. package/dist/{chunk-FNGXKY5W.js → chunk-OPYBLX4V.js} +19 -6
  25. package/dist/{chunk-QQKDGPUI.js → chunk-PO4M4JAJ.js} +1 -1
  26. package/dist/{chunk-2M5B7YNY.js → chunk-RRW2XWAY.js} +2 -2
  27. package/dist/{chunk-REZRGCKV.js → chunk-SOGGKYFV.js} +3 -3
  28. package/dist/{chunk-C32SBNA3.js → chunk-SRFFIFW6.js} +457 -294
  29. package/dist/{chunk-3OHR73VK.js → chunk-SVXIJ2IC.js} +1 -1
  30. package/dist/{chunk-SYFVUF2C.js → chunk-SZJZEFTY.js} +1 -1
  31. package/dist/{chunk-42IULNIY.js → chunk-THLVCXLF.js} +3 -3
  32. package/dist/{chunk-JZHRZ3DR.js → chunk-TQBUXKIB.js} +5 -5
  33. package/dist/chunk-WWUABK6B.js +56 -0
  34. package/dist/{chunk-DFTVZEZY.js → chunk-XRHTRXZN.js} +1051 -1050
  35. package/dist/{chunk-BTC2D6LS.js → chunk-Y5JES2VV.js} +3 -51
  36. package/dist/{connected-teams-WK47ATT7.js → connected-teams-LX5DLL2I.js} +3 -2
  37. package/dist/{connected-teams-PU4AMFNA.js → connected-teams-PQETXUWV.js} +3 -2
  38. package/dist/{coordinator-prompt-FQX6ALAI.js → coordinator-prompt-5V7GEPBG.js} +6 -6
  39. package/dist/{coordinator-prompt-LE2GQZ2X.js → coordinator-prompt-J4QSNTKE.js} +6 -5
  40. package/dist/{global-workspace-6P236KKG.js → global-workspace-4TEMLESD.js} +6 -6
  41. package/dist/{global-workspace-KT3FRHZL.js → global-workspace-XPTFHMKL.js} +6 -5
  42. package/dist/index.cjs +1027 -821
  43. package/dist/index.d.cts +10 -1
  44. package/dist/index.d.ts +10 -1
  45. package/dist/index.js +22 -18
  46. package/dist/mcp/run-stdio.cjs +1838 -1651
  47. package/dist/mcp/run-stdio.js +16 -14
  48. package/dist/{orchestrator-WVZPTHBV.js → orchestrator-HKW3VLGX.js} +10 -10
  49. package/dist/{orchestrator-MI7A5DQZ.js → orchestrator-SWRTYFHX.js} +9 -8
  50. package/dist/{run-EBWL2Q4N.js → run-QDZCTP4Y.js} +2 -1
  51. package/dist/{run-CAGKZLHA.js → run-UEQM4JMZ.js} +2 -1
  52. package/dist/{workspaces-KM7KTLVO.js → workspaces-2HQP654Q.js} +6 -5
  53. package/dist/{workspaces-R5LJCJRB.js → workspaces-BCBBMMXB.js} +6 -6
  54. package/dist/{worktree-MDMTCAHX.js → worktree-7V67XTEO.js} +5 -5
  55. package/dist/{worktree-VXRI7LYM.js → worktree-I573UOPD.js} +5 -4
  56. package/dist/{worktree-exclude-N5X5I422.js → worktree-exclude-K7QK4RI5.js} +3 -2
  57. package/dist/{worktree-exclude-X54WSOXM.js → worktree-exclude-L32WEBX6.js} +3 -2
  58. package/package.json +1 -1
  59. package/dist/{chunk-L5CIEBLR.js → chunk-EWHJNJHV.js} +3 -3
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-6K64FJDD.js";
4
4
  import {
5
5
  ensureWorktreeSideboardIgnored
6
- } from "./chunk-QQKDGPUI.js";
6
+ } from "./chunk-PO4M4JAJ.js";
7
7
  import {
8
8
  getGithubGitAuthMode,
9
9
  getGithubPat
10
- } from "./chunk-L5CIEBLR.js";
10
+ } from "./chunk-EWHJNJHV.js";
11
11
  import {
12
12
  listThreads
13
13
  } from "./chunk-3IMSQNTS.js";
@@ -23,7 +23,7 @@ import {
23
23
  githubGhConfigEnv,
24
24
  materializeGithubAgentAuth,
25
25
  resolveGhAuthToken
26
- } from "./chunk-UFHNSFAS.js";
26
+ } from "./chunk-HVUVQXZ2.js";
27
27
 
28
28
  // src/git/worktree.ts
29
29
  import { randomBytes } from "crypto";
@@ -1902,7 +1902,14 @@ function slugify(input) {
1902
1902
  }
1903
1903
  async function resolveRepoRoot(cwd) {
1904
1904
  const { stdout } = await git(["rev-parse", "--show-toplevel"], cwd);
1905
- return canonicalizeRepoPath(stdout.trim());
1905
+ const toplevel = canonicalizeRepoPath(stdout.trim());
1906
+ try {
1907
+ const listed = await listWorktrees(cwd);
1908
+ const primary = listed[0]?.path;
1909
+ if (primary) return canonicalizeRepoPath(primary);
1910
+ } catch {
1911
+ }
1912
+ return toplevel;
1906
1913
  }
1907
1914
  function canonicalizeRepoPath(path) {
1908
1915
  try {
@@ -1922,7 +1929,8 @@ function parseGithubSlugFromRemoteUrl(url) {
1922
1929
  }
1923
1930
  async function slugFromGitRemote(repoPath, remote) {
1924
1931
  const result = await git(["remote", "get-url", remote], repoPath, {
1925
- reject: false
1932
+ reject: false,
1933
+ timeoutMs: 5e3
1926
1934
  });
1927
1935
  if (result.exitCode !== 0 || !result.stdout.trim()) return null;
1928
1936
  return parseGithubSlugFromRemoteUrl(result.stdout);
@@ -1935,7 +1943,7 @@ async function resolveGithubRepoSlug(repoPath) {
1935
1943
  const viaGh = await gh(
1936
1944
  ["repo", "view", "--json", "nameWithOwner", "--jq", ".nameWithOwner"],
1937
1945
  repoPath,
1938
- { reject: false }
1946
+ { reject: false, timeoutMs: 8e3 }
1939
1947
  );
1940
1948
  if (viaGh.exitCode === 0 && viaGh.stdout.trim()) {
1941
1949
  return viaGh.stdout.trim();
@@ -2884,7 +2892,7 @@ async function listWorktrees(repoPath) {
2884
2892
  const { stdout } = await git(
2885
2893
  ["worktree", "list", "--porcelain"],
2886
2894
  repoPath,
2887
- { reject: false }
2895
+ { reject: false, timeoutMs: 8e3 }
2888
2896
  );
2889
2897
  if (!stdout.trim()) return [];
2890
2898
  const entries = [];
@@ -7,7 +7,7 @@ import {
7
7
  resolveRepoRoot,
8
8
  takenSlugsFromThread,
9
9
  teamSlugFromName
10
- } from "./chunk-XYKVRRC2.js";
10
+ } from "./chunk-NFWPDEN4.js";
11
11
  import {
12
12
  ATTACHMENTS_DIR,
13
13
  attachmentsGitignoreBody
@@ -30,7 +30,7 @@ import {
30
30
  resolveThreadDefaults,
31
31
  resolveViewerProfile,
32
32
  resolveViewerProfileForRepo
33
- } from "./chunk-BTC2D6LS.js";
33
+ } from "./chunk-Y5JES2VV.js";
34
34
  import {
35
35
  appDataDir,
36
36
  globalAgentCwd,
@@ -38,7 +38,7 @@ import {
38
38
  } from "./chunk-EQNRWDLN.js";
39
39
 
40
40
  // src/store/workspaces.ts
41
- import { existsSync as existsSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
41
+ import { existsSync as existsSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync3, statSync as statSync2, writeFileSync as writeFileSync3 } from "fs";
42
42
  import { basename as basename2, join as join3 } from "path";
43
43
 
44
44
  // src/brightsy/cloud-connect-constants.ts
@@ -796,6 +796,18 @@ function listWorkspaces() {
796
796
  if (valid.length !== all.length) writeAll(valid);
797
797
  return valid.sort((a, b) => a.name.localeCompare(b.name));
798
798
  }
799
+ function isLinkedWorktreeOf(path, mainRepo) {
800
+ if (!path || path === mainRepo) return false;
801
+ const git = join3(path, ".git");
802
+ try {
803
+ if (!existsSync2(git) || statSync2(git).isDirectory()) return false;
804
+ const text = readFileSync3(git, "utf8");
805
+ const needle = `${mainRepo.replace(/\/+$/, "")}/.git`;
806
+ return text.includes(needle);
807
+ } catch {
808
+ return false;
809
+ }
810
+ }
799
811
  async function addWorkspace(repoPath) {
800
812
  const root = await resolveRepoRoot(repoPath);
801
813
  if (!root || root === "/") throw new Error(`Invalid repo path: ${repoPath}`);
@@ -804,13 +816,14 @@ async function addWorkspace(repoPath) {
804
816
  await ensureGhPreferOrigin(root);
805
817
  const current = readAll();
806
818
  const existing = current.find((w) => w.path === root);
807
- if (existing) return existing;
808
- const next = {
819
+ const withoutLinked = current.filter((w) => !isLinkedWorktreeOf(w.path, root));
820
+ if (existing && withoutLinked.length === current.length) return existing;
821
+ const next = existing ?? {
809
822
  path: root,
810
823
  name: basename2(root),
811
824
  addedAt: (/* @__PURE__ */ new Date()).toISOString()
812
825
  };
813
- writeAll([...current, next]);
826
+ writeAll(existing ? withoutLinked : [...withoutLinked, next]);
814
827
  return next;
815
828
  }
816
829
  function removeWorkspace(repoPath) {
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-HY2GFZ5S.js";
9
9
  import {
10
10
  ensureWorktreeSideboardIgnored
11
- } from "./chunk-SYFVUF2C.js";
11
+ } from "./chunk-SZJZEFTY.js";
12
12
  import {
13
13
  gh,
14
14
  git,
@@ -18,11 +18,11 @@ import {
18
18
  githubGhConfigEnv,
19
19
  materializeGithubAgentAuth,
20
20
  resolveGhAuthToken
21
- } from "./chunk-FNQNJOHY.js";
21
+ } from "./chunk-ABOBTSO6.js";
22
22
  import {
23
23
  getGithubGitAuthMode,
24
24
  getGithubPat
25
- } from "./chunk-BTC2D6LS.js";
25
+ } from "./chunk-Y5JES2VV.js";
26
26
  import {
27
27
  worktreesRoot
28
28
  } from "./chunk-EQNRWDLN.js";
@@ -1865,7 +1865,14 @@ function slugify(input) {
1865
1865
  }
1866
1866
  async function resolveRepoRoot(cwd) {
1867
1867
  const { stdout } = await git(["rev-parse", "--show-toplevel"], cwd);
1868
- return canonicalizeRepoPath(stdout.trim());
1868
+ const toplevel = canonicalizeRepoPath(stdout.trim());
1869
+ try {
1870
+ const listed = await listWorktrees(cwd);
1871
+ const primary = listed[0]?.path;
1872
+ if (primary) return canonicalizeRepoPath(primary);
1873
+ } catch {
1874
+ }
1875
+ return toplevel;
1869
1876
  }
1870
1877
  function canonicalizeRepoPath(path) {
1871
1878
  try {
@@ -1885,7 +1892,8 @@ function parseGithubSlugFromRemoteUrl(url) {
1885
1892
  }
1886
1893
  async function slugFromGitRemote(repoPath, remote) {
1887
1894
  const result = await git(["remote", "get-url", remote], repoPath, {
1888
- reject: false
1895
+ reject: false,
1896
+ timeoutMs: 5e3
1889
1897
  });
1890
1898
  if (result.exitCode !== 0 || !result.stdout.trim()) return null;
1891
1899
  return parseGithubSlugFromRemoteUrl(result.stdout);
@@ -1898,7 +1906,7 @@ async function resolveGithubRepoSlug(repoPath) {
1898
1906
  const viaGh = await gh(
1899
1907
  ["repo", "view", "--json", "nameWithOwner", "--jq", ".nameWithOwner"],
1900
1908
  repoPath,
1901
- { reject: false }
1909
+ { reject: false, timeoutMs: 8e3 }
1902
1910
  );
1903
1911
  if (viaGh.exitCode === 0 && viaGh.stdout.trim()) {
1904
1912
  return viaGh.stdout.trim();
@@ -2847,7 +2855,7 @@ async function listWorktrees(repoPath) {
2847
2855
  const { stdout } = await git(
2848
2856
  ["worktree", "list", "--porcelain"],
2849
2857
  repoPath,
2850
- { reject: false }
2858
+ { reject: false, timeoutMs: 8e3 }
2851
2859
  );
2852
2860
  if (!stdout.trim()) return [];
2853
2861
  const entries = [];
@@ -5,7 +5,7 @@ import {
5
5
  resolveRepoRoot,
6
6
  takenSlugsFromThread,
7
7
  teamSlugFromName
8
- } from "./chunk-NI243N27.js";
8
+ } from "./chunk-KTZESHYH.js";
9
9
  import {
10
10
  ATTACHMENTS_DIR,
11
11
  attachmentsGitignoreBody
@@ -22,7 +22,7 @@ import {
22
22
  resolveThreadDefaults,
23
23
  resolveViewerProfile,
24
24
  resolveViewerProfileForRepo
25
- } from "./chunk-L5CIEBLR.js";
25
+ } from "./chunk-EWHJNJHV.js";
26
26
  import {
27
27
  createEmptyThread,
28
28
  listThreads,
@@ -36,7 +36,7 @@ import {
36
36
  } from "./chunk-WFUDY6PC.js";
37
37
 
38
38
  // src/store/workspaces.ts
39
- import { existsSync as existsSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
39
+ import { existsSync as existsSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync3, statSync as statSync2, writeFileSync as writeFileSync3 } from "fs";
40
40
  import { basename as basename2, join as join3 } from "path";
41
41
 
42
42
  // src/brightsy/cloud-connect-constants.ts
@@ -841,6 +841,18 @@ function listWorkspaces() {
841
841
  if (valid.length !== all.length) writeAll(valid);
842
842
  return valid.sort((a, b) => a.name.localeCompare(b.name));
843
843
  }
844
+ function isLinkedWorktreeOf(path, mainRepo) {
845
+ if (!path || path === mainRepo) return false;
846
+ const git = join3(path, ".git");
847
+ try {
848
+ if (!existsSync2(git) || statSync2(git).isDirectory()) return false;
849
+ const text = readFileSync3(git, "utf8");
850
+ const needle = `${mainRepo.replace(/\/+$/, "")}/.git`;
851
+ return text.includes(needle);
852
+ } catch {
853
+ return false;
854
+ }
855
+ }
844
856
  async function addWorkspace(repoPath) {
845
857
  const root = await resolveRepoRoot(repoPath);
846
858
  if (!root || root === "/") throw new Error(`Invalid repo path: ${repoPath}`);
@@ -849,13 +861,14 @@ async function addWorkspace(repoPath) {
849
861
  await ensureGhPreferOrigin(root);
850
862
  const current = readAll();
851
863
  const existing = current.find((w) => w.path === root);
852
- if (existing) return existing;
853
- const next = {
864
+ const withoutLinked = current.filter((w) => !isLinkedWorktreeOf(w.path, root));
865
+ if (existing && withoutLinked.length === current.length) return existing;
866
+ const next = existing ?? {
854
867
  path: root,
855
868
  name: basename2(root),
856
869
  addedAt: (/* @__PURE__ */ new Date()).toISOString()
857
870
  };
858
- writeAll([...current, next]);
871
+ writeAll(existing ? withoutLinked : [...withoutLinked, next]);
859
872
  return next;
860
873
  }
861
874
  function removeWorkspace(repoPath) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  git
3
- } from "./chunk-UFHNSFAS.js";
3
+ } from "./chunk-HVUVQXZ2.js";
4
4
 
5
5
  // src/git/worktree-exclude.ts
6
6
  import { mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -4,14 +4,14 @@ import {
4
4
  normalizeAbleTimeCredential,
5
5
  normalizeAbleTimeHost,
6
6
  rewriteAbleTimeError
7
- } from "./chunk-G4TANQC3.js";
7
+ } from "./chunk-646I442S.js";
8
8
  import {
9
9
  httpFetch
10
10
  } from "./chunk-N7WZ6NIN.js";
11
11
  import {
12
12
  getAbleTimeAccessToken,
13
13
  getAbleTimeHost
14
- } from "./chunk-L5CIEBLR.js";
14
+ } from "./chunk-EWHJNJHV.js";
15
15
 
16
16
  // src/integrations/abletime-rest.ts
17
17
  var ABLETIME_REST_PREFIX = "/api/public/v2";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  textFromAbleTimeDoc
3
- } from "./chunk-2M5B7YNY.js";
3
+ } from "./chunk-RRW2XWAY.js";
4
4
  import {
5
5
  assertAbleTimeCredential,
6
6
  callAbleTimeTool,
7
7
  normalizeAbleTimeHost,
8
8
  rewriteAbleTimeError
9
- } from "./chunk-G4TANQC3.js";
9
+ } from "./chunk-646I442S.js";
10
10
  import {
11
11
  isAbleTimeConnected,
12
12
  saveAbleTimeConnection
13
- } from "./chunk-L5CIEBLR.js";
13
+ } from "./chunk-EWHJNJHV.js";
14
14
 
15
15
  // src/integrations/abletime.ts
16
16
  var CLOSED_STATES = /* @__PURE__ */ new Set([