dsh-pstack 0.2.0-beta.1 → 0.2.0-beta.3

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 (261) hide show
  1. package/LICENSE +2 -3
  2. package/README.md +135 -84
  3. package/README.zh.md +185 -0
  4. package/cordis.patch.yml +97 -27
  5. package/dist/host-contract-CUPSpeNk.d.mts +22 -0
  6. package/dist/index.d.mts +49 -238
  7. package/dist/index.mjs +250 -123
  8. package/dist/models.d.mts +44 -0
  9. package/dist/models.mjs +201 -0
  10. package/dist/paths-BT77khwm.mjs +48 -0
  11. package/dist/pstack/LICENSE +21 -0
  12. package/dist/pstack/README.md +291 -0
  13. package/dist/pstack/agents/poteto-agent.md +9 -0
  14. package/{assets → dist/pstack}/docs/guide/01-setup.md +13 -11
  15. package/{assets → dist/pstack}/docs/guide/02-poteto-mode.md +4 -4
  16. package/{assets → dist/pstack}/docs/guide/04-design.md +4 -4
  17. package/{assets → dist/pstack}/docs/guide/05-build-and-clean.md +2 -2
  18. package/{assets → dist/pstack}/docs/guide/06-verify-and-ship.md +13 -3
  19. package/{assets → dist/pstack}/docs/guide/07-overnight.md +15 -13
  20. package/{assets → dist/pstack}/docs/guide/09-make-it-yours.md +6 -2
  21. package/{assets → dist/pstack}/docs/guide/10-recipes-and-pitfalls.md +7 -5
  22. package/{assets → dist/pstack}/docs/guide/README.md +1 -1
  23. package/dist/pstack/docs/harness/dsh.md +98 -0
  24. package/{assets → dist/pstack}/skills/architect/SKILL.md +12 -12
  25. package/dist/pstack/skills/arena/SKILL.md +50 -0
  26. package/{assets → dist/pstack}/skills/automate-me/SKILL.md +14 -14
  27. package/{assets → dist/pstack}/skills/benchmark-checklist/SKILL.md +1 -1
  28. package/{assets → dist/pstack}/skills/blast-radius/SKILL.md +4 -6
  29. package/{assets → dist/pstack}/skills/correct/SKILL.md +1 -1
  30. package/{assets → dist/pstack}/skills/create-formal-verification-skill/SKILL.md +4 -2
  31. package/{assets → dist/pstack}/skills/create-verification-skill/SKILL.md +5 -5
  32. package/dist/pstack/skills/figure-it-out/SKILL.md +54 -0
  33. package/dist/pstack/skills/how/SKILL.md +38 -0
  34. package/{assets → dist/pstack}/skills/in-your-own-words/SKILL.md +1 -1
  35. package/dist/pstack/skills/interrogate/SKILL.md +33 -0
  36. package/{assets → dist/pstack}/skills/ketchup/SKILL.md +3 -5
  37. package/dist/pstack/skills/ketchup-video/SKILL.md +29 -0
  38. package/{assets → dist/pstack}/skills/maintain-formal-verification-skill/SKILL.md +1 -1
  39. package/{assets → dist/pstack}/skills/maintain-verification-skill/SKILL.md +3 -3
  40. package/dist/pstack/skills/make-bot-ui/SKILL.md +117 -0
  41. package/dist/pstack/skills/no-comments/SKILL.md +26 -0
  42. package/{assets → dist/pstack}/skills/poteto-help/SKILL.md +34 -31
  43. package/{assets → dist/pstack}/skills/poteto-help/references/prompting.md +1 -1
  44. package/{assets → dist/pstack}/skills/poteto-help/references/recipes.md +3 -3
  45. package/{assets → dist/pstack}/skills/poteto-mode/SKILL.md +20 -19
  46. package/dist/pstack/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
  47. package/dist/pstack/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
  48. package/dist/pstack/skills/poteto-mode/playbooks/autopilot-full.md +25 -0
  49. package/dist/pstack/skills/poteto-mode/playbooks/autopilot-stack.md +8 -0
  50. package/{assets → dist/pstack}/skills/poteto-mode/playbooks/babysit.md +4 -4
  51. package/dist/pstack/skills/poteto-mode/playbooks/bug-fix.md +15 -0
  52. package/{assets → dist/pstack}/skills/poteto-mode/playbooks/eval.md +3 -3
  53. package/dist/pstack/skills/poteto-mode/playbooks/feature.md +21 -0
  54. package/{assets → dist/pstack}/skills/poteto-mode/playbooks/hillclimb.md +3 -3
  55. package/{assets → dist/pstack}/skills/poteto-mode/playbooks/investigation.md +2 -2
  56. package/{assets → dist/pstack}/skills/poteto-mode/playbooks/multi-phase-plan.md +23 -23
  57. package/{assets → dist/pstack}/skills/poteto-mode/playbooks/opening-a-pr.md +6 -6
  58. package/dist/pstack/skills/poteto-mode/playbooks/orchestrate.md +25 -0
  59. package/{assets → dist/pstack}/skills/poteto-mode/playbooks/pause-safely.md +2 -2
  60. package/dist/pstack/skills/poteto-mode/playbooks/perf-issue.md +25 -0
  61. package/{assets → dist/pstack}/skills/poteto-mode/playbooks/prototype.md +4 -4
  62. package/dist/pstack/skills/poteto-mode/playbooks/refactoring.md +16 -0
  63. package/dist/pstack/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
  64. package/dist/pstack/skills/poteto-mode/playbooks/session-pickup.md +11 -0
  65. package/{assets → dist/pstack}/skills/poteto-mode/playbooks/shipping.md +2 -2
  66. package/{assets → dist/pstack}/skills/poteto-mode/playbooks/trace-forensics.md +2 -2
  67. package/dist/pstack/skills/poteto-mode/playbooks/visual-parity.md +11 -0
  68. package/dist/pstack/skills/poteto-mode/playbooks/worktree-cleanup.md +12 -0
  69. package/{assets → dist/pstack}/skills/poteto-mode/scripts/check-plan.mjs +6 -8
  70. package/dist/pstack/skills/poteto-mode/scripts/check-plan.test.mjs +128 -0
  71. package/{assets/skills/poteto-mode/scripts/check-plan.test.mjs → dist/pstack/skills/poteto-mode/scripts/expect.mjs} +12 -101
  72. package/dist/pstack/skills/poteto-mode/scripts/support.mjs +93 -0
  73. package/dist/pstack/skills/poteto-mode/scripts/watch-pr/cli.mjs +123 -0
  74. package/dist/pstack/skills/poteto-mode/scripts/watch-pr/cli.test.mjs +217 -0
  75. package/dist/pstack/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.mjs +119 -0
  76. package/dist/pstack/skills/poteto-mode/scripts/watch-pr/github.mjs +626 -0
  77. package/dist/pstack/skills/poteto-mode/scripts/watch-pr/github.test.mjs +521 -0
  78. package/dist/pstack/skills/poteto-mode/scripts/watch-pr/policy.mjs +657 -0
  79. package/dist/pstack/skills/poteto-mode/scripts/watch-pr/policy.test.mjs +523 -0
  80. package/dist/pstack/skills/poteto-mode/scripts/watch-pr/render.mjs +106 -0
  81. package/dist/pstack/skills/poteto-mode/scripts/watch-pr/types.mjs +9 -0
  82. package/dist/pstack/skills/poteto-mode/scripts/watch-pr/watch-pr.mjs +5 -0
  83. package/{assets → dist/pstack}/skills/poteto-mode/scripts/worktree-audit.mjs +15 -22
  84. package/dist/pstack/skills/poteto-mode/scripts/worktree-audit.test.mjs +134 -0
  85. package/{assets → dist/pstack}/skills/principle-attack-the-premise/SKILL.md +1 -1
  86. package/{assets → dist/pstack}/skills/principle-boundary-discipline/SKILL.md +1 -1
  87. package/{assets → dist/pstack}/skills/principle-encode-lessons-in-structure/SKILL.md +1 -1
  88. package/{assets → dist/pstack}/skills/principle-exhaust-the-design-space/SKILL.md +1 -1
  89. package/{assets → dist/pstack}/skills/principle-experience-first/SKILL.md +1 -1
  90. package/{assets → dist/pstack}/skills/principle-explain-the-number/SKILL.md +3 -2
  91. package/{assets → dist/pstack}/skills/principle-fix-root-causes/SKILL.md +1 -1
  92. package/{assets → dist/pstack}/skills/principle-laziness-protocol/SKILL.md +1 -1
  93. package/{assets → dist/pstack}/skills/principle-make-operations-idempotent/SKILL.md +1 -1
  94. package/{assets → dist/pstack}/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +1 -1
  95. package/{assets → dist/pstack}/skills/principle-minimize-reader-load/SKILL.md +1 -1
  96. package/{assets → dist/pstack}/skills/principle-model-the-domain/SKILL.md +1 -1
  97. package/{assets → dist/pstack}/skills/principle-never-block-on-the-human/SKILL.md +1 -1
  98. package/{assets → dist/pstack}/skills/principle-outcome-oriented-execution/SKILL.md +1 -1
  99. package/{assets → dist/pstack}/skills/principle-prove-it-works/SKILL.md +2 -2
  100. package/{assets → dist/pstack}/skills/principle-redesign-from-first-principles/SKILL.md +1 -1
  101. package/{assets → dist/pstack}/skills/principle-separate-before-serializing-shared-state/SKILL.md +1 -1
  102. package/{assets → dist/pstack}/skills/principle-sequence-verifiable-units/SKILL.md +1 -1
  103. package/{assets → dist/pstack}/skills/principle-subtract-before-you-add/SKILL.md +1 -1
  104. package/{assets → dist/pstack}/skills/principle-test-behavior-not-implementation/SKILL.md +1 -1
  105. package/{assets → dist/pstack}/skills/principle-type-system-discipline/SKILL.md +1 -1
  106. package/dist/pstack/skills/recall/SKILL.md +37 -0
  107. package/dist/pstack/skills/reflect/SKILL.md +71 -0
  108. package/{assets → dist/pstack}/skills/reflect/references/divergent-reviewer.md +4 -4
  109. package/{assets → dist/pstack}/skills/reflect/references/judgment-reviewer.md +2 -2
  110. package/{assets → dist/pstack}/skills/reflect/references/synthesizer.md +5 -5
  111. package/{assets → dist/pstack}/skills/reflect/references/tooling-reviewer.md +2 -2
  112. package/dist/pstack/skills/setup-pstack/SKILL.md +80 -0
  113. package/{assets → dist/pstack}/skills/sharpen/SKILL.md +1 -1
  114. package/{assets → dist/pstack}/skills/show-me-your-work/SKILL.md +8 -8
  115. package/{assets → dist/pstack}/skills/show-me-your-work/scripts/log.mjs +1 -3
  116. package/dist/pstack/skills/show-me-your-work/scripts/log.test.mjs +56 -0
  117. package/dist/pstack/skills/statechart/SKILL.md +82 -0
  118. package/dist/pstack/skills/statechart/references/render.md +93 -0
  119. package/dist/pstack/skills/statechart/scripts/backends/cfg.mjs +31 -0
  120. package/dist/pstack/skills/statechart/scripts/backends/mermaid.mjs +186 -0
  121. package/dist/pstack/skills/statechart/scripts/backends/plain-text.mjs +62 -0
  122. package/dist/pstack/skills/statechart/scripts/backends/report.mjs +84 -0
  123. package/dist/pstack/skills/statechart/scripts/frontends/config.mjs +268 -0
  124. package/dist/pstack/skills/statechart/scripts/frontends/dot.mjs +67 -0
  125. package/dist/pstack/skills/statechart/scripts/frontends/marks.mjs +94 -0
  126. package/dist/pstack/skills/statechart/scripts/frontends/messages.mjs +48 -0
  127. package/dist/pstack/skills/statechart/scripts/frontends/spec.mjs +101 -0
  128. package/dist/pstack/skills/statechart/scripts/frontends/trace.mjs +39 -0
  129. package/dist/pstack/skills/statechart/scripts/frontends/value.mjs +180 -0
  130. package/dist/pstack/skills/statechart/scripts/frontends/verdict.mjs +40 -0
  131. package/dist/pstack/skills/statechart/scripts/frontends/view.mjs +99 -0
  132. package/dist/pstack/skills/statechart/scripts/ir.mjs +277 -0
  133. package/dist/pstack/skills/statechart/scripts/passes/annotate.mjs +92 -0
  134. package/dist/pstack/skills/statechart/scripts/passes/label.mjs +210 -0
  135. package/dist/pstack/skills/statechart/scripts/passes/lift.mjs +84 -0
  136. package/dist/pstack/skills/statechart/scripts/passes/loop-check.mjs +47 -0
  137. package/dist/pstack/skills/statechart/scripts/passes/paths.mjs +72 -0
  138. package/dist/pstack/skills/statechart/scripts/passes/reach.mjs +135 -0
  139. package/dist/pstack/skills/statechart/scripts/passes/region-check.mjs +82 -0
  140. package/dist/pstack/skills/statechart/scripts/passes/regions.mjs +268 -0
  141. package/dist/pstack/skills/statechart/scripts/pipeline.mjs +72 -0
  142. package/dist/pstack/skills/statechart/scripts/run.mjs +440 -0
  143. package/dist/pstack/skills/statechart/scripts/statechart.mjs +155 -0
  144. package/dist/pstack/skills/statechart/scripts/statechart.test.mjs +198 -0
  145. package/dist/pstack/skills/statechart/scripts/worker.mjs +31 -0
  146. package/dist/pstack/skills/swarm/SKILL.md +43 -0
  147. package/{assets → dist/pstack}/skills/tdd/SKILL.md +1 -1
  148. package/{assets → dist/pstack}/skills/teach/SKILL.md +2 -2
  149. package/{assets → dist/pstack}/skills/technical-writing/SKILL.md +1 -1
  150. package/{assets → dist/pstack}/skills/typescript-best-practices/SKILL.md +3 -6
  151. package/{assets → dist/pstack}/skills/why/SKILL.md +8 -8
  152. package/dist/script.d.mts +9 -111
  153. package/dist/script.mjs +32 -329
  154. package/dist/skill.d.mts +38 -0
  155. package/dist/skill.mjs +183 -0
  156. package/dist/skills/authored/decision-audit/SKILL.md +99 -0
  157. package/dist/skills/authored/decision-audit/SKILL.zh.md +99 -0
  158. package/dist/skills/authored/decision-audit/references/recover-commit.md +17 -0
  159. package/dist/skills/authored/decision-audit/references/recover-commit.zh.md +17 -0
  160. package/dist/skills/authored/decision-write/SKILL.md +131 -0
  161. package/dist/skills/authored/decision-write/SKILL.zh.md +131 -0
  162. package/dist/skills/authored/decision-write/references/land.md +48 -0
  163. package/dist/skills/authored/decision-write/references/land.zh.md +48 -0
  164. package/dist/skills/authored/setup-project-docs/SKILL.md +58 -0
  165. package/dist/skills/authored/setup-project-docs/SKILL.zh.md +58 -0
  166. package/dist/skills/authored/setup-project-docs/references/decision-conventions.md +11 -0
  167. package/dist/skills/authored/setup-project-docs/references/decision-conventions.zh.md +11 -0
  168. package/dist/skills/vendored/retro/SKILL.md +44 -0
  169. package/dist/skills/vendored/retro/agents/openai.yaml +5 -0
  170. package/dist/skills/vendored/writing-for-agents/SKILL-MECHANICS.md +22 -0
  171. package/dist/skills/vendored/writing-for-agents/SKILL.md +81 -0
  172. package/dist/skills/vendored/writing-for-agents/agents/openai.yaml +3 -0
  173. package/dist/subagent.d.mts +56 -193
  174. package/dist/subagent.mjs +443 -741
  175. package/locale/en.json +3 -2
  176. package/locale/zh.json +3 -2
  177. package/package.json +63 -66
  178. package/assets/agents/poteto-agent.md +0 -8
  179. package/assets/docs/harness/dsh.md +0 -60
  180. package/assets/docs/pstack-models.example.md +0 -54
  181. package/assets/skills/arena/SKILL.md +0 -50
  182. package/assets/skills/figure-it-out/SKILL.md +0 -54
  183. package/assets/skills/how/SKILL.md +0 -38
  184. package/assets/skills/interrogate/SKILL.md +0 -71
  185. package/assets/skills/interrogate/references/code-quality-review.md +0 -47
  186. package/assets/skills/interrogate/references/lead-judgment.md +0 -39
  187. package/assets/skills/interrogate/references/reviewer-prompt.md +0 -62
  188. package/assets/skills/interrogate/references/rubric.md +0 -77
  189. package/assets/skills/no-comments/SKILL.md +0 -26
  190. package/assets/skills/poteto-mode/playbooks/authoring-a-skill.md +0 -12
  191. package/assets/skills/poteto-mode/playbooks/autonomous-run.md +0 -15
  192. package/assets/skills/poteto-mode/playbooks/autopilot-full.md +0 -25
  193. package/assets/skills/poteto-mode/playbooks/autopilot-stack.md +0 -12
  194. package/assets/skills/poteto-mode/playbooks/bug-fix.md +0 -15
  195. package/assets/skills/poteto-mode/playbooks/feature.md +0 -21
  196. package/assets/skills/poteto-mode/playbooks/orchestrate.md +0 -112
  197. package/assets/skills/poteto-mode/playbooks/perf-issue.md +0 -25
  198. package/assets/skills/poteto-mode/playbooks/refactoring.md +0 -16
  199. package/assets/skills/poteto-mode/playbooks/runtime-forensics.md +0 -11
  200. package/assets/skills/poteto-mode/playbooks/session-pickup.md +0 -11
  201. package/assets/skills/poteto-mode/playbooks/visual-parity.md +0 -11
  202. package/assets/skills/poteto-mode/playbooks/worktree-cleanup.md +0 -20
  203. package/assets/skills/poteto-mode/scripts/orch/orch.mjs +0 -4282
  204. package/assets/skills/poteto-mode/scripts/orch/orch.test.mjs +0 -2042
  205. package/assets/skills/poteto-mode/scripts/watch-pr/cli.test.mjs +0 -5101
  206. package/assets/skills/poteto-mode/scripts/watch-pr/github.test.mjs +0 -1177
  207. package/assets/skills/poteto-mode/scripts/watch-pr/policy.test.mjs +0 -1441
  208. package/assets/skills/poteto-mode/scripts/watch-pr/watch-pr.mjs +0 -4601
  209. package/assets/skills/recall/SKILL.md +0 -37
  210. package/assets/skills/reflect/SKILL.md +0 -69
  211. package/assets/skills/setup-pstack/SKILL.md +0 -67
  212. package/assets/skills/swarm/SKILL.md +0 -43
  213. package/dist/frontmatter-BQX3ekwP.mjs +0 -229
  214. package/dist/frontmatter-BQX3ekwP.mjs.map +0 -1
  215. package/dist/history.d.mts +0 -429
  216. package/dist/history.mjs +0 -1129
  217. package/dist/history.mjs.map +0 -1
  218. package/dist/host-contract-o47JH_r8.d.mts +0 -527
  219. package/dist/index.mjs.map +0 -1
  220. package/dist/paths-D_JlVmBk.mjs +0 -42
  221. package/dist/paths-D_JlVmBk.mjs.map +0 -1
  222. package/dist/script.mjs.map +0 -1
  223. package/dist/subagent.mjs.map +0 -1
  224. /package/{static/icon.png → assets/logo.png} +0 -0
  225. /package/{assets → dist/pstack}/agents/comment-sicko.md +0 -0
  226. /package/{assets → dist/pstack}/docs/guide/03-understand.md +0 -0
  227. /package/{assets → dist/pstack}/docs/guide/08-principles.md +0 -0
  228. /package/{assets → dist/pstack}/docs/guide/images/design.jpg +0 -0
  229. /package/{assets → dist/pstack}/docs/guide/images/overnight.jpg +0 -0
  230. /package/{assets → dist/pstack}/docs/guide/images/recipes.jpg +0 -0
  231. /package/{assets → dist/pstack}/docs/guide/images/router.jpg +0 -0
  232. /package/{assets → dist/pstack}/docs/guide/images/understanding.jpg +0 -0
  233. /package/{assets → dist/pstack}/docs/guide/images/verification.jpg +0 -0
  234. /package/{assets → dist/pstack}/skills/architect/references/design-red-flags.md +0 -0
  235. /package/{assets → dist/pstack}/skills/architect/references/rationale-template.md +0 -0
  236. /package/{assets → dist/pstack}/skills/architect/references/runner-prompt.md +0 -0
  237. /package/{assets → dist/pstack}/skills/bro/SKILL.md +0 -0
  238. /package/{assets → dist/pstack}/skills/create-verification-skill/references/feature-map-example/README.md +0 -0
  239. /package/{assets → dist/pstack}/skills/create-verification-skill/references/feature-map-example/create-note.md +0 -0
  240. /package/{assets → dist/pstack}/skills/create-verification-skill/references/feature-map-example/search.md +0 -0
  241. /package/{assets → dist/pstack}/skills/how/references/explainer-prompt.md +0 -0
  242. /package/{assets → dist/pstack}/skills/how/references/explorer-prompt.md +0 -0
  243. /package/{assets → dist/pstack}/skills/poteto-mode/references/bugbot-triage.md +0 -0
  244. /package/{assets → dist/pstack}/skills/principle-build-the-lever/SKILL.md +0 -0
  245. /package/{assets → dist/pstack}/skills/principle-foundational-thinking/SKILL.md +0 -0
  246. /package/{assets → dist/pstack}/skills/principle-guard-the-context-window/SKILL.md +0 -0
  247. /package/{assets → dist/pstack}/skills/show-me-your-work/references/decision-log-template.tsv +0 -0
  248. /package/{assets → dist/pstack}/skills/typescript-best-practices/references/patterns.md +0 -0
  249. /package/{assets → dist/pstack}/skills/unslop/SKILL.md +0 -0
  250. /package/{assets → dist/pstack}/skills/why/references/epistemics.md +0 -0
  251. /package/{assets → dist/pstack}/skills/why/references/investigator-prompt.md +0 -0
  252. /package/{assets → dist/pstack}/skills/why/references/source-playbook.md +0 -0
  253. /package/{assets → dist/pstack}/skills/why/references/sources/code-archaeology.md +0 -0
  254. /package/{assets → dist/pstack}/skills/why/references/sources/databricks.md +0 -0
  255. /package/{assets → dist/pstack}/skills/why/references/sources/datadog.md +0 -0
  256. /package/{assets → dist/pstack}/skills/why/references/sources/incident-postmortem.md +0 -0
  257. /package/{assets → dist/pstack}/skills/why/references/sources/linear.md +0 -0
  258. /package/{assets → dist/pstack}/skills/why/references/sources/notion.md +0 -0
  259. /package/{assets → dist/pstack}/skills/why/references/sources/sentry.md +0 -0
  260. /package/{assets → dist/pstack}/skills/why/references/sources/slack.md +0 -0
  261. /package/{assets → dist/pstack}/skills/why/references/synthesizer-prompt.md +0 -0
