import type { BootstrapStateOptions, BootstrapStateResult, ChangeDeviceStateOptions, CreateAgentOptions, GetDeviceStatusOptions, LettaCodeClientSessionOptions, LettaCodeSession, ListModelsResult, ListMessagesOptions, ListMessagesResult, RecoverPendingApprovalsOptions, RecoverPendingApprovalsResult, RemoveQueuedMessageResult, SDKInitMessage, SDKMessage, SDKProtocolCommand, SDKProtocolMessage, SDKResultMessage, SendCommandOptions, SendMessage, SendOptions, SessionDeviceStatus, UpdateModelOptions, UpdateModelResult } from "./types.js"; export { ensureSuccess, isUnrestrictedPermissionMode, mapPermissionMode, normalizePermissionMode, normalizeSendMessage, } from "./remote-session-protocol.js"; import { type RemoteClientSessionCoreConfig, type RemoteClientRuntimeController, type RuntimeScope, type RuntimeSessionInit, type RuntimeSessionMode } from "./remote-session-protocol.js"; export type { ProtocolMessage, RemoteClientRuntimeController, RuntimeRequestOptions, RuntimeScope, RuntimeSendTurnOptions, RuntimeSessionInit, RuntimeSessionMode, RuntimeTurnResult, } from "./remote-session-protocol.js"; export declare abstract class RemoteClientSessionCore implements LettaCodeSession { protected readonly mode: RuntimeSessionMode; protected controller: RemoteClientRuntimeController | null; protected runtime: RuntimeScope | null; protected initialized: boolean; protected closed: boolean; protected _agentId: string | null; protected _sessionId: string | null; protected _conversationId: string | null; protected _model: string; protected _modelSettings: Record | null; private readonly label; private readonly requestTimeoutMs; private initializePromise; private removeMessageHandler; private detachTransportDisconnect; private idleTransportDisconnected; private transportRecoveryPromise; private transportDisconnectGeneration; private readonly turns; private toolNames; private deviceStatusListeners; private deviceStatusRefreshCancels; protected constructor(mode: RuntimeSessionMode, config: RemoteClientSessionCoreConfig); /** * Initialize the session. * * Single-flight: the first caller starts initialization and every * concurrent caller (including the lazily-initializing entry points such * as send()/stream()/listMessages()) awaits the same promise, so a fresh * session never opens more than one runtime connection. A failed attempt * clears the memo so a later call can retry; it only releases the * resources that failed attempt created. */ initialize(): Promise; private performInitialize; /** * Release the partial state a failed initialize attempt created without * closing the session, so a later initialize() can retry. */ private cleanupFailedInitialize; send(message: SendMessage, options?: SendOptions): Promise; sendAndWaitForResult(message: SendMessage): Promise; stream(): AsyncGenerator; abort(): Promise; sendCommand(command: SDKProtocolCommand): Promise; sendCommand(command: SDKProtocolCommand, options: SendCommandOptions): Promise; listModels(): Promise; updateModel(update: string | UpdateModelOptions): Promise; private applyModelUpdate; recoverPendingApprovals(options?: RecoverPendingApprovalsOptions): Promise; removeQueuedMessage(itemId: string): Promise; getDeviceStatus(options?: GetDeviceStatusOptions): Promise; onDeviceStatus(listener: (status: SessionDeviceStatus) => void): () => void; private refreshDeviceStatus; listMessages(options?: ListMessagesOptions): Promise; bootstrapState(options?: BootstrapStateOptions): Promise; close(): void; get agentId(): string | null; get sessionId(): string | null; get conversationId(): string | null; [Symbol.asyncDispose](): Promise; changeDeviceState(updates: ChangeDeviceStateOptions): Promise; updateToolset(toolsetPreference: string): Promise; protected abstract initializeRuntimeController(): Promise; /** * Active turns fail because the input may have reached the listener. Cloud * sessions may recover an idle connection before the next turn is tracked. */ protected watchTransportDisconnect(client: { onDisconnect(handler: () => void): () => void; }, options?: { recoverWhenIdle?: boolean; }): void; private recoverIdleTransportIfNeeded; protected recoverIdleTransport(_runtime: RuntimeScope): Promise; protected onIdleTransportDisconnect(): void; protected onRecoveredTransportDiscarded(): void; protected afterRuntimeInitialized(): Promise; protected beforeTurn(): Promise; protected onCoreClose(): void; protected onCoreDisposed(): Promise; protected currentOptions(): LettaCodeClientSessionOptions | CreateAgentOptions; protected shouldEnableMemfs(options: LettaCodeClientSessionOptions | CreateAgentOptions): boolean; protected enableMemfsBody(): Record; protected setModel(model: string): void; private resolveUpdateModelPayload; protected applyPostInitializeOptions(): Promise; private emitDeviceStatus; } //# sourceMappingURL=remote-client-session-core.d.ts.map