pushary 1.9.113 → 1.9.116
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-X624HAAU.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 +51 -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-FQSFN5ZE.js → chunk-27CV6IXW.js} +1 -1
- package/dist/{chunk-T5GJK54S.js → chunk-32MHL5HC.js} +4 -4
- package/dist/{chunk-JXN4SH6M.js → chunk-32R6ESWY.js} +1 -1
- package/dist/{chunk-WUREJCUJ.js → chunk-3CYXPFGA.js} +5 -5
- package/dist/{chunk-O5VJGP6H.js → chunk-3WEWYRLQ.js} +4 -4
- package/dist/{chunk-Q4VB3DIL.js → chunk-4B6USDD3.js} +2 -2
- package/dist/{chunk-UMR6UQZ4.js → chunk-4NCIAMPN.js} +3 -3
- package/dist/{chunk-E3A77P52.js → chunk-4Q5J3HRJ.js} +4 -4
- package/dist/{chunk-CG5SK6NF.js → chunk-4QJUMXZS.js} +1 -1
- package/dist/{chunk-Z2QWM27R.js → chunk-4WG5XTKS.js} +6 -6
- package/dist/{chunk-MPG4HYQ6.js → chunk-4X6GTMU4.js} +3 -3
- package/dist/{chunk-OJGHJIFQ.js → chunk-5LWC7PSM.js} +5 -5
- package/dist/{chunk-U35OB2HQ.js → chunk-6FMHWS6M.js} +6 -6
- package/dist/{chunk-AR3VX4UQ.js → chunk-6RKEHEW6.js} +10 -10
- package/dist/{chunk-NG2EWF32.js → chunk-7ELMLTD7.js} +2 -2
- package/dist/{chunk-YM5OM2CI.js → chunk-7O4ZTJYY.js} +6 -6
- package/dist/{chunk-GBT74TNN.js → chunk-7THCN7FJ.js} +2 -2
- package/dist/{chunk-FLRVTAV4.js → chunk-BVN3WPDZ.js} +2 -2
- package/dist/{chunk-PU2KHDRD.js → chunk-BWSAVEMV.js} +101 -18
- package/dist/{chunk-BMZFL3HF.js → chunk-BZLG63YR.js} +4 -4
- package/dist/{chunk-3D2J3T2M.js → chunk-CBJXUJ4Y.js} +1 -1
- package/dist/{chunk-GNP6I5XM.js → chunk-CHHS7WT2.js} +2 -2
- package/dist/{chunk-XL6DDWWT.js → chunk-CJL7IMWO.js} +1 -1
- package/dist/{chunk-GQFT3QTC.js → chunk-CW34RKBV.js} +5 -3
- package/dist/{chunk-IWUYKDDW.js → chunk-DGZGCKDA.js} +4 -4
- package/dist/{chunk-KDTTCR3E.js → chunk-DMY2J2MY.js} +3 -3
- package/dist/{chunk-LUBECFXJ.js → chunk-EQZKJXHE.js} +1 -1
- package/dist/{chunk-T2N7MEO3.js → chunk-FHRXFUGD.js} +3 -3
- package/dist/{chunk-GI3266RE.js → chunk-FKVPV3SH.js} +2 -2
- package/dist/{chunk-RIBCPWOB.js → chunk-FU33PDFG.js} +3 -3
- package/dist/{chunk-KB2EEK5T.js → chunk-GB5E3JHR.js} +5 -5
- package/dist/{chunk-ZUZ4RXM7.js → chunk-GKXEA6IW.js} +1 -1
- package/dist/{chunk-KPCVIH52.js → chunk-H5TODUJ3.js} +113 -9
- package/dist/{chunk-P4PLDBZK.js → chunk-I5XLH7L3.js} +5 -5
- package/dist/{chunk-3LJWADU2.js → chunk-IC7LNHAX.js} +6 -6
- package/dist/{chunk-DSXBMC2N.js → chunk-JQS5YQQZ.js} +5 -5
- package/dist/{chunk-NPG4WCIM.js → chunk-JSTA2JTL.js} +1 -1
- package/dist/{chunk-24M7PB2Y.js → chunk-KK7JA5JP.js} +5 -5
- package/dist/{chunk-53ROMSOB.js → chunk-KVZAFFEE.js} +3 -3
- package/dist/{chunk-BWSXWX6T.js → chunk-LC2A3GBN.js} +2 -2
- package/dist/{chunk-3ZU77DJH.js → chunk-LQQWATPA.js} +6 -6
- package/dist/{chunk-GSJUGW3A.js → chunk-NGWG2CHI.js} +1 -1
- package/dist/{chunk-233KC6DP.js → chunk-NXEOD5JC.js} +1 -1
- package/dist/{chunk-5SUTYXCT.js → chunk-OEXJ7AJO.js} +1 -1
- package/dist/{chunk-44O6GG4I.js → chunk-PBM565KU.js} +6 -6
- package/dist/{chunk-B5NKPU2E.js → chunk-PCRLVQW3.js} +5 -5
- package/dist/{chunk-XQFHB2EK.js → chunk-PH4LJXTG.js} +3 -3
- package/dist/{chunk-DLCECUKY.js → chunk-PPEN3N44.js} +7 -7
- package/dist/{chunk-TAGLGMA6.js → chunk-PPW3K5DR.js} +2 -2
- package/dist/{chunk-BYL7RNOM.js → chunk-PPYNBRU6.js} +3 -3
- package/dist/{chunk-5J2OGCUA.js → chunk-Q3GYEEOM.js} +1 -1
- package/dist/{chunk-44HW5T6P.js → chunk-QVD4UOJ7.js} +2 -2
- package/dist/{chunk-D3XNQAQO.js → chunk-QXLV3CT6.js} +2 -2
- package/dist/{chunk-4EFZANH3.js → chunk-R7BP6ZEW.js} +1 -1
- package/dist/{chunk-MDEXA6JD.js → chunk-RQGMDAHY.js} +3 -3
- package/dist/{chunk-JXNDO7FB.js → chunk-RZRFHCAG.js} +1 -1
- package/dist/{chunk-22OATDEL.js → chunk-S5B3LKOP.js} +3 -3
- package/dist/{chunk-4I6FWGZ5.js → chunk-SDMGCRO3.js} +1 -1
- package/dist/{chunk-F5TQ6TCH.js → chunk-TNQ5JFCV.js} +1 -1
- package/dist/{chunk-WGK2BIX6.js → chunk-TSXTMJQH.js} +4 -4
- package/dist/{chunk-JCHF4VR3.js → chunk-TWRDOVN4.js} +1 -1
- package/dist/{chunk-SI7EFQEU.js → chunk-V766TMSY.js} +4 -4
- package/dist/{chunk-NK5XT4RS.js → chunk-VAT53KQR.js} +4 -4
- package/dist/{chunk-JRW5HK32.js → chunk-WACBGAWA.js} +2 -2
- package/dist/{chunk-I7HSE5LD.js → chunk-XUHDUD34.js} +27 -14
- package/dist/{chunk-GGBGKQIZ.js → chunk-YDQ2KQOH.js} +8 -8
- package/dist/{chunk-HJ566HEV.js → chunk-Z3WNBZG6.js} +3 -3
- package/dist/{chunk-OR5SWH44.js → chunk-ZETS7HPG.js} +10 -10
- package/dist/{chunk-6E2D22Y5.js → chunk-ZR7ODRKY.js} +2 -2
- package/dist/{chunk-RLBTKTOK.js → chunk-ZUVDQOU6.js} +16 -2
- package/dist/{codex-app-cards-switch-UI2LQQ6C.js → codex-app-cards-switch-7XA2J7MU.js} +11 -11
- package/dist/{codex-card-routing-IOVURY45.js → codex-card-routing-SWDFV5IG.js} +2 -2
- package/dist/{codex-desktop-launch-GAXMK6IM.js → codex-desktop-launch-7Y2YODZM.js} +1 -1
- package/dist/{codex-session-launch-FYXRCD3I.js → codex-session-launch-5I3NEQRG.js} +18 -18
- package/dist/{config-WOATWPOD.js → config-HUULA2T7.js} +3 -3
- package/dist/{global-upgrade-LDIMKAPF.js → global-upgrade-BTHOIZK5.js} +9 -9
- package/dist/{identity-GCRCIP45.js → identity-MVXY2GIK.js} +4 -4
- package/dist/{live-capabilities-DPMIMA3P.js → live-capabilities-KCTCX3EI.js} +4 -4
- package/dist/{paths-H5LP5HJB.js → paths-BVROPWE2.js} +3 -3
- package/dist/{reapply-FBNJRZLQ.js → reapply-6J22YOVO.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-LQQDJAEJ.js} +4 -4
- package/dist/{usage-SIELH6XD.js → usage-LC7XUIV3.js} +3 -3
- package/package.json +1 -1
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
claudeSettingsLocationFor,
|
|
3
3
|
readClaudePermissionRules
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZR7ODRKY.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-PPEN3N44.js";
|
|
12
12
|
import {
|
|
13
13
|
isGatingMoment,
|
|
14
14
|
recordKeylessMoment
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4QJUMXZS.js";
|
|
16
16
|
import {
|
|
17
17
|
isAdmitted,
|
|
18
18
|
readAdmissionRules
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-KK7JA5JP.js";
|
|
20
20
|
import {
|
|
21
21
|
isDeferAnswer,
|
|
22
22
|
oncePerSession
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-CJL7IMWO.js";
|
|
24
24
|
import {
|
|
25
25
|
activeHookSource,
|
|
26
26
|
activeIdentity,
|
|
27
27
|
namedSource
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-5LWC7PSM.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-XUHDUD34.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-27CV6IXW.js";
|
|
56
59
|
import {
|
|
60
|
+
branchFor,
|
|
57
61
|
repoKeyFor,
|
|
58
62
|
repositoryScopeFor
|
|
59
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-SDMGCRO3.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-PBM565KU.js";
|
|
77
81
|
import {
|
|
78
82
|
getMachineId
|
|
79
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-TNQ5JFCV.js";
|
|
80
84
|
import {
|
|
81
85
|
getApiKey,
|
|
82
86
|
getBaseUrl
|
|
83
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-NGWG2CHI.js";
|
|
88
|
+
import {
|
|
89
|
+
writeFileAtomic
|
|
90
|
+
} from "./chunk-T5I4PKOQ.js";
|
|
84
91
|
import {
|
|
85
92
|
NPX_LATEST_COMMAND
|
|
86
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-TWRDOVN4.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-H5TODUJ3.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);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile,
|
|
3
3
|
hasCompatibleHooks
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5LWC7PSM.js";
|
|
5
5
|
import {
|
|
6
6
|
pusharyHookExecutable
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VAT53KQR.js";
|
|
8
8
|
import {
|
|
9
9
|
isProtectedByScope,
|
|
10
10
|
registerHookEntry
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZUVDQOU6.js";
|
|
12
12
|
import {
|
|
13
13
|
isRecord
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-H5TODUJ3.js";
|
|
15
15
|
|
|
16
16
|
// src/cursor-config.ts
|
|
17
17
|
var hookCommandOf = (entry) => {
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
installedCodexApp,
|
|
10
10
|
readCodexAppRuntime,
|
|
11
11
|
shellQuoted
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PPYNBRU6.js";
|
|
13
13
|
import {
|
|
14
14
|
writeHuman
|
|
15
15
|
} from "./chunk-QCGNGEGE.js";
|
|
16
16
|
import {
|
|
17
17
|
xml
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LQQWATPA.js";
|
|
19
19
|
import {
|
|
20
20
|
writeFileAtomic
|
|
21
21
|
} from "./chunk-T5I4PKOQ.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CODEX_HOOK_STATUS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7THCN7FJ.js";
|
|
4
4
|
import {
|
|
5
5
|
retryAgentCommand
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4X6GTMU4.js";
|
|
7
7
|
import {
|
|
8
8
|
NPX_LATEST_COMMAND
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TWRDOVN4.js";
|
|
10
10
|
|
|
11
11
|
// src/setup/codex-trust.ts
|
|
12
12
|
var CODEX_TRUST_TELEMETRY = {
|
|
@@ -26,6 +26,7 @@ var CODEX_APPROVALS_BY_TRUST = {
|
|
|
26
26
|
};
|
|
27
27
|
var GAPS_THAT_STOP_A_HOOK = /* @__PURE__ */ new Set(["untrusted", "disabled", "asynchronous"]);
|
|
28
28
|
var CODEX_SETTINGS_STOP_A_HOOK = "Codex's own settings stop a Pushary hook from running: hooks are turned off in config.toml, or a hook is turned off or not trusted in Codex's hooks list (/hooks, or Settings then Hooks in the ChatGPT app). Run pushary doctor to see which, and how to fix it.";
|
|
29
|
+
var CODEX_NEEDS_A_NEWER_VERSION = "Update Codex to get approvals, then run setup again.";
|
|
29
30
|
var codexSettingsStopAHook = (onDisk) => onDisk.kind === "read" && (onDisk.hooksFeatureOff || onDisk.gaps.some((gap) => GAPS_THAT_STOP_A_HOOK.has(gap.kind)));
|
|
30
31
|
var codexApprovalsWithHooks = (trust, onDisk) => trust === "unverified" && codexSettingsStopAHook(onDisk) ? "hooks_not_running" : CODEX_APPROVALS_BY_TRUST[trust];
|
|
31
32
|
var CODEX_TRUST_REFUSED = "Codex did not accept the trust Pushary asked for, so its hooks are not trusted yet. Open Codex, run /hooks, and choose Trust for the Pushary hooks.";
|
|
@@ -121,6 +122,7 @@ var describeHermesState = (state) => {
|
|
|
121
122
|
export {
|
|
122
123
|
codexTrustOutcome,
|
|
123
124
|
CODEX_SETTINGS_STOP_A_HOOK,
|
|
125
|
+
CODEX_NEEDS_A_NEWER_VERSION,
|
|
124
126
|
codexApprovalsWithHooks,
|
|
125
127
|
CODEX_HOOK_REMEDY,
|
|
126
128
|
needsCodexTrustStep,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyHookExecutable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VAT53KQR.js";
|
|
4
4
|
import {
|
|
5
5
|
bridgeResolvesToApp,
|
|
6
6
|
cursorUserHooks,
|
|
7
7
|
executableFileName,
|
|
8
8
|
isBridgeLocator,
|
|
9
9
|
liveBridgeProbe
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZUVDQOU6.js";
|
|
11
11
|
import {
|
|
12
12
|
atLeast,
|
|
13
13
|
parseVersion
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FU33PDFG.js";
|
|
15
15
|
import {
|
|
16
16
|
CURSOR_GATE_COVERAGE,
|
|
17
17
|
CURSOR_GATE_SCRIPT,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
isCursorHookPayload,
|
|
22
22
|
isRecord,
|
|
23
23
|
toolsCoveredByGateEntry
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-H5TODUJ3.js";
|
|
25
25
|
|
|
26
26
|
// src/cursor-gate-registration.ts
|
|
27
27
|
import { dirname, isAbsolute, join, resolve } from "path";
|
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
} from "./chunk-XMSDA5WA.js";
|
|
4
4
|
import {
|
|
5
5
|
fetchAsCredential
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JSTA2JTL.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NGWG2CHI.js";
|
|
10
10
|
import {
|
|
11
11
|
compressTranscriptRecord,
|
|
12
12
|
redactSecretsFromContent,
|
|
13
13
|
transcriptRecordPlaintext
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-H5TODUJ3.js";
|
|
15
15
|
|
|
16
16
|
// src/transcript-api.ts
|
|
17
17
|
var providerRecipientSchema = external_exports.object({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
realpath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BVN3WPDZ.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-FU33PDFG.js";
|
|
17
17
|
import {
|
|
18
18
|
MANAGED_PROVIDERS
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-H5TODUJ3.js";
|
|
20
20
|
|
|
21
21
|
// src/live-capabilities.ts
|
|
22
22
|
import { homedir } from "os";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
keyPrefix,
|
|
5
5
|
readConfigFileKey,
|
|
6
6
|
readMacAppKeyPrefix
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-S5B3LKOP.js";
|
|
8
8
|
import {
|
|
9
9
|
NPX_LATEST_COMMAND
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-TWRDOVN4.js";
|
|
11
11
|
|
|
12
12
|
// src/key-signed-out.ts
|
|
13
13
|
var VERDICT_BY_CHECK = {
|
|
@@ -399,9 +399,9 @@ var installGlobally = (options) => {
|
|
|
399
399
|
}
|
|
400
400
|
const started = (async () => {
|
|
401
401
|
if (!npmIsOnPath()) throw new NpmMissingError();
|
|
402
|
-
const { withUpgradeLock } = await import("./global-upgrade-
|
|
403
|
-
const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-
|
|
404
|
-
const { autoUpdateLock } = await import("./paths-
|
|
402
|
+
const { withUpgradeLock } = await import("./global-upgrade-BTHOIZK5.js");
|
|
403
|
+
const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-LQQDJAEJ.js");
|
|
404
|
+
const { autoUpdateLock } = await import("./paths-BVROPWE2.js");
|
|
405
405
|
let result = "skipped";
|
|
406
406
|
const install = async () => {
|
|
407
407
|
const platform = process.platform;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5LWC7PSM.js";
|
|
4
4
|
import {
|
|
5
5
|
hookOwnerOf,
|
|
6
6
|
hookOwnerOfCommands
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VAT53KQR.js";
|
|
8
8
|
import {
|
|
9
9
|
AGENT_CHOICES
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OEXJ7AJO.js";
|
|
11
11
|
import {
|
|
12
12
|
bridgeStub,
|
|
13
13
|
claudeSettings,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
resolveBridgeStub,
|
|
20
20
|
vscodePluginDir,
|
|
21
21
|
windowsNodeLauncherFor
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ZUVDQOU6.js";
|
|
23
23
|
import {
|
|
24
24
|
readJsonSafe
|
|
25
25
|
} from "./chunk-T5I4PKOQ.js";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
OPENCODE_APPROVAL_EVENT,
|
|
30
30
|
hookCompatibleProfile,
|
|
31
31
|
isRecord
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-H5TODUJ3.js";
|
|
33
33
|
|
|
34
34
|
// src/opencode-plugin.ts
|
|
35
35
|
var OPENCODE_PLUGIN_MARKER = "pushary-opencode-plugin w1";
|