@dsmm/dsmm 0.1.9 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (553) hide show
  1. package/README.md +46 -58
  2. package/agent-presets/dsmm-builder/agent.cordis.yml +91 -186
  3. package/agent-presets/dsmm-builder/preset.yml +1 -1
  4. package/agent-presets/dsmm-clarifier/agent.cordis.yml +120 -17
  5. package/agent-presets/dsmm-clarifier/preset.yml +1 -1
  6. package/agent-presets/dsmm-code-search/agent.cordis.yml +72 -17
  7. package/agent-presets/dsmm-code-search/preset.yml +1 -1
  8. package/agent-presets/dsmm-coding/agent.cordis.yml +169 -0
  9. package/agent-presets/dsmm-coding/preset.yml +3 -0
  10. package/agent-presets/dsmm-complex/agent.cordis.yml +154 -0
  11. package/agent-presets/dsmm-complex/preset.yml +3 -0
  12. package/agent-presets/dsmm-creative/agent.cordis.yml +122 -15
  13. package/agent-presets/dsmm-creative/preset.yml +1 -1
  14. package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +179 -0
  15. package/agent-presets/dsmm-cross-cutting/preset.yml +3 -0
  16. package/agent-presets/dsmm-deep/agent.cordis.yml +189 -0
  17. package/agent-presets/dsmm-deep/preset.yml +3 -0
  18. package/agent-presets/dsmm-doc-search/agent.cordis.yml +72 -17
  19. package/agent-presets/dsmm-doc-search/preset.yml +1 -1
  20. package/agent-presets/dsmm-documenting/agent.cordis.yml +168 -0
  21. package/agent-presets/dsmm-documenting/preset.yml +3 -0
  22. package/agent-presets/dsmm-frontend/agent.cordis.yml +161 -0
  23. package/agent-presets/dsmm-frontend/preset.yml +3 -0
  24. package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +153 -0
  25. package/agent-presets/dsmm-hard-reasoning/preset.yml +3 -0
  26. package/agent-presets/dsmm-media-reader/agent.cordis.yml +72 -17
  27. package/agent-presets/dsmm-media-reader/preset.yml +1 -1
  28. package/agent-presets/dsmm-normal-task/agent.cordis.yml +127 -0
  29. package/agent-presets/dsmm-normal-task/preset.yml +3 -0
  30. package/agent-presets/dsmm-oracle/agent.cordis.yml +109 -15
  31. package/agent-presets/dsmm-oracle/preset.yml +1 -1
  32. package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +109 -15
  33. package/agent-presets/dsmm-oracle-2nd/preset.yml +1 -1
  34. package/agent-presets/dsmm-orchestrator/agent.cordis.yml +174 -190
  35. package/agent-presets/dsmm-orchestrator/preset.yml +1 -1
  36. package/agent-presets/dsmm-plan-critic/agent.cordis.yml +102 -16
  37. package/agent-presets/dsmm-plan-critic/preset.yml +1 -1
  38. package/agent-presets/dsmm-planner/agent.cordis.yml +134 -15
  39. package/agent-presets/dsmm-planner/preset.yml +1 -1
  40. package/agent-presets/dsmm-quick/agent.cordis.yml +132 -0
  41. package/agent-presets/dsmm-quick/preset.yml +3 -0
  42. package/agent-presets/dsmm-research/agent.cordis.yml +156 -0
  43. package/agent-presets/dsmm-research/preset.yml +3 -0
  44. package/agent-presets/dsmm-reviewer/agent.cordis.yml +108 -16
  45. package/agent-presets/dsmm-reviewer/preset.yml +1 -1
  46. package/cordis.patch.yml +1 -5
  47. package/docs/agent-presets.md +48 -15
  48. package/docs/compatibility.md +58 -68
  49. package/docs/deferred-native-approval-risk.md +19 -0
  50. package/docs/design.md +43 -2
  51. package/docs/lsp.md +12 -12
  52. package/docs/migration-from-ocmm.md +10 -2
  53. package/docs/model-routing.md +84 -59
  54. package/docs/native-permissions.md +35 -0
  55. package/docs/profiles.md +43 -64
  56. package/docs/releasing.md +159 -8
  57. package/docs/roadmap.md +77 -17
  58. package/docs/runtime-recovery.md +12 -0
  59. package/docs/safety-guards.md +7 -3
  60. package/docs/settings-status.md +46 -40
  61. package/docs/skill-sync.md +89 -14
  62. package/lib/child-admission-contract.d.ts +37 -0
  63. package/lib/child-admission-contract.js +2 -0
  64. package/lib/child-admission.d.ts +42 -0
  65. package/lib/child-admission.js +162 -0
  66. package/lib/child-capture.d.ts +81 -0
  67. package/lib/child-capture.js +203 -0
  68. package/lib/child-evidence.d.ts +17 -0
  69. package/lib/child-evidence.js +43 -0
  70. package/lib/client/ChildrenPanel.d.ts +43 -0
  71. package/lib/client/ChildrenPanel.js +82 -0
  72. package/lib/client/DeploymentPage.d.ts +18 -0
  73. package/lib/client/DeploymentPage.js +127 -0
  74. package/lib/client/EditableChoice.d.ts +17 -0
  75. package/lib/client/EditableChoice.js +49 -0
  76. package/lib/client/PermissionsPanel.d.ts +14 -0
  77. package/lib/client/PermissionsPanel.js +46 -0
  78. package/lib/client/ProfilesSection.js +32 -15
  79. package/lib/client/RoleAvailability.d.ts +7 -0
  80. package/lib/client/RoleAvailability.js +19 -0
  81. package/lib/client/SessionProfiles.js +27 -9
  82. package/lib/client/StructuredEditor.js +15 -7
  83. package/lib/client/children-controller.d.ts +98 -0
  84. package/lib/client/children-controller.js +296 -0
  85. package/lib/client/children-locales.d.ts +367 -0
  86. package/lib/client/children-locales.js +69 -0
  87. package/lib/client/controller.d.ts +6 -1
  88. package/lib/client/controller.js +14 -8
  89. package/lib/client/deployment-controller.d.ts +50 -0
  90. package/lib/client/deployment-controller.js +193 -0
  91. package/lib/client/deployment-data.d.ts +17 -0
  92. package/lib/client/deployment-data.js +138 -0
  93. package/lib/client/deployment-locales.d.ts +70 -0
  94. package/lib/client/deployment-locales.js +81 -0
  95. package/lib/client/diagnostics.d.ts +14 -0
  96. package/lib/client/diagnostics.js +53 -0
  97. package/lib/client/index.d.ts +4 -0
  98. package/lib/client/index.js +145 -1
  99. package/lib/client/locales.d.ts +58 -0
  100. package/lib/client/locales.js +38 -18
  101. package/lib/client/permission-client.d.ts +16 -0
  102. package/lib/client/permission-client.js +38 -0
  103. package/lib/client/permission-controller.d.ts +62 -0
  104. package/lib/client/permission-controller.js +149 -0
  105. package/lib/client/permission-locales.d.ts +114 -0
  106. package/lib/client/permission-locales.js +75 -0
  107. package/lib/client/plugins-contract.d.ts +27 -0
  108. package/lib/client/plugins-contract.js +2 -0
  109. package/lib/client/session-labels.js +4 -4
  110. package/lib/client/structured.js +19 -5
  111. package/lib/client/styles.d.ts +1 -1
  112. package/lib/client/styles.js +36 -0
  113. package/lib/client.js +6724 -1604
  114. package/lib/commands.js +3 -0
  115. package/lib/config-file-store.d.ts +23 -0
  116. package/lib/config-file-store.js +67 -0
  117. package/lib/core-permission-authority.d.ts +18 -0
  118. package/lib/core-permission-authority.js +255 -0
  119. package/lib/core-permissions.d.ts +8 -0
  120. package/lib/core-permissions.js +33 -0
  121. package/lib/delivery-authority.d.ts +68 -0
  122. package/lib/delivery-authority.js +260 -0
  123. package/lib/deployment-config.d.ts +60 -0
  124. package/lib/deployment-config.js +205 -0
  125. package/lib/deployment-permission-rules.d.ts +55 -0
  126. package/lib/deployment-permission-rules.js +306 -0
  127. package/lib/dsh-home.d.ts +3 -0
  128. package/lib/dsh-home.js +10 -0
  129. package/lib/dsh-types.d.ts +22 -69
  130. package/lib/guards.d.ts +3 -2
  131. package/lib/guards.js +44 -6
  132. package/lib/host-llm-startup.d.ts +41 -0
  133. package/lib/host-llm-startup.js +65 -0
  134. package/lib/host-llm.d.ts +92 -0
  135. package/lib/host-llm.js +325 -0
  136. package/lib/index.d.ts +23 -5
  137. package/lib/index.js +383 -40
  138. package/lib/legacy-child-policy.d.ts +51 -0
  139. package/lib/legacy-child-policy.js +123 -0
  140. package/lib/legacy-read-composition.d.ts +20 -0
  141. package/lib/legacy-read-composition.js +144 -0
  142. package/lib/legacy-read-contracts.d.ts +157 -0
  143. package/lib/legacy-read-contracts.js +39 -0
  144. package/lib/legacy-read-host.d.ts +19 -0
  145. package/lib/legacy-read-host.js +67 -0
  146. package/lib/legacy-read-integration.d.ts +121 -0
  147. package/lib/legacy-read-integration.js +522 -0
  148. package/lib/legacy-read-proxy.d.ts +26 -0
  149. package/lib/legacy-read-proxy.js +237 -0
  150. package/lib/live-pi-ai-owner.d.ts +18 -0
  151. package/lib/live-pi-ai-owner.js +144 -0
  152. package/lib/llm-runtime.d.ts +11 -0
  153. package/lib/llm-runtime.js +21 -0
  154. package/lib/lsp.d.ts +13 -0
  155. package/lib/lsp.js +60 -0
  156. package/lib/managed-settings.d.ts +5 -0
  157. package/lib/managed-settings.js +14 -0
  158. package/lib/mode.js +42 -47
  159. package/lib/model-parameter-policy.d.ts +11 -0
  160. package/lib/model-parameter-policy.js +27 -0
  161. package/lib/model-routing.js +33 -19
  162. package/lib/modules.d.ts +35 -0
  163. package/lib/modules.js +37 -0
  164. package/lib/native-child-evidence.d.ts +42 -0
  165. package/lib/native-child-evidence.js +133 -0
  166. package/lib/native-pi-ai-wire.d.ts +37 -0
  167. package/lib/native-pi-ai-wire.js +261 -0
  168. package/lib/native-scope.d.ts +9 -0
  169. package/lib/native-scope.js +20 -0
  170. package/lib/permission-bash.d.ts +6 -0
  171. package/lib/permission-bash.js +7 -0
  172. package/lib/permission-control.d.ts +73 -0
  173. package/lib/permission-control.js +205 -0
  174. package/lib/permission-controller.d.ts +68 -0
  175. package/lib/permission-controller.js +317 -0
  176. package/lib/permission-errors.d.ts +7 -0
  177. package/lib/permission-errors.js +21 -0
  178. package/lib/permission-fs-search.d.ts +5 -0
  179. package/lib/permission-fs-search.js +7 -0
  180. package/lib/permission-fs.d.ts +5 -0
  181. package/lib/permission-fs.js +7 -0
  182. package/lib/permission-native-access.d.ts +11 -0
  183. package/lib/permission-native-access.js +6 -0
  184. package/lib/permission-native-command.d.ts +10 -0
  185. package/lib/permission-native-command.js +93 -0
  186. package/lib/permission-native-rules.d.ts +75 -0
  187. package/lib/permission-native-rules.js +278 -0
  188. package/lib/permission-pwsh.d.ts +6 -0
  189. package/lib/permission-pwsh.js +7 -0
  190. package/lib/permission-remote.d.ts +26 -0
  191. package/lib/permission-remote.js +53 -0
  192. package/lib/permission-rpc.d.ts +29 -0
  193. package/lib/permission-rpc.js +152 -0
  194. package/lib/permission-rules.d.ts +115 -0
  195. package/lib/permission-rules.js +256 -0
  196. package/lib/permission-settings.d.ts +45 -0
  197. package/lib/permission-settings.js +48 -0
  198. package/lib/permission-shell.d.ts +38 -0
  199. package/lib/permission-shell.js +150 -0
  200. package/lib/permission-web.d.ts +5 -0
  201. package/lib/permission-web.js +7 -0
  202. package/lib/plan-validation.js +6 -44
  203. package/lib/preset-materializer.js +2 -0
  204. package/lib/preset-registry.d.ts +1 -1
  205. package/lib/preset-registry.js +38 -24
  206. package/lib/preset-skills.d.ts +4 -1
  207. package/lib/preset-skills.js +60 -19
  208. package/lib/profile-diagnostics.d.ts +45 -0
  209. package/lib/profile-diagnostics.js +148 -0
  210. package/lib/profile-locale.d.ts +3 -0
  211. package/lib/profile-locale.js +2 -0
  212. package/lib/profile-remote.d.ts +22 -0
  213. package/lib/profile-remote.js +344 -27
  214. package/lib/profile-rpc.d.ts +25 -1
  215. package/lib/profile-rpc.js +143 -3
  216. package/lib/profile-runtime.d.ts +63 -0
  217. package/lib/profile-runtime.js +496 -77
  218. package/lib/profile-store.d.ts +56 -1
  219. package/lib/profile-store.js +377 -111
  220. package/lib/profile-types.d.ts +125 -1
  221. package/lib/profile-types.js +1 -0
  222. package/lib/profiles.d.ts +16 -2
  223. package/lib/profiles.js +156 -79
  224. package/lib/prompt-content.d.ts +25 -0
  225. package/lib/prompt-content.js +27 -0
  226. package/lib/prompts.d.ts +45 -4
  227. package/lib/prompts.js +157 -43
  228. package/lib/recovery-policy.js +20 -7
  229. package/lib/role-control-remote.d.ts +38 -0
  230. package/lib/role-control-remote.js +211 -0
  231. package/lib/role-control-rpc.d.ts +51 -0
  232. package/lib/role-control-rpc.js +377 -0
  233. package/lib/role-control-types.d.ts +92 -0
  234. package/lib/role-control-types.js +8 -0
  235. package/lib/role-invocation.d.ts +47 -0
  236. package/lib/role-invocation.js +135 -0
  237. package/lib/role-llm-runtime.d.ts +17 -0
  238. package/lib/role-llm-runtime.js +62 -0
  239. package/lib/role-llm.d.ts +31 -0
  240. package/lib/role-llm.js +66 -0
  241. package/lib/role-policy.d.ts +92 -0
  242. package/lib/role-policy.js +601 -0
  243. package/lib/role-providers.d.ts +7 -3
  244. package/lib/role-providers.js +74 -46
  245. package/lib/role-routing.d.ts +11 -2
  246. package/lib/role-routing.js +42 -25
  247. package/lib/role-runs.d.ts +135 -0
  248. package/lib/role-runs.js +304 -0
  249. package/lib/role-subagents.d.ts +63 -4
  250. package/lib/role-subagents.js +299 -47
  251. package/lib/roles.d.ts +20 -9
  252. package/lib/roles.js +87 -216
  253. package/lib/route-json.d.ts +19 -0
  254. package/lib/route-json.js +129 -0
  255. package/lib/routing-policy.d.ts +2 -0
  256. package/lib/routing-policy.js +12 -2
  257. package/lib/runtime-integration.d.ts +112 -0
  258. package/lib/runtime-integration.js +784 -0
  259. package/lib/runtime-recovery.js +34 -13
  260. package/lib/session-scope.js +2 -0
  261. package/lib/settings.d.ts +116 -14
  262. package/lib/settings.js +455 -149
  263. package/lib/skills.d.ts +24 -9
  264. package/lib/skills.js +114 -35
  265. package/lib/state.d.ts +10 -6
  266. package/lib/state.js +48 -49
  267. package/lib/status.d.ts +35 -1
  268. package/lib/status.js +58 -17
  269. package/lib/subagent-runtime.d.ts +45 -0
  270. package/lib/subagent-runtime.js +131 -0
  271. package/locale/en.json +2 -2
  272. package/locale/zh.json +2 -2
  273. package/package.json +112 -45
  274. package/patches/subagent-runtime.yml +15 -0
  275. package/prompts/deepseek-flash.md +1 -1
  276. package/prompts/deepseek-v4-pro.md +2 -2
  277. package/prompts/deepwork.md +153 -20
  278. package/prompts/source/agents/clarifier.md +47 -0
  279. package/prompts/source/agents/orchestrator.md +72 -0
  280. package/prompts/source/agents/plan-critic.md +29 -0
  281. package/prompts/source/agents/planner.md +21 -0
  282. package/prompts/source/agents/reviewer.md +23 -0
  283. package/prompts/source/catalog.json +548 -0
  284. package/prompts/source/category/coding.md +46 -0
  285. package/prompts/source/category/complex.md +29 -0
  286. package/prompts/source/category/creative.md +40 -0
  287. package/prompts/source/category/cross-cutting.md +54 -0
  288. package/prompts/source/category/deep.md +64 -0
  289. package/prompts/source/category/documenting.md +68 -0
  290. package/prompts/source/category/frontend.md +38 -0
  291. package/prompts/source/category/hard-reasoning.md +53 -0
  292. package/prompts/source/category/normal-task.md +27 -0
  293. package/prompts/source/category/quick.md +34 -0
  294. package/prompts/source/category/research.md +58 -0
  295. package/prompts/source/deepwork/claude-opus-5.md +28 -0
  296. package/prompts/source/deepwork/codex.md +9 -0
  297. package/prompts/source/deepwork/default.md +136 -0
  298. package/prompts/source/deepwork/gemini.md +191 -0
  299. package/prompts/source/deepwork/glm.md +263 -0
  300. package/prompts/source/deepwork/gpt.md +49 -0
  301. package/prompts/source/deepwork/kimi-k27.md +13 -0
  302. package/prompts/source/deepwork/planner.md +44 -0
  303. package/prompts/source/deepwork/swe-2.md +13 -0
  304. package/prompts/source/manifest.json +3233 -0
  305. package/prompts/source/shared/dsh-host-contract.md +8 -0
  306. package/prompts/source/shared/locale.md +8 -0
  307. package/prompts/source/shared/shell-safety.md +7 -0
  308. package/prompts/source/terminal/builder.md +13 -0
  309. package/prompts/source/terminal/clarifier.md +41 -0
  310. package/prompts/source/terminal/code-search.md +39 -0
  311. package/prompts/source/terminal/coding.md +41 -0
  312. package/prompts/source/terminal/complex.md +43 -0
  313. package/prompts/source/terminal/creative.md +41 -0
  314. package/prompts/source/terminal/cross-cutting.md +43 -0
  315. package/prompts/source/terminal/deep.md +43 -0
  316. package/prompts/source/terminal/doc-search.md +39 -0
  317. package/prompts/source/terminal/documenting.md +41 -0
  318. package/prompts/source/terminal/frontend.md +41 -0
  319. package/prompts/source/terminal/hard-reasoning.md +41 -0
  320. package/prompts/source/terminal/media-reader.md +39 -0
  321. package/prompts/source/terminal/normal-task.md +41 -0
  322. package/prompts/source/terminal/oracle-2nd.md +53 -0
  323. package/prompts/source/terminal/oracle.md +53 -0
  324. package/prompts/source/terminal/orchestrator.md +26 -0
  325. package/prompts/source/terminal/plan-critic.md +41 -0
  326. package/prompts/source/terminal/planner.md +42 -0
  327. package/prompts/source/terminal/quick.md +39 -0
  328. package/prompts/source/terminal/research.md +39 -0
  329. package/prompts/source/terminal/reviewer.md +53 -0
  330. package/scripts/cold-profile-composition.mjs +329 -0
  331. package/scripts/cold-profile-sources.mjs +238 -0
  332. package/scripts/migrate-cold-profile.mjs +315 -0
  333. package/skills/ast-grep/LICENSE +21 -0
  334. package/skills/ast-grep/README.md +138 -0
  335. package/skills/ast-grep/SKILL.md +287 -0
  336. package/skills/ast-grep/SOURCE +1 -0
  337. package/skills/ast-grep/install.ps1 +235 -0
  338. package/skills/ast-grep/install.sh +286 -0
  339. package/skills/ast-grep/references/cli.md +233 -0
  340. package/skills/ast-grep/references/install.md +168 -0
  341. package/skills/ast-grep/references/patterns.md +149 -0
  342. package/skills/ast-grep/references/pitfalls.md +305 -0
  343. package/skills/ast-grep/references/recipes.md +404 -0
  344. package/skills/ast-grep/references/sgconfig.md +250 -0
  345. package/skills/ast-grep/references/yaml-rules.md +511 -0
  346. package/skills/ast-grep/scripts/ast_grep_helper.py +760 -0
  347. package/skills/ast-grep/tests/smoke.ps1 +129 -0
  348. package/skills/ast-grep/tests/smoke.sh +212 -0
  349. package/skills/ast-grep/tests/test_resolver.py +154 -0
  350. package/skills/brainstorming/SKILL.md +123 -9
  351. package/skills/coding-agent-sessions/LICENSE-UPSTREAM.md +82 -0
  352. package/skills/coding-agent-sessions/NOTICE.md +24 -0
  353. package/skills/coding-agent-sessions/SKILL.md +147 -0
  354. package/skills/coding-agent-sessions/agents/openai.yaml +4 -0
  355. package/skills/coding-agent-sessions/pyrightconfig.json +5 -0
  356. package/skills/coding-agent-sessions/references/all-platforms.md +77 -0
  357. package/skills/coding-agent-sessions/references/claude.md +34 -0
  358. package/skills/coding-agent-sessions/references/codex.md +32 -0
  359. package/skills/coding-agent-sessions/references/opencode.md +45 -0
  360. package/skills/coding-agent-sessions/references/senpi.md +29 -0
  361. package/skills/coding-agent-sessions/scripts/agent_sessions/__init__.py +1 -0
  362. package/skills/coding-agent-sessions/scripts/agent_sessions/aside_scanner.py +140 -0
  363. package/skills/coding-agent-sessions/scripts/agent_sessions/claude.py +66 -0
  364. package/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +283 -0
  365. package/skills/coding-agent-sessions/scripts/agent_sessions/codex.py +105 -0
  366. package/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +275 -0
  367. package/skills/coding-agent-sessions/scripts/agent_sessions/jsonio.py +55 -0
  368. package/skills/coding-agent-sessions/scripts/agent_sessions/kiro_scanner.py +91 -0
  369. package/skills/coding-agent-sessions/scripts/agent_sessions/opencode.py +289 -0
  370. package/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +46 -0
  371. package/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +104 -0
  372. package/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_optional_scanners.py +203 -0
  373. package/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_scanners.py +177 -0
  374. package/skills/coding-agent-sessions/scripts/agent_sessions/timeparse.py +51 -0
  375. package/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +149 -0
  376. package/skills/coding-agent-sessions/scripts/agent_sessions/types.py +57 -0
  377. package/skills/coding-agent-sessions/scripts/find-agent-sessions.py +19 -0
  378. package/skills/coding-agent-sessions/scripts/tests/test_agent_sessions.py +322 -0
  379. package/skills/coding-agent-sessions/scripts/tests/test_aside_scanner.py +131 -0
  380. package/skills/coding-agent-sessions/scripts/tests/test_cli_contract.py +126 -0
  381. package/skills/coding-agent-sessions/scripts/tests/test_extended_scanners.py +262 -0
  382. package/skills/coding-agent-sessions/scripts/tests/test_optional_sqlite_scanners.py +79 -0
  383. package/skills/coding-agent-sessions/scripts/tests/test_pi_family_scanners.py +130 -0
  384. package/skills/debugging/SKILL.md +130 -4
  385. package/skills/debugging/references/logging.md +2 -0
  386. package/skills/debugging/references/methodology/00-setup.md +16 -62
  387. package/skills/debugging/references/methodology/02-investigate.md +11 -5
  388. package/skills/debugging/references/methodology/03-flaky-triage.md +6 -4
  389. package/skills/debugging/references/methodology/04-hard-reasoning-escalation.md +6 -16
  390. package/skills/debugging/references/methodology/05-escalate.md +2 -0
  391. package/skills/debugging/references/methodology/06-fix.md +8 -6
  392. package/skills/debugging/references/methodology/08-qa.md +7 -5
  393. package/skills/debugging/references/methodology/09-cleanup.md +16 -152
  394. package/skills/debugging/references/methodology/partial-runtime-evidence.md +7 -18
  395. package/skills/debugging/references/runtimes/bundled-js-binary.md +3 -16
  396. package/skills/debugging/references/runtimes/go.md +2 -0
  397. package/skills/debugging/references/runtimes/native-binary.md +11 -54
  398. package/skills/debugging/references/runtimes/node.md +6 -15
  399. package/skills/debugging/references/runtimes/python.md +5 -15
  400. package/skills/debugging/references/runtimes/rust.md +4 -18
  401. package/skills/debugging/references/scripts/dap.test.mjs +539 -0
  402. package/skills/debugging/references/scripts/fixture-adapter.mjs +164 -0
  403. package/skills/debugging/references/tools/dap.md +4 -2
  404. package/skills/debugging/references/tools/ghidra.md +6 -15
  405. package/skills/debugging/references/tools/playwright-cli.md +5 -15
  406. package/skills/debugging/references/tools/pwndbg.md +2 -0
  407. package/skills/debugging/references/tools/pwntools.md +6 -16
  408. package/skills/dispatching-parallel-agents/SKILL.md +96 -7
  409. package/skills/frontend/.frontend-materialized.json +856 -0
  410. package/skills/frontend/ATTRIBUTION.md +37 -0
  411. package/skills/frontend/LICENSE-Apache-2.0.txt +201 -0
  412. package/skills/frontend/LICENSE-taste-skill.txt +21 -0
  413. package/skills/frontend/LICENSE-ui-ux-pro-max.txt +21 -0
  414. package/skills/frontend/SKILL.md +145 -0
  415. package/skills/frontend/references/design/README.md +256 -0
  416. package/skills/frontend/references/design/_INDEX.md +206 -0
  417. package/skills/frontend/references/design/airbnb.md +393 -0
  418. package/skills/frontend/references/design/airtable.md +92 -0
  419. package/skills/frontend/references/design/apple.md +250 -0
  420. package/skills/frontend/references/design/aside.md +211 -0
  421. package/skills/frontend/references/design/binance.md +348 -0
  422. package/skills/frontend/references/design/bmw.md +183 -0
  423. package/skills/frontend/references/design/brutalist-skill.md +92 -0
  424. package/skills/frontend/references/design/bugatti.md +271 -0
  425. package/skills/frontend/references/design/cal.md +262 -0
  426. package/skills/frontend/references/design/claude.md +315 -0
  427. package/skills/frontend/references/design/clay.md +307 -0
  428. package/skills/frontend/references/design/clickhouse.md +284 -0
  429. package/skills/frontend/references/design/clone-from-url.md +69 -0
  430. package/skills/frontend/references/design/cohere.md +269 -0
  431. package/skills/frontend/references/design/coinbase.md +132 -0
  432. package/skills/frontend/references/design/composio.md +310 -0
  433. package/skills/frontend/references/design/cursor.md +312 -0
  434. package/skills/frontend/references/design/design-system-architecture.md +250 -0
  435. package/skills/frontend/references/design/elevenlabs.md +268 -0
  436. package/skills/frontend/references/design/expo.md +284 -0
  437. package/skills/frontend/references/design/ferrari.md +317 -0
  438. package/skills/frontend/references/design/figma.md +223 -0
  439. package/skills/frontend/references/design/framer.md +249 -0
  440. package/skills/frontend/references/design/gpt-tasteskill.md +74 -0
  441. package/skills/frontend/references/design/hashicorp.md +281 -0
  442. package/skills/frontend/references/design/ibm.md +335 -0
  443. package/skills/frontend/references/design/image-to-code-skill.md +1228 -0
  444. package/skills/frontend/references/design/imagegen-brandkit.md +798 -0
  445. package/skills/frontend/references/design/imagegen-frontend-mobile.md +1465 -0
  446. package/skills/frontend/references/design/imagegen-frontend-web.md +987 -0
  447. package/skills/frontend/references/design/interaction-skill.md +52 -0
  448. package/skills/frontend/references/design/intercom.md +149 -0
  449. package/skills/frontend/references/design/kraken.md +128 -0
  450. package/skills/frontend/references/design/lamborghini.md +291 -0
  451. package/skills/frontend/references/design/linear.app.md +370 -0
  452. package/skills/frontend/references/design/lovable.md +301 -0
  453. package/skills/frontend/references/design/mastercard.md +368 -0
  454. package/skills/frontend/references/design/meta.md +369 -0
  455. package/skills/frontend/references/design/minimalist-skill.md +85 -0
  456. package/skills/frontend/references/design/minimax.md +260 -0
  457. package/skills/frontend/references/design/mintlify.md +329 -0
  458. package/skills/frontend/references/design/miro.md +111 -0
  459. package/skills/frontend/references/design/mistral.ai.md +264 -0
  460. package/skills/frontend/references/design/mongodb.md +269 -0
  461. package/skills/frontend/references/design/nike.md +366 -0
  462. package/skills/frontend/references/design/notion.md +312 -0
  463. package/skills/frontend/references/design/nvidia.md +296 -0
  464. package/skills/frontend/references/design/ollama.md +270 -0
  465. package/skills/frontend/references/design/opencode.ai.md +284 -0
  466. package/skills/frontend/references/design/output-skill.md +49 -0
  467. package/skills/frontend/references/design/pinterest.md +233 -0
  468. package/skills/frontend/references/design/playstation.md +367 -0
  469. package/skills/frontend/references/design/posthog.md +259 -0
  470. package/skills/frontend/references/design/raycast.md +271 -0
  471. package/skills/frontend/references/design/react-dev-tooling-skill.md +232 -0
  472. package/skills/frontend/references/design/redesign-skill.md +178 -0
  473. package/skills/frontend/references/design/renault.md +314 -0
  474. package/skills/frontend/references/design/replicate.md +264 -0
  475. package/skills/frontend/references/design/resend.md +306 -0
  476. package/skills/frontend/references/design/revolut.md +188 -0
  477. package/skills/frontend/references/design/runwayml.md +247 -0
  478. package/skills/frontend/references/design/sanity.md +360 -0
  479. package/skills/frontend/references/design/sentry.md +265 -0
  480. package/skills/frontend/references/design/shopify.md +353 -0
  481. package/skills/frontend/references/design/soft-skill.md +98 -0
  482. package/skills/frontend/references/design/spacex.md +197 -0
  483. package/skills/frontend/references/design/spotify.md +249 -0
  484. package/skills/frontend/references/design/starbucks.md +583 -0
  485. package/skills/frontend/references/design/stitch-design-example.md +121 -0
  486. package/skills/frontend/references/design/stitch-skill.md +184 -0
  487. package/skills/frontend/references/design/stripe.md +325 -0
  488. package/skills/frontend/references/design/supabase.md +258 -0
  489. package/skills/frontend/references/design/superhuman.md +255 -0
  490. package/skills/frontend/references/design/taste-skill.md +1206 -0
  491. package/skills/frontend/references/design/tesla.md +289 -0
  492. package/skills/frontend/references/design/theverge.md +342 -0
  493. package/skills/frontend/references/design/together.ai.md +266 -0
  494. package/skills/frontend/references/design/uber.md +298 -0
  495. package/skills/frontend/references/design/vercel.md +313 -0
  496. package/skills/frontend/references/design/vodafone.md +426 -0
  497. package/skills/frontend/references/design/voltagent.md +326 -0
  498. package/skills/frontend/references/design/warp.md +256 -0
  499. package/skills/frontend/references/design/webflow.md +95 -0
  500. package/skills/frontend/references/design/wired.md +281 -0
  501. package/skills/frontend/references/design/wise.md +176 -0
  502. package/skills/frontend/references/design/x.ai.md +260 -0
  503. package/skills/frontend/references/design/zapier.md +331 -0
  504. package/skills/frontend/references/perfection/README.md +264 -0
  505. package/skills/frontend/references/perfection/react-perf-tooling.md +234 -0
  506. package/skills/frontend/references/ui-ux-db/README.md +659 -0
  507. package/skills/frontend/references/ui-ux-db/data/app-interface.csv +31 -0
  508. package/skills/frontend/references/ui-ux-db/data/charts.csv +26 -0
  509. package/skills/frontend/references/ui-ux-db/data/colors.csv +162 -0
  510. package/skills/frontend/references/ui-ux-db/data/google-fonts.csv +1924 -0
  511. package/skills/frontend/references/ui-ux-db/data/icons.csv +106 -0
  512. package/skills/frontend/references/ui-ux-db/data/landing.csv +35 -0
  513. package/skills/frontend/references/ui-ux-db/data/products.csv +162 -0
  514. package/skills/frontend/references/ui-ux-db/data/react-performance.csv +45 -0
  515. package/skills/frontend/references/ui-ux-db/data/stacks/angular.csv +51 -0
  516. package/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +54 -0
  517. package/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -0
  518. package/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
  519. package/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
  520. package/skills/frontend/references/ui-ux-db/data/stacks/laravel.csv +51 -0
  521. package/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
  522. package/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
  523. package/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
  524. package/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +52 -0
  525. package/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -0
  526. package/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
  527. package/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -0
  528. package/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
  529. package/skills/frontend/references/ui-ux-db/data/stacks/threejs.csv +54 -0
  530. package/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -0
  531. package/skills/frontend/references/ui-ux-db/data/styles.csv +85 -0
  532. package/skills/frontend/references/ui-ux-db/data/typography.csv +74 -0
  533. package/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +162 -0
  534. package/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +100 -0
  535. package/skills/frontend/references/ui-ux-db/data/web-interface.csv +31 -0
  536. package/skills/frontend/references/ui-ux-db/scripts/core.py +262 -0
  537. package/skills/frontend/references/ui-ux-db/scripts/design_system.py +1148 -0
  538. package/skills/frontend/references/ui-ux-db/scripts/search.py +114 -0
  539. package/skills/frontend/scripts/perfection/lighthouse-audit.py +201 -0
  540. package/skills/git-master/SKILL.md +115 -0
  541. package/skills/git-master/agents/openai.yaml +13 -0
  542. package/skills/init-deep/SKILL.md +282 -0
  543. package/skills/receiving-code-review/SKILL.md +117 -7
  544. package/skills/remove-ai-slops/SKILL.md +160 -8
  545. package/skills/requesting-code-review/SKILL.md +98 -3
  546. package/skills/requesting-code-review/code-reviewer.md +59 -0
  547. package/skills/subagent-driven-development/SKILL.md +179 -6
  548. package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +23 -0
  549. package/skills/subagent-driven-development/implementer-prompt.md +87 -0
  550. package/skills/subagent-driven-development/spec-reviewer-prompt.md +37 -0
  551. package/skills/using-git-worktrees/SKILL.md +144 -0
  552. package/skills/writing-plans/SKILL.md +126 -7
  553. package/skills/writing-plans/plan-document-reviewer-prompt.md +47 -0
