cordis.yml 4.7 KB

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