import type { SessionTraceContext } from "#channel/types.js"; import type { ContextAccessor } from "#context/key.js"; import type { AgentActionTraceState, AgentSessionTraceState, AgentTraceStateStore, AgentTurnTraceState } from "#tracing/agent-trace-state.js"; import type { SessionStateMap } from "#harness/types.js"; import type { InstrumentationDecision } from "#shared/instrumentation-decision.js"; /** Run after task-provider commits, so a pending workflow tool call keeps its anchor. */ export declare function pruneAgentTraceState(context: ContextAccessor, sessionId: string, sessionState: SessionStateMap | undefined): void; export declare function readSessionTraceDecision(context: ContextAccessor, sessionId: string): InstrumentationDecision | undefined; /** Keeps only framework trace state from an interrupted step's context changes. */ export declare function preserveSerializedAgentTraceState(original: Record, interrupted: Record): Record; /** Reads the active turn context straight out of a serialized Workflow context. */ export declare function readTurnTraceContext(serializedContext: Readonly>, sessionId: string, turnId: string): SessionTraceContext | undefined; /** Reads the durable action span that should parent a dispatched child agent. */ export declare function readActionTraceContext(serializedContext: Readonly>, sessionId: string, turnId: string, callId: string): SessionTraceContext | undefined; /** Durable trace state backed by eve's serialized Workflow context. */ export declare class ContextAgentTraceStateStore implements AgentTraceStateStore { deleteAction(idempotencyKey: string): void; deleteActionAnchors(sessionId: string): void; deleteActions(sessionId: string, turnId?: string): void; deleteSession(sessionId: string): void; deleteTurn(sessionId: string, turnId: string): void; findAction(sessionId: string, callId: string): AgentActionTraceState | undefined; findActionAnchor(sessionId: string, turnId: string, callId: string): AgentActionTraceState | undefined; getAction(idempotencyKey: string): AgentActionTraceState | undefined; getSession(sessionId: string): AgentSessionTraceState | undefined; getTurn(sessionId: string, turnId: string): AgentTurnTraceState | undefined; setAction(idempotencyKey: string, value: AgentActionTraceState): void; setActionAnchor(idempotencyKey: string, value: AgentActionTraceState): void; setSession(sessionId: string, value: AgentSessionTraceState): void; setTurn(sessionId: string, turnId: string, value: AgentTurnTraceState): void; updateTurn(sessionId: string, turnId: string, update: (state: AgentTurnTraceState) => AgentTurnTraceState): void; }