@pushary/agent-hooks 0.28.0 → 0.28.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pushary
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,111 @@
1
+ # @pushary/agent-hooks
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@pushary/agent-hooks.svg)](https://www.npmjs.com/package/@pushary/agent-hooks)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@pushary/agent-hooks.svg)](https://www.npmjs.com/package/@pushary/agent-hooks)
5
+ [![license](https://img.shields.io/npm/l/@pushary/agent-hooks.svg)](./LICENSE)
6
+
7
+ Push notifications, questions, and permission approvals for AI coding agents. Get a push when your agent finishes work, answer its questions from your phone, and approve risky commands before they run. Works with Claude Code, Codex, Cursor, Gemini CLI, and Hermes.
8
+
9
+ Your agent froze waiting for a yes. This is how it reaches you.
10
+
11
+ ```bash
12
+ npx @pushary/agent-hooks@latest setup
13
+ ```
14
+
15
+ One command wires up the MCP server, the permission hooks, and the agent instruction files. Then you close your laptop and the agent still reaches you.
16
+
17
+ ## What it does
18
+
19
+ There are three things.
20
+
21
+ **Notify.** The agent sends a push when a long task finishes or when a build, test, or deploy fails. The notification can carry what changed, the error, and suggested next steps.
22
+
23
+ **Ask.** The agent asks you questions through push: yes/no, multiple choice, or free text. It waits for your answer. When Pushary is connected, the agent sends its questions to your phone instead of stalling in the terminal.
24
+
25
+ **Gate.** Risky shell commands (`rm -rf`, force pushes, history rewrites, database drops, deploys) are checked before they run. What happens is set by your dashboard policy: auto approve trusted read-only commands, push to your phone for approval, or hold for the phone and never auto-deny. If the check cannot run, the command is blocked instead of allowed. It fails closed.
26
+
27
+ ## Setup
28
+
29
+ You need an API key. Sign up at [pushary.com](https://pushary.com/sign-up?from=npm), then run:
30
+
31
+ ```bash
32
+ npx @pushary/agent-hooks@latest setup
33
+ ```
34
+
35
+ The wizard detects which agents you have installed and configures each one. To skip the prompts:
36
+
37
+ ```bash
38
+ npx @pushary/agent-hooks@latest setup --key pk_xxx.sk_xxx --skip-phone
39
+ ```
40
+
41
+ Verify it worked:
42
+
43
+ ```bash
44
+ npx @pushary/agent-hooks@latest doctor
45
+ ```
46
+
47
+ ## Supported agents
48
+
49
+ | Agent | Notify | Ask | Gate |
50
+ |-------|:------:|:---:|:----:|
51
+ | Claude Code | yes | yes | yes |
52
+ | Codex | yes | yes | yes |
53
+ | Cursor | yes | yes | yes |
54
+ | Gemini CLI | yes | yes | yes |
55
+ | Hermes | yes | yes | yes |
56
+
57
+ Any other MCP client can use notify and ask by pointing at the Pushary MCP endpoint directly.
58
+
59
+ ## Commands
60
+
61
+ ```
62
+ setup Configure Claude Code, Codex, Gemini CLI, Hermes, or Cursor with Pushary
63
+ doctor Verify your Pushary installation is working
64
+ clean Remove all Pushary configuration
65
+ mode Switch approval mode (push_only, push_first, terminal_only)
66
+ wait Show or set the "wait for your phone" ladder (pushary wait 45)
67
+ hook Run as a PreToolUse hook (reads stdin, writes stdout)
68
+ ```
69
+
70
+ Examples:
71
+
72
+ ```bash
73
+ npx @pushary/agent-hooks@latest mode push_only --for 30m
74
+ npx @pushary/agent-hooks@latest wait 45
75
+ npx @pushary/agent-hooks@latest clean
76
+ ```
77
+
78
+ ## Manual MCP setup
79
+
80
+ If you only want notifications and questions (no permission gating), add Pushary to your MCP config directly:
81
+
82
+ ```json
83
+ {
84
+ "mcpServers": {
85
+ "pushary": {
86
+ "type": "http",
87
+ "url": "https://pushary.com/api/mcp/mcp",
88
+ "headers": {
89
+ "Authorization": "Bearer YOUR_API_KEY"
90
+ }
91
+ }
92
+ }
93
+ }
94
+ ```
95
+
96
+ The MCP server exposes `send_notification`, `ask_user`, `wait_for_answer`, and `cancel_question`. Full tool reference is in the [docs](https://pushary.com/docs?from=npm).
97
+
98
+ ## Security
99
+
100
+ The permission gate fails closed. If a policy cannot be fetched or a hook errors, the command is blocked, not allowed. Secrets in command arguments and environment are redacted before anything is sent to a phone or stored. Read-only commands can be allowlisted so trusted work never interrupts you, while writes and destructive commands still route through approval.
101
+
102
+ ## Links
103
+
104
+ - Website: [pushary.com](https://pushary.com/?from=npm)
105
+ - Docs: [pushary.com/docs](https://pushary.com/docs?from=npm)
106
+ - Sign up: [pushary.com/sign-up](https://pushary.com/sign-up?from=npm)
107
+ - Issues: [github.com/pushary/pushary/issues](https://github.com/pushary/pushary/issues)
108
+
109
+ ## License
110
+
111
+ MIT
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  removeClaudeMcpServers,
4
4
  removePusharySettings
5
- } from "../chunk-76F75WQQ.js";
5
+ } from "../chunk-QNEYHDKR.js";
6
6
  import {
7
7
  execNpm,
8
8
  removeCodexHooks,
9
9
  removeGeminiSettings,
10
10
  removeInstructionBlock
11
- } from "../chunk-QDPUTE2V.js";
12
- import "../chunk-YRL4ZB4R.js";
11
+ } from "../chunk-X3YCHQQK.js";
12
+ import "../chunk-Z5PL3K7C.js";
13
13
 
14
14
  // bin/pushary-clean.ts
15
15
  import { existsSync, readFileSync, writeFileSync, rmSync } from "fs";
@@ -32,14 +32,14 @@ import {
32
32
  toCodexWire,
33
33
  toPolicyLookup,
34
34
  waitForAnswer
35
- } from "../chunk-NFKYZY74.js";
35
+ } from "../chunk-IAOXM7X5.js";
36
36
  import "../chunk-DWED7BS3.js";
37
37
  import {
38
38
  DECISION_LINE_MAX,
39
39
  effectiveWaitSeconds,
40
40
  hookWaitClamped,
41
41
  hookWaitDeadline
42
- } from "../chunk-YRL4ZB4R.js";
42
+ } from "../chunk-Z5PL3K7C.js";
43
43
  import {
44
44
  getApiKey
45
45
  } from "../chunk-NKXSILEW.js";
@@ -4,9 +4,9 @@ import {
4
4
  getMachineId,
5
5
  reportEvent,
6
6
  waitForAnswer
7
- } from "../chunk-NFKYZY74.js";
7
+ } from "../chunk-IAOXM7X5.js";
8
8
  import "../chunk-DWED7BS3.js";
9
- import "../chunk-YRL4ZB4R.js";
9
+ import "../chunk-Z5PL3K7C.js";
10
10
  import {
11
11
  getApiKey
12
12
  } from "../chunk-NKXSILEW.js";
@@ -12,12 +12,12 @@ import {
12
12
  missingGeminiHookEvents,
13
13
  readCodexMcpAuth,
14
14
  untrustedCodexHookEvents
15
- } from "../chunk-QDPUTE2V.js";
15
+ } from "../chunk-X3YCHQQK.js";
16
16
  import {
17
17
  callMcpTool,
18
18
  sendMcpRequest
19
19
  } from "../chunk-DWED7BS3.js";
20
- import "../chunk-YRL4ZB4R.js";
20
+ import "../chunk-Z5PL3K7C.js";
21
21
  import {
22
22
  getBaseUrl
23
23
  } from "../chunk-NKXSILEW.js";
@@ -24,14 +24,14 @@ import {
24
24
  savePendingQuestion,
25
25
  sendNotification,
26
26
  waitForAnswer
27
- } from "../chunk-NFKYZY74.js";
27
+ } from "../chunk-IAOXM7X5.js";
28
28
  import "../chunk-DWED7BS3.js";
29
29
  import {
30
30
  DECISION_LINE_MAX,
31
31
  effectiveWaitSeconds,
32
32
  hookWaitClamped,
33
33
  hookWaitDeadline
34
- } from "../chunk-YRL4ZB4R.js";
34
+ } from "../chunk-Z5PL3K7C.js";
35
35
  import {
36
36
  getApiKey
37
37
  } from "../chunk-NKXSILEW.js";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePreToolUse
