@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.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/translations/en-GB.ts
2
2
  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.",
3
+ "mcpAdminContracts.manifest.descriptionForModel": "OAuth-protected MCP discovery manifest for the Plasius admin control plane covering feature flags, capabilities, analytics, pseudonymous Token finance reads, and audit-backed operations.",
4
+ "mcpAdminContracts.manifest.description": "Authenticated admin MCP discovery for the Plasius feature flag, capability, analytics, pseudonymous Token reporting, and audit control plane.",
5
5
  "mcpAdminContracts.action.listFeatureFlags.description": "List existing feature flags from the admin rollout control plane.",
6
6
  "mcpAdminContracts.action.getFeatureFlag.description": "Fetch one feature flag by stable key.",
7
7
  "mcpAdminContracts.action.updateFeatureFlag.description": "Patch an existing feature flag without bypassing the current admin update semantics.",
@@ -21,6 +21,10 @@ var mcpAdminContractsEnGbTranslations = {
21
21
  "mcpAdminContracts.action.listAggregationDimensions.description": "List the approved user-aggregation dimensions from the MCP whitelist.",
22
22
  "mcpAdminContracts.action.aggregateUsers.description": "Run grouped user aggregation over the bounded admin user data surface.",
23
23
  "mcpAdminContracts.action.aggregateUsersByPreset.description": "Run a curated user-aggregation preset against the bounded aggregation route.",
24
+ "mcpAdminContracts.action.listAdminTokenActivity.description": "List bounded pseudonymous Token activity after re-checking MCP scope, finance capabilities, and stored rollout flags.",
25
+ "mcpAdminContracts.action.getAdminTokenEconomyOverview.description": "Read the identifier-free global Token balance, lifetime totals, wallet counts, and authoritative projection freshness.",
26
+ "mcpAdminContracts.action.listAdminTokenWalletBalances.description": "List bounded pseudonymous Token wallet balances without exposing account, payment, provider, or raw wallet identifiers.",
27
+ "mcpAdminContracts.action.getAdminTokenTrends.description": "Read privacy-suppressed Token acquisition and usage trends with explainable advisory anomaly indicators.",
24
28
  "mcpAdminContracts.action.searchAssetCatalog.description": "Search promoted asset catalog records without live third-party lookup.",
25
29
  "mcpAdminContracts.action.getAssetManifest.description": "Fetch a promoted player-safe runtime asset manifest reference.",
26
30
  "mcpAdminContracts.action.requestAsset.description": "Queue a governed missing-asset request when no promoted catalog match exists.",
@@ -34,13 +38,21 @@ var mcpAdminContractsEnGbTranslations = {
34
38
  "mcpAdminContracts.action.promoteAsset.description": "Promote an approved asset candidate to an immutable runtime manifest reference.",
35
39
  "mcpAdminContracts.action.rollbackAsset.description": "Rollback an asset runtime channel to a previous promoted manifest version.",
36
40
  "mcpAdminContracts.action.getAssetJobStatus.description": "Read governed asset job status, planned processing work, and evidence references.",
41
+ "mcpAdminContracts.action.getUserTokenWallet.description": "Read an account's server-resolved Token wallet summary without exposing provider or payment data.",
42
+ "mcpAdminContracts.action.listUserTokenActivity.description": "Read a bounded, cursor-paginated Token activity history for one account.",
43
+ "mcpAdminContracts.action.listTokenAdjustments.description": "List audited Token adjustment proposals and their approval state.",
44
+ "mcpAdminContracts.action.proposeTokenCredit.description": "Propose a positive Token credit for a server-resolved personal wallet; a distinct owner must approve it.",
45
+ "mcpAdminContracts.action.approveTokenCredit.description": "Approve a preview-bound Token credit proposed by a different owner.",
46
+ "mcpAdminContracts.action.rejectTokenCredit.description": "Reject a pending Token credit without mutating the wallet.",
47
+ "mcpAdminContracts.action.reverseTokenCredit.description": "Propose an immutable compensating reversal of an earlier owner Token credit.",
37
48
  "mcpAdminContracts.verification.enableFeatureFlag.description": "Use admin audit history to verify the rollout change.",
38
49
  "mcpAdminContracts.verification.disableFeatureFlag.description": "Use admin audit history to verify the rollout change.",
39
50
  "mcpAdminContracts.verification.assignCapability.description": "Use admin audit history to verify the stored rule written by the capability assignment.",
40
51
  "mcpAdminContracts.verification.unassignCapability.description": "Use admin audit history to verify capability-rule deletion.",
41
52
  "mcpAdminContracts.verification.updateCapability.description": "Use admin audit history to verify the stored rule updated by the capability mutation.",
42
53
  "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."
54
+ "mcpAdminContracts.verification.rollbackAsset.description": "Use asset promotion history and admin audit events to verify the runtime channel rollback.",
55
+ "mcpAdminContracts.verification.tokenAdjustment.description": "Read the adjustment and Token activity history to verify its immutable proposal, decision, and ledger result."
44
56
  };
45
57
 
46
58
  // src/i18n.ts
@@ -66,6 +78,10 @@ var mcpAdminContractDescriptionKeys = {
66
78
  actionListAggregationDimensions: "mcpAdminContracts.action.listAggregationDimensions.description",
67
79
  actionAggregateUsers: "mcpAdminContracts.action.aggregateUsers.description",
68
80
  actionAggregateUsersByPreset: "mcpAdminContracts.action.aggregateUsersByPreset.description",
81
+ actionListAdminTokenActivity: "mcpAdminContracts.action.listAdminTokenActivity.description",
82
+ actionGetAdminTokenEconomyOverview: "mcpAdminContracts.action.getAdminTokenEconomyOverview.description",
83
+ actionListAdminTokenWalletBalances: "mcpAdminContracts.action.listAdminTokenWalletBalances.description",
84
+ actionGetAdminTokenTrends: "mcpAdminContracts.action.getAdminTokenTrends.description",
69
85
  actionSearchAssetCatalog: "mcpAdminContracts.action.searchAssetCatalog.description",
70
86
  actionGetAssetManifest: "mcpAdminContracts.action.getAssetManifest.description",
71
87
  actionRequestAsset: "mcpAdminContracts.action.requestAsset.description",
@@ -79,13 +95,21 @@ var mcpAdminContractDescriptionKeys = {
79
95
  actionPromoteAsset: "mcpAdminContracts.action.promoteAsset.description",
80
96
  actionRollbackAsset: "mcpAdminContracts.action.rollbackAsset.description",
81
97
  actionGetAssetJobStatus: "mcpAdminContracts.action.getAssetJobStatus.description",
98
+ actionGetUserTokenWallet: "mcpAdminContracts.action.getUserTokenWallet.description",
99
+ actionListUserTokenActivity: "mcpAdminContracts.action.listUserTokenActivity.description",
100
+ actionListTokenAdjustments: "mcpAdminContracts.action.listTokenAdjustments.description",
101
+ actionProposeTokenCredit: "mcpAdminContracts.action.proposeTokenCredit.description",
102
+ actionApproveTokenCredit: "mcpAdminContracts.action.approveTokenCredit.description",
103
+ actionRejectTokenCredit: "mcpAdminContracts.action.rejectTokenCredit.description",
104
+ actionReverseTokenCredit: "mcpAdminContracts.action.reverseTokenCredit.description",
82
105
  verificationEnableFeatureFlag: "mcpAdminContracts.verification.enableFeatureFlag.description",
83
106
  verificationDisableFeatureFlag: "mcpAdminContracts.verification.disableFeatureFlag.description",
84
107
  verificationAssignCapability: "mcpAdminContracts.verification.assignCapability.description",
85
108
  verificationUnassignCapability: "mcpAdminContracts.verification.unassignCapability.description",
86
109
  verificationUpdateCapability: "mcpAdminContracts.verification.updateCapability.description",
87
110
  verificationPromoteAsset: "mcpAdminContracts.verification.promoteAsset.description",
88
- verificationRollbackAsset: "mcpAdminContracts.verification.rollbackAsset.description"
111
+ verificationRollbackAsset: "mcpAdminContracts.verification.rollbackAsset.description",
112
+ verificationTokenAdjustment: "mcpAdminContracts.verification.tokenAdjustment.description"
89
113
  };
90
114
  var mcpAdminContractsTranslations = {
91
115
  "en-GB": mcpAdminContractsEnGbTranslations
@@ -95,13 +119,18 @@ function getMcpAdminContractDefaultTranslation(key) {
95
119
  }
96
120
 
97
121
  // src/index.ts
98
- var MCP_ADMIN_CONTRACT_VERSION = "2026-04-28.v3";
122
+ var MCP_ADMIN_CONTRACT_VERSION = "2026-08-08.v5";
99
123
  var MCP_ADMIN_REGISTRY_SOURCE = "@plasius/mcp-admin-contracts";
100
124
  var MCP_ADMIN_FOUNDATION_FLAG_ID = "mcp.admin.foundation.enabled";
125
+ var MCP_ACCESS_SCOPE = "mcp:access";
101
126
  var MCP_ADMIN_FOUNDATION_ENV_VAR = "MCP_ADMIN_FOUNDATION_ENABLED";
102
127
  var MCP_ADMIN_FOUNDATION_DISABLED_CODE = "MCP_ADMIN_FOUNDATION_DISABLED";
103
128
  var MCP_ADMIN_LIVEOPS_FLAG_ID = "mcp.admin.liveops-controls.enabled";
104
129
  var MCP_ADMIN_ANALYTICS_FLAG_ID = "mcp.admin.analytics.enabled";
130
+ var ECONOMY_ADMIN_HISTORY_FLAG_ID = "economy.admin-history.enabled";
131
+ var MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID = "mcp.admin-economy-history.enabled";
132
+ var MCP_ADMIN_ECONOMY_READ_CAPABILITY = "admin.economy.read";
133
+ var ECONOMY_FINANCE_OPERATIONS_VIEW_CAPABILITY = "economy.finance-operations.view";
105
134
  var MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID = "mcp.admin.production-readiness.enabled";
106
135
  var MCP_ADMIN_PRODUCTION_READINESS_ENV_VAR = "MCP_ADMIN_PRODUCTION_READINESS_ENABLED";
107
136
  var MCP_ASSET_PIPELINE_FLAG_ID = "asset.pipeline.unified-ai-assets.enabled";
@@ -110,6 +139,11 @@ var MCP_ASSET_CATALOG_REQUEST_CAPABILITY = "asset.catalog.request";
110
139
  var MCP_ASSET_PIPELINE_MANAGE_CAPABILITY = "asset.pipeline.mcp.manage";
111
140
  var MCP_ASSET_SOURCE_MANAGE_CAPABILITY = "asset.source.manage";
112
141
  var MCP_ASSET_CATALOG_REVIEW_CAPABILITY = "asset.catalog.review";
142
+ var MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID = "mcp.admin-economy-adjustments.enabled";
143
+ var ECONOMY_OWNER_ADJUSTMENTS_FLAG_ID = "economy.tokens.owner-adjustments.enabled";
144
+ var MCP_ECONOMY_FINANCE_VIEW_CAPABILITY = "economy.finance-operations.view";
145
+ var MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY = "economy.finance-operations.adjust";
146
+ var MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY = "economy.finance-operations.approve-adjustment";
113
147
  var stringField = (description, options = {}) => ({
114
148
  type: "string",
115
149
  description,
@@ -177,6 +211,42 @@ var MCP_ADMIN_USER_AGGREGATION_PRESETS = [
177
211
  "usersByNotificationPreference",
178
212
  "usersByAccountAgeBand"
179
213
  ];
214
+ var MCP_ADMIN_TOKEN_ACTIVITY_TYPES = [
215
+ "acquisition",
216
+ "spend",
217
+ "reversal",
218
+ "hold",
219
+ "failure"
220
+ ];
221
+ var MCP_ADMIN_TOKEN_ACTIVITY_STATUSES = [
222
+ "pending",
223
+ "held",
224
+ "settled",
225
+ "reversed",
226
+ "failed"
227
+ ];
228
+ var MCP_ADMIN_TOKEN_WALLET_COMPONENTS = [
229
+ "household",
230
+ "personal",
231
+ "gameplay-allocation"
232
+ ];
233
+ var MCP_ADMIN_TOKEN_WALLET_STATUSES = ["active", "closed"];
234
+ var MCP_ADMIN_TOKEN_WALLET_SORTS = [
235
+ "available-desc",
236
+ "updated-at-desc"
237
+ ];
238
+ var MCP_ADMIN_TOKEN_ACTIVITY_SOURCES = [
239
+ "paid-purchase",
240
+ "subscription",
241
+ "rewarded-activity",
242
+ "gameplay",
243
+ "system-adjustment",
244
+ "unknown"
245
+ ];
246
+ var MCP_ADMIN_TOKEN_ACTIVITY_SORTS = [
247
+ "occurred-at-desc",
248
+ "amount-absolute-desc"
249
+ ];
180
250
  var MCP_ASSET_SOURCE_ADAPTERS = [
181
251
  "polyhaven",
182
252
  "kenney",
@@ -323,6 +393,276 @@ var assetOperationAcceptedOutput = {
323
393
  job: assetJobStatusField("Governed asset job created or updated by the operation."),
324
394
  nextAction: stringField("Next expected lifecycle action.", { required: false })
325
395
  };
396
+ var tokenAdjustmentOutput = {
397
+ adjustment: objectField("Audited Token adjustment state.", {
398
+ adjustmentId: stringField("Stable adjustment identifier."),
399
+ targetAccountId: stringField("Target account identifier."),
400
+ targetWalletId: stringField("Server-resolved target wallet identifier."),
401
+ targetWalletKind: stringField("Server-resolved target wallet kind.", {
402
+ enum: ["personal"]
403
+ }),
404
+ amountTokenSubunits: stringField(
405
+ "Exact positive base-10 TokenSubunit amount; 1 Token is 1,000 subunits."
406
+ ),
407
+ status: stringField("Current immutable workflow status.", {
408
+ enum: ["pending", "approved", "rejected", "executed", "failed", "expired"]
409
+ }),
410
+ previewHash: stringField("Canonical preview hash bound to the proposal."),
411
+ proposalHash: stringField("Canonical proposal hash bound to decisions."),
412
+ proposerAccountId: stringField("Stable proposing owner account identifier."),
413
+ approverAccountId: stringField("Distinct approving owner account identifier.", {
414
+ required: false
415
+ }),
416
+ createdAt: stringField("ISO-8601 proposal timestamp."),
417
+ expiresAt: stringField("ISO-8601 proposal expiry timestamp."),
418
+ transactionId: stringField("Immutable ledger transaction identifier.", {
419
+ required: false
420
+ })
421
+ })
422
+ };
423
+ var adminEconomyReadAccess = {
424
+ oauthScopes: [MCP_ACCESS_SCOPE],
425
+ capabilities: [
426
+ MCP_ADMIN_ECONOMY_READ_CAPABILITY,
427
+ ECONOMY_FINANCE_OPERATIONS_VIEW_CAPABILITY
428
+ ],
429
+ rolloutFlags: [
430
+ ECONOMY_ADMIN_HISTORY_FLAG_ID,
431
+ MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID
432
+ ],
433
+ mode: "read-only",
434
+ identityResolution: "not-available"
435
+ };
436
+ var adminTokenReportingWindowInput = {
437
+ lookbackDays: numberField(
438
+ "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.",
439
+ {
440
+ required: false,
441
+ minimum: 1,
442
+ maximum: 365,
443
+ default: 30
444
+ }
445
+ ),
446
+ fromInclusive: stringField(
447
+ "Optional inclusive ISO-8601 UTC start; the normalized interactive window cannot exceed 365 days.",
448
+ { required: false, format: "date-time" }
449
+ ),
450
+ toExclusive: stringField(
451
+ "Optional exclusive ISO-8601 UTC end; defaults to the request time.",
452
+ { required: false, format: "date-time" }
453
+ )
454
+ };
455
+ var adminTokenActivityEntryField = objectField(
456
+ "One pseudonymous Token activity row with no raw financial or identity identifiers.",
457
+ {
458
+ schemaVersion: stringField("Economy reporting contract version.", {
459
+ enum: ["1"]
460
+ }),
461
+ occurredAt: stringField("ISO-8601 UTC activity timestamp.", {
462
+ format: "date-time"
463
+ }),
464
+ activityType: stringField("Normalized Token activity type.", {
465
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_TYPES
466
+ }),
467
+ status: stringField("Normalized activity status.", {
468
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_STATUSES
469
+ }),
470
+ source: stringField(
471
+ "Provider-neutral source grouping; provider names and identifiers are excluded.",
472
+ { enum: MCP_ADMIN_TOKEN_ACTIVITY_SOURCES }
473
+ ),
474
+ amount: stringField(
475
+ "Exact signed TokenSubunit amount as a canonical base-10 integer string.",
476
+ { format: "int64-string" }
477
+ ),
478
+ safeLabel: stringField(
479
+ "Bounded source-owned display label with no account, payment, or provider metadata."
480
+ ),
481
+ rowAlias: stringField(
482
+ "Versioned audience-separated opaque alias for this reporting row.",
483
+ { format: "pseudonymous-alias" }
484
+ ),
485
+ subjectAlias: stringField(
486
+ "Versioned audience-separated opaque alias for the activity subject.",
487
+ { format: "pseudonymous-alias" }
488
+ )
489
+ }
490
+ );
491
+ var adminTokenAggregateBalancesField = objectField(
492
+ "Identifier-free exact aggregate Token balance categories.",
493
+ {
494
+ schemaVersion: stringField("Economy reporting contract version.", {
495
+ enum: ["1"]
496
+ }),
497
+ available: stringField("Exact available TokenSubunits.", {
498
+ format: "int64-string"
499
+ }),
500
+ reserved: stringField("Exact reserved TokenSubunits.", {
501
+ format: "int64-string"
502
+ }),
503
+ held: stringField("Exact held TokenSubunits.", {
504
+ format: "int64-string"
505
+ }),
506
+ rewardProgress: stringField("Exact accumulated reward TokenSubunits.", {
507
+ format: "int64-string"
508
+ })
509
+ }
510
+ );
511
+ var adminTokenAggregateLifetimeField = objectField(
512
+ "Identifier-free exact aggregate lifetime Token metrics.",
513
+ {
514
+ schemaVersion: stringField("Economy reporting contract version.", {
515
+ enum: ["1"]
516
+ }),
517
+ bought: stringField("Exact lifetime bought TokenSubunits.", {
518
+ format: "int64-string"
519
+ }),
520
+ earned: stringField("Exact lifetime earned TokenSubunits.", {
521
+ format: "int64-string"
522
+ }),
523
+ allocated: stringField("Exact lifetime allocated TokenSubunits.", {
524
+ format: "int64-string"
525
+ }),
526
+ reclaimed: stringField("Exact lifetime reclaimed TokenSubunits.", {
527
+ format: "int64-string"
528
+ }),
529
+ spent: stringField("Exact lifetime spent TokenSubunits.", {
530
+ format: "int64-string"
531
+ }),
532
+ reversed: stringField("Exact lifetime reversed TokenSubunits.", {
533
+ format: "int64-string"
534
+ })
535
+ }
536
+ );
537
+ var adminTokenWalletBalanceEntryField = objectField(
538
+ "One pseudonymous Token wallet balance with no raw account or wallet identifier.",
539
+ {
540
+ schemaVersion: stringField("Economy reporting contract version.", {
541
+ enum: ["1"]
542
+ }),
543
+ walletAlias: stringField("MCP-audience opaque wallet alias.", {
544
+ format: "pseudonymous-alias"
545
+ }),
546
+ subjectAlias: stringField("MCP-audience opaque subject alias.", {
547
+ format: "pseudonymous-alias"
548
+ }),
549
+ component: stringField("Provider-neutral wallet component.", {
550
+ enum: MCP_ADMIN_TOKEN_WALLET_COMPONENTS
551
+ }),
552
+ status: stringField("Wallet projection status.", {
553
+ enum: MCP_ADMIN_TOKEN_WALLET_STATUSES
554
+ }),
555
+ available: stringField("Exact available TokenSubunits.", {
556
+ format: "int64-string"
557
+ }),
558
+ reserved: stringField("Exact reserved TokenSubunits.", {
559
+ format: "int64-string"
560
+ }),
561
+ held: stringField("Exact held TokenSubunits.", {
562
+ format: "int64-string"
563
+ }),
564
+ rewardProgress: stringField("Exact reward-progress TokenSubunits.", {
565
+ format: "int64-string"
566
+ }),
567
+ updatedAt: stringField("UTC time of the included wallet projection.", {
568
+ format: "date-time"
569
+ }),
570
+ authoritySequence: stringField(
571
+ "Canonical positive authority sequence through which this row is current.",
572
+ { format: "uint64-string" }
573
+ )
574
+ }
575
+ );
576
+ var adminTokenAnomalyField = objectField(
577
+ "Explainable advisory indicator; it never triggers a financial mutation.",
578
+ {
579
+ method: stringField("Server-owned baseline method.", {
580
+ enum: ["same-window-median-mad-v1"]
581
+ }),
582
+ status: stringField("Advisory irregularity classification.", {
583
+ enum: ["normal", "irregular-spike"]
584
+ }),
585
+ baselineWindowCount: numberField(
586
+ "Count of preceding same-window samples used by the baseline.",
587
+ { minimum: 28, maximum: 28, default: 28 }
588
+ ),
589
+ medianAmount: stringField("Exact median signed TokenSubunit amount.", {
590
+ format: "int64-string"
591
+ }),
592
+ medianAbsoluteDeviation: stringField(
593
+ "Exact median absolute deviation in TokenSubunits.",
594
+ { format: "int64-string" }
595
+ ),
596
+ minimumAbsoluteDelta: stringField(
597
+ "Server-owned exact absolute minimum required before a spike is reported.",
598
+ { format: "int64-string" }
599
+ ),
600
+ deviationFromMedian: stringField(
601
+ "Exact signed TokenSubunit deviation from the baseline median.",
602
+ { format: "int64-string" }
603
+ ),
604
+ madMultiplierMilli: numberField(
605
+ "Fixed-point MAD multiplier where 1,000 represents one MAD.",
606
+ { minimum: 1, maximum: 1e6 }
607
+ ),
608
+ explanationCode: stringField("Stable explanation code for operator review.")
609
+ },
610
+ { required: false }
611
+ );
612
+ var adminTokenTrendPointField = objectField(
613
+ "One hourly or daily activity-type trend point.",
614
+ {
615
+ schemaVersion: stringField("Economy reporting contract version.", {
616
+ enum: ["1"]
617
+ }),
618
+ bucketStart: stringField("Inclusive aligned bucket start.", {
619
+ format: "date-time"
620
+ }),
621
+ bucketEnd: stringField("Exclusive aligned bucket end.", {
622
+ format: "date-time"
623
+ }),
624
+ activityType: stringField("Normalized Token activity type.", {
625
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_TYPES
626
+ }),
627
+ aggregate: objectField(
628
+ "Reported aggregate or a suppression marker. Suppressed points omit counts, amounts, and anomaly details.",
629
+ {
630
+ visibility: stringField("Privacy visibility state.", {
631
+ enum: ["reported", "suppressed"]
632
+ }),
633
+ reason: stringField(
634
+ "Present only when the cohort is suppressed.",
635
+ {
636
+ required: false,
637
+ enum: ["cohort-below-minimum"]
638
+ }
639
+ ),
640
+ distinctSubjects: numberField(
641
+ "Distinct pseudonymous subjects; present only for cohorts of at least five.",
642
+ { required: false, minimum: 5 }
643
+ ),
644
+ activityCount: numberField(
645
+ "Activity row count; absent for suppressed cohorts.",
646
+ { required: false, minimum: 5 }
647
+ ),
648
+ signedAmount: stringField(
649
+ "Exact aggregate signed TokenSubunits; absent for suppressed cohorts.",
650
+ { required: false, format: "int64-string" }
651
+ ),
652
+ threshold: numberField(
653
+ "Fixed minimum cohort size; present on suppression markers.",
654
+ {
655
+ required: false,
656
+ minimum: 5,
657
+ maximum: 5,
658
+ default: 5
659
+ }
660
+ )
661
+ }
662
+ ),
663
+ anomaly: adminTokenAnomalyField
664
+ }
665
+ );
326
666
  var MCP_ADMIN_ACTIONS = [
327
667
  {
328
668
  name: "listFeatureFlags",
@@ -1089,6 +1429,342 @@ var MCP_ADMIN_ACTIONS = [
1089
1429
  )
1090
1430
  }
1091
1431
  },
1432
+ {
1433
+ name: "get_admin_token_economy_overview",
1434
+ ...translatedDescription(
1435
+ mcpAdminContractDescriptionKeys.actionGetAdminTokenEconomyOverview
1436
+ ),
1437
+ domain: "economy",
1438
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
1439
+ availability: "near-future",
1440
+ access: adminEconomyReadAccess,
1441
+ execution: {
1442
+ method: "GET",
1443
+ path: "/api/mcp/economy/token-overview",
1444
+ source: "near-future-route",
1445
+ notes: [
1446
+ "The hosted site must register this descriptor as a JSON-RPC MCP tool; publishing this package does not create the runtime route.",
1447
+ "The result is an identifier-free point read of the rebuildable authoritative projection and is never derived by summing a page.",
1448
+ "The tool is read-only and cannot resolve identity or mutate a Token balance."
1449
+ ]
1450
+ },
1451
+ input: {},
1452
+ output: {
1453
+ schemaVersion: stringField("Economy reporting contract version.", {
1454
+ enum: ["1"]
1455
+ }),
1456
+ generatedAt: stringField("UTC time the response was generated.", {
1457
+ format: "date-time"
1458
+ }),
1459
+ projectionAsOf: stringField(
1460
+ "UTC time of the included global projection.",
1461
+ { format: "date-time" }
1462
+ ),
1463
+ authoritySequence: stringField(
1464
+ "Canonical positive authority sequence through which the projection is current.",
1465
+ { format: "uint64-string" }
1466
+ ),
1467
+ walletCount: numberField("Total represented Token wallets.", {
1468
+ minimum: 0
1469
+ }),
1470
+ activeWalletCount: numberField("Active represented Token wallets.", {
1471
+ minimum: 0
1472
+ }),
1473
+ balances: adminTokenAggregateBalancesField,
1474
+ lifetime: adminTokenAggregateLifetimeField,
1475
+ rawIdentifiersIncluded: booleanField(
1476
+ "Always false for this identifier-free contract.",
1477
+ { default: false }
1478
+ )
1479
+ }
1480
+ },
1481
+ {
1482
+ name: "list_admin_token_wallet_balances",
1483
+ ...translatedDescription(
1484
+ mcpAdminContractDescriptionKeys.actionListAdminTokenWalletBalances
1485
+ ),
1486
+ domain: "economy",
1487
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
1488
+ availability: "near-future",
1489
+ access: adminEconomyReadAccess,
1490
+ execution: {
1491
+ method: "GET",
1492
+ path: "/api/mcp/economy/token-wallet-balances",
1493
+ source: "near-future-route",
1494
+ notes: [
1495
+ "The hosted site must register this descriptor as a JSON-RPC MCP tool; publishing this package does not create the runtime route.",
1496
+ "Responses are private/no-store and bounded to 100 pseudonymous projection rows.",
1497
+ "Raw account, wallet, household, payment, and provider identifiers are excluded and identity resolution is unavailable."
1498
+ ]
1499
+ },
1500
+ input: {
1501
+ limit: numberField("Maximum wallet balance rows to return.", {
1502
+ required: false,
1503
+ minimum: 1,
1504
+ maximum: 100,
1505
+ default: 100
1506
+ }),
1507
+ cursor: stringField(
1508
+ "Opaque query-bound cursor returned by the preceding page.",
1509
+ { required: false, format: "opaque-cursor" }
1510
+ ),
1511
+ components: arrayField(
1512
+ "Optional provider-neutral wallet-component filters.",
1513
+ "string",
1514
+ {
1515
+ required: false,
1516
+ enum: MCP_ADMIN_TOKEN_WALLET_COMPONENTS,
1517
+ maxItems: MCP_ADMIN_TOKEN_WALLET_COMPONENTS.length
1518
+ }
1519
+ ),
1520
+ statuses: arrayField("Optional wallet-status filters.", "string", {
1521
+ required: false,
1522
+ enum: MCP_ADMIN_TOKEN_WALLET_STATUSES,
1523
+ maxItems: MCP_ADMIN_TOKEN_WALLET_STATUSES.length
1524
+ }),
1525
+ subjectAlias: stringField(
1526
+ "Optional exact MCP-audience subject alias; raw account identifiers are not accepted.",
1527
+ { required: false, format: "pseudonymous-alias" }
1528
+ ),
1529
+ sort: stringField("Allowlisted stable wallet sort.", {
1530
+ required: false,
1531
+ enum: MCP_ADMIN_TOKEN_WALLET_SORTS,
1532
+ default: "available-desc"
1533
+ })
1534
+ },
1535
+ output: {
1536
+ schemaVersion: stringField("Economy reporting contract version.", {
1537
+ enum: ["1"]
1538
+ }),
1539
+ items: arrayField(
1540
+ "Pseudonymous wallet balances without raw account, wallet, household, payment, or provider identifiers.",
1541
+ "AdminTokenWalletBalanceEntryV1",
1542
+ {
1543
+ items: adminTokenWalletBalanceEntryField,
1544
+ maxItems: 100
1545
+ }
1546
+ ),
1547
+ hasMore: booleanField("Whether another bounded page exists."),
1548
+ nextCursor: stringField("Opaque cursor for the next page.", {
1549
+ required: false,
1550
+ format: "opaque-cursor"
1551
+ }),
1552
+ metadata: objectField("Privacy and normalized wallet query metadata.", {
1553
+ schemaVersion: stringField("Economy reporting contract version.", {
1554
+ enum: ["1"]
1555
+ }),
1556
+ generatedAt: stringField("UTC time the result was generated.", {
1557
+ format: "date-time"
1558
+ }),
1559
+ sort: stringField("Applied stable sort.", {
1560
+ enum: MCP_ADMIN_TOKEN_WALLET_SORTS
1561
+ }),
1562
+ pageLimit: numberField("Applied page bound.", {
1563
+ minimum: 1,
1564
+ maximum: 100
1565
+ }),
1566
+ audience: stringField("Pseudonym audience fixed by the MCP endpoint.", {
1567
+ enum: ["mcp-token-balances"]
1568
+ }),
1569
+ pseudonymVersion: stringField("Active opaque pseudonym key version."),
1570
+ rawIdentifiersIncluded: booleanField(
1571
+ "Always false for this public-safe contract.",
1572
+ { default: false }
1573
+ )
1574
+ })
1575
+ }
1576
+ },
1577
+ {
1578
+ name: "list_admin_token_activity",
1579
+ ...translatedDescription(
1580
+ mcpAdminContractDescriptionKeys.actionListAdminTokenActivity
1581
+ ),
1582
+ domain: "economy",
1583
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
1584
+ availability: "near-future",
1585
+ access: adminEconomyReadAccess,
1586
+ execution: {
1587
+ method: "GET",
1588
+ path: "/api/mcp/economy/token-activity",
1589
+ source: "near-future-route",
1590
+ notes: [
1591
+ "The hosted site must register this descriptor as a JSON-RPC MCP tool; publishing this package does not create the runtime route.",
1592
+ "Responses are private/no-store, bounded to 100 rows, and contain only audience-separated pseudonyms plus source-owned labels.",
1593
+ "The tool is read-only and cannot resolve a pseudonym or mutate a financial record."
1594
+ ]
1595
+ },
1596
+ input: {
1597
+ ...adminTokenReportingWindowInput,
1598
+ limit: numberField("Maximum activity rows to return.", {
1599
+ required: false,
1600
+ minimum: 1,
1601
+ maximum: 100,
1602
+ default: 100
1603
+ }),
1604
+ cursor: stringField(
1605
+ "Opaque query-bound cursor returned by the preceding page.",
1606
+ { required: false, format: "opaque-cursor" }
1607
+ ),
1608
+ activityTypes: arrayField(
1609
+ "Optional allowlisted activity-type filters.",
1610
+ "string",
1611
+ {
1612
+ required: false,
1613
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_TYPES,
1614
+ maxItems: MCP_ADMIN_TOKEN_ACTIVITY_TYPES.length
1615
+ }
1616
+ ),
1617
+ statuses: arrayField("Optional allowlisted activity-status filters.", "string", {
1618
+ required: false,
1619
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_STATUSES,
1620
+ maxItems: MCP_ADMIN_TOKEN_ACTIVITY_STATUSES.length
1621
+ }),
1622
+ sources: arrayField(
1623
+ "Optional provider-neutral source-group filters.",
1624
+ "string",
1625
+ {
1626
+ required: false,
1627
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_SOURCES,
1628
+ maxItems: MCP_ADMIN_TOKEN_ACTIVITY_SOURCES.length
1629
+ }
1630
+ ),
1631
+ subjectAlias: stringField(
1632
+ "Optional exact MCP-audience subject alias; raw account identifiers are not accepted.",
1633
+ { required: false, format: "pseudonymous-alias" }
1634
+ ),
1635
+ sort: stringField("Allowlisted stable sort.", {
1636
+ required: false,
1637
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_SORTS,
1638
+ default: "occurred-at-desc"
1639
+ })
1640
+ },
1641
+ output: {
1642
+ schemaVersion: stringField("Economy reporting contract version.", {
1643
+ enum: ["1"]
1644
+ }),
1645
+ items: arrayField(
1646
+ "Pseudonymous activity rows; no account, wallet, transaction, order, payment, provider-event, idempotency, or journal-integrity identifiers.",
1647
+ "AdminTokenActivityEntryV1",
1648
+ {
1649
+ items: adminTokenActivityEntryField,
1650
+ maxItems: 100
1651
+ }
1652
+ ),
1653
+ hasMore: booleanField("Whether another bounded page exists."),
1654
+ nextCursor: stringField("Opaque cursor for the next page.", {
1655
+ required: false,
1656
+ format: "opaque-cursor"
1657
+ }),
1658
+ metadata: objectField("Privacy and normalized query metadata.", {
1659
+ schemaVersion: stringField("Economy reporting contract version.", {
1660
+ enum: ["1"]
1661
+ }),
1662
+ generatedAt: stringField("UTC time the result was generated.", {
1663
+ format: "date-time"
1664
+ }),
1665
+ fromInclusive: stringField("Normalized inclusive UTC window start.", {
1666
+ format: "date-time"
1667
+ }),
1668
+ toExclusive: stringField("Normalized exclusive UTC window end.", {
1669
+ format: "date-time"
1670
+ }),
1671
+ sort: stringField("Applied stable sort.", {
1672
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_SORTS
1673
+ }),
1674
+ pageLimit: numberField("Applied page bound.", {
1675
+ minimum: 1,
1676
+ maximum: 100
1677
+ }),
1678
+ audience: stringField("Pseudonym audience fixed by the MCP endpoint.", {
1679
+ enum: ["mcp-token-activity"]
1680
+ }),
1681
+ pseudonymVersion: stringField("Active opaque pseudonym key version."),
1682
+ rawIdentifiersIncluded: booleanField(
1683
+ "Always false for this public-safe contract.",
1684
+ { default: false }
1685
+ )
1686
+ })
1687
+ }
1688
+ },
1689
+ {
1690
+ name: "get_admin_token_trends",
1691
+ ...translatedDescription(
1692
+ mcpAdminContractDescriptionKeys.actionGetAdminTokenTrends
1693
+ ),
1694
+ domain: "economy",
1695
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
1696
+ availability: "near-future",
1697
+ access: adminEconomyReadAccess,
1698
+ execution: {
1699
+ method: "GET",
1700
+ path: "/api/mcp/economy/token-trends",
1701
+ source: "near-future-route",
1702
+ notes: [
1703
+ "The hosted site must register this descriptor as a JSON-RPC MCP tool; publishing this package does not create the runtime route.",
1704
+ "Cohorts below five are suppression markers with no counts, amounts, aliases, or anomaly details.",
1705
+ "Anomalies are explainable review signals and never mutate financial records."
1706
+ ]
1707
+ },
1708
+ input: {
1709
+ ...adminTokenReportingWindowInput,
1710
+ granularity: stringField("Hourly or daily UTC aggregation.", {
1711
+ required: false,
1712
+ enum: ["hour", "day"],
1713
+ default: "day"
1714
+ }),
1715
+ activityTypes: arrayField(
1716
+ "Optional allowlisted trend activity types.",
1717
+ "string",
1718
+ {
1719
+ required: false,
1720
+ enum: MCP_ADMIN_TOKEN_ACTIVITY_TYPES,
1721
+ maxItems: MCP_ADMIN_TOKEN_ACTIVITY_TYPES.length
1722
+ }
1723
+ )
1724
+ },
1725
+ output: {
1726
+ schemaVersion: stringField("Economy reporting contract version.", {
1727
+ enum: ["1"]
1728
+ }),
1729
+ series: arrayField(
1730
+ "Bounded, stably ordered trend points.",
1731
+ "AdminTokenTrendPointV1",
1732
+ {
1733
+ items: adminTokenTrendPointField,
1734
+ maxItems: 1e3
1735
+ }
1736
+ ),
1737
+ metadata: objectField("Trend privacy and baseline metadata.", {
1738
+ schemaVersion: stringField("Economy reporting contract version.", {
1739
+ enum: ["1"]
1740
+ }),
1741
+ generatedAt: stringField("UTC time the result was generated.", {
1742
+ format: "date-time"
1743
+ }),
1744
+ fromInclusive: stringField("Normalized inclusive UTC window start.", {
1745
+ format: "date-time"
1746
+ }),
1747
+ toExclusive: stringField("Normalized exclusive UTC window end.", {
1748
+ format: "date-time"
1749
+ }),
1750
+ granularity: stringField("Applied UTC aggregation granularity.", {
1751
+ enum: ["hour", "day"]
1752
+ }),
1753
+ minimumCohortSize: numberField(
1754
+ "Fixed minimum distinct-subject cohort before aggregate disclosure.",
1755
+ { minimum: 5, maximum: 5, default: 5 }
1756
+ ),
1757
+ anomalyBaselineDays: numberField(
1758
+ "Fixed same-window median/MAD baseline length.",
1759
+ { minimum: 28, maximum: 28, default: 28 }
1760
+ ),
1761
+ rawIdentifiersIncluded: booleanField(
1762
+ "Always false for this public-safe contract.",
1763
+ { default: false }
1764
+ )
1765
+ })
1766
+ }
1767
+ },
1092
1768
  {
1093
1769
  name: "searchAssetCatalog",
1094
1770
  ...translatedDescription(mcpAdminContractDescriptionKeys.actionSearchAssetCatalog),
@@ -1419,6 +2095,254 @@ var MCP_ADMIN_ACTIONS = [
1419
2095
  plannedOperations: arrayField("Processing or review operations planned for the job.", "string"),
1420
2096
  evidence: arrayField("Review and processing evidence references available to the caller.", "AssetEvidence")
1421
2097
  }
2098
+ },
2099
+ {
2100
+ name: "getUserTokenWallet",
2101
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionGetUserTokenWallet),
2102
+ domain: "economyAdjustments",
2103
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2104
+ availability: "near-future",
2105
+ requiredCapability: MCP_ECONOMY_FINANCE_VIEW_CAPABILITY,
2106
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_VIEW_CAPABILITY],
2107
+ execution: {
2108
+ method: "GET",
2109
+ path: "/api/mcp/economy/users/{accountId}/wallet",
2110
+ source: "near-future-route",
2111
+ notes: [
2112
+ "The backend resolves the personal wallet from the account id; callers cannot select an arbitrary wallet."
2113
+ ]
2114
+ },
2115
+ input: {
2116
+ accountId: stringField("Stable target account identifier.", { required: true })
2117
+ },
2118
+ output: {
2119
+ wallet: objectField("Authorized Token wallet summary.", {
2120
+ accountId: stringField("Stable target account identifier."),
2121
+ initialized: booleanField(
2122
+ "Whether the authoritative personal wallet has been initialized."
2123
+ ),
2124
+ walletId: stringField("Server-resolved wallet identifier.", {
2125
+ required: false
2126
+ }),
2127
+ walletKind: stringField("Server-resolved wallet kind.", { enum: ["personal"] }),
2128
+ availableTokenSubunits: stringField("Exact available TokenSubunits as base-10 text."),
2129
+ heldTokenSubunits: stringField("Exact held TokenSubunits as base-10 text."),
2130
+ lifetimeCreditedTokenSubunits: stringField(
2131
+ "Exact lifetime credited TokenSubunits as base-10 text."
2132
+ ),
2133
+ lifetimeReversedTokenSubunits: stringField(
2134
+ "Exact lifetime reversed TokenSubunits as base-10 text."
2135
+ ),
2136
+ projectionVersion: stringField("Optimistic concurrency projection version.", {
2137
+ required: false
2138
+ })
2139
+ })
2140
+ }
2141
+ },
2142
+ {
2143
+ name: "listUserTokenActivity",
2144
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionListUserTokenActivity),
2145
+ domain: "economyAdjustments",
2146
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2147
+ availability: "near-future",
2148
+ requiredCapability: MCP_ECONOMY_FINANCE_VIEW_CAPABILITY,
2149
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_VIEW_CAPABILITY],
2150
+ execution: {
2151
+ method: "GET",
2152
+ path: "/api/mcp/economy/users/{accountId}/activity",
2153
+ source: "near-future-route"
2154
+ },
2155
+ input: {
2156
+ accountId: stringField("Stable target account identifier.", { required: true }),
2157
+ cursor: stringField("Opaque continuation cursor.", { required: false }),
2158
+ limit: numberField("Maximum results; the backend applies a bounded ceiling.", {
2159
+ required: false
2160
+ })
2161
+ },
2162
+ output: {
2163
+ items: arrayField("Immutable Token activity entries.", "WalletActivityEntryV1"),
2164
+ nextCursor: stringField("Opaque cursor for the next page.", { required: false })
2165
+ }
2166
+ },
2167
+ {
2168
+ name: "listTokenAdjustments",
2169
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionListTokenAdjustments),
2170
+ domain: "economyAdjustments",
2171
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2172
+ availability: "near-future",
2173
+ requiredCapability: MCP_ECONOMY_FINANCE_VIEW_CAPABILITY,
2174
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_VIEW_CAPABILITY],
2175
+ execution: {
2176
+ method: "GET",
2177
+ path: "/api/mcp/economy/adjustments",
2178
+ source: "near-future-route"
2179
+ },
2180
+ input: {
2181
+ targetAccountId: stringField("Optional target account filter.", { required: false }),
2182
+ status: stringField("Optional workflow status filter.", {
2183
+ required: false,
2184
+ enum: ["pending", "approved", "rejected", "executed", "failed", "expired"]
2185
+ }),
2186
+ cursor: stringField("Opaque continuation cursor.", { required: false }),
2187
+ limit: numberField("Maximum results; the backend applies a bounded ceiling.", {
2188
+ required: false
2189
+ })
2190
+ },
2191
+ output: {
2192
+ items: arrayField("Audited adjustment workflow records.", "OperatorAdjustmentProposalV1"),
2193
+ nextCursor: stringField("Opaque cursor for the next page.", { required: false })
2194
+ }
2195
+ },
2196
+ {
2197
+ name: "proposeTokenCredit",
2198
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionProposeTokenCredit),
2199
+ domain: "economyAdjustments",
2200
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2201
+ availability: "near-future",
2202
+ requiredCapability: MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY,
2203
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY],
2204
+ execution: {
2205
+ method: "POST",
2206
+ path: "/api/mcp/economy/adjustments/token-credits",
2207
+ source: "near-future-route",
2208
+ notes: [
2209
+ "This creates a preview-bound proposal only; it does not credit the wallet until a distinct owner approves it.",
2210
+ "Raw idempotency keys and ticket references are fingerprinted before authoritative persistence."
2211
+ ]
2212
+ },
2213
+ input: {
2214
+ targetAccountId: stringField("Stable target account identifier.", { required: true }),
2215
+ targetWalletKind: stringField("Permitted server-resolved wallet kind.", {
2216
+ required: true,
2217
+ enum: ["personal"]
2218
+ }),
2219
+ amountTokenSubunits: stringField(
2220
+ "Exact positive base-10 TokenSubunit amount; 1 Token is 1,000 subunits.",
2221
+ { required: true }
2222
+ ),
2223
+ reasonCode: stringField("Allowlisted operator reason code.", { required: true }),
2224
+ ticketReference: stringField("Support or change ticket reference.", { required: true }),
2225
+ idempotencyKey: stringField("Caller-generated idempotency key.", { required: true })
2226
+ },
2227
+ output: tokenAdjustmentOutput,
2228
+ verification: {
2229
+ method: "GET",
2230
+ path: "/api/mcp/economy/adjustments",
2231
+ query: ["adjustmentId={adjustmentId}"],
2232
+ ...translatedDescription(
2233
+ mcpAdminContractDescriptionKeys.verificationTokenAdjustment
2234
+ )
2235
+ }
2236
+ },
2237
+ {
2238
+ name: "approveTokenCredit",
2239
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionApproveTokenCredit),
2240
+ domain: "economyAdjustments",
2241
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2242
+ availability: "near-future",
2243
+ requiredCapability: MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY,
2244
+ requiredTokenScopes: [
2245
+ "mcp:access",
2246
+ MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY
2247
+ ],
2248
+ execution: {
2249
+ method: "POST",
2250
+ path: "/api/mcp/economy/adjustments/{adjustmentId}/approve",
2251
+ source: "near-future-route",
2252
+ notes: [
2253
+ "The authenticated approver must be a different stable platform-owner account from the proposer."
2254
+ ]
2255
+ },
2256
+ input: {
2257
+ adjustmentId: stringField("Stable pending adjustment identifier.", { required: true }),
2258
+ expectedPreviewHash: stringField("Preview hash displayed to the approver.", {
2259
+ required: true
2260
+ }),
2261
+ expectedProposalHash: stringField("Proposal hash displayed to the approver.", {
2262
+ required: true
2263
+ }),
2264
+ idempotencyKey: stringField("Caller-generated idempotency key.", { required: true })
2265
+ },
2266
+ output: tokenAdjustmentOutput,
2267
+ verification: {
2268
+ method: "GET",
2269
+ path: "/api/mcp/economy/adjustments",
2270
+ query: ["adjustmentId={adjustmentId}"],
2271
+ ...translatedDescription(
2272
+ mcpAdminContractDescriptionKeys.verificationTokenAdjustment
2273
+ )
2274
+ }
2275
+ },
2276
+ {
2277
+ name: "rejectTokenCredit",
2278
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionRejectTokenCredit),
2279
+ domain: "economyAdjustments",
2280
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2281
+ availability: "near-future",
2282
+ requiredCapability: MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY,
2283
+ requiredTokenScopes: [
2284
+ "mcp:access",
2285
+ MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY
2286
+ ],
2287
+ execution: {
2288
+ method: "POST",
2289
+ path: "/api/mcp/economy/adjustments/{adjustmentId}/reject",
2290
+ source: "near-future-route"
2291
+ },
2292
+ input: {
2293
+ adjustmentId: stringField("Stable pending adjustment identifier.", { required: true }),
2294
+ expectedPreviewHash: stringField("Preview hash displayed to the approver.", {
2295
+ required: true
2296
+ }),
2297
+ expectedProposalHash: stringField("Proposal hash displayed to the approver.", {
2298
+ required: true
2299
+ }),
2300
+ reasonCode: stringField("Allowlisted rejection reason code.", { required: true }),
2301
+ idempotencyKey: stringField("Caller-generated idempotency key.", { required: true })
2302
+ },
2303
+ output: tokenAdjustmentOutput,
2304
+ verification: {
2305
+ method: "GET",
2306
+ path: "/api/mcp/economy/adjustments",
2307
+ query: ["adjustmentId={adjustmentId}"],
2308
+ ...translatedDescription(
2309
+ mcpAdminContractDescriptionKeys.verificationTokenAdjustment
2310
+ )
2311
+ }
2312
+ },
2313
+ {
2314
+ name: "reverseTokenCredit",
2315
+ ...translatedDescription(mcpAdminContractDescriptionKeys.actionReverseTokenCredit),
2316
+ domain: "economyAdjustments",
2317
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2318
+ availability: "near-future",
2319
+ requiredCapability: MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY,
2320
+ requiredTokenScopes: ["mcp:access", MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY],
2321
+ execution: {
2322
+ method: "POST",
2323
+ path: "/api/mcp/economy/adjustments/{adjustmentId}/reverse",
2324
+ source: "near-future-route",
2325
+ notes: [
2326
+ "A reversal is a separately approved compensating transaction; the original credit is never updated or deleted."
2327
+ ]
2328
+ },
2329
+ input: {
2330
+ originalAdjustmentId: stringField("Executed credit adjustment to reverse.", {
2331
+ required: true
2332
+ }),
2333
+ reasonCode: stringField("Allowlisted reversal reason code.", { required: true }),
2334
+ ticketReference: stringField("Support or change ticket reference.", { required: true }),
2335
+ idempotencyKey: stringField("Caller-generated idempotency key.", { required: true })
2336
+ },
2337
+ output: tokenAdjustmentOutput,
2338
+ verification: {
2339
+ method: "GET",
2340
+ path: "/api/mcp/economy/adjustments",
2341
+ query: ["adjustmentId={adjustmentId}"],
2342
+ ...translatedDescription(
2343
+ mcpAdminContractDescriptionKeys.verificationTokenAdjustment
2344
+ )
2345
+ }
1422
2346
  }
