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

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 (653) hide show
  1. package/README.md +14 -9
  2. package/api/build/_adapter.d.mts +33 -4
  3. package/api/build/_adapter.mjs +43 -8
  4. package/api/build/blocks/blocks.d.mts +1 -0
  5. package/api/build/blocks/blocks.mjs +2 -1
  6. package/api/build/blocks/blocks.weights.json +1 -1
  7. package/api/build/build.doc.mjs +2 -2
  8. package/api/build/build.type.d.mts +13 -1
  9. package/api/build/build.type.mjs +6 -3
  10. package/api/build/kit/kind.d.mts +6 -0
  11. package/api/build/kit/kind.mjs +1 -1
  12. package/api/build/kit/kit.mjs +3 -3
  13. package/api/build/kit/rank.d.mts +9 -3
  14. package/api/build/kit/rank.mjs +21 -8
  15. package/api/build/kit/signals.d.mts +7 -1
  16. package/api/build/kit/signals.mjs +124 -41
  17. package/api/build/kit/start.d.mts +20 -5
  18. package/api/build/kit/start.mjs +103 -23
  19. package/api/build/kit/weights.d.mts +20 -4
  20. package/api/build/kit/weights.json +1 -1
  21. package/api/build/kit/weights.mjs +68 -18
  22. package/api/build/kit/words.d.mts +44 -2
  23. package/api/build/kit/words.mjs +159 -4
  24. package/api/build/tree.mjs +1 -1
  25. package/api/component/__fixtures__/resolutions/modules.txt +4 -4
  26. package/api/component/_adapter.d.mts +51 -20
  27. package/api/component/_adapter.mjs +198 -29
  28. package/api/component/component.mjs +18 -5
  29. package/api/component/component.type.d.mts +4 -0
  30. package/api/component/component.type.mjs +1 -0
  31. package/api/component/detail/blocks/blocks.mjs +1 -0
  32. package/api/component/detail/detail.d.mts +2 -2
  33. package/api/component/detail/detail.mjs +1 -1
  34. package/api/component/list/list.d.mts +2 -2
  35. package/api/component/list/list.mjs +4 -4
  36. package/api/discover/_adapter.d.mts +10 -0
  37. package/api/discover/_adapter.mjs +110 -16
  38. package/api/discover/detail/item/item.mjs +5 -0
  39. package/api/discover/discover.mjs +12 -3
  40. package/api/discover/discover.type.d.mts +16 -3
  41. package/api/discover/discover.type.mjs +13 -3
  42. package/api/docs/_adapter.d.mts +74 -30
  43. package/api/docs/_adapter.mjs +488 -234
  44. package/api/docs/_entry-names-lazily.d.mts +22 -0
  45. package/api/docs/_entry-names-lazily.mjs +25 -0
  46. package/api/docs/_entry-names.d.mts +23 -0
  47. package/api/docs/_entry-names.mjs +105 -0
  48. package/api/doctor/_adapter.d.mts +63 -2
  49. package/api/doctor/_adapter.mjs +141 -5
  50. package/api/doctor/doctor.d.mts +11 -0
  51. package/api/doctor/doctor.doc.mjs +1 -1
  52. package/api/doctor/doctor.mjs +81 -30
  53. package/api/doctor/theme-checks.d.mts +35 -3
  54. package/api/doctor/theme-checks.mjs +449 -99
  55. package/api/error.d.mts +4 -3
  56. package/api/error.mjs +3 -2
  57. package/api/hook/_adapter.d.mts +14 -7
  58. package/api/hook/_adapter.mjs +46 -9
  59. package/api/hook/detail/detail.mjs +5 -2
  60. package/api/hook/detail/params/params.mjs +10 -3
  61. package/api/icon/_options.d.mts +17 -0
  62. package/api/icon/_options.mjs +54 -0
  63. package/api/icon/exportIconIndex.doc.d.mts +10 -0
  64. package/api/icon/exportIconIndex.doc.mjs +59 -0
  65. package/api/icon/icon.mjs +11 -34
  66. package/api/icon/icon.type.d.mts +49 -0
  67. package/api/icon/icon.type.mjs +24 -0
  68. package/api/icon/rankIconIndex.doc.d.mts +10 -0
  69. package/api/icon/rankIconIndex.doc.mjs +79 -0
  70. package/api/icon/search/icon-index.d.mts +41 -0
  71. package/api/icon/search/icon-index.mjs +139 -0
  72. package/api/icon/search/search.d.mts +18 -0
  73. package/api/icon/search/search.mjs +13 -0
  74. package/api/index.d.mts +1 -0
  75. package/api/index.mjs +1 -0
  76. package/api/integration/add-helpers.mjs +10 -0
  77. package/api/integration/authoring-checks.mjs +5 -2
  78. package/api/integration/check/check.mjs +6 -1
  79. package/api/integration/pack-check.mjs +50 -3
  80. package/api/integration/validate-integration.d.mts +18 -6
  81. package/api/integration/validate-integration.mjs +110 -14
  82. package/api/integration/validate-integration.type.d.mts +13 -0
  83. package/api/integration/validate-integration.type.mjs +2 -1
  84. package/api/integration/validateIntegration.doc.mjs +1 -1
  85. package/api/render/render.type.d.mts +1 -1
  86. package/api/render/render.type.mjs +1 -1
  87. package/api/search/ORDERING.md +1 -1
  88. package/api/search/_adapter.d.mts +8 -5
  89. package/api/search/_adapter.mjs +14 -10
  90. package/api/search/_candidate-score.d.mts +9 -4
  91. package/api/search/_candidate-score.mjs +82 -14
  92. package/api/search/_gather-components.d.mts +4 -4
  93. package/api/search/_gather-components.mjs +4 -3
  94. package/api/search/_gather-hooks.d.mts +2 -2
  95. package/api/search/_gather-hooks.mjs +1 -1
  96. package/api/search/_gather-templates.mjs +1 -0
  97. package/api/search/_lexical.d.mts +16 -0
  98. package/api/search/_lexical.mjs +98 -10
  99. package/api/search/_priority.d.mts +10 -2
  100. package/api/search/_priority.mjs +37 -7
  101. package/api/search/_result.d.mts +1 -0
  102. package/api/search/_result.mjs +1 -0
  103. package/api/search/_score.d.mts +12 -3
  104. package/api/search/_score.mjs +6 -3
  105. package/api/search/_words.mjs +12 -3
  106. package/api/search/search.d.mts +7 -1
  107. package/api/search/search.doc.mjs +1 -1
  108. package/api/search/search.mjs +37 -4
  109. package/api/search/search.type.d.mts +4 -0
  110. package/api/search/search.type.mjs +1 -0
  111. package/api/swizzle/_adapter.d.mts +7 -5
  112. package/api/swizzle/_adapter.mjs +22 -6
  113. package/api/swizzle/copy/copy.mjs +5 -4
  114. package/api/template/_adapter.d.mts +16 -0
  115. package/api/template/_adapter.mjs +39 -2
  116. package/api/template/cdn/cdn.mjs +37 -8
  117. package/api/template/copy/copy.d.mts +6 -3
  118. package/api/template/copy/copy.mjs +83 -8
  119. package/api/template/show/show.mjs +1 -0
  120. package/api/template/skeleton/skeleton.mjs +1 -0
  121. package/api/template/template.doc.mjs +5 -5
  122. package/api/template/template.mjs +63 -11
  123. package/api/template/template.type.d.mts +4 -0
  124. package/api/template/template.type.mjs +5 -1
  125. package/api/theme/_adapter.d.mts +20 -1
  126. package/api/theme/_adapter.mjs +149 -12
  127. package/api/theme/_app-provider.d.mts +31 -0
  128. package/api/theme/_app-provider.mjs +135 -0
  129. package/api/theme/add/add.mjs +3 -1
  130. package/api/theme/build/build.d.mts +127 -11
  131. package/api/theme/build/build.mjs +2047 -352
  132. package/api/theme/build/core-interception.d.mts +10 -0
  133. package/api/theme/build/core-interception.mjs +10 -0
  134. package/api/theme/build/family.mjs +61 -21
  135. package/api/theme/build/font-warning.d.mts +99 -5
  136. package/api/theme/build/font-warning.mjs +379 -61
  137. package/api/theme/build/icon-imports.mjs +83 -15
  138. package/api/theme/build/input-fields.d.mts +110 -0
  139. package/api/theme/build/input-fields.mjs +667 -0
  140. package/api/theme/build/null-values.d.mts +42 -0
  141. package/api/theme/build/null-values.mjs +283 -0
  142. package/api/theme/build/self-contained.d.mts +90 -0
  143. package/api/theme/build/self-contained.mjs +380 -0
  144. package/api/theme/build/source-syntax.d.mts +11 -0
  145. package/api/theme/build/source-syntax.mjs +28 -0
  146. package/api/theme/build/style-keys.d.mts +72 -0
  147. package/api/theme/build/style-keys.mjs +589 -0
  148. package/api/theme/build/typography-values.d.mts +61 -0
  149. package/api/theme/build/typography-values.mjs +408 -0
  150. package/api/theme/build/written-values.d.mts +78 -0
  151. package/api/theme/build/written-values.mjs +482 -0
  152. package/api/theme/generateTonalPalette.doc.mjs +1 -1
  153. package/api/theme/list/list.mjs +17 -1
  154. package/api/theme/palette/generate/generator.d.mts +14 -2
  155. package/api/theme/palette/generate/generator.mjs +94 -8
  156. package/api/theme/remove/remove.d.mts +2 -1
  157. package/api/theme/remove/remove.mjs +7 -3
  158. package/api/theme/theme.type.d.mts +89 -5
  159. package/api/theme/theme.type.mjs +46 -7
  160. package/api/theme/themeAdd.doc.mjs +1 -1
  161. package/api/theme/themeBuild.doc.mjs +1 -1
  162. package/api/theme/themeListAvailable.doc.mjs +1 -1
  163. package/api/theme/themePaletteGenerate.doc.mjs +1 -1
  164. package/api/theme/themeRemove.doc.mjs +8 -5
  165. package/api/theme/themeTemplate.doc.mjs +18 -3
  166. package/api/theme-edit/_adapter.d.mts +57 -4
  167. package/api/theme-edit/_adapter.mjs +380 -73
  168. package/api/theme-edit/_catalog.d.mts +82 -4
  169. package/api/theme-edit/_catalog.mjs +397 -24
  170. package/api/theme-edit/_check.d.mts +153 -2
  171. package/api/theme-edit/_check.mjs +3028 -563
  172. package/api/theme-edit/_color.d.mts +27 -2
  173. package/api/theme-edit/_color.mjs +66 -8
  174. package/api/theme-edit/_compiler.d.mts +7 -2
  175. package/api/theme-edit/_compiler.mjs +335 -21
  176. package/api/theme-edit/_context.d.mts +192 -7
  177. package/api/theme-edit/_context.mjs +750 -70
  178. package/api/theme-edit/_css.d.mts +32 -0
  179. package/api/theme-edit/_css.mjs +121 -34
  180. package/api/theme-edit/_edit.d.mts +68 -5
  181. package/api/theme-edit/_edit.mjs +5119 -667
  182. package/api/theme-edit/_how-commands.d.mts +28 -1
  183. package/api/theme-edit/_how-commands.mjs +621 -17
  184. package/api/theme-edit/_how-question.d.mts +101 -9
  185. package/api/theme-edit/_how-question.mjs +13901 -1282
  186. package/api/theme-edit/_how.d.mts +13 -2
  187. package/api/theme-edit/_how.mjs +389 -32
  188. package/api/theme-edit/_importers.d.mts +38 -0
  189. package/api/theme-edit/_importers.mjs +188 -0
  190. package/api/theme-edit/_missed.d.mts +54 -0
  191. package/api/theme-edit/_missed.mjs +917 -0
  192. package/api/theme-edit/_normal.d.mts +110 -21
  193. package/api/theme-edit/_normal.mjs +700 -105
  194. package/api/theme-edit/_palette.d.mts +77 -0
  195. package/api/theme-edit/_palette.mjs +364 -73
  196. package/api/theme-edit/_part-words.d.mts +39 -0
  197. package/api/theme-edit/_part-words.mjs +191 -0
  198. package/api/theme-edit/_parts.d.mts +74 -4
  199. package/api/theme-edit/_parts.mjs +677 -73
  200. package/api/theme-edit/_preview-app.d.mts +8 -13
  201. package/api/theme-edit/_preview-app.mjs +1189 -559
  202. package/api/theme-edit/_preview.d.mts +151 -10
  203. package/api/theme-edit/_preview.mjs +785 -98
  204. package/api/theme-edit/_project.d.mts +38 -3
  205. package/api/theme-edit/_project.mjs +135 -8
  206. package/api/theme-edit/_settings.d.mts +678 -83
  207. package/api/theme-edit/_settings.mjs +6037 -1051
  208. package/api/theme-edit/_tables.d.mts +43 -3
  209. package/api/theme-edit/_tables.mjs +244 -59
  210. package/api/theme-edit/_vet.d.mts +14 -1
  211. package/api/theme-edit/_vet.mjs +86 -12
  212. package/api/theme-edit/theme-edit.type.d.mts +53 -3
  213. package/api/theme-edit/theme-edit.type.mjs +23 -5
  214. package/api/theme-edit/themeEditPreviewApp.doc.mjs +1 -1
  215. package/api/upgrade/_adapter.mjs +13 -2
  216. package/api/upgrade/upgrade.mjs +16 -1
  217. package/assets/codemods/integration-runner.mjs +1 -1
  218. package/assets/codemods/jscodeshift.d.ts +1 -1
  219. package/assets/codemods/parse.mjs +2 -2
  220. package/assets/codemods/run-codemod.mjs +71 -18
  221. package/assets/codemods/runner.mjs +1 -4
  222. package/assets/component-list.generated.json +1 -1
  223. package/assets/docs/author-a-theme.doc.mjs +1 -0
  224. package/assets/docs/theme.doc.dense.mjs +86 -7
  225. package/assets/docs/theme.doc.mjs +76 -2
  226. package/assets/docs/theme.doc.zh.mjs +61 -1
  227. package/assets/docs/tree/authoring.doc.mjs +1 -0
  228. package/assets/docs/tree/checks.doc.mjs +2 -2
  229. package/assets/docs/tree/cli.doc.mjs +1 -0
  230. package/assets/docs/tree/computer-agent-guide.doc.mjs +1 -1
  231. package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
  232. package/assets/docs/tree/font-setup.doc.mjs +1 -1
  233. package/assets/docs/tree/fonts-and-assets.doc.mjs +1 -1
  234. package/assets/docs/tree/generate-a-palette.doc.mjs +2 -2
  235. package/assets/docs/tree/global.doc.mjs +1 -0
  236. package/assets/docs/tree/install-once.doc.mjs +1 -1
  237. package/assets/docs/tree/problems.doc.mjs +1 -1
  238. package/assets/docs/tree/render-pages.doc.mjs +2 -2
  239. package/assets/docs/tree/share-a-page.doc.mjs +162 -0
  240. package/assets/docs/tree/single-component.doc.mjs +40 -2
  241. package/assets/docs/tree/updates.doc.mjs +1 -1
  242. package/assets/docs/tree/who-answers.doc.mjs +3 -3
  243. package/assets/docs/tree/write-good-templates.doc.mjs +1 -1
  244. package/assets/docs/use-a-theme.doc.mjs +1 -1
  245. package/assets/docs-routes.generated.json +1 -0
  246. package/assets/docs.generated.json +2 -2
  247. package/assets/search-catalog.generated.json +2 -2
  248. package/assets/self-audit.generated.json +1 -1
  249. package/assets/templates/blocks/components/Blockquote/BlockquoteShowcase.tsx +1 -1
  250. package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.tsx +4 -4
  251. package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsCustomSeparator.tsx +1 -0
  252. package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsSupportingVariant.tsx +2 -2
  253. package/assets/templates/blocks/components/Card/CardElevations.tsx +1 -1
  254. package/assets/templates/blocks/components/Card/CardWithInnerLayout.tsx +19 -3
  255. package/assets/templates/blocks/components/Card/ClickableCardWithNestedButton.tsx +11 -1
  256. package/assets/templates/blocks/components/Card/SelectableCardElevated.tsx +1 -1
  257. package/assets/templates/blocks/components/Card/SelectableCardMulti.tsx +1 -1
  258. package/assets/templates/blocks/components/Center/CenterHorizontal.tsx +1 -1
  259. package/assets/templates/blocks/components/Center/CenterInsideACard.tsx +1 -1
  260. package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsx +8 -0
  261. package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsx +8 -2
  262. package/assets/templates/blocks/components/ChatComposerInput/useChatPasteAsTokenHookUsage.doc.mjs +14 -0
  263. package/assets/templates/blocks/components/ChatComposerInput/useChatPasteAsTokenHookUsage.tsx +32 -0
  264. package/assets/templates/blocks/components/ChatComposerInput/useSpeechRecognitionHookUsage.doc.mjs +14 -0
  265. package/assets/templates/blocks/components/ChatComposerInput/useSpeechRecognitionHookUsage.tsx +43 -0
  266. package/assets/templates/blocks/components/ChatLayout/ChatLayoutPanelChat.tsx +1 -0
  267. package/assets/templates/blocks/components/ChatLayout/ChatLayoutShowcase.tsx +1 -1
  268. package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleCustomContent.tsx +9 -1
  269. package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx +12 -2
  270. package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.tsx +28 -7
  271. package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +35 -7
  272. package/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx +1 -1
  273. package/assets/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupBasic.tsx +20 -4
  274. package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.tsx +15 -3
  275. package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.tsx +29 -6
  276. package/assets/templates/blocks/components/ContextMenu/ContextMenuBasic.tsx +2 -2
  277. package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.tsx +1 -1
  278. package/assets/templates/blocks/components/ContextMenu/ContextMenuShowcase.tsx +2 -2
  279. package/assets/templates/blocks/components/Divider/DividerFullBleed.tsx +1 -1
  280. package/assets/templates/blocks/components/Divider/DividerShowcase.tsx +1 -1
  281. package/assets/templates/blocks/components/Divider/DividerVariants.tsx +1 -1
  282. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +23 -4
  283. package/assets/templates/blocks/components/EmptyState/EmptyStateActions.tsx +18 -2
  284. package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.tsx +20 -2
  285. package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.tsx +16 -2
  286. package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx +11 -1
  287. package/assets/templates/blocks/components/Heading/HeadingTruncation.tsx +12 -2
  288. package/assets/templates/blocks/components/InternationalizationProvider/useDirectionHookUsage.tsx +1 -1
  289. package/assets/templates/blocks/components/LayoutContent/LayoutContentBasic.tsx +1 -1
  290. package/assets/templates/blocks/components/LayoutContent/LayoutContentShowcase.tsx +1 -1
  291. package/assets/templates/blocks/components/LayoutFooter/LayoutFooterActions.tsx +17 -3
  292. package/assets/templates/blocks/components/LayoutFooter/LayoutFooterShowcase.tsx +17 -3
  293. package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderShowcase.tsx +15 -3
  294. package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderWithActions.tsx +9 -2
  295. package/assets/templates/blocks/components/LayoutPanel/LayoutPanelNavigation.tsx +1 -1
  296. package/assets/templates/blocks/components/LayoutPanel/LayoutPanelShowcase.tsx +1 -1
  297. package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.tsx +1 -1
  298. package/assets/templates/blocks/components/MultiSelector/MultiSelectorGhostToolbar.tsx +14 -2
  299. package/assets/templates/blocks/components/Outline/OutlineDensity.tsx +2 -0
  300. package/assets/templates/blocks/components/OverflowList/OverflowListShowcase.tsx +6 -1
  301. package/assets/templates/blocks/components/Pagination/PaginationVariants.tsx +4 -0
  302. package/assets/templates/blocks/components/Popover/PopoverHookUsage.tsx +17 -2
  303. package/assets/templates/blocks/components/SegmentedControl/SegmentedControlFillLayout.tsx +1 -1
  304. package/assets/templates/blocks/components/Selector/SelectorGhostToolbar.tsx +14 -2
  305. package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +8 -1
  306. package/assets/templates/blocks/components/SideNav/SideNavWithHeaderMenu.tsx +2 -2
  307. package/assets/templates/blocks/components/SideNavHeading/SideNavHeadingShowcase.tsx +2 -0
  308. package/assets/templates/blocks/components/Switch/SwitchWithStatus.tsx +1 -1
  309. package/assets/templates/blocks/components/TabList/TabListTabsFillLayout.tsx +1 -1
  310. package/assets/templates/blocks/components/TabList/TabListTabsWithActions.tsx +12 -1
  311. package/assets/templates/blocks/components/Table/TableBulkActionsTable.tsx +11 -1
  312. package/assets/templates/blocks/components/Table/TableInCard.tsx +2 -2
  313. package/assets/templates/blocks/components/Text/TextTruncation.tsx +1 -1
  314. package/assets/templates/blocks/components/Text/TextWordBreak.tsx +12 -2
  315. package/assets/templates/blocks/components/Text/TextWrap.tsx +19 -4
  316. package/assets/templates/blocks/components/TextArea/TextAreaCharacterCount.tsx +1 -1
  317. package/assets/templates/blocks/components/TextArea/TextAreaShowcase.tsx +1 -1
  318. package/assets/templates/blocks/components/TextArea/TextAreaStates.tsx +1 -1
  319. package/assets/templates/blocks/components/TextArea/TextAreaValidation.tsx +1 -1
  320. package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.tsx +1 -1
  321. package/assets/templates/blocks/components/TextInput/TextInputStatusVariant.tsx +2 -2
  322. package/assets/templates/blocks/components/Timestamp/TimestampAutoFormat.tsx +15 -1
  323. package/assets/templates/blocks/components/Timestamp/TimestampRelativeFormat.tsx +15 -1
  324. package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +8 -0
  325. package/assets/templates/blocks/components/Toolbar/ToolbarSizes.tsx +12 -1
  326. package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +18 -3
  327. package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx +6 -0
  328. package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx +7 -1
  329. package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.tsx +2 -2
  330. package/assets/templates/blocks/components/TopNav/TopNavShowcase.tsx +9 -0
  331. package/assets/templates/components.generated.json +1 -1
  332. package/assets/templates/pages/ai-chat/page.tsx +102 -6
  333. package/assets/templates/pages/ai-chat-landing/page.tsx +31 -4
  334. package/assets/templates/pages/ai-chat-landing/template.doc.mjs +3 -0
  335. package/assets/templates/pages/canvas-editor/page.tsx +73 -2
  336. package/assets/templates/pages/centered-hero/page.tsx +10 -4
  337. package/assets/templates/pages/course-detail/page.tsx +46 -2
  338. package/assets/templates/pages/dashboard/page.tsx +45 -16
  339. package/assets/templates/pages/dashboard-alert-rail/page.tsx +1 -1
  340. package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +32 -21
  341. package/assets/templates/pages/dashboard-comparison/page.tsx +11 -2
  342. package/assets/templates/pages/dashboard-composition/page.tsx +22 -9
  343. package/assets/templates/pages/dashboard-progress/page.tsx +28 -16
  344. package/assets/templates/pages/dashboard-scorecard/page.tsx +9 -0
  345. package/assets/templates/pages/detail-page/page.tsx +157 -76
  346. package/assets/templates/pages/documentation/page.tsx +15 -2
  347. package/assets/templates/pages/documentation-design/page.tsx +7 -34
  348. package/assets/templates/pages/documentation-technical/page.tsx +122 -65
  349. package/assets/templates/pages/editor/page.tsx +41 -24
  350. package/assets/templates/pages/file-explorer/page.tsx +44 -1
  351. package/assets/templates/pages/form-two-column/page.tsx +2 -3
  352. package/assets/templates/pages/form-wizard/page.tsx +31 -3
  353. package/assets/templates/pages/form-wizard-vertical/page.tsx +55 -6
  354. package/assets/templates/pages/gallery-hero/page.tsx +2 -1
  355. package/assets/templates/pages/ide/page.tsx +23 -0
  356. package/assets/templates/pages/ide/template.doc.mjs +1 -1
  357. package/assets/templates/pages/incident-console/page.tsx +130 -30
  358. package/assets/templates/pages/incident-console/template.doc.mjs +2 -2
  359. package/assets/templates/pages/kanban-board/page.tsx +50 -3
  360. package/assets/templates/pages/login-card/page.tsx +16 -0
  361. package/assets/templates/pages/login-split/page.tsx +19 -6
  362. package/assets/templates/pages/messaging-shell/page.tsx +409 -419
  363. package/assets/templates/pages/messaging-shell/template.doc.mjs +6 -6
  364. package/assets/templates/pages/payment-form/page.tsx +107 -43
  365. package/assets/templates/pages/product-detail/page.tsx +26 -2
  366. package/assets/templates/pages/product-gallery/page.tsx +16 -14
  367. package/assets/templates/pages/settings/page.tsx +35 -3
  368. package/assets/templates/pages/settings-dialog/page.tsx +196 -17
  369. package/assets/templates/pages/settings-sidebar/page.tsx +23 -3
  370. package/assets/templates/pages/shell-nav/page.tsx +28 -12
  371. package/assets/templates/pages/shell-side-nav/page.tsx +27 -4
  372. package/assets/templates/pages/shell-top-nav/page.tsx +27 -1
  373. package/assets/templates/pages/side-gallery/page.tsx +1 -1
  374. package/assets/templates/pages/table/page.tsx +575 -61
  375. package/assets/templates/pages/table/template.doc.mjs +11 -1
  376. package/assets/templates/pages/table-collapsible/page.tsx +1 -1
  377. package/assets/templates/pages/table-comparison/page.tsx +1 -1
  378. package/assets/templates/pages/table-filter/page.tsx +17 -1
  379. package/assets/templates/pages/table-grouped/page.tsx +171 -133
  380. package/assets/templates/pages/table-inbox/page.tsx +60 -1
  381. package/assets/templates/pages/table-page/page.tsx +23 -2
  382. package/assets/templates/pages/table-tree/page.tsx +95 -13
  383. package/assets/templates/pages/theme-showcase/page.tsx +107 -11
  384. package/assets/templates/pages/work-item-detail/page.tsx +134 -80
  385. package/assets/templates/pages/work-item-detail/template.doc.mjs +0 -1
  386. package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +1 -1
  387. package/assets/templates/themes/gothic/gothicTheme.ts +5 -0
  388. package/assets/templates/themes/neutral/neutralTheme.ts +1 -1
  389. package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +1 -1
  390. package/assets/templates/themes/y2k/y2kTheme.ts +1 -1
  391. package/assets/theme.template.ts +3 -2
  392. package/authoring/debug/parse.d.mts +1 -1
  393. package/authoring/doctypes/_schema.d.mts +28 -14
  394. package/authoring/doctypes/_schema.mjs +31 -0
  395. package/authoring/doctypes/command/command.doc.mjs +24 -0
  396. package/authoring/doctypes/command/type.ts +31 -0
  397. package/authoring/doctypes/component/component.doc.mjs +1 -1
  398. package/authoring/doctypes/component/type.ts +8 -5
  399. package/authoring/doctypes/namespace/namespace.doc.mjs +6 -0
  400. package/authoring/doctypes/namespace/type.ts +4 -0
  401. package/authoring/doctypes/template/template.doc.mjs +1 -1
  402. package/authoring/doctypes/template/type.ts +1 -1
  403. package/authoring/index.d.ts +6 -1
  404. package/authoring/integration/integration.doc.mjs +15 -0
  405. package/authoring/integration/schema.d.mts +30 -1
  406. package/authoring/integration/schema.mjs +129 -4
  407. package/authoring/integration/type.ts +48 -0
  408. package/clients/cli/bin/astryx.mjs +9 -3
  409. package/clients/cli/build-id.generated.json +1 -1
  410. package/clients/cli/commands/build.mjs +17 -5
  411. package/clients/cli/commands/component.doc.mjs +1 -0
  412. package/clients/cli/commands/component.mjs +107 -42
  413. package/clients/cli/commands/discover.mjs +70 -3
  414. package/clients/cli/commands/docs.doc.mjs +1 -1
  415. package/clients/cli/commands/docs.mjs +41 -5
  416. package/clients/cli/commands/doctor.mjs +52 -2
  417. package/clients/cli/commands/experimental/index.mjs +4 -1
  418. package/clients/cli/commands/experimental/theme.mjs +1504 -186
  419. package/clients/cli/commands/experimental-render.doc.mjs +18 -5
  420. package/clients/cli/commands/experimental-theme-add.doc.mjs +2 -0
  421. package/clients/cli/commands/experimental-theme-compile.doc.mjs +3 -2
  422. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +1 -0
  423. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +3 -1
  424. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +4 -3
  425. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +3 -2
  426. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +5 -4
  427. package/clients/cli/commands/experimental-theme-eject.doc.mjs +1 -0
  428. package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +1 -0
  429. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +3 -2
  430. package/clients/cli/commands/experimental-theme-remove.doc.mjs +6 -4
  431. package/clients/cli/commands/experimental-theme-targets.doc.mjs +1 -0
  432. package/clients/cli/commands/experimental-theme-template.doc.mjs +1 -0
  433. package/clients/cli/commands/experimental-theme-use.doc.mjs +2 -0
  434. package/clients/cli/commands/gap-report.doc.mjs +1 -0
  435. package/clients/cli/commands/hook.doc.mjs +1 -1
  436. package/clients/cli/commands/init.doc.mjs +1 -1
  437. package/clients/cli/commands/init.mjs +14 -6
  438. package/clients/cli/commands/integration-add.doc.mjs +1 -0
  439. package/clients/cli/commands/manifest.mjs +10 -3
  440. package/clients/cli/commands/search.mjs +13 -1
  441. package/clients/cli/commands/swizzle.doc.mjs +9 -2
  442. package/clients/cli/commands/swizzle.mjs +13 -6
  443. package/clients/cli/commands/template.doc.mjs +4 -1
  444. package/clients/cli/commands/template.mjs +34 -7
  445. package/clients/cli/commands/theme-add.doc.mjs +3 -2
  446. package/clients/cli/commands/theme-build.doc.mjs +11 -2
  447. package/clients/cli/commands/theme-eject.doc.mjs +1 -1
  448. package/clients/cli/commands/theme-list.doc.mjs +1 -1
  449. package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -2
  450. package/clients/cli/commands/theme-remove.doc.mjs +15 -6
  451. package/clients/cli/commands/theme-targets.doc.mjs +1 -0
  452. package/clients/cli/commands/theme-template.doc.mjs +1 -0
  453. package/clients/cli/commands/theme-use.doc.mjs +2 -1
  454. package/clients/cli/commands/theme.doc.mjs +7 -2
  455. package/clients/cli/commands/theme.mjs +824 -576
  456. package/clients/cli/commands/upgrade.mjs +7 -3
  457. package/clients/cli/index.mjs +177 -78
  458. package/clients/cli/lib/base-gate.mjs +522 -0
  459. package/clients/cli/lib/cli-error.mjs +21 -0
  460. package/clients/cli/lib/command-path.mjs +26 -0
  461. package/clients/cli/lib/define-command.mjs +161 -12
  462. package/clients/cli/lib/json-shim.mjs +679 -40
  463. package/clients/cli/lib/manifest.d.ts +14 -0
  464. package/clients/cli/lib/manifest.mjs +78 -22
  465. package/clients/cli/lib/not-ready.mjs +22 -0
  466. package/clients/cli/lib/root-args.mjs +79 -0
  467. package/clients/cli/lib/stray-option.mjs +491 -0
  468. package/clients/cli/lib/unknown-command.mjs +374 -0
  469. package/clients/cli/manifest.generated.json +1 -1
  470. package/clients/cli/run.mjs +39 -3
  471. package/foundation/agent-docs/agent-docs.mjs +1 -1
  472. package/foundation/agent-docs/computer-agent-text.mjs +1 -1
  473. package/foundation/bases/core-docs.d.mts +10 -0
  474. package/foundation/bases/core-docs.mjs +42 -0
  475. package/foundation/bases/core.d.mts +11 -0
  476. package/foundation/bases/core.mjs +32 -0
  477. package/foundation/bases/requirements.d.mts +128 -0
  478. package/foundation/bases/requirements.mjs +193 -0
  479. package/foundation/bases/resolve.d.mts +134 -0
  480. package/foundation/bases/resolve.mjs +295 -0
  481. package/foundation/bases/state.d.mts +24 -0
  482. package/foundation/bases/state.mjs +46 -0
  483. package/foundation/bases/steps.d.mts +49 -0
  484. package/foundation/bases/steps.mjs +88 -0
  485. package/foundation/config/project.d.mts +22 -0
  486. package/foundation/config/project.mjs +94 -30
  487. package/foundation/config/theme-build-header.d.mts +14 -0
  488. package/foundation/config/theme-build-header.mjs +14 -0
  489. package/foundation/config/theme-private-vars.d.mts +26 -2
  490. package/foundation/config/theme-private-vars.mjs +65 -5
  491. package/foundation/config/theme-state.d.mts +19 -2
  492. package/foundation/config/theme-state.mjs +93 -1
  493. package/foundation/debug/event.d.mts +8 -2
  494. package/foundation/debug/event.mjs +6 -7
  495. package/foundation/debug/recorder.d.mts +8 -1
  496. package/foundation/debug/recorder.mjs +8 -2
  497. package/foundation/discovery/cli-self-doc-names.d.mts +13 -0
  498. package/foundation/discovery/cli-self-doc-names.mjs +51 -0
  499. package/foundation/discovery/cli-self-docs.d.mts +0 -2
  500. package/foundation/discovery/cli-self-docs.mjs +11 -16
  501. package/foundation/discovery/command-pointers.d.mts +28 -0
  502. package/foundation/discovery/command-pointers.mjs +31 -0
  503. package/foundation/discovery/component-discovery.d.mts +9 -8
  504. package/foundation/discovery/component-discovery.mjs +12 -6
  505. package/foundation/discovery/core-component-docs.d.mts +29 -0
  506. package/foundation/discovery/core-component-docs.mjs +83 -0
  507. package/foundation/discovery/core-theme-facts.d.mts +70 -0
  508. package/foundation/discovery/core-theme-facts.mjs +384 -0
  509. package/foundation/discovery/docs-discovery.d.mts +84 -9
  510. package/foundation/discovery/docs-discovery.mjs +151 -60
  511. package/foundation/discovery/entry-name-files.d.mts +72 -9
  512. package/foundation/discovery/entry-name-files.mjs +193 -103
  513. package/foundation/discovery/hook-discovery.d.mts +16 -6
  514. package/foundation/discovery/hook-discovery.mjs +82 -43
  515. package/foundation/discovery/integration-component-views.d.mts +15 -0
  516. package/foundation/discovery/integration-component-views.mjs +91 -0
  517. package/foundation/discovery/module-exports.d.mts +26 -1
  518. package/foundation/discovery/module-exports.mjs +114 -40
  519. package/foundation/discovery/name-roots.d.mts +38 -0
  520. package/foundation/discovery/name-roots.mjs +108 -0
  521. package/foundation/discovery/next-routes.d.mts +48 -0
  522. package/foundation/discovery/next-routes.mjs +197 -0
  523. package/foundation/discovery/stored-self-audit.mjs +2 -0
  524. package/foundation/discovery/template-adapter.d.mts +31 -63
  525. package/foundation/discovery/template-adapter.mjs +38 -207
  526. package/foundation/discovery/template-destination.d.mts +28 -0
  527. package/foundation/discovery/template-destination.mjs +106 -0
  528. package/foundation/discovery/template-ids.d.mts +69 -0
  529. package/foundation/discovery/template-ids.mjs +203 -0
  530. package/foundation/discovery/template-needs.mjs +3 -1
  531. package/foundation/discovery/theme-discovery.d.mts +12 -0
  532. package/foundation/discovery/theme-discovery.mjs +34 -2
  533. package/foundation/discovery/theme-imports.d.mts +10 -0
  534. package/foundation/discovery/theme-imports.mjs +37 -4
  535. package/foundation/discovery/theming-targets.d.mts +13 -5
  536. package/foundation/discovery/theming-targets.mjs +38 -45
  537. package/foundation/doc-compiler/generated-levels.d.mts +43 -0
  538. package/foundation/doc-compiler/generated-levels.mjs +72 -0
  539. package/foundation/doc-compiler/literal-doc.d.mts +12 -0
  540. package/foundation/doc-compiler/literal-doc.mjs +322 -0
  541. package/foundation/doc-compiler/stored-docs.d.mts +7 -0
  542. package/foundation/doc-compiler/stored-docs.mjs +14 -1
  543. package/foundation/doc-compiler/tree.d.mts +18 -87
  544. package/foundation/doc-compiler/tree.mjs +57 -64
  545. package/foundation/env/intl-defaults.d.mts +39 -0
  546. package/foundation/env/intl-defaults.mjs +150 -0
  547. package/foundation/env/intl-now.d.mts +21 -0
  548. package/foundation/env/intl-now.mjs +25 -0
  549. package/foundation/env/package-manager.d.mts +11 -2
  550. package/foundation/env/package-manager.mjs +28 -4
  551. package/foundation/fonts/font-stylesheet.d.mts +38 -0
  552. package/foundation/fonts/font-stylesheet.mjs +128 -12
  553. package/foundation/fs/cache-eviction.d.mts +3 -1
  554. package/foundation/fs/cache-eviction.mjs +7 -1
  555. package/foundation/fs/exact-codec.d.mts +12 -2
  556. package/foundation/fs/exact-codec.mjs +23 -6
  557. package/foundation/fs/file-protection.mjs +12 -2
  558. package/foundation/fs/gather-cache.d.mts +81 -2
  559. package/foundation/fs/gather-cache.mjs +615 -97
  560. package/foundation/fs/glob.d.mts +16 -0
  561. package/foundation/fs/glob.mjs +105 -0
  562. package/foundation/fs/jiti-cache.mjs +14 -6
  563. package/foundation/fs/kept-tree.d.mts +39 -15
  564. package/foundation/fs/kept-tree.mjs +155 -46
  565. package/foundation/fs/loaded-files.d.mts +30 -0
  566. package/foundation/fs/loaded-files.mjs +148 -0
  567. package/foundation/fs/module-loader.d.mts +53 -8
  568. package/foundation/fs/module-loader.mjs +559 -39
  569. package/foundation/fs/own-modules.d.mts +29 -0
  570. package/foundation/fs/own-modules.mjs +57 -0
  571. package/foundation/fs/path-safety.d.mts +34 -2
  572. package/foundation/fs/path-safety.mjs +170 -18
  573. package/foundation/fs/paths.d.mts +41 -2
  574. package/foundation/fs/paths.mjs +95 -5
  575. package/foundation/fs/read-record.d.mts +84 -7
  576. package/foundation/fs/read-record.mjs +333 -56
  577. package/foundation/fs/regular-file.d.mts +29 -0
  578. package/foundation/fs/regular-file.mjs +77 -0
  579. package/foundation/fs/stop-cleanup.d.mts +12 -0
  580. package/foundation/fs/stop-cleanup.mjs +66 -0
  581. package/foundation/fs/stylesheet-file.d.mts +37 -0
  582. package/foundation/fs/stylesheet-file.mjs +48 -0
  583. package/foundation/fs/theme-module-rejections.d.mts +32 -0
  584. package/foundation/fs/theme-module-rejections.mjs +82 -0
  585. package/foundation/integrations/integrations.d.mts +27 -1
  586. package/foundation/integrations/integrations.mjs +24 -2
  587. package/foundation/integrations/pack-state.d.mts +85 -0
  588. package/foundation/integrations/pack-state.mjs +509 -0
  589. package/foundation/integrations/shipped-imports.d.mts +125 -0
  590. package/foundation/integrations/shipped-imports.mjs +530 -0
  591. package/foundation/integrations/validate-contributions.d.mts +0 -17
  592. package/foundation/integrations/validate-contributions.mjs +81 -290
  593. package/foundation/release/choose.d.mts +7 -0
  594. package/foundation/release/choose.mjs +16 -2
  595. package/foundation/release/handoff.mjs +68 -13
  596. package/foundation/release/notices.d.mts +46 -9
  597. package/foundation/release/notices.mjs +78 -20
  598. package/foundation/release/pnp-runtime.d.mts +66 -0
  599. package/foundation/release/pnp-runtime.mjs +139 -0
  600. package/foundation/release/project.d.mts +11 -0
  601. package/foundation/release/project.mjs +23 -7
  602. package/foundation/release/run-context.d.mts +7 -2
  603. package/foundation/release/run-context.mjs +6 -2
  604. package/foundation/render/assets.mjs +52 -7
  605. package/foundation/render/charts.d.mts +78 -27
  606. package/foundation/render/charts.mjs +319 -90
  607. package/foundation/render/css-cut.d.mts +14 -1
  608. package/foundation/render/css-cut.mjs +117 -4
  609. package/foundation/render/cut-short.d.mts +35 -0
  610. package/foundation/render/cut-short.mjs +124 -0
  611. package/foundation/render/embedded-imports.d.mts +31 -0
  612. package/foundation/render/embedded-imports.mjs +169 -39
  613. package/foundation/render/font-probe.d.mts +27 -0
  614. package/foundation/render/font-probe.mjs +77 -0
  615. package/foundation/render/layers.d.mts +49 -0
  616. package/foundation/render/layers.mjs +347 -0
  617. package/foundation/render/offline.d.mts +32 -0
  618. package/foundation/render/offline.mjs +56 -0
  619. package/foundation/render/page-worker.mjs +374 -15
  620. package/foundation/render/picture-chrome.mjs +46 -4
  621. package/foundation/render/picture-playwright.mjs +41 -5
  622. package/foundation/render/picture-window.d.mts +32 -0
  623. package/foundation/render/picture-window.mjs +146 -0
  624. package/foundation/render/render-page.d.mts +46 -4
  625. package/foundation/render/render-page.mjs +453 -98
  626. package/foundation/response/base.d.ts +25 -0
  627. package/foundation/response/error-codes.d.mts +4 -1
  628. package/foundation/response/error-codes.d.ts +4 -1
  629. package/foundation/response/error-codes.doc.mjs +17 -0
  630. package/foundation/response/error-codes.mjs +21 -0
  631. package/foundation/response/json.d.mts +3 -1
  632. package/foundation/response/json.mjs +7 -2
  633. package/foundation/response/response-types.doc.mjs +12 -12
  634. package/foundation/runtime/css-tree.d.mts +24 -0
  635. package/foundation/runtime/css-tree.mjs +103 -0
  636. package/foundation/runtime/lazy-dependencies.d.mts +3 -1
  637. package/foundation/runtime/lazy-dependencies.mjs +20 -5
  638. package/foundation/suggest/name-index.d.mts +149 -0
  639. package/foundation/suggest/name-index.mjs +317 -0
  640. package/foundation/suggest/other-command.d.mts +146 -0
  641. package/foundation/suggest/other-command.mjs +783 -0
  642. package/foundation/text/css-escape.d.mts +18 -0
  643. package/foundation/text/css-escape.mjs +35 -0
  644. package/foundation/text/entry-names.d.mts +14 -0
  645. package/foundation/text/entry-names.mjs +14 -0
  646. package/foundation/text/string-utils.d.mts +49 -5
  647. package/foundation/text/string-utils.mjs +124 -26
  648. package/foundation/text/suggest-order.d.mts +75 -4
  649. package/foundation/text/suggest-order.mjs +285 -9
  650. package/foundation/text/written-string.d.mts +17 -0
  651. package/foundation/text/written-string.mjs +22 -0
  652. package/foundation/xle/browser.d.mts +2 -2
  653. package/package.json +8 -7
