dsh-super-code 0.3.10 → 0.4.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 (926) hide show
  1. package/LICENSE +1 -1
  2. package/README.en.md +51 -19
  3. package/README.md +51 -19
  4. package/builtin/README.md +22 -0
  5. package/builtin/skills/mattpocock/LICENSE +21 -0
  6. package/builtin/skills/mattpocock/UPSTREAM.md +11 -0
  7. package/builtin/skills/mattpocock/distribution.json +352 -0
  8. package/builtin/skills/mattpocock/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
  9. package/builtin/skills/mattpocock/skills/ask-matt/SKILL.md +97 -0
  10. package/builtin/skills/mattpocock/skills/ask-matt/agents/openai.yaml +5 -0
  11. package/builtin/skills/mattpocock/skills/code-review/SKILL.md +89 -0
  12. package/builtin/skills/mattpocock/skills/code-review/agents/openai.yaml +3 -0
  13. package/builtin/skills/mattpocock/skills/codebase-design/DEEPENING.md +37 -0
  14. package/builtin/skills/mattpocock/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  15. package/builtin/skills/mattpocock/skills/codebase-design/SKILL.md +114 -0
  16. package/builtin/skills/mattpocock/skills/codebase-design/agents/openai.yaml +3 -0
  17. package/builtin/skills/mattpocock/skills/diagnosing-bugs/SKILL.md +138 -0
  18. package/builtin/skills/mattpocock/skills/diagnosing-bugs/agents/openai.yaml +3 -0
  19. package/builtin/skills/mattpocock/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
  20. package/builtin/skills/mattpocock/skills/domain-modeling/ADR-FORMAT.md +47 -0
  21. package/builtin/skills/mattpocock/skills/domain-modeling/GLOSSARY-FORMAT.md +60 -0
  22. package/builtin/skills/mattpocock/skills/domain-modeling/SKILL.md +74 -0
  23. package/builtin/skills/mattpocock/skills/domain-modeling/agents/openai.yaml +3 -0
  24. package/builtin/skills/mattpocock/skills/grill-me/SKILL.md +7 -0
  25. package/builtin/skills/mattpocock/skills/grill-me/agents/openai.yaml +5 -0
  26. package/builtin/skills/mattpocock/skills/grill-with-docs/SKILL.md +7 -0
  27. package/builtin/skills/mattpocock/skills/grill-with-docs/agents/openai.yaml +5 -0
  28. package/builtin/skills/mattpocock/skills/grilling/SKILL.md +30 -0
  29. package/builtin/skills/mattpocock/skills/grilling/agents/openai.yaml +3 -0
  30. package/builtin/skills/mattpocock/skills/handoff/SKILL.md +16 -0
  31. package/builtin/skills/mattpocock/skills/handoff/agents/openai.yaml +5 -0
  32. package/builtin/skills/mattpocock/skills/implement/SKILL.md +17 -0
  33. package/builtin/skills/mattpocock/skills/implement/agents/openai.yaml +5 -0
  34. package/builtin/skills/mattpocock/skills/implement-spec/SKILL.md +42 -0
  35. package/builtin/skills/mattpocock/skills/implement-spec/agents/openai.yaml +5 -0
  36. package/builtin/skills/mattpocock/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  37. package/builtin/skills/mattpocock/skills/improve-codebase-architecture/SKILL.md +71 -0
  38. package/builtin/skills/mattpocock/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
  39. package/builtin/skills/mattpocock/skills/pr/CREDITS.md +3 -0
  40. package/builtin/skills/mattpocock/skills/pr/SKILL.md +170 -0
  41. package/builtin/skills/mattpocock/skills/pr/agents/openai.yaml +3 -0
  42. package/builtin/skills/mattpocock/skills/prototype/LOGIC.md +67 -0
  43. package/builtin/skills/mattpocock/skills/prototype/SKILL.md +26 -0
  44. package/builtin/skills/mattpocock/skills/prototype/UI.md +112 -0
  45. package/builtin/skills/mattpocock/skills/prototype/agents/openai.yaml +3 -0
  46. package/builtin/skills/mattpocock/skills/research/SKILL.md +12 -0
  47. package/builtin/skills/mattpocock/skills/research/agents/openai.yaml +3 -0
  48. package/builtin/skills/mattpocock/skills/retro/SKILL.md +44 -0
  49. package/builtin/skills/mattpocock/skills/retro/agents/openai.yaml +5 -0
  50. package/builtin/skills/mattpocock/skills/setup-matt-pocock-skills/SKILL.md +120 -0
  51. package/builtin/skills/mattpocock/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
  52. package/builtin/skills/mattpocock/skills/setup-matt-pocock-skills/domain.md +51 -0
  53. package/builtin/skills/mattpocock/skills/setup-matt-pocock-skills/issue-tracker-github.md +50 -0
  54. package/builtin/skills/mattpocock/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  55. package/builtin/skills/mattpocock/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  56. package/builtin/skills/mattpocock/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  57. package/builtin/skills/mattpocock/skills/tdd/SKILL.md +38 -0
  58. package/builtin/skills/mattpocock/skills/tdd/agents/openai.yaml +3 -0
  59. package/builtin/skills/mattpocock/skills/tdd/mocking.md +59 -0
  60. package/builtin/skills/mattpocock/skills/tdd/tests.md +77 -0
  61. package/builtin/skills/mattpocock/skills/teach/GLOSSARY-FORMAT.md +35 -0
  62. package/builtin/skills/mattpocock/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
  63. package/builtin/skills/mattpocock/skills/teach/MISSION-FORMAT.md +31 -0
  64. package/builtin/skills/mattpocock/skills/teach/RESOURCES-FORMAT.md +32 -0
  65. package/builtin/skills/mattpocock/skills/teach/SKILL.md +140 -0
  66. package/builtin/skills/mattpocock/skills/teach/agents/openai.yaml +5 -0
  67. package/builtin/skills/mattpocock/skills/to-questionnaire/SKILL.md +54 -0
  68. package/builtin/skills/mattpocock/skills/to-questionnaire/agents/openai.yaml +5 -0
  69. package/builtin/skills/mattpocock/skills/to-spec/SKILL.md +75 -0
  70. package/builtin/skills/mattpocock/skills/to-spec/agents/openai.yaml +5 -0
  71. package/builtin/skills/mattpocock/skills/to-tickets/SKILL.md +105 -0
  72. package/builtin/skills/mattpocock/skills/to-tickets/agents/openai.yaml +5 -0
  73. package/builtin/skills/mattpocock/skills/triage/AGENT-BRIEF.md +207 -0
  74. package/builtin/skills/mattpocock/skills/triage/OUT-OF-SCOPE.md +105 -0
  75. package/builtin/skills/mattpocock/skills/triage/SKILL.md +112 -0
  76. package/builtin/skills/mattpocock/skills/triage/agents/openai.yaml +5 -0
  77. package/builtin/skills/mattpocock/skills/wait-what/SKILL.md +7 -0
  78. package/builtin/skills/mattpocock/skills/wait-what/agents/openai.yaml +5 -0
  79. package/builtin/skills/mattpocock/skills/wayfinder/SKILL.md +128 -0
  80. package/builtin/skills/mattpocock/skills/wayfinder/agents/openai.yaml +5 -0
  81. package/builtin/skills/mattpocock/skills/wizard/SKILL.md +44 -0
  82. package/builtin/skills/mattpocock/skills/wizard/agents/openai.yaml +3 -0
  83. package/builtin/skills/mattpocock/skills/wizard/template.sh +223 -0
  84. package/builtin/skills/mattpocock/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
  85. package/builtin/skills/mattpocock/skills/writing-for-agents/SKILL.md +81 -0
  86. package/builtin/skills/mattpocock/skills/writing-for-agents/agents/openai.yaml +3 -0
  87. package/builtin/skills/oil-ui/LICENSE +21 -0
  88. package/builtin/skills/oil-ui/SKILL.md +163 -0
  89. package/builtin/skills/oil-ui/UPSTREAM.md +14 -0
  90. package/builtin/skills/oil-ui/assets/fonts/instrument-serif/InstrumentSerif-Regular.ttf +0 -0
  91. package/builtin/skills/oil-ui/assets/fonts/instrument-serif/OFL.txt +93 -0
  92. package/builtin/skills/oil-ui/assets/logo.png +0 -0
  93. package/builtin/skills/oil-ui/assets/style-explorer.html +433 -0
  94. package/builtin/skills/oil-ui/distribution.json +5 -0
  95. package/builtin/skills/oil-ui/references/design-direction.md +233 -0
  96. package/builtin/skills/oil-ui/references/direction-persuasion.md +25 -0
  97. package/builtin/skills/oil-ui/references/image-ideation.md +130 -0
  98. package/builtin/skills/oil-ui/references/layout-and-viewport.md +24 -0
  99. package/builtin/skills/oil-ui/references/media.md +158 -0
  100. package/builtin/skills/oil-ui/references/motion.md +123 -0
  101. package/builtin/skills/oil-ui/references/play.md +29 -0
  102. package/builtin/skills/oil-ui/references/reviewer-manual.md +73 -0
  103. package/builtin/skills/oil-ui/references/scroll-narrative.md +97 -0
  104. package/builtin/skills/oil-ui/references/style-explorer.md +48 -0
  105. package/builtin/skills/oil-ui/references/task-explore.md +28 -0
  106. package/builtin/skills/oil-ui/references/task-review.md +8 -0
  107. package/builtin/skills/oil-ui/references/tools.md +75 -0
  108. package/builtin/skills/oil-ui/references/ux-review.md +23 -0
  109. package/builtin/skills/oil-ui/references/ux-reviewer.md +10 -0
  110. package/builtin/skills/oil-ui/references/visual-language.md +103 -0
  111. package/builtin/skills/oil-ui/references/visual-review.md +35 -0
  112. package/builtin/skills/oil-ui/references/workdir.md +64 -0
  113. package/builtin/skills/oil-ui/scripts/build_explorer.py +958 -0
  114. package/builtin/skills/oil-ui/scripts/chrome.mjs +115 -0
  115. package/builtin/skills/oil-ui/scripts/curate-media.mjs +726 -0
  116. package/builtin/skills/oil-ui/scripts/measure_reference.py +543 -0
  117. package/builtin/skills/oil-ui/scripts/oiloil-image.mjs +388 -0
  118. package/builtin/skills/oil-ui/scripts/prep-image.mjs +287 -0
  119. package/builtin/skills/oil-ui/scripts/recommend_once.py +65 -0
  120. package/builtin/skills/oil-ui/scripts/shoot.mjs +2067 -0
  121. package/builtin/skills/openspec/LICENSE +22 -0
  122. package/builtin/skills/openspec/UPSTREAM.md +11 -0
  123. package/builtin/skills/openspec/distribution.json +73 -0
  124. package/builtin/skills/openspec/skills/README.md +19 -0
  125. package/builtin/skills/openspec/skills/openspec-apply-change/SKILL.md +205 -0
  126. package/builtin/skills/openspec/skills/openspec-archive-change/SKILL.md +220 -0
  127. package/builtin/skills/openspec/skills/openspec-bulk-archive-change/SKILL.md +376 -0
  128. package/builtin/skills/openspec/skills/openspec-continue-change/SKILL.md +137 -0
  129. package/builtin/skills/openspec/skills/openspec-explore/SKILL.md +355 -0
  130. package/builtin/skills/openspec/skills/openspec-ff-change/SKILL.md +128 -0
  131. package/builtin/skills/openspec/skills/openspec-new-change/SKILL.md +87 -0
  132. package/builtin/skills/openspec/skills/openspec-onboard/SKILL.md +574 -0
  133. package/builtin/skills/openspec/skills/openspec-propose/SKILL.md +174 -0
  134. package/builtin/skills/openspec/skills/openspec-sync-specs/SKILL.md +289 -0
  135. package/builtin/skills/openspec/skills/openspec-update-change/SKILL.md +108 -0
  136. package/builtin/skills/openspec/skills/openspec-verify-change/SKILL.md +222 -0
  137. package/builtin/skills/pstack/LICENSE +21 -0
  138. package/builtin/skills/pstack/UPSTREAM.md +17 -0
  139. package/builtin/skills/pstack/distribution.json +2299 -0
  140. package/builtin/skills/pstack/dsh/DSH.md +59 -0
  141. package/builtin/skills/pstack/dsh/LICENSE +21 -0
  142. package/builtin/skills/pstack/dsh/README.md +9 -0
  143. package/builtin/skills/pstack/dsh/adaptation.json +2930 -0
  144. package/builtin/skills/pstack/dsh/agents/comment-sicko.md +32 -0
  145. package/builtin/skills/pstack/dsh/agents/poteto-agent.md +5 -0
  146. package/builtin/skills/pstack/dsh/assets/logo.png +0 -0
  147. package/builtin/skills/pstack/dsh/authoring.md +7 -0
  148. package/builtin/skills/pstack/dsh/docs/guide/01-setup.md +68 -0
  149. package/builtin/skills/pstack/dsh/docs/guide/02-poteto-mode.md +141 -0
  150. package/builtin/skills/pstack/dsh/docs/guide/03-understand.md +81 -0
  151. package/builtin/skills/pstack/dsh/docs/guide/04-design.md +135 -0
  152. package/builtin/skills/pstack/dsh/docs/guide/05-build-and-clean.md +85 -0
  153. package/builtin/skills/pstack/dsh/docs/guide/06-verify-and-ship.md +164 -0
  154. package/builtin/skills/pstack/dsh/docs/guide/07-overnight.md +124 -0
  155. package/builtin/skills/pstack/dsh/docs/guide/08-principles.md +74 -0
  156. package/builtin/skills/pstack/dsh/docs/guide/09-make-it-yours.md +102 -0
  157. package/builtin/skills/pstack/dsh/docs/guide/10-recipes-and-pitfalls.md +184 -0
  158. package/builtin/skills/pstack/dsh/docs/guide/README.md +40 -0
  159. package/builtin/skills/pstack/dsh/docs/guide/images/design.jpg +0 -0
  160. package/builtin/skills/pstack/dsh/docs/guide/images/overnight.jpg +0 -0
  161. package/builtin/skills/pstack/dsh/docs/guide/images/recipes.jpg +0 -0
  162. package/builtin/skills/pstack/dsh/docs/guide/images/router.jpg +0 -0
  163. package/builtin/skills/pstack/dsh/docs/guide/images/understanding.jpg +0 -0
  164. package/builtin/skills/pstack/dsh/docs/guide/images/verification.jpg +0 -0
  165. package/builtin/skills/pstack/dsh/docs/harness/claude-code.md +69 -0
  166. package/builtin/skills/pstack/dsh/scripts/capture.mjs +80 -0
  167. package/builtin/skills/pstack/dsh/skills/architect/SKILL.md +82 -0
  168. package/builtin/skills/pstack/dsh/skills/architect/references/design-red-flags.md +57 -0
  169. package/builtin/skills/pstack/dsh/skills/architect/references/rationale-template.md +35 -0
  170. package/builtin/skills/pstack/dsh/skills/architect/references/runner-prompt.md +20 -0
  171. package/builtin/skills/pstack/dsh/skills/arena/SKILL.md +51 -0
  172. package/builtin/skills/pstack/dsh/skills/automate-me/SKILL.md +19 -0
  173. package/builtin/skills/pstack/dsh/skills/benchmark-checklist/SKILL.md +42 -0
  174. package/builtin/skills/pstack/dsh/skills/blast-radius/SKILL.md +53 -0
  175. package/builtin/skills/pstack/dsh/skills/bro/SKILL.md +10 -0
  176. package/builtin/skills/pstack/dsh/skills/correct/SKILL.md +35 -0
  177. package/builtin/skills/pstack/dsh/skills/create-formal-verification-skill/SKILL.md +46 -0
  178. package/builtin/skills/pstack/dsh/skills/create-verification-skill/SKILL.md +47 -0
  179. package/builtin/skills/pstack/dsh/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
  180. package/builtin/skills/pstack/dsh/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
  181. package/builtin/skills/pstack/dsh/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
  182. package/builtin/skills/pstack/dsh/skills/figure-it-out/SKILL.md +55 -0
  183. package/builtin/skills/pstack/dsh/skills/how/SKILL.md +39 -0
  184. package/builtin/skills/pstack/dsh/skills/how/references/explainer-prompt.md +55 -0
  185. package/builtin/skills/pstack/dsh/skills/how/references/explorer-prompt.md +35 -0
  186. package/builtin/skills/pstack/dsh/skills/in-your-own-words/SKILL.md +10 -0
  187. package/builtin/skills/pstack/dsh/skills/interrogate/SKILL.md +34 -0
  188. package/builtin/skills/pstack/dsh/skills/ketchup/SKILL.md +46 -0
  189. package/builtin/skills/pstack/dsh/skills/ketchup-video/SKILL.md +32 -0
  190. package/builtin/skills/pstack/dsh/skills/maintain-formal-verification-skill/SKILL.md +61 -0
  191. package/builtin/skills/pstack/dsh/skills/maintain-verification-skill/SKILL.md +42 -0
  192. package/builtin/skills/pstack/dsh/skills/make-bot-ui/SKILL.md +22 -0
  193. package/builtin/skills/pstack/dsh/skills/make-bot-ui/references/submissions.md +44 -0
  194. package/builtin/skills/pstack/dsh/skills/make-bot-ui/scripts/submissions.mjs +86 -0
  195. package/builtin/skills/pstack/dsh/skills/no-comments/SKILL.md +27 -0
  196. package/builtin/skills/pstack/dsh/skills/poteto-help/SKILL.md +42 -0
  197. package/builtin/skills/pstack/dsh/skills/poteto-help/references/prompting.md +51 -0
  198. package/builtin/skills/pstack/dsh/skills/poteto-help/references/recipes.md +51 -0
  199. package/builtin/skills/pstack/dsh/skills/poteto-mode/SKILL.md +153 -0
  200. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/authoring-a-skill.md +8 -0
  201. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/autonomous-run.md +12 -0
  202. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/autopilot-full.md +25 -0
  203. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/autopilot-stack.md +8 -0
  204. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/babysit.md +23 -0
  205. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/bug-fix.md +15 -0
  206. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/eval.md +25 -0
  207. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/feature.md +21 -0
  208. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/hillclimb.md +21 -0
  209. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/investigation.md +14 -0
  210. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/multi-phase-plan.md +155 -0
  211. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/opening-a-pr.md +34 -0
  212. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/orchestrate.md +14 -0
  213. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/pause-safely.md +8 -0
  214. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/perf-issue.md +25 -0
  215. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/prototype.md +14 -0
  216. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/refactoring.md +16 -0
  217. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
  218. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/session-pickup.md +9 -0
  219. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/shipping.md +12 -0
  220. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
  221. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/visual-parity.md +11 -0
  222. package/builtin/skills/pstack/dsh/skills/poteto-mode/playbooks/worktree-cleanup.md +9 -0
  223. package/builtin/skills/pstack/dsh/skills/poteto-mode/references/bugbot-triage.md +142 -0
  224. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/bootstrap.ts +62 -0
  225. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/bun.lock +67 -0
  226. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/check-plan.mjs +205 -0
  227. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/check-plan.test.ts +110 -0
  228. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/package.json +16 -0
  229. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/watch-pr/cli.test.ts +224 -0
  230. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/watch-pr/cli.ts +223 -0
  231. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +129 -0
  232. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/watch-pr/github.test.ts +498 -0
  233. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/watch-pr/github.ts +726 -0
  234. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/watch-pr/policy.test.ts +482 -0
  235. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/watch-pr/policy.ts +842 -0
  236. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/watch-pr/render.ts +169 -0
  237. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
  238. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/watch-pr/types.compile.ts +93 -0
  239. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/watch-pr/types.ts +414 -0
  240. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
  241. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/worktree-audit.mjs +52 -0
  242. package/builtin/skills/pstack/dsh/skills/poteto-mode/scripts/worktree-audit.sh +4 -0
  243. package/builtin/skills/pstack/dsh/skills/principle-attack-the-premise/SKILL.md +24 -0
  244. package/builtin/skills/pstack/dsh/skills/principle-boundary-discipline/SKILL.md +37 -0
  245. package/builtin/skills/pstack/dsh/skills/principle-build-the-lever/SKILL.md +26 -0
  246. package/builtin/skills/pstack/dsh/skills/principle-encode-lessons-in-structure/SKILL.md +14 -0
  247. package/builtin/skills/pstack/dsh/skills/principle-exhaust-the-design-space/SKILL.md +12 -0
  248. package/builtin/skills/pstack/dsh/skills/principle-experience-first/SKILL.md +22 -0
  249. package/builtin/skills/pstack/dsh/skills/principle-explain-the-number/SKILL.md +21 -0
  250. package/builtin/skills/pstack/dsh/skills/principle-fix-root-causes/SKILL.md +24 -0
  251. package/builtin/skills/pstack/dsh/skills/principle-foundational-thinking/SKILL.md +24 -0
  252. package/builtin/skills/pstack/dsh/skills/principle-guard-the-context-window/SKILL.md +15 -0
  253. package/builtin/skills/pstack/dsh/skills/principle-laziness-protocol/SKILL.md +13 -0
  254. package/builtin/skills/pstack/dsh/skills/principle-make-operations-idempotent/SKILL.md +25 -0
  255. package/builtin/skills/pstack/dsh/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +17 -0
  256. package/builtin/skills/pstack/dsh/skills/principle-minimize-reader-load/SKILL.md +21 -0
  257. package/builtin/skills/pstack/dsh/skills/principle-model-the-domain/SKILL.md +27 -0
  258. package/builtin/skills/pstack/dsh/skills/principle-never-block-on-the-human/SKILL.md +18 -0
  259. package/builtin/skills/pstack/dsh/skills/principle-outcome-oriented-execution/SKILL.md +24 -0
  260. package/builtin/skills/pstack/dsh/skills/principle-prove-it-works/SKILL.md +25 -0
  261. package/builtin/skills/pstack/dsh/skills/principle-redesign-from-first-principles/SKILL.md +19 -0
  262. package/builtin/skills/pstack/dsh/skills/principle-separate-before-serializing-shared-state/SKILL.md +19 -0
  263. package/builtin/skills/pstack/dsh/skills/principle-sequence-verifiable-units/SKILL.md +20 -0
  264. package/builtin/skills/pstack/dsh/skills/principle-subtract-before-you-add/SKILL.md +21 -0
  265. package/builtin/skills/pstack/dsh/skills/principle-test-behavior-not-implementation/SKILL.md +23 -0
  266. package/builtin/skills/pstack/dsh/skills/principle-type-system-discipline/SKILL.md +16 -0
  267. package/builtin/skills/pstack/dsh/skills/recall/SKILL.md +19 -0
  268. package/builtin/skills/pstack/dsh/skills/reflect/SKILL.md +19 -0
  269. package/builtin/skills/pstack/dsh/skills/reflect/references/divergent-reviewer.md +38 -0
  270. package/builtin/skills/pstack/dsh/skills/reflect/references/judgment-reviewer.md +37 -0
  271. package/builtin/skills/pstack/dsh/skills/reflect/references/synthesizer.md +56 -0
  272. package/builtin/skills/pstack/dsh/skills/reflect/references/tooling-reviewer.md +48 -0
  273. package/builtin/skills/pstack/dsh/skills/setup-pstack/SKILL.md +80 -0
  274. package/builtin/skills/pstack/dsh/skills/sharpen/SKILL.md +19 -0
  275. package/builtin/skills/pstack/dsh/skills/show-me-your-work/SKILL.md +85 -0
  276. package/builtin/skills/pstack/dsh/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
  277. package/builtin/skills/pstack/dsh/skills/show-me-your-work/scripts/audit-log.mjs +43 -0
  278. package/builtin/skills/pstack/dsh/skills/show-me-your-work/scripts/log.sh +42 -0
  279. package/builtin/skills/pstack/dsh/skills/statechart/SKILL.md +85 -0
  280. package/builtin/skills/pstack/dsh/skills/statechart/references/render.md +93 -0
  281. package/builtin/skills/pstack/dsh/skills/statechart/scripts/backends/cfg.mjs +31 -0
  282. package/builtin/skills/pstack/dsh/skills/statechart/scripts/backends/cfg.ts +33 -0
  283. package/builtin/skills/pstack/dsh/skills/statechart/scripts/backends/mermaid.mjs +223 -0
  284. package/builtin/skills/pstack/dsh/skills/statechart/scripts/backends/mermaid.ts +201 -0
  285. package/builtin/skills/pstack/dsh/skills/statechart/scripts/backends/plain-text.mjs +68 -0
  286. package/builtin/skills/pstack/dsh/skills/statechart/scripts/backends/plain-text.ts +72 -0
  287. package/builtin/skills/pstack/dsh/skills/statechart/scripts/backends/report.mjs +123 -0
  288. package/builtin/skills/pstack/dsh/skills/statechart/scripts/backends/report.ts +177 -0
  289. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/config.mjs +258 -0
  290. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/config.ts +276 -0
  291. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/dot.mjs +68 -0
  292. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/dot.ts +74 -0
  293. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/marks.mjs +102 -0
  294. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/marks.ts +93 -0
  295. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/messages.mjs +53 -0
  296. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/messages.ts +52 -0
  297. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/spec.mjs +89 -0
  298. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/spec.ts +114 -0
  299. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/trace.mjs +24 -0
  300. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/trace.ts +24 -0
  301. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/value.mjs +181 -0
  302. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/value.ts +166 -0
  303. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/verdict.mjs +38 -0
  304. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/verdict.ts +40 -0
  305. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/view.mjs +107 -0
  306. package/builtin/skills/pstack/dsh/skills/statechart/scripts/frontends/view.ts +119 -0
  307. package/builtin/skills/pstack/dsh/skills/statechart/scripts/ir.mjs +317 -0
  308. package/builtin/skills/pstack/dsh/skills/statechart/scripts/ir.ts +547 -0
  309. package/builtin/skills/pstack/dsh/skills/statechart/scripts/package.json +11 -0
  310. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/annotate.mjs +102 -0
  311. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/annotate.ts +128 -0
  312. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/label.mjs +217 -0
  313. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/label.ts +269 -0
  314. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/lift.mjs +89 -0
  315. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/lift.ts +85 -0
  316. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/loop-check.mjs +57 -0
  317. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/loop-check.ts +68 -0
  318. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/paths.mjs +50 -0
  319. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/paths.ts +60 -0
  320. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/reach.mjs +134 -0
  321. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/reach.ts +135 -0
  322. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/region-check.mjs +94 -0
  323. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/region-check.ts +97 -0
  324. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/regions.mjs +296 -0
  325. package/builtin/skills/pstack/dsh/skills/statechart/scripts/passes/regions.ts +295 -0
  326. package/builtin/skills/pstack/dsh/skills/statechart/scripts/pipeline.mjs +63 -0
  327. package/builtin/skills/pstack/dsh/skills/statechart/scripts/pipeline.ts +76 -0
  328. package/builtin/skills/pstack/dsh/skills/statechart/scripts/run.mjs +432 -0
  329. package/builtin/skills/pstack/dsh/skills/statechart/scripts/run.ts +481 -0
  330. package/builtin/skills/pstack/dsh/skills/statechart/scripts/statechart +29 -0
  331. package/builtin/skills/pstack/dsh/skills/statechart/scripts/statechart.mjs +149 -0
  332. package/builtin/skills/pstack/dsh/skills/statechart/scripts/statechart.ts +164 -0
  333. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/ConfigOracle.java +63 -0
  334. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/chart.test.ts +1210 -0
  335. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/charts/Braces.mmd +7 -0
  336. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/charts/Escapes.mmd +11 -0
  337. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/charts/Phases.mmd +29 -0
  338. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/cli.test.ts +1314 -0
  339. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/config-fuzz.test.ts +263 -0
  340. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Counter/ChartRun.out +57 -0
  341. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Counter/Counter.cfg +3 -0
  342. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Counter/Counter.tla +10 -0
  343. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Counter/chart.mmd +9 -0
  344. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Counter/graph.dot +16 -0
  345. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Counter/report.md +7 -0
  346. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Counter/sany.out +2 -0
  347. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Counter/verdict-1.out +49 -0
  348. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterAction/ChartRun.out +60 -0
  349. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.cfg +4 -0
  350. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.tla +22 -0
  351. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterAction/chart.mmd +26 -0
  352. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterAction/graph.dot +19 -0
  353. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterAction/report.md +20 -0
  354. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterAction/sany.out +2 -0
  355. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.exit +1 -0
  356. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.out +56 -0
  357. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.exit +1 -0
  358. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.out +82 -0
  359. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterAction/verdict-3.out +57 -0
  360. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterDeadlock/ChartRun.out +59 -0
  361. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.cfg +3 -0
  362. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.tla +11 -0
  363. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterDeadlock/chart.mmd +22 -0
  364. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterDeadlock/graph.dot +16 -0
  365. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterDeadlock/report.md +17 -0
  366. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterDeadlock/sany.out +2 -0
  367. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.exit +1 -0
  368. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.out +56 -0
  369. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.exit +1 -0
  370. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.out +77 -0
  371. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterFan/ChartRun.out +69 -0
  372. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.cfg +2 -0
  373. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.tla +11 -0
  374. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterFan/chart.mmd +85 -0
  375. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterFan/graph.dot +70 -0
  376. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterFan/report.md +12 -0
  377. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterFan/sany.out +2 -0
  378. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.exit +1 -0
  379. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.out +67 -0
  380. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterFan/verdict-2.out +57 -0
  381. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.exit +1 -0
  382. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.out +85 -0
  383. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.cfg +6 -0
  384. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.tla +13 -0
  385. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterGuard/chart.mmd +5 -0
  386. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterGuard/graph.dot +10 -0
  387. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterGuard/report.md +31 -0
  388. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterGuard/sany.out +2 -0
  389. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.exit +1 -0
  390. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.out +64 -0
  391. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.exit +1 -0
  392. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.out +77 -0
  393. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPast/ChartRun.out +55 -0
  394. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.cfg +3 -0
  395. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.tla +10 -0
  396. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPast/chart.mmd +12 -0
  397. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPast/graph.dot +6 -0
  398. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPast/report.md +12 -0
  399. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPast/sany.out +2 -0
  400. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.exit +1 -0
  401. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.out +33 -0
  402. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-2.out +54 -0
  403. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPastHolds/ChartRun.out +54 -0
  404. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.cfg +3 -0
  405. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.tla +10 -0
  406. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPastHolds/chart.mmd +1 -0
  407. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPastHolds/graph.dot +6 -0
  408. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPastHolds/report.md +7 -0
  409. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPastHolds/sany.out +2 -0
  410. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInitPastHolds/verdict-1.out +46 -0
  411. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInstance/ChartRun.out +59 -0
  412. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.cfg +2 -0
  413. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.tla +10 -0
  414. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInstance/CounterSteps.tla +6 -0
  415. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInstance/chart.mmd +17 -0
  416. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInstance/graph.dot +15 -0
  417. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInstance/report.md +14 -0
  418. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInstance/sany.out +3 -0
  419. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.exit +1 -0
  420. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.out +78 -0
  421. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterJump/ChartRun.out +59 -0
  422. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.cfg +3 -0
  423. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.tla +19 -0
  424. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterJump/chart.mmd +26 -0
  425. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterJump/graph.dot +22 -0
  426. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterJump/report.md +12 -0
  427. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterJump/sany.out +2 -0
  428. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.exit +1 -0
  429. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.out +58 -0
  430. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterJump/verdict-2.out +57 -0
  431. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterLoop/ChartRun.out +57 -0
  432. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.cfg +2 -0
  433. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.tla +11 -0
  434. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterLoop/chart.mmd +17 -0
  435. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterLoop/graph.dot +15 -0
  436. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterLoop/report.md +14 -0
  437. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterLoop/sany.out +2 -0
  438. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.exit +1 -0
  439. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.out +76 -0
  440. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterOrder/ChartRun.out +59 -0
  441. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.cfg +3 -0
  442. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.tla +11 -0
  443. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterOrder/chart.mmd +19 -0
  444. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterOrder/graph.dot +10 -0
  445. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterOrder/report.md +15 -0
  446. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterOrder/sany.out +2 -0
  447. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.exit +1 -0
  448. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.out +56 -0
  449. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.exit +1 -0
  450. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.out +67 -0
  451. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/ChartRun.out +62 -0
  452. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.cfg +6 -0
  453. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.tla +24 -0
  454. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/Moves.tla +5 -0
  455. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/chart.mmd +22 -0
  456. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/graph.dot +10 -0
  457. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/report.md +23 -0
  458. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/sany.out +3 -0
  459. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.exit +1 -0
  460. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.out +58 -0
  461. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.exit +1 -0
  462. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.out +66 -0
  463. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.exit +1 -0
  464. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.out +74 -0
  465. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterRules/verdict-4.out +59 -0
  466. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStart/ChartRun.out +58 -0
  467. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.cfg +3 -0
  468. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.tla +15 -0
  469. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStart/chart.mmd +18 -0
  470. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStart/graph.dot +13 -0
  471. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStart/report.md +11 -0
  472. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStart/sany.out +2 -0
  473. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.exit +1 -0
  474. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.out +33 -0
  475. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStart/verdict-2.out +57 -0
  476. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStop/ChartRun.out +57 -0
  477. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.cfg +3 -0
  478. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.tla +15 -0
  479. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStop/chart.mmd +7 -0
  480. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStop/graph.dot +13 -0
  481. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStop/report.md +6 -0
  482. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStop/sany.out +2 -0
  483. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterStop/verdict-1.out +49 -0
  484. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTie/ChartRun.out +61 -0
  485. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.cfg +4 -0
  486. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.tla +14 -0
  487. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTie/chart.mmd +30 -0
  488. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTie/graph.dot +19 -0
  489. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTie/report.md +27 -0
  490. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTie/sany.out +2 -0
  491. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.exit +1 -0
  492. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.out +56 -0
  493. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.exit +1 -0
  494. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.out +64 -0
  495. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.exit +1 -0
  496. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.out +87 -0
  497. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTie/verdict-4.out +57 -0
  498. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTieInGraph/ChartRun.out +60 -0
  499. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.cfg +3 -0
  500. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.tla +12 -0
  501. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTieInGraph/chart.mmd +23 -0
  502. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTieInGraph/graph.dot +19 -0
  503. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTieInGraph/report.md +11 -0
  504. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTieInGraph/sany.out +2 -0
  505. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.exit +1 -0
  506. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.out +56 -0
  507. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-2.out +57 -0
  508. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/ChartRun.out +61 -0
  509. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/CounterView.cfg +4 -0
  510. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/CounterView.tla +14 -0
  511. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/chart.mmd +23 -0
  512. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/graph.dot +19 -0
  513. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/report.md +27 -0
  514. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/sany.out +2 -0
  515. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/verdict-1.exit +1 -0
  516. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/verdict-1.out +56 -0
  517. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/verdict-2.exit +1 -0
  518. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/verdict-2.out +64 -0
  519. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/verdict-3.exit +1 -0
  520. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/verdict-3.out +87 -0
  521. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/verdict-4.out +57 -0
  522. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/CounterView/view.mjs +1 -0
  523. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/DieHard/ChartRun.out +59 -0
  524. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/DieHard/DieHard.cfg +4 -0
  525. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/DieHard/DieHard.tla +38 -0
  526. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/DieHard/chart.mmd +92 -0
  527. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/DieHard/graph.dot +126 -0
  528. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/DieHard/report.md +17 -0
  529. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/DieHard/sany.out +2 -0
  530. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/DieHard/verdict-1.exit +1 -0
  531. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/DieHard/verdict-1.out +91 -0
  532. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/DieHard/verdict-2.out +57 -0
  533. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/ChartRun.out +61 -0
  534. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.cfg +6 -0
  535. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.tla +11 -0
  536. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/chart.mmd +22 -0
  537. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/graph.dot +16 -0
  538. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/report.md +25 -0
  539. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/sany.out +2 -0
  540. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.exit +1 -0
  541. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.out +56 -0
  542. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.exit +1 -0
  543. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.out +64 -0
  544. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.exit +1 -0
  545. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.out +64 -0
  546. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.exit +1 -0
  547. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.out +77 -0
  548. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/HiddenClock/ChartRun.out +57 -0
  549. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.cfg +4 -0
  550. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.tla +11 -0
  551. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/HiddenClock/chart.mmd +13 -0
  552. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/HiddenClock/graph.dot +12 -0
  553. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/HiddenClock/report.md +11 -0
  554. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/HiddenClock/sany.out +2 -0
  555. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.exit +1 -0
  556. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.out +72 -0
  557. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Login/ChartRun.out +57 -0
  558. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Login/Login.cfg +3 -0
  559. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Login/Login.tla +62 -0
  560. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Login/chart.mmd +27 -0
  561. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Login/graph.dot +40 -0
  562. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Login/report.md +7 -0
  563. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Login/sany.out +1 -0
  564. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Login/verdict-1.out +47 -0
  565. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Login/view.mjs +1 -0
  566. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginGuarded/ChartRun.out +57 -0
  567. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.cfg +2 -0
  568. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.tla +64 -0
  569. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginGuarded/chart.mmd +28 -0
  570. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginGuarded/graph.dot +37 -0
  571. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginGuarded/report.md +8 -0
  572. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginGuarded/sany.out +1 -0
  573. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginGuarded/verdict-1.out +47 -0
  574. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginGuarded/view.mjs +1 -0
  575. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginParallel/ChartRun.out +60 -0
  576. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.cfg +3 -0
  577. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.tla +64 -0
  578. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginParallel/chart.mmd +44 -0
  579. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginParallel/graph.dot +58 -0
  580. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginParallel/report.md +17 -0
  581. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginParallel/sany.out +1 -0
  582. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.exit +1 -0
  583. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.out +83 -0
  584. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginParallel/verdict-2.out +57 -0
  585. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/LoginParallel/view.mjs +1 -0
  586. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayer/ChartRun.out +60 -0
  587. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.cfg +3 -0
  588. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.tla +103 -0
  589. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayer/chart.mmd +43 -0
  590. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayer/graph.dot +93 -0
  591. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayer/report.md +14 -0
  592. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayer/sany.out +1 -0
  593. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.exit +1 -0
  594. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.out +59 -0
  595. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-2.out +72 -0
  596. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayer/view.mjs +3 -0
  597. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerFixed/ChartRun.out +57 -0
  598. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.cfg +2 -0
  599. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.tla +100 -0
  600. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerFixed/chart.mmd +31 -0
  601. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerFixed/graph.dot +85 -0
  602. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerFixed/report.md +9 -0
  603. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerFixed/sany.out +1 -0
  604. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerFixed/verdict-1.out +47 -0
  605. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerFixed/view.mjs +3 -0
  606. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/ChartRun.out +59 -0
  607. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayer.tla +103 -0
  608. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.cfg +3 -0
  609. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.tla +6 -0
  610. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/chart.mmd +42 -0
  611. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/graph.dot +93 -0
  612. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/report.md +19 -0
  613. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/sany.out +2 -0
  614. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.exit +1 -0
  615. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.out +61 -0
  616. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-2.out +59 -0
  617. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-3.out +61 -0
  618. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.exit +1 -0
  619. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.out +66 -0
  620. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.exit +1 -0
  621. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.out +58 -0
  622. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-6.out +49 -0
  623. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/MediaPlayerProps/view.mjs +3 -0
  624. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/PickWorker/ChartRun.out +57 -0
  625. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.cfg +6 -0
  626. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.tla +11 -0
  627. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/PickWorker/chart.mmd +5 -0
  628. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/PickWorker/graph.dot +11 -0
  629. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/PickWorker/report.md +7 -0
  630. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/PickWorker/sany.out +5 -0
  631. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/PickWorker/verdict-1.out +70 -0
  632. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Shadow/ChartRun.out +61 -0
  633. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Shadow/Shadow.cfg +4 -0
  634. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Shadow/Shadow.tla +11 -0
  635. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Shadow/ShadowLib.tla +6 -0
  636. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Shadow/ShadowSub.tla +3 -0
  637. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Shadow/chart.mmd +9 -0
  638. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Shadow/graph.dot +16 -0
  639. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Shadow/report.md +8 -0
  640. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Shadow/sany.out +4 -0
  641. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/Shadow/verdict-1.out +65 -0
  642. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/SpacedNames/ChartRun.out +59 -0
  643. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.cfg +2 -0
  644. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.tla +9 -0
  645. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/SpacedNames/chart.mmd +23 -0
  646. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/SpacedNames/graph.dot +17 -0
  647. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/SpacedNames/report.md +15 -0
  648. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/SpacedNames/sany.out +1 -0
  649. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.exit +1 -0
  650. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.out +65 -0
  651. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.exit +1 -0
  652. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.out +75 -0
  653. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhase/ChartRun.out +69 -0
  654. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.cfg +3 -0
  655. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.tla +75 -0
  656. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhase/chart.mmd +60 -0
  657. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhase/graph.dot +297 -0
  658. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhase/report.md +20 -0
  659. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhase/sany.out +1 -0
  660. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.exit +1 -0
  661. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.out +95 -0
  662. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhase/verdict-2.out +57 -0
  663. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhase/view.mjs +1 -0
  664. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhaseFixed/ChartRun.out +57 -0
  665. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.cfg +3 -0
  666. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.tla +75 -0
  667. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhaseFixed/chart.mmd +37 -0
  668. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhaseFixed/graph.dot +223 -0
  669. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhaseFixed/report.md +11 -0
  670. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhaseFixed/sany.out +1 -0
  671. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhaseFixed/verdict-1.out +47 -0
  672. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TwoPhaseFixed/view.mjs +1 -0
  673. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.exit +1 -0
  674. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.out +75 -0
  675. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.cfg +5 -0
  676. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.tla +11 -0
  677. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TypeGuard/chart.mmd +18 -0
  678. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TypeGuard/graph.dot +14 -0
  679. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TypeGuard/report.md +29 -0
  680. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TypeGuard/sany.out +2 -0
  681. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.exit +1 -0
  682. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.out +64 -0
  683. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.exit +1 -0
  684. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.out +75 -0
  685. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/UserNoDeadlock/ChartRun.out +58 -0
  686. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.cfg +2 -0
  687. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.tla +8 -0
  688. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/UserNoDeadlock/chart.mmd +22 -0
  689. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/UserNoDeadlock/graph.dot +16 -0
  690. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/UserNoDeadlock/report.md +15 -0
  691. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/UserNoDeadlock/sany.out +2 -0
  692. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.exit +1 -0
  693. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.out +56 -0
  694. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.exit +1 -0
  695. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.out +77 -0
  696. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/corpus.test.ts +403 -0
  697. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/differential.test.ts +565 -0
  698. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/grid/Grid.cfg +2 -0
  699. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/grid/Grid.tla +9 -0
  700. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/grid/sany.out +2 -0
  701. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/java.ts +63 -0
  702. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/labels.ts +643 -0
  703. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/messages.test.ts +212 -0
  704. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/pipeline.test.ts +270 -0
  705. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/plain-tlc.test.ts +255 -0
  706. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/render.test.ts +81 -0
  707. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/tlc-out.test.ts +90 -0
  708. package/builtin/skills/pstack/dsh/skills/statechart/scripts/test/tlc.ts +158 -0
  709. package/builtin/skills/pstack/dsh/skills/statechart/scripts/tsconfig.json +11 -0
  710. package/builtin/skills/pstack/dsh/skills/statechart/scripts/worker.mjs +32 -0
  711. package/builtin/skills/pstack/dsh/skills/statechart/scripts/worker.ts +35 -0
  712. package/builtin/skills/pstack/dsh/skills/swarm/SKILL.md +44 -0
  713. package/builtin/skills/pstack/dsh/skills/tdd/SKILL.md +45 -0
  714. package/builtin/skills/pstack/dsh/skills/teach/SKILL.md +24 -0
  715. package/builtin/skills/pstack/dsh/skills/technical-writing/SKILL.md +109 -0
  716. package/builtin/skills/pstack/dsh/skills/typescript-best-practices/SKILL.md +34 -0
  717. package/builtin/skills/pstack/dsh/skills/typescript-best-practices/references/patterns.md +328 -0
  718. package/builtin/skills/pstack/dsh/skills/unslop/SKILL.md +65 -0
  719. package/builtin/skills/pstack/dsh/skills/why/SKILL.md +99 -0
  720. package/builtin/skills/pstack/dsh/skills/why/references/epistemics.md +71 -0
  721. package/builtin/skills/pstack/dsh/skills/why/references/investigator-prompt.md +84 -0
  722. package/builtin/skills/pstack/dsh/skills/why/references/source-playbook.md +17 -0
  723. package/builtin/skills/pstack/dsh/skills/why/references/sources/code-archaeology.md +51 -0
  724. package/builtin/skills/pstack/dsh/skills/why/references/sources/databricks.md +70 -0
  725. package/builtin/skills/pstack/dsh/skills/why/references/sources/datadog.md +97 -0
  726. package/builtin/skills/pstack/dsh/skills/why/references/sources/incident-postmortem.md +5 -0
  727. package/builtin/skills/pstack/dsh/skills/why/references/sources/linear.md +48 -0
  728. package/builtin/skills/pstack/dsh/skills/why/references/sources/notion.md +55 -0
  729. package/builtin/skills/pstack/dsh/skills/why/references/sources/sentry.md +66 -0
  730. package/builtin/skills/pstack/dsh/skills/why/references/sources/slack.md +17 -0
  731. package/builtin/skills/pstack/dsh/skills/why/references/synthesizer-prompt.md +129 -0
  732. package/client/index.js +453 -129
  733. package/cordis.patch.yml +5 -13
  734. package/docs/Acknowledgements.md +24 -12
  735. package/docs/Changelog.md +70 -0
  736. package/docs/Compatibility.md +78 -2
  737. package/docs/EvaluationResults.md +8 -6
  738. package/docs/UsageGuide.md +91 -15
  739. package/docs/en/Acknowledgements.md +24 -12
  740. package/docs/en/Changelog.md +70 -0
  741. package/docs/en/Compatibility.md +78 -2
  742. package/docs/en/EvaluationResults.md +8 -6
  743. package/docs/en/UsageGuide.md +91 -15
  744. package/docs/images/agent-tree-preview.png +0 -0
  745. package/docs/images/agent-tree.png +0 -0
  746. package/docs/images/install-tgz-preview.png +0 -0
  747. package/docs/images/install-tgz.png +0 -0
  748. package/docs/images/npm-downloads-dark.svg +22 -0
  749. package/docs/images/npm-downloads.svg +22 -0
  750. package/docs/images/preset-settings-preview.png +0 -0
  751. package/docs/images/star-history-dark.svg +22 -0
  752. package/docs/images/star-history.svg +22 -0
  753. package/docs/images/task-status-preview.png +0 -0
  754. package/docs/images/task-status.png +0 -0
  755. package/lib/connection/approvals.d.ts +4 -0
  756. package/lib/connection/approvals.d.ts.map +1 -1
  757. package/lib/connection/approvals.js.map +1 -1
  758. package/lib/connection/client.d.ts.map +1 -1
  759. package/lib/connection/client.js +20 -3
  760. package/lib/connection/client.js.map +1 -1
  761. package/lib/connection/directories.d.ts.map +1 -1
  762. package/lib/connection/directories.js +14 -5
  763. package/lib/connection/directories.js.map +1 -1
  764. package/lib/connection/git.d.ts.map +1 -1
  765. package/lib/connection/git.js +17 -12
  766. package/lib/connection/git.js.map +1 -1
  767. package/lib/connection/guidance.d.ts.map +1 -1
  768. package/lib/connection/guidance.js +7 -0
  769. package/lib/connection/guidance.js.map +1 -1
  770. package/lib/connection/http.d.ts.map +1 -1
  771. package/lib/connection/http.js +79 -31
  772. package/lib/connection/http.js.map +1 -1
  773. package/lib/connection/service.d.ts +6 -2
  774. package/lib/connection/service.d.ts.map +1 -1
  775. package/lib/connection/service.js +87 -33
  776. package/lib/connection/service.js.map +1 -1
  777. package/lib/connection/store.d.ts +3 -0
  778. package/lib/connection/store.d.ts.map +1 -1
  779. package/lib/connection/store.js +151 -37
  780. package/lib/connection/store.js.map +1 -1
  781. package/lib/connection/tasks.d.ts +10 -5
  782. package/lib/connection/tasks.d.ts.map +1 -1
  783. package/lib/connection/tasks.js +158 -81
  784. package/lib/connection/tasks.js.map +1 -1
  785. package/lib/connection/types.d.ts +2 -0
  786. package/lib/connection/types.d.ts.map +1 -1
  787. package/lib/connection/types.js.map +1 -1
  788. package/lib/core/batch-policy.js +2 -2
  789. package/lib/core/batch-policy.js.map +1 -1
  790. package/lib/core/delegation.d.ts +3 -0
  791. package/lib/core/delegation.d.ts.map +1 -1
  792. package/lib/core/delegation.js +2 -2
  793. package/lib/core/delegation.js.map +1 -1
  794. package/lib/core/deletion-command.d.ts.map +1 -1
  795. package/lib/core/deletion-command.js +271 -38
  796. package/lib/core/deletion-command.js.map +1 -1
  797. package/lib/core/tool-evidence.d.ts.map +1 -1
  798. package/lib/core/tool-evidence.js +9 -2
  799. package/lib/core/tool-evidence.js.map +1 -1
  800. package/lib/dsh/budget-settings.d.ts +11 -0
  801. package/lib/dsh/budget-settings.d.ts.map +1 -1
  802. package/lib/dsh/budget-settings.js +43 -9
  803. package/lib/dsh/budget-settings.js.map +1 -1
  804. package/lib/dsh/budgets.d.ts +5 -0
  805. package/lib/dsh/budgets.d.ts.map +1 -1
  806. package/lib/dsh/budgets.js +15 -0
  807. package/lib/dsh/budgets.js.map +1 -1
  808. package/lib/dsh/bundled-skills.d.ts +17 -0
  809. package/lib/dsh/bundled-skills.d.ts.map +1 -0
  810. package/lib/dsh/bundled-skills.js +94 -0
  811. package/lib/dsh/bundled-skills.js.map +1 -0
  812. package/lib/dsh/compaction.d.ts.map +1 -1
  813. package/lib/dsh/compaction.js +1 -0
  814. package/lib/dsh/compaction.js.map +1 -1
  815. package/lib/dsh/connection-approval.d.ts.map +1 -1
  816. package/lib/dsh/connection-approval.js +24 -2
  817. package/lib/dsh/connection-approval.js.map +1 -1
  818. package/lib/dsh/connection-history.d.ts +2 -1
  819. package/lib/dsh/connection-history.d.ts.map +1 -1
  820. package/lib/dsh/connection-history.js +25 -4
  821. package/lib/dsh/connection-history.js.map +1 -1
  822. package/lib/dsh/connection-host.d.ts +0 -1
  823. package/lib/dsh/connection-host.d.ts.map +1 -1
  824. package/lib/dsh/connection-host.js +59 -26
  825. package/lib/dsh/connection-host.js.map +1 -1
  826. package/lib/dsh/connection.d.ts.map +1 -1
  827. package/lib/dsh/connection.js +34 -8
  828. package/lib/dsh/connection.js.map +1 -1
  829. package/lib/dsh/deletion-protection.d.ts.map +1 -1
  830. package/lib/dsh/deletion-protection.js +18 -10
  831. package/lib/dsh/deletion-protection.js.map +1 -1
  832. package/lib/dsh/directory-metadata.d.ts +4 -0
  833. package/lib/dsh/directory-metadata.d.ts.map +1 -0
  834. package/lib/dsh/directory-metadata.js +4 -0
  835. package/lib/dsh/directory-metadata.js.map +1 -0
  836. package/lib/dsh/index.d.ts.map +1 -1
  837. package/lib/dsh/index.js +4 -0
  838. package/lib/dsh/index.js.map +1 -1
  839. package/lib/dsh/memory-library.d.ts.map +1 -1
  840. package/lib/dsh/memory-library.js +8 -4
  841. package/lib/dsh/memory-library.js.map +1 -1
  842. package/lib/dsh/official-budgets.d.ts.map +1 -1
  843. package/lib/dsh/official-budgets.js +16 -3
  844. package/lib/dsh/official-budgets.js.map +1 -1
  845. package/lib/dsh/openspec-shell.d.ts +3 -0
  846. package/lib/dsh/openspec-shell.d.ts.map +1 -0
  847. package/lib/dsh/openspec-shell.js +25 -0
  848. package/lib/dsh/openspec-shell.js.map +1 -0
  849. package/lib/dsh/preset-declaration.d.ts +6 -0
  850. package/lib/dsh/preset-declaration.d.ts.map +1 -1
  851. package/lib/dsh/preset-declaration.js +91 -65
  852. package/lib/dsh/preset-declaration.js.map +1 -1
  853. package/lib/dsh/preset-files.d.ts.map +1 -1
  854. package/lib/dsh/preset-files.js +16 -1
  855. package/lib/dsh/preset-files.js.map +1 -1
  856. package/lib/dsh/preset-installation.d.ts +11 -7
  857. package/lib/dsh/preset-installation.d.ts.map +1 -1
  858. package/lib/dsh/preset-installation.js +71 -33
  859. package/lib/dsh/preset-installation.js.map +1 -1
  860. package/lib/dsh/preset-metadata.d.ts.map +1 -1
  861. package/lib/dsh/preset-metadata.js +20 -7
  862. package/lib/dsh/preset-metadata.js.map +1 -1
  863. package/lib/dsh/preset-recovery-runtime.d.ts +76 -0
  864. package/lib/dsh/preset-recovery-runtime.d.ts.map +1 -0
  865. package/lib/dsh/preset-recovery-runtime.js +344 -0
  866. package/lib/dsh/preset-recovery-runtime.js.map +1 -0
  867. package/lib/dsh/preset-recovery.d.ts +14 -0
  868. package/lib/dsh/preset-recovery.d.ts.map +1 -0
  869. package/lib/dsh/preset-recovery.js +206 -0
  870. package/lib/dsh/preset-recovery.js.map +1 -0
  871. package/lib/dsh/preset-version.d.ts +1 -0
  872. package/lib/dsh/preset-version.d.ts.map +1 -1
  873. package/lib/dsh/preset-version.js +1 -1
  874. package/lib/dsh/preset-version.js.map +1 -1
  875. package/lib/dsh/ptc-budget.d.ts.map +1 -1
  876. package/lib/dsh/ptc-budget.js +24 -12
  877. package/lib/dsh/ptc-budget.js.map +1 -1
  878. package/lib/dsh/skill-directory.d.ts +45 -0
  879. package/lib/dsh/skill-directory.d.ts.map +1 -0
  880. package/lib/dsh/skill-directory.js +113 -0
  881. package/lib/dsh/skill-directory.js.map +1 -0
  882. package/lib/dsh/skill-installation.d.ts +8 -0
  883. package/lib/dsh/skill-installation.d.ts.map +1 -0
  884. package/lib/dsh/skill-installation.js +131 -0
  885. package/lib/dsh/skill-installation.js.map +1 -0
  886. package/lib/dsh/skill-packages.d.ts +6 -0
  887. package/lib/dsh/skill-packages.d.ts.map +1 -0
  888. package/lib/dsh/skill-packages.js +8 -0
  889. package/lib/dsh/skill-packages.js.map +1 -0
  890. package/lib/dsh/super-code.d.ts.map +1 -1
  891. package/lib/dsh/super-code.js +143 -166
  892. package/lib/dsh/super-code.js.map +1 -1
  893. package/lib/dsh/tool-contracts.d.ts +53 -0
  894. package/lib/dsh/tool-contracts.d.ts.map +1 -0
  895. package/lib/dsh/tool-contracts.js +129 -0
  896. package/lib/dsh/tool-contracts.js.map +1 -0
  897. package/lib/dsh/windows-shell.d.ts +2 -2
  898. package/lib/dsh/windows-shell.d.ts.map +1 -1
  899. package/lib/dsh/windows-shell.js +29 -5
  900. package/lib/dsh/windows-shell.js.map +1 -1
  901. package/lib/long-memory.d.ts +2 -2
  902. package/lib/long-memory.d.ts.map +1 -1
  903. package/lib/long-memory.js +19 -11
  904. package/lib/long-memory.js.map +1 -1
  905. package/lib/memory-usage-projection.d.ts.map +1 -1
  906. package/lib/memory-usage-projection.js +13 -9
  907. package/lib/memory-usage-projection.js.map +1 -1
  908. package/lib/super-agent-usage.d.ts +2 -0
  909. package/lib/super-agent-usage.d.ts.map +1 -1
  910. package/lib/super-agent-usage.js +16 -11
  911. package/lib/super-agent-usage.js.map +1 -1
  912. package/lib/task-feedback-projection.d.ts +12 -0
  913. package/lib/task-feedback-projection.d.ts.map +1 -1
  914. package/lib/task-feedback-projection.js +96 -27
  915. package/lib/task-feedback-projection.js.map +1 -1
  916. package/lib/task-memory-store.d.ts.map +1 -1
  917. package/lib/task-memory-store.js +7 -1
  918. package/lib/task-memory-store.js.map +1 -1
  919. package/package.json +24 -4
  920. package/presets/super-code/agent.cordis.yml +4 -6
  921. package/runtime/skills/openspec/bin/openspec +2 -0
  922. package/runtime/skills/openspec/bin/openspec.cmd +6 -0
  923. package/presets/super-code/skills/super-code-frontend/SKILL.md +0 -33
  924. package/presets/super-code/skills/super-code-frontend/references/browser-validation.md +0 -59
  925. package/presets/super-code/skills/super-code-frontend/references/interaction-states.md +0 -51
  926. package/presets/super-code/skills/super-code-frontend/references/visual-design.md +0 -43
