@astryxdesign/cli 0.7.17-canary.gdaeb596 → 0.7.17-canary.gdcdd9fa
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 +26 -26
- package/api/build/_adapter.mjs +11 -4
- package/api/build/build.doc.mjs +2 -2
- package/api/build/build.type.mjs +1 -1
- package/api/build/help/help.mjs +3 -3
- package/api/build/kit/kit.mjs +1 -1
- package/api/build/kit/start.mjs +1 -1
- package/api/component/_adapter.d.mts +21 -4
- package/api/component/_adapter.mjs +68 -45
- package/api/component/component.mjs +13 -3
- package/api/component/detail/blocks/blocks.mjs +1 -2
- package/api/discover/_adapter.d.mts +13 -2
- package/api/discover/_adapter.mjs +38 -30
- package/api/discover/_catalog-view.d.mts +15 -0
- package/api/discover/_catalog-view.mjs +20 -0
- package/api/discover/_icon-set-coverage.d.mts +22 -0
- package/api/discover/_icon-set-coverage.mjs +32 -0
- package/api/discover/detail/detail.d.mts +3 -1
- package/api/discover/detail/detail.mjs +11 -4
- package/api/discover/detail/item/item.d.mts +11 -1
- package/api/discover/detail/item/item.mjs +29 -8
- package/api/discover/discover.d.mts +12 -0
- package/api/discover/discover.mjs +72 -16
- package/api/discover/discover.type.d.mts +23 -3
- package/api/discover/discover.type.mjs +14 -3
- package/api/discover/search/search.mjs +3 -0
- package/api/docs/_adapter.d.mts +52 -1
- package/api/docs/_adapter.mjs +153 -12
- package/api/doctor/_adapter.d.mts +85 -1
- package/api/doctor/_adapter.mjs +212 -2
- package/api/doctor/built-checks.d.mts +9 -0
- package/api/doctor/built-checks.mjs +37 -6
- package/api/doctor/doctor.d.mts +30 -1
- package/api/doctor/doctor.doc.mjs +1 -1
- package/api/doctor/doctor.mjs +222 -11
- package/api/doctor/theme-checks.mjs +176 -19
- package/api/error.d.mts +12 -1
- package/api/error.mjs +18 -6
- package/api/icon/_adapter.d.mts +10 -1
- package/api/icon/_adapter.mjs +21 -1
- package/api/icon/_authoring.mjs +21 -7
- package/api/icon/add/add.mjs +1 -1
- package/api/icon/definitions/definitions.mjs +2 -0
- package/api/icon/icon.doc.mjs +3 -3
- package/api/icon/icon.type.d.mts +43 -1
- package/api/icon/icon.type.mjs +19 -3
- package/api/icon/iconMap.doc.mjs +2 -2
- package/api/icon/list/list.mjs +4 -5
- package/api/icon/map/map.mjs +13 -4
- package/api/icon/search/icon-index.mjs +4 -1
- package/api/icon/search/search.d.mts +5 -3
- package/api/icon/search/search.mjs +55 -12
- package/api/init/_adapter.d.mts +44 -0
- package/api/init/_adapter.mjs +192 -13
- package/api/init/init.doc.mjs +16 -3
- package/api/init/init.mjs +66 -4
- package/api/init/init.type.d.mts +39 -2
- package/api/init/init.type.mjs +18 -2
- package/api/init/run/run.d.mts +34 -2
- package/api/init/run/run.mjs +335 -32
- package/api/integration/pack-check.d.mts +2 -1
- package/api/integration/pack-check.mjs +10 -18
- package/api/integration/validate-integration.mjs +20 -1
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/render/_adapter.mjs +129 -32
- package/api/render/render.doc.mjs +4 -4
- package/api/render/render.mjs +7 -7
- package/api/render/render.type.d.mts +48 -8
- package/api/render/render.type.mjs +18 -9
- package/api/search/ORDERING.md +1 -1
- package/api/search/_adapter.d.mts +5 -4
- package/api/search/_adapter.mjs +6 -5
- package/api/search/_candidate-score.mjs +1 -2
- package/api/search/_cards.json +4 -1
- package/api/search/_gather-templates.mjs +1 -2
- package/api/search/_lexical.mjs +131 -7
- package/api/search/_order.mjs +7 -3
- package/api/search/_result.d.mts +7 -0
- package/api/search/_result.mjs +8 -0
- package/api/search/_score.mjs +3 -2
- package/api/search/_titles.d.mts +14 -0
- package/api/search/_titles.mjs +16 -3
- package/api/search/_words.mjs +7 -1
- package/api/search/search-index.mjs +18 -10
- package/api/swizzle/_adapter.d.mts +1 -1
- package/api/swizzle/_adapter.mjs +1 -5
- package/api/swizzle/_moduleGraph.d.mts +0 -6
- package/api/swizzle/_moduleGraph.mjs +0 -12
- package/api/swizzle/copy/copy.mjs +1 -1
- package/api/template/_adapter.d.mts +38 -0
- package/api/template/_adapter.mjs +170 -2
- package/api/template/copy/copy.d.mts +9 -2
- package/api/template/copy/copy.mjs +6 -1
- package/api/template/list/list.mjs +1 -2
- package/api/template/show/show.d.mts +10 -3
- package/api/template/show/show.mjs +14 -5
- package/api/template/skeleton/skeleton.mjs +1 -2
- package/api/template/template.doc.mjs +2 -2
- package/api/template/template.mjs +29 -6
- package/api/template/template.type.d.mts +2 -0
- package/api/template/template.type.mjs +3 -1
- package/api/theme/_adapter.mjs +31 -8
- package/api/theme/_shared-source.mjs +3 -1
- package/api/theme/build/build.d.mts +54 -19
- package/api/theme/build/build.mjs +265 -168
- package/api/theme/build/core-interception.d.mts +10 -0
- package/api/theme/build/core-interception.mjs +24 -0
- package/api/theme/build/import-specifier.d.mts +14 -0
- package/api/theme/build/import-specifier.mjs +36 -0
- package/api/theme/build/null-values.d.mts +11 -3
- package/api/theme/build/null-values.mjs +49 -23
- package/api/theme/build/self-contained.mjs +32 -11
- package/api/theme/build/setting-effects.d.mts +55 -0
- package/api/theme/build/setting-effects.mjs +110 -2
- package/api/theme/build/theme-object.d.mts +47 -0
- package/api/theme/build/theme-object.mjs +144 -0
- package/api/theme/theme.d.mts +25 -4
- package/api/theme/theme.mjs +55 -5
- package/api/theme/theme.type.d.mts +15 -5
- package/api/theme/theme.type.mjs +14 -7
- package/api/theme/themeBuild.doc.mjs +2 -2
- package/api/theme-edit/_how-question.mjs +2 -2
- package/api/theme-edit/_settings.mjs +11 -0
- package/api/theme-edit/_tables.mjs +1 -1
- package/api/upgrade/_adapter.d.mts +26 -0
- package/api/upgrade/_adapter.mjs +225 -1
- package/api/upgrade/run/run.mjs +4 -0
- package/api/upgrade/upgrade.mjs +1 -1
- package/api/upgrade/upgrade.type.d.mts +39 -7
- package/api/upgrade/upgrade.type.mjs +23 -9
- package/assets/codemods/transforms/next/index.mjs +8 -0
- package/assets/codemods/transforms/next/preserve-chat-radius.mjs +515 -0
- package/assets/component-list.generated.json +1 -1
- package/assets/docs/author-a-theme.doc.mjs +2 -2
- package/assets/docs/principles.doc.dense.mjs +1 -1
- package/assets/docs/principles.doc.mjs +1 -1
- package/assets/docs/principles.doc.zh.mjs +1 -1
- package/assets/docs/tree/checks.doc.mjs +1 -1
- package/assets/docs/tree/export-pages.doc.mjs +20 -6
- package/assets/docs/tree/fonts-and-assets.doc.mjs +1 -1
- package/assets/docs/tree/icon-sets.doc.mjs +76 -8
- package/assets/docs/tree/layout.doc.mjs +16 -5
- package/assets/docs/tree/responsive.doc.mjs +2 -2
- package/assets/docs/tree/scaffold.doc.mjs +1 -0
- package/assets/docs/tree/share-a-page.doc.mjs +2 -2
- package/assets/docs/tree/tokens-color.doc.mjs +1 -1
- package/assets/docs/tree/tokens-radius.doc.mjs +1 -1
- package/assets/docs/tree/tokens.doc.mjs +32 -0
- package/assets/docs/use-a-theme.doc.mjs +4 -0
- package/assets/docs/working-with-ai.doc.mjs +1 -1
- package/assets/docs-routes.generated.json +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/icons/definitions/alignBottom.doc.mjs +1 -0
- package/assets/icons/definitions/alignCenter.doc.mjs +1 -0
- package/assets/icons/definitions/alignEnd.doc.mjs +1 -0
- package/assets/icons/definitions/alignJustify.doc.mjs +1 -0
- package/assets/icons/definitions/alignMiddle.doc.mjs +1 -0
- package/assets/icons/definitions/alignStart.doc.mjs +1 -0
- package/assets/icons/definitions/alignTop.doc.mjs +1 -0
- package/assets/icons/definitions/arrowDown.doc.mjs +1 -0
- package/assets/icons/definitions/arrowLeft.doc.mjs +1 -0
- package/assets/icons/definitions/arrowRight.doc.mjs +1 -0
- package/assets/icons/definitions/arrowUp.doc.mjs +1 -0
- package/assets/icons/definitions/arrowsUpDown.doc.mjs +1 -0
- package/assets/icons/definitions/bank.doc.mjs +1 -0
- package/assets/icons/definitions/bold.doc.mjs +1 -0
- package/assets/icons/definitions/bookmark.doc.mjs +1 -0
- package/assets/icons/definitions/bookmarkAdd.doc.mjs +1 -0
- package/assets/icons/definitions/cart.doc.mjs +1 -0
- package/assets/icons/definitions/check.doc.mjs +1 -0
- package/assets/icons/definitions/checkDouble.doc.mjs +1 -0
- package/assets/icons/definitions/chevronDown.doc.mjs +1 -0
- package/assets/icons/definitions/chevronLeft.doc.mjs +1 -0
- package/assets/icons/definitions/chevronRight.doc.mjs +1 -0
- package/assets/icons/definitions/chevronUp.doc.mjs +1 -0
- package/assets/icons/definitions/chevronsLeft.doc.mjs +1 -0
- package/assets/icons/definitions/chevronsRight.doc.mjs +1 -0
- package/assets/icons/definitions/clipboard.doc.mjs +1 -0
- package/assets/icons/definitions/cloud.doc.mjs +1 -1
- package/assets/icons/definitions/collapse.doc.mjs +1 -0
- package/assets/icons/definitions/compose.doc.mjs +1 -0
- package/assets/icons/definitions/conversation.doc.mjs +1 -0
- package/assets/icons/definitions/copy.doc.mjs +1 -0
- package/assets/icons/definitions/cornerRadius.doc.mjs +1 -0
- package/assets/icons/definitions/creditCard.doc.mjs +1 -0
- package/assets/icons/definitions/cut.doc.mjs +1 -0
- package/assets/icons/definitions/desktop.doc.mjs +1 -0
- package/assets/icons/definitions/discount.doc.mjs +1 -0
- package/assets/icons/definitions/document.doc.mjs +1 -0
- package/assets/icons/definitions/documentSearch.doc.mjs +1 -0
- package/assets/icons/definitions/download.doc.mjs +1 -0
- package/assets/icons/definitions/error.doc.mjs +1 -0
- package/assets/icons/definitions/exitFullScreen.doc.mjs +16 -0
- package/assets/icons/definitions/expand.doc.mjs +1 -0
- package/assets/icons/definitions/eye.doc.mjs +1 -0
- package/assets/icons/definitions/eyeSlash.doc.mjs +1 -0
- package/assets/icons/definitions/file.doc.mjs +1 -0
- package/assets/icons/definitions/flipHorizontal.doc.mjs +1 -0
- package/assets/icons/definitions/flipVertical.doc.mjs +1 -0
- package/assets/icons/definitions/folder.doc.mjs +1 -0
- package/assets/icons/definitions/folderAdd.doc.mjs +1 -0
- package/assets/icons/definitions/fullScreen.doc.mjs +16 -0
- package/assets/icons/definitions/globe.doc.mjs +1 -1
- package/assets/icons/definitions/info.doc.mjs +1 -0
- package/assets/icons/definitions/italic.doc.mjs +1 -0
- package/assets/icons/definitions/lock.doc.mjs +1 -0
- package/assets/icons/definitions/lowercase.doc.mjs +1 -0
- package/assets/icons/definitions/mail.doc.mjs +1 -1
- package/assets/icons/definitions/message.doc.mjs +2 -1
- package/assets/icons/definitions/mobile.doc.mjs +1 -0
- package/assets/icons/definitions/money.doc.mjs +1 -0
- package/assets/icons/definitions/moon.doc.mjs +1 -0
- package/assets/icons/definitions/notification.doc.mjs +1 -0
- package/assets/icons/definitions/notificationActive.doc.mjs +1 -0
- package/assets/icons/definitions/notificationOff.doc.mjs +1 -0
- package/assets/icons/definitions/paddingHorizontal.doc.mjs +1 -0
- package/assets/icons/definitions/paddingPerSide.doc.mjs +1 -0
- package/assets/icons/definitions/paddingVertical.doc.mjs +1 -0
- package/assets/icons/definitions/panelBottom.doc.mjs +1 -0
- package/assets/icons/definitions/panelLeft.doc.mjs +1 -0
- package/assets/icons/definitions/panelRight.doc.mjs +1 -0
- package/assets/icons/definitions/pause.doc.mjs +1 -0
- package/assets/icons/definitions/play.doc.mjs +1 -0
- package/assets/icons/definitions/radiusPerCorner.doc.mjs +1 -0
- package/assets/icons/definitions/redo.doc.mjs +1 -0
- package/assets/icons/definitions/rotate.doc.mjs +1 -0
- package/assets/icons/definitions/rotateCounterclockwise.doc.mjs +1 -0
- package/assets/icons/definitions/scale.doc.mjs +1 -2
- package/assets/icons/definitions/search.doc.mjs +1 -0
- package/assets/icons/definitions/send.doc.mjs +1 -0
- package/assets/icons/definitions/shoppingBag.doc.mjs +1 -0
- package/assets/icons/definitions/stop.doc.mjs +1 -0
- package/assets/icons/definitions/strikethrough.doc.mjs +1 -0
- package/assets/icons/definitions/success.doc.mjs +1 -0
- package/assets/icons/definitions/sun.doc.mjs +1 -0
- package/assets/icons/definitions/tablet.doc.mjs +1 -0
- package/assets/icons/definitions/textCase.doc.mjs +2 -1
- package/assets/icons/definitions/textRegular.doc.mjs +1 -0
- package/assets/icons/definitions/thumbsDown.doc.mjs +1 -0
- package/assets/icons/definitions/thumbsUp.doc.mjs +1 -0
- package/assets/icons/definitions/transfer.doc.mjs +1 -0
- package/assets/icons/definitions/trendDown.doc.mjs +1 -0
- package/assets/icons/definitions/trendUp.doc.mjs +1 -0
- package/assets/icons/definitions/underline.doc.mjs +1 -0
- package/assets/icons/definitions/undo.doc.mjs +1 -0
- package/assets/icons/definitions/unlock.doc.mjs +1 -0
- package/assets/icons/definitions/upload.doc.mjs +1 -0
- package/assets/icons/definitions/uppercase.doc.mjs +1 -0
- package/assets/icons/definitions/user.doc.mjs +1 -0
- package/assets/icons/definitions/userAdd.doc.mjs +1 -0
- package/assets/icons/definitions/userCircle.doc.mjs +1 -0
- package/assets/icons/definitions/userRemove.doc.mjs +1 -0
- package/assets/icons/definitions/users.doc.mjs +1 -0
- package/assets/icons/definitions/wallet.doc.mjs +1 -0
- package/assets/icons/definitions/warning.doc.mjs +1 -0
- package/assets/icons/definitions/wrench.doc.mjs +1 -1
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/AspectRatio/AspectRatioImageGallery.tsx +1 -1
- package/assets/templates/blocks/components/AspectRatio/AspectRatioWidescreen.tsx +1 -1
- package/assets/templates/blocks/components/AspectRatio/AspectRatioWithSkeleton.tsx +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarTooltip.tsx +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarWithStatus.tsx +1 -1
- package/assets/templates/blocks/components/AvatarStatusDot/AvatarStatusDotShowcase.tsx +1 -1
- package/assets/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.tsx +1 -1
- package/assets/templates/blocks/components/Badge/BadgeShowcase.tsx +2 -2
- package/assets/templates/blocks/components/Grid/GridShowcase.tsx +1 -1
- package/assets/templates/blocks/components/GridSpan/GridSpanColumns.tsx +1 -1
- package/assets/templates/blocks/components/GridSpan/GridSpanShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Heading/HeadingTruncation.tsx +3 -2
- package/assets/templates/blocks/components/Hooks/useClipboardHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/Hooks/useContainerRevealHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/Hooks/useGridFocusHookUsage.tsx +6 -6
- package/assets/templates/blocks/components/Hooks/useHotkeysHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/Hooks/useStreamingTextHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/Markdown/MarkdownShowcase.tsx +1 -1
- package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.tsx +8 -8
- package/assets/templates/blocks/components/OverflowList/OverflowListCappedToolbar.tsx +1 -1
- package/assets/templates/blocks/components/Resizable/ResizableShowcase.tsx +12 -2
- package/assets/templates/blocks/components/Resizable/ResizableSidebar.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaInlineRail.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaOverscrollChaining.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaShowcase.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyGroupHeaders.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyPassthrough.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaTwoAxisBoard.tsx +1 -1
- package/assets/templates/blocks/components/Stack/StackDirections.tsx +1 -1
- package/assets/templates/blocks/components/Step/StepContent.tsx +4 -3
- package/assets/templates/blocks/components/Step/StepIndicator.tsx +3 -2
- package/assets/templates/blocks/components/Step/StepShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Step/StepStates.tsx +3 -2
- package/assets/templates/blocks/components/Stepper/StepperCustomContent.tsx +18 -14
- package/assets/templates/blocks/components/Stepper/StepperOnTrackHorizontal.tsx +1 -1
- package/assets/templates/blocks/components/Table/TableInCard.tsx +1 -1
- package/assets/templates/blocks/components/Table/TableShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +2 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarSizes.tsx +1 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +2 -1
- package/assets/templates/blocks/components/TopNav/TopNavShowcase.tsx +1 -1
- package/assets/templates/blocks/components/TopNavItem/TopNavItemShowcase.tsx +1 -1
- package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuBasic.tsx +1 -1
- package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuShowcase.tsx +1 -1
- package/assets/templates/blocks/components/TopNavMenu/TopNavMenuBasic.tsx +1 -1
- package/assets/templates/blocks/components/TopNavMenu/TopNavMenuShowcase.tsx +1 -1
- package/assets/templates/blocks/components/TreeList/TreeListInteractiveSettings.tsx +4 -1
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/canvas-editor/page.tsx +17 -7
- package/assets/templates/pages/checkout-wizard/page.tsx +19 -6
- package/assets/templates/pages/contact-form/page.tsx +6 -1
- package/assets/templates/pages/dashboard/page.tsx +3 -1
- package/assets/templates/pages/dashboard-comparison/page.tsx +3 -1
- package/assets/templates/pages/dashboard-composition/page.tsx +21 -13
- package/assets/templates/pages/dashboard-progress/page.tsx +89 -96
- package/assets/templates/pages/dashboard-scorecard/page.tsx +32 -23
- package/assets/templates/pages/detail-page/page.tsx +1 -1
- package/assets/templates/pages/documentation/page.tsx +7 -2
- package/assets/templates/pages/documentation-design/page.tsx +10 -3
- package/assets/templates/pages/documentation-technical/page.tsx +1 -1
- package/assets/templates/pages/editor/page.tsx +4 -1
- package/assets/templates/pages/form-wizard/page.tsx +11 -4
- package/assets/templates/pages/form-wizard-dialog/page.tsx +3 -1
- package/assets/templates/pages/form-wizard-vertical/page.tsx +4 -3
- package/assets/templates/pages/payment-form/page.tsx +27 -4
- package/assets/templates/pages/settings/page.tsx +20 -5
- package/assets/templates/pages/settings-dialog/page.tsx +14 -2
- package/assets/templates/pages/settings-sidebar/page.tsx +13 -1
- package/assets/templates/pages/shell-nav/page.tsx +27 -15
- package/assets/templates/pages/table/page.tsx +1 -1
- package/assets/templates/pages/table-filter/page.tsx +15 -2
- package/assets/templates/pages/table-grouped/page.tsx +2 -1
- package/assets/templates/pages/table-inbox/page.tsx +42 -6
- package/assets/templates/pages/theme-showcase/page.tsx +5 -3
- package/assets/templates/pages/work-item-detail/page.tsx +19 -3
- package/assets/templates/themes/butter/butterTheme.ts +17 -4
- package/assets/templates/themes/chocolate/chocolateTheme.ts +13 -6
- package/assets/templates/themes/gothic/gothicTheme.ts +14 -2
- package/assets/templates/themes/matcha/matchaTheme.ts +10 -2
- package/assets/templates/themes/neutral/neutralTheme.ts +5 -0
- package/assets/templates/themes/stone/stoneTheme.ts +5 -0
- package/assets/templates/themes/y2k/y2kTheme.ts +11 -3
- package/assets/theme.template.ts +1 -0
- package/authoring/config/config.doc.mjs +8 -1
- package/authoring/config/parse.mjs +15 -0
- package/authoring/config/skill-places.d.mts +23 -0
- package/authoring/config/skill-places.mjs +35 -0
- package/authoring/config/type.ts +16 -0
- package/authoring/debug/parse.d.mts +2 -2
- package/authoring/debug/type.ts +4 -0
- package/authoring/discover/parse.d.mts +2 -1
- package/authoring/discover/parse.mjs +24 -3
- package/authoring/discover/type.ts +9 -2
- package/authoring/doctypes/_schema.d.mts +19 -19
- package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +16 -0
- package/authoring/doctypes/icon-definition/parse.mjs +12 -0
- package/authoring/doctypes/icon-definition/type.ts +18 -0
- package/authoring/gap-report/parse.d.mts +1 -1
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/build.doc.mjs +1 -1
- package/clients/cli/commands/build.mjs +8 -8
- package/clients/cli/commands/discover.mjs +91 -6
- package/clients/cli/commands/docs.mjs +22 -16
- package/clients/cli/commands/experimental/export.mjs +4 -145
- package/clients/cli/commands/experimental/icon.mjs +58 -10
- package/clients/cli/commands/experimental/import.mjs +70 -0
- package/clients/cli/commands/experimental/index.mjs +98 -20
- package/clients/cli/commands/experimental/render-output.mjs +242 -0
- package/clients/cli/commands/experimental-export.doc.mjs +4 -4
- package/clients/cli/commands/experimental-import.doc.mjs +53 -0
- package/clients/cli/commands/experimental.doc.mjs +3 -3
- package/clients/cli/commands/init.doc.mjs +13 -3
- package/clients/cli/commands/search.mjs +7 -2
- package/clients/cli/commands/template.mjs +18 -0
- package/clients/cli/commands/theme-add.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +2 -2
- package/clients/cli/commands/upgrade.doc.mjs +2 -1
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/index.mjs +8 -1
- package/clients/cli/lib/cli-error.mjs +1 -6
- package/clients/cli/lib/component-format.mjs +10 -2
- package/clients/cli/lib/hook-format.mjs +14 -11
- package/clients/cli/lib/root-args.mjs +10 -3
- package/clients/cli/lib/stray-option.mjs +52 -0
- package/clients/cli/lib/unknown-command.mjs +12 -5
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +27 -0
- package/foundation/agent-docs/agent-doc-state.d.mts +20 -2
- package/foundation/agent-docs/agent-doc-state.mjs +70 -3
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/agent-docs/computer-agent-text.d.mts +5 -14
- package/foundation/agent-docs/computer-agent-text.mjs +60 -155
- package/foundation/agent-docs/folder-scope.d.mts +40 -0
- package/foundation/agent-docs/folder-scope.mjs +68 -0
- package/foundation/agent-docs/managed-skill-file.d.mts +103 -0
- package/foundation/agent-docs/managed-skill-file.mjs +193 -0
- package/foundation/agent-docs/skill-place-files.d.mts +88 -0
- package/foundation/agent-docs/skill-place-files.mjs +220 -0
- package/foundation/agent-docs/skill-places.d.mts +115 -0
- package/foundation/agent-docs/skill-places.mjs +286 -0
- package/foundation/config/config-path.d.mts +2 -2
- package/foundation/config/config-path.mjs +5 -6
- package/foundation/config/config-writer.d.mts +5 -1
- package/foundation/config/config-writer.mjs +20 -4
- package/foundation/config/theme-state.d.mts +13 -0
- package/foundation/config/theme-state.mjs +28 -0
- package/foundation/debug/event.d.mts +2 -1
- package/foundation/debug/event.mjs +2 -1
- package/foundation/discovery/cli-self-docs.d.mts +7 -0
- package/foundation/discovery/cli-self-docs.mjs +52 -5
- package/foundation/discovery/component-discovery.d.mts +10 -0
- package/foundation/discovery/component-discovery.mjs +84 -15
- package/foundation/discovery/docs-discovery.mjs +7 -22
- package/foundation/discovery/icon-definition-discovery.d.mts +155 -3
- package/foundation/discovery/icon-definition-discovery.mjs +197 -5
- package/foundation/discovery/icon-ranking.d.mts +84 -0
- package/foundation/discovery/icon-ranking.mjs +214 -61
- package/foundation/discovery/icon-set-checks.d.mts +2 -0
- package/foundation/discovery/icon-set-checks.mjs +14 -1
- package/foundation/discovery/icon-set-discovery.d.mts +20 -2
- package/foundation/discovery/icon-set-discovery.mjs +40 -7
- package/foundation/discovery/icon-set-writer.d.mts +7 -2
- package/foundation/discovery/icon-set-writer.mjs +86 -7
- package/foundation/discovery/package-exports.d.mts +11 -0
- package/foundation/discovery/package-exports.mjs +22 -1
- package/foundation/discovery/replacement-aliases.d.mts +51 -0
- package/foundation/discovery/replacement-aliases.mjs +95 -0
- package/foundation/discovery/template-adapter.d.mts +26 -0
- package/foundation/discovery/template-adapter.mjs +150 -3
- package/foundation/discovery/template-icon-meanings.mjs +15 -5
- package/foundation/discovery/template-icons.mjs +8 -3
- package/foundation/discovery/template-needs.d.mts +6 -5
- package/foundation/discovery/template-needs.mjs +79 -20
- package/foundation/doc-compiler/read.d.mts +1 -1
- package/foundation/doc-compiler/stored-docs.d.mts +14 -3
- package/foundation/doc-compiler/stored-docs.mjs +12 -6
- package/foundation/env/user-settings.d.mts +15 -0
- package/foundation/env/user-settings.mjs +56 -2
- package/foundation/fs/file-protection.d.mts +11 -0
- package/foundation/fs/file-protection.mjs +49 -3
- package/foundation/fs/gather-cache.d.mts +10 -4
- package/foundation/fs/gather-cache.mjs +117 -32
- package/foundation/fs/import-url.d.mts +7 -5
- package/foundation/fs/import-url.mjs +7 -5
- package/foundation/fs/loaded-files.d.mts +15 -1
- package/foundation/fs/loaded-files.mjs +40 -3
- package/foundation/fs/relative-specifier.d.mts +10 -0
- package/foundation/fs/relative-specifier.mjs +28 -0
- package/foundation/integrations/integrations.d.mts +3 -1
- package/foundation/integrations/integrations.mjs +3 -2
- package/foundation/integrations/provider-resolution.mjs +19 -2
- package/foundation/release/agent-text-worker.mjs +32 -1
- package/foundation/release/cache.d.mts +28 -2
- package/foundation/release/cache.mjs +63 -3
- package/foundation/release/choose.d.mts +5 -2
- package/foundation/release/choose.mjs +54 -4
- package/foundation/release/global-state.mjs +10 -2
- package/foundation/release/notices.d.mts +29 -0
- package/foundation/release/notices.mjs +109 -20
- package/foundation/render/assets.d.mts +7 -0
- package/foundation/render/assets.mjs +29 -16
- package/foundation/render/client-bundle.d.mts +25 -1
- package/foundation/render/client-bundle.mjs +334 -3
- package/foundation/render/dropped-text.d.mts +43 -0
- package/foundation/render/dropped-text.mjs +90 -0
- package/foundation/render/embedded-imports.d.mts +28 -7
- package/foundation/render/embedded-imports.mjs +101 -24
- package/foundation/render/file-header.d.mts +2 -2
- package/foundation/render/file-header.mjs +5 -5
- package/foundation/render/html-reader.d.mts +4 -3
- package/foundation/render/html-reader.mjs +5 -4
- package/foundation/render/image-attributes.d.mts +25 -0
- package/foundation/render/image-attributes.mjs +33 -0
- package/foundation/render/package-resolve-hooks.d.mts +54 -0
- package/foundation/render/package-resolve-hooks.mjs +144 -0
- package/foundation/render/page-worker.mjs +573 -16
- package/foundation/render/picture-window.d.mts +11 -5
- package/foundation/render/picture-window.mjs +187 -19
- package/foundation/render/rebuild.mjs +2 -2
- package/foundation/render/remote-images.d.mts +83 -0
- package/foundation/render/remote-images.mjs +384 -0
- package/foundation/render/render-page.d.mts +94 -6
- package/foundation/render/render-page.mjs +546 -96
- package/foundation/render/served-packages.d.mts +12 -0
- package/foundation/render/served-packages.mjs +45 -3
- package/foundation/render/share-checks.d.mts +35 -0
- package/foundation/render/share-checks.mjs +94 -0
- package/foundation/render/source-block.d.mts +10 -3
- package/foundation/render/source-block.mjs +41 -8
- package/foundation/render/srcset.d.mts +32 -0
- package/foundation/render/srcset.mjs +64 -0
- package/foundation/render/ts-paths.d.mts +8 -0
- package/foundation/render/ts-paths.mjs +14 -5
- package/foundation/response/error-codes.doc.mjs +3 -3
- package/foundation/response/json.d.mts +0 -15
- package/foundation/response/json.mjs +1 -51
- package/foundation/response/response-types.doc.mjs +8 -8
- package/foundation/runtime/lazy-dependencies.d.mts +7 -0
- package/foundation/runtime/lazy-dependencies.mjs +25 -3
- package/foundation/text/default-variant.d.mts +20 -0
- package/foundation/text/default-variant.mjs +24 -0
- package/foundation/text/definition-coverage.d.mts +21 -0
- package/foundation/text/definition-coverage.mjs +20 -0
- package/foundation/text/icon-set-next.d.mts +11 -10
- package/foundation/text/icon-set-next.mjs +19 -11
- package/foundation/text/suggest-order.d.mts +10 -4
- package/foundation/text/suggest-order.mjs +20 -13
- package/package.json +6 -6
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The computer-level skill file of a folder saved outside any project, from
|
|
6
|
+
* the text it is saved as (`~/<path>` or absolute).
|
|
7
|
+
* @param {string} saved
|
|
8
|
+
* @param {string} [home]
|
|
9
|
+
* @returns {string}
|
|
10
|
+
*/
|
|
11
|
+
export function savedComputerFolderSkillFile(saved: string, home?: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Split a `--to` value (a comma list, or several) into its names.
|
|
14
|
+
* @param {string | readonly string[]} value
|
|
15
|
+
* @returns {string[]}
|
|
16
|
+
*/
|
|
17
|
+
export function placeNames(value: string | readonly string[]): string[];
|
|
18
|
+
/**
|
|
19
|
+
* Parse place names. A folder resolves from `cwd`; it is a project place
|
|
20
|
+
* when it is inside `projectRoot`. Throws SkillPlaceError for an unknown
|
|
21
|
+
* word, a project place with no project, and an empty list.
|
|
22
|
+
* @param {readonly string[]} names
|
|
23
|
+
* @param {{cwd: string, projectRoot: string | null, home?: string}} where
|
|
24
|
+
* @returns {SkillPlace[]}
|
|
25
|
+
*/
|
|
26
|
+
export function parsePlaces(names: readonly string[], { cwd, projectRoot, home }: {
|
|
27
|
+
cwd: string;
|
|
28
|
+
projectRoot: string | null;
|
|
29
|
+
home?: string;
|
|
30
|
+
}): SkillPlace[];
|
|
31
|
+
/**
|
|
32
|
+
* The text a place is saved as.
|
|
33
|
+
* @param {SkillPlace} place
|
|
34
|
+
* @returns {string}
|
|
35
|
+
*/
|
|
36
|
+
export function savedName(place: SkillPlace): string;
|
|
37
|
+
/**
|
|
38
|
+
* The project places saved in a config's `skills.to`, parsed; the default
|
|
39
|
+
* (`agents-md`) when nothing is saved. A saved value that no longer parses
|
|
40
|
+
* is left out, so a config written by a newer release still sets up the
|
|
41
|
+
* places this one knows.
|
|
42
|
+
* @param {{skills?: {to?: string | string[]}} | undefined} config
|
|
43
|
+
* @param {string} projectRoot
|
|
44
|
+
* @returns {SkillPlace[]}
|
|
45
|
+
*/
|
|
46
|
+
export function savedProjectPlaces(config: {
|
|
47
|
+
skills?: {
|
|
48
|
+
to?: string | string[];
|
|
49
|
+
};
|
|
50
|
+
} | undefined, projectRoot: string): SkillPlace[];
|
|
51
|
+
/**
|
|
52
|
+
* The value a project's `skills.to` is saved as: null (no key) for the
|
|
53
|
+
* default alone, one name, or a list.
|
|
54
|
+
* @param {readonly SkillPlace[]} projectPlaces
|
|
55
|
+
* @returns {string | string[] | null}
|
|
56
|
+
*/
|
|
57
|
+
export function projectPlacesValue(projectPlaces: readonly SkillPlace[]): string | string[] | null;
|
|
58
|
+
/**
|
|
59
|
+
* The skill files a place holds, absolute. `agents-md` holds none: its files
|
|
60
|
+
* are the agent docs. `user` holds the computer-level skill, which
|
|
61
|
+
* `computer-agent-text.mjs` writes with its links.
|
|
62
|
+
* @param {SkillPlace} place
|
|
63
|
+
* @param {string | null} projectRoot
|
|
64
|
+
* @returns {string[]}
|
|
65
|
+
*/
|
|
66
|
+
export function placeSkillFiles(place: SkillPlace, projectRoot: string | null): string[];
|
|
67
|
+
/**
|
|
68
|
+
* The project skill: the managed block under skill frontmatter, with the
|
|
69
|
+
* hash line after the start marker.
|
|
70
|
+
* @param {string} block the managed block, from its start marker to its end marker
|
|
71
|
+
* @returns {string}
|
|
72
|
+
*/
|
|
73
|
+
export function renderProjectSkill(block: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* The keywords `--to` takes besides a folder: the project place keywords
|
|
76
|
+
* astryx.config accepts in `skills.to`, and `user`. One list, so the config
|
|
77
|
+
* check and init never disagree.
|
|
78
|
+
*/
|
|
79
|
+
export const PLACE_KEYWORDS: readonly string[];
|
|
80
|
+
/** The project place that holds the block; the default. */
|
|
81
|
+
export const AGENTS_MD_PLACE: "agents-md";
|
|
82
|
+
/** The computer-level skill's name and folder name. */
|
|
83
|
+
export const COMPUTER_SKILL_NAME: "astryx";
|
|
84
|
+
/**
|
|
85
|
+
* When an agent loads the project skill; the frontmatter `description`. One
|
|
86
|
+
* sentence.
|
|
87
|
+
*/
|
|
88
|
+
export const PROJECT_SKILL_DESCRIPTION: "This project builds its UI with Astryx, a design system and UI library, through the astryx command; use it whenever you build or change a page or any UI here (components, layout, styling, theming, a doctor finding), even when the request never says Astryx.";
|
|
89
|
+
/** The sentence every refusal of a place ends with. */
|
|
90
|
+
export const VALID_PLACES_HINT: "Valid places: agents-md (the AGENTS.md block, the default), skills (the project skills folders), user (this computer), or a folder written as a path, such as ./team-skills or ~/team-skills.";
|
|
91
|
+
/** A place `--to` named that cannot be used. */
|
|
92
|
+
export class SkillPlaceError extends Error {
|
|
93
|
+
/** @param {string} message */
|
|
94
|
+
constructor(message: string);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* One parsed place. `scope`: `project` places are saved in the project's
|
|
98
|
+
* config, `computer` places in the settings file. A folder carries its
|
|
99
|
+
* absolute path and the text it is saved as: `./` and its path from the
|
|
100
|
+
* project root, or, for a computer folder, `~/` and its path in the home
|
|
101
|
+
* folder, else its absolute path.
|
|
102
|
+
*/
|
|
103
|
+
export type SkillPlace = {
|
|
104
|
+
scope: "project";
|
|
105
|
+
kind: "agents-md" | "skills";
|
|
106
|
+
} | {
|
|
107
|
+
scope: "computer";
|
|
108
|
+
kind: "user";
|
|
109
|
+
} | {
|
|
110
|
+
scope: "project" | "computer";
|
|
111
|
+
kind: "folder";
|
|
112
|
+
dir: string;
|
|
113
|
+
saved: string;
|
|
114
|
+
};
|
|
115
|
+
export { PROJECT_SKILL_FOLDERS, PROJECT_SKILL_NAME } from "./agent-doc-state.mjs";
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file The places `astryx init --to` puts the Astryx skill, and how a
|
|
5
|
+
* project and the computer remember them.
|
|
6
|
+
*
|
|
7
|
+
* A place is one of:
|
|
8
|
+
* - `agents-md`: the managed block in AGENTS.md and the agent files beside
|
|
9
|
+
* it. The default for a project, and the place when nothing is saved.
|
|
10
|
+
* - `skills`: the project's skills folders,
|
|
11
|
+
* `.agents/skills/astryx-project/SKILL.md` and a copy at
|
|
12
|
+
* `.claude/skills/astryx-project/SKILL.md` (`PROJECT_SKILL_FOLDERS`). Each
|
|
13
|
+
* is a regular file: a link in a repository breaks in a checkout that does
|
|
14
|
+
* not make links. The two copies are one place: when either is a person's
|
|
15
|
+
* own, neither is written, so every agent reads one text.
|
|
16
|
+
* - `user`: the computer-level skill (`computer-agent-text.mjs`).
|
|
17
|
+
* - a folder: a folder inside the project gets the project skill,
|
|
18
|
+
* `<folder>/astryx-project/SKILL.md`, and is saved in the project's config;
|
|
19
|
+
* any other folder gets the computer-level skill, `<folder>/astryx/SKILL.md`,
|
|
20
|
+
* and is saved in the settings file.
|
|
21
|
+
*
|
|
22
|
+
* A folder is written as a path (`./team`, `../skills`, `~/team-skills`, an
|
|
23
|
+
* absolute path), so a misspelled keyword is refused, not made a folder.
|
|
24
|
+
*
|
|
25
|
+
* The project skill is the managed block, byte for byte, under skill
|
|
26
|
+
* frontmatter, with the hash line that tells an edited file from an older
|
|
27
|
+
* rendering (`managed-skill-file.mjs`).
|
|
28
|
+
*
|
|
29
|
+
* @input the `--to` list, the project root, the saved places
|
|
30
|
+
* @output parsed places, the files each place holds, the project skill text
|
|
31
|
+
* @position foundation/agent-docs — read by `init`
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
import * as os from 'node:os';
|
|
35
|
+
import * as path from 'node:path';
|
|
36
|
+
import {
|
|
37
|
+
MARKER_START,
|
|
38
|
+
PROJECT_SKILL_FOLDERS,
|
|
39
|
+
PROJECT_SKILL_NAME,
|
|
40
|
+
} from './agent-doc-state.mjs';
|
|
41
|
+
import {withHash} from './managed-skill-file.mjs';
|
|
42
|
+
import {absoluteFolder, folderScope, inside} from './folder-scope.mjs';
|
|
43
|
+
import {PROJECT_PLACE_KEYWORDS} from '../../authoring/config/skill-places.mjs';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The keywords `--to` takes besides a folder: the project place keywords
|
|
47
|
+
* astryx.config accepts in `skills.to`, and `user`. One list, so the config
|
|
48
|
+
* check and init never disagree.
|
|
49
|
+
*/
|
|
50
|
+
export const PLACE_KEYWORDS = Object.freeze([...PROJECT_PLACE_KEYWORDS, 'user']);
|
|
51
|
+
|
|
52
|
+
/** The project place that holds the block; the default. */
|
|
53
|
+
export const AGENTS_MD_PLACE = 'agents-md';
|
|
54
|
+
|
|
55
|
+
// The project skills folders and the project skill's name live in the leaf
|
|
56
|
+
// module, so the setup check reads them without loading this one.
|
|
57
|
+
export {PROJECT_SKILL_FOLDERS, PROJECT_SKILL_NAME} from './agent-doc-state.mjs';
|
|
58
|
+
|
|
59
|
+
/** The computer-level skill's name and folder name. */
|
|
60
|
+
export const COMPUTER_SKILL_NAME = 'astryx';
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* When an agent loads the project skill; the frontmatter `description`. One
|
|
64
|
+
* sentence.
|
|
65
|
+
*/
|
|
66
|
+
export const PROJECT_SKILL_DESCRIPTION =
|
|
67
|
+
'This project builds its UI with Astryx, a design system and UI library, through the astryx command; use it whenever you build or change a page or any UI here (components, layout, styling, theming, a doctor finding), even when the request never says Astryx.';
|
|
68
|
+
|
|
69
|
+
/** The sentence every refusal of a place ends with. */
|
|
70
|
+
export const VALID_PLACES_HINT =
|
|
71
|
+
'Valid places: agents-md (the AGENTS.md block, the default), skills (the project skills folders), user (this computer), or a folder written as a path, such as ./team-skills or ~/team-skills.';
|
|
72
|
+
|
|
73
|
+
/** A place `--to` named that cannot be used. */
|
|
74
|
+
export class SkillPlaceError extends Error {
|
|
75
|
+
/** @param {string} message */
|
|
76
|
+
constructor(message) {
|
|
77
|
+
super(`${message} ${VALID_PLACES_HINT}`);
|
|
78
|
+
this.name = 'SkillPlaceError';
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* One parsed place. `scope`: `project` places are saved in the project's
|
|
84
|
+
* config, `computer` places in the settings file. A folder carries its
|
|
85
|
+
* absolute path and the text it is saved as: `./` and its path from the
|
|
86
|
+
* project root, or, for a computer folder, `~/` and its path in the home
|
|
87
|
+
* folder, else its absolute path.
|
|
88
|
+
* @typedef {{scope: 'project', kind: 'agents-md' | 'skills'}
|
|
89
|
+
* | {scope: 'computer', kind: 'user'}
|
|
90
|
+
* | {scope: 'project' | 'computer', kind: 'folder', dir: string, saved: string}} SkillPlace
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* How a computer folder is saved: `~/` and its path in the home folder, else
|
|
97
|
+
* its absolute path, so a later run finds it from any folder.
|
|
98
|
+
* @param {string} dir absolute
|
|
99
|
+
* @param {string} home
|
|
100
|
+
* @returns {string}
|
|
101
|
+
*/
|
|
102
|
+
function homePath(dir, home) {
|
|
103
|
+
return inside(dir, home) && dir !== home
|
|
104
|
+
? `~/${path.relative(home, dir).split(path.sep).join('/')}`
|
|
105
|
+
: dir;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The computer-level skill file of a folder saved outside any project, from
|
|
110
|
+
* the text it is saved as (`~/<path>` or absolute).
|
|
111
|
+
* @param {string} saved
|
|
112
|
+
* @param {string} [home]
|
|
113
|
+
* @returns {string}
|
|
114
|
+
*/
|
|
115
|
+
export function savedComputerFolderSkillFile(saved, home = os.homedir()) {
|
|
116
|
+
return path.join(absoluteFolder(saved, home, home), COMPUTER_SKILL_NAME, 'SKILL.md');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Split a `--to` value (a comma list, or several) into its names.
|
|
122
|
+
* @param {string | readonly string[]} value
|
|
123
|
+
* @returns {string[]}
|
|
124
|
+
*/
|
|
125
|
+
export function placeNames(value) {
|
|
126
|
+
return (Array.isArray(value) ? value : [value])
|
|
127
|
+
.flatMap(each => String(each).split(','))
|
|
128
|
+
.map(each => each.trim())
|
|
129
|
+
.filter(each => each.length > 0);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Parse place names. A folder resolves from `cwd`; it is a project place
|
|
134
|
+
* when it is inside `projectRoot`. Throws SkillPlaceError for an unknown
|
|
135
|
+
* word, a project place with no project, and an empty list.
|
|
136
|
+
* @param {readonly string[]} names
|
|
137
|
+
* @param {{cwd: string, projectRoot: string | null, home?: string}} where
|
|
138
|
+
* @returns {SkillPlace[]}
|
|
139
|
+
*/
|
|
140
|
+
export function parsePlaces(names, {cwd, projectRoot, home = os.homedir()}) {
|
|
141
|
+
if (names.length === 0) throw new SkillPlaceError('`--to` needs a place.');
|
|
142
|
+
/** @type {SkillPlace[]} */
|
|
143
|
+
const places = [];
|
|
144
|
+
/** @type {Set<string>} */
|
|
145
|
+
const seen = new Set();
|
|
146
|
+
for (const name of names) {
|
|
147
|
+
/** @type {SkillPlace} */
|
|
148
|
+
let place;
|
|
149
|
+
if (name === 'user') {
|
|
150
|
+
place = {scope: 'computer', kind: 'user'};
|
|
151
|
+
} else if (/** @type {readonly string[]} */ (PROJECT_PLACE_KEYWORDS).includes(name)) {
|
|
152
|
+
if (projectRoot == null && name === 'skills') {
|
|
153
|
+
throw new SkillPlaceError(
|
|
154
|
+
'`--to skills` writes the project skills folders, and this folder is not in a project.',
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
place = {scope: 'project', kind: /** @type {'agents-md' | 'skills'} */ (name)};
|
|
158
|
+
} else if (folderScope(name, {cwd, projectRoot, home})) {
|
|
159
|
+
const {dir, scope} = /** @type {{dir: string, scope: 'project' | 'computer'}} */ (
|
|
160
|
+
folderScope(name, {cwd, projectRoot, home})
|
|
161
|
+
);
|
|
162
|
+
if (scope === 'project' && projectRoot != null) {
|
|
163
|
+
const rel = path.relative(projectRoot, dir).split(path.sep).join('/');
|
|
164
|
+
place = {
|
|
165
|
+
scope: 'project',
|
|
166
|
+
kind: 'folder',
|
|
167
|
+
dir,
|
|
168
|
+
saved: rel ? `./${rel}` : '.',
|
|
169
|
+
};
|
|
170
|
+
} else {
|
|
171
|
+
place = {scope: 'computer', kind: 'folder', dir, saved: homePath(dir, home)};
|
|
172
|
+
}
|
|
173
|
+
} else {
|
|
174
|
+
throw new SkillPlaceError(`Unknown place "${name}".`);
|
|
175
|
+
}
|
|
176
|
+
const key = placeKey(place);
|
|
177
|
+
if (seen.has(key)) continue;
|
|
178
|
+
seen.add(key);
|
|
179
|
+
places.push(place);
|
|
180
|
+
}
|
|
181
|
+
return places;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The text a place is saved as.
|
|
186
|
+
* @param {SkillPlace} place
|
|
187
|
+
* @returns {string}
|
|
188
|
+
*/
|
|
189
|
+
export function savedName(place) {
|
|
190
|
+
return place.kind === 'folder' ? place.saved : place.kind;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* A place's identity: two places with one key are one place.
|
|
195
|
+
* @param {SkillPlace} place
|
|
196
|
+
* @returns {string}
|
|
197
|
+
*/
|
|
198
|
+
function placeKey(place) {
|
|
199
|
+
return place.kind === 'folder' ? `folder:${place.dir}` : place.kind;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* The project places saved in a config's `skills.to`, parsed; the default
|
|
204
|
+
* (`agents-md`) when nothing is saved. A saved value that no longer parses
|
|
205
|
+
* is left out, so a config written by a newer release still sets up the
|
|
206
|
+
* places this one knows.
|
|
207
|
+
* @param {{skills?: {to?: string | string[]}} | undefined} config
|
|
208
|
+
* @param {string} projectRoot
|
|
209
|
+
* @returns {SkillPlace[]}
|
|
210
|
+
*/
|
|
211
|
+
export function savedProjectPlaces(config, projectRoot) {
|
|
212
|
+
const to = config?.skills?.to;
|
|
213
|
+
if (to == null) return [{scope: 'project', kind: 'agents-md'}];
|
|
214
|
+
/** @type {SkillPlace[]} */
|
|
215
|
+
const places = [];
|
|
216
|
+
for (const name of placeNames(to)) {
|
|
217
|
+
try {
|
|
218
|
+
places.push(
|
|
219
|
+
...parsePlaces([name], {cwd: projectRoot, projectRoot}).filter(
|
|
220
|
+
place => place.scope === 'project',
|
|
221
|
+
),
|
|
222
|
+
);
|
|
223
|
+
} catch {
|
|
224
|
+
// Not a place this release knows.
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return places;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* The value a project's `skills.to` is saved as: null (no key) for the
|
|
232
|
+
* default alone, one name, or a list.
|
|
233
|
+
* @param {readonly SkillPlace[]} projectPlaces
|
|
234
|
+
* @returns {string | string[] | null}
|
|
235
|
+
*/
|
|
236
|
+
export function projectPlacesValue(projectPlaces) {
|
|
237
|
+
const names = projectPlaces.map(savedName);
|
|
238
|
+
if (names.length === 1 && names[0] === AGENTS_MD_PLACE) return null;
|
|
239
|
+
return names.length === 1 ? /** @type {string} */ (names[0]) : names;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* The skill files a place holds, absolute. `agents-md` holds none: its files
|
|
244
|
+
* are the agent docs. `user` holds the computer-level skill, which
|
|
245
|
+
* `computer-agent-text.mjs` writes with its links.
|
|
246
|
+
* @param {SkillPlace} place
|
|
247
|
+
* @param {string | null} projectRoot
|
|
248
|
+
* @returns {string[]}
|
|
249
|
+
*/
|
|
250
|
+
export function placeSkillFiles(place, projectRoot) {
|
|
251
|
+
if (place.kind === 'skills' && projectRoot != null) {
|
|
252
|
+
return PROJECT_SKILL_FOLDERS.map(folder =>
|
|
253
|
+
path.join(projectRoot, folder, PROJECT_SKILL_NAME, 'SKILL.md'),
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
if (place.kind === 'folder') {
|
|
257
|
+
const name = place.scope === 'project' ? PROJECT_SKILL_NAME : COMPUTER_SKILL_NAME;
|
|
258
|
+
return [path.join(place.dir, name, 'SKILL.md')];
|
|
259
|
+
}
|
|
260
|
+
return [];
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* The project skill: the managed block under skill frontmatter, with the
|
|
265
|
+
* hash line after the start marker.
|
|
266
|
+
* @param {string} block the managed block, from its start marker to its end marker
|
|
267
|
+
* @returns {string}
|
|
268
|
+
*/
|
|
269
|
+
export function renderProjectSkill(block) {
|
|
270
|
+
if (!block.startsWith(MARKER_START)) {
|
|
271
|
+
throw new Error('The project skill needs the managed block.');
|
|
272
|
+
}
|
|
273
|
+
return withHash(
|
|
274
|
+
[
|
|
275
|
+
'---',
|
|
276
|
+
`name: ${PROJECT_SKILL_NAME}`,
|
|
277
|
+
// Quoted: the description holds `: ` and `;`, which strict YAML parsers
|
|
278
|
+
// can misread, and an agent tool that fails to parse drops the skill.
|
|
279
|
+
`description: ${JSON.stringify(PROJECT_SKILL_DESCRIPTION)}`,
|
|
280
|
+
'---',
|
|
281
|
+
'',
|
|
282
|
+
block,
|
|
283
|
+
'',
|
|
284
|
+
].join('\n'),
|
|
285
|
+
);
|
|
286
|
+
}
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
* @returns {string|null}
|
|
10
10
|
*/
|
|
11
11
|
export function findConfigPath(startDir?: string): string | null;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
export { CONFIG_BASENAMES };
|
|
13
|
+
import { CONFIG_BASENAMES } from '../agent-docs/agent-doc-state.mjs';
|
|
@@ -14,12 +14,11 @@ import * as path from 'node:path';
|
|
|
14
14
|
import {findPackageRoot} from '../fs/paths.mjs';
|
|
15
15
|
import {findPresentFiles} from '../fs/present-files.mjs';
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
];
|
|
17
|
+
// The config names, in load-precedence order, live in the dependency-free
|
|
18
|
+
// setup check, which Core copies.
|
|
19
|
+
import {CONFIG_BASENAMES} from '../agent-docs/agent-doc-state.mjs';
|
|
20
|
+
|
|
21
|
+
export {CONFIG_BASENAMES};
|
|
23
22
|
|
|
24
23
|
/**
|
|
25
24
|
* Find astryx.config.{ts,mjs,js} as a sibling of the nearest package.json.
|
|
@@ -37,10 +37,14 @@ export function setConfigValue(projectDir: string, key: string, value: string |
|
|
|
37
37
|
* @param {ReadonlyArray<readonly [string, string | readonly string[] | null]>} fields
|
|
38
38
|
* each a top-level key or a dotted path (`experimental.iconSet`), and its
|
|
39
39
|
* value
|
|
40
|
+
* @param {{check?: boolean}} [options] `check`: find every reason the write
|
|
41
|
+
* would be refused, and write nothing
|
|
40
42
|
* @returns {{file: string, created: boolean, previous: Array<string | string[] | null>, changed: boolean}}
|
|
41
43
|
* `previous`: each field's value before the write, in the order given
|
|
42
44
|
*/
|
|
43
|
-
export function setConfigValues(projectDir: string, fields: ReadonlyArray<readonly [string, string | readonly string[] | null]
|
|
45
|
+
export function setConfigValues(projectDir: string, fields: ReadonlyArray<readonly [string, string | readonly string[] | null]>, { check }?: {
|
|
46
|
+
check?: boolean;
|
|
47
|
+
}): {
|
|
44
48
|
file: string;
|
|
45
49
|
created: boolean;
|
|
46
50
|
previous: Array<string | string[] | null>;
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* astryx.config, or remove them, in one write.
|
|
6
6
|
*
|
|
7
7
|
* A field is a top-level key or a dotted path into nested object literals
|
|
8
|
-
* (`experimental.iconSet`); a missing object on the path is created
|
|
8
|
+
* (`experimental.iconSet`); a missing object on the path is created, and an
|
|
9
|
+
* object a removal empties is removed.
|
|
9
10
|
*
|
|
10
11
|
* Edits the default-exported object literal in place (comments and other
|
|
11
12
|
* fields kept), or creates `astryx.config.mjs` when the project has no
|
|
@@ -221,10 +222,12 @@ function newConfigText(fields) {
|
|
|
221
222
|
* @param {ReadonlyArray<readonly [string, string | readonly string[] | null]>} fields
|
|
222
223
|
* each a top-level key or a dotted path (`experimental.iconSet`), and its
|
|
223
224
|
* value
|
|
225
|
+
* @param {{check?: boolean}} [options] `check`: find every reason the write
|
|
226
|
+
* would be refused, and write nothing
|
|
224
227
|
* @returns {{file: string, created: boolean, previous: Array<string | string[] | null>, changed: boolean}}
|
|
225
228
|
* `previous`: each field's value before the write, in the order given
|
|
226
229
|
*/
|
|
227
|
-
export function setConfigValues(projectDir, fields) {
|
|
230
|
+
export function setConfigValues(projectDir, fields, {check = false} = {}) {
|
|
228
231
|
const existing = CONFIG_BASENAMES.map(name =>
|
|
229
232
|
path.join(projectDir, name),
|
|
230
233
|
).find(file => fs.existsSync(file));
|
|
@@ -239,7 +242,7 @@ export function setConfigValues(projectDir, fields) {
|
|
|
239
242
|
if (set.length === 0)
|
|
240
243
|
return {file, created: false, previous, changed: false};
|
|
241
244
|
assertWritable(projectDir, file);
|
|
242
|
-
writeAtomically(file, newConfigText(set));
|
|
245
|
+
if (!check) writeAtomically(file, newConfigText(set));
|
|
243
246
|
return {file, created: true, previous, changed: true};
|
|
244
247
|
}
|
|
245
248
|
assertWritable(projectDir, existing);
|
|
@@ -277,6 +280,10 @@ export function setConfigValues(projectDir, fields) {
|
|
|
277
280
|
let object = root;
|
|
278
281
|
assertNoSpread(object, 'its default export');
|
|
279
282
|
let absent = false;
|
|
283
|
+
// Each object the path opens, with the object that holds it, so a
|
|
284
|
+
// removal that empties one removes it too.
|
|
285
|
+
/** @type {Array<{parent: any, holder: any, object: any}>} */
|
|
286
|
+
const opened = [];
|
|
280
287
|
for (const each of keys.slice(0, -1)) {
|
|
281
288
|
const holder = object.properties.find((/** @type {any} */ property) =>
|
|
282
289
|
propertyNamed(property, each),
|
|
@@ -295,6 +302,7 @@ export function setConfigValues(projectDir, fields) {
|
|
|
295
302
|
const nested = unwrapManifestExpression(holder.value);
|
|
296
303
|
if (!j.ObjectExpression.check(nested)) throw refuse();
|
|
297
304
|
assertNoSpread(nested, `its "${each}" object`);
|
|
305
|
+
opened.push({parent: object, holder, object: nested});
|
|
298
306
|
object = nested;
|
|
299
307
|
}
|
|
300
308
|
if (absent) {
|
|
@@ -311,6 +319,14 @@ export function setConfigValues(projectDir, fields) {
|
|
|
311
319
|
if (property) {
|
|
312
320
|
object.properties.splice(at, 1);
|
|
313
321
|
changed = true;
|
|
322
|
+
// A removal leaves no empty object behind (`skills: {}`).
|
|
323
|
+
for (const step of opened.reverse()) {
|
|
324
|
+
if (step.object.properties.length > 0) break;
|
|
325
|
+
step.parent.properties.splice(
|
|
326
|
+
step.parent.properties.indexOf(step.holder),
|
|
327
|
+
1,
|
|
328
|
+
);
|
|
329
|
+
}
|
|
314
330
|
}
|
|
315
331
|
continue;
|
|
316
332
|
}
|
|
@@ -329,7 +345,7 @@ export function setConfigValues(projectDir, fields) {
|
|
|
329
345
|
}
|
|
330
346
|
let next = ast.toSource({quote: 'single', reuseWhitespace: true});
|
|
331
347
|
if (source.endsWith('\n') && !next.endsWith('\n')) next += '\n';
|
|
332
|
-
writeAtomically(existing, next);
|
|
348
|
+
if (!check) writeAtomically(existing, next);
|
|
333
349
|
return {file: existing, created: false, previous, changed: true};
|
|
334
350
|
}
|
|
335
351
|
|
|
@@ -105,6 +105,19 @@ export function readThemeState(cwd?: string): ThemeState;
|
|
|
105
105
|
export function renderThemeModule(themes: RenderedAppTheme[], defaultSlug: string, typescript: boolean, { keepModes }?: {
|
|
106
106
|
keepModes?: boolean;
|
|
107
107
|
}): string;
|
|
108
|
+
/**
|
|
109
|
+
* The stylesheets the CLI's theme module imports for the themes its record
|
|
110
|
+
* carries (each theme's stylesheet, then its font stylesheet), as written in
|
|
111
|
+
* the module, each with its theme's recorded owner. Only the module the CLI
|
|
112
|
+
* writes counts (exactly its rendering of the record); none otherwise.
|
|
113
|
+
* @param {string} source
|
|
114
|
+
* @param {boolean} typescript
|
|
115
|
+
* @returns {Array<{spec: string, owner: string}>}
|
|
116
|
+
*/
|
|
117
|
+
export function themeModuleStylesheets(source: string, typescript: boolean): Array<{
|
|
118
|
+
spec: string;
|
|
119
|
+
owner: string;
|
|
120
|
+
}>;
|
|
108
121
|
/**
|
|
109
122
|
* Is `source` exactly the module `renderThemeModule` writes for the record it
|
|
110
123
|
* carries? Only then may a command delete the module: it holds nothing a
|
|
@@ -494,6 +494,34 @@ const MODE_ENTRY_RE = new RegExp(
|
|
|
494
494
|
'u',
|
|
495
495
|
);
|
|
496
496
|
|
|
497
|
+
/**
|
|
498
|
+
* The stylesheets the CLI's theme module imports for the themes its record
|
|
499
|
+
* carries (each theme's stylesheet, then its font stylesheet), as written in
|
|
500
|
+
* the module, each with its theme's recorded owner. Only the module the CLI
|
|
501
|
+
* writes counts (exactly its rendering of the record); none otherwise.
|
|
502
|
+
* @param {string} source
|
|
503
|
+
* @param {boolean} typescript
|
|
504
|
+
* @returns {Array<{spec: string, owner: string}>}
|
|
505
|
+
*/
|
|
506
|
+
export function themeModuleStylesheets(source, typescript) {
|
|
507
|
+
if (!isUneditedThemeModule(source, typescript)) return [];
|
|
508
|
+
const owners = Object.values(parseThemeModuleRecord(source).themes);
|
|
509
|
+
/** @type {Array<{spec: string, owner: string}>} */
|
|
510
|
+
const out = [];
|
|
511
|
+
let index = -1;
|
|
512
|
+
for (const line of source.split(/\r?\n/u)) {
|
|
513
|
+
if (NAMED_IMPORT_RE.test(line)) {
|
|
514
|
+
index++;
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
const bare = BARE_IMPORT_RE.exec(line);
|
|
518
|
+
const owner = owners[index];
|
|
519
|
+
if (bare && owner !== undefined)
|
|
520
|
+
out.push({spec: JSON.parse(bare[1]), owner});
|
|
521
|
+
}
|
|
522
|
+
return out;
|
|
523
|
+
}
|
|
524
|
+
|
|
497
525
|
/**
|
|
498
526
|
* Is `source` exactly the module `renderThemeModule` writes for the record it
|
|
499
527
|
* carries? Only then may a command delete the module: it holds nothing a
|
|
@@ -23,7 +23,8 @@ export function captureEnv({ cliVersion, intl }?: {
|
|
|
23
23
|
/**
|
|
24
24
|
* Snapshot the project the command ran against. Names of a user's private
|
|
25
25
|
* packages are identifying, so this records only shape: whether a project is
|
|
26
|
-
* present, whether it is configured, and how many integrations
|
|
26
|
+
* present, whether it is configured, and how many integrations its
|
|
27
|
+
* astryx.config names.
|
|
27
28
|
*
|
|
28
29
|
* @param {{hasConfig?: boolean, initialized?: boolean, integrationCount?: number, inProject?: boolean}} [facts]
|
|
29
30
|
* @returns {import('../../authoring/debug/type').DebugEventProject}
|
|
@@ -230,7 +230,8 @@ export function captureEnv({cliVersion, intl = intlNow} = {}) {
|
|
|
230
230
|
/**
|
|
231
231
|
* Snapshot the project the command ran against. Names of a user's private
|
|
232
232
|
* packages are identifying, so this records only shape: whether a project is
|
|
233
|
-
* present, whether it is configured, and how many integrations
|
|
233
|
+
* present, whether it is configured, and how many integrations its
|
|
234
|
+
* astryx.config names.
|
|
234
235
|
*
|
|
235
236
|
* @param {{hasConfig?: boolean, initialized?: boolean, integrationCount?: number, inProject?: boolean}} [facts]
|
|
236
237
|
* @returns {import('../../authoring/debug/type').DebugEventProject}
|
|
@@ -32,6 +32,8 @@ export function loadCliSelfDocs(sources?: string[], root?: string): Promise<{
|
|
|
32
32
|
* @typedef {object} CliDocIndex
|
|
33
33
|
* @property {Map<string, any>} functions
|
|
34
34
|
* @property {Set<string>} commands
|
|
35
|
+
* @property {any[]} iconDefinitions the loaded icon definition docs, the
|
|
36
|
+
* first of each name only
|
|
35
37
|
* @property {(kind: string, name: string) => string | null} route
|
|
36
38
|
*/
|
|
37
39
|
/**
|
|
@@ -120,5 +122,10 @@ export const CLI_DOC_NAMESPACES: Record<string, {
|
|
|
120
122
|
export type CliDocIndex = {
|
|
121
123
|
functions: Map<string, any>;
|
|
122
124
|
commands: Set<string>;
|
|
125
|
+
/**
|
|
126
|
+
* the loaded icon definition docs, the
|
|
127
|
+
* first of each name only
|
|
128
|
+
*/
|
|
129
|
+
iconDefinitions: any[];
|
|
123
130
|
route: (kind: string, name: string) => string | null;
|
|
124
131
|
};
|