@dsmm/dsmm 0.1.9 → 0.2.0

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 (409) hide show
  1. package/README.md +40 -24
  2. package/agent-presets/dsmm-builder/agent.cordis.yml +1949 -39
  3. package/agent-presets/dsmm-builder/preset.yml +1 -1
  4. package/agent-presets/dsmm-clarifier/agent.cordis.yml +436 -14
  5. package/agent-presets/dsmm-clarifier/preset.yml +1 -1
  6. package/agent-presets/dsmm-code-search/agent.cordis.yml +56 -14
  7. package/agent-presets/dsmm-code-search/preset.yml +1 -1
  8. package/agent-presets/dsmm-coding/agent.cordis.yml +588 -0
  9. package/agent-presets/dsmm-coding/preset.yml +3 -0
  10. package/agent-presets/dsmm-complex/agent.cordis.yml +1140 -0
  11. package/agent-presets/dsmm-complex/preset.yml +3 -0
  12. package/agent-presets/dsmm-creative/agent.cordis.yml +536 -12
  13. package/agent-presets/dsmm-creative/preset.yml +1 -1
  14. package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +1163 -0
  15. package/agent-presets/dsmm-cross-cutting/preset.yml +3 -0
  16. package/agent-presets/dsmm-deep/agent.cordis.yml +1173 -0
  17. package/agent-presets/dsmm-deep/preset.yml +3 -0
  18. package/agent-presets/dsmm-doc-search/agent.cordis.yml +56 -14
  19. package/agent-presets/dsmm-doc-search/preset.yml +1 -1
  20. package/agent-presets/dsmm-documenting/agent.cordis.yml +581 -0
  21. package/agent-presets/dsmm-documenting/preset.yml +3 -0
  22. package/agent-presets/dsmm-frontend/agent.cordis.yml +580 -0
  23. package/agent-presets/dsmm-frontend/preset.yml +3 -0
  24. package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +572 -0
  25. package/agent-presets/dsmm-hard-reasoning/preset.yml +3 -0
  26. package/agent-presets/dsmm-media-reader/agent.cordis.yml +56 -14
  27. package/agent-presets/dsmm-media-reader/preset.yml +1 -1
  28. package/agent-presets/dsmm-normal-task/agent.cordis.yml +546 -0
  29. package/agent-presets/dsmm-normal-task/preset.yml +3 -0
  30. package/agent-presets/dsmm-oracle/agent.cordis.yml +421 -12
  31. package/agent-presets/dsmm-oracle/preset.yml +1 -1
  32. package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +421 -12
  33. package/agent-presets/dsmm-oracle-2nd/preset.yml +1 -1
  34. package/agent-presets/dsmm-orchestrator/agent.cordis.yml +2023 -43
  35. package/agent-presets/dsmm-orchestrator/preset.yml +1 -1
  36. package/agent-presets/dsmm-plan-critic/agent.cordis.yml +416 -13
  37. package/agent-presets/dsmm-plan-critic/preset.yml +1 -1
  38. package/agent-presets/dsmm-planner/agent.cordis.yml +462 -13
  39. package/agent-presets/dsmm-planner/preset.yml +1 -1
  40. package/agent-presets/dsmm-quick/agent.cordis.yml +119 -0
  41. package/agent-presets/dsmm-quick/preset.yml +3 -0
  42. package/agent-presets/dsmm-research/agent.cordis.yml +141 -0
  43. package/agent-presets/dsmm-research/preset.yml +3 -0
  44. package/agent-presets/dsmm-reviewer/agent.cordis.yml +420 -13
  45. package/agent-presets/dsmm-reviewer/preset.yml +1 -1
  46. package/cordis.patch.yml +1 -5
  47. package/docs/agent-presets.md +64 -15
  48. package/docs/compatibility.md +61 -13
  49. package/docs/design.md +41 -0
  50. package/docs/lsp.md +12 -2
  51. package/docs/migration-from-ocmm.md +8 -0
  52. package/docs/profiles.md +41 -15
  53. package/docs/releasing.md +78 -8
  54. package/docs/roadmap.md +6 -0
  55. package/docs/runtime-recovery.md +12 -0
  56. package/docs/safety-guards.md +7 -3
  57. package/docs/settings-status.md +148 -7
  58. package/docs/skill-sync.md +52 -14
  59. package/lib/client/DeploymentPage.d.ts +18 -0
  60. package/lib/client/DeploymentPage.js +120 -0
  61. package/lib/client/ProfilesSection.js +4 -2
  62. package/lib/client/deployment-controller.d.ts +50 -0
  63. package/lib/client/deployment-controller.js +193 -0
  64. package/lib/client/deployment-data.d.ts +16 -0
  65. package/lib/client/deployment-data.js +109 -0
  66. package/lib/client/deployment-locales.d.ts +66 -0
  67. package/lib/client/deployment-locales.js +72 -0
  68. package/lib/client/index.js +50 -0
  69. package/lib/client/locales.d.ts +4 -0
  70. package/lib/client/locales.js +4 -2
  71. package/lib/client/plugins-contract.d.ts +27 -0
  72. package/lib/client/plugins-contract.js +2 -0
  73. package/lib/client/styles.d.ts +1 -1
  74. package/lib/client/styles.js +16 -0
  75. package/lib/client.js +1048 -29
  76. package/lib/commands.js +3 -0
  77. package/lib/config-file-store.d.ts +23 -0
  78. package/lib/config-file-store.js +67 -0
  79. package/lib/deployment-config.d.ts +37 -0
  80. package/lib/deployment-config.js +184 -0
  81. package/lib/dsh-home.d.ts +3 -0
  82. package/lib/dsh-home.js +10 -0
  83. package/lib/dsh-types.d.ts +12 -65
  84. package/lib/guards.d.ts +2 -1
  85. package/lib/guards.js +19 -2
  86. package/lib/index.d.ts +8 -1
  87. package/lib/index.js +115 -25
  88. package/lib/lsp.d.ts +13 -0
  89. package/lib/lsp.js +60 -0
  90. package/lib/mode.js +42 -47
  91. package/lib/model-routing.js +5 -2
  92. package/lib/modules.d.ts +27 -0
  93. package/lib/modules.js +21 -0
  94. package/lib/native-scope.d.ts +9 -0
  95. package/lib/native-scope.js +20 -0
  96. package/lib/plan-validation.js +6 -44
  97. package/lib/preset-materializer.js +2 -0
  98. package/lib/preset-registry.d.ts +1 -1
  99. package/lib/preset-registry.js +7 -4
  100. package/lib/preset-skills.d.ts +4 -1
  101. package/lib/preset-skills.js +60 -19
  102. package/lib/profile-remote.d.ts +14 -0
  103. package/lib/profile-remote.js +197 -4
  104. package/lib/profile-rpc.d.ts +24 -1
  105. package/lib/profile-rpc.js +139 -1
  106. package/lib/profile-runtime.d.ts +24 -0
  107. package/lib/profile-runtime.js +177 -33
  108. package/lib/profile-store.d.ts +45 -1
  109. package/lib/profile-store.js +236 -102
  110. package/lib/profile-types.d.ts +55 -0
  111. package/lib/prompt-content.d.ts +25 -0
  112. package/lib/prompt-content.js +27 -0
  113. package/lib/prompts.d.ts +8 -2
  114. package/lib/prompts.js +46 -34
  115. package/lib/role-policy.d.ts +51 -0
  116. package/lib/role-policy.js +224 -0
  117. package/lib/role-providers.d.ts +6 -2
  118. package/lib/role-providers.js +72 -39
  119. package/lib/role-subagents.d.ts +6 -2
  120. package/lib/role-subagents.js +187 -48
  121. package/lib/roles.d.ts +16 -4
  122. package/lib/roles.js +86 -186
  123. package/lib/runtime-recovery.js +16 -5
  124. package/lib/session-scope.js +2 -0
  125. package/lib/settings.d.ts +69 -1
  126. package/lib/settings.js +262 -91
  127. package/lib/skills.d.ts +24 -9
  128. package/lib/skills.js +114 -35
  129. package/lib/state.d.ts +10 -6
  130. package/lib/state.js +48 -49
  131. package/lib/status.d.ts +25 -0
  132. package/lib/status.js +47 -9
  133. package/locale/en.json +2 -2
  134. package/locale/zh.json +2 -2
  135. package/package.json +19 -2
  136. package/prompts/deepwork.md +144 -20
  137. package/prompts/source/agents/clarifier.md +45 -0
  138. package/prompts/source/agents/orchestrator.md +63 -0
  139. package/prompts/source/agents/plan-critic.md +25 -0
  140. package/prompts/source/agents/planner.md +19 -0
  141. package/prompts/source/agents/reviewer.md +17 -0
  142. package/prompts/source/catalog.json +548 -0
  143. package/prompts/source/category/coding.md +46 -0
  144. package/prompts/source/category/complex.md +29 -0
  145. package/prompts/source/category/creative.md +38 -0
  146. package/prompts/source/category/cross-cutting.md +52 -0
  147. package/prompts/source/category/deep.md +62 -0
  148. package/prompts/source/category/documenting.md +62 -0
  149. package/prompts/source/category/frontend.md +38 -0
  150. package/prompts/source/category/hard-reasoning.md +53 -0
  151. package/prompts/source/category/normal-task.md +27 -0
  152. package/prompts/source/category/quick.md +34 -0
  153. package/prompts/source/category/research.md +56 -0
  154. package/prompts/source/deepwork/claude-opus-5.md +28 -0
  155. package/prompts/source/deepwork/codex.md +9 -0
  156. package/prompts/source/deepwork/default.md +129 -0
  157. package/prompts/source/deepwork/gemini.md +184 -0
  158. package/prompts/source/deepwork/glm.md +256 -0
  159. package/prompts/source/deepwork/gpt.md +43 -0
  160. package/prompts/source/deepwork/kimi-k27.md +13 -0
  161. package/prompts/source/deepwork/planner.md +41 -0
  162. package/prompts/source/deepwork/swe-2.md +13 -0
  163. package/prompts/source/manifest.json +3118 -0
  164. package/prompts/source/shared/dsh-host-contract.md +6 -0
  165. package/prompts/source/shared/locale.md +8 -0
  166. package/prompts/source/shared/shell-safety.md +7 -0
  167. package/prompts/source/terminal/builder.md +13 -0
  168. package/prompts/source/terminal/clarifier.md +41 -0
  169. package/prompts/source/terminal/code-search.md +39 -0
  170. package/prompts/source/terminal/coding.md +41 -0
  171. package/prompts/source/terminal/complex.md +43 -0
  172. package/prompts/source/terminal/creative.md +41 -0
  173. package/prompts/source/terminal/cross-cutting.md +43 -0
  174. package/prompts/source/terminal/deep.md +43 -0
  175. package/prompts/source/terminal/doc-search.md +39 -0
  176. package/prompts/source/terminal/documenting.md +41 -0
  177. package/prompts/source/terminal/frontend.md +41 -0
  178. package/prompts/source/terminal/hard-reasoning.md +41 -0
  179. package/prompts/source/terminal/media-reader.md +39 -0
  180. package/prompts/source/terminal/normal-task.md +41 -0
  181. package/prompts/source/terminal/oracle-2nd.md +53 -0
  182. package/prompts/source/terminal/oracle.md +53 -0
  183. package/prompts/source/terminal/orchestrator.md +26 -0
  184. package/prompts/source/terminal/plan-critic.md +41 -0
  185. package/prompts/source/terminal/planner.md +42 -0
  186. package/prompts/source/terminal/quick.md +39 -0
  187. package/prompts/source/terminal/research.md +39 -0
  188. package/prompts/source/terminal/reviewer.md +53 -0
  189. package/skills/ast-grep/LICENSE +21 -0
  190. package/skills/ast-grep/README.md +138 -0
  191. package/skills/ast-grep/SKILL.md +284 -0
  192. package/skills/ast-grep/SOURCE +1 -0
  193. package/skills/ast-grep/install.ps1 +235 -0
  194. package/skills/ast-grep/install.sh +286 -0
  195. package/skills/ast-grep/references/cli.md +233 -0
  196. package/skills/ast-grep/references/install.md +168 -0
  197. package/skills/ast-grep/references/patterns.md +149 -0
  198. package/skills/ast-grep/references/pitfalls.md +305 -0
  199. package/skills/ast-grep/references/recipes.md +404 -0
  200. package/skills/ast-grep/references/sgconfig.md +250 -0
  201. package/skills/ast-grep/references/yaml-rules.md +511 -0
  202. package/skills/ast-grep/scripts/ast_grep_helper.py +760 -0
  203. package/skills/ast-grep/tests/smoke.ps1 +129 -0
  204. package/skills/ast-grep/tests/smoke.sh +212 -0
  205. package/skills/ast-grep/tests/test_resolver.py +154 -0
  206. package/skills/brainstorming/SKILL.md +102 -9
  207. package/skills/coding-agent-sessions/LICENSE-UPSTREAM.md +82 -0
  208. package/skills/coding-agent-sessions/NOTICE.md +24 -0
  209. package/skills/coding-agent-sessions/SKILL.md +144 -0
  210. package/skills/coding-agent-sessions/agents/openai.yaml +4 -0
  211. package/skills/coding-agent-sessions/pyrightconfig.json +5 -0
  212. package/skills/coding-agent-sessions/references/all-platforms.md +77 -0
  213. package/skills/coding-agent-sessions/references/claude.md +34 -0
  214. package/skills/coding-agent-sessions/references/codex.md +32 -0
  215. package/skills/coding-agent-sessions/references/opencode.md +45 -0
  216. package/skills/coding-agent-sessions/references/senpi.md +29 -0
  217. package/skills/coding-agent-sessions/scripts/agent_sessions/__init__.py +1 -0
  218. package/skills/coding-agent-sessions/scripts/agent_sessions/aside_scanner.py +140 -0
  219. package/skills/coding-agent-sessions/scripts/agent_sessions/claude.py +66 -0
  220. package/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +283 -0
  221. package/skills/coding-agent-sessions/scripts/agent_sessions/codex.py +105 -0
  222. package/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +275 -0
  223. package/skills/coding-agent-sessions/scripts/agent_sessions/jsonio.py +55 -0
  224. package/skills/coding-agent-sessions/scripts/agent_sessions/kiro_scanner.py +91 -0
  225. package/skills/coding-agent-sessions/scripts/agent_sessions/opencode.py +289 -0
  226. package/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +46 -0
  227. package/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +104 -0
  228. package/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_optional_scanners.py +203 -0
  229. package/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_scanners.py +177 -0
  230. package/skills/coding-agent-sessions/scripts/agent_sessions/timeparse.py +51 -0
  231. package/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +149 -0
  232. package/skills/coding-agent-sessions/scripts/agent_sessions/types.py +57 -0
  233. package/skills/coding-agent-sessions/scripts/find-agent-sessions.py +19 -0
  234. package/skills/coding-agent-sessions/scripts/tests/test_agent_sessions.py +322 -0
  235. package/skills/coding-agent-sessions/scripts/tests/test_aside_scanner.py +131 -0
  236. package/skills/coding-agent-sessions/scripts/tests/test_cli_contract.py +126 -0
  237. package/skills/coding-agent-sessions/scripts/tests/test_extended_scanners.py +262 -0
  238. package/skills/coding-agent-sessions/scripts/tests/test_optional_sqlite_scanners.py +79 -0
  239. package/skills/coding-agent-sessions/scripts/tests/test_pi_family_scanners.py +130 -0
  240. package/skills/debugging/SKILL.md +125 -4
  241. package/skills/debugging/references/logging.md +2 -0
  242. package/skills/debugging/references/methodology/00-setup.md +2 -0
  243. package/skills/debugging/references/methodology/02-investigate.md +8 -2
  244. package/skills/debugging/references/methodology/03-flaky-triage.md +3 -1
  245. package/skills/debugging/references/methodology/04-hard-reasoning-escalation.md +4 -2
  246. package/skills/debugging/references/methodology/05-escalate.md +2 -0
  247. package/skills/debugging/references/methodology/06-fix.md +2 -0
  248. package/skills/debugging/references/methodology/08-qa.md +2 -0
  249. package/skills/debugging/references/methodology/09-cleanup.md +2 -0
  250. package/skills/debugging/references/methodology/partial-runtime-evidence.md +4 -2
  251. package/skills/debugging/references/runtimes/bundled-js-binary.md +2 -0
  252. package/skills/debugging/references/runtimes/go.md +2 -0
  253. package/skills/debugging/references/runtimes/native-binary.md +2 -0
  254. package/skills/debugging/references/runtimes/node.md +2 -0
  255. package/skills/debugging/references/runtimes/python.md +2 -0
  256. package/skills/debugging/references/runtimes/rust.md +2 -0
  257. package/skills/debugging/references/scripts/dap.test.mjs +539 -0
  258. package/skills/debugging/references/scripts/fixture-adapter.mjs +164 -0
  259. package/skills/debugging/references/tools/dap.md +3 -1
  260. package/skills/debugging/references/tools/ghidra.md +2 -0
  261. package/skills/debugging/references/tools/playwright-cli.md +2 -0
  262. package/skills/debugging/references/tools/pwndbg.md +2 -0
  263. package/skills/debugging/references/tools/pwntools.md +2 -0
  264. package/skills/dispatching-parallel-agents/SKILL.md +94 -7
  265. package/skills/frontend/.frontend-materialized.json +856 -0
  266. package/skills/frontend/ATTRIBUTION.md +37 -0
  267. package/skills/frontend/LICENSE-Apache-2.0.txt +201 -0
  268. package/skills/frontend/LICENSE-taste-skill.txt +21 -0
  269. package/skills/frontend/LICENSE-ui-ux-pro-max.txt +21 -0
  270. package/skills/frontend/SKILL.md +142 -0
  271. package/skills/frontend/references/design/README.md +256 -0
  272. package/skills/frontend/references/design/_INDEX.md +206 -0
  273. package/skills/frontend/references/design/airbnb.md +393 -0
  274. package/skills/frontend/references/design/airtable.md +92 -0
  275. package/skills/frontend/references/design/apple.md +250 -0
  276. package/skills/frontend/references/design/aside.md +211 -0
  277. package/skills/frontend/references/design/binance.md +348 -0
  278. package/skills/frontend/references/design/bmw.md +183 -0
  279. package/skills/frontend/references/design/brutalist-skill.md +92 -0
  280. package/skills/frontend/references/design/bugatti.md +271 -0
  281. package/skills/frontend/references/design/cal.md +262 -0
  282. package/skills/frontend/references/design/claude.md +315 -0
  283. package/skills/frontend/references/design/clay.md +307 -0
  284. package/skills/frontend/references/design/clickhouse.md +284 -0
  285. package/skills/frontend/references/design/clone-from-url.md +69 -0
  286. package/skills/frontend/references/design/cohere.md +269 -0
  287. package/skills/frontend/references/design/coinbase.md +132 -0
  288. package/skills/frontend/references/design/composio.md +310 -0
  289. package/skills/frontend/references/design/cursor.md +312 -0
  290. package/skills/frontend/references/design/design-system-architecture.md +250 -0
  291. package/skills/frontend/references/design/elevenlabs.md +268 -0
  292. package/skills/frontend/references/design/expo.md +284 -0
  293. package/skills/frontend/references/design/ferrari.md +317 -0
  294. package/skills/frontend/references/design/figma.md +223 -0
  295. package/skills/frontend/references/design/framer.md +249 -0
  296. package/skills/frontend/references/design/gpt-tasteskill.md +74 -0
  297. package/skills/frontend/references/design/hashicorp.md +281 -0
  298. package/skills/frontend/references/design/ibm.md +335 -0
  299. package/skills/frontend/references/design/image-to-code-skill.md +1228 -0
  300. package/skills/frontend/references/design/imagegen-brandkit.md +798 -0
  301. package/skills/frontend/references/design/imagegen-frontend-mobile.md +1465 -0
  302. package/skills/frontend/references/design/imagegen-frontend-web.md +987 -0
  303. package/skills/frontend/references/design/interaction-skill.md +52 -0
  304. package/skills/frontend/references/design/intercom.md +149 -0
  305. package/skills/frontend/references/design/kraken.md +128 -0
  306. package/skills/frontend/references/design/lamborghini.md +291 -0
  307. package/skills/frontend/references/design/linear.app.md +370 -0
  308. package/skills/frontend/references/design/lovable.md +301 -0
  309. package/skills/frontend/references/design/mastercard.md +368 -0
  310. package/skills/frontend/references/design/meta.md +369 -0
  311. package/skills/frontend/references/design/minimalist-skill.md +85 -0
  312. package/skills/frontend/references/design/minimax.md +260 -0
  313. package/skills/frontend/references/design/mintlify.md +329 -0
  314. package/skills/frontend/references/design/miro.md +111 -0
  315. package/skills/frontend/references/design/mistral.ai.md +264 -0
  316. package/skills/frontend/references/design/mongodb.md +269 -0
  317. package/skills/frontend/references/design/nike.md +366 -0
  318. package/skills/frontend/references/design/notion.md +312 -0
  319. package/skills/frontend/references/design/nvidia.md +296 -0
  320. package/skills/frontend/references/design/ollama.md +270 -0
  321. package/skills/frontend/references/design/opencode.ai.md +284 -0
  322. package/skills/frontend/references/design/output-skill.md +49 -0
  323. package/skills/frontend/references/design/pinterest.md +233 -0
  324. package/skills/frontend/references/design/playstation.md +367 -0
  325. package/skills/frontend/references/design/posthog.md +259 -0
  326. package/skills/frontend/references/design/raycast.md +271 -0
  327. package/skills/frontend/references/design/react-dev-tooling-skill.md +232 -0
  328. package/skills/frontend/references/design/redesign-skill.md +178 -0
  329. package/skills/frontend/references/design/renault.md +314 -0
  330. package/skills/frontend/references/design/replicate.md +264 -0
  331. package/skills/frontend/references/design/resend.md +306 -0
  332. package/skills/frontend/references/design/revolut.md +188 -0
  333. package/skills/frontend/references/design/runwayml.md +247 -0
  334. package/skills/frontend/references/design/sanity.md +360 -0
  335. package/skills/frontend/references/design/sentry.md +265 -0
  336. package/skills/frontend/references/design/shopify.md +353 -0
  337. package/skills/frontend/references/design/soft-skill.md +98 -0
  338. package/skills/frontend/references/design/spacex.md +197 -0
  339. package/skills/frontend/references/design/spotify.md +249 -0
  340. package/skills/frontend/references/design/starbucks.md +583 -0
  341. package/skills/frontend/references/design/stitch-design-example.md +121 -0
  342. package/skills/frontend/references/design/stitch-skill.md +184 -0
  343. package/skills/frontend/references/design/stripe.md +325 -0
  344. package/skills/frontend/references/design/supabase.md +258 -0
  345. package/skills/frontend/references/design/superhuman.md +255 -0
  346. package/skills/frontend/references/design/taste-skill.md +1206 -0
  347. package/skills/frontend/references/design/tesla.md +289 -0
  348. package/skills/frontend/references/design/theverge.md +342 -0
  349. package/skills/frontend/references/design/together.ai.md +266 -0
  350. package/skills/frontend/references/design/uber.md +298 -0
  351. package/skills/frontend/references/design/vercel.md +313 -0
  352. package/skills/frontend/references/design/vodafone.md +426 -0
  353. package/skills/frontend/references/design/voltagent.md +326 -0
  354. package/skills/frontend/references/design/warp.md +256 -0
  355. package/skills/frontend/references/design/webflow.md +95 -0
  356. package/skills/frontend/references/design/wired.md +281 -0
  357. package/skills/frontend/references/design/wise.md +176 -0
  358. package/skills/frontend/references/design/x.ai.md +260 -0
  359. package/skills/frontend/references/design/zapier.md +331 -0
  360. package/skills/frontend/references/perfection/README.md +264 -0
  361. package/skills/frontend/references/perfection/react-perf-tooling.md +234 -0
  362. package/skills/frontend/references/ui-ux-db/README.md +659 -0
  363. package/skills/frontend/references/ui-ux-db/data/app-interface.csv +31 -0
  364. package/skills/frontend/references/ui-ux-db/data/charts.csv +26 -0
  365. package/skills/frontend/references/ui-ux-db/data/colors.csv +162 -0
  366. package/skills/frontend/references/ui-ux-db/data/google-fonts.csv +1924 -0
  367. package/skills/frontend/references/ui-ux-db/data/icons.csv +106 -0
  368. package/skills/frontend/references/ui-ux-db/data/landing.csv +35 -0
  369. package/skills/frontend/references/ui-ux-db/data/products.csv +162 -0
  370. package/skills/frontend/references/ui-ux-db/data/react-performance.csv +45 -0
  371. package/skills/frontend/references/ui-ux-db/data/stacks/angular.csv +51 -0
  372. package/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +54 -0
  373. package/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -0
  374. package/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
  375. package/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
  376. package/skills/frontend/references/ui-ux-db/data/stacks/laravel.csv +51 -0
  377. package/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
  378. package/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
  379. package/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
  380. package/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +52 -0
  381. package/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -0
  382. package/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
  383. package/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -0
  384. package/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
  385. package/skills/frontend/references/ui-ux-db/data/stacks/threejs.csv +54 -0
  386. package/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -0
  387. package/skills/frontend/references/ui-ux-db/data/styles.csv +85 -0
  388. package/skills/frontend/references/ui-ux-db/data/typography.csv +74 -0
  389. package/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +162 -0
  390. package/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +100 -0
  391. package/skills/frontend/references/ui-ux-db/data/web-interface.csv +31 -0
  392. package/skills/frontend/references/ui-ux-db/scripts/core.py +262 -0
  393. package/skills/frontend/references/ui-ux-db/scripts/design_system.py +1148 -0
  394. package/skills/frontend/references/ui-ux-db/scripts/search.py +114 -0
  395. package/skills/frontend/scripts/perfection/lighthouse-audit.py +201 -0
  396. package/skills/git-master/SKILL.md +112 -0
  397. package/skills/git-master/agents/openai.yaml +13 -0
  398. package/skills/init-deep/SKILL.md +279 -0
  399. package/skills/receiving-code-review/SKILL.md +112 -7
  400. package/skills/remove-ai-slops/SKILL.md +159 -8
  401. package/skills/requesting-code-review/SKILL.md +96 -3
  402. package/skills/requesting-code-review/code-reviewer.md +47 -0
  403. package/skills/subagent-driven-development/SKILL.md +176 -6
  404. package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +23 -0
  405. package/skills/subagent-driven-development/implementer-prompt.md +69 -0
  406. package/skills/subagent-driven-development/spec-reviewer-prompt.md +32 -0
  407. package/skills/using-git-worktrees/SKILL.md +141 -0
  408. package/skills/writing-plans/SKILL.md +121 -7
  409. package/skills/writing-plans/plan-document-reviewer-prompt.md +38 -0