package/client/index.js CHANGED
@@ -14,6 +14,7 @@ const icons = require('@deepseek-ai/dsh-client-ui-primitives')
14
14
  const IconChevronDownOutline14 = icons.IconChevronDownOutlineRegular ?? icons.IconChevronDownOutline14
15
15
  const IconRefreshOutline16 = icons.IconRefreshOutlineRegular ?? icons.IconRefreshOutline16
16
16
  const { SessionEventStream } = require('@deepseek-ai/dsh-api-session-controller')
17
+ const skillUi = require('@deepseek-ai/dsh-client-ui-skill')
17
18
 
18
19
  /* Shared controls use public React APIs without host-private dependencies. */
19
20
  let selectControlSequence = 0
@@ -44,10 +45,12 @@ function SelectControl({ id, label, value, choices, onChange, disabled = false }
44
45
  setOpen(true)
45
46
  }
46
47
  const choose = index => {
48
+ if (unavailable) return
47
49
  onChange(choices[index][0])
48
50
  setOpen(false)
49
51
  trigger.current.focus({ preventScroll: true })
50
52
  }
53
+ useLayoutEffect(() => { if (unavailable) setOpen(false) }, [unavailable])
51
54
  useLayoutEffect(() => {
52
55
  if (!open) return
53
56
  const place = () => setPlacement(selectControlPlacement(trigger.current.getBoundingClientRect(), choices.length))
@@ -173,8 +176,8 @@ function AgentMessage({ record, saved, t, toolName }) {
173
176
  if (event.currentTarget.open) saved.open.add(item.seq); else saved.open.delete(item.seq)
174
177
  } },
175
178
  React.createElement('summary', null, label, React.createElement(Glyph, { type: 'chevron' })),
176
- React.createElement(DetailText, { text: item.text, t }))
177
- : React.createElement(React.Fragment, null, label, React.createElement(DetailText, { text: item.text, t }))))
179
+ React.createElement(DetailText, { text: item.text, format: item.format, t }))
180
+ : React.createElement(React.Fragment, null, label, React.createElement(DetailText, { text: item.text, format: item.format, t }))))
178
181
  }
