@canonical/pragma-cli 0.38.0 → 0.40.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 (330) hide show
  1. package/README.md +1 -1
  2. package/dist/package.json +14 -14
  3. package/dist/pragma.conf.js +273 -176
  4. package/dist/pragma.conf.js.map +1 -1
  5. package/dist/src/capabilities/capabilities/capabilities.verb.js +2 -0
  6. package/dist/src/capabilities/capabilities/capabilities.verb.js.map +1 -1
  7. package/dist/src/capabilities/capabilities/catalog.js +47 -51
  8. package/dist/src/capabilities/capabilities/catalog.js.map +1 -1
  9. package/dist/src/capabilities/capabilities/index.js +2 -0
  10. package/dist/src/capabilities/capabilities/index.js.map +1 -1
  11. package/dist/src/capabilities/capabilities/types.js +5 -5
  12. package/dist/src/capabilities/colophon/colophon.render.js +7 -4
  13. package/dist/src/capabilities/colophon/colophon.render.js.map +1 -1
  14. package/dist/src/capabilities/colophon/colophon.verb.js +1 -0
  15. package/dist/src/capabilities/colophon/colophon.verb.js.map +1 -1
  16. package/dist/src/capabilities/config/get.verb.js +2 -0
  17. package/dist/src/capabilities/config/get.verb.js.map +1 -1
  18. package/dist/src/capabilities/config/runField.js +2 -2
  19. package/dist/src/capabilities/config/runField.js.map +1 -1
  20. package/dist/src/capabilities/config/set.verb.js +2 -0
  21. package/dist/src/capabilities/config/set.verb.js.map +1 -1
  22. package/dist/src/capabilities/config/show.verb.js +1 -0
  23. package/dist/src/capabilities/config/show.verb.js.map +1 -1
  24. package/dist/src/capabilities/config/unset.verb.js +2 -0
  25. package/dist/src/capabilities/config/unset.verb.js.map +1 -1
  26. package/dist/src/capabilities/create/constants.js +2 -2
  27. package/dist/src/capabilities/create/create.verb.js +14 -4
  28. package/dist/src/capabilities/create/create.verb.js.map +1 -1
  29. package/dist/src/capabilities/distribution.js +3 -1
  30. package/dist/src/capabilities/distribution.js.map +1 -1
  31. package/dist/src/capabilities/doctor/checks/checkPackageRefs.js +10 -2
  32. package/dist/src/capabilities/doctor/checks/checkPackageRefs.js.map +1 -1
  33. package/dist/src/capabilities/doctor/doctor.verb.js +2 -0
  34. package/dist/src/capabilities/doctor/doctor.verb.js.map +1 -1
  35. package/dist/src/capabilities/graph/connect.verb.js +2 -0
  36. package/dist/src/capabilities/graph/connect.verb.js.map +1 -1
  37. package/dist/src/capabilities/graph/inspect.render.js +7 -1
  38. package/dist/src/capabilities/graph/inspect.render.js.map +1 -1
  39. package/dist/src/capabilities/graph/inspect.verb.js +2 -0
  40. package/dist/src/capabilities/graph/inspect.verb.js.map +1 -1
  41. package/dist/src/capabilities/graph/query.render.js +37 -5
  42. package/dist/src/capabilities/graph/query.render.js.map +1 -1
  43. package/dist/src/capabilities/graph/query.verb.js +2 -0
  44. package/dist/src/capabilities/graph/query.verb.js.map +1 -1
  45. package/dist/src/capabilities/graph/queryText.js +28 -0
  46. package/dist/src/capabilities/graph/queryText.js.map +1 -1
  47. package/dist/src/capabilities/graph/runConnect.js +3 -3
  48. package/dist/src/capabilities/graph/runConnect.js.map +1 -1
  49. package/dist/src/capabilities/graph/runQuery.js +8 -6
  50. package/dist/src/capabilities/graph/runQuery.js.map +1 -1
  51. package/dist/src/capabilities/info/info.verb.js +2 -0
  52. package/dist/src/capabilities/info/info.verb.js.map +1 -1
  53. package/dist/src/capabilities/meta/mcp.verb.js +1 -0
  54. package/dist/src/capabilities/meta/mcp.verb.js.map +1 -1
  55. package/dist/src/capabilities/ontology/verbs.js +7 -10
  56. package/dist/src/capabilities/ontology/verbs.js.map +1 -1
  57. package/dist/src/capabilities/prompt/verbs.js +5 -4
  58. package/dist/src/capabilities/prompt/verbs.js.map +1 -1
  59. package/dist/src/capabilities/resources/provider.js +6 -3
  60. package/dist/src/capabilities/resources/provider.js.map +1 -1
  61. package/dist/src/capabilities/setup/setup.verb.js +13 -5
  62. package/dist/src/capabilities/setup/setup.verb.js.map +1 -1
  63. package/dist/src/capabilities/shared/calls.js +16 -0
  64. package/dist/src/capabilities/shared/calls.js.map +1 -0
  65. package/dist/src/capabilities/skill/render.js +7 -5
  66. package/dist/src/capabilities/skill/render.js.map +1 -1
  67. package/dist/src/capabilities/skill/verbs.js +5 -4
  68. package/dist/src/capabilities/skill/verbs.js.map +1 -1
  69. package/dist/src/capabilities/sources/collectStatus.js +6 -1
  70. package/dist/src/capabilities/sources/collectStatus.js.map +1 -1
  71. package/dist/src/capabilities/sources/index.js +4 -3
  72. package/dist/src/capabilities/sources/index.js.map +1 -1
  73. package/dist/src/capabilities/sources/reset.render.js +37 -0
  74. package/dist/src/capabilities/sources/reset.render.js.map +1 -0
  75. package/dist/src/capabilities/sources/reset.verb.js +51 -0
  76. package/dist/src/capabilities/sources/reset.verb.js.map +1 -0
  77. package/dist/src/capabilities/sources/runReset.js +59 -0
  78. package/dist/src/capabilities/sources/runReset.js.map +1 -0
  79. package/dist/src/capabilities/sources/runUpdate.js +7 -6
  80. package/dist/src/capabilities/sources/runUpdate.js.map +1 -1
  81. package/dist/src/capabilities/sources/status.render.js +24 -8
  82. package/dist/src/capabilities/sources/status.render.js.map +1 -1
  83. package/dist/src/capabilities/sources/status.verb.js +1 -0
  84. package/dist/src/capabilities/sources/status.verb.js.map +1 -1
  85. package/dist/src/capabilities/sources/update.verb.js +2 -0
  86. package/dist/src/capabilities/sources/update.verb.js.map +1 -1
  87. package/dist/src/capabilities/upgrade/upgrade.verb.js +1 -0
  88. package/dist/src/capabilities/upgrade/upgrade.verb.js.map +1 -1
  89. package/dist/src/capabilities/version/version.verb.js +1 -0
  90. package/dist/src/capabilities/version/version.verb.js.map +1 -1
  91. package/dist/src/constants.js +4 -3
  92. package/dist/src/constants.js.map +1 -1
  93. package/dist/src/kernel/error/index.js +1 -1
  94. package/dist/src/kernel/error/index.js.map +1 -1
  95. package/dist/src/kernel/error/recovery.js +24 -42
  96. package/dist/src/kernel/error/recovery.js.map +1 -1
  97. package/dist/src/kernel/packs/collect.js +123 -9
  98. package/dist/src/kernel/packs/collect.js.map +1 -1
  99. package/dist/src/kernel/packs/compile.js +74 -15
  100. package/dist/src/kernel/packs/compile.js.map +1 -1
  101. package/dist/src/kernel/packs/graphql/fetchGraphqlLookup.js +3 -3
  102. package/dist/src/kernel/packs/graphql/fetchGraphqlLookup.js.map +1 -1
  103. package/dist/src/kernel/packs/iri.js +2 -4
  104. package/dist/src/kernel/packs/iri.js.map +1 -1
  105. package/dist/src/kernel/packs/renderPack.js +90 -50
  106. package/dist/src/kernel/packs/renderPack.js.map +1 -1
  107. package/dist/src/kernel/packs/resolveEntity.js +202 -90
  108. package/dist/src/kernel/packs/resolveEntity.js.map +1 -1
  109. package/dist/src/kernel/packs/runBodies.js +89 -30
  110. package/dist/src/kernel/packs/runBodies.js.map +1 -1
  111. package/dist/src/kernel/packs/schema.js +66 -12
  112. package/dist/src/kernel/packs/schema.js.map +1 -1
  113. package/dist/src/kernel/packs/sparql/buildListQuery.js +80 -13
  114. package/dist/src/kernel/packs/sparql/buildListQuery.js.map +1 -1
  115. package/dist/src/kernel/packs/sparql/buildLookupQuery.js +41 -13
  116. package/dist/src/kernel/packs/sparql/buildLookupQuery.js.map +1 -1
  117. package/dist/src/kernel/packs/sparql/filterValues.js +32 -23
  118. package/dist/src/kernel/packs/sparql/filterValues.js.map +1 -1
  119. package/dist/src/kernel/packs/sparql/runSelect.js +3 -5
  120. package/dist/src/kernel/packs/sparql/runSelect.js.map +1 -1
  121. package/dist/src/kernel/packs/storyRules.js +31 -4
  122. package/dist/src/kernel/packs/storyRules.js.map +1 -1
  123. package/dist/src/kernel/packs/tierScope.js +3 -3
  124. package/dist/src/kernel/packs/tierScope.js.map +1 -1
  125. package/dist/src/kernel/packs/types.js +4 -0
  126. package/dist/src/kernel/packs/types.js.map +1 -1
  127. package/dist/src/kernel/project/cli/buildProgram.js +4 -0
  128. package/dist/src/kernel/project/cli/buildProgram.js.map +1 -1
  129. package/dist/src/kernel/project/cli/dispatch.js +32 -8
  130. package/dist/src/kernel/project/cli/dispatch.js.map +1 -1
  131. package/dist/src/kernel/project/cli/suggestNames.js +44 -1
  132. package/dist/src/kernel/project/cli/suggestNames.js.map +1 -1
  133. package/dist/src/kernel/project/cli/verbHelp.js +17 -18
  134. package/dist/src/kernel/project/cli/verbHelp.js.map +1 -1
  135. package/dist/src/kernel/project/mcp/buildServer.js +11 -4
  136. package/dist/src/kernel/project/mcp/buildServer.js.map +1 -1
  137. package/dist/src/kernel/project/mcp/envelope.js +3 -2
  138. package/dist/src/kernel/project/mcp/envelope.js.map +1 -1
  139. package/dist/src/kernel/project/mcp/instructions.js +101 -31
  140. package/dist/src/kernel/project/mcp/instructions.js.map +1 -1
  141. package/dist/src/kernel/project/mcp/registerVerb.js +59 -23
  142. package/dist/src/kernel/project/mcp/registerVerb.js.map +1 -1
  143. package/dist/src/kernel/render/renderers.js +3 -3
  144. package/dist/src/kernel/render/turtle.js +21 -4
  145. package/dist/src/kernel/render/turtle.js.map +1 -1
  146. package/dist/src/kernel/runtime/graphpack/build.js +54 -1
  147. package/dist/src/kernel/runtime/graphpack/build.js.map +1 -1
  148. package/dist/src/kernel/runtime/graphpack/manifest.js +14 -0
  149. package/dist/src/kernel/runtime/graphpack/manifest.js.map +1 -1
  150. package/dist/src/kernel/runtime/graphpack/read.js +3 -5
  151. package/dist/src/kernel/runtime/graphpack/read.js.map +1 -1
  152. package/dist/src/kernel/runtime/graphpack/schemas.js +1 -0
  153. package/dist/src/kernel/runtime/graphpack/schemas.js.map +1 -1
  154. package/dist/src/kernel/runtime/loadSession.js +8 -1
  155. package/dist/src/kernel/runtime/loadSession.js.map +1 -1
  156. package/dist/src/kernel/runtime/packVersion.js +75 -0
  157. package/dist/src/kernel/runtime/packVersion.js.map +1 -0
  158. package/dist/src/kernel/runtime/readEntity.js +43 -4
  159. package/dist/src/kernel/runtime/readEntity.js.map +1 -1
  160. package/dist/src/kernel/runtime/resolveSources.js +61 -9
  161. package/dist/src/kernel/runtime/resolveSources.js.map +1 -1
  162. package/dist/src/kernel/runtime/storeReadiness.js +3 -2
  163. package/dist/src/kernel/runtime/storeReadiness.js.map +1 -1
  164. package/dist/src/kernel/spec/call.js +167 -0
  165. package/dist/src/kernel/spec/call.js.map +1 -0
  166. package/dist/src/kernel/spec/emitReference.js +9 -13
  167. package/dist/src/kernel/spec/emitReference.js.map +1 -1
  168. package/dist/src/kernel/spec/emitSurface.js +8 -1
  169. package/dist/src/kernel/spec/emitSurface.js.map +1 -1
  170. package/dist/src/kernel/spec/guidance.js +63 -0
  171. package/dist/src/kernel/spec/guidance.js.map +1 -0
  172. package/dist/src/kernel/spec/wireType.js +36 -0
  173. package/dist/src/kernel/spec/wireType.js.map +1 -0
  174. package/package.json +14 -14
  175. package/pragma.conf.ts +294 -177
  176. package/src/capabilities/block.parity.test.ts +1 -1
  177. package/src/capabilities/callRule.test.ts +147 -0
  178. package/src/capabilities/capabilities/capabilities.test.ts +47 -19
  179. package/src/capabilities/capabilities/capabilities.verb.ts +2 -0
  180. package/src/capabilities/capabilities/catalog.ts +60 -55
  181. package/src/capabilities/capabilities/index.ts +2 -0
  182. package/src/capabilities/capabilities/types.ts +16 -19
  183. package/src/capabilities/colophon/colophon.render.ts +9 -5
  184. package/src/capabilities/colophon/colophon.verb.ts +1 -0
  185. package/src/capabilities/config/get.verb.ts +2 -0
  186. package/src/capabilities/config/runField.ts +3 -3
  187. package/src/capabilities/config/set.verb.ts +3 -0
  188. package/src/capabilities/config/show.verb.ts +2 -0
  189. package/src/capabilities/config/unset.verb.ts +2 -0
  190. package/src/capabilities/create/constants.ts +2 -2
  191. package/src/capabilities/create/create.verb.ts +16 -0
  192. package/src/capabilities/create/createGrammar.test.ts +1 -1
  193. package/src/capabilities/distribution.test.ts +6 -3
  194. package/src/capabilities/distribution.ts +6 -0
  195. package/src/capabilities/doctor/checks/checkPackageRefs.ts +14 -2
  196. package/src/capabilities/doctor/doctor.test.ts +38 -1
  197. package/src/capabilities/doctor/doctor.verb.ts +2 -0
  198. package/src/capabilities/emptyRecovery.test.ts +5 -0
  199. package/src/capabilities/graph/connect.verb.ts +2 -0
  200. package/src/capabilities/graph/inspect.render.ts +9 -1
  201. package/src/capabilities/graph/inspect.test.ts +73 -0
  202. package/src/capabilities/graph/inspect.verb.ts +2 -0
  203. package/src/capabilities/graph/query.render.test.ts +35 -0
  204. package/src/capabilities/graph/query.render.ts +45 -7
  205. package/src/capabilities/graph/query.shipped.exec.test.ts +44 -0
  206. package/src/capabilities/graph/query.verb.ts +2 -0
  207. package/src/capabilities/graph/queryText.test.ts +55 -1
  208. package/src/capabilities/graph/queryText.ts +47 -0
  209. package/src/capabilities/graph/runConnect.ts +4 -5
  210. package/src/capabilities/graph/runQuery.ts +23 -9
  211. package/src/capabilities/info/info.verb.ts +2 -0
  212. package/src/capabilities/links.shipped.exec.test.ts +398 -0
  213. package/src/capabilities/listBudget.shipped.exec.test.ts +2 -2
  214. package/src/capabilities/listLookup.shipped.exec.test.ts +122 -13
  215. package/src/capabilities/listQuery.shipped.exec.test.ts +39 -16
  216. package/src/capabilities/lookupBudget.shipped.exec.test.ts +208 -0
  217. package/src/capabilities/meta/mcp.verb.ts +2 -0
  218. package/src/capabilities/ontology/ontology.test.ts +24 -0
  219. package/src/capabilities/ontology/verbs.ts +16 -12
  220. package/src/capabilities/prompt/verbs.ts +10 -4
  221. package/src/capabilities/resources/provider.ts +7 -3
  222. package/src/capabilities/resources/resources.test.ts +2 -1
  223. package/src/capabilities/setup/setup.verb.ts +16 -0
  224. package/src/capabilities/shared/calls.ts +20 -0
  225. package/src/capabilities/skill/render.ts +9 -6
  226. package/src/capabilities/skill/verbs.ts +8 -4
  227. package/src/capabilities/sources/collectStatus.ts +6 -1
  228. package/src/capabilities/sources/index.ts +4 -3
  229. package/src/capabilities/sources/reset.render.test.ts +33 -0
  230. package/src/capabilities/sources/reset.render.ts +43 -0
  231. package/src/capabilities/sources/reset.verb.ts +59 -0
  232. package/src/capabilities/sources/runReset.ts +65 -0
  233. package/src/capabilities/sources/runUpdate.ts +12 -11
  234. package/src/capabilities/sources/sources.test.ts +158 -3
  235. package/src/capabilities/sources/status.render.test.ts +63 -1
  236. package/src/capabilities/sources/status.render.ts +25 -8
  237. package/src/capabilities/sources/status.verb.ts +2 -0
  238. package/src/capabilities/sources/types.ts +26 -0
  239. package/src/capabilities/sources/update.verb.ts +3 -0
  240. package/src/capabilities/surface.test.ts +2 -2
  241. package/src/capabilities/token.parity.test.ts +3 -2
  242. package/src/capabilities/tokenGraph.shipped.exec.test.ts +14 -2
  243. package/src/capabilities/upgrade/upgrade.verb.ts +1 -0
  244. package/src/capabilities/variable.parity.test.ts +2 -1
  245. package/src/capabilities/version/version.verb.ts +1 -0
  246. package/src/capabilities/wireContract.test.ts +110 -0
  247. package/src/constants.ts +4 -3
  248. package/src/kernel/copy.test.ts +1 -1
  249. package/src/kernel/error/PragmaError.test.ts +7 -3
  250. package/src/kernel/error/index.ts +1 -1
  251. package/src/kernel/error/recovery.test.ts +52 -18
  252. package/src/kernel/error/recovery.ts +25 -46
  253. package/src/kernel/error/types.ts +1 -1
  254. package/src/kernel/packs/collect.test.ts +79 -0
  255. package/src/kernel/packs/collect.ts +151 -11
  256. package/src/kernel/packs/compile.test.ts +107 -10
  257. package/src/kernel/packs/compile.ts +100 -11
  258. package/src/kernel/packs/filteredEmpty.test.ts +22 -5
  259. package/src/kernel/packs/graphql/fetchGraphqlLookup.ts +5 -6
  260. package/src/kernel/packs/graphqlSource.test.ts +42 -0
  261. package/src/kernel/packs/iri.ts +5 -4
  262. package/src/kernel/packs/listNotice.test.ts +1 -1
  263. package/src/kernel/packs/nounLink.test.ts +385 -0
  264. package/src/kernel/packs/renderPack.ts +137 -57
  265. package/src/kernel/packs/resolveEntity.test.ts +170 -1
  266. package/src/kernel/packs/resolveEntity.ts +281 -101
  267. package/src/kernel/packs/runBodies.ts +133 -31
  268. package/src/kernel/packs/schema.ts +77 -12
  269. package/src/kernel/packs/sparql/buildListQuery.test.ts +78 -1
  270. package/src/kernel/packs/sparql/buildListQuery.ts +106 -16
  271. package/src/kernel/packs/sparql/buildLookupQuery.ts +44 -13
  272. package/src/kernel/packs/sparql/filterValues.test.ts +36 -4
  273. package/src/kernel/packs/sparql/filterValues.ts +50 -31
  274. package/src/kernel/packs/sparql/runSelect.ts +4 -6
  275. package/src/kernel/packs/storyRules.ts +37 -4
  276. package/src/kernel/packs/tierScope.test.ts +120 -6
  277. package/src/kernel/packs/tierScope.ts +5 -7
  278. package/src/kernel/packs/toolDescription.test.ts +59 -74
  279. package/src/kernel/packs/types.ts +93 -11
  280. package/src/kernel/project/cli/buildProgram.ts +4 -0
  281. package/src/kernel/project/cli/dispatch.ts +34 -8
  282. package/src/kernel/project/cli/suggest.test.ts +77 -0
  283. package/src/kernel/project/cli/suggestNames.ts +47 -1
  284. package/src/kernel/project/cli/verbHelp.ts +16 -19
  285. package/src/kernel/project/mcp/buildServer.ts +15 -4
  286. package/src/kernel/project/mcp/envelope.ts +3 -2
  287. package/src/kernel/project/mcp/instructions.ts +123 -35
  288. package/src/kernel/project/mcp/prompts/prompts.test.ts +136 -20
  289. package/src/kernel/project/mcp/registerVerb.test.ts +28 -0
  290. package/src/kernel/project/mcp/registerVerb.ts +67 -29
  291. package/src/kernel/render/__snapshots__/renderers.test.ts.snap +1 -1
  292. package/src/kernel/render/renderers.test.ts +2 -2
  293. package/src/kernel/render/renderers.ts +3 -3
  294. package/src/kernel/render/turtle.ts +24 -4
  295. package/src/kernel/runtime/graphpack/build.ts +58 -1
  296. package/src/kernel/runtime/graphpack/graphpack.test.ts +20 -0
  297. package/src/kernel/runtime/graphpack/manifest.ts +15 -0
  298. package/src/kernel/runtime/graphpack/read.ts +4 -6
  299. package/src/kernel/runtime/graphpack/schemas.ts +1 -0
  300. package/src/kernel/runtime/graphpack/types.ts +13 -0
  301. package/src/kernel/runtime/loadSession.ts +8 -1
  302. package/src/kernel/runtime/packVersion.test.ts +61 -0
  303. package/src/kernel/runtime/packVersion.ts +84 -0
  304. package/src/kernel/runtime/readEntity.ts +61 -6
  305. package/src/kernel/runtime/resolveSources.test.ts +90 -7
  306. package/src/kernel/runtime/resolveSources.ts +91 -10
  307. package/src/kernel/runtime/storeReadiness.ts +4 -4
  308. package/src/kernel/runtime/types.ts +12 -0
  309. package/src/kernel/spec/call.test.ts +95 -0
  310. package/src/kernel/spec/call.ts +186 -0
  311. package/src/kernel/spec/emitReference.ts +9 -13
  312. package/src/kernel/spec/emitSurface.ts +9 -1
  313. package/src/kernel/spec/guidance.test.ts +49 -0
  314. package/src/kernel/spec/guidance.ts +68 -0
  315. package/src/kernel/spec/index.ts +4 -0
  316. package/src/kernel/spec/surfaceConformance.test.ts +2 -2
  317. package/src/kernel/spec/types.ts +64 -7
  318. package/src/kernel/spec/wireType.ts +53 -0
  319. package/src/testing/behavioral/errorMatrix.mcp.test.ts +2 -1
  320. package/src/testing/behavioral/journeys.firstInstall.test.ts +72 -2
  321. package/src/testing/behavioral/parity.test.ts +40 -0
  322. package/src/testing/eval/__snapshots__/eval.test.ts.snap +1 -1
  323. package/src/testing/eval/cases/assembly.ts +4 -3
  324. package/src/testing/eval/cases/stable.ts +2 -3
  325. package/src/testing/helpers/callSchema.ts +40 -0
  326. package/src/testing/helpers/parity.ts +35 -2
  327. package/src/testing/setupCallChecking.ts +30 -0
  328. package/dist/src/capabilities/capabilities/hints.js +0 -223
  329. package/dist/src/capabilities/capabilities/hints.js.map +0 -1
  330. package/src/capabilities/capabilities/hints.ts +0 -266
