Context + Stream + Collector + EnvironmentRuntime values and outputs
Core TypeScript values passed into makers, operators, and endpoint handlers. These are the stable application-facing handles to the generated runtime.
When to use
Use this page while implementing a generated business function or endpoint handler.
Behavior
- Contexts carry cancellation and correlation across graph boundaries.
- Collectors and stream contexts are the supported way to emit values; calling downstream functions directly bypasses graph semantics and observability.
- The service environment is supplied during construction so business implementations can create scoped metrics, obtain loggers, and resolve configured dependencies.
Core runtime types
Types normally visible in preserved implementation signatures.
MessageContextPer-message contextCarries cancellation, stream ID, priority, and tracing propagation. Pass the same context to outputs unless intentionally deriving another context.
StreamStream metadataExposes generated stream identity, configuration, type, environment, and runtime bindings.
Collector<T>Operator outputout(context, value) forwards a value and returns void or a completion Promise.
StreamContext<T, R, E>Source endpoint contextcollect(context, value) and errorCollect(context, error) emit into the graph.
SinkStreamContext<T, R, E>Sink endpoint contextCollects typed outbound results and errors.
KeyValue<K, V>Keyed valueCarries key and value from keyBy into stateful joins.
RuntimeEnvironmentMaker dependencyProvides metrics, logger, tracing, runtime configuration, and service dependencies.
<Type>StreamConfig / <Type>EndpointConfigTyped configurationGenerated type imports make the maker contract specific to the selected graph node.
Generated extension pattern
await stream.collect(context, value);
await stream.errorCollect(context, error);
await out.out(context, result);