/**
 * Multi-Model Architecture Types
 *
 * Defines types for the two-tier agentic architecture:
 * - Tier 1 (Planner): High-level reasoning and task decomposition
 * - Tier 2 (Executor): Concrete implementation following planner specs
 */
import { z } from 'zod';
export type ModelProvider = 'anthropic' | 'openai' | 'ollama' | 'custom';
export type ModelRole = 'planner' | 'executor' | 'reviewer' | 'fallback' | 'task';
export type TaskComplexity = 'low' | 'medium' | 'high' | 'critical';
/**
 * Model configuration for a specific provider/model combination
 */
export declare const ModelConfigSchemaModels: z.ZodObject<{
    id: z.ZodString;
    name: z.ZodString;
    provider: z.ZodEnum<["anthropic", "openai", "ollama", "custom"]>;
    apiModel: z.ZodString;
    endpoint: z.ZodOptional<z.ZodString>;
    apiKeyEnvVar: z.ZodOptional<z.ZodString>;
    maxContextTokens: z.ZodDefault<z.ZodNumber>;
    costPer1MInput: z.ZodOptional<z.ZodNumber>;
    costPer1MOutput: z.ZodOptional<z.ZodNumber>;
    capabilities: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
    modelContextBudget: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
    id: string;
    name: string;
    provider: "anthropic" | "openai" | "ollama" | "custom";
    apiModel: string;
    maxContextTokens: number;
    capabilities: string[];
    endpoint?: string | undefined;
    apiKeyEnvVar?: string | undefined;
    costPer1MInput?: number | undefined;
    costPer1MOutput?: number | undefined;
    modelContextBudget?: number | undefined;
}, {
    id: string;
    name: string;
    provider: "anthropic" | "openai" | "ollama" | "custom";
    apiModel: string;
    endpoint?: string | undefined;
    apiKeyEnvVar?: string | undefined;
    maxContextTokens?: number | undefined;
    costPer1MInput?: number | undefined;
    costPer1MOutput?: number | undefined;
    capabilities?: string[] | undefined;
    modelContextBudget?: number | undefined;
}>;
export type ModelConfig = z.infer<typeof ModelConfigSchemaModels>;
/**
 * Pre-defined model presets for common configurations
 */
export declare const ModelPresets: Record<string, ModelConfig>;
export type ModelPresetId = keyof typeof ModelPresets;
/**
 * Role assignment configuration - maps roles to models
 */
export declare const RoleAssignmentSchema: z.ZodObject<{
    role: z.ZodEnum<["planner", "executor", "reviewer", "fallback"]>;
    modelId: z.ZodString;
    maxTokensPerRequest: z.ZodOptional<z.ZodNumber>;
    timeout: z.ZodDefault<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
    role: "planner" | "executor" | "reviewer" | "fallback";
    modelId: string;
    timeout: number;
    maxTokensPerRequest?: number | undefined;
}, {
    role: "planner" | "executor" | "reviewer" | "fallback";
    modelId: string;
    maxTokensPerRequest?: number | undefined;
    timeout?: number | undefined;
}>;
export type RoleAssignment = z.infer<typeof RoleAssignmentSchema>;
/**
 * Routing rule for task-to-model mapping
 */
export declare const RoutingRuleSchema: z.ZodObject<{
    complexity: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
    keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    taskType: z.ZodOptional<z.ZodEnum<["planning", "coding", "refactoring", "bug-fix", "review", "documentation"]>>;
    targetRole: z.ZodEnum<["planner", "executor", "reviewer", "fallback"]>;
    priority: z.ZodDefault<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
    targetRole: "planner" | "executor" | "reviewer" | "fallback";
    priority: number;
    complexity?: "low" | "medium" | "high" | "critical" | undefined;
    keywords?: string[] | undefined;
    taskType?: "planning" | "review" | "coding" | "refactoring" | "bug-fix" | "documentation" | undefined;
}, {
    targetRole: "planner" | "executor" | "reviewer" | "fallback";
    complexity?: "low" | "medium" | "high" | "critical" | undefined;
    keywords?: string[] | undefined;
    taskType?: "planning" | "review" | "coding" | "refactoring" | "bug-fix" | "documentation" | undefined;
    priority?: number | undefined;
}>;
export type RoutingRule = z.infer<typeof RoutingRuleSchema>;
/**
 * Multi-Model Architecture configuration schema for .uap.json
 */
