@canonical/pragma-cli 0.34.0 → 0.35.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 (798) hide show
  1. package/README.md +153 -30
  2. package/dist/.build-ok +0 -0
  3. package/dist/package.json +83 -0
  4. package/dist/pragma.conf.js +814 -0
  5. package/dist/pragma.conf.js.map +1 -0
  6. package/dist/src/bin.js +356 -0
  7. package/dist/src/bin.js.map +1 -0
  8. package/dist/src/capabilities/capabilities/capabilities.render.js +70 -0
  9. package/dist/src/capabilities/capabilities/capabilities.render.js.map +1 -0
  10. package/dist/src/capabilities/capabilities/capabilities.verb.js +59 -0
  11. package/dist/src/capabilities/capabilities/capabilities.verb.js.map +1 -0
  12. package/dist/src/capabilities/capabilities/catalog.js +130 -0
  13. package/dist/src/capabilities/capabilities/catalog.js.map +1 -0
  14. package/dist/src/capabilities/capabilities/hints.js +195 -0
  15. package/dist/src/capabilities/capabilities/hints.js.map +1 -0
  16. package/dist/src/capabilities/capabilities/index.js +11 -0
  17. package/dist/src/capabilities/capabilities/index.js.map +1 -0
  18. package/dist/src/capabilities/capabilities/types.js +11 -0
  19. package/dist/src/capabilities/capabilities/types.js.map +1 -0
  20. package/dist/src/capabilities/colophon/collectColophon.js +83 -0
  21. package/dist/src/capabilities/colophon/collectColophon.js.map +1 -0
  22. package/dist/src/capabilities/colophon/colophon.render.js +59 -0
  23. package/dist/src/capabilities/colophon/colophon.render.js.map +1 -0
  24. package/dist/src/capabilities/colophon/colophon.verb.js +43 -0
  25. package/dist/src/capabilities/colophon/colophon.verb.js.map +1 -0
  26. package/dist/src/capabilities/colophon/index.js +5 -0
  27. package/dist/src/capabilities/colophon/index.js.map +1 -0
  28. package/dist/src/capabilities/colophon/markdownTerminal.js +90 -0
  29. package/dist/src/capabilities/colophon/markdownTerminal.js.map +1 -0
  30. package/dist/src/capabilities/colophon/types.js +10 -0
  31. package/dist/src/capabilities/colophon/types.js.map +1 -0
  32. package/dist/src/capabilities/config/collectConfigShow.js +59 -0
  33. package/dist/src/capabilities/config/collectConfigShow.js.map +1 -0
  34. package/dist/src/capabilities/config/field.render.js +22 -0
  35. package/dist/src/capabilities/config/field.render.js.map +1 -0
  36. package/dist/src/capabilities/config/fields.js +46 -0
  37. package/dist/src/capabilities/config/fields.js.map +1 -0
  38. package/dist/src/capabilities/config/get.verb.js +61 -0
  39. package/dist/src/capabilities/config/get.verb.js.map +1 -0
  40. package/dist/src/capabilities/config/index.js +5 -0
  41. package/dist/src/capabilities/config/index.js.map +1 -0
  42. package/dist/src/capabilities/config/runField.js +59 -0
  43. package/dist/src/capabilities/config/runField.js.map +1 -0
  44. package/dist/src/capabilities/config/runGet.js +28 -0
  45. package/dist/src/capabilities/config/runGet.js.map +1 -0
  46. package/dist/src/capabilities/config/runSet.js +53 -0
  47. package/dist/src/capabilities/config/runSet.js.map +1 -0
  48. package/dist/src/capabilities/config/set.verb.js +66 -0
  49. package/dist/src/capabilities/config/set.verb.js.map +1 -0
  50. package/dist/src/capabilities/config/show.render.js +84 -0
  51. package/dist/src/capabilities/config/show.render.js.map +1 -0
  52. package/dist/src/capabilities/config/show.verb.js +44 -0
  53. package/dist/src/capabilities/config/show.verb.js.map +1 -0
  54. package/dist/src/capabilities/config/types.js +5 -0
  55. package/dist/src/capabilities/config/types.js.map +1 -0
  56. package/dist/src/capabilities/config/unset.verb.js +49 -0
  57. package/dist/src/capabilities/config/unset.verb.js.map +1 -0
  58. package/dist/src/capabilities/create/cliProjection.js +195 -0
  59. package/dist/src/capabilities/create/cliProjection.js.map +1 -0
  60. package/dist/src/capabilities/create/constants.js +47 -0
  61. package/dist/src/capabilities/create/constants.js.map +1 -0
  62. package/dist/src/capabilities/create/create.render.js +100 -0
  63. package/dist/src/capabilities/create/create.render.js.map +1 -0
  64. package/dist/src/capabilities/create/create.verb.js +438 -0
  65. package/dist/src/capabilities/create/create.verb.js.map +1 -0
  66. package/dist/src/capabilities/create/createHelp.js +47 -0
  67. package/dist/src/capabilities/create/createHelp.js.map +1 -0
  68. package/dist/src/capabilities/create/createSurface.generated.js +394 -0
  69. package/dist/src/capabilities/create/createSurface.generated.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 +18 -0
  73. package/dist/src/capabilities/create/index.js.map +1 -0
  74. package/dist/src/capabilities/create/messages.js +16 -0
  75. package/dist/src/capabilities/create/messages.js.map +1 -0
  76. package/dist/src/capabilities/create/mount.js +293 -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 +53 -0
  81. package/dist/src/capabilities/create/pickGenerator.js.map +1 -0
  82. package/dist/src/capabilities/create/types.js +2 -0
  83. package/dist/src/capabilities/create/types.js.map +1 -0
  84. package/dist/src/capabilities/distribution.js +40 -0
  85. package/dist/src/capabilities/distribution.js.map +1 -0
  86. package/dist/src/capabilities/doctor/checks/checkKeStore.js +40 -0
  87. package/dist/src/capabilities/doctor/checks/checkKeStore.js.map +1 -0
  88. package/dist/src/capabilities/doctor/checks/checkNodeVersion.js +21 -0
  89. package/dist/src/capabilities/doctor/checks/checkNodeVersion.js.map +1 -0
  90. package/dist/src/capabilities/doctor/checks/checkPackageRefs.js +92 -0
  91. package/dist/src/capabilities/doctor/checks/checkPackageRefs.js.map +1 -0
  92. package/dist/src/capabilities/doctor/checks/checkPragmaVersion.js +19 -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/index.js +27 -0
  97. package/dist/src/capabilities/doctor/checks/index.js.map +1 -0
  98. package/dist/src/capabilities/doctor/checks/mcpCommand.js +57 -0
  99. package/dist/src/capabilities/doctor/checks/mcpCommand.js.map +1 -0
  100. package/dist/src/capabilities/doctor/checks/targetHealth.js +205 -0
  101. package/dist/src/capabilities/doctor/checks/targetHealth.js.map +1 -0
  102. package/dist/src/capabilities/doctor/doctor.render.js +185 -0
  103. package/dist/src/capabilities/doctor/doctor.render.js.map +1 -0
  104. package/dist/src/capabilities/doctor/doctor.verb.js +45 -0
  105. package/dist/src/capabilities/doctor/doctor.verb.js.map +1 -0
  106. package/dist/src/capabilities/doctor/index.js +5 -0
  107. package/dist/src/capabilities/doctor/index.js.map +1 -0
  108. package/dist/src/capabilities/doctor/runChecks.js +83 -0
  109. package/dist/src/capabilities/doctor/runChecks.js.map +1 -0
  110. package/dist/src/capabilities/doctor/types.js +5 -0
  111. package/dist/src/capabilities/doctor/types.js.map +1 -0
  112. package/dist/src/capabilities/graph/index.js +19 -0
  113. package/dist/src/capabilities/graph/index.js.map +1 -0
  114. package/dist/src/capabilities/graph/inspect.render.js +76 -0
  115. package/dist/src/capabilities/graph/inspect.render.js.map +1 -0
  116. package/dist/src/capabilities/graph/inspect.verb.js +53 -0
  117. package/dist/src/capabilities/graph/inspect.verb.js.map +1 -0
  118. package/dist/src/capabilities/graph/query.render.js +73 -0
  119. package/dist/src/capabilities/graph/query.render.js.map +1 -0
  120. package/dist/src/capabilities/graph/query.verb.js +49 -0
  121. package/dist/src/capabilities/graph/query.verb.js.map +1 -0
  122. package/dist/src/capabilities/graph/runQuery.js +41 -0
  123. package/dist/src/capabilities/graph/runQuery.js.map +1 -0
  124. package/dist/src/capabilities/index.js +56 -0
  125. package/dist/src/capabilities/index.js.map +1 -0
  126. package/dist/src/capabilities/info/collectInfo.js +66 -0
  127. package/dist/src/capabilities/info/collectInfo.js.map +1 -0
  128. package/dist/src/capabilities/info/index.js +5 -0
  129. package/dist/src/capabilities/info/index.js.map +1 -0
  130. package/dist/src/capabilities/info/info.render.js +53 -0
  131. package/dist/src/capabilities/info/info.render.js.map +1 -0
  132. package/dist/src/capabilities/info/info.verb.js +42 -0
  133. package/dist/src/capabilities/info/info.verb.js.map +1 -0
  134. package/dist/src/capabilities/info/types.js +5 -0
  135. package/dist/src/capabilities/info/types.js.map +1 -0
  136. package/dist/src/capabilities/meta/complete.verb.js +43 -0
  137. package/dist/src/capabilities/meta/complete.verb.js.map +1 -0
  138. package/dist/src/capabilities/meta/index.js +13 -0
  139. package/dist/src/capabilities/meta/index.js.map +1 -0
  140. package/dist/src/capabilities/meta/mcp.verb.js +34 -0
  141. package/dist/src/capabilities/meta/mcp.verb.js.map +1 -0
  142. package/dist/src/capabilities/ontology/index.js +21 -0
  143. package/dist/src/capabilities/ontology/index.js.map +1 -0
  144. package/dist/src/capabilities/ontology/queries.js +123 -0
  145. package/dist/src/capabilities/ontology/queries.js.map +1 -0
  146. package/dist/src/capabilities/ontology/render.js +66 -0
  147. package/dist/src/capabilities/ontology/render.js.map +1 -0
  148. package/dist/src/capabilities/ontology/verbs.js +181 -0
  149. package/dist/src/capabilities/ontology/verbs.js.map +1 -0
  150. package/dist/src/capabilities/prompt/index.js +16 -0
  151. package/dist/src/capabilities/prompt/index.js.map +1 -0
  152. package/dist/src/capabilities/prompt/prompt.render.js +78 -0
  153. package/dist/src/capabilities/prompt/prompt.render.js.map +1 -0
  154. package/dist/src/capabilities/prompt/types.js +10 -0
  155. package/dist/src/capabilities/prompt/types.js.map +1 -0
  156. package/dist/src/capabilities/prompt/verbs.js +93 -0
  157. package/dist/src/capabilities/prompt/verbs.js.map +1 -0
  158. package/dist/src/capabilities/resources/index.js +10 -0
  159. package/dist/src/capabilities/resources/index.js.map +1 -0
  160. package/dist/src/capabilities/resources/provider.js +423 -0
  161. package/dist/src/capabilities/resources/provider.js.map +1 -0
  162. package/dist/src/capabilities/setup/buildPlan.js +168 -0
  163. package/dist/src/capabilities/setup/buildPlan.js.map +1 -0
  164. package/dist/src/capabilities/setup/index.js +5 -0
  165. package/dist/src/capabilities/setup/index.js.map +1 -0
  166. package/dist/src/capabilities/setup/mode.js +53 -0
  167. package/dist/src/capabilities/setup/mode.js.map +1 -0
  168. package/dist/src/capabilities/setup/operations/index.js +39 -0
  169. package/dist/src/capabilities/setup/operations/index.js.map +1 -0
  170. package/dist/src/capabilities/setup/operations/setupCompletions.js +160 -0
  171. package/dist/src/capabilities/setup/operations/setupCompletions.js.map +1 -0
  172. package/dist/src/capabilities/setup/operations/setupConfig.js +101 -0
  173. package/dist/src/capabilities/setup/operations/setupConfig.js.map +1 -0
  174. package/dist/src/capabilities/setup/operations/setupGenerator.js +343 -0
  175. package/dist/src/capabilities/setup/operations/setupGenerator.js.map +1 -0
  176. package/dist/src/capabilities/setup/operations/setupLsp.js +277 -0
  177. package/dist/src/capabilities/setup/operations/setupLsp.js.map +1 -0
  178. package/dist/src/capabilities/setup/operations/setupMcp.js +207 -0
  179. package/dist/src/capabilities/setup/operations/setupMcp.js.map +1 -0
  180. package/dist/src/capabilities/setup/operations/setupSkills.js +316 -0
  181. package/dist/src/capabilities/setup/operations/setupSkills.js.map +1 -0
  182. package/dist/src/capabilities/setup/plan.js +128 -0
  183. package/dist/src/capabilities/setup/plan.js.map +1 -0
  184. package/dist/src/capabilities/setup/plan.render.js +193 -0
  185. package/dist/src/capabilities/setup/plan.render.js.map +1 -0
  186. package/dist/src/capabilities/setup/setup.render.js +54 -0
  187. package/dist/src/capabilities/setup/setup.render.js.map +1 -0
  188. package/dist/src/capabilities/setup/setup.verb.js +334 -0
  189. package/dist/src/capabilities/setup/setup.verb.js.map +1 -0
  190. package/dist/src/capabilities/setup/shell.js +196 -0
  191. package/dist/src/capabilities/setup/shell.js.map +1 -0
  192. package/dist/src/capabilities/setup/targets.js +263 -0
  193. package/dist/src/capabilities/setup/targets.js.map +1 -0
  194. package/dist/src/capabilities/setup/types.js +5 -0
  195. package/dist/src/capabilities/setup/types.js.map +1 -0
  196. package/dist/src/capabilities/shared/assertExecOk.js +137 -0
  197. package/dist/src/capabilities/shared/assertExecOk.js.map +1 -0
  198. package/dist/src/capabilities/shared/bands.js +16 -0
  199. package/dist/src/capabilities/shared/bands.js.map +1 -0
  200. package/dist/src/capabilities/shared/index.js +26 -0
  201. package/dist/src/capabilities/shared/index.js.map +1 -0
  202. package/dist/src/capabilities/shared/packageManager.js +103 -0
  203. package/dist/src/capabilities/shared/packageManager.js.map +1 -0
  204. package/dist/src/capabilities/shared/registry.js +55 -0
  205. package/dist/src/capabilities/shared/registry.js.map +1 -0
  206. package/dist/src/capabilities/skill/discover.js +195 -0
  207. package/dist/src/capabilities/skill/discover.js.map +1 -0
  208. package/dist/src/capabilities/skill/index.js +10 -0
  209. package/dist/src/capabilities/skill/index.js.map +1 -0
  210. package/dist/src/capabilities/skill/render.js +49 -0
  211. package/dist/src/capabilities/skill/render.js.map +1 -0
  212. package/dist/src/capabilities/skill/verbs.js +83 -0
  213. package/dist/src/capabilities/skill/verbs.js.map +1 -0
  214. package/dist/src/capabilities/sources/collectStatus.js +103 -0
  215. package/dist/src/capabilities/sources/collectStatus.js.map +1 -0
  216. package/dist/src/capabilities/sources/index.js +13 -0
  217. package/dist/src/capabilities/sources/index.js.map +1 -0
  218. package/dist/src/capabilities/sources/installSkills.js +167 -0
  219. package/dist/src/capabilities/sources/installSkills.js.map +1 -0
  220. package/dist/src/capabilities/sources/runUpdate.js +394 -0
  221. package/dist/src/capabilities/sources/runUpdate.js.map +1 -0
  222. package/dist/src/capabilities/sources/status.render.js +64 -0
  223. package/dist/src/capabilities/sources/status.render.js.map +1 -0
  224. package/dist/src/capabilities/sources/status.verb.js +40 -0
  225. package/dist/src/capabilities/sources/status.verb.js.map +1 -0
  226. package/dist/src/capabilities/sources/types.js +6 -0
  227. package/dist/src/capabilities/sources/types.js.map +1 -0
  228. package/dist/src/capabilities/sources/update.render.js +34 -0
  229. package/dist/src/capabilities/sources/update.render.js.map +1 -0
  230. package/dist/src/capabilities/sources/update.verb.js +55 -0
  231. package/dist/src/capabilities/sources/update.verb.js.map +1 -0
  232. package/dist/src/capabilities/upgrade/index.js +5 -0
  233. package/dist/src/capabilities/upgrade/index.js.map +1 -0
  234. package/dist/src/capabilities/upgrade/runUpgrade.js +99 -0
  235. package/dist/src/capabilities/upgrade/runUpgrade.js.map +1 -0
  236. package/dist/src/capabilities/upgrade/types.js +5 -0
  237. package/dist/src/capabilities/upgrade/types.js.map +1 -0
  238. package/dist/src/capabilities/upgrade/upgrade.render.js +44 -0
  239. package/dist/src/capabilities/upgrade/upgrade.render.js.map +1 -0
  240. package/dist/src/capabilities/upgrade/upgrade.verb.js +52 -0
  241. package/dist/src/capabilities/upgrade/upgrade.verb.js.map +1 -0
  242. package/dist/src/capabilities/version/index.js +10 -0
  243. package/dist/src/capabilities/version/index.js.map +1 -0
  244. package/dist/src/capabilities/version/version.verb.js +36 -0
  245. package/dist/src/capabilities/version/version.verb.js.map +1 -0
  246. package/dist/src/constants.js +82 -0
  247. package/dist/src/constants.js.map +1 -0
  248. package/dist/src/index.js +12 -0
  249. package/dist/src/index.js.map +1 -0
  250. package/dist/src/kernel/completion/complete.js +66 -0
  251. package/dist/src/kernel/completion/complete.js.map +1 -0
  252. package/dist/src/kernel/completion/emitScripts.js +92 -0
  253. package/dist/src/kernel/completion/emitScripts.js.map +1 -0
  254. package/dist/src/kernel/completion/entitySource.js +285 -0
  255. package/dist/src/kernel/completion/entitySource.js.map +1 -0
  256. package/dist/src/kernel/completion/index.js +14 -0
  257. package/dist/src/kernel/completion/index.js.map +1 -0
  258. package/dist/src/kernel/completion/model.js +301 -0
  259. package/dist/src/kernel/completion/model.js.map +1 -0
  260. package/dist/src/kernel/completion/parse.js +253 -0
  261. package/dist/src/kernel/completion/parse.js.map +1 -0
  262. package/dist/src/kernel/completion/rank.js +101 -0
  263. package/dist/src/kernel/completion/rank.js.map +1 -0
  264. package/dist/src/kernel/completion/resolve.js +100 -0
  265. package/dist/src/kernel/completion/resolve.js.map +1 -0
  266. package/dist/src/kernel/completion/templates/bash.js +209 -0
  267. package/dist/src/kernel/completion/templates/bash.js.map +1 -0
  268. package/dist/src/kernel/completion/templates/fish.js +214 -0
  269. package/dist/src/kernel/completion/templates/fish.js.map +1 -0
  270. package/dist/src/kernel/completion/templates/index.js +23 -0
  271. package/dist/src/kernel/completion/templates/index.js.map +1 -0
  272. package/dist/src/kernel/completion/templates/shared.js +98 -0
  273. package/dist/src/kernel/completion/templates/shared.js.map +1 -0
  274. package/dist/src/kernel/completion/templates/zsh.js +201 -0
  275. package/dist/src/kernel/completion/templates/zsh.js.map +1 -0
  276. package/dist/src/kernel/completion/types.js +13 -0
  277. package/dist/src/kernel/completion/types.js.map +1 -0
  278. package/dist/src/kernel/config/defaults.js +17 -0
  279. package/dist/src/kernel/config/defaults.js.map +1 -0
  280. package/dist/src/kernel/config/evaluateProjectConfig.js +126 -0
  281. package/dist/src/kernel/config/evaluateProjectConfig.js.map +1 -0
  282. package/dist/src/kernel/config/findProjectConfig.js +43 -0
  283. package/dist/src/kernel/config/findProjectConfig.js.map +1 -0
  284. package/dist/src/kernel/config/firstRun.js +34 -0
  285. package/dist/src/kernel/config/firstRun.js.map +1 -0
  286. package/dist/src/kernel/config/globalConfig.js +79 -0
  287. package/dist/src/kernel/config/globalConfig.js.map +1 -0
  288. package/dist/src/kernel/config/index.js +16 -0
  289. package/dist/src/kernel/config/index.js.map +1 -0
  290. package/dist/src/kernel/config/paths.js +35 -0
  291. package/dist/src/kernel/config/paths.js.map +1 -0
  292. package/dist/src/kernel/config/readConfig.js +78 -0
  293. package/dist/src/kernel/config/readConfig.js.map +1 -0
  294. package/dist/src/kernel/config/schema.js +130 -0
  295. package/dist/src/kernel/config/schema.js.map +1 -0
  296. package/dist/src/kernel/config/types.js +19 -0
  297. package/dist/src/kernel/config/types.js.map +1 -0
  298. package/dist/src/kernel/config/writeConfigField.js +59 -0
  299. package/dist/src/kernel/config/writeConfigField.js.map +1 -0
  300. package/dist/src/kernel/copy.js +43 -0
  301. package/dist/src/kernel/copy.js.map +1 -0
  302. package/dist/src/kernel/error/PragmaError.js +149 -0
  303. package/dist/src/kernel/error/PragmaError.js.map +1 -0
  304. package/dist/src/kernel/error/constants.js +40 -0
  305. package/dist/src/kernel/error/constants.js.map +1 -0
  306. package/dist/src/kernel/error/fromTaskError.js +96 -0
  307. package/dist/src/kernel/error/fromTaskError.js.map +1 -0
  308. package/dist/src/kernel/error/index.js +13 -0
  309. package/dist/src/kernel/error/index.js.map +1 -0
  310. package/dist/src/kernel/error/recovery.js +52 -0
  311. package/dist/src/kernel/error/recovery.js.map +1 -0
  312. package/dist/src/kernel/error/renderError.js +115 -0
  313. package/dist/src/kernel/error/renderError.js.map +1 -0
  314. package/dist/src/kernel/error/serialize.js +25 -0
  315. package/dist/src/kernel/error/serialize.js.map +1 -0
  316. package/dist/src/kernel/error/types.js +9 -0
  317. package/dist/src/kernel/error/types.js.map +1 -0
  318. package/dist/src/kernel/index.js +25 -0
  319. package/dist/src/kernel/index.js.map +1 -0
  320. package/dist/src/kernel/packs/collect.js +187 -0
  321. package/dist/src/kernel/packs/collect.js.map +1 -0
  322. package/dist/src/kernel/packs/compile.js +304 -0
  323. package/dist/src/kernel/packs/compile.js.map +1 -0
  324. package/dist/src/kernel/packs/disclosure.js +76 -0
  325. package/dist/src/kernel/packs/disclosure.js.map +1 -0
  326. package/dist/src/kernel/packs/glob.js +38 -0
  327. package/dist/src/kernel/packs/glob.js.map +1 -0
  328. package/dist/src/kernel/packs/graphql/buildLookupDocument.js +258 -0
  329. package/dist/src/kernel/packs/graphql/buildLookupDocument.js.map +1 -0
  330. package/dist/src/kernel/packs/graphql/fetchGraphqlLookup.js +157 -0
  331. package/dist/src/kernel/packs/graphql/fetchGraphqlLookup.js.map +1 -0
  332. package/dist/src/kernel/packs/graphql/index.js +20 -0
  333. package/dist/src/kernel/packs/graphql/index.js.map +1 -0
  334. package/dist/src/kernel/packs/graphql/nameMap.js +63 -0
  335. package/dist/src/kernel/packs/graphql/nameMap.js.map +1 -0
  336. package/dist/src/kernel/packs/index.js +34 -0
  337. package/dist/src/kernel/packs/index.js.map +1 -0
  338. package/dist/src/kernel/packs/iri.js +110 -0
  339. package/dist/src/kernel/packs/iri.js.map +1 -0
  340. package/dist/src/kernel/packs/renderPack.js +129 -0
  341. package/dist/src/kernel/packs/renderPack.js.map +1 -0
  342. package/dist/src/kernel/packs/resolveEntity.js +223 -0
  343. package/dist/src/kernel/packs/resolveEntity.js.map +1 -0
  344. package/dist/src/kernel/packs/runBodies.js +87 -0
  345. package/dist/src/kernel/packs/runBodies.js.map +1 -0
  346. package/dist/src/kernel/packs/sample.js +56 -0
  347. package/dist/src/kernel/packs/sample.js.map +1 -0
  348. package/dist/src/kernel/packs/schema.js +369 -0
  349. package/dist/src/kernel/packs/schema.js.map +1 -0
  350. package/dist/src/kernel/packs/sparql/applyFilters.js +68 -0
  351. package/dist/src/kernel/packs/sparql/applyFilters.js.map +1 -0
  352. package/dist/src/kernel/packs/sparql/applySearch.js +25 -0
  353. package/dist/src/kernel/packs/sparql/applySearch.js.map +1 -0
  354. package/dist/src/kernel/packs/sparql/buildLookupQuery.js +217 -0
  355. package/dist/src/kernel/packs/sparql/buildLookupQuery.js.map +1 -0
  356. package/dist/src/kernel/packs/sparql/escape.js +21 -0
  357. package/dist/src/kernel/packs/sparql/escape.js.map +1 -0
  358. package/dist/src/kernel/packs/sparql/index.js +31 -0
  359. package/dist/src/kernel/packs/sparql/index.js.map +1 -0
  360. package/dist/src/kernel/packs/sparql/runSelect.js +101 -0
  361. package/dist/src/kernel/packs/sparql/runSelect.js.map +1 -0
  362. package/dist/src/kernel/packs/types.js +30 -0
  363. package/dist/src/kernel/packs/types.js.map +1 -0
  364. package/dist/src/kernel/packs/uniqueness.js +30 -0
  365. package/dist/src/kernel/packs/uniqueness.js.map +1 -0
  366. package/dist/src/kernel/project/cli/buildProgram.js +263 -0
  367. package/dist/src/kernel/project/cli/buildProgram.js.map +1 -0
  368. package/dist/src/kernel/project/cli/constants.js +27 -0
  369. package/dist/src/kernel/project/cli/constants.js.map +1 -0
  370. package/dist/src/kernel/project/cli/dispatch.js +420 -0
  371. package/dist/src/kernel/project/cli/dispatch.js.map +1 -0
  372. package/dist/src/kernel/project/cli/exitCodes.js +66 -0
  373. package/dist/src/kernel/project/cli/exitCodes.js.map +1 -0
  374. package/dist/src/kernel/project/cli/globalFlags.js +216 -0
  375. package/dist/src/kernel/project/cli/globalFlags.js.map +1 -0
  376. package/dist/src/kernel/project/cli/helpFormat.js +59 -0
  377. package/dist/src/kernel/project/cli/helpFormat.js.map +1 -0
  378. package/dist/src/kernel/project/cli/index.js +14 -0
  379. package/dist/src/kernel/project/cli/index.js.map +1 -0
  380. package/dist/src/kernel/project/cli/rootHelp.js +197 -0
  381. package/dist/src/kernel/project/cli/rootHelp.js.map +1 -0
  382. package/dist/src/kernel/project/cli/suggest.js +75 -0
  383. package/dist/src/kernel/project/cli/suggest.js.map +1 -0
  384. package/dist/src/kernel/project/cli/suggestNames.js +96 -0
  385. package/dist/src/kernel/project/cli/suggestNames.js.map +1 -0
  386. package/dist/src/kernel/project/cli/verbHelp.js +131 -0
  387. package/dist/src/kernel/project/cli/verbHelp.js.map +1 -0
  388. package/dist/src/kernel/project/mcp/buildServer.js +67 -0
  389. package/dist/src/kernel/project/mcp/buildServer.js.map +1 -0
  390. package/dist/src/kernel/project/mcp/envelope.js +37 -0
  391. package/dist/src/kernel/project/mcp/envelope.js.map +1 -0
  392. package/dist/src/kernel/project/mcp/index.js +8 -0
  393. package/dist/src/kernel/project/mcp/index.js.map +1 -0
  394. package/dist/src/kernel/project/mcp/instructions.js +44 -0
  395. package/dist/src/kernel/project/mcp/instructions.js.map +1 -0
  396. package/dist/src/kernel/project/mcp/mcpError.js +42 -0
  397. package/dist/src/kernel/project/mcp/mcpError.js.map +1 -0
  398. package/dist/src/kernel/project/mcp/prompts/index.js +36 -0
  399. package/dist/src/kernel/project/mcp/prompts/index.js.map +1 -0
  400. package/dist/src/kernel/project/mcp/prompts/provider.js +98 -0
  401. package/dist/src/kernel/project/mcp/prompts/provider.js.map +1 -0
  402. package/dist/src/kernel/project/mcp/prompts/source.js +154 -0
  403. package/dist/src/kernel/project/mcp/prompts/source.js.map +1 -0
  404. package/dist/src/kernel/project/mcp/registerVerb.js +300 -0
  405. package/dist/src/kernel/project/mcp/registerVerb.js.map +1 -0
  406. package/dist/src/kernel/project/mcp/serve.js +35 -0
  407. package/dist/src/kernel/project/mcp/serve.js.map +1 -0
  408. package/dist/src/kernel/render/compactUri.js +24 -0
  409. package/dist/src/kernel/render/compactUri.js.map +1 -0
  410. package/dist/src/kernel/render/contracts.js +10 -0
  411. package/dist/src/kernel/render/contracts.js.map +1 -0
  412. package/dist/src/kernel/render/disclosure.js +34 -0
  413. package/dist/src/kernel/render/disclosure.js.map +1 -0
  414. package/dist/src/kernel/render/envelope.js +30 -0
  415. package/dist/src/kernel/render/envelope.js.map +1 -0
  416. package/dist/src/kernel/render/formatters.js +27 -0
  417. package/dist/src/kernel/render/formatters.js.map +1 -0
  418. package/dist/src/kernel/render/index.js +15 -0
  419. package/dist/src/kernel/render/index.js.map +1 -0
  420. package/dist/src/kernel/render/prefixes.js +46 -0
  421. package/dist/src/kernel/render/prefixes.js.map +1 -0
  422. package/dist/src/kernel/render/renderers.js +468 -0
  423. package/dist/src/kernel/render/renderers.js.map +1 -0
  424. package/dist/src/kernel/render/style.js +85 -0
  425. package/dist/src/kernel/render/style.js.map +1 -0
  426. package/dist/src/kernel/render/turtle.js +194 -0
  427. package/dist/src/kernel/render/turtle.js.map +1 -0
  428. package/dist/src/kernel/render/writeStdout.js +43 -0
  429. package/dist/src/kernel/render/writeStdout.js.map +1 -0
  430. package/dist/src/kernel/runtime/boot.js +49 -0
  431. package/dist/src/kernel/runtime/boot.js.map +1 -0
  432. package/dist/src/kernel/runtime/facade.js +39 -0
  433. package/dist/src/kernel/runtime/facade.js.map +1 -0
  434. package/dist/src/kernel/runtime/graphpack/build.js +122 -0
  435. package/dist/src/kernel/runtime/graphpack/build.js.map +1 -0
  436. package/dist/src/kernel/runtime/graphpack/buildIndex.js +303 -0
  437. package/dist/src/kernel/runtime/graphpack/buildIndex.js.map +1 -0
  438. package/dist/src/kernel/runtime/graphpack/embedded/pack.generated.js +6 -0
  439. package/dist/src/kernel/runtime/graphpack/embedded/pack.generated.js.map +1 -0
  440. package/dist/src/kernel/runtime/graphpack/embedded/pack.index.generated.js +4 -0
  441. package/dist/src/kernel/runtime/graphpack/embedded/pack.index.generated.js.map +1 -0
  442. package/dist/src/kernel/runtime/graphpack/embedded/pack.stories.generated.js +4 -0
  443. package/dist/src/kernel/runtime/graphpack/embedded/pack.stories.generated.js.map +1 -0
  444. package/dist/src/kernel/runtime/graphpack/embedded.js +82 -0
  445. package/dist/src/kernel/runtime/graphpack/embedded.js.map +1 -0
  446. package/dist/src/kernel/runtime/graphpack/hash.js +38 -0
  447. package/dist/src/kernel/runtime/graphpack/hash.js.map +1 -0
  448. package/dist/src/kernel/runtime/graphpack/index.js +11 -0
  449. package/dist/src/kernel/runtime/graphpack/index.js.map +1 -0
  450. package/dist/src/kernel/runtime/graphpack/manifest.js +145 -0
  451. package/dist/src/kernel/runtime/graphpack/manifest.js.map +1 -0
  452. package/dist/src/kernel/runtime/graphpack/read.js +92 -0
  453. package/dist/src/kernel/runtime/graphpack/read.js.map +1 -0
  454. package/dist/src/kernel/runtime/graphpack/schemas.js +70 -0
  455. package/dist/src/kernel/runtime/graphpack/schemas.js.map +1 -0
  456. package/dist/src/kernel/runtime/graphpack/stories.js +68 -0
  457. package/dist/src/kernel/runtime/graphpack/stories.js.map +1 -0
  458. package/dist/src/kernel/runtime/graphpack/types.js +55 -0
  459. package/dist/src/kernel/runtime/graphpack/types.js.map +1 -0
  460. package/dist/src/kernel/runtime/index.js +8 -0
  461. package/dist/src/kernel/runtime/index.js.map +1 -0
  462. package/dist/src/kernel/runtime/loadSession.js +34 -0
  463. package/dist/src/kernel/runtime/loadSession.js.map +1 -0
  464. package/dist/src/kernel/runtime/paths.js +78 -0
  465. package/dist/src/kernel/runtime/paths.js.map +1 -0
  466. package/dist/src/kernel/runtime/probe.js +37 -0
  467. package/dist/src/kernel/runtime/probe.js.map +1 -0
  468. package/dist/src/kernel/runtime/readEntity.js +363 -0
  469. package/dist/src/kernel/runtime/readEntity.js.map +1 -0
  470. package/dist/src/kernel/runtime/refs/gitOps.js +65 -0
  471. package/dist/src/kernel/runtime/refs/gitOps.js.map +1 -0
  472. package/dist/src/kernel/runtime/refs/index.js +29 -0
  473. package/dist/src/kernel/runtime/refs/index.js.map +1 -0
  474. package/dist/src/kernel/runtime/refs/parseRef.js +70 -0
  475. package/dist/src/kernel/runtime/refs/parseRef.js.map +1 -0
  476. package/dist/src/kernel/runtime/refs/resolve.js +332 -0
  477. package/dist/src/kernel/runtime/refs/resolve.js.map +1 -0
  478. package/dist/src/kernel/runtime/resolveSources.js +62 -0
  479. package/dist/src/kernel/runtime/resolveSources.js.map +1 -0
  480. package/dist/src/kernel/runtime/store.js +75 -0
  481. package/dist/src/kernel/runtime/store.js.map +1 -0
  482. package/dist/src/kernel/runtime/storeReadiness.js +51 -0
  483. package/dist/src/kernel/runtime/storeReadiness.js.map +1 -0
  484. package/dist/src/kernel/runtime/types.js +11 -0
  485. package/dist/src/kernel/runtime/types.js.map +1 -0
  486. package/dist/src/kernel/spec/asVerb.js +21 -0
  487. package/dist/src/kernel/spec/asVerb.js.map +1 -0
  488. package/dist/src/kernel/spec/emitReference.js +578 -0
  489. package/dist/src/kernel/spec/emitReference.js.map +1 -0
  490. package/dist/src/kernel/spec/emitSurface.js +202 -0
  491. package/dist/src/kernel/spec/emitSurface.js.map +1 -0
  492. package/dist/src/kernel/spec/index.js +11 -0
  493. package/dist/src/kernel/spec/index.js.map +1 -0
  494. package/dist/src/kernel/spec/surfaceConformance.js +103 -0
  495. package/dist/src/kernel/spec/surfaceConformance.js.map +1 -0
  496. package/dist/src/kernel/spec/types.js +14 -0
  497. package/dist/src/kernel/spec/types.js.map +1 -0
  498. package/dist/src/kernel/spec/validate.js +110 -0
  499. package/dist/src/kernel/spec/validate.js.map +1 -0
  500. package/dist/src/kernel/vocabulary.js +97 -0
  501. package/dist/src/kernel/vocabulary.js.map +1 -0
  502. package/dist/src/types.js +11 -0
  503. package/dist/src/types.js.map +1 -0
  504. package/package.json +20 -22
  505. package/pragma.conf.ts +249 -60
  506. package/src/bin.ts +267 -82
  507. package/src/capabilities/block.parity.test.ts +6 -3
  508. package/src/capabilities/capabilities/capabilities.render.ts +1 -1
  509. package/src/capabilities/capabilities/capabilities.verb.ts +1 -1
  510. package/src/capabilities/capabilities/catalog.ts +3 -3
  511. package/src/capabilities/capabilities/hints.ts +32 -7
  512. package/src/capabilities/capabilities/index.ts +1 -1
  513. package/src/capabilities/colophon/collectColophon.ts +35 -24
  514. package/src/capabilities/colophon/colophon.render.ts +25 -1
  515. package/src/capabilities/colophon/colophon.test.ts +42 -21
  516. package/src/capabilities/colophon/colophon.verb.ts +4 -4
  517. package/src/capabilities/config/collectConfigShow.test.ts +1 -0
  518. package/src/capabilities/config/collectConfigShow.ts +3 -3
  519. package/src/capabilities/config/field.render.ts +4 -5
  520. package/src/capabilities/config/fields.ts +17 -10
  521. package/src/capabilities/config/get.verb.ts +70 -0
  522. package/src/capabilities/config/getUnset.test.ts +264 -0
  523. package/src/capabilities/config/index.ts +5 -1
  524. package/src/capabilities/config/runField.ts +40 -22
  525. package/src/capabilities/config/runGet.ts +34 -0
  526. package/src/capabilities/config/runSet.ts +35 -9
  527. package/src/capabilities/config/set.test.ts +48 -14
  528. package/src/capabilities/config/set.verb.ts +8 -7
  529. package/src/capabilities/config/show.render.ts +1 -1
  530. package/src/capabilities/config/show.verb.ts +9 -6
  531. package/src/capabilities/config/types.ts +18 -4
  532. package/src/capabilities/config/unset.verb.ts +58 -0
  533. package/src/capabilities/create/byteEquality.subprocess.test.ts +2 -3
  534. package/src/capabilities/create/byteEquality.test.ts +25 -11
  535. package/src/capabilities/create/cliProjection.ts +227 -0
  536. package/src/capabilities/create/constants.ts +36 -61
  537. package/src/capabilities/create/create.mcp.test.ts +89 -5
  538. package/src/capabilities/create/create.render.ts +71 -7
  539. package/src/capabilities/create/create.test.ts +433 -219
  540. package/src/capabilities/create/create.verb.ts +297 -328
  541. package/src/capabilities/create/createGrammar.test.ts +865 -0
  542. package/src/capabilities/create/createHelp.ts +71 -0
  543. package/src/capabilities/create/createSurface.generated.ts +400 -0
  544. package/src/capabilities/create/crossCli.subprocess.test.ts +745 -0
  545. package/src/capabilities/create/cwdJail.test.ts +24 -5
  546. package/src/capabilities/create/generatorToVerbSpec.test.ts +186 -0
  547. package/src/capabilities/create/generatorToVerbSpec.ts +13 -11
  548. package/src/capabilities/create/index.ts +7 -4
  549. package/src/capabilities/create/messages.ts +18 -0
  550. package/src/capabilities/create/mount.ts +391 -0
  551. package/src/capabilities/create/pathJail.test.ts +90 -0
  552. package/src/capabilities/create/pathJail.ts +8 -5
  553. package/src/capabilities/create/pickGenerator.ts +23 -35
  554. package/src/capabilities/create/shippedCreate.subprocess.test.ts +164 -0
  555. package/src/capabilities/create/types.ts +20 -0
  556. package/src/capabilities/distribution.test.ts +3 -1
  557. package/src/capabilities/distribution.ts +10 -15
  558. package/src/capabilities/doctor/checks/checkKeStore.ts +7 -5
  559. package/src/capabilities/doctor/checks/checkPackageRefs.ts +6 -4
  560. package/src/capabilities/doctor/checks/checkPragmaVersion.ts +2 -2
  561. package/src/capabilities/doctor/checks/checkShellCompletions.test.ts +72 -27
  562. package/src/capabilities/doctor/checks/checkShellCompletions.ts +59 -13
  563. package/src/capabilities/doctor/checks/index.ts +27 -0
  564. package/src/capabilities/doctor/checks/mcpCommand.test.ts +100 -0
  565. package/src/capabilities/doctor/checks/mcpCommand.ts +69 -0
  566. package/src/capabilities/doctor/checks/targetHealth.ts +274 -0
  567. package/src/capabilities/doctor/doctor.render.test.ts +18 -7
  568. package/src/capabilities/doctor/doctor.render.ts +43 -19
  569. package/src/capabilities/doctor/doctor.test.ts +123 -34
  570. package/src/capabilities/doctor/doctor.verb.ts +3 -3
  571. package/src/capabilities/doctor/runChecks.ts +62 -63
  572. package/src/capabilities/doctor/types.ts +20 -4
  573. package/src/capabilities/emptyRecovery.test.ts +13 -8
  574. package/src/capabilities/graph/examples.exec.test.ts +107 -0
  575. package/src/capabilities/graph/index.ts +1 -1
  576. package/src/capabilities/graph/inspect.render.ts +70 -22
  577. package/src/capabilities/graph/inspect.test.ts +260 -5
  578. package/src/capabilities/graph/inspect.verb.ts +18 -6
  579. package/src/capabilities/graph/query.render.ts +15 -3
  580. package/src/capabilities/graph/query.verb.ts +3 -3
  581. package/src/capabilities/graph/runQuery.ts +2 -3
  582. package/src/capabilities/index.ts +3 -1
  583. package/src/capabilities/info/collectInfo.ts +5 -4
  584. package/src/capabilities/info/info.render.ts +1 -1
  585. package/src/capabilities/info/info.verb.ts +1 -1
  586. package/src/capabilities/lazy.test.ts +32 -0
  587. package/src/capabilities/meta/complete.verb.ts +1 -1
  588. package/src/capabilities/meta/index.ts +1 -1
  589. package/src/capabilities/meta/mcp.verb.ts +10 -8
  590. package/src/capabilities/ontology/index.ts +15 -11
  591. package/src/capabilities/ontology/ontology.test.ts +6 -55
  592. package/src/capabilities/ontology/queries.ts +2 -2
  593. package/src/capabilities/ontology/render.ts +3 -4
  594. package/src/capabilities/ontology/verbs.ts +27 -68
  595. package/src/capabilities/prompt/index.ts +2 -2
  596. package/src/capabilities/prompt/prompt.render.ts +6 -2
  597. package/src/capabilities/prompt/types.ts +1 -1
  598. package/src/capabilities/prompt/verbs.ts +4 -5
  599. package/src/capabilities/reference.test.ts +63 -0
  600. package/src/capabilities/resources/provider.ts +342 -85
  601. package/src/capabilities/resources/resources.test.ts +355 -59
  602. package/src/capabilities/setup/buildPlan.ts +236 -0
  603. package/src/capabilities/setup/index.ts +7 -7
  604. package/src/capabilities/setup/mode.ts +74 -0
  605. package/src/capabilities/setup/operations/index.ts +74 -0
  606. package/src/capabilities/setup/operations/setupCompletions.ts +97 -24
  607. package/src/capabilities/setup/operations/setupConfig.ts +124 -0
  608. package/src/capabilities/setup/operations/setupGenerator.ts +396 -326
  609. package/src/capabilities/setup/operations/setupLsp.ts +329 -68
  610. package/src/capabilities/setup/operations/setupMcp.ts +137 -97
  611. package/src/capabilities/setup/operations/setupSkills.ts +336 -108
  612. package/src/capabilities/setup/plan.render.ts +241 -0
  613. package/src/capabilities/setup/plan.ts +236 -0
  614. package/src/capabilities/setup/setup.mcp.correctness.test.ts +432 -0
  615. package/src/capabilities/setup/setup.render.test.ts +281 -73
  616. package/src/capabilities/setup/setup.render.ts +45 -77
  617. package/src/capabilities/setup/setup.test.ts +972 -209
  618. package/src/capabilities/setup/setup.verb.ts +223 -71
  619. package/src/capabilities/setup/shell.test.ts +86 -0
  620. package/src/capabilities/setup/shell.ts +137 -11
  621. package/src/capabilities/setup/targets.ts +367 -0
  622. package/src/capabilities/setup/types.ts +18 -57
  623. package/src/capabilities/shared/assertExecOk.ts +68 -10
  624. package/src/capabilities/shared/index.ts +32 -0
  625. package/src/capabilities/shared/packageManager.test.ts +55 -0
  626. package/src/capabilities/shared/packageManager.ts +62 -6
  627. package/src/capabilities/skill/discover.ts +37 -5
  628. package/src/capabilities/skill/index.ts +1 -1
  629. package/src/capabilities/skill/render.ts +10 -9
  630. package/src/capabilities/skill/skill.test.ts +7 -5
  631. package/src/capabilities/skill/verbs.ts +3 -4
  632. package/src/capabilities/sources/collectStatus.ts +7 -2
  633. package/src/capabilities/sources/index.ts +1 -1
  634. package/src/capabilities/sources/installSkills.ts +84 -7
  635. package/src/capabilities/sources/runUpdate.ts +53 -21
  636. package/src/capabilities/sources/sources.test.ts +154 -2
  637. package/src/capabilities/sources/status.render.ts +1 -1
  638. package/src/capabilities/sources/status.verb.ts +1 -1
  639. package/src/capabilities/sources/update.render.ts +1 -1
  640. package/src/capabilities/sources/update.verb.ts +1 -1
  641. package/src/capabilities/surface.test.ts +134 -17
  642. package/src/capabilities/upgrade/runUpgrade.ts +8 -8
  643. package/src/capabilities/upgrade/upgrade.render.ts +4 -5
  644. package/src/capabilities/upgrade/upgrade.test.ts +3 -3
  645. package/src/capabilities/upgrade/upgrade.verb.ts +1 -1
  646. package/src/capabilities/version/index.ts +12 -0
  647. package/src/capabilities/version/version.test.ts +66 -0
  648. package/src/capabilities/version/version.verb.ts +39 -0
  649. package/src/constants.ts +31 -1
  650. package/src/identity.test.ts +40 -25
  651. package/src/kernel/completion/__snapshots__/emitScripts.test.ts.snap +15 -13
  652. package/src/kernel/completion/complete.test.ts +12 -2
  653. package/src/kernel/completion/complete.ts +1 -1
  654. package/src/kernel/completion/emitScripts.ts +1 -1
  655. package/src/kernel/completion/entitySource.test.ts +1 -1
  656. package/src/kernel/completion/entitySource.ts +21 -8
  657. package/src/kernel/completion/model.test.ts +164 -12
  658. package/src/kernel/completion/model.ts +94 -14
  659. package/src/kernel/completion/parse.test.ts +4 -7
  660. package/src/kernel/completion/parse.ts +15 -0
  661. package/src/kernel/completion/resolve.test.ts +0 -1
  662. package/src/kernel/completion/safety.test.ts +34 -26
  663. package/src/kernel/completion/shellDrive.test.ts +28 -9
  664. package/src/kernel/completion/templates/bash.ts +7 -2
  665. package/src/kernel/completion/templates/index.ts +23 -0
  666. package/src/kernel/completion/types.ts +7 -0
  667. package/src/kernel/config/defaults.test.ts +25 -2
  668. package/src/kernel/config/defaults.ts +4 -3
  669. package/src/kernel/config/evaluateProjectConfig.ts +31 -8
  670. package/src/kernel/config/firstRun.test.ts +44 -38
  671. package/src/kernel/config/firstRun.ts +24 -88
  672. package/src/kernel/config/index.ts +1 -1
  673. package/src/kernel/config/readConfig.test.ts +6 -3
  674. package/src/kernel/config/readConfig.ts +1 -1
  675. package/src/kernel/config/schema.ts +3 -1
  676. package/src/kernel/config/types.ts +3 -1
  677. package/src/kernel/copy.test.ts +34 -4
  678. package/src/kernel/copy.ts +54 -0
  679. package/src/kernel/error/PragmaError.test.ts +5 -2
  680. package/src/kernel/error/PragmaError.ts +4 -2
  681. package/src/kernel/error/constants.ts +7 -5
  682. package/src/kernel/error/fromTaskError.ts +28 -6
  683. package/src/kernel/error/recovery.ts +14 -0
  684. package/src/kernel/error/renderError.ts +42 -1
  685. package/src/kernel/error/types.ts +21 -1
  686. package/src/kernel/index.ts +26 -0
  687. package/src/kernel/packs/collect.ts +12 -16
  688. package/src/kernel/packs/compile.test.ts +130 -1
  689. package/src/kernel/packs/compile.ts +93 -3
  690. package/src/kernel/packs/disclosure.ts +2 -2
  691. package/src/kernel/packs/graphql/buildLookupDocument.ts +1 -1
  692. package/src/kernel/packs/graphql/fetchGraphqlLookup.ts +3 -4
  693. package/src/kernel/packs/graphql/index.ts +20 -0
  694. package/src/kernel/packs/index.ts +40 -0
  695. package/src/kernel/packs/iri.test.ts +73 -0
  696. package/src/kernel/packs/iri.ts +66 -14
  697. package/src/kernel/packs/renderPack.ts +24 -5
  698. package/src/kernel/packs/resolveEntity.test.ts +213 -0
  699. package/src/kernel/packs/resolveEntity.ts +112 -18
  700. package/src/kernel/packs/runBodies.ts +2 -3
  701. package/src/kernel/packs/sample.ts +1 -1
  702. package/src/kernel/packs/schema.ts +18 -1
  703. package/src/kernel/packs/sparql/applyFilters.ts +16 -17
  704. package/src/kernel/packs/sparql/buildLookupQuery.ts +75 -3
  705. package/src/kernel/packs/sparql/index.ts +37 -0
  706. package/src/kernel/packs/sparql/runSelect.test.ts +1 -1
  707. package/src/kernel/packs/sparql/runSelect.ts +3 -4
  708. package/src/kernel/packs/toolDescription.test.ts +42 -3
  709. package/src/kernel/packs/types.ts +13 -0
  710. package/src/kernel/packs/uniqueness.ts +1 -1
  711. package/src/kernel/project/cli/buildProgram.test.ts +147 -12
  712. package/src/kernel/project/cli/buildProgram.ts +77 -18
  713. package/src/kernel/project/cli/constants.ts +34 -0
  714. package/src/kernel/project/cli/dispatch.test.ts +160 -3
  715. package/src/kernel/project/cli/dispatch.ts +222 -42
  716. package/src/kernel/project/cli/exitCodes.ts +1 -1
  717. package/src/kernel/project/cli/globalFlags.test.ts +117 -1
  718. package/src/kernel/project/cli/globalFlags.ts +130 -30
  719. package/src/kernel/project/cli/helpFormat.ts +13 -0
  720. package/src/kernel/project/cli/rootHelp.ts +41 -12
  721. package/src/kernel/project/cli/suggest.test.ts +33 -1
  722. package/src/kernel/project/cli/suggest.ts +25 -1
  723. package/src/kernel/project/cli/verbHelp.test.ts +30 -0
  724. package/src/kernel/project/cli/verbHelp.ts +23 -7
  725. package/src/kernel/project/mcp/buildServer.ts +7 -4
  726. package/src/kernel/project/mcp/envelope.ts +2 -2
  727. package/src/kernel/project/mcp/instructions.ts +2 -2
  728. package/src/kernel/project/mcp/mcpError.ts +1 -1
  729. package/src/kernel/project/mcp/parity.test.ts +5 -2
  730. package/src/kernel/project/mcp/prompts/index.ts +37 -0
  731. package/src/kernel/project/mcp/prompts/source.ts +2 -2
  732. package/src/kernel/project/mcp/registerVerb.ts +35 -9
  733. package/src/kernel/project/mcp/serve.ts +2 -2
  734. package/src/kernel/render/__snapshots__/renderers.test.ts.snap +7 -4
  735. package/src/kernel/render/contracts.ts +21 -0
  736. package/src/kernel/render/envelope.ts +2 -3
  737. package/src/kernel/render/formatters.ts +1 -1
  738. package/src/kernel/render/renderers.test.ts +243 -6
  739. package/src/kernel/render/renderers.ts +222 -20
  740. package/src/kernel/render/style.test.ts +75 -24
  741. package/src/kernel/render/style.ts +31 -1
  742. package/src/kernel/render/turtle.ts +222 -0
  743. package/src/kernel/runtime/graphpack/buildIndex.ts +1 -1
  744. package/src/kernel/runtime/graphpack/embedded/pack.generated.ts +3 -3
  745. package/src/kernel/runtime/graphpack/embedded/pack.index.generated.ts +1 -1
  746. package/src/kernel/runtime/graphpack/embedded.ts +3 -3
  747. package/src/kernel/runtime/graphpack/manifest.ts +1 -1
  748. package/src/kernel/runtime/graphpack/read.ts +1 -2
  749. package/src/kernel/runtime/loadSession.ts +1 -1
  750. package/src/kernel/runtime/probe.ts +6 -6
  751. package/src/kernel/runtime/readEntity.ts +472 -28
  752. package/src/kernel/runtime/refs/index.ts +39 -0
  753. package/src/kernel/runtime/refs/parseRef.ts +2 -2
  754. package/src/kernel/runtime/refs/resolve.ts +4 -4
  755. package/src/kernel/runtime/storeReadiness.ts +1 -2
  756. package/src/kernel/runtime/types.ts +15 -1
  757. package/src/kernel/runtime/wasmEmbed.test.ts +37 -39
  758. package/src/kernel/spec/emitReference.ts +105 -30
  759. package/src/kernel/spec/emitSurface.ts +48 -6
  760. package/src/kernel/spec/surfaceConformance.test.ts +4 -2
  761. package/src/kernel/spec/types.ts +248 -4
  762. package/src/testing/behavioral/docExamples.test.ts +14 -0
  763. package/src/testing/behavioral/errorMatrix.mcp.test.ts +2 -2
  764. package/src/testing/behavioral/firstRun.e2e.test.ts +24 -24
  765. package/src/testing/behavioral/journeys.cli.test.ts +1 -1
  766. package/src/testing/behavioral/journeys.defaultPack.test.ts +7 -7
  767. package/src/testing/behavioral/journeys.implementation.test.ts +206 -0
  768. package/src/testing/behavioral/journeys.interactiveTty.e2e.test.ts +2 -2
  769. package/src/testing/behavioral/journeys.packageStories.test.ts +4 -4
  770. package/src/testing/behavioral/mcpServe.e2e.test.ts +57 -2
  771. package/src/testing/behavioral/mcpSurface.test.ts +1 -1
  772. package/src/testing/behavioral/rootCli.e2e.test.ts +26 -2
  773. package/src/testing/eval/cases/effectful.ts +3 -2
  774. package/src/testing/fixtures/blockGraph.ts +79 -0
  775. package/src/testing/fixtures/graph/canonical.ts +88 -2
  776. package/src/testing/fixtures/graph/defaultPack.ts +1 -1
  777. package/src/testing/helpers/blankCanonicalRanges.ts +36 -0
  778. package/src/testing/helpers/projectMcp.ts +32 -6
  779. package/src/testing/helpers/runCli.ts +35 -18
  780. package/src/testing/perf/budgets.test.ts +20 -9
  781. package/src/testing/perf/budgets.ts +58 -9
  782. package/src/testing/perf/codegen.test.ts +126 -0
  783. package/src/testing/perf/globalSetup.test.ts +286 -0
  784. package/src/testing/perf/globalSetup.ts +505 -23
  785. package/src/testing/perf/measure.test.ts +38 -0
  786. package/src/testing/perf/measure.ts +23 -4
  787. package/src/testing/setupXdgIsolation.ts +81 -21
  788. package/src/testing/tempRoot.globalSetup.ts +122 -0
  789. package/dist/pragma +0 -0
  790. package/src/capabilities/create/compiledCreate.subprocess.test.ts +0 -189
  791. package/src/capabilities/create/templates.embedded.generated.ts +0 -28
  792. package/src/capabilities/doctor/checks/checkConfigFile.ts +0 -42
  793. package/src/capabilities/doctor/checks/checkMcpCommands.ts +0 -114
  794. package/src/capabilities/doctor/checks/checkMcpConfigured.ts +0 -68
  795. package/src/capabilities/doctor/checks/checkSkillsSymlinked.ts +0 -61
  796. package/src/capabilities/doctor/checks/deriveBand.test.ts +0 -42
  797. package/src/capabilities/doctor/checks/deriveBand.ts +0 -28
  798. package/src/kernel/config/__snapshots__/firstRun.test.ts.snap +0 -11
