Bundled builds (the CLI bundle and the MCP server bundle, which inlines core)
get it injected at bundle time. That matters for the MCP server: its argv[1]
is the mcp-server bundle, so the package.json lookup below would return the
mcp-server version, never equal to the core version the dashboard server
records in its PID file (#1732).
Unbundled runs fall back to package.json relative to the running entry point.
Resolves ../package.json from the real path of process.argv[1] (the bundle
entry point). An npm install runs the CLI through the node_modules/.bin/oss-autopilot
symlink, and Node leaves process.argv[1] as the symlink, so without realpathSync
the lookup lands on node_modules/package.json and every caller sees 0.0.0 (#1664).
Falls back to '0.0.0' if the file is unreadable.
Return the @oss-autopilot/core version.
Bundled builds (the CLI bundle and the MCP server bundle, which inlines core) get it injected at bundle time. That matters for the MCP server: its argv[1] is the mcp-server bundle, so the package.json lookup below would return the mcp-server version, never equal to the core version the dashboard server records in its PID file (#1732).
Unbundled runs fall back to package.json relative to the running entry point. Resolves
../package.jsonfrom the real path ofprocess.argv[1](the bundle entry point). An npm install runs the CLI through thenode_modules/.bin/oss-autopilotsymlink, and Node leavesprocess.argv[1]as the symlink, so withoutrealpathSyncthe lookup lands onnode_modules/package.jsonand every caller sees0.0.0(#1664). Falls back to '0.0.0' if the file is unreadable.