/** * Push access for checkpoint-written ontology entity files. * * `ontology/` is cloud-authoritative (see ./cloud-authoritative.ts): the push * leg refuses it and the pull leg overwrites it. `hq core checkpoint` in * hq-cli now writes entity files under `ontology/entities//.md` * in place of the retired cloud gardener, and those files have to reach the * vault. This module decides, per company, whether they may be pushed. * * The decision is the hq-flags flag `checkpoint.ontology`, the same flag that * turns the checkpoint ontology step on, evaluated for the vault's company. * `HQ_FLAG_CHECKPOINT_ONTOLOGY` is the local override. Any failure (no * endpoint, no token, network error, missing flag row) resolves to false, so * the path stays refused exactly as before. * * Only entity files are opened. `.last-run`, `merge-proposals.json`, facts, * and everything else under `ontology/` stay server-owned. * * Conflict rule (enforced in share.ts): the cloud copy wins. A pushed entity * is written only with an S3 precondition (`If-Match` on the etag this * machine last synced, or `If-None-Match: *` for a new key). If the remote * moved, or the key was deleted server-side, the local body is set aside and * the cloud body adopted. The pull leg keeps treating the path as * cloud-authoritative. The next checkpoint re-applies its changes on top of * the cloud version. */ import { type FlagClient, type FlagClientOptions } from "@indigoai-us/hq-flags-client"; /** Flag that gates both the checkpoint ontology step and this push path. */ export declare const ONTOLOGY_ENTITY_PUSH_FLAG = "checkpoint.ontology"; /** * Flag that gates the several-writers rules (see ./ontology-outbox.ts): an * entity is pushed only when this machine's checkpoint wrote those bytes, and * a stale create over an absent remote is set aside. Read only when * `checkpoint.ontology` is on. */ export declare const ONTOLOGY_MULTI_WRITER_FLAG = "checkpoint.ontology.multi-writer"; export { isOntologyEntityKey } from "./ontology-entity-meta.js"; export interface OntologyEntityPushInput { /** Company vault uid (`cmp_*`). Personal vaults never push entities. */ companyUid: string; companySlug?: string; /** hq-pro base URL; `HQ_FLAGS_API_URL` wins when set. */ endpoint?: string; getToken?: () => string | Promise; env?: Readonly>; createClient?: (options: FlagClientOptions) => Pick; now?: () => number; /** Told about each failed read. Defaults to one line on stderr. */ onError?: (error: unknown) => void; /** Flag to read. Defaults to `checkpoint.ontology`. */ flag?: string; } /** Resolve `checkpoint.ontology` (or `input.flag`) for one company vault. Never throws. */ export declare function resolveOntologyEntityPush(input: OntologyEntityPushInput): Promise; export declare function _resetOntologyEntityPushCacheForTests(): void; //# sourceMappingURL=ontology-entity-push.d.ts.map