@sideboard-ai/core 0.1.173 → 0.1.175

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 (44) hide show
  1. package/dist/{abletime-PCLL36HW.js → abletime-BFIDZR3O.js} +2 -2
  2. package/dist/{abletime-7VW4EGPT.js → abletime-INEHQH6K.js} +2 -2
  3. package/dist/agents/cursor-runner.cjs +91 -62
  4. package/dist/agents/cursor-runner.js +1 -1
  5. package/dist/{agents-CTWLBPCV.js → agents-2W7LP7JR.js} +6 -6
  6. package/dist/{agents-7UTRNLXQ.js → agents-AWSFDB47.js} +7 -7
  7. package/dist/{chunk-QYZYDO3F.js → chunk-7JIYKYLL.js} +26 -5
  8. package/dist/{chunk-PXNOT6NV.js → chunk-7O53GXTA.js} +26 -5
  9. package/dist/{chunk-M267JPEA.js → chunk-AN3THU7F.js} +1 -1
  10. package/dist/{chunk-AQPVBVJE.js → chunk-BBNUL4IE.js} +1 -1
  11. package/dist/{chunk-LZ6QMEQC.js → chunk-HVIEYTUK.js} +1 -1
  12. package/dist/{chunk-XD2BAANL.js → chunk-IEEAVWAP.js} +6 -6
  13. package/dist/{chunk-WE34LOLO.js → chunk-JIWRBNSO.js} +22 -21
  14. package/dist/{chunk-ELBYOGVA.js → chunk-N7WZ6NIN.js} +10 -1
  15. package/dist/{chunk-2RM6BZQ2.js → chunk-NA7P3SZL.js} +4 -4
  16. package/dist/{chunk-XXIH6XYR.js → chunk-NQTKRAUF.js} +167 -35
  17. package/dist/{chunk-3F7AXVIL.js → chunk-QTJ2ERA6.js} +6 -6
  18. package/dist/{chunk-SKKEJZEX.js → chunk-RCICB4OM.js} +19 -18
  19. package/dist/{chunk-CMJ2FBBV.js → chunk-RE2YWFUQ.js} +1 -1
  20. package/dist/{chunk-234EKD2F.js → chunk-TNOLCU5B.js} +4 -4
  21. package/dist/{chunk-6GN5WPYZ.js → chunk-VKQGAWHY.js} +10 -1
  22. package/dist/{chunk-S42XV45P.js → chunk-Y4MIXGPA.js} +1 -1
  23. package/dist/{chunk-6X6KMUI2.js → chunk-ZXHV3NHY.js} +225 -96
  24. package/dist/{connected-teams-DBWAMP7G.js → connected-teams-ON2KIKQX.js} +3 -3
  25. package/dist/{connected-teams-WGONUQOF.js → connected-teams-WOYCH7FR.js} +3 -3
  26. package/dist/{coordinator-prompt-7CTI6HRH.js → coordinator-prompt-7OHKB5WV.js} +2 -2
  27. package/dist/{coordinator-prompt-PM6MPYYB.js → coordinator-prompt-XCQCGUED.js} +2 -2
  28. package/dist/{global-workspace-CMYSFRCM.js → global-workspace-KPROJ54C.js} +2 -2
  29. package/dist/{global-workspace-CRJ6ZVIY.js → global-workspace-WSQNEALF.js} +2 -2
  30. package/dist/index.cjs +600 -386
  31. package/dist/index.d.cts +49 -8
  32. package/dist/index.d.ts +49 -8
  33. package/dist/index.js +74 -28
  34. package/dist/mcp/run-stdio.cjs +795 -581
  35. package/dist/mcp/run-stdio.js +75 -26
  36. package/dist/{oauth-A7XXI2TM.js → oauth-6ZQ4Q4XN.js} +2 -2
  37. package/dist/{oauth-YJBAURIJ.js → oauth-O7UGLZOY.js} +2 -2
  38. package/dist/{orchestrator-PEOUSLAY.js → orchestrator-PDEU75EE.js} +8 -8
  39. package/dist/{orchestrator-QBB2RELD.js → orchestrator-QSNGJ2ER.js} +7 -7
  40. package/dist/{workspaces-L73MCDFA.js → workspaces-P66DGCZE.js} +2 -2
  41. package/dist/{workspaces-UYSD2STS.js → workspaces-TEBTNS2M.js} +2 -2
  42. package/dist/{worktree-SQD3DBYC.js → worktree-LC4VRWDM.js} +1 -1
  43. package/dist/{worktree-WVEDT3FM.js → worktree-UTDBQXSS.js} +1 -1
  44. package/package.json +1 -1
