@staff0rd/assist 0.684.0 → 0.684.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.684.0",
9
+ version: "0.684.1",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -3066,7 +3066,7 @@ var refactorConfigHelp = [
3066
3066
  var releasesConfigHelp = [
3067
3067
  {
3068
3068
  key: "releases.streams",
3069
- setter: "assist releases configure <owner/repo>",
3069
+ setter: "assist releases configure --streams <file>",
3070
3070
  note: "promotion streams the /releases page draws; each names a repo, its release workflow, its nodes and the edges between them"
3071
3071
  }
3072
3072
  ];
@@ -12127,7 +12127,7 @@ import { execFile as execFile5 } from "child_process";
12127
12127
  import { promisify as promisify5 } from "util";
12128
12128
  var execFileAsync4 = promisify5(execFile5);
12129
12129
  var CACHE_TTL_MS4 = 3e4;
12130
- function createCachedGhJson(args, parse4, fallback, options2 = {}) {
12130
+ function createCachedGhJson(args, parse5, fallback, options2 = {}) {
12131
12131
  const { cacheFallback = true } = options2;
12132
12132
  const cache6 = /* @__PURE__ */ new Map();
12133
12133
  return async (cwd, extraArgs = []) => {
@@ -12142,7 +12142,7 @@ function createCachedGhJson(args, parse4, fallback, options2 = {}) {
12142
12142
  windowsHide: true,
12143
12143
  cwd: toGitCwd(cwd)
12144
12144
  });
12145
- value = parse4(stdout);
12145
+ value = parse5(stdout);
12146
12146
  } catch {
12147
12147
  value = fallback;
12148
12148
  }
@@ -28754,71 +28754,63 @@ function registerRavendb(program2) {
28754
28754
  // src/commands/releases/releasesConfigure.ts
28755
28755
  import chalk198 from "chalk";
28756
28756
 
28757
- // src/commands/releases/buildConfigurePrompt.ts
28758
- var SCHEMA_EXAMPLE = `releases:
28759
- streams:
28760
- - name: Web App
28761
- repo: owner/name
28762
- workflow: release.yml
28763
- nodes:
28764
- - { id: build, kind: build }
28765
- - { id: dev, environment: dev }
28766
- - { id: promote, kind: gate }
28767
- - { id: uk-prod, environment: UK Production, label: uk-prod }
28768
- edges:
28769
- - [build, dev]
28770
- - [dev, promote]
28771
- - [promote, uk-prod]`;
28772
- function buildConfigurePrompt(repo) {
28773
- return `Derive the release promotion topology of ${repo} and write it into assist's config under \`releases.streams\`.
28774
-
28775
- ## Read the workflows from GitHub
28776
-
28777
- Do not assume ${repo} is checked out here.
28778
-
28779
- - \`gh api repos/${repo}/contents/.github/workflows --jq '.[].name'\` lists the workflow files.
28780
- - \`gh api repos/${repo}/contents/.github/workflows/<file> --jq .content | base64 -d\` reads one.
28781
- - A job with \`uses: <owner>/<name>/.github/workflows/<file>@<ref>\` calls a reusable workflow. Read that file too, from the repo and ref it names, and keep following \`uses:\` to any depth \u2014 a deploy three levels down is still a node in the graph.
28782
-
28783
- ## Derive
28784
-
28785
- - **Streams** \u2014 one per release pipeline. A repo releasing two apps has two streams, whether they share a workflow or not. Name each after the thing released, not after the workflow file. \`workflow\` is the file name of the workflow the promotion runs under, the top-level one, not the reusable ones it calls.
28786
- - **Nodes** \u2014 one per step worth drawing:
28787
- - a job that deploys to a GitHub environment: \`{ id: <short-id>, environment: <name> }\`
28788
- - a job that builds or packages and deploys nothing: \`{ id: <short-id>, kind: build }\`
28789
- - a job or environment approval that only gates promotion: \`{ id: <short-id>, kind: gate }\`
28790
- - \`label\` overrides the text drawn on the node; set it only where \`id\` reads badly.
28791
- - **Environment names** must be the names GitHub knows, spelled as the repo's environments spell them \u2014 live state is read from the repo's deployments against them. Where a reusable workflow takes the name as an input, follow the input back to its value at the call site rather than recording the input's name. \`gh api repos/${repo}/environments --jq '.environments[].name'\` is the check.
28792
- - **Edges** \u2014 \`[from, to]\` for each \`needs:\` relation between the nodes you kept, flattened across reusable-workflow boundaries: where a job needs a \`uses:\` job, the edge runs to or from the inner job that actually neighbours it. Fan-in (several nodes into one gate) and fan-out (one node into several) are both expected and must both survive the flattening.
28793
-
28794
- ## Confirm before writing
28795
-
28796
- Ask rather than guess: which jobs deserve a node, how jobs split into streams, what to call a stream, and any environment name that is computed rather than written literally. Show the graph you intend to write \u2014 nodes and edges \u2014 and let me correct it before anything is written.
28797
-
28798
- ## Write
28799
-
28800
- Put the block in the assist config of the repo you are running in (\`.claude/assist.yml\` or \`assist.yml\`), or in \`~/.assist.yml\` for one that should follow me everywhere. Ask which if there is any doubt. Keep streams already declared for other repos, and replace the ones whose \`repo\` is \`${repo}\`.
28801
-
28802
- ${SCHEMA_EXAMPLE}
28803
-
28804
- Then run \`assist releases list\` to confirm assist reads the block back as you meant it, and exit. Do not run \`assist releases configure\`.`;
28757
+ // src/commands/releases/checkStreamGraph.ts
28758
+ function nodeIds(stream) {
28759
+ const nodes = Array.isArray(stream.nodes) ? stream.nodes : [];
28760
+ return nodes.flatMap(
28761
+ (node) => node !== null && typeof node === "object" && typeof node.id === "string" ? [node.id] : []
28762
+ );
28763
+ }
28764
+ function repeatedIds(ids) {
28765
+ const seen = /* @__PURE__ */ new Set();
28766
+ const repeated = /* @__PURE__ */ new Set();
28767
+ for (const id of ids) {
28768
+ if (seen.has(id)) repeated.add(id);
28769
+ seen.add(id);
28770
+ }
28771
+ return [...repeated];
28772
+ }
28773
+ function unknownEdgeIds(stream, known) {
28774
+ const edges = Array.isArray(stream.edges) ? stream.edges : [];
28775
+ return edges.flatMap(
28776
+ (edge) => (Array.isArray(edge) ? edge : []).filter(
28777
+ (id) => typeof id === "string" && !known.has(id)
28778
+ )
28779
+ );
28780
+ }
28781
+ function checkStreamGraph(streams) {
28782
+ return streams.flatMap((stream, index3) => {
28783
+ const where = typeof stream.name === "string" ? stream.name : `stream ${index3}`;
28784
+ const ids = nodeIds(stream);
28785
+ return [
28786
+ ...repeatedIds(ids).map((id) => `${where}: duplicate node id "${id}"`),
28787
+ ...unknownEdgeIds(stream, new Set(ids)).map(
28788
+ (id) => `${where}: edge refers to unknown node "${id}"`
28789
+ )
28790
+ ];
28791
+ });
28805
28792
  }
28806
28793
 
28807
- // src/commands/releases/readRepoStreams.ts
28808
- import { ZodError } from "zod";
28809
- function readRepoStreams(repo) {
28794
+ // src/commands/releases/readStreamsInput.ts
28795
+ import { readFileSync as readFileSync47 } from "fs";
28796
+ import { parse as parse4 } from "yaml";
28797
+ function readSource2(source) {
28798
+ return readFileSync47(source === "-" ? 0 : source, "utf8");
28799
+ }
28800
+ function readStreamsInput(source) {
28801
+ let parsed;
28810
28802
  try {
28811
- const streams = loadConfig().releases?.streams ?? [];
28812
- const wanted = repo.toLowerCase();
28813
- return { streams: streams.filter((s) => s.repo.toLowerCase() === wanted) };
28803
+ parsed = parse4(readSource2(source));
28814
28804
  } catch (error) {
28815
- return { error: describeConfigError(error) };
28805
+ return { error: error instanceof Error ? error.message : String(error) };
28816
28806
  }
28817
- }
28818
- function describeConfigError(error) {
28819
- if (error instanceof ZodError)
28820
- return error.issues.map((issue) => ` ${issue.path.join(".")}: ${issue.message}`).join("\n");
28821
- return error instanceof Error ? error.message : String(error);
28807
+ if (!Array.isArray(parsed))
28808
+ return { error: `Expected an array of streams, got ${typeof parsed}.` };
28809
+ const bad = parsed.findIndex(
28810
+ (s) => s === null || typeof s !== "object" || Array.isArray(s)
28811
+ );
28812
+ if (bad !== -1) return { error: `Stream ${bad} is not an object.` };
28813
+ return { streams: parsed };
28822
28814
  }
28823
28815
 
28824
28816
  // src/commands/releases/reportDerivedStreams.ts
@@ -28839,39 +28831,130 @@ function printDerived(stream) {
28839
28831
  const edges = stream.edges.map(([from, to]) => `${from} \u2192 ${to}`);
28840
28832
  console.log(` edges: ${edges.join(", ") || chalk197.dim("none")}`);
28841
28833
  }
28842
- function reportDerivedStreams(repo, before) {
28843
- const after = readRepoStreams(repo);
28844
- if ("error" in after) {
28845
- console.error(
28846
- chalk197.red(`releases.streams does not validate:
28847
- ${after.error}`)
28848
- );
28849
- process.exitCode = 1;
28850
- return;
28834
+ function reportDerivedStreams(streams, target) {
28835
+ for (const stream of streams) printDerived(stream);
28836
+ console.log(chalk197.dim(`Written to ${target}`));
28837
+ }
28838
+
28839
+ // src/commands/releases/withCurrentRepo.ts
28840
+ function withCurrentRepo(streams) {
28841
+ if (streams.every((stream) => typeof stream.repo === "string"))
28842
+ return streams;
28843
+ const { org, repo } = getRepoInfo();
28844
+ return streams.map((stream) => ({ repo: `${org}/${repo}`, ...stream }));
28845
+ }
28846
+
28847
+ // src/commands/config/applyConfigWrites.ts
28848
+ function applyConfigWrites(base, writes, schema2) {
28849
+ let updated2 = base;
28850
+ for (const write of writes) {
28851
+ updated2 = setNestedValue(updated2, write.key, write.value);
28852
+ const validation = validateConfig(updated2, write.key, schema2);
28853
+ if (!validation.ok) return validation;
28851
28854
  }
28852
- if (after.streams.length === 0) {
28853
- console.log(chalk197.yellow(`No stream is declared for ${repo}.`));
28854
- return;
28855
+ return { ok: true, updated: updated2 };
28856
+ }
28857
+
28858
+ // src/commands/config/writeConfigKeys.ts
28859
+ function writeConfigKeys(writes, scope, cwd = process.cwd(), globalConfigPath) {
28860
+ const globalOnly = writes.filter((write) => isGlobalOnlyConfigKey(write.key));
28861
+ if (globalOnly.length > 0) {
28862
+ return {
28863
+ ok: false,
28864
+ errors: globalOnly.map(
28865
+ (write) => `"${write.key}" is a global-only key. Set it with 'assist config set ${write.key} <value> -g'`
28866
+ )
28867
+ };
28855
28868
  }
28856
- if (JSON.stringify(after.streams) === JSON.stringify(before))
28857
- console.log(chalk197.dim(`releases.streams for ${repo} is unchanged.`));
28858
- for (const stream of after.streams) printDerived(stream);
28869
+ if (scope === "repo") return writeRepoBlock(writes, cwd, globalConfigPath);
28870
+ const applied = applyConfigWrites(loadProjectConfig(cwd), writes);
28871
+ if (!applied.ok) return applied;
28872
+ saveConfig(applied.updated, cwd);
28873
+ return { ok: true, target: "project assist.yml" };
28874
+ }
28875
+ function writeRepoBlock(writes, cwd, globalConfigPath) {
28876
+ const { globalRaw, repos: repos2, label: label2, block } = resolveRepoConfigBlock(
28877
+ void 0,
28878
+ cwd,
28879
+ globalConfigPath
28880
+ );
28881
+ const applied = applyConfigWrites(block, writes, repoConfigSchema);
28882
+ if (!applied.ok) return applied;
28883
+ repos2[label2] = applied.updated;
28884
+ saveGlobalConfig({ ...globalRaw, repos: repos2 }, globalConfigPath);
28885
+ return { ok: true, target: `~/.assist.yml, repo: ${label2}` };
28886
+ }
28887
+
28888
+ // src/commands/releases/declaredStreamsInScope.ts
28889
+ function streamsOf(block) {
28890
+ const releases = block.releases;
28891
+ if (releases === null || typeof releases !== "object") return [];
28892
+ const streams = releases.streams;
28893
+ return Array.isArray(streams) ? streams : [];
28894
+ }
28895
+ function declaredStreamsInScope(scope, cwd = process.cwd()) {
28896
+ if (scope === "repo")
28897
+ return streamsOf(resolveRepoConfigBlock(void 0, cwd).block);
28898
+ return streamsOf(loadProjectConfig(cwd));
28899
+ }
28900
+
28901
+ // src/commands/releases/mergeRepoStreams.ts
28902
+ function repoOf(stream) {
28903
+ return typeof stream.repo === "string" ? stream.repo.toLowerCase() : "";
28904
+ }
28905
+ function mergeRepoStreams(declared, incoming) {
28906
+ const replaced = new Set(incoming.map(repoOf));
28907
+ return [
28908
+ ...declared.filter((stream) => !replaced.has(repoOf(stream))),
28909
+ ...incoming
28910
+ ];
28911
+ }
28912
+
28913
+ // src/commands/releases/writeReleaseStreams.ts
28914
+ function writeReleaseStreams(incoming, scope) {
28915
+ return writeConfigKeys(
28916
+ [
28917
+ {
28918
+ key: "releases.streams",
28919
+ value: mergeRepoStreams(declaredStreamsInScope(scope), incoming)
28920
+ }
28921
+ ],
28922
+ scope
28923
+ );
28859
28924
  }
28860
28925
 
28861
28926
  // src/commands/releases/releasesConfigure.ts
28862
- var REPO_RE = /^[^/\s]+\/[^/\s]+$/;
28863
- async function releasesConfigure(repo) {
28864
- if (!REPO_RE.test(repo)) {
28865
- console.error(chalk198.red(`Expected <owner/repo>, got '${repo}'.`));
28866
- process.exitCode = 1;
28867
- return;
28868
- }
28869
- const before = readRepoStreams(repo);
28870
- const { done: done2 } = spawnClaude(buildConfigurePrompt(repo), {
28871
- allowEdits: true
28872
- });
28873
- await done2;
28874
- reportDerivedStreams(repo, "streams" in before ? before.streams : []);
28927
+ function fail6(message3, details = []) {
28928
+ console.error(chalk198.red(message3));
28929
+ for (const detail of details) console.error(chalk198.red(` ${detail}`));
28930
+ process.exitCode = 1;
28931
+ }
28932
+ function reportWritten(incoming, target) {
28933
+ const repos2 = new Set(incoming.map((s) => String(s.repo).toLowerCase()));
28934
+ const declared = loadConfig().releases?.streams ?? [];
28935
+ reportDerivedStreams(
28936
+ declared.filter((s) => repos2.has(s.repo.toLowerCase())),
28937
+ target
28938
+ );
28939
+ }
28940
+ function releasesConfigure(options2 = {}) {
28941
+ const scope = options2.scope === "repo" ? "repo" : "project";
28942
+ const input = readStreamsInput(options2.streams ?? "-");
28943
+ if ("error" in input) return fail6(`Could not read --streams: ${input.error}`);
28944
+ const incoming = withCurrentRepo(input.streams);
28945
+ const broken = checkStreamGraph(incoming);
28946
+ if (broken.length > 0)
28947
+ return fail6(
28948
+ "The graph does not hold together, so nothing was written:",
28949
+ broken
28950
+ );
28951
+ const written = writeReleaseStreams(incoming, scope);
28952
+ if (!written.ok)
28953
+ return fail6(
28954
+ "releases.streams does not validate, so nothing was written:",
28955
+ written.errors
28956
+ );
28957
+ reportWritten(incoming, written.target);
28875
28958
  }
28876
28959
 
28877
28960
  // src/commands/releases/releasesList.ts
@@ -28904,11 +28987,18 @@ function registerReleases(parent) {
28904
28987
  configHelp(
28905
28988
  releasesCommand,
28906
28989
  releasesConfigHelp,
28907
- "Streams are declared by 'assist releases configure <owner/repo>' or by hand in assist.yml, and rendered by the /releases page of the sessions dashboard."
28990
+ "Streams are declared by '/releases-configure', which derives them from the repo's workflows and writes them with 'assist releases configure', and rendered by the /releases page of the sessions dashboard."
28908
28991
  );
28909
28992
  releasesCommand.command("list").description("List the declared release streams, their nodes and edges").action(releasesList);
28910
- releasesCommand.command("configure <owner/repo>").description(
28911
- "Derive a repo's promotion topology with Claude and write it to releases.streams"
28993
+ releasesCommand.command("configure").description(
28994
+ "Validate release streams and write them to releases.streams for the current repo"
28995
+ ).requiredOption(
28996
+ "--streams <file>",
28997
+ "JSON or YAML array of streams to declare; '-' reads stdin"
28998
+ ).option(
28999
+ "--scope <project|repo>",
29000
+ "project assist.yml or ~/.assist.yml repo block",
29001
+ "project"
28912
29002
  ).action(releasesConfigure);
28913
29003
  }
28914
29004
 
@@ -29526,7 +29616,7 @@ function buildLimitsSegment(rateLimits) {
29526
29616
  }
29527
29617
 
29528
29618
  // src/commands/readGitBranch.ts
29529
- import { readFileSync as readFileSync47, statSync as statSync10 } from "fs";
29619
+ import { readFileSync as readFileSync48, statSync as statSync10 } from "fs";
29530
29620
  import { isAbsolute as isAbsolute5, join as join76, resolve as resolve20 } from "path";
29531
29621
  function resolveGitDir(cwd) {
29532
29622
  const dotGit = join76(cwd, ".git");
@@ -29541,7 +29631,7 @@ function resolveGitDir(cwd) {
29541
29631
  }
29542
29632
  let contents;
29543
29633
  try {
29544
- contents = readFileSync47(dotGit, "utf8");
29634
+ contents = readFileSync48(dotGit, "utf8");
29545
29635
  } catch {
29546
29636
  return null;
29547
29637
  }
@@ -29559,7 +29649,7 @@ function readGitBranch(cwd) {
29559
29649
  }
29560
29650
  let head;
29561
29651
  try {
29562
- head = readFileSync47(join76(gitDir, "HEAD"), "utf8");
29652
+ head = readFileSync48(join76(gitDir, "HEAD"), "utf8");
29563
29653
  } catch {
29564
29654
  return null;
29565
29655
  }
@@ -31453,47 +31543,6 @@ function coerceSupplied(key, supplied) {
31453
31543
  return coercion.value;
31454
31544
  }
31455
31545
 
31456
- // src/commands/config/applyConfigWrites.ts
31457
- function applyConfigWrites(base, writes, schema2) {
31458
- let updated2 = base;
31459
- for (const write of writes) {
31460
- updated2 = setNestedValue(updated2, write.key, write.value);
31461
- const validation = validateConfig(updated2, write.key, schema2);
31462
- if (!validation.ok) return validation;
31463
- }
31464
- return { ok: true, updated: updated2 };
31465
- }
31466
-
31467
- // src/commands/config/writeConfigKeys.ts
31468
- function writeConfigKeys(writes, scope, cwd = process.cwd(), globalConfigPath) {
31469
- const globalOnly = writes.filter((write) => isGlobalOnlyConfigKey(write.key));
31470
- if (globalOnly.length > 0) {
31471
- return {
31472
- ok: false,
31473
- errors: globalOnly.map(
31474
- (write) => `"${write.key}" is a global-only key. Set it with 'assist config set ${write.key} <value> -g'`
31475
- )
31476
- };
31477
- }
31478
- if (scope === "repo") return writeRepoBlock(writes, cwd, globalConfigPath);
31479
- const applied = applyConfigWrites(loadProjectConfig(cwd), writes);
31480
- if (!applied.ok) return applied;
31481
- saveConfig(applied.updated, cwd);
31482
- return { ok: true, target: "project assist.yml" };
31483
- }
31484
- function writeRepoBlock(writes, cwd, globalConfigPath) {
31485
- const { globalRaw, repos: repos2, label: label2, block } = resolveRepoConfigBlock(
31486
- void 0,
31487
- cwd,
31488
- globalConfigPath
31489
- );
31490
- const applied = applyConfigWrites(block, writes, repoConfigSchema);
31491
- if (!applied.ok) return applied;
31492
- repos2[label2] = applied.updated;
31493
- saveGlobalConfig({ ...globalRaw, repos: repos2 }, globalConfigPath);
31494
- return { ok: true, target: `~/.assist.yml, repo: ${label2}` };
31495
- }
31496
-
31497
31546
  // src/commands/config/configureConfigKeys.ts
31498
31547
  async function configureConfigKeys(questions, options2 = {}) {
31499
31548
  const scope = options2.scope ?? await promptConfigScope();
@@ -32102,7 +32151,7 @@ function fetchHighLevelPr(prNumber, repo) {
32102
32151
  }
32103
32152
 
32104
32153
  // src/commands/review/highLevel/loadHighLevelReview.ts
32105
- import { existsSync as existsSync64, readFileSync as readFileSync48 } from "fs";
32154
+ import { existsSync as existsSync64, readFileSync as readFileSync49 } from "fs";
32106
32155
 
32107
32156
  // src/commands/review/highLevel/highLevelReviewPath.ts
32108
32157
  import { join as join77 } from "path";
@@ -32123,7 +32172,7 @@ function loadHighLevelReview(repo, headRef, headSha) {
32123
32172
  const path91 = highLevelReviewPath(repo, headRef, headSha);
32124
32173
  if (!existsSync64(path91)) return void 0;
32125
32174
  try {
32126
- return JSON.parse(readFileSync48(path91, "utf8"));
32175
+ return JSON.parse(readFileSync49(path91, "utf8"));
32127
32176
  } catch {
32128
32177
  return void 0;
32129
32178
  }
@@ -32698,7 +32747,7 @@ function gatherContext() {
32698
32747
  }
32699
32748
 
32700
32749
  // src/commands/review/postReviewToPr.ts
32701
- import { readFileSync as readFileSync49 } from "fs";
32750
+ import { readFileSync as readFileSync50 } from "fs";
32702
32751
 
32703
32752
  // src/commands/review/carriedUnanchoredFindings.ts
32704
32753
  function carriedUnanchoredFindings(unanchored) {
@@ -33149,7 +33198,7 @@ async function confirmPost(prNumber, work, options2) {
33149
33198
  return promptConfirm(`Post ${work} to PR #${prNumber}?`, false);
33150
33199
  }
33151
33200
  async function postFindingsToPr(prInfo, synthesisPath, options2) {
33152
- const markdown = readFileSync49(synthesisPath, "utf8");
33201
+ const markdown = readFileSync50(synthesisPath, "utf8");
33153
33202
  const { inDiff, unanchored } = selectPostableFindings(markdown, prInfo);
33154
33203
  const carried = carriedUnanchoredFindings(unanchored);
33155
33204
  if (inDiff.length === 0 && carried.length === 0) return NOTHING_POSTED;
@@ -34169,7 +34218,7 @@ async function runReviewers(reviewDir, claudePath, codexPath, stdinPrompt, optio
34169
34218
  }
34170
34219
 
34171
34220
  // src/commands/review/synthesise.ts
34172
- import { readFileSync as readFileSync50 } from "fs";
34221
+ import { readFileSync as readFileSync51 } from "fs";
34173
34222
 
34174
34223
  // src/commands/review/buildSynthesisStdin.ts
34175
34224
  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.
@@ -34234,7 +34283,7 @@ Files:
34234
34283
 
34235
34284
  // src/commands/review/synthesise.ts
34236
34285
  function printSummary2(synthesisPath) {
34237
- const markdown = readFileSync50(synthesisPath, "utf8");
34286
+ const markdown = readFileSync51(synthesisPath, "utf8");
34238
34287
  console.log("");
34239
34288
  console.log(buildReviewSummary(markdown));
34240
34289
  console.log("");
@@ -34547,7 +34596,7 @@ function registerReview(program2) {
34547
34596
  }
34548
34597
 
34549
34598
  // src/commands/rules/addRule.ts
34550
- import { existsSync as existsSync70, readFileSync as readFileSync54, writeFileSync as writeFileSync43 } from "fs";
34599
+ import { existsSync as existsSync70, readFileSync as readFileSync55, writeFileSync as writeFileSync43 } from "fs";
34551
34600
  import path73 from "path";
34552
34601
  import chalk229 from "chalk";
34553
34602
 
@@ -34572,7 +34621,7 @@ function insertRuleBullet(content, rule) {
34572
34621
  }
34573
34622
 
34574
34623
  // src/commands/rules/nextRuleCode.ts
34575
- import { readFileSync as readFileSync51 } from "fs";
34624
+ import { readFileSync as readFileSync52 } from "fs";
34576
34625
 
34577
34626
  // src/commands/rules/findClaudeFiles.ts
34578
34627
  import { readdirSync as readdirSync14 } from "fs";
@@ -34596,7 +34645,7 @@ function findClaudeFiles(dir) {
34596
34645
  var CODE_PREFIX = "R";
34597
34646
  function nextRuleCode(root) {
34598
34647
  const numbers = findClaudeFiles(root).flatMap(
34599
- (file) => parseRulesSection(readFileSync51(file, "utf8")).map(
34648
+ (file) => parseRulesSection(readFileSync52(file, "utf8")).map(
34600
34649
  (rule) => Number(/(\d+)\s*$/.exec(rule.code)?.[1] ?? 0)
34601
34650
  )
34602
34651
  );
@@ -34622,15 +34671,15 @@ function resolveRuleScope(target) {
34622
34671
  }
34623
34672
 
34624
34673
  // src/commands/rules/updateScopedRulesIndex.ts
34625
- import { existsSync as existsSync69, readFileSync as readFileSync53, writeFileSync as writeFileSync42 } from "fs";
34674
+ import { existsSync as existsSync69, readFileSync as readFileSync54, writeFileSync as writeFileSync42 } from "fs";
34626
34675
  import path72 from "path";
34627
34676
 
34628
34677
  // src/commands/rules/scopedRuleDirectories.ts
34629
- import { readFileSync as readFileSync52 } from "fs";
34678
+ import { readFileSync as readFileSync53 } from "fs";
34630
34679
  import path71 from "path";
34631
34680
  function scopedRuleDirectories(root) {
34632
34681
  return findClaudeFiles(root).filter(
34633
- (file) => path71.dirname(file) !== root && parseRulesSection(readFileSync52(file, "utf8")).length > 0
34682
+ (file) => path71.dirname(file) !== root && parseRulesSection(readFileSync53(file, "utf8")).length > 0
34634
34683
  ).map(
34635
34684
  (file) => `${path71.relative(root, path71.dirname(file)).split(path71.sep).join("/")}/`
34636
34685
  ).sort();
@@ -34672,7 +34721,7 @@ function upsertScopedRulesPointer(content, directories) {
34672
34721
  function updateScopedRulesIndex(root) {
34673
34722
  const directories = scopedRuleDirectories(root);
34674
34723
  const rootFile = path72.join(root, "CLAUDE.md");
34675
- const before = existsSync69(rootFile) ? readFileSync53(rootFile, "utf8") : "";
34724
+ const before = existsSync69(rootFile) ? readFileSync54(rootFile, "utf8") : "";
34676
34725
  const after = upsertScopedRulesPointer(before, directories);
34677
34726
  if (after !== before) writeFileSync42(rootFile, after);
34678
34727
  return directories;
@@ -34680,7 +34729,7 @@ function updateScopedRulesIndex(root) {
34680
34729
 
34681
34730
  // src/commands/rules/addRule.ts
34682
34731
  function read2(file) {
34683
- return existsSync70(file) ? readFileSync54(file, "utf8") : "";
34732
+ return existsSync70(file) ? readFileSync55(file, "utf8") : "";
34684
34733
  }
34685
34734
  function addRule(text18, options2) {
34686
34735
  const rule = text18.trim();
@@ -35144,12 +35193,12 @@ import { mkdirSync as mkdirSync26, writeFileSync as writeFileSync45 } from "fs";
35144
35193
  import { mkdirSync as mkdirSync25, writeFileSync as writeFileSync44 } from "fs";
35145
35194
 
35146
35195
  // src/commands/slack/readSlackParts.ts
35147
- import { readFileSync as readFileSync55 } from "fs";
35196
+ import { readFileSync as readFileSync56 } from "fs";
35148
35197
  function readSlackParts(files) {
35149
35198
  return files.map((file) => {
35150
35199
  let contents;
35151
35200
  try {
35152
- contents = readFileSync55(file, "utf8");
35201
+ contents = readFileSync56(file, "utf8");
35153
35202
  } catch {
35154
35203
  console.error(`Error: Part file not found: ${file}`);
35155
35204
  process.exit(1);
@@ -36225,9 +36274,9 @@ function formatVttPassages(passages, notes = [], { sourceMarks = true } = {}) {
36225
36274
  }
36226
36275
 
36227
36276
  // src/commands/transcript/convert/readCleanedCues.ts
36228
- import { readFileSync as readFileSync59 } from "fs";
36277
+ import { readFileSync as readFileSync60 } from "fs";
36229
36278
  function readCleanedCues(inputPath) {
36230
- return deduplicateCues(parseVtt(readFileSync59(inputPath, "utf8")));
36279
+ return deduplicateCues(parseVtt(readFileSync60(inputPath, "utf8")));
36231
36280
  }
36232
36281
 
36233
36282
  // src/commands/transcript/clean.ts
@@ -36533,7 +36582,7 @@ function widenAudience(passages) {
36533
36582
  }
36534
36583
 
36535
36584
  // src/commands/transcript/merge.ts
36536
- function readSource2(file) {
36585
+ function readSource3(file) {
36537
36586
  if (!existsSync78(file)) failTranscript(`VTT file not found: ${file}`);
36538
36587
  const cues = readCleanedCues(file);
36539
36588
  if (cues.length === 0) failTranscript(`no cues found in: ${file}`);
@@ -36551,7 +36600,7 @@ async function readSelection(source) {
36551
36600
  return readJsonPayload(source, selectionSchema, "transcript selection");
36552
36601
  }
36553
36602
  async function merge(files, options2 = {}) {
36554
- const sources = files.map(readSource2);
36603
+ const sources = files.map(readSource3);
36555
36604
  const selection = await readSelection(options2.select);
36556
36605
  const selected = selection ? selectPassages(sources, selection) : wholePassages(sources);
36557
36606
  const passages = rebasePassages(
@@ -36739,14 +36788,14 @@ function devices() {
36739
36788
  }
36740
36789
 
36741
36790
  // src/commands/voice/logs.ts
36742
- import { existsSync as existsSync79, readFileSync as readFileSync60 } from "fs";
36791
+ import { existsSync as existsSync79, readFileSync as readFileSync61 } from "fs";
36743
36792
  function logs(options2) {
36744
36793
  if (!existsSync79(voicePaths.log)) {
36745
36794
  console.log("No voice log file found");
36746
36795
  return;
36747
36796
  }
36748
36797
  const count8 = Number.parseInt(options2.lines ?? "150", 10);
36749
- const content = readFileSync60(voicePaths.log, "utf8").trim();
36798
+ const content = readFileSync61(voicePaths.log, "utf8").trim();
36750
36799
  if (!content) {
36751
36800
  console.log("Voice log is empty");
36752
36801
  return;
@@ -36773,7 +36822,7 @@ import { join as join96 } from "path";
36773
36822
 
36774
36823
  // src/commands/voice/checkLockFile.ts
36775
36824
  import { execSync as execSync66 } from "child_process";
36776
- import { existsSync as existsSync80, mkdirSync as mkdirSync33, readFileSync as readFileSync61, writeFileSync as writeFileSync51 } from "fs";
36825
+ import { existsSync as existsSync80, mkdirSync as mkdirSync33, readFileSync as readFileSync62, writeFileSync as writeFileSync51 } from "fs";
36777
36826
  import { join as join95 } from "path";
36778
36827
  function isProcessAlive2(pid) {
36779
36828
  try {
@@ -36787,7 +36836,7 @@ function checkLockFile() {
36787
36836
  const lockFile = getLockFile();
36788
36837
  if (!existsSync80(lockFile)) return;
36789
36838
  try {
36790
- const lock2 = JSON.parse(readFileSync61(lockFile, "utf8"));
36839
+ const lock2 = JSON.parse(readFileSync62(lockFile, "utf8"));
36791
36840
  if (lock2.pid && isProcessAlive2(lock2.pid)) {
36792
36841
  console.error(
36793
36842
  `Voice daemon already running (PID ${lock2.pid}, env: ${lock2.env}). Stop it first with: assist voice stop`
@@ -36889,7 +36938,7 @@ function start2(options2) {
36889
36938
  }
36890
36939
 
36891
36940
  // src/commands/voice/status.ts
36892
- import { existsSync as existsSync81, readFileSync as readFileSync62 } from "fs";
36941
+ import { existsSync as existsSync81, readFileSync as readFileSync63 } from "fs";
36893
36942
  function isProcessAlive3(pid) {
36894
36943
  try {
36895
36944
  process.kill(pid, 0);
@@ -36900,7 +36949,7 @@ function isProcessAlive3(pid) {
36900
36949
  }
36901
36950
  function readRecentLogs(count8) {
36902
36951
  if (!existsSync81(voicePaths.log)) return [];
36903
- const lines2 = readFileSync62(voicePaths.log, "utf8").trim().split("\n");
36952
+ const lines2 = readFileSync63(voicePaths.log, "utf8").trim().split("\n");
36904
36953
  return lines2.slice(-count8);
36905
36954
  }
36906
36955
  function status2() {
@@ -36908,7 +36957,7 @@ function status2() {
36908
36957
  console.log("Voice daemon: not running (no PID file)");
36909
36958
  return;
36910
36959
  }
36911
- const pid = Number.parseInt(readFileSync62(voicePaths.pid, "utf8").trim(), 10);
36960
+ const pid = Number.parseInt(readFileSync63(voicePaths.pid, "utf8").trim(), 10);
36912
36961
  const alive = isProcessAlive3(pid);
36913
36962
  console.log(`Voice daemon: ${alive ? "running" : "dead"} (PID ${pid})`);
36914
36963
  const recent = readRecentLogs(5);
@@ -36927,13 +36976,13 @@ function status2() {
36927
36976
  }
36928
36977
 
36929
36978
  // src/commands/voice/stop.ts
36930
- import { existsSync as existsSync82, readFileSync as readFileSync63, unlinkSync as unlinkSync21 } from "fs";
36979
+ import { existsSync as existsSync82, readFileSync as readFileSync64, unlinkSync as unlinkSync21 } from "fs";
36931
36980
  function stop2() {
36932
36981
  if (!existsSync82(voicePaths.pid)) {
36933
36982
  console.log("Voice daemon is not running (no PID file)");
36934
36983
  return;
36935
36984
  }
36936
- const pid = Number.parseInt(readFileSync63(voicePaths.pid, "utf8").trim(), 10);
36985
+ const pid = Number.parseInt(readFileSync64(voicePaths.pid, "utf8").trim(), 10);
36937
36986
  try {
36938
36987
  process.kill(pid, "SIGTERM");
36939
36988
  console.log(`Sent SIGTERM to voice daemon (PID ${pid})`);
@@ -37804,7 +37853,7 @@ async function auth() {
37804
37853
 
37805
37854
  // src/commands/roam/postRoamActivity.ts
37806
37855
  import { execFileSync as execFileSync23 } from "child_process";
37807
- import { readdirSync as readdirSync22, readFileSync as readFileSync64, statSync as statSync13 } from "fs";
37856
+ import { readdirSync as readdirSync22, readFileSync as readFileSync65, statSync as statSync13 } from "fs";
37808
37857
  import { join as join100 } from "path";
37809
37858
  function findPortFile(roamDir) {
37810
37859
  let entries;
@@ -37835,7 +37884,7 @@ function postRoamActivity(app, event) {
37835
37884
  if (!portFile) return;
37836
37885
  let port;
37837
37886
  try {
37838
- port = readFileSync64(portFile, "utf8").trim();
37887
+ port = readFileSync65(portFile, "utf8").trim();
37839
37888
  } catch {
37840
37889
  return;
37841
37890
  }
@@ -38203,11 +38252,11 @@ function applyLine(result, pending, line) {
38203
38252
  }
38204
38253
 
38205
38254
  // src/commands/sessions/daemon/readDaemonPidFile.ts
38206
- import { readFileSync as readFileSync65 } from "fs";
38255
+ import { readFileSync as readFileSync66 } from "fs";
38207
38256
  function readDaemonPidFile() {
38208
38257
  try {
38209
38258
  const pid = Number.parseInt(
38210
- readFileSync65(daemonPaths.pid, "utf8").trim(),
38259
+ readFileSync66(daemonPaths.pid, "utf8").trim(),
38211
38260
  10
38212
38261
  );
38213
38262
  return Number.isInteger(pid) ? pid : void 0;
@@ -42403,14 +42452,14 @@ async function defaultConnect() {
42403
42452
  }
42404
42453
 
42405
42454
  // src/commands/sessions/daemon/hasPersistedWindowsSessions.ts
42406
- import { existsSync as existsSync98, readFileSync as readFileSync67 } from "fs";
42455
+ import { existsSync as existsSync98, readFileSync as readFileSync68 } from "fs";
42407
42456
  import { posix as posix3 } from "path";
42408
42457
  function hasPersistedWindowsSessions() {
42409
42458
  const sessionsFile = windowsSessionsFileFromWsl();
42410
42459
  if (!sessionsFile) return false;
42411
42460
  try {
42412
42461
  if (!existsSync98(sessionsFile)) return false;
42413
- const data = JSON.parse(readFileSync67(sessionsFile, "utf8"));
42462
+ const data = JSON.parse(readFileSync68(sessionsFile, "utf8"));
42414
42463
  return Array.isArray(data) && data.length > 0;
42415
42464
  } catch (error) {
42416
42465
  const message3 = error instanceof Error ? error.message : String(error);
@@ -43597,10 +43646,10 @@ async function parseTranscript(sessionId) {
43597
43646
  if (rollout) return readMessages(rollout, parseCodexTranscriptLines);
43598
43647
  return [];
43599
43648
  }
43600
- async function readMessages(filePath, parse4) {
43649
+ async function readMessages(filePath, parse5) {
43601
43650
  try {
43602
43651
  const raw = await fs55.promises.readFile(filePath, "utf8");
43603
- return parse4(raw.split("\n"));
43652
+ return parse5(raw.split("\n"));
43604
43653
  } catch {
43605
43654
  return [];
43606
43655
  }
@@ -43835,7 +43884,7 @@ function handleConnection(socket, manager) {
43835
43884
  import { unlinkSync as unlinkSync23, writeFileSync as writeFileSync54 } from "fs";
43836
43885
 
43837
43886
  // src/commands/sessions/daemon/startPidFileWatchdog.ts
43838
- import { readFileSync as readFileSync68 } from "fs";
43887
+ import { readFileSync as readFileSync69 } from "fs";
43839
43888
  var WATCHDOG_INTERVAL_MS = 5e3;
43840
43889
  function startPidFileWatchdog(onLost, intervalMs = WATCHDOG_INTERVAL_MS) {
43841
43890
  const timer = setInterval(() => {
@@ -43846,7 +43895,7 @@ function startPidFileWatchdog(onLost, intervalMs = WATCHDOG_INTERVAL_MS) {
43846
43895
  }
43847
43896
  function ownsPidFile() {
43848
43897
  try {
43849
- return readFileSync68(daemonPaths.pid, "utf8").trim() === String(process.pid);
43898
+ return readFileSync69(daemonPaths.pid, "utf8").trim() === String(process.pid);
43850
43899
  } catch {
43851
43900
  return false;
43852
43901
  }