@pushary/agent-hooks 0.89.13 → 0.90.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 (78) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/data/SKILL.md +1 -1
  3. package/data/cursor-plugin/skills/pushary/SKILL.md +1 -1
  4. package/data/vscode-plugin/skills/pushary/SKILL.md +1 -1
  5. package/dist/bin/pushary-bell-hook.js +4 -4
  6. package/dist/bin/pushary-bell.js +8 -8
  7. package/dist/bin/pushary-claude.js +72 -21
  8. package/dist/bin/pushary-clean.js +16 -42
  9. package/dist/bin/pushary-codex-bridge.js +37 -12
  10. package/dist/bin/pushary-codex-hook.js +45 -12
  11. package/dist/bin/pushary-codex.js +7 -7
  12. package/dist/bin/pushary-connect.js +11 -10
  13. package/dist/bin/pushary-daemon.js +187 -63
  14. package/dist/bin/pushary-disconnect.js +8 -8
  15. package/dist/bin/pushary-doctor.js +108 -25
  16. package/dist/bin/pushary-elicitation-hook.js +4 -4
  17. package/dist/bin/pushary-gemini-bridge.js +33 -11
  18. package/dist/bin/pushary-gemini-hook.js +21 -10
  19. package/dist/bin/pushary-hook.js +13 -13
  20. package/dist/bin/pushary-login.js +18 -7
  21. package/dist/bin/pushary-logout.js +6 -6
  22. package/dist/bin/pushary-mode.js +28 -21
  23. package/dist/bin/pushary-notification-hook.js +7 -7
  24. package/dist/bin/pushary-opencode-hook.js +8 -8
  25. package/dist/bin/pushary-permission-denied-hook.js +11 -11
  26. package/dist/bin/pushary-permission-hook.js +11 -11
  27. package/dist/bin/pushary-post-hook.js +14 -8
  28. package/dist/bin/pushary-prompt-hook.js +7 -7
  29. package/dist/bin/pushary-session-end-hook.js +7 -7
  30. package/dist/bin/pushary-session-start-hook.js +7 -7
  31. package/dist/bin/pushary-setup.js +168 -45
  32. package/dist/bin/pushary-stats.js +4 -4
  33. package/dist/bin/pushary-status.js +11 -10
  34. package/dist/bin/pushary-stop-hook.js +14 -8
  35. package/dist/bin/pushary-stopfailure-hook.js +7 -7
  36. package/dist/bin/pushary-suggestions.js +2 -2
  37. package/dist/bin/pushary-transcripts.js +6 -6
  38. package/dist/bin/pushary-upgrade.js +15 -15
  39. package/dist/bin/pushary-wait.js +5 -5
  40. package/dist/bin/pushary.js +1 -1
  41. package/dist/{chunk-B2HND22S.js → chunk-2LAHXHBR.js} +1 -1
  42. package/dist/{chunk-GMJDQDXU.js → chunk-43GMYSS4.js} +1 -0
  43. package/dist/{chunk-OX35BSPV.js → chunk-4LOPSGLP.js} +70 -11
  44. package/dist/{chunk-JTBDBKHU.js → chunk-54ELC7D7.js} +1 -1
  45. package/dist/{chunk-C56VHSXU.js → chunk-5NAZ7SFS.js} +1 -1
  46. package/dist/{chunk-4IPSMEGT.js → chunk-7FE2KABY.js} +12 -2
  47. package/dist/{chunk-RAEPAUNJ.js → chunk-7TPQEWUZ.js} +1 -1
  48. package/dist/{chunk-ZO43JTT3.js → chunk-AJYV3VGU.js} +1 -1
  49. package/dist/{chunk-QFJZHVVL.js → chunk-AZPIQG4G.js} +35 -1
  50. package/dist/{chunk-5MNTWAAJ.js → chunk-B6H2KAQC.js} +29 -22
  51. package/dist/{chunk-MNTZKFZI.js → chunk-BQBEH6TV.js} +5 -5
  52. package/dist/{chunk-WHDSJ6PD.js → chunk-BVBEURWJ.js} +1 -1
  53. package/dist/{chunk-ZWEKONU6.js → chunk-CELX75MW.js} +1 -1
  54. package/dist/{chunk-ZP3SNUP7.js → chunk-CNPAT3HL.js} +3 -2
  55. package/dist/{chunk-YXT55PYF.js → chunk-DYP6SMOR.js} +1 -1
  56. package/dist/chunk-DZDI62LY.js +145 -0
  57. package/dist/{chunk-VF3RTVWY.js → chunk-EZIEXHYM.js} +15 -7
  58. package/dist/{chunk-7JZCADBR.js → chunk-F2ICEWZL.js} +101 -19
  59. package/dist/{chunk-JHJHCMAF.js → chunk-F7OURW3C.js} +24 -6
  60. package/dist/{chunk-VASZ6TWW.js → chunk-FQL5E6NG.js} +2 -2
  61. package/dist/{chunk-JVLB5CAJ.js → chunk-GL3FFM7A.js} +7 -4
  62. package/dist/{chunk-5YEF55AX.js → chunk-H2QZRQR2.js} +1 -1
  63. package/dist/{chunk-S4BLNILH.js → chunk-I463AEG3.js} +1 -1
  64. package/dist/{chunk-ANMHIZZY.js → chunk-JW4KO5AF.js} +1 -1
  65. package/dist/{chunk-3YGGEDJK.js → chunk-KUZWXPUS.js} +3 -2
  66. package/dist/{chunk-N4QJ3CLX.js → chunk-L4E2BIJ2.js} +80 -7
  67. package/dist/{chunk-NBDU3R3G.js → chunk-OSALSIUF.js} +1 -1
  68. package/dist/{chunk-KNLKHJZR.js → chunk-PYA4FLKI.js} +32 -21
  69. package/dist/chunk-QCGNGEGE.js +15 -0
  70. package/dist/chunk-S6LYP7QA.js +127 -0
  71. package/dist/{chunk-M3UABYRT.js → chunk-UZNKVRLE.js} +1 -1
  72. package/dist/{chunk-FOGW6O2Y.js → chunk-VHWCVD42.js} +1 -1
  73. package/dist/{chunk-QINYXLA5.js → chunk-VNMKIJZB.js} +15 -2
  74. package/dist/{chunk-CBGGUEKE.js → chunk-Y6BWPERV.js} +90 -7
  75. package/dist/src/index.d.ts +3 -0
  76. package/dist/src/index.js +11 -11
  77. package/package.json +1 -1
  78. package/dist/chunk-MSTHT2M7.js +0 -72
