import { RoleCatalogError } from "./errors.js"; import { type PublishCatalogAtBootOpts } from "./publish.js"; import type { CatalogPublishFailurePolicy, CatalogPublishState } from "./types.js"; /** Default background re-attempt ladder (ms) after a failed boot attempt. */ export declare const DEFAULT_CATALOG_RETRY_DELAYS_MS: readonly number[]; /** Default steady-state re-attempt interval once the ladder is exhausted. */ export declare const DEFAULT_CATALOG_REFRESH_INTERVAL_MS: number; /** * Resolve the effective failure policy from the 0.9.0 `onPublishFailure` and * the deprecated `failFastOnVersionMismatch`. * * Fails LOUD when both are present and DISAGREE rather than picking a winner — * the two spellings mean opposite things about whether the process survives, * and silently choosing one would be exactly the class of ambiguity that put a * service into a crash-loop. Mirrors resolveDomainKey in ./compat.ts. */ export declare function resolveFailurePolicy(opts: { onPublishFailure?: CatalogPublishFailurePolicy; failFastOnVersionMismatch?: boolean; }): CatalogPublishFailurePolicy; /** * Current catalog-publish state for `domainKey`, or `undefined` if this process * never attempted a publish for it. * * WIRE THIS INTO READINESS/HEALTH. A `degraded` status means the domain's * permission keys are absent from tenant-service and its guarded routes are * 403ing — the service is up but that surface is not usable. It is the whole * point of degrading rather than crashing that this is VISIBLE. */ export declare function getCatalogPublishState(domainKey: string): Readonly | undefined; /** Every domain's publish state in this process. */ export declare function getAllCatalogPublishStates(): Readonly[]; /** Test seam — clears all recorded state so a suite can assert the machine from * a clean slate. */ export declare function resetCatalogPublishStatesForTests(): void; /** * Publish this service's permission catalog at boot. * * **Non-fatal by default** per D410(3) — a publish failure records `degraded` * state, logs at ERROR, and keeps retrying in the background while the service * serves. Pass `onPublishFailure: "throw"` for the pre-0.9.0 crash-on-boot * behaviour. * * Awaits ONE attempt so a healthy boot is fully published before the caller * proceeds. If that attempt fails (and the failure is peer-side, so a repair * could land later) a background ladder + slow refresh keeps re-attempting on * `unref`'d timers until it succeeds — no redeploy, no restart. * * @returns the state after the awaited attempt. Never rejects unless * `onPublishFailure: "throw"`. */ export declare function publishCatalogAtBoot(opts: PublishCatalogAtBootOpts): Promise>; /** Thrown by {@link publishCatalogAtBoot} ONLY when the caller explicitly opted * into `onPublishFailure: "throw"`. Carries the recorded state so a crash * handler can log the same detail the degrade path would have exposed. */ export declare class CatalogPublishBootFailed extends RoleCatalogError { readonly state: Readonly; readonly name = "CatalogPublishBootFailed"; constructor(message: string, state: Readonly); } //# sourceMappingURL=boot-publish.d.ts.map