sticky-note-cli 3.1.18 → 3.1.20

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/bin/cli.js CHANGED
@@ -118,6 +118,12 @@ function findStaleHookPaths(settings) {
118
118
  if (/^npx\s+sticky-note\s+run-hook\s+\S+/.test(cmd)) {
119
119
  stale.push(cmd);
120
120
  }
121
+ // Old `node ".claude/hooks/X.js"` — relative to CWD, breaks in subdirectories
122
+ // and agent worktrees. Replaced by `npx --no sticky-note-cli run-hook X`
123
+ // which walks up the tree to find the hooks directory.
124
+ if (/^node\s+"?\.claude\/hooks\//.test(cmd)) {
125
+ stale.push(cmd);
126
+ }
121
127
  }
122
128
  }
123
129
  }
@@ -1143,7 +1149,7 @@ async function cmdInit() {
1143
1149
  const stickyMcpEntry = {
1144
1150
  type: "stdio",
1145
1151
  command: "npx",
1146
- args: ["-y", "-p", "sticky-note-cli", "sticky-note", "mcp-server"],
1152
+ args: ["-y", "sticky-note-cli", "mcp-server"],
1147
1153
  tools: ["*"],
1148
1154
  };
1149
1155
  if (ensureMcpInCopilotCliConfig("sticky-note", stickyMcpEntry)) {
@@ -1162,14 +1168,15 @@ async function cmdInit() {
1162
1168
  try {
1163
1169
  const claudeGlobal = readJsonSafe(claudeGlobalSettingsPath, {});
1164
1170
  if (!claudeGlobal.mcpServers) claudeGlobal.mcpServers = {};
1165
- if (!claudeGlobal.mcpServers["sticky-note"]) {
1166
- claudeGlobal.mcpServers["sticky-note"] = {
1167
- type: "stdio",
1168
- command: "npx",
1169
- args: ["-y", "-p", "sticky-note-cli", "sticky-note", "mcp-server"],
1170
- };
1171
+ const correctMcpEntry = { type: "stdio", command: "npx", args: ["-y", "sticky-note-cli", "mcp-server"] };
1172
+ const existing = claudeGlobal.mcpServers["sticky-note"];
1173
+ const isStale = existing && JSON.stringify(existing.args) !== JSON.stringify(correctMcpEntry.args);
1174
+ if (!existing || isStale) {
1175
+ claudeGlobal.mcpServers["sticky-note"] = correctMcpEntry;
1171
1176
  fs.writeFileSync(claudeGlobalSettingsPath, JSON.stringify(claudeGlobal, null, 2) + "\n");
1172
- print(" [OK] Registered sticky-note MCP server in ~/.claude/settings.json (Claude Code)");
1177
+ print(isStale
1178
+ ? " [OK] Updated sticky-note MCP entry in ~/.claude/settings.json (fixed args)"
1179
+ : " [OK] Registered sticky-note MCP server in ~/.claude/settings.json (Claude Code)");
1173
1180
  } else {
1174
1181
  print(" ⏭️ sticky-note already registered in ~/.claude/settings.json");
1175
1182
  }
@@ -1357,6 +1364,18 @@ function cmdUpdate() {
1357
1364
  // non-fatal
1358
1365
  }
1359
1366
 
1367
+ // Fix stale MCP entry in ~/.claude/settings.json (old -p flag broke Windows)
1368
+ try {
1369
+ const globalSettingsPath = path.join(os.homedir(), ".claude", "settings.json");
1370
+ const globalSettings = readJsonSafe(globalSettingsPath, {});
1371
+ const mcpEntry = globalSettings.mcpServers && globalSettings.mcpServers["sticky-note"];
1372
+ if (mcpEntry && JSON.stringify(mcpEntry.args).includes("-p")) {
1373
+ globalSettings.mcpServers["sticky-note"].args = ["-y", "sticky-note-cli", "mcp-server"];
1374
+ fs.writeFileSync(globalSettingsPath, JSON.stringify(globalSettings, null, 2) + "\n");
1375
+ print(" [OK] ~/.claude/settings.json: fixed sticky-note MCP args (Windows compat)");
1376
+ }
1377
+ } catch (_) { /* non-fatal */ }
1378
+
1360
1379
  print(`\n ✨ Scripts updated to v${VERSION}`);
1361
1380
 
1362
1381
  // Update instruction files (section-based: only replaces between markers)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sticky-note-cli",
3
- "version": "3.1.18",
3
+ "version": "3.1.20",
4
4
  "description": "Human-to-human handoff for AI coding assistants. Git-backed shared memory for Claude Code and Copilot CLI.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -6,7 +6,7 @@
6
6
  "hooks": [
7
7
  {
8
8
  "type": "command",
9
- "command": "node \".claude/hooks/session-start.js\""
9
+ "command": "npx --no sticky-note-cli run-hook session-start"
10
10
  }
11
11
  ]
12
12
  }
@@ -17,7 +17,7 @@
17
17
  "hooks": [
18
18
  {
19
19
  "type": "command",
20
- "command": "node \".claude/hooks/session-end.js\""
20
+ "command": "npx --no sticky-note-cli run-hook session-end"
21
21
  }
22
22
  ]
23
23
  }
@@ -28,7 +28,7 @@
28
28
  "hooks": [
29
29
  {
30
30
  "type": "command",
31
- "command": "node \".claude/hooks/inject-context.js\""
31
+ "command": "npx --no sticky-note-cli run-hook inject-context"
32
32
  }
33
33
  ]
34
34
  }
@@ -39,7 +39,7 @@
39
39
  "hooks": [
40
40
  {
41
41
  "type": "command",
42
- "command": "node \".claude/hooks/pre-tool-use.js\""
42
+ "command": "npx --no sticky-note-cli run-hook pre-tool-use"
43
43
  }
44
44
  ]
45
45
  }
@@ -50,7 +50,7 @@
50
50
  "hooks": [
51
51
  {
52
52
  "type": "command",
53
- "command": "node \".claude/hooks/track-work.js\""
53
+ "command": "npx --no sticky-note-cli run-hook track-work"
54
54
  }
55
55
  ]
56
56
  }
@@ -61,7 +61,7 @@
61
61
  "hooks": [
62
62
  {
63
63
  "type": "command",
64
- "command": "node \".claude/hooks/on-stop.js\""
64
+ "command": "npx --no sticky-note-cli run-hook on-stop"
65
65
  }
66
66
  ]
67
67
  }
@@ -72,7 +72,7 @@
72
72
  "hooks": [
73
73
  {
74
74
  "type": "command",
75
- "command": "node \".claude/hooks/on-error.js\""
75
+ "command": "npx --no sticky-note-cli run-hook on-error"
76
76
  }
77
77
  ]
78
78
  }