@canonical/pragma-cli 0.32.0 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/README.md +72 -0
  2. package/dist/pragma +0 -0
  3. package/package.json +19 -15
  4. package/pragma.conf.ts +664 -0
  5. package/src/bin.ts +15 -6
  6. package/src/capabilities/block.parity.test.ts +250 -0
  7. package/src/capabilities/capabilities/capabilities.render.ts +3 -2
  8. package/src/capabilities/capabilities/capabilities.test.ts +10 -1
  9. package/src/capabilities/capabilities/capabilities.verb.ts +32 -14
  10. package/src/capabilities/capabilities/catalog.ts +20 -8
  11. package/src/capabilities/capabilities/hints.ts +21 -36
  12. package/src/capabilities/capabilities/types.ts +2 -0
  13. package/src/capabilities/colophon/collectColophon.ts +34 -19
  14. package/src/capabilities/colophon/colophon.render.test.ts +31 -4
  15. package/src/capabilities/colophon/colophon.render.ts +13 -4
  16. package/src/capabilities/colophon/colophon.test.ts +3 -3
  17. package/src/capabilities/colophon/colophon.verb.ts +11 -4
  18. package/src/capabilities/colophon/markdownTerminal.ts +33 -14
  19. package/src/capabilities/colophon/types.ts +16 -7
  20. package/src/capabilities/config/collectConfigShow.test.ts +57 -0
  21. package/src/capabilities/config/collectConfigShow.ts +41 -4
  22. package/src/capabilities/config/fields.ts +10 -108
  23. package/src/capabilities/config/set.test.ts +6 -6
  24. package/src/capabilities/config/set.verb.ts +12 -8
  25. package/src/capabilities/config/show.render.test.ts +137 -0
  26. package/src/capabilities/config/show.render.ts +57 -16
  27. package/src/capabilities/config/show.verb.ts +9 -8
  28. package/src/capabilities/config/types.ts +8 -0
  29. package/src/capabilities/create/byteEquality.subprocess.test.ts +1 -1
  30. package/src/capabilities/create/byteEquality.test.ts +82 -101
  31. package/src/capabilities/create/compiledCreate.subprocess.test.ts +53 -16
  32. package/src/capabilities/create/constants.ts +75 -0
  33. package/src/capabilities/create/create.mcp.test.ts +2 -2
  34. package/src/capabilities/create/create.test.ts +192 -16
  35. package/src/capabilities/create/create.verb.ts +208 -79
  36. package/src/capabilities/create/index.ts +2 -10
  37. package/src/capabilities/create/pickGenerator.ts +34 -28
  38. package/src/capabilities/create/templates.embedded.generated.ts +4 -29
  39. package/src/capabilities/create/types.ts +10 -6
  40. package/src/capabilities/{standard/parity.test.ts → distribution.parity.test.ts} +24 -14
  41. package/src/capabilities/distribution.test.ts +120 -0
  42. package/src/capabilities/distribution.ts +59 -0
  43. package/src/capabilities/doctor/checks/checkConfigFile.ts +6 -5
  44. package/src/capabilities/doctor/checks/checkKeStore.ts +2 -2
  45. package/src/capabilities/doctor/checks/checkMcpCommands.ts +6 -0
  46. package/src/capabilities/doctor/checks/checkMcpConfigured.ts +15 -8
  47. package/src/capabilities/doctor/checks/checkPackageRefs.ts +79 -45
  48. package/src/capabilities/doctor/checks/checkPragmaVersion.ts +3 -2
  49. package/src/capabilities/doctor/checks/checkShellCompletions.test.ts +61 -11
  50. package/src/capabilities/doctor/checks/checkShellCompletions.ts +63 -23
  51. package/src/capabilities/doctor/checks/checkSkillsSymlinked.ts +3 -2
  52. package/src/capabilities/doctor/checks/deriveBand.test.ts +42 -0
  53. package/src/capabilities/doctor/checks/deriveBand.ts +28 -0
  54. package/src/capabilities/doctor/doctor.render.test.ts +170 -0
  55. package/src/capabilities/doctor/doctor.render.ts +117 -34
  56. package/src/capabilities/doctor/doctor.test.ts +68 -9
  57. package/src/capabilities/doctor/doctor.verb.ts +6 -2
  58. package/src/capabilities/doctor/runChecks.ts +33 -9
  59. package/src/capabilities/doctor/types.ts +16 -1
  60. package/src/capabilities/emptyRecovery.test.ts +32 -15
  61. package/src/capabilities/graph/inspect.verb.ts +3 -2
  62. package/src/capabilities/graph/query.verb.ts +3 -2
  63. package/src/capabilities/graph/runQuery.ts +8 -5
  64. package/src/capabilities/index.ts +22 -18
  65. package/src/capabilities/info/collectInfo.ts +10 -6
  66. package/src/capabilities/info/info.render.ts +3 -2
  67. package/src/capabilities/info/info.verb.ts +3 -2
  68. package/src/capabilities/lazy.test.ts +93 -2
  69. package/src/capabilities/ontology/index.ts +10 -3
  70. package/src/capabilities/ontology/ontology.test.ts +157 -5
  71. package/src/capabilities/ontology/verbs.ts +203 -104
  72. package/src/capabilities/prompt/prompt.render.test.ts +94 -0
  73. package/src/capabilities/prompt/prompt.render.ts +23 -6
  74. package/src/capabilities/prompt/prompt.test.ts +68 -1
  75. package/src/capabilities/prompt/verbs.ts +24 -11
  76. package/src/capabilities/reference.test.ts +32 -0
  77. package/src/capabilities/resources/provider.ts +58 -25
  78. package/src/capabilities/resources/resources.test.ts +176 -21
  79. package/src/capabilities/scopeTypeSync.test.ts +37 -0
  80. package/src/capabilities/setup/index.ts +7 -1
  81. package/src/capabilities/setup/operations/setupCompletions.ts +49 -16
  82. package/src/capabilities/setup/operations/setupGenerator.ts +166 -63
  83. package/src/capabilities/setup/operations/setupLsp.ts +56 -12
  84. package/src/capabilities/setup/operations/setupMcp.ts +216 -39
  85. package/src/capabilities/setup/operations/setupSkills.ts +10 -4
  86. package/src/capabilities/setup/setup.render.test.ts +109 -0
  87. package/src/capabilities/setup/setup.render.ts +61 -14
  88. package/src/capabilities/setup/setup.test.ts +352 -1
  89. package/src/capabilities/setup/setup.verb.ts +68 -9
  90. package/src/capabilities/setup/shell.ts +29 -3
  91. package/src/capabilities/setup/types.ts +59 -2
  92. package/src/capabilities/shared/bands.ts +16 -0
  93. package/src/capabilities/skill/discover.ts +11 -5
  94. package/src/capabilities/skill/render.ts +4 -5
  95. package/src/capabilities/skill/verbs.ts +7 -7
  96. package/src/capabilities/sources/collectStatus.ts +69 -49
  97. package/src/capabilities/sources/index.ts +1 -1
  98. package/src/capabilities/sources/installSkills.ts +2 -2
  99. package/src/capabilities/sources/runUpdate.ts +146 -98
  100. package/src/capabilities/sources/sources.test.ts +264 -84
  101. package/src/capabilities/sources/status.render.test.ts +94 -0
  102. package/src/capabilities/sources/status.render.ts +55 -33
  103. package/src/capabilities/sources/status.verb.ts +15 -8
  104. package/src/capabilities/sources/types.ts +18 -25
  105. package/src/capabilities/sources/update.render.ts +9 -2
  106. package/src/capabilities/sources/update.verb.ts +12 -23
  107. package/src/capabilities/surface.test.ts +65 -17
  108. package/src/capabilities/tier.parity.test.ts +144 -0
  109. package/src/capabilities/upgrade/upgrade.verb.ts +7 -3
  110. package/src/constants.test.ts +9 -7
  111. package/src/constants.ts +49 -23
  112. package/src/identity.test.ts +333 -0
  113. package/src/index.ts +2 -2
  114. package/src/kernel/completion/__snapshots__/emitScripts.test.ts.snap +18 -16
  115. package/src/kernel/completion/complete.test.ts +3 -5
  116. package/src/kernel/completion/emitScripts.test.ts +1 -1
  117. package/src/kernel/completion/emitScripts.ts +4 -2
  118. package/src/kernel/completion/entitySource.test.ts +185 -41
  119. package/src/kernel/completion/entitySource.ts +131 -113
  120. package/src/kernel/completion/model.test.ts +3 -3
  121. package/src/kernel/completion/model.ts +11 -1
  122. package/src/kernel/completion/parse.test.ts +2 -4
  123. package/src/kernel/completion/safety.test.ts +82 -36
  124. package/src/kernel/completion/shellDrive.test.ts +592 -0
  125. package/src/kernel/completion/templates/fish.ts +28 -6
  126. package/src/kernel/completion/types.ts +3 -3
  127. package/src/kernel/config/__snapshots__/firstRun.test.ts.snap +1 -1
  128. package/src/kernel/config/defaults.test.ts +85 -0
  129. package/src/kernel/config/defaults.ts +12 -23
  130. package/src/kernel/config/evaluateProjectConfig.ts +2 -3
  131. package/src/kernel/config/findProjectConfig.ts +4 -3
  132. package/src/kernel/config/firstRun.ts +12 -5
  133. package/src/kernel/config/globalConfig.ts +2 -2
  134. package/src/kernel/config/index.ts +4 -5
  135. package/src/kernel/config/paths.ts +17 -17
  136. package/src/kernel/config/readConfig.test.ts +242 -6
  137. package/src/kernel/config/readConfig.ts +8 -8
  138. package/src/kernel/config/schema.test.ts +50 -0
  139. package/src/kernel/config/schema.ts +97 -10
  140. package/src/kernel/config/types.ts +73 -19
  141. package/src/kernel/copy.test.ts +453 -0
  142. package/src/kernel/error/PragmaError.test.ts +5 -5
  143. package/src/kernel/error/constants.ts +3 -2
  144. package/src/kernel/error/index.ts +1 -1
  145. package/src/kernel/error/recovery.test.ts +22 -45
  146. package/src/kernel/error/recovery.ts +22 -27
  147. package/src/kernel/error/renderError.ts +1 -1
  148. package/src/kernel/error/types.ts +5 -4
  149. package/src/kernel/packs/collect.test.ts +195 -11
  150. package/src/kernel/packs/collect.ts +213 -58
  151. package/src/kernel/packs/compile.test.ts +163 -7
  152. package/src/kernel/packs/compile.ts +15 -12
  153. package/src/kernel/packs/disclosure.test.ts +5 -2
  154. package/src/kernel/packs/graphql/fetchGraphqlLookup.ts +11 -10
  155. package/src/kernel/packs/graphqlSource.test.ts +6 -3
  156. package/src/kernel/packs/iri.ts +5 -7
  157. package/src/kernel/packs/renderPack.ts +5 -3
  158. package/src/kernel/packs/resolveEntity.ts +21 -17
  159. package/src/kernel/packs/runBodies.ts +15 -14
  160. package/src/kernel/packs/schema.ts +96 -10
  161. package/src/kernel/packs/sparql/runSelect.test.ts +104 -10
  162. package/src/kernel/packs/sparql/runSelect.ts +73 -34
  163. package/src/kernel/packs/toolDescription.test.ts +10 -2
  164. package/src/kernel/packs/types.ts +39 -4
  165. package/src/kernel/packs/uniqueness.ts +4 -4
  166. package/src/kernel/project/cli/buildProgram.test.ts +60 -11
  167. package/src/kernel/project/cli/buildProgram.ts +11 -0
  168. package/src/kernel/project/cli/dispatch.test.ts +67 -0
  169. package/src/kernel/project/cli/dispatch.ts +34 -12
  170. package/src/kernel/project/cli/globalFlags.test.ts +12 -4
  171. package/src/kernel/project/cli/globalFlags.ts +14 -14
  172. package/src/kernel/project/cli/helpFormat.ts +1 -1
  173. package/src/kernel/project/cli/rootHelp.ts +109 -107
  174. package/src/kernel/project/mcp/buildServer.ts +11 -6
  175. package/src/kernel/project/mcp/instructions.ts +12 -7
  176. package/src/kernel/project/mcp/mcpError.ts +52 -0
  177. package/src/kernel/project/mcp/parity.test.ts +39 -1
  178. package/src/kernel/project/mcp/prompts/prompts.test.ts +128 -5
  179. package/src/kernel/project/mcp/prompts/provider.ts +51 -7
  180. package/src/kernel/project/mcp/prompts/source.ts +68 -67
  181. package/src/kernel/project/mcp/registerVerb.ts +25 -6
  182. package/src/kernel/project/mcp/serve.ts +11 -3
  183. package/src/kernel/project/mcp/toolDescriptions.test.ts +6 -2
  184. package/src/kernel/render/disclosure.ts +4 -2
  185. package/src/kernel/render/formatters.ts +5 -4
  186. package/src/kernel/render/prefixes.test.ts +36 -0
  187. package/src/kernel/render/prefixes.ts +40 -13
  188. package/src/kernel/render/renderers.test.ts +35 -1
  189. package/src/kernel/render/renderers.ts +25 -7
  190. package/src/kernel/render/style.test.ts +31 -0
  191. package/src/kernel/render/style.ts +74 -0
  192. package/src/kernel/runtime/graphpack/build.ts +57 -3
  193. package/src/kernel/runtime/graphpack/buildIndex.test.ts +149 -0
  194. package/src/kernel/runtime/graphpack/buildIndex.ts +173 -50
  195. package/src/kernel/runtime/graphpack/embedded/pack.generated.ts +5 -8
  196. package/src/kernel/runtime/graphpack/embedded/pack.index.generated.ts +3 -4
  197. package/src/kernel/runtime/graphpack/embedded/pack.stories.generated.ts +3 -0
  198. package/src/kernel/runtime/graphpack/embedded.ts +37 -11
  199. package/src/kernel/runtime/graphpack/graphpack.test.ts +274 -6
  200. package/src/kernel/runtime/graphpack/hash.ts +3 -2
  201. package/src/kernel/runtime/graphpack/index.ts +1 -1
  202. package/src/kernel/runtime/graphpack/manifest.ts +114 -12
  203. package/src/kernel/runtime/graphpack/read.ts +32 -22
  204. package/src/kernel/runtime/graphpack/schemas.ts +74 -0
  205. package/src/kernel/runtime/graphpack/stories.ts +84 -0
  206. package/src/kernel/runtime/graphpack/types.ts +72 -45
  207. package/src/kernel/runtime/loadSession.ts +4 -12
  208. package/src/kernel/runtime/paths.ts +64 -15
  209. package/src/kernel/runtime/probe.test.ts +8 -4
  210. package/src/kernel/runtime/readEntity.ts +6 -5
  211. package/src/kernel/runtime/refs/gitOps.ts +1 -19
  212. package/src/kernel/runtime/refs/parseRef.ts +7 -7
  213. package/src/kernel/runtime/refs/resolve.ts +141 -65
  214. package/src/kernel/runtime/resolveSources.test.ts +63 -24
  215. package/src/kernel/runtime/resolveSources.ts +36 -25
  216. package/src/kernel/runtime/storeReadiness.ts +62 -0
  217. package/src/kernel/runtime/storeless.test.ts +1 -1
  218. package/src/kernel/runtime/types.ts +1 -1
  219. package/src/kernel/runtime/wasmEmbed.test.ts +25 -20
  220. package/src/kernel/spec/emitReference.test.ts +196 -0
  221. package/src/kernel/spec/emitReference.ts +624 -0
  222. package/src/kernel/spec/emitSurface.ts +13 -7
  223. package/src/kernel/spec/index.ts +2 -0
  224. package/src/kernel/spec/surfaceConformance.test.ts +2 -2
  225. package/src/kernel/spec/surfaceConformance.ts +8 -0
  226. package/src/kernel/spec/types.ts +29 -9
  227. package/src/kernel/spec/validate.ts +2 -1
  228. package/src/kernel/vocabulary.test.ts +164 -0
  229. package/src/kernel/vocabulary.ts +146 -0
  230. package/src/testing/PARITY_GAPS.ts +9 -3
  231. package/src/testing/behavioral/README.md +3 -3
  232. package/src/testing/behavioral/autoLlm.e2e.test.ts +12 -2
  233. package/src/testing/behavioral/completion.test.ts +21 -8
  234. package/src/testing/behavioral/disclosure.test.ts +12 -0
  235. package/src/testing/behavioral/docExamples.test.ts +283 -0
  236. package/src/testing/behavioral/errorMatrix.mcp.test.ts +4 -3
  237. package/src/testing/behavioral/errorMatrix.storeless.test.ts +3 -2
  238. package/src/testing/behavioral/exitCodes.e2e.test.ts +6 -5
  239. package/src/testing/behavioral/harness.foundation.test.ts +14 -5
  240. package/src/testing/behavioral/journeys.cli.test.ts +116 -73
  241. package/src/testing/behavioral/journeys.defaultPack.test.ts +477 -0
  242. package/src/testing/behavioral/journeys.firstInstall.test.ts +167 -0
  243. package/src/testing/behavioral/journeys.interactiveTty.e2e.test.ts +66 -0
  244. package/src/testing/behavioral/journeys.livePack.e2e.test.ts +129 -0
  245. package/src/testing/behavioral/journeys.mcpLifecycle.mcp.test.ts +179 -0
  246. package/src/testing/behavioral/journeys.packageStories.test.ts +188 -0
  247. package/src/testing/behavioral/liveReadSurface.ts +4 -3
  248. package/src/testing/behavioral/mcpSurface.test.ts +10 -5
  249. package/src/testing/behavioral/staleCommands.test.ts +86 -0
  250. package/src/testing/eval/__snapshots__/eval.test.ts.snap +9 -9
  251. package/src/testing/eval/cases/assembly.ts +16 -9
  252. package/src/testing/eval/cases/effectful.ts +31 -16
  253. package/src/testing/eval/cases/readNouns.ts +23 -18
  254. package/src/testing/eval/cases/stable.ts +5 -1
  255. package/src/testing/eval/eval.test.ts +7 -1
  256. package/src/testing/fixtures/fixtureCapability.ts +201 -1
  257. package/src/testing/fixtures/graph/canonical.ts +6 -3
  258. package/src/testing/fixtures/graph/defaultPack.ts +179 -0
  259. package/src/testing/fixtures/graph/owlExport.ts +97 -0
  260. package/src/testing/helpers/extractSnippets.ts +29 -0
  261. package/src/testing/helpers/fixtureGraph.ts +33 -16
  262. package/src/testing/helpers/golden.ts +1 -1
  263. package/src/testing/helpers/packRuntime.ts +2 -3
  264. package/src/testing/helpers/projectCli.ts +2 -1
  265. package/src/testing/helpers/projectMcp.ts +6 -0
  266. package/src/testing/perf/budgets.test.ts +4 -0
  267. package/src/testing/perf/budgets.ts +22 -7
  268. package/src/testing/perf/globalSetup.ts +121 -6
  269. package/src/types.ts +2 -2
  270. package/src/capabilities/block/blockList.verb.ts +0 -150
  271. package/src/capabilities/block/index.ts +0 -25
  272. package/src/capabilities/block/pack.ts +0 -155
  273. package/src/capabilities/block/parity.test.ts +0 -180
  274. package/src/capabilities/block/tierChain.ts +0 -78
  275. package/src/capabilities/colophon/pragmaColophon.ts +0 -66
  276. package/src/capabilities/config/field.test.ts +0 -188
  277. package/src/capabilities/modifier/index.ts +0 -15
  278. package/src/capabilities/modifier/pack.ts +0 -64
  279. package/src/capabilities/standard/index.ts +0 -18
  280. package/src/capabilities/standard/pack.ts +0 -128
  281. package/src/capabilities/tier/index.ts +0 -19
  282. package/src/capabilities/tier/lookup.render.ts +0 -34
  283. package/src/capabilities/tier/lookup.test.ts +0 -68
  284. package/src/capabilities/tier/lookup.verb.ts +0 -44
  285. package/src/capabilities/tier/pack.ts +0 -28
  286. package/src/capabilities/tier/runLookup.ts +0 -59
  287. package/src/capabilities/token/addConfig.render.ts +0 -27
  288. package/src/capabilities/token/addConfig.test.ts +0 -62
  289. package/src/capabilities/token/addConfig.verb.ts +0 -40
  290. package/src/capabilities/token/index.ts +0 -19
  291. package/src/capabilities/token/pack.ts +0 -58
  292. package/src/capabilities/token/runAddConfig.ts +0 -95
  293. package/src/kernel/completion/bashDrive.test.ts +0 -73
  294. package/src/kernel/runtime/graphpack/embedded/sample.ttl +0 -39
  295. package/src/kernel/runtime/lock.ts +0 -90
