import type { TurnResult } from '../types/channel.js'; import type { StreamPart, TurnHandle } from '../types/stream.js'; import type { AgentSpan, AgentTrace, DeploymentTraceContext } from '../types/trace.js'; import type { RunOptions } from './Runtime.js'; export interface TraceRecorderOptions { sessionId?: string; agentId?: string; input?: unknown; deployment?: DeploymentTraceContext; onSpan?: (span: AgentSpan) => void; } export declare class TraceRecorder { private readonly trace; private readonly root; private currentFlow?; private currentNode?; private readonly openTools; private readonly toolCallIds; private readonly openLlms; private readonly emitted; private readonly onSpan?; private readonly deployment; private currentAgentId?; constructor(options?: TraceRecorderOptions); setInitiatingAgent(agentId: string): void; recordSkillSnapshot(agentId: string, contentHash: string): void; record(part: StreamPart): void; finish(result: TurnResult): AgentTrace; private openSpan; private takeToolSpan; private closeTools; private closeLlms; private closeNode; private closeFlow; private setSessionId; private close; private emitSpan; } /** * What the standalone {@link runOnce} needs from a runtime. `run` is required; * the optional accessors let it resolve the same agent `Runtime.runOnce` would. * * It must NOT call `runtime.runOnce` — that method delegates here, so delegating * back is infinite recursion. */ export interface RunOnceRuntime { run(opts: RunOptions): TurnHandle; getSessionStore?(): { get(id: string): Promise<{ activeAgentId?: string; currentAgent?: string; } | null>; }; getDefaultAgentId?(): string; } export declare function runOnce(runtime: RunOnceRuntime, opts: RunOptions): Promise;