@@ -0,0 +1,343 @@
1
+ /**
2
+ * Synthesize a setup invocation as a summon `GeneratorDefinition` driven by the
3
+ * TARGET TABLE, so the run-all and every sub-verb flow through the same
4
+ * `execute` seam `create` uses — inheriting the Ink wizard, the recap/confirm
5
+ * gate, live progress, colours, and the shared cancel fixes by construction.
6
+ *
7
+ * The shape mirrors `create`: detection runs FOR REAL up front (once per
8
+ * target/band, in `detectTargets`), then a PURE `generate` composes only the
9
+ * effects for the SELECTED rows. `generate` must stay re-interpretable —
10
+ * `execute` invokes it more than once (the confirm-gate preview and the build) —
11
+ * so it is composed from combinators and does no reads of its own.
12
+ *
13
+ * The wizard is the PLAN'S EDITOR, not a parallel path: its choices are the plan
14
+ * rows, and what it edits is each row's `selected` flag. There is exactly one
15
+ * list of things this command can do, and the preview, the wizard, the progress
16
+ * lines and the recap are four views of it.
17
+ *
18
+ * This module carries NO static import of `@canonical/summon-core` VALUES or of
19
+ * React/Ink — it only `import type`s the generator shape and builds plain object
20
+ * literals over `@canonical/task`. It is itself reached only through the verb's
21
+ * lazy dynamic import, so the fast paths stay free of it.
22
+ */
23
+ import { flatMap, pure, recover, sequence_, warn, } from "@canonical/task";
24
+ import { BIN_NAME } from "../../../constants.js";
25
+ import { PragmaError } from "../../../kernel/error/index.js";
26
+ import { buildPlan, detectionFailure, detectTargets, draftFor, resolveRoots, } from "../buildPlan.js";
27
+ import { isActionable, TARGET_IDS, withRows, } from "../plan.js";
28
+ /** The answer key the run-all's row multiselect writes. */
29
+ const ROWS_ANSWER = "targets";
30
+ /** The answer key the opt-in per-file MCP narrowing writes. */
31
+ const MCP_FILES_ANSWER = "mcpTargets";
32
+ /** The answer key the opt-in per-editor LSP narrowing writes. */
33
+ const LSP_EDITORS_ANSWER = "lspEditors";
34
+ /** Which answer key carries a target's per-child selection, if it has one. */
35
+ const CHILD_ANSWER = {
36
+ mcp: MCP_FILES_ANSWER,
37
+ lsp: LSP_EDITORS_ANSWER,
38
+ };
39
+ /** A row's identity in an answer bag: band-qualified, so `both` stays unambiguous. */
40
+ const rowKey = (band, target) => `${band}:${target}`;
41
+ /**
42
+ * Where a failed row's error lands during interpretation.
43
+ *
44
+ * Per-row failure isolation needs somewhere to put "row X failed with Y", and
45
+ * `execute` yields only the generator's answers and effects — the value of the
46
+ * composed task is discarded. So the recover handlers record here, and the head
47
+ * of the sequence CLEARS it: `generate` is invoked fresh per interpretation, so
48
+ * the clear runs first on every drive and the last drive (the real one, which
49
+ * follows `execute`'s mocked preview) is the one whose records survive. The
50
+ * composition itself stays pure and re-interpretable — nothing is captured in
51
+ * the task, only written while it runs.
52
+ */
53
+ class OutcomeSink {
54
+ errors = new Map();
55
+ /** Forget every recorded failure — run at the head of each interpretation. */
56
+ clear() {
57
+ this.errors.clear();
58
+ }
59
+ record(key, error) {
60
+ this.errors.set(key, error);
61
+ }
62
+ get(key) {
63
+ return this.errors.get(key);
64
+ }
65
+ get failureCount() {
66
+ return this.errors.size;
67
+ }
68
+ }
69
+ /** The {@link PragmaError} a row failure carries, or a wrapper around it. */
70
+ const rowPragmaError = (error) => error.cause instanceof PragmaError
71
+ ? error.cause
72
+ : new PragmaError({ code: "UNSUPPORTED", message: error.message });
73
+ /**
74
+ * Run the chosen rows with per-row failure isolation. The rows are independent
75
+ * installers, so one unsatisfiable prerequisite must not consume the others: a
76
+ * sequenced composition let a failing editor sideload abort the run before MCP
77
+ * or skills ever executed, so on every machine without a usable editor CLI the
78
+ * single advertised onboarding command configured nothing that mattered.
79
+ *
80
+ * Each row runs under a `recover` frame: the failure is reported inline (a
81
+ * `warn` right where it happened), recorded on the sink, and the remaining rows
82
+ * still run. The aggregate outcome is decided afterwards by the caller reading
83
+ * the sink — a run whose every failure is recorded does NOT rethrow, because the
84
+ * recap is the report and the exit code comes from the plan's own rule.
85
+ *
86
+ * Only failures travelling the task FAILURE CHANNEL are isolable — a synchronous
87
+ * throw bypasses the trampoline's recovery frames — which is why the row bodies
88
+ * raise via `checkExecOk`/`failPragma`, never a bare throw. Interruption bypasses
89
+ * recovery by interpreter invariant, so Ctrl-C still stops the whole run.
90
+ */
91
+ const runRowsIsolated = (sink, rows) => flatMap(pure(undefined), () => {
92
+ sink.clear();
93
+ return sequence_(rows.map(({ key, task }) => recover(task, (error) => flatMap(warn(`The ${key.split(":")[1]} step did not complete — continuing with the remaining targets.`), () => {
94
+ sink.record(key, error);
95
+ return pure(undefined);
96
+ }))));
97
+ });
98
+ /** Build a generator's `meta` (no stamping — the version is just header text). */
99
+ const buildMeta = (rt, title) => ({
100
+ name: title,
101
+ displayName: title,
102
+ description: `Configure ${BIN_NAME} on this machine`,
103
+ version: rt.version,
104
+ });
105
+ /** Read a multiselect answer as a string array. */
106
+ const readList = (answers, key) => Array.isArray(answers[key]) ? answers[key] : undefined;
107
+ /**
108
+ * The wizard's row multiselect — its choices ARE the plan rows. Actionable rows
109
+ * are pre-selected; an already-current row is offered DE-selected, so a re-run
110
+ * never proposes to rewrite what is already correct. A skip row is not a choice
111
+ * at all (summon's choice shape has no disabled state) but stays a visible row
112
+ * in the plan and the recap, carrying its reason.
113
+ */
114
+ const buildRowsPrompt = (plan) => {
115
+ const choices = plan.rows
116
+ .filter((row) => row.action !== "skip")
117
+ .map((row) => ({
118
+ label: `${row.target} — ${row.detail}${row.action === "none" ? " (already configured)" : ""}`,
119
+ value: rowKey(row.band, row.target),
120
+ }));
121
+ return {
122
+ name: ROWS_ANSWER,
123
+ type: "multiselect",
124
+ message: "Which targets would you like to configure?",
125
+ choices,
126
+ default: plan.rows
127
+ .filter((row) => row.selected)
128
+ .map((row) => rowKey(row.band, row.target)),
129
+ };
130
+ };
131
+ /** The opt-in "customize which files" gate — defaults to false. */
132
+ const buildCustomizePrompt = (when) => ({
133
+ name: "customize",
134
+ type: "confirm",
135
+ message: `Customize which files ${BIN_NAME} configures?`,
136
+ default: false,
137
+ when,
138
+ });
139
+ /**
140
+ * The per-file MCP multiselect — one row per deduplicated config file, across
141
+ * every band the run covers. An already-current file is DEFAULT-DESELECTED; a
142
+ * file that is absent or drifted stays selected. Retained unchanged from the
143
+ * landed opt-in narrowing: it is row-level CHILD selection, which is exactly
144
+ * what the plan's child rows are.
145
+ */
146
+ const buildChildPrompt = (plan, target, message, when) => {
147
+ const children = childrenOf(plan, target);
148
+ return {
149
+ name: CHILD_ANSWER[target],
150
+ type: "multiselect",
151
+ message,
152
+ when,
153
+ choices: children.map((child) => ({
154
+ label: `${child.label} — ${child.action}`,
155
+ value: child.key,
156
+ })),
157
+ default: children
158
+ .filter((child) => child.action !== "unchanged")
159
+ .map((child) => child.key),
160
+ };
161
+ };
162
+ /** Every child row a target contributes, across the bands in the plan. */
163
+ const childrenOf = (plan, target) => plan.rows
164
+ .filter((row) => row.target === target)
165
+ .flatMap((row) => row.children ?? []);
166
+ /** Whether a row was chosen: by the wizard's answer, else by its own default. */
167
+ const isChosen = (row, chosen) => row.action !== "skip" &&
168
+ (chosen === undefined
169
+ ? row.selected
170
+ : chosen.includes(rowKey(row.band, row.target)));
171
+ /**
172
+ * What a row DID, as a past-tense word. The row's detail says what and where;
173
+ * the note says what happened to it, so a progress line and a recap line read
174
+ * as sentences rather than as two halves of one.
175
+ */
176
+ const ACTION_NOTES = {
177
+ install: "installed",
178
+ update: "updated",
179
+ link: "linked",
180
+ remove: "removed",
181
+ };
182
+ /**
183
+ * The `2 added, 1 updated` note a row's children produce — counted over the
184
+ * children the run KEPT, not the ones it was offered.
185
+ *
186
+ * `kept` is the row's own child answer: the MCP files, or the LSP editors, the
187
+ * wizard narrowed to. Counting the plan's children instead recapped `2 added`
188
+ * for a run the user had just narrowed to one file, so the plan and the result
189
+ * described different work. Absent (`undefined`) means the narrowing prompt was
190
+ * never answered, which is the same thing the compose bodies read as "all".
191
+ *
192
+ * @param row - The plan row.
193
+ * @param kept - The child keys the run retained, or `undefined` for all.
194
+ * @returns The counts note, or `undefined` when the row has no children.
195
+ */
196
+ function childNote(row, kept) {
197
+ const children = (row.children ?? []).filter((child) => kept === undefined || kept.includes(child.key));
198
+ if (children.length === 0)
199
+ return undefined;
200
+ const count = (action) => children.filter((child) => child.action === action).length;
201
+ const parts = [
202
+ count("add") > 0 ? `${count("add")} added` : "",
203
+ count("update") > 0 ? `${count("update")} updated` : "",
204
+ count("unchanged") > 0 ? `${count("unchanged")} unchanged` : "",
205
+ ].filter((part) => part.length > 0);
206
+ return parts.length > 0 ? parts.join(", ") : undefined;
207
+ }
208
+ /**
209
+ * Build one invocation: detect, plan, synthesize the generator, and expose the
210
+ * projection back onto the plan.
211
+ *
212
+ * @param rt - The per-invocation runtime.
213
+ * @param mode - The entry point: the run-all, or one target.
214
+ * @param scope - The resolved band selection.
215
+ * @param removal - Compose the removal (`--undo`) instead of the install.
216
+ * @returns The plan, the generator, and the answers-to-plan projection.
217
+ * @note Impure — runs every selected target's real detection.
218
+ */
219
+ export async function buildSetupRun(rt, mode, scope, removal = false) {
220
+ const ids = mode === "all" ? [...TARGET_IDS] : [mode];
221
+ const roots = await resolveRoots(rt);
222
+ const detected = await detectTargets(rt, ids, scope);
223
+ const plan = buildPlan(scope, roots, detected, ids, removal);
224
+ const sink = new OutcomeSink();
225
+ const prompts = [];
226
+ if (mode === "all")
227
+ prompts.push(buildRowsPrompt(plan));
228
+ // A target is worth narrowing only when it has more than one child to choose
229
+ // between. `mcp` offers its config files; `lsp` offers the editors on PATH —
230
+ // a machine with several VS Code forks should not have the extension pushed
231
+ // into all of them just because they are installed.
232
+ const narrowable = [
233
+ ["mcp", "Configure MCP for which files?"],
234
+ ["lsp", "Install the extension into which editors?"],
235
+ ].filter(([target]) => !removal && childrenOf(plan, target).length > 1);
236
+ if (narrowable.length > 0) {
237
+ const anyChosen = (answers) => {
238
+ const chosen = readList(answers, ROWS_ANSWER);
239
+ return narrowable.some(([target]) => plan.rows.some((row) => row.target === target && isChosen(row, chosen)));
240
+ };
241
+ prompts.push(buildCustomizePrompt(anyChosen));
242
+ for (const [target, message] of narrowable) {
243
+ const rowChosen = (answers) => {
244
+ const chosen = readList(answers, ROWS_ANSWER);
245
+ return plan.rows.some((row) => row.target === target && isChosen(row, chosen));
246
+ };
247
+ prompts.push(buildChildPrompt(plan, target, message, (answers) => answers.customize === true && rowChosen(answers)));
248
+ }
249
+ }
250
+ /** The detection behind a row, for composing and for re-reading its draft. */
251
+ const detectionFor = (row) => detected.find((d) => d.target.id === row.target && d.band === row.band);
252
+ const generator = {
253
+ meta: buildMeta(rt, mode === "all" ? `${BIN_NAME} setup` : `${BIN_NAME} setup ${mode}`),
254
+ prompts,
255
+ generate: (answers) => {
256
+ const chosen = readList(answers, ROWS_ANSWER);
257
+ const tasks = plan.rows.flatMap((row) => {
258
+ if (!isChosen(row, chosen))
259
+ return [];
260
+ const hit = detectionFor(row);
261
+ if (hit === undefined)
262
+ return [];
263
+ // Each target reads ITS OWN child answer. One shared list was handing
264
+ // MCP file paths to every other target's compose.
265
+ const key = CHILD_ANSWER[row.target];
266
+ const children = key === undefined ? undefined : readList(answers, key);
267
+ const task = removal
268
+ ? hit.target.composeRemoval(hit.detection)
269
+ : hit.target.compose(hit.detection, children);
270
+ return [{ key: rowKey(row.band, row.target), task }];
271
+ });
272
+ return runRowsIsolated(sink, tasks);
273
+ },
274
+ };
275
+ /** The outcome one row ended in, read off the sink and its own draft. */
276
+ const outcomeFor = (row, chosen, answers) => {
277
+ const hit = detectionFor(row);
278
+ // A row whose DETECTION threw has no draft to read and nothing to compose,
279
+ // and it is not a skip: the target was requested and did not happen. It
280
+ // reports `failed` with its own cause, exactly as a failed compose does, so
281
+ // the run names it instead of reporting a clean sweep over its siblings.
282
+ const failure = hit === undefined ? undefined : detectionFailure(hit);
283
+ if (failure !== undefined)
284
+ return { status: "failed", note: failure };
285
+ const draft = hit === undefined ? undefined : draftFor(hit, roots, removal);
286
+ if (row.action === "skip") {
287
+ return {
288
+ status: "skipped",
289
+ ...(draft?.remedy === undefined ? {} : { remedy: draft.remedy }),
290
+ };
291
+ }
292
+ // An already-current row reports `noop` whether or not it was selected. It
293
+ // is offered DE-selected (there is nothing to do to it), and returning no
294
+ // outcome at all left a converged re-run with a plan-shaped output that
295
+ // claimed nothing had run — while the row still rendered a bare green ✓.
296
+ // Convergence is a real result: one quiet line per row, zero writes.
297
+ if (row.action === "none")
298
+ return { status: "noop", note: "unchanged" };
299
+ if (!isChosen(row, chosen))
300
+ return undefined;
301
+ const error = sink.get(rowKey(row.band, row.target));
302
+ if (error !== undefined) {
303
+ const pragma = rowPragmaError(error);
304
+ return {
305
+ status: "failed",
306
+ note: pragma.message,
307
+ ...(pragma.recovery?.message === undefined
308
+ ? {}
309
+ : { remedy: pragma.recovery.message }),
310
+ };
311
+ }
312
+ if (!isActionable(row.action))
313
+ return { status: "noop" };
314
+ // A removal never borrows the forward child summary: its children are the
315
+ // files the entry is being taken OUT of, and counting them as "1 updated"
316
+ // described the opposite of what the run had just done.
317
+ const childKey = CHILD_ANSWER[row.target];
318
+ const kept = childKey === undefined ? undefined : readList(answers, childKey);
319
+ const note = removal
320
+ ? ACTION_NOTES[row.action]
321
+ : (childNote(row, kept) ?? ACTION_NOTES[row.action]);
322
+ return {
323
+ status: removal ? "removed" : "done",
324
+ ...(note === undefined ? {} : { note }),
325
+ };
326
+ };
327
+ return {
328
+ plan,
329
+ generator,
330
+ applied: (answers) => {
331
+ const chosen = readList(answers, ROWS_ANSWER);
332
+ return withRows(plan, plan.rows.map((row) => {
333
+ const outcome = outcomeFor(row, chosen, answers);
334
+ return {
335
+ ...row,
336
+ selected: isChosen(row, chosen),
337
+ ...(outcome === undefined ? {} : { outcome }),
338
+ };
339
+ }));
340
+ },
341
+ };
342
+ }
343
+ //# sourceMappingURL=setupGenerator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupGenerator.js","sourceRoot":"","sources":["../../../../../src/capabilities/setup/operations/setupGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH,OAAO,EACL,OAAO,EACP,IAAI,EACJ,OAAO,EACP,SAAS,EAGT,IAAI,GACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,EACL,SAAS,EAET,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,YAAY,EAKZ,UAAU,EAEV,QAAQ,GACT,MAAM,YAAY,CAAC;AAGpB,2DAA2D;AAC3D,MAAM,WAAW,GAAG,SAAS,CAAC;AAE9B,+DAA+D;AAC/D,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC,iEAAiE;AACjE,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAExC,8EAA8E;AAC9E,MAAM,YAAY,GAAsC;IACtD,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,kBAAkB;CACxB,CAAC;AAEF,sFAAsF;AACtF,MAAM,MAAM,GAAG,CAAC,IAAe,EAAE,MAAgB,EAAU,EAAE,CAC3D,GAAG,IAAI,IAAI,MAAM,EAAE,CAAC;AActB;;;;;;;;;;;GAWG;AACH,MAAM,WAAW;IACE,MAAM,GAAG,IAAI,GAAG,EAAqB,CAAC;I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G,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;SACxC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO;QACL,IAAI;QACJ,SAAS;QACT,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE;YACnB,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;YAC9C,OAAO,QAAQ,CACb,IAAI,EACJ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAW,EAAE;gBAC7B,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;gBACjD,OAAO;oBACL,GAAG,GAAG;oBACN,QAAQ,EAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;oBAC/B,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;iBAC9C,CAAC;YACJ,CAAC,CAAC,CACH,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,277 @@
1
+ /**
2
+ * `setup lsp` — ensure the Terrazzo LSP extension is installed in every
3
+ * VS Code-family editor present on this machine.
4
+ *
5
+ * There is no marketplace listing yet: the install is a VSIX SIDELOAD. The
6
+ * published npm package bundles the VSIX, so the install is two exec steps —
7
+ * fetch the package into a pragma-owned staging dir (`bun add`, so the VSIX
8
+ * lands at a DURABLE path a user can retry by hand, not bunx's ephemeral
9
+ * `/tmp/bunx-…` cache), then `<editor cli> --install-extension <vsix>` for
10
+ * each detected editor. The package's own `install.mjs` bin is deliberately
11
+ * NOT used: it hardcodes the `code` CLI, which is precisely what left
12
+ * VSCodium/Cursor/Windsurf/Antigravity machines unable to install at all.
13
+ *
14
+ * `detectLsp` probes FOR REAL up front, and spawns NOTHING: an editor is
15
+ * "present" when its CLI resolves on PATH (the `editorClis` registry names
16
+ * them), and "installed" when its extensions dir holds a
17
+ * `canonical.terrazzo-lsp-extension-<version>/` entry. Running
18
+ * `--list-extensions` instead would be the natural probe, but Cursor's Linux
19
+ * launcher OPENS THE EDITOR on that flag — a detection step must never launch
20
+ * an app, so the fs is the source of truth. The full extension id is matched
21
+ * (not the old `terrazzo` substring, which any other terrazzo-named extension
22
+ * could false-positive).
23
+ *
24
+ * No editor CLI found is a NAMED SKIP, not an error: the message says what was
25
+ * looked for and what to do, and the run exits 0 — there is nothing on this
26
+ * machine the step could honestly fail at. Real failures (fetch, sideload)
27
+ * travel the task failure channel (`checkExecOk`) with a recovery that names a
28
+ * command runnable on THIS machine, so the run-all can isolate the step
29
+ * (S1-1) and a direct `setup lsp` still renders the original error.
30
+ */
31
+ import { existsSync, readdirSync } from "node:fs";
32
+ import { join } from "node:path";
33
+ import { exec, flatMap, mkdir, sequence_, } from "@canonical/task";
34
+ import { BIN_NAME } from "../../../constants.js";
35
+ import { checkExecOk, guardMissingBinary } from "../../shared/index.js";
36
+ /** The full extension id, as the editor's extensions dir spells it. */
37
+ const EXTENSION_ID = "canonical.terrazzo-lsp-extension";
38
+ /** The npm package whose tarball bundles the VSIX. */
39
+ const LSP_PACKAGE = "@canonical/terrazzo-lsp-extension";
40
+ /**
41
+ * Whether an editor CLI resolves on PATH, given the candidate paths the host
42
+ * would consider for it.
43
+ *
44
+ * The candidates come from `@canonical/harnesses`' `executableCandidates` —
45
+ * the same helper harness detection resolves `process` signals with — rather
46
+ * than from a local `PATH`-join here. That local version joined the BARE name
47
+ * onto each PATH directory, which resolves nothing on Windows: `code`,
48
+ * `codium` and friends install as `.cmd` shims, so every installed editor
49
+ * went unseen and `setup lsp` took the no-editor path. That path is a named
50
+ * SKIP, so the run exited 0 reporting a clean answer on a machine that had
51
+ * the editor — a wrong skip reads as correct, which is worse than a wrong
52
+ * failure. One implementation of the platform rules means the probe cannot
53
+ * drift away from detection's.
54
+ */
55
+ const cliOnPath = (candidates) => candidates.some((candidate) => existsSync(candidate));
56
+ /**
57
+ * The oldest extension release whose bundled language server actually starts.
58
+ *
59
+ * Every VSIX before this one ships the server as ~166 loose modules importing
60
+ * `colorjs.io`, `@lezer/common` and `@lezer/css` by BARE SPECIFIER, with no
61
+ * `node_modules` beside them — so the server dies on load under `node` and
62
+ * under `bun --no-install`. It appeared to work only because the extension
63
+ * prefers Bun, and Bun silently fetches missing packages from the network at
64
+ * spawn time; a machine without that behaviour got a language server that
65
+ * never started, and one with it got a server resolving unpinned dependencies
66
+ * over the wire. Fixed in 0.8.3, which bundles the server into one file
67
+ * (canonical/design-tokens#110).
68
+ */
69
+ const MIN_EXTENSION_VERSION = "0.8.3";
70
+ /** {@link MIN_EXTENSION_VERSION}, parsed once. */
71
+ const MINIMUM = MIN_EXTENSION_VERSION.split(".").map(Number);
72
+ /**
73
+ * A version this check can actually read: dot-separated digit runs, nothing
74
+ * else. Deliberately strict — see {@link parseVersion}.
75
+ */
76
+ const NUMERIC_VERSION = /^\d+(?:\.\d+)*$/;
77
+ /**
78
+ * Parse a dotted numeric version, or `undefined` when it is not one.
79
+ *
80
+ * `Number.parseInt` is the wrong tool here and quietly breaks the fail-closed
81
+ * rule this module claims: it accepts numeric PREFIXES, so `1.0.0junk` reads
82
+ * as `[1, 0, 0]`, and `|| 0` turns a `NaN` component into a zero, so
83
+ * `1.invalid.0` also reads as `[1, 0, 0]`. Both then compare NEWER than the
84
+ * minimum and report a broken extension as installed — the exact wrong-skip
85
+ * this version check exists to prevent, reintroduced by the parser.
86
+ *
87
+ * So the whole string is validated before any component is trusted.
88
+ */
89
+ const parseVersion = (value) => NUMERIC_VERSION.test(value)
90
+ ? value.split(".").map((part) => Number(part))
91
+ : undefined;
92
+ /** Compare two dotted numeric versions. Returns <0, 0, >0 like a comparator. */
93
+ const compareVersions = (left, right) => {
94
+ for (let i = 0; i < Math.max(left.length, right.length); i++) {
95
+ const diff = (left[i] ?? 0) - (right[i] ?? 0);
96
+ if (diff !== 0)
97
+ return diff;
98
+ }
99
+ return 0;
100
+ };
101
+ /**
102
+ * Whether an editor's extensions dir holds a copy new enough to WORK.
103
+ *
104
+ * Version-aware on purpose. Matching any `canonical.terrazzo-lsp-extension-*`
105
+ * entry meant a machine carrying a build whose server cannot start reported
106
+ * `installed`, so `setup lsp` skipped it and `doctor` called it healthy —
107
+ * a wrong skip that reads as correct, which is worse than a wrong failure and
108
+ * is exactly the trap this module's docblock warns about elsewhere. Everyone
109
+ * who ran `setup lsp` before {@link MIN_EXTENSION_VERSION} would have kept a
110
+ * dead language server forever, with nothing telling them why.
111
+ *
112
+ * An unparseable suffix counts as too old: a directory this function cannot
113
+ * read the version of is one it cannot vouch for.
114
+ */
115
+ const extensionInstalled = (editor, platform) => {
116
+ let entries;
117
+ try {
118
+ entries = readdirSync(editor.extensionsDir(platform));
119
+ }
120
+ catch {
121
+ return false; // No extensions dir — nothing installed.
122
+ }
123
+ const prefix = `${EXTENSION_ID}-`;
124
+ return entries.some((entry) => {
125
+ const lower = entry.toLowerCase();
126
+ if (!lower.startsWith(prefix))
127
+ return false;
128
+ const version = parseVersion(lower.slice(prefix.length));
129
+ if (version === undefined)
130
+ return false; // Unreadable: cannot vouch for it.
131
+ return compareVersions(version, MINIMUM) >= 0;
132
+ });
133
+ };
134
+ /**
135
+ * Probe every registry editor: CLI presence via PATH lookup, installed-state
136
+ * via the extensions dir — no spawns (see the module docblock for why).
137
+ *
138
+ * @param _cwd - Unused; kept so every `detectX` shares the (cwd) shape.
139
+ * @returns The detected {@link LspDetection}.
140
+ * @note Impure — reads PATH dirs and editor extension dirs off the real fs.
141
+ */
142
+ export async function detectLsp(_cwd) {
143
+ const { editorClis, executableCandidates, readPlatformEnv, userDataBase } = await import("@canonical/harnesses");
144
+ const platform = readPlatformEnv();
145
+ const editors = editorClis
146
+ .filter((editor) => cliOnPath(executableCandidates(editor.cli, platform)))
147
+ .map((editor) => ({
148
+ editor,
149
+ installed: extensionInstalled(editor, platform),
150
+ }));
151
+ const state = editors.length === 0
152
+ ? "unknown"
153
+ : editors.every((e) => e.installed)
154
+ ? "installed"
155
+ : "absent";
156
+ return {
157
+ available: true,
158
+ state,
159
+ editors,
160
+ probed: editorClis.map((editor) => editor.cli),
161
+ stagingDir: join(userDataBase(platform), BIN_NAME, "lsp"),
162
+ };
163
+ }
164
+ /**
165
+ * The editors an install would act on: those missing the extension, narrowed to
166
+ * the user's per-editor selection when the wizard collected one.
167
+ *
168
+ * A machine commonly has several VS Code forks installed and the user wants the
169
+ * extension in one of them. Installing into all of them because they are on
170
+ * PATH is the same overreach the MCP row already avoids by offering its files.
171
+ *
172
+ * @param d - The detection gathered up front.
173
+ * @param chosen - Selected editor CLI names, or undefined for "all pending".
174
+ * @returns The editors to install into.
175
+ */
176
+ export const selectedEditors = (d, chosen) => {
177
+ const pending = d.editors.filter((e) => !e.installed);
178
+ return chosen === undefined
179
+ ? pending
180
+ : pending.filter((e) => chosen.includes(e.editor.cli));
181
+ };
182
+ /** The editor names in a detection (for messages/results). */
183
+ export const lspEditorNames = (d) => d.editors.map((e) => e.editor.name);
184
+ /**
185
+ * The named-skip reason for a machine with no VS Code-family CLI on PATH. It
186
+ * names every CLI that was probed, because a skip the user cannot act on is
187
+ * only honest if it says what would have counted.
188
+ *
189
+ * @param d - The detection gathered up front.
190
+ * @returns The reason line.
191
+ */
192
+ export const lspSkipReason = (d) => `no VS Code-family editor CLI on PATH (${d.probed.join(", ")})`;
193
+ /**
194
+ * The remedy beneath that skip. It states plainly that nothing is possible here
195
+ * yet rather than offering a command for a binary this machine lacks — the rule
196
+ * every remedy line in this capability holds to.
197
+ */
198
+ export const LSP_SKIP_REMEDY = "no action is possible on this machine yet — install VS Code or VSCodium, then run this again";
199
+ /**
200
+ * Compose the LSP-install effects for a detection.
201
+ *
202
+ * Built from re-runnable combinators (NOT a single-use `gen`) because
203
+ * `execute` interprets the task twice (preview + perform); a dry-run mocks
204
+ * every exec (exit 0), so the preview shows the fetch + per-editor sideloads
205
+ * without spawning. Failures travel the task failure channel with
206
+ * machine-honest recoveries (see module docblock).
207
+ *
208
+ * @param d - The detection gathered up front.
209
+ * @returns A Task installing the extension into each editor missing it.
210
+ */
211
+ export function composeLsp(d, chosen) {
212
+ // Nothing to install: no editor CLI on PATH (a named skip the plan row
213
+ // carries) or every detected editor already has it. Both compose NOTHING —
214
+ // what the run SAYS about this target is the plan row's business.
215
+ if (d.state !== "absent")
216
+ return sequence_([]);
217
+ const pending = selectedEditors(d, chosen);
218
+ // Every pending editor was deselected — there is no fetch to do either.
219
+ if (pending.length === 0)
220
+ return sequence_([]);
221
+ const vsixPath = lspVsixPath(d);
222
+ // Fetch the VSIX-bundling package into the pragma-owned staging dir. `bun`
223
+ // (not bunx) so the unpacked package — and its VSIX — survives at a stable
224
+ // path the recovery lines below can honestly point at.
225
+ const fetchCommand = `bun add ${LSP_PACKAGE}@latest`;
226
+ const fetchVsix = guardMissingBinary("bun", {
227
+ message: `Install Bun (https://bun.sh), then run \`${BIN_NAME} setup lsp\` again.`,
228
+ }, sequence_([
229
+ mkdir(d.stagingDir, true),
230
+ flatMap(exec("bun", ["add", `${LSP_PACKAGE}@latest`], d.stagingDir), (result) => checkExecOk(fetchCommand, result, {
231
+ message: "The extension package cannot be fetched — this machine cannot reach registry.npmjs.org. Check the connection, then run " +
232
+ `\`${BIN_NAME} setup lsp\` again.`,
233
+ })),
234
+ ]));
235
+ const sideloads = pending.map(({ editor }) => {
236
+ const command = `${editor.cli} --install-extension ${vsixPath}`;
237
+ return guardMissingBinary(editor.cli, {
238
+ message: `The \`${editor.cli}\` CLI disappeared from PATH mid-run — restore it, then run \`${BIN_NAME} setup lsp\` again.`,
239
+ }, flatMap(exec(editor.cli, ["--install-extension", vsixPath], d.stagingDir), (result) => checkExecOk(command, result, {
240
+ message: `${editor.name} refused the VSIX (its output is above). The file is kept at ${vsixPath} — retry by hand with ` +
241
+ `\`${command}\`, or update ${editor.name} first.`,
242
+ })));
243
+ });
244
+ return sequence_([fetchVsix, ...sideloads]);
245
+ }
246
+ /**
247
+ * Compose the removal — deliberately empty. An extension install is an `exec`,
248
+ * and an `exec` carries no reversal: pretending otherwise is what made
249
+ * `setup lsp --undo` report a step count for work it never did. The honest
250
+ * answer is the plan row's, which names the editor CLI that CAN uninstall it
251
+ * (see {@link lspUninstallRemedy}) or states that this machine has none.
252
+ *
253
+ * @param _d - The detection (unused; the shape is the table's).
254
+ * @returns An empty Task.
255
+ */
256
+ export function composeLspRemoval(_d) {
257
+ return sequence_([]);
258
+ }
259
+ /**
260
+ * The uninstall instruction for a detection — a command that runs on THIS
261
+ * machine, or `undefined` when no editor CLI was found and there is therefore
262
+ * nothing honest to print.
263
+ *
264
+ * @param d - The detection gathered up front.
265
+ * @returns The uninstall command, or undefined.
266
+ */
267
+ export function lspUninstallRemedy(d) {
268
+ const cli = d.editors.at(0)?.editor.cli;
269
+ return cli === undefined
270
+ ? undefined
271
+ : `${cli} --uninstall-extension ${EXTENSION_ID}`;
272
+ }
273
+ /** The VSIX path a failed sideload leaves behind for a manual retry. */
274
+ export function lspVsixPath(d) {
275
+ return join(d.stagingDir, "node_modules", ...LSP_PACKAGE.split("/"), "terrazzo-lsp.vsix");
276
+ }
277
+ //# sourceMappingURL=setupLsp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupLsp.js","sourceRoot":"","sources":["../../../../../src/capabilities/setup/operations/setupLsp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAEL,IAAI,EACJ,OAAO,EACP,KAAK,EACL,SAAS,GAEV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAGx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