import type { ProviderUsageSnapshot } from '../../models/response.js'; import type { WorkflowMaxSteps, WorkflowResumePointEntry, WorkflowStep } from '../../models/types.js'; import type { JudgeStageEntry, PhaseName, PhasePromptParts, StepProviderInfo, StepRunResult, WorkflowStepFailureSummary, WorkflowTraceTaskMetadata } from '../types.js'; export interface WorkflowSpanParams { enabled: boolean; runId?: string; workflowName: string; initialStep: string; stepCount: number; maxSteps: WorkflowMaxSteps; runMode: 'full' | 'single_iteration'; resumeDepth: number; sanitizeText?: (text: string) => string; traceTaskMetadata?: WorkflowTraceTaskMetadata; } export interface WorkflowSpanOutcome { status?: string; abortKind?: string; abortReason?: string; failure?: WorkflowStepFailureSummary; nextStep?: string; iterations?: number; } export interface StepSpanParams { enabled: boolean; runId?: string; workflowName: string; step: WorkflowStep; iteration: number; stepIteration?: number; instruction?: string; workflowStack?: WorkflowResumePointEntry[]; sanitizeText?: (text: string) => string; providerInfo?: StepProviderInfo; getFinalStepIteration?: () => number | undefined; traceTaskMetadata?: WorkflowTraceTaskMetadata; } export interface PhaseSpanParams { enabled: boolean; runId?: string; workflowName: string; step: WorkflowStep; iteration?: number; phase: 1 | 2 | 3; phaseName: PhaseName; instruction?: string; phaseExecutionId?: string; workflowStack?: WorkflowResumePointEntry[]; sanitizeText?: (text: string) => string; providerInfo?: StepProviderInfo; getPromptParts?: () => PhasePromptParts | undefined; } export interface PhaseSpanOutcome { status?: string; content?: string; error?: string; matchedRuleIndex?: number; matchedRuleMethod?: string; providerUsage?: ProviderUsageSnapshot; } export interface JudgeStageSpanParams { enabled: boolean; runId?: string; workflowName: string; step: WorkflowStep; iteration?: number; phaseExecutionId?: string; workflowStack?: WorkflowResumePointEntry[]; entry: JudgeStageEntry; sanitizeText?: (text: string) => string; providerInfo?: StepProviderInfo; } export interface CompletionRetryJudgeSpanParams { enabled: boolean; runId?: string; workflowName: string; reviewerStep: string; attempt: number; providerInfo: StepProviderInfo; } export declare function runWithCompletionRetryJudgeSpan(params: CompletionRetryJudgeSpanParams, execute: () => Promise, outcome: (result: T) => { status: string; gapCount: number; }): Promise; export declare function runWithWorkflowSpan(params: WorkflowSpanParams, execute: () => Promise, getOutcome: (result: T) => WorkflowSpanOutcome, getErrorOutcome?: (error: unknown) => WorkflowSpanOutcome): Promise; export declare function runWithStepSpan(params: StepSpanParams, execute: () => Promise): Promise; export declare function runWithPhaseSpan(params: PhaseSpanParams, execute: () => Promise, getOutcome: (result: T) => PhaseSpanOutcome, getErrorOutcome?: (error: unknown) => PhaseSpanOutcome | undefined): Promise; export declare function recordJudgeStageSpan(params: JudgeStageSpanParams): void; //# sourceMappingURL=workflowSpans.d.ts.map