@pushary/agent-hooks 0.84.1 → 0.85.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.
Files changed (71) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +24 -0
  3. package/data/cursor-plugin/CHANGELOG.md +21 -0
  4. package/data/cursor-plugin/scripts/pushary-gate.mjs +54 -222
  5. package/data/cursor-plugin/scripts/pushary-gate.test.mjs +11 -106
  6. package/data/vscode-plugin/CHANGELOG.md +26 -0
  7. package/data/vscode-plugin/scripts/pushary-gate.mjs +66 -74
  8. package/dist/bin/pushary-bell-hook.js +9 -7
  9. package/dist/bin/pushary-bell.js +12 -11
  10. package/dist/bin/pushary-claude.js +12 -11
  11. package/dist/bin/pushary-clean.js +8 -7
  12. package/dist/bin/pushary-codex-bridge.js +5 -5
  13. package/dist/bin/pushary-codex-hook.js +14 -20
  14. package/dist/bin/pushary-codex.js +3 -3
  15. package/dist/bin/pushary-connect.js +10 -10
  16. package/dist/bin/pushary-daemon.js +6 -6
  17. package/dist/bin/pushary-disconnect.d.ts +1 -0
  18. package/dist/bin/pushary-disconnect.js +125 -0
  19. package/dist/bin/pushary-doctor.js +16 -16
  20. package/dist/bin/pushary-gemini-bridge.js +5 -5
  21. package/dist/bin/pushary-gemini-hook.js +14 -20
  22. package/dist/bin/pushary-hook.js +16 -23
  23. package/dist/bin/pushary-login.js +6 -6
  24. package/dist/bin/pushary-logout.js +6 -6
  25. package/dist/bin/pushary-mode.js +5 -5
  26. package/dist/bin/pushary-notification-hook.js +8 -11
  27. package/dist/bin/pushary-permission-denied-hook.js +14 -12
  28. package/dist/bin/pushary-permission-hook.js +14 -12
  29. package/dist/bin/pushary-post-hook.js +8 -11
  30. package/dist/bin/pushary-prompt-hook.js +8 -11
  31. package/dist/bin/pushary-session-end-hook.js +8 -8
  32. package/dist/bin/pushary-session-start-hook.js +8 -8
  33. package/dist/bin/pushary-setup.js +29 -30
  34. package/dist/bin/pushary-stats.js +4 -4
  35. package/dist/bin/pushary-status.js +7 -7
  36. package/dist/bin/pushary-stop-hook.js +8 -8
  37. package/dist/bin/pushary-stopfailure-hook.js +8 -8
  38. package/dist/bin/pushary-suggestions.js +2 -2
  39. package/dist/bin/pushary-upgrade.js +15 -10
  40. package/dist/bin/pushary-wait.js +5 -5
  41. package/dist/bin/pushary.js +2 -1
  42. package/dist/{chunk-ILB6UOAF.js → chunk-55656H4Q.js} +1 -1
  43. package/dist/chunk-6CUUA7HO.js +59 -0
  44. package/dist/{chunk-6LC4WSCL.js → chunk-BZKTCOZQ.js} +1 -1
  45. package/dist/{chunk-K7CSRGKZ.js → chunk-CIVG746V.js} +1 -1
  46. package/dist/{chunk-FBGBJXVC.js → chunk-DNSIVHIA.js} +1 -1
  47. package/dist/{chunk-437T77TY.js → chunk-ES3FAX5X.js} +1 -1
  48. package/dist/chunk-EZPRY2ZY.js +70 -0
  49. package/dist/{chunk-MQMPG5X4.js → chunk-G3LXA2ZP.js} +207 -10
  50. package/dist/chunk-GM54KC62.js +187 -0
  51. package/dist/{chunk-MGJBC6DD.js → chunk-GOEXZ5QJ.js} +1 -0
  52. package/dist/chunk-HSGEEBBL.js +37 -0
  53. package/dist/{chunk-UXWEE3QI.js → chunk-IGV4KL7B.js} +1 -1
  54. package/dist/{chunk-GCKAWHFP.js → chunk-JDQY47OW.js} +1 -1
  55. package/dist/{chunk-7PZPJSWI.js → chunk-KTKIZEFT.js} +1 -1
  56. package/dist/{chunk-YR5TSPXB.js → chunk-LB6RSCLL.js} +12 -10
  57. package/dist/{chunk-DOXSWT4Q.js → chunk-OZKRF7MS.js} +6 -6
  58. package/dist/{chunk-SEAHGHCE.js → chunk-PHXEADSL.js} +40 -7
  59. package/dist/{chunk-F52SIIDG.js → chunk-QDKJTPAT.js} +1 -1
  60. package/dist/{chunk-J4KFVOCQ.js → chunk-SQOFGPNX.js} +1 -1
  61. package/dist/{chunk-NJ7JT26G.js → chunk-VGADRFG6.js} +1 -1
  62. package/dist/{chunk-HZNOAJGB.js → chunk-VKJUVPTJ.js} +2 -2
  63. package/dist/{chunk-ERYKGH4J.js → chunk-XIR6N66V.js} +1 -1
  64. package/dist/{chunk-CCH775Y6.js → chunk-XLM6COJA.js} +1 -1
  65. package/dist/{chunk-CCCJ6BPW.js → chunk-Y7BALRVB.js} +73 -134
  66. package/dist/chunk-YHG74UFF.js +12 -0
  67. package/dist/src/index.d.ts +7 -22
  68. package/dist/src/index.js +11 -8
  69. package/package.json +6 -3
  70. package/dist/chunk-BLDDXHHA.js +0 -66
  71. package/dist/chunk-UKSQWTBH.js +0 -208
