/** * RemoteSession:统一 SessionMutation 协议的远程 Session 客户端。 * * 事件泵只传输一种 Mutation;审批查询、模式和决策全部绑定当前 Session。 */ import type { AgentSessionConfigSnapshot, AgentSessionSetOptions, AgentSessionForkInput, AgentSessionInfo, AgentSessionStatus, AgentSessionSystemSnapshot, RemoteSessionSetInput } from "../types/agent/SessionTypes.js"; import type { RemoteAgentSession } from "../types/agent/SessionActor.js"; import type { RespondSessionInteractionInput, SessionInteractionResult, SessionPendingInteraction } from "../types/session/SessionInteraction.js"; import type { SessionMutationSubscriber, SessionMutationUnsubscribe } from "../types/session/SessionMutation.js"; import type { ListSessionMessagesInput, SessionMessagePage } from "../types/session/SessionMessage.js"; import type { AgentSessionPromptInput } from "../types/sdk/AgentSessionPrompt.js"; import type { AgentSessionStopResult } from "../types/sdk/AgentSessionStop.js"; import type { AgentSessionCompactHandle } from "../types/sdk/AgentSessionCompact.js"; import type { AgentSessionTurnHandle } from "../types/sdk/AgentSessionTurn.js"; import type { RemoteSessionTransport } from "../remote/RemoteTransport.js"; /** 远程 Session 客户端。 */ export declare class RemoteSession implements RemoteAgentSession { readonly id: string; readonly agent_id: string; readonly config: AgentSessionConfigSnapshot; private readonly transport; private readonly event_hub; private readonly turns_by_id; private readonly compacts_by_id; private readonly completed_turn_ids; private readonly completed_compact_ids; private event_pump_connect_promise; private event_pump_running; private event_subscriber_count; private event_subscription; constructor(transport: RemoteSessionTransport, info: AgentSessionInfo); /** 读取当前远程 Session 详情。 */ get_info(): Promise; /** 向当前远程 Session 追加 Prompt。 */ prompt(input: AgentSessionPromptInput): Promise; /** 停止当前远程 Session Turn。 */ stop(): Promise; /** 把一次显式历史压缩加入当前远程 Session 的有序输入队列。 */ compact(): Promise; /** 订阅当前 Session 的全部未来 Mutation。 */ subscribe(subscriber: SessionMutationSubscriber): SessionMutationUnsubscribe; /** 读取远程 Message 快照。 */ messages(input?: ListSessionMessagesInput): Promise; /** 读取远程 Session 的 System 快照。 */ system(): Promise; /** 列出当前远程 Session 正在等待用户响应的 Interaction。 */ interactions(): Promise; /** 读取当前远程 Session 的运行与安全状态。 */ status(): Promise; /** 更新当前远程 Session 的可序列化动态配置。 */ set(input: RemoteSessionSetInput, options?: AgentSessionSetOptions): Promise; /** 提交当前远程 Session 的 Interaction 用户响应。 */ respond(input: RespondSessionInteractionInput): Promise; /** 从当前远程 Session 创建分支。 */ fork(input?: AgentSessionForkInput | string): Promise; private ensure_event_pump; private handle_mutation; private handle_event_pump_closed; private ensure_turn_lifecycle; private fail_pending_turns; private remember_completed_turn; /** 有界保留已完成压缩,覆盖 finish Mutation 早于 transport 响应到达的竞态。 */ private remember_completed_compact; private maybe_stop_event_pump; private ensure_compact_lifecycle; } //# sourceMappingURL=RemoteSession.d.ts.map