@pushary/agent-hooks 1.9.35 → 1.9.37
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 +12 -0
- package/README.md +1 -1
- package/dist/bin/pushary-bell-hook.js +25 -25
- package/dist/bin/pushary-bell.js +9 -9
- package/dist/bin/pushary-claude.js +24 -24
- package/dist/bin/pushary-clean.js +52 -45
- package/dist/bin/pushary-codex-bridge.js +17 -17
- package/dist/bin/pushary-codex-hook.js +65 -41
- package/dist/bin/pushary-codex.js +12 -12
- package/dist/bin/pushary-connect.js +24 -24
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +32 -32
- package/dist/bin/pushary-disconnect.js +31 -28
- package/dist/bin/pushary-doctor.js +35 -34
- package/dist/bin/pushary-elicitation-hook.js +25 -25
- package/dist/bin/pushary-gemini-bridge.js +13 -13
- package/dist/bin/pushary-gemini-hook.js +27 -27
- package/dist/bin/pushary-hook.js +34 -30
- package/dist/bin/pushary-login.js +12 -12
- package/dist/bin/pushary-logout.js +24 -24
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +12 -12
- package/dist/bin/pushary-notification-hook.js +24 -24
- package/dist/bin/pushary-opencode-hook.js +26 -26
- package/dist/bin/pushary-permission-denied-hook.js +29 -29
- package/dist/bin/pushary-permission-hook.js +28 -28
- package/dist/bin/pushary-post-hook.js +24 -24
- package/dist/bin/pushary-prompt-hook.js +24 -24
- package/dist/bin/pushary-session-end-hook.js +24 -24
- package/dist/bin/pushary-session-start-hook.js +28 -28
- package/dist/bin/pushary-setup.js +65 -56
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +26 -26
- package/dist/bin/pushary-stop-hook.js +24 -24
- package/dist/bin/pushary-stopfailure-hook.js +24 -24
- package/dist/bin/pushary-suggestions.js +12 -12
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +30 -30
- package/dist/bin/pushary-wait.js +12 -12
- package/dist/bin/pushary.js +6 -6
- package/dist/{chunk-7FQL5NWJ.js → chunk-235LKHLW.js} +301 -90
- package/dist/{chunk-LOYSI2CZ.js → chunk-2WZJHJAB.js} +5 -5
- package/dist/{chunk-YABMIGR3.js → chunk-3Y73MQPF.js} +1 -1
- package/dist/{chunk-GC3SUMYD.js → chunk-4OQHT5IJ.js} +4 -4
- package/dist/{chunk-QJ3ENGBT.js → chunk-6SYU5LVK.js} +3 -3
- package/dist/{chunk-NKAMF2YJ.js → chunk-6VUVVVVN.js} +1 -1
- package/dist/{chunk-3LS3GFJW.js → chunk-AZXPJLKC.js} +1 -1
- package/dist/{chunk-A455TSHF.js → chunk-B7SE22M7.js} +2 -2
- package/dist/{chunk-XLXG6MA5.js → chunk-DG5QHKJA.js} +3 -3
- package/dist/{chunk-7IVV4LLF.js → chunk-DYALNCS6.js} +3 -3
- package/dist/{chunk-PEEJP4HN.js → chunk-EK6PRPCY.js} +4 -4
- package/dist/{chunk-FPYBX36E.js → chunk-F3J6JFR2.js} +5 -5
- package/dist/{chunk-Z6HDYK2A.js → chunk-FFRH7KZP.js} +2 -2
- package/dist/{chunk-V4ZIG66K.js → chunk-GKTVIN4F.js} +1 -1
- package/dist/{chunk-YRDNKY77.js → chunk-GQSJVYKN.js} +6 -6
- package/dist/{chunk-EGTRIM74.js → chunk-GSP7CC52.js} +4 -4
- package/dist/{chunk-NMQLY4PE.js → chunk-GUHM2UQO.js} +2 -2
- package/dist/{chunk-OZMGO4WF.js → chunk-HA22GGDG.js} +5 -5
- package/dist/{chunk-WFPXKCN4.js → chunk-HJF57K2U.js} +5 -5
- package/dist/{chunk-VTAC5FBZ.js → chunk-HK2RPWAD.js} +1 -1
- package/dist/{chunk-SMSX4TCC.js → chunk-HQR6DYVG.js} +1 -1
- package/dist/{chunk-FQQSW7MD.js → chunk-ISNGKZG4.js} +1 -1
- package/dist/{chunk-EJWSE7S7.js → chunk-JLQV3XLV.js} +4 -4
- package/dist/{chunk-A5FFSXZE.js → chunk-JMLJHKJN.js} +2 -2
- package/dist/{chunk-7S7H7V5V.js → chunk-KHLYOIPY.js} +97 -40
- package/dist/{chunk-HVUBWLER.js → chunk-KZ3XE3JG.js} +34 -109
- package/dist/{chunk-CK3W7Q5S.js → chunk-MAGB6VW6.js} +1 -1
- package/dist/{chunk-DCBSD22V.js → chunk-N5WEEYV6.js} +3 -3
- package/dist/{chunk-U7CN5HG2.js → chunk-NDQXKLGE.js} +5 -5
- package/dist/{chunk-IRU7DKJW.js → chunk-NPE44CX4.js} +7 -3
- package/dist/{chunk-22YSHBTI.js → chunk-NWSWP3KY.js} +3 -3
- package/dist/{chunk-HQKYWUBF.js → chunk-OSLC7G3D.js} +2 -2
- package/dist/{chunk-7UGGCTTW.js → chunk-PDDJKGIW.js} +2 -2
- package/dist/chunk-PDRKQSC6.js +184 -0
- package/dist/{chunk-4PIAOJAW.js → chunk-PYWLW7PC.js} +1 -1
- package/dist/{chunk-6OGDGQTT.js → chunk-Q3TCLMYC.js} +5 -5
- package/dist/{chunk-57FFQR46.js → chunk-Q52PBCN7.js} +1 -1
- package/dist/{chunk-DQKEGNTI.js → chunk-QUKATQ66.js} +1 -1
- package/dist/{chunk-UPRNSD2T.js → chunk-RFIHLLRH.js} +9 -6
- package/dist/{chunk-36ZCFJUI.js → chunk-SNI4FGOV.js} +1 -1
- package/dist/{chunk-43H2FUNN.js → chunk-SNUNAIKK.js} +4 -4
- package/dist/{chunk-WMB3OCI4.js → chunk-T2NKNQPM.js} +2 -2
- package/dist/{chunk-WPSI4246.js → chunk-UEIL72RN.js} +1 -1
- package/dist/{chunk-UDECNZYI.js → chunk-UK3WY3LE.js} +2 -2
- package/dist/{chunk-E2OZZZKP.js → chunk-UKCGR5T2.js} +2 -2
- package/dist/{chunk-CPYOJRDN.js → chunk-V7Q7DQXL.js} +8 -8
- package/dist/{chunk-ULJFIF5N.js → chunk-VA36Q6BD.js} +1 -1
- package/dist/{chunk-FDNMQEU6.js → chunk-VMIDUNOT.js} +2 -2
- package/dist/{chunk-SMRMWDFE.js → chunk-W73URGML.js} +43 -17
- package/dist/{chunk-45OXG3VR.js → chunk-WXA3CFZR.js} +1 -1
- package/dist/{chunk-4TFD3WAA.js → chunk-YNJ372JU.js} +2 -2
- package/dist/{chunk-H52HBSOD.js → chunk-Z5ORWTY3.js} +3 -3
- package/dist/{chunk-B5RLJ6QD.js → chunk-ZMR3DSMH.js} +9 -5
- package/dist/{chunk-HJNCVY5F.js → chunk-ZQD6GVS7.js} +7 -7
- package/dist/{global-upgrade-IZCB4WIE.js → global-upgrade-R57HCUTC.js} +6 -6
- package/dist/{paths-4WAA57P5.js → paths-G2AYNZCD.js} +2 -2
- package/dist/{reapply-GJ73ZHDD.js → reapply-FHCOPXEN.js} +20 -20
- package/dist/src/index.js +19 -19
- package/dist/{upgrade-lock-J5PIKSYV.js → upgrade-lock-3I7AF7E3.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-FYQG2UTK.js +0 -71
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerTranscript
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-V7Q7DQXL.js";
|
|
4
4
|
import {
|
|
5
5
|
namedEvent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KHLYOIPY.js";
|
|
7
7
|
import {
|
|
8
8
|
writeDegraded
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HA22GGDG.js";
|
|
10
10
|
import {
|
|
11
11
|
claudeShapedHookInput,
|
|
12
|
-
hookCompatibleProfileBySource
|
|
13
|
-
|
|
12
|
+
hookCompatibleProfileBySource,
|
|
13
|
+
isGrokHookPayload,
|
|
14
|
+
isGrokSessionEndStop
|
|
15
|
+
} from "./chunk-235LKHLW.js";
|
|
14
16
|
|
|
15
17
|
// src/tool-hook-input.ts
|
|
16
18
|
var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode"];
|
|
@@ -89,7 +91,9 @@ var readHookInputOutcome = async (source, fallbackEvent = "", stdin = process.st
|
|
|
89
91
|
return UNREADABLE;
|
|
90
92
|
}
|
|
91
93
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return UNREADABLE;
|
|
94
|
+
if (source !== "grok" && process.env.GROK_SESSION_ID && isGrokHookPayload(parsed)) return UNREADABLE;
|
|
92
95
|
const shaped = inClaudeShape(source, namedEvent(process.argv) ?? fallbackEvent, parsed);
|
|
96
|
+
if (source === "grok" && isGrokSessionEndStop(shaped.hook_event_name, shaped.reason)) return UNREADABLE;
|
|
93
97
|
const input = parseInput ? parseInput(shaped) : shaped;
|
|
94
98
|
if (input === null) return UNREADABLE;
|
|
95
99
|
const event = eventNameOf(input) ?? fallbackEvent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureCodexTrustsPusharyHooks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-B7SE22M7.js";
|
|
4
4
|
import {
|
|
5
5
|
detectClaudeVersion
|
|
6
6
|
} from "./chunk-RIVNNBEK.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
openCodeHookArgv,
|
|
13
13
|
openCodePluginDir,
|
|
14
14
|
openCodeWired
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HJF57K2U.js";
|
|
16
16
|
import {
|
|
17
17
|
addClaudeMcpServer,
|
|
18
18
|
addCompatibleHooks,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
addPusharyToolPermissions,
|
|
21
21
|
compatibleConfigFile,
|
|
22
22
|
hasCompatibleHooks
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-KHLYOIPY.js";
|
|
24
24
|
import {
|
|
25
25
|
claudeUnprovenHolds,
|
|
26
26
|
claudeWired,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
codexWired,
|
|
29
29
|
geminiWired,
|
|
30
30
|
planHooks
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-Q3TCLMYC.js";
|
|
32
32
|
import {
|
|
33
33
|
CLAUDE_HOOK_BINARY,
|
|
34
34
|
CLAUDE_HOOK_EVENTS,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
needsReregistration,
|
|
40
40
|
registrationSignatures,
|
|
41
41
|
supportedClaudeEvents
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-6SYU5LVK.js";
|
|
43
43
|
import {
|
|
44
44
|
formatVersion
|
|
45
45
|
} from "./chunk-6ICPEJY5.js";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
resolveGlobalBinDir,
|
|
64
64
|
resolveGlobalBinary,
|
|
65
65
|
vscodePluginMcp
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-RFIHLLRH.js";
|
|
67
67
|
import {
|
|
68
68
|
readJsonSafe,
|
|
69
69
|
writeFileAtomic,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
HOOK_COMPATIBLE_PROFILES,
|
|
74
74
|
isCompatibleAgentType,
|
|
75
75
|
isRecord
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-235LKHLW.js";
|
|
77
77
|
|
|
78
78
|
// src/reapply.ts
|
|
79
79
|
import { dirname, join } from "path";
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
readGlobalUpgradeSubject,
|
|
6
6
|
upgradeInstalledPackage,
|
|
7
7
|
withUpgradeLock
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-2WZJHJAB.js";
|
|
9
|
+
import "./chunk-ISNGKZG4.js";
|
|
10
|
+
import "./chunk-PDDJKGIW.js";
|
|
11
11
|
import "./chunk-POFBE6ZY.js";
|
|
12
12
|
import "./chunk-KZERVKTD.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-RFIHLLRH.js";
|
|
14
14
|
import "./chunk-AQFEP65J.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-WXA3CFZR.js";
|
|
16
|
+
import "./chunk-235LKHLW.js";
|
|
17
17
|
export {
|
|
18
18
|
finishGlobalUpgrade,
|
|
19
19
|
finishUpgradeWithLock,
|
|
@@ -11,34 +11,34 @@ import {
|
|
|
11
11
|
reapplyOpenCodePlugin,
|
|
12
12
|
reapplyVsCodePlugin,
|
|
13
13
|
repairCodexHolds
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-ZQD6GVS7.js";
|
|
15
|
+
import "./chunk-B7SE22M7.js";
|
|
16
16
|
import "./chunk-RIVNNBEK.js";
|
|
17
17
|
import "./chunk-XHKBHWLX.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-HJF57K2U.js";
|
|
19
|
+
import "./chunk-KHLYOIPY.js";
|
|
20
|
+
import "./chunk-Q3TCLMYC.js";
|
|
21
|
+
import "./chunk-6SYU5LVK.js";
|
|
22
|
+
import "./chunk-Q52PBCN7.js";
|
|
23
|
+
import "./chunk-SNI4FGOV.js";
|
|
24
24
|
import "./chunk-GMXKITVA.js";
|
|
25
25
|
import "./chunk-6ICPEJY5.js";
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-W73URGML.js";
|
|
27
|
+
import "./chunk-QUKATQ66.js";
|
|
28
|
+
import "./chunk-HA22GGDG.js";
|
|
29
29
|
import "./chunk-POFBE6ZY.js";
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-Z5ORWTY3.js";
|
|
31
|
+
import "./chunk-DYALNCS6.js";
|
|
32
|
+
import "./chunk-NWSWP3KY.js";
|
|
33
|
+
import "./chunk-VA36Q6BD.js";
|
|
34
34
|
import "./chunk-7QLSKOSU.js";
|
|
35
35
|
import "./chunk-KZERVKTD.js";
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-GUHM2UQO.js";
|
|
37
|
+
import "./chunk-RFIHLLRH.js";
|
|
38
38
|
import "./chunk-AQFEP65J.js";
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-AZXPJLKC.js";
|
|
40
|
+
import "./chunk-WXA3CFZR.js";
|
|
41
|
+
import "./chunk-235LKHLW.js";
|
|
42
42
|
export {
|
|
43
43
|
ensureCodexTrustAfterReapply,
|
|
44
44
|
inspectConfiguredManagedProviders,
|
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-
|
|
3
|
+
} from "../chunk-KZ3XE3JG.js";
|
|
4
|
+
import "../chunk-PDRKQSC6.js";
|
|
5
|
+
import "../chunk-HK2RPWAD.js";
|
|
6
|
+
import "../chunk-6VUVVVVN.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchAccountPublicKey
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-PYWLW7PC.js";
|
|
10
|
+
import "../chunk-KHLYOIPY.js";
|
|
11
|
+
import "../chunk-6SYU5LVK.js";
|
|
12
12
|
import "../chunk-6ICPEJY5.js";
|
|
13
13
|
import {
|
|
14
14
|
fetchModeOverride,
|
|
@@ -18,31 +18,31 @@ import {
|
|
|
18
18
|
handlePostToolUse,
|
|
19
19
|
handleStop,
|
|
20
20
|
reportEvent
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-W73URGML.js";
|
|
22
|
+
import "../chunk-QUKATQ66.js";
|
|
23
23
|
import {
|
|
24
24
|
askUser,
|
|
25
25
|
cancelQuestion,
|
|
26
26
|
waitForAnswer
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-HA22GGDG.js";
|
|
28
28
|
import "../chunk-POFBE6ZY.js";
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
29
|
+
import "../chunk-Z5ORWTY3.js";
|
|
30
|
+
import "../chunk-DYALNCS6.js";
|
|
31
|
+
import "../chunk-NWSWP3KY.js";
|
|
32
|
+
import "../chunk-VA36Q6BD.js";
|
|
33
33
|
import "../chunk-7QLSKOSU.js";
|
|
34
34
|
import "../chunk-KZERVKTD.js";
|
|
35
|
-
import "../chunk-
|
|
36
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-GUHM2UQO.js";
|
|
36
|
+
import "../chunk-RFIHLLRH.js";
|
|
37
37
|
import "../chunk-AQFEP65J.js";
|
|
38
38
|
import {
|
|
39
39
|
getApiKey,
|
|
40
40
|
getBaseUrl
|
|
41
|
-
} from "../chunk-
|
|
42
|
-
import "../chunk-
|
|
41
|
+
} from "../chunk-AZXPJLKC.js";
|
|
42
|
+
import "../chunk-WXA3CFZR.js";
|
|
43
43
|
import {
|
|
44
44
|
resolvePolicy
|
|
45
|
-
} from "../chunk-
|
|
45
|
+
} from "../chunk-235LKHLW.js";
|
|
46
46
|
export {
|
|
47
47
|
askUser,
|
|
48
48
|
cancelQuestion,
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
installWithUpgradeLock,
|
|
6
6
|
ownsUpgradeLock,
|
|
7
7
|
releaseAutoUpdateLock
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-ISNGKZG4.js";
|
|
9
|
+
import "./chunk-RFIHLLRH.js";
|
|
10
10
|
import "./chunk-AQFEP65J.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-235LKHLW.js";
|
|
12
12
|
export {
|
|
13
13
|
claimUpgradeLock,
|
|
14
14
|
finishWithUpgradeLock,
|
package/package.json
CHANGED
package/dist/chunk-FYQG2UTK.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AUTO_DECISION_WINDOW_MS,
|
|
3
|
-
DEFAULT_SESSION,
|
|
4
|
-
claimThrottle,
|
|
5
|
-
deriveToolTarget,
|
|
6
|
-
permissionDeniedAction,
|
|
7
|
-
releaseThrottle,
|
|
8
|
-
reportEvent
|
|
9
|
-
} from "./chunk-SMRMWDFE.js";
|
|
10
|
-
import {
|
|
11
|
-
machineDecisionFor,
|
|
12
|
-
shouldDeferToNativeMode,
|
|
13
|
-
wireVerdictFor
|
|
14
|
-
} from "./chunk-7FQL5NWJ.js";
|
|
15
|
-
|
|
16
|
-
// src/machine-decision-audit.ts
|
|
17
|
-
import { basename } from "path";
|
|
18
|
-
var reportMachineDenial = async (input, verdict, agent) => {
|
|
19
|
-
const decision = machineDecisionFor(wireVerdictFor(verdict, 0));
|
|
20
|
-
if (!decision) return;
|
|
21
|
-
const sessionKey = input.session_id || DEFAULT_SESSION;
|
|
22
|
-
const toolTarget = deriveToolTarget(input.tool_name, input.tool_input);
|
|
23
|
-
const throttleKey = `machinedecision:${agent.type}:${sessionKey}:${input.tool_name}:${decision.origin}:${toolTarget ?? ""}`;
|
|
24
|
-
const throttle = claimThrottle(throttleKey, AUTO_DECISION_WINDOW_MS);
|
|
25
|
-
if (throttle === "throttled") return;
|
|
26
|
-
if (throttle === "unavailable") {
|
|
27
|
-
console.error("[Pushary] Could not access the audit throttle; reporting this denial without deduplication.");
|
|
28
|
-
}
|
|
29
|
-
try {
|
|
30
|
-
const response = await reportEvent({
|
|
31
|
-
event: "permission_denied",
|
|
32
|
-
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
33
|
-
toolUseId: input.tool_use_id,
|
|
34
|
-
agentType: agent.type,
|
|
35
|
-
agentName: `${agent.label} - ${basename(input.cwd ?? process.cwd())}`,
|
|
36
|
-
action: permissionDeniedAction(input.tool_name),
|
|
37
|
-
sessionId: input.session_id,
|
|
38
|
-
decisionSource: "policy_auto",
|
|
39
|
-
decisionOrigin: decision.origin,
|
|
40
|
-
decisionOutcome: decision.outcome,
|
|
41
|
-
toolName: input.tool_name,
|
|
42
|
-
toolTarget
|
|
43
|
-
}, { maxAttempts: 1, timeoutMs: 800, requireOk: true, skipDrain: true });
|
|
44
|
-
if (response?.ok !== true) throw new Error("Audit delivery was not acknowledged");
|
|
45
|
-
} catch {
|
|
46
|
-
console.error("[Pushary] Could not record the machine denial. The action remains blocked; its audit delivery will be retried on the next matching denial.");
|
|
47
|
-
if (throttle === "passed") {
|
|
48
|
-
try {
|
|
49
|
-
releaseThrottle(throttleKey);
|
|
50
|
-
} catch {
|
|
51
|
-
console.error("[Pushary] Could not reset the failed audit throttle.");
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
// src/native-defer.ts
|
|
58
|
-
var nativeDeferOptions = () => {
|
|
59
|
-
const respect = process.env.PUSHARY_RESPECT_PERMISSION_MODE;
|
|
60
|
-
const bypass = process.env.PUSHARY_DEFER_BYPASS;
|
|
61
|
-
return {
|
|
62
|
-
respectPermissionMode: !(respect === "0" || respect === "false"),
|
|
63
|
-
deferBypass: bypass === "1" || bypass === "true"
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
var defersToNativeMode = (permissionMode, toolName) => shouldDeferToNativeMode(permissionMode, toolName, nativeDeferOptions());
|
|
67
|
-
|
|
68
|
-
export {
|
|
69
|
-
reportMachineDenial,
|
|
70
|
-
defersToNativeMode
|
|
71
|
-
};
|