@@ -15,8 +15,8 @@
15
15
  * module's load runs on `--help`, `__complete` and `--version`. That also makes
16
16
  * the reverse edge impossible — importing `constants.js` from here is a
17
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.
18
+ * except `name` itself: an `emptyRecovery.call` names a verb path, never the
19
+ * binary, and the renderer spells it for the consuming distribution.
20
20
  * `capabilities/lazy.test.ts` pins both halves of that.
21
21
  */
22
22
  /**
@@ -142,7 +142,9 @@ const designSystemStories = [
142
142
  {
143
143
  noun: "block",
144
144
  description: "List all design system blocks.",
145
- toolDescription: "List all design system blocks with their type, tier, and modifier families. Use when browsing which blocks exist. Example: block_list {}.",
145
+ toolDescription: "List all design system blocks with their type, tier, and modifier families.",
146
+ useWhen: "when asked which components, patterns, layouts or subcomponents exist — all four are blocks, and every one of them is read through the block tools",
147
+ example: { tier: "all" },
146
148
  colophon: DESIGN_SYSTEM_COLOPHON,
147
149
  // Blocks are TIERED, so every read of them is SCOPED: `block list` answers
148
150
  // from the top-level tiers, `--tier apps_lxd` from that tier and its
@@ -213,12 +215,14 @@ const designSystemStories = [
213
215
  ],
214
216
  emptyRecovery: {
215
217
  message: "No blocks in the store. Build it from the configured design-system packs.",
216
- cli: "sources update",
218
+ call: { verb: "sources update" },
217
219
  },
218
220
  },
219
221
  lookup: {
220
222
  source: "graphql",
221
- toolDescription: '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 { name: ["Button"] }.',
223
+ toolDescription: 'Get detailed information about one or more design system blocks including anatomy, modifiers, and properties. `detail: "summary"` trims to the base view.',
224
+ useWhen: "when asked about one component, pattern or layout by name — its anatomy, properties, variants, or when to use it",
225
+ example: { name: ["Button", "Accordion"] },
222
226
  by: "ds:name",
223
227
  types: ["ds:Component", "ds:Pattern", "ds:Layout", "ds:Subcomponent"],
224
228
  // A subcomponent is a PART of a block, never the block someone means:
@@ -345,7 +349,7 @@ const designSystemStories = [
345
349
  relation: "ds:hasSubcomponent",
346
350
  level: "detailed",
347
351
  select: [
348
- { name: "name", property: "ds:name" },
352
+ { name: "name", property: "ds:name", noun: "block" },
349
353
  { name: "uri", property: "ds:name", graphqlField: "uri" },
350
354
  ],
351
355
  },
@@ -396,7 +400,19 @@ const designSystemStories = [
396
400
  // The dotted name, not the symbol's IRI: it is the address
397
401
  // `token lookup` and `token consumers --symbol` both take, so a row
398
402
  // here is a query a reader can run.
399
- { name: "symbol", property: "ds:consumesSymbol/rdfs:label" },
403
+ {
404
+ name: "symbol",
405
+ property: "ds:consumesSymbol/rdfs:label",
406
+ noun: "token",
407
+ },
408
+ // The CSS names that symbol is written as. `many`, so a second
409
+ // variable adds a name to the cell and not a row.
410
+ {
411
+ name: "variable",
412
+ property: "ds:consumesSymbol/^dt:ofSymbol/rdfs:label",
413
+ many: true,
414
+ noun: "variable",
415
+ },
400
416
  { name: "key", property: "anatomy:styleKey" },
401
417
  { name: "state", property: "anatomy:styleState" },
402
418
  { name: "rank", property: "ds:rank" },
@@ -419,7 +435,8 @@ const designSystemStories = [
419
435
  },
420
436
  sample: {
421
437
  fixedCount: true,
422
- toolDescription: "Return randomly selected complete design-system blocks as exemplars. Use BEFORE writing queries to see actual data shapes, anatomy, and property names. Example: block_sample {}.",
438
+ toolDescription: "Return randomly selected complete design-system blocks as exemplars.",
439
+ useWhen: "before your first block query, to see what a real block record looks like instead of guessing field names",
423
440
  },
424
441
  },
425
442
  },
@@ -447,7 +464,9 @@ const designSystemStories = [
447
464
  {
448
465
  noun: "token",
449
466
  description: "List the design-token symbols.",
450
- toolDescription: 'List the design-token SYMBOLS — logical dotted names (`color.text`), with the type and description from the symbol\'s OWN definition, and the symbol a channel provisions. The CSS custom-property names a stylesheet declares are variable_list. Example: token_list { type: "color" }.',
467
+ toolDescription: "List the design-token SYMBOLS — logical dotted names (`color.text`), with the type and description from the symbol's OWN definition, and the symbol a channel provisions. The CSS custom-property names a stylesheet declares are variable_list.",
468
+ useWhen: "when asked which design tokens exist — colours, spacing, typography — or to find a token's exact name",
469
+ example: { type: ["color", "dimension"] },
451
470
  list: {
452
471
  // Type and description are DEFINITION-level facts, and 393 of the 745
453
472
  // symbols have more than one definition (`color.text` has 20). The one
@@ -486,7 +505,7 @@ const designSystemStories = [
486
505
  // 60-second timeout; over this query it takes 1.8 s, and the whole
487
506
  // population comes back in 71 ms rather than 1.1 s a page.
488
507
  query: [
489
- "SELECT DISTINCT ?uri ?name ?type ?description ?channelOf",
508
+ "SELECT DISTINCT ?uri ?name ?type ?description ?channelOf ?channelOfUri",
490
509
  "WHERE {",
491
510
  " ?uri a dt:TokenSymbol ;",
492
511
  " rdfs:label ?name .",
@@ -495,7 +514,7 @@ const designSystemStories = [
495
514
  // noun of its own. Bound to the base symbol's LABEL, not its IRI: the
496
515
  // filter column and the displayed column are one column, and an
497
516
  // unbound IRI cell renders as a full IRI.
498
- " OPTIONAL { ?uri dt:channelOf/rdfs:label ?channelOf }",
517
+ " OPTIONAL { ?uri dt:channelOf ?channelOfUri . ?channelOfUri rdfs:label ?channelOf }",
499
518
  " OPTIONAL {",
500
519
  " ?resolved dt:forSymbol ?uri ;",
501
520
  " dt:resolutionChain/rdf:first ?definition .",
@@ -509,7 +528,7 @@ const designSystemStories = [
509
528
  columns: [
510
529
  { field: "name", label: "Name" },
511
530
  { field: "type", label: "Type" },
512
- { field: "channelOf", label: "Channel of" },
531
+ { field: "channelOf", label: "Channel of", noun: "token" },
513
532
  { field: "description", label: "Description" },
514
533
  { field: "uri", label: "IRI" },
515
534
  ],
@@ -534,22 +553,11 @@ const designSystemStories = [
534
553
  {
535
554
  param: "channelOf",
536
555
  variable: "channelOf",
537
- // The dimension is "which SYMBOL", so the roster is EVERY symbol —
556
+ // The dimension is "which SYMBOL", so every symbol is admissible —
538
557
  // not the far smaller set that happens to have a channel today.
539
- // Asking for a symbol nothing provisions is the documented calm empty
540
- // list, which is the whole reason a vocabulary is read from the graph
541
- // rather than from the rows a page returned.
542
- //
543
- // Keyed on `rdfs:label`, the same term the column binds and the same
544
- // term the lookup resolves by. All three move together or not at all.
545
- vocabulary: {
546
- query: [
547
- "SELECT DISTINCT ?channelOf WHERE {",
548
- " ?symbol a dt:TokenSymbol ;",
549
- " rdfs:label ?channelOf .",
550
- "}",
551
- ].join("\n"),
552
- },
558
+ // Asking for a symbol nothing provisions is a calm empty list.
559
+ noun: "token",
560
+ entity: "channelOfUri",
553
561
  description: "Filter to one symbol's channels.",
554
562
  },
555
563
  ],
@@ -567,7 +575,9 @@ const designSystemStories = [
567
575
  {
568
576
  verb: "values",
569
577
  description: "List the value each symbol resolves to at each position, with its chain or its derivation.",
570
- toolDescription: 'List the resolved token VALUES — one row per (symbol, position) the graph materialises, with the value and either its resolution chain or the symbol it derives from. Only MATERIALISED positions appear, not the permutation space: a position with no row falls through to the base symbol. A derived row carries a derivation and no value cell. Example: token_values { symbol: "color.text" }.',
578
+ toolDescription: "List the resolved token VALUES — one row per (symbol, position) the graph materialises, with the value and either its resolution chain or the symbol it derives from. Only MATERIALISED positions appear, not the permutation space: a position with no row falls through to the base symbol. A derived row carries a derivation and no value cell.",
579
+ useWhen: "when asked what value a token has, in light, dark or any other mode",
580
+ example: { symbol: ["color.text", "color.border"] },
571
581
  // The resolved-value shape admits exactly one of a chain or a
572
582
  // derivation, so BOTH are selected wherever a value is projected. A
573
583
  // surface that selected only the chain would show a blank row for every
@@ -589,7 +599,7 @@ const designSystemStories = [
589
599
  // definition the value was authored in, and that is what the lookup's
590
600
  // `values` expand projects with `rdf:first`.
591
601
  query: [
592
- "SELECT ?symbol ?position ?value ?derivedFrom",
602
+ "SELECT ?symbol ?position ?value ?derivedFrom ?symbolUri",
593
603
  ' (GROUP_CONCAT(DISTINCT ?chainItem; SEPARATOR=" ") AS ?chain)',
594
604
  "WHERE {",
595
605
  " ?resolved a dt:ResolvedValue ;",
@@ -609,11 +619,11 @@ const designSystemStories = [
609
619
  // its cell is empty rather than a full IRI.
610
620
  ' BIND(REPLACE(REPLACE(STR(?coordinate), "^.*[/#]", ""), "^coordinate[.]", "") AS ?position)',
611
621
  "}",
612
- "GROUP BY ?resolved ?symbol ?position ?value ?derivedFrom",
622
+ "GROUP BY ?resolved ?symbol ?position ?value ?derivedFrom ?symbolUri",
613
623
  "ORDER BY ?symbol ?position",
614
624
  ].join("\n"),
615
625
  columns: [
616
- { field: "symbol", label: "Symbol" },
626
+ { field: "symbol", label: "Symbol", noun: "token" },
617
627
  { field: "position", label: "Position" },
618
628
  { field: "value", label: "Value" },
619
629
  { field: "chain", label: "Chain" },
@@ -623,14 +633,8 @@ const designSystemStories = [
623
633
  {
624
634
  param: "symbol",
625
635
  variable: "symbol",
626
- vocabulary: {
627
- query: [
628
- "SELECT DISTINCT ?symbol WHERE {",
629
- " ?s a dt:TokenSymbol ;",
630
- " rdfs:label ?symbol .",
631
- "}",
632
- ].join("\n"),
633
- },
636
+ noun: "token",
637
+ entity: "symbolUri",
634
638
  description: "Filter to one symbol.",
635
639
  },
636
640
  {
@@ -658,13 +662,15 @@ const designSystemStories = [
658
662
  },
659
663
  emptyRecovery: {
660
664
  message: "Resolved token values come from the @canonical/token-ontology pack, and a value is only addressable by symbol once that pack publishes its name literals — a store built without that pack carries none.",
661
- cli: "sources update",
665
+ call: { verb: "sources update" },
662
666
  },
663
667
  },
664
668
  {
665
669
  verb: "consumers",
666
670
  description: "List which blocks consume which token symbol, at which style key, state and rank.",
667
- toolDescription: 'List the token BINDINGS the design system records — which block consumes which symbol, at which style key, state, rank and node. Every column is identity: two bindings differing only in state are different facts. The block is the CONSUMING block; via names the block whose anatomy the binding was authored in, and is blank when that is the consuming block itself. Name the symbol by its dotted name (symbol) or by a CSS variable standing for it (variable). Answers empty until the packs record bindings. Example: token_consumers { variable: "color-text" }.',
671
+ toolDescription: "List the token BINDINGS the design system records — which block consumes which symbol, at which style key, state, rank and node. Every column is identity: two bindings differing only in state are different facts. The block is the CONSUMING block; via names the block whose anatomy the binding was authored in, and is blank when that is the consuming block itself. Name the symbol by its dotted name (symbol) or by a CSS variable standing for it (variable); narrow to the components a name reaches, or to one by IRI, with block. Answers empty until the packs record bindings.",
672
+ useWhen: "when asked which components use a token, or what changing one affects",
673
+ example: { symbol: ["color.text", "color.border"] },
668
674
  // Seven identity columns, and not one of them is decoration: a binding
669
675
  // is identified by the whole tuple, so dropping `rank` or `node` would
670
676
  // publish rows a caller cannot tell apart — which is worse than a wide
@@ -691,7 +697,7 @@ const designSystemStories = [
691
697
  // because "Button via Button" is not news and 24 of Button's rows
692
698
  // would say it.
693
699
  query: [
694
- "SELECT ?block ?via ?symbol ?key ?state ?rank ?node ?uri",
700
+ "SELECT ?block ?via ?symbol ?key ?state ?rank ?node ?uri ?blockUri ?symbolUri",
695
701
  ' (GROUP_CONCAT(DISTINCT ?variableName; SEPARATOR=" ") AS ?variable)',
696
702
  "WHERE {",
697
703
  " ?blockUri ds:hasTokenBinding ?uri .",
@@ -703,13 +709,9 @@ const designSystemStories = [
703
709
  " OPTIONAL { ?uri ds:node ?node }",
704
710
  " OPTIONAL { ?uri ds:viaBlock ?viaUri . OPTIONAL { ?viaUri ds:name ?viaName } }",
705
711
  " OPTIONAL { ?blockUri ds:name ?blockName }",
706
- // Every platform spelling of the consumed symbol, as a SET rather
707
- // than a join that multiplies the row: 204 symbols carry both a
708
- // kebab and a camelCase variable, and binding one row per variable
709
- // would publish each binding twice under names a caller cannot tell
710
- // apart. Aggregated, both spellings land in one cell and `--variable`
711
- // set-matches either — which is also why the two spellings of one
712
- // symbol return the SAME set rather than partitioning it.
712
+ // The variable standing for the consumed symbol, as a SET rather
713
+ // than a join: a second platform's variable must add a name to the
714
+ // cell, not a second row for one binding.
713
715
  " OPTIONAL {",
714
716
  " ?variableUri dt:ofSymbol ?symbolUri ;",
715
717
  " rdfs:label ?variableName .",
@@ -724,7 +726,7 @@ const designSystemStories = [
724
726
  ' COALESCE(?viaName, REPLACE(STR(?viaUri), "^.*[/#]", "")),',
725
727
  ' "") AS ?via)',
726
728
  "}",
727
- "GROUP BY ?block ?via ?symbol ?key ?state ?rank ?node ?uri",
729
+ "GROUP BY ?block ?via ?symbol ?key ?state ?rank ?node ?uri ?blockUri ?symbolUri",
728
730
  // `?via` second, so a block's OWN bindings (blank via, which sorts
729
731
  // first) come before the ones it inherits, and the inherited ones
730
732
  // stay grouped by the block they come from.
@@ -742,66 +744,40 @@ const designSystemStories = [
742
744
  // in; a story cannot reorder that, so the column goes rather than the
743
745
  // block staying second to an unusable id.
744
746
  columns: [
745
- { field: "block", label: "Block" },
747
+ { field: "block", label: "Block", noun: "block" },
746
748
  { field: "via", label: "Via" },
747
- { field: "symbol", label: "Symbol" },
748
- { field: "variable", label: "Variables" },
749
+ { field: "symbol", label: "Symbol", noun: "token" },
750
+ { field: "variable", label: "Variables", noun: "variable" },
749
751
  { field: "key", label: "Style key" },
750
752
  { field: "state", label: "State" },
751
753
  { field: "rank", label: "Rank" },
752
754
  { field: "node", label: "Node" },
753
755
  ],
754
756
  filters: [
757
+ {
758
+ param: "block",
759
+ variable: "block",
760
+ // By IRI, because a block name is not an address: 313 blocks
761
+ // share some 277 names. A name means every block it reaches, in
762
+ // every tier; a prefixed IRI means one.
763
+ noun: "block",
764
+ entity: "blockUri",
765
+ description: "Filter to the blocks a name reaches (every tier), or to one block by IRI.",
766
+ },
755
767
  {
756
768
  param: "symbol",
757
769
  variable: "symbol",
758
- vocabulary: {
759
- query: [
760
- "SELECT DISTINCT ?symbol WHERE {",
761
- " ?s a dt:TokenSymbol ;",
762
- " rdfs:label ?symbol .",
763
- "}",
764
- ].join("\n"),
765
- },
770
+ noun: "token",
771
+ entity: "symbolUri",
766
772
  description: "Filter to one symbol.",
767
773
  },
768
774
  {
769
775
  param: "variable",
770
776
  variable: "variable",
771
- // The SAME constraint as `--symbol`, named by the other spelling.
772
- // A web implementer holds a CSS custom-property name, not a dotted
773
- // symbol, so answering "what breaks if I change --color-text" used
774
- // to take two calls and a spelling the caller did not start with.
775
- // The join is in the query instead.
776
- //
777
- // `set`, because the cell is every platform spelling of the
778
- // consumed symbol and one row legitimately belongs to all of them.
779
- match: "set",
780
- // The variable labels, the same source `variable lookup` resolves
781
- // against — so a name that works there works here.
782
- vocabulary: {
783
- query: [
784
- "SELECT DISTINCT ?variable WHERE {",
785
- " ?v a dt:Variable ;",
786
- " rdfs:label ?variable .",
787
- "}",
788
- ].join("\n"),
789
- },
790
- // Two things a caller will otherwise assume, both wrong.
791
- //
792
- // A CHANNEL variable and its semantic sibling are DIFFERENT
793
- // constraints: `--variable modifier-color-text` finds the blocks
794
- // that bind the channel, `--variable color-text` those that bind
795
- // the symbol, and neither includes the other. Whether a block's
796
- // resolution eventually reaches the other through a fallback is a
797
- // question about the consumed list, not about this single-symbol
798
- // join, and blurring them here would answer a question nobody
799
- // asked with rows nobody can check.
800
- //
801
- // And a variable standing for NO symbol has no answer down this
802
- // path at all — 236 of them do — which is an empty answer for a
803
- // reason the recovery below names, not evidence that nothing
804
- // consumes it.
777
+ // Constrains the SYMBOL, through any variable standing for it.
778
+ noun: "variable",
779
+ entity: "symbolUri",
780
+ via: "^dt:ofSymbol",
805
781
  description: "A CSS variable name for the consumed symbol — the other spelling of the symbol parameter. A channel variable and its semantic sibling differ.",
806
782
  },
807
783
  {
@@ -854,19 +830,9 @@ const designSystemStories = [
854
830
  variables: ["block", "via", "symbol", "key", "state", "node"],
855
831
  description: "Search block, via, symbol, key, state and node.",
856
832
  },
857
- // Deliberately `sources update`: unlike `standard list`, this story's
858
- // data does NOT ride the embedded snapshot — the binding records are
859
- // written by the design-system packs, so an empty answer here can be a
860
- // store that predates them.
861
- //
862
- // CAN be, not is — which is why the message opens on the two cases
863
- // rather than asserting one. This text prints under a filtered miss too
864
- // (`--symbol color.text`), where "nothing is recorded at all" would be a
865
- // claim the answer cannot support, so it names both readings and hands
866
- // the reader the one command that separates them.
867
833
  emptyRecovery: {
868
- message: "Either no component uses this token, or no component is recorded as using any token yet — which components use which tokens comes from the component anatomies in the design-system document, and a copy of the graph built before any anatomy named its tokens is empty for every token. Run the same command without `--symbol` to tell the two apart: an empty unfiltered answer means the graph predates the anatomies and fills in once they are written and the graph is rebuilt. If you asked about a CSS variable rather than a token: some variables are computed from others (the `--hover--…` and `--disabled--…` ones, for example) and stand for no token, so nothing is ever recorded as using them; `pragma variable chain --variable <name>` shows what such a variable ends up as.",
869
- cli: "sources update",
834
+ message: "Which components use which tokens is recorded from the component anatomies, and not every component's anatomy names its tokens yet, so a component with no rows may simply not be recorded. A CSS variable computed from others (the `--hover--…` and `--disabled--…` ones, for example) stands for no token and is never recorded as used; the variable chain read shows what it ends up as. If this list is empty with no filter at all, the graph predates the anatomies and a rebuild fills it in.",
835
+ call: { verb: "sources update" },
870
836
  },
871
837
  },
872
838
  ],
@@ -879,13 +845,16 @@ const designSystemStories = [
879
845
  by: "rdfs:label",
880
846
  type: "dt:TokenSymbol",
881
847
  description: "Look up one or more token symbols by dotted name, IRI, or glob.",
882
- toolDescription: 'Get one design-token symbol in full: its own type and description, every definition behind it with that definition\'s own type and description, the modifier families that may rebind it, and the value it resolves to at each position. Address it by the dotted name token_list publishes (`color.text`), by prefixed name, by IRI, or by a glob. Example: token_lookup { name: ["color.text"] }.',
848
+ toolDescription: "Get one design-token symbol in full: its own type and description, every definition behind it with that definition's own type and description, the modifier families that may rebind it, and the value it resolves to at each position. Address it by the dotted name token_list publishes (`color.text`), by prefixed name, by IRI, or by a glob.",
849
+ useWhen: "when asked everything about one token by name: where it is defined, what can change it, and its values",
850
+ example: { name: ["color.text", "color.border"] },
883
851
  fields: [
884
852
  // Single-valued: a channel provisions exactly one symbol.
885
853
  {
886
854
  name: "channelOf",
887
855
  property: "dt:channelOf/rdfs:label",
888
856
  label: "Channel of",
857
+ noun: "token",
889
858
  },
890
859
  // The same pair `token list` publishes, reached the same way: the head
891
860
  // of a resolved value's chain is the definition that value was authored
@@ -913,10 +882,22 @@ const designSystemStories = [
913
882
  },
914
883
  ],
915
884
  expand: [
885
+ {
886
+ name: "variables",
887
+ heading: "CSS variables",
888
+ // Without their leading dashes — the address `variable lookup` takes.
889
+ // Tokens whose name has a capital carry an older camelCase twin
890
+ // variable until canonical/design-tokens#141 lands.
891
+ relation: "^dt:ofSymbol",
892
+ level: "summary",
893
+ orderBy: ["name"],
894
+ select: [{ name: "name", property: "rdfs:label", noun: "variable" }],
895
+ },
916
896
  {
917
897
  name: "definitions",
918
898
  heading: "Definitions",
919
899
  kind: "table",
900
+ level: "standard",
920
901
  // The inverse edge: definitions point AT the symbol
921
902
  // (`?definition dt:symbol ?uri`), so the relation from the symbol is
922
903
  // `^dt:symbol`. 1,311 definitions stand behind 745 symbols.
@@ -930,17 +911,30 @@ const designSystemStories = [
930
911
  {
931
912
  name: "coverage",
932
913
  heading: "Covered by",
914
+ level: "standard",
933
915
  // Coverage hangs on the FAMILY, not on the symbol
934
916
  // (`?family dt:covers ?symbol`), so this is the inverse too. The
935
917
  // family is a `ds:` entity, so its name comes from the
936
918
  // design-system pack rather than the token ontology.
937
919
  relation: "^dt:covers",
938
- select: [{ name: "family", property: "ds:name" }],
920
+ select: [{ name: "family", property: "ds:name", noun: "modifier" }],
921
+ },
922
+ {
923
+ name: "channels",
924
+ heading: "Channels",
925
+ level: "standard",
926
+ // The symbols that provision this one, at most two. What a channel
927
+ // derives from at each position is that channel's own `values`
928
+ // table: a second hop here would repeat each channel once per
929
+ // position.
930
+ relation: "^dt:channelOf",
931
+ select: [{ name: "name", property: "rdfs:label", noun: "token" }],
939
932
  },
940
933
  {
941
934
  name: "values",
942
935
  heading: "Values",
943
936
  kind: "table",
937
+ level: "standard",
944
938
  relation: "^dt:forSymbol",
945
939
  // BOTH the chain and the derivation, for the reason `token values`
946
940
  // states: the shape admits exactly one of them, and selecting only
@@ -961,13 +955,22 @@ const designSystemStories = [
961
955
  { name: "position", property: "dt:coordinate" },
962
956
  { name: "value", property: "dt:resolvesTo" },
963
957
  { name: "chain", property: "dt:resolutionChain/rdf:first" },
964
- { name: "derivedFrom", property: "dt:derivedFrom/rdfs:label" },
958
+ {
959
+ name: "derivedFrom",
960
+ property: "dt:derivedFrom/rdfs:label",
961
+ noun: "token",
962
+ },
965
963
  ],
966
964
  },
967
965
  ],
966
+ disclosure: {
967
+ levels: ["summary", "standard", "detailed"],
968
+ default: "detailed",
969
+ },
968
970
  sample: {
969
971
  fixedCount: true,
970
- toolDescription: "Return random complete design-token symbols — definitions, coverage and resolved values — as exemplars. Use BEFORE writing queries to see real data shapes. Example: token_sample {}.",
972
+ toolDescription: "Return random complete design-token symbols — definitions, coverage and resolved values — as exemplars.",
973
+ useWhen: "before your first token query, to see what a real token record looks like",
971
974
  },
972
975
  },
973
976
  },
@@ -992,15 +995,17 @@ const designSystemStories = [
992
995
  {
993
996
  noun: "variable",
994
997
  description: "List the platform variables the design tokens are emitted as.",
995
- toolDescription: 'List the platform VARIABLES a stylesheet declares as CSS custom properties, with the symbol each stands for, its tier, visibility and the coordinates it is selected at. 236 stand for no symbol, so token_list cannot reach them. Address one WITHOUT its leading dashes (`color-text`). Example: variable_list { symbol: "color.text" }.',
998
+ toolDescription: "List the platform VARIABLES a stylesheet declares as CSS custom properties, with the symbol each stands for, its tier, visibility and the coordinates it is selected at. 236 stand for no symbol, so token_list cannot reach them. Address one WITHOUT its leading dashes (`color-text`).",
999
+ useWhen: "when asked which CSS custom properties (variables) exist, or which CSS variable stands for a token",
1000
+ example: { symbol: ["color.text", "color.border"] },
996
1001
  list: {
997
1002
  query: [
998
- "SELECT ?uri ?name ?platform ?symbol ?tier ?visibility",
1003
+ "SELECT ?uri ?name ?platform ?symbol ?tier ?visibility ?symbolUri",
999
1004
  ' (GROUP_CONCAT(DISTINCT ?coordinateName; SEPARATOR=" ") AS ?coordinate)',
1000
1005
  "WHERE {",
1001
1006
  " ?uri a dt:Variable ;",
1002
1007
  " rdfs:label ?name .",
1003
- " OPTIONAL { ?uri dt:ofSymbol/rdfs:label ?symbol }",
1008
+ " OPTIONAL { ?uri dt:ofSymbol ?symbolUri . ?symbolUri rdfs:label ?symbol }",
1004
1009
  " OPTIONAL { ?uri dt:tier ?tierUri }",
1005
1010
  " OPTIONAL { ?uri dt:visibility ?visibilityUri }",
1006
1011
  // A variable is selected at a coordinate two ways, and both count: the
@@ -1023,12 +1028,12 @@ const designSystemStories = [
1023
1028
  ' BIND(REPLACE(REPLACE(STR(?tierUri), "^.*[/#]", ""), "^tier[.]", "") AS ?tier)',
1024
1029
  ' BIND(REPLACE(REPLACE(STR(?visibilityUri), "^.*[/#]", ""), "^visibility[.]", "") AS ?visibility)',
1025
1030
  "}",
1026
- "GROUP BY ?uri ?name ?platform ?symbol ?tier ?visibility",
1031
+ "GROUP BY ?uri ?name ?platform ?symbol ?tier ?visibility ?symbolUri",
1027
1032
  "ORDER BY ?name",
1028
1033
  ].join("\n"),
1029
1034
  columns: [
1030
1035
  { field: "name", label: "Name" },
1031
- { field: "symbol", label: "Symbol" },
1036
+ { field: "symbol", label: "Symbol", noun: "token" },
1032
1037
  { field: "tier", label: "Tier" },
1033
1038
  { field: "visibility", label: "Visibility" },
1034
1039
  { field: "platform", label: "Platform" },
@@ -1057,16 +1062,8 @@ const designSystemStories = [
1057
1062
  {
1058
1063
  param: "symbol",
1059
1064
  variable: "symbol",
1060
- // The symbol roster, read the same way `token list`'s `channelOf`
1061
- // filter reads it: every symbol, keyed on `rdfs:label`.
1062
- vocabulary: {
1063
- query: [
1064
- "SELECT DISTINCT ?symbol WHERE {",
1065
- " ?s a dt:TokenSymbol ;",
1066
- " rdfs:label ?symbol .",
1067
- "}",
1068
- ].join("\n"),
1069
- },
1065
+ noun: "token",
1066
+ entity: "symbolUri",
1070
1067
  description: "Filter to one symbol.",
1071
1068
  },
1072
1069
  {
@@ -1120,15 +1117,16 @@ const designSystemStories = [
1120
1117
  description: "Search name and symbol.",
1121
1118
  },
1122
1119
  emptyRecovery: {
1123
- message: "Platform variables come from the @canonical/token-ontology pack, and a variable is only addressable once that pack publishes its name literals — a store built without that pack carries none.",
1124
- cli: "sources update",
1120
+ message: "Some tokens, such as the composite typography ones (`typography.heading.1`), have no CSS variable of their own; the token values read shows their value.",
1125
1121
  },
1126
1122
  },
1127
1123
  verbs: [
1128
1124
  {
1129
1125
  verb: "chain",
1130
1126
  description: "List the walk from a variable to every symbol it reaches, through every variable in between.",
1131
- toolDescription: 'List the resolution WALK: every (variable, symbol) pair a variable reaches through what its declarations reference, transitively — what a variable finally means. The closure runs over every declaration of every hop, so one variable can reach dozens of pairs. Example: variable_chain { variable: "modifier-color-text" }.',
1127
+ toolDescription: "List the resolution WALK: every (variable, symbol) pair a variable reaches through what its declarations reference, transitively — what a variable finally means. The closure runs over every declaration of every hop, so one variable can reach dozens of pairs.",
1128
+ useWhen: "when asked which tokens a CSS variable ends up referring to",
1129
+ example: { variable: ["modifier-color-text", "modifier-color-border"] },
1132
1130
  // ONE property path carries the whole walk, which is why this is a
1133
1131
  // query and not a traversal in code. `dt:references` is an rdf:List of
1134
1132
  // the variables a declaration's value reads, so each hop is
@@ -1136,7 +1134,7 @@ const designSystemStories = [
1136
1134
  // the whole thing transitive. The terminal is a variable that stands
1137
1135
  // for a symbol, which is what `dt:ofSymbol` reads.
1138
1136
  query: [
1139
- "SELECT ?variable ?reaches ?symbol",
1137
+ "SELECT ?variable ?reaches ?symbol ?uri ?symbolUri",
1140
1138
  "WHERE {",
1141
1139
  " ?uri a dt:Variable ;",
1142
1140
  " rdfs:label ?variable .",
@@ -1148,46 +1146,29 @@ const designSystemStories = [
1148
1146
  "ORDER BY ?variable ?reaches ?symbol",
1149
1147
  ].join("\n"),
1150
1148
  columns: [
1151
- { field: "variable", label: "Variable" },
1149
+ { field: "variable", label: "Variable", noun: "variable" },
1152
1150
  { field: "reaches", label: "Reaches" },
1153
- { field: "symbol", label: "Symbol" },
1151
+ { field: "symbol", label: "Symbol", noun: "token" },
1154
1152
  ],
1155
1153
  filters: [
1156
1154
  {
1157
1155
  param: "variable",
1158
1156
  variable: "variable",
1159
- // The variable roster, keyed on the same `rdfs:label` the column
1160
- // binds and the lookup resolves by — the CSS name with its leading
1161
- // `--` already stripped, which is the only form typable as a
1162
- // positional. `variable.parity.test.ts` pins that the stripping is
1163
- // injective and collides with no symbol name.
1164
- vocabulary: {
1165
- query: [
1166
- "SELECT DISTINCT ?variable WHERE {",
1167
- " ?v a dt:Variable ;",
1168
- " rdfs:label ?variable .",
1169
- "}",
1170
- ].join("\n"),
1171
- },
1157
+ noun: "variable",
1158
+ entity: "uri",
1172
1159
  description: "Filter to one variable.",
1173
1160
  },
1174
1161
  {
1175
1162
  param: "symbol",
1176
1163
  variable: "symbol",
1177
- vocabulary: {
1178
- query: [
1179
- "SELECT DISTINCT ?symbol WHERE {",
1180
- " ?s a dt:TokenSymbol ;",
1181
- " rdfs:label ?symbol .",
1182
- "}",
1183
- ].join("\n"),
1184
- },
1164
+ noun: "token",
1165
+ entity: "symbolUri",
1185
1166
  description: "Filter to one symbol.",
1186
1167
  },
1187
1168
  ],
1188
1169
  emptyRecovery: {
1189
1170
  message: "A resolution walk follows the declarations the @canonical/token-ontology pack provides, and the walk is only addressable by name once that pack publishes its name literals — a store built without that pack carries none.",
1190
- cli: "sources update",
1171
+ call: { verb: "sources update" },
1191
1172
  },
1192
1173
  },
1193
1174
  ],
@@ -1200,9 +1181,16 @@ const designSystemStories = [
1200
1181
  by: "rdfs:label",
1201
1182
  type: "dt:Variable",
1202
1183
  description: "Look up one or more platform variables by name (without the leading dashes), IRI, or glob.",
1203
- toolDescription: 'Get one platform variable in full: its symbol, tier, visibility, and EVERY place it is declared — the selector and at-rule stack, the emitted value, the source location, the coordinate it also applies at, and the derivation. Address it by the CSS name WITHOUT its leading dashes (`color-text`). Example: variable_lookup { name: ["color-text"] }.',
1184
+ toolDescription: "Get one platform variable in full: its symbol, tier, visibility, and EVERY place it is declared — the selector and at-rule stack, the emitted value, the source location, the coordinate it also applies at, and the derivation. Address it by the CSS name WITHOUT its leading dashes (`color-text`).",
1185
+ useWhen: "when asked about one CSS variable by name: what it stands for and everywhere it is declared",
1186
+ example: { name: ["color-text", "color-border"] },
1204
1187
  fields: [
1205
- { name: "symbol", property: "dt:ofSymbol/rdfs:label", label: "Symbol" },
1188
+ {
1189
+ name: "symbol",
1190
+ property: "dt:ofSymbol/rdfs:label",
1191
+ label: "Symbol",
1192
+ noun: "token",
1193
+ },
1206
1194
  { name: "tier", property: "dt:tier", label: "Tier" },
1207
1195
  { name: "visibility", property: "dt:visibility", label: "Visibility" },
1208
1196
  ],
@@ -1212,6 +1200,7 @@ const designSystemStories = [
1212
1200
  heading: "Declarations",
1213
1201
  kind: "table",
1214
1202
  relation: "dt:declaredAt",
1203
+ level: "standard",
1215
1204
  // 927 variables are declared once; the rest up to 17 times, which is
1216
1205
  // why this is an expand and not a set of fields.
1217
1206
  select: [
@@ -1235,10 +1224,37 @@ const designSystemStories = [
1235
1224
  { name: "derives", property: "dt:derives" },
1236
1225
  ],
1237
1226
  },
1227
+ {
1228
+ name: "values",
1229
+ heading: "Values",
1230
+ kind: "table",
1231
+ // What the variable's symbol resolves to, one row per position the
1232
+ // graph materialises: the base row has no position, a channel's rows
1233
+ // carry the symbol each position derives from and no value. A
1234
+ // declaration's `emits` is the stylesheet's expression; this is the
1235
+ // value that expression comes to.
1236
+ relation: "dt:ofSymbol/^dt:forSymbol",
1237
+ level: "detailed",
1238
+ orderBy: ["position"],
1239
+ select: [
1240
+ { name: "position", property: "dt:coordinate" },
1241
+ { name: "value", property: "dt:resolvesTo" },
1242
+ {
1243
+ name: "derivedFrom",
1244
+ property: "dt:derivedFrom/rdfs:label",
1245
+ noun: "token",
1246
+ },
1247
+ ],
1248
+ },
1238
1249
  ],
1250
+ disclosure: {
1251
+ levels: ["summary", "standard", "detailed"],
1252
+ default: "detailed",
1253
+ },
1239
1254
  sample: {
1240
1255
  fixedCount: true,
1241
- toolDescription: "Return random complete platform variables — symbol, tier, visibility and every declaration — as exemplars. Use BEFORE writing queries to see real data shapes. Example: variable_sample {}.",
1256
+ toolDescription: "Return random complete platform variables — symbol, tier, visibility and every declaration — as exemplars.",
1257
+ useWhen: "before your first variable query, to see what a real CSS variable record looks like",
1242
1258
  },
1243
1259
  },
1244
1260
  },
@@ -1250,7 +1266,9 @@ const designSystemStories = [
1250
1266
  {
1251
1267
  noun: "modifier",
1252
1268
  description: "List all modifier families.",
1253
- toolDescription: "List all modifier families with their values. Use when browsing which modifier families exist and the values each allows. Example: modifier_list {}.",
1269
+ toolDescription: "List all modifier families with their values.",
1270
+ useWhen: "when asked which variants or options components can take — importance, size, density and the like — and the values each allows",
1271
+ example: { tier: "all" },
1254
1272
  // Tiered like blocks — 11 of the modifier families carry a `ds:tier` — so
1255
1273
  // the same scope, declared with the same four terms. The scope is per NOUN
1256
1274
  // because being tiered is a fact about the entities, and the design
@@ -1283,25 +1301,84 @@ const designSystemStories = [
1283
1301
  ],
1284
1302
  emptyRecovery: {
1285
1303
  message: "No modifier families in the store. Build it from the configured design-system packs.",
1286
- cli: "sources update",
1304
+ call: { verb: "sources update" },
1287
1305
  },
1288
1306
  },
1289
1307
  lookup: {
1290
1308
  source: "graphql",
1291
1309
  by: "ds:name",
1292
1310
  type: "ds:ModifierFamily",
1293
- toolDescription: '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 { name: ["importance"] }.',
1311
+ toolDescription: "Get values and usage details for one or more modifier families by name.",
1312
+ useWhen: "when asked which values one option allows, such as the levels of importance",
1313
+ example: { name: ["Importance", "Density"] },
1294
1314
  expand: [
1295
1315
  {
1296
1316
  name: "values",
1297
1317
  heading: "Values",
1298
1318
  relation: "ds:hasModifier",
1319
+ level: "standard",
1299
1320
  select: [{ name: "name", property: "ds:name" }],
1300
1321
  },
1322
+ // The token side of the family, joined on the family's own IRI — an
1323
+ // axis is not named after its family (`theme` encodes Mode). SPARQL
1324
+ // lane: three of the four start on an inverse edge, which a generated
1325
+ // document cannot walk.
1326
+ {
1327
+ name: "axis",
1328
+ heading: "Token axis",
1329
+ relation: "^dt:encodes",
1330
+ source: "sparql",
1331
+ level: "standard",
1332
+ select: [{ name: "name", property: "w3c-tokens:name" }],
1333
+ },
1334
+ {
1335
+ name: "positions",
1336
+ heading: "Positions",
1337
+ kind: "table",
1338
+ relation: "^dt:encodes/w3c-tokens:context",
1339
+ source: "sparql",
1340
+ level: "standard",
1341
+ orderBy: ["context"],
1342
+ select: [
1343
+ { name: "context", property: "w3c-tokens:name" },
1344
+ { name: "position", property: "dt:encodes" },
1345
+ { name: "value", property: "dt:encodes/dt:concept/ds:name" },
1346
+ ],
1347
+ },
1348
+ {
1349
+ name: "contract",
1350
+ heading: "Token contract",
1351
+ kind: "table",
1352
+ relation: "dt:contract",
1353
+ source: "sparql",
1354
+ level: "standard",
1355
+ select: [
1356
+ { name: "level", property: "dt:level" },
1357
+ { name: "provision", property: "dt:provision" },
1358
+ { name: "providesType", property: "dt:providesType" },
1359
+ ],
1360
+ },
1361
+ {
1362
+ name: "tokens",
1363
+ heading: "Covered tokens",
1364
+ // The symbols a value of this family may rebind. A block can declare
1365
+ // the family and consume none of them; `token consumers` says which
1366
+ // do. At `detailed` only: Mode covers 354 of them.
1367
+ relation: "dt:covers",
1368
+ source: "sparql",
1369
+ level: "detailed",
1370
+ orderBy: ["name"],
1371
+ select: [{ name: "name", property: "rdfs:label", noun: "token" }],
1372
+ },
1301
1373
  ],
1374
+ disclosure: {
1375
+ levels: ["summary", "standard", "detailed"],
1376
+ default: "detailed",
1377
+ },
1302
1378
  sample: {
1303
1379
  fixedCount: true,
1304
- toolDescription: "Return randomly selected complete modifier families (with value lists) as exemplars. Use BEFORE writing queries to see actual data shapes. Example: modifier_sample {}.",
1380
+ toolDescription: "Return randomly selected complete modifier families (with value lists) as exemplars.",
1381
+ useWhen: "before your first modifier query, to see what a real modifier family record looks like",
1305
1382
  },
1306
1383
  },
1307
1384
  },
@@ -1316,7 +1393,8 @@ const designSystemStories = [
1316
1393
  {
1317
1394
  noun: "tier",
1318
1395
  description: "List all tiers in the design system ontology.",
1319
- toolDescription: "List all tiers in the design-system ontology. Use when picking the tier to read with: the `tier` parameter scopes a read to one tier plus its ancestors, and this list is never scoped itself. Example: tier_list {}.",
1396
+ toolDescription: "List all tiers in the design-system ontology. The `tier` parameter scopes a read to one tier plus its ancestors, and this list is never scoped itself.",
1397
+ useWhen: "when asked which tiers the design system has — global, apps, a single product — or before passing `tier` to another tool",
1320
1398
  list: {
1321
1399
  query: [
1322
1400
  "SELECT ?uri ?name WHERE {",
@@ -1334,7 +1412,9 @@ const designSystemStories = [
1334
1412
  by: "ds:name",
1335
1413
  type: "ds:Tier",
1336
1414
  description: "Show tiers by name, with the blocks scoped to each.",
1337
- toolDescription: '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 { name: ["apps/lxd"] }.',
1415
+ toolDescription: "Get one or more tiers by name, with the blocks scoped directly to each.",
1416
+ useWhen: "when asked which components belong to one tier or product",
1417
+ example: { name: ["apps/lxd", "global"] },
1338
1418
  expand: [
1339
1419
  {
1340
1420
  name: "blocks",
@@ -1356,7 +1436,9 @@ const designSystemStories = [
1356
1436
  const conceptStory = {
1357
1437
  noun: "concept",
1358
1438
  description: "List design-system concepts.",
1359
- toolDescription: 'List design-system concepts — long-form foundations, how-to guides, and decision guides not bound to a single UI block. Optionally filter by type or search. Example: concept_list { type: "Explanation" }.',
1439
+ toolDescription: "List design-system concepts — long-form foundations, how-to guides, and decision guides not bound to a single UI block. Optionally filter by type or search.",
1440
+ useWhen: "when asked for design guidance that is not about one component — foundations, how-to guides, decision guides",
1441
+ example: { type: ["Explanation", "How to guide"] },
1360
1442
  // Concepts carry a `ds:tier` too (4 of them do), so they are scoped on the
1361
1443
  // same terms as blocks and modifier families. Its `list` publishes no tier
1362
1444
  // COLUMN and does not need to: the scope constrains the entity through
@@ -1411,7 +1493,7 @@ const conceptStory = {
1411
1493
  },
1412
1494
  emptyRecovery: {
1413
1495
  message: "Concepts come from the @canonical/design-system pack, and a local store built without it carries none — refresh it.",
1414
- cli: "sources update",
1496
+ call: { verb: "sources update" },
1415
1497
  },
1416
1498
  },
1417
1499
  lookup: {
@@ -1419,7 +1501,9 @@ const conceptStory = {
1419
1501
  by: "ds:name",
1420
1502
  type: "ds:Concept",
1421
1503
  description: "Look up a concept's full documentation by name, IRI, or glob.",
1422
- toolDescription: 'Get a design-system concept\'s full Markdown documentation. Address concepts by the name concept_list publishes, by prefixed name (ds:concept.…), by absolute IRI, or by a glob. Example: concept_lookup { name: ["Foundations: Grid"] }.',
1504
+ toolDescription: "Get a design-system concept's full Markdown documentation. Address concepts by the name concept_list publishes, by prefixed name (ds:concept.…), by absolute IRI, or by a glob.",
1505
+ useWhen: "when asked to read one guide or foundation in full",
1506
+ example: { name: ["Foundations: Spacing", "Foundations: Surfaces"] },
1423
1507
  fields: [
1424
1508
  { name: "type", property: "ds:conceptType/ds:name", label: "Type" },
1425
1509
  { name: "tier", property: "ds:tier", label: "Tier" },
@@ -1468,7 +1552,9 @@ const conceptStory = {
1468
1552
  const implementationStory = {
1469
1553
  noun: "implementation",
1470
1554
  description: "List which library implements which design-system block.",
1471
- toolDescription: 'List the implementations of design-system blocks — which library implements which block, on which platform, and the source file it lives in. Optionally filter by platform or library, or search. Example: implementation_list { platform: "react" }.',
1555
+ toolDescription: "List the implementations of design-system blocks — which library implements which block, on which platform, and the source file it lives in. Optionally filter by platform or library, or search.",
1556
+ useWhen: "when asked whether a component is implemented in React, Svelte or another library, or where its source code lives",
1557
+ example: { platform: ["react", "svelte"] },
1472
1558
  list: {
1473
1559
  // The library is the subject that carries the platform, so the row is
1474
1560
  // assembled from BOTH ends of `ds:hasImplementation`. `?block` prefers the
@@ -1535,14 +1621,15 @@ const implementationStory = {
1535
1621
  },
1536
1622
  emptyRecovery: {
1537
1623
  message: "Implementations come from the @canonical/ds-implementations pack, and a local store built without it carries none — refresh it.",
1538
- cli: "sources update",
1624
+ call: { verb: "sources update" },
1539
1625
  },
1540
1626
  },
1541
1627
  verbs: [
1542
1628
  {
1543
1629
  verb: "libraries",
1544
1630
  description: "List the implementation libraries.",
1545
- toolDescription: "List the design-system implementation libraries — platform, tier, released version, and how many blocks each one implements. Example: implementation_libraries {}.",
1631
+ toolDescription: "List the design-system implementation libraries — platform, tier, released version, and how many blocks each one implements.",
1632
+ useWhen: "when asked which component libraries exist and what each covers",
1546
1633
  // `ds:implementationCount` is asserted by the aggregate index on the SAME
1547
1634
  // subject the per-library file describes, so the two merge in the store
1548
1635
  // and the count needs no aggregation here.
@@ -1569,7 +1656,7 @@ const implementationStory = {
1569
1656
  ],
1570
1657
  emptyRecovery: {
1571
1658
  message: "No implementation libraries in the store. The @canonical/ds-implementations pack provides them; refresh the local store.",
1572
- cli: "sources update",
1659
+ call: { verb: "sources update" },
1573
1660
  },
1574
1661
  },
1575
1662
  ],
@@ -1587,7 +1674,9 @@ const codeStandardsStories = [
1587
1674
  {
1588
1675
  noun: "standard",
1589
1676
  description: "List all code standards.",
1590
- toolDescription: 'List code standards: one ROW per standard — its IRI, name, category and description — not the standards themselves. Take a row\'s `name` VERBATIM to standard_lookup for the dos and donts. Optionally filter by category slug (a parent slug answers for its whole branch; standard_categories lists them) or by search term. Example: standard_list { category: "react" }.',
1677
+ toolDescription: "List code standards: one ROW per standard — its IRI, name, category and description — not the standards themselves. Take a row's `name` VERBATIM to standard_lookup for the dos and donts. Optionally filter by category slug (a parent slug answers for its whole branch; standard_categories lists them) or by search term.",
1678
+ useWhen: "when asked which coding rules or conventions apply — for React, CSS, testing, documentation and so on",
1679
+ example: { category: ["react", "css"] },
1591
1680
  list: {
1592
1681
  query: [
1593
1682
  // `?category` is the LEAF a standard is filed under — what a row
@@ -1668,14 +1757,15 @@ const codeStandardsStories = [
1668
1757
  // — which is what `standard categories` reads out.
1669
1758
  emptyRecovery: {
1670
1759
  message: "Category slugs come from the graph, and a parent slug answers for its whole branch — read them out rather than guessing.",
1671
- cli: "standard categories",
1760
+ call: { verb: "standard categories" },
1672
1761
  },
1673
1762
  },
1674
1763
  verbs: [
1675
1764
  {
1676
1765
  verb: "categories",
1677
1766
  description: "List all standard categories with counts (a parent counts its whole branch).",
1678
- toolDescription: "List all code standard categories with the number of standards each covers. Categories are a hierarchy: a parent's count includes every descendant, and `standard_list { category }` answers for the same set. Use this to pick a valid slug before filtering. Example: standard_categories {}.",
1767
+ toolDescription: "List all code standard categories with the number of standards each covers. Categories are a hierarchy: a parent's count includes every descendant, and `standard_list { category }` answers for the same set. Use this to pick a valid slug before filtering.",
1768
+ useWhen: "when asked which areas the code standards cover",
1679
1769
  query: [
1680
1770
  // The same reflexive roll-up `list` filters with — written the other
1681
1771
  // way round (every category whose broader-chain reaches ?cat), so the
@@ -1704,7 +1794,7 @@ const codeStandardsStories = [
1704
1794
  // question, not a staleness one.
1705
1795
  emptyRecovery: {
1706
1796
  message: "The code standards ship with the CLI itself, so no categories at all means the store did not load — not that it is out of date.",
1707
- cli: "doctor",
1797
+ call: { verb: "doctor" },
1708
1798
  },
1709
1799
  },
1710
1800
  ],
@@ -1745,7 +1835,12 @@ const codeStandardsStories = [
1745
1835
  nameFallback: "iri",
1746
1836
  type: "cs:CodeStandard",
1747
1837
  description: "Look up one or more standards by name, IRI, or glob. --detail standard adds the dos, --detail detailed adds the don'ts.",
1748
- toolDescription: 'Get one or more code standards in full, with dos and don\'ts as code examples. `detail` DEFAULTS to "summary", which returns neither: pass detail: "standard" for the dos and detail: "detailed" for dos AND don\'ts. Address a standard by the name standard_list publishes (`react/component/tsdoc`), by prefixed name (`cs:react.component.tsdoc`), by absolute IRI, or by a glob over any of those. Example: standard_lookup { name: ["react/component/tsdoc"], detail: "detailed" }.',
1838
+ toolDescription: 'Get one or more code standards in full, with dos and don\'ts as code examples. `detail` DEFAULTS to "summary", which returns neither: pass detail: "standard" for the dos and detail: "detailed" for dos AND don\'ts. Address a standard by the name standard_list publishes (`react/component/tsdoc`), by prefixed name (`cs:react.component.tsdoc`), by absolute IRI, or by a glob over any of those.',
1839
+ useWhen: "when asked how code should be written under one rule",
1840
+ example: {
1841
+ name: ["cs:react.component.tsdoc", "cs:react.component.props"],
1842
+ detail: "detailed",
1843
+ },
1749
1844
  fields: [
1750
1845
  {
1751
1846
  name: "category",
@@ -1789,7 +1884,9 @@ const codeStandardsStories = [
1789
1884
  },
1790
1885
  sample: {
1791
1886
  description: "Return randomly selected complete standard instances as exemplars for shape discovery.",
1792
- toolDescription: "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. Example: standard_sample { count: 2 }.",
1887
+ toolDescription: "Return 1–5 randomly selected complete code standard instances as exemplars. Each call returns different instances.",
1888
+ useWhen: "before your first standards query, to see what a real code standard record looks like",
1889
+ example: { count: "2" },
1793
1890
  },
1794
1891
  },
1795
1892
  },