@canonical/prism-cli 0.0.0-stage → 0.51.0-experimental.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 (985) hide show
  1. package/README.md +43 -2
  2. package/dist/.build-ok +0 -0
  3. package/dist/package.json +124 -0
  4. package/dist/prism.conf.js +42 -0
  5. package/dist/prism.conf.js.map +1 -0
  6. package/dist/src/bin.js +11 -0
  7. package/dist/src/bin.js.map +1 -0
  8. package/dist/src/build/generatorSurface.js +117 -0
  9. package/dist/src/build/generatorSurface.js.map +1 -0
  10. package/dist/src/build/index.js +24 -0
  11. package/dist/src/build/index.js.map +1 -0
  12. package/dist/src/capabilities/capabilities/capabilities.render.js +74 -0
  13. package/dist/src/capabilities/capabilities/capabilities.render.js.map +1 -0
  14. package/dist/src/capabilities/capabilities/capabilities.verb.js +62 -0
  15. package/dist/src/capabilities/capabilities/capabilities.verb.js.map +1 -0
  16. package/dist/src/capabilities/capabilities/catalog.js +140 -0
  17. package/dist/src/capabilities/capabilities/catalog.js.map +1 -0
  18. package/dist/src/capabilities/capabilities/index.js +13 -0
  19. package/dist/src/capabilities/capabilities/index.js.map +1 -0
  20. package/dist/src/capabilities/capabilities/types.js +11 -0
  21. package/dist/src/capabilities/capabilities/types.js.map +1 -0
  22. package/dist/src/capabilities/colophon/collectColophon.js +83 -0
  23. package/dist/src/capabilities/colophon/collectColophon.js.map +1 -0
  24. package/dist/src/capabilities/colophon/colophon.render.js +62 -0
  25. package/dist/src/capabilities/colophon/colophon.render.js.map +1 -0
  26. package/dist/src/capabilities/colophon/colophon.verb.js +44 -0
  27. package/dist/src/capabilities/colophon/colophon.verb.js.map +1 -0
  28. package/dist/src/capabilities/colophon/index.js +5 -0
  29. package/dist/src/capabilities/colophon/index.js.map +1 -0
  30. package/dist/src/capabilities/colophon/markdownTerminal.js +90 -0
  31. package/dist/src/capabilities/colophon/markdownTerminal.js.map +1 -0
  32. package/dist/src/capabilities/colophon/types.js +10 -0
  33. package/dist/src/capabilities/colophon/types.js.map +1 -0
  34. package/dist/src/capabilities/config/collectConfigShow.js +59 -0
  35. package/dist/src/capabilities/config/collectConfigShow.js.map +1 -0
  36. package/dist/src/capabilities/config/field.render.js +22 -0
  37. package/dist/src/capabilities/config/field.render.js.map +1 -0
  38. package/dist/src/capabilities/config/fields.js +46 -0
  39. package/dist/src/capabilities/config/fields.js.map +1 -0
  40. package/dist/src/capabilities/config/get.verb.js +63 -0
  41. package/dist/src/capabilities/config/get.verb.js.map +1 -0
  42. package/dist/src/capabilities/config/index.js +5 -0
  43. package/dist/src/capabilities/config/index.js.map +1 -0
  44. package/dist/src/capabilities/config/runField.js +59 -0
  45. package/dist/src/capabilities/config/runField.js.map +1 -0
  46. package/dist/src/capabilities/config/runGet.js +28 -0
  47. package/dist/src/capabilities/config/runGet.js.map +1 -0
  48. package/dist/src/capabilities/config/runSet.js +53 -0
  49. package/dist/src/capabilities/config/runSet.js.map +1 -0
  50. package/dist/src/capabilities/config/set.verb.js +69 -0
  51. package/dist/src/capabilities/config/set.verb.js.map +1 -0
  52. package/dist/src/capabilities/config/show.render.js +123 -0
  53. package/dist/src/capabilities/config/show.render.js.map +1 -0
  54. package/dist/src/capabilities/config/show.verb.js +45 -0
  55. package/dist/src/capabilities/config/show.verb.js.map +1 -0
  56. package/dist/src/capabilities/config/types.js +5 -0
  57. package/dist/src/capabilities/config/types.js.map +1 -0
  58. package/dist/src/capabilities/config/unset.verb.js +51 -0
  59. package/dist/src/capabilities/config/unset.verb.js.map +1 -0
  60. package/dist/src/capabilities/create/cliProjection.js +203 -0
  61. package/dist/src/capabilities/create/cliProjection.js.map +1 -0
  62. package/dist/src/capabilities/create/constants.js +51 -0
  63. package/dist/src/capabilities/create/constants.js.map +1 -0
  64. package/dist/src/capabilities/create/create.render.js +105 -0
  65. package/dist/src/capabilities/create/create.render.js.map +1 -0
  66. package/dist/src/capabilities/create/create.verb.js +413 -0
  67. package/dist/src/capabilities/create/create.verb.js.map +1 -0
  68. package/dist/src/capabilities/create/createHelp.js +47 -0
  69. package/dist/src/capabilities/create/createHelp.js.map +1 -0
  70. package/dist/src/capabilities/create/generatorToVerbSpec.js +106 -0
  71. package/dist/src/capabilities/create/generatorToVerbSpec.js.map +1 -0
  72. package/dist/src/capabilities/create/index.js +43 -0
  73. package/dist/src/capabilities/create/index.js.map +1 -0
  74. package/dist/src/capabilities/create/moduleNotFound.js +23 -0
  75. package/dist/src/capabilities/create/moduleNotFound.js.map +1 -0
  76. package/dist/src/capabilities/create/mount.js +302 -0
  77. package/dist/src/capabilities/create/mount.js.map +1 -0
  78. package/dist/src/capabilities/create/pathJail.js +65 -0
  79. package/dist/src/capabilities/create/pathJail.js.map +1 -0
  80. package/dist/src/capabilities/create/pickGenerator.js +48 -0
  81. package/dist/src/capabilities/create/pickGenerator.js.map +1 -0
  82. package/dist/src/capabilities/distribution.js +82 -0
  83. package/dist/src/capabilities/distribution.js.map +1 -0
  84. package/dist/src/capabilities/doctor/checks/checkKeStore.js +41 -0
  85. package/dist/src/capabilities/doctor/checks/checkKeStore.js.map +1 -0
  86. package/dist/src/capabilities/doctor/checks/checkNodeVersion.js +26 -0
  87. package/dist/src/capabilities/doctor/checks/checkNodeVersion.js.map +1 -0
  88. package/dist/src/capabilities/doctor/checks/checkPackageRefs.js +156 -0
  89. package/dist/src/capabilities/doctor/checks/checkPackageRefs.js.map +1 -0
  90. package/dist/src/capabilities/doctor/checks/checkPaths.js +62 -0
  91. package/dist/src/capabilities/doctor/checks/checkPaths.js.map +1 -0
  92. package/dist/src/capabilities/doctor/checks/checkPragmaVersion.js +32 -0
  93. package/dist/src/capabilities/doctor/checks/checkPragmaVersion.js.map +1 -0
  94. package/dist/src/capabilities/doctor/checks/checkShellCompletions.js +199 -0
  95. package/dist/src/capabilities/doctor/checks/checkShellCompletions.js.map +1 -0
  96. package/dist/src/capabilities/doctor/checks/harnessInventory.js +195 -0
  97. package/dist/src/capabilities/doctor/checks/harnessInventory.js.map +1 -0
  98. package/dist/src/capabilities/doctor/checks/index.js +27 -0
  99. package/dist/src/capabilities/doctor/checks/index.js.map +1 -0
  100. package/dist/src/capabilities/doctor/checks/isSupportedNodeVersion.js +32 -0
  101. package/dist/src/capabilities/doctor/checks/isSupportedNodeVersion.js.map +1 -0
  102. package/dist/src/capabilities/doctor/checks/mcpCommand.js +57 -0
  103. package/dist/src/capabilities/doctor/checks/mcpCommand.js.map +1 -0
  104. package/dist/src/capabilities/doctor/checks/targetHealth.js +459 -0
  105. package/dist/src/capabilities/doctor/checks/targetHealth.js.map +1 -0
  106. package/dist/src/capabilities/doctor/doctor.render.js +164 -0
  107. package/dist/src/capabilities/doctor/doctor.render.js.map +1 -0
  108. package/dist/src/capabilities/doctor/doctor.verb.js +51 -0
  109. package/dist/src/capabilities/doctor/doctor.verb.js.map +1 -0
  110. package/dist/src/capabilities/doctor/index.js +5 -0
  111. package/dist/src/capabilities/doctor/index.js.map +1 -0
  112. package/dist/src/capabilities/doctor/runChecks.js +88 -0
  113. package/dist/src/capabilities/doctor/runChecks.js.map +1 -0
  114. package/dist/src/capabilities/doctor/types.js +5 -0
  115. package/dist/src/capabilities/doctor/types.js.map +1 -0
  116. package/dist/src/capabilities/graph/connect.render.js +101 -0
  117. package/dist/src/capabilities/graph/connect.render.js.map +1 -0
  118. package/dist/src/capabilities/graph/connect.types.js +21 -0
  119. package/dist/src/capabilities/graph/connect.types.js.map +1 -0
  120. package/dist/src/capabilities/graph/connect.verb.js +150 -0
  121. package/dist/src/capabilities/graph/connect.verb.js.map +1 -0
  122. package/dist/src/capabilities/graph/index.js +21 -0
  123. package/dist/src/capabilities/graph/index.js.map +1 -0
  124. package/dist/src/capabilities/graph/inspect.render.js +82 -0
  125. package/dist/src/capabilities/graph/inspect.render.js.map +1 -0
  126. package/dist/src/capabilities/graph/inspect.verb.js +55 -0
  127. package/dist/src/capabilities/graph/inspect.verb.js.map +1 -0
  128. package/dist/src/capabilities/graph/query.render.js +105 -0
  129. package/dist/src/capabilities/graph/query.render.js.map +1 -0
  130. package/dist/src/capabilities/graph/query.verb.js +51 -0
  131. package/dist/src/capabilities/graph/query.verb.js.map +1 -0
  132. package/dist/src/capabilities/graph/queryText.js +234 -0
  133. package/dist/src/capabilities/graph/queryText.js.map +1 -0
  134. package/dist/src/capabilities/graph/relationIndex.js +302 -0
  135. package/dist/src/capabilities/graph/relationIndex.js.map +1 -0
  136. package/dist/src/capabilities/graph/runConnect.js +456 -0
  137. package/dist/src/capabilities/graph/runConnect.js.map +1 -0
  138. package/dist/src/capabilities/graph/runQuery.js +60 -0
  139. package/dist/src/capabilities/graph/runQuery.js.map +1 -0
  140. package/dist/src/capabilities/index.js +64 -0
  141. package/dist/src/capabilities/index.js.map +1 -0
  142. package/dist/src/capabilities/info/collectInfo.js +74 -0
  143. package/dist/src/capabilities/info/collectInfo.js.map +1 -0
  144. package/dist/src/capabilities/info/index.js +5 -0
  145. package/dist/src/capabilities/info/index.js.map +1 -0
  146. package/dist/src/capabilities/info/info.render.js +68 -0
  147. package/dist/src/capabilities/info/info.render.js.map +1 -0
  148. package/dist/src/capabilities/info/info.verb.js +44 -0
  149. package/dist/src/capabilities/info/info.verb.js.map +1 -0
  150. package/dist/src/capabilities/info/types.js +5 -0
  151. package/dist/src/capabilities/info/types.js.map +1 -0
  152. package/dist/src/capabilities/meta/complete.verb.js +43 -0
  153. package/dist/src/capabilities/meta/complete.verb.js.map +1 -0
  154. package/dist/src/capabilities/meta/index.js +13 -0
  155. package/dist/src/capabilities/meta/index.js.map +1 -0
  156. package/dist/src/capabilities/meta/mcp.verb.js +35 -0
  157. package/dist/src/capabilities/meta/mcp.verb.js.map +1 -0
  158. package/dist/src/capabilities/ontology/index.js +21 -0
  159. package/dist/src/capabilities/ontology/index.js.map +1 -0
  160. package/dist/src/capabilities/ontology/queries.js +123 -0
  161. package/dist/src/capabilities/ontology/queries.js.map +1 -0
  162. package/dist/src/capabilities/ontology/render.js +66 -0
  163. package/dist/src/capabilities/ontology/render.js.map +1 -0
  164. package/dist/src/capabilities/ontology/verbs.js +190 -0
  165. package/dist/src/capabilities/ontology/verbs.js.map +1 -0
  166. package/dist/src/capabilities/packages/add.verb.js +67 -0
  167. package/dist/src/capabilities/packages/add.verb.js.map +1 -0
  168. package/dist/src/capabilities/packages/dependencies.js +103 -0
  169. package/dist/src/capabilities/packages/dependencies.js.map +1 -0
  170. package/dist/src/capabilities/packages/files.js +190 -0
  171. package/dist/src/capabilities/packages/files.js.map +1 -0
  172. package/dist/src/capabilities/packages/git.js +178 -0
  173. package/dist/src/capabilities/packages/git.js.map +1 -0
  174. package/dist/src/capabilities/packages/index.js +30 -0
  175. package/dist/src/capabilities/packages/index.js.map +1 -0
  176. package/dist/src/capabilities/packages/init.verb.js +40 -0
  177. package/dist/src/capabilities/packages/init.verb.js.map +1 -0
  178. package/dist/src/capabilities/packages/install.js +338 -0
  179. package/dist/src/capabilities/packages/install.js.map +1 -0
  180. package/dist/src/capabilities/packages/lockfile.js +378 -0
  181. package/dist/src/capabilities/packages/lockfile.js.map +1 -0
  182. package/dist/src/capabilities/packages/manifest.js +181 -0
  183. package/dist/src/capabilities/packages/manifest.js.map +1 -0
  184. package/dist/src/capabilities/packages/npm.js +216 -0
  185. package/dist/src/capabilities/packages/npm.js.map +1 -0
  186. package/dist/src/capabilities/packages/packages.render.js +59 -0
  187. package/dist/src/capabilities/packages/packages.render.js.map +1 -0
  188. package/dist/src/capabilities/packages/range.js +134 -0
  189. package/dist/src/capabilities/packages/range.js.map +1 -0
  190. package/dist/src/capabilities/packages/remove.verb.js +38 -0
  191. package/dist/src/capabilities/packages/remove.verb.js.map +1 -0
  192. package/dist/src/capabilities/packages/runLock.js +316 -0
  193. package/dist/src/capabilities/packages/runLock.js.map +1 -0
  194. package/dist/src/capabilities/packages/runVerbs.js +86 -0
  195. package/dist/src/capabilities/packages/runVerbs.js.map +1 -0
  196. package/dist/src/capabilities/packages/skills.js +233 -0
  197. package/dist/src/capabilities/packages/skills.js.map +1 -0
  198. package/dist/src/capabilities/packages/source.js +251 -0
  199. package/dist/src/capabilities/packages/source.js.map +1 -0
  200. package/dist/src/capabilities/packages/tar.js +200 -0
  201. package/dist/src/capabilities/packages/tar.js.map +1 -0
  202. package/dist/src/capabilities/packages/types.js +5 -0
  203. package/dist/src/capabilities/packages/types.js.map +1 -0
  204. package/dist/src/capabilities/packages/update.verb.js +46 -0
  205. package/dist/src/capabilities/packages/update.verb.js.map +1 -0
  206. package/dist/src/capabilities/prompt/index.js +16 -0
  207. package/dist/src/capabilities/prompt/index.js.map +1 -0
  208. package/dist/src/capabilities/prompt/prompt.render.js +78 -0
  209. package/dist/src/capabilities/prompt/prompt.render.js.map +1 -0
  210. package/dist/src/capabilities/prompt/types.js +10 -0
  211. package/dist/src/capabilities/prompt/types.js.map +1 -0
  212. package/dist/src/capabilities/prompt/verbs.js +104 -0
  213. package/dist/src/capabilities/prompt/verbs.js.map +1 -0
  214. package/dist/src/capabilities/resources/index.js +10 -0
  215. package/dist/src/capabilities/resources/index.js.map +1 -0
  216. package/dist/src/capabilities/resources/provider.js +433 -0
  217. package/dist/src/capabilities/resources/provider.js.map +1 -0
  218. package/dist/src/capabilities/setup/buildPlan.js +194 -0
  219. package/dist/src/capabilities/setup/buildPlan.js.map +1 -0
  220. package/dist/src/capabilities/setup/index.js +5 -0
  221. package/dist/src/capabilities/setup/index.js.map +1 -0
  222. package/dist/src/capabilities/setup/mode.js +53 -0
  223. package/dist/src/capabilities/setup/mode.js.map +1 -0
  224. package/dist/src/capabilities/setup/operations/index.js +44 -0
  225. package/dist/src/capabilities/setup/operations/index.js.map +1 -0
  226. package/dist/src/capabilities/setup/operations/setupCompletions.js +164 -0
  227. package/dist/src/capabilities/setup/operations/setupCompletions.js.map +1 -0
  228. package/dist/src/capabilities/setup/operations/setupConfig.js +103 -0
  229. package/dist/src/capabilities/setup/operations/setupConfig.js.map +1 -0
  230. package/dist/src/capabilities/setup/operations/setupGenerator.js +461 -0
  231. package/dist/src/capabilities/setup/operations/setupGenerator.js.map +1 -0
  232. package/dist/src/capabilities/setup/operations/setupLsp.js +646 -0
  233. package/dist/src/capabilities/setup/operations/setupLsp.js.map +1 -0
  234. package/dist/src/capabilities/setup/operations/setupMcp.js +399 -0
  235. package/dist/src/capabilities/setup/operations/setupMcp.js.map +1 -0
  236. package/dist/src/capabilities/setup/operations/setupSkills.js +820 -0
  237. package/dist/src/capabilities/setup/operations/setupSkills.js.map +1 -0
  238. package/dist/src/capabilities/setup/operations/writability.js +114 -0
  239. package/dist/src/capabilities/setup/operations/writability.js.map +1 -0
  240. package/dist/src/capabilities/setup/plan.js +177 -0
  241. package/dist/src/capabilities/setup/plan.js.map +1 -0
  242. package/dist/src/capabilities/setup/plan.render.js +295 -0
  243. package/dist/src/capabilities/setup/plan.render.js.map +1 -0
  244. package/dist/src/capabilities/setup/setup.render.js +60 -0
  245. package/dist/src/capabilities/setup/setup.render.js.map +1 -0
  246. package/dist/src/capabilities/setup/setup.verb.js +452 -0
  247. package/dist/src/capabilities/setup/setup.verb.js.map +1 -0
  248. package/dist/src/capabilities/setup/shell.js +196 -0
  249. package/dist/src/capabilities/setup/shell.js.map +1 -0
  250. package/dist/src/capabilities/setup/targets.js +524 -0
  251. package/dist/src/capabilities/setup/targets.js.map +1 -0
  252. package/dist/src/capabilities/setup/types.js +5 -0
  253. package/dist/src/capabilities/setup/types.js.map +1 -0
  254. package/dist/src/capabilities/shared/assertExecOk.js +142 -0
  255. package/dist/src/capabilities/shared/assertExecOk.js.map +1 -0
  256. package/dist/src/capabilities/shared/calls.js +16 -0
  257. package/dist/src/capabilities/shared/calls.js.map +1 -0
  258. package/dist/src/capabilities/shared/index.js +28 -0
  259. package/dist/src/capabilities/shared/index.js.map +1 -0
  260. package/dist/src/capabilities/shared/packageManager.js +350 -0
  261. package/dist/src/capabilities/shared/packageManager.js.map +1 -0
  262. package/dist/src/capabilities/shared/registry.js +49 -0
  263. package/dist/src/capabilities/shared/registry.js.map +1 -0
  264. package/dist/src/capabilities/shared/releaseState.js +177 -0
  265. package/dist/src/capabilities/shared/releaseState.js.map +1 -0
  266. package/dist/src/capabilities/shared/semver.js +77 -0
  267. package/dist/src/capabilities/shared/semver.js.map +1 -0
  268. package/dist/src/capabilities/skill/discover.js +265 -0
  269. package/dist/src/capabilities/skill/discover.js.map +1 -0
  270. package/dist/src/capabilities/skill/index.js +10 -0
  271. package/dist/src/capabilities/skill/index.js.map +1 -0
  272. package/dist/src/capabilities/skill/render.js +52 -0
  273. package/dist/src/capabilities/skill/render.js.map +1 -0
  274. package/dist/src/capabilities/skill/verbs.js +84 -0
  275. package/dist/src/capabilities/skill/verbs.js.map +1 -0
  276. package/dist/src/capabilities/sources/collectStatus.js +108 -0
  277. package/dist/src/capabilities/sources/collectStatus.js.map +1 -0
  278. package/dist/src/capabilities/sources/index.js +14 -0
  279. package/dist/src/capabilities/sources/index.js.map +1 -0
  280. package/dist/src/capabilities/sources/installSkills.js +308 -0
  281. package/dist/src/capabilities/sources/installSkills.js.map +1 -0
  282. package/dist/src/capabilities/sources/reset.render.js +37 -0
  283. package/dist/src/capabilities/sources/reset.render.js.map +1 -0
  284. package/dist/src/capabilities/sources/reset.verb.js +60 -0
  285. package/dist/src/capabilities/sources/reset.verb.js.map +1 -0
  286. package/dist/src/capabilities/sources/runReset.js +59 -0
  287. package/dist/src/capabilities/sources/runReset.js.map +1 -0
  288. package/dist/src/capabilities/sources/runUpdate.js +491 -0
  289. package/dist/src/capabilities/sources/runUpdate.js.map +1 -0
  290. package/dist/src/capabilities/sources/status.render.js +80 -0
  291. package/dist/src/capabilities/sources/status.render.js.map +1 -0
  292. package/dist/src/capabilities/sources/status.verb.js +41 -0
  293. package/dist/src/capabilities/sources/status.verb.js.map +1 -0
  294. package/dist/src/capabilities/sources/types.js +6 -0
  295. package/dist/src/capabilities/sources/types.js.map +1 -0
  296. package/dist/src/capabilities/sources/update.render.js +34 -0
  297. package/dist/src/capabilities/sources/update.render.js.map +1 -0
  298. package/dist/src/capabilities/sources/update.verb.js +57 -0
  299. package/dist/src/capabilities/sources/update.verb.js.map +1 -0
  300. package/dist/src/capabilities/upgrade/index.js +5 -0
  301. package/dist/src/capabilities/upgrade/index.js.map +1 -0
  302. package/dist/src/capabilities/upgrade/runUpgrade.js +138 -0
  303. package/dist/src/capabilities/upgrade/runUpgrade.js.map +1 -0
  304. package/dist/src/capabilities/upgrade/types.js +5 -0
  305. package/dist/src/capabilities/upgrade/types.js.map +1 -0
  306. package/dist/src/capabilities/upgrade/upgrade.render.js +52 -0
  307. package/dist/src/capabilities/upgrade/upgrade.render.js.map +1 -0
  308. package/dist/src/capabilities/upgrade/upgrade.verb.js +54 -0
  309. package/dist/src/capabilities/upgrade/upgrade.verb.js.map +1 -0
  310. package/dist/src/capabilities/version/index.js +10 -0
  311. package/dist/src/capabilities/version/index.js.map +1 -0
  312. package/dist/src/capabilities/version/version.verb.js +37 -0
  313. package/dist/src/capabilities/version/version.verb.js.map +1 -0
  314. package/dist/src/constants.js +105 -0
  315. package/dist/src/constants.js.map +1 -0
  316. package/dist/src/index.js +12 -0
  317. package/dist/src/index.js.map +1 -0
  318. package/dist/src/kernel/baseDirs.js +58 -0
  319. package/dist/src/kernel/baseDirs.js.map +1 -0
  320. package/dist/src/kernel/completion/complete.js +66 -0
  321. package/dist/src/kernel/completion/complete.js.map +1 -0
  322. package/dist/src/kernel/completion/emitScripts.js +92 -0
  323. package/dist/src/kernel/completion/emitScripts.js.map +1 -0
  324. package/dist/src/kernel/completion/entitySource.js +286 -0
  325. package/dist/src/kernel/completion/entitySource.js.map +1 -0
  326. package/dist/src/kernel/completion/index.js +14 -0
  327. package/dist/src/kernel/completion/index.js.map +1 -0
  328. package/dist/src/kernel/completion/model.js +301 -0
  329. package/dist/src/kernel/completion/model.js.map +1 -0
  330. package/dist/src/kernel/completion/parse.js +253 -0
  331. package/dist/src/kernel/completion/parse.js.map +1 -0
  332. package/dist/src/kernel/completion/rank.js +101 -0
  333. package/dist/src/kernel/completion/rank.js.map +1 -0
  334. package/dist/src/kernel/completion/resolve.js +101 -0
  335. package/dist/src/kernel/completion/resolve.js.map +1 -0
  336. package/dist/src/kernel/completion/templates/bash.js +209 -0
  337. package/dist/src/kernel/completion/templates/bash.js.map +1 -0
  338. package/dist/src/kernel/completion/templates/fish.js +214 -0
  339. package/dist/src/kernel/completion/templates/fish.js.map +1 -0
  340. package/dist/src/kernel/completion/templates/index.js +23 -0
  341. package/dist/src/kernel/completion/templates/index.js.map +1 -0
  342. package/dist/src/kernel/completion/templates/shared.js +98 -0
  343. package/dist/src/kernel/completion/templates/shared.js.map +1 -0
  344. package/dist/src/kernel/completion/templates/zsh.js +201 -0
  345. package/dist/src/kernel/completion/templates/zsh.js.map +1 -0
  346. package/dist/src/kernel/completion/types.js +13 -0
  347. package/dist/src/kernel/completion/types.js.map +1 -0
  348. package/dist/src/kernel/config/defaults.js +20 -0
  349. package/dist/src/kernel/config/defaults.js.map +1 -0
  350. package/dist/src/kernel/config/evaluateProjectConfig.js +206 -0
  351. package/dist/src/kernel/config/evaluateProjectConfig.js.map +1 -0
  352. package/dist/src/kernel/config/findProjectConfig.js +8 -0
  353. package/dist/src/kernel/config/findProjectConfig.js.map +1 -0
  354. package/dist/src/kernel/config/firstRun.js +34 -0
  355. package/dist/src/kernel/config/firstRun.js.map +1 -0
  356. package/dist/src/kernel/config/globalConfig.js +79 -0
  357. package/dist/src/kernel/config/globalConfig.js.map +1 -0
  358. package/dist/src/kernel/config/index.js +16 -0
  359. package/dist/src/kernel/config/index.js.map +1 -0
  360. package/dist/src/kernel/config/paths.js +32 -0
  361. package/dist/src/kernel/config/paths.js.map +1 -0
  362. package/dist/src/kernel/config/readConfig.js +79 -0
  363. package/dist/src/kernel/config/readConfig.js.map +1 -0
  364. package/dist/src/kernel/config/schema.js +129 -0
  365. package/dist/src/kernel/config/schema.js.map +1 -0
  366. package/dist/src/kernel/config/types.js +19 -0
  367. package/dist/src/kernel/config/types.js.map +1 -0
  368. package/dist/src/kernel/config/writeConfigField.js +59 -0
  369. package/dist/src/kernel/config/writeConfigField.js.map +1 -0
  370. package/dist/src/kernel/copy.js +43 -0
  371. package/dist/src/kernel/copy.js.map +1 -0
  372. package/dist/src/kernel/distribution/index.js +6 -0
  373. package/dist/src/kernel/distribution/index.js.map +1 -0
  374. package/dist/src/kernel/distribution/packageRoot.js +58 -0
  375. package/dist/src/kernel/distribution/packageRoot.js.map +1 -0
  376. package/dist/src/kernel/distribution/registry.js +77 -0
  377. package/dist/src/kernel/distribution/registry.js.map +1 -0
  378. package/dist/src/kernel/distribution/types.js +16 -0
  379. package/dist/src/kernel/distribution/types.js.map +1 -0
  380. package/dist/src/kernel/error/PragmaError.js +149 -0
  381. package/dist/src/kernel/error/PragmaError.js.map +1 -0
  382. package/dist/src/kernel/error/constants.js +40 -0
  383. package/dist/src/kernel/error/constants.js.map +1 -0
  384. package/dist/src/kernel/error/fromTaskError.js +96 -0
  385. package/dist/src/kernel/error/fromTaskError.js.map +1 -0
  386. package/dist/src/kernel/error/index.js +13 -0
  387. package/dist/src/kernel/error/index.js.map +1 -0
  388. package/dist/src/kernel/error/recovery.js +34 -0
  389. package/dist/src/kernel/error/recovery.js.map +1 -0
  390. package/dist/src/kernel/error/renderError.js +125 -0
  391. package/dist/src/kernel/error/renderError.js.map +1 -0
  392. package/dist/src/kernel/error/serialize.js +25 -0
  393. package/dist/src/kernel/error/serialize.js.map +1 -0
  394. package/dist/src/kernel/error/types.js +9 -0
  395. package/dist/src/kernel/error/types.js.map +1 -0
  396. package/dist/src/kernel/error/validOptions.js +41 -0
  397. package/dist/src/kernel/error/validOptions.js.map +1 -0
  398. package/dist/src/kernel/index.js +34 -0
  399. package/dist/src/kernel/index.js.map +1 -0
  400. package/dist/src/kernel/interactivity.js +68 -0
  401. package/dist/src/kernel/interactivity.js.map +1 -0
  402. package/dist/src/kernel/packs/collect.js +340 -0
  403. package/dist/src/kernel/packs/collect.js.map +1 -0
  404. package/dist/src/kernel/packs/compile.js +451 -0
  405. package/dist/src/kernel/packs/compile.js.map +1 -0
  406. package/dist/src/kernel/packs/cursor.js +135 -0
  407. package/dist/src/kernel/packs/cursor.js.map +1 -0
  408. package/dist/src/kernel/packs/disclosure.js +76 -0
  409. package/dist/src/kernel/packs/disclosure.js.map +1 -0
  410. package/dist/src/kernel/packs/glob.js +38 -0
  411. package/dist/src/kernel/packs/glob.js.map +1 -0
  412. package/dist/src/kernel/packs/graphql/buildLookupDocument.js +265 -0
  413. package/dist/src/kernel/packs/graphql/buildLookupDocument.js.map +1 -0
  414. package/dist/src/kernel/packs/graphql/fetchGraphqlLookup.js +157 -0
  415. package/dist/src/kernel/packs/graphql/fetchGraphqlLookup.js.map +1 -0
  416. package/dist/src/kernel/packs/graphql/index.js +20 -0
  417. package/dist/src/kernel/packs/graphql/index.js.map +1 -0
  418. package/dist/src/kernel/packs/graphql/nameMap.js +63 -0
  419. package/dist/src/kernel/packs/graphql/nameMap.js.map +1 -0
  420. package/dist/src/kernel/packs/index.js +34 -0
  421. package/dist/src/kernel/packs/index.js.map +1 -0
  422. package/dist/src/kernel/packs/iri.js +108 -0
  423. package/dist/src/kernel/packs/iri.js.map +1 -0
  424. package/dist/src/kernel/packs/paging.js +108 -0
  425. package/dist/src/kernel/packs/paging.js.map +1 -0
  426. package/dist/src/kernel/packs/projectNouns.js +212 -0
  427. package/dist/src/kernel/packs/projectNouns.js.map +1 -0
  428. package/dist/src/kernel/packs/renderPack.js +328 -0
  429. package/dist/src/kernel/packs/renderPack.js.map +1 -0
  430. package/dist/src/kernel/packs/resolveEntity.js +485 -0
  431. package/dist/src/kernel/packs/resolveEntity.js.map +1 -0
  432. package/dist/src/kernel/packs/runBodies.js +337 -0
  433. package/dist/src/kernel/packs/runBodies.js.map +1 -0
  434. package/dist/src/kernel/packs/sample.js +56 -0
  435. package/dist/src/kernel/packs/sample.js.map +1 -0
  436. package/dist/src/kernel/packs/schema.js +623 -0
  437. package/dist/src/kernel/packs/schema.js.map +1 -0
  438. package/dist/src/kernel/packs/sparql/authorQuery.js +227 -0
  439. package/dist/src/kernel/packs/sparql/authorQuery.js.map +1 -0
  440. package/dist/src/kernel/packs/sparql/buildListQuery.js +318 -0
  441. package/dist/src/kernel/packs/sparql/buildListQuery.js.map +1 -0
  442. package/dist/src/kernel/packs/sparql/buildLookupQuery.js +611 -0
  443. package/dist/src/kernel/packs/sparql/buildLookupQuery.js.map +1 -0
  444. package/dist/src/kernel/packs/sparql/escape.js +21 -0
  445. package/dist/src/kernel/packs/sparql/escape.js.map +1 -0
  446. package/dist/src/kernel/packs/sparql/filterValues.js +154 -0
  447. package/dist/src/kernel/packs/sparql/filterValues.js.map +1 -0
  448. package/dist/src/kernel/packs/sparql/index.js +41 -0
  449. package/dist/src/kernel/packs/sparql/index.js.map +1 -0
  450. package/dist/src/kernel/packs/sparql/runSelect.js +105 -0
  451. package/dist/src/kernel/packs/sparql/runSelect.js.map +1 -0
  452. package/dist/src/kernel/packs/sparql/searchTerm.js +25 -0
  453. package/dist/src/kernel/packs/sparql/searchTerm.js.map +1 -0
  454. package/dist/src/kernel/packs/storyRules.js +178 -0
  455. package/dist/src/kernel/packs/storyRules.js.map +1 -0
  456. package/dist/src/kernel/packs/tierScope.js +310 -0
  457. package/dist/src/kernel/packs/tierScope.js.map +1 -0
  458. package/dist/src/kernel/packs/types.js +114 -0
  459. package/dist/src/kernel/packs/types.js.map +1 -0
  460. package/dist/src/kernel/packs/uniqueness.js +30 -0
  461. package/dist/src/kernel/packs/uniqueness.js.map +1 -0
  462. package/dist/src/kernel/project/cli/buildProgram.js +276 -0
  463. package/dist/src/kernel/project/cli/buildProgram.js.map +1 -0
  464. package/dist/src/kernel/project/cli/constants.js +27 -0
  465. package/dist/src/kernel/project/cli/constants.js.map +1 -0
  466. package/dist/src/kernel/project/cli/dispatch.js +552 -0
  467. package/dist/src/kernel/project/cli/dispatch.js.map +1 -0
  468. package/dist/src/kernel/project/cli/exitCodes.js +66 -0
  469. package/dist/src/kernel/project/cli/exitCodes.js.map +1 -0
  470. package/dist/src/kernel/project/cli/globalFlags.js +219 -0
  471. package/dist/src/kernel/project/cli/globalFlags.js.map +1 -0
  472. package/dist/src/kernel/project/cli/helpFormat.js +58 -0
  473. package/dist/src/kernel/project/cli/helpFormat.js.map +1 -0
  474. package/dist/src/kernel/project/cli/index.js +14 -0
  475. package/dist/src/kernel/project/cli/index.js.map +1 -0
  476. package/dist/src/kernel/project/cli/rootHelp.js +266 -0
  477. package/dist/src/kernel/project/cli/rootHelp.js.map +1 -0
  478. package/dist/src/kernel/project/cli/suggest.js +75 -0
  479. package/dist/src/kernel/project/cli/suggest.js.map +1 -0
  480. package/dist/src/kernel/project/cli/suggestNames.js +163 -0
  481. package/dist/src/kernel/project/cli/suggestNames.js.map +1 -0
  482. package/dist/src/kernel/project/cli/verbHelp.js +130 -0
  483. package/dist/src/kernel/project/cli/verbHelp.js.map +1 -0
  484. package/dist/src/kernel/project/mcp/buildServer.js +74 -0
  485. package/dist/src/kernel/project/mcp/buildServer.js.map +1 -0
  486. package/dist/src/kernel/project/mcp/envelope.js +38 -0
  487. package/dist/src/kernel/project/mcp/envelope.js.map +1 -0
  488. package/dist/src/kernel/project/mcp/index.js +8 -0
  489. package/dist/src/kernel/project/mcp/index.js.map +1 -0
  490. package/dist/src/kernel/project/mcp/instructions.js +114 -0
  491. package/dist/src/kernel/project/mcp/instructions.js.map +1 -0
  492. package/dist/src/kernel/project/mcp/mcpError.js +42 -0
  493. package/dist/src/kernel/project/mcp/mcpError.js.map +1 -0
  494. package/dist/src/kernel/project/mcp/prompts/index.js +36 -0
  495. package/dist/src/kernel/project/mcp/prompts/index.js.map +1 -0
  496. package/dist/src/kernel/project/mcp/prompts/provider.js +98 -0
  497. package/dist/src/kernel/project/mcp/prompts/provider.js.map +1 -0
  498. package/dist/src/kernel/project/mcp/prompts/source.js +163 -0
  499. package/dist/src/kernel/project/mcp/prompts/source.js.map +1 -0
  500. package/dist/src/kernel/project/mcp/registerVerb.js +378 -0
  501. package/dist/src/kernel/project/mcp/registerVerb.js.map +1 -0
  502. package/dist/src/kernel/project/mcp/serve.js +35 -0
  503. package/dist/src/kernel/project/mcp/serve.js.map +1 -0
  504. package/dist/src/kernel/render/compactUri.js +24 -0
  505. package/dist/src/kernel/render/compactUri.js.map +1 -0
  506. package/dist/src/kernel/render/contracts.js +10 -0
  507. package/dist/src/kernel/render/contracts.js.map +1 -0
  508. package/dist/src/kernel/render/disclosure.js +34 -0
  509. package/dist/src/kernel/render/disclosure.js.map +1 -0
  510. package/dist/src/kernel/render/displaySafe.js +72 -0
  511. package/dist/src/kernel/render/displaySafe.js.map +1 -0
  512. package/dist/src/kernel/render/envelope.js +30 -0
  513. package/dist/src/kernel/render/envelope.js.map +1 -0
  514. package/dist/src/kernel/render/formatters.js +27 -0
  515. package/dist/src/kernel/render/formatters.js.map +1 -0
  516. package/dist/src/kernel/render/index.js +15 -0
  517. package/dist/src/kernel/render/index.js.map +1 -0
  518. package/dist/src/kernel/render/prefixes.js +46 -0
  519. package/dist/src/kernel/render/prefixes.js.map +1 -0
  520. package/dist/src/kernel/render/renderers.js +500 -0
  521. package/dist/src/kernel/render/renderers.js.map +1 -0
  522. package/dist/src/kernel/render/style.js +105 -0
  523. package/dist/src/kernel/render/style.js.map +1 -0
  524. package/dist/src/kernel/render/turtle.js +211 -0
  525. package/dist/src/kernel/render/turtle.js.map +1 -0
  526. package/dist/src/kernel/render/vocabulary.js +174 -0
  527. package/dist/src/kernel/render/vocabulary.js.map +1 -0
  528. package/dist/src/kernel/render/writeStdout.js +43 -0
  529. package/dist/src/kernel/render/writeStdout.js.map +1 -0
  530. package/dist/src/kernel/runtime/boot.js +49 -0
  531. package/dist/src/kernel/runtime/boot.js.map +1 -0
  532. package/dist/src/kernel/runtime/facade.js +39 -0
  533. package/dist/src/kernel/runtime/facade.js.map +1 -0
  534. package/dist/src/kernel/runtime/findProjectConfig.js +58 -0
  535. package/dist/src/kernel/runtime/findProjectConfig.js.map +1 -0
  536. package/dist/src/kernel/runtime/graphpack/build.js +182 -0
  537. package/dist/src/kernel/runtime/graphpack/build.js.map +1 -0
  538. package/dist/src/kernel/runtime/graphpack/buildIndex.js +320 -0
  539. package/dist/src/kernel/runtime/graphpack/buildIndex.js.map +1 -0
  540. package/dist/src/kernel/runtime/graphpack/embedded.js +114 -0
  541. package/dist/src/kernel/runtime/graphpack/embedded.js.map +1 -0
  542. package/dist/src/kernel/runtime/graphpack/hash.js +43 -0
  543. package/dist/src/kernel/runtime/graphpack/hash.js.map +1 -0
  544. package/dist/src/kernel/runtime/graphpack/index.js +11 -0
  545. package/dist/src/kernel/runtime/graphpack/index.js.map +1 -0
  546. package/dist/src/kernel/runtime/graphpack/manifest.js +159 -0
  547. package/dist/src/kernel/runtime/graphpack/manifest.js.map +1 -0
  548. package/dist/src/kernel/runtime/graphpack/read.js +143 -0
  549. package/dist/src/kernel/runtime/graphpack/read.js.map +1 -0
  550. package/dist/src/kernel/runtime/graphpack/schemas.js +88 -0
  551. package/dist/src/kernel/runtime/graphpack/schemas.js.map +1 -0
  552. package/dist/src/kernel/runtime/graphpack/stories.js +68 -0
  553. package/dist/src/kernel/runtime/graphpack/stories.js.map +1 -0
  554. package/dist/src/kernel/runtime/graphpack/types.js +69 -0
  555. package/dist/src/kernel/runtime/graphpack/types.js.map +1 -0
  556. package/dist/src/kernel/runtime/index.js +8 -0
  557. package/dist/src/kernel/runtime/index.js.map +1 -0
  558. package/dist/src/kernel/runtime/loadSession.js +43 -0
  559. package/dist/src/kernel/runtime/loadSession.js.map +1 -0
  560. package/dist/src/kernel/runtime/lockState.js +151 -0
  561. package/dist/src/kernel/runtime/lockState.js.map +1 -0
  562. package/dist/src/kernel/runtime/packVersion.js +75 -0
  563. package/dist/src/kernel/runtime/packVersion.js.map +1 -0
  564. package/dist/src/kernel/runtime/paths.js +160 -0
  565. package/dist/src/kernel/runtime/paths.js.map +1 -0
  566. package/dist/src/kernel/runtime/probe.js +37 -0
  567. package/dist/src/kernel/runtime/probe.js.map +1 -0
  568. package/dist/src/kernel/runtime/readEntity.js +417 -0
  569. package/dist/src/kernel/runtime/readEntity.js.map +1 -0
  570. package/dist/src/kernel/runtime/refs/gitOps.js +347 -0
  571. package/dist/src/kernel/runtime/refs/gitOps.js.map +1 -0
  572. package/dist/src/kernel/runtime/refs/index.js +29 -0
  573. package/dist/src/kernel/runtime/refs/index.js.map +1 -0
  574. package/dist/src/kernel/runtime/refs/parseRef.js +86 -0
  575. package/dist/src/kernel/runtime/refs/parseRef.js.map +1 -0
  576. package/dist/src/kernel/runtime/refs/resolve.js +397 -0
  577. package/dist/src/kernel/runtime/refs/resolve.js.map +1 -0
  578. package/dist/src/kernel/runtime/resolveSources.js +179 -0
  579. package/dist/src/kernel/runtime/resolveSources.js.map +1 -0
  580. package/dist/src/kernel/runtime/store.js +75 -0
  581. package/dist/src/kernel/runtime/store.js.map +1 -0
  582. package/dist/src/kernel/runtime/storeReadiness.js +52 -0
  583. package/dist/src/kernel/runtime/storeReadiness.js.map +1 -0
  584. package/dist/src/kernel/runtime/types.js +11 -0
  585. package/dist/src/kernel/runtime/types.js.map +1 -0
  586. package/dist/src/kernel/spec/asVerb.js +21 -0
  587. package/dist/src/kernel/spec/asVerb.js.map +1 -0
  588. package/dist/src/kernel/spec/call.js +167 -0
  589. package/dist/src/kernel/spec/call.js.map +1 -0
  590. package/dist/src/kernel/spec/emitReference.js +576 -0
  591. package/dist/src/kernel/spec/emitReference.js.map +1 -0
  592. package/dist/src/kernel/spec/emitSurface.js +214 -0
  593. package/dist/src/kernel/spec/emitSurface.js.map +1 -0
  594. package/dist/src/kernel/spec/guidance.js +63 -0
  595. package/dist/src/kernel/spec/guidance.js.map +1 -0
  596. package/dist/src/kernel/spec/index.js +11 -0
  597. package/dist/src/kernel/spec/index.js.map +1 -0
  598. package/dist/src/kernel/spec/surfaceConformance.js +103 -0
  599. package/dist/src/kernel/spec/surfaceConformance.js.map +1 -0
  600. package/dist/src/kernel/spec/types.js +14 -0
  601. package/dist/src/kernel/spec/types.js.map +1 -0
  602. package/dist/src/kernel/spec/validate.js +110 -0
  603. package/dist/src/kernel/spec/validate.js.map +1 -0
  604. package/dist/src/kernel/spec/wireType.js +36 -0
  605. package/dist/src/kernel/spec/wireType.js.map +1 -0
  606. package/dist/src/kernel/vocabulary.js +92 -0
  607. package/dist/src/kernel/vocabulary.js.map +1 -0
  608. package/dist/src/main.js +453 -0
  609. package/dist/src/main.js.map +1 -0
  610. package/dist/src/run.js +22 -0
  611. package/dist/src/run.js.map +1 -0
  612. package/dist/src/testing/behavioral/liveReadSurface.js +68 -0
  613. package/dist/src/testing/behavioral/liveReadSurface.js.map +1 -0
  614. package/dist/src/testing/build.globalSetup.js +569 -0
  615. package/dist/src/testing/build.globalSetup.js.map +1 -0
  616. package/dist/src/testing/eval/cases/stable.js +144 -0
  617. package/dist/src/testing/eval/cases/stable.js.map +1 -0
  618. package/dist/src/testing/eval/harness.js +44 -0
  619. package/dist/src/testing/eval/harness.js.map +1 -0
  620. package/dist/src/testing/helpers/callSchema.js +36 -0
  621. package/dist/src/testing/helpers/callSchema.js.map +1 -0
  622. package/dist/src/testing/helpers/fixtureGraph.js +118 -0
  623. package/dist/src/testing/helpers/fixtureGraph.js.map +1 -0
  624. package/dist/src/testing/helpers/packRuntime.js +79 -0
  625. package/dist/src/testing/helpers/packRuntime.js.map +1 -0
  626. package/dist/src/testing/helpers/parity.js +82 -0
  627. package/dist/src/testing/helpers/parity.js.map +1 -0
  628. package/dist/src/testing/helpers/projectCli.js +28 -0
  629. package/dist/src/testing/helpers/projectCli.js.map +1 -0
  630. package/dist/src/testing/helpers/projectMcp.js +104 -0
  631. package/dist/src/testing/helpers/projectMcp.js.map +1 -0
  632. package/dist/src/testing/helpers/runCli.js +155 -0
  633. package/dist/src/testing/helpers/runCli.js.map +1 -0
  634. package/dist/src/testing/index.js +79 -0
  635. package/dist/src/testing/index.js.map +1 -0
  636. package/dist/src/testing/prismRoot.js +13 -0
  637. package/dist/src/testing/prismRoot.js.map +1 -0
  638. package/dist/src/testing/setup/build.js +6 -0
  639. package/dist/src/testing/setup/build.js.map +1 -0
  640. package/dist/src/testing/setup/calls.js +3 -0
  641. package/dist/src/testing/setup/calls.js.map +1 -0
  642. package/dist/src/testing/setup/offline-registry.js +3 -0
  643. package/dist/src/testing/setup/offline-registry.js.map +1 -0
  644. package/dist/src/testing/setup/temp-root.js +3 -0
  645. package/dist/src/testing/setup/temp-root.js.map +1 -0
  646. package/dist/src/testing/setup/xdg.js +3 -0
  647. package/dist/src/testing/setup/xdg.js.map +1 -0
  648. package/dist/src/testing/setupCallChecking.js +29 -0
  649. package/dist/src/testing/setupCallChecking.js.map +1 -0
  650. package/dist/src/testing/setupOfflineRegistry.js +19 -0
  651. package/dist/src/testing/setupOfflineRegistry.js.map +1 -0
  652. package/dist/src/testing/setupXdgIsolation.js +84 -0
  653. package/dist/src/testing/setupXdgIsolation.js.map +1 -0
  654. package/dist/src/testing/tempRoot.globalSetup.js +115 -0
  655. package/dist/src/testing/tempRoot.globalSetup.js.map +1 -0
  656. package/dist/src/types.js +11 -0
  657. package/dist/src/types.js.map +1 -0
  658. package/package.json +122 -4
  659. package/prism.conf.ts +50 -0
  660. package/src/bin.ts +12 -0
  661. package/src/build/generatorSurface.ts +151 -0
  662. package/src/build/index.ts +42 -0
  663. package/src/capabilities/capabilities/capabilities.render.ts +94 -0
  664. package/src/capabilities/capabilities/capabilities.verb.ts +69 -0
  665. package/src/capabilities/capabilities/catalog.ts +174 -0
  666. package/src/capabilities/capabilities/index.ts +15 -0
  667. package/src/capabilities/capabilities/types.ts +58 -0
  668. package/src/capabilities/colophon/collectColophon.ts +94 -0
  669. package/src/capabilities/colophon/colophon.render.ts +74 -0
  670. package/src/capabilities/colophon/colophon.verb.ts +49 -0
  671. package/src/capabilities/colophon/index.ts +6 -0
  672. package/src/capabilities/colophon/markdownTerminal.ts +104 -0
  673. package/src/capabilities/colophon/types.ts +37 -0
  674. package/src/capabilities/config/collectConfigShow.ts +69 -0
  675. package/src/capabilities/config/field.render.ts +27 -0
  676. package/src/capabilities/config/fields.ts +61 -0
  677. package/src/capabilities/config/get.verb.ts +72 -0
  678. package/src/capabilities/config/index.ts +10 -0
  679. package/src/capabilities/config/runField.ts +77 -0
  680. package/src/capabilities/config/runGet.ts +34 -0
  681. package/src/capabilities/config/runSet.ts +64 -0
  682. package/src/capabilities/config/set.verb.ts +80 -0
  683. package/src/capabilities/config/show.render.ts +142 -0
  684. package/src/capabilities/config/show.verb.ts +51 -0
  685. package/src/capabilities/config/types.ts +49 -0
  686. package/src/capabilities/config/unset.verb.ts +60 -0
  687. package/src/capabilities/create/cliProjection.ts +244 -0
  688. package/src/capabilities/create/constants.ts +67 -0
  689. package/src/capabilities/create/create.render.ts +121 -0
  690. package/src/capabilities/create/create.verb.ts +492 -0
  691. package/src/capabilities/create/createHelp.ts +71 -0
  692. package/src/capabilities/create/generatorToVerbSpec.ts +113 -0
  693. package/src/capabilities/create/index.ts +49 -0
  694. package/src/capabilities/create/moduleNotFound.ts +28 -0
  695. package/src/capabilities/create/mount.ts +403 -0
  696. package/src/capabilities/create/pathJail.ts +76 -0
  697. package/src/capabilities/create/pickGenerator.ts +51 -0
  698. package/src/capabilities/distribution.ts +109 -0
  699. package/src/capabilities/doctor/checks/checkKeStore.ts +42 -0
  700. package/src/capabilities/doctor/checks/checkNodeVersion.ts +29 -0
  701. package/src/capabilities/doctor/checks/checkPackageRefs.ts +186 -0
  702. package/src/capabilities/doctor/checks/checkPaths.ts +81 -0
  703. package/src/capabilities/doctor/checks/checkPragmaVersion.ts +36 -0
  704. package/src/capabilities/doctor/checks/checkShellCompletions.ts +217 -0
  705. package/src/capabilities/doctor/checks/harnessInventory.ts +302 -0
  706. package/src/capabilities/doctor/checks/index.ts +27 -0
  707. package/src/capabilities/doctor/checks/isSupportedNodeVersion.ts +31 -0
  708. package/src/capabilities/doctor/checks/mcpCommand.ts +69 -0
  709. package/src/capabilities/doctor/checks/targetHealth.ts +576 -0
  710. package/src/capabilities/doctor/doctor.render.ts +199 -0
  711. package/src/capabilities/doctor/doctor.verb.ts +57 -0
  712. package/src/capabilities/doctor/index.ts +6 -0
  713. package/src/capabilities/doctor/runChecks.ts +104 -0
  714. package/src/capabilities/doctor/types.ts +63 -0
  715. package/src/capabilities/graph/connect.render.ts +141 -0
  716. package/src/capabilities/graph/connect.types.ts +136 -0
  717. package/src/capabilities/graph/connect.verb.ts +168 -0
  718. package/src/capabilities/graph/index.ts +23 -0
  719. package/src/capabilities/graph/inspect.render.ts +94 -0
  720. package/src/capabilities/graph/inspect.verb.ts +66 -0
  721. package/src/capabilities/graph/query.render.ts +127 -0
  722. package/src/capabilities/graph/query.verb.ts +61 -0
  723. package/src/capabilities/graph/queryText.ts +287 -0
  724. package/src/capabilities/graph/relationIndex.ts +372 -0
  725. package/src/capabilities/graph/runConnect.ts +576 -0
  726. package/src/capabilities/graph/runQuery.ts +80 -0
  727. package/src/capabilities/index.ts +73 -0
  728. package/src/capabilities/info/collectInfo.ts +90 -0
  729. package/src/capabilities/info/index.ts +6 -0
  730. package/src/capabilities/info/info.render.ts +89 -0
  731. package/src/capabilities/info/info.verb.ts +49 -0
  732. package/src/capabilities/info/types.ts +50 -0
  733. package/src/capabilities/meta/complete.verb.ts +52 -0
  734. package/src/capabilities/meta/index.ts +15 -0
  735. package/src/capabilities/meta/mcp.verb.ts +39 -0
  736. package/src/capabilities/ontology/index.ts +23 -0
  737. package/src/capabilities/ontology/queries.ts +197 -0
  738. package/src/capabilities/ontology/render.ts +86 -0
  739. package/src/capabilities/ontology/verbs.ts +242 -0
  740. package/src/capabilities/packages/add.verb.ts +86 -0
  741. package/src/capabilities/packages/dependencies.ts +122 -0
  742. package/src/capabilities/packages/files.ts +260 -0
  743. package/src/capabilities/packages/git.ts +218 -0
  744. package/src/capabilities/packages/index.ts +32 -0
  745. package/src/capabilities/packages/init.verb.ts +48 -0
  746. package/src/capabilities/packages/install.ts +480 -0
  747. package/src/capabilities/packages/lockfile.ts +493 -0
  748. package/src/capabilities/packages/manifest.ts +222 -0
  749. package/src/capabilities/packages/npm.ts +271 -0
  750. package/src/capabilities/packages/packages.render.ts +62 -0
  751. package/src/capabilities/packages/range.ts +149 -0
  752. package/src/capabilities/packages/remove.verb.ts +48 -0
  753. package/src/capabilities/packages/runLock.ts +430 -0
  754. package/src/capabilities/packages/runVerbs.ts +122 -0
  755. package/src/capabilities/packages/skills.ts +290 -0
  756. package/src/capabilities/packages/source.ts +338 -0
  757. package/src/capabilities/packages/tar.ts +217 -0
  758. package/src/capabilities/packages/types.ts +32 -0
  759. package/src/capabilities/packages/update.verb.ts +58 -0
  760. package/src/capabilities/prompt/index.ts +18 -0
  761. package/src/capabilities/prompt/prompt.render.ts +91 -0
  762. package/src/capabilities/prompt/types.ts +30 -0
  763. package/src/capabilities/prompt/verbs.ts +122 -0
  764. package/src/capabilities/resources/index.ts +15 -0
  765. package/src/capabilities/resources/provider.ts +535 -0
  766. package/src/capabilities/setup/buildPlan.ts +267 -0
  767. package/src/capabilities/setup/index.ts +12 -0
  768. package/src/capabilities/setup/mode.ts +74 -0
  769. package/src/capabilities/setup/operations/index.ts +94 -0
  770. package/src/capabilities/setup/operations/setupCompletions.ts +221 -0
  771. package/src/capabilities/setup/operations/setupConfig.ts +129 -0
  772. package/src/capabilities/setup/operations/setupGenerator.ts +651 -0
  773. package/src/capabilities/setup/operations/setupLsp.ts +934 -0
  774. package/src/capabilities/setup/operations/setupMcp.ts +583 -0
  775. package/src/capabilities/setup/operations/setupSkills.ts +1057 -0
  776. package/src/capabilities/setup/operations/writability.ts +135 -0
  777. package/src/capabilities/setup/plan.render.ts +371 -0
  778. package/src/capabilities/setup/plan.ts +320 -0
  779. package/src/capabilities/setup/setup.render.ts +70 -0
  780. package/src/capabilities/setup/setup.verb.ts +555 -0
  781. package/src/capabilities/setup/shell.ts +237 -0
  782. package/src/capabilities/setup/targets.ts +685 -0
  783. package/src/capabilities/setup/types.ts +88 -0
  784. package/src/capabilities/shared/assertExecOk.ts +169 -0
  785. package/src/capabilities/shared/calls.ts +20 -0
  786. package/src/capabilities/shared/index.ts +45 -0
  787. package/src/capabilities/shared/packageManager.ts +457 -0
  788. package/src/capabilities/shared/registry.ts +63 -0
  789. package/src/capabilities/shared/releaseState.ts +221 -0
  790. package/src/capabilities/shared/semver.ts +74 -0
  791. package/src/capabilities/skill/discover.ts +288 -0
  792. package/src/capabilities/skill/index.ts +12 -0
  793. package/src/capabilities/skill/render.ts +64 -0
  794. package/src/capabilities/skill/verbs.ts +103 -0
  795. package/src/capabilities/sources/collectStatus.ts +117 -0
  796. package/src/capabilities/sources/index.ts +16 -0
  797. package/src/capabilities/sources/installSkills.ts +380 -0
  798. package/src/capabilities/sources/reset.render.ts +43 -0
  799. package/src/capabilities/sources/reset.verb.ts +70 -0
  800. package/src/capabilities/sources/runReset.ts +65 -0
  801. package/src/capabilities/sources/runUpdate.ts +619 -0
  802. package/src/capabilities/sources/status.render.ts +95 -0
  803. package/src/capabilities/sources/status.verb.ts +51 -0
  804. package/src/capabilities/sources/types.ts +70 -0
  805. package/src/capabilities/sources/update.render.ts +42 -0
  806. package/src/capabilities/sources/update.verb.ts +68 -0
  807. package/src/capabilities/upgrade/index.ts +6 -0
  808. package/src/capabilities/upgrade/runUpgrade.ts +161 -0
  809. package/src/capabilities/upgrade/types.ts +29 -0
  810. package/src/capabilities/upgrade/upgrade.render.ts +61 -0
  811. package/src/capabilities/upgrade/upgrade.verb.ts +62 -0
  812. package/src/capabilities/version/index.ts +12 -0
  813. package/src/capabilities/version/version.verb.ts +40 -0
  814. package/src/constants.ts +145 -0
  815. package/src/index.ts +50 -0
  816. package/src/kernel/baseDirs.ts +73 -0
  817. package/src/kernel/completion/complete.ts +77 -0
  818. package/src/kernel/completion/emitScripts.ts +124 -0
  819. package/src/kernel/completion/entitySource.ts +303 -0
  820. package/src/kernel/completion/index.ts +42 -0
  821. package/src/kernel/completion/model.ts +349 -0
  822. package/src/kernel/completion/parse.ts +309 -0
  823. package/src/kernel/completion/rank.ts +118 -0
  824. package/src/kernel/completion/resolve.ts +134 -0
  825. package/src/kernel/completion/templates/bash.ts +254 -0
  826. package/src/kernel/completion/templates/fish.ts +267 -0
  827. package/src/kernel/completion/templates/index.ts +23 -0
  828. package/src/kernel/completion/templates/shared.ts +134 -0
  829. package/src/kernel/completion/templates/zsh.ts +246 -0
  830. package/src/kernel/completion/types.ts +160 -0
  831. package/src/kernel/config/defaults.ts +23 -0
  832. package/src/kernel/config/evaluateProjectConfig.ts +240 -0
  833. package/src/kernel/config/findProjectConfig.ts +8 -0
  834. package/src/kernel/config/firstRun.ts +34 -0
  835. package/src/kernel/config/globalConfig.ts +94 -0
  836. package/src/kernel/config/index.ts +34 -0
  837. package/src/kernel/config/paths.ts +36 -0
  838. package/src/kernel/config/readConfig.ts +95 -0
  839. package/src/kernel/config/schema.ts +144 -0
  840. package/src/kernel/config/types.ts +162 -0
  841. package/src/kernel/config/writeConfigField.ts +82 -0
  842. package/src/kernel/copy.ts +54 -0
  843. package/src/kernel/distribution/index.ts +27 -0
  844. package/src/kernel/distribution/packageRoot.ts +58 -0
  845. package/src/kernel/distribution/registry.ts +99 -0
  846. package/src/kernel/distribution/types.ts +330 -0
  847. package/src/kernel/error/PragmaError.ts +184 -0
  848. package/src/kernel/error/constants.ts +41 -0
  849. package/src/kernel/error/fromTaskError.ts +102 -0
  850. package/src/kernel/error/index.ts +23 -0
  851. package/src/kernel/error/recovery.ts +37 -0
  852. package/src/kernel/error/renderError.ts +154 -0
  853. package/src/kernel/error/serialize.ts +28 -0
  854. package/src/kernel/error/types.ts +83 -0
  855. package/src/kernel/error/validOptions.ts +45 -0
  856. package/src/kernel/index.ts +35 -0
  857. package/src/kernel/interactivity.ts +69 -0
  858. package/src/kernel/packs/collect.ts +445 -0
  859. package/src/kernel/packs/compile.ts +596 -0
  860. package/src/kernel/packs/cursor.ts +135 -0
  861. package/src/kernel/packs/disclosure.ts +98 -0
  862. package/src/kernel/packs/glob.ts +39 -0
  863. package/src/kernel/packs/graphql/buildLookupDocument.ts +404 -0
  864. package/src/kernel/packs/graphql/fetchGraphqlLookup.ts +216 -0
  865. package/src/kernel/packs/graphql/index.ts +20 -0
  866. package/src/kernel/packs/graphql/nameMap.ts +67 -0
  867. package/src/kernel/packs/index.ts +40 -0
  868. package/src/kernel/packs/iri.ts +129 -0
  869. package/src/kernel/packs/paging.ts +110 -0
  870. package/src/kernel/packs/projectNouns.ts +251 -0
  871. package/src/kernel/packs/renderPack.ts +478 -0
  872. package/src/kernel/packs/resolveEntity.ts +734 -0
  873. package/src/kernel/packs/runBodies.ts +494 -0
  874. package/src/kernel/packs/sample.ts +60 -0
  875. package/src/kernel/packs/schema.ts +719 -0
  876. package/src/kernel/packs/sparql/authorQuery.ts +257 -0
  877. package/src/kernel/packs/sparql/buildListQuery.ts +434 -0
  878. package/src/kernel/packs/sparql/buildLookupQuery.ts +681 -0
  879. package/src/kernel/packs/sparql/escape.ts +22 -0
  880. package/src/kernel/packs/sparql/filterValues.ts +201 -0
  881. package/src/kernel/packs/sparql/index.ts +53 -0
  882. package/src/kernel/packs/sparql/runSelect.ts +160 -0
  883. package/src/kernel/packs/sparql/searchTerm.ts +29 -0
  884. package/src/kernel/packs/storyRules.ts +213 -0
  885. package/src/kernel/packs/tierScope.ts +407 -0
  886. package/src/kernel/packs/types.ts +893 -0
  887. package/src/kernel/packs/uniqueness.ts +35 -0
  888. package/src/kernel/project/cli/buildProgram.ts +380 -0
  889. package/src/kernel/project/cli/constants.ts +34 -0
  890. package/src/kernel/project/cli/dispatch.ts +680 -0
  891. package/src/kernel/project/cli/exitCodes.ts +68 -0
  892. package/src/kernel/project/cli/globalFlags.ts +256 -0
  893. package/src/kernel/project/cli/helpFormat.ts +70 -0
  894. package/src/kernel/project/cli/index.ts +21 -0
  895. package/src/kernel/project/cli/rootHelp.ts +338 -0
  896. package/src/kernel/project/cli/suggest.ts +91 -0
  897. package/src/kernel/project/cli/suggestNames.ts +195 -0
  898. package/src/kernel/project/cli/verbHelp.ts +157 -0
  899. package/src/kernel/project/mcp/buildServer.ts +89 -0
  900. package/src/kernel/project/mcp/envelope.ts +45 -0
  901. package/src/kernel/project/mcp/index.ts +8 -0
  902. package/src/kernel/project/mcp/instructions.ts +141 -0
  903. package/src/kernel/project/mcp/mcpError.ts +52 -0
  904. package/src/kernel/project/mcp/prompts/index.ts +37 -0
  905. package/src/kernel/project/mcp/prompts/provider.ts +120 -0
  906. package/src/kernel/project/mcp/prompts/source.ts +209 -0
  907. package/src/kernel/project/mcp/registerVerb.ts +426 -0
  908. package/src/kernel/project/mcp/serve.ts +42 -0
  909. package/src/kernel/render/compactUri.ts +25 -0
  910. package/src/kernel/render/contracts.ts +101 -0
  911. package/src/kernel/render/disclosure.ts +46 -0
  912. package/src/kernel/render/displaySafe.ts +80 -0
  913. package/src/kernel/render/envelope.ts +49 -0
  914. package/src/kernel/render/formatters.ts +31 -0
  915. package/src/kernel/render/index.ts +30 -0
  916. package/src/kernel/render/prefixes.ts +48 -0
  917. package/src/kernel/render/renderers.ts +682 -0
  918. package/src/kernel/render/style.ts +127 -0
  919. package/src/kernel/render/turtle.ts +242 -0
  920. package/src/kernel/render/vocabulary.ts +276 -0
  921. package/src/kernel/render/writeStdout.ts +49 -0
  922. package/src/kernel/runtime/boot.ts +59 -0
  923. package/src/kernel/runtime/facade.ts +47 -0
  924. package/src/kernel/runtime/findProjectConfig.ts +62 -0
  925. package/src/kernel/runtime/graphpack/build.ts +260 -0
  926. package/src/kernel/runtime/graphpack/buildIndex.ts +371 -0
  927. package/src/kernel/runtime/graphpack/embedded.ts +136 -0
  928. package/src/kernel/runtime/graphpack/hash.ts +56 -0
  929. package/src/kernel/runtime/graphpack/index.ts +21 -0
  930. package/src/kernel/runtime/graphpack/manifest.ts +172 -0
  931. package/src/kernel/runtime/graphpack/read.ts +170 -0
  932. package/src/kernel/runtime/graphpack/schemas.ts +97 -0
  933. package/src/kernel/runtime/graphpack/stories.ts +84 -0
  934. package/src/kernel/runtime/graphpack/types.ts +187 -0
  935. package/src/kernel/runtime/index.ts +15 -0
  936. package/src/kernel/runtime/loadSession.ts +57 -0
  937. package/src/kernel/runtime/lockState.ts +196 -0
  938. package/src/kernel/runtime/packVersion.ts +84 -0
  939. package/src/kernel/runtime/paths.ts +176 -0
  940. package/src/kernel/runtime/probe.ts +39 -0
  941. package/src/kernel/runtime/readEntity.ts +598 -0
  942. package/src/kernel/runtime/refs/gitOps.ts +426 -0
  943. package/src/kernel/runtime/refs/index.ts +39 -0
  944. package/src/kernel/runtime/refs/parseRef.ts +127 -0
  945. package/src/kernel/runtime/refs/resolve.ts +475 -0
  946. package/src/kernel/runtime/resolveSources.ts +235 -0
  947. package/src/kernel/runtime/store.ts +90 -0
  948. package/src/kernel/runtime/storeReadiness.ts +61 -0
  949. package/src/kernel/runtime/types.ts +266 -0
  950. package/src/kernel/spec/asVerb.ts +23 -0
  951. package/src/kernel/spec/call.ts +186 -0
  952. package/src/kernel/spec/emitReference.ts +701 -0
  953. package/src/kernel/spec/emitSurface.ts +285 -0
  954. package/src/kernel/spec/guidance.ts +68 -0
  955. package/src/kernel/spec/index.ts +41 -0
  956. package/src/kernel/spec/surfaceConformance.ts +143 -0
  957. package/src/kernel/spec/types.ts +636 -0
  958. package/src/kernel/spec/validate.ts +126 -0
  959. package/src/kernel/spec/wireType.ts +53 -0
  960. package/src/kernel/vocabulary.ts +121 -0
  961. package/src/main.ts +615 -0
  962. package/src/run.ts +26 -0
  963. package/src/testing/behavioral/liveReadSurface.ts +112 -0
  964. package/src/testing/build.globalSetup.ts +641 -0
  965. package/src/testing/eval/cases/stable.ts +165 -0
  966. package/src/testing/eval/harness.ts +91 -0
  967. package/src/testing/helpers/callSchema.ts +40 -0
  968. package/src/testing/helpers/fixtureGraph.ts +165 -0
  969. package/src/testing/helpers/packRuntime.ts +117 -0
  970. package/src/testing/helpers/parity.ts +119 -0
  971. package/src/testing/helpers/projectCli.ts +36 -0
  972. package/src/testing/helpers/projectMcp.ts +178 -0
  973. package/src/testing/helpers/runCli.ts +209 -0
  974. package/src/testing/index.ts +218 -0
  975. package/src/testing/prismRoot.ts +14 -0
  976. package/src/testing/setup/build.ts +5 -0
  977. package/src/testing/setup/calls.ts +2 -0
  978. package/src/testing/setup/offline-registry.ts +2 -0
  979. package/src/testing/setup/temp-root.ts +2 -0
  980. package/src/testing/setup/xdg.ts +2 -0
  981. package/src/testing/setupCallChecking.ts +30 -0
  982. package/src/testing/setupOfflineRegistry.ts +20 -0
  983. package/src/testing/setupXdgIsolation.ts +87 -0
  984. package/src/testing/tempRoot.globalSetup.ts +122 -0
  985. package/src/types.ts +61 -0
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Whether a failed import is a missing module — a broken or pruned install —
3
+ * rather than a fault in the module itself.
4
+ */
5
+ /**
6
+ * True when a dynamic import failed because the module could not be RESOLVED.
7
+ * summon-core + the generators are now bundled into the binary, so this should
8
+ * not arise; {@link loadCreateRuntime} keeps it as a defensive backstop that
9
+ * turns a resolution failure into a clean gate rather than a raw "internal bug"
10
+ * report. Matched structurally across bun (`ResolveMessage`) and node
11
+ * (`ERR_MODULE_NOT_FOUND`) so a genuine runtime error still propagates.
12
+ */
13
+ export function isModuleNotFound(cause) {
14
+ if (!cause || typeof cause !== "object")
15
+ return false;
16
+ const { code, name, message } = cause;
17
+ return (code === "ERR_MODULE_NOT_FOUND" ||
18
+ code === "MODULE_NOT_FOUND" ||
19
+ name === "ResolveMessage" ||
20
+ (typeof message === "string" &&
21
+ /cannot find (module|package)/i.test(message)));
22
+ }
23
+ //# sourceMappingURL=moduleNotFound.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moduleNotFound.js","sourceRoot":"","sources":["../../../../src/capabilities/create/moduleNotFound.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAI/B,CAAC;IACF,OAAO,CACL,IAAI,KAAK,sBAAsB;QAC/B,IAAI,KAAK,kBAAkB;QAC3B,IAAI,KAAK,gBAAgB;QACzB,CAAC,OAAO,OAAO,KAAK,QAAQ;YAC1B,+BAA+B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CACjD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,302 @@
1
+ /**
2
+ * The `create` CLI mount: the summon generator TREE, mounted under the
3
+ * `create` noun through the SAME registration path the summon bin uses
4
+ * (`registerGeneratorCommands` from
5
+ * `@canonical/summon-core/projection/commander`), fed
6
+ * by the build-time projection (`createSurface.generated.ts`) — so `pragma
7
+ * create component react [component-path]` and `summon component react
8
+ * [component-path]` are one grammar, derived once.
9
+ *
10
+ * The mount owns everything beneath the noun: tree segments as subcommands,
11
+ * prompt-derived flags (a default-true confirm registers only its `--no-`
12
+ * form), grouped help, the excess-positional guard, and the leaf action —
13
+ * which extracts the EXPLICIT answers, makes the ONE interaction decision
14
+ * (refusing before the create runtime ever loads), and hands the kernel's
15
+ * `dispatchPrepared` a synthesized per-leaf VerbSpec so dry-run/undo/real-run
16
+ * rendering, exit codes, SIGINT and the SEC-2 jail reuse the existing
17
+ * machinery byte-for-byte.
18
+ *
19
+ * This is the HEAVY half of the create projection, reached ONLY through the
20
+ * dynamic import in `cliProjection.ts` — the light half the capabilities
21
+ * barrel carries. The split exists for the fast paths: `--help` and
22
+ * `__complete` import the barrel on every spawn and register nothing, so the
23
+ * registration machinery this module needs (summon-core's projection helpers
24
+ * and Commander adapter, Commander itself, the kernel dispatcher) must load
25
+ * only when an invocation actually enters the `create` subtree. The
26
+ * lazy-graph guard in `lazy.test.ts` pins that boundary.
27
+ */
28
+ import { decideInteraction, explicitAnswersComplete, extractAnswers, missingExplicitFlags, refusalMessage, toKebabCase, } from "@canonical/summon-core/projection";
29
+ import { emitToProcess, registerGeneratorCommands, } from "@canonical/summon-core/projection/commander";
30
+ import { CommanderError, Option } from "commander";
31
+ import { PragmaError } from "../../kernel/error/index.js";
32
+ import { renderErrorForFormat } from "../../kernel/error/renderError.js";
33
+ import { canPrompt } from "../../kernel/interactivity.js";
34
+ import { MUTATION_FLAG_DOCS } from "../../kernel/project/cli/constants.js";
35
+ import { dispatchPrepared, } from "../../kernel/project/cli/dispatch.js";
36
+ import { helpColumns, helpDim, helpHeading, helpUsage, } from "../../kernel/project/cli/helpFormat.js";
37
+ import { bindingFor, CREATE_BINDINGS, CREATE_SURFACE } from "./constants.js";
38
+ import { CREATE_CAPABILITY, CREATE_OUTPUT, runCreate } from "./create.verb.js";
39
+ import { renderCreateHelp } from "./createHelp.js";
40
+ /** The mount's standard-flag rows for the grouped-help Global Options block. */
41
+ const MOUNT_FLAG_HELP = [
42
+ // The kernel's own mutation-flag rows (one authoring point with
43
+ // registration and verb help), then its `--help` row (rootHelp.ts), not
44
+ // Commander's phrasing — one voice across every help page, and `--help`
45
+ // is the only spelling (the subtree inherits the root's long-only help
46
+ // option).
47
+ ...MUTATION_FLAG_DOCS.map(({ flag, doc }) => ({
48
+ flags: flag,
49
+ description: doc,
50
+ })),
51
+ { flags: "--help", description: "Show help (works on any command)" },
52
+ ];
53
+ /** The declared tree, flattened to registration entries (parents first). */
54
+ function surfaceBarrel() {
55
+ const entries = [];
56
+ const namespaces = new Set();
57
+ for (const binding of CREATE_BINDINGS) {
58
+ for (const commandPath of binding.paths) {
59
+ const segments = commandPath.split("/");
60
+ if (segments.length > 1)
61
+ namespaces.add(segments[0]);
62
+ }
63
+ }
64
+ for (const namespace of namespaces) {
65
+ entries.push({ path: [namespace], description: `${namespace} generators` });
66
+ }
67
+ for (const binding of CREATE_BINDINGS) {
68
+ for (const commandPath of binding.paths) {
69
+ const surface = CREATE_SURFACE[commandPath];
70
+ if (!surface) {
71
+ throw new Error(`the generator surface carries no entry for "${commandPath}" — rerun the distribution's build`);
72
+ }
73
+ entries.push({
74
+ path: commandPath.split("/"),
75
+ generator: {
76
+ commandPath,
77
+ meta: { description: surface.description },
78
+ prompts: surface.prompts,
79
+ },
80
+ });
81
+ }
82
+ }
83
+ return entries.sort((a, b) => a.path.length - b.path.length);
84
+ }
85
+ /**
86
+ * Synthesize the per-leaf VerbSpec `dispatchPrepared` runs: params are EMPTY
87
+ * (the mount already extracted the explicit answers — leaf commands carry no
88
+ * Commander defaults, so explicit stays distinguishable from default), and
89
+ * `run` is `runCreate` over the full command path.
90
+ *
91
+ * The output spec is the SHARED `CREATE_OUTPUT`, not a local rebuild: this is
92
+ * the spec a real `create component react …` runs against, so a dry-run
93
+ * renderer declared only on the binding-level verbs would be a renderer the
94
+ * CLI never reached.
95
+ */
96
+ export function leafVerb(commandPath) {
97
+ const surface = CREATE_SURFACE[commandPath];
98
+ return {
99
+ path: ["create", bindingFor(commandPath).noun],
100
+ summary: surface?.description ?? commandPath,
101
+ params: [],
102
+ output: CREATE_OUTPUT,
103
+ capability: CREATE_CAPABILITY,
104
+ run: (params, rt) => runCreate(commandPath, params, rt),
105
+ };
106
+ }
107
+ /**
108
+ * The explicit answers of one leaf invocation: flag-extracted (explicit-only,
109
+ * confirm equality-vs-default) plus the positional when given. Exported for
110
+ * the grammar tests — this is the exact bag the wizard is seeded with.
111
+ */
112
+ export function explicitLeafAnswers(prompts, positionalValue, options) {
113
+ const explicit = extractAnswers(options, prompts);
114
+ const positionalPrompt = prompts.find((prompt) => prompt.positional);
115
+ if (positionalPrompt && positionalValue !== undefined) {
116
+ explicit[positionalPrompt.name] = positionalValue;
117
+ }
118
+ return explicit;
119
+ }
120
+ /**
121
+ * The mount's mode resolution — `decideInteraction` over the leaf's five
122
+ * inputs, with the TTY fact INJECTED so the resolution is testable with
123
+ * `tty: true` (no suite can drive a real TTY through a subprocess). The
124
+ * action calls it with {@link canPrompt} — the same exported H3 gate the
125
+ * kernel's interaction context reads — so the mount and `runCreate` can
126
+ * never disagree about interactivity.
127
+ */
128
+ export function resolveCreateMode(prompts, explicit, mutation, tty) {
129
+ return decideInteraction({
130
+ dryRun: mutation.dryRun,
131
+ undo: mutation.undo,
132
+ yes: mutation.yes,
133
+ isTTY: tty,
134
+ explicitComplete: explicitAnswersComplete(prompts, explicit),
135
+ }).mode;
136
+ }
137
+ /**
138
+ * Write the refusal and set exit 2. The refusal is the cross-CLI parity
139
+ * surface (contract §3): its default bytes are the shared message verbatim,
140
+ * no envelope prefix — the summon bin's full stderr, byte for byte — and
141
+ * ONLY an explicitly requested machine format reframes it, through the
142
+ * kernel's ONE gate+renderer decision (`renderErrorForFormat`): `--format
143
+ * json` emits the D3 `{ ok:false, error }` envelope, `--format llm` the
144
+ * condensed Markdown error form, both as `INVALID_INPUT` through the same
145
+ * renderers every other pragma error uses. Implicit auto-LLM detection (a
146
+ * piped run without `--format`) is excluded by the helper's construction —
147
+ * an inferred output mode must never break refusal byte-parity with summon.
148
+ */
149
+ function writeRefusal(message, flags) {
150
+ const rendered = renderErrorForFormat(new PragmaError({ code: "INVALID_INPUT", message }), flags.format);
151
+ process.stderr.write(`${rendered ?? message}\n`);
152
+ process.exitCode = 2;
153
+ }
154
+ /**
155
+ * Mount the generator tree onto the `create` parent command.
156
+ *
157
+ * The registration entry `cliProjection.ts` dynamically imports — see this
158
+ * module's header for why it must not be reached statically.
159
+ */
160
+ export function mountCreateTree(parent, host) {
161
+ // The parent's own face: the topic tree (paths + descriptions), on bare
162
+ // `create` AND on `create --help` alike, exit 0.
163
+ parent.configureHelp({ formatHelp: () => "" });
164
+ parent.addHelpText("beforeAll", (ctx) => ctx.command === parent ? `${topicTree(host.programName)}\n` : "");
165
+ parent.allowExcessArguments(true);
166
+ parent.action(async () => {
167
+ const stray = parent.args[0];
168
+ if (stray !== undefined) {
169
+ // An unrecognized topic keeps the bin's "Did you mean?" flow (the bin
170
+ // re-derives the token from argv; this message is cosmetic).
171
+ throw new CommanderError(2, "commander.unknownCommand", `error: unknown command '${stray}'`);
172
+ }
173
+ process.stdout.write(`${topicTree(host.programName)}\n`);
174
+ });
175
+ const cliHost = {
176
+ registerFlags: (cmd) => {
177
+ // Reset the designed-help suppression a Commander child inherits from
178
+ // the root program; grouped help re-configures the leaves right after.
179
+ cmd.configureHelp({});
180
+ for (const { flag, doc } of MUTATION_FLAG_DOCS) {
181
+ cmd.option(flag, doc);
182
+ }
183
+ },
184
+ helpFlags: MOUNT_FLAG_HELP,
185
+ // The seam's presentation half: the projection's structure, pragma's
186
+ // house style (see createHelp.ts).
187
+ renderHelp: renderCreateHelp,
188
+ action: async (entry, positionalValue, options) => {
189
+ const generator = entry.generator;
190
+ // An answer this path refuses (`GeneratorBinding.refuse`) is refused
191
+ // before anything loads, with the binding's own message.
192
+ const refusal = bindingFor(generator.commandPath).refuse?.find(({ path, param }) => path === generator.commandPath && options[param] === true);
193
+ if (refusal !== undefined) {
194
+ writeRefusal(refusal.message, host.globalFlags);
195
+ return;
196
+ }
197
+ const explicit = explicitLeafAnswers(generator.prompts, positionalValue, options);
198
+ const mutation = {
199
+ dryRun: options.dryRun === true,
200
+ undo: options.undo === true,
201
+ yes: options.yes === true,
202
+ };
203
+ // The ONE interaction decision — made BEFORE the create runtime loads,
204
+ // so a refusal never touches summon-core. (`runCreate` re-derives the
205
+ // same mode from the same inputs to pick its prompt strategy.)
206
+ const mode = resolveCreateMode(generator.prompts, explicit, mutation, canPrompt());
207
+ if (mode === "refuse") {
208
+ writeRefusal(refusalMessage(missingExplicitFlags(generator.prompts, explicit)), host.globalFlags);
209
+ return;
210
+ }
211
+ await dispatchPrepared(leafVerb(generator.commandPath), explicit, mutation, host.globalFlags);
212
+ },
213
+ onNamespace: (cmd) => {
214
+ // Reset the designed-help suppression a Commander child inherits from
215
+ // the root program. The namespace BEHAVIOR (the shared did-you-mean on
216
+ // a stray segment, help-on-stderr exit 1 when bare) is the
217
+ // projection's, not the mount's — both hosts emit the same lines.
218
+ cmd.configureHelp({});
219
+ },
220
+ // The projection's usage errors reframe ONLY under an explicitly
221
+ // requested machine format — the kernel's ONE gate+renderer decision
222
+ // (`renderErrorForFormat`, shared with `writeRefusal` and bin.ts's
223
+ // usage-error sites), autoLlm excluded by its construction, so the
224
+ // default piped bytes stay the cross-CLI parity surface. Codes mirror
225
+ // bin.ts's classification: unknown command → UNKNOWN_VERB, every other
226
+ // usage error → INVALID_INPUT. The match is serialized PER KIND: an
227
+ // unknown SEGMENT is a fuzzy match, so its bare candidate rides in
228
+ // `suggestions` (substitutable for the token the headline names); an
229
+ // excess positional's match is NOT substitutable — it may BE the stray
230
+ // — so that kind instead carries the correction in the covenant's
231
+ // `recovery.cli` (`[...chain, suggestion].join(" ")`), and ONLY when
232
+ // that command is a DECLARED RUNNABLE LEAF: `chain` is `[<bin>,
233
+ // "create", ...segments]`, so everything past the mount point joined
234
+ // with the suggestion is the CREATE_SURFACE key, and a namespace match
235
+ // (exit-1 help page, can never scaffold) ships NO recovery.
236
+ emit: (outcome) => {
237
+ if (outcome.kind === "namespace-help")
238
+ return emitToProcess(outcome);
239
+ const { error } = outcome;
240
+ const rendered = renderErrorForFormat(new PragmaError({
241
+ code: error.kind === "unknown-segment" ? "UNKNOWN_VERB" : "INVALID_INPUT",
242
+ message: error.headline,
243
+ ...(error.kind === "unknown-segment" && error.suggestion !== undefined
244
+ ? { suggestions: [error.suggestion] }
245
+ : {}),
246
+ ...(error.kind === "excess-positional" &&
247
+ error.suggestion !== undefined &&
248
+ CREATE_SURFACE[[...error.chain.slice(2), error.suggestion].join("/")] !== undefined
249
+ ? {
250
+ recovery: {
251
+ message: "Run the corrected invocation.",
252
+ cli: [...error.chain, error.suggestion].join(" "),
253
+ },
254
+ }
255
+ : {}),
256
+ }), host.globalFlags.format);
257
+ // No machine format requested: the default piped bytes are the parity
258
+ // surface.
259
+ if (rendered === undefined)
260
+ return emitToProcess(outcome);
261
+ process.stderr.write(`${rendered}\n`);
262
+ process.exitCode = outcome.exitCode;
263
+ },
264
+ };
265
+ registerGeneratorCommands(parent, surfaceBarrel(), cliHost);
266
+ // An answer a path refuses is still REGISTERED on it, hidden, so passing it
267
+ // reaches the refusal's own message instead of an unknown-option error.
268
+ for (const binding of CREATE_BINDINGS) {
269
+ for (const refusal of binding.refuse ?? []) {
270
+ let command = parent;
271
+ for (const segment of refusal.path.split("/")) {
272
+ command = command?.commands.find((cmd) => cmd.name() === segment);
273
+ }
274
+ command?.addOption(new Option(`--${toKebabCase(refusal.param)}`).hideHelp());
275
+ }
276
+ }
277
+ }
278
+ /**
279
+ * The pragma-styled topic tree (paths + descriptions from the manifest):
280
+ * one row per INVOCABLE command path (`component react`, `package`, …), so
281
+ * every row is copy-pasteable after `pragma create ` — the same kernel
282
+ * primitives, and the same shape, as every other noun's verb listing
283
+ * (`formatNounHelp`).
284
+ */
285
+ export function topicTree(programName) {
286
+ const rows = CREATE_BINDINGS.flatMap((binding) => binding.paths.map((commandPath) => [
287
+ commandPath.split("/").join(" "),
288
+ CREATE_SURFACE[commandPath]?.description ?? "",
289
+ ]));
290
+ return [
291
+ helpUsage(`${programName} create <path...> [options]`),
292
+ "",
293
+ "Scaffold from the summon generator tree.",
294
+ "",
295
+ helpHeading("Generators"),
296
+ ...helpColumns(rows),
297
+ "",
298
+ helpDim(`Run \`${programName} create <path...> --help\` for a generator's flags.`),
299
+ helpDim(`The tree mirrors the summon CLI: \`${programName} create <path...>\` ≡ \`summon <path...>\`.`),
300
+ ].join("\n");
301
+ }
302
+ //# sourceMappingURL=mount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount.js","sourceRoot":"","sources":["../../../../src/capabilities/create/mount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAEL,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EAGd,oBAAoB,EAEpB,cAAc,EACd,WAAW,GACZ,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,aAAa,EACb,yBAAyB,GAC1B,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAgB,cAAc,EA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I,MAAM,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CACzD,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,WAAmB;IAC3C,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAC/C,OAAO,CAAC,KAAK,CAAC,GAAG,CACf,CAAC,WAAW,EAAE,EAAE,CACd;QACE,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAChC,cAAc,CAAC,WAAW,CAAC,EAAE,WAAW,IAAI,EAAE;KACtC,CACb,CACF,CAAC;IACF,OAAO;QACL,SAAS,CAAC,GAAG,WAAW,6BAA6B,CAAC;QACtD,EAAE;QACF,0CAA0C;QAC1C,EAAE;QACF,WAAW,CAAC,YAAY,CAAC;QACzB,GAAG,WAAW,CAAC,IAAI,CAAC;QACpB,EAAE;QACF,OAAO,CACL,SAAS,WAAW,qDAAqD,CAC1E;QACD,OAAO,CACL,sCAAsC,WAAW,6CAA6C,CAC/F;KACF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * SEC-2 path jail: an independent guard that a `create` output path stays inside
3
+ * the workspace, run BEFORE any effect. It rejects an absolute path, a `..`
4
+ * escape, and — via `realpath` on the nearest existing ancestor — a symlink that
5
+ * points out of the tree. This is defence in depth: the generators' own prompt
6
+ * validators (`validateComponentPath`, `validateAppPath`) reject absolute/`..`
7
+ * uniformly across the declared path prompts — in BOTH hosts, upstream of this
8
+ * jail — so the jail is pragma's host-level backstop, and its symlink check is
9
+ * the one tier the shared validators do not have (summon relies on the
10
+ * validator tier; hoisting the realpath check into the shared layer is a named
11
+ * follow-up).
12
+ */
13
+ import { existsSync, realpathSync } from "node:fs";
14
+ import * as path from "node:path";
15
+ import { PragmaError } from "../../kernel/error/index.js";
16
+ /** Walk up from `p` to the nearest ancestor that exists on disk. */
17
+ function nearestExisting(p) {
18
+ let current = p;
19
+ while (!existsSync(current)) {
20
+ const parent = path.dirname(current);
21
+ if (parent === current)
22
+ return current; // filesystem root
23
+ current = parent;
24
+ }
25
+ return current;
26
+ }
27
+ /** Whether `rel` (a `path.relative` result) points at or above its base. */
28
+ const escapes = (rel) => rel === ".." || rel.startsWith(`..${path.sep}`) || path.isAbsolute(rel);
29
+ /**
30
+ * Reject a create output path that would escape the workspace root (`cwd`).
31
+ *
32
+ * @param field - The param name being jailed (for the error message).
33
+ * @param value - The path value (skipped when absent — the generator's own safe
34
+ * default is used instead).
35
+ * @param cwd - The workspace root the path must stay within.
36
+ * @throws PragmaError INVALID_INPUT when the path escapes the workspace.
37
+ * @note Impure — reads the filesystem (`existsSync`/`realpathSync`).
38
+ */
39
+ export function assertInsideWorkspace(field, value, cwd) {
40
+ if (typeof value !== "string" || value === "")
41
+ return;
42
+ if (path.isAbsolute(value)) {
43
+ throw PragmaError.invalidInput(field, value, {
44
+ recovery: { message: "Use a path relative to the current directory." },
45
+ });
46
+ }
47
+ const root = path.resolve(cwd);
48
+ const resolved = path.resolve(root, value);
49
+ if (escapes(path.relative(root, resolved))) {
50
+ throw PragmaError.invalidInput(field, value, {
51
+ recovery: { message: "The path must stay inside the workspace." },
52
+ });
53
+ }
54
+ // Symlink escape: the nearest existing ancestor, resolved through symlinks,
55
+ // must still sit within the resolved workspace root.
56
+ const realRoot = realpathSync(root);
57
+ const realAncestor = realpathSync(nearestExisting(resolved));
58
+ if (realAncestor !== realRoot &&
59
+ escapes(path.relative(realRoot, realAncestor))) {
60
+ throw PragmaError.invalidInput(field, value, {
61
+ recovery: { message: "The path resolves outside the workspace." },
62
+ });
63
+ }
64
+ }
65
+ //# sourceMappingURL=pathJail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pathJail.js","sourceRoot":"","sources":["../../../../src/capabilities/create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,EAAE,KAAK,CAAC,CAAC;IAC3C,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC;QAC3C,MAAM,WAAW,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE;YAC3C,QAAQ,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE;SAClE,CAAC,CAAC;IACL,CAAC;IAED,4EAA4E;IAC5E,qDAAqD;IACrD,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,YAAY,GAAG,YAAY,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC7D,IACE,YAAY,KAAK,QAAQ;QACzB,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,EAC9C,CAAC;QACD,MAAM,WAAW,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE;YAC3C,QAAQ,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE;SAClE,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { installedDistribution } from "../../kernel/distribution/registry.js";
2
+ import { PragmaError } from "../../kernel/error/index.js";
3
+ import { isModuleNotFound } from "./moduleNotFound.js";
4
+ /**
5
+ * Pick the generator for one FULL COMMAND PATH (`component/react`,
6
+ * `package`, `application/react`) — a straight lookup over the generators the
7
+ * distribution loads, no framework axis: the path IS the identity, exactly as
8
+ * summon's tree keys it. Callers with a kind+choice surface (MCP) map to a
9
+ * path first.
10
+ *
11
+ * The distribution's loader imports its generator packages, and importing
12
+ * them pulls summon-core. So it runs only behind `create`'s lazy `import()`
13
+ * (R9): the fast paths (`buildProgram` / `__complete` / `--help` / reads)
14
+ * never load it, and `create --yes` never loads React either (summon-core's
15
+ * Ink UI is dynamic-only). The loader is written in the distribution's own
16
+ * package, so its generator packages resolve from there, not from prism's.
17
+ *
18
+ * @param commandPath - The declared command path to run.
19
+ * @returns The selected generator definition.
20
+ * @throws PragmaError UNSUPPORTED, with a reinstall hint, when a generator
21
+ * package the distribution loads is missing from the install.
22
+ * @throws PragmaError INTERNAL when the distribution loads no generator for
23
+ * the path (callers validate user-facing inputs before mapping to a path).
24
+ */
25
+ export async function pickGenerator(commandPath) {
26
+ const { config, loadGenerators } = installedDistribution();
27
+ let generators;
28
+ try {
29
+ generators = await loadGenerators?.();
30
+ }
31
+ catch (cause) {
32
+ if (!isModuleNotFound(cause))
33
+ throw cause;
34
+ throw new PragmaError({
35
+ code: "UNSUPPORTED",
36
+ message: `\`create ${commandPath.replaceAll("/", " ")}\` cannot load its generator — a generator package ${config.name} depends on is missing from this install.`,
37
+ recovery: {
38
+ message: `Reinstall ${config.name} to restore its generator packages.`,
39
+ },
40
+ });
41
+ }
42
+ const generator = generators?.[commandPath];
43
+ if (generator === undefined) {
44
+ throw PragmaError.internalError(`missing generator for ${commandPath}`);
45
+ }
46
+ return generator;
47
+ }
48
+ //# sourceMappingURL=pickGenerator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pickGenerator.js","sourceRoot":"","sources":["../../../../src/capabilities/create/pickGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,WAAmB;IAEnB,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAC3D,IAAI,UAES,CAAC;IACd,IAAI,CAAC;QACH,UAAU,GAAG,MAAM,cAAc,EAAE,EAAE,CAAC;IACxC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;YAAE,MAAM,KAAK,CAAC;QAC1C,MAAM,IAAI,WAAW,CAAC;YACpB,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,YAAY,WAAW,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,sDAAsD,MAAM,CAAC,IAAI,2CAA2C;YACjK,QAAQ,EAAE;gBACR,OAAO,EAAE,aAAa,MAAM,CAAC,IAAI,qCAAqC;aACvE;SACF,CAAC,CAAC;IACL,CAAC;IACD,MAAM,SAAS,GAAG,UAAU,EAAE,CAAC,WAAW,CAAC,CAAC;IAC5C,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,WAAW,CAAC,aAAa,CAAC,yBAAyB,WAAW,EAAE,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * The distribution's own read stories, compiled at module load.
3
+ *
4
+ * The installed distribution declares them on the packs that supply them; this is the ONE
5
+ * place those declarations become capabilities. They come through the SAME door
6
+ * a third-party story does — {@link compileStoryModule} — so the mechanism the CLI
7
+ * offers forks is the mechanism the CLI itself runs on.
8
+ *
9
+ * They are compiled STATICALLY rather than merged at dispatch on purpose: the
10
+ * `--help` / `__complete` fast paths read the static capability set, and
11
+ * `surface/surface.v2.json` freezes the emitted surface, so a noun that only
12
+ * arrived at dispatch would vanish from help and completion on a fresh install.
13
+ * That is affordable because this module is zod-free and pure — the
14
+ * distribution is inert data and the compiler builds specs without touching the
15
+ * store.
16
+ *
17
+ * A project's own stories never replace these: `assembleEffectiveModules`
18
+ * skips a project noun that one of them holds, with a warning.
19
+ */
20
+ import { BIN_NAME } from "../constants.js";
21
+ import { installedDistribution } from "../kernel/distribution/registry.js";
22
+ import { compileStoryModule } from "../kernel/packs/compile.js";
23
+ import { distributionSource, } from "../kernel/packs/types.js";
24
+ import { DEFAULT_PREFIX_MAP } from "../kernel/render/index.js";
25
+ const { config, configFile } = installedDistribution();
26
+ /** The read stories the distribution declares on its packs, by noun. */
27
+ export const declaredStories = new Map((config.packs ?? [])
28
+ .flatMap((pack) => (typeof pack === "string" ? [] : (pack.stories ?? [])))
29
+ .map((story) => [story.noun, story]));
30
+ /** The lookup each declared noun resolves names through, for a filter naming it. */
31
+ export const declaredLookups = (noun) => declaredStories.get(noun)?.lookup;
32
+ /**
33
+ * Those stories compiled to capability modules, by noun.
34
+ *
35
+ * `capabilities/index.ts` appends every module no authored one claims — and
36
+ * since L-OPEN-9 that is every one of them: no data noun is authored, so a
37
+ * declared story IS the whole noun. `distribution.test.ts` holds that shut by
38
+ * asserting each registered module's verbs deep-equal its compiled story's.
39
+ */
40
+ export const storyModules = new Map([...declaredStories].map(([noun, story]) => [
41
+ noun,
42
+ compileStoryModule(story, distributionSource(configFile), DEFAULT_PREFIX_MAP, declaredLookups),
43
+ ]));
44
+ /**
45
+ * Put the distribution's wording on one verb: the fields it declares replace
46
+ * the kernel's neutral ones, and its examples are spelled with the binary name.
47
+ */
48
+ function wordVerb(verb, wording) {
49
+ if (wording === undefined)
50
+ return verb;
51
+ const { examples, ...text } = wording;
52
+ return {
53
+ ...verb,
54
+ ...text,
55
+ ...(examples === undefined
56
+ ? {}
57
+ : {
58
+ examples: examples.map(({ args, note }) => ({
59
+ cmd: `${BIN_NAME} ${args}`,
60
+ ...(note === undefined ? {} : { note }),
61
+ })),
62
+ }),
63
+ };
64
+ }
65
+ /**
66
+ * The kernel's own modules, worded for this distribution
67
+ * (`DistributionConfig.verbs`, keyed by verb path). A module none of whose
68
+ * verbs is worded is returned as it is.
69
+ *
70
+ * @param modules - The authored modules.
71
+ * @returns The same modules, their verbs carrying the distribution's wording.
72
+ */
73
+ export function wordModules(modules) {
74
+ const wording = config.verbs ?? {};
75
+ return modules.map((module) => module.verbs.some((verb) => verb.path.join(" ") in wording)
76
+ ? {
77
+ ...module,
78
+ verbs: module.verbs.map((verb) => wordVerb(verb, wording[verb.path.join(" ")])),
79
+ }
80
+ : module);
81
+ }
82
+ //# sourceMappingURL=distribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distribution.js","sourceRoot":"","sources":["../../../src/capabilities/distribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EACL,kBAAkB,GAGnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG/D,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,qBAAqB,EAAE,CAAC;AAEvD,wEAAwE;AACxE,MAAM,CAAC,MAAM,eAAe,GAAwC,IAAI,GAAG,CACzE,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;KACjB,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC;KACzE,GAAG,CAAC,CAAC,KAAK,EAAqC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAC1E,CAAC;AAEF,oFAAoF;AACpF,MAAM,CAAC,MAAM,eAAe,GAAgB,CAAC,IAAI,EAAE,EAAE,CACnD,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAA0C,IAAI,GAAG,CACxE,CAAC,GAAG,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;IAC1C,IAAI;IACJ,kBAAkB,CAChB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CAAC,CAAC,CAC7C;SACF;QACH,CAAC,CAAC,MAAM,CACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { BIN_NAME } from "../../../constants.js";
2
+ import { entityTotal } from "../../../kernel/completion/entitySource.js";
3
+ import { installedDistribution } from "../../../kernel/distribution/registry.js";
4
+ /**
5
+ * Check that the local store boots, reporting the entity total and boot time.
6
+ * The check is NAMED "store" in the report — the same word every other surface
7
+ * uses for it; the ke library it boots through is an implementation detail.
8
+ *
9
+ * This is the ONE check that touches the store — it boots the shared lazy store
10
+ * inside a try/catch, so doctor stays storeless-by-default at the dispatch level
11
+ * (the verb declares `needsStore: false`; only this check pays the boot, only
12
+ * when reached). On success it reads the entity total from the session's
13
+ * storeless index rather than a fresh triple COUNT — cheaper, and the store is
14
+ * already booted.
15
+ *
16
+ * @param rt - The per-invocation runtime.
17
+ * @returns A CheckResult: pass with the entity total, or fail with a remedy.
18
+ * @note Impure — boots the store.
19
+ */
20
+ export async function checkKeStore(rt) {
21
+ const start = performance.now();
22
+ try {
23
+ const session = await rt.store.get();
24
+ const total = entityTotal(session.index);
25
+ const elapsed = Math.round(performance.now() - start);
26
+ return {
27
+ name: "store",
28
+ status: "pass",
29
+ detail: `${total.toLocaleString()} entities in ${elapsed}ms`,
30
+ };
31
+ }
32
+ catch {
33
+ return {
34
+ name: "store",
35
+ status: "fail",
36
+ detail: "cannot boot",
37
+ remedy: `Ensure ${installedDistribution().config.packsLabel ?? "packs"} are configured and run \`${BIN_NAME} sources update\`.`,
38
+ };
39
+ }
40
+ }
41
+ //# sourceMappingURL=checkKeStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkKeStore.js","sourceRoot":"","sources":["../../../../../src/capabilities/doctor/checks/checkKeStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAIjF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EAAiB;IAClD,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAChC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACzC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC;QACtD,OAAO;YACL,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,GAAG,KAAK,CAAC,cAAc,EAAE,gBAAgB,OAAO,IAAI;SAC7D,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;YACL,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE,UAAU,qBAAqB,EAAE,CAAC,MAAM,CAAC,UAAU,IAAI,OAAO,6BAA6B,QAAQ,oBAAoB;SAChI,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { SUPPORTED_NODE_RANGE } from "../../../constants.js";
2
+ import { isSupportedNodeVersion } from "./isSupportedNodeVersion.js";
3
+ /**
4
+ * Check that the running Node.js version satisfies this package's declared
5
+ * `engines.node` range.
6
+ *
7
+ * The floor is a property of the manifest, not of this file: a check that
8
+ * hardcodes its own number can disagree with the range the package publishes,
9
+ * and a consumer then passes a check the install contract would have failed.
10
+ *
11
+ * @returns A CheckResult with the current version and pass/fail status.
12
+ * @note Impure — reads `process.versions`.
13
+ */
14
+ export async function checkNodeVersion() {
15
+ const version = process.versions.node;
16
+ if (isSupportedNodeVersion(version)) {
17
+ return { name: "Node version", status: "pass", detail: `v${version}` };
18
+ }
19
+ return {
20
+ name: "Node version",
21
+ status: "fail",
22
+ detail: `v${version} (requires ${SUPPORTED_NODE_RANGE})`,
23
+ remedy: `Install Node.js ${SUPPORTED_NODE_RANGE}`,
24
+ };
25
+ }
26
+ //# sourceMappingURL=checkNodeVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkNodeVersion.js","sourceRoot":"","sources":["../../../../../src/capabilities/doctor/checks/checkNodeVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;IAEtC,IAAI,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;QACpC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,OAAO,EAAE,EAAE,CAAC;IACzE,CAAC;IAED,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,IAAI,OAAO,cAAc,oBAAoB,GAAG;QACxD,MAAM,EAAE,mBAAmB,oBAAoB,EAAE;KAClD,CAAC;AACJ,CAAC"}