4
- } from "../chunk-2BHYQCF7.js";
4
+ } from "../chunk-P6QBZS27.js";
5
5
  import "../chunk-KQYIHZ5E.js";
6
- import "../chunk-NFKYZY74.js";
6
+ import "../chunk-IAOXM7X5.js";
7
7
  import "../chunk-DWED7BS3.js";
8
- import "../chunk-YRL4ZB4R.js";
8
+ import "../chunk-Z5PL3K7C.js";
9
9
  import "../chunk-NKXSILEW.js";
10
10
 
11
11
  // bin/pushary-hook.ts
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePostToolUse
4
- } from "../chunk-NFKYZY74.js";
4
+ } from "../chunk-IAOXM7X5.js";
5
5
  import "../chunk-DWED7BS3.js";
6
- import "../chunk-YRL4ZB4R.js";
6
+ import "../chunk-Z5PL3K7C.js";
7
7
  import "../chunk-NKXSILEW.js";
8
8
 
9
9
  // bin/pushary-post-hook.ts
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handleUserPrompt
4
- } from "../chunk-NFKYZY74.js";
4
+ } from "../chunk-IAOXM7X5.js";
5
5
  import "../chunk-DWED7BS3.js";
6
- import "../chunk-YRL4ZB4R.js";
6
+ import "../chunk-Z5PL3K7C.js";
7
7
  import "../chunk-NKXSILEW.js";
