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
package/dist/index.mjs CHANGED
@@ -1,36 +1,200 @@
1
- import { a as SKILLS_ROOT, n as HARNESS_DOC_PATH, r as PACKAGE_ROOT, t as ASSETS_ROOT } from "./paths-D_JlVmBk.mjs";
2
- import { a as SKILL_CONSUMED_FIELDS, c as parseFrontmatter, d as skillDroppedFields, f as validateAgentFrontmatter, i as MAX_SKILL_NAME_LENGTH, l as serializeAgentFrontmatter, n as AGENT_DROPPED_FIELDS, o as SKILL_DROPPED_FIELDS, p as validateSkillFrontmatter, r as FrontmatterError, s as agentDroppedFields, t as AGENT_CONSUMED_FIELDS, u as serializeSkillFrontmatter } from "./frontmatter-BQX3ekwP.mjs";
3
- import { join } from "node:path";
1
+ import { c as VENDORED_SKILLS_ROOT, i as PORT_ROOT, n as HARNESS_DOC_PATH, o as SKILLS_ROOT, r as PACKAGE_ROOT, s as SKILL_ROOTS, t as AUTHORED_SKILLS_ROOT } from "./paths-BT77khwm.mjs";
2
+ import { TOOL_NAME, apply as apply$1, createPstackSkillTool, readSkillResource, renderLoadedSkill } from "./skill.mjs";
3
+ import { basename, join } from "node:path";
4
4
  import { readFileSync, readdirSync } from "node:fs";
5
- //#region src/provider.ts
5
+ // src/internal/audit-context.ts
6
+ /** Default repository-relative directory for plans, trails, and orchestration state. */
7
+ const AUDIT_DIRECTORY = ".audit";
8
+ const AUDIT_CONTEXT = {
9
+ name: "pstack:audit-store",
10
+ order: 500,
11
+ text: `pstack writes working files that are not deliverables — plans, decision trails, and orchestration state — under \`${AUDIT_DIRECTORY}/\` in the repository unless the operator names another directory. Nothing outside the repository is assigned for this, and nothing resumes from that directory on its own: a resumed or recreated child must be handed its instructions again rather than told to re-read them. \`${AUDIT_DIRECTORY}/\` stays out of version control; commit a trail only when a reviewer needs it to trust the result.`,
12
+ required: true
13
+ };
6
14
  /**
7
- * The bundled pstack skill provider: one provider over the 55 generated skills
8
- * that ship inside this package.
9
- *
10
- * The provider contract below mirrors `@deepseek-ai/dsh-skill` 0.2.1-rc.3, which
11
- * was read through the host Inspect provider (`Service.listService` with
12
- * `service: "skills"`) and the installed type declarations. It is restated here
13
- * as a structural contract instead of imported so the plugin keeps zero runtime
14
- * imports from the host packages: a workspace-directory bundle is linked from
15
- * its checkout, where `@deepseek-ai/*` is not resolvable.
15
+ * Register the placement rule, tolerating a host without `systemPrompt`.
16
16
  *
17
- * Design constraints this module enforces, from the port design document §8.1:
18
- *
19
- * - The catalog is built once from the package assets and never watched. A
20
- * package update is the refresh boundary.
21
- * - A malformed bundled skill fails the whole index instead of disappearing
22
- * from the catalog, so a broken asset is a startup error rather than a skill
23
- * users silently cannot see.
24
- * - `get()` only accepts a locator this provider produced. Directory names are
25
- * never joined from caller input.
17
+ * The service is read through `get`, never as a property: a row whose `inject` does not
18
+ * name `systemPrompt` would throw on property access, and index must not inject it or a
19
+ * composition without a prompt registry would drop every bundled skill.
26
20
  */
