@pushary/agent-hooks 1.9.171 → 1.9.174
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/{api-WOLCBFMV.js → api-MNYX7TLY.js} +11 -11
- package/dist/bin/pushary-audit.js +3 -3
- package/dist/bin/pushary-bell-hook.js +28 -28
- package/dist/bin/pushary-bell.js +12 -11
- package/dist/bin/pushary-calls.js +15 -15
- package/dist/bin/pushary-claude.js +32 -34
- package/dist/bin/pushary-clean.js +38 -38
- package/dist/bin/pushary-codex-bridge.js +23 -23
- package/dist/bin/pushary-codex-hook.js +44 -46
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +19 -18
- package/dist/bin/pushary-connect.js +34 -34
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +53 -52
- package/dist/bin/pushary-disconnect.js +29 -29
- package/dist/bin/pushary-doctor.js +46 -46
- package/dist/bin/pushary-elicitation-hook.js +31 -30
- package/dist/bin/pushary-gemini-bridge.js +21 -19
- package/dist/bin/pushary-gemini-hook.js +38 -40
- package/dist/bin/pushary-hook.js +36 -36
- package/dist/bin/pushary-login.js +22 -22
- package/dist/bin/pushary-logout.js +29 -29
- package/dist/bin/pushary-mcp.js +12 -12
- package/dist/bin/pushary-mode.js +16 -16
- package/dist/bin/pushary-notification-hook.js +27 -27
- package/dist/bin/pushary-opencode-hook.js +44 -53
- package/dist/bin/pushary-permission-denied-hook.js +36 -36
- package/dist/bin/pushary-permission-hook.js +36 -36
- package/dist/bin/pushary-post-hook.js +28 -28
- package/dist/bin/pushary-prompt-hook.js +27 -27
- package/dist/bin/pushary-session-end-hook.js +27 -27
- package/dist/bin/pushary-session-start-hook.js +38 -38
- package/dist/bin/pushary-sessions.js +14 -14
- package/dist/bin/pushary-setup.js +61 -59
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +35 -35
- package/dist/bin/pushary-stop-hook.js +27 -27
- package/dist/bin/pushary-stopfailure-hook.js +27 -27
- package/dist/bin/pushary-suggestions.js +16 -16
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +25 -25
- package/dist/bin/pushary-upgrade.js +43 -43
- package/dist/bin/pushary-wait.js +16 -16
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-EQQOEDQZ.js → chunk-2EHDZOJA.js} +13 -13
- package/dist/{chunk-G7U5TFPY.js → chunk-2IEU6RX5.js} +1 -1
- package/dist/{chunk-JNVUOEKM.js → chunk-3FOW4K2L.js} +4 -4
- package/dist/{chunk-UCND4JHN.js → chunk-3L5DXDPK.js} +1 -1
- package/dist/{chunk-XHUR62AQ.js → chunk-4IOCYW6O.js} +3 -3
- package/dist/{chunk-CUWHBFBB.js → chunk-4NXEOPXZ.js} +1 -1
- package/dist/{chunk-3GIVPZIS.js → chunk-57C45LJT.js} +2 -2
- package/dist/{chunk-EGDFXMFK.js → chunk-5JCKVJC6.js} +5 -5
- package/dist/{chunk-GVIKF73A.js → chunk-5LIGHRBH.js} +1 -1
- package/dist/{chunk-FJF2D32S.js → chunk-6355EUTT.js} +3 -3
- package/dist/{chunk-HRUKMGRH.js → chunk-6BZCNKCY.js} +3 -3
- package/dist/{chunk-NJNK3ZUC.js → chunk-6HYQSAMW.js} +2 -2
- package/dist/{chunk-UHKYKZQ5.js → chunk-76T3UMRC.js} +31 -32
- package/dist/{chunk-5EU7V5CT.js → chunk-7VG4JO77.js} +4 -4
- package/dist/{chunk-J2CRP5GN.js → chunk-7XALAS43.js} +2 -2
- package/dist/{chunk-W4NCWOVL.js → chunk-7YVSQ342.js} +1 -1
- package/dist/{chunk-DCYRV2BJ.js → chunk-A3YA4EIY.js} +2 -2
- package/dist/{chunk-ZHO263F6.js → chunk-BHBHY35A.js} +4 -4
- package/dist/{chunk-JE6NVEOE.js → chunk-C7SKKHMD.js} +7 -5
- package/dist/{chunk-WKRKTQLA.js → chunk-CDUTYRXO.js} +4 -4
- package/dist/{chunk-DXUPOVJP.js → chunk-CPV25VW5.js} +1 -1
- package/dist/{chunk-5HT352IV.js → chunk-CTLI2HJE.js} +5 -5
- package/dist/{chunk-CJODSIXH.js → chunk-DJS7W4SC.js} +6 -6
- package/dist/{chunk-2TRYSF64.js → chunk-DNJKQHK2.js} +20 -1
- package/dist/{chunk-E7ATFUXV.js → chunk-DPHYIJNF.js} +3 -3
- package/dist/{chunk-YG3KWXGC.js → chunk-E2WABTIY.js} +7 -7
- package/dist/{chunk-KNFZORNH.js → chunk-ET2BWLQX.js} +3 -3
- package/dist/{chunk-7ODDR6FA.js → chunk-FPF7ZSH5.js} +2 -2
- package/dist/{chunk-U2XCKXBH.js → chunk-FS7WOHFO.js} +5 -5
- package/dist/{chunk-D3TNLVVL.js → chunk-GGNKMBCN.js} +4 -4
- package/dist/{chunk-SQCW64C2.js → chunk-GPHESUOZ.js} +4 -4
- package/dist/{chunk-LABBFTYJ.js → chunk-GTCNACQ2.js} +5 -5
- package/dist/{chunk-I72TVBOG.js → chunk-H3MY3EQP.js} +4 -4
- package/dist/{chunk-FCNYCY6G.js → chunk-HGVGOGVD.js} +3 -3
- package/dist/{chunk-LEAACRFN.js → chunk-HLK3ZELO.js} +2 -2
- package/dist/{chunk-CLT4J5N5.js → chunk-HUJWZIQ2.js} +2 -2
- package/dist/{chunk-SM65Z6CM.js → chunk-HZGSGLK4.js} +6 -6
- package/dist/{chunk-7AENNOGX.js → chunk-IP4NJN6G.js} +1 -1
- package/dist/{chunk-Y54VMOE5.js → chunk-IQNM745W.js} +2 -2
- package/dist/{chunk-GZZ7XGL5.js → chunk-JG2ZVO5L.js} +1 -1
- package/dist/{chunk-7L3MVK44.js → chunk-JXOVA3JW.js} +5 -5
- package/dist/{chunk-NWHMER6L.js → chunk-K5NBHOE6.js} +2 -2
- package/dist/{chunk-3I3RUJRD.js → chunk-LH5JTAAH.js} +2 -2
- package/dist/{chunk-IHNII3GT.js → chunk-LIVVVKIZ.js} +3 -3
- package/dist/{chunk-AVN4A4A6.js → chunk-M4KQPSMS.js} +1 -1
- package/dist/{chunk-DRRFOQGF.js → chunk-MF6FSDM4.js} +2 -2
- package/dist/{chunk-SSKNRWWS.js → chunk-N73CKAC6.js} +1 -1
- package/dist/{chunk-MV7NJYJX.js → chunk-O4AAXXXP.js} +3 -3
- package/dist/{chunk-IYTTLDB5.js → chunk-OBNVYNPQ.js} +3 -3
- package/dist/{chunk-CFZUESTS.js → chunk-OFKKNHYJ.js} +1 -1
- package/dist/{chunk-EGPOBJZG.js → chunk-OLKAGHOO.js} +1 -1
- package/dist/{chunk-D6OCHPLT.js → chunk-PAYK5BD7.js} +2 -2
- package/dist/{chunk-WI2WYKSE.js → chunk-PDIN6FE5.js} +1 -1
- package/dist/{chunk-KQXKDF4N.js → chunk-PWJ76P2L.js} +6 -6
- package/dist/{chunk-SJDYK47V.js → chunk-PZNVSYIY.js} +5 -5
- package/dist/{chunk-KMKU2INV.js → chunk-QCZMBOMF.js} +1 -1
- package/dist/{chunk-W46HI6T3.js → chunk-R3EIRYON.js} +5 -5
- package/dist/{chunk-BKVQKWLY.js → chunk-R4RL4UDT.js} +5 -5
- package/dist/{chunk-FP4W2EI6.js → chunk-RIHIXQAL.js} +11 -11
- package/dist/{chunk-FIJPDZIR.js → chunk-RT6FAMIF.js} +26 -25
- package/dist/{chunk-IV7WDCKS.js → chunk-S3X6WLW5.js} +1 -1
- package/dist/{chunk-3PQWVDW5.js → chunk-SHLAHE46.js} +9 -9
- package/dist/{chunk-5GUZJIEL.js → chunk-SNY4ABHS.js} +4 -4
- package/dist/{chunk-JUE347Z7.js → chunk-TRXYUOWW.js} +6 -6
- package/dist/{chunk-A2DVMIX4.js → chunk-TU5DTA2V.js} +1 -1
- package/dist/{chunk-HBJLJHZF.js → chunk-UJ6ZJNHK.js} +2 -2
- package/dist/{chunk-L77OIGRB.js → chunk-US4LUIFU.js} +20 -0
- package/dist/{chunk-ZLMWP6X4.js → chunk-VCWHZDP3.js} +2 -2
- package/dist/{chunk-AUF4BMGA.js → chunk-VH2DDTBE.js} +10 -10
- package/dist/{chunk-2SMEEXDR.js → chunk-VLEKL3PF.js} +1 -1
- package/dist/{chunk-RPMVO2RJ.js → chunk-WAZIEUIG.js} +7 -5
- package/dist/{chunk-V762IZHX.js → chunk-WWVVLMPJ.js} +5 -3
- package/dist/{chunk-FFJX6YOQ.js → chunk-X5LTD4VA.js} +1 -1
- package/dist/{chunk-2XEZJK7G.js → chunk-XZOYXQ6J.js} +5 -5
- package/dist/{chunk-7XSZK4DH.js → chunk-YDYKKSFU.js} +3 -3
- package/dist/{chunk-UB5G7ZZN.js → chunk-YE7WPP7M.js} +1 -1
- package/dist/{chunk-MJMRJ5ZF.js → chunk-YFOR2JQQ.js} +1 -1
- package/dist/{chunk-PQEX64YL.js → chunk-YXLWKFKC.js} +6 -6
- package/dist/{chunk-2RN7D6VI.js → chunk-Z6YRFNN3.js} +4 -4
- package/dist/{chunk-GTB4MBMU.js → chunk-ZLXN26UD.js} +6 -6
- package/dist/{codex-app-cards-switch-TRZKDOVK.js → codex-app-cards-switch-MJA47AZY.js} +11 -11
- package/dist/{codex-card-routing-QGOX4RNI.js → codex-card-routing-2MDDCMAO.js} +2 -2
- package/dist/{codex-desktop-launch-AI5J526F.js → codex-desktop-launch-7IVPOMSK.js} +1 -1
- package/dist/{codex-session-launch-UWD7U2LW.js → codex-session-launch-U6JUH6X6.js} +20 -20
- package/dist/{config-QIHLQCEV.js → config-S2OVEI6F.js} +3 -3
- package/dist/{global-upgrade-4K5SGI7Q.js → global-upgrade-XGDWDFQN.js} +9 -9
- package/dist/{identity-MRXHTKAC.js → identity-7LLNHIP3.js} +4 -4
- package/dist/{live-capabilities-PO5JOGZJ.js → live-capabilities-CI46M4XO.js} +4 -4
- package/dist/{paths-AXIBD5XG.js → paths-FVQYVHLH.js} +3 -3
- package/dist/{reapply-7FJNSGUM.js → reapply-M4DKHUZX.js} +31 -31
- package/dist/src/index.js +35 -35
- package/dist/{upgrade-lock-G3RQPHYM.js → upgrade-lock-DTWLFPH2.js} +4 -4
- package/dist/{usage-GDUDYZSV.js → usage-IHNVIPGZ.js} +3 -3
- package/package.json +1 -1
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
NpmMissingError,
|
|
4
4
|
NpmPermissionError,
|
|
5
5
|
NpmReleaseAgeError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GGNKMBCN.js";
|
|
7
7
|
import {
|
|
8
8
|
writeFileAtomic
|
|
9
9
|
} from "./chunk-PM2NRK6Y.js";
|
|
10
10
|
import {
|
|
11
11
|
NPX_LATEST_COMMAND
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-S3X6WLW5.js";
|
|
13
13
|
import {
|
|
14
14
|
readSetupAgentFailures
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-US4LUIFU.js";
|
|
16
16
|
|
|
17
17
|
// src/setup/config-write.ts
|
|
18
18
|
var AgentConfigWriteError = class extends Error {
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./chunk-55L4JSPA.js";
|
|
5
5
|
import {
|
|
6
6
|
fetchAsCredential
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-N73CKAC6.js";
|
|
8
8
|
import {
|
|
9
9
|
getBaseUrl
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-TU5DTA2V.js";
|
|
11
11
|
import {
|
|
12
12
|
writeJsonAtomicDurable
|
|
13
13
|
} from "./chunk-PM2NRK6Y.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
compressTranscriptRecord,
|
|
16
16
|
redactSecretsFromContent,
|
|
17
17
|
transcriptRecordPlaintext
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-US4LUIFU.js";
|
|
19
19
|
|
|
20
20
|
// src/transcript-recipient-pin.ts
|
|
21
21
|
import { createHash } from "crypto";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MF6FSDM4.js";
|
|
4
4
|
import {
|
|
5
5
|
readJsonSafe
|
|
6
6
|
} from "./chunk-PM2NRK6Y.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-US4LUIFU.js";
|
|
10
10
|
|
|
11
11
|
// src/process-ownership.ts
|
|
12
12
|
import { createHash, randomUUID } from "crypto";
|
|
@@ -2,39 +2,39 @@ import {
|
|
|
2
2
|
forgetPhoneApproval,
|
|
3
3
|
rememberPhoneApproval,
|
|
4
4
|
takePhoneApproval
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-57C45LJT.js";
|
|
6
6
|
import {
|
|
7
7
|
claudeSettingsLocationFor,
|
|
8
8
|
readClaudePermissionRules
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-K5NBHOE6.js";
|
|
10
10
|
import {
|
|
11
11
|
defersToNativeMode
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7YVSQ342.js";
|
|
13
13
|
import {
|
|
14
14
|
askAgentQuestions,
|
|
15
15
|
outcomeOfFailedAsk,
|
|
16
16
|
storedWaitDeadline
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-R4RL4UDT.js";
|
|
18
18
|
import {
|
|
19
19
|
reportMachineDenial
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-C7SKKHMD.js";
|
|
21
21
|
import {
|
|
22
22
|
isGatingMoment,
|
|
23
23
|
recordKeylessMoment
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-VLEKL3PF.js";
|
|
25
25
|
import {
|
|
26
26
|
isAdmitted,
|
|
27
27
|
readAdmissionRules
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-CTLI2HJE.js";
|
|
29
29
|
import {
|
|
30
30
|
isDeferAnswer,
|
|
31
31
|
oncePerSession
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-4NXEOPXZ.js";
|
|
33
33
|
import {
|
|
34
34
|
activeHookSource,
|
|
35
35
|
activeIdentity,
|
|
36
36
|
namedSource
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-R3EIRYON.js";
|
|
38
38
|
import {
|
|
39
39
|
DEFAULT_SESSION,
|
|
40
40
|
approvalAwaitingRetry,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
settleQuestionsForToolUse,
|
|
58
58
|
sweepFilesOlderThan,
|
|
59
59
|
userScope
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-RT6FAMIF.js";
|
|
61
61
|
import {
|
|
62
62
|
UNNAMED_ACTION,
|
|
63
63
|
deriveAction,
|
|
@@ -68,12 +68,7 @@ import {
|
|
|
68
68
|
patchDeletesFiles,
|
|
69
69
|
permissionDeniedAction,
|
|
70
70
|
scopePathFor
|
|
71
|
-
} from "./chunk-
|
|
72
|
-
import {
|
|
73
|
-
branchFor,
|
|
74
|
-
repoKeyFor,
|
|
75
|
-
repositoryScopeFor
|
|
76
|
-
} from "./chunk-2TRYSF64.js";
|
|
71
|
+
} from "./chunk-OFKKNHYJ.js";
|
|
77
72
|
import {
|
|
78
73
|
askUser,
|
|
79
74
|
cancelQuestion,
|
|
@@ -90,23 +85,29 @@ import {
|
|
|
90
85
|
waitForQuestion,
|
|
91
86
|
waitsForThePhone,
|
|
92
87
|
withdrawQuestion
|
|
93
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-YXLWKFKC.js";
|
|
89
|
+
import {
|
|
90
|
+
branchFor,
|
|
91
|
+
projectNameFor,
|
|
92
|
+
repoKeyFor,
|
|
93
|
+
repositoryScopeFor
|
|
94
|
+
} from "./chunk-DNJKQHK2.js";
|
|
94
95
|
import {
|
|
95
96
|
getMachineId
|
|
96
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-YFOR2JQQ.js";
|
|
97
98
|
import {
|
|
98
99
|
POSTTOOLUSE_MIRRORED_TOOLS
|
|
99
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-MF6FSDM4.js";
|
|
100
101
|
import {
|
|
101
102
|
getApiKey,
|
|
102
103
|
getBaseUrl
|
|
103
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-TU5DTA2V.js";
|
|
104
105
|
import {
|
|
105
106
|
writeFileAtomic
|
|
106
107
|
} from "./chunk-PM2NRK6Y.js";
|
|
107
108
|
import {
|
|
108
109
|
NPX_LATEST_COMMAND
|
|
109
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-S3X6WLW5.js";
|
|
110
111
|
import {
|
|
111
112
|
AGENT_QUESTION_STRATEGY,
|
|
112
113
|
AGENT_QUESTION_TOOL,
|
|
@@ -140,6 +141,7 @@ import {
|
|
|
140
141
|
claudePermissionRequestOutput,
|
|
141
142
|
claudePreToolUseOutput,
|
|
142
143
|
claudePromptTakesTheCall,
|
|
144
|
+
claudeQuestionAnswers,
|
|
143
145
|
claudeStoppedPermissionRequestOutput,
|
|
144
146
|
claudeStoppedPreToolUseOutput,
|
|
145
147
|
denyReasonFrom,
|
|
@@ -177,7 +179,7 @@ import {
|
|
|
177
179
|
timeoutActionWithoutLocalPrompt,
|
|
178
180
|
unansweredRefusalReason,
|
|
179
181
|
unapprovedScopeReason
|
|
180
|
-
} from "./chunk-
|
|
182
|
+
} from "./chunk-US4LUIFU.js";
|
|
181
183
|
|
|
182
184
|
// src/terminal-answer-watch.ts
|
|
183
185
|
import { closeSync, openSync, readSync, statSync } from "fs";
|
|
@@ -294,9 +296,6 @@ var reportDecisionEpisode = async (apiKey, input) => {
|
|
|
294
296
|
}
|
|
295
297
|
};
|
|
296
298
|
|
|
297
|
-
// src/hook.ts
|
|
298
|
-
import { basename } from "path";
|
|
299
|
-
|
|
300
299
|
// src/pre-tool-use-output.ts
|
|
301
300
|
var allow = (reason) => claudePreToolUseOutput("allow", reason);
|
|
302
301
|
var deny = (reason) => claudePreToolUseOutput("deny", reason);
|
|
@@ -585,7 +584,7 @@ var outcomeOfDispatch = (decided) => {
|
|
|
585
584
|
};
|
|
586
585
|
var dispatchModeDecision = async (apiKey, input, toolPolicy, machineId, trainingConsent = false, scopeReason, scopePath, terminalLive, askReason, matchedRoute) => {
|
|
587
586
|
const description = describeToolCall(input.tool_name, input.tool_input, "hook");
|
|
588
|
-
const projectName =
|
|
587
|
+
const projectName = projectNameFor(input.cwd);
|
|
589
588
|
const sessionId = input.session_id;
|
|
590
589
|
const toolTarget = deriveToolTarget(input.tool_name, input.tool_input);
|
|
591
590
|
const ownPrompt = hasItsOwnApprovalPrompt(ACTIVE_SOURCE);
|
|
@@ -697,7 +696,7 @@ var handleAskUserQuestion = async (apiKey, input, modeState) => {
|
|
|
697
696
|
if (questionHandedToTheTerminal(input.tool_name, modeState)) return void 0;
|
|
698
697
|
const questions = parseAgentQuestions(input.tool_input ?? {});
|
|
699
698
|
if (!questions) return void 0;
|
|
700
|
-
const projectName =
|
|
699
|
+
const projectName = projectNameFor(input.cwd);
|
|
701
700
|
const deadline = hookWaitDeadline(START_MS, effectiveWaitSeconds("wait", 0, "claude"), "claude", Date.now());
|
|
702
701
|
const outcome = await askAgentQuestions(apiKey, {
|
|
703
702
|
toolName: AGENT_QUESTION_TOOL,
|
|
@@ -709,7 +708,7 @@ var handleAskUserQuestion = async (apiKey, input, modeState) => {
|
|
|
709
708
|
}, questions);
|
|
710
709
|
switch (outcome.kind) {
|
|
711
710
|
case "answered":
|
|
712
|
-
return allowWithInput({ ...input.tool_input ?? {}, answers: outcome.answers });
|
|
711
|
+
return allowWithInput({ ...input.tool_input ?? {}, answers: claudeQuestionAnswers(questions, outcome.answers) });
|
|
713
712
|
case "stopped":
|
|
714
713
|
case "unavailable":
|
|
715
714
|
return halted(DECISION_STOP_REASON);
|
|
@@ -721,7 +720,7 @@ var PLAN_APPROVE = "Approve, start coding";
|
|
|
721
720
|
var PLAN_KEEP_PLANNING = "Keep planning";
|
|
722
721
|
var handleExitPlanMode = async (apiKey, input) => {
|
|
723
722
|
const toolInput = input.tool_input ?? {};
|
|
724
|
-
const projectName =
|
|
723
|
+
const projectName = projectNameFor(input.cwd);
|
|
725
724
|
const deadline = hookWaitDeadline(START_MS, effectiveWaitSeconds("wait", 0, "claude"), "claude", Date.now());
|
|
726
725
|
let result;
|
|
727
726
|
try {
|
|
@@ -761,7 +760,7 @@ var handleKeyless = (input) => {
|
|
|
761
760
|
recordKeylessMoment({
|
|
762
761
|
ts: Date.now(),
|
|
763
762
|
tool: input.tool_name,
|
|
764
|
-
project:
|
|
763
|
+
project: projectNameFor(input.cwd),
|
|
765
764
|
sessionId: input.session_id
|
|
766
765
|
});
|
|
767
766
|
}
|
|
@@ -1044,7 +1043,7 @@ var reportPermissionDenied = (input) => reportEvent({
|
|
|
1044
1043
|
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1045
1044
|
toolUseId: input.tool_use_id,
|
|
1046
1045
|
agentType: ACTIVE_AGENT.type,
|
|
1047
|
-
agentName: agentNameIn(
|
|
1046
|
+
agentName: agentNameIn(projectNameFor(input.cwd)),
|
|
1048
1047
|
action: permissionDeniedAction(input.tool_name),
|
|
1049
1048
|
sessionId: input.session_id,
|
|
1050
1049
|
...permissionModeOf(input)
|
|
@@ -1061,7 +1060,7 @@ var notifyPermissionDenied = async (apiKey, input) => {
|
|
|
1061
1060
|
if (claimThrottle(`permdenied:${sessionKey}:${input.tool_name}`, PERMISSION_DENIED_NOTICE_WINDOW_MS) !== "passed") return;
|
|
1062
1061
|
const mode = await fetchModeState(apiKey, input.session_id).catch(() => null);
|
|
1063
1062
|
if (mode?.kill || mode?.mode === "terminal_only") return;
|
|
1064
|
-
const projectName =
|
|
1063
|
+
const projectName = projectNameFor(input.cwd);
|
|
1065
1064
|
await sendNotification(apiKey, {
|
|
1066
1065
|
title: `Auto mode blocked ${input.tool_name}`,
|
|
1067
1066
|
body: `Your agent was denied ${input.tool_name} in ${projectName}.`,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AGENT_CHOICES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HUJWZIQ2.js";
|
|
4
4
|
import {
|
|
5
5
|
BELL_HOOK_BINARY
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2IEU6RX5.js";
|
|
7
7
|
import {
|
|
8
8
|
CLAUDE_HOOK_EVENTS,
|
|
9
9
|
CODEX_HOOK_EVENTS,
|
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
isBridgeLocator,
|
|
17
17
|
isProtectedByScope,
|
|
18
18
|
registerHookEntry
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-MF6FSDM4.js";
|
|
20
20
|
import {
|
|
21
21
|
CURSOR_GATE_EVENTS,
|
|
22
22
|
HOOK_BUDGETS,
|
|
23
23
|
HOOK_LOCATOR_BINARY,
|
|
24
24
|
hookCommandHoldBudget
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-US4LUIFU.js";
|
|
26
26
|
|
|
27
27
|
// src/gemini-config.ts
|
|
28
28
|
var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
installedCodexApp,
|
|
10
10
|
readCodexAppRuntime,
|
|
11
11
|
shellQuoted
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HGVGOGVD.js";
|
|
13
13
|
import {
|
|
14
14
|
CODEX_APP_LAUNCH_AT_LOGIN_VERB,
|
|
15
15
|
CODEX_APP_LAUNCH_VARIABLE
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./chunk-QCGNGEGE.js";
|
|
20
20
|
import {
|
|
21
21
|
xml
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TRXYUOWW.js";
|
|
23
23
|
import {
|
|
24
24
|
writeFileAtomic
|
|
25
25
|
} from "./chunk-PM2NRK6Y.js";
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
codexHome,
|
|
8
8
|
codexHooksJsonIn,
|
|
9
9
|
isPusharyCodexCommand
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MF6FSDM4.js";
|
|
11
11
|
import {
|
|
12
12
|
resolvePathBinary
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-GGNKMBCN.js";
|
|
14
14
|
import {
|
|
15
15
|
getPackageVersion
|
|
16
16
|
} from "./chunk-UQTQ6HPO.js";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
notificationAnswerStep
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HZGSGLK4.js";
|
|
4
4
|
import {
|
|
5
5
|
matchMacAccountStep,
|
|
6
6
|
retryAgentCommand
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6355EUTT.js";
|
|
8
8
|
import {
|
|
9
9
|
canChangeApprovalSettings
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PAYK5BD7.js";
|
|
11
11
|
import {
|
|
12
12
|
EXIT
|
|
13
13
|
} from "./chunk-BG4HHB7E.js";
|
|
14
14
|
import {
|
|
15
15
|
NPX_LATEST_COMMAND,
|
|
16
16
|
npmExecSetupCommandFor
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-S3X6WLW5.js";
|
|
18
18
|
import {
|
|
19
19
|
LATEST_DIST_TAG
|
|
20
20
|
} from "./chunk-UQTQ6HPO.js";
|
|
@@ -4,18 +4,20 @@ import {
|
|
|
4
4
|
claimThrottle,
|
|
5
5
|
releaseThrottle,
|
|
6
6
|
reportEvent
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RT6FAMIF.js";
|
|
8
8
|
import {
|
|
9
9
|
deriveToolTarget,
|
|
10
10
|
permissionDeniedAction
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OFKKNHYJ.js";
|
|
12
|
+
import {
|
|
13
|
+
projectNameFor
|
|
14
|
+
} from "./chunk-DNJKQHK2.js";
|
|
12
15
|
import {
|
|
13
16
|
machineDecisionFor,
|
|
14
17
|
wireVerdictFor
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-US4LUIFU.js";
|
|
16
19
|
|
|
17
20
|
// src/machine-decision-audit.ts
|
|
18
|
-
import { basename } from "path";
|
|
19
21
|
var reportMachineDenial = async (input, verdict, agent) => {
|
|
20
22
|
const decision = machineDecisionFor(wireVerdictFor(verdict, 0));
|
|
21
23
|
if (!decision) return;
|
|
@@ -33,7 +35,7 @@ var reportMachineDenial = async (input, verdict, agent) => {
|
|
|
33
35
|
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
34
36
|
toolUseId: input.tool_use_id,
|
|
35
37
|
agentType: agent.type,
|
|
36
|
-
agentName: `${agent.label} - ${
|
|
38
|
+
agentName: `${agent.label} - ${projectNameFor(input.cwd)}`,
|
|
37
39
|
action: permissionDeniedAction(input.tool_name),
|
|
38
40
|
sessionId: input.session_id,
|
|
39
41
|
decisionSource: "policy_auto",
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UNNAMED_ACTION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OFKKNHYJ.js";
|
|
4
4
|
import {
|
|
5
5
|
askUser,
|
|
6
6
|
isAwayPaused,
|
|
7
7
|
isLocalQuestionHandoff,
|
|
8
8
|
unavailableQuestionUnlessRefused,
|
|
9
9
|
waitForQuestion
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YXLWKFKC.js";
|
|
11
11
|
import {
|
|
12
12
|
getMachineId
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YFOR2JQQ.js";
|
|
14
14
|
import {
|
|
15
15
|
hookWaitClamped,
|
|
16
16
|
hookWaitDeadline,
|
|
17
17
|
scopeBreachReasonOf
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-US4LUIFU.js";
|
|
19
19
|
|
|
20
20
|
// src/pushed-question.ts
|
|
21
21
|
var scopeQuestionOf = (verdict) => {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cursorGateOwnsClaudeCall,
|
|
3
3
|
readCursorGateRegistration
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-H3MY3EQP.js";
|
|
5
5
|
import {
|
|
6
6
|
registerTranscript
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VH2DDTBE.js";
|
|
8
8
|
import {
|
|
9
9
|
namedEvent
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-R3EIRYON.js";
|
|
11
11
|
import {
|
|
12
12
|
writeDegraded
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YXLWKFKC.js";
|
|
14
14
|
import {
|
|
15
15
|
claudeShapedHookInput,
|
|
16
16
|
hookCompatibleProfileBySource,
|
|
17
17
|
isGrokHookPayload,
|
|
18
18
|
isGrokSessionEndStop
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-US4LUIFU.js";
|
|
20
20
|
|
|
21
21
|
// src/tool-hook-input.ts
|
|
22
22
|
var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode", "cursor_version"];
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
reachVerdict,
|
|
15
15
|
reachesYou,
|
|
16
16
|
verifyDelivery
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-HZGSGLK4.js";
|
|
18
18
|
import {
|
|
19
19
|
describeRevokeAttempt,
|
|
20
20
|
keyNoLongerAccepted,
|
|
@@ -29,20 +29,20 @@ import {
|
|
|
29
29
|
isCI,
|
|
30
30
|
terminalColumns,
|
|
31
31
|
useColor
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-CPV25VW5.js";
|
|
33
33
|
import {
|
|
34
34
|
checkApiKey
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-OBNVYNPQ.js";
|
|
36
36
|
import {
|
|
37
37
|
reportedInstallSource
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-LH5JTAAH.js";
|
|
39
39
|
import {
|
|
40
40
|
NPX_LATEST_COMMAND
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-S3X6WLW5.js";
|
|
42
42
|
import {
|
|
43
43
|
NO_PAIRING_COMPUTER,
|
|
44
44
|
PAIR_TTL_SECONDS
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-US4LUIFU.js";
|
|
46
46
|
|
|
47
47
|
// src/onboarding.ts
|
|
48
48
|
import qrcodeTerminal from "qrcode-terminal";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
localRepoKey,
|
|
3
3
|
normalizeRepoRemote,
|
|
4
4
|
parseGitBranch
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-US4LUIFU.js";
|
|
6
6
|
|
|
7
7
|
// src/repo.ts
|
|
8
8
|
import { existsSync, readFileSync, statSync } from "fs";
|
|
@@ -100,6 +100,24 @@ var repoKeyFor = (cwd) => {
|
|
|
100
100
|
repoKeyCache.set(dir, derived);
|
|
101
101
|
return derived;
|
|
102
102
|
};
|
|
103
|
+
var projectNameCache = /* @__PURE__ */ new Map();
|
|
104
|
+
var isLinkedWorktreeGitDir = (gitDir) => mainGitDirOf(gitDir) !== gitDir;
|
|
105
|
+
var deriveProjectName = (dir) => {
|
|
106
|
+
try {
|
|
107
|
+
const gitDir = findGitDir(dir);
|
|
108
|
+
return gitDir !== void 0 && isLinkedWorktreeGitDir(gitDir) ? basename(projectRootOf(gitDir, dir)) : basename(dir);
|
|
109
|
+
} catch {
|
|
110
|
+
return basename(dir);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
var projectNameFor = (cwd) => {
|
|
114
|
+
const dir = cwd && cwd.length > 0 ? cwd : process.cwd();
|
|
115
|
+
const cached = projectNameCache.get(dir);
|
|
116
|
+
if (cached !== void 0) return cached;
|
|
117
|
+
const name = deriveProjectName(dir);
|
|
118
|
+
projectNameCache.set(dir, name);
|
|
119
|
+
return name;
|
|
120
|
+
};
|
|
103
121
|
function branchFor(cwd) {
|
|
104
122
|
try {
|
|
105
123
|
const gitDir = findGitDir(cwd || process.cwd());
|
|
@@ -128,6 +146,7 @@ var repositoryScopeFor = (cwd) => {
|
|
|
128
146
|
|
|
129
147
|
export {
|
|
130
148
|
repoKeyFor,
|
|
149
|
+
projectNameFor,
|
|
131
150
|
branchFor,
|
|
132
151
|
repositoryScopeFor
|
|
133
152
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
realpath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FPF7ZSH5.js";
|
|
4
4
|
import {
|
|
5
5
|
findNativeClaudeInstall
|
|
6
6
|
} from "./chunk-TCE3J44Z.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
resolvePackageVersionFromBinary,
|
|
13
13
|
resolvePathBinary,
|
|
14
14
|
resolvePathBinaryAsync
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GGNKMBCN.js";
|
|
16
16
|
import {
|
|
17
17
|
CLAUDE_BRIDGE_CAPABILITY,
|
|
18
18
|
CLAUDE_RESUME_CAPABILITY,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
MANAGED_PROVIDERS,
|
|
24
24
|
SPAWN_CAPABILITY,
|
|
25
25
|
sessionProvidersAdvertisedBy
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-US4LUIFU.js";
|
|
27
27
|
|
|
28
28
|
// src/live-capabilities.ts
|
|
29
29
|
import { accessSync, constants, statSync as statSync2 } from "fs";
|
|
@@ -2,31 +2,31 @@ import {
|
|
|
2
2
|
SIGNED_OUT_ON_MAC_MESSAGE,
|
|
3
3
|
describeSignedOutKey,
|
|
4
4
|
readSignedOutDiagnosis
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HLK3ZELO.js";
|
|
6
6
|
import {
|
|
7
7
|
APPROVAL_RULES_PATH
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PAYK5BD7.js";
|
|
9
9
|
import {
|
|
10
10
|
createIo
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CPV25VW5.js";
|
|
12
12
|
import {
|
|
13
13
|
absoluteUrl,
|
|
14
14
|
checkApiKey,
|
|
15
15
|
describeKeyCheck,
|
|
16
16
|
keyCheckFromResponse
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-OBNVYNPQ.js";
|
|
18
18
|
import {
|
|
19
19
|
readKeySource
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YDYKKSFU.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-TU5DTA2V.js";
|
|
24
24
|
import {
|
|
25
25
|
EXIT
|
|
26
26
|
} from "./chunk-BG4HHB7E.js";
|
|
27
27
|
import {
|
|
28
28
|
KEY_SCOPE
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-US4LUIFU.js";
|
|
30
30
|
|
|
31
31
|
// src/cli/report-key.ts
|
|
32
32
|
var { dim, yellow } = createIo();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readExistingMachineId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YFOR2JQQ.js";
|
|
4
4
|
import {
|
|
5
5
|
getBaseUrl
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TU5DTA2V.js";
|
|
7
7
|
import {
|
|
8
8
|
NetworkError
|
|
9
9
|
} from "./chunk-CINBAX5G.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
clientContextHeaders,
|
|
15
15
|
redactSecretsFromContent
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-US4LUIFU.js";
|
|
17
17
|
|
|
18
18
|
// src/cli/net.ts
|
|
19
19
|
import { createRequire } from "module";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-TCE3J44Z.js";
|
|
4
4
|
import {
|
|
5
5
|
parseVersion
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GGNKMBCN.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-US4LUIFU.js";
|
|
10
10
|
|
|
11
11
|
// src/setup/agent-probe.ts
|
|
12
12
|
import { execSync } from "child_process";
|
|
@@ -3,24 +3,24 @@ import {
|
|
|
3
3
|
expectedLaunchCapabilities,
|
|
4
4
|
hasSpawnProvider,
|
|
5
5
|
resolveControlPolicy
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DPHYIJNF.js";
|
|
7
7
|
import {
|
|
8
8
|
daemonHasRemoteProof,
|
|
9
9
|
daemonServiceManagerAvailable,
|
|
10
10
|
hasDaemonServiceDefinition,
|
|
11
11
|
readDaemonNeedsLogin,
|
|
12
12
|
readDaemonStatus
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TRXYUOWW.js";
|
|
14
14
|
import {
|
|
15
15
|
getMachineId
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YFOR2JQQ.js";
|
|
17
17
|
import {
|
|
18
18
|
readControlMode,
|
|
19
19
|
readKeySource
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YDYKKSFU.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-TU5DTA2V.js";
|
|
24
24
|
import {
|
|
25
25
|
getPackageVersion
|
|
26
26
|
} from "./chunk-UQTQ6HPO.js";
|