feat: v2 relay session handoff — replace cloudflared tunnel with Durable Object relay + 6-digit code#63
Open
JamesLawton wants to merge 14 commits intomainfrom
Open
feat: v2 relay session handoff — replace cloudflared tunnel with Durable Object relay + 6-digit code#63JamesLawton wants to merge 14 commits intomainfrom
JamesLawton wants to merge 14 commits intomainfrom
Conversation
…d requestId guard
…ard, payload size limit
…cl, add rid validation
Removes cloudflared/HTTP server machinery from wallet create and replaces it with X25519 key exchange through the connector-ui relay API. The new flow registers a CLI public key with the relay, polls for browser approval, then prompts for a 6-digit out-of-band code to decrypt the session payload. Adds RelayClient, RelayCodeError, and sessionPayloadToWalletSession helpers; updates wallet import to support both relay-code and legacy ciphertext modes.
… validate inputs, cleanup
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
packages/shared— new@polygonlabs/agent-sharedworkspace package with pure-JS X25519 ECDH + HKDF-SHA256 + XChaCha20-Poly1305 crypto protocol (works in both Node.js 20+ and Cloudflare Workers)connector-uiSPA: fetches CLI public key from relay, encrypts session, posts ciphertext, displays 6-digit code on newCodeDisplayscreen; addsSessionRelayDurable Object +/api/relay/*route handlers to the WorkerTest Plan
packages/sharedcrypto round-trip tests pass (4/4)pnpm typecheckclean across all packagespnpm build(connector-ui) produces cleandist//request,/status,/session,/retrieveall return correct responses and state transitionsnpx wrangler deploy --env stagingand verify end-to-end flow with a real wallet