@@ -0,0 +1,125 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ removeGeminiSettings
4
+ } from "../chunk-OZKRF7MS.js";
5
+ import {
6
+ removeClaudeMcpServers,
7
+ removePusharySettings
8
+ } from "../chunk-GM54KC62.js";
9
+ import "../chunk-HSGEEBBL.js";
10
+ import "../chunk-VT4IVERX.js";
11
+ import {
12
+ claudeJson,
13
+ claudeSettings,
14
+ claudeSettingsLocal,
15
+ codexConfigToml,
16
+ codexHooksJson,
17
+ cursorUserHooks,
18
+ cursorUserMcp,
19
+ geminiSettings,
20
+ removeCodexHooks,
21
+ removeCodexSettings
22
+ } from "../chunk-PHXEADSL.js";
23
+ import {
24
+ exitOnHelpFlag
25
+ } from "../chunk-SQOFGPNX.js";
26
+ import "../chunk-GOEXZ5QJ.js";
27
+ import "../chunk-DINDL2CF.js";
28
+ import "../chunk-KZERVKTD.js";
29
+ import "../chunk-G3LXA2ZP.js";
30
+
31
+ // bin/pushary-disconnect.ts
32
+ import { readFileSync, writeFileSync } from "fs";
33
+ import { parse as parseTOML, stringify as stringifyTOML } from "smol-toml";
34
+
35
+ // src/disconnect.ts
36
+ var DISCONNECTABLE_AGENTS = ["claude", "codex", "gemini", "cursor"];
37
+ var isDisconnectableAgent = (value) => DISCONNECTABLE_AGENTS.includes(value);
38
+ var removeCursorHooks = (config) => {
39
+ const hooks = config.hooks;
40
+ if (!hooks) return false;
41
+ let changed = false;
42
+ for (const [event, entries] of Object.entries(hooks)) {
43
+ if (!Array.isArray(entries)) continue;
44
+ const kept = entries.filter((entry) => !String(entry?.command ?? "").includes("pushary"));
45
+ if (kept.length === entries.length) continue;
46
+ changed = true;
47
+ if (kept.length === 0) delete hooks[event];
48
+ else hooks[event] = kept;
49
+ }
50
+ if (changed && Object.keys(hooks).length === 0) delete config.hooks;
51
+ return changed;
52
+ };
53
+ var disconnectPlan = (agent) => {
54
+ switch (agent) {
55
+ case "claude":
56
+ return [
57
+ { path: claudeSettings(), format: "json", remove: removePusharySettings },
58
+ { path: claudeSettingsLocal(), format: "json", remove: removePusharySettings },
59
+ { path: claudeJson(), format: "json", remove: removeClaudeMcpServers }
60
+ ];
61
+ case "codex":
62
+ return [
63
+ { path: codexHooksJson(), format: "json", remove: removeCodexHooks },
64
+ { path: codexConfigToml(), format: "toml", remove: (config) => removeCodexSettings(config, codexHooksJson()) }
65
+ ];
66
+ case "gemini":
67
+ return [{ path: geminiSettings(), format: "json", remove: removeGeminiSettings }];
68
+ case "cursor":
69
+ return [
70
+ { path: cursorUserHooks(), format: "json", remove: removeCursorHooks },
71
+ { path: cursorUserMcp(), format: "json", remove: removeClaudeMcpServers }
72
+ ];
73
+ }
74
+ };
75
+ var disconnectAgent = (agent, io) => {
76
+ const changed = [];
77
+ const untouched = [];
78
+ for (const edit of disconnectPlan(agent)) {
79
+ const raw = io.read(edit.path);
80
+ if (raw === null) continue;
81
+ try {
82
+ const config = edit.format === "toml" ? io.parseToml(raw) : JSON.parse(raw);
83
+ if (!edit.remove(config)) {
84
+ untouched.push(edit.path);
85
+ continue;
86
+ }
87
+ io.write(
88
+ edit.path,
89
+ edit.format === "toml" ? io.stringifyToml(config) : `${JSON.stringify(config, null, 2)}
90
+ `
91
+ );
92
+ changed.push(edit.path);
93
+ } catch {
94
+ untouched.push(edit.path);
95
+ }
96
+ }
97
+ return { agent, changed, untouched };
98
+ };
99
+
100
+ // bin/pushary-disconnect.ts
101
+ exitOnHelpFlag("disconnect");
102
+ var rest = process.argv.slice(2);
103
+ var requested = rest[0] === "disconnect" ? rest[1] : rest[0];
104
+ if (!requested || !isDisconnectableAgent(requested)) {
105
+ console.error(`Usage: pushary disconnect <${DISCONNECTABLE_AGENTS.join("|")}>`);
106
+ process.exit(1);
107
+ }
108
+ var result = disconnectAgent(requested, {
109
+ read: (path) => {
110
+ try {
111
+ return readFileSync(path, "utf-8");
112
+ } catch {
113
+ return null;
114
+ }
115
+ },
116
+ write: (path, contents) => writeFileSync(path, contents, "utf-8"),
117
+ parseToml: (raw) => parseTOML(raw),
118
+ stringifyToml: (config) => stringifyTOML(config)
119
+ });
120
+ if (result.changed.length === 0) {
121
+ console.log(`${requested} was not connected.`);
122
+ } else {
123
+ console.log(`Disconnected ${requested}:`);
124
+ for (const path of result.changed) console.log(` ${path}`);
125
+ }
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- describeWaitLadder
4
- } from "../chunk-IIENZE2J.js";
5
2
  import {
6
3
  claudeWired,
7
4
  codexWired,
8
5
  geminiWired
9
- } from "../chunk-HZNOAJGB.js";
6
+ } from "../chunk-VKJUVPTJ.js";
7
+ import {
8
+ describeWaitLadder
9
+ } from "../chunk-IIENZE2J.js";
10
10
  import {
11
11
  readDaemonStatus
12
- } from "../chunk-CCH775Y6.js";
12
+ } from "../chunk-XLM6COJA.js";
13
13
  import {
14
14
  agentProbes,
15
15
  detectAgent,
@@ -18,12 +18,12 @@ import {
18
18
  isDetected,
19
19
  isPluginRegistered,
20
20
  vscodeSettingsTargets
21
- } from "../chunk-UXWEE3QI.js";
21
+ } from "../chunk-IGV4KL7B.js";
22
22
  import {
23
23
  GEMINI_HOOK_BINARY,
24
24
  hasGeminiHooks,
25
25
  missingGeminiHookEvents
26
- } from "../chunk-DOXSWT4Q.js";
26
+ } from "../chunk-OZKRF7MS.js";
27
27
  import "../chunk-XHKBHWLX.js";
