* feat(preset): declare Agent compositions in profile YAML * fix(preset): share scope binding cleanup and refresh module graph * fix(preset): use host syntax colors in the YAML editor * fix(preset): write new profile declarations as block YAML * fix(preset): align eager activation with browser and worker surfaces * fix(ui-agent-preset): retain the existing preset card layout * fix(preset): keep rows waiting for a Host service mounted and re-audit after settlement A preset row whose Host provider was still activating at declaration time was reported as waiting for a missing service, and the registry recorded the definition as broken for the rest of the process. Split the mount audit into failed and pending rows: failures and root-realm leaks still reject the mount, while pending rows stay mounted and every read and binding re-audits them after the Host Loader tree settles. Remove the accidental self-dependency of @deepseek-ai/dsh-web-app and its lockfile self-link. Archive the copy-only preset authoring note, which the declarative-preset note fully supersedes, and update the ralph note's restore recipe to the profile-patch mechanism. * chore(lint): re-key and prune the unknown-cast baseline after the master merge * refactor(web-app): ship each Agent preset as its own bundle patch file `dsh.bundle.patch` accepts an ordered file list, so the four shipped preset declarations move out of the 1000-line web patch into `presets/<id>.patch.yml`, one insert per file, applied after the host patch. The host patch keeps the preset registry row. Gates and test scaffolds that read the web layer resolve every patch file through `bundlePatchPaths` instead of one hardcoded path. * refactor(preset): drop the save notice injected into live Agents The notice duplicated the save result the Web editor already shows, and after the producer-owned message sources it would have needed its own persisted source kind. Saving now only persists and reports the activation diagnostic; the persistence catalog is unchanged from master. * docs: regenerate the module graph after dropping the registry's llm dependency * test(ui-agent-preset): cover the guide dialog's keyboard handling on the declarative section * fix(preset): address the remaining review comments Apply the lowercase id rule only when creating a declaration, so presets declared with other ids stay editable. Export `isBuiltInPreset` from the display fold and key the client card groups on it. Remove the dead `error` and `retry` locale keys, the JSDoc orphaned by the `trust` removal, the `trust` fields in the plugin-inventory test fixtures, and the stale `dsh-agent-presets` package name in comments and READMEs. * refactor(preset): make the Web preset page view-and-select only Remove the child-plugin YAML editor, the `agent_preset` tool and the registry's read/save Remote methods. Presets are declared and changed only by bundle patches; the settings page keeps the roster, the new-task default and the mode help, and its question icon explains that and offers to start a Creator-mode task. The `editing-cordis-compositions` skill and the Creator persona describe the bundle-based path, and the authored skill-load Session and Web snapshots are refreshed for it. * docs(skill): make the composition skill self-sufficient for preset authoring State where the shipped declarations live, list every declaration field, inline a complete minimal bundle and an override example, and name the verification calls, so Creator mode no longer reads DSH package sources to infer the format. Refresh the authored skill-load Session for the new text. * test(tools): drop the removed agent_preset tool from the catalog expectation
6.6 KiB
description, kind
| description | kind |
|---|---|
| 当前 Cordis Loader 插件状态的只读投影,并附带每个 agent preset(智能体预设)的组合:面向 web GUI 宿主客户端的 pluginInventory 服务及其 pluginInventory/list Remote。 | package-reference |
@deepseek-ai/dsh-host-plugin-inventory
English | 中文
概述
客户端可以调用 pluginInventory/list,按加载顺序展示宿主的当前插件,包括每个条目的标识符、模块标识、有效启用状态、存活阶段与可用的展示文本。部署组合了 agent preset roster 时,还会报告各预设的元数据、健康状态与压平后的插件组合;没有 roster 时,预设数据缺席。每次响应都是供展示和诊断使用的只读即时快照:它不能修改插件,也不提供历史或变更订阅。
目录
使用本包
当客户端或设置页需要展示宿主当前组合了什么——哪些插件已加载、已启用、是否存活,以及每个 agent preset 会给会话什么——时调用 pluginInventory/list。Remote 是唯一入口:该服务仅供 Remote 使用,刻意不声明同进程 Cordis Context 合并。
快照包含什么
每一行是一个非组 Loader 条目:其条目 id、精确模块标识、有效启用状态(含被禁用的祖先组)与当前根 Fiber 阶段。pending 表示条目等待加载,loading 表示正在读取,active 表示正在运行,failed 表示其 fiber 被拒绝,unloading 表示正在拆除;null 表示完全不存在存活的根 Fiber。结构性的 group 行会被跳过。
Loader 行与预设行可以携带可选的 meta,其中包含标题、描述或元信息诊断。Host 返回可用翻译与字面回退文本,由 Client 选择语言。元信息诊断不改变启停状态或 fiber 阶段。
每个预设的组合
组合了 roster 时,agentPresets 按 roster 顺序携带每个预设一组:其 id、随部署内置还是用户自建(trust,客户端据此本地化内置预设名)、发布的显示名、未指名预设的会话是否组合它,以及压平后的插件行——条目 id(文件行未声明时为 null)、模块标识、有效启用状态、行自带的 !!js disabled 表达式(如有),以及组合存活时的根 Fiber 阶段。已有会话组合过的预设由其最新仍存续的世代作答——即使其文件事后损坏也是如此,因为挂载才是这些会话实际运行的组合;开机以来从未被组合的预设由其组合文件作答,disabled 门用 Loader 上下文求值,且读取从不挂载预设。conditional 表示宿主无法求值的门;无人组合的坏预设保留在列表中,携带原因且没有行。没有 roster 时该字段缺席。
你能用它做什么、不能做什么
该清单是供展示与诊断的快照:客户端可以渲染名单、标出失败条目,并通过比较快照检测变化。它不能启用、停用、添加或移除插件,也不携带历史——已经失败并被移除的 fiber 缺席。由于服务每次调用都读取 Loader,答案总是反映当前组合,而不是缓存视图。
理解实现
实现细节——点击展开
设计理念
网关是一层没有第二个生命周期真源的直接投影:每次 list() 调用都读取 ctx.loader.entries(),并把每个非组条目映射为公共行。Cordis 内部的 plugin/status 事件已经维护了 Entry.fiber 与 Fiber.state,因此再加缓存只会多出一个需要同步的生命周期真源。agent preset roster 是每次调用经 ctx.get('agentPresets') 解析的可选伙伴:预设组合读取由它的 compositionInventory() 负责,本包把根 Fiber 状态映射到公共阶段。
展示元信息来自可选的 pluginPackages 服务:Loader 行使用其所属树的解析基准,预设行使用网关上下文的基准。服务或对应基准不存在时,meta 缺席。读取元信息不会加载或激活插件。
阶段映射
Fiber 状态映射到公共阶段词汇,其中 disposed 折叠为 null——fiber 已消失的条目没有可报告的存活根。因此阶段从不区分为什么没有存活根:条目可能从未启动,也可能其 fiber 已被释放。
源码地图
| 文件 | 职责 |
|---|---|
src/index.ts |
PluginInventoryGateway:pluginInventory Remote 服务与 Loader 投影 |
src/types.ts |
公共 payload 类型:PluginInventoryEntry、PluginInventorySnapshot、PluginFiberPhase |
| — | 不发布运行时不变式配套项;每个快照都投影 Loader 持有的状态。 |
Typert 生成由 ./typert 与 ./remote 导出的 Host 和 Client Remote 产物。
进一步探索
当清单约定不够用时阅读以下内容:先看 Remote 如何到达客户端,再看它所投影的 Loader 与渲染它的界面。
- Remote 组合——客户端如何在不导入 Host 实现的情况下消费
pluginInventory/list。 - Cordis 插件 loader——本包所投影条目的那个 Loader。
- 插件清单设置界面——渲染该清单的浏览器侧投影。
模型体验
无。这个仅限 Host 的只读 Loader 投影不注册任何面向模型的内容。
KV Cache 影响
无;该包既不组装也不发送提供方请求。
已知限制与延期工作
这些限制说明即时清单无法向客户端提供哪些信息。它们是当前包约束,不是任务积压。
- 仅表示调用当下——结果不包含持久的失败历史或订阅;只要不存在存活的根 Fiber,就会报告
null,而不区分其原因。 - 不标识引入层,也不修改插件——服务不识别条目由哪个 bundle、profile 或 override 引入,也不能在任一平面启用、停用、添加或移除插件。
- 预设仅随 roster 出现——未装
dsh-agent-preset-registry的部署只提供 Loader 条目;agentPresets字段缺席而非为空。
开发备注
维护者的工作上下文——点击展开
无。