/** * [WHO]: Shared semantic trace helpers for run, turn, model, tool, checkpoint, and transition boundaries * [FROM]: Depends on agent messages, the trace recorder, and canonical fingerprints * [TO]: Consumed by both standard and structured-adaptive loops * [HERE]: core/lib/agent-core/src/run-trace-context.ts - loop-neutral trace instrumentation */ import type { AssistantMessage } from "@catui/ai/types"; import type { AgentLoopFramework, AgentLoopTransition, AgentMessage } from "./types.js"; import type { RunTraceRecorder } from "./run-trace-recorder.js"; interface TraceToolCall { id: string; name: string; arguments: unknown; } interface TraceToolResult { toolCallId: string; toolName: string; isError: boolean; content: unknown; details?: unknown; } export declare function traceRunStarted(recorder: RunTraceRecorder | undefined, framework: AgentLoopFramework, messages: readonly AgentMessage[]): Promise; export declare function traceTurnStarted(recorder: RunTraceRecorder | undefined, turn: number): Promise; export declare function traceModelRequested(recorder: RunTraceRecorder | undefined, turn: number, messages: readonly AgentMessage[]): Promise; export declare function traceModelResponded(recorder: RunTraceRecorder | undefined, turn: number, message: AssistantMessage): Promise; export declare function traceTurnCompleted(recorder: RunTraceRecorder | undefined, turn: number, message: AssistantMessage): Promise; export declare function traceToolBatch(recorder: RunTraceRecorder | undefined, calls: readonly TraceToolCall[], results: readonly TraceToolResult[], policyEnabled: boolean, approvalRequired?: { checkpointId: string; policyId?: string; toolCallId: string; }): Promise; export declare function traceTransitionApplied(recorder: RunTraceRecorder | undefined, transition: AgentLoopTransition | { reason: string; [key: string]: unknown; }): void; export declare function traceRunCompleted(recorder: RunTraceRecorder | undefined, result: { stopReason: string; turnCount: number; toolCallCount: number; messages: readonly AgentMessage[]; }): Promise; export {};