import type { CrowdyAgentLeaseV1, CrowdyAgentPreemptionReason } from '../crowdy-agent/types.js'; import type { GameCommandResultV1, GameCommandV1, GameObservationV1, ObserveRequestV1, PlayerHostAdapterV1, PlayerHostCapabilitiesV1 } from './types.js'; export interface AgentControlDispatchV1 { readonly toolCallId: string; readonly clientEpoch: string; readonly leaseId?: string; readonly approvalGrant?: string; readonly command: GameCommandV1; } export interface AgentObservationDispatchV1 { readonly clientEpoch: string; readonly leaseId?: string; } export interface AgentControlLeaseSnapshotV1 { readonly connected: boolean; readonly clientEpoch: string | null; readonly lease: CrowdyAgentLeaseV1 | null; readonly capabilities: PlayerHostCapabilitiesV1 | null; readonly lastPreemption?: CrowdyAgentPreemptionReason; } export interface AgentControlLeaseManagerOptionsV1 { readonly now?: () => number; readonly contextVersion?: () => string; readonly maxLeaseSeconds?: number; readonly maxRememberedCalls?: number; readonly onChange?: (snapshot: AgentControlLeaseSnapshotV1) => void; } /** * Browser-local Play authority gate. Human takeover calls `preempt` and clears * intent synchronously before any server acknowledgement or async cleanup. */ export declare class AgentControlLeaseManager { private readonly adapter; private readonly options; private clientEpoch; private connected; private lease; private capabilitiesValue; private readonly observations; private readonly calls; private readonly rateWindows; private expiryTimer; private lastPreemption?; private readonly now; constructor(adapter: PlayerHostAdapterV1, options?: AgentControlLeaseManagerOptionsV1); snapshot(): AgentControlLeaseSnapshotV1; attach(clientEpoch: string): void; disconnect(): void; refreshCapabilities(): Promise; grantLease(lease: CrowdyAgentLeaseV1): void; revoke(reason?: CrowdyAgentPreemptionReason): void; /** Human input, Escape, Stop, death, and context changes call this directly. */ preempt(reason: CrowdyAgentPreemptionReason): void; observe(request: ObserveRequestV1, dispatch?: AgentObservationDispatchV1): Promise; private validateObservationLease; dispatch(input: AgentControlDispatchV1): Promise; clearClosedSession(): void; private execute; private validateDispatch; private validateObservationContext; private consumeRate; private requireCapabilities; private clearExpiryTimer; private emit; } //# sourceMappingURL=lease-manager.d.ts.map