179
182
 
180
183
  /* Keep native controls and their refs/events; mount name bubbles outside clipped
@@ -268,6 +271,9 @@ const zh = {
268
271
  'feedback.source.record': '任务记录',
269
272
  'feedback.source.request': '用户原文',
270
273
  'feedback.latest': '本轮要求',
274
+ 'feedback.previous': '此前要求',
275
+ 'feedback.historicalStatus': '{status}(历史记录)',
276
+ 'feedback.historyPartial': '部分较早的要求或步骤未展示,完整记录见执行记录。',
271
277
  'feedback.progress': '步骤 {done} / {total}',
272
278
  'feedback.progressPartial': '已记录步骤 {done} / {total}',
273
279
  'feedback.steps': '步骤进度',
@@ -298,6 +304,23 @@ const zh = {
298
304
  'feedback.agentsPartial': '任务条目超过显示上限,可在动作执行中查看其他 Agent。',
299
305
  'status.blocked': '受阻',
300
306
 
307
+ 'settings.skillsTab': '预设 Skill',
308
+ 'skills.title': '预设 Skill', 'skills.scope': '开启后同步到 DSH 的 Skill 目录,按需加载,自动保存并在当前对话实时生效。',
309
+ 'skills.openDirectory': '打开 Skill 目录', 'skills.openFailed': '无法打开 Skill 目录,请确认 DSH 所在设备支持文件管理器。',
310
+ 'skills.directoryUnavailable': '当前 DSH 所在环境不支持打开文件管理器。',
311
+ 'skills.directoryError': '部分 Skill 未能同步。已有的用户文件和修改已保留,请打开 Skill 目录检查后重试。',
312
+ 'skills.retry': '重试同步',
313
+ 'skills.individual': 'Skill', 'skills.workflows': '工作流',
314
+ 'skills.grillMeSkill': 'grill-me', 'skills.grillMeSkillHint': '需求还不清楚或想检验方案时,输入 /grill-me,通过逐轮追问理清关键决策。',
315
+ 'skills.oilUiSkill': 'oil-ui', 'skills.oilUiSkillHint': '设计或改进页面时,输入 /oil-ui,获得布局、配色和交互方面的设计建议。',
316
+ 'skills.openspecSkills': 'OpenSpec', 'skills.openspecSkillsHint': '需要先明确规范再开发时,输入 /openspec-propose,生成包含需求、设计和任务的变更提案。',
317
+ 'skills.mattpocockSkills': 'Matt Pocock Skills', 'skills.mattpocockSkillsHint': '规划、开发、测试或排查代码问题时,输入 /mattpocock 搜索并选择对应工作流。',
318
+ 'skills.pstackSkills': 'PStack', 'skills.pstackSkillsHint': '需要规划、协作开发或代码评审时,输入 /pstack 选择工作流,也可用 /poteto-mode 启用整套工作方式。',
319
+ 'skills.commands': '输入 / 选择 Skill,也可输入 /pstack、/mattpocock 等包名查找,选择后使用真实 Skill 命令。开关保存后实时生效,不撤回已进入上下文的内容。',
320
+ 'skills.pstackRequirement': 'PStack 已针对 DSH 0.2.1-alpha.1 及之后版本适配;部分流程仍需 Git、Bun 或模型检查器等外部工具。',
321
+ 'skills.openspecRequirement': 'OpenSpec CLI 随插件安装就绪。开关不改动项目,仅在你明确要求时初始化项目。',
322
+ 'skills.upgrade': '当前预设尚未接入 Skill 包开关,请在“预设配置”中重新安装预设后使用。',
323
+ 'skills.missing': '安装 Super Code 预设后即可使用这些 Skill 包。',
301
324
  'settings.homeTab': '首页', 'settings.presetTab': '预设配置', 'settings.protectionTab': '删除保护',
302
325
  'shell.title': '命令环境', 'shell.enabled': '使用内置 Bash(Windows)',
303
326
  'shell.hint': '无需安装 Git。新启动的会话生效,子 Agent 继承。Windows 限权模式下需由 DSH 逐条审批,不自动修改会话权限。',
@@ -347,7 +370,7 @@ const zh = {
347
370
  'connection.tokenHint': '请将凭证安全保存在客户端。更换凭证后,旧凭证立即失效。',
348
371
  'connection.rotated': '已更换凭证,请更新客户端。', 'connection.copied': '已复制。',
349
372
  'connection.error.unavailable': '连接服务尚未就绪或当前配置目录不可写,请重新读取。', 'connection.error.invalid': '请检查端口、最大连接数和目录。启用连接至少需要一个有效目录。', 'connection.error.new-conversation-disabled': 'MCP 新增对话已关闭,请选择已有对话继续。',
350
- 'connection.error.conflict': '连接设置已在别处修改。草稿已保留,请重新读取。', 'connection.error.save-failed': '保存失败,草稿已保留。', 'connection.error.port-unavailable': '端口被占用或无法监听。请更换端口并保存。', 'connection.error.storage-unavailable': '任务状态保存失败,请检查配置目录。', 'connection.error.clipboard': '复制失败,请手动复制。',
373
+ 'connection.error.conflict': '连接设置已在别处修改。草稿已保留,请重新读取。', 'connection.error.save-failed': '保存失败,草稿已保留。', 'connection.error.port-unavailable': '端口被占用或无法监听。请更换端口,或稍后重试。', 'connection.error.cleanup-failed': '设置已保存,但连接清理失败。请点击“重试”恢复连接。', 'connection.error.storage-unavailable': '任务状态保存失败,请检查配置目录。', 'connection.error.clipboard': '复制失败,请手动复制。',
351
374
  'settings.contextTab': '上下文配置', 'settings.tabs': 'Super Code 配置',
352
375
  'budget.common': '通用预算', 'budget.superCode': 'Super Code 专属预算',
353
376
  'budget.applyToOfficialPresets': '同时应用到官方预设', 'budget.officialHint': '开启后,通用预算也用于标准、PTC、极简和创造模式;不包含下方的 Super Code 专属预算。',
@@ -388,6 +411,9 @@ const zh = {
388
411
  'workspace.title': 'Super Code', 'workspace.description': '任务状态、Agent 执行树与记忆库', 'workspace.resize': '调整执行树与记忆库高度',
389
412
  'tree.collapsedLabel': '已收起', 'tree.organizeLabel': '自动整理',
390
413
  'detail.toolCall': '工具调用', 'detail.toolResult': '工具结果', 'detail.toolError': '工具失败',
414
+ 'detail.authError': '模型身份验证失败,请检查模型配置。',
415
+ 'detail.maxTokens': '模型输出达到 Token 上限,可继续对话。',
416
+ 'detail.copy': '复制', 'detail.copied': '已复制', 'detail.footnotes': '脚注',
391
417
  'detail.cache': '缓存', 'detail.info': '详情', 'tree.countCompact': '{shown}/{total} · 运行 {running}',
392
418
  'memory.loading': '正在读取记忆…', 'memory.topics': '知识主题', 'memory.allTopics': '全部主题', 'memory.related': '同主题知识', 'preset.configuration': '预设配置',
393
419
  'memory.title': '记忆', 'memory.project': '当前项目', 'memory.global': '全局偏好', 'memory.search': '搜索主题或记忆',
@@ -457,6 +483,9 @@ const en = {
457
483
  'feedback.source.record': 'Recorded objective',
458
484
  'feedback.source.request': 'User request',
459
485
  'feedback.latest': 'Latest request',
486
+ 'feedback.previous': 'Earlier request',
487
+ 'feedback.historicalStatus': '{status} (historical record)',
488
+ 'feedback.historyPartial': 'Some earlier requests or steps are omitted; open the execution log for the full record.',
460
489
  'feedback.progress': 'Steps {done} / {total}',
461
490
  'feedback.progressPartial': 'Recorded steps {done} / {total}',
462
491
  'feedback.steps': 'Step progress',
@@ -487,6 +516,23 @@ const en = {
487
516
  'feedback.agentsPartial': 'The task list reached its limit; view other Agents in the execution tree.',
488
517
  'status.blocked': 'Blocked',
489
518
 
519
+ 'settings.skillsTab': 'Preset Skills',
520
+ 'skills.title': 'Preset Skills', 'skills.scope': 'Enabled packages sync to the DSH Skill directory. Skills load on demand; changes save automatically and apply to current conversations.',
521
+ 'skills.openDirectory': 'Open Skill directory', 'skills.openFailed': 'Could not open the Skill directory. Check that the device running DSH supports a file manager.',
522
+ 'skills.directoryUnavailable': 'The device running DSH does not support opening a file manager.',
523
+ 'skills.directoryError': 'Some Skills could not be synced. Existing user files and edits were preserved. Check the Skill directory and retry.',
524
+ 'skills.retry': 'Retry sync',
525
+ 'skills.individual': 'Skills', 'skills.workflows': 'Workflows',
526
+ 'skills.grillMeSkill': 'grill-me', 'skills.grillMeSkillHint': 'When requirements are unclear or a plan needs scrutiny, use /grill-me to clarify key decisions through focused questions.',
527
+ 'skills.oilUiSkill': 'oil-ui', 'skills.oilUiSkillHint': 'When designing or improving a page, use /oil-ui for layout, color and interaction design guidance.',
528
+ 'skills.openspecSkills': 'OpenSpec', 'skills.openspecSkillsHint': 'When a change needs a specification before development, use /openspec-propose to generate a proposal with requirements, design and tasks.',
529
+ 'skills.mattpocockSkills': 'Matt Pocock Skills', 'skills.mattpocockSkillsHint': 'For planning, development, testing or debugging, type /mattpocock to search for and select the appropriate workflow.',
530
+ 'skills.pstackSkills': 'PStack', 'skills.pstackSkillsHint': 'For planning, collaborative development or code review, type /pstack to select a workflow, or use /poteto-mode to adopt the full working approach.',
531
+ 'skills.commands': 'Type / to select a Skill, or search by package with /pstack or /mattpocock. Picking inserts the real Skill command. Saved switches take effect immediately; instructions already in context remain.',
532
+ 'skills.pstackRequirement': 'PStack is adapted for DSH 0.2.1-alpha.1 and later; some workflows still need external tools such as Git, Bun or a model checker.',
533
+ 'skills.openspecRequirement': 'The OpenSpec CLI is installed with the plugin. Switches do not change projects; initialization runs only when you explicitly request it.',
534
+ 'skills.upgrade': 'This preset does not support Skill package switches yet. Reinstall it in Preset configuration to apply these choices.',
535
+ 'skills.missing': 'Install the Super Code preset to use these Skill packages.',
490
536
  'settings.homeTab': 'Home', 'settings.presetTab': 'Preset configuration', 'settings.protectionTab': 'Deletion protection',
491
537
  'shell.title': 'Command environment', 'shell.enabled': 'Use bundled Bash (Windows)',
492
538
  'shell.hint': 'No Git installation required. Takes effect when a conversation starts; child Agents inherit it. Confined Windows modes require DSH approval for each command without changing session permissions.',
@@ -536,7 +582,7 @@ const en = {
536
582
  'connection.tokenHint': 'Store the token securely in the client. Rotation invalidates the previous token immediately.',
537
583
  'connection.rotated': 'Token rotated. Update your client.', 'connection.copied': 'Copied.',
538
584
  'connection.error.unavailable': 'The service is not ready or the profile directory is not writable. Reload to retry.', 'connection.error.invalid': 'Check the port, maximum connections and directories. Enabling requires at least one valid directory.', 'connection.error.new-conversation-disabled': 'MCP new conversations are disabled. Choose an existing conversation to continue.',
539
- 'connection.error.conflict': 'Connection settings changed elsewhere. Your draft is retained; reload to continue.', 'connection.error.save-failed': 'Save failed. Your draft is retained.', 'connection.error.port-unavailable': 'The port is occupied or cannot be opened. Save with another port.', 'connection.error.storage-unavailable': 'Task state could not be saved. Check the profile directory.', 'connection.error.clipboard': 'Copy failed. Copy the text manually.',
585
+ 'connection.error.conflict': 'Connection settings changed elsewhere. Your draft is retained; reload to continue.', 'connection.error.save-failed': 'Save failed. Your draft is retained.', 'connection.error.port-unavailable': 'The port is occupied or cannot be opened. Choose another port or retry later.', 'connection.error.cleanup-failed': 'Settings were saved, but connection cleanup failed. Click Retry to restore the connection.', 'connection.error.storage-unavailable': 'Task state could not be saved. Check the profile directory.', 'connection.error.clipboard': 'Copy failed. Copy the text manually.',
540
586
  'settings.contextTab': 'Context settings', 'settings.tabs': 'Super Code settings',
541
587
  'budget.common': 'Common budgets', 'budget.superCode': 'Super Code budgets',
542
588
  'budget.applyToOfficialPresets': 'Also apply to official presets', 'budget.officialHint': 'Apply common budgets to Standard, PTC, Minimal and Create. Super Code task and memory limits below remain exclusive to Super Code.',
@@ -577,6 +623,9 @@ const en = {
577
623
  'workspace.title': 'Super Code', 'workspace.description': 'Task status, Agent tree and memory library', 'workspace.resize': 'Resize agent tree and memory library',
578
624
  'tree.collapsedLabel': 'Collapsed', 'tree.organizeLabel': 'Organize',
579
625
  'detail.toolCall': 'Tool call', 'detail.toolResult': 'Tool result', 'detail.toolError': 'Tool failed',
626
+ 'detail.authError': 'Model authentication failed. Check the model settings.',
627
+ 'detail.maxTokens': 'The model reached its output token limit. Continue the conversation to proceed.',
628
+ 'detail.copy': 'Copy', 'detail.copied': 'Copied', 'detail.footnotes': 'Footnotes',
580
629
  'detail.cache': 'Cache', 'detail.info': 'Details', 'tree.countCompact': '{shown}/{total} · Running {running}',
581
630
  'memory.loading': 'Loading memories…', 'memory.topics': 'Knowledge topics', 'memory.allTopics': 'All topics', 'memory.related': 'More in this topic', 'preset.configuration': 'Preset configuration',
582
631
  'memory.title': 'Memory', 'memory.project': 'This project', 'memory.global': 'Global preferences', 'memory.search': 'Search topics or memories',
@@ -1024,19 +1073,24 @@ function FeedbackTools({ tools, t }) {
1024
1073
  function feedbackListItems(model, root, partial) {
1025
1074
  const items = []
1026
1075
  const add = (kind, key, data = {}, row) => items.push({ kind, key: JSON.stringify(key), row, ...data,
1027
- signature: JSON.stringify([kind, data.content, data.todo, data.tools, data.label, data.count,
1076
+ signature: JSON.stringify([kind, data.content, data.todo, data.historical, data.tools, data.label, data.count,
1028
1077
  data.file && [data.file.name, data.file.directory, [...data.file.operations]], kind === 'task' &&
1029
1078
  [row.title, row.owner, row.done, row.total, row.complete, row.taskStatus, row.facts?.phase, row.node.running]]) })
1030
1079
  for (const row of model.tasks) {
1031
1080
  const facts = row.facts
1032
1081
  add('task', [row.id, 'task'], {}, row)
1033
1082
  if (row.goal && row.goal !== row.title) add('text', [row.id, 'goal'], { content: row.goal }, row)
1034
- if (facts?.latestRequest && facts.latestRequest !== facts.request) add('request', [row.id, 'request'], { content: facts.latestRequest }, row)
1083
+ if (facts?.latestRequest && (facts.latestRequest !== row.title || facts.history?.length)) add('request', [row.id, 'request'], { content: facts.latestRequest }, row)
1035
1084
  row.todos.forEach((todo, index) => add('step', [row.id, 'step', index], { todo }, row))
1036
1085
  const tools = feedbackToolSummary(facts?.activities)
1037
1086
  if (tools.length) add('tools', [row.id, 'tools'], { tools }, row)
1038
1087
  if (!row.total && !tools.length) add('note', [row.id, 'empty'], { label: facts ? 'feedback.noSteps' : 'feedback.loading' }, row)
1039
1088
  if (facts?.omittedActivities) add('note', [row.id, 'recent'], { label: 'feedback.recentOnly' }, row)
1089
+ for (const previous of [...(facts?.history || [])].reverse()) {
1090
+ add('request', [row.id, 'history', previous.seq], { content: previous.request, historical: true }, row)
1091
+ previous.todos.forEach((todo, index) => add('step', [row.id, 'history', previous.seq, index], { todo, historical: true }, row))
1092
+ }
1093
+ if (facts?.omittedRequests || facts?.history?.some(previous => previous.omittedTodos)) add('note', [row.id, 'historyPartial'], { label: 'feedback.historyPartial' }, row)
1040
1094
  add('open', [row.id, 'open'], { focusable: !row.node.unavailable }, row)
1041
1095
  }
1042
1096
  if (root) {
@@ -1096,8 +1150,9 @@ function FeedbackRowContent({ item, root, openDetail, t }) {
1096
1150
  row.total > 0 && React.createElement('span', { className: 'dsh-super-code-feedback-count', 'aria-label': progressLabel, title: progressLabel }, `${row.done}/${row.total}${row.complete ? '' : '+'}`),
1097
1151
  row.total > 0 && row.complete && React.createElement('progress', { max: row.total, value: row.done, 'aria-label': text(t, 'feedback.steps') }))
1098
1152
  }
1099
- if (item.kind === 'step') return React.createElement('div', { className: 'dsh-super-code-feedback-step', 'data-step-state': item.todo.status },
1100
- React.createElement(FeedbackMark, { tone: item.todo.status === 'completed' ? 'success' : item.todo.status === 'in_progress' ? 'active' : 'pending', label: text(t, 'feedback.todo.' + item.todo.status) }),
1153
+ if (item.kind === 'step') return React.createElement('div', { className: 'dsh-super-code-feedback-step', 'data-step-state': item.todo.status, 'data-step-history': item.historical || undefined },
1154
+ React.createElement(FeedbackMark, { tone: item.todo.status === 'completed' ? 'success' : !item.historical && item.todo.status === 'in_progress' ? 'active' : 'pending',
1155
+ label: item.historical ? text(t, 'feedback.historicalStatus', { status: text(t, 'feedback.todo.' + item.todo.status) }) : text(t, 'feedback.todo.' + item.todo.status) }),
1101
1156
  React.createElement('span', null, item.todo.content))
1102
1157
  if (item.kind === 'tools') return React.createElement(FeedbackTools, { tools: item.tools, t })
1103
1158
  if (item.kind === 'open') return React.createElement(ActionButton, { type: 'button', className: 'dsh-super-code-feedback-open', disabled: !item.focusable,
@@ -1115,7 +1170,7 @@ function FeedbackRowContent({ item, root, openDetail, t }) {
1115
1170
  if (item.label === 'tree.empty') return React.createElement('p', { className: 'dsh-super-code-state', 'data-tone': 'empty' }, React.createElement(Glyph, { type: 'context' }), text(t, item.label))
1116
1171
  if (item.kind === 'note') return React.createElement('p', { className: 'dsh-super-code-feedback-muted' }, text(t, item.label))
1117
1172
  return React.createElement('p', { className: 'dsh-super-code-feedback-text' },
1118
- item.kind === 'request' && React.createElement('small', null, text(t, 'feedback.latest')), item.content)
1173
+ item.kind === 'request' && React.createElement('small', null, text(t, item.historical ? 'feedback.previous' : 'feedback.latest')), item.content)
1119
1174
  }
1120
1175
 
1121
1176
  /** One measured, variable-height viewport for tasks, steps, activity and files. */
