import { type ControlAuditSink } from './control-audit.js'; import type { TerminalDashboardActor } from './terminal-control.js'; /** Product contract: interaction always relocks after fifteen idle minutes. */ export declare const PREVIEW_INTERACTION_IDLE_MS: number; export declare const PREVIEW_DEFAULT_MODE_LABEL = "\u9884\u89C8\u6A21\u5F0F\uFF08\u9ED8\u8BA4\uFF09"; export declare const PREVIEW_INTERACTIVE_MODE_LABEL = "\u4EA4\u4E92\u6A21\u5F0F"; export declare const PREVIEW_OVERLAY_SECURITY_NOTICE = "\u4EA4\u4E92\u8499\u5C42\u4EC5\u7528\u4E8E\u9632\u6B62\u8BEF\u89E6\uFF0C\u4E0D\u662F\u5E94\u7528\u7EA7\u5F3A\u53EA\u8BFB\u5B89\u5168\u8FB9\u754C\u3002"; export interface PreviewInteractionState { mode: 'preview' | 'interactive'; label: string; securityNotice: string; idleExpiresAt?: number; } export interface PreviewInteractionManagerOptions { audit: ControlAuditSink; now?: () => number; setTimer?: typeof setTimeout; clearTimer?: typeof clearTimeout; } /** * Server-owned preview interaction state. Unlock and activity are explicit; * both the scheduled timer and lazy reads enforce the exact idle deadline. * This state drives a browser overlay only—it does not claim to neutralize * scripts or network side effects inside the proxied application. */ export declare class PreviewInteractionManager { private readonly leases; private readonly audit; private readonly now; private readonly schedule; private readonly cancel; private generation; constructor(opts: PreviewInteractionManagerOptions); state(actor: TerminalDashboardActor, sessionId: string): PreviewInteractionState; unlock(actor: TerminalDashboardActor, sessionId: string): PreviewInteractionState; activity(actor: TerminalDashboardActor, sessionId: string): PreviewInteractionState; lock(actor: TerminalDashboardActor, sessionId: string): PreviewInteractionState; /** * P1-13:把某个**业务会话**上的交互授权全部收回,不论持有者是谁。 * * 交互解锁是「我确认要操作**这个**预览目标」的授权,绑定的是当时那一代 worker 起 * 的那个 Web 服务。worker 换代、切 CLI、会话 close→resume、端口易主之后,目标已经 * 是另一个进程,旧租约不能顺延:否则 resume 出来的新一代 CLI(或抢到同一端口的别的 * 进程)一上来就落在「交互模式」里,用户从未对它点过解锁。收回后回到默认预览模式, * 需要重新显式解锁。 */ relockSession(sessionId: string): number; relockAuthSession(authSessionId: string): number; expireDue(): number; private liveLease; private arm; private expire; private remove; private previewState; private interactiveState; } //# sourceMappingURL=preview-interaction.d.ts.map