21
+ function registerAuditContext(host) {
22
+ const registry = host.get?.("systemPrompt");
23
+ if (registry === void 0 || registry === null) return false;
24
+ const candidate = registry;
25
+ if (typeof candidate.context !== "function") return false;
26
+ candidate.context(AUDIT_CONTEXT);
27
+ return true;
28
+ }
29
+ // src/internal/frontmatter.ts
30
+ var FrontmatterError = class extends Error {
31
+ constructor(message) {
32
+ super(message);
33
+ this.name = "FrontmatterError";
34
+ }
35
+ };
36
+ const SKILL_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
37
+ const MAX_SKILL_NAME_LENGTH = 64;
38
+ /** Parse a leading `---` frontmatter block and the body after it. */
39
+ function parseFrontmatter(source) {
40
+ const eol = detectEol(source);
41
+ const lines = (eol === "\r\n" ? source.replaceAll("\r\n", "\n") : source).split("\n");
42
+ if (lines[0] !== "---") throw new FrontmatterError("frontmatter: file must start with a \"---\" line");
43
+ const closing = lines.indexOf("---", 1);
44
+ if (closing === -1) throw new FrontmatterError("frontmatter: missing closing \"---\" delimiter");
45
+ const data = parseBlock(lines.slice(1, closing));
46
+ const body = lines.slice(closing + 1).join("\n");
47
+ return {
48
+ data,
49
+ body: eol === "\r\n" ? body.replaceAll("\n", eol) : body
50
+ };
51
+ }
52
+ /** Read the fields a skill needs, ignoring every other upstream field. */
53
+ function validateSkillFrontmatter(data, source) {
54
+ const name = readName(data, source);
55
+ const description = readDescription(data, source);
56
+ const whenToUse = data["whenToUse"];
57
+ if (whenToUse !== void 0 && whenToUse.trim() === "") throw new FrontmatterError(`${source}: "whenToUse" must not be empty`);
58
+ return {
59
+ name,
60
+ description,
61
+ disableModelInvocation: readBoolean(data, "disable-model-invocation", source, false),
62
+ userInvocable: readBoolean(data, "user-invocable", source, true),
63
+ ...whenToUse === void 0 ? {} : { whenToUse }
64
+ };
65
+ }
66
+ function detectEol(source) {
67
+ if (!source.includes("\r\n")) return "\n";
68
+ const withoutCrlf = source.replaceAll("\r\n", "");
69
+ if (withoutCrlf.includes("\r") || withoutCrlf.includes("\n")) throw new FrontmatterError("frontmatter: mixed line endings are not supported");
70
+ return "\r\n";
71
+ }
72
+ function parseBlock(lines) {
73
+ const data = {};
74
+ for (let index = 0; index < lines.length; index += 1) {
75
+ const line = lines[index];
76
+ const trimmed = line.trim();
77
+ if (trimmed === "" || trimmed.startsWith("#")) continue;
78
+ if (trimmed !== line) throw new FrontmatterError(`frontmatter: unexpected indented line "${trimmed}"`);
79
+ const entry = /^([A-Za-z_][A-Za-z0-9_-]*):(.*)$/.exec(line);
80
+ if (entry === null) throw new FrontmatterError(`frontmatter: expected "key: value", got "${line}"`);
81
+ const key = entry[1];
82
+ const rest = entry[2];
83
+ if (rest !== "" && !rest.startsWith(" ")) throw new FrontmatterError(`frontmatter: missing space after "${key}:"`);
84
+ if (Object.hasOwn(data, key)) throw new FrontmatterError(`frontmatter: duplicate key "${key}"`);
85
+ const raw = rest.trim();
86
+ if (raw === ">" || raw === ">-" || raw === "|" || raw === "|-") {
87
+ const block = [];
88
+ let cursor = index + 1;
89
+ while (cursor < lines.length) {
90
+ const candidate = lines[cursor];
91
+ if (candidate.trim() !== "" && !candidate.startsWith(" ") && !candidate.startsWith(" ")) break;
92
+ block.push(candidate);
93
+ cursor += 1;
94
+ }
95
+ while (block.length > 0 && block.at(-1).trim() === "") block.pop();
96
+ if (block.length === 0) throw new FrontmatterError(`frontmatter: "${key}" has an empty ${raw} block`);
97
+ data[key] = parseBlockScalar(block, raw, key);
98
+ index = cursor - 1;
99
+ continue;
100
+ }
101
+ data[key] = parseScalar(raw, key);
102
+ }
103
+ return data;
104
+ }
105
+ function parseScalar(raw, key) {
106
+ if (raw === "") return "";
107
+ if (raw.startsWith("\"")) return parseDoubleQuoted(raw, key);
108
+ if (raw.startsWith("'")) return parseSingleQuoted(raw, key);
109
+ return raw;
110
+ }
111
+ function parseDoubleQuoted(raw, key) {
112
+ if (raw.length < 2 || !raw.endsWith("\"")) throw new FrontmatterError(`frontmatter: unterminated double-quoted value for "${key}"`);
113
+ const inner = raw.slice(1, -1);
114
+ let value = "";
115
+ for (let index = 0; index < inner.length; index += 1) {
116
+ const character = inner[index];
117
+ if (character !== "\\") {
118
+ value += character;
119
+ continue;
120
+ }
121
+ const escaped = inner[index += 1];
122
+ if (escaped === "\"") value += "\"";
123
+ else if (escaped === "\\") value += "\\";
124
+ else if (escaped === "n") value += "\n";
125
+ else throw new FrontmatterError(`frontmatter: unsupported escape "\\${escaped ?? ""}" in "${key}"`);
126
+ }
127
+ return value;
128
+ }
129
+ function parseSingleQuoted(raw, key) {
130
+ if (raw.length < 2 || !raw.endsWith("'")) throw new FrontmatterError(`frontmatter: unterminated single-quoted value for "${key}"`);
131
+ const inner = raw.slice(1, -1);
132
+ let value = "";
133
+ for (let index = 0; index < inner.length; index += 1) {
134
+ const character = inner[index];
135
+ if (character !== "'") {
136
+ value += character;
137
+ continue;
138
+ }
139
+ if (inner[index + 1] === "'") {
140
+ value += "'";
141
+ index += 1;
142
+ continue;
143
+ }
144
+ throw new FrontmatterError(`frontmatter: unescaped single quote in "${key}"`);
145
+ }
146
+ return value;
147
+ }
148
+ function parseBlockScalar(lines, indicator, key) {
149
+ const indents = lines.filter((line) => line.trim() !== "").map((line) => /^\s*/.exec(line)[0].length);
150
+ const indent = Math.min(...indents);
151
+ const content = lines.map((line) => line.trim() === "" ? "" : line.slice(indent));
152
+ const text = indicator.startsWith("|") ? content.join("\n") : fold(content);
153
+ if (text.trim() === "") throw new FrontmatterError(`frontmatter: "${key}" block is empty`);
154
+ return indicator.endsWith("-") ? text : `${text}\n`;
155
+ }
156
+ function fold(lines) {
157
+ const paragraphs = [[]];
158
+ for (const line of lines) if (line === "") paragraphs.push([]);
159
+ else paragraphs.at(-1).push(line);
160
+ return paragraphs.map((paragraph) => paragraph.join(" ")).join("\n");
161
+ }
162
+ function readName(data, source) {
163
+ const value = data["name"];
164
+ if (value === void 0 || value.trim() === "") throw new FrontmatterError(`${source}: missing "name"`);
165
+ if (!SKILL_NAME_PATTERN.test(value)) throw new FrontmatterError(`${source}: "name" must be kebab-case, got "${value}"`);
166
+ if (value.length > MAX_SKILL_NAME_LENGTH) throw new FrontmatterError(`${source}: "name" is longer than ${MAX_SKILL_NAME_LENGTH} characters`);
167
+ return value;
168
+ }
169
+ function readDescription(data, source) {
170
+ const value = data["description"];
171
+ if (value === void 0 || value.trim() === "") throw new FrontmatterError(`${source}: missing "description"`);
172
+ return value;
173
+ }
174
+ function readBoolean(data, key, source, fallback) {
175
+ const value = data[key];
176
+ if (value === void 0) return fallback;
177
+ if (value === "true") return true;
178
+ if (value === "false") return false;
179
+ throw new FrontmatterError(`${source}: "${key}" must be true or false, got "${value}"`);
180
+ }
181
+ // src/internal/skill-provider.ts
27
182
  /**
28
- * Standard precedence rank for packaged skill providers, re-exported by
29
- * `@deepseek-ai/dsh-skill` as `BUNDLED_SKILL_RANK`. Restated to keep the package
30
- * dependency-free; a mismatch only changes which provider wins a name collision.
183
+ * The bundled pstack skill provider: one provider over the generated skills and the
184
+ * independent skill trees that ship inside this package.
185
+ *
186
+ * Roots hold skills at different depths (`pstack/skills/<skill>`,
187
+ * `skills/vendored/<source>/<skill>`, `skills/authored/<skill>`), so discovery walks
188
+ * down until it finds a directory with a `SKILL.md` and stops there. A malformed
189
+ * bundled skill fails the whole index instead of disappearing from the catalog: a
190
+ * broken asset is a startup error, not a skill users silently cannot see.
191
+ *
192
+ * `get()` accepts only a locator this provider produced, so a caller cannot name an
193
+ * arbitrary path.
31
194
  */
