@pushary/agent-hooks 1.9.61 → 1.9.62
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 +5 -0
- package/dist/{api-LW3PJQYY.js → api-7HLZRIUV.js} +14 -12
- package/dist/bin/pushary-bell-hook.js +27 -27
- package/dist/bin/pushary-bell.js +10 -10
- package/dist/bin/pushary-claude.js +33 -26
- package/dist/bin/pushary-clean.js +33 -33
- package/dist/bin/pushary-codex-bridge.js +21 -21
- package/dist/bin/pushary-codex-hook.js +48 -35
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +14 -14
- package/dist/bin/pushary-connect.js +27 -27
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +37 -37
- package/dist/bin/pushary-disconnect.js +26 -26
- package/dist/bin/pushary-doctor.js +40 -40
- package/dist/bin/pushary-elicitation-hook.js +29 -27
- package/dist/bin/pushary-gemini-bridge.js +15 -15
- package/dist/bin/pushary-gemini-hook.js +37 -29
- package/dist/bin/pushary-hook.js +32 -31
- package/dist/bin/pushary-login.js +14 -14
- package/dist/bin/pushary-logout.js +27 -27
- package/dist/bin/pushary-mcp.js +11 -11
- package/dist/bin/pushary-mode.js +14 -14
- package/dist/bin/pushary-notification-hook.js +26 -26
- package/dist/bin/pushary-opencode-hook.js +39 -30
- package/dist/bin/pushary-permission-denied-hook.js +31 -31
- package/dist/bin/pushary-permission-hook.js +30 -30
- package/dist/bin/pushary-post-hook.js +26 -26
- package/dist/bin/pushary-prompt-hook.js +26 -26
- package/dist/bin/pushary-session-end-hook.js +26 -26
- package/dist/bin/pushary-session-start-hook.js +33 -33
- package/dist/bin/pushary-setup.js +44 -44
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +31 -31
- package/dist/bin/pushary-stop-hook.js +26 -26
- package/dist/bin/pushary-stopfailure-hook.js +26 -26
- package/dist/bin/pushary-suggestions.js +14 -14
- package/dist/bin/pushary-transcript-register.js +18 -18
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +37 -37
- package/dist/bin/pushary-wait.js +14 -14
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-ZEWIMY63.js → chunk-3IFCXMC6.js} +1 -1
- package/dist/{chunk-GZCSWDAS.js → chunk-3LBB7GVF.js} +4 -4
- package/dist/{chunk-WFSGCFXQ.js → chunk-3YGUWPNZ.js} +2 -6
- package/dist/{chunk-SVQWHV65.js → chunk-44FNEAXK.js} +1 -1
- package/dist/{chunk-YPD3MTFU.js → chunk-4K6YZPZ3.js} +1 -1
- package/dist/{chunk-GKFO5JLN.js → chunk-557ZE5EX.js} +4 -4
- package/dist/{chunk-LBHJJEKT.js → chunk-5R23J52J.js} +6 -6
- package/dist/{chunk-ORX5BTV4.js → chunk-67Q3Q5IO.js} +8 -6
- package/dist/{chunk-ZGU3NXL2.js → chunk-6HIYOY6I.js} +5 -5
- package/dist/{chunk-LN7DE5LY.js → chunk-6JAWNRDR.js} +2 -2
- package/dist/{chunk-MWLTTLPK.js → chunk-6YSEOXP5.js} +2 -2
- package/dist/{chunk-4N5E4JNF.js → chunk-7E2ZN7XA.js} +2 -2
- package/dist/{chunk-P3VQH65N.js → chunk-7EHZXZB2.js} +33 -20
- package/dist/{chunk-2AELPDMT.js → chunk-7ETELRQX.js} +1 -1
- package/dist/{chunk-7BHI3PZN.js → chunk-7GU4PXE5.js} +1 -1
- package/dist/{chunk-BJTSKOH3.js → chunk-7NJ4TDUH.js} +5 -5
- package/dist/{chunk-X3YKQJCZ.js → chunk-7NXB7OVX.js} +1 -1
- package/dist/{chunk-XEJOPVCG.js → chunk-A4CZPUQ6.js} +1 -1
- package/dist/{chunk-64S5PQBQ.js → chunk-AFV3FQNG.js} +4 -4
- package/dist/{chunk-QER5R7Z6.js → chunk-BIUSODLS.js} +2 -2
- package/dist/{chunk-CJ5TCFD4.js → chunk-CFIQ3252.js} +3 -3
- package/dist/{chunk-BG4Y64FW.js → chunk-DFKEJARZ.js} +1 -1
- package/dist/{chunk-GDKQUB52.js → chunk-EA6574W2.js} +5 -5
- package/dist/{chunk-UADSXJZ4.js → chunk-EO6CL4PD.js} +2 -2
- package/dist/{chunk-XAO6EYGM.js → chunk-ESXGCZDA.js} +26 -3
- package/dist/{chunk-EUIPTDLX.js → chunk-EUNSJKJJ.js} +8 -8
- package/dist/{chunk-BUZIEL7Y.js → chunk-EVZDYG7L.js} +2 -2
- package/dist/{chunk-IFPOHFDJ.js → chunk-F35YILEN.js} +1 -1
- package/dist/{chunk-ERK24P76.js → chunk-FG5HMJ7C.js} +1 -1
- package/dist/{chunk-NKLNU577.js → chunk-FX7KDF47.js} +3 -3
- package/dist/{chunk-AXJLJJ3M.js → chunk-FXECTHAG.js} +73 -2
- package/dist/chunk-FYS27SUS.js +216 -0
- package/dist/{chunk-SFAP4AJY.js → chunk-G3ZDCYMU.js} +1 -1
- package/dist/{chunk-ELLJPP6O.js → chunk-GFAG72LR.js} +2 -2
- package/dist/{chunk-ATKN4BJT.js → chunk-GV43RXR2.js} +1 -1
- package/dist/{chunk-7BAO42UV.js → chunk-HSRNWCXJ.js} +3 -3
- package/dist/{chunk-RGSW36XH.js → chunk-LCNN7UOE.js} +3 -3
- package/dist/{chunk-4VRTSDGP.js → chunk-LILS32LF.js} +5 -5
- package/dist/{chunk-33OOEVPG.js → chunk-LL2KHEJH.js} +1 -1
- package/dist/{chunk-DQLCFGHK.js → chunk-LWR5VKNC.js} +15 -9
- package/dist/{chunk-CICLXLQN.js → chunk-M7MEVILL.js} +3 -3
- package/dist/{chunk-XV6S5PWW.js → chunk-MURJ4WAL.js} +1 -1
- package/dist/{chunk-FUZ5VYWD.js → chunk-MYEALNW6.js} +1 -1
- package/dist/{chunk-ADR3KHOC.js → chunk-NAZRRXZM.js} +2 -2
- package/dist/{chunk-VX2MJ4X7.js → chunk-NZLQ6GMX.js} +4 -4
- package/dist/{chunk-K4MBKXAE.js → chunk-OZRT64BB.js} +1 -1
- package/dist/{chunk-Y5VKZNFN.js → chunk-PSCXEH42.js} +2 -2
- package/dist/{chunk-YDR4BQ7R.js → chunk-Q4WTIKM6.js} +3 -3
- package/dist/{chunk-KPNZ7JUL.js → chunk-QIPW7OVB.js} +4 -4
- package/dist/{chunk-USE5IEEW.js → chunk-R3CLBNST.js} +1 -1
- package/dist/{chunk-SHJVFW22.js → chunk-RFCEVROB.js} +2 -2
- package/dist/{chunk-RJHX66EY.js → chunk-RSNN2TPE.js} +13 -8
- package/dist/{chunk-HUI4OE43.js → chunk-RU37NSZH.js} +3 -3
- package/dist/{chunk-7MCCXE5Y.js → chunk-SDOWT67G.js} +5 -5
- package/dist/{chunk-BQ2VV7LY.js → chunk-SJCPIYWJ.js} +2 -2
- package/dist/{chunk-O65F2IIN.js → chunk-SJJYXMJP.js} +6 -6
- package/dist/{chunk-G36T5LAP.js → chunk-TMHE5CVX.js} +3 -3
- package/dist/{chunk-GAMVAORR.js → chunk-UUAVYIWJ.js} +1 -1
- package/dist/{chunk-PITQ5ZIQ.js → chunk-UWCPY4RY.js} +2 -2
- package/dist/{chunk-7HDGH3Z2.js → chunk-VF3IL56Q.js} +2 -2
- package/dist/{chunk-WN3RACVD.js → chunk-W3CBFLIX.js} +3 -3
- package/dist/{chunk-6T5Z64KS.js → chunk-W6MYFAOK.js} +10 -10
- package/dist/{chunk-Y6Z7DA5Y.js → chunk-YQK72JGV.js} +5 -5
- package/dist/{chunk-7JXJJNQ5.js → chunk-ZEDGKCCM.js} +1 -1
- package/dist/{chunk-JGQV4MDQ.js → chunk-ZJFJUAHS.js} +6 -6
- package/dist/{codex-app-cards-switch-BD7LCI2I.js → codex-app-cards-switch-IIL7IPP6.js} +11 -11
- package/dist/{codex-desktop-launch-V5CASSBB.js → codex-desktop-launch-XCLMYVBD.js} +1 -1
- package/dist/{codex-session-launch-5PKFKUFD.js → codex-session-launch-UMVALJ3A.js} +18 -18
- package/dist/{config-AEKH7HGC.js → config-5N3GUJD5.js} +3 -3
- package/dist/{global-upgrade-IUXJJDWF.js → global-upgrade-5F4CSXED.js} +9 -9
- package/dist/{identity-YJIV2XTY.js → identity-7ULYW4RL.js} +4 -4
- package/dist/{live-capabilities-QYFW5QAW.js → live-capabilities-QTSFXA6T.js} +4 -4
- package/dist/{paths-A5GAR5PL.js → paths-HEMK2ALW.js} +3 -3
- package/dist/{reapply-BKJGICRJ.js → reapply-AMFKVYZV.js} +26 -26
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +21 -21
- package/dist/{upgrade-lock-DDB7WEWC.js → upgrade-lock-IAZC5644.js} +4 -4
- package/dist/{usage-HBDNFZ3O.js → usage-NEFDYSRT.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-6FJ6CK32.js +0 -126
package/dist/src/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handlePreToolUse
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-7EHZXZB2.js";
|
|
4
|
+
import "../chunk-67Q3Q5IO.js";
|
|
5
|
+
import "../chunk-44FNEAXK.js";
|
|
6
|
+
import "../chunk-3IFCXMC6.js";
|
|
7
|
+
import "../chunk-557ZE5EX.js";
|
|
8
|
+
import "../chunk-LCNN7UOE.js";
|
|
9
9
|
import {
|
|
10
10
|
fetchAccountPublicKey
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-UUAVYIWJ.js";
|
|
12
12
|
import "../chunk-6ICPEJY5.js";
|
|
13
13
|
import {
|
|
14
14
|
fetchModeOverride,
|
|
@@ -18,34 +18,34 @@ import {
|
|
|
18
18
|
handlePostToolUse,
|
|
19
19
|
handleStop,
|
|
20
20
|
reportEvent
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-LWR5VKNC.js";
|
|
22
|
+
import "../chunk-LL2KHEJH.js";
|
|
23
|
+
import "../chunk-4K6YZPZ3.js";
|
|
24
24
|
import {
|
|
25
25
|
askUser,
|
|
26
26
|
cancelQuestion,
|
|
27
27
|
waitForAnswer
|
|
28
|
-
} from "../chunk-
|
|
29
|
-
import "../chunk-
|
|
28
|
+
} from "../chunk-RSNN2TPE.js";
|
|
29
|
+
import "../chunk-ESXGCZDA.js";
|
|
30
30
|
import "../chunk-POFBE6ZY.js";
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-Q4WTIKM6.js";
|
|
32
|
+
import "../chunk-HSRNWCXJ.js";
|
|
33
|
+
import "../chunk-G3ZDCYMU.js";
|
|
34
34
|
import "../chunk-PPY5N2E6.js";
|
|
35
35
|
import "../chunk-KZERVKTD.js";
|
|
36
|
-
import "../chunk-
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-
|
|
36
|
+
import "../chunk-PSCXEH42.js";
|
|
37
|
+
import "../chunk-6YSEOXP5.js";
|
|
38
|
+
import "../chunk-CFIQ3252.js";
|
|
39
39
|
import "../chunk-QENTGE75.js";
|
|
40
40
|
import {
|
|
41
41
|
getApiKey,
|
|
42
42
|
getBaseUrl
|
|
43
|
-
} from "../chunk-
|
|
44
|
-
import "../chunk-
|
|
43
|
+
} from "../chunk-DFKEJARZ.js";
|
|
44
|
+
import "../chunk-FG5HMJ7C.js";
|
|
45
45
|
import "../chunk-QTOLNRET.js";
|
|
46
46
|
import {
|
|
47
47
|
resolvePolicy
|
|
48
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-FXECTHAG.js";
|
|
49
49
|
import "../chunk-MLKGABMK.js";
|
|
50
50
|
export {
|
|
51
51
|
askUser,
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
installWithUpgradeLock,
|
|
5
5
|
ownsUpgradeLock,
|
|
6
6
|
releaseAutoUpdateLock
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-7E2ZN7XA.js";
|
|
8
|
+
import "./chunk-6YSEOXP5.js";
|
|
9
|
+
import "./chunk-CFIQ3252.js";
|
|
10
10
|
import "./chunk-QENTGE75.js";
|
|
11
11
|
import "./chunk-QTOLNRET.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FXECTHAG.js";
|
|
13
13
|
import "./chunk-MLKGABMK.js";
|
|
14
14
|
export {
|
|
15
15
|
claimUpgradeLock,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exitOnHelpFlag
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OZRT64BB.js";
|
|
4
4
|
import "./chunk-KZERVKTD.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-FG5HMJ7C.js";
|
|
6
6
|
import "./chunk-QTOLNRET.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-FXECTHAG.js";
|
|
8
8
|
import "./chunk-MLKGABMK.js";
|
|
9
9
|
export {
|
|
10
10
|
exitOnHelpFlag
|
package/package.json
CHANGED
package/dist/chunk-6FJ6CK32.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
registerTranscript
|
|
3
|
-
} from "./chunk-EUIPTDLX.js";
|
|
4
|
-
import {
|
|
5
|
-
namedEvent
|
|
6
|
-
} from "./chunk-GKFO5JLN.js";
|
|
7
|
-
import {
|
|
8
|
-
writeDegraded
|
|
9
|
-
} from "./chunk-RJHX66EY.js";
|
|
10
|
-
import {
|
|
11
|
-
claudeShapedHookInput,
|
|
12
|
-
hookCompatibleProfileBySource,
|
|
13
|
-
isGrokHookPayload,
|
|
14
|
-
isGrokSessionEndStop
|
|
15
|
-
} from "./chunk-AXJLJJ3M.js";
|
|
16
|
-
|
|
17
|
-
// src/tool-hook-input.ts
|
|
18
|
-
var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode"];
|
|
19
|
-
function isInputRecord(value) {
|
|
20
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
21
|
-
}
|
|
22
|
-
function isToolHookInput(value) {
|
|
23
|
-
if (!isInputRecord(value)) return false;
|
|
24
|
-
if (typeof value.tool_name !== "string" || value.tool_name.length === 0) return false;
|
|
25
|
-
if (!isInputRecord(value.tool_input)) return false;
|
|
26
|
-
for (const field of OPTIONAL_TEXT_FIELDS) {
|
|
27
|
-
if (value[field] !== void 0 && typeof value[field] !== "string") return false;
|
|
28
|
-
}
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
function parseToolHookInput(value) {
|
|
32
|
-
if (!isInputRecord(value)) return null;
|
|
33
|
-
const input = { ...value, tool_input: value.tool_input === void 0 ? {} : value.tool_input };
|
|
34
|
-
return isToolHookInput(input) ? input : null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// src/admission.ts
|
|
38
|
-
import { readFileSync } from "fs";
|
|
39
|
-
import { homedir } from "os";
|
|
40
|
-
import { join } from "path";
|
|
41
|
-
var NO_RULES = { version: 1, disabled: [] };
|
|
42
|
-
var SUPPORTED_VERSION = 1;
|
|
43
|
-
var parseAdmissionRules = (raw) => {
|
|
44
|
-
if (!raw) return NO_RULES;
|
|
45
|
-
try {
|
|
46
|
-
const parsed = JSON.parse(raw);
|
|
47
|
-
if (parsed.version !== SUPPORTED_VERSION) return NO_RULES;
|
|
48
|
-
if (!Array.isArray(parsed.disabled)) return NO_RULES;
|
|
49
|
-
return {
|
|
50
|
-
version: SUPPORTED_VERSION,
|
|
51
|
-
disabled: parsed.disabled.filter((rule) => typeof rule === "string")
|
|
52
|
-
};
|
|
53
|
-
} catch {
|
|
54
|
-
return NO_RULES;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
var admissionRulesFile = () => process.env.PUSHARY_ADMISSION_FILE?.trim() || join(homedir(), ".pushary", "admission-rules.json");
|
|
58
|
-
var readAdmissionRules = () => {
|
|
59
|
-
try {
|
|
60
|
-
return parseAdmissionRules(readFileSync(admissionRulesFile(), "utf-8"));
|
|
61
|
-
} catch {
|
|
62
|
-
return NO_RULES;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
var matches = (rule, source, event) => {
|
|
66
|
-
const colon = rule.indexOf(":");
|
|
67
|
-
if (colon <= 0 || colon === rule.length - 1) return false;
|
|
68
|
-
const ruleSource = rule.slice(0, colon);
|
|
69
|
-
const ruleEvent = rule.slice(colon + 1);
|
|
70
|
-
return (ruleSource === "*" || ruleSource === source) && (ruleEvent === "*" || ruleEvent === event);
|
|
71
|
-
};
|
|
72
|
-
var isAdmitted = (rules, source, event) => !rules.disabled.some((rule) => matches(rule, source, event));
|
|
73
|
-
var UNREADABLE = { kind: "unreadable" };
|
|
74
|
-
var UNKNOWN_AGENT = { kind: "unknown_agent" };
|
|
75
|
-
var readHookInputOutcome = async (source, fallbackEvent = "", stdin = process.stdin, parseInput) => {
|
|
76
|
-
if (source === null) {
|
|
77
|
-
writeDegraded("hook", {
|
|
78
|
-
reason: "unknown_agent",
|
|
79
|
-
fallback: "stood aside, so nothing is gated or reported for this call",
|
|
80
|
-
event: fallbackEvent
|
|
81
|
-
});
|
|
82
|
-
return UNKNOWN_AGENT;
|
|
83
|
-
}
|
|
84
|
-
let raw = "";
|
|
85
|
-
for await (const chunk of stdin) raw += chunk;
|
|
86
|
-
if (!raw.trim()) return UNREADABLE;
|
|
87
|
-
let parsed;
|
|
88
|
-
try {
|
|
89
|
-
parsed = JSON.parse(raw);
|
|
90
|
-
} catch {
|
|
91
|
-
return UNREADABLE;
|
|
92
|
-
}
|
|
93
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return UNREADABLE;
|
|
94
|
-
if (source !== "grok" && process.env.GROK_SESSION_ID && isGrokHookPayload(parsed)) return UNREADABLE;
|
|
95
|
-
const shaped = inClaudeShape(source, namedEvent(process.argv) ?? fallbackEvent, parsed);
|
|
96
|
-
if (source === "grok" && isGrokSessionEndStop(shaped.hook_event_name, shaped.reason)) return UNREADABLE;
|
|
97
|
-
const input = parseInput ? parseInput(shaped) : shaped;
|
|
98
|
-
if (input === null) return UNREADABLE;
|
|
99
|
-
const event = eventNameOf(input) ?? fallbackEvent;
|
|
100
|
-
if (!isAdmitted(readAdmissionRules(), source, event)) return { kind: "not_admitted", input };
|
|
101
|
-
if (stdin === process.stdin) registerTranscript(source, input);
|
|
102
|
-
return { kind: "admitted", input };
|
|
103
|
-
};
|
|
104
|
-
var admittedInput = (read) => read.kind === "admitted" ? read.input : null;
|
|
105
|
-
var readHookInput = async (source, fallbackEvent = "", stdin = process.stdin, parseInput) => admittedInput(await readHookInputOutcome(source, fallbackEvent, stdin, parseInput));
|
|
106
|
-
var inClaudeShape = (source, event, parsed) => {
|
|
107
|
-
const profile = hookCompatibleProfileBySource(source);
|
|
108
|
-
return profile ? claudeShapedHookInput(profile.payload, event, parsed) : parsed;
|
|
109
|
-
};
|
|
110
|
-
var eventNameOf = (input) => {
|
|
111
|
-
if (!("hook_event_name" in input)) return void 0;
|
|
112
|
-
const name = input.hook_event_name;
|
|
113
|
-
return typeof name === "string" && name.length > 0 ? name : void 0;
|
|
114
|
-
};
|
|
115
|
-
function readToolHookInput(source, event, stdin = process.stdin) {
|
|
116
|
-
return readHookInput(source, event, stdin, parseToolHookInput);
|
|
117
|
-
}
|
|
118
|
-
function readToolHookCall(source, event, stdin = process.stdin) {
|
|
119
|
-
return readHookInputOutcome(source, event, stdin, parseToolHookInput);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export {
|
|
123
|
-
readHookInput,
|
|
124
|
-
readToolHookInput,
|
|
125
|
-
readToolHookCall
|
|
126
|
-
};
|