8
8
 
9
9
  // bin/pushary-prompt-hook.ts
@@ -3,7 +3,7 @@ import {
3
3
  addClaudeMcpServer,
4
4
  addPusharyHooks,
5
5
  addPusharyToolPermissions
6
- } from "../chunk-76F75WQQ.js";
6
+ } from "../chunk-QNEYHDKR.js";
7
7
  import {
8
8
  GEMINI_HOOK_BINARY,
9
9
  addCodexHookTrust,
@@ -16,14 +16,14 @@ import {
16
16
  renderAgentInstructions,
17
17
  renderProjectAgentInstructions,
18
18
  writeInstructionBlock
19
- } from "../chunk-QDPUTE2V.js";
19
+ } from "../chunk-X3YCHQQK.js";
20
20
  import {
21
21
  reportEvent
22
- } from "../chunk-NFKYZY74.js";
22
+ } from "../chunk-IAOXM7X5.js";
23
23
  import "../chunk-DWED7BS3.js";
24
24
  import {
25
25
  isValidApiKey
26
- } from "../chunk-YRL4ZB4R.js";
26
+ } from "../chunk-Z5PL3K7C.js";
27
27
  import "../chunk-NKXSILEW.js";
28
28
 
29
29
  // bin/pushary-setup.ts
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handleStop
4
- } from "../chunk-NFKYZY74.js";
4
+ } from "../chunk-IAOXM7X5.js";
5
5
  import "../chunk-DWED7BS3.js";
6
- import "../chunk-YRL4ZB4R.js";
6
+ import "../chunk-Z5PL3K7C.js";
7
7
  import "../chunk-NKXSILEW.js";
8
8
 
