@pushary/agent-hooks 0.73.0 → 0.75.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/data/SKILL.md +14 -6
  3. package/data/cursor-plugin/CHANGELOG.md +27 -1
  4. package/data/cursor-plugin/CONTRIBUTING.md +28 -0
  5. package/data/cursor-plugin/README.md +1 -1
  6. package/data/cursor-plugin/scripts/pushary-gate.mjs +305 -131
  7. package/data/cursor-plugin/scripts/pushary-gate.test.mjs +130 -0
  8. package/data/cursor-plugin/skills/pushary/SKILL.md +14 -6
  9. package/data/vscode-plugin/CONTRIBUTING.md +28 -0
  10. package/data/vscode-plugin/skills/pushary/SKILL.md +14 -6
  11. package/dist/bin/pushary-claude.js +3 -3
  12. package/dist/bin/pushary-clean.js +5 -5
  13. package/dist/bin/pushary-codex-hook.js +4 -4
  14. package/dist/bin/pushary-codex.js +2 -2
  15. package/dist/bin/pushary-connect.js +3 -3
  16. package/dist/bin/pushary-doctor.js +7 -7
  17. package/dist/bin/pushary-gemini-hook.js +4 -4
  18. package/dist/bin/pushary-hook.js +6 -6
  19. package/dist/bin/pushary-login.js +2 -2
  20. package/dist/bin/pushary-logout.js +2 -2
  21. package/dist/bin/pushary-mode.js +3 -3
  22. package/dist/bin/pushary-notification-hook.js +2 -2
  23. package/dist/bin/pushary-permission-denied-hook.js +6 -6
  24. package/dist/bin/pushary-permission-hook.js +6 -6
  25. package/dist/bin/pushary-post-hook.js +2 -2
  26. package/dist/bin/pushary-prompt-hook.js +2 -2
  27. package/dist/bin/pushary-session-end-hook.js +2 -2
  28. package/dist/bin/pushary-session-start-hook.js +2 -2
  29. package/dist/bin/pushary-setup.js +17 -13
  30. package/dist/bin/pushary-stats.js +2 -2
  31. package/dist/bin/pushary-status.js +2 -2
  32. package/dist/bin/pushary-stop-hook.js +2 -2
  33. package/dist/bin/pushary-stopfailure-hook.js +2 -2
  34. package/dist/bin/pushary-upgrade.js +4 -4
  35. package/dist/bin/pushary-wait.js +3 -3
  36. package/dist/{chunk-CAJZAFVS.js → chunk-3CBPY2G5.js} +1 -1
  37. package/dist/{chunk-B7R4YSAB.js → chunk-46UEJXQO.js} +2 -2
  38. package/dist/{chunk-SR52774M.js → chunk-7BBUTWBD.js} +1 -1
  39. package/dist/{chunk-FZIQSDTQ.js → chunk-7L57N7WN.js} +1 -1
  40. package/dist/{chunk-E2U35RLD.js → chunk-CC2K2SST.js} +1 -1
  41. package/dist/{chunk-HU43EZ5Q.js → chunk-DJHWBNM3.js} +30 -8
  42. package/dist/{chunk-G4TARJAY.js → chunk-DLBW37U6.js} +1 -1
  43. package/dist/{chunk-WLGEY4UX.js → chunk-IA5GBKNL.js} +1 -1
  44. package/dist/{chunk-I4BYZIX4.js → chunk-IZA7SWXX.js} +1 -1
  45. package/dist/{chunk-7HG4WUIE.js → chunk-QCYN5VXB.js} +1 -1
  46. package/dist/{chunk-GD275GEX.js → chunk-UPPHYOIZ.js} +2 -2
  47. package/dist/src/index.d.ts +1 -0
  48. package/dist/src/index.js +6 -6
  49. package/package.json +1 -1
  50. /package/dist/{chunk-DQAN3JQP.js → chunk-TJJBF73A.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,66 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.75.0
4
+
5
+ ### An agent can now run the install
6
+
7
+ Pasting "install pushary for me" into Claude Code, Codex or Cursor exited 3
8
+ before doing anything:
9
+
10
+ ! No API key, and no terminal to sign in from.
11
+
12
+ The agent runs setup with stdin and stdout piped, so `isTTY` is false, and app
13
+ pairing sat behind the same check as browser login. That check was answering the
14
+ wrong question. Pairing needs a person, not a terminal, and the agent shows its
15
+ output to one, so a QR written to stdout is read just as well as a QR drawn on a
16
+ terminal.
17
+
18
+ Setup now pairs whenever it is not running in CI. It prints the QR, the tappable
19
+ link and the fingerprint, and waits for the scan, so the whole install is one
20
+ command with nothing to paste:
21
+
22
+ npx @pushary/agent-hooks@latest setup
23
+
24
+ Browser login still requires a real terminal, because it opens a browser on the
25
+ machine and waits for a redirect. CI still declines to pair, so no build hangs
26
+ drawing a QR into a log nobody is watching.
27
+
28
+ The bundled skill told agents to do the opposite: hand the user a signup link
29
+ and wait for them to paste a key back. It now says to run setup and show the
30
+ user the QR.
31
+
32
+ The failure message above also had to change, because after this it was naming a
33
+ cause that no longer applies. Reaching that branch now means CI, `--skip-phone`,
34
+ or a connect mode other than `app`, so setup says which of those it hit instead
35
+ of blaming a missing terminal. A headless run with no flags is the one worth
36
+ calling out: it used to be told to drop into a browser login it cannot open.
37
+
38
+
39
+ ## 0.74.0
40
+
41
+ ### The terminal went quiet while your phone was deciding
42
+
43
+ A gated tool call sent the push and then blocked, writing nothing. Claude Code
44
+ showed a bare spinner. If you missed the notification there was no way to tell
45
+ that a question existed, let alone where to answer it, and the terminal prompt
46
+ only appeared once the wait expired.
47
+
48
+ The hook now says so before it blocks:
49
+
50
+ [pushary] Sent to your phone. Waiting 10s, then this terminal takes over.
51
+ Answer here instead: https://pushary.com/dashboard/agent
52
+
53
+ The wait line prints per question, because each question is its own blocking
54
+ moment with its own countdown. The URL prints once per session, because it is
55
+ the same page every time and repeating it on every gated call is noise.
56
+
57
+ That URL is the signed-in dashboard, not the `/decide` link the push carries.
58
+ The decide link is a bearer credential: anyone holding it can answer. Handing it
59
+ to the agent that is being gated would let it approve its own action, so the
60
+ hook is only ever told about the page that requires your login.
61
+
62
+ Servers that predate this send no URL, and the hook just prints the wait line.
63
+
3
64
  ## 0.73.0
4
65
 
5
66
  ### Codex could finish setup with no skill installed
package/data/SKILL.md CHANGED
@@ -60,16 +60,24 @@ If the user runs Claude Code with a Claude Max subscription, Anthropic Remote Co
60
60
 
61
61
  ## Setup
62
62
 
63
- First check for an API key. Look for `PUSHARY_API_KEY` in the environment or an Authorization header in the existing MCP config. If there is no key, the user needs an account: give them this link, then pause until they finish signup from their phone and hand you the key:
63
+ Just run it. No account, no API key, and nothing to paste first:
64
64
 
65
- https://pushary.com/sign-up?utm_source=skill&utm_medium=setup
65
+ ```bash
66
+ npx @pushary/agent-hooks@latest setup
67
+ ```
68
+
69
+ It configures MCP, hooks, permissions and the skill in one step, then prints a QR code and waits.
66
70
 
67
- Signup starts a 7-day trial and asks for a card up front. The key format is `pk_xxx.sk_xxx`.
71
+ **Show the user your output and ask them to scan that QR with their phone camera.** Scanning pairs their Pushary app, which is what hands this machine its key. A tappable link and a fingerprint print under the QR for a phone already in hand. Do not ask the user for an API key, and do not send them to a signup page first: that is the old flow and it is strictly worse.
68
72
 
69
- Once the key exists, run the CLI setup (recommended - configures MCP, hooks, permissions, and skill in one step):
73
+ Signup starts a 7-day trial and asks for a card up front, which happens in the app.
74
+
75
+ If `PUSHARY_API_KEY` is already in the environment or in an existing MCP config, setup uses it and skips pairing entirely.
76
+
77
+ No app on their phone yet? They can get it at https://pushary.com/download, or approve in a browser tab instead:
70
78
 
71
79
  ```bash
72
- npx @pushary/agent-hooks@latest setup
80
+ npx @pushary/agent-hooks@latest setup --connect browser
73
81
  ```
74
82
 
75
83
  Or add Pushary manually to your MCP configuration:
@@ -88,7 +96,7 @@ Or add Pushary manually to your MCP configuration:
88
96
  }