28
28
  import {
29
29
  execNpm
@@ -46,10 +46,10 @@ import {
46
46
  readCodexMcpAuth,
47
47
  untrustedCodexHookEvents,
48
48
  vscodePluginDir
49
- } from "../chunk-SEAHGHCE.js";
49
+ } from "../chunk-PHXEADSL.js";
50
50
  import {
51
51
  readLedgerSummary
52
- } from "../chunk-NJ7JT26G.js";
52
+ } from "../chunk-VGADRFG6.js";
53
53
  import {
54
54
  getMachineId
55
55
  } from "../chunk-RN3NOEJF.js";
@@ -59,26 +59,26 @@ import {
59
59
  fetchChannels,
60
60
  reachVerdict,
61
61
  verifyRoundTrip
62
- } from "../chunk-6LC4WSCL.js";
62
+ } from "../chunk-BZKTCOZQ.js";
63
63
  import "../chunk-3EGEA4KH.js";
64
64
  import {
65
65
  checkApiKey,
66
66
  describeKeyCheck
67
- } from "../chunk-F52SIIDG.js";
67
+ } from "../chunk-QDKJTPAT.js";
68
68
  import {
69
69
  createIo
70
70
  } from "../chunk-5RUIFDTP.js";
71
71
  import {
72
72
  keyPrefix,
73
73
  readKeySource
74
- } from "../chunk-K7CSRGKZ.js";
74
+ } from "../chunk-CIVG746V.js";
75
75
  import {
76
76
  parseFlags
77
77
  } from "../chunk-GMXKITVA.js";