package/pragma.conf.ts ADDED
@@ -0,0 +1,664 @@
1
+ /**
2
+ * The pragma distribution config — identity, default packs, and the read
3
+ * stories those packs supply.
4
+ *
5
+ * Consumed three times: statically imported by `src/kernel/config/defaults.ts`
6
+ * as the lowest config layer (compiled into the binary — no fs), by
7
+ * `src/capabilities/distribution.ts` (which compiles the declared stories into
8
+ * capability modules at module load), and at build time by the bundler. A
9
+ * NON-magic name on purpose: `findProjectConfig` only discovers
10
+ * `pragma.config.{ts,js}`, so this file is never mistaken for a project config.
11
+ * Validated by the same `parseRawConfig` as every layer.
12
+ *
13
+ * INERT DATA. It must never gain a value import: `src/constants.ts` statically
14
+ * imports it to project the program's identity, so anything that runs at this
15
+ * module's load runs on `--help`, `__complete` and `--version`. That also makes
16
+ * the reverse edge impossible — importing `constants.js` from here is a
17
+ * temporal-dead-zone cycle. It is also why no string below names the binary
18
+ * except `name` itself: an `emptyRecovery.cli` is the command WITHOUT the
19
+ * binary name, and the renderer prepends the consuming distribution's.
20
+ * `capabilities/lazy.test.ts` pins both halves of that.
21
+ */
22
+
23
+ import type { RawConfig } from "./src/kernel/config/types.js";
24
+ import type { PackDefinition } from "./src/kernel/packs/types.js";
25
+
26
+ /**
27
+ * The design-system domain colophon — the ontology + graph story, surfaced by
28
+ * `pragma colophon` after pragma's own. Declared on the flagship UI-block noun
29
+ * because `block` most embodies the design system; it narrates the DOMAIN (what
30
+ * the graph models), not the toolchain (pragma's built-in section).
31
+ */
32
+ const DESIGN_SYSTEM_COLOPHON = `The Canonical design system is a **knowledge graph**, not a component library.
33
+ Every block, token, modifier, standard, and tier is a node in an RDF store,
34
+ described by the \`ds:\` ontology and queried the same way whether you reach it
35
+ over GraphQL or raw SPARQL.
36
+
37
+ ## What the graph models
38
+
39
+ - **Blocks** — components, patterns, layouts, and subcomponents (the \`ds:UIBlock\`
40
+ family). A block carries its anatomy, guidelines, and \`when to use\` / \`when
41
+ not to use\` narrative as graph properties, not prose in a wiki.
42
+ - **Modifiers** — families of variant values (\`ds:hasModifierFamily\` →
43
+ \`ds:hasModifier\`) a block composes, so a variant is a relationship, not a
44
+ string.
45
+ - **Tokens** — the themeable design values, resolved per theme.
46
+ - **Standards** — the do / don't coding guidance, categorized and linked to the
47
+ blocks they govern.
48
+
49
+ ## How it fits together
50
+
51
+ - **Tiers** are a hierarchy (\`global\` > \`apps\` > \`apps/lxd\`): a lower tier
52
+ inherits and overrides the blocks of its ancestors, so scoping a query to a
53
+ tier walks that chain.
54
+ - **Channels** (\`normal\`, \`experimental\`, \`prerelease\`) gate visibility, so an
55
+ in-progress block never leaks into a stable answer.
56
+
57
+ ## Why RDF
58
+
59
+ One graph makes every relationship first-class and queryable: \`block lookup\`
60
+ follows edges to modifiers and subcomponents, \`graph query\` runs arbitrary
61
+ SPARQL, and \`ontology show\` reads the schema itself. The store is built once
62
+ by \`sources update\` and addressed by content hash, so the domain you query is
63
+ exactly the domain that was published.`;
64
+
65
+ /**
66
+ * The read stories the design-system pack supplies — `block`, `token`,
67
+ * `modifier` and `tier` as declared data rather than code.
68
+ *
69
+ * The association with the pack is the point: when `@canonical/design-system`
70
+ * starts shipping its own `stories/*.json`, this block is deleted and the
71
+ * package tier takes over with no code change here or anywhere else. The local
72
+ * `readonly PackDefinition[]` annotation is what type-checks them —
73
+ * `PackSource.stories` is deliberately `readonly unknown[]`, because the config
74
+ * layer does not know the pack grammar (`parsePackDefinition` does).
75
+ */
76
+ const designSystemStories: readonly PackDefinition[] = [
77
+ // `block list` is declared content (L-OPEN-9): one unfiltered SELECT over
78
+ // the four UIBlock classes, listing ALL blocks — experimental and alpha ones
79
+ // included, for everyone — until filtering returns in declared form. The
80
+ // hand-written tier-chain/channel filtering (and its `--all-tiers` escape)
81
+ // is removed with the code, an owner-signed consequence. Display parity
82
+ // lives IN the query: `VALUES ?class` closes the type set, so the BINDs
83
+ // that derive `name` (declared name, else the IRI's local name), `type`
84
+ // (lowercased class local name), and `tier` (tier IRI's local name) operate
85
+ // over known shapes — the `standard` story's BIND/COALESCE precedent.
86
+ //
87
+ // `block lookup` is served over the GraphQL fetch path (ONE generated document
88
+ // over the `UIBlock` interface covering Component/Pattern/Layout/Subcomponent).
89
+ // Base level mirrors the old summary view (name/tier/summary); the default is
90
+ // `detailed`, matching the old CLI which rendered anatomy and modifiers
91
+ // without a flag. A derived name that maps onto no schema field is omitted
92
+ // (OPTIONAL parity), so a graph lacking whenToUse/whenNotToUse degrades
93
+ // gracefully.
94
+ //
95
+ // Disclosure declares the FULL canonical ladder `[summary, standard,
96
+ // detailed]` — the same set `standard` declares — so a config
97
+ // `detail=standard` names a level `block` advertises rather than one it
98
+ // silently accepts-then-degrades. Block carries no `standard`-tier content of
99
+ // its own; gating is by canonical index, so `standard` resolves to the base
100
+ // view. Only the level SET is aligned: the per-noun DEFAULT stays domain-tuned
101
+ // (`block` rich-by-default, `standard` terse-by-default).
102
+ {
103
+ noun: "block",
104
+ description: "List all design system blocks.",
105
+ toolDescription:
106
+ "List all design system blocks with their type, tier, and modifier families. Use when browsing which blocks exist. Example: block_list {}.",
107
+ colophon: DESIGN_SYSTEM_COLOPHON,
108
+ list: {
109
+ query: [
110
+ "SELECT ?uri ?name ?type ?tier",
111
+ ' (GROUP_CONCAT(DISTINCT ?modName; separator=", ") AS ?modifiers)',
112
+ "WHERE {",
113
+ " VALUES ?class { ds:Component ds:Pattern ds:Layout ds:Subcomponent }",
114
+ " ?uri a ?class .",
115
+ " OPTIONAL { ?uri ds:name ?dsName }",
116
+ " OPTIONAL { ?uri ds:tier ?tierUri }",
117
+ " OPTIONAL { ?uri ds:hasModifierFamily ?family . ?family ds:name ?modName }",
118
+ ' BIND(COALESCE(?dsName, REPLACE(STR(?uri), "^.*[/#]", "")) AS ?name)',
119
+ ' BIND(LCASE(REPLACE(STR(?class), "^.*[/#]", "")) AS ?type)',
120
+ ' BIND(REPLACE(STR(?tierUri), "^.*[/#]", "") AS ?tier)',
121
+ "}",
122
+ "GROUP BY ?uri ?name ?type ?tier",
123
+ "ORDER BY ?name",
124
+ ].join("\n"),
125
+ columns: [
126
+ { field: "name", label: "Name" },
127
+ { field: "type", label: "Type" },
128
+ { field: "tier", label: "Tier" },
129
+ { field: "modifiers", label: "Modifiers" },
130
+ { field: "uri", label: "IRI" },
131
+ ],
132
+ emptyRecovery: {
133
+ message:
134
+ "No blocks in the store. Build it from the configured design-system packs.",
135
+ cli: "sources update",
136
+ },
137
+ },
138
+ lookup: {
139
+ source: "graphql",
140
+ toolDescription:
141
+ 'Get detailed information about one or more design system blocks including anatomy, modifiers, and properties. Use when you need the full spec of specific blocks by name — detail: "summary" trims to the base view. Example: block_lookup { names: ["Button"] }.',
142
+ by: "ds:name",
143
+ types: ["ds:Component", "ds:Pattern", "ds:Layout", "ds:Subcomponent"],
144
+ graphqlType: "UIBlock",
145
+ fields: [
146
+ { name: "tier", property: "ds:tier", label: "Tier" },
147
+ {
148
+ name: "figmaLink",
149
+ property: "ds:figmaLink",
150
+ label: "Figma",
151
+ level: "detailed",
152
+ },
153
+ ],
154
+ sections: [
155
+ { name: "summary", property: "ds:summary", label: "Summary" },
156
+ {
157
+ name: "whenToUse",
158
+ property: "ds:whenToUse",
159
+ label: "When to use",
160
+ level: "detailed",
161
+ },
162
+ {
163
+ name: "whenNotToUse",
164
+ property: "ds:whenNotToUse",
165
+ label: "When not to use",
166
+ level: "detailed",
167
+ },
168
+ {
169
+ name: "guidelines",
170
+ property: "ds:guidelines",
171
+ label: "Guidelines",
172
+ level: "detailed",
173
+ },
174
+ {
175
+ name: "anatomyDsl",
176
+ property: "ds:anatomyDsl",
177
+ label: "Anatomy (DSL)",
178
+ kind: "code",
179
+ level: "detailed",
180
+ },
181
+ {
182
+ name: "anatomyClassic",
183
+ property: "ds:anatomyClassic",
184
+ label: "Anatomy (classic)",
185
+ kind: "code",
186
+ level: "detailed",
187
+ },
188
+ ],
189
+ expand: [
190
+ {
191
+ name: "modifierFamilies",
192
+ heading: "Modifier Families",
193
+ relation: "ds:hasModifierFamily",
194
+ level: "detailed",
195
+ select: [
196
+ { name: "name", property: "ds:name" },
197
+ {
198
+ name: "values",
199
+ relation: "ds:hasModifier",
200
+ select: [{ name: "name", property: "ds:name" }],
201
+ },
202
+ ],
203
+ },
204
+ {
205
+ name: "properties",
206
+ heading: "Properties",
207
+ relation: "ds:hasProperty",
208
+ kind: "table",
209
+ level: "detailed",
210
+ select: [
211
+ { name: "name", property: "ds:name" },
212
+ { name: "type", property: "ds:propertyType" },
213
+ { name: "optional", property: "ds:optional" },
214
+ ],
215
+ },
216
+ {
217
+ name: "subcomponents",
218
+ heading: "Subcomponents",
219
+ relation: "ds:hasSubcomponent",
220
+ level: "detailed",
221
+ select: [
222
+ { name: "name", property: "ds:name" },
223
+ { name: "uri", property: "ds:name", graphqlField: "uri" },
224
+ ],
225
+ },
226
+ ],
227
+ disclosure: {
228
+ levels: ["summary", "standard", "detailed"],
229
+ default: "detailed",
230
+ },
231
+ sample: {
232
+ fixedCount: true,
233
+ toolDescription:
234
+ "Return randomly selected complete design-system blocks as exemplars. Use BEFORE writing queries to see actual data shapes, anatomy, and property names.",
235
+ },
236
+ },
237
+ },
238
+
239
+ // Design tokens: SPARQL-sourced on both verbs. There is no `ds:Token` GraphQL
240
+ // type to project against when the graph ships no tokens, and the lookup reads
241
+ // a property path (`ds:tokenType/rdfs:label`) only SPARQL can express. The
242
+ // `emptyRecovery` install hint is the story users see on an empty store. The
243
+ // noun is now purely declarative: `token add-config` wrote a starter file, and
244
+ // L-OPEN-9 removed it rather than growing the read grammar a mutation verb.
245
+ {
246
+ noun: "token",
247
+ description: "List all design tokens.",
248
+ toolDescription:
249
+ "List all design tokens with their type. Use when browsing which tokens exist under the active scope. Example: token_list {}.",
250
+ list: {
251
+ query: [
252
+ "SELECT ?uri ?name ?category WHERE {",
253
+ " ?uri a ds:Token ;",
254
+ " ds:tokenId ?name .",
255
+ " OPTIONAL {",
256
+ " ?uri ds:tokenType ?type .",
257
+ " ?type rdfs:label ?category .",
258
+ " }",
259
+ "}",
260
+ "ORDER BY ?name",
261
+ ].join("\n"),
262
+ columns: [
263
+ { field: "uri", label: "IRI" },
264
+ { field: "name", label: "Name" },
265
+ { field: "category", label: "Type" },
266
+ ],
267
+ emptyRecovery: {
268
+ message:
269
+ "No tokens in the store. Build it from the configured design-system packs.",
270
+ cli: "sources update",
271
+ },
272
+ },
273
+ lookup: {
274
+ source: "sparql",
275
+ by: "ds:tokenId",
276
+ type: "ds:Token",
277
+ toolDescription:
278
+ 'Get type and theme values for one or more design tokens by name. Use when resolving specific tokens\' light/dark values. Example: token_lookup { names: ["color.primary"] }.',
279
+ fields: [
280
+ {
281
+ name: "category",
282
+ property: "ds:tokenType/rdfs:label",
283
+ label: "Type",
284
+ },
285
+ { name: "valueLight", property: "ds:valueLight", label: "Light value" },
286
+ { name: "valueDark", property: "ds:valueDark", label: "Dark value" },
287
+ ],
288
+ sample: {
289
+ fixedCount: true,
290
+ toolDescription:
291
+ "Return randomly selected complete design tokens (with theme values) as exemplars. Use BEFORE writing queries to see actual data shapes.",
292
+ },
293
+ },
294
+ },
295
+
296
+ // Modifier families. `modifier list` is SPARQL (an alternation path collects
297
+ // values asserted in either direction); `modifier lookup` is GRAPHQL, where
298
+ // the compiled `ModifierFamily.modifiers` field is the declared-inverse union
299
+ // and resolves both directions in ONE generated document — exactly the case
300
+ // the GraphQL fetch path exists for.
301
+ {
302
+ noun: "modifier",
303
+ description: "List all modifier families.",
304
+ toolDescription:
305
+ "List all modifier families with their values. Use when browsing which modifier families exist and the values each allows. Example: modifier_list {}.",
306
+ list: {
307
+ query: [
308
+ "SELECT ?uri ?name",
309
+ ' (GROUP_CONCAT(DISTINCT ?valueName; separator=", ") AS ?values)',
310
+ "WHERE {",
311
+ " ?uri a ds:ModifierFamily ;",
312
+ " ds:name ?name .",
313
+ " OPTIONAL {",
314
+ " ?uri (ds:hasModifier|^ds:modifierFamily) ?value .",
315
+ " ?value ds:name ?valueName .",
316
+ " }",
317
+ "}",
318
+ "GROUP BY ?uri ?name",
319
+ "ORDER BY ?name",
320
+ ].join("\n"),
321
+ columns: [
322
+ { field: "uri", label: "IRI" },
323
+ { field: "name", label: "Name" },
324
+ { field: "values", label: "Values" },
325
+ ],
326
+ emptyRecovery: {
327
+ message:
328
+ "No modifier families in the store. Build it from the configured design-system packs.",
329
+ cli: "sources update",
330
+ },
331
+ },
332
+ lookup: {
333
+ source: "graphql",
334
+ by: "ds:name",
335
+ type: "ds:ModifierFamily",
336
+ toolDescription:
337
+ 'Get values and usage details for one or more modifier families by name. Use when you need the allowed values of specific families. Example: modifier_lookup { names: ["importance"] }.',
338
+ expand: [
339
+ {
340
+ name: "values",
341
+ heading: "Values",
342
+ relation: "ds:hasModifier",
343
+ select: [{ name: "name", property: "ds:name" }],
344
+ },
345
+ ],
346
+ sample: {
347
+ fixedCount: true,
348
+ toolDescription:
349
+ "Return randomly selected complete modifier families (with value lists) as exemplars. Use BEFORE writing queries to see actual data shapes.",
350
+ },
351
+ },
352
+ },
353
+
354
+ // Tiers. The hierarchy is encoded in the slash-separated path string
355
+ // (`apps/lxd`), not in graph edges, so `tier list` is a flat, name-ordered
356
+ // list. `tier lookup` resolves a tier by its declared name and expands the
357
+ // blocks scoped DIRECTLY to it through the inverse path `^ds:tier` — a
358
+ // single-hop expand the generated sub-SELECT emits as `<tier> ^ds:tier ?child`
359
+ // (property paths, inverse included, are in-contract for `PackExpand.relation`).
360
+ // Retiring the bespoke single-`<name>` lookup for this declared variadic one
361
+ // is an L-OPEN-9 covenant change, recorded in the covenant's $comment.
362
+ {
363
+ noun: "tier",
364
+ description: "List all tiers in the design system ontology.",
365
+ toolDescription:
366
+ "List all tiers in the design-system ontology. Use when understanding the tier hierarchy before setting a tier filter. Example: tier_list {}.",
367
+ list: {
368
+ query: [
369
+ "SELECT ?uri ?name WHERE {",
370
+ " ?uri a ds:Tier ;",
371
+ " ds:name ?name .",
372
+ "} ORDER BY ?name",
373
+ ].join("\n"),
374
+ columns: [
375
+ { field: "uri", label: "IRI" },
376
+ { field: "name", label: "Name" },
377
+ ],
378
+ },
379
+ lookup: {
380
+ source: "sparql",
381
+ by: "ds:name",
382
+ type: "ds:Tier",
383
+ description: "Show tiers by name, with the blocks scoped to each.",
384
+ toolDescription:
385
+ 'Get one or more tiers by name, with the blocks scoped directly to each. Use when you need which blocks a specific tier carries. Example: tier_lookup { names: ["apps/lxd"] }.',
386
+ expand: [
387
+ {
388
+ name: "blocks",
389
+ heading: "Blocks",
390
+ relation: "^ds:tier",
391
+ select: [{ name: "name", property: "ds:name" }],
392
+ },
393
+ ],
394
+ },
395
+ },
396
+ ];
397
+
398
+ /**
399
+ * The read story the code-standards pack supplies — `standard` as declared data.
400
+ *
401
+ * Normalized for the v2 grammar: the old `digest` level is the canonical
402
+ * `standard`, so disclosure gates by the canonical index. The default is
403
+ * `summary` (base fields by name), `--detail standard` adds the `dos` examples,
404
+ * `--detail detailed` adds `donts`. `cs:extends` stays the raw IRI in JSON
405
+ * (renderers compact it at display time).
406
+ */
407
+ const codeStandardsStories: readonly PackDefinition[] = [
408
+ {
409
+ noun: "standard",
410
+ description: "List all code standards.",
411
+ toolDescription:
412
+ "List code standards. Optionally filter by category or search term.",
413
+ list: {
414
+ query: [
415
+ "SELECT ?uri ?name ?category ?description",
416
+ "WHERE {",
417
+ " ?uri a cs:CodeStandard ;",
418
+ " cs:description ?description .",
419
+ " OPTIONAL { ?uri cs:name ?n . }",
420
+ ' BIND(COALESCE(?n, REPLACE(STRAFTER(STR(?uri), "#"), "\\\\.", "/")) AS ?name)',
421
+ " OPTIONAL {",
422
+ " ?uri cs:hasCategory ?cat .",
423
+ " ?cat cs:slug ?category .",
424
+ " }",
425
+ "}",
426
+ "ORDER BY ?name",
427
+ ].join("\n"),
428
+ columns: [
429
+ { field: "uri", label: "IRI" },
430
+ { field: "name", label: "Name" },
431
+ { field: "category", label: "Category" },
432
+ { field: "description", label: "Description" },
433
+ ],
434
+ filters: [
435
+ {
436
+ param: "category",
437
+ variable: "category",
438
+ description: "Filter by category name.",
439
+ },
440
+ ],
441
+ search: {
442
+ variables: ["name", "description"],
443
+ description: "Search in name and description.",
444
+ },
445
+ },
446
+ verbs: [
447
+ {
448
+ verb: "categories",
449
+ description: "List all standard categories with counts.",
450
+ toolDescription: "List all code standard categories.",
451
+ query: [
452
+ "SELECT ?name (COUNT(?standard) AS ?count)",
453
+ "WHERE {",
454
+ " ?cat a cs:Category ;",
455
+ " cs:slug ?name .",
456
+ " OPTIONAL {",
457
+ " ?standard a cs:CodeStandard ;",
458
+ " cs:hasCategory ?cat .",
459
+ " }",
460
+ "}",
461
+ "GROUP BY ?name",
462
+ "ORDER BY ?name",
463
+ ].join("\n"),
464
+ columns: [
465
+ { field: "name", label: "Category" },
466
+ { field: "count", label: "Standards" },
467
+ ],
468
+ },
469
+ ],
470
+ lookup: {
471
+ source: "sparql",
472
+ by: "cs:name",
473
+ type: "cs:CodeStandard",
474
+ description:
475
+ "Look up detailed information for a standard by name, IRI, or glob.",
476
+ toolDescription:
477
+ "Get detailed information about one or more code standards including dos and donts with code examples. Address standards by name, prefixed name (cs:…), absolute IRI, or glob pattern (react/component/*).",
478
+ fields: [
479
+ {
480
+ name: "category",
481
+ property: "cs:hasCategory/cs:slug",
482
+ label: "Category",
483
+ },
484
+ {
485
+ name: "description",
486
+ property: "cs:description",
487
+ label: "Description",
488
+ },
489
+ { name: "extends", property: "cs:extends", label: "Extends" },
490
+ ],
491
+ expand: [
492
+ {
493
+ name: "dos",
494
+ heading: "Do",
495
+ relation: "cs:do",
496
+ select: [
497
+ { name: "caption", property: "cs:description" },
498
+ { name: "language", property: "cs:language" },
499
+ { name: "code", property: "cs:code" },
500
+ ],
501
+ level: "standard",
502
+ },
503
+ {
504
+ name: "donts",
505
+ heading: "Don't",
506
+ relation: "cs:dont",
507
+ select: [
508
+ { name: "caption", property: "cs:description" },
509
+ { name: "language", property: "cs:language" },
510
+ { name: "code", property: "cs:code" },
511
+ ],
512
+ level: "detailed",
513
+ },
514
+ ],
515
+ disclosure: {
516
+ levels: ["summary", "standard", "detailed"],
517
+ default: "summary",
518
+ },
519
+ sample: {
520
+ description:
521
+ "Return randomly selected complete standard instances as exemplars for shape discovery.",
522
+ toolDescription:
523
+ "Return 1–5 randomly selected complete code standard instances as exemplars. Use BEFORE writing queries to see actual data shapes, property names, and value formats. Each call returns different instances.",
524
+ },
525
+ },
526
+ },
527
+ ];
528
+
529
+ export default {
530
+ name: "pragma",
531
+ help: "Explore the design system",
532
+ // The toolchain's own colophon — CONTENT this distribution declares, not
533
+ // machinery: `pragma colophon` renders whatever stands here as its first
534
+ // section, titled with the distribution's name, before any active pack's
535
+ // domain colophon. A fork tells its own story by editing this declaration.
536
+ // `markdown` is the full narrative; `summary` is the condensed `--format llm`
537
+ // form. Both are BODIES with no leading H1 (the renderer supplies the
538
+ // heading), grounded in this tree's real architecture.
539
+ colophon: {
540
+ markdown: `pragma is a **domain-based toolchain**: one CLI and one MCP server projected
541
+ from a single grammar, serving a knowledge-graph domain that reads as data.
542
+
543
+ ## The effect monad
544
+
545
+ Reads are plain \`async\` functions; a mutation instead *describes* its effects
546
+ as a \`Task\` (\`@canonical/task\`) that is interpreted — under the real node
547
+ interpreter, a \`--dry-run\` planner, or an \`--undo\` reverser. Describe-then-
548
+ interpret means dry-run and undo come for free, and the dispatcher tells the two
549
+ worlds apart on one bit: \`capability.mutates\`.
550
+
551
+ ## One grammar, many projections
552
+
553
+ Every capability is a \`VerbSpec\` — a noun, its params, its effect profile, its
554
+ formatters. The CLI commands, the MCP tools, shell completion, and the
555
+ surface/docs are all *projections* of that one shape, so they cannot drift. The
556
+ projected surface is frozen in a covenant (\`surface/surface.v2.json\`): a single
557
+ source of truth a test asserts the live grammar still emits, tool for tool.
558
+
559
+ ## LLM-optimized output
560
+
561
+ Each verb renders three ways — \`plain\` for a terminal, \`json\` for the machine
562
+ envelope, and \`llm\` for condensed Markdown. \`--format llm\` (or a non-interactive
563
+ stdout) selects the agent form: the same data, shaped for a model to read. This
564
+ colophon is itself a showcase of that render model.
565
+
566
+ ## Modular, storeless by construction
567
+
568
+ Capabilities ship as **modules** — named bundles of verbs with optional
569
+ boot / resource / prompt hooks. A verb declares whether it \`needsStore\`, and
570
+ the dispatcher boots the triple store *only* for those; a storeless verb
571
+ (\`info\`, \`config\`, \`capabilities\`, \`colophon\`) never pays for the graph.
572
+
573
+ ## Scaffolding
574
+
575
+ \`pragma create\` scaffolds components, packages, and applications through the
576
+ \`@canonical/summon-*\` generators, reusing summon's rich Ink wizard when it runs
577
+ interactively.
578
+
579
+ ## The domain reads as data
580
+
581
+ A domain is a **pack**: a declarative \`PackDefinition\` (its list / lookup
582
+ queries) compiled into verbs, backed by a content-addressed graphpack that
583
+ \`sources update\` builds once. Swap the pack and the same pragma serves a
584
+ different domain — including the domain colophon printed below this one.
585
+
586
+ Made by the Canonical Webteam — https://canonical.com.`,
587
+ summary: `pragma is a domain-based toolchain: one CLI + MCP server projected from a single \`VerbSpec\` grammar.
588
+
589
+ - **Effect monad** (\`@canonical/task\`): reads are async; a mutation returns an interpreted \`Task\`, so \`--dry-run\` and \`--undo\` are free. The dispatcher branches on \`capability.mutates\`.
590
+ - **One grammar, many projections**: CLI, MCP tools, completion, and docs all project one \`VerbSpec\`; the emitted surface is frozen in a covenant so the projections never drift.
591
+ - **LLM-optimized output**: every verb renders \`plain\` / \`json\` / \`llm\`; \`--format llm\` (or a piped stdout) emits condensed Markdown for agents.
592
+ - **Modular + storeless**: capability modules; the triple store boots only for \`needsStore\` verbs.
593
+ - **Domain as data**: a pack is a declarative \`PackDefinition\` compiled to verbs over a content-addressed graph built by \`sources update\`.
594
+
595
+ Made by the Canonical Webteam — https://canonical.com.`,
596
+ },
597
+ issuesUrl: "https://github.com/canonical/pragma/issues",
598
+ packs: [
599
+ {
600
+ name: "@canonical/design-system",
601
+ source: "git+https://github.com/canonical/design-system.git#main",
602
+ stories: designSystemStories,
603
+ },
604
+ {
605
+ name: "@canonical/anatomy-dsl",
606
+ source: "git+https://github.com/canonical/anatomy-dsl.git#main",
607
+ },
608
+ {
609
+ name: "@canonical/code-standards",
610
+ source: "git+https://github.com/canonical/web-code-standards.git#main",
611
+ stories: codeStandardsStories,
612
+ },
613
+ ],
614
+ // This distribution's domain namespaces, declared once and read twice.
615
+ //
616
+ // (1) They pin what `sources update` builds the store with. The design system
617
+ // declares `ds:` twice — `…/` in `definitions/` and `…/data/` in `data/` —
618
+ // and prefix harvesting is last-wins over a filename sort, so which one binds
619
+ // is an accident of file naming. The config layer wins every harvest: without
620
+ // this pin an added or renamed upstream file can silently compact every `ds:`
621
+ // entity to the wrong prefix, and `block list` stops resolving.
622
+ //
623
+ // (2) They are the domain half of the kernel's `DEFAULT_PREFIX_MAP`
624
+ // (`src/kernel/render/prefixes.ts`) — what the CLI compacts in output AND
625
+ // what it expands a user-typed `ds:Button` / `cs:rule` through before a
626
+ // lookup. Drop a namespace here and its lookups stop resolving; that is why
627
+ // `cs:` is listed even though nothing rebinds it upstream.
628
+ prefixes: {
629
+ ds: "https://ds.canonical.com/",
630
+ cs: "http://pragma.canonical.com/codestandards#",
631
+ },
632
+ channel: "normal",
633
+ detail: "standard",
634
+ } satisfies RawConfig;
635
+
636
+ /**
637
+ * The domain terms the kernel reads this distribution's graph with.
638
+ *
639
+ * A separate export because it is NOT a config layer field: it is compiled in
640
+ * and read at module load by `src/kernel/vocabulary.ts`, whose readers (the
641
+ * storeless completion fast path, the pack index builder) cannot reach a config
642
+ * layer at all. Layering it would let a project config set it and change
643
+ * nothing. A fork edits these values and rebuilds; `parseVocabulary` type-checks
644
+ * the shape and rejects a term that is not a prefixed name.
645
+ *
646
+ * Every prefix used here must be bound in `prefixes` above. `rdfs:label` and
647
+ * `rdfs:comment` are deliberately absent — the kernel treats standard
648
+ * vocabulary as universal.
649
+ *
650
+ * The `prompt` terms are a READ CONTRACT, not a claim about instances: this
651
+ * distribution's graph currently carries no `ds:Prompt` entities at all, so
652
+ * `prompt list` is honestly empty. Declaring the shape anyway is what makes an
653
+ * empty result mean "the graph has none" rather than "nothing was declared".
654
+ */
655
+ export const vocabulary = {
656
+ altName: "ds:name",
657
+ prompt: {
658
+ type: "ds:Prompt",
659
+ body: "ds:promptBody",
660
+ argument: "ds:promptArgument",
661
+ argName: "ds:argName",
662
+ argRequired: "ds:argRequired",
663
+ },
664
+ };