@@ -16,8 +16,8 @@ import {
16
16
  toAbleTimeIssueInfo,
17
17
  updateAbleTimeTask,
18
18
  verifyAbleTimeConnection
19
- } from "./chunk-AQPVBVJE.js";
20
- import "./chunk-6GN5WPYZ.js";
19
+ } from "./chunk-BBNUL4IE.js";
20
+ import "./chunk-VKQGAWHY.js";
21
21
  import "./chunk-OKZFTOM2.js";
22
22
  import "./chunk-NSTQ6QKD.js";
23
23
  import "./chunk-KGZBYWZ3.js";
@@ -14,8 +14,8 @@ import {
14
14
  toAbleTimeIssueInfo,
15
15
  updateAbleTimeTask,
16
16
  verifyAbleTimeConnection
17
- } from "./chunk-CMJ2FBBV.js";
18
- import "./chunk-ELBYOGVA.js";
17
+ } from "./chunk-RE2YWFUQ.js";
18
+ import "./chunk-N7WZ6NIN.js";
19
19
  import "./chunk-J7LQVLFQ.js";
20
20
  import "./chunk-4TR3HZFT.js";
21
21
  import "./chunk-JT7R45JB.js";
@@ -1,9 +1,31 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
+ // If the importer is in node compatibility mode or this is not an ESM
19
+ // file that has been converted to a CommonJS file using a Babel-
20
+ // compatible transform (i.e. "__esModule" has not been set), then set
21
+ // "default" to the CommonJS "module.exports" for node compatibility.
22
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
23
+ mod
24
+ ));
3
25
 
4
26
  // src/agents/cursor-runner.ts
5
27
  var import_sdk = require("@cursor/sdk");
6
- var import_node_fs11 = require("fs");
28
+ var import_node_fs12 = require("fs");
7
29
  var import_node_readline2 = require("readline");
8
30
 
9
31
  // src/hook/nested-electron-env.ts
@@ -24,36 +46,75 @@ var STRIP_NESTED_ELECTRON_THEN_EXEC = [
24
46
  ].join("; ");
25
47
 
26
48
  // src/agents/cursor-ripgrep.ts
27
- var import_node_fs6 = require("fs");
49
+ var import_node_fs11 = require("fs");
28
50
  var import_node_module = require("module");
29
- var import_node_path6 = require("path");
51
+ var import_node_path12 = require("path");
30
52
 
31
53
  // src/agents/node-launch.ts
54
+ var import_node_fs10 = require("fs");
55
+ var import_node_os5 = require("os");
56
+ var import_node_path11 = require("path");
57
+
58
+ // src/http/system-ca.ts
59
+ var import_node_child_process = require("child_process");
32
60
  var import_node_fs5 = require("fs");
33
- var import_node_os3 = require("os");
61
+ var import_node_path6 = require("path");
62
+ var import_node_tls = __toESM(require("tls"), 1);
63
+
64
+ // src/store/paths.ts
65
+ var import_node_path4 = require("path");
66
+ var import_node_os2 = require("os");
34
67
  var import_node_path5 = require("path");
68
+ var import_node_fs4 = require("fs");
35
69
 
