refactor(vega): ship Vega OS as a platform plugin

Merged
TH
7d ago
+836-238

Summary

Ships Vega OS as the managed platform plugin @agent-device/vega, the same shape #4792 gave web.

  • packages/platform-vega now publishes as @agent-device/vega ("private": true, apiVersion: 3, platform: "vega", single ./agent-device export) and contributes one { kind: 'platform', family: 'vega', setup(host) }: inventory + runtime modules, the host-bound interactor factory, request-scoped provider entry, and the named operation toolchainCheck (doctor). App lifecycle and the TV remote stay in the package's runtime/interactor; core keeps family identity, the TV remote vocabulary and toVegaTvRemoteKey, the vegaToolProvider resolver key, help/schema text, and the daemon tv-remote handler.
  • The Vega provider contract type moves to @agent-device/contracts/vega-tool-provider (contracts may not import host-kit or platform packages), mirroring @agent-device/contracts/web-provider.
  • Core no longer imports the package at all: no inline fallback, no dynamic import. Vega is dropped from the builtin platform set, the root devDependency, and bundling. An absent plugin answers through the one absence reporter with typed plugin-not-installed and agent-device plugins add @agent-device/vega; unfiltered devices skips Vega silently; help renders without it.
  • Gates: vega joins the forbidden list in scripts/check-package.ts (packed paths + implementation markers) and MANAGED_PLATFORMS in the platform-package layering policy; the managed-platform policy test gained a case that only the plugin scope resolves the managed Vega entry. Package tests moved with the package; core/daemon tests supply Vega as a plugin fixture (src/platform-runtime-vega-provider.fixtures.ts); the vega-tv-remote provider scenario now composes Vega through the plugin; packages/platform-vega/test/package-smoke.mjs proves the packed-install behavior (absent → typed hint, silent skip, install → active plugin) on any host.
  • Docs: installation, TV targets, and the client API gained the one install step; help tv names it in its loop.

Live verification ran on a Vega Virtual Device on a macOS host with Vega CLI 1.3.2 / SDK 0.23.9221: typed plugin absence, install, discovery, open of the SDK sample app, a tv-remote press, the designed screenshot refusal, close, and the plugin-supplied doctor toolchain check all behave as specified. See the "Live run: Vega Virtual Device" comment for the per-step table and JSON.

Closes #4672. Follows #4591 / #4792.

Validation

  • head 0a4f6f3609, base origin/0.22 (db5f1225e3). The review follow-up refactor(vega): keep absent-family request scope and doctor row honest is included.
  • receipt .tmp/validation/run-GsVwxc/receipt.json: [passed] exactCommit=true — 42 checks passed, 28 skipped (no device lanes). unit 21,464 passed / 10 skipped / 0 failed; vitest-related 441; provider-integration 309; plus format, lint, typecheck, layering, package, docs, capability-matrix, mutation-model.
  • pnpm typecheck, pnpm check:layering (499 pass), pnpm run check:package (tarball lint + installed-CLI probes), pnpm format, fallow audit --base origin/0.22 (0 issues in 41 changed files) — all green.
  • Review fixes (Sentinel): vegaToolProvider is gated on the active Vega selection, so a request for an unserved family never calls its resolver (resolverAsked === false is pinned); doctor --platform vega now reports a failing toolchain row built from the composition's own absence report, naming agent-device plugins add @agent-device/vega, while an unfiltered doctor keeps no Vega toolchain row and its unscoped inventory sweep skips an uninstalled optional family. Verified on the device again at this head (typed absence, doctor absent row, unfiltered silence, discovery/open/tv-remote/screenshot refusal/close, plugin doctor pass).
  • At the review-fix head: pnpm typecheck and the focused suites (host diagnostics, doctor device inventory, optional-family and provider-routing registries, the whole Vega package) are green locally; hosted CI backs the rest.
  • Live device run on a Vega Virtual Device (manual; CI has no Vega lane): see the "Live run: Vega Virtual Device" comment for each command, exit code, and JSON.

Core tarball size

Same toolchain on both trees, measured at head 42129a867d (the review follow-up changes behaviour only, not the packed file set):

packedunpackedfiles
base 5a9eb4252c1,639,137 B5,282,033 B674
head 42129a867d1,636,629 B5,272,022 B667
delta−2,508 B−10,011 B−7

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