@mcpjam/cli 5.14.1 → 5.16.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, aiRefusalClass, formatEvalRunDecisionSummary, gateOutcomeVerdict, applyGateWaiver, formatGateReport, formatGateWaiverLine, detectFlakyCases, evaluateCompareGates, buildRunCompareReport, formatSuiteFileFindings, serializeEvalSuiteFile, MAX_SUITE_FILE_BYTES, buildCorpus, HostedOnlyCaseError, verifyCorpusLock, TaskLifecycleEngine, driveTaskToTerminal, extensionTaskToObservation, legacyTaskToObservation, recognizedAiRefusalCode, 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.16.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;
@@ -7984,8 +7972,6 @@ function parseWaiverExpiry(raw, now = Date.now()) {
7984
7972
  }
7985
7973
  return now + amount * DURATION_UNIT_MS[match[2].toLowerCase()];
7986
7974
  }
7987
-
7988
- // src/lib/eval-run-exit-code.ts
7989
7975
  var SEVERITY_ORDER = [1, 3, 4, 5, 0];
7990
7976
  function worstOf(codes) {
7991
7977
  for (const code of SEVERITY_ORDER) {
@@ -8044,8 +8030,25 @@ function isBillingShapedDetail(details) {
8044
8030
  const inner = details.code;
8045
8031
  return typeof inner === "string" && BILLING_SHAPED_DETAIL_CODES.has(inner);
8046
8032
  }
8033
+ var AI_REFUSAL_EXIT_CODE = {
8034
+ configuration: 2,
8035
+ temporary: 4
8036
+ };
8037
+ function aiRefusalCodeOf(code, details) {
8038
+ const inner = details && typeof details === "object" ? details.code : void 0;
8039
+ for (const candidate of [inner, code]) {
8040
+ if (typeof candidate !== "string") continue;
8041
+ const recognized = recognizedAiRefusalCode(candidate);
8042
+ if (recognized) return recognized;
8043
+ }
8044
+ return void 0;
8045
+ }
8047
8046
  function classifyLaunchErrorExitCode(code, details) {
8048
8047
  if (isBillingShapedDetail(details)) return 4;
8048
+ const aiRefusal = aiRefusalCodeOf(code, details);
8049
+ if (aiRefusal !== void 0) {
8050
+ return AI_REFUSAL_EXIT_CODE[aiRefusalClass(aiRefusal)];
8051
+ }
8049
8052
  if (code !== void 0 && AUTH_SHAPED_CODES.has(code)) return 3;
8050
8053
  if (code !== void 0 && INVALID_SHAPED_CODES.has(code)) return 2;
8051
8054
  return 4;
@@ -8270,6 +8273,12 @@ function writeRunGroupSummary(format, webOrigin, result) {
8270
8273
  if (format !== "human") return;
8271
8274
  for (const target of result.targets) {
8272
8275
  if (target.status !== "started") continue;
8276
+ if (target.deduped === true) {
8277
+ process.stderr.write(
8278
+ `Reused existing eval run ${target.runId} (idempotency key replay).
8279
+ `
8280
+ );
8281
+ }
8273
8282
  writeRunLink(format, webOrigin, {
8274
8283
  projectId: result.project.id,
8275
8284
  suiteId: result.suite.id,
@@ -8527,8 +8536,12 @@ function validateOpInput(op, raw, extras = {}) {
8527
8536
  }
8528
8537
  return parsed.data;
8529
8538
  }
8539
+ var EVAL_REQUEST_TIMEOUT_MS = 12e4;
8540
+ function evalGlobalOptions(command) {
8541
+ return getGlobalOptions(command, EVAL_REQUEST_TIMEOUT_MS);
8542
+ }
8530
8543
  async function executeOp(op, input, options, command) {
8531
- const globalOptions = getGlobalOptions(command);
8544
+ const globalOptions = evalGlobalOptions(command);
8532
8545
  const inputProject = options.project === void 0 && typeof input.project === "string" ? input.project : void 0;
8533
8546
  const resolved = resolveCloudProjectArgs(options, { inputProject });
8534
8547
  const filled = { ...input };
@@ -8815,7 +8828,7 @@ function gateReportCase(report, baselineProvenance) {
8815
8828
  }
8816
8829
  var DEFAULT_GATE_WAIT_TIMEOUT_MS = 35 * 6e4;
8817
8830
  async function runEvalGate(options, command) {
8818
- const globalOptions = getGlobalOptions(command);
8831
+ const globalOptions = evalGlobalOptions(command);
8819
8832
  const runId = options.run?.trim();
8820
8833
  if (!runId) {
8821
8834
  throw usageError("--run <id> is required. Pass the eval run to gate.");
@@ -9217,7 +9230,7 @@ function gateSubcommandScope(command) {
9217
9230
  };
9218
9231
  }
9219
9232
  async function runEvalGateWaive(options, command) {
9220
- const globalOptions = getGlobalOptions(command);
9233
+ const globalOptions = evalGlobalOptions(command);
9221
9234
  const scope = gateSubcommandScope(command);
9222
9235
  const expiresAt = parseWaiverExpiry(options.expiresIn);
9223
9236
  const resolved = resolveCloudProjectArgs(scope);
@@ -9260,7 +9273,7 @@ async function runEvalGateWaive(options, command) {
9260
9273
  }
9261
9274
  }
9262
9275
  async function runEvalGateUnwaive(options, command) {
9263
- const globalOptions = getGlobalOptions(command);
9276
+ const globalOptions = evalGlobalOptions(command);
9264
9277
  const scope = gateSubcommandScope(command);
9265
9278
  const resolved = resolveCloudProjectArgs(scope);
9266
9279
  const result = await runPlatformOperation(
@@ -9303,7 +9316,7 @@ async function runEvalGateUnwaive(options, command) {
9303
9316
  }
9304
9317
  }
9305
9318
  async function runEvalCompare(options, command) {
9306
- const globalOptions = getGlobalOptions(command);
9319
+ const globalOptions = evalGlobalOptions(command);
9307
9320
  const policy = comparePolicyFromOptions(options);
9308
9321
  const baseSelector = compareBaseSelector({
9309
9322
  baseRun: options.baseRun,
@@ -9451,7 +9464,7 @@ async function runEvalCompare(options, command) {
9451
9464
  }
9452
9465
  }
9453
9466
  async function runEvalPull(options, command) {
9454
- const globalOptions = getGlobalOptions(command);
9467
+ const globalOptions = evalGlobalOptions(command);
9455
9468
  const lockPath = resolveCorpusLockPath(options.lock);
9456
9469
  const resolved = resolveCloudProjectArgs(options);
9457
9470
  const locked = options.frozen ? await readCorpusLock(lockPath) : void 0;
@@ -9692,7 +9705,7 @@ function formatImportToolFindings(findings) {
9692
9705
  ).join("\n");
9693
9706
  }
9694
9707
  async function runProjectValidation(options, command, resolved) {
9695
- const globalOptions = getGlobalOptions(command);
9708
+ const globalOptions = evalGlobalOptions(command);
9696
9709
  const scope = resolveCloudProjectArgs(options);
9697
9710
  return runPlatformOperation(
9698
9711
  platformOptionsOf(command),
@@ -9717,7 +9730,7 @@ async function runProjectValidation(options, command, resolved) {
9717
9730
  );
9718
9731
  }
9719
9732
  async function runEvalValidate(options, command) {
9720
- const globalOptions = getGlobalOptions(command);
9733
+ const globalOptions = evalGlobalOptions(command);
9721
9734
  const source = readSuiteFileInput(options.file);
9722
9735
  const label = options.file === "-" ? "<stdin>" : options.file;
9723
9736
  const loaded = loadEvalSuiteFile(source.text, { byteLength: source.bytes });
@@ -9778,7 +9791,7 @@ function isEvalSuiteSchemaVersion(value) {
9778
9791
  return EVAL_SUITE_SCHEMA_VERSIONS.includes(value);
9779
9792
  }
9780
9793
  async function runEvalExport(options, command) {
9781
- const globalOptions = getGlobalOptions(command);
9794
+ const globalOptions = evalGlobalOptions(command);
9782
9795
  const resolved = resolveCloudProjectArgs(options);
9783
9796
  const schemaVersion = options.schemaVersion ?? EVAL_SUITE_SCHEMA_VERSION;
9784
9797
  if (!isEvalSuiteSchemaVersion(schemaVersion)) {
@@ -9923,7 +9936,7 @@ function registerEvalCommands(program) {
9923
9936
  "--client <id-or-name...>",
9924
9937
  "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
9938
  ).option("--host <id-or-name...>", "Deprecated alias for --client").action(async (options, command) => {
9926
- const globalOptions = getGlobalOptions(command);
9939
+ const globalOptions = evalGlobalOptions(command);
9927
9940
  const input = loadSuiteDefinition(options);
9928
9941
  const resolved = resolveCloudProjectArgs(options, {
9929
9942
  inputProject: options.project === void 0 && typeof input.project === "string" ? input.project : void 0
@@ -9944,11 +9957,15 @@ function registerEvalCommands(program) {
9944
9957
  "Project name or ID (defaults to the most recently updated project)"
9945
9958
  ).action(
9946
9959
  async (options, command) => {
9947
- const globalOptions = getGlobalOptions(command);
9960
+ const globalOptions = evalGlobalOptions(command);
9948
9961
  const result = await runCloudOp(
9949
9962
  command,
9950
9963
  options,
9951
- ({ client, signal }, project) => listEvalSuitesOperation.execute(project, { client, signal })
9964
+ ({ client, signal }, project) => listEvalSuitesOperation.execute(project, { client, signal }),
9965
+ // `runCloudOp` resolves the options a second time, so without this
9966
+ // it hands back the 30s probe default no matter what this command
9967
+ // computed for itself.
9968
+ { defaultTimeoutMs: EVAL_REQUEST_TIMEOUT_MS }
9952
9969
  );
9953
9970
  writeResult(result, globalOptions.format);
9954
9971
  }
@@ -9994,7 +10011,7 @@ function registerEvalCommands(program) {
9994
10011
  }
9995
10012
  );
9996
10013
  evals.command("run").description(
9997
- "Start an eval run of an existing suite, or upload a versioned suite file and run it"
10014
+ "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
10015
  ).option("--suite <id-or-name>", "Eval suite name or ID").option(
9999
10016
  "--file <path>",
10000
10017
  "Versioned suite file to upload and run (.yaml or .json, or - for stdin)"
@@ -10042,7 +10059,7 @@ function registerEvalCommands(program) {
10042
10059
  `Tool-call match options for this run, e.g. '{"toolCallOrder":"exact"}'`
10043
10060
  ).option(
10044
10061
  "--idempotency-key <key>",
10045
- "Retry-safety key: repeating the call returns the run it already started"
10062
+ "Retry key for a lost launch response; for --file, one is minted and printed when omitted"
10046
10063
  ).option("--wait", "Wait for every started run to reach a terminal status").option(
10047
10064
  "--wait-timeout <ms>",
10048
10065
  "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 +10132,7 @@ function registerEvalCommands(program) {
10115
10132
  throw usageError("--wait-timeout requires --wait.");
10116
10133
  }
10117
10134
  const approvals = parseApprovalFlags(options);
10118
- const globalOptions = getGlobalOptions(command);
10135
+ const globalOptions = evalGlobalOptions(command);
10119
10136
  const reporter = parseReporterFormat(options.reporter);
10120
10137
  const waitTimeoutMs = options.waitTimeout !== void 0 ? parsePositiveInteger(options.waitTimeout, "--wait-timeout") : DEFAULT_RUN_WAIT_TIMEOUT_MS;
10121
10138
  const gradingExtensionMs = options.waitTimeout !== void 0 ? 0 : GRADING_WAIT_EXTENSION_MS;
@@ -10159,7 +10176,11 @@ function registerEvalCommands(program) {
10159
10176
  client: context.client,
10160
10177
  signal: context.signal,
10161
10178
  onDisclosure,
10162
- onDisclosureUnavailable
10179
+ onDisclosureUnavailable,
10180
+ onIdempotencyKey: (key) => {
10181
+ process.stderr.write(`Eval idempotency key: ${key}
10182
+ `);
10183
+ }
10163
10184
  },
10164
10185
  {
10165
10186
  source,
@@ -10495,7 +10516,7 @@ function registerEvalCommands(program) {
10495
10516
  "Print all six user-value chain rows for each failing trial (human output)"
10496
10517
  ).action(
10497
10518
  async (options, command) => {
10498
- const globalOptions = getGlobalOptions(command);
10519
+ const globalOptions = evalGlobalOptions(command);
10499
10520
  let webOrigin = DEFAULT_PLATFORM_ORIGIN;
10500
10521
  let decisionSummary;
10501
10522
  const resolved = resolveCloudProjectArgs(options);
@@ -10774,7 +10795,7 @@ function registerEvalCommands(program) {
10774
10795
  if (options.dryRun && options.wait) {
10775
10796
  throw usageError("--dry-run starts nothing, so it cannot --wait.");
10776
10797
  }
10777
- const globalOptions = getGlobalOptions(command);
10798
+ const globalOptions = evalGlobalOptions(command);
10778
10799
  const format = options.json ? "json" : globalOptions.format;
10779
10800
  const waitTimeoutMs = options.waitTimeout !== void 0 ? parsePositiveInteger(options.waitTimeout, "--wait-timeout") : DEFAULT_RUN_WAIT_TIMEOUT_MS;
10780
10801
  const gradingExtensionMs = options.waitTimeout !== void 0 ? 0 : GRADING_WAIT_EXTENSION_MS;
@@ -11276,7 +11297,7 @@ function registerEvalCommands(program) {
11276
11297
  "With --out, also download the iteration's replay recording next to the screenshots"
11277
11298
  ).action(
11278
11299
  async (options, command) => {
11279
- const globalOptions = getGlobalOptions(command);
11300
+ const globalOptions = evalGlobalOptions(command);
11280
11301
  const index = options.index !== void 0 ? parsePositiveInteger(options.index, "--index") : void 0;
11281
11302
  const resolved = resolveCloudProjectArgs(options);
11282
11303
  const result = await runPlatformOperation(
@@ -11433,7 +11454,7 @@ function registerEvalCommands(program) {
11433
11454
  "Download the recording to this file instead of printing the URL"
11434
11455
  ).action(
11435
11456
  async (options, command) => {
11436
- const globalOptions = getGlobalOptions(command);
11457
+ const globalOptions = evalGlobalOptions(command);
11437
11458
  const resolved = resolveCloudProjectArgs(options);
11438
11459
  const result = await runPlatformOperation(
11439
11460
  platformOptionsOf(command),
@@ -11576,7 +11597,7 @@ ${summary}
11576
11597
  ].includes(key) && value !== void 0 && (key !== "settings" || Object.keys(input2.settings ?? {}).length > 0)
11577
11598
  );
11578
11599
  const message = "No grading change: the suite already has these values.";
11579
- const format = getGlobalOptions(command).format;
11600
+ const format = evalGlobalOptions(command).format;
11580
11601
  if (!hasOtherEdits) {
11581
11602
  if (format === "human") process.stdout.write(`${message}
11582
11603
  `);
@@ -18675,6 +18696,37 @@ async function runOpenAICheck(target, options, command) {
18675
18696
  const exitCode = directoryReadinessExitCode(result);
18676
18697
  if (exitCode !== 0) setProcessExitCode(exitCode);
18677
18698
  }
18699
+ async function readSubmissionProfile(path11) {
18700
+ let text;
18701
+ try {
18702
+ text = await readFile(path11, "utf8");
18703
+ } catch {
18704
+ throw usageError(`Cannot read --submission-profile ${path11}.`);
18705
+ }
18706
+ try {
18707
+ return JSON.parse(text);
18708
+ } catch {
18709
+ throw usageError(`--submission-profile ${path11} is not valid JSON.`);
18710
+ }
18711
+ }
18712
+ async function runMuseCheck(target, options, command) {
18713
+ const reporter = parseReporterFormat(options.reporter);
18714
+ const format = getFormat2(command, reporter);
18715
+ const evidence = await gatherMuseReadinessEvidence({
18716
+ enteredUrl: target,
18717
+ // The global fetch — see `runClaudeCheck`.
18718
+ fetchFn: fetch,
18719
+ headers: requestHeaders(options, target),
18720
+ timeoutMs: options.timeout,
18721
+ submissionProfile: options.submissionProfile ? await readSubmissionProfile(options.submissionProfile) : void 0
18722
+ });
18723
+ const result = gradeMuseReadiness(evidence);
18724
+ writeReadinessOutput(renderConformanceForCli(result, reporter, format));
18725
+ reportReadinessVerdict(result, command);
18726
+ reportReadinessGaps(result, command);
18727
+ const exitCode = directoryReadinessExitCode(result);
18728
+ if (exitCode !== 0) setProcessExitCode(exitCode);
18729
+ }
18678
18730
  function registerReadinessCommands(program) {
18679
18731
  const readiness = program.command("readiness").description("Grade a server or plugin against a publisher's directory");
18680
18732
  const check = readiness.command("check").description("Grade locally, without a MCPJam account (free)");
@@ -18722,6 +18774,27 @@ function registerReadinessCommands(program) {
18722
18774
  await runOpenAICheck(url, options, command);
18723
18775
  }
18724
18776
  );
18777
+ check.command("muse").description("Grade an MCP server against Meta's Muse connector guidelines").argument("<url>", "MCP server URL").option(
18778
+ "--submission-profile <path>",
18779
+ "JSON submission profile (overview, contacts, docs, credentials, tool classes). Without it the submission verdict stays incomplete."
18780
+ ).option("--access-token <token>", "Bearer access token for the server").option(
18781
+ "--credentials-file <path>",
18782
+ "Load the access token from a file written by oauth login"
18783
+ ).option(
18784
+ "--header <header>",
18785
+ 'HTTP header in "Key: Value" format. Repeat to send multiple headers.',
18786
+ (value, previous = []) => [...previous, value],
18787
+ []
18788
+ ).option(
18789
+ "--timeout <ms>",
18790
+ "Per-request timeout in milliseconds",
18791
+ (value) => parsePositiveInteger(value, "Timeout")
18792
+ ).option(
18793
+ "--reporter <reporter>",
18794
+ "Structured reporter output: json-summary or junit-xml"
18795
+ ).action(async (url, options, command) => {
18796
+ await runMuseCheck(url, options, command);
18797
+ });
18725
18798
  registerHostedReadinessCommands(readiness);
18726
18799
  }
18727
18800
  function registerHostedReadinessCommands(readiness) {
@@ -18762,6 +18835,18 @@ function registerHostedReadinessCommands(readiness) {
18762
18835
  ...options.idempotencyKey ? { idempotencyKey: options.idempotencyKey } : {}
18763
18836
  })
18764
18837
  );
18838
+ const startMuse = addProjectOption(
18839
+ 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")
18840
+ );
18841
+ bindOperation(
18842
+ startMuse,
18843
+ startMuseReadinessRunOperation,
18844
+ (options) => ({
18845
+ project: options.project,
18846
+ server: options.server,
18847
+ ...options.idempotencyKey ? { idempotencyKey: options.idempotencyKey } : {}
18848
+ })
18849
+ );
18765
18850
  const status = addProjectOption(
18766
18851
  readiness.command("status").description("Read one hosted readiness run").requiredOption("--run <id>", "Readiness run id")
18767
18852
  );
@@ -18771,7 +18856,7 @@ function registerHostedReadinessCommands(readiness) {
18771
18856
  (options) => ({ project: options.project, run: options.run })
18772
18857
  );
18773
18858
  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(
18859
+ 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
18860
  "--limit <n>",
18776
18861
  "Rows to return (1-100)",
18777
18862
  (value) => parsePositiveInteger(value, "Limit")