78
78
  import {
79
79
  exitOnHelpFlag
80
- } from "../chunk-J4KFVOCQ.js";
81
- import "../chunk-MGJBC6DD.js";
80
+ } from "../chunk-SQOFGPNX.js";
81
+ import "../chunk-GOEXZ5QJ.js";
82
82
  import "../chunk-BC3VCZ3E.js";
83
83
  import {
84
84
  getPackageVersion
@@ -89,7 +89,7 @@ import {
89
89
  sendMcpRequest
90
90
  } from "../chunk-BSZYIAZL.js";
91
91
  import "../chunk-SAF6HGAA.js";
92
- import "../chunk-437T77TY.js";
92
+ import "../chunk-ES3FAX5X.js";
93
93
  import {
94
94
  UsageError
95
95
  } from "../chunk-7QLSKOSU.js";
@@ -99,7 +99,7 @@ import {
99
99
  import {
100
100
  getBaseUrl
101
101
  } from "../chunk-2UMNXADU.js";
102
- import "../chunk-MQMPG5X4.js";
102
+ import "../chunk-G3LXA2ZP.js";
103
103
 
104
104
  // bin/pushary-doctor.ts
105
105
  import { existsSync, readFileSync, writeFileSync } from "fs";
@@ -5,19 +5,19 @@ import {
5
5
  postLiveSession,
6
6
  postLiveSessionUntilAccepted,
7
7
  startLiveSessionHeartbeat
8
- } from "../chunk-ERYKGH4J.js";
9
- import "../chunk-GCKAWHFP.js";
8
+ } from "../chunk-XIR6N66V.js";
9
+ import "../chunk-JDQY47OW.js";
10
10
  import {
11
11
  startProcessOwnership,
12
12
  withSpawnProcessOwnership
13
- } from "../chunk-ILB6UOAF.js";
13
+ } from "../chunk-55656H4Q.js";
14
14
  import {
15
15
  spawnClaude
16
16
  } from "../chunk-XHKBHWLX.js";
