cordis.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. # Readline coding REPL with swappable DeepSeek and local-bash backends.
  2. # `dsh-stdio-demo` supplies the agent spine, workspace instructions, generic
  3. # task controls, JSONL persistence, the line-oriented front door, and `main`.
  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. ui:
  37. mode: readline
  38. # Keep the persona to identity and behavior; tool plugins own tool guidance.
  39. # The loop resolves {{model}} from this agent's configuration.
  40. persona: |
  41. You are coding-agent, a coding assistant powered by the {{model}} model.
  42. Verify your work by running the code or tests. Keep answers brief and
  43. factual.
  44. # Replay-aware request pressure with one service-wide context window.
  45. - id: token-meter
  46. name: '@deepseek-ai/dsh-token-meter'
  47. # Summarize an older range when measured history approaches the context window.
  48. # Service-wide policy provides the ordinary threshold and retained-tail defaults.
  49. - id: compact-basic
  50. name: '@deepseek-ai/dsh-compact-basic'
  51. # Expose fresh-child `spawn` and completed-prefix `fork` through independent
  52. # in-process backends. Each tool instance needs a distinct `toolName`; the registry
  53. # rejects duplicates. These leaves follow the app because it provides `ctx.agents` and `ctx.tools`.
  54. - id: subagent
  55. name: '@deepseek-ai/dsh-subagent'
  56. - id: subagent-spawn
  57. name: '@deepseek-ai/dsh-subagent-spawn'
  58. config:
  59. providerName: spawn
  60. - id: subagent-fork
  61. name: '@deepseek-ai/dsh-subagent-fork'
  62. config:
  63. providerName: fork
  64. - id: tool-subagent
  65. name: '@deepseek-ai/dsh-tool-subagent'
  66. config:
  67. provider: spawn
  68. toolName: subagent
  69. - id: tool-subagent-fork
  70. name: '@deepseek-ai/dsh-tool-subagent'
  71. config:
  72. provider: fork
  73. toolName: subagent_fork
  74. # The worker-thread workflow engine fans a model-written JavaScript script's
  75. # `agent()` calls out through the spawn backend; the adjacent tool exposes it to the model.
  76. - id: workflow-workerthread
  77. name: '@deepseek-ai/dsh-workflow-workerthread'
  78. config:
  79. provider: spawn
  80. - id: tool-workflow
  81. name: '@deepseek-ai/dsh-tool-workflow'
  82. # `todo_write` replaces the logged whole list and renders as a stdio checklist or ACP plan.
  83. - id: tool-todo
  84. name: '@deepseek-ai/dsh-tool-todo'
  85. # Policy loads before the model-facing filesystem tools so writes and edits require
  86. # an observed file. This single-session app resolves relative paths from the process cwd.
  87. - id: fs-local
  88. name: '@deepseek-ai/dsh-fs-local'
  89. config:
  90. cwd: !!js process.cwd()
  91. - id: fs-policy
  92. name: '@deepseek-ai/dsh-fs-policy'
  93. - id: tool-fs
  94. name: '@deepseek-ai/dsh-tool-fs'
  95. # Bash-backed discovery tools (glob/grep): fixed ripgrep commands through the
  96. # local bash executor above — not ctx.fs. Capped results save the complete
  97. # formatted list through the spill backend below (ctx.spillStore, optional).
  98. - id: tool-fs-search
  99. name: '@deepseek-ai/dsh-tool-fs-search'
  100. # The tool-call timeout enforcer: arms each declared ToolDefinition.timeoutMs
  101. # (the search tools above declare 30s) as a deadline on exec.signal. Without
  102. # it a declared budget is advisory and only the bash executor's own timeout
  103. # backstop applies.
  104. - id: timeout-policy
  105. name: '@deepseek-ai/dsh-timeout-policy'
  106. # Tool-output spill stack: a local backend that saves oversized tool text under
  107. # a private session-scoped dir, and the tools/post-execute policy that replaces
  108. # an over-budget plain-text result with a preview + the spill locator/retrieval
  109. # hint. A leaf pair after the app (needs ctx.tools). The policy is a no-op until
  110. # a tool returns more than maxInlineBytes of plain text.
  111. - id: spill-local
  112. name: '@deepseek-ai/dsh-spill-local'
  113. - id: spill-policy
  114. name: '@deepseek-ai/dsh-spill-policy'
  115. config:
  116. maxInlineBytes: 50000