base.cordis.yml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. # The shared `dsh` core. Raw `dsh --config <path>` applies its required patch
  2. # list directly over this file. Web and headless apply their shipped overlay,
  3. # followed by an explicit or personal user layer. Every layer addresses these
  4. # rows by id at one include level, with the last write winning per row.
  5. #
  6. # A patch replaces the targeted row's whole `config` rather than merging into
  7. # it, so a row whose value differs by mode does NOT live here: it belongs to
  8. # each overlay, keeping any single row down to one overlay layer plus the user's.
  9. # Mode-specific rows appear below only with shared plugin identity and neutral
  10. # defaults; each overlay restates its complete configuration.
  11. #
  12. # Row order carries no load semantics (activation is service-availability
  13. # driven); the grouping is for readers.
  14. - id: timer
  15. name: '@cordisjs/plugin-timer'
  16. - id: hmr
  17. name: '@cordisjs/plugin-hmr'
  18. config:
  19. root: ['.']
  20. # `$DSH_HOME/config.yaml` replaces this row's config to select exact GitHub
  21. # repository Plugin generations. The app registers the DSH-owned runtime even
  22. # when the list is empty so a later personal-config edit can load
  23. # transactionally; one-shot headless runs consume the startup value only.
  24. - id: repository-plugins
  25. name: '@deepseek-ai/dsh-repository-plugin'
  26. - id: llm
  27. name: '@deepseek-ai/dsh-llm'
  28. - id: session
  29. name: '@deepseek-ai/dsh-session'
  30. - id: session-title
  31. name: '@deepseek-ai/dsh-session-title'
  32. config:
  33. fallbackMaxWords: 5
  34. fallbackMaxBytes: 40
  35. maxTitleBytes: 80
  36. - id: session-title-llm
  37. name: '@deepseek-ai/dsh-session-title-first-message-llm'
  38. config:
  39. targetWords: 5
  40. targetCjkCharacters: 10
  41. maxInputBytes: 4096
  42. maxOutputTokens: 64
  43. timeoutMs: 60000
  44. - id: user-interaction
  45. name: '@deepseek-ai/dsh-user-interaction'
  46. - id: agent
  47. name: '@deepseek-ai/dsh-agent'
  48. - id: tasks
  49. name: '@deepseek-ai/dsh-tasks-local'
  50. - id: llm-retry
  51. name: '@deepseek-ai/dsh-llm-retry'
  52. # User-settings document (`$DSH_HOME/settings.yaml`, hot-reloaded): a
  53. # `llm-deepseek:` or `llm-pi-ai:` section there overrides the adapter entries
  54. # below without a restart, and is what the web Models page writes.
  55. - id: settings
  56. name: '@deepseek-ai/dsh-settings-local'
  57. # Credential store: the live process environment over `$DSH_HOME/.env`
  58. # (owner-only file, hot-reloaded). Adapters resolve their key references
  59. # through it at each request, so no key is inlined in this file. The web
  60. # Models page's key inputs write it through `credentials.set`; nothing hoists
  61. # the document into the process environment, which would make every stored key
  62. # read as an unrotatable ambient override.
  63. - id: credentials
  64. name: '@deepseek-ai/dsh-credentials-local'
  65. # The pi-ai multi-provider twin, mounted dormant: zero routes (and no extra
  66. # models in the picker) until a `llm-pi-ai:` settings section supplies provider
  67. # profiles — then those routes register live, keys resolving per request
  68. # through their apiKeyEnv references, and drop again when the section empties.
  69. # Supplying those profiles is exactly what the web Models page does. Which
  70. # adapters exist is composition; which providers run is the user's settings
  71. # document.
  72. - id: llm-pi-ai
  73. name: '@deepseek-ai/dsh-llm-pi-ai'
  74. - id: session-persistence-jsonl
  75. name: '@deepseek-ai/dsh-session-persistence-jsonl'
  76. config:
  77. root: !!js dshHomePath('sessions')
  78. # Raw configs can supply a process-local path or disable this shared session
  79. # capability. The neutral default is process-local and opens only when used.
  80. - id: session-query-sqlite
  81. name: '@deepseek-ai/dsh-session-query-sqlite'
  82. config:
  83. path: ':memory:'
  84. openAt: first-search
  85. # Session telemetry, on for every dsh mode: mirrors every session-log
  86. # event (assistant/chunk projected to first-of-step) plus ops markers onto
  87. # OTLP/HTTP log records, streaming on the batch processor's cadence
  88. # (10s/batch here) — not at exit; a crash loses at most the last unexported
  89. # interval. No telemetry/record redaction rule is mounted yet, so exports
  90. # are the raw captured copy; the deployment stance, env seams, and
  91. # follow-ups are pinned in the web-telemetry-default-mount Agent Note.
  92. # DSH_TELEMETRY_OTLP_URL overrides the production endpoint, and a non-empty
  93. # DSH_TELEMETRY_DISABLED — any value, including '0'/'false' — opts the
  94. # process out (the launchers patch the row disabled; config cannot disable
  95. # a row). Exports carry the harness home's anonymous user id ($DSH_HOME/.userid,
  96. # random UUID; delete the file to reset the identity) as the Resource's
  97. # user.id. The exporter/processor values normally bound the shutdown drain
  98. # to ~1s against an unreachable collector: exporter.timeoutMillis is both
  99. # the per-attempt socket timeout and the retry deadline (1s effectively
  100. # disables the SDK's 5-try backoff), while maxExportBatchSize == maxQueueSize
  101. # (both explicit) makes the drain a single batch. The SDK awaits
  102. # exporter.forceFlush() outside exportTimeoutMillis, so the backend's 3s
  103. # shutdownTimeoutMillis is the load-bearing outer bound when a transport
  104. # promise never settles. Every CLI exit path drains it by disposing the root
  105. # on SIGINT/SIGTERM.
  106. - id: telemetry-otel
  107. name: '@deepseek-ai/dsh-session-telemetry-otel'
  108. config:
  109. shutdownTimeoutMillis: 3000
  110. exporter:
  111. url: !!js process.env.DSH_TELEMETRY_OTLP_URL ?? 'https://harness-telemetry.deepseeksvc.com/v1/logs'
  112. compression: gzip
  113. timeoutMillis: 1000
  114. processor:
  115. scheduledDelayMillis: 10000
  116. maxQueueSize: 2048
  117. maxExportBatchSize: 2048
  118. exportTimeoutMillis: 1500
  119. - id: subprocess
  120. name: '@deepseek-ai/dsh-subprocess-local'
  121. # Every shipped CLI mode starts with the same file-effect boundary.
  122. # The environment remains an explicit deployment override; otherwise fresh
  123. # sessions pin workspace-write + ask through the permission service below.
  124. - id: sandbox
  125. name: '@deepseek-ai/dsh-sandbox-local'
  126. - id: sandbox-policy
  127. name: '@deepseek-ai/dsh-sandbox-policy'
  128. config:
  129. mode: !!js process.env.DSH_PERMISSION_MODE ?? 'workspace-write'
  130. workspaceRoot: !!js process.cwd()
  131. - id: bash-sandbox
  132. name: '@deepseek-ai/dsh-bash-sandbox'
  133. config:
  134. timeoutMs: 60000
  135. - id: approval
  136. name: '@deepseek-ai/dsh-user-approval'
  137. config:
  138. policy: !!js "(process.env.DSH_PERMISSION_MODE ?? 'workspace-write') === 'danger-full-access' ? 'never' : 'ask'"
  139. - id: permission
  140. name: '@deepseek-ai/dsh-permission'
  141. config:
  142. presets:
  143. read-only:
  144. sandbox: read-only
  145. approval: ask
  146. workspace-write:
  147. sandbox: workspace-write
  148. approval: ask
  149. danger-full-access:
  150. sandbox: danger-full-access
  151. approval: never
  152. - id: bash-env
  153. name: '@deepseek-ai/dsh-bash-env'
  154. - id: tool-bash
  155. name: '@deepseek-ai/dsh-tool-bash'
  156. - id: tool-tasks
  157. name: '@deepseek-ai/dsh-tool-tasks'
  158. - id: fs-policy
  159. name: '@deepseek-ai/dsh-fs-policy'
  160. - id: tool-fs
  161. name: '@deepseek-ai/dsh-tool-fs'
  162. - id: tool-fs-search
  163. name: '@deepseek-ai/dsh-tool-fs-search'
  164. config:
  165. sampleOverCapGlobResults: false
  166. - id: workspace-context
  167. name: '@deepseek-ai/dsh-workspace-context'
  168. config:
  169. maxBytes: 65536
  170. - id: skill
  171. name: '@deepseek-ai/dsh-skill'
  172. - id: skill-local
  173. name: '@deepseek-ai/dsh-skill-local'
  174. - id: tool-skill
  175. name: '@deepseek-ai/dsh-tool-skill'
  176. - id: commands
  177. name: '@deepseek-ai/dsh-commands'
  178. - id: goal
  179. name: '@deepseek-ai/dsh-goal'
  180. - id: goal-session
  181. name: '@deepseek-ai/dsh-goal-session'
  182. - id: command-goal
  183. name: '@deepseek-ai/dsh-command-goal'
  184. - id: plan-mode
  185. name: '@deepseek-ai/dsh-plan-mode'
  186. config:
  187. section: |
  188. You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
  189. Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
  190. The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed only to keep the request shape stable. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
  191. Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
  192. Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
  193. When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
  194. - id: token-meter
  195. name: '@deepseek-ai/dsh-token-meter'
  196. - id: compact-basic
  197. name: '@deepseek-ai/dsh-compact-basic'
  198. # Human `/compact`: one useful reduction below the automatic threshold. Backend
  199. # independent, so it follows whichever compaction service this leaf mounts.
  200. - id: command-compact
  201. name: '@deepseek-ai/dsh-command-compact'
  202. - id: subagent
  203. name: '@deepseek-ai/dsh-subagent'
  204. - id: subagent-spawn
  205. name: '@deepseek-ai/dsh-subagent-spawn'
  206. config:
  207. providerName: spawn
  208. - id: subagent-fork
  209. name: '@deepseek-ai/dsh-subagent-fork'
  210. config:
  211. providerName: fork
  212. # Continuable background children are selected per delegation tool. The
  213. # separately loaded follow-up tool registers the one global `send_message`.
  214. - id: tool-subagent-control
  215. name: '@deepseek-ai/dsh-tool-subagent-control'
  216. - id: tool-subagent-list-agents
  217. name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
  218. - id: tool-subagent
  219. name: '@deepseek-ai/dsh-tool-subagent'
  220. config:
  221. provider: spawn
  222. toolName: subagent
  223. backgroundMode: continuable
  224. - id: tool-subagent-fork
  225. name: '@deepseek-ai/dsh-tool-subagent'
  226. config:
  227. provider: fork
  228. toolName: subagent_fork
  229. backgroundMode: continuable
  230. # Optional direct-child return channel; absent from roots and one-shot agents.
  231. - id: tool-subagent-report
  232. name: '@deepseek-ai/dsh-tool-subagent-report'
  233. - id: workflow-workerthread
  234. name: '@deepseek-ai/dsh-workflow-workerthread'
  235. config:
  236. provider: spawn
  237. - id: tool-workflow
  238. name: '@deepseek-ai/dsh-tool-workflow'
  239. - id: timeout-policy
  240. name: '@deepseek-ai/dsh-timeout-policy'
  241. - id: spill-local
  242. name: '@deepseek-ai/dsh-spill-local'
  243. - id: spill-policy
  244. name: '@deepseek-ai/dsh-spill-policy'
  245. config:
  246. maxInlineBytes: 50000
  247. # Durability checkpoints before each model request and top-level dispatch.
  248. - id: session-checkpoint-policy
  249. name: '@deepseek-ai/dsh-session-checkpoint-policy'
  250. # Compacts oversized tool results before the broader conversation compactor
  251. # runs, preserving the model-visible result within the configured budget.
  252. - id: tool-result-prune
  253. name: '@deepseek-ai/dsh-compact-tool-result-prune'
  254. config:
  255. thresholdChars: 8192
  256. headChars: 4096
  257. tailChars: 1024
  258. - id: tool-todo
  259. name: '@deepseek-ai/dsh-tool-todo'
  260. # Persisted same-session goals reach the model and the slash menu here; the
  261. # domain, driver, and `/goal` command are above.
  262. - id: tool-goal
  263. name: '@deepseek-ai/dsh-tool-goal'
  264. # Fresh-agent Ralph iteration over a build-time-fixed script.
  265. - id: tool-ralph
  266. name: '@deepseek-ai/dsh-tool-ralph'
  267. config:
  268. subagentProvider: spawn
  269. maxRounds: 64
  270. - id: tool-str-replace-editor
  271. name: '@deepseek-ai/dsh-tool-str-replace-editor'
  272. config:
  273. maxOutputChars: 16000
  274. # Consecutive-repeat reminders on the tool chain.
  275. - id: repeat-tool-guard
  276. name: '@deepseek-ai/dsh-repeat-tool-guard'
  277. config:
  278. thresholds: [3, 5, 8]
  279. argumentsPreviewChars: 500
  280. # Every mode enables the stable web_search model surface. DeepSeek search
  281. # resolves the same DEEPSEEK_API_KEY credential the Models page manages for
  282. # chat, at each search; its Messages endpoint is separate from the
  283. # chat-completions endpoint, so it takes its own base-URL override. Fetch stays
  284. # disabled and no fetch provider is mounted: that provider defers SSRF
  285. # protection and the model would choose the request target. Search is a full
  286. # auxiliary model request with server-side retrieval, so this shipped DeepSeek
  287. # route gets 60s while the provider-neutral tool default remains 30s.
  288. - id: web
  289. name: '@deepseek-ai/dsh-web'
  290. config:
  291. searchProvider: deepseek-official
  292. - id: web-search-deepseek
  293. name: '@deepseek-ai/dsh-web-search-deepseek'
  294. config:
  295. apiKeyEnv: DEEPSEEK_API_KEY
  296. baseURL: !!js process.env.DEEPSEEK_SEARCH_BASE_URL
  297. - id: tool-web
  298. name: '@deepseek-ai/dsh-tool-web'
  299. config:
  300. fetch: false
  301. searchTimeoutMs: 60000
  302. # ── rows every mode mounts, whose values each overlay may state ──────────────
  303. # The tool registry. Presentation mode is a deployment choice; omitting it here
  304. # keeps the schema default (native).
  305. - id: tools
  306. name: '@deepseek-ai/dsh-tools'
  307. # The deployment persona is a deployment choice; plan-mode and tool plugins own
  308. # their own prompt sections.
  309. - id: system-prompt
  310. name: '@deepseek-ai/dsh-system-prompt'
  311. config:
  312. persona: ''
  313. # Agents created at startup. The base stays empty; raw overlays may create
  314. # agents, while Web creates sessions on client request.
  315. - id: agent-loop
  316. name: '@deepseek-ai/dsh-agent-loop'
  317. config:
  318. agents: []
  319. # The sandboxed filesystem provider. `cwd` defaults to `process.cwd()`; an
  320. # overlay can pin another workspace.
  321. - id: fs-sandbox
  322. name: '@deepseek-ai/dsh-fs-sandbox'
  323. # The native DeepSeek adapter. No key or endpoint is inlined: both resolve per
  324. # request from the `llm-deepseek:` settings section over this entry, with the
  325. # key coming from the credential store below. Thinking defaults are a deployment
  326. # choice.
  327. - id: llm-deepseek
  328. name: '@deepseek-ai/dsh-llm-deepseek'