@plasius/mcp-admin-contracts 0.2.9 → 0.4.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.cjs CHANGED
@@ -20,6 +20,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ ECONOMY_ADMIN_HISTORY_FLAG_ID: () => ECONOMY_ADMIN_HISTORY_FLAG_ID,
24
+ ECONOMY_FINANCE_OPERATIONS_VIEW_CAPABILITY: () => ECONOMY_FINANCE_OPERATIONS_VIEW_CAPABILITY,
25
+ ECONOMY_OWNER_ADJUSTMENTS_FLAG_ID: () => ECONOMY_OWNER_ADJUSTMENTS_FLAG_ID,
26
+ MCP_ACCESS_SCOPE: () => MCP_ACCESS_SCOPE,
23
27
  MCP_ADMIN_ACTIONS: () => MCP_ADMIN_ACTIONS,
24
28
  MCP_ADMIN_ANALYTICS_DIMENSIONS: () => MCP_ADMIN_ANALYTICS_DIMENSIONS,
25
29
  MCP_ADMIN_ANALYTICS_FLAG_ID: () => MCP_ADMIN_ANALYTICS_FLAG_ID,
@@ -27,6 +31,9 @@ __export(index_exports, {
27
31
  MCP_ADMIN_ANALYTICS_PRESETS: () => MCP_ADMIN_ANALYTICS_PRESETS,
28
32
  MCP_ADMIN_CONTEXT_SHAPE: () => MCP_ADMIN_CONTEXT_SHAPE,
29
33
  MCP_ADMIN_CONTRACT_VERSION: () => MCP_ADMIN_CONTRACT_VERSION,
34
+ MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID: () => MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
35
+ MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID: () => MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
36
+ MCP_ADMIN_ECONOMY_READ_CAPABILITY: () => MCP_ADMIN_ECONOMY_READ_CAPABILITY,
30
37
  MCP_ADMIN_EXTENSION_RULES: () => MCP_ADMIN_EXTENSION_RULES,
31
38
  MCP_ADMIN_FOUNDATION_DISABLED_CODE: () => MCP_ADMIN_FOUNDATION_DISABLED_CODE,
32
39
  MCP_ADMIN_FOUNDATION_ENV_VAR: () => MCP_ADMIN_FOUNDATION_ENV_VAR,
@@ -35,6 +42,13 @@ __export(index_exports, {
35
42
  MCP_ADMIN_PRODUCTION_READINESS_ENV_VAR: () => MCP_ADMIN_PRODUCTION_READINESS_ENV_VAR,
36
43
  MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID: () => MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID,
37
44
  MCP_ADMIN_REGISTRY_SOURCE: () => MCP_ADMIN_REGISTRY_SOURCE,
45
+ MCP_ADMIN_TOKEN_ACTIVITY_SORTS: () => MCP_ADMIN_TOKEN_ACTIVITY_SORTS,
46
+ MCP_ADMIN_TOKEN_ACTIVITY_SOURCES: () => MCP_ADMIN_TOKEN_ACTIVITY_SOURCES,
47
+ MCP_ADMIN_TOKEN_ACTIVITY_STATUSES: () => MCP_ADMIN_TOKEN_ACTIVITY_STATUSES,
48
+ MCP_ADMIN_TOKEN_ACTIVITY_TYPES: () => MCP_ADMIN_TOKEN_ACTIVITY_TYPES,
49
+ MCP_ADMIN_TOKEN_WALLET_COMPONENTS: () => MCP_ADMIN_TOKEN_WALLET_COMPONENTS,
50
+ MCP_ADMIN_TOKEN_WALLET_SORTS: () => MCP_ADMIN_TOKEN_WALLET_SORTS,
51
+ MCP_ADMIN_TOKEN_WALLET_STATUSES: () => MCP_ADMIN_TOKEN_WALLET_STATUSES,
38
52
  MCP_ADMIN_USER_AGGREGATION_DIMENSIONS: () => MCP_ADMIN_USER_AGGREGATION_DIMENSIONS,
39
53
  MCP_ADMIN_USER_AGGREGATION_METRICS: () => MCP_ADMIN_USER_AGGREGATION_METRICS,
40
54
  MCP_ADMIN_USER_AGGREGATION_PRESETS: () => MCP_ADMIN_USER_AGGREGATION_PRESETS,
@@ -48,6 +62,9 @@ __export(index_exports, {
48
62
  MCP_ASSET_SOURCE_ADAPTERS: () => MCP_ASSET_SOURCE_ADAPTERS,
49
63
  MCP_ASSET_SOURCE_MANAGE_CAPABILITY: () => MCP_ASSET_SOURCE_MANAGE_CAPABILITY,
50
64
  MCP_ASSET_SOURCE_TIERS: () => MCP_ASSET_SOURCE_TIERS,
65
+ MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY: () => MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY,
66
+ MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY: () => MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY,
67
+ MCP_ECONOMY_FINANCE_VIEW_CAPABILITY: () => MCP_ECONOMY_FINANCE_VIEW_CAPABILITY,
51
68
  buildAiPluginManifest: () => buildAiPluginManifest,
52
69
  buildMcpContextResponse: () => buildMcpContextResponse,
53
70
  buildMcpDiscoveryResponse: () => buildMcpDiscoveryResponse,
@@ -63,8 +80,8 @@ module.exports = __toCommonJS(index_exports);
63
80
 
64
81
  // src/translations/en-GB.ts
65
82
  var mcpAdminContractsEnGbTranslations = {
66
- "mcpAdminContracts.manifest.descriptionForModel": "OAuth-protected MCP discovery manifest for the Plasius admin control plane covering feature flags, capabilities, analytics, and audit-backed operations.",
67
- "mcpAdminContracts.manifest.description": "Authenticated admin MCP discovery for the Plasius feature flag, capability, analytics, and audit control plane.",
83
+ "mcpAdminContracts.manifest.descriptionForModel": "OAuth-protected MCP discovery manifest for the Plasius admin control plane covering feature flags, capabilities, analytics, pseudonymous Token finance reads, and audit-backed operations.",
84
+ "mcpAdminContracts.manifest.description": "Authenticated admin MCP discovery for the Plasius feature flag, capability, analytics, pseudonymous Token reporting, and audit control plane.",
68
85
  "mcpAdminContracts.action.listFeatureFlags.description": "List existing feature flags from the admin rollout control plane.",
69
86
  "mcpAdminContracts.action.getFeatureFlag.description": "Fetch one feature flag by stable key.",
70
87
  "mcpAdminContracts.action.updateFeatureFlag.description": "Patch an existing feature flag without bypassing the current admin update semantics.",
@@ -84,6 +101,10 @@ var mcpAdminContractsEnGbTranslations = {
84
101
  "mcpAdminContracts.action.listAggregationDimensions.description": "List the approved user-aggregation dimensions from the MCP whitelist.",
85
102
  "mcpAdminContracts.action.aggregateUsers.description": "Run grouped user aggregation over the bounded admin user data surface.",
86
103
  "mcpAdminContracts.action.aggregateUsersByPreset.description": "Run a curated user-aggregation preset against the bounded aggregation route.",
104
+ "mcpAdminContracts.action.listAdminTokenActivity.description": "List bounded pseudonymous Token activity after re-checking MCP scope, finance capabilities, and stored rollout flags.",
105
+ "mcpAdminContracts.action.getAdminTokenEconomyOverview.description": "Read the identifier-free global Token balance, lifetime totals, wallet counts, and authoritative projection freshness.",
106
+ "mcpAdminContracts.action.listAdminTokenWalletBalances.description": "List bounded pseudonymous Token wallet balances without exposing account, payment, provider, or raw wallet identifiers.",
107
+ "mcpAdminContracts.action.getAdminTokenTrends.description": "Read privacy-suppressed Token acquisition and usage trends with explainable advisory anomaly indicators.",
87
108
  "mcpAdminContracts.action.searchAssetCatalog.description": "Search promoted asset catalog records without live third-party lookup.",
88
109
  "mcpAdminContracts.action.getAssetManifest.description": "Fetch a promoted player-safe runtime asset manifest reference.",
89
110
  "mcpAdminContracts.action.requestAsset.description": "Queue a governed missing-asset request when no promoted catalog match exists.",
@@ -97,13 +118,21 @@ var mcpAdminContractsEnGbTranslations = {
97
118
  "mcpAdminContracts.action.promoteAsset.description": "Promote an approved asset candidate to an immutable runtime manifest reference.",
98
119
  "mcpAdminContracts.action.rollbackAsset.description": "Rollback an asset runtime channel to a previous promoted manifest version.",
99
120
  "mcpAdminContracts.action.getAssetJobStatus.description": "Read governed asset job status, planned processing work, and evidence references.",
121
+ "mcpAdminContracts.action.getUserTokenWallet.description": "Read an account's server-resolved Token wallet summary without exposing provider or payment data.",
122
+ "mcpAdminContracts.action.listUserTokenActivity.description": "Read a bounded, cursor-paginated Token activity history for one account.",
123
+ "mcpAdminContracts.action.listTokenAdjustments.description": "List audited Token adjustment proposals and their approval state.",
124
+ "mcpAdminContracts.action.proposeTokenCredit.description": "Propose a positive Token credit for a server-resolved personal wallet; a distinct owner must approve it.",
125
+ "mcpAdminContracts.action.approveTokenCredit.description": "Approve a preview-bound Token credit proposed by a different owner.",
126
+ "mcpAdminContracts.action.rejectTokenCredit.description": "Reject a pending Token credit without mutating the wallet.",
127
+ "mcpAdminContracts.action.reverseTokenCredit.description": "Propose an immutable compensating reversal of an earlier owner Token credit.",
100
128
  "mcpAdminContracts.verification.enableFeatureFlag.description": "Use admin audit history to verify the rollout change.",
101
129
  "mcpAdminContracts.verification.disableFeatureFlag.description": "Use admin audit history to verify the rollout change.",
102
130
  "mcpAdminContracts.verification.assignCapability.description": "Use admin audit history to verify the stored rule written by the capability assignment.",
103
131
  "mcpAdminContracts.verification.unassignCapability.description": "Use admin audit history to verify capability-rule deletion.",
104
132
  "mcpAdminContracts.verification.updateCapability.description": "Use admin audit history to verify the stored rule updated by the capability mutation.",
105
133
  "mcpAdminContracts.verification.promoteAsset.description": "Use asset promotion history and admin audit events to verify the immutable runtime manifest promotion.",
106
- "mcpAdminContracts.verification.rollbackAsset.description": "Use asset promotion history and admin audit events to verify the runtime channel rollback."
134
+ "mcpAdminContracts.verification.rollbackAsset.description": "Use asset promotion history and admin audit events to verify the runtime channel rollback.",
135
+ "mcpAdminContracts.verification.tokenAdjustment.description": "Read the adjustment and Token activity history to verify its immutable proposal, decision, and ledger result."
107
136
  };
108
137
 
109
138
  // src/i18n.ts
@@ -129,6 +158,10 @@ var mcpAdminContractDescriptionKeys = {
129
158
  actionListAggregationDimensions: "mcpAdminContracts.action.listAggregationDimensions.description",
130
159
  actionAggregateUsers: "mcpAdminContracts.action.aggregateUsers.description",
131
160
  actionAggregateUsersByPreset: "mcpAdminContracts.action.aggregateUsersByPreset.description",
161
+ actionListAdminTokenActivity: "mcpAdminContracts.action.listAdminTokenActivity.description",
162
+ actionGetAdminTokenEconomyOverview: "mcpAdminContracts.action.getAdminTokenEconomyOverview.description",
163
+ actionListAdminTokenWalletBalances: "mcpAdminContracts.action.listAdminTokenWalletBalances.description",
164
+ actionGetAdminTokenTrends: "mcpAdminContracts.action.getAdminTokenTrends.description",
132
165
  actionSearchAssetCatalog: "mcpAdminContracts.action.searchAssetCatalog.description",
133
166
  actionGetAssetManifest: "mcpAdminContracts.action.getAssetManifest.description",
134
167
  actionRequestAsset: "mcpAdminContracts.action.requestAsset.description",
@@ -142,13 +175,21 @@ var mcpAdminContractDescriptionKeys = {
142
175
  actionPromoteAsset: "mcpAdminContracts.action.promoteAsset.description",
143
176
  actionRollbackAsset: "mcpAdminContracts.action.rollbackAsset.description",
144
177
  actionGetAssetJobStatus: "mcpAdminContracts.action.getAssetJobStatus.description",
178
+ actionGetUserTokenWallet: "mcpAdminContracts.action.getUserTokenWallet.description",
179
+ actionListUserTokenActivity: "mcpAdminContracts.action.listUserTokenActivity.description",
180
+ actionListTokenAdjustments: "mcpAdminContracts.action.listTokenAdjustments.description",
181
+ actionProposeTokenCredit: "mcpAdminContracts.action.proposeTokenCredit.description",
182
+ actionApproveTokenCredit: "mcpAdminContracts.action.approveTokenCredit.description",
183
+ actionRejectTokenCredit: "mcpAdminContracts.action.rejectTokenCredit.description",
184
+ actionReverseTokenCredit: "mcpAdminContracts.action.reverseTokenCredit.description",
145
185
  verificationEnableFeatureFlag: "mcpAdminContracts.verification.enableFeatureFlag.description",
146
186
  verificationDisableFeatureFlag: "mcpAdminContracts.verification.disableFeatureFlag.description",
147
187
  verificationAssignCapability: "mcpAdminContracts.verification.assignCapability.description",
148
188
  verificationUnassignCapability: "mcpAdminContracts.verification.unassignCapability.description",
149
189
  verificationUpdateCapability: "mcpAdminContracts.verification.updateCapability.description",
150
190
  verificationPromoteAsset: "mcpAdminContracts.verification.promoteAsset.description",
151
- verificationRollbackAsset: "mcpAdminContracts.verification.rollbackAsset.description"
191
+ verificationRollbackAsset: "mcpAdminContracts.verification.rollbackAsset.description",
192
+ verificationTokenAdjustment: "mcpAdminContracts.verification.tokenAdjustment.description"
152
193
  };
153
194
  var mcpAdminContractsTranslations = {
154
195
  "en-GB": mcpAdminContractsEnGbTranslations
@@ -158,13 +199,18 @@ function getMcpAdminContractDefaultTranslation(key) {
158
199
  }
159
200
 
160
201
  // src/index.ts
161
- var MCP_ADMIN_CONTRACT_VERSION = "2026-04-28.v3";
202
+ var MCP_ADMIN_CONTRACT_VERSION = "2026-08-08.v5";
162
203
  var MCP_ADMIN_REGISTRY_SOURCE = "@plasius/mcp-admin-contracts";
163
204
  var MCP_ADMIN_FOUNDATION_FLAG_ID = "mcp.admin.foundation.enabled";
205
+ var MCP_ACCESS_SCOPE = "mcp:access";
164
206
  var MCP_ADMIN_FOUNDATION_ENV_VAR = "MCP_ADMIN_FOUNDATION_ENABLED";
165
207
  var MCP_ADMIN_FOUNDATION_DISABLED_CODE = "MCP_ADMIN_FOUNDATION_DISABLED";
166
208
  var MCP_ADMIN_LIVEOPS_FLAG_ID = "mcp.admin.liveops-controls.enabled";
167
209
  var MCP_ADMIN_ANALYTICS_FLAG_ID = "mcp.admin.analytics.enabled";
210
+ var ECONOMY_ADMIN_HISTORY_FLAG_ID = "economy.admin-history.enabled";
211
+ var MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID = "mcp.admin-economy-history.enabled";
212
+ var MCP_ADMIN_ECONOMY_READ_CAPABILITY = "admin.economy.read";
213
+ var ECONOMY_FINANCE_OPERATIONS_VIEW_CAPABILITY = "economy.finance-operations.view";
168
214
  var MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID = "mcp.admin.production-readiness.enabled";
169
215
  var MCP_ADMIN_PRODUCTION_READINESS_ENV_VAR = "MCP_ADMIN_PRODUCTION_READINESS_ENABLED";
170
216
  var MCP_ASSET_PIPELINE_FLAG_ID = "asset.pipeline.unified-ai-assets.enabled";
@@ -173,6 +219,11 @@ var MCP_ASSET_CATALOG_REQUEST_CAPABILITY = "asset.catalog.request";
173
219
  var MCP_ASSET_PIPELINE_MANAGE_CAPABILITY = "asset.pipeline.mcp.manage";
174
220
  var MCP_ASSET_SOURCE_MANAGE_CAPABILITY = "asset.source.manage";
175
221
  var MCP_ASSET_CATALOG_REVIEW_CAPABILITY = "asset.catalog.review";
222
+ var MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID = "mcp.admin-economy-adjustments.enabled";
223
+ var ECONOMY_OWNER_ADJUSTMENTS_FLAG_ID = "economy.tokens.owner-adjustments.enabled";
224
+ var MCP_ECONOMY_FINANCE_VIEW_CAPABILITY = "economy.finance-operations.view";
225
+ var MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY = "economy.finance-operations.adjust";
226
+ var MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY = "economy.finance-operations.approve-adjustment";
176
227
  var stringField = (description, options = {}) => ({
177
228
  type: "string",
178
229
  description,
@@ -240,6 +291,42 @@ var MCP_ADMIN_USER_AGGREGATION_PRESETS = [
240
291
  "usersByNotificationPreference",
241
292
  "usersByAccountAgeBand"
242
293
  ];
294
+ var MCP_ADMIN_TOKEN_ACTIVITY_TYPES = [
295
+ "acquisition",
296
+ "spend",
297
+ "reversal",
298
+ "hold",
299
+ "failure"
300
+ ];
301
+ var MCP_ADMIN_TOKEN_ACTIVITY_STATUSES = [
302
+ "pending",
303
+ "held",
304
+ "settled",
305
+ "reversed",
306
+ "failed"
307
+ ];
308
+ var MCP_ADMIN_TOKEN_WALLET_COMPONENTS = [
309
+ "household",
310
+ "personal",
311
+ "gameplay-allocation"
312
+ ];
313
+ var MCP_ADMIN_TOKEN_WALLET_STATUSES = ["active", "closed"];
314
+ var MCP_ADMIN_TOKEN_WALLET_SORTS = [
315
+ "available-desc",
316
+ "updated-at-desc"
317
+ ];
318
+ var MCP_ADMIN_TOKEN_ACTIVITY_SOURCES = [
319
+ "paid-purchase",
320
+ "subscription",
321
+ "rewarded-activity",
322
+ "gameplay",
323
+ "system-adjustment",
324
+ "unknown"
325
+ ];
326
+ var MCP_ADMIN_TOKEN_ACTIVITY_SORTS = [
327
+ "occurred-at-desc",
328
+ "amount-absolute-desc"
329
+ ];
243
330
  var MCP_ASSET_SOURCE_ADAPTERS = [
244
331
  "polyhaven",
245
332
  "kenney",
@@ -386,6 +473,276 @@ var assetOperationAcceptedOutput = {
386
473
  job: assetJobStatusField("Governed asset job created or updated by the operation."),
387
474
  nextAction: stringField("Next expected lifecycle action.", { required: false })
388
475
  };
476
+ var tokenAdjustmentOutput = {
477
+ adjustment: objectField("Audited Token adjustment state.", {
478
+ adjustmentId: stringField("Stable adjustment identifier."),
479
+ targetAccountId: stringField("Target account identifier."),
480
+ targetWalletId: stringField("Server-resolved target wallet identifier."),
481
+ targetWalletKind: stringField("Server-resolved target wallet kind.", {
482
+ enum: ["personal"]
483
+ }),
484
+ amountTokenSubunits: stringField(
485
+ "Exact positive base-10 TokenSubunit amount; 1 Token is 1,000 subunits."
486
+ ),
487
+ status: stringField("Current immutable workflow status.", {
488
+ enum: ["pending", "approved", "rejected", "executed", "failed", "expired"]
489
+ }),
490
+ previewHash: stringField("Canonical preview hash bound to the proposal."),
491
+ proposalHash: stringField("Canonical proposal hash bound to decisions."),
492
+ proposerAccountId: stringField("Stable proposing owner account identifier."),
493
+ approverAccountId: stringField("Distinct approving owner account identifier.", {
494
+ required: false
495
+ }),
496
+ createdAt: stringField("ISO-8601 proposal timestamp."),
497
+ expiresAt: stringField("ISO-8601 proposal expiry timestamp."),
498
+ transactionId: stringField("Immutable ledger transaction identifier.", {
499
+ required: false
500
+ })
501
+ })
502
+ };
503
+ var adminEconomyReadAccess = {
504
+ oauthScopes: [MCP_ACCESS_SCOPE],
505
+ capabilities: [
506
+ MCP_ADMIN_ECONOMY_READ_CAPABILITY,
507
+ ECONOMY_FINANCE_OPERATIONS_VIEW_CAPABILITY
508
+ ],
509
+ rolloutFlags: [
510
+ ECONOMY_ADMIN_HISTORY_FLAG_ID,
511
+ MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID
512
+ ],
513
+ mode: "read-only",
514
+ identityResolution: "not-available"
515
+ };
516
+ var adminTokenReportingWindowInput = {
517
+ lookbackDays: numberField(
518
+ "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.",
519
+ {
520
+ required: false,
521
+ minimum: 1,
522
+ maximum: 365,
523
+ default: 30
524
+ }
525
+ ),
526
+ fromInclusive: stringField(
527
+ "Optional inclusive ISO-8601 UTC start; the normalized interactive window cannot exceed 365 days.",
528
+ { required: false, format: "date-time" }
529
+ ),
530
+ toExclusive: stringField(
531
+ "Optional exclusive ISO-8601 UTC end; defaults to the request time.",
532
+ { required: false, format: "date-time" }
533
+ )
534
+ };
535
+ var adminTokenActivityEntryField = objectField(
536
+ "One pseudonymous Token activity row with no raw financial or identity identifiers.",
537
+ {
538
+ schemaVersion: stringField("Economy reporting contract version.", {
539
+ enum: ["1"]
540
+ }),
541
+ occurredAt: stringField("ISO-8601 UTC activity timestamp.", {
542
+ format: "date-time"
543
+ }),
544
+ activityType: stringField("Normalized Token activity type.", {
545
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_TYPES
546
+ }),
547
+ status: stringField("Normalized activity status.", {
548
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_STATUSES
549
+ }),
550
+ source: stringField(
551
+ "Provider-neutral source grouping; provider names and identifiers are excluded.",
552
+ { enum: MCP_ADMIN_TOKEN_ACTIVITY_SOURCES }
553
+ ),
554
+ amount: stringField(
555
+ "Exact signed TokenSubunit amount as a canonical base-10 integer string.",
556
+ { format: "int64-string" }
557
+ ),
558
+ safeLabel: stringField(
559
+ "Bounded source-owned display label with no account, payment, or provider metadata."
560
+ ),
561
+ rowAlias: stringField(
562
+ "Versioned audience-separated opaque alias for this reporting row.",
563
+ { format: "pseudonymous-alias" }
564
+ ),
565
+ subjectAlias: stringField(
566
+ "Versioned audience-separated opaque alias for the activity subject.",
567
+ { format: "pseudonymous-alias" }
568
+ )
569
+ }
570
+ );
571
+ var adminTokenAggregateBalancesField = objectField(
572
+ "Identifier-free exact aggregate Token balance categories.",
573
+ {
574
+ schemaVersion: stringField("Economy reporting contract version.", {
575
+ enum: ["1"]
576
+ }),
577
+ available: stringField("Exact available TokenSubunits.", {
578
+ format: "int64-string"
579
+ }),
580
+ reserved: stringField("Exact reserved TokenSubunits.", {
581
+ format: "int64-string"
582
+ }),
583
+ held: stringField("Exact held TokenSubunits.", {
584
+ format: "int64-string"
585
+ }),
586
+ rewardProgress: stringField("Exact accumulated reward TokenSubunits.", {
587
+ format: "int64-string"
588
+ })
589
+ }
590
+ );
591
+ var adminTokenAggregateLifetimeField = objectField(
592
+ "Identifier-free exact aggregate lifetime Token metrics.",
593
+ {
594
+ schemaVersion: stringField("Economy reporting contract version.", {
595
+ enum: ["1"]
596
+ }),
597
+ bought: stringField("Exact lifetime bought TokenSubunits.", {
598
+ format: "int64-string"
599
+ }),
600
+ earned: stringField("Exact lifetime earned TokenSubunits.", {
601
+ format: "int64-string"
602
+ }),
603
+ allocated: stringField("Exact lifetime allocated TokenSubunits.", {
604
+ format: "int64-string"
605
+ }),
606
+ reclaimed: stringField("Exact lifetime reclaimed TokenSubunits.", {
607
+ format: "int64-string"
608
+ }),
609
+ spent: stringField("Exact lifetime spent TokenSubunits.", {
610
+ format: "int64-string"
611
+ }),
612
+ reversed: stringField("Exact lifetime reversed TokenSubunits.", {
613
+ format: "int64-string"
614
+ })
615
+ }
616
+ );
617
+ var adminTokenWalletBalanceEntryField = objectField(
618
+ "One pseudonymous Token wallet balance with no raw account or wallet identifier.",
619
+ {
620
+ schemaVersion: stringField("Economy reporting contract version.", {
621
+ enum: ["1"]
622
+ }),
623
+ walletAlias: stringField("MCP-audience opaque wallet alias.", {
624
+ format: "pseudonymous-alias"
625
+ }),
626
+ subjectAlias: stringField("MCP-audience opaque subject alias.", {
627
+ format: "pseudonymous-alias"
628
+ }),
629
+ component: stringField("Provider-neutral wallet component.", {
630
+ enum: MCP_ADMIN_TOKEN_WALLET_COMPONENTS
631
+ }),
632
+ status: stringField("Wallet projection status.", {
633
+ enum: MCP_ADMIN_TOKEN_WALLET_STATUSES
634
+ }),
635
+ available: stringField("Exact available TokenSubunits.", {
636
+ format: "int64-string"
637
+ }),
638
+ reserved: stringField("Exact reserved TokenSubunits.", {
639
+ format: "int64-string"
640
+ }),
641
+ held: stringField("Exact held TokenSubunits.", {
642
+ format: "int64-string"
643
+ }),
644
+ rewardProgress: stringField("Exact reward-progress TokenSubunits.", {
645
+ format: "int64-string"
646
+ }),
647
+ updatedAt: stringField("UTC time of the included wallet projection.", {
648
+ format: "date-time"
649
+ }),
650
+ authoritySequence: stringField(
651
+ "Canonical positive authority sequence through which this row is current.",
652
+ { format: "uint64-string" }
653
+ )
654
+ }
655
+ );
656
+ var adminTokenAnomalyField = objectField(
657
+ "Explainable advisory indicator; it never triggers a financial mutation.",
658
+ {
659
+ method: stringField("Server-owned baseline method.", {
660
+ enum: ["same-window-median-mad-v1"]
661
+ }),
662
+ status: stringField("Advisory irregularity classification.", {
663
+ enum: ["normal", "irregular-spike"]
664
+ }),
665
+ baselineWindowCount: numberField(
666
+ "Count of preceding same-window samples used by the baseline.",
667
+ { minimum: 28, maximum: 28, default: 28 }
668
+ ),
669
+ medianAmount: stringField("Exact median signed TokenSubunit amount.", {
670
+ format: "int64-string"
671
+ }),
672
+ medianAbsoluteDeviation: stringField(
673
+ "Exact median absolute deviation in TokenSubunits.",
674
+ { format: "int64-string" }
675
+ ),
676
+ minimumAbsoluteDelta: stringField(
677
+ "Server-owned exact absolute minimum required before a spike is reported.",
678
+ { format: "int64-string" }
679
+ ),
680
+ deviationFromMedian: stringField(
681
+ "Exact signed TokenSubunit deviation from the baseline median.",
682
+ { format: "int64-string" }
683
+ ),
684
+ madMultiplierMilli: numberField(
685
+ "Fixed-point MAD multiplier where 1,000 represents one MAD.",
686
+ { minimum: 1, maximum: 1e6 }
687
+ ),
688
+ explanationCode: stringField("Stable explanation code for operator review.")
689
+ },
690
+ { required: false }
691
+ );
692
+ var adminTokenTrendPointField = objectField(
693
+ "One hourly or daily activity-type trend point.",
694
+ {
695
+ schemaVersion: stringField("Economy reporting contract version.", {
696
+ enum: ["1"]
697
+ }),
698
+ bucketStart: stringField("Inclusive aligned bucket start.", {
699
+ format: "date-time"
700
+ }),
701
+ bucketEnd: stringField("Exclusive aligned bucket end.", {
702
+ format: "date-time"
703
+ }),
704
+ activityType: stringField("Normalized Token activity type.", {
705
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_TYPES
706
+ }),
707
+ aggregate: objectField(
708
+ "Reported aggregate or a suppression marker. Suppressed points omit counts, amounts, and anomaly details.",
709
+ {
710
+ visibility: stringField("Privacy visibility state.", {
711
+ enum: ["reported", "suppressed"]
712
+ }),
713
+ reason: stringField(
714
+ "Present only when the cohort is suppressed.",
715
+ {
716
+ required: false,
717
+ enum: ["cohort-below-minimum"]
718
+ }
719
+ ),
720
+ distinctSubjects: numberField(
721
+ "Distinct pseudonymous subjects; present only for cohorts of at least five.",
722
+ { required: false, minimum: 5 }
723
+ ),
724
+ activityCount: numberField(
725
+ "Activity row count; absent for suppressed cohorts.",
726
+ { required: false, minimum: 5 }
727
+ ),
728
+ signedAmount: stringField(
729
+ "Exact aggregate signed TokenSubunits; absent for suppressed cohorts.",
730
+ { required: false, format: "int64-string" }
731
+ ),
732
+ threshold: numberField(
733
+ "Fixed minimum cohort size; present on suppression markers.",
734
+ {
735
+ required: false,
736
+ minimum: 5,
737
+ maximum: 5,
738
+ default: 5
739
+ }
740
+ )
741
+ }
742
+ ),
743
+ anomaly: adminTokenAnomalyField
744
+ }
745
+ );
389
746
  var MCP_ADMIN_ACTIONS = [
390
747
  {
391
748
  name: "listFeatureFlags",
@@ -1152,6 +1509,342 @@ var MCP_ADMIN_ACTIONS = [
1152
1509
  )
1153
1510
  }
1154
1511
  },
1512
+ {
1513
+ name: "get_admin_token_economy_overview",
1514
+ ...translatedDescription(
1515
+ mcpAdminContractDescriptionKeys.actionGetAdminTokenEconomyOverview
1516
+ ),
1517
+ domain: "economy",
1518
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
1519
+ availability: "near-future",
1520
+ access: adminEconomyReadAccess,
1521
+ execution: {
1522
+ method: "GET",
1523
+ path: "/api/mcp/economy/token-overview",
1524
+ source: "near-future-route",
1525
+ notes: [
1526
+ "The hosted site must register this descriptor as a JSON-RPC MCP tool; publishing this package does not create the runtime route.",
1527
+ "The result is an identifier-free point read of the rebuildable authoritative projection and is never derived by summing a page.",
1528
+ "The tool is read-only and cannot resolve identity or mutate a Token balance."
1529
+ ]
1530
+ },
1531
+ input: {},
1532
+ output: {
1533
+ schemaVersion: stringField("Economy reporting contract version.", {
1534
+ enum: ["1"]
1535
+ }),
1536
+ generatedAt: stringField("UTC time the response was generated.", {
1537
+ format: "date-time"
1538
+ }),
1539
+ projectionAsOf: stringField(
1540
+ "UTC time of the included global projection.",
1541
+ { format: "date-time" }
1542
+ ),
1543
+ authoritySequence: stringField(
1544
+ "Canonical positive authority sequence through which the projection is current.",
1545
+ { format: "uint64-string" }
1546
+ ),
1547
+ walletCount: numberField("Total represented Token wallets.", {
1548
+ minimum: 0
1549
+ }),
1550
+ activeWalletCount: numberField("Active represented Token wallets.", {
1551
+ minimum: 0
1552
+ }),
1553
+ balances: adminTokenAggregateBalancesField,
1554
+ lifetime: adminTokenAggregateLifetimeField,
1555
+ rawIdentifiersIncluded: booleanField(
1556
+ "Always false for this identifier-free contract.",
1557
+ { default: false }
1558
+ )
1559
+ }
1560
+ },
1561
+ {
1562
+ name: "list_admin_token_wallet_balances",
1563
+ ...translatedDescription(
1564
+ mcpAdminContractDescriptionKeys.actionListAdminTokenWalletBalances
1565
+ ),
1566
+ domain: "economy",
1567
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
1568
+ availability: "near-future",
1569
+ access: adminEconomyReadAccess,
1570
+ execution: {
1571
+ method: "GET",
1572
+ path: "/api/mcp/economy/token-wallet-balances",
1573
+ source: "near-future-route",
1574
+ notes: [
1575
+ "The hosted site must register this descriptor as a JSON-RPC MCP tool; publishing this package does not create the runtime route.",
1576
+ "Responses are private/no-store and bounded to 100 pseudonymous projection rows.",
1577
+ "Raw account, wallet, household, payment, and provider identifiers are excluded and identity resolution is unavailable."
1578
+ ]
1579
+ },
1580
+ input: {
1581
+ limit: numberField("Maximum wallet balance rows to return.", {
1582
+ required: false,
1583
+ minimum: 1,
1584
+ maximum: 100,
1585
+ default: 100
1586
+ }),
1587
+ cursor: stringField(
1588
+ "Opaque query-bound cursor returned by the preceding page.",
1589
+ { required: false, format: "opaque-cursor" }
1590
+ ),
1591
+ components: arrayField(
1592
+ "Optional provider-neutral wallet-component filters.",
1593
+ "string",
1594
+ {
1595
+ required: false,
1596
+ enum: MCP_ADMIN_TOKEN_WALLET_COMPONENTS,
1597
+ maxItems: MCP_ADMIN_TOKEN_WALLET_COMPONENTS.length
1598
+ }
1599
+ ),
1600
+ statuses: arrayField("Optional wallet-status filters.", "string", {
1601
+ required: false,
1602
+ enum: MCP_ADMIN_TOKEN_WALLET_STATUSES,
1603
+ maxItems: MCP_ADMIN_TOKEN_WALLET_STATUSES.length
1604
+ }),
1605
+ subjectAlias: stringField(
1606
+ "Optional exact MCP-audience subject alias; raw account identifiers are not accepted.",
1607
+ { required: false, format: "pseudonymous-alias" }
1608
+ ),
1609
+ sort: stringField("Allowlisted stable wallet sort.", {
1610
+ required: false,
1611
+ enum: MCP_ADMIN_TOKEN_WALLET_SORTS,
1612
+ default: "available-desc"
1613
+ })
1614
+ },
1615
+ output: {
1616
+ schemaVersion: stringField("Economy reporting contract version.", {
1617
+ enum: ["1"]
1618
+ }),
1619
+ items: arrayField(
1620
+ "Pseudonymous wallet balances without raw account, wallet, household, payment, or provider identifiers.",
1621
+ "AdminTokenWalletBalanceEntryV1",
1622
+ {
1623
+ items: adminTokenWalletBalanceEntryField,
1624
+ maxItems: 100
1625
+ }
1626
+ ),
1627
+ hasMore: booleanField("Whether another bounded page exists."),
1628
+ nextCursor: stringField("Opaque cursor for the next page.", {
1629
+ required: false,
1630
+ format: "opaque-cursor"
1631
+ }),
1632
+ metadata: objectField("Privacy and normalized wallet query metadata.", {
1633
+ schemaVersion: stringField("Economy reporting contract version.", {
1634
+ enum: ["1"]
1635
+ }),
1636
+ generatedAt: stringField("UTC time the result was generated.", {
1637
+ format: "date-time"
1638
+ }),
1639
+ sort: stringField("Applied stable sort.", {
1640
+ enum: MCP_ADMIN_TOKEN_WALLET_SORTS
1641
+ }),
1642
+ pageLimit: numberField("Applied page bound.", {
1643
+ minimum: 1,
1644
+ maximum: 100
1645
+ }),
1646
+ audience: stringField("Pseudonym audience fixed by the MCP endpoint.", {
1647
+ enum: ["mcp-token-balances"]
1648
+ }),
1649
+ pseudonymVersion: stringField("Active opaque pseudonym key version."),
1650
+ rawIdentifiersIncluded: booleanField(
1651
+ "Always false for this public-safe contract.",
1652
+ { default: false }
1653
+ )
1654
+ })
1655
+ }
1656
+ },
1657
+ {
1658
+ name: "list_admin_token_activity",
1659
+ ...translatedDescription(
1660
+ mcpAdminContractDescriptionKeys.actionListAdminTokenActivity
1661
+ ),
1662
+ domain: "economy",
1663
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
1664
+ availability: "near-future",
1665
+ access: adminEconomyReadAccess,
1666
+ execution: {
1667
+ method: "GET",
1668
+ path: "/api/mcp/economy/token-activity",
1669
+ source: "near-future-route",
1670
+ notes: [
1671
+ "The hosted site must register this descriptor as a JSON-RPC MCP tool; publishing this package does not create the runtime route.",
1672
+ "Responses are private/no-store, bounded to 100 rows, and contain only audience-separated pseudonyms plus source-owned labels.",
1673
+ "The tool is read-only and cannot resolve a pseudonym or mutate a financial record."
1674
+ ]
1675
+ },
1676
+ input: {
1677
+ ...adminTokenReportingWindowInput,
1678
+ limit: numberField("Maximum activity rows to return.", {
1679
+ required: false,
1680
+ minimum: 1,
1681
+ maximum: 100,
1682
+ default: 100
1683
+ }),
1684
+ cursor: stringField(
1685
+ "Opaque query-bound cursor returned by the preceding page.",
1686
+ { required: false, format: "opaque-cursor" }
1687
+ ),
1688
+ activityTypes: arrayField(
1689
+ "Optional allowlisted activity-type filters.",
1690
+ "string",
1691
+ {
1692
+ required: false,
1693
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_TYPES,
1694
+ maxItems: MCP_ADMIN_TOKEN_ACTIVITY_TYPES.length
1695
+ }
1696
+ ),
1697
+ statuses: arrayField("Optional allowlisted activity-status filters.", "string", {
1698
+ required: false,
1699
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_STATUSES,
1700
+ maxItems: MCP_ADMIN_TOKEN_ACTIVITY_STATUSES.length
1701
+ }),
1702
+ sources: arrayField(
1703
+ "Optional provider-neutral source-group filters.",
1704
+ "string",
1705
+ {
1706
+ required: false,
1707
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_SOURCES,
1708
+ maxItems: MCP_ADMIN_TOKEN_ACTIVITY_SOURCES.length
1709
+ }
1710
+ ),
1711
+ subjectAlias: stringField(
1712
+ "Optional exact MCP-audience subject alias; raw account identifiers are not accepted.",
1713
+ { required: false, format: "pseudonymous-alias" }
1714
+ ),
1715
+ sort: stringField("Allowlisted stable sort.", {
1716
+ required: false,
1717
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_SORTS,
1718
+ default: "occurred-at-desc"
1719
+ })
1720
+ },
1721
+ output: {
1722
+ schemaVersion: stringField("Economy reporting contract version.", {
1723
+ enum: ["1"]
1724
+ }),
1725
+ items: arrayField(
1726
+ "Pseudonymous activity rows; no account, wallet, transaction, order, payment, provider-event, idempotency, or journal-integrity identifiers.",
1727
+ "AdminTokenActivityEntryV1",
1728
+ {
1729
+ items: adminTokenActivityEntryField,
1730
+ maxItems: 100
1731
+ }
1732
+ ),
1733
+ hasMore: booleanField("Whether another bounded page exists."),
1734
+ nextCursor: stringField("Opaque cursor for the next page.", {
1735
+ required: false,
1736
+ format: "opaque-cursor"
1737
+ }),
1738
+ metadata: objectField("Privacy and normalized query metadata.", {
1739
+ schemaVersion: stringField("Economy reporting contract version.", {
1740
+ enum: ["1"]
1741
+ }),
1742
+ generatedAt: stringField("UTC time the result was generated.", {
1743
+ format: "date-time"
1744
+ }),
1745
+ fromInclusive: stringField("Normalized inclusive UTC window start.", {
1746
+ format: "date-time"
1747
+ }),
1748
+ toExclusive: stringField("Normalized exclusive UTC window end.", {
1749
+ format: "date-time"
1750
+ }),
1751
+ sort: stringField("Applied stable sort.", {
1752
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_SORTS
1753
+ }),
1754
+ pageLimit: numberField("Applied page bound.", {
1755
+ minimum: 1,
1756
+ maximum: 100
1757
+ }),
1758
+ audience: stringField("Pseudonym audience fixed by the MCP endpoint.", {
1759
+ enum: ["mcp-token-activity"]
1760
+ }),
1761
+ pseudonymVersion: stringField("Active opaque pseudonym key version."),
1762
+ rawIdentifiersIncluded: booleanField(
1763
+ "Always false for this public-safe contract.",
1764
+ { default: false }
1765
+ )
1766
+ })
1767
+ }
1768
+ },
1769
+ {
1770
+ name: "get_admin_token_trends",
1771
+ ...translatedDescription(
1772
+ mcpAdminContractDescriptionKeys.actionGetAdminTokenTrends
1773
+ ),
1774
+ domain: "economy",
1775
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
1776
+ availability: "near-future",
1777
+ access: adminEconomyReadAccess,
1778
+ execution: {
1779
+ method: "GET",
1780
+ path: "/api/mcp/economy/token-trends",
1781
+ source: "near-future-route",
1782
+ notes: [
1783
+ "The hosted site must register this descriptor as a JSON-RPC MCP tool; publishing this package does not create the runtime route.",
1784
+ "Cohorts below five are suppression markers with no counts, amounts, aliases, or anomaly details.",
1785
+ "Anomalies are explainable review signals and never mutate financial records."
1786
+ ]
1787
+ },
1788
+ input: {
1789
+ ...adminTokenReportingWindowInput,
1790
+ granularity: stringField("Hourly or daily UTC aggregation.", {
1791
+ required: false,
1792
+ enum: ["hour", "day"],
1793
+ default: "day"
1794
+ }),
1795
+ activityTypes: arrayField(
1796
+ "Optional allowlisted trend activity types.",
1797
+ "string",
1798
+ {
1799
+ required: false,
1800
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_TYPES,
1801
+ maxItems: MCP_ADMIN_TOKEN_ACTIVITY_TYPES.length
1802
+ }
1803
+ )
1804
+ },
1805
+ output: {
1806
+ schemaVersion: stringField("Economy reporting contract version.", {
1807
+ enum: ["1"]
1808
+ }),
1809
+ series: arrayField(
1810
+ "Bounded, stably ordered trend points.",
1811
+ "AdminTokenTrendPointV1",
1812
+ {
1813
+ items: adminTokenTrendPointField,
1814
+ maxItems: 1e3
1815
+ }
1816
+ ),
1817
+ metadata: objectField("Trend privacy and baseline metadata.", {
1818
+ schemaVersion: stringField("Economy reporting contract version.", {
1819
+ enum: ["1"]
1820
+ }),
1821
+ generatedAt: stringField("UTC time the result was generated.", {
1822
+ format: "date-time"
1823
+ }),
1824
+ fromInclusive: stringField("Normalized inclusive UTC window start.", {
1825
+ format: "date-time"
1826
+ }),
1827
+ toExclusive: stringField("Normalized exclusive UTC window end.", {
1828
+ format: "date-time"
1829
+ }),
1830
+ granularity: stringField("Applied UTC aggregation granularity.", {
1831
+ enum: ["hour", "day"]
1832
+ }),
1833
+ minimumCohortSize: numberField(
1834
+ "Fixed minimum distinct-subject cohort before aggregate disclosure.",
1835
+ { minimum: 5, maximum: 5, default: 5 }
1836
+ ),
1837
+ anomalyBaselineDays: numberField(
1838
+ "Fixed same-window median/MAD baseline length.",
1839
+ { minimum: 28, maximum: 28, default: 28 }
1840
+ ),
1841
+ rawIdentifiersIncluded: booleanField(
1842
+ "Always false for this public-safe contract.",
1843
+ { default: false }
1844
+ )
1845
+ })
1846
+ }
1847
+ },
1155
1848
  {
1156
1849
  name: "searchAssetCatalog",
1157
1850
  ...translatedDescription(mcpAdminContractDescriptionKeys.actionSearchAssetCatalog),
@@ -1482,6 +2175,254 @@ var MCP_ADMIN_ACTIONS = [
1482
2175
  plannedOperations: arrayField("Processing or review operations planned for the job.", "string"),
1483
2176
  evidence: arrayField("Review and processing evidence references available to the caller.", "AssetEvidence")
1484
2177
  }
2178
+ },
2179
+ {
2180
+ name: "getUserTokenWallet",
2181
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionGetUserTokenWallet),
2182
+ domain: "economyAdjustments",
2183
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2184
+ availability: "near-future",
2185
+ requiredCapability: MCP_ECONOMY_FINANCE_VIEW_CAPABILITY,
2186
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_VIEW_CAPABILITY],
2187
+ execution: {
2188
+ method: "GET",
2189
+ path: "/api/mcp/economy/users/{accountId}/wallet",
2190
+ source: "near-future-route",
2191
+ notes: [
2192
+ "The backend resolves the personal wallet from the account id; callers cannot select an arbitrary wallet."
2193
+ ]
2194
+ },
2195
+ input: {
2196
+ accountId: stringField("Stable target account identifier.", { required: true })
2197
+ },
2198
+ output: {
2199
+ wallet: objectField("Authorized Token wallet summary.", {
2200
+ accountId: stringField("Stable target account identifier."),
2201
+ initialized: booleanField(
2202
+ "Whether the authoritative personal wallet has been initialized."
2203
+ ),
2204
+ walletId: stringField("Server-resolved wallet identifier.", {
2205
+ required: false
2206
+ }),
2207
+ walletKind: stringField("Server-resolved wallet kind.", { enum: ["personal"] }),
2208
+ availableTokenSubunits: stringField("Exact available TokenSubunits as base-10 text."),
2209
+ heldTokenSubunits: stringField("Exact held TokenSubunits as base-10 text."),
2210
+ lifetimeCreditedTokenSubunits: stringField(
2211
+ "Exact lifetime credited TokenSubunits as base-10 text."
2212
+ ),
2213
+ lifetimeReversedTokenSubunits: stringField(
2214
+ "Exact lifetime reversed TokenSubunits as base-10 text."
2215
+ ),
2216
+ projectionVersion: stringField("Optimistic concurrency projection version.", {
2217
+ required: false
2218
+ })
2219
+ })
2220
+ }
2221
+ },
2222
+ {
2223
+ name: "listUserTokenActivity",
2224
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionListUserTokenActivity),
2225
+ domain: "economyAdjustments",
2226
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2227
+ availability: "near-future",
2228
+ requiredCapability: MCP_ECONOMY_FINANCE_VIEW_CAPABILITY,
2229
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_VIEW_CAPABILITY],
2230
+ execution: {
2231
+ method: "GET",
2232
+ path: "/api/mcp/economy/users/{accountId}/activity",
2233
+ source: "near-future-route"
2234
+ },
2235
+ input: {
2236
+ accountId: stringField("Stable target account identifier.", { required: true }),
2237
+ cursor: stringField("Opaque continuation cursor.", { required: false }),
2238
+ limit: numberField("Maximum results; the backend applies a bounded ceiling.", {
2239
+ required: false
2240
+ })
2241
+ },
2242
+ output: {
2243
+ items: arrayField("Immutable Token activity entries.", "WalletActivityEntryV1"),
2244
+ nextCursor: stringField("Opaque cursor for the next page.", { required: false })
2245
+ }
2246
+ },
2247
+ {
2248
+ name: "listTokenAdjustments",
2249
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionListTokenAdjustments),
2250
+ domain: "economyAdjustments",
2251
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2252
+ availability: "near-future",
2253
+ requiredCapability: MCP_ECONOMY_FINANCE_VIEW_CAPABILITY,
2254
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_VIEW_CAPABILITY],
2255
+ execution: {
2256
+ method: "GET",
2257
+ path: "/api/mcp/economy/adjustments",
2258
+ source: "near-future-route"
2259
+ },
2260
+ input: {
2261
+ targetAccountId: stringField("Optional target account filter.", { required: false }),
2262
+ status: stringField("Optional workflow status filter.", {
2263
+ required: false,
2264
+ enum: ["pending", "approved", "rejected", "executed", "failed", "expired"]
2265
+ }),
2266
+ cursor: stringField("Opaque continuation cursor.", { required: false }),
2267
+ limit: numberField("Maximum results; the backend applies a bounded ceiling.", {
2268
+ required: false
2269
+ })
2270
+ },
2271
+ output: {
2272
+ items: arrayField("Audited adjustment workflow records.", "OperatorAdjustmentProposalV1"),
2273
+ nextCursor: stringField("Opaque cursor for the next page.", { required: false })
2274
+ }
2275
+ },
2276
+ {
2277
+ name: "proposeTokenCredit",
2278
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionProposeTokenCredit),
2279
+ domain: "economyAdjustments",
2280
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2281
+ availability: "near-future",
2282
+ requiredCapability: MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY,
2283
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY],
2284
+ execution: {
2285
+ method: "POST",
2286
+ path: "/api/mcp/economy/adjustments/token-credits",
2287
+ source: "near-future-route",
2288
+ notes: [
2289
+ "This creates a preview-bound proposal only; it does not credit the wallet until a distinct owner approves it.",
2290
+ "Raw idempotency keys and ticket references are fingerprinted before authoritative persistence."
2291
+ ]
2292
+ },
2293
+ input: {
2294
+ targetAccountId: stringField("Stable target account identifier.", { required: true }),
2295
+ targetWalletKind: stringField("Permitted server-resolved wallet kind.", {
2296
+ required: true,
2297
+ enum: ["personal"]
2298
+ }),
2299
+ amountTokenSubunits: stringField(
2300
+ "Exact positive base-10 TokenSubunit amount; 1 Token is 1,000 subunits.",
2301
+ { required: true }
2302
+ ),
2303
+ reasonCode: stringField("Allowlisted operator reason code.", { required: true }),
2304
+ ticketReference: stringField("Support or change ticket reference.", { required: true }),
2305
+ idempotencyKey: stringField("Caller-generated idempotency key.", { required: true })
2306
+ },
2307
+ output: tokenAdjustmentOutput,
2308
+ verification: {
2309
+ method: "GET",
2310
+ path: "/api/mcp/economy/adjustments",
2311
+ query: ["adjustmentId={adjustmentId}"],
2312
+ ...translatedDescription(
2313
+ mcpAdminContractDescriptionKeys.verificationTokenAdjustment
2314
+ )
2315
+ }
2316
+ },
2317
+ {
2318
+ name: "approveTokenCredit",
2319
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionApproveTokenCredit),
2320
+ domain: "economyAdjustments",
2321
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2322
+ availability: "near-future",
2323
+ requiredCapability: MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY,
2324
+ requiredTokenScopes: [
2325
+ "mcp:access",
2326
+ MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY
2327
+ ],
2328
+ execution: {
2329
+ method: "POST",
2330
+ path: "/api/mcp/economy/adjustments/{adjustmentId}/approve",
2331
+ source: "near-future-route",
2332
+ notes: [
2333
+ "The authenticated approver must be a different stable platform-owner account from the proposer."
2334
+ ]
2335
+ },
2336
+ input: {
2337
+ adjustmentId: stringField("Stable pending adjustment identifier.", { required: true }),
2338
+ expectedPreviewHash: stringField("Preview hash displayed to the approver.", {
2339
+ required: true
2340
+ }),
2341
+ expectedProposalHash: stringField("Proposal hash displayed to the approver.", {
2342
+ required: true
2343
+ }),
2344
+ idempotencyKey: stringField("Caller-generated idempotency key.", { required: true })
2345
+ },
2346
+ output: tokenAdjustmentOutput,
2347
+ verification: {
2348
+ method: "GET",
2349
+ path: "/api/mcp/economy/adjustments",
2350
+ query: ["adjustmentId={adjustmentId}"],
2351
+ ...translatedDescription(
2352
+ mcpAdminContractDescriptionKeys.verificationTokenAdjustment
2353
+ )
2354
+ }
2355
+ },
2356
+ {
2357
+ name: "rejectTokenCredit",
2358
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionRejectTokenCredit),
2359
+ domain: "economyAdjustments",
2360
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2361
+ availability: "near-future",
2362
+ requiredCapability: MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY,
2363
+ requiredTokenScopes: [
2364
+ "mcp:access",
2365
+ MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY
2366
+ ],
2367
+ execution: {
2368
+ method: "POST",
2369
+ path: "/api/mcp/economy/adjustments/{adjustmentId}/reject",
2370
+ source: "near-future-route"
2371
+ },
2372
+ input: {
2373
+ adjustmentId: stringField("Stable pending adjustment identifier.", { required: true }),
2374
+ expectedPreviewHash: stringField("Preview hash displayed to the approver.", {
2375
+ required: true
2376
+ }),
2377
+ expectedProposalHash: stringField("Proposal hash displayed to the approver.", {
2378
+ required: true
2379
+ }),
2380
+ reasonCode: stringField("Allowlisted rejection reason code.", { required: true }),
2381
+ idempotencyKey: stringField("Caller-generated idempotency key.", { required: true })
2382
+ },
2383
+ output: tokenAdjustmentOutput,
2384
+ verification: {
2385
+ method: "GET",
2386
+ path: "/api/mcp/economy/adjustments",
2387
+ query: ["adjustmentId={adjustmentId}"],
2388
+ ...translatedDescription(
2389
+ mcpAdminContractDescriptionKeys.verificationTokenAdjustment
2390
+ )
2391
+ }
2392
+ },
2393
+ {
2394
+ name: "reverseTokenCredit",
2395
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionReverseTokenCredit),
2396
+ domain: "economyAdjustments",
2397
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2398
+ availability: "near-future",
2399
+ requiredCapability: MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY,
2400
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY],
2401
+ execution: {
2402
+ method: "POST",
2403
+ path: "/api/mcp/economy/adjustments/{adjustmentId}/reverse",
2404
+ source: "near-future-route",
2405
+ notes: [
2406
+ "A reversal is a separately approved compensating transaction; the original credit is never updated or deleted."
2407
+ ]
2408
+ },
2409
+ input: {
2410
+ originalAdjustmentId: stringField("Executed credit adjustment to reverse.", {
2411
+ required: true
2412
+ }),
2413
+ reasonCode: stringField("Allowlisted reversal reason code.", { required: true }),
2414
+ ticketReference: stringField("Support or change ticket reference.", { required: true }),
2415
+ idempotencyKey: stringField("Caller-generated idempotency key.", { required: true })
2416
+ },
2417
+ output: tokenAdjustmentOutput,
2418
+ verification: {
2419
+ method: "GET",
2420
+ path: "/api/mcp/economy/adjustments",
2421
+ query: ["adjustmentId={adjustmentId}"],
2422
+ ...translatedDescription(
2423
+ mcpAdminContractDescriptionKeys.verificationTokenAdjustment
2424
+ )
2425
+ }
1485
2426
  }
1486
2427
  ];
