Skip to content

Summary

The core primitives for mapping data from tools to the output.

FeatureExample
Pull wires (<-)out.name <- api.name
Constant wires (=)api.method = "GET"
Nullish coalescing (??)out.x <- api.x ?? "default"
Falsy fallback (||)out.x <- api.x || backup.x
Conditional (Ternary)api.mode <- i.premium ? "full" : "basic"
Lazy EvaluationOnly the chosen branch in a ternary is executed
OverdefinitionMultiple wires to the same target (o.x <- a and o.x <- b) resolve as first non-null wins
Root passthrougho <- api (maps the entire object)
Context accessapi.token <- ctx.apiKey

Tools for data manipulation and code organization.

FeatureExample
alias declarationsalias api.result.data as d
Safe-exec aliases (?.)alias api?.value as safeVal
Alias fallbacksalias (expr) ? val : null ?? panic "msg" as x
Math / Comparisono.total <- i.price * i.qty, o.isAdult <- i.age >= 18
String interpolationo.msg <- "Hello, {i.name}!"
Pipe operatorso.loud <- tu:i.text
const blocksconst geo = { "lat": 0 } (Inlined at compile time)
define blocksdefine profile { ... } (Virtual containers)

Zero-allocation iteration using native JavaScript loops.

FeatureExample
Array mappingout.items <- api.list[] as el { .id <- el.id }
Nested arrayso <- items[] as i { .sub <- i.list[] as j { ... } }
Array Control Flowitem.name ?? break, item.name ?? continue
Nested Control Flowbreak 1/continue 2 scopes correctly in sub-arrays
Interpolation in arrayso <- items[] as it { .url <- "/items/{it.id}" }
Null array preservationIf source is null, output is null (not [])

Granular control over tool failures and execution halting.

FeatureExample
catch fallbacksout.data <- api.result catch "fallback"
catch ref fallbacksout.data <- primary.val catch backup.val
throwo.name <- i.name || throw "name is required"
panic (Fatal)o.name <- i.name ?? panic "fatal error" (Bypasses catch)
force (Critical tool)force audit (Execution halts if tool fails)
force catch nullforce ping catch null (Fire-and-forget execution)

Reusable tool configurations defined in the schema.

FeatureExample
Pre-wired Inputstool api from httpCall { .method = "GET" }
Tool inheritancetool childApi from parentApi { .path = "/v2" }
Centralized on errortool api from httpCall { on error = {...} }
Override mechanicsBridge wires override ToolDef wires by key

Under-the-hood engine features that ensure stability and performance.

FeatureDescription
Dead-Code EliminationUnrequested GraphQL/Sparse fields are pruned; unneeded tools are mathematically excluded from the JIT compilation.
Tool TimeoutsAutomatic Promise.race with memory-leak prevention (clearTimeout) based on toolTimeoutMs.
Cycle DetectionCompile-time detection of circular tool dependencies (Kahn’s algorithm) throws an immediate initialization error.
Abort SignalsPre-tool signal.aborted checks throw BridgeAbortError, which safely bypasses standard catch blocks.
Telemetry InjectionAutomatically passes { logger, signal } via ctx to custom tool functions.