@sideboard-ai/core 0.1.86 → 0.1.88

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/agents/cursor-runner.cjs +23 -13
  2. package/dist/agents/cursor-runner.js +2 -2
  3. package/dist/{agents-NDHD3VOL.js → agents-LMUFTGKF.js} +8 -8
  4. package/dist/{agents-HJ3Y2JN5.js → agents-ODBP7J6E.js} +9 -9
  5. package/dist/{app-settings-K6RFCRF6.js → app-settings-BRF7VKTQ.js} +3 -3
  6. package/dist/{app-settings-PEXK5VEX.js → app-settings-ZXPAB3QN.js} +2 -2
  7. package/dist/{caffeinate-hold-EAZNWJBE.js → caffeinate-hold-I7SG6UQR.js} +2 -2
  8. package/dist/{caffeinate-hold-OHAUWOA6.js → caffeinate-hold-U3QJBV67.js} +2 -2
  9. package/dist/{chunk-FWJYLBO6.js → chunk-3WA37BRI.js} +1 -1
  10. package/dist/{chunk-IGEL6M4G.js → chunk-6EZRSCIT.js} +3 -3
  11. package/dist/{chunk-AY53MPDE.js → chunk-6LFV4VFI.js} +15 -2
  12. package/dist/{chunk-OBHZKT2T.js → chunk-7D27DD2X.js} +3 -3
  13. package/dist/{chunk-RV6DBEDQ.js → chunk-7KDBDMNC.js} +1 -1
  14. package/dist/{chunk-U4RZ3IQI.js → chunk-B2KIO2SD.js} +5 -5
  15. package/dist/{chunk-M37RITA6.js → chunk-B4R2VB2A.js} +164 -30
  16. package/dist/{chunk-6K5VAPVR.js → chunk-DKHGWYWR.js} +1 -1
  17. package/dist/{chunk-I3FRXL7J.js → chunk-FT2SQOL4.js} +2 -2
  18. package/dist/{chunk-KE6QLNTJ.js → chunk-JE75QW2I.js} +58 -24
  19. package/dist/{chunk-7MV3RXSC.js → chunk-JL4SJ6V7.js} +137 -26
  20. package/dist/{chunk-7FD7COKE.js → chunk-JOF3XIEM.js} +1 -1
  21. package/dist/{chunk-MFF2RE3I.js → chunk-NZPGMNFC.js} +1 -1
  22. package/dist/{chunk-HA2QTIWN.js → chunk-OB6IRIFV.js} +5 -5
  23. package/dist/{chunk-HHTHF5BQ.js → chunk-QSLE4VEM.js} +4 -4
  24. package/dist/{chunk-4Y745GLN.js → chunk-RJLBSYUO.js} +59 -25
  25. package/dist/{chunk-5KLC2MWZ.js → chunk-TLPJHLLM.js} +14 -1
  26. package/dist/{chunk-EWKHP6DD.js → chunk-UHTNJKZX.js} +5 -5
  27. package/dist/{chunk-ZN4NDAHV.js → chunk-VZ2L4AEJ.js} +5 -5
  28. package/dist/{chunk-45U4RQ74.js → chunk-WANQFU3S.js} +3 -3
  29. package/dist/{chunk-6ZGTM2E7.js → chunk-ZXYWWSHZ.js} +3 -3
  30. package/dist/{connected-teams-BNBM7OIC.js → connected-teams-SWHJWK2A.js} +2 -2
  31. package/dist/{connected-teams-LSQ5TAZP.js → connected-teams-TLVKZPJP.js} +2 -2
  32. package/dist/{coordinator-prompt-L65MIGCV.js → coordinator-prompt-CI5SHONJ.js} +5 -5
  33. package/dist/{coordinator-prompt-HOMHBR2L.js → coordinator-prompt-UK5LYFN5.js} +6 -6
  34. package/dist/{cursor-recover-L5PNQUDT.js → cursor-recover-G34BYKL2.js} +1 -1
  35. package/dist/{cursor-recover-NNK7JPQM.js → cursor-recover-S5ORPW34.js} +1 -1
  36. package/dist/{global-workspace-MXOLTUAR.js → global-workspace-2YZ2V4I5.js} +6 -6
  37. package/dist/{global-workspace-VGKPYFE2.js → global-workspace-JQQLPJM5.js} +7 -7
  38. package/dist/index.cjs +693 -541
  39. package/dist/index.d.cts +43 -9
  40. package/dist/index.d.ts +43 -9
  41. package/dist/index.js +213 -253
  42. package/dist/mcp/run-stdio.cjs +630 -505
  43. package/dist/mcp/run-stdio.js +184 -225
  44. package/dist/{paths-VPH3ITBK.js → paths-JQM2XRAD.js} +1 -1
  45. package/dist/{paths-2OFB7UJG.js → paths-TZX4L5X7.js} +1 -1
  46. package/dist/{thread-store-BUBR24YA.js → thread-store-V7NOOXKE.js} +2 -2
  47. package/dist/{thread-store-XTPFCJAI.js → thread-store-XAKWCV2E.js} +2 -2
  48. package/dist/{workspaces-VWQ5YSND.js → workspaces-FDO5L4NI.js} +7 -7
  49. package/dist/{workspaces-2GZ2VNNU.js → workspaces-YWCC3WV4.js} +8 -8
  50. package/dist/{worktree-RFCCG23P.js → worktree-4555QBQ7.js} +4 -4
  51. package/dist/{worktree-WZJ3CFEN.js → worktree-7YNSJ224.js} +5 -5
  52. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  stripNestedElectronEnv
