@sideboard-ai/core 0.1.330 → 0.1.332

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.js +2 -2
  2. package/dist/{agents-JXQKHY7Q.js → agents-5FB756FF.js} +8 -8
  3. package/dist/{agents-JH4WV2ZH.js → agents-XEVZ6RY2.js} +7 -7
  4. package/dist/{chunk-NQHTYX35.js → chunk-25KXB7W6.js} +1 -1
  5. package/dist/{chunk-DFKLWWLY.js → chunk-3MOUHIA2.js} +6 -6
  6. package/dist/{chunk-PZ5MVD27.js → chunk-5G5DTQ5N.js} +5 -5
  7. package/dist/{chunk-O7JSWISN.js → chunk-5MJ7FCZ2.js} +1 -1
  8. package/dist/{chunk-DBRQ5NNB.js → chunk-6HGTYZGL.js} +5 -5
  9. package/dist/{chunk-QKHEVSB5.js → chunk-BMRJNRQK.js} +1 -1
  10. package/dist/{chunk-JQWCZGSO.js → chunk-CS6LQUL6.js} +110 -11
  11. package/dist/{chunk-E6LONPQH.js → chunk-E5DFGOAA.js} +39 -27
  12. package/dist/{chunk-KUD24QYI.js → chunk-EHZ24J7U.js} +5 -5
  13. package/dist/{chunk-4YXZOXMT.js → chunk-GK7H3SY7.js} +1 -1
  14. package/dist/{chunk-6U6QRUHY.js → chunk-I6RGRUNY.js} +1 -1
  15. package/dist/{chunk-P4QRDXRY.js → chunk-JJRTVB7D.js} +2 -2
  16. package/dist/{chunk-HCK3UCBJ.js → chunk-KYHW5WYT.js} +42 -29
  17. package/dist/{chunk-U7EANR52.js → chunk-P7S3XGKL.js} +2 -2
  18. package/dist/{chunk-XOIJJRAQ.js → chunk-QNKJCD7B.js} +110 -11
  19. package/dist/{chunk-2TUE6JKQ.js → chunk-R4W4VQJZ.js} +2 -0
  20. package/dist/{chunk-7L36GZA4.js → chunk-RCRDNOAT.js} +1 -1
  21. package/dist/{chunk-YBTSZ2SW.js → chunk-TL2HK6LZ.js} +2 -0
  22. package/dist/{chunk-G45SGI57.js → chunk-UEPTL7UG.js} +1 -1
  23. package/dist/{chunk-NURZOXGN.js → chunk-UGUWFONI.js} +1 -1
  24. package/dist/{chunk-3DJQLQWU.js → chunk-UV33UCV6.js} +3 -3
  25. package/dist/{chunk-S5CJUIPY.js → chunk-XOEKCE6L.js} +5 -5
  26. package/dist/{conductor-FA27ZGCV.js → conductor-5OTVFON5.js} +5 -5
  27. package/dist/{conductor-6DIR7A4N.js → conductor-CVQJEAKE.js} +5 -5
  28. package/dist/{connected-teams-H4LZOJDC.js → connected-teams-2YDE2EZ2.js} +2 -2
  29. package/dist/{connected-teams-XYRZMQO4.js → connected-teams-6756SMAW.js} +2 -2
  30. package/dist/{coordinator-prompt-B6RHGEJK.js → coordinator-prompt-OD6VYETQ.js} +4 -4
  31. package/dist/{coordinator-prompt-KAZXK5FZ.js → coordinator-prompt-XU5KFYI5.js} +4 -4
  32. package/dist/{global-workspace-JKINHUY3.js → global-workspace-EW54B2P4.js} +4 -4
  33. package/dist/{global-workspace-IOKHZCXD.js → global-workspace-P2BW6MJ3.js} +4 -4
  34. package/dist/index.cjs +300 -178
  35. package/dist/index.d.cts +6 -1
  36. package/dist/index.d.ts +6 -1
  37. package/dist/index.js +17 -15
  38. package/dist/mcp/run-stdio.cjs +210 -159
  39. package/dist/mcp/run-stdio.js +10 -10
  40. package/dist/{optional-cli-FOSC4NVE.js → optional-cli-KWIII44P.js} +3 -3
  41. package/dist/{optional-cli-NSQZ2DYK.js → optional-cli-XJE4BELL.js} +4 -4
  42. package/dist/{orchestrator-LI6EBD2Y.js → orchestrator-5X62LJ2T.js} +11 -11
  43. package/dist/{orchestrator-V35TLMXB.js → orchestrator-UKAXA5ZW.js} +10 -10
  44. package/dist/{run-7QMRYP3F.js → run-ARDGUXUN.js} +1 -1
  45. package/dist/{run-UPNCCRCN.js → run-ZKK3VGO5.js} +1 -1
  46. package/dist/{workspaces-OLONQF2C.js → workspaces-CB4SCKVH.js} +4 -4
  47. package/dist/{workspaces-FJL3TL3K.js → workspaces-OY7JIPDE.js} +4 -4
  48. package/dist/{worktree-TX4WXQZV.js → worktree-6WWUWH4K.js} +3 -3
  49. package/dist/{worktree-QSQJ2POO.js → worktree-N435EXSP.js} +3 -3
  50. package/dist/{worktree-exclude-P5NJODWP.js → worktree-exclude-KMZQXZKP.js} +2 -2
  51. package/dist/{worktree-exclude-INRDQFWV.js → worktree-exclude-YQBN43QD.js} +2 -2
  52. package/package.json +1 -1
