import type { AgentLoopOutcome, AgentLoopUsage } from "../agent/production-agent.js"; import type { AgentChatEvent } from "../agent/types.js"; export { redactSensitiveFields } from "./trace-redaction.js"; import type { ObservabilityConfig } from "./types.js"; export declare function httpStatusFromError(err: unknown): number | undefined; export declare function getObservabilityConfig(): Promise; export declare function instrumentAgentLoop(opts: { runAgentLoop: (loopOpts: { engine: any; model: string; systemPrompt: string; tools: any[]; messages: any[]; actions: Record; send: (event: AgentChatEvent) => void; signal: AbortSignal; onModelInput?: (messages: readonly unknown[]) => void | Promise; onModelDispatchStarted?: () => void; onUsage?: (usage: AgentLoopUsage) => void; onOutcome?: (outcome: AgentLoopOutcome) => void; providerOptions?: any; runId?: string; }) => Promise; loopOpts: { engine: any; model: string; systemPrompt: string; tools: any[]; messages: any[]; actions: Record; send: (event: AgentChatEvent) => void; signal: AbortSignal; onModelInput?: (messages: readonly unknown[]) => void | Promise; onModelDispatchStarted?: () => void; onUsage?: (usage: AgentLoopUsage) => void; onOutcome?: (outcome: AgentLoopOutcome) => void; providerOptions?: any; runId?: string; }; runId: string; threadId: string | null; /** The agent turn this run serves; omitted from events when unknown. */ turnId?: string; userId: string | null; config: ObservabilityConfig; spanName?: string; metadata?: Record | null; experimentAssignments?: Array<{ experimentId: string; variantId: string; }>; singularExperimentAssignment?: { experimentId: string; variantId: string; }; modelSelectionSource?: string; delegation?: { protocol: "a2a" | "mcp" | "agent-team"; callerApp?: string; taskId?: string; parentRunId?: string; parentTurnId?: string; }; sentimentInput?: string; browserSessionId?: string; classifyError?: (error: unknown) => { status?: "success" | "error"; errorMessage?: string | null; metadata?: Record | null; } | null | undefined; }): Promise;