@sideboard-ai/core 0.1.198 → 0.1.199

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 (35) hide show
  1. package/dist/{abletime-JINF5KJV.js → abletime-3CSCNAXU.js} +2 -2
  2. package/dist/{abletime-HR6P4GJH.js → abletime-H74RNIKV.js} +2 -2
  3. package/dist/{agents-AQQKPD46.js → agents-AVH44CBS.js} +26 -4
  4. package/dist/{agents-5TZY6LLX.js → agents-BOYOK56K.js} +26 -4
  5. package/dist/{app-settings-J775CYOO.js → app-settings-FMTDH5RD.js} +3 -1
  6. package/dist/{app-settings-5KHVKJKO.js → app-settings-MMPLJHWF.js} +3 -1
  7. package/dist/{chunk-S5GLSRLP.js → chunk-2IQ6W47G.js} +10 -0
  8. package/dist/{chunk-HZTHWU6A.js → chunk-BLOKJY4U.js} +2 -2
  9. package/dist/{chunk-E37JHCO3.js → chunk-CA7PWMQ7.js} +1 -1
  10. package/dist/{chunk-DROELG52.js → chunk-CTABTALL.js} +19 -19
  11. package/dist/{chunk-SYXSSU7G.js → chunk-DU2ICKLA.js} +355 -4
  12. package/dist/{chunk-S4QCBBXS.js → chunk-DU4ID3DA.js} +1 -1
  13. package/dist/{chunk-AH6WIBLY.js → chunk-HQKGK4KO.js} +10 -0
  14. package/dist/{chunk-EA67VQM2.js → chunk-KI4YI72Y.js} +355 -4
  15. package/dist/{chunk-6YS5IKD2.js → chunk-PPVN3APP.js} +20 -20
  16. package/dist/{chunk-KTHRWHA3.js → chunk-PTAMHXBT.js} +1 -1
  17. package/dist/{chunk-DP4TKAMZ.js → chunk-QFABSE3Q.js} +1 -1
  18. package/dist/{chunk-6YTI2HBG.js → chunk-S4EEYOSU.js} +2 -2
  19. package/dist/{coordinator-prompt-IX66YUJ2.js → coordinator-prompt-LB3GA3U4.js} +3 -3
  20. package/dist/{coordinator-prompt-LYKS3YNG.js → coordinator-prompt-ROWPLVQ3.js} +3 -3
  21. package/dist/{global-workspace-SNJ2Z6SL.js → global-workspace-C5XKWCRH.js} +3 -3
  22. package/dist/{global-workspace-4QX6UEOY.js → global-workspace-V2A4YKZ6.js} +3 -3
  23. package/dist/index.cjs +660 -258
  24. package/dist/index.d.cts +78 -1
  25. package/dist/index.d.ts +78 -1
  26. package/dist/index.js +32 -8
  27. package/dist/mcp/run-stdio.cjs +289 -254
  28. package/dist/mcp/run-stdio.js +8 -8
  29. package/dist/{orchestrator-L2H42HPW.js → orchestrator-AJGDZEAS.js} +5 -5
  30. package/dist/{orchestrator-6ZNKCPNL.js → orchestrator-NCGYNVYN.js} +5 -5
  31. package/dist/{workspaces-URMUVGAQ.js → workspaces-GWEKIS3B.js} +3 -3
  32. package/dist/{workspaces-UTOYGBYB.js → workspaces-WIRJQ6HA.js} +3 -3
  33. package/dist/{worktree-RM6UWNGZ.js → worktree-QA4J75FI.js} +2 -2
  34. package/dist/{worktree-R43JOR4V.js → worktree-UI5WJC3A.js} +2 -2
  35. package/package.json +1 -1