@@ -0,0 +1,22 @@
1
+ import { Agent, AgentOptions, AgentRegistry } from "@deepseek-ai/dsh-agent";
2
+ import { JobId, JobRegistry } from "@deepseek-ai/dsh-jobs";
3
+ import { LlmRuntime } from "@deepseek-ai/dsh-llm";
4
+ import { SessionId } from "@deepseek-ai/dsh-session";
5
+ import { SkillDefinition, SkillInvocationPolicy, SkillProvider, SkillProviderControl, SkillResourceBase } from "@deepseek-ai/dsh-skill";
6
+ import { SubagentCapabilities, SubagentRuntime } from "@deepseek-ai/dsh-subagent";
7
+ import "@deepseek-ai/dsh-system-prompt";
8
+ import { JsonSchemaNode, ToolDefinition, ToolRuntime } from "@deepseek-ai/dsh-tools";
9
+ import { WorkingDirectoryService } from "@deepseek-ai/dsh-working-directory";
10
+ /** The slice of `ctx.agents` used to reach a child this tool has just started. */
11
+ type AgentsHost = Pick<AgentRegistry, "get">;
12
+ /** The slice of `ctx.llm` used to resolve routes and advertised efforts. */
13
+ type LlmHost = Pick<LlmRuntime, "listProviders" | "listModels" | "resolveModelInfo" | "resolveCallConfig">;
14
+ /** The slice of `ctx.subagents` this plugin drives. */
15
+ type SubagentsHost = Pick<SubagentRuntime, "list" | "getProvider" | "resolveMaxDepth" | "startActivation">;
16
+ /** The slice of `ctx.tools` this plugin registers against. */
17
+ type ToolsHost = Pick<ToolRuntime, "register" | "get" | "schemas">;
18
+ /** The slice of `ctx.jobs` a background script run needs. */
19
+ type JobsHost = Pick<JobRegistry, "start" | "get">;
20
+ /** The slice of `ctx.workingDirectory` a run needs to find the session directory. */
21
+ type WorkingDirectoryHost = Pick<WorkingDirectoryService, "ensure">;
22
+ export { ToolsHost as _, JobsHost as a, SessionId as c, SkillProvider as d, SkillProviderControl as f, ToolDefinition as g, SubagentsHost as h, JobId as i, SkillDefinition as l, SubagentCapabilities as m, AgentOptions as n, JsonSchemaNode as o, SkillResourceBase as p, AgentsHost as r, LlmHost as s, Agent as t, SkillInvocationPolicy as u, WorkingDirectoryHost as v };
package/dist/index.d.mts CHANGED
@@ -1,118 +1,46 @@
1
- //#region src/provider.d.ts
1
+ import { _ as ToolsHost, d as SkillProvider, f as SkillProviderControl, u as SkillInvocationPolicy } from "./host-contract-CUPSpeNk.mjs";
2
+ import { LoadSkillResult, SkillResourceResult, SkillsHost, TOOL_NAME, createPstackSkillTool, readSkillResource, renderLoadedSkill } from "./skill.mjs";
2
3
  /**
3
- * The bundled pstack skill provider: one provider over the 55 generated skills
4
- * that ship inside this package.
5
- *
6
- * The provider contract below mirrors `@deepseek-ai/dsh-skill` 0.2.1-rc.3, which
7
- * was read through the host Inspect provider (`Service.listService` with
8
- * `service: "skills"`) and the installed type declarations. It is restated here
9
- * as a structural contract instead of imported so the plugin keeps zero runtime
10
- * imports from the host packages: a workspace-directory bundle is linked from
11
- * its checkout, where `@deepseek-ai/*` is not resolvable.
4
+ * Package-internal resource locations.
12
5
  *
13
- * Design constraints this module enforces, from the port design document §8.1:
6
+ * Every shipped resource is read from `dist/` and nowhere else. The bundler writes the
7
+ * public entries at `dist/*.mjs` and shared helper chunks under `dist/internal/`, the
8
+ * pstack build writes `dist/pstack/`, and the packaging step writes `dist/skills/`.
14
9
  *
15
- * - The catalog is built once from the package assets and never watched. A
16
- * package update is the refresh boundary.
17
- * - A malformed bundled skill fails the whole index instead of disappearing
18
- * from the catalog, so a broken asset is a startup error rather than a skill
19
- * users silently cannot see.
20
- * - `get()` only accepts a locator this provider produced. Directory names are
21
- * never joined from caller input.
22
- */
23
- /**
24
- * Standard precedence rank for packaged skill providers, re-exported by
25
- * `@deepseek-ai/dsh-skill` as `BUNDLED_SKILL_RANK`. Restated to keep the package
26
- * dependency-free; a mismatch only changes which provider wins a name collision.
10
+ * `PACKAGE_ROOT` therefore sits either one level above this module (an entry bundle in
11
+ * `dist/`) or two (a helper chunk in `dist/internal/`). Both layouts are known, so the
12
+ * directory name decides instead of probing for `dist` first and falling back.
27
13
  */