3
- } from "./chunk-5KLC2MWZ.js";
3
+ } from "./chunk-TLPJHLLM.js";
4
4
  import {
5
5
  chmodOwnerOnly,
6
6
  writePrivateFile
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-77WWLBCI.js";
11
11
  import {
12
12
  appDataDir
13
- } from "./chunk-M37RITA6.js";
13
+ } from "./chunk-B4R2VB2A.js";
14
14
 
15
15
  // src/store/app-settings.ts
16
16
  import { randomUUID } from "crypto";
@@ -6,25 +6,26 @@ import {
6
6
  ensureCliTeamTracked,
7
7
  ensureConnectedBrightsyTeamTokens,
8
8
  loadBrightsyConfig
9
- } from "./chunk-6K5VAPVR.js";
9
+ } from "./chunk-DKHGWYWR.js";
10
10
  import {
11
11
  isOrchestratorThread
12
- } from "./chunk-EWKHP6DD.js";
12
+ } from "./chunk-UHTNJKZX.js";
13
13
  import {
14
14
  codexUnattendedGitConfigArgs,
15
15
  resolveAgentGitAuthEnv
16
- } from "./chunk-6ZGTM2E7.js";
16
+ } from "./chunk-ZXYWWSHZ.js";
17
17
  import {
18
18
  claudeChromeEnabled,
19
- isStrippedElectronLaunch,
19
+ isElectronLikeCommand,
20
20
  loadAppSettings,
21
21
  resolveAgentExecutable,
22
22
  resolveClaudeExecutable,
23
+ unwrapStrippedElectronLaunch,
23
24
  wrapElectronAsNodeLaunch
24
- } from "./chunk-AY53MPDE.js";
25
+ } from "./chunk-6LFV4VFI.js";
25
26
  import {
26
27
  appDataDir
27
- } from "./chunk-7MV3RXSC.js";
28
+ } from "./chunk-JL4SJ6V7.js";
28
29
  import {
29
30
  enrichPathWithNpmGlobalBin,
30
31
  isConductorBundledCli,
@@ -602,7 +603,7 @@ function mcpAllowTools(servers) {
602
603
  }
603
604
 
604
605
  // src/agents/injected-mcp.ts
605
- import { existsSync as existsSync2, mkdtempSync, writeFileSync } from "fs";
606
+ import { existsSync as existsSync2, mkdirSync, mkdtempSync, writeFileSync } from "fs";
606
607
  import { createRequire } from "module";
607
608
  import { tmpdir } from "os";
608
609
  import { dirname, join } from "path";
@@ -841,22 +842,52 @@ async function buildInjectedMcpServers(opts) {
841
842
  }
842
843
  return servers;
843
844
  }
