Files
deepseek-harness/packages/preset/README.zh.md
T
Yichen Jiang 3ae22b3835 feat(agent-presets): ship a cordis agent that can author compositions
A third built-in preset: the standard coding agent plus the self-referential
Cordis toolset, a persona that explains the two-plane split, and a skill
teaching composition authoring. It exists so a person can ask an agent to
author another agent.

The skill ships INSIDE the preset directory rather than in the user's skill
root, and the root is derived from the preset's own `baseUrl` — the loader
evaluates `!!js` with `with (ctx)`, so a composition can locate itself. A
preset is the unit that gets copied and edited, so its documentation should
travel with it.

The skill leads with the rule that actually bites: a row publishing a service
may not sit loose in a preset, whether a row publishes one is not visible from
its name (`tool-bash` provides `bashEnv`), and a consumer left outside its
provider's isolate group resolves the host registry and then contributes
nothing — the quietest failure this design has.

Writing the test surfaced a consequence worth stating: an entry-local realm
makes the service invisible to the agent's own scope too, not just to the host.
Only rows inside that group resolve it, which is precisely what makes
`tool-skill` this agent's own rather than a shared one. The test asserts what
is actually observable from outside instead of reaching for the isolated
service.

TRUST: `cordis_mount` evaluates model-written JavaScript against the live
runtime, and a composition this agent writes becomes a preset other sessions
mount. Both the preset header and the toolset's own documentation say to treat
this as shell access. The tools stay opt-in per session — a test pins that they
are absent from every other preset.
2026-08-07 00:39:35 +08:00

1.3 KiB
Raw Blame History

preset/:按会话组装 agent

English | 中文

agent preset 是一个目录,其中放置一份 agent.cordis.yml。把它挂载到某个 agent(智能体)的 scope 上下文之下,该会话就获得自己的工具与提示词段落,而其他在运行的会话各自保持不变,因此一个进程可以同时运行多个组装方式不同的 agent。

包 职责 ctx 键
agent-presets/ preset 词汇、在受信任目录与用户自建目录上的文件系统发现,以及带校验的按 agent 挂载 ctx.agentPresets
persona/ 把 agent 人设做成可组装的行,使 preset 不止能改工具、也能改身份 —

部署随附三个 preset:standard(完整编码 agent)、core-web(两个工具的 benchmark 表层),以及 cordis(标准 agent 加上自指工具集与一份组装创作 skill,使人可以让 agent 去创作另一个 agent)。

本组假定的组装划分是:注册表与跨会话设施是进程单例,留在宿主组装中;preset 只承载单个 agent 对它们的贡献。若 preset 中某一行发布了进程级全局服务,挂载时即被拒绝,而不是留到与下一个会话相撞。

设计详见 按会话组装 agent preset 的 Agent Note。