feat(adapters): add Claude Code Gateway hook adapter#326
Conversation
Signed-off-by: Ziyang Guo <121015044+RerankerGuo@users.noreply.github.com>
Signed-off-by: Ziyang Guo <121015044+RerankerGuo@users.noreply.github.com>
Signed-off-by: Ziyang Guo <121015044+RerankerGuo@users.noreply.github.com>
|
Hi @Arreboi06 👋, |
|
I pushed a follow-up hardening commit ( The most important improvement is that the SDK default tools are now executable through Verification after the update:
This should make the PR stronger as a challenge-level solution for #235: unified SDK + multi-platform adapters + docs + tests. |
|
Triage note for #235 duplicate/scope cleanup: The shared Gateway client / generic adapter SDK part now overlaps with #316, which is the currently verified lightweight baseline for #235. #316 is CI green, locally verified, and keeps the reusable boundary small: GatewayMemoryClient + createGatewayPlatformAdapter() + lifecycle mapping tests + focused docs. For this PR, please consider re-scoping rather than merging it as-is:
This is not a rejection of the platform-specific work. It is a request to avoid merging multiple competing adapter frameworks from one broad #235 PR now that a smaller canonical gateway-client base exists. |
e6ff2a1 to
7949d10
Compare
|
Rescoped this PR according to the #235 duplicate/scope cleanup note. What changed in the latest force-push:
Current shape:
Verification after the rescope: npm.cmd test -- --reporter=dot
npm.cmd run build:plugin
git diff --check origin/main...HEAD
This is now intended as a small platform-specific follow-up on top of the canonical #316 Gateway client boundary, not as a competing adapter framework. |



Summary
This PR has been rescoped per the #235 duplicate/scope cleanup note.
It now reuses the #316 Gateway client boundary instead of carrying a parallel generic adapter SDK. The remaining unique value is a focused Claude Code platform helper built on top of
GatewayMemoryClient+createGatewayPlatformAdapter().What changed
GatewayMemoryClient,createGatewayPlatformAdapter(), Gateway lifecycle mapping tests, and focused adapter docs.createClaudeCodeGatewayAdapter()maps prompt prefetch, completed-turn capture, search, and session flush to the Gateway adapter lifecycle.createClaudeCodeContextFromHookInput()maps Claude Code hook JSON identity fields (session_id,cwd) into adapter context.createClaudeCodeSessionKey()derives stable workspace/session keys for TDAI memory grouping.Why this shape
The previous version tried to solve the challenge-level adapter goal by introducing a broad SDK and multiple platform implementations in one PR. After #316 became the verified lightweight baseline, that shape would create competing adapter frameworks.
This version intentionally keeps the reusable seam small and canonical:
While #316 is still open, this branch is based on the #316 commits. The unique delta over #316 is the Claude Code follow-up only: 6 files, +407/-3.
Verification
Local verification after the rescope:
Build note:
tsdownprints a Node.js v22.17.0 deprecation warning, but the build exits successfully.Related
Refs #235. Builds on the Gateway client baseline from #316.