/**
 * Engine binary discovery + persisted-path management.
 *
 * Resolution chain (per T.1 audit §J + src.legacy precedent):
 *   1. `OPENSQUID_ENGINE_BIN` env var — explicit override, always wins
 *   2. `~/.opensquid/engine-config.json` `engine_bin` field — persisted choice
 *   3. Bundled npm optional dep (`opensquid-engine-<platform>-<arch>`)
 *      — returns `null` until npm stubs ship (follow-up track)
 *   4. Auto-search dev paths under `~/projects/*` and `~/work/*`
 *   5. `loop-engine` on `$PATH`
 *   6. `null` — caller surfaces a helpful error
 *
 * First successful resolution from (4) or (5) is persisted to
 * `~/.opensquid/engine-config.json` so the next session skips the search.
 * Bundled-binary hits (3) are NOT persisted because the path is
 * deterministic from the npm install layout and persisting it would
 * point at a stale `node_modules/` path after upgrades.
 *
 * The persisted file is engine-specific so it doesn't collide with the
 * existing `~/.opensquid/config.json` written by the chat-daemon stack.
 *
 * Imports `OPENSQUID_HOME` from `runtime/paths.ts` so the data root
 * honors the `OPENSQUID_HOME` env override (tests + relocatable installs).
 */
export interface EngineConfig {
    version: 1;
    /** Last-known path to the loop-engine binary. */
    engine_bin?: string;
    /** ISO timestamp the engine_bin was last resolved via search. */
    engine_bin_resolved_at?: string;
}
export declare function loadEngineConfig(): Promise<EngineConfig>;
export declare function saveEngineConfig(config: EngineConfig): Promise<void>;
/**
 * Resolve the engine binary path using the priority chain above. Writes
 * the resolved path back to config when discovered via search so the
 * next session is instant. Returns `null` if no working binary could be
 * located.
 *
 * **Re-resolution on every start** (T.7 / T.1.P): a persisted
 * `engine_bin` that no longer points at an executable file is cleared
 * from the config and the resolver falls through to bundled → dev →
 * `$PATH`. This adds ~10-100ms (one extra `fs.stat`) but means a
 * deleted / moved / freshly-rebuilt binary silently self-heals on the
 * next start instead of failing loudly with `ENOENT`. Bundled hits
 * are NOT persisted (deterministic from npm layout); dev-path + `$PATH`
 * hits ARE persisted so subsequent sessions skip the search.
 */
export declare function resolveEngineBin(): Promise<string | null>;
/**
 * Set the engine binary path explicitly and persist. Validates that the
 * path points at an executable file before writing.
 */
export declare function setEngineBin(binPath: string): Promise<{
    resolved: string;
}>;
/**
 * Forget the persisted engine binary path. Forces re-discovery on the
 * next `resolveEngineBin` call.
 */
export declare function forgetEngineBin(): Promise<void>;
//# sourceMappingURL=config.d.ts.map