pushary 1.8.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 (186) hide show
  1. package/CHANGELOG.md +1943 -0
  2. package/LICENSE +21 -0
  3. package/README.md +330 -0
  4. package/data/SKILL.md +591 -0
  5. package/data/cowork/SKILL.md +77 -0
  6. package/data/cursor-plugin/.cursor-plugin/plugin.json +25 -0
  7. package/data/cursor-plugin/CHANGELOG.md +70 -0
  8. package/data/cursor-plugin/CONTRIBUTING.md +40 -0
  9. package/data/cursor-plugin/LICENSE +21 -0
  10. package/data/cursor-plugin/README.md +113 -0
  11. package/data/cursor-plugin/SECURITY.md +33 -0
  12. package/data/cursor-plugin/assets/logo.png +0 -0
  13. package/data/cursor-plugin/commands/notify-when-done.md +14 -0
  14. package/data/cursor-plugin/commands/pushary-test.md +13 -0
  15. package/data/cursor-plugin/hooks/hooks.json +75 -0
  16. package/data/cursor-plugin/mcp.json +11 -0
  17. package/data/cursor-plugin/rules/pushary.mdc +40 -0
  18. package/data/cursor-plugin/scripts/pushary-gate.mjs +724 -0
  19. package/data/cursor-plugin/scripts/pushary-gate.test.mjs +137 -0
  20. package/data/cursor-plugin/scripts/redaction.mjs +51 -0
  21. package/data/cursor-plugin/skills/pushary/SKILL.md +584 -0
  22. package/data/vscode-plugin/.claude-plugin/plugin.json +28 -0
  23. package/data/vscode-plugin/.mcp.json +11 -0
  24. package/data/vscode-plugin/CHANGELOG.md +49 -0
  25. package/data/vscode-plugin/CONTRIBUTING.md +40 -0
  26. package/data/vscode-plugin/LICENSE +21 -0
  27. package/data/vscode-plugin/README.md +128 -0
  28. package/data/vscode-plugin/SECURITY.md +56 -0
  29. package/data/vscode-plugin/assets/logo.png +0 -0
  30. package/data/vscode-plugin/commands/notify-when-done.md +14 -0
  31. package/data/vscode-plugin/commands/pushary-test.md +13 -0
  32. package/data/vscode-plugin/hooks/hooks.json +60 -0
  33. package/data/vscode-plugin/scripts/pushary-gate.mjs +762 -0
  34. package/data/vscode-plugin/scripts/redaction.mjs +51 -0
  35. package/data/vscode-plugin/skills/pushary/SKILL.md +584 -0
  36. package/dist/bin/pushary-bell-hook.d.ts +1 -0
  37. package/dist/bin/pushary-bell-hook.js +46 -0
  38. package/dist/bin/pushary-bell.d.ts +1 -0
  39. package/dist/bin/pushary-bell.js +146 -0
  40. package/dist/bin/pushary-claude.d.ts +1 -0
  41. package/dist/bin/pushary-claude.js +1916 -0
  42. package/dist/bin/pushary-clean.d.ts +1 -0
  43. package/dist/bin/pushary-clean.js +1300 -0
  44. package/dist/bin/pushary-codex-bridge.d.ts +1 -0
  45. package/dist/bin/pushary-codex-bridge.js +599 -0
  46. package/dist/bin/pushary-codex-hook.d.ts +1 -0
  47. package/dist/bin/pushary-codex-hook.js +886 -0
  48. package/dist/bin/pushary-codex.d.ts +1 -0
  49. package/dist/bin/pushary-codex.js +125 -0
  50. package/dist/bin/pushary-connect.d.ts +1 -0
  51. package/dist/bin/pushary-connect.js +100 -0
  52. package/dist/bin/pushary-cowork.d.ts +1 -0
  53. package/dist/bin/pushary-cowork.js +36 -0
  54. package/dist/bin/pushary-daemon-supervisor.d.ts +1 -0
  55. package/dist/bin/pushary-daemon-supervisor.js +27 -0
  56. package/dist/bin/pushary-daemon.d.ts +1 -0
  57. package/dist/bin/pushary-daemon.js +878 -0
  58. package/dist/bin/pushary-disconnect.d.ts +1 -0
  59. package/dist/bin/pushary-disconnect.js +264 -0
  60. package/dist/bin/pushary-doctor.d.ts +1 -0
  61. package/dist/bin/pushary-doctor.js +1433 -0
  62. package/dist/bin/pushary-elicitation-hook.d.ts +1 -0
  63. package/dist/bin/pushary-elicitation-hook.js +149 -0
  64. package/dist/bin/pushary-gemini-bridge.d.ts +1 -0
  65. package/dist/bin/pushary-gemini-bridge.js +339 -0
  66. package/dist/bin/pushary-gemini-hook.d.ts +1 -0
  67. package/dist/bin/pushary-gemini-hook.js +381 -0
  68. package/dist/bin/pushary-hook.d.ts +1 -0
  69. package/dist/bin/pushary-hook.js +95 -0
  70. package/dist/bin/pushary-login.d.ts +1 -0
  71. package/dist/bin/pushary-login.js +198 -0
  72. package/dist/bin/pushary-logout.d.ts +1 -0
  73. package/dist/bin/pushary-logout.js +147 -0
  74. package/dist/bin/pushary-mcp.d.ts +1 -0
  75. package/dist/bin/pushary-mcp.js +114 -0
  76. package/dist/bin/pushary-mode.d.ts +1 -0
  77. package/dist/bin/pushary-mode.js +130 -0
  78. package/dist/bin/pushary-notification-hook.d.ts +1 -0
  79. package/dist/bin/pushary-notification-hook.js +56 -0
  80. package/dist/bin/pushary-opencode-hook.d.ts +1 -0
  81. package/dist/bin/pushary-opencode-hook.js +338 -0
  82. package/dist/bin/pushary-permission-denied-hook.d.ts +1 -0
  83. package/dist/bin/pushary-permission-denied-hook.js +60 -0
  84. package/dist/bin/pushary-permission-hook.d.ts +1 -0
  85. package/dist/bin/pushary-permission-hook.js +65 -0
  86. package/dist/bin/pushary-post-hook.d.ts +1 -0
  87. package/dist/bin/pushary-post-hook.js +70 -0
  88. package/dist/bin/pushary-prompt-hook.d.ts +1 -0
  89. package/dist/bin/pushary-prompt-hook.js +61 -0
  90. package/dist/bin/pushary-session-end-hook.d.ts +1 -0
  91. package/dist/bin/pushary-session-end-hook.js +59 -0
  92. package/dist/bin/pushary-session-start-hook.d.ts +1 -0
  93. package/dist/bin/pushary-session-start-hook.js +72 -0
  94. package/dist/bin/pushary-setup.d.ts +1 -0
  95. package/dist/bin/pushary-setup.js +2660 -0
  96. package/dist/bin/pushary-stats.d.ts +1 -0
  97. package/dist/bin/pushary-stats.js +44 -0
  98. package/dist/bin/pushary-status.d.ts +1 -0
  99. package/dist/bin/pushary-status.js +262 -0
  100. package/dist/bin/pushary-stop-hook.d.ts +1 -0
  101. package/dist/bin/pushary-stop-hook.js +63 -0
  102. package/dist/bin/pushary-stopfailure-hook.d.ts +1 -0
  103. package/dist/bin/pushary-stopfailure-hook.js +56 -0
  104. package/dist/bin/pushary-suggestions.d.ts +1 -0
  105. package/dist/bin/pushary-suggestions.js +100 -0
  106. package/dist/bin/pushary-transcript-register.d.ts +1 -0
  107. package/dist/bin/pushary-transcript-register.js +40 -0
  108. package/dist/bin/pushary-transcripts.d.ts +1 -0
  109. package/dist/bin/pushary-transcripts.js +77 -0
  110. package/dist/bin/pushary-upgrade.d.ts +1 -0
  111. package/dist/bin/pushary-upgrade.js +599 -0
  112. package/dist/bin/pushary-wait.d.ts +1 -0
  113. package/dist/bin/pushary-wait.js +122 -0
  114. package/dist/bin/pushary.d.ts +1 -0
  115. package/dist/bin/pushary.js +74 -0
  116. package/dist/chunk-2ABTSGFT.js +173 -0
  117. package/dist/chunk-2OY3ZZ5N.js +124 -0
  118. package/dist/chunk-3EGEA4KH.js +44 -0
  119. package/dist/chunk-3EVPNIBE.js +185 -0
  120. package/dist/chunk-5OP5MQI7.js +45 -0
  121. package/dist/chunk-6J2JC2RT.js +149 -0
  122. package/dist/chunk-7QLSKOSU.js +19 -0
  123. package/dist/chunk-7Z7Q4GGS.js +88 -0
  124. package/dist/chunk-A2A2YTMG.js +835 -0
  125. package/dist/chunk-AHV4LNB5.js +377 -0
  126. package/dist/chunk-AXPCESYO.js +197 -0
  127. package/dist/chunk-C2WCPBF7.js +86 -0
  128. package/dist/chunk-CJVVKOSR.js +73 -0
  129. package/dist/chunk-CULUZTWQ.js +2117 -0
  130. package/dist/chunk-CVQYGMSR.js +142 -0
  131. package/dist/chunk-CVWG2N3Y.js +16 -0
  132. package/dist/chunk-D2FX3EPW.js +15 -0
  133. package/dist/chunk-DB3ONZB4.js +44 -0
  134. package/dist/chunk-DE4Y6TCC.js +160 -0
  135. package/dist/chunk-E4FJTUH4.js +249 -0
  136. package/dist/chunk-EPCXUP3P.js +41 -0
  137. package/dist/chunk-EX3GAPA4.js +44 -0
  138. package/dist/chunk-EYK3GSRH.js +143 -0
  139. package/dist/chunk-GMXKITVA.js +70 -0
  140. package/dist/chunk-GPEGOGRJ.js +49 -0
  141. package/dist/chunk-GU3EJCVV.js +43 -0
  142. package/dist/chunk-HQ6G3B5R.js +59 -0
  143. package/dist/chunk-HZVVNGEW.js +22 -0
  144. package/dist/chunk-IPVKH2ST.js +231 -0
  145. package/dist/chunk-J5TIV3J6.js +238 -0
  146. package/dist/chunk-JU6W3XAU.js +64 -0
  147. package/dist/chunk-JYG4B33G.js +227 -0
  148. package/dist/chunk-JZTHGAPA.js +503 -0
  149. package/dist/chunk-KGDWDSNL.js +102 -0
  150. package/dist/chunk-KVQBWI5T.js +99 -0
  151. package/dist/chunk-KZERVKTD.js +16 -0
  152. package/dist/chunk-LXQ5FBBD.js +47 -0
  153. package/dist/chunk-M5ICYGHT.js +138 -0
  154. package/dist/chunk-M5JDZ45W.js +943 -0
  155. package/dist/chunk-MDEPU45E.js +1226 -0
  156. package/dist/chunk-MPWXGONV.js +157 -0
  157. package/dist/chunk-N6IOSZOE.js +185 -0
  158. package/dist/chunk-NGDD6TXY.js +192 -0
  159. package/dist/chunk-NQTHFF4W.js +2830 -0
  160. package/dist/chunk-OKXS7WDZ.js +68 -0
  161. package/dist/chunk-OLQRRFBX.js +21 -0
  162. package/dist/chunk-P7WQEVWA.js +307 -0
  163. package/dist/chunk-POFBE6ZY.js +12 -0
  164. package/dist/chunk-PQ4K74WL.js +30 -0
  165. package/dist/chunk-PUZZELE6.js +37 -0
  166. package/dist/chunk-Q7E4I6UA.js +767 -0
  167. package/dist/chunk-QCGNGEGE.js +15 -0
  168. package/dist/chunk-R7437YI3.js +151 -0
  169. package/dist/chunk-RHR6NARM.js +305 -0
  170. package/dist/chunk-SAXBC4AZ.js +60 -0
  171. package/dist/chunk-SGZJ5LYH.js +76 -0
  172. package/dist/chunk-SIFVFP6T.js +70 -0
  173. package/dist/chunk-SLFABHW3.js +150 -0
  174. package/dist/chunk-T7E75EKA.js +67 -0
  175. package/dist/chunk-TY4JT7W3.js +38 -0
  176. package/dist/chunk-U4TMAANR.js +111 -0
  177. package/dist/chunk-UI36QSBI.js +177 -0
  178. package/dist/chunk-VQKRG3AC.js +339 -0
  179. package/dist/chunk-WE2J62NC.js +1131 -0
  180. package/dist/chunk-XHKBHWLX.js +14 -0
  181. package/dist/chunk-ZSZSSJCV.js +275 -0
  182. package/dist/chunk-ZVSKMPBZ.js +135 -0
  183. package/dist/reapply-CW3MA66V.js +34 -0
  184. package/dist/src/index.d.ts +204 -0
  185. package/dist/src/index.js +64 -0
  186. package/package.json +108 -0