28
- export declare const BUNDLED_SKILL_RANK = 600;
29
- /** Default provider name used when the row does not override it. */
30
- export declare const DEFAULT_PROVIDER_NAME = "pstack";
31
- /** Origin bucket for a skill contribution. */
32
- type SkillSource = "project-dsh" | "project-agents" | "runtime" | "user-dsh" | "user-agents" | "custom" | "bundled" | (string & {});
33
- /** Optional provider-specific base used by loaded skill bodies to resolve relative resources. */
34
- type SkillResourceBase = {
35
- readonly kind: "directory";
14
+ /** Absolute path of the package root. */
15
+ export declare const PACKAGE_ROOT: string;
16
+ /** Absolute path of the generated pstack tree. */
17
+ export declare const PORT_ROOT: string;
18
+ /** Absolute path of the ported pstack skill directories. */
19
+ export declare const SKILLS_ROOT: string;
20
+ /** Absolute path of the vendored skill directories (`skills/vendored` at pack time). */
21
+ export declare const VENDORED_SKILLS_ROOT: string;
22
+ /** Absolute path of the skills authored in this repository. */
23
+ export declare const AUTHORED_SKILLS_ROOT: string;
24
+ /** Absolute path of the shipped harness mapping document. */
25
+ export declare const HARNESS_DOC_PATH: string;
26
+ /** One skill root the provider loads, labelled for collision errors. */
27
+ interface SkillRoot {
36
28
  readonly path: string;
37
- } | {
38
- readonly kind: "url";
39
- readonly url: string;
40
- } | {
41
- readonly kind: "opaque";
42
- readonly description: string;
43
- };
44
- /** Invocation controls shared by skill discovery consumers. */
45
- interface SkillInvocationPolicy {
46
- /** Whether model-facing catalogs and loaders include this skill. */
47
- readonly modelInvocable: boolean;
48
- /** Whether human-facing command catalogs and loaders include this skill. */
49
- readonly userInvocable: boolean;
50
- }
51
- /** Invocation-neutral skill metadata returned by `ctx.skills.list()`. */
52
- interface SkillSummary {
53
- /** Absolute instruction file path. */
54
- readonly path?: string;
55
- /** Kebab-case identifier used to address the skill. */
56
- readonly name: string;
57
- /** Short routing description shown by discovery consumers. */
58
- readonly description: string;
59
- /** Optional extra routing guidance. */
60
- readonly whenToUse?: string;
61
- /** Resolved model and user invocation controls. */
62
- readonly invocation: SkillInvocationPolicy;
63
- /** Discovery source that produced this skill. */
64
- readonly source: SkillSource;
65
- /** Provider that owns this skill body. */
66
- readonly provider: string;
67
- /** Provider-specific base for relative resources. */
68
- readonly resourceBase?: SkillResourceBase;
69
- }
70
- /** Provider catalog entry used by the registry to merge and later load skills. */
71
- interface SkillCandidate extends SkillSummary {
72
- /** Lower ranks win duplicate skill names. */
73
- readonly rank: number;
74
- /** Opaque provider-owned handle passed back to `provider.get()`. */
75
- readonly locator: unknown;
76
- /** Parsed optional metadata object from provider-specific skill frontmatter. */
77
- readonly metadata?: Readonly<Record<string, unknown>>;
78
- }
79
- /** Complete parsed skill definition, including the body loaded by `ctx.skills.get()`. */
80
- interface SkillDefinition extends SkillSummary {
81
- /** Markdown instruction body after frontmatter removal. */
82
- readonly content: string;
83
- /** Parsed optional metadata object from frontmatter. */
84
- readonly metadata?: Readonly<Record<string, unknown>>;
85
- }
86
- /** Caller context used for cwd-sensitive and abortable provider work. */
87
- interface SkillLookupOptions {
88
- /** Workspace selector for the current lookup. */
89
- readonly cwd?: string | undefined;
90
- /** Abort discovery or loading work for the current caller. */
91
- readonly signal?: AbortSignal | undefined;
92
- }
93
- /** Registration-scoped lifecycle capability handed to a provider factory. */
94
- interface SkillProviderControl {
95
- /** Aborts when registration fails or the exact provider registration is disposed. */
96
- readonly signal: AbortSignal;
97
- /** Invalidate completed catalogs and notify consumers. */
98
- readonly invalidate: () => void;
99
- }
100
- /** Provider interface for one source of skills. */
101
- interface SkillProvider {
102
- /** Unique provider name in the `ctx.skills` registry. */
103
- readonly name: string;
104
- /** List available skill candidates for the current lookup context. */
105
- readonly list: (options: SkillLookupOptions) => Promise<readonly SkillCandidate[]>;
106
- /** Load a complete skill body for a previously listed candidate. */
107
- readonly get: (candidate: SkillCandidate, options: SkillLookupOptions) => Promise<SkillDefinition | undefined>;
29
+ readonly label: string;
108
30
  }
31
+ /** Every skill root, in load order. Recursive discovery handles each root's nesting. */
32
+ export declare const SKILL_ROOTS: readonly SkillRoot[];
33
+ /** Standard precedence rank for packaged skill providers. */
34
+ export declare const BUNDLED_SKILL_RANK = 600;
35
+ /** Default provider name. */
36
+ export declare const DEFAULT_PROVIDER_NAME = "pstack";
109
37
  /** One validated on-disk bundled skill. */
110
38
  interface BundledSkill {
111
39
  readonly name: string;
112
40
  readonly description: string;
113
41
  readonly whenToUse?: string;
114
42
  readonly invocation: SkillInvocationPolicy;
115
- /** Absolute skill directory; the candidate resource base. */
43
+ /** Absolute skill directory; also the resource base. */
116
44
  readonly directory: string;
117
45
  /** Absolute `SKILL.md` path. */
118
46
  readonly instructionFile: string;
@@ -124,155 +52,38 @@ export declare class BundledSkillError extends Error {
124
52
  constructor(message: string);
125
53
  }
126
54
  /**
127
- * Read and validate every bundled skill below one directory.
55
+ * Read and validate every bundled skill under every root.
128
56
  *
129
- * This is the startup check: it runs before the provider registers, so a missing
130
- * `SKILL.md`, an invalid frontmatter block, or a name that disagrees with its
131
- * directory fails plugin activation with a path-qualified message instead of
132
- * dropping a skill from the catalog.
133
- *
134
- * @param skillsRoot - absolute path of the directory holding the skill directories.
135
- * @returns validated skills keyed by absolute skill directory, sorted by name.
136
- * @throws {BundledSkillError} when the tree or any skill in it is malformed.
57
+ * A skill name may appear in only one root; a duplicate is a packaging mistake, so it
58
+ * fails activation rather than letting one silently shadow the other. A root that does
59
+ * not exist is skipped, but an empty merged catalog fails.
137
60
  */
138
- export declare function loadBundledSkillIndex(skillsRoot: string): BundledSkillIndex;
61
+ export declare function loadBundledSkillIndexes(roots: readonly SkillRoot[]): BundledSkillIndex;
139
62
  /**
140
63
  * Build the provider over an already validated index.
141
64
  *
142
- * @param index - result of {@link loadBundledSkillIndex}.
143
- * @param providerName - registry name for this provider.
144
- * @returns a read-only provider whose catalog never changes until the package does.
65
+ * The catalog is sorted by name so two installs present the same order, and it never
66
+ * changes until the package does.
145
67
  */
146
68
  export declare function createPstackSkillProvider(index: BundledSkillIndex, providerName?: string): SkillProvider;
147
- /**
148
- * Load the index and build the provider in one step, failing on a malformed tree.
149
- *
150
- * `apply()` uses this exact function, so the startup failure path and the
151
- * provider used in tests are the same code.
152
- *
153
- * @param skillsRoot - absolute path of the bundled skill root.
154
- * @param providerName - registry name for this provider.
155
- * @returns the provider over the validated index.
156
- */
157
- export declare function createPstackSkillProviderFromRoot(skillsRoot: string, providerName?: string): SkillProvider;
158
- //#endregion
159
- //#region src/paths.d.ts
160
- /**
161
- * Package-internal resource locations.
162
- *
163
- * The provider reads generated assets in place instead of copying them into a
164
- * user-visible skills directory, so every path here is resolved from this
165
- * module's own location. The modules run from `src/` in a checkout and from the
166
- * bundled `dist/index.mjs` in an installed package; both sit one directory below
167
- * the package root, so the same expression holds in both cases.
168
- */
169
- /** Absolute path of the package root: the repository in a checkout, the install directory after packing. */
170
- export declare const PACKAGE_ROOT: string;
171
- /** Absolute path of the generated, committed assets directory. */
172
- export declare const ASSETS_ROOT: string;
173
- /** Absolute path of the directory holding the 55 bundled skill directories. */
174
- export declare const SKILLS_ROOT: string;
175
- /** Absolute path of the generated harness mapping document. */
176
- export declare const HARNESS_DOC_PATH: string;
177
- //#endregion
178
- //#region src/frontmatter.d.ts
179
- /**
180
- * Frontmatter parsing for pstack skills and agents.
181
- *
182
- * This is a deliberately small YAML subset, not YAML. It reads the shapes the
183
- * upstream files use: plain scalars, single and double quotes, folded (`>` and
184
- * `>-`) and literal (`|` and `|-`) blocks, comments, and blank lines. Nesting
185
- * and multi-document streams are rejected rather than half-supported.
186
- */
187
- export interface Frontmatter {
188
- readonly data: Readonly<Record<string, string>>;
189
- readonly body: string;
190
- }
191
- export interface SkillFrontmatter {
192
- readonly name: string;
193
- readonly description: string;
194
- readonly disableModelInvocation: boolean;
195
- readonly userInvocable: boolean;
196
- readonly whenToUse?: string;
197
- }
198
- export interface AgentFrontmatter {
199
- readonly name: string;
200
- readonly description: string;
201
- }
202
- export interface DroppedFrontmatterField {
203
- readonly file: string;
204
- readonly field: string;
205
- readonly value: string;
206
- }
207
- export declare const SKILL_CONSUMED_FIELDS: readonly ["name", "description", "disable-model-invocation", "user-invocable", "whenToUse"];
208
- export declare const SKILL_DROPPED_FIELDS: readonly ["icon", "color", "paths"];
209
- export declare const AGENT_CONSUMED_FIELDS: readonly ["name", "description"];
210
- export declare const AGENT_DROPPED_FIELDS: readonly ["is_background"];
211
- export declare const MAX_SKILL_NAME_LENGTH = 64;
212
- export declare class FrontmatterError extends Error {
213
- constructor(message: string);
214
- }
215
- export declare function parseFrontmatter(source: string): Frontmatter;
216
- export declare function validateSkillFrontmatter(data: Readonly<Record<string, string>>, source: string): SkillFrontmatter;
217
- export declare function validateAgentFrontmatter(data: Readonly<Record<string, string>>, source: string): AgentFrontmatter;
218
- export declare function serializeSkillFrontmatter(data: SkillFrontmatter): string;
219
- export declare function serializeAgentFrontmatter(data: AgentFrontmatter): string;
220
- export declare function skillDroppedFields(data: Readonly<Record<string, string>>, source: string): readonly DroppedFrontmatterField[];
221
- export declare function agentDroppedFields(data: Readonly<Record<string, string>>, source: string): readonly DroppedFrontmatterField[];
222
- //#endregion
223
- //#region src/index.d.ts
224
- /** Plugin name used by Loader diagnostics for this row. */
69
+ /** Cordis row name, used by Loader diagnostics. */
225
70
  export declare const name = "pstack";
226
- /** The provider needs the skill registry and nothing else. */
71
+ /** The row needs the skill registry and the tool registry. */
227
72
  export declare const inject: string[];
228
- /** Row configuration. Every field is optional; an omitted `config` is valid. */
229
- export interface PstackConfig {
230
- /** Registry name for the provider; change it when two rows must coexist. */
231
- readonly providerName?: string;
232
- }
233
- interface StandardSchemaIssue {
234
- readonly message: string;
235
- readonly path?: readonly (string | number)[];
236
- }
237
- type StandardSchemaResult = {
238
- readonly value: PstackConfig;
239
- readonly issues?: undefined;
240
- } | {
241
- readonly issues: readonly StandardSchemaIssue[];
242
- };
243
- /**
244
- * Minimal Standard Schema validator for this plugin's row config.
245
- *
246
- * Cordis validates `apply()`'s second argument with `Config["~standard"]` and
247
- * substitutes the returned `value`, so an omitted row `config` resolves to the
248
- * documented defaults without a schemastery dependency.
249
- */
250
- export declare const Config: {
251
- "~standard": {
252
- version: number;
253
- vendor: string;
254
- validate(value: unknown): StandardSchemaResult;
255
- };
256
- };
257
73
  /** The slice of the Cordis context this plugin requires. */
258
74
  export interface PstackSkillHost {
259
- readonly skills: {
75
+ readonly skills: SkillsHost & {
260
76
  registerProvider(create: (control: SkillProviderControl) => SkillProvider): () => void;
261
77
  };
78
+ readonly tools: ToolsHost;
79
+ /** Optional-service read for `systemPrompt`; absent is fine. */
80
+ get?(name: string): unknown;
262
81
  }
263
82
  /**
264
- * Register the bundled pstack skill provider.
265
- *
266
- * The bundled tree is validated before the provider registers, so a malformed
267
- * `SKILL.md` fails plugin activation with a path-qualified error instead of
268
- * removing one skill from the catalog. Nothing is copied out of the package and
269
- * nothing is watched: reinstalling the package is the refresh boundary.
83
+ * Register the bundled pstack skill provider and the trusted loader.
270
84
  *
271
- * @param ctx - host context carrying the skill registry.
272
- * @param config - validated row config.
273
- * @throws {import("./provider.ts").BundledSkillError} when the bundled tree is malformed.
85
+ * @param ctx - host context carrying the skill and tool registries.
86
+ * @throws {import("./internal/skill-provider.ts").BundledSkillError} when the tree is malformed.
274
87
  */
275
- export declare function apply(ctx: PstackSkillHost, config?: PstackConfig): void;
276
- //#endregion
277
- export type { BundledSkill, BundledSkillIndex, SkillCandidate, SkillDefinition, SkillInvocationPolicy, SkillLookupOptions, SkillProvider, SkillProviderControl, SkillResourceBase, SkillSource, SkillSummary };
278
- //# sourceMappingURL=index.d.mts.map
88
+ export declare function apply(ctx: PstackSkillHost): void;
89
+ export { type LoadSkillResult, TOOL_NAME as PSTACK_SKILL_TOOL_NAME, type SkillResourceResult, type SkillRoot, createPstackSkillTool, readSkillResource, renderLoadedSkill };