import { type ConfigWriteOptions } from "./io.js"; import type { ConfigFileSnapshot, OpenClawConfig } from "./types.js"; export type ConfigMutationBase = "runtime" | "source"; export declare class ConfigMutationConflictError extends Error { readonly currentHash: string | null; constructor(message: string, params: { currentHash: string | null; }); } export type ConfigReplaceResult = { path: string; previousHash: string | null; snapshot: ConfigFileSnapshot; nextConfig: OpenClawConfig; }; export declare function replaceConfigFile(params: { nextConfig: OpenClawConfig; baseHash?: string; writeOptions?: ConfigWriteOptions; }): Promise; export declare function mutateConfigFile(params: { base?: ConfigMutationBase; baseHash?: string; writeOptions?: ConfigWriteOptions; mutate: (draft: OpenClawConfig, context: { snapshot: ConfigFileSnapshot; previousHash: string | null; }) => Promise | T | void; }): Promise;