17
17
  import {
18
18
  resolveBinary
19
19
  } from "../chunk-VT4IVERX.js";
20
- import "../chunk-SEAHGHCE.js";
20
+ import "../chunk-PHXEADSL.js";
21
21
  import {
22
22
  getMachineId
23
23
  } from "../chunk-RN3NOEJF.js";
@@ -26,7 +26,7 @@ import {
26
26
  getApiKey,
27
27
  getBaseUrl
28
28
  } from "../chunk-2UMNXADU.js";
29
- import "../chunk-MQMPG5X4.js";
29
+ import "../chunk-G3LXA2ZP.js";
30
30
 
31
31
  // bin/pushary-gemini-bridge.ts
32
32
  import { existsSync } from "fs";
@@ -2,13 +2,14 @@
2
2
  import {
3
3
  isGatingMoment,
4
4
  recordKeylessMoment
5
- } from "../chunk-NJ7JT26G.js";
5
+ } from "../chunk-VGADRFG6.js";
6
+ import {
7
+ readHookInput
8
+ } from "../chunk-6CUUA7HO.js";
6
9
  import {
7
- KILL_REASON,
8
10
  denyReasonFrom,
9
- isDeferAnswer,
10
- resolveGate
11
- } from "../chunk-BLDDXHHA.js";
11
+ isDeferAnswer
12
+ } from "../chunk-YHG74UFF.js";
12
13
  import {
13
14
  DEFAULT_SESSION,
14
15
  askUser,
@@ -31,13 +32,13 @@ import {
31
32
  scopePathFor,
32
33
  sendNotification,
33
34
  waitForAnswer
34
- } from "../chunk-CCCJ6BPW.js";
35
+ } from "../chunk-Y7BALRVB.js";
35
36
  import {
36
37
  getMachineId
37
38
  } from "../chunk-RN3NOEJF.js";
38
39
  import "../chunk-BSZYIAZL.js";
39
40
  import "../chunk-SAF6HGAA.js";
40
- import "../chunk-437T77TY.js";
41
+ import "../chunk-ES3FAX5X.js";
41
42
  import "../chunk-7QLSKOSU.js";
42
43
  import "../chunk-KZERVKTD.js";
43
44
  import {
@@ -45,10 +46,12 @@ import {
45
46
  } from "../chunk-2UMNXADU.js";
46
47
  import {
47
48
  DECISION_LINE_MAX,
49
+ KILL_REASON,
48
50
  effectiveWaitSeconds,
49
51
  hookWaitClamped,
50
- hookWaitDeadline
51
- } from "../chunk-MQMPG5X4.js";
52
+ hookWaitDeadline,
53
+ resolveGate
54
+ } from "../chunk-G3LXA2ZP.js";
52
55
 
53
56
  // bin/pushary-gemini-hook.ts
54
57
  import { basename } from "path";
@@ -278,17 +281,8 @@ var emit = (wire) => {
278
281
  if (wire) process.stdout.write(JSON.stringify(wire));
279
282
  };
