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
@@ -1,527 +0,0 @@
1
- //#region src/host-contract.d.ts
2
- /**
3
- * Structural copies of the `@deepseek-ai/*` 0.2.1-rc.3 declarations this plugin
4
- * binds to.
5
- *
6
- * Runtime modules import nothing from the host packages. A profile install of a
7
- * workspace directory is a link into this checkout, and the profile's
8
- * `pnpm-workspace.yaml` sets `autoInstallPeers: false`, so a runtime import of a
9
- * host package resolves nothing. Restating the contract here keeps that promise
10
- * and keeps `pnpm typecheck` independent of a machine-local DSH install.
11
- *
12
- * This is the only file that restates a host contract for delegation. When DSH
13
- * changes, re-inspect and update here, then run the delegation tests and the real
14
- * profile acceptance. Do not grow a second copy in another module.
15
- *
16
- * Contract sources (Host Inspect, 0.2.1-rc.3):
17
- * - `Service.listService({ service: "subagents" })`
18
- * - `Service.listService({ service: "llm" })`
19
- * - `Service.listService({ service: "tools" })`
20
- * - `Service.listService({ service: "agents" })` — `Agent`, `AgentsHost`,
21
- * `AgentScope`, and the `agent/request` waterfall below
22
- * - `Service.listService({ service: "sessionQuery" })`
23
- *
24
- * `Agent` is deliberately not minimal. Its `options`, `session.requestHeader()`,
25
- * and `ctx` are the three seams a child-scoped reasoning-effort control needs, and
26
- * an `Agent` that stops at `{ id }` cannot express the capability at all. The cost
27
- * of the wider copy is that every test now has to build a fuller fake; the cost of
28
- * the narrower one was a documented capability with nowhere to live.
29
- *
30
- * Deliberate simplifications, none observable at runtime:
31
- * - Branded ids (`SessionId`, `MessageId`, `ReasoningEffortId`,
32
- * `SessionSeq`, `SessionPersistenceRevision`) are plain `string`/`number`;
33
- * the brand is erased and only carried for documentation.
34
- * - `ContentBlock` names the text variant this plugin emits and leaves the other
35
- * variants opaque, because the prompt this tool builds is text only.
36
- * - `SessionEvent.data` stays `unknown`. Restricted history forwards raw event
37
- * payloads unchanged, so naming every event variant here would be a second,
38
- * drifting copy of the log format with no reader.
39
- */
40
- /**
41
- * The request header in force after the log's last header event.
42
- *
43
- * Only `config` is named, because only `config` is read. `config` is the call
44
- * configuration the machine would use, i.e. the live route after a model switch,
45
- * where `Agent.options` describes the creation-time route instead.
46
- */
47
- interface RequestEpochHeader {
48
- readonly config: LlmCallConfig;
49
- }
50
- /** The slice of `Agent.session` used to resolve a live route. */
51
- interface AgentSession {
52
- /** The header in force after the log's last header event; undefined before the first request. */
53
- requestHeader(): RequestEpochHeader | undefined;
54
- }
55
- /** One `agent/request` waterfall listener. */
56
- type AgentRequestListener = (payload: {
57
- readonly agent: Agent;
58
- readonly turn: number;
59
- readonly step: number;
60
- }, next: () => Promise<LlmCallConfig>) => Promise<LlmCallConfig>;
61
- /**
62
- * The slice of an agent-scoped context a child-scoped contribution needs.
63
- *
64
- * Everything registered here is agent-local: it unwinds on disposal and rejects
65
- * registration afterward. That is what makes one child's reasoning-effort control
66
- * invisible to its siblings, and why two concurrent delegations cannot affect each
67
- * other.
68
- */
69
- interface AgentScope {
70
- /**
71
- * Contribute to the agent-scoped `agent/request` waterfall.
72
- *
73
- * Dispatch is scope-filtered, so a listener registered on this child's own
74
- * context receives only that child's requests. `next()` yields the configuration
75
- * the machine would use (agent options on the first request, the logged header
76
- * afterwards); returning a replacement switches it. A request already in flight
77
- * is never rewritten.
78
- *
79
- * @returns the disposer, which unwinds with the scope.
80
- */
81
- on(event: "agent/request", listener: AgentRequestListener): () => void;
82
- /** The tool registry, scoped to this agent. */
83
- readonly tools: ToolsHost;
84
- }
85
- /** The live Agent the tool executes under. */
86
- interface Agent {
87
- readonly id: string;
88
- /** The provider route and model this agent's requests use at creation time. */
89
- readonly options: AgentOptions;
90
- /** The live session this agent drives. */
91
- readonly session: AgentSession;
92
- /** Agent-scoped context; contributions are agent-local and unwind on disposal. */
93
- readonly ctx: AgentScope;
94
- }
95
- /**
96
- * The slice of `ctx.agents` this tool uses to reach a child it has just started.
97
- *
98
- * `startActivation` returns the child id and not the child handle, and this tool
99
- * needs the handle to contribute to the child's own scope.
100
- */
101
- interface AgentsHost {
102
- /** The live agent with this shared agent/session id, or undefined when none is live. */
103
- get(id: string): Agent | undefined;
104
- }
105
- /** Adapter-owned child model controls. Omitted fields inherit the parent route. */
106
- interface AgentOptions {
107
- provider?: string;
108
- model?: string;
109
- reasoningEffort?: string;
110
- maxTokens?: number;
111
- }
112
- /** One provider/model route plus optional request controls. */
113
- interface LlmCallConfig {
114
- provider: string;
115
- model: string;
116
- reasoningEffort?: string;
117
- temperature?: number;
118
- maxTokens?: number;
119
- stop?: string[];
120
- }
121
- interface LlmProviderInfo {
122
- readonly id: string;
123
- readonly name: string;
124
- }
125
- interface LlmReasoningEffortInfo {
126
- readonly id: string;
127
- readonly name: string;
128
- readonly description?: string;
129
- }
130
- interface LlmModelReasoningInfo {
131
- readonly efforts: readonly LlmReasoningEffortInfo[];
132
- readonly defaultEffort?: string;
133
- }
134
- interface LlmModelContext {
135
- readonly contextWindow: number;
136
- }
137
- /** Detached metadata for one exact route, as the owning adapter reports it. */
138
- interface LlmResolvedModelInfo {
139
- readonly provider: string;
140
- readonly id: string;
141
- readonly name: string;
142
- readonly description?: string;
143
- readonly context?: LlmModelContext;
144
- readonly reasoning?: LlmModelReasoningInfo;
145
- }
146
- /** The slice of `ctx.llm` used to validate a child route before starting it. */
147
- interface LlmHost {
148
- listProviders(): readonly LlmProviderInfo[];
149
- resolveModelInfo(provider: string, model: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
150
- /**
151
- * Validate a call config against the exact model capability and materialize
152
- * adapter defaults. An unsupported explicit effort rejects before any provider
153
- * I/O; nothing is clamped or aliased.
154
- */
155
- resolveCallConfig(config: LlmCallConfig, signal?: AbortSignal): Promise<LlmCallConfig>;
156
- }
157
- /** A text content block, the only prompt variant this tool sends. */
158
- interface TextBlock {
159
- readonly type: "text";
160
- readonly text: string;
161
- }
162
- /** Prompt content; the non-text variants stay opaque here. */
163
- type ContentBlock = TextBlock | {
164
- readonly type: string;
165
- readonly [field: string]: unknown;
166
- };
167
- /** What one registered backend can enforce, checked before a child starts. */
168
- interface SubagentCapabilities {
169
- readonly agentOptions: boolean;
170
- readonly agentPreset: boolean;
171
- readonly outputSchema: boolean;
172
- readonly depthLimit: boolean;
173
- }
174
- /** The registered backend behind a provider name. */
175
- interface SubagentProvider {
176
- readonly name: string;
177
- readonly capabilities: SubagentCapabilities;
178
- readonly inheritsParentContext: boolean;
179
- readonly agentRouteDefaults?: Readonly<{
180
- provider: string;
181
- model: string;
182
- }>;
183
- }
184
- /** One child start request, after the activation wrapper supplies label and signal. */
185
- interface SubagentStartRequest {
186
- readonly cwd?: string;
187
- readonly agentPreset?: string;
188
- readonly label?: string;
189
- readonly prompt: ContentBlock[];
190
- readonly parent: Agent;
191
- readonly signal: AbortSignal;
192
- readonly agentOptions?: AgentOptions;
193
- readonly outputSchema?: unknown;
194
- readonly maxDepth?: number;
195
- }
196
- interface SubagentActivationSpec {
197
- readonly provider: string;
198
- readonly label: string;
199
- readonly childId?: string;
200
- readonly request: Omit<SubagentStartRequest, "label" | "signal">;
201
- readonly signal: AbortSignal;
202
- readonly delivery: "parent" | "caller";
203
- }
204
- interface SubagentActivation {
205
- readonly childId: string;
206
- readonly messageId?: string;
207
- }
208
- /** The slice of `ctx.subagents` this tool drives. */
209
- interface SubagentsHost {
210
- /** Registered provider names in insertion order. */
211
- list(): string[];
212
- getProvider(name: string): SubagentProvider | undefined;
213
- /**
214
- * Resolve this tool's depth policy. A numeric `configured` is returned as-is and
215
- * an omitted one reads the Host setting, so the caller owns taking the minimum
216
- * against its own cap.
217
- */
218
- resolveMaxDepth(configured?: number | "provider-managed"): number | undefined;
219
- startActivation(spec: SubagentActivationSpec): Promise<SubagentActivation>;
220
- }
221
- /**
222
- * One durable direct-child catalog row.
223
- *
224
- * `mode` is the authorization discriminator: only `continuable` children are
225
- * reviewable. `one-shot` children cannot be resumed, `external` children live in
226
- * another backend, and `unknown` modes carry no review guarantee.
227
- */
228
- type SubagentCatalogEntry = {
229
- readonly id: string;
230
- readonly createdAt: number;
231
- } & ({
232
- readonly mode: "one-shot";
233
- readonly label?: string;
234
- } | {
235
- readonly mode: "external";
236
- readonly label?: string;
237
- } | {
238
- readonly mode: "continuable";
239
- readonly label: string;
240
- } | {
241
- readonly mode: "unknown";
242
- readonly label?: string;
243
- });
244
- /**
245
- * The slice of `ctx.subagents` restricted history reads for authorization.
246
- *
247
- * `listChildren` takes a parent session id, not a caller identity, so its result
248
- * is a naming source and never an authorization boundary on its own. Restricted
249
- * history pairs it with the observed `header.parentSession`.
250
- */
251
- interface SubagentCatalogHost {
252
- listChildren(parentSessionId: string, signal?: AbortSignal): Promise<readonly SubagentCatalogEntry[]>;
253
- }
254
- /** The last committed log position, or `-1` when the log is empty. */
255
- type SessionSeqCursor = number;
256
- /**
257
- * One raw log event.
258
- *
259
- * Only the envelope is named. `data` is forwarded unchanged so an auditor reads
260
- * the log rather than a projection: this is the reason the tool never returns
261
- * `deriveMessages()` output in its place.
262
- */
263
- interface SessionEvent {
264
- readonly type: string;
265
- readonly seq: number;
266
- readonly time: number;
267
- readonly data: unknown;
268
- readonly ignorable?: true;
269
- readonly surfaceOp?: "append" | {
270
- readonly op: "replace";
271
- readonly startSeq: number;
272
- readonly endSeq: number;
273
- };
274
- readonly sourceEventSeqs?: readonly number[];
275
- }
276
- /** Immutable per-session identity plus its durable delegation position. */
277
- interface SessionHeader {
278
- readonly version: number;
279
- readonly id: string;
280
- readonly createdAt: number;
281
- readonly cwd?: string;
282
- readonly parentSession?: string;
283
- readonly isSeeded: boolean;
284
- readonly origin?: "subagent";
285
- readonly delegationDepth?: number;
286
- readonly agentPreset?: string;
287
- }
288
- /**
289
- * One caller-owned observation lease.
290
- *
291
- * A `live` lease fixes the log position when it is built, so `events` never
292
- * grows after construction. A `prepared` lease is a detached copy read from
293
- * persistence; rc.3 appends synthetic interrupted-turn closers to it and marks
294
- * neither them nor the persisted boundary. `revision` is present only for
295
- * `prepared`. Both shapes must be released with `[Symbol.dispose]()`.
296
- */
297
- interface SessionObservation {
298
- readonly source: "live" | "prepared";
299
- readonly header: SessionHeader;
300
- readonly inheritedEventCount: number;
301
- readonly events: readonly SessionEvent[];
302
- /** Last seq this snapshot covers; `-1` when the log was empty. */
303
- readonly cursor: SessionSeqCursor;
304
- /** Persistence revision of a prepared snapshot. Live snapshots omit it. */
305
- readonly revision?: string;
306
- retain(): SessionObservation;
307
- [Symbol.dispose](): void;
308
- }
309
- interface SessionObservationOptions {
310
- readonly signal?: AbortSignal;
311
- readonly projectionMode?: "all" | "none";
312
- }
313
- interface SessionRecord {
314
- readonly header: SessionHeader;
315
- readonly live: boolean;
316
- readonly persisted: boolean;
317
- readonly formatStatus?: "current" | "migration-required";
318
- }
319
- /** Provider-independent session metadata predicate, ANDed with its siblings. */
320
- type SessionResultFilter = {
321
- readonly kind: "id";
322
- readonly values: readonly string[];
323
- } | {
324
- readonly kind: "cwd";
325
- readonly values: readonly (string | null)[];
326
- } | {
327
- readonly kind: "created-at";
328
- readonly from?: number;
329
- readonly to?: number;
330
- } | {
331
- readonly kind: "parent";
332
- readonly values: readonly (string | null)[];
333
- } | {
334
- readonly kind: "availability";
335
- readonly values: readonly ("live" | "persisted")[];
336
- };
337
- /**
338
- * The slice of `ctx.sessionQuery` restricted history reads.
339
- *
340
- * `observeSession` is the only raw-event reader used: `listEvents` returns a
341
- * summary and `readSession` re-reads a detached copy, so neither can page one
342
- * fixed snapshot. `filterSessions` answers the caller's workspace without
343
- * materializing its log.
344
- */
345
- interface SessionQueryHost {
346
- observeSession(sessionId: string, options?: SessionObservationOptions): Promise<SessionObservation>;
347
- filterSessions(filters: readonly SessionResultFilter[], signal?: AbortSignal): Promise<readonly SessionRecord[]>;
348
- }
349
- type JsonSchemaType = "object" | "array" | "string" | "number" | "integer" | "boolean" | "null";
350
- /**
351
- * The JSON Schema subset the Host actually enforces.
352
- *
353
- * Exactly `type`/`oneOf`/`properties`/`required`/`additionalProperties`/`items`/
354
- * `enum`/`const` plus the annotation keys. Nothing else is accepted by
355
- * `assertSupportedJsonSchema`, and the subset is deliberately narrow here too:
356
- * `minimum` used to be listed, three tools declared numeric bounds with it, and the
357
- * Host rejected the whole schema — so `jsonSchemaToTs` and `jsonSchemaToPy` fell back
358
- * to `"unknown"` and the declared bounds were never enforced. Omitting it from this
359
- * type makes the same mistake a compile error. Bounds live in each tool's own
360
- * argument validation and in its `description`.
361
- */
362
- interface JsonSchemaNode {
363
- type?: JsonSchemaType;
364
- oneOf?: JsonSchemaNode[];
365
- properties?: Record<string, JsonSchemaNode>;
366
- required?: string[];
367
- additionalProperties?: boolean;
368
- items?: JsonSchemaNode;
369
- enum?: readonly (string | number | boolean | null)[];
370
- const?: string | number | boolean | null;
371
- description?: string;
372
- title?: string;
373
- default?: unknown;
374
- }
375
- /** How one tool's result is projected for the model. */
376
- interface ToolOutputDefinition {
377
- readonly schema: JsonSchemaNode;
378
- render(args: unknown, value: unknown): ContentBlock[];
379
- }
380
- /** The typed same-process call input the registry supplies to `execute`. */
381
- interface ToolExecutionInput {
382
- readonly name: string;
383
- /** Corpus id of this exact call, as written to the `tool/call` event. */
384
- readonly callId: string;
385
- readonly arguments: unknown;
386
- readonly agent?: Agent;
387
- readonly signal: AbortSignal;
388
- }
389
- /** `exec` inside a tool body. */
390
- interface ToolRunContext extends ToolExecutionInput {
391
- deferContext(context: unknown): void;
392
- concludeTurn(): void;
393
- }
394
- interface ToolDefinition {
395
- name: string;
396
- description: string;
397
- parameters: Record<string, unknown>;
398
- readonly output: ToolOutputDefinition;
399
- execute(args: unknown, exec: ToolRunContext): Promise<unknown>;
400
- isConcurrencySafe?(args: unknown): boolean;
401
- /**
402
- * Cooperative tool-call timeout budget in milliseconds; omitted means no deadline.
403
- *
404
- * Enforced by `@deepseek-ai/dsh-tool-call-timeout-policy`, which wraps
405
- * `tools/execute`: it replaces `exec.signal` with a deadline-combined signal for the
406
- * duration of the call, and converts the outcome to a timeout when its own timer won.
407
- *
408
- * The budget covers **only the tool call**, not work the call starts. The wrapper
409
- * disposes its timer as soon as `execute` settles, so a background job started by the
410
- * call keeps running past the budget — the deadline cannot be used to bound a long
411
- * task, and it does not break one either.
412
- *
413
- * Never sent to the model: `schemas()` whitelists name/description/parameters only.
414
- *
415
- * Declaring it asserts that the tool forwards `exec.signal` into an implementation
416
- * that can reach quiescence when that signal aborts. `pstack_script` does: the
417
- * foreground run hands the signal to `spawn`, so an abort kills the child.
418
- *
419
- * Source: `dsh-tools/lib/types/index.d.ts` (`ToolDefinition.timeoutMs`) in the
420
- * installed 0.2.1-rc.3 tree; the npm copy of that file is byte-identical.
421
- */
422
- timeoutMs?: number;
423
- }
424
- /** The slice of `ctx.tools` this tool needs. */
425
- interface ToolsHost {
426
- register(definition: ToolDefinition): () => void;
427
- }
428
- /**
429
- * The slice of `ctx.workingDirectory` a script run needs.
430
- *
431
- * `ensure` is the same seam `dsh-tool-bash` uses before it spawns anything
432
- * (`dsh-tool-bash/lib/index.js:663`): it returns the Session's current directory,
433
- * creating or restoring it as the Host requires. Reading `process.cwd()` instead
434
- * would run the script in the Host process's directory — wrong for every Session
435
- * whose workspace is a checkout or a worktree.
436
- */
437
- interface WorkingDirectoryHost {
438
- /** The Session's current directory, validated/created as the Host requires. */
439
- ensure(agent: Agent, signal?: AbortSignal): Promise<string>;
440
- }
441
- /**
442
- * A registry-issued job id, branded by the Host.
443
- *
444
- * Kept as a plain `string` here, like the other branded ids in this file: the brand
445
- * is erased and only documents that the value is opaque and must not be parsed.
446
- */
447
- type JobId = string;
448
- /**
449
- * A session id, branded by the Host.
450
- *
451
- * Plain `string` for the same reason. A job's `owner` is a session id, so the jobs
452
- * slice below reuses the name rather than introducing a second spelling.
453
- */
454
- type SessionId = string;
455
- /** The tool call a job was started for. */
456
- interface JobToolCall {
457
- readonly callId: string;
458
- readonly rootCallId: string;
459
- }
460
- /** One job's lifecycle state. */
461
- type JobStatus = "running" | "stopping" | "completed" | "killed" | "failed";
462
- /** One output channel a producer may append to. */
463
- type JobChannel = "stdout" | "stderr" | "log";
464
- /** A live handle on a started job. */
465
- interface JobHandle {
466
- readonly id: JobId;
467
- append(text: string, options?: {
468
- readonly channel?: JobChannel;
469
- }): void;
470
- updateProgress(line: string): void;
471
- }
472
- /** What a producer returns so the registry can cancel it and await its outcome. */
473
- interface JobHooks {
474
- cancel(reason?: string): void;
475
- readonly done: Promise<JobOutcome>;
476
- }
477
- /** How a job ended, as its producer reports it. */
478
- interface JobOutcome {
479
- readonly status: "completed" | "killed" | "failed";
480
- readonly detail?: string;
481
- readonly result?: string;
482
- }
483
- /** The spec handed to `jobs.start`. */
484
- interface JobSpec {
485
- readonly kind: "bash";
486
- readonly label: string;
487
- readonly owner?: SessionId;
488
- readonly toolCall?: JobToolCall;
489
- readonly outputLimitBytes?: number;
490
- readonly run: (job: JobHandle) => JobHooks;
491
- }
492
- /** A fresh projection of one job. */
493
- interface JobView {
494
- readonly id: JobId;
495
- readonly kind: string;
496
- readonly label: string;
497
- readonly owner?: SessionId;
498
- readonly status: JobStatus;
499
- readonly progress?: string;
500
- readonly detail?: string;
501
- readonly startedAt: number;
502
- readonly finishedAt?: number;
503
- readonly output: {
504
- readonly total: number;
505
- readonly earliest: number;
506
- readonly spillPaths?: readonly string[];
507
- };
508
- }
509
- /**
510
- * The slice of `ctx.jobs` a background script run needs.
511
- *
512
- * `jobs` is optional in the composition: a profile without a job controller still
513
- * gets `pstack_script`, and a `background: true` call is then refused with a reason
514
- * instead of hanging. That is why the access the row uses is `ctx.get("jobs")` —
515
- * rc.3's optional-service form — and not `ctx.jobs`.
516
- *
517
- * Only `start` and `get` are named. `pstack_script` starts one job and reports its
518
- * id; reading output, waiting, and killing stay with the Host's own job tools, which
519
- * already own the model cursor and authorization checks.
520
- */
521
- interface JobsHost {
522
- start(spec: JobSpec): JobId;
523
- get(id: JobId, caller?: SessionId): JobView;
524
- }
525
- //#endregion
526
- export { ToolRunContext as _, JobsHost as a, SessionEvent as c, SessionQueryHost as d, SubagentCapabilities as f, ToolDefinition as g, SubagentsHost as h, JobId as i, SessionHeader as l, SubagentCatalogHost as m, AgentOptions as n, JsonSchemaNode as o, SubagentCatalogEntry as p, AgentsHost as r, LlmHost as s, Agent as t, SessionId as u, ToolsHost as v, WorkingDirectoryHost as y };
527
- //# sourceMappingURL=host-contract-o47JH_r8.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/provider.ts","../src/index.ts"],"sourcesContent":["/**\n * The bundled pstack skill provider: one provider over the 55 generated skills\n * that ship inside this package.\n *\n * The provider contract below mirrors `@deepseek-ai/dsh-skill` 0.2.1-rc.3, which\n * was read through the host Inspect provider (`Service.listService` with\n * `service: \"skills\"`) and the installed type declarations. It is restated here\n * as a structural contract instead of imported so the plugin keeps zero runtime\n * imports from the host packages: a workspace-directory bundle is linked from\n * its checkout, where `@deepseek-ai/*` is not resolvable.\n *\n * Design constraints this module enforces, from the port design document §8.1:\n *\n * - The catalog is built once from the package assets and never watched. A\n * package update is the refresh boundary.\n * - A malformed bundled skill fails the whole index instead of disappearing\n * from the catalog, so a broken asset is a startup error rather than a skill\n * users silently cannot see.\n * - `get()` only accepts a locator this provider produced. Directory names are\n * never joined from caller input.\n */\n\nimport { readFileSync, readdirSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nimport { parseFrontmatter, validateSkillFrontmatter } from \"./frontmatter.ts\";\n\n/**\n * Standard precedence rank for packaged skill providers, re-exported by\n * `@deepseek-ai/dsh-skill` as `BUNDLED_SKILL_RANK`. Restated to keep the package\n * dependency-free; a mismatch only changes which provider wins a name collision.\n */\nexport const BUNDLED_SKILL_RANK = 600;\n\n/** Default provider name used when the row does not override it. */\nexport const DEFAULT_PROVIDER_NAME = \"pstack\";\n\n/** Origin bucket for a skill contribution. */\nexport type SkillSource =\n | \"project-dsh\"\n | \"project-agents\"\n | \"runtime\"\n | \"user-dsh\"\n | \"user-agents\"\n | \"custom\"\n | \"bundled\"\n | (string & {});\n\n/** Optional provider-specific base used by loaded skill bodies to resolve relative resources. */\nexport type SkillResourceBase =\n | { readonly kind: \"directory\"; readonly path: string }\n | { readonly kind: \"url\"; readonly url: string }\n | { readonly kind: \"opaque\"; readonly description: string };\n\n/** Invocation controls shared by skill discovery consumers. */\nexport interface SkillInvocationPolicy {\n /** Whether model-facing catalogs and loaders include this skill. */\n readonly modelInvocable: boolean;\n /** Whether human-facing command catalogs and loaders include this skill. */\n readonly userInvocable: boolean;\n}\n\n/** Invocation-neutral skill metadata returned by `ctx.skills.list()`. */\nexport interface SkillSummary {\n /** Absolute instruction file path. */\n readonly path?: string;\n /** Kebab-case identifier used to address the skill. */\n readonly name: string;\n /** Short routing description shown by discovery consumers. */\n readonly description: string;\n /** Optional extra routing guidance. */\n readonly whenToUse?: string;\n /** Resolved model and user invocation controls. */\n readonly invocation: SkillInvocationPolicy;\n /** Discovery source that produced this skill. */\n readonly source: SkillSource;\n /** Provider that owns this skill body. */\n readonly provider: string;\n /** Provider-specific base for relative resources. */\n readonly resourceBase?: SkillResourceBase;\n}\n\n/** Provider catalog entry used by the registry to merge and later load skills. */\nexport interface SkillCandidate extends SkillSummary {\n /** Lower ranks win duplicate skill names. */\n readonly rank: number;\n /** Opaque provider-owned handle passed back to `provider.get()`. */\n readonly locator: unknown;\n /** Parsed optional metadata object from provider-specific skill frontmatter. */\n readonly metadata?: Readonly<Record<string, unknown>>;\n}\n\n/** Complete parsed skill definition, including the body loaded by `ctx.skills.get()`. */\nexport interface SkillDefinition extends SkillSummary {\n /** Markdown instruction body after frontmatter removal. */\n readonly content: string;\n /** Parsed optional metadata object from frontmatter. */\n readonly metadata?: Readonly<Record<string, unknown>>;\n}\n\n/** Caller context used for cwd-sensitive and abortable provider work. */\nexport interface SkillLookupOptions {\n /** Workspace selector for the current lookup. */\n readonly cwd?: string | undefined;\n /** Abort discovery or loading work for the current caller. */\n readonly signal?: AbortSignal | undefined;\n}\n\n/** Registration-scoped lifecycle capability handed to a provider factory. */\nexport interface SkillProviderControl {\n /** Aborts when registration fails or the exact provider registration is disposed. */\n readonly signal: AbortSignal;\n /** Invalidate completed catalogs and notify consumers. */\n readonly invalidate: () => void;\n}\n\n/** Provider interface for one source of skills. */\nexport interface SkillProvider {\n /** Unique provider name in the `ctx.skills` registry. */\n readonly name: string;\n /** List available skill candidates for the current lookup context. */\n readonly list: (options: SkillLookupOptions) => Promise<readonly SkillCandidate[]>;\n /** Load a complete skill body for a previously listed candidate. */\n readonly get: (\n candidate: SkillCandidate,\n options: SkillLookupOptions,\n ) => Promise<SkillDefinition | undefined>;\n}\n\n/** Opaque handle this provider hands back to itself; never derived from caller input. */\ninterface BundledSkillLocator {\n readonly kind: \"bundled-skill\";\n /** Absolute skill directory that also serves as the resource base. */\n readonly directory: string;\n /** Absolute `SKILL.md` path read by `get()`. */\n readonly instructionFile: string;\n}\n\n/** One validated on-disk bundled skill. */\nexport interface BundledSkill {\n readonly name: string;\n readonly description: string;\n readonly whenToUse?: string;\n readonly invocation: SkillInvocationPolicy;\n /** Absolute skill directory; the candidate resource base. */\n readonly directory: string;\n /** Absolute `SKILL.md` path. */\n readonly instructionFile: string;\n}\n\n/** Validated skills keyed by their absolute directory. */\nexport type BundledSkillIndex = ReadonlyMap<string, BundledSkill>;\n\n/** Raised when a bundled asset violates the provider contract. */\nexport class BundledSkillError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"BundledSkillError\";\n }\n}\n\n/**\n * Read and validate every bundled skill below one directory.\n *\n * This is the startup check: it runs before the provider registers, so a missing\n * `SKILL.md`, an invalid frontmatter block, or a name that disagrees with its\n * directory fails plugin activation with a path-qualified message instead of\n * dropping a skill from the catalog.\n *\n * @param skillsRoot - absolute path of the directory holding the skill directories.\n * @returns validated skills keyed by absolute skill directory, sorted by name.\n * @throws {BundledSkillError} when the tree or any skill in it is malformed.\n */\nexport function loadBundledSkillIndex(skillsRoot: string): BundledSkillIndex {\n let entries;\n try {\n entries = readdirSync(skillsRoot, { withFileTypes: true });\n } catch (error) {\n throw new BundledSkillError(\n `bundled skills: cannot read \"${skillsRoot}\": ${messageOf(error)}`,\n );\n }\n\n const index = new Map<string, BundledSkill>();\n\n for (const entry of entries.sort((left, right) => (left.name < right.name ? -1 : 1))) {\n const directory = join(skillsRoot, entry.name);\n if (!entry.isDirectory()) {\n throw new BundledSkillError(\n `bundled skills: \"${directory}\" is not a skill directory; remove it or add a SKILL.md`,\n );\n }\n\n const instructionFile = join(directory, \"SKILL.md\");\n const text = readSkillFile(instructionFile);\n const frontmatter = readSkillFrontmatter(text, instructionFile);\n\n if (frontmatter.name !== entry.name) {\n throw new BundledSkillError(\n `${instructionFile}: skill name \"${frontmatter.name}\" does not match its directory \"${entry.name}\"`,\n );\n }\n\n index.set(directory, {\n name: frontmatter.name,\n description: frontmatter.description,\n ...(frontmatter.whenToUse === undefined ? {} : { whenToUse: frontmatter.whenToUse }),\n invocation: {\n modelInvocable: !frontmatter.disableModelInvocation,\n userInvocable: frontmatter.userInvocable,\n },\n directory,\n instructionFile,\n });\n }\n\n if (index.size === 0) {\n throw new BundledSkillError(`bundled skills: no skill directories under \"${skillsRoot}\"`);\n }\n\n return index;\n}\n\n/**\n * Build the provider over an already validated index.\n *\n * @param index - result of {@link loadBundledSkillIndex}.\n * @param providerName - registry name for this provider.\n * @returns a read-only provider whose catalog never changes until the package does.\n */\nexport function createPstackSkillProvider(\n index: BundledSkillIndex,\n providerName: string = DEFAULT_PROVIDER_NAME,\n): SkillProvider {\n const ordered = [...index.values()].sort((left, right) =>\n left.name < right.name ? -1 : left.name > right.name ? 1 : 0,\n );\n\n return {\n name: providerName,\n\n async list(options) {\n throwIfAborted(options?.signal);\n return ordered.map(\n (skill): SkillCandidate => ({\n name: skill.name,\n description: skill.description,\n ...(skill.whenToUse === undefined ? {} : { whenToUse: skill.whenToUse }),\n invocation: skill.invocation,\n source: \"bundled\",\n provider: providerName,\n rank: BUNDLED_SKILL_RANK,\n locator: {\n kind: \"bundled-skill\",\n directory: skill.directory,\n instructionFile: skill.instructionFile,\n } satisfies BundledSkillLocator,\n path: skill.instructionFile,\n resourceBase: { kind: \"directory\", path: skill.directory },\n }),\n );\n },\n\n async get(candidate, options) {\n const locator = asBundledSkillLocator(candidate.locator);\n if (locator === undefined) return undefined;\n\n const skill = index.get(locator.directory);\n if (\n skill === undefined ||\n skill.instructionFile !== locator.instructionFile ||\n skill.name !== candidate.name\n ) {\n return undefined;\n }\n\n throwIfAborted(options?.signal);\n\n const text = readOptionalSkillFile(skill.instructionFile);\n if (text === undefined) return undefined;\n const { body } = parseFrontmatter(text);\n\n return {\n name: skill.name,\n description: skill.description,\n ...(skill.whenToUse === undefined ? {} : { whenToUse: skill.whenToUse }),\n invocation: skill.invocation,\n source: \"bundled\",\n provider: providerName,\n path: skill.instructionFile,\n resourceBase: { kind: \"directory\", path: skill.directory },\n content: body,\n };\n },\n };\n}\n\n/**\n * Load the index and build the provider in one step, failing on a malformed tree.\n *\n * `apply()` uses this exact function, so the startup failure path and the\n * provider used in tests are the same code.\n *\n * @param skillsRoot - absolute path of the bundled skill root.\n * @param providerName - registry name for this provider.\n * @returns the provider over the validated index.\n */\nexport function createPstackSkillProviderFromRoot(\n skillsRoot: string,\n providerName: string = DEFAULT_PROVIDER_NAME,\n): SkillProvider {\n return createPstackSkillProvider(loadBundledSkillIndex(skillsRoot), providerName);\n}\n\nfunction asBundledSkillLocator(locator: unknown): BundledSkillLocator | undefined {\n if (typeof locator !== \"object\" || locator === null) return undefined;\n const candidate = locator as Partial<BundledSkillLocator>;\n if (candidate.kind !== \"bundled-skill\") return undefined;\n if (typeof candidate.directory !== \"string\") return undefined;\n if (typeof candidate.instructionFile !== \"string\") return undefined;\n return {\n kind: \"bundled-skill\",\n directory: candidate.directory,\n instructionFile: candidate.instructionFile,\n };\n}\n\nfunction readSkillFile(instructionFile: string): string {\n try {\n return readFileSync(instructionFile, \"utf8\");\n } catch (error) {\n throw new BundledSkillError(\n `bundled skills: cannot read \"${instructionFile}\": ${messageOf(error)}`,\n );\n }\n}\n\n/** Parse and validate one skill header, reporting failures as bundled-asset errors. */\nfunction readSkillFrontmatter(\n text: string,\n instructionFile: string,\n): ReturnType<typeof validateSkillFrontmatter> {\n try {\n const { data } = parseFrontmatter(text);\n return validateSkillFrontmatter(data, instructionFile);\n } catch (error) {\n const message = messageOf(error);\n throw new BundledSkillError(\n message.includes(instructionFile) ? message : `${instructionFile}: ${message}`,\n );\n }\n}\n\nfunction readOptionalSkillFile(instructionFile: string): string | undefined {\n try {\n return readFileSync(instructionFile, \"utf8\");\n } catch (error) {\n if (errorCode(error) === \"ENOENT\") return undefined;\n throw error;\n }\n}\n\nfunction throwIfAborted(signal: AbortSignal | undefined): void {\n if (signal?.aborted !== true) return;\n throw signal.reason ?? new Error(\"skill provider work was aborted\");\n}\n\nfunction errorCode(error: unknown): string | undefined {\n if (typeof error !== \"object\" || error === null) return undefined;\n const code = (error as { code?: unknown }).code;\n return typeof code === \"string\" ? code : undefined;\n}\n\nfunction messageOf(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n","/**\n * dsh-pstack Host entry.\n *\n * Unit 2 ships one minimal capability: a single `ctx.skills` provider over the\n * generated assets in this package. Delegation, restricted history, roles, and\n * the worktree integration are later units and are deliberately absent here.\n *\n * The provider contract types live in `./provider.ts` and are structural copies\n * of the `@deepseek-ai/dsh-skill` 0.2.1-rc.3 declarations, so this module imports\n * nothing from the host packages at runtime.\n */\n\nimport { SKILLS_ROOT } from \"./paths.ts\";\nimport {\n DEFAULT_PROVIDER_NAME,\n createPstackSkillProvider,\n loadBundledSkillIndex,\n} from \"./provider.ts\";\nimport type { SkillProvider, SkillProviderControl } from \"./provider.ts\";\n\n/** Plugin name used by Loader diagnostics for this row. */\nexport const name = \"pstack\";\n\n/** The provider needs the skill registry and nothing else. */\nexport const inject = [\"skills\"];\n\n/** Row configuration. Every field is optional; an omitted `config` is valid. */\nexport interface PstackConfig {\n /** Registry name for the provider; change it when two rows must coexist. */\n readonly providerName?: string;\n}\n\ninterface StandardSchemaIssue {\n readonly message: string;\n readonly path?: readonly (string | number)[];\n}\n\ntype StandardSchemaResult =\n | { readonly value: PstackConfig; readonly issues?: undefined }\n | { readonly issues: readonly StandardSchemaIssue[] };\n\n/**\n * Minimal Standard Schema validator for this plugin's row config.\n *\n * Cordis validates `apply()`'s second argument with `Config[\"~standard\"]` and\n * substitutes the returned `value`, so an omitted row `config` resolves to the\n * documented defaults without a schemastery dependency.\n */\nexport const Config = {\n \"~standard\": {\n version: 1,\n vendor: \"dsh-pstack\",\n validate(value: unknown): StandardSchemaResult {\n if (value === undefined || value === null) {\n return { value: { providerName: DEFAULT_PROVIDER_NAME } };\n }\n if (typeof value !== \"object\" || Array.isArray(value)) {\n return { issues: [{ message: \"config must be a mapping\" }] };\n }\n\n const issues: StandardSchemaIssue[] = [];\n const record = value as Record<string, unknown>;\n for (const key of Object.keys(record)) {\n if (key !== \"providerName\") issues.push({ message: `unknown field \"${key}\"`, path: [key] });\n }\n\n const providerName = record[\"providerName\"];\n if (providerName === undefined) {\n return issues.length > 0\n ? { issues }\n : { value: { providerName: DEFAULT_PROVIDER_NAME } };\n }\n if (typeof providerName !== \"string\" || providerName.trim() === \"\") {\n issues.push({ message: \"providerName must be a non-empty string\", path: [\"providerName\"] });\n return { issues };\n }\n\n return issues.length > 0 ? { issues } : { value: { providerName } };\n },\n },\n};\n\n/** The slice of the Cordis context this plugin requires. */\nexport interface PstackSkillHost {\n readonly skills: {\n registerProvider(create: (control: SkillProviderControl) => SkillProvider): () => void;\n };\n}\n\n/**\n * Register the bundled pstack skill provider.\n *\n * The bundled tree is validated before the provider registers, so a malformed\n * `SKILL.md` fails plugin activation with a path-qualified error instead of\n * removing one skill from the catalog. Nothing is copied out of the package and\n * nothing is watched: reinstalling the package is the refresh boundary.\n *\n * @param ctx - host context carrying the skill registry.\n * @param config - validated row config.\n * @throws {import(\"./provider.ts\").BundledSkillError} when the bundled tree is malformed.\n */\nexport function apply(ctx: PstackSkillHost, config: PstackConfig = {}): void {\n const providerName = config.providerName ?? DEFAULT_PROVIDER_NAME;\n const index = loadBundledSkillIndex(SKILLS_ROOT);\n ctx.skills.registerProvider((_control) => createPstackSkillProvider(index, providerName));\n}\n\nexport { ASSETS_ROOT, HARNESS_DOC_PATH, PACKAGE_ROOT, SKILLS_ROOT } from \"./paths.ts\";\nexport {\n BUNDLED_SKILL_RANK,\n BundledSkillError,\n DEFAULT_PROVIDER_NAME,\n createPstackSkillProvider,\n createPstackSkillProviderFromRoot,\n loadBundledSkillIndex,\n} from \"./provider.ts\";\nexport type {\n BundledSkill,\n BundledSkillIndex,\n SkillCandidate,\n SkillDefinition,\n SkillInvocationPolicy,\n SkillLookupOptions,\n SkillProvider,\n SkillProviderControl,\n SkillResourceBase,\n SkillSource,\n SkillSummary,\n} from \"./provider.ts\";\nexport * from \"./frontmatter.ts\";\n"],"mappings":"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"}
@@ -1,42 +0,0 @@
1
- import { dirname, join, resolve } from "node:path";
2
- import { fileURLToPath } from "node:url";
3
- //#region src/paths.ts
4
- /**
5
- * Package-internal resource locations.
6
- *
7
- * The provider reads generated assets in place instead of copying them into a
8
- * user-visible skills directory, so every path here is resolved from this
9
- * module's own location. The modules run from `src/` in a checkout and from the
10
- * bundled `dist/index.mjs` in an installed package; both sit one directory below
11
- * the package root, so the same expression holds in both cases.
12
- */
13
- /** Absolute path of the package root: the repository in a checkout, the install directory after packing. */
14
- const PACKAGE_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
15
- /** Absolute path of the generated, committed assets directory. */
16
- const ASSETS_ROOT = join(PACKAGE_ROOT, "assets");
17
- /** Absolute path of the directory holding the 55 bundled skill directories. */
18
- const SKILLS_ROOT = join(ASSETS_ROOT, "skills");
19
- /** Absolute path of the directory holding the generated agent preambles. */
20
- const AGENTS_ROOT = join(ASSETS_ROOT, "agents");
21
- /**
22
- * Absolute path of the `poteto-mode` instructions.
23
- *
24
- * `pstack_subagent` injects this path into a `poteto-agent` child's prompt, so the
25
- * child reads the playbook from where it actually is instead of searching a Cursor
26
- * plugin install for the highest version.
27
- */
28
- const POTETO_MODE_SKILL_PATH = join(SKILLS_ROOT, "poteto-mode", "SKILL.md");
29
- /** Absolute path of the generated harness mapping document. */
30
- const HARNESS_DOC_PATH = join(ASSETS_ROOT, "docs", "harness", "dsh.md");
31
- /**
32
- * Absolute path of one agent preamble.
33
- *
34
- * Returns `undefined` for `general`, which is a plain child and gets no preamble.
35
- */
36
- function agentPreamblePath(agent) {
37
- return agent === "general" ? void 0 : join(AGENTS_ROOT, `${agent}.md`);
38
- }
39
- //#endregion
40
- export { SKILLS_ROOT as a, POTETO_MODE_SKILL_PATH as i, HARNESS_DOC_PATH as n, agentPreamblePath as o, PACKAGE_ROOT as r, ASSETS_ROOT as t };
41
-
42
- //# sourceMappingURL=paths-D_JlVmBk.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"paths-D_JlVmBk.mjs","names":[],"sources":["../src/paths.ts"],"sourcesContent":["/**\n * Package-internal resource locations.\n *\n * The provider reads generated assets in place instead of copying them into a\n * user-visible skills directory, so every path here is resolved from this\n * module's own location. The modules run from `src/` in a checkout and from the\n * bundled `dist/index.mjs` in an installed package; both sit one directory below\n * the package root, so the same expression holds in both cases.\n */\n\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n/** Absolute path of the package root: the repository in a checkout, the install directory after packing. */\nexport const PACKAGE_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), \"..\");\n\n/** Absolute path of the generated, committed assets directory. */\nexport const ASSETS_ROOT = join(PACKAGE_ROOT, \"assets\");\n\n/** Absolute path of the directory holding the 55 bundled skill directories. */\nexport const SKILLS_ROOT = join(ASSETS_ROOT, \"skills\");\n\n/** Absolute path of the directory holding the generated agent preambles. */\nexport const AGENTS_ROOT = join(ASSETS_ROOT, \"agents\");\n\n/**\n * Absolute path of the `poteto-mode` instructions.\n *\n * `pstack_subagent` injects this path into a `poteto-agent` child's prompt, so the\n * child reads the playbook from where it actually is instead of searching a Cursor\n * plugin install for the highest version.\n */\nexport const POTETO_MODE_SKILL_PATH = join(SKILLS_ROOT, \"poteto-mode\", \"SKILL.md\");\n\n/** Absolute path of the generated harness mapping document. */\nexport const HARNESS_DOC_PATH = join(ASSETS_ROOT, \"docs\", \"harness\", \"dsh.md\");\n\n/**\n * Absolute path of one agent preamble.\n *\n * Returns `undefined` for `general`, which is a plain child and gets no preamble.\n */\nexport function agentPreamblePath(agent: string): string | undefined {\n return agent === \"general\" ? undefined : join(AGENTS_ROOT, `${agent}.md`);\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,eAAe,QAAQ,QAAQ,cAAc,YAAY,GAAG,CAAC,GAAG,IAAI;;AAGjF,MAAa,cAAc,KAAK,cAAc,QAAQ;;AAGtD,MAAa,cAAc,KAAK,aAAa,QAAQ;;AAGrD,MAAa,cAAc,KAAK,aAAa,QAAQ;;;;;;;;AASrD,MAAa,yBAAyB,KAAK,aAAa,eAAe,UAAU;;AAGjF,MAAa,mBAAmB,KAAK,aAAa,QAAQ,WAAW,QAAQ;;;;;;AAO7E,SAAgB,kBAAkB,OAAmC;CACnE,OAAO,UAAU,YAAY,KAAA,IAAY,KAAK,aAAa,GAAG,MAAM,IAAI;AAC1E"}