agent.cordis.yml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. # The `code` agent preset: the standard coding agent, presented as Code Mode.
  2. #
  3. # Everything in `standard` is here unchanged. What is added is the `tool-presentation`
  4. # row: instead of one tool call per action, the model writes a TypeScript
  5. # program against a generated SDK and `run_code` executes it, so a sequence
  6. # that would be five round trips becomes one.
  7. #
  8. # The registry itself stays on the host plane — the agent loop's scheduler and
  9. # the API proxy's presenters are its consumers — so what this preset owns is
  10. # the PRESENTATION of that registry for this agent alone. Native sessions run
  11. # beside this one in the same process, each seeing its own catalog.
  12. #
  13. # This file is an AGENT-PLANE composition. It is mounted under one agent's
  14. # scope context, so every tool and prompt section it registers belongs to that
  15. # session alone. The host composition (`base.cordis.yml` + `web.cordis.yml`)
  16. # keeps everything a preset must not own: the registries themselves, the
  17. # sandbox and approval stack, persistence, and the model route.
  18. #
  19. # A service row here MUST sit inside a group carrying an `isolate` realm.
  20. # Without one it publishes into the root realm, where it is process-global
  21. # rather than per-session and the second session mounting this preset collides
  22. # with the first; `dsh-agent-presets` rejects that at mount. `true` means an
  23. # entry-local realm — one private instance per mounted session, which is the
  24. # default this deployment wants. A shared label would instead pool one instance
  25. # across every session naming it.
  26. # ── identity ────────────────────────────────────────────────────────────────
  27. # The preset's own persona, shadowing the deployment default for this agent.
  28. # `{{model}}` and `{{cwd}}` resolve from the agent's own route and workspace.
  29. - id: persona
  30. name: '@deepseek-ai/dsh-persona'
  31. config:
  32. text: >-
  33. You are a coding agent powered by the {{model}} model. Your working directory is {{cwd}}.
  34. - id: agent-instructions
  35. name: '@deepseek-ai/dsh-agent-instructions'
  36. config:
  37. maxBytes: 65536
  38. # ── shell ───────────────────────────────────────────────────────────────────
  39. # `shell-env` stays in the HOST composition: `apps/cli/src/web.ts` injects it to
  40. # publish `DSH_WEB_URL`/`DSH_WEB_MODE`, and a host row that injects a service is
  41. # the criterion for host-plane ownership — injection resolves before any session
  42. # exists, so there is no agent to key by. Behind a preset realm those variables
  43. # never reached the model's shell at all. Both shell tools consume the host
  44. # registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
  45. # host-plane too.
  46. - id: tool-bash
  47. name: '@deepseek-ai/dsh-tool-bash'
  48. disabled: !!js process.platform === 'win32'
  49. - id: tool-pwsh
  50. name: '@deepseek-ai/dsh-tool-pwsh'
  51. disabled: !!js process.platform !== 'win32'
  52. # ── filesystem ──────────────────────────────────────────────────────────────
  53. # Both register into the host `tools` registry and provide nothing, so
  54. # they need no realm. The `fs` service and its policy stay in the host.
  55. - id: tool-fs
  56. name: '@deepseek-ai/dsh-tool-fs'
  57. - id: tool-fs-search
  58. name: '@deepseek-ai/dsh-tool-fs-search'
  59. config:
  60. sampleOverCapGlobResults: false
  61. # ── background jobs ────────────────────────────────────────────────────────
  62. # Only the model-facing controls. The task REGISTRY stays on the host plane:
  63. # its producers sit outside any realm this file could put it in — `tool-bash`
  64. # above resolves it with `ctx.get`, and an entry-local realm here is invisible
  65. # to every sibling row, so `run_in_background` would answer "background jobs
  66. # unavailable" while these controls sat in the catalog. The registry is keyed by
  67. # owning agent anyway, so one host instance serves every session. What a preset
  68. # chooses is whether its agent can collect and stop background work at all.
  69. - id: tool-jobs
  70. name: '@deepseek-ai/dsh-tool-jobs'
  71. # ── skills ──────────────────────────────────────────────────────────────────
  72. # The skill REGISTRY lives in the host composition and is layered per scope:
  73. # these rows register into THIS preset's layer of it, so they need no realm.
  74. # `skill-filesystem` contributes local-root discovery for agents on this preset, and
  75. # `tool-skill` gives them the catalog and loader; the merged catalog also
  76. # carries whatever the deployment registered globally (repository plugins).
  77. - id: skill-filesystem
  78. name: '@deepseek-ai/dsh-skill-filesystem'
  79. - id: tool-skill
  80. name: '@deepseek-ai/dsh-tool-skill'
  81. # ── goals ───────────────────────────────────────────────────────────────────
  82. # Only the model-facing tool. The goal SERVICE, its session driver, and the
  83. # `/goal` command stay on the host plane: the Gateway serves the goal domain as
  84. # Remote endpoints whose receiver comes from a generated descriptor, so it
  85. # resolves `goals` on the host and an entry-local realm here would hide it. The
  86. # registry is keyed by session anyway, so one host instance serves every
  87. # session. What a preset chooses is whether its agent can call the goal tool.
  88. - id: tool-goal
  89. name: '@deepseek-ai/dsh-tool-goal'
  90. # ── plan mode ───────────────────────────────────────────────────────────────
  91. # Plan state is per-agent by nature, so an entry-local realm is not a
  92. # workaround here — it is the correct lifetime.
  93. - id: planning
  94. name: cordis:group
  95. group: true
  96. isolate:
  97. planMode: true
  98. config:
  99. - id: plan-mode
  100. name: '@deepseek-ai/dsh-plan-mode'
  101. config:
  102. section: |
  103. You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
  104. Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
  105. The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
  106. Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
  107. Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
  108. When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
  109. # ── compaction ──────────────────────────────────────────────────────────────
  110. # `compaction-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
  111. # share this realm rather than sit outside it.
  112. #
  113. # `tokenMeter` is deliberately NOT in this realm: the meter stays on the HOST
  114. # plane, and the rows here resolve that one instance. It takes no configuration,
  115. # keys every fold by Session, and owns the context-meter projection units the
  116. # browser reads for every session — behind a realm those units would come and go
  117. # with whichever presets happen to be mounted. What a preset chooses is whether
  118. # its agent compacts at all, which is `compaction-basic` below.
  119. - id: compaction
  120. name: cordis:group
  121. group: true
  122. isolate:
  123. compaction: true
  124. toolResultPruner: true
  125. config:
  126. - id: compaction-basic
  127. name: '@deepseek-ai/dsh-compaction-basic'
  128. - id: command-compact
  129. name: '@deepseek-ai/dsh-command-compact'
  130. - id: tool-result-pruner
  131. name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
  132. config:
  133. thresholdChars: 8192
  134. headChars: 4096
  135. tailChars: 1024
  136. # ── delegation and workflows ────────────────────────────────────────────────
  137. # The `subagents` registry and its spawn/fork backends live in the HOST
  138. # composition: the registry is a process singleton whose cross-session queries
  139. # the api-proxy serves to the browser, and a provider name may only be
  140. # registered once. This preset contributes the delegation TOOLS, which resolve
  141. # that host registry.
  142. #
  143. # `workflows` is different — nothing outside an agent reads it — so every row
  144. # that reaches it shares one entry-local realm here, and a consumer left
  145. # outside would resolve a host registry this preset does not populate.
  146. - id: delegation
  147. name: cordis:group
  148. group: true
  149. isolate:
  150. workflowEngine: true
  151. config:
  152. - id: tool-subagent-control
  153. name: '@deepseek-ai/dsh-tool-subagent-control'
  154. - id: tool-subagent-list-agents
  155. name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
  156. - id: tool-subagent
  157. name: '@deepseek-ai/dsh-tool-subagent'
  158. config:
  159. provider: spawn
  160. toolName: subagent
  161. backgroundMode: continuable
  162. - id: tool-subagent-fork
  163. name: '@deepseek-ai/dsh-tool-subagent'
  164. config:
  165. provider: fork
  166. toolName: subagent_fork
  167. backgroundMode: continuable
  168. # Production dsh does not install these optional providers. An opting-in
  169. # Profile mounts each provider once on the host plane; copy this preset,
  170. # then remove `disabled` from the matching tool row.
  171. - id: tool-subagent-codex
  172. name: '@deepseek-ai/dsh-tool-subagent'
  173. disabled: true
  174. config:
  175. provider: codex
  176. toolName: subagent_codex
  177. backgroundMode: one-shot
  178. maxDepth: provider-managed
  179. - id: tool-subagent-claude-code
  180. name: '@deepseek-ai/dsh-tool-subagent'
  181. disabled: true
  182. config:
  183. provider: claude-code
  184. toolName: subagent_claude_code
  185. backgroundMode: one-shot
  186. maxDepth: provider-managed
  187. - id: workflow-worker-thread
  188. name: '@deepseek-ai/dsh-workflow-worker-thread'
  189. config:
  190. provider: spawn
  191. - id: tool-workflow
  192. name: '@deepseek-ai/dsh-tool-workflow'
  193. - id: tool-ralph
  194. name: '@deepseek-ai/dsh-tool-ralph'
  195. config:
  196. subagentProvider: spawn
  197. maxRounds: 64
  198. # ── remaining model-facing rows ─────────────────────────────────────────────
  199. - id: tool-ask-user
  200. name: '@deepseek-ai/dsh-tool-ask-user'
  201. - id: tool-todo
  202. name: '@deepseek-ai/dsh-tool-todo'
  203. config:
  204. allowParallelInProgress: true
  205. # The `web` service and its search provider stay in the host composition; only
  206. # the model-facing tool is per-session.
  207. - id: tool-web
  208. name: '@deepseek-ai/dsh-tool-web'
  209. config:
  210. fetch: false
  211. searchTimeoutMs: 60000
  212. # ── presentation ────────────────────────────────────────────────────────────
  213. # Code Mode for this agent alone. The row waits for the host's `codeRuntime`
  214. # rather than assuming it: a deployment that composes no TypeScript runtime
  215. # fails this preset at mount, naming this id, instead of at the first request.
  216. - id: tool-presentation
  217. name: '@deepseek-ai/dsh-agent-tool-presentation'
  218. config:
  219. mode: code