@staff0rd/assist 0.244.0 → 0.244.2

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.244.0",
9
+ version: "0.244.2",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -12826,6 +12826,35 @@ function buildReviewPaths(repoRoot, key) {
12826
12826
  };
12827
12827
  }
12828
12828
 
12829
+ // src/commands/review/ensureReviewsIgnored.ts
12830
+ import {
12831
+ appendFileSync,
12832
+ existsSync as existsSync35,
12833
+ readFileSync as readFileSync29,
12834
+ writeFileSync as writeFileSync24
12835
+ } from "fs";
12836
+ import { join as join36 } from "path";
12837
+ var REVIEWS_ENTRY = ".assist/reviews";
12838
+ function coversReviews(line) {
12839
+ const pattern2 = line.trim().replace(/^\//, "").replace(/\/$/, "");
12840
+ return pattern2 === ".assist" || pattern2 === REVIEWS_ENTRY;
12841
+ }
12842
+ function ensureReviewsIgnored(repoRoot) {
12843
+ const gitignorePath = join36(repoRoot, ".gitignore");
12844
+ if (!existsSync35(gitignorePath)) {
12845
+ writeFileSync24(gitignorePath, `${REVIEWS_ENTRY}
12846
+ `);
12847
+ console.log(`Created .gitignore with ${REVIEWS_ENTRY} entry.`);
12848
+ return;
12849
+ }
12850
+ const content = readFileSync29(gitignorePath, "utf-8");
12851
+ if (content.split("\n").some(coversReviews)) return;
12852
+ const separator = content === "" || content.endsWith("\n") ? "" : "\n";
12853
+ appendFileSync(gitignorePath, `${separator}${REVIEWS_ENTRY}
12854
+ `);
12855
+ console.log(`Added ${REVIEWS_ENTRY} to .gitignore.`);
12856
+ }
12857
+
12829
12858
  // src/commands/review/fetchExistingComments.ts
12830
12859
  import { execSync as execSync40 } from "child_process";
12831
12860
  function fetchRawComments(org, repo, prNumber) {
@@ -12965,7 +12994,7 @@ function gatherContext() {
12965
12994
  }
12966
12995
 
12967
12996
  // src/commands/review/postReviewToPr.ts
12968
- import { readFileSync as readFileSync29 } from "fs";
12997
+ import { readFileSync as readFileSync30 } from "fs";
12969
12998
 
12970
12999
  // src/commands/review/parseFindings.ts
12971
13000
  var SEVERITIES = ["blocker", "major", "minor", "nit"];
@@ -13195,7 +13224,7 @@ async function postReviewToPr(synthesisPath, options2) {
13195
13224
  console.log("No PR found for current branch; nothing posted.");
13196
13225
  return;
13197
13226
  }
13198
- const markdown = readFileSync29(synthesisPath, "utf-8");
13227
+ const markdown = readFileSync30(synthesisPath, "utf-8");
13199
13228
  const findings = parseFindings(markdown);
13200
13229
  if (findings.length === 0) {
13201
13230
  console.log("Synthesis contains no findings; nothing to post.");
@@ -13272,16 +13301,16 @@ async function handlePostSynthesis(synthesisPath, options2) {
13272
13301
  }
13273
13302
 
13274
13303
  // src/commands/review/prepareReviewDir.ts
13275
- import { existsSync as existsSync35, mkdirSync as mkdirSync11, unlinkSync as unlinkSync10, writeFileSync as writeFileSync24 } from "fs";
13304
+ import { existsSync as existsSync36, mkdirSync as mkdirSync11, unlinkSync as unlinkSync10, writeFileSync as writeFileSync25 } from "fs";
13276
13305
  function clearReviewFiles(paths) {
13277
13306
  for (const path54 of [paths.claudePath, paths.codexPath, paths.synthesisPath]) {
13278
- if (existsSync35(path54)) unlinkSync10(path54);
13307
+ if (existsSync36(path54)) unlinkSync10(path54);
13279
13308
  }
13280
13309
  }
13281
13310
  function prepareReviewDir(paths, requestBody, force) {
13282
13311
  mkdirSync11(paths.reviewDir, { recursive: true });
13283
13312
  if (force) clearReviewFiles(paths);
13284
- writeFileSync24(paths.requestPath, requestBody);
13313
+ writeFileSync25(paths.requestPath, requestBody);
13285
13314
  }
13286
13315
 
13287
13316
  // src/commands/review/runApplySession.ts
@@ -13560,7 +13589,7 @@ function printReviewerFailures(results) {
13560
13589
  }
13561
13590
 
13562
13591
  // src/commands/review/runAndSynthesise.ts
13563
- import { existsSync as existsSync37, unlinkSync as unlinkSync12 } from "fs";
13592
+ import { existsSync as existsSync38, unlinkSync as unlinkSync12 } from "fs";
13564
13593
 
13565
13594
  // src/commands/review/buildReviewerStdin.ts
13566
13595
  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 request.md in the current working directory.
@@ -13624,7 +13653,7 @@ The review request is at: ${requestPath}
13624
13653
  }
13625
13654
 
13626
13655
  // src/commands/review/runClaudeReviewer.ts
13627
- import { writeFileSync as writeFileSync25 } from "fs";
13656
+ import { writeFileSync as writeFileSync26 } from "fs";
13628
13657
 
13629
13658
  // src/commands/review/finaliseReviewerSpinner.ts
13630
13659
  var SUMMARY_MAX_LEN = 80;
@@ -13960,7 +13989,7 @@ async function runClaudeReviewer(spec) {
13960
13989
  }
13961
13990
  });
13962
13991
  if (result.exitCode === 0 && finalText)
13963
- writeFileSync25(spec.outputPath, finalText);
13992
+ writeFileSync26(spec.outputPath, finalText);
13964
13993
  return finaliseReviewerRun({ ...spec, command }, spinner, result);