@@ -65,7 +65,7 @@ export const doc = {
65
65
  {
66
66
  type: 'build.kit',
67
67
  description:
68
- 'The page template to start from and the kit around it: the echoed query, hasResults/matchCount/directMatch fields, `start` (the template to scaffold, the `template <id> --type page <path>` command that selects it, whether the start is also search\'s direct match, the closest page, or the fallback app shell, the next two `alternatives` in the order the start is chosen from, and optional `notes` — setup notes naming what the template needs that the project lacks, such as missing packages or a missing StyleX compiler), search\'s closest page templates (≤3), drop-in block patterns (≤5), idea-specific components/hooks (≤6), and the always-on frame + foundation component-name arrays. Carries `hint` only when the kit came back thin — what to try instead, so a caller does not read a near-empty kit as "the package has nothing".',
68
+ "The page template to start from and the kit around it: the echoed query, hasResults/matchCount/directMatch fields, `start` (the template to scaffold, the `template <id> --type page <path>` command that selects it and names where it goes in the project (`<path>` stays a placeholder outside a project), whether the start is also search's direct match, the closest page, or the fallback app shell, the next two `alternatives` in the order the start is chosen from, `fit` on a page-template start (the page-pick model's probability for it among the ready page templates, 0 to 1; 0.4 or more is a clear choice; absent for a template the word tables do not list), and optional `notes` — setup notes naming what the template needs that the project lacks, such as missing packages or a missing StyleX compiler), search's closest page templates that build could start from (≤3), drop-in block patterns (≤5) — each template, the start and its alternatives included, with `isReady` — idea-specific components/hooks (≤6), and the always-on frame + foundation component-name arrays. Carries `hint` only when the kit came back thin — what to try instead, so a caller does not read a near-empty kit as \"the package has nothing\".",
69
69
  },
70
70
  ],
