@pushary/agent-hooks 1.9.66 → 1.9.67
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 +9 -0
- package/data/SKILL.md +1 -1
- package/data/cursor-plugin/skills/pushary/SKILL.md +1 -1
- package/data/vscode-plugin/skills/pushary/SKILL.md +1 -1
- package/dist/{api-GDSVUTI2.js → api-3WIPD5GC.js} +10 -10
- package/dist/bin/pushary-bell-hook.js +25 -25
- package/dist/bin/pushary-bell.js +10 -10
- package/dist/bin/pushary-claude.js +26 -26
- package/dist/bin/pushary-clean.js +73 -74
- package/dist/bin/pushary-codex-bridge.js +21 -21
- package/dist/bin/pushary-codex-hook.js +30 -30
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +13 -13
- package/dist/bin/pushary-connect.js +28 -27
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +40 -39
- package/dist/bin/pushary-disconnect.js +25 -25
- package/dist/bin/pushary-doctor.js +115 -71
- package/dist/bin/pushary-elicitation-hook.js +25 -25
- package/dist/bin/pushary-gemini-bridge.js +15 -15
- package/dist/bin/pushary-gemini-hook.js +27 -27
- package/dist/bin/pushary-hook.js +29 -29
- package/dist/bin/pushary-login.js +20 -19
- package/dist/bin/pushary-logout.js +26 -27
- package/dist/bin/pushary-mcp.js +11 -11
- package/dist/bin/pushary-mode.js +16 -15
- package/dist/bin/pushary-notification-hook.js +24 -24
- package/dist/bin/pushary-opencode-hook.js +26 -26
- package/dist/bin/pushary-permission-denied-hook.js +29 -29
- package/dist/bin/pushary-permission-hook.js +29 -29
- package/dist/bin/pushary-post-hook.js +24 -24
- package/dist/bin/pushary-prompt-hook.js +24 -24
- package/dist/bin/pushary-session-end-hook.js +26 -26
- package/dist/bin/pushary-session-start-hook.js +34 -33
- package/dist/bin/pushary-setup.js +107 -93
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +37 -35
- package/dist/bin/pushary-stop-hook.js +24 -24
- package/dist/bin/pushary-stopfailure-hook.js +24 -24
- package/dist/bin/pushary-suggestions.js +15 -14
- package/dist/bin/pushary-transcript-register.js +16 -16
- package/dist/bin/pushary-transcripts.js +18 -17
- package/dist/bin/pushary-upgrade.js +45 -38
- package/dist/bin/pushary-wait.js +26 -20
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-A47UKPC7.js → chunk-32OSSYGZ.js} +1 -1
- package/dist/{chunk-QR2QWGQI.js → chunk-3THDNNVL.js} +3 -3
- package/dist/{chunk-DPU6H4JY.js → chunk-564IPPBL.js} +3 -3
- package/dist/chunk-5MOJCOCF.js +25 -0
- package/dist/{chunk-V4EOFOB2.js → chunk-6H4E5UBA.js} +6 -6
- package/dist/{chunk-DKMVVBXO.js → chunk-6LXXKMV6.js} +38 -10
- package/dist/chunk-76SWHCAR.js +299 -0
- package/dist/{chunk-G6VJZ3RB.js → chunk-77L2TNJW.js} +1 -1
- package/dist/{chunk-6BGVSV2Q.js → chunk-7YJSDXLM.js} +1 -1
- package/dist/{chunk-AWGBL4P3.js → chunk-B3V2WOJX.js} +89 -41
- package/dist/{chunk-RJ6JEHCP.js → chunk-BBFGDYYI.js} +1 -1
- package/dist/{chunk-YQDCTID4.js → chunk-BFF3ABFV.js} +4 -4
- package/dist/{chunk-R7C2FS33.js → chunk-C4EDAHXI.js} +1 -1
- package/dist/{chunk-YB3HMDKE.js → chunk-CHYBOTQN.js} +2 -2
- package/dist/{chunk-26W46E46.js → chunk-CJZLIAJF.js} +27 -10
- package/dist/{chunk-ZJV7SFIJ.js → chunk-CPLQ5OHX.js} +1 -1
- package/dist/{chunk-ZAZUDYSF.js → chunk-D3U6CN7T.js} +5 -5
- package/dist/{chunk-MNNQEUQC.js → chunk-D7Z4USSB.js} +27 -8
- package/dist/{chunk-V3YBVOTZ.js → chunk-DP6LU6BB.js} +2 -2
- package/dist/{chunk-32ZT2ATY.js → chunk-DXCHIKAN.js} +8 -8
- package/dist/{chunk-QN25WBXL.js → chunk-EQR6JSFE.js} +7 -7
- package/dist/{chunk-IQ3GKPFM.js → chunk-FONWVVDD.js} +1 -1
- package/dist/{chunk-XXIJBYNW.js → chunk-GMHQYX3D.js} +1 -1
- package/dist/{chunk-3EZP5ZPS.js → chunk-ICQCQAUO.js} +4 -4
- package/dist/{chunk-5J7OZBJ4.js → chunk-IPG3RS23.js} +2 -2
- package/dist/{chunk-4APD2DPI.js → chunk-IRV2MNMA.js} +53 -3
- package/dist/{chunk-MDIGG3Q7.js → chunk-IVB5O6NY.js} +3 -3
- package/dist/{chunk-VURDLVAQ.js → chunk-IXTVUINH.js} +3 -3
- package/dist/{chunk-HUGVJBDN.js → chunk-JBRMIADM.js} +2 -2
- package/dist/{chunk-IGO3AGZK.js → chunk-JHB5SR5B.js} +4 -4
- package/dist/{chunk-CNJ7SI5V.js → chunk-JOBSKQ2Z.js} +4 -4
- package/dist/{chunk-5FJDODOA.js → chunk-JOD2325S.js} +3 -3
- package/dist/{chunk-376TUN72.js → chunk-JSPCGPSH.js} +3 -3
- package/dist/{chunk-T6YLXO6N.js → chunk-KE4TSJUD.js} +4 -4
- package/dist/{chunk-TQNFDNJA.js → chunk-KIXRHNCW.js} +6 -6
- package/dist/{chunk-Q5RNYE2L.js → chunk-KNUYUQBP.js} +4 -4
- package/dist/{chunk-3FQX74E4.js → chunk-KTLE7NIK.js} +23 -8
- package/dist/{chunk-57NTMVMI.js → chunk-LJHDUKBB.js} +6 -6
- package/dist/{chunk-CN6JFM62.js → chunk-LS42NV6E.js} +15 -6
- package/dist/{chunk-6ZXCWK27.js → chunk-LYTWK5TF.js} +5 -5
- package/dist/{chunk-XIJTXRWB.js → chunk-METUT7V4.js} +2 -2
- package/dist/{chunk-7LK3Y6ET.js → chunk-NSS2AIGI.js} +6 -6
- package/dist/{chunk-XEXF2OFZ.js → chunk-NWN6GGJL.js} +2 -2
- package/dist/{chunk-GECU7V44.js → chunk-P4RXSZDT.js} +3 -3
- package/dist/{chunk-IA5VWIHV.js → chunk-PIBWX3EF.js} +2 -2
- package/dist/{chunk-GWYCKTXS.js → chunk-PO2P3XDC.js} +5 -5
- package/dist/{chunk-DIUTSF6I.js → chunk-R2BZH2NK.js} +4 -4
- package/dist/{chunk-6RJZSBPD.js → chunk-RO2B4YBF.js} +1 -1
- package/dist/{chunk-EJR5JXMV.js → chunk-RQOT6QL3.js} +43 -5
- package/dist/{chunk-SVKCYUYP.js → chunk-SB6TYV4M.js} +9 -9
- package/dist/{chunk-GDLT32I4.js → chunk-TI4JYPGQ.js} +6 -2
- package/dist/{chunk-B6JC676X.js → chunk-UC2J5RR4.js} +1 -1
- package/dist/{chunk-XDDSURY3.js → chunk-UQIPWXBL.js} +3 -3
- package/dist/{chunk-EU2ZOZC3.js → chunk-UXN73YAE.js} +3 -3
- package/dist/{chunk-RSZQEEEW.js → chunk-VEYFXRZ6.js} +7 -6
- package/dist/{chunk-XFQAK35L.js → chunk-VHMZPN3N.js} +1 -1
- package/dist/{chunk-45KMS76L.js → chunk-VKZ3RJ5U.js} +1 -1
- package/dist/chunk-VVIQWGS7.js +2298 -0
- package/dist/{chunk-KS3O6O7E.js → chunk-WJLHZ6E6.js} +3 -3
- package/dist/{chunk-GO7YKPT3.js → chunk-X2MTVD4W.js} +1 -1
- package/dist/{chunk-2BL6KWN7.js → chunk-XFDWLDHG.js} +9 -9
- package/dist/{chunk-3ELJIG2R.js → chunk-XNUWKKGS.js} +3 -3
- package/dist/{chunk-QOIPUYUD.js → chunk-XZKSUJ55.js} +1 -1
- package/dist/{chunk-JL3SZJJP.js → chunk-Y4MRHAE5.js} +2 -2
- package/dist/{chunk-DBUHSUL7.js → chunk-Y6ZN454E.js} +1 -1
- package/dist/{chunk-XGFFNERF.js → chunk-YSD4SMHE.js} +1 -1
- package/dist/{chunk-UTAARXYQ.js → chunk-ZK5WYAMI.js} +1 -1
- package/dist/{chunk-AVWECJSN.js → chunk-ZPIYJLQ3.js} +2 -2
- package/dist/{codex-app-cards-switch-W7OLKOMO.js → codex-app-cards-switch-25TDTMUZ.js} +11 -11
- package/dist/{codex-desktop-launch-U6V3AXZF.js → codex-desktop-launch-JDKUCD2Y.js} +1 -1
- package/dist/{codex-session-launch-EFU46WBL.js → codex-session-launch-6N35AAEO.js} +18 -18
- package/dist/{config-UC4LMCNX.js → config-OBGYURFX.js} +3 -3
- package/dist/{global-upgrade-ABF5O3HU.js → global-upgrade-2QNQD5OM.js} +10 -10
- package/dist/{identity-3ZUZPHN6.js → identity-CUPX2U7Q.js} +4 -4
- package/dist/{live-capabilities-BXWXJARK.js → live-capabilities-CUEIWMSM.js} +5 -5
- package/dist/{paths-FO76CFRQ.js → paths-BHLBZ6FY.js} +7 -3
- package/dist/{reapply-3T3DFUAI.js → reapply-4GXLWZ5M.js} +27 -26
- package/dist/src/index.js +28 -28
- package/dist/{upgrade-lock-EZ5JIPJE.js → upgrade-lock-RDKTAHWR.js} +4 -4
- package/dist/{usage-Y6BL7RUD.js → usage-KX2HN47E.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-QBNICXMC.js +0 -615
|
@@ -4,24 +4,24 @@ import {
|
|
|
4
4
|
outcomeOfFailedAsk,
|
|
5
5
|
reportMachineDenial,
|
|
6
6
|
storedWaitDeadline
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6H4E5UBA.js";
|
|
8
8
|
import {
|
|
9
9
|
isGatingMoment,
|
|
10
10
|
recordKeylessMoment
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7YJSDXLM.js";
|
|
12
12
|
import {
|
|
13
13
|
isAdmitted,
|
|
14
14
|
readAdmissionRules
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EQR6JSFE.js";
|
|
16
16
|
import {
|
|
17
17
|
isDeferAnswer,
|
|
18
18
|
oncePerSession
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-CPLQ5OHX.js";
|
|
20
20
|
import {
|
|
21
21
|
activeHookSource,
|
|
22
22
|
activeIdentity,
|
|
23
23
|
namedSource
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-ICQCQAUO.js";
|
|
25
25
|
import {
|
|
26
26
|
DEFAULT_SESSION,
|
|
27
27
|
UNNAMED_ACTION,
|
|
@@ -45,10 +45,10 @@ import {
|
|
|
45
45
|
reportEvent,
|
|
46
46
|
scopePathFor,
|
|
47
47
|
settleQuestionsForToolUse
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-XFDWLDHG.js";
|
|
49
49
|
import {
|
|
50
50
|
repoKeyFor
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-GMHQYX3D.js";
|
|
52
52
|
import {
|
|
53
53
|
askUser,
|
|
54
54
|
cancelQuestion,
|
|
@@ -65,20 +65,20 @@ import {
|
|
|
65
65
|
waitForQuestion,
|
|
66
66
|
waitsForThePhone,
|
|
67
67
|
withdrawQuestion
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-D3U6CN7T.js";
|
|
69
69
|
import {
|
|
70
70
|
getMachineId
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-PIBWX3EF.js";
|
|
72
72
|
import {
|
|
73
73
|
claudeConfigDir
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-TI4JYPGQ.js";
|
|
75
75
|
import {
|
|
76
76
|
getApiKey,
|
|
77
77
|
getBaseUrl
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-32OSSYGZ.js";
|
|
79
79
|
import {
|
|
80
80
|
NPX_LATEST_COMMAND
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-X2MTVD4W.js";
|
|
82
82
|
import {
|
|
83
83
|
AGENT_QUESTION_STRATEGY,
|
|
84
84
|
AGENT_QUESTION_TOOL,
|
|
@@ -133,7 +133,7 @@ import {
|
|
|
133
133
|
terminalStaysLiveForTheCall,
|
|
134
134
|
timeoutActionWithoutLocalPrompt,
|
|
135
135
|
unansweredRefusalReason
|
|
136
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-RQOT6QL3.js";
|
|
137
137
|
|
|
138
138
|
// src/terminal-answer-watch.ts
|
|
139
139
|
import { closeSync, openSync, readSync, statSync } from "fs";
|
|
@@ -296,36 +296,45 @@ var reportDecisionEpisode = async (apiKey, input) => {
|
|
|
296
296
|
|
|
297
297
|
// src/hook.ts
|
|
298
298
|
import { basename } from "path";
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
var ACTIVE_SOURCE = activeHookSource(process.argv);
|
|
302
|
-
var HANDED_DOWN_BY_THE_MAC_BRIDGE = namedSource(process.argv) !== void 0;
|
|
303
|
-
var CLAUDE_SESSION_ATTENDED_ENV = "CLAUDE_CODE_SESSION_ATTENDED";
|
|
304
|
-
var PUSHARY_IS_SOLE_GATE = ACTIVE_SOURCE !== null && hookCompatibleProfileBySource(ACTIVE_SOURCE)?.soleGate != null;
|
|
305
|
-
var agentNameIn = (projectName) => `${ACTIVE_AGENT.label} - ${projectName}`;
|
|
299
|
+
|
|
300
|
+
// src/pre-tool-use-output.ts
|
|
306
301
|
var allow = (reason) => claudePreToolUseOutput("allow", reason);
|
|
307
302
|
var deny = (reason) => claudePreToolUseOutput("deny", reason);
|
|
308
|
-
var allowWithInput = (updatedInput) => claudePreToolUseOutput("allow", void 0, updatedInput);
|
|
309
303
|
var ask = (reason) => claudePreToolUseOutput("ask", reason);
|
|
310
304
|
var halted = (reason) => claudeStoppedPreToolUseOutput(reason);
|
|
311
|
-
|
|
305
|
+
|
|
306
|
+
// src/permission-ask-outcome.ts
|
|
312
307
|
var questionLimitOutput = (handBack) => handBack.kind === "refuse" ? deny(handBack.reason) : ask(QUESTION_LIMIT_PROMPT_REASON);
|
|
313
|
-
var outcomeOfFailedPermissionAsk = (error, sessionId, questionLimitFacts) => {
|
|
308
|
+
var outcomeOfFailedPermissionAsk = (error, sessionId, questionLimitFacts, subscriptionRequiredOutput) => {
|
|
314
309
|
if (isQuestionLimitRefusal(error)) return questionLimitOutput(questionLimitHandBack(questionLimitFacts));
|
|
315
|
-
return outcomeOfFailedAsk(error, sessionId, halted(UNVERIFIABLE_APPROVAL_REASON)) ??
|
|
310
|
+
return outcomeOfFailedAsk(error, sessionId, halted(UNVERIFIABLE_APPROVAL_REASON)) ?? subscriptionRequiredOutput;
|
|
316
311
|
};
|
|
317
|
-
var handlePushOnly = async (apiKey,
|
|
312
|
+
var handlePushOnly = async (apiKey, call, timeoutSeconds, timeoutAction, signals) => {
|
|
313
|
+
const {
|
|
314
|
+
description,
|
|
315
|
+
projectName,
|
|
316
|
+
agentName,
|
|
317
|
+
sessionId,
|
|
318
|
+
machineId,
|
|
319
|
+
toolName,
|
|
320
|
+
toolTarget,
|
|
321
|
+
decision,
|
|
322
|
+
agentPromptFollows,
|
|
323
|
+
startMs,
|
|
324
|
+
subscriptionRequiredOutput,
|
|
325
|
+
announceWait: announceWait2
|
|
326
|
+
} = call;
|
|
318
327
|
const effectiveWait = effectiveWaitSeconds(timeoutAction, timeoutSeconds, "claude");
|
|
319
328
|
const now = Date.now();
|
|
320
|
-
const requestedDeadline = hookWaitDeadline(
|
|
321
|
-
const clampCut = hookWaitClamped(
|
|
329
|
+
const requestedDeadline = hookWaitDeadline(startMs, effectiveWait, "claude", now);
|
|
330
|
+
const clampCut = hookWaitClamped(startMs, effectiveWait, "claude", now);
|
|
322
331
|
let result;
|
|
323
332
|
try {
|
|
324
333
|
result = await askUser(apiKey, {
|
|
325
334
|
question: `Allow ${description || UNNAMED_ACTION}?`,
|
|
326
335
|
type: "confirm",
|
|
327
336
|
context: `Agent wants to run this in ${projectName}`,
|
|
328
|
-
agentName
|
|
337
|
+
agentName,
|
|
329
338
|
sessionId,
|
|
330
339
|
machineId,
|
|
331
340
|
toolName,
|
|
@@ -337,11 +346,11 @@ var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, ti
|
|
|
337
346
|
return outcomeOfFailedPermissionAsk(error, sessionId, {
|
|
338
347
|
refusesUnanswered: refusesWhenUnanswered({ mode: "push_only", timeoutAction }),
|
|
339
348
|
agentPromptFollows
|
|
340
|
-
});
|
|
349
|
+
}, subscriptionRequiredOutput);
|
|
341
350
|
}
|
|
342
351
|
if (isDecisionStopped(result)) return halted(DECISION_STOP_REASON);
|
|
343
352
|
const deadline = storedWaitDeadline(result, requestedDeadline);
|
|
344
|
-
if (waitsForThePhone(result))
|
|
353
|
+
if (waitsForThePhone(result)) announceWait2(effectiveWait, result.answerUrl, sessionId);
|
|
345
354
|
const answer = await waitForQuestion(apiKey, result, deadline);
|
|
346
355
|
if (isDecisionStopped(answer)) return halted(DECISION_STOP_REASON);
|
|
347
356
|
if (!answer.answered && isLocalQuestionHandoff(result)) return ask("Approve in the current client.");
|
|
@@ -362,18 +371,29 @@ var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, ti
|
|
|
362
371
|
return ask("No push response, asking in terminal");
|
|
363
372
|
}
|
|
364
373
|
};
|
|
365
|
-
var
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
374
|
+
var handlePushFirst = async (apiKey, call, pushFirstSeconds, signals) => {
|
|
375
|
+
const {
|
|
376
|
+
description,
|
|
377
|
+
projectName,
|
|
378
|
+
agentName,
|
|
379
|
+
sessionId,
|
|
380
|
+
machineId,
|
|
381
|
+
toolName,
|
|
382
|
+
toolTarget,
|
|
383
|
+
decision,
|
|
384
|
+
agentPromptFollows,
|
|
385
|
+
startMs,
|
|
386
|
+
subscriptionRequiredOutput,
|
|
387
|
+
announceWait: announceWait2
|
|
388
|
+
} = call;
|
|
389
|
+
const requestedDeadline = hookWaitDeadline(startMs, pushFirstSeconds, "claude", Date.now());
|
|
370
390
|
let result;
|
|
371
391
|
try {
|
|
372
392
|
result = await askUser(apiKey, {
|
|
373
393
|
question: `Allow ${description || UNNAMED_ACTION}?`,
|
|
374
394
|
type: "confirm",
|
|
375
395
|
context: `Agent wants to run this in ${projectName}`,
|
|
376
|
-
agentName
|
|
396
|
+
agentName,
|
|
377
397
|
sessionId,
|
|
378
398
|
machineId,
|
|
379
399
|
toolName,
|
|
@@ -382,10 +402,10 @@ var handlePushFirst = async (apiKey, description, projectName, pushFirstSeconds,
|
|
|
382
402
|
...decision
|
|
383
403
|
});
|
|
384
404
|
} catch (error) {
|
|
385
|
-
return outcomeOfFailedPermissionAsk(error, sessionId, { refusesUnanswered: false, agentPromptFollows });
|
|
405
|
+
return outcomeOfFailedPermissionAsk(error, sessionId, { refusesUnanswered: false, agentPromptFollows }, subscriptionRequiredOutput);
|
|
386
406
|
}
|
|
387
407
|
if (isDecisionStopped(result)) return halted(DECISION_STOP_REASON);
|
|
388
|
-
if (waitsForThePhone(result))
|
|
408
|
+
if (waitsForThePhone(result)) announceWait2(pushFirstSeconds, result.answerUrl, sessionId);
|
|
389
409
|
const deadline = storedWaitDeadline(result, requestedDeadline);
|
|
390
410
|
const answer = await waitForQuestion(apiKey, result, deadline, 1500);
|
|
391
411
|
if (isDecisionStopped(answer)) return halted(DECISION_STOP_REASON);
|
|
@@ -396,6 +416,20 @@ var handlePushFirst = async (apiKey, description, projectName, pushFirstSeconds,
|
|
|
396
416
|
}
|
|
397
417
|
return ask(WITHDRAWN_APPROVAL_REASON);
|
|
398
418
|
};
|
|
419
|
+
|
|
420
|
+
// src/hook.ts
|
|
421
|
+
var START_MS = Date.now();
|
|
422
|
+
var ACTIVE_AGENT = activeIdentity(process.argv);
|
|
423
|
+
var ACTIVE_SOURCE = activeHookSource(process.argv);
|
|
424
|
+
var HANDED_DOWN_BY_THE_MAC_BRIDGE = namedSource(process.argv) !== void 0;
|
|
425
|
+
var CLAUDE_SESSION_ATTENDED_ENV = "CLAUDE_CODE_SESSION_ATTENDED";
|
|
426
|
+
var PUSHARY_IS_SOLE_GATE = ACTIVE_SOURCE !== null && hookCompatibleProfileBySource(ACTIVE_SOURCE)?.soleGate != null;
|
|
427
|
+
var agentNameIn = (projectName) => `${ACTIVE_AGENT.label} - ${projectName}`;
|
|
428
|
+
var allowWithInput = (updatedInput) => claudePreToolUseOutput("allow", void 0, updatedInput);
|
|
429
|
+
var undecidedCall = (reason) => PUSHARY_IS_SOLE_GATE ? deny(reason) : void 0;
|
|
430
|
+
var handleTerminalOnly = () => {
|
|
431
|
+
return ask();
|
|
432
|
+
};
|
|
399
433
|
var handleNotifyOnly = async (apiKey, description, projectName, sessionId, machineId) => {
|
|
400
434
|
try {
|
|
401
435
|
await sendNotification(apiKey, {
|
|
@@ -522,6 +556,20 @@ var dispatchModeHandler = async (apiKey, input, toolPolicy, machineId, trainingC
|
|
|
522
556
|
permissionMode: input.permission_mode
|
|
523
557
|
};
|
|
524
558
|
const signals = {};
|
|
559
|
+
const permissionAsk = {
|
|
560
|
+
description,
|
|
561
|
+
projectName,
|
|
562
|
+
agentName: agentNameIn(projectName),
|
|
563
|
+
sessionId,
|
|
564
|
+
machineId,
|
|
565
|
+
toolName: input.tool_name,
|
|
566
|
+
toolTarget,
|
|
567
|
+
decision,
|
|
568
|
+
agentPromptFollows,
|
|
569
|
+
startMs: START_MS,
|
|
570
|
+
subscriptionRequiredOutput: undecidedCall(SOLE_GATE_SUBSCRIPTION_REASON),
|
|
571
|
+
announceWait
|
|
572
|
+
};
|
|
525
573
|
const runHandler = () => {
|
|
526
574
|
const mode = ownPrompt ? toolPolicy.mode : approvalModeWithoutLocalPrompt(toolPolicy.mode);
|
|
527
575
|
if (terminalLive && pushesToThePhone(mode)) {
|
|
@@ -529,15 +577,15 @@ var dispatchModeHandler = async (apiKey, input, toolPolicy, machineId, trainingC
|
|
|
529
577
|
}
|
|
530
578
|
switch (mode) {
|
|
531
579
|
case "push_only":
|
|
532
|
-
return handlePushOnly(apiKey,
|
|
580
|
+
return handlePushOnly(apiKey, permissionAsk, toolPolicy.timeoutSeconds, ownPrompt ? toolPolicy.timeoutAction : timeoutActionWithoutLocalPrompt(toolPolicy), signals);
|
|
533
581
|
case "terminal_only":
|
|
534
582
|
return Promise.resolve(handleTerminalOnly());
|
|
535
583
|
case "push_first":
|
|
536
|
-
return handlePushFirst(apiKey,
|
|
584
|
+
return handlePushFirst(apiKey, permissionAsk, toolPolicy.pushFirstSeconds, signals);
|
|
537
585
|
case "notify_only":
|
|
538
586
|
return handleNotifyOnly(apiKey, description, projectName, sessionId, machineId);
|
|
539
587
|
default:
|
|
540
|
-
return handlePushFirst(apiKey,
|
|
588
|
+
return handlePushFirst(apiKey, permissionAsk, toolPolicy.pushFirstSeconds, signals);
|
|
541
589
|
}
|
|
542
590
|
};
|
|
543
591
|
const result = await runHandler();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AGENT_CHOICES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZK5WYAMI.js";
|
|
4
4
|
import {
|
|
5
5
|
BELL_HOOK_BINARY
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FONWVVDD.js";
|
|
7
7
|
import {
|
|
8
8
|
CLAUDE_HOOK_EVENTS,
|
|
9
9
|
CODEX_HOOK_EVENTS,
|
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
holdBudgetOf,
|
|
13
13
|
isProtectedByScope,
|
|
14
14
|
registerHookEntry
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-TI4JYPGQ.js";
|
|
16
16
|
import {
|
|
17
17
|
CURSOR_GATE_EVENTS,
|
|
18
18
|
HOOK_BUDGETS,
|
|
19
19
|
HOOK_LOCATOR_BINARY,
|
|
20
20
|
hookCommandHoldBudget
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-RQOT6QL3.js";
|
|
22
22
|
|
|
23
23
|
// src/diagnostics/bridge.ts
|
|
24
24
|
import { execFileSync } from "child_process";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
keyPrefix,
|
|
5
5
|
readConfigFileKey,
|
|
6
6
|
readMacAppKeyPrefix
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JOBSKQ2Z.js";
|
|
8
8
|
import {
|
|
9
9
|
NPX_LATEST_COMMAND
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-X2MTVD4W.js";
|
|
11
11
|
|
|
12
12
|
// src/key-signed-out.ts
|
|
13
13
|
var VERDICT_BY_CHECK = {
|
|
@@ -2,25 +2,31 @@ import {
|
|
|
2
2
|
SIGNED_OUT_ON_MAC_MESSAGE,
|
|
3
3
|
describeSignedOutKey,
|
|
4
4
|
readSignedOutDiagnosis
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CHYBOTQN.js";
|
|
6
|
+
import {
|
|
7
|
+
APPROVAL_RULES_PATH
|
|
8
|
+
} from "./chunk-5MOJCOCF.js";
|
|
6
9
|
import {
|
|
7
10
|
createIo
|
|
8
11
|
} from "./chunk-FO3MDD26.js";
|
|
9
12
|
import {
|
|
10
13
|
readKeySource
|
|
11
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JOBSKQ2Z.js";
|
|
12
15
|
import {
|
|
13
16
|
absoluteUrl,
|
|
14
17
|
checkApiKey,
|
|
15
18
|
describeKeyCheck,
|
|
16
19
|
keyCheckFromResponse
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-3THDNNVL.js";
|
|
18
21
|
import {
|
|
19
22
|
EXIT
|
|
20
23
|
} from "./chunk-KZERVKTD.js";
|
|
21
24
|
import {
|
|
22
25
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-32OSSYGZ.js";
|
|
27
|
+
import {
|
|
28
|
+
KEY_SCOPE
|
|
29
|
+
} from "./chunk-RQOT6QL3.js";
|
|
24
30
|
|
|
25
31
|
// src/cli/report-key.ts
|
|
26
32
|
var { dim, yellow } = createIo();
|
|
@@ -61,16 +67,28 @@ var exitOnFailedResponse = async (response, baseUrl) => {
|
|
|
61
67
|
};
|
|
62
68
|
var REFUSED_SETTINGS_ACTION = {
|
|
63
69
|
mode: "change the approval mode",
|
|
70
|
+
mode_clear: "end a temporary approval mode",
|
|
64
71
|
wait: "change how long approvals wait for you",
|
|
65
72
|
suggestions: "read or accept rule suggestions"
|
|
66
73
|
};
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
var settingsChangeStep = (request, baseUrl) => {
|
|
75
|
+
const approvalRules = absoluteUrl(baseUrl, APPROVAL_RULES_PATH);
|
|
76
|
+
switch (request) {
|
|
77
|
+
case "mode":
|
|
78
|
+
return `Change it in the Pushary app, or on the dashboard: ${approvalRules}`;
|
|
79
|
+
case "mode_clear":
|
|
80
|
+
return "A temporary mode ends on its own. To end it now, pick a mode in the Pushary app.";
|
|
81
|
+
case "wait":
|
|
82
|
+
return `Change it on the dashboard: ${approvalRules}`;
|
|
83
|
+
case "suggestions":
|
|
84
|
+
return `Review them on the dashboard: ${approvalRules}`;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var isAgentKeyRefusal = (status, check) => status === 401 && check.kind === "ok" && check.identity.keyScope === KEY_SCOPE.agent;
|
|
70
88
|
var describeAgentKeyRefusal = (request, baseUrl = getBaseUrl()) => ({
|
|
71
|
-
message: `This computer's key cannot ${REFUSED_SETTINGS_ACTION[request]}.
|
|
89
|
+
message: `This computer's key cannot ${REFUSED_SETTINGS_ACTION[request]}. It runs approvals and notifications, not account settings.`,
|
|
72
90
|
next: [
|
|
73
|
-
|
|
91
|
+
settingsChangeStep(request, baseUrl),
|
|
74
92
|
"The key itself is valid. Nothing on this computer needs fixing."
|
|
75
93
|
],
|
|
76
94
|
exitCode: EXIT.USAGE,
|
|
@@ -90,6 +108,5 @@ var exitOnFailedSettingsRequest = async (response, settings) => {
|
|
|
90
108
|
|
|
91
109
|
export {
|
|
92
110
|
printKeyCheck,
|
|
93
|
-
APPROVAL_SETTINGS_PATH,
|
|
94
111
|
exitOnFailedSettingsRequest
|
|
95
112
|
};
|
|
@@ -6,18 +6,18 @@ import {
|
|
|
6
6
|
McpToolError,
|
|
7
7
|
SubscriptionRequiredError,
|
|
8
8
|
callMcpTool
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KNUYUQBP.js";
|
|
10
10
|
import {
|
|
11
11
|
installNetworkDefaults,
|
|
12
12
|
isNetworkFailure
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-P4RXSZDT.js";
|
|
14
14
|
import {
|
|
15
15
|
clientReportClaims
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-TI4JYPGQ.js";
|
|
17
17
|
import {
|
|
18
18
|
getApiKey,
|
|
19
19
|
getBaseUrl
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-32OSSYGZ.js";
|
|
21
21
|
import {
|
|
22
22
|
ASK_AGENT_NAME_MAX,
|
|
23
23
|
CLIENT_REPORT_PATH,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
TOOL_FAILURE_CODES,
|
|
27
27
|
degradedLine,
|
|
28
28
|
truncateLine
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-RQOT6QL3.js";
|
|
30
30
|
|
|
31
31
|
// src/api.ts
|
|
32
32
|
import { randomUUID } from "crypto";
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
APPROVAL_RULES_PATH,
|
|
3
|
+
canChangeApprovalSettings
|
|
4
|
+
} from "./chunk-5MOJCOCF.js";
|
|
1
5
|
import {
|
|
2
6
|
callMcpTool
|
|
3
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KNUYUQBP.js";
|
|
8
|
+
import {
|
|
9
|
+
absoluteUrl
|
|
10
|
+
} from "./chunk-3THDNNVL.js";
|
|
11
|
+
import {
|
|
12
|
+
getBaseUrl
|
|
13
|
+
} from "./chunk-32OSSYGZ.js";
|
|
4
14
|
import {
|
|
5
15
|
NPX_LATEST_COMMAND
|
|
6
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-X2MTVD4W.js";
|
|
7
17
|
import {
|
|
18
|
+
APPROVAL_MODE_META,
|
|
8
19
|
classifyConfirmResponse,
|
|
9
20
|
isAnswerSource
|
|
10
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-RQOT6QL3.js";
|
|
11
22
|
|
|
12
23
|
// src/reach.ts
|
|
13
24
|
var reachVerdict = (channels) => {
|
|
@@ -304,7 +315,15 @@ var unansweredNextStep = (appPlatforms) => {
|
|
|
304
315
|
const step = notificationAnswerStep(appPlatforms);
|
|
305
316
|
return step === null ? CHECK_THE_NOTIFICATION_OPENED : `To send another one, run pushary doctor --roundtrip. ${step}`;
|
|
306
317
|
};
|
|
307
|
-
var
|
|
318
|
+
var PHONE_APPROVAL_MODES = ["push_only", "push_first"];
|
|
319
|
+
var NOTIFY_ONLY_SENT = `Sent. This site is set to ${APPROVAL_MODE_META.notify_only.label}, so questions never wait for an answer.`;
|
|
320
|
+
var phoneApprovalModeLabels = PHONE_APPROVAL_MODES.map((mode) => APPROVAL_MODE_META[mode].label).join(" or ");
|
|
321
|
+
var phoneApprovalModeCommands = PHONE_APPROVAL_MODES.map((mode) => `pushary mode ${mode}`).join(" or ");
|
|
322
|
+
var answerFromYourPhoneSteps = (baseUrl, keyScope) => {
|
|
323
|
+
const inTheAppOrDashboard = `To answer approvals from your phone, choose ${phoneApprovalModeLabels} in the Pushary app, or on the dashboard: ${absoluteUrl(baseUrl, APPROVAL_RULES_PATH)}`;
|
|
324
|
+
return canChangeApprovalSettings(keyScope) ? [inTheAppOrDashboard, `With this key you can also run ${phoneApprovalModeCommands}.`] : [inTheAppOrDashboard];
|
|
325
|
+
};
|
|
326
|
+
var describeRoundTripOutcome = (outcome, { appPlatforms = [], baseUrl = getBaseUrl(), keyScope = null } = {}) => {
|
|
308
327
|
switch (outcome.kind) {
|
|
309
328
|
case "answered":
|
|
310
329
|
return {
|
|
@@ -324,8 +343,8 @@ var describeRoundTripOutcome = (outcome, appPlatforms = []) => {
|
|
|
324
343
|
case "notify-only":
|
|
325
344
|
return {
|
|
326
345
|
ok: true,
|
|
327
|
-
message:
|
|
328
|
-
next: [
|
|
346
|
+
message: NOTIFY_ONLY_SENT,
|
|
347
|
+
next: [...answerFromYourPhoneSteps(baseUrl, keyScope)]
|
|
329
348
|
};
|
|
330
349
|
case "no-recipients":
|
|
331
350
|
return {
|
|
@@ -344,8 +363,8 @@ var describeRoundTripOutcome = (outcome, appPlatforms = []) => {
|
|
|
344
363
|
};
|
|
345
364
|
}
|
|
346
365
|
};
|
|
347
|
-
var describeRoundTrip = (outcome,
|
|
348
|
-
const report = describeRoundTripOutcome(outcome,
|
|
366
|
+
var describeRoundTrip = (outcome, context = {}) => {
|
|
367
|
+
const report = describeRoundTripOutcome(outcome, context);
|
|
349
368
|
return { ...report, next: [...report.next, "Agent hook activation remains unverified. Restart your agent and check one real approval."] };
|
|
350
369
|
};
|
|
351
370
|
var roundTripEvidence = (outcome) => ({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autoUpdateLock
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TI4JYPGQ.js";
|
|
4
4
|
import {
|
|
5
5
|
installPackageGlobally,
|
|
6
6
|
npmErrorMessage,
|
|
7
7
|
writeJsonAtomic
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WJLHZ6E6.js";
|
|
9
9
|
|
|
10
10
|
// src/upgrade-lock.ts
|
|
11
11
|
import { fork } from "child_process";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
APPROVAL_SETTINGS_PATH
|
|
3
|
-
} from "./chunk-26W46E46.js";
|
|
4
1
|
import {
|
|
5
2
|
readMacAppAgentKey
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LS42NV6E.js";
|
|
4
|
+
import {
|
|
5
|
+
API_KEYS_PATH
|
|
6
|
+
} from "./chunk-5MOJCOCF.js";
|
|
7
7
|
import {
|
|
8
8
|
findExportedKeyLines,
|
|
9
9
|
isAdoptedMacAppKey,
|
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
readConfigFileKey,
|
|
14
14
|
readKeySource,
|
|
15
15
|
readMacAppKeyPrefix
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JOBSKQ2Z.js";
|
|
17
17
|
import {
|
|
18
18
|
absoluteUrl
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-3THDNNVL.js";
|
|
20
20
|
import {
|
|
21
21
|
isValidApiKey
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-RQOT6QL3.js";
|
|
23
23
|
|
|
24
24
|
// src/key-revocation.ts
|
|
25
25
|
var SELF_REVOKE_PATH = "/api/v1/server/keys/self/revoke";
|
|
@@ -128,7 +128,7 @@ var SPARED_KEY_WHY = {
|
|
|
128
128
|
no_creation_record: "This CLI has no record of creating it, so it may be in use by the Mac app or on another machine."
|
|
129
129
|
};
|
|
130
130
|
var localRemovalOf = (dryRun) => dryRun ? "would be removed here" : "removed here";
|
|
131
|
-
var settingsUrlOf = (baseUrl) => absoluteUrl(baseUrl,
|
|
131
|
+
var settingsUrlOf = (baseUrl) => absoluteUrl(baseUrl, API_KEYS_PATH);
|
|
132
132
|
var revokeYourselfHint = (reason, baseUrl) => reason === "no_creation_record" ? `Revoke it at ${settingsUrlOf(baseUrl)} if nothing else uses it.` : null;
|
|
133
133
|
var describeCliKeyRevocation = (outcome, run) => {
|
|
134
134
|
const label = `API key ${outcome.keyPrefix}`;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerTranscript
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SB6TYV4M.js";
|
|
4
4
|
import {
|
|
5
5
|
namedEvent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ICQCQAUO.js";
|
|
7
7
|
import {
|
|
8
8
|
isBridgeLocator,
|
|
9
9
|
liveBridgeProbe,
|
|
10
10
|
pusharyHookExecutable,
|
|
11
11
|
resolveBridgeStub
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BFF3ABFV.js";
|
|
13
13
|
import {
|
|
14
14
|
writeDegraded
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-D3U6CN7T.js";
|
|
16
16
|
import {
|
|
17
17
|
cursorUserHooks
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-TI4JYPGQ.js";
|
|
19
19
|
import {
|
|
20
20
|
atLeast,
|
|
21
21
|
parseVersion
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-WJLHZ6E6.js";
|
|
23
23
|
import {
|
|
24
24
|
CURSOR_GATE_COVERAGE,
|
|
25
25
|
CURSOR_GATE_SCRIPT,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
isGrokSessionEndStop,
|
|
34
34
|
isRecord,
|
|
35
35
|
toolsCoveredByGateEntry
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-RQOT6QL3.js";
|
|
37
37
|
|
|
38
38
|
// src/tool-hook-input.ts
|
|
39
39
|
var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode", "cursor_version"];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addGeminiMcpServer,
|
|
3
3
|
removeGeminiMcpServer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BFF3ABFV.js";
|
|
5
5
|
import {
|
|
6
6
|
CLAUDE_CODE_AGENT,
|
|
7
7
|
compatibleToolLookup
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XFDWLDHG.js";
|
|
9
9
|
import {
|
|
10
10
|
CLAUDE_HOOK_EVENTS,
|
|
11
11
|
PUSHARY_MCP_URL,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
isPusharyHook,
|
|
18
18
|
registerHookEntry,
|
|
19
19
|
removeClaudeMcpServers
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-TI4JYPGQ.js";
|
|
21
21
|
import {
|
|
22
22
|
HOOK_COMPATIBLE_PROFILES,
|
|
23
23
|
PHONE_ANSWERED_TOOLS,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
pusharyMissingReason,
|
|
29
29
|
refusalOutput,
|
|
30
30
|
withHookHoldBudget
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-RQOT6QL3.js";
|
|
32
32
|
|
|
33
33
|
// src/config-document.ts
|
|
34
34
|
import { parse, stringify } from "smol-toml";
|