@pushary/agent-hooks 1.9.59 → 1.9.60
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 +7 -0
- package/data/cursor-plugin/.cursor-plugin/plugin.json +5 -1
- package/data/cursor-plugin/CHANGELOG.md +4 -0
- package/dist/{api-UVJGNZIF.js → api-ASQA5PZM.js} +11 -11
- package/dist/bin/pushary-bell-hook.js +29 -29
- package/dist/bin/pushary-bell.js +12 -12
- package/dist/bin/pushary-claude.js +31 -30
- package/dist/bin/pushary-clean.js +58 -53
- package/dist/bin/pushary-codex-bridge.js +22 -22
- package/dist/bin/pushary-codex-hook.js +34 -34
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +15 -15
- package/dist/bin/pushary-connect.js +29 -29
- package/dist/bin/pushary-cowork.js +7 -7
- package/dist/bin/pushary-daemon.js +39 -39
- package/dist/bin/pushary-disconnect.js +42 -29
- package/dist/bin/pushary-doctor.js +51 -47
- package/dist/bin/pushary-elicitation-hook.js +29 -29
- package/dist/bin/pushary-gemini-bridge.js +15 -15
- package/dist/bin/pushary-gemini-hook.js +31 -31
- package/dist/bin/pushary-hook.js +33 -33
- package/dist/bin/pushary-login.js +22 -19
- package/dist/bin/pushary-logout.js +36 -31
- package/dist/bin/pushary-mcp.js +12 -12
- package/dist/bin/pushary-mode.js +41 -55
- package/dist/bin/pushary-notification-hook.js +28 -28
- package/dist/bin/pushary-opencode-hook.js +30 -30
- package/dist/bin/pushary-permission-denied-hook.js +33 -33
- package/dist/bin/pushary-permission-hook.js +32 -32
- 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 +35 -35
- package/dist/bin/pushary-setup.js +49 -46
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +41 -36
- package/dist/bin/pushary-stop-hook.js +28 -28
- package/dist/bin/pushary-stopfailure-hook.js +28 -28
- package/dist/bin/pushary-suggestions.js +33 -39
- package/dist/bin/pushary-transcript-register.js +20 -20
- package/dist/bin/pushary-transcripts.js +33 -20
- package/dist/bin/pushary-upgrade.js +71 -50
- package/dist/bin/pushary-wait.js +36 -42
- package/dist/bin/pushary.js +8 -8
- package/dist/{chunk-PVANKDWM.js → chunk-2AELPDMT.js} +1 -1
- package/dist/{chunk-US3IT6ZC.js → chunk-2QREHU4O.js} +11 -4
- package/dist/{chunk-W47WL6JY.js → chunk-33OOEVPG.js} +1 -1
- package/dist/{chunk-AS4Z6KS4.js → chunk-4MUFZU2G.js} +1 -1
- package/dist/{chunk-JAKBCKEB.js → chunk-4MWRR5IT.js} +8 -7
- package/dist/{chunk-TCH5UCPR.js → chunk-4PZXI7WU.js} +2 -2
- package/dist/{chunk-IBXHVYN2.js → chunk-56JCQQLS.js} +2 -2
- package/dist/{chunk-5BNXJTOZ.js → chunk-5RU35K57.js} +3 -12
- package/dist/{chunk-T65RIQK2.js → chunk-625DZLT5.js} +6 -6
- package/dist/{chunk-5PP4455M.js → chunk-6LOQE4J4.js} +3 -3
- package/dist/{chunk-KQHY6L3X.js → chunk-6MC2XXFD.js} +4 -4
- package/dist/{chunk-KZCYHWDF.js → chunk-6MJWYYAS.js} +62 -49
- package/dist/chunk-7BHI3PZN.js +41 -0
- package/dist/{chunk-D6CXQIXO.js → chunk-7JXJJNQ5.js} +1 -1
- package/dist/{chunk-MSU3VKGJ.js → chunk-7WFRY6OL.js} +2 -2
- package/dist/{chunk-AY32RSUC.js → chunk-ADR3KHOC.js} +2 -2
- package/dist/{chunk-MMLIQDTG.js → chunk-ATKN4BJT.js} +1 -1
- package/dist/{chunk-762CDAJJ.js → chunk-AXJLJJ3M.js} +7 -0
- package/dist/{chunk-4XXZUFWN.js → chunk-BG4Y64FW.js} +1 -1
- package/dist/{chunk-X4ES7QBT.js → chunk-CDQHQAS7.js} +9 -7
- package/dist/{chunk-2WMZDKPM.js → chunk-CEQ2AZH4.js} +13 -13
- package/dist/{chunk-DK35M4TH.js → chunk-CSOROFJY.js} +5 -5
- package/dist/{chunk-2FVP7WRP.js → chunk-DJ7EZIQA.js} +3 -3
- package/dist/{chunk-V3PDUDPB.js → chunk-ELLJPP6O.js} +2 -2
- package/dist/{chunk-BMPZ5HVJ.js → chunk-ERK24P76.js} +11 -1
- package/dist/{chunk-WW24SG27.js → chunk-EZHY65QA.js} +21 -11
- package/dist/{chunk-3NROUNIS.js → chunk-FDWMG6NY.js} +2 -2
- package/dist/{chunk-RQDP2SJY.js → chunk-FUZ5VYWD.js} +1 -1
- package/dist/{chunk-3N2ZTHZZ.js → chunk-GAMVAORR.js} +1 -1
- package/dist/{chunk-4QF2YLYK.js → chunk-HC3FHDKB.js} +6 -6
- package/dist/{chunk-TDOKDCFH.js → chunk-IF26ZGZ7.js} +3 -3
- package/dist/{chunk-KHDD74MK.js → chunk-J4KQL7YZ.js} +5 -5
- package/dist/{chunk-UVZK5LIK.js → chunk-K4MBKXAE.js} +1 -1
- package/dist/{chunk-5O6D4J2K.js → chunk-L3AFVFGQ.js} +2 -2
- package/dist/{chunk-MA37WNVS.js → chunk-METMK3L4.js} +4 -4
- package/dist/{chunk-SIU6OWA6.js → chunk-MUNL23WE.js} +6 -6
- package/dist/{chunk-WWAVHLGS.js → chunk-NKLNU577.js} +5 -5
- package/dist/{chunk-GMXKITVA.js → chunk-NMUI3ZWG.js} +1 -1
- package/dist/{chunk-M46WDK64.js → chunk-O6IUZGWV.js} +1 -1
- package/dist/chunk-PPY5N2E6.js +58 -0
- package/dist/{chunk-KQWN7C5C.js → chunk-PUHP4IBA.js} +4 -4
- package/dist/{chunk-JBCMXSBO.js → chunk-QGSHV3WO.js} +5 -5
- package/dist/{chunk-VAJHDTJX.js → chunk-QLMOU57V.js} +28 -17
- package/dist/{chunk-UFJS4RR7.js → chunk-QUBIEZXC.js} +3 -3
- package/dist/{chunk-EBQTWH5O.js → chunk-RLVJ6TVL.js} +23 -23
- package/dist/{chunk-LAEW5QQD.js → chunk-RPPXQNIA.js} +1 -1
- package/dist/{chunk-YQVKG5MC.js → chunk-S54C6TQC.js} +7 -6
- package/dist/{chunk-5EFNBL6V.js → chunk-SEILUNWB.js} +3 -3
- package/dist/{chunk-L3NVHPBU.js → chunk-SOCJ2N3E.js} +6 -6
- package/dist/{chunk-RAMQBSVZ.js → chunk-SVQWHV65.js} +1 -1
- package/dist/{chunk-EHCIQA5D.js → chunk-U7NR4JVD.js} +4 -4
- package/dist/{chunk-M6MOQBR5.js → chunk-USE5IEEW.js} +1 -1
- package/dist/{chunk-UTJ5465F.js → chunk-V57XLKZL.js} +2 -2
- package/dist/{chunk-BRUHVTFB.js → chunk-VIJIG5YL.js} +2 -2
- package/dist/{chunk-5JWCWALO.js → chunk-W2IVTHIG.js} +9 -9
- package/dist/{chunk-OZIXBN3O.js → chunk-WFSGCFXQ.js} +2 -2
- package/dist/{chunk-KAJDKYUM.js → chunk-WN3RACVD.js} +3 -3
- package/dist/{chunk-MYU5D5VH.js → chunk-WXPVVXBU.js} +4 -4
- package/dist/{chunk-6ONSTCDJ.js → chunk-WXZHQ3TT.js} +5 -5
- package/dist/chunk-X3YKQJCZ.js +36 -0
- package/dist/{chunk-BKVX53QR.js → chunk-XEJOPVCG.js} +1 -1
- package/dist/{chunk-75UYYIFJ.js → chunk-XV6S5PWW.js} +3 -3
- package/dist/{chunk-CPRA7IEK.js → chunk-Y5V4PA2Z.js} +2 -2
- package/dist/{chunk-3RKIJM26.js → chunk-Y5VKZNFN.js} +2 -2
- package/dist/{chunk-DS7X36Z3.js → chunk-YGE6ML3O.js} +4 -4
- package/dist/{chunk-XGP5VSQG.js → chunk-YPD3MTFU.js} +1 -1
- package/dist/{chunk-KW3DED2A.js → chunk-ZGOJLNKS.js} +4 -4
- package/dist/{codex-app-cards-switch-N77RWKCO.js → codex-app-cards-switch-ZO76D2NY.js} +11 -11
- package/dist/{codex-desktop-launch-KIX7OMTL.js → codex-desktop-launch-MJT5E3O3.js} +1 -1
- package/dist/{codex-session-launch-XV7SIIWP.js → codex-session-launch-PTFCVIC7.js} +19 -19
- package/dist/{config-HH4DYYNX.js → config-SXV6XNVU.js} +3 -3
- package/dist/{global-upgrade-YWIVJIUR.js → global-upgrade-ETDP32LO.js} +9 -9
- package/dist/{identity-4J7Y2MW3.js → identity-OOLIOSMR.js} +4 -4
- package/dist/{live-capabilities-LHZBCI5U.js → live-capabilities-2XIFA7YO.js} +4 -4
- package/dist/{paths-ES3V7BWQ.js → paths-IIOQZESZ.js} +3 -3
- package/dist/{reapply-KA5SIYWX.js → reapply-KFAJSKOQ.js} +28 -28
- package/dist/src/index.js +22 -22
- package/dist/{upgrade-lock-TJPKU5HL.js → upgrade-lock-T6ILR644.js} +4 -4
- package/dist/{usage-7ALXBJVJ.js → usage-6TN7FVWS.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-7QLSKOSU.js +0 -19
- package/dist/chunk-EO23EUOK.js +0 -14
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
outcomeOfFailedAsk,
|
|
5
5
|
reportMachineDenial,
|
|
6
6
|
storedWaitDeadline
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-625DZLT5.js";
|
|
8
8
|
import {
|
|
9
9
|
isGatingMoment,
|
|
10
10
|
recordKeylessMoment
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SVQWHV65.js";
|
|
12
12
|
import {
|
|
13
13
|
isDeferAnswer,
|
|
14
14
|
oncePerSession
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-RPPXQNIA.js";
|
|
16
16
|
import {
|
|
17
17
|
activeHookSource,
|
|
18
18
|
activeIdentity
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-PUHP4IBA.js";
|
|
20
20
|
import {
|
|
21
21
|
DEFAULT_SESSION,
|
|
22
22
|
UNNAMED_ACTION,
|
|
@@ -40,33 +40,38 @@ import {
|
|
|
40
40
|
reportEvent,
|
|
41
41
|
scopePathFor,
|
|
42
42
|
settleQuestionsForToolUse
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-W2IVTHIG.js";
|
|
44
44
|
import {
|
|
45
45
|
repoKeyFor
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-YPD3MTFU.js";
|
|
47
47
|
import {
|
|
48
48
|
askUser,
|
|
49
49
|
cancelQuestion,
|
|
50
50
|
claimBlockedAction,
|
|
51
|
+
clientErrorKindOf,
|
|
51
52
|
isAwayPaused,
|
|
52
53
|
isDecisionStopped,
|
|
53
54
|
isLocalQuestionHandoff,
|
|
54
55
|
pollForAnswer,
|
|
56
|
+
reportClientError,
|
|
55
57
|
requestGate,
|
|
56
58
|
sendNotification,
|
|
57
59
|
waitForQuestion,
|
|
58
60
|
waitsForThePhone
|
|
59
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-EZHY65QA.js";
|
|
60
62
|
import {
|
|
61
63
|
getMachineId
|
|
62
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-O6IUZGWV.js";
|
|
65
|
+
import {
|
|
66
|
+
claudeConfigDir
|
|
67
|
+
} from "./chunk-6MJWYYAS.js";
|
|
63
68
|
import {
|
|
64
69
|
getApiKey,
|
|
65
70
|
getBaseUrl
|
|
66
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-BG4Y64FW.js";
|
|
67
72
|
import {
|
|
68
73
|
NPX_LATEST_COMMAND
|
|
69
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-ERK24P76.js";
|
|
70
75
|
import {
|
|
71
76
|
AGENT_QUESTION_STRATEGY,
|
|
72
77
|
AGENT_QUESTION_TOOL,
|
|
@@ -111,7 +116,7 @@ import {
|
|
|
111
116
|
resolveGate,
|
|
112
117
|
timeoutActionWithoutLocalPrompt,
|
|
113
118
|
unansweredRefusalReason
|
|
114
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
115
120
|
|
|
116
121
|
// src/claude-permission-rules.ts
|
|
117
122
|
import { readFileSync, statSync } from "fs";
|
|
@@ -124,7 +129,7 @@ var MANAGED_CLAUDE_SETTINGS_BY_PLATFORM = {
|
|
|
124
129
|
};
|
|
125
130
|
var MAX_CLAUDE_SETTINGS_BYTES = 1048576;
|
|
126
131
|
var claudeSettingsLocationFor = (cwd, environment = process.env, home = homedir(), platform = process.platform) => ({
|
|
127
|
-
configDir:
|
|
132
|
+
configDir: claudeConfigDir(home, environment),
|
|
128
133
|
projectDir: environment.CLAUDE_PROJECT_DIR || cwd || void 0,
|
|
129
134
|
managedSettingsPath: MANAGED_CLAUDE_SETTINGS_BY_PLATFORM[platform]
|
|
130
135
|
});
|
|
@@ -528,6 +533,10 @@ var remindedOfApprovedRetry = (input) => {
|
|
|
528
533
|
markApprovalReminded(approval);
|
|
529
534
|
return true;
|
|
530
535
|
};
|
|
536
|
+
var reportHookFailure = async (code, error) => {
|
|
537
|
+
console.error(`[Pushary] ${code}: could not complete the approval check; keeping the agent's existing fallback.`);
|
|
538
|
+
await reportClientError({ kind: clientErrorKindOf(error), code });
|
|
539
|
+
};
|
|
531
540
|
var handlePreToolUse = async (input, canonical) => {
|
|
532
541
|
if (isPusharyOwnTool(input.tool_name)) return void 0;
|
|
533
542
|
let apiKey;
|
|
@@ -554,10 +563,10 @@ var handlePreToolUse = async (input, canonical) => {
|
|
|
554
563
|
if (verdict.kind === "gate" && verdict.scopeReason && (canonical?.toolInputs.length ?? 0) > 1) return deny(SCOPE_BATCH_REASON);
|
|
555
564
|
if (agentQuestionStrategy(ACTIVE_SOURCE, "PreToolUse", input.tool_name) === AGENT_QUESTION_STRATEGY.native) return void 0;
|
|
556
565
|
if (input.tool_name === "AskUserQuestion") {
|
|
557
|
-
return handleAskUserQuestion(apiKey, input, modeState);
|
|
566
|
+
return await handleAskUserQuestion(apiKey, input, modeState);
|
|
558
567
|
}
|
|
559
568
|
if (input.tool_name === "ExitPlanMode") {
|
|
560
|
-
return handleExitPlanMode(apiKey, input);
|
|
569
|
+
return await handleExitPlanMode(apiKey, input);
|
|
561
570
|
}
|
|
562
571
|
if (await claimedBlockedActionRetry(apiKey, input)) return allow(BLOCKED_ACTION_ALLOW_REASON);
|
|
563
572
|
if (remindedOfApprovedRetry(input)) return deny(BLOCKED_ACTION_CHANGED_RETRY_REASON);
|
|
@@ -577,9 +586,10 @@ var handlePreToolUse = async (input, canonical) => {
|
|
|
577
586
|
case "defer":
|
|
578
587
|
return undecidedCall(SOLE_GATE_UNDECIDED_REASON);
|
|
579
588
|
default:
|
|
580
|
-
return dispatchModeHandler(apiKey, input, verdict.policy, getMachineId(), modeState.trainingConsent, verdict.scopeReason, verdict.scopePath);
|
|
589
|
+
return await dispatchModeHandler(apiKey, input, verdict.policy, getMachineId(), modeState.trainingConsent, verdict.scopeReason, verdict.scopePath);
|
|
581
590
|
}
|
|
582
|
-
} catch {
|
|
591
|
+
} catch (error) {
|
|
592
|
+
await reportHookFailure("pre_tool_use_failed", error);
|
|
583
593
|
return undecidedCall(SOLE_GATE_UNDECIDED_REASON);
|
|
584
594
|
}
|
|
585
595
|
};
|
|
@@ -631,7 +641,8 @@ var handlePermissionRequest = async (input, canonical) => {
|
|
|
631
641
|
await dispatchModeHandler(apiKey, input, verdict.policy, getMachineId(), modeState.trainingConsent, verdict.scopeReason, verdict.scopePath)
|
|
632
642
|
);
|
|
633
643
|
}
|
|
634
|
-
} catch {
|
|
644
|
+
} catch (error) {
|
|
645
|
+
await reportHookFailure("permission_request_failed", error);
|
|
635
646
|
return void 0;
|
|
636
647
|
}
|
|
637
648
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
notificationAnswerStep
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DJ7EZIQA.js";
|
|
4
4
|
import {
|
|
5
5
|
matchMacAccountStep,
|
|
6
6
|
retryAgentCommand
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WXZHQ3TT.js";
|
|
8
8
|
import {
|
|
9
9
|
EXIT
|
|
10
10
|
} from "./chunk-KZERVKTD.js";
|
|
11
11
|
import {
|
|
12
12
|
NPX_LATEST_COMMAND
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ERK24P76.js";
|
|
14
14
|
|
|
15
15
|
// src/setup/closing.ts
|
|
16
16
|
var ACTIVITY_URL = "pushary.com/dashboard/agent/activity";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureCodexTrustsPusharyHooks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-56JCQQLS.js";
|
|
4
4
|
import {
|
|
5
5
|
CODEX_INSTRUCTIONS_LABEL,
|
|
6
6
|
GEMINI_INSTRUCTIONS_LABEL,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
macAppFxBridge,
|
|
12
12
|
refreshInstructionBlock,
|
|
13
13
|
renderAgentInstructions
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-WXZHQ3TT.js";
|
|
15
15
|
import {
|
|
16
16
|
OPENCODE_HOOK_BINARY,
|
|
17
17
|
agentHookOwner,
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
openCodeInstructionsFile,
|
|
22
22
|
openCodePluginDir,
|
|
23
23
|
openCodeWired
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-QGSHV3WO.js";
|
|
25
25
|
import {
|
|
26
26
|
detectClaudeVersion
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-USE5IEEW.js";
|
|
28
28
|
import {
|
|
29
29
|
addClaudeMcpServer,
|
|
30
30
|
addCompatibleHooks,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
compatibleConfigFile,
|
|
34
34
|
compatibleInstructionsFile,
|
|
35
35
|
hasCompatibleHooks
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-PUHP4IBA.js";
|
|
37
37
|
import {
|
|
38
38
|
claudeUnprovenHolds,
|
|
39
39
|
claudeWired,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
codexWired,
|
|
42
42
|
geminiWired,
|
|
43
43
|
planHooks
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-CDQHQAS7.js";
|
|
45
45
|
import {
|
|
46
46
|
CLAUDE_HOOK_BINARY,
|
|
47
47
|
CLAUDE_HOOK_EVENTS,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
needsReregistration,
|
|
53
53
|
registrationSignatures,
|
|
54
54
|
supportedClaudeEvents
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-IF26ZGZ7.js";
|
|
56
56
|
import {
|
|
57
57
|
formatVersion
|
|
58
58
|
} from "./chunk-6ICPEJY5.js";
|
|
@@ -61,7 +61,9 @@ import {
|
|
|
61
61
|
addCodexHookTrust,
|
|
62
62
|
addCodexHooks,
|
|
63
63
|
addCodexMcpServer,
|
|
64
|
+
claudeJson,
|
|
64
65
|
claudeRegistrationReceipt,
|
|
66
|
+
claudeSettings,
|
|
65
67
|
codexAgentsMd,
|
|
66
68
|
codexConfigToml,
|
|
67
69
|
codexHookPositions,
|
|
@@ -80,11 +82,11 @@ import {
|
|
|
80
82
|
registeredCommands,
|
|
81
83
|
registrationHolderOf,
|
|
82
84
|
vscodePluginMcp
|
|
83
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-6MJWYYAS.js";
|
|
84
86
|
import {
|
|
85
87
|
resolveGlobalBinDir,
|
|
86
88
|
resolveGlobalBinary
|
|
87
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-2QREHU4O.js";
|
|
88
90
|
import {
|
|
89
91
|
readJsonSafe,
|
|
90
92
|
writeFileAtomic,
|
|
@@ -94,7 +96,7 @@ import {
|
|
|
94
96
|
HOOK_COMPATIBLE_PROFILES,
|
|
95
97
|
isCompatibleAgentType,
|
|
96
98
|
isRecord
|
|
97
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
98
100
|
|
|
99
101
|
// src/reapply.ts
|
|
100
102
|
import { dirname, join } from "path";
|
|
@@ -137,8 +139,6 @@ var storedSignatures = (raw) => {
|
|
|
137
139
|
};
|
|
138
140
|
|
|
139
141
|
// src/reapply.ts
|
|
140
|
-
var CLAUDE_SETTINGS = join(homedir(), ".claude", "settings.json");
|
|
141
|
-
var CLAUDE_JSON = join(homedir(), ".claude.json");
|
|
142
142
|
var readJson = (filePath) => {
|
|
143
143
|
const result = readJsonSafe(filePath);
|
|
144
144
|
if (result.kind === "ok") return isRecord(result.value) ? result.value : null;
|
|
@@ -147,7 +147,7 @@ var readJson = (filePath) => {
|
|
|
147
147
|
};
|
|
148
148
|
var writeJson = (filePath, data) => writeJsonAtomic(filePath, data);
|
|
149
149
|
var hasPusharyClaudeHooks = (settings) => JSON.stringify(settings.hooks ?? {}).includes(CLAUDE_HOOK_BINARY);
|
|
150
|
-
var hasPusharyMcp = (
|
|
150
|
+
var hasPusharyMcp = (claudeJson2) => !!claudeJson2.mcpServers?.pushary;
|
|
151
151
|
var PRIVATE_TO_OWNER = 384;
|
|
152
152
|
var modeToPreserve = (filePath) => {
|
|
153
153
|
try {
|
|
@@ -158,14 +158,14 @@ var modeToPreserve = (filePath) => {
|
|
|
158
158
|
};
|
|
159
159
|
var wouldWriteBareNames = (resolve, probe) => resolve(probe) === void 0;
|
|
160
160
|
var reapplyClaudeSettings = (apiKey, paths = {}) => {
|
|
161
|
-
const settingsPath = paths.settingsPath ??
|
|
162
|
-
const claudeJsonPath = paths.claudeJsonPath ??
|
|
161
|
+
const settingsPath = paths.settingsPath ?? claudeSettings();
|
|
162
|
+
const claudeJsonPath = paths.claudeJsonPath ?? claudeJson();
|
|
163
163
|
const settings = readJson(settingsPath);
|
|
164
|
-
const
|
|
165
|
-
const configured = settings != null && hasPusharyClaudeHooks(settings) ||
|
|
164
|
+
const claudeJson2 = readJson(claudeJsonPath);
|
|
165
|
+
const configured = settings != null && hasPusharyClaudeHooks(settings) || claudeJson2 != null && hasPusharyMcp(claudeJson2);
|
|
166
166
|
if (!configured) return { configured: false, reapplied: false, hooks: false, mcp: false };
|
|
167
167
|
const settingsWritable = settings != null;
|
|
168
|
-
const claudeJsonWritable =
|
|
168
|
+
const claudeJsonWritable = claudeJson2 != null;
|
|
169
169
|
let hooks = false;
|
|
170
170
|
let mcp = false;
|
|
171
171
|
let failed = false;
|
|
@@ -183,7 +183,7 @@ var reapplyClaudeSettings = (apiKey, paths = {}) => {
|
|
|
183
183
|
if (apiKey) {
|
|
184
184
|
try {
|
|
185
185
|
if (!claudeJsonWritable) throw new Error(".claude.json could not be parsed");
|
|
186
|
-
const cj =
|
|
186
|
+
const cj = claudeJson2;
|
|
187
187
|
addClaudeMcpServer(cj, apiKey);
|
|
188
188
|
writeJson(claudeJsonPath, cj);
|
|
189
189
|
mcp = true;
|
|
@@ -196,7 +196,7 @@ var reapplyClaudeSettings = (apiKey, paths = {}) => {
|
|
|
196
196
|
var reapplyClaudeForVersion = (apiKey, paths = {}) => {
|
|
197
197
|
const idle = { verdict: "current", rewrote: false, missing: [] };
|
|
198
198
|
try {
|
|
199
|
-
const settingsPath = paths.settingsPath ??
|
|
199
|
+
const settingsPath = paths.settingsPath ?? claudeSettings();
|
|
200
200
|
const receiptPath = paths.receiptPath ?? claudeRegistrationReceipt();
|
|
201
201
|
const version = (paths.detectVersion ?? detectClaudeVersion)();
|
|
202
202
|
const receipt = readJsonSafe(receiptPath);
|
|
@@ -234,9 +234,9 @@ var readToml = (filePath) => {
|
|
|
234
234
|
};
|
|
235
235
|
var inspectConfiguredManagedProviders = (paths = {}) => {
|
|
236
236
|
const providers = [];
|
|
237
|
-
const
|
|
238
|
-
const
|
|
239
|
-
if (claudeWired({ claudeJson, settings:
|
|
237
|
+
const claudeSettings2 = readJson(paths.claudeSettingsPath ?? claudeSettings());
|
|
238
|
+
const claudeJson2 = readJson(paths.claudeJsonPath ?? claudeJson());
|
|
239
|
+
if (claudeWired({ claudeJson: claudeJson2, settings: claudeSettings2, skillExists: false })) {
|
|
240
240
|
providers.push("claude");
|
|
241
241
|
}
|
|
242
242
|
const codexConfig = readToml(paths.codexConfigPath ?? codexConfigToml());
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openCodeConfigDirFrom
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QGSHV3WO.js";
|
|
4
4
|
import {
|
|
5
5
|
nativeClaudeInstallPath
|
|
6
6
|
} from "./chunk-VUFHYMSP.js";
|
|
7
7
|
import {
|
|
8
8
|
grokHome
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PUHP4IBA.js";
|
|
10
10
|
import {
|
|
11
|
+
claudeConfigDir,
|
|
11
12
|
codexHomeFrom
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6MJWYYAS.js";
|
|
13
14
|
import {
|
|
14
15
|
resolvePathBinary
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2QREHU4O.js";
|
|
16
17
|
import {
|
|
17
18
|
HOOK_COMPATIBLE_PROFILES
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
19
20
|
|
|
20
21
|
// src/hermes-config.ts
|
|
21
22
|
import { execFileSync } from "child_process";
|
|
@@ -510,7 +511,7 @@ var agentProbes = (home = homedir3(), platform = process.platform) => ({
|
|
|
510
511
|
binary: "claude",
|
|
511
512
|
// The native installer puts it here, outside a default non-login PATH.
|
|
512
513
|
paths: [nativeClaudeInstallPath(home, platform)],
|
|
513
|
-
configMarkers: [
|
|
514
|
+
configMarkers: [claudeConfigDir(home)]
|
|
514
515
|
},
|
|
515
516
|
codex: {
|
|
516
517
|
binary: "codex",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
keyCheckFromResponse
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-METMK3L4.js";
|
|
4
4
|
import {
|
|
5
5
|
installNetworkDefaults
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4MWRR5IT.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BG4Y64FW.js";
|
|
10
10
|
|
|
11
11
|
// src/retry.ts
|
|
12
12
|
var isRetryable = (err) => {
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
forkFinishWithUpgradeLock,
|
|
4
4
|
installWithUpgradeLock,
|
|
5
5
|
releaseAutoUpdateLock
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VIJIG5YL.js";
|
|
7
7
|
import {
|
|
8
8
|
phoneStartIsRequired
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6LOQE4J4.js";
|
|
10
10
|
import {
|
|
11
11
|
describeAutoUpdateCheck,
|
|
12
12
|
globalInstallLocation,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
readAutoUpdateState,
|
|
19
19
|
updateAutoUpdateState,
|
|
20
20
|
upgradeEntryFor
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-5RU35K57.js";
|
|
22
22
|
import {
|
|
23
23
|
EXIT
|
|
24
24
|
} from "./chunk-KZERVKTD.js";
|
|
@@ -26,17 +26,17 @@ import {
|
|
|
26
26
|
autoUpdateLock,
|
|
27
27
|
autoUpdateLog,
|
|
28
28
|
autoUpdateState
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-6MJWYYAS.js";
|
|
30
30
|
import {
|
|
31
31
|
execNpm,
|
|
32
32
|
fetchLatestPublishedVersion,
|
|
33
33
|
npmErrorMessage,
|
|
34
34
|
readGlobalCliInstallAt,
|
|
35
35
|
readGlobalPrefix
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-2QREHU4O.js";
|
|
37
37
|
import {
|
|
38
38
|
NPX_LATEST_COMMAND
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-ERK24P76.js";
|
|
40
40
|
import {
|
|
41
41
|
commandsPackage,
|
|
42
42
|
globalUpgradeEntry,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
macAppBridgeAvailable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QGSHV3WO.js";
|
|
4
4
|
import {
|
|
5
5
|
keyPrefix
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WN3RACVD.js";
|
|
7
7
|
import {
|
|
8
8
|
bridgeAgentKey
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6MJWYYAS.js";
|
|
10
10
|
import {
|
|
11
11
|
readJsonSafe
|
|
12
12
|
} from "./chunk-QENTGE75.js";
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
16
16
|
|
|
17
17
|
// src/shared-mcp-key.ts
|
|
18
18
|
var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autoUpdateLock
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6MJWYYAS.js";
|
|
4
4
|
import {
|
|
5
5
|
installPackageGlobally,
|
|
6
6
|
npmErrorMessage
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2QREHU4O.js";
|
|
8
8
|
import {
|
|
9
9
|
writeJsonAtomic
|
|
10
10
|
} from "./chunk-QENTGE75.js";
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
IDLE_PROMPT_NOTIFICATION,
|
|
3
3
|
NOTIFICATION_PUSH_TYPES,
|
|
4
4
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-33OOEVPG.js";
|
|
6
6
|
import {
|
|
7
7
|
repoKeyFor
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YPD3MTFU.js";
|
|
9
9
|
import {
|
|
10
10
|
cancelQuestion,
|
|
11
11
|
clientErrorKindOf,
|
|
@@ -13,26 +13,26 @@ import {
|
|
|
13
13
|
reportClientError,
|
|
14
14
|
sendNotification,
|
|
15
15
|
waitForAnswer
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EZHY65QA.js";
|
|
17
17
|
import {
|
|
18
18
|
withRetry
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-SEILUNWB.js";
|
|
20
20
|
import {
|
|
21
21
|
getMachineId
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-O6IUZGWV.js";
|
|
23
23
|
import {
|
|
24
24
|
reportedInstallSource
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-Y5VKZNFN.js";
|
|
26
26
|
import {
|
|
27
27
|
canonicalJson
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-6MJWYYAS.js";
|
|
29
29
|
import {
|
|
30
30
|
writeFileAtomic
|
|
31
31
|
} from "./chunk-QENTGE75.js";
|
|
32
32
|
import {
|
|
33
33
|
getApiKey,
|
|
34
34
|
getBaseUrl
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-BG4Y64FW.js";
|
|
36
36
|
import {
|
|
37
37
|
ACTION_BODY_MAX,
|
|
38
38
|
AGENTS,
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
toToolLookup,
|
|
67
67
|
truncateLine,
|
|
68
68
|
unansweredRefusalReason
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
70
70
|
|
|
71
71
|
// ../hook-mapping/src/describe.ts
|
|
72
72
|
import { isAbsolute, relative, resolve } from "path";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./chunk-QENTGE75.js";
|
|
5
5
|
import {
|
|
6
6
|
configFilePath
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BG4Y64FW.js";
|
|
8
8
|
import {
|
|
9
9
|
readSetupOutcomeProperties
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
11
11
|
|
|
12
12
|
// src/hooks-spec.ts
|
|
13
13
|
var CURSOR_GATE_SCRIPT = "pushary-gate.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveInstallSourceFor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y5VKZNFN.js";
|
|
4
4
|
import {
|
|
5
5
|
backupFile,
|
|
6
6
|
readJsonSafe,
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
} from "./chunk-QENTGE75.js";
|
|
10
10
|
import {
|
|
11
11
|
configFilePath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BG4Y64FW.js";
|
|
13
13
|
import {
|
|
14
14
|
API_KEY_PREFIX_PATTERN,
|
|
15
15
|
isRecord
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
17
17
|
|
|
18
18
|
// src/shell-alias.ts
|
|
19
19
|
import { homedir } from "os";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile,
|
|
3
3
|
hasCompatibleHooks
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PUHP4IBA.js";
|
|
5
5
|
import {
|
|
6
6
|
pusharyHookExecutable
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CDQHQAS7.js";
|
|
8
8
|
import {
|
|
9
9
|
isProtectedByScope,
|
|
10
10
|
registerHookEntry
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6MJWYYAS.js";
|
|
12
12
|
import {
|
|
13
13
|
isRecord
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
15
15
|
|
|
16
16
|
// src/cursor-config.ts
|
|
17
17
|
var hookCommandOf = (entry) => {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MCP_BRIDGE_BINARY
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FDWMG6NY.js";
|
|
4
4
|
import {
|
|
5
5
|
KEY_FILE_MODE
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WN3RACVD.js";
|
|
7
7
|
import {
|
|
8
8
|
NpmInstallError,
|
|
9
9
|
NpmMissingError,
|
|
10
10
|
NpmPermissionError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2QREHU4O.js";
|
|
12
12
|
import {
|
|
13
13
|
readJsonSafe,
|
|
14
14
|
writeFileAtomic,
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
} from "./chunk-QENTGE75.js";
|
|
17
17
|
import {
|
|
18
18
|
NPX_LATEST_COMMAND
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ERK24P76.js";
|
|
20
20
|
import {
|
|
21
21
|
readSetupAgentFailures
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
23
23
|
|
|
24
24
|
// src/instruction-file.ts
|
|
25
25
|
import { accessSync, constants, existsSync, readFileSync, statSync, writeFileSync, mkdirSync, rmSync } from "fs";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isApprovalMode,
|
|
3
|
+
isRecord,
|
|
4
|
+
isTimeoutAction
|
|
5
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
6
|
+
|
|
7
|
+
// src/cli/settings-response.ts
|
|
8
|
+
var isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
|
|
9
|
+
var isWaitSeconds = (value) => isFiniteNumber(value) && value >= 0;
|
|
10
|
+
var isModeOverride = (value) => isRecord(value) && isApprovalMode(value.mode) && (value.expiresAt === null || typeof value.expiresAt === "string" && Number.isFinite(Date.parse(value.expiresAt)));
|
|
11
|
+
var modeResponse = (value) => {
|
|
12
|
+
if (!isRecord(value) || value.override !== null && !isModeOverride(value.override) || value.permanent !== void 0 && typeof value.permanent !== "boolean") throw new Error("Invalid mode response");
|
|
13
|
+
return { override: value.override, ...typeof value.permanent === "boolean" ? { permanent: value.permanent } : {} };
|
|
14
|
+
};
|
|
15
|
+
var isWaitPolicy = (value) => isRecord(value) && typeof value.tool === "string" && isApprovalMode(value.mode) && isTimeoutAction(value.timeoutAction) && isWaitSeconds(value.timeoutSeconds) && isWaitSeconds(value.pushFirstSeconds);
|
|
16
|
+
var waitWindowResponse = (value) => {
|
|
17
|
+
if (!isRecord(value) || !isWaitSeconds(value.defaultPushFirstSeconds)) throw new Error("Invalid wait response");
|
|
18
|
+
return value.defaultPushFirstSeconds;
|
|
19
|
+
};
|
|
20
|
+
var waitResponse = (value) => {
|
|
21
|
+
const defaultPushFirstSeconds = waitWindowResponse(value);
|
|
22
|
+
if (!isRecord(value) || !Array.isArray(value.policies) || !value.policies.every(isWaitPolicy) || value.modeOverride !== null && !isApprovalMode(value.modeOverride)) throw new Error("Invalid wait response");
|
|
23
|
+
return { policies: value.policies, defaultPushFirstSeconds, modeOverride: value.modeOverride };
|
|
24
|
+
};
|
|
25
|
+
var isSuggestion = (value) => isRecord(value) && typeof value.id === "string" && typeof value.toolPattern === "string" && (value.kind === "auto_approve" || value.kind === "always_deny") && isFiniteNumber(value.evidenceApproved) && isFiniteNumber(value.evidenceDenied) && isFiniteNumber(value.windowDays);
|
|
26
|
+
var suggestionsResponse = (value) => {
|
|
27
|
+
if (!isRecord(value) || !Array.isArray(value.suggestions) || !value.suggestions.every(isSuggestion)) throw new Error("Invalid suggestions response");
|
|
28
|
+
return value.suggestions;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
modeResponse,
|
|
33
|
+
waitWindowResponse,
|
|
34
|
+
waitResponse,
|
|
35
|
+
suggestionsResponse
|
|
36
|
+
};
|