9
9
  // bin/pushary-stop-hook.ts
@@ -12,7 +12,7 @@ import {
12
12
  matchToolPattern,
13
13
  redactSecrets,
14
14
  redactSecretsDeep
15
- } from "./chunk-YRL4ZB4R.js";
15
+ } from "./chunk-Z5PL3K7C.js";
16
16
  import {
17
17
  getApiKey,
18
18
  getBaseUrl
@@ -20,12 +20,12 @@ import {
20
20
  savePendingQuestion,
21
21
  sendNotification,
22
22
  waitForAnswer
23
- } from "./chunk-NFKYZY74.js";
23
+ } from "./chunk-IAOXM7X5.js";
24
24
  import {
25
25
  effectiveWaitSeconds,
26
26
  hookWaitClamped,
27
27
  hookWaitDeadline
28
- } from "./chunk-YRL4ZB4R.js";
28
+ } from "./chunk-Z5PL3K7C.js";
29
29
  import {
30
30
  getApiKey
31
31
  } from "./chunk-NKXSILEW.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HOOK_BUDGETS
3
- } from "./chunk-YRL4ZB4R.js";
3
+ } from "./chunk-Z5PL3K7C.js";
4
4
 
5
5
  // src/claude-config.ts
6
6
  import { join } from "path";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HOOK_BUDGETS
3
- } from "./chunk-YRL4ZB4R.js";
3
+ } from "./chunk-Z5PL3K7C.js";
4
4
 
5
5
  // src/codex-config.ts
6
6
  import { createHash } from "crypto";
@@ -1,4 +1,4 @@
1
- // ../../../../../packages/contracts/src/index.ts
1
+ // ../contracts/src/index.ts
2
2
  var APPROVAL_MODES = ["push_only", "terminal_only", "push_first", "notify_only"];
3
3
  var isApprovalMode = (value) => typeof value === "string" && APPROVAL_MODES.includes(value);
4
4
  var HOOK_BUDGETS = {
package/dist/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  handlePreToolUse
3
- } from "../chunk-2BHYQCF7.js";
3
+ } from "../chunk-P6QBZS27.js";
4
4
  import "../chunk-KQYIHZ5E.js";
5
5
  import {
6
6
  askUser,
@@ -14,9 +14,9 @@ import {
14
14
  reportEvent,
15
15
  resolvePolicy,
16
16
  waitForAnswer
17
- } from "../chunk-NFKYZY74.js";
17
+ } from "../chunk-IAOXM7X5.js";
18
18
  import "../chunk-DWED7BS3.js";
19
- import "../chunk-YRL4ZB4R.js";
19
+ import "../chunk-Z5PL3K7C.js";
20
20
  import {
21
21
  getApiKey,
22
22
  getBaseUrl
package/package.json CHANGED
@@ -1,7 +1,28 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "0.28.0",
3
+ "version": "0.28.2",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
+ "keywords": [
6
+ "pushary",
7
+ "claude-code",
8
+ "claude-code-hooks",
9
+ "codex",
10
+ "cursor",
11
+ "gemini-cli",
12
+ "hermes",
13
+ "mcp",
14
+ "mcp-server",
15
+ "ai-agent",
16
+ "ai-coding-agent",
17
+ "human-in-the-loop",
18
+ "hitl",
19
+ "push-notifications",
20
+ "notifications",
21
+ "agent-permissions",
22
+ "permission-hooks",
23
+ "tool-approvals",
24
+ "pretooluse"
25
+ ],
5
26
  "author": "Pushary <business@pushary.com>",
6
27
  "homepage": "https://pushary.com",
7
28
  "repository": {
@@ -9,6 +30,9 @@
9
30
  "url": "git+https://github.com/pushary/pushary.git",
10
31
  "directory": "packages/agent-hooks"
11
32
  },
33
+ "bugs": {
34
+ "url": "https://github.com/pushary/pushary/issues"
35
+ },
12
36
  "license": "MIT",
13
37
  "type": "module",
14
38
  "engines": {