@pushary/agent-hooks 0.65.0 → 0.67.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 CHANGED
@@ -1,5 +1,61 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.67.0
4
+
5
+ ### The VS Code agent can now ask for approval on your phone
6
+
7
+ Setup has a VS Code option. It installs a Pushary agent plugin, connects the MCP
8
+ tools so the agent can notify you and ask you questions, and registers a
9
+ permission gate so a risky terminal command reaches your phone before it runs.
10
+ The policy behind it is the one your other agents already use, so a rule you
11
+ wrote for Claude Code applies here too.
12
+
13
+ Two things about VS Code shaped how this works.
14
+
15
+ VS Code reads a hook's matcher but does not act on it, so the gate is called for
16
+ every tool the agent uses, including reading a file. It therefore decides for
17
+ itself, and for anything that is not a risky shell command it returns straight
18
+ away without touching the disk or the network.
19
+
20
+ And a plugin folder does nothing until VS Code is told where it is. Setup adds
21
+ that entry to your settings.json. That file usually has comments in it, and
22
+ rewriting it as plain JSON would delete every one of them, so an existing file
23
+ is edited one line at a time and left otherwise byte for byte identical. If your
24
+ settings already have a plugin list with comments around it, setup does not
25
+ guess: it prints the single line to paste and names the file.
26
+
27
+ Unlike Cursor, VS Code hooks cannot ask the editor to block a command on the
28
+ plugin's behalf. So when Pushary cannot reach you, or cannot reach its own
29
+ server, the gate hands the decision to VS Code's own approval prompt rather than
30
+ letting the command through.
31
+
32
+ `pushary clean` removes all of it again, the settings.json entry included, and
33
+ `pushary doctor` checks the three things that can be silently wrong: whether the
34
+ plugin is registered at all, whether the gate script resolves, and whether your
35
+ key is linked.
36
+
37
+ ## 0.66.0
38
+
39
+ ### Setup waited three minutes for a step that takes longer than three minutes
40
+
41
+ If you already had the app installed and signed in, pairing resolved in seconds
42
+ and this never came up. If you did not, it could not work at all.
43
+
44
+ Scanning the QR without the app opens a page that sends you to the store. Install
45
+ it, sign in, subscribe, come back, scan: that is never three minutes. The CLI had
46
+ given up and cancelled the pairing long before, so a first-time user's first scan
47
+ was guaranteed to fail, and the only route through was to notice the terminal had
48
+ stopped waiting and run setup again.
49
+
50
+ Setup now waits as long as the code is actually valid, and after the first
51
+ 45 seconds the spinner says what to do if the app is not installed yet. Ctrl-C
52
+ still exits cleanly and cancels the pairing, so nothing holds you there.
53
+
54
+ The window itself is unchanged in what protects it: a pairing id is 128 bits,
55
+ single use, deleted the moment it is claimed, and authorising one requires a
56
+ signed-in session for the owning account and the public key you physically
57
+ scanned.
58
+
3
59
  ## 0.65.0
4
60
 
