Documentation
¶
Overview ¶
Package forwarder embeds the shared spawn-forwarder WASM into the Aileron daemon binary.
The forwarder is a manifest-driven adapter between the action layer's JSON envelope ({op, args}) and the runtime's aileron_host.spawn_op host function. Per ADR-0002's spawn-primitive section, every spawn-primitive connector that references `connector.forwarder = "builtin://spawn-forwarder"` is dispatched through this binary.
The forwarder source lives under src/. The compiled WASM lives under embedded/ and is regenerated by `task build:forwarder`. The embedded directory is gitignored except for a committed `.gitkeep` that guarantees the `go:embed` pattern always matches at least one file on a fresh clone. When the WASM has not been built (a fresh clone where `task build:forwarder` has not run, or a `go build` that bypassed the Taskfile), WASM is empty and callers surface a clear error instead of compiling an empty module.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var WASM []byte
WASM is the compiled forwarder bytes. Loaded into the Wazero runtime when a connector manifest declares `connector.forwarder = "builtin://spawn-forwarder"`.
The hash of these bytes contributes to a forwarder-connector's content hash (sha256(WASM || manifest.toml) per ADR-0002), so a daemon upgrade that ships new forwarder bytes invalidates the cached hashes of every shared-forwarder wrap on the host. The install pipeline re-stores the manifest under the new hash; manifest content is unchanged.
Empty when `task build:forwarder` has not populated embedded/spawn-forwarder.wasm. Callers check `len(WASM) > 0` before using and surface a clear "forwarder not built" error otherwise.
Functions ¶
This section is empty.
Types ¶
This section is empty.