280
283
  var main = async () => {
281
- let rawInput = "";
282
- for await (const chunk of process.stdin) {
283
- rawInput += chunk;
284
- }
285
- if (!rawInput.trim()) {
286
- process.exit(0);
287
- }
288
- let input;
289
- try {
290
- input = JSON.parse(rawInput);
291
- } catch {
284
+ const input = await readHookInput("gemini");
285
+ if (!input) {
292
286
  process.exit(0);
293
287
  }
294
288
  try {
@@ -1,42 +1,35 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePreToolUse
4
- } from "../chunk-YR5TSPXB.js";
5
- import "../chunk-UKSQWTBH.js";
6
- import "../chunk-NJ7JT26G.js";
7
- import "../chunk-BLDDXHHA.js";
8
- import "../chunk-CCCJ6BPW.js";
4
+ } from "../chunk-LB6RSCLL.js";
5
+ import "../chunk-GM54KC62.js";
6
+ import "../chunk-HSGEEBBL.js";
7
+ import "../chunk-VT4IVERX.js";
8
+ import "../chunk-VGADRFG6.js";
9
+ import {
10
+ readHookInput
11
+ } from "../chunk-6CUUA7HO.js";
12
+ import "../chunk-YHG74UFF.js";
13
+ import "../chunk-Y7BALRVB.js";
9
14
  import "../chunk-RN3NOEJF.js";
10
15
  import {
11
16
  exitOnHelpFlag
12
- } from "../chunk-J4KFVOCQ.js";
13
- import "../chunk-MGJBC6DD.js";
17
+ } from "../chunk-SQOFGPNX.js";
18
+ import "../chunk-GOEXZ5QJ.js";
14
19
  import "../chunk-DINDL2CF.js";
15
20
  import "../chunk-BSZYIAZL.js";
16
21
  import "../chunk-SAF6HGAA.js";
17
- import "../chunk-437T77TY.js";
22
+ import "../chunk-ES3FAX5X.js";
18
23
  import "../chunk-7QLSKOSU.js";
19
24
  import "../chunk-KZERVKTD.js";
20
25
  import "../chunk-2UMNXADU.js";
21
- import "../chunk-MQMPG5X4.js";
26
+ import "../chunk-G3LXA2ZP.js";
22
27
 
23
28
  // bin/pushary-hook.ts
24
29
  exitOnHelpFlag("hook");
25
30
  var main = async () => {
26
- let rawInput = "";
27
- for await (const chunk of process.stdin) {
28
- rawInput += chunk;
29
- }
30
- if (!rawInput.trim()) {
31
- process.exit(0);
32
- }
33
- let input;
34
- try {
35
- input = JSON.parse(rawInput);
36
- } catch {
37
- process.exit(0);
38
- }
39
- if (!input.tool_name) {
31
+ const input = await readHookInput("claude", "PreToolUse");
32
+ if (!input?.tool_name) {
40
33
  process.exit(0);
41
34
  }
42
35
  try {
@@ -6,28 +6,28 @@ import "../chunk-3EGEA4KH.js";
6
6
  import {
7
7
  checkApiKey,
8
8
  describeKeyCheck
9
- } from "../chunk-F52SIIDG.js";
9
+ } from "../chunk-QDKJTPAT.js";
10
10
  import {
11
11
  createIo
12
12
  } from "../chunk-5RUIFDTP.js";
13
13
  import {
14
14
  readKeySource,
15
15
  writeKey
16
- } from "../chunk-K7CSRGKZ.js";
16
+ } from "../chunk-CIVG746V.js";
17
17
  import {
18
18
  parseFlags
19
19
  } from "../chunk-GMXKITVA.js";
20
20
  import {
21
21
  exitOnHelpFlag
22
- } from "../chunk-J4KFVOCQ.js";
23
- import "../chunk-MGJBC6DD.js";
22
+ } from "../chunk-SQOFGPNX.js";
23
+ import "../chunk-GOEXZ5QJ.js";
24
24
  import "../chunk-BC3VCZ3E.js";
25
25
  import {
26
26
  getPackageVersion
27
27
  } from "../chunk-DINDL2CF.js";
28
28
  import "../chunk-6MTNS63X.js";
29
29
  import "../chunk-SAF6HGAA.js";
30
- import "../chunk-437T77TY.js";
30
+ import "../chunk-ES3FAX5X.js";
31
31
  import {
32
32
  UsageError
33
33
  } from "../chunk-7QLSKOSU.js";
@@ -37,7 +37,7 @@ import {
37
37
  import "../chunk-2UMNXADU.js";
38
38
  import {
39
39
  isValidApiKey
40
- } from "../chunk-MQMPG5X4.js";
40
+ } from "../chunk-G3LXA2ZP.js";
41
41
 
