/** * Session 用户异步交互运行时。 * * 本模块只拥有 pending waiter、超时与恢复执行;Interaction 的权威状态由 * SessionMessages 持久化。任何终态都必须先提交 canonical Message,再兑现等待 Promise。 */ import type { SessionMessages } from "../../session/SessionMessages.js"; import type { RespondSessionInteractionInput, SessionInteractionHandle, SessionInteractionLifecycle, SessionInteractionPort, SessionInteractionRequest, SessionInteractionResult, SessionPendingInteraction } from "../../types/session/SessionInteraction.js"; /** 单个 Session 的异步用户交互入口。 */ export declare class SessionInteractions implements SessionInteractionPort, SessionInteractionLifecycle { private readonly session_id; private readonly messages; private readonly pending_by_id; constructor(options: { /** 当前 Interaction 运行时所属 Session 标识。 */ session_id: string; /** 当前 Session 的 canonical Message 入口。 */ messages: SessionMessages; }); /** 创建并持久化一次 Interaction,返回等待终态结果的句柄。 */ request(request: SessionInteractionRequest): Promise; /** 返回当前 Session 全部 pending Interaction 请求快照。 */ list(): SessionPendingInteraction[]; /** 保存用户响应,并在提交成功后恢复原执行。 */ respond(input: RespondSessionInteractionInput): Promise; /** 取消当前 Session 的全部 pending Interaction。 */ cancel_all(reason: "turn_stopped" | "session_disposed" | "runtime_interrupted"): Promise; /** 处理单个 Interaction 自动过期。 */ private expire; /** 校验执行面提交的 Interaction 请求。 */ private validate_request; /** 校验响应 kind、问题集合与回答值。 */ private validate_response; /** 读取当前 pending Interaction 运行态。 */ private require_pending; /** 清理运行态并兑现执行方等待 Promise。 */ private finish_pending; } //# sourceMappingURL=SessionInteractions.d.ts.map