1487
2428
  function listMcpActionSummaries() {
@@ -1493,7 +2434,10 @@ function listMcpActionSummaries() {
1493
2434
  domain: action.domain,
1494
2435
  rolloutFlag: action.rolloutFlag,
1495
2436
  availability: action.availability,
1496
- execution: action.execution
2437
+ execution: action.execution,
2438
+ requiredCapability: action.requiredCapability,
2439
+ requiredTokenScopes: action.requiredTokenScopes,
2440
+ access: action.access
1497
2441
  }));
1498
2442
  }
1499
2443
  var MCP_ADMIN_CONTEXT_SHAPE = {
@@ -1537,7 +2481,8 @@ var MCP_ADMIN_EXTENSION_RULES = {
1537
2481
  singleResourceMutations: true,
1538
2482
  notes: [
1539
2483
  "Future game/admin asset actions must reuse the same descriptor shape instead of adding a second discovery contract.",
1540
- "New descriptors must define rolloutFlag, execution mapping, input shape, output shape, and verification notes where applicable."
2484
+ "New descriptors must define rolloutFlag, execution mapping, input shape, output shape, and verification notes where applicable.",
2485
+ "Sensitive read descriptors must publish their OAuth scope, capability, rollout, read-only, and identity-resolution metadata without treating discovery as authorization."
1541
2486
  ]
1542
2487
  };
1543
2488
  function buildMcpSurfaceUrls(origin) {
@@ -1574,7 +2519,7 @@ function buildAiPluginManifest(origin) {
1574
2519
  client_url: `${urls.apiBaseUrl}/login`,
1575
2520
  authorization_url: `${urls.apiBaseUrl}/oauth/authorize`,
1576
2521
  token_url: `${urls.apiBaseUrl}/oauth/token`,
1577
- scope: "openid email profile",
2522
+ scope: `openid email profile ${MCP_ACCESS_SCOPE}`,
1578
2523
  authorization_content_type: "application/x-www-form-urlencoded",
1579
2524
  instructions: "Sign in with an admin-capable Google or Microsoft account to access the Plasius MCP control plane."
1580
2525
  }
@@ -1598,6 +2543,9 @@ function buildMcpSchemaResponse() {
1598
2543
  execution: action.execution,
1599
2544
  input: action.input,
1600
2545
  output: action.output,
2546
+ requiredCapability: action.requiredCapability,
2547
+ requiredTokenScopes: action.requiredTokenScopes,
2548
+ access: action.access,
1601
2549
  verification: action.verification
1602
2550
  }
1603
2551
  ])
