cordis.yml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # The coding-agent plugin tree: the real coding agent. The two swappable
  2. # backends — the DeepSeek adapter and the local bash executor — plus `hmr` for
  3. # the dev/demo reload loop, then the stdio chat app (@deepseek-ai/dsh-stdio-
  4. # agent), which bundles the whole agent-core spine (timer, llm, sessions,
  5. # system-prompt, tools, agents, invariants, tool-bash, agent-loop), the console
  6. # logger, JSONL persistence, the readline UI, and a pre-created `main` agent.
  7. #
  8. # `hmr` is a leaf entry (not baked into dsh-stdio-agent): it is a Loader-only
  9. # dev plugin that needs `--expose-internals` — the `demo:coding` script passes
  10. # it. Requires DEEPSEEK_API_KEY (and optionally DEEPSEEK_BASE_URL) in the
  11. # environment — the dsh-stdio-agent bin loads the gitignored repo-root .env
  12. # first. cordis.yml reads them via the `!!js` tag.
  13. # Hot-module reload for the dev/demo loop (needs `node --expose-internals`).
  14. - id: hmr
  15. name: '@cordisjs/plugin-hmr'
  16. config:
  17. root: ['.']
  18. # The DeepSeek adapter. Swap to '@deepseek-ai/dsh-llm-pi-ai' for the pi-ai-backed
  19. # twin (same config shape; `reasoning: high` replaces thinking/reasoningEffort).
  20. - id: llm-deepseek
  21. name: '@deepseek-ai/dsh-llm-deepseek'
  22. config:
  23. apiKey: !!js process.env.DEEPSEEK_API_KEY
  24. baseURL: !!js process.env.DEEPSEEK_BASE_URL
  25. models:
  26. - deepseek-v4-flash
  27. - deepseek-v4-pro
  28. # Local bash executor for agent-core's tool-bash schema.
  29. # FIXME(config-comments): keep this executor note from implying bash is the
  30. # whole tool set; subagent and todo_write are loaded below.
  31. - id: bash
  32. name: '@deepseek-ai/dsh-bash-local'
  33. config:
  34. timeoutMs: 60000
  35. # The stdio chat app: the whole spine + front-door cluster, configured for a
  36. # real coding agent driving a pre-created `main` agent.
  37. - id: stdio-agent
  38. name: '@deepseek-ai/dsh-stdio-agent'
  39. config:
  40. model: deepseek-v4-flash
  41. # Set RESUME_SESSION_ID to continue a prior persisted session (the ids live
  42. # under ./.sessions); unset starts a fresh session each run.
  43. resumeSessionId: !!js process.env.RESUME_SESSION_ID
  44. persistenceRoot: './.sessions'
  45. welcome: 'coding-agent ready. Give it a coding task (its tools are bash, subagent, and todo_write).'
  46. systemPrompt: |
  47. You are coding-agent, a CLI coding assistant.
  48. Your tools are bash (plus bash_output/bash_kill for background
  49. tasks) and subagent. Do ALL file operations through bash: read with
  50. cat/sed/head, search with grep, write with heredocs (cat <<'EOF' >
  51. file), edit with sed or a rewrite. Each bash call runs in a fresh
  52. shell — pass workdir instead of cd, and never rely on shell state
  53. between calls.
  54. Use the subagent tool to delegate a focused, self-contained subtask
  55. to a fresh child agent (it works in its own context and returns only
  56. its final result) — give it a complete, standalone instruction. Use
  57. subagent_fork instead when the subtask needs THIS conversation's
  58. context: the child inherits the log so far.
  59. Check the [exit code: N] marker on every command; investigate
  60. failures before moving on. Verify your work by running the code or
  61. tests. Keep answers brief and factual.
  62. For multi-step work, use the todo_write tool to track a task list:
  63. send the WHOLE list each call (it replaces the previous one), keep at
  64. most one task in_progress (exactly one while work remains), and mark a
  65. task completed as soon as it is done. Skip it for trivial single-step
  66. tasks.
  67. # Automatic context compaction: when the derived history approaches the model's
  68. # context window, summarize an older range into a checkpoint so a long-running
  69. # or tool-heavy session keeps fitting. A leaf entry (needs ctx.llm + the
  70. # agent-loop's `agent/pre-step` seam from the app above).
  71. - id: compact-basic
  72. name: '@deepseek-ai/dsh-compact-basic'
  73. config:
  74. contextWindow: 128000
  75. thresholdRatio: 0.8
  76. retainTokens: 20480
  77. summarizationModel: ''
  78. maxTokens: 8192
  79. compactionRetries: 1
  80. # The subagent seam + BOTH in-process backends + two model-facing tools, as leaf
  81. # entries after the app (which provides ctx.agents/ctx.tools). spawn (a fresh
  82. # child) and fork (a child seeded with the parent's completed-turn prefix) are
  83. # independent backends over the shared dsh-subagent-inprocess driver. Exposing
  84. # both transports is pure config: load each backend, then load dsh-tool-subagent
  85. # once per backend with a distinct toolName (the tool registry rejects a
  86. # duplicate name) — no code change.
  87. - id: subagent
  88. name: '@deepseek-ai/dsh-subagent'
  89. - id: subagent-spawn
  90. name: '@deepseek-ai/dsh-subagent-spawn'
  91. config:
  92. providerName: spawn
  93. - id: subagent-fork
  94. name: '@deepseek-ai/dsh-subagent-fork'
  95. config:
  96. providerName: fork
  97. - id: tool-subagent
  98. name: '@deepseek-ai/dsh-tool-subagent'
  99. config:
  100. provider: spawn
  101. toolName: subagent
  102. - id: tool-subagent-fork
  103. name: '@deepseek-ai/dsh-tool-subagent'
  104. config:
  105. provider: fork
  106. toolName: subagent_fork
  107. # The model-facing todo_write tool: whole-list task tracking written to the
  108. # session log (todo/write), rendered as a stdio checklist / ACP plan.
  109. - id: tool-todo
  110. name: '@deepseek-ai/dsh-tool-todo'