@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 +21 -0
- package/README.md +111 -0
- package/dist/bin/pushary-clean.js +3 -3
- package/dist/bin/pushary-codex-hook.js +2 -2
- package/dist/bin/pushary-codex.js +2 -2
- package/dist/bin/pushary-doctor.js +2 -2
- package/dist/bin/pushary-gemini-hook.js +2 -2
- package/dist/bin/pushary-hook.js +3 -3
- package/dist/bin/pushary-post-hook.js +2 -2
- package/dist/bin/pushary-prompt-hook.js +2 -2
- package/dist/bin/pushary-setup.js +4 -4
- package/dist/bin/pushary-stop-hook.js +2 -2
- package/dist/{chunk-NFKYZY74.js → chunk-IAOXM7X5.js} +1 -1
- package/dist/{chunk-2BHYQCF7.js → chunk-P6QBZS27.js} +2 -2
- package/dist/{chunk-76F75WQQ.js → chunk-QNEYHDKR.js} +1 -1
- package/dist/{chunk-QDPUTE2V.js → chunk-X3YCHQQK.js} +1 -1
- package/dist/{chunk-YRL4ZB4R.js → chunk-Z5PL3K7C.js} +1 -1
- package/dist/src/index.js +3 -3
- package/package.json +25 -1
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
|
+
[](https://www.npmjs.com/package/@pushary/agent-hooks)
|
|
4
|
+
[](https://www.npmjs.com/package/@pushary/agent-hooks)
|
|
5
|
+
[](./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-
|
|
5
|
+
} from "../chunk-QNEYHDKR.js";
|
|
6
6
|
import {
|
|
7
7
|
execNpm,
|
|
8
8
|
removeCodexHooks,
|
|
9
9
|
removeGeminiSettings,
|
|
10
10
|
removeInstructionBlock
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
7
|
+
} from "../chunk-IAOXM7X5.js";
|
|
8
8
|
import "../chunk-DWED7BS3.js";
|
|
9
|
-
import "../chunk-
|
|
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-
|
|
15
|
+
} from "../chunk-X3YCHQQK.js";
|
|
16
16
|
import {
|
|
17
17
|
callMcpTool,
|
|
18
18
|
sendMcpRequest
|
|
19
19
|
} from "../chunk-DWED7BS3.js";
|
|
20
|
-
import "../chunk-
|
|
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-
|
|
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-
|
|
34
|
+
} from "../chunk-Z5PL3K7C.js";
|
|
35
35
|
import {
|
|
36
36
|
getApiKey
|
|
37
37
|
} from "../chunk-NKXSILEW.js";
|
package/dist/bin/pushary-hook.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePreToolUse
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-P6QBZS27.js";
|
|
5
5
|
import "../chunk-KQYIHZ5E.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-IAOXM7X5.js";
|
|
7
7
|
import "../chunk-DWED7BS3.js";
|
|
8
|
-
import "../chunk-
|
|
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-
|
|
4
|
+
} from "../chunk-IAOXM7X5.js";
|
|
5
5
|
import "../chunk-DWED7BS3.js";
|
|
6
|
-
import "../chunk-
|
|
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-
|
|
4
|
+
} from "../chunk-IAOXM7X5.js";
|
|
5
5
|
import "../chunk-DWED7BS3.js";
|
|
6
|
-
import "../chunk-
|
|
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-
|
|
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-
|
|
19
|
+
} from "../chunk-X3YCHQQK.js";
|
|
20
20
|
import {
|
|
21
21
|
reportEvent
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-IAOXM7X5.js";
|
|
23
23
|
import "../chunk-DWED7BS3.js";
|
|
24
24
|
import {
|
|
25
25
|
isValidApiKey
|
|
26
|
-
} from "../chunk-
|
|
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-
|
|
4
|
+
} from "../chunk-IAOXM7X5.js";
|
|
5
5
|
import "../chunk-DWED7BS3.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-Z5PL3K7C.js";
|
|
7
7
|
import "../chunk-NKXSILEW.js";
|
|
8
8
|
|
|
9
9
|
// bin/pushary-stop-hook.ts
|
|
@@ -20,12 +20,12 @@ import {
|
|
|
20
20
|
savePendingQuestion,
|
|
21
21
|
sendNotification,
|
|
22
22
|
waitForAnswer
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-IAOXM7X5.js";
|
|
24
24
|
import {
|
|
25
25
|
effectiveWaitSeconds,
|
|
26
26
|
hookWaitClamped,
|
|
27
27
|
hookWaitDeadline
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-Z5PL3K7C.js";
|
|
29
29
|
import {
|
|
30
30
|
getApiKey
|
|
31
31
|
} from "./chunk-NKXSILEW.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
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-
|
|
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-
|
|
17
|
+
} from "../chunk-IAOXM7X5.js";
|
|
18
18
|
import "../chunk-DWED7BS3.js";
|
|
19
|
-
import "../chunk-
|
|
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.
|
|
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": {
|