/** * Bind a live session to a durable agent persona. * * The operation is serialized because "is this name live?" and "claim it" * must be one critical section. Authoritative state is written twice on * purpose: `.name-history` supplies display metadata, while the canonical * `coord.identity_attested` event makes replay and derived readers converge. * * Local collision policy: a fresh heartbeat alone is not enough to block. * If the namesake has no live pid-map process (crashed session, healed * zombie, or abandoned adapter), reclaim that heartbeat and continue. * Refuse only when another process is still alive, or when cached remote * presence reports the name. */ export type IdentityAssumeErrorCode = "identity_busy" | "identity_in_use" | "identity_is_ancestor" | "identity_not_found" | "invalid_identity" | "no_live_generation" | "not_session" | "projection_failed"; export declare class IdentityAssumeError extends Error { readonly code: IdentityAssumeErrorCode; constructor(code: IdentityAssumeErrorCode, message: string); } export interface IdentityConflict { instance_id: string; name: string; scope: "local" | "remote"; machine?: string; } export interface IdentityAssumeResult { changed: boolean; instance_id: string; session_id: string; previous_name: string | null; previous_agent_id: string | null; name: string; agent_id: string; identity_created: boolean; event_id: string | null; /** Prior local holder swept because it had no live process. */ reclaimed_instance_id: string | null; } /** Best-effort collision read across local heartbeats and cached remote * presence. No network call occurs; absent presence degrades to local-only. */ export declare function findIdentityConflict(coordRoot: string, instanceId: string, name: string, nowMs?: number, excludedInstanceIds?: ReadonlySet): IdentityConflict | null; /** * Drop a local namesake whose adapter process is gone. Fresh heartbeats can * linger after a crash (or after heartbeat heal without a live pid-map), and * `identity assume` is the supported takeover path — operators should not * need a separate kill/sweep step. */ export declare function reclaimAbandonedLocalConflict(coordRoot: string, conflict: IdentityConflict): boolean; /** Assume `target` for one live main session. Safe to retry. */ export declare function assumeIdentity(coordRoot: string, instanceId: string, target: string, opts?: { forceAncestor?: boolean; }): IdentityAssumeResult; //# sourceMappingURL=assume.d.ts.map