13965
13994
  }
13966
13995
 
@@ -13978,7 +14007,7 @@ function resolveClaude(args) {
13978
14007
  }
13979
14008
 
13980
14009
  // src/commands/review/runCodexReviewer.ts
13981
- import { existsSync as existsSync36, unlinkSync as unlinkSync11 } from "fs";
14010
+ import { existsSync as existsSync37, unlinkSync as unlinkSync11 } from "fs";
13982
14011
 
13983
14012
  // src/commands/review/parseCodexEvent.ts
13984
14013
  function isItemStarted(value) {
@@ -14032,7 +14061,7 @@ async function runCodexReviewer(spec) {
14032
14061
  reportReviewerToolUse(spec.name, event, spinner);
14033
14062
  }
14034
14063
  });
14035
- if (result.exitCode !== 0 && existsSync36(spec.outputPath)) {
14064
+ if (result.exitCode !== 0 && existsSync37(spec.outputPath)) {
14036
14065
  unlinkSync11(spec.outputPath);
14037
14066
  }
14038
14067
  return finaliseReviewerRun({ ...spec, command }, spinner, result);
@@ -14076,7 +14105,7 @@ async function runReviewers(reviewDir, claudePath, codexPath, stdinPrompt, optio
14076
14105
  }
14077
14106
 
14078
14107
  // src/commands/review/synthesise.ts
14079
- import { readFileSync as readFileSync30 } from "fs";
14108
+ import { readFileSync as readFileSync31 } from "fs";
14080
14109
 
14081
14110
  // src/commands/review/buildSynthesisStdin.ts
14082
14111
  var SYNTHESIS_PROMPT = `You are consolidating two independent code reviews of the same change. The original review request is in request.md. The two reviews are in claude.md and codex.md in the current working directory.
@@ -14132,7 +14161,7 @@ Files:
14132
14161
 
14133
14162
  // src/commands/review/synthesise.ts
14134
14163
  function printSummary2(synthesisPath) {
14135
- const markdown = readFileSync30(synthesisPath, "utf-8");
14164
+ const markdown = readFileSync31(synthesisPath, "utf-8");
14136
14165
  console.log("");
14137
14166
  console.log(buildReviewSummary(markdown));
14138
14167
  console.log("");
@@ -14180,7 +14209,7 @@ async function runAndSynthesise(args) {
14180
14209
  console.error("Both reviewers failed; skipping synthesis.");
14181
14210
  return { ok: false, failures };
14182
14211
  }
14183
- if (anyFresh && existsSync37(paths.synthesisPath)) {
14212
+ if (anyFresh && existsSync38(paths.synthesisPath)) {
14184
14213
  unlinkSync12(paths.synthesisPath);
14185
14214
  }
14186
14215
  const synthesisResult = await synthesise(paths, { multi });
@@ -14274,6 +14303,7 @@ async function runPostSynthesis(synthesisPath, options2) {
14274
14303
  }
14275
14304
  async function reviewPr(repoRoot, options2) {
14276
14305
  const context = gatherChangedContext();
14306
+ ensureReviewsIgnored(repoRoot);
14277
14307
  const paths = setupReviewDir(repoRoot, context, options2.force ?? false);
14278
14308
  const synthesisOk = await runReviewPipeline(paths, {
14279
14309
  verbose: options2.verbose ?? false
@@ -14951,8 +14981,8 @@ function registerSql(program2) {
14951
14981
  }
14952
14982
 
14953
14983
  // src/commands/transcript/shared.ts
14954
- import { existsSync as existsSync38, readdirSync as readdirSync6, statSync as statSync3 } from "fs";
14955
- import { basename as basename6, join as join36, relative as relative2 } from "path";
14984
+ import { existsSync as existsSync39, readdirSync as readdirSync6, statSync as statSync3 } from "fs";
14985
+ import { basename as basename6, join as join37, relative as relative2 } from "path";
14956
14986
  import * as readline2 from "readline";
14957
14987
  var DATE_PREFIX_REGEX = /^\d{4}-\d{2}-\d{2}/;
14958
14988
  function getDatePrefix(daysOffset = 0) {
@@ -14967,10 +14997,10 @@ function isValidDatePrefix(filename) {
14967
14997
  return DATE_PREFIX_REGEX.test(filename);
14968
14998
  }
14969
14999
  function collectFiles(dir, extension) {
14970
- if (!existsSync38(dir)) return [];
15000
+ if (!existsSync39(dir)) return [];
14971
15001
  const results = [];
14972
15002
  for (const entry of readdirSync6(dir)) {
14973
- const fullPath = join36(dir, entry);
15003
+ const fullPath = join37(dir, entry);
14974
15004
  if (statSync3(fullPath).isDirectory()) {
14975
15005
  results.push(...collectFiles(fullPath, extension));
14976
15006
  } else if (entry.endsWith(extension)) {
@@ -15064,14 +15094,14 @@ async function configure() {
15064
15094
  }
15065
15095
 
15066
15096
  // src/commands/transcript/format/index.ts
15067
- import { existsSync as existsSync40 } from "fs";
15097
+ import { existsSync as existsSync41 } from "fs";
15068
15098
 
15069
15099
  // src/commands/transcript/format/fixInvalidDatePrefixes/index.ts
15070
- import { dirname as dirname19, join as join38 } from "path";
15100
+ import { dirname as dirname19, join as join39 } from "path";
15071
15101
 
15072
15102
  // src/commands/transcript/format/fixInvalidDatePrefixes/promptForDateFix.ts
15073
15103
  import { renameSync as renameSync3 } from "fs";
15074
- import { join as join37 } from "path";
15104
+ import { join as join38 } from "path";
15075
15105
  async function resolveDate(rl, choice) {
15076
15106
  if (choice === "1") return getDatePrefix(0);
15077
15107
  if (choice === "2") return getDatePrefix(-1);
@@ -15086,7 +15116,7 @@ async function resolveDate(rl, choice) {
15086
15116
  }
15087
15117
  function renameWithPrefix(vttDir, vttFile, prefix2) {
15088
15118
  const newFilename = `${prefix2}.${vttFile}`;
15089
- renameSync3(join37(vttDir, vttFile), join37(vttDir, newFilename));
15119
+ renameSync3(join38(vttDir, vttFile), join38(vttDir, newFilename));
15090
15120
  console.log(`Renamed to: ${newFilename}`);
15091
15121
  return newFilename;
15092
15122
  }
@@ -15120,12 +15150,12 @@ async function fixInvalidDatePrefixes(vttFiles) {
15120
15150
  const vttFileDir = dirname19(vttFile.absolutePath);
15121
15151
  const newFilename = await promptForDateFix(vttFile.filename, vttFileDir);
15122
15152
  if (newFilename) {
15123
- const newRelativePath = join38(
15153
+ const newRelativePath = join39(
15124
15154
  dirname19(vttFile.relativePath),
15125
15155
  newFilename
15126
15156
  );
15127
15157
  vttFiles[i] = {
15128
- absolutePath: join38(vttFileDir, newFilename),
15158
+ absolutePath: join39(vttFileDir, newFilename),
15129
15159
  relativePath: newRelativePath,
15130
15160
  filename: newFilename
15131
15161
  };
@@ -15138,8 +15168,8 @@ async function fixInvalidDatePrefixes(vttFiles) {
15138
15168
  }
15139
15169
 
15140
15170
  // src/commands/transcript/format/processVttFile/index.ts
15141
- import { existsSync as existsSync39, mkdirSync as mkdirSync12, readFileSync as readFileSync31, writeFileSync as writeFileSync26 } from "fs";
15142
- import { basename as basename7, dirname as dirname20, join as join39 } from "path";
15171
+ import { existsSync as existsSync40, mkdirSync as mkdirSync12, readFileSync as readFileSync32, writeFileSync as writeFileSync27 } from "fs";
15172
+ import { basename as basename7, dirname as dirname20, join as join40 } from "path";
15143
15173
 
15144
15174
  // src/commands/transcript/cleanText.ts
15145
15175
  function cleanText(text2) {
@@ -15349,21 +15379,21 @@ function toMdFilename(vttFilename) {
15349
15379
  return `${basename7(vttFilename, ".vtt").replace(/\s*Transcription\s*/g, " ").trim()}.md`;
15350
15380
  }
15351
15381
  function resolveOutputDir(relativeDir, transcriptsDir) {
15352
- return relativeDir === "." ? transcriptsDir : join39(transcriptsDir, relativeDir);
15382
+ return relativeDir === "." ? transcriptsDir : join40(transcriptsDir, relativeDir);
15353
15383
  }
15354
15384
  function buildOutputPaths(vttFile, transcriptsDir) {
15355
15385
  const mdFile = toMdFilename(vttFile.filename);
15356
15386
  const relativeDir = dirname20(vttFile.relativePath);
15357
15387
  const outputDir = resolveOutputDir(relativeDir, transcriptsDir);
15358
- const outputPath = join39(outputDir, mdFile);
15388
+ const outputPath = join40(outputDir, mdFile);
15359
15389
  return { outputDir, outputPath, mdFile, relativeDir };
15360
15390
  }
15361
15391
  function logSkipped(relativeDir, mdFile) {
15362
- console.log(`Skipping (already exists): ${join39(relativeDir, mdFile)}`);
15392
+ console.log(`Skipping (already exists): ${join40(relativeDir, mdFile)}`);
15363
15393
  return "skipped";
15364
15394
  }
15365
15395
  function ensureDirectory(dir, label2) {
15366
- if (!existsSync39(dir)) {
15396
+ if (!existsSync40(dir)) {
15367
15397
  mkdirSync12(dir, { recursive: true });
15368
15398
  console.log(`Created ${label2}: ${dir}`);
15369
15399
  }
@@ -15386,10 +15416,10 @@ function logReduction(cueCount, messageCount) {
15386
15416
  }
15387
15417
  function readAndParseCues(inputPath) {
15388
15418
  console.log(`Reading: ${inputPath}`);
15389
- return processCues(readFileSync31(inputPath, "utf-8"));
15419
+ return processCues(readFileSync32(inputPath, "utf-8"));
15390
15420
  }
15391
15421
  function writeFormatted(outputPath, content) {
15392
- writeFileSync26(outputPath, content, "utf-8");
15422
+ writeFileSync27(outputPath, content, "utf-8");
15393
15423
  console.log(`Written: ${outputPath}`);
15394
15424
  }
15395
15425
  function convertVttToMarkdown(inputPath, outputPath) {
@@ -15399,7 +15429,7 @@ function convertVttToMarkdown(inputPath, outputPath) {
15399
15429
  logReduction(cues.length, chatMessages.length);
15400
15430
  }
15401
15431
  function tryProcessVtt(vttFile, paths) {
15402
- if (existsSync39(paths.outputPath))
15432
+ if (existsSync40(paths.outputPath))
15403
15433
  return logSkipped(paths.relativeDir, paths.mdFile);
15404
15434
  convertVttToMarkdown(vttFile.absolutePath, paths.outputPath);
15405
15435
  return "processed";
@@ -15425,7 +15455,7 @@ function processAllFiles(vttFiles, transcriptsDir) {
15425
15455
  logSummary(counts);
15426
15456
  }
15427
15457
  function requireVttDir(vttDir) {
15428
- if (!existsSync40(vttDir)) {
15458
+ if (!existsSync41(vttDir)) {
15429
15459
  console.error(`VTT directory not found: ${vttDir}`);
15430
15460
  process.exit(1);
15431
15461
  }
@@ -15457,18 +15487,18 @@ async function format() {
15457
15487
  }
15458
15488
 
15459
15489
  // src/commands/transcript/summarise/index.ts
15460
- import { existsSync as existsSync42 } from "fs";
15461
- import { basename as basename8, dirname as dirname22, join as join41, relative as relative3 } from "path";
15490
+ import { existsSync as existsSync43 } from "fs";
15491
+ import { basename as basename8, dirname as dirname22, join as join42, relative as relative3 } from "path";
15462
15492
 
15463
15493
  // src/commands/transcript/summarise/processStagedFile/index.ts
15464
15494
  import {
15465
- existsSync as existsSync41,
15495
+ existsSync as existsSync42,
15466
15496
  mkdirSync as mkdirSync13,
15467
- readFileSync as readFileSync32,
15497
+ readFileSync as readFileSync33,
15468
15498
  renameSync as renameSync4,
15469
15499
  rmSync
15470
15500
  } from "fs";
15471
- import { dirname as dirname21, join as join40 } from "path";
15501
+ import { dirname as dirname21, join as join41 } from "path";
15472
15502
 
15473
15503
  // src/commands/transcript/summarise/processStagedFile/validateStagedContent.ts
15474
15504
  import chalk154 from "chalk";
@@ -15497,9 +15527,9 @@ function validateStagedContent(filename, content) {
15497
15527
  }
15498
15528
 
15499
15529
  // src/commands/transcript/summarise/processStagedFile/index.ts
15500
- var STAGING_DIR = join40(process.cwd(), ".assist", "transcript");
15530
+ var STAGING_DIR = join41(process.cwd(), ".assist", "transcript");
15501
15531
  function processStagedFile() {
15502
- if (!existsSync41(STAGING_DIR)) {
15532
+ if (!existsSync42(STAGING_DIR)) {
15503
15533
  return false;
15504
15534
  }
15505
15535
  const stagedFiles = findMdFilesRecursive(STAGING_DIR);
@@ -15508,7 +15538,7 @@ function processStagedFile() {
15508
15538
  }
15509
15539
  const { transcriptsDir, summaryDir } = getTranscriptConfig();
15510
15540
  const stagedFile = stagedFiles[0];
15511
- const content = readFileSync32(stagedFile.absolutePath, "utf-8");
15541
+ const content = readFileSync33(stagedFile.absolutePath, "utf-8");
15512
15542
  validateStagedContent(stagedFile.filename, content);
15513
15543
  const stagedBaseName = getTranscriptBaseName(stagedFile.filename);
15514
15544
  const transcriptFiles = findMdFilesRecursive(transcriptsDir);
@@ -15521,9 +15551,9 @@ function processStagedFile() {
15521
15551
  );
15522
15552
  process.exit(1);
15523
15553
  }
15524
- const destPath = join40(summaryDir, matchingTranscript.relativePath);
15554
+ const destPath = join41(summaryDir, matchingTranscript.relativePath);
15525
15555
  const destDir = dirname21(destPath);
15526
- if (!existsSync41(destDir)) {
15556
+ if (!existsSync42(destDir)) {
15527
15557
  mkdirSync13(destDir, { recursive: true });
15528
15558
  }
15529
15559
  renameSync4(stagedFile.absolutePath, destPath);
@@ -15537,7 +15567,7 @@ function processStagedFile() {
15537
15567
  // src/commands/transcript/summarise/index.ts
15538
15568
  function buildRelativeKey(relativePath, baseName) {
15539
15569
  const relDir = dirname22(relativePath);
15540
- return relDir === "." ? baseName : join41(relDir, baseName);
15570
+ return relDir === "." ? baseName : join42(relDir, baseName);
15541
15571
  }
15542
15572
  function buildSummaryIndex(summaryDir) {
15543
15573
  const summaryFiles = findMdFilesRecursive(summaryDir);
@@ -15550,7 +15580,7 @@ function buildSummaryIndex(summaryDir) {
15550
15580
  function summarise3() {
15551
15581
  processStagedFile();
15552
15582
  const { transcriptsDir, summaryDir } = getTranscriptConfig();
15553
- if (!existsSync42(transcriptsDir)) {
15583
+ if (!existsSync43(transcriptsDir)) {
15554
15584
  console.log("No transcripts directory found.");
15555
15585
  return;
15556
15586
  }
@@ -15571,8 +15601,8 @@ function summarise3() {
15571
15601
  }
15572
15602
  const next3 = missing[0];
15573
15603
  const outputFilename = `${getTranscriptBaseName(next3.filename)}.md`;
15574
- const outputPath = join41(STAGING_DIR, outputFilename);
15575
- const summaryFileDir = join41(summaryDir, dirname22(next3.relativePath));
15604
+ const outputPath = join42(STAGING_DIR, outputFilename);
15605
+ const summaryFileDir = join42(summaryDir, dirname22(next3.relativePath));
15576
15606
  const relativeTranscriptPath = encodeURI(
15577
15607
  relative3(summaryFileDir, next3.absolutePath).replace(/\\/g, "/")
15578
15608
  );
@@ -15621,50 +15651,50 @@ function registerVerify(program2) {
15621
15651
 
15622
15652
  // src/commands/voice/devices.ts
15623
15653
  import { spawnSync as spawnSync4 } from "child_process";
15624
- import { join as join43 } from "path";
15654
+ import { join as join44 } from "path";
15625
15655
 
15626
15656
  // src/commands/voice/shared.ts
15627
15657
  import { homedir as homedir9 } from "os";
15628
- import { dirname as dirname23, join as join42 } from "path";
15658
+ import { dirname as dirname23, join as join43 } from "path";
15629
15659
  import { fileURLToPath as fileURLToPath6 } from "url";
15630
15660
  var __dirname6 = dirname23(fileURLToPath6(import.meta.url));
15631
- var VOICE_DIR = join42(homedir9(), ".assist", "voice");
15661
+ var VOICE_DIR = join43(homedir9(), ".assist", "voice");
15632
15662
  var voicePaths = {
15633
15663
  dir: VOICE_DIR,
15634
- pid: join42(VOICE_DIR, "voice.pid"),
15635
- log: join42(VOICE_DIR, "voice.log"),
15636
- venv: join42(VOICE_DIR, ".venv"),
15637
- lock: join42(VOICE_DIR, "voice.lock")
15664
+ pid: join43(VOICE_DIR, "voice.pid"),
15665
+ log: join43(VOICE_DIR, "voice.log"),
15666
+ venv: join43(VOICE_DIR, ".venv"),
15667
+ lock: join43(VOICE_DIR, "voice.lock")
15638
15668
  };
15639
15669
  function getPythonDir() {
15640
- return join42(__dirname6, "commands", "voice", "python");
15670
+ return join43(__dirname6, "commands", "voice", "python");
15641
15671
  }
15642
15672
  function getVenvPython() {
15643
- return process.platform === "win32" ? join42(voicePaths.venv, "Scripts", "python.exe") : join42(voicePaths.venv, "bin", "python");
15673
+ return process.platform === "win32" ? join43(voicePaths.venv, "Scripts", "python.exe") : join43(voicePaths.venv, "bin", "python");
15644
15674
  }
15645
15675
  function getLockDir() {
15646
15676
  const config = loadConfig();
15647
15677
  return config.voice?.lockDir ?? VOICE_DIR;
15648
15678
  }
15649
15679
  function getLockFile() {
15650
- return join42(getLockDir(), "voice.lock");
15680
+ return join43(getLockDir(), "voice.lock");
15651
15681
  }
15652
15682
 
15653
15683
  // src/commands/voice/devices.ts
15654
15684
  function devices() {
15655
- const script = join43(getPythonDir(), "list_devices.py");
15685
+ const script = join44(getPythonDir(), "list_devices.py");
15656
15686
  spawnSync4(getVenvPython(), [script], { stdio: "inherit" });
15657
15687
  }
15658
15688
 
15659
15689
  // src/commands/voice/logs.ts
15660
- import { existsSync as existsSync43, readFileSync as readFileSync33 } from "fs";
15690
+ import { existsSync as existsSync44, readFileSync as readFileSync34 } from "fs";
15661
15691
  function logs(options2) {
15662
- if (!existsSync43(voicePaths.log)) {
15692
+ if (!existsSync44(voicePaths.log)) {
15663
15693
  console.log("No voice log file found");
15664
15694
  return;
15665
15695
  }
15666
15696
  const count6 = Number.parseInt(options2.lines ?? "150", 10);
15667
- const content = readFileSync33(voicePaths.log, "utf-8").trim();
15697
+ const content = readFileSync34(voicePaths.log, "utf-8").trim();
15668
15698
  if (!content) {
15669
15699
  console.log("Voice log is empty");
15670
15700
  return;
@@ -15687,12 +15717,12 @@ function logs(options2) {
15687
15717
  // src/commands/voice/setup.ts
15688
15718
  import { spawnSync as spawnSync5 } from "child_process";
15689
15719
  import { mkdirSync as mkdirSync15 } from "fs";
15690
- import { join as join45 } from "path";
15720
+ import { join as join46 } from "path";
15691
15721
 
15692
15722
  // src/commands/voice/checkLockFile.ts
15693
15723
  import { execSync as execSync44 } from "child_process";
15694
- import { existsSync as existsSync44, mkdirSync as mkdirSync14, readFileSync as readFileSync34, writeFileSync as writeFileSync27 } from "fs";
15695
- import { join as join44 } from "path";
15724
+ import { existsSync as existsSync45, mkdirSync as mkdirSync14, readFileSync as readFileSync35, writeFileSync as writeFileSync28 } from "fs";
15725
+ import { join as join45 } from "path";
15696
15726
  function isProcessAlive2(pid) {
15697
15727
  try {
15698
15728
  process.kill(pid, 0);
@@ -15703,9 +15733,9 @@ function isProcessAlive2(pid) {
15703
15733
  }
15704
15734
  function checkLockFile() {
15705
15735
  const lockFile = getLockFile();
15706
- if (!existsSync44(lockFile)) return;
15736
+ if (!existsSync45(lockFile)) return;
15707
15737
  try {
15708
- const lock = JSON.parse(readFileSync34(lockFile, "utf-8"));
15738
+ const lock = JSON.parse(readFileSync35(lockFile, "utf-8"));
15709
15739
  if (lock.pid && isProcessAlive2(lock.pid)) {
15710
15740
  console.error(
15711
15741
  `Voice daemon already running (PID ${lock.pid}, env: ${lock.env}). Stop it first with: assist voice stop`
@@ -15716,7 +15746,7 @@ function checkLockFile() {
15716
15746
  }
15717
15747
  }
15718
15748
  function bootstrapVenv() {
15719
- if (existsSync44(getVenvPython())) return;
15749
+ if (existsSync45(getVenvPython())) return;
15720
15750
  console.log("Setting up Python environment...");
15721
15751
  const pythonDir = getPythonDir();
15722
15752
  execSync44(
@@ -15729,8 +15759,8 @@ function bootstrapVenv() {
15729
15759
  }
15730
15760
  function writeLockFile(pid) {
15731
15761
  const lockFile = getLockFile();
15732
- mkdirSync14(join44(lockFile, ".."), { recursive: true });
15733
- writeFileSync27(
15762
+ mkdirSync14(join45(lockFile, ".."), { recursive: true });
15763
+ writeFileSync28(
15734
15764
  lockFile,
15735
15765
  JSON.stringify({
15736
15766
  pid,
@@ -15745,7 +15775,7 @@ function setup() {
15745
15775
  mkdirSync15(voicePaths.dir, { recursive: true });
15746
15776
  bootstrapVenv();
15747
15777
  console.log("\nDownloading models...\n");
15748
- const script = join45(getPythonDir(), "setup_models.py");
15778
+ const script = join46(getPythonDir(), "setup_models.py");
15749
15779
  const result = spawnSync5(getVenvPython(), [script], {
15750
15780
  stdio: "inherit",
15751
15781
  env: { ...process.env, VOICE_LOG_FILE: voicePaths.log }
@@ -15758,8 +15788,8 @@ function setup() {
15758
15788
 
15759
15789
  // src/commands/voice/start.ts
15760
15790
  import { spawn as spawn7 } from "child_process";
15761
- import { mkdirSync as mkdirSync16, writeFileSync as writeFileSync28 } from "fs";
15762
- import { join as join46 } from "path";
15791
+ import { mkdirSync as mkdirSync16, writeFileSync as writeFileSync29 } from "fs";
15792
+ import { join as join47 } from "path";
15763
15793
 
15764
15794
  // src/commands/voice/buildDaemonEnv.ts
15765
15795
  function buildDaemonEnv(options2) {
@@ -15787,7 +15817,7 @@ function spawnBackground(python, script, env) {
15787
15817
  console.error("Failed to start voice daemon");
15788
15818
  process.exit(1);
15789
15819
  }
15790
- writeFileSync28(voicePaths.pid, String(pid));
15820
+ writeFileSync29(voicePaths.pid, String(pid));
15791
15821
  writeLockFile(pid);
15792
15822
  console.log(`Voice daemon started (PID ${pid})`);
15793
15823
  }
@@ -15797,7 +15827,7 @@ function start2(options2) {
15797
15827
  bootstrapVenv();
15798
15828
  const debug = options2.debug || options2.foreground || process.platform === "win32";
15799
15829
  const env = buildDaemonEnv({ debug });
15800
- const script = join46(getPythonDir(), "voice_daemon.py");
15830
+ const script = join47(getPythonDir(), "voice_daemon.py");
15801
15831
  const python = getVenvPython();
15802
15832
  if (options2.foreground) {
15803
15833
  spawnForeground(python, script, env);
@@ -15807,7 +15837,7 @@ function start2(options2) {
15807
15837
  }
15808
15838
 
15809
15839
  // src/commands/voice/status.ts
15810
- import { existsSync as existsSync45, readFileSync as readFileSync35 } from "fs";
15840
+ import { existsSync as existsSync46, readFileSync as readFileSync36 } from "fs";
15811
15841
  function isProcessAlive3(pid) {
15812
15842
  try {
15813
15843
  process.kill(pid, 0);
@@ -15817,16 +15847,16 @@ function isProcessAlive3(pid) {
15817
15847
  }
15818
15848
  }
15819
15849
  function readRecentLogs(count6) {
15820
- if (!existsSync45(voicePaths.log)) return [];
15821
- const lines = readFileSync35(voicePaths.log, "utf-8").trim().split("\n");
15850
+ if (!existsSync46(voicePaths.log)) return [];
15851
+ const lines = readFileSync36(voicePaths.log, "utf-8").trim().split("\n");
15822
15852
  return lines.slice(-count6);
15823
15853
  }
15824
15854
  function status() {
15825
- if (!existsSync45(voicePaths.pid)) {
15855
+ if (!existsSync46(voicePaths.pid)) {
15826
15856
  console.log("Voice daemon: not running (no PID file)");
15827
15857
  return;
15828
15858
  }
15829
- const pid = Number.parseInt(readFileSync35(voicePaths.pid, "utf-8").trim(), 10);
15859
+ const pid = Number.parseInt(readFileSync36(voicePaths.pid, "utf-8").trim(), 10);
15830
15860
  const alive = isProcessAlive3(pid);
15831
15861
  console.log(`Voice daemon: ${alive ? "running" : "dead"} (PID ${pid})`);
15832
15862
  const recent = readRecentLogs(5);
@@ -15845,13 +15875,13 @@ function status() {
15845
15875
  }
15846
15876
 
15847
15877
  // src/commands/voice/stop.ts
15848
- import { existsSync as existsSync46, readFileSync as readFileSync36, unlinkSync as unlinkSync13 } from "fs";
15878
+ import { existsSync as existsSync47, readFileSync as readFileSync37, unlinkSync as unlinkSync13 } from "fs";
15849
15879
  function stop2() {
15850
- if (!existsSync46(voicePaths.pid)) {
15880
+ if (!existsSync47(voicePaths.pid)) {
15851
15881
  console.log("Voice daemon is not running (no PID file)");
15852
15882
  return;
15853
15883
  }
15854
- const pid = Number.parseInt(readFileSync36(voicePaths.pid, "utf-8").trim(), 10);
15884
+ const pid = Number.parseInt(readFileSync37(voicePaths.pid, "utf-8").trim(), 10);
15855
15885
  try {
15856
15886
  process.kill(pid, "SIGTERM");
15857
15887
  console.log(`Sent SIGTERM to voice daemon (PID ${pid})`);
@@ -15864,7 +15894,7 @@ function stop2() {
15864
15894
  }
15865
15895
  try {
15866
15896
  const lockFile = getLockFile();
15867
- if (existsSync46(lockFile)) unlinkSync13(lockFile);
15897
+ if (existsSync47(lockFile)) unlinkSync13(lockFile);
15868
15898
  } catch {
15869
15899
  }
15870
15900
  console.log("Voice daemon stopped");
@@ -16086,8 +16116,8 @@ async function auth() {
16086
16116
 
16087
16117
  // src/commands/roam/postRoamActivity.ts
16088
16118
  import { execFileSync as execFileSync7 } from "child_process";
16089
- import { readdirSync as readdirSync7, readFileSync as readFileSync37, statSync as statSync4 } from "fs";
16090
- import { join as join47 } from "path";
16119
+ import { readdirSync as readdirSync7, readFileSync as readFileSync38, statSync as statSync4 } from "fs";
16120
+ import { join as join48 } from "path";
16091
16121
  function findPortFile(roamDir) {
16092
16122
  let entries;
16093
16123
  try {
@@ -16096,7 +16126,7 @@ function findPortFile(roamDir) {
16096
16126
  return void 0;
16097
16127
  }
16098
16128
  const candidates = entries.filter((name) => /^roam-local-api(-[^.]+)?\.port$/.test(name)).map((name) => {
16099
- const path54 = join47(roamDir, name);
16129
+ const path54 = join48(roamDir, name);
16100
16130
  try {
16101
16131
  return { path: path54, mtimeMs: statSync4(path54).mtimeMs };
16102
16132
  } catch {
@@ -16108,11 +16138,11 @@ function findPortFile(roamDir) {
16108
16138
  function postRoamActivity(app, event) {
16109
16139
  const appData = process.env.APPDATA;
16110
16140
  if (!appData) return;
16111
- const portFile = findPortFile(join47(appData, "Roam"));
16141
+ const portFile = findPortFile(join48(appData, "Roam"));
16112
16142
  if (!portFile) return;
16113
16143
  let port;
16114
16144
  try {
16115
- port = readFileSync37(portFile, "utf-8").trim();
16145
+ port = readFileSync38(portFile, "utf-8").trim();
16116
16146
  } catch {
16117
16147
  return;
16118
16148
  }
@@ -16246,15 +16276,15 @@ function runPreCommands(pre, cwd) {
16246
16276
 
16247
16277
  // src/commands/run/spawnRunCommand.ts
16248
16278
  import { execFileSync as execFileSync8, spawn as spawn8 } from "child_process";
16249
- import { existsSync as existsSync47 } from "fs";
16250
- import { dirname as dirname24, join as join48, resolve as resolve11 } from "path";
16279
+ import { existsSync as existsSync48 } from "fs";
16280
+ import { dirname as dirname24, join as join49, resolve as resolve11 } from "path";
16251
16281
  function resolveCommand2(command) {
16252
16282
  if (process.platform !== "win32" || command !== "bash") return command;
16253
16283
  try {
16254
16284
  const gitPath = execFileSync8("where", ["git"], { encoding: "utf8" }).trim().split("\r\n")[0];
16255
16285
  const gitRoot = resolve11(dirname24(gitPath), "..");
16256
- const gitBash = join48(gitRoot, "bin", "bash.exe");
16257
- if (existsSync47(gitBash)) return gitBash;
16286
+ const gitBash = join49(gitRoot, "bin", "bash.exe");
16287
+ if (existsSync48(gitBash)) return gitBash;
16258
16288
  } catch {
16259
16289
  }
16260
16290
  return command;
@@ -16321,8 +16351,8 @@ function run3(name, args) {
16321
16351
  }
16322
16352
 
16323
16353
  // src/commands/run/add.ts
16324
- import { mkdirSync as mkdirSync17, writeFileSync as writeFileSync29 } from "fs";
16325
- import { join as join49 } from "path";
16354
+ import { mkdirSync as mkdirSync17, writeFileSync as writeFileSync30 } from "fs";
16355
+ import { join as join50 } from "path";
16326
16356
 
16327
16357
  // src/commands/run/extractOption.ts
16328
16358
  function extractOption(args, flag) {
@@ -16383,7 +16413,7 @@ function saveNewRunConfig(name, command, args, cwd) {
16383
16413
  saveConfig(config);
16384
16414
  }
16385
16415
  function createCommandFile(name) {
16386
- const dir = join49(".claude", "commands");
16416
+ const dir = join50(".claude", "commands");
16387
16417
  mkdirSync17(dir, { recursive: true });
16388
16418
  const content = `---
16389
16419
  description: Run ${name}
@@ -16391,8 +16421,8 @@ description: Run ${name}
16391
16421
 
16392
16422
  Run \`assist run ${name} $ARGUMENTS 2>&1\`.
16393
16423
  `;
16394
- const filePath = join49(dir, `${name}.md`);
16395
- writeFileSync29(filePath, content);
16424
+ const filePath = join50(dir, `${name}.md`);
16425
+ writeFileSync30(filePath, content);
16396
16426
  console.log(`Created command file: ${filePath}`);
16397
16427
  }