1423
2347
  ];
1424
2348
  function listMcpActionSummaries() {
@@ -1430,7 +2354,10 @@ function listMcpActionSummaries() {
1430
2354
  domain: action.domain,
1431
2355
  rolloutFlag: action.rolloutFlag,
1432
2356
  availability: action.availability,
1433
- execution: action.execution
2357
+ execution: action.execution,
2358
+ requiredCapability: action.requiredCapability,
2359
+ requiredTokenScopes: action.requiredTokenScopes,
2360
+ access: action.access
1434
2361
  }));
1435
2362
  }
1436
2363
  var MCP_ADMIN_CONTEXT_SHAPE = {
@@ -1474,7 +2401,8 @@ var MCP_ADMIN_EXTENSION_RULES = {
1474
2401
  singleResourceMutations: true,
1475
2402
  notes: [
1476
2403
  "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."
2404
+ "New descriptors must define rolloutFlag, execution mapping, input shape, output shape, and verification notes where applicable.",
2405
+ "Sensitive read descriptors must publish their OAuth scope, capability, rollout, read-only, and identity-resolution metadata without treating discovery as authorization."
1478
2406
  ]
1479
2407
  };
1480
2408
  function buildMcpSurfaceUrls(origin) {
@@ -1511,7 +2439,7 @@ function buildAiPluginManifest(origin) {
1511
2439
  client_url: `${urls.apiBaseUrl}/login`,
1512
2440
  authorization_url: `${urls.apiBaseUrl}/oauth/authorize`,
1513
2441
  token_url: `${urls.apiBaseUrl}/oauth/token`,
1514
- scope: "openid email profile",
2442
+ scope: `openid email profile ${MCP_ACCESS_SCOPE}`,
1515
2443
  authorization_content_type: "application/x-www-form-urlencoded",
1516
2444
  instructions: "Sign in with an admin-capable Google or Microsoft account to access the Plasius MCP control plane."
1517
2445
  }
@@ -1535,6 +2463,9 @@ function buildMcpSchemaResponse() {
1535
2463
  execution: action.execution,
1536
2464
  input: action.input,
1537
2465
  output: action.output,
2466
+ requiredCapability: action.requiredCapability,
2467
+ requiredTokenScopes: action.requiredTokenScopes,
2468
+ access: action.access,
1538
2469
  verification: action.verification
1539
2470
  }
1540
2471
  ])
