@pushary/agent-hooks 1.9.14 → 1.9.16
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 +32 -0
- package/dist/bin/pushary-bell-hook.js +25 -25
- package/dist/bin/pushary-bell.js +10 -10
- package/dist/bin/pushary-claude.js +24 -24
- package/dist/bin/pushary-clean.js +29 -29
- package/dist/bin/pushary-codex-bridge.js +17 -17
- package/dist/bin/pushary-codex-hook.js +72 -48
- package/dist/bin/pushary-codex.js +12 -12
- package/dist/bin/pushary-connect.js +25 -25
- 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 +34 -34
- 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 +27 -27
- package/dist/bin/pushary-hook.js +29 -29
- package/dist/bin/pushary-login.js +13 -13
- package/dist/bin/pushary-logout.js +11 -11
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +13 -13
- package/dist/bin/pushary-notification-hook.js +24 -24
- package/dist/bin/pushary-opencode-hook.js +26 -26
- package/dist/bin/pushary-permission-denied-hook.js +29 -29
- package/dist/bin/pushary-permission-hook.js +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 +443 -117
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +27 -27
- package/dist/bin/pushary-stop-hook.js +24 -24
- package/dist/bin/pushary-stopfailure-hook.js +24 -24
- package/dist/bin/pushary-suggestions.js +13 -13
- 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 +13 -13
- package/dist/bin/pushary.js +10 -7
- package/dist/{chunk-EB6LH3U6.js → chunk-3DZG5EXY.js} +3 -3
- package/dist/{chunk-RMWV3MYN.js → chunk-4MOOSU5Y.js} +36 -25
- package/dist/{chunk-NNCK2PUR.js → chunk-4PQGFWPO.js} +2 -2
- package/dist/{chunk-VYXXAFIA.js → chunk-52JA2WTH.js} +1 -1
- package/dist/{chunk-2WWHZTI5.js → chunk-5ETPCIG4.js} +23 -4
- package/dist/{chunk-XJKM6NQS.js → chunk-65OI53N7.js} +6 -6
- package/dist/{chunk-42WYKVHL.js → chunk-7BNU5AVD.js} +2 -2
- package/dist/{chunk-3KHQWC4F.js → chunk-7DE5BZMB.js} +6 -6
- package/dist/{chunk-PWO6T7JG.js → chunk-7EBZRHIH.js} +5 -5
- package/dist/{chunk-NAROM5IR.js → chunk-AYV2NRYJ.js} +93 -2
- package/dist/{chunk-3U4R475X.js → chunk-BARUIIUR.js} +3 -3
- package/dist/{chunk-QD6GQDYW.js → chunk-COGQIULO.js} +1 -1
- package/dist/{chunk-Y6IKUCVF.js → chunk-CXXYHPN7.js} +2 -2
- package/dist/{chunk-2Q6IT5PR.js → chunk-DMJPRZVJ.js} +1 -1
- package/dist/{chunk-NMDGIMDV.js → chunk-DUDI3Z7F.js} +2 -2
- package/dist/{chunk-RV4U3LYL.js → chunk-EDEIIKCV.js} +3 -3
- package/dist/{chunk-H7MTFFNI.js → chunk-EDXJEQCK.js} +4 -4
- package/dist/{chunk-U4TMAANR.js → chunk-FO3MDD26.js} +4 -4
- package/dist/{chunk-5RONPCMH.js → chunk-HBDZYQZX.js} +5 -5
- package/dist/{chunk-4BXVGCPE.js → chunk-HDQAN2C3.js} +27 -8
- package/dist/{chunk-Q7JWY33N.js → chunk-HKSH4KWI.js} +3 -3
- package/dist/{chunk-OMR3P7PJ.js → chunk-ICEMM4H2.js} +14 -14
- package/dist/{chunk-WYPQKDKX.js → chunk-IHPSFUL2.js} +13 -18
- package/dist/{chunk-YSVCBUT3.js → chunk-ISJ5ROXM.js} +2 -2
- package/dist/{chunk-JHDHC2M7.js → chunk-J36EWRVL.js} +5 -5
- package/dist/{chunk-7MGNY7S3.js → chunk-JF2XRQR2.js} +1 -1
- package/dist/{chunk-2Z56BRTF.js → chunk-JNZU2F5B.js} +2 -2
- package/dist/{chunk-5UYAJVAQ.js → chunk-JQC7ZFHM.js} +1 -1
- package/dist/{chunk-LRZMGU7T.js → chunk-L52HDK35.js} +4 -4
- package/dist/{chunk-ZECHTK3K.js → chunk-LJJLMU5B.js} +3 -3
- package/dist/{chunk-34PUBGLS.js → chunk-LYEXTD64.js} +2 -2
- package/dist/{chunk-ARM4DMIL.js → chunk-MN2QJA7K.js} +1 -1
- package/dist/{chunk-5VP72OOI.js → chunk-NM6IHHRO.js} +8 -8
- package/dist/{chunk-CT4BJEU7.js → chunk-OEMDXBV6.js} +1 -1
- package/dist/{chunk-FKQMH2DW.js → chunk-OIAZ2QAC.js} +3 -2
- package/dist/{chunk-MSEUUAJ7.js → chunk-OLJ6YZME.js} +5 -5
- package/dist/{chunk-AJRT3JGE.js → chunk-PJNZJPPX.js} +1 -1
- package/dist/{chunk-POJUUEGO.js → chunk-PVOOKOKX.js} +4 -4
- package/dist/{chunk-J5RQW52I.js → chunk-PYPZ3MYC.js} +2 -2
- package/dist/{chunk-7SIZISYH.js → chunk-PZ33VQ54.js} +5 -5
- package/dist/{chunk-LETLRKSY.js → chunk-QINDG6HO.js} +1 -1
- package/dist/{chunk-DVTXGXXL.js → chunk-QIOWXUFH.js} +1 -1
- package/dist/{chunk-NXJNYAP7.js → chunk-QJYBHKHO.js} +1 -1
- package/dist/{chunk-2A234H3F.js → chunk-R2FHKTD3.js} +3 -3
- package/dist/{chunk-CIZQARGJ.js → chunk-S2LU6HIZ.js} +3 -3
- package/dist/{chunk-ZSL7B7NF.js → chunk-VKYDON4A.js} +2 -2
- package/dist/{chunk-ECU2Y7D2.js → chunk-W2AUU35K.js} +2 -2
- package/dist/{chunk-2QASSTM5.js → chunk-WVSECXIM.js} +2 -2
- package/dist/{chunk-3XAUHY35.js → chunk-WWTB4DAE.js} +1 -1
- package/dist/{chunk-ZVFKNSRX.js → chunk-XIJMMY6M.js} +1 -1
- package/dist/{chunk-2NIBBM3N.js → chunk-YHHUYJQN.js} +2 -2
- package/dist/{chunk-K2IUMMZJ.js → chunk-YKYFFCB5.js} +1 -1
- package/dist/{chunk-APG7IAUK.js → chunk-ZH74RRGM.js} +1 -1
- package/dist/{chunk-SEQSZYLW.js → chunk-ZOMVMLMU.js} +10 -15
- package/dist/{global-upgrade-P5CJ22AW.js → global-upgrade-4XWM5RXK.js} +6 -6
- package/dist/{paths-XZE2MPTP.js → paths-2RE6MBKF.js} +2 -2
- package/dist/{reapply-V4GMKCGP.js → reapply-Y5PSM7U7.js} +20 -20
- package/dist/src/index.js +19 -19
- package/dist/{upgrade-lock-DQF62B6X.js → upgrade-lock-HVWZN4BZ.js} +3 -3
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PVOOKOKX.js";
|
|
4
4
|
import {
|
|
5
5
|
hookOwnerOf,
|
|
6
6
|
hookOwnerOfCommands,
|
|
7
7
|
liveBridgeProbe,
|
|
8
8
|
resolveBridgeStub
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZOMVMLMU.js";
|
|
10
10
|
import {
|
|
11
11
|
AGENT_CHOICES
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YKYFFCB5.js";
|
|
13
13
|
import {
|
|
14
14
|
claudeSettings,
|
|
15
15
|
codexHooksJson,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
guardedArgv,
|
|
19
19
|
pusharyDir,
|
|
20
20
|
vscodePluginDir
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-5ETPCIG4.js";
|
|
22
22
|
import {
|
|
23
23
|
readJsonSafe
|
|
24
24
|
} from "./chunk-T7E75EKA.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
HOOK_LOCATOR_BINARY,
|
|
29
29
|
OPENCODE_APPROVAL_EVENT,
|
|
30
30
|
hookCompatibleProfile
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-AYV2NRYJ.js";
|
|
32
32
|
|
|
33
33
|
// src/opencode-plugin.ts
|
|
34
34
|
var OPENCODE_PLUGIN_MARKER = "pushary-opencode-plugin w1";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MCP_BRIDGE_BINARY
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WVSECXIM.js";
|
|
4
4
|
import {
|
|
5
5
|
KEY_FILE_MODE
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DUDI3Z7F.js";
|
|
7
7
|
import {
|
|
8
|
-
NpmMissingError
|
|
9
|
-
|
|
8
|
+
NpmMissingError,
|
|
9
|
+
NpmPermissionError
|
|
10
|
+
} from "./chunk-5ETPCIG4.js";
|
|
10
11
|
import {
|
|
11
12
|
readJsonSafe,
|
|
12
13
|
writeFileAtomic,
|
|
@@ -14,7 +15,7 @@ import {
|
|
|
14
15
|
} from "./chunk-T7E75EKA.js";
|
|
15
16
|
import {
|
|
16
17
|
NPX_LATEST_COMMAND
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-OIAZ2QAC.js";
|
|
18
19
|
|
|
19
20
|
// src/instruction-file.ts
|
|
20
21
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync } from "fs";
|
|
@@ -472,21 +473,37 @@ var AgentConfigError = class extends Error {
|
|
|
472
473
|
var configFailureKind = (readFailure) => readFailure === "unparseable" ? "config-unparseable" : "config-unreadable";
|
|
473
474
|
var AGENT_FAILURE_DETAILS = {
|
|
474
475
|
"not-wired": "reported success but its config is not there.",
|
|
475
|
-
"app-account-mismatch": "Mac
|
|
476
|
+
"app-account-mismatch": "Pushary for Mac set it up with an account that does not match this setup, so it was left as it is."
|
|
477
|
+
};
|
|
478
|
+
var DESCRIBED_FAILURE_REMEDIES = {
|
|
479
|
+
"not-wired": "retry-agent",
|
|
480
|
+
"app-account-mismatch": "match-mac-account"
|
|
476
481
|
};
|
|
477
482
|
var describedAgentFailure = (agent, kind) => ({
|
|
478
483
|
agent,
|
|
479
484
|
kind,
|
|
480
485
|
detail: AGENT_FAILURE_DETAILS[kind],
|
|
481
|
-
remedy:
|
|
486
|
+
remedy: DESCRIBED_FAILURE_REMEDIES[kind]
|
|
482
487
|
});
|
|
488
|
+
var remedyForError = (error) => {
|
|
489
|
+
if (error instanceof NpmMissingError) return "install-node";
|
|
490
|
+
if (error instanceof NpmPermissionError) return "fix-npm-prefix";
|
|
491
|
+
return "retry-agent";
|
|
492
|
+
};
|
|
483
493
|
var agentFailureFromError = (agent, error, describeError) => ({
|
|
484
494
|
agent,
|
|
485
495
|
kind: error instanceof AgentConfigError ? error.kind : "installer-error",
|
|
486
496
|
detail: describeError(error),
|
|
487
|
-
remedy: error
|
|
497
|
+
remedy: remedyForError(error)
|
|
488
498
|
});
|
|
489
499
|
var retryAgentCommand = (agent) => `${NPX_LATEST_COMMAND} setup --agents ${agent}`;
|
|
500
|
+
var takeOverHooksCommand = (agent) => `${retryAgentCommand(agent)} --take-over-hooks`;
|
|
501
|
+
var matchMacAccountStep = (agent, setupAccount) => `Sign Pushary for Mac into ${setupAccount ?? "this setup's account"}, or run ${takeOverHooksCommand(agent)}`;
|
|
502
|
+
var UNCHECKED_ACCOUNT = "an account that could not be checked";
|
|
503
|
+
var describeMacAccountMismatch = (mismatch) => [
|
|
504
|
+
`${mismatch.agentName}: Pushary for Mac uses ${mismatch.macAccount ?? UNCHECKED_ACCOUNT}. This setup uses ${mismatch.setupAccount ?? UNCHECKED_ACCOUNT}.`,
|
|
505
|
+
matchMacAccountStep(mismatch.agent, mismatch.setupAccount)
|
|
506
|
+
];
|
|
490
507
|
var REMAINING_AGENTS_CONTINUE = "Other agents will continue. Re-run setup to retry.";
|
|
491
508
|
var afterAgentFailureNote = (agentsStillToSetUp) => agentsStillToSetUp > 0 ? REMAINING_AGENTS_CONTINUE : null;
|
|
492
509
|
var failedAgentsContext = (configuredAgentNames) => configuredAgentNames.length > 0 ? `(configured: ${configuredAgentNames.join(", ")})` : null;
|
|
@@ -626,6 +643,8 @@ export {
|
|
|
626
643
|
describedAgentFailure,
|
|
627
644
|
agentFailureFromError,
|
|
628
645
|
retryAgentCommand,
|
|
646
|
+
matchMacAccountStep,
|
|
647
|
+
describeMacAccountMismatch,
|
|
629
648
|
afterAgentFailureNote,
|
|
630
649
|
failedAgentsContext,
|
|
631
650
|
agentFailureWire,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile,
|
|
3
3
|
hasCompatibleHooks
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PVOOKOKX.js";
|
|
5
5
|
import {
|
|
6
6
|
pusharyHookExecutable
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZOMVMLMU.js";
|
|
8
8
|
import {
|
|
9
9
|
isProtectedByScope,
|
|
10
10
|
registerHookEntry
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5ETPCIG4.js";
|
|
12
12
|
|
|
13
13
|
// src/cursor-config.ts
|
|
14
14
|
var hookCommandOf = (entry) => {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defersToNativeMode,
|
|
3
3
|
reportMachineDenial
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7BNU5AVD.js";
|
|
5
5
|
import {
|
|
6
6
|
isGatingMoment,
|
|
7
7
|
recordKeylessMoment
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WWTB4DAE.js";
|
|
9
9
|
import {
|
|
10
10
|
announceSubscriptionRequired,
|
|
11
11
|
denyReasonFrom,
|
|
12
12
|
isDeferAnswer,
|
|
13
13
|
oncePerSession
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MN2QJA7K.js";
|
|
15
15
|
import {
|
|
16
16
|
activeHookSource,
|
|
17
17
|
activeIdentity
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-PVOOKOKX.js";
|
|
19
19
|
import {
|
|
20
20
|
DEFAULT_SESSION,
|
|
21
21
|
UNNAMED_ACTION,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
reportEvent,
|
|
41
41
|
scopePathFor,
|
|
42
42
|
settleQuestionsForToolUse
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-IHPSFUL2.js";
|
|
44
44
|
import {
|
|
45
45
|
askUser,
|
|
46
46
|
cancelQuestion,
|
|
@@ -51,26 +51,27 @@ import {
|
|
|
51
51
|
requestGate,
|
|
52
52
|
sendNotification,
|
|
53
53
|
waitForQuestion
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-7EBZRHIH.js";
|
|
55
55
|
import {
|
|
56
56
|
SubscriptionRequiredError
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-S2LU6HIZ.js";
|
|
58
58
|
import {
|
|
59
59
|
getMachineId
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-XIJMMY6M.js";
|
|
61
61
|
import {
|
|
62
62
|
getApiKey,
|
|
63
63
|
getBaseUrl
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-PJNZJPPX.js";
|
|
65
65
|
import {
|
|
66
66
|
NPX_LATEST_COMMAND
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-OIAZ2QAC.js";
|
|
68
68
|
import {
|
|
69
69
|
AGENT_QUESTION_STRATEGY,
|
|
70
70
|
DECISION_STOP_REASON,
|
|
71
71
|
GATE_BLOCK_REASON_MAX_LENGTH,
|
|
72
72
|
GATE_WIRE,
|
|
73
73
|
PLAN_DECLINED_REASON,
|
|
74
|
+
SCOPE_BATCH_REASON,
|
|
74
75
|
SOLE_GATE_SIGNED_OUT_REASON,
|
|
75
76
|
SOLE_GATE_UNDECIDED_REASON,
|
|
76
77
|
UNVERIFIABLE_APPROVAL_REASON,
|
|
@@ -102,7 +103,7 @@ import {
|
|
|
102
103
|
parseAgentQuestions,
|
|
103
104
|
questionHandedToTheTerminal,
|
|
104
105
|
resolveGate
|
|
105
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-AYV2NRYJ.js";
|
|
106
107
|
|
|
107
108
|
// src/claude-permission-rules.ts
|
|
108
109
|
import { readFileSync, statSync } from "fs";
|
|
@@ -545,7 +546,6 @@ var claudeGateInput = (modeState, config, input, canonical) => {
|
|
|
545
546
|
};
|
|
546
547
|
};
|
|
547
548
|
var unreadableReason = "Pushary could not read every target of this call. Use a supported command or a single-file edit.";
|
|
548
|
-
var batchScopeReason = "This patch exceeds the agreed scope. Split it into single-file edits so each additional path can be approved.";
|
|
549
549
|
var BLOCKED_ACTION_GATE_TIMEOUT_MS = 15e3;
|
|
550
550
|
var BLOCKED_ACTION_CLAIM_TIMEOUT_MS = 4e3;
|
|
551
551
|
var BLOCKED_ACTION_ALLOW_REASON = "Approved from Pushary after auto mode blocked it";
|
|
@@ -616,7 +616,7 @@ var handlePreToolUse = async (input, canonical) => {
|
|
|
616
616
|
return deny(verdict.reason);
|
|
617
617
|
}
|
|
618
618
|
if (canonical === null) return deny(unreadableReason);
|
|
619
|
-
if (verdict.kind === "gate" && verdict.scopeReason && (canonical?.toolInputs.length ?? 0) > 1) return deny(
|
|
619
|
+
if (verdict.kind === "gate" && verdict.scopeReason && (canonical?.toolInputs.length ?? 0) > 1) return deny(SCOPE_BATCH_REASON);
|
|
620
620
|
if (agentQuestionStrategy(ACTIVE_SOURCE, "PreToolUse", input.tool_name) === AGENT_QUESTION_STRATEGY.native) return void 0;
|
|
621
621
|
if (input.tool_name === "AskUserQuestion") {
|
|
622
622
|
return handleAskUserQuestion(apiKey, input, modeState);
|
|
@@ -683,7 +683,7 @@ var handlePermissionRequest = async (input, canonical) => {
|
|
|
683
683
|
}
|
|
684
684
|
if (canonical === null) return permReqDeny(unreadableReason);
|
|
685
685
|
if (agentQuestionStrategy(ACTIVE_SOURCE, "PermissionRequest", input.tool_name) === AGENT_QUESTION_STRATEGY.native) return void 0;
|
|
686
|
-
if (verdict.kind === "gate" && verdict.scopeReason && (canonical?.toolInputs.length ?? 0) > 1) return permReqDeny(
|
|
686
|
+
if (verdict.kind === "gate" && verdict.scopeReason && (canonical?.toolInputs.length ?? 0) > 1) return permReqDeny(SCOPE_BATCH_REASON);
|
|
687
687
|
if (!(verdict.kind === "gate" && verdict.scopeReason) && !claudeAllowlistOwnsCall(gateInput, verdict, input.permission_mode, claudeRules) && isPermissionRequestOwnedByPreToolUse(input.tool_name, input.permission_mode, shouldDeferToNativeMode)) return void 0;
|
|
688
688
|
switch (verdict.kind) {
|
|
689
689
|
case "allow":
|
|
@@ -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-52JA2WTH.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-7EBZRHIH.js";
|
|
14
14
|
import {
|
|
15
15
|
withRetry
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-S2LU6HIZ.js";
|
|
17
17
|
import {
|
|
18
18
|
getMachineId
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-XIJMMY6M.js";
|
|
20
20
|
import {
|
|
21
21
|
reportedInstallSource
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-VKYDON4A.js";
|
|
23
23
|
import {
|
|
24
24
|
canonicalJson
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-5ETPCIG4.js";
|
|
26
26
|
import {
|
|
27
27
|
writeFileAtomic
|
|
28
28
|
} from "./chunk-T7E75EKA.js";
|
|
29
29
|
import {
|
|
30
30
|
getApiKey,
|
|
31
31
|
getBaseUrl
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-PJNZJPPX.js";
|
|
33
33
|
import {
|
|
34
34
|
ACTION_BODY_MAX,
|
|
35
35
|
AGENT_LABELS_BY_TYPE,
|
|
@@ -50,6 +50,7 @@ import {
|
|
|
50
50
|
localRepoKey,
|
|
51
51
|
modeStateFromResponse,
|
|
52
52
|
normalizeRepoRemote,
|
|
53
|
+
parseMcpToolName,
|
|
53
54
|
pendingCommandEvents,
|
|
54
55
|
redactSecrets,
|
|
55
56
|
redactSecretsDeep,
|
|
@@ -58,7 +59,7 @@ import {
|
|
|
58
59
|
resolvePolicy,
|
|
59
60
|
toToolLookup,
|
|
60
61
|
truncateLine
|
|
61
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-AYV2NRYJ.js";
|
|
62
63
|
|
|
63
64
|
// ../hook-mapping/src/describe.ts
|
|
64
65
|
import { isAbsolute, relative, resolve } from "path";
|
|
@@ -105,14 +106,6 @@ var eventPrefixes = {
|
|
|
105
106
|
Task: (input) => `ran subagent: ${describeTaskCall(input)}`,
|
|
106
107
|
WebSearch: (input) => `searched: ${firstString(input.query) ?? "the web"}`
|
|
107
108
|
};
|
|
108
|
-
var MCP_TOOL_PREFIX = "mcp__";
|
|
109
|
-
var parseMcpToolName = (toolName) => {
|
|
110
|
-
if (!toolName.startsWith(MCP_TOOL_PREFIX)) return void 0;
|
|
111
|
-
const rest = toolName.slice(MCP_TOOL_PREFIX.length);
|
|
112
|
-
const split = rest.indexOf("__");
|
|
113
|
-
if (split <= 0 || split + 2 >= rest.length) return void 0;
|
|
114
|
-
return { server: rest.slice(0, split), tool: rest.slice(split + 2) };
|
|
115
|
-
};
|
|
116
109
|
var NETWORK_TARGET_KEYS = ["url", "urls", "href", "host", "hosts", "hostname", "domain", "domains"];
|
|
117
110
|
var ABSOLUTE_HTTP_URL = /^https?:\/\//i;
|
|
118
111
|
var HOSTNAME = /^(?=.{1,253}$)[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+(?::\d{1,5})?$/i;
|
|
@@ -199,12 +192,12 @@ var parseApplyPatchOps = (command) => {
|
|
|
199
192
|
if (typeof command !== "string") return [];
|
|
200
193
|
const ops = [];
|
|
201
194
|
for (const line of command.split("\n")) {
|
|
202
|
-
const file = line.match(
|
|
195
|
+
const file = line.match(/^\s*\*\*\*\s+(Add|Update|Delete) File:\s+(.+?)\s*$/);
|
|
203
196
|
if (file) {
|
|
204
197
|
ops.push({ op: file[1].toLowerCase(), path: file[2] });
|
|
205
198
|
continue;
|
|
206
199
|
}
|
|
207
|
-
const move = line.match(
|
|
200
|
+
const move = line.match(/^\s*\*\*\*\s+Move to:\s+(.+?)\s*$/);
|
|
208
201
|
if (move) ops.push({ op: "move", path: move[1] });
|
|
209
202
|
}
|
|
210
203
|
return ops;
|
|
@@ -1365,6 +1358,7 @@ var toCodexWire = (event, decision) => {
|
|
|
1365
1358
|
decision.kind === "deny" ? decision.reason : void 0
|
|
1366
1359
|
) ?? null;
|
|
1367
1360
|
};
|
|
1361
|
+
var patchDeletesFiles = (toolName, toolInput) => toolName === "apply_patch" && parseApplyPatchOps(toolInput.command).some((entry) => entry.op === "delete");
|
|
1368
1362
|
var describeApplyPatch = (command) => {
|
|
1369
1363
|
const ops = parseApplyPatchOps(command);
|
|
1370
1364
|
if (ops.length === 0) return null;
|
|
@@ -2285,6 +2279,7 @@ export {
|
|
|
2285
2279
|
codexDeny,
|
|
2286
2280
|
codexPass,
|
|
2287
2281
|
toCodexWire,
|
|
2282
|
+
patchDeletesFiles,
|
|
2288
2283
|
describeApplyPatch,
|
|
2289
2284
|
toPolicyLookup,
|
|
2290
2285
|
toPolicyLookups,
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
codexHooksJsonIn,
|
|
9
9
|
isPusharyCodexCommand,
|
|
10
10
|
resolvePathBinary
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5ETPCIG4.js";
|
|
12
12
|
import {
|
|
13
13
|
getPackageVersion
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-AYV2NRYJ.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-PYPZ3MYC.js";
|
|
6
6
|
import {
|
|
7
7
|
createIo
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FO3MDD26.js";
|
|
9
9
|
import {
|
|
10
10
|
readKeySource
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DUDI3Z7F.js";
|
|
12
12
|
import {
|
|
13
13
|
absoluteUrl,
|
|
14
14
|
checkApiKey,
|
|
15
15
|
describeKeyCheck,
|
|
16
16
|
keyCheckFromResponse
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-BARUIIUR.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-PJNZJPPX.js";
|
|
24
24
|
|
|
25
25
|
// src/cli/report-key.ts
|
|
26
26
|
var { dim, yellow } = createIo();
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-POFBE6ZY.js";
|
|
4
4
|
import {
|
|
5
5
|
autoUpdateState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5ETPCIG4.js";
|
|
7
7
|
import {
|
|
8
8
|
readJsonSafe,
|
|
9
9
|
writeJsonAtomic
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
cliPackagePathSegments,
|
|
15
15
|
globalUpgradeEntry,
|
|
16
16
|
ownPackageRoot
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AYV2NRYJ.js";
|
|
18
18
|
|
|
19
19
|
// src/auto-update.ts
|
|
20
20
|
import { spawn } from "child_process";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerTranscript
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NM6IHHRO.js";
|
|
4
4
|
import {
|
|
5
5
|
namedEvent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PVOOKOKX.js";
|
|
7
7
|
import {
|
|
8
8
|
writeDegraded
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7EBZRHIH.js";
|
|
10
10
|
import {
|
|
11
11
|
claudeShapedHookInput,
|
|
12
12
|
hookCompatibleProfileBySource
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-AYV2NRYJ.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"];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openCodeConfigDirFrom
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HBDZYQZX.js";
|
|
4
4
|
import {
|
|
5
5
|
codexHomeFrom,
|
|
6
6
|
resolvePathBinary
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5ETPCIG4.js";
|
|
8
8
|
import {
|
|
9
9
|
HOOK_COMPATIBLE_PROFILES
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AYV2NRYJ.js";
|
|
11
11
|
|
|
12
12
|
// src/hermes-config.ts
|
|
13
13
|
import { execFileSync } from "child_process";
|
|
@@ -6,38 +6,38 @@ import {
|
|
|
6
6
|
} from "./chunk-SGZJ5LYH.js";
|
|
7
7
|
import {
|
|
8
8
|
ensureDaemonRunning
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PZ33VQ54.js";
|
|
10
10
|
import {
|
|
11
11
|
buildTranscriptRecords,
|
|
12
12
|
decodePublicKey,
|
|
13
13
|
generateSessionKey,
|
|
14
14
|
wrapSessionKey
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QIOWXUFH.js";
|
|
16
16
|
import {
|
|
17
17
|
fetchTranscriptRecipients,
|
|
18
18
|
uploadTranscriptRecords
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-OEMDXBV6.js";
|
|
20
20
|
import {
|
|
21
21
|
transcriptEnvironmentPreference,
|
|
22
22
|
transcriptsEnabled
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-JF2XRQR2.js";
|
|
24
24
|
import {
|
|
25
25
|
hookOwnerOf
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-ZOMVMLMU.js";
|
|
27
27
|
import {
|
|
28
28
|
readTranscriptPreference
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-DUDI3Z7F.js";
|
|
30
30
|
import {
|
|
31
31
|
codexHome,
|
|
32
32
|
pusharyDir
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-5ETPCIG4.js";
|
|
34
34
|
import {
|
|
35
35
|
writeJsonAtomic
|
|
36
36
|
} from "./chunk-T7E75EKA.js";
|
|
37
37
|
import {
|
|
38
38
|
getApiKey,
|
|
39
39
|
getBaseUrl
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-PJNZJPPX.js";
|
|
41
41
|
|
|
42
42
|
// src/transcript-registration.ts
|
|
43
43
|
import { createHash } from "crypto";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DISCONNECT_AGENT_IDS,
|
|
3
3
|
SETUP_AGENT_CHOICES,
|
|
4
4
|
isApprovalMode
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AYV2NRYJ.js";
|
|
6
6
|
|
|
7
7
|
// src/cli/mode-request.ts
|
|
8
8
|
var parseDuration = (value) => {
|
|
@@ -33,7 +33,8 @@ var describeMode = (mode) => {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
// src/cli/commands.ts
|
|
36
|
-
var
|
|
36
|
+
var npxLatestCommandFor = (platform) => `${platform === "win32" ? "npx.cmd" : "npx"} pushary@latest`;
|
|
37
|
+
var NPX_LATEST_COMMAND = npxLatestCommandFor(process.platform);
|
|
37
38
|
var COMMAND_LIST = [
|
|
38
39
|
{
|
|
39
40
|
name: "cowork",
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
forkFinishWithUpgradeLock,
|
|
5
5
|
installWithUpgradeLock,
|
|
6
6
|
releaseAutoUpdateLock
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QINDG6HO.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-JNZU2F5B.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-5ETPCIG4.js";
|
|
31
31
|
import {
|
|
32
32
|
NPX_LATEST_COMMAND
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-OIAZ2QAC.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-AYV2NRYJ.js";
|
|
43
43
|
|
|
44
44
|
// src/global-upgrade.ts
|
|
45
45
|
import { existsSync } from "fs";
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
addGeminiMcpServer,
|
|
4
4
|
removeGeminiMcpServer,
|
|
5
5
|
supportedClaudeEvents
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EDEIIKCV.js";
|
|
7
7
|
import {
|
|
8
8
|
CLAUDE_CODE_AGENT,
|
|
9
9
|
parseApplyPatchFiles
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IHPSFUL2.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-5ETPCIG4.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-AYV2NRYJ.js";
|
|
28
28
|
|
|
29
29
|
// src/claude-config.ts
|
|
30
30
|
import { join } from "path";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
keyPrefix,
|
|
4
4
|
readConfigFileKey,
|
|
5
5
|
readMacAppKeyPrefix
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DUDI3Z7F.js";
|
|
7
7
|
import {
|
|
8
8
|
NPX_LATEST_COMMAND
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OIAZ2QAC.js";
|
|
10
10
|
|
|
11
11
|
// src/key-signed-out.ts
|
|
12
12
|
var VERDICT_BY_CHECK = {
|