import { WorkspaceResolution } from "../../workspace/WorkspaceManager.js"; import { TaskSelectionFilters } from "./TaskSelectionService.js"; type StepName = "work" | "review" | "qa"; type AgentTier = "cheap" | "strong" | "specialist" | "unknown"; type DecisionRecord = { step: StepName; kind: "result" | "retry" | "terminal"; status: string; detail?: string; attempt: number; timestamp: string; }; type FailureRecord = { step: StepName; agent: string; reason: string; attempt: number; timestamp: string; }; type RatingSummary = { step: StepName; agent: string; rating?: number; maxComplexity?: number; runScore?: number; qualityScore?: number; }; type TaskProgress = { taskKey: string; attempts: number; status: "pending" | "completed" | "failed" | "skipped"; lastStep?: StepName; lastError?: string; lastWorkAgentTier?: AgentTier; lastEscalationReason?: string; escalationAttempts?: Record; lastGuardrailRetryable?: boolean; lastQaFailureSummary?: string; pendingLearningSummary?: string; lastRevertEventAt?: string; lastDecision?: string; lastOutcome?: string; stepOutcomes?: Partial>; decisionHistory?: DecisionRecord[]; chosenAgents: { work?: string; review?: string; qa?: string; }; failureHistory?: FailureRecord[]; ratings?: RatingSummary[]; }; export interface GatewayTrioRequest extends TaskSelectionFilters { workspace: WorkspaceResolution; maxIterations?: number; maxCycles?: number; onJobStart?: (jobId: string, commandRunId: string) => void; onGatewayStart?: (details: GatewayLogDetails) => void; onGatewayChunk?: (chunk: string) => void; onGatewaySelection?: (details: GatewayLogDetails) => void; onGatewayEnd?: (details: GatewayLogDetails) => void; gatewayAgentName?: string; workAgentName?: string; reviewAgentName?: string; qaAgentName?: string; maxDocs?: number; agentStream?: boolean; noCommit?: boolean; dryRun?: boolean; reviewBase?: string; maxAgentSeconds?: number; qaProfileName?: string; qaLevel?: string; qaTestCommand?: string; qaMode?: "auto" | "manual"; qaFollowups?: "auto" | "none" | "prompt"; reviewFollowups?: boolean; qaResult?: "pass" | "fail"; qaNotes?: string; qaEvidenceUrl?: string; qaAllowDirty?: boolean; resumeJobId?: string; rateAgents?: boolean; escalateOnNoChange?: boolean; workRunner?: string; useCodali?: boolean; agentAdapterOverride?: string; } export interface GatewayLogDetails { taskKey: string; job: string; gatewayAgent?: string; chosenAgent?: string; chosenModel?: string; chosenAdapter?: string; startedAt: string; endedAt?: string; status?: "completed" | "failed"; error?: string; } export interface GatewayTrioTaskSummary { taskKey: string; attempts: number; status: TaskProgress["status"]; lastStep?: StepName; lastDecision?: string; lastOutcome?: string; lastError?: string; chosenAgents: TaskProgress["chosenAgents"]; ratings?: RatingSummary[]; } export interface GatewayTrioResult { jobId: string; commandRunId: string; tasks: GatewayTrioTaskSummary[]; warnings: string[]; failed: string[]; skipped: string[]; } export declare class GatewayTrioService { private workspace; private deps; private selectionService; private projectKeyCache; private tokenUsageCheckEnabled?; private constructor(); static create(workspace: WorkspaceResolution, options?: { noTelemetry?: boolean; }): Promise; close(): Promise; private disableDocdex; private writeDocdexCheckArtifact; private runDocdexPreflight; private trioDir; private statePath; private writeState; private loadState; private readManifest; private isPseudoTaskKey; private skipPseudoTask; private isTokenUsageCheckEnabled; private isZeroTokenRun; private backoffZeroTokens; private cleanupExpiredTaskLocks; private assertResumeAllowed; private writeHandoffArtifact; private prepareHandoff; private projectKeyForTask; private seedExplicitTasks; private ensureProgress; private dedupeTaskKeys; private buildRunListFromExplicit; private buildRunListFromSelection; private guardMissingContext; private hasMissingTaskSignal; private hasReachedMaxIterations; private hasIterationsRemaining; private shouldReopenFailedTask; private reopenRetryableFailedTasks; private dependenciesReady; private normalizeStatus; private resolveRequest; private buildStatusFilter; private refreshTaskStatus; private parseWorkResult; private parseReviewResult; private parseQaResult; private isAuthFailure; private shouldRetryAfter; private escalationReasons; private resolveTierFromComplexity; private nextTier; private recordFailure; private mergeGatewayFiles; private handoffContextForProgress; private appendFallbackHandoffContext; private recordDecision; private buildQaFailureSummary; private extractRevertLearning; private shouldSavePreference; private persistRevertLearning; private sanitizeGoldenText; private appendGoldenExample; private countFailures; private prioritizeFeedbackTasks; private buildAgentOptions; private recordRating; private loadRatingSummary; private updateJobHeartbeat; private runStepWithTimeout; private runGateway; private withGatewayIoSuppressed; private runWorkStep; private runReviewStep; private runQaStep; private toSummary; run(request: GatewayTrioRequest): Promise; } export {}; //# sourceMappingURL=GatewayTrioService.d.ts.map