89
97
  ```
90
98
 
91
- Sign up at https://pushary.com/sign-up?utm_source=skill&utm_medium=setup to get your API key.
99
+ Manual configuration needs a key, so it means signing up first at https://pushary.com/sign-up?utm_source=skill&utm_medium=setup and copying the key from the dashboard. Prefer `setup` above: it needs neither.
92
100
 
93
101
  After setup, verify with:
94
102
 
@@ -1,10 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.1
4
+
5
+ Policy parity with the other agents. The gate matched rules on tool NAME alone, so
6
+ every argument rule was invisible here: a `Bash(rm:*)` deny you had written did
7
+ nothing, and `rm -rf` was auto-approved by a broad `Bash` allow. Cursor was
8
+ strictly less safe than Claude Code for the same dashboard policy.
9
+
10
+ - Argument rules now match: `Bash(git status)` exact, `Bash(npm test:*)` prefix,
11
+ and path-style globs, with the same precedence the hook uses.
12
+ - The destructive ceiling applies: a command the classifier flags can no longer
13
+ auto-approve through a general bare-tool or wildcard rule. An explicit rule you
14
+ wrote still wins.
15
+ - Repo-scoped rules are honoured. Identity is the normalized git remote, read from
16
+ `.git/config` as a file; credentials are stripped. `PUSHARY_REPO_KEY` pins it,
17
+ `PUSHARY_REPO_KEY=off` disables scoping.
18
+ - Approvals now carry the command target and body, so the server can drop the
19
+ one-tap Approve on a dangerous call and the audit trail records Cursor
20
+ decisions at the same grain as every other agent.
21
+ - `scripts/pushary-gate.test.mjs` mirrors the monorepo's policy tests, since the
22
+ matcher is vendored and cannot be imported.
23
+
24
+ Verified against the canonical matcher over 1512 resolutions: zero cases where
25
+ the gate is less safe. The remaining differences are all the safe-read-only
26
+ allowlist, which is deliberately not vendored because it only ever loosens a
27
+ decision.
28
+
3
29
  ## 0.1.0
4
30
 
5
31
  Initial release.
6
32
 
7
- - MCP server (`send_notification`, `ask_user`, `wait_for_answer`, `cancel_question`) wired via `mcp.json`, key supplied at runtime through `PUSHARY_API_KEY`.
33
+ - MCP server (`send_notification`, `ask_user`, `wait_for_answer`, `cancel_question`, `list_sessions`) wired via `mcp.json`, key supplied at runtime through `PUSHARY_API_KEY`.
8
34
  - Always-on rule and full tool-reference skill so the agent uses Pushary proactively.
9
35
  - `beforeShellExecution` gate (`scripts/pushary-gate.mjs`, zero-dependency) that evaluates risky commands against your Pushary dashboard policy — auto-approve, the four approval modes, timeout actions, live mode override, and kill switch, scoped to the Cursor conversation. Falls back to Cursor's own prompt when Pushary is unreachable, and is fail-closed: a broken gate blocks rather than allows.
10
36
  - Commands: `/pushary-test`, `/notify-when-done`.
@@ -0,0 +1,28 @@
1
+ # Contributing
2
+
3
+ Thanks for looking. Please read this before opening a pull request, because of
4
+ where this code lives.
5
+
6
+ **This repository is a published copy, not the place the code is written.** The
7
+ source is a directory inside Pushary's private monorepo, and it is pushed here
8
+ whenever it changes. Anything committed directly to this repo is overwritten by
9
+ the next publish.
10
+
11
+ That is not hypothetical. Two pull requests were merged here and then sat
12
+ stranded for a month, because nothing carried them back upstream and the next
13
+ publish would have deleted them.
14
+
15
+ ## So what should you do
16
+
17
+ **Open an issue.** Bugs, missing behaviour, a patch you have already written and
18
+ want applied: an issue is read and acted on, and the fix is made upstream and
19
+ published here. Paste your diff into the issue if you have one, and it will be
20
+ credited.
21
+
22
+ **Security issues**: email aadil@pushary.com rather than opening an issue.
23
+
24
+ ## If you do open a pull request
25
+
26
+ It will not be merged as a pull request, because merging it would guarantee it
27
+ gets erased. It will be treated as a patch submission: applied upstream, and
28
+ this repo updated on the next publish. You will be told when that has happened.
@@ -75,7 +75,7 @@ macOS GUI apps do not read `.zshrc`. If Settings > MCP shows pushary in red afte
75
75
 
76
76
  | Part | File | What it does |
77
77
  |------|------|--------------|
78
- | MCP server | `mcp.json` | Connects Cursor to the Pushary tools: `send_notification`, `ask_user`, `wait_for_answer`, `cancel_question` |
78
+ | MCP server | `mcp.json` | Connects Cursor to the Pushary tools: `send_notification`, `ask_user`, `wait_for_answer`, `cancel_question`, `list_sessions` |
79
79
  | Rule | `rules/pushary.mdc` | Always on guidance so the agent uses Pushary on its own |
80
80
  | Skill | `skills/pushary/SKILL.md` | Full tool reference: parameters, examples, return values |
81
81
  | Hook | `hooks/hooks.json` and `scripts/pushary-gate.mjs` | Sends risky commands to your phone for approval |