@mcpjam/cli 5.11.2 → 5.11.4
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 +157 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { Command, CommanderError, Option } from 'commander';
|
|
3
3
|
import { realpathSync, readFileSync, existsSync, mkdirSync, writeFileSync, unlinkSync, statSync, closeSync, renameSync, openSync } from 'fs';
|
|
4
4
|
import { pathToFileURL } from 'url';
|
|
5
|
-
import { probeMcpServer, redactForTelemetry, runServerDoctor, collectServerSnapshot, serializeStableServerSnapshot, serializeServerSnapshot, buildServerDiffReport, classifyMcpHeader, validateToolCallResult, isCallToolResultError, buildToolCallValidationReport, listResources, readResource, listServerSkillCatalog, getVerifiedServerSkill, isServerSkillRefusalError, readVerifiedServerSkillFile, SubscriptionCoordinator, listTools, listPrompts, getPrompt, MCPAppsConformanceTest, scoreFromAppsResult, MCPAppsConformanceSuite, MCPTasksConformanceTest, scoreFromTasksResult, runOAuthLogin, OAuthConformanceTest, scoreFromOAuthResult, OAuthConformanceSuite, runXaaFlow, MCPConformanceTest, scoreFromProtocolResult, MCPConformanceSuite, runConformance, isConformanceReportingConfigured, reportConformanceRun, reportConformanceRunSafely, OPENAI_SUBMISSION_MODES, withEphemeralClient, diffServerSnapshots, ServerSnapshotFormatError, renderStructuredRunJUnitXml, renderStructuredRunHtml, renderStructuredRunJson, DEFAULT_SUBSCRIPTION_RECONNECT_POLICY, isKnownProtocolVersion, describeConformanceScore, toConformanceReport, buildConformanceRunReport, renderConformanceReportJUnitXml, renderConformanceReportJson, formatOAuthConformanceHuman, formatOAuthConformanceSuiteHuman, fetchOAuthMetadata, executeOAuthProxy, executeDebugOAuthProxy, normalizeRegistrationStrategy, normalizeXaaClientAuth, normalizeIdentityAssertionFormat, IDENTITY_ASSERTION_FORMATS, XAA_CONFIDENTIAL_CIMD_ORIGIN, getLocalConfidentialCimdProvider, MCP_PROTOCOL_VERSIONS, gatherClaudeReadinessEvidence, gradeClaudeReadiness, gatherOpenAIReadinessEvidence, xmldomParseXml, gradeOpenAIReadiness, openUrlInBrowser, buildEvalRunReport, GATE_WAIVER_MAX_REASON_LENGTH, GATE_WAIVER_REASON_NOTICE, MCPClientManager, withSkillsExtensionCapability, MCP_SKILLS_EXTENSION_ID, decodeMcpHeaderValue, canDeclareTasksExtension, createStrictElicitationContentValidator, MCP_APPS_CHECK_CATEGORIES, MCP_APPS_CHECK_IDS, MCP_TASKS_CHECK_CATEGORIES, MCP_TASKS_CHECK_IDS, OAuthProxyError, isLoopbackHost, MCP_CHECK_CATEGORIES, MCP_CHECK_IDS, OPENAI_SUBMISSION_MODE_SHAPES, createDirectoryPluginFileSource, collectZipArchiveObservations, createZipPluginFileSource, generateRandomString, generateCodeChallenge, createInteractiveAuthorizationSession, loadEvalSuiteFile, declareEvalSuiteFileValidity, formatEvalRunDecisionSummary, gateOutcomeVerdict, applyGateWaiver, formatGateReport, formatGateWaiverLine, detectFlakyCases, evaluateCompareGates, buildRunCompareReport, formatSuiteFileFindings, serializeEvalSuiteFile, MAX_SUITE_FILE_BYTES, buildCorpus, HostedOnlyCaseError, verifyCorpusLock, detectCiMetadata, TaskLifecycleEngine, driveTaskToTerminal, extensionTaskToObservation, legacyTaskToObservation, canonicalDigest, readEvalRunDecisionSummary as readEvalRunDecisionSummary$1, buildEvalRunDecisionSummary, evaluateGates, gateInputFromPlatformRun, isGateWaiverInForce, calculateLatencyStats, CORPUS_LOCK_VERSION, suiteFilePointer, passRateFractionFromPercent, DEFAULT_MIN_EFFECT_SIZE, DEFAULT_MIN_SAMPLE_SIZE, planPlatformSuiteGradingUpdate, isUnknownTaskError, isMCPTasksWireError, LEGACY_TASK_STATUSES } from '@mcpjam/sdk';
|
|
6
|
-
import path7, { join, dirname,
|
|
5
|
+
import { probeMcpServer, redactForTelemetry, runServerDoctor, collectServerSnapshot, serializeStableServerSnapshot, serializeServerSnapshot, buildServerDiffReport, classifyMcpHeader, validateToolCallResult, isCallToolResultError, buildToolCallValidationReport, listResources, readResource, listServerSkillCatalog, getVerifiedServerSkill, isServerSkillRefusalError, readVerifiedServerSkillFile, SubscriptionCoordinator, listTools, listPrompts, getPrompt, MCPAppsConformanceTest, scoreFromAppsResult, MCPAppsConformanceSuite, MCPTasksConformanceTest, scoreFromTasksResult, runOAuthLogin, OAuthConformanceTest, scoreFromOAuthResult, OAuthConformanceSuite, runXaaFlow, MCPConformanceTest, scoreFromProtocolResult, MCPConformanceSuite, runConformance, isConformanceReportingConfigured, reportConformanceRun, reportConformanceRunSafely, OPENAI_SUBMISSION_MODES, withEphemeralClient, diffServerSnapshots, ServerSnapshotFormatError, renderStructuredRunJUnitXml, renderStructuredRunHtml, renderStructuredRunJson, DEFAULT_SUBSCRIPTION_RECONNECT_POLICY, isKnownProtocolVersion, describeConformanceScore, toConformanceReport, buildConformanceRunReport, renderConformanceReportJUnitXml, renderConformanceReportJson, formatOAuthConformanceHuman, formatOAuthConformanceSuiteHuman, fetchOAuthMetadata, executeOAuthProxy, executeDebugOAuthProxy, normalizeRegistrationStrategy, normalizeXaaClientAuth, normalizeIdentityAssertionFormat, IDENTITY_ASSERTION_FORMATS, XAA_CONFIDENTIAL_CIMD_ORIGIN, getLocalConfidentialCimdProvider, MCP_PROTOCOL_VERSIONS, gatherClaudeReadinessEvidence, gradeClaudeReadiness, gatherOpenAIReadinessEvidence, xmldomParseXml, gradeOpenAIReadiness, openUrlInBrowser, buildEvalRunReport, GATE_WAIVER_MAX_REASON_LENGTH, GATE_WAIVER_REASON_NOTICE, MCPClientManager, withSkillsExtensionCapability, MCP_SKILLS_EXTENSION_ID, decodeMcpHeaderValue, canDeclareTasksExtension, createStrictElicitationContentValidator, MCP_APPS_CHECK_CATEGORIES, MCP_APPS_CHECK_IDS, MCP_TASKS_CHECK_CATEGORIES, MCP_TASKS_CHECK_IDS, OAuthProxyError, isLoopbackHost, MCP_CHECK_CATEGORIES, MCP_CHECK_IDS, OPENAI_SUBMISSION_MODE_SHAPES, createDirectoryPluginFileSource, collectZipArchiveObservations, createZipPluginFileSource, generateRandomString, generateCodeChallenge, createInteractiveAuthorizationSession, loadEvalSuiteFile, declareEvalSuiteFileValidity, formatEvalRunDecisionSummary, gateOutcomeVerdict, applyGateWaiver, formatGateReport, formatGateWaiverLine, detectFlakyCases, evaluateCompareGates, buildRunCompareReport, formatSuiteFileFindings, serializeEvalSuiteFile, MAX_SUITE_FILE_BYTES, buildCorpus, HostedOnlyCaseError, verifyCorpusLock, detectCiMetadata, TaskLifecycleEngine, driveTaskToTerminal, extensionTaskToObservation, legacyTaskToObservation, executionRailLabel, executionDeviationTitle, canonicalDigest, readEvalRunDecisionSummary as readEvalRunDecisionSummary$1, buildEvalRunDecisionSummary, readExecutionRecord, formatExecutionProvenanceLine, formatExecutionDeviationLine, evaluateGates, gateInputFromPlatformRun, isGateWaiverInForce, calculateLatencyStats, CORPUS_LOCK_VERSION, suiteFilePointer, passRateFractionFromPercent, DEFAULT_MIN_EFFECT_SIZE, DEFAULT_MIN_SAMPLE_SIZE, planPlatformSuiteGradingUpdate, isUnknownTaskError, isMCPTasksWireError, LEGACY_TASK_STATUSES } from '@mcpjam/sdk';
|
|
6
|
+
import path7, { join, dirname, basename, resolve } from 'path';
|
|
7
7
|
import { randomUUID, randomBytes, createHash } from 'crypto';
|
|
8
8
|
import { mkdir, writeFile, readFile, chmod, rename, rm, open, unlink, stat } from 'fs/promises';
|
|
9
9
|
import { spawn } from 'child_process';
|
|
10
10
|
import { createRequire } from 'module';
|
|
11
11
|
import os, { homedir, tmpdir } from 'os';
|
|
12
|
-
import { RUN_LAUNCH_HEADERS, getRegistryDirectoryServerOperation, listOrganizationsOperation, listProjectsOperation, createProjectOperation, updateProjectOperation, deleteProjectOperation, connectProjectServerOperation, getProjectServerConnectionStatusOperation, cancelProjectServerConnectionOperation, listChatSessionsOperation, resolveProject, sendChatMessageOperation, createTunnelOperation, listEvalSuiteRunsOperation, listEvalSuiteRevisionsOperation, runEvalSuiteOperation, getEvalRunOperation, getEvalRunRouteFactsOperation, getEvalRunServerFactsOperation, proposeEvalDescriptionRewriteOperation, startEvalDescriptionExperimentOperation, getEvalDescriptionExperimentOperation, cancelEvalRunOperation, backtestEvalRunJudgeOperation, backtestEvalRunOperation, requestEvalRunJudgeOperation, listEvalRunIterationsOperation, getEvalIterationTraceOperation, getEvalRunStepsOperation, getEvalSuiteOperation, updateEvalSuiteOperation, deleteEvalSuiteOperation, setEvalSuiteScheduleOperation, setEvalSuiteEnvironmentsOperation, listEvalCasesOperation, getEvalCaseOperation, createEvalCaseOperation, updateEvalCaseOperation, deleteEvalCaseOperation, generateEvalCasesOperation, createClientOperation, updateClientOperation, setClientServersOperation, duplicateClientOperation, createEnvironmentOperation, ensureAdhocEnvironmentOperation, nameEnvironmentOperation, updateEnvironmentOperation, createSecretOperation, updateSecretOperation, createImageOperation, validateImageBlueprintOperation, updateImageOperation, listTraceDestinationsOperation, getTraceDestinationOperation, createTraceDestinationOperation, updateTraceDestinationOperation, deleteTraceDestinationOperation, testTraceDestinationOperation, pauseTraceDestinationOperation, resumeTraceDestinationOperation, backfillTraceDestinationOperation, listTraceDestinationBackfillsOperation, runOperationWithPermalinks, withPermalinkEnvelope, PlatformApiError, installRegistryServerOperation, installRegistryDirectoryServerOperation, getProjectServerOperation, DEFAULT_PLATFORM_API_BASE_URL, projectResolutionError, listProjectServersOperation, createProjectServerOperation, updateProjectServerOperation, deleteProjectServerOperation, showServersOperation, driveChatSessionBrowserOperation, observeChatSessionBrowserOperation, isPlatformApiError, describePlatformRefusal, platformRefusalHint, createEvalSuiteOperation, listEvalSuitesOperation, buildAppPermalink, listEvalSuiteStageAnalyticsOperation, getEvalRunStageAnalyticsOperation, listEvalGithubReposOperation, connectEvalGithubRepoOperation, resolveEnvironmentOperation, listClientsOperation, getClientOperation, deleteClientOperation, listEnvironmentsOperation, getEnvironmentOperation, getEnvironmentCapabilitiesOperation, archiveEnvironmentOperation, restoreEnvironmentOperation, listSecretsOperation, getSecretOperation, deleteSecretOperation, listImagesOperation, getImageOperation, buildImageOperation, listImageBuildsOperation, useImageOperation, resetComputerOperation, promoteImageOperation, deleteImageOperation, listProjectSkillsOperation, getProjectSkillOperation, listGoalsOperation, listGoalRunsOperation, getGoalRunOperation, launchGoalRunOperation, cancelGoalRunOperation, listGoalRunSessionsOperation, PlatformApiClient, platformBrowserToolPolicySchema, listServerToolsOperation, runEvalCaseOperation, getCapabilitiesOperation, getStudyOperation, listStudySessionsOperation, getStudySessionOperation, getStudyMetricsOperation, getStudyUsageOperation, listStudyFindingsOperation, getStudySignalsOperation, getStudyInsightsOperation, requestStudyInsightsOperation, cancelStudyInsightsOperation, dismissStudyFindingOperation, undismissStudyFindingOperation, updateStudyOperation, setStudyGuestExecutionOperation, rotateStudyLinkOperation, upsertStudyMemberOperation, removeStudyMemberOperation, rebindStudyOperation, listStudiesOperation, publishStudyOperation, unpublishStudyOperation, searchSessionsOperation, getChatSessionOperation, getChatSessionTraceOperation, listPersonasOperation, getPersonaOperation, createPersonaOperation, updatePersonaOperation, deletePersonaOperation, generatePersonasOperation, getGoalOperation, createGoalOperation, updateGoalOperation, archiveGoalOperation, generateGoalsOperation, getSwarmOverviewOperation, getGoalRunScorecardOperation, listSwarmFindingsOperation, dismissSwarmFindingOperation, undismissSwarmFindingOperation, getSwarmRunInsightsOperation, requestSwarmRunInsightsOperation, cancelSwarmRunInsightsOperation, listSwarmsOperation, getSwarmOperation, createSwarmOperation, updateSwarmOperation, archiveSwarmOperation, startClaudeReadinessRunOperation, startOpenAIReadinessRunOperation, getReadinessRunOperation, listReadinessRunsOperation, cancelReadinessRunOperation, getReadinessReportOperation, listRegistryDirectorySourcesOperation, searchRegistryDirectoryOperation, listRegistryServersOperation, listRegistryConnectionsOperation, uninstallRegistryServerOperation } from '@mcpjam/sdk/platform';
|
|
12
|
+
import { RUN_LAUNCH_HEADERS, getRegistryDirectoryServerOperation, listOrganizationsOperation, listProjectsOperation, createProjectOperation, updateProjectOperation, deleteProjectOperation, connectProjectServerOperation, getProjectServerConnectionStatusOperation, cancelProjectServerConnectionOperation, listChatSessionsOperation, resolveProject, sendChatMessageOperation, createTunnelOperation, listEvalSuiteRunsOperation, listEvalSuiteRevisionsOperation, runEvalSuiteOperation, getEvalRunOperation, getEvalRunRouteFactsOperation, getEvalRunServerFactsOperation, proposeEvalDescriptionRewriteOperation, startEvalDescriptionExperimentOperation, getEvalDescriptionExperimentOperation, cancelEvalRunOperation, backtestEvalRunJudgeOperation, backtestEvalRunOperation, requestEvalRunJudgeOperation, listEvalRunIterationsOperation, getEvalIterationTraceOperation, getEvalRunStepsOperation, getEvalSuiteOperation, updateEvalSuiteOperation, deleteEvalSuiteOperation, setEvalSuiteScheduleOperation, setEvalSuiteEnvironmentsOperation, listEvalCasesOperation, getEvalCaseOperation, createEvalCaseOperation, updateEvalCaseOperation, deleteEvalCaseOperation, generateEvalCasesOperation, importEvalCasesOperation, createClientOperation, updateClientOperation, setClientServersOperation, duplicateClientOperation, createEnvironmentOperation, ensureAdhocEnvironmentOperation, nameEnvironmentOperation, updateEnvironmentOperation, createSecretOperation, updateSecretOperation, createImageOperation, validateImageBlueprintOperation, updateImageOperation, listTraceDestinationsOperation, getTraceDestinationOperation, createTraceDestinationOperation, updateTraceDestinationOperation, deleteTraceDestinationOperation, testTraceDestinationOperation, pauseTraceDestinationOperation, resumeTraceDestinationOperation, backfillTraceDestinationOperation, listTraceDestinationBackfillsOperation, runOperationWithPermalinks, withPermalinkEnvelope, PlatformApiError, installRegistryServerOperation, installRegistryDirectoryServerOperation, getProjectServerOperation, DEFAULT_PLATFORM_API_BASE_URL, projectResolutionError, listProjectServersOperation, createProjectServerOperation, updateProjectServerOperation, deleteProjectServerOperation, showServersOperation, driveChatSessionBrowserOperation, observeChatSessionBrowserOperation, isPlatformApiError, describePlatformRefusal, platformRefusalHint, createEvalSuiteOperation, listEvalSuitesOperation, buildAppPermalink, listEvalSuiteStageAnalyticsOperation, getEvalRunStageAnalyticsOperation, listEvalGithubReposOperation, connectEvalGithubRepoOperation, resolveEnvironmentOperation, listClientsOperation, getClientOperation, deleteClientOperation, listEnvironmentsOperation, getEnvironmentOperation, getEnvironmentCapabilitiesOperation, archiveEnvironmentOperation, restoreEnvironmentOperation, listSecretsOperation, getSecretOperation, deleteSecretOperation, listImagesOperation, getImageOperation, buildImageOperation, listImageBuildsOperation, useImageOperation, resetComputerOperation, promoteImageOperation, deleteImageOperation, listProjectSkillsOperation, getProjectSkillOperation, listGoalsOperation, listGoalRunsOperation, getGoalRunOperation, launchGoalRunOperation, cancelGoalRunOperation, listGoalRunSessionsOperation, PlatformApiClient, platformBrowserToolPolicySchema, listServerToolsOperation, runEvalCaseOperation, getCapabilitiesOperation, getStudyOperation, listStudySessionsOperation, getStudySessionOperation, getStudyMetricsOperation, getStudyUsageOperation, listStudyFindingsOperation, getStudySignalsOperation, getStudyInsightsOperation, requestStudyInsightsOperation, cancelStudyInsightsOperation, dismissStudyFindingOperation, undismissStudyFindingOperation, updateStudyOperation, setStudyGuestExecutionOperation, rotateStudyLinkOperation, upsertStudyMemberOperation, removeStudyMemberOperation, rebindStudyOperation, listStudiesOperation, publishStudyOperation, unpublishStudyOperation, searchSessionsOperation, getChatSessionOperation, getChatSessionTraceOperation, listPersonasOperation, getPersonaOperation, createPersonaOperation, updatePersonaOperation, deletePersonaOperation, generatePersonasOperation, getGoalOperation, createGoalOperation, updateGoalOperation, archiveGoalOperation, generateGoalsOperation, getSwarmOverviewOperation, getGoalRunScorecardOperation, listSwarmFindingsOperation, dismissSwarmFindingOperation, undismissSwarmFindingOperation, getSwarmRunInsightsOperation, requestSwarmRunInsightsOperation, cancelSwarmRunInsightsOperation, listSwarmsOperation, getSwarmOperation, createSwarmOperation, updateSwarmOperation, archiveSwarmOperation, startClaudeReadinessRunOperation, startOpenAIReadinessRunOperation, getReadinessRunOperation, listReadinessRunsOperation, cancelReadinessRunOperation, getReadinessReportOperation, listRegistryDirectorySourcesOperation, searchRegistryDirectoryOperation, listRegistryServersOperation, listRegistryConnectionsOperation, uninstallRegistryServerOperation } from '@mcpjam/sdk/platform';
|
|
13
13
|
import { isDeepStrictEqual } from 'util';
|
|
14
14
|
import { swarmVerdictLabel, composeSuiteGateWithBaseReport, EVAL_SUITE_SCHEMA_VERSION, EVAL_SUITE_SCHEMA_VERSIONS, MAX_BATCH_CREATE_CASES, filterSuppressedSuiteAssertions, evalSuiteFileSchema, MAX_IMPORT_NOTE_CHARS, isOpaqueId } from '@mcpjam/sdk/contract';
|
|
15
15
|
import { HOST_TEMPLATES, HOST_TEMPLATE_IDS, seedHostTemplate } from '@mcpjam/sdk/host-config/templates';
|
|
@@ -28,7 +28,7 @@ import { PostHog } from 'posthog-node';
|
|
|
28
28
|
|
|
29
29
|
// package.json
|
|
30
30
|
var package_default = {
|
|
31
|
-
version: "5.11.
|
|
31
|
+
version: "5.11.4"};
|
|
32
32
|
function conformanceExitCode(result) {
|
|
33
33
|
if (result.outcome === "incomplete") return 3;
|
|
34
34
|
if (result.outcome === "failed") return 1;
|
|
@@ -7932,6 +7932,57 @@ function classifyWaitErrorExitCode(code) {
|
|
|
7932
7932
|
if (code !== void 0 && AUTH_SHAPED_CODES.has(code)) return 3;
|
|
7933
7933
|
return 5;
|
|
7934
7934
|
}
|
|
7935
|
+
function iterationLabel(iteration) {
|
|
7936
|
+
const title = iteration.title?.trim();
|
|
7937
|
+
return title ? `${title} #${iteration.iterationNumber}` : `iteration #${iteration.iterationNumber} (${iteration.id})`;
|
|
7938
|
+
}
|
|
7939
|
+
function formatIterationProvenance(runs) {
|
|
7940
|
+
const lines = [];
|
|
7941
|
+
for (const run of runs) {
|
|
7942
|
+
if (run.error !== void 0) {
|
|
7943
|
+
lines.push(
|
|
7944
|
+
`Iteration provenance (run ${run.runId}): unavailable \u2014 ${run.error}`
|
|
7945
|
+
);
|
|
7946
|
+
continue;
|
|
7947
|
+
}
|
|
7948
|
+
if (run.iterations.length === 0) continue;
|
|
7949
|
+
lines.push(`Iteration provenance (run ${run.runId}):`);
|
|
7950
|
+
const ordered = [...run.iterations].sort(
|
|
7951
|
+
(a, b) => (a.title ?? "").localeCompare(b.title ?? "") || a.iterationNumber - b.iterationNumber
|
|
7952
|
+
);
|
|
7953
|
+
for (const iteration of ordered) {
|
|
7954
|
+
const record = readExecutionRecord(iteration.execution);
|
|
7955
|
+
if (!record) {
|
|
7956
|
+
lines.push(` ${iterationLabel(iteration)}: not recorded`);
|
|
7957
|
+
continue;
|
|
7958
|
+
}
|
|
7959
|
+
lines.push(
|
|
7960
|
+
` ${iterationLabel(iteration)}: ${formatExecutionProvenanceLine(
|
|
7961
|
+
record
|
|
7962
|
+
)}`
|
|
7963
|
+
);
|
|
7964
|
+
if (record.deviation) {
|
|
7965
|
+
lines.push(` ${formatExecutionDeviationLine(record.deviation)}`);
|
|
7966
|
+
}
|
|
7967
|
+
}
|
|
7968
|
+
}
|
|
7969
|
+
return lines;
|
|
7970
|
+
}
|
|
7971
|
+
function writeIterationProvenance(format, runs, stream = process.stdout) {
|
|
7972
|
+
if (format !== "human") return;
|
|
7973
|
+
const lines = formatIterationProvenance(runs);
|
|
7974
|
+
if (lines.length === 0) return;
|
|
7975
|
+
stream.write(`${lines.join("\n")}
|
|
7976
|
+
`);
|
|
7977
|
+
}
|
|
7978
|
+
function formatRecordedExecutionDisclosure(model) {
|
|
7979
|
+
if (model.provenance !== "execution-record" || !model.recorded) return null;
|
|
7980
|
+
const { records, resolvedRails, attemptedRails, deviations } = model.recorded;
|
|
7981
|
+
const extraRails = attemptedRails.filter(
|
|
7982
|
+
(rail) => !resolvedRails.includes(rail)
|
|
7983
|
+
);
|
|
7984
|
+
return `Recorded (${records} record${records === 1 ? "" : "s"}): ran via ${resolvedRails.map(executionRailLabel).join(", ") || "no rail recorded"}` + (extraRails.length > 0 ? `; also attempted ${extraRails.map(executionRailLabel).join(", ")}` : "") + (deviations.length > 0 ? `; deviations: ${deviations.map(executionDeviationTitle).join(", ")}` : "");
|
|
7985
|
+
}
|
|
7935
7986
|
function decisionSummaryFromIterations(input) {
|
|
7936
7987
|
return buildEvalRunDecisionSummary({
|
|
7937
7988
|
projectId: input.projectId,
|
|
@@ -8060,22 +8111,21 @@ function composeField(options) {
|
|
|
8060
8111
|
"--compose-server and --compose-server-group both pin the run's servers. Use --compose-server with server names, or --compose-server-group with an existing group ID."
|
|
8061
8112
|
);
|
|
8062
8113
|
}
|
|
8063
|
-
|
|
8064
|
-
if (options.composeHostServers === true && pinsServers) {
|
|
8114
|
+
if (options.composeHostServers === true) {
|
|
8065
8115
|
throw usageError(
|
|
8066
|
-
"--compose-host-servers
|
|
8116
|
+
"--compose-host-servers is no longer supported: an eval run takes its servers from a server group alone, so following the client's list would run with no servers. Use --compose-server <name> or --compose-server-group <id> instead."
|
|
8067
8117
|
);
|
|
8068
8118
|
}
|
|
8069
|
-
|
|
8119
|
+
const pinsServers = options.composeServerGroup !== void 0 || (options.composeServer?.length ?? 0) > 0;
|
|
8120
|
+
if (!pinsServers) {
|
|
8070
8121
|
throw usageError(
|
|
8071
|
-
`${clientFlag} needs to know which servers to test: add --compose-server <name
|
|
8122
|
+
`${clientFlag} needs to know which servers to test: add --compose-server <name> (or --compose-server-group <id>).`
|
|
8072
8123
|
);
|
|
8073
8124
|
}
|
|
8074
8125
|
return {
|
|
8075
8126
|
compose: {
|
|
8076
8127
|
host: composeClient,
|
|
8077
8128
|
...options.composeServerGroup !== void 0 ? { serverGroup: options.composeServerGroup } : {},
|
|
8078
|
-
...options.composeHostServers === true ? { hostServers: true } : {},
|
|
8079
8129
|
...selectorField("server", "servers", options.composeServer),
|
|
8080
8130
|
...models !== void 0 ? { models } : {},
|
|
8081
8131
|
...options.withClientDefault === true ? { includeClientDefault: true } : {},
|
|
@@ -8176,6 +8226,8 @@ function writeRunDisclosure(format, disclosure, stream = process.stdout) {
|
|
|
8176
8226
|
for (const model of execution.models) {
|
|
8177
8227
|
const destination = model.byok?.baseUrlHost ? model.byok.baseUrlHost : model.rail.managed ? `${model.rail.possibleDestinations.join(" or ")} (currently: ${model.rail.outcomeIfRunNow.destination})` : model.tenantEgress;
|
|
8178
8228
|
lines.push(` Model: ${model.modelId} \u2014 ${destination}`);
|
|
8229
|
+
const recorded = formatRecordedExecutionDisclosure(model);
|
|
8230
|
+
if (recorded) lines.push(` ${recorded}`);
|
|
8179
8231
|
}
|
|
8180
8232
|
} else if (execution.modelsUnresolved) {
|
|
8181
8233
|
lines.push(
|
|
@@ -8197,6 +8249,14 @@ function writeRunDisclosure(format, disclosure, stream = process.stdout) {
|
|
|
8197
8249
|
lines.push(
|
|
8198
8250
|
` Redaction: ${disclosure.capture.redaction.kind}` + (disclosure.capture.redaction.isDlp ? "" : ` \u2014 NOT a DLP system (${disclosure.capture.redaction.limitation})`)
|
|
8199
8251
|
);
|
|
8252
|
+
const providerRetention = disclosure.capture.redaction.providerRetention;
|
|
8253
|
+
if (providerRetention) {
|
|
8254
|
+
const noTraining = providerRetention.openrouter.data_collection === "deny" && providerRetention.gateway.disallowPromptTraining;
|
|
8255
|
+
const policy = providerRetention.zeroDataRetention ? noTraining ? "zero data retention and no training required" : "zero data retention required, training NOT restricted" : noTraining ? "no training required, zero data retention NOT required" : "zero data retention and training NOT restricted";
|
|
8256
|
+
lines.push(
|
|
8257
|
+
` Analysis providers: ${policy} on platform-key analysis calls` + (providerRetention.notAppliedTo.length > 0 ? ` \u2014 NOT applied to: ${providerRetention.notAppliedTo.join("; ")}` : "")
|
|
8258
|
+
);
|
|
8259
|
+
}
|
|
8200
8260
|
lines.push(
|
|
8201
8261
|
` Export defaults: ${disclosure.capture.exportDefaults.includeContent ? "includes content" : "excludes content"} (${disclosure.capture.exportDefaults.note})`
|
|
8202
8262
|
);
|
|
@@ -9938,7 +9998,7 @@ function registerEvalCommands(program) {
|
|
|
9938
9998
|
"Standalone server group to pin on the composed stack"
|
|
9939
9999
|
).option(
|
|
9940
10000
|
"--compose-host-servers",
|
|
9941
|
-
"
|
|
10001
|
+
"No longer supported: eval runs take their servers from a server group. Use --compose-server or --compose-server-group."
|
|
9942
10002
|
).option(
|
|
9943
10003
|
"--compose-skill <id...>",
|
|
9944
10004
|
"Project-shared skill IDs to pin on the composed stack"
|
|
@@ -10177,11 +10237,34 @@ function registerEvalCommands(program) {
|
|
|
10177
10237
|
result.project.id,
|
|
10178
10238
|
runs[0]
|
|
10179
10239
|
) : void 0;
|
|
10240
|
+
const provenance = globalOptions.format === "human" ? await Promise.all(
|
|
10241
|
+
runs.map(async (run) => {
|
|
10242
|
+
try {
|
|
10243
|
+
const iterations = await fetchAllIterations(
|
|
10244
|
+
client,
|
|
10245
|
+
signal,
|
|
10246
|
+
result.project.id,
|
|
10247
|
+
run.id
|
|
10248
|
+
);
|
|
10249
|
+
return {
|
|
10250
|
+
runId: run.id,
|
|
10251
|
+
iterations: iterations.items
|
|
10252
|
+
};
|
|
10253
|
+
} catch (error) {
|
|
10254
|
+
return {
|
|
10255
|
+
runId: run.id,
|
|
10256
|
+
iterations: [],
|
|
10257
|
+
error: error instanceof Error ? error.message : String(error)
|
|
10258
|
+
};
|
|
10259
|
+
}
|
|
10260
|
+
})
|
|
10261
|
+
) : [];
|
|
10180
10262
|
return {
|
|
10181
10263
|
runs,
|
|
10182
10264
|
waitErrors,
|
|
10183
10265
|
reportInputs: [],
|
|
10184
10266
|
iterationErrorCodes: /* @__PURE__ */ new Map(),
|
|
10267
|
+
provenance,
|
|
10185
10268
|
...soloSummary ? { decisionSummary: soloSummary } : {}
|
|
10186
10269
|
};
|
|
10187
10270
|
}
|
|
@@ -10227,6 +10310,14 @@ function registerEvalCommands(program) {
|
|
|
10227
10310
|
waitErrors,
|
|
10228
10311
|
reportInputs,
|
|
10229
10312
|
iterationErrorCodes,
|
|
10313
|
+
// Free: the walk the report already paid for.
|
|
10314
|
+
provenance: reportInputs.map(
|
|
10315
|
+
(input) => ({
|
|
10316
|
+
runId: input.run.id,
|
|
10317
|
+
iterations: input.iterations,
|
|
10318
|
+
...input.iterationError !== void 0 ? { error: input.iterationError } : {}
|
|
10319
|
+
})
|
|
10320
|
+
),
|
|
10230
10321
|
...decisionSummary ? { decisionSummary } : {}
|
|
10231
10322
|
};
|
|
10232
10323
|
},
|
|
@@ -10288,6 +10379,11 @@ function registerEvalCommands(program) {
|
|
|
10288
10379
|
}
|
|
10289
10380
|
if (reporter && report) {
|
|
10290
10381
|
writeReporterResult(reporter, report);
|
|
10382
|
+
writeIterationProvenance(
|
|
10383
|
+
globalOptions.format,
|
|
10384
|
+
completion.provenance,
|
|
10385
|
+
process.stderr
|
|
10386
|
+
);
|
|
10291
10387
|
} else {
|
|
10292
10388
|
writeResult(
|
|
10293
10389
|
{
|
|
@@ -10312,6 +10408,11 @@ function registerEvalCommands(program) {
|
|
|
10312
10408
|
completion.decisionSummary,
|
|
10313
10409
|
process.stdout
|
|
10314
10410
|
);
|
|
10411
|
+
writeIterationProvenance(
|
|
10412
|
+
globalOptions.format,
|
|
10413
|
+
completion.provenance,
|
|
10414
|
+
process.stdout
|
|
10415
|
+
);
|
|
10315
10416
|
}
|
|
10316
10417
|
if (outWriteError !== void 0) {
|
|
10317
10418
|
throw cliError("OUT_WRITE_FAILED", outWriteError, worstOf([code, 4]));
|
|
@@ -11444,7 +11545,7 @@ ${summary}
|
|
|
11444
11545
|
"Standalone server group to pin on the composed stack"
|
|
11445
11546
|
).option(
|
|
11446
11547
|
"--compose-host-servers",
|
|
11447
|
-
"
|
|
11548
|
+
"No longer supported: eval runs take their servers from a server group. Use --compose-server or --compose-server-group."
|
|
11448
11549
|
).option(
|
|
11449
11550
|
"--compose-skill <id...>",
|
|
11450
11551
|
"Project-shared skill IDs to pin on the composed stack"
|
|
@@ -11561,6 +11662,50 @@ ${summary}
|
|
|
11561
11662
|
await executeOp(generateEvalCasesOperation, input, options, command);
|
|
11562
11663
|
}
|
|
11563
11664
|
);
|
|
11665
|
+
cases.command("import").description(
|
|
11666
|
+
"Turn any text document \u2014 markdown, JSON, CSV, notes \u2014 into test cases with MCPJam's AI and add them to the suite"
|
|
11667
|
+
).requiredOption("--suite <id-or-name>", "Eval suite name or ID").option("--project <id-or-name>", PROJECT_OPT).option("--file <path>", 'Document to import ("-" reads stdin)').option("--content <text>", "Document text, instead of --file").option(
|
|
11668
|
+
"--file-name <name>",
|
|
11669
|
+
"Name recorded on each case's source (default: --file's basename)"
|
|
11670
|
+
).option(
|
|
11671
|
+
"--server <id-or-name...>",
|
|
11672
|
+
"Servers to discover tools from (default: suite's)"
|
|
11673
|
+
).option(
|
|
11674
|
+
"--environment <id-or-name>",
|
|
11675
|
+
"Discover tools from this attached environment's server set"
|
|
11676
|
+
).option("--case-model <id...>", "Execution model(s) for the imported cases").option(
|
|
11677
|
+
"--duplicate-policy <block|warn|create_anyway>",
|
|
11678
|
+
"What to do with a case that already exists (default block)"
|
|
11679
|
+
).option(
|
|
11680
|
+
"--override-reason <text>",
|
|
11681
|
+
"Why importing a duplicate is intended (required by warn / create_anyway)"
|
|
11682
|
+
).option(
|
|
11683
|
+
"--idempotency-key <key>",
|
|
11684
|
+
"Retry-safety key: repeating the call replays the first attempt's drafts instead of authoring (and billing) again"
|
|
11685
|
+
).action(
|
|
11686
|
+
async (options, command) => {
|
|
11687
|
+
if (!options.file === !options.content)
|
|
11688
|
+
throw usageError(
|
|
11689
|
+
"Pass exactly one of --file or --content.",
|
|
11690
|
+
options.file ? { source: "Both were given." } : { source: "Neither was given." }
|
|
11691
|
+
);
|
|
11692
|
+
const content = options.file ? readFileOrStdin(options.file, "document") : options.content;
|
|
11693
|
+
const fileName = options.fileName ?? (options.file && options.file !== "-" ? basename(options.file) : void 0);
|
|
11694
|
+
const input = validateOpInput(importEvalCasesOperation, {
|
|
11695
|
+
project: options.project,
|
|
11696
|
+
suite: options.suite,
|
|
11697
|
+
content,
|
|
11698
|
+
...fileName ? { fileName } : {},
|
|
11699
|
+
...options.server ? { servers: options.server } : {},
|
|
11700
|
+
...options.environment ? { environment: options.environment } : {},
|
|
11701
|
+
...options.caseModel ? { caseModels: options.caseModel.map((model) => ({ model })) } : {},
|
|
11702
|
+
...options.duplicatePolicy ? { duplicatePolicy: options.duplicatePolicy } : {},
|
|
11703
|
+
...options.overrideReason ? { overrideReason: options.overrideReason } : {},
|
|
11704
|
+
...options.idempotencyKey ? { idempotencyKey: options.idempotencyKey } : {}
|
|
11705
|
+
});
|
|
11706
|
+
await executeOp(importEvalCasesOperation, input, options, command);
|
|
11707
|
+
}
|
|
11708
|
+
);
|
|
11564
11709
|
}
|
|
11565
11710
|
var CLIENT_TEMPLATES = HOST_TEMPLATES.map(({ id, label }) => ({ id, label }));
|
|
11566
11711
|
function selectorOf(options) {
|