@pushary/agent-hooks 1.9.21 → 1.9.23
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/dist/bin/pushary-bell-hook.js +25 -25
- package/dist/bin/pushary-bell.js +9 -9
- package/dist/bin/pushary-claude.js +24 -24
- package/dist/bin/pushary-clean.js +28 -28
- package/dist/bin/pushary-codex-bridge.js +17 -17
- package/dist/bin/pushary-codex-hook.js +38 -36
- package/dist/bin/pushary-codex.js +12 -12
- package/dist/bin/pushary-connect.js +24 -24
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +31 -31
- package/dist/bin/pushary-disconnect.js +24 -24
- package/dist/bin/pushary-doctor.js +33 -33
- 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 +29 -29
- package/dist/bin/pushary-login.js +12 -12
- package/dist/bin/pushary-logout.js +12 -12
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +12 -12
- package/dist/bin/pushary-notification-hook.js +24 -24
- package/dist/bin/pushary-opencode-hook.js +27 -27
- package/dist/bin/pushary-permission-denied-hook.js +29 -29
- package/dist/bin/pushary-permission-hook.js +28 -28
- 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 +24 -24
- package/dist/bin/pushary-session-start-hook.js +28 -28
- package/dist/bin/pushary-setup.js +40 -39
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +26 -26
- package/dist/bin/pushary-stop-hook.js +24 -24
- package/dist/bin/pushary-stopfailure-hook.js +24 -24
- package/dist/bin/pushary-suggestions.js +12 -12
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +30 -30
- package/dist/bin/pushary-wait.js +12 -12
- package/dist/bin/pushary.js +6 -6
- package/dist/{chunk-U6GYFWT4.js → chunk-2AUKCSLQ.js} +4 -4
- package/dist/{chunk-Y2BOLNJV.js → chunk-4GKQDFH6.js} +9 -6
- package/dist/{chunk-4RJQPI36.js → chunk-6GHZAS7S.js} +4 -4
- package/dist/{chunk-NVXC6ZBR.js → chunk-6HT2TUZD.js} +2 -2
- package/dist/{chunk-LUDGBOLV.js → chunk-73HGV4R6.js} +2 -2
- package/dist/{chunk-Z5EYCMJH.js → chunk-7J2AX5T6.js} +2 -2
- package/dist/{chunk-YLLGKY7K.js → chunk-7RGEJOQS.js} +3 -3
- package/dist/{chunk-PYWZYM74.js → chunk-A5U62Q6K.js} +5 -5
- package/dist/{chunk-AXBFNQG6.js → chunk-AFP3HZVK.js} +1 -1
- package/dist/{chunk-FH4O3QGQ.js → chunk-AQ3TSQA2.js} +3 -3
- package/dist/{chunk-TJ4KMPYO.js → chunk-AV5VX7OK.js} +8 -8
- package/dist/{chunk-QHY3UDYC.js → chunk-AXSHPFU3.js} +3 -3
- package/dist/{chunk-PCF7JUTP.js → chunk-BY5EKA6W.js} +3 -3
- package/dist/{chunk-7AFLHL2R.js → chunk-CJTQNUUT.js} +2 -2
- package/dist/{chunk-TVBEHME2.js → chunk-DKBPNHAI.js} +4 -4
- package/dist/{chunk-ZNAGS7O7.js → chunk-E2LGKG75.js} +3 -3
- package/dist/{chunk-NBGJ3EOE.js → chunk-EDN4F6GX.js} +1 -1
- package/dist/{chunk-G4TV5GYU.js → chunk-FBV2KS3Z.js} +2 -2
- package/dist/{chunk-BV5JPACQ.js → chunk-FIYCICHC.js} +2 -2
- package/dist/{chunk-UKCRTTKF.js → chunk-GN6BJXC7.js} +1 -1
- package/dist/{chunk-YCL2V5FD.js → chunk-GYP6DLA4.js} +10 -10
- package/dist/{chunk-RVP6COOQ.js → chunk-HXZG5WHU.js} +2 -2
- package/dist/{chunk-2V55RBUR.js → chunk-I46QTKYI.js} +5 -5
- package/dist/{chunk-FUXCWF4Y.js → chunk-ISAKLEKE.js} +7 -7
- package/dist/{chunk-VRXX2AY2.js → chunk-JCEUDLGW.js} +1 -1
- package/dist/{chunk-TQIPIFL7.js → chunk-JNKHCGHR.js} +1 -1
- package/dist/{chunk-BDL6GJOQ.js → chunk-K2EYK5RL.js} +4 -4
- package/dist/{chunk-JHAPJRAN.js → chunk-KJA6IGOZ.js} +1 -1
- package/dist/{chunk-B6KZME5D.js → chunk-LEQRIJ4H.js} +1 -1
- package/dist/{chunk-6WBIQQHO.js → chunk-M6R3SZZS.js} +1 -1
- package/dist/{chunk-PCVAK67W.js → chunk-M7DCI44L.js} +1 -7
- package/dist/{chunk-6WINXCXY.js → chunk-N4DMADJM.js} +1 -1
- package/dist/{chunk-IEYFFMTU.js → chunk-NHBPW6C4.js} +2 -2
- package/dist/{chunk-XNO3CSVW.js → chunk-NSCETODW.js} +1 -1
- package/dist/{chunk-VBPASZU7.js → chunk-OH647UT3.js} +32 -6
- package/dist/{chunk-II6OFDB3.js → chunk-OH6OGEOY.js} +4 -4
- package/dist/{chunk-4WHNRAOK.js → chunk-OQPEHKH2.js} +1 -1
- package/dist/{chunk-IIQ77WUJ.js → chunk-PFB7P4F3.js} +6 -6
- package/dist/{chunk-IM7EGZVH.js → chunk-QFNY4KUQ.js} +1 -1
- package/dist/{chunk-CEF4UQ3X.js → chunk-QIODXPTP.js} +4 -4
- package/dist/{chunk-247PAUW6.js → chunk-R5C3QCVT.js} +1 -1
- package/dist/{chunk-Y6PZ3B5U.js → chunk-RHIKMNWJ.js} +2 -2
- package/dist/{chunk-VD2AWSER.js → chunk-RN5NRRHX.js} +2 -2
- package/dist/{chunk-SVQOEVAT.js → chunk-S2R2U5W5.js} +4 -4
- package/dist/{chunk-I52ALHOM.js → chunk-SLBO7PHS.js} +2 -2
- package/dist/{chunk-L5NPRGVE.js → chunk-SSWK2WYX.js} +5 -5
- package/dist/{chunk-GMJOSAAP.js → chunk-SWQLZQE3.js} +18 -15
- package/dist/{chunk-5PW6GMQO.js → chunk-USUI4P63.js} +2 -2
- package/dist/{chunk-TBCXMW2C.js → chunk-XBETSM5T.js} +3 -3
- package/dist/{chunk-4BKAZ4JN.js → chunk-YXHVMZPR.js} +4 -4
- package/dist/{chunk-ESHO7OC3.js → chunk-YZPFJCFE.js} +1 -1
- package/dist/{chunk-UZ2YEGIT.js → chunk-Z4UDB7EC.js} +3 -3
- package/dist/{chunk-BERMVODT.js → chunk-ZGYO6OQE.js} +5 -5
- package/dist/{global-upgrade-AHRKGQ7M.js → global-upgrade-SKY7A3SI.js} +6 -6
- package/dist/{paths-AGUCNYQ5.js → paths-XUUEK7OU.js} +2 -2
- package/dist/{reapply-BUCDXIIM.js → reapply-WQDP26EA.js} +20 -20
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +19 -19
- package/dist/{upgrade-lock-7Z5WBZVH.js → upgrade-lock-AYW3TB7X.js} +3 -3
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
IDLE_PROMPT_NOTIFICATION,
|
|
3
3
|
NOTIFICATION_PUSH_TYPES,
|
|
4
4
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KJA6IGOZ.js";
|
|
6
6
|
import {
|
|
7
7
|
cancelQuestion,
|
|
8
8
|
clientErrorKindOf,
|
|
@@ -10,26 +10,26 @@ import {
|
|
|
10
10
|
reportClientError,
|
|
11
11
|
sendNotification,
|
|
12
12
|
waitForAnswer
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-4GKQDFH6.js";
|
|
14
14
|
import {
|
|
15
15
|
withRetry
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-E2LGKG75.js";
|
|
17
17
|
import {
|
|
18
18
|
getMachineId
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-EDN4F6GX.js";
|
|
20
20
|
import {
|
|
21
21
|
reportedInstallSource
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-6HT2TUZD.js";
|
|
23
23
|
import {
|
|
24
24
|
canonicalJson
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-QIODXPTP.js";
|
|
26
26
|
import {
|
|
27
27
|
writeFileAtomic
|
|
28
28
|
} from "./chunk-AQFEP65J.js";
|
|
29
29
|
import {
|
|
30
30
|
getApiKey,
|
|
31
31
|
getBaseUrl
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-OQPEHKH2.js";
|
|
33
33
|
import {
|
|
34
34
|
ACTION_BODY_MAX,
|
|
35
35
|
AGENT_LABELS_BY_TYPE,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
resolvePolicy,
|
|
61
61
|
toToolLookup,
|
|
62
62
|
truncateLine
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-OH647UT3.js";
|
|
64
64
|
|
|
65
65
|
// ../hook-mapping/src/describe.ts
|
|
66
66
|
import { isAbsolute, relative, resolve } from "path";
|
|
@@ -204,6 +204,7 @@ var parseApplyPatchOps = (command) => {
|
|
|
204
204
|
return ops;
|
|
205
205
|
};
|
|
206
206
|
var parseApplyPatchFiles = (command) => [...new Set(parseApplyPatchOps(command).map((entry) => entry.path))];
|
|
207
|
+
var patchDeletesFiles = (toolName, toolInput) => toolName === "apply_patch" && parseApplyPatchOps(toolInput.command).some((entry) => entry.op === "delete");
|
|
207
208
|
var OPENCODE_TOOL_NAMES = {
|
|
208
209
|
bash: "Bash",
|
|
209
210
|
// A shell command reaching outside the worktree asks a second time under its
|
|
@@ -1359,7 +1360,6 @@ var toCodexWire = (event, decision) => {
|
|
|
1359
1360
|
decision.kind === "deny" ? decision.reason : void 0
|
|
1360
1361
|
) ?? null;
|
|
1361
1362
|
};
|
|
1362
|
-
var patchDeletesFiles = (toolName, toolInput) => toolName === "apply_patch" && parseApplyPatchOps(toolInput.command).some((entry) => entry.op === "delete");
|
|
1363
1363
|
var describeApplyPatch = (command) => {
|
|
1364
1364
|
const ops = parseApplyPatchOps(command);
|
|
1365
1365
|
if (ops.length === 0) return null;
|
|
@@ -2246,6 +2246,7 @@ export {
|
|
|
2246
2246
|
describeToolCall,
|
|
2247
2247
|
deriveToolTarget,
|
|
2248
2248
|
parseApplyPatchFiles,
|
|
2249
|
+
patchDeletesFiles,
|
|
2249
2250
|
OPENCODE_TOOL_NAMES,
|
|
2250
2251
|
canonicalGateInputs,
|
|
2251
2252
|
scopePathFor,
|
|
@@ -2279,7 +2280,6 @@ export {
|
|
|
2279
2280
|
codexDeny,
|
|
2280
2281
|
codexPass,
|
|
2281
2282
|
toCodexWire,
|
|
2282
|
-
patchDeletesFiles,
|
|
2283
2283
|
describeApplyPatch,
|
|
2284
2284
|
toPolicyLookup,
|
|
2285
2285
|
toPolicyLookups,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
forkFinishWithUpgradeLock,
|
|
5
5
|
installWithUpgradeLock,
|
|
6
6
|
releaseAutoUpdateLock
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JCEUDLGW.js";
|
|
8
8
|
import {
|
|
9
9
|
describeAutoUpdateCheck,
|
|
10
10
|
globalInstallLocation,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
readAutoUpdateState,
|
|
15
15
|
updateAutoUpdateState,
|
|
16
16
|
upgradeEntryFor
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-USUI4P63.js";
|
|
18
18
|
import {
|
|
19
19
|
EXIT
|
|
20
20
|
} from "./chunk-KZERVKTD.js";
|
|
@@ -27,10 +27,10 @@ import {
|
|
|
27
27
|
npmErrorMessage,
|
|
28
28
|
readGlobalCliInstallAt,
|
|
29
29
|
readGlobalPrefix
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-QIODXPTP.js";
|
|
31
31
|
import {
|
|
32
32
|
NPX_LATEST_COMMAND
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-LEQRIJ4H.js";
|
|
34
34
|
import {
|
|
35
35
|
commandsPackage,
|
|
36
36
|
globalUpgradeEntry,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
isSameMajorVersion,
|
|
40
40
|
ownPackageRoot,
|
|
41
41
|
packageVersionAt
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-OH647UT3.js";
|
|
43
43
|
|
|
44
44
|
// src/global-upgrade.ts
|
|
45
45
|
import { existsSync } from "fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureCodexTrustsPusharyHooks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RHIKMNWJ.js";
|
|
4
4
|
import {
|
|
5
5
|
detectClaudeVersion
|
|
6
6
|
} from "./chunk-RIVNNBEK.js";
|
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
openCodeHookArgv,
|
|
13
13
|
openCodePluginDir,
|
|
14
14
|
openCodeWired
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ZGYO6OQE.js";
|
|
16
16
|
import {
|
|
17
17
|
addClaudeMcpServer,
|
|
18
18
|
addPusharyHooks,
|
|
19
19
|
addPusharyToolPermissions
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-K2EYK5RL.js";
|
|
21
21
|
import {
|
|
22
22
|
claudeUnprovenHolds,
|
|
23
23
|
claudeWired,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
codexWired,
|
|
26
26
|
geminiWired,
|
|
27
27
|
planHooks
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-A5U62Q6K.js";
|
|
29
29
|
import {
|
|
30
30
|
CLAUDE_HOOK_BINARY,
|
|
31
31
|
CLAUDE_HOOK_EVENTS,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
needsReregistration,
|
|
37
37
|
registrationSignatures,
|
|
38
38
|
supportedClaudeEvents
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-7RGEJOQS.js";
|
|
40
40
|
import {
|
|
41
41
|
formatVersion
|
|
42
42
|
} from "./chunk-6ICPEJY5.js";
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
registrationHolderOf,
|
|
60
60
|
resolveGlobalBinary,
|
|
61
61
|
vscodePluginMcp
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-QIODXPTP.js";
|
|
63
63
|
import {
|
|
64
64
|
readJsonSafe,
|
|
65
65
|
writeFileAtomic,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
} from "./chunk-AQFEP65J.js";
|
|
68
68
|
import {
|
|
69
69
|
isRecord
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-OH647UT3.js";
|
|
71
71
|
|
|
72
72
|
// src/reapply.ts
|
|
73
73
|
import { dirname, join } from "path";
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
addGeminiMcpServer,
|
|
4
4
|
removeGeminiMcpServer,
|
|
5
5
|
supportedClaudeEvents
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7RGEJOQS.js";
|
|
7
7
|
import {
|
|
8
8
|
CLAUDE_CODE_AGENT,
|
|
9
9
|
parseApplyPatchFiles
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GYP6DLA4.js";
|
|
11
11
|
import {
|
|
12
12
|
guardBinary,
|
|
13
13
|
guardBinaryRefusing,
|
|
14
14
|
holdBudgetOf,
|
|
15
15
|
isProtectedByScope,
|
|
16
16
|
registerHookEntry
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QIODXPTP.js";
|
|
18
18
|
import {
|
|
19
19
|
HOOK_LOCATOR_BINARY,
|
|
20
20
|
PHONE_ANSWERED_TOOLS,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
refusalOutput,
|
|
25
25
|
toToolLookup,
|
|
26
26
|
withHookHoldBudget
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-OH647UT3.js";
|
|
28
28
|
|
|
29
29
|
// src/claude-config.ts
|
|
30
30
|
import { join } from "path";
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_SESSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GYP6DLA4.js";
|
|
4
4
|
|
|
5
5
|
// src/answer.ts
|
|
6
|
-
var denyReasonFrom = (value, note) => {
|
|
7
|
-
const trimmed = note?.trim();
|
|
8
|
-
if (trimmed) return `Denied from your phone: ${trimmed}`;
|
|
9
|
-
return value && value !== "no" && value !== "yes" ? `Denied from your phone: ${value}` : "Denied via push notification";
|
|
10
|
-
};
|
|
11
6
|
var isDeferAnswer = (value) => value === "defer";
|
|
12
7
|
|
|
13
8
|
// src/session-notice.ts
|
|
@@ -38,7 +33,6 @@ var announceSubscriptionRequired = (upgradeUrl, sessionId) => {
|
|
|
38
33
|
};
|
|
39
34
|
|
|
40
35
|
export {
|
|
41
|
-
denyReasonFrom,
|
|
42
36
|
isDeferAnswer,
|
|
43
37
|
oncePerSession,
|
|
44
38
|
announceSubscriptionRequired
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QIODXPTP.js";
|
|
4
4
|
import {
|
|
5
5
|
readJsonSafe,
|
|
6
6
|
writeFileAtomic
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
serializeDeclinedAgents,
|
|
14
14
|
withDeclinedAgent,
|
|
15
15
|
withoutDeclinedAgent
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OH647UT3.js";
|
|
17
17
|
|
|
18
18
|
// src/declined-agents-file.ts
|
|
19
19
|
import { join } from "path";
|
|
@@ -102,7 +102,7 @@ var AGENTS = {
|
|
|
102
102
|
enforcement: "enforced",
|
|
103
103
|
connectVia: "Native hooks + MCP",
|
|
104
104
|
setupCommand: PUSHARY_SETUP_COMMAND,
|
|
105
|
-
enforcementDetail: "Shell, writes and
|
|
105
|
+
enforcementDetail: "Shell, writes, edits and MCP calls through native BeforeTool hooks."
|
|
106
106
|
},
|
|
107
107
|
hermes: {
|
|
108
108
|
...defaults,
|
|
@@ -333,6 +333,7 @@ var toToolLookup = (profile, toolName, toolInput, resolvePath = (path) => path)
|
|
|
333
333
|
var NO_AGENT_PROMPT_REASON = "Pushary needs an answer from the phone before this can run, and this agent has no approval prompt of its own here, so nothing ran. Ask the user, then try again.";
|
|
334
334
|
var DENIED_BY_PUSHARY_REASON = "Denied from Pushary.";
|
|
335
335
|
var SOLE_GATE_UNDECIDED_REASON = "Pushary could not decide on this call, so it did not run. Pushary is the only approval for this agent. Check that Pushary is signed in and online, then try again.";
|
|
336
|
+
var SOLE_GATE_SUBSCRIPTION_REASON = "Pushary needs an active subscription to approve this call, so it did not run. Pushary is the only approval for this agent. Renew Pushary, or disconnect this agent from Pushary.";
|
|
336
337
|
var SOLE_GATE_SIGNED_OUT_REASON = "Pushary is not signed in on this computer, so nothing can approve this call and it did not run. Sign in to Pushary, or disconnect this agent from Pushary.";
|
|
337
338
|
var UNCARRIED_ANSWER_REASON = "The answer from the phone cannot be passed to this agent, so the call did not run. Ask the question in chat instead.";
|
|
338
339
|
var renderAllowDenyDecision = (verdict) => {
|
|
@@ -1510,7 +1511,14 @@ var DATE_UTC_FLAG = "-u";
|
|
|
1510
1511
|
var isFlagToken = (token) => token.startsWith("-");
|
|
1511
1512
|
var isPrintOnlySed = (args) => args[0] === SED_QUIET_FLAG && SED_PRINT_ONLY_SCRIPT.test(args[1] ?? "") && !args.slice(2).some(isFlagToken);
|
|
1512
1513
|
var isReadOnlyDate = (args) => args.every((arg) => arg.startsWith(DATE_FORMAT_PREFIX) || arg === DATE_UTC_FLAG);
|
|
1513
|
-
var
|
|
1514
|
+
var PRINTF_TEXT_CONVERSION = /%(?:%|[-+ #0]*\d*(?:\.\d*)?[bcqs])/g;
|
|
1515
|
+
var PRINTF_CONVERSION_START = "%";
|
|
1516
|
+
var ARITHMETIC_SAFE_NUMBER = /^[-+]?(?:0[xX][0-9a-fA-F]+|\d+(?:\.\d+)?)$/;
|
|
1517
|
+
var printfAssignsNothing = (args) => args[0] === END_OF_OPTIONS || !isFlagToken(args[0] ?? "");
|
|
1518
|
+
var printfOperands = (args) => args[0] === END_OF_OPTIONS ? args.slice(1) : args;
|
|
1519
|
+
var convertsArgumentsOnlyAsText = (format) => !format.replace(PRINTF_TEXT_CONVERSION, "").includes(PRINTF_CONVERSION_START);
|
|
1520
|
+
var printfNeverEvaluatesAnArgument = ([format = "", ...values]) => convertsArgumentsOnlyAsText(format) || values.every((value) => ARITHMETIC_SAFE_NUMBER.test(value));
|
|
1521
|
+
var isOutputOnlyPrintf = (args) => printfAssignsNothing(args) && printfNeverEvaluatesAnArgument(printfOperands(args));
|
|
1514
1522
|
var READ_ONLY_SEGMENT_SEPARATOR = /&&|\|\||[;|]/g;
|
|
1515
1523
|
var PIPELINE_CHAIN_SEPARATOR = /&&|\|\||;/g;
|
|
1516
1524
|
var EXPANSION_THAT_CAN_BECOME_A_FLAG = /\$|(?:^|\s)[*?[]/;
|
|
@@ -2125,9 +2133,19 @@ var SETTLED_OUTCOME = {
|
|
|
2125
2133
|
deny: "deny"
|
|
2126
2134
|
};
|
|
2127
2135
|
var isSettledOutcome = (value) => typeof value === "string" && SETTLED_OUTCOMES.includes(value);
|
|
2128
|
-
var
|
|
2129
|
-
var
|
|
2130
|
-
var
|
|
2136
|
+
var APPROVE_ANSWER = "yes";
|
|
2137
|
+
var DENY_ANSWER = "no";
|
|
2138
|
+
var DEFER_ANSWER = "defer";
|
|
2139
|
+
var PHONE_DENIAL_PREFIX = "Denied from your phone: ";
|
|
2140
|
+
var PHONE_DENIAL_REASON = "Denied via push notification";
|
|
2141
|
+
var denyReasonFrom = (value, note) => {
|
|
2142
|
+
const trimmed = note?.trim();
|
|
2143
|
+
if (trimmed) return `${PHONE_DENIAL_PREFIX}${trimmed}`;
|
|
2144
|
+
return value && value !== DENY_ANSWER && value !== APPROVE_ANSWER ? `${PHONE_DENIAL_PREFIX}${value}` : PHONE_DENIAL_REASON;
|
|
2145
|
+
};
|
|
2146
|
+
var APPROVE_RESPONSES = /* @__PURE__ */ new Set([APPROVE_ANSWER, "approve", "approved"]);
|
|
2147
|
+
var DENY_RESPONSES = /* @__PURE__ */ new Set([DENY_ANSWER, "deny", "denied", "reject", "rejected"]);
|
|
2148
|
+
var DEFER_RESPONSES = /* @__PURE__ */ new Set([DEFER_ANSWER]);
|
|
2131
2149
|
var classifyConfirmResponse = (response) => {
|
|
2132
2150
|
const normalized = (response ?? "").trim().toLowerCase();
|
|
2133
2151
|
if (APPROVE_RESPONSES.has(normalized)) return "approve";
|
|
@@ -2590,6 +2608,7 @@ var SCOPE_BATCH_REASON = "This patch exceeds the agreed scope. Split it into sin
|
|
|
2590
2608
|
var unapprovedScopeReason = (scopeReason) => `${scopeReason}. Nobody approved this path, so the change was refused.`;
|
|
2591
2609
|
var NO_RESPONSE_REASON = "No response within timeout";
|
|
2592
2610
|
var codexRaisesItsOwnPrompts = (permissionMode) => permissionMode !== "bypassPermissions";
|
|
2611
|
+
var codexHasNoPromptOfItsOwn = (scopeReason, permissionMode) => scopeReason !== void 0 || !codexRaisesItsOwnPrompts(permissionMode);
|
|
2593
2612
|
var CODEX_ASK_PASSES = { kind: "pass" };
|
|
2594
2613
|
var CODEX_ASK_UNANSWERED = { kind: "deny", reason: NO_RESPONSE_REASON };
|
|
2595
2614
|
var timeoutActionApplies = (ask) => ask.mode === "push_only" && ask.fullWindowServed;
|
|
@@ -2598,6 +2617,8 @@ var codexUnansweredPreToolUse = (ask) => {
|
|
|
2598
2617
|
if (timeoutActionApplies(ask) && ask.timeoutAction === "deny") return CODEX_ASK_UNANSWERED;
|
|
2599
2618
|
return codexRaisesItsOwnPrompts(ask.permissionMode) ? CODEX_ASK_PASSES : CODEX_ASK_UNANSWERED;
|
|
2600
2619
|
};
|
|
2620
|
+
var CODEX_DEFER_WITHOUT_A_PROMPT = { kind: "deny", reason: NO_AGENT_PROMPT_REASON };
|
|
2621
|
+
var codexDeferredPreToolUse = (agentPromptFollows) => agentPromptFollows ? CODEX_ASK_PASSES : CODEX_DEFER_WITHOUT_A_PROMPT;
|
|
2601
2622
|
var isScopeReason = (scopeReason) => typeof scopeReason === "string" && scopeReason.length > 0;
|
|
2602
2623
|
var scopeBreachReasonOf = (verdict) => verdict.kind === "gate" && isScopeReason(verdict.scopeReason) ? verdict.scopeReason : void 0;
|
|
2603
2624
|
var onlyCodexPreToolUseCanAsk = (verdict, permissionMode) => verdict.kind === "gate" && (scopeBreachReasonOf(verdict) !== void 0 || !codexRaisesItsOwnPrompts(permissionMode));
|
|
@@ -2679,6 +2700,7 @@ var modeStateFromResponse = (data) => {
|
|
|
2679
2700
|
};
|
|
2680
2701
|
var GATE_WIRE = 1;
|
|
2681
2702
|
var GATE_MAX_TOOL_INPUTS = 32;
|
|
2703
|
+
var GATE_PERMISSION_MODE_MAX_LENGTH = 64;
|
|
2682
2704
|
var GATE_BLOCK_REASON_MAX_LENGTH = 200;
|
|
2683
2705
|
var wireVerdictFor = (verdict, deadlineSeconds) => {
|
|
2684
2706
|
switch (verdict.kind) {
|
|
@@ -3142,6 +3164,7 @@ export {
|
|
|
3142
3164
|
canonicalToolName,
|
|
3143
3165
|
toToolLookup,
|
|
3144
3166
|
SOLE_GATE_UNDECIDED_REASON,
|
|
3167
|
+
SOLE_GATE_SUBSCRIPTION_REASON,
|
|
3145
3168
|
SOLE_GATE_SIGNED_OUT_REASON,
|
|
3146
3169
|
renderPreToolUseVerdict,
|
|
3147
3170
|
pusharyMissingReason,
|
|
@@ -3212,6 +3235,7 @@ export {
|
|
|
3212
3235
|
ASK_AGENT_NAME_MAX,
|
|
3213
3236
|
truncateLine,
|
|
3214
3237
|
isAnswerSource,
|
|
3238
|
+
denyReasonFrom,
|
|
3215
3239
|
classifyConfirmResponse,
|
|
3216
3240
|
buildDecisionEpisodeFeatures,
|
|
3217
3241
|
resolveAutoResolveOrigin,
|
|
@@ -3234,8 +3258,9 @@ export {
|
|
|
3234
3258
|
SCOPE_BATCH_REASON,
|
|
3235
3259
|
unapprovedScopeReason,
|
|
3236
3260
|
NO_RESPONSE_REASON,
|
|
3237
|
-
|
|
3261
|
+
codexHasNoPromptOfItsOwn,
|
|
3238
3262
|
codexUnansweredPreToolUse,
|
|
3263
|
+
codexDeferredPreToolUse,
|
|
3239
3264
|
scopeBreachReasonOf,
|
|
3240
3265
|
codexCallNeedsAPerson,
|
|
3241
3266
|
claudePermissionRulesFromSettings,
|
|
@@ -3245,6 +3270,7 @@ export {
|
|
|
3245
3270
|
modeStateFromResponse,
|
|
3246
3271
|
GATE_WIRE,
|
|
3247
3272
|
GATE_MAX_TOOL_INPUTS,
|
|
3273
|
+
GATE_PERMISSION_MODE_MAX_LENGTH,
|
|
3248
3274
|
GATE_BLOCK_REASON_MAX_LENGTH,
|
|
3249
3275
|
wireVerdictFor,
|
|
3250
3276
|
machineDecisionFor,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerTranscript
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AV5VX7OK.js";
|
|
4
4
|
import {
|
|
5
5
|
namedEvent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-K2EYK5RL.js";
|
|
7
7
|
import {
|
|
8
8
|
writeDegraded
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4GKQDFH6.js";
|
|
10
10
|
import {
|
|
11
11
|
claudeShapedHookInput,
|
|
12
12
|
hookCompatibleProfileBySource
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OH647UT3.js";
|
|
14
14
|
|
|
15
15
|
// src/tool-hook-input.ts
|
|
16
16
|
var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode"];
|
|
@@ -3,27 +3,27 @@ import {
|
|
|
3
3
|
expectedLaunchCapabilities,
|
|
4
4
|
hasSpawnProvider,
|
|
5
5
|
resolveControlPolicy
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7J2AX5T6.js";
|
|
7
7
|
import {
|
|
8
8
|
daemonHasRemoteProof,
|
|
9
9
|
daemonServiceManagerAvailable,
|
|
10
10
|
hasDaemonServiceDefinition,
|
|
11
11
|
readDaemonNeedsLogin,
|
|
12
12
|
readDaemonStatus
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SSWK2WYX.js";
|
|
14
14
|
import {
|
|
15
15
|
readControlMode,
|
|
16
16
|
readKeySource
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AQ3TSQA2.js";
|
|
18
18
|
import {
|
|
19
19
|
getMachineId
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-EDN4F6GX.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OQPEHKH2.js";
|
|
24
24
|
import {
|
|
25
25
|
getPackageVersion
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-OH647UT3.js";
|
|
27
27
|
|
|
28
28
|
// src/machines.ts
|
|
29
29
|
import { hostname } from "os";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
isReleaseVersion,
|
|
14
14
|
ownPackageName,
|
|
15
15
|
withHookHoldBudget
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OH647UT3.js";
|
|
17
17
|
|
|
18
18
|
// src/setup/paths.ts
|
|
19
19
|
import { homedir as homedir2 } from "os";
|
|
@@ -395,9 +395,9 @@ var installGlobally = (options) => {
|
|
|
395
395
|
}
|
|
396
396
|
const started = (async () => {
|
|
397
397
|
if (!npmIsOnPath()) throw new NpmMissingError();
|
|
398
|
-
const { withUpgradeLock } = await import("./global-upgrade-
|
|
399
|
-
const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-
|
|
400
|
-
const { autoUpdateLock: autoUpdateLock2 } = await import("./paths-
|
|
398
|
+
const { withUpgradeLock } = await import("./global-upgrade-SKY7A3SI.js");
|
|
399
|
+
const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-AYW3TB7X.js");
|
|
400
|
+
const { autoUpdateLock: autoUpdateLock2 } = await import("./paths-XUUEK7OU.js");
|
|
401
401
|
let result = "skipped";
|
|
402
402
|
const install = async () => {
|
|
403
403
|
const platform = process.platform;
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
codexHooksJsonIn,
|
|
9
9
|
isPusharyCodexCommand,
|
|
10
10
|
resolvePathBinary
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QIODXPTP.js";
|
|
12
12
|
import {
|
|
13
13
|
getPackageVersion
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OH647UT3.js";
|
|
15
15
|
|
|
16
16
|
// src/codex-app-server.ts
|
|
17
17
|
import { existsSync, realpathSync } from "fs";
|
|
@@ -2,25 +2,25 @@ import {
|
|
|
2
2
|
SIGNED_OUT_ON_MAC_MESSAGE,
|
|
3
3
|
describeSignedOutKey,
|
|
4
4
|
readSignedOutDiagnosis
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-SLBO7PHS.js";
|
|
6
6
|
import {
|
|
7
7
|
createIo
|
|
8
8
|
} from "./chunk-FO3MDD26.js";
|
|
9
9
|
import {
|
|
10
10
|
readKeySource
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-AQ3TSQA2.js";
|
|
12
12
|
import {
|
|
13
13
|
absoluteUrl,
|
|
14
14
|
checkApiKey,
|
|
15
15
|
describeKeyCheck,
|
|
16
16
|
keyCheckFromResponse
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-Z4UDB7EC.js";
|
|
18
18
|
import {
|
|
19
19
|
EXIT
|
|
20
20
|
} from "./chunk-KZERVKTD.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OQPEHKH2.js";
|
|
24
24
|
|
|
25
25
|
// src/cli/report-key.ts
|
|
26
26
|
var { dim, yellow } = createIo();
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
keyPrefix,
|
|
5
5
|
readConfigFileKey,
|
|
6
6
|
readMacAppKeyPrefix
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AQ3TSQA2.js";
|
|
8
8
|
import {
|
|
9
9
|
NPX_LATEST_COMMAND
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LEQRIJ4H.js";
|
|
11
11
|
|
|
12
12
|
// src/key-signed-out.ts
|
|
13
13
|
var VERDICT_BY_CHECK = {
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-XHKBHWLX.js";
|
|
5
5
|
import {
|
|
6
6
|
readControlMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AQ3TSQA2.js";
|
|
8
8
|
import {
|
|
9
9
|
getMachineId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EDN4F6GX.js";
|
|
11
11
|
import {
|
|
12
12
|
pusharyDir,
|
|
13
13
|
resolveGlobalBinary
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QIODXPTP.js";
|
|
15
15
|
import {
|
|
16
16
|
readJsonSafe,
|
|
17
17
|
writeFileAtomic,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./chunk-AQFEP65J.js";
|
|
21
21
|
import {
|
|
22
22
|
getApiKey
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OQPEHKH2.js";
|
|
24
24
|
import {
|
|
25
25
|
CLI_PACKAGE_NAMES,
|
|
26
26
|
cmdShimTarget,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
globalPackageFolder,
|
|
29
29
|
globalRootFor,
|
|
30
30
|
isRecord
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-OH647UT3.js";
|
|
32
32
|
|
|
33
33
|
// src/daemon-lifecycle.ts
|
|
34
34
|
import { dirname, join, win32 as win32Path } from "path";
|