/** * Which config.yaml a page was looking at when it loaded, so a save that would * overwrite somebody else's edit can be refused instead of landing. * * The Settings page PUTs a whole config document it read at load time, and the * gateway merges that document over whatever is on disk now. Between those two * moments an operator can hand-edit the file, and a key they added is a key the * page never had — the merge keeps it, but a key they *changed* loses to the * page's stale copy, silently. The revision closes that window: it is taken from * the file, not from the in-memory config, because the file is what the merge * reads and therefore what a conflict is actually about. */ export declare const CONFIG_REVISION_HEADER = "X-Jinn-Config-Revision"; /** * A revision for config.yaml as it is on disk right now. Hashing the bytes rather * than reading an mtime keeps it honest across a rename-based atomic write, whose * mtime moves for a write that changed nothing. * * A file that is not there yet has the empty revision, which is a real value and * not an error: `jinn setup` has not run, and the first PUT is allowed to create * the file. It stops being empty the moment the file exists. */ export declare function currentConfigRevision(configPath?: string): string; /** * Whether a PUT is writing over a config it has not seen. * * A request with no header is not stale — it opted out, and that is deliberate: * partial PUTs that touch one key (the Talk voice-setup card) never read the * document they are merging into, so there is no revision they could send and * nothing they could clobber by not sending one. */ export declare function isStaleConfigRevision(headers: Record, current: string): boolean; /** What the operator is told when their save would have overwritten a hand edit. */ export declare const CONFIG_CONFLICT_BODY: { readonly error: "config.yaml changed on disk after this page loaded it — saving now would overwrite that change"; readonly code: "CONFIG_CONFLICT"; readonly remedy: "Reload the config to pick up the change on disk, then reapply your edit and save again."; }; //# sourceMappingURL=config-revision.d.ts.map