import type * as LlmsProviders from "@cline/llms"; import type { ChatRunTurnRequest, ChatStartSessionRequest, ChatStartSessionResponse, ChatTurnResult, TeamProgressProjectionEvent } from "@cline/shared"; import type { CheckpointEntry } from "../../hooks/checkpoint-hooks"; type ScheduleClientRecord = Record & { metadata?: Record; }; export interface HubSessionClientOptions { address: string; authToken?: string; clientId?: string; clientType?: string; displayName?: string; workspaceRoot?: string; cwd?: string; metadata?: Record; } export interface HubSessionRow { sessionId: string; parentSessionId?: string; metadata?: Record; messagesPath?: string; } export interface HubStreamEvent { sessionId: string; eventType: string; payload: Record; } export interface HubRestoreRequest { sessionId: string; checkpointRunCount: number; config?: ChatStartSessionRequest; restore?: { messages?: boolean; workspace?: boolean; omitCheckpointMessageFromSession?: boolean; }; } export interface HubRestoreResponse { sessionId?: string; startResult?: { sessionId: string; manifestPath: string; messagesPath: string; }; messages?: LlmsProviders.Message[]; checkpoint: CheckpointEntry; } export interface HubEventStreamHandlers { onEvent?: (event: HubStreamEvent) => void; onError?: (error: Error) => void; } export interface HubTeamProgressHandlers { onProjection?: (event: TeamProgressProjectionEvent) => void; onError?: (error: Error) => void; } export declare class HubSessionClient { private readonly options; private readonly client; private metadataApplied; constructor(options: HubSessionClientOptions); private ensureMetadataApplied; connect(): Promise; close(): void; dispose(): Promise; startRuntimeSession(request: ChatStartSessionRequest): Promise; sendRuntimeSession(sessionId: string, request: ChatRunTurnRequest, options?: { timeoutMs?: number | null; }): Promise<{ result?: ChatTurnResult; }>; stopRuntimeSession(sessionId: string): Promise<{ applied: boolean; }>; abortRuntimeSession(sessionId: string): Promise<{ applied: boolean; }>; updateSession(input: { sessionId: string; metadata?: Record; }): Promise<{ updated: boolean; }>; getSession(sessionId: string): Promise; readMessages(sessionId: string): Promise; restore(input: HubRestoreRequest): Promise; listSessions(input?: { limit?: number; }): Promise; deleteSession(sessionId: string, deleteCheckpointRefs?: boolean): Promise; respondToolApproval(input: { approvalId: string; approved: boolean; reason?: string; responderClientId?: string; }): Promise; streamEvents(input: { clientId?: string; sessionIds?: string[]; }, handlers: HubEventStreamHandlers): () => void; streamTeamProgress(_input: { clientId?: string; }, handlers: HubTeamProgressHandlers): () => void; createSchedule(input: Record): Promise; listSchedules(_input?: { limit?: number; }): Promise; getSchedule(scheduleId: string): Promise; updateSchedule(scheduleId: string, input: Record): Promise; pauseSchedule(scheduleId: string): Promise; resumeSchedule(scheduleId: string): Promise; deleteSchedule(scheduleId: string): Promise; triggerScheduleNow(scheduleId: string): Promise | undefined>; listScheduleExecutions(scheduleId: string, limit?: number): Promise>>; getScheduleStats(): Promise | undefined>; getActiveScheduledExecutions(): Promise>>; getUpcomingScheduledRuns(limit?: number): Promise>>; } export {};