import { type TimelineSubscription } from "./connection/index.js"; import type { z } from "zod"; import { type ClientCapability } from "@getpaseo/protocol/client-capabilities"; import type { AgentAttentionNotificationPayload } from "@getpaseo/protocol/agent-attention-notification"; import { AgentRefreshedStatusPayloadSchema, CheckoutRenameBranchResponseSchema, RenameTerminalResponseSchema, RestartRequestedStatusPayloadSchema, ShutdownRequestedStatusPayloadSchema, DaemonUpdateResponseSchema, type ActiveTurnBehavior, type ServerInfoStatusPayload } from "@getpaseo/protocol/messages"; import type { AgentStreamEventPayload, AgentSnapshotPayload, ProjectPlacementPayload, AgentPermissionResolvedMessage, CreateAgentRequestMessage, CreatePaseoWorktreeRequest, FileDownloadTokenResponse, FileUploadResponse, FileExplorerResponse, FileVersion, FileWriteResult, FetchAgentTimelineResponseMessage, AgentForkContextResponseMessage, GitSetupOptions, CheckoutStatusResponse, CheckoutCommit, ParsedDiffFile, CheckoutCommitResponse, CheckoutMergeResponse, CheckoutMergeFromBaseResponse, CheckoutPullResponse, CheckoutPushResponse, CheckoutRefreshResponse, CheckoutPrCreateResponse, CheckoutPrMergeResponse, CheckoutPrMergeMethod, CheckoutForgeSetAutoMergeResponse, CheckoutGithubSetAutoMergeResponse, CheckoutForgeGetCheckDetailsResponse, CheckoutGithubGetCheckDetailsResponse, CheckoutPrStatusResponse, PullRequestTimelineResponse, CheckoutSwitchBranchResponse, StashSaveResponse, StashPopResponse, StashListResponse, ValidateBranchResponse, BranchSuggestionsResponse, ForgeSearchResponse, ForgeSearchRequest, GitHubSearchResponse, GitHubSearchRequest, DirectorySuggestionsResponse, PaseoWorktreeListResponse, PaseoWorktreeArchiveResponse, ProjectIconSource, ProjectIconResponse, ProjectIconGetResponse, ProjectAddResponse, ProjectCreateDirectoryResponse, OpenProjectResponseMessage, WorkspaceGithubSearchRepositoriesResponse, ProjectGithubCloneProtocol, ProjectGithubCloneResponse, ArchiveWorkspaceResponseMessage, WorkspaceSetupStatusResponseMessage, ListCommandsResponse, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, ListAvailableProvidersResponse, GetProvidersSnapshotResponseMessage, RefreshProvidersSnapshotResponseMessage, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, DaemonGetStatusResponse, DaemonGetPairingOfferResponse, DaemonConfigReloadResponse, DiagnosticsResponse, AgentRewindResponseMessage, ListTerminalsResponse, CreateTerminalResponse, SubscribeTerminalResponse, SubscribeTerminalRequest, CloseItemsResponse, KillTerminalResponse, CaptureTerminalResponse, TerminalInput, SessionInboundMessage, SessionOutboundMessage, SendAgentMessageRequest, PaseoConfigRaw, PaseoConfigRevision, WorkspaceCreateRequest, WorkspaceRecoveryState, PluginListItem, PluginLogEntry, PluginSourceStatusItem, PluginSourceUpdateItem, AgentSkillSelection, AgentSkillsStatus, AgentSkillsSaveResult } from "@getpaseo/protocol/messages"; import type { AgentPermissionRequest, AgentPermissionResponse, AgentPersistenceHandle, AgentProviderNotice, AgentProvider, AgentSessionConfig } from "@getpaseo/protocol/agent-types"; import type { AgentConfigApply, MutableDaemonConfig, MutableDaemonConfigPatch } from "@getpaseo/protocol/messages"; import { type DaemonTransportFactory, type WebSocketFactory } from "./daemon-client-transport.js"; import { type TerminalStreamEvent } from "./terminal-stream-router.js"; import type { BrowserAutomationExecuteRequest, BrowserAutomationExecuteResponse } from "@getpaseo/protocol/browser-automation/rpc-schemas"; export interface Logger { debug(obj: object, msg?: string): void; info(obj: object, msg?: string): void; warn(obj: object, msg?: string): void; error(obj: object, msg?: string): void; } interface ImportAgentInputBase { cwd?: string; workspaceId?: string; labels?: Record; } export type ImportAgentInput = (ImportAgentInputBase & { providerId: string; providerHandleId: string; }) | (ImportAgentInputBase & { provider: AgentProvider; sessionId: string; }); export type { DaemonTransport, DaemonTransportFactory, WebSocketFactory, WebSocketLike, } from "./daemon-client-transport.js"; export type { TerminalStreamEvent }; export type ConnectionState = { status: "idle"; } | { status: "connecting"; attempt: number; } | { status: "connected"; } | { status: "disconnected"; reason?: string; } | { status: "disposed"; }; export type DaemonEvent = { type: "agent_update"; agentId: string; payload: Extract["payload"]; } | { type: "workspace_update"; workspaceId: string; payload: Extract["payload"]; } | { type: "project.update"; payload: Extract["payload"]; } | { type: "workspace_setup_progress"; workspaceId: string; payload: Extract["payload"]; } | { type: "agent_stream"; agentId: string; event: AgentStreamEventPayload; timestamp: string; seq?: number; epoch?: string; } | { type: "status"; payload: { status: string; } & Record; } | { type: "agent_deleted"; agentId: string; } | { type: "agent_permission_request"; agentId: string; request: AgentPermissionRequest; } | { type: "agent_permission_resolved"; agentId: string; requestId: string; resolution: AgentPermissionResponse; } | { type: "providers_snapshot_update"; payload: Extract["payload"]; } | { type: "error"; message: string; }; export type DaemonEventHandler = (event: DaemonEvent) => void; export type BrowserAutomationExecuteRequestMessage = BrowserAutomationExecuteRequest; export type BrowserAutomationExecuteResponseMessage = BrowserAutomationExecuteResponse; export interface DaemonClientConfig { /** Deliver compact bodies/hash references to a caller-owned snapshot cache. * The default keeps public SDK snapshot entries expanded. */ providerSnapshots?: "wire"; url: string; clientId: string; clientType?: "mobile" | "browser" | "cli" | "mcp" | "hub"; appVersion?: string; runtimeGeneration?: number | null; password?: string; authHeader?: string; suppressSendErrors?: boolean; transportFactory?: DaemonTransportFactory; webSocketFactory?: WebSocketFactory; logger?: Logger; connectTimeoutMs?: number; e2ee?: { enabled?: boolean; daemonPublicKeyB64?: string; }; reconnect?: { enabled?: boolean; baseDelayMs?: number; maxDelayMs?: number; }; runtimeMetricsIntervalMs?: number; runtimeMetricsWindowMs?: number; trace?: DaemonClientTrace; capabilities?: Partial>; } export interface DaemonClientTrace { isEnabled(): boolean; beginSection(name: string, args?: Record): void; endSection(): void; } export interface SendMessageOptions { messageId?: string; activeTurnBehavior?: ActiveTurnBehavior; images?: Array<{ data: string; mimeType: string; }>; attachments?: SendAgentMessageRequest["attachments"]; } export interface AgentAttentionRequiredNotification { agentId: string; reason: "finished" | "error" | "permission"; timestamp: string; shouldNotify: boolean; notification?: AgentAttentionNotificationPayload; } type AgentConfigOverrides = Partial>; export interface CreateAgentRequestOptions extends AgentConfigOverrides { config?: AgentSessionConfig; provider?: AgentProvider; cwd?: string; env?: CreateAgentRequestMessage["env"]; workspaceId?: string; callerAgentId?: string; initialPrompt?: string; idempotencyKey?: string; clientMessageId?: string; outputSchema?: Record; images?: CreateAgentRequestMessage["images"]; attachments?: CreateAgentRequestMessage["attachments"]; git?: GitSetupOptions; worktree?: CreateAgentRequestMessage["worktree"]; autoArchive?: CreateAgentRequestMessage["autoArchive"]; worktreeName?: string; requestId?: string; labels?: Record; } export interface CreatePaseoWorktreeInput extends Pick { } type CheckoutStatusPayload = CheckoutStatusResponse["payload"]; type SubscribeCheckoutDiffPayload = Extract["payload"]; type CheckoutDiffPayload = Omit; type CheckoutCommitPayload = CheckoutCommitResponse["payload"]; type CheckoutMergePayload = CheckoutMergeResponse["payload"]; type CheckoutMergeFromBasePayload = CheckoutMergeFromBaseResponse["payload"]; type CheckoutPullPayload = CheckoutPullResponse["payload"]; type CheckoutPushPayload = CheckoutPushResponse["payload"]; type CheckoutRefreshPayload = CheckoutRefreshResponse["payload"]; type CheckoutPrCreatePayload = CheckoutPrCreateResponse["payload"]; type CheckoutPrMergePayload = CheckoutPrMergeResponse["payload"]; type CheckoutForgeSetAutoMergePayload = CheckoutForgeSetAutoMergeResponse["payload"]; type CheckoutGithubSetAutoMergePayload = CheckoutGithubSetAutoMergeResponse["payload"]; type CheckoutForgeGetCheckDetailsPayload = CheckoutForgeGetCheckDetailsResponse["payload"]; type CheckoutGithubGetCheckDetailsPayload = CheckoutGithubGetCheckDetailsResponse["payload"]; type CheckoutPrStatusPayload = CheckoutPrStatusResponse["payload"]; type PullRequestTimelinePayload = PullRequestTimelineResponse["payload"]; type CheckoutSwitchBranchPayload = CheckoutSwitchBranchResponse["payload"]; export type RenameBranchResult = z.infer["payload"]; type StashSavePayload = StashSaveResponse["payload"]; type StashPopPayload = StashPopResponse["payload"]; type StashListPayload = StashListResponse["payload"]; type ValidateBranchPayload = ValidateBranchResponse["payload"]; type BranchSuggestionsPayload = BranchSuggestionsResponse["payload"]; type ForgeSearchPayload = ForgeSearchResponse["payload"]; type GitHubSearchPayload = GitHubSearchResponse["payload"]; type DirectorySuggestionsPayload = DirectorySuggestionsResponse["payload"]; type PaseoWorktreeListPayload = PaseoWorktreeListResponse["payload"]; type PaseoWorktreeArchivePayload = PaseoWorktreeArchiveResponse["payload"]; type CreatePaseoWorktreePayload = Extract["payload"]; type WorkspaceCreatePayload = Extract["payload"]; type FileExplorerPayload = FileExplorerResponse["payload"]; export type FileExplorerDirectoryPayload = NonNullable; type LegacyFileExplorerFilePayload = NonNullable; export interface FileReadResult { bytes: Uint8Array; mime: string; size: number; path: string; kind: LegacyFileExplorerFilePayload["kind"]; modifiedAt: string; revision?: string; } export interface FileUploadInput { fileName: string; mimeType: string; bytes: Uint8Array | ArrayBuffer; modifiedAt?: string; requestId?: string; chunkSize?: number; } export type FileUploadResult = FileUploadResponse["payload"]; type FileDownloadTokenPayload = FileDownloadTokenResponse["payload"]; type ListProviderFeaturesPayload = ListProviderFeaturesResponseMessage["payload"]; type ListProviderModelsPayload = ListProviderModelsResponseMessage["payload"]; type ListProviderModesPayload = ListProviderModesResponseMessage["payload"]; type ListAvailableProvidersPayload = ListAvailableProvidersResponse["payload"]; type GetProvidersSnapshotPayload = GetProvidersSnapshotResponseMessage["payload"]; type RefreshProvidersSnapshotPayload = RefreshProvidersSnapshotResponseMessage["payload"]; type ProviderDiagnosticPayload = ProviderDiagnosticResponseMessage["payload"]; type ProviderUsageListPayload = ProviderUsageListResponseMessage["payload"]; type DaemonStatusPayload = DaemonGetStatusResponse["payload"]; type DaemonPairingOfferPayload = DaemonGetPairingOfferResponse["payload"]; type DiagnosticsPayload = DiagnosticsResponse["payload"]; type ReadProjectConfigPayload = Extract["payload"]; type WriteProjectConfigPayload = Extract["payload"]; type ListCommandsPayload = ListCommandsResponse["payload"]; type ListCommandsDraftConfig = Pick; export interface WriteProjectConfigInput { repoRoot: string; config: PaseoConfigRaw; expectedRevision: PaseoConfigRevision | null; requestId?: string; } interface ListCommandsOptions { agentId: string; requestId?: string; draftConfig?: ListCommandsDraftConfig; } type LegacyListCommandsOptions = Omit; type SetVoiceModePayload = Extract["payload"]; type AgentPermissionResolvedPayload = AgentPermissionResolvedMessage["payload"]; type ListTerminalsPayload = ListTerminalsResponse["payload"]; type CreateTerminalPayload = CreateTerminalResponse["payload"]; export type RenameTerminalResult = z.infer["payload"]; type SubscribeTerminalPayload = SubscribeTerminalResponse["payload"]; type CloseItemsPayload = CloseItemsResponse["payload"]; type KillTerminalPayload = KillTerminalResponse["payload"]; type CaptureTerminalPayload = CaptureTerminalResponse["payload"]; type ScheduleCreatePayload = Extract["payload"]; type ScheduleListPayload = Extract["payload"]; type ScheduleInspectPayload = Extract["payload"]; type ScheduleLogsPayload = Extract["payload"]; type SchedulePausePayload = Extract["payload"]; type ScheduleResumePayload = Extract["payload"]; type ScheduleDeletePayload = Extract["payload"]; type ScheduleRunOncePayload = Extract["payload"]; type ScheduleUpdatePayload = Extract["payload"]; export type FetchAgentTimelinePayload = FetchAgentTimelineResponseMessage["payload"]; export type AgentForkContextPayload = AgentForkContextResponseMessage["payload"]; export type FetchAgentTimelineDirection = FetchAgentTimelinePayload["direction"]; export type FetchAgentTimelineProjection = FetchAgentTimelinePayload["projection"]; export type FetchAgentTimelineCursor = NonNullable; export interface FetchAgentOptions { agentId: string; requestId?: string; timeout?: number; } type LegacyFetchAgentOptions = Omit; export interface FetchAgentTimelineOptions { direction?: FetchAgentTimelineDirection; cursor?: FetchAgentTimelineCursor; limit?: number; projection?: FetchAgentTimelineProjection; mergeWindow?: boolean; requestId?: string; timeout?: number; } export type AgentTimelinePromptIndexPayload = Extract["payload"]; export type ProviderSubagentListPayload = Extract["payload"]; export type ProviderSubagentTimelinePayload = Extract["payload"]; export interface FetchProviderSubagentTimelineOptions { direction?: ProviderSubagentTimelinePayload["direction"]; cursor?: FetchAgentTimelineCursor; limit?: number; requestId?: string; timeout?: number; } export interface AgentForkContextOptions { boundaryCursor?: FetchAgentTimelineCursor; boundaryMessageId?: string; requestId?: string; } type AgentRefreshedStatusPayload = z.infer; type RestartRequestedStatusPayload = z.infer; type ShutdownRequestedStatusPayload = z.infer; export interface ShutdownServerOptions { requestId?: string; timeout?: number; } export interface DaemonStatusOptions { requestId?: string; timeout?: number; } export interface DaemonPairingOfferOptions { requestId?: string; timeout?: number; } type DaemonUpdateResponse = z.infer; type FetchAgentsPayload = Extract["payload"]; type FetchAgentsRequest = Extract; export type FetchAgentsOptions = Omit & { requestId?: string; timeout?: number; }; export type FetchAgentsEntry = FetchAgentsPayload["entries"][number]; export type FetchAgentsPageInfo = FetchAgentsPayload["pageInfo"]; type FetchAgentHistoryPayload = Extract["payload"]; type FetchAgentHistoryRequest = Extract; export type FetchAgentHistoryOptions = Omit & { requestId?: string; }; export type FetchAgentHistoryEntry = FetchAgentHistoryPayload["entries"][number]; export type FetchAgentHistoryPageInfo = FetchAgentHistoryPayload["pageInfo"]; type FetchRecentProviderSessionsPayload = Extract["payload"]; type FetchRecentProviderSessionsRequest = Extract; export type FetchRecentProviderSessionsOptions = Omit & { requestId?: string; }; export type FetchRecentProviderSessionEntry = FetchRecentProviderSessionsPayload["entries"][number]; type FetchWorkspacesPayload = Extract["payload"]; type FetchWorkspacesRequest = Extract; export type FetchWorkspacesOptions = Omit & { requestId?: string; }; export type FetchWorkspacesEntry = FetchWorkspacesPayload["entries"][number]; export type FetchWorkspacesPageInfo = FetchWorkspacesPayload["pageInfo"]; export type WorkspaceLabelListPayload = Extract["payload"]; export type WorkspaceLabelAssignmentPayload = Extract["payload"]; export type WorkspaceLabelUpdatePayload = Extract["payload"]; export type WorkspaceLabelDeletePayload = Extract["payload"]; export type WorkspaceLabelDeleteInspectPayload = Extract["payload"]; export type ProjectListPayload = Extract["payload"]; type ProjectListRequest = Extract; export type ProjectListOptions = Omit & { requestId?: string; }; export interface CreateScheduleOptions { prompt: string; name?: string | null; cadence: { type: "cron"; expression: string; timezone?: string; }; target: { type: "self"; agentId: string; } | { type: "agent"; agentId: string; } | { type: "new-agent"; config: { provider: AgentProvider; cwd: string; modeId?: string; model?: string; thinkingOptionId?: string; archiveOnFinish?: boolean; isolation?: "local" | "worktree"; title?: string | null; providerOptions?: AgentSessionConfig["providerOptions"]; systemPrompt?: string; mcpServers?: AgentSessionConfig["mcpServers"]; }; }; maxRuns?: number; expiresAt?: string; runOnCreate?: boolean; requestId?: string; } export interface InspectScheduleOptions { id: string; requestId?: string; } export interface UpdateScheduleNewAgentConfig { provider?: string; model?: string | null; modeId?: string | null; thinkingOptionId?: string | null; archiveOnFinish?: boolean; isolation?: "local" | "worktree"; cwd?: string; } export interface UpdateScheduleOptions { id: string; name?: string | null; prompt?: string; cadence?: { type: "cron"; expression: string; timezone?: string; }; newAgentConfig?: UpdateScheduleNewAgentConfig; maxRuns?: number | null; expiresAt?: string | null; requestId?: string; } export interface RenameBranchInput { cwd: string; branch: string; requestId?: string; } export interface RenameTerminalInput { terminalId: string; title: string; requestId?: string; } type OpenProjectPayload = OpenProjectResponseMessage["payload"]; type ProjectAddPayload = ProjectAddResponse["payload"]; export type ProjectCreateDirectoryPayload = ProjectCreateDirectoryResponse["payload"]; export type WorkspaceGithubSearchRepositoriesPayload = WorkspaceGithubSearchRepositoriesResponse["payload"]; type ProjectGithubClonePayload = ProjectGithubCloneResponse["payload"]; type ArchiveWorkspacePayload = ArchiveWorkspaceResponseMessage["payload"]; type WorkspaceSetupStatusPayload = WorkspaceSetupStatusResponseMessage["payload"]; export interface FetchAgentResult { agent: AgentSnapshotPayload; project: ProjectPlacementPayload | null; } export interface WaitForFinishResult { status: "idle" | "error" | "permission" | "timeout"; final: AgentSnapshotPayload | null; error: string | null; lastMessage: string | null; } type GetDaemonConfigResponse = Extract; type SetDaemonConfigResponse = Extract; type CorrelatedResponseMessage = Extract | GetDaemonConfigResponse | SetDaemonConfigResponse; type CorrelatedResponseType = CorrelatedResponseMessage["type"]; type CorrelatedResponsePayload = Extract["payload"]; export declare class DaemonClient { private config; private readonly providerSnapshotUpdates; private readonly subscriptions; private transport; private transportCleanup; private rawMessageListeners; private messageHandlers; private eventListeners; private waiters; private checkoutStatusInFlight; private connectionListeners; private reconnectTimeout; private connectTimeout; private pendingGenericTransportErrorTimeout; private reconnectAttempt; private shouldReconnect; private connectPromise; private connectResolve; private connectReject; private lastErrorValue; private connectionState; private checkoutDiffSubscriptions; private terminalDirectorySubscriptions; private fileSubscriptions; private readonly terminalStreams; private pendingBinaryFileReads; private activeBinaryFileTransfers; private completedBinaryFileReads; private logger; private pendingSendQueue; private readonly logConnectionPath; private readonly logServerId; private readonly logClientIdHash; private readonly logGeneration; private lastServerInfoMessage; private runtimeMetricsInterval; private runtimeMetrics; private pingProbe; private livenessHeartbeatTimer; private lastLivenessRttMs; private consecutiveLivenessFailures; constructor(config: DaemonClientConfig); connect(): Promise; private attemptConnect; private resolveConnect; private rejectConnect; close(): Promise; ensureConnected(): void; getConnectionState(): ConnectionState; subscribeConnectionStatus(listener: (status: ConnectionState) => void): () => void; get isConnected(): boolean; get isConnecting(): boolean; get lastError(): string | null; getLastLivenessRttMs(): number | null; subscribe(handler: DaemonEventHandler): () => void; subscribeRawMessages(handler: (message: SessionOutboundMessage) => void): () => void; on(type: TType, handler: (message: Extract) => void): () => void; on(handler: DaemonEventHandler): () => void; onAgentAttentionRequired(handler: (notification: AgentAttentionRequiredNotification) => void): () => void; private beginTraceSection; private endTraceSection; private traceInstant; private sendJsonMessage; private sendTransportFrame; /** * Send a session message. For fire-and-forget messages (heartbeats, etc.), * failures are suppressed if `suppressSendErrors` is configured. * For RPC methods that wait for responses, use `sendSessionMessageOrThrow` instead. */ private sendSessionMessage; private sendBinaryFrame; /** * Send a session message for RPC methods that create waiters. * If the connection is still being established ("connecting"), the message * is queued and will be sent once connected (or rejected after timeout). * This prevents waiters from hanging forever when called during connection. */ private sendSessionMessageOrThrow; /** * Flush pending send queue - called when connection is established. */ private flushPendingSendQueue; /** * Reject all pending sends - called when connection fails or is closed. */ private rejectPendingSendQueue; private sendRequest; private sendCorrelatedRequest; private sendCorrelatedSessionRequest; private sendNamespacedCorrelatedSessionRequest; private sendSessionMessageStrict; clearAgentAttention(agentId: string | string[]): Promise; clearWorkspaceAttention(workspaceId: string | string[]): Promise; markWorkspaceUnread(workspaceId: string, requestId?: string): Promise; sendHeartbeat(params: { deviceType: "web" | "mobile"; focusedAgentId: string | null; focusedTerminalId?: string | null; lastActivityAt: string; appVisible: boolean; appVisibilityChangedAt?: string; }): void; registerPushToken(token: string): void; unregisterPushToken(token: string): Promise; ping(params?: { requestId?: string; timeoutMs?: number; }): Promise<{ requestId: string; clientSentAt: number; serverReceivedAt: number; serverSentAt: number; rttMs: number; }>; measureLatency(params?: { timeoutMs?: number; }): Promise; private livenessPing; private sendPingAwaitRtt; private startLivenessHeartbeat; private stopLivenessHeartbeat; private scheduleNextLivenessHeartbeat; fetchAgents(options?: FetchAgentsOptions): Promise; fetchAgentHistory(options?: FetchAgentHistoryOptions): Promise; fetchRecentProviderSessions(options?: FetchRecentProviderSessionsOptions): Promise; fetchWorkspaces(options?: FetchWorkspacesOptions): Promise; listWorkspaceLabels(options: { subscriptionId: string; sync?: { generation: string; afterSeq: number; }; requestId?: string; }): Promise; setWorkspaceLabel(options: { workspaceId: string; label: Extract["label"]; assigned: boolean; requestId?: string; }): Promise; updateWorkspaceLabel(options: { name: string; newName?: string; color?: Extract["color"]; requestId?: string; }): Promise; deleteWorkspaceLabel(options: { name: string; requestId?: string; }): Promise; inspectWorkspaceLabelDelete(options: { name: string; requestId?: string; }): Promise; listProjects(options?: string | ProjectListOptions): Promise; openProject(cwd: string, requestId?: string): Promise; addProject(cwd: string, requestId?: string): Promise; createProjectDirectory(input: { parentPath: string; name: string; }, requestId?: string): Promise; searchGithubRepositories(input: { query: string; limit?: number; }, requestId?: string): Promise; cloneGithubProject(input: { repo: string; targetDirectory: string; cloneProtocol?: ProjectGithubCloneProtocol; }, requestId?: string): Promise; startWorkspaceScript(workspaceId: string, scriptName: string, requestId?: string): Promise["payload"]>; listWorkspaceScripts(workspaceId: string, requestId?: string): Promise["payload"]>; startWorkspaceScriptWithStatus(workspaceId: string, scriptName: string, requestId?: string): Promise["payload"]>; stopWorkspaceScript(workspaceId: string, scriptName: string, requestId?: string): Promise["payload"]>; archiveWorkspace(workspaceId: string, requestId?: string): Promise; fetchWorkspaceSetupStatus(workspaceId: string, requestId?: string): Promise; runWorkspaceSetup(workspaceId: string, requestId?: string): Promise["payload"]>; fetchAgent(options: FetchAgentOptions): Promise; fetchAgent(agentId: string, requestId?: string): Promise; fetchAgent(agentId: string, options?: LegacyFetchAgentOptions): Promise; private resubscribeCheckoutDiffSubscriptions; private resubscribeTerminalDirectorySubscriptions; private resubscribeFileSubscriptions; createAgent(options: CreateAgentRequestOptions): Promise; private requireAgentRequestReceipts; deleteAgent(agentId: string): Promise; archiveAgent(agentId: string): Promise<{ archivedAt: string; }>; detachAgent(agentId: string): Promise; updateAgent(agentId: string, updates: { name?: string; labels?: Record; }): Promise; renameProject(projectId: string, customName: string | null, requestId?: string): Promise<{ customName: string | null; }>; setProjectIcon(projectId: string, source: ProjectIconSource, requestId?: string): Promise; removeProject(projectId: string, requestId?: string): Promise<{ removedWorkspaceIds: string[]; }>; setWorkspaceTitle(workspaceId: string, title: string | null, requestId?: string): Promise<{ title: string | null; }>; setWorkspacePinned(workspaceId: string, pinned: boolean, requestId?: string): Promise<{ pinnedAt: string | null; }>; inspectWorkspaceRecovery(workspaceId: string, requestId?: string): Promise; restoreWorkspace(workspaceId: string, requestId?: string): Promise; resumeAgent(handle: AgentPersistenceHandle, overrides?: Partial): Promise; importAgent(input: ImportAgentInput): Promise; refreshAgent(agentId: string, requestId?: string): Promise; fetchAgentTimeline(agentId: string, options?: FetchAgentTimelineOptions): Promise; appendAgentTimelineItem(agentId: string, item: Omit): Promise<{ seq: number; epoch: string; }>; listAgentTimelinePrompts(agentId: string, options?: { requestId?: string; timeout?: number; }): Promise; listProviderSubagents(parentAgentId: string, options?: { requestId?: string; timeout?: number; }): Promise; fetchProviderSubagentTimeline(parentAgentId: string, subagentId: string, options?: FetchProviderSubagentTimelineOptions): Promise; setAgentTimelineSubscription(agentIds: string[]): Promise; subscribeAgentTimeline(agentId: string, handler: (message: Extract) => void): TimelineSubscription; private updateEventSubscriptions; private sendEventSubscription; private sendTimelineSubscription; buildAgentForkContext(agentId: string, options?: AgentForkContextOptions): Promise; sendAgentMessage(agentId: string, text: string, options?: SendMessageOptions): Promise; sendMessage(agentId: string, text: string, options?: SendMessageOptions): Promise; rewindAgent(agentId: string, messageId: string, mode: "conversation" | "files" | "both"): Promise; cancelAgent(agentId: string): Promise; setAgentMode(agentId: string, modeId: string): Promise; setAgentModel(agentId: string, modelId: string | null): Promise; setAgentFeature(agentId: string, featureId: string, value: unknown): Promise; setAgentThinkingOption(agentId: string, thinkingOptionId: string | null): Promise; /** * Applies a whole agent-config bundle in one request. Use this instead of * chaining the single-field setters when the values belong together so client * interruption and other mutations cannot interleave between steps. A * provider rejection can still leave earlier steps applied. * Gated on `server_info.features.agentConfigApply`. */ applyAgentConfig(agentId: string, config: AgentConfigApply): Promise; restartServer(reason?: string, requestId?: string): Promise; shutdownServer(options?: ShutdownServerOptions): Promise; updateDaemon(requestId?: string): Promise; setVoiceMode(enabled: boolean, agentId?: string): Promise; sendVoiceAudioChunk(audio: string, format: string, isLast?: boolean): Promise; startDictationStream(dictationId: string, format: string): Promise; sendDictationStreamChunk(dictationId: string, seq: number, audio: string, format: string): void; finishDictationStream(dictationId: string, finalSeq: number): Promise<{ dictationId: string; text: string; }>; cancelDictationStream(dictationId: string): void; abortRequest(): Promise; audioPlayed(id: string): Promise; getCheckoutStatus(cwd: string, options?: { requestId?: string; }): Promise; private normalizeCheckoutDiffCompare; getCheckoutDiff(cwd: string, compare: { mode: "uncommitted" | "base"; baseRef?: string; ignoreWhitespace?: boolean; }, requestId?: string): Promise; subscribeCheckoutDiff(cwd: string, compare: { mode: "uncommitted" | "base"; baseRef?: string; ignoreWhitespace?: boolean; }, options?: { subscriptionId?: string; requestId?: string; }): Promise; unsubscribeCheckoutDiff(subscriptionId: string): void; checkoutCommit(cwd: string, input: { message?: string; addAll?: boolean; }, requestId?: string): Promise; checkoutMerge(cwd: string, input: { baseRef?: string; strategy?: "merge" | "squash"; requireCleanTarget?: boolean; }, requestId?: string): Promise; checkoutMergeFromBase(cwd: string, input: { baseRef?: string; requireCleanTarget?: boolean; }, requestId?: string): Promise; checkoutPull(cwd: string, requestId?: string): Promise; checkoutPush(cwd: string, requestId?: string): Promise; checkoutRefresh(cwd: string, requestId?: string): Promise; listCheckoutCommits(cwd: string, requestId?: string): Promise<{ baseRef: string | null; commits: CheckoutCommit[]; }>; getCommitFileDiff(cwd: string, sha: string, path: string, requestId?: string): Promise<{ file: ParsedDiffFile | null; }>; checkoutPrCreate(cwd: string, input: { title?: string; body?: string; baseRef?: string; }, requestId?: string): Promise; checkoutPrMerge(cwd: string, input: { method: CheckoutPrMergeMethod; }, requestId?: string): Promise; checkoutForgeSetAutoMerge(cwd: string, input: { enabled: true; method: CheckoutPrMergeMethod; } | { enabled: false; }, requestId?: string): Promise; checkoutGithubSetAutoMerge(cwd: string, input: { enabled: true; method: CheckoutPrMergeMethod; } | { enabled: false; }, requestId?: string): Promise; checkoutForgeGetCheckDetails(input: { cwd: string; repoOwner?: string; repoName?: string; checkRunId?: number; workflowRunId?: number; changeRequestNumber?: number; }, requestId?: string): Promise; checkoutGithubGetCheckDetails(input: { cwd: string; repoOwner?: string; repoName?: string; checkRunId?: number; workflowRunId?: number; }, requestId?: string): Promise; checkoutPrStatus(cwd: string, requestId?: string): Promise; pullRequestTimeline(input: { cwd: string; prNumber: number; repoOwner: string; repoName: string; }, requestId?: string): Promise; checkoutSwitchBranch(cwd: string, branch: string, requestId?: string): Promise; renameBranch(input: RenameBranchInput): Promise; stashSave(cwd: string, options?: { branch?: string; }, requestId?: string): Promise; stashPop(cwd: string, stashIndex: number, requestId?: string): Promise; stashList(cwd: string, options?: { paseoOnly?: boolean; }, requestId?: string): Promise; getPaseoWorktreeList(input: { cwd?: string; repoRoot?: string; }, requestId?: string): Promise; archivePaseoWorktree(input: { worktreePath?: string; repoRoot?: string; branchName?: string; workspaceId?: string; scope?: "workspace" | "worktree"; }, requestId?: string): Promise; createPaseoWorktree(input: CreatePaseoWorktreeInput, requestId?: string): Promise; createWorkspace(input: { source: WorkspaceCreateRequest["source"]; title?: string; firstAgentContext?: WorkspaceCreateRequest["firstAgentContext"]; }, requestId?: string): Promise; validateBranch(options: { cwd: string; branchName: string; }, requestId?: string): Promise; getBranchSuggestions(options: { cwd: string; query?: string; limit?: number; }, requestId?: string): Promise; searchForge(options: { cwd: string; query: string; limit?: number; kinds?: ForgeSearchRequest["kinds"]; }, requestId?: string): Promise; searchGitHub(options: { cwd: string; query: string; limit?: number; kinds?: GitHubSearchRequest["kinds"]; }, requestId?: string): Promise; getDirectorySuggestions(options: { query: string; limit?: number; cwd?: string; includeFiles?: boolean; includeDirectories?: boolean; matchMode?: "fuzzy" | "suffix"; }, requestId?: string): Promise; private requestFileExplorer; listDirectory(cwd: string, path: string, requestId?: string): Promise; readFile(cwd: string, path: string, requestId?: string, maxBytes?: number): Promise; subscribeFile(input: { cwd: string; path: string; }, onUpdate: (version: FileVersion) => void): Promise<{ initial: FileVersion; unsubscribe: () => void; }>; writeFile(input: { cwd: string; path: string; content: string; expectedModifiedAt: string; expectedRevision?: string; }): Promise; createFileEntry(input: { cwd: string; parentPath: string; name: string; kind: "file" | "directory"; }): Promise>; renameFileEntry(input: { cwd: string; path: string; name: string; }): Promise>; duplicateFileEntry(input: { cwd: string; path: string; }): Promise>; deleteFileEntry(input: { cwd: string; path: string; }): Promise>; checkoutDiscardChanges(cwd: string, input: { paths: string[]; }): Promise>; uploadFile(input: FileUploadInput): Promise; requestDownloadToken(cwd: string, path: string, requestId?: string): Promise; requestProjectIcon(cwd: string, requestId?: string): Promise; getProjectIcon(projectId: string, requestId?: string): Promise; listProviderModels(provider: AgentProvider, options?: { cwd?: string; requestId?: string; }): Promise; listProviderModes(provider: AgentProvider, options?: { cwd?: string; requestId?: string; }): Promise; listProviderFeatures(draftConfig: ListCommandsDraftConfig, options?: { requestId?: string; }): Promise; listAvailableProviders(options?: { requestId?: string; }): Promise; getProvidersSnapshot(options?: { cwd?: string; ifNoneMatch?: string; requestId?: string; }): Promise; private requestProvidersSnapshot; getDaemonConfig(requestId?: string): Promise<{ requestId: string; config: MutableDaemonConfig; }>; getDaemonStatus(options?: DaemonStatusOptions): Promise; reloadDaemonConfig(requestId?: string): Promise; connectHub(hubUrl: string, token: string, permissions?: readonly string[], requestId?: string): Promise<{ requestId: string; status: { state: "connecting" | "connected" | "not_connected" | "reconnecting" | "disconnecting" | "revoked"; daemonId: string | null; hubOrigin: string | null; permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[]; connectedAt: string | null; lastError: string | null; }; }>; updateHubPermissions(input: { grant?: readonly string[]; revoke?: readonly string[]; }, requestId?: string): Promise<{ requestId: string; status: { state: "connecting" | "connected" | "not_connected" | "reconnecting" | "disconnecting" | "revoked"; daemonId: string | null; hubOrigin: string | null; permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[]; connectedAt: string | null; lastError: string | null; }; }>; getHubStatus(requestId?: string): Promise<{ requestId: string; status: { state: "connecting" | "connected" | "not_connected" | "reconnecting" | "disconnecting" | "revoked"; daemonId: string | null; hubOrigin: string | null; permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[]; connectedAt: string | null; lastError: string | null; }; }>; disconnectHub(force?: boolean, requestId?: string): Promise<{ requestId: string; status: { state: "connecting" | "connected" | "not_connected" | "reconnecting" | "disconnecting" | "revoked"; daemonId: string | null; hubOrigin: string | null; permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[]; connectedAt: string | null; lastError: string | null; }; warning?: string | undefined; }>; getDaemonPairingOffer(options?: DaemonPairingOfferOptions): Promise; collectDiagnostics(requestId?: string): Promise; patchDaemonConfig(config: MutableDaemonConfigPatch, requestId?: string): Promise<{ requestId: string; config: MutableDaemonConfig; }>; sendBrowserAutomationExecuteResponse(response: BrowserAutomationExecuteResponse): void; readProjectConfig(repoRoot: string, requestId?: string): Promise; writeProjectConfig(input: WriteProjectConfigInput): Promise; refreshProvidersSnapshot(options?: { cwd?: string; providers?: AgentProvider[]; requestId?: string; }): Promise; getProviderDiagnostic(provider: AgentProvider, options?: { requestId?: string; }): Promise; listProviderUsage(options?: { requestId?: string; }): Promise; listCommands(options: ListCommandsOptions): Promise; listCommands(agentId: string, requestId?: string): Promise; listCommands(agentId: string, options?: LegacyListCommandsOptions): Promise; respondToPermission(agentId: string, requestId: string, response: AgentPermissionResponse): Promise; getPluginCatalog(): Promise<{ id: string; clientBundle: string; requirements?: { paseo?: string | undefined; } | undefined; }[]>; listPlugins(): Promise; getPluginLogs(pluginId: string): Promise; getAgentSkillsStatus(): Promise; reconcileAgentSkills(): Promise; uninstallAgentSkills(): Promise; saveAgentSkillsSelection(selection: AgentSkillSelection, confirmedRemovals?: readonly string[]): Promise; importLegacyAgentSkillsSelection(selection: AgentSkillSelection): Promise<{ imported: boolean; selection: AgentSkillSelection; }>; installDirectoryPlugin(path: string, id?: string): Promise; installPluginSource(input: { source: string; id?: string; ref?: string; }): Promise; getPluginSourceStatus(pluginId?: string): Promise; updatePluginSources(pluginId?: string): Promise; inspectDirectoryPlugin(path: string): Promise<{ id: string; }>; reloadPlugin(pluginId: string): Promise; enablePlugin(pluginId: string): Promise; disablePlugin(pluginId: string): Promise; removePlugin(pluginId: string): Promise; private managePlugin; invokePluginRpc(pluginId: string, method: string, input: unknown): Promise; respondToPermissionAndWait(agentId: string, requestId: string, response: AgentPermissionResponse, timeout?: number): Promise; waitForAgentUpsert(agentId: string, predicate: (snapshot: AgentSnapshotPayload) => boolean, timeout?: number): Promise; waitForFinish(agentId: string, timeout?: number): Promise; subscribeTerminals(input: { cwd: string; workspaceId?: string; }): void; unsubscribeTerminals(input: { cwd: string; workspaceId?: string; }): void; listTerminals(cwd?: string, requestId?: string, options?: { workspaceId?: string; }): Promise; createTerminal(cwd: string, name?: string, requestId?: string, options?: { agentId?: string; command?: string; args?: string[]; workspaceId?: string; size?: { rows: number; cols: number; }; }): Promise; renameTerminal(input: RenameTerminalInput): Promise; subscribeTerminal(terminalId: string, optionsOrRequestId?: { restore?: SubscribeTerminalRequest["restore"]; requestId?: string; } | string): Promise; unsubscribeTerminal(terminalId: string): void; sendTerminalInput(terminalId: string, message: TerminalInput["message"]): void; killTerminal(terminalId: string, requestId?: string): Promise; closeItems(input: { agentIds?: string[]; terminalIds?: string[]; }, requestId?: string): Promise; captureTerminal(terminalId: string, options?: { start?: number; end?: number; stripAnsi?: boolean; }, requestId?: string): Promise; scheduleCreate(options: CreateScheduleOptions): Promise; scheduleList(requestId?: string): Promise; scheduleInspect(options: InspectScheduleOptions): Promise; scheduleLogs(options: InspectScheduleOptions): Promise; schedulePause(options: InspectScheduleOptions): Promise; scheduleResume(options: InspectScheduleOptions): Promise; scheduleDelete(options: InspectScheduleOptions): Promise; scheduleRunOnce(options: InspectScheduleOptions): Promise; scheduleUpdate(options: UpdateScheduleOptions): Promise; onTerminalStreamEvent(handler: (event: TerminalStreamEvent) => void): () => void; waitForTerminalStreamEvent(predicate: (event: TerminalStreamEvent) => boolean, timeout?: number): Promise; private createRequestId; getLastServerInfoMessage(): ServerInfoStatusPayload | null; private requireHubRelationshipSupport; private requireDaemonConfigReloadSupport; private resolveTransportUrlForAttempt; private sendHelloMessage; private disposeTransport; private cleanupTransport; private resetConnectTimeout; private handleTransportMessage; private handleJsonPayload; private tryHandleBinaryFrame; private handleFileTransferFrame; private updateConnectionState; setReconnectEnabled(enabled: boolean): void; private scheduleReconnect; private emitDisconnectedStateForReconnect; private armReconnectTimer; private resolvePingProbe; private clearPingProbe; private rejectPingProbe; private recordLivenessFailure; private handleSessionMessage; private deliverSessionMessage; private resolveWaiters; private rejectWaitersForRequestId; private clearWaiters; private toEvent; private waitForWithCancel; } //# sourceMappingURL=daemon-client.d.ts.map