195
+ /** Standard precedence rank for packaged skill providers. */
32
196
  const BUNDLED_SKILL_RANK = 600;
33
- /** Default provider name used when the row does not override it. */
197
+ /** Default provider name. */
34
198
  const DEFAULT_PROVIDER_NAME = "pstack";
35
199
  /** Raised when a bundled asset violates the provider contract. */
36
200
  var BundledSkillError = class extends Error {
@@ -40,31 +204,31 @@ var BundledSkillError = class extends Error {
40
204
  }
41
205
  };
42
206
  /**
43
- * Read and validate every bundled skill below one directory.
44
- *
45
- * This is the startup check: it runs before the provider registers, so a missing
46
- * `SKILL.md`, an invalid frontmatter block, or a name that disagrees with its
47
- * directory fails plugin activation with a path-qualified message instead of
48
- * dropping a skill from the catalog.
207
+ * Read and validate every bundled skill under every root.
49
208
  *
50
- * @param skillsRoot - absolute path of the directory holding the skill directories.
51
- * @returns validated skills keyed by absolute skill directory, sorted by name.
52
- * @throws {BundledSkillError} when the tree or any skill in it is malformed.
209
+ * A skill name may appear in only one root; a duplicate is a packaging mistake, so it
210
+ * fails activation rather than letting one silently shadow the other. A root that does
211
+ * not exist is skipped, but an empty merged catalog fails.
53
212
  */
