Documentation
¶
Overview ¶
Package composeremote places a composition on a fleet node and brings the video back, so a machine with no composition lane of its own (a thin client) calls offload_compose_video exactly as a render node does (ADR 0071). It mirrors visionremote: probe delegate_remotes through /fleet/health, pick a node that advertises the task, dispatch with the fleet bearer, poll the job, and map every failure to a typed defer.
Two kinds of request travel:
- a vetted template (template + variables) goes through the fleet's template door, compose-video over /fleet/dispatch, which every node with the lane serves;
- a project (project_dir, or an inline html composition) is packed into a bundle, checked here with the same confinement rules the node applies (composebundle), and sent to the token-gated compose-project door, which only nodes that opened it advertise.
The node writes the video (and any snapshots) into its own media dir; they are fetched back by name from /fleet/media into the caller's `out` or this box's media dir, and the result's paths are rewritten to the local copies. The node's typed failure reason (LINT_ERRORS, CHECK_FAILED, ...) is passed through unchanged.
Index ¶
Constants ¶
const ( RouteLocal = "local" RouteAuto = "auto" RouteRemote = "remote" )
const ( // Budget bounds one remote composition end to end when the caller set no deadline: a 30-minute // render (compose_timeout_sec's default) plus the transfers. Budget = 45 * time.Minute )
Variables ¶
var HTTPClient = &http.Client{Transport: netguard.SafeTransport(nil), CheckRedirect: rosterprobe.NoRedirect}
HTTPClient is the transport every request uses; tests swap it. netguard.SafeTransport limits the lane to loopback and the operator's tailnet at dial time (never cloud, ADR 0001).
Functions ¶
func Call ¶
Call runs req on the best eligible fleet node and fetches its outputs. A placement, transfer or bundle problem is an error the caller maps to a defer class; the node's own verdict (a render that deferred) comes back as a deferred core.Result.
func NormalizeRoute ¶
NormalizeRoute maps the caller's route to one of the three values; "" is auto.
func Run ¶
func Run(ctx context.Context, cfg config.Config, runner Runner, req core.Request, route string) core.Result
Run is the entry point the MCP tool and the CLI verb share. local runs here; remote runs on a fleet node; auto runs here when this box has the composition lane (byte-identical to before the route existed) and on a fleet node when it has none.