import { AgentInfo, AgentResponse, AttachedFrame, CompleteAccountRequest, CompleteAccountResponse, ConnectAccountResponse, ConversationHistoryResponse, ConversationsResponse, CreateAgentRequest, CreateJobRequest, CreateProfileRequest, CreateSessionRequest, DiscardAndCutRequest, EraseConversationResponse, FindHostFilesResponse, GatewayMeta, GatewayRelayMeta, GetProfileResponse, HostEntryResponse, JobEvent, JobInfo, ListHostDirResponse, ListHostRootsResponse, ListProfilesResponse, McpServerActionRequest, McpServerStatusInfo, MessageAttachment, NewConversationRequest, NewConversationResponse, PeerSessionSummary, PermissionMode, ProfileInfo, QueueStats, ReadHostFileResponse, RenameOwnerRequest, RenameOwnerResponse, ResolvePermissionRequest, RetireAgentRequest, RetiredAgentInfo, SdkSessionSummary, SessionAgentRequest, SessionEvent, SessionFileInfo, SessionInfo, SessionSettingsPatch, ShellInfo, SubmitExecutionResultRequest, SubmitExecutionResultResponse, ToolCallRequestFrame, ToolExecutionOutput, ToolResultBlock, UnconfirmedInputRefusal, UpdateAgentRequest, UpdateProfileRequest, UpdateSessionRequest, UpdateSessionResponse, WriteHostFileRequest, WriteHostFileResponse } from "@workerdeck/protocol"; //#region src/lib/emitter.d.ts type Listener = (payload: T) => void; //#endregion //#region src/session-handle.d.ts type AttachOptions = { afterSeq?: number; reconnect?: boolean; truncateResults?: boolean; imageRefs?: boolean; conversation?: number; }; type SessionHandleEvents = { attached: AttachedFrame; event: SessionEvent; protocolError: string; connectionChange: boolean; reconnectAttempt: number; toolCallRequest: ToolCallRequestFrame; toolCallCanceled: { executionId: string; reason: string; }; shellAttached: { shellId: string; shell: ShellInfo; cols: number; rows: number; scrollback: string; }; shellOutput: { shellId: string; data: string; }; shellDetached: { shellId: string; reason: string; }; undeliveredPrompt: { clientId: string; text: string; attachmentIds?: string[]; uncertain?: true; }; }; declare class SessionHandle { #private; readonly sessionId: string; constructor(client: WorkerDeckClient, sessionId: string, options?: AttachOptions); get lastSeq(): number; get everConnected(): boolean; on(kind: K, listener: Listener): () => void; send(text: string, attachmentIds?: string[]): void; approve(requestId: string, updatedInput?: Record): void; deny(requestId: string, message?: string, interrupt?: boolean): void; interrupt(): void; sleep(): void; backgroundTask(toolUseId?: string): void; runShell(command: string): void; attachShell(shellId: string, size: { cols: number; rows: number; }): void; writeShell(shellId: string, data: string): void; resizeShell(shellId: string, size: { cols: number; rows: number; }): void; detachShell(shellId: string): void; clearContext(): void; setPermissionMode(mode: PermissionMode): void; setModel(model?: string): void; setEffort(effort?: string): void; sendToolCallResult(executionId: string, output: ToolExecutionOutput, logs?: string[]): void; sendToolCallError(executionId: string, reason: string, error: string, logs?: string[]): void; closeSession(): void; reconnectNow(): void; detach(): void; get conversation(): number | undefined; } //#endregion //#region src/queue-handle.d.ts type QueueHandleEvents = { attached: QueueStats; event: JobEvent; stats: QueueStats; connectionChange: boolean; }; declare class QueueHandle { #private; constructor(client: WorkerDeckClient, options?: { reconnect?: boolean; }); on(kind: K, listener: Listener): () => void; detach(): void; } //#endregion //#region src/host-url.d.ts type HostUrl = { baseUrl: string; }; declare function apiUrl(host: HostUrl): string | undefined; declare function isLoopbackHost(host: HostUrl): boolean; //#endregion //#region src/host-auth.d.ts declare function hostAuth(options: { baseUrl: string; key: string; }): Pick; //#endregion //#region src/team-move.d.ts type TeamMovePlan = { mover: { hostId: string; sessionId: string; agentId?: string; owner?: string; }; lead: { hostId: string; agentId: string; } | null; order?: number; siblings?: Array<{ hostId: string; agentId: string; order: number; }>; crossOwner?: true; }; type TeamInvitation = { hostId: string; leadAgentId: string; member: string; invite?: string; state: 'withdrawn' | 'open' | 'unknown'; }; type TeamMoveOutcome = { committed: 'yes' | 'no' | 'unknown'; error?: string; adopted?: { hostId: string; agentId: string; }; invitation?: TeamInvitation; unordered?: Array<{ hostId: string; agentId: string; }>; }; declare function runTeamMove(plan: TeamMovePlan, clientOf: (hostId: string) => WorkerDeckClient | undefined, relayOf?: (hostId: string) => GatewayRelayMeta | undefined): Promise; declare function withdrawTeamInvitation(invitation: TeamInvitation, clientOf: (hostId: string) => WorkerDeckClient | undefined): Promise; declare function teamMoveMessage(outcome: TeamMoveOutcome): string | undefined; //#endregion //#region src/index.d.ts type ToolResultResponse = { seq: number; toolUseId: string; content: ToolResultBlock['content']; isError: boolean; }; type FetchBody = NonNullable[1]>['body']>; type ClientOptions = { baseUrl: string; headers?: Record; buildWsUrl?: (sessionId: string, afterSeq: number, truncateResults?: boolean, imageRefs?: boolean, conversation?: number) => string; buildQueueWsUrl?: () => string; WebSocketImpl?: typeof WebSocket; fetchImpl?: typeof fetch; }; declare class WorkerDeckError extends Error { readonly status: number; readonly code: string | undefined; readonly body: Record | undefined; constructor(message: string, status: number, body?: Record); } declare function unconfirmedInputOf(error: unknown): UnconfirmedInputRefusal | undefined; declare class WorkerDeckClient { #private; constructor(options: ClientOptions); get identityKey(): string; createSession(request: CreateSessionRequest): Promise; listSessions(): Promise; getSession(id: string): Promise; updateSession(id: string, patch: UpdateSessionRequest): Promise; nameSession(id: string, agent: SessionAgentRequest): Promise; unnameSession(id: string): Promise; updateSessionSettings(id: string, config: SessionSettingsPatch): Promise; conversations(id: string): Promise; conversationHistory(id: string, conversation: number): Promise; eraseConversation(id: string, conversation: number): Promise; newConversation(id: string, request: NewConversationRequest): Promise; discardAndCut(id: string, request: DiscardAndCutRequest): Promise; retryConversationStart(id: string, expectedGeneration: number): Promise; settlePendingPrompt(id: string, send: boolean, expectedGeneration: number): Promise; sleepSession(id: string): Promise; deleteSession(id: string): Promise; listSessionFiles(sessionId: string): Promise; fetchSessionFile(sessionId: string, path: string): Promise; uploadAttachment(sessionId: string, file: { name: string; mediaType: string; data: FetchBody; }): Promise; attachmentUrl(sessionId: string, attachmentId: string): string; producedFileUrl(sessionId: string, fileId: string): string; readProducedFile(sessionId: string, fileId: string): Promise; projectIconUrl(sessionId: string): string; projectIcon(sessionId: string): Promise; listAgents(): Promise; retiredAgents(): Promise; createAgent(request: CreateAgentRequest): Promise; getAgent(id: string): Promise; updateAgent(id: string, patch: UpdateAgentRequest): Promise; inviteRemoteMember(id: string, agent: string, owner?: string): Promise; withdrawInvitation(id: string, agent: string, invite: string): Promise; removeRemoteMember(id: string, agent: string): Promise; retireAgent(id: string, request: RetireAgentRequest): Promise<{ retired: string[]; released: string[]; }>; changeAgentAvatar(id: string, seed?: string): Promise; agentAvatarPreviewUrl(id: string, seed: string): string; agentAvatarPreview(id: string, seed: string): Promise; agentAvatarUrl(id: string, busy?: boolean): string; agentAvatar(id: string, busy?: boolean): Promise<{ blob: Blob; durations?: number[]; }>; listPeers(sessionId: string): Promise; listMcpServers(sessionId: string): Promise; mcpServerAction(sessionId: string, serverName: string, action: McpServerActionRequest['action']): Promise; sessionFileUrl(sessionId: string, path: string): string; resolvePermission(sessionId: string, requestId: string, decision: ResolvePermissionRequest): Promise; submitExecutionResult(executionId: string, result: SubmitExecutionResultRequest): Promise; listProfiles(): Promise; getProfile(name: string): Promise; createProfile(profile: CreateProfileRequest): Promise; updateProfile(name: string, patch: UpdateProfileRequest): Promise; deleteProfile(name: string): Promise; connectAccount(profile: string): Promise; completeAccount(profile: string, request: CompleteAccountRequest): Promise; awaitAccount(profile: string, attemptId: string): Promise; disconnectAccount(profile: string): Promise; renameOwner(request: RenameOwnerRequest): Promise; listSdkSessions(params?: { dir?: string; limit?: number; offset?: number; profile?: string; }): Promise; listHostRoots(): Promise; meta(): Promise; listHostDir(path: string): Promise; findHostFiles(path: string, q?: string, limit?: number): Promise; readHostFile(path: string): Promise; writeHostFile(request: WriteHostFileRequest): Promise; makeHostDir(path: string): Promise; deleteHostEntry(path: string, recursive?: boolean): Promise; renameHostEntry(from: string, to: string): Promise; createJob(request: CreateJobRequest): Promise; listJobs(): Promise; getJob(id: string): Promise; cancelJob(id: string): Promise; queueStats(): Promise; listShells(sessionId: string): Promise; getShell(sessionId: string, shellId: string): Promise; shellOutput(sessionId: string, shellId: string, options?: { view?: 'text' | 'raw' | 'screen'; tail?: number; }): Promise; killShell(sessionId: string, shellId: string): Promise; stopTask(sessionId: string, toolUseId: string): Promise; backgroundTask(sessionId: string, toolUseId?: string): Promise; setShellAgentWrite(sessionId: string, shellId: string, enabled: boolean): Promise; conversationOf(sessionId: string): number | undefined; noteConversation(sessionId: string, conversation: number): void; attach(sessionId: string, options?: AttachOptions): SessionHandle; attachQueue(options?: { reconnect?: boolean; }): QueueHandle; openSocket(sessionId: string, afterSeq: number, truncateResults?: boolean, imageRefs?: boolean, conversation?: number): WebSocket; toolResult(sessionId: string, seq: number, toolUseId: string, options?: { imageRefs?: boolean; }): Promise; toolResultImage(sessionId: string, seq: number, toolUseId: string, partIndex: number): Promise; openQueueSocket(): WebSocket; } //#endregion export { type AttachOptions, ClientOptions, FetchBody, type HostUrl, QueueHandle, type QueueHandleEvents, SessionHandle, type SessionHandleEvents, type TeamInvitation, type TeamMoveOutcome, type TeamMovePlan, WorkerDeckClient, WorkerDeckError, apiUrl, hostAuth, isLoopbackHost, runTeamMove, teamMoveMessage, unconfirmedInputOf, withdrawTeamInvitation }; //# sourceMappingURL=index.d.mts.map