@agledger/mcp-server 3.0.0 → 3.2.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 +130 -170
- package/README.md +24 -21
- package/dist/api-client.d.ts +18 -0
- package/dist/api-client.js +80 -20
- package/dist/credentials.d.ts +52 -1
- package/dist/credentials.js +184 -10
- package/dist/delegation.js +2 -1
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +18 -0
- package/dist/index.js +66 -17
- package/dist/server.d.ts +35 -1
- package/dist/server.js +310 -136
- package/dist/zod-integrity.d.ts +7 -7
- package/dist/zod-integrity.js +11 -9
- package/package.json +12 -10
package/CHANGELOG.md
CHANGED
|
@@ -4,355 +4,315 @@ All notable changes to the AGLedger MCP Server will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
-
## [
|
|
8
|
-
|
|
9
|
-
Targets API 2.0 only. The major version follows the API's, and is 3 because this server is at 2.x. 2.12.0 was never published; its changes are part of this release.
|
|
10
|
-
|
|
11
|
-
### Breaking
|
|
7
|
+
## [Unreleased]
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
- **`agledger_verify` reports a verdict, as `@agledger/verify` and `agledger verify` do.** `structuredContent` carries `verdict` beside verify-core's result: `trusted` when the chain is valid and `keyTrust.status` is `walked`, `failed` when it is not valid, and `unanchored` otherwise. The one text block mirrors `structuredContent` as JSON, which also carries `summary`: the verdict in the other verifiers' words (`Verdict: PASS`, `Verdict: VERIFIED, NOT ANCHORED`, `Verdict: FAIL`) with the next step, worded from `valid` and `keyTrust.status` only. `verdict` is the one `@agledger/verify-core` now puts on its result. An unanchored result says it is not a trusted verdict, and `isError` stays false for it. It is unanchored in two cases: without `trustAnchors` (`keyTrust.status` `no_anchor`), where the text names the key the export claims as its Server's (`exportMetadata.anchoredFrom`, which is not an anchor) and says to call the tool again with a pin; and when the pin was walked but no signature verified under a key it anchors (`no_anchored_signature`), as for an export of unsigned entries pinned on any key. Entries that carry no signature are named as covered by the hash chain only, and agent signatures left unchecked are counted.
|
|
9
|
+
## [3.2.0] - 2026-11-23
|
|
15
10
|
|
|
16
11
|
### Added
|
|
17
12
|
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
13
|
+
- `agledger-mcp --version` (`-V`) prints the version and exits `0`, with no credential needed.
|
|
14
|
+
- **`agledger_verify` takes `allowAfterRetirement` and `expectedEntryCount`.** A peer message signed more than 300 seconds after its key's retirement now fails `CHAIN_FEDERATION_WIRE_INVALID`; `allowAfterRetirement: true` accepts and counts it. `expectedEntryCount` holds the export to an entry count taken out of band, so an export cut from the end with its own (unsigned) counts deleted fails `CHAIN_POSITION_GAP` instead of verifying.
|
|
15
|
+
- **An OIDC-authenticated server can hand over its cert public key.** The cert carries only a thumbprint, so the agent signatures the server sealed could not be re-verified offline. `agledger_discover` now returns `agentKey.publicKeyJwk`, and `AGLEDGER_AGENT_KEYS_FILE` names a JWK Set the key is added to on each exchange, before the cert is used. A file that is not a `{"keys":[...]}` set is left alone and the call fails `AGENT_KEYS_FILE_FAILED` before anything is signed. Server processes and agledger CLI commands can share one file: each adds its key under `<file>.lock`, and one that cannot take the lock within 15 seconds fails `AGENT_KEYS_FILE_FAILED` naming it.
|
|
16
|
+
- `agledger_verify` `agentKeys` takes one JWK, an array, or a `{"keys":[...]}` JWK Set whose entries may wrap the key as `{"publicKeyJwk":{...}}`, as the verifier CLIs' `--agent-keys` does. Only an array was accepted.
|
|
17
|
+
- `agledger_api` returns a text response as the Server sent it. The `html` audit export of AGLedger Server 3.0.0 (and a `csv` or `ndjson` one) used to come back as a JSON object wrapping an escaped string; the text block is now the page itself, and `structuredContent` keeps `_raw` and `_contentType`.
|
|
18
|
+
- The `agledger_api` description and the README say how to reach the request fields and filters of AGLedger Server 3.0.0: `producedBy` on a record or completion, `traceId`, `originRecordId`, `producedBy[key]`, the numeric `criteriaGt/Gte/Lt/Lte` and `metadataGt/Gte/Lt/Lte` bounds on search, `GET /v1/records/counts` with `groupBy`, and `signatureMeaning` on a verdict (accepted only on an ephemeral OIDC cert; an API key gets a 422).
|
|
22
19
|
|
|
23
20
|
### Changed
|
|
24
21
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- `agledger_verify`
|
|
28
|
-
- **
|
|
29
|
-
-
|
|
30
|
-
-
|
|
22
|
+
- **`agledger_verify` reports an untampered export under another Server's pin as `NOT ANCHORED`.** When the `trustAnchors` reach none of the export's keys and it verifies without them, `verdict` is `unanchored` (with `valid: false`), the summary opens `Verdict: NOT ANCHORED` and says to check the pin, and `isError` is not set. It used to read `Verdict: FAIL` like a tampered export. `isError` is now set only for a `failed` verdict.
|
|
23
|
+
- **`agledger_verify` fails an export cut from the end.** The export is held to the two entry counts it states: fewer entries than `exportMetadata.expectedEntries` is `CHECKPOINT_ROW_MISSING`, and fewer than `exportMetadata.totalEntries` is `CHAIN_POSITION_GAP`. The summary has an `Entry count` line saying which count applied, and `result.entryCount` carries both. An export that verified on 3.1.0 with its tail removed now fails.
|
|
24
|
+
- `agledger_verify` runs on `@agledger/verify-core` 2.2.0. A sealed federation message is placed in its key's window with 300 seconds allowed at each edge, so a message signed close to a key change now verifies on the key it names. A signed payload string that begins with U+FEFF no longer fails `CHAIN_PAYLOAD_BINDING_MISMATCH`.
|
|
25
|
+
- **Built on `@modelcontextprotocol/server` 2.x** in place of `@modelcontextprotocol/sdk` 1.x. The runtime dependency tree drops from 97 packages to 5. Tool names, descriptions, arguments and results are unchanged. `tools/list` now reports each input schema as JSON Schema 2020-12 (was draft-07) and no longer sends the default `execution.taskSupport: "forbidden"` on each tool.
|
|
26
|
+
- **`zod` 4 is required.** The dependency is `^4.2.0`, and the `zod` peer dependency is gone. An embedding host that held zod 3 gets zod 4 alongside it.
|
|
27
|
+
- **A program that embeds the exported `AgledgerMcpServer` now holds the `@modelcontextprotocol/server` 2.x `McpServer` through its `mcp` property.** Code that registers more tools on `server.mcp` must be written against the 2.x API.
|
|
28
|
+
- `agledger-mcp --help` prints to stdout. A fatal error prints its cause as well as its message, and the whole stack when `DEBUG` is set. SIGINT and SIGTERM end a running token command before the process exits. `--timeout` and `AGLEDGER_TIMEOUT` refuse a value under one millisecond.
|
|
29
|
+
- The `agledger_api` description says what a 409 `IDEMPOTENCY_KEY_IN_FLIGHT`, a 409 `IDEMPOTENT_WRITE_COMMITTED` and a 503 `SERVER_SHUTTING_DOWN` ask of the caller. The README and `--help` say that most responses carry `nextSteps`, and that listing pages, `GET /v1/schemas` and `GET /v1/admin/orgs` carry none.
|
|
30
|
+
- The README says the interactive API docs at `/docs` are available only when the operator enables them. Tool and resource descriptions describe the export a caller holds rather than the Server's storage.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- **`agledger_api` refuses a `params` value nested below the bracket form, and sends nothing.** `{ criteriaGte: { amount: 500 } }` becomes `criteriaGte[amount]=500`; an object one level deeper, or inside an array, used to be sent as `[object Object]`. It now returns `INVALID_ARGUMENT`.
|
|
35
|
+
- **`agledger_api` no longer fails a write that succeeded with an empty body.** A 204, or any empty body under a JSON content type, returned `UNKNOWN_ERROR: Unexpected end of JSON input`, which an agent could retry as a failed write. An empty body is now `{}`, and a body that does not parse under a JSON content type comes back as `{ _raw, _contentType }`.
|
|
36
|
+
- An error result carries `httpStatus`, and `retryAfter` in seconds when the Server sent a `Retry-After` header. The Server's own fields are forwarded as sent and win over both.
|
|
37
|
+
- A failed connection says why. `fetch failed` is followed by the cause (`ECONNREFUSED`, `ENOTFOUND`, a certificate error), with a suggestion for each; a certificate that is not accepted points at `NODE_EXTRA_CA_CERTS`. The same holds for `agledger_discover` and the resources.
|
|
38
|
+
- Reading `agledger://openapi` or `agledger://llms.txt` after the Server refused the call includes the Server's `detail` and `recoveryHint`, not only `HTTP 401`.
|
|
39
|
+
- `agledger_discover` marks a section the Server refused with `httpStatus` and `error: true` and the Server's body. A failed scope-profiles call used to be omitted, and a refused health or identity call was stored as if it were the answer.
|
|
40
|
+
- An API URL with a path prefix keeps it. `https://gateway.example/agledger` used to send `/v1/records` to `https://gateway.example/v1/records`; requests now go to the prefix followed by the path, and are still pinned to the configured origin.
|
|
41
|
+
|
|
42
|
+
## [3.1.0] - 2026-11-05
|
|
33
43
|
|
|
34
44
|
### Added
|
|
35
45
|
|
|
36
|
-
- **`agledger_verify`
|
|
37
|
-
-
|
|
46
|
+
- **`agledger_verify` re-binds inlined evidence.** On an export fetched with `?evidence=true`, each completion's evidence body and each dispute's filed payload is hashed (SHA-256 over RFC 8785) against the hash its entry signs. An edited body fails `CHAIN_EVIDENCE_BINDING_MISMATCH` where it used to pass. `result.evidenceBinding` counts them, and the summary names a failed or encrypted-mode body. Requires `@agledger/verify-core` 2.1.0.
|
|
47
|
+
- **`federationKeys` on `agledger_verify`** verifies the peer messages a receiving Server seals from federation, against the keys you supply. `result.federationWire` reports `present`, `verified`, `failed` and `afterRetirement` counts, and a failure is `CHAIN_FEDERATION_WIRE_INVALID`. An entry's `history`, taken from the peer's `GET /.well-known/agledger-federation-keys.json`, lets messages sealed before the peer changed its federation key still verify.
|
|
38
48
|
|
|
39
|
-
|
|
40
|
-
- The cert is re-exchanged once half its lifetime has passed, measured from when it was received so clock skew cannot shorten or stretch it. Concurrent tool calls share one exchange. A refresh that fails while the current cert is still valid keeps it and prints one warning on stderr.
|
|
41
|
-
- A 401 on a cert bearer (a revoked cert) forces exactly one re-exchange and one retry of the request, with the same body bytes and the same `Idempotency-Key`. A second 401 is returned as the answer.
|
|
42
|
-
- Every request body is signed with the key bound to the cert (`X-Agent-Signature-Content-Hash` and `X-Agent-Signature`), so the Server records the agent's own signature in the chain entry (`predicate.on_behalf_of.agent_signature`) on the routes that accept one.
|
|
43
|
-
- A failed exchange reaches the tool result as `code: OIDC_EXCHANGE_FAILED` with the Server's status, error body and `recoveryHint`; a token source that cannot produce a token is `OIDC_TOKEN_SOURCE_FAILED`. Tokens are scrubbed from both, and a failing command's stderr is included with anything shaped like a JWT removed. The command text itself is never echoed, since it can carry a secret of its own.
|
|
44
|
-
- A token command (`AGLEDGER_OIDC_TOKEN_CMD`, and `AGLEDGER_ON_BEHALF_OF_CMD` below) runs in its own process group, and the whole group is killed when the command times out after 60 seconds, prints more than 64 KiB, or exits, so a pipeline or a helper it forks cannot outlive the call and pile up across refreshes in a long-running server.
|
|
45
|
-
- `agledger_discover` fetches `/health` without a credential, so "is the Server up" stays answerable when the credential is what is broken.
|
|
46
|
-
- `--help` and the no-credential startup error list all three credential sources. A token file that cannot be read exits 2 at startup rather than failing on the first tool call.
|
|
49
|
+
### Fixed
|
|
47
50
|
|
|
48
|
-
-
|
|
51
|
+
- The `agledger_api` description states that listing pages, `GET /v1/schemas` and `GET /v1/admin/orgs` carry no `nextSteps`, and that the discovery documents and `/a2a` sit at the root rather than under `/v1/`.
|
|
49
52
|
|
|
50
|
-
|
|
53
|
+
### Changed
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
- The README states that the package needs an AGLedger Server 2.0 or later and names the last release for a 1.x Server.
|
|
53
56
|
|
|
54
|
-
|
|
57
|
+
## [3.0.0] - 2026-10-05
|
|
55
58
|
|
|
56
|
-
|
|
59
|
+
Targets API 2.0 only.
|
|
57
60
|
|
|
58
|
-
|
|
61
|
+
### Breaking
|
|
59
62
|
|
|
60
|
-
|
|
63
|
+
- **`agledger_verify` takes `requireSuppliedKeys`, not `requireOutOfBandKeys`.** Behavior is unchanged, but the old name is refused as an unknown argument. In the result, `keyProvenance.outOfBand` is now `keyProvenance.supplied`, `optionalChecks` carries `key_anchoring`, and every result carries `keyTrust`.
|
|
64
|
+
- **`agledger_verify` reports a verdict, as `@agledger/verify` and `agledger verify` do.** `structuredContent` carries `verdict`: `trusted` when the chain is valid and `keyTrust.status` is `walked`, `failed` when it is not valid, and `unanchored` otherwise. The text block mirrors `structuredContent` as JSON and adds a `summary` (`Verdict: PASS`, `Verdict: VERIFIED, NOT ANCHORED` or `Verdict: FAIL`) with the next step. An unanchored result is not a trusted verdict, and `isError` stays false for it. Pass `trustAnchors` to get a trusted verdict.
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
- The README states what AGLedger is in current terms: agent memory, approvals, audit trail and notifications on one API and one signed ledger, self-hosted.
|
|
66
|
+
### Added
|
|
64
67
|
|
|
65
|
-
|
|
68
|
+
- **`trustAnchors` and `distrustedKeys` on `agledger_verify`.** `trustAnchors` takes SPKI digests (`sha256:<hex>`) of vault keys you obtained out of band, and the signed key statements in the export are walked from them. An entry signed by a key the walk does not reach fails `CHAIN_SIGNING_KEY_UNANCHORED`, and a statement that does not hold fails with `KEY_STATEMENT_INVALID`, `KEY_CLOSURE_INVALID` or `CHAIN_KEY_WINDOW_DRIFT`. `distrustedKeys` takes your `VAULT_DISTRUSTED_KEYS` entries and requires `trustAnchors`; a pin may carry a date (`sha256:<hex>@<instant>`) to vouch for what the key signed before that instant. Invalid input is refused with `INVALID_ARGUMENT`. Requires `@agledger/verify-core` 2.0.0.
|
|
69
|
+
- When an API 2.0 export lists a distrusted key and your call did not pass the matching `distrustedKeys` entry, the `CHAIN_KEY_WINDOW_DRIFT` or `KEY_CLOSURE_INVALID` finding names the entry to confirm with the Server's operator.
|
|
70
|
+
- `agledger_verify` reports an unsigned entry written while the vault was signing as the new `CHAIN_ENTRY_UNSIGNED`, and an entry that names a key but carries an all-zero signature as `CHAIN_SIGNATURE_INVALID`.
|
|
66
71
|
|
|
67
72
|
### Changed
|
|
68
73
|
|
|
69
|
-
- **
|
|
74
|
+
- **A timeout returns the key to retry with, and `--timeout` exists.** A POST that times out or loses its connection returns the `Idempotency-Key` it sent as `idempotencyKey`; retry with that exact key to avoid creating a second record. `--timeout <seconds>` (or `AGLEDGER_TIMEOUT`) sets the wait for each response, default 30; anything other than a positive number up to 2147483 exits 2.
|
|
75
|
+
- **A malformed API URL refuses startup.** An `--api-url` or `AGLEDGER_API_URL` that is not an absolute `http` or `https` URL exits 2 before the server accepts a connection, and names where the URL came from.
|
|
76
|
+
- A refused OIDC cert exchange reports the Server's `detail`, which API 2.0 error bodies carry in place of a top-level `message`.
|
|
77
|
+
- A key statement that counts for nothing only because its signer is distrusted and dated before the cutoff is reported as a `keyTrust.notes` entry (`Key note:` in the verdict text) rather than a finding.
|
|
78
|
+
- The README states that under cert auth the Server verifies the body signature on every authenticated route and seals it into each chain entry the request writes. `X-Agent-Signature` is sent only with the OIDC cert credential and only on a request with a body.
|
|
79
|
+
- The README states that `AGLEDGER_OIDC_AGENT_ID` is an assertion, not a choice of agent. A cert is bound to the agent the token names; if `AGLEDGER_OIDC_AGENT_ID` names a different agent, or the token binds none, the exchange is refused with 403 `CERT_AGENT_BINDING_MISMATCH`, and a token bound to a federation shadow agent is refused with 403 `SHADOW_AGENT_CERT_FORBIDDEN`. Bind the agent with `PATCH /v1/agents/{id}` (`oidcIss` and `oidcSub`) or `claimMapping.agent_id` on the trusted issuer.
|
|
70
80
|
|
|
71
|
-
## [2.
|
|
81
|
+
## [2.11.0] - 2026-09-21
|
|
72
82
|
|
|
73
83
|
### Added
|
|
74
84
|
|
|
75
|
-
-
|
|
85
|
+
- **`agledger_verify` refuses a re-attributed export.** The `actorId`, `actorRole` and `actorOwnerId` an export displays are cross-checked against the signed actor claim, and a mismatch fails with the new `CHAIN_ACTOR_ATTRIBUTION_MISMATCH`. Requires `@agledger/verify-core` 1.5.0.
|
|
86
|
+
- **The server can authenticate with an OIDC token instead of an API key.** Set `AGLEDGER_OIDC_TOKEN_FILE` (a file holding the token, such as a Kubernetes projected service-account token) or `AGLEDGER_OIDC_TOKEN_CMD` (a shell command that prints one), plus `AGLEDGER_OIDC_AGENT_ID` to bind the cert to a specific agent. The server generates an Ed25519 key pair in memory, exchanges the token for a short-lived cert (`POST /v1/auth/oidc/cert`) and presents the cert as its bearer, so no long-lived secret sits in the MCP client configuration. An API key wins when set, then the command, then the file; a note names any source that is ignored.
|
|
87
|
+
- The token source is read on every exchange, and the cert is re-exchanged once half its lifetime has passed. A 401 on a cert forces one re-exchange and one retry with the same body and `Idempotency-Key`.
|
|
88
|
+
- Every request body is signed with the key bound to the cert (`X-Agent-Signature-Content-Hash` and `X-Agent-Signature`), so the agent's own signature is recorded in the chain entry on routes that accept one.
|
|
89
|
+
- A failed exchange returns `OIDC_EXCHANGE_FAILED` with the Server's status, error body and `recoveryHint`; a token source that cannot produce a token returns `OIDC_TOKEN_SOURCE_FAILED`. Tokens are scrubbed from both.
|
|
90
|
+
- A token command is killed on a 60-second timeout or more than 64 KiB of output. A token file that cannot be read exits 2 at startup.
|
|
91
|
+
- **The server can act on behalf of a person or another party.** `AGLEDGER_ON_BEHALF_OF_CMD` (a shell command) or `AGLEDGER_ON_BEHALF_OF_FILE` names an RFC 8693 delegation token, which the server sends as `AGLedger-On-Behalf-Of` on every POST. The token comes from the process, never from a tool argument, and is scrubbed from every error and tool result. `agledger_discover` reports only whether a delegation is configured and its source. With the OIDC cert credential the Server records the delegation as `bound` to the agent's identity; with an API key, as `unbound`.
|
|
92
|
+
- **`agledger_verify` takes `agentKeys`**, the Ed25519 public keys (JWKs) of agent certs. An entry whose sealed agent signature names one of them has that signature re-verified offline, and a failure is the new `CHAIN_AGENT_SIGNATURE_INVALID`. Without it, `agentSignatures` counts the signatures without checking them. Requires `@agledger/verify-core` 1.5.0.
|
|
76
93
|
|
|
77
94
|
### Fixed
|
|
78
95
|
|
|
79
|
-
- **
|
|
96
|
+
- **An argument a tool does not declare is refused.** Each tool answers an undeclared argument with `code: UNKNOWN_ARGUMENT`, naming the argument and the ones it accepts, before anything is sent. For example, `agledger_api` called with `body` instead of `params` now says so.
|
|
97
|
+
- The `agledger_api` description and the README name `recoveryHint` as the field to read on Server errors, and `suggestion` for errors the tool raises itself.
|
|
98
|
+
- The `agledger_verify` description lists all 19 failure codes an audit export can produce.
|
|
80
99
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- **`agledger_verify` published its one mandatory argument as optional.** The tool advertised no `required` array at all, so every client read `export` as something it could omit. `jsonStringField` was built with `z.preprocess`, whose input is typed `unknown`; `unknown` subsumes `undefined`, so zod marked the field `optin: 'optional'` and the MCP SDK left it out of `required` when rendering the schema with `io: 'input'`. The field is now an explicit `unknown` piped through the transform, which reports required-ness correctly while still publishing as `type: string` and still accepting a native object from object-native runtimes. `agledger_api`, whose fields are plain `z.string()`, was never affected. Reported by agledger-testbed against the 2.10.0 candidate (F-982). A new `tests/tool-schema.test.ts` asserts the published `required` array of every tool, read back over a real client connection rather than from the zod, since that is where the two came apart.
|
|
84
|
-
|
|
85
|
-
- **Object query parameters reached the wire as `[object Object]`.** The client ran every query value through `String(value)`, so `agledger_api` with `GET /v1/records/search` and a `criteria` or `metadata` filter returned 400 rather than filtering. Objects now expand into the API's bracket notation (`metadata[state]=blocked`), and a `Date` serializes as ISO-8601 rather than the JS locale form the date-time params reject. Found by driving the server against a live API.
|
|
100
|
+
## [2.10.1] - 2026-09-10
|
|
86
101
|
|
|
87
102
|
### Changed
|
|
88
103
|
|
|
89
|
-
-
|
|
104
|
+
- `LICENSE` section 6 names the ciphers this package line ships: Ed25519 (EdDSA), ECDSA P-256 with SHA-256, HMAC-SHA-256, AES-256-GCM, HKDF-SHA-256 and SHA-256. No other files changed.
|
|
90
105
|
|
|
91
|
-
|
|
106
|
+
## [2.10.0] - 2026-08-21
|
|
92
107
|
|
|
93
|
-
|
|
108
|
+
### Added
|
|
94
109
|
|
|
95
|
-
|
|
110
|
+
- **An `idempotencyKey` argument on `agledger_api`, and a generated key on every POST.** To retry a call that may already have reached the Server, pass the key used the first time and the Server returns the original result instead of creating a second record. The key binds to method, route and body, so a retry with a changed body is rejected.
|
|
96
111
|
|
|
97
112
|
### Fixed
|
|
98
113
|
|
|
99
|
-
-
|
|
114
|
+
- Tool argument descriptions are published when the host already has zod 3. The package declares `zod` as a peer dependency, and the server warns on stderr at startup if a dependency tree resolves two different zod versions.
|
|
115
|
+
- `agledger_verify` publishes `export` as a required argument.
|
|
116
|
+
- Object query parameters are sent correctly. `agledger_api` with `GET /v1/records/search` and a `criteria` or `metadata` filter expands objects into bracket notation (`metadata[state]=blocked`), and a `Date` serializes as ISO-8601.
|
|
100
117
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
- **An unknown flag is reported as usage, not as a crash.** `parseArgs` runs in strict mode, so `--version` (which this server does not implement) threw and surfaced as `Uncaught exception: Unknown option '--version'` with exit 0. It now prints an error, points at `--help`, and exits 2.
|
|
118
|
+
### Changed
|
|
104
119
|
|
|
105
|
-
|
|
120
|
+
- The `params` description says the body is not type-coerced: identifier fields such as `externalTaskId`, `correlationId`, `platformRef`, `projectRef` and `publisher` are strings, so all-digit values must be written as strings.
|
|
121
|
+
- The `agledger_api` description covers supersession: `supersedesRecordId` with `?superseded=false` returns the current state of tracked work, `supersededByCount` above 1 means a fork with several current heads, and signed `criteria` differ from unsigned `metadata` as filters.
|
|
106
122
|
|
|
107
|
-
|
|
123
|
+
## [2.9.0] - 2026-08-07
|
|
108
124
|
|
|
109
|
-
###
|
|
125
|
+
### Fixed
|
|
110
126
|
|
|
111
|
-
-
|
|
127
|
+
- A server that refuses to start now exits non-zero. A missing `--api-url` previously printed an error and exited 0.
|
|
128
|
+
- The Quick Start and `--help` show `--api-url` as required.
|
|
129
|
+
- An unknown flag prints an error, points at `--help`, and exits 2.
|
|
112
130
|
|
|
113
|
-
###
|
|
131
|
+
### Changed
|
|
114
132
|
|
|
115
|
-
- **
|
|
116
|
-
- **`bugs` added to package.json.**
|
|
133
|
+
- **Exit codes are a documented contract:** `0` clean, `1` runtime failure, `2` usage or configuration error. A missing `--api-key` or `--api-url` now exits 2. A launcher that checked for exactly `1` to detect bad configuration should check for 2.
|
|
117
134
|
|
|
118
135
|
## [2.8.0] - 2026-08-07
|
|
119
136
|
|
|
120
137
|
### Added
|
|
121
138
|
|
|
122
|
-
-
|
|
139
|
+
- `agledger://llms.txt` resource, fetched live from `GET /llms.txt`. `agledger_discover` points to it.
|
|
123
140
|
|
|
124
141
|
### Changed
|
|
125
142
|
|
|
126
|
-
- **`--api-url` is now required.** The
|
|
143
|
+
- **`--api-url` is now required.** The placeholder default is removed, and the server refuses to start without a URL.
|
|
127
144
|
|
|
128
145
|
## [2.7.0] - 2026-08-05
|
|
129
146
|
|
|
130
|
-
Signing-agility wave 2.
|
|
131
|
-
|
|
132
147
|
### Added
|
|
133
148
|
|
|
134
|
-
-
|
|
149
|
+
- `agledger_verify` handles ES256 chains. Unsupported algorithms still fail closed as `CHAIN_UNSUPPORTED_ALGORITHM`.
|
|
135
150
|
|
|
136
151
|
## [2.6.0] - 2026-08-05
|
|
137
152
|
|
|
138
153
|
### Changed
|
|
139
154
|
|
|
140
|
-
-
|
|
155
|
+
- `agledger_verify` binds algorithm dispatch to the trusted verification key rather than the unverified protected header. Tampered or missing header `alg` values fail as `CHAIN_ALG_MISMATCH`, a key algorithm beyond the build fails as `CHAIN_UNSUPPORTED_ALGORITHM`, the signed kid is cross-checked against `signingKeyId` (`CHAIN_SIGNING_KEY_DRIFT`), and untagged COSE_Sign1 is rejected. Valid Ed25519 exports verify as before.
|
|
141
156
|
|
|
142
157
|
## [2.5.6] - 2026-08-01
|
|
143
158
|
|
|
144
|
-
Security
|
|
145
|
-
|
|
146
|
-
### Changed
|
|
147
|
-
|
|
148
|
-
- Upgraded `@modelcontextprotocol/sdk` to `^1.30.0`. A fresh `npm install @agledger/mcp-server` previously ended with npm reporting moderate vulnerabilities, and enterprise CI that gates on `npm audit --audit-level=moderate` failed the install outright. The chain was `@modelcontextprotocol/sdk` to `@hono/node-server ^1.19.9`, and the advisory (GHSA-frvp-7c67-39w9, path traversal in `serve-static` on Windows via an encoded backslash) is fixed only in `@hono/node-server` 2.x. SDK 1.30.0 widened that range to `^1.19.9 || ^2.0.5`, so there is finally a fix path. Almost certainly not exploitable here, since it is Windows-only on a `serve-static` code path this package does not use, but "no fix available" reads badly on a security product.
|
|
149
|
-
- Refreshed the lockfile to in-range latest, clearing the remaining transitive advisories: `@hono/node-server` 2.0.12, `hono` 4.12.33 (GHSA-xgm2-5f3f-mvvc, GHSA-hvrm-45r6-mjfj, GHSA-w62v-xxxg-mg59), `fast-uri` 3.1.5 (GHSA-v2hh-gcrm-f6hx, GHSA-4c8g-83qw-93j6), `body-parser` 2.3.0. `npm audit` now reports 0 vulnerabilities.
|
|
150
|
-
|
|
151
|
-
### Notes
|
|
152
|
-
|
|
153
|
-
- Verified against a live AGLedger API v1.3.4 over the in-memory MCP transport, not just mocks: all 75 tests pass, including the 8 live integration cases covering discover, auth identity, record list and create, the structured schema-help error, and the record lifecycle.
|
|
159
|
+
### Security
|
|
154
160
|
|
|
155
|
-
|
|
161
|
+
- Upgraded `@modelcontextprotocol/sdk` to `^1.30.0` and refreshed transitive dependencies, so a fresh install reports no `npm audit` vulnerabilities. No tool-surface or behavior change.
|
|
156
162
|
|
|
157
163
|
## [2.5.5] - 2026-07-16
|
|
158
164
|
|
|
159
|
-
Docs and tooling. No tool-surface or behavior change.
|
|
160
|
-
|
|
161
165
|
### Changed
|
|
162
166
|
|
|
163
|
-
- The `agledger_discover` tool description
|
|
164
|
-
- Removed dead vocabulary, stale naming history, and the phantom "fulfill" endpoint framing from the README and pitch text (#99).
|
|
165
|
-
- Refreshed the lockfile to in-range latest (`@agledger/verify-core` 1.0.2, plus dev tooling).
|
|
166
|
-
- Upgraded the TypeScript devDependency to `^7.0.2`. Build, typecheck, and tests all pass under 7.0.2.
|
|
167
|
+
- The `agledger_discover` tool description and quickstart lead with notarize.
|
|
167
168
|
|
|
168
169
|
## [2.5.4] - 2026-06-29
|
|
169
170
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
- Docs only: removed em-dashes from the README prose and the package.json description (cross-repo #98 writing-style sweep). Rewrote each sentence rather than swapping the glyph. No tool-surface or behavior change.
|
|
171
|
+
- Maintenance release with no user-facing changes.
|
|
173
172
|
|
|
174
173
|
## [2.5.3] - 2026-06-20
|
|
175
174
|
|
|
176
175
|
### Changed
|
|
177
176
|
|
|
178
|
-
- Bumped `@agledger/verify-core` to `^1.0.0
|
|
177
|
+
- Bumped `@agledger/verify-core` to `^1.0.0`. No tool-surface or behavior changes.
|
|
179
178
|
|
|
180
179
|
## [2.5.2] - 2026-06-18
|
|
181
180
|
|
|
182
|
-
###
|
|
181
|
+
### Security
|
|
183
182
|
|
|
184
|
-
-
|
|
183
|
+
- Replaced a regex-based trailing-slash strip with a linear scan to remove a polynomial-backtracking risk. No tool-surface or behavior change.
|
|
185
184
|
|
|
186
185
|
## [2.5.1] - 2026-06-10
|
|
187
186
|
|
|
188
187
|
### Changed
|
|
189
188
|
|
|
190
|
-
-
|
|
191
|
-
- No code changes; republished so the distributed tarball carries the corrected license text.
|
|
189
|
+
- `LICENSE` updated to the canonical AGLedger SDK license template v1.5.
|
|
192
190
|
|
|
193
191
|
## [2.5.0] - 2026-06-08
|
|
194
192
|
|
|
195
|
-
|
|
193
|
+
Aligned with AGLedger API v1.0.0 GA. The tool surface is unchanged from 2.4.x.
|
|
196
194
|
|
|
197
195
|
## [2.4.11] - 2026-06-04
|
|
198
196
|
|
|
199
197
|
### Security
|
|
200
198
|
|
|
201
|
-
-
|
|
199
|
+
- `agledger_api` rejects a `path` starting with `//` (returns a `PATH_INVALID` error result), and every request is pinned to the configured API origin, so a crafted path cannot send the API key to another host.
|
|
202
200
|
|
|
203
201
|
### Changed
|
|
204
202
|
|
|
205
|
-
-
|
|
203
|
+
- Added `_meta.requiredScopes` to `agledger_verify` and `agledger_discover`, both `[]`. `agledger_api` declares none, since each route enforces its own scope.
|
|
206
204
|
|
|
207
205
|
## [2.4.10] - 2026-06-04
|
|
208
206
|
|
|
209
|
-
|
|
207
|
+
Published with npm build provenance (verify with `npm audit signatures`) and a CycloneDX SBOM. No functional change.
|
|
210
208
|
|
|
211
209
|
## [2.4.9] - 2026-06-02
|
|
212
210
|
|
|
213
211
|
### Security
|
|
214
212
|
|
|
215
|
-
- `agledger_api`
|
|
213
|
+
- `agledger_api` rejects a `path` containing control characters (`\x00` to `\x1f`, `\x7f`) with a `PATH_INVALID` error result.
|
|
216
214
|
|
|
217
215
|
### Changed
|
|
218
216
|
|
|
219
|
-
- `agledger_api` `destructiveHint` annotation
|
|
217
|
+
- The `agledger_api` `destructiveHint` annotation is now `true`, because the tool can dispatch `DELETE` and `PATCH` requests.
|
|
220
218
|
|
|
221
219
|
## [2.4.8] - 2026-05-29
|
|
222
220
|
|
|
223
221
|
### Fixed
|
|
224
222
|
|
|
225
|
-
- `agledger_verify`
|
|
223
|
+
- `agledger_verify` accepts the raw `GET /v1/verification-keys` response envelope (`{data:[...], ...}`) as `publicKeys` and unwraps `.data`. The compact `{keyId: SPKI-DER-base64}` map and the bare `[{keyId, publicKey, ...}]` list are still accepted.
|
|
226
224
|
|
|
227
225
|
## [2.4.7] - 2026-05-29
|
|
228
226
|
|
|
229
227
|
### Changed
|
|
230
228
|
|
|
231
|
-
-
|
|
229
|
+
- A `payload` rewritten while `coseSign1` stays intact fails `CHAIN_PAYLOAD_BINDING_MISMATCH`, and a signature skipped because of an upstream chain break reports `not-checked`.
|
|
232
230
|
|
|
233
231
|
## [2.4.6] - 2026-05-28
|
|
234
232
|
|
|
235
233
|
### Changed
|
|
236
234
|
|
|
237
|
-
-
|
|
235
|
+
- The `publicKeys` argument of `agledger_verify` accepts either the compact `{keyId: SPKI-DER-base64}` map or the array from `GET /v1/verification-keys`, as a JSON-encoded string or a native object or array. Malformed input returns the standard `{code: "INVALID_JSON", suggestion}` error.
|
|
238
236
|
|
|
239
237
|
## [2.4.5] - 2026-05-28
|
|
240
238
|
|
|
241
239
|
### Changed
|
|
242
240
|
|
|
243
|
-
-
|
|
241
|
+
- `agledger_verify` applies the `oidc_actor` and `key_temporal` checks to exports that carry the new fields; older exports still report them as `skipped_no_input`.
|
|
244
242
|
|
|
245
243
|
## [2.4.4] - 2026-05-27
|
|
246
244
|
|
|
247
|
-
|
|
245
|
+
`agledger_verify` now runs on the shared verification core `@agledger/verify-core`, the same hash-chain, COSE_Sign1 and Ed25519 logic used by the SDK, CLI and `@agledger/verify`.
|
|
248
246
|
|
|
249
247
|
### Changed
|
|
250
248
|
|
|
251
|
-
- Offline verifier failure reasons are now
|
|
252
|
-
- New `requireOutOfBandKeys` input on
|
|
253
|
-
- The
|
|
249
|
+
- Offline verifier failure reasons are now `FailureCode` values from `@agledger/verify-core`, in SCREAMING_SNAKE case.
|
|
250
|
+
- New `requireOutOfBandKeys` input on `agledger_verify`: fail unless every signature is verified against a caller-supplied key, rejecting keys embedded in the export.
|
|
251
|
+
- The result includes `keyProvenance`, showing whether each verified entry's key was caller-supplied or embedded in the export.
|
|
254
252
|
|
|
255
253
|
## [2.4.3] - 2026-05-27
|
|
256
254
|
|
|
257
255
|
### Fixed
|
|
258
256
|
|
|
259
|
-
-
|
|
257
|
+
- `agledger_verify` rejected valid exports. It now reads `chainPosition` (with a `position` fallback for older exports) instead of only the legacy `position` field.
|
|
260
258
|
|
|
261
259
|
## [2.4.2] - 2026-05-27
|
|
262
260
|
|
|
263
|
-
Tracks AGLedger API v0.25.5
|
|
264
|
-
|
|
265
|
-
### Changed
|
|
266
|
-
|
|
267
|
-
- README: the Verdicts capability is now described as accept/reject (was PASS/FAIL).
|
|
261
|
+
Tracks AGLedger API v0.25.5. The renamed routes reach `agledger_api` automatically, and `agledger_verify` is unchanged.
|
|
268
262
|
|
|
269
263
|
## [2.4.1] - 2026-05-21
|
|
270
264
|
|
|
271
|
-
Tracks AGLedger API v0.24.0.
|
|
265
|
+
Tracks AGLedger API v0.24.0.
|
|
272
266
|
|
|
273
267
|
### Changed
|
|
274
268
|
|
|
275
|
-
-
|
|
276
|
-
- Integration test fixtures: `/v1/records/{id}/receipts` → `/v1/records/{id}/completions` (vocab cutover leftover from v0.23.0).
|
|
269
|
+
- `agledger_verify`: `RecordAuditExport.exportMetadata.enterpriseId` is now `orgId`, matching the v0.24.0 export shape.
|
|
277
270
|
|
|
278
271
|
## [2.4.0] - 2026-05-19
|
|
279
272
|
|
|
280
|
-
Tracks AGLedger API v0.23.0
|
|
273
|
+
Tracks AGLedger API v0.23.0, which moves the chain to a canonical COSE_Sign1 envelope.
|
|
281
274
|
|
|
282
|
-
### Changed (
|
|
275
|
+
### Changed (breaking)
|
|
283
276
|
|
|
284
|
-
- `agledger_verify`
|
|
285
|
-
-
|
|
286
|
-
-
|
|
287
|
-
-
|
|
288
|
-
-
|
|
289
|
-
- The verifier picks up a `cborg` runtime dependency (only used by the offline-verifier path; the `agledger_discover` + `agledger_api` tools still use direct `fetch`).
|
|
277
|
+
- `agledger_verify` decodes COSE_Sign1 envelopes (RFC 9052, tag 18, EdDSA) over in-toto v1 Statement payloads with deterministic CBOR (RFC 8949 section 4.2.1), replacing the earlier JCS and detached-Ed25519 verifier. New failure modes are `cose_decode_failed` and `cose_header_mismatch`.
|
|
278
|
+
- `structuredContent` carries a `signatureCoverage` object (`{ signed, unsigned, skipped, total }`). Do not conclude "Ed25519-verified" from `valid: true` alone; report `signatureCoverage` or `integrityLevel`.
|
|
279
|
+
- New `chainIntegrityReason: "payload_drift"` when the visible `payload` differs from the predicate signed in `coseSign1`.
|
|
280
|
+
- Export format 1.0 (`exportFormatVersion: "1.0"`) is rejected with `unsupported_algorithm`. Re-export the chain with `agledger_api method=GET path=/v1/records/{id}/audit-export` from a v0.23.0 or later Server.
|
|
281
|
+
- Adds a `cborg` runtime dependency, used only by the offline verifier.
|
|
290
282
|
|
|
291
|
-
### Changed
|
|
292
|
-
|
|
293
|
-
- `agledger_discover` quickstart step 4: "Do your work, then submit a receipt" → "submit a completion"; path `/v1/records/{id}/receipts` → `/v1/records/{id}/completions`.
|
|
294
|
-
- `agledger_api` tool description: route example `/v1/records/{id}/receipts` → `/v1/records/{id}/completions`. Workflow line "POST /v1/records/{id}/receipts — submit evidence when done" → "POST /v1/records/{id}/completions — submit evidence when done".
|
|
295
|
-
|
|
296
|
-
The three-tool surface is unchanged: `agledger_discover`, `agledger_api`, `agledger_verify`. `agledger_api` is a pure HTTP pass-through, so the API-side renames (route paths, request/response field names, webhook event names, scopes) surface verbatim. Agents writing prompts that target `agledger_api method=POST path=/v1/records/{id}/receipts` need to update the path to `/v1/records/{id}/completions`.
|
|
297
|
-
|
|
298
|
-
### Tests
|
|
283
|
+
### Changed
|
|
299
284
|
|
|
300
|
-
-
|
|
285
|
+
- The `agledger_discover` quickstart and the `agledger_api` description now say "submit a completion" with the path `/v1/records/{id}/completions` (was `/v1/records/{id}/receipts`). Update any prompts that target the old path.
|
|
301
286
|
|
|
302
287
|
## [2.3.3] - 2026-05-06
|
|
303
288
|
|
|
304
289
|
### Fixed
|
|
305
290
|
|
|
306
|
-
-
|
|
307
|
-
|
|
308
|
-
### Tests
|
|
309
|
-
|
|
310
|
-
- Added Gemini-shape regressions covering all three affected fields: stringified-JSON path, native-object path (back-compat), and malformed-JSON error path. The new `INVALID_JSON` error code surfaces a structured suggestion telling the agent how to retry.
|
|
291
|
+
- Gemini MCP integrations work on non-trivial calls. `agledger_api.params`, `agledger_verify.export` and `agledger_verify.publicKeys` are declared as JSON-encoded strings, which Gemini's function-call grammar accepts. Object-native runtimes can still pass a native object. Malformed JSON returns the `INVALID_JSON` error with a suggestion for retrying.
|
|
311
292
|
|
|
312
293
|
## [2.3.2] - 2026-05-06
|
|
313
294
|
|
|
314
295
|
### Fixed
|
|
315
296
|
|
|
316
|
-
-
|
|
317
|
-
-
|
|
318
|
-
- **`--help` banner lists all three tools.** `agledger_verify` was missing from the Tools section.
|
|
319
|
-
- **`mirrorContent` no longer pretty-prints.** The text mirror is consumed by an LLM, not a human — dropping the 2-space indent saves ~25% on agent context tokens for large paginated responses.
|
|
320
|
-
|
|
321
|
-
### Build
|
|
322
|
-
|
|
323
|
-
- Added a `files` allowlist to `package.json` so the npm tarball only ships `dist/`, `LICENSE`, `README.md`, `CHANGELOG.md`, and `package.json` (24 files vs. 29 in 2.3.1). No more shipping `tests/` or `tsconfig.json`.
|
|
324
|
-
|
|
325
|
-
### Tests
|
|
326
|
-
|
|
327
|
-
- Added `assertContentMirrorsStructured` helper and a dedicated F-531 regression suite covering success and error paths on all three tools, plus a parity test asserting `SERVER_VERSION` matches `package.json`.
|
|
297
|
+
- Tool results are visible to LLM-driven MCP runtimes. All three tools mirror `structuredContent` into a single, compact text content block on every success and error path.
|
|
298
|
+
- `serverInfo.version`, `User-Agent` and the `--help` banner read the version from `package.json`, and the banner lists all three tools.
|
|
328
299
|
|
|
329
300
|
## [2.3.1] - 2026-04-30
|
|
330
301
|
|
|
331
|
-
Tracks AGLedger API v0.22.13.
|
|
332
|
-
|
|
333
|
-
### Changed
|
|
334
|
-
|
|
335
|
-
- Re-published as part of the v0.7.1 SDK/CLI sweep tracking API v0.22.13. No tool-surface changes.
|
|
302
|
+
Tracks AGLedger API v0.22.13. No tool-surface changes.
|
|
336
303
|
|
|
337
304
|
## [2.3.0] - 2026-04-27
|
|
338
305
|
|
|
339
|
-
Tracks AGLedger API v0.21.5. Every `/v1/mandates/*` route is now `/v1/records
|
|
340
|
-
|
|
341
|
-
### Changed (BREAKING)
|
|
306
|
+
Tracks AGLedger API v0.21.5. Every `/v1/mandates/*` route is now `/v1/records/*`, and `Contract Type` is `Type`.
|
|
342
307
|
|
|
343
|
-
|
|
344
|
-
- **`agledger_verify` tool description** points at `/v1/records/{id}/audit-export`. The `INVALID_EXPORT` error suggestion was updated similarly.
|
|
308
|
+
### Changed (breaking)
|
|
345
309
|
|
|
346
|
-
|
|
310
|
+
- Offline verifier output fields are renamed: `mandateId` to `recordId` and `contractType` to `type`; `MandateAuditExport` is now `RecordAuditExport`. The signature input `{position}:{payloadHash}:{previousHash}` is unchanged.
|
|
311
|
+
- The `agledger_verify` description and `INVALID_EXPORT` suggestion point at `/v1/records/{id}/audit-export`.
|
|
347
312
|
|
|
348
|
-
|
|
349
|
-
1. `GET /v1/schemas` — list Record types.
|
|
350
|
-
2. `GET /v1/schemas/{type}` — get required fields and examples.
|
|
351
|
-
3. `POST /v1/records` — create a record.
|
|
352
|
-
4. `POST /v1/records/{id}/receipts` — submit evidence when done.
|
|
353
|
-
- **`agledger_api` tool description** uses the new vocabulary throughout (workflow steps, path examples, `PATH_INVALID` error message and suggestion).
|
|
354
|
-
- **README** Tools table, Agent workflow section, and "What is AGLedger?" bullet list use Record / Type vocabulary.
|
|
313
|
+
### Changed
|
|
355
314
|
|
|
356
|
-
|
|
315
|
+
- The `agledger_discover` quickstart reads: `GET /v1/schemas` to list Record types, `GET /v1/schemas/{type}` for required fields and examples, `POST /v1/records` to create a record, `POST /v1/records/{id}/receipts` to submit evidence when done.
|
|
316
|
+
- The `agledger_api` description and the README use the Record and Type vocabulary.
|
|
357
317
|
|
|
358
|
-
|
|
318
|
+
Releases before 2.3.0 are listed on npm (https://www.npmjs.com/package/@agledger/mcp-server?activeTab=versions).
|