cordis.yml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 (one of several tool
  29. # stacks in this tree: filesystem, subagent, and todo_write load below).
  30. - id: bash
  31. name: '@deepseek-ai/dsh-bash-local'
  32. config:
  33. timeoutMs: 60000
  34. # The stdio chat app: the whole spine + front-door cluster, configured for a
  35. # REPL agent demo driving a pre-created `main` agent.
  36. - id: stdio-agent
  37. name: '@deepseek-ai/dsh-stdio-agent'
  38. config:
  39. model: deepseek-v4-flash
  40. # Set RESUME_SESSION_ID to continue a prior persisted session (the ids live
  41. # under ./.sessions); unset starts a fresh session each run.
  42. resumeSessionId: !!js process.env.RESUME_SESSION_ID
  43. persistenceRoot: './.sessions'
  44. welcome: 'agent REPL ready. Give it a coding task.'
  45. # The persona: identity + behavior only, nothing about transports or
  46. # tooling — tool guidance lives with each tool plugin (descriptions +
  47. # prompt sections). {{model}} is the prompt variable the agent loop
  48. # resolves from this agent's configured model.
  49. persona: |
  50. You are coding-agent, a coding assistant powered by the {{model}} model.
  51. Verify your work by running the code or tests. Keep answers brief and
  52. factual.
  53. # Automatic context compaction: when the derived history approaches the model's
  54. # context window, summarize an older range into a checkpoint so a long-running
  55. # or tool-heavy session keeps fitting. A leaf entry (needs ctx.llm + the
  56. # agent-loop's `agent/pre-step` seam from the app above).
  57. - id: compact-basic
  58. name: '@deepseek-ai/dsh-compact-basic'
  59. config:
  60. contextWindow: 128000
  61. thresholdRatio: 0.8
  62. retainTokens: 20480
  63. summarizationModel: ''
  64. maxTokens: 8192
  65. compactionRetries: 1
  66. # The subagent seam + BOTH in-process backends + two model-facing tools, as leaf
  67. # entries after the app (which provides ctx.agents/ctx.tools). spawn (a fresh
  68. # child) and fork (a child seeded with the parent's completed-turn prefix) are
  69. # independent backends over the shared dsh-subagent-inprocess driver. Exposing
  70. # both transports is pure config: load each backend, then load dsh-tool-subagent
  71. # once per backend with a distinct toolName (the tool registry rejects a
  72. # duplicate name) — no code change.
  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. # Dynamic workflows: the worker-thread engine (ctx.workflows) over the spawn
  94. # subagent backend above, plus the model-facing `workflow` tool. The model
  95. # writes a JavaScript orchestration script (meta + body); the engine runs it
  96. # in its own worker thread and fans agent() calls out as spawn children.
  97. - id: workflow-workerthread
  98. name: '@deepseek-ai/dsh-workflow-workerthread'
  99. config:
  100. provider: spawn
  101. - id: tool-workflow
  102. name: '@deepseek-ai/dsh-tool-workflow'
  103. # The model-facing todo_write tool: whole-list task tracking written to the
  104. # session log (todo/write), rendered as a stdio checklist / ACP plan.
  105. - id: tool-todo
  106. name: '@deepseek-ai/dsh-tool-todo'
  107. # Filesystem capability stack: local provider, read-before-write/edit policy
  108. # gate, then the model-facing read/write/edit tools. stdio-agent is a single
  109. # session, so relative paths resolve from the process cwd (the workspace).
  110. - id: fs-local
  111. name: '@deepseek-ai/dsh-fs-local'
  112. config:
  113. cwd: !!js process.cwd()
  114. - id: fs-policy
  115. name: '@deepseek-ai/dsh-fs-policy'
  116. - id: tool-fs
  117. name: '@deepseek-ai/dsh-tool-fs'