@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/CHANGELOG.md +65 -0
- package/README.md +59 -0
- package/dist/index.cjs +983 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -7
- package/dist/index.d.ts +87 -7
- package/dist/index.js +966 -8
- 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/index.md +3 -0
- package/package.json +6 -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.
|
package/docs/adrs/index.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
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)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasius/mcp-admin-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Public-safe MCP admin discovery contract descriptors and response builders.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -97,6 +97,11 @@
|
|
|
97
97
|
"url": "https://github.com/sponsors/Plasius-LTD"
|
|
98
98
|
}
|
|
99
99
|
],
|
|
100
|
+
"overrides": {
|
|
101
|
+
"brace-expansion": "^5.0.8",
|
|
102
|
+
"esbuild": "^0.28.1",
|
|
103
|
+
"postcss": "^8.5.23"
|
|
104
|
+
},
|
|
100
105
|
"engines": {
|
|
101
106
|
"node": ">=24"
|
|
102
107
|
}
|
package/legal/CLA-REGISTRY.csv
DELETED