Skip to content

feat(studio,agent): mDNS auto-discovery for WiFi physical devices#86

Merged
pbertsch merged 1 commit intomainfrom
feat/mdns-discovery
May 2, 2026
Merged

feat(studio,agent): mDNS auto-discovery for WiFi physical devices#86
pbertsch merged 1 commit intomainfrom
feat/mdns-discovery

Conversation

@pbertsch
Copy link
Copy Markdown
Contributor

@pbertsch pbertsch commented May 2, 2026

Summary

Two-sided change so Studio can find physical iOS/Android devices on the local network without manual IP entry. Pairs with PR #85 (USB physical-device support) to give Studio its full physical-device story for v0.7.0.

Agent (flutter_probe_agent v0.7.0)

  • New dep: bonsoir: ^5.1.10
  • When started in WiFi mode (PROBE_WIFI=true), advertises itself as _flutterprobe._tcp with TXT records {version, port}. Localhost-bound deployments skip mDNS entirely so simulator-only apps pay zero overhead.
  • Token deliberately NOT in TXT records — anyone on the LAN could read it. Users still paste from PROBE_TOKEN= log lines.
  • Version bumped 0.6.0 → 0.7.0; CHANGELOG entry added.

Studio

  • New dep: github.com/grandcat/zeroconf v1.0.0
  • New file studio/wifi_discovery.go owns the browse loop. Discovered devices stream out via the wifi:device-found Wails event with dedup on host:port.
  • New Wails methods: StartWiFiDiscovery, StopWiFiDiscovery, ConnectWiFi(host, port, token).
  • Frontend: WiFi button (📡) in the toolbar opens a modal listing discovered devices. User clicks one, pastes the token, hits Connect. Modal close cancels the browse cleanly.
  • Modal markup uses DOM construction (not innerHTML) for agent-supplied strings — agent name/host/version are user-controlled within the LAN trust boundary.

Compatibility

Studio v0.7.0 only discovers agents flutter_probe_agent v0.7.0+. Older agents continue to work over USB through the existing Connect path — no regression.

Release coordination

This PR ships changes to a published Dart package. After merge:

  1. Tag and release triggers dart pub publish for flutter_probe_agent v0.7.0 (.github/workflows/publish-pub-dev.yml).
  2. Studio v0.7.0 binary ships in the same release.
  3. Users update both their app's pubspec.yaml (rebuild required) and their Studio binary.

Test plan

  • go build ./... — root module clean
  • go test ./... — full Go suite green
  • cd studio && go build ./... && go vet ./... clean
  • cd probe_agent && dart analyze lib/ — no issues
  • cd probe_agent && flutter test — 13/13 pass
  • cd probe_agent && dart pub publish --dry-run — passes (warning only about uncommitted state during local check)
  • cd studio/frontend && tsc --noEmit clean
  • Manual: physical iPhone over WiFi — start app with PROBE_WIFI=true, open Studio, click 📡, see device discovered, paste token, connect, see live screen
  • Manual: physical Android over WiFi — same
  • Manual: regression — start a sim, USB-connect a device, verify the existing Connect path still works

@pbertsch pbertsch requested a review from a team as a code owner May 2, 2026 23:07
Two-sided change so Studio can find physical iOS/Android devices on
the LAN without manual IP entry.

Agent (flutter_probe_agent v0.7.0):
  - New dep: bonsoir ^5.1.10
  - When started in WiFi mode (PROBE_WIFI=true), advertises itself as
    _flutterprobe._tcp with TXT records {version, port}. Localhost
    deployments skip mDNS entirely so simulator-only apps pay zero
    overhead.
  - Token is deliberately NOT in TXT records — anyone on the LAN
    could read it. Users still paste the token from PROBE_TOKEN logs.

Studio:
  - New dep: github.com/grandcat/zeroconf v1.0.0
  - New file studio/wifi_discovery.go owns the browse loop. Discovered
    devices stream out via the wifi:device-found Wails event with dedup
    on host:port.
  - New Wails methods: StartWiFiDiscovery, StopWiFiDiscovery,
    ConnectWiFi(host, port, token).
  - Frontend gets a WiFi button in the toolbar that opens a modal
    listing discovered devices, with a token input that fires
    ConnectWiFi on submit.

Compatibility: Studio v0.7.0 only discovers agents v0.7.0+. Older
agents continue to work over USB through the existing Connect path.
@pbertsch pbertsch force-pushed the feat/mdns-discovery branch from efa245e to 1d02ff7 Compare May 2, 2026 23:25
@pbertsch pbertsch merged commit 53bd458 into main May 2, 2026
13 checks passed
@pbertsch pbertsch mentioned this pull request May 2, 2026
pbertsch added a commit that referenced this pull request May 2, 2026
Bumps VERSION, vscode extension, wiki current-version reference, and
landing-page badge to 0.7.0. Renames the CHANGELOG [Unreleased] section
to [0.7.0] - 2026-05-02 and records the entries from PRs #84, #85, #86.

flutter_probe_agent already at 0.7.0 (bumped in PR #86, includes the
mDNS advertising change).

Tag v0.7.0 after merge to trigger:
- GitHub release workflow (Go binaries)
- pub.dev publish workflow (flutter_probe_agent)
- Homebrew tap formula update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant