@trygocode/notify 0.3.2 → 0.3.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.
- package/dist/src/claude.js +7 -2
- package/dist/src/cursor.js +9 -1
- package/dist/src/on_stop.js +11 -1
- package/dist/src/opencode.js +4 -1
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/dist/src/claude.js
CHANGED
|
@@ -56,9 +56,14 @@ export const MCP_SERVER_ENTRY = {
|
|
|
56
56
|
* We intentionally register ONLY `Stop` + `Notification`. `SubagentStop` is NOT
|
|
57
57
|
* here on purpose — see {@link SUBAGENT_STOP_EVENT}.
|
|
58
58
|
*/
|
|
59
|
+
// `@latest` is REQUIRED: bare `npx -y @trygocode/notify` caches the
|
|
60
|
+
// first-resolved version forever and never auto-updates (npm/cli#6664). Pinning
|
|
61
|
+
// `@latest` makes every hook fire the newest published version, so users get our
|
|
62
|
+
// fixes without ever clearing their npx cache by hand. Matchers below key on the
|
|
63
|
+
// `@trygocode/notify` substring, which `@latest` preserves.
|
|
59
64
|
export const CLAUDE_HOOK_COMMANDS = {
|
|
60
|
-
Stop: 'npx -y @trygocode/notify on-stop --source claude_code --dedupe-key "$CLAUDE_SESSION_ID-stop" || true',
|
|
61
|
-
Notification: 'npx -y @trygocode/notify send --kind awaiting_input --source claude_code --title "Agent needs you" --dedupe-key "$CLAUDE_SESSION_ID-notify" || true',
|
|
65
|
+
Stop: 'npx -y @trygocode/notify@latest on-stop --source claude_code --dedupe-key "$CLAUDE_SESSION_ID-stop" || true',
|
|
66
|
+
Notification: 'npx -y @trygocode/notify@latest send --kind awaiting_input --source claude_code --title "Agent needs you" --dedupe-key "$CLAUDE_SESSION_ID-notify" || true',
|
|
62
67
|
};
|
|
63
68
|
/**
|
|
64
69
|
* The Claude event we DELIBERATELY do not register and actively scrub on every
|
package/dist/src/cursor.js
CHANGED
|
@@ -48,7 +48,15 @@ export const MCP_SERVER_ENTRY = {
|
|
|
48
48
|
* both old and new commands contain the {@link HOOK_MARKERS} tokens, so an old
|
|
49
49
|
* install still upgrades idempotently and uninstalls cleanly (PRD §2.2).
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
// `@latest` is REQUIRED, not cosmetic: bare `npx -y @trygocode/notify` caches the
|
|
52
|
+
// first-resolved version FOREVER and never picks up a newer publish (documented
|
|
53
|
+
// npx behaviour — npm/cli#6664; the whole `clear-npx-cache` package exists for
|
|
54
|
+
// this). Without `@latest`, a user who installed an old version would keep
|
|
55
|
+
// running it after we ship a fix, with no way to update short of wiping
|
|
56
|
+
// ~/.npm/_npx by hand. Pinning `@latest` forces npx to resolve the newest
|
|
57
|
+
// version on every turn, so users self-update seamlessly. (Matchers below key on
|
|
58
|
+
// the `@trygocode/notify` substring, which `@latest` preserves.)
|
|
59
|
+
export const CURSOR_STOP_COMMAND = "npx -y @trygocode/notify@latest on-stop --source cursor --dedupe-key cursor-stop || true";
|
|
52
60
|
/**
|
|
53
61
|
* Substrings that together identify a `stop` hook entry as OURS. Used for
|
|
54
62
|
* idempotent merge (replace, don't duplicate) and for surgical uninstall (remove
|
package/dist/src/on_stop.js
CHANGED
|
@@ -238,7 +238,17 @@ export function ideChatIdFromHookStdin(source, cwd, hookStdin) {
|
|
|
238
238
|
const ideSessionId = str(p.conversation_id, p.conversationId, p.session_id, p.sessionId, sessionFromPath);
|
|
239
239
|
if (!ideSessionId)
|
|
240
240
|
return undefined;
|
|
241
|
-
|
|
241
|
+
// CRITICAL parity: the deep-link id hashes the workspace, and gocode-sync hashes
|
|
242
|
+
// the SAME workspace when it stores the chat — they MUST agree or a tapped push
|
|
243
|
+
// hits "Chat not found". gocode-sync resolves the workspace from Cursor's REAL
|
|
244
|
+
// field `workspace_roots` (snake_case), so we MUST read it here too. Reuse
|
|
245
|
+
// workspaceRootFromHookStdin (which already prefers workspace_roots and every
|
|
246
|
+
// spelling) so the two packages can never drift. Fall back to camelCase / cwd
|
|
247
|
+
// for older Cursor builds, then the process cwd.
|
|
248
|
+
const workspacePath = workspaceRootFromHookStdin(hookStdin) ??
|
|
249
|
+
str(p.workspace_path, Array.isArray(p.workspace_roots)
|
|
250
|
+
? p.workspace_roots[0]
|
|
251
|
+
: undefined, Array.isArray(p.workspaceRoots) ? p.workspaceRoots[0] : undefined, p.cwd, cwd);
|
|
242
252
|
if (!workspacePath)
|
|
243
253
|
return undefined;
|
|
244
254
|
// The capture side stores `source: "cursor" | "claude_code"`; the hook passes
|
package/dist/src/opencode.js
CHANGED
|
@@ -68,7 +68,10 @@ export const OPENCODE_MCP_ENTRY = {
|
|
|
68
68
|
* Claude/Cursor. Ends in `|| true` so a failure can never block the session, and
|
|
69
69
|
* carries a `--dedupe-key` so overlapping triggers coalesce server-side.
|
|
70
70
|
*/
|
|
71
|
-
|
|
71
|
+
// `@latest` is REQUIRED: bare `npx -y @trygocode/notify` caches the first
|
|
72
|
+
// resolved version forever and never auto-updates (npm/cli#6664). Pinning
|
|
73
|
+
// `@latest` makes the hook always fetch the newest publish so users self-update.
|
|
74
|
+
export const OPENCODE_STOP_COMMAND = "npx -y @trygocode/notify@latest on-stop --source opencode --dedupe-key opencode-idle || true";
|
|
72
75
|
/**
|
|
73
76
|
* Substrings that together identify our plugin file as OURS. Used to keep
|
|
74
77
|
* uninstall surgical: we only delete the plugin file when BOTH markers are
|
package/dist/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Single source of truth for the CLI version. Keep in sync with package.json.
|
|
2
|
-
export const VERSION = "0.3.
|
|
2
|
+
export const VERSION = "0.3.3";
|
package/package.json
CHANGED