@plasius/mcp-admin-contracts 0.5.0 → 0.5.1

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
@@ -20,6 +20,22 @@ import {
20
20
  FeedbackProcessorCheckpointSchema,
21
21
  FeedbackReviewPacketSchema
22
22
  } from "@plasius/schema";
23
+ import { MODEL_RESOLUTION_CONTRACT_VERSION } from "@plasius/asset-contracts";
24
+ import {
25
+ ASSET_MCP_PACKAGE,
26
+ MODEL_MCP_CATALOG_CONFIRM_CAPABILITY,
27
+ MODEL_MCP_CATALOG_REQUEST_CAPABILITY,
28
+ MODEL_MCP_CATALOG_REVIEW_CAPABILITY,
29
+ MODEL_MCP_CONTRACT_VERSION,
30
+ MODEL_MCP_EXTERNAL_HARVEST_FEATURE_FLAG_ID,
31
+ MODEL_MCP_GENERATION_FEATURE_FLAG_ID,
32
+ MODEL_MCP_PIPELINE_MANAGE_CAPABILITY,
33
+ MODEL_MCP_SOURCE_MANAGE_CAPABILITY,
34
+ MODEL_MCP_TOOL_NAMES,
35
+ MODEL_MCP_UNIFIED_FEATURE_FLAG_ID,
36
+ listModelMcpResourceTemplates,
37
+ listModelMcpToolDefinitions
38
+ } from "@plasius/asset-mcp";
23
39
 
24
40
  // src/translations/en-GB.ts
