@staff0rd/assist 0.804.0 → 0.806.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.804.0",
9
+ version: "0.806.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -18974,7 +18974,7 @@ var PATTERN_DENIES = [
18974
18974
  },
18975
18975
  {
18976
18976
  pattern: "gh issue edit",
18977
- message: "Do not run 'gh issue edit' directly. Use 'assist github issue edit <number> [-R <owner>/<repo>]' instead \u2014 it fetches the issue's current body, opens it in the assist web preview pane, and pushes nothing back until the user approves it. Run 'assist github issue edit --help' for how the working file and the preview pane fit together; it is authoritative on how approval is handled in this environment."
18977
+ message: "Do not run 'gh issue edit' directly. Use 'assist github issue edit <number> [-R <owner>/<repo>] [--body <body>]' instead \u2014 it opens the body in the assist web preview pane and pushes nothing back until the user approves it. When you already know the body you want, pass it with --body (--body - reads stdin) so the first preview shows your proposal; without --body the pane shows the issue's current body. Run 'assist github issue edit --help' for how the working file and the preview pane fit together; it is authoritative on how approval is handled in this environment."
18978
18978
  },
18979
18979
  {
18980
18980
  pattern: "gh issue comment",
@@ -25834,12 +25834,12 @@ function slugFromUrl(url) {
25834
25834
  const match = /github\.com\/([^/]+\/[^/]+)\//.exec(url ?? "");
25835
25835
  return match ? match[1] : "unknown/unknown";
25836
25836
  }
25837
- function prepareIssueEdit(number, repo, fresh) {
25837
+ function prepareIssueEdit(number, repo, fresh, proposed) {
25838
25838
  const issue = fetchIssue2(number, repo);
25839
25839
  const slug2 = repo ?? slugFromUrl(issue.url);
25840
25840
  const target = `${slug2}#${number}`;
25841
- const resumed = fresh ? void 0 : resumeIssueBody(slug2, number, issue.updatedAt);
25842
- const body = resumed ?? issue.body;
25841
+ const resumed = proposed !== void 0 || fresh ? void 0 : resumeIssueBody(slug2, number, issue.updatedAt);
25842
+ const body = proposed ?? resumed ?? issue.body;
25843
25843
  validateIssueBody(issue.title, body);
25844
25844
  const save = (markdown) => writeIssueWorkingFile(slug2, number, target, issue.updatedAt, markdown);
25845
25845
  const bodyPath = save(body);
@@ -25933,7 +25933,7 @@ function viewIssue(number, repo) {
25933
25933
  }
25934
25934
 
25935
25935
  // src/commands/github/issue/editIssue.ts
25936
- var USAGE3 = "Usage: assist github issue edit <number> [-R <owner>/<repo>] [--parent <issue>]";
25936
+ var USAGE3 = "Usage: assist github issue edit <number> [-R <owner>/<repo>] [--body <body>] [--parent <issue>]";
25937
25937
  async function editIssue(numberArg, options2) {
25938
25938
  const number = Number.parseInt(numberArg, 10);
25939
25939
  if (!Number.isInteger(number) || number <= 0) {
@@ -25948,7 +25948,8 @@ async function editIssue(numberArg, options2) {
25948
25948
  viewIssue(number, options2.repo);
25949
25949
  return;
25950
25950
  }
25951
- const issue = prepareIssueEdit(number, options2.repo, options2.fresh);
25951
+ const proposed = options2.body ? await readBodyArgument(options2.body) : void 0;
25952
+ const issue = prepareIssueEdit(number, options2.repo, options2.fresh, proposed);
25952
25953
  const edited = await reviewProposedIssueEdit(
25953
25954
  `Edit ${issue.target}: ${issue.title}`,
25954
25955
  issue.body,
@@ -25969,6 +25970,9 @@ function registerEditIssue(issueCommand) {
25969
25970
  issueCommand.command("edit <number>").description("Edit an existing GitHub issue's body in the preview pane").option(
25970
25971
  "-R, --repo <owner/repo>",
25971
25972
  "Target repository (defaults to the current repo)"
25973
+ ).option(
25974
+ "--body <body>",
25975
+ "Proposed replacement body to preview instead of the current one (- reads it from stdin)"
25972
25976
  ).option(
25973
25977
  "--fresh",
25974
25978
  "Discard any working file for the issue and re-fetch its body from GitHub"
@@ -25977,7 +25981,7 @@ function registerEditIssue(issueCommand) {
25977
25981
  "Make the issue a sub-issue of this one, as owner/repo#number, a github.com issue URL, or a bare number"
25978
25982
  ).addHelpText(
25979
25983
  "after",
25980
- "\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. Approving 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."
25984
+ "\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. Approving 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."
25981
25985
  ).action(editIssue);
25982
25986
  }
25983
25987
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.804.0",
3
+ "version": "0.806.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {