mirror of
https://github.com/morluto/rea.git
synced 2026-11-19 05:02:40 +00:00
fix(setup): register explicit MCP runtimes and preserve launcher identity
This commit is contained in:
1 parent
b8ce3c74cd
commit
d69a54d592
19 files changed
+637
-100
No files matched your search
@@ -12,6 +12,7 @@ import { PRODUCT_IDENTITY } from "../identity.js";
|
||||
import {
|
||||
invokingPackageRunner,
|
||||
registrationEntrypointPath,
|
||||
registrationRuntimePath,
|
||||
packageRunnerRegistrationCommand,
|
||||
type PackageRunner,
|
||||
} from "./ClientRegistrationIdentity.js";
|
||||
@@ -21,6 +22,7 @@ import {
|
||||
} from "./SetupRegistrationPrewarm.js";
|
||||
import {
|
||||
SUPPORTED_NODE_VERSION_PROSE,
|
||||
javaScriptRuntime,
|
||||
supportsNodeVersion,
|
||||
} from "../domain/runtimeVersion.js";
|
||||
import {
|
||||
@@ -91,12 +93,20 @@ export const setupRegistrationCommand = (
|
||||
if (packageRunner !== undefined)
|
||||
return packageRunnerRegistrationCommand(packageRunner, platform);
|
||||
if (entrypointPath === undefined || entrypointPath.length === 0) return [];
|
||||
return platform === "win32"
|
||||
? [process.execPath, entrypointPath, "mcp"]
|
||||
: [
|
||||
registrationEntrypointPath(entrypointPath, environment, platform),
|
||||
"mcp",
|
||||
];
|
||||
const script = registrationEntrypointPath(
|
||||
entrypointPath,
|
||||
environment,
|
||||
platform,
|
||||
);
|
||||
const runtime = registrationRuntimePath(
|
||||
process.execPath,
|
||||
javaScriptRuntime(process.versions).id,
|
||||
environment,
|
||||
platform,
|
||||
);
|
||||
// The script's env-node shebang depends on the client's PATH, which may
|
||||
// differ from setup's shell. Bind the runtime that is executing setup.
|
||||
return [runtime, script, "mcp"];
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user