@pushary/agent-hooks 0.84.1 → 0.85.0
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 +44 -0
- package/README.md +24 -0
- package/dist/bin/pushary-bell-hook.js +5 -3
- package/dist/bin/pushary-bell.js +8 -7
- package/dist/bin/pushary-claude.js +5 -5
- package/dist/bin/pushary-clean.js +6 -5
- package/dist/bin/pushary-codex-bridge.js +2 -2
- package/dist/bin/pushary-codex-hook.js +7 -13
- package/dist/bin/pushary-codex.js +1 -1
- package/dist/bin/pushary-connect.js +5 -5
- package/dist/bin/pushary-daemon.js +5 -5
- package/dist/bin/pushary-disconnect.d.ts +1 -0
- package/dist/bin/pushary-disconnect.js +125 -0
- package/dist/bin/pushary-doctor.js +9 -9
- package/dist/bin/pushary-gemini-bridge.js +2 -2
- package/dist/bin/pushary-gemini-hook.js +7 -13
- package/dist/bin/pushary-hook.js +13 -20
- package/dist/bin/pushary-login.js +2 -2
- package/dist/bin/pushary-logout.js +3 -3
- package/dist/bin/pushary-mode.js +2 -2
- package/dist/bin/pushary-notification-hook.js +6 -9
- package/dist/bin/pushary-permission-denied-hook.js +11 -9
- package/dist/bin/pushary-permission-hook.js +11 -9
- package/dist/bin/pushary-post-hook.js +6 -9
- package/dist/bin/pushary-prompt-hook.js +6 -9
- package/dist/bin/pushary-session-end-hook.js +6 -6
- package/dist/bin/pushary-session-start-hook.js +6 -6
- package/dist/bin/pushary-setup.js +23 -24
- package/dist/bin/pushary-stats.js +2 -2
- package/dist/bin/pushary-status.js +2 -2
- package/dist/bin/pushary-stop-hook.js +6 -6
- package/dist/bin/pushary-stopfailure-hook.js +6 -6
- package/dist/bin/pushary-suggestions.js +2 -2
- package/dist/bin/pushary-upgrade.js +13 -8
- package/dist/bin/pushary-wait.js +2 -2
- package/dist/bin/pushary.js +2 -1
- package/dist/{chunk-HZNOAJGB.js → chunk-4QPOMJUB.js} +1 -1
- package/dist/chunk-64PXDATC.js +187 -0
- package/dist/chunk-6CUUA7HO.js +59 -0
- package/dist/{chunk-UXWEE3QI.js → chunk-ADISVXZL.js} +1 -1
- package/dist/chunk-AXRATIS6.js +70 -0
- package/dist/{chunk-CCCJ6BPW.js → chunk-EXMUM226.js} +19 -7
- package/dist/{chunk-YR5TSPXB.js → chunk-GFM3STWO.js} +3 -3
- package/dist/{chunk-MGJBC6DD.js → chunk-GOEXZ5QJ.js} +1 -0
- package/dist/{chunk-BLDDXHHA.js → chunk-GXIFADGD.js} +1 -1
- package/dist/{chunk-SEAHGHCE.js → chunk-HVZIHTOO.js} +33 -0
- package/dist/chunk-PWTKKQQI.js +27 -0
- package/dist/{chunk-J4KFVOCQ.js → chunk-SQOFGPNX.js} +1 -1
- package/dist/{chunk-CCH775Y6.js → chunk-WEAQQSHQ.js} +1 -1
- package/dist/{chunk-ILB6UOAF.js → chunk-YKW6JCWI.js} +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +6 -4
- package/package.json +3 -2
- package/dist/chunk-UKSQWTBH.js +0 -208
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
codexConfigToml,
|
|
5
5
|
cursorUserMcp,
|
|
6
6
|
geminiSettings
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-HVZIHTOO.js";
|
|
8
8
|
import {
|
|
9
9
|
createIo
|
|
10
10
|
} from "../chunk-5RUIFDTP.js";
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
} from "../chunk-GMXKITVA.js";
|
|
18
18
|
import {
|
|
19
19
|
exitOnHelpFlag
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import "../chunk-
|
|
20
|
+
} from "../chunk-SQOFGPNX.js";
|
|
21
|
+
import "../chunk-GOEXZ5QJ.js";
|
|
22
22
|
import "../chunk-BC3VCZ3E.js";
|
|
23
23
|
import "../chunk-DINDL2CF.js";
|
|
24
24
|
import "../chunk-6MTNS63X.js";
|
package/dist/bin/pushary-mode.js
CHANGED
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
} from "../chunk-GMXKITVA.js";
|
|
12
12
|
import {
|
|
13
13
|
exitOnHelpFlag
|
|
14
|
-
} from "../chunk-
|
|
15
|
-
import "../chunk-
|
|
14
|
+
} from "../chunk-SQOFGPNX.js";
|
|
15
|
+
import "../chunk-GOEXZ5QJ.js";
|
|
16
16
|
import "../chunk-DINDL2CF.js";
|
|
17
17
|
import "../chunk-SAF6HGAA.js";
|
|
18
18
|
import {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
readHookInput
|
|
4
|
+
} from "../chunk-6CUUA7HO.js";
|
|
2
5
|
import {
|
|
3
6
|
handleNotification
|
|
4
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-EXMUM226.js";
|
|
5
8
|
import "../chunk-RN3NOEJF.js";
|
|
6
9
|
import "../chunk-BSZYIAZL.js";
|
|
7
10
|
import "../chunk-SAF6HGAA.js";
|
|
@@ -13,15 +16,9 @@ import "../chunk-MQMPG5X4.js";
|
|
|
13
16
|
|
|
14
17
|
// bin/pushary-notification-hook.ts
|
|
15
18
|
var main = async () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
rawInput += chunk;
|
|
19
|
-
}
|
|
20
|
-
if (!rawInput.trim()) {
|
|
21
|
-
process.exit(0);
|
|
22
|
-
}
|
|
19
|
+
const input = await readHookInput("claude", "Notification");
|
|
20
|
+
if (!input) return;
|
|
23
21
|
try {
|
|
24
|
-
const input = JSON.parse(rawInput);
|
|
25
22
|
await handleNotification(input);
|
|
26
23
|
} catch {
|
|
27
24
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePermissionDenied
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-GFM3STWO.js";
|
|
5
|
+
import "../chunk-64PXDATC.js";
|
|
6
|
+
import "../chunk-PWTKKQQI.js";
|
|
7
|
+
import "../chunk-VT4IVERX.js";
|
|
6
8
|
import "../chunk-NJ7JT26G.js";
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
+
import {
|
|
10
|
+
readHookInput
|
|
11
|
+
} from "../chunk-6CUUA7HO.js";
|
|
12
|
+
import "../chunk-GXIFADGD.js";
|
|
13
|
+
import "../chunk-EXMUM226.js";
|
|
9
14
|
import "../chunk-RN3NOEJF.js";
|
|
10
15
|
import "../chunk-BSZYIAZL.js";
|
|
11
16
|
import "../chunk-SAF6HGAA.js";
|
|
@@ -17,12 +22,9 @@ import "../chunk-MQMPG5X4.js";
|
|
|
17
22
|
|
|
18
23
|
// bin/pushary-permission-denied-hook.ts
|
|
19
24
|
var main = async () => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
rawInput += chunk;
|
|
23
|
-
}
|
|
25
|
+
const input = await readHookInput("claude", "PermissionDenied");
|
|
26
|
+
if (!input) return;
|
|
24
27
|
try {
|
|
25
|
-
const input = rawInput.trim() ? JSON.parse(rawInput) : {};
|
|
26
28
|
const output = await handlePermissionDenied(input);
|
|
27
29
|
if (output) process.stdout.write(JSON.stringify(output));
|
|
28
30
|
} catch {
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePermissionRequest
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-GFM3STWO.js";
|
|
5
|
+
import "../chunk-64PXDATC.js";
|
|
6
|
+
import "../chunk-PWTKKQQI.js";
|
|
7
|
+
import "../chunk-VT4IVERX.js";
|
|
6
8
|
import "../chunk-NJ7JT26G.js";
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
+
import {
|
|
10
|
+
readHookInput
|
|
11
|
+
} from "../chunk-6CUUA7HO.js";
|
|
12
|
+
import "../chunk-GXIFADGD.js";
|
|
13
|
+
import "../chunk-EXMUM226.js";
|
|
9
14
|
import "../chunk-RN3NOEJF.js";
|
|
10
15
|
import "../chunk-BSZYIAZL.js";
|
|
11
16
|
import "../chunk-SAF6HGAA.js";
|
|
@@ -17,12 +22,9 @@ import "../chunk-MQMPG5X4.js";
|
|
|
17
22
|
|
|
18
23
|
// bin/pushary-permission-hook.ts
|
|
19
24
|
var main = async () => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
rawInput += chunk;
|
|
23
|
-
}
|
|
25
|
+
const input = await readHookInput("claude", "PermissionRequest");
|
|
26
|
+
if (!input) return;
|
|
24
27
|
try {
|
|
25
|
-
const input = rawInput.trim() ? JSON.parse(rawInput) : {};
|
|
26
28
|
const output = await handlePermissionRequest(input);
|
|
27
29
|
if (output) process.stdout.write(JSON.stringify(output));
|
|
28
30
|
} catch {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
readHookInput
|
|
4
|
+
} from "../chunk-6CUUA7HO.js";
|
|
2
5
|
import {
|
|
3
6
|
handlePostToolUse
|
|
4
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-EXMUM226.js";
|
|
5
8
|
import "../chunk-RN3NOEJF.js";
|
|
6
9
|
import "../chunk-BSZYIAZL.js";
|
|
7
10
|
import "../chunk-SAF6HGAA.js";
|
|
@@ -13,15 +16,9 @@ import "../chunk-MQMPG5X4.js";
|
|
|
13
16
|
|
|
14
17
|
// bin/pushary-post-hook.ts
|
|
15
18
|
var main = async () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
rawInput += chunk;
|
|
19
|
-
}
|
|
20
|
-
if (!rawInput.trim()) {
|
|
21
|
-
process.exit(0);
|
|
22
|
-
}
|
|
19
|
+
const input = await readHookInput("claude", "PostToolUse");
|
|
20
|
+
if (!input) return;
|
|
23
21
|
try {
|
|
24
|
-
const input = JSON.parse(rawInput);
|
|
25
22
|
const additionalContext = await handlePostToolUse(input);
|
|
26
23
|
if (additionalContext) {
|
|
27
24
|
process.stdout.write(JSON.stringify({
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
readHookInput
|
|
4
|
+
} from "../chunk-6CUUA7HO.js";
|
|
2
5
|
import {
|
|
3
6
|
handleUserPrompt
|
|
4
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-EXMUM226.js";
|
|
5
8
|
import "../chunk-RN3NOEJF.js";
|
|
6
9
|
import "../chunk-BSZYIAZL.js";
|
|
7
10
|
import "../chunk-SAF6HGAA.js";
|
|
@@ -13,15 +16,9 @@ import "../chunk-MQMPG5X4.js";
|
|
|
13
16
|
|
|
14
17
|
// bin/pushary-prompt-hook.ts
|
|
15
18
|
var main = async () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
rawInput += chunk;
|
|
19
|
-
}
|
|
20
|
-
if (!rawInput.trim()) {
|
|
21
|
-
process.exit(0);
|
|
22
|
-
}
|
|
19
|
+
const input = await readHookInput("claude", "UserPromptSubmit");
|
|
20
|
+
if (!input) return;
|
|
23
21
|
try {
|
|
24
|
-
const input = JSON.parse(rawInput);
|
|
25
22
|
const additionalContext = await handleUserPrompt(input);
|
|
26
23
|
if (additionalContext) {
|
|
27
24
|
process.stdout.write(JSON.stringify({
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
readHookInput
|
|
4
|
+
} from "../chunk-6CUUA7HO.js";
|
|
2
5
|
import {
|
|
3
6
|
handleSessionEnd
|
|
4
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-EXMUM226.js";
|
|
5
8
|
import "../chunk-RN3NOEJF.js";
|
|
6
9
|
import "../chunk-BSZYIAZL.js";
|
|
7
10
|
import "../chunk-SAF6HGAA.js";
|
|
@@ -13,12 +16,9 @@ import "../chunk-MQMPG5X4.js";
|
|
|
13
16
|
|
|
14
17
|
// bin/pushary-session-end-hook.ts
|
|
15
18
|
var main = async () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
rawInput += chunk;
|
|
19
|
-
}
|
|
19
|
+
const input = await readHookInput("claude", "SessionEnd");
|
|
20
|
+
if (!input) return;
|
|
20
21
|
try {
|
|
21
|
-
const input = rawInput.trim() ? JSON.parse(rawInput) : {};
|
|
22
22
|
await handleSessionEnd(input);
|
|
23
23
|
} catch {
|
|
24
24
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
readHookInput
|
|
4
|
+
} from "../chunk-6CUUA7HO.js";
|
|
2
5
|
import {
|
|
3
6
|
handleSessionStart
|
|
4
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-EXMUM226.js";
|
|
5
8
|
import "../chunk-RN3NOEJF.js";
|
|
6
9
|
import "../chunk-BSZYIAZL.js";
|
|
7
10
|
import "../chunk-SAF6HGAA.js";
|
|
@@ -13,12 +16,9 @@ import "../chunk-MQMPG5X4.js";
|
|
|
13
16
|
|
|
14
17
|
// bin/pushary-session-start-hook.ts
|
|
15
18
|
var main = async () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
rawInput += chunk;
|
|
19
|
-
}
|
|
19
|
+
const input = await readHookInput("claude", "SessionStart");
|
|
20
|
+
if (!input) return;
|
|
20
21
|
try {
|
|
21
|
-
const input = rawInput.trim() ? JSON.parse(rawInput) : {};
|
|
22
22
|
await handleSessionStart(input);
|
|
23
23
|
} catch {
|
|
24
24
|
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
detectClaudeVersion
|
|
4
|
+
} from "../chunk-AXRATIS6.js";
|
|
2
5
|
import {
|
|
3
6
|
claudeWired,
|
|
4
7
|
codexWired,
|
|
5
8
|
geminiWired
|
|
6
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-4QPOMJUB.js";
|
|
7
10
|
import {
|
|
8
11
|
runBrowserLogin
|
|
9
12
|
} from "../chunk-Z3Z4VK5F.js";
|
|
10
13
|
import {
|
|
11
14
|
ensureDaemonRunning
|
|
12
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-WEAQQSHQ.js";
|
|
13
16
|
import {
|
|
14
17
|
describeDetection,
|
|
15
18
|
detectAllAgents,
|
|
@@ -21,7 +24,7 @@ import {
|
|
|
21
24
|
shortenHome,
|
|
22
25
|
vscodeSettingsTargets,
|
|
23
26
|
writeInstructionBlock
|
|
24
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-ADISVXZL.js";
|
|
25
28
|
import {
|
|
26
29
|
GEMINI_HOOK_BINARY,
|
|
27
30
|
addGeminiHooks,
|
|
@@ -30,13 +33,18 @@ import {
|
|
|
30
33
|
import {
|
|
31
34
|
addClaudeMcpServer,
|
|
32
35
|
addPusharyHooks,
|
|
33
|
-
addPusharyToolPermissions
|
|
34
|
-
|
|
36
|
+
addPusharyToolPermissions,
|
|
37
|
+
compareVersion,
|
|
38
|
+
parseVersion
|
|
39
|
+
} from "../chunk-64PXDATC.js";
|
|
40
|
+
import {
|
|
41
|
+
guardBinary,
|
|
42
|
+
guardNodeScript
|
|
43
|
+
} from "../chunk-PWTKKQQI.js";
|
|
35
44
|
import "../chunk-XHKBHWLX.js";
|
|
36
45
|
import {
|
|
37
46
|
installGlobally,
|
|
38
47
|
npmErrorMessage,
|
|
39
|
-
quoteIfNeeded,
|
|
40
48
|
resolveGlobalBinDir,
|
|
41
49
|
resolveGlobalBinary
|
|
42
50
|
} from "../chunk-VT4IVERX.js";
|
|
@@ -57,10 +65,10 @@ import {
|
|
|
57
65
|
geminiSettings,
|
|
58
66
|
pusharyConfigFile,
|
|
59
67
|
vscodePluginDir
|
|
60
|
-
} from "../chunk-
|
|
68
|
+
} from "../chunk-HVZIHTOO.js";
|
|
61
69
|
import {
|
|
62
70
|
reportEvent
|
|
63
|
-
} from "../chunk-
|
|
71
|
+
} from "../chunk-EXMUM226.js";
|
|
64
72
|
import "../chunk-RN3NOEJF.js";
|
|
65
73
|
import {
|
|
66
74
|
confirmAppConnection,
|
|
@@ -92,7 +100,7 @@ import {
|
|
|
92
100
|
} from "../chunk-GMXKITVA.js";
|
|
93
101
|
import {
|
|
94
102
|
renderCommandHelp
|
|
95
|
-
} from "../chunk-
|
|
103
|
+
} from "../chunk-GOEXZ5QJ.js";
|
|
96
104
|
import {
|
|
97
105
|
installClaudeAlias,
|
|
98
106
|
resolveShellRc
|
|
@@ -234,17 +242,8 @@ var describeClosing = (facts) => {
|
|
|
234
242
|
|
|
235
243
|
// src/setup/codex-version.ts
|
|
236
244
|
import { dirname, join } from "path";
|
|
237
|
-
var parseCodexVersion =
|
|
238
|
-
|
|
239
|
-
if (!match) return null;
|
|
240
|
-
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
241
|
-
};
|
|
242
|
-
var compareCodexVersion = (a, b) => {
|
|
243
|
-
for (let i = 0; i < 3; i++) {
|
|
244
|
-
if (a[i] !== b[i]) return a[i] < b[i] ? -1 : 1;
|
|
245
|
-
}
|
|
246
|
-
return 0;
|
|
247
|
-
};
|
|
245
|
+
var parseCodexVersion = parseVersion;
|
|
246
|
+
var compareCodexVersion = compareVersion;
|
|
248
247
|
var versionFromManifest = (probe, binPath) => {
|
|
249
248
|
let dir = dirname(binPath);
|
|
250
249
|
for (let depth = 0; depth < 4; depth++) {
|
|
@@ -714,7 +713,7 @@ var setupClaudeCode = async (apiKey) => {
|
|
|
714
713
|
addPusharyToolPermissions(settings);
|
|
715
714
|
});
|
|
716
715
|
await spinner("Adding hooks (approvals, activity, presence, and lifecycle events)", async () => {
|
|
717
|
-
addPusharyHooks(settings, resolveGlobalBinDir("pushary-hook"));
|
|
716
|
+
addPusharyHooks(settings, resolveGlobalBinDir("pushary-hook"), detectClaudeVersion());
|
|
718
717
|
});
|
|
719
718
|
await spinner(`Writing ${CLAUDE_JSON}`, async () => {
|
|
720
719
|
writeJsonAtomic(CLAUDE_JSON, claudeJson2, 384);
|
|
@@ -940,7 +939,7 @@ var setupCodex = async (apiKey) => {
|
|
|
940
939
|
const trustAuto = codexTrustAutoSupported(codexVersion);
|
|
941
940
|
let trusted = false;
|
|
942
941
|
if (hooksSupported) {
|
|
943
|
-
const hookCommand =
|
|
942
|
+
const hookCommand = guardBinary(resolveGlobalBinary("pushary-codex-hook") ?? "pushary-codex-hook");
|
|
944
943
|
await spinner("Adding native hooks (~/.codex/hooks.json)", async () => {
|
|
945
944
|
const hooksConfig = readAgentJson(CODEX_HOOKS_JSON);
|
|
946
945
|
addCodexHooks(hooksConfig, hookCommand);
|
|
@@ -1022,7 +1021,7 @@ var resolveBundledPlugin = () => {
|
|
|
1022
1021
|
var installCursorUserHooks = (gateScript) => {
|
|
1023
1022
|
const template = readJson(join2(CURSOR_PLUGIN_DIR, "hooks", "hooks.json")).hooks?.beforeShellExecution?.[0];
|
|
1024
1023
|
if (!template) throw new Error("bundled Cursor hooks.json missing a beforeShellExecution entry");
|
|
1025
|
-
const entry = { ...template, command:
|
|
1024
|
+
const entry = { ...template, command: guardNodeScript(gateScript) };
|
|
1026
1025
|
let userHooks = {};
|
|
1027
1026
|
if (existsSync(CURSOR_USER_HOOKS)) {
|
|
1028
1027
|
try {
|
|
@@ -1286,7 +1285,7 @@ var setupGemini = async (apiKey) => {
|
|
|
1286
1285
|
addGeminiMcpServer(settings, apiKey);
|
|
1287
1286
|
});
|
|
1288
1287
|
await spinner("Adding hooks (BeforeTool, AfterTool, BeforeAgent, SessionStart, SessionEnd)", async () => {
|
|
1289
|
-
addGeminiHooks(settings,
|
|
1288
|
+
addGeminiHooks(settings, guardBinary(resolveGlobalBinary(GEMINI_HOOK_BINARY) ?? GEMINI_HOOK_BINARY));
|
|
1290
1289
|
});
|
|
1291
1290
|
await spinner(`Writing ${GEMINI_SETTINGS}`, async () => {
|
|
1292
1291
|
writeJsonAtomic(GEMINI_SETTINGS, settings, KEY_FILE_MODE);
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
} from "../chunk-NJ7JT26G.js";
|
|
5
5
|
import {
|
|
6
6
|
exitOnHelpFlag
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-SQOFGPNX.js";
|
|
8
|
+
import "../chunk-GOEXZ5QJ.js";
|
|
9
9
|
import "../chunk-DINDL2CF.js";
|
|
10
10
|
import "../chunk-KZERVKTD.js";
|
|
11
11
|
import {
|
|
@@ -25,8 +25,8 @@ import {
|
|
|
25
25
|
} from "../chunk-GMXKITVA.js";
|
|
26
26
|
import {
|
|
27
27
|
exitOnHelpFlag
|
|
28
|
-
} from "../chunk-
|
|
29
|
-
import "../chunk-
|
|
28
|
+
} from "../chunk-SQOFGPNX.js";
|
|
29
|
+
import "../chunk-GOEXZ5QJ.js";
|
|
30
30
|
import "../chunk-BC3VCZ3E.js";
|
|
31
31
|
import "../chunk-DINDL2CF.js";
|
|
32
32
|
import "../chunk-6MTNS63X.js";
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
readHookInput
|
|
4
|
+
} from "../chunk-6CUUA7HO.js";
|
|
2
5
|
import {
|
|
3
6
|
handleStop
|
|
4
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-EXMUM226.js";
|
|
5
8
|
import "../chunk-RN3NOEJF.js";
|
|
6
9
|
import "../chunk-BSZYIAZL.js";
|
|
7
10
|
import "../chunk-SAF6HGAA.js";
|
|
@@ -13,12 +16,9 @@ import "../chunk-MQMPG5X4.js";
|
|
|
13
16
|
|
|
14
17
|
// bin/pushary-stop-hook.ts
|
|
15
18
|
var main = async () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
rawInput += chunk;
|
|
19
|
-
}
|
|
19
|
+
const input = await readHookInput("claude", "Stop");
|
|
20
|
+
if (!input) return;
|
|
20
21
|
try {
|
|
21
|
-
const input = rawInput.trim() ? JSON.parse(rawInput) : {};
|
|
22
22
|
const output = await handleStop(input);
|
|
23
23
|
if (output) process.stdout.write(JSON.stringify(output));
|
|
24
24
|
} catch {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
readHookInput
|
|
4
|
+
} from "../chunk-6CUUA7HO.js";
|
|
2
5
|
import {
|
|
3
6
|
handleStopFailure
|
|
4
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-EXMUM226.js";
|
|
5
8
|
import "../chunk-RN3NOEJF.js";
|
|
6
9
|
import "../chunk-BSZYIAZL.js";
|
|
7
10
|
import "../chunk-SAF6HGAA.js";
|
|
@@ -13,12 +16,9 @@ import "../chunk-MQMPG5X4.js";
|
|
|
13
16
|
|
|
14
17
|
// bin/pushary-stopfailure-hook.ts
|
|
15
18
|
var main = async () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
rawInput += chunk;
|
|
19
|
-
}
|
|
19
|
+
const input = await readHookInput("claude", "StopFailure");
|
|
20
|
+
if (!input) return;
|
|
20
21
|
try {
|
|
21
|
-
const input = rawInput.trim() ? JSON.parse(rawInput) : {};
|
|
22
22
|
await handleStopFailure(input);
|
|
23
23
|
} catch {
|
|
24
24
|
}
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
} from "../chunk-GMXKITVA.js";
|
|
8
8
|
import {
|
|
9
9
|
exitOnHelpFlag
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-SQOFGPNX.js";
|
|
11
|
+
import "../chunk-GOEXZ5QJ.js";
|
|
12
12
|
import "../chunk-DINDL2CF.js";
|
|
13
13
|
import {
|
|
14
14
|
UsageError
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
detectClaudeVersion
|
|
4
|
+
} from "../chunk-AXRATIS6.js";
|
|
2
5
|
import {
|
|
3
6
|
GEMINI_HOOK_BINARY,
|
|
4
7
|
addGeminiHooks,
|
|
@@ -9,11 +12,13 @@ import {
|
|
|
9
12
|
addClaudeMcpServer,
|
|
10
13
|
addPusharyHooks,
|
|
11
14
|
addPusharyToolPermissions
|
|
12
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-64PXDATC.js";
|
|
16
|
+
import {
|
|
17
|
+
guardBinary
|
|
18
|
+
} from "../chunk-PWTKKQQI.js";
|
|
13
19
|
import {
|
|
14
20
|
execNpm,
|
|
15
21
|
npmErrorMessage,
|
|
16
|
-
quoteIfNeeded,
|
|
17
22
|
resolveGlobalBinDir,
|
|
18
23
|
resolveGlobalBinary
|
|
19
24
|
} from "../chunk-VT4IVERX.js";
|
|
@@ -30,11 +35,11 @@ import {
|
|
|
30
35
|
hasCodexHooks,
|
|
31
36
|
vscodePluginDir,
|
|
32
37
|
vscodePluginMcp
|
|
33
|
-
} from "../chunk-
|
|
38
|
+
} from "../chunk-HVZIHTOO.js";
|
|
34
39
|
import {
|
|
35
40
|
exitOnHelpFlag
|
|
36
|
-
} from "../chunk-
|
|
37
|
-
import "../chunk-
|
|
41
|
+
} from "../chunk-SQOFGPNX.js";
|
|
42
|
+
import "../chunk-GOEXZ5QJ.js";
|
|
38
43
|
import {
|
|
39
44
|
isNewerVersion
|
|
40
45
|
} from "../chunk-DINDL2CF.js";
|
|
@@ -87,7 +92,7 @@ var reapplyClaudeSettings = (apiKey, paths = {}) => {
|
|
|
87
92
|
if (!settingsWritable) throw new Error("settings.json could not be parsed");
|
|
88
93
|
const s = settings;
|
|
89
94
|
addPusharyToolPermissions(s);
|
|
90
|
-
addPusharyHooks(s, resolveGlobalBinDir("pushary-hook"));
|
|
95
|
+
addPusharyHooks(s, resolveGlobalBinDir("pushary-hook"), detectClaudeVersion());
|
|
91
96
|
writeJson(settingsPath, s);
|
|
92
97
|
hooks = true;
|
|
93
98
|
} catch {
|
|
@@ -119,7 +124,7 @@ var reapplyCodexSettings = (apiKey, paths = {}) => {
|
|
|
119
124
|
const hooksConfig = readJson(hooksPath);
|
|
120
125
|
const configured = config != null && !!config.mcp_servers?.pushary || hooksConfig != null && hasCodexHooks(hooksConfig);
|
|
121
126
|
if (!configured) return { reapplied: false, hooks: false, mcp: false };
|
|
122
|
-
const command =
|
|
127
|
+
const command = guardBinary(resolveGlobalBinary(CODEX_HOOK_BINARY) ?? CODEX_HOOK_BINARY);
|
|
123
128
|
let hooks = false;
|
|
124
129
|
let mcp = false;
|
|
125
130
|
if (hooksConfig != null) {
|
|
@@ -152,7 +157,7 @@ var reapplyGeminiSettings = (apiKey, paths = {}) => {
|
|
|
152
157
|
let hooks = false;
|
|
153
158
|
let mcp = false;
|
|
154
159
|
try {
|
|
155
|
-
addGeminiHooks(settings,
|
|
160
|
+
addGeminiHooks(settings, guardBinary(resolveGlobalBinary(GEMINI_HOOK_BINARY) ?? GEMINI_HOOK_BINARY));
|
|
156
161
|
hooks = true;
|
|
157
162
|
if (apiKey) {
|
|
158
163
|
addGeminiMcpServer(settings, apiKey);
|
package/dist/bin/pushary-wait.js
CHANGED
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
} from "../chunk-GMXKITVA.js";
|
|
15
15
|
import {
|
|
16
16
|
exitOnHelpFlag
|
|
17
|
-
} from "../chunk-
|
|
18
|
-
import "../chunk-
|
|
17
|
+
} from "../chunk-SQOFGPNX.js";
|
|
18
|
+
import "../chunk-GOEXZ5QJ.js";
|
|
19
19
|
import "../chunk-DINDL2CF.js";
|
|
20
20
|
import "../chunk-SAF6HGAA.js";
|
|
21
21
|
import {
|
package/dist/bin/pushary.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
COMMANDS,
|
|
4
4
|
isCommandName,
|
|
5
5
|
renderHelp
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-GOEXZ5QJ.js";
|
|
7
7
|
import {
|
|
8
8
|
getPackageVersion
|
|
9
9
|
} from "../chunk-DINDL2CF.js";
|
|
@@ -26,6 +26,7 @@ var LOADERS = {
|
|
|
26
26
|
connect: () => import("./pushary-connect.js"),
|
|
27
27
|
bell: () => import("./pushary-bell.js"),
|
|
28
28
|
doctor: () => import("./pushary-doctor.js"),
|
|
29
|
+
disconnect: () => import("./pushary-disconnect.js"),
|
|
29
30
|
clean: () => import("./pushary-clean.js"),
|
|
30
31
|
mode: () => import("./pushary-mode.js"),
|
|
31
32
|
wait: () => import("./pushary-wait.js"),
|