cordis.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. # Summarize an older range when derived history approaches the context window.
  43. # This leaf consumes `ctx.llm` and the app's `agent/pre-step` seam.
  44. - id: compact-basic
  45. name: '@deepseek-ai/dsh-compact-basic'
  46. config:
  47. contextWindow: 128000
  48. thresholdRatio: 0.8
  49. retainTokens: 20480
  50. summarizationProvider: ''
  51. summarizationModel: ''
  52. maxTokens: 8192
  53. compactionRetries: 1
  54. # Expose fresh-child `spawn` and completed-prefix `fork` through independent
  55. # in-process backends. Each tool instance needs a distinct `toolName`; the registry
  56. # rejects duplicates. These leaves follow the app because it provides `ctx.agents` and `ctx.tools`.
  57. - id: subagent
  58. name: '@deepseek-ai/dsh-subagent'
  59. - id: subagent-spawn
  60. name: '@deepseek-ai/dsh-subagent-spawn'
  61. config:
  62. providerName: spawn
  63. - id: subagent-fork
  64. name: '@deepseek-ai/dsh-subagent-fork'
  65. config:
  66. providerName: fork
  67. - id: tool-subagent
  68. name: '@deepseek-ai/dsh-tool-subagent'
  69. config:
  70. provider: spawn
  71. toolName: subagent
  72. - id: tool-subagent-fork
  73. name: '@deepseek-ai/dsh-tool-subagent'
  74. config:
  75. provider: fork
  76. toolName: subagent_fork
  77. # The worker-thread workflow engine fans a model-written JavaScript script's
  78. # `agent()` calls out through the spawn backend; the adjacent tool exposes it to the model.
  79. - id: workflow-workerthread
  80. name: '@deepseek-ai/dsh-workflow-workerthread'
  81. config:
  82. provider: spawn
  83. - id: tool-workflow
  84. name: '@deepseek-ai/dsh-tool-workflow'
  85. # `todo_write` replaces the logged whole list and renders as a stdio checklist or ACP plan.
  86. - id: tool-todo
  87. name: '@deepseek-ai/dsh-tool-todo'
  88. # Policy loads before the model-facing filesystem tools so writes and edits require
  89. # an observed file. This single-session app resolves relative paths from the process cwd.
  90. - id: fs-local
  91. name: '@deepseek-ai/dsh-fs-local'
  92. config:
  93. cwd: !!js process.cwd()
  94. - id: fs-policy
  95. name: '@deepseek-ai/dsh-fs-policy'
  96. - id: tool-fs
  97. name: '@deepseek-ai/dsh-tool-fs'
  98. # Bash-backed discovery tools (glob/grep): fixed ripgrep commands through the
  99. # local bash executor above — not ctx.fs. Capped results save the complete
  100. # formatted list through the spill backend below (ctx.spillStore, optional).
  101. - id: tool-fs-search
  102. name: '@deepseek-ai/dsh-tool-fs-search'
  103. # The tool-call timeout enforcer: arms each declared ToolDefinition.timeoutMs
  104. # (the search tools above declare 30s) as a deadline on exec.signal. Without
  105. # it a declared budget is advisory and only the bash executor's own timeout
  106. # backstop applies.
  107. - id: timeout-policy
  108. name: '@deepseek-ai/dsh-timeout-policy'
  109. # Tool-output spill stack: a local backend that saves oversized tool text under
  110. # a private session-scoped dir, and the tools/post-execute policy that replaces
  111. # an over-budget plain-text result with a preview + the spill locator/retrieval
  112. # hint. A leaf pair after the app (needs ctx.tools). The policy is a no-op until
  113. # a tool returns more than maxInlineBytes of plain text.
  114. - id: spill-local
  115. name: '@deepseek-ai/dsh-spill-local'
  116. - id: spill-policy
  117. name: '@deepseek-ai/dsh-spill-policy'
  118. config:
  119. maxInlineBytes: 50000