@@ -39,6 +39,7 @@ interface AgentEvent {
39
39
  machineId?: string;
40
40
  repoKey?: string;
41
41
  sessionId?: string;
42
+ parentSessionId?: string;
42
43
  error?: string;
43
44
  taskTitle?: string;
44
45
  decisionSource?: DecisionSource;
@@ -80,6 +81,7 @@ declare const handlePostToolUse: (input: {
80
81
  cwd?: string;
81
82
  session_id?: string;
82
83
  transcript_path?: string;
84
+ tool_use_id?: string;
83
85
  }, agent?: AgentIdentity) => Promise<string | undefined>;
84
86
  interface StopHookOutput {
85
87
  readonly decision: 'block';
@@ -88,6 +90,7 @@ interface StopHookOutput {
88
90
  declare const handleStop: (input: {
89
91
  cwd?: string;
90
92
  session_id?: string;
93
+ agent_id?: string;
91
94
  stop_hook_active?: boolean;
92
95
  transcript_path?: string;
93
96
  last_assistant_message?: string;
package/dist/src/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  handlePreToolUse
3
- } from "../chunk-5MNTWAAJ.js";
4
- import "../chunk-B2HND22S.js";
3
+ } from "../chunk-B6H2KAQC.js";
4
+ import "../chunk-2LAHXHBR.js";
5
5
  import {
6
6
  fetchAccountPublicKey
7
7
  } from "../chunk-QZCFVWA7.js";
8
- import "../chunk-S4BLNILH.js";
9
- import "../chunk-FOGW6O2Y.js";
8
+ import "../chunk-I463AEG3.js";
9
+ import "../chunk-VHWCVD42.js";
10
10
  import "../chunk-YHG74UFF.js";
11
11
  import {
12
12
  fetchModeOverride,
@@ -16,20 +16,20 @@ import {
16
16
  handlePostToolUse,
17
17
  handleStop,
18
18
  reportEvent
19
- } from "../chunk-OX35BSPV.js";
19
+ } from "../chunk-4LOPSGLP.js";
20
20
  import {
21
21
  askUser,
22
22
  cancelQuestion,
23
23
  waitForAnswer
24
- } from "../chunk-JHJHCMAF.js";
25
- import "../chunk-N4QJ3CLX.js";
26
- import "../chunk-JTBDBKHU.js";
27
- import "../chunk-3YGGEDJK.js";
24
+ } from "../chunk-F7OURW3C.js";
25
+ import "../chunk-L4E2BIJ2.js";
26
+ import "../chunk-54ELC7D7.js";
27
+ import "../chunk-KUZWXPUS.js";
28
28
  import "../chunk-BSZYIAZL.js";
29
29
  import "../chunk-SAF6HGAA.js";
30
30
  import "../chunk-7QLSKOSU.js";
31
31
  import "../chunk-KZERVKTD.js";
32
- import "../chunk-ANMHIZZY.js";
32
+ import "../chunk-JW4KO5AF.js";
33
33
  import "../chunk-4LL6LG5X.js";
34
34
  import {
35
35
  getApiKey,
@@ -37,7 +37,7 @@ import {
37
37
  } from "../chunk-2UMNXADU.js";
38
38
  import {
39
39
  resolvePolicy
40
- } from "../chunk-QINYXLA5.js";
40
+ } from "../chunk-VNMKIJZB.js";
41
41
  export {
42
42
  askUser,
43
43
  cancelQuestion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "0.89.13",
3
+ "version": "0.90.1",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",
@@ -1,72 +0,0 @@
1
- import {
2
- hasGeminiHooks
3
- } from "./chunk-JVLB5CAJ.js";
4
- import {
5
- hasCodexHooks
6
- } from "./chunk-3YGGEDJK.js";
7
- import {
8
- HOOK_LOCATOR_BINARY
9
- } from "./chunk-QINYXLA5.js";
10
-
11
- // src/diagnostics/wiring.ts
12
- var record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : null;
13
- var CLAUDE_HOOK_BINARY = /pushary-[a-z-]*hook/;
14
- var EXACT_HOOK_BINARY = /^pushary-[a-z-]*(hook|gate)$/;
15
- var pusharyHookExecutable = (command) => {
16
- const tokens = command.match(/"[^"]*"|'[^']*'|\S+/g) ?? [];
17
- for (const raw of tokens.reverse()) {
18
- const token = raw[0] === '"' && raw.at(-1) === '"' || raw[0] === "'" && raw.at(-1) === "'" ? raw.slice(1, -1) : raw;
19
- const name = token.split(/[/\\]/).pop()?.replace(/\.(cmd|exe|mjs)$/i, "") ?? "";
20
- if (name === HOOK_LOCATOR_BINARY || EXACT_HOOK_BINARY.test(name)) return token;
21
- }
22
- return null;
23
- };
24
- var claudeWired = ({ claudeJson, settings, skillExists }) => {
25
- if (record(record(claudeJson)?.mcpServers)?.pushary) return true;
26
- const s = record(settings);
27
- if (s) {
28
- const hooks = JSON.stringify(s.hooks ?? {});
29
- if (CLAUDE_HOOK_BINARY.test(hooks) || hooks.includes(HOOK_LOCATOR_BINARY)) return true;
30
- const allow = record(s.permissions)?.allow;
31
- if (Array.isArray(allow) && allow.some((rule) => String(rule).includes("mcp__pushary__"))) return true;
32
- }
33
- return skillExists;
34
- };
35
- var codexWired = ({ config, hooks, skillExists }) => {
36
- if (record(record(config)?.mcp_servers)?.pushary) return true;
37
- const h = record(hooks);
38
- if (h && hasCodexHooks(h)) return true;
39
- return skillExists;
40
- };
41
- var geminiWired = ({ settings }) => {
42
- const s = record(settings);
43
- if (!s) return false;
44
- if (record(s.mcpServers)?.pushary) return true;
45
- return hasGeminiHooks(s);
46
- };
47
- var cursorWired = ({ userHooks, mcp, pluginDirExists }) => {
48
- if (pluginDirExists) return true;
49
- if (record(record(mcp)?.mcpServers)?.pushary) return true;
50
- const hooks = record(record(userHooks)?.hooks);
51
- if (!hooks) return false;
52
- return Object.values(hooks).some((entries) => Array.isArray(entries) && entries.some((entry) => pusharyHookExecutable(String(record(entry)?.command ?? "")) !== null));
53
- };
54
- var cursorMcpAuthorization = (pluginMcp, userMcp) => {
55
- const pluginServers = record(record(pluginMcp)?.mcpServers);
56
- const usePlugin = pluginServers !== null && Object.hasOwn(pluginServers, "pushary");
57
- const servers = usePlugin ? pluginServers : record(record(userMcp)?.mcpServers);
58
- const headers = record(record(servers?.pushary)?.headers);
59
- return {
60
- authorization: typeof headers?.Authorization === "string" ? headers.Authorization : null,
61
- source: usePlugin ? "plugin mcp.json" : "~/.cursor/mcp.json"
62
- };
63
- };
64
-
65
- export {
66
- pusharyHookExecutable,
67
- claudeWired,
68
- codexWired,
69
- geminiWired,
70
- cursorWired,
71
- cursorMcpAuthorization
72
- };