package/lib/roles.js CHANGED
@@ -1,216 +1,90 @@
1
1
  import { DSMM_SKILL_NAMES } from "./skills.js";
2
- import { roleProviderName } from "./role-providers.js";
2
+ import { buildRolePersona, SOURCE_ROLE_CATALOG } from "./prompt-content.js";
3
3
  export const DSMM_ROLE_IDS = [
4
- "dsmm-orchestrator",
5
- "dsmm-planner",
6
- "dsmm-plan-critic",
7
- "dsmm-builder",
8
- "dsmm-reviewer",
9
- "dsmm-oracle",
10
- "dsmm-oracle-2nd",
11
- "dsmm-creative",
12
- "dsmm-code-search",
13
- "dsmm-doc-search",
14
- "dsmm-clarifier",
15
- "dsmm-media-reader"
16
- ];
17
- export const DSMM_ROLES = [
18
- {
19
- id: "dsmm-orchestrator",
20
- name: "DW Orchestrator",
21
- description: "Coordinates Deepwork sessions and routes work to focused DW roles.",
22
- order: 10,
23
- mode: "primary",
24
- enabledByDefault: true,
25
- persona: `You are DW Orchestrator (role ID: dsmm-orchestrator), a dsh-native coordinator for deepwork sessions.
26
- For complex behavior implementation, default to planner → plan-critic → implementation; for simple bounded low-risk work, proceed directly. A clear implementation request authorizes its stated scope without repeated design approval.
27
- Delegate bounded work only through callable role-specific DSH tools: dsmm-planner, dsmm-plan-critic, dsmm-builder, dsmm-reviewer, dsmm-oracle, dsmm-oracle-2nd, dsmm-creative, dsmm-code-search, dsmm-doc-search, dsmm-clarifier and dsmm-media-reader.
28
- Reviewer is primary-lane self-review; use Oracle only for a useful external cross-check when a different model was explicitly selected. Review when risk warrants it, not in a fixed loop.
29
- Keep scope explicit, preserve user constraints, and do not claim a preset is active unless the host selected it. Implementing does not authorize Git writes.`
30
- },
31
- {
32
- id: "dsmm-planner",
33
- name: "DW Planner",
34
- description: "Turns approved scope into ordered implementation steps with verification gates.",
35
- order: 20,
36
- mode: "all",
37
- enabledByDefault: true,
38
- access: "read-only",
39
- persona: `You are DW Planner (role ID: dsmm-planner), a dsh-native planning specialist.
40
- Inspect evidence and convert approved complex work into an outcome-oriented plan with dependencies, interfaces, risks and verification. Do not implement or modify files. Flag decisions that change scope, safety or public APIs. Git writes need specific authorization.`
41
- },
42
- {
43
- id: "dsmm-plan-critic",
44
- name: "DW Plan Critic",
45
- description: "Checks implementation plans for ambiguity, missing evidence, and unsafe sequencing.",
46
- order: 30,
47
- mode: "subagent",
48
- enabledByDefault: true,
49
- access: "read-only",
50
- persona: `You are DW Plan Critic (role ID: dsmm-plan-critic), a dsh-native plan review specialist.
51
- Inspect the plan and evidence for material blockers in outcome coverage, dependencies, tests, safety and scope. Return concrete blockers or a concise pass with residual risks; do not require a fixed format or repeated reviews after editorial changes. Read only; do not implement or perform Git writes.`
52
- },
53
- {
54
- id: "dsmm-builder",
55
- name: "DW Builder",
56
- description: "Implements one bounded approved outcome and verifies the changed surface.",
57
- order: 35,
58
- mode: "primary",
59
- enabledByDefault: true,
60
- access: "write",
61
- persona: `You are DW Builder (role ID: dsmm-builder), a bounded implementation worker. Respect assigned file ownership and other workers' changes. Implement only the approved outcome, verify the affected surface, and report changes, evidence and risks. Escalate changes to public APIs, permissions, safety, data guarantees or irreversible behavior. Never stage, commit, push, tag, rebase or release without specific authorization.`
62
- },
63
- {
64
- id: "dsmm-reviewer",
65
- name: "DW Reviewer",
66
- description: "Reviews completed changes against requirements, tests, and regression risk.",
67
- order: 40,
68
- mode: "subagent",
69
- enabledByDefault: true,
70
- access: "read-only",
71
- persona: `You are DW Reviewer (role ID: dsmm-reviewer), a dsh-native implementation reviewer.
72
- Read the current implementation diff and new files against requirements, conventions and verification. Prioritize actionable correctness and regression findings. This is primary-model or primary-lane self-review, not external Oracle review. Do not modify files or perform Git writes.`
73
- },
74
- {
75
- id: "dsmm-oracle",
76
- name: "DW Oracle",
77
- description: "First-priority external-model implementation cross-check when explicitly configured.",
78
- order: 42,
79
- mode: "subagent",
80
- enabledByDefault: true,
81
- access: "read-only",
82
- persona: `You are DW Oracle (role ID: dsmm-oracle), first-priority implementation cross-check. Read only; inspect the current diff, evidence and requirements for concrete defects. Your role is externally heterogeneous only when the caller selects a different available model; do not claim model independence when inheriting the parent's route. Do not implement or perform Git writes.`
83
- },
84
- {
85
- id: "dsmm-oracle-2nd",
86
- name: "DW Oracle 2nd",
87
- description: "Second-priority external-model implementation cross-check for an additional evidence need.",
88
- order: 44,
89
- mode: "subagent",
90
- enabledByDefault: true,
91
- access: "read-only",
92
- persona: `You are DW Oracle 2nd (role ID: dsmm-oracle-2nd), second-priority implementation cross-check, not a higher-capability rank. Read only; report concrete defects in the current diff and evidence. An external model must be explicitly selected; the role label alone is no proof of independence. Do not implement or perform Git writes.`
93
- },
94
- {
95
- id: "dsmm-creative",
96
- name: "DW Creative",
97
- description: "Explores unconventional but coherent approaches and explicit trade-offs.",
98
- order: 46,
99
- mode: "subagent",
100
- enabledByDefault: true,
101
- access: "read-only",
102
- persona: `You are DW Creative (role ID: dsmm-creative). Explore distinct coherent approaches, state trade-offs, constraints and a grounded recommendation. Remain read-only unless a separate implementation assignment authorizes changes. Do not perform Git writes.`
103
- },
104
- {
105
- id: "dsmm-code-search",
106
- name: "DW Code Search",
107
- description: "Finds local codebase facts, symbols, patterns, and relevant implementation context.",
108
- order: 50,
109
- mode: "subagent",
110
- enabledByDefault: true,
111
- access: "read-only",
112
- persona: `You are DW Code Search (role ID: dsmm-code-search), a dsh-native codebase research specialist.
113
- Search local project context for exact files, symbols, references, and conventions needed by the caller.
114
- Summarize findings with paths and evidence; do not modify files.`
115
- },
116
- {
117
- id: "dsmm-doc-search",
118
- name: "DW Doc Search",
119
- description: "Finds current external documentation and examples for library or API questions.",
120
- order: 60,
121
- mode: "subagent",
122
- enabledByDefault: true,
123
- access: "read-only",
124
- persona: `You are DW Doc Search (role ID: dsmm-doc-search), a dsh-native documentation research specialist.
125
- Find current documentation and real examples for libraries, APIs, CLIs, and services relevant to the task.
126
- Cite source locations, separate facts from assumptions, and avoid guessing when documentation is unavailable.`
127
- },
128
- {
129
- id: "dsmm-clarifier",
130
- name: "DW Clarifier",
131
- description: "Reduces ambiguous requests to the few decisions needed before planning or implementation.",
132
- order: 70,
133
- mode: "subagent",
134
- enabledByDefault: true,
135
- access: "read-only",
136
- persona: `You are DW Clarifier (role ID: dsmm-clarifier), a dsh-native requirements clarification specialist.
137
- Identify ambiguity in purpose, constraints, success criteria, and scope boundaries.
138
- Ask at most three material questions, prefer concrete choices, and propose safe defaults when evidence is strong.`
139
- },
140
- {
141
- id: "dsmm-media-reader",
142
- name: "DW Media Reader",
143
- description: "Extracts implementation-relevant information from images, PDFs, and visual artifacts.",
144
- order: 80,
145
- mode: "subagent",
146
- enabledByDefault: true,
147
- access: "read-only",
148
- persona: `You are DW Media Reader (role ID: dsmm-media-reader), a dsh-native visual and document analysis specialist.
149
- Extract text, structure, UI details, diagrams, and implementation-relevant facts from provided media.
150
- Report uncertainty clearly and avoid inventing details that are not visible.`
151
- }
4
+ "dsmm-orchestrator", "dsmm-planner", "dsmm-plan-critic", "dsmm-builder",
5
+ "dsmm-reviewer", "dsmm-oracle", "dsmm-oracle-2nd", "dsmm-creative",
6
+ "dsmm-code-search", "dsmm-doc-search", "dsmm-clarifier", "dsmm-media-reader",
7
+ "dsmm-frontend", "dsmm-hard-reasoning", "dsmm-research", "dsmm-quick",
8
+ "dsmm-coding", "dsmm-normal-task", "dsmm-complex", "dsmm-deep",
9
+ "dsmm-documenting", "dsmm-cross-cutting"
152
10
  ];
