-
Notifications
You must be signed in to change notification settings - Fork 110
feat!: adopt web-identity-schemas, drop zod v3 #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| "@agentcommercekit/keys": patch | ||
| --- | ||
|
|
||
| Build the `./secp256r1` subpath export. The export was declared in `package.json` | ||
| but its entry was missing from `tsdown.config.ts`, so `dist/curves/secp256r1.{js,d.ts}` | ||
| were never emitted and importing `@agentcommercekit/keys/secp256r1` failed (and | ||
| `publint` flagged the missing files). Added the build entry so the export resolves. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| --- | ||
| "@agentcommercekit/did": major | ||
| "@agentcommercekit/jwt": major | ||
| "@agentcommercekit/vc": major | ||
| "@agentcommercekit/caip": major | ||
| "@agentcommercekit/ack-id": major | ||
| "@agentcommercekit/ack-pay": major | ||
| "agentcommercekit": major | ||
| --- | ||
|
|
||
| Adopt [`web-identity-schemas`](https://github.com/catena-labs/web-identity-schemas) | ||
| as the source of truth for DID/JWT/VC validation schemas and DID/JWT types, and | ||
| **drop Zod v3 support**. | ||
|
|
||
| Breaking changes: | ||
|
|
||
| - **Zod v3 is no longer supported.** The `./schemas/zod/v3` and `./schemas/zod/v4` | ||
| subpath exports are removed; each package now exports a single `./schemas/zod` | ||
| (Zod v4). The `zod` optional peer range is now `^4.0.0`. Import from | ||
| `@agentcommercekit/<pkg>/schemas/zod` instead of `.../schemas/zod/v3` or | ||
| `.../schemas/zod/v4`. | ||
| - **DID validation is stricter.** `didUriSchema` and `isDidUri` now enforce the | ||
| full DID-core syntax (via `web-identity-schemas`' `DidSchema`/`isDid`) instead of | ||
| a permissive `startsWith("did:")` check. Malformed DIDs that previously passed | ||
| are now rejected (and validation error details have changed). | ||
| - `DidUri` and `JwtString` are now re-exported from `web-identity-schemas` (`Did` | ||
| and `JwtString` respectively). They remain structurally compatible; `JwtString` | ||
| widens to `string`. | ||
| - **VC validation is stricter.** `credentialSchema` (and the `isCredential` guard | ||
| built on it) is now backed by w-i-s' `CredentialV1Schema`, which enforces the VC | ||
| Data Model v1.1 shape: the `@context` must start with the v1 core URI, `type` | ||
| must include `"VerifiableCredential"`, `issuanceDate` must be an ISO-8601 | ||
| datetime, and `id` must be a URI. Loosely-shaped objects that the previous | ||
| hand-rolled schema accepted may now be rejected. ACK-issued credentials (always | ||
| v1) are unaffected, and the credential-verification path | ||
| (`parseJwtCredential`/`verifyParsedCredential`) is unchanged — it still uses a | ||
| separate structural guard, not this authoring schema. | ||
|
|
||
| `web-identity-schemas` is now a dependency of `did`, `jwt`, and `vc`. The VC | ||
| credential schema is now backed by w-i-s' `CredentialV1Schema` while preserving | ||
| ACK's issuer-normalization and `JwtProof2020` handling. CAIP, payment, A2A, | ||
| controller-claim, and `JwtProof2020` schemas remain hand-rolled. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/ack-id/src/a2a/schemas/zod/v4.ts → packages/ack-id/src/a2a/schemas/zod.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import * as z from "zod/v4" | ||
| import * as z from "zod" | ||
|
|
||
| const roleSchema = z.enum(["agent", "user"]) | ||
|
|
||
|
|
||
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/ack-id/src/schemas/zod/v3.ts → packages/ack-id/src/schemas/zod.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/ack-pay/src/schemas/zod/v4.ts → packages/ack-pay/src/schemas/zod.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,7 @@ | ||
| import { defineConfig } from "tsdown/config" | ||
|
|
||
| export default defineConfig({ | ||
| entry: [ | ||
| "src/index.ts", | ||
| "src/schemas/zod/v3.ts", | ||
| "src/schemas/zod/v4.ts", | ||
| "src/schemas/valibot.ts", | ||
| ], | ||
| entry: ["src/index.ts", "src/schemas/zod.ts", "src/schemas/valibot.ts"], | ||
| dts: true, | ||
| silent: true, | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add a language tag to the example fence.
The fenced block at Line 46 is missing a language identifier, which triggers MD040 in markdownlint.
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 46-46: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Source: Linters/SAST tools