export declare const IDENTITY_FILE = ".ekho-identity.json"; /** Why a pinned operator key is trusted on THIS box (#26). Written at the moment * the gate admitted the key, so the question "why is this key trusted here?" * has an offline answer — no relay round trip, and nothing to re-ask the relay * for (which is exactly the party we don't trust). For a chain admission the * endorsement signature is kept verbatim, so the endorsement can be re-verified * from disk against the endorser's pinned public key. */ export interface OperatorKeyAdmission { admitted_by: "tofu" | "chain"; /** Chain only: the pinned key whose endorsement admitted this one. */ endorsed_by_key_id?: string; /** Chain only: the endorsement signature this box actually verified. */ endorsement_sig?: string; admitted_at: string; } /** The agent's own Ed25519 identity (private seed) + the operator keys it pins. */ export interface EkhoIdentity { seedHex: string; pinnedOperatorKeys: Record; /** Set once, when the empty pin set trust-on-first-use adopted the relay's * operator keys (#5). Latched forever so a later emptied pin set can never * be re-seeded by whoever controls the relay at that moment. */ tofuAt?: string; /** key_id -> ISO timestamp we first saw the relay report it revoked (#14). * A tombstone ledger, not a cache: unpinning a revoked key is worthless on * its own because the config seed, TOFU and endorsement chaining all re-add * it on the next wake. Every add path consults this, so revocation sticks. */ revokedOperatorKeys?: Record; /** key_id -> the evidence that admitted it (#26). */ operatorKeyAdmissions?: Record; } /** * Thrown instead of minting. Before 4 Oct 2026 an identity file that was * present but unparseable, or absent on a box whose config already names an * enrolled agent, silently produced a NEW random seed and registered it with * the relay. Seven live "Jarvis" identity keys with no private half anywhere * were found that way, each later endorsed by the operator in good faith. A * key that exists only because a read failed is a forged identity, not a * recovery; the caller must stop and say so. */ export declare class IdentityUnavailableError extends Error { readonly reason: "unreadable" | "missing"; constructor(message: string, reason: "unreadable" | "missing"); } /** Set to "1" to let an already-enrolled agent mint a brand-new identity key. */ export declare const ALLOW_NEW_IDENTITY_ENV = "EKHO_ALLOW_NEW_IDENTITY"; export interface LoadIdentityOptions { /** * Whether an ABSENT file may be answered with a freshly minted identity. * Default true (first enrolment). Pass false for an agent whose config already * carries enrolled credentials: its identity must already exist somewhere, * so an absent file is a lost/moved file, not a new agent. */ allowCreate?: boolean; } export declare function loadOrCreateIdentity(configDir: string, opts?: LoadIdentityOptions): EkhoIdentity; /** Byte-for-byte copy of an unusable state file, for forensics. Bytes, not a * decoded string: invalid UTF-8 must survive exactly (review, Case, 4 Oct). */ export declare function preserveUnusableFile(filePath: string, raw: Buffer | undefined): string | undefined; /** * Atomic: write a sibling temp file and rename it over the real one, so no * reader (another plugin instance, a CLI run, the other runtime sharing this * dir) can ever observe a truncated identity file mid-write. */ export declare function saveIdentity(configDir: string, identity: EkhoIdentity): void; export declare function identityPublicKey(identity: EkhoIdentity): string; //# sourceMappingURL=store.d.ts.map