sticky-note-cli 3.1.21 → 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/cli.js +4 -10
- package/bin/mcp-server.js +45 -42
- package/package.json +1 -1
- package/sticky-server/.wrangler/state/v3/observability/miniflare-wobs-trace-store/a590acd76969f996ec6e4b599c3c09f58c283a76f2d61392b5d3046caf557602.sqlite +0 -0
- package/sticky-server/.wrangler/state/v3/observability/miniflare-wobs-trace-store/a590acd76969f996ec6e4b599c3c09f58c283a76f2d61392b5d3046caf557602.sqlite-shm +0 -0
- package/sticky-server/.wrangler/state/v3/observability/miniflare-wobs-trace-store/a590acd76969f996ec6e4b599c3c09f58c283a76f2d61392b5d3046caf557602.sqlite-wal +0 -0
package/bin/cli.js
CHANGED
|
@@ -3797,16 +3797,10 @@ function cmdMcpServer() {
|
|
|
3797
3797
|
print(" [ERR] mcp-server.js not found");
|
|
3798
3798
|
process.exit(1);
|
|
3799
3799
|
}
|
|
3800
|
-
//
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
execFileSync(process.execPath, [mcpServerPath, ...args], {
|
|
3805
|
-
stdio: "inherit",
|
|
3806
|
-
});
|
|
3807
|
-
} catch (err) {
|
|
3808
|
-
if (err.status) process.exit(err.status);
|
|
3809
|
-
}
|
|
3800
|
+
// Run mcp-server.js in-process to avoid stdio pipe inheritance issues on Windows.
|
|
3801
|
+
// Inject --project <cwd> so the server knows which project to serve.
|
|
3802
|
+
process.argv = [process.argv[0], mcpServerPath, "--project", process.cwd(), ...process.argv.slice(3)];
|
|
3803
|
+
require(mcpServerPath);
|
|
3810
3804
|
}
|
|
3811
3805
|
|
|
3812
3806
|
// ──────────────────────────────────────────────
|
package/bin/mcp-server.js
CHANGED
|
@@ -959,54 +959,57 @@ async function handleRequest(msg) {
|
|
|
959
959
|
// stdio transport
|
|
960
960
|
// ──────────────────────────────────────────────
|
|
961
961
|
|
|
962
|
-
|
|
963
|
-
|
|
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
|
-
|
|
967
|
+
process.stdin.setEncoding("utf-8");
|
|
968
|
+
process.stdin.on("data", (chunk) => {
|
|
969
|
+
buffer += chunk;
|
|
966
970
|
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
buffer
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
979
|
-
|
|
980
|
-
|
|
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
|
-
|
|
992
|
-
|
|
993
|
-
|
|
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
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1009
|
+
process.on("uncaughtException", (err) => {
|
|
1010
|
+
process.stderr.write(`sticky-note MCP server error: ${err.message}\n`);
|
|
1011
|
+
});
|
|
1008
1012
|
|
|
1009
|
-
|
|
1010
|
-
|
|
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
|
Binary file
|
|
Binary file
|