Skip to content

Runtime

new Runtime(config): Runtime;
Parameter Type

config

HarnessConfig

Runtime

abortSession(sessionId, reason?): void;
Parameter Type

sessionId

string

reason?

string

void


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.

Parameter Type

defs

readonly AuthoringFlowDefinition[]

opts

{ agentId: string; compiler?: | LanguageModel | NlPredicateProvider; replace?: boolean; store?: FlowDefinitionsStore; }

opts.agentId

string

opts.compiler?

| LanguageModel | NlPredicateProvider

opts.replace?

boolean

opts.store?

FlowDefinitionsStore

Promise<void>


deleteSession(sessionId): Promise<void>;
Parameter Type

sessionId

string

Promise<void>


getConversationLength(sessionId): Promise<number>;
Parameter Type

sessionId

string

Promise<number>


getDefaultAgentId(): string;

The agent used when neither the caller nor persisted state names one.

string


getRun(runId, sessionId?): Promise<RunHandle | null>;
Parameter Type

runId

string

sessionId?

string

Promise<RunHandle | null>


getRunStore(): RunStore;

RunStore


getSession(sessionId): Promise<Session | null>;
Parameter Type

sessionId

string

Promise<Session | null>


getSessionStore(): SessionStore;

SessionStore


getTrace(traceId): Promise<AgentTrace | null>;
Parameter Type

traceId

string

Promise<AgentTrace | null>


getTraceStore(): TraceStore | undefined;

TraceStore | undefined


listTraces(sessionId): Promise<AgentTrace[]>;
Parameter Type

sessionId

string

Promise<AgentTrace[]>


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.

Parameter Type

opts

{ agentId: string; store?: FlowDefinitionsStore; }

opts.agentId

string

opts.store?

FlowDefinitionsStore

Promise<void>


markOutcome(
sessionId,
outcome,
opts?): Promise<void>;
Parameter Type

sessionId

string

outcome

ConversationOutcome

opts?

{ markedBy?: ConversationOutcomeMarkedBy; reason?: string; }

opts.markedBy?

ConversationOutcomeMarkedBy

opts.reason?

string

Promise<void>


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.

Parameter Type

name

string

opts

{ agentId: string; }

opts.agentId

string

Promise<boolean>


replayAuditLog(sessionId, opts?): Promise<ConversationAuditEntry[]>;
Parameter Type

sessionId

string

opts?

AuditListOptions

Promise<ConversationAuditEntry[]>


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.

Parameter Type

sessionId

string

opts?

{ resolutionSummary?: string; }

opts.resolutionSummary?

string

Promise<void>


run(opts): TurnHandle;
Parameter Type

opts

RunOptions

TurnHandle


runOnce(opts): Promise<AgentTrace>;
Parameter Type

opts

RunOptions

Promise<AgentTrace>


settled(): Promise<void>;

Resolves once every in-flight background extraction has settled.

Promise<void>


stream(opts): TurnHandle;
Parameter Type

opts

RunOptions

TurnHandle