5
61
  ### The pairing QR now works when you scan it with your phone camera
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "pushary",
3
+ "description": "Push notifications, human-in-the-loop questions, and permission gating for your AI agent. Get a push when a task finishes, answer the agent from your phone, and approve risky commands before they run.",
4
+ "version": "0.1.0",
5
+ "author": {
6
+ "name": "Pushary",
7
+ "email": "business@pushary.com",
8
+ "url": "https://pushary.com"
9
+ },
10
+ "homepage": "https://pushary.com",
11
+ "repository": "https://github.com/Pushary/vscode-plugin",
12
+ "license": "MIT",
13
+ "keywords": [
14
+ "notifications",
15
+ "push",
16
+ "human-in-the-loop",
17
+ "permissions",
18
+ "approvals",
19
+ "mcp",
20
+ "agent",
21
+ "control-panel",
22
+ "ask",
23
+ "alerts"
24
+ ],
25
+ "skills": "skills/",
26
+ "hooks": "hooks/hooks.json",
27
+ "mcpServers": ".mcp.json"
28
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "mcpServers": {
3
+ "pushary": {
4
+ "type": "http",
5
+ "url": "https://pushary.com/api/mcp/mcp",
6
+ "headers": {
7
+ "Authorization": "Bearer ${env:PUSHARY_API_KEY}"
8
+ }
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ First release.
6
+
7
+ - `PreToolUse` permission gate for the VS Code agent, routing risky terminal commands to phone approval through your Pushary policy.
8
+ - Self-filtering gate script, because VS Code parses but does not enforce a hook `matcher`. Non-matching tool calls return without touching disk or network.
9
+ - MCP server wiring for `send_notification`, `ask_user`, `wait_for_answer`, and `cancel_question`.
10
+ - Pushary skill and the `/pushary-test` and `/notify-when-done` commands.
11
+ - API key resolution from `PUSHARY_API_KEY`, the plugin `.mcp.json`, or `~/.pushary/config.json`, so the plugin works when VS Code is launched from the Dock without a shell profile.
@@ -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.
@@ -0,0 +1,136 @@
1
+ <p align="center">
2
+ <img src="assets/logo.png" alt="Pushary" width="72" height="72" />
3
+ </p>
4
+
5
+ <h1 align="center">Pushary for VS Code</h1>
6
+
7
+ <p align="center">A control panel for your AI agent. Get a push when work finishes, answer the agent from your phone, and approve risky commands before they run.</p>
8
+
9
+ ---
10
+
11
+ ## What it is
12
+
13
+ Pushary connects the VS Code agent to your phone. When the agent finishes a task, needs a decision, or is about to run something risky, it reaches you with a push notification. You answer from the lock screen and the agent keeps going. It works even when you have stepped away from your computer.
14
+
15
+ ## What it does
16
+
17
+ There are three things.
18
+
19
+ 1. Notify. The agent sends a push when a long task finishes, or when a build, test, or deploy fails. The push can include what changed, the error, and suggested next steps.
20
+
21
+ 2. Ask. The agent asks you questions through push: yes or 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 waiting in the chat panel.
22
+
23
+ 3. Gate. Risky terminal commands (like rm, force push, history rewrites, database drops, deploys, and systemctl) are checked before they run. What happens is set by your Pushary dashboard policy: auto approve trusted commands, push to your phone for approval, or just notify. If you do not answer in time, it falls back to VS Code's own approval prompt, so nothing dangerous runs silently.
24
+
25
+ ## Requirements
26
+
27
+ - VS Code with agent plugins enabled (`chat.plugins.enabled`). This setting can be managed by your organization.
28
+ - Node.js 20 or newer on your PATH. The gate runs as a `node` subprocess.
29
+ - A Pushary API key from https://pushary.com.
30
+
31
+ ## Install
32
+
33
+ ### Option 1: CLI (recommended)
34
+
35
+ This installs the plugin, registers it with VS Code, and links your API key. It also sets up Claude Code, Codex, Cursor, and Hermes if you use them.
36
+
37
+ ```bash
38
+ npx @pushary/agent-hooks@latest setup
39
+ ```
40
+
41
+ To configure only VS Code:
42
+
43
+ ```bash
44
+ npx @pushary/agent-hooks@latest setup --agents vscode
45
+ ```
46
+
47
+ ### Option 2: Install from source
48
+
49
+ Run **Chat: Install Plugin From Source** from the Command Palette and enter:
50
+
51
+ ```
52
+ https://github.com/Pushary/vscode-plugin
53
+ ```
54
+
55
+ Then set your API key (see below).
56
+
57
+ ### Option 3: Point VS Code at a local folder
58
+
59
+ Clone this repository, then add the absolute path to your VS Code `settings.json`:
60
+
61
+ ```json
62
+ {
63
+ "chat.pluginLocations": {
64
+ "/absolute/path/to/vscode-plugin": true
65
+ }
66
+ }
67
+ ```
68
+
69
+ However you install it, Pushary talks to the same server, so the plugin and the CLI give you the same setup.
70
+
71
+ ## Set your API key
72
+
73
+ The plugin reads your key from the `PUSHARY_API_KEY` environment variable, falling back to the key `pushary setup` writes to `~/.pushary/config.json`.
74
+
75
+ ```bash
76
+ echo 'export PUSHARY_API_KEY="pk_xxx.sk_xxx"' >> ~/.zshrc
77
+ source ~/.zshrc
78
+ ```
79
+
80
+ macOS and Windows do not pass your shell profile to apps launched from the Dock, Finder, or the Start menu, so an `export` in `.zshrc` is often invisible to VS Code. The `~/.pushary/config.json` fallback exists for exactly this case, which is why the CLI install is the recommended path.
81
+
82
+ Install the Pushary app on your phone (or turn on web push) so the agent can reach you.
83
+
84
+ ## What is in the plugin
85
+
86
+ | Part | File | What it does |
87
+ |------|------|--------------|
88
+ | MCP server | `.mcp.json` | Connects VS Code to the Pushary tools: `send_notification`, `ask_user`, `wait_for_answer`, `cancel_question` |
89
+ | Skill | `skills/pushary/SKILL.md` | Full tool reference: parameters, examples, return values, and the proactive-use guidance |
90
+ | Hook | `hooks/hooks.json` and `scripts/pushary-gate.mjs` | Sends risky commands to your phone for approval |
91
+ | Commands | `commands/` | `/pushary-test` and `/notify-when-done` |
92
+
93
+ ## How the gate decides
94
+
95
+ There are two layers.
96
+
97
+ 1. `RISKY_COMMAND` in `scripts/pushary-gate.mjs` decides which commands get checked at all. Everything else passes straight through with no disk or network access.
98
+
99
+ 2. Your Pushary dashboard policy decides what happens to a checked command, per tool: auto approve, the approval mode (push and wait, push then prompt, notify only, or prompt only), the timeout action, a live mode override, and the kill switch. This is the same policy your other Pushary agents use, so behavior stays the same across agents.
100
+
101
+ ### Why the filtering lives in the script
102
+
103
+ VS Code parses a hook's `matcher` but does not enforce it, so `PreToolUse` fires on every tool call the agent makes, including reads and searches. `hooks/hooks.json` therefore declares no matcher: one there would do nothing, and would only read as a promise the file cannot keep.
104
+
105
+ The one and only gate is `RISKY_COMMAND` in `scripts/pushary-gate.mjs`. To change which commands need approval, edit that regex. Everything else returns immediately without touching the disk or the network.
106
+
107
+ ## Failure behavior
108
+
109
+ Every path returns a decision. Network errors, a missing API key, and unparseable input all fall back to `ask`, which hands the decision to VS Code's own approval prompt rather than allowing the command unapproved. A 55 second guard guarantees output before the hook's 60 second timeout.
110
+
111
+ ## Cross-tool compatibility
112
+
113
+ This repository uses the `.claude-plugin/plugin.json` layout, which VS Code, GitHub Copilot CLI, and Claude Code all detect. That is also what makes `${CLAUDE_PLUGIN_ROOT}` available in `hooks/hooks.json`, which the Copilot-format layout does not define.
114
+
115
+ The layout is portable; this plugin is not meant to be. `hooks/hooks.json` uses VS Code's flat hook form, and the gate speaks VS Code's tool names, so treat this as a VS Code plugin that happens to sit in a portable folder shape.
116
+
117
+ Claude Code users are served by `npx @pushary/agent-hooks setup --agents claude_code`, which installs a hook built for Claude Code's own tool names and matcher format. Do not install this directory as a Claude Code plugin as well: at best it duplicates the MCP server, and the two installs would fight over the same approvals.
118
+
119
+ ## Development
120
+
121
+ `skills/pushary/SKILL.md` mirrors the Pushary skill that ships with `@pushary/agent-hooks`. Keep the two the same.
122
+
123
+ Test the gate without VS Code:
124
+
125
+ ```bash
126
+ echo '{"hook_event_name":"PreToolUse","tool_name":"runTerminalCommand","tool_input":{"command":"rm -rf build"},"cwd":"/tmp"}' \
127
+ | node scripts/pushary-gate.mjs
128
+ ```
129
+
130
+ ## Security
131
+
132
+ This repository has no secrets. Your key is read at runtime from `PUSHARY_API_KEY`, the plugin `.mcp.json`, or `~/.pushary/config.json`. The gate script has no dependencies and only talks to pushary.com. Command text is redacted for common secret shapes before it is sent. Read `scripts/pushary-gate.mjs` to see exactly what it sends. See `SECURITY.md` for details.
133
+
134
+ ## License
135
+
136
+ MIT. See `LICENSE`.
@@ -0,0 +1,56 @@
1
+ # Security
2
+
3
+ ## Reporting a vulnerability
4
+
5
+ Email **security@pushary.com** with details and reproduction steps. Please do not open a public
6
+ issue for security reports. We aim to acknowledge within 72 hours.
7
+
8
+ ## What this plugin sends
9
+
10
+ The plugin connects VS Code to the Pushary MCP server at `https://pushary.com/api/mcp/mcp` using
11
+ your API key. The key is read at runtime from the `PUSHARY_API_KEY` environment variable, the
12
+ plugin's `.mcp.json` (written by the CLI installer), or `~/.pushary/config.json`. No key is
13
+ committed to this repository.
14
+
15
+ The permission gate (`scripts/pushary-gate.mjs`) sends nothing for the overwhelming majority of
16
+ tool calls. It only contacts Pushary when the tool is a terminal tool **and** the command matches
17
+ `RISKY_COMMAND` in the script. For such a command it sends, over HTTPS to Pushary:
18
+
19
+ - the command text, with common secret shapes (API keys, bearer tokens, `password=`, long base64
20
+ runs) redacted first,
21
+ - the basename of the working directory (for example `my-repo`, not the full path),
22
+ - an agent label (`VS Code - <project>`),
23
+ - the VS Code chat session id, so the dashboard kill switch and per-session mode can target this
24
+ session,
25
+ - a machine id, which is the first 8 hex characters of a SHA-256 of your hostname and never the
26
+ hostname itself.
27
+
28
+ It also fetches your permission policy and mode from `pushary.com`. The policy is cached in the
29
+ system temp directory for 5 minutes. The gate contacts no host other than `pushary.com`, has no
30
+ third-party dependencies, and writes only that policy cache to disk. The full source is in this
31
+ repository, so read it before installing.
32
+
33
+ ## Failure behavior
34
+
35
+ Unlike the Cursor plugin, VS Code hooks have no `failClosed` option, so the gate cannot ask VS
36
+ Code to block a command on its behalf. It is built so that every handled failure degrades to
37
+ `permissionDecision: "ask"`, which forces VS Code's own approval prompt instead of allowing the
38
+ command:
39
+
40
+ - no API key, unreachable network, invalid policy, or an unparseable response: `ask`
41
+ - no answer from your phone within the window: `ask`, unless your policy's timeout action is
42
+ explicitly `deny`
43
+ - kill switch active in your dashboard: `deny`
44
+ - anything that hangs: a 55 second guard emits `ask` before the 60 second hook timeout
45
+
46
+ The one case the gate cannot cover is a catastrophic crash before it produces any output, for
47
+ example Node.js missing from PATH. VS Code treats a non-zero exit with no decision as a
48
+ non-blocking warning and continues, at which point your normal VS Code terminal approval settings
49
+ apply. If you have auto-approve enabled for terminal commands in VS Code, that command would run
50
+ without a Pushary approval. Keep VS Code's own terminal approval on if that matters to you.
51
+
52
+ ## Hook execution model
53
+
54
+ Hooks execute shell commands with the same permissions as VS Code. This one runs
55
+ `node scripts/pushary-gate.mjs` on every agent tool call. Review the script before installing, and
56
+ treat any plugin that registers hooks the same way.
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: notify-when-done
3
+ description: Send a Pushary push summarizing what changed when the current task finishes.
4
+ ---
5
+
6
+ When you finish the current task, send a Pushary push notification so the user knows it's done, even if they have stepped away from the editor.
7
+
8
+ Call `send_notification` with:
9
+ - `title`: a short summary (under 60 chars) of what was completed
10
+ - `body`: one line on the outcome (under 200 chars)
11
+ - `agentName`: `"VS Code - {project}"`
12
+ - `context`: `{ type: "task_complete", summary, filesChanged, nextSteps }`
13
+
14
+ Send a single notification for the task. If the task fails instead, send `context.type: "error"` with `errorMessage` and the file where it failed.
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: pushary-test
3
+ description: Send a test Pushary push notification to confirm notifications are working.
4
+ ---
5
+
6
+ Send a test push notification with the Pushary `send_notification` tool so the user can confirm delivery on their phone.
7
+
8
+ Call `send_notification` with:
9
+ - `title`: "Pushary test"
10
+ - `body`: "If you can read this on your phone, Pushary is working."
11
+ - `agentName`: `"VS Code - {project}"` (use the current project folder name)
12
+
13
+ Then tell the user it was sent and to check their device. If the call fails, report the error and remind them to set the `PUSHARY_API_KEY` environment variable and sign in at https://pushary.com.
@@ -0,0 +1,11 @@
1
+ {
2
+ "hooks": {
3
+ "PreToolUse": [
4
+ {
5
+ "type": "command",
6
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/pushary-gate.mjs\"",
7
+ "timeout": 60
8
+ }
9
+ ]
10
+ }
11
+ }