AdlRuntime
Defined in: packages/core/src/runtime/types.ts:111
Bound runtime — primary project API. Create via createAdlRuntime, reference from adl.config.
Use adl.createAgent, adl.createWorkflow, adl.createTemplate, and tool helpers on this object
in application code. Functional createAgent(runtime, …) exports exist for tests only.
Properties
Section titled “Properties”services
Section titled “services”
readonlyservices:RuntimeServices
Defined in: packages/core/src/runtime/types.ts:112
Methods
Section titled “Methods”createAgent()
Section titled “createAgent()”createAgent<
ToolProviderContext,Tools,TOutput>(definition,overrides?):Agent<ToolProviderContext,Tools,TOutput>
Defined in: packages/core/src/runtime/types.ts:114
Type Parameters
Section titled “Type Parameters”ToolProviderContext
Section titled “ToolProviderContext”ToolProviderContext = undefined
Tools extends ToolSet = ToolSet
TOutput
Section titled “TOutput”TOutput = string
Parameters
Section titled “Parameters”definition
Section titled “definition”AgentDefinition<ToolProviderContext, Tools, TOutput>
overrides?
Section titled “overrides?”Returns
Section titled “Returns”Agent<ToolProviderContext, Tools, TOutput>
createTemplate()
Section titled “createTemplate()”createTemplate<
TSchema>(config):Template<output<TSchema>>
Defined in: packages/core/src/runtime/types.ts:148
Type Parameters
Section titled “Type Parameters”TSchema
Section titled “TSchema”TSchema extends ZodType<object, unknown, $ZodTypeInternals<object, unknown>>
Parameters
Section titled “Parameters”config
Section titled “config”TemplateConfig<TSchema>
Returns
Section titled “Returns”Template<output<TSchema>>
createToolFromAgent()
Section titled “createToolFromAgent()”createToolFromAgent<
ToolProviderContext,Tools,TOutput,TToolInput>(agent,options):Tool<TToolInput,TOutput>
Defined in: packages/core/src/runtime/types.ts:124
Type Parameters
Section titled “Type Parameters”ToolProviderContext
Section titled “ToolProviderContext”ToolProviderContext = undefined
Tools extends ToolSet = ToolSet
TOutput
Section titled “TOutput”TOutput = string
TToolInput
Section titled “TToolInput”TToolInput = DefaultToolInput
Parameters
Section titled “Parameters”Agent<ToolProviderContext, Tools, TOutput>
options
Section titled “options”CreateToolFromAgentOptions<ToolProviderContext, TToolInput>
Returns
Section titled “Returns”Tool<TToolInput, TOutput>
createToolFromWorkflow()
Section titled “createToolFromWorkflow()”createToolFromWorkflow<
TInput,TOutput,TRawInput,TToolInput>(workflow,options):Tool<TToolInput,TOutput>
Defined in: packages/core/src/runtime/types.ts:134
Type Parameters
Section titled “Type Parameters”TInput
Section titled “TInput”TInput
TOutput
Section titled “TOutput”TOutput
TRawInput
Section titled “TRawInput”TRawInput = TInput
TToolInput
Section titled “TToolInput”TToolInput = TRawInput
Parameters
Section titled “Parameters”workflow
Section titled “workflow”Workflow<TInput, TOutput, TRawInput>
options
Section titled “options”CreateToolFromWorkflowOptions<TRawInput, TToolInput>
Returns
Section titled “Returns”Tool<TToolInput, TOutput>
createWorkflow()
Section titled “createWorkflow()”createWorkflow<
TInput,TOutput,TRawInput>(definition,overrides?):Workflow<TInput,TOutput,TRawInput>
Defined in: packages/core/src/runtime/types.ts:119
Type Parameters
Section titled “Type Parameters”TInput
Section titled “TInput”TInput
TOutput
Section titled “TOutput”TOutput
TRawInput
Section titled “TRawInput”TRawInput = TInput
Parameters
Section titled “Parameters”definition
Section titled “definition”WorkflowDefinition<TInput, TOutput, TRawInput>
overrides?
Section titled “overrides?”Returns
Section titled “Returns”Workflow<TInput, TOutput, TRawInput>
createWorkflowFromAgent()
Section titled “createWorkflowFromAgent()”createWorkflowFromAgent<
ToolProviderContext,Tools,TOutput>(agent,options?):Workflow<string,TOutput,string>
Defined in: packages/core/src/runtime/types.ts:139
Type Parameters
Section titled “Type Parameters”ToolProviderContext
Section titled “ToolProviderContext”ToolProviderContext = undefined
Tools extends ToolSet = ToolSet
TOutput
Section titled “TOutput”TOutput = string
Parameters
Section titled “Parameters”Agent<ToolProviderContext, Tools, TOutput>
options?
Section titled “options?”CreateWorkflowFromAgentOptions<ToolProviderContext>
Returns
Section titled “Returns”Workflow<string, TOutput, string>
recordConversationForked()
Section titled “recordConversationForked()”recordConversationForked(
input):Promise<void>
Defined in: packages/core/src/runtime/types.ts:168
Records that a conversation was forked out of an agent episode.
Forking happens outside any run — the new memoryScope is created before
its first turn — so there is no WorkflowContext or agent handle to
emit through, and this is the seam for it. Persists a
conversation_forked RunEvent (readable back via
listEvents({ memoryScope })) which projects the lineage into
adl_conversation_metadata.fork_json.
title is the forked conversation’s initial display name; the caller has
a real one at this point, and it is the row’s first writer.
No-op when the runtime has no workflow store configured, matching how every other event behaves without one.
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
memoryScope
Section titled “memoryScope”string
string
Returns
Section titled “Returns”Promise<void>