@plasius/mcp-admin-contracts 0.2.9 → 0.5.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
@@ -1,7 +1,30 @@
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
+
1
24
  // src/translations/en-GB.ts
2
25
  var mcpAdminContractsEnGbTranslations = {
3
- "mcpAdminContracts.manifest.descriptionForModel": "OAuth-protected MCP discovery manifest for the Plasius admin control plane covering feature flags, capabilities, analytics, and audit-backed operations.",
4
- "mcpAdminContracts.manifest.description": "Authenticated admin MCP discovery for the Plasius feature flag, capability, analytics, and audit control plane.",
26
+ "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.",
27
+ "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
28
  "mcpAdminContracts.action.listFeatureFlags.description": "List existing feature flags from the admin rollout control plane.",
6
29
  "mcpAdminContracts.action.getFeatureFlag.description": "Fetch one feature flag by stable key.",
7
30
  "mcpAdminContracts.action.updateFeatureFlag.description": "Patch an existing feature flag without bypassing the current admin update semantics.",
@@ -21,6 +44,15 @@ var mcpAdminContractsEnGbTranslations = {
21
44
  "mcpAdminContracts.action.listAggregationDimensions.description": "List the approved user-aggregation dimensions from the MCP whitelist.",
22
45
  "mcpAdminContracts.action.aggregateUsers.description": "Run grouped user aggregation over the bounded admin user data surface.",
23
46
  "mcpAdminContracts.action.aggregateUsersByPreset.description": "Run a curated user-aggregation preset against the bounded aggregation route.",
47
+ "mcpAdminContracts.action.listAdminTokenActivity.description": "List bounded pseudonymous Token activity after re-checking MCP scope, finance capabilities, and stored rollout flags.",
48
+ "mcpAdminContracts.action.getAdminTokenEconomyOverview.description": "Read the identifier-free global Token balance, lifetime totals, wallet counts, and authoritative projection freshness.",
49
+ "mcpAdminContracts.action.listAdminTokenWalletBalances.description": "List bounded pseudonymous Token wallet balances without exposing account, payment, provider, or raw wallet identifiers.",
50
+ "mcpAdminContracts.action.getAdminTokenTrends.description": "Read privacy-suppressed Token acquisition and usage trends with explainable advisory anomaly indicators.",
51
+ "mcpAdminContracts.action.getFeedbackBugHealth.description": "Read a bounded immutable hourly bug-health materialisation.",
52
+ "mcpAdminContracts.action.getFeedbackSatisfaction.description": "Read a bounded immutable daily satisfaction materialisation.",
53
+ "mcpAdminContracts.action.listFeedbackAlerts.description": "List bounded deterministic feedback advisories using an opaque cursor.",
54
+ "mcpAdminContracts.action.getFeedbackFreshness.description": "Read safe freshness metadata for the hourly bug and daily satisfaction processors.",
55
+ "mcpAdminContracts.action.listFeedbackStructuredEntries.description": "List bounded reporter-identifier-free structured feedback entries without narrative or storage references.",
24
56
  "mcpAdminContracts.action.searchAssetCatalog.description": "Search promoted asset catalog records without live third-party lookup.",
25
57
  "mcpAdminContracts.action.getAssetManifest.description": "Fetch a promoted player-safe runtime asset manifest reference.",
26
58
  "mcpAdminContracts.action.requestAsset.description": "Queue a governed missing-asset request when no promoted catalog match exists.",
@@ -34,13 +66,21 @@ var mcpAdminContractsEnGbTranslations = {
34
66
  "mcpAdminContracts.action.promoteAsset.description": "Promote an approved asset candidate to an immutable runtime manifest reference.",
35
67
  "mcpAdminContracts.action.rollbackAsset.description": "Rollback an asset runtime channel to a previous promoted manifest version.",
36
68
  "mcpAdminContracts.action.getAssetJobStatus.description": "Read governed asset job status, planned processing work, and evidence references.",
69
+ "mcpAdminContracts.action.getUserTokenWallet.description": "Read an account's server-resolved Token wallet summary without exposing provider or payment data.",
70
+ "mcpAdminContracts.action.listUserTokenActivity.description": "Read a bounded, cursor-paginated Token activity history for one account.",
71
+ "mcpAdminContracts.action.listTokenAdjustments.description": "List audited Token adjustment proposals and their approval state.",
72
+ "mcpAdminContracts.action.proposeTokenCredit.description": "Propose a positive Token credit for a server-resolved personal wallet; a distinct owner must approve it.",
73
+ "mcpAdminContracts.action.approveTokenCredit.description": "Approve a preview-bound Token credit proposed by a different owner.",
74
+ "mcpAdminContracts.action.rejectTokenCredit.description": "Reject a pending Token credit without mutating the wallet.",
75
+ "mcpAdminContracts.action.reverseTokenCredit.description": "Propose an immutable compensating reversal of an earlier owner Token credit.",
37
76
  "mcpAdminContracts.verification.enableFeatureFlag.description": "Use admin audit history to verify the rollout change.",
38
77
  "mcpAdminContracts.verification.disableFeatureFlag.description": "Use admin audit history to verify the rollout change.",
39
78
  "mcpAdminContracts.verification.assignCapability.description": "Use admin audit history to verify the stored rule written by the capability assignment.",
40
79
  "mcpAdminContracts.verification.unassignCapability.description": "Use admin audit history to verify capability-rule deletion.",
41
80
  "mcpAdminContracts.verification.updateCapability.description": "Use admin audit history to verify the stored rule updated by the capability mutation.",
42
81
  "mcpAdminContracts.verification.promoteAsset.description": "Use asset promotion history and admin audit events to verify the immutable runtime manifest promotion.",
43
- "mcpAdminContracts.verification.rollbackAsset.description": "Use asset promotion history and admin audit events to verify the runtime channel rollback."
82
+ "mcpAdminContracts.verification.rollbackAsset.description": "Use asset promotion history and admin audit events to verify the runtime channel rollback.",
83
+ "mcpAdminContracts.verification.tokenAdjustment.description": "Read the adjustment and Token activity history to verify its immutable proposal, decision, and ledger result."
44
84
  };
45
85
 
46
86
  // src/i18n.ts
@@ -66,6 +106,15 @@ var mcpAdminContractDescriptionKeys = {
66
106
  actionListAggregationDimensions: "mcpAdminContracts.action.listAggregationDimensions.description",
67
107
  actionAggregateUsers: "mcpAdminContracts.action.aggregateUsers.description",
68
108
  actionAggregateUsersByPreset: "mcpAdminContracts.action.aggregateUsersByPreset.description",
109
+ actionListAdminTokenActivity: "mcpAdminContracts.action.listAdminTokenActivity.description",
110
+ actionGetAdminTokenEconomyOverview: "mcpAdminContracts.action.getAdminTokenEconomyOverview.description",
111
+ actionListAdminTokenWalletBalances: "mcpAdminContracts.action.listAdminTokenWalletBalances.description",
112
+ actionGetAdminTokenTrends: "mcpAdminContracts.action.getAdminTokenTrends.description",
113
+ actionGetFeedbackBugHealth: "mcpAdminContracts.action.getFeedbackBugHealth.description",
114
+ actionGetFeedbackSatisfaction: "mcpAdminContracts.action.getFeedbackSatisfaction.description",
115
+ actionListFeedbackAlerts: "mcpAdminContracts.action.listFeedbackAlerts.description",
116
+ actionGetFeedbackFreshness: "mcpAdminContracts.action.getFeedbackFreshness.description",
117
+ actionListFeedbackStructuredEntries: "mcpAdminContracts.action.listFeedbackStructuredEntries.description",
69
118
  actionSearchAssetCatalog: "mcpAdminContracts.action.searchAssetCatalog.description",
70
119
  actionGetAssetManifest: "mcpAdminContracts.action.getAssetManifest.description",
71
120
  actionRequestAsset: "mcpAdminContracts.action.requestAsset.description",
@@ -79,13 +128,21 @@ var mcpAdminContractDescriptionKeys = {
79
128
  actionPromoteAsset: "mcpAdminContracts.action.promoteAsset.description",
80
129
  actionRollbackAsset: "mcpAdminContracts.action.rollbackAsset.description",
81
130
  actionGetAssetJobStatus: "mcpAdminContracts.action.getAssetJobStatus.description",
131
+ actionGetUserTokenWallet: "mcpAdminContracts.action.getUserTokenWallet.description",
132
+ actionListUserTokenActivity: "mcpAdminContracts.action.listUserTokenActivity.description",
133
+ actionListTokenAdjustments: "mcpAdminContracts.action.listTokenAdjustments.description",
134
+ actionProposeTokenCredit: "mcpAdminContracts.action.proposeTokenCredit.description",
135
+ actionApproveTokenCredit: "mcpAdminContracts.action.approveTokenCredit.description",
136
+ actionRejectTokenCredit: "mcpAdminContracts.action.rejectTokenCredit.description",
137
+ actionReverseTokenCredit: "mcpAdminContracts.action.reverseTokenCredit.description",
82
138
  verificationEnableFeatureFlag: "mcpAdminContracts.verification.enableFeatureFlag.description",
83
139
  verificationDisableFeatureFlag: "mcpAdminContracts.verification.disableFeatureFlag.description",
84
140
  verificationAssignCapability: "mcpAdminContracts.verification.assignCapability.description",
85
141
  verificationUnassignCapability: "mcpAdminContracts.verification.unassignCapability.description",
86
142
  verificationUpdateCapability: "mcpAdminContracts.verification.updateCapability.description",
87
143
  verificationPromoteAsset: "mcpAdminContracts.verification.promoteAsset.description",
88
- verificationRollbackAsset: "mcpAdminContracts.verification.rollbackAsset.description"
144
+ verificationRollbackAsset: "mcpAdminContracts.verification.rollbackAsset.description",
145
+ verificationTokenAdjustment: "mcpAdminContracts.verification.tokenAdjustment.description"
89
146
  };
90
147
  var mcpAdminContractsTranslations = {
91
148
  "en-GB": mcpAdminContractsEnGbTranslations
@@ -95,13 +152,18 @@ function getMcpAdminContractDefaultTranslation(key) {
95
152
  }
96
153
 
97
154
  // src/index.ts
98
- var MCP_ADMIN_CONTRACT_VERSION = "2026-04-28.v3";
155
+ var MCP_ADMIN_CONTRACT_VERSION = "2026-08-11.v6";
99
156
  var MCP_ADMIN_REGISTRY_SOURCE = "@plasius/mcp-admin-contracts";
100
157
  var MCP_ADMIN_FOUNDATION_FLAG_ID = "mcp.admin.foundation.enabled";
158
+ var MCP_ACCESS_SCOPE = "mcp:access";
101
159
  var MCP_ADMIN_FOUNDATION_ENV_VAR = "MCP_ADMIN_FOUNDATION_ENABLED";
102
160
  var MCP_ADMIN_FOUNDATION_DISABLED_CODE = "MCP_ADMIN_FOUNDATION_DISABLED";
103
161
  var MCP_ADMIN_LIVEOPS_FLAG_ID = "mcp.admin.liveops-controls.enabled";
104
162
  var MCP_ADMIN_ANALYTICS_FLAG_ID = "mcp.admin.analytics.enabled";
163
+ var ECONOMY_ADMIN_HISTORY_FLAG_ID = "economy.admin-history.enabled";
164
+ var MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID = "mcp.admin-economy-history.enabled";
165
+ var MCP_ADMIN_ECONOMY_READ_CAPABILITY = "admin.economy.read";
166
+ var ECONOMY_FINANCE_OPERATIONS_VIEW_CAPABILITY = "economy.finance-operations.view";
105
167
  var MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID = "mcp.admin.production-readiness.enabled";
106
168
  var MCP_ADMIN_PRODUCTION_READINESS_ENV_VAR = "MCP_ADMIN_PRODUCTION_READINESS_ENABLED";
107
169
  var MCP_ASSET_PIPELINE_FLAG_ID = "asset.pipeline.unified-ai-assets.enabled";
@@ -110,6 +172,90 @@ var MCP_ASSET_CATALOG_REQUEST_CAPABILITY = "asset.catalog.request";
110
172
  var MCP_ASSET_PIPELINE_MANAGE_CAPABILITY = "asset.pipeline.mcp.manage";
111
173
  var MCP_ASSET_SOURCE_MANAGE_CAPABILITY = "asset.source.manage";
112
174
  var MCP_ASSET_CATALOG_REVIEW_CAPABILITY = "asset.catalog.review";
175
+ var MCP_ADMIN_FEEDBACK_FLAG_ID = "feedback.mcp.enabled";
176
+ var MCP_ADMIN_FEEDBACK_READ_CAPABILITY = "admin.feedback.read";
177
+ var MCP_ADMIN_BASE_OAUTH_SCOPE = MCP_ACCESS_SCOPE;
178
+ var MCP_ADMIN_FEEDBACK_READ_OAUTH_SCOPE = MCP_ADMIN_FEEDBACK_READ_CAPABILITY;
179
+ var MCP_ADMIN_FEEDBACK_REQUIRED_OAUTH_SCOPES = Object.freeze([
180
+ MCP_ADMIN_BASE_OAUTH_SCOPE,
181
+ MCP_ADMIN_FEEDBACK_READ_OAUTH_SCOPE
182
+ ]);
183
+ var MCP_ADMIN_FEEDBACK_SCHEMA_PACKAGE = "@plasius/schema";
184
+ var MCP_ADMIN_FEEDBACK_SCHEMA_CONTRACT_VERSION = FEEDBACK_CONTRACT_VERSION;
185
+ var MCP_ADMIN_FEEDBACK_WINDOWS = [
186
+ "previous-utc-hour",
187
+ "last-24-hours",
188
+ "last-7-days",
189
+ "last-30-days",
190
+ "last-90-days"
191
+ ];
192
+ var MCP_ADMIN_FEEDBACK_PACKET_TYPES = [
193
+ "feedback-bug-packet",
194
+ "feedback-review-packet"
195
+ ];
196
+ var MCP_ADMIN_FEEDBACK_REPORT_TYPES = [
197
+ "feedback-hourly-bug-report",
198
+ "feedback-daily-satisfaction-report"
199
+ ];
200
+ var MCP_ADMIN_FEEDBACK_PROCESSORS = [
201
+ "bug-hourly",
202
+ "review-daily",
203
+ "commit-reconciliation"
204
+ ];
205
+ var MCP_ADMIN_FEEDBACK_PRIVACY_EXCLUSIONS = [
206
+ "account-identifiers",
207
+ "reporter-pseudonyms",
208
+ "network-identifiers",
209
+ "session-identifiers",
210
+ "user-agents",
211
+ "locales",
212
+ "client-timestamps",
213
+ "referrers",
214
+ "credential-material",
215
+ "financial-identifiers",
216
+ "government-identifiers",
217
+ "narrative",
218
+ "generated-summaries",
219
+ "quotations",
220
+ "embeddings",
221
+ "content-hashes",
222
+ "matched-values",
223
+ "model-traces",
224
+ "binary-images",
225
+ "filenames",
226
+ "exact-coordinates",
227
+ "exact-dimensions",
228
+ "adapter-fingerprints",
229
+ "raw-warnings",
230
+ "blob-references",
231
+ "raw-urls",
232
+ "unrestricted-scans",
233
+ "mutations"
234
+ ];
235
+ var MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID = "mcp.admin-economy-adjustments.enabled";
236
+ var ECONOMY_OWNER_ADJUSTMENTS_FLAG_ID = "economy.tokens.owner-adjustments.enabled";
237
+ var MCP_ECONOMY_FINANCE_VIEW_CAPABILITY = "economy.finance-operations.view";
238
+ var MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY = "economy.finance-operations.adjust";
239
+ var MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY = "economy.finance-operations.approve-adjustment";
240
+ var canonicalFeedbackSchemas = Object.freeze({
241
+ FeedbackBugPacketSchema,
242
+ FeedbackReviewPacketSchema,
243
+ FeedbackHourlyBugReportSchema,
244
+ FeedbackDailySatisfactionReportSchema,
245
+ FeedbackProcessorCheckpointSchema
246
+ });
247
+ var feedbackSchemaSource = (...schemaNames) => {
248
+ for (const schemaName of schemaNames) {
249
+ if (canonicalFeedbackSchemas[schemaName].meta.version !== MCP_ADMIN_FEEDBACK_SCHEMA_CONTRACT_VERSION) {
250
+ throw new TypeError("Canonical feedback schema version mismatch.");
251
+ }
252
+ }
253
+ return {
254
+ packageName: MCP_ADMIN_FEEDBACK_SCHEMA_PACKAGE,
255
+ contractVersion: MCP_ADMIN_FEEDBACK_SCHEMA_CONTRACT_VERSION,
256
+ schemaNames: [...schemaNames]
257
+ };
258
+ };
113
259
  var stringField = (description, options = {}) => ({
114
260
  type: "string",
115
261
  description,
@@ -125,18 +271,41 @@ var numberField = (description, options = {}) => ({
125
271
  description,
126
272
  ...options
127
273
  });
274
+ var integerField = (description, options = {}) => ({
275
+ type: "integer",
276
+ description,
277
+ ...options
278
+ });
128
279
  var objectField = (description, properties, options = {}) => ({
129
280
  type: "object",
130
281
  description,
131
282
  properties,
132
283
  ...options
133
284
  });
285
+ var feedbackClosedObjectField = (description, properties, options = {}) => objectField(description, properties, {
286
+ ...options,
287
+ additionalProperties: false
288
+ });
134
289
  var arrayField = (description, itemType, options = {}) => ({
135
290
  type: "array",
136
291
  description,
137
292
  itemType,
138
293
  ...options
139
294
  });
295
+ var arrayOfField = (description, itemType, items, options = {}) => ({
296
+ type: "array",
297
+ description,
298
+ itemType,
299
+ items,
300
+ ...options
301
+ });
302
+ var discriminatedUnionField = (description, discriminator, variants, options = {}) => ({
303
+ type: "discriminated-union",
304
+ description,
305
+ discriminator,
306
+ oneOf: variants,
307
+ ...options
308
+ });
140
309
  var translatedDescription = (descriptionKey) => {
141
310
  const descriptionDefault = getMcpAdminContractDefaultTranslation(descriptionKey);
142
311
  return {
@@ -177,6 +346,42 @@ var MCP_ADMIN_USER_AGGREGATION_PRESETS = [
177
346
  "usersByNotificationPreference",
178
347
  "usersByAccountAgeBand"
179
348
  ];
349
+ var MCP_ADMIN_TOKEN_ACTIVITY_TYPES = [
350
+ "acquisition",
351
+ "spend",
352
+ "reversal",
353
+ "hold",
354
+ "failure"
355
+ ];
356
+ var MCP_ADMIN_TOKEN_ACTIVITY_STATUSES = [
357
+ "pending",
358
+ "held",
359
+ "settled",
360
+ "reversed",
361
+ "failed"
362
+ ];
363
+ var MCP_ADMIN_TOKEN_WALLET_COMPONENTS = [
364
+ "household",
365
+ "personal",
366
+ "gameplay-allocation"
367
+ ];
368
+ var MCP_ADMIN_TOKEN_WALLET_STATUSES = ["active", "closed"];
369
+ var MCP_ADMIN_TOKEN_WALLET_SORTS = [
370
+ "available-desc",
371
+ "updated-at-desc"
372
+ ];
373
+ var MCP_ADMIN_TOKEN_ACTIVITY_SOURCES = [
374
+ "paid-purchase",
375
+ "subscription",
376
+ "rewarded-activity",
377
+ "gameplay",
378
+ "system-adjustment",
379
+ "unknown"
380
+ ];
381
+ var MCP_ADMIN_TOKEN_ACTIVITY_SORTS = [
382
+ "occurred-at-desc",
383
+ "amount-absolute-desc"
384
+ ];
180
385
  var MCP_ASSET_SOURCE_ADAPTERS = [
181
386
  "polyhaven",
182
387
  "kenney",
@@ -323,6 +528,1210 @@ var assetOperationAcceptedOutput = {
323
528
  job: assetJobStatusField("Governed asset job created or updated by the operation."),
324
529
  nextAction: stringField("Next expected lifecycle action.", { required: false })
325
530
  };
531
+ var tokenAdjustmentOutput = {
532
+ adjustment: objectField("Audited Token adjustment state.", {
533
+ adjustmentId: stringField("Stable adjustment identifier."),
534
+ targetAccountId: stringField("Target account identifier."),
535
+ targetWalletId: stringField("Server-resolved target wallet identifier."),
536
+ targetWalletKind: stringField("Server-resolved target wallet kind.", {
537
+ enum: ["personal"]
538
+ }),
539
+ amountTokenSubunits: stringField(
540
+ "Exact positive base-10 TokenSubunit amount; 1 Token is 1,000 subunits."
541
+ ),
542
+ status: stringField("Current immutable workflow status.", {
543
+ enum: ["pending", "approved", "rejected", "executed", "failed", "expired"]
544
+ }),
545
+ previewHash: stringField("Canonical preview hash bound to the proposal."),
546
+ proposalHash: stringField("Canonical proposal hash bound to decisions."),
547
+ proposerAccountId: stringField("Stable proposing owner account identifier."),
548
+ approverAccountId: stringField("Distinct approving owner account identifier.", {
549
+ required: false
550
+ }),
551
+ createdAt: stringField("ISO-8601 proposal timestamp."),
552
+ expiresAt: stringField("ISO-8601 proposal expiry timestamp."),
553
+ transactionId: stringField("Immutable ledger transaction identifier.", {
554
+ required: false
555
+ })
556
+ })
557
+ };
558
+ var adminEconomyReadAccess = {
559
+ oauthScopes: [MCP_ACCESS_SCOPE],
560
+ capabilities: [
561
+ MCP_ADMIN_ECONOMY_READ_CAPABILITY,
562
+ ECONOMY_FINANCE_OPERATIONS_VIEW_CAPABILITY
563
+ ],
564
+ rolloutFlags: [
565
+ ECONOMY_ADMIN_HISTORY_FLAG_ID,
566
+ MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID
567
+ ],
568
+ mode: "read-only",
569
+ identityResolution: "not-available"
570
+ };
571
+ var adminTokenReportingWindowInput = {
572
+ lookbackDays: numberField(
573
+ "Optional whole-day lookback ending now; defaults to 30, cannot exceed 365, and hourly trend calls are further limited to 31. Do not combine with explicit timestamps.",
574
+ {
575
+ required: false,
576
+ minimum: 1,
577
+ maximum: 365,
578
+ default: 30
579
+ }
580
+ ),
581
+ fromInclusive: stringField(
582
+ "Optional inclusive ISO-8601 UTC start; the normalized interactive window cannot exceed 365 days.",
583
+ { required: false, format: "date-time" }
584
+ ),
585
+ toExclusive: stringField(
586
+ "Optional exclusive ISO-8601 UTC end; defaults to the request time.",
587
+ { required: false, format: "date-time" }
588
+ )
589
+ };
590
+ var adminTokenActivityEntryField = objectField(
591
+ "One pseudonymous Token activity row with no raw financial or identity identifiers.",
592
+ {
593
+ schemaVersion: stringField("Economy reporting contract version.", {
594
+ enum: ["1"]
595
+ }),
596
+ occurredAt: stringField("ISO-8601 UTC activity timestamp.", {
597
+ format: "date-time"
598
+ }),
599
+ activityType: stringField("Normalized Token activity type.", {
600
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_TYPES
601
+ }),
602
+ status: stringField("Normalized activity status.", {
603
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_STATUSES
604
+ }),
605
+ source: stringField(
606
+ "Provider-neutral source grouping; provider names and identifiers are excluded.",
607
+ { enum: MCP_ADMIN_TOKEN_ACTIVITY_SOURCES }
608
+ ),
609
+ amount: stringField(
610
+ "Exact signed TokenSubunit amount as a canonical base-10 integer string.",
611
+ { format: "int64-string" }
612
+ ),
613
+ safeLabel: stringField(
614
+ "Bounded source-owned display label with no account, payment, or provider metadata."
615
+ ),
616
+ rowAlias: stringField(
617
+ "Versioned audience-separated opaque alias for this reporting row.",
618
+ { format: "pseudonymous-alias" }
619
+ ),
620
+ subjectAlias: stringField(
621
+ "Versioned audience-separated opaque alias for the activity subject.",
622
+ { format: "pseudonymous-alias" }
623
+ )
624
+ }
625
+ );
626
+ var adminTokenAggregateBalancesField = objectField(
627
+ "Identifier-free exact aggregate Token balance categories.",
628
+ {
629
+ schemaVersion: stringField("Economy reporting contract version.", {
630
+ enum: ["1"]
631
+ }),
632
+ available: stringField("Exact available TokenSubunits.", {
633
+ format: "int64-string"
634
+ }),
635
+ reserved: stringField("Exact reserved TokenSubunits.", {
636
+ format: "int64-string"
637
+ }),
638
+ held: stringField("Exact held TokenSubunits.", {
639
+ format: "int64-string"
640
+ }),
641
+ rewardProgress: stringField("Exact accumulated reward TokenSubunits.", {
642
+ format: "int64-string"
643
+ })
644
+ }
645
+ );
646
+ var adminTokenAggregateLifetimeField = objectField(
647
+ "Identifier-free exact aggregate lifetime Token metrics.",
648
+ {
649
+ schemaVersion: stringField("Economy reporting contract version.", {
650
+ enum: ["1"]
651
+ }),
652
+ bought: stringField("Exact lifetime bought TokenSubunits.", {
653
+ format: "int64-string"
654
+ }),
655
+ earned: stringField("Exact lifetime earned TokenSubunits.", {
656
+ format: "int64-string"
657
+ }),
658
+ allocated: stringField("Exact lifetime allocated TokenSubunits.", {
659
+ format: "int64-string"
660
+ }),
661
+ reclaimed: stringField("Exact lifetime reclaimed TokenSubunits.", {
662
+ format: "int64-string"
663
+ }),
664
+ spent: stringField("Exact lifetime spent TokenSubunits.", {
665
+ format: "int64-string"
666
+ }),
667
+ reversed: stringField("Exact lifetime reversed TokenSubunits.", {
668
+ format: "int64-string"
669
+ })
670
+ }
671
+ );
672
+ var adminTokenWalletBalanceEntryField = objectField(
673
+ "One pseudonymous Token wallet balance with no raw account or wallet identifier.",
674
+ {
675
+ schemaVersion: stringField("Economy reporting contract version.", {
676
+ enum: ["1"]
677
+ }),
678
+ walletAlias: stringField("MCP-audience opaque wallet alias.", {
679
+ format: "pseudonymous-alias"
680
+ }),
681
+ subjectAlias: stringField("MCP-audience opaque subject alias.", {
682
+ format: "pseudonymous-alias"
683
+ }),
684
+ component: stringField("Provider-neutral wallet component.", {
685
+ enum: MCP_ADMIN_TOKEN_WALLET_COMPONENTS
686
+ }),
687
+ status: stringField("Wallet projection status.", {
688
+ enum: MCP_ADMIN_TOKEN_WALLET_STATUSES
689
+ }),
690
+ available: stringField("Exact available TokenSubunits.", {
691
+ format: "int64-string"
692
+ }),
693
+ reserved: stringField("Exact reserved TokenSubunits.", {
694
+ format: "int64-string"
695
+ }),
696
+ held: stringField("Exact held TokenSubunits.", {
697
+ format: "int64-string"
698
+ }),
699
+ rewardProgress: stringField("Exact reward-progress TokenSubunits.", {
700
+ format: "int64-string"
701
+ }),
702
+ updatedAt: stringField("UTC time of the included wallet projection.", {
703
+ format: "date-time"
704
+ }),
705
+ authoritySequence: stringField(
706
+ "Canonical positive authority sequence through which this row is current.",
707
+ { format: "uint64-string" }
708
+ )
709
+ }
710
+ );
711
+ var adminTokenAnomalyField = objectField(
712
+ "Explainable advisory indicator; it never triggers a financial mutation.",
713
+ {
714
+ method: stringField("Server-owned baseline method.", {
715
+ enum: ["same-window-median-mad-v1"]
716
+ }),
717
+ status: stringField("Advisory irregularity classification.", {
718
+ enum: ["normal", "irregular-spike"]
719
+ }),
720
+ baselineWindowCount: numberField(
721
+ "Count of preceding same-window samples used by the baseline.",
722
+ { minimum: 28, maximum: 28, default: 28 }
723
+ ),
724
+ medianAmount: stringField("Exact median signed TokenSubunit amount.", {
725
+ format: "int64-string"
726
+ }),
727
+ medianAbsoluteDeviation: stringField(
728
+ "Exact median absolute deviation in TokenSubunits.",
729
+ { format: "int64-string" }
730
+ ),
731
+ minimumAbsoluteDelta: stringField(
732
+ "Server-owned exact absolute minimum required before a spike is reported.",
733
+ { format: "int64-string" }
734
+ ),
735
+ deviationFromMedian: stringField(
736
+ "Exact signed TokenSubunit deviation from the baseline median.",
737
+ { format: "int64-string" }
738
+ ),
739
+ madMultiplierMilli: numberField(
740
+ "Fixed-point MAD multiplier where 1,000 represents one MAD.",
741
+ { minimum: 1, maximum: 1e6 }
742
+ ),
743
+ explanationCode: stringField("Stable explanation code for operator review.")
744
+ },
745
+ { required: false }
746
+ );
747
+ var adminTokenTrendPointField = objectField(
748
+ "One hourly or daily activity-type trend point.",
749
+ {
750
+ schemaVersion: stringField("Economy reporting contract version.", {
751
+ enum: ["1"]
752
+ }),
753
+ bucketStart: stringField("Inclusive aligned bucket start.", {
754
+ format: "date-time"
755
+ }),
756
+ bucketEnd: stringField("Exclusive aligned bucket end.", {
757
+ format: "date-time"
758
+ }),
759
+ activityType: stringField("Normalized Token activity type.", {
760
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_TYPES
761
+ }),
762
+ aggregate: objectField(
763
+ "Reported aggregate or a suppression marker. Suppressed points omit counts, amounts, and anomaly details.",
764
+ {
765
+ visibility: stringField("Privacy visibility state.", {
766
+ enum: ["reported", "suppressed"]
767
+ }),
768
+ reason: stringField(
769
+ "Present only when the cohort is suppressed.",
770
+ {
771
+ required: false,
772
+ enum: ["cohort-below-minimum"]
773
+ }
774
+ ),
775
+ distinctSubjects: numberField(
776
+ "Distinct pseudonymous subjects; present only for cohorts of at least five.",
777
+ { required: false, minimum: 5 }
778
+ ),
779
+ activityCount: numberField(
780
+ "Activity row count; absent for suppressed cohorts.",
781
+ { required: false, minimum: 5 }
782
+ ),
783
+ signedAmount: stringField(
784
+ "Exact aggregate signed TokenSubunits; absent for suppressed cohorts.",
785
+ { required: false, format: "int64-string" }
786
+ ),
787
+ threshold: numberField(
788
+ "Fixed minimum cohort size; present on suppression markers.",
789
+ {
790
+ required: false,
791
+ minimum: 5,
792
+ maximum: 5,
793
+ default: 5
794
+ }
795
+ )
796
+ }
797
+ ),
798
+ anomaly: adminTokenAnomalyField
799
+ }
800
+ );
801
+ var MCP_ADMIN_FEEDBACK_MAX_PAGE_SIZE = 100;
802
+ var MCP_ADMIN_FEEDBACK_MAX_CURSOR_LENGTH = 512;
803
+ var MCP_ADMIN_FEEDBACK_BUG_HEALTH_WINDOWS = [
804
+ "previous-utc-hour",
805
+ "last-24-hours",
806
+ "last-7-days"
807
+ ];
808
+ var MCP_ADMIN_FEEDBACK_SATISFACTION_WINDOWS = [
809
+ "last-7-days",
810
+ "last-30-days",
811
+ "last-90-days"
812
+ ];
813
+ var MCP_ADMIN_FEEDBACK_ENTRY_WINDOWS = [
814
+ "last-24-hours",
815
+ "last-7-days",
816
+ "last-30-days",
817
+ "last-90-days"
818
+ ];
819
+ var MCP_ADMIN_FEEDBACK_ALERT_WINDOWS = [
820
+ "last-24-hours",
821
+ "last-7-days"
822
+ ];
823
+ var MCP_ADMIN_FEEDBACK_PRIVACY_METADATA = Object.freeze({
824
+ classification: "public-safe-structured-only",
825
+ readOnly: true,
826
+ bounded: true,
827
+ excludes: Object.freeze([...MCP_ADMIN_FEEDBACK_PRIVACY_EXCLUSIONS]),
828
+ notes: Object.freeze([
829
+ "Responses contain only schema-validated structured fields and materialised report metadata.",
830
+ "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.",
831
+ "Narrative-derived values are closed classifications only; no summaries, quotations, embeddings, hashes, matched values, or model traces are permitted."
832
+ ])
833
+ });
834
+ var feedbackReadAccess = {
835
+ oauthScopes: [...MCP_ADMIN_FEEDBACK_REQUIRED_OAUTH_SCOPES],
836
+ capabilities: [MCP_ADMIN_FEEDBACK_READ_CAPABILITY],
837
+ rolloutFlags: [MCP_ADMIN_FEEDBACK_FLAG_ID],
838
+ mode: "read-only",
839
+ identityResolution: "not-available"
840
+ };
841
+ var feedbackPageMetadataField = (allowedWindows) => feedbackClosedObjectField("Bounded read-response metadata.", {
842
+ window: stringField("Closed server-owned response window.", {
843
+ enum: [...allowedWindows]
844
+ }),
845
+ windowStart: stringField("Inclusive UTC response-window boundary.", {
846
+ format: "date-time"
847
+ }),
848
+ windowEnd: stringField("Exclusive UTC response-window boundary.", {
849
+ format: "date-time"
850
+ }),
851
+ generatedAt: stringField("UTC time at which this response projection was produced.", {
852
+ format: "date-time"
853
+ }),
854
+ returnedCount: integerField("Number of records in this bounded page.", {
855
+ minimum: 0,
856
+ maximum: MCP_ADMIN_FEEDBACK_MAX_PAGE_SIZE
857
+ }),
858
+ nextCursor: stringField("Opaque continuation cursor when more results exist.", {
859
+ required: false,
860
+ minLength: 1,
861
+ maxLength: MCP_ADMIN_FEEDBACK_MAX_CURSOR_LENGTH,
862
+ pattern: "^[A-Za-z0-9_-]+$"
863
+ })
864
+ });
865
+ var FEEDBACK_SCHEMA_MAX_COUNT = 1e9;
866
+ 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}$";
867
+ var FEEDBACK_SCHEMA_SAFE_ID_PATTERN = "^[A-Za-z0-9][A-Za-z0-9._:-]*$";
868
+ var FEEDBACK_SCHEMA_SURFACE_IDS = FEEDBACK_SURFACE_IDS;
869
+ var FEEDBACK_SCHEMA_PERSISTABLE_ISSUE_TYPES = FEEDBACK_PERSISTABLE_ISSUE_TYPES;
870
+ var FEEDBACK_SCHEMA_SENTIMENT_BUCKETS = FEEDBACK_SENTIMENT_BUCKETS;
871
+ var FEEDBACK_SCHEMA_INTENT_IDS = FEEDBACK_INTENT_IDS;
872
+ var FEEDBACK_SCHEMA_THEME_IDS = FEEDBACK_THEME_IDS;
873
+ var FEEDBACK_SCHEMA_RENDERER_BUCKETS = FEEDBACK_RENDERER_BUCKETS;
874
+ var FEEDBACK_SCHEMA_BACKEND_BUCKETS = FEEDBACK_BACKEND_BUCKETS;
875
+ var FEEDBACK_SCHEMA_VIEWPORT_BUCKETS = FEEDBACK_VIEWPORT_BUCKETS;
876
+ var FEEDBACK_SCHEMA_FRAME_RATE_BUCKETS = FEEDBACK_FRAME_RATE_BUCKETS;
877
+ var FEEDBACK_SCHEMA_FRAME_TIME_BUCKETS = FEEDBACK_FRAME_TIME_BUCKETS;
878
+ var FEEDBACK_SCHEMA_GAME_FEATURE_IDS = FEEDBACK_GAME_FEATURE_IDS;
879
+ var FEEDBACK_SCHEMA_GAME_COUNTER_CODES = FEEDBACK_GAME_COUNTER_CODES;
880
+ var FEEDBACK_SCHEMA_GAME_ERROR_CODES = FEEDBACK_GAME_ERROR_CODES;
881
+ var requireCanonicalStringEnum = (field) => {
882
+ const values = field?.enumValues;
883
+ if (values === void 0 || values.length === 0 || values.some((value) => typeof value !== "string")) {
884
+ throw new TypeError("Canonical feedback schema enum is unavailable.");
885
+ }
886
+ return Object.freeze([...values]);
887
+ };
888
+ var canonicalHourlyBugShape = FeedbackHourlyBugReportSchema._shape;
889
+ var canonicalAdvisoryShape = canonicalHourlyBugShape.advisories?.itemType?._shape;
890
+ var FEEDBACK_SCHEMA_ADVISORY_CODES = requireCanonicalStringEnum(
891
+ canonicalAdvisoryShape?.code
892
+ );
893
+ var FEEDBACK_SCHEMA_RECOMMENDATION_IDS = requireCanonicalStringEnum(
894
+ canonicalAdvisoryShape?.recommendationIds?.itemType
895
+ );
896
+ var FEEDBACK_SCHEMA_ABUSE_BLOCK_BANDS = requireCanonicalStringEnum(
897
+ canonicalHourlyBugShape.abuseBlockBands?.itemType?._shape?.id
898
+ );
899
+ var canonicalLiteralStringField = (description, value) => stringField(description, {
900
+ enum: [value],
901
+ constValue: value
902
+ });
903
+ var canonicalUuidV4Field = (description) => stringField(description, {
904
+ format: "uuid",
905
+ minLength: 36,
906
+ maxLength: 36,
907
+ pattern: FEEDBACK_SCHEMA_UUID_V4_PATTERN
908
+ });
909
+ var canonicalSafeIdField = (description, maximum = 128) => stringField(description, {
910
+ minLength: 1,
911
+ maxLength: maximum,
912
+ pattern: FEEDBACK_SCHEMA_SAFE_ID_PATTERN
913
+ });
914
+ var canonicalDateTimeField = (description) => stringField(description, {
915
+ format: "date-time"
916
+ });
917
+ var canonicalCountField = (description, options = {}) => integerField(description, {
918
+ minimum: 0,
919
+ maximum: FEEDBACK_SCHEMA_MAX_COUNT,
920
+ ...options
921
+ });
922
+ var canonicalSchemaIdentityFields = (type) => ({
923
+ type: canonicalLiteralStringField("Canonical @plasius/schema identity.", type),
924
+ version: canonicalLiteralStringField(
925
+ "Canonical feedback contract version.",
926
+ MCP_ADMIN_FEEDBACK_SCHEMA_CONTRACT_VERSION
927
+ )
928
+ });
929
+ var canonicalStringArrayField = (description, enumValues, maximum, options = {}) => arrayOfField(
930
+ description,
931
+ "string",
932
+ stringField("Closed canonical value.", { enum: [...enumValues] }),
933
+ { maxItems: maximum, ...options }
934
+ );
935
+ var canonicalAnalyzedProjectionField = feedbackClosedObjectField(
936
+ "Canonical analyzed `FeedbackDerivedAnalysis` projection.",
937
+ {
938
+ ...canonicalSchemaIdentityFields("feedback-derived-analysis"),
939
+ status: canonicalLiteralStringField(
940
+ "Canonical analysis status.",
941
+ "analyzed"
942
+ ),
943
+ sentiment: stringField("Closed canonical sentiment bucket.", {
944
+ enum: [...FEEDBACK_SCHEMA_SENTIMENT_BUCKETS]
945
+ }),
946
+ intentIds: canonicalStringArrayField(
947
+ "Unique closed canonical intent identifiers.",
948
+ FEEDBACK_SCHEMA_INTENT_IDS,
949
+ 8
950
+ ),
951
+ themeIds: canonicalStringArrayField(
952
+ "Unique closed canonical theme identifiers.",
953
+ FEEDBACK_SCHEMA_THEME_IDS,
954
+ 8
955
+ ),
956
+ confidence: stringField("Closed classifier confidence.", {
957
+ enum: ["low", "medium", "high"]
958
+ }),
959
+ policyVersion: stringField("Pinned canonical privacy policy version.", {
960
+ enum: ["feedback-privacy-en-v1"]
961
+ }),
962
+ modelVersion: stringField("Pinned canonical local model version.", {
963
+ enum: ["feedback-en-rules-v1"]
964
+ }),
965
+ deterministicRedactionCount: canonicalCountField(
966
+ "Browser deterministic-redaction count.",
967
+ { maximum: 4e3 }
968
+ ),
969
+ scannerRedactionCount: canonicalCountField(
970
+ "Private-scanner redaction count.",
971
+ { maximum: 4e3 }
972
+ )
973
+ }
974
+ );
975
+ var canonicalStructuredOnlyProjectionField = feedbackClosedObjectField(
976
+ "Canonical structured-only `FeedbackDerivedAnalysis` projection.",
977
+ {
978
+ ...canonicalSchemaIdentityFields("feedback-derived-analysis"),
979
+ status: canonicalLiteralStringField(
980
+ "Canonical analysis status.",
981
+ "structured-only"
982
+ ),
983
+ intentIds: canonicalStringArrayField(
984
+ "Structured-only projections contain no intent identifiers.",
985
+ FEEDBACK_SCHEMA_INTENT_IDS,
986
+ 0
987
+ ),
988
+ themeIds: canonicalStringArrayField(
989
+ "Structured-only projections contain no theme identifiers.",
990
+ FEEDBACK_SCHEMA_THEME_IDS,
991
+ 0
992
+ ),
993
+ policyVersion: stringField("Pinned canonical privacy policy version.", {
994
+ enum: ["feedback-privacy-en-v1"]
995
+ }),
996
+ modelVersion: stringField("Pinned canonical local model version.", {
997
+ enum: ["feedback-en-rules-v1"]
998
+ }),
999
+ deterministicRedactionCount: canonicalCountField(
1000
+ "Browser deterministic-redaction count.",
1001
+ { maximum: 4e3 }
1002
+ ),
1003
+ scannerRedactionCount: canonicalCountField(
1004
+ "Private-scanner redaction count.",
1005
+ { maximum: 4e3 }
1006
+ )
1007
+ }
1008
+ );
1009
+ var canonicalAnalysisProjectionField = discriminatedUnionField(
1010
+ "Canonical closed `FeedbackDerivedAnalysis` projection.",
1011
+ "status",
1012
+ [
1013
+ canonicalAnalyzedProjectionField,
1014
+ canonicalStructuredOnlyProjectionField
1015
+ ],
1016
+ { required: false }
1017
+ );
1018
+ var canonicalGameCounterField = feedbackClosedObjectField(
1019
+ "Canonical bounded renderer diagnostic counter.",
1020
+ {
1021
+ code: stringField("Closed canonical counter code.", {
1022
+ enum: [...FEEDBACK_SCHEMA_GAME_COUNTER_CODES]
1023
+ }),
1024
+ count: canonicalCountField("Positive bounded counter value.", {
1025
+ minimum: 1,
1026
+ maximum: 1e4
1027
+ })
1028
+ }
1029
+ );
1030
+ var canonicalGameDiagnosticsVariantField = (surfaceId, provenanceContractId) => feedbackClosedObjectField("Canonical bounded renderer-owned game diagnostics.", {
1031
+ ...canonicalSchemaIdentityFields("feedback-game-diagnostics"),
1032
+ surfaceId: canonicalLiteralStringField(
1033
+ "Canonical diagnostics-eligible surface.",
1034
+ surfaceId
1035
+ ),
1036
+ consentConfirmed: booleanField("Explicit diagnostics consent.", {
1037
+ constValue: true
1038
+ }),
1039
+ provenanceContractId: canonicalLiteralStringField(
1040
+ "Renderer-owned provenance contract.",
1041
+ provenanceContractId
1042
+ ),
1043
+ renderer: stringField("Coarse canonical renderer bucket.", {
1044
+ enum: [...FEEDBACK_SCHEMA_RENDERER_BUCKETS]
1045
+ }),
1046
+ backend: stringField("Coarse canonical execution-backend bucket.", {
1047
+ enum: [...FEEDBACK_SCHEMA_BACKEND_BUCKETS]
1048
+ }),
1049
+ viewportBucket: stringField("Coarse canonical viewport bucket.", {
1050
+ enum: [...FEEDBACK_SCHEMA_VIEWPORT_BUCKETS]
1051
+ }),
1052
+ frameRateBucket: stringField("Coarse canonical frame-rate bucket.", {
1053
+ enum: [...FEEDBACK_SCHEMA_FRAME_RATE_BUCKETS]
1054
+ }),
1055
+ frameTimeBucket: stringField("Coarse canonical frame-time bucket.", {
1056
+ enum: [...FEEDBACK_SCHEMA_FRAME_TIME_BUCKETS]
1057
+ }),
1058
+ featureIds: canonicalStringArrayField(
1059
+ "Unique closed renderer feature identifiers.",
1060
+ FEEDBACK_SCHEMA_GAME_FEATURE_IDS,
1061
+ FEEDBACK_SCHEMA_GAME_FEATURE_IDS.length
1062
+ ),
1063
+ counters: arrayOfField(
1064
+ "Unique bounded renderer counters.",
1065
+ "FeedbackGameDiagnosticCounter",
1066
+ canonicalGameCounterField,
1067
+ { maxItems: 32 }
1068
+ ),
1069
+ errorCodes: canonicalStringArrayField(
1070
+ "Unique closed renderer error codes.",
1071
+ FEEDBACK_SCHEMA_GAME_ERROR_CODES,
1072
+ FEEDBACK_SCHEMA_GAME_ERROR_CODES.length
1073
+ )
1074
+ });
1075
+ var canonicalGameDiagnosticsField = discriminatedUnionField(
1076
+ "Canonical `FeedbackGameDiagnostics`; its surface must equal the containing bug packet surface and it cannot express pixels, DOM, text, URLs, filenames, coordinates, or adapter fingerprints.",
1077
+ "surfaceId",
1078
+ [
1079
+ canonicalGameDiagnosticsVariantField(
1080
+ "site.generator",
1081
+ "generator.renderer-diagnostics.v1"
1082
+ ),
1083
+ canonicalGameDiagnosticsVariantField(
1084
+ "site.gpu-demo",
1085
+ "gpu-demo.renderer-diagnostics.v1"
1086
+ )
1087
+ ],
1088
+ { required: false }
1089
+ );
1090
+ var canonicalBugPacketField = feedbackClosedObjectField(
1091
+ "Canonical identifier-free immutable `FeedbackBugPacket`.",
1092
+ {
1093
+ ...canonicalSchemaIdentityFields("feedback-bug-packet"),
1094
+ packetId: canonicalUuidV4Field("Opaque canonical packet UUIDv4."),
1095
+ acceptedAt: canonicalDateTimeField("Server-owned packet acceptance time."),
1096
+ surfaceId: stringField("Canonical capability-projected surface identifier.", {
1097
+ enum: [...FEEDBACK_SCHEMA_SURFACE_IDS]
1098
+ }),
1099
+ issueType: stringField("Canonical persistable issue type.", {
1100
+ enum: [...FEEDBACK_SCHEMA_PERSISTABLE_ISSUE_TYPES]
1101
+ }),
1102
+ severity: integerField("Canonical bug severity.", {
1103
+ minimum: 1,
1104
+ maximum: 5
1105
+ }),
1106
+ releaseId: canonicalSafeIdField("Server-owned release identifier."),
1107
+ buildId: canonicalSafeIdField("Server-owned build identifier."),
1108
+ analysis: canonicalAnalysisProjectionField,
1109
+ gameDiagnostics: canonicalGameDiagnosticsField
1110
+ }
1111
+ );
1112
+ var canonicalReviewPacketField = feedbackClosedObjectField(
1113
+ "Canonical identifier-free immutable `FeedbackReviewPacket`.",
1114
+ {
1115
+ ...canonicalSchemaIdentityFields("feedback-review-packet"),
1116
+ packetId: canonicalUuidV4Field("Opaque canonical packet UUIDv4."),
1117
+ acceptedAt: canonicalDateTimeField("Server-owned packet acceptance time."),
1118
+ satisfaction: integerField("Canonical satisfaction rating.", {
1119
+ minimum: 1,
1120
+ maximum: 5
1121
+ }),
1122
+ analysis: canonicalAnalysisProjectionField
1123
+ }
1124
+ );
1125
+ var canonicalFeedbackPacketField = discriminatedUnionField(
1126
+ "Canonical bug/review packet discriminated by exact schema identity.",
1127
+ "type",
1128
+ [canonicalBugPacketField, canonicalReviewPacketField]
1129
+ );
1130
+ var canonicalDistributionField = (description, idField, maximum) => arrayOfField(
1131
+ `${description} Bucket identifiers are unique as required by the canonical schema.`,
1132
+ "FeedbackCountBucket",
1133
+ feedbackClosedObjectField("Canonical count bucket.", {
1134
+ id: idField,
1135
+ count: canonicalCountField("Canonical non-negative bucket count.")
1136
+ }),
1137
+ { maxItems: maximum }
1138
+ );
1139
+ var canonicalAdvisoryField = feedbackClosedObjectField(
1140
+ "Canonical deterministic feedback advisory.",
1141
+ {
1142
+ code: stringField("Closed canonical advisory code.", {
1143
+ enum: [...FEEDBACK_SCHEMA_ADVISORY_CODES]
1144
+ }),
1145
+ level: stringField("Canonical advisory level.", {
1146
+ enum: ["advisory", "critical"]
1147
+ }),
1148
+ triggerCount: canonicalCountField("Positive deterministic trigger count.", {
1149
+ minimum: 1
1150
+ }),
1151
+ recommendationIds: canonicalStringArrayField(
1152
+ "One to eight deterministic recommendation identifiers.",
1153
+ FEEDBACK_SCHEMA_RECOMMENDATION_IDS,
1154
+ 8,
1155
+ { minItems: 1 }
1156
+ )
1157
+ }
1158
+ );
1159
+ var canonicalAdvisoriesField = arrayOfField(
1160
+ "Canonical deterministic advisories.",
1161
+ "FeedbackAdvisory",
1162
+ canonicalAdvisoryField,
1163
+ { maxItems: 32 }
1164
+ );
1165
+ var canonicalHourlyBugReportField = feedbackClosedObjectField(
1166
+ "Canonical materialised `FeedbackHourlyBugReport`.",
1167
+ {
1168
+ ...canonicalSchemaIdentityFields("feedback-hourly-bug-report"),
1169
+ reportId: canonicalUuidV4Field("Opaque canonical report UUIDv4."),
1170
+ windowStart: canonicalDateTimeField("Inclusive aligned UTC hour boundary."),
1171
+ windowEnd: canonicalDateTimeField("Exclusive aligned UTC hour boundary."),
1172
+ revision: integerField("Positive canonical materialisation revision.", {
1173
+ minimum: 1,
1174
+ maximum: 1e6
1175
+ }),
1176
+ generatedAt: canonicalDateTimeField("Canonical materialisation time."),
1177
+ acceptedCount: canonicalCountField("Accepted bug-packet count."),
1178
+ rejectedCount: canonicalCountField("Rejected bug-submission count."),
1179
+ diagnosticsAttachedCount: canonicalCountField(
1180
+ "Accepted packets carrying canonical game diagnostics."
1181
+ ),
1182
+ deterministicRedactionCount: canonicalCountField(
1183
+ "Total browser deterministic redactions."
1184
+ ),
1185
+ scannerRedactionCount: canonicalCountField(
1186
+ "Total private-scanner redactions."
1187
+ ),
1188
+ processorLagSeconds: canonicalCountField(
1189
+ "Exact materialisation lag from `windowEnd`."
1190
+ ),
1191
+ rates: feedbackClosedObjectField("Canonical rejection and redaction rates.", {
1192
+ rejectionRate: numberField("Rejected share of submitted records.", {
1193
+ minimum: 0,
1194
+ maximum: 1
1195
+ }),
1196
+ deterministicRedactionsPerAccepted: numberField(
1197
+ "Deterministic redactions per accepted packet.",
1198
+ { minimum: 0, maximum: 4e3 }
1199
+ ),
1200
+ scannerRedactionsPerAccepted: numberField(
1201
+ "Scanner redactions per accepted packet.",
1202
+ { minimum: 0, maximum: 4e3 }
1203
+ )
1204
+ }),
1205
+ traffic: feedbackClosedObjectField("Safe precomputed traffic denominator.", {
1206
+ denominator: canonicalCountField("Safe traffic denominator."),
1207
+ acceptedPerTenThousand: numberField(
1208
+ "Accepted bugs per ten thousand traffic units when denominator is non-zero.",
1209
+ {
1210
+ required: false,
1211
+ minimum: 0,
1212
+ maximum: FEEDBACK_SCHEMA_MAX_COUNT
1213
+ }
1214
+ )
1215
+ }),
1216
+ targetDistribution: canonicalDistributionField(
1217
+ "Counts by canonical feedback surface.",
1218
+ stringField("Canonical surface identifier.", {
1219
+ enum: [...FEEDBACK_SCHEMA_SURFACE_IDS]
1220
+ }),
1221
+ 256
1222
+ ),
1223
+ issueTypeDistribution: canonicalDistributionField(
1224
+ "Counts by canonical persistable issue type.",
1225
+ stringField("Canonical persistable issue type.", {
1226
+ enum: [...FEEDBACK_SCHEMA_PERSISTABLE_ISSUE_TYPES]
1227
+ }),
1228
+ 9
1229
+ ),
1230
+ severityDistribution: canonicalDistributionField(
1231
+ "Counts by canonical severity identifier.",
1232
+ stringField("Canonical severity identifier.", {
1233
+ enum: ["1", "2", "3", "4", "5"]
1234
+ }),
1235
+ 5
1236
+ ),
1237
+ intentDistribution: canonicalDistributionField(
1238
+ "Counts by canonical derived intent.",
1239
+ stringField("Canonical intent identifier.", {
1240
+ enum: [...FEEDBACK_SCHEMA_INTENT_IDS]
1241
+ }),
1242
+ FEEDBACK_SCHEMA_INTENT_IDS.length
1243
+ ),
1244
+ buildDistribution: canonicalDistributionField(
1245
+ "Counts by server-owned build identifier.",
1246
+ canonicalSafeIdField("Server-owned build identifier."),
1247
+ 128
1248
+ ),
1249
+ rendererDistribution: canonicalDistributionField(
1250
+ "Counts by canonical renderer bucket.",
1251
+ stringField("Canonical renderer bucket.", {
1252
+ enum: [...FEEDBACK_SCHEMA_RENDERER_BUCKETS]
1253
+ }),
1254
+ FEEDBACK_SCHEMA_RENDERER_BUCKETS.length
1255
+ ),
1256
+ backendDistribution: canonicalDistributionField(
1257
+ "Counts by canonical execution-backend bucket.",
1258
+ stringField("Canonical backend bucket.", {
1259
+ enum: [...FEEDBACK_SCHEMA_BACKEND_BUCKETS]
1260
+ }),
1261
+ FEEDBACK_SCHEMA_BACKEND_BUCKETS.length
1262
+ ),
1263
+ viewportDistribution: canonicalDistributionField(
1264
+ "Counts by canonical viewport bucket.",
1265
+ stringField("Canonical viewport bucket.", {
1266
+ enum: [...FEEDBACK_SCHEMA_VIEWPORT_BUCKETS]
1267
+ }),
1268
+ FEEDBACK_SCHEMA_VIEWPORT_BUCKETS.length
1269
+ ),
1270
+ frameRateDistribution: canonicalDistributionField(
1271
+ "Counts by canonical frame-rate bucket.",
1272
+ stringField("Canonical frame-rate bucket.", {
1273
+ enum: [...FEEDBACK_SCHEMA_FRAME_RATE_BUCKETS]
1274
+ }),
1275
+ FEEDBACK_SCHEMA_FRAME_RATE_BUCKETS.length
1276
+ ),
1277
+ frameTimeDistribution: canonicalDistributionField(
1278
+ "Counts by canonical frame-time bucket.",
1279
+ stringField("Canonical frame-time bucket.", {
1280
+ enum: [...FEEDBACK_SCHEMA_FRAME_TIME_BUCKETS]
1281
+ }),
1282
+ FEEDBACK_SCHEMA_FRAME_TIME_BUCKETS.length
1283
+ ),
1284
+ diagnosticFeatureDistribution: canonicalDistributionField(
1285
+ "Counts by canonical renderer feature identifier.",
1286
+ stringField("Canonical renderer feature identifier.", {
1287
+ enum: [...FEEDBACK_SCHEMA_GAME_FEATURE_IDS]
1288
+ }),
1289
+ FEEDBACK_SCHEMA_GAME_FEATURE_IDS.length
1290
+ ),
1291
+ diagnosticCounterDistribution: canonicalDistributionField(
1292
+ "Summed canonical renderer counters.",
1293
+ stringField("Canonical renderer counter code.", {
1294
+ enum: [...FEEDBACK_SCHEMA_GAME_COUNTER_CODES]
1295
+ }),
1296
+ FEEDBACK_SCHEMA_GAME_COUNTER_CODES.length
1297
+ ),
1298
+ diagnosticErrorDistribution: canonicalDistributionField(
1299
+ "Counts by canonical renderer error code.",
1300
+ stringField("Canonical renderer error code.", {
1301
+ enum: [...FEEDBACK_SCHEMA_GAME_ERROR_CODES]
1302
+ }),
1303
+ FEEDBACK_SCHEMA_GAME_ERROR_CODES.length
1304
+ ),
1305
+ abuseBlockBands: canonicalDistributionField(
1306
+ "Counts by canonical abuse-block band.",
1307
+ stringField("Canonical abuse-block band.", {
1308
+ enum: [...FEEDBACK_SCHEMA_ABUSE_BLOCK_BANDS]
1309
+ }),
1310
+ 16
1311
+ ),
1312
+ comparison: feedbackClosedObjectField("Canonical prior-period comparison.", {
1313
+ previousHourRatio: numberField("Ratio to the previous UTC hour.", {
1314
+ minimum: 0,
1315
+ maximum: 1e3
1316
+ }),
1317
+ sevenDaySameHourRatio: numberField(
1318
+ "Ratio to the seven-day same-hour baseline.",
1319
+ { minimum: 0, maximum: 1e3 }
1320
+ )
1321
+ }),
1322
+ advisories: canonicalAdvisoriesField
1323
+ }
1324
+ );
1325
+ var canonicalDailySatisfactionReportField = feedbackClosedObjectField(
1326
+ "Canonical materialised `FeedbackDailySatisfactionReport`.",
1327
+ {
1328
+ ...canonicalSchemaIdentityFields("feedback-daily-satisfaction-report"),
1329
+ reportId: canonicalUuidV4Field("Opaque canonical report UUIDv4."),
1330
+ windowStart: canonicalDateTimeField("Inclusive aligned UTC day boundary."),
1331
+ windowEnd: canonicalDateTimeField("Exclusive aligned UTC day boundary."),
1332
+ revision: integerField("Positive canonical materialisation revision.", {
1333
+ minimum: 1,
1334
+ maximum: 1e6
1335
+ }),
1336
+ generatedAt: canonicalDateTimeField("Canonical materialisation time."),
1337
+ processorLagSeconds: canonicalCountField(
1338
+ "Exact materialisation lag from `windowEnd`."
1339
+ ),
1340
+ acceptedReviewCount: canonicalCountField("Accepted review-packet count."),
1341
+ meanStars: numberField(
1342
+ "Mean stars; absent exactly when `acceptedReviewCount` is zero.",
1343
+ { required: false, minimum: 1, maximum: 5 }
1344
+ ),
1345
+ medianStars: numberField(
1346
+ "Median stars; absent exactly when `acceptedReviewCount` is zero.",
1347
+ { required: false, minimum: 1, maximum: 5 }
1348
+ ),
1349
+ starDistribution: canonicalDistributionField(
1350
+ "Counts by canonical star identifier.",
1351
+ stringField("Canonical star identifier.", {
1352
+ enum: ["1", "2", "3", "4", "5"]
1353
+ }),
1354
+ 5
1355
+ ),
1356
+ sentimentDistribution: canonicalDistributionField(
1357
+ "Counts by canonical sentiment bucket.",
1358
+ stringField("Canonical sentiment bucket.", {
1359
+ enum: [...FEEDBACK_SCHEMA_SENTIMENT_BUCKETS]
1360
+ }),
1361
+ FEEDBACK_SCHEMA_SENTIMENT_BUCKETS.length
1362
+ ),
1363
+ intentDistribution: canonicalDistributionField(
1364
+ "Counts by canonical derived intent.",
1365
+ stringField("Canonical intent identifier.", {
1366
+ enum: [...FEEDBACK_SCHEMA_INTENT_IDS]
1367
+ }),
1368
+ FEEDBACK_SCHEMA_INTENT_IDS.length
1369
+ ),
1370
+ rollingWindows: arrayOfField(
1371
+ "Exactly one canonical 7-, 30-, and 90-day rolling window.",
1372
+ "FeedbackRollingSatisfaction",
1373
+ feedbackClosedObjectField("Canonical rolling satisfaction window.", {
1374
+ period: stringField("Canonical rolling period.", {
1375
+ enum: ["7-days", "30-days", "90-days"]
1376
+ }),
1377
+ reviewCount: canonicalCountField("Accepted reviews in the period."),
1378
+ meanStars: numberField(
1379
+ "Mean stars; absent exactly when `reviewCount` is zero.",
1380
+ { required: false, minimum: 1, maximum: 5 }
1381
+ )
1382
+ }),
1383
+ { minItems: 3, maxItems: 3 }
1384
+ ),
1385
+ previousPeriodDeltaStars: numberField(
1386
+ "Seven-day mean-star delta from the preceding seven-day period.",
1387
+ { required: false, minimum: -4, maximum: 4 }
1388
+ ),
1389
+ advisories: canonicalAdvisoriesField
1390
+ }
1391
+ );
1392
+ var canonicalProcessorCheckpointVariantField = (processor) => feedbackClosedObjectField("Canonical replay-safe processor checkpoint.", {
1393
+ ...canonicalSchemaIdentityFields("feedback-processor-checkpoint"),
1394
+ checkpointId: canonicalSafeIdField(
1395
+ "Canonical checkpoint identifier.",
1396
+ 160
1397
+ ),
1398
+ processor: canonicalLiteralStringField(
1399
+ "Canonical feedback processor.",
1400
+ processor
1401
+ ),
1402
+ windowKey: canonicalSafeIdField("Canonical processor window key.", 160),
1403
+ revision: integerField("Positive canonical processor revision.", {
1404
+ minimum: 1,
1405
+ maximum: 1e6
1406
+ }),
1407
+ completedAt: canonicalDateTimeField("Canonical completion time."),
1408
+ ...processor === "commit-reconciliation" ? {} : {
1409
+ reportId: canonicalUuidV4Field(
1410
+ "Opaque UUIDv4 of the materialised report."
1411
+ )
1412
+ }
1413
+ });
1414
+ var canonicalProcessorCheckpointField = discriminatedUnionField(
1415
+ "Canonical `FeedbackProcessorCheckpoint`.",
1416
+ "processor",
1417
+ MCP_ADMIN_FEEDBACK_PROCESSORS.map(canonicalProcessorCheckpointVariantField)
1418
+ );
1419
+ var feedbackCanonicalReportListMetadataField = (allowedWindows, maximumReports) => feedbackClosedObjectField("Bounded report-list response metadata.", {
1420
+ window: stringField("Closed server-owned lookback selector.", {
1421
+ enum: [...allowedWindows]
1422
+ }),
1423
+ windowStart: canonicalDateTimeField("Inclusive returned range boundary."),
1424
+ windowEnd: canonicalDateTimeField("Exclusive returned range boundary."),
1425
+ generatedAt: canonicalDateTimeField("Response projection time."),
1426
+ returnedCount: canonicalCountField("Reports returned.", {
1427
+ maximum: maximumReports
1428
+ })
1429
+ });
1430
+ var canonicalAlertProjectionField = feedbackClosedObjectField(
1431
+ "Bounded projection of an advisory from one canonical report.",
1432
+ {
1433
+ reportId: canonicalUuidV4Field("Canonical source report UUIDv4."),
1434
+ reportType: stringField("Canonical source report identity.", {
1435
+ enum: [...MCP_ADMIN_FEEDBACK_REPORT_TYPES]
1436
+ }),
1437
+ windowStart: canonicalDateTimeField("Canonical report window start."),
1438
+ windowEnd: canonicalDateTimeField("Canonical report window end."),
1439
+ advisory: canonicalAdvisoryField
1440
+ }
1441
+ );
1442
+ var canonicalFreshnessProjectionField = feedbackClosedObjectField(
1443
+ "Freshness derived from one canonical processor checkpoint.",
1444
+ {
1445
+ checkpoint: canonicalProcessorCheckpointField,
1446
+ freshness: stringField("Closed derived freshness state.", {
1447
+ enum: ["fresh", "stale"]
1448
+ }),
1449
+ lagSeconds: canonicalCountField(
1450
+ "Whole seconds from checkpoint completion to `checkedAt`."
1451
+ )
1452
+ }
1453
+ );
1454
+ var feedbackStructuredEntryCommonFilterFields = () => ({
1455
+ window: stringField("Closed server-owned entry lookback.", {
1456
+ required: true,
1457
+ enum: [...MCP_ADMIN_FEEDBACK_ENTRY_WINDOWS]
1458
+ }),
1459
+ limit: integerField("Maximum structured entries returned.", {
1460
+ required: false,
1461
+ minimum: 1,
1462
+ maximum: MCP_ADMIN_FEEDBACK_MAX_PAGE_SIZE
1463
+ }),
1464
+ cursor: stringField("Opaque server-issued continuation cursor.", {
1465
+ required: false,
1466
+ minLength: 1,
1467
+ maxLength: MCP_ADMIN_FEEDBACK_MAX_CURSOR_LENGTH,
1468
+ pattern: "^[A-Za-z0-9_-]+$"
1469
+ })
1470
+ });
1471
+ var feedbackStructuredEntryFiltersField = discriminatedUnionField(
1472
+ "Exact bounded structured-entry filters. The selected `packetType` variant is closed so bug-only and review-only filters cannot be combined.",
1473
+ "packetType",
1474
+ [
1475
+ feedbackClosedObjectField(
1476
+ "Filters for canonical bug packets only.",
1477
+ {
1478
+ packetType: canonicalLiteralStringField(
1479
+ "Canonical bug-packet identity.",
1480
+ MCP_ADMIN_FEEDBACK_PACKET_TYPES[0]
1481
+ ),
1482
+ ...feedbackStructuredEntryCommonFilterFields(),
1483
+ surfaceId: stringField(
1484
+ "Optional exact allowlisted bug-surface identifier.",
1485
+ {
1486
+ required: false,
1487
+ enum: [...FEEDBACK_SCHEMA_SURFACE_IDS]
1488
+ }
1489
+ ),
1490
+ buildId: stringField(
1491
+ "Optional exact server-owned bug build identifier.",
1492
+ {
1493
+ required: false,
1494
+ maxLength: 128,
1495
+ pattern: "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
1496
+ }
1497
+ ),
1498
+ severity: integerField("Optional exact bug severity.", {
1499
+ required: false,
1500
+ minimum: 1,
1501
+ maximum: 5
1502
+ })
1503
+ },
1504
+ { additionalProperties: false }
1505
+ ),
1506
+ feedbackClosedObjectField(
1507
+ "Filters for canonical review packets only.",
1508
+ {
1509
+ packetType: canonicalLiteralStringField(
1510
+ "Canonical review-packet identity.",
1511
+ MCP_ADMIN_FEEDBACK_PACKET_TYPES[1]
1512
+ ),
1513
+ ...feedbackStructuredEntryCommonFilterFields(),
1514
+ satisfaction: integerField("Optional exact satisfaction score.", {
1515
+ required: false,
1516
+ minimum: 1,
1517
+ maximum: 5
1518
+ })
1519
+ },
1520
+ { additionalProperties: false }
1521
+ )
1522
+ ],
1523
+ { required: true }
1524
+ );
1525
+ function deepFreeze(value) {
1526
+ if (value === null || typeof value !== "object" && typeof value !== "function") {
1527
+ return value;
1528
+ }
1529
+ for (const propertyValue of Object.values(value)) {
1530
+ deepFreeze(propertyValue);
1531
+ }
1532
+ return Object.freeze(value);
1533
+ }
1534
+ var feedbackDescriptorMetadata = {
1535
+ domain: "feedback",
1536
+ rolloutFlag: MCP_ADMIN_FEEDBACK_FLAG_ID,
1537
+ requiredCapability: MCP_ADMIN_FEEDBACK_READ_CAPABILITY,
1538
+ oauthScopes: [...MCP_ADMIN_FEEDBACK_REQUIRED_OAUTH_SCOPES],
1539
+ privacy: MCP_ADMIN_FEEDBACK_PRIVACY_METADATA,
1540
+ access: feedbackReadAccess,
1541
+ availability: "near-future"
1542
+ };
1543
+ var MCP_ADMIN_FEEDBACK_ACTIONS = deepFreeze([
1544
+ {
1545
+ name: "getFeedbackBugHealth",
1546
+ ...translatedDescription(
1547
+ mcpAdminContractDescriptionKeys.actionGetFeedbackBugHealth
1548
+ ),
1549
+ ...feedbackDescriptorMetadata,
1550
+ schemaSource: feedbackSchemaSource("FeedbackHourlyBugReportSchema"),
1551
+ execution: {
1552
+ method: "GET",
1553
+ path: "/api/admin/feedback/bug-health",
1554
+ source: "near-future-route",
1555
+ notes: [
1556
+ "Reads immutable hourly materialisations only; it does not scan packets or Blob Storage on request.",
1557
+ "Returns identifier-free structured distributions, fixed advisories, and deterministic recommendation identifiers only."
1558
+ ]
1559
+ },
1560
+ input: {
1561
+ window: stringField("Closed server-owned bug-health report window.", {
1562
+ required: true,
1563
+ enum: [...MCP_ADMIN_FEEDBACK_BUG_HEALTH_WINDOWS]
1564
+ })
1565
+ },
1566
+ output: {
1567
+ metadata: feedbackCanonicalReportListMetadataField(
1568
+ MCP_ADMIN_FEEDBACK_BUG_HEALTH_WINDOWS,
1569
+ 168
1570
+ ),
1571
+ reports: arrayOfField(
1572
+ "At most 168 canonical immutable hourly bug-health reports.",
1573
+ "FeedbackHourlyBugReport",
1574
+ canonicalHourlyBugReportField,
1575
+ { maxItems: 168 }
1576
+ )
1577
+ }
1578
+ },
1579
+ {
1580
+ name: "getFeedbackSatisfaction",
1581
+ ...translatedDescription(
1582
+ mcpAdminContractDescriptionKeys.actionGetFeedbackSatisfaction
1583
+ ),
1584
+ ...feedbackDescriptorMetadata,
1585
+ schemaSource: feedbackSchemaSource(
1586
+ "FeedbackDailySatisfactionReportSchema"
1587
+ ),
1588
+ execution: {
1589
+ method: "GET",
1590
+ path: "/api/admin/feedback/satisfaction",
1591
+ source: "near-future-route",
1592
+ notes: [
1593
+ "Reads immutable daily materialisations only; it does not calculate from raw review packets on request.",
1594
+ "Returns star statistics and closed derived classifications without narrative or reporter correlation."
1595
+ ]
1596
+ },
1597
+ input: {
1598
+ window: stringField("Closed server-owned satisfaction report window.", {
1599
+ required: true,
1600
+ enum: [...MCP_ADMIN_FEEDBACK_SATISFACTION_WINDOWS]
1601
+ })
1602
+ },
1603
+ output: {
1604
+ metadata: feedbackCanonicalReportListMetadataField(
1605
+ MCP_ADMIN_FEEDBACK_SATISFACTION_WINDOWS,
1606
+ 90
1607
+ ),
1608
+ reports: arrayOfField(
1609
+ "At most 90 canonical immutable daily satisfaction reports.",
1610
+ "FeedbackDailySatisfactionReport",
1611
+ canonicalDailySatisfactionReportField,
1612
+ { maxItems: 90 }
1613
+ )
1614
+ }
1615
+ },
1616
+ {
1617
+ name: "listFeedbackAlerts",
1618
+ ...translatedDescription(
1619
+ mcpAdminContractDescriptionKeys.actionListFeedbackAlerts
1620
+ ),
1621
+ ...feedbackDescriptorMetadata,
1622
+ schemaSource: feedbackSchemaSource(
1623
+ "FeedbackHourlyBugReportSchema",
1624
+ "FeedbackDailySatisfactionReportSchema"
1625
+ ),
1626
+ execution: {
1627
+ method: "GET",
1628
+ path: "/api/admin/feedback/alerts",
1629
+ source: "near-future-route",
1630
+ notes: [
1631
+ "Reads deterministic advisories only; no generated summaries, operator notes, or mutation controls are exposed.",
1632
+ "Pagination is server-cursor based and capped at 100 advisories per call."
1633
+ ]
1634
+ },
1635
+ input: {
1636
+ window: stringField("Closed server-owned advisory lookback.", {
1637
+ required: true,
1638
+ enum: [...MCP_ADMIN_FEEDBACK_ALERT_WINDOWS]
1639
+ }),
1640
+ reportType: stringField("Optional canonical source-report identity.", {
1641
+ required: false,
1642
+ enum: [...MCP_ADMIN_FEEDBACK_REPORT_TYPES]
1643
+ }),
1644
+ limit: integerField("Maximum advisories returned.", {
1645
+ required: false,
1646
+ minimum: 1,
1647
+ maximum: MCP_ADMIN_FEEDBACK_MAX_PAGE_SIZE
1648
+ }),
1649
+ cursor: stringField("Opaque server-issued continuation cursor.", {
1650
+ required: false,
1651
+ minLength: 1,
1652
+ maxLength: MCP_ADMIN_FEEDBACK_MAX_CURSOR_LENGTH,
1653
+ pattern: "^[A-Za-z0-9_-]+$"
1654
+ })
1655
+ },
1656
+ output: {
1657
+ metadata: feedbackPageMetadataField(MCP_ADMIN_FEEDBACK_ALERT_WINDOWS),
1658
+ items: arrayOfField(
1659
+ "Canonical deterministic advisories with bounded source-report metadata.",
1660
+ "FeedbackAdvisoryProjection",
1661
+ canonicalAlertProjectionField,
1662
+ { maxItems: MCP_ADMIN_FEEDBACK_MAX_PAGE_SIZE }
1663
+ )
1664
+ }
1665
+ },
1666
+ {
1667
+ name: "getFeedbackFreshness",
1668
+ ...translatedDescription(
1669
+ mcpAdminContractDescriptionKeys.actionGetFeedbackFreshness
1670
+ ),
1671
+ ...feedbackDescriptorMetadata,
1672
+ schemaSource: feedbackSchemaSource(
1673
+ "FeedbackProcessorCheckpointSchema"
1674
+ ),
1675
+ execution: {
1676
+ method: "GET",
1677
+ path: "/api/admin/feedback/freshness",
1678
+ source: "near-future-route",
1679
+ notes: [
1680
+ "Returns freshness derived from canonical processor checkpoints only; no logs, exception text, or storage references are exposed."
1681
+ ]
1682
+ },
1683
+ input: {
1684
+ processor: stringField("Optional canonical processor filter.", {
1685
+ required: false,
1686
+ enum: [...MCP_ADMIN_FEEDBACK_PROCESSORS]
1687
+ })
1688
+ },
1689
+ output: {
1690
+ checkedAt: canonicalDateTimeField(
1691
+ "UTC time at which processor freshness was read."
1692
+ ),
1693
+ processors: arrayOfField(
1694
+ "Freshness derived from canonical feedback processor checkpoints.",
1695
+ "FeedbackProcessorFreshness",
1696
+ canonicalFreshnessProjectionField,
1697
+ { maxItems: MCP_ADMIN_FEEDBACK_PROCESSORS.length }
1698
+ )
1699
+ }
1700
+ },
1701
+ {
1702
+ name: "listFeedbackStructuredEntries",
1703
+ ...translatedDescription(
1704
+ mcpAdminContractDescriptionKeys.actionListFeedbackStructuredEntries
1705
+ ),
1706
+ ...feedbackDescriptorMetadata,
1707
+ schemaSource: feedbackSchemaSource(
1708
+ "FeedbackBugPacketSchema",
1709
+ "FeedbackReviewPacketSchema"
1710
+ ),
1711
+ execution: {
1712
+ method: "GET",
1713
+ path: "/api/admin/feedback/entries",
1714
+ source: "near-future-route",
1715
+ notes: [
1716
+ "Returns schema-validated identifier-free structured entries only; narrative, reporter control state, pixels, URLs, and direct storage references are never available.",
1717
+ "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.",
1718
+ "Only closed window selectors, allowlisted packet-specific filters, opaque cursors, and a maximum page size of 100 are accepted; unrestricted scans are not represented."
1719
+ ]
1720
+ },
1721
+ input: {
1722
+ filters: feedbackStructuredEntryFiltersField
1723
+ },
1724
+ output: {
1725
+ metadata: feedbackPageMetadataField(MCP_ADMIN_FEEDBACK_ENTRY_WINDOWS),
1726
+ items: arrayOfField(
1727
+ "Reporter-identifier-free structured feedback entries.",
1728
+ "FeedbackPacket",
1729
+ canonicalFeedbackPacketField,
1730
+ { maxItems: MCP_ADMIN_FEEDBACK_MAX_PAGE_SIZE }
1731
+ )
1732
+ }
1733
+ }
1734
+ ]);
326
1735
  var MCP_ADMIN_ACTIONS = [
327
1736
  {
328
1737
  name: "listFeatureFlags",
@@ -1089,6 +2498,342 @@ var MCP_ADMIN_ACTIONS = [
1089
2498
  )
1090
2499
  }
1091
2500
  },
2501
+ {
2502
+ name: "get_admin_token_economy_overview",
2503
+ ...translatedDescription(
2504
+ mcpAdminContractDescriptionKeys.actionGetAdminTokenEconomyOverview
2505
+ ),
2506
+ domain: "economy",
2507
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
2508
+ availability: "near-future",
2509
+ access: adminEconomyReadAccess,
2510
+ execution: {
2511
+ method: "GET",
2512
+ path: "/api/mcp/economy/token-overview",
2513
+ source: "near-future-route",
2514
+ notes: [
2515
+ "The hosted site must register this descriptor as a JSON-RPC MCP tool; publishing this package does not create the runtime route.",
2516
+ "The result is an identifier-free point read of the rebuildable authoritative projection and is never derived by summing a page.",
2517
+ "The tool is read-only and cannot resolve identity or mutate a Token balance."
2518
+ ]
2519
+ },
2520
+ input: {},
2521
+ output: {
2522
+ schemaVersion: stringField("Economy reporting contract version.", {
2523
+ enum: ["1"]
2524
+ }),
2525
+ generatedAt: stringField("UTC time the response was generated.", {
2526
+ format: "date-time"
2527
+ }),
2528
+ projectionAsOf: stringField(
2529
+ "UTC time of the included global projection.",
2530
+ { format: "date-time" }
2531
+ ),
2532
+ authoritySequence: stringField(
2533
+ "Canonical positive authority sequence through which the projection is current.",
2534
+ { format: "uint64-string" }
2535
+ ),
2536
+ walletCount: numberField("Total represented Token wallets.", {
2537
+ minimum: 0
2538
+ }),
2539
+ activeWalletCount: numberField("Active represented Token wallets.", {
2540
+ minimum: 0
2541
+ }),
2542
+ balances: adminTokenAggregateBalancesField,
2543
+ lifetime: adminTokenAggregateLifetimeField,
2544
+ rawIdentifiersIncluded: booleanField(
2545
+ "Always false for this identifier-free contract.",
2546
+ { default: false }
2547
+ )
2548
+ }
2549
+ },
2550
+ {
2551
+ name: "list_admin_token_wallet_balances",
2552
+ ...translatedDescription(
2553
+ mcpAdminContractDescriptionKeys.actionListAdminTokenWalletBalances
2554
+ ),
2555
+ domain: "economy",
2556
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
2557
+ availability: "near-future",
2558
+ access: adminEconomyReadAccess,
2559
+ execution: {
2560
+ method: "GET",
2561
+ path: "/api/mcp/economy/token-wallet-balances",
2562
+ source: "near-future-route",
2563
+ notes: [
2564
+ "The hosted site must register this descriptor as a JSON-RPC MCP tool; publishing this package does not create the runtime route.",
2565
+ "Responses are private/no-store and bounded to 100 pseudonymous projection rows.",
2566
+ "Raw account, wallet, household, payment, and provider identifiers are excluded and identity resolution is unavailable."
2567
+ ]
2568
+ },
2569
+ input: {
2570
+ limit: numberField("Maximum wallet balance rows to return.", {
2571
+ required: false,
2572
+ minimum: 1,
2573
+ maximum: 100,
2574
+ default: 100
2575
+ }),
2576
+ cursor: stringField(
2577
+ "Opaque query-bound cursor returned by the preceding page.",
2578
+ { required: false, format: "opaque-cursor" }
2579
+ ),
2580
+ components: arrayField(
2581
+ "Optional provider-neutral wallet-component filters.",
2582
+ "string",
2583
+ {
2584
+ required: false,
2585
+ enum: MCP_ADMIN_TOKEN_WALLET_COMPONENTS,
2586
+ maxItems: MCP_ADMIN_TOKEN_WALLET_COMPONENTS.length
2587
+ }
2588
+ ),
2589
+ statuses: arrayField("Optional wallet-status filters.", "string", {
2590
+ required: false,
2591
+ enum: MCP_ADMIN_TOKEN_WALLET_STATUSES,
2592
+ maxItems: MCP_ADMIN_TOKEN_WALLET_STATUSES.length
2593
+ }),
2594
+ subjectAlias: stringField(
2595
+ "Optional exact MCP-audience subject alias; raw account identifiers are not accepted.",
2596
+ { required: false, format: "pseudonymous-alias" }
2597
+ ),
2598
+ sort: stringField("Allowlisted stable wallet sort.", {
2599
+ required: false,
2600
+ enum: MCP_ADMIN_TOKEN_WALLET_SORTS,
2601
+ default: "available-desc"
2602
+ })
2603
+ },
2604
+ output: {
2605
+ schemaVersion: stringField("Economy reporting contract version.", {
2606
+ enum: ["1"]
2607
+ }),
2608
+ items: arrayField(
2609
+ "Pseudonymous wallet balances without raw account, wallet, household, payment, or provider identifiers.",
2610
+ "AdminTokenWalletBalanceEntryV1",
2611
+ {
2612
+ items: adminTokenWalletBalanceEntryField,
2613
+ maxItems: 100
2614
+ }
2615
+ ),
2616
+ hasMore: booleanField("Whether another bounded page exists."),
2617
+ nextCursor: stringField("Opaque cursor for the next page.", {
2618
+ required: false,
2619
+ format: "opaque-cursor"
2620
+ }),
2621
+ metadata: objectField("Privacy and normalized wallet query metadata.", {
2622
+ schemaVersion: stringField("Economy reporting contract version.", {
2623
+ enum: ["1"]
2624
+ }),
2625
+ generatedAt: stringField("UTC time the result was generated.", {
2626
+ format: "date-time"
2627
+ }),
2628
+ sort: stringField("Applied stable sort.", {
2629
+ enum: MCP_ADMIN_TOKEN_WALLET_SORTS
2630
+ }),
2631
+ pageLimit: numberField("Applied page bound.", {
2632
+ minimum: 1,
2633
+ maximum: 100
2634
+ }),
2635
+ audience: stringField("Pseudonym audience fixed by the MCP endpoint.", {
2636
+ enum: ["mcp-token-balances"]
2637
+ }),
2638
+ pseudonymVersion: stringField("Active opaque pseudonym key version."),
2639
+ rawIdentifiersIncluded: booleanField(
2640
+ "Always false for this public-safe contract.",
2641
+ { default: false }
2642
+ )
2643
+ })
2644
+ }
2645
+ },
2646
+ {
2647
+ name: "list_admin_token_activity",
2648
+ ...translatedDescription(
2649
+ mcpAdminContractDescriptionKeys.actionListAdminTokenActivity
2650
+ ),
2651
+ domain: "economy",
2652
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
2653
+ availability: "near-future",
2654
+ access: adminEconomyReadAccess,
2655
+ execution: {
2656
+ method: "GET",
2657
+ path: "/api/mcp/economy/token-activity",
2658
+ source: "near-future-route",
2659
+ notes: [
2660
+ "The hosted site must register this descriptor as a JSON-RPC MCP tool; publishing this package does not create the runtime route.",
2661
+ "Responses are private/no-store, bounded to 100 rows, and contain only audience-separated pseudonyms plus source-owned labels.",
2662
+ "The tool is read-only and cannot resolve a pseudonym or mutate a financial record."
2663
+ ]
2664
+ },
2665
+ input: {
2666
+ ...adminTokenReportingWindowInput,
2667
+ limit: numberField("Maximum activity rows to return.", {
2668
+ required: false,
2669
+ minimum: 1,
2670
+ maximum: 100,
2671
+ default: 100
2672
+ }),
2673
+ cursor: stringField(
2674
+ "Opaque query-bound cursor returned by the preceding page.",
2675
+ { required: false, format: "opaque-cursor" }
2676
+ ),
2677
+ activityTypes: arrayField(
2678
+ "Optional allowlisted activity-type filters.",
2679
+ "string",
2680
+ {
2681
+ required: false,
2682
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_TYPES,
2683
+ maxItems: MCP_ADMIN_TOKEN_ACTIVITY_TYPES.length
2684
+ }
2685
+ ),
2686
+ statuses: arrayField("Optional allowlisted activity-status filters.", "string", {
2687
+ required: false,
2688
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_STATUSES,
2689
+ maxItems: MCP_ADMIN_TOKEN_ACTIVITY_STATUSES.length
2690
+ }),
2691
+ sources: arrayField(
2692
+ "Optional provider-neutral source-group filters.",
2693
+ "string",
2694
+ {
2695
+ required: false,
2696
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_SOURCES,
2697
+ maxItems: MCP_ADMIN_TOKEN_ACTIVITY_SOURCES.length
2698
+ }
2699
+ ),
2700
+ subjectAlias: stringField(
2701
+ "Optional exact MCP-audience subject alias; raw account identifiers are not accepted.",
2702
+ { required: false, format: "pseudonymous-alias" }
2703
+ ),
2704
+ sort: stringField("Allowlisted stable sort.", {
2705
+ required: false,
2706
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_SORTS,
2707
+ default: "occurred-at-desc"
2708
+ })
2709
+ },
2710
+ output: {
2711
+ schemaVersion: stringField("Economy reporting contract version.", {
2712
+ enum: ["1"]
2713
+ }),
2714
+ items: arrayField(
2715
+ "Pseudonymous activity rows; no account, wallet, transaction, order, payment, provider-event, idempotency, or journal-integrity identifiers.",
2716
+ "AdminTokenActivityEntryV1",
2717
+ {
2718
+ items: adminTokenActivityEntryField,
2719
+ maxItems: 100
2720
+ }
2721
+ ),
2722
+ hasMore: booleanField("Whether another bounded page exists."),
2723
+ nextCursor: stringField("Opaque cursor for the next page.", {
2724
+ required: false,
2725
+ format: "opaque-cursor"
2726
+ }),
2727
+ metadata: objectField("Privacy and normalized query metadata.", {
2728
+ schemaVersion: stringField("Economy reporting contract version.", {
2729
+ enum: ["1"]
2730
+ }),
2731
+ generatedAt: stringField("UTC time the result was generated.", {
2732
+ format: "date-time"
2733
+ }),
2734
+ fromInclusive: stringField("Normalized inclusive UTC window start.", {
2735
+ format: "date-time"
2736
+ }),
2737
+ toExclusive: stringField("Normalized exclusive UTC window end.", {
2738
+ format: "date-time"
2739
+ }),
2740
+ sort: stringField("Applied stable sort.", {
2741
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_SORTS
2742
+ }),
2743
+ pageLimit: numberField("Applied page bound.", {
2744
+ minimum: 1,
2745
+ maximum: 100
2746
+ }),
2747
+ audience: stringField("Pseudonym audience fixed by the MCP endpoint.", {
2748
+ enum: ["mcp-token-activity"]
2749
+ }),
2750
+ pseudonymVersion: stringField("Active opaque pseudonym key version."),
2751
+ rawIdentifiersIncluded: booleanField(
2752
+ "Always false for this public-safe contract.",
2753
+ { default: false }
2754
+ )
2755
+ })
2756
+ }
2757
+ },
2758
+ {
2759
+ name: "get_admin_token_trends",
2760
+ ...translatedDescription(
2761
+ mcpAdminContractDescriptionKeys.actionGetAdminTokenTrends
2762
+ ),
2763
+ domain: "economy",
2764
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
2765
+ availability: "near-future",
2766
+ access: adminEconomyReadAccess,
2767
+ execution: {
2768
+ method: "GET",
2769
+ path: "/api/mcp/economy/token-trends",
2770
+ source: "near-future-route",
2771
+ notes: [
2772
+ "The hosted site must register this descriptor as a JSON-RPC MCP tool; publishing this package does not create the runtime route.",
2773
+ "Cohorts below five are suppression markers with no counts, amounts, aliases, or anomaly details.",
2774
+ "Anomalies are explainable review signals and never mutate financial records."
2775
+ ]
2776
+ },
2777
+ input: {
2778
+ ...adminTokenReportingWindowInput,
2779
+ granularity: stringField("Hourly or daily UTC aggregation.", {
2780
+ required: false,
2781
+ enum: ["hour", "day"],
2782
+ default: "day"
2783
+ }),
2784
+ activityTypes: arrayField(
2785
+ "Optional allowlisted trend activity types.",
2786
+ "string",
2787
+ {
2788
+ required: false,
2789
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_TYPES,
2790
+ maxItems: MCP_ADMIN_TOKEN_ACTIVITY_TYPES.length
2791
+ }
2792
+ )
2793
+ },
2794
+ output: {
2795
+ schemaVersion: stringField("Economy reporting contract version.", {
2796
+ enum: ["1"]
2797
+ }),
2798
+ series: arrayField(
2799
+ "Bounded, stably ordered trend points.",
2800
+ "AdminTokenTrendPointV1",
2801
+ {
2802
+ items: adminTokenTrendPointField,
2803
+ maxItems: 1e3
2804
+ }
2805
+ ),
2806
+ metadata: objectField("Trend privacy and baseline metadata.", {
2807
+ schemaVersion: stringField("Economy reporting contract version.", {
2808
+ enum: ["1"]
2809
+ }),
2810
+ generatedAt: stringField("UTC time the result was generated.", {
2811
+ format: "date-time"
2812
+ }),
2813
+ fromInclusive: stringField("Normalized inclusive UTC window start.", {
2814
+ format: "date-time"
2815
+ }),
2816
+ toExclusive: stringField("Normalized exclusive UTC window end.", {
2817
+ format: "date-time"
2818
+ }),
2819
+ granularity: stringField("Applied UTC aggregation granularity.", {
2820
+ enum: ["hour", "day"]
2821
+ }),
2822
+ minimumCohortSize: numberField(
2823
+ "Fixed minimum distinct-subject cohort before aggregate disclosure.",
2824
+ { minimum: 5, maximum: 5, default: 5 }
2825
+ ),
2826
+ anomalyBaselineDays: numberField(
2827
+ "Fixed same-window median/MAD baseline length.",
2828
+ { minimum: 28, maximum: 28, default: 28 }
2829
+ ),
2830
+ rawIdentifiersIncluded: booleanField(
2831
+ "Always false for this public-safe contract.",
2832
+ { default: false }
2833
+ )
2834
+ })
2835
+ }
2836
+ },
1092
2837
  {
1093
2838
  name: "searchAssetCatalog",
1094
2839
  ...translatedDescription(mcpAdminContractDescriptionKeys.actionSearchAssetCatalog),
@@ -1419,7 +3164,256 @@ var MCP_ADMIN_ACTIONS = [
1419
3164
  plannedOperations: arrayField("Processing or review operations planned for the job.", "string"),
1420
3165
  evidence: arrayField("Review and processing evidence references available to the caller.", "AssetEvidence")
1421
3166
  }
1422
- }
3167
+ },
3168
+ {
3169
+ name: "getUserTokenWallet",
3170
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionGetUserTokenWallet),
3171
+ domain: "economyAdjustments",
3172
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
3173
+ availability: "near-future",
3174
+ requiredCapability: MCP_ECONOMY_FINANCE_VIEW_CAPABILITY,
3175
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_VIEW_CAPABILITY],
3176
+ execution: {
3177
+ method: "GET",
3178
+ path: "/api/mcp/economy/users/{accountId}/wallet",
3179
+ source: "near-future-route",
3180
+ notes: [
3181
+ "The backend resolves the personal wallet from the account id; callers cannot select an arbitrary wallet."
3182
+ ]
3183
+ },
3184
+ input: {
3185
+ accountId: stringField("Stable target account identifier.", { required: true })
3186
+ },
3187
+ output: {
3188
+ wallet: objectField("Authorized Token wallet summary.", {
3189
+ accountId: stringField("Stable target account identifier."),
3190
+ initialized: booleanField(
3191
+ "Whether the authoritative personal wallet has been initialized."
3192
+ ),
3193
+ walletId: stringField("Server-resolved wallet identifier.", {
3194
+ required: false
3195
+ }),
3196
+ walletKind: stringField("Server-resolved wallet kind.", { enum: ["personal"] }),
3197
+ availableTokenSubunits: stringField("Exact available TokenSubunits as base-10 text."),
3198
+ heldTokenSubunits: stringField("Exact held TokenSubunits as base-10 text."),
3199
+ lifetimeCreditedTokenSubunits: stringField(
3200
+ "Exact lifetime credited TokenSubunits as base-10 text."
3201
+ ),
3202
+ lifetimeReversedTokenSubunits: stringField(
3203
+ "Exact lifetime reversed TokenSubunits as base-10 text."
3204
+ ),
3205
+ projectionVersion: stringField("Optimistic concurrency projection version.", {
3206
+ required: false
3207
+ })
3208
+ })
3209
+ }
3210
+ },
3211
+ {
3212
+ name: "listUserTokenActivity",
3213
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionListUserTokenActivity),
3214
+ domain: "economyAdjustments",
3215
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
3216
+ availability: "near-future",
3217
+ requiredCapability: MCP_ECONOMY_FINANCE_VIEW_CAPABILITY,
3218
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_VIEW_CAPABILITY],
3219
+ execution: {
3220
+ method: "GET",
3221
+ path: "/api/mcp/economy/users/{accountId}/activity",
3222
+ source: "near-future-route"
3223
+ },
3224
+ input: {
3225
+ accountId: stringField("Stable target account identifier.", { required: true }),
3226
+ cursor: stringField("Opaque continuation cursor.", { required: false }),
3227
+ limit: numberField("Maximum results; the backend applies a bounded ceiling.", {
3228
+ required: false
3229
+ })
3230
+ },
3231
+ output: {
3232
+ items: arrayField("Immutable Token activity entries.", "WalletActivityEntryV1"),
3233
+ nextCursor: stringField("Opaque cursor for the next page.", { required: false })
3234
+ }
3235
+ },
3236
+ {
3237
+ name: "listTokenAdjustments",
3238
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionListTokenAdjustments),
3239
+ domain: "economyAdjustments",
3240
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
3241
+ availability: "near-future",
3242
+ requiredCapability: MCP_ECONOMY_FINANCE_VIEW_CAPABILITY,
3243
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_VIEW_CAPABILITY],
3244
+ execution: {
3245
+ method: "GET",
3246
+ path: "/api/mcp/economy/adjustments",
3247
+ source: "near-future-route"
3248
+ },
3249
+ input: {
3250
+ targetAccountId: stringField("Optional target account filter.", { required: false }),
3251
+ status: stringField("Optional workflow status filter.", {
3252
+ required: false,
3253
+ enum: ["pending", "approved", "rejected", "executed", "failed", "expired"]
3254
+ }),
3255
+ cursor: stringField("Opaque continuation cursor.", { required: false }),
3256
+ limit: numberField("Maximum results; the backend applies a bounded ceiling.", {
3257
+ required: false
3258
+ })
3259
+ },
3260
+ output: {
3261
+ items: arrayField("Audited adjustment workflow records.", "OperatorAdjustmentProposalV1"),
3262
+ nextCursor: stringField("Opaque cursor for the next page.", { required: false })
3263
+ }
3264
+ },
3265
+ {
3266
+ name: "proposeTokenCredit",
3267
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionProposeTokenCredit),
3268
+ domain: "economyAdjustments",
3269
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
3270
+ availability: "near-future",
3271
+ requiredCapability: MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY,
3272
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY],
3273
+ execution: {
3274
+ method: "POST",
3275
+ path: "/api/mcp/economy/adjustments/token-credits",
3276
+ source: "near-future-route",
3277
+ notes: [
3278
+ "This creates a preview-bound proposal only; it does not credit the wallet until a distinct owner approves it.",
3279
+ "Raw idempotency keys and ticket references are fingerprinted before authoritative persistence."
3280
+ ]
3281
+ },
3282
+ input: {
3283
+ targetAccountId: stringField("Stable target account identifier.", { required: true }),
3284
+ targetWalletKind: stringField("Permitted server-resolved wallet kind.", {
3285
+ required: true,
3286
+ enum: ["personal"]
3287
+ }),
3288
+ amountTokenSubunits: stringField(
3289
+ "Exact positive base-10 TokenSubunit amount; 1 Token is 1,000 subunits.",
3290
+ { required: true }
3291
+ ),
3292
+ reasonCode: stringField("Allowlisted operator reason code.", { required: true }),
3293
+ ticketReference: stringField("Support or change ticket reference.", { required: true }),
3294
+ idempotencyKey: stringField("Caller-generated idempotency key.", { required: true })
3295
+ },
3296
+ output: tokenAdjustmentOutput,
3297
+ verification: {
3298
+ method: "GET",
3299
+ path: "/api/mcp/economy/adjustments",
3300
+ query: ["adjustmentId={adjustmentId}"],
3301
+ ...translatedDescription(
3302
+ mcpAdminContractDescriptionKeys.verificationTokenAdjustment
3303
+ )
3304
+ }
3305
+ },
3306
+ {
3307
+ name: "approveTokenCredit",
3308
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionApproveTokenCredit),
3309
+ domain: "economyAdjustments",
3310
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
3311
+ availability: "near-future",
3312
+ requiredCapability: MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY,
3313
+ requiredTokenScopes: [
3314
+ "mcp:access",
3315
+ MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY
3316
+ ],
3317
+ execution: {
3318
+ method: "POST",
3319
+ path: "/api/mcp/economy/adjustments/{adjustmentId}/approve",
3320
+ source: "near-future-route",
3321
+ notes: [
3322
+ "The authenticated approver must be a different stable platform-owner account from the proposer."
3323
+ ]
3324
+ },
3325
+ input: {
3326
+ adjustmentId: stringField("Stable pending adjustment identifier.", { required: true }),
3327
+ expectedPreviewHash: stringField("Preview hash displayed to the approver.", {
3328
+ required: true
3329
+ }),
3330
+ expectedProposalHash: stringField("Proposal hash displayed to the approver.", {
3331
+ required: true
3332
+ }),
3333
+ idempotencyKey: stringField("Caller-generated idempotency key.", { required: true })
3334
+ },
3335
+ output: tokenAdjustmentOutput,
3336
+ verification: {
3337
+ method: "GET",
3338
+ path: "/api/mcp/economy/adjustments",
3339
+ query: ["adjustmentId={adjustmentId}"],
3340
+ ...translatedDescription(
3341
+ mcpAdminContractDescriptionKeys.verificationTokenAdjustment
3342
+ )
3343
+ }
3344
+ },
3345
+ {
3346
+ name: "rejectTokenCredit",
3347
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionRejectTokenCredit),
3348
+ domain: "economyAdjustments",
3349
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
3350
+ availability: "near-future",
3351
+ requiredCapability: MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY,
3352
+ requiredTokenScopes: [
3353
+ "mcp:access",
3354
+ MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY
3355
+ ],
3356
+ execution: {
3357
+ method: "POST",
3358
+ path: "/api/mcp/economy/adjustments/{adjustmentId}/reject",
3359
+ source: "near-future-route"
3360
+ },
3361
+ input: {
3362
+ adjustmentId: stringField("Stable pending adjustment identifier.", { required: true }),
3363
+ expectedPreviewHash: stringField("Preview hash displayed to the approver.", {
3364
+ required: true
3365
+ }),
3366
+ expectedProposalHash: stringField("Proposal hash displayed to the approver.", {
3367
+ required: true
3368
+ }),
3369
+ reasonCode: stringField("Allowlisted rejection reason code.", { required: true }),
3370
+ idempotencyKey: stringField("Caller-generated idempotency key.", { required: true })
3371
+ },
3372
+ output: tokenAdjustmentOutput,
3373
+ verification: {
3374
+ method: "GET",
3375
+ path: "/api/mcp/economy/adjustments",
3376
+ query: ["adjustmentId={adjustmentId}"],
3377
+ ...translatedDescription(
3378
+ mcpAdminContractDescriptionKeys.verificationTokenAdjustment
3379
+ )
3380
+ }
3381
+ },
3382
+ {
3383
+ name: "reverseTokenCredit",
3384
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionReverseTokenCredit),
3385
+ domain: "economyAdjustments",
3386
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
3387
+ availability: "near-future",
3388
+ requiredCapability: MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY,
3389
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY],
3390
+ execution: {
3391
+ method: "POST",
3392
+ path: "/api/mcp/economy/adjustments/{adjustmentId}/reverse",
3393
+ source: "near-future-route",
3394
+ notes: [
3395
+ "A reversal is a separately approved compensating transaction; the original credit is never updated or deleted."
3396
+ ]
3397
+ },
3398
+ input: {
3399
+ originalAdjustmentId: stringField("Executed credit adjustment to reverse.", {
3400
+ required: true
3401
+ }),
3402
+ reasonCode: stringField("Allowlisted reversal reason code.", { required: true }),
3403
+ ticketReference: stringField("Support or change ticket reference.", { required: true }),
3404
+ idempotencyKey: stringField("Caller-generated idempotency key.", { required: true })
3405
+ },
3406
+ output: tokenAdjustmentOutput,
3407
+ verification: {
3408
+ method: "GET",
3409
+ path: "/api/mcp/economy/adjustments",
3410
+ query: ["adjustmentId={adjustmentId}"],
3411
+ ...translatedDescription(
3412
+ mcpAdminContractDescriptionKeys.verificationTokenAdjustment
3413
+ )
3414
+ }
3415
+ },
3416
+ ...MCP_ADMIN_FEEDBACK_ACTIONS
1423
3417
  ];