36
- // src/git/run.ts
37
- var import_execa = require("execa");
70
+ // src/hook/settings.ts
71
+ var import_node_fs3 = require("fs");
72
+ var import_node_os = require("os");
73
+ var import_node_path3 = require("path");
74
+ var import_smol_toml = require("smol-toml");
38
75
 
39
- // src/agents/path.ts
76
+ // src/hook/convention-setup.ts
40
77
  var import_node_fs = require("fs");
41
- var import_node_child_process = require("child_process");
42
- var import_node_os = require("os");
43
78
  var import_node_path = require("path");
44
79
 
45
- // src/git/github-agent-auth.ts
80
+ // src/hook/cursor-worktrees.ts
46
81
  var import_node_fs2 = require("fs");
47
- var import_node_os2 = require("os");
48
82
  var import_node_path2 = require("path");
83
+ var import_execa = require("execa");
84
+ var import_node_readline = require("readline");
85
+
86
+ // src/store/paths.ts
87
+ function appDataDir() {
88
+ const override = process.env.SIDEBOARD_APP_DATA?.trim();
89
+ const base = override ? override : process.platform === "darwin" ? (0, import_node_path5.join)((0, import_node_os2.homedir)(), "Library", "Application Support", "sideboard") : process.platform === "win32" ? (0, import_node_path5.join)(process.env.APPDATA ?? (0, import_node_path5.join)((0, import_node_os2.homedir)(), "AppData", "Roaming"), "sideboard") : (0, import_node_path5.join)((0, import_node_os2.homedir)(), ".local", "share", "sideboard");
90
+ (0, import_node_fs4.mkdirSync)(base, { recursive: true });
91
+ return base;
92
+ }
93
+
94
+ // src/http/system-ca.ts
95
+ var BUNDLE_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
96
+
97
+ // src/git/run.ts
98
+ var import_execa2 = require("execa");
99
+
100
+ // src/agents/path.ts
101
+ var import_node_fs6 = require("fs");
102
+ var import_node_child_process2 = require("child_process");
103
+ var import_node_os3 = require("os");
104
+ var import_node_path7 = require("path");
105
+
106
+ // src/git/github-agent-auth.ts
107
+ var import_node_fs7 = require("fs");
108
+ var import_node_os4 = require("os");
109
+ var import_node_path8 = require("path");
49
110
 
50
111
  // src/git/stale-lock.ts
51
- var import_node_fs3 = require("fs");
52
- var import_node_path3 = require("path");
112
+ var import_node_fs8 = require("fs");
113
+ var import_node_path9 = require("path");
53
114
 
54
115
  // src/agents/packaged-runtime.ts
