@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
package/api/icon/icon.type.mjs
CHANGED
|
@@ -44,12 +44,23 @@
|
|
|
44
44
|
* @property {IconVariantEntry[]} variants - Other variants.
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* A definition in the same group as another (its family of related
|
|
49
|
+
* meanings), so a reader picks the one that fits.
|
|
50
|
+
* @experimental May change or be removed in a patch release.
|
|
51
|
+
* @typedef {object} IconDefinitionRelative
|
|
52
|
+
* @property {string} definition - The related definition's name.
|
|
53
|
+
* @property {string} description - What it means.
|
|
54
|
+
*/
|
|
55
|
+
|
|
47
56
|
/**
|
|
48
57
|
* One ranked icon match. When the project picks a look and the match's set
|
|
49
58
|
* is in its list, `module`, `export`, and `import` draw that look; `look`
|
|
50
|
-
* is present when the icon does not have it.
|
|
59
|
+
* is present when the icon does not have it. `relatives` is present when the
|
|
60
|
+
* groups of the definitions it draws have other members: those definitions,
|
|
61
|
+
* Astryx's and its set's own.
|
|
51
62
|
* @experimental May change or be removed in a patch release.
|
|
52
|
-
* @typedef {IconRecord & {reason: string, score: number, look?: {asked: string, used: string | null}}} IconMatchEntry
|
|
63
|
+
* @typedef {IconRecord & {reason: string, score: number, look?: {asked: string, used: string | null}, relatives?: IconDefinitionRelative[]}} IconMatchEntry
|
|
53
64
|
*/
|
|
54
65
|
|
|
55
66
|
/**
|
|
@@ -60,6 +71,8 @@
|
|
|
60
71
|
* @property {string} name - The definition's name.
|
|
61
72
|
* @property {boolean} builtIn - Core draws it by name with no icon set.
|
|
62
73
|
* @property {string} description - What the definition means.
|
|
74
|
+
* @property {string} [group] - Present when the definition names one: the family of related definitions it belongs to.
|
|
75
|
+
* @property {IconDefinitionRelative[]} [relatives] - Present when its group has other members: those definitions, so a reader picks the one that fits.
|
|
63
76
|
*/
|
|
64
77
|
|
|
65
78
|
/**
|
|
@@ -187,6 +200,7 @@
|
|
|
187
200
|
* @property {Array<{definition: string, icon: string, previous: string | null, changed: boolean}>} data.entries - Each pair, in order, and what it replaced.
|
|
188
201
|
* @property {boolean} data.changed - Whether the file was written.
|
|
189
202
|
* @property {{previous: string, module: string}} [data.moduleUpdate] - The data file's `module` before and after this command, when the package was renamed and the command wrote its new name.
|
|
203
|
+
* @property {Array<{key: string, definition: string}>} [data.replacedKeys] - Each `map` key that named a replaced icon definition; the command wrote it under the definition that replaced it.
|
|
190
204
|
* @property {string[]} [data.files] - The generated module and its types, when its theme map was rewritten.
|
|
191
205
|
* @property {IconTemplateMeanings} [data.templateMeanings] - After a write: the icon definitions the bundled templates use that the set's `map` does not name. A copied template renders a placeholder for each in a project that uses this set.
|
|
192
206
|
*/
|
|
@@ -205,6 +219,7 @@
|
|
|
205
219
|
* @property {string | null} data.previous - The icon id it replaced.
|
|
206
220
|
* @property {boolean} data.changed - Whether the file was written.
|
|
207
221
|
* @property {{previous: string, module: string}} [data.moduleUpdate] - The data file's `module` before and after this command, when the package was renamed and the command wrote its new name.
|
|
222
|
+
* @property {Array<{key: string, definition: string}>} [data.replacedKeys] - Each `map` key that named a replaced icon definition; the command wrote it under the definition that replaced it.
|
|
208
223
|
* @property {string[]} [data.files] - The generated module and its types, when its theme map was rewritten.
|
|
209
224
|
* @property {IconTemplateMeanings} [data.templateMeanings] - After a write: the icon definitions the bundled templates use that the set's `map` does not name. A copied template renders a placeholder for each in a project that uses this set.
|
|
210
225
|
*/
|
|
@@ -309,7 +324,7 @@
|
|
|
309
324
|
* @property {'icon.definitions'} type
|
|
310
325
|
* @property {object} data
|
|
311
326
|
* @property {string | null} data.set - The set `mapped` describes, as `<package>/<set>`: the one `set` names, else the project's main set, else the only set of the icon-set package the command runs in; null when there is none.
|
|
312
|
-
* @property {Array<{name: string, builtIn: boolean, description: string, words: string[], templates: number, mapped?: boolean}>} data.definitions - Every Astryx icon definition, by name; `builtIn` ones every set maps. `templates`: how many bundled templates use it. `mapped`: whether the set's `map` names it, present when `set` is not null.
|
|
327
|
+
* @property {Array<{name: string, builtIn: boolean, description: string, words: string[], group?: string, replaces?: string, templates: number, mapped?: boolean}>} data.definitions - Every Astryx icon definition, by name; `builtIn` ones every set maps. `group`: the family of related definitions it belongs to, present when it names one. `replaces`: the older definition it took the place of, whose name answers with it. `templates`: how many bundled templates use it. `mapped`: whether the set's `map` names it, present when `set` is not null.
|
|
313
328
|
*/
|
|
314
329
|
|
|
315
330
|
/**
|
|
@@ -414,6 +429,7 @@
|
|
|
414
429
|
* @property {string} package - The integration package that ships the set.
|
|
415
430
|
* @property {import('../../authoring/doctypes/icon-set/type').IconSetData} data - The set's data file.
|
|
416
431
|
* @property {Array<{doc: Record<string, unknown>}>} definitions - The set's own icon definitions.
|
|
432
|
+
* @property {Array<{name: string, definition: string}>} [replacedDefinitions] - The old names of the set's own definitions, each with the current definition it answers with.
|
|
417
433
|
* @property {string} [look] - The look the folder's project draws the set in (`experimental.iconVariant`), when the set is in its list.
|
|
418
434
|
*/
|
|
419
435
|
|
package/api/icon/iconMap.doc.mjs
CHANGED
|
@@ -58,12 +58,12 @@ export const doc = {
|
|
|
58
58
|
{
|
|
59
59
|
type: 'icon.mapMany',
|
|
60
60
|
description:
|
|
61
|
-
"With pairs: the set, the data file, each entry with the icon it replaced, and whether the file changed. `templateMeanings.unmapped` lists the icon definitions the bundled templates use that the set's `map` does not name, each with its template count, most used first.",
|
|
61
|
+
"With pairs: the set, the data file, each entry with the icon it replaced, and whether the file changed; `replacedKeys` lists each `map` key that named a replaced definition and was written under its successor's name. `templateMeanings.unmapped` lists the icon definitions the bundled templates use that the set's `map` does not name, each with its template count, most used first.",
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
type: 'icon.map',
|
|
65
65
|
description:
|
|
66
|
-
"The set, the data file, the definition, the icon now mapped, the icon it replaced, and whether the file changed. `templateMeanings.unmapped` lists the icon definitions the bundled templates use that the set's `map` does not name, each with its template count, most used first.",
|
|
66
|
+
"The set, the data file, the definition, the icon now mapped, the icon it replaced, and whether the file changed; `replacedKeys` lists each `map` key that named a replaced definition and was written under its successor's name. `templateMeanings.unmapped` lists the icon definitions the bundled templates use that the set's `map` does not name, each with its template count, most used first.",
|
|
67
67
|
},
|
|
68
68
|
],
|
|
69
69
|
throws: [
|
package/api/icon/list/list.mjs
CHANGED
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
|
+
astryxDefinitionCoverage,
|
|
13
14
|
astryxIconDefinitions,
|
|
15
|
+
discoverListsIconSet,
|
|
14
16
|
ICON_USE_ORDER_COMMAND,
|
|
15
17
|
noIconSetNext,
|
|
16
18
|
iconSetKey,
|
|
@@ -49,7 +51,7 @@ export async function iconList({cwd}) {
|
|
|
49
51
|
next: `${sets.length} icon sets are installed and none is your main set: run \`${ICON_USE_ORDER_COMMAND}\`.`,
|
|
50
52
|
}
|
|
51
53
|
: sets.length === 0 && withdrawn.length === 0
|
|
52
|
-
? {next: noIconSetNext()}
|
|
54
|
+
? {next: noIconSetNext(await discoverListsIconSet(cwd))}
|
|
53
55
|
: {}),
|
|
54
56
|
sets: sets.map(set => {
|
|
55
57
|
const rank = order.indexOf(set);
|
|
@@ -69,10 +71,7 @@ export async function iconList({cwd}) {
|
|
|
69
71
|
total: builtIn.length,
|
|
70
72
|
missing: builtIn.filter(name => !mapped.has(name)),
|
|
71
73
|
},
|
|
72
|
-
astryx:
|
|
73
|
-
mapped: astryx.filter(doc => mapped.has(doc.name)).length,
|
|
74
|
-
total: astryx.length,
|
|
75
|
-
},
|
|
74
|
+
astryx: astryxDefinitionCoverage(mapped),
|
|
76
75
|
own: set.definitions.map(each => each.doc.name),
|
|
77
76
|
},
|
|
78
77
|
project: set === choice.set,
|
package/api/icon/map/map.mjs
CHANGED
|
@@ -85,7 +85,7 @@ export async function iconMap(definition, icon, options = {}) {
|
|
|
85
85
|
await findLocalIconSet(cwd, selector);
|
|
86
86
|
// The docs' kebab id (`eye-slash`) names the same definition, and a
|
|
87
87
|
// library's other name for an icon (`trash-2`) names the same icon.
|
|
88
|
-
definition = definitionNameOf(definition, mappableDefinitions(set));
|
|
88
|
+
definition = definitionNameOf(definition, mappableDefinitions(set), set);
|
|
89
89
|
if (!remove) icon = iconIdIn(set, /** @type {string} */ (icon)) ?? icon;
|
|
90
90
|
const map = {...(set.data.map ?? {})};
|
|
91
91
|
const previous = map[definition] ?? null;
|
|
@@ -117,8 +117,12 @@ export async function iconMap(definition, icon, options = {}) {
|
|
|
117
117
|
}
|
|
118
118
|
map[definition] = /** @type {string} */ (icon);
|
|
119
119
|
}
|
|
120
|
+
// A key that names a replaced definition is written under its
|
|
121
|
+
// successor's name, as discovery reads it.
|
|
120
122
|
const changed =
|
|
121
|
-
(remove ? previous != null : previous !== icon) ||
|
|
123
|
+
(remove ? previous != null : previous !== icon) ||
|
|
124
|
+
moduleRenamed ||
|
|
125
|
+
set.replacedKeys != null;
|
|
122
126
|
/** @type {string[]} */
|
|
123
127
|
const files = [];
|
|
124
128
|
if (changed) {
|
|
@@ -146,6 +150,7 @@ export async function iconMap(definition, icon, options = {}) {
|
|
|
146
150
|
previous,
|
|
147
151
|
changed,
|
|
148
152
|
...(moduleUpdate ? {moduleUpdate} : {}),
|
|
153
|
+
...(set.replacedKeys ? {replacedKeys: set.replacedKeys} : {}),
|
|
149
154
|
...(files.length > 0 ? {files} : {}),
|
|
150
155
|
},
|
|
151
156
|
};
|
|
@@ -201,7 +206,7 @@ async function mapMany({cwd, selector, pairs}) {
|
|
|
201
206
|
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
202
207
|
);
|
|
203
208
|
}
|
|
204
|
-
const name = definitionNameOf(match[1], known);
|
|
209
|
+
const name = definitionNameOf(match[1], known, set);
|
|
205
210
|
const id = iconIdIn(set, match[2]) ?? match[2];
|
|
206
211
|
if (!known.has(name)) {
|
|
207
212
|
throw new AstryxError(
|
|
@@ -229,7 +234,10 @@ async function mapMany({cwd, selector, pairs}) {
|
|
|
229
234
|
changed: previous !== id,
|
|
230
235
|
});
|
|
231
236
|
}
|
|
232
|
-
const changed =
|
|
237
|
+
const changed =
|
|
238
|
+
entries.some(each => each.changed) ||
|
|
239
|
+
moduleRenamed ||
|
|
240
|
+
set.replacedKeys != null;
|
|
233
241
|
/** @type {string[]} */
|
|
234
242
|
const files = [];
|
|
235
243
|
if (changed) {
|
|
@@ -254,6 +262,7 @@ async function mapMany({cwd, selector, pairs}) {
|
|
|
254
262
|
entries,
|
|
255
263
|
changed,
|
|
256
264
|
...(moduleUpdate ? {moduleUpdate} : {}),
|
|
265
|
+
...(set.replacedKeys ? {replacedKeys: set.replacedKeys} : {}),
|
|
257
266
|
...(files.length > 0 ? {files} : {}),
|
|
258
267
|
},
|
|
259
268
|
};
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import {cliVersion} from '../../../foundation/release/run-context.mjs';
|
|
15
15
|
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
16
16
|
import {AstryxError} from '../../error.mjs';
|
|
17
|
-
import {loadIconSets} from '../_adapter.mjs';
|
|
17
|
+
import {loadIconSets, ownReplacedDefinitions} from '../_adapter.mjs';
|
|
18
18
|
import {
|
|
19
19
|
REFERENCE_RE,
|
|
20
20
|
checkIconLimit,
|
|
@@ -39,6 +39,9 @@ function portableSet(set, look) {
|
|
|
39
39
|
package: set.package,
|
|
40
40
|
data: set.data,
|
|
41
41
|
definitions: (set.definitions ?? []).map(each => ({doc: each.doc})),
|
|
42
|
+
...(set.definitionAliases?.size
|
|
43
|
+
? {replacedDefinitions: ownReplacedDefinitions(set)}
|
|
44
|
+
: {}),
|
|
42
45
|
...(look ? {look} : {}),
|
|
43
46
|
}),
|
|
44
47
|
);
|
|
@@ -39,18 +39,20 @@ export function projectLooks(choice: import("../../../foundation/discovery/icon-
|
|
|
39
39
|
* @param {Parameters<typeof rankIcons>[0]} sets in tie order
|
|
40
40
|
* @param {Array<{name: string, package: string, reason: string}>} withdrawn
|
|
41
41
|
* @param {string} query
|
|
42
|
-
* @param {{set?: string, limit: number, looks?: Record<string, string
|
|
43
|
-
* `looks`: the look each set draws, by `<package>/<set
|
|
42
|
+
* @param {{set?: string, limit: number, looks?: Record<string, string>, discoverListsPacks?: boolean}} options
|
|
43
|
+
* `looks`: the look each set draws, by `<package>/<set>`;
|
|
44
|
+
* `discoverListsPacks`: discover lists an icon set the project could add
|
|
44
45
|
* @returns {import('../icon.type.mjs').IconSearchResponse}
|
|
45
46
|
*/
|
|
46
47
|
export function rankIconSets(sets: Parameters<typeof rankIcons>[0], withdrawn: Array<{
|
|
47
48
|
name: string;
|
|
48
49
|
package: string;
|
|
49
50
|
reason: string;
|
|
50
|
-
}>, query: string, { set, limit, looks }: {
|
|
51
|
+
}>, query: string, { set, limit, looks, discoverListsPacks }: {
|
|
51
52
|
set?: string;
|
|
52
53
|
limit: number;
|
|
53
54
|
looks?: Record<string, string>;
|
|
55
|
+
discoverListsPacks?: boolean;
|
|
54
56
|
}): import("../icon.type.mjs").IconSearchResponse;
|
|
55
57
|
/**
|
|
56
58
|
* The Astryx icon definitions that answer a query, each with its score,
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
astryxIconDefinitions,
|
|
14
|
+
discoverListsIconSet,
|
|
15
|
+
definitionRelatives,
|
|
14
16
|
iconLookExport,
|
|
15
17
|
iconSetKey,
|
|
16
18
|
importLine,
|
|
@@ -66,10 +68,12 @@ export async function iconSetIcons({cwd, set}) {
|
|
|
66
68
|
*/
|
|
67
69
|
export async function iconSearch(query, {cwd, set, limit}) {
|
|
68
70
|
const {sets, withdrawn, choice} = await loadIconSets(cwd);
|
|
71
|
+
const noSet = sets.length === 0 && withdrawn.length === 0;
|
|
69
72
|
return rankIconSets(sets, withdrawn, query, {
|
|
70
73
|
set,
|
|
71
74
|
limit,
|
|
72
75
|
looks: projectLooks(choice),
|
|
76
|
+
discoverListsPacks: noSet && (await discoverListsIconSet(cwd)),
|
|
73
77
|
});
|
|
74
78
|
}
|
|
75
79
|
|
|
@@ -97,11 +101,17 @@ export function projectLooks(choice) {
|
|
|
97
101
|
* @param {Parameters<typeof rankIcons>[0]} sets in tie order
|
|
98
102
|
* @param {Array<{name: string, package: string, reason: string}>} withdrawn
|
|
99
103
|
* @param {string} query
|
|
100
|
-
* @param {{set?: string, limit: number, looks?: Record<string, string
|
|
101
|
-
* `looks`: the look each set draws, by `<package>/<set
|
|
104
|
+
* @param {{set?: string, limit: number, looks?: Record<string, string>, discoverListsPacks?: boolean}} options
|
|
105
|
+
* `looks`: the look each set draws, by `<package>/<set>`;
|
|
106
|
+
* `discoverListsPacks`: discover lists an icon set the project could add
|
|
102
107
|
* @returns {import('../icon.type.mjs').IconSearchResponse}
|
|
103
108
|
*/
|
|
104
|
-
export function rankIconSets(
|
|
109
|
+
export function rankIconSets(
|
|
110
|
+
sets,
|
|
111
|
+
withdrawn,
|
|
112
|
+
query,
|
|
113
|
+
{set, limit, looks = {}, discoverListsPacks = false},
|
|
114
|
+
) {
|
|
105
115
|
let searched = sets;
|
|
106
116
|
if (set != null) {
|
|
107
117
|
searched = setsNamed(sets, set);
|
|
@@ -109,7 +119,7 @@ export function rankIconSets(sets, withdrawn, query, {set, limit, looks = {}}) {
|
|
|
109
119
|
}
|
|
110
120
|
// A withdrawn set is installed: `--list` says why it cannot be used.
|
|
111
121
|
if (sets.length === 0 && withdrawn.length === 0) {
|
|
112
|
-
return noIconSet(query, limit);
|
|
122
|
+
return noIconSet(query, limit, discoverListsPacks);
|
|
113
123
|
}
|
|
114
124
|
const ranked = rankIcons(searched, query, {words: true});
|
|
115
125
|
// A word start (`start` for `star`) answers only when nothing matches a
|
|
@@ -123,11 +133,37 @@ export function rankIconSets(sets, withdrawn, query, {set, limit, looks = {}}) {
|
|
|
123
133
|
matchCount: matches.length,
|
|
124
134
|
matches: matches
|
|
125
135
|
.slice(0, limit)
|
|
126
|
-
.map(match => inLook(match, searched, looks)),
|
|
136
|
+
.map(match => withRelatives(inLook(match, searched, looks), searched)),
|
|
127
137
|
},
|
|
128
138
|
};
|
|
129
139
|
}
|
|
130
140
|
|
|
141
|
+
/**
|
|
142
|
+
* A match with `relatives`: the other definitions in the groups of the
|
|
143
|
+
* definitions it draws, from Astryx's and its set's own, so a reader sees
|
|
144
|
+
* the related meanings and picks the one that fits. Absent when there are
|
|
145
|
+
* none. It never changes the ranking.
|
|
146
|
+
* @param {import('../icon.type.mjs').IconMatchEntry} match
|
|
147
|
+
* @param {Parameters<typeof rankIcons>[0]} sets
|
|
148
|
+
* @returns {import('../icon.type.mjs').IconMatchEntry}
|
|
149
|
+
*/
|
|
150
|
+
function withRelatives(match, sets) {
|
|
151
|
+
if (match.definitions.length === 0) return match;
|
|
152
|
+
const set = sets.find(
|
|
153
|
+
each => each.package === match.package && each.name === match.set,
|
|
154
|
+
);
|
|
155
|
+
const relatives = definitionRelatives(match.definitions, [
|
|
156
|
+
...astryxIconDefinitions().definitions.map(each => each.doc),
|
|
157
|
+
...(set?.definitions ?? []).map(
|
|
158
|
+
each =>
|
|
159
|
+
/** @type {{name: string, description: string, group?: string}} */ (
|
|
160
|
+
each.doc
|
|
161
|
+
),
|
|
162
|
+
),
|
|
163
|
+
]);
|
|
164
|
+
return relatives.length > 0 ? {...match, relatives} : match;
|
|
165
|
+
}
|
|
166
|
+
|
|
131
167
|
/**
|
|
132
168
|
* A match drawn in its set's look: its export and import name the icon's
|
|
133
169
|
* variant of that look, or keep its own export with `look` saying which
|
|
@@ -161,9 +197,11 @@ function inLook(match, sets, looks) {
|
|
|
161
197
|
* by name with no set), and how to get a set.
|
|
162
198
|
* @param {string} query
|
|
163
199
|
* @param {number} limit
|
|
200
|
+
* @param {boolean} discoverListsPacks
|
|
164
201
|
* @returns {import('../icon.type.mjs').IconSearchResponse}
|
|
165
202
|
*/
|
|
166
|
-
function noIconSet(query, limit) {
|
|
203
|
+
function noIconSet(query, limit, discoverListsPacks) {
|
|
204
|
+
const docs = astryxIconDefinitions().definitions.map(each => each.doc);
|
|
167
205
|
const found = definitionMatches(query).map(match => match.doc);
|
|
168
206
|
const ordered = [
|
|
169
207
|
...found.filter(doc => doc.builtIn),
|
|
@@ -176,12 +214,17 @@ function noIconSet(query, limit) {
|
|
|
176
214
|
matchCount: 0,
|
|
177
215
|
matches: [],
|
|
178
216
|
reason: 'No icon set is installed.',
|
|
179
|
-
definitions: ordered.slice(0, limit).map(doc =>
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
217
|
+
definitions: ordered.slice(0, limit).map(doc => {
|
|
218
|
+
const relatives = definitionRelatives([doc.name], docs);
|
|
219
|
+
return {
|
|
220
|
+
name: doc.name,
|
|
221
|
+
builtIn: doc.builtIn === true,
|
|
222
|
+
description: doc.description,
|
|
223
|
+
...(doc.group ? {group: doc.group} : {}),
|
|
224
|
+
...(relatives.length > 0 ? {relatives} : {}),
|
|
225
|
+
};
|
|
226
|
+
}),
|
|
227
|
+
next: noIconSetNext(discoverListsPacks),
|
|
185
228
|
},
|
|
186
229
|
};
|
|
187
230
|
}
|
package/api/init/_adapter.d.mts
CHANGED
|
@@ -28,9 +28,53 @@ export function projectInstallStep(packages: string[], cwd: string): {
|
|
|
28
28
|
line: string;
|
|
29
29
|
note: string | null;
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* The project root a skill place belongs to, or null when no folder above
|
|
33
|
+
* `cwd` has a package.json.
|
|
34
|
+
* @param {string} cwd
|
|
35
|
+
* @returns {string | null}
|
|
36
|
+
*/
|
|
37
|
+
export function skillProjectRoot(cwd: string): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Save the project places in `skills.to` of the project's config: no key for
|
|
40
|
+
* the default alone, and no config file when nothing else is left in it. A
|
|
41
|
+
* protected or dynamic config throws, before any file is written.
|
|
42
|
+
* @param {string} projectRoot
|
|
43
|
+
* @param {readonly import('../../foundation/agent-docs/skill-places.mjs').SkillPlace[]} places
|
|
44
|
+
* @param {{check?: boolean}} [options] `check`: throw as the save would, and
|
|
45
|
+
* write nothing, so a run can stop before it changes any place
|
|
46
|
+
*/
|
|
47
|
+
export function saveProjectPlaces(projectRoot: string, places: readonly import("../../foundation/agent-docs/skill-places.mjs").SkillPlace[], { check }?: {
|
|
48
|
+
check?: boolean;
|
|
49
|
+
}): void;
|
|
50
|
+
/**
|
|
51
|
+
* Refuse a project place whose skill files resolve outside the project, as
|
|
52
|
+
* through a skills folder linked out of it, before anything is written.
|
|
53
|
+
* @param {import('../../foundation/agent-docs/skill-places.mjs').SkillPlace} place
|
|
54
|
+
* @param {string} projectRoot
|
|
55
|
+
*/
|
|
56
|
+
export function assertPlaceWithin(place: import("../../foundation/agent-docs/skill-places.mjs").SkillPlace, projectRoot: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* The project skill's text for the project at `projectRoot`.
|
|
59
|
+
* @param {string} projectRoot
|
|
60
|
+
* @returns {Promise<string>}
|
|
61
|
+
*/
|
|
62
|
+
export function projectSkillText(projectRoot: string): Promise<string>;
|
|
63
|
+
/**
|
|
64
|
+
* The computer-level skill's text, for a folder outside any project.
|
|
65
|
+
* @param {string} command
|
|
66
|
+
* @returns {string}
|
|
67
|
+
*/
|
|
68
|
+
export function computerSkillText(command: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* Add folders outside any project to the ones the settings file records.
|
|
71
|
+
* @param {readonly string[]} folders as saved: `~/<path>` or absolute
|
|
72
|
+
*/
|
|
73
|
+
export function addComputerSkillFolders(folders: readonly string[]): void;
|
|
31
74
|
export { STARTER_THEME } from "../../foundation/discovery/theme-discovery.mjs";
|
|
32
75
|
import { COMPUTER_COMMAND } from '../../foundation/agent-docs/computer-agent-text.mjs';
|
|
33
76
|
import { COMPUTER_INSTALL_STEP } from '../../foundation/agent-docs/computer-agent-text.mjs';
|
|
34
77
|
import { displayHomePath } from '../../foundation/agent-docs/computer-agent-text.mjs';
|
|
35
78
|
export { COMPUTER_COMMAND, COMPUTER_INSTALL_STEP, displayHomePath };
|
|
79
|
+
export { readProjectPlaces, removeSkillPlace, writeSkillPlace } from "../../foundation/agent-docs/skill-place-files.mjs";
|
|
36
80
|
export { inspectAgentDocs, resolveAgentPaths } from "../../foundation/agent-docs/agent-docs.mjs";
|
package/api/init/_adapter.mjs
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @file Environment adapter for init: for `init --user`, the home folder, the
|
|
5
5
|
* settings file, the per-user state, and the search path (spec AST-081 FR7,
|
|
6
|
-
* FR8); for
|
|
7
|
-
*
|
|
6
|
+
* FR8); for `init --to`, the project's saved places, its config, and the
|
|
7
|
+
* skill files each place holds; for the getting-started steps, the project's
|
|
8
|
+
* install command (architecture:cli-surface INV21).
|
|
8
9
|
*
|
|
9
10
|
* @input the home folder, the settings file, the search path
|
|
10
11
|
* @output the computer-level agent text written or removed, with the setting
|
|
@@ -12,7 +13,9 @@
|
|
|
12
13
|
* @position packages/cli/api/init — imported by the user and run leaves
|
|
13
14
|
*/
|
|
14
15
|
|
|
16
|
+
import * as fs from 'node:fs';
|
|
15
17
|
import * as os from 'node:os';
|
|
18
|
+
import * as path from 'node:path';
|
|
16
19
|
import {
|
|
17
20
|
COMPUTER_COMMAND,
|
|
18
21
|
COMPUTER_INSTALL_STEP,
|
|
@@ -29,9 +32,33 @@ import {
|
|
|
29
32
|
import {recordAgentTextWritten} from '../../foundation/release/global-state.mjs';
|
|
30
33
|
import {cliVersion} from '../../foundation/release/run-context.mjs';
|
|
31
34
|
import {installStepFor} from '../../foundation/discovery/template-needs.mjs';
|
|
35
|
+
import {writeFailed} from '../error.mjs';
|
|
32
36
|
export {STARTER_THEME} from '../../foundation/discovery/theme-discovery.mjs';
|
|
37
|
+
import {
|
|
38
|
+
computerInstallStep,
|
|
39
|
+
renderComputerAgentText,
|
|
40
|
+
} from '../../foundation/agent-docs/computer-agent-text.mjs';
|
|
41
|
+
import {resolveAgentDocsRoot} from '../../foundation/agent-docs/agent-docs-target.mjs';
|
|
42
|
+
import {renderAgentDocsBlock} from '../../foundation/agent-docs/agent-docs.mjs';
|
|
43
|
+
import {
|
|
44
|
+
projectPlacesValue,
|
|
45
|
+
renderProjectSkill,
|
|
46
|
+
} from '../../foundation/agent-docs/skill-places.mjs';
|
|
47
|
+
import {
|
|
48
|
+
computerSkillFolders,
|
|
49
|
+
recordComputerSkillFolders,
|
|
50
|
+
} from '../../foundation/env/user-settings.mjs';
|
|
51
|
+
import {setConfigValues} from '../../foundation/config/config-writer.mjs';
|
|
52
|
+
import {AstryxError} from '../error.mjs';
|
|
53
|
+
import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
|
|
33
54
|
|
|
34
55
|
export {COMPUTER_COMMAND, COMPUTER_INSTALL_STEP, displayHomePath};
|
|
56
|
+
export {
|
|
57
|
+
readProjectPlaces,
|
|
58
|
+
removeSkillPlace,
|
|
59
|
+
writeSkillPlace,
|
|
60
|
+
} from '../../foundation/agent-docs/skill-place-files.mjs';
|
|
61
|
+
import {skillPlaceEscape} from '../../foundation/agent-docs/skill-place-files.mjs';
|
|
35
62
|
|
|
36
63
|
// What the run leaf reads before it writes agent docs: the state of the files
|
|
37
64
|
// it is about to write.
|
|
@@ -53,21 +80,83 @@ export function applyComputerAgentText({remove}) {
|
|
|
53
80
|
const recorded = computerAgentTextSettings().links;
|
|
54
81
|
/** @type {import('./init.type.mjs').InitUserFile[]} */
|
|
55
82
|
let files;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
83
|
+
try {
|
|
84
|
+
if (remove) {
|
|
85
|
+
files = removeComputerAgentText({home, links: recorded});
|
|
86
|
+
recordComputerAgentTextSettings({install: false, links: []});
|
|
87
|
+
} else {
|
|
88
|
+
const written = writeComputerAgentText({home, command});
|
|
89
|
+
files = written.rows;
|
|
90
|
+
recordComputerAgentTextSettings({
|
|
91
|
+
install: true,
|
|
92
|
+
links: [...new Set([...recorded, ...written.links])],
|
|
93
|
+
});
|
|
94
|
+
recordAgentTextWritten(cliVersion());
|
|
95
|
+
}
|
|
96
|
+
} catch (err) {
|
|
97
|
+
throw computerTextFailed(err, home, remove);
|
|
67
98
|
}
|
|
68
99
|
return {home, command, files, cliOnSearchPath: astryxOnSearchPath()};
|
|
69
100
|
}
|
|
70
101
|
|
|
102
|
+
/**
|
|
103
|
+
* The nearest existing folder above `at`: where a refused recursive write
|
|
104
|
+
* stopped, since the error names the path it was asked for.
|
|
105
|
+
* @param {string} at
|
|
106
|
+
* @returns {string}
|
|
107
|
+
*/
|
|
108
|
+
function nearestFolder(at) {
|
|
109
|
+
let dir = path.dirname(at);
|
|
110
|
+
while (!fs.existsSync(dir)) {
|
|
111
|
+
const parent = path.dirname(dir);
|
|
112
|
+
if (parent === dir) break;
|
|
113
|
+
dir = parent;
|
|
114
|
+
}
|
|
115
|
+
return dir;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The error for a computer-level agent text write or removal the file system
|
|
120
|
+
* refused, as a read-only `~/.agents/skills`: the path, the errno, what had
|
|
121
|
+
* already changed, and the step that fixes that errno. Any other error
|
|
122
|
+
* passes through unchanged.
|
|
123
|
+
* @param {unknown} err
|
|
124
|
+
* @param {string} home
|
|
125
|
+
* @param {boolean} remove
|
|
126
|
+
* @returns {unknown}
|
|
127
|
+
*/
|
|
128
|
+
function computerTextFailed(err, home, remove) {
|
|
129
|
+
const {code, path: at, removed, syscall} = /** @type {{code?: unknown, path?: unknown, removed?: string[], syscall?: unknown}} */ (
|
|
130
|
+
err ?? {}
|
|
131
|
+
);
|
|
132
|
+
if (typeof code !== 'string' || typeof at !== 'string') return err;
|
|
133
|
+
const again = remove ? 'astryx init --user --remove-agents' : 'astryx init --user';
|
|
134
|
+
// An open that fails on a file that exists is refused by the file itself
|
|
135
|
+
// (read-only, or owned by root after a sudo run); a mkdir, an unlink, or a
|
|
136
|
+
// missing target is refused by the folder that holds it.
|
|
137
|
+
const fix = syscall === 'open' && fs.existsSync(at) ? at : nearestFolder(at);
|
|
138
|
+
/** @type {Record<string, string>} */
|
|
139
|
+
const nextFor = {
|
|
140
|
+
EACCES: `Give yourself write access to ${displayHomePath(fix, home)}, then run \`${again}\` again.`,
|
|
141
|
+
EPERM: `Give yourself write access to ${displayHomePath(fix, home)}, then run \`${again}\` again.`,
|
|
142
|
+
EROFS: `That folder is on a read-only file system; run \`${again}\` where your home folder can be written.`,
|
|
143
|
+
ENOTDIR: `A file stands where a folder belongs on that path (such as ~/.agents being a file); move it aside, then run \`${again}\` again.`,
|
|
144
|
+
};
|
|
145
|
+
const next = nextFor[code];
|
|
146
|
+
if (!next) return err;
|
|
147
|
+
const done = (removed ?? []).map(file => displayHomePath(file, home));
|
|
148
|
+
return writeFailed(at, home, err, [], {
|
|
149
|
+
shown: `the computer-level agent text at ${displayHomePath(at, home)}`,
|
|
150
|
+
what: remove ? 'remove' : 'write',
|
|
151
|
+
outcome: remove
|
|
152
|
+
? done.length > 0
|
|
153
|
+
? `Already removed: ${done.join(', ')}.`
|
|
154
|
+
: 'The computer-level agent text was not removed.'
|
|
155
|
+
: 'The computer-level agent text was not written.',
|
|
156
|
+
next,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
71
160
|
/**
|
|
72
161
|
* The install step to print for `packages` in the project at `cwd`: the
|
|
73
162
|
* install guidance its integrations give, else its package manager's command,
|
|
@@ -79,3 +168,93 @@ export function applyComputerAgentText({remove}) {
|
|
|
79
168
|
export function projectInstallStep(packages, cwd) {
|
|
80
169
|
return installStepFor(packages, cwd);
|
|
81
170
|
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* The project root a skill place belongs to, or null when no folder above
|
|
174
|
+
* `cwd` has a package.json.
|
|
175
|
+
* @param {string} cwd
|
|
176
|
+
* @returns {string | null}
|
|
177
|
+
*/
|
|
178
|
+
export function skillProjectRoot(cwd) {
|
|
179
|
+
return resolveAgentDocsRoot(cwd);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Save the project places in `skills.to` of the project's config: no key for
|
|
185
|
+
* the default alone, and no config file when nothing else is left in it. A
|
|
186
|
+
* protected or dynamic config throws, before any file is written.
|
|
187
|
+
* @param {string} projectRoot
|
|
188
|
+
* @param {readonly import('../../foundation/agent-docs/skill-places.mjs').SkillPlace[]} places
|
|
189
|
+
* @param {{check?: boolean}} [options] `check`: throw as the save would, and
|
|
190
|
+
* write nothing, so a run can stop before it changes any place
|
|
191
|
+
*/
|
|
192
|
+
export function saveProjectPlaces(projectRoot, places, {check = false} = {}) {
|
|
193
|
+
let written;
|
|
194
|
+
try {
|
|
195
|
+
written = setConfigValues(projectRoot, [['skills.to', projectPlacesValue(places)]], {check});
|
|
196
|
+
} catch (error) {
|
|
197
|
+
// A protected config keeps the stable code every consumer-file writer
|
|
198
|
+
// uses (spec:AST-040 FR4, FR6).
|
|
199
|
+
const code = /** @type {{code?: unknown}} */ (error)?.code;
|
|
200
|
+
const stable = [
|
|
201
|
+
ERROR_CODES.ERR_CODEMOD_PROTECTED,
|
|
202
|
+
ERROR_CODES.ERR_CODEMOD_PROTECTION_SOURCE,
|
|
203
|
+
].find(each => each === code);
|
|
204
|
+
throw new AstryxError(
|
|
205
|
+
error instanceof Error ? error.message : String(error),
|
|
206
|
+
undefined,
|
|
207
|
+
stable ?? ERROR_CODES.ERR_WRITE_FAILED,
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
// A config left holding nothing says what no config says, so it goes, as
|
|
211
|
+
// after a move back to the default place in a project init gave a config.
|
|
212
|
+
if (
|
|
213
|
+
!check &&
|
|
214
|
+
written.changed &&
|
|
215
|
+
/^export default \{\};?\s*$/u.test(fs.readFileSync(written.file, 'utf8'))
|
|
216
|
+
) {
|
|
217
|
+
fs.unlinkSync(written.file);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Refuse a project place whose skill files resolve outside the project, as
|
|
223
|
+
* through a skills folder linked out of it, before anything is written.
|
|
224
|
+
* @param {import('../../foundation/agent-docs/skill-places.mjs').SkillPlace} place
|
|
225
|
+
* @param {string} projectRoot
|
|
226
|
+
*/
|
|
227
|
+
export function assertPlaceWithin(place, projectRoot) {
|
|
228
|
+
const escape = skillPlaceEscape(place, projectRoot);
|
|
229
|
+
if (escape) throw new AstryxError(escape, undefined, ERROR_CODES.ERR_PATH_TRAVERSAL);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* The project skill's text for the project at `projectRoot`.
|
|
234
|
+
* @param {string} projectRoot
|
|
235
|
+
* @returns {Promise<string>}
|
|
236
|
+
*/
|
|
237
|
+
export async function projectSkillText(projectRoot) {
|
|
238
|
+
return renderProjectSkill(await renderAgentDocsBlock(projectRoot));
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* The computer-level skill's text, for a folder outside any project.
|
|
243
|
+
* @param {string} command
|
|
244
|
+
* @returns {string}
|
|
245
|
+
*/
|
|
246
|
+
export function computerSkillText(command) {
|
|
247
|
+
return renderComputerAgentText({command, install: computerInstallStep()});
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Add folders outside any project to the ones the settings file records.
|
|
255
|
+
* @param {readonly string[]} folders as saved: `~/<path>` or absolute
|
|
256
|
+
*/
|
|
257
|
+
export function addComputerSkillFolders(folders) {
|
|
258
|
+
const saved = computerSkillFolders();
|
|
259
|
+
recordComputerSkillFolders([...new Set([...saved, ...folders])]);
|
|
260
|
+
}
|