@mcpjam/cli 5.14.1 → 5.15.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 CHANGED
@@ -2,16 +2,16 @@
2
2
  import { Command, CommanderError, Option } from 'commander';
3
3
  import { realpathSync, readFileSync, existsSync, mkdirSync, writeFileSync, unlinkSync, statSync, closeSync, renameSync, lstatSync, openSync } from 'fs';
4
4
  import { pathToFileURL } from 'url';
5
- import { MODEL_REASONING_EFFORTS, loadEvalSuiteFile, createSuiteFileRunner, runSuiteFile, SuiteFileRunError, formatLocalEvalRunSummary, renderStructuredRunJson, 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, renderStructuredRunJUnitXml, renderStructuredRunHtml, withEphemeralClient, diffServerSnapshots, ServerSnapshotFormatError, 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, detectCiMetadata, 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, declareEvalSuiteFileValidity, formatEvalRunDecisionSummary, gateOutcomeVerdict, applyGateWaiver, formatGateReport, formatGateWaiverLine, detectFlakyCases, evaluateCompareGates, buildRunCompareReport, formatSuiteFileFindings, serializeEvalSuiteFile, MAX_SUITE_FILE_BYTES, buildCorpus, HostedOnlyCaseError, verifyCorpusLock, 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';
5
+ import { MODEL_REASONING_EFFORTS, loadEvalSuiteFile, createSuiteFileRunner, runSuiteFile, SuiteFileRunError, formatLocalEvalRunSummary, renderStructuredRunJson, 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, renderStructuredRunJUnitXml, renderStructuredRunHtml, withEphemeralClient, diffServerSnapshots, ServerSnapshotFormatError, 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, gatherMuseReadinessEvidence, gradeMuseReadiness, openUrlInBrowser, buildEvalRunReport, GATE_WAIVER_MAX_REASON_LENGTH, GATE_WAIVER_REASON_NOTICE, MCPClientManager, withSkillsExtensionCapability, detectCiMetadata, 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, declareEvalSuiteFileValidity, formatEvalRunDecisionSummary, gateOutcomeVerdict, applyGateWaiver, formatGateReport, formatGateWaiverLine, detectFlakyCases, evaluateCompareGates, buildRunCompareReport, formatSuiteFileFindings, serializeEvalSuiteFile, MAX_SUITE_FILE_BYTES, buildCorpus, HostedOnlyCaseError, verifyCorpusLock, TaskLifecycleEngine, driveTaskToTerminal, extensionTaskToObservation, legacyTaskToObservation, 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
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, isPlatformApiError, resolveProject, listOrganizationsOperation, listProjectsOperation, createProjectOperation, updateProjectOperation, deleteProjectOperation, connectProjectServerOperation, getProjectServerConnectionStatusOperation, cancelProjectServerConnectionOperation, listChatSessionsOperation, 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, PlatformApiClient, projectResolutionError, listProjectServersOperation, createProjectServerOperation, updateProjectServerOperation, deleteProjectServerOperation, showServersOperation, driveChatSessionBrowserOperation, observeChatSessionBrowserOperation, 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, platformBrowserToolPolicySchema, listServerToolsOperation, runEvalCaseOperation, sendFeedbackOperation, 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, isPlatformApiError, resolveProject, listOrganizationsOperation, listProjectsOperation, createProjectOperation, updateProjectOperation, deleteProjectOperation, connectProjectServerOperation, getProjectServerConnectionStatusOperation, cancelProjectServerConnectionOperation, listChatSessionsOperation, 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, PlatformApiClient, projectResolutionError, listProjectServersOperation, createProjectServerOperation, updateProjectServerOperation, deleteProjectServerOperation, showServersOperation, driveChatSessionBrowserOperation, observeChatSessionBrowserOperation, 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, platformBrowserToolPolicySchema, listServerToolsOperation, runEvalCaseOperation, sendFeedbackOperation, 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, startMuseReadinessRunOperation, getReadinessRunOperation, listReadinessRunsOperation, cancelReadinessRunOperation, getReadinessReportOperation, listRegistryDirectorySourcesOperation, searchRegistryDirectoryOperation, listRegistryServersOperation, listRegistryConnectionsOperation, uninstallRegistryServerOperation } from '@mcpjam/sdk/platform';
13
13
  import { isDeepStrictEqual } from 'util';
14
- import { swarmVerdictLabel, composeSuiteGateWithBaseReport, EVAL_SUITE_SCHEMA_VERSION, EVAL_SUITE_SCHEMA_VERSIONS, MAX_BATCH_CREATE_CASES, filterSuppressedSuiteAssertions, LEGACY_SUITE_WIDE_THRESHOLD_PERCENT, evalSuiteFileSchema, MAX_IMPORT_NOTE_CHARS, isOpaqueId } from '@mcpjam/sdk/contract';
14
+ import { swarmVerdictLabel, composeSuiteGateWithBaseReport, EVAL_SUITE_SCHEMA_VERSION, EVAL_SUITE_SCHEMA_VERSIONS, MAX_BATCH_CREATE_CASES, filterSuppressedSuiteAssertions, DEFAULT_SUITE_WIDE_THRESHOLD_PERCENT, 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';
16
16
  import { setTimeout as setTimeout$1 } from 'timers/promises';
17
17
  import http from 'http';
@@ -29,7 +29,7 @@ import { selectPluginMcpServerMap, detectPluginMcpTransport } from '@mcpjam/sdk/
29
29
 
30
30
  // package.json
31
31
  var package_default = {
32
- version: "5.14.1"};
32
+ version: "5.15.0"};
33
33
  function conformanceExitCode(result) {
34
34
  if (result.outcome === "incomplete") return 3;
35
35
  if (result.outcome === "failed") return 1;
@@ -4626,8 +4626,8 @@ function bindOperation(command, operation, buildInput, bindExtras = {}) {
4626
4626
  });
4627
4627
  }
