/** * Workspace:本地项目资源与安全作用域。 * * 职责说明(中文) * - 只解析一次项目根目录,并将 Store、Tool 与可选 Shell 绑定到同一资源容器。 * - AgentStore 与 WorkspaceTools 共用同一个 FileSystem 和目录访问范围。 * - 每个 Workspace 实例只绑定一个 Agent;同一物理目录可创建多个独立实例。 */ import type { FileSystem } from "../types/workspace/FileSystem.js"; import type { WorkspaceOptions } from "../types/workspace/Workspace.js"; import type { AgentStore } from "../types/store/AgentStore.js"; import type { WorkspaceTools } from "../types/workspace/WorkspaceTools.js"; import type { WorkspaceEnvPatch, WorkspaceEnvSubscriber, WorkspaceEnvUnsubscribe } from "../types/workspace/WorkspaceEnv.js"; import { WorkspaceBase } from "../workspace/WorkspaceBase.js"; /** 本地 Workspace。 */ export declare class Workspace extends WorkspaceBase { /** 已解析且不可变的项目根目录。 */ readonly path: string; /** Workspace 根目录内统一的受控文件与搜索能力。 */ readonly files: FileSystem; /** Workspace 内可用的文件、搜索与可选命令工具。 */ readonly tools: WorkspaceTools; /** Workspace 内可选的受控命令执行能力。 */ readonly shell?: WorkspaceOptions["shell"]; /** Workspace 首次释放产生的稳定 Promise,保证重复释放不会重复关闭资源。 */ private dispose_promise?; /** 当前 Workspace 已绑定的 Agent 标识;未绑定时为空。 */ private bound_agent_id?; /** 当前 Workspace 为唯一 Agent 创建的结构化 Store。 */ private bound_store?; /** 当前 Workspace configured env 的唯一可变状态。 */ private readonly env; /** Workspace env 变化订阅器。 */ private readonly env_subscribers; constructor(options: WorkspaceOptions); /** 返回当前 Workspace env 的浅拷贝快照。 */ get_env(): Record; /** 整体覆盖 Workspace env,并通知已绑定的 Agent。 */ set_env(next: WorkspaceEnvPatch): void; /** 增量修改 Workspace env,并通知已绑定的 Agent。 */ patch_env(patch: WorkspaceEnvPatch): void; /** 订阅 Workspace env 的后续变化。 */ subscribe_env(subscriber: WorkspaceEnvSubscriber): WorkspaceEnvUnsubscribe; /** 将当前 Workspace 唯一绑定到 Agent,并创建结构化状态入口。 */ bind_agent(agent_id: string): AgentStore; /** 关闭 Workspace 持有的 Store、命令进程与平台 Sandbox 资源。 */ dispose(): Promise; /** 原地应用一次 env patch。 */ private apply_env_patch; /** 只在内容真实变化时发布完整 env 快照。 */ private publish_env_if_changed; } //# sourceMappingURL=Workspace.d.ts.map