@pushary/agent-hooks 1.5.1 → 1.6.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 +12 -0
- package/dist/bin/pushary-bell-hook.js +18 -18
- package/dist/bin/pushary-bell.js +6 -6
- package/dist/bin/pushary-claude.js +18 -18
- package/dist/bin/pushary-clean.js +19 -19
- package/dist/bin/pushary-codex-bridge.js +10 -10
- package/dist/bin/pushary-codex-hook.js +23 -23
- package/dist/bin/pushary-codex.js +6 -6
- 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 +10 -10
- package/dist/bin/pushary-doctor.js +22 -22
- package/dist/bin/pushary-elicitation-hook.js +17 -17
- package/dist/bin/pushary-gemini-bridge.js +9 -9
- package/dist/bin/pushary-gemini-hook.js +20 -20
- 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 +19 -19
- 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 +24 -24
- package/dist/bin/pushary-setup.js +28 -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 +16 -16
- package/dist/bin/pushary-transcripts.js +4 -4
- package/dist/bin/pushary-upgrade.js +44 -26
- package/dist/bin/pushary-wait.js +3 -3
- package/dist/{chunk-5ZZG76S2.js → chunk-5MH5P366.js} +2 -2
- package/dist/{chunk-HVBF35GT.js → chunk-5QCZYSYR.js} +1 -1
- package/dist/{chunk-PJ27EHCD.js → chunk-644CGYOB.js} +66 -12
- package/dist/{chunk-D573TLP6.js → chunk-66BIMA62.js} +6 -5
- package/dist/{chunk-WOLPADR6.js → chunk-7JSE6JTZ.js} +1 -1
- package/dist/{chunk-TZGCUNOX.js → chunk-A2GS2ENL.js} +6 -6
- package/dist/{chunk-TFKBFQCE.js → chunk-A5URWZTP.js} +1 -1
- package/dist/{chunk-M2LMXPJZ.js → chunk-ALG3IBLB.js} +1 -1
- package/dist/{chunk-TUXFIVOH.js → chunk-B6TYEKJR.js} +1 -1
- package/dist/{chunk-MDJJW3LP.js → chunk-BE4P7ERZ.js} +3 -3
- package/dist/{chunk-2AUIEZYS.js → chunk-BK5F3FGE.js} +3 -3
- package/dist/{chunk-IV3RHICU.js → chunk-BW3Y2D24.js} +4 -4
- package/dist/{chunk-43LJSM4F.js → chunk-CSW6A2EW.js} +1 -1
- package/dist/{chunk-X7FESZTD.js → chunk-DZ75BJ7V.js} +3 -3
- package/dist/{chunk-DTQNDR7C.js → chunk-E7MJBWSR.js} +1 -1
- package/dist/{chunk-6IU45EHE.js → chunk-F2OPOBRO.js} +1 -1
- package/dist/{chunk-43ZDACBO.js → chunk-F4KRNFDE.js} +1 -1
- package/dist/{chunk-6QFEQIPM.js → chunk-FDF72XHK.js} +2 -2
- package/dist/{chunk-R5KY3PBN.js → chunk-FI3LQCUH.js} +5 -5
- package/dist/{chunk-KHXVTWYS.js → chunk-G5LENVCZ.js} +3 -3
- package/dist/{chunk-K3QVDAZW.js → chunk-GDXSCXQC.js} +1 -1
- package/dist/{chunk-5HYNICS7.js → chunk-GOXINLDU.js} +1 -1
- package/dist/{chunk-2QT3GCU4.js → chunk-GP6SFVEN.js} +1 -1
- package/dist/{chunk-4ERLRNOK.js → chunk-HWG7X3VI.js} +3 -3
- package/dist/{chunk-WNJSGZY7.js → chunk-KZBGITM4.js} +4 -4
- package/dist/{chunk-Z4VGIBJ7.js → chunk-MOQOJOMD.js} +3 -3
- package/dist/{chunk-HUAOMX4U.js → chunk-NDS27FXU.js} +1 -1
- package/dist/{chunk-YAWXKL2X.js → chunk-NYD7W7AT.js} +1 -1
- package/dist/{chunk-JKBDGZFL.js → chunk-OP7HFIWE.js} +22 -12
- package/dist/{chunk-5UQ5ATIE.js → chunk-OR3A3RLH.js} +1 -1
- package/dist/{chunk-XWEONSLV.js → chunk-PCVVCS4A.js} +1 -1
- package/dist/{chunk-KJRALILH.js → chunk-PRZXYILJ.js} +2 -2
- package/dist/{chunk-MU3WU2FO.js → chunk-RBPJO4KG.js} +1 -1
- package/dist/{chunk-TIWURSLS.js → chunk-SFNRAEEW.js} +1 -1
- package/dist/{chunk-USQDVBEV.js → chunk-TDKE3V6W.js} +1 -1
- package/dist/{chunk-HU5LSYL2.js → chunk-VMNI33F5.js} +1 -1
- package/dist/{chunk-UYDTFCHW.js → chunk-VZANUMIF.js} +1 -1
- package/dist/{chunk-3ZSGKLSO.js → chunk-XGL5JC6U.js} +2 -2
- package/dist/{chunk-6EEANS74.js → chunk-XQOT4CCK.js} +8 -3
- package/dist/{chunk-T4QY64OR.js → chunk-YFD7CRIZ.js} +376 -10
- package/dist/{reapply-5CZSTJZI.js → reapply-RRDVJATI.js} +9 -9
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +12 -12
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
activeHookSource,
|
|
3
3
|
activeIdentity
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FI3LQCUH.js";
|
|
5
5
|
import {
|
|
6
6
|
blockedActionFingerprint,
|
|
7
7
|
defersToNativeMode,
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
hasBlockedActionHint,
|
|
10
10
|
recordBlockedActionHint,
|
|
11
11
|
reportMachineDenial
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BE4P7ERZ.js";
|
|
13
13
|
import {
|
|
14
14
|
isGatingMoment,
|
|
15
15
|
recordKeylessMoment
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-F4KRNFDE.js";
|
|
17
17
|
import {
|
|
18
18
|
denyReasonFrom,
|
|
19
19
|
isDeferAnswer
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
reportEvent,
|
|
37
37
|
scopePathFor,
|
|
38
38
|
settleQuestionsForToolUse
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-66BIMA62.js";
|
|
40
40
|
import {
|
|
41
41
|
DECISION_STOP_REASON,
|
|
42
42
|
askUser,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
} from "./chunk-PYCQXCI5.js";
|
|
52
52
|
import {
|
|
53
53
|
getMachineId
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-7JSE6JTZ.js";
|
|
55
55
|
import {
|
|
56
56
|
getApiKey,
|
|
57
57
|
getBaseUrl
|
|
@@ -61,9 +61,13 @@ import {
|
|
|
61
61
|
GATE_BLOCK_REASON_MAX_LENGTH,
|
|
62
62
|
GATE_WIRE,
|
|
63
63
|
agentQuestionStrategy,
|
|
64
|
+
agentRulesAllowEveryInput,
|
|
64
65
|
buildDecisionEpisodeFeatures,
|
|
66
|
+
claudeAllowlistOwnsCall,
|
|
67
|
+
claudeConsultsItsAllowlist,
|
|
65
68
|
claudePermissionDeniedOutput,
|
|
66
69
|
claudePermissionRequestOutput,
|
|
70
|
+
claudePermissionRulesFromSettings,
|
|
67
71
|
claudePreToolUseOutput,
|
|
68
72
|
claudePromptsBeforeAnEdit,
|
|
69
73
|
editAsksAtTheAgentsPrompt,
|
|
@@ -79,7 +83,51 @@ import {
|
|
|
79
83
|
parseAgentQuestions,
|
|
80
84
|
resolveGate,
|
|
81
85
|
stoppedOutput
|
|
82
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-YFD7CRIZ.js";
|
|
87
|
+
|
|
88
|
+
// src/claude-permission-rules.ts
|
|
89
|
+
import { readFileSync, statSync } from "fs";
|
|
90
|
+
import { homedir } from "os";
|
|
91
|
+
import { join } from "path";
|
|
92
|
+
var MANAGED_CLAUDE_SETTINGS_BY_PLATFORM = {
|
|
93
|
+
darwin: "/Library/Application Support/ClaudeCode/managed-settings.json",
|
|
94
|
+
linux: "/etc/claude-code/managed-settings.json",
|
|
95
|
+
win32: "C:\\ProgramData\\ClaudeCode\\managed-settings.json"
|
|
96
|
+
};
|
|
97
|
+
var MAX_CLAUDE_SETTINGS_BYTES = 1048576;
|
|
98
|
+
var claudeSettingsLocationFor = (cwd, environment = process.env, home = homedir(), platform = process.platform) => ({
|
|
99
|
+
configDir: environment.CLAUDE_CONFIG_DIR || join(home, ".claude"),
|
|
100
|
+
projectDir: environment.CLAUDE_PROJECT_DIR || cwd || void 0,
|
|
101
|
+
managedSettingsPath: MANAGED_CLAUDE_SETTINGS_BY_PLATFORM[platform]
|
|
102
|
+
});
|
|
103
|
+
var claudeSettingsSources = (location) => [
|
|
104
|
+
...location.managedSettingsPath ? [{ path: location.managedSettingsPath, trust: "grants" }] : [],
|
|
105
|
+
{ path: join(location.configDir, "settings.json"), trust: "grants" },
|
|
106
|
+
...location.projectDir ? [
|
|
107
|
+
{ path: join(location.projectDir, ".claude", "settings.json"), trust: "restricts_only" },
|
|
108
|
+
{ path: join(location.projectDir, ".claude", "settings.local.json"), trust: "grants" }
|
|
109
|
+
] : []
|
|
110
|
+
];
|
|
111
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
112
|
+
var restrictionsOnly = (document) => {
|
|
113
|
+
if (!isRecord(document) || !isRecord(document.permissions)) return null;
|
|
114
|
+
const { ask: ask2, deny: deny2 } = document.permissions;
|
|
115
|
+
return { permissions: { ask: ask2, deny: deny2 } };
|
|
116
|
+
};
|
|
117
|
+
var readSettingsDocument = (path) => {
|
|
118
|
+
try {
|
|
119
|
+
const stats = statSync(path);
|
|
120
|
+
if (!stats.isFile() || stats.size > MAX_CLAUDE_SETTINGS_BYTES) return null;
|
|
121
|
+
return JSON.parse(readFileSync(path, "utf8"));
|
|
122
|
+
} catch {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
var trustedDocument = ({ path, trust }) => {
|
|
127
|
+
const document = readSettingsDocument(path);
|
|
128
|
+
return trust === "grants" ? document : restrictionsOnly(document);
|
|
129
|
+
};
|
|
130
|
+
var readClaudePermissionRules = (location) => claudePermissionRulesFromSettings(claudeSettingsSources(location).map(trustedDocument));
|
|
83
131
|
|
|
84
132
|
// src/decision-episode.ts
|
|
85
133
|
var EPISODE_PATH = "/api/agent/decision-episode";
|
|
@@ -104,7 +152,7 @@ var reportDecisionEpisode = async (apiKey, input) => {
|
|
|
104
152
|
};
|
|
105
153
|
|
|
106
154
|
// src/hook.ts
|
|
107
|
-
import { basename, join } from "path";
|
|
155
|
+
import { basename, join as join2 } from "path";
|
|
108
156
|
import { tmpdir } from "os";
|
|
109
157
|
import { existsSync, writeFileSync } from "fs";
|
|
110
158
|
var START_MS = Date.now();
|
|
@@ -259,7 +307,8 @@ var dispatchModeHandler = async (apiKey, input, toolPolicy, machineId, trainingC
|
|
|
259
307
|
// The gate asks at most one question per tool call, so the runtime's id needs
|
|
260
308
|
// no suffix here. Absent on runtimes that do not send one, and the server then
|
|
261
309
|
// creates a fresh decision exactly as before.
|
|
262
|
-
toolUseId: input.tool_use_id
|
|
310
|
+
toolUseId: input.tool_use_id,
|
|
311
|
+
sessionToolAware: true
|
|
263
312
|
};
|
|
264
313
|
const signals = {};
|
|
265
314
|
const runHandler = () => {
|
|
@@ -298,7 +347,7 @@ var KEYLESS_NOTICE = "[pushary] Not connected (no API key), so your agent runs u
|
|
|
298
347
|
var oncePerSession = (kind, sessionId) => {
|
|
299
348
|
try {
|
|
300
349
|
const key = (sessionId || DEFAULT_SESSION).replace(/[^a-zA-Z0-9_-]/g, "");
|
|
301
|
-
const marker =
|
|
350
|
+
const marker = join2(tmpdir(), `pushary-${kind}-${key}`);
|
|
302
351
|
if (existsSync(marker)) return false;
|
|
303
352
|
writeFileSync(marker, "1", "utf-8");
|
|
304
353
|
return true;
|
|
@@ -457,6 +506,8 @@ var handleKeyless = (input) => {
|
|
|
457
506
|
}
|
|
458
507
|
return void 0;
|
|
459
508
|
};
|
|
509
|
+
var claudePermissionRulesFor = (input) => ACTIVE_SOURCE === "claude" ? readClaudePermissionRules(claudeSettingsLocationFor(input.cwd)) : null;
|
|
510
|
+
var claudeRulesMayCover = (input, rules) => rules !== null && claudeConsultsItsAllowlist(input.permission_mode) && agentRulesAllowEveryInput(rules, input.tool_name, [input.tool_input ?? {}], input.cwd);
|
|
460
511
|
var claudeGateInput = (modeState, config, input, canonical) => {
|
|
461
512
|
const toolName = canonical?.toolName ?? input.tool_name;
|
|
462
513
|
const toolInputs = canonical?.toolInputs ?? [input.tool_input ?? {}];
|
|
@@ -549,6 +600,7 @@ var handlePreToolUse = async (input, canonical) => {
|
|
|
549
600
|
if (!(verdict.kind === "gate" && verdict.scopeReason) && shouldDeferToNativeMode(input.permission_mode, input.tool_name)) {
|
|
550
601
|
return void 0;
|
|
551
602
|
}
|
|
603
|
+
if (claudeAllowlistOwnsCall(gateInput, verdict, input.permission_mode, claudePermissionRulesFor(input))) return void 0;
|
|
552
604
|
if (claudePromptsBeforeAnEdit(input.permission_mode) && editAsksAtTheAgentsPrompt(gateInput, verdict)) return handleTerminalOnly();
|
|
553
605
|
switch (verdict.kind) {
|
|
554
606
|
case "allow":
|
|
@@ -578,7 +630,8 @@ var toPermissionRequestOutput = (hookOutput) => {
|
|
|
578
630
|
return void 0;
|
|
579
631
|
};
|
|
580
632
|
var handlePermissionRequest = async (input, canonical) => {
|
|
581
|
-
|
|
633
|
+
const claudeRules = claudePermissionRulesFor(input);
|
|
634
|
+
if (canonical === void 0 && !claudeRulesMayCover(input, claudeRules) && isPermissionRequestOwnedByPreToolUse(input.tool_name, input.permission_mode, shouldDeferToNativeMode)) return void 0;
|
|
582
635
|
if (isPusharyOwnTool(input.tool_name)) return void 0;
|
|
583
636
|
let apiKey;
|
|
584
637
|
try {
|
|
@@ -589,7 +642,8 @@ var handlePermissionRequest = async (input, canonical) => {
|
|
|
589
642
|
try {
|
|
590
643
|
const modeState = await fetchModeState(apiKey, input.session_id);
|
|
591
644
|
const policy = await getPolicy(apiKey, modeState.policyVersion, ACTIVE_AGENT.type, true, input.session_id);
|
|
592
|
-
const
|
|
645
|
+
const gateInput = claudeGateInput(modeState, policy, input, canonical);
|
|
646
|
+
const verdict = resolveGate(gateInput);
|
|
593
647
|
if (verdict.kind === "kill") {
|
|
594
648
|
await reportMachineDenial(input, verdict, ACTIVE_AGENT);
|
|
595
649
|
return permReqHalted(verdict.reason);
|
|
@@ -601,7 +655,7 @@ var handlePermissionRequest = async (input, canonical) => {
|
|
|
601
655
|
if (canonical === null) return permReqDeny(unreadableReason);
|
|
602
656
|
if (agentQuestionStrategy(ACTIVE_SOURCE, "PermissionRequest", input.tool_name) === AGENT_QUESTION_STRATEGY.native) return void 0;
|
|
603
657
|
if (verdict.kind === "gate" && verdict.scopeReason && (canonical?.toolInputs.length ?? 0) > 1) return permReqDeny(batchScopeReason);
|
|
604
|
-
if (!(verdict.kind === "gate" && verdict.scopeReason) && isPermissionRequestOwnedByPreToolUse(input.tool_name, input.permission_mode, shouldDeferToNativeMode)) return void 0;
|
|
658
|
+
if (!(verdict.kind === "gate" && verdict.scopeReason) && !claudeAllowlistOwnsCall(gateInput, verdict, input.permission_mode, claudeRules) && isPermissionRequestOwnedByPreToolUse(input.tool_name, input.permission_mode, shouldDeferToNativeMode)) return void 0;
|
|
605
659
|
switch (verdict.kind) {
|
|
606
660
|
case "allow":
|
|
607
661
|
return permReqAllow();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOTIFICATION_PUSH_TYPES,
|
|
3
3
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VZANUMIF.js";
|
|
5
5
|
import {
|
|
6
6
|
cancelQuestion,
|
|
7
7
|
isPolicyConfig,
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
} from "./chunk-PYCQXCI5.js";
|
|
11
11
|
import {
|
|
12
12
|
getMachineId
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7JSE6JTZ.js";
|
|
14
14
|
import {
|
|
15
15
|
withRetry
|
|
16
16
|
} from "./chunk-HETOKNIL.js";
|
|
17
17
|
import {
|
|
18
18
|
reportedInstallSource
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-VMNI33F5.js";
|
|
20
20
|
import {
|
|
21
21
|
getApiKey,
|
|
22
22
|
getBaseUrl
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
resolveAutoResolveOrigin,
|
|
45
45
|
resolvePolicy,
|
|
46
46
|
toToolLookup
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-YFD7CRIZ.js";
|
|
48
48
|
|
|
49
49
|
// src/policy.ts
|
|
50
50
|
import { createHash } from "crypto";
|
|
@@ -58,7 +58,7 @@ var policyRequestFor = (agentType) => ({
|
|
|
58
58
|
repoAware: REPO_AWARE_AGENTS.includes(agentType)
|
|
59
59
|
});
|
|
60
60
|
var policyCacheFile = (apiKey, agent, repoAware = false) => {
|
|
61
|
-
const parts = [apiKey, agent, repoAware ? "repoAware" : void 0].filter(Boolean);
|
|
61
|
+
const parts = [apiKey, agent, repoAware ? "repoAware" : void 0, "sessionToolAware"].filter(Boolean);
|
|
62
62
|
const hash = createHash("sha256").update(parts.join(":")).digest("hex").slice(0, 12);
|
|
63
63
|
return join(tmpdir(), `pushary-policy-${hash}.json`);
|
|
64
64
|
};
|
|
@@ -69,6 +69,7 @@ var fetchPolicy = async (apiKey, agent, repoAware = false, sessionId) => {
|
|
|
69
69
|
if (agent) params.set("agent", agent);
|
|
70
70
|
if (repoAware) params.set("repoAware", "1");
|
|
71
71
|
params.set("scopeAware", "1");
|
|
72
|
+
params.set("sessionToolAware", "1");
|
|
72
73
|
if (sessionId) params.set("sessionId", sessionId);
|
|
73
74
|
const query = params.toString();
|
|
74
75
|
const url = query ? `${baseUrl}/api/mcp/policy?${query}` : `${baseUrl}/api/mcp/policy`;
|
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
} from "./chunk-SGZJ5LYH.js";
|
|
7
7
|
import {
|
|
8
8
|
hookOwnerOf
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KZBGITM4.js";
|
|
10
10
|
import {
|
|
11
11
|
ensureDaemonRunning
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DZ75BJ7V.js";
|
|
13
13
|
import {
|
|
14
14
|
buildTranscriptRecords,
|
|
15
15
|
decodePublicKey,
|
|
16
16
|
generateSessionKey,
|
|
17
17
|
wrapSessionKey
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-SFNRAEEW.js";
|
|
19
19
|
import {
|
|
20
20
|
fetchTranscriptRecipients,
|
|
21
21
|
uploadTranscriptRecords
|
|
@@ -23,14 +23,14 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
transcriptEnvironmentPreference,
|
|
25
25
|
transcriptsEnabled
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-GP6SFVEN.js";
|
|
27
27
|
import {
|
|
28
28
|
codexHome,
|
|
29
29
|
pusharyDir
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-F2OPOBRO.js";
|
|
31
31
|
import {
|
|
32
32
|
readTranscriptPreference
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-TDKE3V6W.js";
|
|
34
34
|
import {
|
|
35
35
|
writeJsonAtomic
|
|
36
36
|
} from "./chunk-T7E75EKA.js";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
COMPATIBLE_AGENT_TYPES,
|
|
9
9
|
isValidApiKey
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YFD7CRIZ.js";
|
|
11
11
|
|
|
12
12
|
// src/setup/options.ts
|
|
13
13
|
var AGENT_CHOICES = ["claude_code", "codex", "gemini_cli", "hermes", "cursor", "vscode", "opencode", ...COMPATIBLE_AGENT_TYPES, "custom"];
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
permissionDeniedAction,
|
|
8
8
|
releaseThrottle,
|
|
9
9
|
reportEvent
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-66BIMA62.js";
|
|
11
11
|
import {
|
|
12
12
|
canonicalJson
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-F2OPOBRO.js";
|
|
14
14
|
import {
|
|
15
15
|
writeFileAtomic
|
|
16
16
|
} from "./chunk-T7E75EKA.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
machineDecisionFor,
|
|
21
21
|
shouldDeferToNativeMode,
|
|
22
22
|
wireVerdictFor
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-YFD7CRIZ.js";
|
|
24
24
|
|
|
25
25
|
// src/machine-decision-audit.ts
|
|
26
26
|
import { basename } from "path";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOTIFICATION_MATCHED_TYPES,
|
|
3
3
|
POSTTOOLUSE_MIRRORED_TOOLS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VZANUMIF.js";
|
|
5
5
|
import {
|
|
6
6
|
isProtectedByScope,
|
|
7
7
|
registerHookEntry
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-F2OPOBRO.js";
|
|
9
9
|
import {
|
|
10
10
|
CLAUDE_PRETOOLUSE_MATCHER,
|
|
11
11
|
HOOK_BUDGETS,
|
|
12
12
|
HOOK_LOCATOR_BINARY
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YFD7CRIZ.js";
|
|
14
14
|
|
|
15
15
|
// src/gemini-config.ts
|
|
16
16
|
var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
|
|
@@ -2,21 +2,21 @@ import {
|
|
|
2
2
|
detectProviderLiveCapabilities,
|
|
3
3
|
hasSpawnProvider,
|
|
4
4
|
resolveControlPolicy
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5MH5P366.js";
|
|
6
6
|
import {
|
|
7
7
|
daemonHasRemoteProof,
|
|
8
8
|
daemonServiceManagerAvailable,
|
|
9
9
|
hasDaemonServiceDefinition,
|
|
10
10
|
readDaemonNeedsLogin,
|
|
11
11
|
readDaemonStatus
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DZ75BJ7V.js";
|
|
13
13
|
import {
|
|
14
14
|
getMachineId
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7JSE6JTZ.js";
|
|
16
16
|
import {
|
|
17
17
|
readControlMode,
|
|
18
18
|
readKeySource
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-TDKE3V6W.js";
|
|
20
20
|
import {
|
|
21
21
|
getBaseUrl
|
|
22
22
|
} from "./chunk-OSJEMXSR.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey,
|
|
15
15
|
normalizeKeyScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YFD7CRIZ.js";
|
|
17
17
|
|
|
18
18
|
// src/session.ts
|
|
19
19
|
var samePusharyAccount = (left, right) => left.kind === "ok" && right.kind === "ok" && left.identity.workspaceId !== "" && left.identity.workspaceId === right.identity.workspaceId && left.identity.siteId === right.identity.siteId;
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-XHKBHWLX.js";
|
|
5
5
|
import {
|
|
6
6
|
getMachineId
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7JSE6JTZ.js";
|
|
8
8
|
import {
|
|
9
9
|
pusharyDir,
|
|
10
10
|
resolveGlobalBinary
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-F2OPOBRO.js";
|
|
12
12
|
import {
|
|
13
13
|
readControlMode
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TDKE3V6W.js";
|
|
15
15
|
import {
|
|
16
16
|
readJsonSafe,
|
|
17
17
|
writeFileAtomic,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerTranscript
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A2GS2ENL.js";
|
|
4
4
|
import {
|
|
5
5
|
degradedLine
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YFD7CRIZ.js";
|
|
7
7
|
|
|
8
8
|
// src/tool-hook-input.ts
|
|
9
9
|
var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode"];
|
|
@@ -3,28 +3,28 @@ import {
|
|
|
3
3
|
addPusharyToolPermissions,
|
|
4
4
|
isPusharyHook,
|
|
5
5
|
removeClaudeMcpServers
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HWG7X3VI.js";
|
|
7
7
|
import {
|
|
8
8
|
CLAUDE_HOOK_EVENTS,
|
|
9
9
|
addGeminiMcpServer,
|
|
10
10
|
removeGeminiMcpServer
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BK5F3FGE.js";
|
|
12
12
|
import {
|
|
13
13
|
CLAUDE_CODE_AGENT,
|
|
14
14
|
parseApplyPatchFiles
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-66BIMA62.js";
|
|
16
16
|
import {
|
|
17
17
|
guardBinary,
|
|
18
18
|
holdBudgetOf,
|
|
19
19
|
registerHookEntry
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-F2OPOBRO.js";
|
|
21
21
|
import {
|
|
22
22
|
PHONE_ANSWERED_TOOLS,
|
|
23
23
|
hookCompatibleProfile,
|
|
24
24
|
hookCompatibleProfileBySource,
|
|
25
25
|
toToolLookup,
|
|
26
26
|
withHookHoldBudget
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-YFD7CRIZ.js";
|
|
28
28
|
|
|
29
29
|
// src/compatible-config.ts
|
|
30
30
|
import { homedir } from "os";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openCodeConfigDirFrom
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-B6TYEKJR.js";
|
|
4
4
|
import {
|
|
5
5
|
codexHomeFrom
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-F2OPOBRO.js";
|
|
7
7
|
import {
|
|
8
8
|
HOOK_COMPATIBLE_PROFILES
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YFD7CRIZ.js";
|
|
10
10
|
|
|
11
11
|
// src/vscode-config.ts
|
|
12
12
|
import { homedir } from "os";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
supportedClaudeEvents
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BK5F3FGE.js";
|
|
5
5
|
import {
|
|
6
6
|
guardBinary,
|
|
7
7
|
holdBudgetOf,
|
|
8
8
|
isProtectedByScope,
|
|
9
9
|
registerHookEntry
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-F2OPOBRO.js";
|
|
11
11
|
import {
|
|
12
12
|
HOOK_LOCATOR_BINARY,
|
|
13
13
|
withHookHoldBudget
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YFD7CRIZ.js";
|
|
15
15
|
|
|
16
16
|
// src/claude-config.ts
|
|
17
17
|
import { join } from "path";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AGENT_CHOICES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A5URWZTP.js";
|
|
4
4
|
import {
|
|
5
5
|
isBridgeLocator
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GDXSCXQC.js";
|
|
7
7
|
import {
|
|
8
8
|
pusharyHookExecutable
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MOQOJOMD.js";
|
|
10
10
|
import {
|
|
11
11
|
BELL_HOOK_BINARY
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OR3A3RLH.js";
|
|
13
13
|
|
|
14
14
|
// src/setup/hook-ownership.ts
|
|
15
15
|
var commandsIn = (value) => {
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
GEMINI_HOOK_EVENTS,
|
|
4
4
|
hasGeminiHooks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-BK5F3FGE.js";
|
|
6
6
|
import {
|
|
7
7
|
CODEX_HOOK_EVENTS,
|
|
8
8
|
hasCodexHooks,
|
|
9
9
|
holdBudgetOf
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-F2OPOBRO.js";
|
|
11
11
|
import {
|
|
12
12
|
CURSOR_GATE_EVENTS,
|
|
13
13
|
HOOK_LOCATOR_BINARY,
|
|
14
14
|
hookCommandHoldBudget
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-YFD7CRIZ.js";
|
|
16
16
|
|
|
17
17
|
// src/diagnostics/wiring.ts
|
|
18
18
|
var record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : null;
|