import type { SceneType } from './sceneClassifier';
import { type OutputLanguage } from './outputLanguage';
import type { ProviderScope } from '../services/providerManager';
export type EffortLevel = 'low' | 'medium' | 'high' | 'max';
export interface ClaudeAgentConfig {
    model: string;
    /** Lightweight model for auxiliary single-turn calls (verifier, classifier, summarizer).
     *  When using a third-party proxy that maps only one model, set CLAUDE_LIGHT_MODEL
     *  to the same value as CLAUDE_MODEL so all SDK calls route to the same endpoint. */
    lightModel: string;
    maxTurns: number;
    maxBudgetUsd?: number;
    cwd: string;
    effort: EffortLevel;
    /** Enable sub-agent delegation (frame-expert, system-expert, startup-expert). Default: false */
    enableSubAgents: boolean;
    /** Enable conclusion verification (heuristic + LLM). Default: false */
    enableVerification: boolean;
    /** Per sub-agent timeout in ms. Sub-agents exceeding this are stopped via stopTask(). Default: 120000 (2min) */
    subAgentTimeoutMs: number;
    /** Sub-agent model shorthand. Defaults to 'sonnet'.
     *  Accepted values: 'haiku' | 'sonnet' | 'opus' | 'inherit' (inherit orchestrator model). */
    subAgentModel?: 'inherit' | 'haiku' | 'sonnet' | 'opus';
    /** Per-turn timeout (ms) for the full analysis pipeline. Default: 60_000 (60s/turn).
     *  Raise via CLAUDE_FULL_PER_TURN_MS for slower LLMs (DeepSeek / Ollama / GLM). */
    fullPathPerTurnMs: number;
    /** Per-turn timeout (ms) for the quick analysis pipeline. Default: 40_000 (40s/turn).
     *  Override via CLAUDE_QUICK_PER_TURN_MS. */
    quickPathPerTurnMs: number;
    /** Timeout (ms) for the single-turn verifier LLM call. Default: 60_000.
     *  Override via CLAUDE_VERIFIER_TIMEOUT_MS (raise when CLAUDE_LIGHT_MODEL is not Haiku). */
    verifierTimeoutMs: number;
    /** Timeout (ms) for the single-turn query complexity classifier. Default: 30_000.
     *  Override via CLAUDE_CLASSIFIER_TIMEOUT_MS. */
    classifierTimeoutMs: number;
    /** User-facing output language. Default: zh-CN. Override via SMARTPERFETTO_OUTPUT_LANGUAGE=en. */
    outputLanguage: OutputLanguage;
}
export declare function loadClaudeConfig(overrides?: Partial<ClaudeAgentConfig>): ClaudeAgentConfig;
/**
 * Resolve effort level by scene type.
 * Explicit operator/provider effort overrides can opt out of scene defaults.
 * Deterministic pipelines (scrolling/startup/anr) use 'medium' since the workflow is prescriptive.
 * Open-ended queries ('general') use the configured default (typically 'high').
 */
export declare function resolveEffort(config: ClaudeAgentConfig, sceneType?: SceneType, options?: {
    configuredEffortOverridesScene?: boolean;
}): EffortLevel;
export declare function hasConfiguredClaudeEffortOverride(providerId?: string | null, providerScope?: ProviderScope): boolean;
export interface BedrockStatus {
    enabled: boolean;
    hasAuth: boolean;
    authMethod?: 'bearer_token' | 'iam_credentials' | 'profile_or_chain';
    region: string;
    baseUrl?: string;
    missing?: string[];
}
export interface VertexStatus {
    enabled: boolean;
    configured: boolean;
    projectId?: string;
    region?: string;
    missing?: string[];
}
/**
 * Detects whether AWS Bedrock is configured and whether its authentication
 * credentials are complete. Supports three auth paths:
 *   1. Bearer token: AWS_BEARER_TOKEN_BEDROCK
 *   2. IAM credentials: AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY (+ optional AWS_SESSION_TOKEN)
 *   3. AWS profile / default credential chain: AWS_PROFILE or implicit chain resolution
 */
