@pushary/agent-hooks 1.3.1 → 1.4.1
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 +23 -0
- package/README.md +1 -1
- package/dist/bin/pushary-bell-hook.js +18 -18
- package/dist/bin/pushary-bell.js +8 -8
- package/dist/bin/pushary-claude.js +18 -18
- package/dist/bin/pushary-clean.js +490 -95
- package/dist/bin/pushary-codex-bridge.js +10 -10
- package/dist/bin/pushary-codex-hook.js +28 -26
- package/dist/bin/pushary-codex.js +6 -6
- package/dist/bin/pushary-connect.js +8 -8
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +24 -24
- package/dist/bin/pushary-disconnect.js +12 -12
- package/dist/bin/pushary-doctor.js +75 -26
- package/dist/bin/pushary-elicitation-hook.js +17 -17
- package/dist/bin/pushary-gemini-bridge.js +9 -9
- package/dist/bin/pushary-gemini-hook.js +19 -19
- package/dist/bin/pushary-hook.js +27 -27
- package/dist/bin/pushary-login.js +9 -9
- package/dist/bin/pushary-logout.js +6 -6
- package/dist/bin/pushary-mode.js +5 -5
- package/dist/bin/pushary-notification-hook.js +20 -20
- package/dist/bin/pushary-opencode-hook.js +19 -19
- package/dist/bin/pushary-permission-denied-hook.js +24 -24
- package/dist/bin/pushary-permission-hook.js +25 -25
- package/dist/bin/pushary-post-hook.js +20 -20
- package/dist/bin/pushary-prompt-hook.js +20 -20
- package/dist/bin/pushary-session-end-hook.js +20 -20
- package/dist/bin/pushary-session-start-hook.js +22 -22
- package/dist/bin/pushary-setup.js +38 -59
- package/dist/bin/pushary-stats.js +4 -4
- package/dist/bin/pushary-status.js +12 -12
- package/dist/bin/pushary-stop-hook.js +20 -20
- package/dist/bin/pushary-stopfailure-hook.js +20 -20
- package/dist/bin/pushary-suggestions.js +2 -2
- package/dist/bin/pushary-transcript-register.js +16 -16
- package/dist/bin/pushary-transcripts.js +6 -6
- package/dist/bin/pushary-upgrade.js +16 -16
- package/dist/bin/pushary-wait.js +5 -5
- package/dist/bin/pushary.js +1 -1
- package/dist/{chunk-RERJ2ZDV.js → chunk-2GMI6JH6.js} +5 -5
- package/dist/{chunk-AFOTOA24.js → chunk-37VLIYLI.js} +35 -4
- package/dist/{chunk-6HH4IH4K.js → chunk-3BPB2HYZ.js} +3 -3
- package/dist/{chunk-465UENKO.js → chunk-3T52B2OF.js} +1 -1
- package/dist/{chunk-PEV6ULSM.js → chunk-3UA6FPRC.js} +3 -3
- package/dist/{chunk-QDYJQLXT.js → chunk-43JKGLZZ.js} +2 -2
- package/dist/{chunk-CKLWJ6EL.js → chunk-4FN6VV56.js} +33 -7
- package/dist/{chunk-HCTSTMDD.js → chunk-ALFT7H5B.js} +3 -3
- package/dist/{chunk-35RPUNYU.js → chunk-BZBUPZC6.js} +1 -1
- package/dist/{chunk-CDSL3LLO.js → chunk-CRNAXFQ6.js} +1 -1
- package/dist/{chunk-NDSOOJDX.js → chunk-D7ERHWYB.js} +1 -1
- package/dist/{chunk-KHGIM2BN.js → chunk-ED5TA2FJ.js} +3 -3
- package/dist/{chunk-LZQVAEWP.js → chunk-FAH3D74E.js} +2 -1
- package/dist/{chunk-5UWDYOZX.js → chunk-FVKFDTN6.js} +81 -8
- package/dist/{chunk-I2OLM3DM.js → chunk-GOFDGTEI.js} +62 -12
- package/dist/{chunk-JZA2JOGO.js → chunk-HK3IXIQJ.js} +1 -1
- package/dist/{chunk-LWT34GSY.js → chunk-HQLAZWJJ.js} +7 -7
- package/dist/{chunk-5XKMOZO6.js → chunk-I6HRQOMT.js} +4 -4
- package/dist/{chunk-EAGMQMRM.js → chunk-JOVWYVSR.js} +1 -1
- package/dist/{chunk-5WLH2ENB.js → chunk-K6I5M2ME.js} +1 -1
- package/dist/{chunk-REIZ5GXG.js → chunk-KEMEBTCJ.js} +4 -4
- package/dist/{chunk-PHXU4NOP.js → chunk-KI36MAT6.js} +2 -2
- package/dist/{chunk-WOBHHXW5.js → chunk-LNGYW6G4.js} +5 -4
- package/dist/{chunk-AFKOWCMQ.js → chunk-LUT2EZLG.js} +1 -1
- package/dist/{chunk-KLZJEMSE.js → chunk-LYXX5NSB.js} +1 -1
- package/dist/{chunk-YXWM4TNX.js → chunk-MN3XOVRK.js} +1 -1
- package/dist/{chunk-XOUQUZ43.js → chunk-PHHGHHOW.js} +1 -1
- package/dist/{chunk-TW7KA27C.js → chunk-QBS6LGEK.js} +1 -1
- package/dist/{chunk-FGNABUPN.js → chunk-R3AMKNIW.js} +1 -1
- package/dist/{chunk-TGG4FWWB.js → chunk-S3EP4B35.js} +2 -2
- package/dist/{chunk-34NNTYK6.js → chunk-SAF6NNXY.js} +1 -1
- package/dist/{chunk-R5CU7ED6.js → chunk-SKXLIVFM.js} +1 -1
- package/dist/{chunk-OMP3KDDU.js → chunk-SWFF5U2N.js} +1 -1
- package/dist/{chunk-QOCWB4Q6.js → chunk-TF4IOINR.js} +3 -3
- package/dist/{chunk-5SALHATY.js → chunk-TI3ZWXZG.js} +11 -2
- package/dist/{chunk-P232YODQ.js → chunk-TNS3YLFE.js} +6 -6
- package/dist/{chunk-GOQHN2UH.js → chunk-TWWLVOPB.js} +1 -1
- package/dist/{chunk-XVE52YFZ.js → chunk-VYUDGQM7.js} +1 -1
- package/dist/{chunk-XP2KRTZD.js → chunk-WEO5JCB4.js} +1 -1
- package/dist/{chunk-SGZE2JBF.js → chunk-WIOXWUUH.js} +3 -3
- package/dist/{reapply-ADFRVH5N.js → reapply-BAWDJTG7.js} +8 -8
- package/dist/src/index.d.ts +19 -16
- package/dist/src/index.js +12 -12
- package/package.json +1 -1
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
|
+
activeHookSource,
|
|
2
3
|
activeIdentity
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HQLAZWJJ.js";
|
|
4
5
|
import {
|
|
5
6
|
blockedActionFingerprint,
|
|
6
7
|
defersToNativeMode,
|
|
7
8
|
forgetBlockedActionHint,
|
|
8
9
|
hasBlockedActionHint,
|
|
9
10
|
recordBlockedActionHint
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ALFT7H5B.js";
|
|
11
12
|
import {
|
|
12
13
|
isGatingMoment,
|
|
13
14
|
recordKeylessMoment
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SWFF5U2N.js";
|
|
15
16
|
import {
|
|
16
17
|
denyReasonFrom,
|
|
17
18
|
isDeferAnswer
|
|
18
19
|
} from "./chunk-YHG74UFF.js";
|
|
19
20
|
import {
|
|
21
|
+
AUTO_DECISION_WINDOW_MS,
|
|
20
22
|
DEFAULT_SESSION,
|
|
21
23
|
UNNAMED_ACTION,
|
|
22
24
|
deriveAction,
|
|
@@ -34,7 +36,7 @@ import {
|
|
|
34
36
|
scopePathFor,
|
|
35
37
|
settleQuestionsForToolUse,
|
|
36
38
|
throttlePass
|
|
37
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-LNGYW6G4.js";
|
|
38
40
|
import {
|
|
39
41
|
DECISION_STOP_REASON,
|
|
40
42
|
askUser,
|
|
@@ -49,18 +51,22 @@ import {
|
|
|
49
51
|
} from "./chunk-LGXUGYUH.js";
|
|
50
52
|
import {
|
|
51
53
|
getMachineId
|
|
52
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-3T52B2OF.js";
|
|
53
55
|
import {
|
|
54
56
|
getApiKey,
|
|
55
57
|
getBaseUrl
|
|
56
58
|
} from "./chunk-2UMNXADU.js";
|
|
57
59
|
import {
|
|
60
|
+
AGENT_QUESTION_STRATEGY,
|
|
58
61
|
GATE_BLOCK_REASON_MAX_LENGTH,
|
|
59
62
|
GATE_WIRE,
|
|
63
|
+
agentQuestionStrategy,
|
|
60
64
|
buildDecisionEpisodeFeatures,
|
|
61
65
|
claudePermissionDeniedOutput,
|
|
62
66
|
claudePermissionRequestOutput,
|
|
63
67
|
claudePreToolUseOutput,
|
|
68
|
+
claudePromptsBeforeAnEdit,
|
|
69
|
+
editAsksAtTheAgentsPrompt,
|
|
64
70
|
effectiveWaitSeconds,
|
|
65
71
|
hookHoldWindowMs,
|
|
66
72
|
hookWaitClamped,
|
|
@@ -69,11 +75,13 @@ import {
|
|
|
69
75
|
isBlockedActionRequest,
|
|
70
76
|
isPermissionRequestOwnedByPreToolUse,
|
|
71
77
|
isPusharyOwnTool,
|
|
78
|
+
machineDecisionFor,
|
|
72
79
|
parseAgentQuestionAnswers,
|
|
73
80
|
parseAgentQuestions,
|
|
74
81
|
resolveGate,
|
|
75
|
-
stoppedOutput
|
|
76
|
-
|
|
82
|
+
stoppedOutput,
|
|
83
|
+
wireVerdictFor
|
|
84
|
+
} from "./chunk-FVKFDTN6.js";
|
|
77
85
|
|
|
78
86
|
// src/decision-episode.ts
|
|
79
87
|
var EPISODE_PATH = "/api/agent/decision-episode";
|
|
@@ -103,12 +111,38 @@ import { tmpdir } from "os";
|
|
|
103
111
|
import { existsSync, writeFileSync } from "fs";
|
|
104
112
|
var START_MS = Date.now();
|
|
105
113
|
var ACTIVE_AGENT = activeIdentity(process.argv);
|
|
114
|
+
var ACTIVE_SOURCE = activeHookSource(process.argv);
|
|
106
115
|
var agentNameIn = (projectName) => `${ACTIVE_AGENT.label} - ${projectName}`;
|
|
107
116
|
var allow = (reason) => claudePreToolUseOutput("allow", reason);
|
|
108
117
|
var deny = (reason) => claudePreToolUseOutput("deny", reason);
|
|
109
118
|
var allowWithInput = (updatedInput) => claudePreToolUseOutput("allow", void 0, updatedInput);
|
|
110
119
|
var ask = (reason) => claudePreToolUseOutput("ask", reason);
|
|
111
120
|
var halted = (reason) => stoppedOutput(deny(reason), reason);
|
|
121
|
+
var reportMachineDecision = async (input, verdict) => {
|
|
122
|
+
const decision = machineDecisionFor(wireVerdictFor(verdict, 0));
|
|
123
|
+
if (!decision) return;
|
|
124
|
+
const sessionKey = input.session_id || DEFAULT_SESSION;
|
|
125
|
+
const toolTarget = deriveToolTarget(input.tool_name, input.tool_input);
|
|
126
|
+
const throttleKey = `machinedecision:${sessionKey}:${input.tool_name}:${decision.origin}:${toolTarget ?? ""}`;
|
|
127
|
+
if (!throttlePass(throttleKey, AUTO_DECISION_WINDOW_MS)) return;
|
|
128
|
+
await reportEvent(
|
|
129
|
+
{
|
|
130
|
+
event: "permission_denied",
|
|
131
|
+
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
132
|
+
toolUseId: input.tool_use_id,
|
|
133
|
+
agentType: ACTIVE_AGENT.type,
|
|
134
|
+
agentName: agentNameIn(basename(input.cwd ?? process.cwd())),
|
|
135
|
+
action: permissionDeniedAction(input.tool_name),
|
|
136
|
+
sessionId: input.session_id,
|
|
137
|
+
decisionSource: "policy_auto",
|
|
138
|
+
decisionOrigin: decision.origin,
|
|
139
|
+
decisionOutcome: decision.outcome,
|
|
140
|
+
toolName: input.tool_name,
|
|
141
|
+
toolTarget
|
|
142
|
+
},
|
|
143
|
+
{ maxAttempts: 1, timeoutMs: 800 }
|
|
144
|
+
).catch(() => void 0);
|
|
145
|
+
};
|
|
112
146
|
var storedWaitDeadline = (result, requestedDeadline) => {
|
|
113
147
|
const stored = result.waitEndsAt ? Date.parse(result.waitEndsAt) : Number.NaN;
|
|
114
148
|
return Number.isFinite(stored) ? Math.min(stored, requestedDeadline) : requestedDeadline;
|
|
@@ -519,11 +553,19 @@ var handlePreToolUse = async (input, canonical) => {
|
|
|
519
553
|
try {
|
|
520
554
|
const modeState = await fetchModeState(apiKey, input.session_id);
|
|
521
555
|
const policy = await getPolicy(apiKey, modeState.policyVersion, ACTIVE_AGENT.type, true, input.session_id);
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
if (verdict.kind === "
|
|
556
|
+
const gateInput = claudeGateInput(modeState, policy, input, canonical);
|
|
557
|
+
const verdict = resolveGate(gateInput);
|
|
558
|
+
if (verdict.kind === "kill") {
|
|
559
|
+
await reportMachineDecision(input, verdict);
|
|
560
|
+
return halted(verdict.reason);
|
|
561
|
+
}
|
|
562
|
+
if (verdict.kind === "deny") {
|
|
563
|
+
await reportMachineDecision(input, verdict);
|
|
564
|
+
return deny(verdict.reason);
|
|
565
|
+
}
|
|
525
566
|
if (canonical === null) return deny(unreadableReason);
|
|
526
567
|
if (verdict.kind === "gate" && verdict.scopeReason && (canonical?.toolInputs.length ?? 0) > 1) return deny(batchScopeReason);
|
|
568
|
+
if (agentQuestionStrategy(ACTIVE_SOURCE, "PreToolUse", input.tool_name) === AGENT_QUESTION_STRATEGY.native) return void 0;
|
|
527
569
|
if (input.tool_name === "AskUserQuestion") {
|
|
528
570
|
return handleAskUserQuestion(apiKey, input, modeState);
|
|
529
571
|
}
|
|
@@ -534,6 +576,7 @@ var handlePreToolUse = async (input, canonical) => {
|
|
|
534
576
|
if (!(verdict.kind === "gate" && verdict.scopeReason) && shouldDeferToNativeMode(input.permission_mode, input.tool_name)) {
|
|
535
577
|
return void 0;
|
|
536
578
|
}
|
|
579
|
+
if (claudePromptsBeforeAnEdit(input.permission_mode) && editAsksAtTheAgentsPrompt(gateInput, verdict)) return handleTerminalOnly();
|
|
537
580
|
switch (verdict.kind) {
|
|
538
581
|
case "allow":
|
|
539
582
|
return allow();
|
|
@@ -574,9 +617,16 @@ var handlePermissionRequest = async (input, canonical) => {
|
|
|
574
617
|
const modeState = await fetchModeState(apiKey, input.session_id);
|
|
575
618
|
const policy = await getPolicy(apiKey, modeState.policyVersion, ACTIVE_AGENT.type, true, input.session_id);
|
|
576
619
|
const verdict = resolveGate(claudeGateInput(modeState, policy, input, canonical));
|
|
577
|
-
if (verdict.kind === "kill")
|
|
578
|
-
|
|
620
|
+
if (verdict.kind === "kill") {
|
|
621
|
+
await reportMachineDecision(input, verdict);
|
|
622
|
+
return permReqHalted(verdict.reason);
|
|
623
|
+
}
|
|
624
|
+
if (verdict.kind === "deny") {
|
|
625
|
+
await reportMachineDecision(input, verdict);
|
|
626
|
+
return permReqDeny(verdict.reason);
|
|
627
|
+
}
|
|
579
628
|
if (canonical === null) return permReqDeny(unreadableReason);
|
|
629
|
+
if (agentQuestionStrategy(ACTIVE_SOURCE, "PermissionRequest", input.tool_name) === AGENT_QUESTION_STRATEGY.native) return void 0;
|
|
580
630
|
if (verdict.kind === "gate" && verdict.scopeReason && (canonical?.toolInputs.length ?? 0) > 1) return permReqDeny(batchScopeReason);
|
|
581
631
|
if (!(verdict.kind === "gate" && verdict.scopeReason) && isPermissionRequestOwnedByPreToolUse(input.tool_name, input.permission_mode, shouldDeferToNativeMode)) return void 0;
|
|
582
632
|
switch (verdict.kind) {
|
|
@@ -3,28 +3,28 @@ import {
|
|
|
3
3
|
addPusharyToolPermissions,
|
|
4
4
|
isPusharyHook,
|
|
5
5
|
removeClaudeMcpServers
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WIOXWUUH.js";
|
|
7
7
|
import {
|
|
8
8
|
CLAUDE_HOOK_EVENTS,
|
|
9
9
|
addGeminiMcpServer,
|
|
10
10
|
removeGeminiMcpServer
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ED5TA2FJ.js";
|
|
12
12
|
import {
|
|
13
13
|
CLAUDE_CODE_AGENT,
|
|
14
14
|
parseApplyPatchFiles
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LNGYW6G4.js";
|
|
16
16
|
import {
|
|
17
17
|
guardBinary,
|
|
18
18
|
holdBudgetOf,
|
|
19
19
|
registerHookEntry
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-SAF6NNXY.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-FVKFDTN6.js";
|
|
28
28
|
|
|
29
29
|
// src/compatible-config.ts
|
|
30
30
|
import { homedir } from "os";
|
|
@@ -50,14 +50,14 @@ var namedSource = (argv) => {
|
|
|
50
50
|
const inline = argv.find((argument) => argument.startsWith(`${SOURCE_FLAG}=`));
|
|
51
51
|
if (inline) return inline.slice(SOURCE_FLAG.length + 1);
|
|
52
52
|
const index = argv.indexOf(SOURCE_FLAG);
|
|
53
|
-
return index === -1 ? void 0 : argv[index + 1];
|
|
53
|
+
return index === -1 ? void 0 : argv[index + 1] ?? "";
|
|
54
54
|
};
|
|
55
55
|
var activeHookSource = (argv) => {
|
|
56
56
|
const named = namedAgent(argv);
|
|
57
57
|
if (named !== void 0) return hookCompatibleProfile(named)?.source ?? null;
|
|
58
58
|
const source = namedSource(argv);
|
|
59
59
|
if (source === void 0) return "claude";
|
|
60
|
-
return hookCompatibleProfileBySource(source)?.source ??
|
|
60
|
+
return source === "claude" ? "claude" : hookCompatibleProfileBySource(source)?.source ?? null;
|
|
61
61
|
};
|
|
62
62
|
var PATCH_INPUT_KEYS = ["command", "patch", "input"];
|
|
63
63
|
var patchedFiles = (toolInput) => [...new Set(PATCH_INPUT_KEYS.flatMap((key) => parseApplyPatchFiles(toolInput[key])))];
|
|
@@ -2,24 +2,24 @@ import {
|
|
|
2
2
|
detectProviderLiveCapabilities,
|
|
3
3
|
hasSpawnProvider,
|
|
4
4
|
resolveControlPolicy
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KI36MAT6.js";
|
|
6
6
|
import {
|
|
7
7
|
daemonHasRemoteProof,
|
|
8
8
|
daemonServiceManagerAvailable,
|
|
9
9
|
hasDaemonServiceDefinition,
|
|
10
10
|
readDaemonNeedsLogin,
|
|
11
11
|
readDaemonStatus
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3BPB2HYZ.js";
|
|
13
13
|
import {
|
|
14
14
|
getMachineId
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3T52B2OF.js";
|
|
16
16
|
import {
|
|
17
17
|
getPackageVersion
|
|
18
18
|
} from "./chunk-DINDL2CF.js";
|
|
19
19
|
import {
|
|
20
20
|
readControlMode,
|
|
21
21
|
readKeySource
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TI3ZWXZG.js";
|
|
23
23
|
import {
|
|
24
24
|
getBaseUrl
|
|
25
25
|
} from "./chunk-2UMNXADU.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AGENT_CHOICES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-R3AMKNIW.js";
|
|
4
4
|
import {
|
|
5
5
|
isBridgeLocator
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LYXX5NSB.js";
|
|
7
7
|
import {
|
|
8
8
|
pusharyHookExecutable
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TF4IOINR.js";
|
|
10
10
|
import {
|
|
11
11
|
BELL_HOOK_BINARY
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JOVWYVSR.js";
|
|
13
13
|
|
|
14
14
|
// src/setup/hook-ownership.ts
|
|
15
15
|
var commandsIn = (value) => {
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
resolveBinary,
|
|
3
3
|
resolveGlobalPackageVersion,
|
|
4
4
|
resolvePackageVersionFromBinary
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-SAF6NNXY.js";
|
|
6
6
|
import {
|
|
7
7
|
MANAGED_PROVIDERS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FVKFDTN6.js";
|
|
9
9
|
|
|
10
10
|
// src/live-capabilities.ts
|
|
11
11
|
var CLAUDE_BRIDGE_CAPABILITY = "claude-bridge";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOTIFICATION_PUSH_TYPES,
|
|
3
3
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WEO5JCB4.js";
|
|
5
5
|
import {
|
|
6
6
|
cancelQuestion,
|
|
7
7
|
isPolicyConfig,
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
} from "./chunk-LGXUGYUH.js";
|
|
11
11
|
import {
|
|
12
12
|
getMachineId
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3T52B2OF.js";
|
|
14
14
|
import {
|
|
15
15
|
withRetry
|
|
16
16
|
} from "./chunk-EYRGBYZG.js";
|
|
17
17
|
import {
|
|
18
18
|
reportedInstallSource
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-K6I5M2ME.js";
|
|
20
20
|
import {
|
|
21
21
|
getApiKey,
|
|
22
22
|
getBaseUrl
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
resolveAutoResolveOrigin,
|
|
45
45
|
resolvePolicy,
|
|
46
46
|
toToolLookup
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-FVKFDTN6.js";
|
|
48
48
|
|
|
49
49
|
// src/policy.ts
|
|
50
50
|
import { createHash } from "crypto";
|
|
@@ -2004,6 +2004,7 @@ export {
|
|
|
2004
2004
|
preToolUseTimeoutDecision,
|
|
2005
2005
|
readLastPrompt,
|
|
2006
2006
|
CLAUDE_CODE_AGENT,
|
|
2007
|
+
AUTO_DECISION_WINDOW_MS,
|
|
2007
2008
|
reportEvent,
|
|
2008
2009
|
settleQuestionsForToolUse,
|
|
2009
2010
|
handlePostToolUse,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey,
|
|
15
15
|
normalizeKeyScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-FVKFDTN6.js";
|
|
17
17
|
|
|
18
18
|
// src/session.ts
|
|
19
19
|
var samePusharyAccount = (left, right) => left.kind === "ok" && right.kind === "ok" && left.identity.workspaceId !== "" && left.identity.workspaceId === right.identity.workspaceId && left.identity.siteId === right.identity.siteId;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
COMPATIBLE_AGENT_TYPES,
|
|
9
9
|
isValidApiKey
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FVKFDTN6.js";
|
|
11
11
|
|
|
12
12
|
// src/setup/options.ts
|
|
13
13
|
var AGENT_CHOICES = ["claude_code", "codex", "gemini_cli", "hermes", "cursor", "vscode", "opencode", ...COMPATIBLE_AGENT_TYPES, "custom"];
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
} from "./chunk-EYRGBYZG.js";
|
|
16
16
|
import {
|
|
17
17
|
reportedInstallSource
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-K6I5M2ME.js";
|
|
19
19
|
import {
|
|
20
20
|
isAnswerSource
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-FVKFDTN6.js";
|
|
22
22
|
|
|
23
23
|
// src/reach.ts
|
|
24
24
|
var reachVerdict = (channels) => {
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
GEMINI_HOOK_EVENTS,
|
|
4
4
|
hasGeminiHooks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ED5TA2FJ.js";
|
|
6
6
|
import {
|
|
7
7
|
CODEX_HOOK_EVENTS,
|
|
8
8
|
hasCodexHooks,
|
|
9
9
|
holdBudgetOf
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SAF6NNXY.js";
|
|
11
11
|
import {
|
|
12
12
|
CURSOR_GATE_EVENTS,
|
|
13
13
|
HOOK_LOCATOR_BINARY,
|
|
14
14
|
hookCommandHoldBudget
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FVKFDTN6.js";
|
|
16
16
|
|
|
17
17
|
// src/diagnostics/wiring.ts
|
|
18
18
|
var record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveInstallSourceFor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-K6I5M2ME.js";
|
|
4
4
|
import {
|
|
5
5
|
backupFile,
|
|
6
6
|
readJsonSafe,
|
|
@@ -102,6 +102,13 @@ var OUR_EXPORT = /^[ \t]*export[ \t]+PUSHARY_API_KEY=(['"]?)(pk_[a-f0-9]+\.[a-f0
|
|
|
102
102
|
var MENTIONS_KEY = /PUSHARY_API_KEY/;
|
|
103
103
|
var isComment = (line) => line.trimStart().startsWith("#");
|
|
104
104
|
var exportLine = (apiKey) => `export PUSHARY_API_KEY='${apiKey}'`;
|
|
105
|
+
var LOGOUT_MARK = "# removed by pushary logout";
|
|
106
|
+
var disabledExportLine = (line) => `# ${line.trim()} ${LOGOUT_MARK}`;
|
|
107
|
+
var isDisabledExport = (line) => {
|
|
108
|
+
const trimmed = line.trim();
|
|
109
|
+
if (!isComment(trimmed) || !trimmed.endsWith(LOGOUT_MARK)) return false;
|
|
110
|
+
return OUR_EXPORT.test(trimmed.slice(1, -LOGOUT_MARK.length).trim());
|
|
111
|
+
};
|
|
105
112
|
var keyPrefix = (key) => key.split(".")[0] ?? key;
|
|
106
113
|
var rcResult = (kind, over = {}) => ({
|
|
107
114
|
kind,
|
|
@@ -233,7 +240,7 @@ var clearKey = (options = {}) => {
|
|
|
233
240
|
const next = lines.map((line) => {
|
|
234
241
|
if (!OUR_EXPORT.test(line)) return line;
|
|
235
242
|
rcLinesDisabled += 1;
|
|
236
|
-
return
|
|
243
|
+
return disabledExportLine(line);
|
|
237
244
|
});
|
|
238
245
|
if (rcLinesDisabled > 0) writeFileSync2(real, next.join("\n"));
|
|
239
246
|
} catch {
|
|
@@ -283,11 +290,13 @@ var readKeySource = () => {
|
|
|
283
290
|
};
|
|
284
291
|
|
|
285
292
|
export {
|
|
293
|
+
CANDIDATE_RCS,
|
|
286
294
|
resolveShellRc,
|
|
287
295
|
installClaudeAlias,
|
|
288
296
|
removeClaudeAlias,
|
|
289
297
|
KEY_FILE_MODE,
|
|
290
298
|
exportLine,
|
|
299
|
+
isDisabledExport,
|
|
291
300
|
keyPrefix,
|
|
292
301
|
writeKey,
|
|
293
302
|
clearKey,
|
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
} from "./chunk-SGZJ5LYH.js";
|
|
7
7
|
import {
|
|
8
8
|
hookOwnerOf
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KEMEBTCJ.js";
|
|
10
10
|
import {
|
|
11
11
|
ensureDaemonRunning
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3BPB2HYZ.js";
|
|
13
13
|
import {
|
|
14
14
|
buildTranscriptRecords,
|
|
15
15
|
decodePublicKey,
|
|
16
16
|
generateSessionKey,
|
|
17
17
|
wrapSessionKey
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CRNAXFQ6.js";
|
|
19
19
|
import {
|
|
20
20
|
fetchTranscriptRecipients,
|
|
21
21
|
uploadTranscriptRecords
|
|
@@ -23,14 +23,14 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
transcriptEnvironmentPreference,
|
|
25
25
|
transcriptsEnabled
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-MN3XOVRK.js";
|
|
27
27
|
import {
|
|
28
28
|
codexHome,
|
|
29
29
|
pusharyDir
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-SAF6NNXY.js";
|
|
31
31
|
import {
|
|
32
32
|
readTranscriptPreference
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-TI3ZWXZG.js";
|
|
34
34
|
import {
|
|
35
35
|
writeJsonAtomic
|
|
36
36
|
} from "./chunk-T7E75EKA.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
supportedClaudeEvents
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ED5TA2FJ.js";
|
|
5
5
|
import {
|
|
6
6
|
guardBinary,
|
|
7
7
|
holdBudgetOf,
|
|
8
8
|
isProtectedByScope,
|
|
9
9
|
registerHookEntry
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SAF6NNXY.js";
|
|
11
11
|
import {
|
|
12
12
|
HOOK_LOCATOR_BINARY,
|
|
13
13
|
withHookHoldBudget
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FVKFDTN6.js";
|
|
15
15
|
|
|
16
16
|
// src/claude-config.ts
|
|
17
17
|
import { join } from "path";
|
|
@@ -8,15 +8,15 @@ import {
|
|
|
8
8
|
reapplyGeminiSettings,
|
|
9
9
|
reapplyVsCodePlugin,
|
|
10
10
|
repairCodexHolds
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-2GMI6JH6.js";
|
|
12
|
+
import "./chunk-LUT2EZLG.js";
|
|
13
|
+
import "./chunk-WIOXWUUH.js";
|
|
14
|
+
import "./chunk-TF4IOINR.js";
|
|
15
|
+
import "./chunk-ED5TA2FJ.js";
|
|
16
|
+
import "./chunk-WEO5JCB4.js";
|
|
17
|
+
import "./chunk-SAF6NNXY.js";
|
|
18
18
|
import "./chunk-T7E75EKA.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-FVKFDTN6.js";
|
|
20
20
|
export {
|
|
21
21
|
inspectConfiguredManagedProviders,
|
|
22
22
|
reapplyAllAgents,
|