@astryxdesign/cli 0.7.17-canary.g4ea41ce → 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 (409) hide show
  1. package/README.md +7 -2
  2. package/api/build/_adapter.d.mts +7 -6
  3. package/api/build/_adapter.mjs +18 -11
  4. package/api/build/build.type.mjs +1 -1
  5. package/api/build/kit/kind.d.mts +6 -0
  6. package/api/build/kit/kind.mjs +1 -1
  7. package/api/build/kit/rank.d.mts +7 -1
  8. package/api/build/kit/rank.mjs +15 -5
  9. package/api/build/kit/signals.mjs +58 -57
  10. package/api/build/kit/start.d.mts +2 -1
  11. package/api/build/kit/start.mjs +62 -9
  12. package/api/build/kit/words.d.mts +6 -2
  13. package/api/build/kit/words.mjs +7 -3
  14. package/api/component/__fixtures__/resolutions/modules.txt +2 -2
  15. package/api/component/_adapter.d.mts +30 -24
  16. package/api/component/_adapter.mjs +72 -31
  17. package/api/component/component.mjs +4 -4
  18. package/api/component/detail/detail.d.mts +2 -2
  19. package/api/component/detail/detail.mjs +1 -1
  20. package/api/component/list/list.d.mts +2 -2
  21. package/api/component/list/list.mjs +4 -4
  22. package/api/discover/_adapter.mjs +15 -15
  23. package/api/docs/_adapter.d.mts +13 -5
  24. package/api/docs/_adapter.mjs +37 -10
  25. package/api/doctor/_adapter.d.mts +32 -0
  26. package/api/doctor/_adapter.mjs +56 -1
  27. package/api/doctor/doctor.mjs +28 -5
  28. package/api/doctor/theme-checks.mjs +165 -83
  29. package/api/error.d.mts +4 -3
  30. package/api/error.mjs +3 -2
  31. package/api/hook/_adapter.d.mts +5 -4
  32. package/api/hook/_adapter.mjs +6 -5
  33. package/api/icon/_options.d.mts +17 -0
  34. package/api/icon/_options.mjs +54 -0
  35. package/api/icon/exportIconIndex.doc.d.mts +10 -0
  36. package/api/icon/exportIconIndex.doc.mjs +59 -0
  37. package/api/icon/icon.mjs +11 -34
  38. package/api/icon/icon.type.d.mts +49 -0
  39. package/api/icon/icon.type.mjs +24 -0
  40. package/api/icon/rankIconIndex.doc.d.mts +10 -0
  41. package/api/icon/rankIconIndex.doc.mjs +79 -0
  42. package/api/icon/search/icon-index.d.mts +41 -0
  43. package/api/icon/search/icon-index.mjs +139 -0
  44. package/api/icon/search/search.d.mts +18 -0
  45. package/api/icon/search/search.mjs +13 -0
  46. package/api/index.d.mts +1 -0
  47. package/api/index.mjs +1 -0
  48. package/api/search/_adapter.d.mts +8 -5
  49. package/api/search/_adapter.mjs +14 -10
  50. package/api/search/_gather-components.d.mts +4 -4
  51. package/api/search/_gather-components.mjs +4 -3
  52. package/api/search/_gather-hooks.d.mts +2 -2
  53. package/api/search/_gather-hooks.mjs +1 -1
  54. package/api/search/_lexical.mjs +12 -2
  55. package/api/search/_priority.d.mts +10 -2
  56. package/api/search/_priority.mjs +37 -7
  57. package/api/search/_score.d.mts +12 -3
  58. package/api/search/_score.mjs +6 -3
  59. package/api/search/_words.mjs +12 -3
  60. package/api/search/search.d.mts +7 -1
  61. package/api/search/search.mjs +37 -4
  62. package/api/swizzle/_adapter.d.mts +7 -5
  63. package/api/swizzle/_adapter.mjs +7 -3
  64. package/api/swizzle/copy/copy.mjs +5 -4
  65. package/api/theme/build/build.d.mts +5 -0
  66. package/api/theme/build/build.mjs +400 -21
  67. package/api/theme/build/family.mjs +18 -7
  68. package/api/theme/build/font-warning.mjs +5 -4
  69. package/api/theme/build/input-fields.d.mts +21 -6
  70. package/api/theme/build/input-fields.mjs +104 -13
  71. package/api/theme/build/typography-values.d.mts +22 -0
  72. package/api/theme/build/typography-values.mjs +172 -22
  73. package/api/theme/build/written-values.d.mts +7 -0
  74. package/api/theme/build/written-values.mjs +57 -8
  75. package/api/theme/generateTonalPalette.doc.mjs +1 -1
  76. package/api/theme/palette/generate/generator.d.mts +14 -2
  77. package/api/theme/palette/generate/generator.mjs +94 -8
  78. package/api/theme/theme.type.d.mts +21 -4
  79. package/api/theme/theme.type.mjs +14 -5
  80. package/api/theme/themePaletteGenerate.doc.mjs +1 -1
  81. package/api/theme/themeTemplate.doc.mjs +18 -3
  82. package/api/theme-edit/_adapter.d.mts +1 -1
  83. package/api/theme-edit/_adapter.mjs +1 -1
  84. package/api/theme-edit/_catalog.d.mts +10 -4
  85. package/api/theme-edit/_catalog.mjs +81 -22
  86. package/api/theme-edit/_check.mjs +402 -88
  87. package/api/theme-edit/_color.d.mts +11 -2
  88. package/api/theme-edit/_color.mjs +23 -7
  89. package/api/theme-edit/_compiler.mjs +11 -3
  90. package/api/theme-edit/_context.d.mts +87 -6
  91. package/api/theme-edit/_context.mjs +224 -17
  92. package/api/theme-edit/_css.mjs +4 -0
  93. package/api/theme-edit/_edit.mjs +331 -58
  94. package/api/theme-edit/_how-question.d.mts +11 -0
  95. package/api/theme-edit/_how-question.mjs +2514 -234
  96. package/api/theme-edit/_how.mjs +79 -14
  97. package/api/theme-edit/_missed.mjs +294 -32
  98. package/api/theme-edit/_normal.d.mts +3 -1
  99. package/api/theme-edit/_normal.mjs +4 -1
  100. package/api/theme-edit/_palette.mjs +36 -5
  101. package/api/theme-edit/_part-words.mjs +20 -2
  102. package/api/theme-edit/_parts.d.mts +12 -1
  103. package/api/theme-edit/_parts.mjs +116 -11
  104. package/api/theme-edit/_preview-app.mjs +40 -2
  105. package/api/theme-edit/_preview.d.mts +45 -5
  106. package/api/theme-edit/_preview.mjs +173 -21
  107. package/api/theme-edit/_settings.d.mts +20 -0
  108. package/api/theme-edit/_settings.mjs +1033 -94
  109. package/api/theme-edit/_tables.mjs +2 -2
  110. package/api/theme-edit/theme-edit.type.d.mts +6 -5
  111. package/api/theme-edit/theme-edit.type.mjs +8 -8
  112. package/api/upgrade/_adapter.mjs +13 -2
  113. package/assets/component-list.generated.json +1 -1
  114. package/assets/docs/tree/authoring.doc.mjs +1 -0
  115. package/assets/docs/tree/cli.doc.mjs +1 -0
  116. package/assets/docs/tree/computer-agent-guide.doc.mjs +1 -1
  117. package/assets/docs/tree/generate-a-palette.doc.mjs +2 -2
  118. package/assets/docs/tree/global.doc.mjs +1 -0
  119. package/assets/docs/tree/single-component.doc.mjs +40 -2
  120. package/assets/docs/tree/updates.doc.mjs +1 -1
  121. package/assets/docs/tree/who-answers.doc.mjs +2 -2
  122. package/assets/docs-routes.generated.json +1 -1
  123. package/assets/docs.generated.json +2 -2
  124. package/assets/search-catalog.generated.json +2 -2
  125. package/assets/self-audit.generated.json +1 -1
  126. package/assets/templates/blocks/components/Blockquote/BlockquoteShowcase.tsx +1 -1
  127. package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.tsx +4 -4
  128. package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsCustomSeparator.tsx +1 -0
  129. package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsSupportingVariant.tsx +2 -2
  130. package/assets/templates/blocks/components/Card/CardElevations.tsx +1 -1
  131. package/assets/templates/blocks/components/Card/CardWithInnerLayout.tsx +19 -3
  132. package/assets/templates/blocks/components/Card/ClickableCardWithNestedButton.tsx +11 -1
  133. package/assets/templates/blocks/components/Card/SelectableCardElevated.tsx +1 -1
  134. package/assets/templates/blocks/components/Card/SelectableCardMulti.tsx +1 -1
  135. package/assets/templates/blocks/components/Center/CenterHorizontal.tsx +1 -1
  136. package/assets/templates/blocks/components/Center/CenterInsideACard.tsx +1 -1
  137. package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsx +8 -0
  138. package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsx +8 -2
  139. package/assets/templates/blocks/components/ChatLayout/ChatLayoutPanelChat.tsx +1 -0
  140. package/assets/templates/blocks/components/ChatLayout/ChatLayoutShowcase.tsx +1 -1
  141. package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleCustomContent.tsx +9 -1
  142. package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx +12 -2
  143. package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.tsx +28 -7
  144. package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +35 -7
  145. package/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx +1 -1
  146. package/assets/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupBasic.tsx +20 -4
  147. package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.tsx +15 -3
  148. package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.tsx +29 -6
  149. package/assets/templates/blocks/components/ContextMenu/ContextMenuBasic.tsx +2 -2
  150. package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.tsx +1 -1
  151. package/assets/templates/blocks/components/ContextMenu/ContextMenuShowcase.tsx +2 -2
  152. package/assets/templates/blocks/components/Divider/DividerFullBleed.tsx +1 -1
  153. package/assets/templates/blocks/components/Divider/DividerShowcase.tsx +1 -1
  154. package/assets/templates/blocks/components/Divider/DividerVariants.tsx +1 -1
  155. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +23 -4
  156. package/assets/templates/blocks/components/EmptyState/EmptyStateActions.tsx +18 -2
  157. package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.tsx +20 -2
  158. package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.tsx +16 -2
  159. package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx +11 -1
  160. package/assets/templates/blocks/components/Heading/HeadingTruncation.tsx +12 -2
  161. package/assets/templates/blocks/components/InternationalizationProvider/useDirectionHookUsage.tsx +1 -1
  162. package/assets/templates/blocks/components/LayoutContent/LayoutContentBasic.tsx +1 -1
  163. package/assets/templates/blocks/components/LayoutContent/LayoutContentShowcase.tsx +1 -1
  164. package/assets/templates/blocks/components/LayoutFooter/LayoutFooterActions.tsx +17 -3
  165. package/assets/templates/blocks/components/LayoutFooter/LayoutFooterShowcase.tsx +17 -3
  166. package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderShowcase.tsx +15 -3
  167. package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderWithActions.tsx +9 -2
  168. package/assets/templates/blocks/components/LayoutPanel/LayoutPanelNavigation.tsx +1 -1
  169. package/assets/templates/blocks/components/LayoutPanel/LayoutPanelShowcase.tsx +1 -1
  170. package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.tsx +1 -1
  171. package/assets/templates/blocks/components/MultiSelector/MultiSelectorGhostToolbar.tsx +14 -2
  172. package/assets/templates/blocks/components/Outline/OutlineDensity.tsx +2 -0
  173. package/assets/templates/blocks/components/OverflowList/OverflowListShowcase.tsx +6 -1
  174. package/assets/templates/blocks/components/Pagination/PaginationVariants.tsx +4 -0
  175. package/assets/templates/blocks/components/Popover/PopoverHookUsage.tsx +17 -2
  176. package/assets/templates/blocks/components/SegmentedControl/SegmentedControlFillLayout.tsx +1 -1
  177. package/assets/templates/blocks/components/Selector/SelectorGhostToolbar.tsx +14 -2
  178. package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +8 -1
  179. package/assets/templates/blocks/components/SideNav/SideNavWithHeaderMenu.tsx +2 -2
  180. package/assets/templates/blocks/components/SideNavHeading/SideNavHeadingShowcase.tsx +2 -0
  181. package/assets/templates/blocks/components/Switch/SwitchWithStatus.tsx +1 -1
  182. package/assets/templates/blocks/components/TabList/TabListTabsFillLayout.tsx +1 -1
  183. package/assets/templates/blocks/components/TabList/TabListTabsWithActions.tsx +12 -1
  184. package/assets/templates/blocks/components/Table/TableBulkActionsTable.tsx +11 -1
  185. package/assets/templates/blocks/components/Table/TableInCard.tsx +2 -2
  186. package/assets/templates/blocks/components/Text/TextTruncation.tsx +1 -1
  187. package/assets/templates/blocks/components/Text/TextWordBreak.tsx +12 -2
  188. package/assets/templates/blocks/components/Text/TextWrap.tsx +19 -4
  189. package/assets/templates/blocks/components/TextArea/TextAreaCharacterCount.tsx +1 -1
  190. package/assets/templates/blocks/components/TextArea/TextAreaShowcase.tsx +1 -1
  191. package/assets/templates/blocks/components/TextArea/TextAreaStates.tsx +1 -1
  192. package/assets/templates/blocks/components/TextArea/TextAreaValidation.tsx +1 -1
  193. package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.tsx +1 -1
  194. package/assets/templates/blocks/components/TextInput/TextInputStatusVariant.tsx +2 -2
  195. package/assets/templates/blocks/components/Timestamp/TimestampAutoFormat.tsx +15 -1
  196. package/assets/templates/blocks/components/Timestamp/TimestampRelativeFormat.tsx +15 -1
  197. package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +8 -0
  198. package/assets/templates/blocks/components/Toolbar/ToolbarSizes.tsx +12 -1
  199. package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +18 -3
  200. package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx +6 -0
  201. package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx +7 -1
  202. package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.tsx +2 -2
  203. package/assets/templates/blocks/components/TopNav/TopNavShowcase.tsx +9 -0
  204. package/assets/templates/components.generated.json +1 -1
  205. package/assets/templates/pages/ai-chat/page.tsx +102 -6
  206. package/assets/templates/pages/canvas-editor/page.tsx +73 -2
  207. package/assets/templates/pages/centered-hero/page.tsx +10 -4
  208. package/assets/templates/pages/course-detail/page.tsx +46 -2
  209. package/assets/templates/pages/dashboard/page.tsx +45 -16
  210. package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +31 -20
  211. package/assets/templates/pages/dashboard-comparison/page.tsx +9 -0
  212. package/assets/templates/pages/dashboard-composition/page.tsx +22 -9
  213. package/assets/templates/pages/dashboard-progress/page.tsx +27 -15
  214. package/assets/templates/pages/dashboard-scorecard/page.tsx +9 -0
  215. package/assets/templates/pages/detail-page/page.tsx +105 -77
  216. package/assets/templates/pages/documentation/page.tsx +15 -2
  217. package/assets/templates/pages/documentation-design/page.tsx +7 -34
  218. package/assets/templates/pages/documentation-technical/page.tsx +76 -12
  219. package/assets/templates/pages/editor/page.tsx +26 -21
  220. package/assets/templates/pages/file-explorer/page.tsx +35 -1
  221. package/assets/templates/pages/form-two-column/page.tsx +2 -3
  222. package/assets/templates/pages/form-wizard/page.tsx +31 -3
  223. package/assets/templates/pages/form-wizard-vertical/page.tsx +32 -3
  224. package/assets/templates/pages/gallery-hero/page.tsx +2 -1
  225. package/assets/templates/pages/ide/page.tsx +15 -1
  226. package/assets/templates/pages/incident-console/page.tsx +2 -1
  227. package/assets/templates/pages/incident-console/template.doc.mjs +1 -1
  228. package/assets/templates/pages/kanban-board/page.tsx +39 -2
  229. package/assets/templates/pages/payment-form/page.tsx +77 -39
  230. package/assets/templates/pages/product-gallery/page.tsx +16 -14
  231. package/assets/templates/pages/settings/page.tsx +35 -3
  232. package/assets/templates/pages/settings-dialog/page.tsx +34 -5
  233. package/assets/templates/pages/settings-sidebar/page.tsx +23 -3
  234. package/assets/templates/pages/shell-nav/page.tsx +28 -12
  235. package/assets/templates/pages/shell-side-nav/page.tsx +16 -1
  236. package/assets/templates/pages/shell-top-nav/page.tsx +27 -1
  237. package/assets/templates/pages/side-gallery/page.tsx +1 -1
  238. package/assets/templates/pages/table/page.tsx +2 -1
  239. package/assets/templates/pages/table/template.doc.mjs +1 -1
  240. package/assets/templates/pages/table-collapsible/page.tsx +1 -1
  241. package/assets/templates/pages/table-comparison/page.tsx +1 -1
  242. package/assets/templates/pages/table-filter/page.tsx +9 -2
  243. package/assets/templates/pages/table-grouped/page.tsx +16 -6
  244. package/assets/templates/pages/table-inbox/page.tsx +60 -1
  245. package/assets/templates/pages/table-page/page.tsx +10 -2
  246. package/assets/templates/pages/table-tree/page.tsx +95 -13
  247. package/assets/templates/pages/theme-showcase/page.tsx +107 -11
  248. package/assets/templates/pages/work-item-detail/page.tsx +88 -74
  249. package/assets/templates/pages/work-item-detail/template.doc.mjs +0 -1
  250. package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +1 -1
  251. package/assets/templates/themes/gothic/gothicTheme.ts +5 -0
  252. package/assets/templates/themes/neutral/neutralTheme.ts +1 -1
  253. package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +1 -1
  254. package/assets/templates/themes/y2k/y2kTheme.ts +1 -1
  255. package/authoring/debug/parse.d.mts +1 -1
  256. package/authoring/doctypes/_schema.d.mts +22 -8
  257. package/authoring/doctypes/_schema.mjs +31 -0
  258. package/authoring/doctypes/command/command.doc.mjs +24 -0
  259. package/authoring/doctypes/command/type.ts +31 -0
  260. package/authoring/doctypes/component/component.doc.mjs +1 -1
  261. package/authoring/doctypes/component/type.ts +8 -5
  262. package/authoring/doctypes/namespace/namespace.doc.mjs +6 -0
  263. package/authoring/doctypes/namespace/type.ts +4 -0
  264. package/authoring/doctypes/template/type.ts +0 -7
  265. package/authoring/index.d.ts +6 -1
  266. package/authoring/integration/integration.doc.mjs +7 -0
  267. package/authoring/integration/schema.d.mts +6 -0
  268. package/authoring/integration/schema.mjs +3 -0
  269. package/authoring/integration/type.ts +34 -0
  270. package/clients/cli/build-id.generated.json +1 -1
  271. package/clients/cli/commands/component.doc.mjs +1 -0
  272. package/clients/cli/commands/component.mjs +5 -1
  273. package/clients/cli/commands/docs.doc.mjs +1 -1
  274. package/clients/cli/commands/experimental/index.mjs +4 -1
  275. package/clients/cli/commands/experimental/theme.mjs +139 -64
  276. package/clients/cli/commands/experimental-render.doc.mjs +2 -0
  277. package/clients/cli/commands/experimental-theme-add.doc.mjs +2 -0
  278. package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -0
  279. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +1 -0
  280. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +3 -1
  281. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +3 -2
  282. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +2 -1
  283. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +3 -2
  284. package/clients/cli/commands/experimental-theme-eject.doc.mjs +1 -0
  285. package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +1 -0
  286. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -0
  287. package/clients/cli/commands/experimental-theme-remove.doc.mjs +2 -0
  288. package/clients/cli/commands/experimental-theme-targets.doc.mjs +1 -0
  289. package/clients/cli/commands/experimental-theme-template.doc.mjs +1 -0
  290. package/clients/cli/commands/experimental-theme-use.doc.mjs +2 -0
  291. package/clients/cli/commands/gap-report.doc.mjs +1 -0
  292. package/clients/cli/commands/hook.doc.mjs +1 -1
  293. package/clients/cli/commands/init.doc.mjs +1 -1
  294. package/clients/cli/commands/integration-add.doc.mjs +1 -0
  295. package/clients/cli/commands/manifest.mjs +10 -3
  296. package/clients/cli/commands/swizzle.doc.mjs +8 -1
  297. package/clients/cli/commands/swizzle.mjs +13 -6
  298. package/clients/cli/commands/template.doc.mjs +3 -0
  299. package/clients/cli/commands/theme-add.doc.mjs +2 -1
  300. package/clients/cli/commands/theme-build.doc.mjs +2 -1
  301. package/clients/cli/commands/theme-eject.doc.mjs +1 -1
  302. package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -2
  303. package/clients/cli/commands/theme-remove.doc.mjs +2 -1
  304. package/clients/cli/commands/theme-targets.doc.mjs +1 -0
  305. package/clients/cli/commands/theme-template.doc.mjs +1 -0
  306. package/clients/cli/commands/theme-use.doc.mjs +2 -1
  307. package/clients/cli/commands/theme.doc.mjs +7 -2
  308. package/clients/cli/commands/theme.mjs +21 -5
  309. package/clients/cli/index.mjs +167 -59
  310. package/clients/cli/lib/base-gate.mjs +522 -0
  311. package/clients/cli/lib/command-path.mjs +26 -0
  312. package/clients/cli/lib/define-command.mjs +161 -12
  313. package/clients/cli/lib/json-shim.mjs +34 -31
  314. package/clients/cli/lib/manifest.d.ts +14 -0
  315. package/clients/cli/lib/manifest.mjs +78 -22
  316. package/clients/cli/lib/root-args.mjs +79 -0
  317. package/clients/cli/lib/stray-option.mjs +21 -8
  318. package/clients/cli/lib/unknown-command.mjs +27 -6
  319. package/clients/cli/manifest.generated.json +1 -1
  320. package/clients/cli/run.mjs +13 -1
  321. package/foundation/agent-docs/computer-agent-text.mjs +1 -1
  322. package/foundation/bases/core-docs.d.mts +10 -0
  323. package/foundation/bases/core-docs.mjs +42 -0
  324. package/foundation/bases/core.d.mts +11 -0
  325. package/foundation/bases/core.mjs +32 -0
  326. package/foundation/bases/requirements.d.mts +128 -0
  327. package/foundation/bases/requirements.mjs +193 -0
  328. package/foundation/bases/resolve.d.mts +134 -0
  329. package/foundation/bases/resolve.mjs +295 -0
  330. package/foundation/bases/state.d.mts +24 -0
  331. package/foundation/bases/state.mjs +46 -0
  332. package/foundation/bases/steps.d.mts +49 -0
  333. package/foundation/bases/steps.mjs +88 -0
  334. package/foundation/config/project.d.mts +14 -0
  335. package/foundation/config/project.mjs +68 -1
  336. package/foundation/discovery/cli-self-docs.mjs +9 -1
  337. package/foundation/discovery/command-pointers.d.mts +28 -0
  338. package/foundation/discovery/command-pointers.mjs +31 -0
  339. package/foundation/discovery/component-discovery.d.mts +9 -8
  340. package/foundation/discovery/component-discovery.mjs +9 -4
  341. package/foundation/discovery/docs-discovery.d.mts +13 -5
  342. package/foundation/discovery/docs-discovery.mjs +25 -6
  343. package/foundation/discovery/hook-discovery.d.mts +6 -6
  344. package/foundation/discovery/hook-discovery.mjs +6 -4
  345. package/foundation/discovery/template-adapter.mjs +5 -0
  346. package/foundation/discovery/template-ids.d.mts +1 -1
  347. package/foundation/discovery/template-ids.mjs +5 -1
  348. package/foundation/discovery/theme-discovery.mjs +3 -0
  349. package/foundation/discovery/theme-imports.mjs +19 -1
  350. package/foundation/doc-compiler/tree.d.mts +4 -2
  351. package/foundation/doc-compiler/tree.mjs +46 -1
  352. package/foundation/env/package-manager.d.mts +7 -0
  353. package/foundation/env/package-manager.mjs +21 -0
  354. package/foundation/fonts/font-stylesheet.d.mts +8 -0
  355. package/foundation/fonts/font-stylesheet.mjs +26 -2
  356. package/foundation/fs/gather-cache.mjs +44 -13
  357. package/foundation/fs/own-modules.d.mts +29 -0
  358. package/foundation/fs/own-modules.mjs +57 -0
  359. package/foundation/fs/paths.d.mts +30 -2
  360. package/foundation/fs/paths.mjs +49 -2
  361. package/foundation/integrations/integrations.d.mts +4 -0
  362. package/foundation/integrations/integrations.mjs +6 -1
  363. package/foundation/release/choose.d.mts +7 -0
  364. package/foundation/release/choose.mjs +16 -2
  365. package/foundation/release/notices.d.mts +26 -0
  366. package/foundation/release/notices.mjs +48 -19
  367. package/foundation/release/project.d.mts +3 -2
  368. package/foundation/release/project.mjs +4 -5
  369. package/foundation/release/run-context.d.mts +7 -2
  370. package/foundation/release/run-context.mjs +6 -2
  371. package/foundation/render/css-cut.mjs +86 -6
  372. package/foundation/render/cut-short.d.mts +35 -0
  373. package/foundation/render/cut-short.mjs +124 -0
  374. package/foundation/render/font-probe.d.mts +27 -0
  375. package/foundation/render/font-probe.mjs +77 -0
  376. package/foundation/render/layers.d.mts +1 -9
  377. package/foundation/render/layers.mjs +2 -111
  378. package/foundation/render/page-worker.mjs +83 -6
  379. package/foundation/render/picture-chrome.mjs +24 -2
  380. package/foundation/render/picture-playwright.mjs +22 -2
  381. package/foundation/render/picture-window.d.mts +20 -4
  382. package/foundation/render/picture-window.mjs +137 -4
  383. package/foundation/response/base.d.ts +25 -0
  384. package/foundation/response/error-codes.d.mts +4 -1
  385. package/foundation/response/error-codes.d.ts +4 -1
  386. package/foundation/response/error-codes.doc.mjs +17 -0
  387. package/foundation/response/error-codes.mjs +21 -0
  388. package/foundation/response/json.d.mts +3 -1
  389. package/foundation/response/json.mjs +7 -2
  390. package/foundation/response/response-types.doc.mjs +2 -2
  391. package/foundation/suggest/name-index.d.mts +2 -1
  392. package/foundation/suggest/name-index.mjs +1 -1
  393. package/foundation/suggest/other-command.d.mts +4 -1
  394. package/foundation/suggest/other-command.mjs +23 -6
  395. package/foundation/text/string-utils.d.mts +7 -2
  396. package/foundation/text/string-utils.mjs +24 -10
  397. package/package.json +6 -6
  398. package/assets/templates/pages/access-denied/page.tsx +0 -101
  399. package/assets/templates/pages/access-denied/template.doc.mjs +0 -24
  400. package/assets/templates/pages/error-page/page.tsx +0 -130
  401. package/assets/templates/pages/error-page/template.doc.mjs +0 -22
  402. package/assets/templates/pages/not-found/page.tsx +0 -124
  403. package/assets/templates/pages/not-found/template.doc.mjs +0 -30
  404. package/assets/templates/pages/review-workspace/page.tsx +0 -551
  405. package/assets/templates/pages/review-workspace/template.doc.mjs +0 -31
  406. package/assets/templates/pages/run-console/page.tsx +0 -945
  407. package/assets/templates/pages/run-console/template.doc.mjs +0 -27
  408. package/assets/templates/pages/welcome-portal/page.tsx +0 -538
  409. package/assets/templates/pages/welcome-portal/template.doc.mjs +0 -38
