@astryxdesign/cli 0.7.17-canary.g5a3fd39 → 0.7.17-canary.g5cf5d69

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 (426) hide show
  1. package/README.md +64 -63
  2. package/api/build/_adapter.d.mts +51 -0
  3. package/api/build/_adapter.mjs +122 -6
  4. package/api/build/build.doc.mjs +1 -1
  5. package/api/build/build.mjs +23 -14
  6. package/api/build/build.type.d.mts +1 -1
  7. package/api/build/build.type.mjs +3 -3
  8. package/api/build/help/help.d.mts +15 -14
  9. package/api/build/help/help.mjs +62 -3
  10. package/api/build/kit/answer.mjs +2 -3
  11. package/api/build/kit/signals.d.mts +10 -0
  12. package/api/build/kit/signals.mjs +15 -2
  13. package/api/component/detail/blocks/blocks.mjs +2 -1
  14. package/api/discover/_adapter.d.mts +57 -6
  15. package/api/discover/_adapter.mjs +278 -49
  16. package/api/discover/_catalog-view.d.mts +7 -0
  17. package/api/discover/_catalog-view.mjs +10 -1
  18. package/api/discover/detail/detail.d.mts +3 -2
  19. package/api/discover/detail/detail.mjs +3 -2
  20. package/api/discover/detail/doc/doc.mjs +1 -1
  21. package/api/discover/discover.d.mts +24 -0
  22. package/api/discover/discover.doc.mjs +1 -1
  23. package/api/discover/discover.mjs +146 -25
  24. package/api/discover/discover.type.d.mts +6 -4
  25. package/api/discover/discover.type.mjs +6 -4
  26. package/api/discover/search/search.d.mts +22 -0
  27. package/api/discover/search/search.mjs +290 -70
  28. package/api/docs/_entry-names.mjs +4 -3
  29. package/api/doctor/_adapter.d.mts +43 -3
  30. package/api/doctor/_adapter.mjs +142 -18
  31. package/api/doctor/built-checks.d.mts +30 -3
  32. package/api/doctor/built-checks.mjs +132 -5
  33. package/api/doctor/doctor.d.mts +93 -6
  34. package/api/doctor/doctor.doc.mjs +2 -2
  35. package/api/doctor/doctor.mjs +524 -33
  36. package/api/doctor/doctor.type.d.mts +2 -1
  37. package/api/doctor/doctor.type.mjs +2 -1
  38. package/api/doctor/theme-checks.d.mts +19 -0
  39. package/api/doctor/theme-checks.mjs +74 -6
  40. package/api/hook/hook.type.d.mts +1 -1
  41. package/api/hook/hook.type.mjs +1 -1
  42. package/api/hook/list/list.mjs +11 -7
  43. package/api/icon/_adapter.d.mts +2 -1
  44. package/api/icon/_adapter.mjs +10 -15
  45. package/api/icon/_records.d.mts +3 -1
  46. package/api/icon/_records.mjs +30 -3
  47. package/api/icon/exportIconIndex.doc.mjs +1 -1
  48. package/api/icon/icon.doc.mjs +3 -3
  49. package/api/icon/icon.type.d.mts +32 -1
  50. package/api/icon/icon.type.mjs +19 -3
  51. package/api/icon/list/list.mjs +4 -1
  52. package/api/icon/rankIconIndex.doc.mjs +1 -1
  53. package/api/icon/search/icon-index.mjs +18 -8
  54. package/api/icon/search/search.d.mts +26 -3
  55. package/api/icon/search/search.mjs +155 -9
  56. package/api/init/_adapter.d.mts +14 -0
  57. package/api/init/_adapter.mjs +26 -4
  58. package/api/init/init.d.mts +1 -1
  59. package/api/init/init.doc.mjs +2 -2
  60. package/api/init/init.mjs +1 -1
  61. package/api/init/init.type.d.mts +29 -1
  62. package/api/init/init.type.mjs +14 -1
  63. package/api/init/run/run.d.mts +11 -1
  64. package/api/init/run/run.mjs +84 -5
  65. package/api/integration/_adapter.d.mts +5 -4
  66. package/api/integration/_adapter.mjs +7 -5
  67. package/api/integration/integrationCheck.doc.mjs +1 -1
  68. package/api/integration/pack-check.mjs +8 -9
  69. package/api/integration/validate-integration.d.mts +1 -1
  70. package/api/integration/validate-integration.mjs +26 -24
  71. package/api/integration/validate-integration.type.d.mts +5 -2
  72. package/api/integration/validate-integration.type.mjs +5 -2
  73. package/api/integration/validateIntegration.doc.mjs +1 -1
  74. package/api/render/_adapter.d.mts +4 -2
  75. package/api/render/_adapter.mjs +62 -21
  76. package/api/render/render.doc.mjs +8 -5
  77. package/api/render/render.mjs +1 -1
  78. package/api/render/render.type.d.mts +2 -0
  79. package/api/render/render.type.mjs +2 -0
  80. package/api/search/ORDERING.md +2 -2
  81. package/api/search/_candidate-score.d.mts +3 -0
  82. package/api/search/_candidate-score.mjs +36 -3
  83. package/api/search/_gather-docs.mjs +29 -2
  84. package/api/search/_gather-templates.mjs +2 -1
  85. package/api/search/_main-searcher.mjs +13 -0
  86. package/api/search/_named-keywords.d.mts +2 -1
  87. package/api/search/_named-keywords.mjs +48 -6
  88. package/api/search/_order.d.mts +36 -1
  89. package/api/search/_order.mjs +141 -3
  90. package/api/swizzle/list/list.mjs +8 -1
  91. package/api/swizzle/swizzle.type.d.mts +1 -1
  92. package/api/swizzle/swizzle.type.mjs +1 -1
  93. package/api/template/copy/copy.mjs +3 -4
  94. package/api/template/list/list.mjs +2 -1
  95. package/api/template/show/show.mjs +2 -1
  96. package/api/template/skeleton/skeleton.mjs +2 -1
  97. package/api/template/template.doc.mjs +1 -1
  98. package/api/template/template.mjs +19 -1
  99. package/api/template/template.type.d.mts +1 -0
  100. package/api/template/template.type.mjs +2 -1
  101. package/api/theme/_adapter.d.mts +1 -0
  102. package/api/theme/_adapter.mjs +3 -5
  103. package/api/theme/_app-provider.d.mts +42 -0
  104. package/api/theme/_app-provider.mjs +61 -27
  105. package/api/theme/build/build.d.mts +4 -10
  106. package/api/theme/build/build.mjs +165 -116
  107. package/api/theme/build/input-fields.d.mts +9 -0
  108. package/api/theme/build/input-fields.mjs +155 -16
  109. package/api/theme/build/radius-values.d.mts +18 -0
  110. package/api/theme/build/radius-values.mjs +76 -0
  111. package/api/theme/build/typography-values.mjs +7 -23
  112. package/api/theme/build/written-values.d.mts +18 -0
  113. package/api/theme/build/written-values.mjs +107 -31
  114. package/api/theme/eject/eject.mjs +6 -1
  115. package/api/theme/palette/generate/generator.mjs +24 -0
  116. package/api/theme/theme.type.d.mts +4 -2
  117. package/api/theme/theme.type.mjs +3 -2
  118. package/api/theme/themeBuild.doc.mjs +2 -2
  119. package/api/theme/themeEject.doc.mjs +1 -1
  120. package/api/theme-edit/_catalog.d.mts +40 -0
  121. package/api/theme-edit/_catalog.mjs +100 -22
  122. package/api/theme-edit/_check.mjs +213 -43
  123. package/api/theme-edit/_color.d.mts +14 -0
  124. package/api/theme-edit/_color.mjs +22 -0
  125. package/api/theme-edit/_compiler.mjs +52 -0
  126. package/api/theme-edit/_context.d.mts +20 -2
  127. package/api/theme-edit/_context.mjs +157 -29
  128. package/api/theme-edit/_edit.mjs +426 -58
  129. package/api/theme-edit/_how-question.d.mts +14 -0
  130. package/api/theme-edit/_how-question.mjs +1541 -127
  131. package/api/theme-edit/_how.mjs +43 -0
  132. package/api/theme-edit/_missed.mjs +107 -27
  133. package/api/theme-edit/_normal.d.mts +18 -4
  134. package/api/theme-edit/_normal.mjs +84 -3
  135. package/api/theme-edit/_palette.d.mts +9 -0
  136. package/api/theme-edit/_palette.mjs +158 -33
  137. package/api/theme-edit/_part-words.mjs +16 -3
  138. package/api/theme-edit/_parts.d.mts +8 -0
  139. package/api/theme-edit/_parts.mjs +120 -36
  140. package/api/theme-edit/_png.d.mts +24 -0
  141. package/api/theme-edit/_png.mjs +99 -0
  142. package/api/theme-edit/_preview-app.d.mts +16 -0
  143. package/api/theme-edit/_preview-app.mjs +52 -18
  144. package/api/theme-edit/_preview.d.mts +44 -26
  145. package/api/theme-edit/_preview.mjs +255 -67
  146. package/api/theme-edit/_project.d.mts +12 -1
  147. package/api/theme-edit/_project.mjs +16 -1
  148. package/api/theme-edit/_settings.d.mts +116 -0
  149. package/api/theme-edit/_settings.mjs +1197 -58
  150. package/api/theme-edit/_tables.d.mts +16 -0
  151. package/api/theme-edit/_tables.mjs +34 -4
  152. package/api/theme-edit/theme-edit.type.d.mts +15 -2
  153. package/api/theme-edit/theme-edit.type.mjs +8 -6
  154. package/api/upgrade/_adapter.d.mts +46 -7
  155. package/api/upgrade/_adapter.mjs +110 -15
  156. package/api/upgrade/registry/registry.d.mts +6 -3
  157. package/api/upgrade/registry/registry.mjs +21 -6
  158. package/api/upgrade/run/run.mjs +23 -11
  159. package/api/upgrade/upgrade.doc.mjs +4 -3
  160. package/assets/component-list.generated.json +1 -1
  161. package/assets/docs/tree/agent-guidance.doc.mjs +3 -2
  162. package/assets/docs/tree/checks.doc.mjs +2 -2
  163. package/assets/docs/tree/host-entry.doc.mjs +4 -0
  164. package/assets/docs/tree/icon-definitions.doc.mjs +3 -3
  165. package/assets/docs/tree/icon-sets.doc.mjs +6 -6
  166. package/assets/docs/tree/problems.doc.mjs +3 -3
  167. package/assets/docs/tree/render-pages.doc.mjs +17 -3
  168. package/assets/docs/tree/share-a-page.doc.mjs +5 -5
  169. package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
  170. package/assets/docs/tree/troubleshooting.doc.mjs +8 -0
  171. package/assets/docs/tree/updates.doc.mjs +1 -1
  172. package/assets/docs/tree/versioning.doc.mjs +1 -1
  173. package/assets/docs/working-with-ai.doc.mjs +40 -5
  174. package/assets/docs-routes.generated.json +1 -1
  175. package/assets/docs.generated.json +2 -2
  176. package/assets/icons/installed-icon-set.doc.mjs +30 -0
  177. package/assets/search-catalog.generated.json +2 -2
  178. package/assets/self-audit.generated.json +1 -1
  179. package/assets/templates/blocks/components/Avatar/AvatarInteractive.tsx +6 -1
  180. package/assets/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +1 -1
  181. package/assets/templates/blocks/components/LinkProvider/LinkProviderCustomLink.tsx +3 -1
  182. package/assets/templates/components.generated.json +1 -1
  183. package/assets/templates/pages/ai-chat/page.tsx +6 -2
  184. package/assets/templates/pages/ai-chat-landing/page.tsx +1 -1
  185. package/assets/templates/pages/blank/page.tsx +4 -2
  186. package/assets/templates/pages/canvas-editor/page.tsx +3 -1
  187. package/assets/templates/pages/centered-hero/page.tsx +1 -1
  188. package/assets/templates/pages/checkout-wizard/page.tsx +1 -1
  189. package/assets/templates/pages/classic-gallery/page.tsx +1 -1
  190. package/assets/templates/pages/contact-form/page.tsx +2 -2
  191. package/assets/templates/pages/course-detail/page.tsx +1 -1
  192. package/assets/templates/pages/dashboard/page.tsx +24 -8
  193. package/assets/templates/pages/dashboard-alert-rail/page.tsx +4 -2
  194. package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +7 -3
  195. package/assets/templates/pages/dashboard-comparison/page.tsx +5 -2
  196. package/assets/templates/pages/dashboard-composition/page.tsx +10 -4
  197. package/assets/templates/pages/dashboard-progress/page.tsx +6 -3
  198. package/assets/templates/pages/dashboard-scorecard/page.tsx +17 -8
  199. package/assets/templates/pages/detail-page/page.tsx +22 -5
  200. package/assets/templates/pages/documentation/page.tsx +4 -2
  201. package/assets/templates/pages/documentation-design/page.tsx +5 -2
  202. package/assets/templates/pages/documentation-technical/page.tsx +4 -2
  203. package/assets/templates/pages/editor/page.tsx +28 -9
  204. package/assets/templates/pages/file-explorer/page.tsx +3 -1
  205. package/assets/templates/pages/form-two-column/page.tsx +1 -1
  206. package/assets/templates/pages/form-wizard/page.tsx +1 -1
  207. package/assets/templates/pages/form-wizard-dialog/page.tsx +3 -1
  208. package/assets/templates/pages/form-wizard-inline/page.tsx +1 -1
  209. package/assets/templates/pages/form-wizard-vertical/page.tsx +1 -1
  210. package/assets/templates/pages/gallery-hero/page.tsx +1 -1
  211. package/assets/templates/pages/ide/page.tsx +7 -2
  212. package/assets/templates/pages/kanban-board/page.tsx +10 -4
  213. package/assets/templates/pages/library/page.tsx +31 -61
  214. package/assets/templates/pages/login/page.tsx +4 -2
  215. package/assets/templates/pages/login-card/page.tsx +4 -2
  216. package/assets/templates/pages/login-split/page.tsx +3 -2
  217. package/assets/templates/pages/login-sso/page.tsx +4 -4
  218. package/assets/templates/pages/mixed-gallery/page.tsx +1 -1
  219. package/assets/templates/pages/payment-form/page.tsx +1 -1
  220. package/assets/templates/pages/product-detail/page.tsx +16 -4
  221. package/assets/templates/pages/product-gallery/page.tsx +1 -1
  222. package/assets/templates/pages/settings/page.tsx +10 -4
  223. package/assets/templates/pages/settings-dialog/page.tsx +5 -6
  224. package/assets/templates/pages/settings-sidebar/page.tsx +39 -13
  225. package/assets/templates/pages/side-gallery/page.tsx +1 -1
  226. package/assets/templates/pages/table/page.tsx +2 -2
  227. package/assets/templates/pages/table-filter/page.tsx +21 -6
  228. package/assets/templates/pages/table-grouped/page.tsx +23 -2
  229. package/assets/templates/pages/table-inbox/page.tsx +82 -32
  230. package/assets/templates/pages/theme-showcase/page.tsx +3 -2
  231. package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +12 -12
  232. package/assets/templates/themes/butter/butterTheme.ts +197 -4
  233. package/assets/templates/themes/chocolate/chocolateTheme.ts +72 -8
  234. package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +3 -3
  235. package/assets/templates/themes/gothic/gothicTheme.ts +114 -4
  236. package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +8 -8
  237. package/assets/templates/themes/matcha/matchaTheme.ts +48 -12
  238. package/assets/templates/themes/neutral/neutralTheme.ts +29 -0
  239. package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +2 -2
  240. package/assets/templates/themes/stone/stoneTheme.ts +69 -0
  241. package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +9 -9
  242. package/assets/templates/themes/y2k/y2kTheme.ts +249 -14
  243. package/authoring/codemod/parse.d.mts +0 -36
  244. package/authoring/codemod/parse.mjs +62 -41
  245. package/authoring/config/config.doc.mjs +1 -1
  246. package/authoring/config/parse.d.mts +0 -47
  247. package/authoring/config/parse.mjs +128 -103
  248. package/authoring/config/type.ts +4 -3
  249. package/authoring/debug/parse.d.mts +2 -2
  250. package/authoring/discover/parse.d.mts +2 -2
  251. package/authoring/discover/parse.mjs +52 -38
  252. package/authoring/discover/type.ts +2 -1
  253. package/authoring/doctypes/_schema.d.mts +834 -950
  254. package/authoring/doctypes/_schema.mjs +863 -825
  255. package/authoring/doctypes/command/parse.mjs +2 -2
  256. package/authoring/doctypes/component/parse.mjs +2 -2
  257. package/authoring/doctypes/enum/parse.mjs +2 -2
  258. package/authoring/doctypes/hook/parse.mjs +2 -2
  259. package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +1 -1
  260. package/authoring/doctypes/icon-definition/parse.d.mts +0 -24
  261. package/authoring/doctypes/icon-definition/parse.mjs +59 -43
  262. package/authoring/doctypes/icon-set/parse.d.mts +0 -75
  263. package/authoring/doctypes/icon-set/parse.mjs +239 -210
  264. package/authoring/doctypes/legacy.mjs +3 -3
  265. package/authoring/doctypes/namespace/parse.mjs +2 -2
  266. package/authoring/doctypes/reference/parse.mjs +2 -2
  267. package/authoring/doctypes/schema/parse.mjs +2 -2
  268. package/authoring/doctypes/template/parse.d.mts +0 -101
  269. package/authoring/doctypes/template/parse.mjs +131 -106
  270. package/authoring/doctypes/theme/parse.d.mts +0 -23
  271. package/authoring/doctypes/theme/parse.mjs +52 -36
  272. package/authoring/gap-report/parse.d.mts +1 -1
  273. package/authoring/integration/integration.doc.mjs +8 -0
  274. package/authoring/integration/schema.d.mts +14 -3
  275. package/authoring/integration/schema.mjs +20 -2
  276. package/authoring/integration/type.ts +14 -0
  277. package/clients/cli/build-id.generated.json +1 -1
  278. package/clients/cli/commands/build.mjs +27 -13
  279. package/clients/cli/commands/component.mjs +14 -3
  280. package/clients/cli/commands/discover.doc.mjs +2 -2
  281. package/clients/cli/commands/discover.mjs +20 -3
  282. package/clients/cli/commands/docs.doc.mjs +11 -9
  283. package/clients/cli/commands/docs.mjs +50 -21
  284. package/clients/cli/commands/experimental/icon.mjs +330 -227
  285. package/clients/cli/commands/experimental/render.mjs +16 -1
  286. package/clients/cli/commands/experimental/theme.mjs +42 -17
  287. package/clients/cli/commands/experimental-icon-add.doc.mjs +1 -1
  288. package/clients/cli/commands/experimental-icon-map.doc.mjs +4 -1
  289. package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +4 -1
  290. package/clients/cli/commands/experimental-icon-new-set.doc.mjs +4 -1
  291. package/clients/cli/commands/experimental-icon-use.doc.mjs +1 -1
  292. package/clients/cli/commands/experimental-icon.doc.mjs +1 -1
  293. package/clients/cli/commands/experimental-render.doc.mjs +3 -3
  294. package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -1
  295. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +1 -1
  296. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -1
  297. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
  298. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
  299. package/clients/cli/commands/init.doc.mjs +36 -24
  300. package/clients/cli/commands/integration-check.doc.mjs +1 -1
  301. package/clients/cli/commands/mcp.doc.mjs +53 -0
  302. package/clients/cli/commands/mcp.mjs +51 -0
  303. package/clients/cli/commands/search.mjs +46 -9
  304. package/clients/cli/commands/template.mjs +3 -2
  305. package/clients/cli/commands/theme-build.doc.mjs +1 -1
  306. package/clients/cli/commands/theme.mjs +12 -2
  307. package/clients/cli/commands/upgrade.doc.mjs +3 -2
  308. package/clients/cli/commands.generated.json +1 -1
  309. package/clients/cli/formatters/index.mjs +52 -6
  310. package/clients/cli/index.mjs +23 -17
  311. package/clients/cli/lib/base-gate.mjs +37 -5
  312. package/clients/cli/lib/define-command.mjs +82 -4
  313. package/clients/cli/lib/json-shim.mjs +61 -4
  314. package/clients/cli/lib/manifest.mjs +9 -1
  315. package/clients/cli/lib/mcp-server.mjs +286 -0
  316. package/clients/cli/lib/mcp-tools.mjs +405 -0
  317. package/clients/cli/lib/other-cli-words.mjs +99 -0
  318. package/clients/cli/lib/stray-option.mjs +27 -1
  319. package/clients/cli/lib/unknown-command.mjs +326 -11
  320. package/clients/cli/manifest.generated.json +1 -1
  321. package/clients/cli/run.mjs +1 -1
  322. package/foundation/agent-docs/agent-docs.d.mts +49 -1
  323. package/foundation/agent-docs/agent-docs.mjs +108 -7
  324. package/foundation/agent-docs/computer-agent-text.mjs +1 -1
  325. package/foundation/bases/core.d.mts +1 -1
  326. package/foundation/bases/core.mjs +3 -3
  327. package/foundation/bases/resolve.d.mts +4 -8
  328. package/foundation/bases/resolve.mjs +15 -21
  329. package/foundation/bases/state.d.mts +15 -9
  330. package/foundation/bases/state.mjs +33 -6
  331. package/foundation/config/project.d.mts +5 -4
  332. package/foundation/config/project.mjs +33 -17
  333. package/foundation/discovery/component-discovery.mjs +15 -28
  334. package/foundation/discovery/icon-imports.d.mts +66 -0
  335. package/foundation/discovery/icon-imports.mjs +225 -0
  336. package/foundation/discovery/icon-ranking.d.mts +12 -2
  337. package/foundation/discovery/icon-ranking.mjs +197 -10
  338. package/foundation/discovery/icon-set-checks.mjs +2 -1
  339. package/foundation/discovery/icon-set-discovery.d.mts +28 -0
  340. package/foundation/discovery/icon-set-discovery.mjs +42 -0
  341. package/foundation/discovery/icon-set-writer.d.mts +2 -11
  342. package/foundation/discovery/icon-set-writer.mjs +3 -29
  343. package/foundation/discovery/module-exports.d.mts +1 -1
  344. package/foundation/discovery/module-exports.mjs +136 -33
  345. package/foundation/discovery/name-roots.d.mts +5 -0
  346. package/foundation/discovery/name-roots.mjs +11 -0
  347. package/foundation/discovery/runner-allowlist.d.mts +1 -0
  348. package/foundation/discovery/runner-allowlist.mjs +2 -0
  349. package/foundation/discovery/runner-commands.mjs +1 -0
  350. package/foundation/discovery/template-adapter.d.mts +1 -1
  351. package/foundation/discovery/template-destination.d.mts +14 -6
  352. package/foundation/discovery/template-destination.mjs +42 -8
  353. package/foundation/discovery/template-icons.d.mts +45 -2
  354. package/foundation/discovery/template-icons.mjs +26 -54
  355. package/foundation/discovery/template-needs.d.mts +28 -2
  356. package/foundation/discovery/template-needs.mjs +92 -11
  357. package/foundation/discovery/theme-discovery.d.mts +8 -0
  358. package/foundation/discovery/theme-discovery.mjs +23 -6
  359. package/foundation/discovery/theme-imports.mjs +2 -4
  360. package/foundation/doc-compiler/parse-readable.mjs +4 -3
  361. package/foundation/doc-compiler/stored-docs.d.mts +13 -0
  362. package/foundation/doc-compiler/stored-docs.mjs +74 -3
  363. package/foundation/env/cli-command.d.mts +68 -10
  364. package/foundation/env/cli-command.mjs +116 -22
  365. package/foundation/env/project-scope.d.mts +9 -0
  366. package/foundation/env/project-scope.mjs +28 -2
  367. package/foundation/fs/gather-cache.d.mts +23 -0
  368. package/foundation/fs/gather-cache.mjs +94 -2
  369. package/foundation/fs/module-loader.d.mts +3 -1
  370. package/foundation/fs/module-loader.mjs +85 -5
  371. package/foundation/fs/read-record.mjs +9 -5
  372. package/foundation/identity/package-names.d.mts +18 -0
  373. package/foundation/identity/package-names.mjs +19 -0
  374. package/foundation/identity/providers.mjs +3 -2
  375. package/foundation/integrations/icon-features.d.mts +63 -0
  376. package/foundation/integrations/icon-features.mjs +54 -0
  377. package/foundation/integrations/integrations.d.mts +13 -1
  378. package/foundation/integrations/integrations.mjs +47 -6
  379. package/foundation/integrations/pack-state.d.mts +21 -0
  380. package/foundation/integrations/pack-state.mjs +42 -19
  381. package/foundation/integrations/validate-contributions.d.mts +11 -3
  382. package/foundation/integrations/validate-contributions.mjs +51 -13
  383. package/foundation/release/cache.d.mts +13 -1
  384. package/foundation/release/cache.mjs +94 -14
  385. package/foundation/release/notices.d.mts +15 -0
  386. package/foundation/release/notices.mjs +111 -7
  387. package/foundation/release/project.d.mts +3 -4
  388. package/foundation/release/project.mjs +5 -6
  389. package/foundation/render/client-bundle.d.mts +126 -0
  390. package/foundation/render/client-bundle.mjs +565 -0
  391. package/foundation/render/cut-short.d.mts +7 -1
  392. package/foundation/render/cut-short.mjs +46 -6
  393. package/foundation/render/embedded-imports.d.mts +4 -3
  394. package/foundation/render/embedded-imports.mjs +13 -8
  395. package/foundation/render/esbuild-dependency.d.mts +14 -0
  396. package/foundation/render/esbuild-dependency.mjs +41 -0
  397. package/foundation/render/file-header.mjs +5 -4
  398. package/foundation/render/page-worker.mjs +562 -86
  399. package/foundation/render/picture-chrome.mjs +54 -29
  400. package/foundation/render/picture-playwright.mjs +78 -42
  401. package/foundation/render/picture-window.d.mts +33 -0
  402. package/foundation/render/picture-window.mjs +78 -0
  403. package/foundation/render/render-page.d.mts +55 -4
  404. package/foundation/render/render-page.mjs +199 -28
  405. package/foundation/render/restore-folder.d.mts +13 -0
  406. package/foundation/render/restore-folder.mjs +30 -0
  407. package/foundation/render/served-packages.d.mts +2 -1
  408. package/foundation/render/served-packages.mjs +5 -3
  409. package/foundation/render/ts-paths.d.mts +11 -0
  410. package/foundation/render/ts-paths.mjs +27 -2
  411. package/foundation/render/value-uses.d.mts +43 -0
  412. package/foundation/render/value-uses.mjs +110 -0
  413. package/foundation/response/error-codes.d.mts +2 -1
  414. package/foundation/response/error-codes.doc.mjs +7 -1
  415. package/foundation/response/error-codes.mjs +10 -2
  416. package/foundation/response/response-types.doc.mjs +12 -12
  417. package/foundation/runtime/package-root.d.mts +8 -0
  418. package/foundation/runtime/package-root.mjs +20 -0
  419. package/foundation/suggest/other-command.d.mts +11 -0
  420. package/foundation/suggest/other-command.mjs +1 -1
  421. package/foundation/text/icon-id.d.mts +20 -0
  422. package/foundation/text/icon-id.mjs +40 -0
  423. package/foundation/text/icon-set-next.d.mts +25 -0
  424. package/foundation/text/icon-set-next.mjs +29 -0
  425. package/foundation/xle/browser.d.mts +2 -2
  426. package/package.json +7 -6
