cordis.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # The code-agent plugin tree: the Code Mode demo. The same spine as
  2. # examples/coding-agent — the DeepSeek adapter, local bash, filesystem and
  3. # todo tool stacks over the stdio chat app — with TWO differences that turn
  4. # it into Cloudflare-style Code Mode:
  5. #
  6. # 1. `code-runtime` loads the worker-thread code-execution backend
  7. # (`ctx.codeRuntime`): one fresh Node worker per run, TypeScript in.
  8. # 2. `stdio-agent` sets `tools: { mode: code }`, so the model is offered
  9. # exactly ONE wire tool — `run_code` — plus a generated TypeScript SDK
  10. # prompt section declaring bash/read/write/edit/todo_write; the model
  11. # composes them by WRITING A PROGRAM, and only what it prints or
  12. # returns re-enters its context.
  13. #
  14. # Requires DEEPSEEK_API_KEY (and optionally DEEPSEEK_BASE_URL) in the
  15. # environment — the dsh-stdio-agent bin loads the gitignored repo-root .env
  16. # first. cordis.yml reads them via the `!!js` tag.
  17. # Hot-module reload for the dev/demo loop (needs `node --expose-internals`).
  18. - id: hmr
  19. name: '@cordisjs/plugin-hmr'
  20. config:
  21. root: ['.']
  22. # The DeepSeek adapter.
  23. - id: llm-deepseek
  24. name: '@deepseek-ai/dsh-llm-deepseek'
  25. config:
  26. apiKey: !!js process.env.DEEPSEEK_API_KEY
  27. baseURL: !!js process.env.DEEPSEEK_BASE_URL
  28. models:
  29. - deepseek-v4-pro
  30. - deepseek-v4-flash
  31. # Local bash executor for the spine's `bash` tool schemas.
  32. - id: bash
  33. name: '@deepseek-ai/dsh-bash-local'
  34. config:
  35. timeoutMs: 60000
  36. # The code-execution backend: `run_code` programs execute here, in one fresh
  37. # worker thread per run with an empty environment, port-bridged tool
  38. # bindings, and busy-time/wall-clock/heap caps (all overridable here).
  39. - id: code-runtime
  40. name: '@deepseek-ai/dsh-code-runtime-worker'
  41. # The stdio chat app with the registry flipped to Code Mode: the wire tool
  42. # list collapses to [run_code] and the `tools:sdk` prompt section carries the
  43. # generated TypeScript declarations for every other registered tool.
  44. - id: stdio-agent
  45. name: '@deepseek-ai/dsh-stdio-agent'
  46. config:
  47. model: deepseek-v4-flash
  48. tools:
  49. mode: code
  50. # Set RESUME_SESSION_ID to continue a prior persisted session (the ids
  51. # live under ./.sessions); unset starts a fresh session each run.
  52. resumeSessionId: !!js process.env.RESUME_SESSION_ID
  53. persistenceRoot: './.sessions'
  54. welcome: 'code-mode agent ready. Give it a multi-tool task.'
  55. persona: |
  56. You are code-agent, a coding assistant powered by the {{model}} model.
  57. You work by writing TypeScript programs for run_code: batch related
  58. tool work into one program, loop and branch where it helps, and print
  59. or return ONLY the findings that matter.
  60. # The model-facing todo_write tool: whole-list task tracking written to the
  61. # session log (todo/write), rendered as a stdio checklist.
  62. - id: tool-todo
  63. name: '@deepseek-ai/dsh-tool-todo'
  64. # Filesystem capability stack: local provider, read-before-write/edit policy
  65. # gate, then the model-facing read/write/edit tools — all reachable from a
  66. # run_code program as `tools.read(...)` / `tools.write(...)` / `tools.edit(...)`.
  67. - id: fs-local
  68. name: '@deepseek-ai/dsh-fs-local'
  69. config:
  70. cwd: !!js process.cwd()
  71. - id: fs-policy
  72. name: '@deepseek-ai/dsh-fs-policy'
  73. - id: tool-fs
  74. name: '@deepseek-ai/dsh-tool-fs'