42
42
  // bin/pushary-login.ts
43
43
  exitOnHelpFlag("login");
@@ -4,25 +4,25 @@ import {
4
4
  codexConfigToml,
5
5
  cursorUserMcp,
6
6
  geminiSettings
7
- } from "../chunk-SEAHGHCE.js";
7
+ } from "../chunk-PHXEADSL.js";
8
8
  import {
9
9
  createIo
10
10
  } from "../chunk-5RUIFDTP.js";
11
11
  import {
12
12
  clearKey,
13
13
  readKeySource
14
- } from "../chunk-K7CSRGKZ.js";
14
+ } from "../chunk-CIVG746V.js";
15
15
  import {
16
16
  parseFlags
17
17
  } from "../chunk-GMXKITVA.js";
18
18
  import {
19
19
  exitOnHelpFlag
20
- } from "../chunk-J4KFVOCQ.js";
21
- import "../chunk-MGJBC6DD.js";
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";
25
- import "../chunk-437T77TY.js";
25
+ import "../chunk-ES3FAX5X.js";
26
26
  import {
27
27
  UsageError
28
28
  } from "../chunk-7QLSKOSU.js";
@@ -32,7 +32,7 @@ import {
32
32
  import {
33
33
  getBaseUrl
34
34
  } from "../chunk-2UMNXADU.js";
35
- import "../chunk-MQMPG5X4.js";
35
+ import "../chunk-G3LXA2ZP.js";
36
36
 
37
37
  // bin/pushary-logout.ts
38
38
  import { existsSync } from "fs";
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  exitOnFailedResponse
4
- } from "../chunk-FBGBJXVC.js";
5
- import "../chunk-F52SIIDG.js";
4
+ } from "../chunk-DNSIVHIA.js";
5
+ import "../chunk-QDKJTPAT.js";
6
6
  import {
7
7
  createIo
8
8
  } from "../chunk-5RUIFDTP.js";
@@ -11,8 +11,8 @@ import {
11
11
  } from "../chunk-GMXKITVA.js";
12
12
  import {
13
13
  exitOnHelpFlag
14
- } from "../chunk-J4KFVOCQ.js";
15
- import "../chunk-MGJBC6DD.js";
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 {
@@ -25,7 +25,7 @@ import {
25
25
  getApiKey,
26
26
  getBaseUrl
27
27
  } from "../chunk-2UMNXADU.js";
28
- import "../chunk-MQMPG5X4.js";
28
+ import "../chunk-G3LXA2ZP.js";
29
29
 
30
30
  // bin/pushary-mode.ts
31
31
  exitOnHelpFlag("mode");
@@ -1,27 +1,24 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ readHookInput
4
+ } from "../chunk-6CUUA7HO.js";
2
5
  import {
3
6
  handleNotification
4
- } from "../chunk-CCCJ6BPW.js";
7
+ } from "../chunk-Y7BALRVB.js";
5
8
  import "../chunk-RN3NOEJF.js";
6
9
  import "../chunk-BSZYIAZL.js";
7
10
  import "../chunk-SAF6HGAA.js";
8
- import "../chunk-437T77TY.js";
11
+ import "../chunk-ES3FAX5X.js";
9
12
  import "../chunk-7QLSKOSU.js";
10
13
  import "../chunk-KZERVKTD.js";
11
14
  import "../chunk-2UMNXADU.js";
12
- import "../chunk-MQMPG5X4.js";
15
+ import "../chunk-G3LXA2ZP.js";
13
16
 
14
17
  // bin/pushary-notification-hook.ts