4628
4628
  async function runCloudOp(command, options, execute, extra = {}) {
4629
- const globalOptions = getGlobalOptions(command);
4630
- const { extras: nestedExtras, ...selectorExtra } = extra;
4629
+ const { defaultTimeoutMs, extras: nestedExtras, ...selectorExtra } = extra;
4630
+ const globalOptions = getGlobalOptions(command, defaultTimeoutMs);
4631
4631
  const resolved = resolveCloudProjectArgs(options, selectorExtra);
4632
4632
  return runPlatformOperation(
4633
4633
  platformOptionsOf(command),
@@ -6003,10 +6003,10 @@ function suiteLevelFindings(detail, cases, environment) {
6003
6003
  );
6004
6004
  }
6005
6005
  } else if (
6006
- // A legacy suite with no minimum accuracy is NOT unset: every legacy
6007
- // producer grades it at `LEGACY_SUITE_WIDE_THRESHOLD_PERCENT` (100, "every
6008
- // unit must pass"), so exporting that value is lossless. Only a present
6009
- // value that does not convert cleanly is refused.
6006
+ // A legacy suite with no minimum accuracy is NOT unset: every new run is
6007
+ // stamped with `DEFAULT_SUITE_WIDE_THRESHOLD_PERCENT` (70), so exporting
6008
+ // that value is lossless. Only a present value that does not convert
6009
+ // cleanly is refused.
6010
6010
  typeof settings.minimumAccuracy === "number" && (settings.minimumAccuracy < 0 || settings.minimumAccuracy > 100 || percentToFraction(settings.minimumAccuracy) === null)
6011
6011
  ) {
6012
6012
  findings.push(
@@ -6052,14 +6052,6 @@ function caseLevelFindings(evalCase, index, suiteChecks) {
6052
6052
  )
6053
6053
  );
6054
6054
  }
