@pushary/agent-hooks 0.97.0 → 0.98.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/CHANGELOG.md +10 -0
- package/dist/bin/pushary-bell-hook.js +19 -19
- package/dist/bin/pushary-bell.js +6 -6
- package/dist/bin/pushary-claude.js +20 -20
- package/dist/bin/pushary-clean.js +18 -18
- package/dist/bin/pushary-codex-bridge.js +10 -10
- package/dist/bin/pushary-codex-hook.js +23 -23
- package/dist/bin/pushary-codex.js +7 -7
- package/dist/bin/pushary-connect.js +6 -6
- package/dist/bin/pushary-cowork.js +3 -3
- package/dist/bin/pushary-daemon.js +23 -23
- package/dist/bin/pushary-disconnect.js +6 -6
- package/dist/bin/pushary-doctor.js +19 -19
- package/dist/bin/pushary-elicitation-hook.js +18 -18
- package/dist/bin/pushary-gemini-bridge.js +9 -9
- package/dist/bin/pushary-gemini-hook.js +21 -21
- package/dist/bin/pushary-hook.js +23 -23
- package/dist/bin/pushary-login.js +7 -7
- package/dist/bin/pushary-logout.js +4 -4
- package/dist/bin/pushary-mode.js +3 -3
- package/dist/bin/pushary-notification-hook.js +20 -20
- package/dist/bin/pushary-opencode-hook.js +21 -21
- package/dist/bin/pushary-permission-denied-hook.js +24 -24
- package/dist/bin/pushary-permission-hook.js +23 -23
- package/dist/bin/pushary-post-hook.js +20 -20
- package/dist/bin/pushary-prompt-hook.js +20 -20
- package/dist/bin/pushary-session-end-hook.js +20 -20
- package/dist/bin/pushary-session-start-hook.js +23 -23
- package/dist/bin/pushary-setup.js +37 -28
- package/dist/bin/pushary-stats.js +2 -2
- package/dist/bin/pushary-status.js +10 -10
- package/dist/bin/pushary-stop-hook.js +20 -20
- package/dist/bin/pushary-stopfailure-hook.js +20 -20
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +5 -5
- package/dist/bin/pushary-upgrade.js +14 -14
- package/dist/bin/pushary-wait.js +3 -3
- package/dist/{chunk-WIKEADOS.js → chunk-2GLOHBYB.js} +1 -1
- package/dist/{chunk-SW37HB27.js → chunk-3RVCQDC4.js} +1 -1
- package/dist/{chunk-XDMHLQMH.js → chunk-53QCTSWY.js} +4 -4
- package/dist/{chunk-6VXZKOBB.js → chunk-5B5QV3KC.js} +8 -8
- package/dist/{chunk-ROTIPRM4.js → chunk-5KLAETSU.js} +1 -1
- package/dist/{chunk-VDTC5DEM.js → chunk-6C6MS57P.js} +1 -1
- package/dist/{chunk-YX3U2CLP.js → chunk-6CYB77VD.js} +6 -6
- package/dist/{chunk-FU5SQKAY.js → chunk-6LRGZJFB.js} +9 -20
- package/dist/{chunk-VCKQ45QA.js → chunk-A76GNRIK.js} +1 -1
- package/dist/{chunk-3SNTEHOH.js → chunk-B35OCFXH.js} +4 -4
- package/dist/{chunk-ICUBJNFL.js → chunk-CP34FI4B.js} +2 -2
- package/dist/{chunk-LYWTLNMG.js → chunk-DOD3A6EU.js} +4 -4
- package/dist/{chunk-AXSDMDJI.js → chunk-FAJ4R7IB.js} +1 -1
- package/dist/{chunk-EHQC3GWL.js → chunk-HB2KB7QL.js} +1 -1
- package/dist/{chunk-IBRX7LRE.js → chunk-HFQ7WSHZ.js} +6 -7
- package/dist/{chunk-BYH75I7Y.js → chunk-IRLTW6KF.js} +1 -1
- package/dist/{chunk-KDPYXMUI.js → chunk-J44RPHUZ.js} +2 -2
- package/dist/{chunk-DOKFLZWL.js → chunk-JQU6PMH4.js} +14 -8
- package/dist/{chunk-YRXVC4HL.js → chunk-K6CH5NVW.js} +1 -1
- package/dist/{chunk-H4VNAOCG.js → chunk-LBNAGGLV.js} +1 -1
- package/dist/{chunk-B3557BDL.js → chunk-LX4NNYII.js} +2 -2
- package/dist/{chunk-5ODZEFP3.js → chunk-M4TVEMLH.js} +1 -1
- package/dist/{chunk-GGYH6LIE.js → chunk-NIXVMMJM.js} +1 -1
- package/dist/{chunk-C2FYSFTQ.js → chunk-NQGYPTJQ.js} +1 -1
- package/dist/{chunk-A4AIISZZ.js → chunk-OBYC6SN4.js} +1 -1
- package/dist/{chunk-QFAZ6QCT.js → chunk-OPR2BPD4.js} +1 -1
- package/dist/{chunk-HUZW6SEO.js → chunk-OUAE3GKO.js} +2 -2
- package/dist/{chunk-6WJKYD3Q.js → chunk-QXIF6R4P.js} +11 -8
- package/dist/{chunk-OYTOLQ3N.js → chunk-SI7GYBQP.js} +1 -1
- package/dist/{chunk-VF7YOT2W.js → chunk-SJLGOVC6.js} +1 -1
- package/dist/{chunk-DNLFSRCF.js → chunk-TZHDKRMG.js} +2 -2
- package/dist/{chunk-K7MLXXPY.js → chunk-V47GITZV.js} +3 -3
- package/dist/{chunk-VTUN7WSG.js → chunk-VZD2GEKB.js} +1 -1
- package/dist/{chunk-4AXWBCCO.js → chunk-W2MG2P46.js} +4 -4
- package/dist/{chunk-IZKCA35M.js → chunk-WU6LSXJ6.js} +2 -2
- package/dist/{chunk-67RNDRKL.js → chunk-XL3RKJYQ.js} +49 -4
- package/dist/{chunk-VOC55PQV.js → chunk-XOOWC62T.js} +1 -1
- package/dist/{chunk-CDSA3NTB.js → chunk-XPPXOKIG.js} +1 -1
- package/dist/{chunk-DGUMR5LZ.js → chunk-YJDRHQLG.js} +5 -5
- package/dist/src/index.js +10 -10
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
HOOK_BUDGETS,
|
|
3
3
|
HOOK_LOCATOR_BINARY,
|
|
4
4
|
withHookHoldBudget
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OUAE3GKO.js";
|
|
6
6
|
|
|
7
7
|
// src/npm.ts
|
|
8
8
|
import { execFileSync, execSync } from "child_process";
|
|
@@ -227,6 +227,23 @@ import { createHash } from "crypto";
|
|
|
227
227
|
import { homedir } from "os";
|
|
228
228
|
import { join as join2 } from "path";
|
|
229
229
|
|
|
230
|
+
// src/hook-entries.ts
|
|
231
|
+
var registerHookEntry = (existing, isOurs, entry) => {
|
|
232
|
+
const rewritten = [];
|
|
233
|
+
let placed = false;
|
|
234
|
+
for (const item of existing) {
|
|
235
|
+
if (!isOurs(item)) {
|
|
236
|
+
rewritten.push(item);
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
if (placed) continue;
|
|
240
|
+
rewritten.push(entry);
|
|
241
|
+
placed = true;
|
|
242
|
+
}
|
|
243
|
+
if (!placed) rewritten.push(entry);
|
|
244
|
+
return rewritten;
|
|
245
|
+
};
|
|
246
|
+
|
|
230
247
|
// src/canonical-json.ts
|
|
231
248
|
var canonicalJson = (value) => {
|
|
232
249
|
if (value === null || typeof value !== "object") return JSON.stringify(value);
|
|
@@ -325,8 +342,7 @@ var addCodexHooks = (config, command) => {
|
|
|
325
342
|
const hooks = ensureRecord(config, "hooks");
|
|
326
343
|
for (const definition of CODEX_HOOK_EVENTS) {
|
|
327
344
|
const existing = Array.isArray(hooks[definition.event]) ? hooks[definition.event] : [];
|
|
328
|
-
|
|
329
|
-
entries.push({
|
|
345
|
+
hooks[definition.event] = registerHookEntry(existing, isPusharyCodexHook, {
|
|
330
346
|
...definition.matcher ? { matcher: definition.matcher } : {},
|
|
331
347
|
hooks: [{
|
|
332
348
|
type: "command",
|
|
@@ -335,7 +351,6 @@ var addCodexHooks = (config, command) => {
|
|
|
335
351
|
...definition.statusMessage ? { statusMessage: definition.statusMessage } : {}
|
|
336
352
|
}]
|
|
337
353
|
});
|
|
338
|
-
hooks[definition.event] = entries;
|
|
339
354
|
}
|
|
340
355
|
};
|
|
341
356
|
var removeCodexHooks = (config, scope) => {
|
|
@@ -421,6 +436,33 @@ var codexHookPositions = (hooksConfig) => {
|
|
|
421
436
|
return positions;
|
|
422
437
|
};
|
|
423
438
|
var codexHookStateKey = (hooksJsonPath, event, position) => `${hooksJsonPath}:${CODEX_EVENT_KEY[event]}:${position[0]}:${position[1]}`;
|
|
439
|
+
var codexVacatedIndexes = (hooksConfig) => {
|
|
440
|
+
const hooks = asRecord(hooksConfig?.hooks);
|
|
441
|
+
const vacated = {};
|
|
442
|
+
for (const definition of CODEX_HOOK_EVENTS) {
|
|
443
|
+
const entries = hooks?.[definition.event];
|
|
444
|
+
if (!Array.isArray(entries)) continue;
|
|
445
|
+
const ours = entries.flatMap((entry, index) => isPusharyCodexHook(entry) ? [index] : []);
|
|
446
|
+
if (ours.length > 1) vacated[definition.event] = ours[1];
|
|
447
|
+
}
|
|
448
|
+
return vacated;
|
|
449
|
+
};
|
|
450
|
+
var dropVacatedCodexHookTrust = (config, hooksJsonPath, vacated) => {
|
|
451
|
+
const state = asRecord(asRecord(config.hooks)?.state);
|
|
452
|
+
if (!state) return false;
|
|
453
|
+
let changed = false;
|
|
454
|
+
for (const [event, from] of Object.entries(vacated)) {
|
|
455
|
+
const prefix = `${hooksJsonPath}:${CODEX_EVENT_KEY[event] ?? codexEventKeyOf(event)}:`;
|
|
456
|
+
for (const key of Object.keys(state)) {
|
|
457
|
+
if (!key.startsWith(prefix)) continue;
|
|
458
|
+
const entryIndex = Number(key.slice(prefix.length).split(":")[0]);
|
|
459
|
+
if (!Number.isInteger(entryIndex) || entryIndex < from) continue;
|
|
460
|
+
delete state[key];
|
|
461
|
+
changed = true;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return changed;
|
|
465
|
+
};
|
|
424
466
|
var captureCodexHookTrust = (config, hooksJsonPath, positions) => {
|
|
425
467
|
const state = asRecord(asRecord(config.hooks)?.state);
|
|
426
468
|
if (!state) return {};
|
|
@@ -559,6 +601,7 @@ export {
|
|
|
559
601
|
guardBinary,
|
|
560
602
|
guardCursorGate,
|
|
561
603
|
guardedArgv,
|
|
604
|
+
registerHookEntry,
|
|
562
605
|
isProtectedByScope,
|
|
563
606
|
canonicalJson,
|
|
564
607
|
CODEX_HOOK_BINARY,
|
|
@@ -577,6 +620,8 @@ export {
|
|
|
577
620
|
missingCodexHookEvents,
|
|
578
621
|
codexTrustSchemeAgrees,
|
|
579
622
|
codexHookPositions,
|
|
623
|
+
codexVacatedIndexes,
|
|
624
|
+
dropVacatedCodexHookTrust,
|
|
580
625
|
captureCodexHookTrust,
|
|
581
626
|
restoreCodexHookTrust,
|
|
582
627
|
codexTrustGaps,
|
|
@@ -18,11 +18,11 @@ import {
|
|
|
18
18
|
summarizeStop,
|
|
19
19
|
taskTitleFrom,
|
|
20
20
|
toolResultErrorText
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-A76GNRIK.js";
|
|
22
22
|
import {
|
|
23
23
|
NOTIFICATION_PUSH_TYPES,
|
|
24
24
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-OPR2BPD4.js";
|
|
26
26
|
import {
|
|
27
27
|
cancelQuestion,
|
|
28
28
|
isPolicyConfig,
|
|
@@ -31,13 +31,13 @@ import {
|
|
|
31
31
|
} from "./chunk-LGXUGYUH.js";
|
|
32
32
|
import {
|
|
33
33
|
getMachineId
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-WU6LSXJ6.js";
|
|
35
35
|
import {
|
|
36
36
|
withRetry
|
|
37
37
|
} from "./chunk-EYRGBYZG.js";
|
|
38
38
|
import {
|
|
39
39
|
reportedInstallSource
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-VZD2GEKB.js";
|
|
41
41
|
import {
|
|
42
42
|
getApiKey,
|
|
43
43
|
getBaseUrl
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
pendingCommandEvents,
|
|
55
55
|
resolveAutoResolveOrigin,
|
|
56
56
|
resolvePolicy
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-OUAE3GKO.js";
|
|
58
58
|
|
|
59
59
|
// src/policy.ts
|
|
60
60
|
import { createHash } from "crypto";
|
package/dist/src/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handlePreToolUse
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-6CYB77VD.js";
|
|
4
|
+
import "../chunk-53QCTSWY.js";
|
|
5
|
+
import "../chunk-XOOWC62T.js";
|
|
6
6
|
import "../chunk-YHG74UFF.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchAccountPublicKey
|
|
@@ -15,28 +15,28 @@ import {
|
|
|
15
15
|
handlePostToolUse,
|
|
16
16
|
handleStop,
|
|
17
17
|
reportEvent
|
|
18
|
-
} from "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
18
|
+
} from "../chunk-YJDRHQLG.js";
|
|
19
|
+
import "../chunk-A76GNRIK.js";
|
|
20
|
+
import "../chunk-OPR2BPD4.js";
|
|
21
21
|
import {
|
|
22
22
|
askUser,
|
|
23
23
|
cancelQuestion,
|
|
24
24
|
waitForAnswer
|
|
25
25
|
} from "../chunk-LGXUGYUH.js";
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-WU6LSXJ6.js";
|
|
27
|
+
import "../chunk-XL3RKJYQ.js";
|
|
28
28
|
import "../chunk-EYRGBYZG.js";
|
|
29
29
|
import "../chunk-SAF6HGAA.js";
|
|
30
30
|
import "../chunk-7QLSKOSU.js";
|
|
31
31
|
import "../chunk-KZERVKTD.js";
|
|
32
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-VZD2GEKB.js";
|
|
33
33
|
import {
|
|
34
34
|
getApiKey,
|
|
35
35
|
getBaseUrl
|
|
36
36
|
} from "../chunk-2UMNXADU.js";
|
|
37
37
|
import {
|
|
38
38
|
resolvePolicy
|
|
39
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-OUAE3GKO.js";
|
|
40
40
|
export {
|
|
41
41
|
askUser,
|
|
42
42
|
cancelQuestion,
|