cordis.yml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. # Coding agent with swappable DeepSeek and local-bash backends. `dsh-stdio-demo`
  2. # supplies the agent spine, workspace instructions, generic task controls,
  3. # JSONL persistence, TTY-selected `dsh-tui`/`dsh-stdio` terminal front doors,
  4. # readline logging, and `main` agent.
  5. # HMR remains a leaf because it requires Loader internals; `demo:repl` passes
  6. # `--expose-internals`. The app bin loads the gitignored root `.env`; this file
  7. # reads `DEEPSEEK_API_KEY` and optional `DEEPSEEK_BASE_URL` through `!!js`.
  8. # Hot-module reload for the dev/demo loop (needs `node --expose-internals`).
  9. - id: hmr
  10. name: '@cordisjs/plugin-hmr'
  11. config:
  12. root: ['.']
  13. # The native DeepSeek adapter.
  14. - id: llm-deepseek
  15. name: '@deepseek-ai/dsh-llm-deepseek'
  16. config:
  17. apiKey: !!js process.env.DEEPSEEK_API_KEY
  18. baseURL: !!js process.env.DEEPSEEK_BASE_URL
  19. # Local executor for the app bundle's bash tool.
  20. - id: bash
  21. name: '@deepseek-ai/dsh-bash-local'
  22. config:
  23. timeoutMs: 60000
  24. # The app bundle pre-creates the REPL's `main` agent.
  25. - id: stdio-agent
  26. name: '@deepseek-ai/dsh-stdio-demo'
  27. config:
  28. provider: deepseek
  29. model: deepseek-v4-flash
  30. # Set RESUME_SESSION_ID to continue a prior persisted session (the ids live
  31. # under ./.sessions); unset starts a fresh session each run.
  32. resumeSessionId: !!js process.env.RESUME_SESSION_ID
  33. persistenceRoot: './.sessions'
  34. workspaceContext:
  35. maxBytes: 65536
  36. welcome: 'agent REPL ready. Give it a coding task.'
  37. ui:
  38. mode: auto
  39. tui:
  40. showReasoning: true
  41. maxToolOutputLines: 12
  42. # Keep the persona to identity and behavior; tool plugins own tool guidance.
  43. # The loop resolves {{model}} from this agent's configuration.
  44. persona: |
  45. You are coding-agent, a coding assistant powered by the {{model}} model.
  46. Verify your work by running the code or tests. Keep answers brief and
  47. factual.
  48. # Replay-aware request pressure with one service-wide context window.
  49. - id: token-meter
  50. name: '@deepseek-ai/dsh-token-meter'
  51. # Summarize an older range when measured history approaches the context window.
  52. # Service-wide policy provides the ordinary threshold and retained-tail defaults.
  53. - id: compact-basic
  54. name: '@deepseek-ai/dsh-compact-basic'
  55. # Expose fresh-child `spawn` and completed-prefix `fork` through independent
  56. # in-process backends. Each tool instance needs a distinct `toolName`; the registry
  57. # rejects duplicates. These leaves follow the app because it provides `ctx.agents` and `ctx.tools`.
  58. - id: subagent
  59. name: '@deepseek-ai/dsh-subagent'
  60. - id: subagent-spawn
  61. name: '@deepseek-ai/dsh-subagent-spawn'
  62. config:
  63. providerName: spawn
  64. - id: subagent-fork
  65. name: '@deepseek-ai/dsh-subagent-fork'
  66. config:
  67. providerName: fork
  68. - id: tool-subagent
  69. name: '@deepseek-ai/dsh-tool-subagent'
  70. config:
  71. provider: spawn
  72. toolName: subagent
  73. - id: tool-subagent-fork
  74. name: '@deepseek-ai/dsh-tool-subagent'
  75. config:
  76. provider: fork
  77. toolName: subagent_fork
  78. # The worker-thread workflow engine fans a model-written JavaScript script's
  79. # `agent()` calls out through the spawn backend; the adjacent tool exposes it to the model.
  80. - id: workflow-workerthread
  81. name: '@deepseek-ai/dsh-workflow-workerthread'
  82. config:
  83. provider: spawn
  84. - id: tool-workflow
  85. name: '@deepseek-ai/dsh-tool-workflow'
  86. # `todo_write` replaces the logged whole list and renders as a stdio checklist or ACP plan.
  87. - id: tool-todo
  88. name: '@deepseek-ai/dsh-tool-todo'
  89. # Policy loads before the model-facing filesystem tools so writes and edits require
  90. # an observed file. This single-session app resolves relative paths from the process cwd.
  91. - id: fs-local
  92. name: '@deepseek-ai/dsh-fs-local'
  93. config:
  94. cwd: !!js process.cwd()
  95. - id: fs-policy
  96. name: '@deepseek-ai/dsh-fs-policy'
  97. - id: tool-fs
  98. name: '@deepseek-ai/dsh-tool-fs'
  99. # Bash-backed discovery tools (glob/grep): fixed ripgrep commands through the
  100. # local bash executor above — not ctx.fs. Capped results save the complete
  101. # formatted list through the spill backend below (ctx.spillStore, optional).
  102. - id: tool-fs-search
  103. name: '@deepseek-ai/dsh-tool-fs-search'
  104. # The tool-call timeout enforcer: arms each declared ToolDefinition.timeoutMs
  105. # (the search tools above declare 30s) as a deadline on exec.signal. Without
  106. # it a declared budget is advisory and only the bash executor's own timeout
  107. # backstop applies.
  108. - id: timeout-policy
  109. name: '@deepseek-ai/dsh-timeout-policy'
  110. # Tool-output spill stack: a local backend that saves oversized tool text under
  111. # a private session-scoped dir, and the tools/post-execute policy that replaces
  112. # an over-budget plain-text result with a preview + the spill locator/retrieval
  113. # hint. A leaf pair after the app (needs ctx.tools). The policy is a no-op until
  114. # a tool returns more than maxInlineBytes of plain text.
  115. - id: spill-local
  116. name: '@deepseek-ai/dsh-spill-local'
  117. - id: spill-policy
  118. name: '@deepseek-ai/dsh-spill-policy'
  119. config:
  120. maxInlineBytes: 50000