@hua-labs/tap 0.2.2 → 0.2.3
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.
- package/dist/cli.mjs +14 -17
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +14 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1022,18 +1022,18 @@ function buildManagedMcpServerSpec(ctx, instanceId) {
|
|
|
1022
1022
|
return { command: null, args: [], env, sourcePath, warnings, issues };
|
|
1023
1023
|
}
|
|
1024
1024
|
const isBundled = sourcePath.endsWith(".mjs");
|
|
1025
|
+
const isEphemeralSource = isEphemeralPath(sourcePath);
|
|
1025
1026
|
let command = bunCommand;
|
|
1026
1027
|
let args = [toForwardSlashPath(sourcePath)];
|
|
1027
|
-
if (
|
|
1028
|
-
|
|
1028
|
+
if (isEphemeralSource && isBundled) {
|
|
1029
|
+
command = "npx";
|
|
1030
|
+
args = ["@hua-labs/tap", "serve"];
|
|
1031
|
+
warnings.push(
|
|
1032
|
+
"Detected npx cache path. Using `npx @hua-labs/tap serve` as stable MCP launcher."
|
|
1033
|
+
);
|
|
1034
|
+
} else if (!command && isBundled) {
|
|
1029
1035
|
const isEphemeralNode = isEphemeralPath(process.execPath);
|
|
1030
|
-
if (
|
|
1031
|
-
command = "npx";
|
|
1032
|
-
args = ["@hua-labs/tap", "serve"];
|
|
1033
|
-
warnings.push(
|
|
1034
|
-
"Detected npx cache path. Using `npx @hua-labs/tap serve` as stable MCP launcher."
|
|
1035
|
-
);
|
|
1036
|
-
} else if (isEphemeralNode) {
|
|
1036
|
+
if (isEphemeralNode) {
|
|
1037
1037
|
command = "node";
|
|
1038
1038
|
warnings.push(
|
|
1039
1039
|
"Detected ephemeral node path. Using `node` from PATH for MCP config stability."
|
|
@@ -1041,11 +1041,9 @@ function buildManagedMcpServerSpec(ctx, instanceId) {
|
|
|
1041
1041
|
} else {
|
|
1042
1042
|
command = toForwardSlashPath(process.execPath);
|
|
1043
1043
|
}
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
);
|
|
1048
|
-
}
|
|
1044
|
+
warnings.push(
|
|
1045
|
+
"bun not found; using node to run the compiled MCP server. Install bun for better performance."
|
|
1046
|
+
);
|
|
1049
1047
|
}
|
|
1050
1048
|
if (!command) {
|
|
1051
1049
|
issues.push(
|
|
@@ -1419,13 +1417,12 @@ function verifyManagedToml(content, ctx, configPath) {
|
|
|
1419
1417
|
});
|
|
1420
1418
|
}
|
|
1421
1419
|
if (mainTable && managed.command) {
|
|
1420
|
+
const expectedArgs = managed.args.map((a) => `"${a.replace(/\\/g, "\\\\")}"`).join(", ");
|
|
1422
1421
|
checks.push({
|
|
1423
1422
|
name: "Managed command configured",
|
|
1424
1423
|
passed: mainTable.includes(
|
|
1425
1424
|
`command = "${managed.command.replace(/\\/g, "\\\\")}"`
|
|
1426
|
-
) && mainTable.includes(
|
|
1427
|
-
`args = ["${managed.args[0]?.replace(/\\/g, "\\\\") ?? ""}"]`
|
|
1428
|
-
),
|
|
1425
|
+
) && mainTable.includes(`args = [${expectedArgs}]`),
|
|
1429
1426
|
message: "Managed tap-comms command/args do not match expected values"
|
|
1430
1427
|
});
|
|
1431
1428
|
}
|