import { type RuntimeRecord } from "../domain/records.js"; import { type Engine, type RoleId, type TrackedRolePolicyGate } from "../domain/role-policy.js"; import { type TransitionResult } from "../runtime/record-store.js"; import { type RuntimeComposition } from "../runtime/composition.js"; declare const SESSION_REGISTRY: unique symbol; export type SessionState = "running" | "parked" | "stalled" | "stopped"; export type SessionMode = "pane" | "goal" | "exec"; export type SessionPayload = Record & { session_id: string; role_id: RoleId; engine: Engine; mode: SessionMode; transport: "claude_interactive" | "codex_goal" | "codex_exec"; run_id: string | null; ticket_id: string | null; native_session_ref: string; provider_native_session_sha256: string | null; tmux_pane_id: string | null; policy_version: 2; policy_digest: string; started_at: string; last_observed_at: string; heartbeat_deadline_at: string | null; parked_until: string | null; stop_reason: string | null; ended_at: string | null; source_event_id: string; last_event_id: string; }; export type SessionRecord = RuntimeRecord; export interface RegisterSessionInput { readonly sessionId: string; readonly roleId: string; readonly engine: Engine; readonly mode: SessionMode; readonly runId: string | null; readonly ticketId: string | null; readonly nativeSessionRef: string; readonly tmuxPaneId: string | null; readonly actorId: string; readonly sourceEventId: string; readonly observedAt: string; readonly heartbeatDeadlineAt: string; } export interface SessionMutationInput { readonly sessionId: string; readonly operationId: string; readonly actorId: string; readonly eventId: string; readonly observedAt: string; readonly expectedVersion: number; } export interface SessionRegistry { readonly [SESSION_REGISTRY]: true; register(input: RegisterSessionInput): Readonly<{ status: "created" | "replayed"; record: SessionRecord; }>; heartbeat(input: SessionMutationInput & { heartbeatDeadlineAt: string; }): TransitionResult; bindNativeSession(input: SessionMutationInput & { nativeSessionSha256: string; heartbeatDeadlineAt: string; }): TransitionResult; park(input: SessionMutationInput & { parkedUntil: string; }): TransitionResult; resume(input: SessionMutationInput & { heartbeatDeadlineAt: string; }): TransitionResult; markStalled(input: SessionMutationInput): TransitionResult; stop(input: SessionMutationInput & { reason: string; }): TransitionResult; read(sessionId: string): SessionRecord; readIfExists(sessionId: string): SessionRecord | undefined; list(): readonly SessionRecord[]; } export declare function createSessionRegistry(options: { recordsRoot: string; locksRoot: string; packageRoot: string; policyRoot: string; policyGate: TrackedRolePolicyGate; composition?: RuntimeComposition; }): SessionRegistry; export declare function assertSessionRegistry(value: unknown): asserts value is SessionRegistry; export {};