Runtime
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Runtime(config): Runtime;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”Runtime
Methods
Section titled “Methods”abortSession()
Section titled “abortSession()”abortSession(sessionId, reason?): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”void
addDynamicFlows()
Section titled “addDynamicFlows()”addDynamicFlows(defs, opts): Promise<void>;Atomically register a bundle of stored flow definitions on a live agent.
Persistence is not transactional across rows. On failure the in-memory
catalog rolls back this bundle’s registrations; members that already
persisted are best-effort archived so a later loadDynamicFlows does not
resurrect them.
Reusing an existing dynamic name is rejected unless replace: true.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
readonly |
|
|
{ |
|
|
|
|
|
| |
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
deleteSession()
Section titled “deleteSession()”deleteSession(sessionId): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”Promise<void>
getConversationLength()
Section titled “getConversationLength()”getConversationLength(sessionId): Promise<number>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”Promise<number>
getDefaultAgentId()
Section titled “getDefaultAgentId()”getDefaultAgentId(): string;The agent used when neither the caller nor persisted state names one.
Returns
Section titled “Returns”string
getRun()
Section titled “getRun()”getRun(runId, sessionId?): Promise<RunHandle | null>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<RunHandle | null>
getRunStore()
Section titled “getRunStore()”getRunStore(): RunStore;Returns
Section titled “Returns”getSession()
Section titled “getSession()”getSession(sessionId): Promise<Session | null>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”Promise<Session | null>
getSessionStore()
Section titled “getSessionStore()”getSessionStore(): SessionStore;Returns
Section titled “Returns”getTrace()
Section titled “getTrace()”getTrace(traceId): Promise<AgentTrace | null>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”Promise<AgentTrace | null>
getTraceStore()
Section titled “getTraceStore()”getTraceStore(): TraceStore | undefined;Returns
Section titled “Returns”TraceStore | undefined
listTraces()
Section titled “listTraces()”listTraces(sessionId): Promise<AgentTrace[]>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”Promise<AgentTrace[]>
loadDynamicFlows()
Section titled “loadDynamicFlows()”loadDynamicFlows(opts): Promise<void>;Load status: 'active' versions onto the agent’s live catalog. Per-row
failures are logged and skipped so one corrupt definition cannot sink boot.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
{ |
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
markOutcome()
Section titled “markOutcome()”markOutcome( sessionId, outcome,opts?): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
removeDynamicFlow()
Section titled “removeDynamicFlow()”removeDynamicFlow(name, opts): Promise<boolean>;Drop a dynamic flow from this runtime’s live catalog.
The store row stays active; a later loadDynamicFlows (including boot)
will reload it unless the caller archives the name first.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
{ |
|
|
|
Returns
Section titled “Returns”Promise<boolean>
replayAuditLog()
Section titled “replayAuditLog()”replayAuditLog(sessionId, opts?): Promise<ConversationAuditEntry[]>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
Returns
Section titled “Returns”Promise<ConversationAuditEntry[]>
resumeFromEscalation()
Section titled “resumeFromEscalation()”resumeFromEscalation(sessionId, opts?): Promise<void>;Hand the conversation back to the bot after a human resolved an
escalation: appends a resolution note the model will see, clears any
parked flow/escalation state, and marks the run runnable again. The next
run() continues the conversation with full context.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
{ |
|
|
|
Returns
Section titled “Returns”Promise<void>
run(opts): TurnHandle;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”runOnce()
Section titled “runOnce()”runOnce(opts): Promise<AgentTrace>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”Promise<AgentTrace>
settled()
Section titled “settled()”settled(): Promise<void>;Resolves once every in-flight background extraction has settled.
Returns
Section titled “Returns”Promise<void>
stream()
Section titled “stream()”stream(opts): TurnHandle;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|