fix(npm): use latest entry points without install scripts
This commit is contained in:
@@ -78,7 +78,7 @@ const registrationAligned = (
|
||||
command.length === 4 &&
|
||||
command[0] === "npx" &&
|
||||
command[1] === "-y" &&
|
||||
command[2] === PRODUCT_IDENTITY.packageName &&
|
||||
command[2] === PRODUCT_IDENTITY.packageSpecifier &&
|
||||
command[3] === "mcp"
|
||||
)
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { tmpdir } from "node:os";
|
||||
import { spawn } from "node-pty";
|
||||
|
||||
export type ProcessCaptureCapability =
|
||||
| { readonly available: true; readonly backend: "node-pty" }
|
||||
@@ -13,6 +12,7 @@ export type ProcessCaptureCapability =
|
||||
export const probeProcessCaptureCapability =
|
||||
async (): Promise<ProcessCaptureCapability> => {
|
||||
try {
|
||||
const { spawn } = await import("@lydell/node-pty");
|
||||
const terminal = spawn(
|
||||
process.platform === "win32" ? "cmd.exe" : "/bin/sh",
|
||||
process.platform === "win32" ? ["/c", "exit", "0"] : ["-c", "exit 0"],
|
||||
|
||||
@@ -3,7 +3,7 @@ import { createReadStream } from "node:fs";
|
||||
import { mkdir, mkdtemp, rm } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import type { IPty } from "node-pty";
|
||||
import type { IPty } from "@lydell/node-pty";
|
||||
|
||||
import type {
|
||||
FilesystemCheckpoint,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { spawn, type IPty } from "node-pty";
|
||||
import type { IPty } from "@lydell/node-pty";
|
||||
import type {
|
||||
InteractionEvent,
|
||||
ProcessCapture,
|
||||
@@ -204,6 +204,7 @@ const startCaptureRuntime = async (options: {
|
||||
let shimReplay: CommandShimReplay | undefined;
|
||||
let terminal: IPty | undefined;
|
||||
try {
|
||||
const { spawn } = await import("@lydell/node-pty");
|
||||
replay = await startLoopbackReplay(scenario);
|
||||
const startedAt = new Date();
|
||||
const started = Date.now();
|
||||
|
||||
@@ -53,7 +53,7 @@ export {
|
||||
|
||||
const registrationCommand = (): readonly string[] =>
|
||||
process.env.npm_command === "exec"
|
||||
? ["npx", "-y", PRODUCT_IDENTITY.packageName, "mcp"]
|
||||
? ["npx", "-y", PRODUCT_IDENTITY.packageSpecifier, "mcp"]
|
||||
: [resolve(process.argv[1] ?? PRODUCT_IDENTITY.cliBinary), "mcp"];
|
||||
|
||||
/** Result of one backup/write/readback transaction. */
|
||||
@@ -405,7 +405,7 @@ export const configureJsonClient = async (
|
||||
command: readonly string[] = [
|
||||
"npx",
|
||||
"-y",
|
||||
PRODUCT_IDENTITY.packageName,
|
||||
PRODUCT_IDENTITY.packageSpecifier,
|
||||
"mcp",
|
||||
],
|
||||
): Promise<ClientConfigurationResult> => {
|
||||
@@ -483,7 +483,7 @@ export const configureTomlClient = async (
|
||||
command: readonly string[] = [
|
||||
"npx",
|
||||
"-y",
|
||||
PRODUCT_IDENTITY.packageName,
|
||||
PRODUCT_IDENTITY.packageSpecifier,
|
||||
"mcp",
|
||||
],
|
||||
): Promise<ClientConfigurationResult> => {
|
||||
|
||||
@@ -229,8 +229,10 @@ const isOwnedRegistration = (value: unknown): boolean => {
|
||||
args.length === 1 &&
|
||||
args[0] === "mcp") ||
|
||||
(command === "npx" &&
|
||||
JSON.stringify(args) ===
|
||||
JSON.stringify(["-y", PRODUCT_IDENTITY.packageName, "mcp"]))
|
||||
(JSON.stringify(args) ===
|
||||
JSON.stringify(["-y", PRODUCT_IDENTITY.packageSpecifier, "mcp"]) ||
|
||||
JSON.stringify(args) ===
|
||||
JSON.stringify(["-y", PRODUCT_IDENTITY.packageName, "mcp"])))
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user