cli: reconcile --print-handoff deep-link with #1576 canonical format (#1666)#1672
cli: reconcile --print-handoff deep-link with #1576 canonical format (#1666)#1672cliffhall wants to merge 2 commits into
Conversation
…1666) Closes #1666 #1575 shipped `--print-handoff` with an interim deep-link shape (hardcoded `transport: "http"`, marked `TODO(#1576)`). Now that #1576 owns the canonical `?serverUrl&transport&autoConnect` format, `--print-handoff` emits exactly it: - New `deepLinkTransport(serverUrl, transport)` helper derives `http`|`sse` from the resolved server — explicit `--transport` wins, else auto-detect from the URL path (`/sse` → sse), else default `http`. Unlike the core resolver it defaults instead of throwing (the handoff is best-effort; the web parser defaults an unknown transport to http too). - `buildHandoff` takes the transport, emits the normalized serverUrl + derived transport in the query, and keeps `autoConnect=<token>` (which #1576 adopted as the canonical CSRF gate, so the interim guess was already correct). - Removed the `TODO(#1576)` marker; updated the doc comment + CLI README. Tests: handoff emits `transport=http` for `/mcp`, `transport=sse` for `/sse` and for explicit `--transport sse`; `deepLinkTransport` unit tests cover the explicit/auto/default/stdio/unparseable branches. CLI coverage gate green (cli.ts 100/92.8/100/100). Part of the #1579 decomposition (Wave 4). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
|
@claude review |
|
Claude finished @cliffhall's task in 1m 43s —— View job Review —
|
…verUrl - The JSDoc referenced a non-existent `resolveServerConfig`; name the real `resolveServerConfigs` (core/mcp/node/config.ts) in plain text (it isn't imported here, so an @link wouldn't resolve). - Hoist the doubly-computed `normalizeServerUrl(serverUrl)` in buildHandoff to a single `normalizedUrl` reused for the query param and the serverUrl field. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
|
Thanks — addressed both nits in @claude review |
|
Claude finished @cliffhall's task in 34s —— View job Follow-up review — nits addressed in
|
|
Superseded by the Wave 4 rollup #1676, which contains this change (reviewed to LGTM here) merged base→tip. Closing in favor of the rollup. |
Closes #1666
Summary
#1575 shipped
--print-handoffwith an interim deep-link shape (hardcodedtransport: "http", markedTODO(#1576)). Now that #1576 owns the canonical?serverUrl&transport&autoConnectformat,--print-handoffemits exactly it:deepLinkTransport(serverUrl, transport)deriveshttp|ssefrom the resolved server: explicit--transportwins, else auto-detect from the URL path (/sse→sse), else defaulthttp. UnlikeresolveServerConfigit defaults rather than throwing on an ambiguous path — the handoff is best-effort and the webparseDeepLinkalso defaults an unknown transport to http.buildHandoffnow takes the transport, emits the normalizedserverUrl+ derivedtransportin the query, and keepsautoConnect=<token>— which web: deep-link auto-connect (?serverUrl&transport&autoConnect) + machine-readable connection status #1576 adopted as the canonical CSRF gate, so the interim guess was already right.TODO(#1576)marker; updated the doc comment + CLI README.Tests
transport=httpfor a/mcpserver,transport=ssefor/sse, and honors explicit--transport sse.deepLinkTransportunit tests cover explicit / auto-detect / default / stdio / unparseable-URL branches.CLI coverage gate green (
npm run test:coverage, EXIT 0;cli.ts100/92.8/100/100).Part of the #1579 decomposition (Wave 4). Per AGENTS.md the
Closesline won't auto-fire onv2/main; the issue is closed and its board card moved on the Wave 4 rollup merge.🤖 Generated with Claude Code