Move mesh networking logic into the SDK and fix lifecycle bugs

SDK:
- Add build_config/migrate_config, mesh_cidrs, route_generation, health
  and start_bridged; expose abi_info (capability revision 2).
- Add wait_routes long-poll; stop wakes waiters, and context_free now
  stops the network immediately instead of waiting for waiters to time out.

Hosts:
- Dart: waitRoutes(), MeshProxySession route watcher, ABI capability check.
- Android: fix a deadlock where every VPN request waited on its own
  single-thread worker; requests are now async, status is served from a
  snapshot, and combined mode reports Partial when the mesh stops.
- macOS helper: mesh-only unified mode stops when the mesh is lost;
  installed_subnet_routes excludes the overlay.
- Lab: restore Partial sessions, write migrated profiles back, remove the
  unreachable TOML import dialog; native test now connects via the form.

Docs updated accordingly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-15 18:17:42 +09:00
co-authored by Claude Opus 5.5
parent 29d236f3fe
commit dc1bfc99d2
34 changed files with 1724 additions and 715 deletions
@@ -36,11 +36,12 @@ Future<void> waitForRoutes(
final state = await client.status();
lastState = state;
final platform = state['platform_network'] as Map? ?? {};
// mesh_cidrs is the SDK's routable set (overlay + accepted subnets).
final routes =
platform[installed ? 'installed_subnet_routes' : 'subnet_routes']
platform[installed ? 'installed_subnet_routes' : 'mesh_cidrs']
as List? ??
[];
if (withdrawn ? routes.isEmpty : routes.contains('10.253.79.0/24')) return;
if (routes.contains('10.253.79.0/24') != withdrawn) return;
await Future<void>.delayed(const Duration(milliseconds: 200));
}
debugPrint('ANDROID_ROUTE_TIMEOUT_STATE ${jsonEncode(lastState)}');