@hasna/hooks 0.12.6 → 0.12.8
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/README.md +10 -4
- package/bin/hooks-mcp.js +3666 -1268
- package/bin/index.js +4104 -1723
- package/bin/native-safety-entry.js +25 -20
- package/bin/native-safety-worker.cjs +25 -20
- package/bin/serve.js +2 -2
- package/dist/index.js +3936 -1522
- package/dist/lib/claude-skills-coordination.d.ts +16 -2
- package/dist/lib/codex-safety-check.d.ts +1 -1
- package/dist/lib/installer.d.ts +11 -0
- package/dist/lib/native-safety-registration.d.ts +8 -3
- package/hooks/hook-trash-guard/README.md +49 -15
- package/hooks/hook-trash-guard/src/hook.ts +741 -125
- package/hooks/hook-workspace-repos-guard/src/hook.ts +274 -79
- package/hooks/shell-words.ts +368 -0
- package/package.json +2 -2
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How bash turns the words of a command into other words, read the same way
|
|
3
|
+
* by workspace-repos-guard and trash-guard:
|
|
4
|
+
* - splitsOrMoves and expandBraces: brace expansion and named tilde prefixes,
|
|
5
|
+
* which make one written word several words or another path;
|
|
6
|
+
* - unwrapCommand: the strict wrapper model. Wrapper commands (timeout, env,
|
|
7
|
+
* nice, nohup, command, exec, builtin, stdbuf, time, ionice, setsid) run the
|
|
8
|
+
* command after their own options and arguments, read the way GNU getopt,
|
|
9
|
+
* util-linux and bash read them: option clusters, attached values and unique
|
|
10
|
+
* long-option abbreviations. Arguments it cannot read fail closed (null), so
|
|
11
|
+
* a caller keeps its more conservative reading.
|
|
12
|
+
*
|
|
13
|
+
* Pure: no I/O, no imports. Both guards and the native safety bundles import
|
|
14
|
+
* it, so one model decides for all of them.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export interface ShellWord {
|
|
18
|
+
text: string;
|
|
19
|
+
opaque: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*\+?=/;
|
|
23
|
+
|
|
24
|
+
export const baseName = (word: string): string => word.split("/").pop() ?? "";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Whether bash turns this raw word into several words or another path by an
|
|
28
|
+
* expansion the `$`, backtick, glob and parenthesis tests do not see:
|
|
29
|
+
* - an unquoted `{` or `}` outside a `${...}` parameter expansion. Brace
|
|
30
|
+
* expansion makes `{a,build}`, `a{,/../build}` and `{a..c}` several words;
|
|
31
|
+
* `{}` and `{a}` stay literal in bash, but are read as opaque here too.
|
|
32
|
+
* - a tilde prefix naming a user or the directory stack (`~root/x`, `~+`,
|
|
33
|
+
* `~-`), which bash replaces with that home or directory. A prefix holding a
|
|
34
|
+
* quote or a backslash stays literal, as in bash.
|
|
35
|
+
*/
|
|
36
|
+
export function splitsOrMoves(raw: string): boolean {
|
|
37
|
+
const prefix = raw.startsWith("~") ? raw.slice(1).split("/", 1)[0] : "";
|
|
38
|
+
if (prefix && !/['"\\]/.test(prefix)) return true;
|
|
39
|
+
let quote: "'" | '"' | null = null;
|
|
40
|
+
let parameter = 0;
|
|
41
|
+
for (let i = 0; i < raw.length; i++) {
|
|
42
|
+
const ch = raw[i];
|
|
43
|
+
if (quote === "'") {
|
|
44
|
+
if (ch === "'") quote = null;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (ch === "\\") {
|
|
48
|
+
i++;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (quote === '"') {
|
|
52
|
+
if (ch === '"') quote = null;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (ch === "'" || ch === '"') quote = ch;
|
|
56
|
+
else if (ch === "$" && raw[i + 1] === "{") {
|
|
57
|
+
parameter++;
|
|
58
|
+
i++;
|
|
59
|
+
} else if (ch === "}" && parameter > 0) parameter--;
|
|
60
|
+
else if (ch === "{" || ch === "}") return true;
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** The most words one brace-expanded word may become before the reading fails closed. */
|
|
66
|
+
const BRACE_LIMIT = 64;
|
|
67
|
+
|
|
68
|
+
/** Index of the `}` closing the parameter expansion whose `{` is at `open`, or the last index. */
|
|
69
|
+
function parameterEnd(raw: string, open: number): number {
|
|
70
|
+
let depth = 0;
|
|
71
|
+
for (let i = open; i < raw.length; i++) {
|
|
72
|
+
if (raw[i] === "\\") i++;
|
|
73
|
+
else if (raw[i] === "{") depth++;
|
|
74
|
+
else if (raw[i] === "}" && --depth === 0) return i;
|
|
75
|
+
}
|
|
76
|
+
return raw.length - 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** A sequence expression's words (`1..5`, `05..10..2`, `a..e`), "overflow" past BRACE_LIMIT, or null. */
|
|
80
|
+
function braceSequence(body: string): string[] | "overflow" | null {
|
|
81
|
+
const numeric = body.match(/^([-+]?\d+)\.\.([-+]?\d+)(?:\.\.([-+]?\d+))?$/);
|
|
82
|
+
const letters = numeric ? null : body.match(/^([A-Za-z])\.\.([A-Za-z])(?:\.\.([-+]?\d+))?$/);
|
|
83
|
+
const match = numeric ?? letters;
|
|
84
|
+
if (!match) return null;
|
|
85
|
+
const from = numeric ? Number(match[1]) : match[1].charCodeAt(0);
|
|
86
|
+
const to = numeric ? Number(match[2]) : match[2].charCodeAt(0);
|
|
87
|
+
const step = Math.abs(Number(match[3] ?? 1)) || 1;
|
|
88
|
+
if (!Number.isSafeInteger(from) || !Number.isSafeInteger(to) || !Number.isSafeInteger(step)) return "overflow";
|
|
89
|
+
if (Math.floor(Math.abs(to - from) / step) + 1 > BRACE_LIMIT) return "overflow";
|
|
90
|
+
const width = numeric && (/^[-+]?0\d/.test(match[1]) || /^[-+]?0\d/.test(match[2])) ? Math.max(match[1].length, match[2].length) : 0;
|
|
91
|
+
const words: string[] = [];
|
|
92
|
+
for (let value = from; from <= to ? value <= to : value >= to; value += from <= to ? step : -step) {
|
|
93
|
+
if (!numeric) words.push(String.fromCharCode(value));
|
|
94
|
+
else words.push(value < 0 ? `-${String(-value).padStart(width - 1, "0")}` : String(value).padStart(width, "0"));
|
|
95
|
+
}
|
|
96
|
+
return words;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The first brace expression in a raw word: an unquoted `{` and its matching
|
|
101
|
+
* `}` around an unquoted top-level `,`, or around a sequence expression.
|
|
102
|
+
* `${` starts a parameter expansion, not a brace expression, and a `{` that
|
|
103
|
+
* starts neither stays literal, as in bash. More than BRACE_LIMIT candidate
|
|
104
|
+
* `{` is "overflow", which keeps the scan linear-bounded: a guard that runs
|
|
105
|
+
* past its timeout lets the command through.
|
|
106
|
+
*/
|
|
107
|
+
function braceExpression(raw: string): { open: number; close: number; parts: string[] } | "overflow" | null {
|
|
108
|
+
let quote: "'" | '"' | null = null;
|
|
109
|
+
let candidates = 0;
|
|
110
|
+
for (let open = 0; open < raw.length; open++) {
|
|
111
|
+
const ch = raw[open];
|
|
112
|
+
if (quote === "'") {
|
|
113
|
+
if (ch === "'") quote = null;
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
if (ch === "\\") {
|
|
117
|
+
open++;
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (quote === '"') {
|
|
121
|
+
if (ch === '"') quote = null;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (ch === "'" || ch === '"') quote = ch;
|
|
125
|
+
else if (ch === "$" && raw[open + 1] === "{") open = parameterEnd(raw, open + 1);
|
|
126
|
+
else if (ch === "{") {
|
|
127
|
+
if (++candidates > BRACE_LIMIT) return "overflow";
|
|
128
|
+
let inner: "'" | '"' | null = null;
|
|
129
|
+
let depth = 0;
|
|
130
|
+
let plain = true;
|
|
131
|
+
const commas: number[] = [];
|
|
132
|
+
for (let i = open; i < raw.length; i++) {
|
|
133
|
+
const c = raw[i];
|
|
134
|
+
if (inner === "'") {
|
|
135
|
+
if (c === "'") inner = null;
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (c === "\\") {
|
|
139
|
+
plain = false;
|
|
140
|
+
i++;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (inner === '"') {
|
|
144
|
+
if (c === '"') inner = null;
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
if (c === "'" || c === '"') {
|
|
148
|
+
inner = c;
|
|
149
|
+
plain = false;
|
|
150
|
+
} else if (c === "$" && raw[i + 1] === "{") {
|
|
151
|
+
i = parameterEnd(raw, i + 1);
|
|
152
|
+
plain = false;
|
|
153
|
+
} else if (c === "{") depth++;
|
|
154
|
+
else if (c === "," && depth === 1) commas.push(i);
|
|
155
|
+
else if (c === "}" && --depth === 0) {
|
|
156
|
+
if (commas.length > 0) {
|
|
157
|
+
const bounds = [open, ...commas, i];
|
|
158
|
+
return { open, close: i, parts: bounds.slice(0, -1).map((at, k) => raw.slice(at + 1, bounds[k + 1])) };
|
|
159
|
+
}
|
|
160
|
+
const parts = plain ? braceSequence(raw.slice(open + 1, i)) : null;
|
|
161
|
+
if (parts === "overflow") return parts;
|
|
162
|
+
if (parts) return { open, close: i, parts };
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Bash brace expansion of one raw word, quotes kept: the first brace
|
|
173
|
+
* expression expanded, then each result expanded again. Null when the word
|
|
174
|
+
* would become more than BRACE_LIMIT words, or is longer than 4096
|
|
175
|
+
* characters and holds a `{`: each expansion copies the word, and a guard
|
|
176
|
+
* that runs past its timeout lets the command through.
|
|
177
|
+
*/
|
|
178
|
+
export function expandBraces(raw: string): string[] | null {
|
|
179
|
+
if (raw.length > 4096 && raw.includes("{")) return null;
|
|
180
|
+
const found = braceExpression(raw);
|
|
181
|
+
if (found === null) return [raw];
|
|
182
|
+
if (found === "overflow") return null;
|
|
183
|
+
const words: string[] = [];
|
|
184
|
+
for (const part of found.parts) {
|
|
185
|
+
const more = expandBraces(raw.slice(0, found.open) + part + raw.slice(found.close + 1));
|
|
186
|
+
if (more === null || words.push(...more) > BRACE_LIMIT) return null;
|
|
187
|
+
}
|
|
188
|
+
return words;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface WrapperOption {
|
|
192
|
+
/** "none": a flag; "value": a value attached, after `=` or as the next word; "optional": a value only after `=`. */
|
|
193
|
+
arg: "none" | "value" | "optional";
|
|
194
|
+
/** "lookup": the wrapper runs no command (`command -v`); "refuse": not modelled, the reading fails closed. */
|
|
195
|
+
effect?: "lookup" | "refuse";
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface WrapperSpec {
|
|
199
|
+
short: Record<string, WrapperOption>;
|
|
200
|
+
long: Record<string, WrapperOption>;
|
|
201
|
+
/** Positional words between the options and the command, each with its accepted form (timeout's DURATION). */
|
|
202
|
+
positionals?: RegExp[];
|
|
203
|
+
/** env: `NAME=VALUE` words between the options and the command, and a lone `-` meaning -i. */
|
|
204
|
+
env?: boolean;
|
|
205
|
+
/** nice: the legacy `-N` adjustment. */
|
|
206
|
+
numericOption?: boolean;
|
|
207
|
+
/** sudo: `NAME=VALUE` words between the options and the command. */
|
|
208
|
+
assignments?: boolean;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export const FLAG: WrapperOption = { arg: "none" };
|
|
212
|
+
export const VALUE: WrapperOption = { arg: "value" };
|
|
213
|
+
export const OPTIONAL: WrapperOption = { arg: "optional" };
|
|
214
|
+
export const LOOKUP: WrapperOption = { arg: "none", effect: "lookup" };
|
|
215
|
+
// Help and version print and run nothing; a working directory (`env -C`), a
|
|
216
|
+
// split string (`env -S`), an output file (`time -o`) and a process target
|
|
217
|
+
// (`ionice -p`) change what the command acts on. None is modelled: the
|
|
218
|
+
// command keeps the reading it had without this model.
|
|
219
|
+
export const REFUSE: WrapperOption = { arg: "none", effect: "refuse" };
|
|
220
|
+
export const HELP_LONG = { help: REFUSE, version: REFUSE };
|
|
221
|
+
|
|
222
|
+
/** timeout's DURATION: a decimal number with an optional unit. Other strtod forms fail closed. */
|
|
223
|
+
const DURATION = /^(?:\d+(?:\.\d*)?|\.\d+)[smhd]?$/;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Wrapper commands that run the command after their own options, modelled as
|
|
227
|
+
* GNU coreutils, util-linux and bash parse them: options end at the first
|
|
228
|
+
* non-option word or `--`, a short option cluster may end in a value-taking
|
|
229
|
+
* option whose value is the rest of the word or the next word, and a long
|
|
230
|
+
* option may be abbreviated to a unique prefix. The option lists are
|
|
231
|
+
* complete, so an abbreviation that is unique here is unique in the tool.
|
|
232
|
+
* sudo and doas are not modelled: their own options are richer, and the
|
|
233
|
+
* shared command-position walk keeps reading them.
|
|
234
|
+
*/
|
|
235
|
+
export const WRAPPER_SPECS: Record<string, WrapperSpec> = {
|
|
236
|
+
timeout: {
|
|
237
|
+
short: { k: VALUE, s: VALUE, v: FLAG },
|
|
238
|
+
long: { "kill-after": VALUE, signal: VALUE, verbose: FLAG, foreground: FLAG, "preserve-status": FLAG, ...HELP_LONG },
|
|
239
|
+
positionals: [DURATION],
|
|
240
|
+
},
|
|
241
|
+
env: {
|
|
242
|
+
short: { i: FLAG, "0": FLAG, v: FLAG, u: VALUE, a: VALUE, C: REFUSE, S: REFUSE },
|
|
243
|
+
long: {
|
|
244
|
+
"ignore-environment": FLAG, null: FLAG, debug: FLAG, unset: VALUE, argv0: VALUE, chdir: REFUSE, "split-string": REFUSE,
|
|
245
|
+
"block-signal": OPTIONAL, "default-signal": OPTIONAL, "ignore-signal": OPTIONAL, "list-signal-handling": REFUSE, ...HELP_LONG,
|
|
246
|
+
},
|
|
247
|
+
env: true,
|
|
248
|
+
},
|
|
249
|
+
nice: { short: { n: VALUE }, long: { adjustment: VALUE, ...HELP_LONG }, numericOption: true },
|
|
250
|
+
nohup: { short: {}, long: { ...HELP_LONG } },
|
|
251
|
+
command: { short: { p: FLAG, v: LOOKUP, V: LOOKUP }, long: {} },
|
|
252
|
+
exec: { short: { c: FLAG, l: FLAG, a: VALUE }, long: {} },
|
|
253
|
+
builtin: { short: {}, long: {} },
|
|
254
|
+
stdbuf: { short: { i: VALUE, o: VALUE, e: VALUE }, long: { input: VALUE, output: VALUE, error: VALUE, ...HELP_LONG } },
|
|
255
|
+
time: {
|
|
256
|
+
short: { p: FLAG, a: FLAG, q: FLAG, v: FLAG, f: VALUE, o: REFUSE, V: REFUSE },
|
|
257
|
+
long: { portability: FLAG, append: FLAG, quiet: FLAG, verbose: FLAG, format: VALUE, output: REFUSE, ...HELP_LONG },
|
|
258
|
+
},
|
|
259
|
+
ionice: {
|
|
260
|
+
short: { c: VALUE, n: VALUE, t: FLAG, p: REFUSE, P: REFUSE, u: REFUSE, h: REFUSE, V: REFUSE },
|
|
261
|
+
long: { class: VALUE, classdata: VALUE, ignore: FLAG, pid: REFUSE, pgid: REFUSE, uid: REFUSE, ...HELP_LONG },
|
|
262
|
+
},
|
|
263
|
+
setsid: { short: { c: FLAG, f: FLAG, w: FLAG, h: REFUSE, V: REFUSE }, long: { ctty: FLAG, fork: FLAG, wait: FLAG, ...HELP_LONG } },
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
/** Shell reserved words that may precede the command word. */
|
|
267
|
+
const RESERVED_WORDS = new Set(["!", "{", "}", "then", "do", "else", "elif", "if", "while", "until", "for", "case", "esac", "fi", "done", "select", "function"]);
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* The words of one wrapper's own arguments, from `at` (the word after the
|
|
271
|
+
* wrapper's name): the index of the next word, -1 when the wrapper runs no
|
|
272
|
+
* command, or null when the arguments cannot be parsed. A word built from an
|
|
273
|
+
* expansion is never parsed: it may become several words or none.
|
|
274
|
+
*/
|
|
275
|
+
function skipWrapperArguments(spec: WrapperSpec, words: ShellWord[], at: number): number | null {
|
|
276
|
+
let lookup = false;
|
|
277
|
+
const apply = (option: WrapperOption | undefined): boolean => {
|
|
278
|
+
if (!option || option.effect === "refuse") return false;
|
|
279
|
+
if (option.effect === "lookup") lookup = true;
|
|
280
|
+
return true;
|
|
281
|
+
};
|
|
282
|
+
while (at < words.length) {
|
|
283
|
+
const word = words[at];
|
|
284
|
+
if (word.opaque) return null;
|
|
285
|
+
const text = word.text;
|
|
286
|
+
if (text === "--") {
|
|
287
|
+
at++;
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
if (text === "-" && spec.env) {
|
|
291
|
+
at++;
|
|
292
|
+
continue;
|
|
293
|
+
}
|
|
294
|
+
if (!text.startsWith("-") || text === "-") break;
|
|
295
|
+
if (spec.numericOption && /^-[-+]?\d+$/.test(text)) {
|
|
296
|
+
at++;
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
if (text.startsWith("--")) {
|
|
300
|
+
const eq = text.indexOf("=");
|
|
301
|
+
const name = eq < 0 ? text.slice(2) : text.slice(2, eq);
|
|
302
|
+
const names = Object.keys(spec.long);
|
|
303
|
+
const matches = names.includes(name) ? [name] : names.filter((candidate) => name && candidate.startsWith(name));
|
|
304
|
+
if (matches.length !== 1) return null;
|
|
305
|
+
const option = spec.long[matches[0]];
|
|
306
|
+
if (!apply(option)) return null;
|
|
307
|
+
if (option.arg === "none" && eq >= 0) return null;
|
|
308
|
+
if (option.arg === "value" && eq < 0) {
|
|
309
|
+
const value = words[++at];
|
|
310
|
+
if (!value || value.opaque) return null;
|
|
311
|
+
}
|
|
312
|
+
at++;
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
for (let i = 1; i < text.length; i++) {
|
|
316
|
+
const option = spec.short[text[i]];
|
|
317
|
+
if (!apply(option)) return null;
|
|
318
|
+
if (option.arg === "value") {
|
|
319
|
+
if (i === text.length - 1) {
|
|
320
|
+
const value = words[++at];
|
|
321
|
+
if (!value || value.opaque) return null;
|
|
322
|
+
}
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
at++;
|
|
327
|
+
}
|
|
328
|
+
if (lookup) return -1;
|
|
329
|
+
for (const pattern of spec.positionals ?? []) {
|
|
330
|
+
const word = words[at];
|
|
331
|
+
if (!word || word.opaque || !pattern.test(word.text)) return null;
|
|
332
|
+
at++;
|
|
333
|
+
}
|
|
334
|
+
if (spec.env || spec.assignments) {
|
|
335
|
+
for (; at < words.length && ASSIGNMENT.test(words[at].text); at++) {
|
|
336
|
+
// env's own arguments are split and globbed: unlike a shell
|
|
337
|
+
// assignment, an expansion here can become several words.
|
|
338
|
+
if (words[at].opaque) return null;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return at;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Index of the command a simple command runs, past shell assignments,
|
|
346
|
+
* reserved words and the wrappers in WRAPPER_SPECS with their own arguments:
|
|
347
|
+
* -1 when it runs no command (`command -v x`, a bare `env` or `exec`), null
|
|
348
|
+
* when a wrapper's arguments cannot be parsed or the word a wrapper runs is
|
|
349
|
+
* built from an expansion. A wrapper not modelled here, and an expanded
|
|
350
|
+
* command word with no wrapper before it, are returned as the command.
|
|
351
|
+
* `specs` defaults to WRAPPER_SPECS; a caller may model more wrappers.
|
|
352
|
+
*/
|
|
353
|
+
export function unwrapCommand(words: ShellWord[], specs: Record<string, WrapperSpec> = WRAPPER_SPECS): { index: number } | null {
|
|
354
|
+
let at = 0;
|
|
355
|
+
// A shell assignment is not split, so its expansion is still one word.
|
|
356
|
+
while (at < words.length && (ASSIGNMENT.test(words[at].text) || RESERVED_WORDS.has(words[at].text))) at++;
|
|
357
|
+
for (let depth = 0; depth < 16; depth++) {
|
|
358
|
+
if (at >= words.length) return { index: -1 };
|
|
359
|
+
if (words[at].opaque) return depth === 0 ? { index: at } : null;
|
|
360
|
+
const spec = Object.hasOwn(specs, baseName(words[at].text)) ? specs[baseName(words[at].text)] : undefined;
|
|
361
|
+
if (!spec) return { index: at };
|
|
362
|
+
const next = skipWrapperArguments(spec, words, at + 1);
|
|
363
|
+
if (next === null) return null;
|
|
364
|
+
if (next < 0) return { index: -1 };
|
|
365
|
+
at = next;
|
|
366
|
+
}
|
|
367
|
+
return null;
|
|
368
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/hooks",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.8",
|
|
4
4
|
"description": "Open source hooks library for AI coding agents - Install safety, quality, and automation hooks with a single command",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@hasna/contracts": "~1.2.1"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@hasna/skills": "0.10.
|
|
73
|
+
"@hasna/skills": "0.10.53",
|
|
74
74
|
"@hasna/events": "^0.1.16",
|
|
75
75
|
"@hasna/secrets": "0.4.2",
|
|
76
76
|
"@modelcontextprotocol/sdk": "^1.26.0",
|