@@ -22,7 +22,7 @@ import * as fs from 'node:fs';
22
22
  import * as path from 'node:path';
23
23
  import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
24
24
  import {
25
- requireCoreDir as requireAnswerCoreDir,
25
+ coreContentDir as answerCoreContentDir,
26
26
  discoverExternalPackages,
27
27
  } from '../../foundation/fs/paths.mjs';
28
28
  import {
@@ -44,7 +44,11 @@ import {Project} from '../../foundation/config/project.mjs';
44
44
  import {loadComponentDoc as loadValidatedComponentDoc} from '../../foundation/discovery/component-loader.mjs';
45
45
  import {resolveComponentReplacements} from '../../foundation/discovery/component-replacement.mjs';
46
46
  import {integrationComponentViews} from '../../foundation/discovery/integration-component-views.mjs';
47
- import {searchComponents} from '../../foundation/text/string-utils.mjs';
47
+ import {
48
+ EXACT_KEYWORD_SCORE,
49
+ EXACT_NAME_SCORE,
50
+ searchComponents,
51
+ } from '../../foundation/text/string-utils.mjs';
48
52
  import {
49
53
  rankComponentSuggestions,
50
54
  synonymMatches,
@@ -63,6 +67,8 @@ import {
63
67
 
64
68
  /** How far below the first suggestion's score a later one may be. */
65
69
  const NEAR_FIRST = 10;
70
+ /** How far a clear match scores above every other Core match. */
71
+ const CLEAR_GAP = 20;
66
72
 
67
73
  /** @type {Record<string, {synonyms?: string[]}> | undefined} */
68
74
  let cards;
@@ -151,12 +157,14 @@ export {CORE_PACKAGE, unscopedComponentOwners};
151
157
  */
152
158
 
153
159
  /**
154
- * Locate `@astryxdesign/core`, throwing the stable not-found error when absent.
160
+ * Locate the Core whose components this run reads, throwing the stable
161
+ * not-found error when a run on Core finds none. Null in a run whose base is
162
+ * not Core: it has no Core components.
155
163
  * @param {string} cwd
156
- * @returns {string}
164
+ * @returns {string | null}
157
165
  */
158
- export function requireCoreDir(cwd) {
159
- return coreDirOrThrow(requireAnswerCoreDir, cwd);
166
+ export function coreContentDir(cwd) {
167
+ return coreDirOrThrow(answerCoreContentDir, cwd);
160
168
  }
161
169
 
162
170
  /**
@@ -193,7 +201,7 @@ export function loadComponentReplacements(coreDir, loadedIntegrations) {
193
201
  /**
194
202
  * The integration component that answers to the Core component name
195
203
  * `dirName` for unqualified lookup, or undefined when none replaces it.
196
- * @param {string} coreDir
204
+ * @param {string | null} coreDir
197
205
  * @param {import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]} loadedIntegrations
198
206
  * @param {string} dirName
199
207
  * @returns {Promise<import('../../foundation/discovery/component-replacement.mjs').ActiveComponentReplacement | undefined>}
@@ -223,7 +231,7 @@ function findLoadedIntegration(loadedIntegrations, packageName) {
223
231
  * Read the exact installed version available to a package-qualified component
224
232
  * selector. Legacy docs packages do not expose a reliable version here, so a
225
233
  * version-qualified lookup never falls through to them.
226
- * @param {string} coreDir
234
+ * @param {string | null} coreDir
227
235
  * @param {import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]} loadedIntegrations
228
236
  * @param {string} packageName
229
237
  * @returns {string|null}
@@ -234,6 +242,7 @@ export function installedComponentPackageVersion(
234
242
  packageName,
235
243
  ) {
236
244
  if (packageName === CORE_PACKAGE) {
245
+ if (coreDir == null) return null;
237
246
  try {
238
247
  const pkg = JSON.parse(
239
248
  fs.readFileSync(path.join(coreDir, 'package.json'), 'utf8'),
@@ -262,7 +271,7 @@ function resolveExternalPackage(packageName, cwd) {
262
271
  * Build the set of OWNER packages that provide a component with this name
263
272
  * across core + every loaded integration. This is what lets the CLI
264
273
  * disambiguate by package and expose the owner's source + issuesUrl.
265
- * @param {string} coreDir
274
+ * @param {string | null} coreDir
266
275
  * @param {string} dirName - bare component name (no `XDS` prefix)
267
276
  * @param {import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]} loadedIntegrations
268
277
  * @returns {ComponentOwner[]}
@@ -437,7 +446,7 @@ export function legacyExternalKeeps(cwd, dirName, owners) {
437
446
  /**
438
447
  * The core source file for `dirName` (the no-scope `--source` path reads core
439
448
  * directly — it does NOT fall back to externals or fuzzy search).
440
- * @param {string} coreDir
449
+ * @param {string | null} coreDir
441
450
  * @param {string} dirName
442
451
  * @returns {string | null}
443
452
  */
@@ -445,6 +454,25 @@ export function resolveCoreSourcePath(coreDir, dirName) {
445
454
  return findComponentSource(coreDir, dirName);
446
455
  }
447
456
 
457
+ /**
458
+ * The unknown-component error for a name that is clearly one component's
459
+ * keyword. That component is its first suggestion, and a hint for another
460
+ * command never goes ahead of it.
461
+ */
462
+ class KeywordMatchError extends AstryxError {}
463
+
464
+ /**
465
+ * The one Core match that scores above every other Core match by at least
466
+ * {@link CLEAR_GAP}, or undefined.
467
+ * @param {Array<{name: string, score: number}>} coreResults - sorted, best first
468
+ * @returns {{name: string, score: number} | undefined}
469
+ */
470
+ function clearCoreMatch(coreResults) {
471
+ const [first, second] = coreResults;
472
+ if (!first) return undefined;
473
+ return first.score - (second?.score ?? 0) >= CLEAR_GAP ? first : undefined;
474
+ }
475
+
448
476
  /**
449
477
  * Resolve a bare (unscoped) name to a `.doc.mjs`: core first, then back-compat
450
478
  * externals, then a conservative fuzzy search. Throws ERR_UNKNOWN_COMPONENT
@@ -453,10 +481,13 @@ export function resolveCoreSourcePath(coreDir, dirName) {
453
481
  * (with candidate suggestions when close) or ERR_NO_DOC.
454
482
  *
455
483
  * The suggestions for an unknown name come from every component the bare
456
- * lookup reads: Core's and each loaded integration's. Only a Core component
457
- * resolves by a close match.
484
+ * lookup reads: Core's and each loaded integration's. Past the exact file
485
+ * name, only a Core component whose name is the typed name, ignoring case,
486
+ * resolves, and only when no other Core component comes close. A typed name
487
+ * that is a component's keyword never resolves: that component goes first in
488
+ * the suggestions.
458
489
  * @param {string} dirName - bare component name (no `XDS` prefix)
459
- * @param {{coreDir: string, cwd: string, name: string, loadedIntegrations?: import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]}} ctx - `name` is the caller's original (prefixed) input, used in error text
490
+ * @param {{coreDir: string | null, cwd: string, name: string, loadedIntegrations?: import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]}} ctx - `name` is the caller's original (prefixed) input, used in error text
460
491
  * @returns {Promise<ResolvedUnscopedDoc>}
461
492
  */
462
493
  export async function resolveUnscopedDoc(
@@ -503,20 +534,19 @@ export async function resolveUnscopedDoc(
503
534
  const coreResults = results.filter(r => coreNames.has(r.name));
504
535
 
505
536
  if (results.length > 0) {
506
- const topScore = coreResults[0]?.score ?? 0;
507
- const topTied = coreResults.filter(r => r.score === topScore);
508
- const secondScore =
509
- coreResults.length > topTied.length
510
- ? coreResults[topTied.length].score
511
- : 0;
512
- const gap = topScore - secondScore;
537
+ const clear = clearCoreMatch(coreResults);
513
538
 
514
- if (topScore >= 90 && topTied.length === 1 && gap >= 20) {
515
- resolvedName = topTied[0].name;
539
+ if (clear?.score === EXACT_NAME_SCORE) {
540
+ resolvedName = clear.name;
516
541
  readmePath = findComponentReadme(coreDir, resolvedName);
517
542
  resolvedOwnerPackage = CORE_PACKAGE;
518
543
  resolvedSourcePath = findComponentSource(coreDir, resolvedName);
519
544
  } else {
545
+ // A keyword is a word to find a component by, not another name
546
+ // for it: a clear exact-keyword match never opens. It goes first
547
+ // in the suggestions instead.
548
+ const pinned =
549
+ clear?.score === EXACT_KEYWORD_SCORE ? clear.name : undefined;
520
550
  // How many to suggest: the near-top results, at most five and at
521
551
  // least two. Which ones, and in what order, is the suggestion
522
552
  // ranking's call.
@@ -525,11 +555,19 @@ export async function resolveUnscopedDoc(
525
555
  results.filter(r => r.score >= threshold).slice(0, 5).length,
526
556
  Math.min(2, results.length),
527
557
  );
528
- const candidates = rankComponentSuggestions(
558
+ const ranked = rankComponentSuggestions(
529
559
  dirName,
530
560
  results,
531
561
  [...coreNames, ...integrationComponents.map(c => c.name)],
532
562
  synonymMatches(dirName, searchCards()),
563
+ );
564
+ const candidates = (
565
+ pinned
566
+ ? [
567
+ ...ranked.filter(c => c.name === pinned),
568
+ ...ranked.filter(c => c.name !== pinned),
569
+ ]
570
+ : ranked
533
571
  ).slice(0, count);
534
572
  // Past the first two suggestions, only the ones about as close as
535
573
  // the first (within NEAR_FIRST points), or a close spelling of the
@@ -542,7 +580,8 @@ export async function resolveUnscopedDoc(
542
580
  c.score >= candidates[0].score - NEAR_FIRST ||
543
581
  levenshteinDistance(c.name.toLowerCase(), typed) <= 2,
544
582
  );
545
- throw new AstryxError(
583
+ const ErrorClass = pinned ? KeywordMatchError : AstryxError;
584
+ throw new ErrorClass(
546
585
  `No component named "${name}"`,
547
586
  nearFirst.map(c => ({name: c.name, reason: c.reason})),
548
587
  ERROR_CODES.ERR_UNKNOWN_COMPONENT,
@@ -632,7 +671,7 @@ function withExampleKinds(examples) {
632
671
  * @param {LoadedComponentDoc} docs
633
672
  * @param {OwnershipSubject} owner
634
673
  * @param {string} componentName
635
- * @param {string} coreDir
674
+ * @param {string | null} coreDir
636
675
  * @returns {import('./component.type.mjs').ComponentDetailResponse['data']}
637
676
  */
638
677
  export function withOwnership(docs, owner, componentName, coreDir) {
@@ -692,7 +731,7 @@ function resolveIntegrationImportPath(owner, componentName, authoredImport) {
692
731
  * not a scopeable parent.
693
732
  * @param {LoadedComponentDoc} docs
694
733
  * @param {string} dirName
695
- * @param {string} coreDir
734
+ * @param {string | null} coreDir
696
735
  * @returns {{scoped: LoadedComponentDoc & {parentDoc?: string, import?: string}, matchingComponent: any} | null}
697
736
  */
698
737
  export function scopeSubComponent(docs, dirName, coreDir) {
@@ -887,7 +926,7 @@ export async function linkComponentResponse(response, cwd) {
887
926
  * matcher's suggestions stay. Returns `error` unchanged otherwise.
888
927
  * @param {unknown} error
889
928
  * @param {string} dirName
890
- * @param {{coreDir: string, cwd: string}} context
929
+ * @param {{coreDir: string | null, cwd: string}} context
891
930
  * @returns {Promise<unknown>}
892
931
  */
893
932
  export async function withExampleBlockPointer(error, dirName, {coreDir, cwd}) {
@@ -931,11 +970,12 @@ export async function withExampleBlockPointer(error, dirName, {coreDir, cwd}) {
931
970
  * among its suggestions, in the place foundation/suggest/other-command.mjs
932
971
  * gives it: a hint at the folded tier or a worse one stays behind a
933
972
  * suggested component that declares the name as a keyword or synonym, and a
934
- * hook keyword hint behind one that declares the same keyword. Returns `error` unchanged otherwise,
973
+ * hook keyword hint behind one that declares the same keyword. A component
974
+ * whose keyword the name clearly is stays first. Returns `error` unchanged otherwise,
935
975
  * and when the check fails.
936
976
  * @param {unknown} error
937
977
  * @param {string} dirName
938
- * @param {{coreDir: string, cwd: string, loadedIntegrations: import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]}} context
978
+ * @param {{coreDir: string | null, cwd: string, loadedIntegrations: import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]}} context
939
979
  * @returns {Promise<unknown>}
940
980
  */
941
981
  export async function withOtherCommandHint(
@@ -978,6 +1018,7 @@ export async function withOtherCommandHint(
978
1018
  error.message,
979
1019
  withOtherCommand(error.suggestions, hint, dirName, {
980
1020
  from: 'component',
1021
+ pinned: error instanceof KeywordMatchError ? 1 : 0,
981
1022
  keywordsOf: suggestion => declared.get(suggestion.name) ?? [],
982
1023
  }),
983
1024
  ERROR_CODES.ERR_UNKNOWN_COMPONENT,
@@ -993,7 +1034,7 @@ export async function withOtherCommandHint(
993
1034
  * an integration component's match view (the first integration that has the
994
1035
  * name, as the suggestions read it). A name Core has keeps Core's doc.
995
1036
  * @param {Array<{name: string}>} suggestions
996
- * @param {string} coreDir
1037
+ * @param {string | null} coreDir null in a run that reads no Core
997
1038
  * @param {import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]} loadedIntegrations
998
1039
  * @returns {Promise<Map<string, string[]>>}
999
1040
  */
@@ -1036,7 +1077,7 @@ async function declaredNames(suggestions, coreDir, loadedIntegrations) {
1036
1077
  * the components the block uses, its own folder's component first, that
1037
1078
  * resolves as a component and whose related blocks include the block.
1038
1079
  * @param {{dirName: string, category?: string, componentsUsed?: string[]}} block
1039
- * @param {string} coreDir
1080
+ * @param {string | null} coreDir
1040
1081
  * @param {string} cwd
1041
1082
  * @returns {Promise<string | null>}
1042
1083
  */
@@ -21,7 +21,7 @@ import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
21
21
  import {AstryxError} from '../error.mjs';
22
22
  import {
23
23
  CORE_PACKAGE,
24
- requireCoreDir,
24
+ coreContentDir,
25
25
  loadIntegrationsSafely,
26
26
  resolveOwners,
27
27
  scopeIntegrationMember,
@@ -139,7 +139,7 @@ function parseComponentSelector(value, packageScope) {
139
139
  * version. Its structured suggestion points at the command that can discover
140
140
  * the requested package release.
141
141
  * @param {{package?: string, version?: string}} target
142
- * @param {string} coreDir
142
+ * @param {string | null} coreDir
143
143
  * @param {import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]} loadedIntegrations
144
144
  * @returns {void}
145
145
  */
@@ -211,7 +211,7 @@ function batchFailure(selector, error) {
211
211
  * @param {string|null} [options.lang]
212
212
  * @param {boolean} [options.zh]
213
213
  * @param {boolean} [options.dense]
214
- * @param {string} coreDir
214
+ * @param {string | null} coreDir
215
215
  * @returns {Promise<import('./component.type.mjs').ComponentBatchResponse>}
216
216
  */
217
217
  async function componentBatch(selectors, options, coreDir) {
@@ -340,7 +340,7 @@ async function componentRead(name, options = {}) {
340
340
  );
341
341
  }
342
342
 
343
- const coreDir = requireCoreDir(cwd);
343
+ const coreDir = coreContentDir(cwd);
344
344
 
345
345
  // A public API caller could pass a non-string category; the list leaf does
346
346
  // `category.toLowerCase()`, so guard it up front (same class as the name
@@ -6,10 +6,10 @@
6
6
  * @param {import('../_adapter.mjs').LoadedComponentDoc} docs
7
7
  * @param {{package: string, sourcePath: string|null}} owner
8
8
  * @param {string} componentName - name used for the import specifier
9
- * @param {string} coreDir
9
+ * @param {string | null} coreDir
10
10
  * @returns {import('../component.type.mjs').ComponentDetailResponse}
11
11
  */
12
12
  export function componentDetail(docs: import("../_adapter.mjs").LoadedComponentDoc, owner: {
13
13
  package: string;
14
14
  sourcePath: string | null;
15
- }, componentName: string, coreDir: string): import("../component.type.mjs").ComponentDetailResponse;
15
+ }, componentName: string, coreDir: string | null): import("../component.type.mjs").ComponentDetailResponse;
@@ -15,7 +15,7 @@ import {withOwnership} from '../_adapter.mjs';
15
15
  * @param {import('../_adapter.mjs').LoadedComponentDoc} docs
16
16
  * @param {{package: string, sourcePath: string|null}} owner
17
17
  * @param {string} componentName - name used for the import specifier
18
- * @param {string} coreDir
18
+ * @param {string | null} coreDir
19
19
  * @returns {import('../component.type.mjs').ComponentDetailResponse}
20
20
  */
21
21
  export function componentDetail(docs, owner, componentName, coreDir) {
@@ -5,7 +5,7 @@
5
5
  * Build the `component.list` envelope. The list taxonomy is collapsed: all
6
6
  * three detail levels emit ONE `component.list` type; the depth rides in
7
7
  * `data.detail` and the grouped map in `data.components`.
8
- * @param {string} coreDir
8
+ * @param {string | null} coreDir
9
9
  * @param {object} opts
10
10
  * @param {string} opts.cwd
11
11
  * @param {string} [opts.category] - Filter to a single category (group key).
@@ -15,7 +15,7 @@
15
15
  * @param {string|null} opts.lang
16
16
  * @returns {Promise<ComponentListResponse>}
17
17
  */
18
- export function componentList(coreDir: string, opts: {
18
+ export function componentList(coreDir: string | null, opts: {
19
19
  cwd: string;
20
20
  category?: string | undefined;
21
21
  detail: "full" | "compact" | "brief";
@@ -46,7 +46,7 @@ import {compareText} from '../../../foundation/text/compare-text.mjs';
46
46
  * same way (`withOwnership`) so list and detail agree.
47
47
  * @param {{name: string, docsDir: string}} ext
48
48
  * @param {string} name
49
- * @param {string} coreDir
49
+ * @param {string | null} coreDir
50
50
  * @param {{zh: boolean, lang: string|null}} docOpts
51
51
  * @returns {Promise<string>}
52
52
  */
@@ -77,7 +77,7 @@ const coreEntry = doc => ({name: doc.name, package: CORE_PACKAGE, ...doc});
77
77
  * full entry. Null when the doc is the component's own.
78
78
  * @param {any} docs
79
79
  * @param {string} name
80
- * @param {string} coreDir
80
+ * @param {string | null} coreDir
81
81
  * @returns {any}
82
82
  */
83
83
  function memberEntry(docs, name, coreDir) {
@@ -155,7 +155,7 @@ async function replacementEntry(replacement, detail, {zh, dense, lang}) {
155
155
  * Build the `component.list` envelope. The list taxonomy is collapsed: all
156
156
  * three detail levels emit ONE `component.list` type; the depth rides in
157
157
  * `data.detail` and the grouped map in `data.components`.
158
- * @param {string} coreDir
158
+ * @param {string | null} coreDir
159
159
  * @param {object} opts
160
160
  * @param {string} opts.cwd
161
161
  * @param {string} [opts.category] - Filter to a single category (group key).
@@ -203,7 +203,7 @@ const COMPONENT_LIST_CODEC = {
203
203
 
204
204
  /**
205
205
  * componentList, worked out now.
206
- * @param {string} coreDir
206
+ * @param {string | null} coreDir
207
207
  * @param {Parameters<typeof componentList>[1]} options
208
208
  * @returns {Promise<ComponentListResponse>}
209
209
  */
@@ -25,7 +25,10 @@ import {
25
25
  availableComputerIntegrations,
26
26
  } from '../../foundation/config/project.mjs';
27
27
  import {isOutsideProject} from '../../foundation/env/project-scope.mjs';
28
- import {projectAddCommand} from '../../foundation/release/notices.mjs';
28
+ import {
29
+ addVerbFor,
30
+ projectAddCommand,
31
+ } from '../../foundation/release/notices.mjs';
29
32
  import {hostedRun} from '../../foundation/runtime/package-root.mjs';
30
33
  import {scanAllPackages, findComponentInPackages} from './_package-scanner.mjs';
31
34
  import {loadDocs} from '../../foundation/discovery/component-loader.mjs';
@@ -36,7 +39,6 @@ import {
36
39
  projectTree,
37
40
  } from '../docs/_adapter.mjs';
38
41
  import {discoverIntegrationIconSets} from '../../foundation/discovery/icon-set-discovery.mjs';
39
- import {detectPackageManager} from '../../foundation/env/package-manager.mjs';
40
42
  import {isValidSemver, semverCompare} from '../../foundation/env/semver.mjs';
41
43
  import {assertWithin} from '../../foundation/fs/path-safety.mjs';
42
44
  import {userCacheDir} from '../../foundation/env/user-dirs.mjs';
@@ -598,23 +600,21 @@ function newerFirst(a, b) {
598
600
  * @returns {(name: string, version?: string) => string}
599
601
  */
600
602
  export function addCommand(project, {official = []} = {}) {
601
- const pm = detectPackageManager(project?.cwd ?? process.cwd());
602
- const verb =
603
- pm === 'pnpm'
604
- ? 'pnpm add'
605
- : pm === 'yarn'
606
- ? 'yarn add'
607
- : pm === 'bun'
608
- ? 'bun add'
609
- : 'npm install';
603
+ const cwd = project?.cwd ?? process.cwd();
610
604
  const byName = new Map(official.map(pkg => [pkg.package, pkg]));
605
+ // An Astryx package at one version is saved exactly in a project that pins
606
+ // its Core to one version (see addVerbFor): that pin is about Astryx's
607
+ // release. Any other package is saved as the package manager saves it.
608
+ /** @param {string} name @param {string | null} version */
609
+ const verb = (name, version) =>
610
+ addVerbFor(cwd, name.startsWith('@astryxdesign/') ? version : null);
611
611
  return (name, version) => {
612
- if (version) return `${verb} ${name}@${version}`;
612
+ if (version) return `${verb(name, version)} ${name}@${version}`;
613
613
  const pin = byName.get(name)?.pin;
614
- if (!pin) return `${verb} ${name}`;
614
+ if (!pin) return `${verb(name, null)} ${name}`;
615
615
  return isValidSemver(pin)
616
- ? `${verb} ${name}@${pin}`
617
- : `${verb} "${name}@${pin}"`;
616
+ ? `${verb(name, pin)} ${name}@${pin}`
617
+ : `${verb(name, null)} "${name}@${pin}"`;
618
618
  };
619
619
  }
620
620
 
@@ -124,15 +124,23 @@ export function linkResolver(catalog: DocsCatalog, fromProvider: string): Promis
124
124
  * guide the tree places, and each typed doc.
125
125
  * @param {DocsCatalog} catalog
126
126
  * @param {DocsTree} tree
127
- * @param {{owner?: string, references?: boolean}} [options] `owner`: only the
128
- * docs this package owns. `references`: instead of the links, each reference
129
- * block that cannot include what it names; a reader loses that content,
130
- * where a link that names no doc still prints as written
127
+ * @param {{owner?: string, references?: boolean, absent?: (target: {provider: string, kind: string, name: string}) => boolean}} [options]
128
+ * `owner`: only the docs this package owns. `references`: instead of the
129
+ * links, each reference block that cannot include what it names; a reader
130
+ * loses that content, where a link that names no doc still prints as
131
+ * written. `absent`: true for a target the run leaves out on purpose, such
132
+ * as a Core doc in a run whose base is not Core; a link to it is no problem.
133
+ * A target that names no provider names one of its own doc's provider.
131
134
  * @returns {Promise<string[]>}
132
135
  */
133
- export function docsLinkProblems(catalog: DocsCatalog, tree: DocsTree, { owner, references }?: {
136
+ export function docsLinkProblems(catalog: DocsCatalog, tree: DocsTree, { owner, references, absent }?: {
134
137
  owner?: string;
135
138
  references?: boolean;
139
+ absent?: (target: {
140
+ provider: string;
141
+ kind: string;
142
+ name: string;
143
+ }) => boolean;
136
144
  }): Promise<string[]>;
137
145
  /**
138
146
  * What \`astryx doctor integration components\` checks of the links in one
@@ -1253,23 +1253,42 @@ function ownsNode(node, owner) {
1253
1253
  * guide the tree places, and each typed doc.
1254
1254
  * @param {DocsCatalog} catalog
1255
1255
  * @param {DocsTree} tree
1256
- * @param {{owner?: string, references?: boolean}} [options] `owner`: only the
1257
- * docs this package owns. `references`: instead of the links, each reference
1258
- * block that cannot include what it names; a reader loses that content,
1259
- * where a link that names no doc still prints as written
1256
+ * @param {{owner?: string, references?: boolean, absent?: (target: {provider: string, kind: string, name: string}) => boolean}} [options]
1257
+ * `owner`: only the docs this package owns. `references`: instead of the
1258
+ * links, each reference block that cannot include what it names; a reader
1259
+ * loses that content, where a link that names no doc still prints as
1260
+ * written. `absent`: true for a target the run leaves out on purpose, such
1261
+ * as a Core doc in a run whose base is not Core; a link to it is no problem.
1262
+ * A target that names no provider names one of its own doc's provider.
1260
1263
  * @returns {Promise<string[]>}
1261
1264
  */
1262
1265
  export async function docsLinkProblems(
1263
1266
  catalog,
1264
1267
  tree,
1265
- {owner, references = false} = {},
1268
+ {owner, references = false, absent} = {},
1266
1269
  ) {
1267
1270
  /** @type {string[]} */
1268
1271
  const problems = [];
1269
- /** @param {string} where @param {LinkProblem[]} found */
1270
- const note = (where, found) => {
1272
+ /**
1273
+ * @param {LinkProblem} problem
1274
+ * @param {string | undefined} provider the provider of the doc it sits in
1275
+ */
1276
+ const leftOut = (problem, provider) => {
1277
+ if (absent == null) return false;
1278
+ const target = parseLinkTarget(problem.target);
1279
+ if ('error' in target) return false;
1280
+ const owning = target.provider ?? provider;
1281
+ return owning != null && absent({...target, provider: owning});
1282
+ };
1283
+ /**
1284
+ * @param {string} where
1285
+ * @param {string | undefined} provider
1286
+ * @param {LinkProblem[]} found
1287
+ */
1288
+ const note = (where, provider, found) => {
1271
1289
  for (const problem of found) {
1272
1290
  if ((problem.include === true) !== references) continue;
1291
+ if (leftOut(problem, provider)) continue;
1273
1292
  problems.push(
1274
1293
  `${where}${problem.section ? ` \u00a7 ${problem.section}` : ''}${problem.field ? ` (${problem.field})` : ''}: ${problem.message}`,
1275
1294
  );
@@ -1278,7 +1297,7 @@ export async function docsLinkProblems(
1278
1297
  for (const entry of catalog.entries()) {
1279
1298
  if (owner != null && !ownsTopic(entry, owner)) continue;
1280
1299
  try {
1281
- note(entry.name, await topicLinkProblems(catalog, entry));
1300
+ note(entry.name, entry.package, await topicLinkProblems(catalog, entry));
1282
1301
  } catch {
1283
1302
  // The topic budget check reports a topic that does not load.
1284
1303
  }
@@ -1287,12 +1306,20 @@ export async function docsLinkProblems(
1287
1306
  if (owner != null && !ownsNode(node, owner)) continue;
1288
1307
  if (node.kind === 'generic' && node.ref?.topicFile) {
1289
1308
  try {
1290
- note(node.route, await topicLinkProblems(catalog, guideEntry(node)));
1309
+ note(
1310
+ node.route,
1311
+ node.provider,
1312
+ await topicLinkProblems(catalog, guideEntry(node)),
1313
+ );
1291
1314
  } catch {
1292
1315
  // As above.
1293
1316
  }
1294
1317
  } else if (node.ref?.selfDoc) {
1295
- note(node.route, (await nodeContent(catalog, tree, node)).problems);
1318
+ note(
1319
+ node.route,
1320
+ node.provider,
1321
+ (await nodeContent(catalog, tree, node)).problems,
1322
+ );
1296
1323
  }
1297
1324
  }
1298
1325
  return problems;
@@ -267,6 +267,24 @@ export function addCliCommandFor(cwd: string, version: string): {
267
267
  * @returns {((name: string) => string) | null}
268
268
  */
269
269
  export function installCommandFor(cwd: string): ((name: string) => string) | null;
270
+ /**
271
+ * The command that installs the project's dependencies, when the project
272
+ * `cwd` belongs to lists `name`, so a `name` that is not installed comes from
273
+ * installing them; null otherwise (see `listedPackageInstall`).
274
+ * @param {string} cwd
275
+ * @param {string} name
276
+ * @returns {string | null}
277
+ */
278
+ export function dependencyInstallFor(cwd: string, name: string): string | null;
279
+ /**
280
+ * The command that installs the Core a theme's peer range accepts, with the
281
+ * project's package manager; one version is saved exactly in a project that
282
+ * pins its Core (see `addVerbFor`), and a range is quoted for the shell.
283
+ * @param {string} projectDir
284
+ * @param {string} range
285
+ * @returns {string}
286
+ */
287
+ export function coreAddCommand(projectDir: string, range: string): string;
270
288
  /**
271
289
  * Whether `cwd` is inside a project whose package.json is not the project's,
272
290
  * so advice points at the project's folder (see `installFolder`).
@@ -326,8 +344,22 @@ export function readBuiltPath(target: string, { fileLimit }?: {
326
344
  * @returns {string[]}
327
345
  */
328
346
  export function builtIntegrationPackages(target: string, cwd: string): string[];
347
+ /**
348
+ * The install line for the font families a known package loads (an open
349
+ * font the editor's table names), in the project's package manager, and
350
+ * whether it loads every family given. A family no known package loads (a
351
+ * self-hosted face) gets none: its package name would be a guess.
352
+ * @param {string} projectDir
353
+ * @param {string[]} families
354
+ * @returns {Promise<{line: string | null, coversAll: boolean}>}
355
+ */
356
+ export function fontPackagesInstallLine(projectDir: string, families: string[]): Promise<{
357
+ line: string | null;
358
+ coversAll: boolean;
359
+ }>;
329
360
  export { placeholderFixes } from "../../foundation/discovery/template-icons.mjs";
330
361
  export { installCommandFor as packageInstallCommand } from "../../foundation/discovery/template-needs.mjs";
362
+ export { fontServiceFamilies } from "../../foundation/fonts/font-stylesheet.mjs";
331
363
  export { resolveRecordedTheme } from "../theme/theme.mjs";
332
364
  export { themeIdentifier } from "../theme/_fork.mjs";
333
365
  export { collectUnloadedFonts } from "../theme/build/font-warning.mjs";