54
- function loadBundledSkillIndex(skillsRoot) {
55
- let entries;
56
- try {
57
- entries = readdirSync(skillsRoot, { withFileTypes: true });
58
- } catch (error) {
59
- throw new BundledSkillError(`bundled skills: cannot read "${skillsRoot}": ${messageOf(error)}`);
213
+ function loadBundledSkillIndexes(roots) {
214
+ const merged = /* @__PURE__ */ new Map();
215
+ const byName = /* @__PURE__ */ new Map();
216
+ for (const root of roots) for (const skill of loadRoot(root).values()) {
217
+ const previous = byName.get(skill.name);
218
+ if (previous !== void 0) throw new BundledSkillError(`bundled skills: "${skill.name}" is offered by both "${previous}" and "${skill.directory}"; one name belongs to one source`);
219
+ byName.set(skill.name, skill.directory);
220
+ merged.set(skill.directory, skill);
60
221
  }
222
+ if (merged.size === 0) throw new BundledSkillError(`bundled skills: no skill directories under ${roots.map((root) => `"${root.path}"`).join(", ")}`);
223
+ return merged;
224
+ }
225
+ /** Validate every skill under one root. */
226
+ function loadRoot(root) {
61
227
  const index = /* @__PURE__ */ new Map();
62
- for (const entry of entries.sort((left, right) => left.name < right.name ? -1 : 1)) {
63
- const directory = join(skillsRoot, entry.name);
64
- if (!entry.isDirectory()) throw new BundledSkillError(`bundled skills: "${directory}" is not a skill directory; remove it or add a SKILL.md`);
228
+ for (const directory of discoverSkillDirectories(root.path)) {
65
229
  const instructionFile = join(directory, "SKILL.md");
66
230
  const frontmatter = readSkillFrontmatter(readSkillFile(instructionFile), instructionFile);
67
- if (frontmatter.name !== entry.name) throw new BundledSkillError(`${instructionFile}: skill name "${frontmatter.name}" does not match its directory "${entry.name}"`);
231
+ if (frontmatter.name !== basename(directory)) throw new BundledSkillError(`${instructionFile}: skill name "${frontmatter.name}" does not match its directory "${basename(directory)}"`);
68
232
  index.set(directory, {
69
233
  name: frontmatter.name,
70
234
  description: frontmatter.description,
@@ -77,15 +241,28 @@ function loadBundledSkillIndex(skillsRoot) {
77
241
  instructionFile
78
242
  });
79
243
  }
80
- if (index.size === 0) throw new BundledSkillError(`bundled skills: no skill directories under "${skillsRoot}"`);
81
244
  return index;
82
245
  }
246
+ /** Directories that hold a `SKILL.md`, discovered recursively. A found skill is a leaf. */
247
+ function discoverSkillDirectories(root) {
248
+ let entries;
249
+ try {
250
+ entries = readdirSync(root, { withFileTypes: true });
251
+ } catch (error) {
252
+ if (errorCode(error) === "ENOENT") return [];
253
+ throw new BundledSkillError(`bundled skills: cannot read "${root}": ${messageOf(error)}`);
254
+ }
255
+ if (entries.some((entry) => entry.isFile() && entry.name === "SKILL.md")) return [root];
256
+ const found = [];
257
+ const children = entries.filter((entry) => entry.isDirectory()).sort((left, right) => left.name < right.name ? -1 : 1);
258
+ for (const child of children) found.push(...discoverSkillDirectories(join(root, child.name)));
259
+ return found;
260
+ }
83
261
  /**
84
262
  * Build the provider over an already validated index.
85
263
  *
86
- * @param index - result of {@link loadBundledSkillIndex}.
87
- * @param providerName - registry name for this provider.
88
- * @returns a read-only provider whose catalog never changes until the package does.
264
+ * The catalog is sorted by name so two installs present the same order, and it never
265
+ * changes until the package does.
89
266
  */
90
267
  function createPstackSkillProvider(index, providerName = DEFAULT_PROVIDER_NAME) {
91
268
  const ordered = [...index.values()].sort((left, right) => left.name < right.name ? -1 : left.name > right.name ? 1 : 0);
@@ -139,19 +316,6 @@ function createPstackSkillProvider(index, providerName = DEFAULT_PROVIDER_NAME)
139
316
  }
140
317
  };
141
318
  }
142
- /**
143
- * Load the index and build the provider in one step, failing on a malformed tree.
144
- *
145
- * `apply()` uses this exact function, so the startup failure path and the
146
- * provider used in tests are the same code.
147
- *
148
- * @param skillsRoot - absolute path of the bundled skill root.
149
- * @param providerName - registry name for this provider.
150
- * @returns the provider over the validated index.
151
- */
152
- function createPstackSkillProviderFromRoot(skillsRoot, providerName = DEFAULT_PROVIDER_NAME) {
153
- return createPstackSkillProvider(loadBundledSkillIndex(skillsRoot), providerName);
154
- }
155
319
  function asBundledSkillLocator(locator) {
156
320
  if (typeof locator !== "object" || locator === null) return void 0;
157
321
  const candidate = locator;
@@ -171,7 +335,6 @@ function readSkillFile(instructionFile) {
171
335
  throw new BundledSkillError(`bundled skills: cannot read "${instructionFile}": ${messageOf(error)}`);
172
336
  }
173
337
  }
174
- /** Parse and validate one skill header, reporting failures as bundled-asset errors. */
175
338
  function readSkillFrontmatter(text, instructionFile) {
176
339
  try {
177
340
  const { data } = parseFrontmatter(text);
@@ -201,72 +364,36 @@ function errorCode(error) {
201
364
  function messageOf(error) {
202
365
  return error instanceof Error ? error.message : String(error);
203
366
  }
204
- //#endregion
205
- //#region src/index.ts
367
+ // src/index.ts
206
368
  /**
207
- * dsh-pstack Host entry.
369
+ * dsh-pstack Host entry: the bundled skill provider and `pstack_skill`.
208
370
  *
209
- * Unit 2 ships one minimal capability: a single `ctx.skills` provider over the
210
- * generated assets in this package. Delegation, restricted history, roles, and
211
- * the worktree integration are later units and are deliberately absent here.
371
+ * One `ctx.skills` provider serves the generated pstack tree and the independent skill
372
+ * trees. The catalog is built once at activation and never watched; reinstalling the
373
+ * package is the refresh boundary. A malformed bundled skill fails activation with a
374
+ * path-qualified error instead of removing one skill from the catalog.
212
375
  *
213
- * The provider contract types live in `./provider.ts` and are structural copies
214
- * of the `@deepseek-ai/dsh-skill` 0.2.1-rc.3 declarations, so this module imports
215
- * nothing from the host packages at runtime.
376
+ * `pstack_skill` is registered from the same row because it is the other half of the
377
+ * provider: the provider keeps hidden skills out of the model catalog, and the tool
378
+ * gives trusted pstack routing a way to load them by name.
216
379
  */
217
- /** Plugin name used by Loader diagnostics for this row. */
380
+ /** Cordis row name, used by Loader diagnostics. */
218
381
  const name = "pstack";
219
- /** The provider needs the skill registry and nothing else. */
220
- const inject = ["skills"];
382
+ /** The row needs the skill registry and the tool registry. */
383
+ const inject = ["skills", "tools"];
221
384
  /**
222
- * Minimal Standard Schema validator for this plugin's row config.
223
- *
224
- * Cordis validates `apply()`'s second argument with `Config["~standard"]` and
225
- * substitutes the returned `value`, so an omitted row `config` resolves to the
226
- * documented defaults without a schemastery dependency.
227
- */
228
- const Config = { "~standard": {
229
- version: 1,
230
- vendor: "dsh-pstack",
231
- validate(value) {
232
- if (value === void 0 || value === null) return { value: { providerName: DEFAULT_PROVIDER_NAME } };
233
- if (typeof value !== "object" || Array.isArray(value)) return { issues: [{ message: "config must be a mapping" }] };
234
- const issues = [];
235
- const record = value;
236
- for (const key of Object.keys(record)) if (key !== "providerName") issues.push({
237
- message: `unknown field "${key}"`,
238
- path: [key]
239
- });
240
- const providerName = record["providerName"];
241
- if (providerName === void 0) return issues.length > 0 ? { issues } : { value: { providerName: DEFAULT_PROVIDER_NAME } };
242
- if (typeof providerName !== "string" || providerName.trim() === "") {
243
- issues.push({
244
- message: "providerName must be a non-empty string",
245
- path: ["providerName"]
246
- });
247
- return { issues };
248
- }
249
- return issues.length > 0 ? { issues } : { value: { providerName } };
250
- }
251
- } };
252
- /**
253
- * Register the bundled pstack skill provider.
254
- *
255
- * The bundled tree is validated before the provider registers, so a malformed
256
- * `SKILL.md` fails plugin activation with a path-qualified error instead of
257
- * removing one skill from the catalog. Nothing is copied out of the package and
258
- * nothing is watched: reinstalling the package is the refresh boundary.
385
+ * Register the bundled pstack skill provider and the trusted loader.
259
386
  *
260
- * @param ctx - host context carrying the skill registry.
261
- * @param config - validated row config.
262
- * @throws {import("./provider.ts").BundledSkillError} when the bundled tree is malformed.
387
+ * @param ctx - host context carrying the skill and tool registries.
388
+ * @throws {import("./internal/skill-provider.ts").BundledSkillError} when the tree is malformed.
263
389
  */
264
- function apply(ctx, config = {}) {
265
- const providerName = config.providerName ?? "pstack";
266
- const index = loadBundledSkillIndex(SKILLS_ROOT);
267
- ctx.skills.registerProvider((_control) => createPstackSkillProvider(index, providerName));
390
+ function apply(ctx) {
391
+ const index = loadBundledSkillIndexes(SKILL_ROOTS);
392
+ ctx.skills.registerProvider((_control) => createPstackSkillProvider(index, DEFAULT_PROVIDER_NAME));
393
+ registerAuditContext(ctx);
394
+ apply$1({
395
+ skills: ctx.skills,
396
+ tools: ctx.tools
397
+ });
268
398
  }
269
- //#endregion
270
- export { AGENT_CONSUMED_FIELDS, AGENT_DROPPED_FIELDS, ASSETS_ROOT, BUNDLED_SKILL_RANK, BundledSkillError, Config, DEFAULT_PROVIDER_NAME, FrontmatterError, HARNESS_DOC_PATH, MAX_SKILL_NAME_LENGTH, PACKAGE_ROOT, SKILLS_ROOT, SKILL_CONSUMED_FIELDS, SKILL_DROPPED_FIELDS, agentDroppedFields, apply, createPstackSkillProvider, createPstackSkillProviderFromRoot, inject, loadBundledSkillIndex, name, parseFrontmatter, serializeAgentFrontmatter, serializeSkillFrontmatter, skillDroppedFields, validateAgentFrontmatter, validateSkillFrontmatter };
271
-
272
- //# sourceMappingURL=index.mjs.map
399
+ export { AUTHORED_SKILLS_ROOT, BUNDLED_SKILL_RANK, BundledSkillError, DEFAULT_PROVIDER_NAME, HARNESS_DOC_PATH, PACKAGE_ROOT, PORT_ROOT, TOOL_NAME as PSTACK_SKILL_TOOL_NAME, SKILLS_ROOT, SKILL_ROOTS, VENDORED_SKILLS_ROOT, apply, createPstackSkillProvider, createPstackSkillTool, inject, loadBundledSkillIndexes, name, readSkillResource, renderLoadedSkill };
@@ -0,0 +1,44 @@
1
+ import { _ as ToolsHost, g as ToolDefinition, s as LlmHost } from "./host-contract-CUPSpeNk.mjs";
2
+ /** Cordis row name, used by Loader diagnostics. */
3
+ export declare const name = "pstack-models";
4
+ /** The hard dependencies: the adapter registry and the tool registry. */
5
+ export declare const inject: string[];
6
+ /** Model-facing tool name. */
7
+ export declare const TOOL_NAME = "pstack_models";
8
+ export interface ModelEntry {
9
+ /** `<provider>/<model>`, the exact route a role line writes. */
10
+ readonly route: string;
11
+ readonly id: string;
12
+ readonly name: string;
13
+ readonly description?: string;
14
+ readonly contextWindow?: number;
15
+ readonly maxTokens?: number;
16
+ /** Advertised reasoning efforts, in the adapter's least-to-greatest order. */
17
+ readonly efforts: readonly string[];
18
+ readonly defaultEffort?: string;
19
+ /** Set when this one model could not be resolved; the route is still listed. */
20
+ readonly error?: string;
21
+ }
22
+ export interface ProviderEntry {
23
+ readonly provider: string;
24
+ readonly name: string;
25
+ readonly models: readonly ModelEntry[];
26
+ /** Set when this provider's model list could not be read. */
27
+ readonly error?: string;
28
+ }
29
+ export interface CatalogueResult {
30
+ readonly providers: readonly ProviderEntry[];
31
+ readonly truncated: boolean;
32
+ readonly providerFilter?: string;
33
+ }
34
+ /** Collect the catalogue from the live adapters. */
35
+ export declare function collectCatalogue(llm: LlmHost, providerFilter: string | undefined, signal: AbortSignal): Promise<CatalogueResult>;
36
+ export declare function renderCatalogue(result: CatalogueResult): string;
37
+ export declare function createPstackModelsTool(llm: LlmHost): ToolDefinition;
38
+ /** The slice of the Cordis context this row uses. */
39
+ export interface PstackModelsHost {
40
+ readonly llm: LlmHost;
41
+ readonly tools: ToolsHost;
42
+ }
43
+ /** Register `pstack_models`. */
44
+ export declare function apply(ctx: PstackModelsHost): void;