11
+ // Generated source catalog is checked against the exact literal ID inventory.
12
+ // It carries no OCMM provider/model default and requires only package assets.
13
+ export const DSMM_ROLES = SOURCE_ROLE_CATALOG.map((row) => ({
14
+ ...row,
15
+ id: row.id,
16
+ allowedChildren: row.allowedChildren,
17
+ childBuilderAllowedChildren: row.childBuilderAllowedChildren,
18
+ persona: buildRolePersona(row)
19
+ }));
20
+ const defaultEnabledRoleIds = DSMM_ROLES.filter((role) => role.enabledByDefault).map((role) => role.id);
153
21
  export function isDsmmRoleId(value) {
154
22
  return typeof value === "string" && DSMM_ROLE_IDS.includes(value);
155
23
  }
24
+ export function roleProviderName(role) { return `dsmm-role-${role.slice("dsmm-".length)}`; }
25
+ export function allowedRoleChildren(role, child = false) {
26
+ const definition = DSMM_ROLES.find(row => row.id === role);
27
+ return child && role === "dsmm-builder" ? definition.childBuilderAllowedChildren ?? [] : definition.allowedChildren;
28
+ }
156
29
  /** Root exposure is separate from whether a role is enabled for delegation. */
157
30
  export function isRootRole(role) {
158
31
  return role.mode === "primary" || role.mode === "all";
159
32
  }