@@ -1642,6 +2590,11 @@ function buildMcpActionFamilies() {
1642
2590
  rolloutFlag: MCP_ADMIN_ANALYTICS_FLAG_ID,
1643
2591
  actions: getActionsByDomain("userAggregation")
1644
2592
  },
2593
+ {
2594
+ domain: "economy",
2595
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
2596
+ actions: getActionsByDomain("economy")
2597
+ },
1645
2598
  {
1646
2599
  domain: "assetCatalog",
1647
2600
  rolloutFlag: MCP_ASSET_PIPELINE_FLAG_ID,
@@ -1662,6 +2615,11 @@ function buildMcpActionFamilies() {
1662
2615
  rolloutFlag: MCP_ASSET_PIPELINE_FLAG_ID,
1663
2616
  actions: getActionsByDomain("assetReview")
1664
2617
  },
2618
+ {
2619
+ domain: "economyAdjustments",
2620
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2621
+ actions: getActionsByDomain("economyAdjustments")
2622
+ },
1665
2623
  {
1666
2624
  domain: "productionReadiness",
1667
2625
  rolloutFlag: MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID,
@@ -1697,6 +2655,10 @@ function normalizeOptionalString(value) {
1697
2655
  }
1698
2656
  // Annotate the CommonJS export names for ESM import in node:
1699
2657
  0 && (module.exports = {
2658
+ ECONOMY_ADMIN_HISTORY_FLAG_ID,
2659
+ ECONOMY_FINANCE_OPERATIONS_VIEW_CAPABILITY,
2660
+ ECONOMY_OWNER_ADJUSTMENTS_FLAG_ID,
2661
+ MCP_ACCESS_SCOPE,
1700
2662
  MCP_ADMIN_ACTIONS,
1701
2663
  MCP_ADMIN_ANALYTICS_DIMENSIONS,
1702
2664
  MCP_ADMIN_ANALYTICS_FLAG_ID,
@@ -1704,6 +2666,9 @@ function normalizeOptionalString(value) {
1704
2666
  MCP_ADMIN_ANALYTICS_PRESETS,
1705
2667
  MCP_ADMIN_CONTEXT_SHAPE,
1706
2668
  MCP_ADMIN_CONTRACT_VERSION,
2669
+ MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2670
+ MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
2671
+ MCP_ADMIN_ECONOMY_READ_CAPABILITY,
1707
2672
  MCP_ADMIN_EXTENSION_RULES,
1708
2673
  MCP_ADMIN_FOUNDATION_DISABLED_CODE,
1709
2674
  MCP_ADMIN_FOUNDATION_ENV_VAR,
@@ -1712,6 +2677,13 @@ function normalizeOptionalString(value) {
1712
2677
  MCP_ADMIN_PRODUCTION_READINESS_ENV_VAR,
1713
2678
  MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID,
1714
2679
  MCP_ADMIN_REGISTRY_SOURCE,
2680
+ MCP_ADMIN_TOKEN_ACTIVITY_SORTS,
2681
+ MCP_ADMIN_TOKEN_ACTIVITY_SOURCES,
2682
+ MCP_ADMIN_TOKEN_ACTIVITY_STATUSES,
2683
+ MCP_ADMIN_TOKEN_ACTIVITY_TYPES,
2684
+ MCP_ADMIN_TOKEN_WALLET_COMPONENTS,
2685
+ MCP_ADMIN_TOKEN_WALLET_SORTS,
2686
+ MCP_ADMIN_TOKEN_WALLET_STATUSES,
1715
2687
  MCP_ADMIN_USER_AGGREGATION_DIMENSIONS,
1716
2688
  MCP_ADMIN_USER_AGGREGATION_METRICS,
1717
2689
  MCP_ADMIN_USER_AGGREGATION_PRESETS,
@@ -1725,6 +2697,9 @@ function normalizeOptionalString(value) {
1725
2697
  MCP_ASSET_SOURCE_ADAPTERS,
1726
2698
  MCP_ASSET_SOURCE_MANAGE_CAPABILITY,
1727
2699
  MCP_ASSET_SOURCE_TIERS,
2700
+ MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY,
2701
+ MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY,
2702
+ MCP_ECONOMY_FINANCE_VIEW_CAPABILITY,
1728
2703
  buildAiPluginManifest,
1729
2704
  buildMcpContextResponse,
1730
2705
  buildMcpDiscoveryResponse,