@yawlabs/mcp-compliance 0.13.2 → 0.13.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/index.js +23 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5161,6 +5161,20 @@ function formatHtml(report) {
|
|
|
5161
5161
|
</html>`;
|
|
5162
5162
|
}
|
|
5163
5163
|
|
|
5164
|
+
// src/stdio-split.ts
|
|
5165
|
+
function splitStdioTarget(s) {
|
|
5166
|
+
if (/["'`]/.test(s)) {
|
|
5167
|
+
throw new Error(
|
|
5168
|
+
"stdio command contains quote characters \u2014 pass the command and its args as separate tokens (e.g. `mcp-compliance test node dist/index.js serve`) instead of wrapping them in one quoted string."
|
|
5169
|
+
);
|
|
5170
|
+
}
|
|
5171
|
+
const tokens = s.trim().split(/\s+/).filter(Boolean);
|
|
5172
|
+
if (tokens.length === 0) {
|
|
5173
|
+
throw new Error("stdio command is empty");
|
|
5174
|
+
}
|
|
5175
|
+
return { command: tokens[0], args: tokens.slice(1) };
|
|
5176
|
+
}
|
|
5177
|
+
|
|
5164
5178
|
// src/token-store.ts
|
|
5165
5179
|
import { createHash as createHash2 } from "crypto";
|
|
5166
5180
|
import { existsSync as existsSync3, mkdirSync, readFileSync as readFileSync3, writeFileSync } from "fs";
|
|
@@ -5290,10 +5304,17 @@ function buildTarget(positional, extraArgs, opts) {
|
|
|
5290
5304
|
...opts.envFile ? readEnvFile(opts.envFile) : {},
|
|
5291
5305
|
...opts.env ?? {}
|
|
5292
5306
|
};
|
|
5307
|
+
let command = positional;
|
|
5308
|
+
let args = extraArgs;
|
|
5309
|
+
if (extraArgs.length === 0 && /\s/.test(positional)) {
|
|
5310
|
+
const split = splitStdioTarget(positional);
|
|
5311
|
+
command = split.command;
|
|
5312
|
+
args = split.args;
|
|
5313
|
+
}
|
|
5293
5314
|
return {
|
|
5294
5315
|
type: "stdio",
|
|
5295
|
-
command
|
|
5296
|
-
args
|
|
5316
|
+
command,
|
|
5317
|
+
args,
|
|
5297
5318
|
env: Object.keys(env).length ? env : void 0,
|
|
5298
5319
|
cwd: opts.cwd,
|
|
5299
5320
|
verbose: opts.verbose
|
package/package.json
CHANGED