15
18
  var main = async () => {
16
- let rawInput = "";
17
- for await (const chunk of process.stdin) {
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,28 +1,30 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePermissionDenied
4
- } from "../chunk-YR5TSPXB.js";
5
- import "../chunk-UKSQWTBH.js";
6
- import "../chunk-NJ7JT26G.js";
7
- import "../chunk-BLDDXHHA.js";
8
- import "../chunk-CCCJ6BPW.js";
4
+ } from "../chunk-LB6RSCLL.js";
5
+ import "../chunk-GM54KC62.js";
6
+ import "../chunk-HSGEEBBL.js";
7
+ import "../chunk-VT4IVERX.js";
8
+ import "../chunk-VGADRFG6.js";
9
+ import {
10
+ readHookInput
11
+ } from "../chunk-6CUUA7HO.js";
12
+ import "../chunk-YHG74UFF.js";
13
+ import "../chunk-Y7BALRVB.js";
9
14
  import "../chunk-RN3NOEJF.js";
10
15
  import "../chunk-BSZYIAZL.js";
11
16
  import "../chunk-SAF6HGAA.js";
12
- import "../chunk-437T77TY.js";
17
+ import "../chunk-ES3FAX5X.js";
13
18
  import "../chunk-7QLSKOSU.js";
14
19
  import "../chunk-KZERVKTD.js";
15
20
  import "../chunk-2UMNXADU.js";
16
- import "../chunk-MQMPG5X4.js";
21
+ import "../chunk-G3LXA2ZP.js";
17
22
 
18
23
  // bin/pushary-permission-denied-hook.ts
19
24
  var main = async () => {
20
- let rawInput = "";
21
- for await (const chunk of process.stdin) {
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,28 +1,30 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePermissionRequest
4
- } from "../chunk-YR5TSPXB.js";
5
- import "../chunk-UKSQWTBH.js";
6
- import "../chunk-NJ7JT26G.js";
7
- import "../chunk-BLDDXHHA.js";
8
- import "../chunk-CCCJ6BPW.js";
4
+ } from "../chunk-LB6RSCLL.js";
5
+ import "../chunk-GM54KC62.js";
6
+ import "../chunk-HSGEEBBL.js";
7
+ import "../chunk-VT4IVERX.js";
8
+ import "../chunk-VGADRFG6.js";
9
+ import {
10
+ readHookInput
11
+ } from "../chunk-6CUUA7HO.js";
12
+ import "../chunk-YHG74UFF.js";
13
+ import "../chunk-Y7BALRVB.js";
9
14
  import "../chunk-RN3NOEJF.js";
10
15
  import "../chunk-BSZYIAZL.js";
11
16
  import "../chunk-SAF6HGAA.js";
12
- import "../chunk-437T77TY.js";
17
+ import "../chunk-ES3FAX5X.js";
13
18
  import "../chunk-7QLSKOSU.js";
14
19
  import "../chunk-KZERVKTD.js";
15
20
  import "../chunk-2UMNXADU.js";
16
- import "../chunk-MQMPG5X4.js";
21
+ import "../chunk-G3LXA2ZP.js";
17
22
 
18
23
  // bin/pushary-permission-hook.ts
19
24
  var main = async () => {
20
- let rawInput = "";
21
- for await (const chunk of process.stdin) {
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,27 +1,24 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ readHookInput
4
+ } from "../chunk-6CUUA7HO.js";
2
5
  import {
3
6
  handlePostToolUse
4
- } from "../chunk-CCCJ6BPW.js";
7
+ } from "../chunk-Y7BALRVB.js";
5
8
  import "../chunk-RN3NOEJF.js";
6
9
  import "../chunk-BSZYIAZL.js";
7
10
  import "../chunk-SAF6HGAA.js";
8
- import "../chunk-437T77TY.js";
11
+ import "../chunk-ES3FAX5X.js";
9
12
  import "../chunk-7QLSKOSU.js";
10
13
  import "../chunk-KZERVKTD.js";
11
14
  import "../chunk-2UMNXADU.js";
12
- import "../chunk-MQMPG5X4.js";
15
+ import "../chunk-G3LXA2ZP.js";
13
16
 
14
17
  // bin/pushary-post-hook.ts
15
18
  var main = async () => {
16
- let rawInput = "";
17
- for await (const chunk of process.stdin) {
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({