@pushary/agent-hooks 1.9.1 → 1.9.3
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 +10 -0
- package/data/cursor-plugin/.cursor-plugin/plugin.json +1 -1
- package/data/cursor-plugin/CHANGELOG.md +4 -0
- package/data/cursor-plugin/scripts/pushary-gate.mjs +1 -1
- package/data/vscode-plugin/.claude-plugin/plugin.json +1 -1
- package/data/vscode-plugin/CHANGELOG.md +4 -0
- package/data/vscode-plugin/scripts/pushary-gate.mjs +1 -1
- package/dist/bin/pushary-bell-hook.js +23 -23
- package/dist/bin/pushary-bell.js +9 -9
- package/dist/bin/pushary-claude.js +26 -26
- package/dist/bin/pushary-clean.js +28 -28
- package/dist/bin/pushary-codex-bridge.js +18 -18
- package/dist/bin/pushary-codex-hook.js +31 -31
- package/dist/bin/pushary-codex.js +13 -13
- package/dist/bin/pushary-connect.js +13 -13
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +26 -26
- package/dist/bin/pushary-disconnect.js +18 -18
- package/dist/bin/pushary-doctor.js +99 -48
- package/dist/bin/pushary-elicitation-hook.js +25 -25
- package/dist/bin/pushary-gemini-bridge.js +13 -13
- package/dist/bin/pushary-gemini-hook.js +28 -28
- package/dist/bin/pushary-hook.js +32 -32
- package/dist/bin/pushary-login.js +26 -23
- package/dist/bin/pushary-logout.js +7 -7
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +9 -9
- package/dist/bin/pushary-notification-hook.js +28 -28
- package/dist/bin/pushary-opencode-hook.js +27 -27
- package/dist/bin/pushary-permission-denied-hook.js +32 -32
- package/dist/bin/pushary-permission-hook.js +31 -31
- package/dist/bin/pushary-post-hook.js +28 -28
- package/dist/bin/pushary-prompt-hook.js +28 -28
- package/dist/bin/pushary-session-end-hook.js +28 -28
- package/dist/bin/pushary-session-start-hook.js +31 -31
- package/dist/bin/pushary-setup.js +69 -52
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +15 -15
- package/dist/bin/pushary-stop-hook.js +28 -28
- package/dist/bin/pushary-stopfailure-hook.js +28 -28
- package/dist/bin/pushary-suggestions.js +4 -4
- package/dist/bin/pushary-transcript-register.js +19 -19
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +21 -21
- package/dist/bin/pushary-wait.js +9 -9
- package/dist/bin/pushary.js +6 -6
- package/dist/{chunk-COSADFEH.js → chunk-2UWD2WZC.js} +1 -1
- package/dist/{chunk-7ER66HZH.js → chunk-34JHGOYO.js} +1 -1
- package/dist/{chunk-4SB46XLF.js → chunk-4GTXFYQ7.js} +1 -1
- package/dist/{chunk-P7YDVWLL.js → chunk-552AGATI.js} +1 -1
- package/dist/{chunk-ZMKEKWNR.js → chunk-5IIAUWEJ.js} +18 -5
- package/dist/{chunk-AKCJ5SNO.js → chunk-7FVC3RGF.js} +17 -12
- package/dist/{chunk-DMA3QUOB.js → chunk-7MO3CNBX.js} +3 -3
- package/dist/{chunk-IITCMJ4G.js → chunk-AGW7PMMO.js} +2 -2
- package/dist/{chunk-WWDPULS3.js → chunk-AMFNJPJ5.js} +8 -8
- package/dist/{chunk-LJI7U6PM.js → chunk-AUS3LY4N.js} +2 -2
- package/dist/{chunk-RS4ZOFSF.js → chunk-BPGATW2F.js} +7 -6
- package/dist/{chunk-JCER3Q6P.js → chunk-CJFVYYKM.js} +10 -9
- package/dist/{chunk-D3RS57MN.js → chunk-CVVPUVBD.js} +3 -3
- package/dist/{chunk-JGQ2ANHQ.js → chunk-DEWCUHOY.js} +2 -2
- package/dist/chunk-EO23EUOK.js +14 -0
- package/dist/{chunk-FVOCQSBG.js → chunk-EZFE4PC3.js} +1 -1
- package/dist/{chunk-LXWUYG7D.js → chunk-FANGHYW5.js} +1 -1
- package/dist/{chunk-SKEP3M6M.js → chunk-FLUECSUC.js} +2 -2
- package/dist/{chunk-J7JXA2LX.js → chunk-FSFI2PQL.js} +1 -1
- package/dist/{chunk-UPTEPARD.js → chunk-G2YXIZZS.js} +2 -2
- package/dist/{chunk-65TOHCXT.js → chunk-GB2U4QVF.js} +4 -4
- package/dist/{chunk-CE4UH4AP.js → chunk-GOWCPJTP.js} +7 -5
- package/dist/{chunk-RNDFGHSQ.js → chunk-HBUQ2EQD.js} +1 -1
- package/dist/{chunk-GHKNUQYU.js → chunk-HIQNUBWO.js} +2 -2
- package/dist/{chunk-QXL27RY6.js → chunk-HPXFPXW7.js} +1 -1
- package/dist/{chunk-CGRPHFOV.js → chunk-IVF3OVR2.js} +1 -1
- package/dist/{chunk-XEIV5QOT.js → chunk-JDUWMJDP.js} +118 -170
- package/dist/{chunk-V4H33GBM.js → chunk-JM2MCYRZ.js} +6 -6
- package/dist/{chunk-LZMH4EGE.js → chunk-KA2GI53J.js} +1 -1
- package/dist/{chunk-SWGY5WNX.js → chunk-KO7UOTLD.js} +5 -5
- package/dist/{chunk-HU2LWGEE.js → chunk-MH6SJHUE.js} +1 -1
- package/dist/{chunk-XW2B4QV2.js → chunk-NGD7H3GZ.js} +2 -2
- package/dist/{chunk-UYHLMBPQ.js → chunk-NP5RJL34.js} +1 -1
- package/dist/{chunk-IJXJW2VH.js → chunk-NZJ5LFMX.js} +10 -10
- package/dist/{chunk-QQJCDRD3.js → chunk-OEMF3KJ3.js} +5 -5
- package/dist/{chunk-6L7TNZ43.js → chunk-OXJRUMZT.js} +1 -1
- package/dist/{chunk-C6PPDKVI.js → chunk-P3REVSM5.js} +3 -3
- package/dist/{chunk-SPB3QRE7.js → chunk-PPC4FZKJ.js} +4 -4
- package/dist/{chunk-FJPC35OW.js → chunk-Q4RF7EEP.js} +1 -1
- package/dist/{chunk-4XT4JXMG.js → chunk-Q7FLA4N3.js} +1 -1
- package/dist/{chunk-LKKYRNJT.js → chunk-Q7KSRRQ4.js} +1 -1
- package/dist/{chunk-KR5JASA4.js → chunk-QVUOPB32.js} +44 -16
- package/dist/{chunk-VH6763OR.js → chunk-SJC5TXK7.js} +3 -3
- package/dist/{chunk-6QSDNXGM.js → chunk-U3DBAX7P.js} +2 -2
- package/dist/{chunk-JHZAZAI3.js → chunk-UWMEY4RS.js} +5 -5
- package/dist/{chunk-NVLXK2I6.js → chunk-VRPNTJX3.js} +5 -5
- package/dist/{chunk-5K43TBK4.js → chunk-VRYOALHQ.js} +3 -3
- package/dist/{chunk-VQLWYKX7.js → chunk-WEK6US33.js} +1 -1
- package/dist/{chunk-PEGKBNGN.js → chunk-WL4YO6CO.js} +5 -5
- package/dist/{chunk-6JTTJIKJ.js → chunk-WRDMCP4G.js} +3 -3
- package/dist/{chunk-RJ7ECJSZ.js → chunk-ZPTSEJMD.js} +4 -2
- package/dist/{chunk-6Q4NM2LW.js → chunk-ZUZKHTPJ.js} +3 -3
- package/dist/{chunk-PMS3EBD2.js → chunk-ZV32QRBR.js} +1 -1
- package/dist/{global-upgrade-ML2RHV4W.js → global-upgrade-VEQ4KQEW.js} +6 -6
- package/dist/{paths-LG3IEDDM.js → paths-QTOUBV2V.js} +2 -2
- package/dist/{reapply-7PFOITE4.js → reapply-T5PLCAGP.js} +8 -8
- package/dist/src/index.js +20 -20
- package/dist/{upgrade-lock-2A2YUUEU.js → upgrade-lock-KFZBAPNU.js} +3 -3
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyHookExecutable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VRYOALHQ.js";
|
|
4
4
|
import {
|
|
5
5
|
isProtectedByScope,
|
|
6
6
|
registerHookEntry
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5IIAUWEJ.js";
|
|
8
8
|
|
|
9
9
|
// src/skills-cli.ts
|
|
10
10
|
import { execSync } from "child_process";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
activeHookSource,
|
|
3
3
|
activeIdentity
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VRPNTJX3.js";
|
|
5
5
|
import {
|
|
6
6
|
defersToNativeMode,
|
|
7
7
|
reportMachineDenial
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HIQNUBWO.js";
|
|
9
9
|
import {
|
|
10
10
|
isGatingMoment,
|
|
11
11
|
recordKeylessMoment
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-552AGATI.js";
|
|
13
13
|
import {
|
|
14
14
|
announceSubscriptionRequired,
|
|
15
15
|
denyReasonFrom,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
reportEvent,
|
|
40
40
|
scopePathFor,
|
|
41
41
|
settleQuestionsForToolUse
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-CJFVYYKM.js";
|
|
43
43
|
import {
|
|
44
44
|
DEFAULT_SESSION
|
|
45
45
|
} from "./chunk-N6IOSZOE.js";
|
|
@@ -55,20 +55,20 @@ import {
|
|
|
55
55
|
requestGate,
|
|
56
56
|
sendNotification,
|
|
57
57
|
waitForQuestion
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-UWMEY4RS.js";
|
|
59
59
|
import {
|
|
60
60
|
SubscriptionRequiredError
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-SJC5TXK7.js";
|
|
62
62
|
import {
|
|
63
63
|
getMachineId
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-FSFI2PQL.js";
|
|
65
65
|
import {
|
|
66
66
|
getApiKey,
|
|
67
67
|
getBaseUrl
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-4GTXFYQ7.js";
|
|
69
69
|
import {
|
|
70
70
|
NPX_LATEST_COMMAND
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-EZFE4PC3.js";
|
|
72
72
|
import {
|
|
73
73
|
AGENT_QUESTION_STRATEGY,
|
|
74
74
|
GATE_BLOCK_REASON_MAX_LENGTH,
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
parseAgentQuestions,
|
|
97
97
|
resolveGate,
|
|
98
98
|
stoppedOutput
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-JDUWMJDP.js";
|
|
100
100
|
|
|
101
101
|
// src/claude-permission-rules.ts
|
|
102
102
|
import { readFileSync, statSync } from "fs";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
finishWithUpgradeLock,
|
|
4
4
|
installWithUpgradeLock,
|
|
5
5
|
releaseAutoUpdateLock
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HPXFPXW7.js";
|
|
7
7
|
import {
|
|
8
8
|
describeAutoUpdateCheck,
|
|
9
9
|
globalInstallLocation,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
readAutoUpdateState,
|
|
12
12
|
updateAutoUpdateState,
|
|
13
13
|
upgradeEntryFor
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GOWCPJTP.js";
|
|
15
15
|
import {
|
|
16
16
|
EXIT
|
|
17
17
|
} from "./chunk-KZERVKTD.js";
|
|
@@ -24,10 +24,10 @@ import {
|
|
|
24
24
|
npmErrorMessage,
|
|
25
25
|
readGlobalCliInstallAt,
|
|
26
26
|
readGlobalPrefix
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-5IIAUWEJ.js";
|
|
28
28
|
import {
|
|
29
29
|
NPX_LATEST_COMMAND
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-EZFE4PC3.js";
|
|
31
31
|
import {
|
|
32
32
|
commandsPackage,
|
|
33
33
|
globalUpgradeEntry,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
isSameMajorVersion,
|
|
37
37
|
ownPackageRoot,
|
|
38
38
|
packageVersionAt
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-JDUWMJDP.js";
|
|
40
40
|
|
|
41
41
|
// src/global-upgrade.ts
|
|
42
42
|
import { existsSync } from "fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SETUP_FLAGS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MH6SJHUE.js";
|
|
4
4
|
import {
|
|
5
5
|
parseFlags
|
|
6
6
|
} from "./chunk-GMXKITVA.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-7QLSKOSU.js";
|
|
10
10
|
import {
|
|
11
11
|
NPX_LATEST_COMMAND
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-EZFE4PC3.js";
|
|
13
13
|
import {
|
|
14
14
|
CLAUDE_CONNECTOR_GUIDE,
|
|
15
15
|
CLAUDE_CONNECTOR_STEPS,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
CLAUDE_CONNECTOR_URL,
|
|
18
18
|
COWORK_CONNECTOR_LIMIT,
|
|
19
19
|
COWORK_STANDING_INSTRUCTIONS
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-JDUWMJDP.js";
|
|
21
21
|
|
|
22
22
|
// src/cli/cowork.ts
|
|
23
23
|
import { readFileSync } from "fs";
|
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
} from "./chunk-POFBE6ZY.js";
|
|
5
5
|
import {
|
|
6
6
|
isNetworkFailure
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WRDMCP4G.js";
|
|
8
8
|
import {
|
|
9
9
|
clientReportClaims
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5IIAUWEJ.js";
|
|
11
11
|
import {
|
|
12
12
|
getApiKey,
|
|
13
13
|
getBaseUrl
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-4GTXFYQ7.js";
|
|
15
15
|
import {
|
|
16
16
|
CLIENT_REPORT_PATH,
|
|
17
17
|
degradedLine
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-JDUWMJDP.js";
|
|
19
19
|
|
|
20
20
|
// src/client-report-claim.ts
|
|
21
21
|
import { createHash } from "crypto";
|
|
@@ -2,14 +2,16 @@ import {
|
|
|
2
2
|
spawnClaude
|
|
3
3
|
} from "./chunk-XHKBHWLX.js";
|
|
4
4
|
import {
|
|
5
|
+
CODEX_HOOK_EVENTS,
|
|
6
|
+
CODEX_REQUIRED_APPROVAL_EVENTS,
|
|
5
7
|
codexHome,
|
|
6
8
|
codexHooksJsonIn,
|
|
7
9
|
isPusharyCodexCommand,
|
|
8
10
|
resolvePathBinary
|
|
9
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5IIAUWEJ.js";
|
|
10
12
|
import {
|
|
11
13
|
getPackageVersion
|
|
12
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JDUWMJDP.js";
|
|
13
15
|
|
|
14
16
|
// src/codex-app-server.ts
|
|
15
17
|
import { existsSync, realpathSync } from "fs";
|
|
@@ -20,6 +22,7 @@ var CODEX_HOOK_STATUS = {
|
|
|
20
22
|
modified: "modified",
|
|
21
23
|
managed: "managed",
|
|
22
24
|
disabled: "disabled",
|
|
25
|
+
asynchronous: "asynchronous",
|
|
23
26
|
notListed: "not listed"
|
|
24
27
|
};
|
|
25
28
|
var CODEX_APP_SERVER_ARGS = ["app-server"];
|
|
@@ -42,11 +45,19 @@ var CODEX_NOT_ASKED = {
|
|
|
42
45
|
};
|
|
43
46
|
var UNRECOGNISED_LISTING = "Codex answered hooks/list in a shape Pushary does not recognise";
|
|
44
47
|
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
45
|
-
var
|
|
48
|
+
var hasCodexHookIdentity = (value) => isRecord(value) && typeof value.key === "string" && value.key.length > 0 && typeof value.eventName === "string" && value.eventName.length > 0 && typeof value.sourcePath === "string" && value.sourcePath.length > 0 && typeof value.enabled === "boolean" && typeof value.isManaged === "boolean" && typeof value.currentHash === "string" && value.currentHash.length > 0 && typeof value.trustStatus === "string" && value.trustStatus.length > 0;
|
|
49
|
+
var isCodexListedHook = (value) => hasCodexHookIdentity(value) && (value.handlerType === void 0 || value.handlerType === "command") && typeof value.command === "string" && value.command.length > 0 && (value.async === void 0 || typeof value.async === "boolean");
|
|
50
|
+
var isCodexHookMetadata = (value) => {
|
|
51
|
+
if (isCodexListedHook(value)) return true;
|
|
52
|
+
if (!hasCodexHookIdentity(value)) return false;
|
|
53
|
+
if (value.handlerType === "prompt" || value.handlerType === "agent") return true;
|
|
54
|
+
return value.handlerType === "mcpTool" && typeof value.server === "string" && value.server.length > 0 && typeof value.tool === "string" && value.tool.length > 0;
|
|
55
|
+
};
|
|
46
56
|
var listedHookFields = (hook) => ({
|
|
47
57
|
key: hook.key,
|
|
48
58
|
eventName: hook.eventName,
|
|
49
59
|
command: hook.command,
|
|
60
|
+
async: hook.async ?? false,
|
|
50
61
|
sourcePath: hook.sourcePath,
|
|
51
62
|
enabled: hook.enabled,
|
|
52
63
|
isManaged: hook.isManaged,
|
|
@@ -67,20 +78,17 @@ var hooksListingOf = (result) => {
|
|
|
67
78
|
const warnings = [];
|
|
68
79
|
for (const layer of result.data) {
|
|
69
80
|
if (!isRecord(layer) || !Array.isArray(layer.hooks)) return null;
|
|
81
|
+
if (!layer.hooks.every(isCodexHookMetadata)) return null;
|
|
70
82
|
hooks.push(...layer.hooks.filter(isCodexListedHook).map(listedHookFields));
|
|
71
83
|
warnings.push(...diagnosticMessages(layer.warnings), ...diagnosticMessages(layer.errors));
|
|
72
84
|
}
|
|
73
85
|
return { hooks, warnings };
|
|
74
86
|
};
|
|
75
87
|
var isPusharyHookIn = (hooksJsonPath, hook) => hook.sourcePath === hooksJsonPath && isPusharyCodexCommand(hook.command);
|
|
76
|
-
var isTrustableByPushary = (hook) => hook.enabled && !hook.isManaged && hook.trustStatus !== CODEX_HOOK_STATUS.managed;
|
|
88
|
+
var isTrustableByPushary = (hook) => hook.enabled && !hook.isManaged && hook.trustStatus !== CODEX_HOOK_STATUS.managed && !(CODEX_REQUIRED_APPROVAL_EVENTS.includes(hookEventOf(hook.eventName)) && hook.async === true);
|
|
77
89
|
var pusharyHooksIn = (hooks, hooksJsonPath) => hooks.filter((hook) => isPusharyHookIn(hooksJsonPath, hook));
|
|
78
90
|
var selectPusharyCodexHooks = (hooks, hooksJsonPath) => pusharyHooksIn(hooks, hooksJsonPath).filter(isTrustableByPushary);
|
|
79
|
-
var codexTrustVerdict = (hooks, hooksJsonPath) =>
|
|
80
|
-
if (pusharyHooksIn(hooks, hooksJsonPath).length === 0) return { kind: "unlisted" };
|
|
81
|
-
const untrusted = selectPusharyCodexHooks(hooks, hooksJsonPath).filter((hook) => hook.trustStatus !== CODEX_HOOK_STATUS.trusted);
|
|
82
|
-
return untrusted.length === 0 ? { kind: "trusted" } : { kind: "untrusted", hooks: untrusted };
|
|
83
|
-
};
|
|
91
|
+
var codexTrustVerdict = (hooks, hooksJsonPath) => assessCodexHookTrust(CODEX_HOOK_EVENTS.map((event) => event.event), pusharyHooksIn(hooks, hooksJsonPath));
|
|
84
92
|
var codexTrustEdit = (hooks) => ({
|
|
85
93
|
edits: [{
|
|
86
94
|
keyPath: HOOKS_STATE_KEY_PATH,
|
|
@@ -94,16 +102,34 @@ var initializeParams = (clientVersion) => ({
|
|
|
94
102
|
});
|
|
95
103
|
var hooksListParams = (cwd) => ({ cwds: [cwd] });
|
|
96
104
|
var hookEventOf = (eventName) => eventName.charAt(0).toUpperCase() + eventName.slice(1);
|
|
105
|
+
var trustStatusOf = (hook) => {
|
|
106
|
+
if (!hook.enabled) return CODEX_HOOK_STATUS.disabled;
|
|
107
|
+
if (CODEX_REQUIRED_APPROVAL_EVENTS.includes(hookEventOf(hook.eventName)) && hook.async === true) return CODEX_HOOK_STATUS.asynchronous;
|
|
108
|
+
return hook.trustStatus;
|
|
109
|
+
};
|
|
97
110
|
var readingOf = (hook) => ({
|
|
98
111
|
event: hookEventOf(hook.eventName),
|
|
99
|
-
status: hook
|
|
112
|
+
status: trustStatusOf(hook)
|
|
100
113
|
});
|
|
101
|
-
var codexHookTrustByEvent = (events, hooks) =>
|
|
102
|
-
|
|
103
|
-
|
|
114
|
+
var codexHookTrustByEvent = (events, hooks) => {
|
|
115
|
+
const readings = hooks.map(readingOf);
|
|
116
|
+
const result = [];
|
|
117
|
+
for (const event of events) {
|
|
118
|
+
const matching = readings.filter((reading) => reading.event === event);
|
|
119
|
+
result.push(...matching.length > 0 ? matching : [{ event, status: CODEX_HOOK_STATUS.notListed }]);
|
|
120
|
+
}
|
|
121
|
+
return result;
|
|
122
|
+
};
|
|
123
|
+
var isCodexTrustFailure = (reading) => {
|
|
124
|
+
if (reading.status === CODEX_HOOK_STATUS.trusted || reading.status === CODEX_HOOK_STATUS.managed) return false;
|
|
125
|
+
if (reading.status === CODEX_HOOK_STATUS.disabled || reading.status === CODEX_HOOK_STATUS.notListed) {
|
|
126
|
+
return CODEX_REQUIRED_APPROVAL_EVENTS.includes(reading.event);
|
|
127
|
+
}
|
|
128
|
+
return true;
|
|
129
|
+
};
|
|
104
130
|
var eventsWithStatus = (readings, status) => readings.filter((reading) => reading.status === status).map((reading) => reading.event);
|
|
105
131
|
var assessCodexHookTrust = (events, hooks) => {
|
|
106
|
-
const readings = codexHookTrustByEvent(events, hooks);
|
|
132
|
+
const readings = codexHookTrustByEvent([.../* @__PURE__ */ new Set([...events, ...CODEX_REQUIRED_APPROVAL_EVENTS])], hooks);
|
|
107
133
|
const notListed = eventsWithStatus(readings, CODEX_HOOK_STATUS.notListed);
|
|
108
134
|
if (readings.length > 0 && notListed.length === readings.length) return { kind: "unlisted" };
|
|
109
135
|
const disabled = eventsWithStatus(readings, CODEX_HOOK_STATUS.disabled);
|
|
@@ -265,7 +291,7 @@ var confirmationAfterWrite = (listing, hooksJsonPath, writeError) => {
|
|
|
265
291
|
const verdict = codexTrustVerdict(listing.hooks, hooksJsonPath);
|
|
266
292
|
if (verdict.kind === "trusted") return { kind: "verified", wrote: true };
|
|
267
293
|
if (verdict.kind === "unlisted") return { kind: "unlisted", warnings: listing.warnings };
|
|
268
|
-
return { kind: "refused", hooks: verdict.
|
|
294
|
+
return { kind: "refused", hooks: verdict.failures, writeError };
|
|
269
295
|
};
|
|
270
296
|
var trustConversation = (launch, hooksJsonPath) => async (session) => {
|
|
271
297
|
const unavailable = await openSession(session);
|
|
@@ -275,7 +301,9 @@ var trustConversation = (launch, hooksJsonPath) => async (session) => {
|
|
|
275
301
|
const verdict = codexTrustVerdict(before.hooks, hooksJsonPath);
|
|
276
302
|
if (verdict.kind === "trusted") return { kind: "verified", wrote: false };
|
|
277
303
|
if (verdict.kind === "unlisted") return { kind: "unlisted", warnings: before.warnings };
|
|
278
|
-
const
|
|
304
|
+
const trustable = selectPusharyCodexHooks(before.hooks, hooksJsonPath).filter((hook) => hook.trustStatus === CODEX_HOOK_STATUS.untrusted || hook.trustStatus === CODEX_HOOK_STATUS.modified);
|
|
305
|
+
if (trustable.length === 0) return { kind: "refused", hooks: verdict.failures, writeError: null };
|
|
306
|
+
const written = await session.request(METHOD_CONFIG_BATCH_WRITE, codexTrustEdit(trustable));
|
|
279
307
|
const after = await listHooks(session, launch);
|
|
280
308
|
if (!isListing(after)) return after;
|
|
281
309
|
return confirmationAfterWrite(after, hooksJsonPath, written.kind === "error" ? written.message : null);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
keyCheckFromResponse
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7MO3CNBX.js";
|
|
4
4
|
import {
|
|
5
5
|
installNetworkDefaults
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WRDMCP4G.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4GTXFYQ7.js";
|
|
10
10
|
|
|
11
11
|
// src/retry.ts
|
|
12
12
|
var isRetryable = (err) => {
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clientErrorKindOf,
|
|
3
3
|
reportClientError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PPC4FZKJ.js";
|
|
5
5
|
import {
|
|
6
6
|
SubscriptionRequiredError,
|
|
7
7
|
callMcpTool
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SJC5TXK7.js";
|
|
9
9
|
import {
|
|
10
10
|
installNetworkDefaults
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WRDMCP4G.js";
|
|
12
12
|
import {
|
|
13
13
|
getBaseUrl
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-4GTXFYQ7.js";
|
|
15
15
|
import {
|
|
16
16
|
ASK_AGENT_NAME_MAX,
|
|
17
17
|
ASK_QUESTION_MAX,
|
|
18
18
|
DECISION_LINE_MAX,
|
|
19
19
|
truncateLine
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-JDUWMJDP.js";
|
|
21
21
|
|
|
22
22
|
// src/api.ts
|
|
23
23
|
import { randomUUID } from "crypto";
|
|
@@ -3,28 +3,28 @@ import {
|
|
|
3
3
|
addPusharyToolPermissions,
|
|
4
4
|
isPusharyHook,
|
|
5
5
|
removeClaudeMcpServers
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZUZKHTPJ.js";
|
|
7
7
|
import {
|
|
8
8
|
CLAUDE_HOOK_EVENTS,
|
|
9
9
|
addGeminiMcpServer,
|
|
10
10
|
removeGeminiMcpServer
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CVVPUVBD.js";
|
|
12
12
|
import {
|
|
13
13
|
CLAUDE_CODE_AGENT,
|
|
14
14
|
parseApplyPatchFiles
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CJFVYYKM.js";
|
|
16
16
|
import {
|
|
17
17
|
guardBinary,
|
|
18
18
|
holdBudgetOf,
|
|
19
19
|
registerHookEntry
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5IIAUWEJ.js";
|
|
21
21
|
import {
|
|
22
22
|
PHONE_ANSWERED_TOOLS,
|
|
23
23
|
hookCompatibleProfile,
|
|
24
24
|
hookCompatibleProfileBySource,
|
|
25
25
|
toToolLookup,
|
|
26
26
|
withHookHoldBudget
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-JDUWMJDP.js";
|
|
28
28
|
|
|
29
29
|
// src/compatible-config.ts
|
|
30
30
|
import { homedir } from "os";
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
GEMINI_HOOK_EVENTS,
|
|
4
4
|
hasGeminiHooks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CVVPUVBD.js";
|
|
6
6
|
import {
|
|
7
7
|
CODEX_HOOK_EVENTS,
|
|
8
8
|
hasCodexHooks,
|
|
9
9
|
holdBudgetOf
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5IIAUWEJ.js";
|
|
11
11
|
import {
|
|
12
12
|
CURSOR_GATE_EVENTS,
|
|
13
13
|
HOOK_LOCATOR_BINARY,
|
|
14
14
|
hookCommandHoldBudget
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JDUWMJDP.js";
|
|
16
16
|
|
|
17
17
|
// src/diagnostics/wiring.ts
|
|
18
18
|
var record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-XHKBHWLX.js";
|
|
5
5
|
import {
|
|
6
6
|
readControlMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZPTSEJMD.js";
|
|
8
8
|
import {
|
|
9
9
|
getMachineId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FSFI2PQL.js";
|
|
11
11
|
import {
|
|
12
12
|
pusharyDir,
|
|
13
13
|
resolveGlobalBinary
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5IIAUWEJ.js";
|
|
15
15
|
import {
|
|
16
16
|
readJsonSafe,
|
|
17
17
|
writeFileAtomic,
|
|
@@ -20,14 +20,14 @@ import {
|
|
|
20
20
|
} from "./chunk-T7E75EKA.js";
|
|
21
21
|
import {
|
|
22
22
|
getApiKey
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-4GTXFYQ7.js";
|
|
24
24
|
import {
|
|
25
25
|
CLI_PACKAGE_NAMES,
|
|
26
26
|
cmdShimTarget,
|
|
27
27
|
getPackageVersion,
|
|
28
28
|
globalPackageFolder,
|
|
29
29
|
globalRootFor
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-JDUWMJDP.js";
|
|
31
31
|
|
|
32
32
|
// src/daemon-lifecycle.ts
|
|
33
33
|
import { dirname, join, win32 as win32Path } from "path";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readExistingMachineId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FSFI2PQL.js";
|
|
4
4
|
import {
|
|
5
5
|
NetworkError
|
|
6
6
|
} from "./chunk-7QLSKOSU.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4GTXFYQ7.js";
|
|
10
10
|
import {
|
|
11
11
|
clientContextHeaders,
|
|
12
12
|
getPackageVersion
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JDUWMJDP.js";
|
|
14
14
|
|
|
15
15
|
// src/cli/net.ts
|
|
16
16
|
import { createRequire } from "module";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveInstallSourceFor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U3DBAX7P.js";
|
|
4
4
|
import {
|
|
5
5
|
backupFile,
|
|
6
6
|
readJsonSafe,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-T7E75EKA.js";
|
|
10
10
|
import {
|
|
11
11
|
configFilePath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4GTXFYQ7.js";
|
|
13
13
|
|
|
14
14
|
// src/shell-alias.ts
|
|
15
15
|
import { homedir } from "os";
|
|
@@ -110,6 +110,7 @@ var isDisabledExport = (line) => {
|
|
|
110
110
|
return OUR_EXPORT.test(trimmed.slice(1, -LOGOUT_MARK.length).trim());
|
|
111
111
|
};
|
|
112
112
|
var keyPrefix = (key) => key.split(".")[0] ?? key;
|
|
113
|
+
var manualKeyStepFor = (kind, platform) => kind === "no-rc" || platform === "win32" ? "config-only" : "paste-export";
|
|
113
114
|
var rcResult = (kind, over = {}) => ({
|
|
114
115
|
kind,
|
|
115
116
|
path: null,
|
|
@@ -298,6 +299,7 @@ export {
|
|
|
298
299
|
exportLine,
|
|
299
300
|
isDisabledExport,
|
|
300
301
|
keyPrefix,
|
|
302
|
+
manualKeyStepFor,
|
|
301
303
|
writeKey,
|
|
302
304
|
clearKey,
|
|
303
305
|
readConfigFileKey,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
supportedClaudeEvents
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CVVPUVBD.js";
|
|
5
5
|
import {
|
|
6
6
|
guardBinary,
|
|
7
7
|
holdBudgetOf,
|
|
8
8
|
isProtectedByScope,
|
|
9
9
|
registerHookEntry
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5IIAUWEJ.js";
|
|
11
11
|
import {
|
|
12
12
|
HOOK_LOCATOR_BINARY,
|
|
13
13
|
withHookHoldBudget
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JDUWMJDP.js";
|
|
15
15
|
|
|
16
16
|
// src/claude-config.ts
|
|
17
17
|
import { join } from "path";
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
readGlobalUpgradeSubject,
|
|
6
6
|
upgradeInstalledPackage,
|
|
7
7
|
withUpgradeLock
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-OEMF3KJ3.js";
|
|
9
|
+
import "./chunk-HPXFPXW7.js";
|
|
10
|
+
import "./chunk-GOWCPJTP.js";
|
|
11
11
|
import "./chunk-POFBE6ZY.js";
|
|
12
12
|
import "./chunk-KZERVKTD.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-5IIAUWEJ.js";
|
|
14
14
|
import "./chunk-T7E75EKA.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-EZFE4PC3.js";
|
|
16
|
+
import "./chunk-JDUWMJDP.js";
|
|
17
17
|
export {
|
|
18
18
|
finishGlobalUpgrade,
|
|
19
19
|
finishUpgradeWithLock,
|
|
@@ -9,18 +9,18 @@ import {
|
|
|
9
9
|
reapplyGeminiSettings,
|
|
10
10
|
reapplyVsCodePlugin,
|
|
11
11
|
repairCodexHolds
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-KO7UOTLD.js";
|
|
13
|
+
import "./chunk-QVUOPB32.js";
|
|
14
|
+
import "./chunk-ZUZKHTPJ.js";
|
|
15
15
|
import "./chunk-RIVNNBEK.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-VRYOALHQ.js";
|
|
17
|
+
import "./chunk-CVVPUVBD.js";
|
|
18
18
|
import "./chunk-XHKBHWLX.js";
|
|
19
19
|
import "./chunk-6ICPEJY5.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-HBUQ2EQD.js";
|
|
21
|
+
import "./chunk-5IIAUWEJ.js";
|
|
22
22
|
import "./chunk-T7E75EKA.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-JDUWMJDP.js";
|
|
24
24
|
export {
|
|
25
25
|
ensureCodexTrustAfterReapply,
|
|
26
26
|
inspectConfiguredManagedProviders,
|