sticky-note-cli 3.1.22 → 3.1.23

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/mcp-server.js CHANGED
@@ -959,54 +959,57 @@ async function handleRequest(msg) {
959
959
  // stdio transport
960
960
  // ──────────────────────────────────────────────
961
961
 
962
- (async () => {
963
- await initCloudCache();
962
+ // Set up stdin listeners immediately so Claude Code's initialize handshake
963
+ // is answered right away — before any async cloud pre-warming, which can
964
+ // block for up to 5 s and cause the MCP client to time out the connection.
965
+ let buffer = "";
964
966
 
965
- let buffer = "";
967
+ process.stdin.setEncoding("utf-8");
968
+ process.stdin.on("data", (chunk) => {
969
+ buffer += chunk;
966
970
 
967
- process.stdin.setEncoding("utf-8");
968
- process.stdin.on("data", (chunk) => {
969
- buffer += chunk;
971
+ let newlineIdx;
972
+ while ((newlineIdx = buffer.indexOf("\n")) !== -1) {
973
+ const line = buffer.slice(0, newlineIdx).trim();
974
+ buffer = buffer.slice(newlineIdx + 1);
970
975
 
971
- let newlineIdx;
972
- while ((newlineIdx = buffer.indexOf("\n")) !== -1) {
973
- const line = buffer.slice(0, newlineIdx).trim();
974
- buffer = buffer.slice(newlineIdx + 1);
976
+ if (!line) continue;
975
977
 
976
- if (!line) continue;
978
+ let msg;
979
+ try {
980
+ msg = JSON.parse(line);
981
+ } catch {
982
+ const errResp = {
983
+ jsonrpc: "2.0",
984
+ id: null,
985
+ error: { code: -32700, message: "Parse error" },
986
+ };
987
+ process.stdout.write(JSON.stringify(errResp) + "\n");
988
+ continue;
989
+ }
977
990
 
978
- let msg;
979
- try {
980
- msg = JSON.parse(line);
981
- } catch {
982
- const errResp = {
983
- jsonrpc: "2.0",
984
- id: null,
985
- error: { code: -32700, message: "Parse error" },
986
- };
987
- process.stdout.write(JSON.stringify(errResp) + "\n");
988
- continue;
991
+ handleRequest(msg).then((response) => {
992
+ if (response) {
993
+ process.stdout.write(JSON.stringify(response) + "\n");
989
994
  }
995
+ }).catch((err) => {
996
+ process.stdout.write(JSON.stringify({
997
+ jsonrpc: "2.0",
998
+ id: msg.id,
999
+ error: { code: -32603, message: `Internal error: ${err.message}` },
1000
+ }) + "\n");
1001
+ });
1002
+ }
1003
+ });
990
1004
 
991
- handleRequest(msg).then((response) => {
992
- if (response) {
993
- process.stdout.write(JSON.stringify(response) + "\n");
994
- }
995
- }).catch((err) => {
996
- process.stdout.write(JSON.stringify({
997
- jsonrpc: "2.0",
998
- id: msg.id,
999
- error: { code: -32603, message: `Internal error: ${err.message}` },
1000
- }) + "\n");
1001
- });
1002
- }
1003
- });
1005
+ process.stdin.on("end", () => {
1006
+ process.exit(0);
1007
+ });
1004
1008
 
1005
- process.stdin.on("end", () => {
1006
- process.exit(0);
1007
- });
1009
+ process.on("uncaughtException", (err) => {
1010
+ process.stderr.write(`sticky-note MCP server error: ${err.message}\n`);
1011
+ });
1008
1012
 
1009
- process.on("uncaughtException", (err) => {
1010
- process.stderr.write(`sticky-note MCP server error: ${err.message}\n`);
1011
- });
1012
- })();
1013
+ // Pre-warm cloud cache in the background; tool handlers fall back to local
1014
+ // data if this hasn't finished yet when the first call arrives.
1015
+ initCloudCache().catch(() => {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sticky-note-cli",
3
- "version": "3.1.22",
3
+ "version": "3.1.23",
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": {