55
- var import_node_fs4 = require("fs");
56
- var import_node_path4 = require("path");
116
+ var import_node_fs9 = require("fs");
117
+ var import_node_path10 = require("path");
57
118
  function electronResourcesPath() {
58
119
  const resources = process.resourcesPath;
59
120
  if (typeof resources !== "string" || !resources) return null;
@@ -62,14 +123,14 @@ function electronResourcesPath() {
62
123
  function packagedCursorRuntimeDir() {
63
124
  const resources = electronResourcesPath();
64
125
  if (!resources) return null;
65
- const dir = (0, import_node_path4.join)(resources, "cursor-runtime");
66
- if (!(0, import_node_fs4.existsSync)((0, import_node_path4.join)(dir, "core-dist", "agents", "cursor-runner.js"))) return null;
126
+ const dir = (0, import_node_path10.join)(resources, "cursor-runtime");
127
+ if (!(0, import_node_fs9.existsSync)((0, import_node_path10.join)(dir, "core-dist", "agents", "cursor-runner.js"))) return null;
67
128
  return dir;
68
129
  }
69
130
  function packagedCursorRipgrepCandidate(platformPkg, binName) {
70
131
  const dir = packagedCursorRuntimeDir();
71
132
  if (!dir) return null;
72
- return (0, import_node_path4.join)(dir, "node_modules", platformPkg, "bin", binName);
133
+ return (0, import_node_path10.join)(dir, "node_modules", platformPkg, "bin", binName);
73
134
  }
74
135
 
75
136
  // src/agents/node-launch.ts
@@ -81,7 +142,7 @@ function unpackedAsarPath(filePath) {
81
142
  if (!isAsarPath(filePath)) return null;
82
143
  const unpacked = filePath.replace(/\.asar(?=[/\\])/, ".asar.unpacked");
83
144
  if (unpacked === filePath) return null;
84
- return (0, import_node_fs5.existsSync)(unpacked) ? unpacked : null;
145
+ return (0, import_node_fs10.existsSync)(unpacked) ? unpacked : null;
85
146
  }
86
147
  function nodeReadableScriptPath(scriptPath) {
87
148
  return unpackedAsarPath(scriptPath) ?? scriptPath;
@@ -97,21 +158,21 @@ function platformRipgrepPackage() {
97
158
  }
98
159
  function usableRipgrepPath(candidate) {
99
160
  const raw = candidate?.trim();
100
- if (!raw || !(0, import_node_path6.isAbsolute)(raw)) return null;
161
+ if (!raw || !(0, import_node_path12.isAbsolute)(raw)) return null;
101
162
  const readable = nodeReadableScriptPath(raw);
102
- if (!(0, import_node_fs6.existsSync)(readable) || isAsarPath(readable)) return null;
163
+ if (!(0, import_node_fs11.existsSync)(readable) || isAsarPath(readable)) return null;
103
164
  return readable;
104
165
  }
105
166
  function walkForBundledRipgrep(startFile) {
106
167
  if (!startFile) return null;
107
168
  const pkg = platformRipgrepPackage();
108
169
  const name = rgBinaryName();
109
- let dir = (0, import_node_path6.dirname)((0, import_node_path6.resolve)(startFile));
110
- const root = (0, import_node_path6.parse)(dir).root;
170
+ let dir = (0, import_node_path12.dirname)((0, import_node_path12.resolve)(startFile));
171
+ const root = (0, import_node_path12.parse)(dir).root;
111
172
  while (dir !== root) {
112
- const hit = usableRipgrepPath((0, import_node_path6.join)(dir, "node_modules", pkg, "bin", name));
173
+ const hit = usableRipgrepPath((0, import_node_path12.join)(dir, "node_modules", pkg, "bin", name));
113
174
  if (hit) return hit;
114
- const next = (0, import_node_path6.dirname)(dir);
175
+ const next = (0, import_node_path12.dirname)(dir);
115
176
  if (next === dir) break;
116
177
  dir = next;
117
178
  }
@@ -121,7 +182,7 @@ function requireResolveBundledRipgrep(fromFile) {
121
182
  try {
122
183
  const req = (0, import_node_module.createRequire)(fromFile);
123
184
  const pkgJson = req.resolve(`${platformRipgrepPackage()}/package.json`);
124
- return usableRipgrepPath((0, import_node_path6.join)((0, import_node_path6.dirname)(pkgJson), "bin", rgBinaryName()));
185
+ return usableRipgrepPath((0, import_node_path12.join)((0, import_node_path12.dirname)(pkgJson), "bin", rgBinaryName()));
125
186
  } catch {
126
187
  return null;
127
188
  }
@@ -147,45 +208,13 @@ function ensureCursorRipgrepPath(opts) {
147
208
  }
148
209
 
149
210
  // src/agents/cursor-store.ts
150
- var import_node_path12 = require("path");
151
-
152
- // src/store/paths.ts
153
- var import_node_path10 = require("path");
154
- var import_node_os5 = require("os");
155
- var import_node_path11 = require("path");
156
- var import_node_fs10 = require("fs");
157
-
158
- // src/hook/settings.ts
159
- var import_node_fs9 = require("fs");
160
- var import_node_os4 = require("os");
161
- var import_node_path9 = require("path");
162
- var import_smol_toml = require("smol-toml");
163
-
164
- // src/hook/convention-setup.ts
165
- var import_node_fs7 = require("fs");
166
- var import_node_path7 = require("path");
167
-
168
- // src/hook/cursor-worktrees.ts
169
- var import_node_fs8 = require("fs");
170
- var import_node_path8 = require("path");
171
- var import_execa2 = require("execa");
172
- var import_node_readline = require("readline");
173
-
174
- // src/store/paths.ts
175
- function appDataDir() {
176
- const override = process.env.SIDEBOARD_APP_DATA?.trim();
177
- const base = override ? override : process.platform === "darwin" ? (0, import_node_path11.join)((0, import_node_os5.homedir)(), "Library", "Application Support", "sideboard") : process.platform === "win32" ? (0, import_node_path11.join)(process.env.APPDATA ?? (0, import_node_path11.join)((0, import_node_os5.homedir)(), "AppData", "Roaming"), "sideboard") : (0, import_node_path11.join)((0, import_node_os5.homedir)(), ".local", "share", "sideboard");
178
- (0, import_node_fs10.mkdirSync)(base, { recursive: true });
179
- return base;
180
- }
181
-
182
- // src/agents/cursor-store.ts
211
+ var import_node_path13 = require("path");
183
212
  var CURSOR_SDK_STORE_DIR = "cursor-sdk-store";
184
213
  function cursorSdkStoreDir(threadId) {
185
- const root = (0, import_node_path12.join)(appDataDir(), CURSOR_SDK_STORE_DIR);
214
+ const root = (0, import_node_path13.join)(appDataDir(), CURSOR_SDK_STORE_DIR);
186
215
  const id = sanitizeCursorStoreSegment(threadId);
187
216
  if (!id) return root;
188
- return (0, import_node_path12.join)(root, "threads", id);
217
+ return (0, import_node_path13.join)(root, "threads", id);
189
218
  }
190
219
  function sanitizeCursorStoreSegment(threadId) {
191
220
  return (threadId ?? "").trim().replace(/[^a-zA-Z0-9._-]/g, "_");
@@ -712,7 +741,7 @@ function modelSelection(model, opts) {
712
741
  }
713
742
  function localAgentStore(threadId) {
714
743
  const root = cursorSdkStoreDir(threadId);
715
- (0, import_node_fs11.mkdirSync)(root, { recursive: true });
744
+ (0, import_node_fs12.mkdirSync)(root, { recursive: true });
716
745
  return new import_sdk.JsonlLocalAgentStore(root);
717
746
  }
718
747
  async function cancelStaleLocalRuns(agentId, opts) {
@@ -12,7 +12,7 @@ import {
12
12
  ensureCursorRipgrepPath,
13
13
  fetchCursorTurnCostUsd,
14
14
  formatUnknownDetail
15
- } from "../chunk-XXIH6XYR.js";
15
+ } from "../chunk-NQTKRAUF.js";
16
16
  import {
17
17
  dropNestedElectronEnvFromProcess
18
18
  } from "../chunk-4TR3HZFT.js";
@@ -37,12 +37,12 @@ import {
37
37
  resolveQuotaFallbackAgent,
38
38
  turnCostUsdFromCursorUsage,
39
39
  whichOnPath
40
- } from "./chunk-6X6KMUI2.js";
41
- import "./chunk-LZ6QMEQC.js";
42
- import "./chunk-S42XV45P.js";
43
- import "./chunk-6GN5WPYZ.js";
44
- import "./chunk-234EKD2F.js";
45
- import "./chunk-PXNOT6NV.js";
40
+ } from "./chunk-ZXHV3NHY.js";
41
+ import "./chunk-HVIEYTUK.js";
42
+ import "./chunk-Y4MIXGPA.js";
43
+ import "./chunk-VKQGAWHY.js";
44
+ import "./chunk-TNOLCU5B.js";
45
+ import "./chunk-7O53GXTA.js";
46
46
  import "./chunk-D6JWYJ4P.js";
47
47
  import "./chunk-LZQULFIT.js";
48
48
  import "./chunk-SYFVUF2C.js";
@@ -31,19 +31,19 @@ import {
31
31
  resolveLoginCommand,
32
32
  resolveQuotaFallbackAgent,
33
33
  whichOnPath
34
- } from "./chunk-3F7AXVIL.js";
35
- import "./chunk-2RM6BZQ2.js";
36
- import "./chunk-QYZYDO3F.js";
34
+ } from "./chunk-QTJ2ERA6.js";
35
+ import "./chunk-NA7P3SZL.js";
36
+ import "./chunk-7JIYKYLL.js";
37
37
  import "./chunk-6K64FJDD.js";
38
- import "./chunk-XD2BAANL.js";
39
- import "./chunk-M267JPEA.js";
40
- import "./chunk-ELBYOGVA.js";
38
+ import "./chunk-IEEAVWAP.js";
39
+ import "./chunk-AN3THU7F.js";
40
+ import "./chunk-N7WZ6NIN.js";
41
41
  import {
42
42
  cursorSdkMessageToEvents,
43
43
  parseCursorRunnerLine,
44
44
  preferredCursorCostCents,
45
45
  turnCostUsdFromCursorUsage
46
- } from "./chunk-XXIH6XYR.js";
46
+ } from "./chunk-NQTKRAUF.js";
47
47
  import {
48
48
  ORCHESTRATOR_AGENT_KINDS,
49
49
  assertOrchestratorCapableAgent,
@@ -760,18 +760,35 @@ function teamSlugFromName(name) {
760
760
  function normalizeTakenSlug(raw) {
761
761
  return raw.toLowerCase().replace(/^thread\//, "").replace(/\/+$/, "");
762
762
  }
763
+ function soccerTokenFromTakenSlug(raw) {
764
+ const normalized = normalizeTakenSlug(raw);
765
+ if (!normalized) return null;
766
+ const withoutTicket = normalized.replace(/^[a-z]{2,8}-\d{1,6}-/, "").replace(/^\d{1,8}-/, "");
767
+ const lookup = withoutTicket || normalized;
768
+ const suffixMatch = lookup.match(/^(.+)-(\d+)$/);
769
+ const base = suffixMatch?.[1] ?? lookup;
770
+ const team = FAMOUS_SOCCER_TEAM_SEEDS.find((t) => t.slug === base);
771
+ if (!team) return null;
772
+ return suffixMatch ? `${team.slug}-${suffixMatch[2]}` : team.slug;
773
+ }
774
+ function addTakenSlug(out, raw) {
775
+ const normalized = normalizeTakenSlug(raw);
776
+ if (!normalized) return;
777
+ out.add(normalized);
778
+ const token = soccerTokenFromTakenSlug(normalized);
779
+ if (token) out.add(token);
780
+ }
763
781
  function takenSlugsFromThread(thread) {
764
782
  const out = /* @__PURE__ */ new Set();
765
783
  const titleSlug = thread.title ? teamSlugFromName(thread.title) : null;
766
784
  if (titleSlug) out.add(normalizeTakenSlug(titleSlug));
767
785
  if (thread.branchName?.trim()) {
768
- const branch = normalizeTakenSlug(thread.branchName.trim());
769
- if (branch) out.add(branch);
786
+ addTakenSlug(out, thread.branchName.trim());
770
787
  }
771
788
  if (thread.worktreePath) {
772
789
  const parts = thread.worktreePath.replace(/\/+$/, "").split("/");
773
790
  const dir = parts[parts.length - 1];
774
- if (dir) out.add(normalizeTakenSlug(dir));
791
+ if (dir) addTakenSlug(out, dir);
775
792
  }
776
793
  return [...out];
777
794
  }
@@ -3191,12 +3208,16 @@ function collectTakenTeamSlugs(repoPath) {
3191
3208
  if (existsSync(root)) {
3192
3209
  for (const entry of readdirSync(root, { withFileTypes: true })) {
3193
3210
  if (entry.isDirectory() && entry.name !== ".DS_Store") {
3194
- taken.add(normalizeTakenSlug(entry.name));
3211
+ for (const slug of takenSlugsFromThread({ worktreePath: entry.name })) {
3212
+ taken.add(slug);
3213
+ }
3195
3214
  }
3196
3215
  }
3197
3216
  }
3198
3217
  for (const slug of listLocalThreadBranchSlugs(repoPath)) {
3199
- taken.add(slug);
3218
+ for (const token of takenSlugsFromThread({ branchName: slug })) {
3219
+ taken.add(token);
3220
+ }
3200
3221
  }
3201
3222
  for (const thread of listThreads({ includeArchived: true })) {
3202
3223
  if (!sameRepoPath(thread.repoPath, repoPath)) continue;
@@ -762,18 +762,35 @@ function teamSlugFromName(name) {
762
762
  function normalizeTakenSlug(raw) {
763
763
  return raw.toLowerCase().replace(/^thread\//, "").replace(/\/+$/, "");
764
764
  }
765
+ function soccerTokenFromTakenSlug(raw) {
766
+ const normalized = normalizeTakenSlug(raw);
767
+ if (!normalized) return null;
768
+ const withoutTicket = normalized.replace(/^[a-z]{2,8}-\d{1,6}-/, "").replace(/^\d{1,8}-/, "");
769
+ const lookup = withoutTicket || normalized;
770
+ const suffixMatch = lookup.match(/^(.+)-(\d+)$/);
771
+ const base = suffixMatch?.[1] ?? lookup;
772
+ const team = FAMOUS_SOCCER_TEAM_SEEDS.find((t) => t.slug === base);
773
+ if (!team) return null;
774
+ return suffixMatch ? `${team.slug}-${suffixMatch[2]}` : team.slug;
775
+ }
776
+ function addTakenSlug(out, raw) {
777
+ const normalized = normalizeTakenSlug(raw);
778
+ if (!normalized) return;
779
+ out.add(normalized);
780
+ const token = soccerTokenFromTakenSlug(normalized);
781
+ if (token) out.add(token);
782
+ }
765
783
  function takenSlugsFromThread(thread) {
766
784
  const out = /* @__PURE__ */ new Set();
767
785
  const titleSlug = thread.title ? teamSlugFromName(thread.title) : null;
768
786
  if (titleSlug) out.add(normalizeTakenSlug(titleSlug));
769
787
  if (thread.branchName?.trim()) {
770
- const branch = normalizeTakenSlug(thread.branchName.trim());
771
- if (branch) out.add(branch);
788
+ addTakenSlug(out, thread.branchName.trim());
772
789
  }
773
790
  if (thread.worktreePath) {
774
791
  const parts = thread.worktreePath.replace(/\/+$/, "").split("/");
775
792
  const dir = parts[parts.length - 1];
776
- if (dir) out.add(normalizeTakenSlug(dir));
793
+ if (dir) addTakenSlug(out, dir);
777
794
  }
778
795
  return [...out];
779
796
  }
@@ -3154,12 +3171,16 @@ function collectTakenTeamSlugs(repoPath) {
3154
3171
  if (existsSync(root)) {
3155
3172
  for (const entry of readdirSync(root, { withFileTypes: true })) {
3156
3173
  if (entry.isDirectory() && entry.name !== ".DS_Store") {
3157
- taken.add(normalizeTakenSlug(entry.name));
3174
+ for (const slug of takenSlugsFromThread({ worktreePath: entry.name })) {
3175
+ taken.add(slug);
3176
+ }
3158
3177
  }
3159
3178
  }
3160
3179
  }
3161
3180
  for (const slug of listLocalThreadBranchSlugs(repoPath)) {
3162
- taken.add(slug);
3181
+ for (const token of takenSlugsFromThread({ branchName: slug })) {
3182
+ taken.add(token);
3183
+ }
3163
3184
  }
3164
3185
  for (const thread of listThreads({ includeArchived: true })) {
3165
3186
  if (!sameRepoPath(thread.repoPath, repoPath)) continue;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  formatFetchError
3
- } from "./chunk-ELBYOGVA.js";
3
+ } from "./chunk-N7WZ6NIN.js";
4
4
 
5
5
  // src/brightsy/config.ts
6
6
  import { existsSync, readFileSync, writeFileSync } from "fs";
@@ -2,7 +2,7 @@
2
2
 
3
3
  import {
4
4
  httpFetch
5
- } from "./chunk-6GN5WPYZ.js";
5
+ } from "./chunk-VKQGAWHY.js";
6
6
  import {
7
7
  getAbleTimeAccessToken,
8
8
  getAbleTimeHost,
@@ -6,7 +6,7 @@ import {
6
6
  loadBrightsyConfig,
7
7
  refreshBrightsyAccessToken,
8
8
  saveBrightsyConfig
9
- } from "./chunk-S42XV45P.js";
9
+ } from "./chunk-Y4MIXGPA.js";
10
10
  import {
11
11
  run
12
12
  } from "./chunk-FNQNJOHY.js";
@@ -4,7 +4,7 @@ import {
4
4
  loadBrightsyConfig,
5
5
  refreshBrightsyAccessToken,
6
6
  saveBrightsyConfig
7
- } from "./chunk-M267JPEA.js";
7
+ } from "./chunk-AN3THU7F.js";
8
8
  import {
9
9
  appDataDir
10
10
  } from "./chunk-EFVFB2AH.js";
@@ -18,7 +18,7 @@ import { join } from "path";
18
18
 
19
19
  // src/brightsy/accounts.ts
20
20
  async function loadConnectedTeams() {
21
- const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-DBWAMP7G.js");
21
+ const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-ON2KIKQX.js");
22
22
  return listConnectedBrightsyTeams2();
23
23
  }
24
24
  async function runBrightsyTeamsJson(args) {
@@ -46,15 +46,15 @@ async function listBrightsyAccounts() {
46
46
  }
47
47
  async function getBrightsySession() {
48
48
  try {
49
- const { ensureBrightsyLocalConfigFresh: ensureBrightsyLocalConfigFresh2 } = await import("./oauth-A7XXI2TM.js");
50
- const { ensureConnectedBrightsyTeamTokens: ensureConnectedBrightsyTeamTokens2 } = await import("./connected-teams-DBWAMP7G.js");
49
+ const { ensureBrightsyLocalConfigFresh: ensureBrightsyLocalConfigFresh2 } = await import("./oauth-6ZQ4Q4XN.js");
50
+ const { ensureConnectedBrightsyTeamTokens: ensureConnectedBrightsyTeamTokens2 } = await import("./connected-teams-ON2KIKQX.js");
51
51
  await ensureBrightsyLocalConfigFresh2();
52
52
  await ensureConnectedBrightsyTeamTokens2();
53
53
  loadBrightsyConfig();
54
54
  const data = await runBrightsyTeamsJson([]);
55
55
  const accounts = Array.isArray(data.teams) ? data.teams : [];
56
56
  const active = data.active ?? accounts.find((a) => a.active) ?? null;
57
- const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-DBWAMP7G.js");
57
+ const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-ON2KIKQX.js");
58
58
  const connectedTeams = ensureCliTeamTracked2(
59
59
  active ? { id: active.id, slug: active.slug, name: active.name } : void 0
60
60
  );
@@ -94,7 +94,7 @@ async function performBrightsyAccountSwitch(accountIdOrSlug) {
94
94
  return { cfg, target: data.active };
95
95
  }
96
96
  async function switchBrightsyAccount(accountIdOrSlug) {
97
- const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-DBWAMP7G.js");
97
+ const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-ON2KIKQX.js");
98
98
  await connectBrightsyTeam2(accountIdOrSlug);
99
99
  return getBrightsySession();
100
100
  }