mirror of
https://github.com/morluto/rea
synced 2026-10-27 14:42:18 -04:00
fix(setup): register explicit MCP runtimes and preserve launcher identity
This commit is contained in:
@@ -1,13 +1,21 @@
|
||||
import { resolve } from "node:path";
|
||||
import {
|
||||
javaScriptRuntime,
|
||||
type JavaScriptRuntime,
|
||||
} from "../domain/runtimeVersion.js";
|
||||
import { absoluteCallerPath } from "../filesystem/callerPath.js";
|
||||
|
||||
/** Node's absolute argv script selection, or undefined when none was supplied.
|
||||
/** Runtime-specific absolute argv script selection, or undefined when none was supplied.
|
||||
* Native executable paths have different traversal semantics and must not use this.
|
||||
*/
|
||||
export const normalizeEntrypointPath = (
|
||||
entrypoint: string | undefined,
|
||||
runtime: JavaScriptRuntime["id"] = javaScriptRuntime(process.versions).id,
|
||||
): string | undefined =>
|
||||
entrypoint === undefined || entrypoint.length === 0
|
||||
? undefined
|
||||
: resolve(entrypoint);
|
||||
: runtime === "bun"
|
||||
? absoluteCallerPath(entrypoint)
|
||||
: resolve(entrypoint);
|
||||
|
||||
export const CURRENT_ENTRYPOINT_PATH = normalizeEntrypointPath(process.argv[1]);
|
||||
|
||||
Reference in New Issue
Block a user