import { type AftConfigFileMigrationResult, type ConfigTier } from "@cortexkit/aft-bridge"; import { z } from "zod"; /** How configure-time missing-tool warnings reach the user. Default: toast (no chat transcript). */ export declare const ConfigureWarningsDeliveryEnum: z.ZodEnum<{ toast: "toast"; log: "log"; chat: "chat"; }>; export type ConfigureWarningsDelivery = z.infer; export declare const DEFAULT_INSPECT_DIAGNOSTICS_TIMEOUT_MS = 120000; export declare const MIN_INSPECT_DIAGNOSTICS_TIMEOUT_MS = 10000; export declare const MAX_INSPECT_DIAGNOSTICS_TIMEOUT_MS = 600000; export declare const AftConfigSchema: z.ZodPreprocess; enabled: z.ZodOptional; edit_mode: z.ZodOptional>; format_on_edit: z.ZodOptional; formatter_timeout_secs: z.ZodOptional; validate_on_edit: z.ZodOptional>; formatter: z.ZodOptional>>; checker: z.ZodOptional>>; configure_warnings_delivery: z.ZodOptional>; hoist_builtin_tools: z.ZodOptional; tool_surface: z.ZodOptional>; disabled_tools: z.ZodOptional>; restrict_to_project_root: z.ZodOptional; search_index: z.ZodOptional; index: z.ZodOptional>; }, z.core.$strip>, z.ZodTransform<{ path: string; indexes: ("search" | "semantic" | "callgraph")[]; }, { path: string; indexes: ("search" | "semantic" | "callgraph")[]; }>>>>; }, z.core.$strip>>; semantic_search: z.ZodOptional; callgraph_store: z.ZodOptional; callgraph_chunk_size: z.ZodOptional; inspect: z.ZodOptional; diagnostics_timeout_ms: z.ZodPipe, z.ZodTransform>; tier2_idle_minutes: z.ZodOptional; categories: z.ZodOptional>; tier2_soft_deadline_ms: z.ZodOptional; max_drill_down_items: z.ZodOptional; duplicates: z.ZodOptional>>; }, z.core.$strip>>; }, z.core.$strip>>; backup: z.ZodOptional; max_depth: z.ZodOptional; max_file_size: z.ZodOptional; }, z.core.$strip>>; worktree: z.ZodOptional; }, z.core.$strip>>; sandbox: z.ZodOptional; write_allow: z.ZodOptional>; read_deny: z.ZodOptional>; }, z.core.$strip>>; bash: z.ZodOptional; compress: z.ZodOptional; background: z.ZodOptional; host_fallback: z.ZodOptional; subagent_background: z.ZodOptional; long_running_reminder_enabled: z.ZodOptional; long_running_reminder_interval_ms: z.ZodOptional; foreground_wait_window_ms: z.ZodOptional; }, z.core.$strip>]>>; experimental: z.ZodOptional; compress: z.ZodOptional; background: z.ZodOptional; long_running_reminder_enabled: z.ZodOptional; long_running_reminder_interval_ms: z.ZodOptional; }, z.core.$strip>>; lsp_ty: z.ZodOptional; }, z.core.$strip>>; lsp: z.ZodOptional>; binary: z.ZodOptional; args: z.ZodDefault>>; root_markers: z.ZodDefault>>; disabled: z.ZodDefault>; env: z.ZodOptional>; initialization_options: z.ZodOptional; }, z.core.$strip>>>; disabled: z.ZodOptional>; python: z.ZodOptional>; diagnostics_on_edit: z.ZodOptional; auto_install: z.ZodOptional; grace_days: z.ZodOptional; versions: z.ZodOptional>; }, z.core.$strip>>; url_fetch_allow_private: z.ZodOptional; semantic: z.ZodOptional>; model: z.ZodOptional; base_url: z.ZodOptional; api_key_env: z.ZodOptional; timeout_ms: z.ZodOptional; query_timeout_ms: z.ZodOptional; max_batch_size: z.ZodOptional; max_files: z.ZodOptional; }, z.core.$strip>>; auto_update: z.ZodOptional; bridge: z.ZodOptional; hang_threshold: z.ZodOptional; }, z.core.$strip>>; subc: z.ZodOptional; client_reaper: z.ZodOptional; }, z.core.$strip>>; gh_shim: z.ZodOptional; binary_path: z.ZodOptional; }, z.core.$strip>>; git: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strict>>; export type AftConfig = z.infer; /** Resolve the blocking diagnostics deadline for tools that wait on `aft_inspect`. */ export declare function resolveInspectDiagnosticsTimeoutMs(config: AftConfig): number; export interface ConfigureLspServer { id: string; /** Omitted when overriding a built-in server to inherit its extensions. */ extensions?: string[]; /** Omitted when overriding a built-in server to inherit its binary. */ binary?: string; args: string[]; root_markers: string[]; disabled: boolean; env?: Record; initialization_options?: unknown; } export interface ConfigureLspOverrides { experimental_lsp_ty?: boolean; lsp_servers?: ConfigureLspServer[]; disabled_lsp?: string[]; } export interface ConfigureExperimentalOverrides { experimental_bash_rewrite?: boolean; experimental_bash_compress?: boolean; experimental_bash_background?: boolean; bash_long_running_reminder_enabled?: boolean; bash_long_running_reminder_interval_ms?: number; experimental_lsp_ty?: boolean; } export declare function resolveLspConfigForConfigure(config: AftConfig): ConfigureLspOverrides; /** * Build the per-project subset of configure overrides that come from * `aft.jsonc` (user config merged with project config). Used by the OpenCode * plugin's per-bridge `projectConfigLoader` so each project's `aft.jsonc` wins * over the user-level config for that project's bridge, instead of every * bridge inheriting whatever project was visible at plugin init. * * **DO NOT** put genuinely-global fields here. Things like `storage_dir`, * `_ort_dylib_dir`, `harness`, `lsp_paths_extra`, `bash_permissions` are set * at plugin init from process state (XDG dirs, ONNX download path, etc.) and * MUST NOT be re-derived per-bridge — they're identical across all bridges in * one OpenCode/Pi process. * * **DO NOT** put fields that affect plugin-side tool registration here. * `enabled`, `tool_surface`, `disabled_tools`, and `hoist_builtin_tools` lock * at plugin init because OpenCode registers tools synchronously when the plugin * function returns. Per-bridge changes to those fields wouldn't take effect. */ export declare function resolveProjectOverridesForConfigure(config: AftConfig): Record; /** * Resolved bash configuration after merging top-level `bash`, the * legacy `experimental.bash.*` fallback, and tool_surface defaults. * Everything downstream — hoist gating, configure-override emission, * workflow-hints — reads from this single shape. * * `enabled` controls hoist registration ONLY; the three sub-features * (rewrite/compress/background) are independent feature flags within * an enabled bash surface. `enabled: false` forces all three off and * disables hoist; OpenCode's native bash stays in place. */ export interface ResolvedBashConfig { enabled: boolean; rewrite: boolean; compress: boolean; background: boolean; /** Emergency local execution gate. Default false, including for `bash: true`. */ host_fallback: boolean; /** See BashFeaturesSchema.subagent_background. Default false. */ subagent_background: boolean; long_running_reminder_enabled?: boolean; long_running_reminder_interval_ms?: number; /** * Foreground poll window before auto-promotion to background, in ms. * Always resolved: defaults to 15000, floored at 5000. */ foreground_wait_window_ms: number; } /** Default foreground wait-window before auto-promotion (ms). */ export declare const FOREGROUND_WAIT_WINDOW_DEFAULT_MS = 15000; /** Minimum allowed foreground wait-window (ms); smaller values clamp up. */ export declare const FOREGROUND_WAIT_WINDOW_MIN_MS = 5000; /** * Single source of truth for bash config across the plugin. Resolution * order (highest priority wins): * * 1. Top-level `bash: false` → fully disabled (sub-features all false) * 2. Top-level `bash: true` → fully enabled (sub-features all true) * 3. Top-level `bash: { ... }` → enabled; each sub-feature defaults true * when not specified * 4. Top-level `bash` absent + any `experimental.bash.*` set → legacy * fallback; sub-features take their explicit values (default false * to preserve pre-v0.27.2 behavior — that block was opt-in) * 5. Top-level `bash` absent + no experimental → tool_surface default: * - "minimal" → disabled * - "recommended" or "all" → enabled with all sub-features on * * The long_running_reminder_* tuning fields are passed through from * whichever surface specified them; they live alongside the feature * flags because they're emitted to Rust through the same configure * call shape. */ export declare function resolveBashConfig(config: AftConfig): ResolvedBashConfig; export declare function resolveExperimentalConfigForConfigure(config: AftConfig): ConfigureExperimentalOverrides; type Logger = { log: (message: string) => void; warn: (message: string) => void; }; export declare function migrateAftConfigFile(configPath: string, logger?: Logger): { migrated: boolean; oldKeys: string[]; }; export type ConfigLoadError = { path: string; message: string; }; /** Errors from the most recent {@link loadAftConfig} call (parse failures only). */ export declare function getConfigLoadErrors(): readonly ConfigLoadError[]; export declare function formatConfigParseFailureMessage(configPath: string, errorMessage: string): string; /** Defaults for bridge transport when omitted from config. */ export declare const DEFAULT_BRIDGE_REQUEST_TIMEOUT_MS = 30000; export declare const DEFAULT_BRIDGE_HANG_THRESHOLD = 2; /** Default the client-side root reaper to disabled when no user configuration is provided; production deployments may enable it through their own configuration. */ export declare const DEFAULT_SUBC_CLIENT_REAPER = false; export declare function resolveSubcClientReaper(config: AftConfig): boolean; /** Resolved pool/bridge options from `config.bridge` (defaults 30000 / 2). */ export declare function resolveBridgePoolTransportOptions(config: AftConfig): { timeoutMs: number; hangThreshold: number; }; export interface ResolvedAftConfigPaths { userConfigPath: string; projectConfigPath: string; } export declare function migrateAftConfigLocations(projectDirectory: string, logger?: Logger): AftConfigFileMigrationResult[]; export declare function resolveAftConfigPaths(projectDirectory: string): ResolvedAftConfigPaths; /** Resolve the checkout whose project config controls OpenCode's registered tool schema. */ export declare function resolveOpenCodeRegistrationRoot(directory: string, worktree?: string): string; export declare function buildConfigTierConfigureParams(projectDirectory: string, processState?: Record): Record & { config: ConfigTier[]; cortexkit_user_config_path: string; subc_client_reaper?: boolean; }; export declare function loadAftConfig(projectDirectory: string): AftConfig; export {}; //# sourceMappingURL=config.d.ts.map