AssembledTooling
assembleTooling 的产物:执行器、工具定义 / 注册表、权限门、装配层 system 段与 cwd 重绑能力
capabilities
Section titled “capabilities”capabilities: AppCapabilities;生效能力位(agent 位等后续装配消费)
executor
Section titled “executor”executor: ToolExecutor;mcpDiscover?
Section titled “mcpDiscover?”optional mcpDiscover?: (toolset) => Tool;Task 子代理 McpDiscover 换装工厂(MCP 懒目录非空时在场;与 cli 同形)。调用方接进 attachSdkTaskTool 的
mcpDiscover:子代理生效集含 McpDiscover 时派生期换装为绑定子视图的实例(展开只写子代理自己的工具面);
缺席 = kernel 防御性摘除(子代理无 MCP 展开面)。
toolset
Section titled “toolset”McpToolset
onEnded?
Section titled “onEnded?”optional onEnded?: () => Promise<void>;会话收口回调(会话级临时 MCP host 的 dispose;应用级 host 恒缺席)
Promise<void>
ownedResources?
Section titled “ownedResources?”optional ownedResources?: OwnedResources;内部所有权载体,会话与单轮 query 装配共享同一真实在飞清理。
permissionGate
Section titled “permissionGate”permissionGate: PermissionGate;权限门(Task 子代理沿用同实例)
rebindCwd
Section titled “rebindCwd”rebindCwd: (cwd) => { executor: DispatchingToolExecutor; permissionGate: PermissionGate;};按新 cwd 重建 cwd 锚定的三件——PreToolUse HookEngine(command 执行体 cwd 与载荷 cwd)、权限门 (规则路径锚定 / 工作区快路径)、执行器(kernel withCwd 派生:registry / fileReadState / searchAggregator 共享)。权限引擎实例复用(会话缓存 / 分类器熔断与预算 / 已装载策略束跨切换存续;规则编译按 cwd 键缓存 无陈旧面)。返回新实例,既有实例零改动;调用方(AgentSession.setCwd)在空闲期替换持有引用。 多次调用自最近一次派生。
string
{ executor: DispatchingToolExecutor; permissionGate: PermissionGate;}executor
Section titled “executor”executor: DispatchingToolExecutor;permissionGate
Section titled “permissionGate”permissionGate: PermissionGate;registry
Section titled “registry”registry: ToolRegistry;工具注册表(与 toolDefs 名字集合恒一致;Task 子代理附着面)
systemSegments
Section titled “systemSegments”systemSegments: IRSystemSegment[];装配层合成 system 段(guide 等;调用方追加到用户 system 尾部)
toolDefs
Section titled “toolDefs”toolDefs: IRToolDef[];模型可见工具定义(与 executor 的 registry 名字集合恒一致)
本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。