@trygocode/notify 0.1.1 → 0.1.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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to `@trygocode/notify` are documented here. This project
4
4
  follows [Semantic Versioning](https://semver.org).
5
5
 
6
+ ## [0.1.2] — 2026-06-04
7
+
8
+ ### Fixed
9
+ - **Hooks now work without a global install.** The Cursor `stop` hook and the
10
+ Claude Code `Stop`/`Notification`/`SubagentStop` hooks (and the Ralph/Homer
11
+ loop snippet) shelled out to a bare `gocode-notify send …`, which only
12
+ resolves when the package is installed globally on `PATH`. After an
13
+ `npx @trygocode/notify setup` (the documented flow) the binary was NOT on
14
+ `PATH`, so every hook silently failed (the `|| true` guard hid it) and no
15
+ phone notification was ever sent on agent completion. The hooks now invoke
16
+ `npx -y @trygocode/notify send …`, matching the MCP entry's invocation form,
17
+ so they work out of the box with zero global footprint. The idempotent
18
+ merge/uninstall markers were widened to `notify send` so they detect and
19
+ cleanly replace BOTH the new form and any legacy bare-command hook from an
20
+ older install.
21
+
6
22
  ## [0.1.1] — 2026-06-03
7
23
 
8
24
  ### Changed
package/README.md CHANGED
@@ -180,9 +180,9 @@ completion/halt path:
180
180
 
181
181
  ```bash
182
182
  # At loop completion:
183
- gocode-notify send --kind loop_completed --source ralph --project "$(basename "$PWD")" || true
183
+ npx -y @trygocode/notify send --kind loop_completed --source ralph --project "$(basename "$PWD")" || true
184
184
  # At loop halt (paused_max_failures / awaiting_human):
185
- gocode-notify send --kind loop_halted --source ralph --project "$(basename "$PWD")" \
185
+ npx -y @trygocode/notify send --kind loop_halted --source ralph --project "$(basename "$PWD")" \
186
186
  --title "Ralph halted — needs you" || true
187
187
  ```
188
188
 
@@ -42,16 +42,20 @@ export const MCP_SERVER_ENTRY = {
42
42
  * (e.g. Cursor `stop` + Claude `Stop`) coalesce server-side.
43
43
  */
44
44
  export const CLAUDE_HOOK_COMMANDS = {
45
- Stop: 'gocode-notify send --kind finished --source claude_code --dedupe-key "$CLAUDE_SESSION_ID-stop" || true',
46
- Notification: 'gocode-notify send --kind awaiting_input --source claude_code --title "Agent needs you" --dedupe-key "$CLAUDE_SESSION_ID-notify" || true',
47
- SubagentStop: 'gocode-notify send --kind finished --source claude_code --title "Subagent done" --dedupe-key "$CLAUDE_SESSION_ID-subagent" || true',
45
+ Stop: 'npx -y @trygocode/notify send --kind finished --source claude_code --dedupe-key "$CLAUDE_SESSION_ID-stop" || true',
46
+ Notification: 'npx -y @trygocode/notify send --kind awaiting_input --source claude_code --title "Agent needs you" --dedupe-key "$CLAUDE_SESSION_ID-notify" || true',
47
+ SubagentStop: 'npx -y @trygocode/notify send --kind finished --source claude_code --title "Subagent done" --dedupe-key "$CLAUDE_SESSION_ID-subagent" || true',
48
48
  };
49
49
  /**
50
50
  * Substrings that together identify a hook command as OURS. Used for idempotent
51
51
  * merge (replace, don't duplicate) and for surgical uninstall (remove exactly
52
52
  * ours). A command must contain BOTH to be considered ours.
53
+ *
54
+ * `notify send` matches BOTH the current `npx -y @trygocode/notify send …`
55
+ * form AND the legacy bare `gocode-notify send …` form, so upgrading from an
56
+ * older install is detected and cleanly replaced rather than duplicated.
53
57
  */
54
- const HOOK_MARKERS = ["gocode-notify", "--source claude_code"];
58
+ const HOOK_MARKERS = ["notify send", "--source claude_code"];
55
59
  /**
56
60
  * The on-demand skill written to `~/.claude/skills/gocode-notify/SKILL.md`
57
61
  * (PRD §5.5). The crucial content is the anti-double-ping rule: the automatic
@@ -41,13 +41,17 @@ export const MCP_SERVER_ENTRY = {
41
41
  * `--dedupe-key` so overlapping triggers (e.g. Cursor `stop` + Claude `Stop`)
42
42
  * coalesce server-side.
43
43
  */
44
- export const CURSOR_STOP_COMMAND = "gocode-notify send --kind finished --source cursor --dedupe-key cursor-stop || true";
44
+ export const CURSOR_STOP_COMMAND = "npx -y @trygocode/notify send --kind finished --source cursor --dedupe-key cursor-stop || true";
45
45
  /**
46
46
  * Substrings that together identify a `stop` hook entry as OURS. Used for
47
47
  * idempotent merge (replace, don't duplicate) and for surgical uninstall (remove
48
48
  * exactly ours). A command must contain BOTH to be considered ours.
49
+ *
50
+ * `notify send` matches BOTH the current `npx -y @trygocode/notify send …`
51
+ * form AND the legacy bare `gocode-notify send …` form, so an upgrade from an
52
+ * older install is detected and cleanly replaced rather than duplicated.
49
53
  */
50
- const HOOK_MARKERS = ["gocode-notify", "--source cursor"];
54
+ const HOOK_MARKERS = ["notify send", "--source cursor"];
51
55
  /**
52
56
  * The on-demand rule written to `~/.cursor/rules/gocode-notify.md` (PRD §5.5).
53
57
  * The crucial content is the anti-double-ping rule: the automatic pings are
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trygocode/notify",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Free phone notifications for any coding agent (Cursor, Claude Code, OpenCode, Ralph Wiggum / Autopilot loops) via the free GoCode app. One npx command installs the hooks + MCP server.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,8 +14,8 @@
14
14
  # can never block or fail your loop (the CLI also self-times-out in 5s).
15
15
 
16
16
  # --- At loop completion (the loop finished all work cleanly) -----------------
17
- gocode-notify send --kind loop_completed --source ralph --project "$(basename "$PWD")" || true
17
+ npx -y @trygocode/notify send --kind loop_completed --source ralph --project "$(basename "$PWD")" || true
18
18
 
19
19
  # --- At loop halt (paused_max_failures / awaiting_human / question raised) ---
20
- gocode-notify send --kind loop_halted --source ralph --project "$(basename "$PWD")" \
20
+ npx -y @trygocode/notify send --kind loop_halted --source ralph --project "$(basename "$PWD")" \
21
21
  --title "Ralph halted — needs you" || true