cordis.patch.yml 16 KB

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