/**
 * Configuration shape for the gemini-cli adapter.
 *
 * Gemini CLI auth (per the verified facts, v0.25.2):
 *   - Cached OAuth credentials under `~/.gemini` (the subscription / cached-
 *     OAuth path). THIS IS THE ALLOWED PATH.
 *   - A `GEMINI_API_KEY` / `GOOGLE_API_KEY` / Vertex env path can route onto
 *     a BILLED API account. The env-allowlist (geminiSpawn.ts) unconditionally
 *     deletes those billing-capable vars from the child env — the Rule-1a
 *     analog. See credentials.ts for the rationale.
 */
import { detectGeminiPath } from '../../../core/Config.js';
import { GEMINI_DEFAULT_MODEL } from './models.js';
/**
 * Build a config from environment variables, with sensible defaults.
 *
 * Binary detection: when `GEMINI_PATH` is not set, falls back to
 * `detectGeminiPath()` (the existing `detectFrameworkBinary('gemini')`
 * wrapper, which probes `~/.gemini/bin/gemini` + the standard install
 * locations). NEVER hardcode developer-specific paths here — the verified
 * `/opt/homebrew/bin/gemini` is a fact for THIS box, not a value to bake in.
 */
export function configFromEnv(env = process.env) {
    return {
        geminiPath: env['GEMINI_PATH'] || detectGeminiPath() || 'gemini',
        // Undefined → resolveCliModelFlag picks the verified-working default
        // (gemini-2.5-flash) via the tier resolver.
        defaultModel: env['GEMINI_DEFAULT_MODEL'],
        defaultApprovalMode: 'default',
        defaultOneShotTimeoutMs: 60_000,
        defaultSessionTimeoutMs: 30_000,
    };
}
/** Re-export for callers that want the literal default without configFromEnv. */
export { GEMINI_DEFAULT_MODEL };
//# sourceMappingURL=config.js.map