sticky-note-cli 3.1.24 → 3.1.26

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
@@ -1394,20 +1394,23 @@ function cmdUpdate() {
1394
1394
  print(" [OK] .claude/sticky-note-mcp.js (MCP entry point updated)");
1395
1395
  }
1396
1396
 
1397
- // Migrate .mcp.json to use "node .claude/sticky-note-mcp.js" instead of npx subcommand.
1397
+ // Ensure .mcp.json has a correct sticky-note entry using "node .claude/sticky-note-mcp.js".
1398
1398
  // The old npx approach goes through multiple .cmd shim layers on Windows, causing
1399
1399
  // Claude Code to silently skip the server. The node approach is a direct single process.
1400
1400
  const correctMcpEntry = { type: "stdio", command: "node", args: [".claude/sticky-note-mcp.js"] };
1401
1401
  try {
1402
1402
  const mcpJsonPath = path.join(process.cwd(), ".mcp.json");
1403
- if (fs.existsSync(mcpJsonPath)) {
1404
- const mcpJson = readJsonSafe(mcpJsonPath, {});
1405
- const projectEntry = mcpJson.mcpServers && mcpJson.mcpServers["sticky-note"];
1406
- if (projectEntry && (projectEntry.command !== "node" || JSON.stringify(projectEntry.args) !== JSON.stringify(correctMcpEntry.args))) {
1407
- mcpJson.mcpServers["sticky-note"] = correctMcpEntry;
1408
- fs.writeFileSync(mcpJsonPath, JSON.stringify(mcpJson, null, 2) + "\n");
1409
- print(" [OK] .mcp.json: migrated sticky-note to direct node invocation (Windows MCP fix)");
1410
- }
1403
+ const mcpJson = fs.existsSync(mcpJsonPath) ? readJsonSafe(mcpJsonPath, {}) : {};
1404
+ if (!mcpJson.mcpServers) mcpJson.mcpServers = {};
1405
+ const projectEntry = mcpJson.mcpServers["sticky-note"];
1406
+ if (!projectEntry) {
1407
+ mcpJson.mcpServers["sticky-note"] = correctMcpEntry;
1408
+ fs.writeFileSync(mcpJsonPath, JSON.stringify(mcpJson, null, 2) + "\n");
1409
+ print(" [OK] .mcp.json: added sticky-note MCP entry");
1410
+ } else if (projectEntry.command !== "node" || JSON.stringify(projectEntry.args) !== JSON.stringify(correctMcpEntry.args)) {
1411
+ mcpJson.mcpServers["sticky-note"] = correctMcpEntry;
1412
+ fs.writeFileSync(mcpJsonPath, JSON.stringify(mcpJson, null, 2) + "\n");
1413
+ print(" [OK] .mcp.json: migrated sticky-note to direct node invocation (Windows MCP fix)");
1411
1414
  }
1412
1415
  } catch (_) { /* non-fatal */ }
1413
1416
 
@@ -1423,6 +1426,46 @@ function cmdUpdate() {
1423
1426
  }
1424
1427
  } catch (_) { /* non-fatal */ }
1425
1428
 
1429
+ // Create environment directory if missing (idempotent — skips if manifest already exists)
1430
+ const envDir = path.join(stickyDir, "environment");
1431
+ const envManifestDest = path.join(envDir, "manifest.json");
1432
+ mkdirSafe(path.join(envDir, "skills"));
1433
+ mkdirSafe(path.join(envDir, "agents"));
1434
+ mkdirSafe(path.join(envDir, "commands"));
1435
+ if (!fs.existsSync(envManifestDest)) {
1436
+ const detectedServers = Array.from(detectMcpServers().values());
1437
+ const manifestData = { version: "1", mcp_servers: {}, permissions: [], env_vars: {} };
1438
+ for (const server of detectedServers) {
1439
+ const entry = { type: server.type || "stdio", description: server.name, required: false };
1440
+ if (server.command) entry.command = server.command;
1441
+ if (server.args) entry.args = server.args;
1442
+ if (server.env) {
1443
+ entry.env = {};
1444
+ for (const [k] of Object.entries(server.env)) {
1445
+ entry.env[k] = `\${${k}}`;
1446
+ manifestData.env_vars[k] = { description: k, required: true };
1447
+ }
1448
+ }
1449
+ manifestData.mcp_servers[server.name] = entry;
1450
+ }
1451
+ const detectedSkills = Array.from(detectSkills());
1452
+ for (const skillName of detectedSkills) {
1453
+ const claudeSkillPath = path.join(process.cwd(), ".claude", "plugins");
1454
+ const possibleSkillPaths = [
1455
+ path.join(claudeSkillPath, skillName, "SKILL.md"),
1456
+ path.join(claudeSkillPath, skillName, "skills", skillName, "SKILL.md"),
1457
+ ];
1458
+ for (const sp of possibleSkillPaths) {
1459
+ if (fs.existsSync(sp)) {
1460
+ fs.copyFileSync(sp, path.join(envDir, "skills", skillName + ".md"));
1461
+ break;
1462
+ }
1463
+ }
1464
+ }
1465
+ fs.writeFileSync(envManifestDest, JSON.stringify(manifestData, null, 2) + "\n");
1466
+ print(` [OK] Created .sticky-note/environment/ (${detectedServers.length} MCP server(s) detected)`);
1467
+ }
1468
+
1426
1469
  print(`\n ✨ Scripts updated to v${VERSION}`);
1427
1470
 
1428
1471
  // 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.24",
3
+ "version": "3.1.26",
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": {
@@ -2,4 +2,7 @@
2
2
  // sticky-note MCP server entry point
3
3
  // Auto-generated by sticky-note-cli init/update. Do not edit manually.
4
4
  // Runs the sticky-note MCP server in-process using the installed package.
5
+ // Injects --project so the server always reads from this project's root,
6
+ // regardless of the CWD Claude Code uses when spawning the MCP process.
7
+ process.argv.push("--project", require("path").resolve(__dirname, ".."));
5
8
  require("sticky-note-cli/bin/mcp-server.js");