jamgate 0.4.0 → 0.4.1

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/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
5
+ import { realpathSync } from "node:fs";
5
6
  import { pathToFileURL } from "node:url";
6
7
  import { VERSION } from "./version.js";
7
8
  import { FileStore } from "./store/fileStore.js";
@@ -229,8 +230,25 @@ async function main() {
229
230
  // stdout is the MCP channel; logs must go to stderr.
230
231
  console.error("jamgate MCP server running on stdio");
231
232
  }
232
- // Only bootstrap stdio when run as the CLI entrypoint, not when imported by a test.
233
- if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
233
+ /** True when this module is the process entrypoint (run as the CLI), not imported by a test.
234
+ * Must compare against the *realpath* of `process.argv[1]`: npm/npx install the bin as a
235
+ * symlink (`node_modules/.bin/jamgate` → the real `dist/index.js`), so `process.argv[1]` is
236
+ * the symlink path while `import.meta.url` is the resolved target. A naive equality check
237
+ * fails there and `main()` never runs — the wizard exits 0 with no output (the 0.4.0 bug).
238
+ * Resolving the symlink first makes both sides the same real file. */
239
+ function isMainEntrypoint() {
240
+ const entry = process.argv[1];
241
+ if (!entry)
242
+ return false;
243
+ try {
244
+ return import.meta.url === pathToFileURL(realpathSync(entry)).href;
245
+ }
246
+ catch {
247
+ // realpathSync throws if the path doesn't exist; fall back to the raw comparison.
248
+ return import.meta.url === pathToFileURL(entry).href;
249
+ }
250
+ }
251
+ if (isMainEntrypoint()) {
234
252
  main().catch((err) => {
235
253
  console.error("jamgate fatal:", err);
236
254
  process.exit(1);
package/dist/version.js CHANGED
@@ -6,4 +6,4 @@
6
6
  * the same number without importing `package.json` at runtime (which would break once the
7
7
  * code is bundled or the file layout changes between `dist/` and the published package).
8
8
  */
9
- export const VERSION = "0.4.0";
9
+ export const VERSION = "0.4.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamgate",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "mcpName": "io.github.amirj4m/jamgate",
5
5
  "description": "A neutral, cross-agent memory quality gate for AI agents, delivered as an MCP server — a gate, not a store.",
6
6
  "keywords": [