feat(rkd): connect with prod, dev or any address #5
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/easier-server-address"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Connecting shouldn't require knowing the API hostname.
/rkd:configure prodanddevname RKD's hosted servers, and any other address works too: a bare hostname getshttps://, a localhost address getshttp://, a trailing/or a pasted/apiis ignored, and the web app's own address works because it serves the API. The address is checked against/api/healthbefore a code is requested, so a typo or a non-RKD server fails in about a second with a plain message rather than after the ten-minute code expires. With no address,/rkd:configureasks which server.The companion change on the RKD side (nanoya-biz/rkd#971) makes Settings → Apps → Claude Code show the exact command with the address that app talks to, plus a Copy button.
Version 0.2.3.
Type of change
Test plan
Automated:
pnpm test(100, 17 new for the resolver: shorthands, bare hosts, localhost, trailing/and/api, ports and paths, other schemes refused, and the reachability check for a healthy server, a non-RKD server and an unreachable one)pnpm typecheck,pnpm check:dist, Node 20 handshake smoke,claude plugin validate --strictManual, through the real CLI against a local server:
login rkd-typo.invalid→ "couldn't reach https://rkd-typo.invalid: check the address and your connection"login 127.0.0.1:1→ "couldn't reach http://127.0.0.1:1…"login https://example.com→ "answered HTTP 404 at /api/health, so it doesn't look like an RKD server (or it's down)"login 127.0.0.1:18090(no scheme) signed in, savedRKD_SERVER=http://127.0.0.1:18090, and the second machine showed up not active in Settings → AppsReview checklist
Migrations and breaking changes
None. Existing
login <full-url>calls resolve to themselves.Notes for the reviewer
src/server-url.ts(prod,dev), the same two the RKD apps use inserverConfig.ts. A self-hosted server just passes its own address.checkReachableuses/api/health, which every RKD server already exposes; it needs no auth and no new endpoint.https://claude.ai/code/session_01GdkP2Y3vcxcGz5XCFFWW16
prod,devor any address