Parameters
External output names, inferred as literal types. Must not repeat any input name.
A synchronous callback that adds parts and wires them. It runs immediately, exactly once, and its result is validated before
circuit() returns.Returns
A frozenComponentDefinition with kind: "composite".
CircuitBuilder
Every wiring call reads destination ← source.Adds a part made from any definition, and wires the inputs listed in
inputs, an object like { a: source, b: source }. Inputs you leave out must be wired later with feed. Without name, a deterministic name <Definition>#<n> is generated, and the inputs object moves to the second argument: add(NOT, { a: inputs.a }). The returned part exposes outputs (sources) and inputs (only for feed).Wires an input of a part you already added. This is how feedback loops are built, because the source can be a part added after the one it feeds.
Drives one of the circuit’s own outputs from a source. Each output must be driven exactly once.
Example
Errors
Every error is aCircuitError whose message is prefixed with the circuit name.