import { type AgentTierResolution, type CodaliGatewayAgentAssignment, type CodaliGatewayAgentCandidate, type CodaliGatewayAgentSource, type CodaliGatewayAgentTierError } from "../gateway/AgentTierResolver.js"; import type { CodaliAgentTierPolicy, CodaliGatewayModelTier } from "../gateway/CodaliGatewayTypes.js"; export type CodaliGatewayLiveScenarioId = "generic_question" | "docdex_encrypted_repo_search" | "tool_disabled_leakage" | "multi_step_evidence" | "final_answer_large_model" | "image_generation"; export type CodaliGatewayLiveRoleKey = "small_json" | "medium_planner" | "medium_verifier" | "large_final" | "image_worker"; export type CodaliGatewayLiveScenarioStatus = "passed" | "failed" | "degraded" | "skipped"; export type CodaliGatewayLiveHarnessStatus = "passed" | "failed" | "degraded"; export interface CodaliGatewayLiveCommandResult { stdout: string; stderr: string; exitCode: number; signal?: string; latencyMs: number; timedOut?: boolean; } export type CodaliGatewayLiveCommandRunner = (command: string, args: string[], options: { input?: string; timeoutMs: number; maxBuffer?: number; env?: NodeJS.ProcessEnv; }) => Promise; export interface CodaliGatewayLiveScenarioArtifact { id?: string; kind?: string; uri?: string; mimeType?: string; metadata?: Record; } export interface CodaliGatewayLiveScenarioResult { id: CodaliGatewayLiveScenarioId; label: string; status: CodaliGatewayLiveScenarioStatus; role: CodaliGatewayLiveRoleKey; agentSlug?: string; tier?: CodaliGatewayModelTier; model?: string; adapter?: string; latencyMs: number; jsonValid?: boolean; toolCallCount?: number; calledTools?: string[]; finalAnswerStatus?: string; finalModelTier?: CodaliGatewayModelTier; finalModelAgentSlug?: string; artifact?: CodaliGatewayLiveScenarioArtifact; outputPreview?: string; warnings: string[]; errors: string[]; metadata?: Record; } export type CodaliGatewayShadowComparisonStatus = "disabled" | "skipped" | "compared"; export interface CodaliGatewayShadowComparisonPolicy { enabled?: boolean; maxCandidatesPerScenario?: number; includePrimary?: boolean; requireHealthy?: boolean; roles?: CodaliGatewayLiveRoleKey[]; } export interface CodaliGatewayLiveEnvironmentWarning { code: string; message: string; reason: string; role?: CodaliGatewayLiveRoleKey; resolverRole?: string; agentSlug?: string; healthStatus?: CodaliGatewayAgentCandidate["healthStatus"]; details?: Record; } export interface CodaliGatewayModelComparisonTokenUse { inputTokens?: number; outputTokens?: number; totalTokens?: number; } export interface CodaliGatewayModelComparisonQueueMetrics { waitMs?: number; depth?: number; status?: string; } export interface CodaliGatewayModelComparisonThroughputMetrics { tokensPerSecond?: number; requestsPerMinute?: number; } export interface CodaliGatewayModelComparisonMetrics { quality: { status: CodaliGatewayLiveScenarioStatus; score: number; jsonValid?: boolean; toolCallCount?: number; artifactPresent?: boolean; finalAnswerSucceeded?: boolean; }; latencyMs?: number; costUsd?: number; tokenUse?: CodaliGatewayModelComparisonTokenUse; queue?: CodaliGatewayModelComparisonQueueMetrics; throughput?: CodaliGatewayModelComparisonThroughputMetrics; failure: { status: "none" | "failed" | "degraded" | "skipped"; reasons: string[]; }; localInference?: Record; } export interface CodaliGatewayModelComparisonRecord { id: string; scenarioId: CodaliGatewayLiveScenarioId; role: CodaliGatewayLiveRoleKey; resolverRole: string; comparisonRole: "primary" | "shadow"; primary: boolean; candidateRank?: number; agentSlug?: string; tier?: CodaliGatewayModelTier; model?: string; adapter?: string; source?: CodaliGatewayAgentSource; healthStatus?: CodaliGatewayAgentCandidate["healthStatus"]; capabilities?: string[]; resultStatus: CodaliGatewayLiveScenarioStatus; selectedByPolicy: boolean; metrics: CodaliGatewayModelComparisonMetrics; warnings: string[]; errors: string[]; metadata?: Record; } export interface CodaliGatewayShadowComparisonResult { policy: { enabled: boolean; maxCandidatesPerScenario: number; includePrimary: boolean; requireHealthy: boolean; roles: CodaliGatewayLiveRoleKey[]; }; status: CodaliGatewayShadowComparisonStatus; records: CodaliGatewayModelComparisonRecord[]; environmentWarnings: CodaliGatewayLiveEnvironmentWarning[]; } export interface CodaliGatewayLiveScenarioDefinition { id: CodaliGatewayLiveScenarioId; label: string; role: CodaliGatewayLiveRoleKey; expectsJson?: boolean; expectsArtifact?: boolean; requiresGatewayToolTelemetry?: boolean; } export interface CodaliGatewayLiveScenarioRunnerInput { runId: string; scenario: CodaliGatewayLiveScenarioDefinition; assignment?: CodaliGatewayAgentAssignment; classification: CodaliGatewayLiveClassification; commandRunner: CodaliGatewayLiveCommandRunner; command: string; timeoutMs: number; forceAgentRun: boolean; } export type CodaliGatewayLiveScenarioRunner = (input: CodaliGatewayLiveScenarioRunnerInput) => Promise; export interface CodaliGatewayLiveAgentSummary { slug: string; tier: CodaliGatewayModelTier; source: CodaliGatewayAgentCandidate["source"]; healthStatus: CodaliGatewayAgentCandidate["healthStatus"]; latencyMs?: number; model?: string; adapter?: string; supportsTools?: boolean; supportsJsonSchema?: boolean; supportsImageGeneration?: boolean; contextWindow?: number; costPerMillion?: number; rating?: number; reasoningRating?: number; } export interface CodaliGatewayLiveRoleSummary { role: CodaliGatewayLiveRoleKey; resolverRole: string; agentSlug?: string; tier?: CodaliGatewayModelTier; model?: string; score?: number; reasons: string[]; status: "assigned" | "unavailable"; errorCodes: string[]; } export interface CodaliGatewayLiveClassification { resolution: AgentTierResolution; assignments: Record; agents: CodaliGatewayLiveAgentSummary[]; roles: Record; warnings: CodaliGatewayAgentTierError[]; errors: CodaliGatewayAgentTierError[]; } export interface CodaliGatewayLiveDiscoveryResult { source: "provided" | "command"; command?: string; args?: string[]; status: "succeeded" | "failed"; latencyMs: number; inventoryCount: number; errors: string[]; } export interface CodaliGatewayLiveHarnessOptions { runId?: string; inventory?: unknown[]; inventoryCommand?: { command?: string; args?: string[]; }; command?: string; commandRunner?: CodaliGatewayLiveCommandRunner; scenarioRunner?: CodaliGatewayLiveScenarioRunner; scenarios?: CodaliGatewayLiveScenarioId[]; timeoutMs?: number; maxBuffer?: number; forceAgentRun?: boolean; allowCloudFallback?: boolean; allowImageWorker?: boolean; agentPolicy?: CodaliAgentTierPolicy; shadowComparison?: CodaliGatewayShadowComparisonPolicy; } export interface CodaliGatewayLiveHarnessResult { schemaVersion: 1; runId: string; runtime: "codali_gateway_live_harness"; mode: "live"; startedAt: string; endedAt: string; durationMs: number; discovery: CodaliGatewayLiveDiscoveryResult; classification: CodaliGatewayLiveClassification; scenarios: CodaliGatewayLiveScenarioResult[]; shadowComparison: CodaliGatewayShadowComparisonResult; environmentWarnings: CodaliGatewayLiveEnvironmentWarning[]; summary: { status: CodaliGatewayLiveHarnessStatus; passed: number; failed: number; degraded: number; skipped: number; jsonValidAgents: string[]; largeFinalSynthesizerOk: boolean; imageArtifactOk: boolean; missingRoles: CodaliGatewayLiveRoleKey[]; }; warnings: string[]; errors: string[]; } export declare const CODALI_GATEWAY_LIVE_SCENARIOS: CodaliGatewayLiveScenarioDefinition[]; export declare const defaultCodaliGatewayLiveCommandRunner: CodaliGatewayLiveCommandRunner; export declare const parseCodaliGatewayLiveInventory: (payload: unknown) => unknown[]; export declare const redactCodaliGatewayLiveValue: (value: unknown) => unknown; export declare const classifyCodaliGatewayLiveAgents: (input: { inventory: unknown[]; allowCloudFallback?: boolean; allowImageWorker?: boolean; agentPolicy?: CodaliAgentTierPolicy; }) => CodaliGatewayLiveClassification; export declare const createMcodaAgentRunScenarioRunner: () => CodaliGatewayLiveScenarioRunner; export declare const runCodaliGatewayLiveHarness: (options?: CodaliGatewayLiveHarnessOptions) => Promise; export declare const formatCodaliGatewayLiveHarnessTextReport: (result: CodaliGatewayLiveHarnessResult) => string; //# sourceMappingURL=CodaliGatewayLiveHarness.d.ts.map