@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/index.mjs
CHANGED
|
@@ -556,18 +556,18 @@ function buildManagedMcpServerSpec(ctx, instanceId) {
|
|
|
556
556
|
return { command: null, args: [], env, sourcePath, warnings, issues };
|
|
557
557
|
}
|
|
558
558
|
const isBundled = sourcePath.endsWith(".mjs");
|
|
559
|
+
const isEphemeralSource = isEphemeralPath(sourcePath);
|
|
559
560
|
let command = bunCommand;
|
|
560
561
|
let args = [toForwardSlashPath(sourcePath)];
|
|
561
|
-
if (
|
|
562
|
-
|
|
562
|
+
if (isEphemeralSource && isBundled) {
|
|
563
|
+
command = "npx";
|
|
564
|
+
args = ["@hua-labs/tap", "serve"];
|
|
565
|
+
warnings.push(
|
|
566
|
+
"Detected npx cache path. Using `npx @hua-labs/tap serve` as stable MCP launcher."
|
|
567
|
+
);
|
|
568
|
+
} else if (!command && isBundled) {
|
|
563
569
|
const isEphemeralNode = isEphemeralPath(process.execPath);
|
|
564
|
-
if (
|
|
565
|
-
command = "npx";
|
|
566
|
-
args = ["@hua-labs/tap", "serve"];
|
|
567
|
-
warnings.push(
|
|
568
|
-
"Detected npx cache path. Using `npx @hua-labs/tap serve` as stable MCP launcher."
|
|
569
|
-
);
|
|
570
|
-
} else if (isEphemeralNode) {
|
|
570
|
+
if (isEphemeralNode) {
|
|
571
571
|
command = "node";
|
|
572
572
|
warnings.push(
|
|
573
573
|
"Detected ephemeral node path. Using `node` from PATH for MCP config stability."
|
|
@@ -575,11 +575,9 @@ function buildManagedMcpServerSpec(ctx, instanceId) {
|
|
|
575
575
|
} else {
|
|
576
576
|
command = toForwardSlashPath(process.execPath);
|
|
577
577
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
);
|
|
582
|
-
}
|
|
578
|
+
warnings.push(
|
|
579
|
+
"bun not found; using node to run the compiled MCP server. Install bun for better performance."
|
|
580
|
+
);
|
|
583
581
|
}
|
|
584
582
|
if (!command) {
|
|
585
583
|
issues.push(
|
|
@@ -2496,13 +2494,12 @@ function verifyManagedToml(content, ctx, configPath) {
|
|
|
2496
2494
|
});
|
|
2497
2495
|
}
|
|
2498
2496
|
if (mainTable && managed.command) {
|
|
2497
|
+
const expectedArgs = managed.args.map((a) => `"${a.replace(/\\/g, "\\\\")}"`).join(", ");
|
|
2499
2498
|
checks.push({
|
|
2500
2499
|
name: "Managed command configured",
|
|
2501
2500
|
passed: mainTable.includes(
|
|
2502
2501
|
`command = "${managed.command.replace(/\\/g, "\\\\")}"`
|
|
2503
|
-
) && mainTable.includes(
|
|
2504
|
-
`args = ["${managed.args[0]?.replace(/\\/g, "\\\\") ?? ""}"]`
|
|
2505
|
-
),
|
|
2502
|
+
) && mainTable.includes(`args = [${expectedArgs}]`),
|
|
2506
2503
|
message: "Managed tap-comms command/args do not match expected values"
|
|
2507
2504
|
});
|
|
2508
2505
|
}
|