25
41
  var mcpAdminContractsEnGbTranslations = {
@@ -66,6 +82,14 @@ var mcpAdminContractsEnGbTranslations = {
66
82
  "mcpAdminContracts.action.promoteAsset.description": "Promote an approved asset candidate to an immutable runtime manifest reference.",
67
83
  "mcpAdminContracts.action.rollbackAsset.description": "Rollback an asset runtime channel to a previous promoted manifest version.",
68
84
  "mcpAdminContracts.action.getAssetJobStatus.description": "Read governed asset job status, planned processing work, and evidence references.",
85
+ "mcpAdminContracts.action.listModelSearchRankers.description": "List allowlisted, calibrated model-search rankers and their current readiness without selecting a substitute.",
86
+ "mcpAdminContracts.action.searchModelCatalog.description": "Search promoted model catalog versions using hard constraints and one exact calibrated ranker selection.",
87
+ "mcpAdminContracts.action.resolveModelRequest.description": "Search the catalog and idempotently create asynchronous provider or generator fallback work when needed.",
88
+ "mcpAdminContracts.action.getModelResolution.description": "Read an owned immutable model-resolution revision, progress, questions, and review evidence.",
89
+ "mcpAdminContracts.action.confirmModelCandidate.description": "Confirm one exact four-view candidate; low assurance additionally requires explicit semantic-risk acceptance.",
90
+ "mcpAdminContracts.action.retryModelResolution.description": "Create the next immutable request revision from bounded refinement answers and candidate exclusions.",
91
+ "mcpAdminContracts.action.cancelModelResolution.description": "Idempotently cancel unfinished work owned by the requester.",
92
+ "mcpAdminContracts.action.rebuildModelCatalogIndex.description": "Run an operator-only idempotent full, backfill, or repair rebuild of the promoted model catalog index.",
69
93
  "mcpAdminContracts.action.getUserTokenWallet.description": "Read an account's server-resolved Token wallet summary without exposing provider or payment data.",
70
94
  "mcpAdminContracts.action.listUserTokenActivity.description": "Read a bounded, cursor-paginated Token activity history for one account.",
71
95
  "mcpAdminContracts.action.listTokenAdjustments.description": "List audited Token adjustment proposals and their approval state.",
@@ -128,6 +152,14 @@ var mcpAdminContractDescriptionKeys = {
128
152
  actionPromoteAsset: "mcpAdminContracts.action.promoteAsset.description",
129
153
  actionRollbackAsset: "mcpAdminContracts.action.rollbackAsset.description",
130
154
  actionGetAssetJobStatus: "mcpAdminContracts.action.getAssetJobStatus.description",
155
+ actionListModelSearchRankers: "mcpAdminContracts.action.listModelSearchRankers.description",
156
+ actionSearchModelCatalog: "mcpAdminContracts.action.searchModelCatalog.description",
157
+ actionResolveModelRequest: "mcpAdminContracts.action.resolveModelRequest.description",
158
+ actionGetModelResolution: "mcpAdminContracts.action.getModelResolution.description",
159
+ actionConfirmModelCandidate: "mcpAdminContracts.action.confirmModelCandidate.description",
160
+ actionRetryModelResolution: "mcpAdminContracts.action.retryModelResolution.description",
161
+ actionCancelModelResolution: "mcpAdminContracts.action.cancelModelResolution.description",
162
+ actionRebuildModelCatalogIndex: "mcpAdminContracts.action.rebuildModelCatalogIndex.description",
131
163
  actionGetUserTokenWallet: "mcpAdminContracts.action.getUserTokenWallet.description",
132
164
  actionListUserTokenActivity: "mcpAdminContracts.action.listUserTokenActivity.description",
133
165
  actionListTokenAdjustments: "mcpAdminContracts.action.listTokenAdjustments.description",
@@ -152,7 +184,7 @@ function getMcpAdminContractDefaultTranslation(key) {
152
184
  }
153
185
 
154
186
  // src/index.ts
155
- var MCP_ADMIN_CONTRACT_VERSION = "2026-08-11.v6";
187
+ var MCP_ADMIN_CONTRACT_VERSION = "2026-08-20.v7";
156
188
  var MCP_ADMIN_REGISTRY_SOURCE = "@plasius/mcp-admin-contracts";
157
189
  var MCP_ADMIN_FOUNDATION_FLAG_ID = "mcp.admin.foundation.enabled";
158
190
  var MCP_ACCESS_SCOPE = "mcp:access";
@@ -168,10 +200,30 @@ var MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID = "mcp.admin.production-readiness.ena
168
200
  var MCP_ADMIN_PRODUCTION_READINESS_ENV_VAR = "MCP_ADMIN_PRODUCTION_READINESS_ENABLED";
169
201
  var MCP_ASSET_PIPELINE_FLAG_ID = "asset.pipeline.unified-ai-assets.enabled";
170
202
  var MCP_ASSET_EXTERNAL_HARVEST_FLAG_ID = "asset.pipeline.external-model-harvest.enabled";
171
- var MCP_ASSET_CATALOG_REQUEST_CAPABILITY = "asset.catalog.request";
172
- var MCP_ASSET_PIPELINE_MANAGE_CAPABILITY = "asset.pipeline.mcp.manage";
173
- var MCP_ASSET_SOURCE_MANAGE_CAPABILITY = "asset.source.manage";
174
- var MCP_ASSET_CATALOG_REVIEW_CAPABILITY = "asset.catalog.review";
203
+ var MCP_ASSET_CATALOG_REQUEST_CAPABILITY = MODEL_MCP_CATALOG_REQUEST_CAPABILITY;
204
+ var MCP_ASSET_CATALOG_CONFIRM_CAPABILITY = MODEL_MCP_CATALOG_CONFIRM_CAPABILITY;
205
+ var MCP_ASSET_PIPELINE_MANAGE_CAPABILITY = MODEL_MCP_PIPELINE_MANAGE_CAPABILITY;
206
+ var MCP_ASSET_SOURCE_MANAGE_CAPABILITY = MODEL_MCP_SOURCE_MANAGE_CAPABILITY;
207
+ var MCP_ASSET_CATALOG_REVIEW_CAPABILITY = MODEL_MCP_CATALOG_REVIEW_CAPABILITY;
208
+ var MCP_ADMIN_MODEL_TOOL_CONTRACT_VERSION = MODEL_MCP_CONTRACT_VERSION;
209
+ var MCP_ADMIN_MODEL_REGISTRY_SOURCE = ASSET_MCP_PACKAGE;
210
+ var MCP_ADMIN_MODEL_RESOLUTION_CONTRACT_VERSION = MODEL_RESOLUTION_CONTRACT_VERSION;
211
+ var MCP_ADMIN_MODEL_CAPABILITIES = Object.freeze({
212
+ catalogRequest: MODEL_MCP_CATALOG_REQUEST_CAPABILITY,
213
+ catalogConfirm: MODEL_MCP_CATALOG_CONFIRM_CAPABILITY,
214
+ catalogReview: MODEL_MCP_CATALOG_REVIEW_CAPABILITY,
215
+ sourceManage: MODEL_MCP_SOURCE_MANAGE_CAPABILITY,
216
+ pipelineManage: MODEL_MCP_PIPELINE_MANAGE_CAPABILITY
217
+ });
218
+ var MCP_ADMIN_MODEL_OAUTH_SCOPES = Object.freeze([
219
+ MCP_ACCESS_SCOPE,
220
+ MODEL_MCP_CATALOG_REQUEST_CAPABILITY,
221
+ MODEL_MCP_CATALOG_CONFIRM_CAPABILITY,
222
+ MODEL_MCP_CATALOG_REVIEW_CAPABILITY,
223
+ MODEL_MCP_SOURCE_MANAGE_CAPABILITY,
224
+ MODEL_MCP_PIPELINE_MANAGE_CAPABILITY
225
+ ]);
226
+ var canonicalModelToolDefinitions = listModelMcpToolDefinitions();
175
227
  var MCP_ADMIN_FEEDBACK_FLAG_ID = "feedback.mcp.enabled";
176
228
  var MCP_ADMIN_FEEDBACK_READ_CAPABILITY = "admin.feedback.read";
177
229
  var MCP_ADMIN_BASE_OAUTH_SCOPE = MCP_ACCESS_SCOPE;
@@ -3415,6 +3467,100 @@ var MCP_ADMIN_ACTIONS = [
3415
3467
  },
3416
3468
  ...MCP_ADMIN_FEEDBACK_ACTIONS
3417
3469
  ];
3470
+ var modelDescriptionKeys = {
3471
+ list_model_search_rankers: mcpAdminContractDescriptionKeys.actionListModelSearchRankers,
3472
+ search_model_catalog: mcpAdminContractDescriptionKeys.actionSearchModelCatalog,
3473
+ resolve_model_request: mcpAdminContractDescriptionKeys.actionResolveModelRequest,
3474
+ get_model_resolution: mcpAdminContractDescriptionKeys.actionGetModelResolution,
3475
+ confirm_model_candidate: mcpAdminContractDescriptionKeys.actionConfirmModelCandidate,
3476
+ retry_model_resolution: mcpAdminContractDescriptionKeys.actionRetryModelResolution,
3477
+ cancel_model_resolution: mcpAdminContractDescriptionKeys.actionCancelModelResolution,
3478
+ rebuild_model_catalog_index: mcpAdminContractDescriptionKeys.actionRebuildModelCatalogIndex
3479
+ };
3480
+ var modelVerificationNotes = deepFreeze({
3481
+ list_model_search_rankers: [
3482
+ "Validate the returned ranker list and no-substitution policy against the canonical output schema."
3483
+ ],
3484
+ search_model_catalog: [
3485
+ "Validate ranked catalog evidence and any four-view image pack against the canonical structured output schema."
3486
+ ],
3487
+ resolve_model_request: [
3488
+ "Use get_model_resolution with the returned resolution identifier to verify durable progress and candidate evidence."
3489
+ ],
3490
+ get_model_resolution: [
3491
+ "Validate the owned immutable revision, state, questions, and any four-view image pack against the canonical output schema."
3492
+ ],
3493
+ confirm_model_candidate: [
3494
+ "Use get_model_resolution to verify completion and the immutable final asset reference after confirmation."
3495
+ ],
3496
+ retry_model_resolution: [
3497
+ "Use get_model_resolution to verify the newly created immutable request revision and excluded candidates."
3498
+ ],
3499
+ cancel_model_resolution: [
3500
+ "Use get_model_resolution to verify that unfinished requester-owned work reached the cancelled state."
3501
+ ],
3502
+ rebuild_model_catalog_index: [
3503
+ "Validate the idempotent operation identifier and state against the canonical output schema and operator audit record."
3504
+ ]
3505
+ });
3506
+ var modelToolExecution = (toolName) => ({
3507
+ protocol: "json-rpc-2.0",
3508
+ method: "POST",
3509
+ path: "/api/mcp",
3510
+ rpcMethod: "tools/call",
3511
+ toolName
3512
+ });
3513
+ var modelToolTranslation = (definition) => {
3514
+ const translation = translatedDescription(modelDescriptionKeys[definition.name]);
3515
+ if (translation.descriptionDefault !== definition.description) {
3516
+ throw new TypeError("Canonical model tool description translation mismatch.");
3517
+ }
3518
+ return translation;
3519
+ };
3520
+ function listMcpModelToolSummaries() {
3521
+ return canonicalModelToolDefinitions.map((definition) => {
3522
+ const { inputSchema: _inputSchema, outputSchema: _outputSchema, ...summary } = definition;
3523
+ return {
3524
+ ...summary,
3525
+ ...modelToolTranslation(definition),
3526
+ availability: "near-future",
3527
+ execution: modelToolExecution(definition.name),
3528
+ verificationNotes: modelVerificationNotes[definition.name]
3529
+ };
3530
+ });
3531
+ }
3532
+ function listMcpModelResourceTemplates() {
3533
+ return listModelMcpResourceTemplates();
3534
+ }
3535
+ var buildMcpModelToolSchemaDescriptors = () => Object.fromEntries(
3536
+ canonicalModelToolDefinitions.map((definition) => [
3537
+ definition.name,
3538
+ {
3539
+ ...definition,
3540
+ ...modelToolTranslation(definition),
3541
+ availability: "near-future",
3542
+ execution: modelToolExecution(definition.name),
3543
+ verificationNotes: modelVerificationNotes[definition.name]
3544
+ }
3545
+ ])
3546
+ );
3547
+ var buildMcpModelResolutionContext = () => ({
3548
+ toolContractVersion: MODEL_MCP_CONTRACT_VERSION,
3549
+ sourceOfTruth: ASSET_MCP_PACKAGE,
3550
+ resolutionContractVersion: MODEL_RESOLUTION_CONTRACT_VERSION,
3551
+ endpoint: "/api/mcp",
3552
+ protocol: "json-rpc-2.0",
3553
+ rpcMethod: "tools/call",
3554
+ requiredFeatureFlag: MODEL_MCP_UNIFIED_FEATURE_FLAG_ID,
3555
+ conditionalFeatureFlags: [
3556
+ MODEL_MCP_EXTERNAL_HARVEST_FEATURE_FLAG_ID,
3557
+ MODEL_MCP_GENERATION_FEATURE_FLAG_ID
3558
+ ],
3559
+ tools: [...MODEL_MCP_TOOL_NAMES],
3560
+ resourceTemplates: listModelMcpResourceTemplates().map(
3561
+ ({ uriTemplate }) => uriTemplate
3562
+ )
3563
+ });
3418
3564
  function listMcpActionSummaries() {
3419
3565
  return MCP_ADMIN_ACTIONS.map((action) => ({
3420
3566
  name: action.name,
@@ -3433,7 +3579,7 @@ function listMcpActionSummaries() {
3433
3579
  access: action.access
3434
3580
  }));
3435
3581
  }
3436
- var MCP_ADMIN_CONTEXT_SHAPE = {
3582
+ var MCP_ADMIN_CONTEXT_SHAPE = deepFreeze({
3437
3583
  contractVersion: stringField("Versioned discovery contract identifier."),
3438
3584
  authenticatedUser: objectField("Authenticated admin session context.", {
3439
3585
  id: stringField("Authenticated user identifier."),
@@ -3459,6 +3605,44 @@ var MCP_ADMIN_CONTEXT_SHAPE = {
3459
3605
  )
3460
3606
  }),
3461
3607
  actionFamilies: arrayField("Approved action families grouped by rollout domain.", "McpActionFamily"),
3608
+ modelResolution: objectField(
3609
+ "Canonical model-resolution JSON-RPC discovery metadata.",
3610
+ {
3611
+ toolContractVersion: stringField(
3612
+ "Contract version imported from @plasius/asset-mcp.",
3613
+ { constValue: MODEL_MCP_CONTRACT_VERSION }
3614
+ ),
3615
+ sourceOfTruth: stringField("Package that owns the canonical tool registry.", {
3616
+ constValue: ASSET_MCP_PACKAGE
3617
+ }),
3618
+ resolutionContractVersion: stringField(
3619
+ "Resolution contract version imported from @plasius/asset-contracts.",
3620
+ { constValue: MODEL_RESOLUTION_CONTRACT_VERSION }
3621
+ ),
3622
+ endpoint: stringField("Hosted MCP JSON-RPC endpoint.", {
3623
+ constValue: "/api/mcp"
3624
+ }),
3625
+ protocol: stringField("MCP transport protocol.", {
3626
+ constValue: "json-rpc-2.0"
3627
+ }),
3628
+ rpcMethod: stringField("JSON-RPC method used to execute a named tool.", {
3629
+ constValue: "tools/call"
3630
+ }),
3631
+ requiredFeatureFlag: stringField(
3632
+ "Parent rollout flag required for every model-resolution tool.",
3633
+ { constValue: MODEL_MCP_UNIFIED_FEATURE_FLAG_ID }
3634
+ ),
3635
+ conditionalFeatureFlags: arrayField(
3636
+ "Provider and generator flags evaluated only when their fallback is attempted.",
3637
+ "string"
3638
+ ),
3639
+ tools: arrayField("Canonical snake_case model-resolution tool names.", "string"),
3640
+ resourceTemplates: arrayField(
3641
+ "Authenticated canonical mcp://models resource templates.",
3642
+ "string"
3643
+ )
3644
+ }
3645
+ ),
3462
3646
  extensionRules: objectField("Rules for extending the registry without changing the discovery shape.", {
3463
3647
  sourceOfTruth: stringField("Package that owns the approved MCP registry."),
3464
3648
  addOnlyWithinV1: booleanField("Whether v1 additions must be additive."),
@@ -3466,7 +3650,7 @@ var MCP_ADMIN_CONTEXT_SHAPE = {
3466
3650
  singleResourceMutations: booleanField("Whether mutations must target one resource at a time."),
3467
3651
  notes: arrayField("Extension notes for future MCP tool families.", "string")
3468
3652
  })
3469
- };
3653
+ });
3470
3654
  var MCP_ADMIN_EXTENSION_RULES = {
3471
3655
  sourceOfTruth: MCP_ADMIN_REGISTRY_SOURCE,
3472
3656
  addOnlyWithinV1: true,
@@ -3522,7 +3706,10 @@ function buildMcpDiscoveryResponse() {
3522
3706
  return {
3523
3707
  contractVersion: MCP_ADMIN_CONTRACT_VERSION,
3524
3708
  sourceOfTruth: MCP_ADMIN_REGISTRY_SOURCE,
3525
- actions: listMcpActionSummaries()
3709
+ actions: listMcpActionSummaries(),
3710
+ modelTools: listMcpModelToolSummaries(),
3711
+ modelResources: listMcpModelResourceTemplates(),
3712
+ modelSourceOfTruth: ASSET_MCP_PACKAGE
3526
3713
  };
3527
3714
  }
3528
3715
  function buildMcpSchemaResponse() {
@@ -3551,7 +3738,10 @@ function buildMcpSchemaResponse() {
3551
3738
  sourceOfTruth: MCP_ADMIN_REGISTRY_SOURCE,
3552
3739
  actions,
3553
3740
  contextShape: MCP_ADMIN_CONTEXT_SHAPE,
3554
- extensionRules: MCP_ADMIN_EXTENSION_RULES
3741
+ extensionRules: MCP_ADMIN_EXTENSION_RULES,
3742
+ modelTools: buildMcpModelToolSchemaDescriptors(),
3743
+ modelResources: listMcpModelResourceTemplates(),
3744
+ modelSourceOfTruth: ASSET_MCP_PACKAGE
3555
3745
  };
3556
3746
  }
3557
3747
  function buildMcpContextResponse(options) {
@@ -3561,7 +3751,8 @@ function buildMcpContextResponse(options) {
3561
3751
  surface: buildMcpSurfaceUrls(options.origin),
3562
3752
  rollout: options.rollout,
3563
3753
  actionFamilies: buildMcpActionFamilies(),
3564
- extensionRules: MCP_ADMIN_EXTENSION_RULES
3754
+ extensionRules: MCP_ADMIN_EXTENSION_RULES,
3755
+ modelResolution: buildMcpModelResolutionContext()
3565
3756
  };
3566
3757
  }
3567
3758
  function buildMcpActionFamilies() {
@@ -3696,6 +3887,11 @@ export {
3696
3887
  MCP_ADMIN_FOUNDATION_ENV_VAR,
3697
3888
  MCP_ADMIN_FOUNDATION_FLAG_ID,
3698
3889
  MCP_ADMIN_LIVEOPS_FLAG_ID,
3890
+ MCP_ADMIN_MODEL_CAPABILITIES,
3891
+ MCP_ADMIN_MODEL_OAUTH_SCOPES,
3892
+ MCP_ADMIN_MODEL_REGISTRY_SOURCE,
3893
+ MCP_ADMIN_MODEL_RESOLUTION_CONTRACT_VERSION,
3894
+ MCP_ADMIN_MODEL_TOOL_CONTRACT_VERSION,
3699
3895
  MCP_ADMIN_PRODUCTION_READINESS_ENV_VAR,
3700
3896
  MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID,
3701
3897
  MCP_ADMIN_REGISTRY_SOURCE,
@@ -3709,6 +3905,7 @@ export {
3709
3905
  MCP_ADMIN_USER_AGGREGATION_DIMENSIONS,
3710
3906
  MCP_ADMIN_USER_AGGREGATION_METRICS,
3711
3907
  MCP_ADMIN_USER_AGGREGATION_PRESETS,
3908
+ MCP_ASSET_CATALOG_CONFIRM_CAPABILITY,
3712
3909
  MCP_ASSET_CATALOG_REQUEST_CAPABILITY,
3713
3910
  MCP_ASSET_CATALOG_REVIEW_CAPABILITY,
3714
3911
  MCP_ASSET_EXTERNAL_HARVEST_FLAG_ID,
@@ -3729,6 +3926,8 @@ export {
3729
3926
  buildMcpSurfaceUrls,
3730
3927
  getMcpAdminContractDefaultTranslation,
3731
3928
  listMcpActionSummaries,
3929
+ listMcpModelResourceTemplates,
3930
+ listMcpModelToolSummaries,
3732
3931
  mcpAdminContractDescriptionKeys,
3733
3932
  mcpAdminContractsEnGbTranslations,
3734
3933
  mcpAdminContractsTranslations