@staff0rd/assist 0.565.0 → 0.565.1

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.
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.565.0",
9
+ version: "0.565.1",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -676,8 +676,8 @@ function projectConfigPathFrom(cwd) {
676
676
  const clone = linkedWorktree(cwd)?.clone;
677
677
  return getConfigPathFrom(clone ?? cwd);
678
678
  }
679
- function loadConfigFrom(cwd) {
680
- const globalRaw = loadRawYaml(getGlobalConfigPath());
679
+ function loadConfigFrom(cwd, globalConfigPath = getGlobalConfigPath()) {
680
+ const globalRaw = loadRawYaml(globalConfigPath);
681
681
  const projectRaw = loadRawYaml(projectConfigPathFrom(cwd));
682
682
  const repoOverride = globalRaw.repos ? resolveRepoOverride(globalRaw, getCurrentOrigin(cwd)) : {};
683
683
  const globalWithRepo = mergeRawConfigs(globalRaw, repoOverride);
@@ -698,11 +698,11 @@ function loadConfig() {
698
698
  function loadProjectConfig(cwd = process.cwd()) {
699
699
  return loadRawYaml(projectConfigPathFrom(cwd));
700
700
  }
701
- function loadGlobalConfigRaw() {
702
- return loadRawYaml(getGlobalConfigPath());
701
+ function loadGlobalConfigRaw(globalConfigPath = getGlobalConfigPath()) {
702
+ return loadRawYaml(globalConfigPath);
703
703
  }
704
- function saveGlobalConfig(config) {
705
- writeFileSync(getGlobalConfigPath(), stringifyYaml(config, { lineWidth: 0 }));
704
+ function saveGlobalConfig(config, globalConfigPath = getGlobalConfigPath()) {
705
+ writeFileSync(globalConfigPath, stringifyYaml(config, { lineWidth: 0 }));
706
706
  }
707
707
  function saveConfig(config, cwd = process.cwd()) {
708
708
  const configPath = projectConfigPathFrom(cwd);
@@ -10995,6 +10995,73 @@ async function getBackups(_req, res) {
10995
10995
  respondJson(res, 200, await listBackups(await getDb()));
10996
10996
  }
10997
10997
 
10998
+ // src/shared/globalConfigTargetFor.ts
10999
+ import { existsSync as existsSync30 } from "fs";
11000
+ import { posix as posix2 } from "path";
11001
+
11002
+ // src/shared/windowsHomeFromWsl.ts
11003
+ import { posix } from "path";
11004
+ function windowsHomeFromWsl() {
11005
+ const projectsRootUnderWinHome = loadConfig().sessions?.windowsProjectsRoot;
11006
+ if (!projectsRootUnderWinHome) return null;
11007
+ return posix.dirname(posix.dirname(projectsRootUnderWinHome));
11008
+ }
11009
+
11010
+ // src/shared/globalConfigTargetFor.ts
11011
+ function globalConfigTargetFor(cwd) {
11012
+ if (!shouldProxyToWindows(cwd))
11013
+ return { ok: true, path: getGlobalConfigPath() };
11014
+ const winHome = windowsHomeFromWsl();
11015
+ if (!winHome)
11016
+ return {
11017
+ ok: false,
11018
+ error: `${cwd} runs on the Windows host, whose ~/.assist.yml cannot be located because sessions.windowsProjectsRoot is unset. Set it with: assist config set sessions.windowsProjectsRoot /mnt/c/Users/<you>/.claude/projects`
11019
+ };
11020
+ if (!existsSync30(winHome))
11021
+ return {
11022
+ ok: false,
11023
+ error: `${cwd} runs on the Windows host, whose home ${winHome} is not reachable from here. Check that the Windows drive is mounted and sessions.windowsProjectsRoot points at it.`
11024
+ };
11025
+ return { ok: true, path: posix2.join(winHome, ".assist.yml") };
11026
+ }
11027
+
11028
+ // src/commands/config/globalConfigFileLabel.ts
11029
+ var WINDOWS_MOUNT_PREFIX = "/mnt/";
11030
+ function globalConfigFileLabel(path80) {
11031
+ if (path80 === getGlobalConfigPath()) return "~/.assist.yml";
11032
+ if (path80.startsWith(WINDOWS_MOUNT_PREFIX))
11033
+ return `${path80} on the Windows host`;
11034
+ return path80;
11035
+ }
11036
+
11037
+ // src/commands/config/readRawConfigLayers.ts
11038
+ function readRawConfigLayers(cwd, globalConfigPath = getGlobalConfigPath()) {
11039
+ const global = loadRawYaml(globalConfigPath);
11040
+ if (!global.repos)
11041
+ return {
11042
+ project: loadRawYaml(projectConfigPathFrom(cwd)),
11043
+ global,
11044
+ repoOverride: {}
11045
+ };
11046
+ const origin = getCurrentOrigin(cwd);
11047
+ return {
11048
+ project: loadRawYaml(projectConfigPathFrom(cwd)),
11049
+ global,
11050
+ repoOverride: resolveRepoOverride(global, origin),
11051
+ repoKey: matchRepoConfigKey(global, origin)
11052
+ };
11053
+ }
11054
+
11055
+ // src/commands/config/configEntryContext.ts
11056
+ function configEntryContext(cwd, globalConfigPath) {
11057
+ return {
11058
+ config: loadConfigFrom(cwd, globalConfigPath),
11059
+ layers: readRawConfigLayers(cwd, globalConfigPath),
11060
+ globalConfigFile: globalConfigFileLabel(globalConfigPath),
11061
+ schema: describeConfigNode(assistConfigSchema)
11062
+ };
11063
+ }
11064
+
10998
11065
  // src/shared/configNodeFieldName.ts
10999
11066
  function configNodeFieldName(node) {
11000
11067
  const last = node.path.at(-1);
@@ -11067,13 +11134,6 @@ function redactConfigSecrets(value, node) {
11067
11134
  return mapConfigSecrets(value, node, () => REDACTED_SECRET);
11068
11135
  }
11069
11136
 
11070
- // src/commands/config/configHelpForKey.ts
11071
- var byKey;
11072
- function configHelpForKey(key) {
11073
- byKey ??= new Map(configHelpEntries.map((entry) => [entry.key, entry]));
11074
- return byKey.get(key);
11075
- }
11076
-
11077
11137
  // src/commands/config/getNestedValue.ts
11078
11138
  function isTraversable(value) {
11079
11139
  return value !== null && value !== void 0 && typeof value === "object";
@@ -11102,41 +11162,6 @@ function configEntryLayers(key, layers, node) {
11102
11162
  return entryLayers;
11103
11163
  }
11104
11164
 
11105
- // src/commands/config/isGlobalOnlyConfigKey.ts
11106
- var GLOBAL_ONLY_KEYS = ["sync.autoConfirm"];
11107
- function isGlobalOnlyConfigKey(key) {
11108
- return GLOBAL_ONLY_KEYS.some((k) => key.startsWith(k));
11109
- }
11110
-
11111
- // src/commands/config/readRawConfigLayers.ts
11112
- function readRawConfigLayers(cwd) {
11113
- const global = loadRawYaml(getGlobalConfigPath());
11114
- if (!global.repos)
11115
- return {
11116
- project: loadRawYaml(projectConfigPathFrom(cwd)),
11117
- global,
11118
- repoOverride: {}
11119
- };
11120
- const origin = getCurrentOrigin(cwd);
11121
- return {
11122
- project: loadRawYaml(projectConfigPathFrom(cwd)),
11123
- global,
11124
- repoOverride: resolveRepoOverride(global, origin),
11125
- repoKey: matchRepoConfigKey(global, origin)
11126
- };
11127
- }
11128
-
11129
- // src/commands/config/resolveConfigSources.ts
11130
- function resolveConfigSources(key, layers) {
11131
- const sources = [];
11132
- if (getNestedValue(layers.project, key) !== void 0)
11133
- sources.push("project");
11134
- if (getNestedValue(layers.repoOverride, key) !== void 0)
11135
- sources.push("repo");
11136
- if (getNestedValue(layers.global, key) !== void 0) sources.push("global");
11137
- return sources;
11138
- }
11139
-
11140
11165
  // src/shared/findConfigNode.ts
11141
11166
  function objectField(node, segment) {
11142
11167
  if (segment.kind !== "key") return void 0;
@@ -11217,38 +11242,68 @@ function configEntryNode(root, key) {
11217
11242
  return path80 ? findConfigNode(root, path80) : void 0;
11218
11243
  }
11219
11244
 
11245
+ // src/commands/config/configHelpForKey.ts
11246
+ var byKey;
11247
+ function configHelpForKey(key) {
11248
+ byKey ??= new Map(configHelpEntries.map((entry) => [entry.key, entry]));
11249
+ return byKey.get(key);
11250
+ }
11251
+
11252
+ // src/commands/config/isGlobalOnlyConfigKey.ts
11253
+ var GLOBAL_ONLY_KEYS = ["sync.autoConfirm"];
11254
+ function isGlobalOnlyConfigKey(key) {
11255
+ return GLOBAL_ONLY_KEYS.some((k) => key.startsWith(k));
11256
+ }
11257
+
11258
+ // src/commands/config/resolveConfigSources.ts
11259
+ function resolveConfigSources(key, layers) {
11260
+ const sources = [];
11261
+ if (getNestedValue(layers.project, key) !== void 0)
11262
+ sources.push("project");
11263
+ if (getNestedValue(layers.repoOverride, key) !== void 0)
11264
+ sources.push("repo");
11265
+ if (getNestedValue(layers.global, key) !== void 0) sources.push("global");
11266
+ return sources;
11267
+ }
11268
+
11269
+ // src/commands/config/configEntryFor.ts
11270
+ function configEntryFor(leaf, { config, layers, globalConfigFile, schema: schema2 }) {
11271
+ const sources = resolveConfigSources(leaf.key, layers);
11272
+ const node = configEntryNode(schema2, leaf.key);
11273
+ const help = configHelpForKey(leaf.key);
11274
+ return {
11275
+ ...leaf,
11276
+ ...help ? { note: help.note, setter: help.setter } : {},
11277
+ ...leaf.defaultValue === void 0 ? {} : { defaultValue: redactConfigSecrets(leaf.defaultValue, node) },
11278
+ value: redactConfigSecrets(getNestedValue(config, leaf.key), node),
11279
+ source: sources[0] ?? "default",
11280
+ sources,
11281
+ layers: configEntryLayers(leaf.key, layers, node),
11282
+ ...layers.repoKey ? { repoKey: layers.repoKey } : {},
11283
+ globalConfigFile,
11284
+ globalOnly: isGlobalOnlyConfigKey(leaf.key),
11285
+ node
11286
+ };
11287
+ }
11288
+
11220
11289
  // src/commands/config/readConfigEntries.ts
11221
11290
  var KEYS_STRIPPED_FROM_MERGED_CONFIG = /* @__PURE__ */ new Set(["repos"]);
11222
- function readConfigEntries(cwd) {
11223
- const config = loadConfigFrom(cwd);
11224
- const layers = readRawConfigLayers(cwd);
11225
- const schema2 = describeConfigNode(assistConfigSchema);
11226
- return describeConfigLeaves(assistConfigSchema).filter((leaf) => !KEYS_STRIPPED_FROM_MERGED_CONFIG.has(leaf.key)).map((leaf) => {
11227
- const sources = resolveConfigSources(leaf.key, layers);
11228
- const source = sources[0] ?? "default";
11229
- const node = configEntryNode(schema2, leaf.key);
11230
- const help = configHelpForKey(leaf.key);
11231
- return {
11232
- ...leaf,
11233
- ...help ? { note: help.note, setter: help.setter } : {},
11234
- ...leaf.defaultValue === void 0 ? {} : { defaultValue: redactConfigSecrets(leaf.defaultValue, node) },
11235
- value: redactConfigSecrets(getNestedValue(config, leaf.key), node),
11236
- source,
11237
- sources,
11238
- layers: configEntryLayers(leaf.key, layers, node),
11239
- ...layers.repoKey ? { repoKey: layers.repoKey } : {},
11240
- globalOnly: isGlobalOnlyConfigKey(leaf.key),
11241
- node
11242
- };
11243
- });
11291
+ function readConfigEntries(cwd, globalConfigPath = getGlobalConfigPath()) {
11292
+ const context = configEntryContext(cwd, globalConfigPath);
11293
+ return describeConfigLeaves(assistConfigSchema).filter((leaf) => !KEYS_STRIPPED_FROM_MERGED_CONFIG.has(leaf.key)).map((leaf) => configEntryFor(leaf, context));
11244
11294
  }
11245
11295
 
11246
11296
  // src/commands/sessions/web/getConfig.ts
11247
11297
  function getConfig(req, res) {
11248
11298
  const cwd = getCwdParam(req, res);
11249
11299
  if (!cwd) return;
11300
+ const target = globalConfigTargetFor(cwd);
11301
+ if (!target.ok) {
11302
+ respondJson(res, 500, { error: target.error });
11303
+ return;
11304
+ }
11250
11305
  try {
11251
- respondJson(res, 200, readConfigEntries(toGitCwd(cwd)));
11306
+ respondJson(res, 200, readConfigEntries(toGitCwd(cwd), target.path));
11252
11307
  } catch (error) {
11253
11308
  respondJson(res, 500, {
11254
11309
  error: error instanceof Error ? error.message : "Failed to read config"
@@ -11312,14 +11367,14 @@ import { basename as basename9, join as join30 } from "path";
11312
11367
  import { promisify as promisify3 } from "util";
11313
11368
 
11314
11369
  // src/commands/sessions/web/findSynthesisForBranch.ts
11315
- import { existsSync as existsSync30, readdirSync as readdirSync2, statSync as statSync4 } from "fs";
11370
+ import { existsSync as existsSync31, readdirSync as readdirSync2, statSync as statSync4 } from "fs";
11316
11371
  import { basename as basename8, dirname as dirname21, join as join29 } from "path";
11317
11372
  function findSynthesisForBranch(repoReviewsDir, branch2) {
11318
11373
  const branchKeyPath = join29(repoReviewsDir, `${branch2}-`);
11319
11374
  const parent = dirname21(branchKeyPath);
11320
11375
  const branchPrefix = basename8(branchKeyPath);
11321
- if (!existsSync30(parent)) return null;
11322
- const synthesisFiles = readdirSync2(parent).filter((name) => name.startsWith(branchPrefix)).map((name) => join29(parent, name, "synthesis.md")).filter((path80) => existsSync30(path80)).map((path80) => ({ path: path80, mtime: statSync4(path80).mtimeMs })).sort((a, b) => b.mtime - a.mtime);
11376
+ if (!existsSync31(parent)) return null;
11377
+ const synthesisFiles = readdirSync2(parent).filter((name) => name.startsWith(branchPrefix)).map((name) => join29(parent, name, "synthesis.md")).filter((path80) => existsSync31(path80)).map((path80) => ({ path: path80, mtime: statSync4(path80).mtimeMs })).sort((a, b) => b.mtime - a.mtime);
11323
11378
  return synthesisFiles[0]?.path ?? null;
11324
11379
  }
11325
11380
 
@@ -12342,10 +12397,10 @@ function restoreConfigSecrets(value, stored, node) {
12342
12397
  }
12343
12398
 
12344
12399
  // src/commands/config/restoreConfigWriteSecrets.ts
12345
- function restoreConfigWriteSecrets(key, value, cwd) {
12400
+ function restoreConfigWriteSecrets(key, value, cwd, globalConfigPath) {
12346
12401
  const node = configKeyNode(key);
12347
12402
  if (!node) return value;
12348
- const stored = loadConfigFrom(cwd);
12403
+ const stored = loadConfigFrom(cwd, globalConfigPath);
12349
12404
  return restoreConfigSecrets(value, getNestedValue(stored, key), node);
12350
12405
  }
12351
12406
 
@@ -12413,7 +12468,7 @@ function formatIssue2(issue, key) {
12413
12468
  }
12414
12469
 
12415
12470
  // src/commands/config/applyConfigSet.ts
12416
- function applyConfigSet(key, coerced, global, cwd = process.cwd()) {
12471
+ function applyConfigSet(key, coerced, global, cwd = process.cwd(), globalConfigPath) {
12417
12472
  if (!global && isGlobalOnlyConfigKey(key)) {
12418
12473
  return {
12419
12474
  ok: false,
@@ -12422,12 +12477,12 @@ function applyConfigSet(key, coerced, global, cwd = process.cwd()) {
12422
12477
  ]
12423
12478
  };
12424
12479
  }
12425
- const raw = global ? loadGlobalConfigRaw() : loadProjectConfig(cwd);
12480
+ const raw = global ? loadGlobalConfigRaw(globalConfigPath) : loadProjectConfig(cwd);
12426
12481
  const updated = setNestedValue(raw, key, coerced);
12427
12482
  const validation = validateConfig(updated, key);
12428
12483
  if (!validation.ok) return validation;
12429
12484
  if (global) {
12430
- saveGlobalConfig(updated);
12485
+ saveGlobalConfig(updated, globalConfigPath);
12431
12486
  return { ok: true, target: "global" };
12432
12487
  }
12433
12488
  saveConfig(updated, cwd);
@@ -12457,8 +12512,8 @@ function resolveNamedRepoWriteLabel(globalRaw, name) {
12457
12512
  }
12458
12513
 
12459
12514
  // src/commands/config/resolveRepoConfigBlock.ts
12460
- function resolveRepoConfigBlock(repoName, cwd) {
12461
- const globalRaw = loadGlobalConfigRaw();
12515
+ function resolveRepoConfigBlock(repoName, cwd, globalConfigPath) {
12516
+ const globalRaw = loadGlobalConfigRaw(globalConfigPath);
12462
12517
  const label2 = repoName === void 0 ? resolveRepoWriteLabel(globalRaw, getCurrentOrigin(cwd)) : resolveNamedRepoWriteLabel(globalRaw, repoName);
12463
12518
  const repos2 = isPlainObject3(globalRaw.repos) ? { ...globalRaw.repos } : {};
12464
12519
  const block = isPlainObject3(repos2[label2]) ? repos2[label2] : {};
@@ -12469,7 +12524,7 @@ function isPlainObject3(value) {
12469
12524
  }
12470
12525
 
12471
12526
  // src/commands/config/applyRepoConfigSet.ts
12472
- function applyRepoConfigSet(key, coerced, repoName, cwd = process.cwd()) {
12527
+ function applyRepoConfigSet(key, coerced, repoName, cwd = process.cwd(), globalConfigPath) {
12473
12528
  if (isGlobalOnlyConfigKey(key)) {
12474
12529
  return {
12475
12530
  ok: false,
@@ -12480,23 +12535,36 @@ function applyRepoConfigSet(key, coerced, repoName, cwd = process.cwd()) {
12480
12535
  }
12481
12536
  const { globalRaw, repos: repos2, label: label2, block } = resolveRepoConfigBlock(
12482
12537
  repoName,
12483
- cwd
12538
+ cwd,
12539
+ globalConfigPath
12484
12540
  );
12485
12541
  const updatedBlock = setNestedValue(block, key, coerced);
12486
12542
  const validation = validateConfig(updatedBlock, key, repoConfigSchema);
12487
12543
  if (!validation.ok) return validation;
12488
12544
  repos2[label2] = updatedBlock;
12489
- saveGlobalConfig({ ...globalRaw, repos: repos2 });
12545
+ saveGlobalConfig({ ...globalRaw, repos: repos2 }, globalConfigPath);
12490
12546
  return { ok: true, target: "repo", label: label2 };
12491
12547
  }
12492
12548
 
12493
12549
  // src/commands/sessions/web/applyScopedConfigSet.ts
12494
- function applyScopedConfigSet(key, value, cwd, scope) {
12550
+ function applyScopedConfigSet(key, value, cwd, scope, globalConfigPath) {
12495
12551
  if (scope === "repo") {
12496
- const result2 = applyRepoConfigSet(key, value, void 0, cwd);
12552
+ const result2 = applyRepoConfigSet(
12553
+ key,
12554
+ value,
12555
+ void 0,
12556
+ cwd,
12557
+ globalConfigPath
12558
+ );
12497
12559
  return result2.ok ? { ok: true, payload: { target: result2.target, repoKey: result2.label } } : result2;
12498
12560
  }
12499
- const result = applyConfigSet(key, value, scope === "global", cwd);
12561
+ const result = applyConfigSet(
12562
+ key,
12563
+ value,
12564
+ scope === "global",
12565
+ cwd,
12566
+ globalConfigPath
12567
+ );
12500
12568
  return result.ok ? { ok: true, payload: { target: result.target } } : result;
12501
12569
  }
12502
12570
 
@@ -12530,8 +12598,17 @@ async function handleConfigWrite(req, res, apply) {
12530
12598
  respondJson(res, 400, { error: parsed.error });
12531
12599
  return;
12532
12600
  }
12601
+ const target = globalConfigTargetFor(parsed.cwd);
12602
+ if (!target.ok) {
12603
+ respondJson(res, 400, { error: target.error, errors: [target.error] });
12604
+ return;
12605
+ }
12533
12606
  try {
12534
- const result = apply({ ...parsed, cwd: toGitCwd(parsed.cwd) });
12607
+ const result = apply({
12608
+ ...parsed,
12609
+ cwd: toGitCwd(parsed.cwd),
12610
+ globalConfigPath: target.path
12611
+ });
12535
12612
  if (!result.ok) {
12536
12613
  respondJson(res, 400, {
12537
12614
  error: result.errors.join("\n"),
@@ -12552,14 +12629,20 @@ function setConfig(req, res) {
12552
12629
  return handleConfigWrite(req, res, (request) => {
12553
12630
  const coerced = coerceConfigValue(
12554
12631
  request.key,
12555
- restoreConfigWriteSecrets(request.key, request.value, request.cwd)
12632
+ restoreConfigWriteSecrets(
12633
+ request.key,
12634
+ request.value,
12635
+ request.cwd,
12636
+ request.globalConfigPath
12637
+ )
12556
12638
  );
12557
12639
  if (!coerced.ok) return { ok: false, errors: [coerced.error] };
12558
12640
  return applyScopedConfigSet(
12559
12641
  request.key,
12560
12642
  coerced.value,
12561
12643
  request.cwd,
12562
- request.scope
12644
+ request.scope,
12645
+ request.globalConfigPath
12563
12646
  );
12564
12647
  });
12565
12648
  }
@@ -12639,7 +12722,7 @@ function unsetNestedValue(obj, path80) {
12639
12722
  }
12640
12723
 
12641
12724
  // src/commands/config/applyConfigUnset.ts
12642
- function applyConfigUnset(key, global, cwd = process.cwd()) {
12725
+ function applyConfigUnset(key, global, cwd = process.cwd(), globalConfigPath) {
12643
12726
  if (!global && isGlobalOnlyConfigKey(key)) {
12644
12727
  return {
12645
12728
  ok: false,
@@ -12649,18 +12732,18 @@ function applyConfigUnset(key, global, cwd = process.cwd()) {
12649
12732
  };
12650
12733
  }
12651
12734
  const target = global ? "global" : "project";
12652
- const raw = global ? loadGlobalConfigRaw() : loadProjectConfig(cwd);
12735
+ const raw = global ? loadGlobalConfigRaw(globalConfigPath) : loadProjectConfig(cwd);
12653
12736
  const { config, removed } = unsetNestedValue(raw, key);
12654
12737
  if (!removed) return { ok: true, target, removed: false };
12655
12738
  const validation = validateConfig(config, key);
12656
12739
  if (!validation.ok) return validation;
12657
- if (global) saveGlobalConfig(config);
12740
+ if (global) saveGlobalConfig(config, globalConfigPath);
12658
12741
  else saveConfig(config, cwd);
12659
12742
  return { ok: true, target, removed: true };
12660
12743
  }
12661
12744
 
12662
12745
  // src/commands/config/applyRepoConfigUnset.ts
12663
- function applyRepoConfigUnset(key, repoName, cwd = process.cwd()) {
12746
+ function applyRepoConfigUnset(key, repoName, cwd = process.cwd(), globalConfigPath) {
12664
12747
  if (isGlobalOnlyConfigKey(key)) {
12665
12748
  return {
12666
12749
  ok: false,
@@ -12671,7 +12754,8 @@ function applyRepoConfigUnset(key, repoName, cwd = process.cwd()) {
12671
12754
  }
12672
12755
  const { globalRaw, repos: repos2, label: label2, block } = resolveRepoConfigBlock(
12673
12756
  repoName,
12674
- cwd
12757
+ cwd,
12758
+ globalConfigPath
12675
12759
  );
12676
12760
  const { config: updatedBlock, removed } = unsetNestedValue(block, key);
12677
12761
  if (!removed) return { ok: true, target: "repo", label: label2, removed: false };
@@ -12682,14 +12766,14 @@ function applyRepoConfigUnset(key, repoName, cwd = process.cwd()) {
12682
12766
  const next3 = { ...globalRaw };
12683
12767
  if (Object.keys(repos2).length === 0) delete next3.repos;
12684
12768
  else next3.repos = repos2;
12685
- saveGlobalConfig(next3);
12769
+ saveGlobalConfig(next3, globalConfigPath);
12686
12770
  return { ok: true, target: "repo", label: label2, removed: true };
12687
12771
  }
12688
12772
 
12689
12773
  // src/commands/sessions/web/applyScopedConfigUnset.ts
12690
- function applyScopedConfigUnset(key, cwd, scope) {
12774
+ function applyScopedConfigUnset(key, cwd, scope, globalConfigPath) {
12691
12775
  if (scope === "repo") {
12692
- const result2 = applyRepoConfigUnset(key, void 0, cwd);
12776
+ const result2 = applyRepoConfigUnset(key, void 0, cwd, globalConfigPath);
12693
12777
  return result2.ok ? {
12694
12778
  ok: true,
12695
12779
  payload: {
@@ -12699,7 +12783,12 @@ function applyScopedConfigUnset(key, cwd, scope) {
12699
12783
  }
12700
12784
  } : result2;
12701
12785
  }
12702
- const result = applyConfigUnset(key, scope === "global", cwd);
12786
+ const result = applyConfigUnset(
12787
+ key,
12788
+ scope === "global",
12789
+ cwd,
12790
+ globalConfigPath
12791
+ );
12703
12792
  return result.ok ? { ok: true, payload: { target: result.target, removed: result.removed } } : result;
12704
12793
  }
12705
12794
 
@@ -12708,7 +12797,12 @@ function unsetConfig(req, res) {
12708
12797
  return handleConfigWrite(req, res, (request) => {
12709
12798
  if (!isKnownConfigKey(request.key))
12710
12799
  return { ok: false, errors: [`Unknown config key "${request.key}"`] };
12711
- return applyScopedConfigUnset(request.key, request.cwd, request.scope);
12800
+ return applyScopedConfigUnset(
12801
+ request.key,
12802
+ request.cwd,
12803
+ request.scope,
12804
+ request.globalConfigPath
12805
+ );
12712
12806
  });
12713
12807
  }
12714
12808
 
@@ -12844,7 +12938,7 @@ import { readFile as readFile2, stat as stat3, writeFile as writeFile3 } from "f
12844
12938
 
12845
12939
  // src/commands/sessions/web/formatWithOxfmt.ts
12846
12940
  import { execFile as execFile8 } from "child_process";
12847
- import { existsSync as existsSync31 } from "fs";
12941
+ import { existsSync as existsSync32 } from "fs";
12848
12942
  import { dirname as dirname22, join as join32 } from "path";
12849
12943
  import { promisify as promisify8 } from "util";
12850
12944
  var execFileAsync7 = promisify8(execFile8);
@@ -12853,7 +12947,7 @@ function findOxfmtScript(root) {
12853
12947
  let dir = root;
12854
12948
  for (; ; ) {
12855
12949
  const candidate = join32(dir, "node_modules", "oxfmt", "bin", "oxfmt");
12856
- if (existsSync31(candidate)) return candidate;
12950
+ if (existsSync32(candidate)) return candidate;
12857
12951
  const parent = dirname22(dir);
12858
12952
  if (parent === dir) return void 0;
12859
12953
  dir = parent;
@@ -13726,7 +13820,7 @@ function registerAssociateJiraCommand(cmd) {
13726
13820
 
13727
13821
  // src/commands/backlog/cloneRepo.ts
13728
13822
  import { spawnSync as spawnSync2 } from "child_process";
13729
- import { existsSync as existsSync33 } from "fs";
13823
+ import { existsSync as existsSync34 } from "fs";
13730
13824
  import { mkdir as mkdir3 } from "fs/promises";
13731
13825
  import chalk70 from "chalk";
13732
13826
 
@@ -13762,7 +13856,7 @@ async function cloneRepo(originRaw) {
13762
13856
  if (!target) {
13763
13857
  return fail2(`Could not derive a repository name from "${origin}".`);
13764
13858
  }
13765
- if (existsSync33(target)) {
13859
+ if (existsSync34(target)) {
13766
13860
  return fail2(`Clone target already exists: ${target}`);
13767
13861
  }
13768
13862
  await mkdir3(baseDir, { recursive: true });
@@ -16732,7 +16826,7 @@ function extractGraphqlQuery(args) {
16732
16826
  }
16733
16827
 
16734
16828
  // src/shared/loadCliReads.ts
16735
- import { existsSync as existsSync34, readFileSync as readFileSync25, writeFileSync as writeFileSync22 } from "fs";
16829
+ import { existsSync as existsSync35, readFileSync as readFileSync25, writeFileSync as writeFileSync22 } from "fs";
16736
16830
  import { dirname as dirname23, resolve as resolve12 } from "path";
16737
16831
  import { fileURLToPath as fileURLToPath5 } from "url";
16738
16832
  var __filename3 = fileURLToPath5(import.meta.url);
@@ -16741,7 +16835,7 @@ function packageRoot() {
16741
16835
  return __dirname4;
16742
16836
  }
16743
16837
  function readLines(path80) {
16744
- if (!existsSync34(path80)) return [];
16838
+ if (!existsSync35(path80)) return [];
16745
16839
  return readFileSync25(path80, "utf8").split("\n").filter((line) => line.trim() !== "");
16746
16840
  }
16747
16841
  var cachedReads;
@@ -16788,7 +16882,7 @@ function findCliWrite(command) {
16788
16882
  }
16789
16883
 
16790
16884
  // src/shared/readSettingsPerms.ts
16791
- import { existsSync as existsSync35, readFileSync as readFileSync26 } from "fs";
16885
+ import { existsSync as existsSync36, readFileSync as readFileSync26 } from "fs";
16792
16886
  import { homedir as homedir15 } from "os";
16793
16887
  import { join as join37 } from "path";
16794
16888
  function readSettingsPerms(key) {
@@ -16804,7 +16898,7 @@ function readSettingsPerms(key) {
16804
16898
  return entries;
16805
16899
  }
16806
16900
  function readPermissionArray(filePath, key) {
16807
- if (!existsSync35(filePath)) return [];
16901
+ if (!existsSync36(filePath)) return [];
16808
16902
  try {
16809
16903
  const data = JSON.parse(readFileSync26(filePath, "utf8"));
16810
16904
  const arr = data?.permissions?.[key];
@@ -17149,7 +17243,7 @@ ${reasons.join("\n")}`);
17149
17243
  }
17150
17244
 
17151
17245
  // src/commands/permitCliReads/index.ts
17152
- import { existsSync as existsSync36, mkdirSync as mkdirSync13, readFileSync as readFileSync27, writeFileSync as writeFileSync23 } from "fs";
17246
+ import { existsSync as existsSync37, mkdirSync as mkdirSync13, readFileSync as readFileSync27, writeFileSync as writeFileSync23 } from "fs";
17153
17247
  import { homedir as homedir17 } from "os";
17154
17248
  import { join as join39 } from "path";
17155
17249
 
@@ -17418,7 +17512,7 @@ function logPath(cli) {
17418
17512
  }
17419
17513
  function readCache(cli) {
17420
17514
  const path80 = logPath(cli);
17421
- if (!existsSync36(path80)) return void 0;
17515
+ if (!existsSync37(path80)) return void 0;
17422
17516
  return readFileSync27(path80, "utf8");
17423
17517
  }
17424
17518
  function writeCache(cli, output) {
@@ -17553,7 +17647,7 @@ function registerCliHook(program2) {
17553
17647
  }
17554
17648
 
17555
17649
  // src/commands/codeComment/codeCommentConfirm.ts
17556
- import { existsSync as existsSync38, readFileSync as readFileSync29, unlinkSync as unlinkSync8, writeFileSync as writeFileSync24 } from "fs";
17650
+ import { existsSync as existsSync39, readFileSync as readFileSync29, unlinkSync as unlinkSync8, writeFileSync as writeFileSync24 } from "fs";
17557
17651
  import chalk122 from "chalk";
17558
17652
 
17559
17653
  // src/commands/codeComment/getRestrictedDir.ts
@@ -17589,10 +17683,10 @@ function sweepRestrictedDir(dir = getRestrictedDir()) {
17589
17683
  }
17590
17684
 
17591
17685
  // src/commands/codeComment/readPinState.ts
17592
- import { existsSync as existsSync37, readFileSync as readFileSync28 } from "fs";
17686
+ import { existsSync as existsSync38, readFileSync as readFileSync28 } from "fs";
17593
17687
  function readPinState(pin) {
17594
17688
  const path80 = getPinStatePath(pin);
17595
- if (!existsSync37(path80)) return void 0;
17689
+ if (!existsSync38(path80)) return void 0;
17596
17690
  try {
17597
17691
  const state = JSON.parse(readFileSync28(path80, "utf8"));
17598
17692
  if (state.pin !== pin) return void 0;
@@ -17611,7 +17705,7 @@ function codeCommentConfirm(pin) {
17611
17705
  process.exitCode = 1;
17612
17706
  return;
17613
17707
  }
17614
- if (!existsSync38(state.file)) {
17708
+ if (!existsSync39(state.file)) {
17615
17709
  console.error(chalk122.red(`Target file no longer exists: ${state.file}`));
17616
17710
  process.exitCode = 1;
17617
17711
  return;
@@ -18778,10 +18872,10 @@ function getMigrationApprovalPath(migrationId) {
18778
18872
  }
18779
18873
 
18780
18874
  // src/commands/dbMigration/readMigrationPinState.ts
18781
- import { existsSync as existsSync39, readFileSync as readFileSync30 } from "fs";
18875
+ import { existsSync as existsSync40, readFileSync as readFileSync30 } from "fs";
18782
18876
  function readMigrationPinState(pin) {
18783
18877
  const path80 = getMigrationPinPath(pin);
18784
- if (!existsSync39(path80)) return void 0;
18878
+ if (!existsSync40(path80)) return void 0;
18785
18879
  try {
18786
18880
  const state = JSON.parse(readFileSync30(path80, "utf8"));
18787
18881
  if (state.pin !== pin) return void 0;
@@ -18870,7 +18964,7 @@ function registerDbMigration(parent) {
18870
18964
  }
18871
18965
 
18872
18966
  // src/commands/deploy/redirect.ts
18873
- import { existsSync as existsSync40, readFileSync as readFileSync31, writeFileSync as writeFileSync28 } from "fs";
18967
+ import { existsSync as existsSync41, readFileSync as readFileSync31, writeFileSync as writeFileSync28 } from "fs";
18874
18968
  import chalk142 from "chalk";
18875
18969
  var TRAILING_SLASH_SCRIPT = ` <script>
18876
18970
  if (!window.location.pathname.endsWith('/')) {
@@ -18879,7 +18973,7 @@ var TRAILING_SLASH_SCRIPT = ` <script>
18879
18973
  </script>`;
18880
18974
  function redirect() {
18881
18975
  const indexPath = "index.html";
18882
- if (!existsSync40(indexPath)) {
18976
+ if (!existsSync41(indexPath)) {
18883
18977
  console.log(chalk142.yellow("No index.html found"));
18884
18978
  return;
18885
18979
  }
@@ -18926,7 +19020,7 @@ import { execSync as execSync36 } from "child_process";
18926
19020
  import chalk143 from "chalk";
18927
19021
 
18928
19022
  // src/shared/getRepoName.ts
18929
- import { existsSync as existsSync41, readFileSync as readFileSync32 } from "fs";
19023
+ import { existsSync as existsSync42, readFileSync as readFileSync32 } from "fs";
18930
19024
  import { basename as basename12, join as join44 } from "path";
18931
19025
  function getRepoName() {
18932
19026
  const config = loadConfig();
@@ -18934,7 +19028,7 @@ function getRepoName() {
18934
19028
  return config.devlog.name;
18935
19029
  }
18936
19030
  const packageJsonPath = join44(process.cwd(), "package.json");
18937
- if (existsSync41(packageJsonPath)) {
19031
+ if (existsSync42(packageJsonPath)) {
18938
19032
  try {
18939
19033
  const content = readFileSync32(packageJsonPath, "utf8");
18940
19034
  const pkg = JSON.parse(content);
@@ -19636,12 +19730,12 @@ function printJson(tree, totalCount, solutions) {
19636
19730
  }
19637
19731
 
19638
19732
  // src/commands/dotnet/resolveCsproj.ts
19639
- import { existsSync as existsSync42 } from "fs";
19733
+ import { existsSync as existsSync43 } from "fs";
19640
19734
  import path39 from "path";
19641
19735
  import chalk152 from "chalk";
19642
19736
  function resolveCsproj(csprojPath) {
19643
19737
  const resolved = path39.resolve(csprojPath);
19644
- if (!existsSync42(resolved)) {
19738
+ if (!existsSync43(resolved)) {
19645
19739
  console.error(chalk152.red(`File not found: ${resolved}`));
19646
19740
  process.exit(1);
19647
19741
  }
@@ -19809,7 +19903,7 @@ function filterIssues(issues, all, cliOnly, cliSuppress) {
19809
19903
  }
19810
19904
 
19811
19905
  // src/commands/dotnet/resolveSolution.ts
19812
- import { existsSync as existsSync43 } from "fs";
19906
+ import { existsSync as existsSync44 } from "fs";
19813
19907
  import path40 from "path";
19814
19908
  import chalk156 from "chalk";
19815
19909
 
@@ -19850,7 +19944,7 @@ function findSolution() {
19850
19944
  function resolveSolution(sln) {
19851
19945
  if (sln) {
19852
19946
  const resolved = path40.resolve(sln);
19853
- if (!existsSync43(resolved)) {
19947
+ if (!existsSync44(resolved)) {
19854
19948
  console.error(chalk156.red(`Solution file not found: ${resolved}`));
19855
19949
  process.exit(1);
19856
19950
  }
@@ -19890,7 +19984,7 @@ function parseInspectReport(json) {
19890
19984
 
19891
19985
  // src/commands/dotnet/runInspectCode.ts
19892
19986
  import { execSync as execSync40 } from "child_process";
19893
- import { existsSync as existsSync44, readFileSync as readFileSync36, unlinkSync as unlinkSync10 } from "fs";
19987
+ import { existsSync as existsSync45, readFileSync as readFileSync36, unlinkSync as unlinkSync10 } from "fs";
19894
19988
  import { tmpdir as tmpdir4 } from "os";
19895
19989
  import path41 from "path";
19896
19990
  import chalk157 from "chalk";
@@ -19921,7 +20015,7 @@ function runInspectCode(slnPath, include, swea) {
19921
20015
  console.error(chalk157.red("jb inspectcode failed"));
19922
20016
  process.exit(1);
19923
20017
  }
19924
- if (!existsSync44(reportPath)) {
20018
+ if (!existsSync45(reportPath)) {
19925
20019
  console.error(chalk157.red("Report file not generated"));
19926
20020
  process.exit(1);
19927
20021
  }
@@ -20210,11 +20304,11 @@ function decideCommentGuard(input, existingContent) {
20210
20304
  }
20211
20305
 
20212
20306
  // src/commands/dbMigration/consumeMigrationApproval.ts
20213
- import { existsSync as existsSync45, unlinkSync as unlinkSync11 } from "fs";
20307
+ import { existsSync as existsSync46, unlinkSync as unlinkSync11 } from "fs";
20214
20308
  function consumeMigrationApproval(migrationId) {
20215
20309
  sweepRestrictedDir();
20216
20310
  const path80 = getMigrationApprovalPath(migrationId);
20217
- if (!existsSync45(path80)) return false;
20311
+ if (!existsSync46(path80)) return false;
20218
20312
  try {
20219
20313
  unlinkSync11(path80);
20220
20314
  return true;
@@ -20547,7 +20641,7 @@ async function countPendingHandovers(orm, origin) {
20547
20641
 
20548
20642
  // src/commands/handover/migrateDiskHandovers.ts
20549
20643
  import {
20550
- existsSync as existsSync46,
20644
+ existsSync as existsSync47,
20551
20645
  readdirSync as readdirSync10,
20552
20646
  readFileSync as readFileSync37,
20553
20647
  rmSync as rmSync3,
@@ -20602,7 +20696,7 @@ function summariseHandoverContent(content) {
20602
20696
 
20603
20697
  // src/commands/handover/migrateDiskHandovers.ts
20604
20698
  function collectMarkdown(dir) {
20605
- if (!existsSync46(dir)) return [];
20699
+ if (!existsSync47(dir)) return [];
20606
20700
  const out = [];
20607
20701
  for (const entry of readdirSync10(dir, { withFileTypes: true })) {
20608
20702
  const full = join52(dir, entry.name);
@@ -20629,7 +20723,7 @@ async function migrateDiskHandovers(orm, origin, cwd = process.cwd()) {
20629
20723
  migrated++;
20630
20724
  }
20631
20725
  const handoverPath = getHandoverPath(cwd);
20632
- if (existsSync46(handoverPath)) {
20726
+ if (existsSync47(handoverPath)) {
20633
20727
  await migrateFile(orm, origin, handoverPath, statSync8(handoverPath).mtime);
20634
20728
  migrated++;
20635
20729
  }
@@ -20986,7 +21080,7 @@ function canonicalTreePath(path80) {
20986
21080
  }
20987
21081
 
20988
21082
  // src/commands/sessions/daemon/worktree/createWorktree.ts
20989
- import { existsSync as existsSync47 } from "fs";
21083
+ import { existsSync as existsSync48 } from "fs";
20990
21084
  import { basename as basename16, dirname as dirname25 } from "path";
20991
21085
 
20992
21086
  // src/commands/sessions/daemon/worktree/planAllocation.ts
@@ -21033,7 +21127,7 @@ function createWorktree(clone, strategy, boundTreeRoots2, preferredPath) {
21033
21127
  const base = strategy.root ? expandTilde2(strategy.root) : dirname25(clone);
21034
21128
  const registered = new Set(listWorktreePaths(clone));
21035
21129
  const branches = new Set(listLocalBranches(clone));
21036
- const isTaken = (candidate) => registered.has(candidate) || existsSync47(candidate) || boundTreeRoots2.has(candidate) || branches.has(basename16(candidate));
21130
+ const isTaken = (candidate) => registered.has(candidate) || existsSync48(candidate) || boundTreeRoots2.has(candidate) || branches.has(basename16(candidate));
21037
21131
  const path80 = preferredPath && !isTaken(preferredPath) ? preferredPath : nextWorktreePath(clone, base, isTaken);
21038
21132
  const start3 = worktreeStartPoint(clone, strategy.trunk);
21039
21133
  gitSync(clone, [
@@ -21059,7 +21153,7 @@ function keptInTree(cwd, reason4) {
21059
21153
  }
21060
21154
 
21061
21155
  // src/commands/sessions/daemon/worktree/treeDurability.ts
21062
- import { existsSync as existsSync48 } from "fs";
21156
+ import { existsSync as existsSync49 } from "fs";
21063
21157
  var treeIsGone = { durable: true, gone: true };
21064
21158
  function treeDurability(state) {
21065
21159
  if (state.dirty) return { durable: false, reason: "uncommitted changes" };
@@ -21090,14 +21184,14 @@ function* durabilityProbes() {
21090
21184
  });
21091
21185
  }
21092
21186
  async function checkDurability(cwd) {
21093
- if (!existsSync48(cwd)) return treeIsGone;
21187
+ if (!existsSync49(cwd)) return treeIsGone;
21094
21188
  const probes = durabilityProbes();
21095
21189
  let step2 = probes.next();
21096
21190
  while (!step2.done) step2 = probes.next(await gitResult(cwd, step2.value));
21097
21191
  return step2.value;
21098
21192
  }
21099
21193
  function checkDurabilitySync(cwd) {
21100
- if (!existsSync48(cwd)) return treeIsGone;
21194
+ if (!existsSync49(cwd)) return treeIsGone;
21101
21195
  const probes = durabilityProbes();
21102
21196
  let step2 = probes.next();
21103
21197
  while (!step2.done) step2 = probes.next(gitSyncResult(cwd, step2.value));
@@ -21336,20 +21430,20 @@ function persistedTreeRoots() {
21336
21430
  }
21337
21431
 
21338
21432
  // src/commands/sessions/daemon/worktree/seedWorktree.ts
21339
- import { copyFileSync, existsSync as existsSync50, mkdirSync as mkdirSync16 } from "fs";
21433
+ import { copyFileSync, existsSync as existsSync51, mkdirSync as mkdirSync16 } from "fs";
21340
21434
  import { dirname as dirname26, join as join55 } from "path";
21341
21435
 
21342
21436
  // src/commands/sessions/daemon/worktree/runInstall.ts
21343
21437
  import { spawn as spawn5 } from "child_process";
21344
21438
 
21345
21439
  // src/commands/sessions/daemon/worktree/resolveInstallCommand.ts
21346
- import { existsSync as existsSync49 } from "fs";
21440
+ import { existsSync as existsSync50 } from "fs";
21347
21441
  import { join as join54 } from "path";
21348
21442
  function detectInstallCommand(repoRoot2) {
21349
- if (!existsSync49(join54(repoRoot2, "package.json"))) return null;
21350
- if (existsSync49(join54(repoRoot2, "pnpm-lock.yaml"))) return "pnpm install";
21351
- if (existsSync49(join54(repoRoot2, "yarn.lock"))) return "yarn install";
21352
- if (existsSync49(join54(repoRoot2, "bun.lockb"))) return "bun install";
21443
+ if (!existsSync50(join54(repoRoot2, "package.json"))) return null;
21444
+ if (existsSync50(join54(repoRoot2, "pnpm-lock.yaml"))) return "pnpm install";
21445
+ if (existsSync50(join54(repoRoot2, "yarn.lock"))) return "yarn install";
21446
+ if (existsSync50(join54(repoRoot2, "bun.lockb"))) return "bun install";
21353
21447
  return "npm install";
21354
21448
  }
21355
21449
  function resolveInstallCommand(repoRoot2, install) {
@@ -21462,7 +21556,7 @@ function seedWorktree(worktreePath, clone, onSeeded = () => {
21462
21556
  function copyConfigFiles(worktreePath, clone, copy) {
21463
21557
  for (const rel of copy) {
21464
21558
  const src = join55(clone, rel);
21465
- if (!existsSync50(src)) continue;
21559
+ if (!existsSync51(src)) continue;
21466
21560
  const dest = join55(worktreePath, rel);
21467
21561
  try {
21468
21562
  mkdirSync16(dirname26(dest), { recursive: true });
@@ -22977,7 +23071,7 @@ import { tmpdir as tmpdir6 } from "os";
22977
23071
  import { join as join62 } from "path";
22978
23072
 
22979
23073
  // src/commands/prs/loadCommentsCache.ts
22980
- import { existsSync as existsSync51, readFileSync as readFileSync40, unlinkSync as unlinkSync13 } from "fs";
23074
+ import { existsSync as existsSync52, readFileSync as readFileSync40, unlinkSync as unlinkSync13 } from "fs";
22981
23075
  import { parse as parse2 } from "yaml";
22982
23076
 
22983
23077
  // src/commands/prs/commentsCachePath.ts
@@ -22997,7 +23091,7 @@ function commentsCachePath(org, repo, prNumber) {
22997
23091
  // src/commands/prs/loadCommentsCache.ts
22998
23092
  function loadCommentsCache(org, repo, prNumber) {
22999
23093
  const cachePath = commentsCachePath(org, repo, prNumber);
23000
- if (!existsSync51(cachePath)) {
23094
+ if (!existsSync52(cachePath)) {
23001
23095
  return null;
23002
23096
  }
23003
23097
  const content = readFileSync40(cachePath, "utf8");
@@ -23005,7 +23099,7 @@ function loadCommentsCache(org, repo, prNumber) {
23005
23099
  }
23006
23100
  function deleteCommentsCache(org, repo, prNumber) {
23007
23101
  const cachePath = commentsCachePath(org, repo, prNumber);
23008
- if (existsSync51(cachePath)) {
23102
+ if (existsSync52(cachePath)) {
23009
23103
  unlinkSync13(cachePath);
23010
23104
  console.log("No more unresolved line comments. Cache dropped.");
23011
23105
  }
@@ -27134,10 +27228,10 @@ async function handlePostSynthesis(synthesisPath, prInfo, options2) {
27134
27228
  }
27135
27229
 
27136
27230
  // src/commands/review/prepareReviewDir.ts
27137
- import { existsSync as existsSync52, mkdirSync as mkdirSync19, unlinkSync as unlinkSync17, writeFileSync as writeFileSync36 } from "fs";
27231
+ import { existsSync as existsSync53, mkdirSync as mkdirSync19, unlinkSync as unlinkSync17, writeFileSync as writeFileSync36 } from "fs";
27138
27232
  function clearReviewFiles(paths) {
27139
27233
  for (const path80 of [paths.claudePath, paths.codexPath, paths.synthesisPath]) {
27140
- if (existsSync52(path80)) unlinkSync17(path80);
27234
+ if (existsSync53(path80)) unlinkSync17(path80);
27141
27235
  }
27142
27236
  }
27143
27237
  function prepareReviewDir(paths, requestBody, force) {
@@ -27364,7 +27458,7 @@ function printReviewerFailures(results) {
27364
27458
  }
27365
27459
 
27366
27460
  // src/commands/review/runAndSynthesise.ts
27367
- import { existsSync as existsSync54, unlinkSync as unlinkSync19 } from "fs";
27461
+ import { existsSync as existsSync55, unlinkSync as unlinkSync19 } from "fs";
27368
27462
 
27369
27463
  // src/commands/review/buildReviewerStdin.ts
27370
27464
  var REVIEW_PROMPT = `You are acting as a reviewer for a proposed code change made by another engineer. The full review request \u2014 branch, base, changed files, and unified diff \u2014 is in the request file whose absolute path is given below.
@@ -27793,7 +27887,7 @@ function resolveClaude(args) {
27793
27887
  }
27794
27888
 
27795
27889
  // src/commands/review/runCodexReviewer.ts
27796
- import { existsSync as existsSync53, unlinkSync as unlinkSync18 } from "fs";
27890
+ import { existsSync as existsSync54, unlinkSync as unlinkSync18 } from "fs";
27797
27891
 
27798
27892
  // src/commands/review/parseCodexEvent.ts
27799
27893
  function isItemStarted(value) {
@@ -27845,7 +27939,7 @@ async function runCodexReviewer(spec) {
27845
27939
  reportReviewerToolUse(spec.name, event, spinner);
27846
27940
  }
27847
27941
  });
27848
- if (result.exitCode !== 0 && existsSync53(spec.outputPath)) {
27942
+ if (result.exitCode !== 0 && existsSync54(spec.outputPath)) {
27849
27943
  unlinkSync18(spec.outputPath);
27850
27944
  }
27851
27945
  return finaliseReviewerRun({ ...spec, command }, spinner, result);
@@ -28000,7 +28094,7 @@ async function runAndSynthesise(args) {
28000
28094
  console.error("Both reviewers failed; skipping synthesis.");
28001
28095
  return { ok: false, failures };
28002
28096
  }
28003
- if (anyFresh && existsSync54(paths.synthesisPath)) {
28097
+ if (anyFresh && existsSync55(paths.synthesisPath)) {
28004
28098
  unlinkSync19(paths.synthesisPath);
28005
28099
  }
28006
28100
  const synthesisResult = await synthesise(paths, { multi });
@@ -29299,11 +29393,11 @@ async function configure() {
29299
29393
  }
29300
29394
 
29301
29395
  // src/commands/transcript/list.ts
29302
- import { existsSync as existsSync59, readdirSync as readdirSync19, statSync as statSync10 } from "fs";
29396
+ import { existsSync as existsSync60, readdirSync as readdirSync19, statSync as statSync10 } from "fs";
29303
29397
  import { join as join76 } from "path";
29304
29398
  function list4() {
29305
29399
  const { vttDir } = getTranscriptConfig();
29306
- if (!existsSync59(vttDir)) return;
29400
+ if (!existsSync60(vttDir)) return;
29307
29401
  for (const entry of readdirSync19(vttDir)) {
29308
29402
  if (!entry.endsWith(".vtt")) continue;
29309
29403
  if (statSync10(join76(vttDir, entry)).isDirectory()) continue;
@@ -29313,7 +29407,7 @@ function list4() {
29313
29407
 
29314
29408
  // src/commands/transcript/move.ts
29315
29409
  import {
29316
- existsSync as existsSync60,
29410
+ existsSync as existsSync61,
29317
29411
  mkdirSync as mkdirSync25,
29318
29412
  readFileSync as readFileSync47,
29319
29413
  renameSync as renameSync2,
@@ -29545,7 +29639,7 @@ function move(file, options2) {
29545
29639
  const { vttDir, transcriptsDir, summaryDir } = getTranscriptConfig();
29546
29640
  const filename = basename21(file);
29547
29641
  const sourcePath = join77(vttDir, filename);
29548
- if (!existsSync60(sourcePath)) {
29642
+ if (!existsSync61(sourcePath)) {
29549
29643
  console.error(`Error: VTT file not found: ${sourcePath}`);
29550
29644
  process.exit(1);
29551
29645
  }
@@ -29674,9 +29768,9 @@ function devices() {
29674
29768
  }
29675
29769
 
29676
29770
  // src/commands/voice/logs.ts
29677
- import { existsSync as existsSync61, readFileSync as readFileSync48 } from "fs";
29771
+ import { existsSync as existsSync62, readFileSync as readFileSync48 } from "fs";
29678
29772
  function logs(options2) {
29679
- if (!existsSync61(voicePaths.log)) {
29773
+ if (!existsSync62(voicePaths.log)) {
29680
29774
  console.log("No voice log file found");
29681
29775
  return;
29682
29776
  }
@@ -29708,7 +29802,7 @@ import { join as join81 } from "path";
29708
29802
 
29709
29803
  // src/commands/voice/checkLockFile.ts
29710
29804
  import { execSync as execSync58 } from "child_process";
29711
- import { existsSync as existsSync62, mkdirSync as mkdirSync26, readFileSync as readFileSync49, writeFileSync as writeFileSync42 } from "fs";
29805
+ import { existsSync as existsSync63, mkdirSync as mkdirSync26, readFileSync as readFileSync49, writeFileSync as writeFileSync42 } from "fs";
29712
29806
  import { join as join80 } from "path";
29713
29807
  function isProcessAlive2(pid) {
29714
29808
  try {
@@ -29720,7 +29814,7 @@ function isProcessAlive2(pid) {
29720
29814
  }
29721
29815
  function checkLockFile() {
29722
29816
  const lockFile = getLockFile();
29723
- if (!existsSync62(lockFile)) return;
29817
+ if (!existsSync63(lockFile)) return;
29724
29818
  try {
29725
29819
  const lock2 = JSON.parse(readFileSync49(lockFile, "utf8"));
29726
29820
  if (lock2.pid && isProcessAlive2(lock2.pid)) {
@@ -29733,7 +29827,7 @@ function checkLockFile() {
29733
29827
  }
29734
29828
  }
29735
29829
  function bootstrapVenv() {
29736
- if (existsSync62(getVenvPython())) return;
29830
+ if (existsSync63(getVenvPython())) return;
29737
29831
  console.log("Setting up Python environment...");
29738
29832
  const pythonDir = getPythonDir();
29739
29833
  execSync58(
@@ -29824,7 +29918,7 @@ function start2(options2) {
29824
29918
  }
29825
29919
 
29826
29920
  // src/commands/voice/status.ts
29827
- import { existsSync as existsSync63, readFileSync as readFileSync50 } from "fs";
29921
+ import { existsSync as existsSync64, readFileSync as readFileSync50 } from "fs";
29828
29922
  function isProcessAlive3(pid) {
29829
29923
  try {
29830
29924
  process.kill(pid, 0);
@@ -29834,12 +29928,12 @@ function isProcessAlive3(pid) {
29834
29928
  }
29835
29929
  }
29836
29930
  function readRecentLogs(count8) {
29837
- if (!existsSync63(voicePaths.log)) return [];
29931
+ if (!existsSync64(voicePaths.log)) return [];
29838
29932
  const lines2 = readFileSync50(voicePaths.log, "utf8").trim().split("\n");
29839
29933
  return lines2.slice(-count8);
29840
29934
  }
29841
29935
  function status2() {
29842
- if (!existsSync63(voicePaths.pid)) {
29936
+ if (!existsSync64(voicePaths.pid)) {
29843
29937
  console.log("Voice daemon: not running (no PID file)");
29844
29938
  return;
29845
29939
  }
@@ -29862,9 +29956,9 @@ function status2() {
29862
29956
  }
29863
29957
 
29864
29958
  // src/commands/voice/stop.ts
29865
- import { existsSync as existsSync64, readFileSync as readFileSync51, unlinkSync as unlinkSync20 } from "fs";
29959
+ import { existsSync as existsSync65, readFileSync as readFileSync51, unlinkSync as unlinkSync20 } from "fs";
29866
29960
  function stop2() {
29867
- if (!existsSync64(voicePaths.pid)) {
29961
+ if (!existsSync65(voicePaths.pid)) {
29868
29962
  console.log("Voice daemon is not running (no PID file)");
29869
29963
  return;
29870
29964
  }
@@ -29881,7 +29975,7 @@ function stop2() {
29881
29975
  }
29882
29976
  try {
29883
29977
  const lockFile = getLockFile();
29884
- if (existsSync64(lockFile)) unlinkSync20(lockFile);
29978
+ if (existsSync65(lockFile)) unlinkSync20(lockFile);
29885
29979
  } catch {
29886
29980
  }
29887
29981
  console.log("Voice daemon stopped");
@@ -30244,7 +30338,7 @@ function resolveParams(params, cliArgs) {
30244
30338
  }
30245
30339
 
30246
30340
  // src/commands/run/resolveRunCwd.ts
30247
- import { existsSync as existsSync65 } from "fs";
30341
+ import { existsSync as existsSync66 } from "fs";
30248
30342
  import { resolve as resolve18 } from "path";
30249
30343
  var MissingRunCwdError = class extends Error {
30250
30344
  constructor(runName, cwd) {
@@ -30257,17 +30351,17 @@ var MissingRunCwdError = class extends Error {
30257
30351
  function resolveRunCwd(config, baseDir = runConfigBaseDir()) {
30258
30352
  if (!config.cwd) return void 0;
30259
30353
  const cwd = resolve18(baseDir, config.cwd);
30260
- if (!existsSync65(cwd)) throw new MissingRunCwdError(config.name, cwd);
30354
+ if (!existsSync66(cwd)) throw new MissingRunCwdError(config.name, cwd);
30261
30355
  return cwd;
30262
30356
  }
30263
30357
 
30264
30358
  // src/commands/run/runCommandToCompletion.ts
30265
30359
  import { spawn as spawn9 } from "child_process";
30266
- import { existsSync as existsSync67 } from "fs";
30360
+ import { existsSync as existsSync68 } from "fs";
30267
30361
 
30268
30362
  // src/commands/run/resolveCommand.ts
30269
30363
  import { execFileSync as execFileSync11 } from "child_process";
30270
- import { existsSync as existsSync66 } from "fs";
30364
+ import { existsSync as existsSync67 } from "fs";
30271
30365
  import { dirname as dirname35, join as join84, resolve as resolve19 } from "path";
30272
30366
  function resolveCommand2(command) {
30273
30367
  if (process.platform !== "win32" || command !== "bash") return command;
@@ -30275,7 +30369,7 @@ function resolveCommand2(command) {
30275
30369
  const gitPath = execFileSync11("where", ["git"], { encoding: "utf8" }).trim().split("\r\n")[0];
30276
30370
  const gitRoot = resolve19(dirname35(gitPath), "..");
30277
30371
  const gitBash = join84(gitRoot, "bin", "bash.exe");
30278
- if (existsSync66(gitBash)) return gitBash;
30372
+ if (existsSync67(gitBash)) return gitBash;
30279
30373
  } catch {
30280
30374
  return command;
30281
30375
  }
@@ -30285,7 +30379,7 @@ function resolveCommand2(command) {
30285
30379
  // src/commands/run/runCommandToCompletion.ts
30286
30380
  function runCommandToCompletion(command, args, env, cwd, quiet) {
30287
30381
  return new Promise((resolveResult) => {
30288
- if (cwd && !existsSync67(cwd)) {
30382
+ if (cwd && !existsSync68(cwd)) {
30289
30383
  resolveResult({
30290
30384
  kind: "failed",
30291
30385
  message: `Failed to execute command: cwd ${cwd} does not exist`
@@ -30954,7 +31048,7 @@ function link2() {
30954
31048
  }
30955
31049
 
30956
31050
  // src/commands/run/remove.ts
30957
- import { existsSync as existsSync68, unlinkSync as unlinkSync21 } from "fs";
31051
+ import { existsSync as existsSync69, unlinkSync as unlinkSync21 } from "fs";
30958
31052
  import { join as join87 } from "path";
30959
31053
  function findRemoveIndex() {
30960
31054
  const idx = process.argv.indexOf("remove");
@@ -30971,7 +31065,7 @@ function parseRemoveName() {
30971
31065
  }
30972
31066
  function deleteCommandFile(name) {
30973
31067
  const filePath = join87(".claude", "commands", `${name}.md`);
30974
- if (existsSync68(filePath)) {
31068
+ if (existsSync69(filePath)) {
30975
31069
  unlinkSync21(filePath);
30976
31070
  console.log(`Deleted command file: ${filePath}`);
30977
31071
  }
@@ -31016,7 +31110,7 @@ function registerRun(program2) {
31016
31110
 
31017
31111
  // src/commands/screenshot/index.ts
31018
31112
  import { execSync as execSync60 } from "child_process";
31019
- import { existsSync as existsSync69, mkdirSync as mkdirSync30, unlinkSync as unlinkSync22, writeFileSync as writeFileSync45 } from "fs";
31113
+ import { existsSync as existsSync70, mkdirSync as mkdirSync30, unlinkSync as unlinkSync22, writeFileSync as writeFileSync45 } from "fs";
31020
31114
  import { tmpdir as tmpdir8 } from "os";
31021
31115
  import { join as join88, resolve as resolve20 } from "path";
31022
31116
  import chalk216 from "chalk";
@@ -31148,7 +31242,7 @@ Write-Output $OutputPath
31148
31242
 
31149
31243
  // src/commands/screenshot/index.ts
31150
31244
  function buildOutputPath(outputDir, processName) {
31151
- if (!existsSync69(outputDir)) {
31245
+ if (!existsSync70(outputDir)) {
31152
31246
  mkdirSync30(outputDir, { recursive: true });
31153
31247
  }
31154
31248
  const timestamp6 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
@@ -31483,12 +31577,12 @@ function toSessionRunInfo({
31483
31577
  }
31484
31578
 
31485
31579
  // src/commands/sessions/daemon/worktree/joinRefusal.ts
31486
- import { existsSync as existsSync70 } from "fs";
31580
+ import { existsSync as existsSync71 } from "fs";
31487
31581
  function joinRefusal(session) {
31488
31582
  if (session.commandType === "run") return "a server run has no agent stream";
31489
31583
  if (session.closing === true) return "the session is closing";
31490
31584
  if (!session.cwd) return "the session has no working directory";
31491
- if (!existsSync70(session.cwd))
31585
+ if (!existsSync71(session.cwd))
31492
31586
  return "the session's workspace no longer exists";
31493
31587
  return void 0;
31494
31588
  }
@@ -31652,11 +31746,11 @@ function sessionBase(id, status3) {
31652
31746
  }
31653
31747
 
31654
31748
  // src/commands/sessions/daemon/spawnPty.ts
31655
- import { existsSync as existsSync72 } from "fs";
31749
+ import { existsSync as existsSync73 } from "fs";
31656
31750
  import * as pty from "node-pty";
31657
31751
 
31658
31752
  // src/commands/sessions/daemon/ensureSpawnHelperExecutable.ts
31659
- import { chmodSync, existsSync as existsSync71, statSync as statSync12 } from "fs";
31753
+ import { chmodSync, existsSync as existsSync72, statSync as statSync12 } from "fs";
31660
31754
  import { createRequire as createRequire3 } from "module";
31661
31755
  import path75 from "path";
31662
31756
  var require4 = createRequire3(import.meta.url);
@@ -31671,7 +31765,7 @@ function ensureSpawnHelperExecutable() {
31671
31765
  `${process.platform}-${process.arch}`,
31672
31766
  "spawn-helper"
31673
31767
  );
31674
- if (!existsSync71(helper)) return;
31768
+ if (!existsSync72(helper)) return;
31675
31769
  const mode = statSync12(helper).mode;
31676
31770
  if ((mode & 73) === 0) chmodSync(helper, mode | 493);
31677
31771
  }
@@ -31707,7 +31801,7 @@ function spawnPty(args, cwd, sessionId, extraEnv) {
31707
31801
  });
31708
31802
  }
31709
31803
  function refuseMissingCwd(cwd, sessionId) {
31710
- if (!cwd || existsSync72(cwd)) return;
31804
+ if (!cwd || existsSync73(cwd)) return;
31711
31805
  daemonLog(
31712
31806
  `${sessionId ? `session ${sessionId}` : "pty"} not spawned: working directory ${cwd} no longer exists`
31713
31807
  );
@@ -31881,11 +31975,11 @@ function setStatus2(session, newStatus) {
31881
31975
  }
31882
31976
 
31883
31977
  // src/commands/sessions/daemon/worktree/reapWorktree.ts
31884
- import { existsSync as existsSync74 } from "fs";
31978
+ import { existsSync as existsSync75 } from "fs";
31885
31979
  import { basename as basename22 } from "path";
31886
31980
 
31887
31981
  // src/commands/sessions/daemon/worktree/deleteStrandedTree.ts
31888
- import { existsSync as existsSync73 } from "fs";
31982
+ import { existsSync as existsSync74 } from "fs";
31889
31983
  import { join as join91 } from "path";
31890
31984
 
31891
31985
  // src/commands/sessions/daemon/worktree/deleteTreeDirectly.ts
@@ -31955,7 +32049,7 @@ async function deleteStrandedTree(clone, worktreePath, cause) {
31955
32049
  );
31956
32050
  }
31957
32051
  function strandedReason(worktreePath, cause) {
31958
- if (!existsSync73(join91(worktreePath, ".git")))
32052
+ if (!existsSync74(join91(worktreePath, ".git")))
31959
32053
  return "its .git link is already gone";
31960
32054
  if (/not a working tree|not a git repository/i.test(reason2(cause)))
31961
32055
  return "git no longer recognises it as a working tree";
@@ -32007,7 +32101,7 @@ function reason3(error) {
32007
32101
 
32008
32102
  // src/commands/sessions/daemon/worktree/reapWorktree.ts
32009
32103
  async function reapWorktree(worktreePath, force = false) {
32010
- if (!existsSync74(worktreePath)) {
32104
+ if (!existsSync75(worktreePath)) {
32011
32105
  forgetWorktree(worktreePath);
32012
32106
  daemonLog(
32013
32107
  `worktree ${worktreePath} already gone; its record was forgotten`
@@ -32032,7 +32126,7 @@ async function reapWorktree(worktreePath, force = false) {
32032
32126
  }
32033
32127
  function owningClone(worktreePath) {
32034
32128
  const recorded = worktreeAttributionIncludingReaped(worktreePath)?.clone;
32035
- if (recorded && existsSync74(recorded)) return recorded;
32129
+ if (recorded && existsSync75(recorded)) return recorded;
32036
32130
  const detected = mainWorktree(worktreePath);
32037
32131
  if (detected) return detected;
32038
32132
  daemonLog(
@@ -32160,12 +32254,12 @@ function closeGateApplies(sessions, session) {
32160
32254
  }
32161
32255
 
32162
32256
  // src/commands/sessions/daemon/worktree/watchGitState.ts
32163
- import { existsSync as existsSync75, watch } from "fs";
32257
+ import { existsSync as existsSync76, watch } from "fs";
32164
32258
  var DEBOUNCE_MS = 500;
32165
32259
  var POLL_MS = 3e4;
32166
32260
  function watchGitState(cwd, onChange) {
32167
32261
  const common = gitCommonDir(cwd);
32168
- if (!common || !existsSync75(common)) return void 0;
32262
+ if (!common || !existsSync76(common)) return void 0;
32169
32263
  const watchers = [
32170
32264
  watchGitDir(common, onChange),
32171
32265
  pollGitState(cwd, onChange)
@@ -32621,10 +32715,10 @@ function emitSessionOutput(session, clients, data) {
32621
32715
  }
32622
32716
 
32623
32717
  // src/commands/sessions/daemon/exitReason.ts
32624
- import { existsSync as existsSync76 } from "fs";
32718
+ import { existsSync as existsSync77 } from "fs";
32625
32719
  import { resolve as resolve21 } from "path";
32626
32720
  function exitDetail(session) {
32627
- if (session.cwd && !existsSync76(session.cwd))
32721
+ if (session.cwd && !existsSync77(session.cwd))
32628
32722
  return `working directory ${session.cwd} no longer exists`;
32629
32723
  return missingRunConfigCwd(session);
32630
32724
  }
@@ -32638,7 +32732,7 @@ function missingRunConfigCwd(session) {
32638
32732
  const config = resolveRunConfig(session.runName, dir);
32639
32733
  if (!config?.cwd) return void 0;
32640
32734
  const configured = resolve21(runConfigBaseDirFrom(dir), config.cwd);
32641
- if (existsSync76(configured)) return void 0;
32735
+ if (existsSync77(configured)) return void 0;
32642
32736
  return `run config "${config.name}": cwd ${configured} does not exist`;
32643
32737
  }
32644
32738
 
@@ -32679,7 +32773,7 @@ function handleFailedResume(session, exitCode, onStatusChange) {
32679
32773
  }
32680
32774
 
32681
32775
  // src/commands/sessions/daemon/watchActivity.ts
32682
- import { existsSync as existsSync77, mkdirSync as mkdirSync31, watch as watch2 } from "fs";
32776
+ import { existsSync as existsSync78, mkdirSync as mkdirSync31, watch as watch2 } from "fs";
32683
32777
  import { dirname as dirname37 } from "path";
32684
32778
 
32685
32779
  // src/commands/sessions/daemon/applyActivityToSession.ts
@@ -32765,7 +32859,7 @@ function watchActivity(session, notify2, onClaudeSessionId) {
32765
32859
  if (timer) clearTimeout(timer);
32766
32860
  timer = setTimeout(read2, DEBOUNCE_MS2);
32767
32861
  });
32768
- if (existsSync77(path80)) read2();
32862
+ if (existsSync78(path80)) read2();
32769
32863
  }
32770
32864
  function refreshActivity(session) {
32771
32865
  if (session.commandType !== "assist" || !session.cwd) return;
@@ -34378,7 +34472,7 @@ function rearmStoppedSessions(sessions, notify2) {
34378
34472
  }
34379
34473
 
34380
34474
  // src/commands/sessions/daemon/worktree/reconcileWorktreesOnRestore.ts
34381
- import { existsSync as existsSync80 } from "fs";
34475
+ import { existsSync as existsSync81 } from "fs";
34382
34476
  import { basename as basename24 } from "path";
34383
34477
 
34384
34478
  // src/commands/sessions/daemon/worktree/accountedTrees.ts
@@ -34433,9 +34527,9 @@ function bindResumedWorktree(session, cwd, notify2) {
34433
34527
  }
34434
34528
 
34435
34529
  // src/commands/sessions/daemon/worktree/reclaimVanishedWorktrees.ts
34436
- import { existsSync as existsSync79 } from "fs";
34530
+ import { existsSync as existsSync80 } from "fs";
34437
34531
  async function reclaimVanishedWorktrees(clone, paths) {
34438
- if (!existsSync79(clone)) {
34532
+ if (!existsSync80(clone)) {
34439
34533
  for (const { path: path80 } of paths) forgetWorktree(path80);
34440
34534
  daemonLog(
34441
34535
  `clone ${clone} is gone; forgot ${paths.length} worktree record(s) it owned`
@@ -34601,7 +34695,7 @@ async function recoverOrphanedWorktrees(sessions, spawnWith, notify2) {
34601
34695
  );
34602
34696
  continue;
34603
34697
  }
34604
- if (!existsSync80(path80)) {
34698
+ if (!existsSync81(path80)) {
34605
34699
  logVanishedTree(sessions, path80);
34606
34700
  vanished.set(clone, [
34607
34701
  ...vanished.get(clone) ?? [],
@@ -35182,13 +35276,13 @@ async function defaultConnect() {
35182
35276
  }
35183
35277
 
35184
35278
  // src/commands/sessions/daemon/hasPersistedWindowsSessions.ts
35185
- import { existsSync as existsSync81, readFileSync as readFileSync55 } from "fs";
35186
- import { posix } from "path";
35279
+ import { existsSync as existsSync82, readFileSync as readFileSync55 } from "fs";
35280
+ import { posix as posix3 } from "path";
35187
35281
  function hasPersistedWindowsSessions() {
35188
35282
  const sessionsFile = windowsSessionsFileFromWsl();
35189
35283
  if (!sessionsFile) return false;
35190
35284
  try {
35191
- if (!existsSync81(sessionsFile)) return false;
35285
+ if (!existsSync82(sessionsFile)) return false;
35192
35286
  const data = JSON.parse(readFileSync55(sessionsFile, "utf8"));
35193
35287
  return Array.isArray(data) && data.length > 0;
35194
35288
  } catch (error) {
@@ -35200,10 +35294,9 @@ function hasPersistedWindowsSessions() {
35200
35294
  }
35201
35295
  }
35202
35296
  function windowsSessionsFileFromWsl() {
35203
- const projectsRootUnderWinHome = loadConfig().sessions?.windowsProjectsRoot;
35204
- if (!projectsRootUnderWinHome) return null;
35205
- const winHome = posix.dirname(posix.dirname(projectsRootUnderWinHome));
35206
- return posix.join(winHome, ".assist", "sessions.json");
35297
+ const winHome = windowsHomeFromWsl();
35298
+ if (!winHome) return null;
35299
+ return posix3.join(winHome, ".assist", "sessions.json");
35207
35300
  }
35208
35301
 
35209
35302
  // src/commands/sessions/daemon/discoverWindowsSessions.ts
@@ -35794,7 +35887,7 @@ function addAgentToStream(ctx, targetId, prompt, harness) {
35794
35887
  }
35795
35888
 
35796
35889
  // src/commands/sessions/daemon/worktree/spawnInTree.ts
35797
- import { existsSync as existsSync84 } from "fs";
35890
+ import { existsSync as existsSync85 } from "fs";
35798
35891
 
35799
35892
  // src/commands/sessions/daemon/createAssistSession.ts
35800
35893
  function createAssistSession(id, assistArgs, cwd, meta, holdPty) {
@@ -35849,10 +35942,10 @@ function resumeSession(id, sessionId, cwd, name, holdPty, harness) {
35849
35942
  }
35850
35943
 
35851
35944
  // src/commands/sessions/daemon/worktree/resumeInReplacementTree.ts
35852
- import { existsSync as existsSync83 } from "fs";
35945
+ import { existsSync as existsSync84 } from "fs";
35853
35946
 
35854
35947
  // src/commands/sessions/daemon/worktree/carryTranscriptToTree.ts
35855
- import { copyFileSync as copyFileSync7, existsSync as existsSync82, mkdirSync as mkdirSync33 } from "fs";
35948
+ import { copyFileSync as copyFileSync7, existsSync as existsSync83, mkdirSync as mkdirSync33 } from "fs";
35856
35949
  import { join as join93 } from "path";
35857
35950
  function carryTranscriptToTree(claudeSessionId, fromCwd, toCwd) {
35858
35951
  const dir = projectDirForCwd(toCwd);
@@ -35863,7 +35956,7 @@ function carryTranscriptToTree(claudeSessionId, fromCwd, toCwd) {
35863
35956
  return;
35864
35957
  }
35865
35958
  const dest = join93(dir, `${claudeSessionId}.jsonl`);
35866
- if (existsSync82(dest)) {
35959
+ if (existsSync83(dest)) {
35867
35960
  daemonLog(`transcript ${claudeSessionId} already present in ${dir}`);
35868
35961
  return;
35869
35962
  }
@@ -35914,7 +36007,7 @@ function resumeInReplacementTree(ctx, claudeSessionId, missingCwd, name, harness
35914
36007
  }
35915
36008
  function cloneForReapedTree(missingCwd) {
35916
36009
  const clone = worktreeAttributionIncludingReaped(missingCwd)?.clone;
35917
- if (!clone || !existsSync83(clone))
36010
+ if (!clone || !existsSync84(clone))
35918
36011
  throw new Error(
35919
36012
  `working directory no longer exists and no clone is recorded to re-allocate from: ${missingCwd}`
35920
36013
  );
@@ -35948,7 +36041,7 @@ function spawnAssistInTree(ctx, assistArgs, cwd, meta, context) {
35948
36041
  return id;
35949
36042
  }
35950
36043
  function resumeInTree(ctx, sessionId, cwd, name, harness) {
35951
- if (!existsSync84(cwd))
36044
+ if (!existsSync85(cwd))
35952
36045
  return resumeInReplacementTree(ctx, sessionId, cwd, name, harness);
35953
36046
  const id = ctx.spawnWith(
35954
36047
  (sid) => resumeSession(sid, sessionId, cwd, name, void 0, harness)
@@ -36361,9 +36454,9 @@ function safeParse2(line) {
36361
36454
  }
36362
36455
 
36363
36456
  // src/commands/sessions/daemon/repoDirExists.ts
36364
- import { existsSync as existsSync85 } from "fs";
36457
+ import { existsSync as existsSync86 } from "fs";
36365
36458
  function repoDirExists(cwd) {
36366
- return existsSync85(toGitCwd(cwd));
36459
+ return existsSync86(toGitCwd(cwd));
36367
36460
  }
36368
36461
 
36369
36462
  // src/commands/sessions/daemon/withRepoGroups.ts