6055
- if (evalCase.scenario !== void 0 && evalCase.scenario !== null) {
6056
- findings.push(
6057
- unsupported(
6058
- ["cases", index, "scenario"],
6059
- `case "${evalCase.title}" is bound to scenario "${evalCase.scenario}", which a suite file has no field for`
6060
- )
6061
- );
6062
- }
6063
6055
  if (!isNeutralMatchOptions(evalCase.matchOptions)) {
6064
6056
  findings.push(
6065
6057
  unsupported(
@@ -6219,10 +6211,10 @@ function buildSuiteFileFromPlatform(input, options = {}) {
6219
6211
  mode: "agentWorkflow",
6220
6212
  reportingMode: "standard",
6221
6213
  suite: {
6222
- // File-owned suites keep the declared id the file authored. A UI suite
6223
- // has none, so export still writes the Convex document id — running that
6224
- // file back is the ownership refusal, not an attach.
6225
- id: detail.declaredId ?? detail.id,
6214
+ // File-owned suites keep the declared id the file authored. For a
6215
+ // UI-owned suite, derive a stable file identity distinct from the source
6216
+ // row so importing the export creates a file-owned clone.
6217
+ id: detail.declaredId ?? `s_export_${detail.id}`,
6226
6218
  name: (detail.name ?? "").trim(),
6227
6219
  ...detail.description === null || detail.description === void 0 ? {} : { description: detail.description }
6228
6220
  },
@@ -6260,9 +6252,9 @@ function buildSuiteFileFromPlatform(input, options = {}) {
6260
6252
  // Never the other way round for a v2 suite: `suiteLevelFindings` has
6261
6253
  // already refused the export when a v2 threshold is unreadable, so this
6262
6254
  // `??` can only reach the legacy branch for a legacy suite. A legacy
6263
- // suite with no percent writes the fallback every run already grades at.
6255
+ // suite with no percent writes the default every new run is stamped with.
6264
6256
  passThreshold: isVerdictPolicyV2Suite(detail.settings) ? suiteVerdictPolicyThreshold(detail.settings) : percentToFraction(
6265
- detail.settings.minimumAccuracy ?? LEGACY_SUITE_WIDE_THRESHOLD_PERCENT
6257
+ detail.settings.minimumAccuracy ?? DEFAULT_SUITE_WIDE_THRESHOLD_PERCENT
6266
6258
  ),
6267
6259
  // `{}`, not the resolved defaults: the contract documents them and the
6268
6260
  // loader applies them, and writing them here would put values nobody
@@ -6278,6 +6270,7 @@ function buildSuiteFileFromPlatform(input, options = {}) {
6278
6270
  id: caseIds[index],
6279
6271
  title: evalCase.title,
6280
6272
  ...evalCase.intent === void 0 ? {} : { intent: evalCase.intent },
6273
+ ...evalCase.scenario == null ? {} : { scenario: evalCase.scenario },
6281
6274
  ...evalCase.iterations === iterations ? {} : { [countKey]: evalCase.iterations },
6282
6275
  ...evalCase.isNegative ? { isNegativeTest: true } : {},
6283
6276
  ...evalCase.expectedOutput === void 0 || evalCase.expectedOutput === null ? {} : { expectedOutput: evalCase.expectedOutput },
@@ -6429,6 +6422,7 @@ function fileCaseToCreateBody(testCase, vocabulary = 1) {
6429
6422
  id: testCase.id,
6430
6423
  title: testCase.title,
6431
6424
  ...testCase.intent !== void 0 ? { intent: testCase.intent } : {},
6425
+ ...testCase.scenario !== void 0 ? { scenario: testCase.scenario } : {},
6432
6426
  ...testCase.kind !== void 0 ? { kind: testCase.kind } : {},
6433
6427
  steps: testCase.steps,
6434
6428
  ...testCase.suppressedSuiteStandardCheckIds !== void 0 ? {
@@ -6469,7 +6463,10 @@ function fileCaseToUpdateBody(testCase, previousSuppression, vocabulary = 1) {
6469
6463
  // stored value", so a re-sync of a file whose author deleted the import
6470
6464
  // block would otherwise leave a stale claim describing a conversion that
6471
6465
  // is no longer being asserted.
6472
- import: testCase.import ?? null
6466
+ import: testCase.import ?? null,
6467
+ // A file sync clears a removed scenario; ordinary PATCH callers can omit
6468
+ // the field to preserve the existing value.
6469
+ scenario: testCase.scenario ?? null
6473
6470
  };
6474
6471
  }
6475
6472
  function refuseEmptyEnabledSet(loaded) {
@@ -6860,37 +6857,9 @@ function mapApprovalsToHostedCases(params) {
6860
6857
  return mapped;
6861
6858
  }
6862
6859
  var MAX_APPROVAL_REASON_LENGTH = 500;
6863
- function deriveFileRunIdempotencyKey(params) {
6864
- if (params.knobs.idempotencyKey) return params.knobs.idempotencyKey;
6865
- return canonicalDigest({
6866
- sourceHash: params.sourceHash,
6867
- declaredSuiteId: params.declaredSuiteId,
6868
- project: params.projectId,
6869
- target: params.target,
6870
- servers: params.knobs.server ?? null,
6871
- environments: params.knobs.environment ?? (params.fileEnvironment ? [params.fileEnvironment] : null),
6872
- hosts: params.knobs.host ?? null,
6873
- allTargets: params.knobs.allTargets === true,
6874
- // The digest KEY keeps its original spelling: it is an idempotency payload,
6875
- // and renaming it would re-key every file run ever launched.
6876
- repetitions: params.knobs.iterations ?? params.knobs.repetitions ?? null,
6877
- cases: params.knobs.case ?? null,
6878
- excludeSkills: params.knobs.excludeSkills === true,
6879
- refreshSnapshot: params.knobs.refreshSnapshot === true,
6880
- minPassRate: params.knobs.minPassRate ?? null,
6881
- matchOptions: params.knobs.matchOptions ?? null,
6882
- compose: params.knobs.compose ?? null,
6883
- // AUTHORED ids, sorted — not the hosted row ids the sync happened to
6884
- // return. Two equivalent syncs of the same file can land on different
6885
- // hosted ids, and keying on those would make the same run with the same
6886
- // approvals look like a different run on a re-sync. Sorted so `--allow-
6887
- // approximated a --allow-approximated b` and the reverse are one key: flag
6888
- // ORDER is not a property of the run.
6889
- approvals: params.knobs.approvals ? {
6890
- cases: [...params.knobs.approvals.cases].sort(),
6891
- reason: params.knobs.approvals.reason
6892
- } : null
6893
- });
6860
+ function resolveFileRunIdempotencyKey(idempotencyKey) {
6861
+ if (idempotencyKey) return idempotencyKey;
6862
+ return randomUUID();
6894
6863
  }
6895
6864
  function selectEnabledRunCases(enabledCases, allCases, selectors) {
6896
6865
  if (!selectors?.length) {
@@ -6958,9 +6927,17 @@ async function executeEvalRunFromFile(context, params) {
6958
6927
  refuseRepetitions(loaded);
6959
6928
  refuseEmptyEnabledSet(loaded);
6960
6929
  refuseUnsupportedHostedSemantics(loaded);
6930
+ const knobs = params.knobs;
6931
+ if (loaded.authored.target.environment && knobs.server?.length) {
6932
+ throw cliError(
6933
+ "ENVIRONMENT_SERVERS_NOT_OVERRIDABLE",
6934
+ `Suite file targets environment "${loaded.authored.target.environment}", which owns its closed server set; --server cannot override it. Use the environment as declared, or create a separate suite file without target.environment for an explicit --server run.`,
6935
+ SUITE_FILE_RUN_INVALID_EXIT_CODE,
6936
+ { environment: loaded.authored.target.environment }
6937
+ );
6938
+ }
6961
6939
  const sourceHash = sha256HexOfBuffer(params.source.buffer);
6962
6940
  const authored = loaded.authored;
6963
- const knobs = params.knobs;
6964
6941
  const liveCheck = await validateImportToolReferences(context.client, {
6965
6942
  projectId: project.id,
6966
6943
  resolved: loaded.resolved,
@@ -7076,41 +7053,52 @@ async function executeEvalRunFromFile(context, params) {
7076
7053
  approvals: knobs.approvals,
7077
7054
  enabledCases: syncedCases.enabledCases
7078
7055
  });
7079
- const idempotencyKey = deriveFileRunIdempotencyKey({
7080
- sourceHash,
7081
- declaredSuiteId: authored.suite.id,
7082
- projectId: project.id,
7083
- target: authored.target,
7084
- knobs,
7085
- fileEnvironment
7086
- });
7087
- return runEvalSuiteOperation.execute(
7088
- {
7089
- project: project.id,
7090
- suite: synced.suite.id,
7091
- sourceHash,
7056
+ const idempotencyKey = resolveFileRunIdempotencyKey(knobs.idempotencyKey);
7057
+ context.onIdempotencyKey?.(idempotencyKey);
7058
+ let result;
7059
+ try {
7060
+ result = await runEvalSuiteOperation.execute(
7061
+ {
7062
+ project: project.id,
7063
+ suite: synced.suite.id,
7064
+ sourceHash,
7065
+ idempotencyKey,
7066
+ ...knobs.server ? { servers: knobs.server } : {},
7067
+ ...knobs.environment?.length === 1 ? { environment: knobs.environment[0] } : knobs.environment?.length ? { environments: knobs.environment } : fileEnvironment ? { environment: fileEnvironment } : {},
7068
+ ...knobs.host?.length === 1 ? { host: knobs.host[0] } : knobs.host?.length ? { hosts: knobs.host } : fileHosts?.length === 1 ? { host: fileHosts[0] } : fileHosts?.length ? { hosts: fileHosts } : {},
7069
+ ...knobs.allTargets ? { allAttached: true } : {},
7070
+ ...knobs.iterations !== void 0 || knobs.repetitions !== void 0 ? { iterations: knobs.iterations ?? knobs.repetitions } : {},
7071
+ cases: runCases,
7072
+ ...knobs.excludeSkills ? { excludeSkills: true } : {},
7073
+ ...knobs.refreshSnapshot ? { refreshSnapshot: true } : {},
7074
+ ...knobs.notes !== void 0 ? { notes: knobs.notes } : {},
7075
+ ...knobs.minPassRate !== void 0 ? { minPassRate: knobs.minPassRate } : {},
7076
+ ...knobs.matchOptions ? { matchOptions: knobs.matchOptions } : {},
7077
+ ...knobs.compose ? { compose: knobs.compose } : {},
7078
+ ...importApprovals ? { importApprovals } : {}
7079
+ },
7080
+ {
7081
+ client: negotiated.client,
7082
+ signal: context.signal,
7083
+ onDisclosure: context.onDisclosure,
7084
+ onDisclosureUnavailable: context.onDisclosureUnavailable
7085
+ }
7086
+ );
7087
+ } catch (error) {
7088
+ const normalized = normalizeCliError(error);
7089
+ const details = normalized.details && typeof normalized.details === "object" && !Array.isArray(normalized.details) ? { ...normalized.details, idempotencyKey } : {
7092
7090
  idempotencyKey,
7093
- ...knobs.server ? { servers: knobs.server } : {},
7094
- ...knobs.environment?.length === 1 ? { environment: knobs.environment[0] } : knobs.environment?.length ? { environments: knobs.environment } : fileEnvironment ? { environment: fileEnvironment } : {},
7095
- ...knobs.host?.length === 1 ? { host: knobs.host[0] } : knobs.host?.length ? { hosts: knobs.host } : fileHosts?.length === 1 ? { host: fileHosts[0] } : fileHosts?.length ? { hosts: fileHosts } : {},
7096
- ...knobs.allTargets ? { allAttached: true } : {},
7097
- ...knobs.iterations !== void 0 || knobs.repetitions !== void 0 ? { iterations: knobs.iterations ?? knobs.repetitions } : {},
7098
- cases: runCases,
7099
- ...knobs.excludeSkills ? { excludeSkills: true } : {},
7100
- ...knobs.refreshSnapshot ? { refreshSnapshot: true } : {},
7101
- ...knobs.notes !== void 0 ? { notes: knobs.notes } : {},
7102
- ...knobs.minPassRate !== void 0 ? { minPassRate: knobs.minPassRate } : {},
7103
- ...knobs.matchOptions ? { matchOptions: knobs.matchOptions } : {},
7104
- ...knobs.compose ? { compose: knobs.compose } : {},
7105
- ...importApprovals ? { importApprovals } : {}
7106
- },
7107
- {
7108
- client: negotiated.client,
7109
- signal: context.signal,
7110
- onDisclosure: context.onDisclosure,
7111
- onDisclosureUnavailable: context.onDisclosureUnavailable
7112
- }
7113
- );
7091
+ ...normalized.details !== void 0 ? { cause: normalized.details } : {}
7092
+ };
7093
+ throw new CliError(
7094
+ normalized.code,
7095
+ `${normalized.message}
7096
+ Retry this launch with --idempotency-key ${idempotencyKey}.`,
7097
+ normalized.exitCode,
7098
+ details
7099
+ );
7100
+ }
7101
+ return { ...result, idempotencyKey };
7114
7102
  }
7115
7103
  var DEFAULT_CORPUS_LOCK_PATH = "mcpjam-evals.lock.json";
7116
7104
  var CORPUS_DRIFT_EXIT_CODE = 1;
@@ -8270,6 +8258,12 @@ function writeRunGroupSummary(format, webOrigin, result) {
8270
8258
  if (format !== "human") return;
8271
8259
  for (const target of result.targets) {
8272
8260
  if (target.status !== "started") continue;
8261
+ if (target.deduped === true) {
8262
+ process.stderr.write(
8263
+ `Reused existing eval run ${target.runId} (idempotency key replay).
8264
+ `
8265
+ );
8266
+ }
8273
8267
  writeRunLink(format, webOrigin, {
8274
8268
  projectId: result.project.id,
8275
8269
  suiteId: result.suite.id,
@@ -8527,8 +8521,12 @@ function validateOpInput(op, raw, extras = {}) {
8527
8521
  }
8528
8522
  return parsed.data;
8529
8523
  }
8524
+ var EVAL_REQUEST_TIMEOUT_MS = 12e4;
8525
+ function evalGlobalOptions(command) {
8526
+ return getGlobalOptions(command, EVAL_REQUEST_TIMEOUT_MS);
8527
+ }
8530
8528
  async function executeOp(op, input, options, command) {
8531
- const globalOptions = getGlobalOptions(command);
8529
+ const globalOptions = evalGlobalOptions(command);
8532
8530
  const inputProject = options.project === void 0 && typeof input.project === "string" ? input.project : void 0;
8533
8531
  const resolved = resolveCloudProjectArgs(options, { inputProject });
8534
8532
  const filled = { ...input };
@@ -8815,7 +8813,7 @@ function gateReportCase(report, baselineProvenance) {
8815
8813
  }
8816
8814
  var DEFAULT_GATE_WAIT_TIMEOUT_MS = 35 * 6e4;
8817
8815
  async function runEvalGate(options, command) {
8818
- const globalOptions = getGlobalOptions(command);
8816
+ const globalOptions = evalGlobalOptions(command);
8819
8817
  const runId = options.run?.trim();
8820
8818
  if (!runId) {
8821
8819
  throw usageError("--run <id> is required. Pass the eval run to gate.");
@@ -9217,7 +9215,7 @@ function gateSubcommandScope(command) {
9217
9215
  };
9218
9216
  }
9219
9217
  async function runEvalGateWaive(options, command) {
9220
- const globalOptions = getGlobalOptions(command);
9218
+ const globalOptions = evalGlobalOptions(command);
9221
9219
  const scope = gateSubcommandScope(command);
9222
9220
  const expiresAt = parseWaiverExpiry(options.expiresIn);
9223
9221
  const resolved = resolveCloudProjectArgs(scope);
@@ -9260,7 +9258,7 @@ async function runEvalGateWaive(options, command) {
9260
9258
  }
9261
9259
  }
9262
9260
  async function runEvalGateUnwaive(options, command) {
9263
- const globalOptions = getGlobalOptions(command);
9261
+ const globalOptions = evalGlobalOptions(command);
9264
9262
  const scope = gateSubcommandScope(command);
9265
9263
  const resolved = resolveCloudProjectArgs(scope);
9266
9264
  const result = await runPlatformOperation(
@@ -9303,7 +9301,7 @@ async function runEvalGateUnwaive(options, command) {
9303
9301
  }
9304
9302
  }
9305
9303
  async function runEvalCompare(options, command) {
9306
- const globalOptions = getGlobalOptions(command);
9304
+ const globalOptions = evalGlobalOptions(command);
9307
9305
  const policy = comparePolicyFromOptions(options);
9308
9306
  const baseSelector = compareBaseSelector({
9309
9307
  baseRun: options.baseRun,
@@ -9451,7 +9449,7 @@ async function runEvalCompare(options, command) {
9451
9449
  }
9452
9450
  }
9453
9451
  async function runEvalPull(options, command) {
9454
- const globalOptions = getGlobalOptions(command);
9452
+ const globalOptions = evalGlobalOptions(command);
9455
9453
  const lockPath = resolveCorpusLockPath(options.lock);
9456
9454
  const resolved = resolveCloudProjectArgs(options);
9457
9455
  const locked = options.frozen ? await readCorpusLock(lockPath) : void 0;
@@ -9692,7 +9690,7 @@ function formatImportToolFindings(findings) {
9692
9690
  ).join("\n");
9693
9691
  }
9694
9692
  async function runProjectValidation(options, command, resolved) {
9695
- const globalOptions = getGlobalOptions(command);
9693
+ const globalOptions = evalGlobalOptions(command);
9696
9694
  const scope = resolveCloudProjectArgs(options);
9697
9695
  return runPlatformOperation(
9698
9696
  platformOptionsOf(command),
@@ -9717,7 +9715,7 @@ async function runProjectValidation(options, command, resolved) {
9717
9715
  );
9718
9716
  }
9719
9717
  async function runEvalValidate(options, command) {
9720
- const globalOptions = getGlobalOptions(command);
9718
+ const globalOptions = evalGlobalOptions(command);
9721
9719
  const source = readSuiteFileInput(options.file);
9722
9720
  const label = options.file === "-" ? "<stdin>" : options.file;
9723
9721
  const loaded = loadEvalSuiteFile(source.text, { byteLength: source.bytes });
@@ -9778,7 +9776,7 @@ function isEvalSuiteSchemaVersion(value) {
9778
9776
  return EVAL_SUITE_SCHEMA_VERSIONS.includes(value);
9779
9777
  }
9780
9778
  async function runEvalExport(options, command) {
9781
- const globalOptions = getGlobalOptions(command);
9779
+ const globalOptions = evalGlobalOptions(command);
9782
9780
  const resolved = resolveCloudProjectArgs(options);
9783
9781
  const schemaVersion = options.schemaVersion ?? EVAL_SUITE_SCHEMA_VERSION;
9784
9782
  if (!isEvalSuiteSchemaVersion(schemaVersion)) {
@@ -9923,7 +9921,7 @@ function registerEvalCommands(program) {
9923
9921
  "--client <id-or-name...>",
9924
9922
  "Clients to attach the suite to, by name or ID (overrides the file). Without one the suite lists no client and `eval run --client` has nothing to select"
9925
9923
  ).option("--host <id-or-name...>", "Deprecated alias for --client").action(async (options, command) => {
9926
- const globalOptions = getGlobalOptions(command);
9924
+ const globalOptions = evalGlobalOptions(command);
9927
9925
  const input = loadSuiteDefinition(options);
9928
9926
  const resolved = resolveCloudProjectArgs(options, {
9929
9927
  inputProject: options.project === void 0 && typeof input.project === "string" ? input.project : void 0
@@ -9944,11 +9942,15 @@ function registerEvalCommands(program) {
9944
9942
  "Project name or ID (defaults to the most recently updated project)"
9945
9943
  ).action(
9946
9944
  async (options, command) => {
9947
- const globalOptions = getGlobalOptions(command);
9945
+ const globalOptions = evalGlobalOptions(command);
9948
9946
  const result = await runCloudOp(
9949
9947
  command,
9950
9948
  options,
9951
- ({ client, signal }, project) => listEvalSuitesOperation.execute(project, { client, signal })
9949
+ ({ client, signal }, project) => listEvalSuitesOperation.execute(project, { client, signal }),
9950
+ // `runCloudOp` resolves the options a second time, so without this
9951
+ // it hands back the 30s probe default no matter what this command
9952
+ // computed for itself.
9953
+ { defaultTimeoutMs: EVAL_REQUEST_TIMEOUT_MS }
9952
9954
  );
9953
9955
  writeResult(result, globalOptions.format);
9954
9956
  }
@@ -9994,7 +9996,7 @@ function registerEvalCommands(program) {
9994
9996
  }
9995
9997
  );
9996
9998
  evals.command("run").description(
9997
- "Start an eval run of an existing suite, or upload a versioned suite file and run it"
9999
+ "Start an eval run of an existing suite, or upload a versioned suite file and run it. The upload-and-launch has a 120s deadline overall, not per request (raise it with the global --timeout <ms>); --wait-timeout bounds the RUN instead."
9998
10000
  ).option("--suite <id-or-name>", "Eval suite name or ID").option(
9999
10001
  "--file <path>",
10000
10002
  "Versioned suite file to upload and run (.yaml or .json, or - for stdin)"
@@ -10042,7 +10044,7 @@ function registerEvalCommands(program) {
10042
10044
  `Tool-call match options for this run, e.g. '{"toolCallOrder":"exact"}'`
10043
10045
  ).option(
10044
10046
  "--idempotency-key <key>",
10045
- "Retry-safety key: repeating the call returns the run it already started"
10047
+ "Retry key for a lost launch response; for --file, one is minted and printed when omitted"
10046
10048
  ).option("--wait", "Wait for every started run to reach a terminal status").option(
10047
10049
  "--wait-timeout <ms>",
10048
10050
  "Maximum time to wait for completion (default 600000; a run held for its judge gets up to 31 more minutes unless this flag is set)"
@@ -10115,7 +10117,7 @@ function registerEvalCommands(program) {
10115
10117
  throw usageError("--wait-timeout requires --wait.");
10116
10118
  }
10117
10119
  const approvals = parseApprovalFlags(options);
10118
- const globalOptions = getGlobalOptions(command);
10120
+ const globalOptions = evalGlobalOptions(command);
10119
10121
  const reporter = parseReporterFormat(options.reporter);
10120
10122
  const waitTimeoutMs = options.waitTimeout !== void 0 ? parsePositiveInteger(options.waitTimeout, "--wait-timeout") : DEFAULT_RUN_WAIT_TIMEOUT_MS;
10121
10123
  const gradingExtensionMs = options.waitTimeout !== void 0 ? 0 : GRADING_WAIT_EXTENSION_MS;
@@ -10159,7 +10161,11 @@ function registerEvalCommands(program) {
10159
10161
  client: context.client,
10160
10162
  signal: context.signal,
10161
10163
  onDisclosure,
10162
- onDisclosureUnavailable
10164
+ onDisclosureUnavailable,
10165
+ onIdempotencyKey: (key) => {
10166
+ process.stderr.write(`Eval idempotency key: ${key}
10167
+ `);
10168
+ }
10163
10169
  },
10164
10170
  {
10165
10171
  source,
@@ -10495,7 +10501,7 @@ function registerEvalCommands(program) {
10495
10501
  "Print all six user-value chain rows for each failing trial (human output)"
10496
10502
  ).action(
10497
10503
  async (options, command) => {
10498
- const globalOptions = getGlobalOptions(command);
10504
+ const globalOptions = evalGlobalOptions(command);
10499
10505
  let webOrigin = DEFAULT_PLATFORM_ORIGIN;
10500
10506
  let decisionSummary;
10501
10507
  const resolved = resolveCloudProjectArgs(options);
@@ -10774,7 +10780,7 @@ function registerEvalCommands(program) {
10774
10780
  if (options.dryRun && options.wait) {
10775
10781
  throw usageError("--dry-run starts nothing, so it cannot --wait.");
10776
10782
  }
10777
- const globalOptions = getGlobalOptions(command);
10783
+ const globalOptions = evalGlobalOptions(command);
10778
10784
  const format = options.json ? "json" : globalOptions.format;
10779
10785
  const waitTimeoutMs = options.waitTimeout !== void 0 ? parsePositiveInteger(options.waitTimeout, "--wait-timeout") : DEFAULT_RUN_WAIT_TIMEOUT_MS;
10780
10786
  const gradingExtensionMs = options.waitTimeout !== void 0 ? 0 : GRADING_WAIT_EXTENSION_MS;
@@ -11276,7 +11282,7 @@ function registerEvalCommands(program) {
11276
11282
  "With --out, also download the iteration's replay recording next to the screenshots"
11277
11283
  ).action(
11278
11284
  async (options, command) => {
11279
- const globalOptions = getGlobalOptions(command);
11285
+ const globalOptions = evalGlobalOptions(command);
11280
11286
  const index = options.index !== void 0 ? parsePositiveInteger(options.index, "--index") : void 0;
11281
11287
  const resolved = resolveCloudProjectArgs(options);
11282
11288
  const result = await runPlatformOperation(
@@ -11433,7 +11439,7 @@ function registerEvalCommands(program) {
11433
11439
  "Download the recording to this file instead of printing the URL"
11434
11440
  ).action(
11435
11441
  async (options, command) => {
11436
- const globalOptions = getGlobalOptions(command);
11442
+ const globalOptions = evalGlobalOptions(command);
11437
11443
  const resolved = resolveCloudProjectArgs(options);
11438
11444
  const result = await runPlatformOperation(
11439
11445
  platformOptionsOf(command),
@@ -11576,7 +11582,7 @@ ${summary}
11576
11582
  ].includes(key) && value !== void 0 && (key !== "settings" || Object.keys(input2.settings ?? {}).length > 0)
11577
11583
  );
11578
11584
  const message = "No grading change: the suite already has these values.";
11579
- const format = getGlobalOptions(command).format;
11585
+ const format = evalGlobalOptions(command).format;
11580
11586
  if (!hasOtherEdits) {
11581
11587
  if (format === "human") process.stdout.write(`${message}
11582
11588
  `);
@@ -18675,6 +18681,37 @@ async function runOpenAICheck(target, options, command) {
18675
18681
  const exitCode = directoryReadinessExitCode(result);
18676
18682
  if (exitCode !== 0) setProcessExitCode(exitCode);
18677
18683
  }
18684
+ async function readSubmissionProfile(path11) {
18685
+ let text;
18686
+ try {
18687
+ text = await readFile(path11, "utf8");
18688
+ } catch {
18689
+ throw usageError(`Cannot read --submission-profile ${path11}.`);
18690
+ }
18691
+ try {
18692
+ return JSON.parse(text);
18693
+ } catch {
18694
+ throw usageError(`--submission-profile ${path11} is not valid JSON.`);
18695
+ }
18696
+ }
18697
+ async function runMuseCheck(target, options, command) {
18698
+ const reporter = parseReporterFormat(options.reporter);
18699
+ const format = getFormat2(command, reporter);
18700
+ const evidence = await gatherMuseReadinessEvidence({
18701
+ enteredUrl: target,
18702
+ // The global fetch — see `runClaudeCheck`.
18703
+ fetchFn: fetch,
18704
+ headers: requestHeaders(options, target),
18705
+ timeoutMs: options.timeout,
18706
+ submissionProfile: options.submissionProfile ? await readSubmissionProfile(options.submissionProfile) : void 0
18707
+ });
18708
+ const result = gradeMuseReadiness(evidence);
18709
+ writeReadinessOutput(renderConformanceForCli(result, reporter, format));
18710
+ reportReadinessVerdict(result, command);
18711
+ reportReadinessGaps(result, command);
18712
+ const exitCode = directoryReadinessExitCode(result);
18713
+ if (exitCode !== 0) setProcessExitCode(exitCode);
18714
+ }
18678
18715
  function registerReadinessCommands(program) {
18679
18716
  const readiness = program.command("readiness").description("Grade a server or plugin against a publisher's directory");
18680
18717
  const check = readiness.command("check").description("Grade locally, without a MCPJam account (free)");
@@ -18722,6 +18759,27 @@ function registerReadinessCommands(program) {
18722
18759
  await runOpenAICheck(url, options, command);
18723
18760
  }
18724
18761
  );
18762
+ check.command("muse").description("Grade an MCP server against Meta's Muse connector guidelines").argument("<url>", "MCP server URL").option(
18763
+ "--submission-profile <path>",
18764
+ "JSON submission profile (overview, contacts, docs, credentials, tool classes). Without it the submission verdict stays incomplete."
18765
+ ).option("--access-token <token>", "Bearer access token for the server").option(
18766
+ "--credentials-file <path>",
18767
+ "Load the access token from a file written by oauth login"
18768
+ ).option(
18769
+ "--header <header>",
18770
+ 'HTTP header in "Key: Value" format. Repeat to send multiple headers.',
18771
+ (value, previous = []) => [...previous, value],
18772
+ []
18773
+ ).option(
18774
+ "--timeout <ms>",
18775
+ "Per-request timeout in milliseconds",
18776
+ (value) => parsePositiveInteger(value, "Timeout")
18777
+ ).option(
18778
+ "--reporter <reporter>",
18779
+ "Structured reporter output: json-summary or junit-xml"
18780
+ ).action(async (url, options, command) => {
18781
+ await runMuseCheck(url, options, command);
18782
+ });
18725
18783
  registerHostedReadinessCommands(readiness);
18726
18784
  }
18727
18785
  function registerHostedReadinessCommands(readiness) {
@@ -18762,6 +18820,18 @@ function registerHostedReadinessCommands(readiness) {
18762
18820
  ...options.idempotencyKey ? { idempotencyKey: options.idempotencyKey } : {}
18763
18821
  })
18764
18822
  );
18823
+ const startMuse = addProjectOption(
18824
+ start.command("muse").description("Grade a saved server against Meta's Muse guidelines").requiredOption("--server <idOrName>", "Saved server to grade").option("--idempotency-key <key>", "Replay guard for a retried start")
18825
+ );
18826
+ bindOperation(
18827
+ startMuse,
18828
+ startMuseReadinessRunOperation,
18829
+ (options) => ({
18830
+ project: options.project,
18831
+ server: options.server,
18832
+ ...options.idempotencyKey ? { idempotencyKey: options.idempotencyKey } : {}
18833
+ })
18834
+ );
18765
18835
  const status = addProjectOption(
18766
18836
  readiness.command("status").description("Read one hosted readiness run").requiredOption("--run <id>", "Readiness run id")
18767
18837
  );
@@ -18771,7 +18841,7 @@ function registerHostedReadinessCommands(readiness) {
18771
18841
  (options) => ({ project: options.project, run: options.run })
18772
18842
  );
18773
18843
  const list = addProjectOption(
18774
- readiness.command("list").description("List hosted readiness runs, newest first").option("--kind <publisher>", "Narrow to claude or openai").option("--server <idOrName>", "Narrow to one saved server").option(
18844
+ readiness.command("list").description("List hosted readiness runs, newest first").option("--kind <publisher>", "Narrow to claude, openai or muse").option("--server <idOrName>", "Narrow to one saved server").option(
18775
18845
  "--limit <n>",
18776
18846
  "Rows to return (1-100)",
18777
18847
  (value) => parsePositiveInteger(value, "Limit")