import { PANERELAY_PROTOCOL_VERSION } from './constants.js'; export type ControlSessionState = 'allocated' | 'connected' | 'active' | 'released' | 'expired' | 'failed'; export type ControlHeartbeatFreshness = 'unknown' | 'fresh' | 'stale'; export interface ControlSessionActor { kind: 'automation'; name: string; sessionLabel?: string; } export interface ControlSessionSummary { id: string; actor: ControlSessionActor; state: ControlSessionState; participantCount: number; observedTargetCount: number; controlledTargetCount: number; heartbeatFreshness: ControlHeartbeatFreshness; lastHeartbeatAt?: string; leaseExpiresAt?: string; updatedAt: string; } export type AutomationActivityCategory = 'target' | 'navigation' | 'interaction' | 'page-content' | 'browser-state' | 'network' | 'emulation' | 'artifact' | 'other'; export type AutomationActivityLabel = 'manage-target' | 'navigate-page' | 'interact-with-page' | 'read-page' | 'manage-browser-state' | 'inspect-network' | 'emulate-page' | 'create-artifact' | 'run-browser-operation'; export type AutomationActivityStatus = 'started' | 'completed' | 'failed' | 'denied'; export type AutomationActivityFailure = 'policy-denied' | 'browser-error' | 'session-ended' | 'transport-error'; export interface AutomationActivityClassification { category: AutomationActivityCategory; label: AutomationActivityLabel; } export type CdpTargetAccess = 'observe' | 'control'; export interface AutomationActivity { id: string; sessionId: string; actor: ControlSessionActor; targetId?: string; category: AutomationActivityCategory; label: AutomationActivityLabel; status: AutomationActivityStatus; failure?: AutomationActivityFailure; sequence: number; startedAt: string; updatedAt: string; } export interface ControlSessionChangedMessage { type: 'control.session.changed'; protocol: typeof PANERELAY_PROTOCOL_VERSION; epoch: string; sequence: number; session: ControlSessionSummary; } export interface AutomationActivitySnapshotMessage { type: 'control.activity.snapshot'; protocol: typeof PANERELAY_PROTOCOL_VERSION; epoch: string; sequence: number; firstRetainedSequence?: number; activities: AutomationActivity[]; } export interface AutomationActivityUpdatedMessage { type: 'control.activity.updated'; protocol: typeof PANERELAY_PROTOCOL_VERSION; epoch: string; sequence: number; activity: AutomationActivity; } export declare function classifyCdpTargetAccess(method: string): CdpTargetAccess; export declare function classifyCdpMethod(method: string): AutomationActivityClassification; export declare function isControlSessionSummary(value: unknown): value is ControlSessionSummary; export declare function isAutomationActivity(value: unknown): value is AutomationActivity; export declare function isControlSessionChangedMessage(value: unknown): value is ControlSessionChangedMessage; export declare function isAutomationActivitySnapshotMessage(value: unknown): value is AutomationActivitySnapshotMessage; export declare function isAutomationActivityUpdatedMessage(value: unknown): value is AutomationActivityUpdatedMessage; //# sourceMappingURL=control-activity.d.ts.map