@pushary/agent-hooks 0.99.0 → 1.0.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 +14 -0
- package/dist/bin/pushary-bell-hook.js +18 -18
- package/dist/bin/pushary-bell.js +6 -6
- package/dist/bin/pushary-claude.js +22 -24
- package/dist/bin/pushary-clean.js +60 -18
- package/dist/bin/pushary-codex-bridge.js +10 -10
- package/dist/bin/pushary-codex-hook.js +33 -35
- package/dist/bin/pushary-codex.js +6 -7
- package/dist/bin/pushary-connect.js +6 -6
- package/dist/bin/pushary-cowork.js +3 -3
- package/dist/bin/pushary-daemon.js +22 -22
- package/dist/bin/pushary-disconnect.js +48 -7
- package/dist/bin/pushary-doctor.js +58 -19
- 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 +25 -27
- package/dist/bin/pushary-hook.js +61 -33
- package/dist/bin/pushary-login.js +7 -7
- package/dist/bin/pushary-logout.js +4 -4
- package/dist/bin/pushary-mode.js +3 -3
- package/dist/bin/pushary-notification-hook.js +26 -21
- package/dist/bin/pushary-opencode-hook.js +27 -29
- package/dist/bin/pushary-permission-denied-hook.js +24 -23
- package/dist/bin/pushary-permission-hook.js +32 -24
- package/dist/bin/pushary-post-hook.js +30 -22
- package/dist/bin/pushary-prompt-hook.js +26 -21
- package/dist/bin/pushary-session-end-hook.js +26 -21
- package/dist/bin/pushary-session-start-hook.js +30 -25
- package/dist/bin/pushary-setup.js +145 -37
- package/dist/bin/pushary-stats.js +2 -2
- package/dist/bin/pushary-status.js +10 -10
- package/dist/bin/pushary-stop-hook.js +27 -22
- package/dist/bin/pushary-stopfailure-hook.js +26 -21
- package/dist/bin/pushary-transcript-register.js +16 -16
- package/dist/bin/pushary-transcripts.js +4 -4
- package/dist/bin/pushary-upgrade.js +14 -14
- package/dist/bin/pushary-wait.js +3 -3
- package/dist/{chunk-PD6JY33P.js → chunk-2PS3DTHQ.js} +4 -3
- package/dist/{chunk-RALVI7OF.js → chunk-2SL5X7UB.js} +9 -6
- package/dist/{chunk-6KLCP7VF.js → chunk-3C4ERARU.js} +3 -3
- package/dist/{chunk-LBNAGGLV.js → chunk-3UUAK2AK.js} +3 -2
- package/dist/{chunk-V262ATS5.js → chunk-447SBIC7.js} +15 -2
- package/dist/{chunk-562UJ2DA.js → chunk-7WMFPYR5.js} +1 -1
- package/dist/{chunk-XPPXOKIG.js → chunk-7ZDFVWRR.js} +1 -1
- package/dist/{chunk-GCD3SQSV.js → chunk-A3D43VXO.js} +1 -1
- package/dist/{chunk-3RVCQDC4.js → chunk-BOZETFXB.js} +1 -1
- package/dist/{chunk-4C4XFAGJ.js → chunk-BPD4P3NN.js} +2 -2
- package/dist/{chunk-IRLTW6KF.js → chunk-CDTGL7TT.js} +1 -1
- package/dist/{chunk-CP34FI4B.js → chunk-D2N2EJH2.js} +2 -2
- package/dist/{chunk-6IFUXNFX.js → chunk-DMJTWULU.js} +1 -1
- package/dist/{chunk-4PBCNVI3.js → chunk-DOYARIYB.js} +1 -1
- package/dist/{chunk-XOOWC62T.js → chunk-DUOG74E7.js} +1 -1
- package/dist/{chunk-OPR2BPD4.js → chunk-EMCNSBF3.js} +1 -1
- package/dist/{chunk-5KLAETSU.js → chunk-GTR72MIU.js} +1 -1
- package/dist/{chunk-NSFNEDCT.js → chunk-HGEI7SVM.js} +6 -6
- package/dist/chunk-HS2KEAFD.js +224 -0
- package/dist/{chunk-T3JZZUAR.js → chunk-I3TWY7GH.js} +30 -29
- package/dist/{chunk-ID5FDKDZ.js → chunk-IBU7UU3R.js} +1 -1
- package/dist/{chunk-O3LZQEQP.js → chunk-IWZG2Y4Z.js} +1 -1
- package/dist/{chunk-WGV3VY7O.js → chunk-IYA3NCZG.js} +2 -2
- package/dist/{chunk-JBJBVERL.js → chunk-LTPQKBJH.js} +1 -1
- package/dist/{chunk-64WARXGV.js → chunk-MDV7ZRAT.js} +698 -43
- package/dist/{chunk-QS55LDX4.js → chunk-MGI6MLFU.js} +16 -16
- package/dist/{chunk-CRFLU455.js → chunk-MSOFZYI3.js} +3 -3
- package/dist/{chunk-LWKPMSBB.js → chunk-R744XA2M.js} +5 -5
- package/dist/{chunk-3ZAEUPM4.js → chunk-RFNMSC6N.js} +1 -1
- package/dist/{chunk-K6BASBQJ.js → chunk-S2W4ZSHE.js} +1 -1
- package/dist/{chunk-OUAE3GKO.js → chunk-TTBRBWAK.js} +278 -1
- package/dist/{chunk-6C6MS57P.js → chunk-TVY7AT6O.js} +1 -1
- package/dist/{chunk-EXHXR2X5.js → chunk-UWQVODHT.js} +1 -1
- package/dist/{chunk-JXELRCU5.js → chunk-XK34HTMW.js} +3 -3
- package/dist/{chunk-SI7GYBQP.js → chunk-XKDKUFMP.js} +1 -1
- package/dist/{chunk-HB2KB7QL.js → chunk-XNXIMIFY.js} +1 -1
- package/dist/{chunk-K4XFCEVI.js → chunk-Y55JNI2I.js} +1 -1
- package/dist/{chunk-JL33EDN7.js → chunk-ZZIUQVAN.js} +4 -4
- package/dist/{reapply-HQ264ZTR.js → reapply-I4NB5SSM.js} +8 -8
- package/dist/src/index.js +12 -10
- package/package.json +1 -1
- package/dist/chunk-A76GNRIK.js +0 -608
|
@@ -1,46 +1,51 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
activeHookSource,
|
|
4
|
+
activeIdentity
|
|
5
|
+
} from "../chunk-HS2KEAFD.js";
|
|
6
|
+
import "../chunk-MGI6MLFU.js";
|
|
2
7
|
import {
|
|
3
8
|
readHookInput
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-IWZG2Y4Z.js";
|
|
10
|
+
import "../chunk-HGEI7SVM.js";
|
|
6
11
|
import "../chunk-YKLCWWEI.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-2SL5X7UB.js";
|
|
13
|
+
import "../chunk-3UUAK2AK.js";
|
|
14
|
+
import "../chunk-CDTGL7TT.js";
|
|
15
|
+
import "../chunk-XK34HTMW.js";
|
|
16
|
+
import "../chunk-MSOFZYI3.js";
|
|
17
|
+
import "../chunk-2PS3DTHQ.js";
|
|
18
|
+
import "../chunk-UWQVODHT.js";
|
|
19
|
+
import "../chunk-7ZDFVWRR.js";
|
|
15
20
|
import "../chunk-EQRS3SGM.js";
|
|
16
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-IBU7UU3R.js";
|
|
17
22
|
import "../chunk-XHKBHWLX.js";
|
|
18
23
|
import {
|
|
19
24
|
handleUserPrompt
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-OPR2BPD4.js";
|
|
25
|
+
} from "../chunk-MDV7ZRAT.js";
|
|
26
|
+
import "../chunk-EMCNSBF3.js";
|
|
23
27
|
import "../chunk-LGXUGYUH.js";
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-7WMFPYR5.js";
|
|
29
|
+
import "../chunk-LTPQKBJH.js";
|
|
26
30
|
import "../chunk-GMXKITVA.js";
|
|
27
31
|
import "../chunk-DINDL2CF.js";
|
|
28
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-DOYARIYB.js";
|
|
29
33
|
import "../chunk-EYRGBYZG.js";
|
|
30
34
|
import "../chunk-SAF6HGAA.js";
|
|
31
35
|
import "../chunk-7QLSKOSU.js";
|
|
32
36
|
import "../chunk-KZERVKTD.js";
|
|
33
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-A3D43VXO.js";
|
|
34
38
|
import "../chunk-4LL6LG5X.js";
|
|
35
39
|
import "../chunk-2UMNXADU.js";
|
|
36
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-TTBRBWAK.js";
|
|
37
41
|
|
|
38
42
|
// bin/pushary-prompt-hook.ts
|
|
43
|
+
var AGENT = activeIdentity(process.argv);
|
|
39
44
|
var main = async () => {
|
|
40
|
-
const input = await readHookInput(
|
|
45
|
+
const input = await readHookInput(activeHookSource(process.argv), "UserPromptSubmit");
|
|
41
46
|
if (!input) return;
|
|
42
47
|
try {
|
|
43
|
-
const additionalContext = await handleUserPrompt(input);
|
|
48
|
+
const additionalContext = await handleUserPrompt(input, AGENT);
|
|
44
49
|
if (additionalContext) {
|
|
45
50
|
process.stdout.write(JSON.stringify({
|
|
46
51
|
hookSpecificOutput: { hookEventName: "UserPromptSubmit", additionalContext }
|
|
@@ -2,48 +2,53 @@
|
|
|
2
2
|
import {
|
|
3
3
|
WRAPPER_ACTIVE_ENV
|
|
4
4
|
} from "../chunk-PQ4K74WL.js";
|
|
5
|
+
import {
|
|
6
|
+
activeHookSource,
|
|
7
|
+
activeIdentity
|
|
8
|
+
} from "../chunk-HS2KEAFD.js";
|
|
9
|
+
import "../chunk-MGI6MLFU.js";
|
|
5
10
|
import {
|
|
6
11
|
readHookInput
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
12
|
+
} from "../chunk-IWZG2Y4Z.js";
|
|
13
|
+
import "../chunk-HGEI7SVM.js";
|
|
9
14
|
import "../chunk-YKLCWWEI.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-2SL5X7UB.js";
|
|
16
|
+
import "../chunk-3UUAK2AK.js";
|
|
17
|
+
import "../chunk-CDTGL7TT.js";
|
|
18
|
+
import "../chunk-XK34HTMW.js";
|
|
19
|
+
import "../chunk-MSOFZYI3.js";
|
|
20
|
+
import "../chunk-2PS3DTHQ.js";
|
|
21
|
+
import "../chunk-UWQVODHT.js";
|
|
22
|
+
import "../chunk-7ZDFVWRR.js";
|
|
18
23
|
import "../chunk-EQRS3SGM.js";
|
|
19
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-IBU7UU3R.js";
|
|
20
25
|
import "../chunk-XHKBHWLX.js";
|
|
21
26
|
import {
|
|
22
27
|
handleSessionEnd
|
|
23
|
-
} from "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-OPR2BPD4.js";
|
|
28
|
+
} from "../chunk-MDV7ZRAT.js";
|
|
29
|
+
import "../chunk-EMCNSBF3.js";
|
|
26
30
|
import "../chunk-LGXUGYUH.js";
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-7WMFPYR5.js";
|
|
32
|
+
import "../chunk-LTPQKBJH.js";
|
|
29
33
|
import "../chunk-GMXKITVA.js";
|
|
30
34
|
import "../chunk-DINDL2CF.js";
|
|
31
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-DOYARIYB.js";
|
|
32
36
|
import "../chunk-EYRGBYZG.js";
|
|
33
37
|
import "../chunk-SAF6HGAA.js";
|
|
34
38
|
import "../chunk-7QLSKOSU.js";
|
|
35
39
|
import "../chunk-KZERVKTD.js";
|
|
36
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-A3D43VXO.js";
|
|
37
41
|
import "../chunk-4LL6LG5X.js";
|
|
38
42
|
import "../chunk-2UMNXADU.js";
|
|
39
|
-
import "../chunk-
|
|
43
|
+
import "../chunk-TTBRBWAK.js";
|
|
40
44
|
|
|
41
45
|
// bin/pushary-session-end-hook.ts
|
|
46
|
+
var AGENT = activeIdentity(process.argv);
|
|
42
47
|
var main = async () => {
|
|
43
|
-
const input = await readHookInput(
|
|
48
|
+
const input = await readHookInput(activeHookSource(process.argv), "SessionEnd");
|
|
44
49
|
if (!input) return;
|
|
45
50
|
try {
|
|
46
|
-
await handleSessionEnd(input,
|
|
51
|
+
await handleSessionEnd(input, AGENT, { reportClosed: process.env[WRAPPER_ACTIVE_ENV] !== "1" });
|
|
47
52
|
} catch {
|
|
48
53
|
}
|
|
49
54
|
};
|
|
@@ -1,57 +1,62 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
reapplyClaudeForVersion
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import
|
|
4
|
+
} from "../chunk-R744XA2M.js";
|
|
5
|
+
import "../chunk-Y55JNI2I.js";
|
|
6
|
+
import {
|
|
7
|
+
activeHookSource,
|
|
8
|
+
activeIdentity
|
|
9
|
+
} from "../chunk-HS2KEAFD.js";
|
|
10
|
+
import "../chunk-MGI6MLFU.js";
|
|
7
11
|
import {
|
|
8
12
|
readHookInput
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
13
|
+
} from "../chunk-IWZG2Y4Z.js";
|
|
14
|
+
import "../chunk-HGEI7SVM.js";
|
|
11
15
|
import "../chunk-YKLCWWEI.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-2SL5X7UB.js";
|
|
17
|
+
import "../chunk-3UUAK2AK.js";
|
|
18
|
+
import "../chunk-CDTGL7TT.js";
|
|
19
|
+
import "../chunk-XK34HTMW.js";
|
|
20
|
+
import "../chunk-MSOFZYI3.js";
|
|
21
|
+
import "../chunk-2PS3DTHQ.js";
|
|
22
|
+
import "../chunk-UWQVODHT.js";
|
|
23
|
+
import "../chunk-7ZDFVWRR.js";
|
|
20
24
|
import "../chunk-EQRS3SGM.js";
|
|
21
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-IBU7UU3R.js";
|
|
22
26
|
import "../chunk-XHKBHWLX.js";
|
|
23
27
|
import {
|
|
28
|
+
CLAUDE_CODE_AGENT,
|
|
24
29
|
handleSessionStart
|
|
25
|
-
} from "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-OPR2BPD4.js";
|
|
30
|
+
} from "../chunk-MDV7ZRAT.js";
|
|
31
|
+
import "../chunk-EMCNSBF3.js";
|
|
28
32
|
import "../chunk-LGXUGYUH.js";
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-7WMFPYR5.js";
|
|
34
|
+
import "../chunk-LTPQKBJH.js";
|
|
31
35
|
import "../chunk-GMXKITVA.js";
|
|
32
36
|
import "../chunk-DINDL2CF.js";
|
|
33
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-DOYARIYB.js";
|
|
34
38
|
import "../chunk-EYRGBYZG.js";
|
|
35
39
|
import "../chunk-SAF6HGAA.js";
|
|
36
40
|
import "../chunk-7QLSKOSU.js";
|
|
37
41
|
import "../chunk-KZERVKTD.js";
|
|
38
|
-
import "../chunk-
|
|
42
|
+
import "../chunk-A3D43VXO.js";
|
|
39
43
|
import "../chunk-4LL6LG5X.js";
|
|
40
44
|
import "../chunk-2UMNXADU.js";
|
|
41
|
-
import "../chunk-
|
|
45
|
+
import "../chunk-TTBRBWAK.js";
|
|
42
46
|
|
|
43
47
|
// bin/pushary-session-start-hook.ts
|
|
48
|
+
var AGENT = activeIdentity(process.argv);
|
|
44
49
|
var main = async () => {
|
|
45
|
-
const input = await readHookInput(
|
|
50
|
+
const input = await readHookInput(activeHookSource(process.argv), "SessionStart");
|
|
46
51
|
if (!input) return;
|
|
47
|
-
if (!input.agent_id) {
|
|
52
|
+
if (!input.agent_id && AGENT.type === CLAUDE_CODE_AGENT.type) {
|
|
48
53
|
try {
|
|
49
54
|
reapplyClaudeForVersion();
|
|
50
55
|
} catch {
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
try {
|
|
54
|
-
await handleSessionStart(input);
|
|
59
|
+
await handleSessionStart(input, AGENT);
|
|
55
60
|
} catch {
|
|
56
61
|
}
|
|
57
62
|
};
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
coworkOutput,
|
|
7
7
|
coworkSelection
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-D2N2EJH2.js";
|
|
9
9
|
import "../chunk-PUZZELE6.js";
|
|
10
10
|
import {
|
|
11
11
|
detectClaudeVersion
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-Y55JNI2I.js";
|
|
13
13
|
import {
|
|
14
14
|
describeVersionManagerPin,
|
|
15
15
|
versionManagerOf
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
readManagedControlEvidence,
|
|
19
19
|
waitForMachineReadiness
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-ZZIUQVAN.js";
|
|
21
21
|
import {
|
|
22
22
|
HERMES_CONFIG_SCRIPT,
|
|
23
23
|
HERMES_PIP_PACKAGE,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
isHermesConfigReceipt,
|
|
26
26
|
resolveHermesPython,
|
|
27
27
|
runHermesPythonScript
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-RFNMSC6N.js";
|
|
29
29
|
import {
|
|
30
30
|
describeDetection,
|
|
31
31
|
detectAllAgents,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
shortenHome,
|
|
38
38
|
vscodeSettingsTargets,
|
|
39
39
|
writeInstructionBlock
|
|
40
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-447SBIC7.js";
|
|
41
41
|
import {
|
|
42
42
|
OPENCODE_HOOK_BINARY,
|
|
43
43
|
addOpenCodeMcpServer,
|
|
@@ -48,7 +48,18 @@ import {
|
|
|
48
48
|
openCodePluginDir,
|
|
49
49
|
openCodePluginFile,
|
|
50
50
|
openCodeWired
|
|
51
|
-
} from "../chunk-
|
|
51
|
+
} from "../chunk-XNXIMIFY.js";
|
|
52
|
+
import {
|
|
53
|
+
addCompatibleHooks,
|
|
54
|
+
addCompatibleMcpServer,
|
|
55
|
+
addCompatibleToolPermissions,
|
|
56
|
+
compatibleConfigFile,
|
|
57
|
+
compatibleHookEvents,
|
|
58
|
+
compatibleInstructionsFile,
|
|
59
|
+
compatibleMcpFile,
|
|
60
|
+
compatiblePermissionRuleFile,
|
|
61
|
+
hasCompatibleHooks
|
|
62
|
+
} from "../chunk-HS2KEAFD.js";
|
|
52
63
|
import {
|
|
53
64
|
addClaudeMcpServer,
|
|
54
65
|
addPusharyHooks,
|
|
@@ -56,12 +67,12 @@ import {
|
|
|
56
67
|
captureClaudeMcpServer,
|
|
57
68
|
isClaudeMcpSnapshot,
|
|
58
69
|
updateClaudeMcpSnapshot
|
|
59
|
-
} from "../chunk-
|
|
70
|
+
} from "../chunk-MGI6MLFU.js";
|
|
60
71
|
import {
|
|
61
72
|
detectProviderLiveCapabilities,
|
|
62
73
|
hasSpawnProvider,
|
|
63
74
|
resolveControlPolicy
|
|
64
|
-
} from "../chunk-
|
|
75
|
+
} from "../chunk-IYA3NCZG.js";
|
|
65
76
|
import {
|
|
66
77
|
KEEP_HINT,
|
|
67
78
|
captureHookTakeover,
|
|
@@ -71,23 +82,23 @@ import {
|
|
|
71
82
|
hookOwnerOf,
|
|
72
83
|
mcpBearerKey,
|
|
73
84
|
planHooks
|
|
74
|
-
} from "../chunk-
|
|
85
|
+
} from "../chunk-2SL5X7UB.js";
|
|
75
86
|
import {
|
|
76
87
|
AGENT_CHOICES,
|
|
77
88
|
effectiveControlMode,
|
|
78
89
|
effectiveVerify,
|
|
79
90
|
parseSetupOptions
|
|
80
|
-
} from "../chunk-
|
|
91
|
+
} from "../chunk-3UUAK2AK.js";
|
|
81
92
|
import {
|
|
82
93
|
liveBridgeProbe,
|
|
83
94
|
resolveBridgeStub
|
|
84
|
-
} from "../chunk-
|
|
95
|
+
} from "../chunk-CDTGL7TT.js";
|
|
85
96
|
import {
|
|
86
97
|
claudeWired,
|
|
87
98
|
codexWired,
|
|
88
99
|
geminiWired,
|
|
89
100
|
pusharyHookExecutable
|
|
90
|
-
} from "../chunk-
|
|
101
|
+
} from "../chunk-XK34HTMW.js";
|
|
91
102
|
import {
|
|
92
103
|
clearDaemonNeedsLogin,
|
|
93
104
|
daemonHasRemoteProof,
|
|
@@ -100,26 +111,25 @@ import {
|
|
|
100
111
|
replaceDaemonService,
|
|
101
112
|
stopDaemonService,
|
|
102
113
|
waitForDaemonRemoteProof
|
|
103
|
-
} from "../chunk-
|
|
114
|
+
} from "../chunk-MSOFZYI3.js";
|
|
104
115
|
import {
|
|
105
116
|
GEMINI_HOOK_BINARY,
|
|
106
117
|
addGeminiHooks,
|
|
107
118
|
addGeminiMcpServer,
|
|
108
119
|
compareVersion,
|
|
109
120
|
parseVersion
|
|
110
|
-
} from "../chunk-
|
|
111
|
-
import "../chunk-
|
|
121
|
+
} from "../chunk-2PS3DTHQ.js";
|
|
122
|
+
import "../chunk-UWQVODHT.js";
|
|
112
123
|
import {
|
|
113
124
|
transcriptPreferenceForSetup
|
|
114
|
-
} from "../chunk-
|
|
125
|
+
} from "../chunk-IBU7UU3R.js";
|
|
115
126
|
import "../chunk-XHKBHWLX.js";
|
|
116
127
|
import {
|
|
117
128
|
reportEvent
|
|
118
|
-
} from "../chunk-
|
|
119
|
-
import "../chunk-
|
|
120
|
-
import "../chunk-OPR2BPD4.js";
|
|
129
|
+
} from "../chunk-MDV7ZRAT.js";
|
|
130
|
+
import "../chunk-EMCNSBF3.js";
|
|
121
131
|
import "../chunk-LGXUGYUH.js";
|
|
122
|
-
import "../chunk-
|
|
132
|
+
import "../chunk-7WMFPYR5.js";
|
|
123
133
|
import {
|
|
124
134
|
addCodexHookTrust,
|
|
125
135
|
addCodexHooks,
|
|
@@ -157,7 +167,7 @@ import {
|
|
|
157
167
|
resolveGlobalBinary,
|
|
158
168
|
vscodePluginDir,
|
|
159
169
|
vscodePluginMcp
|
|
160
|
-
} from "../chunk-
|
|
170
|
+
} from "../chunk-LTPQKBJH.js";
|
|
161
171
|
import {
|
|
162
172
|
confirmAppConnection,
|
|
163
173
|
connectDevice,
|
|
@@ -167,13 +177,13 @@ import {
|
|
|
167
177
|
printConnectInstructions,
|
|
168
178
|
roundTripEvidence,
|
|
169
179
|
verifyRoundTrip
|
|
170
|
-
} from "../chunk-
|
|
180
|
+
} from "../chunk-BPD4P3NN.js";
|
|
171
181
|
import "../chunk-3EGEA4KH.js";
|
|
172
182
|
import {
|
|
173
183
|
checkApiKey,
|
|
174
184
|
describeKeyCheck,
|
|
175
185
|
samePusharyAccount
|
|
176
|
-
} from "../chunk-
|
|
186
|
+
} from "../chunk-BOZETFXB.js";
|
|
177
187
|
import {
|
|
178
188
|
setHumanStream
|
|
179
189
|
} from "../chunk-QCGNGEGE.js";
|
|
@@ -198,7 +208,7 @@ import {
|
|
|
198
208
|
readKeySource,
|
|
199
209
|
resolveShellRc,
|
|
200
210
|
writeKey
|
|
201
|
-
} from "../chunk-
|
|
211
|
+
} from "../chunk-DOYARIYB.js";
|
|
202
212
|
import "../chunk-EYRGBYZG.js";
|
|
203
213
|
import "../chunk-SAF6HGAA.js";
|
|
204
214
|
import {
|
|
@@ -207,7 +217,7 @@ import {
|
|
|
207
217
|
import {
|
|
208
218
|
EXIT
|
|
209
219
|
} from "../chunk-KZERVKTD.js";
|
|
210
|
-
import "../chunk-
|
|
220
|
+
import "../chunk-A3D43VXO.js";
|
|
211
221
|
import {
|
|
212
222
|
backupFile,
|
|
213
223
|
readJsonSafe,
|
|
@@ -216,9 +226,13 @@ import {
|
|
|
216
226
|
} from "../chunk-4LL6LG5X.js";
|
|
217
227
|
import "../chunk-2UMNXADU.js";
|
|
218
228
|
import {
|
|
229
|
+
HOOK_COMPATIBLE_PROFILES,
|
|
219
230
|
HOOK_LOCATOR_BINARY,
|
|
231
|
+
PRETOOLUSE_GATED_TOOLS,
|
|
232
|
+
compatibleTargetFiles,
|
|
233
|
+
hookCompatibleProfile,
|
|
220
234
|
isValidApiKey
|
|
221
|
-
} from "../chunk-
|
|
235
|
+
} from "../chunk-TTBRBWAK.js";
|
|
222
236
|
|
|
223
237
|
// bin/pushary-setup.ts
|
|
224
238
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, cpSync, rmSync, renameSync, realpathSync, readdirSync, statSync, openSync, readSync, closeSync } from "fs";
|
|
@@ -1490,18 +1504,28 @@ var setupOpenCode = async (apiKey) => {
|
|
|
1490
1504
|
noteManual("Restart OpenCode to load the plugin.");
|
|
1491
1505
|
return "configured";
|
|
1492
1506
|
};
|
|
1507
|
+
var compatibleRecord = (of) => HOOK_COMPATIBLE_PROFILES.reduce(
|
|
1508
|
+
(record, profile) => ({ ...record, [profile.agentType]: of(profile) }),
|
|
1509
|
+
{}
|
|
1510
|
+
);
|
|
1493
1511
|
var HOOK_FILES = {
|
|
1494
1512
|
claude_code: () => CLAUDE_SETTINGS,
|
|
1495
1513
|
codex: () => CODEX_HOOKS_JSON,
|
|
1496
1514
|
gemini_cli: () => GEMINI_SETTINGS,
|
|
1497
1515
|
cursor: () => CURSOR_USER_HOOKS,
|
|
1498
|
-
vscode: () => join3(VSCODE_PLUGIN_DIR, "hooks", "hooks.json")
|
|
1516
|
+
vscode: () => join3(VSCODE_PLUGIN_DIR, "hooks", "hooks.json"),
|
|
1517
|
+
...compatibleRecord((profile) => () => compatibleConfigFile(profile))
|
|
1499
1518
|
};
|
|
1500
1519
|
var hookOwnerFor = (agent, appAvailable = true) => {
|
|
1501
1520
|
const file = HOOK_FILES[agent]?.();
|
|
1502
1521
|
if (!file) return "none";
|
|
1503
1522
|
const document = readJsonSafe(file);
|
|
1504
|
-
|
|
1523
|
+
const profile = hookCompatibleProfile(agent);
|
|
1524
|
+
return hookOwnerOf(
|
|
1525
|
+
document.kind === "ok" ? document.value : null,
|
|
1526
|
+
appAvailable,
|
|
1527
|
+
profile ? profile.hooksKeyPath : void 0
|
|
1528
|
+
);
|
|
1505
1529
|
};
|
|
1506
1530
|
var appMcpKeyFor = (agent) => {
|
|
1507
1531
|
if (agent === "codex") {
|
|
@@ -1571,10 +1595,90 @@ var agentIsWired = (agent) => {
|
|
|
1571
1595
|
return existsSync(VSCODE_PLUGIN_MCP);
|
|
1572
1596
|
case "opencode":
|
|
1573
1597
|
return openCodeWired();
|
|
1574
|
-
default:
|
|
1575
|
-
|
|
1598
|
+
default: {
|
|
1599
|
+
const profile = hookCompatibleProfile(agent);
|
|
1600
|
+
if (!profile) return true;
|
|
1601
|
+
const config = readJson2(compatibleConfigFile(profile));
|
|
1602
|
+
return config !== null && hasCompatibleHooks(config, profile);
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
};
|
|
1606
|
+
var compatibleGateSummary = (profile) => {
|
|
1607
|
+
const gated = PRETOOLUSE_GATED_TOOLS.map((canonical) => Object.entries(profile.toolAliases).find(([, target]) => target === canonical)?.[0] ?? canonical);
|
|
1608
|
+
return gated.slice(0, 3).map((name) => bold(name)).join(", ");
|
|
1609
|
+
};
|
|
1610
|
+
var setupCompatibleAgent = (profile) => async (apiKey) => {
|
|
1611
|
+
const configFile = compatibleConfigFile(profile);
|
|
1612
|
+
const mcpFile = compatibleMcpFile(profile);
|
|
1613
|
+
const permissionFile = compatiblePermissionRuleFile(profile);
|
|
1614
|
+
const instructionsFile = compatibleInstructionsFile(profile);
|
|
1615
|
+
console.log(`
|
|
1616
|
+
${bold(`Setting up ${profile.label}`)}
|
|
1617
|
+
`);
|
|
1618
|
+
if (!isInstalled(profile.binary) && !existsSync(dirname2(configFile))) {
|
|
1619
|
+
console.log(` ${yellow("!")} ${profile.label} not found. Skipping.`);
|
|
1620
|
+
console.log(` ${dim(`Install ${profile.label} and re-run setup to configure.`)}`);
|
|
1621
|
+
return "skipped";
|
|
1576
1622
|
}
|
|
1623
|
+
await installGlobally2();
|
|
1624
|
+
const documents = /* @__PURE__ */ new Map();
|
|
1625
|
+
const open = (path) => {
|
|
1626
|
+
const existing = documents.get(path);
|
|
1627
|
+
if (existing) return existing;
|
|
1628
|
+
const document = readAgentJson(path);
|
|
1629
|
+
documents.set(path, document);
|
|
1630
|
+
return document;
|
|
1631
|
+
};
|
|
1632
|
+
const declined = [];
|
|
1633
|
+
const record = (path, write) => {
|
|
1634
|
+
if (!write.ok) declined.push(`${shortenHome(path)} \u2192 ${write.conflictAt}`);
|
|
1635
|
+
};
|
|
1636
|
+
const events = compatibleHookEvents(profile).map((hook) => hook.event);
|
|
1637
|
+
await spinner(`Adding hooks (${events.slice(0, 4).join(", ")}${events.length > 4 ? `, +${events.length - 4} more` : ""})`, async () => {
|
|
1638
|
+
record(configFile, addCompatibleHooks(open(configFile), profile, resolveGlobalBinDir("pushary-hook")));
|
|
1639
|
+
});
|
|
1640
|
+
if (mcpFile) {
|
|
1641
|
+
await spinner(`Adding MCP server (${shortenHome(mcpFile)})`, async () => {
|
|
1642
|
+
addCompatibleMcpServer(open(mcpFile), profile, apiKey);
|
|
1643
|
+
});
|
|
1644
|
+
}
|
|
1645
|
+
if (permissionFile) {
|
|
1646
|
+
await spinner("Auto-allowing Pushary MCP tools", async () => {
|
|
1647
|
+
record(permissionFile, addCompatibleToolPermissions(open(permissionFile)));
|
|
1648
|
+
});
|
|
1649
|
+
}
|
|
1650
|
+
if (declined.length > 0) {
|
|
1651
|
+
console.log(`
|
|
1652
|
+
${yellow("!")} ${profile.label} keeps something unexpected where Pushary writes. Nothing was changed.`);
|
|
1653
|
+
for (const conflict of declined) console.log(` ${dim(`\u2022 ${conflict}`)}`);
|
|
1654
|
+
console.log(` ${dim("Pushary expects a list of hook entries there. Move that key and re-run setup.")}`);
|
|
1655
|
+
return "skipped";
|
|
1656
|
+
}
|
|
1657
|
+
for (const [path, document] of documents) {
|
|
1658
|
+
await spinner(`Writing ${shortenHome(path)}`, async () => {
|
|
1659
|
+
writeJsonAtomic(path, document, KEY_FILE_MODE);
|
|
1660
|
+
});
|
|
1661
|
+
}
|
|
1662
|
+
if (instructionsFile && profile.instructions) {
|
|
1663
|
+
await spinner(`Teaching ${profile.label} to ask via push (${shortenHome(instructionsFile)})`, async () => {
|
|
1664
|
+
writeInstructionBlock(instructionsFile, renderAgentInstructions(profile.instructions.label));
|
|
1665
|
+
});
|
|
1666
|
+
}
|
|
1667
|
+
console.log();
|
|
1668
|
+
console.log(` ${dim("What this configured:")}`);
|
|
1669
|
+
console.log(` ${dim("\u2022")} Hooks: phone approvals, policy enforcement, kill switch, session tracking`);
|
|
1670
|
+
console.log(` ${dim("\u2022")} Gate covers ${compatibleGateSummary(profile)}`);
|
|
1671
|
+
if (mcpFile) console.log(` ${dim("\u2022")} MCP server: ${profile.label} can send notifications and ask questions`);
|
|
1672
|
+
else console.log(` ${dim("\u2022")} ${dim(`No MCP server: ${profile.label} documents no remote-server config shape, so approvals work and agent-initiated questions do not`)}`);
|
|
1673
|
+
if (instructionsFile) console.log(` ${dim("\u2022")} Proactive instructions: ${shortenHome(instructionsFile)}`);
|
|
1674
|
+
console.log(` ${dim(`Restart ${profile.label} to load the new config.`)}`);
|
|
1675
|
+
noteManual(`Restart ${profile.label} to load the new config.`);
|
|
1676
|
+
return "configured";
|
|
1577
1677
|
};
|
|
1678
|
+
var COMPATIBLE_SETUP = HOOK_COMPATIBLE_PROFILES.reduce((installers, profile) => ({
|
|
1679
|
+
...installers,
|
|
1680
|
+
[profile.agentType]: setupCompatibleAgent(profile)
|
|
1681
|
+
}), {});
|
|
1578
1682
|
var AGENT_SETUP = {
|
|
1579
1683
|
claude_code: setupClaudeCode,
|
|
1580
1684
|
codex: setupCodex,
|
|
@@ -1583,6 +1687,7 @@ var AGENT_SETUP = {
|
|
|
1583
1687
|
cursor: setupCursor,
|
|
1584
1688
|
vscode: setupVsCode,
|
|
1585
1689
|
opencode: setupOpenCode,
|
|
1690
|
+
...COMPATIBLE_SETUP,
|
|
1586
1691
|
custom: setupCustom
|
|
1587
1692
|
};
|
|
1588
1693
|
var PROJECT_INSTRUCTION_TARGETS = {
|
|
@@ -1686,6 +1791,7 @@ var AGENT_NAMES = {
|
|
|
1686
1791
|
cursor: "Cursor",
|
|
1687
1792
|
vscode: "VS Code",
|
|
1688
1793
|
opencode: "OpenCode",
|
|
1794
|
+
...compatibleRecord((profile) => profile.label),
|
|
1689
1795
|
custom: "Other"
|
|
1690
1796
|
};
|
|
1691
1797
|
var AGENT_CAPABILITIES = {
|
|
@@ -1696,6 +1802,7 @@ var AGENT_CAPABILITIES = {
|
|
|
1696
1802
|
cursor: "plugin + permission gate",
|
|
1697
1803
|
vscode: "agent plugin + permission gate",
|
|
1698
1804
|
opencode: "generated plugin + permission gate",
|
|
1805
|
+
...compatibleRecord((profile) => profile.mcp ? "MCP + native hooks" : "native hooks"),
|
|
1699
1806
|
custom: "any MCP or HTTP agent (Windsurf, n8n, custom)"
|
|
1700
1807
|
};
|
|
1701
1808
|
var NAME_COLUMN = Math.max(...Object.values(AGENT_NAMES).map((name) => name.length)) + 2;
|
|
@@ -1766,6 +1873,7 @@ var AGENT_TARGETS = {
|
|
|
1766
1873
|
openCodeConfigFile(),
|
|
1767
1874
|
OPENCODE_INSTRUCTIONS()
|
|
1768
1875
|
],
|
|
1876
|
+
...compatibleRecord((profile) => compatibleTargetFiles(profile).map((file) => join3(homedir(), ...file))),
|
|
1769
1877
|
custom: ["nothing (prints connection details only)"]
|
|
1770
1878
|
};
|
|
1771
1879
|
var reportDryRun = (apiKey, agents, keyCheck, controlMode) => {
|
|
@@ -1792,10 +1900,10 @@ var reportDryRun = (apiKey, agents, keyCheck, controlMode) => {
|
|
|
1792
1900
|
if (agents.length === 0) {
|
|
1793
1901
|
console.log(` ${dim("Agents:")} ${dim("none")}`);
|
|
1794
1902
|
} else {
|
|
1795
|
-
console.log(` ${dim("Agents:")} ${agents.map((
|
|
1903
|
+
console.log(` ${dim("Agents:")} ${agents.map((agent) => AGENT_NAMES[agent]).join(", ")}`);
|
|
1796
1904
|
for (const agent of agents) {
|
|
1797
1905
|
console.log();
|
|
1798
|
-
console.log(` ${bold(agent
|
|
1906
|
+
console.log(` ${bold(AGENT_NAMES[agent])}`);
|
|
1799
1907
|
for (const target of AGENT_TARGETS[agent]) console.log(` ${dim("would write")} ${target}`);
|
|
1800
1908
|
}
|
|
1801
1909
|
}
|
|
@@ -2045,7 +2153,7 @@ var main = async () => {
|
|
|
2045
2153
|
if (keepAppWiring) {
|
|
2046
2154
|
if (!await appAccountMatches(agent)) {
|
|
2047
2155
|
hookOwners.push({ agent, owner: "app", kept: true });
|
|
2048
|
-
failed.push(agent
|
|
2156
|
+
failed.push(AGENT_NAMES[agent]);
|
|
2049
2157
|
console.log(`
|
|
2050
2158
|
${yellow("!")} ${AGENT_NAMES[agent]}: Mac app hooks kept, but their Pushary account could not be matched to this setup.`);
|
|
2051
2159
|
console.log(` ${dim("Sign the Mac app into the same account and repair this agent, then re-run setup.")}`);
|
|
@@ -2066,13 +2174,13 @@ var main = async () => {
|
|
|
2066
2174
|
completed.push(agent);
|
|
2067
2175
|
hookOwners.push({ agent, owner: hookOwnerFor(agent, appBridgeAvailable), kept: false });
|
|
2068
2176
|
} else {
|
|
2069
|
-
failed.push(agent
|
|
2070
|
-
console.log(` ${yellow("!")} ${agent
|
|
2177
|
+
failed.push(AGENT_NAMES[agent]);
|
|
2178
|
+
console.log(` ${yellow("!")} ${AGENT_NAMES[agent]} reported success but its config is not there.`);
|
|
2071
2179
|
console.log(` ${dim("Re-run setup, then")} ${cyan("npx @pushary/agent-hooks@latest doctor")} ${dim("to see what is missing.")}`);
|
|
2072
2180
|
}
|
|
2073
2181
|
} catch (err) {
|
|
2074
|
-
failed.push(agent
|
|
2075
|
-
console.log(` ${yellow("!")} ${agent
|
|
2182
|
+
failed.push(AGENT_NAMES[agent]);
|
|
2183
|
+
console.log(` ${yellow("!")} ${AGENT_NAMES[agent]} setup failed: ${formatError(err)}`);
|
|
2076
2184
|
console.log(` ${dim("Other agents will continue. Re-run setup to retry.")}`);
|
|
2077
2185
|
}
|
|
2078
2186
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readLedgerSummary
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-DUOG74E7.js";
|
|
5
5
|
import {
|
|
6
6
|
exitOnHelpFlag
|
|
7
7
|
} from "../chunk-GOQHN2UH.js";
|
|
@@ -11,7 +11,7 @@ import "../chunk-KZERVKTD.js";
|
|
|
11
11
|
import {
|
|
12
12
|
getApiKey
|
|
13
13
|
} from "../chunk-2UMNXADU.js";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-TTBRBWAK.js";
|
|
15
15
|
|
|
16
16
|
// bin/pushary-stats.ts
|
|
17
17
|
exitOnHelpFlag("stats");
|