160
- export function renderAgentCordis(role, skills = DSMM_SKILL_NAMES, enabledRoles = DSMM_ROLE_IDS, roleRouting = {}) {
161
- return rolePluginRows(role, skills, enabledRoles, roleRouting).map(renderPluginRow).join("");
33
+ /**
34
+ * @param skills Ignored compatibility argument; preserve its published position.
35
+ * Native Agent settings, not standing preset YAML, control skill visibility.
36
+ */
37
+ export function renderAgentCordis(role, skills = DSMM_SKILL_NAMES, enabledRoles = defaultEnabledRoleIds, roleRouting = {}) {
38
+ return rolePluginRows(role, skills, enabledRoles, roleRouting).map((row) => renderPluginRow(row)).join("");
162
39
  }
163
- /** The native PresetDefinition and the static YAML mirror use this same inventory. */
164
- export function rolePluginRows(role, skills = DSMM_SKILL_NAMES, enabledRoles = DSMM_ROLE_IDS, roleRouting = {}) {
40
+ const longDevelopmentRoles = ["dsmm-coding", "dsmm-frontend", "dsmm-deep", "dsmm-complex", "dsmm-cross-cutting"];
41
+ // Deployment-owned guidance from DSH rc.2's public standard preset, not a new
42
+ // role permission: Planner remains read-only after native plan-mode exit.
43
+ const nativePlanSection = `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.
44
+
45
+ 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.
46
+
47
+ 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 to keep the tool catalog unchanged. 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.
48
+
49
+ 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.
50
+
51
+ 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.
52
+
53
+ 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.`;
54
+ /** Standing native capabilities; session routes, skills and callable delegation are admission-owned. */
55
+ export function rolePluginRows(role, _skills = DSMM_SKILL_NAMES, _enabledRoles = defaultEnabledRoleIds, _roleRouting = {}) {
165
56
  const rows = [
166
57
  { id: "persona", name: "@deepseek-ai/dsh-persona", config: { prefix: role.persona } },
167
58
  { id: "agent-instructions", name: "@deepseek-ai/dsh-agent-instructions", config: { maxBytes: 65536 } },
168
- { id: "tool-fs", name: "@deepseek-ai/dsh-tool-fs" },
169
- { id: "tool-fs-search", name: "@deepseek-ai/dsh-tool-fs-search", config: { sampleOverCapGlobResults: false } },
170
- { id: "tool-web", name: "@deepseek-ai/dsh-tool-web", config: { fetch: true } },
59
+ { id: "tool-fs", name: "@dsmm/dsmm/permission-fs" },
60
+ { id: "tool-fs-search", name: "@dsmm/dsmm/permission-fs-search", config: { sampleOverCapGlobResults: false } },
61
+ { id: "tool-web", name: "@dsmm/dsmm/permission-web", config: { fetch: true } },
171
62
  { id: "skill-filesystem", name: "@deepseek-ai/dsh-skill-filesystem" },
172
- { id: "tool-skill", name: "@deepseek-ai/dsh-tool-skill" },
173
- { id: "dsmm-preset-skills", name: "@dsmm/dsmm/preset-skills", config: { skills: DSMM_SKILL_NAMES.filter((name) => skills.includes(name)) } }
63
+ { id: "tool-skill", name: "@deepseek-ai/dsh-tool-skill" }
174
64
  ];
175
65
  if (role.access !== "read-only") {
176
66
  rows.push({ id: "tool-bash", name: "@deepseek-ai/dsh-tool-bash", disabled: process.platform === "win32" });
177
67
  rows.push({ id: "tool-pwsh", name: "@deepseek-ai/dsh-tool-pwsh", disabled: process.platform !== "win32" });
178
68
  rows.push({ id: "tool-jobs", name: "@deepseek-ai/dsh-tool-jobs" });
179
69
  }
180
- if (role.id === "dsmm-orchestrator" || role.id === "dsmm-builder")
181
- rows.push(...roleSubagentPluginRows(enabledRoles, roleRouting));
182
- return rows;
183
- }
184
- /** DSH's spawn provider joins the parent's preset; persona/filter give each child its own role. */
185
- export function roleSubagentPluginRows(enabledRoles = DSMM_ROLE_IDS, roleRouting = {}) {
186
- return DSMM_ROLES.filter((role) => role.id !== "dsmm-orchestrator" && enabledRoles.includes(role.id)).map((role) => ({
187
- id: `subagent-${role.id}`,
188
- name: "@deepseek-ai/dsh-tool-subagent",
189
- config: roleSubagentConfig(role, [], roleRouting[role.id]?.primary)
190
- }));
191
- }
192
- export function roleSubagentConfig(role, availableTools = [], primary) {
193
- const readOnlyTools = ["read", "glob", "grep"];
194
- if (role.id === "dsmm-doc-search" || role.id === "dsmm-media-reader") {
195
- readOnlyTools.push("web_search", "web_fetch");
70
+ const root = isRootRole(role);
71
+ const longDevelopment = longDevelopmentRoles.includes(role.id);
72
+ if (root) {
73
+ rows.push({ id: "planning", name: "cordis:group", group: true, isolate: { planMode: true }, config: [
74
+ { id: "plan-mode", name: "@deepseek-ai/dsh-plan-mode", config: { section: nativePlanSection } }
75
+ ] });
196
76
  }
197
- // read_image is conditional on the DSH attachment store; an unknown name
198
- // would make DSH's native toolFilter reject the child at startup.
199
- if (role.id === "dsmm-media-reader" && availableTools.includes("read_image"))
200
- readOnlyTools.push("read_image");
201
- return {
202
- provider: roleProviderName(role.id),
203
- ...(primary === undefined ? {} : { agentOptions: { ...primary } }),
204
- toolName: role.id.replace(/-/gu, "_"),
205
- // A standing preset with modelSelectionSettings=true re-registers tools in
206
- // each child Agent's own scope. DSH restrictions filter inherited tools,
207
- // not same-scope registrations, so that would bypass readonly filters.
208
- modelSelectionSettings: false,
209
- backgroundMode: "one-shot",
210
- enableRunInBackground: false,
211
- persona: role.persona,
212
- ...(role.access === "read-only" ? { toolFilter: { allow: readOnlyTools } } : {})
213
- };
77
+ if (root || longDevelopment) {
78
+ rows.push({ id: "compaction", name: "cordis:group", group: true, isolate: { compaction: true, toolResultPruner: true }, config: [
79
+ { id: "compaction-basic", name: "@deepseek-ai/dsh-compaction-basic" },
80
+ { id: "command-compact", name: "@deepseek-ai/dsh-command-compact" },
81
+ { id: "tool-result-pruner", name: "@deepseek-ai/dsh-compaction-tool-result-pruner", config: { thresholdChars: 8192, headChars: 4096, tailChars: 1024 } }
82
+ ] });
83
+ rows.push({ id: "tool-ask-user", name: "@deepseek-ai/dsh-tool-ask-user" });
84
+ if (role.id !== "dsmm-planner")
85
+ rows.push({ id: "tool-todo", name: "@deepseek-ai/dsh-tool-todo", config: { allowParallelInProgress: true } });
86
+ }
87
+ return rows;
214
88
  }
215
89
  export function renderPresetMetadata(role) {
216
90
  return `id: ${role.id}
@@ -220,36 +94,33 @@ description: ${quoteYamlString(role.description)}
220
94
  }
221
95
  function indentBlock(value, spaces) {
222
96
  const prefix = " ".repeat(spaces);
223
- return value.split(/\r?\n/u).map((line) => `${prefix}${line}`).join("\n");
97
+ return value.split(/\r?\n/u).map((line) => line.length === 0 ? "" : `${prefix}${line}`).join("\n");
224
98
  }
225
- function renderPluginRow(row) {
226
- let output = `- id: ${row.id}\n name: ${quoteYamlString(row.name)}\n`;
99
+ function renderPluginRow(row, spaces = 0) {
100
+ const prefix = " ".repeat(spaces);
101
+ let output = `${prefix}- id: ${row.id}\n${prefix} name: ${quoteYamlString(row.name)}\n`;
227
102
  if (row.disabled !== undefined) {
228
- output += ` disabled: !!js process.platform ${row.id === "tool-bash" ? "===" : "!=="} 'win32'\n`;
103
+ output += `${prefix} disabled: !!js process.platform ${row.id === "tool-bash" ? "===" : "!=="} 'win32'\n`;
229
104
  }
105
+ if (row.group !== undefined)
106
+ output += `${prefix} group: ${row.group}\n`;
107
+ if (row.isolate !== undefined)
108
+ output += renderYamlField("isolate", row.isolate, spaces + 2);
230
109
  if (row.config === undefined)
231
110
  return output;
232
- output += " config:\n";
233
- for (const [key, value] of Object.entries(row.config)) {
234
- if (typeof value === "string" && value.includes("\n"))
235
- output += ` ${key}: |-\n${indentBlock(value, 6)}\n`;
236
- else if (typeof value === "string")
237
- output += ` ${key}: ${quoteYamlString(value)}\n`;
238
- else if (Array.isArray(value))
239
- output += value.length === 0 ? ` ${key}: []\n` : ` ${key}:\n${value.map((item) => ` - ${quoteYamlString(String(item))}\n`).join("")}`;
240
- else if (typeof value === "object" && value !== null) {
241
- output += ` ${key}:\n`;
242
- for (const [nestedKey, nestedValue] of Object.entries(value)) {
243
- if (Array.isArray(nestedValue))
244
- output += nestedValue.length === 0 ? ` ${nestedKey}: []\n` : ` ${nestedKey}:\n${nestedValue.map((item) => ` - ${quoteYamlString(String(item))}\n`).join("")}`;
245
- else
246
- output += ` ${nestedKey}: ${typeof nestedValue === "string" ? quoteYamlString(nestedValue) : String(nestedValue)}\n`;
247
- }
248
- }
249
- else
250
- output += ` ${key}: ${String(value)}\n`;
251
- }
252
- return output;
111
+ if (Array.isArray(row.config))
112
+ return output + `${prefix} config:\n${row.config.map((child) => renderPluginRow(child, spaces + 4)).join("")}`;
113
+ return output + renderYamlField("config", row.config, spaces + 2);
114
+ }
115
+ function renderYamlField(key, value, spaces) {
116
+ const prefix = " ".repeat(spaces);
117
+ if (typeof value === "string")
118
+ return value.includes("\n") ? `${prefix}${key}: |-\n${indentBlock(value, spaces + 2)}\n` : `${prefix}${key}: ${quoteYamlString(value)}\n`;
119
+ if (Array.isArray(value))
120
+ return value.length === 0 ? `${prefix}${key}: []\n` : `${prefix}${key}:\n${value.map((item) => `${prefix} - ${quoteYamlString(String(item))}\n`).join("")}`;
121
+ if (typeof value === "object" && value !== null)
122
+ return `${prefix}${key}:\n${Object.entries(value).map(([nestedKey, nestedValue]) => renderYamlField(nestedKey, nestedValue, spaces + 2)).join("")}`;
123
+ return `${prefix}${key}: ${String(value)}\n`;
253
124
  }
254
125
  function quoteYamlString(value) {
255
126
  return `'${value.replace(/'/gu, "''")}'`;
@@ -0,0 +1,19 @@
1
+ export type RouteJson = null | boolean | number | string | RouteJson[] | {
2
+ [key: string]: RouteJson;
3
+ };
4
+ export type ModelRouteJson = {
5
+ provider: string;
6
+ model: string;
7
+ reasoningEffort?: string;
8
+ } & {
9
+ [key: string]: RouteJson;
10
+ };
11
+ export declare function validateModelRouteFieldName(key: string): void;
12
+ /** Copies only lossless JSON, without evaluating getters or accepting prototype keys. */
13
+ export declare function copyRouteJson<T>(input: T): T;
14
+ /** Sparse deployment routes validate present fields; identity is required on complete values. */
15
+ export declare function normalizeModelRouteJson(input: unknown, sparse?: boolean, allowIdentityWhitespace?: boolean): ModelRouteJson;
16
+ /** Stable complete-value identity; not a replacement for legacy capture or role-pin hashes. */
17
+ export declare function canonicalModelRouteJson(input: unknown): string;
18
+ export declare function sameModelRouteJson(left: unknown, right: unknown): boolean;
19
+ //# sourceMappingURL=route-json.d.ts.map
@@ -0,0 +1,129 @@
1
+ const MAX_ROUTE_BYTES = 128 * 1024;
2
+ const hostFields = new Set([
3
+ "provider", "model", "messages", "tools", "toolHistory", "system", "input",
4
+ "agent", "agentId", "role", "roleId", "session", "sessionId", "signal",
5
+ "permission", "permissions", "auth", "authorization", "apiKey", "apiKeyEnv", "credentials",
6
+ "headers", "endpoint", "apiEndpoint", "baseURL", "url", "fetch", "onPayload", "callbacks",
7
+ "stream", "stream_options", "tool_choice", "parallel_tool_calls", "functions", "function_call",
8
+ "timeout", "timeoutMs", "transport", "transformHeaders", "onResponse",
9
+ "context", "systemPromptUpdate", "toolUpdate", "adapterDefaults",
10
+ "readOnly", "toolFilter", "authorityCeiling", "guards", "roleRouting", "runtimePolicy", "runtimePolicyCapture",
11
+ "subagents", "allowRouteOverride", "maxDepth", "toolTopology", "profilePin", "originalAdmissionEpoch", "admissionEpoch",
12
+ "childSessionId", "parentSessionId",
13
+ ].map(parameterKey));
14
+ const aliases = [
15
+ ["reasoningEffort", "reasoning_effort"],
16
+ ["maxTokens", "max_tokens", "max_completion_tokens", "max_output_tokens"],
17
+ ];
18
+ function parameterKey(key) { return key.toLowerCase().replace(/[-_]/gu, ""); }
19
+ function fail() { throw new TypeError("Model routes must contain bounded plain JSON and valid route fields"); }
20
+ const routeFields = new Set(["provider", "model", "temperature", "stop", ...aliases.flat()]);
21
+ export function validateModelRouteFieldName(key) {
22
+ if (["__proto__", "prototype", "constructor"].includes(key))
23
+ fail();
24
+ if (routeFields.has(key))
25
+ return;
26
+ if (hostFields.has(parameterKey(key))
27
+ || [...routeFields].some(field => parameterKey(field) === parameterKey(key)))
28
+ fail();
29
+ }
30
+ /** Copies only lossless JSON, without evaluating getters or accepting prototype keys. */
31
+ export function copyRouteJson(input) {
32
+ const active = new Set();
33
+ const copy = (value, depth) => {
34
+ if (depth > 32)
35
+ fail();
36
+ if (value === null || typeof value === "boolean")
37
+ return value;
38
+ if (typeof value === "string") {
39
+ if (new TextDecoder("utf-8", { ignoreBOM: true }).decode(new TextEncoder().encode(value)) !== value)
40
+ fail();
41
+ return value;
42
+ }
43
+ if (typeof value === "number" && Number.isFinite(value) && !Object.is(value, -0))
44
+ return value;
45
+ if (typeof value !== "object" || value === null || active.has(value))
46
+ fail();
47
+ const prototype = Object.getPrototypeOf(value);
48
+ if (Array.isArray(value) ? prototype !== Array.prototype : prototype !== Object.prototype && prototype !== null)
49
+ fail();
50
+ if (Object.getOwnPropertySymbols(value).length)
51
+ fail();
52
+ active.add(value);
53
+ const result = Array.isArray(value) ? [] : {};
54
+ for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(value))) {
55
+ if (Array.isArray(value) && key === "length")
56
+ continue;
57
+ if (new TextDecoder("utf-8", { ignoreBOM: true }).decode(new TextEncoder().encode(key)) !== key || ["__proto__", "prototype", "constructor"].includes(key)
58
+ || !Object.hasOwn(descriptor, "value") || !descriptor.enumerable)
59
+ fail();
60
+ if (Array.isArray(value) && !/^(0|[1-9][0-9]*)$/u.test(key))
61
+ fail();
62
+ Reflect.set(result, key, copy(descriptor.value, depth + 1));
63
+ }
64
+ if (Array.isArray(value) && Object.keys(result).length !== value.length)
65
+ fail();
66
+ active.delete(value);
67
+ return result;
68
+ };
69
+ const result = copy(input, 0);
70
+ if (new TextEncoder().encode(JSON.stringify(result)).byteLength > MAX_ROUTE_BYTES)
71
+ fail();
72
+ return result;
73
+ }
74
+ function boundedText(value, max) {
75
+ if (typeof value !== "string" || !value.trim() || value.length > max || /[\u0000-\u001f\u007f]/u.test(value))
76
+ fail();
77
+ }
78
+ /** Sparse deployment routes validate present fields; identity is required on complete values. */
79
+ export function normalizeModelRouteJson(input, sparse = false, allowIdentityWhitespace = false) {
80
+ const route = copyRouteJson(input);
81
+ if (route === null || typeof route !== "object" || Array.isArray(route))
82
+ fail();
83
+ const row = route;
84
+ if (!sparse && (!Object.hasOwn(row, "provider") || !Object.hasOwn(row, "model")))
85
+ fail();
86
+ for (const key of Object.keys(row)) {
87
+ validateModelRouteFieldName(key);
88
+ const value = row[key];
89
+ if (key === "provider") {
90
+ boundedText(value, 128);
91
+ if (!/^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$/u.test(allowIdentityWhitespace ? value.trim() : value))
92
+ fail();
93
+ }
94
+ else if (key === "model") {
95
+ boundedText(value, 512);
96
+ if (value.includes("://"))
97
+ fail();
98
+ }
99
+ else if (key === "reasoningEffort" || key === "reasoning_effort") {
100
+ boundedText(value, 64);
101
+ }
102
+ else if (key === "temperature") {
103
+ if (typeof value !== "number")
104
+ fail();
105
+ }
106
+ else if (aliases[1].includes(key)) {
107
+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value <= 0)
108
+ fail();
109
+ }
110
+ else if (key === "stop") {
111
+ if (!Array.isArray(value) || !value.every(item => typeof item === "string"))
112
+ fail();
113
+ }
114
+ }
115
+ for (const group of aliases)
116
+ if (group.filter(key => Object.hasOwn(row, key)).length > 1)
117
+ fail();
118
+ return row;
119
+ }
120
+ /** Stable complete-value identity; not a replacement for legacy capture or role-pin hashes. */
121
+ export function canonicalModelRouteJson(input) {
122
+ const order = (value) => Array.isArray(value) ? value.map(order)
123
+ : value !== null && typeof value === "object" ? Object.fromEntries(Object.keys(value).sort().map(key => [key, order(value[key])])) : value;
124
+ return JSON.stringify(order(normalizeModelRouteJson(input)));
125
+ }
126
+ export function sameModelRouteJson(left, right) {
127
+ return canonicalModelRouteJson(left) === canonicalModelRouteJson(right);
128
+ }
129
+ //# sourceMappingURL=route-json.js.map
@@ -27,6 +27,8 @@ export declare function normalizeRoutingStrategy(value: unknown): DsmmRoutingStr
27
27
  export declare function normalizeRateLimitOverrides(value: unknown): Partial<DsmmRateLimitPolicy>;