845
+ function shSingleQuote(value) {
846
+ return `'${value.replace(/'/g, `'\\''`)}'`;
847
+ }
848
+ function cursorSafeMcpLaunch(command, args) {
849
+ if (process.platform === "win32") {
850
+ return args && args.length > 0 ? { command, args } : { command };
851
+ }
852
+ const unwrapped = unwrapStrippedElectronLaunch(command, args);
853
+ const file = unwrapped?.file ?? command;
854
+ const fileArgs = unwrapped?.args ?? args ?? [];
855
+ if (!isElectronLikeCommand(file)) {
856
+ return fileArgs.length > 0 ? { command: file, args: fileArgs } : { command: file };
857
+ }
858
+ const dir = join(appDataDir(), "mcp-launch");
859
+ mkdirSync(dir, { recursive: true });
860
+ const wrap = join(dir, "cursor-electron-as-node.sh");
861
+ const execLine = [file, ...fileArgs].map(shSingleQuote).join(" ");
862
+ writeFileSync(
863
+ wrap,
864
+ [
865
+ "#!/bin/sh",
866
+ "vars=`printenv | awk -F= '/^(ELECTRON_|CHROME_)/{print $1}'`",
867
+ '[ -n "$vars" ] && unset $vars',
868
+ "export ELECTRON_RUN_AS_NODE=1",
869
+ `exec ${execLine} "$@"`,
870
+ ""
871
+ ].join("\n"),
872
+ { mode: 493 }
873
+ );
874
+ return { command: wrap };
875
+ }
876
+ function mcpSpawnEnv(env) {
877
+ if (!env) return void 0;
878
+ const out = { ...env };
879
+ delete out.ELECTRON_RUN_AS_NODE;
880
+ return Object.keys(out).length > 0 ? out : void 0;
881
+ }
844
882
  function toCursorMcpServers(servers) {
845
883
  const out = {};
846
884
  for (const s of servers) {
847
- const env = s.env ? { ...s.env } : void 0;
848
- if (env) delete env.ELECTRON_RUN_AS_NODE;
849
- let command = s.command;
850
- let args = s.args;
851
- if (process.platform !== "win32" && !isStrippedElectronLaunch(command, args)) {
852
- const wrapped = wrapElectronAsNodeLaunch(command, args ?? []);
853
- command = wrapped.file;
854
- args = wrapped.args;
855
- }
885
+ const env = mcpSpawnEnv(s.env);
886
+ const launch = cursorSafeMcpLaunch(s.command, s.args);
856
887
  out[s.name] = {
857
- command,
858
- ...args && args.length > 0 ? { args } : {},
859
- ...env && Object.keys(env).length > 0 ? { env } : {}
888
+ command: launch.command,
889
+ ...launch.args && launch.args.length > 0 ? { args: launch.args } : {},
890
+ ...env ? { env } : {}
860
891
  };
861
892
  }
862
893
  return out;
@@ -869,8 +900,9 @@ function toCodexMcpConfigArgs(servers) {
869
900
  if (s.args?.length) {
870
901
  args.push("-c", `${prefix}.args=${JSON.stringify(s.args)}`);
871
902
  }
872
- if (s.env) {
873
- for (const [key, value] of Object.entries(s.env)) {
903
+ const env = mcpSpawnEnv(s.env);
904
+ if (env) {
905
+ for (const [key, value] of Object.entries(env)) {
874
906
  args.push("-c", `${prefix}.env.${key}=${JSON.stringify(value)}`);
875
907
  }
876
908
  }
@@ -883,11 +915,12 @@ function toCodexMcpConfigArgs(servers) {
883
915
  function toOpencodeMcpConfigContent(servers) {
884
916
  const mcp = {};
885
917
  for (const s of servers) {
918
+ const env = mcpSpawnEnv(s.env);
886
919
  mcp[s.name] = {
887
920
  type: "local",
888
921
  command: [s.command, ...s.args ?? []],
889
922
  enabled: true,
890
- ...s.env && Object.keys(s.env).length > 0 ? { environment: s.env } : {}
923
+ ...env ? { environment: env } : {}
891
924
  };
892
925
  }
893
926
  return JSON.stringify({ mcp });
@@ -896,10 +929,11 @@ function writeMcpServersConfig(servers) {
896
929
  if (servers.length === 0) return null;
897
930
  const mcpServers = {};
898
931
  for (const s of servers) {
932
+ const env = mcpSpawnEnv(s.env);
899
933
  mcpServers[s.name] = {
900
934
  command: s.command,
901
935
  ...s.args ? { args: s.args } : {},
902
- ...s.env ? { env: s.env } : {}
936
+ ...env ? { env } : {}
903
937
  };
904
938
  }
905
939
  const dir = mkdtempSync(join(tmpdir(), "sideboard-mcp-"));
@@ -1100,7 +1134,7 @@ var claudeAdapter = {
1100
1134
  );
1101
1135
  }
1102
1136
  const mode = permissionMode(thread);
1103
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-MXOLTUAR.js");
1137
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-2YZ2V4I5.js");
1104
1138
  const isOrchestrator = isOrchestratorThread2(thread);
1105
1139
  const injectedServers = await buildInjectedMcpServers({
1106
1140
  includeSideboard: true,
@@ -4,17 +4,126 @@
4
4
  // src/store/paths.ts
5
5
  import { basename } from "path";
6
6
  import { homedir as homedir2 } from "os";
7
- import { join as join2 } from "path";
7
+ import { join as join4 } from "path";
8
8
  import { mkdirSync } from "fs";
9
9
 
10
10
  // src/hook/settings.ts
11
- import { existsSync, readFileSync } from "fs";
11
+ import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
12
12
  import { homedir } from "os";
13
- import { join } from "path";
13
+ import { join as join3 } from "path";
14
14
  import { parse as parseToml } from "smol-toml";
15
+
16
+ // src/hook/convention-setup.ts
17
+ import { existsSync, statSync } from "fs";
18
+ import { join } from "path";
19
+ var CONVENTION_SETUP_RELPATHS = [
20
+ "script/setup",
21
+ "bin/setup",
22
+ "scripts/setup.sh",
23
+ "scripts/setup"
24
+ ];
25
+ function isFile(path) {
26
+ try {
27
+ return statSync(path).isFile();
28
+ } catch {
29
+ return false;
30
+ }
31
+ }
32
+ function normPath(p) {
33
+ return p.replace(/\/+$/, "");
34
+ }
35
+ function findConventionSetup(worktreePath, repoPath) {
36
+ const roots = [
37
+ { root: worktreePath, where: "worktree" }
38
+ ];
39
+ if (repoPath && normPath(repoPath) !== normPath(worktreePath)) {
40
+ roots.push({ root: repoPath, where: "main repo" });
41
+ }
42
+ for (const { root, where } of roots) {
43
+ for (const relPath of CONVENTION_SETUP_RELPATHS) {
44
+ const absPath = join(root, relPath);
45
+ if (!existsSync(absPath) || !isFile(absPath)) continue;
46
+ return {
47
+ relPath,
48
+ absPath,
49
+ command: `bash ${JSON.stringify(absPath)}`,
50
+ source: `${relPath} (${where})`
51
+ };
52
+ }
53
+ }
54
+ return null;
55
+ }
56
+
57
+ // src/hook/cursor-worktrees.ts
58
+ import { existsSync as existsSync2, readFileSync } from "fs";
59
+ import { join as join2 } from "path";
60
+ import { execa } from "execa";
61
+ import { createInterface } from "readline";
62
+ function loadCursorWorktreesJson(rootPath) {
63
+ const path = join2(rootPath, ".cursor", "worktrees.json");
64
+ if (!existsSync2(path)) return null;
65
+ try {
66
+ return JSON.parse(readFileSync(path, "utf8"));
67
+ } catch {
68
+ return null;
69
+ }
70
+ }
71
+ function resolveSetupSpec(config) {
72
+ if (process.platform === "win32") {
73
+ return config["setup-worktree-windows"] ?? config["setup-worktree"] ?? null;
74
+ }
75
+ return config["setup-worktree-unix"] ?? config["setup-worktree"] ?? null;
76
+ }
77
+ async function runCursorWorktreeSetup(repoPath, worktreePath, onLine) {
78
+ const fromWorktree = loadCursorWorktreesJson(worktreePath);
79
+ const fromRepo = worktreePath !== repoPath ? loadCursorWorktreesJson(repoPath) : null;
80
+ const config = fromWorktree ?? fromRepo;
81
+ if (!config) return { ran: false, exitCode: null, source: null };
82
+ const spec = resolveSetupSpec(config);
83
+ if (!spec) return { ran: false, exitCode: null, source: null };
84
+ const sourceLabel = fromWorktree ? ".cursor/worktrees.json (worktree)" : ".cursor/worktrees.json (main repo)";
85
+ const env = {
86
+ ...process.env,
87
+ ROOT_WORKTREE_PATH: repoPath
88
+ };
89
+ if (process.platform === "win32") {
90
+ env.ROOT_WORKTREE_PATH = repoPath;
91
+ }
92
+ const commands = Array.isArray(spec) ? spec : [spec.endsWith(".sh") || spec.endsWith(".ps1") ? join2(
93
+ fromWorktree ? worktreePath : repoPath,
94
+ ".cursor",
95
+ spec
96
+ ) : spec];
97
+ let lastExit = 0;
98
+ for (const command of commands) {
99
+ const isScriptPath = typeof spec === "string" && (spec.endsWith(".sh") || spec.endsWith(".ps1"));
100
+ const shell = process.platform === "win32" ? "powershell" : "bash";
101
+ const args = process.platform === "win32" ? isScriptPath ? ["-File", command] : ["-Command", command] : isScriptPath ? [command] : ["-lc", command];
102
+ onLine?.(`[cursor setup] ${command}`);
103
+ const child = execa(shell, args, {
104
+ cwd: worktreePath,
105
+ reject: false,
106
+ env
107
+ });
108
+ if (child.stdout && onLine) {
109
+ const rl = createInterface({ input: child.stdout });
110
+ rl.on("line", onLine);
111
+ }
112
+ if (child.stderr && onLine) {
113
+ const rl = createInterface({ input: child.stderr });
114
+ rl.on("line", onLine);
115
+ }
116
+ const result = await child;
117
+ lastExit = result.exitCode ?? null;
118
+ if (lastExit !== 0 && lastExit !== null) break;
119
+ }
120
+ return { ran: true, exitCode: lastExit, source: sourceLabel };
121
+ }
122
+
123
+ // src/hook/settings.ts
15
124
  function expandHome(path) {
16
125
  if (path.startsWith("~/") || path === "~") {
17
- return join(homedir(), path.slice(2));
126
+ return join3(homedir(), path.slice(2));
18
127
  }
19
128
  return path;
20
129
  }
@@ -27,8 +136,8 @@ function parseAvailableIn(raw) {
27
136
  return out.length ? out : void 0;
28
137
  }
29
138
  function parseSettingsFile(path, source) {
30
- if (!existsSync(path)) return null;
31
- const raw = readFileSync(path, "utf8");
139
+ if (!existsSync3(path)) return null;
140
+ const raw = readFileSync2(path, "utf8");
32
141
  const data = parseToml(raw);
33
142
  const scripts = data.scripts ?? {};
34
143
  const setup = typeof scripts.setup === "string" ? scripts.setup : void 0;
@@ -131,15 +240,15 @@ function finalizeSettings(parsed) {
131
240
  };
132
241
  }
133
242
  function familyFiles(rootPath, source) {
134
- const dir = join(rootPath, `.${source}`);
243
+ const dir = join3(rootPath, `.${source}`);
135
244
  return {
136
- toml: join(dir, "settings.toml"),
137
- local: join(dir, "settings.local.toml")
245
+ toml: join3(dir, "settings.toml"),
246
+ local: join3(dir, "settings.local.toml")
138
247
  };
139
248
  }
140
249
  function familyExists(rootPath, source) {
141
250
  const files = familyFiles(rootPath, source);
142
- return existsSync(files.toml) || existsSync(files.local);
251
+ return existsSync3(files.toml) || existsSync3(files.local);
143
252
  }
144
253
  function detectFamily(rootPath) {
145
254
  if (familyExists(rootPath, "sideboard")) return "sideboard";
@@ -158,7 +267,7 @@ function loadAnyLocal(rootPath) {
158
267
  loadLocalToml(rootPath, "sideboard")
159
268
  );
160
269
  }
161
- function normPath(p) {
270
+ function normPath2(p) {
162
271
  return p.replace(/\/+$/, "");
163
272
  }
164
273
  function loadRepoSettings(repoPath) {
@@ -172,11 +281,11 @@ function loadRepoSettings(repoPath) {
172
281
  }
173
282
  function loadWorkspaceSettings(worktreePath, repoPath) {
174
283
  const wtFamily = detectFamily(worktreePath);
175
- const repoFamily = repoPath && normPath(repoPath) !== normPath(worktreePath) ? detectFamily(repoPath) : null;
284
+ const repoFamily = repoPath && normPath2(repoPath) !== normPath2(worktreePath) ? detectFamily(repoPath) : null;
176
285
  const wtToml = wtFamily ? loadCommittedToml(worktreePath, wtFamily) : null;
177
286
  const repoToml = repoPath && repoFamily ? loadCommittedToml(repoPath, repoFamily) : null;
178
287
  let merged = wtToml ?? repoToml;
179
- if (repoPath && normPath(repoPath) !== normPath(worktreePath)) {
288
+ if (repoPath && normPath2(repoPath) !== normPath2(worktreePath)) {
180
289
  merged = mergeSettings(merged, loadAnyLocal(repoPath));
181
290
  }
182
291
  merged = mergeSettings(merged, loadAnyLocal(worktreePath));
@@ -186,16 +295,16 @@ function settingsSourceLabel(rootPath) {
186
295
  const family = detectFamily(rootPath);
187
296
  if (!family) return null;
188
297
  const files = familyFiles(rootPath, family);
189
- if (existsSync(files.toml) && existsSync(files.local)) {
298
+ if (existsSync3(files.toml) && existsSync3(files.local)) {
190
299
  return `.${family}/settings.toml + local`;
191
300
  }
192
- if (existsSync(files.local)) return `.${family}/settings.local.toml`;
301
+ if (existsSync3(files.local)) return `.${family}/settings.local.toml`;
193
302
  return `.${family}/settings.toml`;
194
303
  }
195
304
  function workspaceSettingsSourceLabel(worktreePath, repoPath) {
196
305
  const wt = settingsSourceLabel(worktreePath);
197
306
  if (wt) return `${wt} (worktree)`;
198
- if (repoPath && normPath(repoPath) !== normPath(worktreePath)) {
307
+ if (repoPath && normPath2(repoPath) !== normPath2(worktreePath)) {
199
308
  const repo = settingsSourceLabel(repoPath);
200
309
  if (repo) return `${repo} (main repo)`;
201
310
  }
@@ -205,32 +314,32 @@ function workspaceSettingsSourceLabel(worktreePath, repoPath) {
205
314
  // src/store/paths.ts
206
315
  function appDataDir() {
207
316
  const override = process.env.SIDEBOARD_APP_DATA?.trim();
208
- const base = override ? override : process.platform === "darwin" ? join2(homedir2(), "Library", "Application Support", "sideboard") : process.platform === "win32" ? join2(process.env.APPDATA ?? join2(homedir2(), "AppData", "Roaming"), "sideboard") : join2(homedir2(), ".local", "share", "sideboard");
317
+ const base = override ? override : process.platform === "darwin" ? join4(homedir2(), "Library", "Application Support", "sideboard") : process.platform === "win32" ? join4(process.env.APPDATA ?? join4(homedir2(), "AppData", "Roaming"), "sideboard") : join4(homedir2(), ".local", "share", "sideboard");
209
318
  mkdirSync(base, { recursive: true });
210
319
  return base;
211
320
  }
212
321
  function threadsDir() {
213
- const dir = join2(appDataDir(), "threads");
322
+ const dir = join4(appDataDir(), "threads");
214
323
  mkdirSync(dir, { recursive: true });
215
324
  return dir;
216
325
  }
217
326
  function locksDir() {
218
- const dir = join2(appDataDir(), "locks");
327
+ const dir = join4(appDataDir(), "locks");
219
328
  mkdirSync(dir, { recursive: true });
220
329
  return dir;
221
330
  }
222
331
  function sideboardHomeDir() {
223
- const dir = join2(homedir2(), "sideboard");
332
+ const dir = join4(homedir2(), "sideboard");
224
333
  mkdirSync(dir, { recursive: true });
225
334
  return dir;
226
335
  }
227
336
  function sideboardReposDir() {
228
- const dir = join2(sideboardHomeDir(), "repos");
337
+ const dir = join4(sideboardHomeDir(), "repos");
229
338
  mkdirSync(dir, { recursive: true });
230
339
  return dir;
231
340
  }
232
341
  function sideboardWorkspacesDir() {
233
- const dir = join2(sideboardHomeDir(), "workspaces");
342
+ const dir = join4(sideboardHomeDir(), "workspaces");
234
343
  mkdirSync(dir, { recursive: true });
235
344
  return dir;
236
345
  }
@@ -243,23 +352,25 @@ function worktreesRoot(repoPath) {
243
352
  mkdirSync(settings.worktreesRoot, { recursive: true });
244
353
  return settings.worktreesRoot;
245
354
  }
246
- const dir = join2(sideboardWorkspacesDir(), repoSlug(repoPath));
355
+ const dir = join4(sideboardWorkspacesDir(), repoSlug(repoPath));
247
356
  mkdirSync(dir, { recursive: true });
248
357
  return dir;
249
358
  }
250
359
  function threadFilePath(id) {
251
- return join2(threadsDir(), `${id}.json`);
360
+ return join4(threadsDir(), `${id}.json`);
252
361
  }
253
362
  function threadLockPath(id) {
254
- return join2(locksDir(), `${id}.lock`);
363
+ return join4(locksDir(), `${id}.lock`);
255
364
  }
256
365
  function globalAgentCwd() {
257
- const dir = join2(appDataDir(), "global");
366
+ const dir = join4(appDataDir(), "global");
258
367
  mkdirSync(dir, { recursive: true });
259
368
  return dir;
260
369
  }
261
370
 
262
371
  export {
372
+ findConventionSetup,
373
+ runCursorWorktreeSetup,
263
374
  loadRepoSettings,
264
375
  loadWorkspaceSettings,
265
376
  workspaceSettingsSourceLabel,
@@ -7,7 +7,7 @@ import {
7
7
  threadFilePath,
8
8
  threadLockPath,
9
9
  threadsDir
10
- } from "./chunk-7MV3RXSC.js";
10
+ } from "./chunk-JL4SJ6V7.js";
11
11
 
12
12
  // src/store/thread-store.ts
13
13
  import { randomUUID } from "crypto";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-JT7R45JB.js";
4
4
  import {
5
5
  appDataDir
6
- } from "./chunk-M37RITA6.js";
6
+ } from "./chunk-B4R2VB2A.js";
7
7
 
8
8
  // src/store/caffeinate-hold.ts
9
9
  import { spawn } from "child_process";
@@ -2,14 +2,14 @@
2
2
 
3
3
  import {
4
4
  resolveGithubRepoSlug
5
- } from "./chunk-6ZGTM2E7.js";
5
+ } from "./chunk-ZXYWWSHZ.js";
6
6
  import {
7
7
  resolveThreadDefaults
8
- } from "./chunk-AY53MPDE.js";
8
+ } from "./chunk-6LFV4VFI.js";
9
9
  import {
10
10
  globalAgentCwd,
11
11
  sideboardReposDir
12
- } from "./chunk-7MV3RXSC.js";
12
+ } from "./chunk-JL4SJ6V7.js";
13
13
 
14
14
  // src/orchestrator/coordinator-prompt.ts
15
15
  import { mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -58,7 +58,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
58
58
  "Workspaces:",
59
59
  "- add_workspace / remove_workspace \u2014 register or unregister a git repo",
60
60
  "Worktree threads (chats):",
61
- "- create_thread \u2014 create a worktree + chat from branch | pr | ticket; pass repoPath + parentThreadId; omit agent and model to use Sideboard Account defaults (Settings \u2192 Default agent, model & effort). If you are Codex, do not set agent=codex (nested Codex deadlocks)",
61
+ "- create_thread \u2014 create a worktree + chat from branch | pr | ticket; pass repoPath + parentThreadId; omit agent and model to use Sideboard Account defaults (Settings \u2192 Default agent, model & effort). If the repo has a setup script, Sideboard runs it in the background (does not block send_to_thread). If you are Codex, do not set agent=codex (nested Codex deadlocks)",
62
62
  "- fork_worktree \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.",
63
63
  "- fork_chat \u2014 fork a worktree chat (same worktree tab) OR a Global orchestration chat (new orchestration tab); optional agent; leave model unset (Auto) unless you have a reason. Remote coordinators: use this to continue another orchestration chat on a different agent after session limits.",
64
64
  "- send_to_thread \u2014 queue a prompt (start/continue a chat turn); pass force_stop: true to interrupt mid-turn / clear stale queued prompts before replacing with a new request",
@@ -66,7 +66,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
66
66
  "- stop_thread \u2014 force-stop: kill in-flight turn AND clear queued prompts (do not leave stale queue after an interrupt)",
67
67
  "- archive_thread / restore_thread \u2014 archive (tears down worktree when last tab) or restore",
68
68
  "Setup / run:",
69
- "- run_setup \u2014 re-run worktree setup",
69
+ "- run_setup \u2014 re-run worktree setup (already runs automatically on create when a script exists)",
70
70
  "- list_run_scripts / run_dev_script / stop_dev_script \u2014 start/stop named run scripts",
71
71
  "Inspect / review / PRs:",
72
72
  "- get_diff \u2014 compact diff summary",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  appDataDir
3
- } from "./chunk-M37RITA6.js";
3
+ } from "./chunk-B4R2VB2A.js";
4
4
  import {
5
5
  run
6
6
  } from "./chunk-LGXBYZZA.js";
@@ -36,7 +36,7 @@ function saveBrightsyConfig(cfg) {
36
36
 
37
37
  // src/brightsy/accounts.ts
38
38
  async function loadConnectedTeams() {
39
- const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-BNBM7OIC.js");
39
+ const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-SWHJWK2A.js");
40
40
  return listConnectedBrightsyTeams2();
41
41
  }
42
42
  async function runBrightsyTeamsJson(args) {
@@ -68,7 +68,7 @@ async function getBrightsySession() {
68
68
  const data = await runBrightsyTeamsJson([]);
69
69
  const accounts = Array.isArray(data.teams) ? data.teams : [];
70
70
  const active = data.active ?? accounts.find((a) => a.active) ?? null;
71
- const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-BNBM7OIC.js");
71
+ const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-SWHJWK2A.js");
72
72
  const connectedTeams = ensureCliTeamTracked2(
73
73
  active ? { id: active.id, slug: active.slug, name: active.name } : void 0
74
74
  );
@@ -108,7 +108,7 @@ async function performBrightsyAccountSwitch(accountIdOrSlug) {
108
108
  return { cfg, target: data.active };
109
109
  }
110
110
  async function switchBrightsyAccount(accountIdOrSlug) {
111
- const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-BNBM7OIC.js");
111
+ const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-SWHJWK2A.js");
112
112
  await connectBrightsyTeam2(accountIdOrSlug);
113
113
  return getBrightsySession();
114
114
  }