import type { Kysely } from 'kysely';
import { type ClusterName } from '@kici-dev/engine/protocol/cluster-name';
import type { Database } from '../db/types.js';
/**
 * Source attribution for the resolved cluster name. Useful for operator
 * tooling (`kici-admin cluster-name get`) to explain where the current
 * value came from.
 */
export type ClusterNameSource = 'stored' | 'env-seeded' | 'auto-generated';
export interface ResolveResult {
    clusterName: ClusterName;
    source: ClusterNameSource;
}
/**
 * Read the cluster name from `cluster_meta`. Returns null if no row
 * exists yet (orch has never resolved its name).
 */
export declare function readClusterName(db: Kysely<Database>): Promise<ClusterName | null>;
/**
 * Look up the cluster name. Throws if no row exists — callers that hit
 * this before the boot resolver has run should be considered bugs.
 */
export declare function getClusterName(db: Kysely<Database>): Promise<ClusterName>;
/**
 * Persist a validated cluster name. Upsert semantics: replaces the
 * existing row if one exists. Called by both the boot resolver and the
 * kici-admin CLI's `cluster-name set`.
 */
export declare function setClusterName(db: Kysely<Database>, name: string): Promise<ClusterName>;
/**
 * Boot-time resolution: returns the existing row, seeds from env, or
 * auto-generates. Idempotent: a re-run after first boot just returns
 * the stored value.
 *
 * `randomSource` is dependency-injected so tests can drive deterministic
 * suffixes; production callers pass `node:crypto.randomBytes`.
 */
export declare function resolveAndPersistClusterName(db: Kysely<Database>, env?: NodeJS.ProcessEnv, randomSource?: (size: number) => Uint8Array): Promise<ResolveResult>;
//# sourceMappingURL=cluster-name.d.ts.map