export declare const MultiModelConfigSchema: z.ZodObject<{
    enabled: z.ZodDefault<z.ZodBoolean>;
    models: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
        id: z.ZodString;
        name: z.ZodString;
        provider: z.ZodEnum<["anthropic", "openai", "ollama", "custom"]>;
        apiModel: z.ZodString;
        endpoint: z.ZodOptional<z.ZodString>;
        apiKeyEnvVar: z.ZodOptional<z.ZodString>;
        maxContextTokens: z.ZodDefault<z.ZodNumber>;
        costPer1MInput: z.ZodOptional<z.ZodNumber>;
        costPer1MOutput: z.ZodOptional<z.ZodNumber>;
        capabilities: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
        modelContextBudget: z.ZodOptional<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        id: string;
        name: string;
        provider: "anthropic" | "openai" | "ollama" | "custom";
        apiModel: string;
        maxContextTokens: number;
        capabilities: string[];
        endpoint?: string | undefined;
        apiKeyEnvVar?: string | undefined;
        costPer1MInput?: number | undefined;
        costPer1MOutput?: number | undefined;
        modelContextBudget?: number | undefined;
    }, {
        id: string;
        name: string;
        provider: "anthropic" | "openai" | "ollama" | "custom";
        apiModel: string;
        endpoint?: string | undefined;
        apiKeyEnvVar?: string | undefined;
        maxContextTokens?: number | undefined;
        costPer1MInput?: number | undefined;
        costPer1MOutput?: number | undefined;
        capabilities?: string[] | undefined;
        modelContextBudget?: number | undefined;
    }>]>, "many">>;
    roles: z.ZodOptional<z.ZodObject<{
        planner: z.ZodDefault<z.ZodString>;
        executor: z.ZodDefault<z.ZodString>;
        reviewer: z.ZodOptional<z.ZodString>;
        fallback: z.ZodDefault<z.ZodString>;
    }, "strip", z.ZodTypeAny, {
        planner: string;
        executor: string;
        fallback: string;
        reviewer?: string | undefined;
    }, {
        planner?: string | undefined;
        executor?: string | undefined;
        reviewer?: string | undefined;
        fallback?: string | undefined;
    }>>;
    routing: z.ZodOptional<z.ZodArray<z.ZodObject<{
        complexity: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
        keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
        taskType: z.ZodOptional<z.ZodEnum<["planning", "coding", "refactoring", "bug-fix", "review", "documentation"]>>;
        targetRole: z.ZodEnum<["planner", "executor", "reviewer", "fallback"]>;
        priority: z.ZodDefault<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        targetRole: "planner" | "executor" | "reviewer" | "fallback";
        priority: number;
        complexity?: "low" | "medium" | "high" | "critical" | undefined;
        keywords?: string[] | undefined;
        taskType?: "planning" | "review" | "coding" | "refactoring" | "bug-fix" | "documentation" | undefined;
    }, {
        targetRole: "planner" | "executor" | "reviewer" | "fallback";
        complexity?: "low" | "medium" | "high" | "critical" | undefined;
        keywords?: string[] | undefined;
        taskType?: "planning" | "review" | "coding" | "refactoring" | "bug-fix" | "documentation" | undefined;
        priority?: number | undefined;
    }>, "many">>;
    costOptimization: z.ZodOptional<z.ZodObject<{
        enabled: z.ZodDefault<z.ZodBoolean>;
        targetReduction: z.ZodDefault<z.ZodNumber>;
        maxPerformanceDegradation: z.ZodDefault<z.ZodNumber>;
        fallbackThreshold: z.ZodDefault<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        enabled: boolean;
        targetReduction: number;
        maxPerformanceDegradation: number;
        fallbackThreshold: number;
    }, {
        enabled?: boolean | undefined;
        targetReduction?: number | undefined;
        maxPerformanceDegradation?: number | undefined;
        fallbackThreshold?: number | undefined;
    }>>;
    routingMatrix: z.ZodOptional<z.ZodRecord<z.ZodEnum<["low", "medium", "high", "critical"]>, z.ZodObject<{
        planner: z.ZodString;
        executor: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        planner: string;
        executor: string;
    }, {
        planner: string;
        executor: string;
    }>>>;
    routingStrategy: z.ZodDefault<z.ZodEnum<["cost-optimized", "performance-first", "balanced", "adaptive"]>>;
    plannerSettings: z.ZodOptional<z.ZodObject<{
        complexityThreshold: z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>;
        maxPlanningTokens: z.ZodDefault<z.ZodNumber>;
        enableDecomposition: z.ZodDefault<z.ZodBoolean>;
    }, "strip", z.ZodTypeAny, {
        complexityThreshold: "low" | "medium" | "high";
        maxPlanningTokens: number;
        enableDecomposition: boolean;
    }, {
        complexityThreshold?: "low" | "medium" | "high" | undefined;
        maxPlanningTokens?: number | undefined;
        enableDecomposition?: boolean | undefined;
    }>>;
    executorSettings: z.ZodOptional<z.ZodObject<{
        retryWithFallback: z.ZodDefault<z.ZodBoolean>;
        maxRetries: z.ZodDefault<z.ZodNumber>;
        stepTimeout: z.ZodDefault<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        retryWithFallback: boolean;
        maxRetries: number;
        stepTimeout: number;
    }, {
        retryWithFallback?: boolean | undefined;
        maxRetries?: number | undefined;
        stepTimeout?: number | undefined;
    }>>;
}, "strip", z.ZodTypeAny, {
    enabled: boolean;
    models: (string | {
        id: string;
        name: string;
        provider: "anthropic" | "openai" | "ollama" | "custom";
        apiModel: string;
        maxContextTokens: number;
        capabilities: string[];
        endpoint?: string | undefined;
        apiKeyEnvVar?: string | undefined;
        costPer1MInput?: number | undefined;
        costPer1MOutput?: number | undefined;
        modelContextBudget?: number | undefined;
    })[];
    routingStrategy: "cost-optimized" | "performance-first" | "balanced" | "adaptive";
    roles?: {
        planner: string;
        executor: string;
        fallback: string;
        reviewer?: string | undefined;
    } | undefined;
    routing?: {
        targetRole: "planner" | "executor" | "reviewer" | "fallback";
        priority: number;
        complexity?: "low" | "medium" | "high" | "critical" | undefined;
        keywords?: string[] | undefined;
        taskType?: "planning" | "review" | "coding" | "refactoring" | "bug-fix" | "documentation" | undefined;
    }[] | undefined;
    costOptimization?: {
        enabled: boolean;
        targetReduction: number;
        maxPerformanceDegradation: number;
        fallbackThreshold: number;
    } | undefined;
    routingMatrix?: Partial<Record<"low" | "medium" | "high" | "critical", {
        planner: string;
        executor: string;
    }>> | undefined;
    plannerSettings?: {
        complexityThreshold: "low" | "medium" | "high";
        maxPlanningTokens: number;
        enableDecomposition: boolean;
    } | undefined;
    executorSettings?: {
        retryWithFallback: boolean;
        maxRetries: number;
        stepTimeout: number;
    } | undefined;
}, {
    enabled?: boolean | undefined;
    models?: (string | {
        id: string;
        name: string;
        provider: "anthropic" | "openai" | "ollama" | "custom";
        apiModel: string;
        endpoint?: string | undefined;
        apiKeyEnvVar?: string | undefined;
        maxContextTokens?: number | undefined;
        costPer1MInput?: number | undefined;
        costPer1MOutput?: number | undefined;
        capabilities?: string[] | undefined;
        modelContextBudget?: number | undefined;
    })[] | undefined;
    roles?: {
        planner?: string | undefined;
        executor?: string | undefined;
        reviewer?: string | undefined;
        fallback?: string | undefined;
    } | undefined;
    routing?: {
        targetRole: "planner" | "executor" | "reviewer" | "fallback";
        complexity?: "low" | "medium" | "high" | "critical" | undefined;
        keywords?: string[] | undefined;
        taskType?: "planning" | "review" | "coding" | "refactoring" | "bug-fix" | "documentation" | undefined;
        priority?: number | undefined;
    }[] | undefined;
    costOptimization?: {
        enabled?: boolean | undefined;
        targetReduction?: number | undefined;
        maxPerformanceDegradation?: number | undefined;
        fallbackThreshold?: number | undefined;
    } | undefined;
    routingMatrix?: Partial<Record<"low" | "medium" | "high" | "critical", {
        planner: string;
        executor: string;
    }>> | undefined;
    routingStrategy?: "cost-optimized" | "performance-first" | "balanced" | "adaptive" | undefined;
    plannerSettings?: {
        complexityThreshold?: "low" | "medium" | "high" | undefined;
        maxPlanningTokens?: number | undefined;
        enableDecomposition?: boolean | undefined;
    } | undefined;
    executorSettings?: {
        retryWithFallback?: boolean | undefined;
        maxRetries?: number | undefined;
        stepTimeout?: number | undefined;
    } | undefined;
}>;
export type MultiModelConfig = z.infer<typeof MultiModelConfigSchema>;
/**
 * Task classification result from the router
 */
