@synergy-design-system/metadata 3.7.0 → 3.9.0
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/CHANGELOG.md +25 -0
- package/README.md +45 -0
- package/data/core/component/component:syn-accordion.json +46 -3
- package/data/core/component/component:syn-alert.json +112 -3
- package/data/core/component/component:syn-badge.json +66 -3
- package/data/core/component/component:syn-breadcrumb-item.json +37 -3
- package/data/core/component/component:syn-breadcrumb.json +57 -3
- package/data/core/component/component:syn-button-group.json +76 -3
- package/data/core/component/component:syn-button.json +76 -3
- package/data/core/component/component:syn-card.json +56 -3
- package/data/core/component/component:syn-chart.json +181 -0
- package/data/core/component/component:syn-checkbox.json +48 -3
- package/data/core/component/component:syn-combobox.json +53 -2
- package/data/core/component/component:syn-details.json +53 -3
- package/data/core/component/component:syn-dialog.json +70 -3
- package/data/core/component/component:syn-divider.json +38 -3
- package/data/core/component/component:syn-drawer.json +64 -3
- package/data/core/component/component:syn-dropdown.json +52 -3
- package/data/core/component/component:syn-file.json +60 -2
- package/data/core/component/component:syn-header.json +60 -1
- package/data/core/component/component:syn-icon-button.json +57 -3
- package/data/core/component/component:syn-icon.json +70 -4
- package/data/core/component/component:syn-input.json +69 -3
- package/data/core/component/component:syn-menu-item.json +62 -3
- package/data/core/component/component:syn-menu-label.json +59 -3
- package/data/core/component/component:syn-menu.json +66 -3
- package/data/core/component/component:syn-nav-item.json +62 -3
- package/data/core/component/component:syn-optgroup.json +49 -3
- package/data/core/component/component:syn-option.json +43 -3
- package/data/core/component/component:syn-pagination.json +54 -0
- package/data/core/component/component:syn-popup.json +56 -2
- package/data/core/component/component:syn-prio-nav.json +60 -3
- package/data/core/component/component:syn-progress-bar.json +58 -3
- package/data/core/component/component:syn-progress-ring.json +58 -3
- package/data/core/component/component:syn-radio-button.json +65 -2
- package/data/core/component/component:syn-radio-group.json +57 -3
- package/data/core/component/component:syn-radio.json +61 -3
- package/data/core/component/component:syn-range-tick.json +63 -2
- package/data/core/component/component:syn-range.json +61 -2
- package/data/core/component/component:syn-select.json +54 -3
- package/data/core/component/component:syn-side-nav.json +61 -3
- package/data/core/component/component:syn-spinner.json +55 -3
- package/data/core/component/component:syn-switch.json +51 -3
- package/data/core/component/component:syn-tab-group.json +50 -3
- package/data/core/component/component:syn-tab-panel.json +61 -3
- package/data/core/component/component:syn-tab.json +60 -3
- package/data/core/component/component:syn-tag-group.json +58 -2
- package/data/core/component/component:syn-tag.json +52 -3
- package/data/core/component/component:syn-textarea.json +53 -3
- package/data/core/component/component:syn-tooltip.json +66 -3
- package/data/core/component/component:syn-validate.json +64 -2
- package/data/core/setup/setup:angular-components-module.json +1 -1
- package/data/core/setup/setup:angular-forms-module.json +1 -1
- package/data/core/setup/setup:angular-package.json +2 -2
- package/data/core/setup/setup:angular-validators-module.json +1 -1
- package/data/core/setup/setup:components-package.json +2 -2
- package/data/core/setup/setup:react-package.json +2 -2
- package/data/core/setup/setup:tokens-package.json +10 -2
- package/data/core/setup/setup:vue-package.json +2 -2
- package/data/core/token/token:tokens-charts-js-index-d-ts.json +31 -0
- package/data/core/token/token:tokens-charts-js-index-js.json +31 -0
- package/data/core/token/token:tokens-charts-scss-tokens-scss.json +31 -0
- package/data/core/token/token:tokens-charts-themes-sick2025-dark-css.json +32 -0
- package/data/core/token/token:tokens-charts-themes-sick2025-light-css.json +32 -0
- package/data/core/token/token:tokens-figma-variables-sick2018-dark-json.json +1 -1
- package/data/core/token/token:tokens-figma-variables-sick2018-light-json.json +1 -1
- package/data/core/token/token:tokens-figma-variables-sick2025-dark-json.json +1 -1
- package/data/core/token/token:tokens-figma-variables-sick2025-light-json.json +1 -1
- package/data/core/token/token:tokens-js-index-d-ts.json +1 -1
- package/data/core/token/token:tokens-js-index-js.json +1 -1
- package/data/core/token/token:tokens-scss-tokens-scss.json +1 -1
- package/data/core/token/token:tokens-themes-sick2018-dark-css.json +1 -1
- package/data/core/token/token:tokens-themes-sick2018-light-css.json +1 -1
- package/data/core/token/token:tokens-themes-sick2025-dark-css.json +1 -1
- package/data/core/token/token:tokens-themes-sick2025-light-css.json +1 -1
- package/data/index.json +204 -49
- package/data/layers/examples/component/component:syn-chart.md +191 -0
- package/data/layers/full/component/component:syn-accordion/angular/accordion.component.ts +2 -2
- package/data/layers/full/component/component:syn-accordion/components/accordion.component.ts +1 -1
- package/data/layers/full/component/component:syn-accordion/react/accordion.ts +1 -1
- package/data/layers/full/component/component:syn-accordion/vue/SynVueAccordion.vue +2 -2
- package/data/layers/full/component/component:syn-alert/angular/alert.component.ts +2 -2
- package/data/layers/full/component/component:syn-alert/components/alert.component.ts +1 -1
- package/data/layers/full/component/component:syn-alert/react/alert.ts +1 -1
- package/data/layers/full/component/component:syn-alert/vue/SynVueAlert.vue +2 -2
- package/data/layers/full/component/component:syn-badge/angular/badge.component.ts +2 -2
- package/data/layers/full/component/component:syn-badge/components/badge.component.ts +1 -1
- package/data/layers/full/component/component:syn-badge/react/badge.ts +1 -1
- package/data/layers/full/component/component:syn-badge/vue/SynVueBadge.vue +2 -2
- package/data/layers/full/component/component:syn-breadcrumb/angular/breadcrumb.component.ts +2 -2
- package/data/layers/full/component/component:syn-breadcrumb/components/breadcrumb.component.ts +1 -1
- package/data/layers/full/component/component:syn-breadcrumb/react/breadcrumb.ts +1 -1
- package/data/layers/full/component/component:syn-breadcrumb/vue/SynVueBreadcrumb.vue +2 -2
- package/data/layers/full/component/component:syn-breadcrumb-item/angular/breadcrumb-item.component.ts +2 -2
- package/data/layers/full/component/component:syn-breadcrumb-item/components/breadcrumb-item.component.ts +1 -1
- package/data/layers/full/component/component:syn-breadcrumb-item/react/breadcrumb-item.ts +1 -1
- package/data/layers/full/component/component:syn-breadcrumb-item/vue/SynVueBreadcrumbItem.vue +2 -2
- package/data/layers/full/component/component:syn-button/angular/button.component.ts +2 -2
- package/data/layers/full/component/component:syn-button/components/button.component.ts +1 -1
- package/data/layers/full/component/component:syn-button/react/button.ts +1 -1
- package/data/layers/full/component/component:syn-button/vue/SynVueButton.vue +2 -2
- package/data/layers/full/component/component:syn-button-group/angular/button-group.component.ts +2 -2
- package/data/layers/full/component/component:syn-button-group/components/button-group.component.ts +1 -1
- package/data/layers/full/component/component:syn-button-group/react/button-group.ts +1 -1
- package/data/layers/full/component/component:syn-button-group/vue/SynVueButtonGroup.vue +2 -2
- package/data/layers/full/component/component:syn-card/angular/card.component.ts +2 -2
- package/data/layers/full/component/component:syn-card/components/card.component.ts +1 -1
- package/data/layers/full/component/component:syn-card/react/card.ts +1 -1
- package/data/layers/full/component/component:syn-card/vue/SynVueCard.vue +2 -2
- package/data/layers/full/component/component:syn-chart/angular/chart.component.ts +84 -0
- package/data/layers/full/component/component:syn-chart/components/chart.component.ts +181 -0
- package/data/layers/full/component/component:syn-chart/components/chart.palettes.ts +110 -0
- package/data/layers/full/component/component:syn-chart/components/chart.styles.ts +15 -0
- package/data/layers/full/component/component:syn-chart/components/chart.ts +14 -0
- package/data/layers/full/component/component:syn-chart/components/types.ts +5 -0
- package/data/layers/full/component/component:syn-chart/react/SynChartJSXElement.ts +1 -0
- package/data/layers/full/component/component:syn-chart/react/chart.ts +28 -0
- package/data/layers/full/component/component:syn-chart/vue/SynVueChart.vue +76 -0
- package/data/layers/full/component/component:syn-checkbox/angular/checkbox.component.ts +2 -2
- package/data/layers/full/component/component:syn-checkbox/components/checkbox.component.ts +1 -1
- package/data/layers/full/component/component:syn-checkbox/react/checkbox.ts +1 -1
- package/data/layers/full/component/component:syn-checkbox/vue/SynVueCheckbox.vue +2 -2
- package/data/layers/full/component/component:syn-combobox/angular/combobox.component.ts +2 -1
- package/data/layers/full/component/component:syn-combobox/components/combobox.component.ts +1 -0
- package/data/layers/full/component/component:syn-combobox/react/combobox.ts +1 -0
- package/data/layers/full/component/component:syn-combobox/vue/SynVueCombobox.vue +2 -1
- package/data/layers/full/component/component:syn-details/angular/details.component.ts +2 -2
- package/data/layers/full/component/component:syn-details/components/details.component.ts +1 -1
- package/data/layers/full/component/component:syn-details/react/details.ts +1 -1
- package/data/layers/full/component/component:syn-details/vue/SynVueDetails.vue +2 -2
- package/data/layers/full/component/component:syn-dialog/angular/dialog.component.ts +2 -2
- package/data/layers/full/component/component:syn-dialog/components/dialog.component.ts +1 -1
- package/data/layers/full/component/component:syn-dialog/react/dialog.ts +1 -1
- package/data/layers/full/component/component:syn-dialog/vue/SynVueDialog.vue +2 -2
- package/data/layers/full/component/component:syn-divider/angular/divider.component.ts +2 -2
- package/data/layers/full/component/component:syn-divider/components/divider.component.ts +1 -1
- package/data/layers/full/component/component:syn-divider/react/divider.ts +1 -1
- package/data/layers/full/component/component:syn-divider/vue/SynVueDivider.vue +2 -2
- package/data/layers/full/component/component:syn-drawer/angular/drawer.component.ts +2 -2
- package/data/layers/full/component/component:syn-drawer/components/drawer.component.ts +1 -1
- package/data/layers/full/component/component:syn-drawer/react/drawer.ts +1 -1
- package/data/layers/full/component/component:syn-drawer/vue/SynVueDrawer.vue +2 -2
- package/data/layers/full/component/component:syn-dropdown/angular/dropdown.component.ts +2 -2
- package/data/layers/full/component/component:syn-dropdown/components/dropdown.component.ts +1 -1
- package/data/layers/full/component/component:syn-dropdown/react/dropdown.ts +1 -1
- package/data/layers/full/component/component:syn-dropdown/vue/SynVueDropdown.vue +2 -2
- package/data/layers/full/component/component:syn-file/angular/file.component.ts +2 -1
- package/data/layers/full/component/component:syn-file/components/file.component.ts +1 -0
- package/data/layers/full/component/component:syn-file/react/file.ts +1 -0
- package/data/layers/full/component/component:syn-file/vue/SynVueFile.vue +2 -1
- package/data/layers/full/component/component:syn-header/angular/header.component.ts +1 -1
- package/data/layers/full/component/component:syn-header/vue/SynVueHeader.vue +1 -1
- package/data/layers/full/component/component:syn-icon/angular/icon.component.ts +2 -2
- package/data/layers/full/component/component:syn-icon/components/icon.component.ts +1 -1
- package/data/layers/full/component/component:syn-icon/react/icon.ts +1 -1
- package/data/layers/full/component/component:syn-icon/vue/SynVueIcon.vue +2 -2
- package/data/layers/full/component/component:syn-icon-button/angular/icon-button.component.ts +2 -2
- package/data/layers/full/component/component:syn-icon-button/components/icon-button.component.ts +1 -1
- package/data/layers/full/component/component:syn-icon-button/react/icon-button.ts +1 -1
- package/data/layers/full/component/component:syn-icon-button/vue/SynVueIconButton.vue +2 -2
- package/data/layers/full/component/component:syn-input/angular/input.component.ts +2 -2
- package/data/layers/full/component/component:syn-input/components/input.component.ts +1 -1
- package/data/layers/full/component/component:syn-input/react/input.ts +1 -1
- package/data/layers/full/component/component:syn-input/vue/SynVueInput.vue +2 -2
- package/data/layers/full/component/component:syn-menu/angular/menu.component.ts +2 -2
- package/data/layers/full/component/component:syn-menu/components/menu.component.ts +1 -1
- package/data/layers/full/component/component:syn-menu/react/menu.ts +1 -1
- package/data/layers/full/component/component:syn-menu/vue/SynVueMenu.vue +2 -2
- package/data/layers/full/component/component:syn-menu-item/angular/menu-item.component.ts +2 -2
- package/data/layers/full/component/component:syn-menu-item/components/menu-item.component.ts +1 -1
- package/data/layers/full/component/component:syn-menu-item/react/menu-item.ts +1 -1
- package/data/layers/full/component/component:syn-menu-item/vue/SynVueMenuItem.vue +2 -2
- package/data/layers/full/component/component:syn-menu-label/angular/menu-label.component.ts +2 -2
- package/data/layers/full/component/component:syn-menu-label/components/menu-label.component.ts +1 -1
- package/data/layers/full/component/component:syn-menu-label/react/menu-label.ts +1 -1
- package/data/layers/full/component/component:syn-menu-label/vue/SynVueMenuLabel.vue +2 -2
- package/data/layers/full/component/component:syn-nav-item/angular/nav-item.component.ts +2 -2
- package/data/layers/full/component/component:syn-nav-item/components/nav-item.component.ts +1 -1
- package/data/layers/full/component/component:syn-nav-item/react/nav-item.ts +1 -1
- package/data/layers/full/component/component:syn-nav-item/vue/SynVueNavItem.vue +2 -2
- package/data/layers/full/component/component:syn-optgroup/angular/optgroup.component.ts +2 -2
- package/data/layers/full/component/component:syn-optgroup/components/optgroup.component.ts +1 -1
- package/data/layers/full/component/component:syn-optgroup/react/optgroup.ts +1 -1
- package/data/layers/full/component/component:syn-optgroup/vue/SynVueOptgroup.vue +2 -2
- package/data/layers/full/component/component:syn-option/angular/option.component.ts +2 -2
- package/data/layers/full/component/component:syn-option/components/option.component.ts +1 -1
- package/data/layers/full/component/component:syn-option/react/option.ts +1 -1
- package/data/layers/full/component/component:syn-option/vue/SynVueOption.vue +2 -2
- package/data/layers/full/component/component:syn-pagination/angular/pagination.component.ts +1 -1
- package/data/layers/full/component/component:syn-pagination/vue/SynVuePagination.vue +1 -1
- package/data/layers/full/component/component:syn-popup/angular/popup.component.ts +2 -2
- package/data/layers/full/component/component:syn-popup/components/popup.component.ts +1 -1
- package/data/layers/full/component/component:syn-popup/react/popup.ts +1 -1
- package/data/layers/full/component/component:syn-popup/vue/SynVuePopup.vue +2 -2
- package/data/layers/full/component/component:syn-prio-nav/angular/prio-nav.component.ts +2 -2
- package/data/layers/full/component/component:syn-prio-nav/components/prio-nav.component.ts +1 -1
- package/data/layers/full/component/component:syn-prio-nav/react/prio-nav.ts +1 -1
- package/data/layers/full/component/component:syn-prio-nav/vue/SynVuePrioNav.vue +2 -2
- package/data/layers/full/component/component:syn-progress-bar/angular/progress-bar.component.ts +2 -2
- package/data/layers/full/component/component:syn-progress-bar/components/progress-bar.component.ts +1 -1
- package/data/layers/full/component/component:syn-progress-bar/react/progress-bar.ts +1 -1
- package/data/layers/full/component/component:syn-progress-bar/vue/SynVueProgressBar.vue +2 -2
- package/data/layers/full/component/component:syn-progress-ring/angular/progress-ring.component.ts +2 -2
- package/data/layers/full/component/component:syn-progress-ring/components/progress-ring.component.ts +1 -1
- package/data/layers/full/component/component:syn-progress-ring/react/progress-ring.ts +1 -1
- package/data/layers/full/component/component:syn-progress-ring/vue/SynVueProgressRing.vue +2 -2
- package/data/layers/full/component/component:syn-radio/angular/radio.component.ts +2 -2
- package/data/layers/full/component/component:syn-radio/components/radio.component.ts +1 -1
- package/data/layers/full/component/component:syn-radio/react/radio.ts +1 -1
- package/data/layers/full/component/component:syn-radio/vue/SynVueRadio.vue +2 -2
- package/data/layers/full/component/component:syn-radio-button/angular/radio-button.component.ts +2 -2
- package/data/layers/full/component/component:syn-radio-button/components/radio-button.component.ts +1 -1
- package/data/layers/full/component/component:syn-radio-button/react/radio-button.ts +1 -1
- package/data/layers/full/component/component:syn-radio-button/vue/SynVueRadioButton.vue +2 -2
- package/data/layers/full/component/component:syn-radio-group/angular/radio-group.component.ts +2 -2
- package/data/layers/full/component/component:syn-radio-group/components/radio-group.component.ts +1 -1
- package/data/layers/full/component/component:syn-radio-group/react/radio-group.ts +1 -1
- package/data/layers/full/component/component:syn-radio-group/vue/SynVueRadioGroup.vue +2 -2
- package/data/layers/full/component/component:syn-range/angular/range.component.ts +2 -1
- package/data/layers/full/component/component:syn-range/components/range.component.ts +1 -0
- package/data/layers/full/component/component:syn-range/react/range.ts +1 -0
- package/data/layers/full/component/component:syn-range/vue/SynVueRange.vue +2 -1
- package/data/layers/full/component/component:syn-range-tick/angular/range-tick.component.ts +2 -1
- package/data/layers/full/component/component:syn-range-tick/components/range-tick.component.ts +1 -0
- package/data/layers/full/component/component:syn-range-tick/react/range-tick.ts +1 -0
- package/data/layers/full/component/component:syn-range-tick/vue/SynVueRangeTick.vue +2 -1
- package/data/layers/full/component/component:syn-select/angular/select.component.ts +2 -2
- package/data/layers/full/component/component:syn-select/components/select.component.ts +1 -1
- package/data/layers/full/component/component:syn-select/react/select.ts +1 -1
- package/data/layers/full/component/component:syn-select/vue/SynVueSelect.vue +2 -2
- package/data/layers/full/component/component:syn-side-nav/angular/side-nav.component.ts +2 -2
- package/data/layers/full/component/component:syn-side-nav/components/side-nav.component.ts +1 -1
- package/data/layers/full/component/component:syn-side-nav/react/side-nav.ts +1 -1
- package/data/layers/full/component/component:syn-side-nav/vue/SynVueSideNav.vue +2 -2
- package/data/layers/full/component/component:syn-spinner/angular/spinner.component.ts +2 -2
- package/data/layers/full/component/component:syn-spinner/components/spinner.component.ts +1 -1
- package/data/layers/full/component/component:syn-spinner/react/spinner.ts +1 -1
- package/data/layers/full/component/component:syn-spinner/vue/SynVueSpinner.vue +2 -2
- package/data/layers/full/component/component:syn-switch/angular/switch.component.ts +2 -2
- package/data/layers/full/component/component:syn-switch/components/switch.component.ts +1 -1
- package/data/layers/full/component/component:syn-switch/react/switch.ts +1 -1
- package/data/layers/full/component/component:syn-switch/vue/SynVueSwitch.vue +2 -2
- package/data/layers/full/component/component:syn-tab/angular/tab.component.ts +2 -2
- package/data/layers/full/component/component:syn-tab/components/tab.component.ts +1 -1
- package/data/layers/full/component/component:syn-tab/react/tab.ts +1 -1
- package/data/layers/full/component/component:syn-tab/vue/SynVueTab.vue +2 -2
- package/data/layers/full/component/component:syn-tab-group/angular/tab-group.component.ts +2 -2
- package/data/layers/full/component/component:syn-tab-group/components/tab-group.component.ts +1 -1
- package/data/layers/full/component/component:syn-tab-group/react/tab-group.ts +1 -1
- package/data/layers/full/component/component:syn-tab-group/vue/SynVueTabGroup.vue +2 -2
- package/data/layers/full/component/component:syn-tab-panel/angular/tab-panel.component.ts +2 -2
- package/data/layers/full/component/component:syn-tab-panel/components/tab-panel.component.ts +1 -1
- package/data/layers/full/component/component:syn-tab-panel/react/tab-panel.ts +1 -1
- package/data/layers/full/component/component:syn-tab-panel/vue/SynVueTabPanel.vue +2 -2
- package/data/layers/full/component/component:syn-tag/angular/tag.component.ts +2 -2
- package/data/layers/full/component/component:syn-tag/components/tag.component.ts +1 -1
- package/data/layers/full/component/component:syn-tag/react/tag.ts +1 -1
- package/data/layers/full/component/component:syn-tag/vue/SynVueTag.vue +2 -2
- package/data/layers/full/component/component:syn-tag-group/angular/tag-group.component.ts +2 -1
- package/data/layers/full/component/component:syn-tag-group/components/tag-group.component.ts +1 -0
- package/data/layers/full/component/component:syn-tag-group/react/tag-group.ts +1 -0
- package/data/layers/full/component/component:syn-tag-group/vue/SynVueTagGroup.vue +2 -1
- package/data/layers/full/component/component:syn-textarea/angular/textarea.component.ts +2 -2
- package/data/layers/full/component/component:syn-textarea/components/textarea.component.ts +1 -1
- package/data/layers/full/component/component:syn-textarea/react/textarea.ts +1 -1
- package/data/layers/full/component/component:syn-textarea/vue/SynVueTextarea.vue +2 -2
- package/data/layers/full/component/component:syn-tooltip/angular/tooltip.component.ts +2 -2
- package/data/layers/full/component/component:syn-tooltip/components/tooltip.component.ts +1 -1
- package/data/layers/full/component/component:syn-tooltip/react/tooltip.ts +1 -1
- package/data/layers/full/component/component:syn-tooltip/vue/SynVueTooltip.vue +2 -2
- package/data/layers/full/component/component:syn-validate/angular/validate.component.ts +4 -1
- package/data/layers/full/component/component:syn-validate/components/validate.component.ts +3 -0
- package/data/layers/full/component/component:syn-validate/react/validate.ts +3 -0
- package/data/layers/full/component/component:syn-validate/vue/SynVueValidate.vue +4 -1
- package/data/layers/full/setup/setup:angular-package/angular/CHANGELOG.md +37 -0
- package/data/layers/full/setup/setup:angular-package/angular/README.md +4 -0
- package/data/layers/full/setup/setup:angular-package/angular/package.json +1 -1
- package/data/layers/full/setup/setup:components-package/components/CHANGELOG.md +36 -1
- package/data/layers/full/setup/setup:components-package/components/README.md +84 -2
- package/data/layers/full/setup/setup:components-package/components/package.json +8 -5
- package/data/layers/full/setup/setup:react-package/react/CHANGELOG.md +37 -0
- package/data/layers/full/setup/setup:react-package/react/README.md +4 -0
- package/data/layers/full/setup/setup:react-package/react/package.json +1 -1
- package/data/layers/full/setup/setup:react-package/react/syn-jsx-elements.ts +115 -80
- package/data/layers/full/setup/setup:tokens-package/tokens/CHANGELOG.md +18 -0
- package/data/layers/full/setup/setup:tokens-package/tokens/README.md +119 -19
- package/data/layers/full/setup/setup:tokens-package/tokens/package.json +11 -6
- package/data/layers/full/setup/setup:vue-package/vue/CHANGELOG.md +37 -0
- package/data/layers/full/setup/setup:vue-package/vue/README.md +4 -0
- package/data/layers/full/setup/setup:vue-package/vue/package.json +9 -2
- package/data/layers/full/tokens/charts/js/index.d.ts +664 -0
- package/data/layers/full/tokens/charts/js/index.js +664 -0
- package/data/layers/full/tokens/charts/scss/_tokens.scss +136 -0
- package/data/layers/full/tokens/charts/themes/sick2025_dark.css +142 -0
- package/data/layers/full/tokens/charts/themes/sick2025_light.css +142 -0
- package/data/layers/full/tokens/figma-variables/sick2025-light.json +12 -12
- package/data/layers/full/tokens/js/index.d.ts +1 -1
- package/data/layers/full/tokens/js/index.js +1 -1
- package/data/layers/full/tokens/scss/_tokens.scss +1 -1
- package/data/layers/full/tokens/themes/sick2018_dark.css +1 -1
- package/data/layers/full/tokens/themes/sick2018_light.css +1 -1
- package/data/layers/full/tokens/themes/sick2025_dark.css +1 -1
- package/data/layers/full/tokens/themes/sick2025_light.css +12 -12
- package/data/layers/interface/component/component:syn-accordion.json +3 -2
- package/data/layers/interface/component/component:syn-accordion.md +3 -2
- package/data/layers/interface/component/component:syn-alert.json +3 -2
- package/data/layers/interface/component/component:syn-alert.md +3 -2
- package/data/layers/interface/component/component:syn-badge.json +3 -2
- package/data/layers/interface/component/component:syn-badge.md +3 -2
- package/data/layers/interface/component/component:syn-breadcrumb-item.json +3 -2
- package/data/layers/interface/component/component:syn-breadcrumb-item.md +3 -2
- package/data/layers/interface/component/component:syn-breadcrumb.json +3 -2
- package/data/layers/interface/component/component:syn-breadcrumb.md +3 -2
- package/data/layers/interface/component/component:syn-button-group.json +2 -2
- package/data/layers/interface/component/component:syn-button-group.md +2 -2
- package/data/layers/interface/component/component:syn-button.json +3 -2
- package/data/layers/interface/component/component:syn-button.md +3 -2
- package/data/layers/interface/component/component:syn-card.json +3 -2
- package/data/layers/interface/component/component:syn-card.md +3 -2
- package/data/layers/interface/component/component:syn-chart.json +51 -0
- package/data/layers/interface/component/component:syn-chart.md +61 -0
- package/data/layers/interface/component/component:syn-checkbox.json +3 -2
- package/data/layers/interface/component/component:syn-checkbox.md +3 -2
- package/data/layers/interface/component/component:syn-combobox.json +3 -2
- package/data/layers/interface/component/component:syn-combobox.md +3 -2
- package/data/layers/interface/component/component:syn-details.json +3 -2
- package/data/layers/interface/component/component:syn-details.md +3 -2
- package/data/layers/interface/component/component:syn-dialog.json +3 -2
- package/data/layers/interface/component/component:syn-dialog.md +3 -2
- package/data/layers/interface/component/component:syn-divider.json +3 -2
- package/data/layers/interface/component/component:syn-divider.md +3 -2
- package/data/layers/interface/component/component:syn-drawer.json +3 -2
- package/data/layers/interface/component/component:syn-drawer.md +3 -2
- package/data/layers/interface/component/component:syn-dropdown.json +3 -2
- package/data/layers/interface/component/component:syn-dropdown.md +3 -2
- package/data/layers/interface/component/component:syn-file.json +3 -2
- package/data/layers/interface/component/component:syn-file.md +3 -2
- package/data/layers/interface/component/component:syn-header.json +2 -1
- package/data/layers/interface/component/component:syn-header.md +2 -1
- package/data/layers/interface/component/component:syn-icon-button.json +3 -2
- package/data/layers/interface/component/component:syn-icon-button.md +3 -2
- package/data/layers/interface/component/component:syn-icon.json +2 -2
- package/data/layers/interface/component/component:syn-icon.md +2 -2
- package/data/layers/interface/component/component:syn-input.json +3 -2
- package/data/layers/interface/component/component:syn-input.md +3 -2
- package/data/layers/interface/component/component:syn-menu-item.json +3 -2
- package/data/layers/interface/component/component:syn-menu-item.md +3 -2
- package/data/layers/interface/component/component:syn-menu-label.json +3 -2
- package/data/layers/interface/component/component:syn-menu-label.md +3 -2
- package/data/layers/interface/component/component:syn-menu.json +3 -2
- package/data/layers/interface/component/component:syn-menu.md +3 -2
- package/data/layers/interface/component/component:syn-nav-item.json +3 -2
- package/data/layers/interface/component/component:syn-nav-item.md +3 -2
- package/data/layers/interface/component/component:syn-optgroup.json +3 -2
- package/data/layers/interface/component/component:syn-optgroup.md +3 -2
- package/data/layers/interface/component/component:syn-option.json +3 -2
- package/data/layers/interface/component/component:syn-option.md +3 -2
- package/data/layers/interface/component/component:syn-popup.json +1 -1
- package/data/layers/interface/component/component:syn-popup.md +1 -1
- package/data/layers/interface/component/component:syn-prio-nav.json +3 -2
- package/data/layers/interface/component/component:syn-prio-nav.md +3 -2
- package/data/layers/interface/component/component:syn-progress-bar.json +3 -2
- package/data/layers/interface/component/component:syn-progress-bar.md +3 -2
- package/data/layers/interface/component/component:syn-progress-ring.json +3 -2
- package/data/layers/interface/component/component:syn-progress-ring.md +3 -2
- package/data/layers/interface/component/component:syn-radio-button.json +1 -1
- package/data/layers/interface/component/component:syn-radio-button.md +1 -1
- package/data/layers/interface/component/component:syn-radio-group.json +2 -2
- package/data/layers/interface/component/component:syn-radio-group.md +2 -2
- package/data/layers/interface/component/component:syn-radio.json +3 -2
- package/data/layers/interface/component/component:syn-radio.md +3 -2
- package/data/layers/interface/component/component:syn-range-tick.json +3 -2
- package/data/layers/interface/component/component:syn-range-tick.md +3 -2
- package/data/layers/interface/component/component:syn-range.json +3 -2
- package/data/layers/interface/component/component:syn-range.md +3 -2
- package/data/layers/interface/component/component:syn-select.json +3 -2
- package/data/layers/interface/component/component:syn-select.md +3 -2
- package/data/layers/interface/component/component:syn-side-nav.json +3 -2
- package/data/layers/interface/component/component:syn-side-nav.md +3 -2
- package/data/layers/interface/component/component:syn-spinner.json +3 -2
- package/data/layers/interface/component/component:syn-spinner.md +3 -2
- package/data/layers/interface/component/component:syn-switch.json +3 -2
- package/data/layers/interface/component/component:syn-switch.md +3 -2
- package/data/layers/interface/component/component:syn-tab-group.json +3 -2
- package/data/layers/interface/component/component:syn-tab-group.md +3 -2
- package/data/layers/interface/component/component:syn-tab-panel.json +3 -2
- package/data/layers/interface/component/component:syn-tab-panel.md +3 -2
- package/data/layers/interface/component/component:syn-tab.json +3 -2
- package/data/layers/interface/component/component:syn-tab.md +3 -2
- package/data/layers/interface/component/component:syn-tag-group.json +2 -2
- package/data/layers/interface/component/component:syn-tag-group.md +2 -2
- package/data/layers/interface/component/component:syn-tag.json +3 -2
- package/data/layers/interface/component/component:syn-tag.md +3 -2
- package/data/layers/interface/component/component:syn-textarea.json +3 -2
- package/data/layers/interface/component/component:syn-textarea.md +3 -2
- package/data/layers/interface/component/component:syn-tooltip.json +3 -2
- package/data/layers/interface/component/component:syn-tooltip.md +3 -2
- package/data/layers/interface/component/component:syn-validate.json +3 -2
- package/data/layers/interface/component/component:syn-validate.md +3 -2
- package/data/layers/rules/component/component:syn-accordion.md +33 -0
- package/data/layers/rules/component/component:syn-alert.md +81 -0
- package/data/layers/rules/component/component:syn-badge.md +42 -0
- package/data/layers/rules/component/component:syn-breadcrumb-item.md +28 -0
- package/data/layers/rules/component/component:syn-breadcrumb.md +42 -0
- package/data/layers/rules/component/component:syn-button-group.md +55 -0
- package/data/layers/rules/component/component:syn-button.md +54 -0
- package/data/layers/rules/component/component:syn-card.md +37 -0
- package/data/layers/rules/component/component:syn-chart.md +39 -0
- package/data/layers/rules/component/component:syn-checkbox.md +34 -0
- package/data/layers/rules/component/component:syn-combobox.md +42 -0
- package/data/layers/rules/component/component:syn-details.md +37 -0
- package/data/layers/rules/component/component:syn-dialog.md +47 -0
- package/data/layers/rules/component/component:syn-divider.md +26 -0
- package/data/layers/rules/component/component:syn-drawer.md +45 -0
- package/data/layers/rules/component/component:syn-dropdown.md +36 -0
- package/data/layers/rules/component/component:syn-file.md +45 -0
- package/data/layers/rules/component/component:syn-header.md +48 -0
- package/data/layers/rules/component/component:syn-icon-button.md +41 -0
- package/data/layers/rules/component/component:syn-icon.md +42 -0
- package/data/layers/rules/component/component:syn-input.md +50 -0
- package/data/layers/rules/component/component:syn-menu-item.md +47 -0
- package/data/layers/rules/component/component:syn-menu-label.md +43 -0
- package/data/layers/rules/component/component:syn-menu.md +51 -0
- package/data/layers/rules/component/component:syn-nav-item.md +44 -0
- package/data/layers/rules/component/component:syn-optgroup.md +37 -0
- package/data/layers/rules/component/component:syn-option.md +34 -0
- package/data/layers/rules/component/component:syn-pagination.md +42 -0
- package/data/layers/rules/component/component:syn-popup.md +42 -0
- package/data/layers/rules/component/component:syn-prio-nav.md +47 -0
- package/data/layers/rules/component/component:syn-progress-bar.md +42 -0
- package/data/layers/rules/component/component:syn-progress-ring.md +42 -0
- package/data/layers/rules/component/component:syn-radio-button.md +49 -0
- package/data/layers/rules/component/component:syn-radio-group.md +43 -0
- package/data/layers/rules/component/component:syn-radio.md +46 -0
- package/data/layers/rules/component/component:syn-range-tick.md +48 -0
- package/data/layers/rules/component/component:syn-range.md +46 -0
- package/data/layers/rules/component/component:syn-select.md +42 -0
- package/data/layers/rules/component/component:syn-side-nav.md +47 -0
- package/data/layers/rules/component/component:syn-spinner.md +38 -0
- package/data/layers/rules/component/component:syn-switch.md +39 -0
- package/data/layers/rules/component/component:syn-tab-group.md +35 -0
- package/data/layers/rules/component/component:syn-tab-panel.md +44 -0
- package/data/layers/rules/component/component:syn-tab.md +44 -0
- package/data/layers/rules/component/component:syn-tag-group.md +46 -0
- package/data/layers/rules/component/component:syn-tag.md +40 -0
- package/data/layers/rules/component/component:syn-textarea.md +40 -0
- package/data/layers/rules/component/component:syn-tooltip.md +47 -0
- package/data/layers/rules/component/component:syn-validate.md +50 -0
- package/data/manifest.json +3 -3
- package/data/schemas/core-entity.schema.json +1 -0
- package/data/schemas/layer-ref.schema.json +1 -0
- package/dist/bin/install-skills.d.ts +2 -0
- package/dist/bin/install-skills.js +79 -0
- package/dist/intentPolicy/capabilities.d.ts +6 -0
- package/dist/intentPolicy/capabilities.js +22 -0
- package/dist/intentPolicy/categories.d.ts +6 -0
- package/dist/intentPolicy/categories.js +22 -0
- package/dist/intentPolicy/domains/action/capabilities.d.ts +2 -0
- package/dist/intentPolicy/domains/action/capabilities.js +26 -0
- package/dist/intentPolicy/domains/action/category.d.ts +2 -0
- package/dist/intentPolicy/domains/action/category.js +4 -0
- package/dist/intentPolicy/domains/action/index.d.ts +4 -0
- package/dist/intentPolicy/domains/action/index.js +4 -0
- package/dist/intentPolicy/domains/action/intents.d.ts +2 -0
- package/dist/intentPolicy/domains/action/intents.js +38 -0
- package/dist/intentPolicy/domains/action/patterns/grouped.d.ts +2 -0
- package/dist/intentPolicy/domains/action/patterns/grouped.js +9 -0
- package/dist/intentPolicy/domains/action/patterns/icon.d.ts +2 -0
- package/dist/intentPolicy/domains/action/patterns/icon.js +9 -0
- package/dist/intentPolicy/domains/action/patterns/index.d.ts +2 -0
- package/dist/intentPolicy/domains/action/patterns/index.js +14 -0
- package/dist/intentPolicy/domains/action/patterns/navigation.d.ts +2 -0
- package/dist/intentPolicy/domains/action/patterns/navigation.js +39 -0
- package/dist/intentPolicy/domains/action/patterns/primary.d.ts +2 -0
- package/dist/intentPolicy/domains/action/patterns/primary.js +39 -0
- package/dist/intentPolicy/domains/action/patterns/reset.d.ts +2 -0
- package/dist/intentPolicy/domains/action/patterns/reset.js +39 -0
- package/dist/intentPolicy/domains/action/patterns/submit.d.ts +2 -0
- package/dist/intentPolicy/domains/action/patterns/submit.js +58 -0
- package/dist/intentPolicy/domains/assistance/capabilities.d.ts +2 -0
- package/dist/intentPolicy/domains/assistance/capabilities.js +10 -0
- package/dist/intentPolicy/domains/assistance/category.d.ts +2 -0
- package/dist/intentPolicy/domains/assistance/category.js +4 -0
- package/dist/intentPolicy/domains/assistance/index.d.ts +4 -0
- package/dist/intentPolicy/domains/assistance/index.js +4 -0
- package/dist/intentPolicy/domains/assistance/intents.d.ts +2 -0
- package/dist/intentPolicy/domains/assistance/intents.js +14 -0
- package/dist/intentPolicy/domains/assistance/patterns.d.ts +2 -0
- package/dist/intentPolicy/domains/assistance/patterns.js +13 -0
- package/dist/intentPolicy/domains/disclosure/capabilities.d.ts +2 -0
- package/dist/intentPolicy/domains/disclosure/capabilities.js +14 -0
- package/dist/intentPolicy/domains/disclosure/category.d.ts +2 -0
- package/dist/intentPolicy/domains/disclosure/category.js +4 -0
- package/dist/intentPolicy/domains/disclosure/index.d.ts +4 -0
- package/dist/intentPolicy/domains/disclosure/index.js +4 -0
- package/dist/intentPolicy/domains/disclosure/intents.d.ts +2 -0
- package/dist/intentPolicy/domains/disclosure/intents.js +20 -0
- package/dist/intentPolicy/domains/disclosure/patterns.d.ts +2 -0
- package/dist/intentPolicy/domains/disclosure/patterns.js +23 -0
- package/dist/intentPolicy/domains/feedback/capabilities.d.ts +2 -0
- package/dist/intentPolicy/domains/feedback/capabilities.js +42 -0
- package/dist/intentPolicy/domains/feedback/category.d.ts +2 -0
- package/dist/intentPolicy/domains/feedback/category.js +4 -0
- package/dist/intentPolicy/domains/feedback/index.d.ts +4 -0
- package/dist/intentPolicy/domains/feedback/index.js +4 -0
- package/dist/intentPolicy/domains/feedback/intents.d.ts +2 -0
- package/dist/intentPolicy/domains/feedback/intents.js +32 -0
- package/dist/intentPolicy/domains/feedback/patterns.d.ts +2 -0
- package/dist/intentPolicy/domains/feedback/patterns.js +44 -0
- package/dist/intentPolicy/domains/input/capabilities.d.ts +2 -0
- package/dist/intentPolicy/domains/input/capabilities.js +38 -0
- package/dist/intentPolicy/domains/input/category.d.ts +2 -0
- package/dist/intentPolicy/domains/input/category.js +4 -0
- package/dist/intentPolicy/domains/input/index.d.ts +4 -0
- package/dist/intentPolicy/domains/input/index.js +4 -0
- package/dist/intentPolicy/domains/input/intents.d.ts +2 -0
- package/dist/intentPolicy/domains/input/intents.js +62 -0
- package/dist/intentPolicy/domains/input/patterns.d.ts +2 -0
- package/dist/intentPolicy/domains/input/patterns.js +99 -0
- package/dist/intentPolicy/domains/navigation/capabilities.d.ts +2 -0
- package/dist/intentPolicy/domains/navigation/capabilities.js +54 -0
- package/dist/intentPolicy/domains/navigation/category.d.ts +2 -0
- package/dist/intentPolicy/domains/navigation/category.js +4 -0
- package/dist/intentPolicy/domains/navigation/index.d.ts +4 -0
- package/dist/intentPolicy/domains/navigation/index.js +4 -0
- package/dist/intentPolicy/domains/navigation/intents.d.ts +2 -0
- package/dist/intentPolicy/domains/navigation/intents.js +44 -0
- package/dist/intentPolicy/domains/navigation/patterns.d.ts +2 -0
- package/dist/intentPolicy/domains/navigation/patterns.js +192 -0
- package/dist/intentPolicy/domains/status/capabilities.d.ts +2 -0
- package/dist/intentPolicy/domains/status/capabilities.js +14 -0
- package/dist/intentPolicy/domains/status/category.d.ts +2 -0
- package/dist/intentPolicy/domains/status/category.js +4 -0
- package/dist/intentPolicy/domains/status/index.d.ts +4 -0
- package/dist/intentPolicy/domains/status/index.js +4 -0
- package/dist/intentPolicy/domains/status/intents.d.ts +2 -0
- package/dist/intentPolicy/domains/status/intents.js +26 -0
- package/dist/intentPolicy/domains/status/patterns.d.ts +2 -0
- package/dist/intentPolicy/domains/status/patterns.js +32 -0
- package/dist/intentPolicy/domains/structure/capabilities.d.ts +2 -0
- package/dist/intentPolicy/domains/structure/capabilities.js +22 -0
- package/dist/intentPolicy/domains/structure/category.d.ts +2 -0
- package/dist/intentPolicy/domains/structure/category.js +4 -0
- package/dist/intentPolicy/domains/structure/index.d.ts +4 -0
- package/dist/intentPolicy/domains/structure/index.js +4 -0
- package/dist/intentPolicy/domains/structure/intents.d.ts +2 -0
- package/dist/intentPolicy/domains/structure/intents.js +32 -0
- package/dist/intentPolicy/domains/structure/patterns.d.ts +2 -0
- package/dist/intentPolicy/domains/structure/patterns.js +96 -0
- package/dist/intentPolicy/intents.d.ts +7 -0
- package/dist/intentPolicy/intents.js +23 -0
- package/dist/intentPolicy/intermediate-representation/types.d.ts +38 -0
- package/dist/intentPolicy/intermediate-representation/types.js +1 -0
- package/dist/intentPolicy/mappings/framework-targets.d.ts +5 -0
- package/dist/intentPolicy/mappings/framework-targets.js +21 -0
- package/dist/intentPolicy/patterns.d.ts +6 -0
- package/dist/intentPolicy/patterns.js +22 -0
- package/dist/intentPolicy/registry.d.ts +4 -0
- package/dist/intentPolicy/registry.js +4 -0
- package/dist/intentPolicy/renderers/index.d.ts +6 -0
- package/dist/intentPolicy/renderers/index.js +95 -0
- package/dist/intentPolicy/resolution.d.ts +41 -0
- package/dist/intentPolicy/resolution.js +226 -0
- package/dist/intentPolicy/services/render.d.ts +16 -0
- package/dist/intentPolicy/services/render.js +29 -0
- package/dist/intentPolicy/types.d.ts +486 -0
- package/dist/intentPolicy/types.js +17 -0
- package/dist/public/domains/components.d.ts +15 -1
- package/dist/public/domains/components.js +43 -0
- package/dist/public/domains/intent-policy.d.ts +255 -0
- package/dist/public/domains/intent-policy.js +965 -0
- package/dist/public/index.d.ts +72 -3
- package/dist/public/index.js +80 -1
- package/dist/public/skill-bundle.d.ts +17 -0
- package/dist/public/skill-bundle.js +259 -0
- package/dist/public/types.d.ts +12 -2
- package/package.json +10 -5
|
@@ -0,0 +1,965 @@
|
|
|
1
|
+
import { getIntentFromRegistry, getTargetCapabilityFromRegistry, listCapabilitiesForIntentFromRegistry, listIntentCategoriesFromRegistry, listIntentsFromRegistry, normalizeIntentId, normalizeTargetRef, resolveIntentFromRegistry, resolveUsagePatternFromRegistry, } from '../../intentPolicy/resolution.js';
|
|
2
|
+
import { renderIntentFromRegistry } from '../../intentPolicy/services/render.js';
|
|
3
|
+
import { createMetadataStore } from '../store.js';
|
|
4
|
+
const REQUESTED_LAYER = 'full';
|
|
5
|
+
const REQUESTED_VERBOSITY = 'readable';
|
|
6
|
+
const DEFAULT_GUIDE_PHASES = ['stable'];
|
|
7
|
+
const normalizeCategoryId = (value) => value.trim().toLowerCase();
|
|
8
|
+
const buildMeta = (builtAt, schemaVersion, total) => ({
|
|
9
|
+
builtAt,
|
|
10
|
+
requestedLayer: REQUESTED_LAYER,
|
|
11
|
+
requestedVerbosity: REQUESTED_VERBOSITY,
|
|
12
|
+
resolvedLayer: REQUESTED_LAYER,
|
|
13
|
+
schemaVersion,
|
|
14
|
+
total,
|
|
15
|
+
});
|
|
16
|
+
const resolveGuidePhases = (includePhases) => {
|
|
17
|
+
if (!includePhases || includePhases.length === 0) {
|
|
18
|
+
return DEFAULT_GUIDE_PHASES;
|
|
19
|
+
}
|
|
20
|
+
return includePhases;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* List all available intent categories.
|
|
24
|
+
*
|
|
25
|
+
* @experimental This API is still under active design.
|
|
26
|
+
*/
|
|
27
|
+
export const listIntentCategories = async (storeOptions = {}, options = {}) => {
|
|
28
|
+
const store = createMetadataStore(storeOptions);
|
|
29
|
+
const index = await store.getIndex();
|
|
30
|
+
const categories = listIntentCategoriesFromRegistry(options.includePhases);
|
|
31
|
+
return {
|
|
32
|
+
data: categories,
|
|
33
|
+
meta: buildMeta(index.builtAt, index.version, categories.length),
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Return one intent category by its ID.
|
|
38
|
+
*
|
|
39
|
+
* @experimental This API is still under active design.
|
|
40
|
+
*/
|
|
41
|
+
export const getIntentCategory = async (categoryId, options = {}, storeOptions = {}) => {
|
|
42
|
+
const store = createMetadataStore(storeOptions);
|
|
43
|
+
const index = await store.getIndex();
|
|
44
|
+
if (typeof categoryId !== 'string' || categoryId.trim().length === 0) {
|
|
45
|
+
return {
|
|
46
|
+
data: null,
|
|
47
|
+
errors: [{
|
|
48
|
+
code: 'INVALID_QUERY',
|
|
49
|
+
details: {
|
|
50
|
+
categoryId,
|
|
51
|
+
},
|
|
52
|
+
message: 'Category ID must be a non-empty string.',
|
|
53
|
+
}],
|
|
54
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const categories = listIntentCategoriesFromRegistry(options.includePhases);
|
|
58
|
+
const normalizedCategoryId = normalizeCategoryId(categoryId);
|
|
59
|
+
const category = categories.find((entry) => normalizeCategoryId(entry.id) === normalizedCategoryId);
|
|
60
|
+
if (!category) {
|
|
61
|
+
return {
|
|
62
|
+
data: null,
|
|
63
|
+
errors: [{
|
|
64
|
+
code: 'NOT_FOUND',
|
|
65
|
+
details: {
|
|
66
|
+
categoryId: normalizedCategoryId,
|
|
67
|
+
},
|
|
68
|
+
message: `Intent category "${categoryId}" is not registered.`,
|
|
69
|
+
}],
|
|
70
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
data: category,
|
|
75
|
+
meta: buildMeta(index.builtAt, index.version, 1),
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* List intents, optionally filtered by category.
|
|
80
|
+
*
|
|
81
|
+
* @experimental This API is still under active design.
|
|
82
|
+
*/
|
|
83
|
+
export const listIntents = async (options = {}, storeOptions = {}) => {
|
|
84
|
+
const store = createMetadataStore(storeOptions);
|
|
85
|
+
const index = await store.getIndex();
|
|
86
|
+
const intents = listIntentsFromRegistry(options.category, options.includePhases);
|
|
87
|
+
return {
|
|
88
|
+
data: intents,
|
|
89
|
+
meta: buildMeta(index.builtAt, index.version, intents.length),
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* List all capabilities (targets) that support a given intent.
|
|
94
|
+
*
|
|
95
|
+
* @experimental This API is still under active design.
|
|
96
|
+
*/
|
|
97
|
+
export const listIntentCapabilities = async (intentId, options = {}, storeOptions = {}) => {
|
|
98
|
+
const store = createMetadataStore(storeOptions);
|
|
99
|
+
const index = await store.getIndex();
|
|
100
|
+
if (typeof intentId !== 'string' || intentId.trim().length === 0) {
|
|
101
|
+
return {
|
|
102
|
+
data: [],
|
|
103
|
+
errors: [{
|
|
104
|
+
code: 'INVALID_QUERY',
|
|
105
|
+
details: { intentId },
|
|
106
|
+
message: 'Intent ID must be a non-empty string.',
|
|
107
|
+
}],
|
|
108
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const capabilities = listCapabilitiesForIntentFromRegistry(intentId, options.includePhases);
|
|
112
|
+
return {
|
|
113
|
+
data: capabilities,
|
|
114
|
+
meta: buildMeta(index.builtAt, index.version, capabilities.length),
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Return capability categories for one target.
|
|
119
|
+
*
|
|
120
|
+
* @experimental This API is still under active design.
|
|
121
|
+
*/
|
|
122
|
+
export const getTargetCapabilities = async (target, storeOptions = {}) => {
|
|
123
|
+
const store = createMetadataStore(storeOptions);
|
|
124
|
+
const index = await store.getIndex();
|
|
125
|
+
if (!target || typeof target !== 'object' || !target.kind) {
|
|
126
|
+
return {
|
|
127
|
+
data: null,
|
|
128
|
+
errors: [{
|
|
129
|
+
code: 'INVALID_QUERY',
|
|
130
|
+
details: {
|
|
131
|
+
target,
|
|
132
|
+
},
|
|
133
|
+
message: 'Target must be a valid target reference with a kind.',
|
|
134
|
+
}],
|
|
135
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
const normalizedTarget = normalizeTargetRef(target);
|
|
139
|
+
const capability = getTargetCapabilityFromRegistry(normalizedTarget);
|
|
140
|
+
if (!capability) {
|
|
141
|
+
return {
|
|
142
|
+
data: null,
|
|
143
|
+
errors: [{
|
|
144
|
+
code: 'NOT_FOUND',
|
|
145
|
+
details: {
|
|
146
|
+
target: normalizedTarget,
|
|
147
|
+
},
|
|
148
|
+
message: 'No intent capabilities are registered for the requested target.',
|
|
149
|
+
}],
|
|
150
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
data: capability,
|
|
155
|
+
meta: buildMeta(index.builtAt, index.version, 1),
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Resolve one target + intent pair to a usage pattern/preset.
|
|
160
|
+
*
|
|
161
|
+
* @experimental This API is still under active design.
|
|
162
|
+
*/
|
|
163
|
+
export const resolveIntent = async (query, storeOptions = {}) => {
|
|
164
|
+
const store = createMetadataStore(storeOptions);
|
|
165
|
+
const index = await store.getIndex();
|
|
166
|
+
const hasValidIntent = typeof query.intent === 'string' && query.intent.trim().length > 0;
|
|
167
|
+
const hasValidTarget = !!query.target && typeof query.target === 'object' && typeof query.target.kind === 'string';
|
|
168
|
+
if (!hasValidIntent || !hasValidTarget) {
|
|
169
|
+
return {
|
|
170
|
+
data: null,
|
|
171
|
+
errors: [{
|
|
172
|
+
code: 'INVALID_QUERY',
|
|
173
|
+
details: query,
|
|
174
|
+
message: 'Both "intent" and "target" must be valid values.',
|
|
175
|
+
}],
|
|
176
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
const intent = getIntentFromRegistry(query.intent, query.includePhases);
|
|
180
|
+
if (!intent) {
|
|
181
|
+
return {
|
|
182
|
+
data: null,
|
|
183
|
+
errors: [{
|
|
184
|
+
code: 'NOT_FOUND',
|
|
185
|
+
details: {
|
|
186
|
+
intent: normalizeIntentId(query.intent),
|
|
187
|
+
},
|
|
188
|
+
message: `Intent "${query.intent}" is not registered.`,
|
|
189
|
+
}],
|
|
190
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
const normalizedTarget = normalizeTargetRef(query.target);
|
|
194
|
+
const capability = getTargetCapabilityFromRegistry(normalizedTarget, query.includePhases);
|
|
195
|
+
if (!capability) {
|
|
196
|
+
return {
|
|
197
|
+
data: null,
|
|
198
|
+
errors: [{
|
|
199
|
+
code: 'NOT_FOUND',
|
|
200
|
+
details: {
|
|
201
|
+
target: normalizedTarget,
|
|
202
|
+
},
|
|
203
|
+
message: 'No intent capabilities are registered for the requested target.',
|
|
204
|
+
}],
|
|
205
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
const canResolve = capability.categories
|
|
209
|
+
.map((category) => category.toLowerCase())
|
|
210
|
+
.includes(intent.category.toLowerCase());
|
|
211
|
+
if (!canResolve) {
|
|
212
|
+
return {
|
|
213
|
+
data: null,
|
|
214
|
+
errors: [{
|
|
215
|
+
code: 'INVALID_QUERY',
|
|
216
|
+
details: {
|
|
217
|
+
capabilityCategories: capability.categories,
|
|
218
|
+
intent: intent.id,
|
|
219
|
+
intentCategory: intent.category,
|
|
220
|
+
target: normalizedTarget,
|
|
221
|
+
},
|
|
222
|
+
message: `Intent "${query.intent}" is not compatible with the requested target.`,
|
|
223
|
+
}],
|
|
224
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
const resolution = resolveIntentFromRegistry(normalizedTarget, query.intent, query.includePhases);
|
|
228
|
+
if (!resolution) {
|
|
229
|
+
return {
|
|
230
|
+
data: null,
|
|
231
|
+
errors: [{
|
|
232
|
+
code: 'NOT_FOUND',
|
|
233
|
+
details: {
|
|
234
|
+
intent: normalizeIntentId(query.intent),
|
|
235
|
+
target: normalizedTarget,
|
|
236
|
+
},
|
|
237
|
+
message: 'No usage pattern is registered for the requested target and intent.',
|
|
238
|
+
}],
|
|
239
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
return {
|
|
243
|
+
data: resolution,
|
|
244
|
+
meta: buildMeta(index.builtAt, index.version, 1),
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Render one target + intent pair to framework-specific component markup.
|
|
249
|
+
*
|
|
250
|
+
* @experimental This API is still under active design.
|
|
251
|
+
*/
|
|
252
|
+
export const renderIntent = async (query, storeOptions = {}) => {
|
|
253
|
+
const store = createMetadataStore(storeOptions);
|
|
254
|
+
const index = await store.getIndex();
|
|
255
|
+
const hasValidIntent = typeof query.intent === 'string' && query.intent.trim().length > 0;
|
|
256
|
+
const hasValidTarget = !query.target || (typeof query.target === 'object' && typeof query.target.kind === 'string');
|
|
257
|
+
const hasValidFramework = typeof query.framework === 'string' && query.framework.trim().length > 0;
|
|
258
|
+
if (!hasValidIntent || !hasValidTarget || !hasValidFramework) {
|
|
259
|
+
return {
|
|
260
|
+
data: null,
|
|
261
|
+
errors: [{
|
|
262
|
+
code: 'INVALID_QUERY',
|
|
263
|
+
details: query,
|
|
264
|
+
message: '"intent" and "framework" must be valid values. "target" is optional but must be valid when provided.',
|
|
265
|
+
}],
|
|
266
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
const rendered = renderIntentFromRegistry({
|
|
270
|
+
content: query.content,
|
|
271
|
+
framework: query.framework,
|
|
272
|
+
includePhases: query.includePhases,
|
|
273
|
+
intent: query.intent,
|
|
274
|
+
target: query.target,
|
|
275
|
+
});
|
|
276
|
+
if (!rendered) {
|
|
277
|
+
return {
|
|
278
|
+
data: null,
|
|
279
|
+
errors: [{
|
|
280
|
+
code: 'NOT_FOUND',
|
|
281
|
+
details: {
|
|
282
|
+
framework: query.framework,
|
|
283
|
+
intent: normalizeIntentId(query.intent),
|
|
284
|
+
target: query.target ? normalizeTargetRef(query.target) : undefined,
|
|
285
|
+
},
|
|
286
|
+
message: 'No renderable usage pattern is registered for the requested intent and target context.',
|
|
287
|
+
}],
|
|
288
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
return {
|
|
292
|
+
data: rendered,
|
|
293
|
+
meta: buildMeta(index.builtAt, index.version, 1),
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
const toComponentTarget = (component) => ({
|
|
297
|
+
id: `component:${component}`,
|
|
298
|
+
kind: 'component',
|
|
299
|
+
name: component,
|
|
300
|
+
});
|
|
301
|
+
const normalizeComponentEntityId = (component) => {
|
|
302
|
+
const normalized = component.trim().toLowerCase();
|
|
303
|
+
if (normalized.startsWith('component:')) {
|
|
304
|
+
return normalized;
|
|
305
|
+
}
|
|
306
|
+
if (normalized.startsWith('syn-')) {
|
|
307
|
+
return `component:${normalized}`;
|
|
308
|
+
}
|
|
309
|
+
return `component:syn-${normalized}`;
|
|
310
|
+
};
|
|
311
|
+
const parsePropertyDefaultValue = (rawValue) => {
|
|
312
|
+
if (typeof rawValue !== 'string') {
|
|
313
|
+
return undefined;
|
|
314
|
+
}
|
|
315
|
+
const trimmed = rawValue.trim();
|
|
316
|
+
if (trimmed.length === 0) {
|
|
317
|
+
return undefined;
|
|
318
|
+
}
|
|
319
|
+
const isQuoted = (trimmed.startsWith('\'') && trimmed.endsWith('\''))
|
|
320
|
+
|| (trimmed.startsWith('"') && trimmed.endsWith('"'));
|
|
321
|
+
const normalized = isQuoted ? trimmed.slice(1, -1) : trimmed;
|
|
322
|
+
// Empty string defaults should not be treated as authored values for validation.
|
|
323
|
+
if (normalized.length === 0) {
|
|
324
|
+
return undefined;
|
|
325
|
+
}
|
|
326
|
+
if (normalized === 'true') {
|
|
327
|
+
return true;
|
|
328
|
+
}
|
|
329
|
+
if (normalized === 'false') {
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
if (normalized === 'null') {
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
if (/^-?\d+(\.\d+)?$/.test(normalized)) {
|
|
336
|
+
return Number(normalized);
|
|
337
|
+
}
|
|
338
|
+
return normalized;
|
|
339
|
+
};
|
|
340
|
+
const getPropertyDefaultsFromInterfaceSnapshot = (snapshot) => {
|
|
341
|
+
const properties = Array.isArray(snapshot.properties) ? snapshot.properties : [];
|
|
342
|
+
const defaults = {};
|
|
343
|
+
for (const property of properties) {
|
|
344
|
+
if (typeof property.name !== 'string') {
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
const defaultValue = parsePropertyDefaultValue(property.default);
|
|
348
|
+
if (defaultValue === undefined) {
|
|
349
|
+
continue;
|
|
350
|
+
}
|
|
351
|
+
defaults[property.name] = defaultValue;
|
|
352
|
+
}
|
|
353
|
+
return defaults;
|
|
354
|
+
};
|
|
355
|
+
const createComponentPropertyDefaultsResolver = (store) => {
|
|
356
|
+
const cache = new Map();
|
|
357
|
+
return async (component) => {
|
|
358
|
+
const cacheKey = component.trim().toLowerCase();
|
|
359
|
+
if (!cacheKey || cacheKey === 'text' || !cacheKey.includes('-')) {
|
|
360
|
+
return {};
|
|
361
|
+
}
|
|
362
|
+
const cached = cache.get(cacheKey);
|
|
363
|
+
if (cached) {
|
|
364
|
+
return cached;
|
|
365
|
+
}
|
|
366
|
+
const loadDefaultsPromise = (async () => {
|
|
367
|
+
const entity = await store.getEntity(normalizeComponentEntityId(cacheKey));
|
|
368
|
+
const interfaceRef = entity?.layers?.interface?.find((ref) => ref.path.endsWith('.json'));
|
|
369
|
+
if (!interfaceRef) {
|
|
370
|
+
return {};
|
|
371
|
+
}
|
|
372
|
+
const rawSnapshot = await store.readLayerFile(interfaceRef);
|
|
373
|
+
const interfaceSnapshot = JSON.parse(rawSnapshot);
|
|
374
|
+
return getPropertyDefaultsFromInterfaceSnapshot(interfaceSnapshot);
|
|
375
|
+
})();
|
|
376
|
+
cache.set(cacheKey, loadDefaultsPromise);
|
|
377
|
+
return loadDefaultsPromise;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
const getTargetIdentity = (target) => target.id
|
|
381
|
+
?? target.name
|
|
382
|
+
?? target.selector
|
|
383
|
+
?? `${target.kind}:unknown`;
|
|
384
|
+
const evaluateNodePropRules = (rules, props, nodePath, issues, strictRequiredEquals) => {
|
|
385
|
+
for (const rule of rules) {
|
|
386
|
+
if (rule.kind === 'forbidden') {
|
|
387
|
+
if (props && Object.prototype.hasOwnProperty.call(props, rule.prop)) {
|
|
388
|
+
issues.push({
|
|
389
|
+
code: rule.code,
|
|
390
|
+
message: rule.message,
|
|
391
|
+
path: `${nodePath}.props.${rule.prop}`,
|
|
392
|
+
rationale: rule.rationale,
|
|
393
|
+
severity: 'error',
|
|
394
|
+
suggestedFix: rule.suggestedFix,
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
if (rule.kind === 'requiredEquals') {
|
|
400
|
+
const hasProp = !!props && Object.prototype.hasOwnProperty.call(props, rule.prop);
|
|
401
|
+
const propValue = props?.[rule.prop];
|
|
402
|
+
const shouldReport = strictRequiredEquals ? (!hasProp || propValue !== rule.value) : (hasProp && propValue !== rule.value);
|
|
403
|
+
if (shouldReport) {
|
|
404
|
+
issues.push({
|
|
405
|
+
code: rule.code,
|
|
406
|
+
message: rule.message,
|
|
407
|
+
path: `${nodePath}.props.${rule.prop}`,
|
|
408
|
+
rationale: rule.rationale,
|
|
409
|
+
severity: 'error',
|
|
410
|
+
suggestedFix: rule.suggestedFix,
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
continue;
|
|
414
|
+
}
|
|
415
|
+
if (rule.kind === 'recommendedEquals') {
|
|
416
|
+
const propValue = props?.[rule.prop];
|
|
417
|
+
if (propValue !== rule.value) {
|
|
418
|
+
issues.push({
|
|
419
|
+
code: rule.code,
|
|
420
|
+
message: rule.message,
|
|
421
|
+
path: `${nodePath}.props.${rule.prop}`,
|
|
422
|
+
rationale: rule.rationale,
|
|
423
|
+
severity: rule.severity ?? 'info',
|
|
424
|
+
suggestedFix: rule.suggestedFix,
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
continue;
|
|
428
|
+
}
|
|
429
|
+
const propValue = props?.[rule.prop];
|
|
430
|
+
if (propValue !== rule.value) {
|
|
431
|
+
continue;
|
|
432
|
+
}
|
|
433
|
+
issues.push({
|
|
434
|
+
code: rule.code,
|
|
435
|
+
message: rule.message,
|
|
436
|
+
path: `${nodePath}.props.${rule.prop}`,
|
|
437
|
+
rationale: rule.rationale,
|
|
438
|
+
severity: rule.severity ?? 'warning',
|
|
439
|
+
suggestedFix: rule.suggestedFix,
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
const validateStructureNode = async (resolveComponentPropertyDefaults, expected, actual, nodePath, issues, strictRequiredEquals) => {
|
|
444
|
+
if (!actual) {
|
|
445
|
+
issues.push({
|
|
446
|
+
code: 'STRUCTURE_NODE_MISSING',
|
|
447
|
+
message: `Missing required node "${expected.component}".`,
|
|
448
|
+
path: nodePath,
|
|
449
|
+
severity: 'error',
|
|
450
|
+
});
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
const componentDefaults = strictRequiredEquals
|
|
454
|
+
? await resolveComponentPropertyDefaults(actual.component)
|
|
455
|
+
: {};
|
|
456
|
+
const actualWithDefaults = {
|
|
457
|
+
...actual,
|
|
458
|
+
props: {
|
|
459
|
+
...componentDefaults,
|
|
460
|
+
...(actual.props ?? {}),
|
|
461
|
+
},
|
|
462
|
+
};
|
|
463
|
+
if (actualWithDefaults.component !== expected.component) {
|
|
464
|
+
issues.push({
|
|
465
|
+
code: 'STRUCTURE_COMPONENT_MISMATCH',
|
|
466
|
+
message: `Expected component "${expected.component}" but found "${actualWithDefaults.component}".`,
|
|
467
|
+
path: `${nodePath}.component`,
|
|
468
|
+
severity: 'error',
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
if (expected.role && actualWithDefaults.role !== expected.role) {
|
|
472
|
+
issues.push({
|
|
473
|
+
code: 'STRUCTURE_ROLE_MISMATCH',
|
|
474
|
+
message: `Expected role "${expected.role}" but found "${actualWithDefaults.role ?? 'undefined'}".`,
|
|
475
|
+
path: `${nodePath}.role`,
|
|
476
|
+
severity: 'warning',
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
if (expected.slot && actualWithDefaults.slot !== expected.slot) {
|
|
480
|
+
issues.push({
|
|
481
|
+
code: 'STRUCTURE_SLOT_MISMATCH',
|
|
482
|
+
message: `Expected slot "${expected.slot}" but found "${actualWithDefaults.slot ?? 'undefined'}".`,
|
|
483
|
+
path: `${nodePath}.slot`,
|
|
484
|
+
severity: 'error',
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
const actualClasses = new Set(actualWithDefaults.classes ?? []);
|
|
488
|
+
for (const requiredClass of expected.requiredClasses ?? []) {
|
|
489
|
+
if (!actualClasses.has(requiredClass)) {
|
|
490
|
+
issues.push({
|
|
491
|
+
code: 'STRUCTURE_REQUIRED_CLASS_MISSING',
|
|
492
|
+
message: `Required class "${requiredClass}" is missing on node "${expected.component}".`,
|
|
493
|
+
path: `${nodePath}.classes`,
|
|
494
|
+
severity: 'error',
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
for (const forbiddenClass of expected.forbiddenClasses ?? []) {
|
|
499
|
+
if (actualClasses.has(forbiddenClass)) {
|
|
500
|
+
issues.push({
|
|
501
|
+
code: 'STRUCTURE_FORBIDDEN_CLASS_PRESENT',
|
|
502
|
+
message: `Forbidden class "${forbiddenClass}" is present on node "${expected.component}".`,
|
|
503
|
+
path: `${nodePath}.classes`,
|
|
504
|
+
severity: 'error',
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
evaluateNodePropRules(expected.config?.propRules ?? [], actualWithDefaults.props, nodePath, issues, strictRequiredEquals);
|
|
509
|
+
if (strictRequiredEquals) {
|
|
510
|
+
for (const rule of expected.config?.contentRules ?? []) {
|
|
511
|
+
const hasTextContent = typeof actualWithDefaults.text === 'string' && actualWithDefaults.text.trim().length > 0;
|
|
512
|
+
const hasChildren = (actualWithDefaults.children?.length ?? 0) > 0;
|
|
513
|
+
if (!hasTextContent && !hasChildren) {
|
|
514
|
+
issues.push({
|
|
515
|
+
code: rule.code,
|
|
516
|
+
message: rule.message,
|
|
517
|
+
path: `${nodePath}.children`,
|
|
518
|
+
rationale: rule.rationale,
|
|
519
|
+
severity: 'error',
|
|
520
|
+
suggestedFix: rule.suggestedFix,
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
if (expected.component === 'text' && expected.text && actualWithDefaults.text !== expected.text) {
|
|
526
|
+
issues.push({
|
|
527
|
+
code: 'STRUCTURE_TEXT_MISMATCH',
|
|
528
|
+
message: `Expected text "${expected.text}" but found "${actualWithDefaults.text ?? ''}".`,
|
|
529
|
+
path: `${nodePath}.text`,
|
|
530
|
+
severity: 'warning',
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
const expectedChildren = expected.children ?? [];
|
|
534
|
+
const actualChildren = actualWithDefaults.children ?? [];
|
|
535
|
+
// Filter actual children by slot if expected children are slot-specific
|
|
536
|
+
// This allows flexible default-slot content while still validating specific slots
|
|
537
|
+
const expectedHasSlots = expectedChildren.some((child) => child.slot);
|
|
538
|
+
const actualChildrenBySlot = new Map();
|
|
539
|
+
if (expectedHasSlots) {
|
|
540
|
+
// Group actual children by slot attribute
|
|
541
|
+
for (const child of actualChildren) {
|
|
542
|
+
const { slot } = child;
|
|
543
|
+
if (!actualChildrenBySlot.has(slot)) {
|
|
544
|
+
actualChildrenBySlot.set(slot, []);
|
|
545
|
+
}
|
|
546
|
+
actualChildrenBySlot.get(slot).push(child);
|
|
547
|
+
}
|
|
548
|
+
// Validate each expected child against children in its slot
|
|
549
|
+
for (let index = 0; index < expectedChildren.length; index += 1) {
|
|
550
|
+
const expectedChild = expectedChildren[index];
|
|
551
|
+
const expectedSlot = expectedChild.slot;
|
|
552
|
+
const slottedChildren = actualChildrenBySlot.get(expectedSlot) ?? [];
|
|
553
|
+
if (slottedChildren.length === 0) {
|
|
554
|
+
issues.push({
|
|
555
|
+
code: 'STRUCTURE_NODE_MISSING',
|
|
556
|
+
message: `Missing required node "${expectedChild.component}" in slot "${expectedSlot ?? 'default'}".`,
|
|
557
|
+
path: `${nodePath}.children.${index}`,
|
|
558
|
+
severity: 'error',
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
else {
|
|
562
|
+
// Compare expected child with the first actual child in that slot
|
|
563
|
+
await validateStructureNode(resolveComponentPropertyDefaults, expectedChild, slottedChildren[0], `${nodePath}.children.${index}`, issues, strictRequiredEquals);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
else {
|
|
568
|
+
// Original positional matching for non-slot patterns
|
|
569
|
+
if (actualChildren.length < expectedChildren.length) {
|
|
570
|
+
issues.push({
|
|
571
|
+
code: 'STRUCTURE_CHILD_MISSING',
|
|
572
|
+
message: `Expected ${expectedChildren.length} child nodes but found ${actualChildren.length}.`,
|
|
573
|
+
path: `${nodePath}.children`,
|
|
574
|
+
severity: 'error',
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
if (expectedChildren.length > 0 && actualChildren.length > expectedChildren.length) {
|
|
578
|
+
issues.push({
|
|
579
|
+
code: 'STRUCTURE_UNEXPECTED_CHILD',
|
|
580
|
+
message: `Found ${actualChildren.length - expectedChildren.length} unexpected child nodes.`,
|
|
581
|
+
path: `${nodePath}.children`,
|
|
582
|
+
severity: 'warning',
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
for (let index = 0; index < expectedChildren.length; index += 1) {
|
|
586
|
+
const expectedChild = expectedChildren[index];
|
|
587
|
+
const actualChild = actualChildren[index];
|
|
588
|
+
await validateStructureNode(resolveComponentPropertyDefaults, expectedChild, actualChild, `${nodePath}.children.${index}`, issues, strictRequiredEquals);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
/**
|
|
593
|
+
* Validate whether a component usage aligns with intent-policy guidance.
|
|
594
|
+
*
|
|
595
|
+
* @experimental This API is still under active design.
|
|
596
|
+
*/
|
|
597
|
+
export const validateComponent = async (query, storeOptions = {}) => {
|
|
598
|
+
const store = createMetadataStore(storeOptions);
|
|
599
|
+
const index = await store.getIndex();
|
|
600
|
+
const hasComponent = typeof query.component === 'string' && query.component.trim().length > 0;
|
|
601
|
+
const hasFramework = typeof query.framework === 'string' && query.framework.trim().length > 0;
|
|
602
|
+
if (!hasComponent || !hasFramework) {
|
|
603
|
+
return {
|
|
604
|
+
data: null,
|
|
605
|
+
errors: [{
|
|
606
|
+
code: 'INVALID_QUERY',
|
|
607
|
+
details: query,
|
|
608
|
+
message: '"component" and "framework" must be valid values.',
|
|
609
|
+
}],
|
|
610
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
const phases = resolveGuidePhases(query.includePhases);
|
|
614
|
+
const resolveComponentPropertyDefaults = createComponentPropertyDefaultsResolver(store);
|
|
615
|
+
const target = normalizeTargetRef(toComponentTarget(query.component));
|
|
616
|
+
const issues = [];
|
|
617
|
+
const capability = getTargetCapabilityFromRegistry(target, phases);
|
|
618
|
+
if (!capability) {
|
|
619
|
+
issues.push({
|
|
620
|
+
code: 'COMPONENT_NOT_REGISTERED',
|
|
621
|
+
message: `No intent capability is registered for "${query.component}" in the selected phases.`,
|
|
622
|
+
severity: 'error',
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
if (query.intent) {
|
|
626
|
+
const intent = getIntentFromRegistry(query.intent, phases);
|
|
627
|
+
if (!intent) {
|
|
628
|
+
issues.push({
|
|
629
|
+
code: 'INTENT_NOT_REGISTERED',
|
|
630
|
+
message: `Intent "${query.intent}" is not registered in the selected phases.`,
|
|
631
|
+
severity: 'error',
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
else if (capability && !capability.categories.map((category) => category.toLowerCase()).includes(intent.category.toLowerCase())) {
|
|
635
|
+
issues.push({
|
|
636
|
+
code: 'INTENT_CATEGORY_MISMATCH',
|
|
637
|
+
message: `Component "${query.component}" does not support the "${intent.category}" category required by intent "${query.intent}".`,
|
|
638
|
+
severity: 'error',
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
const pattern = resolveUsagePatternFromRegistry(target, query.intent, phases);
|
|
642
|
+
if (!pattern) {
|
|
643
|
+
issues.push({
|
|
644
|
+
code: 'PATTERN_NOT_FOUND',
|
|
645
|
+
message: `No usage pattern is registered for "${query.component}" with intent "${query.intent}".`,
|
|
646
|
+
severity: 'error',
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
else {
|
|
650
|
+
const expectedStructure = pattern.structure ?? {
|
|
651
|
+
component: query.component,
|
|
652
|
+
};
|
|
653
|
+
const actualStructure = query.structure
|
|
654
|
+
? {
|
|
655
|
+
...query.structure,
|
|
656
|
+
props: query.structure.props ?? query.props,
|
|
657
|
+
}
|
|
658
|
+
: {
|
|
659
|
+
component: query.component,
|
|
660
|
+
props: query.props,
|
|
661
|
+
};
|
|
662
|
+
await validateStructureNode(resolveComponentPropertyDefaults, expectedStructure, actualStructure, 'structure', issues, !!query.structure);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
const errorCount = issues.filter((issue) => issue.severity === 'error').length;
|
|
666
|
+
const warningCount = issues.filter((issue) => issue.severity === 'warning').length;
|
|
667
|
+
return {
|
|
668
|
+
data: {
|
|
669
|
+
component: query.component,
|
|
670
|
+
framework: query.framework,
|
|
671
|
+
issues,
|
|
672
|
+
score: Math.max(0, 100 - (errorCount * 40) - (warningCount * 10)),
|
|
673
|
+
valid: errorCount === 0,
|
|
674
|
+
},
|
|
675
|
+
meta: buildMeta(index.builtAt, index.version, 1),
|
|
676
|
+
};
|
|
677
|
+
};
|
|
678
|
+
/**
|
|
679
|
+
* Return developer-focused usage guidance for one component.
|
|
680
|
+
*
|
|
681
|
+
* @experimental This API is still under active design.
|
|
682
|
+
*/
|
|
683
|
+
export const getComponentGuide = async (query, storeOptions = {}) => {
|
|
684
|
+
const store = createMetadataStore(storeOptions);
|
|
685
|
+
const index = await store.getIndex();
|
|
686
|
+
const hasComponent = typeof query.component === 'string' && query.component.trim().length > 0;
|
|
687
|
+
const hasFramework = typeof query.framework === 'string' && query.framework.trim().length > 0;
|
|
688
|
+
if (!hasComponent || !hasFramework) {
|
|
689
|
+
return {
|
|
690
|
+
data: null,
|
|
691
|
+
errors: [{
|
|
692
|
+
code: 'INVALID_QUERY',
|
|
693
|
+
details: query,
|
|
694
|
+
message: '"component" and "framework" must be valid values.',
|
|
695
|
+
}],
|
|
696
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
const phases = resolveGuidePhases(query.includePhases);
|
|
700
|
+
const target = normalizeTargetRef(toComponentTarget(query.component));
|
|
701
|
+
const capability = getTargetCapabilityFromRegistry(target, phases);
|
|
702
|
+
if (!capability) {
|
|
703
|
+
return {
|
|
704
|
+
data: null,
|
|
705
|
+
errors: [{
|
|
706
|
+
code: 'NOT_FOUND',
|
|
707
|
+
details: {
|
|
708
|
+
component: query.component,
|
|
709
|
+
phases,
|
|
710
|
+
},
|
|
711
|
+
message: `No intent capability is registered for component "${query.component}" in the selected phases.`,
|
|
712
|
+
}],
|
|
713
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
const supportedIntents = listIntentsFromRegistry(undefined, phases)
|
|
717
|
+
.filter((intent) => capability.categories.map((category) => category.toLowerCase()).includes(intent.category.toLowerCase()))
|
|
718
|
+
.map((intent) => ({
|
|
719
|
+
category: intent.category,
|
|
720
|
+
description: intent.description,
|
|
721
|
+
id: intent.id,
|
|
722
|
+
phase: intent.phase,
|
|
723
|
+
}));
|
|
724
|
+
const recommendedUsages = supportedIntents
|
|
725
|
+
.map((intent) => {
|
|
726
|
+
const pattern = resolveUsagePatternFromRegistry(target, intent.id, phases);
|
|
727
|
+
if (!pattern) {
|
|
728
|
+
return null;
|
|
729
|
+
}
|
|
730
|
+
const snippet = renderIntentFromRegistry({
|
|
731
|
+
framework: query.framework,
|
|
732
|
+
includePhases: phases,
|
|
733
|
+
intent: intent.id,
|
|
734
|
+
target,
|
|
735
|
+
});
|
|
736
|
+
if (!snippet) {
|
|
737
|
+
return null;
|
|
738
|
+
}
|
|
739
|
+
return {
|
|
740
|
+
description: pattern.description,
|
|
741
|
+
intentId: intent.id,
|
|
742
|
+
propRules: pattern.structure?.config?.propRules ?? [],
|
|
743
|
+
snippet,
|
|
744
|
+
};
|
|
745
|
+
})
|
|
746
|
+
.filter((entry) => entry !== null);
|
|
747
|
+
const commonMisuses = [];
|
|
748
|
+
for (const intent of supportedIntents) {
|
|
749
|
+
const pattern = resolveUsagePatternFromRegistry(target, intent.id, phases);
|
|
750
|
+
if (!pattern) {
|
|
751
|
+
continue;
|
|
752
|
+
}
|
|
753
|
+
const forbiddenRules = pattern.structure?.config?.propRules?.filter((r) => r.kind === 'forbidden')
|
|
754
|
+
?? pattern.preset?.forbiddenProps?.map((prop) => ({
|
|
755
|
+
code: 'FORBIDDEN_PROP',
|
|
756
|
+
kind: 'forbidden',
|
|
757
|
+
message: `Avoid using "${prop}" with intent "${intent.id}".`,
|
|
758
|
+
prop,
|
|
759
|
+
rationale: undefined,
|
|
760
|
+
suggestedFix: undefined,
|
|
761
|
+
}))
|
|
762
|
+
?? [];
|
|
763
|
+
for (const rule of forbiddenRules) {
|
|
764
|
+
commonMisuses.push({
|
|
765
|
+
code: rule.code,
|
|
766
|
+
message: rule.message,
|
|
767
|
+
path: `props.${rule.prop}`,
|
|
768
|
+
rationale: rule.rationale,
|
|
769
|
+
severity: 'warning',
|
|
770
|
+
suggestedFix: rule.suggestedFix,
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
return {
|
|
775
|
+
data: {
|
|
776
|
+
commonMisuses,
|
|
777
|
+
component: query.component,
|
|
778
|
+
framework: query.framework,
|
|
779
|
+
quickChecks: [
|
|
780
|
+
{
|
|
781
|
+
detail: `Component has ${supportedIntents.length} supported intents in selected phases.`,
|
|
782
|
+
pass: supportedIntents.length > 0,
|
|
783
|
+
title: 'Intent coverage',
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
detail: `Component has ${recommendedUsages.length} renderable usage patterns for ${query.framework}.`,
|
|
787
|
+
pass: recommendedUsages.length > 0,
|
|
788
|
+
title: 'Renderable patterns',
|
|
789
|
+
},
|
|
790
|
+
],
|
|
791
|
+
recommendedUsages,
|
|
792
|
+
supportedIntents,
|
|
793
|
+
},
|
|
794
|
+
meta: buildMeta(index.builtAt, index.version, 1),
|
|
795
|
+
};
|
|
796
|
+
};
|
|
797
|
+
/**
|
|
798
|
+
* Find component recommendations for a task mapped to an intent ID.
|
|
799
|
+
*
|
|
800
|
+
* @experimental This API is still under active design.
|
|
801
|
+
*/
|
|
802
|
+
export const findComponentsForTask = async (query, storeOptions = {}) => {
|
|
803
|
+
const store = createMetadataStore(storeOptions);
|
|
804
|
+
const index = await store.getIndex();
|
|
805
|
+
const hasTaskId = typeof query.taskId === 'string' && query.taskId.trim().length > 0;
|
|
806
|
+
const hasFramework = typeof query.framework === 'string' && query.framework.trim().length > 0;
|
|
807
|
+
if (!hasTaskId || !hasFramework) {
|
|
808
|
+
return {
|
|
809
|
+
data: null,
|
|
810
|
+
errors: [{
|
|
811
|
+
code: 'INVALID_QUERY',
|
|
812
|
+
details: query,
|
|
813
|
+
message: '"taskId" and "framework" must be valid values.',
|
|
814
|
+
}],
|
|
815
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
const phases = resolveGuidePhases(query.includePhases);
|
|
819
|
+
const intent = getIntentFromRegistry(query.taskId, phases);
|
|
820
|
+
if (!intent) {
|
|
821
|
+
return {
|
|
822
|
+
data: null,
|
|
823
|
+
errors: [{
|
|
824
|
+
code: 'NOT_FOUND',
|
|
825
|
+
details: {
|
|
826
|
+
phases,
|
|
827
|
+
taskId: normalizeIntentId(query.taskId),
|
|
828
|
+
},
|
|
829
|
+
message: `Task "${query.taskId}" is not registered as an intent in the selected phases.`,
|
|
830
|
+
}],
|
|
831
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
const recommendations = listCapabilitiesForIntentFromRegistry(intent.id, phases)
|
|
835
|
+
.map((capability) => {
|
|
836
|
+
const targetId = getTargetIdentity(capability.target);
|
|
837
|
+
if (query.constraints?.avoidTargets?.includes(targetId)) {
|
|
838
|
+
return null;
|
|
839
|
+
}
|
|
840
|
+
const snippet = renderIntentFromRegistry({
|
|
841
|
+
content: query.content,
|
|
842
|
+
framework: query.framework,
|
|
843
|
+
includePhases: phases,
|
|
844
|
+
intent: intent.id,
|
|
845
|
+
target: capability.target,
|
|
846
|
+
});
|
|
847
|
+
if (!snippet) {
|
|
848
|
+
return null;
|
|
849
|
+
}
|
|
850
|
+
const preferred = !!query.constraints?.preferredTargets?.includes(targetId);
|
|
851
|
+
return {
|
|
852
|
+
intentId: intent.id,
|
|
853
|
+
preferred,
|
|
854
|
+
snippet,
|
|
855
|
+
targetId,
|
|
856
|
+
why: `Supports category "${intent.category}" and has a registered render pattern.`,
|
|
857
|
+
};
|
|
858
|
+
})
|
|
859
|
+
.filter((entry) => entry !== null)
|
|
860
|
+
.sort((a, b) => {
|
|
861
|
+
if (a.preferred !== b.preferred) {
|
|
862
|
+
return a.preferred ? -1 : 1;
|
|
863
|
+
}
|
|
864
|
+
return a.targetId.localeCompare(b.targetId);
|
|
865
|
+
})
|
|
866
|
+
.slice(0, query.maxAlternatives ?? 5)
|
|
867
|
+
.map((entry, e) => ({
|
|
868
|
+
...entry,
|
|
869
|
+
rank: e + 1,
|
|
870
|
+
}));
|
|
871
|
+
return {
|
|
872
|
+
data: {
|
|
873
|
+
alternatives: recommendations,
|
|
874
|
+
framework: query.framework,
|
|
875
|
+
notes: recommendations.length === 0
|
|
876
|
+
? ['No renderable component patterns were found for this task in the selected phases.']
|
|
877
|
+
: [],
|
|
878
|
+
primaryRecommendation: recommendations[0] ?? null,
|
|
879
|
+
taskId: intent.id,
|
|
880
|
+
},
|
|
881
|
+
meta: buildMeta(index.builtAt, index.version, 1),
|
|
882
|
+
};
|
|
883
|
+
};
|
|
884
|
+
/**
|
|
885
|
+
* Return renderable options for one intent and framework.
|
|
886
|
+
*
|
|
887
|
+
* @experimental This API is still under active design.
|
|
888
|
+
*/
|
|
889
|
+
export const getIntentOptions = async (query, storeOptions = {}) => {
|
|
890
|
+
const store = createMetadataStore(storeOptions);
|
|
891
|
+
const index = await store.getIndex();
|
|
892
|
+
const hasIntentId = typeof query.intentId === 'string' && query.intentId.trim().length > 0;
|
|
893
|
+
const hasFramework = typeof query.framework === 'string' && query.framework.trim().length > 0;
|
|
894
|
+
if (!hasIntentId || !hasFramework) {
|
|
895
|
+
return {
|
|
896
|
+
data: null,
|
|
897
|
+
errors: [{
|
|
898
|
+
code: 'INVALID_QUERY',
|
|
899
|
+
details: query,
|
|
900
|
+
message: '"intentId" and "framework" must be valid values.',
|
|
901
|
+
}],
|
|
902
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
const phases = resolveGuidePhases(query.includePhases);
|
|
906
|
+
const intent = getIntentFromRegistry(query.intentId, phases);
|
|
907
|
+
if (!intent) {
|
|
908
|
+
return {
|
|
909
|
+
data: null,
|
|
910
|
+
errors: [{
|
|
911
|
+
code: 'NOT_FOUND',
|
|
912
|
+
details: {
|
|
913
|
+
intentId: normalizeIntentId(query.intentId),
|
|
914
|
+
phases,
|
|
915
|
+
},
|
|
916
|
+
message: `Intent "${query.intentId}" is not registered in the selected phases.`,
|
|
917
|
+
}],
|
|
918
|
+
meta: buildMeta(index.builtAt, index.version, 0),
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
const capabilities = listCapabilitiesForIntentFromRegistry(intent.id, phases);
|
|
922
|
+
const renderableTargets = [];
|
|
923
|
+
const nonRenderableCandidates = [];
|
|
924
|
+
const includeDiagnostics = query.includeDiagnostics === true;
|
|
925
|
+
for (const capability of capabilities) {
|
|
926
|
+
const targetId = getTargetIdentity(capability.target);
|
|
927
|
+
const snippet = renderIntentFromRegistry({
|
|
928
|
+
content: query.content,
|
|
929
|
+
framework: query.framework,
|
|
930
|
+
includePhases: phases,
|
|
931
|
+
intent: intent.id,
|
|
932
|
+
target: capability.target,
|
|
933
|
+
});
|
|
934
|
+
if (!snippet) {
|
|
935
|
+
if (includeDiagnostics) {
|
|
936
|
+
nonRenderableCandidates.push({
|
|
937
|
+
detail: 'Capability exists for the intent category, but no concrete usage pattern is registered for this target + intent pair.',
|
|
938
|
+
reasonCode: 'PATTERN_NOT_FOUND',
|
|
939
|
+
targetId,
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
continue;
|
|
943
|
+
}
|
|
944
|
+
const pattern = resolveUsagePatternFromRegistry(capability.target, intent.id, phases);
|
|
945
|
+
renderableTargets.push({
|
|
946
|
+
phase: pattern?.phase,
|
|
947
|
+
previewCode: snippet,
|
|
948
|
+
reason: pattern?.description ?? `Renderable option for intent "${intent.id}".`,
|
|
949
|
+
targetId,
|
|
950
|
+
targetName: capability.target.name,
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
renderableTargets.sort((a, b) => a.targetId.localeCompare(b.targetId));
|
|
954
|
+
const limitedTargets = renderableTargets.slice(0, query.maxAlternatives ?? 5);
|
|
955
|
+
return {
|
|
956
|
+
data: {
|
|
957
|
+
bestDefaultTargetId: limitedTargets[0]?.targetId ?? null,
|
|
958
|
+
framework: query.framework,
|
|
959
|
+
intentId: intent.id,
|
|
960
|
+
nonRenderableCandidates,
|
|
961
|
+
renderableTargets: limitedTargets,
|
|
962
|
+
},
|
|
963
|
+
meta: buildMeta(index.builtAt, index.version, 1),
|
|
964
|
+
};
|
|
965
|
+
};
|