@@ -22,22 +22,24 @@ import {
22
22
  requireIconTerm,
23
23
  } from '../_options.mjs';
24
24
  import {DEFAULT_ICON_LIMIT} from '../icon.mjs';
25
- import {rankIconSets} from './search.mjs';
25
+ import {projectLooks, rankIconSets} from './search.mjs';
26
26
 
27
27
  /**
28
- * The part of a set the ranking reads, as plain JSON. Paths into the folder
29
- * the set was read from are left out, so an index reads the same wherever it
30
- * was made.
28
+ * The part of a set the ranking reads, as plain JSON, with the look the
29
+ * folder's project draws it in. Paths into the folder the set was read from
30
+ * are left out, so an index reads the same wherever it was made.
31
31
  * @param {Awaited<ReturnType<typeof loadIconSets>>['sets'][number]} set
32
+ * @param {string | undefined} look
32
33
  * @returns {import('../icon.type.mjs').IconIndexSet}
33
34
  */
34
- function portableSet(set) {
35
+ function portableSet(set, look) {
35
36
  return JSON.parse(
36
37
  JSON.stringify({
37
38
  name: set.name,
38
39
  package: set.package,
39
40
  data: set.data,
40
41
  definitions: (set.definitions ?? []).map(each => ({doc: each.doc})),
42
+ ...(look ? {look} : {}),
41
43
  }),
42
44
  );
43
45
  }
@@ -63,12 +65,15 @@ export async function exportIconIndex(options = {}) {
63
65
  ERROR_CODES.ERR_INVALID_ARGUMENT,
64
66
  );
65
67
  }
