cordis.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. # dsh web — the full web-shape composition: host runtime (layer 1), the
  2. # transport/service layer (layer 2), and the browser plugin roster (dshClient
  3. # rows the modules node half scans into window.__DSH_BOOT__). Row order
  4. # carries no load semantics (activation is service-availability driven); the
  5. # grouping below is for readers. `--dev` appends the dsh-client-hmr row in
  6. # code (AppCLIEntry) — prod and dev differ by exactly that one row.
  7. # AppCLIEntry patches this tree before boot: profile json + CLI flags +
  8. # distIndex land as config patches over the rows below (yaml = engineering
  9. # defaults, json = user config, user wins per field).
  10. # ── layer 1: runtime ────────────────────────────────────────────────────────
  11. - id: timer
  12. name: '@cordisjs/plugin-timer'
  13. - id: llm
  14. name: '@deepseek-ai/dsh-llm'
  15. - id: session
  16. name: '@deepseek-ai/dsh-session'
  17. - id: session-title
  18. name: '@deepseek-ai/dsh-session-title'
  19. config:
  20. fallbackMaxWords: 5
  21. fallbackMaxBytes: 40
  22. maxTitleBytes: 80
  23. # Model-made titles on the first-message cadence (the web sidebar renders
  24. # session/title). Same values as the TUI composition.
  25. - id: session-title-llm
  26. name: '@deepseek-ai/dsh-session-title-first-message-llm'
  27. config:
  28. targetWords: 5
  29. targetCjkCharacters: 10
  30. maxInputBytes: 4096
  31. maxOutputTokens: 64
  32. timeoutMs: 60000
  33. - id: system-prompt
  34. name: '@deepseek-ai/dsh-system-prompt'
  35. config:
  36. persona: ''
  37. - id: tools
  38. name: '@deepseek-ai/dsh-tools'
  39. config:
  40. # TEMPORARY workaround: DSH_TOOLS_MODE (native|code|both) opts a whole dsh
  41. # process into Code Mode while per-session tool-mode selection is being
  42. # designed; unset keeps the schema default (native). Remove the env seam
  43. # once the web UI owns the choice per session.
  44. mode: !!js process.env.DSH_TOOLS_MODE
  45. # Code Mode substrate for the row above. Mounted unconditionally because
  46. # Loader metadata is static (no conditional rows): a native-mode boot only
  47. # registers the service — a worker thread spawns per run_code execution.
  48. - id: code-runtime
  49. name: '@deepseek-ai/dsh-code-runtime-worker'
  50. - id: user-interaction
  51. name: '@deepseek-ai/dsh-user-interaction'
  52. - id: agent
  53. name: '@deepseek-ai/dsh-agent'
  54. - id: tasks
  55. name: '@deepseek-ai/dsh-tasks-local'
  56. - id: agent-loop
  57. name: '@deepseek-ai/dsh-agent-loop'
  58. config:
  59. agents: []
  60. # The native DeepSeek adapter; reads the key/base-url the boot's layered
  61. # .env loading (cwd then $DSH_HOME) left in the environment.
  62. - id: llm-deepseek
  63. name: '@deepseek-ai/dsh-llm-deepseek'
  64. config:
  65. apiKey: !!js process.env.DEEPSEEK_API_KEY
  66. baseURL: !!js process.env.DEEPSEEK_BASE_URL
  67. # Transient-failure recovery around the loop's model calls (same policy as
  68. # the TUI's agent-spine composition; defaults: 2 retries, 500ms→10s backoff).
  69. - id: llm-retry
  70. name: '@deepseek-ai/dsh-llm-retry'
  71. # Session store root. AppCLIEntry resolves the engineering default to a
  72. # global dir under the Harness home ($DSH_HOME, else ~/.dsh): sessions live
  73. # in one place across every cwd, not a project-local ./.sessions. The
  74. # persistenceRoot profile key (user config) still overrides this per field.
  75. - id: session-persistence-jsonl
  76. name: '@deepseek-ai/dsh-session-persistence-jsonl'
  77. config:
  78. root: './.sessions'
  79. - id: storage
  80. name: '@deepseek-ai/dsh-storage'
  81. - id: storage-json
  82. name: '@deepseek-ai/dsh-storage-json'
  83. config:
  84. root: './.storages'
  85. - id: storage-domain
  86. name: '@deepseek-ai/dsh-storage-domain'
  87. config:
  88. backend: json
  89. - id: workspace
  90. name: '@deepseek-ai/dsh-workspace'
  91. # Managed child-process groups for the bash executor (spawn/kill/output plumbing).
  92. - id: subprocess
  93. name: '@deepseek-ai/dsh-subprocess-local'
  94. - id: bash-local
  95. name: '@deepseek-ai/dsh-bash-local'
  96. - id: tool-bash
  97. name: '@deepseek-ai/dsh-tool-bash'
  98. - id: tool-todo
  99. name: '@deepseek-ai/dsh-tool-todo'
  100. - id: tool-tasks
  101. name: '@deepseek-ai/dsh-tool-tasks'
  102. # fs cwd stays the package default (process.cwd()) — the same value the
  103. # gateway injects into session.cwd, so paths and sessions agree.
  104. - id: fs-local
  105. name: '@deepseek-ai/dsh-fs-local'
  106. - id: fs-policy
  107. name: '@deepseek-ai/dsh-fs-policy'
  108. - id: tool-fs
  109. name: '@deepseek-ai/dsh-tool-fs'
  110. - id: tool-fs-search
  111. name: '@deepseek-ai/dsh-tool-fs-search'
  112. - id: workspace-context
  113. name: '@deepseek-ai/dsh-workspace-context'
  114. config:
  115. maxBytes: 65536
  116. - id: skill
  117. name: '@deepseek-ai/dsh-skill'
  118. - id: skill-local
  119. name: '@deepseek-ai/dsh-skill-local'
  120. - id: tool-skill
  121. name: '@deepseek-ai/dsh-tool-skill'
  122. # Host command registry: the single source of truth behind command.list /
  123. # command.execute; the web '/' menu is a pure projection of this registry.
  124. - id: commands
  125. name: '@deepseek-ai/dsh-commands'
  126. # Plan mode registers /plan (the first real command on the web surface).
  127. # Section text mirrors examples/tui-agent/cordis.yml (the reference
  128. # deployment); plan-mode throws at load on an empty section.
  129. - id: plan-mode
  130. name: '@deepseek-ai/dsh-plan-mode'
  131. config:
  132. section: |
  133. 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.
  134. 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.
  135. 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 only to keep the request shape stable. 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.
  136. 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.
  137. 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.
  138. 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.
  139. # token-meter rejects unknown config keys — keep this row bare.
  140. - id: token-meter
  141. name: '@deepseek-ai/dsh-token-meter'
  142. - id: compact-basic
  143. name: '@deepseek-ai/dsh-compact-basic'
  144. - id: subagent
  145. name: '@deepseek-ai/dsh-subagent'
  146. - id: subagent-spawn
  147. name: '@deepseek-ai/dsh-subagent-spawn'
  148. config:
  149. providerName: spawn
  150. - id: subagent-fork
  151. name: '@deepseek-ai/dsh-subagent-fork'
  152. config:
  153. providerName: fork
  154. - id: tool-subagent
  155. name: '@deepseek-ai/dsh-tool-subagent'
  156. config:
  157. provider: spawn
  158. toolName: subagent
  159. - id: tool-subagent-fork
  160. name: '@deepseek-ai/dsh-tool-subagent'
  161. config:
  162. provider: fork
  163. toolName: subagent_fork
  164. - id: workflow-workerthread
  165. name: '@deepseek-ai/dsh-workflow-workerthread'
  166. config:
  167. provider: spawn
  168. - id: tool-workflow
  169. name: '@deepseek-ai/dsh-tool-workflow'
  170. - id: timeout-policy
  171. name: '@deepseek-ai/dsh-timeout-policy'
  172. - id: spill-local
  173. name: '@deepseek-ai/dsh-spill-local'
  174. # Omitting maxInlineBytes makes the whole policy a silent no-op — always
  175. # state it explicitly.
  176. - id: spill-policy
  177. name: '@deepseek-ai/dsh-spill-policy'
  178. config:
  179. maxInlineBytes: 50000
  180. # The API gateway: the transport-agnostic dispatch face every client shape
  181. # shares. provider/model are the host default routing — the profile json's
  182. # mapping target (user config overrides these engineering defaults).
  183. - id: api-gateway
  184. name: '@deepseek-ai/dsh-host-apiproxy'
  185. config:
  186. provider: deepseek
  187. model: deepseek-v4-flash
  188. # ── layer 2: transport/service ──────────────────────────────────────────────
  189. # Plain route-registration carrier. distIndex is an assembly fact, not user
  190. # config — AppCLIEntry resolves the frontend dist and patches it in; host and
  191. # port arrive as CLI-flag patches over these defaults.
  192. - id: webserver
  193. name: '@deepseek-ai/dsh-host-webserver'
  194. config:
  195. host: 127.0.0.1
  196. port: 3080
  197. # ── browser plugin roster (dshClient rows; node halves are layer-2 hosts) ──
  198. # Dual-face: node half scans this very tree for dshClient rows, composes
  199. # window.__DSH_BOOT__, serves /plugins/<id>/client.js; browser half is the
  200. # module table the shell kernel constructs before cordis exists (§4.7 —
  201. # adopted as a plugin entry by the kernel, never fetched).
  202. - id: modules
  203. name: '@deepseek-ai/dsh-client-modules'
  204. # Owns both ends of the web transport: node half binds the gateway to the
  205. # webserver under /api; browser half is the fetch/SSE client.
  206. - id: connection
  207. name: '@deepseek-ai/dsh-client-connection'
  208. - id: client-runtime
  209. name: '@deepseek-ai/dsh-client-runtime'
  210. - id: ui-theme
  211. name: '@deepseek-ai/dsh-client-ui-theme'
  212. - id: locale
  213. name: '@deepseek-ai/dsh-client-locale'
  214. - id: ui-layout
  215. name: '@deepseek-ai/dsh-client-ui-layout'
  216. - id: ui-sidebar
  217. name: '@deepseek-ai/dsh-client-ui-sidebar'
  218. - id: ui-settings
  219. name: '@deepseek-ai/dsh-client-ui-settings'
  220. - id: ui-settings-general
  221. name: '@deepseek-ai/dsh-client-ui-settings-general'
  222. - id: ui-models
  223. name: '@deepseek-ai/dsh-client-ui-models'
  224. - id: ui-conversation
  225. name: '@deepseek-ai/dsh-client-ui-conversation'
  226. - id: ui-workspace
  227. name: '@deepseek-ai/dsh-client-ui-workspace'
  228. # Input triggers: the '/' | '@' pipeline (ui-slash), the command surface over
  229. # it (ui-command), and the two reference sources (ui-skill / ui-subagent).
  230. - id: ui-slash
  231. name: '@deepseek-ai/dsh-client-ui-slash'
  232. - id: ui-command
  233. name: '@deepseek-ai/dsh-client-ui-command'
  234. - id: ui-skill
  235. name: '@deepseek-ai/dsh-client-ui-skill'
  236. - id: ui-subagent
  237. name: '@deepseek-ai/dsh-client-ui-subagent'
  238. # Model selection: the /model popupSelect + composer seat over session.models.
  239. - id: ui-model
  240. name: '@deepseek-ai/dsh-client-ui-model'
  241. - id: ui-question
  242. name: '@deepseek-ai/dsh-client-ui-question'
  243. - id: ui-trajectory
  244. name: '@deepseek-ai/dsh-client-ui-trajectory'