import { type ModelCapabilityProfile, type RoutingPolicy } from "./modelRouting.js"; import { type RoutingBudgets, type RoutingCircuitBreakers } from "./routingBudget.js"; import { type ExecutionLimits } from "./scheduler.js"; export type ThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"; export interface RoleConfig { provider: string; model: string; thinking: ThinkingLevel; } export type McpProviderApi = "anthropic-messages" | "openai-responses" | "openai-completions"; export interface ProviderConfig { baseUrl: string; api: McpProviderApi | string; apiKey?: string; } /** A user-trusted, MCP-callable catalog entry. Repository config may not add or alter entries. */ export interface McpModelConfig { provider: string; model: string; family?: string; reasoning: boolean; supportedThinking: ThinkingLevel[]; input: ("text" | "image")[]; contextWindow: number; maxOutputTokens: number; cost?: { input: number; output: number; cacheRead: number; cacheWrite: number; }; privacy?: "local" | "private" | "public" | "unknown"; /** Key in routing.profiles. Defaults to provider/model. */ profile?: string; } export type RoleName = "planner" | "coder" | "judge" | "spec" | "verifier" | "reviewer" | "debugger" | "shipper"; export type LifecycleRoutedStage = "define" | "plan" | "verify" | "review" | "debug" | "ship"; export type ModelCandidate = RoleConfig; export type ShipCommitMode = "ask" | "never" | "auto"; export type ShipOpenPrMode = "ask" | "never"; export type ExecutionEngine = "legacy" | "graph-shadow" | "graph"; export interface ExecutionConfig { engine: ExecutionEngine; allowProjectGraph: boolean; limits: ExecutionLimits; } export interface LifecycleRoutingConfig { enabled: boolean; stages: Record; } export interface CapabilityRoutingConfig extends RoutingPolicy { engine: "legacy" | "capability-shadow" | "capability"; profiles: Record; evidence: RoutingEvidenceConfig; budgets: RoutingBudgets; circuitBreakers: RoutingCircuitBreakers; } export interface RoutingEvidenceConfig { enabled: boolean; userStoreDir: string; shadowComparisons: boolean; minRecommendationSamples: number; } export interface McpRunStorageConfig { userStoreDir: string; projectMirror: boolean; terminalRetentionDays: number; } export interface OrchestratorConfig { execution: ExecutionConfig; roles: Record; loop: { maxCoderIterations: number; plannerEscalationAfterRejections: number; }; approval: { requirePlanApproval: boolean; }; judge: { runTests: boolean; }; lifecycle: { artifactsDir: string; }; build: { commitPerTask: boolean; }; routing: { lifecycle: LifecycleRoutingConfig; } & CapabilityRoutingConfig; ship: { commit: ShipCommitMode; openPr: ShipOpenPrMode; }; mcp: { providers: Record; models: McpModelConfig[]; runs: McpRunStorageConfig; }; } export declare const UNCONFIGURED_FABLE_BASE_URL = "https://example.invalid/fable/v1"; export declare const DEFAULT_CONFIG: OrchestratorConfig; export interface LoadConfigOptions { /** * Pi resolves models and credentials through its own registry and ignores mcp.providers. * Use this when loading config for the pi extension so partial MCP config intended for * the future MCP surface cannot block /orchestrate. */ ignoreMcpProviders?: boolean; /** * Project config is repository-controlled input. Use this on the MCP surface so a * cloned repository cannot redirect provider endpoints and exfiltrate user env vars. */ ignoreProjectMcpProviders?: boolean; } export type ConfigSource = "builtin" | "user" | "project"; export interface ConfigProvenance { roles: Record; } export interface ResolvedOrchestratorConfig { config: OrchestratorConfig; provenance: ConfigProvenance; } export declare function loadConfig(cwd: string, options?: LoadConfigOptions): OrchestratorConfig; export declare function loadConfigWithProvenance(cwd: string, options?: LoadConfigOptions): ResolvedOrchestratorConfig; export declare function loopConfigFrom(config: OrchestratorConfig): { maxCoderIterations: number; plannerEscalationAfterRejections: number; requirePlanApproval: boolean; }; export declare function executionLimitsFrom(config: OrchestratorConfig): ExecutionLimits;