export declare function detectBedrock(env?: Record<string, string | undefined>): BedrockStatus;
export declare function detectVertex(env?: Record<string, string | undefined>): VertexStatus;
/**
 * Returns true when any supported Claude credential source is present:
 * direct API key, proxy base URL, or AWS Bedrock.
 */
export declare function hasClaudeCredentials(env?: Record<string, string | undefined>): boolean;
export declare function getClaudeRuntimeDiagnostics(providerId?: string | null, providerScope?: ProviderScope): {
    runtime: string;
    providerMode: string;
    model: string;
    lightModel: string;
    baseUrl: string | undefined;
    outputLanguage: {
        value: OutputLanguage;
        displayName: string;
        env: string;
        default: OutputLanguage;
    };
    configured: boolean;
    credentialSources: string[];
    baseUrlConfigured: boolean;
    bedrock: {
        enabled: boolean;
        authMethod: "bearer_token" | "iam_credentials" | "profile_or_chain" | undefined;
        region: string;
        baseUrlConfigured: boolean;
    };
    vertex: VertexStatus;
    configHint: string;
    sdkBinary: ClaudeSdkBinaryDiagnostics;
};
export declare function isClaudeQuotaError(message: string): boolean;
export interface CredentialSourceHint {
    source: 'provider-manager' | 'env-or-default';
    providerName?: string;
    providerType?: string;
    providerRuntime?: string;
    envCredentialSources: string[];
    providerOverridesEnv: boolean;
}
export declare function getCredentialSourceHint(providerId?: string | null, providerScope?: ProviderScope): CredentialSourceHint;
export declare function explainClaudeRuntimeError(message: string, outputLanguage?: OutputLanguage, credentialSourceHint?: CredentialSourceHint): string;
/**
 * Check if ClaudeRuntime (agentv3) is the active orchestrator.
 * Defaults to true unless the explicit runtime is OpenAI Agents SDK.
 */
export declare function isClaudeCodeEnabled(): boolean;
/**
 * Create a lightweight config for quick (factual) queries.
 * Reduces maxTurns, effort, and disables verification/sub-agents
 * to optimize for fast response on simple questions.
 */
export declare function createQuickConfig(baseConfig: ClaudeAgentConfig, env?: Record<string, string | undefined>): ClaudeAgentConfig;
/** Diagnostics describing how the Claude Agent SDK native binary was resolved. */
export interface ClaudeSdkBinaryDiagnostics {
    detectedPlatformKey: string | null;
    chosenPath: string | null;
    fallbackUsed: boolean;
    source: 'env-override' | 'sdk-default' | 'fallback' | 'none';
    error?: string;
}
/** Test-only: reset the auto-detection memo. */
export declare function resetSdkBinaryOptionCache(): void;
/**
 * Resolve `pathToClaudeCodeExecutable`. Explicit CLAUDE_BINARY_PATH is read
 * per-call so Provider Manager env overlays take effect; auto-detection is
 * memoized.
 */
export declare function getSdkBinaryOption(env?: Record<string, string | undefined>): {
    pathToClaudeCodeExecutable?: string;
};
export declare function getClaudeSdkBinaryDiagnostics(env?: Record<string, string | undefined>): ClaudeSdkBinaryDiagnostics;
/**
 * Create a sanitized copy of process.env for SDK subprocess spawning.
 * When a providerId is given, overlays that provider's env vars.
 * When no providerId is given, overlays the active provider only when it is
 * configured for the Claude Agent SDK runtime.
 * Falls back to raw process.env when no provider is configured.
 */
export declare function createSdkEnv(sessionOverrideProviderId?: string | null, providerScope?: ProviderScope): Record<string, string | undefined>;
/**
 * Resolve the effective ClaudeAgentConfig based on the active provider or session override.
 * Unlike loadClaudeConfig() which only reads process.env at construction time,
 * this reads providerManager env vars at call time when the provider matches
 * the Claude Agent SDK runtime.
 */
export declare function resolveRuntimeConfig(baseConfig: ClaudeAgentConfig, providerId?: string | null, providerScope?: ProviderScope): ClaudeAgentConfig;
//# sourceMappingURL=claudeConfig.d.ts.map