cordis.yml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. # Full-screen TUI coding agent with swappable DeepSeek and local-bash backends.
  2. # `dsh-tui-demo` supplies the agent spine, workspace instructions, generic
  3. # task controls, JSONL persistence, the pi-tui front door, and `main`.
  4. # HMR remains a leaf because it depends on Loader internals. The app bin loads
  5. # the gitignored root `.env`; this file reads `DEEPSEEK_API_KEY` and optional
  6. # `DEEPSEEK_BASE_URL` through `!!js`.
  7. - id: hmr
  8. name: '@cordisjs/plugin-hmr'
  9. config:
  10. root: ['.']
  11. # The native DeepSeek adapter. Shipped default: full thinking at max effort on
  12. # every request (wire-only defaults; they never enter the request header).
  13. - id: llm-deepseek
  14. name: '@deepseek-ai/dsh-llm-deepseek'
  15. config:
  16. apiKey: !!js process.env.DEEPSEEK_API_KEY
  17. baseURL: !!js process.env.DEEPSEEK_BASE_URL
  18. thinking: enabled
  19. reasoningEffort: max
  20. # Local executor for the app bundle's bash tool.
  21. # Managed child-process groups for the bash executor (spawn/kill/output plumbing).
  22. - id: subprocess
  23. name: '@deepseek-ai/dsh-subprocess-local'
  24. - id: bash
  25. name: '@deepseek-ai/dsh-bash-local'
  26. config:
  27. timeoutMs: 60000
  28. # The app bundle pre-creates the TUI's `main` agent.
  29. - id: tui-agent
  30. name: '@deepseek-ai/dsh-tui-demo'
  31. config:
  32. provider: deepseek
  33. model: deepseek-v4-pro
  34. # `dsh --resume <id>` provides the session id on the boot context (the ids
  35. # live under ./.sessions); with no flag the identifier is undefined and a
  36. # fresh session starts each run. The typeof guard tolerates a launcher that
  37. # never provides the slot, reading undefined rather than throwing.
  38. resumeSessionId: !!js "typeof resumeSessionId === 'string' ? resumeSessionId : undefined"
  39. persistenceRoot: './.sessions'
  40. # Printed on exit and listed by `/resume`; `{session}` fills the live id.
  41. # `dsh --resume <id>` resumes that session, so run it from this cwd.
  42. resumeCommand: 'dsh --resume {session}'
  43. workspaceContext:
  44. maxBytes: 65536
  45. ui:
  46. showReasoning: true
  47. maxToolOutputLines: 6
  48. # Keep the persona to identity and behavior; tool plugins own tool guidance.
  49. # The loop resolves {{model}} from this agent's configuration.
  50. persona: |
  51. You are a coding agent powered by the {{model}} model.
  52. Verify your work by running the code or tests. Keep answers brief and
  53. factual.
  54. # Model-made session titles on the first-message cadence: replaces the spine's
  55. # deterministic fallback title with a short model summary. The TUI renders the
  56. # logged `session/title` as the banner subtitle and the terminal window title.
  57. # Omitting provider/model inherits the main request's exact route.
  58. - id: session-title-llm
  59. name: '@deepseek-ai/dsh-session-title-first-message-llm'
  60. config:
  61. targetWords: 5
  62. targetCjkCharacters: 10
  63. maxInputBytes: 4096
  64. maxOutputTokens: 64
  65. timeoutMs: 60000
  66. # Replay-aware request pressure with one service-wide context window.
  67. - id: token-meter
  68. name: '@deepseek-ai/dsh-token-meter'
  69. - id: tool-result-prune
  70. name: '@deepseek-ai/dsh-compact-tool-result-prune'
  71. # Summarize an older range after measured pressure or a canonical provider overflow.
  72. # Service-wide policy provides pressure, retention, and one overflow-retry default.
  73. - id: compact-basic
  74. name: '@deepseek-ai/dsh-compact-basic'
  75. # Expose fresh-child `spawn` and completed-prefix `fork` through independent
  76. # in-process backends. Each tool instance needs a distinct `toolName`; the registry
  77. # rejects duplicates. These leaves follow the app because it provides `ctx.agents` and `ctx.tools`.
  78. - id: subagent
  79. name: '@deepseek-ai/dsh-subagent'
  80. - id: subagent-spawn
  81. name: '@deepseek-ai/dsh-subagent-spawn'
  82. config:
  83. providerName: spawn
  84. - id: subagent-fork
  85. name: '@deepseek-ai/dsh-subagent-fork'
  86. config:
  87. providerName: fork
  88. - id: tool-subagent
  89. name: '@deepseek-ai/dsh-tool-subagent'
  90. config:
  91. provider: spawn
  92. toolName: subagent
  93. - id: tool-subagent-fork
  94. name: '@deepseek-ai/dsh-tool-subagent'
  95. config:
  96. provider: fork
  97. toolName: subagent_fork
  98. # The worker-thread workflow engine fans a model-written JavaScript script's
  99. # `agent()` calls out through the spawn backend; the adjacent tool exposes it to the model.
  100. - id: workflow-workerthread
  101. name: '@deepseek-ai/dsh-workflow-workerthread'
  102. config:
  103. provider: spawn
  104. - id: tool-workflow
  105. name: '@deepseek-ai/dsh-tool-workflow'
  106. # A separate fixed consumer demonstrates fresh-agent Ralph iteration without
  107. # changing the workflow tool or same-session goal behavior.
  108. - id: tool-ralph
  109. name: '@deepseek-ai/dsh-tool-ralph'
  110. # Plan mode gives the TUI plugin-owned /plan [message] entry and /plan off exit
  111. # commands; the reviewed exit rides the TUI's user-interaction provider.
  112. - id: plan-mode
  113. name: '@deepseek-ai/dsh-plan-mode'
  114. config:
  115. section: |
  116. 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.
  117. 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.
  118. 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.
  119. 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.
  120. 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.
  121. 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.
  122. # Policy loads before the model-facing filesystem tools so writes and edits require
  123. # an observed file. This single-session app resolves relative paths from the process cwd.
  124. - id: fs-local
  125. name: '@deepseek-ai/dsh-fs-local'
  126. config:
  127. cwd: !!js process.cwd()
  128. - id: fs-policy
  129. name: '@deepseek-ai/dsh-fs-policy'
  130. - id: tool-fs
  131. name: '@deepseek-ai/dsh-tool-fs'
  132. # Bash-backed discovery tools (glob/grep): fixed ripgrep commands through the
  133. # local bash executor above — not ctx.fs. Capped results save the complete
  134. # formatted list through the spill backend below (ctx.spillStore, optional).
  135. - id: tool-fs-search
  136. name: '@deepseek-ai/dsh-tool-fs-search'
  137. # The tool-call timeout enforcer: arms each declared ToolDefinition.timeoutMs
  138. # (the search tools above declare 30s) as a deadline on exec.signal. Without
  139. # it a declared budget is advisory and only the bash executor's own timeout
  140. # backstop applies.
  141. - id: timeout-policy
  142. name: '@deepseek-ai/dsh-timeout-policy'
  143. # Tool-output spill stack: a local backend that saves oversized tool text under
  144. # a private session-scoped dir, and the tools/post-execute policy that replaces
  145. # an over-budget plain-text result with a preview + the spill locator/retrieval
  146. # hint. A leaf pair after the app (needs ctx.tools). The policy is a no-op until
  147. # a tool returns more than maxInlineBytes of plain text.
  148. - id: spill-local
  149. name: '@deepseek-ai/dsh-spill-local'
  150. - id: spill-policy
  151. name: '@deepseek-ai/dsh-spill-policy'
  152. config:
  153. maxInlineBytes: 50000