/** * Agent:身份、模型、指令与 Plugin 的主体对象。 * * 职责说明(中文) * - Agent 不绑定 Workspace;调用方通过 `agent.sessions.create({ workspace })` 选择本次执行环境。 * - PluginRegistry 只属于 Agent,所有 Workspace 共享同一份注册定义。 * - Session 由 AgentSessions 统一持有;Workspace 只在单个 Session 创建时提供执行资源。 */ import type { RuntimeTool as Tool } from "@downcity/type"; import type { AgentModel } from "./AgentModel.js"; import { PluginRegistry } from "../plugin/core/PluginRegistry.js"; import type { AgentOptions, AgentSessionConstructor } from "../types/agent/AgentOptions.js"; import type { PluginWebServices } from "../types/plugin/PluginServices.js"; import type { AgentSessionCollection } from "../types/agent/AgentSessionCollection.js"; import { Logger } from "../utils/logger/Logger.js"; /** SDK Agent 主体。 */ export declare class Agent { /** Agent 的全局稳定标识。 */ readonly id: string; /** Agent 默认模型;Session 可以显式覆盖。 */ readonly model?: AgentModel; /** Agent 面向用户的 Session 创建入口。 */ readonly sessions: AgentSessionCollection; /** 当前 Agent 持有的 Web 搜索与文档能力。 */ readonly web?: PluginWebServices; /** Agent 注册的唯一 PluginRegistry。 */ readonly plugins: PluginRegistry; /** Agent 自定义 Tool;进入每个 Workspace 时与项目 Tool 合并。 */ readonly custom_tools: Record; /** Agent 使用的 Session 类。 */ readonly session_class?: AgentSessionConstructor; /** AgentPlugin 的内部访问名,仍指向 Agent 唯一 Registry。 */ readonly plugin_registry: PluginRegistry; /** Agent 级日志器,不绑定任何 Workspace。 */ private readonly logger; /** 当前 Agent configured instruction。 */ private readonly instruction; /** Agent 释放状态。 */ private dispose_promise?; /** Agent 级 Plugin lifecycle 启动流程。 */ private readonly plugin_ready; /** Agent 唯一的 Session 集合。 */ private readonly session_manager; constructor(options: AgentOptions); /** 更新 Agent 的静态基础指令。 */ set_instruction(input: string | string[]): void; /** 返回 Agent 指令快照。 */ get_instructions(): readonly string[]; /** 返回 Agent 级日志器。 */ get_logger(): Logger; /** 释放 Agent 进入的全部 Workspace 与 Agent Plugin。 */ dispose(): Promise; /** 等待 Agent 级 Plugin 完成启动,供内部运行时使用。 */ ensure_ready(): Promise; } //# sourceMappingURL=Agent.d.ts.map