@@ -2420,6 +2420,8 @@ var init_path = __esm({
2420
2420
  import_node_path9 = require("path");
2421
2421
  EXTRA_BIN_DIRS = [
2422
2422
  ".local/bin",
2423
+ // Official OpenCode installer (`curl https://opencode.ai/install | bash`).
2424
+ ".opencode/bin",
2423
2425
  ".cargo/bin",
2424
2426
  ".nvm/current/bin",
2425
2427
  ".asdf/shims",
@@ -18302,6 +18304,15 @@ var init_claude_usage_client = __esm({
18302
18304
  }
18303
18305
  });
18304
18306
 
18307
+ // src/agents/install-native.ts
18308
+ var init_install_native = __esm({
18309
+ "src/agents/install-native.ts"() {
18310
+ "use strict";
18311
+ init_run();
18312
+ init_install();
18313
+ }
18314
+ });
18315
+
18305
18316
  // src/agents/install.ts
18306
18317
  async function prepareTerminalCommand(command) {
18307
18318
  enrichPathWithNpmGlobalBin();
@@ -18393,7 +18404,17 @@ async function installNpmGlobalPackage(opts) {
18393
18404
  }
18394
18405
  }
18395
18406
  enrichPathWithNpmGlobalBin();
18396
- const binPath = opts.cliBin ? await whichOnPath(opts.cliBin) : null;
18407
+ const binPath = opts.cliBin ? await resolveCliAfterNpmInstall(opts.cliBin) : null;
18408
+ if (opts.cliBin && !binPath) {
18409
+ return {
18410
+ ok: false,
18411
+ command: opts.installCommand,
18412
+ exitCode: 0,
18413
+ stdout: result.stdout,
18414
+ stderr: result.stderr,
18415
+ message: `Installed ${opts.npmPackage}, but \`${opts.cliBin}\` is not on PATH.`
18416
+ };
18417
+ }
18397
18418
  return {
18398
18419
  ok: true,
18399
18420
  command: opts.installCommand,
@@ -18401,16 +18422,34 @@ async function installNpmGlobalPackage(opts) {
18401
18422
  stdout: result.stdout,
18402
18423
  stderr: result.stderr,
18403
18424
  // Library-only packages (`@cursor/sdk`) have no CLI to look for.
18404
- message: !opts.cliBin ? `Installed ${opts.npmPackage}` : binPath ? `Installed ${opts.npmPackage} \u2192 ${binPath}` : `Installed ${opts.npmPackage} (CLI not yet on PATH)`
18425
+ message: !opts.cliBin ? `Installed ${opts.npmPackage}` : `Installed ${opts.npmPackage} \u2192 ${binPath}`
18405
18426
  };
18406
18427
  }
18407
- var import_node_fs45;
18428
+ async function resolveCliAfterNpmInstall(cliBin) {
18429
+ const found = await whichOnPath(cliBin);
18430
+ if (found) return found;
18431
+ const prefix = await run("npm", ["prefix", "-g"], { reject: false, timeoutMs: 8e3 });
18432
+ if (prefix.exitCode !== 0) return null;
18433
+ const root = prefix.stdout.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.startsWith("/")).pop();
18434
+ if (!root) return null;
18435
+ const candidate = (0, import_node_path46.join)(root, "bin", cliBin);
18436
+ if (!(0, import_node_fs45.existsSync)(candidate)) return null;
18437
+ try {
18438
+ (0, import_node_fs45.chmodSync)(candidate, 493);
18439
+ } catch {
18440
+ }
18441
+ enrichPathWithNpmGlobalBin();
18442
+ return whichOnPath(cliBin);
18443
+ }
18444
+ var import_node_fs45, import_node_path46;
18408
18445
  var init_install = __esm({
18409
18446
  "src/agents/install.ts"() {
18410
18447
  "use strict";
18411
18448
  import_node_fs45 = require("fs");
18449
+ import_node_path46 = require("path");
18412
18450
  init_run();
18413
18451
  init_app_settings();
18452
+ init_install_native();
18414
18453
  init_path();
18415
18454
  }
18416
18455
  });
@@ -18512,7 +18551,7 @@ function isAgentHostEnvKey(key) {
18512
18551
  }
18513
18552
  function stripHostToolingPath(pathValue) {
18514
18553
  if (!pathValue?.trim()) return "";
18515
- return pathValue.split(import_node_path46.delimiter).filter((part) => part && !HOST_PATH_NOISE.test(part.replace(/\\/g, "/"))).join(import_node_path46.delimiter);
18554
+ return pathValue.split(import_node_path47.delimiter).filter((part) => part && !HOST_PATH_NOISE.test(part.replace(/\\/g, "/"))).join(import_node_path47.delimiter);
18516
18555
  }
18517
18556
  function sanitizeAgentHostEnv(env, cwd) {
18518
18557
  for (const key of Object.keys(env)) {
@@ -18526,11 +18565,11 @@ function sanitizeAgentHostEnv(env, cwd) {
18526
18565
  }
18527
18566
  return env;
18528
18567
  }
18529
- var import_node_path46, DROP_EXACT, DROP_PREFIXES, HOST_PATH_NOISE;
18568
+ var import_node_path47, DROP_EXACT, DROP_PREFIXES, HOST_PATH_NOISE;
18530
18569
  var init_agent_host_env = __esm({
18531
18570
  "src/hook/agent-host-env.ts"() {
18532
18571
  "use strict";
18533
- import_node_path46 = require("path");
18572
+ import_node_path47 = require("path");
18534
18573
  DROP_EXACT = /* @__PURE__ */ new Set([
18535
18574
  "NODE_PATH",
18536
18575
  "NODE_ENV_ELECTRON_VITE",
@@ -18569,15 +18608,15 @@ var init_agent_host_env = __esm({
18569
18608
 
18570
18609
  // src/hook/worktree-pkg-cache.ts
18571
18610
  function worktreePkgCacheRoot(worktreePath) {
18572
- return (0, import_node_path47.join)(worktreePath, WORKTREE_PKG_CACHE_REL);
18611
+ return (0, import_node_path48.join)(worktreePath, WORKTREE_PKG_CACHE_REL);
18573
18612
  }
18574
18613
  function worktreePkgCacheEnv(worktreePath) {
18575
18614
  const root = worktreePkgCacheRoot(worktreePath);
18576
- const store = (0, import_node_path47.join)(root, "pnpm-store");
18577
- const pnpmCache = (0, import_node_path47.join)(root, "pnpm");
18578
- const npmCache = (0, import_node_path47.join)(root, "npm");
18579
- const nodeGyp = (0, import_node_path47.join)(root, "node-gyp");
18580
- const electron = (0, import_node_path47.join)(root, "electron");
18615
+ const store = (0, import_node_path48.join)(root, "pnpm-store");
18616
+ const pnpmCache = (0, import_node_path48.join)(root, "pnpm");
18617
+ const npmCache = (0, import_node_path48.join)(root, "npm");
18618
+ const nodeGyp = (0, import_node_path48.join)(root, "node-gyp");
18619
+ const electron = (0, import_node_path48.join)(root, "electron");
18581
18620
  return {
18582
18621
  npm_config_store_dir: store,
18583
18622
  PNPM_STORE_DIR: store,
@@ -18613,12 +18652,12 @@ function applyWorktreePkgCacheEnv(env, worktreePath) {
18613
18652
  fillGroup(env, ["electron_config_cache"], next);
18614
18653
  ensureWorktreePkgCacheDirs(cwd);
18615
18654
  }
18616
- var import_node_fs46, import_node_path47, WORKTREE_PKG_CACHE_REL;
18655
+ var import_node_fs46, import_node_path48, WORKTREE_PKG_CACHE_REL;
18617
18656
  var init_worktree_pkg_cache = __esm({
18618
18657
  "src/hook/worktree-pkg-cache.ts"() {
18619
18658
  "use strict";
18620
18659
  import_node_fs46 = require("fs");
18621
- import_node_path47 = require("path");
18660
+ import_node_path48 = require("path");
18622
18661
  WORKTREE_PKG_CACHE_REL = ".context/.sideboard/pkg-cache";
18623
18662
  }
18624
18663
  });
@@ -20063,12 +20102,12 @@ function readTextIfPresent(abs) {
20063
20102
  }
20064
20103
  }
20065
20104
  function readLocalGuidelines(worktreePath) {
20066
- const localAbs = (0, import_node_path48.join)(worktreePath, REVIEW_REQUEST_PATH);
20105
+ const localAbs = (0, import_node_path49.join)(worktreePath, REVIEW_REQUEST_PATH);
20067
20106
  const localContent = readTextIfPresent(localAbs);
20068
20107
  if (localContent && !shouldRefreshReviewRequestTemplate(localContent)) {
20069
20108
  return { path: REVIEW_REQUEST_PATH, content: localContent };
20070
20109
  }
20071
- const legacyAbs = (0, import_node_path48.join)(worktreePath, LEGACY_REVIEW_REQUEST_PATH);
20110
+ const legacyAbs = (0, import_node_path49.join)(worktreePath, LEGACY_REVIEW_REQUEST_PATH);
20072
20111
  const legacyContent = readTextIfPresent(legacyAbs);
20073
20112
  if (legacyContent && !shouldRefreshReviewRequestTemplate(legacyContent)) {
20074
20113
  return { path: LEGACY_REVIEW_REQUEST_PATH, content: legacyContent };
@@ -20092,27 +20131,27 @@ function contextGuidelines(content, source) {
20092
20131
  };
20093
20132
  }
20094
20133
  function writeContextGuidelines(worktreePath, content) {
20095
- const abs = (0, import_node_path48.join)(worktreePath, CONTEXT_REVIEW_PATH);
20096
- (0, import_node_fs48.mkdirSync)((0, import_node_path48.dirname)(abs), { recursive: true });
20134
+ const abs = (0, import_node_path49.join)(worktreePath, CONTEXT_REVIEW_PATH);
20135
+ (0, import_node_fs48.mkdirSync)((0, import_node_path49.dirname)(abs), { recursive: true });
20097
20136
  const body = content.endsWith("\n") ? content : `${content}
20098
20137
  `;
20099
20138
  (0, import_node_fs48.writeFileSync)(abs, body, "utf8");
20100
20139
  return body;
20101
20140
  }
20102
20141
  function readSideboardReview(worktreePath, repoPath) {
20103
- const fromWorktree = readTextIfPresent((0, import_node_path48.join)(worktreePath, REPO_REVIEW_PATH));
20142
+ const fromWorktree = readTextIfPresent((0, import_node_path49.join)(worktreePath, REPO_REVIEW_PATH));
20104
20143
  if (fromWorktree) return fromWorktree;
20105
20144
  const repo = repoPath?.replace(/\/+$/, "");
20106
20145
  const wt = worktreePath.replace(/\/+$/, "");
20107
20146
  if (!repo || repo === wt) return null;
20108
- return readTextIfPresent((0, import_node_path48.join)(repo, REPO_REVIEW_PATH));
20147
+ return readTextIfPresent((0, import_node_path49.join)(repo, REPO_REVIEW_PATH));
20109
20148
  }
20110
20149
  function ensureReviewGuidelinesFile(worktreePath, repoPath) {
20111
- const skillContent = readTextIfPresent((0, import_node_path48.join)(worktreePath, REVIEW_SKILL_PATH));
20150
+ const skillContent = readTextIfPresent((0, import_node_path49.join)(worktreePath, REVIEW_SKILL_PATH));
20112
20151
  if (skillContent) {
20113
20152
  return { ...skillGuidelines(skillContent, "skill"), wrote: false };
20114
20153
  }
20115
- const contextContent = readTextIfPresent((0, import_node_path48.join)(worktreePath, CONTEXT_REVIEW_PATH));
20154
+ const contextContent = readTextIfPresent((0, import_node_path49.join)(worktreePath, CONTEXT_REVIEW_PATH));
20116
20155
  if (contextContent && !shouldRefreshReviewRequestTemplate(contextContent)) {
20117
20156
  return { ...contextGuidelines(contextContent, "local"), wrote: false };
20118
20157
  }
@@ -20188,13 +20227,13 @@ async function requestReview(threadRef, send) {
20188
20227
  const started = await send(tab.id, REVIEW_REQUEST_PREFILL);
20189
20228
  return { tab: started, from };
20190
20229
  }
20191
- var import_node_crypto12, import_node_fs48, import_node_path48, REPO_REVIEW_PATH, REPO_REVIEW_NAME, CONTEXT_REVIEW_PATH, REVIEW_REQUEST_PATH, LEGACY_REVIEW_REQUEST_PATH, REVIEW_REQUEST_NAME, REVIEW_REQUEST_PREFILL, LEGACY_REVIEW_TEMPLATE_MARKERS;
20230
+ var import_node_crypto12, import_node_fs48, import_node_path49, REPO_REVIEW_PATH, REPO_REVIEW_NAME, CONTEXT_REVIEW_PATH, REVIEW_REQUEST_PATH, LEGACY_REVIEW_REQUEST_PATH, REVIEW_REQUEST_NAME, REVIEW_REQUEST_PREFILL, LEGACY_REVIEW_TEMPLATE_MARKERS;
20192
20231
  var init_request_review = __esm({
20193
20232
  "src/review/request-review.ts"() {
20194
20233
  "use strict";
20195
20234
  import_node_crypto12 = require("crypto");
20196
20235
  import_node_fs48 = require("fs");
20197
- import_node_path48 = require("path");
20236
+ import_node_path49 = require("path");
20198
20237
  init_global_workspace();
20199
20238
  init_chat_tabs();
20200
20239
  init_thread_store();
@@ -20217,7 +20256,7 @@ var init_request_review = __esm({
20217
20256
 
20218
20257
  // src/hook/worktree-run-ports.ts
20219
20258
  function worktreeRunPortsPath(worktreePath) {
20220
- return (0, import_node_path49.join)(worktreePath, RUN_PORTS_REL);
20259
+ return (0, import_node_path50.join)(worktreePath, RUN_PORTS_REL);
20221
20260
  }
20222
20261
  function isPort(value) {
20223
20262
  return typeof value === "number" && Number.isInteger(value) && value > 0 && value <= 65535;
@@ -20275,16 +20314,16 @@ function saveWorktreeRunPorts(worktreePath, scriptName, ports) {
20275
20314
  }
20276
20315
  const scripts = { ...current.scripts ?? {} };
20277
20316
  scripts[scriptName] = cleaned;
20278
- (0, import_node_fs49.mkdirSync)((0, import_node_path49.dirname)(path), { recursive: true });
20317
+ (0, import_node_fs49.mkdirSync)((0, import_node_path50.dirname)(path), { recursive: true });
20279
20318
  (0, import_node_fs49.writeFileSync)(path, `${JSON.stringify({ scripts }, null, 2)}
20280
20319
  `, "utf8");
20281
20320
  }
20282
- var import_node_fs49, import_node_path49, RUN_PORTS_REL;
20321
+ var import_node_fs49, import_node_path50, RUN_PORTS_REL;
20283
20322
  var init_worktree_run_ports = __esm({
20284
20323
  "src/hook/worktree-run-ports.ts"() {
20285
20324
  "use strict";
20286
20325
  import_node_fs49 = require("fs");
20287
- import_node_path49 = require("path");
20326
+ import_node_path50 = require("path");
20288
20327
  RUN_PORTS_REL = ".context/.sideboard/run-ports.json";
20289
20328
  }
20290
20329
  });
@@ -20336,7 +20375,7 @@ function readIntFile(file) {
20336
20375
  return Number.isInteger(n) ? n : null;
20337
20376
  }
20338
20377
  function jobDir(root, id, legacy = false) {
20339
- return (0, import_node_path50.join)(root, legacy ? LEGACY_DETACHED_JOBS_DIR : DETACHED_JOBS_DIR, id);
20378
+ return (0, import_node_path51.join)(root, legacy ? LEGACY_DETACHED_JOBS_DIR : DETACHED_JOBS_DIR, id);
20340
20379
  }
20341
20380
  function resolveJobDir(root, id) {
20342
20381
  const modern = jobDir(root, id, false);
@@ -20346,7 +20385,7 @@ function resolveJobDir(root, id) {
20346
20385
  return modern;
20347
20386
  }
20348
20387
  function listJobIdsIn(root, rel) {
20349
- const dir = (0, import_node_path50.join)(root, rel);
20388
+ const dir = (0, import_node_path51.join)(root, rel);
20350
20389
  if (!(0, import_node_fs50.existsSync)(dir)) return [];
20351
20390
  return (0, import_node_fs50.readdirSync)(dir, { withFileTypes: true }).filter((e) => e.isDirectory() && JOB_ID_RE.test(e.name)).map((e) => e.name);
20352
20391
  }
@@ -20360,7 +20399,7 @@ function listRunningDetachedJobs(worktreePath) {
20360
20399
  const running = [];
20361
20400
  for (const id of ids) {
20362
20401
  const dir = resolveJobDir(root, id);
20363
- const pid = readIntFile((0, import_node_path50.join)(dir, "pid"));
20402
+ const pid = readIntFile((0, import_node_path51.join)(dir, "pid"));
20364
20403
  if (jobTreeAlive(pid)) running.push(id);
20365
20404
  }
20366
20405
  return running.sort();
@@ -20467,15 +20506,15 @@ function takeDelta(logFile, cursorFile) {
20467
20506
  return { delta: capJobLogDelta(lines.slice(start).join("\n")), nextCursor: lines.length };
20468
20507
  }
20469
20508
  function snapshotJob(dir) {
20470
- const pid = readIntFile((0, import_node_path50.join)(dir, "pid"));
20509
+ const pid = readIntFile((0, import_node_path51.join)(dir, "pid"));
20471
20510
  const running = jobTreeAlive(pid);
20472
20511
  return {
20473
20512
  pid,
20474
20513
  running,
20475
- exitCode: readIntFile((0, import_node_path50.join)(dir, "exit")),
20476
- log: (0, import_node_path50.join)(dir, "log"),
20477
- cursor: (0, import_node_path50.join)(dir, "present.cursor"),
20478
- progress: tailProgress((0, import_node_path50.join)(dir, "log"))
20514
+ exitCode: readIntFile((0, import_node_path51.join)(dir, "exit")),
20515
+ log: (0, import_node_path51.join)(dir, "log"),
20516
+ cursor: (0, import_node_path51.join)(dir, "present.cursor"),
20517
+ progress: tailProgress((0, import_node_path51.join)(dir, "log"))
20479
20518
  };
20480
20519
  }
20481
20520
  function toResult(id, snap, extra) {
@@ -20484,7 +20523,7 @@ function toResult(id, snap, extra) {
20484
20523
  const stillRunning = snap.running && !ok;
20485
20524
  const { delta, nextCursor } = takeDelta(snap.log, snap.cursor);
20486
20525
  try {
20487
- (0, import_node_fs50.mkdirSync)((0, import_node_path50.dirname)(snap.cursor), { recursive: true });
20526
+ (0, import_node_fs50.mkdirSync)((0, import_node_path51.dirname)(snap.cursor), { recursive: true });
20488
20527
  (0, import_node_fs50.writeFileSync)(snap.cursor, `${nextCursor}
20489
20528
  `);
20490
20529
  } catch {
@@ -20560,7 +20599,7 @@ function killProcessTree(pid, signal) {
20560
20599
  }
20561
20600
  function appendJobLog(logFile, line) {
20562
20601
  try {
20563
- (0, import_node_fs50.mkdirSync)((0, import_node_path50.dirname)(logFile), { recursive: true });
20602
+ (0, import_node_fs50.mkdirSync)((0, import_node_path51.dirname)(logFile), { recursive: true });
20564
20603
  const body = line.endsWith("\n") ? line : `${line}
20565
20604
  `;
20566
20605
  (0, import_node_fs50.appendFileSync)(logFile, body);
@@ -20609,7 +20648,7 @@ async function stopDetachedJob(cwd, id, opts) {
20609
20648
  killProcessTree(targetPid, "SIGKILL");
20610
20649
  await sleep(100);
20611
20650
  }
20612
- const exitFile = (0, import_node_path50.join)(dir, "exit");
20651
+ const exitFile = (0, import_node_path51.join)(dir, "exit");
20613
20652
  if (!(0, import_node_fs50.existsSync)(exitFile)) {
20614
20653
  try {
20615
20654
  (0, import_node_fs50.writeFileSync)(exitFile, "1\n");
@@ -20632,12 +20671,12 @@ async function stopDetachedJob(cwd, id, opts) {
20632
20671
  hint: stopped ? MCP_STOP_JOB_HINT : MCP_WAIT_JOB_STILL_RUNNING_HINT
20633
20672
  };
20634
20673
  }
20635
- var import_node_fs50, import_node_path50, MAX_JOB_CONTINUES, MAX_JOB_DELTA_LINES, MAX_JOB_DELTA_CHARS, DEFERRED_DONE_MAX_CHARS, GH_WATCH_REFRESH, MCP_WAIT_JOB_STILL_RUNNING_HINT, MCP_STOP_JOB_HINT, JOB_ID_RE;
20674
+ var import_node_fs50, import_node_path51, MAX_JOB_CONTINUES, MAX_JOB_DELTA_LINES, MAX_JOB_DELTA_CHARS, DEFERRED_DONE_MAX_CHARS, GH_WATCH_REFRESH, MCP_WAIT_JOB_STILL_RUNNING_HINT, MCP_STOP_JOB_HINT, JOB_ID_RE;
20636
20675
  var init_wait_for_job = __esm({
20637
20676
  "src/mcp/wait-for-job.ts"() {
20638
20677
  "use strict";
20639
20678
  import_node_fs50 = require("fs");
20640
- import_node_path50 = require("path");
20679
+ import_node_path51 = require("path");
20641
20680
  init_workspace_scratch();
20642
20681
  init_job_process();
20643
20682
  init_wait_for_turn();
@@ -20913,7 +20952,7 @@ function matchSimpleGlob(pattern, name) {
20913
20952
  return new RegExp(`^${escaped}$`).test(name);
20914
20953
  }
20915
20954
  function readWorktreeInclude(repoPath) {
20916
- const path = (0, import_node_path51.join)(repoPath, ".worktreeinclude");
20955
+ const path = (0, import_node_path52.join)(repoPath, ".worktreeinclude");
20917
20956
  if (!(0, import_node_fs51.existsSync)(path)) return [];
20918
20957
  return (0, import_node_fs51.readFileSync)(path, "utf8").split("\n").map((l) => l.trim()).filter((l) => l && !l.startsWith("#"));
20919
20958
  }
@@ -20928,7 +20967,7 @@ function resolveFilesToCopy(repoPath) {
20928
20967
  for (const entry of (0, import_node_fs51.readdirSync)(repoPath, { withFileTypes: true })) {
20929
20968
  if (!entry.isFile()) continue;
20930
20969
  for (const glob of settings.fileIncludeGlobs) {
20931
- if (matchSimpleGlob(glob, entry.name) || matchSimpleGlob((0, import_node_path51.basename)(glob), entry.name)) {
20970
+ if (matchSimpleGlob(glob, entry.name) || matchSimpleGlob((0, import_node_path52.basename)(glob), entry.name)) {
20932
20971
  matched.push(entry.name);
20933
20972
  break;
20934
20973
  }
@@ -20954,10 +20993,10 @@ function copyConfiguredFiles(repoPath, worktreePath) {
20954
20993
  const patterns = resolveFilesToCopy(repoPath);
20955
20994
  const copied = [];
20956
20995
  for (const rel of patterns) {
20957
- const src = (0, import_node_path51.join)(repoPath, rel);
20996
+ const src = (0, import_node_path52.join)(repoPath, rel);
20958
20997
  if (!(0, import_node_fs51.existsSync)(src)) continue;
20959
- const dest = (0, import_node_path51.join)(worktreePath, rel);
20960
- (0, import_node_fs51.mkdirSync)((0, import_node_path51.dirname)(dest), { recursive: true });
20998
+ const dest = (0, import_node_path52.join)(worktreePath, rel);
20999
+ (0, import_node_fs51.mkdirSync)((0, import_node_path52.dirname)(dest), { recursive: true });
20961
21000
  (0, import_node_fs51.copyFileSync)(src, dest);
20962
21001
  copied.push(rel);
20963
21002
  }
@@ -20971,7 +21010,7 @@ function linkSharedDirectories(repoPath, worktreePath) {
20971
21010
  for (const rel of dirs) {
20972
21011
  if (!isSafeRelativeDir(rel)) continue;
20973
21012
  if (!isGitignored(repoPath, rel)) continue;
20974
- const src = (0, import_node_path51.join)(repoPath, rel);
21013
+ const src = (0, import_node_path52.join)(repoPath, rel);
20975
21014
  let srcStat;
20976
21015
  try {
20977
21016
  srcStat = (0, import_node_fs51.lstatSync)(src);
@@ -20979,9 +21018,9 @@ function linkSharedDirectories(repoPath, worktreePath) {
20979
21018
  continue;
20980
21019
  }
20981
21020
  if (!srcStat.isDirectory()) continue;
20982
- const dest = (0, import_node_path51.join)(worktreePath, rel);
21021
+ const dest = (0, import_node_path52.join)(worktreePath, rel);
20983
21022
  if ((0, import_node_fs51.existsSync)(dest)) continue;
20984
- (0, import_node_fs51.mkdirSync)((0, import_node_path51.dirname)(dest), { recursive: true });
21023
+ (0, import_node_fs51.mkdirSync)((0, import_node_path52.dirname)(dest), { recursive: true });
20985
21024
  try {
20986
21025
  (0, import_node_fs51.symlinkSync)(src, dest);
20987
21026
  } catch {
@@ -20995,11 +21034,11 @@ function samePath(a, b) {
20995
21034
  try {
20996
21035
  return (0, import_node_fs51.realpathSync)(a) === (0, import_node_fs51.realpathSync)(b);
20997
21036
  } catch {
20998
- return (0, import_node_path51.resolve)(a) === (0, import_node_path51.resolve)(b);
21037
+ return (0, import_node_path52.resolve)(a) === (0, import_node_path52.resolve)(b);
20999
21038
  }
21000
21039
  }
21001
21040
  function isSafeRelativeDir(rel) {
21002
- if (!rel || (0, import_node_path51.isAbsolute)(rel)) return false;
21041
+ if (!rel || (0, import_node_path52.isAbsolute)(rel)) return false;
21003
21042
  const parts = rel.split(/[\\/]/).filter(Boolean);
21004
21043
  return parts.length > 0 && parts.every((part) => part !== "." && part !== "..");
21005
21044
  }
@@ -21041,7 +21080,7 @@ function buildWorkspaceScriptEnv(opts, baseEnv) {
21041
21080
  const env = stripNestedElectronEnv({
21042
21081
  ...baseEnv ?? process.env
21043
21082
  });
21044
- const name = opts.workspaceName ?? (0, import_node_path51.basename)(opts.worktreePath);
21083
+ const name = opts.workspaceName ?? (0, import_node_path52.basename)(opts.worktreePath);
21045
21084
  const ports = opts.ports ?? [];
21046
21085
  const primary = ports[0];
21047
21086
  env.SIDEBOARD_WORKSPACE_NAME = name;
@@ -21112,18 +21151,18 @@ function realpathOrResolve(path) {
21112
21151
  try {
21113
21152
  return (0, import_node_fs51.realpathSync)(path);
21114
21153
  } catch {
21115
- return (0, import_node_path51.resolve)(path);
21154
+ return (0, import_node_path52.resolve)(path);
21116
21155
  }
21117
21156
  }
21118
21157
  function isOtherWorktreeListenerCwd(cwd, worktreePath) {
21119
21158
  const wt = realpathOrResolve(worktreePath);
21120
21159
  const c = realpathOrResolve(cwd);
21121
- if (c === wt || c.startsWith(wt + import_node_path51.sep)) return false;
21122
- const parent = (0, import_node_path51.dirname)(wt);
21123
- const thisName = (0, import_node_path51.basename)(wt);
21160
+ if (c === wt || c.startsWith(wt + import_node_path52.sep)) return false;
21161
+ const parent = (0, import_node_path52.dirname)(wt);
21162
+ const thisName = (0, import_node_path52.basename)(wt);
21124
21163
  if (!thisName || c === parent) return false;
21125
- if (!c.startsWith(parent + import_node_path51.sep)) return false;
21126
- const first = c.slice(parent.length + 1).split(import_node_path51.sep)[0];
21164
+ if (!c.startsWith(parent + import_node_path52.sep)) return false;
21165
+ const first = c.slice(parent.length + 1).split(import_node_path52.sep)[0];
21127
21166
  return Boolean(first) && first !== thisName;
21128
21167
  }
21129
21168
  function signalPid(pid, signal) {
@@ -21135,7 +21174,7 @@ function signalPid(pid, signal) {
21135
21174
  function isThisWorktreeListenerCwd(cwd, worktreePath) {
21136
21175
  const wt = realpathOrResolve(worktreePath);
21137
21176
  const c = realpathOrResolve(cwd);
21138
- return c === wt || c.startsWith(wt + import_node_path51.sep);
21177
+ return c === wt || c.startsWith(wt + import_node_path52.sep);
21139
21178
  }
21140
21179
  function killDetachedRunTree(pid, worktreePath) {
21141
21180
  if (!Number.isFinite(pid) || pid <= 1 || pid === process.pid) return;
@@ -21387,13 +21426,13 @@ async function startDevServer(repoPath, worktreePath, onLine, opts) {
21387
21426
  throw err;
21388
21427
  }
21389
21428
  }
21390
- var import_node_fs51, import_node_child_process5, import_node_path51, import_execa4, import_node_readline3, cachedLoginEnv;
21429
+ var import_node_fs51, import_node_child_process5, import_node_path52, import_execa4, import_node_readline3, cachedLoginEnv;
21391
21430
  var init_conductor = __esm({
21392
21431
  "src/hook/conductor.ts"() {
21393
21432
  "use strict";
21394
21433
  import_node_fs51 = require("fs");
21395
21434
  import_node_child_process5 = require("child_process");
21396
- import_node_path51 = require("path");
21435
+ import_node_path52 = require("path");
21397
21436
  import_execa4 = require("execa");
21398
21437
  import_node_readline3 = require("readline");
21399
21438
  init_settings();
@@ -21446,7 +21485,7 @@ function materialize(mem) {
21446
21485
  };
21447
21486
  }
21448
21487
  function setupLogPath(threadId) {
21449
- return (0, import_node_path52.join)(threadsDir(), `${threadId}.setup.log.json`);
21488
+ return (0, import_node_path53.join)(threadsDir(), `${threadId}.setup.log.json`);
21450
21489
  }
21451
21490
  function setupLogKeyForWorktree(worktreePath) {
21452
21491
  const norm = normalizeWorktreePath(worktreePath);
@@ -21543,13 +21582,13 @@ function finishSetupLog(threadId, exitCode, source) {
21543
21582
  persistNow(threadId);
21544
21583
  return materialize(mem);
21545
21584
  }
21546
- var import_node_crypto13, import_node_fs52, import_node_path52, EMPTY, MAX_SETUP_LOG_CHARS, memory, persistTimers, PERSIST_DEBOUNCE_MS;
21585
+ var import_node_crypto13, import_node_fs52, import_node_path53, EMPTY, MAX_SETUP_LOG_CHARS, memory, persistTimers, PERSIST_DEBOUNCE_MS;
21547
21586
  var init_setup_log = __esm({
21548
21587
  "src/store/setup-log.ts"() {
21549
21588
  "use strict";
21550
21589
  import_node_crypto13 = require("crypto");
21551
21590
  import_node_fs52 = require("fs");
21552
- import_node_path52 = require("path");
21591
+ import_node_path53 = require("path");
21553
21592
  init_worktree_labels();
21554
21593
  init_paths();
21555
21594
  EMPTY = {
@@ -21594,7 +21633,7 @@ function safeScriptToken(scriptName) {
21594
21633
  return token || "dev";
21595
21634
  }
21596
21635
  function runLogPath(key) {
21597
- return (0, import_node_path53.join)(threadsDir(), `${key}.run.log.json`);
21636
+ return (0, import_node_path54.join)(threadsDir(), `${key}.run.log.json`);
21598
21637
  }
21599
21638
  function runLogKeyForWorktree(worktreePath, scriptName) {
21600
21639
  const norm = normalizeWorktreePath(worktreePath);
@@ -21699,13 +21738,13 @@ function finishRunLog(key, exitCode) {
21699
21738
  function flushRunLog(key) {
21700
21739
  persistNow2(key);
21701
21740
  }
21702
- var import_node_crypto14, import_node_fs53, import_node_path53, EMPTY2, MAX_RUN_LOG_CHARS, DEFAULT_RUN_LOG_TAIL_CHARS, memory2, persistTimers2, PERSIST_DEBOUNCE_MS2;
21741
+ var import_node_crypto14, import_node_fs53, import_node_path54, EMPTY2, MAX_RUN_LOG_CHARS, DEFAULT_RUN_LOG_TAIL_CHARS, memory2, persistTimers2, PERSIST_DEBOUNCE_MS2;
21703
21742
  var init_run_log = __esm({
21704
21743
  "src/store/run-log.ts"() {
21705
21744
  "use strict";
21706
21745
  import_node_crypto14 = require("crypto");
21707
21746
  import_node_fs53 = require("fs");
21708
- import_node_path53 = require("path");
21747
+ import_node_path54 = require("path");
21709
21748
  init_worktree_labels();
21710
21749
  init_setup_log();
21711
21750
  init_paths();
@@ -21770,9 +21809,9 @@ async function findOrphanWorktrees(repoPaths) {
21770
21809
  if ((0, import_node_fs54.existsSync)(root)) {
21771
21810
  for (const entry of (0, import_node_fs54.readdirSync)(root, { withFileTypes: true })) {
21772
21811
  if (!entry.isDirectory()) continue;
21773
- const path = (0, import_node_path54.join)(root, entry.name).replace(/\/$/, "");
21812
+ const path = (0, import_node_path55.join)(root, entry.name).replace(/\/$/, "");
21774
21813
  if (known.has(path) || seen.has(path)) continue;
21775
- if (!(0, import_node_fs54.existsSync)((0, import_node_path54.join)(path, ".git"))) continue;
21814
+ if (!(0, import_node_fs54.existsSync)((0, import_node_path55.join)(path, ".git"))) continue;
21776
21815
  seen.add(path);
21777
21816
  let mtimeMs = 0;
21778
21817
  try {
@@ -21828,12 +21867,12 @@ function shouldRunWorktreeCleanup(settings = loadAppSettings()) {
21828
21867
  const elapsed = Date.now() - Date.parse(last);
21829
21868
  return elapsed >= intervalHours * 36e5;
21830
21869
  }
21831
- var import_node_fs54, import_node_path54;
21870
+ var import_node_fs54, import_node_path55;
21832
21871
  var init_orphan_cleanup = __esm({
21833
21872
  "src/git/orphan-cleanup.ts"() {
21834
21873
  "use strict";
21835
21874
  import_node_fs54 = require("fs");
21836
- import_node_path54 = require("path");
21875
+ import_node_path55 = require("path");
21837
21876
  init_worktree();
21838
21877
  init_thread_store();
21839
21878
  init_paths();
@@ -22009,11 +22048,11 @@ async function cloneRepoIntoSideboard(opts) {
22009
22048
  if (!url) throw new Error("Clone URL is required");
22010
22049
  let name = opts.name?.trim();
22011
22050
  if (!name) {
22012
- const leaf = (0, import_node_path55.basename)(url.replace(/\/$/, "").replace(/\.git$/, ""));
22051
+ const leaf = (0, import_node_path56.basename)(url.replace(/\/$/, "").replace(/\.git$/, ""));
22013
22052
  name = leaf || "repo";
22014
22053
  }
22015
22054
  name = name.replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "repo";
22016
- const dest = (0, import_node_path55.join)(sideboardReposDir(), name);
22055
+ const dest = (0, import_node_path56.join)(sideboardReposDir(), name);
22017
22056
  if ((0, import_node_fs55.existsSync)(dest)) {
22018
22057
  const repoPath2 = await resolveRepoRoot(dest);
22019
22058
  const workspace2 = await addWorkspace(repoPath2);
@@ -22029,12 +22068,12 @@ async function cloneRepoIntoSideboard(opts) {
22029
22068
  const workspace = await addWorkspace(repoPath);
22030
22069
  return { repoPath, workspace };
22031
22070
  }
22032
- var import_node_fs55, import_node_path55, import_execa6;
22071
+ var import_node_fs55, import_node_path56, import_execa6;
22033
22072
  var init_clone_repo = __esm({
22034
22073
  "src/git/clone-repo.ts"() {
22035
22074
  "use strict";
22036
22075
  import_node_fs55 = require("fs");
22037
- import_node_path55 = require("path");
22076
+ import_node_path56 = require("path");
22038
22077
  import_execa6 = require("execa");
22039
22078
  init_paths();
22040
22079
  init_workspaces();
@@ -22054,7 +22093,7 @@ var init_thread = __esm({
22054
22093
 
22055
22094
  // src/store/desktop-host.ts
22056
22095
  function desktopHostPidPath() {
22057
- return (0, import_node_path56.join)(appDataDir(), "desktop-host.pid");
22096
+ return (0, import_node_path57.join)(appDataDir(), "desktop-host.pid");
22058
22097
  }
22059
22098
  function readDesktopHostPid() {
22060
22099
  try {
@@ -22084,12 +22123,12 @@ function thisProcessShouldDrainAgentQueues() {
22084
22123
  if (isThisProcessDesktopHost()) return true;
22085
22124
  return !isDesktopHostAlive();
22086
22125
  }
22087
- var import_node_fs56, import_node_path56;
22126
+ var import_node_fs56, import_node_path57;
22088
22127
  var init_desktop_host = __esm({
22089
22128
  "src/store/desktop-host.ts"() {
22090
22129
  "use strict";
22091
22130
  import_node_fs56 = require("fs");
22092
- import_node_path56 = require("path");
22131
+ import_node_path57 = require("path");
22093
22132
  init_paths();
22094
22133
  }
22095
22134
  });
@@ -22129,12 +22168,12 @@ function denyPendingToolPermissions(threadId) {
22129
22168
  const last = pending[pending.length - 1];
22130
22169
  if (last) clearPrompt(threadId, last.id);
22131
22170
  }
22132
- var import_node_crypto15, import_node_path57, queues, publisher;
22171
+ var import_node_crypto15, import_node_path58, queues, publisher;
22133
22172
  var init_tool_permission = __esm({
22134
22173
  "src/agents/tool-permission.ts"() {
22135
22174
  "use strict";
22136
22175
  import_node_crypto15 = require("crypto");
22137
- import_node_path57 = require("path");
22176
+ import_node_path58 = require("path");
22138
22177
  init_claude_mcp();
22139
22178
  queues = /* @__PURE__ */ new Map();
22140
22179
  publisher = null;
@@ -25469,7 +25508,7 @@ function stampOf(thread) {
25469
25508
  function repoLabel(thread) {
25470
25509
  if (isOrchestratorThread(thread)) return "Orchestration";
25471
25510
  const path = thread.repoPath?.trim() ?? "";
25472
- return path && (0, import_node_path58.basename)(path) || path || "project";
25511
+ return path && (0, import_node_path59.basename)(path) || path || "project";
25473
25512
  }
25474
25513
  function toAgent(thread, flags) {
25475
25514
  const prUrl = thread.prUrl?.trim();
@@ -25668,11 +25707,11 @@ function formatFleetArchive(view) {
25668
25707
  }
25669
25708
  return lines.join("\n");
25670
25709
  }
25671
- var import_node_path58, DEFAULT_LIMIT, MAX_LIMIT;
25710
+ var import_node_path59, DEFAULT_LIMIT, MAX_LIMIT;
25672
25711
  var init_fleet_archive = __esm({
25673
25712
  "src/archive/fleet-archive.ts"() {
25674
25713
  "use strict";
25675
- import_node_path58 = require("path");
25714
+ import_node_path59 = require("path");
25676
25715
  init_global_workspace();
25677
25716
  init_worktree_labels();
25678
25717
  DEFAULT_LIMIT = 40;
@@ -26169,7 +26208,7 @@ var init_quota_failover = __esm({
26169
26208
  // src/threads/adopt.ts
26170
26209
  function thisModuleFile2() {
26171
26210
  const cjsFile = typeof __filename !== "undefined" ? __filename : "";
26172
- return cjsFile || process.argv[1] || (0, import_node_path59.join)(process.cwd(), "package.json");
26211
+ return cjsFile || process.argv[1] || (0, import_node_path60.join)(process.cwd(), "package.json");
26173
26212
  }
26174
26213
  function openReadonlySqlite(file) {
26175
26214
  const req = (0, import_node_module6.createRequire)(thisModuleFile2());
@@ -26197,7 +26236,7 @@ function resolveConductorCursorAgentId(workspacePath) {
26197
26236
  return null;
26198
26237
  }
26199
26238
  for (const hash of hashes) {
26200
- const agentsFile = (0, import_node_path59.join)(CURSOR_SDK_STORE, hash, "agents.ndjson");
26239
+ const agentsFile = (0, import_node_path60.join)(CURSOR_SDK_STORE, hash, "agents.ndjson");
26201
26240
  if (!(0, import_node_fs59.existsSync)(agentsFile)) continue;
26202
26241
  let text7;
26203
26242
  try {
@@ -26254,8 +26293,8 @@ function listConductorWorkspaces() {
26254
26293
  if (!(0, import_node_fs59.existsSync)(CONDUCTOR_DB)) {
26255
26294
  throw new Error(`Conductor DB not found at ${CONDUCTOR_DB}`);
26256
26295
  }
26257
- const tmp = (0, import_node_fs59.mkdtempSync)((0, import_node_path59.join)((0, import_node_os18.tmpdir)(), "sideboard-conductor-"));
26258
- const snapshot = (0, import_node_path59.join)(tmp, "conductor.db");
26296
+ const tmp = (0, import_node_fs59.mkdtempSync)((0, import_node_path60.join)((0, import_node_os18.tmpdir)(), "sideboard-conductor-"));
26297
+ const snapshot = (0, import_node_path60.join)(tmp, "conductor.db");
26259
26298
  try {
26260
26299
  (0, import_node_fs59.copyFileSync)(CONDUCTOR_DB, snapshot);
26261
26300
  for (const suffix of ["-wal", "-shm"]) {
@@ -26345,8 +26384,8 @@ function importConductorWorkspace(workspaceId) {
26345
26384
  if (!(0, import_node_fs59.existsSync)(CONDUCTOR_DB)) {
26346
26385
  throw new Error(`Conductor DB not found at ${CONDUCTOR_DB}`);
26347
26386
  }
26348
- const tmp = (0, import_node_fs59.mkdtempSync)((0, import_node_path59.join)((0, import_node_os18.tmpdir)(), "sideboard-conductor-"));
26349
- const snapshot = (0, import_node_path59.join)(tmp, "conductor.db");
26387
+ const tmp = (0, import_node_fs59.mkdtempSync)((0, import_node_path60.join)((0, import_node_os18.tmpdir)(), "sideboard-conductor-"));
26388
+ const snapshot = (0, import_node_path60.join)(tmp, "conductor.db");
26350
26389
  try {
26351
26390
  (0, import_node_fs59.copyFileSync)(CONDUCTOR_DB, snapshot);
26352
26391
  for (const suffix of ["-wal", "-shm"]) {
@@ -26440,25 +26479,25 @@ function importConductorWorkspace(workspaceId) {
26440
26479
  async function importConductorWorkspaceAsync(workspaceId) {
26441
26480
  return importConductorWorkspace(workspaceId);
26442
26481
  }
26443
- var import_node_child_process6, import_node_fs59, import_node_os18, import_node_path59, import_node_module6, CONDUCTOR_APP_SUPPORT, CONDUCTOR_DB, CURSOR_SDK_STORE;
26482
+ var import_node_child_process6, import_node_fs59, import_node_os18, import_node_path60, import_node_module6, CONDUCTOR_APP_SUPPORT, CONDUCTOR_DB, CURSOR_SDK_STORE;
26444
26483
  var init_adopt = __esm({
26445
26484
  "src/threads/adopt.ts"() {
26446
26485
  "use strict";
26447
26486
  import_node_child_process6 = require("child_process");
26448
26487
  import_node_fs59 = require("fs");
26449
26488
  import_node_os18 = require("os");
26450
- import_node_path59 = require("path");
26489
+ import_node_path60 = require("path");
26451
26490
  import_node_module6 = require("module");
26452
26491
  init_worktree();
26453
26492
  init_thread_store();
26454
- CONDUCTOR_APP_SUPPORT = (0, import_node_path59.join)(
26493
+ CONDUCTOR_APP_SUPPORT = (0, import_node_path60.join)(
26455
26494
  process.env.HOME ?? "",
26456
26495
  "Library",
26457
26496
  "Application Support",
26458
26497
  "com.conductor.app"
26459
26498
  );
26460
- CONDUCTOR_DB = (0, import_node_path59.join)(CONDUCTOR_APP_SUPPORT, "conductor.db");
26461
- CURSOR_SDK_STORE = (0, import_node_path59.join)(CONDUCTOR_APP_SUPPORT, "cursor-sdk-store");
26499
+ CONDUCTOR_DB = (0, import_node_path60.join)(CONDUCTOR_APP_SUPPORT, "conductor.db");
26500
+ CURSOR_SDK_STORE = (0, import_node_path60.join)(CONDUCTOR_APP_SUPPORT, "cursor-sdk-store");
26462
26501
  }
26463
26502
  });
26464
26503
 
@@ -26788,7 +26827,7 @@ async function formatPrCreateFailure(raw, cwd, ctx) {
26788
26827
  }
26789
26828
  async function createCursorPullRequest(worktreePath, slug, opts) {
26790
26829
  const bodyText = (opts.body ?? opts.title).trim() || opts.title;
26791
- const bodyFile = (0, import_node_path60.join)(
26830
+ const bodyFile = (0, import_node_path61.join)(
26792
26831
  (0, import_node_os19.tmpdir)(),
26793
26832
  `sideboard-pr-body-${process.pid}-${(0, import_node_crypto19.randomBytes)(6).toString("hex")}.md`
26794
26833
  );
@@ -26830,7 +26869,7 @@ async function createOrUpdatePr(worktreePath, opts) {
26830
26869
  const headRef = ghHeadRef(slug, opts.head);
26831
26870
  const branchOnly = opts.head.trim().replace(/^refs\/heads\//, "");
26832
26871
  const bodyText = clampGithubPrBody(opts.body ?? opts.title);
26833
- const bodyFile = (0, import_node_path60.join)(
26872
+ const bodyFile = (0, import_node_path61.join)(
26834
26873
  (0, import_node_os19.tmpdir)(),
26835
26874
  `sideboard-pr-body-${process.pid}-${(0, import_node_crypto19.randomBytes)(6).toString("hex")}.md`
26836
26875
  );
@@ -26923,14 +26962,14 @@ async function createOrUpdatePrWithBodyFile(worktreePath, opts) {
26923
26962
  const url = created.stdout.trim().split("\n").find((l) => l.startsWith("http")) ?? created.stdout.trim();
26924
26963
  return url;
26925
26964
  }
26926
- var import_node_crypto19, import_node_fs61, import_node_os19, import_node_path60;
26965
+ var import_node_crypto19, import_node_fs61, import_node_os19, import_node_path61;
26927
26966
  var init_pr_write = __esm({
26928
26967
  "src/git/pr-write.ts"() {
26929
26968
  "use strict";
26930
26969
  import_node_crypto19 = require("crypto");
26931
26970
  import_node_fs61 = require("fs");
26932
26971
  import_node_os19 = require("os");
26933
- import_node_path60 = require("path");
26972
+ import_node_path61 = require("path");
26934
26973
  init_gh_errors();
26935
26974
  init_run();
26936
26975
  init_cursor_pr();
@@ -27082,7 +27121,7 @@ new file mode 100644
27082
27121
  };
27083
27122
  }
27084
27123
  async function untrackedPatch(worktreePath, path, maxHunk) {
27085
- const abs = (0, import_node_path61.join)(worktreePath, path);
27124
+ const abs = (0, import_node_path62.join)(worktreePath, path);
27086
27125
  try {
27087
27126
  const st = (0, import_node_fs62.statSync)(abs);
27088
27127
  if (st.isFile() && st.size > maxHunk) {
@@ -27553,7 +27592,7 @@ async function getDiff(worktreePath, repoPath, opts) {
27553
27592
  }
27554
27593
  function statWorktreePath(worktreePath, relativePath) {
27555
27594
  assertSafeRelativePath(relativePath);
27556
- const abs = (0, import_node_path61.join)(worktreePath, relativePath);
27595
+ const abs = (0, import_node_path62.join)(worktreePath, relativePath);
27557
27596
  if (!(0, import_node_fs62.existsSync)(abs)) return "missing";
27558
27597
  const st = (0, import_node_fs62.statSync)(abs);
27559
27598
  if (st.isDirectory()) return "dir";
@@ -27584,7 +27623,7 @@ function isImageRelativePath(relativePath) {
27584
27623
  function readWorktreeFileForUpload(worktreePath, relativePath, opts) {
27585
27624
  assertSafeRelativePath(relativePath);
27586
27625
  const maxBytes = opts?.maxBytes ?? DEFAULT_UPLOAD_MAX_BYTES;
27587
- const abs = (0, import_node_path61.join)(worktreePath, relativePath);
27626
+ const abs = (0, import_node_path62.join)(worktreePath, relativePath);
27588
27627
  const st = (0, import_node_fs62.statSync)(abs);
27589
27628
  if (!st.isFile()) {
27590
27629
  throw new Error(`Not a file: ${relativePath}`);
@@ -27604,7 +27643,7 @@ function readWorktreeFileForUpload(worktreePath, relativePath, opts) {
27604
27643
  function readWorktreeFile(worktreePath, relativePath, opts) {
27605
27644
  assertSafeRelativePath(relativePath);
27606
27645
  const maxBytes = opts?.maxBytes ?? 2e5;
27607
- const abs = (0, import_node_path61.join)(worktreePath, relativePath);
27646
+ const abs = (0, import_node_path62.join)(worktreePath, relativePath);
27608
27647
  const st = (0, import_node_fs62.statSync)(abs);
27609
27648
  if (!st.isFile()) {
27610
27649
  throw new Error(`Not a file: ${relativePath}`);
@@ -27652,8 +27691,8 @@ function assertSafeRelativePath(relativePath) {
27652
27691
  }
27653
27692
  function writeWorktreeFile(worktreePath, relativePath, content) {
27654
27693
  assertSafeRelativePath(relativePath);
27655
- const abs = (0, import_node_path61.join)(worktreePath, relativePath);
27656
- (0, import_node_fs62.mkdirSync)((0, import_node_path61.dirname)(abs), { recursive: true });
27694
+ const abs = (0, import_node_path62.join)(worktreePath, relativePath);
27695
+ (0, import_node_fs62.mkdirSync)((0, import_node_path62.dirname)(abs), { recursive: true });
27657
27696
  (0, import_node_fs62.writeFileSync)(abs, content, "utf8");
27658
27697
  return { path: relativePath };
27659
27698
  }
@@ -27694,12 +27733,12 @@ async function getDiffSummary(worktreePath, repoPath, opts) {
27694
27733
  truncated: full.files.length > maxFiles
27695
27734
  };
27696
27735
  }
27697
- var import_node_fs62, import_node_path61, mergeBaseCache, MERGE_BASE_TTL_MS, SHA_RE, IMAGE_EXTENSIONS2, DEFAULT_UPLOAD_MAX_BYTES;
27736
+ var import_node_fs62, import_node_path62, mergeBaseCache, MERGE_BASE_TTL_MS, SHA_RE, IMAGE_EXTENSIONS2, DEFAULT_UPLOAD_MAX_BYTES;
27698
27737
  var init_diff = __esm({
27699
27738
  "src/diff/diff.ts"() {
27700
27739
  "use strict";
27701
27740
  import_node_fs62 = require("fs");
27702
- import_node_path61 = require("path");
27741
+ import_node_path62 = require("path");
27703
27742
  init_run();
27704
27743
  init_worktree();
27705
27744
  mergeBaseCache = /* @__PURE__ */ new Map();
@@ -27922,7 +27961,7 @@ function readWorktreeFileTail(worktreePath, relativePath, maxBytes = WORKTREE_TA
27922
27961
  if (!relativePath || relativePath.includes("..") || relativePath.startsWith("/")) {
27923
27962
  throw new Error("Invalid path");
27924
27963
  }
27925
- const abs = (0, import_node_path62.join)(worktreePath, relativePath);
27964
+ const abs = (0, import_node_path63.join)(worktreePath, relativePath);
27926
27965
  const fd = (0, import_node_fs63.openSync)(abs, "r");
27927
27966
  try {
27928
27967
  const st = (0, import_node_fs63.fstatSync)(fd);
@@ -27952,12 +27991,12 @@ function readWorktreeFileTail(worktreePath, relativePath, maxBytes = WORKTREE_TA
27952
27991
  (0, import_node_fs63.closeSync)(fd);
27953
27992
  }
27954
27993
  }
27955
- var import_node_fs63, import_node_path62, WORKTREE_TAIL_BYTES;
27994
+ var import_node_fs63, import_node_path63, WORKTREE_TAIL_BYTES;
27956
27995
  var init_read_worktree_tail = __esm({
27957
27996
  "src/diff/read-worktree-tail.ts"() {
27958
27997
  "use strict";
27959
27998
  import_node_fs63 = require("fs");
27960
- import_node_path62 = require("path");
27999
+ import_node_path63 = require("path");
27961
28000
  WORKTREE_TAIL_BYTES = 2e5;
27962
28001
  }
27963
28002
  });
@@ -28134,7 +28173,7 @@ function scanSkillsDir(dir, source, out) {
28134
28173
  }
28135
28174
  for (const entry of entries) {
28136
28175
  if (entry.startsWith(".")) continue;
28137
- const skillMd = (0, import_node_path63.join)(dir, entry, "SKILL.md");
28176
+ const skillMd = (0, import_node_path64.join)(dir, entry, "SKILL.md");
28138
28177
  if (!(0, import_node_fs64.existsSync)(skillMd)) continue;
28139
28178
  try {
28140
28179
  if (!(0, import_node_fs64.statSync)(skillMd).isFile()) continue;
@@ -28156,12 +28195,12 @@ function scanClaudePluginSkills(pluginsRoot, out) {
28156
28195
  return;
28157
28196
  }
28158
28197
  if (lookingForSkillsDir && entries.includes("SKILL.md")) {
28159
- const skill = readSkill((0, import_node_path63.join)(dir, "SKILL.md"), "cli");
28198
+ const skill = readSkill((0, import_node_path64.join)(dir, "SKILL.md"), "cli");
28160
28199
  if (skill) out.push(skill);
28161
28200
  }
28162
28201
  for (const entry of entries) {
28163
28202
  if (entry === "node_modules" || entry === ".git") continue;
28164
- const full = (0, import_node_path63.join)(dir, entry);
28203
+ const full = (0, import_node_path64.join)(dir, entry);
28165
28204
  try {
28166
28205
  if (!(0, import_node_fs64.statSync)(full).isDirectory()) continue;
28167
28206
  } catch {
@@ -28181,17 +28220,17 @@ function discoverSkills(worktreePath) {
28181
28220
  const home = (0, import_node_os20.homedir)();
28182
28221
  const collected = [];
28183
28222
  for (const rel of [".claude/skills", ".cursor/skills", ".sideboard/skills", ".brightsy/skills", "skills"]) {
28184
- scanSkillsDir((0, import_node_path63.join)(worktreePath, rel), "workspace", collected);
28223
+ scanSkillsDir((0, import_node_path64.join)(worktreePath, rel), "workspace", collected);
28185
28224
  }
28186
28225
  for (const abs of [
28187
- (0, import_node_path63.join)(home, ".claude/skills"),
28188
- (0, import_node_path63.join)(home, ".cursor/skills"),
28189
- (0, import_node_path63.join)(home, ".sideboard/skills"),
28190
- (0, import_node_path63.join)(home, ".brightsy/skills")
28226
+ (0, import_node_path64.join)(home, ".claude/skills"),
28227
+ (0, import_node_path64.join)(home, ".cursor/skills"),
28228
+ (0, import_node_path64.join)(home, ".sideboard/skills"),
28229
+ (0, import_node_path64.join)(home, ".brightsy/skills")
28191
28230
  ]) {
28192
28231
  scanSkillsDir(abs, "user", collected);
28193
28232
  }
28194
- scanClaudePluginSkills((0, import_node_path63.join)(home, ".claude/plugins"), collected);
28233
+ scanClaudePluginSkills((0, import_node_path64.join)(home, ".claude/plugins"), collected);
28195
28234
  collected.push(...bundledSkills());
28196
28235
  const rank = {
28197
28236
  workspace: 0,
@@ -28231,13 +28270,13 @@ function readSkillBody(skillPath, maxChars = 12e3) {
28231
28270
 
28232
28271
  \u2026(truncated)` : raw;
28233
28272
  }
28234
- var import_node_fs64, import_node_os20, import_node_path63, BUNDLED_SKILL_PREFIX;
28273
+ var import_node_fs64, import_node_os20, import_node_path64, BUNDLED_SKILL_PREFIX;
28235
28274
  var init_discover = __esm({
28236
28275
  "src/skills/discover.ts"() {
28237
28276
  "use strict";
28238
28277
  import_node_fs64 = require("fs");
28239
28278
  import_node_os20 = require("os");
28240
- import_node_path63 = require("path");
28279
+ import_node_path64 = require("path");
28241
28280
  init_long_running();
28242
28281
  BUNDLED_SKILL_PREFIX = "bundled:";
28243
28282
  }
@@ -28337,6 +28376,19 @@ function joinSteerPrompt(base, addition) {
28337
28376
  return `${head}
28338
28377
  ${next}`;
28339
28378
  }
28379
+ function messagesWithRewrittenUserPrompt(messages, from, to) {
28380
+ if (from === to) return null;
28381
+ const next = messages.slice();
28382
+ for (let i = next.length - 1; i >= 0; i--) {
28383
+ const message = next[i];
28384
+ if (!message || message.origin === "continue" || message.role === "summary") continue;
28385
+ if (message.role !== "user") continue;
28386
+ if (message.text !== from) return null;
28387
+ next[i] = { ...message, text: to };
28388
+ return next;
28389
+ }
28390
+ return null;
28391
+ }
28340
28392
  function trailingUnansweredUserText(messages) {
28341
28393
  for (let i = messages.length - 1; i >= 0; i--) {
28342
28394
  const message = messages[i];
@@ -28426,22 +28478,21 @@ function resolveSendFollowUp(thread, requested) {
28426
28478
  return isOrchestratorThread(thread) ? followUpBehavior() : "queue";
28427
28479
  }
28428
28480
  function rewriteTrailingUserPrompt(threadId, from, to) {
28429
- if (from === to) return;
28430
28481
  const thread = readThread(threadId);
28431
28482
  if (!thread) return;
28432
- const messages = thread.messages.slice();
28483
+ const messages = messagesWithRewrittenUserPrompt(thread.messages, from, to);
28484
+ if (!messages) return;
28485
+ updateThread(threadId, { messages });
28486
+ }
28487
+ function reuseJoinedUserBubble(reused, threadId, messages, promptText) {
28488
+ if (!reused.delete(threadId)) return false;
28433
28489
  for (let i = messages.length - 1; i >= 0; i--) {
28434
28490
  const message = messages[i];
28435
28491
  if (!message || message.origin === "continue" || message.role === "summary") continue;
28436
- if (message.role === "user" && message.text === from) {
28437
- messages[i] = { ...message, text: to };
28438
- updateThread(threadId, { messages });
28439
- }
28440
- return;
28492
+ if (message.role !== "user") continue;
28493
+ return message.text === promptText;
28441
28494
  }
28442
- }
28443
- function reuseJoinedUserBubble(reused, threadId, last, promptText) {
28444
- return reused.delete(threadId) && last?.role === "user" && last.origin !== "continue" && last.text === promptText;
28495
+ return false;
28445
28496
  }
28446
28497
  function promptForJoinedSteer(input) {
28447
28498
  if (input.latestPrompt === input.promptText) return input.agentPrompt;
@@ -28590,7 +28641,7 @@ function compiledModuleDir() {
28590
28641
  try {
28591
28642
  const url = import_meta8.url;
28592
28643
  if (typeof url === "string" && url.length > 0) {
28593
- return (0, import_node_path64.dirname)((0, import_node_url6.fileURLToPath)(url));
28644
+ return (0, import_node_path65.dirname)((0, import_node_url6.fileURLToPath)(url));
28594
28645
  }
28595
28646
  } catch {
28596
28647
  }
@@ -28598,7 +28649,7 @@ function compiledModuleDir() {
28598
28649
  }
28599
28650
  function detachedJobScriptIn(dir) {
28600
28651
  for (const name of DETACHED_JOB_FILENAMES) {
28601
- const script = (0, import_node_path64.join)(dir, "scripts", name);
28652
+ const script = (0, import_node_path65.join)(dir, "scripts", name);
28602
28653
  if ((0, import_node_fs65.existsSync)(script)) return script;
28603
28654
  }
28604
28655
  return null;
@@ -28616,7 +28667,7 @@ function resolveDetachedJobScript() {
28616
28667
  for (let i = 0; i < 8; i++) {
28617
28668
  const candidate = detachedJobScriptIn(dir);
28618
28669
  if (candidate) return candidate;
28619
- const parent = (0, import_node_path64.dirname)(dir);
28670
+ const parent = (0, import_node_path65.dirname)(dir);
28620
28671
  if (parent === dir) break;
28621
28672
  dir = parent;
28622
28673
  }
@@ -28627,12 +28678,12 @@ function formatDetachedJobInvoke(scriptPath) {
28627
28678
  if (resolved) return `node ${JSON.stringify(resolved)}`;
28628
28679
  return "node scripts/detached-job.cjs";
28629
28680
  }
28630
- var import_node_fs65, import_node_path64, import_node_url6, import_meta8, DETACHED_JOB_FILENAMES;
28681
+ var import_node_fs65, import_node_path65, import_node_url6, import_meta8, DETACHED_JOB_FILENAMES;
28631
28682
  var init_detached_job_path = __esm({
28632
28683
  "src/skills/detached-job-path.ts"() {
28633
28684
  "use strict";
28634
28685
  import_node_fs65 = require("fs");
28635
- import_node_path64 = require("path");
28686
+ import_node_path65 = require("path");
28636
28687
  import_node_url6 = require("url");
28637
28688
  init_packaged_runtime();
28638
28689
  import_meta8 = {};
@@ -28866,9 +28917,9 @@ function formatPrGateDirective() {
28866
28917
  }
28867
28918
  function formatProcessGuideDirective(opts) {
28868
28919
  const worktree = opts?.worktreePath?.trim();
28869
- const hasGraphSkill = !!worktree && (0, import_node_fs66.existsSync)((0, import_node_path65.join)(worktree, ".claude/skills/graph-engineering/SKILL.md"));
28870
- const hasReviewSkill = !!worktree && (0, import_node_fs66.existsSync)((0, import_node_path65.join)(worktree, ".claude/skills/review/SKILL.md"));
28871
- const hasInstallSkill = !!worktree && (0, import_node_fs66.existsSync)((0, import_node_path65.join)(worktree, ".claude/skills/worktree-install/SKILL.md"));
28920
+ const hasGraphSkill = !!worktree && (0, import_node_fs66.existsSync)((0, import_node_path66.join)(worktree, ".claude/skills/graph-engineering/SKILL.md"));
28921
+ const hasReviewSkill = !!worktree && (0, import_node_fs66.existsSync)((0, import_node_path66.join)(worktree, ".claude/skills/review/SKILL.md"));
28922
+ const hasInstallSkill = !!worktree && (0, import_node_fs66.existsSync)((0, import_node_path66.join)(worktree, ".claude/skills/worktree-install/SKILL.md"));
28872
28923
  return [
28873
28924
  "Process guides (recurring work only):",
28874
28925
  hasGraphSkill ? "- Migrations, ports, batch fixes, and other fan-out: follow `.claude/skills/graph-engineering/SKILL.md` (`/graph-engineering`). Judge first; state on disk; grow the rulebook; do not patch around it." : null,
@@ -28908,12 +28959,12 @@ function formatArtifactDirective() {
28908
28959
  function formatUiReminder() {
28909
28960
  return "Sideboard UI: markdown table is enough to read data; present_schema if they ask to edit/filter (even after markdown); present_files for the file manager. html fence or present_artifact, not both for the same document. type=log appends (same artifact_id, new lines only). Chat links: `[name](sideboard://artifact/<id-or-title>)` opens that pane; `[name](sideboard://file/path#L12-L40)` opens a file. ask_user only for a real multiple-choice (not hellos, \u201Cwhat next?\u201D, or after a review) \u2014 reply in chat. ask_user wakes the parent orchestrator; notify_orchestrator if blocked without a picker. Do not say artifacts/CMS UI are unavailable. Dev / preview: run_dev_script (same as the Dev button; pass name \u2014 several scripts can run at once) returns {url, port, preview} (SIDEBOARD_PORT \u2014 never guess :3000). preview=url \u2192 open url; preview=window \u2192 Electron window is the app, url is renderer/HMR only. list_run_scripts active[].url if already running; get_run_log for that script\u2019s Run-tab terminal; stop_dev_script to stop one.";
28910
28961
  }
28911
- var import_node_fs66, import_node_path65, PR_GOAL_RE, GITHUB_TICKET_REF, KEYED_TICKET_REF;
28962
+ var import_node_fs66, import_node_path66, PR_GOAL_RE, GITHUB_TICKET_REF, KEYED_TICKET_REF;
28912
28963
  var init_instructions = __esm({
28913
28964
  "src/agents/instructions.ts"() {
28914
28965
  "use strict";
28915
28966
  import_node_fs66 = require("fs");
28916
- import_node_path65 = require("path");
28967
+ import_node_path66 = require("path");
28917
28968
  init_git_auth_mode();
28918
28969
  init_forge_git_directives();
28919
28970
  init_branch_prefix();
@@ -29580,13 +29631,13 @@ __export(plan_file_exports, {
29580
29631
  writePlanFile: () => writePlanFile
29581
29632
  });
29582
29633
  function ensureAttachmentsGitignore(worktreePath) {
29583
- const gitignoreAbs = (0, import_node_path66.join)(worktreePath, ATTACHMENTS_DIR, ".gitignore");
29634
+ const gitignoreAbs = (0, import_node_path67.join)(worktreePath, ATTACHMENTS_DIR, ".gitignore");
29584
29635
  if ((0, import_node_fs67.existsSync)(gitignoreAbs)) return;
29585
- (0, import_node_fs67.mkdirSync)((0, import_node_path66.dirname)(gitignoreAbs), { recursive: true });
29636
+ (0, import_node_fs67.mkdirSync)((0, import_node_path67.dirname)(gitignoreAbs), { recursive: true });
29586
29637
  (0, import_node_fs67.writeFileSync)(gitignoreAbs, attachmentsGitignoreBody(), "utf8");
29587
29638
  }
29588
29639
  function planFileAbs(worktreePath) {
29589
- return (0, import_node_path66.join)(worktreePath, PLAN_FILE_REL);
29640
+ return (0, import_node_path67.join)(worktreePath, PLAN_FILE_REL);
29590
29641
  }
29591
29642
  function readTextIfPresent2(abs) {
29592
29643
  if (!(0, import_node_fs67.existsSync)(abs)) return null;
@@ -29598,22 +29649,22 @@ function readTextIfPresent2(abs) {
29598
29649
  }
29599
29650
  }
29600
29651
  function readPlanFile(worktreePath) {
29601
- return readTextIfPresent2(planFileAbs(worktreePath)) ?? readTextIfPresent2((0, import_node_path66.join)(worktreePath, `${LEGACY_ATTACHMENTS_DIR}/plan.md`)) ?? readTextIfPresent2((0, import_node_path66.join)(worktreePath, LEGACY_PLAN_FILE_REL));
29652
+ return readTextIfPresent2(planFileAbs(worktreePath)) ?? readTextIfPresent2((0, import_node_path67.join)(worktreePath, `${LEGACY_ATTACHMENTS_DIR}/plan.md`)) ?? readTextIfPresent2((0, import_node_path67.join)(worktreePath, LEGACY_PLAN_FILE_REL));
29602
29653
  }
29603
29654
  function writePlanFile(worktreePath, content) {
29604
29655
  ensureAttachmentsGitignore(worktreePath);
29605
29656
  const abs = planFileAbs(worktreePath);
29606
- (0, import_node_fs67.mkdirSync)((0, import_node_path66.dirname)(abs), { recursive: true });
29657
+ (0, import_node_fs67.mkdirSync)((0, import_node_path67.dirname)(abs), { recursive: true });
29607
29658
  const body = content.trimEnd() + (content.endsWith("\n") ? "" : "\n");
29608
29659
  (0, import_node_fs67.writeFileSync)(abs, body, "utf8");
29609
29660
  return PLAN_FILE_REL;
29610
29661
  }
29611
- var import_node_fs67, import_node_path66;
29662
+ var import_node_fs67, import_node_path67;
29612
29663
  var init_plan_file = __esm({
29613
29664
  "src/plan/plan-file.ts"() {
29614
29665
  "use strict";
29615
29666
  import_node_fs67 = require("fs");
29616
- import_node_path66 = require("path");
29667
+ import_node_path67 = require("path");
29617
29668
  init_workspace_scratch();
29618
29669
  init_plan_present();
29619
29670
  init_plan_present();
@@ -29662,7 +29713,7 @@ function setCaffeinateHoldHooks(next) {
29662
29713
  hooks = next;
29663
29714
  }
29664
29715
  function caffeinateHoldPath() {
29665
- return (0, import_node_path67.join)(appDataDir(), "caffeinate-hold.json");
29716
+ return (0, import_node_path68.join)(appDataDir(), "caffeinate-hold.json");
29666
29717
  }
29667
29718
  function processAlive(pid) {
29668
29719
  if (hooks.processAlive) return hooks.processAlive(pid);
@@ -29805,13 +29856,13 @@ function releaseCaffeinateHoldForThread(threadId) {
29805
29856
  }
29806
29857
  return setCaffeinateHold(false, { threadId: id });
29807
29858
  }
29808
- var import_node_child_process7, import_node_fs68, import_node_path67, hooks;
29859
+ var import_node_child_process7, import_node_fs68, import_node_path68, hooks;
29809
29860
  var init_caffeinate_hold = __esm({
29810
29861
  "src/store/caffeinate-hold.ts"() {
29811
29862
  "use strict";
29812
29863
  import_node_child_process7 = require("child_process");
29813
29864
  import_node_fs68 = require("fs");
29814
- import_node_path67 = require("path");
29865
+ import_node_path68 = require("path");
29815
29866
  init_paths();
29816
29867
  init_private_file();
29817
29868
  hooks = {};
@@ -31075,8 +31126,8 @@ var init_orchestrator = __esm({
31075
31126
  const parked = takePendingTurnAttachments(thread);
31076
31127
  const sentAttachments = !autoContinue && parked.length > 0 ? parked : void 0;
31077
31128
  if (!autoContinue) clearAgentBlock(threadId);
31078
- const lastShown = this.requireThread(threadId).messages.at(-1);
31079
- if (!reuseJoinedUserBubble(this.reusedUserPrompt, threadId, lastShown, promptText)) {
31129
+ const shown = this.requireThread(threadId).messages;
31130
+ if (!reuseJoinedUserBubble(this.reusedUserPrompt, threadId, shown, promptText)) {
31080
31131
  appendMessage(threadId, {
31081
31132
  role: "user",
31082
31133
  text: promptText,
@@ -33072,7 +33123,7 @@ function createClippedMcpServer() {
33072
33123
  // src/mcp/server.ts
33073
33124
  var import_zod11 = require("zod");
33074
33125
  var import_node_crypto23 = require("crypto");
33075
- var import_node_path71 = require("path");
33126
+ var import_node_path72 = require("path");
33076
33127
  init_orchestrator();
33077
33128
  init_task_state();
33078
33129
  init_worktree();
@@ -35479,7 +35530,7 @@ function registerScheduleTools(server) {
35479
35530
 
35480
35531
  // src/agent-rpc/handlers.ts
35481
35532
  var import_node_crypto21 = require("crypto");
35482
- var import_node_path68 = require("path");
35533
+ var import_node_path69 = require("path");
35483
35534
  init_wait_for_job();
35484
35535
  init_wait_for_turn();
35485
35536
 
@@ -35545,20 +35596,20 @@ init_git_auth_mode();
35545
35596
 
35546
35597
  // src/board/load-home-board.ts
35547
35598
  var import_node_fs72 = require("fs");
35548
- var import_node_path70 = require("path");
35599
+ var import_node_path71 = require("path");
35549
35600
  init_worktree();
35550
35601
  init_paths();
35551
35602
 
35552
35603
  // src/board/board-pins.ts
35553
35604
  var import_node_crypto22 = require("crypto");
35554
35605
  var import_node_fs71 = require("fs");
35555
- var import_node_path69 = require("path");
35606
+ var import_node_path70 = require("path");
35556
35607
  init_paths();
35557
35608
  init_home_board();
35558
35609
  var FILE = "home-board-pins.json";
35559
35610
  var VERSION = 1;
35560
35611
  function pinsFile() {
35561
- return (0, import_node_path69.join)(appDataDir(), FILE);
35612
+ return (0, import_node_path70.join)(appDataDir(), FILE);
35562
35613
  }
35563
35614
  function readDisk() {
35564
35615
  const path = pinsFile();
@@ -35594,7 +35645,7 @@ function homeBoardWorkspaceKey(workspaces) {
35594
35645
  return workspaces.map((w) => w.path).filter(Boolean).sort().join("\n");
35595
35646
  }
35596
35647
  function cacheFile() {
35597
- return (0, import_node_path70.join)(appDataDir(), "home-board-cache.json");
35648
+ return (0, import_node_path71.join)(appDataDir(), "home-board-cache.json");
35598
35649
  }
35599
35650
  function emptyInputs() {
35600
35651
  return {
@@ -35892,7 +35943,7 @@ async function startMcpServer() {
35892
35943
  async () => {
35893
35944
  const threads = orch.getThreads();
35894
35945
  const lines = threads.map((t) => {
35895
- const repo = t.repoPath === GLOBAL_WORKSPACE_ID ? "Orchestration" : (0, import_node_path71.basename)(t.repoPath) || t.repoPath;
35946
+ const repo = t.repoPath === GLOBAL_WORKSPACE_ID ? "Orchestration" : (0, import_node_path72.basename)(t.repoPath) || t.repoPath;
35896
35947
  const live = orch.threadLooksLive(t) ? readTurnLive(t.id) : null;
35897
35948
  const parent = t.parentThreadId ? ` parent:${t.parentThreadId.slice(0, 8)}` : "";
35898
35949
  const preview = lastMessagePreview(t.messages, 80);