@@ -1238,9 +1293,13 @@ function TaskFeedback({ useSessions, useSessionStatus, sessionId, useTabInfo, tr
1238
1293
  if (!value || value.root !== view.root) { value = { root: view.root, limit: 200, focused: state.current, expanded: new Set(), collapsed: new Set() }; treeStates.set(tab.signal, value) }
1239
1294
  return value
1240
1295
  }, [treeStates, tab.signal, view.root])
1296
+ const catalogs = state.subagentsByParent
1297
+ return React.createElement(TaskFeedbackBody, { key: view.root, view, catalogs, saved, openDetail, refresh, watchCatalog, onToggle, t })
1298
+ }
1299
+ function TaskFeedbackBody({ view, catalogs, saved, openDetail, refresh, watchCatalog, onToggle, t }) {
1241
1300
  const [busy, setBusy] = useState(false), [error, setError] = useState(false)
1242
1301
  const model = useMemo(() => taskFeedbackRows(view), [view])
1243
- const partial = model.partial || Object.values(state.subagentsByParent || {}).some(value => value.state === 'error')
1302
+ const partial = model.partial || [...view.nodes.keys()].some(id => catalogs?.[id]?.state === 'error')
1244
1303
  const items = useMemo(() => {
1245
1304
  const rows = feedbackListItems(model, view.root, partial)
1246
1305
  if (!view.root) rows.unshift({ kind: 'note', key: 'empty', label: 'tree.empty', signature: 'empty' })
@@ -1260,7 +1319,7 @@ function TaskFeedback({ useSessions, useSessionStatus, sessionId, useTabInfo, tr
1260
1319
  React.createElement('header', null,
1261
1320
  React.createElement(WorkspaceSectionToggle, { section: 'tasks', expanded: true, onToggle, t }),
1262
1321
  React.createElement(ActionButton, { type: 'button', className: 'dsh-super-code-icon-button', title: text(t, 'feedback.refresh'), 'aria-label': text(t, 'feedback.refresh'), disabled: busy || !view.root, onClick: () => void reload() }, React.createElement(IconRefreshOutline16))),
1263
- React.createElement(FeedbackVirtualList, { key: view.root, items, root: view.root, saved, openDetail, t, watchCatalog }))
1322
+ React.createElement(FeedbackVirtualList, { items, root: view.root, saved, openDetail, t, watchCatalog }))
1264
1323
  }
1265
1324
 
1266
1325
  function WorkspaceSectionToggle({ section, expanded, onToggle, children, t }) {
@@ -1272,7 +1331,7 @@ function WorkspaceSectionToggle({ section, expanded, onToggle, children, t }) {
1272
1331
  React.createElement('strong', null, label), children)
1273
1332
  }
1274
1333
 
1275
- /** Accordion: at most one open view; clicking the open heading collapses it. Tab state retains drafts. */
1334
+ /** Accordion: exactly one open view. Tab state retains drafts across section switches. */
1276
1335
  function SuperCodeWorkspace(props) {
1277
1336
  const { tab } = props.useTabInfo()
1278
1337
  const address = typeof tab.navigation?.params?.memory === 'string' ? tab.navigation.params.memory : tab.contentId
@@ -1280,6 +1339,7 @@ function SuperCodeWorkspace(props) {
1280
1339
  const memoryTarget = memoryLibraryTarget(address, '')
1281
1340
  const saved = useMemo(() => {
1282
1341
  const value = props.workspaceStates.get(tab.signal) || { active: 'tasks' }
1342
+ if (!['tasks', 'tree', 'memory'].includes(value.active)) value.active = 'tasks'
1283
1343
  if (value.navigationKey !== navigationKey) {
1284
1344
  value.navigationKey = navigationKey
1285
1345
  if (memoryTarget.id) value.active = 'memory'
@@ -1287,11 +1347,11 @@ function SuperCodeWorkspace(props) {
1287
1347
  props.workspaceStates.set(tab.signal, value)
1288
1348
  return value
1289
1349
  }, [props.workspaceStates, tab.signal])
1290
- const [active, setActive] = useState(['tasks', 'tree', 'memory', ''].includes(saved.active) ? saved.active : 'tasks')
1350
+ const [active, setActive] = useState(saved.active)
1291
1351
  const layout = useRef(null), focusSection = useRef('')
1292
1352
  const toggle = section => {
1293
- const next = active === section ? '' : section
1294
- saved.active = next; focusSection.current = section; setActive(next)
1353
+ if (active === section) return
1354
+ saved.active = section; focusSection.current = section; setActive(section)
1295
1355
  }
1296
1356
  useLayoutEffect(() => {
1297
1357
  if (saved.navigationKey === navigationKey) return
@@ -1511,7 +1571,7 @@ function AgentTreeBody({ state, view, saved, openDetail, refresh, watchCatalog,
1511
1571
  const parent = positions.get(edge.parent), child = positions.get(edge.child)
1512
1572
  return React.createElement('path', { key: edge.child, d: `M ${parent.x} ${parent.y + agentTreeNodeHeight} V ${child.y - 16} H ${child.x} V ${child.y - 10}`, fill: 'none' })
1513
1573
  })),
1514
- rows.map(row => {
1574
+ rows.map((row, index) => {
1515
1575
  const node = view.nodes.get(row.id)
1516
1576
  const title = node.title || node.displayTitle || text(t, 'main.agent')
1517
1577
  const { label: status, tone } = agentExecutionStatus(node, row.id === view.root, t)
@@ -1531,7 +1591,7 @@ function AgentTreeBody({ state, view, saved, openDetail, refresh, watchCatalog,
1531
1591
  onFocus: () => setFocused(row.id), onClick: () => { if (!node.unavailable) open(node) },
1532
1592
  onKeyDown: event => { if (event.target === event.currentTarget) keyDown(event, row) },
1533
1593
  },
1534
- React.createElement('span', { className: 'dsh-super-code-circle ' + tone, 'aria-hidden': true }, row.id === view.root ? text(t, 'main.agent').slice(0, 1) : String(rows.findIndex(item => item.id === row.id))),
1594
+ React.createElement('span', { className: 'dsh-super-code-circle ' + tone, 'aria-hidden': true }, row.id === view.root ? text(t, 'main.agent').slice(0, 1) : String(index)),
1535
1595
  React.createElement('span', { className: 'dsh-super-code-tree-content' },
1536
1596
  React.createElement('span', { className: 'dsh-super-code-tree-title' }, title),
1537
1597
  React.createElement('span', { className: 'dsh-super-code-node-status', 'data-tone': tone }, React.createElement('i', { 'aria-hidden': true }), status),
@@ -1591,27 +1651,44 @@ function detailRecord(entry, t = key => zh[key] || key) {
1591
1651
  const base = { seq: event.seq, time: event.time, entry }
1592
1652
  if (event.type === 'user/message') {
1593
1653
  if (data.source?.kind !== 'user') return { kind: 'skip' }
1594
- return { ...base, kind: 'message', label: text(t, 'detail.task'), text: contentText(data.content, t) }
1595
- }
1596
- if (event.type === 'assistant/message') return { ...base, kind: 'message', label: data.interrupted ? text(t, 'detail.interrupted') : text(t, 'detail.agent'), text: contentText(data.message?.content, t) }
1597
- if (event.type === 'tool/call' && typeof data.name === 'string' && data.name) {
1598
- let value = typeof data.arguments === 'string' ? data.arguments : JSON.stringify(data.arguments ?? {})
1654
+ return { ...base, kind: 'message', format: 'text', label: text(t, 'detail.task'), text: contentText(data.content, t) }
1655
+ }
1656
+ if (event.type === 'assistant/message') return { ...base, kind: 'message', format: 'markdown', label: data.interrupted ? text(t, 'detail.interrupted') : text(t, 'detail.agent'), text: contentText(data.message?.content, t) }
1657
+ const nestedCall = event.type === 'tool/ptc-dispatch-start'
1658
+ if ((event.type === 'tool/call' || nestedCall) && typeof data.name === 'string' && data.name) {
1659
+ // Native arguments are raw JSON; PTC arguments are already decoded values.
1660
+ let value = !nestedCall && typeof data.arguments === 'string' ? data.arguments
1661
+ : JSON.stringify(data.arguments === undefined ? {} : data.arguments)
1599
1662
  try { value = JSON.stringify(JSON.parse(value), null, 2) } catch { /* Incomplete arguments remain readable. */ }
1600
- return { ...base, kind: 'tool', collapsed: true, toolName: data.name, callId: data.callId,
1663
+ return { ...base, kind: 'tool', format: 'json', collapsed: true, toolName: data.name,
1664
+ callId: nestedCall ? data.subCallId : data.callId, ...(nestedCall ? { parentCallId: data.parentCallId } : {}),
1601
1665
  label: text(t, 'detail.toolCall') + ' · ' + data.name, text: value }
1602
1666
  }
1667
+ if (event.type === 'tool/ptc-dispatch' && typeof data.name === 'string' && data.name) {
1668
+ return { ...base, kind: data.isError ? 'error' : 'tool', format: 'code', collapsed: true,
1669
+ callId: data.subCallId, parentCallId: data.parentCallId, toolName: data.name,
1670
+ label: text(t, data.isError ? 'detail.toolError' : 'detail.toolResult') + ' · ' + data.name,
1671
+ text: contentText(data.content, t) }
1672
+ }
1603
1673
  if (event.type === 'tool/result') {
1604
1674
  const blocks = (data.message?.content || []).filter(block => block.type === 'tool-result')
1605
1675
  // Harness journals use both direct tool messages (v4) and nested results.
1606
1676
  const direct = data.message?.role === 'tool'
1607
1677
  if (!blocks.length && !direct) return { kind: 'skip' }
1608
1678
  const failed = direct ? data.message.isError : blocks.some(block => block.isError)
1609
- return { ...base, kind: failed ? 'error' : 'tool', collapsed: true,
1679
+ return { ...base, kind: failed ? 'error' : 'tool', format: 'code', collapsed: true,
1610
1680
  callId: direct ? data.message.toolCallId : blocks[0]?.toolCallId,
1611
1681
  label: text(t, failed ? 'detail.toolError' : 'detail.toolResult'),
1612
1682
  text: contentText(direct ? data.message.content : blocks.flatMap(block => block.content || []), t) }
1613
1683
  }
1614
- if (event.type === 'turn/error') return { ...base, kind: 'error', label: text(t, 'detail.error'), text: data.message || text(t, 'detail.incomplete') }
1684
+ if (event.type === 'turn/end' && ['error', 'max-tokens'].includes(data.reason?.kind)) {
1685
+ const failure = data.reason.error
1686
+ // Match the host's AUTH handling: provider diagnostics can echo credentials.
1687
+ const message = data.reason.kind === 'max-tokens' ? text(t, 'detail.maxTokens') : failure?.code === 'AUTH' ? text(t, 'detail.authError')
1688
+ : (typeof failure?.message === 'string' && failure.message) || text(t, 'detail.incomplete')
1689
+ return { ...base, kind: 'error', format: 'text', label: text(t, 'detail.error'), text: message }
1690
+ }
1691
+ if (event.type === 'turn/error') return { ...base, kind: 'error', format: 'text', label: text(t, 'detail.error'), text: data.message || text(t, 'detail.incomplete') }
1615
1692
  return { kind: 'skip' }
1616
1693
  }
1617
1694
 
@@ -1620,7 +1697,7 @@ function detailRecord(entry, t = key => zh[key] || key) {
1620
1697
  function createAgentInspector(createStream, address, readPage, initial, t = key => zh[key] || key) {
1621
1698
  let snapshot = initial || { status: 'loading', items: [], hasMore: false, earlier: false, truncated: false, projections: {}, error: '', firstSeq: 0, cursor: -1 }
1622
1699
  let cursor = snapshot.cursor
1623
- let disposed = false, stream
1700
+ let disposed = false, paging = false, stream
1624
1701
  const listeners = new Set()
1625
1702
  const publish = patch => {
1626
1703
  if (disposed) return
@@ -1634,7 +1711,7 @@ function createAgentInspector(createStream, address, readPage, initial, t = key
1634
1711
  if (disposed) return
1635
1712
  if (change.type === 'replace') {
1636
1713
  if (snapshot.earlier) {
1637
- publish({ status: 'ready', projections: change.page.projections?.values || {}, error: '' })
1714
+ publish({ status: paging ? 'paging' : 'ready', projections: change.page.projections?.values || {}, error: '' })
1638
1715
  return
1639
1716
  }
1640
1717
  const fresh = itemsOf(change.entries)
@@ -1643,7 +1720,7 @@ function createAgentInspector(createStream, address, readPage, initial, t = key
1643
1720
  // A resumed tail page can start later than the user's reading window.
1644
1721
  // Immutable journal records can be merged without moving that window.
1645
1722
  const items = overlaps ? [...new Map([...snapshot.items, ...fresh].map(item => [item.seq, item])).values()].sort((a, b) => a.seq - b.seq) : fresh
1646
- publish({ status: 'ready', items: items.slice(-200), hasMore: (overlaps ? snapshot.hasMore : change.hasMore) || items.length > 200, earlier: false, truncated: items.length > 200,
1723
+ publish({ status: paging ? 'paging' : 'ready', items: items.slice(-200), hasMore: (overlaps ? snapshot.hasMore : change.hasMore) || items.length > 200, earlier: false, truncated: items.length > 200,
1647
1724
  firstSeq: items.length > 200 ? items.at(-200).seq : overlaps ? snapshot.firstSeq : change.entries[0]?.event.seq ?? 0,
1648
1725
  cursor: change.entries.at(-1)?.event.seq ?? -1,
1649
1726
  projections: change.page.projections?.values || {}, error: '' })
@@ -1665,7 +1742,8 @@ function createAgentInspector(createStream, address, readPage, initial, t = key
1665
1742
  subscribe: listener => { listeners.add(listener); return () => listeners.delete(listener) },
1666
1743
  start: () => { stream.open({ maxMessages: 40 }).catch(() => publish({ status: 'error', error: 'detail.loadError' })) },
1667
1744
  older: async () => {
1668
- if (snapshot.status === 'paging' || !snapshot.hasMore) return
1745
+ if (disposed || paging || !snapshot.hasMore) return
1746
+ paging = true
1669
1747
  publish({ status: 'paging', error: '' })
1670
1748
  const throughSeq = cursor
1671
1749
  try {
@@ -1677,15 +1755,23 @@ function createAgentInspector(createStream, address, readPage, initial, t = key
1677
1755
  hasMore: result.value.hasMore || items.length > 200 })
1678
1756
  }
1679
1757
  catch { publish({ status: 'error', error: 'detail.historyError' }) }
1758
+ finally { paging = false }
1680
1759
  },
1681
1760
  dispose: () => { disposed = true; listeners.clear(); void stream.dispose() },
1682
1761
  }
1683
1762
  }
1684
1763
 
1685
- function DetailText({ text: value, t = key => zh[key] || key }) {
1764
+ function DetailText({ text: value, format = 'text', t = key => zh[key] || key }) {
1686
1765
  const [full, setFull] = useState(false)
1766
+ const copyLabel = text(t, 'detail.copy'), copiedLabel = text(t, 'detail.copied'), footnotes = text(t, 'detail.footnotes')
1767
+ const labels = useMemo(() => ({ code: { copyLabel, copiedLabel }, footnotes }), [copyLabel, copiedLabel, footnotes])
1768
+ const content = full ? value : value.slice(0, 12000)
1687
1769
  return React.createElement(React.Fragment, null,
1688
- React.createElement('pre', null, full ? value : value.slice(0, 12000)),
1770
+ React.createElement('div', { className: 'dsh-super-code-detail-content' },
1771
+ format === 'markdown' ? React.createElement(icons.MarkdownText, { text: content, labels })
1772
+ : format === 'json' || format === 'code' ? React.createElement(icons.CodeBlock, { code: content,
1773
+ lang: format === 'json' ? 'json' : 'text', copyLabel, copiedLabel })
1774
+ : React.createElement('pre', { className: 'dsh-super-code-detail-plain' }, content)),
1689
1775
  !full && value.length > 12000 && React.createElement(ActionButton, { type: 'button', onClick: () => setFull(true) }, text(t, 'detail.open')))
1690
1776
  }
1691
1777
 
@@ -1723,10 +1809,12 @@ function memoryLibraryTarget(address, current) {
1723
1809
  /** A repeated explicit navigation reopens its entry; ordinary remounts retain reading state. */
1724
1810
  function memoryLibraryNavigation(saved, tab, current) {
1725
1811
  const address = typeof tab.navigation?.params?.memory === 'string' ? tab.navigation.params.memory : tab.contentId
1726
- const navigationKey = `${address}/${tab.navigation?.revision || 0}`
1727
- if (saved.navigationKey === navigationKey) return saved
1728
1812
  const target = memoryLibraryTarget(address, current)
1729
- return { ...saved, navigationKey, ...(target.id ? {
1813
+ const navigationKey = `${address}/${tab.navigation?.revision || 0}/${target.sessionId}`
1814
+ if (saved.navigationKey === navigationKey) return saved
1815
+ return { ...saved, navigationKey, sessionId: target.sessionId,
1816
+ ...(!target.id && saved.sessionId && saved.sessionId !== target.sessionId && saved.scope !== 'global'
1817
+ ? { selected: null, query: '', topicFilter: '', top: 0, detailTop: 0 } : {}), ...(target.id ? {
1730
1818
  scope: target.scope, selected: { topic: target.topic, id: target.id }, detailTop: 0,
1731
1819
  ...(saved.scope && saved.scope !== target.scope ? { topicFilter: '', top: 0 } : {}),
1732
1820
  } : {}) }
@@ -1743,7 +1831,10 @@ function memoryLibraryWindow(items, query, top, height) {
1743
1831
 
1744
1832
  /** Drafts and in-flight operations survive the host unmounting a hidden tab. */
1745
1833
  function createMemoryEditor(saved, api) {
1746
- if (saved.editorStore) return saved.editorStore
1834
+ if (saved.editorStore) {
1835
+ saved.editorStore.bindApi(api)
1836
+ return saved.editorStore
1837
+ }
1747
1838
  let snapshot = { draft: null, confirmation: null, busy: false, error: '', refresh: 0 }
1748
1839
  const listeners = new Set()
1749
1840
  const update = patch => { snapshot = { ...snapshot, ...patch }; for (const listener of listeners) listener() }
@@ -1771,6 +1862,8 @@ function createMemoryEditor(saved, api) {
1771
1862
  }
1772
1863
  }
1773
1864
  saved.editorStore = { getSnapshot: () => snapshot, subscribe: listener => { listeners.add(listener); return () => listeners.delete(listener) },
1865
+ // The host may replace its Remote while the retained draft is still open.
1866
+ bindApi: value => { api = value },
1774
1867
  update, save: () => run('save', snapshot.draft), remove: () => run('remove', snapshot.confirmation) }
1775
1868
  return saved.editorStore
1776
1869
  }
@@ -1824,7 +1917,8 @@ function MemoryLibrary({ useTabInfo, useSessions, sessionId: scopeSessionId, api
1824
1917
  const target = memoryLibraryTarget(address, current)
1825
1918
  const saved = useMemo(() => {
1826
1919
  const value = memoryStates.get(tab.signal) || {}
1827
- Object.assign(value, memoryLibraryNavigation(value, tab, current))
1920
+ const editing = value.editorStore?.getSnapshot()
1921
+ if (!editing?.draft && !editing?.confirmation && !editing?.busy) Object.assign(value, memoryLibraryNavigation(value, tab, current))
1828
1922
  memoryStates.set(tab.signal, value)
1829
1923
  return value
1830
1924
  }, [memoryStates, tab.signal])
@@ -1846,10 +1940,11 @@ function MemoryLibrary({ useTabInfo, useSessions, sessionId: scopeSessionId, api
1846
1940
  if (next === saved) return
1847
1941
  Object.assign(saved, next)
1848
1942
  setScope(saved.scope || target.scope); setSelected(saved.selected || null)
1943
+ setQuery(saved.query || '')
1849
1944
  setTopicFilter(saved.topicFilter || '')
1850
1945
  setViewport(value => ({ ...value, top: saved.top || 0 }))
1851
1946
  if (detailBody.current) detailBody.current.scrollTop = 0
1852
- }, [saved, address, tab.navigation?.revision, editing.draft, editing.confirmation, editing.busy])
1947
+ }, [saved, address, current, tab.navigation?.revision, editing.draft, editing.confirmation, editing.busy])
1853
1948
  useLayoutEffect(() => {
1854
1949
  if (!editing.refresh) return
1855
1950
  setScope(saved.scope); setSelected(saved.selected); setRevision(value => value + 1)
@@ -1874,13 +1969,13 @@ function MemoryLibrary({ useTabInfo, useSessions, sessionId: scopeSessionId, api
1874
1969
  }, [api, tab.visible, sessionId, scope, selectionKey, revision])
1875
1970
  useLayoutEffect(() => {
1876
1971
  const element = list.current
1877
- if (!element) return
1972
+ if (!element || visibleState.loading) return
1878
1973
  element.scrollTop = saved.top || 0
1879
1974
  const resize = () => setViewport({ top: element.scrollTop, height: element.clientHeight || 600 })
1880
1975
  resize()
1881
1976
  const observer = new ResizeObserver(resize); observer.observe(element)
1882
1977
  return () => observer.disconnect()
1883
- }, [selected, key, tab.visible, Boolean(editing.draft)])
1978
+ }, [selected, key, tab.visible, Boolean(editing.draft), visibleState])
1884
1979
  useLayoutEffect(() => {
1885
1980
  if (detailBody.current) detailBody.current.scrollTop = saved.detailTop || 0
1886
1981
  }, [selectionKey, detail?.key, tab.visible, Boolean(editing.draft)])
@@ -1943,7 +2038,7 @@ function MemoryLibrary({ useTabInfo, useSessions, sessionId: scopeSessionId, api
1943
2038
  React.createElement('div', { className: 'dsh-super-code-memory-results' },
1944
2039
  React.createElement('div', { className: 'dsh-super-code-memory-list-heading' }, React.createElement('strong', null, topicFilter || text(t, 'memory.allTopics')), React.createElement('small', null, text(t, 'memory.count', { count: page.count }))),
1945
2040
  React.createElement('div', { ref: list, className: 'dsh-super-code-memory-list', role: 'list', 'aria-busy': visibleState.loading, onScroll: event => { saved.top = event.currentTarget.scrollTop; setViewport(value => ({ ...value, top: saved.top })) } },
1946
- visibleState.loading && !visibleState.error && React.createElement('p', { role: 'status', className: 'dsh-super-code-memory-empty' }, text(t, 'memory.loading')),
2041
+ visibleState.loading && !visibleState.error && !visibleState.items.length && React.createElement('p', { role: 'status', className: 'dsh-super-code-memory-empty' }, text(t, 'memory.loading')),
1947
2042
  visibleState.error && React.createElement('p', { role: 'alert' }, text(t, 'memory.error')),
1948
2043
  !visibleState.error && !visibleState.loading && !page.count && React.createElement('p', { className: 'dsh-super-code-memory-empty' }, text(t, query || topicFilter ? 'memory.noMatches' : 'memory.empty')),
1949
2044
  React.createElement('div', { 'aria-hidden': true, style: { height: page.before } }),
@@ -2006,7 +2101,7 @@ function AgentDetail({ useTabInfo, useSessions, useSessionStatus, sessionId, cre
2006
2101
  const input = totals ? (totals.uncachedInputTokens || 0) + (totals.cacheReadTokens || 0) + (totals.cacheWriteTokens || 0) : 0
2007
2102
  const format = value => value === undefined ? text(t, 'detail.unavailable') : value.toLocaleString(localeCode(t))
2008
2103
  const tasks = projections.superCodeTasks
2009
- const toolNames = new Map(snapshot.items.filter(item => item.toolName && item.callId).map(item => [item.callId, item.toolName]))
2104
+ const toolNames = new Map()
2010
2105
  const task = tasks?.current?.kind === 'task' ? tasks.current : undefined
2011
2106
  const title = node?.title || node?.displayTitle || text(t, 'detail.title')
2012
2107
  const metrics = [
@@ -2046,7 +2141,12 @@ function AgentDetail({ useTabInfo, useSessions, useSessionStatus, sessionId, cre
2046
2141
  snapshot.hasMore && React.createElement(ActionButton, { type: 'button', disabled: snapshot.status === 'paging', onClick: inspector.older }, snapshot.status === 'paging' ? text(t, 'detail.read') : text(t, 'detail.older')),
2047
2142
  (snapshot.earlier || snapshot.truncated) && React.createElement(ActionButton, { type: 'button', onClick: latest }, text(t, 'detail.latest')),
2048
2143
  snapshot.status === 'ready' && !snapshot.items.length && React.createElement('p', null, text(t, 'detail.empty')),
2049
- snapshot.items.map(record => React.createElement(AgentMessage, { key: record.seq, record, saved, t, toolName: toolNames.get(record.callId) }))),
2144
+ snapshot.items.map(record => {
2145
+ const data = record.entry?.event?.data
2146
+ const key = JSON.stringify([data?.turn, data?.step, record.callId])
2147
+ if (record.toolName && record.callId) toolNames.set(key, record.toolName)
2148
+ return React.createElement(AgentMessage, { key: record.seq, record, saved, t, toolName: toolNames.get(key) })
2149
+ })),
2050
2150
  unread && React.createElement(ActionButton, { type: 'button', className: 'dsh-super-code-new-content', onClick: () => {
2051
2151
  saved.following = true; log.current.scrollTop = log.current.scrollHeight; markUnread(false)
2052
2152
  } }, text(t, 'detail.new')))
@@ -2080,7 +2180,7 @@ const memoryRemoteContribution = {
2080
2180
 
2081
2181
  // Budget settings use the same public Remote transport as the preset settings.
2082
2182
  const budgetRemoteContribution = {
2083
- package: 'dsh-super-code', descriptors: ['readConfig', 'saveConfig', 'resetConfig'].map(method => ({
2183
+ package: 'dsh-super-code', descriptors: ['readConfig', 'saveConfig', 'resetConfig', 'openSkillsDirectory', 'syncSkills'].map(method => ({
2084
2184
  id: `dsh-super-code:superCodeBudgets/${method}`, service: 'superCodeBudgets', namespace: 'superCodeBudgets', method, invocation: { kind: 'direct' },
2085
2185
  parameters: (method === 'saveConfig' ? ['content', 'expected'] : method === 'resetConfig' ? ['expected'] : [])
2086
2186
  .map(name => ({ name, wire: name, source: 'json', codec: remoteStringCodec })), result: { mode: 'src-json' },
@@ -2095,6 +2195,11 @@ const connectionRemoteContribution = {
2095
2195
  })),
2096
2196
  }
2097
2197
 
2198
+ const skillGroups = [
2199
+ { id: 'individual', keys: ['grillMeSkill', 'openspecSkills', 'oilUiSkill'] },
2200
+ { id: 'workflows', keys: ['mattpocockSkills', 'pstackSkills'] },
2201
+ ]
2202
+ const skillPackageKeys = skillGroups.flatMap(group => group.keys)
2098
2203
  const budgetFields = [
2099
2204
  { key: 'thresholdRatio', group: 'context', factor: 0.01, min: 1, max: 100, step: 'any' },
2100
2205
  { key: 'retainRatio', group: 'context', factor: 0.01, min: 0, max: 100, step: 'any' },
@@ -2108,14 +2213,15 @@ const budgetFields = [
2108
2213
  ]
2109
2214
  function budgetDraft(configuration) {
2110
2215
  const deletion = configuration.deletionProtection
2111
- return Object.fromEntries([['windowsBash', configuration.windowsBash ?? true], ['windowsBashForOfficialPresets', configuration.windowsBashForOfficialPresets ?? false], ['deletionProtection', deletion === true ? 'strict' : deletion === false ? 'off' : deletion ?? 'relaxed'], ['deletionProtectionForOfficialPresets', configuration.deletionProtectionForOfficialPresets ?? false], ['applyToOfficialPresets', configuration.applyToOfficialPresets ?? false], ['pressureBasis', configuration.budgets?.pressureBasis ?? ''],
2216
+ return Object.fromEntries([...skillPackageKeys.map(key => [key, configuration[key] ?? false]), ['windowsBash', configuration.windowsBash ?? true], ['windowsBashForOfficialPresets', configuration.windowsBashForOfficialPresets ?? false], ['deletionProtection', deletion === true ? 'strict' : deletion === false ? 'off' : deletion ?? 'relaxed'], ['deletionProtectionForOfficialPresets', configuration.deletionProtectionForOfficialPresets ?? false], ['applyToOfficialPresets', configuration.applyToOfficialPresets ?? false], ['pressureBasis', configuration.budgets?.pressureBasis ?? ''],
2112
2217
  ...budgetFields.map(field => {
2113
2218
  const value = field.root ? configuration[field.key] : configuration.budgets?.[field.key]
2114
2219
  return [field.key, value === undefined ? '' : String(value / field.factor)]
2115
2220
  })])
2116
2221
  }
2117
- function budgetConfiguration(draft) {
2222
+ function budgetConfiguration(draft, previous = {}) {
2118
2223
  const config = {}, budgets = {}
2224
+ const before = budgetDraft(previous)
2119
2225
  if (draft.deletionProtection !== undefined) {
2120
2226
  if (!['off', 'relaxed', 'strict'].includes(draft.deletionProtection)) return { ok: false, error: 'invalid' }
2121
2227
  config.deletionProtection = draft.deletionProtection
@@ -2138,8 +2244,11 @@ function budgetConfiguration(draft) {
2138
2244
  const value = Number(input)
2139
2245
  if (!Number.isFinite(value) || value < field.min || (field.max !== undefined && value > field.max)) return { ok: false, error: 'invalid' }
2140
2246
  const scaled = value * field.factor
2141
- const selected = field.step === 'any' ? scaled : Math.round(scaled)
2142
- if (field.step !== 'any' && (Math.abs(selected - scaled) > 1e-7 || !Number.isSafeInteger(selected))) return { ok: false, error: 'invalid' }
2247
+ const stored = field.root ? previous[field.key] : previous.budgets?.[field.key]
2248
+ // Percent/seconds formatting must not change an untouched stored number.
2249
+ const unchanged = stored !== undefined && input === before[field.key]
2250
+ const selected = unchanged ? stored : field.step === 'any' ? scaled : Math.round(scaled)
2251
+ if (field.step !== 'any' && ((!unchanged && Math.abs(selected - scaled) > 1e-7) || !Number.isSafeInteger(selected))) return { ok: false, error: 'invalid' }
2143
2252
  ;(field.root ? config : budgets)[field.key] = selected
2144
2253
  }
2145
2254
  if ((budgets.retainRatio ?? 0.16) >= (budgets.thresholdRatio ?? 0.8)) return { ok: false, error: 'retain' }
@@ -2193,20 +2302,152 @@ function ChoiceCards({ name, label, value, choices, onChange, disabled = false }
2193
2302
 
2194
2303
  /** Each budget tab writes only its own fields and carries the other tab's stored values through. */
2195
2304
  function budgetSectionConfiguration(section, draft, snapshot) {
2305
+ if (section === 'skills') return skillPackageKeys.every(key => typeof draft[key] === 'boolean')
2306
+ ? { ok: true, configuration: { ...snapshot.configuration, ...Object.fromEntries(skillPackageKeys.map(key => [key, draft[key]])) } }
2307
+ : { ok: false, error: 'invalid' }
2196
2308
  if (section === 'shell') return typeof draft.windowsBash === 'boolean' && typeof draft.windowsBashForOfficialPresets === 'boolean'
2197
2309
  ? { ok: true, configuration: { ...snapshot.configuration, windowsBash: draft.windowsBash, windowsBashForOfficialPresets: draft.windowsBashForOfficialPresets } }
2198
2310
  : { ok: false, error: 'invalid' }
2199
- const parsed = budgetConfiguration(draft)
2311
+ const parsed = budgetConfiguration(draft, snapshot.configuration)
2200
2312
  if (!parsed.ok) return parsed
2201
2313
  const current = snapshot.configuration
2202
2314
  return { ok: true, configuration: section === 'protection'
2203
2315
  ? { ...current, deletionProtection: draft.deletionProtection, deletionProtectionForOfficialPresets: draft.deletionProtectionForOfficialPresets }
2204
- : { ...parsed.configuration, windowsBash: current.windowsBash, windowsBashForOfficialPresets: current.windowsBashForOfficialPresets, deletionProtection: current.deletionProtection, deletionProtectionForOfficialPresets: current.deletionProtectionForOfficialPresets } }
2316
+ : { ...parsed.configuration, ...Object.fromEntries(skillPackageKeys.map(key => [key, current[key]])), windowsBash: current.windowsBash, windowsBashForOfficialPresets: current.windowsBashForOfficialPresets, deletionProtection: current.deletionProtection, deletionProtectionForOfficialPresets: current.deletionProtectionForOfficialPresets } }
2205
2317
  }
2206
2318
  function createBudgetAutosave(api, section = 'context') {
2207
2319
  return createAutosave(api, { draft: budgetDraft({}), toDraft: budgetDraft,
2208
2320
  toConfiguration: (draft, snapshot) => budgetSectionConfiguration(section, draft, snapshot) })
2209
2321
  }
2322
+
2323
+ /** All budget tabs edit one document; finish local writes before another tab reads it. */
2324
+ function createBudgetEditors(api) {
2325
+ return { ...createSettingsEditors(api, Object.fromEntries(['context', 'shell', 'protection', 'skills']
2326
+ .map(section => [section, source => createBudgetAutosave(source, section)]))),
2327
+ openSkillsDirectory: () => api.openSkillsDirectory(), syncSkills: () => api.syncSkills() }
2328
+ }
2329
+
2330
+ /** Recreate only the native Skill UI cache; Agent and input lifetimes stay owned by DSH. */
2331
+ async function refreshNativeSkillMenus(ctx, plugin, signal) {
2332
+ for (const fiber of [...ctx.registry.get(plugin)?.fibers ?? []]) {
2333
+ if (signal.aborted) return
2334
+ await fiber.restart()
2335
+ }
2336
+ if (signal.aborted) return
2337
+ for (const id of Object.keys(ctx.sessions.list.getSnapshot().byId)) {
2338
+ const scope = ctx.sessions.scope(id)
2339
+ if (scope) ctx.inputTriggers.sessionOf(scope).refreshOpenMenu()
2340
+ }
2341
+ }
2342
+
2343
+ /** Observe accepted host settings, including writes from other connected clients. */
2344
+ function synchronizeSkillMenus(ctx, api, plugin, onError) {
2345
+ const lifetime = new AbortController()
2346
+ let namespace, applied = '', dirty = false, running = false
2347
+ const refresh = ns => {
2348
+ if (lifetime.signal.aborted || (ns && namespace && ns !== namespace)) return
2349
+ dirty = true
2350
+ if (running) return
2351
+ running = true
2352
+ void (async () => {
2353
+ while (dirty && !lifetime.signal.aborted) {
2354
+ dirty = false
2355
+ const response = await api.readConfig()
2356
+ if (lifetime.signal.aborted) return
2357
+ if (!response.ok) throw new Error('Skill settings could not be read')
2358
+ if (dirty) continue
2359
+ namespace = response.value.namespace
2360
+ const draft = budgetDraft(response.value.configuration)
2361
+ const next = JSON.stringify(skillPackageKeys.map(key => draft[key]))
2362
+ if (next !== applied) {
2363
+ await refreshNativeSkillMenus(ctx, plugin, lifetime.signal)
2364
+ if (lifetime.signal.aborted) return
2365
+ applied = next
2366
+ }
2367
+ }
2368
+ })().catch(error => { if (!lifetime.signal.aborted) onError(error) })
2369
+ .finally(() => { running = false; if (dirty && !lifetime.signal.aborted) refresh() })
2370
+ }
2371
+ const off = ctx.remote.$on('settings/document-updated', refresh)
2372
+ const offReset = ctx.on('connection/reset', () => { namespace = undefined; refresh() })
2373
+ refresh()
2374
+ return () => { lifetime.abort(); off(); offReset() }
2375
+ }
2376
+
2377
+ // 只补充包名搜索;真实命令、覆盖优先级和加载仍由宿主负责。
2378
+ function skillPackageSource(ctx) {
2379
+ const packages = [
2380
+ { name: 'grill-me', label: 'grill-me', directory: 'mattpocock/skills/', names: ['grill-me', 'grilling'] },
2381
+ { name: 'openspec', label: 'OpenSpec', directory: 'openspec/skills/' },
2382
+ { name: 'oil-ui', label: 'oil-ui', directory: '', names: ['oil-ui'] },
2383
+ { name: 'mattpocock', label: 'Matt Pocock Skills', directory: 'mattpocock/skills/' },
2384
+ { name: 'pstack', label: 'PStack', directory: 'pstack/dsh/skills/' },
2385
+ ]
2386
+ return {
2387
+ trigger: '/', name: 'Super Code', order: 3,
2388
+ async candidates(session, { query, signal }) {
2389
+ if (!query || signal.aborted || ctx.sessions.subagentAddress(session.sessionId) !== undefined) return []
2390
+ const matching = icons.rankByName(packages, query)
2391
+ if (!matching.length) return []
2392
+ const response = await ctx.remote.skills.list({ sessionId: session.sessionId }, signal)
2393
+ if (signal.aborted) return []
2394
+ if (!response.ok) throw new Error('Skill catalog could not be read')
2395
+ const skills = response.value.skills
2396
+ const native = new Set(icons.rankByName(skills, query).map(skill => skill.name))
2397
+ return skills.flatMap(skill => {
2398
+ if (native.has(skill.name)) return []
2399
+ const relative = skill.path?.replaceAll('\\', '/').match(/(?:^|\/)(?:skills\/dsh-super-code|builtin\/skills)\/(.+)$/i)?.[1]
2400
+ const pack = matching.find(pack => relative === `${pack.directory}${skill.name}/SKILL.md`
2401
+ && (!pack.names || pack.names.includes(skill.name)))
2402
+ return pack ? [{ name: skill.name, description: skill.description, section: pack.label }] : []
2403
+ })
2404
+ },
2405
+ onPick({ candidate }) { return { text: `/${candidate.name} ` } },
2406
+ }
2407
+ }
2408
+
2409
+ function settingsRevision(snapshot) {
2410
+ return snapshot.generation ? `${snapshot.revision}:${snapshot.generation}` : String(snapshot.revision)
2411
+ }
2412
+ function createSettingsEditors(api, factories) {
2413
+ let writing = Promise.resolve(), saved, saveCount = 0, readCount = 0, latestRead
2414
+ const saveConfig = (content, expected) => {
2415
+ const result = api.saveConfig(content, expected).then(response => {
2416
+ if (response.ok && response.value.ok) {
2417
+ saved = response.value.snapshot; saveCount++
2418
+ // Carry local, disjoint edits forward without rebasing an external conflict.
2419
+ for (const editor of Object.values(editors)) {
2420
+ const previous = editor.getSnapshot().snapshot
2421
+ if (previous && settingsRevision(previous) === expected) editor.revision(saved)
2422
+ }
2423
+ }
2424
+ return response
2425
+ })
2426
+ writing = Promise.allSettled([writing, result]).then(() => {})
2427
+ return result
2428
+ }
2429
+ const editors = Object.fromEntries(Object.entries(factories)
2430
+ .map(([section, create]) => [section, create({ saveConfig })]))
2431
+ const flush = async () => {
2432
+ await Promise.all(Object.values(editors).map(editor => editor.flush()))
2433
+ await writing
2434
+ }
2435
+ return { editors, saveConfig, readConfig: async () => {
2436
+ const sequence = ++readCount
2437
+ await flush()
2438
+ const before = saveCount, response = await api.readConfig()
2439
+ await flush()
2440
+ if (!response.ok) return response
2441
+ // A newer read may already belong to a restarted service. Never let an
2442
+ // older request bring the previous instance back into a form.
2443
+ if (!latestRead || sequence > latestRead.sequence) latestRead = { sequence, snapshot: response.value }
2444
+ const snapshot = latestRead.snapshot
2445
+ // A read already in flight must not undo a newer local save. A fresh read
2446
+ // still accepts a lower revision after the host restarts its settings service.
2447
+ return { ...response, value: saveCount !== before && saved.generation === snapshot.generation && saved.revision > snapshot.revision
2448
+ ? saved : snapshot }
2449
+ } }
2450
+ }
2210
2451
  function budgetFieldValid(field, input) {
2211
2452
  const value = String(input ?? '').trim()
2212
2453
  if (!value) return true
@@ -2222,42 +2463,56 @@ function autosaveState(editing) {
2222
2463
  : editing.error ? 'error' : editing.notice === 'saved' ? 'saved' : 'idle'
2223
2464
  }
2224
2465
 
2225
- function BudgetSettings({ api, t, active, section = 'context', onSaved = () => {} }) {
2466
+ function BudgetSettings({ api, t, active, section = 'context', presetStatus, onSaved = () => {} }) {
2226
2467
  const protection = section === 'protection'
2227
- const shell = section === 'shell'
2228
- const editor = useMemo(() => createBudgetAutosave(api, section), [api, section])
2468
+ const shell = section === 'shell', skills = section === 'skills'
2469
+ const editor = api.editors[section]
2229
2470
  const editing = useSyncExternalStore(editor.subscribe, editor.getSnapshot, editor.getSnapshot)
2230
2471
  const { snapshot, draft } = editing
2231
2472
  const [loading, setLoading] = useState(false), [failure, setFailure] = useState(''), [notice, setNotice] = useState('')
2232
2473
  const [confirmReset, setConfirmReset] = useState(false)
2474
+ const [openingSkills, setOpeningSkills] = useState(false), [directoryError, setDirectoryError] = useState(false)
2475
+ const openSkills = async () => {
2476
+ if (openingSkills) return
2477
+ setOpeningSkills(true); setDirectoryError(false)
2478
+ try {
2479
+ const result = await api.openSkillsDirectory()
2480
+ if (!result.ok || !result.value?.opened) throw new Error('Open failed')
2481
+ } catch { if (alive.current) setDirectoryError(true) }
2482
+ finally { if (alive.current) setOpeningSkills(false) }
2483
+ }
2233
2484
  const alive = useRef(false), pending = useRef(false)
2234
2485
  const load = async (discard = false) => {
2235
- if (pending.current || (!discard && editor.hasChanges())) return
2486
+ if (pending.current) return
2236
2487
  pending.current = true; setLoading(true); setFailure('')
2237
2488
  try {
2238
2489
  const response = await api.readConfig()
2239
2490
  if (!response.ok) throw new Error('Remote unavailable')
2240
- if (alive.current) editor.receive(response.value)
2491
+ if (alive.current) {
2492
+ if (discard || !editor.hasChanges()) editor.receive(response.value)
2493
+ else editor.permissions(response.value.writable)
2494
+ }
2241
2495
  } catch { if (alive.current) setFailure('connection') }
2242
2496
  finally { pending.current = false; if (alive.current) setLoading(false) }
2243
2497
  }
2244
2498
  useEffect(() => { alive.current = true; return () => { alive.current = false; void editor.flush() } }, [editor])
2245
2499
  useEffect(() => { if (editing.saveCount) onSaved() }, [editing.saveCount])
2246
2500
  // Other tabs write the same document, so reread on every visit; leaving flushes pending input.
2247
- useEffect(() => { if (active) load(); else { setConfirmReset(false); void editor.flush() } }, [editor, active])
2501
+ useLayoutEffect(() => { if (active) load(); else { setConfirmReset(false); void editor.flush() } }, [editor, active])
2248
2502
  const reset = async () => {
2249
2503
  setConfirmReset(false)
2250
2504
  if (pending.current) return
2251
- await editor.flush()
2252
- const current = editor.getSnapshot().snapshot
2253
- if (!alive.current || !current?.writable) return
2254
- const base = current.configuration
2255
- const configuration = protection
2256
- ? { ...base, deletionProtection: 'relaxed', deletionProtectionForOfficialPresets: false }
2257
- : { windowsBash: base.windowsBash, windowsBashForOfficialPresets: base.windowsBashForOfficialPresets, deletionProtection: base.deletionProtection, deletionProtectionForOfficialPresets: base.deletionProtectionForOfficialPresets }
2505
+ // Claim the whole operation, including the wait for an earlier autosave.
2258
2506
  pending.current = true; setLoading(true); setFailure(''); setNotice('')
2259
2507
  try {
2260
- const response = await api.saveConfig(JSON.stringify(configuration), String(current.revision))
2508
+ await editor.flush()
2509
+ const current = editor.getSnapshot().snapshot
2510
+ if (!alive.current || !current?.writable) return
2511
+ const base = current.configuration
2512
+ const configuration = protection
2513
+ ? { ...base, deletionProtection: 'relaxed', deletionProtectionForOfficialPresets: false }
2514
+ : { ...Object.fromEntries(skillPackageKeys.map(key => [key, base[key]])), windowsBash: base.windowsBash, windowsBashForOfficialPresets: base.windowsBashForOfficialPresets, deletionProtection: base.deletionProtection, deletionProtectionForOfficialPresets: base.deletionProtectionForOfficialPresets }
2515
+ const response = await api.saveConfig(JSON.stringify(configuration), settingsRevision(current))
2261
2516
  if (!response.ok) throw new Error('Remote unavailable')
2262
2517
  if (!alive.current) return
2263
2518
  if (response.value.ok) { editor.receive(response.value.snapshot); onSaved(); setNotice('resetDone') }
@@ -2267,8 +2522,9 @@ function BudgetSettings({ api, t, active, section = 'context', onSaved = () => {
2267
2522
  }
2268
2523
  const disabled = loading || !snapshot?.writable
2269
2524
  const edit = (key, value, delay = 0) => { setNotice(''); setFailure(''); editor.change({ [key]: value }, delay) }
2270
- const parsed = budgetConfiguration(draft)
2271
- const fieldError = field => !budgetFieldValid(field, draft[field.key]) ? t('budget.error.range')
2525
+ const parsed = budgetConfiguration(draft, snapshot?.configuration)
2526
+ const storedDraft = budgetDraft(snapshot?.configuration ?? {})
2527
+ const fieldError = field => draft[field.key] !== storedDraft[field.key] && !budgetFieldValid(field, draft[field.key]) ? t('budget.error.range')
2272
2528
  : field.key === 'retainRatio' && parsed.error === 'retain' ? t('budget.error.retain')
2273
2529
  : field.key === 'ptcTimeoutMs' && parsed.error === 'ptc-order' ? t('budget.error.ptc-order') : ''
2274
2530
  const defaultOf = field => {
@@ -2292,7 +2548,24 @@ function BudgetSettings({ api, t, active, section = 'context', onSaved = () => {
2292
2548
  const shellStatus = snapshot?.shell
2293
2549
  const windowsHost = shellStatus?.platform === 'win32'
2294
2550
  const shellTooltip = shellStatus && !windowsHost ? t('shell.windowsOnly') : undefined
2295
- const content = shell ? React.createElement(SettingsSection, { id: 'super-code-shell', title: t('shell.title') },
2551
+ const content = skills ? React.createElement(React.Fragment, null,
2552
+ React.createElement('div', { className: 'dsh-super-code-settings-footer-actions' },
2553
+ button(t('skills.openDirectory'), openSkills, { disabled: openingSkills || !snapshot?.skills?.canOpen, title: snapshot?.skills?.canOpen ? t('skills.openDirectory') : t('skills.directoryUnavailable') })),
2554
+ directoryError && React.createElement(Callout, { tone: 'error' }, React.createElement('p', null, t('skills.openFailed'))),
2555
+ snapshot?.skills?.state === 'error' && React.createElement(Callout, { tone: 'warning', action: button(t('skills.retry'), async () => {
2556
+ try { await editor.flush(); const result = await api.syncSkills(); if (!result.ok) throw new Error('Sync failed'); if (alive.current) await load() }
2557
+ catch { if (alive.current) setDirectoryError(true) }
2558
+ }) }, React.createElement('p', null, t('skills.directoryError'))),
2559
+ ...skillGroups.map((group, index) => React.createElement(SettingsSection, { key: group.id, id: `super-code-skills-${group.id}`, title: t(`skills.${group.id}`), description: index === 0 ? t('skills.scope') : undefined },
2560
+ ...group.keys.map(key => React.createElement(SettingRow, { key, id: `super-code-skill-${key}`,
2561
+ label: React.createElement(React.Fragment, null, t(`skills.${key}`), snapshot?.skillPackages?.[key]?.version &&
2562
+ React.createElement('span', { className: 'dsh-super-code-skill-version' }, `v${snapshot.skillPackages[key].version}`)), hint: t(`skills.${key}Hint`) }, described =>
2563
+ React.createElement(ConnectionSwitch, { id: `super-code-skill-${key}`, checked: draft[key], disabled, 'aria-describedby': described, onChange: value => edit(key, value) }))))),
2564
+ !snapshot?.skills && presetStatus && !presetStatus.skillPacks && React.createElement(Callout, { tone: 'warning' }, React.createElement('p', null, t(presetStatus.state === 'missing' ? 'skills.missing' : 'skills.upgrade'))),
2565
+ React.createElement('div', { className: 'dsh-super-code-settings-guidance' },
2566
+ ...['commands', 'openspecRequirement', 'pstackRequirement'].map(key =>
2567
+ React.createElement('p', { key }, t(`skills.${key}`)))))
2568
+ : shell ? React.createElement(SettingsSection, { id: 'super-code-shell', title: t('shell.title') },
2296
2569
  React.createElement(SettingRow, { id: 'super-code-windows-bash', label: t('shell.enabled'),
2297
2570
  hint: !windowsHost ? t('shell.otherPlatform') : t('shell.hint') }, described =>
2298
2571
  React.createElement(ConnectionSwitch, { id: 'super-code-windows-bash', checked: draft.windowsBash,
@@ -2335,18 +2608,18 @@ function BudgetSettings({ api, t, active, section = 'context', onSaved = () => {
2335
2608
  snapshot?.ptcMaxTimeoutMs && text(t, 'budget.ptcCeiling', { seconds: snapshot.ptcMaxTimeoutMs / 1000 })] }, ...rows('execution')),
2336
2609
  React.createElement(SettingsSection, { id: 'super-code-budget-exclusive', title: t('budget.superCode'), description: t('budget.superCodeHint') }, ...rows('superCode')))
2337
2610
  return React.createElement('section', { className: 'dsh-super-code-budgets' },
2338
- React.createElement('form', { className: 'dsh-super-code-stack', 'aria-label': t(shell ? 'shell.title' : protection ? 'delete.title' : 'budget.title'), 'aria-busy': loading || editing.saving,
2611
+ React.createElement('form', { className: 'dsh-super-code-stack', 'aria-label': t(skills ? 'skills.title' : shell ? 'shell.title' : protection ? 'delete.title' : 'budget.title'), 'aria-busy': loading || editing.saving,
2339
2612
  onSubmit: event => { event.preventDefault(); void editor.flush() } },
2340
2613
  problem && React.createElement(Callout, { tone: 'error',
2341
2614
  action: failure === 'connection' || problem === 'conflict' ? button(t('budget.reload'), () => load(true))
2342
- : saveError ? button(t('save.retry'), () => { void editor.retry() }) : null },
2615
+ : saveError ? button(t('save.retry'), () => { void editor.retry() }, { disabled }) : null },
2343
2616
  React.createElement('p', null, t(`budget.error.${problem}`))),
2344
2617
  snapshot && !snapshot.writable && React.createElement(Callout, { tone: 'warning' }, React.createElement('p', null, t('budget.error.read-only'))),
2345
2618
  notice && React.createElement(Callout, { tone: 'success' }, React.createElement('p', null, t(`budget.${notice}`))),
2346
2619
  content,
2347
2620
  React.createElement('div', { className: 'dsh-super-code-settings-footer' },
2348
2621
  React.createElement(SaveIndicator, { state: autosaveState(editing), t }),
2349
- !shell && React.createElement('div', { className: 'dsh-super-code-settings-footer-actions' },
2622
+ !shell && !skills && React.createElement('div', { className: 'dsh-super-code-settings-footer-actions' },
2350
2623
  confirmReset ? React.createElement(React.Fragment, null,
2351
2624
  React.createElement('span', null, t('budget.resetQuestion')),
2352
2625
  button(t('preset.cancel'), () => setConfirmReset(false)),
@@ -2383,7 +2656,7 @@ function synchronizePresetDisplay(api, locale, reload, onError, preferenceScope)
2383
2656
  last = language
2384
2657
  needsReload ||= result.value.changed
2385
2658
  }
2386
- if (!disposed && settled && needsReload && pending === last) reload()
2659
+ if (!disposed && settled && needsReload && pending === last) { reload(); needsReload = false }
2387
2660
  } catch (error) { if (!disposed) onError(error) }
2388
2661
  finally { running = false }
2389
2662
  })()
@@ -2423,7 +2696,7 @@ function createAutosave(api, { draft: initialDraft, toDraft, toConfiguration })
2423
2696
  while (acknowledged < version) {
2424
2697
  const sent = version, parsed = toConfiguration(state.draft, state.snapshot)
2425
2698
  if (!parsed.ok) { blocked = version; update({ error: parsed.error || 'invalid' }); break }
2426
- const result = await api.saveConfig(JSON.stringify(parsed.configuration), String(state.snapshot.revision))
2699
+ const result = await api.saveConfig(JSON.stringify(parsed.configuration), settingsRevision(state.snapshot))
2427
2700
  if (!result.ok) throw new Error('Remote unavailable')
2428
2701
  if (!result.value.ok) { blocked = version; update({ error: result.value.error }); break }
2429
2702
  acknowledged = sent
@@ -2443,7 +2716,18 @@ function createAutosave(api, { draft: initialDraft, toDraft, toConfiguration })
2443
2716
  acknowledged = ++version
2444
2717
  update({ snapshot, draft, error: '', notice: '' })
2445
2718
  },
2446
- revision: snapshot => update({ snapshot }),
2719
+ permissions: writable => {
2720
+ // Keep the draft and its CAS baseline while reflecting current host permissions.
2721
+ if (state.snapshot && state.snapshot.writable !== writable) update({ snapshot: { ...state.snapshot, writable } })
2722
+ },
2723
+ revision: snapshot => {
2724
+ const previous = state.snapshot ? toDraft(state.snapshot.configuration) : initialDraft
2725
+ const next = toDraft(snapshot.configuration)
2726
+ // A local save may change an untouched field in this page (for example
2727
+ // the Home switch). Carry it forward while preserving actual edits.
2728
+ update({ snapshot, draft: Object.fromEntries(Object.entries(next).map(([key, value]) =>
2729
+ [key, JSON.stringify(state.draft[key]) === JSON.stringify(previous[key]) ? value : state.draft[key]])) })
2730
+ },
2447
2731
  change: (patch, delay = 0) => {
2448
2732
  version++
2449
2733
  update({ draft: { ...state.draft, ...patch }, error: '', notice: '' })
@@ -2505,22 +2789,27 @@ function connectionSessions(overview) {
2505
2789
  }
2506
2790
  function ConnectionActivity({ api, t, active, openSession }) {
2507
2791
  const [overview, setOverview] = useState(null), [busy, setBusy] = useState(false), [error, setError] = useState(false)
2508
- const alive = useRef(false), pending = useRef(false)
2509
- const load = async () => {
2510
- if (pending.current) return
2511
- pending.current = true
2512
- try { const result = await api.overview(); if (!result.ok) throw new Error(); if (alive.current) { setOverview(result.value); setError(false) } }
2513
- catch { if (alive.current) setError(true) }
2514
- finally { pending.current = false }
2792
+ const alive = useRef(false), pending = useRef(false), disconnecting = useRef(false)
2793
+ const load = () => {
2794
+ if (pending.current || disconnecting.current) return pending.current
2795
+ pending.current = (async () => {
2796
+ try { const result = await api.overview(); if (!result.ok) throw new Error(); if (alive.current) { setOverview(result.value); setError(false) } }
2797
+ catch { if (alive.current) setError(true) }
2798
+ })().finally(() => { pending.current = false })
2799
+ return pending.current
2515
2800
  }
2516
2801
  useEffect(() => { alive.current = true; return () => { alive.current = false } }, [api])
2517
2802
  useEffect(() => { if (!active) return; load(); const timer = setInterval(load, 2000); return () => clearInterval(timer) }, [active, api])
2518
2803
  const disconnect = async id => {
2519
- if (pending.current) return
2520
- pending.current = true; setBusy(true)
2521
- try { const result = await api.disconnectClient(id); if (!result.ok) throw new Error() }
2804
+ if (disconnecting.current) return
2805
+ disconnecting.current = true; setBusy(true)
2806
+ try {
2807
+ await pending.current
2808
+ if (!alive.current) return
2809
+ const result = await api.disconnectClient(id); if (!result.ok) throw new Error()
2810
+ }
2522
2811
  catch { if (alive.current) setError(true); return }
2523
- finally { pending.current = false; if (alive.current) setBusy(false) }
2812
+ finally { disconnecting.current = false; if (alive.current) setBusy(false) }
2524
2813
  if (alive.current) load()
2525
2814
  }
2526
2815
  const groups = overview ? connectionSessions(overview) : { connected: [], history: [] }
@@ -2539,11 +2828,11 @@ function ConnectionActivity({ api, t, active, openSession }) {
2539
2828
  error && React.createElement('p', { role: 'alert' }, t('home.error')))
2540
2829
  }
2541
2830
 
2542
- function ConnectionSettings({ api, t, active, openSession, onSaved = () => {} }) {
2543
- const editor = useMemo(() => createConnectionAutosave(api), [api])
2831
+ function ConnectionSettings({ api, settings, t, active, openSession, onSaved = () => {} }) {
2832
+ const editor = settings.editors.connection
2544
2833
  const editing = useSyncExternalStore(editor.subscribe, editor.getSnapshot, editor.getSnapshot)
2545
2834
  const { snapshot, draft, saving } = editing
2546
- const [catalog, setCatalog] = useState({ items: [], picker: 'unavailable' }), [custom, setCustom] = useState([]), [browser, setBrowser] = useState(false)
2835
+ const [catalog, setCatalog] = useState({ items: [], picker: 'unavailable' }), [browser, setBrowser] = useState(false)
2547
2836
  const [busy, setBusy] = useState(false), [error, setError] = useState(''), [notice, setNotice] = useState(''), [token, setToken] = useState('')
2548
2837
  const alive = useRef(false), pending = useRef(false), visible = useRef(active)
2549
2838
  visible.current = active
@@ -2557,30 +2846,39 @@ function ConnectionSettings({ api, t, active, openSession, onSaved = () => {} })
2557
2846
  if (pending.current || (discard && editor.getSnapshot().saving)) return
2558
2847
  pending.current = true; setBusy(true); setError('')
2559
2848
  try {
2560
- const [config, directories, credential] = await Promise.all([api.readConfig(), api.directories(), api.revealToken()])
2561
- if (!config.ok || !directories.ok || !credential.ok) throw new Error()
2849
+ const [config, directories, credential] = await Promise.all([
2850
+ settings.readConfig(), api.directories().catch(() => ({ ok: false })), api.revealToken().catch(() => ({ ok: false })),
2851
+ ])
2852
+ if (!config.ok) throw new Error()
2562
2853
  if (!alive.current) return
2563
- setCatalog(directories.value)
2564
- if (discard || !dirty) receive(config.value, directories.value)
2565
- if (visible.current) setToken(credential.value.token)
2854
+ if (directories.ok) setCatalog(directories.value)
2855
+ else setError('unavailable')
2856
+ if (discard || !editor.hasChanges()) receive(config.value, directories.ok ? directories.value : catalog)
2857
+ else editor.permissions(config.value.writable)
2858
+ if (visible.current) {
2859
+ setToken(credential.ok ? credential.value.token : '')
2860
+ if (!credential.ok && config.value.url) setError('unavailable')
2861
+ }
2566
2862
  } catch { if (alive.current) setError('unavailable') }
2567
2863
  finally { pending.current = false; if (alive.current) setBusy(false) }
2568
2864
  }
2569
2865
  const action = async kind => {
2570
2866
  if (pending.current) return
2571
2867
  pending.current = true; setBusy(true); setError(''); setNotice('')
2868
+ if (kind === 'rotate') setToken('')
2572
2869
  try {
2573
2870
  const response = kind === 'rotate' ? await api.rotateToken(String(snapshot.revision)) : await api.revealToken()
2574
2871
  if (!response.ok) throw new Error()
2575
2872
  if (!alive.current) return
2576
2873
  if (kind === 'token') { if (visible.current) setToken(response.value.token) }
2577
2874
  else if (response.value.ok) {
2578
- if (kind === 'rotate') {
2579
- editor.revision(response.value.snapshot)
2580
- const credential = await api.revealToken()
2581
- if (credential.ok && alive.current && visible.current) setToken(credential.value.token)
2582
- } else receive(response.value.snapshot)
2583
- onSaved(); setNotice(kind === 'rotate' ? 'rotated' : 'saved')
2875
+ editor.revision(response.value.snapshot)
2876
+ onSaved()
2877
+ const credential = await api.revealToken()
2878
+ if (!credential.ok) throw new Error()
2879
+ if (!alive.current) return
2880
+ if (visible.current) setToken(credential.value.token)
2881
+ setNotice('rotated')
2584
2882
  } else setError(response.value.error)
2585
2883
  } catch { if (alive.current) setError('unavailable') }
2586
2884
  finally { pending.current = false; if (alive.current) setBusy(false) }
@@ -2603,7 +2901,7 @@ function ConnectionSettings({ api, t, active, openSession, onSaved = () => {} })
2603
2901
  const edit = (key, value) => change({ [key]: value }, ['port', 'maxConnections'].includes(key) ? 350 : 0)
2604
2902
  const choose = path => {
2605
2903
  if (!draft.allowedDirectories.includes(path) && draft.allowedDirectories.length >= 32) { setError('directory-limit'); return }
2606
- setCustom(rows => [...new Set([...rows, path])]); change({ allowedDirectories: [...new Set([...draft.allowedDirectories, path])], knownDirectories: [...new Set([...draft.knownDirectories, path])].slice(-128) }); setNotice(''); setError(''); setBrowser(false)
2904
+ change({ allowedDirectories: [...new Set([...draft.allowedDirectories, path])], knownDirectories: [...new Set([...draft.knownDirectories, path])].slice(-128) }); setNotice(''); setError(''); setBrowser(false)
2607
2905
  }
2608
2906
  const addDirectory = async () => {
2609
2907
  if (pending.current) return
@@ -2617,7 +2915,7 @@ function ConnectionSettings({ api, t, active, openSession, onSaved = () => {} })
2617
2915
  finally { pending.current = false; if (alive.current) setBusy(false) }
2618
2916
  }
2619
2917
  const rows = [...catalog.items]
2620
- for (const path of [...custom, ...draft.knownDirectories, ...draft.allowedDirectories]) if (!rows.some(row => row.path === path)) rows.push({ path, title: '', available: true, workspace: false })
2918
+ for (const path of [...draft.knownDirectories, ...draft.allowedDirectories]) if (!rows.some(row => row.path === path)) rows.push({ path, title: '', available: true, workspace: false })
2621
2919
  const copy = async value => {
2622
2920
  try { await navigator.clipboard.writeText(value); if (alive.current) { setNotice('copied'); setError('') } }
2623
2921
  catch { if (alive.current) setError('clipboard') }
@@ -2628,7 +2926,10 @@ function ConnectionSettings({ api, t, active, openSession, onSaved = () => {} })
2628
2926
  React.createElement('p', { className: 'dsh-super-code-preset-status', role: 'status', 'data-available': snapshot?.state === 'listening' },
2629
2927
  React.createElement('i', { 'aria-hidden': true }), t(`connection.state.${snapshot?.state || 'loading'}`)),
2630
2928
  React.createElement('div', { className: 'dsh-super-code-settings-actions' }, React.createElement(ActionButton, { type: 'button', disabled: busy, onClick: () => load(true) }, t('connection.reload')))),
2631
- snapshot?.error && React.createElement('p', { role: 'alert' }, t(`connection.error.${snapshot.error}`)),
2929
+ snapshot?.error && React.createElement('div', { className: 'dsh-super-code-settings-actions' },
2930
+ React.createElement('p', { role: 'alert' }, t(`connection.error.${snapshot.error}`)),
2931
+ snapshot.state === 'error' && React.createElement(ActionButton, { type: 'button', disabled: disabled || dirty,
2932
+ onClick: () => { if (!disabled && !editor.hasChanges()) change({}) } }, t('save.retry'))),
2632
2933
  React.createElement(ConnectionActivity, { api, t, active, openSession }),
2633
2934
  React.createElement('form', { 'aria-label': t('connection.title'), 'aria-busy': saving, onSubmit: event => { event.preventDefault(); void editor.flush() } },
2634
2935
  React.createElement(ConnectionSwitch, { checked: draft.enabled, disabled, onChange: value => edit('enabled', value) }, t('connection.enabled')),
@@ -2655,7 +2956,7 @@ function ConnectionSettings({ api, t, active, openSession, onSaved = () => {} })
2655
2956
  React.createElement('span', null, row.title && React.createElement('strong', null, row.title), React.createElement('code', null, row.path),
2656
2957
  React.createElement('small', { 'data-unavailable': !row.available }, t(!row.available ? 'connection.directoryUnavailable' : row.workspace ? 'connection.workspaceDirectory' : 'connection.customDirectory')))),
2657
2958
  !row.workspace && React.createElement(ActionButton, { type: 'button', disabled, 'aria-label': `${t('connection.removeDirectory')}: ${row.path}`,
2658
- onClick: () => { setCustom(values => values.filter(path => path !== row.path)); setCatalog(value => ({ ...value, items: value.items.filter(item => item.path !== row.path) })); change({ knownDirectories: draft.knownDirectories.filter(path => path !== row.path), allowedDirectories: draft.allowedDirectories.filter(path => path !== row.path) }) } }, t('preset.remove')))),
2959
+ onClick: () => { setCatalog(value => ({ ...value, items: value.items.filter(item => item.path !== row.path) })); change({ knownDirectories: draft.knownDirectories.filter(path => path !== row.path), allowedDirectories: draft.allowedDirectories.filter(path => path !== row.path) }) } }, t('preset.remove')))),
2659
2960
  !rows.length && React.createElement('p', null, t('connection.noDirectories'))),
2660
2961
  React.createElement('div', { className: 'dsh-super-code-settings-actions' },
2661
2962
  React.createElement(ActionButton, { type: 'button', disabled: disabled || catalog.picker === 'unavailable', onClick: addDirectory }, t('connection.addDirectory'))),
@@ -2672,7 +2973,10 @@ function ConnectionSettings({ api, t, active, openSession, onSaved = () => {} })
2672
2973
  active && token && React.createElement('input', { className: 'dsh-super-code-connection-token', 'aria-label': t('connection.token'), value: token, readOnly: true, autoComplete: 'off', spellCheck: false }),
2673
2974
  React.createElement('small', null, t('connection.tokenHint'))),
2674
2975
  notice && React.createElement('p', { role: 'status' }, t(`connection.${notice}`)),
2675
- (error || editing.error) && React.createElement('p', { role: 'alert' }, t(`connection.error.${error || editing.error}`)),
2976
+ (error || editing.error) && React.createElement('div', { className: 'dsh-super-code-settings-actions' },
2977
+ React.createElement('p', { role: 'alert' }, t(`connection.error.${error || editing.error}`)),
2978
+ !error && editing.error === 'save-failed' && React.createElement(ActionButton, { type: 'button', disabled: disabled || saving,
2979
+ onClick: () => { if (!disabled && !editor.getSnapshot().saving) void editor.retry() } }, t('save.retry'))),
2676
2980
  browser && React.createElement(DirectoryBrowser, { api, t, onSelect: choose, onClose: () => setBrowser(false) }))
2677
2981
  }
2678
2982
 
@@ -2695,37 +2999,43 @@ function SegmentedControl({ label, value, choices, onChange, disabled = false, b
2695
2999
  ...choices.map(([choice, text], index) => React.createElement('button', { key: choice, type: 'button', role: 'radio',
2696
3000
  'aria-checked': index === selected, tabIndex: index === focusable ? 0 : -1, disabled, onClick: () => pick(choice) }, text)))
2697
3001
  }
2698
- function SettingsHome({ budgetApi, connectionApi, t, active, revision, navigate, children }) {
3002
+ function SettingsHome({ budgetApi, connectionApi, connectionSettings, t, active, revision, navigate, children }) {
2699
3003
  const [budget, setBudget] = useState(null), [connection, setConnection] = useState(null), [overview, setOverview] = useState({ connections: [], sessions: [] })
2700
- // `saving` keeps the chosen value on screen until the reread confirms it.
3004
+ // Keep the choice visible until the save is acknowledged.
2701
3005
  const [saving, setSaving] = useState(null), [failure, setFailure] = useState('')
3006
+ const [refreshing, setRefreshing] = useState(false)
2702
3007
  const alive = useRef(false), request = useRef(0), loading = useRef(false), writing = useRef(false)
2703
- const load = async (force = false) => {
3008
+ const load = async (force = false, blockControls = false) => {
2704
3009
  if (!force && (loading.current || writing.current)) return
2705
3010
  const sequence = ++request.current
2706
- loading.current = true
3011
+ loading.current = { blocking: blockControls }
3012
+ if (blockControls) setRefreshing(true)
2707
3013
  try {
2708
- const [b, c, o] = await Promise.all([budgetApi.readConfig(), connectionApi.readConfig(), connectionApi.overview()])
3014
+ const [b, c, o] = await Promise.all([budgetApi.readConfig(), connectionSettings.readConfig(), connectionApi.overview()])
2709
3015
  if (!b.ok || !c.ok || !o.ok) throw new Error()
2710
3016
  if (alive.current && sequence === request.current) {
2711
3017
  setBudget(b.value); setConnection(c.value); setOverview(o.value); setFailure(value => value === 'load' ? '' : value)
2712
3018
  }
2713
3019
  } catch { if (alive.current && sequence === request.current) setFailure('load') }
2714
- finally { if (sequence === request.current) loading.current = false }
3020
+ finally { if (sequence === request.current) { loading.current = false; if (alive.current) setRefreshing(false) } }
2715
3021
  }
2716
3022
  useEffect(() => { alive.current = true; return () => { alive.current = false } }, [budgetApi, connectionApi])
2717
- useEffect(() => { if (!active) return; load(); const timer = setInterval(load, 2000); return () => clearInterval(timer) }, [active, revision, budgetApi, connectionApi])
3023
+ useLayoutEffect(() => { if (!active) return; load(true, true); const timer = setInterval(load, 2000); return () => clearInterval(timer) }, [active, revision, budgetApi, connectionApi])
2718
3024
  const change = async (kind, value) => {
2719
3025
  const current = kind === 'protection' ? budget : connection
2720
- if (writing.current || !current?.writable) return
3026
+ if (loading.current?.blocking || writing.current || !current?.writable) return
2721
3027
  // A save supersedes any poll in flight, so a stale read cannot undo the choice.
2722
3028
  writing.current = true; request.current++; loading.current = false
2723
3029
  setSaving({ kind, value }); setFailure('')
2724
3030
  let saved = false
2725
3031
  try {
2726
3032
  const configuration = kind === 'protection' ? { ...current.configuration, deletionProtection: value } : { ...current.configuration, enabled: value }
2727
- const response = await (kind === 'protection' ? budgetApi : connectionApi).saveConfig(JSON.stringify(configuration), String(current.revision))
3033
+ const response = await (kind === 'protection' ? budgetApi : connectionSettings).saveConfig(JSON.stringify(configuration), settingsRevision(current))
2728
3034
  saved = Boolean(response.ok && response.value.ok)
3035
+ if (saved && alive.current) {
3036
+ if (kind === 'protection') setBudget(response.value.snapshot)
3037
+ else setConnection(response.value.snapshot)
3038
+ }
2729
3039
  } catch { /* Reported on the row below. */ }
2730
3040
  if (saved && alive.current) await load(true)
2731
3041
  writing.current = false
@@ -2752,7 +3062,7 @@ function SettingsHome({ budgetApi, connectionApi, t, active, revision, navigate,
2752
3062
  row({ key: 'protection', icon: 'shield', title: t('delete.title'), target: 'protection', on: Boolean(mode) && mode !== 'off',
2753
3063
  body: budget ? React.createElement('p', { id: 'super-code-home-protection-hint', className: 'dsh-super-code-home-row-hint' }, t(`delete.hint.${mode}`)) : placeholder('text'),
2754
3064
  control: budget ? React.createElement(SegmentedControl, { label: t('delete.mode'), value: mode, describedBy: 'super-code-home-protection-hint',
2755
- choices: ['off', 'relaxed', 'strict'].map(value => [value, t(`delete.${value}`)]), disabled: !budget.writable, busy: saving?.kind === 'protection',
3065
+ choices: ['off', 'relaxed', 'strict'].map(value => [value, t(`delete.${value}`)]), disabled: refreshing || Boolean(saving) || !budget.writable, busy: saving?.kind === 'protection',
2756
3066
  onChange: value => change('protection', value) }) : placeholder('control') }),
2757
3067
  row({ key: 'connection', icon: 'plug', title: t('home.mcp'), target: 'connection', on: enabled,
2758
3068
  body: connection ? React.createElement('p', { className: 'dsh-super-code-home-row-status', 'data-tone': state === 'listening' ? 'success' : state === 'error' ? 'error' : 'idle' },
@@ -2761,7 +3071,7 @@ function SettingsHome({ budgetApi, connectionApi, t, active, revision, navigate,
2761
3071
  listening && React.createElement('span', null, t('home.connectionCount', { count: overview.connections.length, max: connection.configuration.maxConnections })),
2762
3072
  listening && React.createElement('span', null, t('home.activeSessions', { count: connectionSessions(overview).connected.length }))) : placeholder('text'),
2763
3073
  control: needsSetup ? React.createElement(ActionButton, { type: 'button', onClick: () => navigate('connection') }, t('home.setupConnection'))
2764
- : connection ? React.createElement(ConnectionSwitch, { checked: enabled, disabled: !connection.writable, 'aria-label': t('home.mcp'),
3074
+ : connection ? React.createElement(ConnectionSwitch, { checked: enabled, disabled: refreshing || Boolean(saving) || !connection.writable, 'aria-label': t('home.mcp'),
2765
3075
  onChange: value => value && !connection.configuration.allowedDirectories.length ? navigate('connection') : change('connection', value) })
2766
3076
  : placeholder('control') })))
2767
3077
  }
@@ -2808,7 +3118,7 @@ function ConnectionConsent({ api, t }) {
2808
3118
  React.createElement(ActionButton, { type: 'button', disabled: busy, className: 'dsh-super-code-primary-button', onClick: () => resolve('approved') }, t('connection.approveDirectory'))))
2809
3119
  }
2810
3120
 
2811
- function PresetSettings({ api, budgetApi, connectionApi, openSession = () => {}, t }) {
3121
+ function PresetSettings({ api, budgetApi: budgets, connectionApi, connectionSettings, openSession = () => {}, t }) {
2812
3122
  const [tab, setTab] = useState('home')
2813
3123
  const [status, setStatus] = useState(null), [customId, setCustomId] = useState(null)
2814
3124
  const reinstall = status?.reinstallable ?? status?.state === 'installed'
@@ -2855,7 +3165,7 @@ function PresetSettings({ api, budgetApi, connectionApi, openSession = () => {},
2855
3165
  if (!install || value.ok) {
2856
3166
  const synced = await api.synchronize(localeCode(t))
2857
3167
  if (!synced.ok) throw new Error('Preset display synchronization failed')
2858
- if (install || synced.value.changed) window.location.reload()
3168
+ if (alive.current && (install || synced.value.changed)) window.location.reload()
2859
3169
  }
2860
3170
  } catch {
2861
3171
  if (alive.current) setError('preset.error.connection')
@@ -2878,7 +3188,7 @@ function PresetSettings({ api, budgetApi, connectionApi, openSession = () => {},
2878
3188
  const versionProblem = Boolean(status) && status.state !== 'missing' && versionState !== 'match'
2879
3189
  const [overviewRevision, setOverviewRevision] = useState(0)
2880
3190
  const onSaved = () => setOverviewRevision(value => value + 1)
2881
- const tabs = ['home', 'preset', 'context', 'protection', 'connection']
3191
+ const tabs = ['home', 'preset', 'skills', 'context', 'protection', 'connection']
2882
3192
  return React.createElement('section', { className: 'dsh-super-code-settings' },
2883
3193
  React.createElement('div', { className: 'dsh-super-code-settings-tabs', role: 'tablist', 'aria-label': t('settings.tabs'), onKeyDown: event => {
2884
3194
  if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) return
@@ -2891,7 +3201,7 @@ function PresetSettings({ api, budgetApi, connectionApi, openSession = () => {},
2891
3201
  tabIndex: tab === value ? 0 : -1, onClick: () => setTab(value) }, t(`settings.${value}Tab`)))),
2892
3202
  React.createElement('div', { className: 'dsh-super-code-settings-body' },
2893
3203
  React.createElement('div', { role: 'tabpanel', id: 'super-code-panel-home', 'aria-labelledby': 'super-code-tab-home', hidden: tab !== 'home' },
2894
- React.createElement(SettingsHome, { budgetApi, connectionApi, t, active: tab === 'home', revision: overviewRevision, navigate: setTab },
3204
+ React.createElement(SettingsHome, { budgetApi: budgets, connectionApi, connectionSettings, t, active: tab === 'home', revision: overviewRevision, navigate: setTab },
2895
3205
  // Healthy state collapses to one status line; problems expand into a notice with its fix.
2896
3206
  React.createElement('header', { className: 'dsh-super-code-settings-header' },
2897
3207
  React.createElement('span', { className: 'dsh-super-code-settings-mark', 'aria-hidden': true }, React.createElement(Glyph, { type: 'code' })),
@@ -2941,13 +3251,15 @@ function PresetSettings({ api, budgetApi, connectionApi, openSession = () => {},
2941
3251
  status?.delivery === 'declaration' && !status.authorable && React.createElement('p', { role: 'note' }, t('preset.declaredReadonly')),
2942
3252
  status?.delivery === 'directory' && !status.authorable && React.createElement('p', { role: 'note' }, t('preset.readonly'))),
2943
3253
  error && React.createElement('p', { role: 'alert' }, t(error)),
2944
- React.createElement(BudgetSettings, { api: budgetApi, t, section: 'shell', active: tab === 'preset', onSaved })),
3254
+ React.createElement(BudgetSettings, { api: budgets, t, section: 'shell', active: tab === 'preset', onSaved })),
3255
+ React.createElement('div', { role: 'tabpanel', id: 'super-code-panel-skills', 'aria-labelledby': 'super-code-tab-skills', hidden: tab !== 'skills' },
3256
+ React.createElement(BudgetSettings, { api: budgets, t, section: 'skills', presetStatus: status, active: tab === 'skills', onSaved })),
2945
3257
  React.createElement('div', { role: 'tabpanel', id: 'super-code-panel-context', 'aria-labelledby': 'super-code-tab-context', hidden: tab !== 'context' },
2946
- React.createElement(BudgetSettings, { api: budgetApi, t, active: tab === 'context', onSaved })),
3258
+ React.createElement(BudgetSettings, { api: budgets, t, active: tab === 'context', onSaved })),
2947
3259
  React.createElement('div', { role: 'tabpanel', id: 'super-code-panel-protection', 'aria-labelledby': 'super-code-tab-protection', hidden: tab !== 'protection' },
2948
- React.createElement(BudgetSettings, { api: budgetApi, t, section: 'protection', active: tab === 'protection', onSaved })),
3260
+ React.createElement(BudgetSettings, { api: budgets, t, section: 'protection', active: tab === 'protection', onSaved })),
2949
3261
  React.createElement('div', { role: 'tabpanel', id: 'super-code-panel-connection', 'aria-labelledby': 'super-code-tab-connection', hidden: tab !== 'connection' },
2950
- React.createElement(ConnectionSettings, { api: connectionApi, t, active: tab === 'connection', openSession, onSaved }))),
3262
+ React.createElement(ConnectionSettings, { api: connectionApi, settings: connectionSettings, t, active: tab === 'connection', openSession, onSaved }))),
2951
3263
  confirmation && React.createElement('dialog', { ref: dialog, className: 'dsh-super-code-confirm',
2952
3264
  'aria-labelledby': 'super-code-confirm-title', 'aria-describedby': 'super-code-confirm-hint',
2953
3265
  onKeyDown: event => { if (event.key === 'Escape') event.stopPropagation() },
@@ -2996,6 +3308,13 @@ function apply(ctx) {
2996
3308
  }
2997
3309
  ready.effect(() => () => { navigation.openSession = () => {} })
2998
3310
  })
3311
+ ctx.inject(['remote.superCodeBudgets', 'inputTriggers'], ready => {
3312
+ ready.effect(() => synchronizeSkillMenus(ready, ready.remote.superCodeBudgets, skillUi,
3313
+ error => console.warn('Super Code Skill menu refresh:', error)), 'super-code: live skill menus')
3314
+ })
3315
+ ctx.inject(['remote.skills', 'inputTriggers'], ready => {
3316
+ ready.effect(() => ready.inputTriggers.registerSource(skillPackageSource(ready)), 'super-code: skill package search')
3317
+ })
2999
3318
  ctx.inject(['remote.superCodeConnection'], ready => {
3000
3319
  ready.slots.inject('shell.overlay', () => ready.slots.register({
3001
3320
  name: 'shell.overlay', id: 'super-code-directory-consent', order: 180, locale: LOCALE_NS,
@@ -3006,13 +3325,17 @@ function apply(ctx) {
3006
3325
  // service here: Cordis rejects even optional reads without an injection.
3007
3326
  const preferenceService = 'configForms' in ctx ? 'configForms' : 'settingsScope'
3008
3327
  ctx.inject(['remote.superCodePresets', 'remote.superCodeBudgets', 'remote.superCodeConnection', preferenceService], ready => {
3328
+ // Settings windows may close while a save is pending. Keep each document's
3329
+ // editor with its Remote service so reopening waits for that same save.
3330
+ const budgets = createBudgetEditors(ready.remote.superCodeBudgets)
3331
+ const connections = createSettingsEditors(ready.remote.superCodeConnection, { connection: createConnectionAutosave })
3009
3332
  const preferenceScope = preferenceService === 'configForms'
3010
3333
  ? ready.configForms.get('locale') : ready.settingsScope.bind({ namespace: 'locale' })
3011
3334
  ready.effect(() => synchronizePresetDisplay(ready.remote.superCodePresets, locale,
3012
3335
  () => window.location.reload(), error => console.warn('Super Code preset display:', error), preferenceScope), 'super-code: preset display')
3013
3336
  ready.slots.inject('settings.section', () => ready.slots.register({
3014
3337
  name: 'settings.section', id: 'super-code', order: 120, label: () => t('preset.title'), locale: LOCALE_NS,
3015
- inject: () => ({ api: ready.remote.superCodePresets, budgetApi: ready.remote.superCodeBudgets, connectionApi: ready.remote.superCodeConnection, openSession: id => navigation.openSession(id) }),
3338
+ inject: () => ({ api: ready.remote.superCodePresets, budgetApi: budgets, connectionApi: ready.remote.superCodeConnection, connectionSettings: connections, openSession: id => navigation.openSession(id) }),
3016
3339
  }, PresetSettings))
3017
3340
  })
3018
3341
  ctx.effect(() => {
@@ -3066,6 +3389,7 @@ function apply(ctx) {
3066
3389
  .dsh-super-code-settings-mark svg{width:22px;height:22px;color:var(--sc-text)}
3067
3390
  .dsh-super-code-settings-head-text{display:grid;gap:4px;min-width:0}
3068
3391
  .dsh-super-code-settings-name{font-size:16px;font-weight:600;line-height:1.4;margin:0}
3392
+ .dsh-super-code-skill-version{margin-left:8px;font-size:12px;font-weight:400;color:var(--sc-muted);font-variant-numeric:tabular-nums}
3069
3393
  .dsh-super-code-settings-body{padding:20px 24px 24px}
3070
3394
  .dsh-super-code-settings-status-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
3071
3395
  .dsh-super-code-preset-status{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:4px 0;font-size:13px;min-width:0;flex:1}
@@ -3094,7 +3418,7 @@ function apply(ctx) {
3094
3418
  .dsh-super-code-settings-guidance{margin-top:20px;padding-top:12px;border-top:1px solid var(--sc-line);color:var(--sc-muted);font-size:12px}
3095
3419
  .dsh-super-code-settings-guidance p{margin:0 0 4px}
3096
3420
  .dsh-super-code-settings-tabs{display:flex;gap:24px;padding:0 24px;border-bottom:1px solid var(--sc-line)}
3097
- .dsh-super-code-settings-tabs>[role=tab]{border:0;border-bottom:2px solid transparent;background:none;color:var(--sc-muted);padding:12px 0;font-size:13px;cursor:pointer}
3421
+ .dsh-super-code-settings-tabs>[role=tab]{flex:none;border:0;border-bottom:2px solid transparent;background:none;color:var(--sc-muted);padding:12px 0;font-size:13px;cursor:pointer}
3098
3422
  .dsh-super-code-settings-tabs>[role=tab][aria-selected=true]{border-bottom-color:var(--sc-text);color:var(--sc-text);font-weight:600}
3099
3423
  .dsh-super-code-settings-tabs>[role=tab]:focus-visible{outline:2px solid var(--sc-active);outline-offset:3px;border-radius:2px}
3100
3424
  .dsh-super-code-settings [role=tabpanel][hidden]{display:none}
@@ -3363,7 +3687,7 @@ function apply(ctx) {
3363
3687
  .dsh-super-code-feedback-step[data-step-state=completed]{color:var(--sc-muted)}
3364
3688
  .dsh-super-code-feedback-step[data-step-state=completed]>span:last-child{text-decoration:line-through;text-decoration-color:color-mix(in srgb,var(--sc-muted) 40%,transparent)}
3365
3689
  .dsh-super-code-feedback-step[data-step-state=pending]{color:var(--sc-muted)}
3366
- .dsh-super-code-feedback-step[data-step-state=in_progress]{background:color-mix(in srgb,var(--sc-accent) 7%,transparent);box-shadow:inset 2px 0 color-mix(in srgb,var(--sc-accent) 55%,transparent);color:var(--sc-text)}
3690
+ .dsh-super-code-feedback-step[data-step-state=in_progress]:not([data-step-history]){background:color-mix(in srgb,var(--sc-accent) 7%,transparent);box-shadow:inset 2px 0 color-mix(in srgb,var(--sc-accent) 55%,transparent);color:var(--sc-text)}
3367
3691
  .dsh-super-code-feedback-mark{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:14px;height:14px;margin-top:3px;color:var(--sc-muted);font-size:11px;line-height:14px}
3368
3692
  .dsh-super-code-feedback-mark>svg{width:14px;height:14px}
3369
3693
  .dsh-super-code-feedback-mark.pending:before,.dsh-super-code-feedback-mark.idle:before,.dsh-super-code-feedback-mark.unavailable:before{content:"";width:7px;height:7px;border:1px solid var(--sc-faint);border-radius:50%}
@@ -3640,8 +3964,8 @@ function apply(ctx) {
3640
3964
  .dsh-super-code-detail-entry-label>span{min-width:0;overflow-wrap:anywhere}
3641
3965
  .dsh-super-code-detail-entry.user .dsh-super-code-detail-entry-label{color:var(--sc-accent)}
3642
3966
  .dsh-super-code-detail-entry time{flex:none;font-family:var(--sc-mono);font-size:11px;font-weight:400;color:var(--sc-faint)}
3643
- .dsh-super-code-detail-entry pre{min-width:0;font:inherit;font-size:14px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0 0}
3644
- .dsh-super-code-detail-entry.tool pre{font-family:var(--sc-mono);font-size:12px;line-height:1.6;color:var(--sc-muted)}
3967
+ .dsh-super-code-detail-content{min-width:0;margin-top:6px}
3968
+ .dsh-super-code-detail-plain{min-width:0;font:inherit;font-size:14px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere;margin:0}
3645
3969
  .dsh-super-code-detail-message>details{min-width:0;color:var(--sc-muted)}
3646
3970
  .dsh-super-code-detail-message>details[open]{color:var(--sc-text)}
3647
3971
  .dsh-super-code-detail-message summary{display:flex;align-items:center;gap:6px;cursor:pointer;overflow-wrap:anywhere;list-style:none}
@@ -3649,8 +3973,8 @@ function apply(ctx) {
3649
3973
  .dsh-super-code-detail-message summary .dsh-super-code-detail-entry-label{flex:1;min-width:0;font-size:12px}
3650
3974
  .dsh-super-code-detail-message summary>.dsh-super-code-glyph{width:14px;height:14px;transition:transform .12s}
3651
3975
  .dsh-super-code-detail-message details[open] summary>.dsh-super-code-glyph{transform:rotate(180deg)}
3652
- .dsh-super-code-detail-message details pre{margin-top:10px;padding:8px 10px;border:1px solid var(--sc-line);border-radius:7px;background:var(--sc-bg)}
3653
- .dsh-super-code-detail-entry button{margin:8px 0 0}
3976
+ .dsh-super-code-detail-message details .dsh-super-code-detail-content{margin-top:10px}
3977
+ .dsh-super-code-detail-message>button,.dsh-super-code-detail-message>details>button{margin:8px 0 0}
3654
3978
  .dsh-super-code-new-content{flex:none;align-self:center;margin:8px 16px 12px;border:1px solid var(--sc-line);border-radius:8px;padding:6px 12px;background:var(--sc-bg);font-size:13px}
3655
3979
  @media(hover:none) and (pointer:coarse){:where(.dsh-super-code-workspace,.dsh-super-code-settings,.dsh-super-code-memory,.dsh-super-code-tree) input{font-size:16px}}
3656
3980
  @media(prefers-reduced-motion:reduce){:where(.dsh-super-code-workspace,.dsh-super-code-settings,.dsh-super-code-tree,.dsh-super-code-detail,.dsh-super-code-memory,.dsh-super-code-confirm,.dsh-super-code-select) *{transition:none!important;animation:none!important}.dsh-super-code-graph-node>.dsh-super-code-circle:after{animation:none!important}}
@@ -3740,5 +4064,5 @@ function apply(ctx) {
3740
4064
  ctx.effect(() => disposeMemoryType, 'super-code: memory library tab')
3741
4065
  }
3742
4066
 
3743
- return { inject, apply, taskFeedbackRows, feedbackStatus, feedbackListItems, feedbackListLayout, feedbackListIndex, feedbackListWindow, feedbackListAnchor, connectionSessions, createConnectionAutosave, createBudgetAutosave, connectionDraft, connectionConfiguration, budgetDraft, budgetConfiguration, synchronizePresetDisplay, agentSessionState, buildAgentView, visibleAgentRows, agentTreeDisplay, agentTreeTotals, agentTreeLayout, agentExecutionStatus, agentDetailAddress, agentDetailTarget, agentPath, detailRecord, createAgentInspector, agentHistoryRange, agentHistoryRows, agentHistoryWindow, memoryLibraryAddress, memoryLibraryTarget, memoryLibraryNavigation, memoryLibraryWindow, createMemoryEditor, MemoryLibrary }
4067
+ return { inject, apply, skillPackageSource, synchronizeSkillMenus, refreshNativeSkillMenus, taskFeedbackRows, feedbackStatus, feedbackListItems, feedbackListLayout, feedbackListIndex, feedbackListWindow, feedbackListAnchor, connectionSessions, createConnectionAutosave, createBudgetAutosave, createBudgetEditors, connectionDraft, connectionConfiguration, budgetDraft, budgetConfiguration, synchronizePresetDisplay, agentSessionState, buildAgentView, visibleAgentRows, agentTreeDisplay, agentTreeTotals, agentTreeLayout, agentExecutionStatus, agentDetailAddress, agentDetailTarget, agentPath, detailRecord, createAgentInspector, agentHistoryRange, agentHistoryRows, agentHistoryWindow, memoryLibraryAddress, memoryLibraryTarget, memoryLibraryNavigation, memoryLibraryWindow, createMemoryEditor, MemoryLibrary }
3744
4068
  } })