@pushary/agent-hooks 0.95.2 → 0.95.5
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 +19 -0
- package/README.md +1 -1
- package/data/cursor-plugin/.cursor-plugin/plugin.json +1 -1
- package/data/cursor-plugin/CHANGELOG.md +5 -0
- package/data/cursor-plugin/README.md +6 -8
- package/data/cursor-plugin/hooks/hooks.json +56 -1
- package/data/cursor-plugin/scripts/pushary-gate.mjs +120 -71
- package/data/vscode-plugin/.claude-plugin/plugin.json +1 -1
- package/data/vscode-plugin/CHANGELOG.md +5 -0
- package/data/vscode-plugin/README.md +7 -15
- package/data/vscode-plugin/hooks/hooks.json +49 -0
- package/data/vscode-plugin/scripts/pushary-gate.mjs +208 -88
- package/dist/bin/pushary-bell-hook.js +20 -22
- package/dist/bin/pushary-bell.js +9 -11
- package/dist/bin/pushary-claude.js +58 -46
- package/dist/bin/pushary-clean.js +21 -20
- package/dist/bin/pushary-codex-bridge.js +120 -25
- package/dist/bin/pushary-codex-hook.js +43 -63
- package/dist/bin/pushary-codex.js +11 -10
- package/dist/bin/pushary-connect.js +8 -10
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +26 -28
- package/dist/bin/pushary-disconnect.js +11 -10
- package/dist/bin/pushary-doctor.js +25 -25
- package/dist/bin/pushary-elicitation-hook.js +30 -31
- package/dist/bin/pushary-gemini-bridge.js +9 -11
- package/dist/bin/pushary-gemini-hook.js +45 -79
- package/dist/bin/pushary-hook.js +27 -29
- package/dist/bin/pushary-login.js +57 -31
- package/dist/bin/pushary-logout.js +6 -8
- package/dist/bin/pushary-mode.js +5 -5
- package/dist/bin/pushary-notification-hook.js +22 -24
- package/dist/bin/pushary-opencode-hook.js +38 -74
- package/dist/bin/pushary-permission-denied-hook.js +25 -27
- package/dist/bin/pushary-permission-hook.js +25 -27
- package/dist/bin/pushary-post-hook.js +22 -24
- package/dist/bin/pushary-prompt-hook.js +22 -24
- package/dist/bin/pushary-session-end-hook.js +22 -24
- package/dist/bin/pushary-session-start-hook.js +25 -27
- package/dist/bin/pushary-setup.js +78 -55
- package/dist/bin/pushary-stats.js +4 -4
- package/dist/bin/pushary-status.js +10 -12
- package/dist/bin/pushary-stop-hook.js +22 -24
- package/dist/bin/pushary-stopfailure-hook.js +22 -24
- package/dist/bin/pushary-suggestions.js +2 -2
- package/dist/bin/pushary-transcript-register.js +18 -20
- package/dist/bin/pushary-transcripts.js +7 -9
- package/dist/bin/pushary-upgrade.js +17 -19
- package/dist/bin/pushary-wait.js +5 -5
- package/dist/bin/pushary.js +1 -1
- package/dist/{chunk-7LUFYRH4.js → chunk-2D7BAOMY.js} +7 -7
- package/dist/{chunk-3ZUTNTZA.js → chunk-2ZTL3PGN.js} +1 -1
- package/dist/{chunk-EPFDN2ZT.js → chunk-32RMQO5Z.js} +1 -1
- package/dist/{chunk-EZIEXHYM.js → chunk-3AJIK5AO.js} +5 -2
- package/dist/{chunk-IPHOUBTU.js → chunk-4PX4QK2Z.js} +1 -1
- package/dist/{chunk-UW4LWAWY.js → chunk-4RF52LSU.js} +8 -8
- package/dist/{chunk-UOTSWS5N.js → chunk-67YNQ3QA.js} +43 -98
- package/dist/{chunk-G4TL4YWH.js → chunk-6AEM5RCS.js} +1 -1
- package/dist/{chunk-G24SEVCI.js → chunk-6VANQN5Q.js} +3 -7
- package/dist/{chunk-CKOLDI47.js → chunk-BDI2MXTT.js} +2 -2
- package/dist/{chunk-YKLCWWEI.js → chunk-BMANRGJQ.js} +1 -1
- package/dist/{chunk-2XUPP4WM.js → chunk-CUEZMPLJ.js} +1 -1
- package/dist/{chunk-A4R6BZCK.js → chunk-D62EONG3.js} +1 -1
- package/dist/{chunk-ZDAT5KMU.js → chunk-D6PRC3YQ.js} +1 -1
- package/dist/{chunk-MOY5X6HJ.js → chunk-DLLAWCQB.js} +1 -1
- package/dist/{chunk-DSTLA2TC.js → chunk-GOPIMNVC.js} +1 -1
- package/dist/{chunk-CH6DTGQR.js → chunk-HBHEX3JQ.js} +3 -3
- package/dist/{chunk-DNVDKHQD.js → chunk-HCMM3BOW.js} +226 -58
- package/dist/{chunk-76XICHYT.js → chunk-HGUZOUB2.js} +4 -4
- package/dist/{chunk-E3NF5CL2.js → chunk-HQIVR7MM.js} +6 -3
- package/dist/{chunk-JDFB3YKG.js → chunk-I6GZX3FT.js} +3 -3
- package/dist/{chunk-3OXHYPZG.js → chunk-IM2A5H33.js} +4 -1
- package/dist/{chunk-V27AHID3.js → chunk-IVQMNLSA.js} +3 -14
- package/dist/{chunk-4LL6LG5X.js → chunk-KAVDAZ7A.js} +43 -1
- package/dist/chunk-KBITFQST.js +6 -0
- package/dist/{chunk-AMZJ3CKW.js → chunk-KI4PA7MQ.js} +1 -1
- package/dist/{chunk-IAEXPTXA.js → chunk-N4VNLISN.js} +2 -2
- package/dist/{chunk-VX3BWMC5.js → chunk-OEKFD5BC.js} +1 -1
- package/dist/{chunk-QF4RI5CD.js → chunk-OI3DJA7N.js} +1 -1
- package/dist/{chunk-WB2C7VPF.js → chunk-OW6AZDY2.js} +3 -3
- package/dist/{chunk-4XXUHWIK.js → chunk-QHWXUNMN.js} +1 -1
- package/dist/{chunk-M7WWEFG6.js → chunk-QQGNFHIK.js} +2 -2
- package/dist/{chunk-YJAQRKH5.js → chunk-RLXVW4AM.js} +1 -1
- package/dist/{chunk-GUVCYYDK.js → chunk-S5CMLR35.js} +94 -15
- package/dist/{chunk-EUAQ4YAN.js → chunk-UCS65VVR.js} +1 -1
- package/dist/{chunk-WM5XMCID.js → chunk-VOSGZ6PH.js} +4 -4
- package/dist/{chunk-QUE76J4H.js → chunk-VTO3TNIB.js} +1 -1
- package/dist/{chunk-6FAHPGCZ.js → chunk-WDKHZRAS.js} +183 -25
- package/dist/{chunk-5GLPYGKS.js → chunk-WRDLHR2F.js} +2 -2
- package/dist/{chunk-RVSEGFPD.js → chunk-XLOELLAS.js} +9 -4
- package/dist/chunk-XS33QBJA.js +112 -0
- package/dist/{chunk-FQUV5KTM.js → chunk-Z2UWFEJW.js} +8 -8
- package/dist/src/index.d.ts +8 -1
- package/dist/src/index.js +11 -12
- package/package.json +1 -1
- package/dist/chunk-BC3VCZ3E.js +0 -86
- package/dist/chunk-RER3FRTD.js +0 -265
- package/dist/chunk-X7YWD6IS.js +0 -44
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defersToNativeMode
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D62EONG3.js";
|
|
4
4
|
import {
|
|
5
5
|
isGatingMoment,
|
|
6
6
|
recordKeylessMoment
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UCS65VVR.js";
|
|
8
8
|
import {
|
|
9
9
|
denyReasonFrom,
|
|
10
10
|
isDeferAnswer
|
|
11
11
|
} from "./chunk-YHG74UFF.js";
|
|
12
12
|
import {
|
|
13
13
|
CLAUDE_CODE_AGENT,
|
|
14
|
+
DEFAULT_SESSION,
|
|
14
15
|
fetchModeState,
|
|
15
16
|
getPolicy,
|
|
16
17
|
readLastPrompt,
|
|
@@ -19,15 +20,15 @@ import {
|
|
|
19
20
|
reportEvent,
|
|
20
21
|
settleQuestionsForToolUse,
|
|
21
22
|
throttlePass
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-HCMM3BOW.js";
|
|
23
24
|
import {
|
|
24
|
-
|
|
25
|
+
DECISION_STOP_REASON,
|
|
25
26
|
askUser,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} from "./chunk-
|
|
27
|
+
isDecisionStopped,
|
|
28
|
+
isLocalQuestionHandoff,
|
|
29
|
+
sendNotification,
|
|
30
|
+
waitForQuestion
|
|
31
|
+
} from "./chunk-XS33QBJA.js";
|
|
31
32
|
import {
|
|
32
33
|
UNNAMED_ACTION,
|
|
33
34
|
deriveAction,
|
|
@@ -37,14 +38,10 @@ import {
|
|
|
37
38
|
describeToolCall,
|
|
38
39
|
permissionDeniedAction,
|
|
39
40
|
scopePathFor
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import {
|
|
42
|
-
PRETOOLUSE_HANDLED_TOOLS,
|
|
43
|
-
PRETOOLUSE_PHONE_ANSWERED_TOOLS
|
|
44
|
-
} from "./chunk-V27AHID3.js";
|
|
41
|
+
} from "./chunk-BDI2MXTT.js";
|
|
45
42
|
import {
|
|
46
43
|
getMachineId
|
|
47
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-N4VNLISN.js";
|
|
48
45
|
import {
|
|
49
46
|
getApiKey,
|
|
50
47
|
getBaseUrl
|
|
@@ -56,12 +53,13 @@ import {
|
|
|
56
53
|
effectiveWaitSeconds,
|
|
57
54
|
hookWaitClamped,
|
|
58
55
|
hookWaitDeadline,
|
|
56
|
+
isPermissionRequestOwnedByPreToolUse,
|
|
59
57
|
isPusharyOwnTool,
|
|
60
58
|
parseAgentQuestionAnswers,
|
|
61
59
|
parseAgentQuestions,
|
|
62
60
|
resolveGate,
|
|
63
61
|
stoppedOutput
|
|
64
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-WDKHZRAS.js";
|
|
65
63
|
|
|
66
64
|
// src/decision-episode.ts
|
|
67
65
|
var EPISODE_PATH = "/api/agent/decision-episode";
|
|
@@ -99,7 +97,6 @@ var storedWaitDeadline = (result, requestedDeadline) => {
|
|
|
99
97
|
const stored = result.waitEndsAt ? Date.parse(result.waitEndsAt) : Number.NaN;
|
|
100
98
|
return Number.isFinite(stored) ? Math.min(stored, requestedDeadline) : requestedDeadline;
|
|
101
99
|
};
|
|
102
|
-
var returnedAnswer = (result) => result.answered === true ? { answered: true, value: result.value, note: result.note } : null;
|
|
103
100
|
var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, timeoutAction, sessionId, machineId, toolName, toolTarget, decision, signals) => {
|
|
104
101
|
const effectiveWait = effectiveWaitSeconds(timeoutAction, timeoutSeconds, "claude");
|
|
105
102
|
const now = Date.now();
|
|
@@ -120,43 +117,21 @@ var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, ti
|
|
|
120
117
|
...decision
|
|
121
118
|
});
|
|
122
119
|
} catch {
|
|
123
|
-
|
|
124
|
-
case "approve":
|
|
125
|
-
return allow();
|
|
126
|
-
case "deny":
|
|
127
|
-
return deny("Push notification failed, denying per policy");
|
|
128
|
-
default:
|
|
129
|
-
return void 0;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
if (result.suppressed || result.status === "terminal") {
|
|
133
|
-
await cancelQuestion(apiKey, result.correlationId).catch(() => {
|
|
134
|
-
});
|
|
135
|
-
return ask(result.suppressed ? "You are at the keyboard, approve here." : "Delivery mode is Terminal, approve here.");
|
|
136
|
-
}
|
|
137
|
-
if (result.noDevices) {
|
|
138
|
-
await cancelQuestion(apiKey, result.correlationId).catch(() => {
|
|
139
|
-
});
|
|
140
|
-
switch (timeoutAction) {
|
|
141
|
-
case "approve":
|
|
142
|
-
return allow();
|
|
143
|
-
case "deny":
|
|
144
|
-
return deny("No device connected to approve on");
|
|
145
|
-
default:
|
|
146
|
-
return void 0;
|
|
147
|
-
}
|
|
120
|
+
return halted("Pushary could not create a verifiable approval. Retry the action.");
|
|
148
121
|
}
|
|
122
|
+
if (isDecisionStopped(result)) return halted(DECISION_STOP_REASON);
|
|
149
123
|
const deadline = storedWaitDeadline(result, requestedDeadline);
|
|
150
|
-
announceWait(effectiveWait, result.answerUrl, sessionId);
|
|
151
|
-
const answer =
|
|
124
|
+
if (!isLocalQuestionHandoff(result) && !result.answered) announceWait(effectiveWait, result.answerUrl, sessionId);
|
|
125
|
+
const answer = await waitForQuestion(apiKey, result, deadline);
|
|
126
|
+
if (isDecisionStopped(answer)) return halted(DECISION_STOP_REASON);
|
|
127
|
+
if (!answer.answered && isLocalQuestionHandoff(result)) return ask("Approve in the current client.");
|
|
152
128
|
if (answer.answered) {
|
|
153
129
|
if (isDeferAnswer(answer.value)) return ask("Handling on your machine");
|
|
154
130
|
signals.humanDecision = true;
|
|
155
131
|
return answer.value === "yes" ? allow() : deny(denyReasonFrom(answer.value, answer.note));
|
|
156
132
|
}
|
|
157
|
-
if (timeoutAction === "wait" || clampCut) {
|
|
158
|
-
|
|
159
|
-
return ask(timeoutAction === "wait" ? "Still waiting on your phone. Answer here, or on your phone and it will be applied on the next step." : "This step cannot wait any longer. Answer here, or on your phone and it will be applied on the next step.");
|
|
133
|
+
if (timeoutAction === "wait" || clampCut || deadline < requestedDeadline) {
|
|
134
|
+
return ask("The phone question was withdrawn. Approve in the current client.");
|
|
160
135
|
}
|
|
161
136
|
switch (timeoutAction) {
|
|
162
137
|
case "approve":
|
|
@@ -164,7 +139,6 @@ var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, ti
|
|
|
164
139
|
case "deny":
|
|
165
140
|
return deny("No response within timeout");
|
|
166
141
|
default:
|
|
167
|
-
savePendingQuestion(sessionId || DEFAULT_SESSION, result.correlationId, decision.toolUseId);
|
|
168
142
|
return ask("No push response, asking in terminal");
|
|
169
143
|
}
|
|
170
144
|
};
|
|
@@ -188,28 +162,19 @@ var handlePushFirst = async (apiKey, description, projectName, pushFirstSeconds,
|
|
|
188
162
|
...decision
|
|
189
163
|
});
|
|
190
164
|
} catch {
|
|
191
|
-
return
|
|
192
|
-
}
|
|
193
|
-
if (result.suppressed) {
|
|
194
|
-
await cancelQuestion(apiKey, result.correlationId).catch(() => {
|
|
195
|
-
});
|
|
196
|
-
return ask("You are at the keyboard, approve here.");
|
|
165
|
+
return halted("Pushary could not create a verifiable approval. Retry the action.");
|
|
197
166
|
}
|
|
198
|
-
if (result
|
|
199
|
-
|
|
200
|
-
});
|
|
201
|
-
return void 0;
|
|
202
|
-
}
|
|
203
|
-
announceWait(pushFirstSeconds, result.answerUrl, sessionId);
|
|
167
|
+
if (isDecisionStopped(result)) return halted(DECISION_STOP_REASON);
|
|
168
|
+
if (!isLocalQuestionHandoff(result) && !result.answered) announceWait(pushFirstSeconds, result.answerUrl, sessionId);
|
|
204
169
|
const deadline = storedWaitDeadline(result, requestedDeadline);
|
|
205
|
-
const answer =
|
|
170
|
+
const answer = await waitForQuestion(apiKey, result, deadline, 1500);
|
|
171
|
+
if (isDecisionStopped(answer)) return halted(DECISION_STOP_REASON);
|
|
206
172
|
if (answer.answered) {
|
|
207
173
|
if (isDeferAnswer(answer.value)) return ask("Handling on your machine");
|
|
208
174
|
signals.humanDecision = true;
|
|
209
175
|
return answer.value === "yes" ? allow() : deny(denyReasonFrom(answer.value, answer.note));
|
|
210
176
|
}
|
|
211
|
-
|
|
212
|
-
return ask("Sent as push notification. You can also approve here.");
|
|
177
|
+
return ask("The phone question was withdrawn. Approve in the current client.");
|
|
213
178
|
};
|
|
214
179
|
var handleNotifyOnly = async (apiKey, description, projectName, sessionId, machineId) => {
|
|
215
180
|
try {
|
|
@@ -327,7 +292,6 @@ var keylessNoticeOnce = (sessionId) => {
|
|
|
327
292
|
}
|
|
328
293
|
};
|
|
329
294
|
var shouldDeferToNativeMode = defersToNativeMode;
|
|
330
|
-
var handedToTerminal = (result) => result.suppressed === true || result.noDevices === true || result.status === "terminal";
|
|
331
295
|
var withLabels = (question) => ({
|
|
332
296
|
...question,
|
|
333
297
|
labels: question.options.map((option) => option.label)
|
|
@@ -356,17 +320,13 @@ var askAsOneCard = async (apiKey, input, parsed, projectName, deadline) => {
|
|
|
356
320
|
waitEndsAt: new Date(deadline).toISOString()
|
|
357
321
|
});
|
|
358
322
|
} catch {
|
|
359
|
-
return
|
|
360
|
-
}
|
|
361
|
-
if (handedToTerminal(result)) {
|
|
362
|
-
await cancelQuestion(apiKey, result.correlationId).catch(() => {
|
|
363
|
-
});
|
|
364
|
-
return void 0;
|
|
323
|
+
return null;
|
|
365
324
|
}
|
|
366
|
-
|
|
325
|
+
if (isDecisionStopped(result)) return null;
|
|
326
|
+
const answer = await waitForQuestion(apiKey, result, storedWaitDeadline(result, deadline));
|
|
327
|
+
if (isDecisionStopped(answer)) return null;
|
|
367
328
|
const values = answer.answered && answer.value ? parseAgentQuestionAnswers(parsed, answer.value) : null;
|
|
368
329
|
if (!values || isDeferAnswer(answer.value)) {
|
|
369
|
-
savePendingQuestion(input.session_id || DEFAULT_SESSION, result.correlationId, input.tool_use_id);
|
|
370
330
|
return void 0;
|
|
371
331
|
}
|
|
372
332
|
return values;
|
|
@@ -393,21 +353,17 @@ var askQuestionByQuestion = async (apiKey, input, parsed, projectName, deadline)
|
|
|
393
353
|
waitEndsAt: new Date(deadline).toISOString()
|
|
394
354
|
});
|
|
395
355
|
} catch {
|
|
396
|
-
return
|
|
356
|
+
return null;
|
|
397
357
|
}
|
|
398
|
-
if (
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
return void 0;
|
|
402
|
-
}
|
|
403
|
-
const answer = returnedAnswer(result) ?? await pollForAnswer(apiKey, result.correlationId, storedWaitDeadline(result, deadline));
|
|
358
|
+
if (isDecisionStopped(result)) return null;
|
|
359
|
+
const answer = await waitForQuestion(apiKey, result, storedWaitDeadline(result, deadline));
|
|
360
|
+
if (isDecisionStopped(answer)) return null;
|
|
404
361
|
const legacyValue = answer.answered ? answer.value?.trim() : void 0;
|
|
405
362
|
const values = legacyValue ? parseAgentQuestionAnswers([question], legacyValue) ?? parseAgentQuestionAnswers([question], JSON.stringify({
|
|
406
363
|
[question.question]: question.multiSelect ? JSON.stringify([legacyValue]) : legacyValue
|
|
407
364
|
})) : null;
|
|
408
365
|
const value = values?.[question.question];
|
|
409
366
|
if (!value || isDeferAnswer(answer.value)) {
|
|
410
|
-
savePendingQuestion(input.session_id || DEFAULT_SESSION, result.correlationId, input.tool_use_id);
|
|
411
367
|
return void 0;
|
|
412
368
|
}
|
|
413
369
|
answers[question.question] = value;
|
|
@@ -421,6 +377,7 @@ var handleAskUserQuestion = async (apiKey, input, modeState) => {
|
|
|
421
377
|
const projectName = basename(input.cwd ?? process.cwd());
|
|
422
378
|
const deadline = hookWaitDeadline(START_MS, effectiveWaitSeconds("wait", 0, "claude"), "claude", Date.now());
|
|
423
379
|
const answers = parsed.length === 1 ? await askAsOneCard(apiKey, input, parsed, projectName, deadline) : await askQuestionByQuestion(apiKey, input, parsed, projectName, deadline);
|
|
380
|
+
if (answers === null) return halted(DECISION_STOP_REASON);
|
|
424
381
|
if (!answers) return void 0;
|
|
425
382
|
return allowWithInput({ ...input.tool_input ?? {}, answers });
|
|
426
383
|
};
|
|
@@ -450,17 +407,13 @@ var handleExitPlanMode = async (apiKey, input) => {
|
|
|
450
407
|
waitEndsAt: new Date(deadline).toISOString()
|
|
451
408
|
});
|
|
452
409
|
} catch {
|
|
453
|
-
return
|
|
454
|
-
}
|
|
455
|
-
if (handedToTerminal(result)) {
|
|
456
|
-
await cancelQuestion(apiKey, result.correlationId).catch(() => {
|
|
457
|
-
});
|
|
458
|
-
return void 0;
|
|
410
|
+
return halted(DECISION_STOP_REASON);
|
|
459
411
|
}
|
|
460
|
-
|
|
412
|
+
if (isDecisionStopped(result)) return halted(DECISION_STOP_REASON);
|
|
413
|
+
const answer = await waitForQuestion(apiKey, result, storedWaitDeadline(result, deadline));
|
|
414
|
+
if (isDecisionStopped(answer)) return halted(DECISION_STOP_REASON);
|
|
461
415
|
const value = answer.answered ? (answer.value ?? "").trim() : "";
|
|
462
416
|
if (!value || isDeferAnswer(answer.value)) {
|
|
463
|
-
savePendingQuestion(input.session_id || DEFAULT_SESSION, result.correlationId, input.tool_use_id);
|
|
464
417
|
return void 0;
|
|
465
418
|
}
|
|
466
419
|
if (value === PLAN_APPROVE) return allow();
|
|
@@ -545,10 +498,7 @@ var toPermissionRequestOutput = (hookOutput) => {
|
|
|
545
498
|
return void 0;
|
|
546
499
|
};
|
|
547
500
|
var handlePermissionRequest = async (input) => {
|
|
548
|
-
if (
|
|
549
|
-
const reclaimDeferredExec = !PRETOOLUSE_PHONE_ANSWERED_TOOLS.includes(input.tool_name) && shouldDeferToNativeMode(input.permission_mode, input.tool_name);
|
|
550
|
-
if (!reclaimDeferredExec) return void 0;
|
|
551
|
-
}
|
|
501
|
+
if (isPermissionRequestOwnedByPreToolUse(input.tool_name, input.permission_mode, shouldDeferToNativeMode)) return void 0;
|
|
552
502
|
if (isPusharyOwnTool(input.tool_name)) return void 0;
|
|
553
503
|
let apiKey;
|
|
554
504
|
try {
|
|
@@ -640,13 +590,8 @@ var handlePermissionDenied = async (input) => {
|
|
|
640
590
|
} catch {
|
|
641
591
|
return void 0;
|
|
642
592
|
}
|
|
643
|
-
if (handedToTerminal(result)) {
|
|
644
|
-
await cancelQuestion(apiKey, result.correlationId).catch(() => {
|
|
645
|
-
});
|
|
646
|
-
return void 0;
|
|
647
|
-
}
|
|
648
593
|
const deadline = hookWaitDeadline(START_MS, PERMISSION_DENIED_WAIT_SECONDS, "claude", Date.now());
|
|
649
|
-
const answer = await
|
|
594
|
+
const answer = await waitForQuestion(apiKey, result, deadline);
|
|
650
595
|
if (answer.answered && answer.value === "yes") {
|
|
651
596
|
return { hookSpecificOutput: { hookEventName: "PermissionDenied", retry: true } };
|
|
652
597
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openCodeConfigDirFrom
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HQIVR7MM.js";
|
|
4
4
|
import {
|
|
5
5
|
codexHomeFrom
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OW6AZDY2.js";
|
|
7
7
|
|
|
8
8
|
// src/vscode-config.ts
|
|
9
9
|
import { homedir } from "os";
|
|
@@ -327,9 +327,6 @@ var hasInstructionBlock = (filePath) => {
|
|
|
327
327
|
}
|
|
328
328
|
};
|
|
329
329
|
|
|
330
|
-
// src/hooks-spec.ts
|
|
331
|
-
var CURSOR_GATE_SCRIPT = "pushary-gate.mjs";
|
|
332
|
-
|
|
333
330
|
export {
|
|
334
331
|
registerPluginLocation,
|
|
335
332
|
unregisterPluginLocation,
|
|
@@ -346,6 +343,5 @@ export {
|
|
|
346
343
|
renderProjectAgentInstructions,
|
|
347
344
|
writeInstructionBlock,
|
|
348
345
|
removeInstructionBlock,
|
|
349
|
-
hasInstructionBlock
|
|
350
|
-
CURSOR_GATE_SCRIPT
|
|
346
|
+
hasInstructionBlock
|
|
351
347
|
};
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
FILE_TARGET_TOOLS,
|
|
6
6
|
redactSecrets,
|
|
7
7
|
redactSecretsDeep
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WDKHZRAS.js";
|
|
9
9
|
|
|
10
10
|
// ../hook-mapping/src/describe.ts
|
|
11
11
|
import { isAbsolute, relative, resolve } from "path";
|
|
@@ -382,7 +382,7 @@ var permissionDeniedAction = (toolName) => {
|
|
|
382
382
|
return tool ? `Auto-mode blocked ${tool}` : "Auto-mode blocked a tool call";
|
|
383
383
|
};
|
|
384
384
|
var sessionIdentityOf = (payload) => {
|
|
385
|
-
const sessionId = asString(payload.session_id);
|
|
385
|
+
const sessionId = asString(payload.session_id ?? payload.sessionId ?? payload.conversation_id);
|
|
386
386
|
const agentId = asString(payload.agent_id);
|
|
387
387
|
if (!agentId) return { sessionId };
|
|
388
388
|
return { sessionId: agentId, parentSessionId: sessionId };
|
|
@@ -60,7 +60,7 @@ var COMMAND_LIST = [
|
|
|
60
60
|
{ name: "doctor", module: "pushary-doctor", summary: "Verify your Pushary installation is working" },
|
|
61
61
|
{ name: "disconnect", module: "pushary-disconnect", summary: "Turn off one agent (claude|codex|gemini|cursor)" },
|
|
62
62
|
{ name: "clean", module: "pushary-clean", summary: "Remove all Pushary configuration (--yes for non-interactive)" },
|
|
63
|
-
{ name: "mode", module: "pushary-mode", summary: "
|
|
63
|
+
{ name: "mode", module: "pushary-mode", summary: "Choose where approval requests appear" },
|
|
64
64
|
{ name: "wait", module: "pushary-wait", summary: 'Show or set the "wait for your phone" ladder (pushary wait 45)' },
|
|
65
65
|
{ name: "stats", module: "pushary-stats", summary: "Show the approval moments your agents hit while not connected" },
|
|
66
66
|
{
|
|
@@ -2,15 +2,15 @@ import {
|
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
GEMINI_HOOK_EVENTS,
|
|
4
4
|
hasGeminiHooks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2D7BAOMY.js";
|
|
6
6
|
import {
|
|
7
7
|
CODEX_HOOK_EVENTS,
|
|
8
8
|
hasCodexHooks
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OW6AZDY2.js";
|
|
10
10
|
import {
|
|
11
11
|
CURSOR_GATE_EVENTS,
|
|
12
12
|
HOOK_LOCATOR_BINARY
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WDKHZRAS.js";
|
|
14
14
|
|
|
15
15
|
// src/diagnostics/wiring.ts
|
|
16
16
|
var record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : null;
|