@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.
- package/README.md +14 -9
- package/api/build/_adapter.d.mts +33 -4
- package/api/build/_adapter.mjs +43 -8
- package/api/build/blocks/blocks.d.mts +1 -0
- package/api/build/blocks/blocks.mjs +2 -1
- package/api/build/blocks/blocks.weights.json +1 -1
- package/api/build/build.doc.mjs +2 -2
- package/api/build/build.type.d.mts +13 -1
- package/api/build/build.type.mjs +6 -3
- package/api/build/kit/kind.d.mts +6 -0
- package/api/build/kit/kind.mjs +1 -1
- package/api/build/kit/kit.mjs +3 -3
- package/api/build/kit/rank.d.mts +9 -3
- package/api/build/kit/rank.mjs +21 -8
- package/api/build/kit/signals.d.mts +7 -1
- package/api/build/kit/signals.mjs +124 -41
- package/api/build/kit/start.d.mts +20 -5
- package/api/build/kit/start.mjs +103 -23
- package/api/build/kit/weights.d.mts +20 -4
- package/api/build/kit/weights.json +1 -1
- package/api/build/kit/weights.mjs +68 -18
- package/api/build/kit/words.d.mts +44 -2
- package/api/build/kit/words.mjs +159 -4
- package/api/build/tree.mjs +1 -1
- package/api/component/__fixtures__/resolutions/modules.txt +4 -4
- package/api/component/_adapter.d.mts +51 -20
- package/api/component/_adapter.mjs +198 -29
- package/api/component/component.mjs +18 -5
- package/api/component/component.type.d.mts +4 -0
- package/api/component/component.type.mjs +1 -0
- package/api/component/detail/blocks/blocks.mjs +1 -0
- package/api/component/detail/detail.d.mts +2 -2
- package/api/component/detail/detail.mjs +1 -1
- package/api/component/list/list.d.mts +2 -2
- package/api/component/list/list.mjs +4 -4
- package/api/discover/_adapter.d.mts +10 -0
- package/api/discover/_adapter.mjs +110 -16
- package/api/discover/detail/item/item.mjs +5 -0
- package/api/discover/discover.mjs +12 -3
- package/api/discover/discover.type.d.mts +16 -3
- package/api/discover/discover.type.mjs +13 -3
- package/api/docs/_adapter.d.mts +74 -30
- package/api/docs/_adapter.mjs +488 -234
- package/api/docs/_entry-names-lazily.d.mts +22 -0
- package/api/docs/_entry-names-lazily.mjs +25 -0
- package/api/docs/_entry-names.d.mts +23 -0
- package/api/docs/_entry-names.mjs +105 -0
- package/api/doctor/_adapter.d.mts +63 -2
- package/api/doctor/_adapter.mjs +141 -5
- package/api/doctor/doctor.d.mts +11 -0
- package/api/doctor/doctor.doc.mjs +1 -1
- package/api/doctor/doctor.mjs +81 -30
- package/api/doctor/theme-checks.d.mts +35 -3
- package/api/doctor/theme-checks.mjs +449 -99
- package/api/error.d.mts +4 -3
- package/api/error.mjs +3 -2
- package/api/hook/_adapter.d.mts +14 -7
- package/api/hook/_adapter.mjs +46 -9
- package/api/hook/detail/detail.mjs +5 -2
- package/api/hook/detail/params/params.mjs +10 -3
- package/api/icon/_options.d.mts +17 -0
- package/api/icon/_options.mjs +54 -0
- package/api/icon/exportIconIndex.doc.d.mts +10 -0
- package/api/icon/exportIconIndex.doc.mjs +59 -0
- package/api/icon/icon.mjs +11 -34
- package/api/icon/icon.type.d.mts +49 -0
- package/api/icon/icon.type.mjs +24 -0
- package/api/icon/rankIconIndex.doc.d.mts +10 -0
- package/api/icon/rankIconIndex.doc.mjs +79 -0
- package/api/icon/search/icon-index.d.mts +41 -0
- package/api/icon/search/icon-index.mjs +139 -0
- package/api/icon/search/search.d.mts +18 -0
- package/api/icon/search/search.mjs +13 -0
- package/api/index.d.mts +1 -0
- package/api/index.mjs +1 -0
- package/api/integration/add-helpers.mjs +10 -0
- package/api/integration/authoring-checks.mjs +5 -2
- package/api/integration/check/check.mjs +6 -1
- package/api/integration/pack-check.mjs +50 -3
- package/api/integration/validate-integration.d.mts +18 -6
- package/api/integration/validate-integration.mjs +110 -14
- package/api/integration/validate-integration.type.d.mts +13 -0
- package/api/integration/validate-integration.type.mjs +2 -1
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/render/render.type.d.mts +1 -1
- package/api/render/render.type.mjs +1 -1
- package/api/search/ORDERING.md +1 -1
- package/api/search/_adapter.d.mts +8 -5
- package/api/search/_adapter.mjs +14 -10
- package/api/search/_candidate-score.d.mts +9 -4
- package/api/search/_candidate-score.mjs +82 -14
- package/api/search/_gather-components.d.mts +4 -4
- package/api/search/_gather-components.mjs +4 -3
- package/api/search/_gather-hooks.d.mts +2 -2
- package/api/search/_gather-hooks.mjs +1 -1
- package/api/search/_gather-templates.mjs +1 -0
- package/api/search/_lexical.d.mts +16 -0
- package/api/search/_lexical.mjs +98 -10
- package/api/search/_priority.d.mts +10 -2
- package/api/search/_priority.mjs +37 -7
- package/api/search/_result.d.mts +1 -0
- package/api/search/_result.mjs +1 -0
- package/api/search/_score.d.mts +12 -3
- package/api/search/_score.mjs +6 -3
- package/api/search/_words.mjs +12 -3
- package/api/search/search.d.mts +7 -1
- package/api/search/search.doc.mjs +1 -1
- package/api/search/search.mjs +37 -4
- package/api/search/search.type.d.mts +4 -0
- package/api/search/search.type.mjs +1 -0
- package/api/swizzle/_adapter.d.mts +7 -5
- package/api/swizzle/_adapter.mjs +22 -6
- package/api/swizzle/copy/copy.mjs +5 -4
- package/api/template/_adapter.d.mts +16 -0
- package/api/template/_adapter.mjs +39 -2
- package/api/template/cdn/cdn.mjs +37 -8
- package/api/template/copy/copy.d.mts +6 -3
- package/api/template/copy/copy.mjs +83 -8
- package/api/template/show/show.mjs +1 -0
- package/api/template/skeleton/skeleton.mjs +1 -0
- package/api/template/template.doc.mjs +5 -5
- package/api/template/template.mjs +63 -11
- package/api/template/template.type.d.mts +4 -0
- package/api/template/template.type.mjs +5 -1
- package/api/theme/_adapter.d.mts +20 -1
- package/api/theme/_adapter.mjs +149 -12
- package/api/theme/_app-provider.d.mts +31 -0
- package/api/theme/_app-provider.mjs +135 -0
- package/api/theme/add/add.mjs +3 -1
- package/api/theme/build/build.d.mts +127 -11
- package/api/theme/build/build.mjs +2047 -352
- package/api/theme/build/core-interception.d.mts +10 -0
- package/api/theme/build/core-interception.mjs +10 -0
- package/api/theme/build/family.mjs +61 -21
- package/api/theme/build/font-warning.d.mts +99 -5
- package/api/theme/build/font-warning.mjs +379 -61
- package/api/theme/build/icon-imports.mjs +83 -15
- package/api/theme/build/input-fields.d.mts +110 -0
- package/api/theme/build/input-fields.mjs +667 -0
- package/api/theme/build/null-values.d.mts +42 -0
- package/api/theme/build/null-values.mjs +283 -0
- package/api/theme/build/self-contained.d.mts +90 -0
- package/api/theme/build/self-contained.mjs +380 -0
- package/api/theme/build/source-syntax.d.mts +11 -0
- package/api/theme/build/source-syntax.mjs +28 -0
- package/api/theme/build/style-keys.d.mts +72 -0
- package/api/theme/build/style-keys.mjs +589 -0
- package/api/theme/build/typography-values.d.mts +61 -0
- package/api/theme/build/typography-values.mjs +408 -0
- package/api/theme/build/written-values.d.mts +78 -0
- package/api/theme/build/written-values.mjs +482 -0
- package/api/theme/generateTonalPalette.doc.mjs +1 -1
- package/api/theme/list/list.mjs +17 -1
- package/api/theme/palette/generate/generator.d.mts +14 -2
- package/api/theme/palette/generate/generator.mjs +94 -8
- package/api/theme/remove/remove.d.mts +2 -1
- package/api/theme/remove/remove.mjs +7 -3
- package/api/theme/theme.type.d.mts +89 -5
- package/api/theme/theme.type.mjs +46 -7
- package/api/theme/themeAdd.doc.mjs +1 -1
- package/api/theme/themeBuild.doc.mjs +1 -1
- package/api/theme/themeListAvailable.doc.mjs +1 -1
- package/api/theme/themePaletteGenerate.doc.mjs +1 -1
- package/api/theme/themeRemove.doc.mjs +8 -5
- package/api/theme/themeTemplate.doc.mjs +18 -3
- package/api/theme-edit/_adapter.d.mts +57 -4
- package/api/theme-edit/_adapter.mjs +380 -73
- package/api/theme-edit/_catalog.d.mts +82 -4
- package/api/theme-edit/_catalog.mjs +397 -24
- package/api/theme-edit/_check.d.mts +153 -2
- package/api/theme-edit/_check.mjs +3028 -563
- package/api/theme-edit/_color.d.mts +27 -2
- package/api/theme-edit/_color.mjs +66 -8
- package/api/theme-edit/_compiler.d.mts +7 -2
- package/api/theme-edit/_compiler.mjs +335 -21
- package/api/theme-edit/_context.d.mts +192 -7
- package/api/theme-edit/_context.mjs +750 -70
- package/api/theme-edit/_css.d.mts +32 -0
- package/api/theme-edit/_css.mjs +121 -34
- package/api/theme-edit/_edit.d.mts +68 -5
- package/api/theme-edit/_edit.mjs +5119 -667
- package/api/theme-edit/_how-commands.d.mts +28 -1
- package/api/theme-edit/_how-commands.mjs +621 -17
- package/api/theme-edit/_how-question.d.mts +101 -9
- package/api/theme-edit/_how-question.mjs +13901 -1282
- package/api/theme-edit/_how.d.mts +13 -2
- package/api/theme-edit/_how.mjs +389 -32
- package/api/theme-edit/_importers.d.mts +38 -0
- package/api/theme-edit/_importers.mjs +188 -0
- package/api/theme-edit/_missed.d.mts +54 -0
- package/api/theme-edit/_missed.mjs +917 -0
- package/api/theme-edit/_normal.d.mts +110 -21
- package/api/theme-edit/_normal.mjs +700 -105
- package/api/theme-edit/_palette.d.mts +77 -0
- package/api/theme-edit/_palette.mjs +364 -73
- package/api/theme-edit/_part-words.d.mts +39 -0
- package/api/theme-edit/_part-words.mjs +191 -0
- package/api/theme-edit/_parts.d.mts +74 -4
- package/api/theme-edit/_parts.mjs +677 -73
- package/api/theme-edit/_preview-app.d.mts +8 -13
- package/api/theme-edit/_preview-app.mjs +1189 -559
- package/api/theme-edit/_preview.d.mts +151 -10
- package/api/theme-edit/_preview.mjs +785 -98
- package/api/theme-edit/_project.d.mts +38 -3
- package/api/theme-edit/_project.mjs +135 -8
- package/api/theme-edit/_settings.d.mts +678 -83
- package/api/theme-edit/_settings.mjs +6037 -1051
- package/api/theme-edit/_tables.d.mts +43 -3
- package/api/theme-edit/_tables.mjs +244 -59
- package/api/theme-edit/_vet.d.mts +14 -1
- package/api/theme-edit/_vet.mjs +86 -12
- package/api/theme-edit/theme-edit.type.d.mts +53 -3
- package/api/theme-edit/theme-edit.type.mjs +23 -5
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +1 -1
- package/api/upgrade/_adapter.mjs +13 -2
- package/api/upgrade/upgrade.mjs +16 -1
- package/assets/codemods/integration-runner.mjs +1 -1
- package/assets/codemods/jscodeshift.d.ts +1 -1
- package/assets/codemods/parse.mjs +2 -2
- package/assets/codemods/run-codemod.mjs +71 -18
- package/assets/codemods/runner.mjs +1 -4
- package/assets/component-list.generated.json +1 -1
- package/assets/docs/author-a-theme.doc.mjs +1 -0
- package/assets/docs/theme.doc.dense.mjs +86 -7
- package/assets/docs/theme.doc.mjs +76 -2
- package/assets/docs/theme.doc.zh.mjs +61 -1
- package/assets/docs/tree/authoring.doc.mjs +1 -0
- package/assets/docs/tree/checks.doc.mjs +2 -2
- package/assets/docs/tree/cli.doc.mjs +1 -0
- package/assets/docs/tree/computer-agent-guide.doc.mjs +1 -1
- package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/font-setup.doc.mjs +1 -1
- package/assets/docs/tree/fonts-and-assets.doc.mjs +1 -1
- package/assets/docs/tree/generate-a-palette.doc.mjs +2 -2
- package/assets/docs/tree/global.doc.mjs +1 -0
- package/assets/docs/tree/install-once.doc.mjs +1 -1
- package/assets/docs/tree/problems.doc.mjs +1 -1
- package/assets/docs/tree/render-pages.doc.mjs +2 -2
- package/assets/docs/tree/share-a-page.doc.mjs +162 -0
- package/assets/docs/tree/single-component.doc.mjs +40 -2
- package/assets/docs/tree/updates.doc.mjs +1 -1
- package/assets/docs/tree/who-answers.doc.mjs +3 -3
- package/assets/docs/tree/write-good-templates.doc.mjs +1 -1
- package/assets/docs/use-a-theme.doc.mjs +1 -1
- package/assets/docs-routes.generated.json +1 -0
- package/assets/docs.generated.json +2 -2
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Blockquote/BlockquoteShowcase.tsx +1 -1
- package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.tsx +4 -4
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsCustomSeparator.tsx +1 -0
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsSupportingVariant.tsx +2 -2
- package/assets/templates/blocks/components/Card/CardElevations.tsx +1 -1
- package/assets/templates/blocks/components/Card/CardWithInnerLayout.tsx +19 -3
- package/assets/templates/blocks/components/Card/ClickableCardWithNestedButton.tsx +11 -1
- package/assets/templates/blocks/components/Card/SelectableCardElevated.tsx +1 -1
- package/assets/templates/blocks/components/Card/SelectableCardMulti.tsx +1 -1
- package/assets/templates/blocks/components/Center/CenterHorizontal.tsx +1 -1
- package/assets/templates/blocks/components/Center/CenterInsideACard.tsx +1 -1
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsx +8 -0
- package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsx +8 -2
- package/assets/templates/blocks/components/ChatComposerInput/useChatPasteAsTokenHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/ChatComposerInput/useChatPasteAsTokenHookUsage.tsx +32 -0
- package/assets/templates/blocks/components/ChatComposerInput/useSpeechRecognitionHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/ChatComposerInput/useSpeechRecognitionHookUsage.tsx +43 -0
- package/assets/templates/blocks/components/ChatLayout/ChatLayoutPanelChat.tsx +1 -0
- package/assets/templates/blocks/components/ChatLayout/ChatLayoutShowcase.tsx +1 -1
- package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleCustomContent.tsx +9 -1
- package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx +12 -2
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.tsx +28 -7
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +35 -7
- package/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx +1 -1
- package/assets/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupBasic.tsx +20 -4
- package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.tsx +15 -3
- package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.tsx +29 -6
- package/assets/templates/blocks/components/ContextMenu/ContextMenuBasic.tsx +2 -2
- package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.tsx +1 -1
- package/assets/templates/blocks/components/ContextMenu/ContextMenuShowcase.tsx +2 -2
- package/assets/templates/blocks/components/Divider/DividerFullBleed.tsx +1 -1
- package/assets/templates/blocks/components/Divider/DividerShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Divider/DividerVariants.tsx +1 -1
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +23 -4
- package/assets/templates/blocks/components/EmptyState/EmptyStateActions.tsx +18 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.tsx +20 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.tsx +16 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx +11 -1
- package/assets/templates/blocks/components/Heading/HeadingTruncation.tsx +12 -2
- package/assets/templates/blocks/components/InternationalizationProvider/useDirectionHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/LayoutContent/LayoutContentBasic.tsx +1 -1
- package/assets/templates/blocks/components/LayoutContent/LayoutContentShowcase.tsx +1 -1
- package/assets/templates/blocks/components/LayoutFooter/LayoutFooterActions.tsx +17 -3
- package/assets/templates/blocks/components/LayoutFooter/LayoutFooterShowcase.tsx +17 -3
- package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderShowcase.tsx +15 -3
- package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderWithActions.tsx +9 -2
- package/assets/templates/blocks/components/LayoutPanel/LayoutPanelNavigation.tsx +1 -1
- package/assets/templates/blocks/components/LayoutPanel/LayoutPanelShowcase.tsx +1 -1
- package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.tsx +1 -1
- package/assets/templates/blocks/components/MultiSelector/MultiSelectorGhostToolbar.tsx +14 -2
- package/assets/templates/blocks/components/Outline/OutlineDensity.tsx +2 -0
- package/assets/templates/blocks/components/OverflowList/OverflowListShowcase.tsx +6 -1
- package/assets/templates/blocks/components/Pagination/PaginationVariants.tsx +4 -0
- package/assets/templates/blocks/components/Popover/PopoverHookUsage.tsx +17 -2
- package/assets/templates/blocks/components/SegmentedControl/SegmentedControlFillLayout.tsx +1 -1
- package/assets/templates/blocks/components/Selector/SelectorGhostToolbar.tsx +14 -2
- package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +8 -1
- package/assets/templates/blocks/components/SideNav/SideNavWithHeaderMenu.tsx +2 -2
- package/assets/templates/blocks/components/SideNavHeading/SideNavHeadingShowcase.tsx +2 -0
- package/assets/templates/blocks/components/Switch/SwitchWithStatus.tsx +1 -1
- package/assets/templates/blocks/components/TabList/TabListTabsFillLayout.tsx +1 -1
- package/assets/templates/blocks/components/TabList/TabListTabsWithActions.tsx +12 -1
- package/assets/templates/blocks/components/Table/TableBulkActionsTable.tsx +11 -1
- package/assets/templates/blocks/components/Table/TableInCard.tsx +2 -2
- package/assets/templates/blocks/components/Text/TextTruncation.tsx +1 -1
- package/assets/templates/blocks/components/Text/TextWordBreak.tsx +12 -2
- package/assets/templates/blocks/components/Text/TextWrap.tsx +19 -4
- package/assets/templates/blocks/components/TextArea/TextAreaCharacterCount.tsx +1 -1
- package/assets/templates/blocks/components/TextArea/TextAreaShowcase.tsx +1 -1
- package/assets/templates/blocks/components/TextArea/TextAreaStates.tsx +1 -1
- package/assets/templates/blocks/components/TextArea/TextAreaValidation.tsx +1 -1
- package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.tsx +1 -1
- package/assets/templates/blocks/components/TextInput/TextInputStatusVariant.tsx +2 -2
- package/assets/templates/blocks/components/Timestamp/TimestampAutoFormat.tsx +15 -1
- package/assets/templates/blocks/components/Timestamp/TimestampRelativeFormat.tsx +15 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +8 -0
- package/assets/templates/blocks/components/Toolbar/ToolbarSizes.tsx +12 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +18 -3
- package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx +6 -0
- package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx +7 -1
- package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.tsx +2 -2
- package/assets/templates/blocks/components/TopNav/TopNavShowcase.tsx +9 -0
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/page.tsx +102 -6
- package/assets/templates/pages/ai-chat-landing/page.tsx +31 -4
- package/assets/templates/pages/ai-chat-landing/template.doc.mjs +3 -0
- package/assets/templates/pages/canvas-editor/page.tsx +73 -2
- package/assets/templates/pages/centered-hero/page.tsx +10 -4
- package/assets/templates/pages/course-detail/page.tsx +46 -2
- package/assets/templates/pages/dashboard/page.tsx +45 -16
- package/assets/templates/pages/dashboard-alert-rail/page.tsx +1 -1
- package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +32 -21
- package/assets/templates/pages/dashboard-comparison/page.tsx +11 -2
- package/assets/templates/pages/dashboard-composition/page.tsx +22 -9
- package/assets/templates/pages/dashboard-progress/page.tsx +28 -16
- package/assets/templates/pages/dashboard-scorecard/page.tsx +9 -0
- package/assets/templates/pages/detail-page/page.tsx +157 -76
- package/assets/templates/pages/documentation/page.tsx +15 -2
- package/assets/templates/pages/documentation-design/page.tsx +7 -34
- package/assets/templates/pages/documentation-technical/page.tsx +122 -65
- package/assets/templates/pages/editor/page.tsx +41 -24
- package/assets/templates/pages/file-explorer/page.tsx +44 -1
- package/assets/templates/pages/form-two-column/page.tsx +2 -3
- package/assets/templates/pages/form-wizard/page.tsx +31 -3
- package/assets/templates/pages/form-wizard-vertical/page.tsx +55 -6
- package/assets/templates/pages/gallery-hero/page.tsx +2 -1
- package/assets/templates/pages/ide/page.tsx +23 -0
- package/assets/templates/pages/ide/template.doc.mjs +1 -1
- package/assets/templates/pages/incident-console/page.tsx +130 -30
- package/assets/templates/pages/incident-console/template.doc.mjs +2 -2
- package/assets/templates/pages/kanban-board/page.tsx +50 -3
- package/assets/templates/pages/login-card/page.tsx +16 -0
- package/assets/templates/pages/login-split/page.tsx +19 -6
- package/assets/templates/pages/messaging-shell/page.tsx +409 -419
- package/assets/templates/pages/messaging-shell/template.doc.mjs +6 -6
- package/assets/templates/pages/payment-form/page.tsx +107 -43
- package/assets/templates/pages/product-detail/page.tsx +26 -2
- package/assets/templates/pages/product-gallery/page.tsx +16 -14
- package/assets/templates/pages/settings/page.tsx +35 -3
- package/assets/templates/pages/settings-dialog/page.tsx +196 -17
- package/assets/templates/pages/settings-sidebar/page.tsx +23 -3
- package/assets/templates/pages/shell-nav/page.tsx +28 -12
- package/assets/templates/pages/shell-side-nav/page.tsx +27 -4
- package/assets/templates/pages/shell-top-nav/page.tsx +27 -1
- package/assets/templates/pages/side-gallery/page.tsx +1 -1
- package/assets/templates/pages/table/page.tsx +575 -61
- package/assets/templates/pages/table/template.doc.mjs +11 -1
- package/assets/templates/pages/table-collapsible/page.tsx +1 -1
- package/assets/templates/pages/table-comparison/page.tsx +1 -1
- package/assets/templates/pages/table-filter/page.tsx +17 -1
- package/assets/templates/pages/table-grouped/page.tsx +171 -133
- package/assets/templates/pages/table-inbox/page.tsx +60 -1
- package/assets/templates/pages/table-page/page.tsx +23 -2
- package/assets/templates/pages/table-tree/page.tsx +95 -13
- package/assets/templates/pages/theme-showcase/page.tsx +107 -11
- package/assets/templates/pages/work-item-detail/page.tsx +134 -80
- package/assets/templates/pages/work-item-detail/template.doc.mjs +0 -1
- package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +1 -1
- package/assets/templates/themes/gothic/gothicTheme.ts +5 -0
- package/assets/templates/themes/neutral/neutralTheme.ts +1 -1
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +1 -1
- package/assets/templates/themes/y2k/y2kTheme.ts +1 -1
- package/assets/theme.template.ts +3 -2
- package/authoring/debug/parse.d.mts +1 -1
- package/authoring/doctypes/_schema.d.mts +28 -14
- package/authoring/doctypes/_schema.mjs +31 -0
- package/authoring/doctypes/command/command.doc.mjs +24 -0
- package/authoring/doctypes/command/type.ts +31 -0
- package/authoring/doctypes/component/component.doc.mjs +1 -1
- package/authoring/doctypes/component/type.ts +8 -5
- package/authoring/doctypes/namespace/namespace.doc.mjs +6 -0
- package/authoring/doctypes/namespace/type.ts +4 -0
- package/authoring/doctypes/template/template.doc.mjs +1 -1
- package/authoring/doctypes/template/type.ts +1 -1
- package/authoring/index.d.ts +6 -1
- package/authoring/integration/integration.doc.mjs +15 -0
- package/authoring/integration/schema.d.mts +30 -1
- package/authoring/integration/schema.mjs +129 -4
- package/authoring/integration/type.ts +48 -0
- package/clients/cli/bin/astryx.mjs +9 -3
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/build.mjs +17 -5
- package/clients/cli/commands/component.doc.mjs +1 -0
- package/clients/cli/commands/component.mjs +107 -42
- package/clients/cli/commands/discover.mjs +70 -3
- package/clients/cli/commands/docs.doc.mjs +1 -1
- package/clients/cli/commands/docs.mjs +41 -5
- package/clients/cli/commands/doctor.mjs +52 -2
- package/clients/cli/commands/experimental/index.mjs +4 -1
- package/clients/cli/commands/experimental/theme.mjs +1504 -186
- package/clients/cli/commands/experimental-render.doc.mjs +18 -5
- package/clients/cli/commands/experimental-theme-add.doc.mjs +2 -0
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +3 -2
- package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +3 -1
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +4 -3
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +3 -2
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +5 -4
- package/clients/cli/commands/experimental-theme-eject.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +3 -2
- package/clients/cli/commands/experimental-theme-remove.doc.mjs +6 -4
- package/clients/cli/commands/experimental-theme-targets.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-template.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-use.doc.mjs +2 -0
- package/clients/cli/commands/gap-report.doc.mjs +1 -0
- package/clients/cli/commands/hook.doc.mjs +1 -1
- package/clients/cli/commands/init.doc.mjs +1 -1
- package/clients/cli/commands/init.mjs +14 -6
- package/clients/cli/commands/integration-add.doc.mjs +1 -0
- package/clients/cli/commands/manifest.mjs +10 -3
- package/clients/cli/commands/search.mjs +13 -1
- package/clients/cli/commands/swizzle.doc.mjs +9 -2
- package/clients/cli/commands/swizzle.mjs +13 -6
- package/clients/cli/commands/template.doc.mjs +4 -1
- package/clients/cli/commands/template.mjs +34 -7
- package/clients/cli/commands/theme-add.doc.mjs +3 -2
- package/clients/cli/commands/theme-build.doc.mjs +11 -2
- package/clients/cli/commands/theme-eject.doc.mjs +1 -1
- package/clients/cli/commands/theme-list.doc.mjs +1 -1
- package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -2
- package/clients/cli/commands/theme-remove.doc.mjs +15 -6
- package/clients/cli/commands/theme-targets.doc.mjs +1 -0
- package/clients/cli/commands/theme-template.doc.mjs +1 -0
- package/clients/cli/commands/theme-use.doc.mjs +2 -1
- package/clients/cli/commands/theme.doc.mjs +7 -2
- package/clients/cli/commands/theme.mjs +824 -576
- package/clients/cli/commands/upgrade.mjs +7 -3
- package/clients/cli/index.mjs +177 -78
- package/clients/cli/lib/base-gate.mjs +522 -0
- package/clients/cli/lib/cli-error.mjs +21 -0
- package/clients/cli/lib/command-path.mjs +26 -0
- package/clients/cli/lib/define-command.mjs +161 -12
- package/clients/cli/lib/json-shim.mjs +679 -40
- package/clients/cli/lib/manifest.d.ts +14 -0
- package/clients/cli/lib/manifest.mjs +78 -22
- package/clients/cli/lib/not-ready.mjs +22 -0
- package/clients/cli/lib/root-args.mjs +79 -0
- package/clients/cli/lib/stray-option.mjs +491 -0
- package/clients/cli/lib/unknown-command.mjs +374 -0
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +39 -3
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/agent-docs/computer-agent-text.mjs +1 -1
- package/foundation/bases/core-docs.d.mts +10 -0
- package/foundation/bases/core-docs.mjs +42 -0
- package/foundation/bases/core.d.mts +11 -0
- package/foundation/bases/core.mjs +32 -0
- package/foundation/bases/requirements.d.mts +128 -0
- package/foundation/bases/requirements.mjs +193 -0
- package/foundation/bases/resolve.d.mts +134 -0
- package/foundation/bases/resolve.mjs +295 -0
- package/foundation/bases/state.d.mts +24 -0
- package/foundation/bases/state.mjs +46 -0
- package/foundation/bases/steps.d.mts +49 -0
- package/foundation/bases/steps.mjs +88 -0
- package/foundation/config/project.d.mts +22 -0
- package/foundation/config/project.mjs +94 -30
- package/foundation/config/theme-build-header.d.mts +14 -0
- package/foundation/config/theme-build-header.mjs +14 -0
- package/foundation/config/theme-private-vars.d.mts +26 -2
- package/foundation/config/theme-private-vars.mjs +65 -5
- package/foundation/config/theme-state.d.mts +19 -2
- package/foundation/config/theme-state.mjs +93 -1
- package/foundation/debug/event.d.mts +8 -2
- package/foundation/debug/event.mjs +6 -7
- package/foundation/debug/recorder.d.mts +8 -1
- package/foundation/debug/recorder.mjs +8 -2
- package/foundation/discovery/cli-self-doc-names.d.mts +13 -0
- package/foundation/discovery/cli-self-doc-names.mjs +51 -0
- package/foundation/discovery/cli-self-docs.d.mts +0 -2
- package/foundation/discovery/cli-self-docs.mjs +11 -16
- package/foundation/discovery/command-pointers.d.mts +28 -0
- package/foundation/discovery/command-pointers.mjs +31 -0
- package/foundation/discovery/component-discovery.d.mts +9 -8
- package/foundation/discovery/component-discovery.mjs +12 -6
- package/foundation/discovery/core-component-docs.d.mts +29 -0
- package/foundation/discovery/core-component-docs.mjs +83 -0
- package/foundation/discovery/core-theme-facts.d.mts +70 -0
- package/foundation/discovery/core-theme-facts.mjs +384 -0
- package/foundation/discovery/docs-discovery.d.mts +84 -9
- package/foundation/discovery/docs-discovery.mjs +151 -60
- package/foundation/discovery/entry-name-files.d.mts +72 -9
- package/foundation/discovery/entry-name-files.mjs +193 -103
- package/foundation/discovery/hook-discovery.d.mts +16 -6
- package/foundation/discovery/hook-discovery.mjs +82 -43
- package/foundation/discovery/integration-component-views.d.mts +15 -0
- package/foundation/discovery/integration-component-views.mjs +91 -0
- package/foundation/discovery/module-exports.d.mts +26 -1
- package/foundation/discovery/module-exports.mjs +114 -40
- package/foundation/discovery/name-roots.d.mts +38 -0
- package/foundation/discovery/name-roots.mjs +108 -0
- package/foundation/discovery/next-routes.d.mts +48 -0
- package/foundation/discovery/next-routes.mjs +197 -0
- package/foundation/discovery/stored-self-audit.mjs +2 -0
- package/foundation/discovery/template-adapter.d.mts +31 -63
- package/foundation/discovery/template-adapter.mjs +38 -207
- package/foundation/discovery/template-destination.d.mts +28 -0
- package/foundation/discovery/template-destination.mjs +106 -0
- package/foundation/discovery/template-ids.d.mts +69 -0
- package/foundation/discovery/template-ids.mjs +203 -0
- package/foundation/discovery/template-needs.mjs +3 -1
- package/foundation/discovery/theme-discovery.d.mts +12 -0
- package/foundation/discovery/theme-discovery.mjs +34 -2
- package/foundation/discovery/theme-imports.d.mts +10 -0
- package/foundation/discovery/theme-imports.mjs +37 -4
- package/foundation/discovery/theming-targets.d.mts +13 -5
- package/foundation/discovery/theming-targets.mjs +38 -45
- package/foundation/doc-compiler/generated-levels.d.mts +43 -0
- package/foundation/doc-compiler/generated-levels.mjs +72 -0
- package/foundation/doc-compiler/literal-doc.d.mts +12 -0
- package/foundation/doc-compiler/literal-doc.mjs +322 -0
- package/foundation/doc-compiler/stored-docs.d.mts +7 -0
- package/foundation/doc-compiler/stored-docs.mjs +14 -1
- package/foundation/doc-compiler/tree.d.mts +18 -87
- package/foundation/doc-compiler/tree.mjs +57 -64
- package/foundation/env/intl-defaults.d.mts +39 -0
- package/foundation/env/intl-defaults.mjs +150 -0
- package/foundation/env/intl-now.d.mts +21 -0
- package/foundation/env/intl-now.mjs +25 -0
- package/foundation/env/package-manager.d.mts +11 -2
- package/foundation/env/package-manager.mjs +28 -4
- package/foundation/fonts/font-stylesheet.d.mts +38 -0
- package/foundation/fonts/font-stylesheet.mjs +128 -12
- package/foundation/fs/cache-eviction.d.mts +3 -1
- package/foundation/fs/cache-eviction.mjs +7 -1
- package/foundation/fs/exact-codec.d.mts +12 -2
- package/foundation/fs/exact-codec.mjs +23 -6
- package/foundation/fs/file-protection.mjs +12 -2
- package/foundation/fs/gather-cache.d.mts +81 -2
- package/foundation/fs/gather-cache.mjs +615 -97
- package/foundation/fs/glob.d.mts +16 -0
- package/foundation/fs/glob.mjs +105 -0
- package/foundation/fs/jiti-cache.mjs +14 -6
- package/foundation/fs/kept-tree.d.mts +39 -15
- package/foundation/fs/kept-tree.mjs +155 -46
- package/foundation/fs/loaded-files.d.mts +30 -0
- package/foundation/fs/loaded-files.mjs +148 -0
- package/foundation/fs/module-loader.d.mts +53 -8
- package/foundation/fs/module-loader.mjs +559 -39
- package/foundation/fs/own-modules.d.mts +29 -0
- package/foundation/fs/own-modules.mjs +57 -0
- package/foundation/fs/path-safety.d.mts +34 -2
- package/foundation/fs/path-safety.mjs +170 -18
- package/foundation/fs/paths.d.mts +41 -2
- package/foundation/fs/paths.mjs +95 -5
- package/foundation/fs/read-record.d.mts +84 -7
- package/foundation/fs/read-record.mjs +333 -56
- package/foundation/fs/regular-file.d.mts +29 -0
- package/foundation/fs/regular-file.mjs +77 -0
- package/foundation/fs/stop-cleanup.d.mts +12 -0
- package/foundation/fs/stop-cleanup.mjs +66 -0
- package/foundation/fs/stylesheet-file.d.mts +37 -0
- package/foundation/fs/stylesheet-file.mjs +48 -0
- package/foundation/fs/theme-module-rejections.d.mts +32 -0
- package/foundation/fs/theme-module-rejections.mjs +82 -0
- package/foundation/integrations/integrations.d.mts +27 -1
- package/foundation/integrations/integrations.mjs +24 -2
- package/foundation/integrations/pack-state.d.mts +85 -0
- package/foundation/integrations/pack-state.mjs +509 -0
- package/foundation/integrations/shipped-imports.d.mts +125 -0
- package/foundation/integrations/shipped-imports.mjs +530 -0
- package/foundation/integrations/validate-contributions.d.mts +0 -17
- package/foundation/integrations/validate-contributions.mjs +81 -290
- package/foundation/release/choose.d.mts +7 -0
- package/foundation/release/choose.mjs +16 -2
- package/foundation/release/handoff.mjs +68 -13
- package/foundation/release/notices.d.mts +46 -9
- package/foundation/release/notices.mjs +78 -20
- package/foundation/release/pnp-runtime.d.mts +66 -0
- package/foundation/release/pnp-runtime.mjs +139 -0
- package/foundation/release/project.d.mts +11 -0
- package/foundation/release/project.mjs +23 -7
- package/foundation/release/run-context.d.mts +7 -2
- package/foundation/release/run-context.mjs +6 -2
- package/foundation/render/assets.mjs +52 -7
- package/foundation/render/charts.d.mts +78 -27
- package/foundation/render/charts.mjs +319 -90
- package/foundation/render/css-cut.d.mts +14 -1
- package/foundation/render/css-cut.mjs +117 -4
- package/foundation/render/cut-short.d.mts +35 -0
- package/foundation/render/cut-short.mjs +124 -0
- package/foundation/render/embedded-imports.d.mts +31 -0
- package/foundation/render/embedded-imports.mjs +169 -39
- package/foundation/render/font-probe.d.mts +27 -0
- package/foundation/render/font-probe.mjs +77 -0
- package/foundation/render/layers.d.mts +49 -0
- package/foundation/render/layers.mjs +347 -0
- package/foundation/render/offline.d.mts +32 -0
- package/foundation/render/offline.mjs +56 -0
- package/foundation/render/page-worker.mjs +374 -15
- package/foundation/render/picture-chrome.mjs +46 -4
- package/foundation/render/picture-playwright.mjs +41 -5
- package/foundation/render/picture-window.d.mts +32 -0
- package/foundation/render/picture-window.mjs +146 -0
- package/foundation/render/render-page.d.mts +46 -4
- package/foundation/render/render-page.mjs +453 -98
- package/foundation/response/base.d.ts +25 -0
- package/foundation/response/error-codes.d.mts +4 -1
- package/foundation/response/error-codes.d.ts +4 -1
- package/foundation/response/error-codes.doc.mjs +17 -0
- package/foundation/response/error-codes.mjs +21 -0
- package/foundation/response/json.d.mts +3 -1
- package/foundation/response/json.mjs +7 -2
- package/foundation/response/response-types.doc.mjs +12 -12
- package/foundation/runtime/css-tree.d.mts +24 -0
- package/foundation/runtime/css-tree.mjs +103 -0
- package/foundation/runtime/lazy-dependencies.d.mts +3 -1
- package/foundation/runtime/lazy-dependencies.mjs +20 -5
- package/foundation/suggest/name-index.d.mts +149 -0
- package/foundation/suggest/name-index.mjs +317 -0
- package/foundation/suggest/other-command.d.mts +146 -0
- package/foundation/suggest/other-command.mjs +783 -0
- package/foundation/text/css-escape.d.mts +18 -0
- package/foundation/text/css-escape.mjs +35 -0
- package/foundation/text/entry-names.d.mts +14 -0
- package/foundation/text/entry-names.mjs +14 -0
- package/foundation/text/string-utils.d.mts +49 -5
- package/foundation/text/string-utils.mjs +124 -26
- package/foundation/text/suggest-order.d.mts +75 -4
- package/foundation/text/suggest-order.mjs +285 -9
- package/foundation/text/written-string.d.mts +17 -0
- package/foundation/text/written-string.mjs +22 -0
- package/foundation/xle/browser.d.mts +2 -2
- package/package.json +8 -7
package/api/build/build.doc.mjs
CHANGED
|
@@ -65,7 +65,7 @@ export const doc = {
|
|
|
65
65
|
{
|
|
66
66
|
type: 'build.kit',
|
|
67
67
|
description:
|
|
68
|
-
|
|
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
|
|
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
|
|
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.
|
package/api/build/build.type.mjs
CHANGED
|
@@ -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
|
|
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
|
|
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.
|
package/api/build/kit/kind.d.mts
CHANGED
|
@@ -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;
|
package/api/build/kit/kind.mjs
CHANGED
|
@@ -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
|
|
package/api/build/kit/kit.mjs
CHANGED
|
@@ -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`
|
|
18
|
-
*
|
|
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>`
|
|
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.
|
package/api/build/kit/rank.d.mts
CHANGED
|
@@ -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}
|
|
10
|
+
* @param {string} idea
|
|
11
11
|
* @param {PageTemplate[]} pages
|
|
12
12
|
* @returns {RankedPage[]}
|
|
13
13
|
*/
|
|
14
|
-
export function rankPages(
|
|
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;
|
package/api/build/kit/rank.mjs
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
|
|
54
54
|
import {
|
|
55
55
|
HEAD_END,
|
|
56
|
-
|
|
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}
|
|
145
|
+
* @param {string} idea
|
|
145
146
|
* @param {PageTemplate[]} pages
|
|
146
147
|
* @returns {RankedPage[]}
|
|
147
148
|
*/
|
|
148
|
-
export function rankPages(
|
|
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
|
|
415
|
-
|
|
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
|
|
420
|
-
return
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
|
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(
|
|
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(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
//
|
|
141
|
-
//
|
|
142
|
-
|
|
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
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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(
|
|
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
|
-
|
|
248
|
-
|
|
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
|
|
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
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
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
|
|
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
|
|
13
|
-
* the reason
|
|
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
|
-
* @
|
|
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;
|