71
71
  throws: [
@@ -86,7 +86,7 @@ export const doc = {
86
86
  {label: 'Get the playbook', code: 'const r = await build();'},
87
87
  {
88
88
  label: 'Find the template to start from',
89
- code: "const {data} = await build('analytics dashboard');\n// data.start.command: 'astryx template dashboard --type page <path>'",
89
+ code: "const {data} = await build('analytics dashboard');\n// in a Next app: data.start.command: 'astryx template dashboard --type page app/dashboard'",
90
90
  },
91
91
  {
92
92
  label: 'Restrict + limit',
@@ -65,7 +65,7 @@ export type BuildStart = {
65
65
  */
66
66
  package: string;
67
67
  /**
68
- * The scaffold command that selects exactly this template, `astryx template <id> --type page <path>`: `<id>` is the Core id an integration replacement stands in for, else the template's own id, `<path>` is a placeholder for the file or folder to write the template to, and the `astryx` prefix is for the caller to replace with its own invocation.
68
+ * The scaffold command that selects exactly this template, `astryx template <id> --type page <path>`: `<id>` is the Core id an integration replacement stands in for, else the template's own id, `<path>` is the path `astryx template` names for the template in the project where build ran, from the project's layout and the template's own id (not the Core id a replacement stands in for): in a Next app, `<id>` in its App Router folder (`app/<id>` or `src/app/<id>`, in the route group with the root layout when that folder has none), or the page file `pages/<id>.tsx` or `src/pages/<id>.tsx` with only the Pages Router; else `src/pages/<id>`; `<id>-2` and on when that path is taken; quoted for a shell. It is the placeholder `<path>` when that folder has no package.json (`architecture:cli-surface` INV38), and the `astryx` prefix is for the caller to replace with its own invocation.
69
69
  */
70
70
  command: string;
71
71
  /**
@@ -76,6 +76,10 @@ export type BuildStart = {
76
76
  * One sentence saying the same as `basis`, for a reader.
77
77
  */
78
78
  reason: string;
79
+ /**
80
+ * For a start that is a page template (not the app shell): the page-pick model's probability for the start among the ready page templates, 0 to 1. A high value means the pick model clearly prefers this template; a low one means several templates fit about as well. At or above 0.4 the choice is clear: below it, the pick model's start agrees with labeled requests less than half the time. Absent for a template the word tables do not list. Absent for an app-shell start and in a project without word weights.
81
+ */
82
+ fit?: number | undefined;
79
83
  /**
80
84
  * The next closest page templates (≤2), for when the start's layout is wrong: for a whole page in the page-pick model's order, else in the ranker's.
81
85
  */
@@ -84,6 +88,10 @@ export type BuildStart = {
84
88
  * Setup notes: what the template needs that the project lacks (missing packages, missing StyleX compiler). Present only when the start template imports packages the project does not have or needs a StyleX compiler the project has not configured.
85
89
  */
86
90
  notes?: string[] | undefined;
91
+ /**
92
+ * Whether the template is ready, as its doc's `isReady` says (`true` when the doc leaves it out). Build starts only from a ready template.
93
+ */
94
+ isReady: boolean;
87
95
  };
88
96
  /**
89
97
  * A page template to consider instead of the start.
@@ -109,6 +117,10 @@ export type BuildAlternative = {
109
117
  * The scaffold command, in the same form as the start's.
110
118
  */
111
119
  command: string;
120
+ /**
121
+ * Whether the template is ready, as for the start.
122
+ */
123
+ isReady: boolean;
112
124
  };
113
125
  /**
114
126
  * astryx --json build "<idea>" — the page template to start from, and the kit around it.
@@ -43,11 +43,13 @@
43
43
  * @property {string} displayName Human-facing template name.
44
44
  * @property {string} description What the page is: its layout and the ideas it serves.
45
45
  * @property {string} package The npm package that owns this template.
46
- * @property {string} command The scaffold command that selects exactly this template, `astryx template <id> --type page <path>`: `<id>` is the Core id an integration replacement stands in for, else the template's own id, `<path>` is a placeholder for the file or folder to write the template to, and the `astryx` prefix is for the caller to replace with its own invocation.
46
+ * @property {string} command The scaffold command that selects exactly this template, `astryx template <id> --type page <path>`: `<id>` is the Core id an integration replacement stands in for, else the template's own id, `<path>` is the path `astryx template` names for the template in the project where build ran, from the project's layout and the template's own id (not the Core id a replacement stands in for): in a Next app, `<id>` in its App Router folder (`app/<id>` or `src/app/<id>`, in the route group with the root layout when that folder has none), or the page file `pages/<id>.tsx` or `src/pages/<id>.tsx` with only the Pages Router; else `src/pages/<id>`; `<id>-2` and on when that path is taken; quoted for a shell. It is the placeholder `<path>` when that folder has no package.json (`architecture:cli-surface` INV38), and the `astryx` prefix is for the caller to replace with its own invocation.
47
47
  * @property {'direct' | 'closest' | 'fallback'} basis Why this template. The page ranker orders the page templates: it weighs each matched word by how rare it is among page templates, favors the family the idea's head names and the container it names ("in a modal"), and discounts words that only modify another. For a part or an edit, the start is where the ranker's placement rules put it; for a whole page, checked-in word weights decide page or app shell and a page-pick model chooses the page from the ranker's list and its own word tables, so the start can differ from the ranker's first template. `direct` when the start is also search's direct match (`directMatch`); `closest` when it is not; `fallback` when the page starts from the app shell.
48
48
  * @property {string} reason One sentence saying the same as `basis`, for a reader.
49
+ * @property {number} [fit] For a start that is a page template (not the app shell): the page-pick model's probability for the start among the ready page templates, 0 to 1. A high value means the pick model clearly prefers this template; a low one means several templates fit about as well. At or above 0.4 the choice is clear: below it, the pick model's start agrees with labeled requests less than half the time. Absent for a template the word tables do not list. Absent for an app-shell start and in a project without word weights.
49
50
  * @property {BuildAlternative[]} alternatives The next closest page templates (≤2), for when the start's layout is wrong: for a whole page in the page-pick model's order, else in the ranker's.
50
51
  * @property {string[]} [notes] Setup notes: what the template needs that the project lacks (missing packages, missing StyleX compiler). Present only when the start template imports packages the project does not have or needs a StyleX compiler the project has not configured.
52
+ * @property {boolean} isReady Whether the template is ready, as its doc's `isReady` says (`true` when the doc leaves it out). Build starts only from a ready template.
51
53
  */
52
54
 
53
55
  /**
@@ -59,6 +61,7 @@
59
61
  * @property {string} description What the page is: its layout and the ideas it serves.
60
62
  * @property {string} package The npm package that owns this template.
61
63
  * @property {string} command The scaffold command, in the same form as the start's.
64
+ * @property {boolean} isReady Whether the template is ready, as for the start.
62
65
  */
63
66
 
64
67
  /**
@@ -74,9 +77,9 @@
74
77
  * @property {string} data.query
75
78
  * @property {boolean} data.hasResults False when search returned nothing. The kit still names a template in `start`.
76
79
  * @property {number} data.matchCount Total ranked search matches for the query — counted before the search `limit`, the kit's score floors, and its per-group caps, so it is never a cap read back.
77
- * @property {boolean} data.directMatch True when the top page template is a confident direct match.
80
+ * @property {boolean} data.directMatch True when the first entry of `pages` is search's confident direct match. Build reads only ready page templates from search, so a template that is not ready yet is never the direct match.
78
81
  * @property {BuildStart | null} data.start The page template to start from (see `BuildStart.basis`), else the app shell. Null only when the kit is narrowed to components or hooks (`type`), or when the project has no page template to offer.
79
- * @property {import('../search/search.type.mjs').SearchResultEntry[]} data.pages Closest page templates by search (≤3). Each entry's `command` carries `--skeleton` when `directMatch` is false, so it previews the layout; `start.command` is the scaffold.
82
+ * @property {import('../search/search.type.mjs').SearchResultEntry[]} data.pages Closest page templates by search that build could start from (≤3): a template the catalog holds as not ready is left out. Each entry's `command` carries `--skeleton` when `directMatch` is false, so it previews the layout; `start.command` is the scaffold.
80
83
  * @property {import('../search/search.type.mjs').SearchResultEntry[]} data.blocks Drop-in block patterns covering parts of the idea (≤5), best first. A block search returned keeps search's score and reason; any other block carries the block picker's relative score (100 for its best candidate, never below 1) and reason, so the two kinds of score are not comparable.
81
84
  * @property {import('../search/search.type.mjs').SearchResultEntry[]} data.domain Idea-specific components/hooks (≤6), excluding frame/foundation.
82
85
  * @property {string[]} data.frame Always-on page-shell component names. Every page template already uses them.
@@ -21,6 +21,12 @@ export function ideaKind(query: string, pages: PageTemplate[], components: Compo
21
21
  * @returns {boolean}
22
22
  */
23
23
  export function asksForNewPage(query: string, pages: PageTemplate[]): boolean;
24
+ /**
25
+ * The words of a component's name: "DateRangeInput" is date, range, input.
26
+ * @param {ComponentWords} component
27
+ * @returns {string[]}
28
+ */
29
+ export function nameTerms(component: ComponentWords): string[];
24
30
  export type PageTemplate = import("./words.mjs").PageTemplate;
25
31
  export type ComponentWords = import("./words.mjs").ComponentWords;
26
32
  export type IdeaKind = import("./words.mjs").IdeaKind;
@@ -342,7 +342,7 @@ export function asksForNewPage(query, pages) {
342
342
  * @param {ComponentWords} component
343
343
  * @returns {string[]}
344
344
  */
345
- function nameTerms(component) {
345
+ export function nameTerms(component) {
346
346
  return terms(component.name.replace(/([a-z0-9])([A-Z])/g, '$1 $2'));
347
347
  }
348
348
 
@@ -14,8 +14,8 @@
14
14
  * composing from scratch while a template exists. Next to the start it names
15
15
  * the ranker's next two templates, then groups the unified search into the
16
16
  * blocks that cover parts and the domain components to fill gaps, plus the
17
- * always-on frame + foundation names. `pages` and `directMatch` keep search's
18
- * own view for callers that read them.
17
+ * always-on frame + foundation names. `pages` and `directMatch` describe
18
+ * search's matches that build could start from.
19
19
  *
20
20
  * signals.mjs computes what the kit is built from and answer.mjs shapes the
21
21
  * response; buildKit is the two with build's own blocks.
@@ -26,7 +26,7 @@
26
26
  * JSON shape stays package-manager-agnostic and stable across environments.
27
27
  *
28
28
  * Two commands are the kit's own: `start.command`, the scaffold (`astryx
29
- * template <id> --type page <path>`, with `<path>` a placeholder), and the `--skeleton`
29
+ * template <id> --type page <path>`, with `<path>` where it goes in the project), and the `--skeleton`
30
30
  * a page entry carries when it is not a direct match, so a loose page reads
31
31
  * as a layout preview rather than the thing to build. Neither is prefixing —
32
32
  * the invocation stays the renderer's job.
@@ -7,11 +7,11 @@
7
7
  * by how strongly each one's own descriptor answers the idea, then by how
8
8
  * typical of its family it is, then by name (`settleTies`).
9
9
  *
10
- * @param {string} query
10
+ * @param {string} idea
11
11
  * @param {PageTemplate[]} pages
12
12
  * @returns {RankedPage[]}
13
13
  */
14
- export function rankPages(query: string, pages: PageTemplate[]): RankedPage[];
14
+ export function rankPages(idea: string, pages: PageTemplate[]): RankedPage[];
15
15
  /**
16
16
  * The next closest templates after the start, best first: the ones a reader
17
17
  * should check the idea against when the start's shape is wrong. Each matched
@@ -31,11 +31,17 @@ export function pickAlternatives(ranked: RankedPage[], startName: string, count?
31
31
  * a page the builder already has starts from the app shell (FR9). Either way,
32
32
  * the app shell is the shell template the idea describes when one leads.
33
33
  *
34
+ * A family's base is where a part goes only when the ranker leads with it. A
35
+ * family word that heads the idea and is also a component's name names the
36
+ * piece, not its place: "a sortable table" is a table to add, not a part for
37
+ * the table page.
38
+ *
34
39
  * @param {RankedPage[]} ranked
35
40
  * @param {IdeaKind} [kind]
41
+ * @param {Set<string>} [pieceWords] the last word of each component's name
36
42
  * @returns {RankedPage | null}
37
43
  */
38
- export function pickStart(ranked: RankedPage[], kind?: IdeaKind): RankedPage | null;
44
+ export function pickStart(ranked: RankedPage[], kind?: IdeaKind, pieceWords?: Set<string>): RankedPage | null;
39
45
  export type PageTemplate = import("./words.mjs").PageTemplate;
40
46
  export type RankedPage = import("./words.mjs").RankedPage;
41
47
  export type IdeaKind = import("./words.mjs").IdeaKind;
@@ -53,7 +53,7 @@
53
53
 
54
54
  import {
55
55
  HEAD_END,
56
- SHELL_FAMILY,
56
+ isAppShell,
57
57
  terms,
58
58
  modifiersOf,
59
59
  pairsOf,
@@ -64,6 +64,7 @@ import {
64
64
  keywordUnits,
65
65
  keywordWordsFor,
66
66
  framesOf,
67
+ readNames,
67
68
  } from './words.mjs';
68
69
  import {namedOutright, tieReading} from './weights.mjs';
69
70
  import {compareText} from '../../../foundation/text/compare-text.mjs';
@@ -141,11 +142,12 @@ const START_TERMS = 2;
141
142
  * by how strongly each one's own descriptor answers the idea, then by how
142
143
  * typical of its family it is, then by name (`settleTies`).
143
144
  *
144
- * @param {string} query
145
+ * @param {string} idea
145
146
  * @param {PageTemplate[]} pages
146
147
  * @returns {RankedPage[]}
147
148
  */
148
- export function rankPages(query, pages) {
149
+ export function rankPages(idea, pages) {
150
+ const query = readNames(idea, pages);
149
151
  const docs = pages.map(page => {
150
152
  const [family = '', ...variantParts] = page.category.split(' - ');
151
153
  const keywords = page.keywords ?? [];
@@ -290,6 +292,7 @@ export function rankPages(query, pages) {
290
292
  family,
291
293
  base,
292
294
  matched,
295
+ hidden: page.hidden === true,
293
296
  };
294
297
  })
295
298
  .sort((a, b) => b.score - a.score || Number(b.base) - Number(a.base));
@@ -405,19 +408,29 @@ export function pickAlternatives(ranked, startName, count = 2) {
405
408
  * a page the builder already has starts from the app shell (FR9). Either way,
406
409
  * the app shell is the shell template the idea describes when one leads.
407
410
  *
411
+ * A family's base is where a part goes only when the ranker leads with it. A
412
+ * family word that heads the idea and is also a component's name names the
413
+ * piece, not its place: "a sortable table" is a table to add, not a part for
414
+ * the table page.
415
+ *
408
416
  * @param {RankedPage[]} ranked
409
417
  * @param {IdeaKind} [kind]
418
+ * @param {Set<string>} [pieceWords] the last word of each component's name
410
419
  * @returns {RankedPage | null}
411
420
  */
412
- export function pickStart(ranked, kind = 'page') {
421
+ export function pickStart(ranked, kind = 'page', pieceWords = new Set()) {
413
422
  if (kind !== 'page') {
414
- const host = kind === 'part' && ranked.find(r => r.base && r.familyNamed);
415
- if (host) return host;
423
+ const lead = ranked[0];
424
+ const namesPiece =
425
+ lead?.headNamed && terms(lead.family).some(t => pieceWords.has(t));
426
+ if (kind === 'part' && lead?.base && lead.familyNamed && !namesPiece) {
427
+ return lead;
428
+ }
416
429
  // Otherwise the app shell (FR2): the shell template the idea describes
417
430
  // when one leads ("a frame with sidebar navigation"), else none, for the
418
431
  // kit's neutral fallback.
419
- const lead = pickStart(ranked);
420
- return lead?.family === SHELL_FAMILY ? lead : null;
432
+ const shell = pickStart(ranked);
433
+ return isAppShell(shell) ? shell : null;
421
434
  }
422
435
  const top = ranked[0];
423
436
  if (!top || top.score < START_SCORE) return null;
@@ -30,9 +30,15 @@ export type BlockScore = [name: string, score: number, matched: number | null, t
30
30
  */
31
31
  export type KitSignals = {
32
32
  /**
33
- * search's echo of the query
33
+ * the caller's query, trimmed, as search echoes it
34
34
  */
35
35
  query: string;
36
+ /**
37
+ * the query as build matches it: a page template it
38
+ * names in any case or with a swapped pair of letters reads as that
39
+ * template's own words (readNames)
40
+ */
41
+ idea: string;
36
42
  matchCount: number;
37
43
  directMatch: boolean;
38
44
  /**
@@ -23,11 +23,16 @@ import {CORE_PROVIDER_ID} from '../../../foundation/identity/providers.mjs';
23
23
  import {
24
24
  loadComponents,
25
25
  loadTemplates,
26
- requireBuildCoreDir,
26
+ loadWeights,
27
+ pageDestination,
28
+ buildCoreContentDir,
27
29
  templateSetupNotes,
28
30
  } from '../_adapter.mjs';
29
- import {ideaKind} from './kind.mjs';
30
- import {rankPages} from './rank.mjs';
31
+ import {ideaKind, nameTerms} from './kind.mjs';
32
+ import {pickStart, rankPages} from './rank.mjs';
33
+ import {pickFit} from './weights.mjs';
34
+ import {readNames} from './words.mjs';
35
+ import {namedOutright} from './weights.mjs';
31
36
  import {asTemplate, chooseStart, pickStartAlternatives} from './start.mjs';
32
37
 
33
38
  /** A page at/above this score is a confident direct match. */
@@ -91,7 +96,10 @@ const ALWAYS = new Set([...FRAME, ...FOUNDATION]);
91
96
  /**
92
97
  * Everything build weighs for one request.
93
98
  * @typedef {object} KitSignals
94
- * @property {string} query search's echo of the query
99
+ * @property {string} query the caller's query, trimmed, as search echoes it
100
+ * @property {string} idea the query as build matches it: a page template it
101
+ * names in any case or with a swapped pair of letters reads as that
102
+ * template's own words (readNames)
95
103
  * @property {number} matchCount
96
104
  * @property {boolean} directMatch
97
105
  * @property {BuildStart | null} start the start, its alternatives, and its notes
@@ -117,6 +125,29 @@ function blockScore(r) {
117
125
  return [r.name, r.score, coverage?.matched ?? null, coverage?.total ?? null];
118
126
  }
119
127
 
128
+ /**
129
+ * The not-ready page template the idea names and search matches directly, or
130
+ * null: the one case where build's reason names a template it does not start
131
+ * from. Search for the kit leaves not-ready templates out, so only an idea
132
+ * that names one outright pays for a search that keeps them.
133
+ * @param {string} query the caller's idea
134
+ * @param {{name: string}[]} notReady the project's not-ready page templates
135
+ * @param {() => Promise<SearchResultEntry[]>} searchAll search's results with every template
136
+ * @param {(r: SearchResultEntry) => boolean} pageMatch
137
+ * @returns {Promise<string | null>}
138
+ */
139
+ async function namedNotReady(query, notReady, searchAll, pageMatch) {
140
+ /** @param {{name: string}} t */
141
+ const named = t =>
142
+ namedOutright([t.name], readNames(query, [{name: t.name}]), [t])[0];
143
+ const names = new Set(notReady.filter(named).map(t => t.name));
144
+ if (names.size === 0) return null;
145
+ const found = (await searchAll()).find(
146
+ r => names.has(r.name) && pageMatch(r) && r.score >= PAGE_DIRECT,
147
+ );
148
+ return found?.name ?? null;
149
+ }
150
+
120
151
  /**
121
152
  * Build's signals for one request (see {@link KitSignals}).
122
153
  *
@@ -128,21 +159,38 @@ export async function kitSignals(query, options = {}) {
128
159
  const {cwd = process.cwd(), type, limit = 60} = options;
129
160
  // A kit is built from Core's components, hooks, and templates. An open
130
161
  // search without core covers the docs alone, so the kit asks for core here.
131
- if (type !== 'doc') coreDirOrThrow(requireBuildCoreDir, cwd);
162
+ if (type !== 'doc') coreDirOrThrow(buildCoreContentDir, cwd);
132
163
  // search()'s JSDoc @returns widens results to object[]; the SearchResponse
133
164
  // shape is the contract (api/search/search.type.mjs). Cast locally rather than
134
165
  // tightening the search @returns (a separate follow-up).
166
+ // A kit narrowed to components or hooks has no page to start from; every
167
+ // other kit does, so the reader is never left to compose a page from scratch.
168
+ const wantsPages = !type || type === 'template';
169
+ const templates = wantsPages
170
+ ? await loadTemplates(cwd)
171
+ : {pages: [], blocks: [], notReadyPages: []};
172
+ const catalog = templates.pages;
173
+ // Search reads a page template the idea names in any case, separator or
174
+ // with a neighbour-letter swap in a word of six or more letters as that template's own words
175
+ // (readNames), as the page ranker does, so such a name matches by name.
176
+ const searched = wantsPages ? readNames(query, catalog) : query;
177
+ const searchOptions = {
178
+ cwd,
179
+ type,
180
+ // Search wider than the surfaced kit so a flood of doc matches cannot
181
+ // bury the page templates past the cutoff; the caller's `limit` still
182
+ // caps the kit below. A non-positive or non-integer limit is passed
183
+ // through unchanged so search rejects it (ERR_INVALID_ARGUMENT).
184
+ limit: Number.isInteger(limit) && limit > 0 ? Math.max(limit, 200) : limit,
185
+ };
135
186
  const result =
136
187
  /** @type {import('../../search/search.type.mjs').SearchResponse} */ (
137
- await search(query, {
138
- cwd,
139
- type,
140
- // Search wider than the surfaced kit so a flood of doc matches cannot
141
- // bury the page templates past the cutoff; the caller's `limit` still
142
- // caps the kit below. A non-positive or non-integer limit is passed
143
- // through unchanged so search rejects it (ERR_INVALID_ARGUMENT).
144
- limit:
145
- Number.isInteger(limit) && limit > 0 ? Math.max(limit, 200) : limit,
188
+ await search(searched, {
189
+ ...searchOptions,
190
+ // Build starts only from ready page templates, so it reads search as
191
+ // if a template not ready yet were absent: such a template takes no
192
+ // place, moves no order and adds nothing to the count.
193
+ readyTemplatesOnly: true,
146
194
  })
147
195
  );
148
196
  const results = result.data.results;
@@ -165,15 +213,22 @@ export async function kitSignals(query, options = {}) {
165
213
  return (coverage?.matched ?? 0) / total >= PAGE_COVERAGE;
166
214
  };
167
215
 
168
- const matchedPages = results
169
- .filter(
170
- r =>
171
- r.domain === 'template' &&
172
- r.kind !== 'block' &&
173
- r.score >= PAGE_FLOOR &&
174
- covers(r),
175
- )
176
- .slice(0, 3);
216
+ /** @param {SearchResultEntry} r */
217
+ const pageMatch = r =>
218
+ r.domain === 'template' &&
219
+ r.kind !== 'block' &&
220
+ r.score >= PAGE_FLOOR &&
221
+ covers(r);
222
+ const matchedPages = results.filter(pageMatch).slice(0, 3);
223
+ const namedUnready = await namedNotReady(
224
+ query,
225
+ templates.notReadyPages,
226
+ async () =>
227
+ /** @type {import('../../search/search.type.mjs').SearchResponse} */ (
228
+ await search(searched, searchOptions)
229
+ ).data.results,
230
+ pageMatch,
231
+ );
177
232
  const searchedBlocks = results.filter(
178
233
  r => r.domain === 'template' && r.kind === 'block',
179
234
  );
@@ -223,13 +278,6 @@ export async function kitSignals(query, options = {}) {
223
278
  const blocksKept = toLimit(blocks);
224
279
  const domainKept = toLimit(domain);
225
280
 
226
- // A kit narrowed to components or hooks has no page to start from; every
227
- // other kit does, so the reader is never left to compose a page from scratch.
228
- const wantsPages = !type || type === 'template';
229
- const templates = wantsPages
230
- ? await loadTemplates(cwd)
231
- : {pages: [], blocks: []};
232
- const catalog = templates.pages;
233
281
  const ranked = wantsPages ? rankPages(query, catalog) : [];
234
282
  // A part of a page starts where it lives (spec:AST-048/FR3); the project's
235
283
  // own components say what a part is. The search above already gathered them
@@ -238,15 +286,42 @@ export async function kitSignals(query, options = {}) {
238
286
  ? (searchedComponents(result) ?? (await loadComponents(cwd)))
239
287
  : [];
240
288
  const kind = wantsPages ? ideaKind(query, catalog, components) : 'page';
289
+ /** @param {import('../_adapter.mjs').PageTemplate} t */
290
+ const placeOf = t => pageDestination(t.name, cwd);
291
+ const pieceWords = new Set(components.map(c => nameTerms(c).at(-1) ?? ''));
241
292
  const chosen = wantsPages
242
- ? chooseStart(ranked, kind, matchedPages, directMatch, catalog, query)
293
+ ? chooseStart(
294
+ ranked,
295
+ kind,
296
+ matchedPages,
297
+ directMatch,
298
+ catalog,
299
+ query,
300
+ placeOf,
301
+ namedUnready,
302
+ pieceWords,
303
+ )
243
304
  : null;
244
305
  // Name the ranker's next two templates beside the start: the reader judges
245
306
  // meaning better than keywords do, and an acceptable template is in these
246
307
  // three far more often than it is the start alone.
247
- /** @type {BuildStart | null} */
248
- const start = chosen && {
308
+ // How clearly the pick model prefers the start over the other pages, for a
309
+ // reader that acts on a start only when the choice is clear.
310
+ const fit =
311
+ chosen && chosen.basis !== 'fallback'
312
+ ? pickFit(
313
+ chosen.name,
314
+ query,
315
+ ranked,
316
+ pickStart(ranked, 'page'),
317
+ catalog,
318
+ loadWeights(),
319
+ )
320
+ : null;
321
+ /** @type {Omit<BuildStart, 'isReady'> | null} */
322
+ const picked = chosen && {
249
323
  ...chosen,
324
+ ...(fit === null ? {} : {fit}),
250
325
  alternatives: pickStartAlternatives(
251
326
  ranked,
252
327
  kind,
@@ -255,23 +330,31 @@ export async function kitSignals(query, options = {}) {
255
330
  query,
256
331
  ).flatMap(r => {
257
332
  const t = catalog.find(c => c.name === r.name);
258
- return t ? [asTemplate(t)] : [];
333
+ return t
334
+ ? [{...asTemplate(t, placeOf(t)), isReady: t.isReady !== false}]
335
+ : [];
259
336
  }),
260
337
  };
261
338
 
262
339
  // Analyze what the start template needs that the project lacks (external
263
340
  // packages, StyleX compiler). Only the start — alternatives are suggestions,
264
341
  // not commitments, so reporting their needs would be noise.
265
- if (start) {
266
- const startTemplate = catalog.find(t => t.name === start.name);
267
- if (startTemplate) {
268
- const notes = templateSetupNotes(startTemplate, cwd);
269
- if (notes.length > 0) start.notes = notes;
270
- }
342
+ const startTemplate = picked && catalog.find(t => t.name === picked.name);
343
+ if (picked && startTemplate) {
344
+ const notes = templateSetupNotes(startTemplate, cwd);
345
+ if (notes.length > 0) picked.notes = notes;
271
346
  }
347
+ /** @type {BuildStart | null} */
348
+ const start = picked && {
349
+ ...picked,
350
+ isReady: startTemplate?.isReady !== false,
351
+ };
272
352
 
273
353
  return {
274
- query: result.data.query,
354
+ // The caller's own words, as search echoes a query; the names read as
355
+ // words are for matching only.
356
+ query: String(query).trim(),
357
+ idea: searched,
275
358
  matchCount,
276
359
  directMatch,
277
360
  start,
@@ -9,8 +9,9 @@
9
9
  *
10
10
  * `direct` means two independent signals agree: the start is also search's
11
11
  * direct match. The ranker sees only ready templates, so a template
12
- * still marked not ready is never the start; when search matched one directly
13
- * the reason names it, so the reader knows why the kit starts elsewhere.
12
+ * still marked not ready is never the start; when the idea names one that
13
+ * search matched directly, the reason says it is not ready yet and where build
14
+ * started instead. A not-ready template the idea does not name is never named.
14
15
  *
15
16
  * @param {import('./rank.mjs').RankedPage[]} ranked
16
17
  * @param {import('./rank.mjs').IdeaKind} kind
@@ -18,9 +19,14 @@
18
19
  * @param {boolean} directMatch
19
20
  * @param {PageTemplate[]} catalog
20
21
  * @param {string} idea
21
- * @returns {Omit<BuildStart, 'alternatives'> | null}
22
+ * @param {(t: PageTemplate) => string | null} [placeOf] the path a template
23
+ * is scaffolded to, quoted for a shell; null when none is known
24
+ * @param {string | null} [unready] a not-ready page template the idea names
25
+ * and search matched directly; the reason says it is not ready yet
26
+ * @param {Set<string>} [pieceWords] the last word of each component's name
27
+ * @returns {Omit<BuildStart, 'alternatives' | 'isReady'> | null}
22
28
  */
23
- export function chooseStart(ranked: import("./rank.mjs").RankedPage[], kind: import("./rank.mjs").IdeaKind, pages: SearchResultEntry[], directMatch: boolean, catalog: PageTemplate[], idea: string): Omit<BuildStart, "alternatives"> | null;
29
+ export function chooseStart(ranked: import("./rank.mjs").RankedPage[], kind: import("./rank.mjs").IdeaKind, pages: SearchResultEntry[], directMatch: boolean, catalog: PageTemplate[], idea: string, placeOf?: (t: PageTemplate) => string | null, unready?: string | null, pieceWords?: Set<string>): Omit<BuildStart, "alternatives" | "isReady"> | null;
24
30
  /**
25
31
  * The next best page templates beside the start (spec:AST-048/FR7), in the
26
32
  * order the start itself is chosen from. The candidates are the ranker's (a
@@ -40,13 +46,22 @@ export function chooseStart(ranked: import("./rank.mjs").RankedPage[], kind: imp
40
46
  * @returns {import('./rank.mjs').RankedPage[]}
41
47
  */
42
48
  export function pickStartAlternatives(ranked: import("./rank.mjs").RankedPage[], kind: import("./rank.mjs").IdeaKind, startName: string, catalog: PageTemplate[], idea: string): import("./rank.mjs").RankedPage[];
43
- export function asTemplate(t: PageTemplate): {
49
+ export function asTemplate(t: PageTemplate, to?: string | null): {
44
50
  name: string;
45
51
  package: string;
46
52
  displayName: string;
47
53
  description: string;
48
54
  command: string;
49
55
  };
56
+ /**
57
+ * The `start.fit` at and above which a page-template start is a clear choice.
58
+ * Below it, the pick model's start agrees with labeled build requests less
59
+ * than half the time; at and above it, more than half the time. A reader that
60
+ * acts on a start only when the choice is clear (theme preview adding a page,
61
+ * wording that calls a start a good fit) compares `start.fit` with this one
62
+ * value.
63
+ */
64
+ export const CLEAR_FIT: 0.4;
50
65
  export type SearchResultEntry = import("../../search/search.type.mjs").SearchResultEntry;
51
66
  export type BuildStart = import("../build.type.mjs").BuildStart;
52
67
  export type PageTemplate = import("../_adapter.mjs").PageTemplate;