@mcpjam/cli 3.8.0 → 3.9.0
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 +319 -20
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import path2, { join, dirname, basename } from 'path';
|
|
|
8
8
|
import { randomUUID } from 'crypto';
|
|
9
9
|
import { spawn } from 'child_process';
|
|
10
10
|
import os, { homedir } from 'os';
|
|
11
|
-
import { createTunnelOperation, DEFAULT_PLATFORM_API_BASE_URL, PlatformApiClient, isPlatformApiError, PlatformApiError, listProjectsOperation, listProjectServersOperation, showServersOperation, createEvalSuiteOperation, listEvalSuitesOperation, runEvalSuiteOperation, getEvalRunOperation } from '@mcpjam/sdk/platform';
|
|
11
|
+
import { listEvalRunIterationsOperation, getEvalIterationTraceOperation, getEvalSuiteOperation, updateEvalSuiteOperation, deleteEvalSuiteOperation, setEvalSuiteScheduleOperation, listEvalCasesOperation, getEvalCaseOperation, createEvalCaseOperation, updateEvalCaseOperation, deleteEvalCaseOperation, generateEvalCasesOperation, createTunnelOperation, DEFAULT_PLATFORM_API_BASE_URL, PlatformApiClient, isPlatformApiError, PlatformApiError, listProjectsOperation, listProjectServersOperation, showServersOperation, createEvalSuiteOperation, listEvalSuitesOperation, runEvalSuiteOperation, getEvalRunOperation } from '@mcpjam/sdk/platform';
|
|
12
12
|
import { StdioServerTransport, McpServer } from '@modelcontextprotocol/server';
|
|
13
13
|
import { z } from 'zod';
|
|
14
14
|
import { PostHog } from 'posthog-node';
|
|
@@ -19,7 +19,7 @@ import { WebSocket } from 'ws';
|
|
|
19
19
|
|
|
20
20
|
// package.json
|
|
21
21
|
var package_default = {
|
|
22
|
-
version: "3.
|
|
22
|
+
version: "3.9.0"};
|
|
23
23
|
|
|
24
24
|
// src/lib/output.ts
|
|
25
25
|
var DEFAULT_OUTPUT_FORMAT = "json";
|
|
@@ -3392,9 +3392,13 @@ async function runPlatformCommand(options, timeoutMs, execute) {
|
|
|
3392
3392
|
const controller = new AbortController();
|
|
3393
3393
|
const timeoutHandle = setTimeout(() => {
|
|
3394
3394
|
controller.abort(
|
|
3395
|
-
new PlatformApiError(
|
|
3396
|
-
|
|
3397
|
-
|
|
3395
|
+
new PlatformApiError(
|
|
3396
|
+
`Request timed out after ${timeoutMs}ms`,
|
|
3397
|
+
"TIMEOUT",
|
|
3398
|
+
{
|
|
3399
|
+
status: 0
|
|
3400
|
+
}
|
|
3401
|
+
)
|
|
3398
3402
|
);
|
|
3399
3403
|
}, timeoutMs);
|
|
3400
3404
|
timeoutHandle.unref?.();
|
|
@@ -3460,6 +3464,98 @@ function loadSuiteDefinition(options) {
|
|
|
3460
3464
|
}
|
|
3461
3465
|
return parsed.data;
|
|
3462
3466
|
}
|
|
3467
|
+
function loadBodyObject(options) {
|
|
3468
|
+
if (options.file !== void 0 && options.json !== void 0) {
|
|
3469
|
+
throw usageError("Provide either --file or --json, not both.");
|
|
3470
|
+
}
|
|
3471
|
+
let base = {};
|
|
3472
|
+
if (options.file !== void 0) {
|
|
3473
|
+
const text = readFileOrStdin(options.file, "--file");
|
|
3474
|
+
if (text.trim() === "") throw usageError("--file input is empty.");
|
|
3475
|
+
try {
|
|
3476
|
+
base = JSON.parse(text);
|
|
3477
|
+
} catch (error) {
|
|
3478
|
+
throw usageError("--file must contain valid JSON.", {
|
|
3479
|
+
source: error instanceof Error ? error.message : String(error)
|
|
3480
|
+
});
|
|
3481
|
+
}
|
|
3482
|
+
} else if (options.json !== void 0) {
|
|
3483
|
+
base = new JsonInputContext().parseJsonInputRecord(options.json, "--json");
|
|
3484
|
+
}
|
|
3485
|
+
if (base === void 0 || base === null) base = {};
|
|
3486
|
+
if (typeof base !== "object" || Array.isArray(base)) {
|
|
3487
|
+
throw usageError("Body must be a JSON object.");
|
|
3488
|
+
}
|
|
3489
|
+
return base;
|
|
3490
|
+
}
|
|
3491
|
+
function validateOpInput(op, raw) {
|
|
3492
|
+
const parsed = op.inputSchema.safeParse(raw);
|
|
3493
|
+
if (!parsed.success) {
|
|
3494
|
+
const detail = parsed.error.issues.map((issue) => `${issue.path.join(".") || "(root)"}: ${issue.message}`).join("; ");
|
|
3495
|
+
throw usageError(`Invalid input: ${detail}`);
|
|
3496
|
+
}
|
|
3497
|
+
return parsed.data;
|
|
3498
|
+
}
|
|
3499
|
+
async function executeOp(op, input, options, command) {
|
|
3500
|
+
const globalOptions = getGlobalOptions(command);
|
|
3501
|
+
const result = await runPlatformCommand(
|
|
3502
|
+
options,
|
|
3503
|
+
globalOptions.timeout,
|
|
3504
|
+
({ client, signal }) => op.execute(input, { client, signal })
|
|
3505
|
+
);
|
|
3506
|
+
writeResult(result, globalOptions.format);
|
|
3507
|
+
}
|
|
3508
|
+
function buildSuiteUpdateInput(options) {
|
|
3509
|
+
const input = { ...loadBodyObject(options) };
|
|
3510
|
+
input.suite = options.suite;
|
|
3511
|
+
if (options.project !== void 0) input.project = options.project;
|
|
3512
|
+
if (options.name !== void 0) input.name = options.name;
|
|
3513
|
+
if (options.description !== void 0)
|
|
3514
|
+
input.description = options.description;
|
|
3515
|
+
if (options.server !== void 0)
|
|
3516
|
+
input.environment = {
|
|
3517
|
+
...input.environment ?? {},
|
|
3518
|
+
servers: options.server
|
|
3519
|
+
};
|
|
3520
|
+
if (options.host !== void 0)
|
|
3521
|
+
input.hosts = options.host.map((host) => ({ host }));
|
|
3522
|
+
const exec = { ...input.executionConfig ?? {} };
|
|
3523
|
+
if (options.model !== void 0) exec.model = options.model;
|
|
3524
|
+
if (options.systemPrompt !== void 0)
|
|
3525
|
+
exec.systemPrompt = options.systemPrompt;
|
|
3526
|
+
if (options.temperature !== void 0)
|
|
3527
|
+
exec.temperature = Number(options.temperature);
|
|
3528
|
+
if (Object.keys(exec).length > 0) input.executionConfig = exec;
|
|
3529
|
+
const settings = { ...input.settings ?? {} };
|
|
3530
|
+
if (options.minAccuracy !== void 0)
|
|
3531
|
+
settings.minimumAccuracy = Number(options.minAccuracy);
|
|
3532
|
+
const mo = { ...settings.matchOptions ?? {} };
|
|
3533
|
+
if (options.toolCallOrder !== void 0)
|
|
3534
|
+
mo.toolCallOrder = options.toolCallOrder;
|
|
3535
|
+
if (options.arguments !== void 0) mo.arguments = options.arguments;
|
|
3536
|
+
if (options.extraToolCalls !== void 0)
|
|
3537
|
+
mo.extraToolCalls = options.extraToolCalls === "unlimited" ? "unlimited" : Number(options.extraToolCalls);
|
|
3538
|
+
if (Object.keys(mo).length > 0) settings.matchOptions = mo;
|
|
3539
|
+
const judge = { ...settings.judge ?? {} };
|
|
3540
|
+
if (options.judge !== void 0) {
|
|
3541
|
+
if (options.judge !== "on" && options.judge !== "off") {
|
|
3542
|
+
throw usageError('--judge must be "on" or "off".');
|
|
3543
|
+
}
|
|
3544
|
+
judge.enabled = options.judge === "on";
|
|
3545
|
+
}
|
|
3546
|
+
if (options.judgeModel !== void 0) judge.model = options.judgeModel;
|
|
3547
|
+
if (Object.keys(judge).length > 0) settings.judge = judge;
|
|
3548
|
+
if (Object.keys(settings).length > 0) input.settings = settings;
|
|
3549
|
+
return input;
|
|
3550
|
+
}
|
|
3551
|
+
function buildCaseInput(options, opts) {
|
|
3552
|
+
const input = { ...loadBodyObject(options) };
|
|
3553
|
+
if (options.project !== void 0) input.project = options.project;
|
|
3554
|
+
input.suite = options.suite;
|
|
3555
|
+
if (opts.requireCase) input.case = options.case;
|
|
3556
|
+
if (options.title !== void 0) input.title = options.title;
|
|
3557
|
+
return input;
|
|
3558
|
+
}
|
|
3463
3559
|
function registerEvalCommands(program) {
|
|
3464
3560
|
const evals = program.command("eval").description("Author and run eval suites in your hosted MCPJam projects");
|
|
3465
3561
|
addPlatformOptions(
|
|
@@ -3474,7 +3570,10 @@ function registerEvalCommands(program) {
|
|
|
3474
3570
|
).option(
|
|
3475
3571
|
"--json <json>",
|
|
3476
3572
|
"Inline suite definition JSON (or @file, or - for stdin)"
|
|
3477
|
-
).option("--name <name>", "Suite name (overrides the file)").option(
|
|
3573
|
+
).option("--name <name>", "Suite name (overrides the file)").option(
|
|
3574
|
+
"--model <model>",
|
|
3575
|
+
"Suite-level default model (overrides the file)"
|
|
3576
|
+
).option(
|
|
3478
3577
|
"--provider <provider>",
|
|
3479
3578
|
"Suite-level default provider (overrides the file; needed for bare/custom model ids)"
|
|
3480
3579
|
).option(
|
|
@@ -3496,20 +3595,18 @@ function registerEvalCommands(program) {
|
|
|
3496
3595
|
"--project <id-or-name>",
|
|
3497
3596
|
"Project name or ID (defaults to the most recently updated project)"
|
|
3498
3597
|
)
|
|
3499
|
-
).action(
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
}
|
|
3512
|
-
);
|
|
3598
|
+
).action(async (options, command) => {
|
|
3599
|
+
const globalOptions = getGlobalOptions(command);
|
|
3600
|
+
const result = await runPlatformCommand(
|
|
3601
|
+
options,
|
|
3602
|
+
globalOptions.timeout,
|
|
3603
|
+
({ client, signal }) => listEvalSuitesOperation.execute(
|
|
3604
|
+
{ project: options.project },
|
|
3605
|
+
{ client, signal }
|
|
3606
|
+
)
|
|
3607
|
+
);
|
|
3608
|
+
writeResult(result, globalOptions.format);
|
|
3609
|
+
});
|
|
3513
3610
|
addPlatformOptions(
|
|
3514
3611
|
evals.command("run").description("Start an eval run of an existing suite (asynchronous)").requiredOption("--suite <id-or-name>", "Eval suite name or ID").option(
|
|
3515
3612
|
"--project <id-or-name>",
|
|
@@ -3552,6 +3649,208 @@ function registerEvalCommands(program) {
|
|
|
3552
3649
|
writeResult(result, globalOptions.format);
|
|
3553
3650
|
}
|
|
3554
3651
|
);
|
|
3652
|
+
const PROJECT_OPT = "Project name or ID (defaults to most recently updated)";
|
|
3653
|
+
addPlatformOptions(
|
|
3654
|
+
evals.command("iterations").description(
|
|
3655
|
+
"List per-iteration results for an eval run (pass/fail, tool calls, tokens, latency)"
|
|
3656
|
+
).requiredOption("--run <id>", "Eval run ID (from `eval run`)").requiredOption(
|
|
3657
|
+
"--project <id-or-name>",
|
|
3658
|
+
"Project the run belongs to (name or ID)"
|
|
3659
|
+
).option("--cursor <cursor>", "Pagination cursor from a previous response").option("--limit <n>", "Max iterations per page (1\u2013200)")
|
|
3660
|
+
).action(
|
|
3661
|
+
async (options, command) => {
|
|
3662
|
+
const input = validateOpInput(listEvalRunIterationsOperation, {
|
|
3663
|
+
project: options.project,
|
|
3664
|
+
runId: options.run,
|
|
3665
|
+
...options.cursor !== void 0 ? { cursor: options.cursor } : {},
|
|
3666
|
+
...options.limit !== void 0 ? { limit: Number(options.limit) } : {}
|
|
3667
|
+
});
|
|
3668
|
+
await executeOp(listEvalRunIterationsOperation, input, options, command);
|
|
3669
|
+
}
|
|
3670
|
+
);
|
|
3671
|
+
addPlatformOptions(
|
|
3672
|
+
evals.command("trace").description(
|
|
3673
|
+
"Fetch the full trace for one eval iteration (large: full message history + spans)"
|
|
3674
|
+
).requiredOption("--run <id>", "Eval run ID (from `eval run`)").requiredOption(
|
|
3675
|
+
"--iteration <id>",
|
|
3676
|
+
"Iteration ID (from `eval iterations`)"
|
|
3677
|
+
).requiredOption(
|
|
3678
|
+
"--project <id-or-name>",
|
|
3679
|
+
"Project the run belongs to (name or ID)"
|
|
3680
|
+
)
|
|
3681
|
+
).action(
|
|
3682
|
+
async (options, command) => {
|
|
3683
|
+
await executeOp(
|
|
3684
|
+
getEvalIterationTraceOperation,
|
|
3685
|
+
{
|
|
3686
|
+
project: options.project,
|
|
3687
|
+
runId: options.run,
|
|
3688
|
+
iterationId: options.iteration
|
|
3689
|
+
},
|
|
3690
|
+
options,
|
|
3691
|
+
command
|
|
3692
|
+
);
|
|
3693
|
+
}
|
|
3694
|
+
);
|
|
3695
|
+
addPlatformOptions(
|
|
3696
|
+
evals.command("get").description("Show an eval suite's full settings").requiredOption("--suite <id-or-name>", "Eval suite name or ID").option("--project <id-or-name>", PROJECT_OPT)
|
|
3697
|
+
).action(
|
|
3698
|
+
async (options, command) => {
|
|
3699
|
+
await executeOp(
|
|
3700
|
+
getEvalSuiteOperation,
|
|
3701
|
+
{ project: options.project, suite: options.suite },
|
|
3702
|
+
options,
|
|
3703
|
+
command
|
|
3704
|
+
);
|
|
3705
|
+
}
|
|
3706
|
+
);
|
|
3707
|
+
addPlatformOptions(
|
|
3708
|
+
evals.command("update").description(
|
|
3709
|
+
"Edit an eval suite's settings (only the flags you pass change)"
|
|
3710
|
+
).requiredOption("--suite <id-or-name>", "Eval suite name or ID").option("--project <id-or-name>", PROJECT_OPT).option("--file <path>", "Suite-update JSON body (or - for stdin)").option("--json <json>", "Inline suite-update JSON (or @file, or -)").option("--name <name>", "Rename the suite").option("--description <text>", "Suite description").option(
|
|
3711
|
+
"--server <name...>",
|
|
3712
|
+
"Replace the suite's server selection (project server names)"
|
|
3713
|
+
).option("--host <name...>", "Replace host attachments (by name/ID)").option("--model <id>", "Execution model id").option("--system-prompt <text>", "Execution system prompt").option("--temperature <n>", "Execution temperature").option("--min-accuracy <pct>", "Minimum accuracy, 0\u2013100").option("--tool-call-order <any|in-order|exact>", "Tool call order").option("--arguments <ignore|partial|exact>", "Argument matching").option("--extra-tool-calls <unlimited|N>", "Allowed extra tool calls").option("--judge <on|off>", "Enable/disable LLM-as-judge grading").option("--judge-model <id>", "Judge model id")
|
|
3714
|
+
).action(async (options, command) => {
|
|
3715
|
+
const input = validateOpInput(
|
|
3716
|
+
updateEvalSuiteOperation,
|
|
3717
|
+
buildSuiteUpdateInput(options)
|
|
3718
|
+
);
|
|
3719
|
+
await executeOp(updateEvalSuiteOperation, input, options, command);
|
|
3720
|
+
});
|
|
3721
|
+
addPlatformOptions(
|
|
3722
|
+
evals.command("delete").description("Permanently delete an eval suite (and its cases and runs)").requiredOption("--suite <id-or-name>", "Eval suite name or ID").option("--project <id-or-name>", PROJECT_OPT)
|
|
3723
|
+
).action(
|
|
3724
|
+
async (options, command) => {
|
|
3725
|
+
await executeOp(
|
|
3726
|
+
deleteEvalSuiteOperation,
|
|
3727
|
+
{ project: options.project, suite: options.suite },
|
|
3728
|
+
options,
|
|
3729
|
+
command
|
|
3730
|
+
);
|
|
3731
|
+
}
|
|
3732
|
+
);
|
|
3733
|
+
addPlatformOptions(
|
|
3734
|
+
evals.command("schedule").description("Enable or disable scheduled runs for a suite").requiredOption("--suite <id-or-name>", "Eval suite name or ID").option("--project <id-or-name>", PROJECT_OPT).option("--enable", "Enable scheduled runs").option("--disable", "Disable scheduled runs").option("--interval <minutes>", "Run interval in minutes (5\u201310080)")
|
|
3735
|
+
).action(
|
|
3736
|
+
async (options, command) => {
|
|
3737
|
+
if (options.enable && options.disable) {
|
|
3738
|
+
throw usageError("Pass either --enable or --disable, not both.");
|
|
3739
|
+
}
|
|
3740
|
+
if (!options.enable && !options.disable) {
|
|
3741
|
+
throw usageError("Pass --enable or --disable.");
|
|
3742
|
+
}
|
|
3743
|
+
const input = validateOpInput(setEvalSuiteScheduleOperation, {
|
|
3744
|
+
project: options.project,
|
|
3745
|
+
suite: options.suite,
|
|
3746
|
+
enabled: Boolean(options.enable),
|
|
3747
|
+
...options.interval !== void 0 ? { intervalMinutes: Number(options.interval) } : {}
|
|
3748
|
+
});
|
|
3749
|
+
await executeOp(setEvalSuiteScheduleOperation, input, options, command);
|
|
3750
|
+
}
|
|
3751
|
+
);
|
|
3752
|
+
const cases = evals.command("cases").description("List, author, and edit an eval suite's test cases");
|
|
3753
|
+
addPlatformOptions(
|
|
3754
|
+
cases.command("list").description("List a suite's test cases").requiredOption("--suite <id-or-name>", "Eval suite name or ID").option("--project <id-or-name>", PROJECT_OPT)
|
|
3755
|
+
).action(
|
|
3756
|
+
async (options, command) => {
|
|
3757
|
+
await executeOp(
|
|
3758
|
+
listEvalCasesOperation,
|
|
3759
|
+
{ project: options.project, suite: options.suite },
|
|
3760
|
+
options,
|
|
3761
|
+
command
|
|
3762
|
+
);
|
|
3763
|
+
}
|
|
3764
|
+
);
|
|
3765
|
+
addPlatformOptions(
|
|
3766
|
+
cases.command("get").description("Show one test case").requiredOption("--suite <id-or-name>", "Eval suite name or ID").requiredOption("--case <id-or-title>", "Eval case title or ID").option("--project <id-or-name>", PROJECT_OPT)
|
|
3767
|
+
).action(
|
|
3768
|
+
async (options, command) => {
|
|
3769
|
+
await executeOp(
|
|
3770
|
+
getEvalCaseOperation,
|
|
3771
|
+
{ project: options.project, suite: options.suite, case: options.case },
|
|
3772
|
+
options,
|
|
3773
|
+
command
|
|
3774
|
+
);
|
|
3775
|
+
}
|
|
3776
|
+
);
|
|
3777
|
+
addPlatformOptions(
|
|
3778
|
+
cases.command("create").description("Add a test case to a suite (definition via --file/--json)").requiredOption("--suite <id-or-name>", "Eval suite name or ID").option("--project <id-or-name>", PROJECT_OPT).option("--file <path>", "Case JSON body (or - for stdin)").option("--json <json>", "Inline case JSON (or @file, or -)").option("--title <title>", "Case title (overrides the body)")
|
|
3779
|
+
).action(async (options, command) => {
|
|
3780
|
+
const input = validateOpInput(
|
|
3781
|
+
createEvalCaseOperation,
|
|
3782
|
+
buildCaseInput(options, { requireCase: false })
|
|
3783
|
+
);
|
|
3784
|
+
await executeOp(createEvalCaseOperation, input, options, command);
|
|
3785
|
+
});
|
|
3786
|
+
addPlatformOptions(
|
|
3787
|
+
cases.command("update").description("Edit a test case (definition via --file/--json)").requiredOption("--suite <id-or-name>", "Eval suite name or ID").requiredOption("--case <id-or-title>", "Eval case title or ID").option("--project <id-or-name>", PROJECT_OPT).option("--file <path>", "Case JSON body (or - for stdin)").option("--json <json>", "Inline case JSON (or @file, or -)").option("--title <title>", "Rename the case")
|
|
3788
|
+
).action(async (options, command) => {
|
|
3789
|
+
const input = validateOpInput(
|
|
3790
|
+
updateEvalCaseOperation,
|
|
3791
|
+
buildCaseInput(options, { requireCase: true })
|
|
3792
|
+
);
|
|
3793
|
+
await executeOp(updateEvalCaseOperation, input, options, command);
|
|
3794
|
+
});
|
|
3795
|
+
addPlatformOptions(
|
|
3796
|
+
cases.command("delete").description("Permanently delete a test case").requiredOption("--suite <id-or-name>", "Eval suite name or ID").requiredOption("--case <id-or-title>", "Eval case title or ID").option("--project <id-or-name>", PROJECT_OPT)
|
|
3797
|
+
).action(
|
|
3798
|
+
async (options, command) => {
|
|
3799
|
+
await executeOp(
|
|
3800
|
+
deleteEvalCaseOperation,
|
|
3801
|
+
{ project: options.project, suite: options.suite, case: options.case },
|
|
3802
|
+
options,
|
|
3803
|
+
command
|
|
3804
|
+
);
|
|
3805
|
+
}
|
|
3806
|
+
);
|
|
3807
|
+
addPlatformOptions(
|
|
3808
|
+
cases.command("generate").description(
|
|
3809
|
+
"AI-generate test cases from the suite's tools (spends credits)"
|
|
3810
|
+
).requiredOption("--suite <id-or-name>", "Eval suite name or ID").option("--project <id-or-name>", PROJECT_OPT).option("--mode <normal|negative>", "Generation mode (default normal)").option(
|
|
3811
|
+
"--server <name...>",
|
|
3812
|
+
"Servers to discover tools from (default: suite's)"
|
|
3813
|
+
).option(
|
|
3814
|
+
"--case-model <id...>",
|
|
3815
|
+
"Execution model(s) for the generated cases"
|
|
3816
|
+
).option("--simple <n>", "How many easy, single-tool cases").option("--multi-tool <n>", "How many medium, 2+ tool cases").option("--multi-turn <n>", "How many multi-turn follow-up cases").option("--complex <n>", "How many hard / cross-server cases").option("--negative <n>", "How many negative (no-tool) cases").option(
|
|
3817
|
+
"--vary-user-styles",
|
|
3818
|
+
"Vary query phrasing across a realistic range of user styles"
|
|
3819
|
+
)
|
|
3820
|
+
).action(
|
|
3821
|
+
async (options, command) => {
|
|
3822
|
+
const caseMix = {};
|
|
3823
|
+
for (const key of [
|
|
3824
|
+
"simple",
|
|
3825
|
+
"multiTool",
|
|
3826
|
+
"multiTurn",
|
|
3827
|
+
"complex",
|
|
3828
|
+
"negative"
|
|
3829
|
+
]) {
|
|
3830
|
+
const raw = options[key];
|
|
3831
|
+
if (raw !== void 0) {
|
|
3832
|
+
const parsed = Number(raw);
|
|
3833
|
+
if (!Number.isInteger(parsed)) {
|
|
3834
|
+
const flag = key.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
|
|
3835
|
+
throw usageError(
|
|
3836
|
+
`--${flag} requires an integer value, got "${raw}".`
|
|
3837
|
+
);
|
|
3838
|
+
}
|
|
3839
|
+
caseMix[key] = parsed;
|
|
3840
|
+
}
|
|
3841
|
+
}
|
|
3842
|
+
const input = validateOpInput(generateEvalCasesOperation, {
|
|
3843
|
+
project: options.project,
|
|
3844
|
+
suite: options.suite,
|
|
3845
|
+
...options.mode ? { mode: options.mode } : {},
|
|
3846
|
+
...options.server ? { servers: options.server } : {},
|
|
3847
|
+
...options.caseModel ? { caseModels: options.caseModel.map((model) => ({ model })) } : {},
|
|
3848
|
+
...Object.keys(caseMix).length > 0 ? { caseMix } : {},
|
|
3849
|
+
...options.varyUserStyles ? { varyUserStyles: true } : {}
|
|
3850
|
+
});
|
|
3851
|
+
await executeOp(generateEvalCasesOperation, input, options, command);
|
|
3852
|
+
}
|
|
3853
|
+
);
|
|
3555
3854
|
}
|
|
3556
3855
|
|
|
3557
3856
|
// src/lib/server-doctor.ts
|