16398
16428
  function add3() {
@@ -16447,8 +16477,8 @@ function link2() {
16447
16477
  }
16448
16478
 
16449
16479
  // src/commands/run/remove.ts
16450
- import { existsSync as existsSync48, unlinkSync as unlinkSync14 } from "fs";
16451
- import { join as join50 } from "path";
16480
+ import { existsSync as existsSync49, unlinkSync as unlinkSync14 } from "fs";
16481
+ import { join as join51 } from "path";
16452
16482
  function findRemoveIndex() {
16453
16483
  const idx = process.argv.indexOf("remove");
16454
16484
  if (idx === -1 || idx + 1 >= process.argv.length) return -1;
@@ -16463,8 +16493,8 @@ function parseRemoveName() {
16463
16493
  return process.argv[idx + 1];
16464
16494
  }
16465
16495
  function deleteCommandFile(name) {
16466
- const filePath = join50(".claude", "commands", `${name}.md`);
16467
- if (existsSync48(filePath)) {
16496
+ const filePath = join51(".claude", "commands", `${name}.md`);
16497
+ if (existsSync49(filePath)) {
16468
16498
  unlinkSync14(filePath);
16469
16499
  console.log(`Deleted command file: ${filePath}`);
16470
16500
  }
@@ -16500,9 +16530,9 @@ function registerRun(program2) {
16500
16530
 
16501
16531
  // src/commands/screenshot/index.ts
16502
16532
  import { execSync as execSync47 } from "child_process";
16503
- import { existsSync as existsSync49, mkdirSync as mkdirSync18, unlinkSync as unlinkSync15, writeFileSync as writeFileSync30 } from "fs";
16533
+ import { existsSync as existsSync50, mkdirSync as mkdirSync18, unlinkSync as unlinkSync15, writeFileSync as writeFileSync31 } from "fs";
16504
16534
  import { tmpdir as tmpdir7 } from "os";
16505
- import { join as join51, resolve as resolve13 } from "path";
16535
+ import { join as join52, resolve as resolve13 } from "path";
16506
16536
  import chalk156 from "chalk";
16507
16537
 
16508
16538
  // src/commands/screenshot/captureWindowPs1.ts
@@ -16632,15 +16662,15 @@ Write-Output $OutputPath
16632
16662
 
16633
16663
  // src/commands/screenshot/index.ts
16634
16664
  function buildOutputPath(outputDir, processName) {
16635
- if (!existsSync49(outputDir)) {
16665
+ if (!existsSync50(outputDir)) {
16636
16666
  mkdirSync18(outputDir, { recursive: true });
16637
16667
  }
16638
16668
  const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
16639
16669
  return resolve13(outputDir, `${processName}-${timestamp}.png`);
16640
16670
  }
16641
16671
  function runPowerShellScript(processName, outputPath) {
16642
- const scriptPath = join51(tmpdir7(), `assist-screenshot-${Date.now()}.ps1`);
16643
- writeFileSync30(scriptPath, captureWindowPs1, "utf-8");
16672
+ const scriptPath = join52(tmpdir7(), `assist-screenshot-${Date.now()}.ps1`);
16673
+ writeFileSync31(scriptPath, captureWindowPs1, "utf-8");
16644
16674
  try {
16645
16675
  execSync47(
16646
16676
  `powershell -NoProfile -ExecutionPolicy Bypass -File "${scriptPath}" -ProcessName "${processName}" -OutputPath "${outputPath}"`,
@@ -16666,7 +16696,7 @@ function screenshot(processName) {
16666
16696
  }
16667
16697
 
16668
16698
  // src/commands/sessions/daemon/daemonStatus.ts
16669
- import { existsSync as existsSync50, readFileSync as readFileSync38 } from "fs";
16699
+ import { existsSync as existsSync51, readFileSync as readFileSync39 } from "fs";
16670
16700
  import { createInterface as createInterface4 } from "readline";
16671
16701
  var STATUS_TIMEOUT_MS = 5e3;
16672
16702
  async function daemonStatus() {
@@ -16690,8 +16720,8 @@ async function daemonStatus() {
16690
16720
  }
16691
16721
  }
16692
16722
  function describePid() {
16693
- if (!existsSync50(daemonPaths.pid)) return "";
16694
- return ` (PID ${readFileSync38(daemonPaths.pid, "utf-8").trim()})`;
16723
+ if (!existsSync51(daemonPaths.pid)) return "";
16724
+ return ` (PID ${readFileSync39(daemonPaths.pid, "utf-8").trim()})`;
16695
16725
  }
16696
16726
  function readSessionList(socket) {
16697
16727
  return new Promise((resolve16) => {
@@ -16758,7 +16788,7 @@ async function restartDaemon() {
16758
16788
  }
16759
16789
 
16760
16790
  // src/commands/sessions/daemon/runDaemon.ts
16761
- import { existsSync as existsSync52, mkdirSync as mkdirSync19, unlinkSync as unlinkSync16, writeFileSync as writeFileSync31 } from "fs";
16791
+ import { existsSync as existsSync53, mkdirSync as mkdirSync19, unlinkSync as unlinkSync16, writeFileSync as writeFileSync32 } from "fs";
16762
16792
  import * as net2 from "net";
16763
16793
 
16764
16794
  // src/commands/sessions/daemon/createAutoExit.ts
@@ -17034,7 +17064,7 @@ function repoPrefix(cwd) {
17034
17064
  import * as pty from "node-pty";
17035
17065
 
17036
17066
  // src/commands/sessions/daemon/ensureSpawnHelperExecutable.ts
17037
- import { chmodSync, existsSync as existsSync51, statSync as statSync5 } from "fs";
17067
+ import { chmodSync, existsSync as existsSync52, statSync as statSync5 } from "fs";
17038
17068
  import { createRequire as createRequire3 } from "module";
17039
17069
  import path48 from "path";
17040
17070
  var require4 = createRequire3(import.meta.url);
@@ -17049,7 +17079,7 @@ function ensureSpawnHelperExecutable() {
17049
17079
  `${process.platform}-${process.arch}`,
17050
17080
  "spawn-helper"
17051
17081
  );
17052
- if (!existsSync51(helper)) return;
17082
+ if (!existsSync52(helper)) return;
17053
17083
  const mode = statSync5(helper).mode;
17054
17084
  if ((mode & 73) === 0) chmodSync(helper, mode | 493);
17055
17085
  }
@@ -17516,7 +17546,7 @@ async function runDaemon() {
17516
17546
  process.exitCode = 1;
17517
17547
  return;
17518
17548
  }
17519
- if (process.platform !== "win32" && existsSync52(daemonPaths.socket)) {
17549
+ if (process.platform !== "win32" && existsSync53(daemonPaths.socket)) {
17520
17550
  unlinkSync16(daemonPaths.socket);
17521
17551
  }
17522
17552
  const checkAutoExit = createAutoExit(() => {
@@ -17529,7 +17559,7 @@ async function runDaemon() {
17529
17559
  (socket) => handleConnection(socket, manager)
17530
17560
  );
17531
17561
  server.listen(daemonPaths.socket, () => {
17532
- writeFileSync31(daemonPaths.pid, String(process.pid));
17562
+ writeFileSync32(daemonPaths.pid, String(process.pid));
17533
17563
  console.log(`Sessions daemon listening on ${daemonPaths.socket}`);
17534
17564
  checkAutoExit(manager.isIdle());
17535
17565
  });