Extract SDK into @attest-protocol/attest-ts#70
Conversation
Move receipt, store, and taxonomy modules to the standalone SDK package. Proxy and CLI now import from @attest-protocol/attest-ts instead of local source. 51 proxy/CLI tests pass against the SDK.
There was a problem hiding this comment.
Pull request overview
This PR refactors the repo to consume the newly extracted @attest-protocol/attest-ts SDK, removing the previously in-repo receipt/store/taxonomy implementation and updating the proxy/CLI to import SDK APIs directly.
Changes:
- Remove local
src/receipt/,src/store/, andsrc/taxonomy/modules (and their tests) after extraction to the standalone SDK. - Add
@attest-protocol/attest-tsas a dependency and update proxy/CLI/test imports to use it. - Re-export
VERSIONfrom the SDK viasrc/index.ts.
Reviewed changes
Copilot reviewed 41 out of 42 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test-utils/receipts.ts | Updates receipt factory imports to come from the extracted SDK. |
| src/taxonomy/types.ts | Deletes local taxonomy types (moved to SDK). |
| src/taxonomy/index.ts | Deletes local taxonomy barrel exports (moved to SDK). |
| src/taxonomy/config.ts | Deletes local taxonomy config loader (moved to SDK). |
| src/taxonomy/config.test.ts | Deletes taxonomy config tests (moved to SDK). |
| src/taxonomy/classify.ts | Deletes local tool-call classifier (moved to SDK). |
| src/taxonomy/classify.test.ts | Deletes classifier tests (moved to SDK). |
| src/taxonomy/actions.ts | Deletes local action taxonomy constants/helpers (moved to SDK). |
| src/taxonomy/actions.test.ts | Deletes taxonomy action tests (moved to SDK). |
| src/store/verify.ts | Deletes local stored-chain verification helper (moved to SDK). |
| src/store/verify.test.ts | Deletes stored-chain verification tests (moved to SDK). |
| src/store/store.ts | Deletes local SQLite receipt store implementation (moved to SDK). |
| src/store/store.test.ts | Deletes receipt store tests (moved to SDK). |
| src/store/index.ts | Deletes local store exports (moved to SDK). |
| src/receipt/types.ts | Deletes local receipt schema types/constants (moved to SDK). |
| src/receipt/types.test.ts | Deletes receipt schema type/constant tests (moved to SDK). |
| src/receipt/signing.ts | Deletes local signing implementation (moved to SDK). |
| src/receipt/signing.test.ts | Deletes signing tests (moved to SDK). |
| src/receipt/index.ts | Deletes local receipt barrel exports (moved to SDK). |
| src/receipt/hash.ts | Deletes local hashing/canonicalization implementation (moved to SDK). |
| src/receipt/hash.test.ts | Deletes hashing tests (moved to SDK). |
| src/receipt/create.ts | Deletes local receipt creation helper (moved to SDK). |
| src/receipt/create.test.ts | Deletes receipt creation tests (moved to SDK). |
| src/receipt/chain.ts | Deletes local chain verification logic (moved to SDK). |
| src/receipt/chain.test.ts | Deletes chain verification tests (moved to SDK). |
| src/proxy/main.ts | Switches proxy entrypoint imports (store/taxonomy/signing) to the SDK. |
| src/proxy/main.test.ts | Updates proxy tests to use the SDK store implementation. |
| src/proxy/emitter.ts | Updates emitter to use SDK receipt creation/signing/hashing + taxonomy + store types. |
| src/proxy/emitter.test.ts | Updates emitter tests to use SDK hashing/signing/store helpers. |
| src/index.ts | Re-exports VERSION from the SDK. |
| src/cli/verify.ts | Uses SDK verifyStoredChain and store types. |
| src/cli/verify.test.ts | Updates verify command tests to use SDK signing/hashing/store. |
| src/cli/main.ts | Updates CLI entrypoint store import to SDK. |
| src/cli/main.test.ts | Updates CLI tests to use SDK helpers. |
| src/cli/list.ts | Updates receipt/store query type imports to SDK. |
| src/cli/list.test.ts | Updates list command tests to use SDK store. |
| src/cli/inspect.ts | Updates inspect command to use SDK verifyReceipt and store type. |
| src/cli/inspect.test.ts | Updates inspect tests to use SDK receipt constants/types/signing/store. |
| src/cli/export.ts | Updates export command store type import to SDK. |
| src/cli/export.test.ts | Updates export tests to use SDK store. |
| package.json | Adds @attest-protocol/attest-ts dependency. |
| pnpm-lock.yaml | Locks the new SDK dependency. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }, | ||
| "packageManager": "pnpm@10.33.0", | ||
| "dependencies": { | ||
| "@attest-protocol/attest-ts": "file:../attest-ts" |
There was a problem hiding this comment.
The dependency on @attest-protocol/attest-ts is declared as a local file:../attest-ts path. This makes installs/builds non-reproducible and will fail in CI or for any consumer that doesn’t have a sibling ../attest-ts directory. Prefer depending on a published semver (or a workspace: protocol entry, with the workspace configured to include the SDK package).
| "@attest-protocol/attest-ts": "file:../attest-ts" | |
| "@attest-protocol/attest-ts": "^0.1.0" |
| .: | ||
| dependencies: | ||
| '@attest-protocol/attest-ts': | ||
| specifier: file:../attest-ts | ||
| version: file:../attest-ts |
There was a problem hiding this comment.
pnpm-lock.yaml pins @attest-protocol/attest-ts to a local directory (file:../attest-ts). This will break clean checkouts/builds unless the SDK exists at that relative path. Once package.json is switched to a published/workspace dependency, regenerate the lockfile so it no longer contains a file: resolution.
| @@ -1 +1 @@ | |||
| export const VERSION = "0.1.0"; | |||
| export { VERSION } from "@attest-protocol/attest-ts"; | |||
There was a problem hiding this comment.
src/index.ts now re-exports VERSION from @attest-protocol/attest-ts, while other updated code imports RECEIPT_VERSION from the SDK and aliases it to VERSION. This is easy to misinterpret (package version vs receipt schema version) and can accidentally become a breaking API change for consumers of this package. Consider exporting an explicitly named RECEIPT_VERSION (and/or keeping a stable VERSION export with clear meaning) so callers don’t depend on an ambiguous symbol.
| export { VERSION } from "@attest-protocol/attest-ts"; | |
| export { VERSION } from "@attest-protocol/attest-ts"; | |
| export { RECEIPT_VERSION } from "@attest-protocol/attest-ts"; |
Address Copilot review: make the distinction between package version and receipt schema version explicit by exporting both symbols.
|
Addressing Copilot review:
|
Resolve conflicts: delete SDK files moved to @attest-protocol/attest-ts, update new stats command imports to use SDK. 69 tests pass.
@attest-protocol/attest-ts@0.1.0 is now on npm. Replace the local file: reference with ^0.1.0 for reproducible installs.
Summary
src/receipt/,src/store/,src/taxonomy/(moved toattest-protocol/attest-ts)@attest-protocol/attest-tsas a dependencyContext
The SDK (receipt creation, signing, hashing, store, taxonomy) has been extracted into the standalone
@attest-protocol/attest-tspackage. This repo now contains only the MCP proxy and CLI, consuming the SDK as a dependency.Related: attest-protocol/attest-ts@ff1d7e0, attest-protocol/spec#1
Test plan
pnpm run checkpasses (typecheck + lint)pnpm run test— 51 tests passpnpm run build— clean compileattestandattest-proxybinaries work end-to-end