@@ -3522,6 +3522,7 @@ __export(app_settings_exports, {
3522
3522
  childEnvWithAppSettings: () => childEnvWithAppSettings,
3523
3523
  claudeChromeEnabled: () => claudeChromeEnabled,
3524
3524
  claudeUserSettingsPath: () => claudeUserSettingsPath,
3525
+ confirmClaudeUsageOverLimitEnabled: () => confirmClaudeUsageOverLimitEnabled,
3525
3526
  cowboyModeEnabled: () => cowboyModeEnabled,
3526
3527
  deleteBranchOnPurgeEnabled: () => deleteBranchOnPurgeEnabled,
3527
3528
  disconnectAbleTimeConnection: () => disconnectAbleTimeConnection,
@@ -3949,6 +3950,9 @@ function normalizeAdvanced(raw) {
3949
3950
  if (typeof source.showCost === "boolean") {
3950
3951
  out.showCost = source.showCost;
3951
3952
  }
3953
+ if (typeof source.confirmClaudeUsageOverLimit === "boolean") {
3954
+ out.confirmClaudeUsageOverLimit = source.confirmClaudeUsageOverLimit;
3955
+ }
3952
3956
  if (typeof source.autoArchiveOnMerge === "boolean") {
3953
3957
  out.autoArchiveOnMerge = source.autoArchiveOnMerge;
3954
3958
  }
@@ -4811,6 +4815,9 @@ function updateAdvancedSettings(patch) {
4811
4815
  if (typeof patch.showCost === "boolean") {
4812
4816
  advanced.showCost = patch.showCost;
4813
4817
  }
4818
+ if (typeof patch.confirmClaudeUsageOverLimit === "boolean") {
4819
+ advanced.confirmClaudeUsageOverLimit = patch.confirmClaudeUsageOverLimit;
4820
+ }
4814
4821
  if (typeof patch.autoArchiveOnMerge === "boolean") {
4815
4822
  advanced.autoArchiveOnMerge = patch.autoArchiveOnMerge;
4816
4823
  }
@@ -4873,6 +4880,9 @@ function cowboyModeEnabled(settings = loadAppSettings()) {
4873
4880
  function showCostEnabled(settings = loadAppSettings()) {
4874
4881
  return Boolean(settings.advanced.showCost);
4875
4882
  }
4883
+ function confirmClaudeUsageOverLimitEnabled(settings = loadAppSettings()) {
4884
+ return Boolean(settings.advanced.confirmClaudeUsageOverLimit);
4885
+ }
4876
4886
  function autoArchiveOnMergeEnabled(settings = loadAppSettings()) {
4877
4887
  return Boolean(settings.advanced.autoArchiveOnMerge);
4878
4888
  }
@@ -12189,6 +12199,29 @@ var init_session_quota = __esm({
12189
12199
  }
12190
12200
  });
12191
12201
 
12202
+ // src/agents/claude-usage.ts
12203
+ var init_claude_usage = __esm({
12204
+ "src/agents/claude-usage.ts"() {
12205
+ "use strict";
12206
+ }
12207
+ });
12208
+
12209
+ // src/agents/claude-usage-client.ts
12210
+ var import_node_fs33, import_node_os13, import_node_path33, CLAUDE_USAGE_ERROR_TTL_MS, CLAUDE_USAGE_STALE_OK_MS;
12211
+ var init_claude_usage_client = __esm({
12212
+ "src/agents/claude-usage-client.ts"() {
12213
+ "use strict";
12214
+ import_node_fs33 = require("fs");
12215
+ import_node_os13 = require("os");
12216
+ import_node_path33 = require("path");
12217
+ init_run();
12218
+ init_app_settings();
12219
+ init_claude_usage();
12220
+ CLAUDE_USAGE_ERROR_TTL_MS = 5 * 6e4;
12221
+ CLAUDE_USAGE_STALE_OK_MS = 30 * 6e4;
12222
+ }
12223
+ });
12224
+
12192
12225
  // src/agents/install.ts
12193
12226
  var init_install = __esm({
12194
12227
  "src/agents/install.ts"() {
@@ -12223,6 +12256,8 @@ var init_agents = __esm({
12223
12256
  init_opencode();
12224
12257
  init_list_models();
12225
12258
  init_session_quota();
12259
+ init_claude_usage();
12260
+ init_claude_usage_client();
12226
12261
  init_orchestrator_capable();
12227
12262
  init_path();
12228
12263
  init_install();
@@ -12238,15 +12273,15 @@ var init_agents = __esm({
12238
12273
 
12239
12274
  // src/hook/worktree-pkg-cache.ts
12240
12275
  function worktreePkgCacheRoot(worktreePath) {
12241
- return (0, import_node_path33.join)(worktreePath, WORKTREE_PKG_CACHE_REL);
12276
+ return (0, import_node_path34.join)(worktreePath, WORKTREE_PKG_CACHE_REL);
12242
12277
  }
12243
12278
  function worktreePkgCacheEnv(worktreePath) {
12244
12279
  const root = worktreePkgCacheRoot(worktreePath);
12245
- const store = (0, import_node_path33.join)(root, "pnpm-store");
12246
- const pnpmCache = (0, import_node_path33.join)(root, "pnpm");
12247
- const npmCache = (0, import_node_path33.join)(root, "npm");
12248
- const nodeGyp = (0, import_node_path33.join)(root, "node-gyp");
12249
- const electron = (0, import_node_path33.join)(root, "electron");
12280
+ const store = (0, import_node_path34.join)(root, "pnpm-store");
12281
+ const pnpmCache = (0, import_node_path34.join)(root, "pnpm");
12282
+ const npmCache = (0, import_node_path34.join)(root, "npm");
12283
+ const nodeGyp = (0, import_node_path34.join)(root, "node-gyp");
12284
+ const electron = (0, import_node_path34.join)(root, "electron");
12250
12285
  return {
12251
12286
  npm_config_store_dir: store,
12252
12287
  PNPM_STORE_DIR: store,
@@ -12268,8 +12303,8 @@ function fillGroup(env, keys, values) {
12268
12303
  }
12269
12304
  }
12270
12305
  function ensureWorktreePkgCacheDirs(worktreePath) {
12271
- if (!(0, import_node_fs33.existsSync)(worktreePath)) return;
12272
- (0, import_node_fs33.mkdirSync)(worktreePkgCacheRoot(worktreePath), { recursive: true });
12306
+ if (!(0, import_node_fs34.existsSync)(worktreePath)) return;
12307
+ (0, import_node_fs34.mkdirSync)(worktreePkgCacheRoot(worktreePath), { recursive: true });
12273
12308
  }
12274
12309
  function applyWorktreePkgCacheEnv(env, worktreePath) {
12275
12310
  const cwd = worktreePath.trim();
@@ -12282,12 +12317,12 @@ function applyWorktreePkgCacheEnv(env, worktreePath) {
12282
12317
  fillGroup(env, ["electron_config_cache"], next);
12283
12318
  ensureWorktreePkgCacheDirs(cwd);
12284
12319
  }
12285
- var import_node_fs33, import_node_path33, WORKTREE_PKG_CACHE_REL;
12320
+ var import_node_fs34, import_node_path34, WORKTREE_PKG_CACHE_REL;
12286
12321
  var init_worktree_pkg_cache = __esm({
12287
12322
  "src/hook/worktree-pkg-cache.ts"() {
12288
12323
  "use strict";
12289
- import_node_fs33 = require("fs");
12290
- import_node_path33 = require("path");
12324
+ import_node_fs34 = require("fs");
12325
+ import_node_path34 = require("path");
12291
12326
  WORKTREE_PKG_CACHE_REL = ".context/.sideboard/pkg-cache";
12292
12327
  }
12293
12328
  });
@@ -13403,21 +13438,21 @@ function shouldRefreshReviewRequestTemplate(content) {
13403
13438
  return LEGACY_REVIEW_TEMPLATE_MARKERS.every((m) => trimmed.includes(m));
13404
13439
  }
13405
13440
  function readTextIfPresent(abs) {
13406
- if (!(0, import_node_fs34.existsSync)(abs)) return null;
13441
+ if (!(0, import_node_fs35.existsSync)(abs)) return null;
13407
13442
  try {
13408
- const content = (0, import_node_fs34.readFileSync)(abs, "utf8");
13443
+ const content = (0, import_node_fs35.readFileSync)(abs, "utf8");
13409
13444
  return content.trim() ? content : null;
13410
13445
  } catch {
13411
13446
  return null;
13412
13447
  }
13413
13448
  }
13414
13449
  function readLocalGuidelines(worktreePath) {
13415
- const localAbs = (0, import_node_path34.join)(worktreePath, REVIEW_REQUEST_PATH);
13450
+ const localAbs = (0, import_node_path35.join)(worktreePath, REVIEW_REQUEST_PATH);
13416
13451
  const localContent = readTextIfPresent(localAbs);
13417
13452
  if (localContent && !shouldRefreshReviewRequestTemplate(localContent)) {
13418
13453
  return { path: REVIEW_REQUEST_PATH, content: localContent };
13419
13454
  }
13420
- const legacyAbs = (0, import_node_path34.join)(worktreePath, LEGACY_REVIEW_REQUEST_PATH);
13455
+ const legacyAbs = (0, import_node_path35.join)(worktreePath, LEGACY_REVIEW_REQUEST_PATH);
13421
13456
  const legacyContent = readTextIfPresent(legacyAbs);
13422
13457
  if (legacyContent && !shouldRefreshReviewRequestTemplate(legacyContent)) {
13423
13458
  return { path: LEGACY_REVIEW_REQUEST_PATH, content: legacyContent };
@@ -13441,27 +13476,27 @@ function contextGuidelines(content, source) {
13441
13476
  };
13442
13477
  }
13443
13478
  function writeContextGuidelines(worktreePath, content) {
13444
- const abs = (0, import_node_path34.join)(worktreePath, CONTEXT_REVIEW_PATH);
13445
- (0, import_node_fs34.mkdirSync)((0, import_node_path34.dirname)(abs), { recursive: true });
13479
+ const abs = (0, import_node_path35.join)(worktreePath, CONTEXT_REVIEW_PATH);
13480
+ (0, import_node_fs35.mkdirSync)((0, import_node_path35.dirname)(abs), { recursive: true });
13446
13481
  const body = content.endsWith("\n") ? content : `${content}
13447
13482
  `;
13448
- (0, import_node_fs34.writeFileSync)(abs, body, "utf8");
13483
+ (0, import_node_fs35.writeFileSync)(abs, body, "utf8");
13449
13484
  return body;
13450
13485
  }
13451
13486
  function readSideboardReview(worktreePath, repoPath) {
13452
- const fromWorktree = readTextIfPresent((0, import_node_path34.join)(worktreePath, REPO_REVIEW_PATH));
13487
+ const fromWorktree = readTextIfPresent((0, import_node_path35.join)(worktreePath, REPO_REVIEW_PATH));
13453
13488
  if (fromWorktree) return fromWorktree;
13454
13489
  const repo = repoPath?.replace(/\/+$/, "");
13455
13490
  const wt = worktreePath.replace(/\/+$/, "");
13456
13491
  if (!repo || repo === wt) return null;
13457
- return readTextIfPresent((0, import_node_path34.join)(repo, REPO_REVIEW_PATH));
13492
+ return readTextIfPresent((0, import_node_path35.join)(repo, REPO_REVIEW_PATH));
13458
13493
  }
13459
13494
  function ensureReviewGuidelinesFile(worktreePath, repoPath) {
13460
- const skillContent = readTextIfPresent((0, import_node_path34.join)(worktreePath, REVIEW_SKILL_PATH));
13495
+ const skillContent = readTextIfPresent((0, import_node_path35.join)(worktreePath, REVIEW_SKILL_PATH));
13461
13496
  if (skillContent) {
13462
13497
  return { ...skillGuidelines(skillContent, "skill"), wrote: false };
13463
13498
  }
13464
- const contextContent = readTextIfPresent((0, import_node_path34.join)(worktreePath, CONTEXT_REVIEW_PATH));
13499
+ const contextContent = readTextIfPresent((0, import_node_path35.join)(worktreePath, CONTEXT_REVIEW_PATH));
13465
13500
  if (contextContent && !shouldRefreshReviewRequestTemplate(contextContent)) {
13466
13501
  return { ...contextGuidelines(contextContent, "local"), wrote: false };
13467
13502
  }
@@ -13516,13 +13551,13 @@ async function requestReview(threadRef, send) {
13516
13551
  const started = await send(tab.id, REVIEW_REQUEST_PREFILL);
13517
13552
  return { tab: started, from };
13518
13553
  }
13519
- var import_node_crypto7, import_node_fs34, import_node_path34, 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;
13554
+ var import_node_crypto7, import_node_fs35, import_node_path35, 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;
13520
13555
  var init_request_review = __esm({
13521
13556
  "src/review/request-review.ts"() {
13522
13557
  "use strict";
13523
13558
  import_node_crypto7 = require("crypto");
13524
- import_node_fs34 = require("fs");
13525
- import_node_path34 = require("path");
13559
+ import_node_fs35 = require("fs");
13560
+ import_node_path35 = require("path");
13526
13561
  init_global_workspace();
13527
13562
  init_chat_tabs();
13528
13563
  init_thread_store();
@@ -13548,9 +13583,9 @@ function matchSimpleGlob(pattern, name) {
13548
13583
  return new RegExp(`^${escaped}$`).test(name);
13549
13584
  }
13550
13585
  function readWorktreeInclude(repoPath) {
13551
- const path = (0, import_node_path35.join)(repoPath, ".worktreeinclude");
13552
- if (!(0, import_node_fs35.existsSync)(path)) return [];
13553
- return (0, import_node_fs35.readFileSync)(path, "utf8").split("\n").map((l) => l.trim()).filter((l) => l && !l.startsWith("#"));
13586
+ const path = (0, import_node_path36.join)(repoPath, ".worktreeinclude");
13587
+ if (!(0, import_node_fs36.existsSync)(path)) return [];
13588
+ return (0, import_node_fs36.readFileSync)(path, "utf8").split("\n").map((l) => l.trim()).filter((l) => l && !l.startsWith("#"));
13554
13589
  }
13555
13590
  function resolveFilesToCopy(repoPath) {
13556
13591
  const fromInclude = readWorktreeInclude(repoPath);
@@ -13560,10 +13595,10 @@ function resolveFilesToCopy(repoPath) {
13560
13595
  if (settings?.fileIncludeGlobs?.length) {
13561
13596
  const matched = [];
13562
13597
  try {
13563
- for (const entry of (0, import_node_fs35.readdirSync)(repoPath, { withFileTypes: true })) {
13598
+ for (const entry of (0, import_node_fs36.readdirSync)(repoPath, { withFileTypes: true })) {
13564
13599
  if (!entry.isFile()) continue;
13565
13600
  for (const glob of settings.fileIncludeGlobs) {
13566
- if (matchSimpleGlob(glob, entry.name) || matchSimpleGlob((0, import_node_path35.basename)(glob), entry.name)) {
13601
+ if (matchSimpleGlob(glob, entry.name) || matchSimpleGlob((0, import_node_path36.basename)(glob), entry.name)) {
13567
13602
  matched.push(entry.name);
13568
13603
  break;
13569
13604
  }
@@ -13575,7 +13610,7 @@ function resolveFilesToCopy(repoPath) {
13575
13610
  }
13576
13611
  const defaults = [];
13577
13612
  try {
13578
- for (const entry of (0, import_node_fs35.readdirSync)(repoPath, { withFileTypes: true })) {
13613
+ for (const entry of (0, import_node_fs36.readdirSync)(repoPath, { withFileTypes: true })) {
13579
13614
  if (entry.isFile() && entry.name.startsWith(".env")) {
13580
13615
  defaults.push(entry.name);
13581
13616
  }
@@ -13589,11 +13624,11 @@ function copyConfiguredFiles(repoPath, worktreePath) {
13589
13624
  const patterns = resolveFilesToCopy(repoPath);
13590
13625
  const copied = [];
13591
13626
  for (const rel of patterns) {
13592
- const src = (0, import_node_path35.join)(repoPath, rel);
13593
- if (!(0, import_node_fs35.existsSync)(src)) continue;
13594
- const dest = (0, import_node_path35.join)(worktreePath, rel);
13595
- (0, import_node_fs35.mkdirSync)((0, import_node_path35.dirname)(dest), { recursive: true });
13596
- (0, import_node_fs35.copyFileSync)(src, dest);
13627
+ const src = (0, import_node_path36.join)(repoPath, rel);
13628
+ if (!(0, import_node_fs36.existsSync)(src)) continue;
13629
+ const dest = (0, import_node_path36.join)(worktreePath, rel);
13630
+ (0, import_node_fs36.mkdirSync)((0, import_node_path36.dirname)(dest), { recursive: true });
13631
+ (0, import_node_fs36.copyFileSync)(src, dest);
13597
13632
  copied.push(rel);
13598
13633
  }
13599
13634
  return copied;
@@ -13628,7 +13663,7 @@ function buildWorkspaceScriptEnv(opts, baseEnv) {
13628
13663
  const env = stripNestedElectronEnv({
13629
13664
  ...baseEnv ?? process.env
13630
13665
  });
13631
- const name = opts.workspaceName ?? (0, import_node_path35.basename)(opts.worktreePath);
13666
+ const name = opts.workspaceName ?? (0, import_node_path36.basename)(opts.worktreePath);
13632
13667
  const ports = opts.ports ?? [];
13633
13668
  const primary = ports[0];
13634
13669
  env.SIDEBOARD_WORKSPACE_NAME = name;
@@ -13891,13 +13926,13 @@ async function startDevServer(repoPath, worktreePath, onLine, opts) {
13891
13926
  done: handle.done
13892
13927
  };
13893
13928
  }
13894
- var import_node_fs35, import_node_net, import_node_path35, import_execa4, import_node_readline3, PORT_RANGE_SIZE, cachedLoginEnv;
13929
+ var import_node_fs36, import_node_net, import_node_path36, import_execa4, import_node_readline3, PORT_RANGE_SIZE, cachedLoginEnv;
13895
13930
  var init_conductor = __esm({
13896
13931
  "src/hook/conductor.ts"() {
13897
13932
  "use strict";
13898
- import_node_fs35 = require("fs");
13933
+ import_node_fs36 = require("fs");
13899
13934
  import_node_net = require("net");
13900
- import_node_path35 = require("path");
13935
+ import_node_path36 = require("path");
13901
13936
  import_execa4 = require("execa");
13902
13937
  import_node_readline3 = require("readline");
13903
13938
  init_settings();
@@ -13924,7 +13959,7 @@ ${line}` : line;
13924
13959
  return nl >= 0 && nl < cut.length - 1 ? cut.slice(nl + 1) : cut;
13925
13960
  }
13926
13961
  function setupLogPath(threadId) {
13927
- return (0, import_node_path36.join)(threadsDir(), `${threadId}.setup.log.json`);
13962
+ return (0, import_node_path37.join)(threadsDir(), `${threadId}.setup.log.json`);
13928
13963
  }
13929
13964
  function setupLogKeyForWorktree(worktreePath) {
13930
13965
  const norm = normalizeWorktreePath(worktreePath);
@@ -13945,7 +13980,7 @@ function persistNow(threadId) {
13945
13980
  const snap = memory.get(threadId);
13946
13981
  if (!snap) return;
13947
13982
  try {
13948
- (0, import_node_fs36.writeFileSync)(setupLogPath(threadId), `${JSON.stringify(snap)}
13983
+ (0, import_node_fs37.writeFileSync)(setupLogPath(threadId), `${JSON.stringify(snap)}
13949
13984
  `, "utf8");
13950
13985
  } catch {
13951
13986
  }
@@ -13962,9 +13997,9 @@ function schedulePersist(threadId) {
13962
13997
  }
13963
13998
  function loadFromDisk(threadId) {
13964
13999
  const path = setupLogPath(threadId);
13965
- if (!(0, import_node_fs36.existsSync)(path)) return null;
14000
+ if (!(0, import_node_fs37.existsSync)(path)) return null;
13966
14001
  try {
13967
- const raw = JSON.parse((0, import_node_fs36.readFileSync)(path, "utf8"));
14002
+ const raw = JSON.parse((0, import_node_fs37.readFileSync)(path, "utf8"));
13968
14003
  return {
13969
14004
  output: typeof raw.output === "string" ? raw.output : "",
13970
14005
  running: Boolean(raw.running),
@@ -14019,13 +14054,13 @@ function finishSetupLog(threadId, exitCode, source) {
14019
14054
  persistNow(threadId);
14020
14055
  return clone(snap);
14021
14056
  }
14022
- var import_node_crypto8, import_node_fs36, import_node_path36, EMPTY, MAX_SETUP_LOG_CHARS, memory, persistTimers;
14057
+ var import_node_crypto8, import_node_fs37, import_node_path37, EMPTY, MAX_SETUP_LOG_CHARS, memory, persistTimers;
14023
14058
  var init_setup_log = __esm({
14024
14059
  "src/store/setup-log.ts"() {
14025
14060
  "use strict";
14026
14061
  import_node_crypto8 = require("crypto");
14027
- import_node_fs36 = require("fs");
14028
- import_node_path36 = require("path");
14062
+ import_node_fs37 = require("fs");
14063
+ import_node_path37 = require("path");
14029
14064
  init_worktree_labels();
14030
14065
  init_paths();
14031
14066
  EMPTY = {
@@ -14051,9 +14086,9 @@ async function findOrphanWorktrees(repoPaths) {
14051
14086
  repoPaths?.length ? repoPaths : threads.map((t) => t.repoPath).filter(Boolean)
14052
14087
  );
14053
14088
  const homeRoot = sideboardWorkspacesDir();
14054
- if ((0, import_node_fs37.existsSync)(homeRoot)) {
14089
+ if ((0, import_node_fs38.existsSync)(homeRoot)) {
14055
14090
  try {
14056
- for (const entry of (0, import_node_fs37.readdirSync)(homeRoot, { withFileTypes: true })) {
14091
+ for (const entry of (0, import_node_fs38.readdirSync)(homeRoot, { withFileTypes: true })) {
14057
14092
  if (!entry.isDirectory()) continue;
14058
14093
  void entry;
14059
14094
  }
@@ -14063,7 +14098,7 @@ async function findOrphanWorktrees(repoPaths) {
14063
14098
  const orphans = [];
14064
14099
  const seen = /* @__PURE__ */ new Set();
14065
14100
  for (const repoPath of repos) {
14066
- if (!repoPath || !(0, import_node_fs37.existsSync)(repoPath)) continue;
14101
+ if (!repoPath || !(0, import_node_fs38.existsSync)(repoPath)) continue;
14067
14102
  try {
14068
14103
  const wts = await listWorktrees(repoPath);
14069
14104
  for (const wt of wts) {
@@ -14074,7 +14109,7 @@ async function findOrphanWorktrees(repoPaths) {
14074
14109
  seen.add(path);
14075
14110
  let mtimeMs = 0;
14076
14111
  try {
14077
- mtimeMs = (0, import_node_fs37.statSync)(path).mtimeMs;
14112
+ mtimeMs = (0, import_node_fs38.statSync)(path).mtimeMs;
14078
14113
  } catch {
14079
14114
  mtimeMs = 0;
14080
14115
  }
@@ -14084,16 +14119,16 @@ async function findOrphanWorktrees(repoPaths) {
14084
14119
  }
14085
14120
  try {
14086
14121
  const root = worktreesRoot(repoPath);
14087
- if ((0, import_node_fs37.existsSync)(root)) {
14088
- for (const entry of (0, import_node_fs37.readdirSync)(root, { withFileTypes: true })) {
14122
+ if ((0, import_node_fs38.existsSync)(root)) {
14123
+ for (const entry of (0, import_node_fs38.readdirSync)(root, { withFileTypes: true })) {
14089
14124
  if (!entry.isDirectory()) continue;
14090
- const path = (0, import_node_path37.join)(root, entry.name).replace(/\/$/, "");
14125
+ const path = (0, import_node_path38.join)(root, entry.name).replace(/\/$/, "");
14091
14126
  if (known.has(path) || seen.has(path)) continue;
14092
- if (!(0, import_node_fs37.existsSync)((0, import_node_path37.join)(path, ".git"))) continue;
14127
+ if (!(0, import_node_fs38.existsSync)((0, import_node_path38.join)(path, ".git"))) continue;
14093
14128
  seen.add(path);
14094
14129
  let mtimeMs = 0;
14095
14130
  try {
14096
- mtimeMs = (0, import_node_fs37.statSync)(path).mtimeMs;
14131
+ mtimeMs = (0, import_node_fs38.statSync)(path).mtimeMs;
14097
14132
  } catch {
14098
14133
  mtimeMs = Date.now();
14099
14134
  }
@@ -14145,12 +14180,12 @@ function shouldRunWorktreeCleanup(settings = loadAppSettings()) {
14145
14180
  const elapsed = Date.now() - Date.parse(last);
14146
14181
  return elapsed >= intervalHours * 36e5;
14147
14182
  }
14148
- var import_node_fs37, import_node_path37;
14183
+ var import_node_fs38, import_node_path38;
14149
14184
  var init_orphan_cleanup = __esm({
14150
14185
  "src/git/orphan-cleanup.ts"() {
14151
14186
  "use strict";
14152
- import_node_fs37 = require("fs");
14153
- import_node_path37 = require("path");
14187
+ import_node_fs38 = require("fs");
14188
+ import_node_path38 = require("path");
14154
14189
  init_worktree();
14155
14190
  init_thread_store();
14156
14191
  init_paths();
@@ -14253,12 +14288,12 @@ async function cloneRepoIntoSideboard(opts) {
14253
14288
  if (!url) throw new Error("Clone URL is required");
14254
14289
  let name = opts.name?.trim();
14255
14290
  if (!name) {
14256
- const leaf = (0, import_node_path38.basename)(url.replace(/\/$/, "").replace(/\.git$/, ""));
14291
+ const leaf = (0, import_node_path39.basename)(url.replace(/\/$/, "").replace(/\.git$/, ""));
14257
14292
  name = leaf || "repo";
14258
14293
  }
14259
14294
  name = name.replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "repo";
14260
- const dest = (0, import_node_path38.join)(sideboardReposDir(), name);
14261
- if ((0, import_node_fs38.existsSync)(dest)) {
14295
+ const dest = (0, import_node_path39.join)(sideboardReposDir(), name);
14296
+ if ((0, import_node_fs39.existsSync)(dest)) {
14262
14297
  const repoPath2 = await resolveRepoRoot(dest);
14263
14298
  const workspace2 = await ensureWorkspace(repoPath2);
14264
14299
  return { repoPath: repoPath2, workspace: workspace2 };
@@ -14273,12 +14308,12 @@ async function cloneRepoIntoSideboard(opts) {
14273
14308
  const workspace = await ensureWorkspace(repoPath);
14274
14309
  return { repoPath, workspace };
14275
14310
  }
14276
- var import_node_fs38, import_node_path38, import_execa6;
14311
+ var import_node_fs39, import_node_path39, import_execa6;
14277
14312
  var init_clone_repo = __esm({
14278
14313
  "src/git/clone-repo.ts"() {
14279
14314
  "use strict";
14280
- import_node_fs38 = require("fs");
14281
- import_node_path38 = require("path");
14315
+ import_node_fs39 = require("fs");
14316
+ import_node_path39 = require("path");
14282
14317
  import_execa6 = require("execa");
14283
14318
  init_paths();
14284
14319
  init_workspaces2();
@@ -14288,11 +14323,11 @@ var init_clone_repo = __esm({
14288
14323
 
14289
14324
  // src/store/desktop-host.ts
14290
14325
  function desktopHostPidPath() {
14291
- return (0, import_node_path39.join)(appDataDir(), "desktop-host.pid");
14326
+ return (0, import_node_path40.join)(appDataDir(), "desktop-host.pid");
14292
14327
  }
14293
14328
  function readDesktopHostPid() {
14294
14329
  try {
14295
- const pid = Number.parseInt((0, import_node_fs39.readFileSync)(desktopHostPidPath(), "utf8").trim(), 10);
14330
+ const pid = Number.parseInt((0, import_node_fs40.readFileSync)(desktopHostPidPath(), "utf8").trim(), 10);
14296
14331
  if (!Number.isFinite(pid) || pid <= 0) return null;
14297
14332
  return pid;
14298
14333
  } catch {
@@ -14318,12 +14353,12 @@ function thisProcessShouldDrainAgentQueues() {
14318
14353
  if (isThisProcessDesktopHost()) return true;
14319
14354
  return !isDesktopHostAlive();
14320
14355
  }
14321
- var import_node_fs39, import_node_path39;
14356
+ var import_node_fs40, import_node_path40;
14322
14357
  var init_desktop_host = __esm({
14323
14358
  "src/store/desktop-host.ts"() {
14324
14359
  "use strict";
14325
- import_node_fs39 = require("fs");
14326
- import_node_path39 = require("path");
14360
+ import_node_fs40 = require("fs");
14361
+ import_node_path40 = require("path");
14327
14362
  init_paths();
14328
14363
  }
14329
14364
  });
@@ -14438,24 +14473,24 @@ function jobTreeAlive(pid) {
14438
14473
  return jobAlive(pid) || processGroupAlive(pid);
14439
14474
  }
14440
14475
  function readIntFile(file) {
14441
- if (!(0, import_node_fs40.existsSync)(file)) return null;
14442
- const n = Number.parseInt((0, import_node_fs40.readFileSync)(file, "utf8").trim(), 10);
14476
+ if (!(0, import_node_fs41.existsSync)(file)) return null;
14477
+ const n = Number.parseInt((0, import_node_fs41.readFileSync)(file, "utf8").trim(), 10);
14443
14478
  return Number.isInteger(n) ? n : null;
14444
14479
  }
14445
14480
  function jobDir(root, id, legacy = false) {
14446
- return (0, import_node_path40.join)(root, legacy ? LEGACY_DETACHED_JOBS_DIR : DETACHED_JOBS_DIR, id);
14481
+ return (0, import_node_path41.join)(root, legacy ? LEGACY_DETACHED_JOBS_DIR : DETACHED_JOBS_DIR, id);
14447
14482
  }
14448
14483
  function resolveJobDir(root, id) {
14449
14484
  const modern = jobDir(root, id, false);
14450
- if ((0, import_node_fs40.existsSync)(modern)) return modern;
14485
+ if ((0, import_node_fs41.existsSync)(modern)) return modern;
14451
14486
  const legacy = jobDir(root, id, true);
14452
- if ((0, import_node_fs40.existsSync)(legacy)) return legacy;
14487
+ if ((0, import_node_fs41.existsSync)(legacy)) return legacy;
14453
14488
  return modern;
14454
14489
  }
14455
14490
  function listJobIdsIn(root, rel) {
14456
- const dir = (0, import_node_path40.join)(root, rel);
14457
- if (!(0, import_node_fs40.existsSync)(dir)) return [];
14458
- return (0, import_node_fs40.readdirSync)(dir, { withFileTypes: true }).filter((e) => e.isDirectory() && JOB_ID_RE.test(e.name)).map((e) => e.name);
14491
+ const dir = (0, import_node_path41.join)(root, rel);
14492
+ if (!(0, import_node_fs41.existsSync)(dir)) return [];
14493
+ return (0, import_node_fs41.readdirSync)(dir, { withFileTypes: true }).filter((e) => e.isDirectory() && JOB_ID_RE.test(e.name)).map((e) => e.name);
14459
14494
  }
14460
14495
  function listRunningDetachedJobs(worktreePath) {
14461
14496
  const root = worktreePath.trim();
@@ -14467,7 +14502,7 @@ function listRunningDetachedJobs(worktreePath) {
14467
14502
  const running = [];
14468
14503
  for (const id of ids) {
14469
14504
  const dir = resolveJobDir(root, id);
14470
- const pid = readIntFile((0, import_node_path40.join)(dir, "pid"));
14505
+ const pid = readIntFile((0, import_node_path41.join)(dir, "pid"));
14471
14506
  if (jobTreeAlive(pid)) running.push(id);
14472
14507
  }
14473
14508
  return running.sort();
@@ -14549,8 +14584,8 @@ function planJobContinue(opts) {
14549
14584
  return { action: "none" };
14550
14585
  }
14551
14586
  function tailProgress(logFile, maxLines = 12) {
14552
- if (!(0, import_node_fs40.existsSync)(logFile)) return "(no log yet)";
14553
- const lines = (0, import_node_fs40.readFileSync)(logFile, "utf8").split("\n");
14587
+ if (!(0, import_node_fs41.existsSync)(logFile)) return "(no log yet)";
14588
+ const lines = (0, import_node_fs41.readFileSync)(logFile, "utf8").split("\n");
14554
14589
  return lines.slice(-maxLines).join("\n");
14555
14590
  }
14556
14591
  function lastProgressLine(progress) {
@@ -14558,8 +14593,8 @@ function lastProgressLine(progress) {
14558
14593
  return last ? last.slice(0, 72) : void 0;
14559
14594
  }
14560
14595
  function readLogLines(file) {
14561
- if (!(0, import_node_fs40.existsSync)(file)) return [];
14562
- const lines = (0, import_node_fs40.readFileSync)(file, "utf8").split("\n");
14596
+ if (!(0, import_node_fs41.existsSync)(file)) return [];
14597
+ const lines = (0, import_node_fs41.readFileSync)(file, "utf8").split("\n");
14563
14598
  if (lines.length && lines[lines.length - 1] === "") lines.pop();
14564
14599
  return lines;
14565
14600
  }
@@ -14570,15 +14605,15 @@ function takeDelta(logFile, cursorFile) {
14570
14605
  return { delta: capJobLogDelta(lines.slice(start).join("\n")), nextCursor: lines.length };
14571
14606
  }
14572
14607
  function snapshotJob(dir) {
14573
- const pid = readIntFile((0, import_node_path40.join)(dir, "pid"));
14608
+ const pid = readIntFile((0, import_node_path41.join)(dir, "pid"));
14574
14609
  const running = jobTreeAlive(pid);
14575
14610
  return {
14576
14611
  pid,
14577
14612
  running,
14578
- exitCode: readIntFile((0, import_node_path40.join)(dir, "exit")),
14579
- log: (0, import_node_path40.join)(dir, "log"),
14580
- cursor: (0, import_node_path40.join)(dir, "present.cursor"),
14581
- progress: tailProgress((0, import_node_path40.join)(dir, "log"))
14613
+ exitCode: readIntFile((0, import_node_path41.join)(dir, "exit")),
14614
+ log: (0, import_node_path41.join)(dir, "log"),
14615
+ cursor: (0, import_node_path41.join)(dir, "present.cursor"),
14616
+ progress: tailProgress((0, import_node_path41.join)(dir, "log"))
14582
14617
  };
14583
14618
  }
14584
14619
  function toResult(id, snap, extra) {
@@ -14587,8 +14622,8 @@ function toResult(id, snap, extra) {
14587
14622
  const stillRunning = snap.running && !ok;
14588
14623
  const { delta, nextCursor } = takeDelta(snap.log, snap.cursor);
14589
14624
  try {
14590
- (0, import_node_fs40.mkdirSync)((0, import_node_path40.dirname)(snap.cursor), { recursive: true });
14591
- (0, import_node_fs40.writeFileSync)(snap.cursor, `${nextCursor}
14625
+ (0, import_node_fs41.mkdirSync)((0, import_node_path41.dirname)(snap.cursor), { recursive: true });
14626
+ (0, import_node_fs41.writeFileSync)(snap.cursor, `${nextCursor}
14592
14627
  `);
14593
14628
  } catch {
14594
14629
  }
@@ -14617,7 +14652,7 @@ async function waitForDetachedJob(cwd, id, opts) {
14617
14652
  const dir = resolveJobDir(root, jobId);
14618
14653
  const timeoutMs = mcpWaitForJobTimeoutMs(opts?.timeoutMs);
14619
14654
  const sleep = opts?.sleep ?? sleepMs;
14620
- if (!(0, import_node_fs40.existsSync)(dir)) {
14655
+ if (!(0, import_node_fs41.existsSync)(dir)) {
14621
14656
  return {
14622
14657
  stillRunning: false,
14623
14658
  ok: false,
@@ -14663,10 +14698,10 @@ function killProcessTree(pid, signal) {
14663
14698
  }
14664
14699
  function appendJobLog(logFile, line) {
14665
14700
  try {
14666
- (0, import_node_fs40.mkdirSync)((0, import_node_path40.dirname)(logFile), { recursive: true });
14701
+ (0, import_node_fs41.mkdirSync)((0, import_node_path41.dirname)(logFile), { recursive: true });
14667
14702
  const body = line.endsWith("\n") ? line : `${line}
14668
14703
  `;
14669
- (0, import_node_fs40.appendFileSync)(logFile, body);
14704
+ (0, import_node_fs41.appendFileSync)(logFile, body);
14670
14705
  } catch {
14671
14706
  }
14672
14707
  }
@@ -14676,7 +14711,7 @@ async function stopDetachedJob(cwd, id, opts) {
14676
14711
  const dir = resolveJobDir(root, jobId);
14677
14712
  const sleep = opts?.sleep ?? sleepMs;
14678
14713
  const why = opts?.reason?.trim() ?? "";
14679
- if (!(0, import_node_fs40.existsSync)(dir)) {
14714
+ if (!(0, import_node_fs41.existsSync)(dir)) {
14680
14715
  return {
14681
14716
  stillRunning: false,
14682
14717
  ok: false,
@@ -14712,10 +14747,10 @@ async function stopDetachedJob(cwd, id, opts) {
14712
14747
  killProcessTree(targetPid, "SIGKILL");
14713
14748
  await sleep(100);
14714
14749
  }
14715
- const exitFile = (0, import_node_path40.join)(dir, "exit");
14716
- if (!(0, import_node_fs40.existsSync)(exitFile)) {
14750
+ const exitFile = (0, import_node_path41.join)(dir, "exit");
14751
+ if (!(0, import_node_fs41.existsSync)(exitFile)) {
14717
14752
  try {
14718
- (0, import_node_fs40.writeFileSync)(exitFile, "1\n");
14753
+ (0, import_node_fs41.writeFileSync)(exitFile, "1\n");
14719
14754
  } catch {
14720
14755
  }
14721
14756
  }
@@ -14735,12 +14770,12 @@ async function stopDetachedJob(cwd, id, opts) {
14735
14770
  hint: stopped ? MCP_STOP_JOB_HINT : MCP_WAIT_JOB_STILL_RUNNING_HINT
14736
14771
  };
14737
14772
  }
14738
- var import_node_fs40, import_node_path40, 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;
14773
+ var import_node_fs41, import_node_path41, 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;
14739
14774
  var init_wait_for_job = __esm({
14740
14775
  "src/mcp/wait-for-job.ts"() {
14741
14776
  "use strict";
14742
- import_node_fs40 = require("fs");
14743
- import_node_path40 = require("path");
14777
+ import_node_fs41 = require("fs");
14778
+ import_node_path41 = require("path");
14744
14779
  init_workspace_scratch();
14745
14780
  init_wait_for_turn();
14746
14781
  MAX_JOB_CONTINUES = 8;
@@ -15986,7 +16021,7 @@ function reuseLiveThread(input, repoPath, match) {
15986
16021
  }
15987
16022
  async function createThread(input, _onSetupLine) {
15988
16023
  const repoPath = await resolveRepoRoot(input.repoPath);
15989
- if (!(0, import_node_fs41.existsSync)(repoPath)) {
16024
+ if (!(0, import_node_fs42.existsSync)(repoPath)) {
15990
16025
  throw new Error(`Repo not found: ${repoPath}`);
15991
16026
  }
15992
16027
  const reused = reuseLiveThread(input, repoPath, {
@@ -16162,11 +16197,11 @@ async function createThread(input, _onSetupLine) {
16162
16197
  await ensureWorkspace(repoPath);
16163
16198
  return readThread(thread.id) ?? thread;
16164
16199
  }
16165
- var import_node_fs41;
16200
+ var import_node_fs42;
16166
16201
  var init_create = __esm({
16167
16202
  "src/threads/create.ts"() {
16168
16203
  "use strict";
16169
- import_node_fs41 = require("fs");
16204
+ import_node_fs42 = require("fs");
16170
16205
  init_detect();
16171
16206
  init_worktree();
16172
16207
  init_home_board();
@@ -16286,20 +16321,20 @@ function writeTurnLive(threadId, progress) {
16286
16321
  const path = threadLivePath(threadId);
16287
16322
  const tmp = `${path}.${process.pid}.tmp`;
16288
16323
  try {
16289
- (0, import_node_fs42.writeFileSync)(tmp, JSON.stringify(progress), "utf8");
16290
- (0, import_node_fs42.renameSync)(tmp, path);
16324
+ (0, import_node_fs43.writeFileSync)(tmp, JSON.stringify(progress), "utf8");
16325
+ (0, import_node_fs43.renameSync)(tmp, path);
16291
16326
  } catch {
16292
16327
  try {
16293
- (0, import_node_fs42.unlinkSync)(tmp);
16328
+ (0, import_node_fs43.unlinkSync)(tmp);
16294
16329
  } catch {
16295
16330
  }
16296
16331
  }
16297
16332
  }
16298
16333
  function readTurnLive(threadId) {
16299
16334
  const path = threadLivePath(threadId);
16300
- if (!(0, import_node_fs42.existsSync)(path)) return null;
16335
+ if (!(0, import_node_fs43.existsSync)(path)) return null;
16301
16336
  try {
16302
- const raw = JSON.parse((0, import_node_fs42.readFileSync)(path, "utf8"));
16337
+ const raw = JSON.parse((0, import_node_fs43.readFileSync)(path, "utf8"));
16303
16338
  if (!raw || typeof raw.summary !== "string") return null;
16304
16339
  return raw;
16305
16340
  } catch {
@@ -16311,17 +16346,17 @@ function clearTurnLive(threadId) {
16311
16346
  if (buf?.timer) clearTimeout(buf.timer);
16312
16347
  buffers.delete(threadId);
16313
16348
  const path = threadLivePath(threadId);
16314
- if (!(0, import_node_fs42.existsSync)(path)) return;
16349
+ if (!(0, import_node_fs43.existsSync)(path)) return;
16315
16350
  try {
16316
- (0, import_node_fs42.unlinkSync)(path);
16351
+ (0, import_node_fs43.unlinkSync)(path);
16317
16352
  } catch {
16318
16353
  }
16319
16354
  }
16320
- var import_node_fs42, buffers, FLUSH_MS, MAX_PARTS;
16355
+ var import_node_fs43, buffers, FLUSH_MS, MAX_PARTS;
16321
16356
  var init_turn_live = __esm({
16322
16357
  "src/store/turn-live.ts"() {
16323
16358
  "use strict";
16324
- import_node_fs42 = require("fs");
16359
+ import_node_fs43 = require("fs");
16325
16360
  init_message_parts();
16326
16361
  init_paths();
16327
16362
  buffers = /* @__PURE__ */ new Map();
@@ -16538,7 +16573,7 @@ var init_quota_failover = __esm({
16538
16573
  // src/threads/adopt.ts
16539
16574
  function thisModuleFile() {
16540
16575
  const cjsFile = typeof __filename !== "undefined" ? __filename : "";
16541
- return cjsFile || process.argv[1] || (0, import_node_path41.join)(process.cwd(), "package.json");
16576
+ return cjsFile || process.argv[1] || (0, import_node_path42.join)(process.cwd(), "package.json");
16542
16577
  }
16543
16578
  function openReadonlySqlite(file) {
16544
16579
  const req = (0, import_node_module4.createRequire)(thisModuleFile());
@@ -16556,21 +16591,21 @@ function mapAgentType(raw) {
16556
16591
  return null;
16557
16592
  }
16558
16593
  function resolveConductorCursorAgentId(workspacePath) {
16559
- if (!workspacePath || !(0, import_node_fs43.existsSync)(CURSOR_SDK_STORE)) return null;
16594
+ if (!workspacePath || !(0, import_node_fs44.existsSync)(CURSOR_SDK_STORE)) return null;
16560
16595
  const normalized = workspacePath.replace(/\/$/, "");
16561
16596
  let best = null;
16562
16597
  let hashes;
16563
16598
  try {
16564
- hashes = (0, import_node_fs43.readdirSync)(CURSOR_SDK_STORE);
16599
+ hashes = (0, import_node_fs44.readdirSync)(CURSOR_SDK_STORE);
16565
16600
  } catch {
16566
16601
  return null;
16567
16602
  }
16568
16603
  for (const hash of hashes) {
16569
- const agentsFile = (0, import_node_path41.join)(CURSOR_SDK_STORE, hash, "agents.ndjson");
16570
- if (!(0, import_node_fs43.existsSync)(agentsFile)) continue;
16604
+ const agentsFile = (0, import_node_path42.join)(CURSOR_SDK_STORE, hash, "agents.ndjson");
16605
+ if (!(0, import_node_fs44.existsSync)(agentsFile)) continue;
16571
16606
  let text7;
16572
16607
  try {
16573
- text7 = (0, import_node_fs43.readFileSync)(agentsFile, "utf8");
16608
+ text7 = (0, import_node_fs44.readFileSync)(agentsFile, "utf8");
16574
16609
  } catch {
16575
16610
  continue;
16576
16611
  }
@@ -16594,7 +16629,7 @@ function resolveConductorCursorAgentId(workspacePath) {
16594
16629
  return best?.agentId ?? null;
16595
16630
  }
16596
16631
  async function adoptThread(input) {
16597
- if (!(0, import_node_fs43.existsSync)(input.worktreePath)) {
16632
+ if (!(0, import_node_fs44.existsSync)(input.worktreePath)) {
16598
16633
  throw new Error(`Worktree not found: ${input.worktreePath}`);
16599
16634
  }
16600
16635
  const repoPath = await resolveRepoRoot(input.worktreePath);
@@ -16620,18 +16655,18 @@ async function adoptThread(input) {
16620
16655
  return thread;
16621
16656
  }
16622
16657
  function listConductorWorkspaces() {
16623
- if (!(0, import_node_fs43.existsSync)(CONDUCTOR_DB)) {
16658
+ if (!(0, import_node_fs44.existsSync)(CONDUCTOR_DB)) {
16624
16659
  throw new Error(`Conductor DB not found at ${CONDUCTOR_DB}`);
16625
16660
  }
16626
- const tmp = (0, import_node_fs43.mkdtempSync)((0, import_node_path41.join)((0, import_node_os13.tmpdir)(), "sideboard-conductor-"));
16627
- const snapshot = (0, import_node_path41.join)(tmp, "conductor.db");
16661
+ const tmp = (0, import_node_fs44.mkdtempSync)((0, import_node_path42.join)((0, import_node_os14.tmpdir)(), "sideboard-conductor-"));
16662
+ const snapshot = (0, import_node_path42.join)(tmp, "conductor.db");
16628
16663
  try {
16629
- (0, import_node_fs43.copyFileSync)(CONDUCTOR_DB, snapshot);
16664
+ (0, import_node_fs44.copyFileSync)(CONDUCTOR_DB, snapshot);
16630
16665
  for (const suffix of ["-wal", "-shm"]) {
16631
16666
  const src = `${CONDUCTOR_DB}${suffix}`;
16632
- if ((0, import_node_fs43.existsSync)(src)) {
16667
+ if ((0, import_node_fs44.existsSync)(src)) {
16633
16668
  try {
16634
- (0, import_node_fs43.copyFileSync)(src, `${snapshot}${suffix}`);
16669
+ (0, import_node_fs44.copyFileSync)(src, `${snapshot}${suffix}`);
16635
16670
  } catch {
16636
16671
  }
16637
16672
  }
@@ -16707,22 +16742,22 @@ function listConductorWorkspaces() {
16707
16742
  db.close();
16708
16743
  }
16709
16744
  } finally {
16710
- (0, import_node_fs43.rmSync)(tmp, { recursive: true, force: true });
16745
+ (0, import_node_fs44.rmSync)(tmp, { recursive: true, force: true });
16711
16746
  }
16712
16747
  }
16713
16748
  function importConductorWorkspace(workspaceId) {
16714
- if (!(0, import_node_fs43.existsSync)(CONDUCTOR_DB)) {
16749
+ if (!(0, import_node_fs44.existsSync)(CONDUCTOR_DB)) {
16715
16750
  throw new Error(`Conductor DB not found at ${CONDUCTOR_DB}`);
16716
16751
  }
16717
- const tmp = (0, import_node_fs43.mkdtempSync)((0, import_node_path41.join)((0, import_node_os13.tmpdir)(), "sideboard-conductor-"));
16718
- const snapshot = (0, import_node_path41.join)(tmp, "conductor.db");
16752
+ const tmp = (0, import_node_fs44.mkdtempSync)((0, import_node_path42.join)((0, import_node_os14.tmpdir)(), "sideboard-conductor-"));
16753
+ const snapshot = (0, import_node_path42.join)(tmp, "conductor.db");
16719
16754
  try {
16720
- (0, import_node_fs43.copyFileSync)(CONDUCTOR_DB, snapshot);
16755
+ (0, import_node_fs44.copyFileSync)(CONDUCTOR_DB, snapshot);
16721
16756
  for (const suffix of ["-wal", "-shm"]) {
16722
16757
  const src = `${CONDUCTOR_DB}${suffix}`;
16723
- if ((0, import_node_fs43.existsSync)(src)) {
16758
+ if ((0, import_node_fs44.existsSync)(src)) {
16724
16759
  try {
16725
- (0, import_node_fs43.copyFileSync)(src, `${snapshot}${suffix}`);
16760
+ (0, import_node_fs44.copyFileSync)(src, `${snapshot}${suffix}`);
16726
16761
  } catch {
16727
16762
  }
16728
16763
  }
@@ -16740,7 +16775,7 @@ function importConductorWorkspace(workspaceId) {
16740
16775
  ).get(workspaceId);
16741
16776
  if (!row) throw new Error(`Conductor workspace not found: ${workspaceId}`);
16742
16777
  const worktreePath = String(row.workspacePath);
16743
- if (!(0, import_node_fs43.existsSync)(worktreePath)) {
16778
+ if (!(0, import_node_fs44.existsSync)(worktreePath)) {
16744
16779
  throw new Error(`Conductor worktree missing on disk: ${worktreePath}`);
16745
16780
  }
16746
16781
  let sessionId = null;
@@ -16803,31 +16838,31 @@ function importConductorWorkspace(workspaceId) {
16803
16838
  db.close();
16804
16839
  }
16805
16840
  } finally {
16806
- (0, import_node_fs43.rmSync)(tmp, { recursive: true, force: true });
16841
+ (0, import_node_fs44.rmSync)(tmp, { recursive: true, force: true });
16807
16842
  }
16808
16843
  }
16809
16844
  async function importConductorWorkspaceAsync(workspaceId) {
16810
16845
  return importConductorWorkspace(workspaceId);
16811
16846
  }
16812
- var import_node_child_process4, import_node_fs43, import_node_os13, import_node_path41, import_node_module4, CONDUCTOR_APP_SUPPORT, CONDUCTOR_DB, CURSOR_SDK_STORE;
16847
+ var import_node_child_process4, import_node_fs44, import_node_os14, import_node_path42, import_node_module4, CONDUCTOR_APP_SUPPORT, CONDUCTOR_DB, CURSOR_SDK_STORE;
16813
16848
  var init_adopt = __esm({
16814
16849
  "src/threads/adopt.ts"() {
16815
16850
  "use strict";
16816
16851
  import_node_child_process4 = require("child_process");
16817
- import_node_fs43 = require("fs");
16818
- import_node_os13 = require("os");
16819
- import_node_path41 = require("path");
16852
+ import_node_fs44 = require("fs");
16853
+ import_node_os14 = require("os");
16854
+ import_node_path42 = require("path");
16820
16855
  import_node_module4 = require("module");
16821
16856
  init_worktree();
16822
16857
  init_thread_store();
16823
- CONDUCTOR_APP_SUPPORT = (0, import_node_path41.join)(
16858
+ CONDUCTOR_APP_SUPPORT = (0, import_node_path42.join)(
16824
16859
  process.env.HOME ?? "",
16825
16860
  "Library",
16826
16861
  "Application Support",
16827
16862
  "com.conductor.app"
16828
16863
  );
16829
- CONDUCTOR_DB = (0, import_node_path41.join)(CONDUCTOR_APP_SUPPORT, "conductor.db");
16830
- CURSOR_SDK_STORE = (0, import_node_path41.join)(CONDUCTOR_APP_SUPPORT, "cursor-sdk-store");
16864
+ CONDUCTOR_DB = (0, import_node_path42.join)(CONDUCTOR_APP_SUPPORT, "conductor.db");
16865
+ CURSOR_SDK_STORE = (0, import_node_path42.join)(CONDUCTOR_APP_SUPPORT, "cursor-sdk-store");
16831
16866
  }
16832
16867
  });
16833
16868
 
@@ -16894,7 +16929,7 @@ async function openStackLayer(input, _onSetupLine) {
16894
16929
  let createdWorktree = false;
16895
16930
  const trees = await listWorktrees(repoPath);
16896
16931
  const checkedOut = trees.find((w) => w.branch === branchName);
16897
- if (checkedOut?.path && (0, import_node_fs44.existsSync)(checkedOut.path)) {
16932
+ if (checkedOut?.path && (0, import_node_fs45.existsSync)(checkedOut.path)) {
16898
16933
  if (input.reuseExistingWorktree !== false) {
16899
16934
  worktreePath = checkedOut.path;
16900
16935
  } else {
@@ -17036,7 +17071,7 @@ async function initStackFromThread(input, onSetupLine) {
17036
17071
  async function createPrStack(input, onSetupLine) {
17037
17072
  await requireAgent(input.agent);
17038
17073
  const repoPath = await resolveRepoRoot(input.repoPath);
17039
- if (!(0, import_node_fs44.existsSync)(repoPath)) throw new Error(`Repo not found: ${repoPath}`);
17074
+ if (!(0, import_node_fs45.existsSync)(repoPath)) throw new Error(`Repo not found: ${repoPath}`);
17040
17075
  if (!input.branches.length) throw new Error("At least one branch name required");
17041
17076
  const status = await detectGhStack(repoPath);
17042
17077
  if (!status.available) throw new Error(status.reason);
@@ -17103,7 +17138,7 @@ async function createPrStack(input, onSetupLine) {
17103
17138
  }
17104
17139
  }
17105
17140
  const claimed = new Set(threads.map((t) => t.worktreePath));
17106
- if (!claimed.has(bootstrap.worktreePath) && (0, import_node_fs44.existsSync)(bootstrap.worktreePath)) {
17141
+ if (!claimed.has(bootstrap.worktreePath) && (0, import_node_fs45.existsSync)(bootstrap.worktreePath)) {
17107
17142
  try {
17108
17143
  await removeWorktree(repoPath, bootstrap.worktreePath, {
17109
17144
  deleteBranch: bootstrap.branchName
@@ -17113,11 +17148,11 @@ async function createPrStack(input, onSetupLine) {
17113
17148
  }
17114
17149
  return { stack, threads, createdThreadIds };
17115
17150
  }
17116
- var import_node_fs44;
17151
+ var import_node_fs45;
17117
17152
  var init_stack_layers = __esm({
17118
17153
  "src/threads/stack-layers.ts"() {
17119
17154
  "use strict";
17120
- import_node_fs44 = require("fs");
17155
+ import_node_fs45 = require("fs");
17121
17156
  init_detect();
17122
17157
  init_run();
17123
17158
  init_stack();
@@ -17130,7 +17165,7 @@ var init_stack_layers = __esm({
17130
17165
 
17131
17166
  // src/diff/diff.ts
17132
17167
  async function inspectGitWorktree(worktreePath) {
17133
- if (!worktreePath || !(0, import_node_fs45.existsSync)(worktreePath)) return "missing_worktree";
17168
+ if (!worktreePath || !(0, import_node_fs46.existsSync)(worktreePath)) return "missing_worktree";
17134
17169
  const check = await git(["rev-parse", "--is-inside-work-tree"], worktreePath, {
17135
17170
  reject: false
17136
17171
  });
@@ -17138,7 +17173,7 @@ async function inspectGitWorktree(worktreePath) {
17138
17173
  return "ok";
17139
17174
  }
17140
17175
  async function initializeGitRepository(worktreePath) {
17141
- if (!worktreePath || !(0, import_node_fs45.existsSync)(worktreePath)) {
17176
+ if (!worktreePath || !(0, import_node_fs46.existsSync)(worktreePath)) {
17142
17177
  throw new Error("Worktree not found");
17143
17178
  }
17144
17179
  const status = await inspectGitWorktree(worktreePath);
@@ -17272,11 +17307,11 @@ new file mode 100644
17272
17307
  };
17273
17308
  }
17274
17309
  async function untrackedPatch(worktreePath, path, maxHunk) {
17275
- const abs = (0, import_node_path42.join)(worktreePath, path);
17310
+ const abs = (0, import_node_path43.join)(worktreePath, path);
17276
17311
  try {
17277
- const st = (0, import_node_fs45.statSync)(abs);
17312
+ const st = (0, import_node_fs46.statSync)(abs);
17278
17313
  if (st.isFile() && st.size > maxHunk) {
17279
- const buf = (0, import_node_fs45.readFileSync)(abs).subarray(0, maxHunk);
17314
+ const buf = (0, import_node_fs46.readFileSync)(abs).subarray(0, maxHunk);
17280
17315
  return syntheticAddPatch(path, buf.toString("utf8"), maxHunk);
17281
17316
  }
17282
17317
  } catch {
@@ -17765,8 +17800,8 @@ function isImageRelativePath(relativePath) {
17765
17800
  function readWorktreeFileForUpload(worktreePath, relativePath, opts) {
17766
17801
  assertSafeRelativePath(relativePath);
17767
17802
  const maxBytes = opts?.maxBytes ?? DEFAULT_UPLOAD_MAX_BYTES;
17768
- const abs = (0, import_node_path42.join)(worktreePath, relativePath);
17769
- const st = (0, import_node_fs45.statSync)(abs);
17803
+ const abs = (0, import_node_path43.join)(worktreePath, relativePath);
17804
+ const st = (0, import_node_fs46.statSync)(abs);
17770
17805
  if (!st.isFile()) {
17771
17806
  throw new Error(`Not a file: ${relativePath}`);
17772
17807
  }
@@ -17775,7 +17810,7 @@ function readWorktreeFileForUpload(worktreePath, relativePath, opts) {
17775
17810
  `File too large to upload (${st.size} bytes; max ${maxBytes})`
17776
17811
  );
17777
17812
  }
17778
- const buf = (0, import_node_fs45.readFileSync)(abs);
17813
+ const buf = (0, import_node_fs46.readFileSync)(abs);
17779
17814
  return {
17780
17815
  path: relativePath,
17781
17816
  contentBase64: buf.toString("base64"),
@@ -17785,12 +17820,12 @@ function readWorktreeFileForUpload(worktreePath, relativePath, opts) {
17785
17820
  function readWorktreeFile(worktreePath, relativePath, opts) {
17786
17821
  assertSafeRelativePath(relativePath);
17787
17822
  const maxBytes = opts?.maxBytes ?? 2e5;
17788
- const abs = (0, import_node_path42.join)(worktreePath, relativePath);
17789
- const st = (0, import_node_fs45.statSync)(abs);
17823
+ const abs = (0, import_node_path43.join)(worktreePath, relativePath);
17824
+ const st = (0, import_node_fs46.statSync)(abs);
17790
17825
  if (!st.isFile()) {
17791
17826
  throw new Error(`Not a file: ${relativePath}`);
17792
17827
  }
17793
- const buf = (0, import_node_fs45.readFileSync)(abs);
17828
+ const buf = (0, import_node_fs46.readFileSync)(abs);
17794
17829
  if (isImageRelativePath(relativePath)) {
17795
17830
  const maxImageBytes = Math.max(maxBytes, 15e6);
17796
17831
  const truncated2 = buf.length > maxImageBytes;
@@ -17833,9 +17868,9 @@ function assertSafeRelativePath(relativePath) {
17833
17868
  }
17834
17869
  function writeWorktreeFile(worktreePath, relativePath, content) {
17835
17870
  assertSafeRelativePath(relativePath);
17836
- const abs = (0, import_node_path42.join)(worktreePath, relativePath);
17837
- (0, import_node_fs45.mkdirSync)((0, import_node_path42.dirname)(abs), { recursive: true });
17838
- (0, import_node_fs45.writeFileSync)(abs, content, "utf8");
17871
+ const abs = (0, import_node_path43.join)(worktreePath, relativePath);
17872
+ (0, import_node_fs46.mkdirSync)((0, import_node_path43.dirname)(abs), { recursive: true });
17873
+ (0, import_node_fs46.writeFileSync)(abs, content, "utf8");
17839
17874
  return { path: relativePath };
17840
17875
  }
17841
17876
  async function getDiffSummary(worktreePath, repoPath, opts) {
@@ -17852,12 +17887,12 @@ async function getDiffSummary(worktreePath, repoPath, opts) {
17852
17887
  truncated: full.files.length > maxFiles
17853
17888
  };
17854
17889
  }
17855
- var import_node_fs45, import_node_path42, mergeBaseCache, MERGE_BASE_TTL_MS, SHA_RE, IMAGE_EXTENSIONS2, DEFAULT_UPLOAD_MAX_BYTES;
17890
+ var import_node_fs46, import_node_path43, mergeBaseCache, MERGE_BASE_TTL_MS, SHA_RE, IMAGE_EXTENSIONS2, DEFAULT_UPLOAD_MAX_BYTES;
17856
17891
  var init_diff = __esm({
17857
17892
  "src/diff/diff.ts"() {
17858
17893
  "use strict";
17859
- import_node_fs45 = require("fs");
17860
- import_node_path42 = require("path");
17894
+ import_node_fs46 = require("fs");
17895
+ import_node_path43 = require("path");
17861
17896
  init_run();
17862
17897
  init_worktree();
17863
17898
  mergeBaseCache = /* @__PURE__ */ new Map();
@@ -18214,7 +18249,7 @@ function parseFrontmatter(content) {
18214
18249
  }
18215
18250
  function readSkill(skillMd, source) {
18216
18251
  try {
18217
- const content = (0, import_node_fs46.readFileSync)(skillMd, "utf8");
18252
+ const content = (0, import_node_fs47.readFileSync)(skillMd, "utf8");
18218
18253
  const { name: fmName, description } = parseFrontmatter(content);
18219
18254
  const dirName = skillMd.split("/").slice(-2, -1)[0] || "skill";
18220
18255
  const name = fmName || dirName;
@@ -18233,19 +18268,19 @@ function readSkill(skillMd, source) {
18233
18268
  }
18234
18269
  }
18235
18270
  function scanSkillsDir(dir, source, out) {
18236
- if (!(0, import_node_fs46.existsSync)(dir)) return;
18271
+ if (!(0, import_node_fs47.existsSync)(dir)) return;
18237
18272
  let entries;
18238
18273
  try {
18239
- entries = (0, import_node_fs46.readdirSync)(dir);
18274
+ entries = (0, import_node_fs47.readdirSync)(dir);
18240
18275
  } catch {
18241
18276
  return;
18242
18277
  }
18243
18278
  for (const entry of entries) {
18244
18279
  if (entry.startsWith(".")) continue;
18245
- const skillMd = (0, import_node_path43.join)(dir, entry, "SKILL.md");
18246
- if (!(0, import_node_fs46.existsSync)(skillMd)) continue;
18280
+ const skillMd = (0, import_node_path44.join)(dir, entry, "SKILL.md");
18281
+ if (!(0, import_node_fs47.existsSync)(skillMd)) continue;
18247
18282
  try {
18248
- if (!(0, import_node_fs46.statSync)(skillMd).isFile()) continue;
18283
+ if (!(0, import_node_fs47.statSync)(skillMd).isFile()) continue;
18249
18284
  } catch {
18250
18285
  continue;
18251
18286
  }
@@ -18254,24 +18289,24 @@ function scanSkillsDir(dir, source, out) {
18254
18289
  }
18255
18290
  }
18256
18291
  function scanClaudePluginSkills(pluginsRoot, out) {
18257
- if (!(0, import_node_fs46.existsSync)(pluginsRoot)) return;
18292
+ if (!(0, import_node_fs47.existsSync)(pluginsRoot)) return;
18258
18293
  const walk = (dir, depth, lookingForSkillsDir) => {
18259
18294
  if (depth > 7) return;
18260
18295
  let entries;
18261
18296
  try {
18262
- entries = (0, import_node_fs46.readdirSync)(dir);
18297
+ entries = (0, import_node_fs47.readdirSync)(dir);
18263
18298
  } catch {
18264
18299
  return;
18265
18300
  }
18266
18301
  if (lookingForSkillsDir && entries.includes("SKILL.md")) {
18267
- const skill = readSkill((0, import_node_path43.join)(dir, "SKILL.md"), "cli");
18302
+ const skill = readSkill((0, import_node_path44.join)(dir, "SKILL.md"), "cli");
18268
18303
  if (skill) out.push(skill);
18269
18304
  }
18270
18305
  for (const entry of entries) {
18271
18306
  if (entry === "node_modules" || entry === ".git") continue;
18272
- const full = (0, import_node_path43.join)(dir, entry);
18307
+ const full = (0, import_node_path44.join)(dir, entry);
18273
18308
  try {
18274
- if (!(0, import_node_fs46.statSync)(full).isDirectory()) continue;
18309
+ if (!(0, import_node_fs47.statSync)(full).isDirectory()) continue;
18275
18310
  } catch {
18276
18311
  continue;
18277
18312
  }
@@ -18286,20 +18321,20 @@ function scanClaudePluginSkills(pluginsRoot, out) {
18286
18321
  walk(pluginsRoot, 0, false);
18287
18322
  }
18288
18323
  function discoverSkills(worktreePath) {
18289
- const home = (0, import_node_os14.homedir)();
18324
+ const home = (0, import_node_os15.homedir)();
18290
18325
  const collected = [];
18291
18326
  for (const rel of [".claude/skills", ".cursor/skills", ".sideboard/skills", ".brightsy/skills", "skills"]) {
18292
- scanSkillsDir((0, import_node_path43.join)(worktreePath, rel), "workspace", collected);
18327
+ scanSkillsDir((0, import_node_path44.join)(worktreePath, rel), "workspace", collected);
18293
18328
  }
18294
18329
  for (const abs of [
18295
- (0, import_node_path43.join)(home, ".claude/skills"),
18296
- (0, import_node_path43.join)(home, ".cursor/skills"),
18297
- (0, import_node_path43.join)(home, ".sideboard/skills"),
18298
- (0, import_node_path43.join)(home, ".brightsy/skills")
18330
+ (0, import_node_path44.join)(home, ".claude/skills"),
18331
+ (0, import_node_path44.join)(home, ".cursor/skills"),
18332
+ (0, import_node_path44.join)(home, ".sideboard/skills"),
18333
+ (0, import_node_path44.join)(home, ".brightsy/skills")
18299
18334
  ]) {
18300
18335
  scanSkillsDir(abs, "user", collected);
18301
18336
  }
18302
- scanClaudePluginSkills((0, import_node_path43.join)(home, ".claude/plugins"), collected);
18337
+ scanClaudePluginSkills((0, import_node_path44.join)(home, ".claude/plugins"), collected);
18303
18338
  collected.push(...bundledSkills());
18304
18339
  const rank = {
18305
18340
  workspace: 0,
@@ -18325,7 +18360,7 @@ function readSkillBody(skillPath, maxChars = 12e3) {
18325
18360
  \u2026(truncated)` : body;
18326
18361
  }
18327
18362
  }
18328
- const raw = (0, import_node_fs46.readFileSync)(skillPath, "utf8");
18363
+ const raw = (0, import_node_fs47.readFileSync)(skillPath, "utf8");
18329
18364
  if (raw.startsWith("---")) {
18330
18365
  const end = raw.indexOf("\n---", 3);
18331
18366
  if (end >= 0) {
@@ -18339,13 +18374,13 @@ function readSkillBody(skillPath, maxChars = 12e3) {
18339
18374
 
18340
18375
  \u2026(truncated)` : raw;
18341
18376
  }
18342
- var import_node_fs46, import_node_os14, import_node_path43, BUNDLED_SKILL_PREFIX;
18377
+ var import_node_fs47, import_node_os15, import_node_path44, BUNDLED_SKILL_PREFIX;
18343
18378
  var init_discover = __esm({
18344
18379
  "src/skills/discover.ts"() {
18345
18380
  "use strict";
18346
- import_node_fs46 = require("fs");
18347
- import_node_os14 = require("os");
18348
- import_node_path43 = require("path");
18381
+ import_node_fs47 = require("fs");
18382
+ import_node_os15 = require("os");
18383
+ import_node_path44 = require("path");
18349
18384
  init_long_running();
18350
18385
  BUNDLED_SKILL_PREFIX = "bundled:";
18351
18386
  }
@@ -18439,8 +18474,8 @@ var init_expand = __esm({
18439
18474
  // src/skills/detached-job-path.ts
18440
18475
  function detachedJobScriptIn(dir) {
18441
18476
  for (const name of DETACHED_JOB_FILENAMES) {
18442
- const script = (0, import_node_path44.join)(dir, "scripts", name);
18443
- if ((0, import_node_fs47.existsSync)(script)) return script;
18477
+ const script = (0, import_node_path45.join)(dir, "scripts", name);
18478
+ if ((0, import_node_fs48.existsSync)(script)) return script;
18444
18479
  }
18445
18480
  return null;
18446
18481
  }
@@ -18452,11 +18487,11 @@ function packagedDetachedJobPath() {
18452
18487
  function resolveDetachedJobScript() {
18453
18488
  const packaged = packagedDetachedJobPath();
18454
18489
  if (packaged) return packaged;
18455
- let dir = (0, import_node_path44.dirname)((0, import_node_url3.fileURLToPath)(import_meta3.url));
18490
+ let dir = (0, import_node_path45.dirname)((0, import_node_url3.fileURLToPath)(import_meta3.url));
18456
18491
  for (let i = 0; i < 8; i++) {
18457
18492
  const candidate = detachedJobScriptIn(dir);
18458
18493
  if (candidate) return candidate;
18459
- const parent = (0, import_node_path44.dirname)(dir);
18494
+ const parent = (0, import_node_path45.dirname)(dir);
18460
18495
  if (parent === dir) break;
18461
18496
  dir = parent;
18462
18497
  }
@@ -18467,12 +18502,12 @@ function formatDetachedJobInvoke(scriptPath) {
18467
18502
  if (resolved) return `node ${JSON.stringify(resolved)}`;
18468
18503
  return "node scripts/detached-job.cjs";
18469
18504
  }
18470
- var import_node_fs47, import_node_path44, import_node_url3, import_meta3, DETACHED_JOB_FILENAMES;
18505
+ var import_node_fs48, import_node_path45, import_node_url3, import_meta3, DETACHED_JOB_FILENAMES;
18471
18506
  var init_detached_job_path = __esm({
18472
18507
  "src/skills/detached-job-path.ts"() {
18473
18508
  "use strict";
18474
- import_node_fs47 = require("fs");
18475
- import_node_path44 = require("path");
18509
+ import_node_fs48 = require("fs");
18510
+ import_node_path45 = require("path");
18476
18511
  import_node_url3 = require("url");
18477
18512
  init_packaged_runtime();
18478
18513
  import_meta3 = {};
@@ -18632,9 +18667,9 @@ function formatPrGateDirective() {
18632
18667
  }
18633
18668
  function formatProcessGuideDirective(opts) {
18634
18669
  const worktree = opts?.worktreePath?.trim();
18635
- const hasGraphSkill = !!worktree && (0, import_node_fs48.existsSync)((0, import_node_path45.join)(worktree, ".claude/skills/graph-engineering/SKILL.md"));
18636
- const hasReviewSkill = !!worktree && (0, import_node_fs48.existsSync)((0, import_node_path45.join)(worktree, ".claude/skills/review/SKILL.md"));
18637
- const hasInstallSkill = !!worktree && (0, import_node_fs48.existsSync)((0, import_node_path45.join)(worktree, ".claude/skills/worktree-install/SKILL.md"));
18670
+ const hasGraphSkill = !!worktree && (0, import_node_fs49.existsSync)((0, import_node_path46.join)(worktree, ".claude/skills/graph-engineering/SKILL.md"));
18671
+ const hasReviewSkill = !!worktree && (0, import_node_fs49.existsSync)((0, import_node_path46.join)(worktree, ".claude/skills/review/SKILL.md"));
18672
+ const hasInstallSkill = !!worktree && (0, import_node_fs49.existsSync)((0, import_node_path46.join)(worktree, ".claude/skills/worktree-install/SKILL.md"));
18638
18673
  return [
18639
18674
  "Process guides (recurring work only):",
18640
18675
  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,
@@ -18672,12 +18707,12 @@ function formatArtifactDirective() {
18672
18707
  function formatUiReminder() {
18673
18708
  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). ask_user only for a real multiple-choice (not hellos, \u201Cwhat next?\u201D, or after a review) \u2014 reply in chat. Do not say artifacts/CMS UI are unavailable.";
18674
18709
  }
18675
- var import_node_fs48, import_node_path45, PR_GOAL_RE, GITHUB_TICKET_REF, KEYED_TICKET_REF;
18710
+ var import_node_fs49, import_node_path46, PR_GOAL_RE, GITHUB_TICKET_REF, KEYED_TICKET_REF;
18676
18711
  var init_instructions = __esm({
18677
18712
  "src/agents/instructions.ts"() {
18678
18713
  "use strict";
18679
- import_node_fs48 = require("fs");
18680
- import_node_path45 = require("path");
18714
+ import_node_fs49 = require("fs");
18715
+ import_node_path46 = require("path");
18681
18716
  init_git_auth_mode();
18682
18717
  init_branch_prefix();
18683
18718
  init_worktree_labels();
@@ -18901,40 +18936,40 @@ __export(plan_file_exports, {
18901
18936
  writePlanFile: () => writePlanFile
18902
18937
  });
18903
18938
  function ensureAttachmentsGitignore(worktreePath) {
18904
- const gitignoreAbs = (0, import_node_path46.join)(worktreePath, ATTACHMENTS_DIR, ".gitignore");
18905
- if ((0, import_node_fs49.existsSync)(gitignoreAbs)) return;
18906
- (0, import_node_fs49.mkdirSync)((0, import_node_path46.dirname)(gitignoreAbs), { recursive: true });
18907
- (0, import_node_fs49.writeFileSync)(gitignoreAbs, attachmentsGitignoreBody(), "utf8");
18939
+ const gitignoreAbs = (0, import_node_path47.join)(worktreePath, ATTACHMENTS_DIR, ".gitignore");
18940
+ if ((0, import_node_fs50.existsSync)(gitignoreAbs)) return;
18941
+ (0, import_node_fs50.mkdirSync)((0, import_node_path47.dirname)(gitignoreAbs), { recursive: true });
18942
+ (0, import_node_fs50.writeFileSync)(gitignoreAbs, attachmentsGitignoreBody(), "utf8");
18908
18943
  }
18909
18944
  function planFileAbs(worktreePath) {
18910
- return (0, import_node_path46.join)(worktreePath, PLAN_FILE_REL);
18945
+ return (0, import_node_path47.join)(worktreePath, PLAN_FILE_REL);
18911
18946
  }
18912
18947
  function readTextIfPresent2(abs) {
18913
- if (!(0, import_node_fs49.existsSync)(abs)) return null;
18948
+ if (!(0, import_node_fs50.existsSync)(abs)) return null;
18914
18949
  try {
18915
- const content = (0, import_node_fs49.readFileSync)(abs, "utf8");
18950
+ const content = (0, import_node_fs50.readFileSync)(abs, "utf8");
18916
18951
  return content.trim() ? content : null;
18917
18952
  } catch {
18918
18953
  return null;
18919
18954
  }
18920
18955
  }
18921
18956
  function readPlanFile(worktreePath) {
18922
- return readTextIfPresent2(planFileAbs(worktreePath)) ?? readTextIfPresent2((0, import_node_path46.join)(worktreePath, `${LEGACY_ATTACHMENTS_DIR}/plan.md`)) ?? readTextIfPresent2((0, import_node_path46.join)(worktreePath, LEGACY_PLAN_FILE_REL));
18957
+ return readTextIfPresent2(planFileAbs(worktreePath)) ?? readTextIfPresent2((0, import_node_path47.join)(worktreePath, `${LEGACY_ATTACHMENTS_DIR}/plan.md`)) ?? readTextIfPresent2((0, import_node_path47.join)(worktreePath, LEGACY_PLAN_FILE_REL));
18923
18958
  }
18924
18959
  function writePlanFile(worktreePath, content) {
18925
18960
  ensureAttachmentsGitignore(worktreePath);
18926
18961
  const abs = planFileAbs(worktreePath);
18927
- (0, import_node_fs49.mkdirSync)((0, import_node_path46.dirname)(abs), { recursive: true });
18962
+ (0, import_node_fs50.mkdirSync)((0, import_node_path47.dirname)(abs), { recursive: true });
18928
18963
  const body = content.trimEnd() + (content.endsWith("\n") ? "" : "\n");
18929
- (0, import_node_fs49.writeFileSync)(abs, body, "utf8");
18964
+ (0, import_node_fs50.writeFileSync)(abs, body, "utf8");
18930
18965
  return PLAN_FILE_REL;
18931
18966
  }
18932
- var import_node_fs49, import_node_path46;
18967
+ var import_node_fs50, import_node_path47;
18933
18968
  var init_plan_file = __esm({
18934
18969
  "src/plan/plan-file.ts"() {
18935
18970
  "use strict";
18936
- import_node_fs49 = require("fs");
18937
- import_node_path46 = require("path");
18971
+ import_node_fs50 = require("fs");
18972
+ import_node_path47 = require("path");
18938
18973
  init_workspace_scratch();
18939
18974
  init_plan_present();
18940
18975
  init_plan_present();
@@ -18994,7 +19029,7 @@ function setCaffeinateHoldHooks(next) {
18994
19029
  hooks = next;
18995
19030
  }
18996
19031
  function caffeinateHoldPath() {
18997
- return (0, import_node_path47.join)(appDataDir(), "caffeinate-hold.json");
19032
+ return (0, import_node_path48.join)(appDataDir(), "caffeinate-hold.json");
18998
19033
  }
18999
19034
  function processAlive(pid) {
19000
19035
  if (hooks.processAlive) return hooks.processAlive(pid);
@@ -19028,9 +19063,9 @@ function uniqueIds(ids) {
19028
19063
  }
19029
19064
  function readHold() {
19030
19065
  const path = caffeinateHoldPath();
19031
- if (!(0, import_node_fs50.existsSync)(path)) return null;
19066
+ if (!(0, import_node_fs51.existsSync)(path)) return null;
19032
19067
  try {
19033
- const parsed = JSON.parse((0, import_node_fs50.readFileSync)(path, "utf8"));
19068
+ const parsed = JSON.parse((0, import_node_fs51.readFileSync)(path, "utf8"));
19034
19069
  if (typeof parsed?.pid === "number" && parsed.pid > 0) {
19035
19070
  return {
19036
19071
  pid: parsed.pid,
@@ -19052,7 +19087,7 @@ function writeHold(pid, threadIds) {
19052
19087
  }
19053
19088
  function clearHold() {
19054
19089
  try {
19055
- (0, import_node_fs50.unlinkSync)(caffeinateHoldPath());
19090
+ (0, import_node_fs51.unlinkSync)(caffeinateHoldPath());
19056
19091
  } catch {
19057
19092
  }
19058
19093
  }
@@ -19137,13 +19172,13 @@ function releaseCaffeinateHoldForThread(threadId) {
19137
19172
  }
19138
19173
  return setCaffeinateHold(false, { threadId: id });
19139
19174
  }
19140
- var import_node_child_process5, import_node_fs50, import_node_path47, hooks;
19175
+ var import_node_child_process5, import_node_fs51, import_node_path48, hooks;
19141
19176
  var init_caffeinate_hold = __esm({
19142
19177
  "src/store/caffeinate-hold.ts"() {
19143
19178
  "use strict";
19144
19179
  import_node_child_process5 = require("child_process");
19145
- import_node_fs50 = require("fs");
19146
- import_node_path47 = require("path");
19180
+ import_node_fs51 = require("fs");
19181
+ import_node_path48 = require("path");
19147
19182
  init_paths();
19148
19183
  init_private_file();
19149
19184
  hooks = {};
@@ -19152,7 +19187,7 @@ var init_caffeinate_hold = __esm({
19152
19187
 
19153
19188
  // src/store/schedules.ts
19154
19189
  function schedulesPath() {
19155
- return (0, import_node_path48.join)(appDataDir(), "schedules.json");
19190
+ return (0, import_node_path49.join)(appDataDir(), "schedules.json");
19156
19191
  }
19157
19192
  function parseDurationMs(every) {
19158
19193
  const m = every.trim().match(DURATION_RE);
@@ -19252,9 +19287,9 @@ function normalizeTask(raw) {
19252
19287
  }
19253
19288
  function readAll2() {
19254
19289
  const path = schedulesPath();
19255
- if (!(0, import_node_fs51.existsSync)(path)) return [];
19290
+ if (!(0, import_node_fs52.existsSync)(path)) return [];
19256
19291
  try {
19257
- const parsed = JSON.parse((0, import_node_fs51.readFileSync)(path, "utf8"));
19292
+ const parsed = JSON.parse((0, import_node_fs52.readFileSync)(path, "utf8"));
19258
19293
  if (!Array.isArray(parsed)) return [];
19259
19294
  return parsed.map((row) => {
19260
19295
  try {
@@ -19366,13 +19401,13 @@ function recordScheduleRun(id, result) {
19366
19401
  writeAll2(rows);
19367
19402
  return next;
19368
19403
  }
19369
- var import_node_crypto10, import_node_fs51, import_node_path48, import_croner, DURATION_RE, UNIT_MS;
19404
+ var import_node_crypto10, import_node_fs52, import_node_path49, import_croner, DURATION_RE, UNIT_MS;
19370
19405
  var init_schedules = __esm({
19371
19406
  "src/store/schedules.ts"() {
19372
19407
  "use strict";
19373
19408
  import_node_crypto10 = require("crypto");
19374
- import_node_fs51 = require("fs");
19375
- import_node_path48 = require("path");
19409
+ import_node_fs52 = require("fs");
19410
+ import_node_path49 = require("path");
19376
19411
  import_croner = require("croner");
19377
19412
  init_orchestrator_capable();
19378
19413
  init_paths();
@@ -19514,13 +19549,13 @@ var init_schedule_runner = __esm({
19514
19549
 
19515
19550
  // src/agents/cursor-store.ts
19516
19551
  function cursorSdkStoreDir(threadId) {
19517
- const root = (0, import_node_path49.join)(appDataDir(), CURSOR_SDK_STORE_DIR);
19552
+ const root = (0, import_node_path50.join)(appDataDir(), CURSOR_SDK_STORE_DIR);
19518
19553
  const id = sanitizeCursorStoreSegment(threadId);
19519
19554
  if (!id) return root;
19520
- return (0, import_node_path49.join)(root, "threads", id);
19555
+ return (0, import_node_path50.join)(root, "threads", id);
19521
19556
  }
19522
19557
  function cursorSdkRunsNdjsonPath(threadId) {
19523
- return (0, import_node_path49.join)(cursorSdkStoreDir(threadId), "runs.ndjson");
19558
+ return (0, import_node_path50.join)(cursorSdkStoreDir(threadId), "runs.ndjson");
19524
19559
  }
19525
19560
  function cursorSdkRunsNdjsonSearchPaths(threadId) {
19526
19561
  const scoped = cursorSdkRunsNdjsonPath(threadId);
@@ -19533,11 +19568,11 @@ function cursorSdkRunsNdjsonSearchPaths(threadId) {
19533
19568
  function sanitizeCursorStoreSegment(threadId) {
19534
19569
  return (threadId ?? "").trim().replace(/[^a-zA-Z0-9._-]/g, "_");
19535
19570
  }
19536
- var import_node_path49, CURSOR_SDK_STORE_DIR;
19571
+ var import_node_path50, CURSOR_SDK_STORE_DIR;
19537
19572
  var init_cursor_store = __esm({
19538
19573
  "src/agents/cursor-store.ts"() {
19539
19574
  "use strict";
19540
- import_node_path49 = require("path");
19575
+ import_node_path50 = require("path");
19541
19576
  init_paths();
19542
19577
  CURSOR_SDK_STORE_DIR = "cursor-sdk-store";
19543
19578
  }
@@ -19559,9 +19594,9 @@ function recoverFinishedCursorRun(opts) {
19559
19594
  return best;
19560
19595
  }
19561
19596
  function scanFinishedCursorRuns(runsPath, agentId, startedAfterMs) {
19562
- if (!(0, import_node_fs52.existsSync)(runsPath)) return null;
19597
+ if (!(0, import_node_fs53.existsSync)(runsPath)) return null;
19563
19598
  try {
19564
- const lines = (0, import_node_fs52.readFileSync)(runsPath, "utf8").split("\n");
19599
+ const lines = (0, import_node_fs53.readFileSync)(runsPath, "utf8").split("\n");
19565
19600
  let best = null;
19566
19601
  for (const line of lines) {
19567
19602
  const trimmed = line.trim();
@@ -19587,11 +19622,11 @@ function scanFinishedCursorRuns(runsPath, agentId, startedAfterMs) {
19587
19622
  return null;
19588
19623
  }
19589
19624
  }
19590
- var import_node_fs52;
19625
+ var import_node_fs53;
19591
19626
  var init_cursor_recover = __esm({
19592
19627
  "src/agents/cursor-recover.ts"() {
19593
19628
  "use strict";
19594
- import_node_fs52 = require("fs");
19629
+ import_node_fs53 = require("fs");
19595
19630
  init_cursor_store();
19596
19631
  }
19597
19632
  });
@@ -19738,13 +19773,13 @@ async function startOrchestration(opts) {
19738
19773
  }
19739
19774
  return updated;
19740
19775
  }
19741
- var import_node_events, import_node_fs53, LIVE_TURN_SPAWN_GRACE_MS, STALE_AGENT_PID_WAIT_MS, Orchestrator, singleton;
19776
+ var import_node_events, import_node_fs54, LIVE_TURN_SPAWN_GRACE_MS, STALE_AGENT_PID_WAIT_MS, Orchestrator, singleton;
19742
19777
  var init_orchestrator = __esm({
19743
19778
  "src/orchestrator/orchestrator.ts"() {
19744
19779
  "use strict";
19745
19780
  import_node_events = require("events");
19746
19781
  init_outbound_watch();
19747
- import_node_fs53 = require("fs");
19782
+ import_node_fs54 = require("fs");
19748
19783
  init_error_detail();
19749
19784
  init_run();
19750
19785
  init_stale_lock();
@@ -19918,7 +19953,7 @@ var init_orchestrator = __esm({
19918
19953
  }
19919
19954
  continue;
19920
19955
  }
19921
- if (!(0, import_node_fs53.existsSync)(thread.worktreePath)) {
19956
+ if (!(0, import_node_fs54.existsSync)(thread.worktreePath)) {
19922
19957
  setStatus(thread.id, "broken", "Worktree missing on disk");
19923
19958
  this.emit({ type: "status_changed", threadId: thread.id, status: "broken" });
19924
19959
  continue;
@@ -21865,7 +21900,7 @@ var init_orchestrator = __esm({
21865
21900
  this.emit({ type: "status_changed", threadId: restored2.id, status: restored2.status });
21866
21901
  return restored2;
21867
21902
  }
21868
- if (!(0, import_node_fs53.existsSync)(thread.worktreePath)) {
21903
+ if (!(0, import_node_fs54.existsSync)(thread.worktreePath)) {
21869
21904
  if (isCowboyThread(thread) || isPrimaryCheckoutThread(thread)) {
21870
21905
  throw new Error(
21871
21906
  `Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
@@ -21949,7 +21984,7 @@ var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
21949
21984
  var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
21950
21985
  var import_zod9 = require("zod");
21951
21986
  var import_node_crypto13 = require("crypto");
21952
- var import_node_path52 = require("path");
21987
+ var import_node_path53 = require("path");
21953
21988
  init_orchestrator();
21954
21989
  init_worktree();
21955
21990
 
@@ -25352,27 +25387,27 @@ init_gh_errors();
25352
25387
  init_git_auth_mode();
25353
25388
 
25354
25389
  // src/board/load-home-board.ts
25355
- var import_node_fs55 = require("fs");
25356
- var import_node_path51 = require("path");
25390
+ var import_node_fs56 = require("fs");
25391
+ var import_node_path52 = require("path");
25357
25392
  init_worktree();
25358
25393
  init_paths();
25359
25394
 
25360
25395
  // src/board/board-pins.ts
25361
25396
  var import_node_crypto12 = require("crypto");
25362
- var import_node_fs54 = require("fs");
25363
- var import_node_path50 = require("path");
25397
+ var import_node_fs55 = require("fs");
25398
+ var import_node_path51 = require("path");
25364
25399
  init_paths();
25365
25400
  init_home_board();
25366
25401
  var FILE = "home-board-pins.json";
25367
25402
  var VERSION = 1;
25368
25403
  function pinsFile() {
25369
- return (0, import_node_path50.join)(appDataDir(), FILE);
25404
+ return (0, import_node_path51.join)(appDataDir(), FILE);
25370
25405
  }
25371
25406
  function readDisk() {
25372
25407
  const path = pinsFile();
25373
- if (!(0, import_node_fs54.existsSync)(path)) return [];
25408
+ if (!(0, import_node_fs55.existsSync)(path)) return [];
25374
25409
  try {
25375
- const raw = JSON.parse((0, import_node_fs54.readFileSync)(path, "utf8"));
25410
+ const raw = JSON.parse((0, import_node_fs55.readFileSync)(path, "utf8"));
25376
25411
  if (raw?.version !== VERSION || !Array.isArray(raw.items)) return [];
25377
25412
  return raw.items.filter((item) => item?.id && item.kind && item.ref);
25378
25413
  } catch {
@@ -25380,8 +25415,8 @@ function readDisk() {
25380
25415
  }
25381
25416
  }
25382
25417
  function writeDisk(items) {
25383
- (0, import_node_fs54.mkdirSync)(appDataDir(), { recursive: true });
25384
- (0, import_node_fs54.writeFileSync)(pinsFile(), JSON.stringify({ version: VERSION, items }, null, 2), "utf8");
25418
+ (0, import_node_fs55.mkdirSync)(appDataDir(), { recursive: true });
25419
+ (0, import_node_fs55.writeFileSync)(pinsFile(), JSON.stringify({ version: VERSION, items }, null, 2), "utf8");
25385
25420
  }
25386
25421
  function listBoardPins() {
25387
25422
  return readDisk();
@@ -25402,7 +25437,7 @@ function homeBoardWorkspaceKey(workspaces) {
25402
25437
  return workspaces.map((w) => w.path).filter(Boolean).sort().join("\n");
25403
25438
  }
25404
25439
  function cacheFile() {
25405
- return (0, import_node_path51.join)(appDataDir(), "home-board-cache.json");
25440
+ return (0, import_node_path52.join)(appDataDir(), "home-board-cache.json");
25406
25441
  }
25407
25442
  function emptyInputs() {
25408
25443
  return {
@@ -25428,9 +25463,9 @@ function shouldCacheHomeBoardInputs(inputs) {
25428
25463
  }
25429
25464
  function readDiskCache() {
25430
25465
  const path = cacheFile();
25431
- if (!(0, import_node_fs55.existsSync)(path)) return null;
25466
+ if (!(0, import_node_fs56.existsSync)(path)) return null;
25432
25467
  try {
25433
- const raw = JSON.parse((0, import_node_fs55.readFileSync)(path, "utf8"));
25468
+ const raw = JSON.parse((0, import_node_fs56.readFileSync)(path, "utf8"));
25434
25469
  if (raw?.version !== CACHE_VERSION || typeof raw.fetchedAt !== "number") {
25435
25470
  return null;
25436
25471
  }
@@ -25444,8 +25479,8 @@ function readDiskCache() {
25444
25479
  }
25445
25480
  function writeDiskCache(entry) {
25446
25481
  try {
25447
- (0, import_node_fs55.mkdirSync)(appDataDir(), { recursive: true });
25448
- (0, import_node_fs55.writeFileSync)(cacheFile(), JSON.stringify(entry), "utf8");
25482
+ (0, import_node_fs56.mkdirSync)(appDataDir(), { recursive: true });
25483
+ (0, import_node_fs56.writeFileSync)(cacheFile(), JSON.stringify(entry), "utf8");
25449
25484
  } catch {
25450
25485
  }
25451
25486
  }
@@ -25832,7 +25867,7 @@ async function startMcpServer() {
25832
25867
  async () => {
25833
25868
  const threads = orch.getThreads(true);
25834
25869
  const lines = threads.map((t) => {
25835
- const repo = t.repoPath === GLOBAL_WORKSPACE_ID ? "Orchestration" : (0, import_node_path52.basename)(t.repoPath) || t.repoPath;
25870
+ const repo = t.repoPath === GLOBAL_WORKSPACE_ID ? "Orchestration" : (0, import_node_path53.basename)(t.repoPath) || t.repoPath;
25836
25871
  const live = orch.threadLooksLive(t) ? readTurnLive(t.id) : null;
25837
25872
  const parent = t.parentThreadId ? ` parent:${t.parentThreadId.slice(0, 8)}` : "";
25838
25873
  const preview = lastMessagePreview(t.messages, 80);