@agentvalet/mcp-server 1.12.0 → 1.12.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.
Files changed (2) hide show
  1. package/dist/index.js +26 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,11 +1,36 @@
1
1
  #!/usr/bin/env node
2
+ // Builtin, hoisted above the diagnostics below on purpose: node:module cannot
3
+ // fail to resolve, so importing it does not weaken the "banner prints no matter
4
+ // what" guarantee the way a package or local import would.
5
+ import { createRequire } from "node:module";
2
6
  // ── BOOT DIAGNOSTICS — must be FIRST executable code ─────────────────────
3
7
  // Claude Desktop captures whatever the MCP server writes to stderr before
4
8
  // the stdio transport handshake. If startup crashes silently (top-level
5
9
  // await rejection, import error, unhandled native crash), Claude Desktop
6
10
  // only logs "Server transport closed unexpectedly" with no detail. These
7
11
  // handlers guarantee a stack lands in the log no matter what fails next.
8
- process.stderr.write(`[mcp-server] boot v0.2.x | node=${process.version} | platform=${process.platform} | ` +
12
+ //
13
+ // The version below is READ, never written here. It was the literal "v0.2.x"
14
+ // and stayed frozen through every release since — so the one place a running
15
+ // server states its own build reported a version it had not been for a year.
16
+ // That misleads exactly when it is hardest to check another way: an operator
17
+ // reading a stdio log, asking whether this session picked up the release they
18
+ // just published. Resolved with builtins only and wrapped, because the rule
19
+ // above is absolute — finding the version must never be the thing that stops
20
+ // the banner from printing.
21
+ const BOOT_VERSION = (() => {
22
+ try {
23
+ // dist/index.js → ../package.json and src/index.ts → ../package.json both
24
+ // land on the package root, so this holds for the published build and for
25
+ // running straight from source.
26
+ const pkg = createRequire(import.meta.url)("../package.json");
27
+ return typeof pkg.version === "string" ? pkg.version : "unknown";
28
+ }
29
+ catch {
30
+ return "unknown";
31
+ }
32
+ })();
33
+ process.stderr.write(`[mcp-server] boot v${BOOT_VERSION} | node=${process.version} | platform=${process.platform} | ` +
9
34
  `env_keys=${Object.keys(process.env).filter((k) => k.startsWith("AGENT_") || k === "OWNER_ID" || k === "PROXY_URL" || k === "INVITE_BIND_SECRET").join(",") || "(none of expected)"}\n`);
10
35
  process.on("uncaughtException", (err) => {
11
36
  process.stderr.write(`[mcp-server] FATAL uncaughtException: ${err instanceof Error ? err.stack ?? err.message : String(err)}\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvalet/mcp-server",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "AgentValet MCP server — lets AI agents call approved platforms via the AgentValet proxy",
5
5
  "mcpName": "io.github.agentvalet/mcp-server",
6
6
  "type": "module",