28
28
  export declare function normalizeRateLimitPolicy(value?: unknown, defaults?: Readonly<DsmmRateLimitPolicy>): DsmmRateLimitPolicy;
29
29
  export declare function normalizeRuntimePolicy(value?: unknown): DsmmRuntimePolicySettings;
30
+ /** Install a preflighted invocation only on this child's immutable settings identity. */
31
+ export declare function captureRoleRuntimePolicy(settings: DsmmSettings, role: DsmmRoleId, policy: DsmmResolvedRoleRuntimePolicy): void;
30
32
  /** Resolve once per immutable settings admission; omission and explicit [] remain distinct. */
31
33
  export declare function resolveRoleRuntimePolicy(settings: DsmmSettings, role?: DsmmRoleId): DsmmResolvedRoleRuntimePolicy;
32
34
  //# sourceMappingURL=routing-policy.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { canonicalModelRouteJson } from "./route-json.js";
1
2
  export const DEFAULT_DSMM_RATE_LIMIT_POLICY = Object.freeze({
2
3
  maxRetries: 3,
3
4
  initialDelayMs: 500,
@@ -57,6 +58,15 @@ function isRecord(value) {
57
58
  return typeof value === "object" && value !== null && !Array.isArray(value);
58
59
  }
59
60
  const resolvedRoleRuntimePolicies = new WeakMap();
61
+ /** Install a preflighted invocation only on this child's immutable settings identity. */
62
+ export function captureRoleRuntimePolicy(settings, role, policy) {
63
+ let policies = resolvedRoleRuntimePolicies.get(settings);
64
+ if (policies === undefined) {
65
+ policies = new Map();
66
+ resolvedRoleRuntimePolicies.set(settings, policies);
67
+ }
68
+ policies.set(role, policy);
69
+ }
60
70
  /** Resolve once per immutable settings admission; omission and explicit [] remain distinct. */
61
71
  export function resolveRoleRuntimePolicy(settings, role) {
62
72
  let policies = resolvedRoleRuntimePolicies.get(settings);
@@ -70,10 +80,10 @@ export function resolveRoleRuntimePolicy(settings, role) {
70
80
  const configured = role === undefined ? undefined : settings.roleRouting[role];
71
81
  const defaults = settings.runtimePolicy;
72
82
  const primary = configured?.primary === undefined ? undefined : Object.freeze({ ...configured.primary });
73
- const seen = new Set(primary === undefined ? [] : [JSON.stringify([primary.provider, primary.model])]);
83
+ const seen = new Set(primary === undefined ? [] : [canonicalModelRouteJson(primary)]);
74
84
  const fallbacks = [];
75
85
  for (const route of configured?.fallbackRoutes ?? settings.runtimeRecovery.fallbackRoutes) {
76
- const identity = JSON.stringify([route.provider, route.model]);
86
+ const identity = canonicalModelRouteJson(route);
77
87
  if (seen.has(identity))
78
88
  continue;
79
89
  seen.add(identity);