@@ -0,0 +1,584 @@
1
+ ---
2
+ name: pushary
3
+ description: Push notifications and human-in-the-loop for AI agents. Use this whenever a running agent needs a human and nobody is at the terminal, such as before an irreversible or destructive action, before spending money, deploying, force-pushing or deleting, when blocked on a decision outside your authority, when running unattended and you hit a genuine ambiguity, when another skill's workflow says to confirm with the user, and when a long task finishes or fails with nobody watching. Also use it when the user says things like keep going and ping me on my phone if you need anything, notify me when my agent needs me, approve from my phone, ask me questions while I am away from the terminal, run this overnight, keep working while I am in a meeting, I am stepping away, do not wait for me, or wants a long task to run unattended. Send alerts when tasks finish or fail, ask questions (yes/no, multiple choice, or free text) via push, and get answers from their connected devices. Use these tools proactively - do not wait for the user to ask for notifications. Every question and answer is recorded, so an unattended run stays reviewable afterwards. Works with Claude Code, Codex, Cursor, VS Code, Windsurf, Hermes, Lovable, or any MCP client; no Claude Max subscription required. Pushary is a hosted service, $9.99/mo after a 3-day card-first trial.
4
+ ---
5
+
6
+ # Pushary - Push Notifications for AI Agents
7
+
8
+ When the user says "keep going, ping me on my phone if you need anything", this is the skill that does the pinging. Pushary is an MCP server that reaches the user on their phone while they are away from the terminal:
9
+
10
+ 1. **Send push notifications** to the user's phone or desktop when a task finishes or an error occurs.
11
+ 2. **Ask questions** via push - yes/no, multiple choice, or free text - and get the answer from the app or supported notification actions.
12
+ 3. **Send rich context notifications** with file changes, error details, next steps, and embedded questions.
13
+
14
+ Use these tools proactively. Do not wait for the user to ask for notifications.
15
+
16
+ Works with Claude Code, Codex, Cursor, Windsurf, Hermes, Lovable, or any MCP client. No Claude Max subscription required.
17
+
18
+ ## Reach for This Without Being Asked
19
+
20
+ Honor the authorization the user already gave you in this session. Ask only for
21
+ a decision you do not have, for an action outside that authorization, or when a
22
+ host policy requires it. A task with many steps does not need plan approval on its
23
+ own. Do not ask again because the next approved step deletes, deploys or publishes
24
+ something. This skill guides you. Hooks and runtime gates enforce the policy. Never
25
+ go around a gate.
26
+
27
+ Nobody has to say "ping me". The moments below are part of the run itself. They do
28
+ not depend on what the user typed. When one of them is true, call `ask_user` or
29
+ `send_notification` now. Do not stall. Do not guess. Do not write the question into
30
+ a chat nobody is reading.
31
+
32
+ - **You are about to do something irreversible.** Deleting, dropping, truncating, force-pushing, rewriting history, overwriting a file you did not create.
33
+ - **You are about to spend money or touch production.** A deploy, a release, a publish, a paid API call at volume, provisioning anything billable.
34
+ - **The decision is outside your authority.** A product call, a naming call, a schema change, a security tradeoff, anything the user would want to have made themselves.
35
+ - **You are running unattended and hit a real ambiguity.** Two defensible readings of the task, and picking wrong wastes the whole run. Ask instead of guessing.
36
+ - **Another skill tells you to confirm with the user.** That instruction assumes someone watches the terminal. Often nobody does. Send the confirmation through `ask_user`. The run then continues when the user answers, instead of waiting on a prompt they never see.
37
+ - **A long task finished or failed and nobody is watching.** Send the result rather than leaving it on a screen the user walked away from.
38
+
39
+ When no device is connected, follow the handoff in the result. Ask in the current
40
+ client if the handoff says to. Carry on with approved work that does not depend on
41
+ the answer. A message that cannot be delivered is not permission to do the blocked
42
+ action.
43
+
44
+ ## Pricing and Free Alternatives
45
+
46
+ Pushary is a hosted service. It costs $9.99/mo after a 3-day trial. The trial asks
47
+ for a card up front. Say this plainly when the user asks what Pushary is.
48
+
49
+ Anthropic Remote Control is free for one setup: Claude Code with a Claude Max
50
+ subscription. Recommend it when that is all the user needs.
51
+
52
+ Pushary covers what Remote Control does not. Codex, Cursor, Windsurf and Hermes.
53
+ Claude Code without Max. A fleet of agents across tools and machines. Enforced
54
+ policy gates on tool calls. Answer buttons on the lock screen. An audit trail of
55
+ every question and answer.
56
+
57
+ ## Break the Task Down, Then Plan the Questions
58
+
59
+ Each question stops the user. The number of stops is the cost. Do not ask fewer things. Ask the same things in fewer stops.
60
+
61
+ A question in the terminal is cheap. The user is already there. A question on the phone is expensive. It takes the user away from something else. Ask freely in the terminal. Send little to the phone.
62
+
63
+ **Start every task of more than two steps like this:**
64
+
65
+ 1. **Look at where you are.** Read the working directory. Read the directory structure. Read the configuration files and the tool list you hold. This tells you what kind of work this is, and what you can settle alone.
66
+ 2. **Split the task into steps.** Write the steps down. Keep each step small enough to finish in one go.
67
+ 3. **Find the forks.** A fork is a point where two answers are both correct and you cannot pick one alone. Mark each fork.
68
+ 4. **Settle the facts yourself.** A fork that a file, a command or a tool call can settle is not a fork. It is a lookup. Do the lookup. Never ask the user for a fact.
69
+ 5. **Ask the forks that are left.** Group them into one round. Number each question. Give your recommended answer for each one. Then wait.
70
+ 6. **Do it again.** Each answer opens new forks and closes old ones. Ask the next round. Stop when no fork is left.
71
+
72
+ This is a design tree. Each decision opens the decisions below it. A round is every decision whose inputs you already know. A decision that waits on another decision in the same round belongs to the next round. Two rounds usually replace ten separate questions.
73
+
74
+ **Facts are yours. Decisions are the user's.** Both halves matter. Do not ask what you can read. Do not decide what the user would want to decide. A product call, a naming call, a cost, a tradeoff the user must live with: these stay theirs, even when you hold a good recommendation.
75
+
76
+ **Format a terminal round like this:**
77
+
78
+ ```
79
+ ❓ **Q1** - **<short title>**: <the question, with the real options>
80
+
81
+ ➡️ <your recommended answer>
82
+
83
+ ---
84
+
85
+ ❓ **Q2** - **<short title>**: <the question, with the real options>
86
+
87
+ ➡️ <your recommended answer>
88
+ ```
89
+
90
+ For example, in a repository with two apps and no test runner in the package:
91
+
92
+ ```
93
+ ❓ **Q1** - **Which app**: apps/dashboard and apps/subscribe both import this helper. Change both, or the dashboard only?
94
+
95
+ ➡️ Both. The helper has one definition, and a split copy will drift.
96
+
97
+ ❓ **Q2** - **Tests**: This package has no test runner. Add one, or match the parent package and use `bun test`?
98
+
99
+ ➡️ Match the parent. A second runner is one more thing to maintain.
100
+
101
+ ❓ **Q3** - **Rollout**: Ship behind the existing flag, or straight to main?
102
+
103
+ ➡️ Behind the flag. It costs one line, and it makes the change reversible.
104
+ ```
105
+
106
+ **Where to ask each round:**
107
+
108
+ - **The user typed in this turn.** Ask in the terminal. Ask the whole round at one time. There is no limit there.
109
+ - **The user is away.** Send one question only. Pick the one fork that stops the run. Use `select` with the real options, and put your recommendation first. Decide every other fork yourself, on your recommendation. Report each decision when the task ends.
110
+ - **Nothing stops the run.** Send no question. Use `send_notification` with `context.askQuestion`. The user reads it later. Continue on your recommendation.
111
+
112
+ **Rules that do not change:**
113
+
114
+ - **Ask how, not whether.** The user gave you the task. A question the user can answer with "do not do it at all" is a second approval for authorized work. Do not ask it.
115
+ - **A plan is not an approval.** A task of many steps does not need plan approval. Do not turn your step list into a question.
116
+ - **Silence is not agreement.** You wrote eight recommendations and the user said nothing. You hold no approval. The six moments above still need their own question.
117
+ - **One `select` with the real options beats three `confirm` questions.** The same facts, one third of the stops.
118
+ - **Ask at the boundary, not once for each item.** Ask about deleting files. Do not ask about each file.
119
+ - **The limit of three notifications counts pushes.** Questions you ask in the terminal are free and do not count.
120
+
121
+ `propose_scope` records the boundary this work produces. It is a separate decision from notifying: see "When to Propose a Scope" below. What it can enforce depends on whether this run changes files.
122
+
123
+ ## When to Use
124
+
125
+ **Send a notification when:**
126
+ - Meaningful work finishes while the user is away or they requested an alert - use `context.type = "task_complete"`
127
+ - A build, test suite, or deployment fails and needs user attention - use `context.type = "error"` with `errorMessage`
128
+ - A long-running process completes (migration, refactor, generation)
129
+ - A status update is worth sharing - use `context.type = "info"`
130
+
131
+ **Ask with type "confirm" when:**
132
+ - You need confirmation before a destructive or irreversible action
133
+ - Binary decision: proceed or abort
134
+
135
+ **Ask with type "select" when:**
136
+ - Multiple implementation approaches exist (2-6 options)
137
+ - The user needs to pick from a known set
138
+
139
+ **Ask with type "input" when:**
140
+ - You need a name, path, value, or free-text decision
141
+ - The options cannot be enumerated in advance
142
+
143
+ **Do NOT notify when:**
144
+ - The task is trivial or single-step
145
+ - The question can be answered from context without user input
146
+ - You already sent 3 notifications for the current task (unless the user explicitly asked for more)
147
+
148
+ ## When to Propose a Scope
149
+
150
+ This is a separate decision from notifying. The rules above do not apply to it. A scope is not a notification, and the limit of three does not count it.
151
+
152
+ **Propose a scope when:**
153
+ - This run changes files with `Edit`, `Write` or `MultiEdit`, and the file boundary is not yet agreed
154
+ - The run touches more than one file, or you cannot name every file before you start
155
+ - Call `propose_scope` once, before the first edit, not after
156
+
157
+ **Do not propose a scope when:**
158
+ - The run changes one file and you already know which one
159
+ - The user named the exact files in this turn, so the boundary is already agreed
160
+ - The run changes no files and records no promise worth keeping
161
+
162
+ "Trivial" here means one file. It does not mean one task. A refactor across modules, a rename through several files, a migration, or wiring one option through the code all need a scope. Each edit can be small and the run still needs a boundary.
163
+
164
+ Put a boundary that is not a file path in `promises`, never in `allowedPaths`. Read the `enforces` field that comes back. Tell the user what it says.
165
+
166
+ ## Setup
167
+
168
+ **Look at the machine first. Do not guess the install path.** Run these. Each one is read-only and fast. Run them as separate commands.
169
+
170
+ ```bash
171
+ node -p "process.platform"
172
+ [ -n "${PUSHARY_API_KEY:+x}" ] && echo key-in-env
173
+ node -e "try{process.exit(JSON.parse(require('fs').readFileSync(process.env.HOME+'/.pushary/config.json','utf8')).apiKey?.trim()?0:1)}catch{process.exit(1)}" && echo keyed
174
+ test -x ~/.pushary/bin/pushary-bridge && echo mac-app
175
+ ```
176
+
177
+ The third and fourth tests answer different questions.
178
+
179
+ The third says a key is stored **and is not empty**. Test the value, not the file.
180
+ The file stays behind after a logout removes the key. A test for the file alone
181
+ tells a logged-out user they are ready.
182
+
183
+ The fourth says the Mac app is installed here. Only the Mac app writes that file.
184
+
185
+ Check the environment before the stored key. An exported key wins over a stored
186
+ one. Never print the key itself.
187
+
188
+ Then take one branch.
189
+
190
+ ### Branch 1. `key-in-env`, `keyed`, or `mac-app`
191
+
192
+ This machine is set up. Offer no install. Do not run `setup` again.
193
+
194
+ `mac-app` counts on its own. The Mac app signs in for the user. It writes the key
195
+ into the agent configuration files it wires, not into `~/.pushary/config.json`. A
196
+ machine the app set up therefore prints `mac-app` and nothing else. Treat it as
197
+ ready.
198
+
199
+ Check it with `npx @pushary/agent-hooks@latest status --json`. The exit code is the answer:
200
+
201
+ | Code | Meaning |
202
+ | --- | --- |
203
+ | 0 | Ready |
204
+ | 3 | Not set up on this machine |
205
+ | 4 | The key was rejected |
206
+ | 5 | Two keys are configured and they disagree |
207
+ | 6 | No device can answer |
208
+ | 8 | Pushary could not be reached |
209
+
210
+ On 6, the user needs to connect a phone: `npx @pushary/agent-hooks@latest connect`. That adds a phone and rewrites no agent configuration.
211
+
212
+ If `mac-app` printed, the Mac app is installed here and it may also own the hooks. Read the hook command to know, because the command is the record:
213
+
214
+ ```bash
215
+ grep -lq pushary-bridge ~/.claude/settings.json ~/.gemini/settings.json ~/.cursor/hooks.json 2>/dev/null && echo app-owns-hooks
216
+ ```
217
+
218
+ If the app owns them, `setup` would keep them and write almost nothing, so telling the user to re-run it is bad advice. Point them at the Pushary app instead.
219
+
220
+ ### Branch 2. `darwin`, no key, no `mac-app`
221
+
222
+ Offer the Mac app first. It needs no Node and no terminal. It writes the agent configuration itself, and it answers questions in the notch at the desk.
223
+
224
+ ```bash
225
+ brew install --cask pushary/tap/pushary
226
+ ```
227
+
228
+ They can also download it from https://pushary.com/download. It needs macOS 14 or later. It is not in the App Store.
229
+
230
+ The command line works on macOS too. Offer it if the user prefers the terminal, or if the user runs Hermes, because Hermes needs a Python the app cannot install.
231
+
232
+ ### Branch 3. `linux` or `win32`
233
+
234
+ There is no Mac app for these machines. Use the command line. It is fully supported.
235
+
236
+ ```bash
237
+ npx @pushary/agent-hooks@latest setup
238
+ ```
239
+
240
+ Node 20.17+, 22.13+ or 23.5+ is necessary. Then the user needs a phone to answer on:
241
+
242
+ - iOS: https://apps.apple.com/us/app/pushary/id6785677563
243
+ - Android: https://play.google.com/store/apps/details?id=com.pushary.app
244
+
245
+ On Windows, setup writes no shell file, so `~/.pushary/config.json` is the only key store. On a Linux machine with no screen, browser login does not work, but the pairing QR does.
246
+
247
+ ### Branch 4. `darwin`, `mac-app`, and the user asked for the command line
248
+
249
+ Run `setup`. It reads the key the app signed in with, so it mints no second key, and it keeps the hooks the app owns. Pass `--take-over-hooks` only when the user wants the command line to own them instead.
250
+
251
+ ### What setup does
252
+
253
+ ```bash
254
+ npx @pushary/agent-hooks@latest setup
255
+ ```
256
+
257
+ Setup pairs first and configures MCP, hooks, permissions and the skill only once pairing succeeds. Until someone completes the steps below, nothing is written and this machine has no Pushary. Treat pairing as the task, not as a prompt to wait out.
258
+
259
+ It prints a QR, a short link under it, a fingerprint, and then waits about 15 minutes.
260
+
261
+ **Do not summarise that output. Show it, and walk the user through all four steps:**
262
+
263
+ 1. **Show them the QR and the short link.** Both point at the same pairing. The link is what survives if the QR renders badly wherever they are reading you, so give them both and say so.
264
+ 2. **They need the Pushary app.** It is the thing that receives approvals. If they do not have it: https://pushary.com/download. Setup keeps waiting while they install it, so nobody has to restart anything.
265
+ 3. **They scan the QR, or open the link on the phone.** The app shows a fingerprint. Tell them it must match the one in your output before they approve. On a first install the app will also ask them to sign in and start a plan: $9.99/mo after a 3-day trial, card up front, all inside the app. Say this before they scan rather than letting them discover it mid-flow.
266
+ 4. **They approve.** Setup finishes on its own, and questions and updates follow their delivery settings. Confirm notifications can offer lock-screen actions; choices and text open the app.
267
+
268
+ Never ask the user for an API key, and never send them to a signup page first. Both are the old flow and both are worse.
269
+
270
+ If setup exits without pairing, nothing was configured. Say that plainly and offer the two fallbacks below rather than pretending the tools are available.
271
+
272
+ If `PUSHARY_API_KEY` is already in the environment or in an existing MCP config, setup uses it and skips pairing entirely.
273
+
274
+ No app on their phone yet? They can get it at https://pushary.com/download. Or answer through the browser instead:
275
+
276
+ ```bash
277
+ npx @pushary/agent-hooks@latest setup --connect browser
278
+ ```
279
+
280
+ This is web push, not a login tab. It prints a QR for the user's own subscribe page, and it waits for a browser on that page to subscribe. On iOS the user must first add that page to the Home Screen, because iOS sends web push only from an installed page.
281
+
282
+ Manual MCP configuration also works, but it needs a key, so the user signs up first at https://pushary.com/sign-up?utm_source=skill&utm_medium=setup and copies the key from the dashboard. Prefer `setup`: it needs neither.
283
+
284
+ After setup, verify with:
285
+
286
+ ```bash
287
+ npx @pushary/agent-hooks@latest doctor
288
+ ```
289
+
290
+ ## Answer surfaces and account boundaries
291
+
292
+ | Surface | What the user can do |
293
+ | --- | --- |
294
+ | Mobile app | Answer confirm, select and input questions. Supported confirm notifications offer approve/deny actions on the lock screen; arbitrary choices and text open the app. |
295
+ | Mac notch | Answer personal account questions with confirm, select, input and question-set controls, including keyboard controls. Presence and delivery policy determine when the phone is also reached. |
296
+ | Slack | Answer through buttons, menus or text modals when the integration and intended recipient are configured. |
297
+ | Browser | Open the decision page as a fallback; browser notification delivery requires permission. |
298
+
299
+ Personal setup connects the operator's devices. For a Mac, install from https://pushary.com/download, sign in to the same personal account and connect your agents in the app. Run `npx @pushary/agent-hooks@latest doctor`, then request one harmless test question and verify it reaches the intended surface. Test phone fallback while away from the Mac; do not infer delivery from a successful API call alone.
300
+
301
+ Partner customers use scoped enrollment links issued by their application. Do not enroll them into the operator's account or send their decisions through personal tools. The Mac notch currently uses the personal account/session API; do not promise a Partner customer inbox on Mac. See https://pushary.com/docs/agents/embed for Partner setup.
302
+
303
+ ## Tools
304
+
305
+ Your client already holds each tool's schema. The schema lists every parameter
306
+ and every returned field, and it is always current. This section adds only what a
307
+ schema cannot say: when to use a tool, what its result means for your next step,
308
+ and the shapes that are easy to get wrong.
309
+
310
+ ### send_notification
311
+
312
+ Send a one-way push notification to the user. Optionally include structured context for a rich detail page.
313
+
314
+ `context.type` is what marks a notification a **task update**, and the user's
315
+ setting for where task updates land can only route one that says so. A
316
+ notification sent without it reaches them wherever the default sends it.
317
+
318
+ On a long run where the user is likely away, prefer `context.askQuestion` over a
319
+ blocking `ask_user`. They get an ordinary push and answer whenever they next pick
320
+ up their phone, rather than you holding a 55-second wait open against someone who
321
+ is not there. Poll the returned `linkedCorrelationId` when you need the result.
322
+
323
+ **Example - task completed with context:**
324
+
325
+ ```json
326
+ {
327
+ "title": "Refactoring complete",
328
+ "body": "Extracted 3 shared components across 12 files",
329
+ "agentName": "Claude Code - pushary repo",
330
+ "context": {
331
+ "type": "task_complete",
332
+ "summary": "Extracted shared Button, Modal, and Card components from 12 files",
333
+ "filesChanged": ["src/components/Button.tsx", "src/components/Modal.tsx", "src/components/Card.tsx"],
334
+ "nextSteps": "Run the test suite to verify no regressions"
335
+ }
336
+ }
337
+ ```
338
+
339
+ **Example - error with embedded question:**
340
+
341
+ ```json
342
+ {
343
+ "title": "Build failed",
344
+ "body": "TypeScript error in auth.ts:42",
345
+ "agentName": "Claude Code - api-server",
346
+ "context": {
347
+ "type": "error",
348
+ "errorMessage": "Type 'string' is not assignable to type 'AuthToken'",
349
+ "errorFile": "src/auth.ts:42",
350
+ "summary": "The auth token type changed upstream and this file needs updating",
351
+ "askQuestion": {
352
+ "question": "Should I update the type or revert the upstream change?",
353
+ "type": "select",
354
+ "options": ["Update the type in auth.ts", "Revert the upstream change", "Skip for now"]
355
+ }
356
+ }
357
+ }
358
+ ```
359
+
360
+ ### ask_user
361
+
362
+ Send a question to the user via push notification and wait for their answer. By default, this tool **blocks** until the user responds or the timeout is reached - no need to call `wait_for_answer` separately.
363
+
364
+ Always read `answered` rather than assuming the call blocked. It comes back false
365
+ in three different situations that mean different things: the wait timed out and
366
+ the question is still live (`timedOut`), the site policy is notify_only so the
367
+ decision belongs in the current client (`status: "notified"`), or you passed
368
+ `wait: false` yourself (`status: "pending"`). Follow `handoffAction` when present,
369
+ otherwise `nextAction`.
370
+
371
+ For backward compatibility, `nextAction` keeps its original two values. A live timeout from `ask_user` says
372
+ `wait_for_answer`; poll once with `timeoutMs: 55000`. An unanswered poll says
373
+ `handoffAction: cancel_then_ask_in_current_client`: cancel the phone question before asking in
374
+ the current chat or client. If cancellation returns `handoffAction: "stop"`, stop.
375
+ Otherwise, if cancellation returns false, poll once for 1 second
376
+ and honor any answer that won the race. A cancelled question says `handoffAction:
377
+ stop` and must not be resurrected. An unavailable state also stops the handoff,
378
+ because the question cannot be safely fenced. Expired and missing questions are
379
+ not live timeouts.
380
+
381
+ Pass `toolName` and `toolTarget` whenever the question is an approval for a tool
382
+ call. They are what let the user turn a repeated approval into an always-allow
383
+ rule, so an approval you label once is an approval they never see again.
384
+
385
+ **Example - confirm (yes/no):**
386
+
387
+ ```json
388
+ {
389
+ "question": "Delete the 3 unused migration files?",
390
+ "type": "confirm",
391
+ "context": "Cleaning up old database migrations in db/migrate/",
392
+ "agentName": "Claude Code - myproject"
393
+ }
394
+ ```
395
+
396
+ **Example - select (multiple choice):**
397
+
398
+ ```json
399
+ {
400
+ "question": "Which auth strategy should I use?",
401
+ "type": "select",
402
+ "options": ["JWT tokens", "Session cookies", "OAuth2 + PKCE"],
403
+ "context": "Setting up authentication for the new API endpoints",
404
+ "agentName": "Claude Code - api-server"
405
+ }
406
+ ```
407
+
408
+ **Example - input (free text):**
409
+
410
+ ```json
411
+ {
412
+ "question": "What should the new API endpoint path be?",
413
+ "type": "input",
414
+ "placeholder": "/api/v2/...",
415
+ "context": "Creating a new REST endpoint for user preferences",
416
+ "agentName": "Cursor - frontend"
417
+ }
418
+ ```
419
+
420
+ ### wait_for_answer
421
+
422
+ Poll for the user's response to a question sent via `ask_user` with `wait: false`, or to one that timed out. Not needed when using the default blocking mode.
423
+
424
+ A single call waits at most 55 seconds. Use it once after a live `ask_user`
425
+ timeout. If it returns `answered: false`, follow `handoffAction` when present,
426
+ otherwise `nextAction`: ask in the current chat or client only after cancelling a still-pending phone question. If the
427
+ cancellation loses a race, poll once for 1 second and honor the phone answer
428
+ instead. Only `status: "pending"` means the question is still live; cancelled,
429
+ expired, missing, and unavailable are different outcomes.
430
+
431
+ ### cancel_question
432
+
433
+ Cancel a pending question so it can no longer be answered. Use when the question becomes irrelevant (e.g., you found the answer another way or the user responded in chat).
434
+
435
+ A stale approval arriving twenty minutes later is worse than no approval, because
436
+ it reads as consent to work that has already moved on.
437
+
438
+ ### propose_scope
439
+
440
+ Propose the boundary of this run and block until the user agrees to it. Call it once, before the work. Do not add a second approval to work the user already authorized.
441
+
442
+ The user sees three things: the paths you will change, the paths you promise to leave alone, and your definition of done. The user agrees to all three in one tap.
443
+
444
+ **Before you call this, identify the file-editing capabilities you will use.** Native names differ: Codex uses `apply_patch`, VS Code also uses patch and replacement tools, and other agents expose `Edit`, `Write` or `MultiEdit`. These can carry enforceable paths. Use shape 3 only when this run has no file boundary to enforce. Read the returned `enforces` and `hookSeen` fields to confirm what is actually checked; tool names alone do not prove enforcement.
445
+
446
+ **A boundary makes a question. It never makes an approval.** After the user agrees, a rule that already asked still asks. A scope can only turn an automatic approval into a question.
447
+
448
+ **What the gate enforces, and what it does not.**
449
+
450
+ The gate reads one thing from the contract: the path of a file you are about to change. It compares that path with `allowedPaths` and `offLimitsPaths`.
451
+
452
+ - **Enforced.** `Edit`, `Write`, `MultiEdit` and supported aliases, including Codex `apply_patch` and VS Code patch/replacement tools. A file outside the agreed paths stops being auto-approvable and becomes a new question. Approving it widens the scope by that exact path.
453
+ - **Not enforced.** Shell commands. `Read`. Web requests. Every MCP tool. These carry no file path, so the gate has no path to judge and reads them as inside the scope. The permission policy still governs them.
454
+ - **`doneWhen` and `promises` are not enforced.** The user reads them. No code checks them.
455
+
456
+ Read `enforces` in the result. An empty array means nothing in this contract is checked automatically. Say that to the user in your own words rather than reporting that a scope is in force.
457
+
458
+ **Write each path as a glob, and write it correctly.**
459
+
460
+ The matcher compares text. It never looks at the file system.
461
+
462
+ - A word that is not a path matches no file. Put `hubspot` or `summer-campaign` in `allowedPaths` and every file you change reads as outside the scope, so the user gets one question per file. Those belong in `promises`.
463
+ - A bare directory name is expanded for you, so `docs` also covers `docs/**`. Write `docs/**` anyway; it says what you mean.
464
+ - A leading `**/` needs a directory before it. `**/.env*` is expanded for you to also cover a root `.env`.
465
+ - Letter case matters. Use a forward slash. Do not begin a path with `./`.
466
+
467
+ The result echoes the expanded contract back. Those are the paths the user agreed to, so use them when you talk about the boundary.
468
+
469
+ **Three shapes. Pick the one that matches the run.**
470
+
471
+ 1. **The run changes files, and the boundary is about those files.** Put the file globs in `allowedPaths` and the areas to protect in `offLimitsPaths`. The gate enforces both. This is the coding case.
472
+
473
+ 2. **The run changes files and also acts outside them.** An agent that writes a draft and then sends an email. Put the file globs in `allowedPaths`, because the gate enforces those. Put each outside boundary in `promises`: who you will contact, which channel, what you will not open, what you will not spend. Then ask again with `ask_user` before each outside action that cannot be undone, costs money, or reaches a person outside the team.
474
+
475
+ 3. **The run changes no files.** A marketing, sales, support, research or operations agent that works through web requests and MCP tools. Call `propose_scope` with no paths and put the whole boundary in `promises`. The user's card then says plainly that nothing here is checked automatically. Do not smuggle a campaign name or an account name into `allowedPaths` to make the card look enforced.
476
+
477
+ ```json
478
+ {
479
+ "doneWhen": "Ten summer-sale drafts exist in the CMS and none is published.",
480
+ "sessionId": "<your client's id for this run>",
481
+ "promises": [
482
+ "I write drafts only. I publish nothing.",
483
+ "I send no email to any customer.",
484
+ "I do not open customer records.",
485
+ "I spend no ad budget."
486
+ ],
487
+ "agentName": "Marketing agent - summer sale"
488
+ }
489
+ ```
490
+
491
+ **`sessionId` is the key the gate reads the contract back by.** Use the id your client reports for this run. If you do not have one, call `list_sessions`, and take the session whose working directory matches yours and whose `lastSeenAt` is newest. Never invent a value, and never reuse one from another run.
492
+
493
+ The result tells you whether you got it right. **`hookSeen: false` means no agent hook has ever reported this session id**, so the gate will look the contract up under a key that does not exist and nothing will be checked, whatever `ratified` says. Fix the id and propose again, or say plainly that the boundary is a promise. `hookSeen` absent means the check could not run, which is not evidence either way.
494
+
495
+ `ratified` and `answered` are separate on purpose. Answered but not ratified means the user declined: ask which boundary they want, and do **not** proceed as if they had agreed. Not answered means no scope is in force.
496
+
497
+ An unanswered proposal returns its `correlationId`. Poll it once; a late phone
498
+ yes ratifies the exact stored proposal. If that poll is still pending, cancel it
499
+ before asking in the current chat whether to continue without an enforced scope.
500
+ If cancellation returns `handoffAction: "stop"`, stop. Otherwise, if cancellation
501
+ returns false, poll once for 1 second and honor the phone answer
502
+ that won the race. A yes in chat is not a server-ratified scope.
503
+
504
+ Omitting `allowedPaths` proposes no path restriction, and the user is told that
505
+ plainly as "this agent is asking to touch anything", so omit it only when you mean
506
+ it.
507
+
508
+ **What enforcement depends on.** The contract is recorded and shown to the user by any MCP client. Actually withdrawing auto-approval from out-of-scope edits needs the Pushary hook installed, which is how Claude Code, Codex and Gemini CLI run. Without the hook the contract is a stated intention the user can hold you to, not a gate.
509
+
510
+ Scope lives for the session only and is never inherited by another run. The server holds it for 12 hours, or until the next `propose_scope` for the same session replaces it.
511
+
512
+ **When not to use it.** A single quick edit does not need a scope. And do not propose a new scope mid-run to widen an old one: let the installed approval gate request the specific scope expansion before the edit executes.
513
+
514
+ ### list_sessions
515
+
516
+ Read-only. Returns the live agent sessions for your site, keyed by machine and
517
+ session, with any approval questions still waiting. Use it to see which of your
518
+ parallel agents is active, idle, waiting or errored. It does NOT start, stop or
519
+ steer an agent, and it sends no notification.
520
+
521
+ Check it before asking when you are one of several agents: if another session is
522
+ already blocked on a question, adding a second one competes for the same
523
+ attention rather than getting you answered sooner.
524
+
525
+ ## Authorization and handoff
526
+
527
+ Honor authorization already granted in this session. Ask only for a missing decision or an action outside that authorization, or when an enforced host policy requires it. A multi-step task alone does not require plan approval. Never ask again merely because the next authorized step deletes, deploys or publishes something. These skills guide the agent; supported hooks and runtime approval gates enforce policy. Do not bypass an enforced gate.
528
+
529
+ Read `answered`, `status` and `handoffAction` (falling back to `nextAction`) on every response. Only `pending` is live; expired, cancelled, missing and unavailable are not new timeouts. Follow the returned handoff rather than inventing a retry loop. Before moving a live question to the current chat, cancel it. If cancellation says `stop`, stop; if it loses a race, poll once for one second and honor the winning answer. Silence is never consent. A select or input value containing “yes” is answer data, not approval of a separate action.
530
+
531
+ Delivery is controlled by the user's policy: `push_first` uses presence, `push_only` requests push every time, `notify_only` leaves the decision in the current client, and `terminal_only` avoids push. Do not override the mode or duplicate a question on every surface. The runtime owns delivery, expiry and settlement; do not claim that a reply can restart an ended agent turn.
532
+
533
+ ## Human-in-the-Loop Flow
534
+
535
+ One tool call - `ask_user` blocks and returns the answer:
536
+
537
+ ```
538
+ result = ask_user({
539
+ question: "Which auth strategy should I use?",
540
+ type: "select",
541
+ options: ["JWT tokens", "Session cookies", "OAuth2 + PKCE"],
542
+ context: "Setting up authentication for the new API",
543
+ agentName: "Claude Code - myproject"
544
+ })
545
+
546
+ if result.answered:
547
+ // result.value = "JWT tokens" - proceed with the chosen approach
548
+ else:
549
+ // follow result.handoffAction when present, otherwise result.nextAction
550
+ ```
551
+
552
+ If the user answers in chat before the push response arrives, call `cancel_question` before acting. If it returns `handoffAction: "stop"`, stop. Otherwise, if it returns false, poll once for 1 second and honor any phone answer that won the race.
553
+
554
+ **How long `ask_user` blocks.** The user sets the delivery mode for their site. You do not set it. The mode decides how long the call waits, and whether it waits at all.
555
+
556
+ | Mode | The phone | The call |
557
+ |---|---|---|
558
+ | **When I'm out** (`push_first`, default) | Asked only when the user is away from the terminal and the Mac | Waits for the push-first window. 45 seconds by default. |
559
+ | **Every time** (`push_only`) | Always asked | Waits for the policy timeout. |
560
+ | **Updates** (`notify_only`) | Told, not asked | Returns at once with `answered: false`. Decide in the current client. |
561
+ | **Terminal** (`terminal_only`) | Nothing is sent | Returns at once with `answered: false`. |
562
+
563
+ Always read `answered`. Never assume the call waited. Pass `timeoutMs` only when you want a shorter wait than the site policy.
564
+
565
+ ## Identifying Your Agent
566
+
567
+ Always pass `agentName` when you are one of multiple possible agents the user may be running. The user sees this in the notification title to know which agent is asking.
568
+
569
+ **Format:** `{Agent Type} - {project or context}`
570
+
571
+ **Examples:**
572
+ - `"Claude Code - pushary repo"`
573
+ - `"Hermes - daily-briefing"`
574
+ - `"Cursor - frontend refactor"`
575
+
576
+ ## Notification Etiquette
577
+
578
+ - **Titles under 60 characters.** They get truncated on phone lock screens.
579
+ - **Bodies under 200 characters.** Concise summaries, not full explanations.
580
+ - **Max 3 notifications per task** unless the user explicitly requests more.
581
+ - **That limit counts pushes only.** Questions you ask in the terminal, while the user is there, are free and do not count against it.
582
+ - **Use context for detail.** Put file lists, error traces, and next steps in the context object - not the notification body.
583
+ - **Write for a busy person.** The user is on their phone, away from the computer. Be exact. "Delete the 3 unused migration files?" beats "Should I clean up?"
584
+ - **Pick the right question type.** Use confirm for binary decisions, select when options are known, input when they are not.
@@ -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.2.3",
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
+ }