export interface TaskClassificationResult {
    complexity: TaskComplexity;
    taskType: 'planning' | 'coding' | 'refactoring' | 'bug-fix' | 'review' | 'documentation';
    keywords: string[];
    estimatedTokens: number;
    requiresPlanning: boolean;
    suggestedModel: string;
    fallbackModel: string;
    reasoning: string;
}
/**
 * Execution plan from the planner
 */
export interface ExecutionPlan {
    id: string;
    originalTask: string;
    subtasks: Subtask[];
    dependencies: Map<string, string[]>;
    modelAssignments: Map<string, string>;
    estimatedCost: number;
    estimatedDuration: number;
    created: Date;
}
export interface Subtask {
    id: string;
    title: string;
    description: string;
    type: 'planning' | 'coding' | 'refactoring' | 'bug-fix' | 'review' | 'documentation';
    complexity: TaskComplexity;
    inputs: string[];
    outputs: string[];
    constraints: string[];
    /** Suggested expert droids for this subtask, in execution order. Optional. */
    suggestedDroids?: string[];
}
/**
 * Execution result for tracking
 */
export interface ExecutionResult {
    planId: string;
    subtaskId: string;
    modelUsed: string;
    success: boolean;
    output: string;
    error?: string;
    tokensUsed: {
        input: number;
        output: number;
    };
    cost: number;
    duration: number;
    retryCount: number;
}
/**
 * Model selection result from the router
 */
export interface ModelSelection {
    model: ModelConfig;
    fallback?: ModelConfig;
    role: ModelRole;
    reasoning: string;
    estimatedCost: number;
}
export declare const DEFAULT_ROUTING_RULES: RoutingRule[];
//# sourceMappingURL=types.d.ts.map