@staff0rd/assist 0.614.0 → 0.615.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.614.0",
9
+ version: "0.615.1",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -16898,10 +16898,26 @@ function matchesConfigDeny(command) {
16898
16898
 
16899
16899
  // src/commands/cliHook/findTruncatedReadDeny.ts
16900
16900
  var UNTRUNCATABLE_READS = ["assist backlog show", "assist backlog view"];
16901
+ var APPROVAL_GATED_COMMANDS = [
16902
+ "assist backlog propose",
16903
+ "assist backlog comment",
16904
+ "assist backlog update-plan",
16905
+ "assist backlog add-phase",
16906
+ "assist github issue create",
16907
+ "assist github issue edit",
16908
+ "assist github issue comment",
16909
+ "assist slack post",
16910
+ "assist prs raise",
16911
+ "assist prs edit",
16912
+ "assist prs comment",
16913
+ "assist prs reply",
16914
+ "assist prs wontfix",
16915
+ "assist miro extract"
16916
+ ];
16901
16917
  var TRUNCATOR_BINARIES = ["head", "tail"];
16902
16918
  var PIPED_TRUNCATOR_RE = /\|\s*(?:\S*\/)?(?:head|tail)\b/;
16903
- function matchUntruncatableRead(part) {
16904
- return UNTRUNCATABLE_READS.find(
16919
+ function matchPrefix(prefixes, part) {
16920
+ return prefixes.find(
16905
16921
  (prefix2) => part === prefix2 || part.startsWith(`${prefix2} `)
16906
16922
  );
16907
16923
  }
@@ -16910,11 +16926,18 @@ function isTruncator(part) {
16910
16926
  return TRUNCATOR_BINARIES.includes(binary) || PIPED_TRUNCATOR_RE.test(part);
16911
16927
  }
16912
16928
  function findTruncatedReadDeny(parts) {
16913
- const read3 = parts.map(matchUntruncatableRead).find(Boolean);
16914
- if (!read3 || !parts.some(isTruncator)) return void 0;
16929
+ const read3 = parts.map((part) => matchPrefix(UNTRUNCATABLE_READS, part)).find(Boolean);
16930
+ const gated = parts.map((part) => matchPrefix(APPROVAL_GATED_COMMANDS, part)).find(Boolean);
16931
+ if (!read3 && !gated) return void 0;
16932
+ if (!parts.some(isTruncator)) return void 0;
16933
+ if (read3)
16934
+ return {
16935
+ permissionDecision: "deny",
16936
+ permissionDecisionReason: `Do not pipe '${read3}' through head or tail. Plan, Activity and Comments print at the end of the output, so a truncated read drops them and leaves you assuming the item has none. Run '${read3} <id>' bare and read all of it, or use a focused view: 'assist backlog comments <id>' for comments only.`
16937
+ };
16915
16938
  return {
16916
16939
  permissionDecision: "deny",
16917
- permissionDecisionReason: `Do not pipe '${read3}' through head or tail. Plan, Activity and Comments print at the end of the output, so a truncated read drops them and leaves you assuming the item has none. Run '${read3} <id>' bare and read all of it, or use a focused view: 'assist backlog comments <id>' for comments only.`
16940
+ permissionDecisionReason: `Do not pipe '${gated}' through head or tail. It gates on a preview the reviewer can reject with inline comments, and those comments print at the end of the output. Nothing persists them, so a truncated read discards the reviewer's feedback for good and they have to retype it. Run '${gated}' bare and read all of it.`
16918
16941
  };
16919
16942
  }
16920
16943
 
@@ -21762,6 +21785,16 @@ function collectLabels(value, previous) {
21762
21785
  return [...previous, ...added];
21763
21786
  }
21764
21787
 
21788
+ // src/commands/prs/appendScreenshots.ts
21789
+ function appendScreenshots(body, screenshots) {
21790
+ if (screenshots.length === 0) return body;
21791
+ return `${body}
21792
+
21793
+ ## Screenshots
21794
+
21795
+ ${screenshots.join("\n\n")}`;
21796
+ }
21797
+
21765
21798
  // src/commands/github/issue/addIssueToProject.ts
21766
21799
  var MUTATION3 = `mutation($projectId: ID!, $contentId: ID!) {
21767
21800
  addProjectV2ItemById(input: { projectId: $projectId, contentId: $contentId }) {
@@ -22179,8 +22212,8 @@ function resolveCreateIssueMetadata(options2) {
22179
22212
  import { randomUUID as randomUUID8 } from "crypto";
22180
22213
  async function reviewProposedIssue(title, body, metadata2 = []) {
22181
22214
  const sessionId = process.env.ASSIST_SESSION_ID;
22182
- if (process.env.ASSIST_SESSION !== "1" || !sessionId) return;
22183
- await awaitPreviewApproval("GitHub issue preview", {
22215
+ if (process.env.ASSIST_SESSION !== "1" || !sessionId) return void 0;
22216
+ return await awaitPreviewApproval("GitHub issue preview", {
22184
22217
  sessionId,
22185
22218
  requestId: randomUUID8(),
22186
22219
  title,
@@ -22229,8 +22262,17 @@ async function createIssue(options2) {
22229
22262
  body
22230
22263
  );
22231
22264
  const resolved = preflight(options2);
22232
- await reviewProposedIssue(title, body, issuePreviewMetadata(resolved));
22233
- const output = runGhIssueCreate(title, body, options2.repo, resolved?.labels);
22265
+ const decision = await reviewProposedIssue(
22266
+ title,
22267
+ body,
22268
+ issuePreviewMetadata(resolved)
22269
+ );
22270
+ const output = runGhIssueCreate(
22271
+ title,
22272
+ appendScreenshots(body, decision?.screenshots ?? []),
22273
+ options2.repo,
22274
+ resolved?.labels
22275
+ );
22234
22276
  console.log(output.trim());
22235
22277
  if (resolved) applyCreatedIssueMetadata(output, resolved);
22236
22278
  }
@@ -25178,16 +25220,6 @@ async function comment2(path90, line, body, startLine) {
25178
25220
  // src/commands/prs/edit.ts
25179
25221
  import { randomUUID as randomUUID14 } from "crypto";
25180
25222
 
25181
- // src/commands/prs/appendScreenshots.ts
25182
- function appendScreenshots(body, screenshots) {
25183
- if (screenshots.length === 0) return body;
25184
- return `${body}
25185
-
25186
- ## Screenshots
25187
-
25188
- ${screenshots.join("\n\n")}`;
25189
- }
25190
-
25191
25223
  // src/commands/prs/applyEdit.ts
25192
25224
  import { execFileSync as execFileSync13 } from "child_process";
25193
25225
  function applyEdit(number, title, body) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.614.0",
3
+ "version": "0.615.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {