import type { ClaimDb } from "./pool-db.js";
export interface ClaimDeps {
    claimDb: ClaimDb;
    /** Resolve + decrypt the Anthropic key attached to the caller's redeemed invite code; null if none. */
    getKeyForDid: (did: string) => Promise<string | null>;
    /** System action: SET_OWNER on the (owner-null) claimed document. */
    setOwner: (documentId: string, address: string) => Promise<void>;
    /**
     * Inject several secrets into the tenant secret store atomically — one write,
     * one notify, one pod bounce. Carries the Anthropic key(s) AND `ADMINS` so the
     * claimant becomes the embedded switchboard's admin without a gitops
     * re-render (which was the slow ~30s second restart).
     */
    setSecrets: (tenantId: string, entries: Array<{
        key: string;
        value: string;
    }>) => Promise<void>;
    /** Fully delete an env (deleteDocument) — used to clean up a half-claimed env
     *  on failure so it doesn't leak a pod/namespace/cert as a TERMINATING husk. */
    deleteEnv: (documentId: string) => Promise<void>;
    cfg: {
        version: string;
    };
    nowIso: () => string;
    /** Optional async sleep (injectable for tests); defaults to setTimeout. */
    sleep?: (ms: number) => Promise<void>;
    logger: {
        info(m: string): void;
        warn(m: string): void;
        error(m: string): void;
    };
}
export interface ClaimResult {
    documentId: string;
    subdomain: string;
    tenantId: string;
}
/**
 * Atomically claim one warm env for the caller `did` (a `did:pkh:...`), transfer
 * ownership (system SET_OWNER on the owner-null env), and inject the caller's
 * attached key. The key lookup is keyed by the full DID (matching how the
 * redemption was recorded); `claimedBy`/owner use the bare address. Returns null
 * when the caller has no key or the pool is empty (frontend then cold-falls-back).
 *
 * Self-healing: transient secret writes are retried; on ANY post-assign failure
 * the half-claimed env is TERMINATED (not left as an owned, key-less orphan) and
 * the keeper provisions a replacement, so a failed claim leaks nothing.
 */
export declare function claimWarmEnvironment(d: ClaimDeps, did: string): Promise<ClaimResult | null>;
//# sourceMappingURL=claim.d.ts.map