fix: extract lightweight service clients#707
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extracts the Gatekeeper/Drawbridge/Keymaster HTTP clients (and their wire contracts) into a new lightweight @didcid/clients package, then migrates internal consumers (including MCP + Keymaster) to depend on that package instead of the full Gatekeeper runtime to avoid pulling in IPFS/Helia/libp2p/native dependencies.
Changes:
- Introduces
@didcid/clientswith axios+buffer-only HTTP clients and shared contract/type definitions. - Repoints MCP, Keymaster, mediators, and apps/tests/build aliases to import clients from
@didcid/clients/*. - Preserves legacy client entry points via compatibility re-exports from
@didcid/gatekeeper/*and@didcid/keymaster/client.
Reviewed changes
Copilot reviewed 69 out of 72 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Adds TS path aliases for @didcid/clients/* entry points. |
| jest.config.js | Adds moduleNameMapper entries so Jest resolves @didcid/clients/* to source during tests. |
| package.json | Ensures workspace build includes @didcid/clients before downstream packages. |
| package-lock.json | Adds workspace link + dependency graph updates for @didcid/clients. |
| AGENTS.md | Documents the new lightweight client/package boundary expectations. |
| packages/clients/package.json | Defines new published package metadata, exports map, and deps (axios/buffer). |
| packages/clients/tsconfig.json | Adds TS build config for ESM + types output. |
| packages/clients/rollup.cjs.config.js | Bundles compiled ESM into CJS artifacts for subpath exports. |
| packages/clients/README.md | Documents new client entry points and type-only subpaths. |
| packages/clients/src/index.ts | Adds root barrel exports for the three HTTP clients. |
| packages/clients/src/gatekeeper-types.ts | Adds Gatekeeper/Drawbridge wire contracts + shared types. |
| packages/clients/src/gatekeeper-client.ts | Adds Gatekeeper HTTP client implementation. |
| packages/clients/src/drawbridge-client.ts | Adds Drawbridge client extending Gatekeeper client. |
| packages/clients/src/keymaster-types.ts | Adds Keymaster wire contracts/types. |
| packages/clients/src/keymaster-client.ts | Adds Keymaster HTTP client implementation (moved from Keymaster package). |
| packages/mcp-server/package.json | Switches MCP dependency from @didcid/gatekeeper to @didcid/clients. |
| packages/mcp-server/src/runtime.ts | Switches Drawbridge client import to @didcid/clients/drawbridge. |
| packages/keymaster/package.json | Removes @didcid/gatekeeper/axios deps, adds @didcid/clients + multiformats. |
| packages/keymaster/src/keymaster.ts | Stops reaching through @didcid/ipfs/utils; validates DIDs via multiformats CID directly and updates Gatekeeper type imports. |
| packages/keymaster/src/types.ts | Collapses types surface to re-export from clients package plus local options interface. |
| packages/keymaster/src/keymaster-client.ts | Converts legacy @didcid/keymaster/client to a compatibility re-export of @didcid/clients/keymaster. |
| packages/keymaster/src/cli.ts | Switches Drawbridge client import to @didcid/clients/drawbridge. |
| packages/keymaster/rollup.cjs.config.js | Improves Rollup externals handling (including subpath imports). |
| packages/keymaster/README.md | Updates documentation examples to use @didcid/clients/* client imports. |
| packages/gatekeeper/package.json | Removes axios dep, adds @didcid/clients. |
| packages/gatekeeper/src/types.ts | Switches Gatekeeper types surface to be based on @didcid/clients contracts. |
| packages/gatekeeper/src/gatekeeper-client.ts | Converts legacy @didcid/gatekeeper/client to compatibility re-export of @didcid/clients/gatekeeper. |
| packages/gatekeeper/src/drawbridge-client.ts | Converts legacy @didcid/gatekeeper/drawbridge to compatibility re-export of @didcid/clients/drawbridge. |
| packages/gatekeeper/rollup.cjs.config.js | Improves Rollup externals handling (including subpath imports). |
| packages/gatekeeper/README.md | Updates documentation examples to use @didcid/clients/gatekeeper. |
| services/keymaster/server/src/keymaster-router-types.ts | Updates Drawbridge client type import to @didcid/clients/drawbridge. |
| services/keymaster/server/src/keymaster-api.ts | Switches Drawbridge client import to @didcid/clients/drawbridge. |
| services/herald/server/src/index.ts | Switches Gatekeeper/Keymaster client imports to @didcid/clients/*. |
| services/drawbridge/server/src/drawbridge-api.ts | Switches Gatekeeper client import to @didcid/clients/gatekeeper. |
| services/didcomm/server/src/index.ts | Switches Gatekeeper client import to @didcid/clients/gatekeeper. |
| services/explorer/src/App.tsx | Switches Gatekeeper client import to @didcid/clients/gatekeeper. |
| services/mediators/satoshi/src/satoshi-mediator.ts | Switches Gatekeeper/Keymaster client imports to @didcid/clients/*. |
| services/mediators/zcash/src/zcash-mediator.ts | Switches Gatekeeper/Keymaster client imports to @didcid/clients/*. |
| services/mediators/solana/src/solana-mediator.ts | Switches Gatekeeper/Keymaster client imports to @didcid/clients/*. |
| services/mediators/ethereum/src/ethereum-mediator.ts | Switches Gatekeeper/Keymaster client imports to @didcid/clients/*. |
| services/mediators/hyperswarm/src/hyperswarm-mediator.ts | Switches Gatekeeper/Keymaster client imports to @didcid/clients/*. |
| services/mediators/pinning/src/pinning-mediator.ts | Switches Gatekeeper client import to @didcid/clients/gatekeeper. |
| services/mediators/filecoin/src/filecoin-mediator.ts | Switches Gatekeeper client import to @didcid/clients/gatekeeper. |
| services/mediators/lightning/src/lightning-mediator.ts | Switches Gatekeeper client import to @didcid/clients/gatekeeper. |
| scripts/archon-cli.js | Switches Keymaster client import to @didcid/clients/keymaster. |
| scripts/admin-cli.js | Switches Gatekeeper client import to @didcid/clients/gatekeeper. |
| tests/keymaster/client.test.ts | Switches Keymaster client test import to @didcid/clients/keymaster. |
| tests/gatekeeper/client.test.ts | Switches Gatekeeper client test import to @didcid/clients/gatekeeper. |
| tests/gatekeeper/drawbridge-client.test.ts | Switches Drawbridge client test import to @didcid/clients/drawbridge. |
| tests/hypr-confirm.js | Switches Gatekeeper client import to @didcid/clients/gatekeeper. |
| tests/clients/package-boundary.test.ts | Adds dependency-boundary regression tests for @didcid/clients + legacy re-exports. |
| apps/react-wallet/vite.config.ts | Updates alias to point Gatekeeper client import to @didcid/clients/gatekeeper build output. |
| apps/react-wallet/src/contexts/WalletProvider.tsx | Switches Drawbridge client import to @didcid/clients/drawbridge. |
| apps/react-wallet/src/components/ImageTab.tsx | Switches Gatekeeper client import to @didcid/clients/gatekeeper. |
| apps/react-wallet/src/components/IdentitiesTab.tsx | Switches Gatekeeper client import to @didcid/clients/gatekeeper. |
| apps/react-wallet/src/components/DropDownID.tsx | Switches Gatekeeper client import to @didcid/clients/gatekeeper. |
| apps/browser-extension/webpack.common.js | Updates alias to point Gatekeeper client import to @didcid/clients/gatekeeper build output. |
| apps/browser-extension/src/contexts/WalletProvider.tsx | Switches Drawbridge client import to @didcid/clients/drawbridge. |
| apps/browser-extension/src/components/ImageTab.tsx | Switches Gatekeeper client import to @didcid/clients/gatekeeper. |
| apps/browser-extension/src/components/IdentitiesTab.tsx | Switches Gatekeeper client import to @didcid/clients/gatekeeper. |
| apps/browser-extension/src/components/DropDownID.tsx | Switches Gatekeeper client import to @didcid/clients/gatekeeper. |
| apps/keymaster-client/vite.config.js | Updates alias to point Keymaster client import to @didcid/clients/keymaster build output. |
| apps/keymaster-client/src/App.jsx | Switches Keymaster client import to @didcid/clients/keymaster. |
| apps/gatekeeper-client/vite.config.js | Updates alias to point Drawbridge client import to @didcid/clients/drawbridge build output. |
| apps/gatekeeper-client/src/App.jsx | Switches Drawbridge client import to @didcid/clients/drawbridge. |
| demo/commonjs-demo/src/demo.ts | Updates example imports to @didcid/clients/*. |
| README.md | Updates architecture docs to reference the new packages/clients client source. |
| SECURITY_AUDIT.md | Updates audit file list to reflect client file moves into packages/clients. |
| docs/services/keymaster/README.md | Updates “client contract” references to point at packages/clients/src/keymaster-client.ts. |
| docs/services/keymaster/drop-in-parity-checklist.md | Updates “client contract” references to point at packages/clients/src/keymaster-client.ts. |
| docs/didcomm-design.md | Updates KeymasterClient reference to new clients location. |
| docs/clean-architecture-assessment.md | Updates boundary diagrams/links to new clients package client locations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
@didcid/clientspackage containing the Gatekeeper, Drawbridge, and Keymaster HTTP clients plus their wire contractsWhy
@didcid/mcp-serverimported only the Drawbridge HTTP client but depended on the full Gatekeeper runtime. Keymaster also depended on Gatekeeper for the Drawbridge contract, so changing MCP's direct import alone would still install Gatekeeper transitively. That pulled in IPFS, Helia, libp2p, and the native@ipshipyard/node-datachannelpackage on first-run MCP installs.The new package depends only on Axios and Buffer. Keymaster now consumes the Drawbridge contract from it, and its small DID validation dependency uses
multiformatsdirectly instead of reaching through@didcid/ipfs/utils.Impact
A clean tarball installation of MCP, Keymaster, and the new clients package contains none of
@didcid/gatekeeper,@didcid/ipfs,helia,libp2p, or@ipshipyard/node-datachannel. Existing client import paths continue to work through compatibility shims.Validation
npm run buildnpm run lint(passes with one pre-existing Drawbridge warning)npm test -- --runInBand— 62 suites passed, 1 skipped; 1,553 tests passed, 3 skippednpm ls @didcid/gatekeeper @didcid/ipfs helia libp2p @ipshipyard/node-datachannel --all— emptyCloses #688