@plasius/mcp-admin-contracts 0.4.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
@@ -1,7 +1,46 @@
1
+ // src/index.ts
2
+ import {
3
+ FEEDBACK_BACKEND_BUCKETS,
4
+ FEEDBACK_CONTRACT_VERSION,
5
+ FEEDBACK_FRAME_RATE_BUCKETS,
6
+ FEEDBACK_FRAME_TIME_BUCKETS,
7
+ FEEDBACK_GAME_COUNTER_CODES,
8
+ FEEDBACK_GAME_ERROR_CODES,
9
+ FEEDBACK_GAME_FEATURE_IDS,
10
+ FEEDBACK_INTENT_IDS,
11
+ FEEDBACK_PERSISTABLE_ISSUE_TYPES,
12
+ FEEDBACK_RENDERER_BUCKETS,
13
+ FEEDBACK_SENTIMENT_BUCKETS,
14
+ FEEDBACK_SURFACE_IDS,
15
+ FEEDBACK_THEME_IDS,
16
+ FEEDBACK_VIEWPORT_BUCKETS,
17
+ FeedbackBugPacketSchema,
18
+ FeedbackDailySatisfactionReportSchema,
19
+ FeedbackHourlyBugReportSchema,
20
+ FeedbackProcessorCheckpointSchema,
21
+ FeedbackReviewPacketSchema
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";
39
+
1
40
  // src/translations/en-GB.ts
2
41
  var mcpAdminContractsEnGbTranslations = {
3
- "mcpAdminContracts.manifest.descriptionForModel": "OAuth-protected MCP discovery manifest for the Plasius admin control plane covering feature flags, capabilities, analytics, pseudonymous Token finance reads, and audit-backed operations.",
4
- "mcpAdminContracts.manifest.description": "Authenticated admin MCP discovery for the Plasius feature flag, capability, analytics, pseudonymous Token reporting, and audit control plane.",
42
+ "mcpAdminContracts.manifest.descriptionForModel": "OAuth-protected MCP discovery manifest for the Plasius admin control plane covering feature flags, capabilities, analytics, privacy-safe feedback intelligence, pseudonymous Token finance reads, and audit-backed operations.",
43
+ "mcpAdminContracts.manifest.description": "Authenticated admin MCP discovery for the Plasius feature flag, capability, analytics, privacy-safe feedback intelligence, pseudonymous Token reporting, and audit control plane.",
5
44
  "mcpAdminContracts.action.listFeatureFlags.description": "List existing feature flags from the admin rollout control plane.",
6
45
  "mcpAdminContracts.action.getFeatureFlag.description": "Fetch one feature flag by stable key.",
7
46
  "mcpAdminContracts.action.updateFeatureFlag.description": "Patch an existing feature flag without bypassing the current admin update semantics.",
@@ -25,6 +64,11 @@ var mcpAdminContractsEnGbTranslations = {
25
64
  "mcpAdminContracts.action.getAdminTokenEconomyOverview.description": "Read the identifier-free global Token balance, lifetime totals, wallet counts, and authoritative projection freshness.",
26
65
  "mcpAdminContracts.action.listAdminTokenWalletBalances.description": "List bounded pseudonymous Token wallet balances without exposing account, payment, provider, or raw wallet identifiers.",
27
66
  "mcpAdminContracts.action.getAdminTokenTrends.description": "Read privacy-suppressed Token acquisition and usage trends with explainable advisory anomaly indicators.",
67
+ "mcpAdminContracts.action.getFeedbackBugHealth.description": "Read a bounded immutable hourly bug-health materialisation.",
68
+ "mcpAdminContracts.action.getFeedbackSatisfaction.description": "Read a bounded immutable daily satisfaction materialisation.",
69
+ "mcpAdminContracts.action.listFeedbackAlerts.description": "List bounded deterministic feedback advisories using an opaque cursor.",
70
+ "mcpAdminContracts.action.getFeedbackFreshness.description": "Read safe freshness metadata for the hourly bug and daily satisfaction processors.",
71
+ "mcpAdminContracts.action.listFeedbackStructuredEntries.description": "List bounded reporter-identifier-free structured feedback entries without narrative or storage references.",
28
72
  "mcpAdminContracts.action.searchAssetCatalog.description": "Search promoted asset catalog records without live third-party lookup.",
29
73
  "mcpAdminContracts.action.getAssetManifest.description": "Fetch a promoted player-safe runtime asset manifest reference.",
30
74
  "mcpAdminContracts.action.requestAsset.description": "Queue a governed missing-asset request when no promoted catalog match exists.",
@@ -38,6 +82,14 @@ var mcpAdminContractsEnGbTranslations = {
38
82
  "mcpAdminContracts.action.promoteAsset.description": "Promote an approved asset candidate to an immutable runtime manifest reference.",
39
83
  "mcpAdminContracts.action.rollbackAsset.description": "Rollback an asset runtime channel to a previous promoted manifest version.",
40
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.",
41
93
  "mcpAdminContracts.action.getUserTokenWallet.description": "Read an account's server-resolved Token wallet summary without exposing provider or payment data.",
42
94
  "mcpAdminContracts.action.listUserTokenActivity.description": "Read a bounded, cursor-paginated Token activity history for one account.",
43
95
  "mcpAdminContracts.action.listTokenAdjustments.description": "List audited Token adjustment proposals and their approval state.",
@@ -82,6 +134,11 @@ var mcpAdminContractDescriptionKeys = {
82
134
  actionGetAdminTokenEconomyOverview: "mcpAdminContracts.action.getAdminTokenEconomyOverview.description",
83
135
  actionListAdminTokenWalletBalances: "mcpAdminContracts.action.listAdminTokenWalletBalances.description",
84
136
  actionGetAdminTokenTrends: "mcpAdminContracts.action.getAdminTokenTrends.description",
137
+ actionGetFeedbackBugHealth: "mcpAdminContracts.action.getFeedbackBugHealth.description",
138
+ actionGetFeedbackSatisfaction: "mcpAdminContracts.action.getFeedbackSatisfaction.description",
139
+ actionListFeedbackAlerts: "mcpAdminContracts.action.listFeedbackAlerts.description",
140
+ actionGetFeedbackFreshness: "mcpAdminContracts.action.getFeedbackFreshness.description",
141
+ actionListFeedbackStructuredEntries: "mcpAdminContracts.action.listFeedbackStructuredEntries.description",
85
142
  actionSearchAssetCatalog: "mcpAdminContracts.action.searchAssetCatalog.description",
86
143
  actionGetAssetManifest: "mcpAdminContracts.action.getAssetManifest.description",
87
144
  actionRequestAsset: "mcpAdminContracts.action.requestAsset.description",
@@ -95,6 +152,14 @@ var mcpAdminContractDescriptionKeys = {
95
152
  actionPromoteAsset: "mcpAdminContracts.action.promoteAsset.description",
96
153
  actionRollbackAsset: "mcpAdminContracts.action.rollbackAsset.description",
97
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",
98
163
  actionGetUserTokenWallet: "mcpAdminContracts.action.getUserTokenWallet.description",
99
164
  actionListUserTokenActivity: "mcpAdminContracts.action.listUserTokenActivity.description",
100
165
  actionListTokenAdjustments: "mcpAdminContracts.action.listTokenAdjustments.description",
@@ -119,7 +184,7 @@ function getMcpAdminContractDefaultTranslation(key) {
119
184
  }
120
185
 
121
186
  // src/index.ts
122
- var MCP_ADMIN_CONTRACT_VERSION = "2026-08-08.v5";
187
+ var MCP_ADMIN_CONTRACT_VERSION = "2026-08-20.v7";
123
188
  var MCP_ADMIN_REGISTRY_SOURCE = "@plasius/mcp-admin-contracts";
124
189
  var MCP_ADMIN_FOUNDATION_FLAG_ID = "mcp.admin.foundation.enabled";
125
190
  var MCP_ACCESS_SCOPE = "mcp:access";
@@ -135,15 +200,114 @@ var MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID = "mcp.admin.production-readiness.ena
135
200
  var MCP_ADMIN_PRODUCTION_READINESS_ENV_VAR = "MCP_ADMIN_PRODUCTION_READINESS_ENABLED";
136
201
  var MCP_ASSET_PIPELINE_FLAG_ID = "asset.pipeline.unified-ai-assets.enabled";
137
202
  var MCP_ASSET_EXTERNAL_HARVEST_FLAG_ID = "asset.pipeline.external-model-harvest.enabled";
138
- var MCP_ASSET_CATALOG_REQUEST_CAPABILITY = "asset.catalog.request";
139
- var MCP_ASSET_PIPELINE_MANAGE_CAPABILITY = "asset.pipeline.mcp.manage";
140
- var MCP_ASSET_SOURCE_MANAGE_CAPABILITY = "asset.source.manage";
141
- 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();
227
+ var MCP_ADMIN_FEEDBACK_FLAG_ID = "feedback.mcp.enabled";
228
+ var MCP_ADMIN_FEEDBACK_READ_CAPABILITY = "admin.feedback.read";
229
+ var MCP_ADMIN_BASE_OAUTH_SCOPE = MCP_ACCESS_SCOPE;
230
+ var MCP_ADMIN_FEEDBACK_READ_OAUTH_SCOPE = MCP_ADMIN_FEEDBACK_READ_CAPABILITY;
231
+ var MCP_ADMIN_FEEDBACK_REQUIRED_OAUTH_SCOPES = Object.freeze([
232
+ MCP_ADMIN_BASE_OAUTH_SCOPE,
233
+ MCP_ADMIN_FEEDBACK_READ_OAUTH_SCOPE
234
+ ]);
235
+ var MCP_ADMIN_FEEDBACK_SCHEMA_PACKAGE = "@plasius/schema";
236
+ var MCP_ADMIN_FEEDBACK_SCHEMA_CONTRACT_VERSION = FEEDBACK_CONTRACT_VERSION;
237
+ var MCP_ADMIN_FEEDBACK_WINDOWS = [
238
+ "previous-utc-hour",
239
+ "last-24-hours",
240
+ "last-7-days",
241
+ "last-30-days",
242
+ "last-90-days"
243
+ ];
244
+ var MCP_ADMIN_FEEDBACK_PACKET_TYPES = [
245
+ "feedback-bug-packet",
246
+ "feedback-review-packet"
247
+ ];
248
+ var MCP_ADMIN_FEEDBACK_REPORT_TYPES = [
249
+ "feedback-hourly-bug-report",
250
+ "feedback-daily-satisfaction-report"
251
+ ];
252
+ var MCP_ADMIN_FEEDBACK_PROCESSORS = [
253
+ "bug-hourly",
254
+ "review-daily",
255
+ "commit-reconciliation"
256
+ ];
257
+ var MCP_ADMIN_FEEDBACK_PRIVACY_EXCLUSIONS = [
258
+ "account-identifiers",
259
+ "reporter-pseudonyms",
260
+ "network-identifiers",
261
+ "session-identifiers",
262
+ "user-agents",
263
+ "locales",
264
+ "client-timestamps",
265
+ "referrers",
266
+ "credential-material",
267
+ "financial-identifiers",
268
+ "government-identifiers",
269
+ "narrative",
270
+ "generated-summaries",
271
+ "quotations",
272
+ "embeddings",
273
+ "content-hashes",
274
+ "matched-values",
275
+ "model-traces",
276
+ "binary-images",
277
+ "filenames",
278
+ "exact-coordinates",
279
+ "exact-dimensions",
280
+ "adapter-fingerprints",
281
+ "raw-warnings",
282
+ "blob-references",
283
+ "raw-urls",
284
+ "unrestricted-scans",
285
+ "mutations"
286
+ ];
142
287
  var MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID = "mcp.admin-economy-adjustments.enabled";
143
288
  var ECONOMY_OWNER_ADJUSTMENTS_FLAG_ID = "economy.tokens.owner-adjustments.enabled";
144
289
  var MCP_ECONOMY_FINANCE_VIEW_CAPABILITY = "economy.finance-operations.view";
145
290
  var MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY = "economy.finance-operations.adjust";
146
291
  var MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY = "economy.finance-operations.approve-adjustment";
292
+ var canonicalFeedbackSchemas = Object.freeze({
293
+ FeedbackBugPacketSchema,
294
+ FeedbackReviewPacketSchema,
295
+ FeedbackHourlyBugReportSchema,
296
+ FeedbackDailySatisfactionReportSchema,
297
+ FeedbackProcessorCheckpointSchema
298
+ });
299
+ var feedbackSchemaSource = (...schemaNames) => {
300
+ for (const schemaName of schemaNames) {
301
+ if (canonicalFeedbackSchemas[schemaName].meta.version !== MCP_ADMIN_FEEDBACK_SCHEMA_CONTRACT_VERSION) {
302
+ throw new TypeError("Canonical feedback schema version mismatch.");
303
+ }
304
+ }
305
+ return {
306
+ packageName: MCP_ADMIN_FEEDBACK_SCHEMA_PACKAGE,
307
+ contractVersion: MCP_ADMIN_FEEDBACK_SCHEMA_CONTRACT_VERSION,
308
+ schemaNames: [...schemaNames]
309
+ };
310
+ };
147
311
  var stringField = (description, options = {}) => ({
148
312
  type: "string",
149
313
  description,
@@ -159,18 +323,41 @@ var numberField = (description, options = {}) => ({
159
323
  description,
160
324
  ...options
161
325
  });
326
+ var integerField = (description, options = {}) => ({
327
+ type: "integer",
328
+ description,
329
+ ...options
330
+ });
162
331
  var objectField = (description, properties, options = {}) => ({
163
332
  type: "object",
164
333
  description,
165
334
  properties,
166
335
  ...options
167
336
  });
337
+ var feedbackClosedObjectField = (description, properties, options = {}) => objectField(description, properties, {
338
+ ...options,
339
+ additionalProperties: false
340
+ });
168
341
  var arrayField = (description, itemType, options = {}) => ({
169
342
  type: "array",
170
343
  description,
171
344
  itemType,
172
345
  ...options
173
346
  });
347
+ var arrayOfField = (description, itemType, items, options = {}) => ({
348
+ type: "array",
349
+ description,
350
+ itemType,
351
+ items,
352
+ ...options
353
+ });
354
+ var discriminatedUnionField = (description, discriminator, variants, options = {}) => ({
355
+ type: "discriminated-union",
356
+ description,
357
+ discriminator,
358
+ oneOf: variants,
359
+ ...options
360
+ });
174
361
  var translatedDescription = (descriptionKey) => {
175
362
  const descriptionDefault = getMcpAdminContractDefaultTranslation(descriptionKey);
176
363
  return {
@@ -663,6 +850,940 @@ var adminTokenTrendPointField = objectField(
663
850
  anomaly: adminTokenAnomalyField
664
851
  }
665
852
  );
853
+ var MCP_ADMIN_FEEDBACK_MAX_PAGE_SIZE = 100;
854
+ var MCP_ADMIN_FEEDBACK_MAX_CURSOR_LENGTH = 512;
855
+ var MCP_ADMIN_FEEDBACK_BUG_HEALTH_WINDOWS = [
856
+ "previous-utc-hour",
857
+ "last-24-hours",
858
+ "last-7-days"
859
+ ];
860
+ var MCP_ADMIN_FEEDBACK_SATISFACTION_WINDOWS = [
861
+ "last-7-days",
862
+ "last-30-days",
863
+ "last-90-days"
864
+ ];
865
+ var MCP_ADMIN_FEEDBACK_ENTRY_WINDOWS = [
866
+ "last-24-hours",
867
+ "last-7-days",
868
+ "last-30-days",
869
+ "last-90-days"
870
+ ];
871
+ var MCP_ADMIN_FEEDBACK_ALERT_WINDOWS = [
872
+ "last-24-hours",
873
+ "last-7-days"
874
+ ];
875
+ var MCP_ADMIN_FEEDBACK_PRIVACY_METADATA = Object.freeze({
876
+ classification: "public-safe-structured-only",
877
+ readOnly: true,
878
+ bounded: true,
879
+ excludes: Object.freeze([...MCP_ADMIN_FEEDBACK_PRIVACY_EXCLUSIONS]),
880
+ notes: Object.freeze([
881
+ "Responses contain only schema-validated structured fields and materialised report metadata.",
882
+ "The runtime must enforce admin authentication, `mcp:access` plus `admin.feedback.read`, the rollout flag, bounded cursors and ranges, fail-closed rate limits, and dedicated audit.",
883
+ "Narrative-derived values are closed classifications only; no summaries, quotations, embeddings, hashes, matched values, or model traces are permitted."
884
+ ])
885
+ });
886
+ var feedbackReadAccess = {
887
+ oauthScopes: [...MCP_ADMIN_FEEDBACK_REQUIRED_OAUTH_SCOPES],
888
+ capabilities: [MCP_ADMIN_FEEDBACK_READ_CAPABILITY],
889
+ rolloutFlags: [MCP_ADMIN_FEEDBACK_FLAG_ID],
890
+ mode: "read-only",
891
+ identityResolution: "not-available"
892
+ };
893
+ var feedbackPageMetadataField = (allowedWindows) => feedbackClosedObjectField("Bounded read-response metadata.", {
894
+ window: stringField("Closed server-owned response window.", {
895
+ enum: [...allowedWindows]
896
+ }),
897
+ windowStart: stringField("Inclusive UTC response-window boundary.", {
898
+ format: "date-time"
899
+ }),
900
+ windowEnd: stringField("Exclusive UTC response-window boundary.", {
901
+ format: "date-time"
902
+ }),
903
+ generatedAt: stringField("UTC time at which this response projection was produced.", {
904
+ format: "date-time"
905
+ }),
906
+ returnedCount: integerField("Number of records in this bounded page.", {
907
+ minimum: 0,
908
+ maximum: MCP_ADMIN_FEEDBACK_MAX_PAGE_SIZE
909
+ }),
910
+ nextCursor: stringField("Opaque continuation cursor when more results exist.", {
911
+ required: false,
912
+ minLength: 1,
913
+ maxLength: MCP_ADMIN_FEEDBACK_MAX_CURSOR_LENGTH,
914
+ pattern: "^[A-Za-z0-9_-]+$"
915
+ })
916
+ });
917
+ var FEEDBACK_SCHEMA_MAX_COUNT = 1e9;
918
+ var FEEDBACK_SCHEMA_UUID_V4_PATTERN = "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$";
919
+ var FEEDBACK_SCHEMA_SAFE_ID_PATTERN = "^[A-Za-z0-9][A-Za-z0-9._:-]*$";
920
+ var FEEDBACK_SCHEMA_SURFACE_IDS = FEEDBACK_SURFACE_IDS;
921
+ var FEEDBACK_SCHEMA_PERSISTABLE_ISSUE_TYPES = FEEDBACK_PERSISTABLE_ISSUE_TYPES;
922
+ var FEEDBACK_SCHEMA_SENTIMENT_BUCKETS = FEEDBACK_SENTIMENT_BUCKETS;
923
+ var FEEDBACK_SCHEMA_INTENT_IDS = FEEDBACK_INTENT_IDS;
924
+ var FEEDBACK_SCHEMA_THEME_IDS = FEEDBACK_THEME_IDS;
925
+ var FEEDBACK_SCHEMA_RENDERER_BUCKETS = FEEDBACK_RENDERER_BUCKETS;
926
+ var FEEDBACK_SCHEMA_BACKEND_BUCKETS = FEEDBACK_BACKEND_BUCKETS;
927
+ var FEEDBACK_SCHEMA_VIEWPORT_BUCKETS = FEEDBACK_VIEWPORT_BUCKETS;
928
+ var FEEDBACK_SCHEMA_FRAME_RATE_BUCKETS = FEEDBACK_FRAME_RATE_BUCKETS;
929
+ var FEEDBACK_SCHEMA_FRAME_TIME_BUCKETS = FEEDBACK_FRAME_TIME_BUCKETS;
930
+ var FEEDBACK_SCHEMA_GAME_FEATURE_IDS = FEEDBACK_GAME_FEATURE_IDS;
931
+ var FEEDBACK_SCHEMA_GAME_COUNTER_CODES = FEEDBACK_GAME_COUNTER_CODES;
932
+ var FEEDBACK_SCHEMA_GAME_ERROR_CODES = FEEDBACK_GAME_ERROR_CODES;
933
+ var requireCanonicalStringEnum = (field) => {
934
+ const values = field?.enumValues;
935
+ if (values === void 0 || values.length === 0 || values.some((value) => typeof value !== "string")) {
936
+ throw new TypeError("Canonical feedback schema enum is unavailable.");
937
+ }
938
+ return Object.freeze([...values]);
939
+ };
940
+ var canonicalHourlyBugShape = FeedbackHourlyBugReportSchema._shape;
941
+ var canonicalAdvisoryShape = canonicalHourlyBugShape.advisories?.itemType?._shape;
942
+ var FEEDBACK_SCHEMA_ADVISORY_CODES = requireCanonicalStringEnum(
943
+ canonicalAdvisoryShape?.code
944
+ );
945
+ var FEEDBACK_SCHEMA_RECOMMENDATION_IDS = requireCanonicalStringEnum(
946
+ canonicalAdvisoryShape?.recommendationIds?.itemType
947
+ );
948
+ var FEEDBACK_SCHEMA_ABUSE_BLOCK_BANDS = requireCanonicalStringEnum(
949
+ canonicalHourlyBugShape.abuseBlockBands?.itemType?._shape?.id
950
+ );
951
+ var canonicalLiteralStringField = (description, value) => stringField(description, {
952
+ enum: [value],
953
+ constValue: value
954
+ });
955
+ var canonicalUuidV4Field = (description) => stringField(description, {
956
+ format: "uuid",
957
+ minLength: 36,
958
+ maxLength: 36,
959
+ pattern: FEEDBACK_SCHEMA_UUID_V4_PATTERN
960
+ });
961
+ var canonicalSafeIdField = (description, maximum = 128) => stringField(description, {
962
+ minLength: 1,
963
+ maxLength: maximum,
964
+ pattern: FEEDBACK_SCHEMA_SAFE_ID_PATTERN
965
+ });
966
+ var canonicalDateTimeField = (description) => stringField(description, {
967
+ format: "date-time"
968
+ });
969
+ var canonicalCountField = (description, options = {}) => integerField(description, {
970
+ minimum: 0,
971
+ maximum: FEEDBACK_SCHEMA_MAX_COUNT,
972
+ ...options
973
+ });
974
+ var canonicalSchemaIdentityFields = (type) => ({
975
+ type: canonicalLiteralStringField("Canonical @plasius/schema identity.", type),
976
+ version: canonicalLiteralStringField(
977
+ "Canonical feedback contract version.",
978
+ MCP_ADMIN_FEEDBACK_SCHEMA_CONTRACT_VERSION
979
+ )
980
+ });
981
+ var canonicalStringArrayField = (description, enumValues, maximum, options = {}) => arrayOfField(
982
+ description,
983
+ "string",
984
+ stringField("Closed canonical value.", { enum: [...enumValues] }),
985
+ { maxItems: maximum, ...options }
986
+ );
987
+ var canonicalAnalyzedProjectionField = feedbackClosedObjectField(
988
+ "Canonical analyzed `FeedbackDerivedAnalysis` projection.",
989
+ {
990
+ ...canonicalSchemaIdentityFields("feedback-derived-analysis"),
991
+ status: canonicalLiteralStringField(
992
+ "Canonical analysis status.",
993
+ "analyzed"
994
+ ),
995
+ sentiment: stringField("Closed canonical sentiment bucket.", {
996
+ enum: [...FEEDBACK_SCHEMA_SENTIMENT_BUCKETS]
997
+ }),
998
+ intentIds: canonicalStringArrayField(
999
+ "Unique closed canonical intent identifiers.",
1000
+ FEEDBACK_SCHEMA_INTENT_IDS,
1001
+ 8
1002
+ ),
1003
+ themeIds: canonicalStringArrayField(
1004
+ "Unique closed canonical theme identifiers.",
1005
+ FEEDBACK_SCHEMA_THEME_IDS,
1006
+ 8
1007
+ ),
1008
+ confidence: stringField("Closed classifier confidence.", {
1009
+ enum: ["low", "medium", "high"]
1010
+ }),
1011
+ policyVersion: stringField("Pinned canonical privacy policy version.", {
1012
+ enum: ["feedback-privacy-en-v1"]
1013
+ }),
1014
+ modelVersion: stringField("Pinned canonical local model version.", {
1015
+ enum: ["feedback-en-rules-v1"]
1016
+ }),
1017
+ deterministicRedactionCount: canonicalCountField(
1018
+ "Browser deterministic-redaction count.",
1019
+ { maximum: 4e3 }
1020
+ ),
1021
+ scannerRedactionCount: canonicalCountField(
1022
+ "Private-scanner redaction count.",
1023
+ { maximum: 4e3 }
1024
+ )
1025
+ }
1026
+ );
1027
+ var canonicalStructuredOnlyProjectionField = feedbackClosedObjectField(
1028
+ "Canonical structured-only `FeedbackDerivedAnalysis` projection.",
1029
+ {
1030
+ ...canonicalSchemaIdentityFields("feedback-derived-analysis"),
1031
+ status: canonicalLiteralStringField(
1032
+ "Canonical analysis status.",
1033
+ "structured-only"
1034
+ ),
1035
+ intentIds: canonicalStringArrayField(
1036
+ "Structured-only projections contain no intent identifiers.",
1037
+ FEEDBACK_SCHEMA_INTENT_IDS,
1038
+ 0
1039
+ ),
1040
+ themeIds: canonicalStringArrayField(
1041
+ "Structured-only projections contain no theme identifiers.",
1042
+ FEEDBACK_SCHEMA_THEME_IDS,
1043
+ 0
1044
+ ),
1045
+ policyVersion: stringField("Pinned canonical privacy policy version.", {
1046
+ enum: ["feedback-privacy-en-v1"]
1047
+ }),
1048
+ modelVersion: stringField("Pinned canonical local model version.", {
1049
+ enum: ["feedback-en-rules-v1"]
1050
+ }),
1051
+ deterministicRedactionCount: canonicalCountField(
1052
+ "Browser deterministic-redaction count.",
1053
+ { maximum: 4e3 }
1054
+ ),
1055
+ scannerRedactionCount: canonicalCountField(
1056
+ "Private-scanner redaction count.",
1057
+ { maximum: 4e3 }
1058
+ )
1059
+ }
1060
+ );
1061
+ var canonicalAnalysisProjectionField = discriminatedUnionField(
1062
+ "Canonical closed `FeedbackDerivedAnalysis` projection.",
1063
+ "status",
1064
+ [
1065
+ canonicalAnalyzedProjectionField,
1066
+ canonicalStructuredOnlyProjectionField
1067
+ ],
1068
+ { required: false }
1069
+ );
1070
+ var canonicalGameCounterField = feedbackClosedObjectField(
1071
+ "Canonical bounded renderer diagnostic counter.",
1072
+ {
1073
+ code: stringField("Closed canonical counter code.", {
1074
+ enum: [...FEEDBACK_SCHEMA_GAME_COUNTER_CODES]
1075
+ }),
1076
+ count: canonicalCountField("Positive bounded counter value.", {
1077
+ minimum: 1,
1078
+ maximum: 1e4
1079
+ })
1080
+ }
1081
+ );
1082
+ var canonicalGameDiagnosticsVariantField = (surfaceId, provenanceContractId) => feedbackClosedObjectField("Canonical bounded renderer-owned game diagnostics.", {
1083
+ ...canonicalSchemaIdentityFields("feedback-game-diagnostics"),
1084
+ surfaceId: canonicalLiteralStringField(
1085
+ "Canonical diagnostics-eligible surface.",
1086
+ surfaceId
1087
+ ),
1088
+ consentConfirmed: booleanField("Explicit diagnostics consent.", {
1089
+ constValue: true
1090
+ }),
1091
+ provenanceContractId: canonicalLiteralStringField(
1092
+ "Renderer-owned provenance contract.",
1093
+ provenanceContractId
1094
+ ),
1095
+ renderer: stringField("Coarse canonical renderer bucket.", {
1096
+ enum: [...FEEDBACK_SCHEMA_RENDERER_BUCKETS]
1097
+ }),
1098
+ backend: stringField("Coarse canonical execution-backend bucket.", {
1099
+ enum: [...FEEDBACK_SCHEMA_BACKEND_BUCKETS]
1100
+ }),
1101
+ viewportBucket: stringField("Coarse canonical viewport bucket.", {
1102
+ enum: [...FEEDBACK_SCHEMA_VIEWPORT_BUCKETS]
1103
+ }),
1104
+ frameRateBucket: stringField("Coarse canonical frame-rate bucket.", {
1105
+ enum: [...FEEDBACK_SCHEMA_FRAME_RATE_BUCKETS]
1106
+ }),
1107
+ frameTimeBucket: stringField("Coarse canonical frame-time bucket.", {
1108
+ enum: [...FEEDBACK_SCHEMA_FRAME_TIME_BUCKETS]
1109
+ }),
1110
+ featureIds: canonicalStringArrayField(
1111
+ "Unique closed renderer feature identifiers.",
1112
+ FEEDBACK_SCHEMA_GAME_FEATURE_IDS,
1113
+ FEEDBACK_SCHEMA_GAME_FEATURE_IDS.length
1114
+ ),
1115
+ counters: arrayOfField(
1116
+ "Unique bounded renderer counters.",
1117
+ "FeedbackGameDiagnosticCounter",
1118
+ canonicalGameCounterField,
1119
+ { maxItems: 32 }
1120
+ ),
1121
+ errorCodes: canonicalStringArrayField(
1122
+ "Unique closed renderer error codes.",
1123
+ FEEDBACK_SCHEMA_GAME_ERROR_CODES,
1124
+ FEEDBACK_SCHEMA_GAME_ERROR_CODES.length
1125
+ )
1126
+ });
1127
+ var canonicalGameDiagnosticsField = discriminatedUnionField(
1128
+ "Canonical `FeedbackGameDiagnostics`; its surface must equal the containing bug packet surface and it cannot express pixels, DOM, text, URLs, filenames, coordinates, or adapter fingerprints.",
1129
+ "surfaceId",
1130
+ [
1131
+ canonicalGameDiagnosticsVariantField(
1132
+ "site.generator",
1133
+ "generator.renderer-diagnostics.v1"
1134
+ ),
1135
+ canonicalGameDiagnosticsVariantField(
1136
+ "site.gpu-demo",
1137
+ "gpu-demo.renderer-diagnostics.v1"
1138
+ )
1139
+ ],
1140
+ { required: false }
1141
+ );
1142
+ var canonicalBugPacketField = feedbackClosedObjectField(
1143
+ "Canonical identifier-free immutable `FeedbackBugPacket`.",
1144
+ {
1145
+ ...canonicalSchemaIdentityFields("feedback-bug-packet"),
1146
+ packetId: canonicalUuidV4Field("Opaque canonical packet UUIDv4."),
1147
+ acceptedAt: canonicalDateTimeField("Server-owned packet acceptance time."),
1148
+ surfaceId: stringField("Canonical capability-projected surface identifier.", {
1149
+ enum: [...FEEDBACK_SCHEMA_SURFACE_IDS]
1150
+ }),
1151
+ issueType: stringField("Canonical persistable issue type.", {
1152
+ enum: [...FEEDBACK_SCHEMA_PERSISTABLE_ISSUE_TYPES]
1153
+ }),
1154
+ severity: integerField("Canonical bug severity.", {
1155
+ minimum: 1,
1156
+ maximum: 5
1157
+ }),
1158
+ releaseId: canonicalSafeIdField("Server-owned release identifier."),
1159
+ buildId: canonicalSafeIdField("Server-owned build identifier."),
1160
+ analysis: canonicalAnalysisProjectionField,
1161
+ gameDiagnostics: canonicalGameDiagnosticsField
1162
+ }
1163
+ );
1164
+ var canonicalReviewPacketField = feedbackClosedObjectField(
1165
+ "Canonical identifier-free immutable `FeedbackReviewPacket`.",
1166
+ {
1167
+ ...canonicalSchemaIdentityFields("feedback-review-packet"),
1168
+ packetId: canonicalUuidV4Field("Opaque canonical packet UUIDv4."),
1169
+ acceptedAt: canonicalDateTimeField("Server-owned packet acceptance time."),
1170
+ satisfaction: integerField("Canonical satisfaction rating.", {
1171
+ minimum: 1,
1172
+ maximum: 5
1173
+ }),
1174
+ analysis: canonicalAnalysisProjectionField
1175
+ }
1176
+ );
1177
+ var canonicalFeedbackPacketField = discriminatedUnionField(
1178
+ "Canonical bug/review packet discriminated by exact schema identity.",
1179
+ "type",
1180
+ [canonicalBugPacketField, canonicalReviewPacketField]
1181
+ );
1182
+ var canonicalDistributionField = (description, idField, maximum) => arrayOfField(
1183
+ `${description} Bucket identifiers are unique as required by the canonical schema.`,
1184
+ "FeedbackCountBucket",
1185
+ feedbackClosedObjectField("Canonical count bucket.", {
1186
+ id: idField,
1187
+ count: canonicalCountField("Canonical non-negative bucket count.")
1188
+ }),
1189
+ { maxItems: maximum }
1190
+ );
1191
+ var canonicalAdvisoryField = feedbackClosedObjectField(
1192
+ "Canonical deterministic feedback advisory.",
1193
+ {
1194
+ code: stringField("Closed canonical advisory code.", {
1195
+ enum: [...FEEDBACK_SCHEMA_ADVISORY_CODES]
1196
+ }),
1197
+ level: stringField("Canonical advisory level.", {
1198
+ enum: ["advisory", "critical"]
1199
+ }),
1200
+ triggerCount: canonicalCountField("Positive deterministic trigger count.", {
1201
+ minimum: 1
1202
+ }),
1203
+ recommendationIds: canonicalStringArrayField(
1204
+ "One to eight deterministic recommendation identifiers.",
1205
+ FEEDBACK_SCHEMA_RECOMMENDATION_IDS,
1206
+ 8,
1207
+ { minItems: 1 }
1208
+ )
1209
+ }
1210
+ );
1211
+ var canonicalAdvisoriesField = arrayOfField(
1212
+ "Canonical deterministic advisories.",
1213
+ "FeedbackAdvisory",
1214
+ canonicalAdvisoryField,
1215
+ { maxItems: 32 }
1216
+ );
1217
+ var canonicalHourlyBugReportField = feedbackClosedObjectField(
1218
+ "Canonical materialised `FeedbackHourlyBugReport`.",
1219
+ {
1220
+ ...canonicalSchemaIdentityFields("feedback-hourly-bug-report"),
1221
+ reportId: canonicalUuidV4Field("Opaque canonical report UUIDv4."),
1222
+ windowStart: canonicalDateTimeField("Inclusive aligned UTC hour boundary."),
1223
+ windowEnd: canonicalDateTimeField("Exclusive aligned UTC hour boundary."),
1224
+ revision: integerField("Positive canonical materialisation revision.", {
1225
+ minimum: 1,
1226
+ maximum: 1e6
1227
+ }),
1228
+ generatedAt: canonicalDateTimeField("Canonical materialisation time."),
1229
+ acceptedCount: canonicalCountField("Accepted bug-packet count."),
1230
+ rejectedCount: canonicalCountField("Rejected bug-submission count."),
1231
+ diagnosticsAttachedCount: canonicalCountField(
1232
+ "Accepted packets carrying canonical game diagnostics."
1233
+ ),
1234
+ deterministicRedactionCount: canonicalCountField(
1235
+ "Total browser deterministic redactions."
1236
+ ),
1237
+ scannerRedactionCount: canonicalCountField(
1238
+ "Total private-scanner redactions."
1239
+ ),
1240
+ processorLagSeconds: canonicalCountField(
1241
+ "Exact materialisation lag from `windowEnd`."
1242
+ ),
1243
+ rates: feedbackClosedObjectField("Canonical rejection and redaction rates.", {
1244
+ rejectionRate: numberField("Rejected share of submitted records.", {
1245
+ minimum: 0,
1246
+ maximum: 1
1247
+ }),
1248
+ deterministicRedactionsPerAccepted: numberField(
1249
+ "Deterministic redactions per accepted packet.",
1250
+ { minimum: 0, maximum: 4e3 }
1251
+ ),
1252
+ scannerRedactionsPerAccepted: numberField(
1253
+ "Scanner redactions per accepted packet.",
1254
+ { minimum: 0, maximum: 4e3 }
1255
+ )
1256
+ }),
1257
+ traffic: feedbackClosedObjectField("Safe precomputed traffic denominator.", {
1258
+ denominator: canonicalCountField("Safe traffic denominator."),
1259
+ acceptedPerTenThousand: numberField(
1260
+ "Accepted bugs per ten thousand traffic units when denominator is non-zero.",
1261
+ {
1262
+ required: false,
1263
+ minimum: 0,
1264
+ maximum: FEEDBACK_SCHEMA_MAX_COUNT
1265
+ }
1266
+ )
1267
+ }),
1268
+ targetDistribution: canonicalDistributionField(
1269
+ "Counts by canonical feedback surface.",
1270
+ stringField("Canonical surface identifier.", {
1271
+ enum: [...FEEDBACK_SCHEMA_SURFACE_IDS]
1272
+ }),
1273
+ 256
1274
+ ),
1275
+ issueTypeDistribution: canonicalDistributionField(
1276
+ "Counts by canonical persistable issue type.",
1277
+ stringField("Canonical persistable issue type.", {
1278
+ enum: [...FEEDBACK_SCHEMA_PERSISTABLE_ISSUE_TYPES]
1279
+ }),
1280
+ 9
1281
+ ),
1282
+ severityDistribution: canonicalDistributionField(
1283
+ "Counts by canonical severity identifier.",
1284
+ stringField("Canonical severity identifier.", {
1285
+ enum: ["1", "2", "3", "4", "5"]
1286
+ }),
1287
+ 5
1288
+ ),
1289
+ intentDistribution: canonicalDistributionField(
1290
+ "Counts by canonical derived intent.",
1291
+ stringField("Canonical intent identifier.", {
1292
+ enum: [...FEEDBACK_SCHEMA_INTENT_IDS]
1293
+ }),
1294
+ FEEDBACK_SCHEMA_INTENT_IDS.length
1295
+ ),
1296
+ buildDistribution: canonicalDistributionField(
1297
+ "Counts by server-owned build identifier.",
1298
+ canonicalSafeIdField("Server-owned build identifier."),
1299
+ 128
1300
+ ),
1301
+ rendererDistribution: canonicalDistributionField(
1302
+ "Counts by canonical renderer bucket.",
1303
+ stringField("Canonical renderer bucket.", {
1304
+ enum: [...FEEDBACK_SCHEMA_RENDERER_BUCKETS]
1305
+ }),
1306
+ FEEDBACK_SCHEMA_RENDERER_BUCKETS.length
1307
+ ),
1308
+ backendDistribution: canonicalDistributionField(
1309
+ "Counts by canonical execution-backend bucket.",
1310
+ stringField("Canonical backend bucket.", {
1311
+ enum: [...FEEDBACK_SCHEMA_BACKEND_BUCKETS]
1312
+ }),
1313
+ FEEDBACK_SCHEMA_BACKEND_BUCKETS.length
1314
+ ),
1315
+ viewportDistribution: canonicalDistributionField(
1316
+ "Counts by canonical viewport bucket.",
1317
+ stringField("Canonical viewport bucket.", {
1318
+ enum: [...FEEDBACK_SCHEMA_VIEWPORT_BUCKETS]
1319
+ }),
1320
+ FEEDBACK_SCHEMA_VIEWPORT_BUCKETS.length
1321
+ ),
1322
+ frameRateDistribution: canonicalDistributionField(
1323
+ "Counts by canonical frame-rate bucket.",
1324
+ stringField("Canonical frame-rate bucket.", {
1325
+ enum: [...FEEDBACK_SCHEMA_FRAME_RATE_BUCKETS]
1326
+ }),
1327
+ FEEDBACK_SCHEMA_FRAME_RATE_BUCKETS.length
1328
+ ),
1329
+ frameTimeDistribution: canonicalDistributionField(
1330
+ "Counts by canonical frame-time bucket.",
1331
+ stringField("Canonical frame-time bucket.", {
1332
+ enum: [...FEEDBACK_SCHEMA_FRAME_TIME_BUCKETS]
1333
+ }),
1334
+ FEEDBACK_SCHEMA_FRAME_TIME_BUCKETS.length
1335
+ ),
1336
+ diagnosticFeatureDistribution: canonicalDistributionField(
1337
+ "Counts by canonical renderer feature identifier.",
1338
+ stringField("Canonical renderer feature identifier.", {
1339
+ enum: [...FEEDBACK_SCHEMA_GAME_FEATURE_IDS]
1340
+ }),
1341
+ FEEDBACK_SCHEMA_GAME_FEATURE_IDS.length
1342
+ ),
1343
+ diagnosticCounterDistribution: canonicalDistributionField(
1344
+ "Summed canonical renderer counters.",
1345
+ stringField("Canonical renderer counter code.", {
1346
+ enum: [...FEEDBACK_SCHEMA_GAME_COUNTER_CODES]
1347
+ }),
1348
+ FEEDBACK_SCHEMA_GAME_COUNTER_CODES.length
1349
+ ),
1350
+ diagnosticErrorDistribution: canonicalDistributionField(
1351
+ "Counts by canonical renderer error code.",
1352
+ stringField("Canonical renderer error code.", {
1353
+ enum: [...FEEDBACK_SCHEMA_GAME_ERROR_CODES]
1354
+ }),
1355
+ FEEDBACK_SCHEMA_GAME_ERROR_CODES.length
1356
+ ),
1357
+ abuseBlockBands: canonicalDistributionField(
1358
+ "Counts by canonical abuse-block band.",
1359
+ stringField("Canonical abuse-block band.", {
1360
+ enum: [...FEEDBACK_SCHEMA_ABUSE_BLOCK_BANDS]
1361
+ }),
1362
+ 16
1363
+ ),
1364
+ comparison: feedbackClosedObjectField("Canonical prior-period comparison.", {
1365
+ previousHourRatio: numberField("Ratio to the previous UTC hour.", {
1366
+ minimum: 0,
1367
+ maximum: 1e3
1368
+ }),
1369
+ sevenDaySameHourRatio: numberField(
1370
+ "Ratio to the seven-day same-hour baseline.",
1371
+ { minimum: 0, maximum: 1e3 }
1372
+ )
1373
+ }),
1374
+ advisories: canonicalAdvisoriesField
1375
+ }
1376
+ );
1377
+ var canonicalDailySatisfactionReportField = feedbackClosedObjectField(
1378
+ "Canonical materialised `FeedbackDailySatisfactionReport`.",
1379
+ {
1380
+ ...canonicalSchemaIdentityFields("feedback-daily-satisfaction-report"),
1381
+ reportId: canonicalUuidV4Field("Opaque canonical report UUIDv4."),
1382
+ windowStart: canonicalDateTimeField("Inclusive aligned UTC day boundary."),
1383
+ windowEnd: canonicalDateTimeField("Exclusive aligned UTC day boundary."),
1384
+ revision: integerField("Positive canonical materialisation revision.", {
1385
+ minimum: 1,
1386
+ maximum: 1e6
1387
+ }),
1388
+ generatedAt: canonicalDateTimeField("Canonical materialisation time."),
1389
+ processorLagSeconds: canonicalCountField(
1390
+ "Exact materialisation lag from `windowEnd`."
1391
+ ),
1392
+ acceptedReviewCount: canonicalCountField("Accepted review-packet count."),
1393
+ meanStars: numberField(
1394
+ "Mean stars; absent exactly when `acceptedReviewCount` is zero.",
1395
+ { required: false, minimum: 1, maximum: 5 }
1396
+ ),
1397
+ medianStars: numberField(
1398
+ "Median stars; absent exactly when `acceptedReviewCount` is zero.",
1399
+ { required: false, minimum: 1, maximum: 5 }
1400
+ ),
1401
+ starDistribution: canonicalDistributionField(
1402
+ "Counts by canonical star identifier.",
1403
+ stringField("Canonical star identifier.", {
1404
+ enum: ["1", "2", "3", "4", "5"]
1405
+ }),
1406
+ 5
1407
+ ),
1408
+ sentimentDistribution: canonicalDistributionField(
1409
+ "Counts by canonical sentiment bucket.",
1410
+ stringField("Canonical sentiment bucket.", {
1411
+ enum: [...FEEDBACK_SCHEMA_SENTIMENT_BUCKETS]
1412
+ }),
1413
+ FEEDBACK_SCHEMA_SENTIMENT_BUCKETS.length
1414
+ ),
1415
+ intentDistribution: canonicalDistributionField(
1416
+ "Counts by canonical derived intent.",
1417
+ stringField("Canonical intent identifier.", {
1418
+ enum: [...FEEDBACK_SCHEMA_INTENT_IDS]
1419
+ }),
1420
+ FEEDBACK_SCHEMA_INTENT_IDS.length
1421
+ ),
1422
+ rollingWindows: arrayOfField(
1423
+ "Exactly one canonical 7-, 30-, and 90-day rolling window.",
1424
+ "FeedbackRollingSatisfaction",
1425
+ feedbackClosedObjectField("Canonical rolling satisfaction window.", {
1426
+ period: stringField("Canonical rolling period.", {
1427
+ enum: ["7-days", "30-days", "90-days"]
1428
+ }),
1429
+ reviewCount: canonicalCountField("Accepted reviews in the period."),
1430
+ meanStars: numberField(
1431
+ "Mean stars; absent exactly when `reviewCount` is zero.",
1432
+ { required: false, minimum: 1, maximum: 5 }
1433
+ )
1434
+ }),
1435
+ { minItems: 3, maxItems: 3 }
1436
+ ),
1437
+ previousPeriodDeltaStars: numberField(
1438
+ "Seven-day mean-star delta from the preceding seven-day period.",
1439
+ { required: false, minimum: -4, maximum: 4 }
1440
+ ),
1441
+ advisories: canonicalAdvisoriesField
1442
+ }
1443
+ );
1444
+ var canonicalProcessorCheckpointVariantField = (processor) => feedbackClosedObjectField("Canonical replay-safe processor checkpoint.", {
1445
+ ...canonicalSchemaIdentityFields("feedback-processor-checkpoint"),
1446
+ checkpointId: canonicalSafeIdField(
1447
+ "Canonical checkpoint identifier.",
1448
+ 160
1449
+ ),
1450
+ processor: canonicalLiteralStringField(
1451
+ "Canonical feedback processor.",
1452
+ processor
1453
+ ),
1454
+ windowKey: canonicalSafeIdField("Canonical processor window key.", 160),
1455
+ revision: integerField("Positive canonical processor revision.", {
1456
+ minimum: 1,
1457
+ maximum: 1e6
1458
+ }),
1459
+ completedAt: canonicalDateTimeField("Canonical completion time."),
1460
+ ...processor === "commit-reconciliation" ? {} : {
1461
+ reportId: canonicalUuidV4Field(
1462
+ "Opaque UUIDv4 of the materialised report."
1463
+ )
1464
+ }
1465
+ });
1466
+ var canonicalProcessorCheckpointField = discriminatedUnionField(
1467
+ "Canonical `FeedbackProcessorCheckpoint`.",
1468
+ "processor",
1469
+ MCP_ADMIN_FEEDBACK_PROCESSORS.map(canonicalProcessorCheckpointVariantField)
1470
+ );
1471
+ var feedbackCanonicalReportListMetadataField = (allowedWindows, maximumReports) => feedbackClosedObjectField("Bounded report-list response metadata.", {
1472
+ window: stringField("Closed server-owned lookback selector.", {
1473
+ enum: [...allowedWindows]
1474
+ }),
1475
+ windowStart: canonicalDateTimeField("Inclusive returned range boundary."),
1476
+ windowEnd: canonicalDateTimeField("Exclusive returned range boundary."),
1477
+ generatedAt: canonicalDateTimeField("Response projection time."),
1478
+ returnedCount: canonicalCountField("Reports returned.", {
1479
+ maximum: maximumReports
1480
+ })
1481
+ });
1482
+ var canonicalAlertProjectionField = feedbackClosedObjectField(
1483
+ "Bounded projection of an advisory from one canonical report.",
1484
+ {
1485
+ reportId: canonicalUuidV4Field("Canonical source report UUIDv4."),
1486
+ reportType: stringField("Canonical source report identity.", {
1487
+ enum: [...MCP_ADMIN_FEEDBACK_REPORT_TYPES]
1488
+ }),
1489
+ windowStart: canonicalDateTimeField("Canonical report window start."),
1490
+ windowEnd: canonicalDateTimeField("Canonical report window end."),
1491
+ advisory: canonicalAdvisoryField
1492
+ }
1493
+ );
1494
+ var canonicalFreshnessProjectionField = feedbackClosedObjectField(
1495
+ "Freshness derived from one canonical processor checkpoint.",
1496
+ {
1497
+ checkpoint: canonicalProcessorCheckpointField,
1498
+ freshness: stringField("Closed derived freshness state.", {
1499
+ enum: ["fresh", "stale"]
1500
+ }),
1501
+ lagSeconds: canonicalCountField(
1502
+ "Whole seconds from checkpoint completion to `checkedAt`."
1503
+ )
1504
+ }
1505
+ );
1506
+ var feedbackStructuredEntryCommonFilterFields = () => ({
1507
+ window: stringField("Closed server-owned entry lookback.", {
1508
+ required: true,
1509
+ enum: [...MCP_ADMIN_FEEDBACK_ENTRY_WINDOWS]
1510
+ }),
1511
+ limit: integerField("Maximum structured entries returned.", {
1512
+ required: false,
1513
+ minimum: 1,
1514
+ maximum: MCP_ADMIN_FEEDBACK_MAX_PAGE_SIZE
1515
+ }),
1516
+ cursor: stringField("Opaque server-issued continuation cursor.", {
1517
+ required: false,
1518
+ minLength: 1,
1519
+ maxLength: MCP_ADMIN_FEEDBACK_MAX_CURSOR_LENGTH,
1520
+ pattern: "^[A-Za-z0-9_-]+$"
1521
+ })
1522
+ });
1523
+ var feedbackStructuredEntryFiltersField = discriminatedUnionField(
1524
+ "Exact bounded structured-entry filters. The selected `packetType` variant is closed so bug-only and review-only filters cannot be combined.",
1525
+ "packetType",
1526
+ [
1527
+ feedbackClosedObjectField(
1528
+ "Filters for canonical bug packets only.",
1529
+ {
1530
+ packetType: canonicalLiteralStringField(
1531
+ "Canonical bug-packet identity.",
1532
+ MCP_ADMIN_FEEDBACK_PACKET_TYPES[0]
1533
+ ),
1534
+ ...feedbackStructuredEntryCommonFilterFields(),
1535
+ surfaceId: stringField(
1536
+ "Optional exact allowlisted bug-surface identifier.",
1537
+ {
1538
+ required: false,
1539
+ enum: [...FEEDBACK_SCHEMA_SURFACE_IDS]
1540
+ }
1541
+ ),
1542
+ buildId: stringField(
1543
+ "Optional exact server-owned bug build identifier.",
1544
+ {
1545
+ required: false,
1546
+ maxLength: 128,
1547
+ pattern: "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
1548
+ }
1549
+ ),
1550
+ severity: integerField("Optional exact bug severity.", {
1551
+ required: false,
1552
+ minimum: 1,
1553
+ maximum: 5
1554
+ })
1555
+ },
1556
+ { additionalProperties: false }
1557
+ ),
1558
+ feedbackClosedObjectField(
1559
+ "Filters for canonical review packets only.",
1560
+ {
1561
+ packetType: canonicalLiteralStringField(
1562
+ "Canonical review-packet identity.",
1563
+ MCP_ADMIN_FEEDBACK_PACKET_TYPES[1]
1564
+ ),
1565
+ ...feedbackStructuredEntryCommonFilterFields(),
1566
+ satisfaction: integerField("Optional exact satisfaction score.", {
1567
+ required: false,
1568
+ minimum: 1,
1569
+ maximum: 5
1570
+ })
1571
+ },
1572
+ { additionalProperties: false }
1573
+ )
1574
+ ],
1575
+ { required: true }
1576
+ );
1577
+ function deepFreeze(value) {
1578
+ if (value === null || typeof value !== "object" && typeof value !== "function") {
1579
+ return value;
1580
+ }
1581
+ for (const propertyValue of Object.values(value)) {
1582
+ deepFreeze(propertyValue);
1583
+ }
1584
+ return Object.freeze(value);
1585
+ }
1586
+ var feedbackDescriptorMetadata = {
1587
+ domain: "feedback",
1588
+ rolloutFlag: MCP_ADMIN_FEEDBACK_FLAG_ID,
1589
+ requiredCapability: MCP_ADMIN_FEEDBACK_READ_CAPABILITY,
1590
+ oauthScopes: [...MCP_ADMIN_FEEDBACK_REQUIRED_OAUTH_SCOPES],
1591
+ privacy: MCP_ADMIN_FEEDBACK_PRIVACY_METADATA,
1592
+ access: feedbackReadAccess,
1593
+ availability: "near-future"
1594
+ };
1595
+ var MCP_ADMIN_FEEDBACK_ACTIONS = deepFreeze([
1596
+ {
1597
+ name: "getFeedbackBugHealth",
1598
+ ...translatedDescription(
1599
+ mcpAdminContractDescriptionKeys.actionGetFeedbackBugHealth
1600
+ ),
1601
+ ...feedbackDescriptorMetadata,
1602
+ schemaSource: feedbackSchemaSource("FeedbackHourlyBugReportSchema"),
1603
+ execution: {
1604
+ method: "GET",
1605
+ path: "/api/admin/feedback/bug-health",
1606
+ source: "near-future-route",
1607
+ notes: [
1608
+ "Reads immutable hourly materialisations only; it does not scan packets or Blob Storage on request.",
1609
+ "Returns identifier-free structured distributions, fixed advisories, and deterministic recommendation identifiers only."
1610
+ ]
1611
+ },
1612
+ input: {
1613
+ window: stringField("Closed server-owned bug-health report window.", {
1614
+ required: true,
1615
+ enum: [...MCP_ADMIN_FEEDBACK_BUG_HEALTH_WINDOWS]
1616
+ })
1617
+ },
1618
+ output: {
1619
+ metadata: feedbackCanonicalReportListMetadataField(
1620
+ MCP_ADMIN_FEEDBACK_BUG_HEALTH_WINDOWS,
1621
+ 168
1622
+ ),
1623
+ reports: arrayOfField(
1624
+ "At most 168 canonical immutable hourly bug-health reports.",
1625
+ "FeedbackHourlyBugReport",
1626
+ canonicalHourlyBugReportField,
1627
+ { maxItems: 168 }
1628
+ )
1629
+ }
1630
+ },
1631
+ {
1632
+ name: "getFeedbackSatisfaction",
1633
+ ...translatedDescription(
1634
+ mcpAdminContractDescriptionKeys.actionGetFeedbackSatisfaction
1635
+ ),
1636
+ ...feedbackDescriptorMetadata,
1637
+ schemaSource: feedbackSchemaSource(
1638
+ "FeedbackDailySatisfactionReportSchema"
1639
+ ),
1640
+ execution: {
1641
+ method: "GET",
1642
+ path: "/api/admin/feedback/satisfaction",
1643
+ source: "near-future-route",
1644
+ notes: [
1645
+ "Reads immutable daily materialisations only; it does not calculate from raw review packets on request.",
1646
+ "Returns star statistics and closed derived classifications without narrative or reporter correlation."
1647
+ ]
1648
+ },
1649
+ input: {
1650
+ window: stringField("Closed server-owned satisfaction report window.", {
1651
+ required: true,
1652
+ enum: [...MCP_ADMIN_FEEDBACK_SATISFACTION_WINDOWS]
1653
+ })
1654
+ },
1655
+ output: {
1656
+ metadata: feedbackCanonicalReportListMetadataField(
1657
+ MCP_ADMIN_FEEDBACK_SATISFACTION_WINDOWS,
1658
+ 90
1659
+ ),
1660
+ reports: arrayOfField(
1661
+ "At most 90 canonical immutable daily satisfaction reports.",
1662
+ "FeedbackDailySatisfactionReport",
1663
+ canonicalDailySatisfactionReportField,
1664
+ { maxItems: 90 }
1665
+ )
1666
+ }
1667
+ },
1668
+ {
1669
+ name: "listFeedbackAlerts",
1670
+ ...translatedDescription(
1671
+ mcpAdminContractDescriptionKeys.actionListFeedbackAlerts
1672
+ ),
1673
+ ...feedbackDescriptorMetadata,
1674
+ schemaSource: feedbackSchemaSource(
1675
+ "FeedbackHourlyBugReportSchema",
1676
+ "FeedbackDailySatisfactionReportSchema"
1677
+ ),
1678
+ execution: {
1679
+ method: "GET",
1680
+ path: "/api/admin/feedback/alerts",
1681
+ source: "near-future-route",
1682
+ notes: [
1683
+ "Reads deterministic advisories only; no generated summaries, operator notes, or mutation controls are exposed.",
1684
+ "Pagination is server-cursor based and capped at 100 advisories per call."
1685
+ ]
1686
+ },
1687
+ input: {
1688
+ window: stringField("Closed server-owned advisory lookback.", {
1689
+ required: true,
1690
+ enum: [...MCP_ADMIN_FEEDBACK_ALERT_WINDOWS]
1691
+ }),
1692
+ reportType: stringField("Optional canonical source-report identity.", {
1693
+ required: false,
1694
+ enum: [...MCP_ADMIN_FEEDBACK_REPORT_TYPES]
1695
+ }),
1696
+ limit: integerField("Maximum advisories returned.", {
1697
+ required: false,
1698
+ minimum: 1,
1699
+ maximum: MCP_ADMIN_FEEDBACK_MAX_PAGE_SIZE
1700
+ }),
1701
+ cursor: stringField("Opaque server-issued continuation cursor.", {
1702
+ required: false,
1703
+ minLength: 1,
1704
+ maxLength: MCP_ADMIN_FEEDBACK_MAX_CURSOR_LENGTH,
1705
+ pattern: "^[A-Za-z0-9_-]+$"
1706
+ })
1707
+ },
1708
+ output: {
1709
+ metadata: feedbackPageMetadataField(MCP_ADMIN_FEEDBACK_ALERT_WINDOWS),
1710
+ items: arrayOfField(
1711
+ "Canonical deterministic advisories with bounded source-report metadata.",
1712
+ "FeedbackAdvisoryProjection",
1713
+ canonicalAlertProjectionField,
1714
+ { maxItems: MCP_ADMIN_FEEDBACK_MAX_PAGE_SIZE }
1715
+ )
1716
+ }
1717
+ },
1718
+ {
1719
+ name: "getFeedbackFreshness",
1720
+ ...translatedDescription(
1721
+ mcpAdminContractDescriptionKeys.actionGetFeedbackFreshness
1722
+ ),
1723
+ ...feedbackDescriptorMetadata,
1724
+ schemaSource: feedbackSchemaSource(
1725
+ "FeedbackProcessorCheckpointSchema"
1726
+ ),
1727
+ execution: {
1728
+ method: "GET",
1729
+ path: "/api/admin/feedback/freshness",
1730
+ source: "near-future-route",
1731
+ notes: [
1732
+ "Returns freshness derived from canonical processor checkpoints only; no logs, exception text, or storage references are exposed."
1733
+ ]
1734
+ },
1735
+ input: {
1736
+ processor: stringField("Optional canonical processor filter.", {
1737
+ required: false,
1738
+ enum: [...MCP_ADMIN_FEEDBACK_PROCESSORS]
1739
+ })
1740
+ },
1741
+ output: {
1742
+ checkedAt: canonicalDateTimeField(
1743
+ "UTC time at which processor freshness was read."
1744
+ ),
1745
+ processors: arrayOfField(
1746
+ "Freshness derived from canonical feedback processor checkpoints.",
1747
+ "FeedbackProcessorFreshness",
1748
+ canonicalFreshnessProjectionField,
1749
+ { maxItems: MCP_ADMIN_FEEDBACK_PROCESSORS.length }
1750
+ )
1751
+ }
1752
+ },
1753
+ {
1754
+ name: "listFeedbackStructuredEntries",
1755
+ ...translatedDescription(
1756
+ mcpAdminContractDescriptionKeys.actionListFeedbackStructuredEntries
1757
+ ),
1758
+ ...feedbackDescriptorMetadata,
1759
+ schemaSource: feedbackSchemaSource(
1760
+ "FeedbackBugPacketSchema",
1761
+ "FeedbackReviewPacketSchema"
1762
+ ),
1763
+ execution: {
1764
+ method: "GET",
1765
+ path: "/api/admin/feedback/entries",
1766
+ source: "near-future-route",
1767
+ notes: [
1768
+ "Returns schema-validated identifier-free structured entries only; narrative, reporter control state, pixels, URLs, and direct storage references are never available.",
1769
+ "The runtime must validate `filters` against exactly one closed `packetType` variant, reject cross-packet or unknown fields, and only then map that variant to route query parameters.",
1770
+ "Only closed window selectors, allowlisted packet-specific filters, opaque cursors, and a maximum page size of 100 are accepted; unrestricted scans are not represented."
1771
+ ]
1772
+ },
1773
+ input: {
1774
+ filters: feedbackStructuredEntryFiltersField
1775
+ },
1776
+ output: {
1777
+ metadata: feedbackPageMetadataField(MCP_ADMIN_FEEDBACK_ENTRY_WINDOWS),
1778
+ items: arrayOfField(
1779
+ "Reporter-identifier-free structured feedback entries.",
1780
+ "FeedbackPacket",
1781
+ canonicalFeedbackPacketField,
1782
+ { maxItems: MCP_ADMIN_FEEDBACK_MAX_PAGE_SIZE }
1783
+ )
1784
+ }
1785
+ }
1786
+ ]);
666
1787
  var MCP_ADMIN_ACTIONS = [
667
1788
  {
668
1789
  name: "listFeatureFlags",
@@ -2343,8 +3464,103 @@ var MCP_ADMIN_ACTIONS = [
2343
3464
  mcpAdminContractDescriptionKeys.verificationTokenAdjustment
2344
3465
  )
2345
3466
  }
2346
- }
3467
+ },
3468
+ ...MCP_ADMIN_FEEDBACK_ACTIONS
2347
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
+ });
2348
3564
  function listMcpActionSummaries() {
2349
3565
  return MCP_ADMIN_ACTIONS.map((action) => ({
2350
3566
  name: action.name,
@@ -2353,6 +3569,9 @@ function listMcpActionSummaries() {
2353
3569
  descriptionDefault: action.descriptionDefault,
2354
3570
  domain: action.domain,
2355
3571
  rolloutFlag: action.rolloutFlag,
3572
+ ...action.oauthScopes === void 0 ? {} : { oauthScopes: action.oauthScopes },
3573
+ ...action.privacy === void 0 ? {} : { privacy: action.privacy },
3574
+ ...action.schemaSource === void 0 ? {} : { schemaSource: action.schemaSource },
2356
3575
  availability: action.availability,
2357
3576
  execution: action.execution,
2358
3577
  requiredCapability: action.requiredCapability,
@@ -2360,7 +3579,7 @@ function listMcpActionSummaries() {
2360
3579
  access: action.access
2361
3580
  }));
2362
3581
  }
2363
- var MCP_ADMIN_CONTEXT_SHAPE = {
3582
+ var MCP_ADMIN_CONTEXT_SHAPE = deepFreeze({
2364
3583
  contractVersion: stringField("Versioned discovery contract identifier."),
2365
3584
  authenticatedUser: objectField("Authenticated admin session context.", {
2366
3585
  id: stringField("Authenticated user identifier."),
@@ -2386,6 +3605,44 @@ var MCP_ADMIN_CONTEXT_SHAPE = {
2386
3605
  )
2387
3606
  }),
2388
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
+ ),
2389
3646
  extensionRules: objectField("Rules for extending the registry without changing the discovery shape.", {
2390
3647
  sourceOfTruth: stringField("Package that owns the approved MCP registry."),
2391
3648
  addOnlyWithinV1: booleanField("Whether v1 additions must be additive."),
@@ -2393,7 +3650,7 @@ var MCP_ADMIN_CONTEXT_SHAPE = {
2393
3650
  singleResourceMutations: booleanField("Whether mutations must target one resource at a time."),
2394
3651
  notes: arrayField("Extension notes for future MCP tool families.", "string")
2395
3652
  })
2396
- };
3653
+ });
2397
3654
  var MCP_ADMIN_EXTENSION_RULES = {
2398
3655
  sourceOfTruth: MCP_ADMIN_REGISTRY_SOURCE,
2399
3656
  addOnlyWithinV1: true,
@@ -2449,7 +3706,10 @@ function buildMcpDiscoveryResponse() {
2449
3706
  return {
2450
3707
  contractVersion: MCP_ADMIN_CONTRACT_VERSION,
2451
3708
  sourceOfTruth: MCP_ADMIN_REGISTRY_SOURCE,
2452
- actions: listMcpActionSummaries()
3709
+ actions: listMcpActionSummaries(),
3710
+ modelTools: listMcpModelToolSummaries(),
3711
+ modelResources: listMcpModelResourceTemplates(),
3712
+ modelSourceOfTruth: ASSET_MCP_PACKAGE
2453
3713
  };
2454
3714
  }
2455
3715
  function buildMcpSchemaResponse() {
@@ -2459,6 +3719,9 @@ function buildMcpSchemaResponse() {
2459
3719
  {
2460
3720
  domain: action.domain,
2461
3721
  rolloutFlag: action.rolloutFlag,
3722
+ ...action.oauthScopes === void 0 ? {} : { oauthScopes: action.oauthScopes },
3723
+ ...action.privacy === void 0 ? {} : { privacy: action.privacy },
3724
+ ...action.schemaSource === void 0 ? {} : { schemaSource: action.schemaSource },
2462
3725
  availability: action.availability,
2463
3726
  execution: action.execution,
2464
3727
  input: action.input,
@@ -2475,7 +3738,10 @@ function buildMcpSchemaResponse() {
2475
3738
  sourceOfTruth: MCP_ADMIN_REGISTRY_SOURCE,
2476
3739
  actions,
2477
3740
  contextShape: MCP_ADMIN_CONTEXT_SHAPE,
2478
- extensionRules: MCP_ADMIN_EXTENSION_RULES
3741
+ extensionRules: MCP_ADMIN_EXTENSION_RULES,
3742
+ modelTools: buildMcpModelToolSchemaDescriptors(),
3743
+ modelResources: listMcpModelResourceTemplates(),
3744
+ modelSourceOfTruth: ASSET_MCP_PACKAGE
2479
3745
  };
2480
3746
  }
2481
3747
  function buildMcpContextResponse(options) {
@@ -2485,7 +3751,8 @@ function buildMcpContextResponse(options) {
2485
3751
  surface: buildMcpSurfaceUrls(options.origin),
2486
3752
  rollout: options.rollout,
2487
3753
  actionFamilies: buildMcpActionFamilies(),
2488
- extensionRules: MCP_ADMIN_EXTENSION_RULES
3754
+ extensionRules: MCP_ADMIN_EXTENSION_RULES,
3755
+ modelResolution: buildMcpModelResolutionContext()
2489
3756
  };
2490
3757
  }
2491
3758
  function buildMcpActionFamilies() {
@@ -2515,6 +3782,13 @@ function buildMcpActionFamilies() {
2515
3782
  rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
2516
3783
  actions: getActionsByDomain("economy")
2517
3784
  },
3785
+ {
3786
+ domain: "feedback",
3787
+ rolloutFlag: MCP_ADMIN_FEEDBACK_FLAG_ID,
3788
+ requiredCapability: MCP_ADMIN_FEEDBACK_READ_CAPABILITY,
3789
+ oauthScopes: [...MCP_ADMIN_FEEDBACK_REQUIRED_OAUTH_SCOPES],
3790
+ actions: getActionsByDomain("feedback")
3791
+ },
2518
3792
  {
2519
3793
  domain: "assetCatalog",
2520
3794
  rolloutFlag: MCP_ASSET_PIPELINE_FLAG_ID,
@@ -2583,16 +3857,41 @@ export {
2583
3857
  MCP_ADMIN_ANALYTICS_FLAG_ID,
2584
3858
  MCP_ADMIN_ANALYTICS_METRICS,
2585
3859
  MCP_ADMIN_ANALYTICS_PRESETS,
3860
+ MCP_ADMIN_BASE_OAUTH_SCOPE,
2586
3861
  MCP_ADMIN_CONTEXT_SHAPE,
2587
3862
  MCP_ADMIN_CONTRACT_VERSION,
2588
3863
  MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2589
3864
  MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
2590
3865
  MCP_ADMIN_ECONOMY_READ_CAPABILITY,
2591
3866
  MCP_ADMIN_EXTENSION_RULES,
3867
+ MCP_ADMIN_FEEDBACK_ACTIONS,
3868
+ MCP_ADMIN_FEEDBACK_ALERT_WINDOWS,
3869
+ MCP_ADMIN_FEEDBACK_BUG_HEALTH_WINDOWS,
3870
+ MCP_ADMIN_FEEDBACK_ENTRY_WINDOWS,
3871
+ MCP_ADMIN_FEEDBACK_FLAG_ID,
3872
+ MCP_ADMIN_FEEDBACK_MAX_CURSOR_LENGTH,
3873
+ MCP_ADMIN_FEEDBACK_MAX_PAGE_SIZE,
3874
+ MCP_ADMIN_FEEDBACK_PACKET_TYPES,
3875
+ MCP_ADMIN_FEEDBACK_PRIVACY_EXCLUSIONS,
3876
+ MCP_ADMIN_FEEDBACK_PRIVACY_METADATA,
3877
+ MCP_ADMIN_FEEDBACK_PROCESSORS,
3878
+ MCP_ADMIN_FEEDBACK_READ_CAPABILITY,
3879
+ MCP_ADMIN_FEEDBACK_READ_OAUTH_SCOPE,
3880
+ MCP_ADMIN_FEEDBACK_REPORT_TYPES,
3881
+ MCP_ADMIN_FEEDBACK_REQUIRED_OAUTH_SCOPES,
3882
+ MCP_ADMIN_FEEDBACK_SATISFACTION_WINDOWS,
3883
+ MCP_ADMIN_FEEDBACK_SCHEMA_CONTRACT_VERSION,
3884
+ MCP_ADMIN_FEEDBACK_SCHEMA_PACKAGE,
3885
+ MCP_ADMIN_FEEDBACK_WINDOWS,
2592
3886
  MCP_ADMIN_FOUNDATION_DISABLED_CODE,
2593
3887
  MCP_ADMIN_FOUNDATION_ENV_VAR,
2594
3888
  MCP_ADMIN_FOUNDATION_FLAG_ID,
2595
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,
2596
3895
  MCP_ADMIN_PRODUCTION_READINESS_ENV_VAR,
2597
3896
  MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID,
2598
3897
  MCP_ADMIN_REGISTRY_SOURCE,
@@ -2606,6 +3905,7 @@ export {
2606
3905
  MCP_ADMIN_USER_AGGREGATION_DIMENSIONS,
2607
3906
  MCP_ADMIN_USER_AGGREGATION_METRICS,
2608
3907
  MCP_ADMIN_USER_AGGREGATION_PRESETS,
3908
+ MCP_ASSET_CATALOG_CONFIRM_CAPABILITY,
2609
3909
  MCP_ASSET_CATALOG_REQUEST_CAPABILITY,
2610
3910
  MCP_ASSET_CATALOG_REVIEW_CAPABILITY,
2611
3911
  MCP_ASSET_EXTERNAL_HARVEST_FLAG_ID,
@@ -2626,6 +3926,8 @@ export {
2626
3926
  buildMcpSurfaceUrls,
2627
3927
  getMcpAdminContractDefaultTranslation,
2628
3928
  listMcpActionSummaries,
3929
+ listMcpModelResourceTemplates,
3930
+ listMcpModelToolSummaries,
2629
3931
  mcpAdminContractDescriptionKeys,
2630
3932
  mcpAdminContractsEnGbTranslations,
2631
3933
  mcpAdminContractsTranslations