@pushary/agent-hooks 1.2.0 → 1.3.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 +7 -0
- package/data/SKILL.md +22 -10
- package/data/cursor-plugin/skills/pushary/SKILL.md +21 -9
- package/data/vscode-plugin/skills/pushary/SKILL.md +21 -9
- package/dist/bin/pushary-bell-hook.js +20 -20
- package/dist/bin/pushary-bell.js +7 -7
- package/dist/bin/pushary-claude.js +20 -20
- package/dist/bin/pushary-clean.js +21 -21
- package/dist/bin/pushary-codex-bridge.js +11 -11
- package/dist/bin/pushary-codex-hook.js +24 -24
- package/dist/bin/pushary-codex.js +7 -7
- package/dist/bin/pushary-connect.js +7 -7
- package/dist/bin/pushary-cowork.js +3 -3
- package/dist/bin/pushary-daemon.js +24 -24
- package/dist/bin/pushary-disconnect.js +11 -11
- package/dist/bin/pushary-doctor.js +35 -22
- package/dist/bin/pushary-elicitation-hook.js +19 -19
- package/dist/bin/pushary-gemini-bridge.js +10 -10
- package/dist/bin/pushary-gemini-hook.js +21 -21
- package/dist/bin/pushary-hook.js +30 -40
- package/dist/bin/pushary-login.js +8 -8
- package/dist/bin/pushary-logout.js +5 -5
- package/dist/bin/pushary-mode.js +3 -3
- package/dist/bin/pushary-notification-hook.js +22 -22
- package/dist/bin/pushary-opencode-hook.js +21 -21
- package/dist/bin/pushary-permission-denied-hook.js +26 -26
- package/dist/bin/pushary-permission-hook.js +30 -29
- package/dist/bin/pushary-post-hook.js +22 -22
- package/dist/bin/pushary-prompt-hook.js +22 -22
- package/dist/bin/pushary-session-end-hook.js +22 -22
- package/dist/bin/pushary-session-start-hook.js +24 -24
- package/dist/bin/pushary-setup.js +27 -27
- package/dist/bin/pushary-stats.js +2 -2
- package/dist/bin/pushary-status.js +11 -11
- package/dist/bin/pushary-stop-hook.js +22 -22
- package/dist/bin/pushary-stopfailure-hook.js +22 -22
- package/dist/bin/pushary-transcript-register.js +18 -18
- package/dist/bin/pushary-transcripts.js +6 -6
- package/dist/bin/pushary-upgrade.js +15 -15
- package/dist/bin/pushary-wait.js +3 -3
- package/dist/{chunk-PX53RT6Q.js → chunk-34NNTYK6.js} +1 -1
- package/dist/{chunk-7ERWAYVV.js → chunk-35RPUNYU.js} +1 -1
- package/dist/{chunk-KZPUARCU.js → chunk-465UENKO.js} +2 -2
- package/dist/{chunk-7TDQ7KDY.js → chunk-5SALHATY.js} +2 -2
- package/dist/{chunk-7DQVIIHX.js → chunk-5UWDYOZX.js} +33 -6
- package/dist/{chunk-ZFQPSGPO.js → chunk-5WLH2ENB.js} +1 -1
- package/dist/{chunk-YK3OU4E2.js → chunk-5XKMOZO6.js} +4 -4
- package/dist/{chunk-CVCSUAXI.js → chunk-6HH4IH4K.js} +4 -4
- package/dist/{chunk-JQJB7BZE.js → chunk-AFKOWCMQ.js} +1 -1
- package/dist/{chunk-JOTV75GX.js → chunk-AFOTOA24.js} +1 -1
- package/dist/{chunk-6QCN5XQE.js → chunk-CDSL3LLO.js} +1 -1
- package/dist/{chunk-4UT44NRP.js → chunk-CKLWJ6EL.js} +10 -2
- package/dist/{chunk-VDOKRCWM.js → chunk-EAGMQMRM.js} +1 -1
- package/dist/{chunk-WC5PYFDK.js → chunk-FGNABUPN.js} +1 -1
- package/dist/{chunk-BXLFUTSD.js → chunk-HCTSTMDD.js} +4 -4
- package/dist/{chunk-KODKICKJ.js → chunk-I2OLM3DM.js} +30 -21
- package/dist/{chunk-LGO7U23Z.js → chunk-JZA2JOGO.js} +1 -1
- package/dist/{chunk-ERP7FOFQ.js → chunk-KHGIM2BN.js} +3 -3
- package/dist/{chunk-U42ES5U3.js → chunk-KLZJEMSE.js} +1 -1
- package/dist/{chunk-YT6H7BB5.js → chunk-LWT34GSY.js} +20 -13
- package/dist/{chunk-VE2ZWUML.js → chunk-NDSOOJDX.js} +1 -1
- package/dist/{chunk-2DT7STR5.js → chunk-OMP3KDDU.js} +1 -1
- package/dist/{chunk-PCT2MYG5.js → chunk-P232YODQ.js} +8 -8
- package/dist/{chunk-7GH3D6YG.js → chunk-PEV6ULSM.js} +3 -3
- package/dist/{chunk-CG4ZUQ5O.js → chunk-PHXU4NOP.js} +2 -2
- package/dist/{chunk-LAXU5U75.js → chunk-QDYJQLXT.js} +2 -2
- package/dist/{chunk-C3WH44MH.js → chunk-QOCWB4Q6.js} +3 -3
- package/dist/{chunk-OGSRCIOD.js → chunk-R5CU7ED6.js} +1 -1
- package/dist/{chunk-W6XVHP4U.js → chunk-REIZ5GXG.js} +4 -4
- package/dist/{chunk-DRAATYTY.js → chunk-RERJ2ZDV.js} +6 -6
- package/dist/{chunk-PX54KULQ.js → chunk-SGZE2JBF.js} +3 -3
- package/dist/{chunk-YKLCWWEI.js → chunk-SGZJ5LYH.js} +1 -1
- package/dist/{chunk-4LL6LG5X.js → chunk-T7E75EKA.js} +4 -3
- package/dist/{chunk-VIQ7CCWW.js → chunk-TGG4FWWB.js} +2 -2
- package/dist/{chunk-RN6ZWIAC.js → chunk-TW7KA27C.js} +1 -1
- package/dist/{chunk-5AATCXJN.js → chunk-WOBHHXW5.js} +4 -4
- package/dist/{chunk-KEVJ2WW6.js → chunk-XOUQUZ43.js} +2 -2
- package/dist/{chunk-UWP66NDF.js → chunk-XP2KRTZD.js} +1 -1
- package/dist/{chunk-LWKVEMVK.js → chunk-XVE52YFZ.js} +1 -1
- package/dist/{chunk-KHTBSSY5.js → chunk-YXWM4TNX.js} +1 -1
- package/dist/{reapply-47AMVIXN.js → reapply-ADFRVH5N.js} +9 -9
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.js +13 -13
- package/package.json +1 -1
- /package/dist/{chunk-KBITFQST.js → chunk-P32LPT2L.js} +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOTIFICATION_MATCHED_TYPES,
|
|
3
3
|
POSTTOOLUSE_MIRRORED_TOOLS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XP2KRTZD.js";
|
|
5
5
|
import {
|
|
6
6
|
isProtectedByScope,
|
|
7
7
|
registerHookEntry
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-34NNTYK6.js";
|
|
9
9
|
import {
|
|
10
10
|
CLAUDE_PRETOOLUSE_MATCHER,
|
|
11
11
|
HOOK_BUDGETS,
|
|
12
12
|
HOOK_LOCATOR_BINARY
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5UWDYOZX.js";
|
|
14
14
|
|
|
15
15
|
// src/gemini-config.ts
|
|
16
16
|
var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
|
|
@@ -3,36 +3,40 @@ import {
|
|
|
3
3
|
addPusharyToolPermissions,
|
|
4
4
|
isPusharyHook,
|
|
5
5
|
removeClaudeMcpServers
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SGZE2JBF.js";
|
|
7
7
|
import {
|
|
8
8
|
CLAUDE_HOOK_EVENTS,
|
|
9
9
|
addGeminiMcpServer,
|
|
10
10
|
removeGeminiMcpServer
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-KHGIM2BN.js";
|
|
12
12
|
import {
|
|
13
13
|
CLAUDE_CODE_AGENT,
|
|
14
14
|
parseApplyPatchFiles
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WOBHHXW5.js";
|
|
16
16
|
import {
|
|
17
17
|
guardBinary,
|
|
18
18
|
holdBudgetOf,
|
|
19
19
|
registerHookEntry
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-34NNTYK6.js";
|
|
21
21
|
import {
|
|
22
22
|
PHONE_ANSWERED_TOOLS,
|
|
23
23
|
hookCompatibleProfile,
|
|
24
|
+
hookCompatibleProfileBySource,
|
|
24
25
|
toToolLookup,
|
|
25
26
|
withHookHoldBudget
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-5UWDYOZX.js";
|
|
27
28
|
|
|
28
29
|
// src/compatible-config.ts
|
|
29
30
|
import { homedir } from "os";
|
|
30
31
|
import { isAbsolute, join, resolve } from "path";
|
|
31
32
|
var AGENT_FLAG = "--agent";
|
|
33
|
+
var SOURCE_FLAG = "--source";
|
|
32
34
|
var agentArgument = (profile) => `${AGENT_FLAG}=${profile.agentType}`;
|
|
33
35
|
var profileFromArgv = (argv) => {
|
|
34
36
|
const named = namedAgent(argv);
|
|
35
|
-
|
|
37
|
+
if (named !== void 0) return hookCompatibleProfile(named);
|
|
38
|
+
const source = namedSource(argv);
|
|
39
|
+
return source === void 0 ? void 0 : hookCompatibleProfileBySource(source);
|
|
36
40
|
};
|
|
37
41
|
var activeIdentity = (argv) => {
|
|
38
42
|
const profile = profileFromArgv(argv);
|
|
@@ -42,10 +46,18 @@ var namedAgent = (argv) => {
|
|
|
42
46
|
const prefix = `${AGENT_FLAG}=`;
|
|
43
47
|
return argv.find((argument) => argument.startsWith(prefix))?.slice(prefix.length);
|
|
44
48
|
};
|
|
49
|
+
var namedSource = (argv) => {
|
|
50
|
+
const inline = argv.find((argument) => argument.startsWith(`${SOURCE_FLAG}=`));
|
|
51
|
+
if (inline) return inline.slice(SOURCE_FLAG.length + 1);
|
|
52
|
+
const index = argv.indexOf(SOURCE_FLAG);
|
|
53
|
+
return index === -1 ? void 0 : argv[index + 1];
|
|
54
|
+
};
|
|
45
55
|
var activeHookSource = (argv) => {
|
|
46
56
|
const named = namedAgent(argv);
|
|
47
|
-
if (named
|
|
48
|
-
|
|
57
|
+
if (named !== void 0) return hookCompatibleProfile(named)?.source ?? null;
|
|
58
|
+
const source = namedSource(argv);
|
|
59
|
+
if (source === void 0) return "claude";
|
|
60
|
+
return hookCompatibleProfileBySource(source)?.source ?? "claude";
|
|
49
61
|
};
|
|
50
62
|
var PATCH_INPUT_KEYS = ["command", "patch", "input"];
|
|
51
63
|
var patchedFiles = (toolInput) => [...new Set(PATCH_INPUT_KEYS.flatMap((key) => parseApplyPatchFiles(toolInput[key])))];
|
|
@@ -62,10 +74,6 @@ var normalizeToolCall = (profile, input) => {
|
|
|
62
74
|
const lookup = lookupFor(profile, input);
|
|
63
75
|
return { ...input, tool_name: lookup.tool, tool_input: lookup.input };
|
|
64
76
|
};
|
|
65
|
-
var unreadableTool = (profile, input) => {
|
|
66
|
-
if (!profile || !input.tool_name) return void 0;
|
|
67
|
-
return lookupFor(profile, input).unreadable ? input.tool_name : void 0;
|
|
68
|
-
};
|
|
69
77
|
var underHome = (segments, home = homedir()) => join(home, ...segments);
|
|
70
78
|
var compatibleConfigFile = (profile, home) => underHome(profile.configFile, home);
|
|
71
79
|
var compatibleMcpFile = (profile, home) => profile.mcp ? underHome(profile.mcp.file, home) : null;
|
|
@@ -215,7 +223,6 @@ export {
|
|
|
215
223
|
activeIdentity,
|
|
216
224
|
activeHookSource,
|
|
217
225
|
normalizeToolCall,
|
|
218
|
-
unreadableTool,
|
|
219
226
|
compatibleConfigFile,
|
|
220
227
|
compatibleMcpFile,
|
|
221
228
|
compatibleInstructionsFile,
|
|
@@ -3,19 +3,19 @@ import {
|
|
|
3
3
|
loadPin,
|
|
4
4
|
savePin,
|
|
5
5
|
verifyRecipients
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SGZJ5LYH.js";
|
|
7
7
|
import {
|
|
8
8
|
hookOwnerOf
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-REIZ5GXG.js";
|
|
10
10
|
import {
|
|
11
11
|
ensureDaemonRunning
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6HH4IH4K.js";
|
|
13
13
|
import {
|
|
14
14
|
buildTranscriptRecords,
|
|
15
15
|
decodePublicKey,
|
|
16
16
|
generateSessionKey,
|
|
17
17
|
wrapSessionKey
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CDSL3LLO.js";
|
|
19
19
|
import {
|
|
20
20
|
fetchTranscriptRecipients,
|
|
21
21
|
uploadTranscriptRecords
|
|
@@ -23,17 +23,17 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
transcriptEnvironmentPreference,
|
|
25
25
|
transcriptsEnabled
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-YXWM4TNX.js";
|
|
27
27
|
import {
|
|
28
28
|
codexHome,
|
|
29
29
|
pusharyDir
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-34NNTYK6.js";
|
|
31
31
|
import {
|
|
32
32
|
readTranscriptPreference
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-5SALHATY.js";
|
|
34
34
|
import {
|
|
35
35
|
writeJsonAtomic
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-T7E75EKA.js";
|
|
37
37
|
import {
|
|
38
38
|
getApiKey,
|
|
39
39
|
getBaseUrl
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openCodeConfigDirFrom
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XVE52YFZ.js";
|
|
4
4
|
import {
|
|
5
5
|
codexHomeFrom
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-34NNTYK6.js";
|
|
7
7
|
import {
|
|
8
8
|
HOOK_COMPATIBLE_PROFILES
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5UWDYOZX.js";
|
|
10
10
|
|
|
11
11
|
// src/vscode-config.ts
|
|
12
12
|
import { homedir } from "os";
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
resolveBinary,
|
|
3
3
|
resolveGlobalPackageVersion,
|
|
4
4
|
resolvePackageVersionFromBinary
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-34NNTYK6.js";
|
|
6
6
|
import {
|
|
7
7
|
MANAGED_PROVIDERS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5UWDYOZX.js";
|
|
9
9
|
|
|
10
10
|
// src/live-capabilities.ts
|
|
11
11
|
var CLAUDE_BRIDGE_CAPABILITY = "claude-bridge";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SETUP_FLAGS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FGNABUPN.js";
|
|
4
4
|
import {
|
|
5
5
|
parseFlags
|
|
6
6
|
} from "./chunk-GMXKITVA.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
CLAUDE_CONNECTOR_URL,
|
|
15
15
|
COWORK_CONNECTOR_LIMIT,
|
|
16
16
|
COWORK_STANDING_INSTRUCTIONS
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5UWDYOZX.js";
|
|
18
18
|
|
|
19
19
|
// src/cli/cowork.ts
|
|
20
20
|
import { readFileSync } from "fs";
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
GEMINI_HOOK_EVENTS,
|
|
4
4
|
hasGeminiHooks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KHGIM2BN.js";
|
|
6
6
|
import {
|
|
7
7
|
CODEX_HOOK_EVENTS,
|
|
8
8
|
hasCodexHooks,
|
|
9
9
|
holdBudgetOf
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-34NNTYK6.js";
|
|
11
11
|
import {
|
|
12
12
|
CURSOR_GATE_EVENTS,
|
|
13
13
|
HOOK_LOCATOR_BINARY,
|
|
14
14
|
hookCommandHoldBudget
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5UWDYOZX.js";
|
|
16
16
|
|
|
17
17
|
// src/diagnostics/wiring.ts
|
|
18
18
|
var record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AGENT_CHOICES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FGNABUPN.js";
|
|
4
4
|
import {
|
|
5
5
|
isBridgeLocator
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KLZJEMSE.js";
|
|
7
7
|
import {
|
|
8
8
|
pusharyHookExecutable
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QOCWB4Q6.js";
|
|
10
10
|
import {
|
|
11
11
|
BELL_HOOK_BINARY
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-EAGMQMRM.js";
|
|
13
13
|
|
|
14
14
|
// src/setup/hook-ownership.ts
|
|
15
15
|
var commandsIn = (value) => {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
detectClaudeVersion
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AFKOWCMQ.js";
|
|
4
4
|
import {
|
|
5
5
|
addClaudeMcpServer,
|
|
6
6
|
addPusharyHooks,
|
|
7
7
|
addPusharyToolPermissions
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SGZE2JBF.js";
|
|
9
9
|
import {
|
|
10
10
|
claudeUnprovenHolds,
|
|
11
11
|
claudeWired,
|
|
12
12
|
codexUnprovenHolds,
|
|
13
13
|
codexWired,
|
|
14
14
|
geminiWired
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QOCWB4Q6.js";
|
|
16
16
|
import {
|
|
17
17
|
CLAUDE_HOOK_BINARY,
|
|
18
18
|
CLAUDE_HOOK_EVENTS,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
needsReregistration,
|
|
25
25
|
registrationSignatures,
|
|
26
26
|
supportedClaudeEvents
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-KHGIM2BN.js";
|
|
28
28
|
import {
|
|
29
29
|
CODEX_HOOK_BINARY,
|
|
30
30
|
addCodexHookTrust,
|
|
@@ -44,12 +44,12 @@ import {
|
|
|
44
44
|
registrationHolderOf,
|
|
45
45
|
resolveGlobalBinary,
|
|
46
46
|
vscodePluginMcp
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-34NNTYK6.js";
|
|
48
48
|
import {
|
|
49
49
|
readJsonSafe,
|
|
50
50
|
writeFileAtomic,
|
|
51
51
|
writeJsonAtomic
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-T7E75EKA.js";
|
|
53
53
|
|
|
54
54
|
// src/reapply.ts
|
|
55
55
|
import { dirname, join } from "path";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
supportedClaudeEvents
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KHGIM2BN.js";
|
|
5
5
|
import {
|
|
6
6
|
guardBinary,
|
|
7
7
|
holdBudgetOf,
|
|
8
8
|
isProtectedByScope,
|
|
9
9
|
registerHookEntry
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-34NNTYK6.js";
|
|
11
11
|
import {
|
|
12
12
|
HOOK_LOCATOR_BINARY,
|
|
13
13
|
withHookHoldBudget
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5UWDYOZX.js";
|
|
15
15
|
|
|
16
16
|
// src/claude-config.ts
|
|
17
17
|
import { join } from "path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/cli/fsx.ts
|
|
2
|
-
import { copyFileSync, existsSync, fsyncSync, mkdirSync, openSync, closeSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "fs";
|
|
2
|
+
import { copyFileSync, lstatSync, realpathSync, existsSync, fsyncSync, mkdirSync, openSync, closeSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "fs";
|
|
3
3
|
import { dirname, join } from "path";
|
|
4
4
|
var readJsonSafe = (filePath) => {
|
|
5
5
|
let raw;
|
|
@@ -24,7 +24,8 @@ var backupFile = (filePath) => {
|
|
|
24
24
|
return target;
|
|
25
25
|
};
|
|
26
26
|
var writeFileAtomic = (filePath, contents, mode, encoding = "utf-8") => {
|
|
27
|
-
const
|
|
27
|
+
const target = lstatSync(filePath, { throwIfNoEntry: false })?.isSymbolicLink() ? realpathSync(filePath) : filePath;
|
|
28
|
+
const dir = dirname(target);
|
|
28
29
|
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
29
30
|
const temp = join(dir, `.${process.pid}-${stamp()}.pushary-tmp`);
|
|
30
31
|
try {
|
|
@@ -35,7 +36,7 @@ var writeFileAtomic = (filePath, contents, mode, encoding = "utf-8") => {
|
|
|
35
36
|
} finally {
|
|
36
37
|
closeSync(handle);
|
|
37
38
|
}
|
|
38
|
-
renameSync(temp,
|
|
39
|
+
renameSync(temp, target);
|
|
39
40
|
} catch (err) {
|
|
40
41
|
try {
|
|
41
42
|
if (existsSync(temp)) unlinkSync(temp);
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
} from "./chunk-EYRGBYZG.js";
|
|
16
16
|
import {
|
|
17
17
|
reportedInstallSource
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-5WLH2ENB.js";
|
|
19
19
|
import {
|
|
20
20
|
isAnswerSource
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-5UWDYOZX.js";
|
|
22
22
|
|
|
23
23
|
// src/reach.ts
|
|
24
24
|
var reachVerdict = (channels) => {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey,
|
|
15
15
|
normalizeKeyScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5UWDYOZX.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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOTIFICATION_PUSH_TYPES,
|
|
3
3
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XP2KRTZD.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-465UENKO.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-5WLH2ENB.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-5UWDYOZX.js";
|
|
48
48
|
|
|
49
49
|
// src/policy.ts
|
|
50
50
|
import { createHash } from "crypto";
|
|
@@ -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-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-RERJ2ZDV.js";
|
|
12
|
+
import "./chunk-AFKOWCMQ.js";
|
|
13
|
+
import "./chunk-SGZE2JBF.js";
|
|
14
|
+
import "./chunk-QOCWB4Q6.js";
|
|
15
|
+
import "./chunk-KHGIM2BN.js";
|
|
16
|
+
import "./chunk-XP2KRTZD.js";
|
|
17
|
+
import "./chunk-34NNTYK6.js";
|
|
18
|
+
import "./chunk-T7E75EKA.js";
|
|
19
|
+
import "./chunk-5UWDYOZX.js";
|
|
20
20
|
export {
|
|
21
21
|
inspectConfiguredManagedProviders,
|
|
22
22
|
reapplyAllAgents,
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { CanonicalGateInputs, ReceiptMeta } from '@pushary/hook-mapping';
|
|
1
2
|
import { ClaudePreToolUseOutput, PolicyConfig, ApprovalMode, ModeState, AutoResolveOrigin, AgentQuestion } from '@pushary/contracts';
|
|
2
3
|
export { ApprovalMode, ModeState, PolicyConfig, ToolPolicy, resolvePolicy } from '@pushary/contracts';
|
|
3
|
-
import { ReceiptMeta } from '@pushary/hook-mapping';
|
|
4
4
|
|
|
5
5
|
interface ToolInput {
|
|
6
6
|
tool_name: string;
|
|
@@ -12,7 +12,7 @@ interface ToolInput {
|
|
|
12
12
|
permission_mode?: string;
|
|
13
13
|
}
|
|
14
14
|
type HookOutput = ClaudePreToolUseOutput;
|
|
15
|
-
declare const handlePreToolUse: (input: ToolInput) => Promise<HookOutput | undefined>;
|
|
15
|
+
declare const handlePreToolUse: (input: ToolInput, canonical?: CanonicalGateInputs | null) => Promise<HookOutput | undefined>;
|
|
16
16
|
|
|
17
17
|
declare const getPolicy: (apiKey: string, expectedVersion?: string | null, agent?: string, repoAware?: boolean, sessionId?: string) => Promise<PolicyConfig>;
|
|
18
18
|
|
package/dist/src/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handlePreToolUse
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-I2OLM3DM.js";
|
|
4
|
+
import "../chunk-LWT34GSY.js";
|
|
5
|
+
import "../chunk-SGZE2JBF.js";
|
|
6
|
+
import "../chunk-HCTSTMDD.js";
|
|
7
|
+
import "../chunk-OMP3KDDU.js";
|
|
8
8
|
import "../chunk-YHG74UFF.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-KHGIM2BN.js";
|
|
10
10
|
import {
|
|
11
11
|
fetchAccountPublicKey
|
|
12
12
|
} from "../chunk-EQRS3SGM.js";
|
|
@@ -18,28 +18,28 @@ import {
|
|
|
18
18
|
handlePostToolUse,
|
|
19
19
|
handleStop,
|
|
20
20
|
reportEvent
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-WOBHHXW5.js";
|
|
22
|
+
import "../chunk-XP2KRTZD.js";
|
|
23
23
|
import {
|
|
24
24
|
askUser,
|
|
25
25
|
cancelQuestion,
|
|
26
26
|
waitForAnswer
|
|
27
27
|
} from "../chunk-LGXUGYUH.js";
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-465UENKO.js";
|
|
29
|
+
import "../chunk-34NNTYK6.js";
|
|
30
30
|
import "../chunk-EYRGBYZG.js";
|
|
31
31
|
import "../chunk-SAF6HGAA.js";
|
|
32
32
|
import "../chunk-7QLSKOSU.js";
|
|
33
33
|
import "../chunk-KZERVKTD.js";
|
|
34
|
-
import "../chunk-
|
|
35
|
-
import "../chunk-
|
|
34
|
+
import "../chunk-5WLH2ENB.js";
|
|
35
|
+
import "../chunk-T7E75EKA.js";
|
|
36
36
|
import {
|
|
37
37
|
getApiKey,
|
|
38
38
|
getBaseUrl
|
|
39
39
|
} from "../chunk-2UMNXADU.js";
|
|
40
40
|
import {
|
|
41
41
|
resolvePolicy
|
|
42
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-5UWDYOZX.js";
|
|
43
43
|
export {
|
|
44
44
|
askUser,
|
|
45
45
|
cancelQuestion,
|
package/package.json
CHANGED
|
File without changes
|