@@ -1579,6 +2510,11 @@ function buildMcpActionFamilies() {
1579
2510
  rolloutFlag: MCP_ADMIN_ANALYTICS_FLAG_ID,
1580
2511
  actions: getActionsByDomain("userAggregation")
1581
2512
  },
2513
+ {
2514
+ domain: "economy",
2515
+ rolloutFlag: MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
2516
+ actions: getActionsByDomain("economy")
2517
+ },
1582
2518
  {
1583
2519
  domain: "assetCatalog",
1584
2520
  rolloutFlag: MCP_ASSET_PIPELINE_FLAG_ID,
@@ -1599,6 +2535,11 @@ function buildMcpActionFamilies() {
1599
2535
  rolloutFlag: MCP_ASSET_PIPELINE_FLAG_ID,
1600
2536
  actions: getActionsByDomain("assetReview")
1601
2537
  },
2538
+ {
2539
+ domain: "economyAdjustments",
2540
+ rolloutFlag: MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2541
+ actions: getActionsByDomain("economyAdjustments")
2542
+ },
1602
2543
  {
1603
2544
  domain: "productionReadiness",
1604
2545
  rolloutFlag: MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID,
@@ -1633,6 +2574,10 @@ function normalizeOptionalString(value) {
1633
2574
  return normalizeNonEmptyString(value);
1634
2575
  }
1635
2576
  export {
2577
+ ECONOMY_ADMIN_HISTORY_FLAG_ID,
2578
+ ECONOMY_FINANCE_OPERATIONS_VIEW_CAPABILITY,
2579
+ ECONOMY_OWNER_ADJUSTMENTS_FLAG_ID,
2580
+ MCP_ACCESS_SCOPE,
1636
2581
  MCP_ADMIN_ACTIONS,
1637
2582
  MCP_ADMIN_ANALYTICS_DIMENSIONS,
1638
2583
  MCP_ADMIN_ANALYTICS_FLAG_ID,
@@ -1640,6 +2585,9 @@ export {
1640
2585
  MCP_ADMIN_ANALYTICS_PRESETS,
1641
2586
  MCP_ADMIN_CONTEXT_SHAPE,
1642
2587
  MCP_ADMIN_CONTRACT_VERSION,
2588
+ MCP_ADMIN_ECONOMY_ADJUSTMENTS_FLAG_ID,
2589
+ MCP_ADMIN_ECONOMY_HISTORY_FLAG_ID,
2590
+ MCP_ADMIN_ECONOMY_READ_CAPABILITY,
1643
2591
  MCP_ADMIN_EXTENSION_RULES,
1644
2592
  MCP_ADMIN_FOUNDATION_DISABLED_CODE,
1645
2593
  MCP_ADMIN_FOUNDATION_ENV_VAR,
@@ -1648,6 +2596,13 @@ export {
1648
2596
  MCP_ADMIN_PRODUCTION_READINESS_ENV_VAR,
1649
2597
  MCP_ADMIN_PRODUCTION_READINESS_FLAG_ID,
1650
2598
  MCP_ADMIN_REGISTRY_SOURCE,
2599
+ MCP_ADMIN_TOKEN_ACTIVITY_SORTS,
2600
+ MCP_ADMIN_TOKEN_ACTIVITY_SOURCES,
2601
+ MCP_ADMIN_TOKEN_ACTIVITY_STATUSES,
2602
+ MCP_ADMIN_TOKEN_ACTIVITY_TYPES,
2603
+ MCP_ADMIN_TOKEN_WALLET_COMPONENTS,
2604
+ MCP_ADMIN_TOKEN_WALLET_SORTS,
2605
+ MCP_ADMIN_TOKEN_WALLET_STATUSES,
1651
2606
  MCP_ADMIN_USER_AGGREGATION_DIMENSIONS,
1652
2607
  MCP_ADMIN_USER_AGGREGATION_METRICS,
1653
2608
  MCP_ADMIN_USER_AGGREGATION_PRESETS,
@@ -1661,6 +2616,9 @@ export {
1661
2616
  MCP_ASSET_SOURCE_ADAPTERS,
1662
2617
  MCP_ASSET_SOURCE_MANAGE_CAPABILITY,
1663
2618
  MCP_ASSET_SOURCE_TIERS,
2619
+ MCP_ECONOMY_FINANCE_ADJUST_CAPABILITY,
2620
+ MCP_ECONOMY_FINANCE_APPROVE_CAPABILITY,
2621
+ MCP_ECONOMY_FINANCE_VIEW_CAPABILITY,
1664
2622
  buildAiPluginManifest,
1665
2623
  buildMcpContextResponse,
1666
2624
  buildMcpDiscoveryResponse,