@staff0rd/assist 0.1135.0 → 0.1135.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.1135.0",
9
+ version: "0.1135.1",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -7874,11 +7874,20 @@ function buildHarnessCodexArgs() {
7874
7874
  // src/shared/codexIsolatedHookArgs.ts
7875
7875
  var codexIsolatedHookArgs = ["--no-daemon"];
7876
7876
 
7877
- // src/shared/codexSandboxNetworkArgs.ts
7878
- var codexSandboxNetworkArgs = [
7879
- "-c",
7880
- "sandbox_workspace_write.network_access=true"
7881
- ];
7877
+ // src/shared/codexSandboxArgs.ts
7878
+ import { mkdirSync as mkdirSync5 } from "fs";
7879
+ import { homedir as homedir10 } from "os";
7880
+ import { join as join19 } from "path";
7881
+ function codexSandboxArgs() {
7882
+ const assistHome = join19(homedir10(), ".assist");
7883
+ mkdirSync5(assistHome, { recursive: true });
7884
+ return [
7885
+ "-c",
7886
+ "sandbox_workspace_write.network_access=true",
7887
+ "--add-dir",
7888
+ assistHome
7889
+ ];
7890
+ }
7882
7891
 
7883
7892
  // src/shared/prepareCodexHookTrust.ts
7884
7893
  import { spawnSync } from "child_process";
@@ -8043,7 +8052,7 @@ function spawnCodex(opts2 = {}) {
8043
8052
  ...codexIsolatedHookArgs,
8044
8053
  ...override.args,
8045
8054
  ...sessionEnv,
8046
- ...codexSandboxNetworkArgs,
8055
+ ...codexSandboxArgs(),
8047
8056
  ...codexDeveloperInstructionsArgs(opts2.appendSystemPromptFile),
8048
8057
  ...codexArgs(opts2)
8049
8058
  ],
@@ -8788,7 +8797,7 @@ function codexHookProbe() {
8788
8797
 
8789
8798
  // src/shared/readCodexRulePerms.ts
8790
8799
  import { existsSync as existsSync19, readdirSync as readdirSync5, readFileSync as readFileSync13 } from "fs";
8791
- import { join as join25 } from "path";
8800
+ import { join as join26 } from "path";
8792
8801
 
8793
8802
  // src/shared/readPatternList.ts
8794
8803
  function readString(text18, start2) {
@@ -8868,15 +8877,15 @@ function parseCodexRules(text18) {
8868
8877
  function ruleFiles(dir) {
8869
8878
  if (!existsSync19(dir)) return [];
8870
8879
  try {
8871
- return readdirSync5(dir).filter((name2) => name2.endsWith(".rules")).sort().map((name2) => join25(dir, name2));
8880
+ return readdirSync5(dir).filter((name2) => name2.endsWith(".rules")).sort().map((name2) => join26(dir, name2));
8872
8881
  } catch {
8873
8882
  return [];
8874
8883
  }
8875
8884
  }
8876
8885
  function readCodexRulePerms(key) {
8877
8886
  const dirs = [
8878
- join25(harnesses.codex.homeDir, "rules"),
8879
- join25(process.cwd(), ".codex", "rules")
8887
+ join26(harnesses.codex.homeDir, "rules"),
8888
+ join26(process.cwd(), ".codex", "rules")
8880
8889
  ];
8881
8890
  return dirs.flatMap(ruleFiles).flatMap((file) => {
8882
8891
  try {
@@ -8910,7 +8919,7 @@ function spawnCodex2(prompt, options2 = {}) {
8910
8919
  ...codexIsolatedHookArgs,
8911
8920
  ...override.args,
8912
8921
  ...codexSessionEnvArgs(process.env),
8913
- ...codexSandboxNetworkArgs,
8922
+ ...codexSandboxArgs(),
8914
8923
  "-C",
8915
8924
  cwd,
8916
8925
  "--sandbox",
@@ -9657,12 +9666,12 @@ async function diffScopes(req, res) {
9657
9666
  }
9658
9667
 
9659
9668
  // src/commands/sessions/daemon/recordPromptJournal.ts
9660
- import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync7 } from "fs";
9669
+ import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync8 } from "fs";
9661
9670
  import { dirname as dirname9 } from "path";
9662
9671
  function recordPromptJournal(entry) {
9663
9672
  const line = JSON.stringify({ at: (/* @__PURE__ */ new Date()).toISOString(), ...entry });
9664
9673
  try {
9665
- mkdirSync7(dirname9(daemonPaths.promptJournal), { recursive: true });
9674
+ mkdirSync8(dirname9(daemonPaths.promptJournal), { recursive: true });
9666
9675
  appendFileSync2(daemonPaths.promptJournal, `${line}
9667
9676
  `);
9668
9677
  } catch {
@@ -9881,10 +9890,10 @@ import { basename as basename7 } from "path";
9881
9890
 
9882
9891
  // src/commands/sessions/web/fromGithub/listClones.ts
9883
9892
  import { existsSync as existsSync22, readdirSync as readdirSync7 } from "fs";
9884
- import { join as join28 } from "path";
9893
+ import { join as join29 } from "path";
9885
9894
  function listClones(baseDir) {
9886
9895
  if (!existsSync22(baseDir)) return [];
9887
- return readdirSync7(baseDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => join28(baseDir, entry.name)).filter((dir) => existsSync22(join28(dir, ".git"))).sort();
9896
+ return readdirSync7(baseDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => join29(baseDir, entry.name)).filter((dir) => existsSync22(join29(dir, ".git"))).sort();
9888
9897
  }
9889
9898
 
9890
9899
  // src/commands/sessions/web/fromGithub/getClones.ts
@@ -10063,7 +10072,7 @@ function azureDevopsRepoUrl({ org, project, repo }) {
10063
10072
 
10064
10073
  // src/commands/sessions/web/fromGithub/findAzureDevopsClone.ts
10065
10074
  import { existsSync as existsSync23, readdirSync as readdirSync8 } from "fs";
10066
- import { join as join29 } from "path";
10075
+ import { join as join30 } from "path";
10067
10076
 
10068
10077
  // src/shared/azureDevops/parseAzureDevopsRemote.ts
10069
10078
  var HTTPS_DEV = /^https?:\/\/(?:[^@/]+@)?dev\.azure\.com\/([^/]+)\/([^/]+)\/_git\/([^/]+)$/i;
@@ -10084,15 +10093,15 @@ function sameAzureDevopsRepo(a, b) {
10084
10093
 
10085
10094
  // src/commands/sessions/web/fromGithub/findAzureDevopsClone.ts
10086
10095
  function clonesRepo(dir, repo) {
10087
- if (!existsSync23(join29(dir, ".git"))) return false;
10096
+ if (!existsSync23(join30(dir, ".git"))) return false;
10088
10097
  const url = remoteUrl(dir).url;
10089
10098
  const remote = url ? parseAzureDevopsRemote(url) : null;
10090
10099
  return remote !== null && sameAzureDevopsRepo(remote, repo);
10091
10100
  }
10092
10101
  function findAzureDevopsClone(repo, baseDir) {
10093
10102
  if (!existsSync23(baseDir)) return void 0;
10094
- const named = join29(baseDir, repo.repo);
10095
- const others = readdirSync8(baseDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => join29(baseDir, entry.name)).filter((dir) => dir !== named).sort();
10103
+ const named = join30(baseDir, repo.repo);
10104
+ const others = readdirSync8(baseDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => join30(baseDir, entry.name)).filter((dir) => dir !== named).sort();
10096
10105
  return [named, ...others].find((dir) => clonesRepo(dir, repo));
10097
10106
  }
10098
10107
 
@@ -11979,12 +11988,12 @@ function assertNoDuplicateRunNames(configs) {
11979
11988
 
11980
11989
  // src/shared/findLinkedConfigPath.ts
11981
11990
  import { existsSync as existsSync24 } from "fs";
11982
- import { join as join30, resolve as resolve5 } from "path";
11991
+ import { join as join31, resolve as resolve5 } from "path";
11983
11992
  function findLinkedConfigPath(linkPath, fromDir) {
11984
11993
  const resolved = resolve5(fromDir, linkPath);
11985
- const claudePath = join30(resolved, ".claude", "assist.yml");
11994
+ const claudePath = join31(resolved, ".claude", "assist.yml");
11986
11995
  if (existsSync24(claudePath)) return claudePath;
11987
- const rootPath = join30(resolved, "assist.yml");
11996
+ const rootPath = join31(resolved, "assist.yml");
11988
11997
  if (existsSync24(rootPath)) return rootPath;
11989
11998
  throw new Error(`No assist.yml found in linked project: ${resolved}`);
11990
11999
  }
@@ -12074,19 +12083,19 @@ function handleServerRuns(req, res) {
12074
12083
  // src/commands/sessions/web/getReviewSynthesis.ts
12075
12084
  import { execFile as execFile6 } from "child_process";
12076
12085
  import { readFileSync as readFileSync14 } from "fs";
12077
- import { homedir as homedir10 } from "os";
12078
- import { basename as basename10, join as join32 } from "path";
12086
+ import { homedir as homedir11 } from "os";
12087
+ import { basename as basename10, join as join33 } from "path";
12079
12088
  import { promisify as promisify6 } from "util";
12080
12089
 
12081
12090
  // src/commands/sessions/web/findSynthesisForBranch.ts
12082
12091
  import { existsSync as existsSync25, readdirSync as readdirSync9, statSync as statSync8 } from "fs";
12083
- import { basename as basename9, dirname as dirname11, join as join31 } from "path";
12092
+ import { basename as basename9, dirname as dirname11, join as join32 } from "path";
12084
12093
  function findSynthesisForBranch(repoReviewsDir, branch2) {
12085
- const branchKeyPath = join31(repoReviewsDir, `${branch2}-`);
12094
+ const branchKeyPath = join32(repoReviewsDir, `${branch2}-`);
12086
12095
  const parent = dirname11(branchKeyPath);
12087
12096
  const branchPrefix = basename9(branchKeyPath);
12088
12097
  if (!existsSync25(parent)) return null;
12089
- const synthesisFiles = readdirSync9(parent).filter((name2) => name2.startsWith(branchPrefix)).map((name2) => join31(parent, name2, "synthesis.md")).filter((path128) => existsSync25(path128)).map((path128) => ({ path: path128, mtime: statSync8(path128).mtimeMs })).sort((a, b) => b.mtime - a.mtime);
12098
+ const synthesisFiles = readdirSync9(parent).filter((name2) => name2.startsWith(branchPrefix)).map((name2) => join32(parent, name2, "synthesis.md")).filter((path128) => existsSync25(path128)).map((path128) => ({ path: path128, mtime: statSync8(path128).mtimeMs })).sort((a, b) => b.mtime - a.mtime);
12090
12099
  return synthesisFiles[0]?.path ?? null;
12091
12100
  }
12092
12101
 
@@ -12104,8 +12113,8 @@ async function resolveSynthesisPath(cwd) {
12104
12113
  runGit2(cwd, ["rev-parse", "--show-toplevel"]),
12105
12114
  runGit2(cwd, ["rev-parse", "--abbrev-ref", "HEAD"])
12106
12115
  ]);
12107
- const repoReviewsDir = join32(
12108
- homedir10(),
12116
+ const repoReviewsDir = join33(
12117
+ homedir11(),
12109
12118
  ".assist",
12110
12119
  "reviews",
12111
12120
  basename10(repoRoot3)
@@ -12973,29 +12982,29 @@ function resolveRewindPlan(item) {
12973
12982
  }
12974
12983
 
12975
12984
  // src/commands/backlog/writeSignal.ts
12976
- import { mkdirSync as mkdirSync9, writeFileSync as writeFileSync8 } from "fs";
12977
- import { homedir as homedir12 } from "os";
12978
- import { dirname as dirname13, join as join34 } from "path";
12985
+ import { mkdirSync as mkdirSync10, writeFileSync as writeFileSync8 } from "fs";
12986
+ import { homedir as homedir13 } from "os";
12987
+ import { dirname as dirname13, join as join35 } from "path";
12979
12988
  import chalk10 from "chalk";
12980
12989
 
12981
12990
  // src/commands/backlog/recordSignalOwner.ts
12982
12991
  import {
12983
12992
  existsSync as existsSync26,
12984
- mkdirSync as mkdirSync8,
12993
+ mkdirSync as mkdirSync9,
12985
12994
  readFileSync as readFileSync15,
12986
12995
  rmSync as rmSync3,
12987
12996
  writeFileSync as writeFileSync7
12988
12997
  } from "fs";
12989
- import { homedir as homedir11 } from "os";
12990
- import { dirname as dirname12, join as join33 } from "path";
12998
+ import { homedir as homedir12 } from "os";
12999
+ import { dirname as dirname12, join as join34 } from "path";
12991
13000
  function getOwnerPath(itemId2) {
12992
- return join33(homedir11(), ".assist", "signals", `owner-${itemId2}.json`);
13001
+ return join34(homedir12(), ".assist", "signals", `owner-${itemId2}.json`);
12993
13002
  }
12994
13003
  function recordSignalOwner(itemId2) {
12995
13004
  const sessionId2 = process.env.ASSIST_SESSION_ID;
12996
13005
  if (!sessionId2) return;
12997
13006
  const path128 = getOwnerPath(itemId2);
12998
- mkdirSync8(dirname12(path128), { recursive: true });
13007
+ mkdirSync9(dirname12(path128), { recursive: true });
12999
13008
  writeFileSync7(path128, JSON.stringify({ sessionId: sessionId2 }));
13000
13009
  }
13001
13010
  function readSignalOwner(itemId2) {
@@ -13019,7 +13028,7 @@ function clearSignalOwner(itemId2) {
13019
13028
  // src/commands/backlog/writeSignal.ts
13020
13029
  function getSignalPath(sessionId2 = process.env.ASSIST_SESSION_ID) {
13021
13030
  if (!sessionId2) return void 0;
13022
- return join34(homedir12(), ".assist", "signals", `signal-${sessionId2}.json`);
13031
+ return join35(homedir13(), ".assist", "signals", `signal-${sessionId2}.json`);
13023
13032
  }
13024
13033
  function resolveSignalTarget(event, data) {
13025
13034
  const caller = process.env.ASSIST_SESSION_ID;
@@ -13051,7 +13060,7 @@ function writeSignal(event, data) {
13051
13060
  const path128 = getSignalPath(target);
13052
13061
  if (!path128) return;
13053
13062
  const signal = { event, sessionId: target, ...data };
13054
- mkdirSync9(dirname13(path128), { recursive: true });
13063
+ mkdirSync10(dirname13(path128), { recursive: true });
13055
13064
  writeFileSync8(path128, JSON.stringify(signal));
13056
13065
  }
13057
13066
 
@@ -16481,9 +16490,9 @@ import { spawn as spawn7 } from "child_process";
16481
16490
  import { existsSync as existsSync30 } from "fs";
16482
16491
 
16483
16492
  // src/shared/expandEnv.ts
16484
- import { homedir as homedir13 } from "os";
16493
+ import { homedir as homedir14 } from "os";
16485
16494
  function expandTilde2(value) {
16486
- return value.startsWith("~/") ? homedir13() + value.slice(1) : value;
16495
+ return value.startsWith("~/") ? homedir14() + value.slice(1) : value;
16487
16496
  }
16488
16497
  function expandEnv(env) {
16489
16498
  return Object.fromEntries(
@@ -16494,13 +16503,13 @@ function expandEnv(env) {
16494
16503
  // src/commands/run/resolveCommand.ts
16495
16504
  import { execFileSync as execFileSync6 } from "child_process";
16496
16505
  import { existsSync as existsSync29 } from "fs";
16497
- import { dirname as dirname14, join as join35, resolve as resolve10 } from "path";
16506
+ import { dirname as dirname14, join as join36, resolve as resolve10 } from "path";
16498
16507
  function resolveCommand(command) {
16499
16508
  if (process.platform !== "win32" || command !== "bash") return command;
16500
16509
  try {
16501
16510
  const gitPath = execFileSync6("where", ["git"], { encoding: "utf8" }).trim().split("\r\n")[0];
16502
16511
  const gitRoot = resolve10(dirname14(gitPath), "..");
16503
- const gitBash = join35(gitRoot, "bin", "bash.exe");
16512
+ const gitBash = join36(gitRoot, "bin", "bash.exe");
16504
16513
  if (existsSync29(gitBash)) return gitBash;
16505
16514
  } catch {
16506
16515
  return command;
@@ -17996,11 +18005,11 @@ async function readUserConfig(orm) {
17996
18005
  }
17997
18006
 
17998
18007
  // src/shared/writeRepoConfigCache.ts
17999
- import { mkdirSync as mkdirSync10, renameSync as renameSync3, writeFileSync as writeFileSync9 } from "fs";
18008
+ import { mkdirSync as mkdirSync11, renameSync as renameSync3, writeFileSync as writeFileSync9 } from "fs";
18000
18009
  import { dirname as dirname15 } from "path";
18001
18010
  function writeRepoConfigCache(repos2, user = {}) {
18002
18011
  const path128 = repoConfigCachePath();
18003
- mkdirSync10(dirname15(path128), { recursive: true });
18012
+ mkdirSync11(dirname15(path128), { recursive: true });
18004
18013
  const cache7 = {
18005
18014
  refreshedAt: (/* @__PURE__ */ new Date()).toISOString(),
18006
18015
  repos: repos2,
@@ -18504,17 +18513,17 @@ var autoRestartWait = {
18504
18513
 
18505
18514
  // src/commands/extension/fetchLatestSignedExtension.ts
18506
18515
  import { readFile as readFile2 } from "fs/promises";
18507
- import { join as join37 } from "path";
18516
+ import { join as join38 } from "path";
18508
18517
 
18509
18518
  // src/commands/extension/extensionDir.ts
18510
18519
  import { existsSync as existsSync31 } from "fs";
18511
- import { dirname as dirname16, join as join36 } from "path";
18520
+ import { dirname as dirname16, join as join37 } from "path";
18512
18521
  import { fileURLToPath as fileURLToPath2 } from "url";
18513
18522
  var moduleDir = dirname16(fileURLToPath2(import.meta.url));
18514
18523
  function extensionDir() {
18515
- const bundled = join36(moduleDir, "commands", "extension", "extension");
18524
+ const bundled = join37(moduleDir, "commands", "extension", "extension");
18516
18525
  if (existsSync31(bundled)) return bundled;
18517
- return join36(moduleDir, "..", "..", "..", "extension");
18526
+ return join37(moduleDir, "..", "..", "..", "extension");
18518
18527
  }
18519
18528
 
18520
18529
  // src/commands/extension/latestUpdate.ts
@@ -18526,7 +18535,7 @@ function latestUpdate(manifest, updates2) {
18526
18535
  // src/commands/extension/fetchLatestSignedExtension.ts
18527
18536
  async function fetchLatestSignedExtension() {
18528
18537
  const manifest = await readFile2(
18529
- join37(extensionDir(), "manifest.json"),
18538
+ join38(extensionDir(), "manifest.json"),
18530
18539
  "utf8"
18531
18540
  );
18532
18541
  const updateUrl = JSON.parse(manifest).browser_specific_settings.gecko.update_url;
@@ -18570,7 +18579,7 @@ function buildPendingPath(cwd) {
18570
18579
  }
18571
18580
 
18572
18581
  // src/commands/watch/readBuiltVersion.ts
18573
- import { join as join39 } from "path";
18582
+ import { join as join40 } from "path";
18574
18583
 
18575
18584
  // src/shared/readPackageJson.ts
18576
18585
  import * as fs18 from "fs";
@@ -18620,7 +18629,7 @@ function findPackageJsonWithVerifyScripts(startDir) {
18620
18629
  function readBuiltVersion(cwd) {
18621
18630
  try {
18622
18631
  const root2 = runGit3(["rev-parse", "--show-toplevel"], cwd);
18623
- return readPackageJson(join39(root2, "package.json")).version ?? "unknown";
18632
+ return readPackageJson(join40(root2, "package.json")).version ?? "unknown";
18624
18633
  } catch {
18625
18634
  return "unknown";
18626
18635
  }
@@ -18628,11 +18637,11 @@ function readBuiltVersion(cwd) {
18628
18637
 
18629
18638
  // src/commands/watch/readDistVersion.ts
18630
18639
  import { readFileSync as readFileSync18 } from "fs";
18631
- import { join as join40 } from "path";
18640
+ import { join as join41 } from "path";
18632
18641
  function readDistVersion(cwd) {
18633
18642
  try {
18634
18643
  const root2 = runGit3(["rev-parse", "--show-toplevel"], cwd);
18635
- return readFileSync18(join40(root2, "dist", "built-version"), "utf8").trim();
18644
+ return readFileSync18(join41(root2, "dist", "built-version"), "utf8").trim();
18636
18645
  } catch {
18637
18646
  return void 0;
18638
18647
  }
@@ -18742,8 +18751,8 @@ function stripAnsi(text18) {
18742
18751
 
18743
18752
  // src/commands/sessions/daemon/worktree/watcherLogPath.ts
18744
18753
  import { createHash } from "crypto";
18745
- import { homedir as homedir14 } from "os";
18746
- import { basename as basename13, join as join41 } from "path";
18754
+ import { homedir as homedir15 } from "os";
18755
+ import { basename as basename13, join as join42 } from "path";
18747
18756
 
18748
18757
  // src/commands/sessions/daemon/worktree/canonicalTreePath.ts
18749
18758
  import { realpathSync as realpathSync2 } from "fs";
@@ -18760,8 +18769,8 @@ function canonicalTreePath(path128) {
18760
18769
  function watcherLogPath(cwd) {
18761
18770
  const clone = canonicalTreePath(cwd);
18762
18771
  const key = createHash("sha1").update(clone).digest("hex").slice(0, 8);
18763
- const dir = process.env.ASSIST_WATCHER_LOG_DIR ?? join41(homedir14(), ".assist", "watchers");
18764
- return join41(dir, `${basename13(clone) || "root"}-${key}.log`);
18772
+ const dir = process.env.ASSIST_WATCHER_LOG_DIR ?? join42(homedir15(), ".assist", "watchers");
18773
+ return join42(dir, `${basename13(clone) || "root"}-${key}.log`);
18765
18774
  }
18766
18775
 
18767
18776
  // src/commands/sessions/web/updates/readUpdateHistory.ts
@@ -18894,7 +18903,7 @@ async function readRequestBuffer(req, limit) {
18894
18903
 
18895
18904
  // src/commands/sessions/web/stageAttachment.ts
18896
18905
  import { mkdir, mkdtemp, writeFile } from "fs/promises";
18897
- import { extname as extname2, join as join42 } from "path";
18906
+ import { extname as extname2, join as join43 } from "path";
18898
18907
 
18899
18908
  // src/commands/sessions/web/ghAttachableExtensions.ts
18900
18909
  var ghAttachableExtensions = /* @__PURE__ */ new Set([
@@ -18926,9 +18935,9 @@ function safeBaseName(name2) {
18926
18935
  async function stageAttachment(name2, contentType, body) {
18927
18936
  const ext = pickExtension(name2, contentType);
18928
18937
  await mkdir(stagedAttachmentsDir, { recursive: true });
18929
- const dir = await mkdtemp(join42(stagedAttachmentsDir, "upload-"));
18938
+ const dir = await mkdtemp(join43(stagedAttachmentsDir, "upload-"));
18930
18939
  const alt = safeBaseName(name2);
18931
- const filePath = join42(dir, `${alt}.${ext}`);
18940
+ const filePath = join43(dir, `${alt}.${ext}`);
18932
18941
  await writeFile(filePath, body);
18933
18942
  return { dir, filePath, alt };
18934
18943
  }
@@ -18978,14 +18987,14 @@ import { readFile as readFile3, stat as stat3, writeFile as writeFile2 } from "f
18978
18987
  // src/commands/sessions/web/formatWithOxfmt.ts
18979
18988
  import { execFile as execFile13 } from "child_process";
18980
18989
  import { existsSync as existsSync34 } from "fs";
18981
- import { dirname as dirname18, join as join43 } from "path";
18990
+ import { dirname as dirname18, join as join44 } from "path";
18982
18991
  import { promisify as promisify13 } from "util";
18983
18992
  var execFileAsync11 = promisify13(execFile13);
18984
18993
  var TIMEOUT_MS2 = 15e3;
18985
18994
  function findOxfmtScript(root2) {
18986
18995
  let dir = root2;
18987
18996
  for (; ; ) {
18988
- const candidate = join43(dir, "node_modules", "oxfmt", "bin", "oxfmt");
18997
+ const candidate = join44(dir, "node_modules", "oxfmt", "bin", "oxfmt");
18989
18998
  if (existsSync34(candidate)) return candidate;
18990
18999
  const parent = dirname18(dir);
18991
19000
  if (parent === dir) return void 0;
@@ -19058,10 +19067,10 @@ async function writeFileContent(req, res) {
19058
19067
  // src/shared/createBundleHandler.ts
19059
19068
  import { createHash as createHash2 } from "crypto";
19060
19069
  import { readFileSync as readFileSync19, statSync as statSync10 } from "fs";
19061
- import { dirname as dirname19, join as join44 } from "path";
19070
+ import { dirname as dirname19, join as join45 } from "path";
19062
19071
  import { fileURLToPath as fileURLToPath3 } from "url";
19063
19072
  function createBundleHandler(importMetaUrl, bundlePath, contentType = "application/javascript") {
19064
- const file = join44(dirname19(fileURLToPath3(importMetaUrl)), bundlePath);
19073
+ const file = join45(dirname19(fileURLToPath3(importMetaUrl)), bundlePath);
19065
19074
  let cache7;
19066
19075
  return (req, res) => {
19067
19076
  const mtimeMs = statSync10(file).mtimeMs;
@@ -19504,9 +19513,9 @@ function scheduleReconnect() {
19504
19513
  }
19505
19514
 
19506
19515
  // src/commands/sessions/web/updates/autoRestart/autoRestartAttempts.ts
19507
- import { mkdirSync as mkdirSync11, readFileSync as readFileSync21, writeFileSync as writeFileSync10 } from "fs";
19508
- import { dirname as dirname20, join as join45 } from "path";
19509
- var defaultPath = join45(daemonPaths.dir, "auto-restart-attempts.json");
19516
+ import { mkdirSync as mkdirSync12, readFileSync as readFileSync21, writeFileSync as writeFileSync10 } from "fs";
19517
+ import { dirname as dirname20, join as join46 } from "path";
19518
+ var defaultPath = join46(daemonPaths.dir, "auto-restart-attempts.json");
19510
19519
  function read(path128) {
19511
19520
  try {
19512
19521
  return JSON.parse(readFileSync21(path128, "utf8"));
@@ -19519,7 +19528,7 @@ function autoRestartAttempts(port, path128 = defaultPath) {
19519
19528
  return {
19520
19529
  get: () => read(path128)[key],
19521
19530
  set: (built) => {
19522
- mkdirSync11(dirname20(path128), { recursive: true });
19531
+ mkdirSync12(dirname20(path128), { recursive: true });
19523
19532
  writeFileSync10(
19524
19533
  path128,
19525
19534
  `${JSON.stringify({ ...read(path128), [key]: built }, null, 2)}
@@ -20250,7 +20259,7 @@ import chalk22 from "chalk";
20250
20259
 
20251
20260
  // src/commands/verify/addToKnipIgnoreBinaries.ts
20252
20261
  import { existsSync as existsSync36, readFileSync as readFileSync22, writeFileSync as writeFileSync12 } from "fs";
20253
- import { join as join46 } from "path";
20262
+ import { join as join47 } from "path";
20254
20263
  import chalk21 from "chalk";
20255
20264
  function loadKnipConfig(knipJsonPath) {
20256
20265
  if (existsSync36(knipJsonPath)) {
@@ -20259,7 +20268,7 @@ function loadKnipConfig(knipJsonPath) {
20259
20268
  return { $schema: "https://unpkg.com/knip@5/schema.json" };
20260
20269
  }
20261
20270
  function addToKnipIgnoreBinaries(cwd, binary) {
20262
- const knipJsonPath = join46(cwd, "knip.json");
20271
+ const knipJsonPath = join47(cwd, "knip.json");
20263
20272
  try {
20264
20273
  const knipConfig = loadKnipConfig(knipJsonPath);
20265
20274
  const ignoreBinaries = knipConfig.ignoreBinaries ?? [];
@@ -21203,7 +21212,7 @@ function initPackageJson(name2) {
21203
21212
  }
21204
21213
 
21205
21214
  // src/commands/new/registerNew/newCli/writeCliTemplate.ts
21206
- import { mkdirSync as mkdirSync13, writeFileSync as writeFileSync20 } from "fs";
21215
+ import { mkdirSync as mkdirSync14, writeFileSync as writeFileSync20 } from "fs";
21207
21216
  function writeCliTemplate(name2) {
21208
21217
  console.log("Writing tsconfig.json...");
21209
21218
  writeFileSync20(
@@ -21244,7 +21253,7 @@ export default defineConfig({
21244
21253
  `
21245
21254
  );
21246
21255
  console.log("Writing src/index.ts...");
21247
- mkdirSync13("src", { recursive: true });
21256
+ mkdirSync14("src", { recursive: true });
21248
21257
  writeFileSync20(
21249
21258
  "src/index.ts",
21250
21259
  `#!/usr/bin/env node
@@ -21281,8 +21290,8 @@ import chalk37 from "chalk";
21281
21290
  import enquirer3 from "enquirer";
21282
21291
 
21283
21292
  // src/commands/deploy/init/updateWorkflow.ts
21284
- import { existsSync as existsSync44, mkdirSync as mkdirSync14, readFileSync as readFileSync28, writeFileSync as writeFileSync21 } from "fs";
21285
- import { dirname as dirname28, join as join53 } from "path";
21293
+ import { existsSync as existsSync44, mkdirSync as mkdirSync15, readFileSync as readFileSync28, writeFileSync as writeFileSync21 } from "fs";
21294
+ import { dirname as dirname28, join as join54 } from "path";
21286
21295
  import { fileURLToPath as fileURLToPath4 } from "url";
21287
21296
  import chalk36 from "chalk";
21288
21297
  var WORKFLOW_PATH = ".github/workflows/build.yml";
@@ -21296,7 +21305,7 @@ function getExistingSiteId() {
21296
21305
  return match ? match[1] : null;
21297
21306
  }
21298
21307
  function getTemplateContent(siteId) {
21299
- const templatePath = join53(__dirname3, "commands/deploy/build.yml");
21308
+ const templatePath = join54(__dirname3, "commands/deploy/build.yml");
21300
21309
  const template = readFileSync28(templatePath, "utf8");
21301
21310
  return template.replace("{{NETLIFY_SITE_ID}}", siteId);
21302
21311
  }
@@ -21304,7 +21313,7 @@ async function updateWorkflow(siteId) {
21304
21313
  const newContent = getTemplateContent(siteId);
21305
21314
  const workflowDir = ".github/workflows";
21306
21315
  if (!existsSync44(workflowDir)) {
21307
- mkdirSync14(workflowDir, { recursive: true });
21316
+ mkdirSync15(workflowDir, { recursive: true });
21308
21317
  }
21309
21318
  if (existsSync44(WORKFLOW_PATH)) {
21310
21319
  const oldContent = readFileSync28(WORKFLOW_PATH, "utf8");
@@ -21605,16 +21614,16 @@ function adviceContextFor(cwd, env = process.env) {
21605
21614
 
21606
21615
  // src/commands/advise/loadAdviceFragments.ts
21607
21616
  import { readdirSync as readdirSync10, readFileSync as readFileSync30 } from "fs";
21608
- import { basename as basename15, join as join55 } from "path";
21617
+ import { basename as basename15, join as join56 } from "path";
21609
21618
 
21610
21619
  // src/commands/advise/adviceDir.ts
21611
21620
  import { existsSync as existsSync46 } from "fs";
21612
- import { dirname as dirname29, join as join54 } from "path";
21621
+ import { dirname as dirname29, join as join55 } from "path";
21613
21622
  import { fileURLToPath as fileURLToPath5 } from "url";
21614
21623
  function adviceDir() {
21615
21624
  let current2 = dirname29(fileURLToPath5(import.meta.url));
21616
21625
  while (current2 !== dirname29(current2)) {
21617
- const candidate = join54(current2, "agent", "advice");
21626
+ const candidate = join55(current2, "agent", "advice");
21618
21627
  if (existsSync46(candidate)) return candidate;
21619
21628
  current2 = dirname29(current2);
21620
21629
  }
@@ -21647,7 +21656,7 @@ function loadAdviceFragments(dir = adviceDir()) {
21647
21656
  return readdirSync10(dir).filter((file) => file.endsWith(".md")).sort().map(
21648
21657
  (file) => parseAdviceFragment(
21649
21658
  basename15(file, ".md"),
21650
- readFileSync30(join55(dir, file), "utf8")
21659
+ readFileSync30(join56(dir, file), "utf8")
21651
21660
  )
21652
21661
  );
21653
21662
  }
@@ -21682,12 +21691,12 @@ function renderAdviceBody(fragment, context) {
21682
21691
 
21683
21692
  // src/commands/advise/adviceConditions.ts
21684
21693
  import { existsSync as existsSync47 } from "fs";
21685
- import { join as join56 } from "path";
21694
+ import { join as join57 } from "path";
21686
21695
  function repoFile(file, label) {
21687
21696
  return {
21688
21697
  whenMet: `the repo has ${label}`,
21689
21698
  whenUnmet: `the repo has no ${label}`,
21690
- matches: ({ rootDir }) => existsSync47(join56(rootDir, file))
21699
+ matches: ({ rootDir }) => existsSync47(join57(rootDir, file))
21691
21700
  };
21692
21701
  }
21693
21702
  var adviceConditions = {
@@ -21713,11 +21722,11 @@ var adviceConditions = {
21713
21722
  },
21714
21723
  typescript: repoFile("tsconfig.json", "a tsconfig.json"),
21715
21724
  filenameConvention: repoFile(
21716
- join56("oxlint-rules", "filenameConvention.ts"),
21725
+ join57("oxlint-rules", "filenameConvention.ts"),
21717
21726
  "oxlint-rules/filenameConvention.ts"
21718
21727
  ),
21719
21728
  claudeSettings: repoFile(
21720
- join56("claude", "settings.json"),
21729
+ join57("claude", "settings.json"),
21721
21730
  "claude/settings.json"
21722
21731
  ),
21723
21732
  verify: {
@@ -21883,6 +21892,17 @@ async function readBodyArgument(value) {
21883
21892
  return body;
21884
21893
  }
21885
21894
 
21895
+ // src/commands/sessions/shared/exitNoPreview.ts
21896
+ function exitNoPreview(error) {
21897
+ console.error(
21898
+ `Error: ${error instanceof Error ? error.message : String(error)}`
21899
+ );
21900
+ console.error(
21901
+ "No preview is open \u2014 nothing is awaiting approval in the preview pane. Do not tell the user to look for one; report this failure instead."
21902
+ );
21903
+ process.exit(1);
21904
+ }
21905
+
21886
21906
  // src/commands/sessions/shared/formatPreviewComments.ts
21887
21907
  function formatPreviewComments(comments3) {
21888
21908
  return comments3.map((c, i) => {
@@ -22074,10 +22094,7 @@ async function awaitPreviewApproval(subject, request, options2 = {}) {
22074
22094
  try {
22075
22095
  outcome = await requestPreviewDecision(request);
22076
22096
  } catch (error) {
22077
- console.error(
22078
- `Error: ${error instanceof Error ? error.message : String(error)}`
22079
- );
22080
- process.exit(1);
22097
+ exitNoPreview(error);
22081
22098
  }
22082
22099
  if (outcome === "superseded") {
22083
22100
  console.log(
@@ -22647,7 +22664,7 @@ function registerAskQuestion(program) {
22647
22664
 
22648
22665
  // src/commands/registerBackup.ts
22649
22666
  import { mkdir as mkdir3, stat as stat4 } from "fs/promises";
22650
- import { join as join58, resolve as resolve16 } from "path";
22667
+ import { join as join59, resolve as resolve16 } from "path";
22651
22668
  import chalk42 from "chalk";
22652
22669
 
22653
22670
  // src/shared/db/recordBackup.ts
@@ -22661,7 +22678,7 @@ async function recordBackup(db, {
22661
22678
 
22662
22679
  // src/commands/backup/scheduleBackup.ts
22663
22680
  import { mkdir as mkdir2 } from "fs/promises";
22664
- import { join as join57 } from "path";
22681
+ import { join as join58 } from "path";
22665
22682
  import chalk40 from "chalk";
22666
22683
 
22667
22684
  // src/commands/backup/readCrontab.ts
@@ -22803,7 +22820,7 @@ async function scheduleBackup({
22803
22820
  const cronExpr = durationToCron(every);
22804
22821
  const dir = expandTilde(loadConfig().backup.dir);
22805
22822
  await mkdir2(dir, { recursive: true });
22806
- const logPath2 = join57(dir, "cron.log");
22823
+ const logPath2 = join58(dir, "cron.log");
22807
22824
  const cronLine = `${cronExpr} ${resolveAssistCommand()} backup >> ${logPath2} 2>&1`;
22808
22825
  writeCrontab(upsertScheduleBlock(readCrontab(), every, cronLine));
22809
22826
  console.error(
@@ -22982,7 +22999,7 @@ async function backup({ out }) {
22982
22999
  await mkdir3(dir, { recursive: true });
22983
23000
  const start2 = Date.now();
22984
23001
  const timestamp9 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
22985
- const filePath = resolve16(join58(dir, `backup-${timestamp9}.dump`));
23002
+ const filePath = resolve16(join59(dir, `backup-${timestamp9}.dump`));
22986
23003
  await exportBacklog(filePath);
22987
23004
  const { size } = await stat4(filePath);
22988
23005
  const durationMs = Date.now() - start2;
@@ -23893,7 +23910,7 @@ function ensureRemoteOrigin() {
23893
23910
  import { spawnSync as spawnSync7 } from "child_process";
23894
23911
  import { mkdtempSync, readFileSync as readFileSync32, unlinkSync as unlinkSync4, writeFileSync as writeFileSync23 } from "fs";
23895
23912
  import { tmpdir as tmpdir2 } from "os";
23896
- import { join as join59 } from "path";
23913
+ import { join as join60 } from "path";
23897
23914
  import enquirer4 from "enquirer";
23898
23915
  async function promptType() {
23899
23916
  const { type } = await enquirer4.prompt({
@@ -23933,8 +23950,8 @@ async function promptDescription() {
23933
23950
  }
23934
23951
  function openEditor() {
23935
23952
  const editor = process.env.EDITOR || process.env.VISUAL || "vi";
23936
- const dir = mkdtempSync(join59(tmpdir2(), "assist-"));
23937
- const filePath = join59(dir, "description.md");
23953
+ const dir = mkdtempSync(join60(tmpdir2(), "assist-"));
23954
+ const filePath = join60(dir, "description.md");
23938
23955
  writeFileSync23(filePath, "");
23939
23956
  const result = spawnSync7(editor, [filePath], { stdio: "inherit" });
23940
23957
  if (result.status !== 0) {
@@ -24376,7 +24393,7 @@ function startProposedRun(id, startOn, cwd = process.cwd()) {
24376
24393
  import { randomUUID as randomUUID10 } from "crypto";
24377
24394
 
24378
24395
  // src/commands/backlog/propose/mutateLedger.ts
24379
- import { mkdirSync as mkdirSync15, readFileSync as readFileSync33, renameSync as renameSync4, writeFileSync as writeFileSync24 } from "fs";
24396
+ import { mkdirSync as mkdirSync16, readFileSync as readFileSync33, renameSync as renameSync4, writeFileSync as writeFileSync24 } from "fs";
24380
24397
  import { dirname as dirname30 } from "path";
24381
24398
  function readLedger(path128) {
24382
24399
  try {
@@ -24389,7 +24406,7 @@ function readLedger(path128) {
24389
24406
  function mutateLedger(path128, mutate) {
24390
24407
  const ledger = readLedger(path128);
24391
24408
  mutate(ledger);
24392
- mkdirSync15(dirname30(path128), { recursive: true });
24409
+ mkdirSync16(dirname30(path128), { recursive: true });
24393
24410
  const tmp = `${path128}.${process.pid}.tmp`;
24394
24411
  writeFileSync24(tmp, JSON.stringify(ledger));
24395
24412
  renameSync4(tmp, path128);
@@ -24419,10 +24436,10 @@ async function findPredecessor(path128, token, startedAt) {
24419
24436
  }
24420
24437
 
24421
24438
  // src/commands/backlog/propose/proposalLedgerPath.ts
24422
- import { homedir as homedir15 } from "os";
24423
- import { join as join60 } from "path";
24439
+ import { homedir as homedir16 } from "os";
24440
+ import { join as join61 } from "path";
24424
24441
  function proposalLedgerPath(sessionId2) {
24425
- return join60(homedir15(), ".assist", "proposals", `session-${sessionId2}.json`);
24442
+ return join61(homedir16(), ".assist", "proposals", `session-${sessionId2}.json`);
24426
24443
  }
24427
24444
 
24428
24445
  // src/commands/backlog/propose/trackProposal.ts
@@ -24471,7 +24488,12 @@ async function propose(options2) {
24471
24488
  return;
24472
24489
  }
24473
24490
  const item = await readProposedItem(options2.json);
24474
- const tracker = sessionId2 ? trackProposal(sessionId2) : void 0;
24491
+ let tracker;
24492
+ try {
24493
+ tracker = sessionId2 ? trackProposal(sessionId2) : void 0;
24494
+ } catch (error) {
24495
+ exitNoPreview(error);
24496
+ }
24475
24497
  try {
24476
24498
  const approval = await reviewProposal(
24477
24499
  item,
@@ -24916,13 +24938,13 @@ function hasLocalChanges() {
24916
24938
  // src/commands/backlog/acquireLock.ts
24917
24939
  import {
24918
24940
  existsSync as existsSync50,
24919
- mkdirSync as mkdirSync16,
24941
+ mkdirSync as mkdirSync17,
24920
24942
  readFileSync as readFileSync35,
24921
24943
  unlinkSync as unlinkSync5,
24922
24944
  writeFileSync as writeFileSync25
24923
24945
  } from "fs";
24924
- import { homedir as homedir16 } from "os";
24925
- import { join as join61 } from "path";
24946
+ import { homedir as homedir17 } from "os";
24947
+ import { join as join62 } from "path";
24926
24948
 
24927
24949
  // src/commands/backlog/bootedAt.ts
24928
24950
  import { uptime } from "os";
@@ -24958,10 +24980,10 @@ function isStaleLock(pid, timestamp9) {
24958
24980
 
24959
24981
  // src/commands/backlog/acquireLock.ts
24960
24982
  function getLocksDir() {
24961
- return join61(homedir16(), ".assist", "locks");
24983
+ return join62(homedir17(), ".assist", "locks");
24962
24984
  }
24963
24985
  function getLockPath(itemId2) {
24964
- return join61(getLocksDir(), `lock-${itemId2}.json`);
24986
+ return join62(getLocksDir(), `lock-${itemId2}.json`);
24965
24987
  }
24966
24988
  function isProcessAlive(pid) {
24967
24989
  try {
@@ -24988,7 +25010,7 @@ function isLockedByOther(itemId2) {
24988
25010
  return foreignLockHolder(itemId2) !== null;
24989
25011
  }
24990
25012
  function acquireLock(itemId2) {
24991
- mkdirSync16(getLocksDir(), { recursive: true });
25013
+ mkdirSync17(getLocksDir(), { recursive: true });
24992
25014
  writeFileSync25(
24993
25015
  getLockPath(itemId2),
24994
25016
  JSON.stringify({ pid: process.pid, timestamp: (/* @__PURE__ */ new Date()).toISOString() })
@@ -25432,17 +25454,17 @@ async function resumeDoneConversation({ item, resumeSessionId }, spawnOptions) {
25432
25454
  }
25433
25455
 
25434
25456
  // src/commands/backlog/consumePause.ts
25435
- import { existsSync as existsSync51, mkdirSync as mkdirSync17, unlinkSync as unlinkSync6, writeFileSync as writeFileSync26 } from "fs";
25436
- import { homedir as homedir17 } from "os";
25437
- import { join as join62 } from "path";
25457
+ import { existsSync as existsSync51, mkdirSync as mkdirSync18, unlinkSync as unlinkSync6, writeFileSync as writeFileSync26 } from "fs";
25458
+ import { homedir as homedir18 } from "os";
25459
+ import { join as join63 } from "path";
25438
25460
  function getControlsDir() {
25439
- return join62(homedir17(), ".assist", "controls");
25461
+ return join63(homedir18(), ".assist", "controls");
25440
25462
  }
25441
25463
  function getPausePath(itemId2) {
25442
- return join62(getControlsDir(), `pause-${itemId2}.json`);
25464
+ return join63(getControlsDir(), `pause-${itemId2}.json`);
25443
25465
  }
25444
25466
  function requestPause(itemId2) {
25445
- mkdirSync17(getControlsDir(), { recursive: true });
25467
+ mkdirSync18(getControlsDir(), { recursive: true });
25446
25468
  writeFileSync26(
25447
25469
  getPausePath(itemId2),
25448
25470
  JSON.stringify({ timestamp: (/* @__PURE__ */ new Date()).toISOString() })
@@ -25775,9 +25797,9 @@ async function persistPhaseSessionId(itemId2, phaseIdx, claudeSessionId) {
25775
25797
  }
25776
25798
 
25777
25799
  // src/shared/emitActivity.ts
25778
- import { mkdirSync as mkdirSync18, readFileSync as readFileSync37, rmSync as rmSync4, writeFileSync as writeFileSync27 } from "fs";
25779
- import { homedir as homedir18 } from "os";
25780
- import { dirname as dirname31, join as join63 } from "path";
25800
+ import { mkdirSync as mkdirSync19, readFileSync as readFileSync37, rmSync as rmSync4, writeFileSync as writeFileSync27 } from "fs";
25801
+ import { homedir as homedir19 } from "os";
25802
+ import { dirname as dirname31, join as join64 } from "path";
25781
25803
  import { z as z19 } from "zod";
25782
25804
  var activitySchema = z19.object({
25783
25805
  kind: z19.enum(["command", "backlog"]),
@@ -25795,13 +25817,13 @@ var activitySchema = z19.object({
25795
25817
  startedAt: z19.number()
25796
25818
  });
25797
25819
  function activityPath(sessionId2) {
25798
- return join63(homedir18(), ".assist", "activity", `activity-${sessionId2}.json`);
25820
+ return join64(homedir19(), ".assist", "activity", `activity-${sessionId2}.json`);
25799
25821
  }
25800
25822
  function emitActivity(activity2) {
25801
25823
  const sessionId2 = process.env.ASSIST_ACTIVITY_ID;
25802
25824
  if (!sessionId2) return;
25803
25825
  const path128 = activityPath(sessionId2);
25804
- mkdirSync18(dirname31(path128), { recursive: true });
25826
+ mkdirSync19(dirname31(path128), { recursive: true });
25805
25827
  writeFileSync27(path128, JSON.stringify({ ...activity2, startedAt: Date.now() }));
25806
25828
  }
25807
25829
  function readActivity(path128) {
@@ -25817,12 +25839,12 @@ function reconcileActivity(sessionId2, activity2) {
25817
25839
  return;
25818
25840
  }
25819
25841
  const path128 = activityPath(sessionId2);
25820
- mkdirSync18(dirname31(path128), { recursive: true });
25842
+ mkdirSync19(dirname31(path128), { recursive: true });
25821
25843
  writeFileSync27(path128, JSON.stringify(activity2));
25822
25844
  }
25823
25845
  function writeActivityIfAbsent(sessionId2, activity2) {
25824
25846
  const path128 = activityPath(sessionId2);
25825
- mkdirSync18(dirname31(path128), { recursive: true });
25847
+ mkdirSync19(dirname31(path128), { recursive: true });
25826
25848
  try {
25827
25849
  writeFileSync27(path128, JSON.stringify(activity2), { flag: "wx" });
25828
25850
  return true;
@@ -28611,13 +28633,13 @@ function findCliWrite(command) {
28611
28633
 
28612
28634
  // src/shared/readSettingsPerms.ts
28613
28635
  import { existsSync as existsSync56, readFileSync as readFileSync40 } from "fs";
28614
- import { homedir as homedir19 } from "os";
28615
- import { join as join64 } from "path";
28636
+ import { homedir as homedir20 } from "os";
28637
+ import { join as join65 } from "path";
28616
28638
  function readSettingsPerms(key) {
28617
28639
  const paths = [
28618
- join64(homedir19(), ".claude", "settings.json"),
28619
- join64(process.cwd(), ".claude", "settings.json"),
28620
- join64(process.cwd(), ".claude", "settings.local.json")
28640
+ join65(homedir20(), ".claude", "settings.json"),
28641
+ join65(process.cwd(), ".claude", "settings.json"),
28642
+ join65(process.cwd(), ".claude", "settings.local.json")
28621
28643
  ];
28622
28644
  const entries2 = [];
28623
28645
  for (const p of paths) {
@@ -28986,29 +29008,29 @@ async function decideDocsGuard({
28986
29008
  import { existsSync as existsSync57, readFileSync as readFileSync42 } from "fs";
28987
29009
 
28988
29010
  // src/commands/schema/getSchemaSessionApprovalPath.ts
28989
- import { join as join66 } from "path";
29011
+ import { join as join67 } from "path";
28990
29012
 
28991
29013
  // src/commands/codeComment/getRestrictedDir.ts
28992
- import { homedir as homedir20 } from "os";
28993
- import { join as join65 } from "path";
29014
+ import { homedir as homedir21 } from "os";
29015
+ import { join as join66 } from "path";
28994
29016
  function getRestrictedDir() {
28995
- return join65(homedir20(), ".assist", "restricted");
29017
+ return join66(homedir21(), ".assist", "restricted");
28996
29018
  }
28997
29019
  function getPinStatePath(pin2) {
28998
- return join65(getRestrictedDir(), `code-comment-${pin2}.json`);
29020
+ return join66(getRestrictedDir(), `code-comment-${pin2}.json`);
28999
29021
  }
29000
29022
 
29001
29023
  // src/commands/schema/getSchemaSessionApprovalPath.ts
29002
29024
  var SESSION_ID = /^[\w-]+$/;
29003
29025
  function getSchemaSessionApprovalDir() {
29004
- return join66(getRestrictedDir(), "schema-sessions");
29026
+ return join67(getRestrictedDir(), "schema-sessions");
29005
29027
  }
29006
29028
  function getSchemaSessionApprovalPath(scope) {
29007
29029
  const { harness, conversationId } = scope;
29008
29030
  if (!SESSION_ID.test(conversationId) || !SESSION_ID.test(harness))
29009
29031
  return void 0;
29010
29032
  const name2 = harness === legacyDefaultHarness ? conversationId : `${harness}-${conversationId}`;
29011
- return join66(getSchemaSessionApprovalDir(), `${name2}.json`);
29033
+ return join67(getSchemaSessionApprovalDir(), `${name2}.json`);
29012
29034
  }
29013
29035
 
29014
29036
  // src/commands/schema/isSchemaLocked.ts
@@ -29101,13 +29123,13 @@ async function decideToolOperations(operations2, identity) {
29101
29123
  import { basename as basename17 } from "path";
29102
29124
 
29103
29125
  // src/commands/cliHook/logDeniedToolCall.ts
29104
- import { mkdirSync as mkdirSync19 } from "fs";
29105
- import { homedir as homedir21 } from "os";
29106
- import { join as join67 } from "path";
29126
+ import { mkdirSync as mkdirSync20 } from "fs";
29127
+ import { homedir as homedir22 } from "os";
29128
+ import { join as join68 } from "path";
29107
29129
  import Database from "better-sqlite3";
29108
29130
  var _db;
29109
29131
  function getDbDir() {
29110
- return join67(homedir21(), ".assist");
29132
+ return join68(homedir22(), ".assist");
29111
29133
  }
29112
29134
  function initSchema(db) {
29113
29135
  db.exec(`
@@ -29125,8 +29147,8 @@ function initSchema(db) {
29125
29147
  function openPromptsDb(dir) {
29126
29148
  if (_db) return _db;
29127
29149
  const dbDir = dir ?? getDbDir();
29128
- mkdirSync19(dbDir, { recursive: true });
29129
- const db = new Database(join67(dbDir, "assist.db"));
29150
+ mkdirSync20(dbDir, { recursive: true });
29151
+ const db = new Database(join68(dbDir, "assist.db"));
29130
29152
  db.pragma("journal_mode = WAL");
29131
29153
  initSchema(db);
29132
29154
  _db = db;
@@ -29230,9 +29252,9 @@ ${reasons.join("\n")}`);
29230
29252
  }
29231
29253
 
29232
29254
  // src/commands/permitCliReads.ts
29233
- import { existsSync as existsSync58, mkdirSync as mkdirSync20, readFileSync as readFileSync43, writeFileSync as writeFileSync29 } from "fs";
29234
- import { homedir as homedir22 } from "os";
29235
- import { join as join68 } from "path";
29255
+ import { existsSync as existsSync58, mkdirSync as mkdirSync21, readFileSync as readFileSync43, writeFileSync as writeFileSync29 } from "fs";
29256
+ import { homedir as homedir23 } from "os";
29257
+ import { join as join69 } from "path";
29236
29258
 
29237
29259
  // src/commands/permitCliReads/assertCliExists.ts
29238
29260
  function assertCliExists(cli) {
@@ -29495,7 +29517,7 @@ function updateSettings(cli, commands) {
29495
29517
  // src/commands/permitCliReads.ts
29496
29518
  function logPath(cli) {
29497
29519
  const safeName = cli.replace(/\s+/g, "-");
29498
- return join68(homedir22(), ".assist", `cli-discover-${safeName}.log`);
29520
+ return join69(homedir23(), ".assist", `cli-discover-${safeName}.log`);
29499
29521
  }
29500
29522
  function readCache(cli) {
29501
29523
  const path128 = logPath(cli);
@@ -29503,8 +29525,8 @@ function readCache(cli) {
29503
29525
  return readFileSync43(path128, "utf8");
29504
29526
  }
29505
29527
  function writeCache(cli, output) {
29506
- const dir = join68(homedir22(), ".assist");
29507
- mkdirSync20(dir, { recursive: true });
29528
+ const dir = join69(homedir23(), ".assist");
29529
+ mkdirSync21(dir, { recursive: true });
29508
29530
  writeFileSync29(logPath(cli), output);
29509
29531
  }
29510
29532
  async function permitCliReads(cli, options2 = { noCache: false }) {
@@ -29669,7 +29691,7 @@ function isHashCommentFile(filePath) {
29669
29691
 
29670
29692
  // src/commands/codeComment/sweepRestrictedDir.ts
29671
29693
  import { readdirSync as readdirSync11, statSync as statSync11, unlinkSync as unlinkSync8 } from "fs";
29672
- import { join as join69 } from "path";
29694
+ import { join as join70 } from "path";
29673
29695
  var STALE_AFTER_MS = 30 * 60 * 1e3;
29674
29696
  function sweepRestrictedDir(dir = getRestrictedDir()) {
29675
29697
  let entries2;
@@ -29680,7 +29702,7 @@ function sweepRestrictedDir(dir = getRestrictedDir()) {
29680
29702
  }
29681
29703
  const cutoff = Date.now() - STALE_AFTER_MS;
29682
29704
  for (const entry of entries2) {
29683
- const path128 = join69(dir, entry);
29705
+ const path128 = join70(dir, entry);
29684
29706
  try {
29685
29707
  if (statSync11(path128).mtimeMs < cutoff) unlinkSync8(path128);
29686
29708
  } catch {
@@ -29771,7 +29793,7 @@ function validateCommentText(raw, isHash = false) {
29771
29793
  }
29772
29794
 
29773
29795
  // src/commands/codeComment/issuePin.ts
29774
- import { mkdirSync as mkdirSync21, writeFileSync as writeFileSync31 } from "fs";
29796
+ import { mkdirSync as mkdirSync22, writeFileSync as writeFileSync31 } from "fs";
29775
29797
  import { randomInt } from "crypto";
29776
29798
 
29777
29799
  // src/commands/notify/deliverPinNotification.ts
@@ -29856,7 +29878,7 @@ async function deliverPinNotification(notification) {
29856
29878
  // src/commands/codeComment/issuePin.ts
29857
29879
  function issuePin(file, lineNumber, text18) {
29858
29880
  const pin2 = generatePin();
29859
- mkdirSync21(getRestrictedDir(), { recursive: true });
29881
+ mkdirSync22(getRestrictedDir(), { recursive: true });
29860
29882
  sweepRestrictedDir();
29861
29883
  writeFileSync31(
29862
29884
  getPinStatePath(pin2),
@@ -32242,16 +32264,16 @@ async function browserRun(options2) {
32242
32264
  }
32243
32265
 
32244
32266
  // src/commands/browser/browserSnapshot.ts
32245
- import { mkdirSync as mkdirSync22, writeFileSync as writeFileSync32 } from "fs";
32267
+ import { mkdirSync as mkdirSync23, writeFileSync as writeFileSync32 } from "fs";
32246
32268
  import { dirname as dirname35 } from "path";
32247
32269
 
32248
32270
  // src/commands/browser/snapshotPath.ts
32249
- import { homedir as homedir23 } from "os";
32250
- import { join as join72 } from "path";
32271
+ import { homedir as homedir24 } from "os";
32272
+ import { join as join73 } from "path";
32251
32273
  function snapshotPath(tabUrl, now) {
32252
32274
  const host = new URL(tabUrl).host.replace(/[^\w.-]/g, "-");
32253
32275
  const timestamp9 = now.toISOString().replace(/[:.]/g, "-");
32254
- return join72(homedir23(), ".assist", "browser", `${host}-${timestamp9}.html`);
32276
+ return join73(homedir24(), ".assist", "browser", `${host}-${timestamp9}.html`);
32255
32277
  }
32256
32278
 
32257
32279
  // src/commands/browser/browserSnapshot.ts
@@ -32261,7 +32283,7 @@ async function browserSnapshot(options2) {
32261
32283
  url: options2.url
32262
32284
  });
32263
32285
  const path128 = snapshotPath(result.tabUrl, /* @__PURE__ */ new Date());
32264
- mkdirSync22(dirname35(path128), { recursive: true });
32286
+ mkdirSync23(dirname35(path128), { recursive: true });
32265
32287
  writeFileSync32(path128, result.html);
32266
32288
  console.log(`snapshot: ${path128}`);
32267
32289
  }
@@ -32457,16 +32479,16 @@ async function printExtensionUrl() {
32457
32479
 
32458
32480
  // src/commands/extension/signExtension.ts
32459
32481
  import { rm as rm2 } from "fs/promises";
32460
- import { homedir as homedir24, tmpdir as tmpdir4 } from "os";
32461
- import { join as join78 } from "path";
32482
+ import { homedir as homedir25, tmpdir as tmpdir4 } from "os";
32483
+ import { join as join79 } from "path";
32462
32484
  import chalk159 from "chalk";
32463
32485
 
32464
32486
  // src/commands/extension/copySignedXpi.ts
32465
32487
  import { copyFile } from "fs/promises";
32466
- import { join as join73 } from "path";
32488
+ import { join as join74 } from "path";
32467
32489
  var SIGNED_XPI_NAME = "assist-extension.xpi";
32468
32490
  async function copySignedXpi(xpi, dir) {
32469
- const fixed2 = join73(dir, SIGNED_XPI_NAME);
32491
+ const fixed2 = join74(dir, SIGNED_XPI_NAME);
32470
32492
  if (fixed2 === xpi) return fixed2;
32471
32493
  await copyFile(xpi, fixed2);
32472
32494
  return fixed2;
@@ -32475,11 +32497,11 @@ async function copySignedXpi(xpi, dir) {
32475
32497
  // src/commands/extension/findSignedXpi.ts
32476
32498
  import { existsSync as existsSync62 } from "fs";
32477
32499
  import { readdir } from "fs/promises";
32478
- import { join as join74 } from "path";
32500
+ import { join as join75 } from "path";
32479
32501
  async function findSignedXpi(dir) {
32480
32502
  if (!existsSync62(dir)) return null;
32481
32503
  const name2 = (await readdir(dir)).find((entry) => entry.endsWith(".xpi"));
32482
- return name2 ? join74(dir, name2) : null;
32504
+ return name2 ? join75(dir, name2) : null;
32483
32505
  }
32484
32506
 
32485
32507
  // src/commands/extension/signedAddonInstallPath.ts
@@ -32502,10 +32524,10 @@ async function signedAddonInstallPath(xpi) {
32502
32524
 
32503
32525
  // src/commands/extension/signPreflightProblem.ts
32504
32526
  import { existsSync as existsSync63 } from "fs";
32505
- import { join as join75 } from "path";
32527
+ import { join as join76 } from "path";
32506
32528
  var KEY_URL = "https://addons.mozilla.org/en-US/developers/addon/api/key/";
32507
32529
  function signPreflightProblem(source) {
32508
- if (!existsSync63(join75(source, "content.js")))
32530
+ if (!existsSync63(join76(source, "content.js")))
32509
32531
  return {
32510
32532
  message: `no content.js in ${source}`,
32511
32533
  hint: "run npm run build to bundle the content script"
@@ -32520,7 +32542,7 @@ function signPreflightProblem(source) {
32520
32542
 
32521
32543
  // src/commands/extension/stageExtension.ts
32522
32544
  import { cp as cp3, mkdir as mkdir5, readFile as readFile5, rm, writeFile as writeFile4 } from "fs/promises";
32523
- import { basename as basename18, join as join76 } from "path";
32545
+ import { basename as basename18, join as join77 } from "path";
32524
32546
 
32525
32547
  // src/commands/extension/stampManifestVersion.ts
32526
32548
  function stampManifestVersion(manifest, version2) {
@@ -32537,7 +32559,7 @@ async function stageExtension(source, staging, version2) {
32537
32559
  recursive: true,
32538
32560
  filter: (path128) => basename18(path128) !== "updates.json"
32539
32561
  });
32540
- const manifest = join76(staging, "manifest.json");
32562
+ const manifest = join77(staging, "manifest.json");
32541
32563
  const stamped = stampManifestVersion(
32542
32564
  await readFile5(manifest, "utf8"),
32543
32565
  version2
@@ -32547,7 +32569,7 @@ async function stageExtension(source, staging, version2) {
32547
32569
 
32548
32570
  // src/commands/extension/writeUpdateManifest.ts
32549
32571
  import { readFile as readFile6, writeFile as writeFile5 } from "fs/promises";
32550
- import { join as join77 } from "path";
32572
+ import { join as join78 } from "path";
32551
32573
 
32552
32574
  // src/commands/extension/buildUpdateManifest.ts
32553
32575
  var RELEASE_DOWNLOAD_URL = "https://github.com/staff0rd/assist/releases/download";
@@ -32572,17 +32594,17 @@ function buildUpdateManifest(manifest, version2) {
32572
32594
  // src/commands/extension/writeUpdateManifest.ts
32573
32595
  async function writeUpdateManifest(source, dir, version2) {
32574
32596
  await writeFile5(
32575
- join77(dir, "updates.json"),
32597
+ join78(dir, "updates.json"),
32576
32598
  buildUpdateManifest(
32577
- await readFile6(join77(source, "manifest.json"), "utf8"),
32599
+ await readFile6(join78(source, "manifest.json"), "utf8"),
32578
32600
  version2
32579
32601
  )
32580
32602
  );
32581
32603
  }
32582
32604
 
32583
32605
  // src/commands/extension/signExtension.ts
32584
- var ARTIFACTS_DIR = join78(homedir24(), ".assist", "extension");
32585
- var STAGING_DIR = join78(tmpdir4(), "assist-extension");
32606
+ var ARTIFACTS_DIR = join79(homedir25(), ".assist", "extension");
32607
+ var STAGING_DIR = join79(tmpdir4(), "assist-extension");
32586
32608
  async function signExtension() {
32587
32609
  const source = extensionDir();
32588
32610
  const problem = signPreflightProblem(source);
@@ -32876,9 +32898,9 @@ import { readFileSync as readFileSync49 } from "fs";
32876
32898
  import { parse as parseYaml3 } from "yaml";
32877
32899
 
32878
32900
  // src/commands/devlog/devEntryPath.ts
32879
- import { join as join79 } from "path";
32901
+ import { join as join80 } from "path";
32880
32902
  function devEntryPath(repoName, week, devDir) {
32881
- return join79(devDir, repoName, `${week.toLowerCase()}.md`);
32903
+ return join80(devDir, repoName, `${week.toLowerCase()}.md`);
32882
32904
  }
32883
32905
 
32884
32906
  // src/commands/devlog/loadDevEntry.ts
@@ -32991,13 +33013,13 @@ import chalk165 from "chalk";
32991
33013
 
32992
33014
  // src/shared/getRepoName.ts
32993
33015
  import { existsSync as existsSync65, readFileSync as readFileSync50 } from "fs";
32994
- import { basename as basename19, join as join80 } from "path";
33016
+ import { basename as basename19, join as join81 } from "path";
32995
33017
  function getRepoName() {
32996
33018
  const config = loadConfig();
32997
33019
  if (config.devlog?.name) {
32998
33020
  return config.devlog.name;
32999
33021
  }
33000
- const packageJsonPath = join80(process.cwd(), "package.json");
33022
+ const packageJsonPath = join81(process.cwd(), "package.json");
33001
33023
  if (existsSync65(packageJsonPath)) {
33002
33024
  try {
33003
33025
  const content = readFileSync50(packageJsonPath, "utf8");
@@ -33076,7 +33098,7 @@ function list2(options2) {
33076
33098
 
33077
33099
  // src/commands/devlog/loadDevWeeks.ts
33078
33100
  import { readdirSync as readdirSync12 } from "fs";
33079
- import { join as join81 } from "path";
33101
+ import { join as join82 } from "path";
33080
33102
  var DEV_FILENAME_PATTERN = /^(\d{4})-w(\d{2})\.md$/;
33081
33103
  function parseDevWeekFilename(filename) {
33082
33104
  const match = filename.match(DEV_FILENAME_PATTERN);
@@ -33090,7 +33112,7 @@ function readFilenames(dir) {
33090
33112
  }
33091
33113
  }
33092
33114
  function loadDevWeeks(repoName, devDir) {
33093
- return readFilenames(join81(devDir, repoName)).map(parseDevWeekFilename).filter((week) => week !== null).sort();
33115
+ return readFilenames(join82(devDir, repoName)).map(parseDevWeekFilename).filter((week) => week !== null).sort();
33094
33116
  }
33095
33117
 
33096
33118
  // src/commands/devlog/next/displayNextEntry.ts
@@ -33355,14 +33377,14 @@ async function skip2(week, cwd = process.cwd()) {
33355
33377
  }
33356
33378
 
33357
33379
  // src/commands/devlog/slack/slack.ts
33358
- import { mkdirSync as mkdirSync25, writeFileSync as writeFileSync37 } from "fs";
33380
+ import { mkdirSync as mkdirSync26, writeFileSync as writeFileSync37 } from "fs";
33359
33381
  import chalk171 from "chalk";
33360
33382
 
33361
33383
  // src/commands/slack/postSlackMessage.ts
33362
- import { mkdirSync as mkdirSync24, writeFileSync as writeFileSync36 } from "fs";
33384
+ import { mkdirSync as mkdirSync25, writeFileSync as writeFileSync36 } from "fs";
33363
33385
 
33364
33386
  // src/commands/slack/previewSlackThreadParts.ts
33365
- import { mkdirSync as mkdirSync23, writeFileSync as writeFileSync35 } from "fs";
33387
+ import { mkdirSync as mkdirSync24, writeFileSync as writeFileSync35 } from "fs";
33366
33388
 
33367
33389
  // src/commands/slack/readSlackParts.ts
33368
33390
  import { readFileSync as readFileSync52 } from "fs";
@@ -33408,12 +33430,12 @@ async function reviewProposedSlackMessage(target, body, workingPath) {
33408
33430
  }
33409
33431
 
33410
33432
  // src/commands/slack/slackWorkingFile.ts
33411
- import { join as join82 } from "path";
33433
+ import { join as join83 } from "path";
33412
33434
  function slackWorkingFile(channel, partIndex) {
33413
33435
  const slug2 = channel.replace(/^[#@]/, "").toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "channel";
33414
- const dir = join82(getStoreDir(), "slack");
33436
+ const dir = join83(getStoreDir(), "slack");
33415
33437
  const name2 = partIndex === void 0 ? slug2 : `${slug2}-${partIndex}`;
33416
- return { dir, bodyPath: join82(dir, `${name2}.md`) };
33438
+ return { dir, bodyPath: join83(dir, `${name2}.md`) };
33417
33439
  }
33418
33440
 
33419
33441
  // src/commands/slack/previewSlackThreadParts.ts
@@ -33425,7 +33447,7 @@ async function previewSlackThreadParts({
33425
33447
  }) {
33426
33448
  const bodies = readSlackParts(partFiles);
33427
33449
  const { dir } = slackWorkingFile(channel);
33428
- mkdirSync23(dir, { recursive: true });
33450
+ mkdirSync24(dir, { recursive: true });
33429
33451
  const paths = bodies.map((body, index3) => {
33430
33452
  const { bodyPath } = slackWorkingFile(channel, index3 + 1);
33431
33453
  writeFileSync35(bodyPath, `${body}
@@ -33479,7 +33501,7 @@ async function postSlackMessage(channelArg, options2) {
33479
33501
  process.exit(1);
33480
33502
  }
33481
33503
  const { dir, bodyPath } = slackWorkingFile(channel);
33482
- mkdirSync24(dir, { recursive: true });
33504
+ mkdirSync25(dir, { recursive: true });
33483
33505
  writeFileSync36(bodyPath, `${body}
33484
33506
  `);
33485
33507
  await reviewProposedSlackMessage({ channel, threadTs }, body, bodyPath);
@@ -33619,7 +33641,7 @@ function fail8(message4) {
33619
33641
  process.exit(1);
33620
33642
  }
33621
33643
  function writeParts(channel, parts2) {
33622
- mkdirSync25(slackWorkingFile(channel).dir, { recursive: true });
33644
+ mkdirSync26(slackWorkingFile(channel).dir, { recursive: true });
33623
33645
  return parts2.map((part, index3) => {
33624
33646
  const { bodyPath } = slackWorkingFile(channel, index3 + 1);
33625
33647
  writeFileSync37(bodyPath, `${part}
@@ -33663,7 +33685,7 @@ async function slack2(week) {
33663
33685
  }
33664
33686
 
33665
33687
  // src/commands/devlog/write.ts
33666
- import { mkdirSync as mkdirSync26, writeFileSync as writeFileSync38 } from "fs";
33688
+ import { mkdirSync as mkdirSync27, writeFileSync as writeFileSync38 } from "fs";
33667
33689
  import { dirname as dirname36 } from "path";
33668
33690
  import chalk172 from "chalk";
33669
33691
 
@@ -33758,7 +33780,7 @@ async function write() {
33758
33780
  const devDir = resolveDevDir();
33759
33781
  const repoName = getRepoName();
33760
33782
  const path128 = devEntryPath(repoName, result.data.week, devDir);
33761
- mkdirSync26(dirname36(path128), { recursive: true });
33783
+ mkdirSync27(dirname36(path128), { recursive: true });
33762
33784
  writeFileSync38(path128, formatDevEntry(repoName, result.data));
33763
33785
  console.log(chalk172.green(`Wrote ${path128}`));
33764
33786
  }
@@ -33955,9 +33977,9 @@ async function findPhaseUnlockItem(itemId2, phase) {
33955
33977
  }
33956
33978
 
33957
33979
  // src/commands/docs/getDocsUnlockPinPath.ts
33958
- import { join as join83 } from "path";
33980
+ import { join as join84 } from "path";
33959
33981
  function getDocsUnlockPinPath(pin2) {
33960
- return join83(getRestrictedDir(), `docs-unlock-pin-${pin2}.json`);
33982
+ return join84(getRestrictedDir(), `docs-unlock-pin-${pin2}.json`);
33961
33983
  }
33962
33984
 
33963
33985
  // src/commands/docs/readDocsUnlockPinState.ts
@@ -34013,7 +34035,7 @@ import chalk177 from "chalk";
34013
34035
 
34014
34036
  // src/commands/notify/issueUnlockPin.ts
34015
34037
  import { randomInt as randomInt2 } from "crypto";
34016
- import { mkdirSync as mkdirSync27, unlinkSync as unlinkSync11, writeFileSync as writeFileSync39 } from "fs";
34038
+ import { mkdirSync as mkdirSync28, unlinkSync as unlinkSync11, writeFileSync as writeFileSync39 } from "fs";
34017
34039
  async function issueUnlockPin({
34018
34040
  area,
34019
34041
  label,
@@ -34021,7 +34043,7 @@ async function issueUnlockPin({
34021
34043
  state
34022
34044
  }) {
34023
34045
  const pin2 = randomInt2(0, 1e3).toString().padStart(3, "0");
34024
- mkdirSync27(getRestrictedDir(), { recursive: true });
34046
+ mkdirSync28(getRestrictedDir(), { recursive: true });
34025
34047
  sweepRestrictedDir();
34026
34048
  const path128 = pinPath(pin2);
34027
34049
  writeFileSync39(path128, JSON.stringify({ ...state, pin: pin2 }));
@@ -34100,7 +34122,7 @@ import { unlinkSync as unlinkSync12 } from "fs";
34100
34122
  import chalk179 from "chalk";
34101
34123
 
34102
34124
  // src/commands/schema/approveSchemaUnlock.ts
34103
- import { mkdirSync as mkdirSync28, writeFileSync as writeFileSync40 } from "fs";
34125
+ import { mkdirSync as mkdirSync29, writeFileSync as writeFileSync40 } from "fs";
34104
34126
  import chalk178 from "chalk";
34105
34127
 
34106
34128
  // src/commands/schema/schemaHarnessLabel.ts
@@ -34131,7 +34153,7 @@ function approveSession({ harness, conversationId }) {
34131
34153
  const scope = { harness, conversationId };
34132
34154
  const path128 = getSchemaSessionApprovalPath(scope);
34133
34155
  if (!path128) return;
34134
- mkdirSync28(getSchemaSessionApprovalDir(), { recursive: true });
34156
+ mkdirSync29(getSchemaSessionApprovalDir(), { recursive: true });
34135
34157
  writeFileSync40(path128, JSON.stringify(scope));
34136
34158
  console.log(
34137
34159
  chalk178.green(
@@ -34145,9 +34167,9 @@ async function approveSchemaUnlock(state) {
34145
34167
  }
34146
34168
 
34147
34169
  // src/commands/schema/getSchemaUnlockPinPath.ts
34148
- import { join as join84 } from "path";
34170
+ import { join as join85 } from "path";
34149
34171
  function getSchemaUnlockPinPath(pin2) {
34150
- return join84(getRestrictedDir(), `schema-unlock-pin-${pin2}.json`);
34172
+ return join85(getRestrictedDir(), `schema-unlock-pin-${pin2}.json`);
34151
34173
  }
34152
34174
 
34153
34175
  // src/commands/schema/readSchemaUnlockPinState.ts
@@ -34306,7 +34328,7 @@ function registerSchema(parent) {
34306
34328
 
34307
34329
  // src/commands/dotnet/checkBuildLocks.ts
34308
34330
  import { closeSync as closeSync6, openSync as openSync7, readdirSync as readdirSync14 } from "fs";
34309
- import { join as join85 } from "path";
34331
+ import { join as join86 } from "path";
34310
34332
  import chalk182 from "chalk";
34311
34333
  var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "packages"]);
34312
34334
  function isLockedDll(debugDir) {
@@ -34318,7 +34340,7 @@ function isLockedDll(debugDir) {
34318
34340
  }
34319
34341
  for (const file of files) {
34320
34342
  if (!file.toLowerCase().endsWith(".dll")) continue;
34321
- const dllPath = join85(debugDir, file);
34343
+ const dllPath = join86(debugDir, file);
34322
34344
  try {
34323
34345
  const fd = openSync7(dllPath, "r+");
34324
34346
  closeSync6(fd);
@@ -34336,13 +34358,13 @@ function findFirstLockedDll(dir) {
34336
34358
  return null;
34337
34359
  }
34338
34360
  if (entries2.includes("bin")) {
34339
- const locked = isLockedDll(join85(dir, "bin", "Debug"));
34361
+ const locked = isLockedDll(join86(dir, "bin", "Debug"));
34340
34362
  if (locked) return locked;
34341
34363
  }
34342
34364
  for (const entry of entries2) {
34343
34365
  if (SKIP_DIRS.has(entry) || entry === "bin" || entry.startsWith("."))
34344
34366
  continue;
34345
- const found = findFirstLockedDll(join85(dir, entry));
34367
+ const found = findFirstLockedDll(join86(dir, entry));
34346
34368
  if (found) return found;
34347
34369
  }
34348
34370
  return null;
@@ -34689,11 +34711,11 @@ import chalk188 from "chalk";
34689
34711
 
34690
34712
  // src/commands/dotnet/findSolution.ts
34691
34713
  import { readdirSync as readdirSync16 } from "fs";
34692
- import { dirname as dirname37, join as join86 } from "path";
34714
+ import { dirname as dirname37, join as join87 } from "path";
34693
34715
  import chalk187 from "chalk";
34694
34716
  function findSlnInDir(dir) {
34695
34717
  try {
34696
- return readdirSync16(dir).filter((f) => f.endsWith(".sln")).map((f) => join86(dir, f));
34718
+ return readdirSync16(dir).filter((f) => f.endsWith(".sln")).map((f) => join87(dir, f));
34697
34719
  } catch {
34698
34720
  return [];
34699
34721
  }
@@ -35735,7 +35757,7 @@ function aggregateCommitters(authorLists) {
35735
35757
  import { spawnSync as spawnSync8 } from "child_process";
35736
35758
  import { unlinkSync as unlinkSync14, writeFileSync as writeFileSync41 } from "fs";
35737
35759
  import { tmpdir as tmpdir6 } from "os";
35738
- import { join as join87 } from "path";
35760
+ import { join as join88 } from "path";
35739
35761
  function buildArgs3(queryFile, vars) {
35740
35762
  const args = ["api", "graphql", "-F", `query=@${queryFile}`];
35741
35763
  for (const [key, value] of Object.entries(vars)) {
@@ -35745,7 +35767,7 @@ function buildArgs3(queryFile, vars) {
35745
35767
  return args;
35746
35768
  }
35747
35769
  function runGhGraphql(mutation, vars) {
35748
- const queryFile = join87(tmpdir6(), `gh-query-${Date.now()}.graphql`);
35770
+ const queryFile = join88(tmpdir6(), `gh-query-${Date.now()}.graphql`);
35749
35771
  writeFileSync41(queryFile, mutation);
35750
35772
  try {
35751
35773
  const result = spawnSync8("gh", buildArgs3(queryFile, vars), {
@@ -37221,24 +37243,24 @@ function slugFromUrl(url) {
37221
37243
  }
37222
37244
 
37223
37245
  // src/commands/github/issue/writeIssueWorkingFile.ts
37224
- import { mkdirSync as mkdirSync29, writeFileSync as writeFileSync42 } from "fs";
37246
+ import { mkdirSync as mkdirSync30, writeFileSync as writeFileSync42 } from "fs";
37225
37247
 
37226
37248
  // src/commands/github/issue/issueWorkingFile.ts
37227
- import { join as join88 } from "path";
37249
+ import { join as join89 } from "path";
37228
37250
  function issueWorkingFile(slug2, number) {
37229
37251
  const [owner = "unknown", repo = "unknown"] = slug2.split("/");
37230
- const dir = join88(getStoreDir(), "github-issues", owner, repo);
37252
+ const dir = join89(getStoreDir(), "github-issues", owner, repo);
37231
37253
  return {
37232
37254
  dir,
37233
- bodyPath: join88(dir, `${number}.md`),
37234
- metaPath: join88(dir, `${number}.json`)
37255
+ bodyPath: join89(dir, `${number}.md`),
37256
+ metaPath: join89(dir, `${number}.json`)
37235
37257
  };
37236
37258
  }
37237
37259
 
37238
37260
  // src/commands/github/issue/writeIssueWorkingFile.ts
37239
37261
  function writeIssueWorkingFile(slug2, number, target, updatedAt, body) {
37240
37262
  const { dir, bodyPath, metaPath } = issueWorkingFile(slug2, number);
37241
- mkdirSync29(dir, { recursive: true });
37263
+ mkdirSync30(dir, { recursive: true });
37242
37264
  writeFileSync42(bodyPath, body);
37243
37265
  writeFileSync42(
37244
37266
  metaPath,
@@ -38418,11 +38440,11 @@ import { existsSync as existsSync72 } from "fs";
38418
38440
  import { basename as basename22, dirname as dirname39 } from "path";
38419
38441
 
38420
38442
  // src/commands/sessions/daemon/worktree/nextWorktreePath.ts
38421
- import { basename as basename21, join as join89 } from "path";
38443
+ import { basename as basename21, join as join90 } from "path";
38422
38444
  function nextWorktreePath(clone, base, isTaken) {
38423
38445
  const name2 = basename21(clone);
38424
38446
  for (let n = 2; n < 1e3; n++) {
38425
- const candidate = join89(base, `${name2}-${n}`);
38447
+ const candidate = join90(base, `${name2}-${n}`);
38426
38448
  if (!isTaken(candidate)) return candidate;
38427
38449
  }
38428
38450
  throw new Error(`no free worktree suffix for ${clone}`);
@@ -38688,8 +38710,8 @@ function persistedTreeRoots() {
38688
38710
  }
38689
38711
 
38690
38712
  // src/commands/sessions/daemon/worktree/seedWorktree.ts
38691
- import { copyFileSync as copyFileSync3, existsSync as existsSync74, mkdirSync as mkdirSync30 } from "fs";
38692
- import { dirname as dirname40, join as join91 } from "path";
38713
+ import { copyFileSync as copyFileSync3, existsSync as existsSync74, mkdirSync as mkdirSync31 } from "fs";
38714
+ import { dirname as dirname40, join as join92 } from "path";
38693
38715
 
38694
38716
  // src/commands/sessions/daemon/worktree/installPaths.ts
38695
38717
  import { resolve as resolve22 } from "path";
@@ -38720,13 +38742,13 @@ function pendingPathAction(enclosing, states2, paths, stopped) {
38720
38742
 
38721
38743
  // src/commands/sessions/daemon/worktree/detectInstallCommand.ts
38722
38744
  import { existsSync as existsSync73 } from "fs";
38723
- import { join as join90 } from "path";
38745
+ import { join as join91 } from "path";
38724
38746
  function detectInstallCommand(dir) {
38725
- if (!existsSync73(join90(dir, "package.json"))) return null;
38726
- if (existsSync73(join90(dir, "pnpm-lock.yaml"))) return "pnpm install";
38727
- if (existsSync73(join90(dir, "yarn.lock"))) return "yarn install";
38728
- if (existsSync73(join90(dir, "bun.lockb"))) return "bun install";
38729
- if (existsSync73(join90(dir, "package-lock.json"))) return "npm ci";
38747
+ if (!existsSync73(join91(dir, "package.json"))) return null;
38748
+ if (existsSync73(join91(dir, "pnpm-lock.yaml"))) return "pnpm install";
38749
+ if (existsSync73(join91(dir, "yarn.lock"))) return "yarn install";
38750
+ if (existsSync73(join91(dir, "bun.lockb"))) return "bun install";
38751
+ if (existsSync73(join91(dir, "package-lock.json"))) return "npm ci";
38730
38752
  return "npm install";
38731
38753
  }
38732
38754
 
@@ -38918,11 +38940,11 @@ function seedWorktree(worktreePath, clone, onSeeded = () => {
38918
38940
  }
38919
38941
  function copyConfigFiles(worktreePath, clone, copy) {
38920
38942
  for (const rel of copy) {
38921
- const src = join91(clone, rel);
38943
+ const src = join92(clone, rel);
38922
38944
  if (!existsSync74(src)) continue;
38923
- const dest = join91(worktreePath, rel);
38945
+ const dest = join92(worktreePath, rel);
38924
38946
  try {
38925
- mkdirSync30(dirname40(dest), { recursive: true });
38947
+ mkdirSync31(dirname40(dest), { recursive: true });
38926
38948
  copyFileSync3(src, dest);
38927
38949
  daemonLog(`worktree ${worktreePath} seeded ${rel}`);
38928
38950
  } catch (error) {
@@ -39424,7 +39446,7 @@ function registerLitellm(program) {
39424
39446
  }
39425
39447
 
39426
39448
  // src/commands/mermaidExport.ts
39427
- import { mkdirSync as mkdirSync31, readdirSync as readdirSync17 } from "fs";
39449
+ import { mkdirSync as mkdirSync32, readdirSync as readdirSync17 } from "fs";
39428
39450
  import { resolve as resolve24 } from "path";
39429
39451
  import chalk207 from "chalk";
39430
39452
 
@@ -39493,7 +39515,7 @@ function extractMermaidBlocks(markdown) {
39493
39515
  async function mermaidExport(file, options2 = {}) {
39494
39516
  const { mermaid } = loadConfig();
39495
39517
  const outDir = resolve24(process.cwd(), options2.out ?? ".");
39496
- mkdirSync31(outDir, { recursive: true });
39518
+ mkdirSync32(outDir, { recursive: true });
39497
39519
  if (options2.index !== void 0) {
39498
39520
  if (!Number.isInteger(options2.index) || options2.index < 1) {
39499
39521
  console.error(
@@ -39588,7 +39610,7 @@ function boardSource(raw, anchorId, options2) {
39588
39610
  import { stringify as stringify2 } from "yaml";
39589
39611
 
39590
39612
  // src/commands/miro/writeExtract.ts
39591
- import { mkdirSync as mkdirSync32, writeFileSync as writeFileSync44 } from "fs";
39613
+ import { mkdirSync as mkdirSync33, writeFileSync as writeFileSync44 } from "fs";
39592
39614
  import { dirname as dirname41 } from "path";
39593
39615
  import { stringify } from "yaml";
39594
39616
  function headerLines(header) {
@@ -39602,7 +39624,7 @@ function headerLines(header) {
39602
39624
  ];
39603
39625
  }
39604
39626
  function writeExtract(file, header, texts) {
39605
- mkdirSync32(dirname41(file), { recursive: true });
39627
+ mkdirSync33(dirname41(file), { recursive: true });
39606
39628
  writeFileSync44(file, `${headerLines(header).join("\n")}
39607
39629
  ${stringify(texts)}`);
39608
39630
  }
@@ -40155,15 +40177,15 @@ function createNetcapHandler(options2) {
40155
40177
  // src/commands/netcap/prepareExtensionForLoad.ts
40156
40178
  import { cp as cp4, readFile as readFile7, writeFile as writeFile6 } from "fs/promises";
40157
40179
  import { networkInterfaces } from "os";
40158
- import { join as join93 } from "path";
40180
+ import { join as join94 } from "path";
40159
40181
  import chalk210 from "chalk";
40160
40182
 
40161
40183
  // src/commands/netcap/netcapExtensionDir.ts
40162
- import { dirname as dirname42, join as join92 } from "path";
40184
+ import { dirname as dirname42, join as join93 } from "path";
40163
40185
  import { fileURLToPath as fileURLToPath8 } from "url";
40164
40186
  var moduleDir2 = dirname42(fileURLToPath8(import.meta.url));
40165
40187
  function netcapExtensionDir() {
40166
- return join92(moduleDir2, "commands", "netcap", "netcap-extension");
40188
+ return join93(moduleDir2, "commands", "netcap", "netcap-extension");
40167
40189
  }
40168
40190
 
40169
40191
  // src/commands/netcap/prepareExtensionForLoad.ts
@@ -40178,7 +40200,7 @@ function lanIPv4() {
40178
40200
  return void 0;
40179
40201
  }
40180
40202
  async function configureBackground(dir, host, port, filter) {
40181
- const file = join93(dir, "background.js");
40203
+ const file = join94(dir, "background.js");
40182
40204
  const source = await readFile7(file, "utf8");
40183
40205
  await writeFile6(
40184
40206
  file,
@@ -40218,20 +40240,20 @@ async function prepareExtensionForLoad(port, filter = "") {
40218
40240
  }
40219
40241
 
40220
40242
  // src/commands/netcap/resolveNetcapOutPath.ts
40221
- import { isAbsolute as isAbsolute6, join as join95, resolve as resolve26 } from "path";
40243
+ import { isAbsolute as isAbsolute6, join as join96, resolve as resolve26 } from "path";
40222
40244
 
40223
40245
  // src/commands/netcap/defaultCapturePath.ts
40224
- import { homedir as homedir25 } from "os";
40225
- import { join as join94 } from "path";
40246
+ import { homedir as homedir26 } from "os";
40247
+ import { join as join95 } from "path";
40226
40248
  function defaultCapturePath() {
40227
- return join94(homedir25(), ".assist", "netcap", "capture.jsonl");
40249
+ return join95(homedir26(), ".assist", "netcap", "capture.jsonl");
40228
40250
  }
40229
40251
 
40230
40252
  // src/commands/netcap/resolveNetcapOutPath.ts
40231
40253
  function resolveNetcapOutPath(out) {
40232
40254
  if (!out) return defaultCapturePath();
40233
40255
  const dir = isAbsolute6(out) ? out : resolve26(process.cwd(), out);
40234
- return join95(dir, "capture.jsonl");
40256
+ return join96(dir, "capture.jsonl");
40235
40257
  }
40236
40258
 
40237
40259
  // src/commands/netcap/netcap.ts
@@ -40278,7 +40300,7 @@ netcap stopped \u2014 captured ${count10} ${count10 === 1 ? "entry" : "entries"}
40278
40300
 
40279
40301
  // src/commands/netcap/netcapExtract.ts
40280
40302
  import { writeFileSync as writeFileSync45 } from "fs";
40281
- import { join as join96 } from "path";
40303
+ import { join as join97 } from "path";
40282
40304
  import chalk212 from "chalk";
40283
40305
 
40284
40306
  // src/commands/netcap/extractPostsFromCapture.ts
@@ -40723,7 +40745,7 @@ function extractPostsFromCapture(captureFile) {
40723
40745
  function netcapExtract(file) {
40724
40746
  const captureFile = file ?? defaultCapturePath();
40725
40747
  const posts = extractPostsFromCapture(captureFile);
40726
- const outFile = join96(captureFile, "..", "posts.json");
40748
+ const outFile = join97(captureFile, "..", "posts.json");
40727
40749
  writeFileSync45(outFile, `${JSON.stringify(posts, null, 2)}
40728
40750
  `);
40729
40751
  console.log(
@@ -41118,11 +41140,11 @@ async function comment2(path128, line, body, options2 = {}) {
41118
41140
  }
41119
41141
 
41120
41142
  // src/commands/prs/commentsCachePath.ts
41121
- import { homedir as homedir26 } from "os";
41122
- import { join as join97 } from "path";
41143
+ import { homedir as homedir27 } from "os";
41144
+ import { join as join98 } from "path";
41123
41145
  function commentsCachePath(org, repo, prNumber) {
41124
- return join97(
41125
- homedir26(),
41146
+ return join98(
41147
+ homedir27(),
41126
41148
  ".assist",
41127
41149
  "pr-comments",
41128
41150
  org,
@@ -41132,7 +41154,7 @@ function commentsCachePath(org, repo, prNumber) {
41132
41154
  }
41133
41155
 
41134
41156
  // src/commands/prs/listComments/updateCommentsCache.ts
41135
- import { mkdirSync as mkdirSync33, writeFileSync as writeFileSync46 } from "fs";
41157
+ import { mkdirSync as mkdirSync34, writeFileSync as writeFileSync46 } from "fs";
41136
41158
  import { dirname as dirname44 } from "path";
41137
41159
  import { stringify as stringify3 } from "yaml";
41138
41160
 
@@ -41157,10 +41179,10 @@ function deleteCommentsCache(org, repo, prNumber) {
41157
41179
 
41158
41180
  // src/commands/prs/removeStaleCommentsCaches.ts
41159
41181
  import { readdirSync as readdirSync18, unlinkSync as unlinkSync16 } from "fs";
41160
- import { join as join98 } from "path";
41182
+ import { join as join99 } from "path";
41161
41183
  var STALE_PATTERN = /^pr-\d+-comments\.yaml$/;
41162
41184
  function removeStaleCommentsCaches(cwd = process.cwd()) {
41163
- const dir = join98(cwd, ".assist");
41185
+ const dir = join99(cwd, ".assist");
41164
41186
  let entries2;
41165
41187
  try {
41166
41188
  entries2 = readdirSync18(dir);
@@ -41168,14 +41190,14 @@ function removeStaleCommentsCaches(cwd = process.cwd()) {
41168
41190
  return;
41169
41191
  }
41170
41192
  for (const entry of entries2.filter((e) => STALE_PATTERN.test(e))) {
41171
- unlinkSync16(join98(dir, entry));
41193
+ unlinkSync16(join99(dir, entry));
41172
41194
  }
41173
41195
  }
41174
41196
 
41175
41197
  // src/commands/prs/listComments/updateCommentsCache.ts
41176
41198
  function writeCommentsCache(org, repo, prNumber, comments3) {
41177
41199
  const cachePath = commentsCachePath(org, repo, prNumber);
41178
- mkdirSync33(dirname44(cachePath), { recursive: true });
41200
+ mkdirSync34(dirname44(cachePath), { recursive: true });
41179
41201
  const cacheData = {
41180
41202
  prNumber,
41181
41203
  fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
@@ -41286,7 +41308,7 @@ function failAzureDevops(error) {
41286
41308
  import { execFileSync as execFileSync23 } from "child_process";
41287
41309
  import { mkdtempSync as mkdtempSync2, rmSync as rmSync6, writeFileSync as writeFileSync47 } from "fs";
41288
41310
  import { tmpdir as tmpdir7 } from "os";
41289
- import { join as join99 } from "path";
41311
+ import { join as join100 } from "path";
41290
41312
  function azDevopsInvokeArgs(request, inFile) {
41291
41313
  return [
41292
41314
  "devops",
@@ -41321,8 +41343,8 @@ function runAz2(args) {
41321
41343
  }
41322
41344
  function invokeAzDevops(request) {
41323
41345
  if (request.body === void 0) return runAz2(azDevopsInvokeArgs(request));
41324
- const dir = mkdtempSync2(join99(tmpdir7(), "assist-az-"));
41325
- const inFile = join99(dir, "body.json");
41346
+ const dir = mkdtempSync2(join100(tmpdir7(), "assist-az-"));
41347
+ const inFile = join100(dir, "body.json");
41326
41348
  try {
41327
41349
  writeFileSync47(inFile, JSON.stringify(request.body));
41328
41350
  return runAz2(azDevopsInvokeArgs(request, inFile));
@@ -44452,9 +44474,9 @@ async function notify() {
44452
44474
 
44453
44475
  // src/commands/screenshot.ts
44454
44476
  import { execSync as execSync54 } from "child_process";
44455
- import { existsSync as existsSync77, mkdirSync as mkdirSync34, unlinkSync as unlinkSync17, writeFileSync as writeFileSync48 } from "fs";
44477
+ import { existsSync as existsSync77, mkdirSync as mkdirSync35, unlinkSync as unlinkSync17, writeFileSync as writeFileSync48 } from "fs";
44456
44478
  import { tmpdir as tmpdir8 } from "os";
44457
- import { join as join100, resolve as resolve28 } from "path";
44479
+ import { join as join101, resolve as resolve28 } from "path";
44458
44480
  import chalk239 from "chalk";
44459
44481
 
44460
44482
  // src/commands/screenshot/captureWindowPs1.ts
@@ -44585,13 +44607,13 @@ Write-Output $OutputPath
44585
44607
  // src/commands/screenshot.ts
44586
44608
  function buildOutputPath(outputDir, processName) {
44587
44609
  if (!existsSync77(outputDir)) {
44588
- mkdirSync34(outputDir, { recursive: true });
44610
+ mkdirSync35(outputDir, { recursive: true });
44589
44611
  }
44590
44612
  const timestamp9 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
44591
44613
  return resolve28(outputDir, `${processName}-${timestamp9}.png`);
44592
44614
  }
44593
44615
  function runPowerShellScript(processName, outputPath) {
44594
- const scriptPath = join100(tmpdir8(), `assist-screenshot-${Date.now()}.ps1`);
44616
+ const scriptPath = join101(tmpdir8(), `assist-screenshot-${Date.now()}.ps1`);
44595
44617
  writeFileSync48(scriptPath, captureWindowPs1, "utf8");
44596
44618
  try {
44597
44619
  execSync54(
@@ -44693,9 +44715,9 @@ function buildLimitsSegment(rateLimits) {
44693
44715
 
44694
44716
  // src/commands/readGitBranch.ts
44695
44717
  import { readFileSync as readFileSync67, statSync as statSync14 } from "fs";
44696
- import { isAbsolute as isAbsolute7, join as join101, resolve as resolve29 } from "path";
44718
+ import { isAbsolute as isAbsolute7, join as join102, resolve as resolve29 } from "path";
44697
44719
  function resolveGitDir(cwd) {
44698
- const dotGit = join101(cwd, ".git");
44720
+ const dotGit = join102(cwd, ".git");
44699
44721
  let stat5;
44700
44722
  try {
44701
44723
  stat5 = statSync14(dotGit);
@@ -44725,7 +44747,7 @@ function readGitBranch(cwd) {
44725
44747
  }
44726
44748
  let head;
44727
44749
  try {
44728
- head = readFileSync67(join101(gitDir, "HEAD"), "utf8");
44750
+ head = readFileSync67(join102(gitDir, "HEAD"), "utf8");
44729
44751
  } catch {
44730
44752
  return null;
44731
44753
  }
@@ -47901,12 +47923,12 @@ function formatSlicingRequest(hunks) {
47901
47923
  }
47902
47924
 
47903
47925
  // src/commands/review/highLevel/highLevelReviewPath.ts
47904
- import { join as join102 } from "path";
47926
+ import { join as join103 } from "path";
47905
47927
  function slug(value) {
47906
47928
  return value.replace(/[^\w.-]+/g, "-");
47907
47929
  }
47908
47930
  function highLevelReviewPath(repo, headRef, headSha) {
47909
- return join102(
47931
+ return join103(
47910
47932
  getStoreDir(),
47911
47933
  "high-level-reviews",
47912
47934
  slug(repo),
@@ -48041,10 +48063,10 @@ function resolveHighLevelSlices(raw, hunks) {
48041
48063
  }
48042
48064
 
48043
48065
  // src/commands/review/highLevel/writeJsonFile.ts
48044
- import { mkdirSync as mkdirSync35, writeFileSync as writeFileSync49 } from "fs";
48066
+ import { mkdirSync as mkdirSync36, writeFileSync as writeFileSync49 } from "fs";
48045
48067
  import { dirname as dirname47 } from "path";
48046
48068
  function writeJsonFile(path128, data) {
48047
- mkdirSync35(dirname47(path128), { recursive: true });
48069
+ mkdirSync36(dirname47(path128), { recursive: true });
48048
48070
  writeFileSync49(path128, `${JSON.stringify(data, null, 2)}
48049
48071
  `);
48050
48072
  return path128;
@@ -49068,8 +49090,8 @@ function renderEntry(entry, frame) {
49068
49090
  import { format } from "util";
49069
49091
 
49070
49092
  // src/commands/review/createReviewLogSink.ts
49071
- import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync36 } from "fs";
49072
- import { join as join103 } from "path";
49093
+ import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync37 } from "fs";
49094
+ import { join as join104 } from "path";
49073
49095
  var LOG_FILE = "review.log";
49074
49096
  function createReviewLogSink() {
49075
49097
  let logPath2;
@@ -49085,8 +49107,8 @@ function createReviewLogSink() {
49085
49107
  `);
49086
49108
  },
49087
49109
  attach(reviewDir) {
49088
- mkdirSync36(reviewDir, { recursive: true });
49089
- logPath2 = join103(reviewDir, LOG_FILE);
49110
+ mkdirSync37(reviewDir, { recursive: true });
49111
+ logPath2 = join104(reviewDir, LOG_FILE);
49090
49112
  const lines = [
49091
49113
  "",
49092
49114
  `=== ${(/* @__PURE__ */ new Date()).toISOString()} ===`,
@@ -49872,11 +49894,11 @@ ${annotateDiffWithLineNumbers(context.diff.trimEnd())}
49872
49894
  }
49873
49895
 
49874
49896
  // src/commands/review/buildReviewPaths.ts
49875
- import { homedir as homedir27 } from "os";
49876
- import { basename as basename27, join as join104 } from "path";
49897
+ import { homedir as homedir28 } from "os";
49898
+ import { basename as basename27, join as join105 } from "path";
49877
49899
  function buildReviewPaths(repoRoot3, key) {
49878
- const reviewDir = join104(
49879
- homedir27(),
49900
+ const reviewDir = join105(
49901
+ homedir28(),
49880
49902
  ".assist",
49881
49903
  "reviews",
49882
49904
  basename27(repoRoot3),
@@ -49884,10 +49906,10 @@ function buildReviewPaths(repoRoot3, key) {
49884
49906
  );
49885
49907
  return {
49886
49908
  reviewDir,
49887
- requestPath: join104(reviewDir, "request.md"),
49888
- claudePath: join104(reviewDir, "claude.md"),
49889
- codexPath: join104(reviewDir, "codex.md"),
49890
- synthesisPath: join104(reviewDir, "synthesis.md")
49909
+ requestPath: join105(reviewDir, "request.md"),
49910
+ claudePath: join105(reviewDir, "claude.md"),
49911
+ codexPath: join105(reviewDir, "codex.md"),
49912
+ synthesisPath: join105(reviewDir, "synthesis.md")
49891
49913
  };
49892
49914
  }
49893
49915
 
@@ -49925,14 +49947,14 @@ function fetchExistingComments() {
49925
49947
  }
49926
49948
 
49927
49949
  // src/commands/review/prepareReviewDir.ts
49928
- import { existsSync as existsSync80, mkdirSync as mkdirSync37, unlinkSync as unlinkSync19, writeFileSync as writeFileSync50 } from "fs";
49950
+ import { existsSync as existsSync80, mkdirSync as mkdirSync38, unlinkSync as unlinkSync19, writeFileSync as writeFileSync50 } from "fs";
49929
49951
  function clearReviewFiles(paths) {
49930
49952
  for (const path128 of [paths.claudePath, paths.codexPath, paths.synthesisPath]) {
49931
49953
  if (existsSync80(path128)) unlinkSync19(path128);
49932
49954
  }
49933
49955
  }
49934
49956
  function prepareReviewDir(paths, requestBody, force) {
49935
- mkdirSync37(paths.reviewDir, { recursive: true });
49957
+ mkdirSync38(paths.reviewDir, { recursive: true });
49936
49958
  if (force) clearReviewFiles(paths);
49937
49959
  writeFileSync50(paths.requestPath, requestBody);
49938
49960
  }
@@ -51534,7 +51556,7 @@ function parseReply(line) {
51534
51556
  }
51535
51557
 
51536
51558
  // src/commands/show/refuseSessionFiles.ts
51537
- import { homedir as homedir28 } from "os";
51559
+ import { homedir as homedir29 } from "os";
51538
51560
 
51539
51561
  // src/commands/show/findShownSessionFiles.ts
51540
51562
  var NOT_AFTER = String.raw`(?![\w\-/]|\.\w)`;
@@ -51594,7 +51616,7 @@ async function refuseSessionFiles(body) {
51594
51616
  harness
51595
51617
  });
51596
51618
  const shown = findShownSessionFiles(body, sessionWrittenPaths(events), {
51597
- home: homedir28(),
51619
+ home: homedir29(),
51598
51620
  cwd: process.cwd()
51599
51621
  });
51600
51622
  if (shown.length === 0) return;
@@ -53162,20 +53184,20 @@ async function configure() {
53162
53184
 
53163
53185
  // src/commands/transcript/list.ts
53164
53186
  import { existsSync as existsSync93, readdirSync as readdirSync25, statSync as statSync17 } from "fs";
53165
- import { join as join121 } from "path";
53187
+ import { join as join122 } from "path";
53166
53188
  function list5() {
53167
53189
  const { vttDir } = getTranscriptConfig();
53168
53190
  if (!existsSync93(vttDir)) return;
53169
53191
  for (const entry of readdirSync25(vttDir)) {
53170
53192
  if (!entry.endsWith(".vtt")) continue;
53171
- if (statSync17(join121(vttDir, entry)).isDirectory()) continue;
53193
+ if (statSync17(join122(vttDir, entry)).isDirectory()) continue;
53172
53194
  console.log(entry);
53173
53195
  }
53174
53196
  }
53175
53197
 
53176
53198
  // src/commands/transcript/move.ts
53177
- import { existsSync as existsSync94, mkdirSync as mkdirSync40, renameSync as renameSync5, writeFileSync as writeFileSync56 } from "fs";
53178
- import { basename as basename31, join as join122 } from "path";
53199
+ import { existsSync as existsSync94, mkdirSync as mkdirSync41, renameSync as renameSync5, writeFileSync as writeFileSync56 } from "fs";
53200
+ import { basename as basename31, join as join123 } from "path";
53179
53201
 
53180
53202
  // src/commands/transcript/convertVttToMarkdown.ts
53181
53203
  function convertVttToMarkdown(inputPath) {
@@ -53185,9 +53207,9 @@ function convertVttToMarkdown(inputPath) {
53185
53207
  // src/commands/transcript/move.ts
53186
53208
  var DATE_REGEX = /^\d{4}-\d{2}-\d{2}$/;
53187
53209
  function archiveRawVtt(vttDir, sourcePath, filename) {
53188
- const processedDir = join122(vttDir, "processed");
53189
- mkdirSync40(processedDir, { recursive: true });
53190
- renameSync5(sourcePath, join122(processedDir, filename));
53210
+ const processedDir = join123(vttDir, "processed");
53211
+ mkdirSync41(processedDir, { recursive: true });
53212
+ renameSync5(sourcePath, join123(processedDir, filename));
53191
53213
  }
53192
53214
  function move(file, options2) {
53193
53215
  const { date, client } = options2;
@@ -53197,19 +53219,19 @@ function move(file, options2) {
53197
53219
  }
53198
53220
  const { vttDir, transcriptsDir, summaryDir } = getTranscriptConfig();
53199
53221
  const filename = basename31(file);
53200
- const sourcePath = join122(vttDir, filename);
53222
+ const sourcePath = join123(vttDir, filename);
53201
53223
  if (!existsSync94(sourcePath)) {
53202
53224
  console.error(`Error: VTT file not found: ${sourcePath}`);
53203
53225
  process.exit(1);
53204
53226
  }
53205
53227
  const base = basename31(filename, ".vtt").replace(/ Transcription$/, "");
53206
53228
  const outputName = `${date} ${base}.md`;
53207
- const formattedDir = join122(transcriptsDir, client);
53208
- mkdirSync40(formattedDir, { recursive: true });
53209
- const formattedPath = join122(formattedDir, outputName);
53229
+ const formattedDir = join123(transcriptsDir, client);
53230
+ mkdirSync41(formattedDir, { recursive: true });
53231
+ const formattedPath = join123(formattedDir, outputName);
53210
53232
  writeFileSync56(formattedPath, convertVttToMarkdown(sourcePath), "utf8");
53211
53233
  archiveRawVtt(vttDir, sourcePath, filename);
53212
- const summaryPath = join122(summaryDir, client, outputName);
53234
+ const summaryPath = join123(summaryDir, client, outputName);
53213
53235
  console.log(`Formatted transcript: ${formattedPath}`);
53214
53236
  console.log(`Summary target: ${summaryPath}`);
53215
53237
  }
@@ -55141,7 +55163,7 @@ function registerWatch(program) {
55141
55163
  // src/commands/roam/postRoamActivity.ts
55142
55164
  import { execFileSync as execFileSync34 } from "child_process";
55143
55165
  import { readdirSync as readdirSync27, readFileSync as readFileSync87, statSync as statSync18 } from "fs";
55144
- import { join as join123 } from "path";
55166
+ import { join as join124 } from "path";
55145
55167
  function findPortFile(roamDir) {
55146
55168
  let entries2;
55147
55169
  try {
@@ -55150,7 +55172,7 @@ function findPortFile(roamDir) {
55150
55172
  return void 0;
55151
55173
  }
55152
55174
  const candidates = entries2.filter((name2) => /^roam-local-api(-[^.]+)?\.port$/.test(name2)).map((name2) => {
55153
- const path128 = join123(roamDir, name2);
55175
+ const path128 = join124(roamDir, name2);
55154
55176
  try {
55155
55177
  return { path: path128, mtimeMs: statSync18(path128).mtimeMs };
55156
55178
  } catch {
@@ -55167,7 +55189,7 @@ var PID_BY_APP = {
55167
55189
  function postRoamActivity(app, event) {
55168
55190
  const appData = process.env.APPDATA;
55169
55191
  if (!appData) return;
55170
- const portFile = findPortFile(join123(appData, "Roam"));
55192
+ const portFile = findPortFile(join124(appData, "Roam"));
55171
55193
  if (!portFile) return;
55172
55194
  let port;
55173
55195
  try {
@@ -55350,7 +55372,7 @@ function link2() {
55350
55372
  }
55351
55373
 
55352
55374
  // src/commands/run/add.ts
55353
- import { mkdirSync as mkdirSync41, writeFileSync as writeFileSync61 } from "fs";
55375
+ import { mkdirSync as mkdirSync42, writeFileSync as writeFileSync61 } from "fs";
55354
55376
  import { dirname as dirname51 } from "path";
55355
55377
 
55356
55378
  // src/commands/run/editRepoRunList.ts
@@ -55526,11 +55548,11 @@ function requireParsedArgs() {
55526
55548
  }
55527
55549
 
55528
55550
  // src/commands/run/runCommandFilePath.ts
55529
- import { join as join124 } from "path";
55551
+ import { join as join125 } from "path";
55530
55552
  function runCommandFilePath(name2) {
55531
55553
  const segments = name2.split(":");
55532
55554
  const file = `${segments.pop()}.md`;
55533
- return join124(".claude", "commands", ...segments, file);
55555
+ return join125(".claude", "commands", ...segments, file);
55534
55556
  }
55535
55557
 
55536
55558
  // src/commands/run/add.ts
@@ -55547,7 +55569,7 @@ function saveProjectRunConfig(entry) {
55547
55569
  }
55548
55570
  function createCommandFile(name2) {
55549
55571
  const filePath = runCommandFilePath(name2);
55550
- mkdirSync41(dirname51(filePath), { recursive: true });
55572
+ mkdirSync42(dirname51(filePath), { recursive: true });
55551
55573
  const content = `---
55552
55574
  description: Run ${name2}
55553
55575
  ---
@@ -55675,7 +55697,7 @@ function registerRunAdd(runCommand) {
55675
55697
 
55676
55698
  // src/commands/run/remove.ts
55677
55699
  import { existsSync as existsSync100, readdirSync as readdirSync28, rmdirSync, unlinkSync as unlinkSync20 } from "fs";
55678
- import { dirname as dirname52, join as join125 } from "path";
55700
+ import { dirname as dirname52, join as join126 } from "path";
55679
55701
 
55680
55702
  // src/commands/run/removeRepoRunConfig.ts
55681
55703
  function isNamed(entry, name2) {
@@ -55693,7 +55715,7 @@ function removeRepoRunConfig(name2, repoName, cwd = process.cwd()) {
55693
55715
 
55694
55716
  // src/commands/run/remove.ts
55695
55717
  function removeEmptyNamespaceDirs(filePath) {
55696
- const root2 = join125(".claude", "commands");
55718
+ const root2 = join126(".claude", "commands");
55697
55719
  for (let dir = dirname52(filePath); dir !== root2; dir = dirname52(dir)) {
55698
55720
  if (!existsSync100(dir) || readdirSync28(dir).length > 0) return;
55699
55721
  rmdirSync(dir);
@@ -55701,7 +55723,7 @@ function removeEmptyNamespaceDirs(filePath) {
55701
55723
  }
55702
55724
  function deleteCommandFile(name2) {
55703
55725
  const filePath = runCommandFilePath(name2);
55704
- const legacyPath = join125(".claude", "commands", `${name2}.md`);
55726
+ const legacyPath = join126(".claude", "commands", `${name2}.md`);
55705
55727
  for (const path128 of /* @__PURE__ */ new Set([filePath, legacyPath])) {
55706
55728
  if (existsSync100(path128)) {
55707
55729
  unlinkSync20(path128);
@@ -55985,7 +56007,7 @@ function requestDrain(socket, lines) {
55985
56007
  }
55986
56008
 
55987
56009
  // src/commands/sessions/daemon/runDaemon.ts
55988
- import { mkdirSync as mkdirSync45 } from "fs";
56010
+ import { mkdirSync as mkdirSync46 } from "fs";
55989
56011
 
55990
56012
  // src/commands/sessions/daemon/broadcast.ts
55991
56013
  function sendTo(client, msg) {
@@ -56552,7 +56574,7 @@ function broadcastSessions(sessions, clients, linkedSessions = [], active) {
56552
56574
 
56553
56575
  // src/commands/sessions/daemon/findServerParents.ts
56554
56576
  import { existsSync as existsSync102 } from "fs";
56555
- import { join as join126, resolve as resolve33 } from "path";
56577
+ import { join as join127, resolve as resolve33 } from "path";
56556
56578
  function isLive(session) {
56557
56579
  return !!session.pty && session.status !== "done" && session.status !== "error";
56558
56580
  }
@@ -56561,7 +56583,7 @@ function isLiveAgent(session) {
56561
56583
  }
56562
56584
  function serverRunDirs(sessions, file) {
56563
56585
  return new Set(
56564
- sessions.filter((s) => s.server && s.cwd && isLive(s)).map((s) => resolve33(s.cwd)).filter((dir) => existsSync102(join126(dir, file)))
56586
+ sessions.filter((s) => s.server && s.cwd && isLive(s)).map((s) => resolve33(s.cwd)).filter((dir) => existsSync102(join127(dir, file)))
56565
56587
  );
56566
56588
  }
56567
56589
  function findServerParents(sessions, file) {
@@ -57410,12 +57432,12 @@ function trimWatcherLog(cwd) {
57410
57432
  }
57411
57433
 
57412
57434
  // src/commands/sessions/daemon/worktree/appendWatcherLog.ts
57413
- import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync42 } from "fs";
57435
+ import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync43 } from "fs";
57414
57436
  import { dirname as dirname53 } from "path";
57415
57437
  function appendWatcherLog(cwd, data) {
57416
57438
  try {
57417
57439
  const path128 = watcherLogPath(cwd);
57418
- mkdirSync42(dirname53(path128), { recursive: true });
57440
+ mkdirSync43(dirname53(path128), { recursive: true });
57419
57441
  appendFileSync4(path128, data);
57420
57442
  } catch {
57421
57443
  }
@@ -57590,9 +57612,9 @@ import { existsSync as existsSync105 } from "fs";
57590
57612
 
57591
57613
  // src/commands/sessions/daemon/worktree/holdsNoCheckout.ts
57592
57614
  import { existsSync as existsSync104 } from "fs";
57593
- import { join as join128 } from "path";
57615
+ import { join as join129 } from "path";
57594
57616
  function holdsNoCheckout(path128) {
57595
- return existsSync104(path128) && !existsSync104(join128(path128, ".git"));
57617
+ return existsSync104(path128) && !existsSync104(join129(path128, ".git"));
57596
57618
  }
57597
57619
 
57598
57620
  // src/commands/sessions/daemon/worktree/treeDurability.ts
@@ -57935,12 +57957,12 @@ import { basename as basename34 } from "path";
57935
57957
 
57936
57958
  // src/commands/sessions/daemon/worktree/deleteStrandedTree.ts
57937
57959
  import { existsSync as existsSync106 } from "fs";
57938
- import { join as join130 } from "path";
57960
+ import { join as join131 } from "path";
57939
57961
 
57940
57962
  // src/commands/sessions/daemon/worktree/deleteTreeDirectly.ts
57941
57963
  import { statSync as statSync19 } from "fs";
57942
57964
  import { rm as rm3 } from "fs/promises";
57943
- import { join as join129 } from "path";
57965
+ import { join as join130 } from "path";
57944
57966
  async function deleteTreeDirectly(clone, worktreePath, why) {
57945
57967
  if (holdsAGitDirectoryRatherThanALink(worktreePath)) {
57946
57968
  const refusal = "it is a clone of its own, not a linked worktree";
@@ -57969,7 +57991,7 @@ async function deleteTreeDirectly(clone, worktreePath, why) {
57969
57991
  return { removed: true };
57970
57992
  }
57971
57993
  function holdsAGitDirectoryRatherThanALink(worktreePath) {
57972
- return statSync19(join129(worktreePath, ".git"), {
57994
+ return statSync19(join130(worktreePath, ".git"), {
57973
57995
  throwIfNoEntry: false
57974
57996
  })?.isDirectory() === true;
57975
57997
  }
@@ -58010,7 +58032,7 @@ async function deleteStrandedTree(clone, worktreePath, cause) {
58010
58032
  );
58011
58033
  }
58012
58034
  function strandedReason(worktreePath, cause) {
58013
- if (!existsSync106(join130(worktreePath, ".git")))
58035
+ if (!existsSync106(join131(worktreePath, ".git")))
58014
58036
  return "its .git link is already gone";
58015
58037
  if (/not a working tree|not a git repository/i.test(reason2(cause)))
58016
58038
  return "git no longer recognises it as a working tree";
@@ -59254,7 +59276,7 @@ function handleRefusedRun(session, exitCode, onStatusChange) {
59254
59276
  }
59255
59277
 
59256
59278
  // src/commands/sessions/daemon/watchActivity.ts
59257
- import { existsSync as existsSync110, mkdirSync as mkdirSync43, watch as watch2 } from "fs";
59279
+ import { existsSync as existsSync110, mkdirSync as mkdirSync44, watch as watch2 } from "fs";
59258
59280
  import { dirname as dirname55 } from "path";
59259
59281
 
59260
59282
  // src/commands/sessions/daemon/applyActivityToSession.ts
@@ -59441,7 +59463,7 @@ function watchActivity(session, notify2, onConversation) {
59441
59463
  const path128 = activityPath(session.id);
59442
59464
  const dir = dirname55(path128);
59443
59465
  try {
59444
- mkdirSync43(dir, { recursive: true });
59466
+ mkdirSync44(dir, { recursive: true });
59445
59467
  } catch {
59446
59468
  return;
59447
59469
  }
@@ -59579,10 +59601,10 @@ function reportSilentFailure(session, clients) {
59579
59601
  import { watch as watch3 } from "fs";
59580
59602
 
59581
59603
  // src/commands/sessions/daemon/ensureProjectDirExists.ts
59582
- import { mkdirSync as mkdirSync44 } from "fs";
59604
+ import { mkdirSync as mkdirSync45 } from "fs";
59583
59605
  function ensureProjectDirExists(dir, sessionId2) {
59584
59606
  try {
59585
- mkdirSync44(dir, { recursive: true });
59607
+ mkdirSync45(dir, { recursive: true });
59586
59608
  return true;
59587
59609
  } catch (error) {
59588
59610
  daemonLog(
@@ -61631,7 +61653,7 @@ import { existsSync as existsSync112 } from "fs";
61631
61653
 
61632
61654
  // src/commands/sessions/daemon/worktree/leftoverContents.ts
61633
61655
  import { lstatSync, readdirSync as readdirSync30 } from "fs";
61634
- import { join as join131 } from "path";
61656
+ import { join as join132 } from "path";
61635
61657
  function leftoverContents(path128) {
61636
61658
  const contents = { holdsFiles: false, foreignOwned: false };
61637
61659
  walk2(path128, contents, process.getuid?.());
@@ -61653,7 +61675,7 @@ function walk2(path128, contents, uid) {
61653
61675
  contents.holdsFiles = true;
61654
61676
  return;
61655
61677
  }
61656
- for (const entry of entries2) walk2(join131(path128, entry), contents, uid);
61678
+ for (const entry of entries2) walk2(join132(path128, entry), contents, uid);
61657
61679
  }
61658
61680
 
61659
61681
  // src/commands/sessions/daemon/worktree/recheckReapedWorktrees.ts
@@ -61691,7 +61713,7 @@ function reviewFirst(path128, contents) {
61691
61713
  }
61692
61714
 
61693
61715
  // src/commands/sessions/daemon/worktree/reportLeftovers.ts
61694
- import { homedir as homedir31 } from "os";
61716
+ import { homedir as homedir32 } from "os";
61695
61717
 
61696
61718
  // src/commands/sessions/daemon/worktree/noticeContent.ts
61697
61719
  function noticeContent(leftovers) {
@@ -61754,7 +61776,7 @@ function reportLeftovers(sessions, spawnNotice, leftovers, notify2) {
61754
61776
  ...content,
61755
61777
  commandType: "assist",
61756
61778
  pty: null,
61757
- cwd: homedir31(),
61779
+ cwd: homedir32(),
61758
61780
  leftoverNotice: true
61759
61781
  }));
61760
61782
  daemonLog(`leftover notice ${id} created: ${leftovers.length} leftover(s)`);
@@ -64889,7 +64911,7 @@ async function recoverFromAddrInUse(server, manager, checkAutoExit) {
64889
64911
 
64890
64912
  // src/commands/sessions/daemon/runDaemon.ts
64891
64913
  async function runDaemon() {
64892
- mkdirSync45(daemonPaths.dir, { recursive: true });
64914
+ mkdirSync46(daemonPaths.dir, { recursive: true });
64893
64915
  daemonLog(
64894
64916
  `starting (reason: ${process.env.ASSIST_DAEMON_SPAWN_REASON ?? "manual"})`
64895
64917
  );