@pushary/agent-hooks 1.9.13 → 1.9.15
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 +18 -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 +72 -48
- 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 +27 -27
- package/dist/bin/pushary-hook.js +29 -29
- package/dist/bin/pushary-login.js +12 -12
- package/dist/bin/pushary-logout.js +10 -10
- 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 +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 +35 -35
- 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-G5K656XW.js → chunk-2DCGUCPZ.js} +2 -2
- package/dist/{chunk-LUYAXSUS.js → chunk-3FQCZSEQ.js} +3 -3
- package/dist/{chunk-UUBEEKT6.js → chunk-3QXCTYMG.js} +2 -2
- package/dist/{chunk-3EOXZYUE.js → chunk-3YCYTGGK.js} +1 -1
- package/dist/{chunk-JRKUJOZL.js → chunk-52JA2WTH.js} +1 -1
- package/dist/{chunk-Y25RH4VF.js → chunk-57VUNV32.js} +1 -1
- package/dist/{chunk-6CM3B4PJ.js → chunk-5BIMNGRQ.js} +6 -6
- package/dist/{chunk-S2LDTUHS.js → chunk-5EWNGYFD.js} +2 -2
- package/dist/{chunk-TDSLVFG6.js → chunk-5LQ7QUVF.js} +1 -1
- package/dist/{chunk-GYR4G4WO.js → chunk-6GRUERVL.js} +1 -1
- package/dist/{chunk-J2VNQSS6.js → chunk-6LORREOI.js} +1 -1
- package/dist/{chunk-MPDJJNGA.js → chunk-6MLSXBNR.js} +2 -2
- package/dist/{chunk-YI37QERZ.js → chunk-6WECKO24.js} +4 -4
- package/dist/{chunk-4ZSWBLVM.js → chunk-7QZZK2YU.js} +6 -6
- package/dist/{chunk-FWAXBC3P.js → chunk-7VOEZPJ4.js} +1 -1
- package/dist/{chunk-TVDI7SX2.js → chunk-AYV2NRYJ.js} +104 -2
- package/dist/{chunk-MWP65CZ3.js → chunk-C2OUUGCW.js} +2 -2
- package/dist/{chunk-WIRM7ZLI.js → chunk-COZE23R3.js} +2 -2
- package/dist/{chunk-OOZ5RSEF.js → chunk-CU7Y7Y4L.js} +2 -2
- package/dist/{chunk-WL4PVINO.js → chunk-D72OJS4S.js} +2 -2
- package/dist/{chunk-226PID65.js → chunk-FZW7Q7GM.js} +5 -5
- package/dist/{chunk-OOKRWBCG.js → chunk-H5YC7H6V.js} +3 -3
- package/dist/{chunk-WP57USIT.js → chunk-HJL5RBOU.js} +4 -4
- package/dist/{chunk-G54VGPRX.js → chunk-HSVJ62BE.js} +1 -1
- package/dist/{chunk-7JM6TCMA.js → chunk-HTO2XULO.js} +1 -1
- package/dist/{chunk-6NL3LYUM.js → chunk-IQCNOEQL.js} +13 -18
- package/dist/{chunk-HHMMY6TB.js → chunk-JC3AGMOP.js} +2 -2
- package/dist/{chunk-7VWIBIDK.js → chunk-JEJSAI6Z.js} +4 -4
- package/dist/{chunk-RJAPOB34.js → chunk-LJJWNHUW.js} +2 -2
- package/dist/{chunk-3VSMTCXV.js → chunk-ME55HQOI.js} +4 -4
- package/dist/{chunk-43ORAXAL.js → chunk-NA5D62OI.js} +1 -1
- package/dist/{chunk-6QPQG3Q5.js → chunk-NDKFHLJI.js} +5 -5
- package/dist/{chunk-QIPDIZC5.js → chunk-NDZBDXU3.js} +4 -4
- package/dist/{chunk-TCVFNLMM.js → chunk-OIESPH3R.js} +21 -18
- package/dist/{chunk-4ATFPZ6X.js → chunk-PNUWMEIY.js} +1 -1
- package/dist/{chunk-U6QEHPEF.js → chunk-PSWFYNOX.js} +3 -3
- package/dist/{chunk-5QTQI3HL.js → chunk-Q4JD6WNB.js} +1 -1
- package/dist/{chunk-RI5E5JQS.js → chunk-QIOWXUFH.js} +1 -1
- package/dist/{chunk-GFAVGG3X.js → chunk-SDDKVY4I.js} +5 -5
- package/dist/{chunk-LYDO2SS6.js → chunk-SYLJL63X.js} +3 -3
- package/dist/{chunk-43IDNI4X.js → chunk-TFV6RATK.js} +5 -5
- package/dist/{chunk-3LSJ7YVM.js → chunk-TMQMUGSN.js} +3 -3
- package/dist/{chunk-NPRFA7YM.js → chunk-VKTDXQGH.js} +2 -2
- package/dist/{chunk-4EAILOOQ.js → chunk-VP6WDFVO.js} +3 -3
- package/dist/{chunk-LHLUKFJV.js → chunk-WBQK6KD5.js} +8 -8
- package/dist/{chunk-ZAH3CCEV.js → chunk-WJO7SENK.js} +4 -4
- package/dist/{chunk-LBNIISXH.js → chunk-WWTB4DAE.js} +1 -1
- package/dist/{chunk-U5SXTKZV.js → chunk-Y6KG5JZP.js} +2 -2
- package/dist/{chunk-6MGD24SH.js → chunk-YKYFFCB5.js} +1 -1
- package/dist/{chunk-JVUK5YFM.js → chunk-YL6HU2KF.js} +5 -5
- package/dist/{chunk-VUHT6NYV.js → chunk-YOHPJNFW.js} +4 -4
- package/dist/{chunk-RYKU62ZI.js → chunk-ZH74RRGM.js} +1 -1
- package/dist/{chunk-N6XFGVNW.js → chunk-ZMUDVPOT.js} +3 -3
- package/dist/{global-upgrade-NIFOQFV4.js → global-upgrade-MOBLBPIJ.js} +6 -6
- package/dist/{paths-QPBLO5Q2.js → paths-55SPLYW5.js} +2 -2
- package/dist/{reapply-TVMBJWJB.js → reapply-SOIJJKGO.js} +20 -20
- package/dist/src/index.js +19 -19
- package/dist/{upgrade-lock-Z3LYROGK.js → upgrade-lock-FER4DMDA.js} +3 -3
- package/package.json +1 -1
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
permissionDeniedAction,
|
|
7
7
|
releaseThrottle,
|
|
8
8
|
reportEvent
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-IQCNOEQL.js";
|
|
10
10
|
import {
|
|
11
11
|
machineDecisionFor,
|
|
12
12
|
shouldDeferToNativeMode,
|
|
13
13
|
wireVerdictFor
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-AYV2NRYJ.js";
|
|
15
15
|
|
|
16
16
|
// src/machine-decision-audit.ts
|
|
17
17
|
import { basename } from "path";
|
|
@@ -2,23 +2,23 @@ import {
|
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
GEMINI_HOOK_EVENTS,
|
|
4
4
|
hasGeminiHooks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-VP6WDFVO.js";
|
|
6
6
|
import {
|
|
7
7
|
AGENT_CHOICES
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YKYFFCB5.js";
|
|
9
9
|
import {
|
|
10
10
|
BELL_HOOK_BINARY
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7VOEZPJ4.js";
|
|
12
12
|
import {
|
|
13
13
|
CODEX_HOOK_EVENTS,
|
|
14
14
|
hasCodexHooks,
|
|
15
15
|
holdBudgetOf
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-HJL5RBOU.js";
|
|
17
17
|
import {
|
|
18
18
|
CURSOR_GATE_EVENTS,
|
|
19
19
|
HOOK_LOCATOR_BINARY,
|
|
20
20
|
hookCommandHoldBudget
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-AYV2NRYJ.js";
|
|
22
22
|
|
|
23
23
|
// src/diagnostics/bridge.ts
|
|
24
24
|
import { execFileSync } from "child_process";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile,
|
|
3
3
|
hasCompatibleHooks
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ME55HQOI.js";
|
|
5
5
|
import {
|
|
6
6
|
pusharyHookExecutable
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FZW7Q7GM.js";
|
|
8
8
|
import {
|
|
9
9
|
isProtectedByScope,
|
|
10
10
|
registerHookEntry
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HJL5RBOU.js";
|
|
12
12
|
|
|
13
13
|
// src/cursor-config.ts
|
|
14
14
|
var hookCommandOf = (entry) => {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
isReleaseVersion,
|
|
14
14
|
ownPackageName,
|
|
15
15
|
withHookHoldBudget
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AYV2NRYJ.js";
|
|
17
17
|
|
|
18
18
|
// src/setup/paths.ts
|
|
19
19
|
import { homedir as homedir2 } from "os";
|
|
@@ -365,9 +365,9 @@ var installGlobally = (options) => {
|
|
|
365
365
|
}
|
|
366
366
|
const started = (async () => {
|
|
367
367
|
if (!npmIsOnPath()) throw new NpmMissingError();
|
|
368
|
-
const { withUpgradeLock } = await import("./global-upgrade-
|
|
369
|
-
const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-
|
|
370
|
-
const { autoUpdateLock: autoUpdateLock2 } = await import("./paths-
|
|
368
|
+
const { withUpgradeLock } = await import("./global-upgrade-MOBLBPIJ.js");
|
|
369
|
+
const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-FER4DMDA.js");
|
|
370
|
+
const { autoUpdateLock: autoUpdateLock2 } = await import("./paths-55SPLYW5.js");
|
|
371
371
|
let result = "skipped";
|
|
372
372
|
const install = async () => {
|
|
373
373
|
const platform = process.platform;
|
|
@@ -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-YL6HU2KF.js";
|
|
14
14
|
import {
|
|
15
15
|
withRetry
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-SYLJL63X.js";
|
|
17
17
|
import {
|
|
18
18
|
getMachineId
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NA5D62OI.js";
|
|
20
20
|
import {
|
|
21
21
|
reportedInstallSource
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-VKTDXQGH.js";
|
|
23
23
|
import {
|
|
24
24
|
canonicalJson
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-HJL5RBOU.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-HTO2XULO.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,
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
resolvePackageVersionFromBinary,
|
|
11
11
|
resolvePathBinary,
|
|
12
12
|
resolvePathBinaryAsync
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-HJL5RBOU.js";
|
|
14
14
|
import {
|
|
15
15
|
MANAGED_PROVIDERS
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AYV2NRYJ.js";
|
|
17
17
|
|
|
18
18
|
// src/setup/codex-install.ts
|
|
19
19
|
var NATIVE_BINARY_MIN_BYTES = 20 * 1024 * 1024;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerTranscript
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WBQK6KD5.js";
|
|
4
4
|
import {
|
|
5
5
|
namedEvent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ME55HQOI.js";
|
|
7
7
|
import {
|
|
8
8
|
writeDegraded
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YL6HU2KF.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"];
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
codexHooksJsonIn,
|
|
9
9
|
isPusharyCodexCommand,
|
|
10
10
|
resolvePathBinary
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HJL5RBOU.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";
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
addGeminiMcpServer,
|
|
4
4
|
removeGeminiMcpServer,
|
|
5
5
|
supportedClaudeEvents
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VP6WDFVO.js";
|
|
7
7
|
import {
|
|
8
8
|
CLAUDE_CODE_AGENT,
|
|
9
9
|
parseApplyPatchFiles
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IQCNOEQL.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-HJL5RBOU.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";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ME55HQOI.js";
|
|
4
4
|
import {
|
|
5
5
|
hookOwnerOf,
|
|
6
6
|
hookOwnerOfCommands,
|
|
7
7
|
liveBridgeProbe,
|
|
8
8
|
resolveBridgeStub
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FZW7Q7GM.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-HJL5RBOU.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,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MCP_BRIDGE_BINARY
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D72OJS4S.js";
|
|
4
4
|
import {
|
|
5
5
|
KEY_FILE_MODE
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5EWNGYFD.js";
|
|
7
7
|
import {
|
|
8
8
|
NpmMissingError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HJL5RBOU.js";
|
|
10
10
|
import {
|
|
11
11
|
readJsonSafe,
|
|
12
12
|
writeFileAtomic,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-T7E75EKA.js";
|
|
15
15
|
import {
|
|
16
16
|
NPX_LATEST_COMMAND
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-PNUWMEIY.js";
|
|
18
18
|
|
|
19
19
|
// src/instruction-file.ts
|
|
20
20
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync } from "fs";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defersToNativeMode,
|
|
3
3
|
reportMachineDenial
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-COZE23R3.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-6GRUERVL.js";
|
|
15
15
|
import {
|
|
16
16
|
activeHookSource,
|
|
17
17
|
activeIdentity
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ME55HQOI.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-IQCNOEQL.js";
|
|
44
44
|
import {
|
|
45
45
|
askUser,
|
|
46
46
|
cancelQuestion,
|
|
@@ -51,32 +51,34 @@ import {
|
|
|
51
51
|
requestGate,
|
|
52
52
|
sendNotification,
|
|
53
53
|
waitForQuestion
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-YL6HU2KF.js";
|
|
55
55
|
import {
|
|
56
56
|
SubscriptionRequiredError
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-SYLJL63X.js";
|
|
58
58
|
import {
|
|
59
59
|
getMachineId
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-NA5D62OI.js";
|
|
61
61
|
import {
|
|
62
62
|
getApiKey,
|
|
63
63
|
getBaseUrl
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-HTO2XULO.js";
|
|
65
65
|
import {
|
|
66
66
|
NPX_LATEST_COMMAND
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-PNUWMEIY.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,
|
|
77
78
|
WITHDRAWN_APPROVAL_REASON,
|
|
78
79
|
agentQuestionStrategy,
|
|
79
80
|
agentRulesAllowEveryInput,
|
|
81
|
+
approvalModeWithoutLocalPrompt,
|
|
80
82
|
buildDecisionEpisodeFeatures,
|
|
81
83
|
claudeAllowlistOwnsCall,
|
|
82
84
|
claudeConsultsItsAllowlist,
|
|
@@ -101,7 +103,7 @@ import {
|
|
|
101
103
|
parseAgentQuestions,
|
|
102
104
|
questionHandedToTheTerminal,
|
|
103
105
|
resolveGate
|
|
104
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-AYV2NRYJ.js";
|
|
105
107
|
|
|
106
108
|
// src/claude-permission-rules.ts
|
|
107
109
|
import { readFileSync, statSync } from "fs";
|
|
@@ -316,6 +318,7 @@ var dispatchModeHandler = async (apiKey, input, toolPolicy, machineId, trainingC
|
|
|
316
318
|
const projectName = basename(input.cwd ?? process.cwd());
|
|
317
319
|
const sessionId = input.session_id;
|
|
318
320
|
const toolTarget = deriveToolTarget(input.tool_name, input.tool_input);
|
|
321
|
+
const ownPrompt = hasItsOwnApprovalPrompt(ACTIVE_SOURCE);
|
|
319
322
|
const intent = readLastPrompt(sessionId ?? DEFAULT_SESSION) ?? (input.transcript_path ? readLastUserPrompt(input.transcript_path) : void 0);
|
|
320
323
|
const decision = {
|
|
321
324
|
toolPath: hookWritePath(input.tool_name, input.tool_input),
|
|
@@ -331,11 +334,12 @@ var dispatchModeHandler = async (apiKey, input, toolPolicy, machineId, trainingC
|
|
|
331
334
|
// no suffix here. Absent on runtimes that do not send one, and the server then
|
|
332
335
|
// creates a fresh decision exactly as before.
|
|
333
336
|
toolUseId: input.tool_use_id,
|
|
334
|
-
sessionToolAware: true
|
|
337
|
+
sessionToolAware: true,
|
|
338
|
+
...ownPrompt ? {} : { localSurfaceAvailable: false }
|
|
335
339
|
};
|
|
336
340
|
const signals = {};
|
|
337
341
|
const runHandler = () => {
|
|
338
|
-
switch (toolPolicy.mode) {
|
|
342
|
+
switch (ownPrompt ? toolPolicy.mode : approvalModeWithoutLocalPrompt(toolPolicy.mode)) {
|
|
339
343
|
case "push_only":
|
|
340
344
|
return handlePushOnly(apiKey, description, projectName, toolPolicy.timeoutSeconds, toolPolicy.timeoutAction, sessionId, machineId, input.tool_name, toolTarget, decision, signals);
|
|
341
345
|
case "terminal_only":
|
|
@@ -354,10 +358,10 @@ var dispatchModeHandler = async (apiKey, input, toolPolicy, machineId, trainingC
|
|
|
354
358
|
}
|
|
355
359
|
return result;
|
|
356
360
|
};
|
|
357
|
-
var
|
|
361
|
+
var hasItsOwnApprovalPrompt = (source) => source === null || hasNativeApprovalPrompt(source, "PreToolUse");
|
|
358
362
|
var phoneWaitHandoff = (source, waitSeconds) => {
|
|
359
363
|
if (waitSeconds <= 0) return "Waiting for your answer.";
|
|
360
|
-
return
|
|
364
|
+
return hasItsOwnApprovalPrompt(source) ? `Waiting ${waitSeconds}s, then this terminal takes over.` : `Waiting ${waitSeconds}s. If nobody answers, it does not run.`;
|
|
361
365
|
};
|
|
362
366
|
var announceWait = (waitSeconds, answerUrl, sessionId) => {
|
|
363
367
|
try {
|
|
@@ -542,7 +546,6 @@ var claudeGateInput = (modeState, config, input, canonical) => {
|
|
|
542
546
|
};
|
|
543
547
|
};
|
|
544
548
|
var unreadableReason = "Pushary could not read every target of this call. Use a supported command or a single-file edit.";
|
|
545
|
-
var batchScopeReason = "This patch exceeds the agreed scope. Split it into single-file edits so each additional path can be approved.";
|
|
546
549
|
var BLOCKED_ACTION_GATE_TIMEOUT_MS = 15e3;
|
|
547
550
|
var BLOCKED_ACTION_CLAIM_TIMEOUT_MS = 4e3;
|
|
548
551
|
var BLOCKED_ACTION_ALLOW_REASON = "Approved from Pushary after auto mode blocked it";
|
|
@@ -613,7 +616,7 @@ var handlePreToolUse = async (input, canonical) => {
|
|
|
613
616
|
return deny(verdict.reason);
|
|
614
617
|
}
|
|
615
618
|
if (canonical === null) return deny(unreadableReason);
|
|
616
|
-
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);
|
|
617
620
|
if (agentQuestionStrategy(ACTIVE_SOURCE, "PreToolUse", input.tool_name) === AGENT_QUESTION_STRATEGY.native) return void 0;
|
|
618
621
|
if (input.tool_name === "AskUserQuestion") {
|
|
619
622
|
return handleAskUserQuestion(apiKey, input, modeState);
|
|
@@ -680,7 +683,7 @@ var handlePermissionRequest = async (input, canonical) => {
|
|
|
680
683
|
}
|
|
681
684
|
if (canonical === null) return permReqDeny(unreadableReason);
|
|
682
685
|
if (agentQuestionStrategy(ACTIVE_SOURCE, "PermissionRequest", input.tool_name) === AGENT_QUESTION_STRATEGY.native) return void 0;
|
|
683
|
-
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);
|
|
684
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;
|
|
685
688
|
switch (verdict.kind) {
|
|
686
689
|
case "allow":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyFetch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3FQCZSEQ.js";
|
|
4
4
|
import {
|
|
5
5
|
NetworkError
|
|
6
6
|
} from "./chunk-7QLSKOSU.js";
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
} from "./chunk-KZERVKTD.js";
|
|
10
10
|
import {
|
|
11
11
|
getBaseUrl
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HTO2XULO.js";
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey,
|
|
15
15
|
normalizeKeyScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AYV2NRYJ.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;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
forkFinishWithUpgradeLock,
|
|
5
5
|
installWithUpgradeLock,
|
|
6
6
|
releaseAutoUpdateLock
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-57VUNV32.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-6MLSXBNR.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-HJL5RBOU.js";
|
|
31
31
|
import {
|
|
32
32
|
NPX_LATEST_COMMAND
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-PNUWMEIY.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";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
keyCheckFromResponse
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PSWFYNOX.js";
|
|
4
4
|
import {
|
|
5
5
|
installNetworkDefaults
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3FQCZSEQ.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HTO2XULO.js";
|
|
10
10
|
|
|
11
11
|
// src/retry.ts
|
|
12
12
|
var isRetryable = (err) => {
|