cordis.yml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. # The coding-agent plugin tree: the REPL agent demo. 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:repl` 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-pro
  27. - deepseek-v4-flash
  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; filesystem, 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. # REPL agent demo 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: 'agent REPL ready. Give it a coding task (its tools are read, write, edit, bash, subagent, and todo_write).'
  46. systemPrompt: |
  47. You are coding-agent, a CLI coding assistant.
  48. Your tools are read/write/edit for file operations, bash (plus
  49. bash_output/bash_kill for background tasks), and subagent. Use read to
  50. inspect UTF-8 text files, write to create or replace files, and edit for
  51. targeted literal replacements. Use bash for shell commands, tests,
  52. searches, and operations that are not ordinary file reads or edits. Each
  53. bash call runs in a fresh shell — pass workdir instead of cd, and never
  54. rely on shell state between calls.
  55. Use the subagent tool to delegate a focused, self-contained subtask
  56. to a fresh child agent (it works in its own context and returns only
  57. its final result) — give it a complete, standalone instruction. Use
  58. subagent_fork instead when the subtask needs THIS conversation's
  59. context: the child inherits the log so far.
  60. Check the [exit code: N] marker on every command; investigate
  61. failures before moving on. Verify your work by running the code or
  62. tests. Keep answers brief and factual.
  63. For multi-step work, use the todo_write tool to track a task list:
  64. send the WHOLE list each call (it replaces the previous one), keep at
  65. most one task in_progress (exactly one while work remains), and mark a
  66. task completed as soon as it is done. Skip it for trivial single-step
  67. tasks.
  68. # Automatic context compaction: when the derived history approaches the model's
  69. # context window, summarize an older range into a checkpoint so a long-running
  70. # or tool-heavy session keeps fitting. A leaf entry (needs ctx.llm + the
  71. # agent-loop's `agent/pre-step` seam from the app above).
  72. - id: compact-basic
  73. name: '@deepseek-ai/dsh-compact-basic'
  74. config:
  75. contextWindow: 128000
  76. thresholdRatio: 0.8
  77. retainTokens: 20480
  78. summarizationModel: ''
  79. maxTokens: 8192
  80. compactionRetries: 1
  81. # The subagent seam + BOTH in-process backends + two model-facing tools, as leaf
  82. # entries after the app (which provides ctx.agents/ctx.tools). spawn (a fresh
  83. # child) and fork (a child seeded with the parent's completed-turn prefix) are
  84. # independent backends over the shared dsh-subagent-inprocess driver. Exposing
  85. # both transports is pure config: load each backend, then load dsh-tool-subagent
  86. # once per backend with a distinct toolName (the tool registry rejects a
  87. # duplicate name) — no code change.
  88. - id: subagent
  89. name: '@deepseek-ai/dsh-subagent'
  90. - id: subagent-spawn
  91. name: '@deepseek-ai/dsh-subagent-spawn'
  92. config:
  93. providerName: spawn
  94. - id: subagent-fork
  95. name: '@deepseek-ai/dsh-subagent-fork'
  96. config:
  97. providerName: fork
  98. - id: tool-subagent
  99. name: '@deepseek-ai/dsh-tool-subagent'
  100. config:
  101. provider: spawn
  102. toolName: subagent
  103. - id: tool-subagent-fork
  104. name: '@deepseek-ai/dsh-tool-subagent'
  105. config:
  106. provider: fork
  107. toolName: subagent_fork
  108. # The model-facing todo_write tool: whole-list task tracking written to the
  109. # session log (todo/write), rendered as a stdio checklist / ACP plan.
  110. - id: tool-todo
  111. name: '@deepseek-ai/dsh-tool-todo'
  112. # Filesystem capability stack: local provider, read-before-write/edit policy
  113. # gate, then the model-facing read/write/edit tools. stdio-agent is a single
  114. # session, so relative paths resolve from the process cwd (the workspace).
  115. - id: fs-local
  116. name: '@deepseek-ai/dsh-fs-local'
  117. config:
  118. cwd: !!js process.cwd()
  119. - id: fs-policy
  120. name: '@deepseek-ai/dsh-fs-policy'
  121. - id: tool-fs
  122. name: '@deepseek-ai/dsh-tool-fs'