@plasius/mcp-admin-contracts 0.2.9 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +106 -0
- package/README.md +124 -0
- package/dist/index.cjs +2085 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +153 -7
- package/dist/index.d.ts +153 -7
- package/dist/index.js +2070 -9
- package/dist/index.js.map +1 -1
- package/docs/adrs/adr-0001-public-safe-mcp-admin-contract-boundary.md +3 -3
- package/docs/adrs/adr-0002-read-only-pseudonymous-token-reporting-tools.md +58 -0
- package/docs/adrs/adr-0003-exact-main-oidc-package-publishing.md +74 -0
- package/docs/adrs/adr-0004-owner-token-adjustment-mcp-boundary.md +41 -0
- package/docs/adrs/adr-0005-privacy-safe-read-only-feedback-contract.md +100 -0
- package/docs/adrs/index.md +4 -0
- package/package.json +10 -1
- package/legal/CLA-REGISTRY.csv +0 -2
|
@@ -15,9 +15,9 @@ logic.
|
|
|
15
15
|
`@plasius/mcp-admin-contracts` contains only public-safe discovery metadata,
|
|
16
16
|
types, flag identifiers, whitelist constants, and pure response builders for
|
|
17
17
|
the approved feature-flag, capability, analytics, and bounded user-aggregation
|
|
18
|
-
surfaces
|
|
19
|
-
|
|
20
|
-
and
|
|
18
|
+
surfaces plus pseudonymous read-only Token reporting metadata. Runtime systems
|
|
19
|
+
remain responsible for session validation, authorization, rollout evaluation,
|
|
20
|
+
rate limits, audit emission, persistence, and execution.
|
|
21
21
|
|
|
22
22
|
## Consequences
|
|
23
23
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# ADR 0002: Read-Only Pseudonymous Token Reporting Tools
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
Finance operators need MCP access to the same global balance/lifetime,
|
|
10
|
+
pseudonymous wallet/activity, and trend surface as the touch-first Admin
|
|
11
|
+
workspace. Routine reporting must not expose
|
|
12
|
+
raw account, wallet, transaction, order, payment, provider-event, idempotency,
|
|
13
|
+
or journal-integrity identifiers. MCP must not gain a pseudonym-resolution or
|
|
14
|
+
financial-mutation path.
|
|
15
|
+
|
|
16
|
+
This public package owns discovery metadata only. It cannot register JSON-RPC
|
|
17
|
+
tools, inspect an OAuth principal, evaluate stored flags or capabilities, query
|
|
18
|
+
the reporting projection, generate HMAC aliases, emit audit records, or set
|
|
19
|
+
HTTP cache controls.
|
|
20
|
+
|
|
21
|
+
## Decision
|
|
22
|
+
|
|
23
|
+
- Add the exact tool names `get_admin_token_economy_overview`,
|
|
24
|
+
`list_admin_token_wallet_balances`, `list_admin_token_activity`, and
|
|
25
|
+
`get_admin_token_trends` under the `economy` action domain.
|
|
26
|
+
- The overview contains only exact identifier-free aggregate balance/lifetime
|
|
27
|
+
totals, wallet counts, and projection freshness. Wallet pages contain only
|
|
28
|
+
separate MCP-audience wallet/subject aliases, closed component/status codes,
|
|
29
|
+
exact non-negative amounts, and canonical authority sequence.
|
|
30
|
+
- Publish `mcp:access` as the required OAuth scope metadata and require both
|
|
31
|
+
`admin.economy.read` and `economy.finance-operations.view` capabilities.
|
|
32
|
+
- Require both stored rollout flags: `economy.admin-history.enabled` and
|
|
33
|
+
`mcp.admin-economy-history.enabled`.
|
|
34
|
+
- Mark both operations read-only and make identity resolution unavailable.
|
|
35
|
+
- Describe a default 30-day and maximum 365-day interactive window, a 100-row
|
|
36
|
+
activity page, provider-neutral source filters, opaque cursors, and
|
|
37
|
+
pseudonymous aliases.
|
|
38
|
+
- Describe hourly/daily trends, suppression below five distinct subjects, and
|
|
39
|
+
advisory 28-window same-time median/MAD indicators. Suppressed points omit
|
|
40
|
+
counts, amounts, aliases, and anomaly details.
|
|
41
|
+
- Keep descriptors `near-future` until the hosted site registers and verifies
|
|
42
|
+
the JSON-RPC tools. Publication of this package alone never claims that a
|
|
43
|
+
callable route exists.
|
|
44
|
+
- Advance the additive registry contract identifier to `2026-08-08.v5`.
|
|
45
|
+
|
|
46
|
+
## Consequences
|
|
47
|
+
|
|
48
|
+
- MCP clients can discover one stable public-safe contract before the private
|
|
49
|
+
runtime implementation is enabled.
|
|
50
|
+
- The hosted site must filter discovery and re-check scopes, capabilities, and
|
|
51
|
+
both stored flags on every call; discovery metadata is not authorization.
|
|
52
|
+
- The hosted site remains responsible for query deadlines, rate limits,
|
|
53
|
+
private/no-store responses, safe query-shape audit, least-privilege reporting
|
|
54
|
+
access, and audience-separated alias generation.
|
|
55
|
+
- The owner-only identity-resolution operation remains outside MCP.
|
|
56
|
+
- After the site JSON-RPC registration and integration tests are green, a
|
|
57
|
+
follow-up contract update may promote the execution source from
|
|
58
|
+
`near-future-route` to `existing-route`.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# ADR-0003: Exact-main OIDC package publishing
|
|
2
|
+
|
|
3
|
+
- Status: Accepted
|
|
4
|
+
- Date: 2026-08-01
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
The former `@plasius/mcp-admin-contracts` workflow prepared a release commit and published it from
|
|
9
|
+
the workflow run dispatched at the preceding commit. Checking out a newer
|
|
10
|
+
commit does not change a GitHub Actions run's source identity, so npm provenance
|
|
11
|
+
could identify a different commit from the package and tag. The workflow also
|
|
12
|
+
configured a reusable long-lived npm write token.
|
|
13
|
+
|
|
14
|
+
The feedback programme cannot consume a new package version until publication
|
|
15
|
+
has an immutable, independently reviewable identity. The public package remains limited to metadata, types, and pure builders; release automation gains no runtime data access.
|
|
16
|
+
|
|
17
|
+
## Decision
|
|
18
|
+
|
|
19
|
+
Use a two-run release protocol:
|
|
20
|
+
|
|
21
|
+
1. An operator dispatches `cd.yml` from protected `main` with
|
|
22
|
+
`phase: prepare`.
|
|
23
|
+
2. The reusable preparation workflow versions the package with lifecycle
|
|
24
|
+
scripts disabled and lands metadata through a unique, non-force-pushed pull
|
|
25
|
+
request.
|
|
26
|
+
3. The prepare run waits for successful push-triggered `ci.yml` evidence whose
|
|
27
|
+
branch, event, head SHA, status, and conclusion match the resulting `main`
|
|
28
|
+
commit.
|
|
29
|
+
4. If remote `main` still equals that commit, it dispatches
|
|
30
|
+
`phase: publish` from `main`, carrying the exact expected SHA, release tag,
|
|
31
|
+
and version-derived prerelease identity.
|
|
32
|
+
5. A read-only hosted job repeats exact-main and exact-CI checks, validates and
|
|
33
|
+
packs the package with lifecycle scripts disabled, creates the SBOM, and
|
|
34
|
+
uploads both as digest-bound direct artifacts.
|
|
35
|
+
6. The hosted `production` job downloads the exact artifact IDs and verifies
|
|
36
|
+
GitHub and SHA-256 digests, safe tar members, package identity, npm
|
|
37
|
+
distribution tag, and SHA-512 registry integrity. It repeats the exact-main
|
|
38
|
+
check immediately before the first mutation.
|
|
39
|
+
7. Only the verified tarball is published through npm OIDC with provenance.
|
|
40
|
+
The privileged job installs no dependencies, runs no project scripts, and
|
|
41
|
+
receives no npm write token.
|
|
42
|
+
|
|
43
|
+
Preparation runs are serialized. Publication concurrency includes the prepared
|
|
44
|
+
SHA so the self-dispatched run is not blocked by its own preparation while
|
|
45
|
+
duplicate attempts for the same SHA remain non-cancelling. Conflicting tags are
|
|
46
|
+
never rewritten.
|
|
47
|
+
|
|
48
|
+
The npm trusted publisher must be externally bound to organization
|
|
49
|
+
`Plasius-LTD`, repository `mcp-admin-contracts`, workflow `cd.yml`, environment
|
|
50
|
+
`production`, and action `npm publish`. GitHub `main` and `production`
|
|
51
|
+
policies are independent admission controls. The inherited product flags are `feedback.admin.enabled` and `feedback.mcp.enabled`; the release-governance control is `platform.public-artifact-integrity.enabled` and introduces no runtime exposure. Rollback disables
|
|
52
|
+
`cd.yml`; it never restores token publication.
|
|
53
|
+
|
|
54
|
+
## Consequences
|
|
55
|
+
|
|
56
|
+
- npm provenance, package bytes, successful CI, tag, and GitHub release bind to
|
|
57
|
+
one immutable `main` commit.
|
|
58
|
+
- Dependency and third-party code cannot use the production OIDC or repository
|
|
59
|
+
mutation permissions.
|
|
60
|
+
- A moved `main`, mismatched existing package, stale dispatch, or absent
|
|
61
|
+
trusted-publisher binding fails closed.
|
|
62
|
+
- Releases use two runs and may require fresh preparation after concurrent
|
|
63
|
+
protected-branch movement.
|
|
64
|
+
- CD remains disabled until the trusted publisher and protected environment are
|
|
65
|
+
independently verified.
|
|
66
|
+
|
|
67
|
+
## Alternatives considered
|
|
68
|
+
|
|
69
|
+
- Publishing after checking out a child commit in the original run was rejected
|
|
70
|
+
because provenance remains bound to the dispatch commit.
|
|
71
|
+
- A token fallback was rejected because it weakens the trusted-publisher
|
|
72
|
+
boundary and makes successful authentication ambiguous.
|
|
73
|
+
- One shared concurrency group was rejected because the self-dispatched publish
|
|
74
|
+
run would wait behind the prepare run.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# ADR 0004: Owner Token adjustment MCP boundary
|
|
2
|
+
|
|
3
|
+
- Status: Accepted
|
|
4
|
+
- Date: 2026-08-01
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
Platform owners need to inspect a user's Token wallet and propose support
|
|
9
|
+
credits through either User Admin or MCP. A direct balance setter would bypass
|
|
10
|
+
the authoritative economy journal, make concurrent mutations unsafe, and make
|
|
11
|
+
operator actions difficult to prove. MCP discovery must also remain public-safe
|
|
12
|
+
metadata rather than acquiring authentication, persistence, or ledger logic.
|
|
13
|
+
|
|
14
|
+
## Decision
|
|
15
|
+
|
|
16
|
+
Add an `economyAdjustments` MCP action family containing bounded wallet and
|
|
17
|
+
activity reads, adjustment listing, positive-credit proposal, approval,
|
|
18
|
+
rejection, and compensating reversal. Every action declares its rollout flag,
|
|
19
|
+
finance capability, and required MCP token scopes.
|
|
20
|
+
|
|
21
|
+
Mutation descriptors model preview-bound proposals. The runtime must require a
|
|
22
|
+
different stable platform-owner account to approve a proposal before the
|
|
23
|
+
authoritative ledger is changed. A reversal is another proposal and an
|
|
24
|
+
immutable compensating transaction. There is no set-balance, patch-balance, or
|
|
25
|
+
delete action.
|
|
26
|
+
|
|
27
|
+
Exact TokenSubunit values cross the contract as base-10 strings. The server
|
|
28
|
+
resolves the permitted personal wallet from the supplied account ID; clients
|
|
29
|
+
cannot supply an authoritative wallet ID. Raw idempotency keys and ticket
|
|
30
|
+
references may be sent to the trusted runtime but must be domain-separated and
|
|
31
|
+
fingerprinted before authoritative persistence.
|
|
32
|
+
|
|
33
|
+
## Consequences
|
|
34
|
+
|
|
35
|
+
- MCP and User Admin can share one governed runtime command path.
|
|
36
|
+
- Hosts retain responsibility for platform-owner authentication, step-up,
|
|
37
|
+
capability checks, dual control, transactional persistence, and auditing.
|
|
38
|
+
- The public contract remains provider-neutral and contains no payment data or
|
|
39
|
+
production identifiers.
|
|
40
|
+
- Correcting a credit adds evidence and a compensating fact; it never rewrites
|
|
41
|
+
or deletes history.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# ADR 0005: Privacy-Safe Read-Only Feedback Contract
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
The admin dashboard and hosted MCP surface need a shared view of hourly bug
|
|
10
|
+
health, daily satisfaction, deterministic advisories, processor freshness, and
|
|
11
|
+
bounded structured feedback entries. The package is publicly published and
|
|
12
|
+
must not acquire runtime access to feedback packets, reporter-control state,
|
|
13
|
+
authentication, or storage.
|
|
14
|
+
|
|
15
|
+
Feedback narrative can contain personal or sensitive information even after
|
|
16
|
+
automated redaction. Reporter correlation is also pseudonymous personal data.
|
|
17
|
+
Neither belongs in this public contract or in the Admin/MCP response surface.
|
|
18
|
+
Unbounded report queries would additionally create an avoidable
|
|
19
|
+
denial-of-service and data-exfiltration surface.
|
|
20
|
+
|
|
21
|
+
## Decision
|
|
22
|
+
|
|
23
|
+
Add an additive `feedback` action family in contract version
|
|
24
|
+
`2026-08-11.v6`. It contains five read-only descriptors:
|
|
25
|
+
|
|
26
|
+
- hourly bug-health materialisations
|
|
27
|
+
- daily satisfaction materialisations
|
|
28
|
+
- deterministic feedback advisories
|
|
29
|
+
- report-processor freshness
|
|
30
|
+
- bounded reporter-identifier-free structured entries
|
|
31
|
+
|
|
32
|
+
All actions use `GET`, closed server-owned lookback windows, allowlisted
|
|
33
|
+
filters, opaque cursors of at most 512 characters, and pages of at most 100
|
|
34
|
+
records. Responses describe immutable materialised reports or bounded
|
|
35
|
+
schema-validated projections; no descriptor represents unrestricted packet,
|
|
36
|
+
Blob, or report scans. Every feedback-specific object projection rejects
|
|
37
|
+
additional properties so an undeclared field cannot be serialized across the
|
|
38
|
+
Admin/MCP contract boundary.
|
|
39
|
+
|
|
40
|
+
The structured-entry action models its complete `filters` object as an exact
|
|
41
|
+
union discriminated by `packetType`. The bug variant permits only its shared
|
|
42
|
+
window/paging controls plus `surfaceId`, `buildId`, and `severity`; the review
|
|
43
|
+
variant permits only the shared controls plus `satisfaction`. Both variants
|
|
44
|
+
disallow additional properties. Consuming runtimes must validate exactly one
|
|
45
|
+
variant, reject unknown and cross-packet fields, and only then map the selected
|
|
46
|
+
variant to route query parameters.
|
|
47
|
+
|
|
48
|
+
Every feedback descriptor carries:
|
|
49
|
+
|
|
50
|
+
- parent rollout flag `feedback.mcp.enabled`
|
|
51
|
+
- required capability `admin.feedback.read`
|
|
52
|
+
- complete action-level OAuth scopes `mcp:access` and `admin.feedback.read`
|
|
53
|
+
- unified read-only access metadata repeating the complete scope, capability,
|
|
54
|
+
and rollout requirements for fail-closed consumers
|
|
55
|
+
- a `public-safe-structured-only` privacy classification
|
|
56
|
+
- explicit exclusion of account, reporter, network, session, user-agent,
|
|
57
|
+
locale, client-time, referrer, coordinate, dimension, and adapter
|
|
58
|
+
identifiers; credentials and secrets; financial and government identifiers;
|
|
59
|
+
filenames and raw warnings; narrative, binary images, Blob references, raw
|
|
60
|
+
URLs, unrestricted scans, and mutations
|
|
61
|
+
|
|
62
|
+
Narrative-derived outputs are limited to closed sentiment, intent, and
|
|
63
|
+
confidence buckets. Summaries, quotations, embeddings, hashes, matched values,
|
|
64
|
+
and model traces are forbidden. In-game evidence is represented only by
|
|
65
|
+
bounded renderer-owned diagnostic facts; captured pixels are not represented.
|
|
66
|
+
|
|
67
|
+
This package remains metadata and pure builders only. The consuming runtime
|
|
68
|
+
must enforce admin authentication, the capability and OAuth scope, the
|
|
69
|
+
default-off rollout flag, bounded parsing, fail-closed rate limits, and
|
|
70
|
+
dedicated audit. It must omit or reject the feedback tools when a control
|
|
71
|
+
cannot be evaluated.
|
|
72
|
+
|
|
73
|
+
The global AI-plugin manifest retains the current
|
|
74
|
+
`openid email profile mcp:access` base scopes. Publishing `admin.feedback.read` there before the site issuer,
|
|
75
|
+
protected-resource metadata, and staged rollout are coordinated would alter
|
|
76
|
+
authentication for unrelated tools while the feedback flag is off.
|
|
77
|
+
|
|
78
|
+
Persisted entry projections are discriminated by the exact
|
|
79
|
+
`feedback-bug-packet` and `feedback-review-packet` identities. Reports,
|
|
80
|
+
advisories, game diagnostics, and processor checkpoints directly consume the
|
|
81
|
+
published `@plasius/schema ^1.4.0` dependency and its feedback contract
|
|
82
|
+
`1.0.0`. Descriptor vocabularies and source identities are imported from the
|
|
83
|
+
canonical package, while direct package-schema parity tests prevent this
|
|
84
|
+
package from establishing a second feedback dialect. The npm-registry lock is
|
|
85
|
+
authoritative; source, file, and Git dependency pins are prohibited.
|
|
86
|
+
|
|
87
|
+
## Consequences
|
|
88
|
+
|
|
89
|
+
- Admin and hosted MCP consumers share one stable, public-safe feedback
|
|
90
|
+
contract.
|
|
91
|
+
- Public package consumers can inspect exact privacy and query bounds without
|
|
92
|
+
gaining access to runtime data or storage.
|
|
93
|
+
- Existing consumers must recognise contract version `2026-08-11.v6` and
|
|
94
|
+
configure both `mcp:access` and `admin.feedback.read` before enabling the
|
|
95
|
+
feedback family.
|
|
96
|
+
- The feedback family must continue to consume the released
|
|
97
|
+
`@plasius/schema ^1.4.0` contract directly and fail validation when its
|
|
98
|
+
canonical schema identities or closed vocabularies diverge.
|
|
99
|
+
- Runtime ingestion, storage, authorisation, reporting, audit, and mutation
|
|
100
|
+
workflows remain outside this package.
|
package/docs/adrs/index.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
# ADR Index
|
|
2
2
|
|
|
3
3
|
- [ADR 0001: Public-Safe MCP Admin Contract Package Boundary](./adr-0001-public-safe-mcp-admin-contract-boundary.md)
|
|
4
|
+
- [ADR 0002: Read-Only Pseudonymous Token Reporting Tools](./adr-0002-read-only-pseudonymous-token-reporting-tools.md)
|
|
5
|
+
- [ADR 0003: Exact-main OIDC package publishing](./adr-0003-exact-main-oidc-package-publishing.md)
|
|
6
|
+
- [ADR 0004: Owner Token adjustment MCP boundary](./adr-0004-owner-token-adjustment-mcp-boundary.md)
|
|
7
|
+
- [ADR 0005: Privacy-Safe Read-Only Feedback Contract](./adr-0005-privacy-safe-read-only-feedback-contract.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasius/mcp-admin-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Public-safe MCP admin discovery contract descriptors and response builders.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -97,7 +97,16 @@
|
|
|
97
97
|
"url": "https://github.com/sponsors/Plasius-LTD"
|
|
98
98
|
}
|
|
99
99
|
],
|
|
100
|
+
"overrides": {
|
|
101
|
+
"brace-expansion": "^5.0.9",
|
|
102
|
+
"esbuild": "^0.28.1",
|
|
103
|
+
"nanoid": "^3.3.17",
|
|
104
|
+
"postcss": "^8.5.26"
|
|
105
|
+
},
|
|
100
106
|
"engines": {
|
|
101
107
|
"node": ">=24"
|
|
108
|
+
},
|
|
109
|
+
"dependencies": {
|
|
110
|
+
"@plasius/schema": "^1.4.0"
|
|
102
111
|
}
|
|
103
112
|
}
|
package/legal/CLA-REGISTRY.csv
DELETED