/** * AgentState:本地 Agent 长期运行状态与生命周期。 * * 职责说明(中文) * - 统一连接 PluginRegistry 与 PluginContext。 * - 持有 Plugin lifecycle 与 ActionSchedule 的启动状态。 * - Agent 构造完成后立即开始启动,调用方通过 `ready()` 等待。 * - Agent 释放时统一停止 ActionSchedule 与 Plugin lifecycle。 * - RPC / HTTP 等 transport 不属于 AgentState,由上游宿主独立管理。 */ import type { AgentStateOptions } from "../types/agent/AgentState.js"; /** * 本地 Agent 长期运行状态。 */ export declare class AgentState { /** 当前 Agent 共用的执行上下文。 */ private readonly context; /** 当前 Agent 唯一的 PluginRegistry 实例。 */ private readonly plugins; /** Plugin lifecycle 与 ActionSchedule 的唯一启动 Promise。 */ private readonly ready_promise; /** Plugin lifecycle 是否已经完成启动流程。 */ private plugins_started; /** 当前 Agent 持有的 ActionSchedule 轮询运行时。 */ private action_schedule_runtime; constructor(options: AgentStateOptions); /** * 等待当前 Agent 持有的长期运行时启动完成。 */ ready(): Promise; /** * 释放当前 Agent 持有的长期运行时对象。 */ dispose(): Promise; /** * 启动 Plugin lifecycle 与 ActionSchedule。 * * 关键点(中文) * - Plugin lifecycle 先启动,避免到期任务调用未就绪的 Plugin。 * - 单个 Plugin 启动失败由 PluginRegistry 隔离,只记录错误并继续启动 Agent。 * - ActionSchedule 启动失败不阻断 Agent ready。 */ private start_runtime; } //# sourceMappingURL=AgentState.d.ts.map