cordis.yml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  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. # Projection registry: drives every registered domain unit over committed
  18. # session events and serves finished values (history-tail projections block +
  19. # session/projection frames). Without this row every domain's optional unit
  20. # injection stays silent — no block, no frames, no titles/todos on the web.
  21. - id: session-projection
  22. name: '@deepseek-ai/dsh-session-projection'
  23. - id: session-title
  24. name: '@deepseek-ai/dsh-session-title'
  25. config:
  26. fallbackMaxWords: 5
  27. fallbackMaxBytes: 40
  28. maxTitleBytes: 80
  29. # Model-made titles on the first-message cadence (the web sidebar renders
  30. # session/title). Same values as the TUI composition.
  31. - id: session-title-llm
  32. name: '@deepseek-ai/dsh-session-title-first-message-llm'
  33. config:
  34. targetWords: 5
  35. targetCjkCharacters: 10
  36. maxInputBytes: 4096
  37. maxOutputTokens: 64
  38. timeoutMs: 60000
  39. - id: system-prompt
  40. name: '@deepseek-ai/dsh-system-prompt'
  41. config:
  42. persona: ''
  43. - id: tools
  44. name: '@deepseek-ai/dsh-tools'
  45. config:
  46. # TEMPORARY workaround: DSH_TOOLS_MODE (native|code|both) opts a whole dsh
  47. # process into Code Mode while per-session tool-mode selection is being
  48. # designed; unset keeps the schema default (native). Remove the env seam
  49. # once the web UI owns the choice per session.
  50. mode: !!js process.env.DSH_TOOLS_MODE
  51. # Code Mode substrate for the row above. Mounted unconditionally because
  52. # Loader metadata is static (no conditional rows): a native-mode boot only
  53. # registers the service — a worker thread spawns per run_code execution.
  54. - id: code-runtime
  55. name: '@deepseek-ai/dsh-code-runtime-worker'
  56. - id: user-interaction
  57. name: '@deepseek-ai/dsh-user-interaction'
  58. - id: agent
  59. name: '@deepseek-ai/dsh-agent'
  60. - id: tasks
  61. name: '@deepseek-ai/dsh-tasks-local'
  62. - id: agent-loop
  63. name: '@deepseek-ai/dsh-agent-loop'
  64. config:
  65. agents: []
  66. # The native DeepSeek adapter; reads the key/base-url the boot's layered
  67. # .env loading (cwd then $DSH_HOME) left in the environment.
  68. - id: llm-deepseek
  69. name: '@deepseek-ai/dsh-llm-deepseek'
  70. config:
  71. apiKey: !!js process.env.DEEPSEEK_API_KEY
  72. baseURL: !!js process.env.DEEPSEEK_BASE_URL
  73. # Common pi-ai provider routes read credentials and endpoint overrides from the
  74. # boot's layered environment.
  75. - id: llm-pi-ai
  76. name: '@deepseek-ai/dsh-llm-pi-ai'
  77. config:
  78. providers:
  79. - provider: openai
  80. apiKey: !!js process.env.OPENAI_API_KEY
  81. baseURL: !!js process.env.OPENAI_BASE_URL
  82. - provider: anthropic
  83. apiKey: !!js process.env.ANTHROPIC_API_KEY
  84. baseURL: !!js process.env.ANTHROPIC_BASE_URL
  85. # Transient-failure recovery around the loop's model calls (same policy as
  86. # the TUI's agent-spine composition; defaults: 2 retries, 500ms→10s backoff).
  87. - id: llm-retry
  88. name: '@deepseek-ai/dsh-llm-retry'
  89. # Session store root. AppCLIEntry resolves the engineering default to a
  90. # global dir under the Harness home ($DSH_HOME, else ~/.dsh): sessions live
  91. # in one place across every cwd, not a project-local ./.sessions. The
  92. # persistenceRoot profile key (user config) still overrides this per field.
  93. - id: session-persistence-jsonl
  94. name: '@deepseek-ai/dsh-session-persistence-jsonl'
  95. config:
  96. root: './.sessions'
  97. - id: storage
  98. name: '@deepseek-ai/dsh-storage'
  99. - id: storage-json
  100. name: '@deepseek-ai/dsh-storage-json'
  101. config:
  102. root: './.storages'
  103. - id: storage-domain
  104. name: '@deepseek-ai/dsh-storage-domain'
  105. config:
  106. backend: json
  107. - id: workspace
  108. name: '@deepseek-ai/dsh-workspace'
  109. # Persisted projection cache: durable per-session checkpoints of every
  110. # registered projection unit (json backend → ./.storages/session_projcache.json,
  111. # beside workspace.json), throttled between the two mandatory points
  112. # (turn/end + detach), serving cold listings without full-log loads.
  113. - id: session-projection-cache
  114. name: '@deepseek-ai/dsh-session-projection-cache'
  115. config:
  116. writeEveryEvents: 200
  117. writeIntervalMs: 5000
  118. # Managed child-process groups for the bash executor (spawn/kill/output plumbing).
  119. - id: subprocess
  120. name: '@deepseek-ai/dsh-subprocess-local'
  121. # The sandboxed product path (the acp-agent composition): per-platform
  122. # runner provider, the shared policy home, the confined bash executor, and
  123. # the approval seam its escalation asks through. The web deployment default
  124. # is danger-full-access + never (same behavior as the former bash-local
  125. # rows); DSH_PERMISSION_MODE opts a process into a confined default, and
  126. # per-session switches ride the /permission command's knob events.
  127. - id: sandbox
  128. name: '@deepseek-ai/dsh-sandbox-local'
  129. - id: sandbox-policy
  130. name: '@deepseek-ai/dsh-sandbox-policy'
  131. config:
  132. mode: !!js process.env.DSH_PERMISSION_MODE ?? 'danger-full-access'
  133. workspaceRoot: !!js process.cwd()
  134. - id: bash-sandbox
  135. name: '@deepseek-ai/dsh-bash-sandbox'
  136. - id: approval
  137. name: '@deepseek-ai/dsh-user-approval'
  138. config:
  139. policy: !!js "(process.env.DSH_PERMISSION_MODE ?? 'danger-full-access') === 'danger-full-access' ? 'never' : 'ask'"
  140. # Presets over the two knobs (requires the confining executor + approval):
  141. # the web permission chip's table, served through the permissions projection
  142. # and switched through /permission.
  143. - id: permission
  144. name: '@deepseek-ai/dsh-permission'
  145. config:
  146. presets:
  147. read-only:
  148. sandbox: read-only
  149. approval: ask
  150. workspace-write:
  151. sandbox: workspace-write
  152. approval: ask
  153. danger-full-access:
  154. sandbox: danger-full-access
  155. approval: never
  156. - id: tool-bash
  157. name: '@deepseek-ai/dsh-tool-bash'
  158. - id: tool-todo
  159. name: '@deepseek-ai/dsh-tool-todo'
  160. - id: tool-tasks
  161. name: '@deepseek-ai/dsh-tool-tasks'
  162. # fs cwd stays the package default (process.cwd()) — the same value the
  163. # gateway injects into session.cwd, so paths and sessions agree. The
  164. # sandboxed backend rides the SAME policy as bash: write/edit fence by the
  165. # effective mode, so read/write/edit stay available under every mode.
  166. - id: fs-sandbox
  167. name: '@deepseek-ai/dsh-fs-sandbox'
  168. - id: fs-policy
  169. name: '@deepseek-ai/dsh-fs-policy'
  170. - id: tool-fs
  171. name: '@deepseek-ai/dsh-tool-fs'
  172. - id: tool-fs-search
  173. name: '@deepseek-ai/dsh-tool-fs-search'
  174. - id: workspace-context
  175. name: '@deepseek-ai/dsh-workspace-context'
  176. config:
  177. maxBytes: 65536
  178. - id: skill
  179. name: '@deepseek-ai/dsh-skill'
  180. - id: skill-local
  181. name: '@deepseek-ai/dsh-skill-local'
  182. - id: tool-skill
  183. name: '@deepseek-ai/dsh-tool-skill'
  184. # Host command registry: the single source of truth behind command.list /
  185. # command.execute; the web '/' menu is a pure projection of this registry.
  186. - id: commands
  187. name: '@deepseek-ai/dsh-commands'
  188. # Goal service + automatic same-session continuation + the /goal command.
  189. # The GoalService registers the 'goal' session projection unit; the web
  190. # GoalBar reads it through useProjection.
  191. - id: goal
  192. name: '@deepseek-ai/dsh-goal'
  193. - id: goal-session
  194. name: '@deepseek-ai/dsh-goal-session'
  195. - id: command-goal
  196. name: '@deepseek-ai/dsh-command-goal'
  197. # Plan mode registers /plan (the first real command on the web surface).
  198. # Section text mirrors examples/tui-agent/cordis.yml (the reference
  199. # deployment); plan-mode throws at load on an empty section.
  200. - id: plan-mode
  201. name: '@deepseek-ai/dsh-plan-mode'
  202. config:
  203. section: |
  204. 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.
  205. 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.
  206. 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.
  207. 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.
  208. 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.
  209. 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.
  210. # token-meter rejects unknown config keys — keep this row bare.
  211. - id: token-meter
  212. name: '@deepseek-ai/dsh-token-meter'
  213. - id: compact-basic
  214. name: '@deepseek-ai/dsh-compact-basic'
  215. - id: subagent
  216. name: '@deepseek-ai/dsh-subagent'
  217. - id: subagent-spawn
  218. name: '@deepseek-ai/dsh-subagent-spawn'
  219. config:
  220. providerName: spawn
  221. - id: subagent-fork
  222. name: '@deepseek-ai/dsh-subagent-fork'
  223. config:
  224. providerName: fork
  225. - id: tool-subagent
  226. name: '@deepseek-ai/dsh-tool-subagent'
  227. config:
  228. provider: spawn
  229. toolName: subagent
  230. - id: tool-subagent-fork
  231. name: '@deepseek-ai/dsh-tool-subagent'
  232. config:
  233. provider: fork
  234. toolName: subagent_fork
  235. - id: workflow-workerthread
  236. name: '@deepseek-ai/dsh-workflow-workerthread'
  237. config:
  238. provider: spawn
  239. - id: tool-workflow
  240. name: '@deepseek-ai/dsh-tool-workflow'
  241. - id: timeout-policy
  242. name: '@deepseek-ai/dsh-timeout-policy'
  243. - id: spill-local
  244. name: '@deepseek-ai/dsh-spill-local'
  245. # Omitting maxInlineBytes makes the whole policy a silent no-op — always
  246. # state it explicitly.
  247. - id: spill-policy
  248. name: '@deepseek-ai/dsh-spill-policy'
  249. config:
  250. maxInlineBytes: 50000
  251. # The API gateway: the transport-agnostic dispatch face every client shape
  252. # shares. provider/model are the host default routing — the profile json's
  253. # mapping target (user config overrides these engineering defaults).
  254. # Directory-picking package, dual-face: the node half serves the gateway's
  255. # host.* picker RPCs, the browser half fills ui-workspace's directory-flow
  256. # slots — one row composes the whole interaction. Swap point: mount
  257. # '-native' instead for the host-display OS chooser.
  258. - id: directory-picker
  259. name: '@deepseek-ai/dsh-host-directory-picker-browse'
  260. - id: api-gateway
  261. name: '@deepseek-ai/dsh-host-apiproxy'
  262. config:
  263. provider: deepseek
  264. model: deepseek-v4-flash
  265. # ── layer 2: transport/service ──────────────────────────────────────────────
  266. # Plain route-registration carrier. distIndex is an assembly fact, not user
  267. # config — AppCLIEntry resolves the frontend dist and patches it in; host and
  268. # port arrive as CLI-flag patches over these defaults.
  269. - id: webserver
  270. name: '@deepseek-ai/dsh-host-webserver'
  271. config:
  272. host: 127.0.0.1
  273. port: 3080
  274. # ── browser plugin roster (dshClient rows; node halves are layer-2 hosts) ──
  275. # Dual-face: node half scans this very tree for dshClient rows, composes
  276. # window.__DSH_BOOT__, serves /plugins/<id>/client.js; browser half is the
  277. # module table the shell kernel constructs before cordis exists (§4.7 —
  278. # adopted as a plugin entry by the kernel, never fetched).
  279. - id: modules
  280. name: '@deepseek-ai/dsh-client-modules'
  281. # Owns both ends of the web transport: node half binds the gateway to the
  282. # webserver under /api; browser half is the fetch/SSE client.
  283. - id: connection
  284. name: '@deepseek-ai/dsh-client-connection'
  285. - id: client-runtime
  286. name: '@deepseek-ai/dsh-client-runtime'
  287. - id: ui-theme
  288. name: '@deepseek-ai/dsh-client-ui-theme'
  289. - id: locale
  290. name: '@deepseek-ai/dsh-client-locale'
  291. - id: ui-layout
  292. name: '@deepseek-ai/dsh-client-ui-layout'
  293. - id: ui-sidebar
  294. name: '@deepseek-ai/dsh-client-ui-sidebar'
  295. - id: ui-settings
  296. name: '@deepseek-ai/dsh-client-ui-settings'
  297. - id: ui-settings-general
  298. name: '@deepseek-ai/dsh-client-ui-settings-general'
  299. - id: ui-models
  300. name: '@deepseek-ai/dsh-client-ui-models'
  301. - id: ui-conversation
  302. name: '@deepseek-ai/dsh-client-ui-conversation'
  303. - id: ui-workspace
  304. name: '@deepseek-ai/dsh-client-ui-workspace'
  305. # Input triggers: the '/' | '@' pipeline (ui-slash), the command surface over
  306. # it (ui-command), and the two reference sources (ui-skill / ui-subagent).
  307. - id: ui-slash
  308. name: '@deepseek-ai/dsh-client-ui-slash'
  309. - id: ui-command
  310. name: '@deepseek-ai/dsh-client-ui-command'
  311. - id: ui-skill
  312. name: '@deepseek-ai/dsh-client-ui-skill'
  313. - id: ui-subagent
  314. name: '@deepseek-ai/dsh-client-ui-subagent'
  315. # Goal surface: GoalBar in the input dock over the goal session projection.
  316. - id: ui-goal
  317. name: '@deepseek-ai/dsh-client-ui-goal'
  318. # Model selection: the /model popupSelect + composer seat over session.models.
  319. - id: ui-model
  320. name: '@deepseek-ai/dsh-client-ui-model'
  321. # The /permission popup picker (hostBacked over the host /permission command).
  322. - id: ui-permission
  323. name: '@deepseek-ai/dsh-client-ui-permission'
  324. # Plan control: the composer plan seat over the plan projection + /plan channel.
  325. - id: ui-plan
  326. name: '@deepseek-ai/dsh-client-ui-plan'
  327. - id: ui-question
  328. name: '@deepseek-ai/dsh-client-ui-question'
  329. - id: ui-trajectory
  330. name: '@deepseek-ai/dsh-client-ui-trajectory'