refactor(macos): ship macOS desktop automation as the managed platform plugin

Merged
TH
10h ago
+3725-1494

Summary

Part of #4675. macOS desktop automation and its Swift helper leave the core for the managed plugin @agent-device/macos (still "private": true).

  • Design A: the plugin holds the leaf claim { kind: 'platform', family: 'apple', appleOs: 'macos' }. The bundled Apple owner keeps apple and calls the installed leaf at its macOS branches.
  • Runner option (a): the plugin owns both app backends' macOS code, the desktop surfaces and macos-helper. Core keeps the XCTest runner and gives the leaf a device-bound runner capability.
  • Without the plugin, --platform macos answers plugin-not-installed with the install hint, and unfiltered discovery omits the Mac. audio probe needs the plugin: the sampler is the helper's.

Size: 163 files, +3462 −1472. It exceeds the cap because the claim key, the leaf port, the move and its gates cannot merge separately, as in the Linux precedent.

Value

Clean builds, npm pack --ignore-scripts, base 80c44fe45e against 4dc93c9ff8:

  • Packed core: 1,638,382 B to 1,616,982 B.
  • Unpacked core: 5,275,885 B to 5,188,827 B.
  • macos-helper files in core: 11 to 0. Plugin tarball: 70,157 B.

Validation

At 68d339fd2d, passing: pnpm lint, pnpm typecheck, pnpm format, pnpm check:layering, fallow audit --base origin/0.22, pnpm run check:package (13 smokes), pnpm check:command-docs, pnpm check:daemon-wire-compat, unit-core (21,099 tests), provider-integration (318 tests), Swift helper tests.

Live check on a Mac (transcript in the first comment): the native backend flow passed. The default XCTest backend is blocked there: XCUITest Automation Mode is not authorized.

CI must still prove the macOS smoke lane, which now installs the packed plugin.


Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.