import type { LocalOpenAiCompatibleRunnerConfig, LocalRunnerAuthMode, LocalRunnerKind, LocalRunnerResponseFormatStrategy } from "@mcoda/shared"; export interface DocdexConfig { baseUrl: string; repoRoot?: string; repoId?: string; } export interface ToolConfig { enabled?: string[]; allowShell?: boolean; shellAllowlist?: string[]; allowOutsideWorkspace?: boolean; allowDestructiveOperations?: boolean; } export interface LimitsConfig { maxSteps: number; maxToolCalls: number; maxRetries: number; maxTokens?: number; timeoutMs: number; } export interface ContextConfig { mode: "bundle_text" | "json"; maxFiles: number; maxTotalBytes: number; tokenBudget: number; focusMaxFileBytes: number; peripheryMaxBytes: number; includeRepoMap: boolean; includeImpact: boolean; includeSnippets: boolean; readStrategy: "docdex" | "fs"; maxContextRefreshes: number; skeletonizeLargeFiles: boolean; redactSecrets: boolean; ignoreFilesFrom: string[]; preferredFiles?: string[]; recentFiles?: string[]; skipSearchWhenPreferred?: boolean; } /** * Minimum tool usage required during deep investigation. * Counts are category-based and only enforced when deep investigation is enabled. */ export interface DeepInvestigationToolQuotaConfig { search: number; openOrSnippet: number; symbolsOrAst: number; impact: number; tree: number; dagExport: number; } /** * Minimum investigation budget required before planning. * Values are only enforced when deep investigation is enabled. */ export interface DeepInvestigationBudgetConfig { minCycles: number; minSeconds: number; maxCycles: number; } /** * Evidence thresholds used to decide if investigation is sufficient. * Values are only enforced when deep investigation is enabled. */ export interface DeepInvestigationEvidenceConfig { minSearchHits: number; minOpenOrSnippet: number; minSymbolsOrAst: number; minImpact: number; maxWarnings: number; } /** * Deep investigation configuration bundle. */ export interface DeepInvestigationConfig { enabled: boolean; deepScanPreset: boolean; toolQuota: DeepInvestigationToolQuotaConfig; investigationBudget: DeepInvestigationBudgetConfig; evidenceGate: DeepInvestigationEvidenceConfig; } export interface SecurityConfig { redactPatterns: string[]; readOnlyPaths: string[]; allowDocEdits: boolean; allowCloudModels: boolean; allowWorkers: boolean; } export interface BuilderConfig { mode: "tool_calls" | "patch_json" | "freeform"; patchFormat: "search_replace" | "file_writes"; fallbackToInterpreter?: boolean; } export declare const WORKFLOW_PROFILE_NAMES: readonly ["run", "fix", "review", "explain", "test"]; export type WorkflowProfileName = (typeof WORKFLOW_PROFILE_NAMES)[number]; export type WorkflowProfileSource = "command" | "cli" | "env" | "config" | "default"; export type WorkflowOutputContract = "general" | "patch_summary" | "review_findings" | "explanation" | "verification_summary"; export interface WorkflowProfile { name: WorkflowProfileName; description: string; smart: boolean; builderMode: BuilderConfig["mode"]; fallbackToInterpreter: boolean; retryBudget: number; verificationPolicy: string; verificationMinimumChecks: number; verificationEnforceHighConfidence: boolean; outputContract: WorkflowOutputContract; allowWrites: boolean; } export interface WorkflowConfig { profile?: WorkflowProfileName; profiles?: Partial>>; } export interface ResolvedWorkflowProfile extends WorkflowProfile { source: WorkflowProfileSource; command: string; } export interface InterpreterConfig { provider: string; model: string; format: string; grammar?: string; maxRetries: number; timeoutMs: number; } export interface StreamingConfig { enabled: boolean; flushEveryMs: number; } export interface CostConfig { maxCostPerRun: number; charPerToken: number; pricingOverrides: Record; } export interface LocalContextSummarizeConfig { enabled: boolean; provider: string; model?: string; targetTokens: number; thresholdPct: number; } export interface LocalContextConfig { enabled: boolean; storageDir: string; persistToolMessages: boolean; maxMessages: number; maxBytesPerLane: number; modelTokenLimits: Record; summarize: LocalContextSummarizeConfig; } export interface RoutingPhaseConfig { agent?: string; provider?: string; model?: string; temperature?: number; format?: string; grammar?: string; } export interface RoutingConfig { librarian?: RoutingPhaseConfig; architect?: RoutingPhaseConfig; builder?: RoutingPhaseConfig; critic?: RoutingPhaseConfig; interpreter?: RoutingPhaseConfig; } export interface LoggingConfig { directory: string; } export interface EvalGateConfig { patch_apply_drop_max: number; verification_pass_rate_min: number; hallucination_rate_max: number; scope_violation_rate_max: number; } export interface EvalConfig { report_dir: string; gates: EvalGateConfig; } export interface LearningConfig { persistence_min_confidence: number; enforcement_min_confidence: number; require_confirmation_for_low_confidence: boolean; auto_enforce_high_confidence: boolean; candidate_store_file: string; } export interface CodaliConfig { workspaceRoot: string; project?: string; command?: string; commandRunId?: string; jobId?: string; runId?: string; taskId?: string; taskKey?: string; agentId?: string; agentSlug?: string; smart?: boolean; planHint?: string; provider: string; model: string; apiKey?: string; baseUrl?: string; localRunner?: LocalOpenAiCompatibleRunnerConfig; runnerKind?: LocalRunnerKind; authMode?: LocalRunnerAuthMode; dummyBearerToken?: string; headers?: Record; extraBody?: Record; responseFormatStrategy?: LocalRunnerResponseFormatStrategy; healthPath?: string; modelsPath?: string; requireModelInRequest?: boolean; supportsStreaming?: boolean; supportsTools?: boolean; supportsJsonSchema?: boolean; supportsGbnf?: boolean; workflow?: WorkflowConfig; resolvedWorkflowProfile?: ResolvedWorkflowProfile; docdex: DocdexConfig; tools: ToolConfig; limits: LimitsConfig; context: ContextConfig; /** * Deep investigation controls. When unset or disabled, deep mode is inactive. * Deep investigation requires the smart pipeline; builder-only runs fail closed. */ deepInvestigation?: DeepInvestigationConfig; security: SecurityConfig; builder: BuilderConfig; interpreter: InterpreterConfig; streaming: StreamingConfig; cost: CostConfig; localContext: LocalContextConfig; eval: EvalConfig; learning: LearningConfig; logging: LoggingConfig; routing?: RoutingConfig; } export declare const DEFAULT_DOCDEX_BASE_URL = "http://127.0.0.1:28491"; export declare const DEFAULT_LOG_DIR = "logs/codali"; export declare const DEFAULT_WORKFLOW_PROFILE: WorkflowProfileName; export declare const DEFAULT_WORKFLOW_PROFILES: Record; export declare const DEFAULT_LIMITS: LimitsConfig; export declare const DEFAULT_CONTEXT: ContextConfig; export declare const DEFAULT_DEEP_INVESTIGATION_TOOL_QUOTA: DeepInvestigationToolQuotaConfig; export declare const DEFAULT_DEEP_INVESTIGATION_BUDGET: DeepInvestigationBudgetConfig; export declare const DEFAULT_DEEP_INVESTIGATION_EVIDENCE: DeepInvestigationEvidenceConfig; export declare const DEFAULT_DEEP_INVESTIGATION: DeepInvestigationConfig; export declare const DEFAULT_SECURITY: SecurityConfig; export declare const DEFAULT_BUILDER: BuilderConfig; export declare const DEFAULT_INTERPRETER: InterpreterConfig; export declare const DEFAULT_STREAMING: StreamingConfig; export declare const DEFAULT_COST: CostConfig; export declare const DEFAULT_LOCAL_CONTEXT: LocalContextConfig; export declare const DEFAULT_TOOL_CONFIG: ToolConfig; export declare const DEFAULT_EVAL_GATES: EvalGateConfig; export declare const DEFAULT_EVAL: EvalConfig; export declare const DEFAULT_LEARNING: LearningConfig; export declare const DEFAULT_LOGGING: LoggingConfig; //# sourceMappingURL=Config.d.ts.map