import type { ControlPlaneRecentEvent, RegisterSharedSessionInput, SharedApprovalRecord, SharedSessionInputRecord, SharedSessionMessage, SharedSessionRecord, SharedSessionRegisterResult, SharedSessionSubmission, SteerSharedSessionMessageInput, SubmitSharedSessionMessageInput } from '../control-plane/index.js'; import type { RequestSharedApprovalInput } from '../control-plane/index.js'; import type { PermissionPromptDecision } from '../permissions/prompt.js'; import { type AuthInspectionSnapshot } from './auth/inspection.js'; import { type ProviderAccountSnapshot } from './provider-accounts/registry.js'; import type { ProviderRuntimeSnapshot, ProviderUsageSnapshot } from '../providers/runtime-snapshot.js'; import type { OperatorClientServices } from './foundation-services.js'; import type { RuntimeTask } from './store/domains/tasks.js'; import type { UiControlPlaneSnapshot, UiSessionSnapshot, UiTasksSnapshot } from './ui-read-models.js'; import type { UiRuntimeEvents } from './ui-events.js'; import type { ShellPathService } from './shell-paths.js'; export interface OperatorControlPlaneSnapshot extends UiControlPlaneSnapshot { } export interface OperatorProvidersSnapshot { readonly providerIds: readonly string[]; readonly runtimeSnapshots: readonly ProviderRuntimeSnapshot[]; readonly accountSnapshot: ProviderAccountSnapshot; readonly authInspection: AuthInspectionSnapshot; } export interface OperatorSessionsClient { current(): UiSessionSnapshot; list(limit?: number): readonly SharedSessionRecord[]; get(sessionId: string): SharedSessionRecord | null; messages(sessionId: string, limit?: number): readonly SharedSessionMessage[]; inputs(sessionId: string, limit?: number, options?: { readonly state?: string | undefined; readonly since?: number | undefined; }): readonly SharedSessionInputRecord[]; ensureSession(input?: OperatorSessionEnsureInput): Promise; register(input: RegisterSharedSessionInput): Promise; close(sessionId: string): Promise; reopen(sessionId: string): Promise; /** Detach a surface's participant/route from a session without closing it * (detach != close != kill). Idempotent; see sessions.detach. */ detach(sessionId: string, surfaceId: string): Promise; /** Permanently remove a session (delete != close). Requires the * session already closed, see sessions.delete. */ delete(sessionId: string): Promise<'deleted' | 'not-found' | 'active'>; bindAgent(sessionId: string, agentId: string): Promise; submitMessage(input: SubmitSharedSessionMessageInput): Promise; steerMessage(input: SteerSharedSessionMessageInput): Promise; followUpMessage(input: SubmitSharedSessionMessageInput): Promise; cancelInput(sessionId: string, inputId: string): Promise; /** A live surface marks a collected input delivered (`consumed:false`) or * consumed/completed (`consumed:true`), optionally naming the agent that is * answering it (`agentId`, which binds the reply) and that agent's finished * output (`answer`/`status`, reported with `consumed:true`). * See sessions.inputs.deliver. */ deliverInput(sessionId: string, inputId: string, options?: SurfaceInputDeliveryOptions): Promise; } /** * What a live surface reports when it hands a collected input back. * * `agentId` names the agent answering THIS input, the pairing only the * surface running the loop knows, and the thing that binds a channel reply. * `answer`/`status` carry that agent's finished output once the surface's turn * ends, so the daemon can write it into the session and deliver it. */ export interface SurfaceInputDeliveryOptions { readonly consumed?: boolean | undefined; readonly agentId?: string | undefined; readonly answer?: string | undefined; readonly status?: 'completed' | 'failed' | 'cancelled' | undefined; } export interface OperatorTasksClient { snapshot(): UiTasksSnapshot; list(limit?: number): readonly RuntimeTask[]; get(taskId: string): RuntimeTask | null; running(): readonly RuntimeTask[]; } export interface OperatorApprovalsClient { list(limit?: number): readonly SharedApprovalRecord[]; get(approvalId: string): SharedApprovalRecord | null; request(input: RequestSharedApprovalInput): Promise; claim(approvalId: string, actor: string, actorSurface?: string, note?: string): Promise; resolve(approvalId: string, input: { readonly approved: boolean; readonly remember?: boolean | undefined; readonly actor: string; readonly actorSurface?: string | undefined; readonly note?: string | undefined; /** Optional per-hunk selection (edit-tool approvals), the broker filters * the approval's own edit list to these indices server-side. */ readonly selectedHunks?: readonly number[] | undefined; }): Promise; approve(approvalId: string, actor: string, actorSurface?: string, note?: string): Promise; deny(approvalId: string, actor: string, actorSurface?: string, note?: string): Promise; cancel(approvalId: string, actor: string, actorSurface?: string, note?: string): Promise; update(approvalId: string, input: { readonly actor: string; readonly actorSurface?: string | undefined; readonly note?: string | undefined; readonly metadata?: Record | undefined; }): Promise; } export type OperatorSessionEnsureInput = NonNullable[0]>; export interface OperatorProvidersClient { listIds(): readonly string[]; runtimeSnapshots(): Promise; runtimeSnapshot(providerId: string): Promise; usageSnapshot(providerId: string): Promise; snapshot(): Promise; accountSnapshot(): Promise; authInspection(): Promise; } export interface OperatorControlPlaneClient { snapshot(): OperatorControlPlaneSnapshot; recentEvents(limit?: number): readonly ControlPlaneRecentEvent[]; } export interface OperatorClient { readonly sessions: OperatorSessionsClient; readonly tasks: OperatorTasksClient; readonly approvals: OperatorApprovalsClient; readonly providers: OperatorProvidersClient; readonly controlPlane: OperatorControlPlaneClient; readonly events: UiRuntimeEvents; readonly shellPaths: ShellPathService; } export declare function createOperatorClient(services: OperatorClientServices): OperatorClient; //# sourceMappingURL=operator-client.d.ts.map