66
- const {sets, withdrawn} = await loadIconSets(cwd);
68
+ const {sets, withdrawn, choice} = await loadIconSets(cwd);
69
+ const looks = projectLooks(choice);
67
70
  /** @param {{package: string}} each */
68
71
  const kept = each => owner == null || each.package === owner;
69
72
  return {
70
73
  version: cliVersion(),
71
- sets: sets.filter(kept).map(portableSet),
74
+ sets: sets
75
+ .filter(kept)
76
+ .map(set => portableSet(set, looks[`${set.package}/${set.name}`])),
72
77
  withdrawn: withdrawn
73
78
  .filter(kept)
74
79
  .map(({name, package: pkg, reason}) => ({name, package: pkg, reason})),
@@ -135,5 +140,10 @@ export async function rankIconIndex(query, indexes, options = {}) {
135
140
  const ranked = /** @type {Parameters<typeof rankIconSets>[0]} */ (
136
141
  /** @type {unknown} */ (sets)
137
142
  );
138
- return rankIconSets(ranked, withdrawn, term, {set, limit});
143
+ /** @type {Record<string, string>} */
144
+ const looks = {};
145
+ for (const each of sets) {
146
+ if (each.look) looks[`${each.package}/${each.name}`] = each.look;
147
+ }
148
+ return rankIconSets(ranked, withdrawn, term, {set, limit, looks});
139
149
  }
@@ -22,21 +22,44 @@ export function iconSearch(query: string, { cwd, set, limit }: {
22
22
  set?: string;
23
23
  limit: number;
24
24
  }): Promise<import("../icon.type.mjs").IconSearchResponse>;
25
+ /**
26
+ * The look each set in the project's list draws, by `<package>/<set>`: the
27
+ * look the project picks (`experimental.iconVariant`). Empty when it picks
28
+ * none. A set outside the list draws no project look.
29
+ * @param {import('../../../foundation/discovery/icon-set-discovery.mjs').IconSetChoice} choice
30
+ * @returns {Record<string, string>}
31
+ */
32
+ export function projectLooks(choice: import("../../../foundation/discovery/icon-set-discovery.mjs").IconSetChoice): Record<string, string>;
25
33
  /**
26
34
  * Rank the icons of `sets` against a query: the one ranking behind both
27
- * `icon()` and `rankIconIndex()`.
35
+ * `icon()` and `rankIconIndex()`. Each match's import draws the look `looks`
36
+ * names for its set when its icon has that look. With no set installed, not
37
+ * even a withdrawn one, the answer names the Astryx icon definitions that
38
+ * match, built-in ones first, and how to get a set.
28
39
  * @param {Parameters<typeof rankIcons>[0]} sets in tie order
29
40
  * @param {Array<{name: string, package: string, reason: string}>} withdrawn
30
41
  * @param {string} query
31
- * @param {{set?: string, limit: number}} options
42
+ * @param {{set?: string, limit: number, looks?: Record<string, string>}} options
43
+ * `looks`: the look each set draws, by `<package>/<set>`
32
44
  * @returns {import('../icon.type.mjs').IconSearchResponse}
33
45
  */
34
46
  export function rankIconSets(sets: Parameters<typeof rankIcons>[0], withdrawn: Array<{
35
47
  name: string;
36
48
  package: string;
37
49
  reason: string;
38
- }>, query: string, { set, limit }: {
50
+ }>, query: string, { set, limit, looks }: {
39
51
  set?: string;
40
52
  limit: number;
53
+ looks?: Record<string, string>;
41
54
  }): import("../icon.type.mjs").IconSearchResponse;
55
+ /**
56
+ * The Astryx icon definitions that answer a query, each with its score,
57
+ * ranked as the search ranks a set's icons (FR6).
58
+ * @param {string} query
59
+ * @returns {Array<{doc: import('../../../authoring/doctypes/icon-definition/type').IconDefinitionDoc, score: number}>}
60
+ */
61
+ export function definitionMatches(query: string): Array<{
62
+ doc: import("../../../authoring/doctypes/icon-definition/type").IconDefinitionDoc;
63
+ score: number;
64
+ }>;
42
65
  import { rankIcons } from '../_records.mjs';
@@ -2,14 +2,22 @@
2
2
 
3
3
  /**
4
4
  * @file `icon.search` leaf (AST-084 FR6): find icons by meaning across every
5
- * installed set, ranked, with each match's import line.
5
+ * installed set, ranked, with each match's import line in the project's look.
6
6
  *
7
7
  * @input a query, an optional set selector, and a limit
8
8
  * @output the `icon.search` envelope
9
9
  * @position api/icon/search — dispatched by ../icon.mjs
10
10
  */
11
11
 
12
- import {loadIconSets} from '../_adapter.mjs';
12
+ import {
13
+ astryxIconDefinitions,
14
+ iconLookExport,
15
+ iconSetKey,
16
+ importLine,
17
+ loadIconSets,
18
+ missingIconLook,
19
+ noIconSetNext,
20
+ } from '../_adapter.mjs';
13
21
  import {
14
22
  answeringMatches,
15
23
  oneNamedSet,
@@ -57,26 +65,53 @@ export async function iconSetIcons({cwd, set}) {
57
65
  * @returns {Promise<import('../icon.type.mjs').IconSearchResponse>}
58
66
  */
59
67
  export async function iconSearch(query, {cwd, set, limit}) {
60
- const {sets, withdrawn} = await loadIconSets(cwd);
61
- return rankIconSets(sets, withdrawn, query, {set, limit});
68
+ const {sets, withdrawn, choice} = await loadIconSets(cwd);
69
+ return rankIconSets(sets, withdrawn, query, {
70
+ set,
71
+ limit,
72
+ looks: projectLooks(choice),
73
+ });
74
+ }
75
+
76
+ /**
77
+ * The look each set in the project's list draws, by `<package>/<set>`: the
78
+ * look the project picks (`experimental.iconVariant`). Empty when it picks
79
+ * none. A set outside the list draws no project look.
80
+ * @param {import('../../../foundation/discovery/icon-set-discovery.mjs').IconSetChoice} choice
81
+ * @returns {Record<string, string>}
82
+ */
83
+ export function projectLooks(choice) {
84
+ const variant = choice.variant;
85
+ if (!variant) return {};
86
+ return Object.fromEntries(
87
+ (choice.order ?? []).map(set => [iconSetKey(set), variant]),
88
+ );
62
89
  }
63
90
 
64
91
  /**
65
92
  * Rank the icons of `sets` against a query: the one ranking behind both
66
- * `icon()` and `rankIconIndex()`.
93
+ * `icon()` and `rankIconIndex()`. Each match's import draws the look `looks`
94
+ * names for its set when its icon has that look. With no set installed, not
95
+ * even a withdrawn one, the answer names the Astryx icon definitions that
96
+ * match, built-in ones first, and how to get a set.
67
97
  * @param {Parameters<typeof rankIcons>[0]} sets in tie order
68
98
  * @param {Array<{name: string, package: string, reason: string}>} withdrawn
69
99
  * @param {string} query
70
- * @param {{set?: string, limit: number}} options
100
+ * @param {{set?: string, limit: number, looks?: Record<string, string>}} options
101
+ * `looks`: the look each set draws, by `<package>/<set>`
71
102
  * @returns {import('../icon.type.mjs').IconSearchResponse}
72
103
  */
73
- export function rankIconSets(sets, withdrawn, query, {set, limit}) {
104
+ export function rankIconSets(sets, withdrawn, query, {set, limit, looks = {}}) {
74
105
  let searched = sets;
75
106
  if (set != null) {
76
107
  searched = setsNamed(sets, set);
77
108
  if (searched.length === 0) throw unusableSet(sets, withdrawn, set);
78
109
  }
79
- const ranked = rankIcons(searched, query);
110
+ // A withdrawn set is installed: `--list` says why it cannot be used.
111
+ if (sets.length === 0 && withdrawn.length === 0) {
112
+ return noIconSet(query, limit);
113
+ }
114
+ const ranked = rankIcons(searched, query, {words: true});
80
115
  // A word start (`start` for `star`) answers only when nothing matches a
81
116
  // whole word, and a partial match (`pin` inside `shopping`) only when
82
117
  // nothing matches a whole word or a word start.
@@ -86,7 +121,118 @@ export function rankIconSets(sets, withdrawn, query, {set, limit}) {
86
121
  data: {
87
122
  query: query.trim(),
88
123
  matchCount: matches.length,
89
- matches: matches.slice(0, limit),
124
+ matches: matches
125
+ .slice(0, limit)
126
+ .map(match => inLook(match, searched, looks)),
127
+ },
128
+ };
129
+ }
130
+
131
+ /**
132
+ * A match drawn in its set's look: its export and import name the icon's
133
+ * variant of that look, or keep its own export with `look` saying which
134
+ * look it draws instead. A match whose set draws no look stays as it is.
135
+ * @param {import('../icon.type.mjs').IconMatchEntry} match
136
+ * @param {Parameters<typeof rankIcons>[0]} sets
137
+ * @param {Record<string, string>} looks
138
+ * @returns {import('../icon.type.mjs').IconMatchEntry}
139
+ */
140
+ function inLook(match, sets, looks) {
141
+ const variant = looks[`${match.package}/${match.set}`];
142
+ if (!variant) return match;
143
+ const set = sets.find(
144
+ each => each.package === match.package && each.name === match.set,
145
+ );
146
+ const icon = set?.data.icons.find(each => each.id === match.id);
147
+ if (!set || !icon) return match;
148
+ const drawn = iconLookExport(icon, set, variant);
149
+ const look = missingIconLook(icon, set, variant);
150
+ return {
151
+ ...match,
152
+ module: drawn.module,
153
+ export: drawn.export,
154
+ import: importLine(drawn.export, drawn.module),
155
+ ...(look ? {look} : {}),
156
+ };
157
+ }
158
+ /**
159
+ * The answer when no icon set is installed: no icon matches, so it names
160
+ * the Astryx icon definitions that do, built-in ones first (Core draws those
161
+ * by name with no set), and how to get a set.
162
+ * @param {string} query
163
+ * @param {number} limit
164
+ * @returns {import('../icon.type.mjs').IconSearchResponse}
165
+ */
166
+ function noIconSet(query, limit) {
167
+ const found = definitionMatches(query).map(match => match.doc);
168
+ const ordered = [
169
+ ...found.filter(doc => doc.builtIn),
170
+ ...found.filter(doc => !doc.builtIn),
171
+ ];
172
+ return {
173
+ type: 'icon.search',
174
+ data: {
175
+ query: query.trim(),
176
+ matchCount: 0,
177
+ matches: [],
178
+ reason: 'No icon set is installed.',
179
+ definitions: ordered.slice(0, limit).map(doc => ({
180
+ name: doc.name,
181
+ builtIn: doc.builtIn === true,
182
+ description: doc.description,
183
+ })),
184
+ next: noIconSetNext(),
90
185
  },
91
186
  };
92
187
  }
188
+
189
+ /**
190
+ * The Astryx icon definitions that answer a query, each with its score,
191
+ * ranked as the search ranks a set's icons (FR6).
192
+ * @param {string} query
193
+ * @returns {Array<{doc: import('../../../authoring/doctypes/icon-definition/type').IconDefinitionDoc, score: number}>}
194
+ */
195
+ export function definitionMatches(query) {
196
+ const docs = astryxIconDefinitions().definitions.map(each => each.doc);
197
+ const byId = new Map(docs.map(doc => [definitionId(doc.name), doc]));
198
+ return answeringMatches(
199
+ rankIcons([definitionSet(docs)], query, {words: true}),
200
+ ).map(match => ({
201
+ doc: /** @type {(typeof docs)[number]} */ (byId.get(match.id)),
202
+ score: match.score,
203
+ }));
204
+ }
205
+
206
+ /**
207
+ * A definition's name as an icon id: `chevronDown` is `chevron-down`.
208
+ * @param {string} name
209
+ */
210
+ const definitionId = name =>
211
+ name.replace(/([a-z0-9])([A-Z])/gu, '$1-$2').toLowerCase();
212
+
213
+ /**
214
+ * Astryx's icon definitions read as one set whose `map` names one icon for
215
+ * each definition, so the icon ranking finds a definition by its name, its
216
+ * name as words, and its own words, exactly as it finds a set's icon.
217
+ * @param {import('../../../authoring/doctypes/icon-definition/type').IconDefinitionDoc[]} docs
218
+ * @returns {import('../../../foundation/discovery/icon-set-discovery.mjs').DiscoveredIconSet}
219
+ */
220
+ function definitionSet(docs) {
221
+ return /** @type {any} */ ({
222
+ name: 'definitions',
223
+ package: '@astryxdesign/cli',
224
+ definitions: [],
225
+ data: {
226
+ schemaVersion: 1,
227
+ module: '@astryxdesign/cli',
228
+ map: Object.fromEntries(
229
+ docs.map(doc => [doc.name, definitionId(doc.name)]),
230
+ ),
231
+ icons: docs.map(doc => ({
232
+ id: definitionId(doc.name),
233
+ export: doc.name,
234
+ words: [],
235
+ })),
236
+ },
237
+ });
238
+ }
@@ -16,7 +16,21 @@ export function applyComputerAgentText({ remove }: {
16
16
  files: import("./init.type.mjs").InitUserFile[];
17
17
  cliOnSearchPath: boolean;
18
18
  };
19
+ /**
20
+ * The install step to print for `packages` in the project at `cwd`: the
21
+ * install guidance its integrations give, else its package manager's command,
22
+ * or `npm install` with a note when its lockfiles disagree.
23
+ * @param {string[]} packages
24
+ * @param {string} cwd
25
+ * @returns {{line: string, note: string | null}}
26
+ */
27
+ export function projectInstallStep(packages: string[], cwd: string): {
28
+ line: string;
29
+ note: string | null;
30
+ };
31
+ export { STARTER_THEME } from "../../foundation/discovery/theme-discovery.mjs";
19
32
  import { COMPUTER_COMMAND } from '../../foundation/agent-docs/computer-agent-text.mjs';
20
33
  import { COMPUTER_INSTALL_STEP } from '../../foundation/agent-docs/computer-agent-text.mjs';
21
34
  import { displayHomePath } from '../../foundation/agent-docs/computer-agent-text.mjs';
22
35
  export { COMPUTER_COMMAND, COMPUTER_INSTALL_STEP, displayHomePath };
36
+ export { inspectAgentDocs, resolveAgentPaths } from "../../foundation/agent-docs/agent-docs.mjs";
@@ -1,14 +1,15 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file Environment adapter for `init --user`: the home folder, the settings
5
- * file, the per-user state, and the search path (spec AST-081 FR7, FR8;
6
- * architecture:cli-surface INV21).
4
+ * @file Environment adapter for init: for `init --user`, the home folder, the
5
+ * settings file, the per-user state, and the search path (spec AST-081 FR7,
6
+ * FR8); for the getting-started steps, the project's install command
7
+ * (architecture:cli-surface INV21).
7
8
  *
8
9
  * @input the home folder, the settings file, the search path
9
10
  * @output the computer-level agent text written or removed, with the setting
10
11
  * and the links recorded
11
- * @position packages/cli/api/init — imported by the user leaf only
12
+ * @position packages/cli/api/init — imported by the user and run leaves
12
13
  */
13
14
 
14
15
  import * as os from 'node:os';
@@ -27,9 +28,18 @@ import {
27
28
  } from '../../foundation/env/user-settings.mjs';
28
29
  import {recordAgentTextWritten} from '../../foundation/release/global-state.mjs';
29
30
  import {cliVersion} from '../../foundation/release/run-context.mjs';
31
+ import {installStepFor} from '../../foundation/discovery/template-needs.mjs';
32
+ export {STARTER_THEME} from '../../foundation/discovery/theme-discovery.mjs';
30
33
 
31
34
  export {COMPUTER_COMMAND, COMPUTER_INSTALL_STEP, displayHomePath};
32
35
 
36
+ // What the run leaf reads before it writes agent docs: the state of the files
37
+ // it is about to write.
38
+ export {
39
+ inspectAgentDocs,
40
+ resolveAgentPaths,
41
+ } from '../../foundation/agent-docs/agent-docs.mjs';
42
+
33
43
  /**
34
44
  * Write or refresh the computer-level agent text, or remove it, and record
35
45
  * the setting and the links Astryx made; after a write, record the release
@@ -57,3 +67,15 @@ export function applyComputerAgentText({remove}) {
57
67
  }
58
68
  return {home, command, files, cliOnSearchPath: astryxOnSearchPath()};
59
69
  }
70
+
71
+ /**
72
+ * The install step to print for `packages` in the project at `cwd`: the
73
+ * install guidance its integrations give, else its package manager's command,
74
+ * or `npm install` with a note when its lockfiles disagree.
75
+ * @param {string[]} packages
76
+ * @param {string} cwd
77
+ * @returns {{line: string, note: string | null}}
78
+ */
79
+ export function projectInstallStep(packages, cwd) {
80
+ return installStepFor(packages, cwd);
81
+ }
@@ -24,7 +24,6 @@
24
24
  export function init(options?: InitOptions, { cwd }?: {
25
25
  cwd?: string;
26
26
  }): Promise<import("./init.type.mjs").InitRunResponse | import("./init.type.mjs").InitRemoveResponse | import("./init.type.mjs").InitUserResponse>;
27
- export { getNextSteps } from "./run/run.mjs";
28
27
  /**
29
28
  * Re-exported types so callers can keep referencing them off the init barrel
30
29
  * (e.g. cli/commands/init.mjs uses `import('../../api/init/init.mjs').InitOptions`).
@@ -37,3 +36,4 @@ export type InitOptions = import("./init.type.mjs").InitOptions;
37
36
  * The canonical shapes stay colocated in api/init/init.type.mjs.
38
37
  */
39
38
  export type InitRunData = import("./init.type.mjs").InitRunData;
39
+ export { getNextSteps, getWorkflowSteps } from "./run/run.mjs";
@@ -30,7 +30,7 @@ export const doc = {
30
30
  'counts as a project, even with a package.json; a folder below it with a package.json does. ' +
31
31
  'The managed block is Astryx-owned: it is written, refreshed, and removed whatever ignore rules ' +
32
32
  'or generated markers say, and the text around it is never changed. It then ' +
33
- "prints getting-started guidance; `features` / `all` print only the chosen features' " +
33
+ "prints getting-started guidance (the build and search commands instead when every agent-docs block was already current, since the app is set up; an outdated block is still refreshed); `features` / `all` print only the chosen features' " +
34
34
  'guidance instead (the theme feature also writes the annotated theme template). ' +
35
35
  'With `removeAgents` it removes the managed agent-docs block, at the project root and in `ctx.cwd`, instead of installing. ' +
36
36
  'Outside a project it writes the same files but prints no getting-started steps and no step that adds a theme to an app, since those set up a project the folder does not have. ' +
@@ -100,7 +100,7 @@ export const doc = {
100
100
  {
101
101
  type: 'init.run',
102
102
  description:
103
- 'The install receipt: the `mode` (`default` | `features`), the features run, agent-doc files written, any soft docsError, the theme-template outcome (`created` | `skipped` | `failed`) plus its path, the page-template outcome (`workflow` | `created` | `skipped`) plus its path, and whether the next-steps were emitted (never outside a project).',
103
+ 'The install receipt: the `mode` (`default` | `features`), the features run, agent-doc files written, `agentDocsStatus` (the agent docs before the write: `missing` | `stale` | `current`; null when agent docs were not installed or the write failed), what changed in each (`docsChanges`: `{path, change, from, to}`, change `created` | `updated` | `unchanged` | `removed`, from and to the Astryx versions the block names, path relative to the project root), any soft docsError, the theme-template outcome (`created` | `skipped` | `failed`) plus its path, the page-template outcome (`workflow` | `created` | `skipped`) plus its path, and whether the next-steps were emitted (never outside a project, and not when `agentDocsStatus` was `current`: a set-up app gets the build and search commands instead).',
104
104
  },
105
105
  {
106
106
  type: 'init.remove',
package/api/init/init.mjs CHANGED
@@ -25,7 +25,7 @@ import {user} from './user/user.mjs';
25
25
  import {AstryxError} from '../error.mjs';
26
26
  import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
27
27
 
28
- export {getNextSteps} from './run/run.mjs';
28
+ export {getNextSteps, getWorkflowSteps} from './run/run.mjs';
29
29
 
30
30
  /**
31
31
  * Re-exported types so callers can keep referencing them off the init barrel
@@ -1,6 +1,26 @@
1
1
  // @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
2
2
  // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
3
 
4
+ /**
5
+ * What init did to one agent-doc file. `created`: the file did not exist.
6
+ * `updated`: its text changed. `unchanged`: it already held this text.
7
+ * `removed`: its Astryx block was removed, because another file holds it.
8
+ */
9
+ export type InitDocsChange = {
10
+ /**
11
+ * The file, relative to the project root (the folder init writes agent docs in), `--agent-docs-path` files included. Never absolute.
12
+ */
13
+ path: string;
14
+ change: "created" | "updated" | "unchanged" | "removed";
15
+ /**
16
+ * The Astryx version the block named before; null on `created`, and when there was no block or no version line.
17
+ */
18
+ from: string | null;
19
+ /**
20
+ * The Astryx version the block names now; null on `removed`, and when there is no block (such as an import of AGENTS.md).
21
+ */
22
+ to: string | null;
23
+ };
4
24
  export type InitRunData = {
5
25
  /**
6
26
  * `default` (no flags) or `features` (--features/--all).
@@ -14,6 +34,14 @@ export type InitRunData = {
14
34
  * Agent-doc files written, relative to the directory init ran in (empty if agents weren't run or install failed). Without --agent-docs-path they sit at the project root: the nearest folder at or above it whose package.json declares an Astryx package, else the nearest with any package.json, within its repository and never the home folder; with none, the directory init ran in.
15
35
  */
16
36
  docsWritten: string[];
37
+ /**
38
+ * The agent docs init writes, before this run: `missing` (no Astryx block), `stale` (a block from another release or with other text, or with `--agent-docs-path` a named file without the block), or `current` (every block already matches); null when agent docs were not installed or the write failed.
39
+ */
40
+ agentDocsStatus: "missing" | "stale" | "current" | null;
41
+ /**
42
+ * What init did to each file in `docsWritten`, in the same order; each path is relative to the project root.
43
+ */
44
+ docsChanges: InitDocsChange[];
17
45
  /**
18
46
  * Soft agent-docs failure, if any. `path-safety` also implies a non-zero exit. `install-failed` carries a message when init wrote no agent docs (the home folder, or a settings folder in it outside a project) or skipped a file that resolves outside the project; docsWritten then lists what was written.
19
47
  */
@@ -42,7 +70,7 @@ export type InitRunData = {
42
70
  */
43
71
  templatePath: string | null;
44
72
  /**
45
- * Whether the getting-started "Next steps" were emitted (default mode inside a project; false outside one).
73
+ * Whether the getting-started "Next steps" were emitted (default mode inside a project; false outside one, and false when `agentDocsStatus` is `current`, where init prints the build and search commands instead).
46
74
  */
47
75
  nextSteps: boolean;
48
76
  };
@@ -6,18 +6,31 @@
6
6
  * `./api` type surface regenerates from this JSDoc.
7
7
  */
8
8
 
9
+ /**
10
+ * What init did to one agent-doc file. `created`: the file did not exist.
11
+ * `updated`: its text changed. `unchanged`: it already held this text.
12
+ * `removed`: its Astryx block was removed, because another file holds it.
13
+ * @typedef {object} InitDocsChange
14
+ * @property {string} path The file, relative to the project root (the folder init writes agent docs in), `--agent-docs-path` files included. Never absolute.
15
+ * @property {'created' | 'updated' | 'unchanged' | 'removed'} change
16
+ * @property {string | null} from The Astryx version the block named before; null on `created`, and when there was no block or no version line.
17
+ * @property {string | null} to The Astryx version the block names now; null on `removed`, and when there is no block (such as an import of AGENTS.md).
18
+ */
19
+
9
20
  /**
10
21
  * @typedef {object} InitRunData
11
22
  * @property {'default' | 'features'} mode `default` (no flags) or `features` (--features/--all).
12
23
  * @property {string[]} features Features that were run, in order.
13
24
  * @property {string[]} docsWritten Agent-doc files written, relative to the directory init ran in (empty if agents weren't run or install failed). Without --agent-docs-path they sit at the project root: the nearest folder at or above it whose package.json declares an Astryx package, else the nearest with any package.json, within its repository and never the home folder; with none, the directory init ran in.
25
+ * @property {'missing' | 'stale' | 'current' | null} agentDocsStatus The agent docs init writes, before this run: `missing` (no Astryx block), `stale` (a block from another release or with other text, or with `--agent-docs-path` a named file without the block), or `current` (every block already matches); null when agent docs were not installed or the write failed.
26
+ * @property {InitDocsChange[]} docsChanges What init did to each file in `docsWritten`, in the same order; each path is relative to the project root.
14
27
  * @property {{kind: 'path-safety' | 'install-failed', message?: string} | null} docsError Soft agent-docs failure, if any. `path-safety` also implies a non-zero exit. `install-failed` carries a message when init wrote no agent docs (the home folder, or a settings folder in it outside a project) or skipped a file that resolves outside the project; docsWritten then lists what was written.
15
28
  * @property {boolean} theme Whether the theme feature ran.
16
29
  * @property {'created' | 'skipped' | 'failed' | null} themeTemplate Outcome of writing the annotated theme template (`skipped` = a file was already there).
17
30
  * @property {string | null} themeTemplatePath Relative output path when `themeTemplate === 'created'`.
18
31
  * @property {'workflow' | 'created' | 'skipped' | null} template Template outcome (`workflow` is the CLI default; `created`/`skipped` are programmatic).
19
32
  * @property {string | null} templatePath Relative output path when `template === 'created'`.
20
- * @property {boolean} nextSteps Whether the getting-started "Next steps" were emitted (default mode inside a project; false outside one).
33
+ * @property {boolean} nextSteps Whether the getting-started "Next steps" were emitted (default mode inside a project; false outside one, and false when `agentDocsStatus` is `current`, where init prints the build and search commands instead).
21
34
  */
22
35
 
23
36
  /**
@@ -9,9 +9,19 @@
9
9
  * app imports that module once and passes its default to <Theme>.
10
10
  *
11
11
  * @param {string} invocation install-aware CLI invocation stem (e.g. `pnpm exec astryx`, `yarn astryx`, or `npx @astryxdesign/cli` for one-off runs)
12
+ * @param {string} [cwd] the project folder; its integrations' install guidance, else its package manager, names the theme install step
12
13
  * @returns {string[]} ordered list of human-facing lines
13
14
  */
14
- export function getNextSteps(invocation: string): string[];
15
+ export function getNextSteps(invocation: string, cwd?: string): string[];
16
+ /**
17
+ * The lines printed instead of "Next steps" when the project's agent files
18
+ * already held the Astryx block: the app is set up, so it needs the commands
19
+ * to build with, not the install steps.
20
+ *
21
+ * @param {string} invocation install-aware CLI invocation stem
22
+ * @returns {string[]} ordered list of human-facing lines
23
+ */
24
+ export function getWorkflowSteps(invocation: string): string[];
15
25
  /**
16
26
  * Run the install path of the non-interactive init flow (the default no-flags
17
27
  * install plus `--features` / `--all`). Performs the side effects (agent-docs