1424
3418
  function listMcpActionSummaries() {
1425
3419
  return MCP_ADMIN_ACTIONS.map((action) => ({
@@ -1429,8 +3423,14 @@ function listMcpActionSummaries() {
1429
3423
  descriptionDefault: action.descriptionDefault,
1430
3424
  domain: action.domain,
1431
3425
  rolloutFlag: action.rolloutFlag,
3426
+ ...action.oauthScopes === void 0 ? {} : { oauthScopes: action.oauthScopes },
3427
+ ...action.privacy === void 0 ? {} : { privacy: action.privacy },
3428
+ ...action.schemaSource === void 0 ? {} : { schemaSource: action.schemaSource },
1432
3429
  availability: action.availability,
1433
- execution: action.execution
3430
+ execution: action.execution,
3431
+ requiredCapability: action.requiredCapability,
3432
+ requiredTokenScopes: action.requiredTokenScopes,
3433
+ access: action.access
1434
3434
  }));
1435
3435
  }
1436
3436
  var MCP_ADMIN_CONTEXT_SHAPE = {
@@ -1474,7 +3474,8 @@ var MCP_ADMIN_EXTENSION_RULES = {
1474
3474
  singleResourceMutations: true,
1475
3475
  notes: [
1476
3476
  "Future game/admin asset actions must reuse the same descriptor shape instead of adding a second discovery contract.",
1477
- "New descriptors must define rolloutFlag, execution mapping, input shape, output shape, and verification notes where applicable."
3477
+ "New descriptors must define rolloutFlag, execution mapping, input shape, output shape, and verification notes where applicable.",
3478
+ "Sensitive read descriptors must publish their OAuth scope, capability, rollout, read-only, and identity-resolution metadata without treating discovery as authorization."
1478
3479
  ]
1479
3480
  };
1480
3481
  function buildMcpSurfaceUrls(origin) {
@@ -1511,7 +3512,7 @@ function buildAiPluginManifest(origin) {
1511
3512
  client_url: `${urls.apiBaseUrl}/login`,
1512
3513
  authorization_url: `${urls.apiBaseUrl}/oauth/authorize`,
1513
3514
  token_url: `${urls.apiBaseUrl}/oauth/token`,
1514
- scope: "openid email profile",
3515
+ scope: `openid email profile ${MCP_ACCESS_SCOPE}`,
1515
3516
  authorization_content_type: "application/x-www-form-urlencoded",
1516
3517
  instructions: "Sign in with an admin-capable Google or Microsoft account to access the Plasius MCP control plane."
1517
3518
  }
@@ -1531,10 +3532,16 @@ function buildMcpSchemaResponse() {
1531
3532
  {
1532
3533
  domain: action.domain,
1533
3534
  rolloutFlag: action.rolloutFlag,
3535
+ ...action.oauthScopes === void 0 ? {} : { oauthScopes: action.oauthScopes },
3536
+ ...action.privacy === void 0 ? {} : { privacy: action.privacy },
3537
+ ...action.schemaSource === void 0 ? {} : { schemaSource: action.schemaSource },
1534
3538
  availability: action.availability,
1535
3539
  execution: action.execution,
1536
3540
  input: action.input,
1537
3541
  output: action.output,
3542
+ requiredCapability: action.requiredCapability,
3543
+ requiredTokenScopes: action.requiredTokenScopes,
3544
+ access: action.access,
1538
3545
  verification: action.verification
1539
3546
  }
1540
3547
  ])
@@ -1579,6 +3586,18 @@ function buildMcpActionFamilies() {
1579
3586
  rolloutFlag: MCP_ADMIN_ANALYTICS_FLAG_ID,
1580
3587
  actions: getActionsByDomain("userAggregation")
1581
3588
  },
3589
+ {
3590
+ domain: "economy",
3591
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
3592
+ actions: getActionsByDomain("economy")
3593
+ },
3594
+ {
3595
+ domain: "feedback",
3596
+ rolloutFlag: MCP_ADMIN_FEEDBACK_FLAG_ID,
3597
+ requiredCapability: MCP_ADMIN_FEEDBACK_READ_CAPABILITY,
3598
+ oauthScopes: [...MCP_ADMIN_FEEDBACK_REQUIRED_OAUTH_SCOPES],
3599
+ actions: getActionsByDomain("feedback")
3600
+ },
1582
3601
  {
1583
3602
  domain: "assetCatalog",
1584
3603
  rolloutFlag: MCP_ASSET_PIPELINE_FLAG_ID,
@@ -1599,6 +3618,11 @@ function buildMcpActionFamilies() {
1599
3618
  rolloutFlag: MCP_ASSET_PIPELINE_FLAG_ID,
1600
3619
  actions: getActionsByDomain("assetReview")
1601
3620
  },
3621
+ {
3622
+ domain: "economyAdjustments",
3623
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
3624
+ actions: getActionsByDomain("economyAdjustments")
3625
+ },
1602
3626
  {
1603
3627
  domain: "productionReadiness",
1604
3628
  rolloutFlag: MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID,
@@ -1633,14 +3657,41 @@ function normalizeOptionalString(value) {
1633
3657
  return normalizeNonEmptyString(value);
1634
3658
  }
1635
3659
  export {
3660
+ ECONOMY_ADMIN_HISTORY_FLAG_ID,
3661
+ ECONOMY_FINANCE_OPERATIONS_VIEW_CAPABILITY,
3662
+ ECONOMY_OWNER_ADJUSTMENTS_FLAG_ID,
3663
+ MCP_ACCESS_SCOPE,
1636
3664
  MCP_ADMIN_ACTIONS,
1637
3665
  MCP_ADMIN_ANALYTICS_DIMENSIONS,
1638
3666
  MCP_ADMIN_ANALYTICS_FLAG_ID,
1639
3667
  MCP_ADMIN_ANALYTICS_METRICS,
1640
3668
  MCP_ADMIN_ANALYTICS_PRESETS,
3669
+ MCP_ADMIN_BASE_OAUTH_SCOPE,
1641
3670
  MCP_ADMIN_CONTEXT_SHAPE,
1642
3671
  MCP_ADMIN_CONTRACT_VERSION,
3672
+ MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
3673
+ MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
3674
+ MCP_ADMIN_ECONOMY_READ_CAPABILITY,
1643
3675
  MCP_ADMIN_EXTENSION_RULES,
3676
+ MCP_ADMIN_FEEDBACK_ACTIONS,
3677
+ MCP_ADMIN_FEEDBACK_ALERT_WINDOWS,
3678
+ MCP_ADMIN_FEEDBACK_BUG_HEALTH_WINDOWS,
3679
+ MCP_ADMIN_FEEDBACK_ENTRY_WINDOWS,
3680
+ MCP_ADMIN_FEEDBACK_FLAG_ID,
3681
+ MCP_ADMIN_FEEDBACK_MAX_CURSOR_LENGTH,
3682
+ MCP_ADMIN_FEEDBACK_MAX_PAGE_SIZE,
3683
+ MCP_ADMIN_FEEDBACK_PACKET_TYPES,
3684
+ MCP_ADMIN_FEEDBACK_PRIVACY_EXCLUSIONS,
3685
+ MCP_ADMIN_FEEDBACK_PRIVACY_METADATA,
3686
+ MCP_ADMIN_FEEDBACK_PROCESSORS,
3687
+ MCP_ADMIN_FEEDBACK_READ_CAPABILITY,
3688
+ MCP_ADMIN_FEEDBACK_READ_OAUTH_SCOPE,
3689
+ MCP_ADMIN_FEEDBACK_REPORT_TYPES,
3690
+ MCP_ADMIN_FEEDBACK_REQUIRED_OAUTH_SCOPES,
3691
+ MCP_ADMIN_FEEDBACK_SATISFACTION_WINDOWS,
3692
+ MCP_ADMIN_FEEDBACK_SCHEMA_CONTRACT_VERSION,
3693
+ MCP_ADMIN_FEEDBACK_SCHEMA_PACKAGE,
3694
+ MCP_ADMIN_FEEDBACK_WINDOWS,
1644
3695
  MCP_ADMIN_FOUNDATION_DISABLED_CODE,
1645
3696
  MCP_ADMIN_FOUNDATION_ENV_VAR,
1646
3697
  MCP_ADMIN_FOUNDATION_FLAG_ID,
@@ -1648,6 +3699,13 @@ export {
1648
3699
  MCP_ADMIN_PRODUCTION_READINESS_ENV_VAR,
1649
3700
  MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID,
1650
3701
  MCP_ADMIN_REGISTRY_SOURCE,
3702
+ MCP_ADMIN_TOKEN_ACTIVITY_SORTS,
3703
+ MCP_ADMIN_TOKEN_ACTIVITY_SOURCES,
3704
+ MCP_ADMIN_TOKEN_ACTIVITY_STATUSES,
3705
+ MCP_ADMIN_TOKEN_ACTIVITY_TYPES,
3706
+ MCP_ADMIN_TOKEN_WALLET_COMPONENTS,
3707
+ MCP_ADMIN_TOKEN_WALLET_SORTS,
3708
+ MCP_ADMIN_TOKEN_WALLET_STATUSES,
1651
3709
  MCP_ADMIN_USER_AGGREGATION_DIMENSIONS,
1652
3710
  MCP_ADMIN_USER_AGGREGATION_METRICS,
1653
3711
  MCP_ADMIN_USER_AGGREGATION_PRESETS,
@@ -1661,6 +3719,9 @@ export {
1661
3719
  MCP_ASSET_SOURCE_ADAPTERS,
1662
3720
  MCP_ASSET_SOURCE_MANAGE_CAPABILITY,
1663
3721
  MCP_ASSET_SOURCE_TIERS,
3722
+ MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY,
3723
+ MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY,
3724
+ MCP_ECONOMY_FINANCE_VIEW_CAPABILITY,
1664
3725
  buildAiPluginManifest,
1665
3726
  buildMcpContextResponse,
1666
3727
  buildMcpDiscoveryResponse,