@staff0rd/assist 0.485.0 → 0.485.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.485.0",
9
+ version: "0.485.1",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -20530,21 +20530,33 @@ import { join as join55 } from "path";
20530
20530
 
20531
20531
  // src/commands/prs/loadCommentsCache.ts
20532
20532
  import { existsSync as existsSync47, readFileSync as readFileSync39, unlinkSync as unlinkSync13 } from "fs";
20533
- import { join as join54 } from "path";
20534
20533
  import { parse as parse2 } from "yaml";
20535
- function getCachePath(prNumber) {
20536
- return join54(process.cwd(), ".assist", `pr-${prNumber}-comments.yaml`);
20534
+
20535
+ // src/commands/prs/commentsCachePath.ts
20536
+ import { homedir as homedir20 } from "os";
20537
+ import { join as join54 } from "path";
20538
+ function commentsCachePath(org, repo, prNumber) {
20539
+ return join54(
20540
+ homedir20(),
20541
+ ".assist",
20542
+ "pr-comments",
20543
+ org,
20544
+ repo,
20545
+ `pr-${prNumber}-comments.yaml`
20546
+ );
20537
20547
  }
20538
- function loadCommentsCache(prNumber) {
20539
- const cachePath = getCachePath(prNumber);
20548
+
20549
+ // src/commands/prs/loadCommentsCache.ts
20550
+ function loadCommentsCache(org, repo, prNumber) {
20551
+ const cachePath = commentsCachePath(org, repo, prNumber);
20540
20552
  if (!existsSync47(cachePath)) {
20541
20553
  return null;
20542
20554
  }
20543
20555
  const content = readFileSync39(cachePath, "utf8");
20544
20556
  return parse2(content);
20545
20557
  }
20546
- function deleteCommentsCache(prNumber) {
20547
- const cachePath = getCachePath(prNumber);
20558
+ function deleteCommentsCache(org, repo, prNumber) {
20559
+ const cachePath = commentsCachePath(org, repo, prNumber);
20548
20560
  if (existsSync47(cachePath)) {
20549
20561
  unlinkSync13(cachePath);
20550
20562
  console.log("No more unresolved line comments. Cache dropped.");
@@ -20574,8 +20586,8 @@ function resolveThread(threadId) {
20574
20586
  unlinkSync14(queryFile);
20575
20587
  }
20576
20588
  }
20577
- function requireCache(prNumber) {
20578
- const cache4 = loadCommentsCache(prNumber);
20589
+ function requireCache(org, repo, prNumber) {
20590
+ const cache4 = loadCommentsCache(org, repo, prNumber);
20579
20591
  if (!cache4) {
20580
20592
  console.error(
20581
20593
  `Error: No cached comments found for PR #${prNumber}. Run "assist prs list-comments" first.`
@@ -20597,22 +20609,22 @@ function requireLineComment(cache4, commentId) {
20597
20609
  }
20598
20610
  return comment3;
20599
20611
  }
20600
- function cleanupCacheIfDone(cache4, prNumber, commentId) {
20612
+ function cleanupCacheIfDone(cache4, org, repo, prNumber, commentId) {
20601
20613
  const hasRemaining = cache4.comments.some(
20602
20614
  (c) => c.type === "line" && c.id !== commentId
20603
20615
  );
20604
- if (!hasRemaining) deleteCommentsCache(prNumber);
20616
+ if (!hasRemaining) deleteCommentsCache(org, repo, prNumber);
20605
20617
  }
20606
20618
  function resolveCommentWithReply(commentId, message2) {
20607
20619
  const prNumber = getCurrentPrNumber();
20608
20620
  const { org, repo } = getRepoInfo();
20609
- const cache4 = requireCache(prNumber);
20621
+ const cache4 = requireCache(org, repo, prNumber);
20610
20622
  const comment3 = requireLineComment(cache4, commentId);
20611
20623
  replyToComment(org, repo, prNumber, commentId, message2);
20612
20624
  console.log("Reply posted successfully.");
20613
20625
  resolveThread(comment3.threadId);
20614
20626
  console.log("Thread resolved successfully.");
20615
- cleanupCacheIfDone(cache4, prNumber, commentId);
20627
+ cleanupCacheIfDone(cache4, org, repo, prNumber, commentId);
20616
20628
  }
20617
20629
 
20618
20630
  // src/commands/prs/fixed.ts
@@ -20644,11 +20656,6 @@ function fixed(commentId, sha) {
20644
20656
  }
20645
20657
  }
20646
20658
 
20647
- // src/commands/prs/listComments/index.ts
20648
- import { existsSync as existsSync48, mkdirSync as mkdirSync18, writeFileSync as writeFileSync35 } from "fs";
20649
- import { join as join57 } from "path";
20650
- import { stringify } from "yaml";
20651
-
20652
20659
  // src/commands/prs/fetchThreadIds.ts
20653
20660
  import { execSync as execSync46 } from "child_process";
20654
20661
  import { unlinkSync as unlinkSync15, writeFileSync as writeFileSync34 } from "fs";
@@ -20724,6 +20731,28 @@ function fetchLineComments(org, repo, prNumber, threadInfo) {
20724
20731
  );
20725
20732
  }
20726
20733
 
20734
+ // src/commands/prs/listComments/updateCommentsCache.ts
20735
+ import { mkdirSync as mkdirSync18, writeFileSync as writeFileSync35 } from "fs";
20736
+ import { dirname as dirname27 } from "path";
20737
+ import { stringify } from "yaml";
20738
+ function writeCommentsCache(org, repo, prNumber, comments3) {
20739
+ const cachePath = commentsCachePath(org, repo, prNumber);
20740
+ mkdirSync18(dirname27(cachePath), { recursive: true });
20741
+ const cacheData = {
20742
+ prNumber,
20743
+ fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
20744
+ comments: comments3
20745
+ };
20746
+ writeFileSync35(cachePath, stringify(cacheData));
20747
+ }
20748
+ function updateCommentsCache(org, repo, prNumber, comments3) {
20749
+ if (comments3.some((c) => c.type === "line")) {
20750
+ writeCommentsCache(org, repo, prNumber, comments3);
20751
+ } else {
20752
+ deleteCommentsCache(org, repo, prNumber);
20753
+ }
20754
+ }
20755
+
20727
20756
  // src/commands/prs/listComments/printComments.ts
20728
20757
  import chalk167 from "chalk";
20729
20758
  function formatForHuman(comment3) {
@@ -20769,19 +20798,6 @@ function printComments2(result) {
20769
20798
  }
20770
20799
 
20771
20800
  // src/commands/prs/listComments/index.ts
20772
- function writeCommentsCache(prNumber, comments3) {
20773
- const assistDir = join57(process.cwd(), ".assist");
20774
- if (!existsSync48(assistDir)) {
20775
- mkdirSync18(assistDir, { recursive: true });
20776
- }
20777
- const cacheData = {
20778
- prNumber,
20779
- fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
20780
- comments: comments3
20781
- };
20782
- const cachePath = join57(assistDir, `pr-${prNumber}-comments.yaml`);
20783
- writeFileSync35(cachePath, stringify(cacheData));
20784
- }
20785
20801
  function handleKnownErrors(error) {
20786
20802
  if (isGhNotInstalled(error)) {
20787
20803
  console.error("Error: GitHub CLI (gh) is not installed.");
@@ -20794,13 +20810,6 @@ function handleKnownErrors(error) {
20794
20810
  }
20795
20811
  return null;
20796
20812
  }
20797
- function updateCache(prNumber, comments3) {
20798
- if (comments3.some((c) => c.type === "line")) {
20799
- writeCommentsCache(prNumber, comments3);
20800
- } else {
20801
- deleteCommentsCache(prNumber);
20802
- }
20803
- }
20804
20813
  async function listComments() {
20805
20814
  try {
20806
20815
  const prNumber = getCurrentPrNumber();
@@ -20810,9 +20819,9 @@ async function listComments() {
20810
20819
  ...fetchReviewComments(org, repo, prNumber),
20811
20820
  ...fetchLineComments(org, repo, prNumber, threadInfo)
20812
20821
  ];
20813
- updateCache(prNumber, allComments);
20822
+ updateCommentsCache(org, repo, prNumber, allComments);
20814
20823
  const hasLineComments = allComments.some((c) => c.type === "line");
20815
- const cachePath = hasLineComments ? join57(process.cwd(), ".assist", `pr-${prNumber}-comments.yaml`) : null;
20824
+ const cachePath = hasLineComments ? commentsCachePath(org, repo, prNumber) : null;
20816
20825
  return { comments: allComments, cachePath };
20817
20826
  } catch (error) {
20818
20827
  const handled = handleKnownErrors(error);
@@ -23603,11 +23612,11 @@ ${annotateDiffWithLineNumbers(context.diff.trimEnd())}
23603
23612
  }
23604
23613
 
23605
23614
  // src/commands/review/buildReviewPaths.ts
23606
- import { homedir as homedir20 } from "os";
23607
- import { basename as basename14, join as join58 } from "path";
23615
+ import { homedir as homedir21 } from "os";
23616
+ import { basename as basename14, join as join57 } from "path";
23608
23617
  function buildReviewPaths(repoRoot, key) {
23609
- const reviewDir = join58(
23610
- homedir20(),
23618
+ const reviewDir = join57(
23619
+ homedir21(),
23611
23620
  ".assist",
23612
23621
  "reviews",
23613
23622
  basename14(repoRoot),
@@ -23615,10 +23624,10 @@ function buildReviewPaths(repoRoot, key) {
23615
23624
  );
23616
23625
  return {
23617
23626
  reviewDir,
23618
- requestPath: join58(reviewDir, "request.md"),
23619
- claudePath: join58(reviewDir, "claude.md"),
23620
- codexPath: join58(reviewDir, "codex.md"),
23621
- synthesisPath: join58(reviewDir, "synthesis.md")
23627
+ requestPath: join57(reviewDir, "request.md"),
23628
+ claudePath: join57(reviewDir, "claude.md"),
23629
+ codexPath: join57(reviewDir, "codex.md"),
23630
+ synthesisPath: join57(reviewDir, "synthesis.md")
23622
23631
  };
23623
23632
  }
23624
23633
 
@@ -24157,10 +24166,10 @@ async function handlePostSynthesis(synthesisPath, options2) {
24157
24166
  }
24158
24167
 
24159
24168
  // src/commands/review/prepareReviewDir.ts
24160
- import { existsSync as existsSync49, mkdirSync as mkdirSync19, unlinkSync as unlinkSync16, writeFileSync as writeFileSync36 } from "fs";
24169
+ import { existsSync as existsSync48, mkdirSync as mkdirSync19, unlinkSync as unlinkSync16, writeFileSync as writeFileSync36 } from "fs";
24161
24170
  function clearReviewFiles(paths) {
24162
24171
  for (const path71 of [paths.claudePath, paths.codexPath, paths.synthesisPath]) {
24163
- if (existsSync49(path71)) unlinkSync16(path71);
24172
+ if (existsSync48(path71)) unlinkSync16(path71);
24164
24173
  }
24165
24174
  }
24166
24175
  function prepareReviewDir(paths, requestBody, force) {
@@ -24445,7 +24454,7 @@ function printReviewerFailures(results) {
24445
24454
  }
24446
24455
 
24447
24456
  // src/commands/review/runAndSynthesise.ts
24448
- import { existsSync as existsSync51, unlinkSync as unlinkSync18 } from "fs";
24457
+ import { existsSync as existsSync50, unlinkSync as unlinkSync18 } from "fs";
24449
24458
 
24450
24459
  // src/commands/review/buildReviewerStdin.ts
24451
24460
  var REVIEW_PROMPT = `You are acting as a reviewer for a proposed code change made by another engineer. The full review request \u2014 branch, base, changed files, and unified diff \u2014 is in the request file whose absolute path is given below.
@@ -24865,7 +24874,7 @@ function resolveClaude(args) {
24865
24874
  }
24866
24875
 
24867
24876
  // src/commands/review/runCodexReviewer.ts
24868
- import { existsSync as existsSync50, unlinkSync as unlinkSync17 } from "fs";
24877
+ import { existsSync as existsSync49, unlinkSync as unlinkSync17 } from "fs";
24869
24878
 
24870
24879
  // src/commands/review/parseCodexEvent.ts
24871
24880
  function isItemStarted(value) {
@@ -24917,7 +24926,7 @@ async function runCodexReviewer(spec) {
24917
24926
  reportReviewerToolUse(spec.name, event, spinner);
24918
24927
  }
24919
24928
  });
24920
- if (result.exitCode !== 0 && existsSync50(spec.outputPath)) {
24929
+ if (result.exitCode !== 0 && existsSync49(spec.outputPath)) {
24921
24930
  unlinkSync17(spec.outputPath);
24922
24931
  }
24923
24932
  return finaliseReviewerRun({ ...spec, command }, spinner, result);
@@ -25063,7 +25072,7 @@ async function runAndSynthesise(args) {
25063
25072
  console.error("Both reviewers failed; skipping synthesis.");
25064
25073
  return { ok: false, failures };
25065
25074
  }
25066
- if (anyFresh && existsSync51(paths.synthesisPath)) {
25075
+ if (anyFresh && existsSync50(paths.synthesisPath)) {
25067
25076
  unlinkSync18(paths.synthesisPath);
25068
25077
  }
25069
25078
  const synthesisResult = await synthesise(paths, { multi });
@@ -25936,27 +25945,27 @@ async function configure() {
25936
25945
  }
25937
25946
 
25938
25947
  // src/commands/transcript/list.ts
25939
- import { existsSync as existsSync52, readdirSync as readdirSync10, statSync as statSync8 } from "fs";
25940
- import { join as join59 } from "path";
25948
+ import { existsSync as existsSync51, readdirSync as readdirSync10, statSync as statSync8 } from "fs";
25949
+ import { join as join58 } from "path";
25941
25950
  function list4() {
25942
25951
  const { vttDir } = getTranscriptConfig();
25943
- if (!existsSync52(vttDir)) return;
25952
+ if (!existsSync51(vttDir)) return;
25944
25953
  for (const entry of readdirSync10(vttDir)) {
25945
25954
  if (!entry.endsWith(".vtt")) continue;
25946
- if (statSync8(join59(vttDir, entry)).isDirectory()) continue;
25955
+ if (statSync8(join58(vttDir, entry)).isDirectory()) continue;
25947
25956
  console.log(entry);
25948
25957
  }
25949
25958
  }
25950
25959
 
25951
25960
  // src/commands/transcript/move.ts
25952
25961
  import {
25953
- existsSync as existsSync53,
25962
+ existsSync as existsSync52,
25954
25963
  mkdirSync as mkdirSync20,
25955
25964
  readFileSync as readFileSync42,
25956
25965
  renameSync as renameSync2,
25957
25966
  writeFileSync as writeFileSync38
25958
25967
  } from "fs";
25959
- import { basename as basename15, join as join60 } from "path";
25968
+ import { basename as basename15, join as join59 } from "path";
25960
25969
 
25961
25970
  // src/commands/transcript/cleanText.ts
25962
25971
  function cleanText(text17) {
@@ -26169,9 +26178,9 @@ function convertVttToMarkdown(inputPath) {
26169
26178
  return formatChatLog(messages);
26170
26179
  }
26171
26180
  function archiveRawVtt(vttDir, sourcePath, filename) {
26172
- const processedDir = join60(vttDir, "processed");
26181
+ const processedDir = join59(vttDir, "processed");
26173
26182
  mkdirSync20(processedDir, { recursive: true });
26174
- renameSync2(sourcePath, join60(processedDir, filename));
26183
+ renameSync2(sourcePath, join59(processedDir, filename));
26175
26184
  }
26176
26185
  function move(file, options2) {
26177
26186
  const { date, client } = options2;
@@ -26181,19 +26190,19 @@ function move(file, options2) {
26181
26190
  }
26182
26191
  const { vttDir, transcriptsDir, summaryDir } = getTranscriptConfig();
26183
26192
  const filename = basename15(file);
26184
- const sourcePath = join60(vttDir, filename);
26185
- if (!existsSync53(sourcePath)) {
26193
+ const sourcePath = join59(vttDir, filename);
26194
+ if (!existsSync52(sourcePath)) {
26186
26195
  console.error(`Error: VTT file not found: ${sourcePath}`);
26187
26196
  process.exit(1);
26188
26197
  }
26189
26198
  const base = basename15(filename, ".vtt").replace(/ Transcription$/, "");
26190
26199
  const outputName = `${date} ${base}.md`;
26191
- const formattedDir = join60(transcriptsDir, client);
26200
+ const formattedDir = join59(transcriptsDir, client);
26192
26201
  mkdirSync20(formattedDir, { recursive: true });
26193
- const formattedPath = join60(formattedDir, outputName);
26202
+ const formattedPath = join59(formattedDir, outputName);
26194
26203
  writeFileSync38(formattedPath, convertVttToMarkdown(sourcePath), "utf8");
26195
26204
  archiveRawVtt(vttDir, sourcePath, filename);
26196
- const summaryPath = join60(summaryDir, client, outputName);
26205
+ const summaryPath = join59(summaryDir, client, outputName);
26197
26206
  console.log(`Formatted transcript: ${formattedPath}`);
26198
26207
  console.log(`Summary target: ${summaryPath}`);
26199
26208
  }
@@ -26313,45 +26322,45 @@ function registerVerify(program2) {
26313
26322
 
26314
26323
  // src/commands/voice/devices.ts
26315
26324
  import { spawnSync as spawnSync6 } from "child_process";
26316
- import { join as join62 } from "path";
26325
+ import { join as join61 } from "path";
26317
26326
 
26318
26327
  // src/commands/voice/shared.ts
26319
- import { homedir as homedir21 } from "os";
26320
- import { dirname as dirname28, join as join61 } from "path";
26328
+ import { homedir as homedir22 } from "os";
26329
+ import { dirname as dirname29, join as join60 } from "path";
26321
26330
  import { fileURLToPath as fileURLToPath7 } from "url";
26322
- var __dirname5 = dirname28(fileURLToPath7(import.meta.url));
26323
- var VOICE_DIR = join61(homedir21(), ".assist", "voice");
26331
+ var __dirname5 = dirname29(fileURLToPath7(import.meta.url));
26332
+ var VOICE_DIR = join60(homedir22(), ".assist", "voice");
26324
26333
  var voicePaths = {
26325
26334
  dir: VOICE_DIR,
26326
- pid: join61(VOICE_DIR, "voice.pid"),
26327
- log: join61(VOICE_DIR, "voice.log"),
26328
- venv: join61(VOICE_DIR, ".venv"),
26329
- lock: join61(VOICE_DIR, "voice.lock")
26335
+ pid: join60(VOICE_DIR, "voice.pid"),
26336
+ log: join60(VOICE_DIR, "voice.log"),
26337
+ venv: join60(VOICE_DIR, ".venv"),
26338
+ lock: join60(VOICE_DIR, "voice.lock")
26330
26339
  };
26331
26340
  function getPythonDir() {
26332
- return join61(__dirname5, "commands", "voice", "python");
26341
+ return join60(__dirname5, "commands", "voice", "python");
26333
26342
  }
26334
26343
  function getVenvPython() {
26335
- return process.platform === "win32" ? join61(voicePaths.venv, "Scripts", "python.exe") : join61(voicePaths.venv, "bin", "python");
26344
+ return process.platform === "win32" ? join60(voicePaths.venv, "Scripts", "python.exe") : join60(voicePaths.venv, "bin", "python");
26336
26345
  }
26337
26346
  function getLockDir() {
26338
26347
  const config = loadConfig();
26339
26348
  return config.voice?.lockDir ?? VOICE_DIR;
26340
26349
  }
26341
26350
  function getLockFile() {
26342
- return join61(getLockDir(), "voice.lock");
26351
+ return join60(getLockDir(), "voice.lock");
26343
26352
  }
26344
26353
 
26345
26354
  // src/commands/voice/devices.ts
26346
26355
  function devices() {
26347
- const script = join62(getPythonDir(), "list_devices.py");
26356
+ const script = join61(getPythonDir(), "list_devices.py");
26348
26357
  spawnSync6(getVenvPython(), [script], { stdio: "inherit" });
26349
26358
  }
26350
26359
 
26351
26360
  // src/commands/voice/logs.ts
26352
- import { existsSync as existsSync54, readFileSync as readFileSync43 } from "fs";
26361
+ import { existsSync as existsSync53, readFileSync as readFileSync43 } from "fs";
26353
26362
  function logs(options2) {
26354
- if (!existsSync54(voicePaths.log)) {
26363
+ if (!existsSync53(voicePaths.log)) {
26355
26364
  console.log("No voice log file found");
26356
26365
  return;
26357
26366
  }
@@ -26379,12 +26388,12 @@ function logs(options2) {
26379
26388
  // src/commands/voice/setup.ts
26380
26389
  import { spawnSync as spawnSync7 } from "child_process";
26381
26390
  import { mkdirSync as mkdirSync22 } from "fs";
26382
- import { join as join64 } from "path";
26391
+ import { join as join63 } from "path";
26383
26392
 
26384
26393
  // src/commands/voice/checkLockFile.ts
26385
26394
  import { execSync as execSync58 } from "child_process";
26386
- import { existsSync as existsSync55, mkdirSync as mkdirSync21, readFileSync as readFileSync44, writeFileSync as writeFileSync39 } from "fs";
26387
- import { join as join63 } from "path";
26395
+ import { existsSync as existsSync54, mkdirSync as mkdirSync21, readFileSync as readFileSync44, writeFileSync as writeFileSync39 } from "fs";
26396
+ import { join as join62 } from "path";
26388
26397
  function isProcessAlive2(pid) {
26389
26398
  try {
26390
26399
  process.kill(pid, 0);
@@ -26395,7 +26404,7 @@ function isProcessAlive2(pid) {
26395
26404
  }
26396
26405
  function checkLockFile() {
26397
26406
  const lockFile = getLockFile();
26398
- if (!existsSync55(lockFile)) return;
26407
+ if (!existsSync54(lockFile)) return;
26399
26408
  try {
26400
26409
  const lock2 = JSON.parse(readFileSync44(lockFile, "utf8"));
26401
26410
  if (lock2.pid && isProcessAlive2(lock2.pid)) {
@@ -26408,7 +26417,7 @@ function checkLockFile() {
26408
26417
  }
26409
26418
  }
26410
26419
  function bootstrapVenv() {
26411
- if (existsSync55(getVenvPython())) return;
26420
+ if (existsSync54(getVenvPython())) return;
26412
26421
  console.log("Setting up Python environment...");
26413
26422
  const pythonDir = getPythonDir();
26414
26423
  execSync58(
@@ -26421,7 +26430,7 @@ function bootstrapVenv() {
26421
26430
  }
26422
26431
  function writeLockFile(pid) {
26423
26432
  const lockFile = getLockFile();
26424
- mkdirSync21(join63(lockFile, ".."), { recursive: true });
26433
+ mkdirSync21(join62(lockFile, ".."), { recursive: true });
26425
26434
  writeFileSync39(
26426
26435
  lockFile,
26427
26436
  JSON.stringify({
@@ -26437,7 +26446,7 @@ function setup() {
26437
26446
  mkdirSync22(voicePaths.dir, { recursive: true });
26438
26447
  bootstrapVenv();
26439
26448
  console.log("\nDownloading models...\n");
26440
- const script = join64(getPythonDir(), "setup_models.py");
26449
+ const script = join63(getPythonDir(), "setup_models.py");
26441
26450
  const result = spawnSync7(getVenvPython(), [script], {
26442
26451
  stdio: "inherit",
26443
26452
  env: { ...process.env, VOICE_LOG_FILE: voicePaths.log }
@@ -26451,7 +26460,7 @@ function setup() {
26451
26460
  // src/commands/voice/start.ts
26452
26461
  import { spawn as spawn8 } from "child_process";
26453
26462
  import { mkdirSync as mkdirSync23, writeFileSync as writeFileSync40 } from "fs";
26454
- import { join as join65 } from "path";
26463
+ import { join as join64 } from "path";
26455
26464
 
26456
26465
  // src/commands/voice/buildDaemonEnv.ts
26457
26466
  function buildDaemonEnv(options2) {
@@ -26489,7 +26498,7 @@ function start2(options2) {
26489
26498
  bootstrapVenv();
26490
26499
  const debug = options2.debug || options2.foreground || process.platform === "win32";
26491
26500
  const env = buildDaemonEnv({ debug });
26492
- const script = join65(getPythonDir(), "voice_daemon.py");
26501
+ const script = join64(getPythonDir(), "voice_daemon.py");
26493
26502
  const python = getVenvPython();
26494
26503
  if (options2.foreground) {
26495
26504
  spawnForeground(python, script, env);
@@ -26499,7 +26508,7 @@ function start2(options2) {
26499
26508
  }
26500
26509
 
26501
26510
  // src/commands/voice/status.ts
26502
- import { existsSync as existsSync56, readFileSync as readFileSync45 } from "fs";
26511
+ import { existsSync as existsSync55, readFileSync as readFileSync45 } from "fs";
26503
26512
  function isProcessAlive3(pid) {
26504
26513
  try {
26505
26514
  process.kill(pid, 0);
@@ -26509,12 +26518,12 @@ function isProcessAlive3(pid) {
26509
26518
  }
26510
26519
  }
26511
26520
  function readRecentLogs(count8) {
26512
- if (!existsSync56(voicePaths.log)) return [];
26521
+ if (!existsSync55(voicePaths.log)) return [];
26513
26522
  const lines = readFileSync45(voicePaths.log, "utf8").trim().split("\n");
26514
26523
  return lines.slice(-count8);
26515
26524
  }
26516
26525
  function status2() {
26517
- if (!existsSync56(voicePaths.pid)) {
26526
+ if (!existsSync55(voicePaths.pid)) {
26518
26527
  console.log("Voice daemon: not running (no PID file)");
26519
26528
  return;
26520
26529
  }
@@ -26537,9 +26546,9 @@ function status2() {
26537
26546
  }
26538
26547
 
26539
26548
  // src/commands/voice/stop.ts
26540
- import { existsSync as existsSync57, readFileSync as readFileSync46, unlinkSync as unlinkSync19 } from "fs";
26549
+ import { existsSync as existsSync56, readFileSync as readFileSync46, unlinkSync as unlinkSync19 } from "fs";
26541
26550
  function stop2() {
26542
- if (!existsSync57(voicePaths.pid)) {
26551
+ if (!existsSync56(voicePaths.pid)) {
26543
26552
  console.log("Voice daemon is not running (no PID file)");
26544
26553
  return;
26545
26554
  }
@@ -26556,7 +26565,7 @@ function stop2() {
26556
26565
  }
26557
26566
  try {
26558
26567
  const lockFile = getLockFile();
26559
- if (existsSync57(lockFile)) unlinkSync19(lockFile);
26568
+ if (existsSync56(lockFile)) unlinkSync19(lockFile);
26560
26569
  } catch {
26561
26570
  }
26562
26571
  console.log("Voice daemon stopped");
@@ -27017,7 +27026,7 @@ async function auth() {
27017
27026
  // src/commands/roam/postRoamActivity.ts
27018
27027
  import { execFileSync as execFileSync12 } from "child_process";
27019
27028
  import { readdirSync as readdirSync11, readFileSync as readFileSync47, statSync as statSync9 } from "fs";
27020
- import { join as join66 } from "path";
27029
+ import { join as join65 } from "path";
27021
27030
  function findPortFile(roamDir) {
27022
27031
  let entries;
27023
27032
  try {
@@ -27026,7 +27035,7 @@ function findPortFile(roamDir) {
27026
27035
  return void 0;
27027
27036
  }
27028
27037
  const candidates = entries.filter((name) => /^roam-local-api(-[^.]+)?\.port$/.test(name)).map((name) => {
27029
- const path71 = join66(roamDir, name);
27038
+ const path71 = join65(roamDir, name);
27030
27039
  try {
27031
27040
  return { path: path71, mtimeMs: statSync9(path71).mtimeMs };
27032
27041
  } catch {
@@ -27038,7 +27047,7 @@ function findPortFile(roamDir) {
27038
27047
  function postRoamActivity(app, event) {
27039
27048
  const appData = process.env.APPDATA;
27040
27049
  if (!appData) return;
27041
- const portFile = findPortFile(join66(appData, "Roam"));
27050
+ const portFile = findPortFile(join65(appData, "Roam"));
27042
27051
  if (!portFile) return;
27043
27052
  let port;
27044
27053
  try {
@@ -27270,15 +27279,15 @@ function runPreCommands(pre, cwd) {
27270
27279
 
27271
27280
  // src/commands/run/spawnRunCommand.ts
27272
27281
  import { execFileSync as execFileSync13, spawn as spawn9 } from "child_process";
27273
- import { existsSync as existsSync58 } from "fs";
27274
- import { dirname as dirname29, join as join67, resolve as resolve15 } from "path";
27282
+ import { existsSync as existsSync57 } from "fs";
27283
+ import { dirname as dirname30, join as join66, resolve as resolve15 } from "path";
27275
27284
  function resolveCommand2(command) {
27276
27285
  if (process.platform !== "win32" || command !== "bash") return command;
27277
27286
  try {
27278
27287
  const gitPath = execFileSync13("where", ["git"], { encoding: "utf8" }).trim().split("\r\n")[0];
27279
- const gitRoot = resolve15(dirname29(gitPath), "..");
27280
- const gitBash = join67(gitRoot, "bin", "bash.exe");
27281
- if (existsSync58(gitBash)) return gitBash;
27288
+ const gitRoot = resolve15(dirname30(gitPath), "..");
27289
+ const gitBash = join66(gitRoot, "bin", "bash.exe");
27290
+ if (existsSync57(gitBash)) return gitBash;
27282
27291
  } catch {
27283
27292
  }
27284
27293
  return command;
@@ -27366,7 +27375,7 @@ async function run3(name, args) {
27366
27375
 
27367
27376
  // src/commands/run/add.ts
27368
27377
  import { mkdirSync as mkdirSync24, writeFileSync as writeFileSync41 } from "fs";
27369
- import { join as join68 } from "path";
27378
+ import { join as join67 } from "path";
27370
27379
 
27371
27380
  // src/commands/run/extractOption.ts
27372
27381
  function extractOption(args, flag) {
@@ -27427,7 +27436,7 @@ function saveNewRunConfig(name, command, args, cwd) {
27427
27436
  saveConfig(config);
27428
27437
  }
27429
27438
  function createCommandFile(name) {
27430
- const dir = join68(".claude", "commands");
27439
+ const dir = join67(".claude", "commands");
27431
27440
  mkdirSync24(dir, { recursive: true });
27432
27441
  const content = `---
27433
27442
  description: Run ${name}
@@ -27435,7 +27444,7 @@ description: Run ${name}
27435
27444
 
27436
27445
  Run \`assist run ${name} $ARGUMENTS 2>&1\`.
27437
27446
  `;
27438
- const filePath = join68(dir, `${name}.md`);
27447
+ const filePath = join67(dir, `${name}.md`);
27439
27448
  writeFileSync41(filePath, content);
27440
27449
  console.log(`Created command file: ${filePath}`);
27441
27450
  }
@@ -27491,8 +27500,8 @@ function link2() {
27491
27500
  }
27492
27501
 
27493
27502
  // src/commands/run/remove.ts
27494
- import { existsSync as existsSync59, unlinkSync as unlinkSync20 } from "fs";
27495
- import { join as join69 } from "path";
27503
+ import { existsSync as existsSync58, unlinkSync as unlinkSync20 } from "fs";
27504
+ import { join as join68 } from "path";
27496
27505
  function findRemoveIndex() {
27497
27506
  const idx = process.argv.indexOf("remove");
27498
27507
  if (idx === -1 || idx + 1 >= process.argv.length) return -1;
@@ -27507,8 +27516,8 @@ function parseRemoveName() {
27507
27516
  return process.argv[idx + 1];
27508
27517
  }
27509
27518
  function deleteCommandFile(name) {
27510
- const filePath = join69(".claude", "commands", `${name}.md`);
27511
- if (existsSync59(filePath)) {
27519
+ const filePath = join68(".claude", "commands", `${name}.md`);
27520
+ if (existsSync58(filePath)) {
27512
27521
  unlinkSync20(filePath);
27513
27522
  console.log(`Deleted command file: ${filePath}`);
27514
27523
  }
@@ -27562,9 +27571,9 @@ function registerRun(program2) {
27562
27571
 
27563
27572
  // src/commands/screenshot/index.ts
27564
27573
  import { execSync as execSync60 } from "child_process";
27565
- import { existsSync as existsSync60, mkdirSync as mkdirSync25, unlinkSync as unlinkSync21, writeFileSync as writeFileSync42 } from "fs";
27574
+ import { existsSync as existsSync59, mkdirSync as mkdirSync25, unlinkSync as unlinkSync21, writeFileSync as writeFileSync42 } from "fs";
27566
27575
  import { tmpdir as tmpdir8 } from "os";
27567
- import { join as join70, resolve as resolve17 } from "path";
27576
+ import { join as join69, resolve as resolve17 } from "path";
27568
27577
  import chalk209 from "chalk";
27569
27578
 
27570
27579
  // src/commands/screenshot/captureWindowPs1.ts
@@ -27694,14 +27703,14 @@ Write-Output $OutputPath
27694
27703
 
27695
27704
  // src/commands/screenshot/index.ts
27696
27705
  function buildOutputPath(outputDir, processName) {
27697
- if (!existsSync60(outputDir)) {
27706
+ if (!existsSync59(outputDir)) {
27698
27707
  mkdirSync25(outputDir, { recursive: true });
27699
27708
  }
27700
27709
  const timestamp6 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
27701
27710
  return resolve17(outputDir, `${processName}-${timestamp6}.png`);
27702
27711
  }
27703
27712
  function runPowerShellScript(processName, outputPath) {
27704
- const scriptPath = join70(tmpdir8(), `assist-screenshot-${Date.now()}.ps1`);
27713
+ const scriptPath = join69(tmpdir8(), `assist-screenshot-${Date.now()}.ps1`);
27705
27714
  writeFileSync42(scriptPath, captureWindowPs1, "utf8");
27706
27715
  try {
27707
27716
  execSync60(
@@ -28186,7 +28195,7 @@ function readDesignSystemPrompt() {
28186
28195
  import * as pty from "node-pty";
28187
28196
 
28188
28197
  // src/commands/sessions/daemon/ensureSpawnHelperExecutable.ts
28189
- import { chmodSync, existsSync as existsSync61, statSync as statSync10 } from "fs";
28198
+ import { chmodSync, existsSync as existsSync60, statSync as statSync10 } from "fs";
28190
28199
  import { createRequire as createRequire3 } from "module";
28191
28200
  import path59 from "path";
28192
28201
  var require4 = createRequire3(import.meta.url);
@@ -28201,7 +28210,7 @@ function ensureSpawnHelperExecutable() {
28201
28210
  `${process.platform}-${process.arch}`,
28202
28211
  "spawn-helper"
28203
28212
  );
28204
- if (!existsSync61(helper)) return;
28213
+ if (!existsSync60(helper)) return;
28205
28214
  const mode = statSync10(helper).mode;
28206
28215
  if ((mode & 73) === 0) chmodSync(helper, mode | 493);
28207
28216
  }
@@ -28361,17 +28370,17 @@ function otherTreeHolders(sessions, session) {
28361
28370
  }
28362
28371
 
28363
28372
  // src/commands/sessions/daemon/worktree/reapWorktree.ts
28364
- import { existsSync as existsSync63 } from "fs";
28373
+ import { existsSync as existsSync62 } from "fs";
28365
28374
  import { basename as basename16 } from "path";
28366
28375
 
28367
28376
  // src/commands/sessions/daemon/worktree/deleteStrandedTree.ts
28368
- import { existsSync as existsSync62 } from "fs";
28369
- import { join as join73 } from "path";
28377
+ import { existsSync as existsSync61 } from "fs";
28378
+ import { join as join72 } from "path";
28370
28379
 
28371
28380
  // src/commands/sessions/daemon/worktree/deleteTreeDirectly.ts
28372
28381
  import { statSync as statSync11 } from "fs";
28373
28382
  import { rm as rm2 } from "fs/promises";
28374
- import { join as join72 } from "path";
28383
+ import { join as join71 } from "path";
28375
28384
  async function deleteTreeDirectly(clone, worktreePath, why) {
28376
28385
  if (holdsAGitDirectoryRatherThanALink(worktreePath)) {
28377
28386
  daemonLog(
@@ -28398,7 +28407,7 @@ async function deleteTreeDirectly(clone, worktreePath, why) {
28398
28407
  return true;
28399
28408
  }
28400
28409
  function holdsAGitDirectoryRatherThanALink(worktreePath) {
28401
- return statSync11(join72(worktreePath, ".git"), {
28410
+ return statSync11(join71(worktreePath, ".git"), {
28402
28411
  throwIfNoEntry: false
28403
28412
  })?.isDirectory() === true;
28404
28413
  }
@@ -28434,7 +28443,7 @@ async function deleteStrandedTree(clone, worktreePath, cause) {
28434
28443
  );
28435
28444
  }
28436
28445
  function strandedReason(worktreePath, cause) {
28437
- if (!existsSync62(join73(worktreePath, ".git")))
28446
+ if (!existsSync61(join72(worktreePath, ".git")))
28438
28447
  return "its .git link is already gone";
28439
28448
  if (/not a working tree|not a git repository/i.test(reason2(cause)))
28440
28449
  return "git no longer recognises it as a working tree";
@@ -28486,7 +28495,7 @@ function reason3(error) {
28486
28495
 
28487
28496
  // src/commands/sessions/daemon/worktree/reapWorktree.ts
28488
28497
  async function reapWorktree(worktreePath, force = false) {
28489
- if (!existsSync63(worktreePath)) {
28498
+ if (!existsSync62(worktreePath)) {
28490
28499
  daemonLog(`worktree ${worktreePath} already gone; skipping reap`);
28491
28500
  return false;
28492
28501
  }
@@ -28507,7 +28516,7 @@ async function reapWorktree(worktreePath, force = false) {
28507
28516
  }
28508
28517
  function owningClone(worktreePath) {
28509
28518
  const recorded = worktreeAttributionIncludingReaped(worktreePath)?.clone;
28510
- if (recorded && existsSync63(recorded)) return recorded;
28519
+ if (recorded && existsSync62(recorded)) return recorded;
28511
28520
  const detected = mainWorktree(worktreePath);
28512
28521
  if (detected) return detected;
28513
28522
  daemonLog(
@@ -28594,12 +28603,12 @@ function setStatus2(session, newStatus) {
28594
28603
  }
28595
28604
 
28596
28605
  // src/commands/sessions/daemon/worktree/watchGitState.ts
28597
- import { existsSync as existsSync64, watch } from "fs";
28606
+ import { existsSync as existsSync63, watch } from "fs";
28598
28607
  var DEBOUNCE_MS = 500;
28599
28608
  var POLL_MS = 3e4;
28600
28609
  function watchGitState(cwd, onChange) {
28601
28610
  const common = gitCommonDir(cwd);
28602
- if (!common || !existsSync64(common)) return void 0;
28611
+ if (!common || !existsSync63(common)) return void 0;
28603
28612
  const watchers = [
28604
28613
  watchGitDir(common, onChange),
28605
28614
  pollGitState(cwd, onChange)
@@ -29003,10 +29012,10 @@ function emitSessionOutput(session, clients, data) {
29003
29012
  }
29004
29013
 
29005
29014
  // src/commands/sessions/daemon/exitReason.ts
29006
- import { existsSync as existsSync65 } from "fs";
29015
+ import { existsSync as existsSync64 } from "fs";
29007
29016
  function exitReason(session, exitCode) {
29008
29017
  const base = `process exited with code ${exitCode}`;
29009
- if (session.cwd && !existsSync65(session.cwd))
29018
+ if (session.cwd && !existsSync64(session.cwd))
29010
29019
  return `${base}: working directory ${session.cwd} no longer exists`;
29011
29020
  return base;
29012
29021
  }
@@ -29024,8 +29033,8 @@ function handleFailedResume(session, exitCode, onStatusChange) {
29024
29033
  }
29025
29034
 
29026
29035
  // src/commands/sessions/daemon/watchActivity.ts
29027
- import { existsSync as existsSync66, mkdirSync as mkdirSync26, watch as watch2 } from "fs";
29028
- import { dirname as dirname31 } from "path";
29036
+ import { existsSync as existsSync65, mkdirSync as mkdirSync26, watch as watch2 } from "fs";
29037
+ import { dirname as dirname32 } from "path";
29029
29038
 
29030
29039
  // src/commands/sessions/daemon/applyReviewPause.ts
29031
29040
  function applyReviewPause(session, activity2) {
@@ -29079,7 +29088,7 @@ var DEBOUNCE_MS2 = 50;
29079
29088
  function watchActivity(session, notify2, onClaudeSessionId) {
29080
29089
  if (session.commandType !== "assist" || !session.cwd) return;
29081
29090
  const path71 = activityPath(session.id);
29082
- const dir = dirname31(path71);
29091
+ const dir = dirname32(path71);
29083
29092
  try {
29084
29093
  mkdirSync26(dir, { recursive: true });
29085
29094
  } catch {
@@ -29105,7 +29114,7 @@ function watchActivity(session, notify2, onClaudeSessionId) {
29105
29114
  if (timer) clearTimeout(timer);
29106
29115
  timer = setTimeout(read, DEBOUNCE_MS2);
29107
29116
  });
29108
- if (existsSync66(path71)) read();
29117
+ if (existsSync65(path71)) read();
29109
29118
  }
29110
29119
  function refreshActivity(session) {
29111
29120
  if (session.commandType !== "assist" || !session.cwd) return;
@@ -30194,7 +30203,7 @@ function rearmStoppedSessions(sessions, notify2) {
30194
30203
  }
30195
30204
 
30196
30205
  // src/commands/sessions/daemon/worktree/reconcileWorktreesOnRestore.ts
30197
- import { existsSync as existsSync69 } from "fs";
30206
+ import { existsSync as existsSync68 } from "fs";
30198
30207
  import { basename as basename18 } from "path";
30199
30208
 
30200
30209
  // src/commands/sessions/daemon/worktree/accountedTrees.ts
@@ -30284,9 +30293,9 @@ function capped(lines) {
30284
30293
  }
30285
30294
 
30286
30295
  // src/commands/sessions/daemon/worktree/reclaimVanishedWorktrees.ts
30287
- import { existsSync as existsSync68 } from "fs";
30296
+ import { existsSync as existsSync67 } from "fs";
30288
30297
  async function reclaimVanishedWorktrees(clone, paths) {
30289
- if (!existsSync68(clone)) {
30298
+ if (!existsSync67(clone)) {
30290
30299
  for (const { path: path71 } of paths) forgetWorktree(path71);
30291
30300
  daemonLog(
30292
30301
  `clone ${clone} is gone; forgot ${paths.length} worktree record(s) it owned`
@@ -30379,7 +30388,7 @@ async function recoverOrphanedWorktrees(sessions, spawnWith, notify2) {
30379
30388
  const vanished = /* @__PURE__ */ new Map();
30380
30389
  for (const { path: path71, clone } of readWorktreeRegistry()) {
30381
30390
  if (accounted.has(path71)) continue;
30382
- if (!existsSync69(path71)) {
30391
+ if (!existsSync68(path71)) {
30383
30392
  vanished.set(clone, [
30384
30393
  ...vanished.get(clone) ?? [],
30385
30394
  { path: path71, branch: basename18(path71) }
@@ -30747,13 +30756,13 @@ async function defaultConnect() {
30747
30756
  }
30748
30757
 
30749
30758
  // src/commands/sessions/daemon/hasPersistedWindowsSessions.ts
30750
- import { existsSync as existsSync70, readFileSync as readFileSync50 } from "fs";
30759
+ import { existsSync as existsSync69, readFileSync as readFileSync50 } from "fs";
30751
30760
  import { posix } from "path";
30752
30761
  function hasPersistedWindowsSessions() {
30753
30762
  const sessionsFile = windowsSessionsFileFromWsl();
30754
30763
  if (!sessionsFile) return false;
30755
30764
  try {
30756
- if (!existsSync70(sessionsFile)) return false;
30765
+ if (!existsSync69(sessionsFile)) return false;
30757
30766
  const data = JSON.parse(readFileSync50(sessionsFile, "utf8"));
30758
30767
  return Array.isArray(data) && data.length > 0;
30759
30768
  } catch (error) {
@@ -31778,9 +31787,9 @@ function safeParse2(line) {
31778
31787
  }
31779
31788
 
31780
31789
  // src/commands/sessions/daemon/repoDirExists.ts
31781
- import { existsSync as existsSync71 } from "fs";
31790
+ import { existsSync as existsSync70 } from "fs";
31782
31791
  function repoDirExists(cwd) {
31783
- return existsSync71(toGitCwd(cwd));
31792
+ return existsSync70(toGitCwd(cwd));
31784
31793
  }
31785
31794
 
31786
31795
  // src/commands/sessions/daemon/withRepoGroups.ts
@@ -32401,9 +32410,9 @@ function buildLimitsSegment(rateLimits) {
32401
32410
 
32402
32411
  // src/commands/readGitBranch.ts
32403
32412
  import { readFileSync as readFileSync53, statSync as statSync13 } from "fs";
32404
- import { isAbsolute as isAbsolute3, join as join75, resolve as resolve18 } from "path";
32413
+ import { isAbsolute as isAbsolute3, join as join74, resolve as resolve18 } from "path";
32405
32414
  function resolveGitDir(cwd) {
32406
- const dotGit = join75(cwd, ".git");
32415
+ const dotGit = join74(cwd, ".git");
32407
32416
  let stat3;
32408
32417
  try {
32409
32418
  stat3 = statSync13(dotGit);
@@ -32433,7 +32442,7 @@ function readGitBranch(cwd) {
32433
32442
  }
32434
32443
  let head;
32435
32444
  try {
32436
- head = readFileSync53(join75(gitDir, "HEAD"), "utf8");
32445
+ head = readFileSync53(join74(gitDir, "HEAD"), "utf8");
32437
32446
  } catch {
32438
32447
  return null;
32439
32448
  }