@pushary/agent-hooks 1.9.157 → 1.9.161
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 +28 -0
- package/README.md +1 -0
- package/dist/{api-3C62HQDC.js → api-WHTSBK74.js} +15 -13
- package/dist/bin/pushary-audit.js +7 -7
- package/dist/bin/pushary-bell-hook.js +31 -31
- package/dist/bin/pushary-bell.js +16 -16
- package/dist/bin/pushary-calls.d.ts +1 -0
- package/dist/bin/pushary-calls.js +287 -0
- package/dist/bin/pushary-claude.js +37 -37
- package/dist/bin/pushary-clean.js +47 -45
- package/dist/bin/pushary-codex-bridge.js +27 -27
- package/dist/bin/pushary-codex-hook.js +61 -51
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +19 -19
- package/dist/bin/pushary-connect.js +41 -40
- package/dist/bin/pushary-cowork.js +6 -6
- package/dist/bin/pushary-daemon.js +52 -51
- package/dist/bin/pushary-disconnect.js +39 -37
- package/dist/bin/pushary-display-hook.js +20 -1
- package/dist/bin/pushary-doctor.js +61 -59
- package/dist/bin/pushary-elicitation-hook.js +32 -32
- package/dist/bin/pushary-gemini-bridge.js +19 -19
- package/dist/bin/pushary-gemini-hook.js +36 -36
- package/dist/bin/pushary-hook.js +39 -38
- package/dist/bin/pushary-login.js +28 -28
- package/dist/bin/pushary-logout.js +34 -33
- package/dist/bin/pushary-mcp.js +15 -15
- package/dist/bin/pushary-mode.js +21 -21
- package/dist/bin/pushary-notification-hook.js +30 -30
- package/dist/bin/pushary-opencode-hook.js +399 -45
- package/dist/bin/pushary-permission-denied-hook.js +39 -38
- package/dist/bin/pushary-permission-hook.js +39 -38
- package/dist/bin/pushary-post-hook.js +31 -31
- package/dist/bin/pushary-prompt-hook.js +30 -30
- package/dist/bin/pushary-session-end-hook.js +30 -30
- package/dist/bin/pushary-session-start-hook.js +41 -40
- package/dist/bin/pushary-setup.js +73 -72
- package/dist/bin/pushary-stats.js +6 -6
- package/dist/bin/pushary-status.js +40 -39
- package/dist/bin/pushary-stop-hook.js +30 -30
- package/dist/bin/pushary-stopfailure-hook.js +30 -30
- package/dist/bin/pushary-suggestions.js +21 -21
- package/dist/bin/pushary-transcript-register.js +21 -21
- package/dist/bin/pushary-transcripts.js +32 -32
- package/dist/bin/pushary-upgrade.js +50 -49
- package/dist/bin/pushary-wait.js +23 -23
- package/dist/bin/pushary.js +10 -9
- package/dist/{chunk-2SHPCEH6.js → chunk-26GVUJMR.js} +5 -2
- package/dist/{chunk-UAYNQ2IG.js → chunk-2ABUBECK.js} +6 -6
- package/dist/{chunk-6NRFAP45.js → chunk-2PY5DJTC.js} +1 -1
- package/dist/{chunk-RF7HGOBC.js → chunk-3F6HE5AK.js} +3 -3
- package/dist/{chunk-5MWNWCCI.js → chunk-4ZNZS6FM.js} +8 -5
- package/dist/{chunk-KB7YWU7A.js → chunk-55AHQF63.js} +110 -0
- package/dist/{chunk-3XTH6EKH.js → chunk-5S66DHJS.js} +3 -3
- package/dist/{chunk-CHI57HS3.js → chunk-5UBV26GO.js} +3 -3
- package/dist/{chunk-V4OIPLSC.js → chunk-6NWESDKK.js} +4 -4
- package/dist/{chunk-RF35YTIF.js → chunk-6OSE2IRG.js} +2 -2
- package/dist/{chunk-G6SQOGSD.js → chunk-7AQTKVA6.js} +12 -7
- package/dist/{chunk-ANL74IBU.js → chunk-7IHVTLHK.js} +1 -1
- package/dist/{chunk-3EF7G5EV.js → chunk-7VXHWU7A.js} +4 -4
- package/dist/{chunk-MH4O453X.js → chunk-7WLKE7QN.js} +4 -3
- package/dist/{chunk-3UYTCDDY.js → chunk-ANYLSZN3.js} +24 -9
- package/dist/{chunk-GA5T3WEB.js → chunk-AT5ZLKMQ.js} +5 -5
- package/dist/{chunk-HXX4EFK3.js → chunk-ATI5XO3E.js} +4 -4
- package/dist/{chunk-TIOQ55VZ.js → chunk-AVGYUZVK.js} +6 -6
- package/dist/{chunk-6UGVZTRA.js → chunk-AVRRD6AY.js} +1 -1
- package/dist/{chunk-WCVANKUD.js → chunk-BGU56XCS.js} +1 -1
- package/dist/{chunk-DDSMTD4W.js → chunk-BTYHDCAP.js} +3 -3
- package/dist/{chunk-IQWMRFKD.js → chunk-DHUWAUVL.js} +1 -1
- package/dist/{chunk-W2GOSAFI.js → chunk-DHX5JZSH.js} +4 -4
- package/dist/{chunk-KOBIBSE6.js → chunk-DLZ6RK2P.js} +3 -3
- package/dist/{chunk-TWOSBIAW.js → chunk-DWMQZM52.js} +1 -1
- package/dist/{chunk-WDU4LEEW.js → chunk-E7K6YCWY.js} +6 -6
- package/dist/{chunk-7JAEIKBV.js → chunk-EGEZKJHX.js} +5 -5
- package/dist/{chunk-VRLYEBDN.js → chunk-F5NJUDGA.js} +78 -50
- package/dist/{chunk-ELF4NIIM.js → chunk-FZCEPG6J.js} +2 -2
- package/dist/{chunk-KURQ4KMV.js → chunk-G44FOBHN.js} +4 -4
- package/dist/{chunk-S6DJAYQW.js → chunk-GJA3KQ3T.js} +5 -5
- package/dist/{chunk-WIOLCW7W.js → chunk-GNHXDRO6.js} +1 -1
- package/dist/{chunk-C3HYWUZE.js → chunk-HHNC6FWO.js} +1 -1
- package/dist/{chunk-E2KAAKWU.js → chunk-HKCJZGAJ.js} +6 -6
- package/dist/{chunk-7HDQUTRK.js → chunk-HKI4RMZF.js} +8 -7
- package/dist/{chunk-C4K4KYOY.js → chunk-I5HXAELM.js} +5 -5
- package/dist/{chunk-MGT2V2AB.js → chunk-IGSSDODQ.js} +2 -2
- package/dist/{chunk-ICHKAH5Q.js → chunk-IHYKSPWH.js} +85 -8
- package/dist/chunk-J36DDPJV.js +18 -0
- package/dist/{chunk-QONYKXWP.js → chunk-KDHLOPSO.js} +1 -1
- package/dist/{chunk-O3NAHPCR.js → chunk-KKDKPWGM.js} +1 -1
- package/dist/{chunk-REUFDG7O.js → chunk-L2ADRR62.js} +5 -5
- package/dist/{chunk-F6ZBXV4G.js → chunk-LRTRIDOC.js} +1 -1
- package/dist/{chunk-4I4HAPT5.js → chunk-LVGRSC44.js} +5 -5
- package/dist/{chunk-UH5NAPWL.js → chunk-MGOBIHXH.js} +10 -10
- package/dist/{chunk-CV6G4IDZ.js → chunk-MPYQW4IV.js} +2 -2
- package/dist/{chunk-QBDCKECQ.js → chunk-N4OKAE65.js} +120 -32
- package/dist/{chunk-EQF6SSQL.js → chunk-ONMAG5BF.js} +2 -2
- package/dist/{chunk-CAZ5FMWP.js → chunk-OOODAKCC.js} +6 -6
- package/dist/chunk-OQAIMSHQ.js +885 -0
- package/dist/{chunk-MOX7IOGL.js → chunk-OSCZ4MNE.js} +7 -7
- package/dist/{chunk-6W6MZ53D.js → chunk-OXZ75E2Y.js} +4 -4
- package/dist/{chunk-O2DJWDVK.js → chunk-OZK75SFS.js} +11 -9
- package/dist/{chunk-WSPDIT2B.js → chunk-PXLWR4TG.js} +2 -2
- package/dist/{chunk-UJJ2OXFA.js → chunk-QLEFFGCN.js} +1 -1
- package/dist/{chunk-T3LSBTWU.js → chunk-R7NAG65X.js} +4 -4
- package/dist/{chunk-WDCS3RGI.js → chunk-R7RN3Z2T.js} +2 -2
- package/dist/{chunk-P5JV6YZW.js → chunk-RZBCXPOV.js} +14 -3
- package/dist/{chunk-JBF6A2X5.js → chunk-S6ARXVVZ.js} +1 -1
- package/dist/{chunk-R4DMHIOK.js → chunk-TYB2QGJD.js} +6 -6
- package/dist/{chunk-C74JHUD3.js → chunk-U36COV3Z.js} +11 -11
- package/dist/{chunk-PKU3WFT5.js → chunk-U3FVVMB3.js} +1 -1
- package/dist/{chunk-3FQJYA76.js → chunk-UH7GJHOO.js} +3 -3
- package/dist/chunk-UJT32RSQ.js +242 -0
- package/dist/{chunk-WIIMW5YO.js → chunk-UQTQ6HPO.js} +2 -0
- package/dist/{chunk-WWDWEVGT.js → chunk-UZTGEACF.js} +5 -5
- package/dist/{chunk-4RSJZOKB.js → chunk-VIS3EVRH.js} +1 -1
- package/dist/{chunk-5HMVXNFU.js → chunk-VYNC7EYV.js} +2 -2
- package/dist/{chunk-MEUAK5BK.js → chunk-W6FCSBTM.js} +2 -2
- package/dist/{chunk-PMEDJ4WM.js → chunk-WAFJGQSE.js} +39 -8
- package/dist/{chunk-25PVMWSM.js → chunk-WCXVPYSD.js} +1 -1
- package/dist/{chunk-5TCLBCUO.js → chunk-WNIDBPT2.js} +8 -8
- package/dist/{chunk-2NSPZZBJ.js → chunk-WTWBHE2Y.js} +42 -34
- package/dist/{chunk-UOVTXOSS.js → chunk-XWCLKWKP.js} +1 -1
- package/dist/{chunk-2LTRA6NA.js → chunk-Y23YO46U.js} +3 -3
- package/dist/{chunk-2N23JFER.js → chunk-Y553AEQU.js} +3 -3
- package/dist/{chunk-H6CL3T2S.js → chunk-Y6ILCLKE.js} +1 -1
- package/dist/{chunk-AKUYCHJU.js → chunk-YD45WNVQ.js} +1 -1
- package/dist/{chunk-44FDCO7M.js → chunk-YEB7YWW7.js} +13 -13
- package/dist/{chunk-BMR66K6T.js → chunk-YGHHDDIM.js} +4 -4
- package/dist/{chunk-KRI7BOND.js → chunk-Z5DOTAFI.js} +3 -3
- package/dist/{chunk-XHPTW6WL.js → chunk-ZIKSHD5M.js} +5 -3
- package/dist/{codex-app-cards-switch-MQIEZLSU.js → codex-app-cards-switch-DPCGWQSX.js} +14 -14
- package/dist/{codex-card-routing-UTWTJ6YQ.js → codex-card-routing-NFIEH66Q.js} +2 -2
- package/dist/{codex-desktop-launch-A6GX6F54.js → codex-desktop-launch-MARNBY23.js} +1 -1
- package/dist/{codex-session-launch-AVEFGOT7.js → codex-session-launch-LSNU7CUV.js} +23 -23
- package/dist/{config-YGUXX5GB.js → config-5D34OAYM.js} +4 -4
- package/dist/{global-upgrade-HLXPTFDU.js → global-upgrade-5XBO6FYU.js} +11 -11
- package/dist/{identity-CAC763RQ.js → identity-6QEFK7PW.js} +5 -5
- package/dist/{live-capabilities-WRI22INV.js → live-capabilities-6KOGY6KM.js} +5 -5
- package/dist/{paths-DNXBDJJH.js → paths-7M6V62NO.js} +4 -4
- package/dist/reapply-ZECM5JRX.js +69 -0
- package/dist/src/index.d.ts +6 -1
- package/dist/src/index.js +39 -38
- package/dist/{upgrade-lock-CRW26OIW.js → upgrade-lock-DI4JY2CU.js} +5 -5
- package/dist/usage-X4BIHYR5.js +11 -0
- package/package.json +2 -1
- package/dist/chunk-BO4HRAY7.js +0 -593
- package/dist/reapply-5ZNMLEKV.js +0 -68
- package/dist/usage-AWWCZ7H7.js +0 -11
|
@@ -8,21 +8,21 @@ import {
|
|
|
8
8
|
SubscriptionRequiredError,
|
|
9
9
|
callMcpTool,
|
|
10
10
|
isRetryable
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OSCZ4MNE.js";
|
|
12
|
+
import {
|
|
13
|
+
fetchAsCredential
|
|
14
|
+
} from "./chunk-DWMQZM52.js";
|
|
12
15
|
import {
|
|
13
16
|
installNetworkDefaults,
|
|
14
17
|
isNetworkFailure
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
fetchAsCredential
|
|
18
|
-
} from "./chunk-TWOSBIAW.js";
|
|
18
|
+
} from "./chunk-HKCJZGAJ.js";
|
|
19
19
|
import {
|
|
20
20
|
clientReportClaims
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-7WLKE7QN.js";
|
|
22
22
|
import {
|
|
23
23
|
getApiKey,
|
|
24
24
|
getBaseUrl
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-7IHVTLHK.js";
|
|
26
26
|
import {
|
|
27
27
|
ASK_AGENT_NAME_MAX,
|
|
28
28
|
CLIENT_REPORT_PATH,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
degradedLine,
|
|
33
33
|
isDecisionStoppedReply,
|
|
34
34
|
truncateLine
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-55AHQF63.js";
|
|
36
36
|
|
|
37
37
|
// src/api.ts
|
|
38
38
|
import { randomUUID } from "crypto";
|
|
@@ -69,6 +69,47 @@ var isBlockedActionClaim = (data) => {
|
|
|
69
69
|
return typeof data.granted === "boolean";
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
+
// src/open-question-wait.ts
|
|
73
|
+
var OPEN_QUESTION_LIVE_WINDOW_MS = 10 * 6e4;
|
|
74
|
+
var OPEN_QUESTION_LIVE_POLL = { holdMs: 3e4, pauseMs: 2e3 };
|
|
75
|
+
var OPEN_QUESTION_IDLE_POLL = { holdMs: 1e3, pauseMs: 3e4 };
|
|
76
|
+
var MAX_FAILURE_PAUSE_MS = 15e3;
|
|
77
|
+
var PENDING_STATUS = "pending";
|
|
78
|
+
var UNAVAILABLE_STATUS = "unavailable";
|
|
79
|
+
var PERSON_STOPPED_STATUS = "stopped";
|
|
80
|
+
var openQuestionPollAt = (elapsedMs) => elapsedMs < OPEN_QUESTION_LIVE_WINDOW_MS ? OPEN_QUESTION_LIVE_POLL : OPEN_QUESTION_IDLE_POLL;
|
|
81
|
+
var openQuestionFailurePauseMs = (failures, poll) => Math.max(poll.pauseMs, Math.min(poll.pauseMs * 2 ** Math.max(0, failures - 1), MAX_FAILURE_PAUSE_MS));
|
|
82
|
+
var isThePersonsStop = (reply) => reply.status === PERSON_STOPPED_STATUS;
|
|
83
|
+
var isPending = (reply) => reply.status === void 0 || reply.status === PENDING_STATUS;
|
|
84
|
+
var isUnavailable = (reply) => reply.status === UNAVAILABLE_STATUS;
|
|
85
|
+
var askingProcessWaits = (asker, currentParent, isGone) => currentParent === asker && !isGone(asker);
|
|
86
|
+
var waitWhileTheQuestionIsOpen = async (effects) => {
|
|
87
|
+
const startedAt = effects.now();
|
|
88
|
+
let failures = 0;
|
|
89
|
+
while (effects.askerStillWaits()) {
|
|
90
|
+
const poll = openQuestionPollAt(effects.now() - startedAt);
|
|
91
|
+
let reply;
|
|
92
|
+
try {
|
|
93
|
+
reply = await effects.poll(poll.holdMs);
|
|
94
|
+
} catch (error) {
|
|
95
|
+
if (!effects.isTransientFailure(error)) return { kind: "abandoned" };
|
|
96
|
+
failures += 1;
|
|
97
|
+
await effects.sleep(openQuestionFailurePauseMs(failures, poll));
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (reply.answered || isThePersonsStop(reply)) return { kind: "replied", reply };
|
|
101
|
+
if (isUnavailable(reply)) {
|
|
102
|
+
failures += 1;
|
|
103
|
+
await effects.sleep(openQuestionFailurePauseMs(failures, poll));
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
failures = 0;
|
|
107
|
+
if (!isPending(reply)) return { kind: "closed" };
|
|
108
|
+
await effects.sleep(poll.pauseMs);
|
|
109
|
+
}
|
|
110
|
+
return { kind: "abandoned" };
|
|
111
|
+
};
|
|
112
|
+
|
|
72
113
|
// src/client-report-claim.ts
|
|
73
114
|
import { createHash } from "crypto";
|
|
74
115
|
import { closeSync, mkdirSync, openSync, readdirSync, unlinkSync } from "fs";
|
|
@@ -326,6 +367,39 @@ var waitForQuestion = async (apiKey, question, deadlineMs, pollInterval = 2e3, s
|
|
|
326
367
|
if (question.status === "expired") return STOPPED;
|
|
327
368
|
return isAwayPaused(question) || isLocalQuestionHandoff(question) ? withdrawQuestion(apiKey, question.correlationId) : pollForAnswer(apiKey, question.correlationId, deadlineMs, pollInterval, signal);
|
|
328
369
|
};
|
|
370
|
+
var OPEN_QUESTION_CLOSED = { answered: false, status: "withdrawn" };
|
|
371
|
+
var OPEN_QUESTION_LATE_ANSWER_HOLD_MS = 1e3;
|
|
372
|
+
var answerThatWonTheCancel = async (apiKey, correlationId) => {
|
|
373
|
+
const late = await waitForAnswer(apiKey, correlationId, OPEN_QUESTION_LATE_ANSWER_HOLD_MS, AbortSignal.timeout(2e3));
|
|
374
|
+
return late.answered ? late : OPEN_QUESTION_CLOSED;
|
|
375
|
+
};
|
|
376
|
+
var withdrawOpenQuestion = async (apiKey, correlationId) => {
|
|
377
|
+
try {
|
|
378
|
+
const cancelled = await cancelQuestion(apiKey, correlationId, AbortSignal.timeout(4e3));
|
|
379
|
+
return cancelled.cancelled === true ? OPEN_QUESTION_CLOSED : await answerThatWonTheCancel(apiKey, correlationId);
|
|
380
|
+
} catch {
|
|
381
|
+
return OPEN_QUESTION_CLOSED;
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
var waitForOpenQuestion = async (apiKey, question, askerStillWaits) => {
|
|
385
|
+
if (question.answered || isThePersonsStop(question)) return { ...question, answered: !!question.answered };
|
|
386
|
+
if (isAwayPaused(question) || isLocalQuestionHandoff(question)) return withdrawOpenQuestion(apiKey, question.correlationId);
|
|
387
|
+
const ending = await waitWhileTheQuestionIsOpen({
|
|
388
|
+
now: Date.now,
|
|
389
|
+
sleep: (ms) => sleepUnlessAborted(ms),
|
|
390
|
+
poll: (holdMs) => waitForAnswer(apiKey, question.correlationId, holdMs),
|
|
391
|
+
askerStillWaits,
|
|
392
|
+
isTransientFailure: isTransientWaitFailure
|
|
393
|
+
});
|
|
394
|
+
switch (ending.kind) {
|
|
395
|
+
case "replied":
|
|
396
|
+
return ending.reply;
|
|
397
|
+
case "closed":
|
|
398
|
+
return OPEN_QUESTION_CLOSED;
|
|
399
|
+
case "abandoned":
|
|
400
|
+
return withdrawOpenQuestion(apiKey, question.correlationId);
|
|
401
|
+
}
|
|
402
|
+
};
|
|
329
403
|
var sendNotification = async (apiKey, params, timeoutMs = 15e3, signal) => {
|
|
330
404
|
await callMcpTool(apiKey, "send_notification", { ...params }, { maxRetries: signal ? 1 : 3, timeoutMs, signal });
|
|
331
405
|
};
|
|
@@ -368,6 +442,8 @@ export {
|
|
|
368
442
|
isPolicyConfig,
|
|
369
443
|
isAskUserResponse,
|
|
370
444
|
isWaitForAnswerResponse,
|
|
445
|
+
isThePersonsStop,
|
|
446
|
+
askingProcessWaits,
|
|
371
447
|
isDecisionStopped,
|
|
372
448
|
isAwayPaused,
|
|
373
449
|
isLocalQuestionHandoff,
|
|
@@ -385,6 +461,7 @@ export {
|
|
|
385
461
|
cancelQuestion,
|
|
386
462
|
withdrawQuestion,
|
|
387
463
|
waitForQuestion,
|
|
464
|
+
waitForOpenQuestion,
|
|
388
465
|
sendNotification,
|
|
389
466
|
requestGate,
|
|
390
467
|
claimBlockedAction
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
shouldDeferToNativeMode
|
|
3
|
+
} from "./chunk-55AHQF63.js";
|
|
4
|
+
|
|
5
|
+
// src/native-defer.ts
|
|
6
|
+
var nativeDeferOptions = () => {
|
|
7
|
+
const respect = process.env.PUSHARY_RESPECT_PERMISSION_MODE;
|
|
8
|
+
const bypass = process.env.PUSHARY_DEFER_BYPASS;
|
|
9
|
+
return {
|
|
10
|
+
respectPermissionMode: !(respect === "0" || respect === "false"),
|
|
11
|
+
deferBypass: bypass === "1" || bypass === "true"
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
var defersToNativeMode = (permissionMode, toolName) => shouldDeferToNativeMode(permissionMode, toolName, nativeDeferOptions());
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
defersToNativeMode
|
|
18
|
+
};
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
} from "./chunk-OYIN77HO.js";
|
|
6
6
|
import {
|
|
7
7
|
readMacAppAgentKey
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OXZ75E2Y.js";
|
|
9
9
|
import {
|
|
10
10
|
API_KEYS_PATH
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ONMAG5BF.js";
|
|
12
12
|
import {
|
|
13
13
|
absoluteUrl
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-I5HXAELM.js";
|
|
15
15
|
import {
|
|
16
16
|
findExportedKeyLines,
|
|
17
17
|
isAdoptedMacAppKey,
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
readConfigFileKey,
|
|
22
22
|
readKeySource,
|
|
23
23
|
readMacAppKeyPrefix
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-Y23YO46U.js";
|
|
25
25
|
import {
|
|
26
26
|
isValidApiKey
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-55AHQF63.js";
|
|
28
28
|
|
|
29
29
|
// src/cli/held-key-revocation.ts
|
|
30
30
|
var readCliHeldKeys = (profiles) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addGeminiMcpServer,
|
|
3
3
|
removeGeminiMcpServer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YGHHDDIM.js";
|
|
5
5
|
import {
|
|
6
6
|
CLAUDE_CODE_AGENT
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-N4OKAE65.js";
|
|
8
8
|
import {
|
|
9
9
|
compatibleToolLookup
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-26GVUJMR.js";
|
|
11
11
|
import {
|
|
12
12
|
CLAUDE_HOOK_EVENTS,
|
|
13
13
|
PUSHARY_MCP_URL,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
isPusharyHook,
|
|
20
20
|
registerHookEntry,
|
|
21
21
|
removeClaudeMcpServers
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-7WLKE7QN.js";
|
|
23
23
|
import {
|
|
24
24
|
HOOK_COMPATIBLE_PROFILES,
|
|
25
25
|
PHONE_ANSWERED_TOOLS,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
pusharyMissingReason,
|
|
31
31
|
refusalOutput,
|
|
32
32
|
withHookHoldBudget
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-55AHQF63.js";
|
|
34
34
|
|
|
35
35
|
// src/config-document.ts
|
|
36
36
|
import { parse, stringify } from "smol-toml";
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-WHB622LP.js";
|
|
4
4
|
import {
|
|
5
5
|
ensureDaemonRunning
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WNIDBPT2.js";
|
|
7
7
|
import {
|
|
8
8
|
hookOwnerOf
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YGHHDDIM.js";
|
|
10
10
|
import {
|
|
11
11
|
hookMeaning
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-26GVUJMR.js";
|
|
13
13
|
import {
|
|
14
14
|
buildTranscriptRecords,
|
|
15
15
|
changedRecipientsMessage,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
uploadTranscriptRecords,
|
|
25
25
|
verifyAnchoredRecipients,
|
|
26
26
|
wrapSessionKey
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-5UBV26GO.js";
|
|
28
28
|
import {
|
|
29
29
|
external_exports,
|
|
30
30
|
ownedOnlyByThisUser,
|
|
@@ -33,22 +33,22 @@ import {
|
|
|
33
33
|
import {
|
|
34
34
|
transcriptEnvironmentPreference,
|
|
35
35
|
transcriptsEnabled
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-YD45WNVQ.js";
|
|
37
37
|
import {
|
|
38
38
|
fetchAsCredential
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-DWMQZM52.js";
|
|
40
40
|
import {
|
|
41
41
|
readTranscriptPreference
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-Y23YO46U.js";
|
|
43
43
|
import {
|
|
44
44
|
claudeConfigDir,
|
|
45
45
|
codexHome,
|
|
46
46
|
pusharyDir
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-7WLKE7QN.js";
|
|
48
48
|
import {
|
|
49
49
|
getApiKey,
|
|
50
50
|
getBaseUrl
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-7IHVTLHK.js";
|
|
52
52
|
import {
|
|
53
53
|
writeJsonAtomic,
|
|
54
54
|
writeJsonAtomicDurable
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
isHookSource,
|
|
61
61
|
isRecord,
|
|
62
62
|
redactSecretsFromContent
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-55AHQF63.js";
|
|
64
64
|
|
|
65
65
|
// src/transcript-registration.ts
|
|
66
66
|
import { createHash as createHash4 } from "crypto";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7WLKE7QN.js";
|
|
4
4
|
import {
|
|
5
5
|
readJsonSafe
|
|
6
6
|
} from "./chunk-TODDEIYG.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-55AHQF63.js";
|
|
10
10
|
|
|
11
11
|
// src/process-ownership.ts
|
|
12
12
|
import { createHash, randomUUID } from "crypto";
|
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
toolResultErrorText,
|
|
28
28
|
transcriptTokensIn,
|
|
29
29
|
transcriptUsageRequest
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-26GVUJMR.js";
|
|
31
31
|
import {
|
|
32
32
|
branchFor,
|
|
33
33
|
repoKeyFor
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-QLEFFGCN.js";
|
|
35
35
|
import {
|
|
36
36
|
cancelQuestion,
|
|
37
37
|
clientErrorKindOf,
|
|
@@ -39,39 +39,39 @@ import {
|
|
|
39
39
|
reportClientError,
|
|
40
40
|
sendNotification,
|
|
41
41
|
waitForAnswer
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import {
|
|
44
|
-
isRetryable,
|
|
45
|
-
withRetry
|
|
46
|
-
} from "./chunk-MOX7IOGL.js";
|
|
42
|
+
} from "./chunk-IHYKSPWH.js";
|
|
47
43
|
import {
|
|
48
44
|
RETRY_ACK,
|
|
49
45
|
readCommandAck,
|
|
50
46
|
refusedReceiptMessage
|
|
51
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-KDHLOPSO.js";
|
|
48
|
+
import {
|
|
49
|
+
isRetryable,
|
|
50
|
+
withRetry
|
|
51
|
+
} from "./chunk-OSCZ4MNE.js";
|
|
52
52
|
import {
|
|
53
53
|
fetchAsCredential
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-DWMQZM52.js";
|
|
55
55
|
import {
|
|
56
56
|
getMachineId
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-VIS3EVRH.js";
|
|
58
58
|
import {
|
|
59
59
|
reportedInstallSource
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-FZCEPG6J.js";
|
|
61
61
|
import {
|
|
62
62
|
IDLE_PROMPT_NOTIFICATION,
|
|
63
63
|
NOTIFICATION_PUSH_TYPES,
|
|
64
64
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS,
|
|
65
65
|
claudeConfigDir
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-7WLKE7QN.js";
|
|
67
67
|
import {
|
|
68
68
|
compareVersion,
|
|
69
69
|
parseVersion
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-WAFJGQSE.js";
|
|
71
71
|
import {
|
|
72
72
|
getApiKey,
|
|
73
73
|
getBaseUrl
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-7IHVTLHK.js";
|
|
75
75
|
import {
|
|
76
76
|
writeFileAtomic,
|
|
77
77
|
writeJsonAtomicDurable
|
|
@@ -89,10 +89,12 @@ import {
|
|
|
89
89
|
gateOutputFor,
|
|
90
90
|
isAutoApprove,
|
|
91
91
|
isClaudeWakePrompt,
|
|
92
|
+
isGateOutcome,
|
|
92
93
|
isProvenModeResponse,
|
|
93
94
|
isRecord,
|
|
94
95
|
modeStateFromResponse,
|
|
95
96
|
nativeRecord,
|
|
97
|
+
parsePermissionMode,
|
|
96
98
|
pendingCommandEvents,
|
|
97
99
|
pendingCommandInstruction,
|
|
98
100
|
policyRequestCapabilitiesHeaderValue,
|
|
@@ -100,7 +102,7 @@ import {
|
|
|
100
102
|
resolveAutoResolveOrigin,
|
|
101
103
|
resolvePolicy,
|
|
102
104
|
unansweredRefusalReason
|
|
103
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-55AHQF63.js";
|
|
104
106
|
|
|
105
107
|
// src/pending.ts
|
|
106
108
|
import { join } from "path";
|
|
@@ -1169,21 +1171,87 @@ var isWaitingOnBackgroundWork = (sessionKey, nowMs = Date.now()) => {
|
|
|
1169
1171
|
}
|
|
1170
1172
|
};
|
|
1171
1173
|
|
|
1172
|
-
// src/
|
|
1173
|
-
import {
|
|
1174
|
-
import {
|
|
1174
|
+
// src/gate-outcome-record.ts
|
|
1175
|
+
import { createHash as createHash7 } from "crypto";
|
|
1176
|
+
import { lstatSync as lstatSync4, readFileSync as readFileSync7, readdirSync as readdirSync6, utimesSync as utimesSync3, writeFileSync as writeFileSync7 } from "fs";
|
|
1175
1177
|
import { tmpdir as tmpdir8 } from "os";
|
|
1176
|
-
|
|
1178
|
+
import { join as join9 } from "path";
|
|
1179
|
+
var GATE_OUTCOME_RECORD_TTL_MS = 60 * 60 * 1e3;
|
|
1180
|
+
var GATE_OUTCOME_RECORD_LIMIT = 512;
|
|
1181
|
+
var GATE_OUTCOME_SWEEP_INTERVAL_MS = 10 * 60 * 1e3;
|
|
1182
|
+
var GATE_OUTCOME_SWEEP_STAMP = ".swept";
|
|
1183
|
+
var gateOutcomeDirectory = () => join9(tmpdir8(), `pushary-gate-outcomes-${userScope()}`);
|
|
1184
|
+
var gateOutcomeRecordName = (toolUseId) => createHash7("sha256").update(toolUseId, "utf-8").digest("hex").slice(0, 32);
|
|
1185
|
+
var startedSweepStamp = (stamp) => {
|
|
1186
|
+
try {
|
|
1187
|
+
writeFileSync7(stamp, "", { flag: "wx", mode: PRIVATE_FILE_MODE });
|
|
1188
|
+
return true;
|
|
1189
|
+
} catch {
|
|
1190
|
+
return false;
|
|
1191
|
+
}
|
|
1192
|
+
};
|
|
1193
|
+
var claimedSweep = (stamp, nowMs) => {
|
|
1194
|
+
try {
|
|
1195
|
+
const stamped = lstatSync4(stamp);
|
|
1196
|
+
if (!stamped.isFile() || nowMs - stamped.mtimeMs < GATE_OUTCOME_SWEEP_INTERVAL_MS) return false;
|
|
1197
|
+
utimesSync3(stamp, nowMs / 1e3, nowMs / 1e3);
|
|
1198
|
+
return true;
|
|
1199
|
+
} catch {
|
|
1200
|
+
return startedSweepStamp(stamp);
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
var sweepWhenDue = (dir, nowMs) => {
|
|
1204
|
+
if (claimedSweep(join9(dir, GATE_OUTCOME_SWEEP_STAMP), nowMs)) sweepExpired(dir, nowMs, GATE_OUTCOME_RECORD_TTL_MS);
|
|
1205
|
+
};
|
|
1206
|
+
var hasRoomForARecord = (dir) => readdirSync6(dir).length < GATE_OUTCOME_RECORD_LIMIT;
|
|
1207
|
+
var isFreshRecord = (path, nowMs) => {
|
|
1208
|
+
const record = lstatSync4(path);
|
|
1209
|
+
return record.isFile() && nowMs - record.mtimeMs < GATE_OUTCOME_RECORD_TTL_MS;
|
|
1210
|
+
};
|
|
1211
|
+
var readFreshRecord = (path, nowMs) => {
|
|
1212
|
+
try {
|
|
1213
|
+
return isFreshRecord(path, nowMs) ? readFileSync7(path, "utf-8") : void 0;
|
|
1214
|
+
} catch {
|
|
1215
|
+
return void 0;
|
|
1216
|
+
}
|
|
1217
|
+
};
|
|
1218
|
+
var recordGateOutcome = (toolUseId, outcome) => {
|
|
1219
|
+
if (!toolUseId) return;
|
|
1220
|
+
try {
|
|
1221
|
+
const dir = privateFolderAt(gateOutcomeDirectory());
|
|
1222
|
+
if (!dir) return;
|
|
1223
|
+
sweepWhenDue(dir, Date.now());
|
|
1224
|
+
if (!hasRoomForARecord(dir)) return;
|
|
1225
|
+
writeFileSync7(join9(dir, gateOutcomeRecordName(toolUseId)), outcome, { encoding: "utf-8", mode: PRIVATE_FILE_MODE });
|
|
1226
|
+
} catch {
|
|
1227
|
+
return;
|
|
1228
|
+
}
|
|
1229
|
+
};
|
|
1230
|
+
var takeGateOutcome = (toolUseId) => {
|
|
1231
|
+
if (!toolUseId) return void 0;
|
|
1232
|
+
const dir = gateOutcomeDirectory();
|
|
1233
|
+
if (!isPrivateFolder(dir)) return void 0;
|
|
1234
|
+
const path = join9(dir, gateOutcomeRecordName(toolUseId));
|
|
1235
|
+
const recorded = readFreshRecord(path, Date.now());
|
|
1236
|
+
removeQuietly(path);
|
|
1237
|
+
return isGateOutcome(recorded) ? recorded : void 0;
|
|
1238
|
+
};
|
|
1239
|
+
|
|
1240
|
+
// src/events.ts
|
|
1241
|
+
import { basename, join as join10 } from "path";
|
|
1242
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync7, readFileSync as readFileSync8, statSync as statSync7, writeFileSync as writeFileSync8 } from "fs";
|
|
1243
|
+
import { tmpdir as tmpdir9 } from "os";
|
|
1244
|
+
var INTENT_DIR = join10(tmpdir9(), "pushary-intent");
|
|
1177
1245
|
var INTENT_MAX_BYTES = 2048;
|
|
1178
1246
|
var INTENT_GRACE_MS = 10 * 60 * 1e3;
|
|
1179
1247
|
var sanitizeSession = (sessionId) => sessionId.replace(/[^A-Za-z0-9_-]/g, "_").slice(0, 128) || DEFAULT_SESSION;
|
|
1180
|
-
var intentFile = (sessionId) =>
|
|
1248
|
+
var intentFile = (sessionId) => join10(INTENT_DIR, sanitizeSession(sessionId));
|
|
1181
1249
|
var saveLastPrompt = (sessionId, prompt) => {
|
|
1182
1250
|
try {
|
|
1183
1251
|
const trimmed = prompt.replace(/\s+/g, " ").trim().slice(0, INTENT_MAX_BYTES);
|
|
1184
1252
|
if (!trimmed) return;
|
|
1185
1253
|
mkdirSync7(INTENT_DIR, { recursive: true });
|
|
1186
|
-
|
|
1254
|
+
writeFileSync8(intentFile(sessionId), trimmed, "utf-8");
|
|
1187
1255
|
} catch {
|
|
1188
1256
|
}
|
|
1189
1257
|
};
|
|
@@ -1191,7 +1259,7 @@ var readLastPrompt = (sessionId) => {
|
|
|
1191
1259
|
try {
|
|
1192
1260
|
const path = intentFile(sessionId);
|
|
1193
1261
|
if (isDefaultSession(sessionId) && statSync7(path).mtimeMs < Date.now() - INTENT_GRACE_MS) return void 0;
|
|
1194
|
-
const value =
|
|
1262
|
+
const value = readFileSync8(path, "utf-8").trim();
|
|
1195
1263
|
return value.length > 0 ? value : void 0;
|
|
1196
1264
|
} catch {
|
|
1197
1265
|
return void 0;
|
|
@@ -1256,7 +1324,7 @@ var readFreshCachedPolicy = (apiKey, agentType, sessionId) => {
|
|
|
1256
1324
|
const request = policyRequestFor(agentType);
|
|
1257
1325
|
const path = policyCacheFile(apiKey, request.agent, request.repoAware, sessionId);
|
|
1258
1326
|
if (!existsSync5(path)) return null;
|
|
1259
|
-
const cached = JSON.parse(
|
|
1327
|
+
const cached = JSON.parse(readFileSync8(path, "utf-8"));
|
|
1260
1328
|
if (!isCachedPolicyRead(cached)) return null;
|
|
1261
1329
|
if ((cached._sessionId ?? null) !== (sessionId ?? null)) return null;
|
|
1262
1330
|
if (!cached._cachedAt || Date.now() - cached._cachedAt >= POLICY_CACHE_TTL_MS) return null;
|
|
@@ -1299,6 +1367,14 @@ var deriveAutoDecisionBeacon = (toolName, toolInput, liveMode, agentType, cwd, s
|
|
|
1299
1367
|
};
|
|
1300
1368
|
var AUTO_DECISION_WINDOW_MS = 15 * 60 * 1e3;
|
|
1301
1369
|
var HOOK_ACTIVE_WINDOW_MS = 30 * 60 * 1e3;
|
|
1370
|
+
var permissionModeOf = (input) => {
|
|
1371
|
+
const permissionMode = parsePermissionMode(input.permission_mode);
|
|
1372
|
+
return permissionMode === void 0 ? {} : { permissionMode };
|
|
1373
|
+
};
|
|
1374
|
+
var gateOutcomeOf = (toolUseId) => {
|
|
1375
|
+
const gateOutcome = takeGateOutcome(toolUseId);
|
|
1376
|
+
return gateOutcome === void 0 ? {} : { gateOutcome };
|
|
1377
|
+
};
|
|
1302
1378
|
var hookSourceOfAgentType = (agentType) => HOOK_SOURCES.find((candidate) => AGENT_IDENTITIES[candidate].type === agentType);
|
|
1303
1379
|
var deriveUsage = (payload, agent, event) => {
|
|
1304
1380
|
const source = hookSourceOfAgentType(agent.type);
|
|
@@ -1521,7 +1597,9 @@ var handlePostToolUse = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
1521
1597
|
decisionSource,
|
|
1522
1598
|
...beacon ? { decisionOrigin: beacon.decisionOrigin, toolName: beacon.toolName, toolTarget: beacon.toolTarget } : {},
|
|
1523
1599
|
meta: receiptsEnabled ? deriveReceiptMeta(lookup.tool, lookup.input, toolResult, input.cwd ?? process.cwd()) : void 0,
|
|
1524
|
-
usage: deriveUsage(input, agent, "PostToolUse")
|
|
1600
|
+
usage: deriveUsage(input, agent, "PostToolUse"),
|
|
1601
|
+
...permissionModeOf(input),
|
|
1602
|
+
...gateOutcomeOf(input.tool_use_id)
|
|
1525
1603
|
}, {
|
|
1526
1604
|
maxAttempts: 1,
|
|
1527
1605
|
budgetMs: Math.min(DRAINING_REPORT_BUDGET_MS, Math.max(0, deadline - Date.now())),
|
|
@@ -1574,7 +1652,8 @@ var handleUserPrompt = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
1574
1652
|
agentName: `${agent.label} - ${projectName}`,
|
|
1575
1653
|
sessionId: input.session_id,
|
|
1576
1654
|
taskTitle,
|
|
1577
|
-
...wakeTurn ? { driver: PHONE_DRIVER } : {}
|
|
1655
|
+
...wakeTurn ? { driver: PHONE_DRIVER } : {},
|
|
1656
|
+
...permissionModeOf(input)
|
|
1578
1657
|
}, { maxAttempts: 1, budgetMs: Math.min(DRAINING_REPORT_BUDGET_MS, Math.max(0, deadline - Date.now())), signal })
|
|
1579
1658
|
]);
|
|
1580
1659
|
if (consumesActivityContext(agent.type)) {
|
|
@@ -1606,7 +1685,8 @@ var handleStop = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
1606
1685
|
agentName: `${agent.label} - ${projectName}`,
|
|
1607
1686
|
action: summarizeStop(input),
|
|
1608
1687
|
...sessionIdentityOf(input),
|
|
1609
|
-
usage: deriveUsage(input, agent, "Stop")
|
|
1688
|
+
usage: deriveUsage(input, agent, "Stop"),
|
|
1689
|
+
...permissionModeOf(input)
|
|
1610
1690
|
}, {
|
|
1611
1691
|
maxAttempts: 1,
|
|
1612
1692
|
budgetMs: Math.min(DRAINING_REPORT_BUDGET_MS, Math.max(0, deadline - Date.now())),
|
|
@@ -1641,7 +1721,8 @@ var handleSubagentStop = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
1641
1721
|
agentType: agent.type,
|
|
1642
1722
|
agentName: `${agent.label} - ${projectName}`,
|
|
1643
1723
|
action: subagentStopSummary(input),
|
|
1644
|
-
...sessionIdentityOf(input)
|
|
1724
|
+
...sessionIdentityOf(input),
|
|
1725
|
+
...permissionModeOf(input)
|
|
1645
1726
|
// A subagent's end is a `session_end` like any other as far as the route is
|
|
1646
1727
|
// concerned, and this caller discards the response, so without this the
|
|
1647
1728
|
// parent's queued instruction is popped and thrown away.
|
|
@@ -1659,7 +1740,8 @@ var handleCompaction = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
1659
1740
|
agentType: agent.type,
|
|
1660
1741
|
agentName: `${agent.label} - ${projectName}`,
|
|
1661
1742
|
action: compactionAction(input.hook_event_name, input.trigger),
|
|
1662
|
-
...sessionIdentityOf(input)
|
|
1743
|
+
...sessionIdentityOf(input),
|
|
1744
|
+
...permissionModeOf(input)
|
|
1663
1745
|
}, { maxAttempts: 1, timeoutMs: COMPACTION_REPORT_TIMEOUT_MS });
|
|
1664
1746
|
} catch {
|
|
1665
1747
|
}
|
|
@@ -1673,7 +1755,8 @@ var handleSessionStart = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
1673
1755
|
agentType: agent.type,
|
|
1674
1756
|
agentName: `${agent.label} - ${projectName}`,
|
|
1675
1757
|
action,
|
|
1676
|
-
...sessionIdentityOf(input)
|
|
1758
|
+
...sessionIdentityOf(input),
|
|
1759
|
+
...permissionModeOf(input)
|
|
1677
1760
|
}, { maxAttempts: 2, timeoutMs: 4e3 });
|
|
1678
1761
|
} catch {
|
|
1679
1762
|
}
|
|
@@ -1698,7 +1781,8 @@ var handleSessionEnd = async (input, agent = CLAUDE_CODE_AGENT, options = {}) =>
|
|
|
1698
1781
|
agentType: agent.type,
|
|
1699
1782
|
agentName: `${agent.label} - ${projectName}`,
|
|
1700
1783
|
action,
|
|
1701
|
-
sessionId: input.session_id
|
|
1784
|
+
sessionId: input.session_id,
|
|
1785
|
+
...permissionModeOf(input)
|
|
1702
1786
|
}, { maxAttempts: options.reportAttempts ?? 2, timeoutMs: options.reportTimeoutMs ?? 3e3 });
|
|
1703
1787
|
} catch {
|
|
1704
1788
|
}
|
|
@@ -1720,7 +1804,8 @@ var handleNotification = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
1720
1804
|
agentName: `${agent.label} - ${projectName}`,
|
|
1721
1805
|
action,
|
|
1722
1806
|
sessionId: input.session_id,
|
|
1723
|
-
error: failed ? action : void 0
|
|
1807
|
+
error: failed ? action : void 0,
|
|
1808
|
+
...permissionModeOf(input)
|
|
1724
1809
|
// `timeoutMs` is not decoration. It is this file's way of saying "side
|
|
1725
1810
|
// report", and it sets `clientCanDrain` false. Without it this call
|
|
1726
1811
|
// advertises itself as able to consume a phone-queued instruction, and the
|
|
@@ -1777,7 +1862,8 @@ var handleStopFailure = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
1777
1862
|
agentName: `${agent.label} - ${projectName}`,
|
|
1778
1863
|
action: reason,
|
|
1779
1864
|
error: reason,
|
|
1780
|
-
sessionId: input.session_id
|
|
1865
|
+
sessionId: input.session_id,
|
|
1866
|
+
...permissionModeOf(input)
|
|
1781
1867
|
// Same reason as the Notification report above, and the same budget shape:
|
|
1782
1868
|
// this is followed by a ~3s fetchModeState and a 4s sendNotification inside
|
|
1783
1869
|
// Claude Code's 10s StopFailure budget. The stopfailure hook prints nothing,
|
|
@@ -1841,9 +1927,11 @@ export {
|
|
|
1841
1927
|
approvalAwaitingRetry,
|
|
1842
1928
|
markApprovalReminded,
|
|
1843
1929
|
forgetBlockedActionHint,
|
|
1930
|
+
recordGateOutcome,
|
|
1844
1931
|
readLastPrompt,
|
|
1845
1932
|
CLAUDE_CODE_AGENT,
|
|
1846
1933
|
AUTO_DECISION_WINDOW_MS,
|
|
1934
|
+
permissionModeOf,
|
|
1847
1935
|
reportEvent,
|
|
1848
1936
|
settleQuestionsForToolUse,
|
|
1849
1937
|
handlePostToolUse,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
absoluteUrl
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-I5HXAELM.js";
|
|
4
4
|
import {
|
|
5
5
|
KEY_SCOPE
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-55AHQF63.js";
|
|
7
7
|
|
|
8
8
|
// src/cli/approval-settings-pages.ts
|
|
9
9
|
var API_KEYS_PATH = "/dashboard/agent/settings";
|