cordis.yml 8.2 KB

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