feat(vis): show LAN URLs when binding to 0.0.0.0 for remote control#1878
feat(vis): show LAN URLs when binding to 0.0.0.0 for remote control#1878bj456736 wants to merge 1 commit into
Conversation
When vis-server binds to 0.0.0.0 or :: (all interfaces), the startup banner and CLI output now display the actual LAN IP addresses that other devices on the same network can use to connect. This enables lan-range remote control from phones, tablets, or other machines. Changes: - Add isAllInterfaces() and getLocalNetworkAddresses() to config.ts - Add lanUrls field to StartedVisServer in start.ts - Update formatStartupBanner() to list LAN URLs when applicable - Update vis CLI handler to print LAN access URLs - Add unit tests for isAllInterfaces and getLocalNetworkAddresses
🦋 Changeset detectedLatest commit: 57f1eec The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 57f1eec340
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @@ -0,0 +1,11 @@ | |||
| --- | |||
| "@moonshot-ai/kimi-code": patch | |||
| "@moonshot-ai/vis-server": patch | |||
There was a problem hiding this comment.
Remove ignored vis-server from the changeset
This repo's changeset config ignores @moonshot-ai/vis-server, and Changesets fails publishing when an ignored package is mentioned in the same changeset as a non-ignored package. Because this file includes both publishable @moonshot-ai/kimi-code and ignored @moonshot-ai/vis-server, the release PR's pnpm changeset version/publish path will fail instead of cutting the CLI patch; keep only the publishable package and describe the bundled vis-server behavior there.
Useful? React with 👍 / 👎.
| describe('getLocalNetworkAddresses', () => { | ||
| it('returns non-empty array of IPv4 URLs for a valid port', () => { | ||
| const addresses = getLocalNetworkAddresses(3001); | ||
| expect(addresses.length).toBeGreaterThan(0); |
There was a problem hiding this comment.
Mock host interfaces in the new config test
On CI or developer machines with only loopback interfaces, or with no non-internal IPv4 interface, getLocalNetworkAddresses() legitimately returns an empty array, so this new assertion fails for host setup rather than product behavior. Since os.networkInterfaces() is environment-dependent, mock it for this test and cover the empty-interface case separately instead of requiring length > 0.
Useful? React with 👍 / 👎.
When vis-server binds to
0.0.0.0or::(all interfaces), the startup banner and CLI output now display the actual LAN IP addresses that other devices on the same network can use to connect. This enables lan-range remote control from phones, tablets, or other machines.Changes
apps/vis/server/src/config.ts: AddisAllInterfaces()andgetLocalNetworkAddresses()helpersapps/vis/server/src/start.ts: AddlanUrlsfield toStartedVisServer, populated when binding to all interfacesapps/vis/server/src/startup-banner.ts: List LAN URLs in startup banner when applicableapps/vis/server/src/index.ts: PasslanUrlsto banner formatterapps/kimi-code/src/cli/sub/vis.ts: Print LAN access URLs in CLI outputapps/vis/server/test/lib/config.test.ts: Add unit tests for new helpersTesting
127.0.0.1binding → no LAN URLs shown ✓0.0.0.0binding → LAN URLs discovered and displayed ✓isAllInterfacesandgetLocalNetworkAddressespass (5 new tests) ✓