@@ -0,0 +1,120 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useId, useMemo, useState, useSyncExternalStore } from "react";
3
+ import { Button, Input } from "@deepseek-ai/dsh-client-ui-primitives";
4
+ import { DeploymentController } from "./deployment-controller.js";
5
+ import { at, enumValues, equal, inspectorPaths, mergeLayer, parseAdvanced, validateEditorValue } from "./deployment-data.js";
6
+ import { deploymentFieldLabels } from "./deployment-locales.js";
7
+ function label(path, t) {
8
+ const key = path.at(-1);
9
+ const item = deploymentFieldLabels[key];
10
+ return item === undefined ? key.replace(/^dsmm-/u, "").replace(/([a-z])([A-Z])/gu, "$1 $2") : item[t("global") === "DSMM 全局配置" ? 1 : 0];
11
+ }
12
+ function displayValue(value, t) {
13
+ if (value === undefined)
14
+ return t("unknown");
15
+ if (typeof value === "boolean")
16
+ return t(value ? "on" : "off");
17
+ const text = JSON.stringify(value);
18
+ return text.length > 120 ? `${text.slice(0, 120)}…` : text;
19
+ }
20
+ function AdvancedField({ schema, path, value, inherited, upper, reset, disabled, onChange, setInvalid, t }) {
21
+ const id = useId(), name = path.join(".");
22
+ const serialized = value === undefined ? "" : JSON.stringify(value, null, 2);
23
+ const [text, setText] = useState(serialized);
24
+ const [invalid, setLocalInvalid] = useState(false);
25
+ useEffect(() => { setText(serialized); setLocalInvalid(false); setInvalid(name, false); }, [serialized, reset]);
26
+ return _jsxs("details", { className: "dsmm-deployment-group", children: [_jsxs("summary", { children: [label(path, t), " \u00B7 ", t("advanced"), " ", _jsx("code", { children: name })] }), _jsxs("div", { className: "dsmm-field", children: [_jsxs("label", { htmlFor: id, children: [label(path, t), " \u00B7 ", t("advanced"), " ", _jsx("code", { children: name })] }), _jsx("p", { className: "dsmm-hint", id: `${id}-hint`, children: t("advancedHint") }), _jsx("textarea", { id: id, rows: 6, maxLength: 32768, value: text, disabled: disabled, "aria-invalid": invalid, "aria-describedby": `${id}-hint ${id}-error`, onChange: event => {
27
+ const next = event.currentTarget.value;
28
+ setText(next);
29
+ let parsed, valid = true;
30
+ try {
31
+ parsed = parseAdvanced(next);
32
+ const candidate = parsed === undefined ? inherited : mergeLayer(inherited, parsed);
33
+ valid = parsed === undefined || validateEditorValue(parsed, schema, true) && validateEditorValue(upper === undefined ? candidate : mergeLayer(candidate, upper), schema);
34
+ }
35
+ catch {
36
+ valid = false;
37
+ }
38
+ setLocalInvalid(!valid);
39
+ setInvalid(name, !valid);
40
+ if (valid)
41
+ onChange(parsed);
42
+ } }), _jsx("p", { id: `${id}-error`, className: "dsmm-hint", children: invalid ? t("invalid") : "" }), _jsxs("details", { children: [_jsxs("summary", { children: [t("advanced"), " \u00B7 schema"] }), _jsx("pre", { children: JSON.stringify(schema, null, 2) })] })] })] });
43
+ }
44
+ function ScalarField({ schema, path, controller, disabled, inherited, invalid, t }) {
45
+ const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot);
46
+ const value = at(state.draft, path), name = path.join("."), id = useId();
47
+ const [text, setText] = useState(String(value ?? inherited ?? ""));
48
+ const [bad, setBad] = useState(false);
49
+ useEffect(() => { setText(String(value ?? inherited ?? "")); setBad(false); invalid(name, false); }, [value, inherited, state.snapshot]);
50
+ return _jsxs(_Fragment, { children: [_jsxs("label", { htmlFor: id, children: [label(path, t), " ", _jsx("code", { children: name })] }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Input, { className: "dsmm-input", id: id, type: "text", inputMode: schema.type === "number" ? "decimal" : undefined, value: text, disabled: disabled, "aria-invalid": bad, "aria-describedby": `${id}-error`, onChange: event => {
51
+ const raw = event.currentTarget.value;
52
+ setText(raw);
53
+ const candidate = schema.type === "number" ? Number(raw) : raw;
54
+ const valid = (schema.type !== "number" || raw.trim() !== "") && validateEditorValue(candidate, schema);
55
+ setBad(!valid);
56
+ invalid(name, !valid);
57
+ if (valid)
58
+ controller.edit(path, candidate);
59
+ } }), _jsx(Button, { type: "button", variant: "outline", disabled: disabled || value === undefined && !bad, onClick: () => { setText(String(inherited ?? "")); setBad(false); invalid(name, false); controller.edit(path, undefined); }, children: t("inherit") })] }), _jsxs("p", { id: `${id}-error`, className: "dsmm-hint", children: [bad ? t("invalid") : "", schema.type === "number" && (schema.min !== undefined || schema.max !== undefined) ? ` ${schema.min ?? "—"} – ${schema.max ?? "—"}` : ""] })] });
60
+ }
61
+ function Field({ schema, path, controller, invalid, t }) {
62
+ const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot), snapshot = state.snapshot;
63
+ const id = useId(), name = path.join("."), explicit = at(state.draft, path);
64
+ const inherited = controller.layer === "global" ? at(snapshot.defaults, path) : at(mergeLayer(mergeLayer(snapshot.defaults, snapshot.global), snapshot.nativeForm?.base ?? {}), path);
65
+ const disabled = state.busy || state.issue === "not-owned" || state.issue === "unavailable" || state.issue === "transport" || controller.layer === "profile" && !controller.canWriteProfile();
66
+ const choices = enumValues(schema);
67
+ if (schema.type === "object" && schema.fields !== undefined && path[0] !== "roleRouting" && path[0] !== "lsp")
68
+ return _jsxs("details", { className: "dsmm-deployment-group", children: [_jsxs("summary", { children: [label(path, t), " ", _jsx("code", { children: name })] }), _jsx("div", { children: Object.entries(schema.fields).map(([key, node]) => _jsx(Field, { schema: node, path: [...path, key], controller: controller, invalid: invalid, t: t }, key)) })] });
69
+ if (!["boolean", "string", "number"].includes(schema.type) && choices === null)
70
+ return _jsx(AdvancedField, { schema: schema, path: path, value: explicit, inherited: inherited, upper: controller.layer === "global" ? at(snapshot.profile, path) : undefined, reset: snapshot, disabled: disabled, t: t, onChange: value => controller.edit(path, value), setInvalid: invalid });
71
+ return _jsxs("div", { className: "dsmm-field dsmm-deployment-field", children: [schema.type === "boolean" || choices !== null ? _jsxs(_Fragment, { children: [_jsxs("label", { htmlFor: id, children: [label(path, t), " ", _jsx("code", { children: name })] }), _jsxs("select", { id: id, disabled: disabled, value: explicit === undefined ? "inherit" : JSON.stringify(explicit), onChange: event => controller.edit(path, event.currentTarget.value === "inherit" ? undefined : JSON.parse(event.currentTarget.value)), children: [_jsxs("option", { value: "inherit", children: [t("inherit"), " \u00B7 ", displayValue(inherited, t)] }), (choices ?? [true, false]).map(choice => _jsx("option", { value: JSON.stringify(choice), children: displayValue(choice, t) }, String(choice)))] })] }) : _jsx(ScalarField, { schema: schema, path: path, controller: controller, disabled: disabled, inherited: inherited, invalid: invalid, t: t }), (explicit !== undefined || controller.layer === "profile" && at(snapshot.nativeForm?.base, path) !== undefined) && _jsxs("p", { className: "dsmm-hint", children: [explicit === undefined ? "" : equal(explicit, at(snapshot.defaults, path)) ? t("defaultPin") : t("explicit"), controller.layer === "profile" && at(snapshot.nativeForm?.base, path) !== undefined ? `${explicit === undefined ? "" : " · "}${t("hostPin")}` : ""] })] });
72
+ }
73
+ function Layer({ controller, t }) {
74
+ const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot);
75
+ const [invalid, setInvalid] = useState(new Set());
76
+ const updateInvalid = (path, bad) => { controller.setInvalid(path, bad); setInvalid(previous => { if (previous.has(path) === bad)
77
+ return previous; const next = new Set(previous); if (bad)
78
+ next.add(path);
79
+ else
80
+ next.delete(path); return next; }); };
81
+ const title = controller.layer === "global" ? "global" : "profile";
82
+ const disabled = state.busy || state.snapshot === null || state.issue !== null || invalid.size > 0 || controller.layer === "profile" && !controller.canWriteProfile();
83
+ return _jsxs("div", { "data-dsmm-layer": controller.layer, "aria-busy": state.busy, children: [_jsxs("details", { className: "dsmm-deployment-card", children: [_jsxs("summary", { children: [t(title), _jsx("span", { role: "status", "aria-live": "polite", className: "dsmm-hint", children: state.busy ? t("saving") : state.dirty ? t("dirty") : state.saved ? t("saved") : "" })] }), _jsxs("fieldset", { children: [_jsx("legend", { children: t(title) }), _jsx("p", { className: "dsmm-hint", children: t(title === "global" ? "globalHint" : "profileHint") }), state.snapshot !== null && Object.entries(state.snapshot.schema.fields ?? {}).filter(([key]) => controller.layer === "global" || key !== "modules").sort(([a], [b]) => a === "modules" ? -1 : b === "modules" ? 1 : 0).map(([key, schema]) => _jsx(Field, { schema: schema, path: [key], controller: controller, invalid: updateInvalid, t: t }, key)), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "primary", disabled: disabled || !state.dirty, onClick: () => { void controller.save(); }, children: t(state.busy ? "saving" : title === "global" ? "saveGlobal" : "saveProfile") }), _jsx(Button, { type: "button", variant: "outline", disabled: state.busy, onClick: () => { void controller.refresh(); }, children: t("refresh") }), _jsx(Button, { type: "button", variant: "outline", disabled: state.busy || !state.dirty && state.issue === null, onClick: () => { setInvalid(new Set()); void controller.refresh(true); }, children: t("discard") })] })] })] }), state.issue !== null && _jsx("p", { className: "dsmm-issue", role: "alert", children: t(state.issue) }), invalid.size > 0 && _jsx("p", { className: "dsmm-issue", role: "alert", children: t("invalid") }), controller.layer === "profile" && !controller.canWriteProfile() && _jsx("p", { className: "dsmm-hint", children: t("unavailableForm") })] });
84
+ }
85
+ function NativeProfileLayer({ namespace, forms, remote, form, core, t }) {
86
+ const shared = useMemo(() => forms.get(namespace), [forms, namespace]);
87
+ const snapshot = useSyncExternalStore(listener => shared.subscribe(listener), () => shared.getSnapshot());
88
+ const controller = useMemo(() => core.forProfile(namespace), [core, remote, namespace]);
89
+ const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot);
90
+ const coreState = useSyncExternalStore(core.subscribe, core.getSnapshot);
91
+ controller.attachForm(form ?? { state: snapshot, mutate: (ops, revision) => shared.mutate(ops, revision) });
92
+ useEffect(() => { void controller.refresh(); return () => controller.dispose(); }, [controller]);
93
+ useEffect(() => { if (state.saved)
94
+ void core.refresh(); }, [state.saved, core]);
95
+ useEffect(() => { if (controller.getSnapshot().snapshot !== null)
96
+ void controller.refresh(); }, [coreState.snapshot?.globalRevision, snapshot.revision, controller]);
97
+ return _jsx(Layer, { controller: controller, t: t });
98
+ }
99
+ function StateInspector({ controller, session, t }) {
100
+ const { snapshot, dirty, issue } = useSyncExternalStore(controller.subscribe, controller.getSnapshot);
101
+ if (snapshot === null)
102
+ return null;
103
+ const admitted = session?.configuration ?? null;
104
+ const source = (value) => t(value === "profile" ? "profileSource" : value === "global" ? "globalSource" : value === "defaults" ? "defaultsSource" : value === "named-session" ? "namedSource" : value === "startup" ? "startupSource" : value === "deployment" ? "deploymentCapture" : value === "mixed" ? "mixedSource" : "unknown");
105
+ const value = (layer, path) => layer === undefined ? t("unknown") : at(layer, path.split(".")) === undefined ? t("absent") : displayValue(at(layer, path.split(".")), t);
106
+ const metadata = (layer, path, entry) => layer !== undefined && at(layer, path.split(".")) === undefined && entry === undefined ? t("absent") : source(entry);
107
+ return _jsxs("details", { className: "dsmm-deployment-card", children: [_jsxs("summary", { children: [t("state"), _jsx("span", { className: "dsmm-hint", children: (snapshot.nextRoot?.restartRequired.length ?? 0) > 0 ? t("pending") : dirty || issue !== null ? t("inspectorStale") : "" })] }), _jsxs("div", { children: [_jsx("p", { role: "status", "aria-live": "polite", children: session === null ? t("noSession") : admitted === null ? t("sessionUnavailable") : `${t("namedSource")}: ${admitted.named?.id ?? "—"}` }), session !== null && _jsxs("p", { children: [t("session"), ": ", _jsx("code", { children: session.sessionId }), " \u00B7 ", _jsx("code", { children: session.admissionEpoch }), " \u00B7 ", session.scope] }), (dirty || issue !== null) && _jsx("p", { className: "dsmm-hint", children: t("inspectorStale") }), _jsxs("p", { className: "dsmm-hint", children: ["Global CAS: ", _jsx("code", { children: snapshot.globalRevision }), " \u00B7 native CAS: ", _jsx("code", { children: snapshot.nativeRevision }), " \u00B7 Host form: ", snapshot.nativeFormRevision ?? "—"] }), inspectorPaths(snapshot, admitted).map(path => _jsxs("dl", { className: "dsmm-deployment-state", children: [_jsx("dt", { children: _jsx("code", { children: path }) }), _jsxs("dd", { children: [t("globalSource"), ": ", at(snapshot.global, path.split(".")) === undefined ? t("absent") : t("globalSource")] }), _jsxs("dd", { children: [t("desired"), ": ", value(snapshot.desired, path), " \u00B7 ", metadata(snapshot.desired, path, snapshot.sources[path])] }), _jsxs("dd", { children: [t("startup"), ": ", value(snapshot.startup, path), " \u00B7 ", metadata(snapshot.startup, path, snapshot.startupSources?.[path]), " / ", at(snapshot.startup, path.split(".")) === undefined ? t("absent") : t("startupSource")] }), _jsxs("dd", { children: [t("next"), ": ", value(snapshot.nextRoot?.settings, path), " \u00B7 ", metadata(snapshot.nextRoot?.settings, path, snapshot.nextRoot?.sources[path]), " / ", metadata(snapshot.nextRoot?.settings, path, snapshot.nextRoot?.captures[path])] }), _jsxs("dd", { children: [t("session"), ": ", value(admitted?.settings, path), " \u00B7 ", metadata(admitted?.settings, path, admitted?.sources[path]), " / ", metadata(admitted?.settings, path, admitted?.captures[path])] })] }, path)), (snapshot.nextRoot?.restartRequired.length ?? 0) > 0 && _jsxs("p", { children: [t("pending"), ": ", snapshot.nextRoot.restartRequired.join(", ")] })] })] });
108
+ }
109
+ export function DeploymentPage(props) {
110
+ const state = useSyncExternalStore(props.core.subscribe, props.core.getSnapshot);
111
+ useEffect(() => { if (props.view === "page")
112
+ void props.core.refresh(); }, [props.core, props.view]);
113
+ if (props.view === "summary")
114
+ return _jsx("span", { children: props.t("summary") });
115
+ const { t } = props, snapshot = state.snapshot, module = snapshot?.modules[0];
116
+ return _jsxs("section", { className: "dsmm-profiles dsmm-deployment", "data-dsmm-page": true, "aria-label": t("title"), children: [_jsx("p", { className: "dsmm-hint", children: t("description") }), _jsx("p", { className: "dsmm-hint", children: t("boundaries") }), _jsxs("details", { className: "dsmm-deployment-card", children: [_jsxs("summary", { children: [t("module"), _jsx("span", { className: "dsmm-hint", children: module?.pending ? t("pending") : module === undefined ? t("unknown") : t(module.desired.enabled ? "on" : "off") })] }), _jsxs("div", { children: [_jsx("p", { children: t("hostUnknown") }), _jsxs("p", { children: [t("desired"), ": ", module === undefined ? t("unknown") : t(module.desired.enabled ? "on" : "off"), " \u00B7 ", module?.desired.source ?? "—"] }), _jsxs("p", { children: [t("startup"), ": ", module === undefined ? t("unknown") : t(module.startupMounted ? "on" : "off"), " \u00B7 ", t("next"), ": ", module === undefined ? t("unknown") : t(module.nextRoot.admitted ? "on" : "off")] }), _jsxs("p", { children: [t("session"), ": ", state.session?.modules?.[0]?.admitted == null ? t("unknown") : t(state.session.modules[0].admitted ? "on" : "off")] }), _jsx("p", { className: "dsmm-hint", children: t("ceiling") })] })] }), _jsx(Layer, { controller: props.core, t: t }), props.profilePage && props.forms !== undefined && snapshot?.namespace !== null && snapshot?.namespace !== undefined && (props.rowNamespace === undefined || props.rowNamespace === snapshot.namespace)
117
+ ? _jsx(NativeProfileLayer, { namespace: snapshot.namespace, forms: props.forms, remote: props.remote, form: props.form, core: props.core, t: t }, `${snapshot.hostProfileKey}:${snapshot.entryId}`)
118
+ : _jsxs("div", { children: [_jsxs("details", { className: "dsmm-deployment-card", children: [_jsxs("summary", { children: [t("profile"), _jsx("span", { className: "dsmm-hint", children: t("profileUnavailable") })] }), _jsx("div", { children: _jsx("p", { children: t("profileHint") }) })] }), _jsx("p", { className: "dsmm-hint", children: t("unavailableForm") })] }), _jsx(StateInspector, { controller: props.core, session: state.session, t: t })] });
119
+ }
120
+ //# sourceMappingURL=DeploymentPage.js.map
@@ -27,6 +27,8 @@ export function ProfilesSection(props) {
27
27
  const disabled = state.busy !== null || state.pendingEditor !== null || state.sessionBusy === "apply" || state.sessionBusy === "reset";
28
28
  const snapshot = state.snapshot;
29
29
  const editor = state.editor;
30
+ const readOnly = snapshot?.readOnly === true;
31
+ const editorDisabled = disabled || readOnly;
30
32
  const reconcilable = canReconcileSelection(snapshot);
31
33
  const selectionConflict = reconcilable && snapshot?.selectionError?.code === "conflict";
32
34
  const invalid = state.issue?.kind === "domain" && state.issue.code === "validation";
@@ -57,10 +59,10 @@ export function ProfilesSection(props) {
57
59
  else if (snapshot?.selectedId !== null && snapshot?.selectedId !== undefined)
58
60
  selection = t("appliedProfile", { id: snapshot.selectedId, revision: snapshot.appliedRevision?.slice(0, 12) ?? "—" });
59
61
  const notice = state.notice === null ? "" : t(state.notice.key === "reset" ? "resetDone" : state.notice.key, { id: state.notice.id });
60
- return _jsxs("section", { className: "dsmm-profiles", "aria-labelledby": `${prefix}-title`, "aria-busy": state.busy !== null, children: [_jsx("h2", { id: `${prefix}-title`, children: t("title") }), _jsx("p", { children: t("description") }), _jsx("h3", { id: `${prefix}-global`, children: t("globalScope") }), _jsx("p", { className: "dsmm-hint", children: t("newSessions") }), _jsx("p", { "data-dsmm-selection": true, children: selection }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: disabled || snapshot === null, onClick: () => { void props.create(); }, children: t("new") }), _jsx(Button, { type: "button", variant: "outline", disabled: disabled, onClick: () => { void props.refresh(); }, children: t(state.busy === "refresh" ? "refreshing" : "refresh") }), _jsx(Button, { type: "button", variant: "outline", disabled: disabled || !reconcilable || (snapshot?.selectedId === null && !selectionConflict), onClick: () => { void props.reset(); }, children: t(state.busy === "reset" ? "resetting" : "reset") })] }), snapshot !== null && _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-select`, children: t("editorSelect") }), _jsxs("select", { ref: selectRef, id: `${prefix}-select`, disabled: disabled, value: editor?.revision == null ? "" : editor.id, onChange: (event) => { if (event.currentTarget.value)
62
+ return _jsxs("section", { className: "dsmm-profiles", "aria-labelledby": `${prefix}-title`, "aria-busy": state.busy !== null, children: [_jsx("h2", { id: `${prefix}-title`, children: t("title") }), _jsx("p", { children: t("description") }), snapshot?.origin !== undefined && _jsx("p", { className: "dsmm-hint", children: t(snapshot.origin === "legacy" ? "legacyOrigin" : snapshot.origin === "central" ? "centralOrigin" : "explicitOrigin") }), readOnly && _jsx("p", { role: "status", className: "dsmm-hint", children: t("readOnlyOrigin") }), _jsx("h3", { id: `${prefix}-global`, children: t("globalScope") }), _jsx("p", { className: "dsmm-hint", children: t("newSessions") }), _jsx("p", { "data-dsmm-selection": true, children: selection }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: editorDisabled || snapshot === null, onClick: () => { void props.create(); }, children: t("new") }), _jsx(Button, { type: "button", variant: "outline", disabled: disabled, onClick: () => { void props.refresh(); }, children: t(state.busy === "refresh" ? "refreshing" : "refresh") }), _jsx(Button, { type: "button", variant: "outline", disabled: editorDisabled || !reconcilable || (snapshot?.selectedId === null && !selectionConflict), onClick: () => { void props.reset(); }, children: t(state.busy === "reset" ? "resetting" : "reset") })] }), snapshot !== null && _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-select`, children: t("editorSelect") }), _jsxs("select", { ref: selectRef, id: `${prefix}-select`, disabled: disabled, value: editor?.revision == null ? "" : editor.id, onChange: (event) => { if (event.currentTarget.value)
61
63
  void props.open(event.currentTarget.value); }, children: [_jsx("option", { value: "", children: t(editor?.revision === null ? "newDraft" : "choose") }), snapshot.profiles.map((profile, index) => _jsxs("option", { value: profile.id, children: [profile.label === undefined ? profile.id : `${profile.label} (${profile.id})`, profile.error === undefined ? "" : ` — ${t("invalidProfile", { id: profile.id })}`] }, `${index}:${profile.id}`))] }), snapshot.profiles.length === 0 && _jsx("p", { className: "dsmm-hint", children: t("empty") })] }), state.pendingEditor !== null && _jsxs("div", { className: "dsmm-confirm", role: "group", "aria-labelledby": `${prefix}-confirm`, onKeyDown: (event) => { if (event.key === "Escape") {
62
64
  event.preventDefault();
63
65
  props.cancelDiscard();
64
- } }, children: [_jsx("p", { id: `${prefix}-confirm`, children: t("discardPrompt") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", onClick: () => { void props.discardAndOpen(); }, children: t("discard") }), _jsx(Button, { ref: cancelRef, type: "button", variant: "primary", onClick: props.cancelDiscard, children: t("cancel") })] })] }), _jsx(SessionScope, { state: state, actions: props, t: t }), _jsxs("div", { className: "dsmm-catalog", children: [_jsx("h3", { children: t("catalogTitle") }), _jsx("p", { className: "dsmm-hint", children: t("catalogHint") }), state.catalogUnavailable && _jsx("p", { className: "dsmm-hint", children: t("catalogUnavailable") }), state.catalog?.failures.map((failure) => _jsx("p", { className: "dsmm-hint", children: t("catalogFailure", { name: failure.name, id: failure.id }) }, failure.id)), _jsx(Button, { type: "button", variant: "outline", disabled: state.catalogBusy, onClick: () => { void props.refreshCatalog(); }, children: t(state.catalogBusy ? "catalogRefreshing" : "catalogRefresh") })] }), editor !== null && _jsxs("div", { className: "dsmm-editor", children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-id`, children: t("profileId") }), _jsx(Input, { ref: inputRef, id: `${prefix}-id`, className: "dsmm-input", value: editor.id, disabled: disabled || editor.revision !== null, "aria-invalid": idInvalid || undefined, "aria-describedby": `${prefix}-id-hint${idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => props.editId(event.currentTarget.value) }), _jsx("p", { id: `${prefix}-id-hint`, className: "dsmm-hint", children: t("idHint") })] }), _jsx(StructuredEditor, { state: state, actions: props, disabled: disabled, t: t }, state.editorEpoch), _jsxs("details", { className: "dsmm-advanced", open: true, children: [_jsx("summary", { children: t("advanced") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-content`, children: t("configuration") }), _jsx("textarea", { ref: editorRef, id: `${prefix}-content`, rows: 12, spellCheck: false, value: editor.content, disabled: disabled, "aria-invalid": rawInvalid || (invalid && !idInvalid) || undefined, "aria-describedby": `${prefix}-content-hint ${prefix}-structural-hint${invalid && !idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => props.editContent(event.currentTarget.value) }), _jsx("p", { id: `${prefix}-content-hint`, className: "dsmm-hint", children: t("configurationHint") }), _jsx("p", { id: `${prefix}-structural-hint`, className: "dsmm-hint", children: t("structuralHint") })] })] }), _jsx("p", { "data-dsmm-editor-state": true, children: t(state.dirty ? "dirty" : applied ? "savedApplied" : "savedNotApplied") }), _jsx("p", { id: `${prefix}-global-action`, className: "dsmm-hint", children: t("globalActionHint") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "primary", disabled: disabled || !state.dirty || snapshot === null || state.invalidFields.length > 0, onClick: () => { void props.save(); }, children: t(state.busy === "save" ? "saving" : "save") }), _jsx(Button, { type: "button", variant: "outline", "aria-describedby": `${prefix}-global-action`, disabled: disabled || state.dirty || editor.revision === null || !reconcilable || (applied && !selectionConflict), onClick: () => { void props.apply(); }, children: t(state.busy === "apply" ? "applying" : "apply") }), editor.revision !== null && _jsx(Button, { type: "button", variant: "outline", disabled: disabled, onClick: () => { void props.reload(); }, children: t("reload") })] })] }), state.issue !== null && _jsxs("div", { className: "dsmm-issue", id: `${prefix}-issue`, role: "alert", children: [_jsx("p", { children: t(issueKey(state.issue)) }), state.issue.kind === "domain" && state.issue.message !== undefined && _jsxs("p", { children: [t("details"), ": ", state.issue.message] })] }), snapshot?.selectionError !== undefined && _jsxs("div", { className: "dsmm-issue", children: [_jsxs("p", { children: [t("details"), ": ", snapshot.selectionError.message] }), _jsx("p", { children: t(selectionConflict ? "selectionConflict" : "retry") })] }), _jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: state.busy === "refresh" && snapshot === null ? t("loading") : state.busy === "read" ? t("reading") : notice })] });
66
+ } }, children: [_jsx("p", { id: `${prefix}-confirm`, children: t("discardPrompt") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", onClick: () => { void props.discardAndOpen(); }, children: t("discard") }), _jsx(Button, { ref: cancelRef, type: "button", variant: "primary", onClick: props.cancelDiscard, children: t("cancel") })] })] }), _jsx(SessionScope, { state: state, actions: props, t: t }), _jsxs("div", { className: "dsmm-catalog", children: [_jsx("h3", { children: t("catalogTitle") }), _jsx("p", { className: "dsmm-hint", children: t("catalogHint") }), state.catalogUnavailable && _jsx("p", { className: "dsmm-hint", children: t("catalogUnavailable") }), state.catalog?.failures.map((failure) => _jsx("p", { className: "dsmm-hint", children: t("catalogFailure", { name: failure.name, id: failure.id }) }, failure.id)), _jsx(Button, { type: "button", variant: "outline", disabled: state.catalogBusy, onClick: () => { void props.refreshCatalog(); }, children: t(state.catalogBusy ? "catalogRefreshing" : "catalogRefresh") })] }), editor !== null && _jsxs("div", { className: "dsmm-editor", children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-id`, children: t("profileId") }), _jsx(Input, { ref: inputRef, id: `${prefix}-id`, className: "dsmm-input", value: editor.id, disabled: disabled || editor.revision !== null, "aria-invalid": idInvalid || undefined, "aria-describedby": `${prefix}-id-hint${idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => props.editId(event.currentTarget.value) }), _jsx("p", { id: `${prefix}-id-hint`, className: "dsmm-hint", children: t("idHint") })] }), _jsx(StructuredEditor, { state: state, actions: props, disabled: editorDisabled, t: t }, state.editorEpoch), _jsxs("details", { className: "dsmm-advanced", open: true, children: [_jsx("summary", { children: t("advanced") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-content`, children: t("configuration") }), _jsx("textarea", { ref: editorRef, id: `${prefix}-content`, rows: 12, spellCheck: false, value: editor.content, readOnly: readOnly, disabled: disabled, "aria-invalid": rawInvalid || (invalid && !idInvalid) || undefined, "aria-describedby": `${prefix}-content-hint ${prefix}-structural-hint${invalid && !idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => props.editContent(event.currentTarget.value) }), _jsx("p", { id: `${prefix}-content-hint`, className: "dsmm-hint", children: t("configurationHint") }), _jsx("p", { id: `${prefix}-structural-hint`, className: "dsmm-hint", children: t("structuralHint") })] })] }), _jsx("p", { "data-dsmm-editor-state": true, children: t(state.dirty ? "dirty" : applied ? "savedApplied" : "savedNotApplied") }), _jsx("p", { id: `${prefix}-global-action`, className: "dsmm-hint", children: t("globalActionHint") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "primary", disabled: editorDisabled || !state.dirty || snapshot === null || state.invalidFields.length > 0, onClick: () => { void props.save(); }, children: t(state.busy === "save" ? "saving" : "save") }), _jsx(Button, { type: "button", variant: "outline", "aria-describedby": `${prefix}-global-action`, disabled: editorDisabled || state.dirty || editor.revision === null || !reconcilable || (applied && !selectionConflict), onClick: () => { void props.apply(); }, children: t(state.busy === "apply" ? "applying" : "apply") }), editor.revision !== null && _jsx(Button, { type: "button", variant: "outline", disabled: disabled, onClick: () => { void props.reload(); }, children: t("reload") })] })] }), state.issue !== null && _jsx("div", { className: "dsmm-issue", id: `${prefix}-issue`, role: "alert", children: _jsx("p", { children: t(issueKey(state.issue)) }) }), snapshot?.selectionError !== undefined && _jsx("div", { className: "dsmm-issue", children: _jsx("p", { children: t(selectionConflict ? "selectionConflict" : "retry") }) }), _jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: state.busy === "refresh" && snapshot === null ? t("loading") : state.busy === "read" ? t("reading") : notice })] });
65
67
  }
66
68
  //# sourceMappingURL=ProfilesSection.js.map
@@ -0,0 +1,50 @@
1
+ import type { ConfigFormSnapshot, ConfigForm } from "@deepseek-ai/dsh-client-ui-settings/client";
2
+ import type { ConnectionGenerationState } from "@deepseek-ai/dsh-client-connection/client";
3
+ import type { DsmmConfigRemote } from "../profile-remote.js";
4
+ import type { DeploymentEditorSnapshot, SessionProfileSnapshot } from "../profile-types.js";
5
+ export type DeploymentIssue = "unavailable" | "not-owned" | "conflict" | "validation" | "transport";
6
+ export interface DeploymentView {
7
+ snapshot: DeploymentEditorSnapshot | null;
8
+ draft: Record<string, unknown>;
9
+ dirty: boolean;
10
+ busy: boolean;
11
+ issue: DeploymentIssue | null;
12
+ saved: boolean;
13
+ session: SessionProfileSnapshot | null;
14
+ }
15
+ export interface NativePageForm {
16
+ state: ConfigFormSnapshot<Record<string, unknown>>;
17
+ mutate: ConfigForm<Record<string, unknown>>["mutate"];
18
+ }
19
+ /** Drafts and CAS baselines, never a second configuration authority. */
20
+ export declare class DeploymentController {
21
+ private readonly remote;
22
+ readonly layer: "global" | "profile";
23
+ readonly rowNamespace: string | null;
24
+ private state;
25
+ private listeners;
26
+ private generation;
27
+ private disposed;
28
+ private baseline;
29
+ private form;
30
+ private invalid;
31
+ private connection;
32
+ private connectionBaseline;
33
+ private stopConnection;
34
+ constructor(remote: DsmmConfigRemote, layer: "global" | "profile", rowNamespace?: string | null);
35
+ readonly getSnapshot: () => DeploymentView;
36
+ readonly subscribe: (listener: () => void) => (() => void);
37
+ dispose(): void;
38
+ bindConnection(source: ConnectionGenerationState): void;
39
+ forProfile(namespace: string): DeploymentController;
40
+ private currentConnection;
41
+ setSession(session: SessionProfileSnapshot | null): void;
42
+ private publish;
43
+ attachForm(form: NativePageForm | null): void;
44
+ setInvalid(path: string, invalid: boolean): void;
45
+ canWriteProfile(snapshot?: DeploymentEditorSnapshot | null): boolean;
46
+ edit(path: readonly string[], value: unknown): void;
47
+ refresh(discard?: boolean): Promise<void>;
48
+ save(): Promise<void>;
49
+ }
50
+ //# sourceMappingURL=deployment-controller.d.ts.map
@@ -0,0 +1,193 @@
1
+ import { equal, editLayer, layerDiff, mergeLayer, record, validateEditorValue } from "./deployment-data.js";
2
+ class Refusal extends Error {
3
+ code;
4
+ constructor(code) {
5
+ super(code);
6
+ this.code = code;
7
+ }
8
+ }
9
+ async function unwrap(promise) {
10
+ const result = await promise;
11
+ if (result.ok)
12
+ return result.value;
13
+ if (result.error.code === "dsmm-profiles/refused") {
14
+ const code = result.error.details.code;
15
+ throw new Refusal(["conflict", "validation", "not-owned"].includes(code) ? code : "unavailable");
16
+ }
17
+ throw new Refusal("transport");
18
+ }
19
+ /** Drafts and CAS baselines, never a second configuration authority. */
20
+ export class DeploymentController {
21
+ remote;
22
+ layer;
23
+ rowNamespace;
24
+ state = { snapshot: null, draft: {}, dirty: false, busy: false, issue: null, saved: false, session: null };
25
+ listeners = new Set();
26
+ generation = 0;
27
+ disposed = false;
28
+ baseline = {};
29
+ form = null;
30
+ invalid = new Set();
31
+ connection = null;
32
+ connectionBaseline;
33
+ stopConnection = null;
34
+ constructor(remote, layer, rowNamespace = null) {
35
+ this.remote = remote;
36
+ this.layer = layer;
37
+ this.rowNamespace = rowNamespace;
38
+ }
39
+ getSnapshot = () => this.state;
40
+ subscribe = (listener) => { this.listeners.add(listener); return () => this.listeners.delete(listener); };
41
+ dispose() { this.disposed = true; this.generation++; this.stopConnection?.(); this.listeners.clear(); this.form = null; }
42
+ bindConnection(source) {
43
+ this.stopConnection?.();
44
+ this.connection = source;
45
+ this.stopConnection = source.subscribe(() => {
46
+ if (this.disposed)
47
+ return;
48
+ this.generation++;
49
+ this.publish({ busy: false, issue: source.getSnapshot() === undefined ? "transport" : "conflict", saved: false });
50
+ });
51
+ }
52
+ forProfile(namespace) {
53
+ const controller = new DeploymentController(this.remote, "profile", namespace);
54
+ if (this.connection !== null)
55
+ controller.bindConnection(this.connection);
56
+ return controller;
57
+ }
58
+ currentConnection() { return this.connection === null || this.connection.getSnapshot() !== undefined && this.connection.getSnapshot() === this.connectionBaseline; }
59
+ setSession(session) { this.publish({ session }); }
60
+ publish(patch) {
61
+ if (this.disposed)
62
+ return;
63
+ this.state = { ...this.state, ...patch };
64
+ for (const listener of this.listeners)
65
+ listener();
66
+ }
67
+ attachForm(form) { this.form = form; }
68
+ setInvalid(path, invalid) {
69
+ if (this.invalid.has(path) === invalid)
70
+ return;
71
+ if (invalid)
72
+ this.invalid.add(path);
73
+ else
74
+ this.invalid.delete(path);
75
+ this.publish({ dirty: this.invalid.size > 0 || !equal(this.baseline, this.state.draft), saved: false });
76
+ }
77
+ canWriteProfile(snapshot = this.state.snapshot) {
78
+ const native = this.form?.state;
79
+ return this.currentConnection() && snapshot !== null && this.rowNamespace !== null && this.rowNamespace === snapshot.namespace
80
+ && native?.status === "ready" && native.mode === "host" && native.writable
81
+ && native.revision === snapshot.nativeFormRevision && snapshot.nativeForm !== null
82
+ && equal(native.base ?? null, snapshot.nativeForm.base) && equal(native.user ?? null, snapshot.nativeForm.user);
83
+ }
84
+ edit(path, value) {
85
+ if (this.state.busy || this.disposed || this.state.snapshot === null || !this.currentConnection() || this.state.issue === "not-owned" || this.layer === "profile" && !this.canWriteProfile())
86
+ return;
87
+ const draft = editLayer(this.state.draft, path, value);
88
+ this.publish({ draft, dirty: this.invalid.size > 0 || !equal(this.baseline, draft), issue: null, saved: false });
89
+ }
90
+ async refresh(discard = false) {
91
+ if (this.disposed || this.state.busy)
92
+ return;
93
+ const generation = ++this.generation;
94
+ const connection = this.connection?.getSnapshot();
95
+ this.publish({ busy: true, saved: false });
96
+ try {
97
+ if (this.connection !== null && connection === undefined)
98
+ throw new Refusal("transport");
99
+ const snapshot = await unwrap(this.remote.describeSettings());
100
+ if (this.disposed || generation !== this.generation)
101
+ return;
102
+ const old = this.state.snapshot;
103
+ if (old !== null && (old.entryId !== snapshot.entryId || old.hostProfileKey !== snapshot.hostProfileKey))
104
+ throw new Refusal("unavailable");
105
+ if (this.state.dirty && !discard) {
106
+ const stale = !this.currentConnection() || (this.layer === "global" ? old?.globalRevision !== snapshot.globalRevision : old?.nativeRevision !== snapshot.nativeRevision || old?.globalRevision !== snapshot.globalRevision);
107
+ this.publish({ issue: stale ? "conflict" : null });
108
+ }
109
+ else {
110
+ this.invalid.clear();
111
+ this.connectionBaseline = connection;
112
+ this.baseline = this.layer === "global" ? snapshot.global : record(snapshot.nativeForm?.user) ? snapshot.nativeForm.user : {};
113
+ this.publish({ snapshot, draft: structuredClone(this.baseline), dirty: false, issue: null });
114
+ }
115
+ }
116
+ catch (error) {
117
+ if (!this.disposed && generation === this.generation)
118
+ this.publish({ issue: error instanceof Refusal ? error.code : "transport" });
119
+ }
120
+ finally {
121
+ if (!this.disposed && generation === this.generation)
122
+ this.publish({ busy: false });
123
+ }
124
+ }
125
+ async save() {
126
+ const { snapshot, draft, dirty, busy, issue } = this.state;
127
+ if (this.disposed || snapshot === null || !dirty || busy || issue !== null || !this.currentConnection() || this.invalid.size > 0 || this.layer === "profile" && !this.canWriteProfile())
128
+ return;
129
+ const schema = this.layer === "global" ? snapshot.schema : { ...snapshot.schema, fields: Object.fromEntries(Object.entries(snapshot.schema.fields ?? {}).filter(([key]) => key !== "modules")) };
130
+ const editable = { ...draft };
131
+ if (this.layer === "profile") {
132
+ if (!equal(editable.sessionPersistence, this.baseline.sessionPersistence)) {
133
+ this.publish({ issue: "validation" });
134
+ return;
135
+ }
136
+ delete editable.sessionPersistence;
137
+ }
138
+ const lower = this.layer === "global" ? snapshot.defaults : mergeLayer(mergeLayer(snapshot.defaults, snapshot.global), snapshot.nativeForm?.base ?? {});
139
+ const candidate = mergeLayer(lower, editable);
140
+ const merged = (this.layer === "global" ? mergeLayer(candidate, snapshot.profile) : candidate);
141
+ delete merged.sessionPersistence;
142
+ if (!validateEditorValue(editable, schema, true) || !validateEditorValue(merged, snapshot.schema)) {
143
+ this.publish({ issue: "validation" });
144
+ return;
145
+ }
146
+ const edits = layerDiff(this.baseline, draft);
147
+ if (edits.length > 128) {
148
+ this.publish({ issue: "validation" });
149
+ return;
150
+ }
151
+ const generation = ++this.generation;
152
+ this.publish({ busy: true, saved: false });
153
+ try {
154
+ const current = await unwrap(this.remote.describeSettings());
155
+ if (this.disposed || generation !== this.generation)
156
+ return;
157
+ if (current.entryId !== snapshot.entryId || current.hostProfileKey !== snapshot.hostProfileKey || current.globalRevision !== snapshot.globalRevision)
158
+ throw new Refusal("conflict");
159
+ if (this.layer === "global")
160
+ await unwrap(this.remote.save({ expectedRevision: snapshot.globalRevision, edits }));
161
+ else {
162
+ if (current.nativeRevision !== snapshot.nativeRevision || !this.canWriteProfile(current))
163
+ throw new Refusal("conflict");
164
+ const form = this.form;
165
+ if (!await form.mutate(edits, snapshot.nativeFormRevision))
166
+ throw new Refusal("conflict");
167
+ }
168
+ if (this.disposed || generation !== this.generation)
169
+ return;
170
+ this.baseline = structuredClone(draft);
171
+ this.publish({ dirty: false, saved: true, issue: null });
172
+ // A successful durable save remains successful even if the follow-up read fails.
173
+ try {
174
+ const next = await unwrap(this.remote.describeSettings());
175
+ if (!this.disposed && generation === this.generation)
176
+ this.publish({ snapshot: next });
177
+ }
178
+ catch {
179
+ if (!this.disposed && generation === this.generation)
180
+ this.publish({ issue: "unavailable" });
181
+ }
182
+ }
183
+ catch (error) {
184
+ if (!this.disposed && generation === this.generation)
185
+ this.publish({ issue: error instanceof Refusal ? error.code : "transport" });
186
+ }
187
+ finally {
188
+ if (!this.disposed && generation === this.generation)
189
+ this.publish({ busy: false });
190
+ }
191
+ }
192
+ }
193
+ //# sourceMappingURL=deployment-controller.js.map
@@ -0,0 +1,16 @@
1
+ import type { DeploymentAdmissionView, DeploymentEditorSnapshot, DeploymentSchemaNode } from "../profile-types.js";
2
+ import type { DeploymentPathEdit } from "../deployment-config.js";
3
+ export declare function record(value: unknown): value is Record<string, unknown>;
4
+ export declare function at(value: unknown, path: readonly string[]): unknown;
5
+ export declare function equal(a: unknown, b: unknown): boolean;
6
+ export declare function mergeLayer(base: unknown, override: unknown): unknown;
7
+ /** Strict JSON with duplicate-key rejection; never silently last-key-wins. */
8
+ export declare function parseAdvanced(text: string): unknown;
9
+ export declare function editLayer(base: Record<string, unknown>, path: readonly string[], value: unknown): Record<string, unknown>;
10
+ /** Preserve untouched sparse fields; arrays are one schema field, not indexed RPC paths. */
11
+ export declare function layerDiff(base: Record<string, unknown>, draft: Record<string, unknown>, prefix?: string[]): DeploymentPathEdit[];
12
+ export declare function validateEditorValue(value: unknown, schema: DeploymentSchemaNode, sparse?: boolean): boolean;
13
+ export declare function enumValues(schema: DeploymentSchemaNode): Array<string | number | boolean> | null;
14
+ /** Only Host-projected inspector layers, never raw sparse editor input. */
15
+ export declare function inspectorPaths(snapshot: DeploymentEditorSnapshot, admitted: DeploymentAdmissionView | null): string[];
16
+ //# sourceMappingURL=deployment-data.d.ts.map
@@ -0,0 +1,109 @@
1
+ import { parseTree } from "jsonc-parser";
2
+ export function record(value) {
3
+ return value !== null && typeof value === "object" && !Array.isArray(value);
4
+ }
5
+ export function at(value, path) {
6
+ return path.reduce((node, key) => record(node) && Object.hasOwn(node, key) ? node[key] : undefined, value);
7
+ }
8
+ export function equal(a, b) {
9
+ if (record(a) && record(b))
10
+ return Object.keys(a).length === Object.keys(b).length && Object.keys(a).every(key => Object.hasOwn(b, key) && equal(a[key], b[key]));
11
+ if (Array.isArray(a) && Array.isArray(b))
12
+ return a.length === b.length && a.every((value, i) => equal(value, b[i]));
13
+ return a === b;
14
+ }
15
+ export function mergeLayer(base, override) {
16
+ if (!record(base) || !record(override))
17
+ return override;
18
+ return Object.fromEntries([...new Set([...Object.keys(base), ...Object.keys(override)])].map(key => [key,
19
+ Object.hasOwn(override, key) ? mergeLayer(base[key], override[key]) : base[key]]));
20
+ }
21
+ /** Strict JSON with duplicate-key rejection; never silently last-key-wins. */
22
+ export function parseAdvanced(text) {
23
+ if (text.trim() === "")
24
+ return undefined;
25
+ const errors = [];
26
+ const root = parseTree(text, errors, { disallowComments: true, allowTrailingComma: false });
27
+ const unique = (node) => {
28
+ if (node.type === "object") {
29
+ const keys = node.children.map(child => child.children[0].value);
30
+ if (new Set(keys).size !== keys.length)
31
+ return false;
32
+ }
33
+ return (node.children ?? []).every(unique);
34
+ };
35
+ if (root === undefined || errors.length || !unique(root))
36
+ throw new Error("Invalid JSON");
37
+ return JSON.parse(text);
38
+ }
39
+ export function editLayer(base, path, value) {
40
+ const next = structuredClone(base);
41
+ let node = next;
42
+ for (const key of path.slice(0, -1)) {
43
+ if (!record(node[key]))
44
+ node[key] = {};
45
+ node = node[key];
46
+ }
47
+ const key = path.at(-1);
48
+ if (value === undefined)
49
+ delete node[key];
50
+ else
51
+ node[key] = structuredClone(value);
52
+ return next;
53
+ }
54
+ /** Preserve untouched sparse fields; arrays are one schema field, not indexed RPC paths. */
55
+ export function layerDiff(base, draft, prefix = []) {
56
+ return [...new Set([...Object.keys(base), ...Object.keys(draft)])].flatMap(key => {
57
+ const path = [...prefix, key], before = base[key], after = draft[key];
58
+ if (equal(before, after))
59
+ return [];
60
+ if (!Object.hasOwn(draft, key))
61
+ return [{ op: "unset", path }];
62
+ if (record(before) && record(after))
63
+ return layerDiff(before, after, path);
64
+ return [{ op: "set", path, value: after }];
65
+ });
66
+ }
67
+ export function validateEditorValue(value, schema, sparse = false) {
68
+ if (schema.type === "union")
69
+ return schema.alternatives?.some(node => validateEditorValue(value, node, sparse)) === true;
70
+ if (schema.type === "const")
71
+ return value === schema.value;
72
+ if (schema.type === "object" || schema.type === "dict")
73
+ return record(value) && (sparse || schema.type !== "object" || Object.entries(schema.fields ?? {}).every(([key, node]) => !node.required || Object.hasOwn(value, key))) && Object.entries(value).every(([key, child]) => {
74
+ if (["__proto__", "prototype", "constructor"].includes(key))
75
+ return false;
76
+ if (schema.keys !== undefined && !schema.keys.includes(key))
77
+ return false;
78
+ const node = schema.type === "dict" ? schema.inner : schema.fields?.[key];
79
+ return node !== undefined && validateEditorValue(child, node, sparse);
80
+ });
81
+ if (schema.type === "array")
82
+ return Array.isArray(value) && (schema.max === undefined || value.length <= schema.max) && schema.inner !== undefined && value.every(child => validateEditorValue(child, schema.inner));
83
+ if (schema.type === "string" && schema.nonempty)
84
+ return typeof value === "string" && value.trim() !== "";
85
+ if (["string", "boolean", "number"].includes(schema.type))
86
+ return typeof value === schema.type && (typeof value !== "number" || Number.isFinite(value) && (schema.min === undefined || value >= schema.min) && (schema.max === undefined || value <= schema.max) && (schema.step === undefined || Number.isInteger(value / schema.step)));
87
+ return false;
88
+ }
89
+ export function enumValues(schema) {
90
+ return schema.type === "union" && schema.alternatives?.every(node => node.type === "const")
91
+ ? schema.alternatives.map(node => node.value) : null;
92
+ }
93
+ /** Only Host-projected inspector layers, never raw sparse editor input. */
94
+ export function inspectorPaths(snapshot, admitted) {
95
+ const paths = new Set([...Object.keys(snapshot.sources), ...Object.keys(snapshot.startupSources ?? {}), ...Object.keys(snapshot.nextRoot?.sources ?? {}),
96
+ ...Object.keys(snapshot.nextRoot?.captures ?? {}), ...Object.keys(admitted?.sources ?? {}), ...Object.keys(admitted?.captures ?? {})]);
97
+ const visit = (value, path) => {
98
+ if (record(value) && Object.keys(value).length && path.join(".") !== "lsp.env")
99
+ for (const [key, child] of Object.entries(value))
100
+ visit(child, [...path, key]);
101
+ else if (path.length)
102
+ paths.add(path.join("."));
103
+ };
104
+ for (const value of [snapshot.desired, snapshot.startup, snapshot.nextRoot?.settings, admitted?.settings])
105
+ if (value !== undefined)
106
+ visit(value, []);
107
+ return [...paths].sort();
108
+ }
109
+ //# sourceMappingURL=deployment-data.js.map
@@ -0,0 +1,66 @@
1
+ export declare const DEPLOYMENT_NS = "plugins.dsmm";
2
+ export declare const deploymentEn: {
3
+ title: string;
4
+ summary: string;
5
+ description: string;
6
+ global: string;
7
+ globalHint: string;
8
+ profile: string;
9
+ profileHint: string;
10
+ profileUnavailable: string;
11
+ unavailableForm: string;
12
+ ceiling: string;
13
+ hostUnknown: string;
14
+ boundaries: string;
15
+ saveGlobal: string;
16
+ saveProfile: string;
17
+ saving: string;
18
+ refresh: string;
19
+ discard: string;
20
+ dirty: string;
21
+ saved: string;
22
+ inherit: string;
23
+ explicit: string;
24
+ defaultPin: string;
25
+ hostPin: string;
26
+ globalSource: string;
27
+ profileSource: string;
28
+ defaultsSource: string;
29
+ namedSource: string;
30
+ startupSource: string;
31
+ deploymentCapture: string;
32
+ desired: string;
33
+ startup: string;
34
+ next: string;
35
+ session: string;
36
+ noSession: string;
37
+ sessionUnavailable: string;
38
+ absent: string;
39
+ mixedSource: string;
40
+ inspectorStale: string;
41
+ pending: string;
42
+ unknown: string;
43
+ on: string;
44
+ off: string;
45
+ state: string;
46
+ module: string;
47
+ advanced: string;
48
+ advancedHint: string;
49
+ invalid: string;
50
+ conflict: string;
51
+ unavailable: string;
52
+ "not-owned": string;
53
+ validation: string;
54
+ transport: string;
55
+ namedIndependent: string;
56
+ };
57
+ export type DeploymentLocaleKey = keyof typeof deploymentEn;
58
+ export declare const deploymentZh: Record<DeploymentLocaleKey, string>;
59
+ declare module "@deepseek-ai/dsh-client-ui-slots" {
60
+ interface LocaleNamespaceMap {
61
+ "plugins.dsmm": DeploymentLocaleKey;
62
+ }
63
+ }
64
+ /** Stable public field names stay visible alongside localized context. */
65
+ export declare const deploymentFieldLabels: Record<string, [string, string]>;
66
+ //# sourceMappingURL=deployment-locales.d.ts.map