Browser-compatible transport seam for ClientRuntime#76
Merged
Conversation
Make the OmnyShell client compile to JavaScript and run in a browser, so a pure web client can reuse ClientRuntime instead of reimplementing the protocol. Native CLI/Hub/Node behaviour is unchanged. - Add ClientConfig.connectionFactory (ConnectionFactory) with a conditional import selecting a dart:io wss:// socket on the VM and the platform WebSocket (WsChannelConnection) under dart2js. - Move TLS trust overrides out of ClientConfig into ioConnectionFactory(...) (exported from omnyshell_client.dart); CLI --ca/--insecure-skip-verify unchanged. BREAKING: ClientConfig.securityContext/onBadCertificate removed. - Isolate dart:io from the client graph: PlatformInfo.local() -> io-only extension; local-tunnel TCP bridge behind a conditional-import factory. - Add ClientConfig.onDisconnected for drop detection. - Add browser-safe barrel lib/omnyshell_client_web.dart. - Fix embedded example to use connectionFactory: ioConnectionFactory(...). - Bump to 1.29.0; update CHANGELOG. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Makes the OmnyShell client compile to JavaScript and run in a browser, so a pure web client (
omnyshell_web) can reuseClientRuntimeover the platform WebSocket instead of reimplementing the protocol. Native CLI / Hub / Node behaviour is unchanged.Changes
ClientConfig.connectionFactory(aConnectionFactory), resolved via a conditional import that selects adart:iowss://socket on the VM and the browser WebSocket (WsChannelConnection) under dart2js.ioConnectionFactory({securityContext, onBadCertificate, pingInterval}), exported fromomnyshell_client.dart, builds the native factory. The CLI's--ca/--insecure-skip-verifybehaviour is unchanged.PlatformInfo.local()moved to adart:io-only extension (platform_info_io.dart); the local-tunnel TCP bridge sits behind a conditional-import factory;PlatformInfois nowdart:io-free.ClientConfig.onDisconnected.package:omnyshell/omnyshell_client_web.dartexports only the JS-compatible subset.Breaking change
ClientConfigno longer acceptssecurityContext/onBadCertificate(thosedart:iotypes blocked browser compilation). Native callers migrate to:HubConfigandNodeConfigare unaffected.Verification
dart analyze .— clean.dart test— all 471 tests pass.dart compile jsof an entrypoint importingClientRuntimeproduces no "dart:io not supported" errors.🤖 Generated with Claude Code