function make<Name>(context: MessageContext, environment: RuntimeEnvironment, config: <Config>): <Name> | Promise<<Name>>Extension model
TypeScript services use `@gorundebug/tsservicelib`. Generated graph assembly owns runtime wiring; application code supplies typed business implementations through preserved maker functions.
When to use
Use this page while implementing a generated business function or endpoint handler.
Behavior
- The runtime is Node.js async runtime with strict ESM and structural interfaces.
- Generated index files import preserved user modules. The maker is called once when the service graph is initialized and its object is reused for message processing.
- The generated maker signature identifies the exact implementation and typed configuration required by the selected stream or endpoint.
- Returning a construction error stops service startup instead of leaving a partially wired graph.
Regeneration contract
Function and endpoint implementation files are preserved by the merge script. Generated registries and graph assembly may change around them; make merge-validate detects a preserved maker whose generated signature is no longer compatible.
Choosing where state lives
Keep reusable clients and immutable dependencies on the implementation object. Keep request, record, RPC, or workflow invocation data in handler state. Use the runtime context for cancellation and correlation instead of inventing a parallel context channel.
Generated and user-owned boundaries
How generated services discover and run application code.
Generated graph assemblyFramework ownedCreates streams, links, connectors, endpoint consumers, serializers, stores, and runtime pools from the designer graph.
Maker functionUser entry pointfunction make<Name>(context: MessageContext, environment: RuntimeEnvironment, config: <Config>): <Name> | Promise<<Name>>
Implementation objectUser ownedContains business dependencies and reusable state for one generated function or endpoint.
Typed configGenerated contractMatches the selected graph node and exposes its runtime configuration to the maker.
Service environmentFramework dependencyProvides configured observability and runtime services without requiring global variables.
Generated extension pattern
export function makeValidateOrder(
context: MessageContext, environment: RuntimeEnvironment,
config: ProcessStreamConfig,
): ValidateOrder {
return new ValidateOrder();
}