import { controlRequest } from '../session/control.js'; import type { ConversationEventV1, ConversationSnapshot, PromptReceipt } from '../session/conversation-types.js'; import type { SessionSnapshot } from '../session/types.js'; import type { OutputPage, SendReceipt, SessionDescriptor } from './types.js'; export interface ConversationPageView { events: ConversationEventV1[]; firstAvailableCursor?: string; nextCursor?: string; hasMore: boolean; snapshot: ConversationSnapshot; } export interface ConversationFollowHandle { close(): void; } /** * An interrupt that reached the session. `state` says whether the turn stopped * cooperatively or through bounded forced recovery — both are accepted, so no * consumer may render `forced` as a failed interrupt. */ export interface InterruptReceipt { accepted: true; state: 'settled' | 'forced'; reasonCode?: string; } export interface RoleSessionControl { describe(): Promise; snapshot(): Promise; recentOutput(request?: { since?: number; limit?: number; }): Promise; sendText(text: string): Promise; interrupt?(): Promise; respondPermission?(request: { permissionId: string; optionId: string; }): Promise<{ accepted: true; }>; conversationPage?(request: { after?: string; limit?: number; }): Promise; submitPromptV2?(request: { commandId: string; text: string; actorBrowserSession: string; source: 'owner_admin_console'; }): Promise; interruptV2?(commandId: string): Promise; respondPermissionV2?(request: { commandId: string; permissionId: string; optionId: string; sessionGeneration: string; }): Promise<{ accepted: true; commandId: string; }>; /** * Open a live follow on the role's ledger. `onPage` receives the initial * replay page; `onEvent` every subsequent durable event; `onClose` fires * exactly once when the underlying control stream ends. */ followConversation?(request: { after?: string; onPage(page: ConversationPageView): void; onEvent(event: ConversationEventV1): void; onClose(reason?: string): void; }): Promise; } export declare class RoleSessionControlAdapter implements RoleSessionControl { private readonly stateDir; private readonly request; constructor(stateDir: string, request?: typeof controlRequest); describe(): Promise; snapshot(): Promise; recentOutput(request?: { since?: number; limit?: number; }): Promise; sendText(text: string): Promise; interrupt(): Promise; conversationPage(request?: { after?: string; limit?: number; }): Promise; submitPromptV2(request: { commandId: string; text: string; actorBrowserSession: string; source: 'owner_admin_console'; }): Promise; interruptV2(commandId: string): Promise; respondPermissionV2(request: { commandId: string; permissionId: string; optionId: string; sessionGeneration: string; }): Promise<{ accepted: true; commandId: string; }>; followConversation(request: { after?: string; onPage(page: ConversationPageView): void; onEvent(event: ConversationEventV1): void; onClose(reason?: string): void; }): Promise; respondPermission(request: { permissionId: string; optionId: string; }): Promise<{ accepted: true; }>; private call; } /** @deprecated Compatibility name; control is provider-neutral. */ export { RoleSessionControlAdapter as AcpRoleSessionAdapter };