@staff0rd/assist 0.615.0 → 0.615.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/commands/sessions/web/bundle.js +183 -183
- package/dist/index.js +29 -6
- package/package.json +1 -1
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.615.
|
|
9
|
+
version: "0.615.2",
|
|
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
|
|
16904
|
-
return
|
|
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(
|
|
16914
|
-
|
|
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 '${
|
|
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
|
|