feat(proxy): serve the daemon proxy over any transport and publish it
Merged
TH
2mo ago+825+825+012345678901234567890123456789-274-274-012345678901234567890123456789
Summary
Publishes @agent-device/proxy so gateways such as simlock can embed the agent-device proxy logic and choose the transport on both sides. Stacked on #3255; publishes through the #3252 release flow.
const proxy = createDaemonProxy({
upstreamBaseUrl, upstreamToken, clientToken,
upstreamFetch: (request) => tunnel.send(request), // optional; defaults to fetch
});
const response = await proxy.handle(request); // Fetch Request -> Response
request.signalcancels the daemon request, upload tickets point atrequest.url's origin, andhandlenever rejects.@agent-device/proxy/nodeserves it onnode:http/node:https. The CLI uses it, and the wire behavior is unchanged.- The published build bundles its workspace siblings and has no runtime dependencies.
chore(gates): R11 reads a published package's siblings fromdevDependenciesand names that field in its error. Fallow lists the entry points. Wire-compat acks the rewritten declarations.
27 files changed, 825 insertions and 274 deletions. About 100 lines over budget: roughly 300 lines are tests and 120 are docs, and the API, adapter, and docs form one unit.
Validation
Tested commit 3cc67072bf:
pnpm check:affected --runpassed. Wire-compat against v0.21.22: protocol unchanged, 3 changed and acked.- Unit tests cover the injected transport, auth, aborts (RPC and health), the upload-ticket origin, the TLS scheme, a malformed Host header, the bare 404, and the body limit.
- Packed install in an empty project: both entry points import.
- Built CLI:
agent-device proxyserves health, returns 401 without a token, and returns 404 for unserved routes.
Not device-facing.