/** * ClaudeClient — top-level entry point for Claude Code Remote. * * Pass credentials once, then create/connect to multiple sessions: * * const client = new ClaudeClient({ organizationUuid, cookie }); * const s1 = await client.connect("session_01...", { onAssistantMessage: ... }); * const s2 = await client.create({ environmentId: "env_...", onAssistantMessage: ... }); * s1.sendMessage("hello from session 1"); * s2.sendMessage("hello from session 2"); */ import { ClaudeApi } from "./api"; import { SessionManager } from "./session"; import type { ClaudeRemoteOptions, Session, SessionListResponse, EnvironmentListResponse, WsAssistantMessage, WsResultMessage, SessionContext } from "./types"; import type { ToolPermissionHandler, HookCallbackHandler, ConnectionState } from "./session"; /** Callbacks for a session — passed to connect() or create() */ export interface SessionCallbacks { onAssistantMessage?: (message: WsAssistantMessage) => void; onResult?: (message: WsResultMessage) => void; onToolPermission?: ToolPermissionHandler; onHookCallback?: HookCallbackHandler; onStateChange?: (state: ConnectionState) => void; onError?: (error: Error) => void; } /** Options for connecting to an existing session */ export interface ConnectOptions extends SessionCallbacks { replay?: boolean; maxRetries?: number; idleTimeout?: number; } /** Options for creating a new session and connecting */ export interface CreateOptions extends ConnectOptions { environmentId?: string; title?: string; model?: string; sessionContext?: Partial; } export declare class ClaudeClient { readonly api: ClaudeApi; private readonly credentials; private sessions; constructor(credentials: ClaudeRemoteOptions); /** * Connect to an existing session by ID. * Returns a connected SessionManager ready to use. */ connect(sessionId: string, options?: ConnectOptions): Promise; /** * Create a new session and connect to it. * * If environmentId is not provided, uses the first active environment. */ create(options?: CreateOptions): Promise; /** * List all sessions. */ listSessions(): Promise; /** * Get a specific session by ID. */ getSession(sessionId: string): Promise; /** * List available environments. */ listEnvironments(): Promise; /** * Get a connected SessionManager by session ID (if previously connected via this client). */ getConnected(sessionId: string): SessionManager | undefined; /** * Disconnect a specific session. */ disconnect(sessionId: string): void; /** * Disconnect all sessions. */ disconnectAll(): void; } //# sourceMappingURL=client.d.ts.map