@staff0rd/assist 0.924.0 → 0.925.0

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.924.0",
9
+ version: "0.925.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -826,6 +826,7 @@ function stripLegacyConfigKeys(config) {
826
826
  const stripped = { ...config };
827
827
  if (stripped.repos) stripped.repos = stripRepos(stripped.repos);
828
828
  delete stripped.backlog;
829
+ delete stripped.cliReadVerbs;
829
830
  const news = stripped.news;
830
831
  if (news && typeof news === "object" && "feeds" in news) {
831
832
  const { feeds: _feeds, ...rest } = news;
@@ -1251,7 +1252,6 @@ var assistConfigShape = {
1251
1252
  }).optional(),
1252
1253
  run: z6.array(z6.union([runConfigSchema, runLinkSchema])).optional(),
1253
1254
  transcript: transcriptConfigSchema.optional(),
1254
- cliReadVerbs: z6.record(z6.string(), z6.array(z6.string())).optional(),
1255
1255
  cliHook: z6.strictObject({
1256
1256
  blockNpmRun: z6.boolean().default(true)
1257
1257
  }).optional(),
@@ -5919,11 +5919,6 @@ var branchConfigHelp = [
5919
5919
 
5920
5920
  // src/commands/cliHook/cliHookConfigHelp.ts
5921
5921
  var cliHookConfigHelp = [
5922
- {
5923
- key: "cliReadVerbs",
5924
- setter: 'assist config set cliReadVerbs.git "status"',
5925
- note: "extra per-CLI verbs treated as read-only for auto-approval"
5926
- },
5927
5922
  {
5928
5923
  key: "cliHook.blockNpmRun",
5929
5924
  setter: "assist config set cliHook.blockNpmRun false",
@@ -13905,8 +13900,8 @@ function registerAdvise(program) {
13905
13900
  }
13906
13901
 
13907
13902
  // src/shared/internalCommand.ts
13908
- function internalCommand(command, calledBy2) {
13909
- command.internalCalledBy = calledBy2;
13903
+ function internalCommand(command, calledBy3) {
13904
+ command.internalCalledBy = calledBy3;
13910
13905
  return command;
13911
13906
  }
13912
13907
 
@@ -14635,11 +14630,11 @@ var agentCommands = {
14635
14630
  rewind: "the review phase of a backlog run"
14636
14631
  };
14637
14632
  function markAgentCommands(cmd) {
14638
- for (const [name, calledBy2] of Object.entries(agentCommands)) {
14633
+ for (const [name, calledBy3] of Object.entries(agentCommands)) {
14639
14634
  const command = cmd.commands.find((c) => c.name() === name);
14640
14635
  if (!command) throw new Error(`No backlog command named ${name}`);
14641
14636
  if (!command.internalCalledBy)
14642
- internalCommand(command, calledBy2);
14637
+ internalCommand(command, calledBy3);
14643
14638
  }
14644
14639
  }
14645
14640
 
@@ -19240,6 +19235,7 @@ function registerBranch(program) {
19240
19235
  ).action(
19241
19236
  (slug2, options2) => branch(slug2, options2)
19242
19237
  );
19238
+ internalCommand(branchCommand, "/branch");
19243
19239
  configHelp(
19244
19240
  branchCommand,
19245
19241
  branchConfigHelp,
@@ -20753,6 +20749,7 @@ function registerCliHook(program) {
20753
20749
  const cmd = program.command("cli-hook").description("PreToolUse hook for auto-approving read-only CLI commands").action(() => {
20754
20750
  cliHook();
20755
20751
  });
20752
+ internalCommand(cmd, "the PreToolUse hook on shell commands and reads");
20756
20753
  configHelp(cmd, cliHookConfigHelp);
20757
20754
  cmd.command("check <command>").description("Check whether a command would be auto-approved").option("--tool <tool>", "Tool name to check against", "Bash").action((command, options2) => {
20758
20755
  cliHookCheck(command, options2.tool);
@@ -21030,17 +21027,26 @@ using the pin from that notification.`
21030
21027
  }
21031
21028
 
21032
21029
  // src/commands/registerCodeComment.ts
21030
+ var calledBy = "agents whose edit the comment gate blocked";
21033
21031
  function registerCodeComment(parent) {
21034
21032
  const codeComment = parent.command("code-comment").description(
21035
21033
  "Escape hatch for the rare code comment that genuinely belongs"
21036
21034
  );
21037
- codeComment.command("set").description(
21038
- "Validate a single-line comment and issue a pin to confirm its insertion"
21039
- ).argument("<file>", "File the comment belongs in").argument("<line>", "1-based line number to insert the comment at").argument(
21040
- "<text>",
21041
- "Single-line comment text (max 50 chars, no block comments)"
21042
- ).action(codeCommentSet);
21043
- codeComment.command("confirm").description("Confirm a pin to insert its comment and clear the pin state").argument("<pin>", "Pin issued by 'code-comment set'").action(codeCommentConfirm);
21035
+ internalCommand(
21036
+ codeComment.command("set").description(
21037
+ "Validate a single-line comment and issue a pin to confirm its insertion"
21038
+ ).argument("<file>", "File the comment belongs in").argument("<line>", "1-based line number to insert the comment at").argument(
21039
+ "<text>",
21040
+ "Single-line comment text (max 50 chars, no block comments)"
21041
+ ).action(codeCommentSet),
21042
+ calledBy
21043
+ );
21044
+ internalCommand(
21045
+ codeComment.command("confirm").description(
21046
+ "Confirm a pin to insert its comment and clear the pin state"
21047
+ ).argument("<pin>", "Pin issued by 'code-comment set'").action(codeCommentConfirm),
21048
+ calledBy
21049
+ );
21044
21050
  }
21045
21051
 
21046
21052
  // src/commands/codexHook/parseCodexHookInput.ts
@@ -21574,6 +21580,7 @@ function registerCommit(program) {
21574
21580
  collectRef,
21575
21581
  []
21576
21582
  ).action(commit);
21583
+ internalCommand(commitCommand, "/commit");
21577
21584
  configHelp(commitCommand, rootConfigHelp.commit);
21578
21585
  }
21579
21586
 
@@ -25045,11 +25052,14 @@ async function editHook() {
25045
25052
 
25046
25053
  // src/commands/registerEditHook.ts
25047
25054
  function registerEditHook(program) {
25048
- program.command("edit-hook").description(
25049
- "PreToolUse hook that blocks edits to the maintainability override marker and edits that introduce code comments"
25050
- ).action(() => {
25051
- editHook();
25052
- });
25055
+ internalCommand(
25056
+ program.command("edit-hook").description(
25057
+ "PreToolUse hook that blocks edits to the maintainability override marker and edits that introduce code comments"
25058
+ ).action(() => {
25059
+ editHook();
25060
+ }),
25061
+ "the PreToolUse hook on file edits"
25062
+ );
25053
25063
  }
25054
25064
 
25055
25065
  // src/commands/github/aggregateCommitters.ts
@@ -25860,7 +25870,7 @@ async function commentIssue(numberArg, options2) {
25860
25870
 
25861
25871
  // src/commands/github/issue/registerCommentIssue.ts
25862
25872
  function registerCommentIssue(issueCommand) {
25863
- issueCommand.command("comment <number>").description("Comment on a GitHub issue (body of - reads it from stdin)").option("--body <body>", "Comment body (- reads it from stdin)").option(
25873
+ const commentCommand = issueCommand.command("comment <number>").description("Comment on a GitHub issue (body of - reads it from stdin)").option("--body <body>", "Comment body (- reads it from stdin)").option(
25864
25874
  "-R, --repo <owner/repo>",
25865
25875
  "Target repository (defaults to the current repo)"
25866
25876
  ).addHelpText(
@@ -25874,6 +25884,7 @@ function registerCommentIssue(issueCommand) {
25874
25884
  });
25875
25885
  }
25876
25886
  );
25887
+ internalCommand(commentCommand, "/github update");
25877
25888
  }
25878
25889
 
25879
25890
  // src/commands/prs/minGhAttachVersion.ts
@@ -26464,7 +26475,7 @@ async function createIssue(options2) {
26464
26475
 
26465
26476
  // src/commands/github/issue/registerCreateIssue.ts
26466
26477
  function registerCreateIssue(issueCommand) {
26467
- issueCommand.command("create").description("Create a GitHub issue").option("--title <title>", "Issue title").option("--body <body>", "Issue body").option(
26478
+ const createCommand = issueCommand.command("create").description("Create a GitHub issue").option("--title <title>", "Issue title").option("--body <body>", "Issue body").option(
26468
26479
  "-R, --repo <owner/repo>",
26469
26480
  "Target repository (defaults to the current repo)"
26470
26481
  ).option(
@@ -26497,6 +26508,7 @@ The reviewer may also drop or paste screenshots or video into the pane; on appro
26497
26508
  A bare --parent number is read against --repo, or the current repo; a parent in another repository is allowed.
26498
26509
  The project scope is needed for --project: gh auth refresh -h github.com -s project`
26499
26510
  ).action(createIssue);
26511
+ internalCommand(createCommand, "/github create");
26500
26512
  }
26501
26513
 
26502
26514
  // src/commands/sessions/shared/inWebSession.ts
@@ -26747,7 +26759,7 @@ async function editIssue(numberArg, options2) {
26747
26759
 
26748
26760
  // src/commands/github/issue/registerEditIssue.ts
26749
26761
  function registerEditIssue(issueCommand) {
26750
- issueCommand.command("edit <number>").description("Edit an existing GitHub issue's body in the preview pane").option(
26762
+ const editCommand = issueCommand.command("edit <number>").description("Edit an existing GitHub issue's body in the preview pane").option(
26751
26763
  "-R, --repo <owner/repo>",
26752
26764
  "Target repository (defaults to the current repo)"
26753
26765
  ).option(
@@ -26766,6 +26778,7 @@ function registerEditIssue(issueCommand) {
26766
26778
  "after",
26767
26779
  "\nFetches the issue's current body and opens it in the assist web preview pane, where it can be reworked before it is pushed back.\nWhen you already know the body you want, pass it with --body (--body - reads stdin): the first preview then shows that proposal instead of the current body, replacing any working file.\nTo make a targeted change to the current body (strike items out, tick a box), run with --fetch first: it writes the current body to the working file and prints its path without opening a preview. Edit that file in place, then re-run without --fetch or --body so the first preview shows your revision. Never run without --fetch just to get the body.\nApproving pushes the pane's markdown to the issue; nothing is pushed if the issue moved on GitHub after it was fetched, or outside a web session.\nRejecting writes the pane's markdown to a working file and names it: revise that file in place and re-run to preview the revision, which keeps any collapses already applied. A re-run resumes from the working file while the issue has not moved on GitHub; --fresh discards it and re-fetches.\nOnly the body is touched \u2014 the title, labels, assignees and state are left alone.\n--parent sets the issue's parent instead of editing the body: nothing is previewed and no web session is needed. A bare number is read against --repo, or the current repo; a parent in another repository is allowed."
26768
26780
  ).action(editIssue);
26781
+ internalCommand(editCommand, "/github");
26769
26782
  }
26770
26783
 
26771
26784
  // src/commands/github/issue/editIssueComment.ts
@@ -26816,7 +26829,7 @@ function commentUrl(raw) {
26816
26829
 
26817
26830
  // src/commands/github/issue/registerEditIssueComment.ts
26818
26831
  function registerEditIssueComment(issueCommand) {
26819
- issueCommand.command("edit-comment <comment-id>").description(
26832
+ const editCommentCommand = issueCommand.command("edit-comment <comment-id>").description(
26820
26833
  "Replace the body of a posted GitHub issue comment (body of - reads it from stdin)"
26821
26834
  ).option("--body <body>", "Replacement comment body (- reads it from stdin)").option(
26822
26835
  "-R, --repo <owner/repo>",
@@ -26832,6 +26845,7 @@ function registerEditIssueComment(issueCommand) {
26832
26845
  });
26833
26846
  }
26834
26847
  );
26848
+ internalCommand(editCommentCommand, "agents revising an issue comment");
26835
26849
  }
26836
26850
 
26837
26851
  // src/commands/github/issue/toIssueProjectItem.ts
@@ -26951,7 +26965,7 @@ function startIssue(numberArg, options2) {
26951
26965
 
26952
26966
  // src/commands/github/issue/registerStartIssue.ts
26953
26967
  function registerStartIssue(issueCommand) {
26954
- issueCommand.command("started <number>").description(
26968
+ const startedCommand = issueCommand.command("started <number>").description(
26955
26969
  "Assign a GitHub issue to yourself and move its project boards to In Progress"
26956
26970
  ).option(
26957
26971
  "-R, --repo <owner/repo>",
@@ -26960,6 +26974,7 @@ function registerStartIssue(issueCommand) {
26960
26974
  "after",
26961
26975
  "\nThe boards are discovered from the issue itself: every ProjectV2 item the issue sits on whose Status field offers an In Progress option (matched case-insensitively) is moved.\nThe assignment is applied first and is never blocked by the board work \u2014 an issue on no board, a Status field with no In Progress option, and a gh token without the project scope are each reported and exit 0.\nThe project scope is needed to read or move a board: gh auth refresh -h github.com -s project"
26962
26976
  ).action(startIssue);
26977
+ internalCommand(startedCommand, "/github started");
26963
26978
  }
26964
26979
 
26965
26980
  // src/commands/registerGithubIssue.ts
@@ -29531,7 +29546,10 @@ function prompts2() {
29531
29546
 
29532
29547
  // src/commands/registerPrompts.ts
29533
29548
  function registerPrompts(program) {
29534
- program.command("prompts").description("Show top denied tool calls by frequency").action(prompts2);
29549
+ internalCommand(
29550
+ program.command("prompts").description("Show top denied tool calls by frequency").action(prompts2),
29551
+ "/prompts"
29552
+ );
29535
29553
  }
29536
29554
 
29537
29555
  // src/commands/prs/prs.ts
@@ -29738,16 +29756,6 @@ async function comment2(path108, line, body, options2 = {}) {
29738
29756
  }
29739
29757
  }
29740
29758
 
29741
- // src/commands/prs/fixed.ts
29742
- import { execSync as execSync40 } from "child_process";
29743
-
29744
- // src/commands/prs/resolveCommentWithReply.ts
29745
- import { execFileSync as execFileSync19 } from "child_process";
29746
-
29747
- // src/commands/prs/loadCommentsCache.ts
29748
- import { existsSync as existsSync63, readFileSync as readFileSync45, unlinkSync as unlinkSync13 } from "fs";
29749
- import { parse as parse3 } from "yaml";
29750
-
29751
29759
  // src/commands/prs/commentsCachePath.ts
29752
29760
  import { homedir as homedir24 } from "os";
29753
29761
  import { join as join78 } from "path";
@@ -29762,126 +29770,11 @@ function commentsCachePath(org, repo, prNumber) {
29762
29770
  );
29763
29771
  }
29764
29772
 
29765
- // src/commands/prs/loadCommentsCache.ts
29766
- function loadCommentsCache(org, repo, prNumber) {
29767
- const cachePath = commentsCachePath(org, repo, prNumber);
29768
- if (!existsSync63(cachePath)) {
29769
- return null;
29770
- }
29771
- const content = readFileSync45(cachePath, "utf8");
29772
- return parse3(content);
29773
- }
29774
- function deleteCommentsCache(org, repo, prNumber) {
29775
- const cachePath = commentsCachePath(org, repo, prNumber);
29776
- if (existsSync63(cachePath)) {
29777
- unlinkSync13(cachePath);
29778
- console.log("No more unresolved line comments. Cache dropped.");
29779
- }
29780
- }
29781
-
29782
- // src/commands/prs/replyToComment.ts
29783
- import { spawnSync as spawnSync7 } from "child_process";
29784
- function replyToComment(org, repo, prNumber, commentId, message3) {
29785
- const result = spawnSync7(
29786
- "gh",
29787
- [
29788
- "api",
29789
- `repos/${org}/${repo}/pulls/${prNumber}/comments`,
29790
- "-f",
29791
- `body=${message3}`,
29792
- "-F",
29793
- `in_reply_to=${commentId}`
29794
- ],
29795
- { encoding: "utf8", windowsHide: true }
29796
- );
29797
- if (result.error) throw result.error;
29798
- if (result.status !== 0) throw new Error(result.stderr || result.stdout);
29799
- }
29800
-
29801
- // src/commands/prs/resolveCommentWithReply.ts
29802
- function resolveThread(threadId) {
29803
- const mutation = `mutation($threadId: ID!) { resolveReviewThread(input: {threadId: $threadId}) { thread { isResolved } } }`;
29804
- execFileSync19(
29805
- "gh",
29806
- ["api", "graphql", "-f", `query=${mutation}`, "-f", `threadId=${threadId}`],
29807
- { stdio: ["inherit", "pipe", "inherit"] }
29808
- );
29809
- }
29810
- function requireCache(org, repo, prNumber) {
29811
- const cache7 = loadCommentsCache(org, repo, prNumber);
29812
- if (!cache7) {
29813
- console.error(
29814
- `Error: No cached comments found for PR #${prNumber}. Run "assist prs list-comments" first.`
29815
- );
29816
- process.exit(1);
29817
- }
29818
- return cache7;
29819
- }
29820
- function findLineComment(comments3, commentId) {
29821
- return comments3.find((c) => c.type === "line" && c.id === commentId);
29822
- }
29823
- function requireLineComment(cache7, commentId) {
29824
- const comment3 = findLineComment(cache7.comments, commentId);
29825
- if (!comment3 || comment3.type !== "line" || !comment3.threadId) {
29826
- console.error(
29827
- `Error: Comment #${commentId} not found or has no thread ID.`
29828
- );
29829
- process.exit(1);
29830
- }
29831
- return comment3;
29832
- }
29833
- function cleanupCacheIfDone(cache7, org, repo, prNumber, commentId) {
29834
- const hasRemaining = cache7.comments.some(
29835
- (c) => c.type === "line" && c.id !== commentId
29836
- );
29837
- if (!hasRemaining) deleteCommentsCache(org, repo, prNumber);
29838
- }
29839
- function resolveCommentWithReply(commentId, message3) {
29840
- const prNumber = getCurrentPrNumber();
29841
- const { org, repo } = getRepoInfo();
29842
- const cache7 = requireCache(org, repo, prNumber);
29843
- const comment3 = requireLineComment(cache7, commentId);
29844
- replyToComment(org, repo, prNumber, commentId, message3);
29845
- console.log("Reply posted successfully.");
29846
- resolveThread(comment3.threadId);
29847
- console.log("Thread resolved successfully.");
29848
- cleanupCacheIfDone(cache7, org, repo, prNumber, commentId);
29849
- }
29850
-
29851
- // src/commands/prs/fixed.ts
29852
- function verifySha(sha) {
29853
- try {
29854
- return execSync40(`git rev-parse --verify ${sha}`, {
29855
- encoding: "utf8"
29856
- }).trim();
29857
- } catch {
29858
- console.error(`Error: '${sha}' is not a valid commit in this repository.`);
29859
- process.exit(1);
29860
- }
29861
- }
29862
- function fixed(commentId, sha) {
29863
- try {
29864
- const fullSha = verifySha(sha);
29865
- const { org, repo } = getRepoInfo();
29866
- const repoUrl = `https://github.com/${org}/${repo}`;
29867
- const message3 = `Fixed in [${fullSha}](${repoUrl}/commit/${fullSha})`;
29868
- pushCommit(loadConfig().worktree?.trunk === true);
29869
- resolveCommentWithReply(commentId, message3);
29870
- } catch (error) {
29871
- if (isGhNotInstalled(error)) {
29872
- console.error("Error: GitHub CLI (gh) is not installed.");
29873
- console.error("Install it from https://cli.github.com/");
29874
- process.exit(1);
29875
- }
29876
- throw error;
29877
- }
29878
- }
29879
-
29880
29773
  // src/commands/prs/fetchThreadIds.ts
29881
- import { execFileSync as execFileSync20 } from "child_process";
29774
+ import { execFileSync as execFileSync19 } from "child_process";
29882
29775
  var THREAD_QUERY = `query($owner: String!, $repo: String!, $prNumber: Int!) { repository(owner: $owner, name: $repo) { pullRequest(number: $prNumber) { reviewThreads(first: 100) { nodes { id isResolved comments(first: 100) { nodes { databaseId } } } } } } }`;
29883
29776
  function fetchThreadIds(org, repo, prNumber) {
29884
- const result = execFileSync20(
29777
+ const result = execFileSync19(
29885
29778
  "gh",
29886
29779
  [
29887
29780
  "api",
@@ -29912,9 +29805,9 @@ function fetchThreadIds(org, repo, prNumber) {
29912
29805
  }
29913
29806
 
29914
29807
  // src/commands/prs/listComments/fetchReviewComments.ts
29915
- import { execSync as execSync41 } from "child_process";
29808
+ import { execSync as execSync40 } from "child_process";
29916
29809
  function fetchJson(endpoint) {
29917
- const result = execSync41(`gh api --paginate ${endpoint}`, {
29810
+ const result = execSync40(`gh api --paginate ${endpoint}`, {
29918
29811
  encoding: "utf8"
29919
29812
  });
29920
29813
  if (!result.trim()) return [];
@@ -29960,6 +29853,25 @@ import { mkdirSync as mkdirSync22, writeFileSync as writeFileSync36 } from "fs";
29960
29853
  import { dirname as dirname36 } from "path";
29961
29854
  import { stringify as stringify3 } from "yaml";
29962
29855
 
29856
+ // src/commands/prs/loadCommentsCache.ts
29857
+ import { existsSync as existsSync63, readFileSync as readFileSync45, unlinkSync as unlinkSync13 } from "fs";
29858
+ import { parse as parse3 } from "yaml";
29859
+ function loadCommentsCache(org, repo, prNumber) {
29860
+ const cachePath = commentsCachePath(org, repo, prNumber);
29861
+ if (!existsSync63(cachePath)) {
29862
+ return null;
29863
+ }
29864
+ const content = readFileSync45(cachePath, "utf8");
29865
+ return parse3(content);
29866
+ }
29867
+ function deleteCommentsCache(org, repo, prNumber) {
29868
+ const cachePath = commentsCachePath(org, repo, prNumber);
29869
+ if (existsSync63(cachePath)) {
29870
+ unlinkSync13(cachePath);
29871
+ console.log("No more unresolved line comments. Cache dropped.");
29872
+ }
29873
+ }
29874
+
29963
29875
  // src/commands/prs/removeStaleCommentsCaches.ts
29964
29876
  import { readdirSync as readdirSync12, unlinkSync as unlinkSync14 } from "fs";
29965
29877
  import { join as join79 } from "path";
@@ -30197,6 +30109,110 @@ function printComments2(result) {
30197
30109
  }
30198
30110
  }
30199
30111
 
30112
+ // src/commands/prs/fixed.ts
30113
+ import { execSync as execSync41 } from "child_process";
30114
+
30115
+ // src/commands/prs/resolveCommentWithReply.ts
30116
+ import { execFileSync as execFileSync20 } from "child_process";
30117
+
30118
+ // src/commands/prs/replyToComment.ts
30119
+ import { spawnSync as spawnSync7 } from "child_process";
30120
+ function replyToComment(org, repo, prNumber, commentId, message3) {
30121
+ const result = spawnSync7(
30122
+ "gh",
30123
+ [
30124
+ "api",
30125
+ `repos/${org}/${repo}/pulls/${prNumber}/comments`,
30126
+ "-f",
30127
+ `body=${message3}`,
30128
+ "-F",
30129
+ `in_reply_to=${commentId}`
30130
+ ],
30131
+ { encoding: "utf8", windowsHide: true }
30132
+ );
30133
+ if (result.error) throw result.error;
30134
+ if (result.status !== 0) throw new Error(result.stderr || result.stdout);
30135
+ }
30136
+
30137
+ // src/commands/prs/resolveCommentWithReply.ts
30138
+ function resolveThread(threadId) {
30139
+ const mutation = `mutation($threadId: ID!) { resolveReviewThread(input: {threadId: $threadId}) { thread { isResolved } } }`;
30140
+ execFileSync20(
30141
+ "gh",
30142
+ ["api", "graphql", "-f", `query=${mutation}`, "-f", `threadId=${threadId}`],
30143
+ { stdio: ["inherit", "pipe", "inherit"] }
30144
+ );
30145
+ }
30146
+ function requireCache(org, repo, prNumber) {
30147
+ const cache7 = loadCommentsCache(org, repo, prNumber);
30148
+ if (!cache7) {
30149
+ console.error(
30150
+ `Error: No cached comments found for PR #${prNumber}. Run "assist prs list-comments" first.`
30151
+ );
30152
+ process.exit(1);
30153
+ }
30154
+ return cache7;
30155
+ }
30156
+ function findLineComment(comments3, commentId) {
30157
+ return comments3.find((c) => c.type === "line" && c.id === commentId);
30158
+ }
30159
+ function requireLineComment(cache7, commentId) {
30160
+ const comment3 = findLineComment(cache7.comments, commentId);
30161
+ if (!comment3 || comment3.type !== "line" || !comment3.threadId) {
30162
+ console.error(
30163
+ `Error: Comment #${commentId} not found or has no thread ID.`
30164
+ );
30165
+ process.exit(1);
30166
+ }
30167
+ return comment3;
30168
+ }
30169
+ function cleanupCacheIfDone(cache7, org, repo, prNumber, commentId) {
30170
+ const hasRemaining = cache7.comments.some(
30171
+ (c) => c.type === "line" && c.id !== commentId
30172
+ );
30173
+ if (!hasRemaining) deleteCommentsCache(org, repo, prNumber);
30174
+ }
30175
+ function resolveCommentWithReply(commentId, message3) {
30176
+ const prNumber = getCurrentPrNumber();
30177
+ const { org, repo } = getRepoInfo();
30178
+ const cache7 = requireCache(org, repo, prNumber);
30179
+ const comment3 = requireLineComment(cache7, commentId);
30180
+ replyToComment(org, repo, prNumber, commentId, message3);
30181
+ console.log("Reply posted successfully.");
30182
+ resolveThread(comment3.threadId);
30183
+ console.log("Thread resolved successfully.");
30184
+ cleanupCacheIfDone(cache7, org, repo, prNumber, commentId);
30185
+ }
30186
+
30187
+ // src/commands/prs/fixed.ts
30188
+ function verifySha(sha) {
30189
+ try {
30190
+ return execSync41(`git rev-parse --verify ${sha}`, {
30191
+ encoding: "utf8"
30192
+ }).trim();
30193
+ } catch {
30194
+ console.error(`Error: '${sha}' is not a valid commit in this repository.`);
30195
+ process.exit(1);
30196
+ }
30197
+ }
30198
+ function fixed(commentId, sha) {
30199
+ try {
30200
+ const fullSha = verifySha(sha);
30201
+ const { org, repo } = getRepoInfo();
30202
+ const repoUrl = `https://github.com/${org}/${repo}`;
30203
+ const message3 = `Fixed in [${fullSha}](${repoUrl}/commit/${fullSha})`;
30204
+ pushCommit(loadConfig().worktree?.trunk === true);
30205
+ resolveCommentWithReply(commentId, message3);
30206
+ } catch (error) {
30207
+ if (isGhNotInstalled(error)) {
30208
+ console.error("Error: GitHub CLI (gh) is not installed.");
30209
+ console.error("Install it from https://cli.github.com/");
30210
+ process.exit(1);
30211
+ }
30212
+ throw error;
30213
+ }
30214
+ }
30215
+
30200
30216
  // src/commands/prs/reply.ts
30201
30217
  function validateBody2(body) {
30202
30218
  const lowerBody = body.toLowerCase();
@@ -30273,39 +30289,60 @@ async function wontfix(commentId, reason4) {
30273
30289
  }
30274
30290
  }
30275
30291
 
30292
+ // src/commands/registerPrsThreadReplies.ts
30293
+ function registerPrsThreadReplies(prsCommand, calledBy3) {
30294
+ internalCommand(
30295
+ prsCommand.command("fixed <comment-id> <sha>").description("Reply with commit link and resolve thread").action((commentId, sha) => {
30296
+ fixed(Number.parseInt(commentId, 10), sha);
30297
+ }),
30298
+ calledBy3
30299
+ );
30300
+ internalCommand(
30301
+ prsCommand.command("wontfix <comment-id> <reason>").description(
30302
+ "Reply with reason and resolve thread (reason of - reads it from stdin)"
30303
+ ).action(async (commentId, reason4) => {
30304
+ await wontfix(
30305
+ Number.parseInt(commentId, 10),
30306
+ await readBodyArgument(reason4)
30307
+ );
30308
+ }),
30309
+ calledBy3
30310
+ );
30311
+ internalCommand(
30312
+ prsCommand.command("reply <comment-id> <body>").description(
30313
+ "Reply to a comment thread without resolving it (body of - reads it from stdin)"
30314
+ ).action(async (commentId, body) => {
30315
+ await reply(
30316
+ Number.parseInt(commentId, 10),
30317
+ await readBodyArgument(body)
30318
+ );
30319
+ }),
30320
+ calledBy3
30321
+ );
30322
+ }
30323
+
30276
30324
  // src/commands/registerPrsComments.ts
30325
+ var reviewComments = "/review-pr-comments";
30277
30326
  function registerPrsComments(prsCommand) {
30278
- prsCommand.command("list-comments").description("List all comments on the current branch's pull request").action(() => {
30279
- listComments().then(printComments2);
30280
- });
30281
- prsCommand.command("fixed <comment-id> <sha>").description("Reply with commit link and resolve thread").action((commentId, sha) => {
30282
- fixed(Number.parseInt(commentId, 10), sha);
30283
- });
30284
- prsCommand.command("wontfix <comment-id> <reason>").description(
30285
- "Reply with reason and resolve thread (reason of - reads it from stdin)"
30286
- ).action(async (commentId, reason4) => {
30287
- await wontfix(
30288
- Number.parseInt(commentId, 10),
30289
- await readBodyArgument(reason4)
30290
- );
30291
- });
30292
- prsCommand.command("reply <comment-id> <body>").description(
30293
- "Reply to a comment thread without resolving it (body of - reads it from stdin)"
30294
- ).action(async (commentId, body) => {
30295
- await reply(
30296
- Number.parseInt(commentId, 10),
30297
- await readBodyArgument(body)
30298
- );
30299
- });
30300
- prsCommand.command("comment <path> <line> <body>").description(
30301
- "Add a line comment to the pending review (body of - reads it from stdin)"
30302
- ).action(async (path108, line, body) => {
30303
- await comment2(
30304
- path108,
30305
- Number.parseInt(line, 10),
30306
- await readBodyArgument(body)
30307
- );
30308
- });
30327
+ internalCommand(
30328
+ prsCommand.command("list-comments").description("List all comments on the current branch's pull request").action(() => {
30329
+ listComments().then(printComments2);
30330
+ }),
30331
+ reviewComments
30332
+ );
30333
+ registerPrsThreadReplies(prsCommand, reviewComments);
30334
+ internalCommand(
30335
+ prsCommand.command("comment <path> <line> <body>").description(
30336
+ "Add a line comment to the pending review (body of - reads it from stdin)"
30337
+ ).action(async (path108, line, body) => {
30338
+ await comment2(
30339
+ path108,
30340
+ Number.parseInt(line, 10),
30341
+ await readBodyArgument(body)
30342
+ );
30343
+ }),
30344
+ "/comment and /forward-comments"
30345
+ );
30309
30346
  }
30310
30347
 
30311
30348
  // src/commands/prs/applyEdit.ts
@@ -30672,7 +30709,7 @@ function collect5(value, previous) {
30672
30709
  return previous.concat([value]);
30673
30710
  }
30674
30711
  function registerPrsEdit(prsCommand) {
30675
- prsCommand.command("edit").description(
30712
+ const editCommand = prsCommand.command("edit").description(
30676
30713
  "Update individual sections of the current branch's pull request"
30677
30714
  ).option("-t, --title <title>", "New title for the pull request").option("--what <what>", "Replace the ## What section").option("--why <why>", "Replace the ## Why section").option("--how <how>", "Replace the ## How section").option(
30678
30715
  "--resolves <ref>",
@@ -30685,6 +30722,7 @@ function registerPrsEdit(prsCommand) {
30685
30722
  collect5,
30686
30723
  []
30687
30724
  ).addHelpText("after", () => editHelpText()).action(edit);
30725
+ internalCommand(editCommand, "agents revising their pull request");
30688
30726
  }
30689
30727
 
30690
30728
  // src/commands/prs/buildValidatedBody.ts
@@ -31113,6 +31151,7 @@ function registerPrsRaise(prsCommand) {
31113
31151
  collect6,
31114
31152
  []
31115
31153
  ).option("-m, --milestone <name>", "Add the pull request to a milestone").addHelpText("after", () => raiseHelpText()).action(raise);
31154
+ internalCommand(raiseCommand, "/pr");
31116
31155
  configHelp(raiseCommand, prsRaiseConfigHelp);
31117
31156
  }
31118
31157
 
@@ -31440,12 +31479,18 @@ function prsStatus(repos2, options2) {
31440
31479
 
31441
31480
  // src/commands/registerPrsStatus.ts
31442
31481
  function registerPrsStatus(prsCommand) {
31443
- prsCommand.command("status <repo...>").description(
31444
- "Report every open pull request in each owner/repo, grouped by repo"
31445
- ).option("--json", "Output as JSON").action(prsStatus);
31446
- prsCommand.command("slack-channel").description(
31447
- "Print the Slack channel PRs are announced to (prs.slack, else slack.channel)"
31448
- ).action(prsSlackChannel);
31482
+ internalCommand(
31483
+ prsCommand.command("status <repo...>").description(
31484
+ "Report every open pull request in each owner/repo, grouped by repo"
31485
+ ).option("--json", "Output as JSON").action(prsStatus),
31486
+ "/prs-status"
31487
+ );
31488
+ internalCommand(
31489
+ prsCommand.command("slack-channel").description(
31490
+ "Print the Slack channel PRs are announced to (prs.slack, else slack.channel)"
31491
+ ).action(prsSlackChannel),
31492
+ "/prs-slack"
31493
+ );
31449
31494
  }
31450
31495
 
31451
31496
  // src/commands/readTime/readTime.ts
@@ -33106,6 +33151,7 @@ function registerNotify(program) {
33106
33151
  const notifyCommand = program.command("notify").description(
33107
33152
  "Show notification from Claude Code hook (reads JSON from stdin)"
33108
33153
  ).action(notify);
33154
+ internalCommand(notifyCommand, "the Notification hook");
33109
33155
  configHelp(notifyCommand, rootConfigHelp.notify);
33110
33156
  }
33111
33157
  function registerScreenshot(program) {
@@ -33116,7 +33162,10 @@ function registerRootCommands(program) {
33116
33162
  program.command("init").description("Initialize VS Code and verify configurations").action(init5);
33117
33163
  registerLint(program);
33118
33164
  registerVscode(program);
33119
- program.command("status-line").description("Format Claude Code status line from JSON stdin").action(statusLine);
33165
+ internalCommand(
33166
+ program.command("status-line").description("Format Claude Code status line from JSON stdin").action(statusLine),
33167
+ "Claude Code's status line"
33168
+ );
33120
33169
  registerNotify(program);
33121
33170
  program.command("update").description("Update assist to the latest version and sync commands").action(update2);
33122
33171
  program.command("coverage").description("Print global statement coverage percentage").action(coverage);
@@ -36377,10 +36426,10 @@ function toItem2(check2, decision) {
36377
36426
  };
36378
36427
  }
36379
36428
  function highLevelProgress(checks2, decision) {
36380
- const reviewComments = decision.reviewComments ?? [];
36429
+ const reviewComments2 = decision.reviewComments ?? [];
36381
36430
  return {
36382
36431
  items: checks2.map((check2) => toItem2(check2, decision)),
36383
- ...reviewComments.length > 0 ? { reviewComments } : {}
36432
+ ...reviewComments2.length > 0 ? { reviewComments: reviewComments2 } : {}
36384
36433
  };
36385
36434
  }
36386
36435
 
@@ -36518,13 +36567,13 @@ function formatItem(item) {
36518
36567
 
36519
36568
  ${item.comment}`;
36520
36569
  }
36521
- function formatHighLevelReviewBody(items2, reviewComments = []) {
36570
+ function formatHighLevelReviewBody(items2, reviewComments2 = []) {
36522
36571
  const sections = items2.map(formatItem).filter((section2) => section2 !== void 0);
36523
- if (reviewComments.length > 0)
36572
+ if (reviewComments2.length > 0)
36524
36573
  sections.push(
36525
36574
  `**Comments**
36526
36575
 
36527
- ${reviewComments.map(formatReviewComment).join("\n")}`
36576
+ ${reviewComments2.map(formatReviewComment).join("\n")}`
36528
36577
  );
36529
36578
  return sections.join("\n\n");
36530
36579
  }
@@ -39573,20 +39622,26 @@ function registerRules(program) {
39573
39622
  ).option("--full", "Show each rule's full description as well as its title").action(
39574
39623
  (target, options2) => listRules(target, options2)
39575
39624
  );
39576
- rulesCommand.command("add <text>").description(
39577
- "Add a rule to the `## Rules` section of the scope's CLAUDE.md, allocating the next repo-wide code and creating the section when absent"
39578
- ).option(
39579
- "--title <title>",
39580
- "As few words as possible summarising the rule, shown in the rule picker in place of the description"
39581
- ).option(
39582
- "--scope <path>",
39583
- "File or directory whose nearest CLAUDE.md receives the rule, or a CLAUDE.md path to write to directly (default: cwd)"
39584
- ).action(
39585
- (text17, options2) => addRule(text17, options2)
39625
+ internalCommand(
39626
+ rulesCommand.command("add <text>").description(
39627
+ "Add a rule to the `## Rules` section of the scope's CLAUDE.md, allocating the next repo-wide code and creating the section when absent"
39628
+ ).option(
39629
+ "--title <title>",
39630
+ "As few words as possible summarising the rule, shown in the rule picker in place of the description"
39631
+ ).option(
39632
+ "--scope <path>",
39633
+ "File or directory whose nearest CLAUDE.md receives the rule, or a CLAUDE.md path to write to directly (default: cwd)"
39634
+ ).action(
39635
+ (text17, options2) => addRule(text17, options2)
39636
+ ),
39637
+ "/add-rule and /fix-rules"
39638
+ );
39639
+ internalCommand(
39640
+ rulesCommand.command("index").description(
39641
+ "Record the directories that carry their own `## Rules` in the repo root's CLAUDE.md, so scoped rules are discoverable from the root. Always repo-wide, resolved from the cwd"
39642
+ ).action(() => indexRules()),
39643
+ "/fix-rules"
39586
39644
  );
39587
- rulesCommand.command("index").description(
39588
- "Record the directories that carry their own `## Rules` in the repo root's CLAUDE.md, so scoped rules are discoverable from the root. Always repo-wide, resolved from the cwd"
39589
- ).action(() => indexRules());
39590
39645
  }
39591
39646
 
39592
39647
  // src/commands/seq/seqAuth.ts
@@ -51655,20 +51710,20 @@ async function nodeLogs(name, options2) {
51655
51710
  }
51656
51711
 
51657
51712
  // src/commands/sessions/nodes/registerDiagnoseCommands.ts
51658
- function registerDiagnoseCommands(nodes, calledBy2) {
51713
+ function registerDiagnoseCommands(nodes, calledBy3) {
51659
51714
  internalCommand(
51660
51715
  nodes.command("doctor [name]").description(
51661
51716
  "Probe each hop of every link (or one) in order and stop at the first failure with a remediation"
51662
51717
  ).option("--json", "Output as JSON").action(
51663
51718
  (name, _options, command) => doctorNodes(name, command.optsWithGlobals())
51664
51719
  ),
51665
- calledBy2
51720
+ calledBy3
51666
51721
  );
51667
51722
  internalCommand(
51668
51723
  nodes.command("logs <name>").description("Tail a linked node's daemon.log through its web server").option("-n, --lines <lines>", "Number of lines", "200").option("--json", "Output as JSON").action(
51669
51724
  (name, _options, command) => nodeLogs(name, command.optsWithGlobals())
51670
51725
  ),
51671
- calledBy2
51726
+ calledBy3
51672
51727
  );
51673
51728
  }
51674
51729
 
@@ -51946,18 +52001,18 @@ async function updateNode(name) {
51946
52001
  }
51947
52002
 
51948
52003
  // src/commands/sessions/nodes/registerPeerActionCommands.ts
51949
- function registerPeerActionCommands(nodes, calledBy2) {
52004
+ function registerPeerActionCommands(nodes, calledBy3) {
51950
52005
  internalCommand(
51951
52006
  nodes.command("restart <name>").description(
51952
52007
  "Restart a linked node's daemon and/or web server, wait for its link to reconnect and print its version"
51953
52008
  ).option("--target <target>", "daemon, webserver or both", "both").action(restartNode),
51954
- calledBy2
52009
+ calledBy3
51955
52010
  );
51956
52011
  internalCommand(
51957
52012
  nodes.command("update <name>").description(
51958
52013
  "Run assist update on a linked node, restart it, wait for its link to reconnect and print its version"
51959
52014
  ).action((name) => updateNode(name)),
51960
- calledBy2
52015
+ calledBy3
51961
52016
  );
51962
52017
  }
51963
52018
 
@@ -51976,19 +52031,19 @@ async function unlinkNode(name) {
51976
52031
  }
51977
52032
 
51978
52033
  // src/commands/sessions/nodes/registerNodes.ts
51979
- var calledBy = "agents managing linked nodes";
52034
+ var calledBy2 = "agents managing linked nodes";
51980
52035
  function registerNodes(sessions) {
51981
52036
  const cmd = internalCommand(
51982
52037
  sessions.command("nodes").description("List this node and every linked node with its link state").option("--json", "Output as JSON").action(listNodes),
51983
- calledBy
52038
+ calledBy2
51984
52039
  );
51985
- internalCommand(registerLinkCommand(cmd), calledBy);
52040
+ internalCommand(registerLinkCommand(cmd), calledBy2);
51986
52041
  internalCommand(
51987
52042
  cmd.command("unlink <name>").description("Remove a linked node").action(unlinkNode),
51988
- calledBy
52043
+ calledBy2
51989
52044
  );
51990
- registerDiagnoseCommands(cmd, calledBy);
51991
- registerPeerActionCommands(cmd, calledBy);
52045
+ registerDiagnoseCommands(cmd, calledBy2);
52046
+ registerPeerActionCommands(cmd, calledBy2);
51992
52047
  configHelp(cmd, nodesConfigHelp);
51993
52048
  }
51994
52049