| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- # REPL agent with swappable DeepSeek and local-bash backends. `dsh-stdio-demo`
- # supplies the agent spine, workspace instructions, generic task controls,
- # logging, JSONL persistence, readline UI, and `main` agent.
- # HMR remains a leaf because it requires Loader internals; `demo:repl` passes
- # `--expose-internals`. The app bin loads the gitignored root `.env`; this file
- # reads `DEEPSEEK_API_KEY` and optional `DEEPSEEK_BASE_URL` through `!!js`.
- # Hot-module reload for the dev/demo loop (needs `node --expose-internals`).
- - id: hmr
- name: '@cordisjs/plugin-hmr'
- config:
- root: ['.']
- # The native DeepSeek adapter.
- - id: llm-deepseek
- name: '@deepseek-ai/dsh-llm-deepseek'
- config:
- apiKey: !!js process.env.DEEPSEEK_API_KEY
- baseURL: !!js process.env.DEEPSEEK_BASE_URL
- # Local executor for the app bundle's bash tool.
- - id: bash
- name: '@deepseek-ai/dsh-bash-local'
- config:
- timeoutMs: 60000
- # The app bundle pre-creates the REPL's `main` agent.
- - id: stdio-agent
- name: '@deepseek-ai/dsh-stdio-demo'
- config:
- provider: deepseek
- model: deepseek-v4-flash
- # Set RESUME_SESSION_ID to continue a prior persisted session (the ids live
- # under ./.sessions); unset starts a fresh session each run.
- resumeSessionId: !!js process.env.RESUME_SESSION_ID
- persistenceRoot: './.sessions'
- workspaceContext:
- maxBytes: 65536
- welcome: 'agent REPL ready. Give it a coding task.'
- # Keep the persona to identity and behavior; tool plugins own tool guidance.
- # The loop resolves {{model}} from this agent's configuration.
- persona: |
- You are coding-agent, a coding assistant powered by the {{model}} model.
- Verify your work by running the code or tests. Keep answers brief and
- factual.
- # Replay-aware request pressure with one service-wide context window.
- - id: token-meter
- name: '@deepseek-ai/dsh-token-meter'
- # Summarize an older range when measured history approaches the context window.
- # Service-wide policy provides the ordinary threshold and retained-tail defaults.
- - id: compact-basic
- name: '@deepseek-ai/dsh-compact-basic'
- # Expose fresh-child `spawn` and completed-prefix `fork` through independent
- # in-process backends. Each tool instance needs a distinct `toolName`; the registry
- # rejects duplicates. These leaves follow the app because it provides `ctx.agents` and `ctx.tools`.
- - id: subagent
- name: '@deepseek-ai/dsh-subagent'
- - id: subagent-spawn
- name: '@deepseek-ai/dsh-subagent-spawn'
- config:
- providerName: spawn
- - id: subagent-fork
- name: '@deepseek-ai/dsh-subagent-fork'
- config:
- providerName: fork
- - id: tool-subagent
- name: '@deepseek-ai/dsh-tool-subagent'
- config:
- provider: spawn
- toolName: subagent
- - id: tool-subagent-fork
- name: '@deepseek-ai/dsh-tool-subagent'
- config:
- provider: fork
- toolName: subagent_fork
- # The worker-thread workflow engine fans a model-written JavaScript script's
- # `agent()` calls out through the spawn backend; the adjacent tool exposes it to the model.
- - id: workflow-workerthread
- name: '@deepseek-ai/dsh-workflow-workerthread'
- config:
- provider: spawn
- - id: tool-workflow
- name: '@deepseek-ai/dsh-tool-workflow'
- # `todo_write` replaces the logged whole list and renders as a stdio checklist or ACP plan.
- - id: tool-todo
- name: '@deepseek-ai/dsh-tool-todo'
- # Policy loads before the model-facing filesystem tools so writes and edits require
- # an observed file. This single-session app resolves relative paths from the process cwd.
- - id: fs-local
- name: '@deepseek-ai/dsh-fs-local'
- config:
- cwd: !!js process.cwd()
- - id: fs-policy
- name: '@deepseek-ai/dsh-fs-policy'
- - id: tool-fs
- name: '@deepseek-ai/dsh-tool-fs'
- # Bash-backed discovery tools (glob/grep): fixed ripgrep commands through the
- # local bash executor above — not ctx.fs. Capped results save the complete
- # formatted list through the spill backend below (ctx.spillStore, optional).
- - id: tool-fs-search
- name: '@deepseek-ai/dsh-tool-fs-search'
- # The tool-call timeout enforcer: arms each declared ToolDefinition.timeoutMs
- # (the search tools above declare 30s) as a deadline on exec.signal. Without
- # it a declared budget is advisory and only the bash executor's own timeout
- # backstop applies.
- - id: timeout-policy
- name: '@deepseek-ai/dsh-timeout-policy'
- # Tool-output spill stack: a local backend that saves oversized tool text under
- # a private session-scoped dir, and the tools/post-execute policy that replaces
- # an over-budget plain-text result with a preview + the spill locator/retrieval
- # hint. A leaf pair after the app (needs ctx.tools). The policy is a no-op until
- # a tool returns more than maxInlineBytes of plain text.
- - id: spill-local
- name: '@deepseek-ai/dsh-spill-local'
- - id: spill-policy
- name: '@deepseek-ai/dsh-spill-policy'
- config:
- maxInlineBytes: 50000
|