cordis.yml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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, workflow, 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. Use the workflow tool ONLY when the user explicitly asks for a
  61. workflow or for large multi-agent orchestration: you write a
  62. JavaScript script (its description documents the exact format) that
  63. fans work out across many subagents with phases and structured
  64. results. For one or two delegations, prefer plain subagent calls.
  65. Check the [exit code: N] marker on every command; investigate
  66. failures before moving on. Verify your work by running the code or
  67. tests. Keep answers brief and factual.
  68. For multi-step work, use the todo_write tool to track a task list:
  69. send the WHOLE list each call (it replaces the previous one), keep at
  70. most one task in_progress (exactly one while work remains), and mark a
  71. task completed as soon as it is done. Skip it for trivial single-step
  72. tasks.
  73. # Automatic context compaction: when the derived history approaches the model's
  74. # context window, summarize an older range into a checkpoint so a long-running
  75. # or tool-heavy session keeps fitting. A leaf entry (needs ctx.llm + the
  76. # agent-loop's `agent/pre-step` seam from the app above).
  77. - id: compact-basic
  78. name: '@deepseek-ai/dsh-compact-basic'
  79. config:
  80. contextWindow: 128000
  81. thresholdRatio: 0.8
  82. retainTokens: 20480
  83. summarizationModel: ''
  84. maxTokens: 8192
  85. compactionRetries: 1
  86. # The subagent seam + BOTH in-process backends + two model-facing tools, as leaf
  87. # entries after the app (which provides ctx.agents/ctx.tools). spawn (a fresh
  88. # child) and fork (a child seeded with the parent's completed-turn prefix) are
  89. # independent backends over the shared dsh-subagent-inprocess driver. Exposing
  90. # both transports is pure config: load each backend, then load dsh-tool-subagent
  91. # once per backend with a distinct toolName (the tool registry rejects a
  92. # duplicate name) — no code change.
  93. - id: subagent
  94. name: '@deepseek-ai/dsh-subagent'
  95. - id: subagent-spawn
  96. name: '@deepseek-ai/dsh-subagent-spawn'
  97. config:
  98. providerName: spawn
  99. - id: subagent-fork
  100. name: '@deepseek-ai/dsh-subagent-fork'
  101. config:
  102. providerName: fork
  103. - id: tool-subagent
  104. name: '@deepseek-ai/dsh-tool-subagent'
  105. config:
  106. provider: spawn
  107. toolName: subagent
  108. - id: tool-subagent-fork
  109. name: '@deepseek-ai/dsh-tool-subagent'
  110. config:
  111. provider: fork
  112. toolName: subagent_fork
  113. # Dynamic workflows: the node:vm engine (ctx.workflows) over the spawn subagent
  114. # backend above, plus the model-facing `workflow` tool. The model writes a
  115. # JavaScript orchestration script (meta + body); the engine runs it in-process
  116. # and fans agent() calls out as spawn children.
  117. - id: workflow-vm
  118. name: '@deepseek-ai/dsh-workflow-vm'
  119. config:
  120. provider: spawn
  121. - id: tool-workflow
  122. name: '@deepseek-ai/dsh-tool-workflow'
  123. # The model-facing todo_write tool: whole-list task tracking written to the
  124. # session log (todo/write), rendered as a stdio checklist / ACP plan.
  125. - id: tool-todo
  126. name: '@deepseek-ai/dsh-tool-todo'
  127. # Filesystem capability stack: local provider, read-before-write/edit policy
  128. # gate, then the model-facing read/write/edit tools. stdio-agent is a single
  129. # session, so relative paths resolve from the process cwd (the workspace).
  130. - id: fs-local
  131. name: '@deepseek-ai/dsh-fs-local'
  132. config:
  133. cwd: !!js process.cwd()
  134. - id: fs-policy
  135. name: '@deepseek-ai/dsh-fs-policy'
  136. - id: tool-fs
  137. name: '@deepseek-ai/dsh-tool-fs'