refactor(move): move the daemon proxy into @agent-device/proxy

Merged
TH
2mo ago
+70-20

Summary

Moves the proxy behind agent-device proxy from src/remote into a private workspace package, @agent-device/proxy: step one of making it embeddable by gateways such as simlock. #3256 adds the transport-neutral API and publishes it.

  • daemon-proxy.ts and proxy-install-source-admission.ts move into packages/proxy/src/. The code is unchanged except that /health lazy-loads readVersion and readHostCpuArch. Without that, the entry evaluates 22 modules, over the domain-facade ceiling of 20.
  • Imports switch to @agent-device/proxy. CLI behavior is unchanged.
  • src/__tests__/daemon-proxy.test.ts stays with only its import changed. It runs against the real daemon HTTP server, which a package test cannot import.
  • chore(gates): the wire-compat ledger, surface, and mutation case follow the moved declarations (digests unchanged). The layering model registers the proxy zone.
  • The lockfile changes only the proxy importer and the root link.

18 files changed.

Validation

Tested commit 720dacea25:

  • pnpm check:affected --run passed: 59 checks, including typecheck, layering, eager-closure budgets, build, and package.
  • git diff -M90% --stat origin/main...HEAD: the move plus 70 insertions and 20 deletions.
  • check:daemon-wire-compat against v0.21.22: 3 moved, 0 changed, protocol unchanged.
  • Built CLI: agent-device proxy starts, /agent-device/health returns proxy and daemon health, and an RPC without a token gets 401.

Not device-facing. Merge after CI Smoke Tests are green.