@pushary/agent-hooks 0.2.2 → 0.2.3

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.
@@ -95,30 +95,27 @@ var sendTestNotification = async (apiKey) => {
95
95
  console.log(`
96
96
  ${bold("Sending test notification...")}`);
97
97
  try {
98
- const response = await fetch("https://pushary.com/api/mcp/mcp", {
98
+ const response = await fetch("https://pushary.com/api/v1/server/send", {
99
99
  method: "POST",
100
100
  headers: {
101
101
  "Content-Type": "application/json",
102
- Authorization: `Bearer ${apiKey}`
102
+ "x-api-key": apiKey
103
103
  },
104
104
  body: JSON.stringify({
105
- jsonrpc: "2.0",
106
- id: 1,
107
- method: "tools/call",
108
- params: {
109
- name: "send_notification",
110
- arguments: {
111
- title: "Pushary is working",
112
- body: "Your AI agent can now send you push notifications.",
113
- agentName: "Pushary Setup"
114
- }
115
- }
105
+ title: "Pushary is working",
106
+ body: "Your AI agent can now send you push notifications."
116
107
  })
117
108
  });
118
109
  if (response.ok) {
119
- console.log(` ${green("done")} Check your phone!`);
110
+ const data = await response.json();
111
+ if (data.delivered && data.delivered > 0) {
112
+ console.log(` ${green("done")} Check your phone!`);
113
+ } else {
114
+ console.log(` ${dim("Notification sent but no subscribers found. Enable notifications on your phone at pushary.com first.")}`);
115
+ }
120
116
  } else {
121
- console.log(` ${dim("Could not send test notification. Make sure you enabled notifications at pushary.com")}`);
117
+ const err = await response.json().catch(() => ({}));
118
+ console.log(` ${dim(`Could not send: ${err.error ?? response.statusText}. Make sure you enabled notifications at pushary.com`)}`);
122
119
  }
123
120
  } catch {
124
121
  console.log(` ${dim("Could not reach Pushary API. Check your internet connection.")}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Permission hooks for AI coding agents — route tool approvals through Pushary push notifications",
5
5
  "author": "Pushary <business@pushary.com>",
6
6
  "homepage": "https://pushary.com",