pushary 1.9.114 → 1.9.117
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 +16 -0
- package/dist/{api-PCAXOVGM.js → api-OXKVQGTP.js} +11 -11
- package/dist/bin/pushary-audit.js +3 -3
- package/dist/bin/pushary-bell-hook.js +27 -27
- package/dist/bin/pushary-bell.js +10 -10
- package/dist/bin/pushary-claude.js +25 -25
- package/dist/bin/pushary-clean.js +34 -34
- package/dist/bin/pushary-codex-bridge.js +21 -21
- package/dist/bin/pushary-codex-hook.js +32 -32
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +15 -15
- package/dist/bin/pushary-connect.js +28 -28
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +42 -42
- package/dist/bin/pushary-disconnect.js +27 -27
- package/dist/bin/pushary-display-hook.js +17 -17
- package/dist/bin/pushary-doctor.js +42 -42
- package/dist/bin/pushary-elicitation-hook.js +27 -27
- package/dist/bin/pushary-gemini-bridge.js +15 -15
- package/dist/bin/pushary-gemini-hook.js +29 -29
- package/dist/bin/pushary-hook.js +32 -32
- package/dist/bin/pushary-login.js +21 -21
- package/dist/bin/pushary-logout.js +26 -26
- package/dist/bin/pushary-mcp.js +12 -12
- package/dist/bin/pushary-mode.js +15 -15
- package/dist/bin/pushary-notification-hook.js +26 -26
- package/dist/bin/pushary-opencode-hook.js +28 -28
- package/dist/bin/pushary-permission-denied-hook.js +32 -32
- package/dist/bin/pushary-permission-hook.js +32 -32
- 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 +35 -35
- package/dist/bin/pushary-setup.js +49 -49
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +32 -32
- package/dist/bin/pushary-stop-hook.js +26 -26
- package/dist/bin/pushary-stopfailure-hook.js +26 -26
- package/dist/bin/pushary-suggestions.js +15 -15
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +25 -25
- package/dist/bin/pushary-upgrade.js +40 -40
- package/dist/bin/pushary-wait.js +15 -15
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-P4PLDBZK.js → chunk-2JQZFGIF.js} +5 -5
- package/dist/{chunk-XL6DDWWT.js → chunk-2KYPNVRC.js} +1 -1
- package/dist/{chunk-53ROMSOB.js → chunk-2NN5ODYJ.js} +3 -3
- package/dist/{chunk-TAGLGMA6.js → chunk-2UYYX6VC.js} +2 -2
- package/dist/{chunk-XQFHB2EK.js → chunk-3OVRAD25.js} +3 -3
- package/dist/{chunk-24M7PB2Y.js → chunk-3ZQT5LQ3.js} +5 -5
- package/dist/{chunk-GNP6I5XM.js → chunk-4BV525QE.js} +2 -2
- package/dist/{chunk-Z2QWM27R.js → chunk-4SI3CUWN.js} +6 -6
- package/dist/{chunk-IWUYKDDW.js → chunk-4UGNMAQ2.js} +4 -4
- package/dist/{chunk-I7HSE5LD.js → chunk-5TVOBKRE.js} +28 -14
- package/dist/{chunk-O5VJGP6H.js → chunk-6GZU4IYU.js} +4 -4
- package/dist/{chunk-NPG4WCIM.js → chunk-6ICAZ33G.js} +1 -1
- package/dist/{chunk-4I6FWGZ5.js → chunk-74MC5LRW.js} +1 -1
- package/dist/{chunk-NK5XT4RS.js → chunk-7VPA5PXJ.js} +4 -4
- package/dist/{chunk-RLBTKTOK.js → chunk-ARRXCME5.js} +16 -2
- package/dist/{chunk-FQSFN5ZE.js → chunk-BE6JIWTM.js} +1 -1
- package/dist/{chunk-3ZU77DJH.js → chunk-BJ7FGYF7.js} +6 -6
- package/dist/{chunk-GI3266RE.js → chunk-BL7ESWIQ.js} +2 -2
- package/dist/{chunk-UMR6UQZ4.js → chunk-BSSD6UWJ.js} +3 -3
- package/dist/{chunk-5J2OGCUA.js → chunk-C2NKILG3.js} +1 -1
- package/dist/{chunk-233KC6DP.js → chunk-C32IT2TR.js} +1 -1
- package/dist/{chunk-KDTTCR3E.js → chunk-DE6ZYZZZ.js} +3 -3
- package/dist/{chunk-HJ566HEV.js → chunk-DH23XX7X.js} +3 -3
- package/dist/{chunk-JRW5HK32.js → chunk-DZI6MSR4.js} +2 -2
- package/dist/{chunk-JXNDO7FB.js → chunk-EBL6XYOI.js} +1 -1
- package/dist/{chunk-TRSKGWEL.js → chunk-EXWJBUL5.js} +3 -3
- package/dist/{chunk-YM5OM2CI.js → chunk-F3Z7UWM6.js} +6 -6
- package/dist/{chunk-PU2KHDRD.js → chunk-FKH3KT4U.js} +101 -18
- package/dist/{chunk-D3XNQAQO.js → chunk-FRIQ4LQ5.js} +2 -2
- package/dist/{chunk-BMZFL3HF.js → chunk-FW2SOQ5J.js} +4 -4
- package/dist/{chunk-T2N7MEO3.js → chunk-G5EB7GAR.js} +3 -3
- package/dist/{chunk-T5GJK54S.js → chunk-GJNWZWMA.js} +4 -4
- package/dist/{chunk-5SUTYXCT.js → chunk-H5RGOO3B.js} +1 -1
- package/dist/{chunk-E3A77P52.js → chunk-IUPEFEBH.js} +4 -4
- package/dist/{chunk-MPG4HYQ6.js → chunk-J3PBLQUD.js} +3 -3
- package/dist/{chunk-CG5SK6NF.js → chunk-K54Y2QFA.js} +1 -1
- package/dist/{chunk-KPCVIH52.js → chunk-KYWTX4R2.js} +113 -9
- package/dist/{chunk-LUBECFXJ.js → chunk-LN6LLUY7.js} +1 -1
- package/dist/{chunk-OJGHJIFQ.js → chunk-MA4KQLCT.js} +5 -5
- package/dist/{chunk-GGBGKQIZ.js → chunk-MHU7CW7T.js} +8 -8
- package/dist/{chunk-BWSXWX6T.js → chunk-MI56IIXG.js} +2 -2
- package/dist/{chunk-KB2EEK5T.js → chunk-MKTZZPWV.js} +5 -5
- package/dist/{chunk-JXN4SH6M.js → chunk-MYSBGQU6.js} +1 -1
- package/dist/{chunk-GSJUGW3A.js → chunk-N4DQDFEP.js} +1 -1
- package/dist/{chunk-44O6GG4I.js → chunk-N74WJAL6.js} +6 -6
- package/dist/{chunk-3LJWADU2.js → chunk-NI5KTEVM.js} +6 -6
- package/dist/{chunk-3D2J3T2M.js → chunk-NSCLVG7M.js} +1 -1
- package/dist/{chunk-BYL7RNOM.js → chunk-NZFYK75R.js} +3 -3
- package/dist/{chunk-SI7EFQEU.js → chunk-PHCZ26TZ.js} +4 -4
- package/dist/{chunk-FLRVTAV4.js → chunk-PHDPS5C7.js} +2 -2
- package/dist/{chunk-4EFZANH3.js → chunk-PPNJ3INA.js} +1 -1
- package/dist/{chunk-JCHF4VR3.js → chunk-R5ZMI6BM.js} +1 -1
- package/dist/{chunk-F5TQ6TCH.js → chunk-RCCISH7T.js} +1 -1
- package/dist/{chunk-ZUZ4RXM7.js → chunk-RVYREG7X.js} +1 -1
- package/dist/{chunk-DSXBMC2N.js → chunk-RYAWSPAR.js} +5 -5
- package/dist/{chunk-B5NKPU2E.js → chunk-S5MQA774.js} +5 -5
- package/dist/{chunk-DLCECUKY.js → chunk-SE62HPB7.js} +7 -7
- package/dist/{chunk-U35OB2HQ.js → chunk-SQLXC4PM.js} +6 -6
- package/dist/{chunk-NG2EWF32.js → chunk-SUMWA5VN.js} +2 -2
- package/dist/{chunk-OR5SWH44.js → chunk-T3UOM443.js} +10 -10
- package/dist/{chunk-AR3VX4UQ.js → chunk-TKTNQORW.js} +10 -10
- package/dist/{chunk-WGK2BIX6.js → chunk-U2AB2ZUZ.js} +4 -4
- package/dist/{chunk-44HW5T6P.js → chunk-UJGA7WL5.js} +2 -2
- package/dist/{chunk-Q4VB3DIL.js → chunk-X2JY437V.js} +2 -2
- package/dist/{chunk-MDEXA6JD.js → chunk-XIJ4ADBX.js} +3 -3
- package/dist/{chunk-GBT74TNN.js → chunk-XJC6PG7J.js} +2 -2
- package/dist/{chunk-RIBCPWOB.js → chunk-XU4DUX7K.js} +3 -3
- package/dist/{chunk-6E2D22Y5.js → chunk-YEV6CIQZ.js} +2 -2
- package/dist/{chunk-22OATDEL.js → chunk-YU3LDR5W.js} +3 -3
- package/dist/{chunk-WUREJCUJ.js → chunk-ZJKH3CTN.js} +5 -5
- package/dist/{codex-app-cards-switch-UI2LQQ6C.js → codex-app-cards-switch-ANBV6CA6.js} +11 -11
- package/dist/{codex-card-routing-IOVURY45.js → codex-card-routing-POEBILLG.js} +2 -2
- package/dist/{codex-desktop-launch-GAXMK6IM.js → codex-desktop-launch-Z4HXKBYP.js} +1 -1
- package/dist/{codex-session-launch-FYXRCD3I.js → codex-session-launch-XA6BMIVU.js} +18 -18
- package/dist/{config-WOATWPOD.js → config-ATKVK4QQ.js} +3 -3
- package/dist/{global-upgrade-LDIMKAPF.js → global-upgrade-BJKCVYJU.js} +9 -9
- package/dist/{identity-GCRCIP45.js → identity-X3FI7ZYE.js} +4 -4
- package/dist/{live-capabilities-DPMIMA3P.js → live-capabilities-6OV363JK.js} +4 -4
- package/dist/{paths-H5LP5HJB.js → paths-U67N2RPP.js} +3 -3
- package/dist/{reapply-FBNJRZLQ.js → reapply-L3KVM3ZO.js} +28 -28
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +31 -31
- package/dist/{upgrade-lock-76Z2YLIV.js → upgrade-lock-ZIPY7I2T.js} +4 -4
- package/dist/{usage-SIELH6XD.js → usage-RAJPNVE5.js} +3 -3
- package/package.json +1 -1
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
} from "./chunk-XMSDA5WA.js";
|
|
4
4
|
import {
|
|
5
5
|
fetchAsCredential
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6ICAZ33G.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-N4DQDFEP.js";
|
|
10
10
|
import {
|
|
11
11
|
compressTranscriptRecord,
|
|
12
12
|
redactSecretsFromContent,
|
|
13
13
|
transcriptRecordPlaintext
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-KYWTX4R2.js";
|
|
15
15
|
|
|
16
16
|
// src/transcript-api.ts
|
|
17
17
|
var providerRecipientSchema = external_exports.object({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyFetch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3OVRAD25.js";
|
|
4
4
|
import {
|
|
5
5
|
getBaseUrl
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-N4DQDFEP.js";
|
|
7
7
|
import {
|
|
8
8
|
NetworkError
|
|
9
9
|
} from "./chunk-YU2EUD7O.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey,
|
|
15
15
|
normalizeKeyScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KYWTX4R2.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;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CODEX_HOOK_STATUS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XJC6PG7J.js";
|
|
4
4
|
import {
|
|
5
5
|
retryAgentCommand
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-J3PBLQUD.js";
|
|
7
7
|
import {
|
|
8
8
|
NPX_LATEST_COMMAND
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-R5ZMI6BM.js";
|
|
10
10
|
|
|
11
11
|
// src/setup/codex-trust.ts
|
|
12
12
|
var CODEX_TRUST_TELEMETRY = {
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
forkFinishWithUpgradeLock,
|
|
4
4
|
installWithUpgradeLock,
|
|
5
5
|
releaseAutoUpdateLock
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-X2JY437V.js";
|
|
7
7
|
import {
|
|
8
8
|
phoneStartIsRequired
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-G5EB7GAR.js";
|
|
10
10
|
import {
|
|
11
11
|
describeAutoUpdateCheck,
|
|
12
12
|
globalInstallLocation,
|
|
@@ -18,25 +18,25 @@ import {
|
|
|
18
18
|
readAutoUpdateState,
|
|
19
19
|
updateAutoUpdateState,
|
|
20
20
|
upgradeEntryFor
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-FRIQ4LQ5.js";
|
|
22
22
|
import {
|
|
23
23
|
autoUpdateLock,
|
|
24
24
|
autoUpdateLog,
|
|
25
25
|
autoUpdateState
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-ARRXCME5.js";
|
|
27
27
|
import {
|
|
28
28
|
execNpm,
|
|
29
29
|
fetchLatestPublishedVersion,
|
|
30
30
|
npmErrorMessage,
|
|
31
31
|
readGlobalCliInstallAt,
|
|
32
32
|
readGlobalPrefix
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-XU4DUX7K.js";
|
|
34
34
|
import {
|
|
35
35
|
EXIT
|
|
36
36
|
} from "./chunk-BG4HHB7E.js";
|
|
37
37
|
import {
|
|
38
38
|
NPX_LATEST_COMMAND
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-R5ZMI6BM.js";
|
|
40
40
|
import {
|
|
41
41
|
commandsPackage,
|
|
42
42
|
globalUpgradeEntry,
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
claudeSettingsLocationFor,
|
|
3
3
|
readClaudePermissionRules
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YEV6CIQZ.js";
|
|
5
5
|
import {
|
|
6
6
|
askAgentQuestions,
|
|
7
7
|
defersToNativeMode,
|
|
8
8
|
outcomeOfFailedAsk,
|
|
9
9
|
reportMachineDenial,
|
|
10
10
|
storedWaitDeadline
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SE62HPB7.js";
|
|
12
12
|
import {
|
|
13
13
|
isGatingMoment,
|
|
14
14
|
recordKeylessMoment
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-K54Y2QFA.js";
|
|
16
16
|
import {
|
|
17
17
|
isAdmitted,
|
|
18
18
|
readAdmissionRules
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-3ZQT5LQ3.js";
|
|
20
20
|
import {
|
|
21
21
|
isDeferAnswer,
|
|
22
22
|
oncePerSession
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-2KYPNVRC.js";
|
|
24
24
|
import {
|
|
25
25
|
activeHookSource,
|
|
26
26
|
activeIdentity,
|
|
27
27
|
namedSource
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-MA4KQLCT.js";
|
|
29
29
|
import {
|
|
30
30
|
DEFAULT_SESSION,
|
|
31
31
|
approvalAwaitingRetry,
|
|
@@ -36,12 +36,15 @@ import {
|
|
|
36
36
|
getPolicy,
|
|
37
37
|
hasBlockedActionHint,
|
|
38
38
|
markApprovalReminded,
|
|
39
|
+
readCachedPolicy,
|
|
39
40
|
readLastPrompt,
|
|
40
41
|
readLastUserPrompt,
|
|
41
42
|
recordBlockedActionHint,
|
|
42
43
|
reportEvent,
|
|
43
|
-
settleQuestionsForToolUse
|
|
44
|
-
|
|
44
|
+
settleQuestionsForToolUse,
|
|
45
|
+
sweepFilesOlderThan,
|
|
46
|
+
userScope
|
|
47
|
+
} from "./chunk-5TVOBKRE.js";
|
|
45
48
|
import {
|
|
46
49
|
UNNAMED_ACTION,
|
|
47
50
|
deriveAction,
|
|
@@ -52,11 +55,12 @@ import {
|
|
|
52
55
|
patchDeletesFiles,
|
|
53
56
|
permissionDeniedAction,
|
|
54
57
|
scopePathFor
|
|
55
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-BE6JIWTM.js";
|
|
56
59
|
import {
|
|
60
|
+
branchFor,
|
|
57
61
|
repoKeyFor,
|
|
58
62
|
repositoryScopeFor
|
|
59
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-74MC5LRW.js";
|
|
60
64
|
import {
|
|
61
65
|
askUser,
|
|
62
66
|
cancelQuestion,
|
|
@@ -73,17 +77,20 @@ import {
|
|
|
73
77
|
waitForQuestion,
|
|
74
78
|
waitsForThePhone,
|
|
75
79
|
withdrawQuestion
|
|
76
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-N74WJAL6.js";
|
|
77
81
|
import {
|
|
78
82
|
getMachineId
|
|
79
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-RCCISH7T.js";
|
|
80
84
|
import {
|
|
81
85
|
getApiKey,
|
|
82
86
|
getBaseUrl
|
|
83
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-N4DQDFEP.js";
|
|
88
|
+
import {
|
|
89
|
+
writeFileAtomic
|
|
90
|
+
} from "./chunk-T5I4PKOQ.js";
|
|
84
91
|
import {
|
|
85
92
|
NPX_LATEST_COMMAND
|
|
86
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-R5ZMI6BM.js";
|
|
87
94
|
import {
|
|
88
95
|
AGENT_QUESTION_STRATEGY,
|
|
89
96
|
AGENT_QUESTION_TOOL,
|
|
@@ -91,6 +98,7 @@ import {
|
|
|
91
98
|
GATE_BLOCK_REASON_MAX_LENGTH,
|
|
92
99
|
GATE_WIRE,
|
|
93
100
|
HANDED_BACK_REASON,
|
|
101
|
+
MCP_TOOL_PREFIX,
|
|
94
102
|
PLAN_DECLINED_REASON,
|
|
95
103
|
PRETOOLUSE_HANDLED_TOOLS,
|
|
96
104
|
QUESTION_LIMIT_PROMPT_REASON,
|
|
@@ -105,8 +113,10 @@ import {
|
|
|
105
113
|
agentQuestionStrategy,
|
|
106
114
|
agentRulesAllowEveryInput,
|
|
107
115
|
approvalModeWithoutLocalPrompt,
|
|
116
|
+
approvalRouteHoldsMcpCall,
|
|
108
117
|
approvalRouteOutranksAutoMode,
|
|
109
118
|
buildDecisionEpisodeFeatures,
|
|
119
|
+
callMayPushTheCurrentBranch,
|
|
110
120
|
claudeAllowlistOwnsCall,
|
|
111
121
|
claudeConsultsItsAllowlist,
|
|
112
122
|
claudePermissionDeniedOutput,
|
|
@@ -130,6 +140,8 @@ import {
|
|
|
130
140
|
isPusharyOwnTool,
|
|
131
141
|
isRecord,
|
|
132
142
|
matchedRouteOf,
|
|
143
|
+
mcpCallCouldBeHeldForSomeoneElse,
|
|
144
|
+
namedRouteWaitsForSomeoneElse,
|
|
133
145
|
parseAgentQuestions,
|
|
134
146
|
permissionsOffAskReason,
|
|
135
147
|
permissionsOffLineAppliesTo,
|
|
@@ -141,7 +153,7 @@ import {
|
|
|
141
153
|
terminalStaysLiveForTheCall,
|
|
142
154
|
timeoutActionWithoutLocalPrompt,
|
|
143
155
|
unansweredRefusalReason
|
|
144
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-KYWTX4R2.js";
|
|
145
157
|
|
|
146
158
|
// src/terminal-answer-watch.ts
|
|
147
159
|
import { closeSync, openSync, readSync, statSync } from "fs";
|
|
@@ -381,6 +393,45 @@ var handlePushFirst = async (apiKey, call, pushFirstSeconds, signals) => {
|
|
|
381
393
|
return ask(WITHDRAWN_APPROVAL_REASON);
|
|
382
394
|
};
|
|
383
395
|
|
|
396
|
+
// src/route-hold-handback.ts
|
|
397
|
+
import { existsSync, mkdirSync, rmSync, statSync as statSync2 } from "fs";
|
|
398
|
+
import { tmpdir } from "os";
|
|
399
|
+
import { join } from "path";
|
|
400
|
+
var HANDBACK_TTL_MS = 2 * 60 * 1e3;
|
|
401
|
+
var FINGERPRINT = /^[0-9a-f]{64}$/;
|
|
402
|
+
var claudeMcpHoldHandbackDir = () => join(tmpdir(), `pushary-mcp-hold-handbacks-${userScope()}`);
|
|
403
|
+
var handbackFile = (fingerprint) => join(claudeMcpHoldHandbackDir(), fingerprint);
|
|
404
|
+
var isLive = (path) => {
|
|
405
|
+
try {
|
|
406
|
+
const stat = statSync2(path);
|
|
407
|
+
return stat.isFile() && Date.now() - stat.mtimeMs < HANDBACK_TTL_MS;
|
|
408
|
+
} catch {
|
|
409
|
+
return false;
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
var recordMcpHoldHandback = (fingerprint) => {
|
|
413
|
+
if (!fingerprint || !FINGERPRINT.test(fingerprint)) return;
|
|
414
|
+
try {
|
|
415
|
+
const dir = claudeMcpHoldHandbackDir();
|
|
416
|
+
if (!existsSync(dir)) mkdirSync(dir, { recursive: true, mode: 448 });
|
|
417
|
+
else sweepFilesOlderThan(dir, HANDBACK_TTL_MS, Date.now());
|
|
418
|
+
writeFileAtomic(handbackFile(fingerprint), "1", 384);
|
|
419
|
+
} catch {
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
var claimMcpHoldHandback = (fingerprint) => {
|
|
424
|
+
if (!fingerprint || !FINGERPRINT.test(fingerprint)) return false;
|
|
425
|
+
const path = handbackFile(fingerprint);
|
|
426
|
+
const live = isLive(path);
|
|
427
|
+
try {
|
|
428
|
+
rmSync(path, { force: true });
|
|
429
|
+
} catch {
|
|
430
|
+
return live;
|
|
431
|
+
}
|
|
432
|
+
return live;
|
|
433
|
+
};
|
|
434
|
+
|
|
384
435
|
// src/hook.ts
|
|
385
436
|
var START_MS = Date.now();
|
|
386
437
|
var ACTIVE_AGENT = activeIdentity(process.argv);
|
|
@@ -674,6 +725,7 @@ var handleKeyless = (input) => {
|
|
|
674
725
|
};
|
|
675
726
|
var claudePermissionRulesFor = (input) => ACTIVE_SOURCE === "claude" ? readClaudePermissionRules(claudeSettingsLocationFor(input.cwd)) : null;
|
|
676
727
|
var claudeRulesMayCover = (input, rules) => rules !== null && claudeConsultsItsAllowlist(input.permission_mode) && agentRulesAllowEveryInput(rules, input.tool_name, [input.tool_input ?? {}], input.cwd);
|
|
728
|
+
var currentBranchOfAPush = (toolName, toolInputs, cwd) => callMayPushTheCurrentBranch(toolName, toolInputs) ? branchFor(cwd) : void 0;
|
|
677
729
|
var claudeGateInput = (modeState, config, input, canonical) => {
|
|
678
730
|
const toolName = canonical?.toolName ?? input.tool_name;
|
|
679
731
|
const toolInputs = canonical?.toolInputs ?? [input.tool_input ?? {}];
|
|
@@ -690,7 +742,8 @@ var claudeGateInput = (modeState, config, input, canonical) => {
|
|
|
690
742
|
...repositoryScopeFor(input.cwd),
|
|
691
743
|
sessionId: input.session_id,
|
|
692
744
|
permissionMode: permissionsOffLineAppliesTo(ACTIVE_AGENT.type) ? input.permission_mode : void 0,
|
|
693
|
-
deletesFiles: patchDeletesFiles(input.tool_name, input.tool_input ?? {})
|
|
745
|
+
deletesFiles: patchDeletesFiles(input.tool_name, input.tool_input ?? {}),
|
|
746
|
+
currentBranch: currentBranchOfAPush(toolName, toolInputs, input.cwd)
|
|
694
747
|
};
|
|
695
748
|
};
|
|
696
749
|
var BLOCKED_ACTION_GATE_TIMEOUT_MS = 15e3;
|
|
@@ -740,12 +793,35 @@ var remindedOfApprovedRetry = (input) => {
|
|
|
740
793
|
markApprovalReminded(approval);
|
|
741
794
|
return true;
|
|
742
795
|
};
|
|
796
|
+
var isMcpCallInClaudeCode = (input) => ACTIVE_SOURCE === "claude" && input.tool_name.startsWith(MCP_TOOL_PREFIX);
|
|
797
|
+
var mcpCallWaitsForSomeoneElse = (input) => {
|
|
798
|
+
if (!mcpCallCouldBeHeldForSomeoneElse(input.tool_name, input.permission_mode)) return false;
|
|
799
|
+
let apiKey;
|
|
800
|
+
try {
|
|
801
|
+
apiKey = getApiKey();
|
|
802
|
+
} catch {
|
|
803
|
+
return false;
|
|
804
|
+
}
|
|
805
|
+
const config = readCachedPolicy(apiKey, ACTIVE_AGENT.type, true);
|
|
806
|
+
return config !== null && namedRouteWaitsForSomeoneElse({
|
|
807
|
+
config,
|
|
808
|
+
toolName: input.tool_name,
|
|
809
|
+
toolInputs: [input.tool_input ?? {}],
|
|
810
|
+
cwd: input.cwd,
|
|
811
|
+
...repositoryScopeFor(input.cwd)
|
|
812
|
+
});
|
|
813
|
+
};
|
|
743
814
|
var reportHookFailure = async (code, error) => {
|
|
744
815
|
console.error(`[Pushary] ${code}: could not complete the approval check; keeping the agent's existing fallback.`);
|
|
745
816
|
await reportClientError({ kind: clientErrorKindOf(error), code });
|
|
746
817
|
};
|
|
818
|
+
var rememberHandbackToThePrompt = (input, heldForMcpRoute, result) => {
|
|
819
|
+
if (heldForMcpRoute && result?.hookSpecificOutput?.permissionDecision === "ask") recordMcpHoldHandback(blockedActionFingerprintFor(input));
|
|
820
|
+
return result;
|
|
821
|
+
};
|
|
747
822
|
var handlePreToolUse = async (input, canonical) => {
|
|
748
823
|
if (isPusharyOwnTool(input.tool_name)) return void 0;
|
|
824
|
+
if (isMcpCallInClaudeCode(input) && !mcpCallWaitsForSomeoneElse(input)) return void 0;
|
|
749
825
|
let apiKey;
|
|
750
826
|
try {
|
|
751
827
|
apiKey = getApiKey();
|
|
@@ -775,9 +851,11 @@ var handlePreToolUse = async (input, canonical) => {
|
|
|
775
851
|
if (input.tool_name === "ExitPlanMode") {
|
|
776
852
|
return await handleExitPlanMode(apiKey, input);
|
|
777
853
|
}
|
|
854
|
+
const heldForMcpRoute = approvalRouteHoldsMcpCall(gateInput, verdict, input.permission_mode);
|
|
855
|
+
if (isMcpCallInClaudeCode(input) && !heldForMcpRoute) return void 0;
|
|
778
856
|
if (await claimedBlockedActionRetry(apiKey, input)) return allow(BLOCKED_ACTION_ALLOW_REASON);
|
|
779
857
|
if (remindedOfApprovedRetry(input)) return deny(BLOCKED_ACTION_CHANGED_RETRY_REASON);
|
|
780
|
-
if (!(verdict.kind === "gate" && verdict.scopeReason) && !approvalRouteOutranksAutoMode(gateInput, verdict, input.permission_mode) && shouldDeferToNativeMode(input.permission_mode, input.tool_name)) {
|
|
858
|
+
if (!(verdict.kind === "gate" && verdict.scopeReason) && !approvalRouteOutranksAutoMode(gateInput, verdict, input.permission_mode) && !heldForMcpRoute && shouldDeferToNativeMode(input.permission_mode, input.tool_name)) {
|
|
781
859
|
return void 0;
|
|
782
860
|
}
|
|
783
861
|
if (claudeAllowlistOwnsCall(gateInput, verdict, input.permission_mode, claudePermissionRulesFor(input))) return void 0;
|
|
@@ -794,7 +872,11 @@ var handlePreToolUse = async (input, canonical) => {
|
|
|
794
872
|
return undecidedCall(SOLE_GATE_UNDECIDED_REASON);
|
|
795
873
|
default:
|
|
796
874
|
if (preToolUseHandsOff(input, gateInput, verdict)) return ask(TERMINAL_AND_PHONE_REASON);
|
|
797
|
-
return
|
|
875
|
+
return rememberHandbackToThePrompt(
|
|
876
|
+
input,
|
|
877
|
+
heldForMcpRoute,
|
|
878
|
+
await dispatchModeHandler(apiKey, input, verdict.policy, getMachineId(), modeState.trainingConsent, verdict.scopeReason, verdict.scopePath, void 0, permissionsOffAskReason(gateInput, verdict), matchedRouteOf(gateInput))
|
|
879
|
+
);
|
|
798
880
|
}
|
|
799
881
|
} catch (error) {
|
|
800
882
|
await reportHookFailure("pre_tool_use_failed", error);
|
|
@@ -835,6 +917,7 @@ var handlePermissionRequest = async (input, canonical, holdBudgetSeconds) => {
|
|
|
835
917
|
return permReqDeny(verdict.reason);
|
|
836
918
|
}
|
|
837
919
|
if (canonical === null) return permReqDeny(UNREADABLE_CALL_REASON);
|
|
920
|
+
if (isMcpCallInClaudeCode(input) && claimMcpHoldHandback(blockedActionFingerprintFor(input))) return void 0;
|
|
838
921
|
if (agentQuestionStrategy(ACTIVE_SOURCE, "PermissionRequest", input.tool_name) === AGENT_QUESTION_STRATEGY.native) return void 0;
|
|
839
922
|
if (verdict.kind === "gate" && verdict.scopeReason && (canonical?.toolInputs.length ?? 0) > 1) return permReqDeny(SCOPE_BATCH_REASON);
|
|
840
923
|
const handedOff = preToolUseHandsOff(input, gateInput, verdict);
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-POFBE6ZY.js";
|
|
4
4
|
import {
|
|
5
5
|
autoUpdateState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ARRXCME5.js";
|
|
7
7
|
import {
|
|
8
8
|
readJsonSafe,
|
|
9
9
|
writeJsonAtomic
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-ZVU6WMMU.js";
|
|
18
18
|
import {
|
|
19
19
|
isAutoUpdateResult
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-KYWTX4R2.js";
|
|
21
21
|
|
|
22
22
|
// src/auto-update.ts
|
|
23
23
|
import { spawn } from "child_process";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile,
|
|
3
3
|
hasCompatibleHooks
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MA4KQLCT.js";
|
|
5
5
|
import {
|
|
6
6
|
pusharyHookExecutable
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7VPA5PXJ.js";
|
|
8
8
|
import {
|
|
9
9
|
isProtectedByScope,
|
|
10
10
|
registerHookEntry
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ARRXCME5.js";
|
|
12
12
|
import {
|
|
13
13
|
isRecord
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-KYWTX4R2.js";
|
|
15
15
|
|
|
16
16
|
// src/cursor-config.ts
|
|
17
17
|
var hookCommandOf = (entry) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
realpath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PHDPS5C7.js";
|
|
4
4
|
import {
|
|
5
5
|
findNativeClaudeInstall
|
|
6
6
|
} from "./chunk-ROVLRXBI.js";
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
resolvePackageVersionFromBinary,
|
|
14
14
|
resolvePathBinary,
|
|
15
15
|
resolvePathBinaryAsync
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XU4DUX7K.js";
|
|
17
17
|
import {
|
|
18
18
|
MANAGED_PROVIDERS
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-KYWTX4R2.js";
|
|
20
20
|
|
|
21
21
|
// src/live-capabilities.ts
|
|
22
22
|
import { homedir } from "os";
|
|
@@ -13,16 +13,16 @@ import {
|
|
|
13
13
|
} from "./chunk-G66WIAST.js";
|
|
14
14
|
import {
|
|
15
15
|
keyPrefix
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YU3LDR5W.js";
|
|
17
17
|
import {
|
|
18
18
|
getBaseUrl
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-N4DQDFEP.js";
|
|
20
20
|
import {
|
|
21
21
|
NPX_LATEST_COMMAND
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-R5ZMI6BM.js";
|
|
23
23
|
import {
|
|
24
24
|
isValidApiKey
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-KYWTX4R2.js";
|
|
26
26
|
|
|
27
27
|
// src/cli/login-ui.ts
|
|
28
28
|
import { hostname } from "os";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
macAppBridgeAvailable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MKTZZPWV.js";
|
|
4
4
|
import {
|
|
5
5
|
keyPrefix
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YU3LDR5W.js";
|
|
7
7
|
import {
|
|
8
8
|
bridgeAgentKey
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ARRXCME5.js";
|
|
10
10
|
import {
|
|
11
11
|
readJsonSafe
|
|
12
12
|
} from "./chunk-T5I4PKOQ.js";
|
|
13
13
|
import {
|
|
14
14
|
isRecord,
|
|
15
15
|
isValidApiKey
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KYWTX4R2.js";
|
|
17
17
|
|
|
18
18
|
// src/shared-mcp-key.ts
|
|
19
19
|
var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
NpmInstallError,
|
|
3
3
|
NpmMissingError,
|
|
4
4
|
NpmPermissionError
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XU4DUX7K.js";
|
|
6
6
|
import {
|
|
7
7
|
writeFileAtomic
|
|
8
8
|
} from "./chunk-T5I4PKOQ.js";
|
|
9
9
|
import {
|
|
10
10
|
NPX_LATEST_COMMAND
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-R5ZMI6BM.js";
|
|
12
12
|
import {
|
|
13
13
|
readSetupAgentFailures
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-KYWTX4R2.js";
|
|
15
15
|
|
|
16
16
|
// src/setup/config-write.ts
|
|
17
17
|
var AgentConfigWriteError = class extends Error {
|