@adia-ai/gen-ui 0.8.37
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 +26 -0
- package/README.md +77 -0
- package/compose/CHANGELOG.md +1707 -0
- package/compose/README.md +215 -0
- package/compose/core/artifacts.js +262 -0
- package/compose/core/context-store.js +218 -0
- package/compose/core/generator.d.ts +4 -0
- package/compose/core/generator.js +602 -0
- package/compose/core/pipeline/engine.js +289 -0
- package/compose/core/pipeline/types.js +91 -0
- package/compose/core/plan-primitives.js +120 -0
- package/compose/core/plan-turn.js +145 -0
- package/compose/core/reference.js +150 -0
- package/compose/core/state.js +15 -0
- package/compose/evals/harness.d.ts +4 -0
- package/compose/evals/harness.mjs +193 -0
- package/compose/index.d.ts +4 -0
- package/compose/index.js +16 -0
- package/compose/shared/validate-and-repair.js +122 -0
- package/compose/strategies/_shared/chunk-loader.js +282 -0
- package/compose/strategies/cascade.d.ts +67 -0
- package/compose/strategies/cascade.js +165 -0
- package/compose/strategies/escalation.d.ts +13 -0
- package/compose/strategies/escalation.js +132 -0
- package/compose/strategies/free-form-composer/index.js +254 -0
- package/compose/strategies/free-form-composer/system-prompt.js +205 -0
- package/compose/strategies/free-form-composer/transpile.js +279 -0
- package/compose/strategies/monolithic/_shared.js +1619 -0
- package/compose/strategies/monolithic/generate-instant.js +228 -0
- package/compose/strategies/monolithic/generate-pro.js +490 -0
- package/compose/strategies/monolithic/generate-thinking.js +206 -0
- package/compose/strategies/registry.d.ts +20 -0
- package/compose/strategies/registry.js +495 -0
- package/compose/strategies/zettel/_smoke.js +27 -0
- package/compose/strategies/zettel/chunk-composer.js +214 -0
- package/compose/strategies/zettel/chunk-refiner.js +582 -0
- package/compose/strategies/zettel/chunk-synthesizer.js +458 -0
- package/compose/strategies/zettel/composer.js +78 -0
- package/compose/strategies/zettel/composition-library.js +418 -0
- package/compose/strategies/zettel/generate.js +15 -0
- package/compose/strategies/zettel/generator-adapter.d.ts +4 -0
- package/compose/strategies/zettel/generator-adapter.js +242 -0
- package/compose/strategies/zettel/issue-reporter.js +607 -0
- package/compose/strategies/zettel/session-store.js +121 -0
- package/compose/strategies/zettel/state-cache.js +158 -0
- package/compose/transpiler/transpiler-maps.js +675 -0
- package/compose/transpiler/transpiler.d.ts +4 -0
- package/compose/transpiler/transpiler.js +962 -0
- package/corpus/CHANGELOG.md +1957 -0
- package/corpus/README.md +279 -0
- package/corpus/catalog-a2ui_0_9.d.ts +4 -0
- package/corpus/catalog-a2ui_0_9.json +29571 -0
- package/corpus/catalog-a2ui_0_9_rules.txt +1215 -0
- package/corpus/chunk-embeddings.d.ts +4 -0
- package/corpus/chunk-embeddings.json +1 -0
- package/corpus/chunks/_index.json +16658 -0
- package/corpus/chunks/_source-hashes.json +571 -0
- package/corpus/chunks/access-denied-with-request.json +124 -0
- package/corpus/chunks/access-request-form.json +166 -0
- package/corpus/chunks/access-request-pending.json +133 -0
- package/corpus/chunks/accordion-settings.json +176 -0
- package/corpus/chunks/achievement-badges.json +413 -0
- package/corpus/chunks/achievement-unlock.json +104 -0
- package/corpus/chunks/action-list-record-actions.json +84 -0
- package/corpus/chunks/activity-feed.json +390 -0
- package/corpus/chunks/admin-page-header-flush.json +83 -0
- package/corpus/chunks/admin-page-header-title-description.json +80 -0
- package/corpus/chunks/admin-page-header-with-actions.json +107 -0
- package/corpus/chunks/admin-page-header-with-tabs.json +144 -0
- package/corpus/chunks/admin-shell-rounded-borderless.json +287 -0
- package/corpus/chunks/admin-shell-standard.json +310 -0
- package/corpus/chunks/admin-sidebar-brand-signin.json +158 -0
- package/corpus/chunks/admin-sidebar-brand-version.json +130 -0
- package/corpus/chunks/admin-sidebar-flat-nav.json +131 -0
- package/corpus/chunks/admin-sidebar-nav-dividers.json +150 -0
- package/corpus/chunks/admin-sidebar-nav-groups.json +171 -0
- package/corpus/chunks/admin-sidebar-workspace-switcher.json +139 -0
- package/corpus/chunks/admin-topbar-breadcrumb-actions.json +130 -0
- package/corpus/chunks/admin-topbar-breadcrumb-minimal.json +79 -0
- package/corpus/chunks/admin-topbar-deep-breadcrumb.json +129 -0
- package/corpus/chunks/admin-topbar-search.json +104 -0
- package/corpus/chunks/admin-topbar-status-indicator.json +122 -0
- package/corpus/chunks/admin-topbar-trailing-toggle.json +114 -0
- package/corpus/chunks/agent-activity-feed.json +163 -0
- package/corpus/chunks/agent-artifact-stub-card.json +115 -0
- package/corpus/chunks/agent-canvas-shell.json +305 -0
- package/corpus/chunks/agent-citations-source-chips.json +82 -0
- package/corpus/chunks/agent-command-palette-search.json +120 -0
- package/corpus/chunks/agent-cost-detailed.json +260 -0
- package/corpus/chunks/agent-cost-inline.json +78 -0
- package/corpus/chunks/agent-memory-detail.json +181 -0
- package/corpus/chunks/agent-memory-editor.json +173 -0
- package/corpus/chunks/agent-memory-list.json +207 -0
- package/corpus/chunks/agent-pipeline-status-stages.json +61 -0
- package/corpus/chunks/agent-prompt-card.json +179 -0
- package/corpus/chunks/agent-prompt-library-grid.json +341 -0
- package/corpus/chunks/agent-prompt-picker.json +282 -0
- package/corpus/chunks/agent-rate-limit.json +100 -0
- package/corpus/chunks/agent-reasoning-collapsed.json +128 -0
- package/corpus/chunks/agent-tool-call-accordion.json +109 -0
- package/corpus/chunks/agent-tool-call-collapsed.json +98 -0
- package/corpus/chunks/agent-tool-call-error.json +112 -0
- package/corpus/chunks/agent-tool-call-result.json +145 -0
- package/corpus/chunks/agent-tool-call-running.json +85 -0
- package/corpus/chunks/agent-tool-call-success.json +137 -0
- package/corpus/chunks/agent-trace-timeline.json +244 -0
- package/corpus/chunks/ai-streaming-response.json +147 -0
- package/corpus/chunks/alert-banner-stack.json +78 -0
- package/corpus/chunks/alert-banner.json +55 -0
- package/corpus/chunks/alert-dialog-simple.json +72 -0
- package/corpus/chunks/alert-dialog-typed.json +107 -0
- package/corpus/chunks/alert-dialog-unsaved.json +81 -0
- package/corpus/chunks/analytics-chart.json +213 -0
- package/corpus/chunks/analytics-sparklines-dashboard.json +259 -0
- package/corpus/chunks/anchor-bar-selection-bar.json +226 -0
- package/corpus/chunks/api-key-table.json +148 -0
- package/corpus/chunks/api-keys-create.json +140 -0
- package/corpus/chunks/api-keys-list.json +271 -0
- package/corpus/chunks/app-nav-badges-counts.json +77 -0
- package/corpus/chunks/app-nav-badges-group-rollup-badges.json +100 -0
- package/corpus/chunks/app-nav-badges-plan-tiers.json +76 -0
- package/corpus/chunks/app-nav-badges-status-callouts.json +75 -0
- package/corpus/chunks/app-nav-full-example.json +195 -0
- package/corpus/chunks/app-nav-groups.json +103 -0
- package/corpus/chunks/app-nav-items.json +74 -0
- package/corpus/chunks/app-nav-labels-and-dividers.json +92 -0
- package/corpus/chunks/app-nav-spacer.json +77 -0
- package/corpus/chunks/app-product-listing-card.json +214 -0
- package/corpus/chunks/approvals-detail.json +240 -0
- package/corpus/chunks/approvals-queue.json +321 -0
- package/corpus/chunks/audit-log-basic.json +184 -0
- package/corpus/chunks/audit-log.json +174 -0
- package/corpus/chunks/auth-account-deleted-actions.json +51 -0
- package/corpus/chunks/auth-account-deleted.json +202 -0
- package/corpus/chunks/auth-card-content.json +260 -0
- package/corpus/chunks/auth-card-header.json +205 -0
- package/corpus/chunks/auth-email-entry.json +65 -0
- package/corpus/chunks/auth-email-verify-confirm.json +52 -0
- package/corpus/chunks/auth-email-verify.json +196 -0
- package/corpus/chunks/auth-forbidden-actions.json +59 -0
- package/corpus/chunks/auth-forbidden.json +203 -0
- package/corpus/chunks/auth-invite-actions.json +49 -0
- package/corpus/chunks/auth-invite-team-card.json +86 -0
- package/corpus/chunks/auth-link-expired-form.json +65 -0
- package/corpus/chunks/auth-link-expired.json +196 -0
- package/corpus/chunks/auth-locked-account.json +211 -0
- package/corpus/chunks/auth-locked-recovery-options.json +60 -0
- package/corpus/chunks/auth-mfa-enrollment-submit.json +54 -0
- package/corpus/chunks/auth-mfa-enrollment.json +284 -0
- package/corpus/chunks/auth-mfa-fallback-actions.json +52 -0
- package/corpus/chunks/auth-mfa-recovery.json +61 -0
- package/corpus/chunks/auth-new-password-form.json +75 -0
- package/corpus/chunks/auth-new-password.json +217 -0
- package/corpus/chunks/auth-oauth-fallback-actions.json +52 -0
- package/corpus/chunks/auth-oauth-interstitial.json +160 -0
- package/corpus/chunks/auth-password-challenge.json +94 -0
- package/corpus/chunks/auth-password-reset-form.json +64 -0
- package/corpus/chunks/auth-password-reset.json +195 -0
- package/corpus/chunks/auth-profile-form.json +72 -0
- package/corpus/chunks/auth-profile-setup.json +194 -0
- package/corpus/chunks/auth-reset-sent.json +188 -0
- package/corpus/chunks/auth-session-expired-actions.json +52 -0
- package/corpus/chunks/auth-session-expired.json +201 -0
- package/corpus/chunks/auth-signin-card-email.json +245 -0
- package/corpus/chunks/auth-signin-card-magic-link.json +147 -0
- package/corpus/chunks/auth-signin-card-mfa.json +231 -0
- package/corpus/chunks/auth-signin-card-otp.json +205 -0
- package/corpus/chunks/auth-signin-card-password.json +264 -0
- package/corpus/chunks/auth-signin-card-recovery.json +218 -0
- package/corpus/chunks/auth-signout-actions.json +51 -0
- package/corpus/chunks/auth-signout.json +184 -0
- package/corpus/chunks/auth-signup-email-entry.json +66 -0
- package/corpus/chunks/auth-signup-entry.json +281 -0
- package/corpus/chunks/auth-signup-social-auths.json +54 -0
- package/corpus/chunks/auth-signup-verify.json +227 -0
- package/corpus/chunks/auth-social-auths.json +62 -0
- package/corpus/chunks/auth-sso-providers.json +55 -0
- package/corpus/chunks/auth-sso-required.json +213 -0
- package/corpus/chunks/auth-team-invite.json +288 -0
- package/corpus/chunks/avatar-group-overflow.json +137 -0
- package/corpus/chunks/avatar-stack-overflow.json +124 -0
- package/corpus/chunks/banner-announcement-beta.json +99 -0
- package/corpus/chunks/banner-announcement-promo.json +102 -0
- package/corpus/chunks/banner-live-update.json +102 -0
- package/corpus/chunks/banner-system-maintenance.json +101 -0
- package/corpus/chunks/banner-system-offline.json +85 -0
- package/corpus/chunks/banner-system-update.json +102 -0
- package/corpus/chunks/bell-menu-empty.json +107 -0
- package/corpus/chunks/bell-menu-unread.json +395 -0
- package/corpus/chunks/billing-cancel-subscription-danger.json +61 -0
- package/corpus/chunks/billing-invoice-history-table.json +75 -0
- package/corpus/chunks/billing-overview.json +202 -0
- package/corpus/chunks/billing-payment-method-card-on-file.json +157 -0
- package/corpus/chunks/billing-progress-label.json +101 -0
- package/corpus/chunks/blog-post-card.json +212 -0
- package/corpus/chunks/breadcrumb-navigation.json +72 -0
- package/corpus/chunks/bulk-action-toolbar-floating.json +199 -0
- package/corpus/chunks/bulk-action-toolbar-swap.json +158 -0
- package/corpus/chunks/bulk-selection-actions-bar.json +162 -0
- package/corpus/chunks/business-address-form.json +953 -0
- package/corpus/chunks/calendar-month-view.json +74 -0
- package/corpus/chunks/card-grid-images.json +459 -0
- package/corpus/chunks/card-header-with-description.json +47 -0
- package/corpus/chunks/card-with-empty-state.json +96 -0
- package/corpus/chunks/card-with-form.json +143 -0
- package/corpus/chunks/card-with-sparkline.json +90 -0
- package/corpus/chunks/card-with-stat-kpi.json +86 -0
- package/corpus/chunks/changelog-feed-basic.json +470 -0
- package/corpus/chunks/chart-in-card-chart-plus-breakdown.json +188 -0
- package/corpus/chunks/chart-in-card-chart-plus-stat.json +89 -0
- package/corpus/chunks/chart-in-card-chart-with-filter-pills.json +124 -0
- package/corpus/chunks/chart-in-card-full-bleed-legend.json +116 -0
- package/corpus/chunks/chart-in-card-full-chart.json +107 -0
- package/corpus/chunks/chart-in-card-sparkline-tile.json +93 -0
- package/corpus/chunks/chart-in-card-stat-with-sparkline.json +73 -0
- package/corpus/chunks/chart-in-card-trend-footer.json +115 -0
- package/corpus/chunks/chart-with-filter-pills.json +169 -0
- package/corpus/chunks/chat-empty-state-hero.json +102 -0
- package/corpus/chunks/chat-message-assistant-byline.json +85 -0
- package/corpus/chunks/chat-message-user-byline.json +84 -0
- package/corpus/chunks/chat-page-shell.json +379 -0
- package/corpus/chunks/chat-streaming-surface.json +169 -0
- package/corpus/chunks/checkout-order-summary-card.json +140 -0
- package/corpus/chunks/code-snippet.json +107 -0
- package/corpus/chunks/col-form-stack.json +93 -0
- package/corpus/chunks/col-heading-body-action.json +79 -0
- package/corpus/chunks/col-stat-label.json +63 -0
- package/corpus/chunks/color-picker-swatches.json +153 -0
- package/corpus/chunks/command-palette.json +327 -0
- package/corpus/chunks/comments-composer.json +158 -0
- package/corpus/chunks/comments-mention-menu.json +237 -0
- package/corpus/chunks/comments-thread.json +344 -0
- package/corpus/chunks/commerce-pricing-tiers.json +401 -0
- package/corpus/chunks/comparison-table.json +246 -0
- package/corpus/chunks/contact-form-card.json +197 -0
- package/corpus/chunks/contact-form.json +157 -0
- package/corpus/chunks/contact-support-form.json +702 -0
- package/corpus/chunks/conversion-funnel-4-step-funnel.json +139 -0
- package/corpus/chunks/conversion-funnel-6step.json +151 -0
- package/corpus/chunks/conversion-funnel-wide-summary.json +192 -0
- package/corpus/chunks/conversion-funnel-with-segment-compare.json +202 -0
- package/corpus/chunks/cta-banner-centered.json +102 -0
- package/corpus/chunks/dashboard-acquisition-panel.json +212 -0
- package/corpus/chunks/dashboard-admin-page.json +104 -0
- package/corpus/chunks/dashboard-audience-kpis.json +165 -0
- package/corpus/chunks/dashboard-audience-panel.json +756 -0
- package/corpus/chunks/dashboard-behavior-panel.json +114 -0
- package/corpus/chunks/dashboard-chart-recent.json +566 -0
- package/corpus/chunks/dashboard-cohort-retention.json +83 -0
- package/corpus/chunks/dashboard-conversion-panel.json +234 -0
- package/corpus/chunks/dashboard-country-list.json +304 -0
- package/corpus/chunks/dashboard-filter-bar.json +118 -0
- package/corpus/chunks/dashboard-funnel.json +142 -0
- package/corpus/chunks/dashboard-notifications-panel.json +423 -0
- package/corpus/chunks/dashboard-overview-panel.json +1644 -0
- package/corpus/chunks/dashboard-page-header.json +166 -0
- package/corpus/chunks/dashboard-pages-table.json +86 -0
- package/corpus/chunks/dashboard-quick-actions.json +116 -0
- package/corpus/chunks/dashboard-reports-panel.json +166 -0
- package/corpus/chunks/dashboard-reports-table.json +138 -0
- package/corpus/chunks/dashboard-storage-card.json +117 -0
- package/corpus/chunks/dashboard-tabs.json +86 -0
- package/corpus/chunks/dashboard-team-actions-storage.json +605 -0
- package/corpus/chunks/dashboard-team-list.json +334 -0
- package/corpus/chunks/dashboard-traffic-channels.json +184 -0
- package/corpus/chunks/dashboard-transactions-table.json +145 -0
- package/corpus/chunks/data-export-history.json +192 -0
- package/corpus/chunks/data-export-request.json +197 -0
- package/corpus/chunks/data-import-wizard.json +391 -0
- package/corpus/chunks/date-range-picker.json +156 -0
- package/corpus/chunks/date-time-picker-form.json +222 -0
- package/corpus/chunks/departments-checkbox-form.json +390 -0
- package/corpus/chunks/destructive-confirm-modal.json +149 -0
- package/corpus/chunks/diff-inline.json +84 -0
- package/corpus/chunks/diff-side-by-side.json +131 -0
- package/corpus/chunks/diff-structured.json +216 -0
- package/corpus/chunks/digest-email-preview.json +374 -0
- package/corpus/chunks/divider-text-label.json +87 -0
- package/corpus/chunks/doc-editor-shell.json +356 -0
- package/corpus/chunks/drawer-2fa-key.json +273 -0
- package/corpus/chunks/drawer-2fa-sms.json +261 -0
- package/corpus/chunks/drawer-2fa-totp.json +385 -0
- package/corpus/chunks/drawer-cancel-sub.json +636 -0
- package/corpus/chunks/drawer-change-plan.json +561 -0
- package/corpus/chunks/drawer-custom-roles.json +696 -0
- package/corpus/chunks/drawer-data-start.json +171 -0
- package/corpus/chunks/drawer-delete-account.json +341 -0
- package/corpus/chunks/drawer-delete-workspace.json +362 -0
- package/corpus/chunks/drawer-discord.json +434 -0
- package/corpus/chunks/drawer-figma.json +401 -0
- package/corpus/chunks/drawer-first-dashboard.json +220 -0
- package/corpus/chunks/drawer-gcal.json +475 -0
- package/corpus/chunks/drawer-github.json +589 -0
- package/corpus/chunks/drawer-invite.json +397 -0
- package/corpus/chunks/drawer-record-detail.json +44 -0
- package/corpus/chunks/drawer-report.json +528 -0
- package/corpus/chunks/drawer-revoke-session.json +331 -0
- package/corpus/chunks/drawer-role.json +190 -0
- package/corpus/chunks/drawer-slack.json +429 -0
- package/corpus/chunks/drawer-smtp.json +476 -0
- package/corpus/chunks/drawer-source.json +294 -0
- package/corpus/chunks/drawer-transaction.json +493 -0
- package/corpus/chunks/drawer-with-create-form.json +43 -0
- package/corpus/chunks/editor-code-pane.json +204 -0
- package/corpus/chunks/editor-page-shell.json +149 -0
- package/corpus/chunks/editor-preview-pane.json +136 -0
- package/corpus/chunks/editor-statusbar-ready.json +99 -0
- package/corpus/chunks/editor-toolbar-import-export.json +195 -0
- package/corpus/chunks/email-inbox-list.json +678 -0
- package/corpus/chunks/empty-state-danger.json +58 -0
- package/corpus/chunks/empty-state-minimal.json +44 -0
- package/corpus/chunks/empty-state-warning.json +53 -0
- package/corpus/chunks/empty-state.json +65 -0
- package/corpus/chunks/error-404-actions.json +54 -0
- package/corpus/chunks/error-404.json +204 -0
- package/corpus/chunks/error-500-actions.json +61 -0
- package/corpus/chunks/error-500.json +220 -0
- package/corpus/chunks/error-maintenance-actions.json +53 -0
- package/corpus/chunks/error-maintenance.json +203 -0
- package/corpus/chunks/error-page-shell.json +132 -0
- package/corpus/chunks/export-flow-async.json +210 -0
- package/corpus/chunks/export-flow-delivery.json +163 -0
- package/corpus/chunks/export-flow-sync.json +162 -0
- package/corpus/chunks/extended-profile-form.json +512 -0
- package/corpus/chunks/faq-accordion.json +123 -0
- package/corpus/chunks/feature-grid-icons.json +314 -0
- package/corpus/chunks/feature-grid-three-cards.json +187 -0
- package/corpus/chunks/feature-toggle-switch-grid.json +213 -0
- package/corpus/chunks/file-upload-dnd.json +166 -0
- package/corpus/chunks/file-upload-field.json +97 -0
- package/corpus/chunks/file-upload-form.json +251 -0
- package/corpus/chunks/filter-bar-active-filters.json +176 -0
- package/corpus/chunks/filter-bar-filter-bar-with-table.json +113 -0
- package/corpus/chunks/filter-bar-saved-views.json +117 -0
- package/corpus/chunks/filter-popover-form.json +137 -0
- package/corpus/chunks/footer-multi-column.json +270 -0
- package/corpus/chunks/footer-primary-only.json +41 -0
- package/corpus/chunks/form-checkbox-group.json +65 -0
- package/corpus/chunks/form-drawer-edit-form.json +178 -0
- package/corpus/chunks/form-drawer-simple-form.json +151 -0
- package/corpus/chunks/form-drawer-tall-form.json +325 -0
- package/corpus/chunks/form-field-email-hint.json +53 -0
- package/corpus/chunks/form-field-range.json +54 -0
- package/corpus/chunks/form-field-required.json +52 -0
- package/corpus/chunks/form-field-select.json +66 -0
- package/corpus/chunks/form-field-textarea.json +51 -0
- package/corpus/chunks/form-field-with-error.json +151 -0
- package/corpus/chunks/form-fields-two-column.json +69 -0
- package/corpus/chunks/form-page-shell.json +146 -0
- package/corpus/chunks/form-switch-toggle.json +41 -0
- package/corpus/chunks/form-system-live-demo.json +123 -0
- package/corpus/chunks/forms-address-autocomplete.json +277 -0
- package/corpus/chunks/forms-address-fields.json +221 -0
- package/corpus/chunks/forms-conditional-reveal.json +195 -0
- package/corpus/chunks/gallery-page-shell.json +444 -0
- package/corpus/chunks/grid-2col-entry-cards.json +140 -0
- package/corpus/chunks/grid-kpi-4col.json +164 -0
- package/corpus/chunks/grid-responsive-kpi.json +165 -0
- package/corpus/chunks/hero-cta-simple.json +107 -0
- package/corpus/chunks/hero-cta-split.json +183 -0
- package/corpus/chunks/hero-section-split.json +111 -0
- package/corpus/chunks/icon-text-row.json +60 -0
- package/corpus/chunks/image-caption-tile.json +99 -0
- package/corpus/chunks/image-carousel.json +156 -0
- package/corpus/chunks/image-thumbnail-grid.json +77 -0
- package/corpus/chunks/image-upload-preview.json +118 -0
- package/corpus/chunks/import-mapping-flow.json +972 -0
- package/corpus/chunks/inline-dialog-rename.json +128 -0
- package/corpus/chunks/inline-dialog-schedule.json +154 -0
- package/corpus/chunks/inline-dialog-status.json +179 -0
- package/corpus/chunks/integrations-api-keys-card-list.json +475 -0
- package/corpus/chunks/integrations-connect-form.json +550 -0
- package/corpus/chunks/integrations-grid.json +141 -0
- package/corpus/chunks/integrations-webhooks-empty-state.json +66 -0
- package/corpus/chunks/inventory-list-stock.json +137 -0
- package/corpus/chunks/invite-members.json +153 -0
- package/corpus/chunks/invoice-line-items.json +493 -0
- package/corpus/chunks/kanban-board-3col.json +713 -0
- package/corpus/chunks/kanban-page-shell.json +671 -0
- package/corpus/chunks/key-value-detail-list.json +242 -0
- package/corpus/chunks/keyboard-shortcut-display.json +250 -0
- package/corpus/chunks/labeled-textarea.json +45 -0
- package/corpus/chunks/leaderboard-table.json +140 -0
- package/corpus/chunks/library-browser-search-filter.json +109 -0
- package/corpus/chunks/linked-record-row.json +61 -0
- package/corpus/chunks/loading-skeleton-placeholder.json +387 -0
- package/corpus/chunks/login-form-card.json +207 -0
- package/corpus/chunks/logo-cloud-trusted-by.json +235 -0
- package/corpus/chunks/map-with-location-list.json +293 -0
- package/corpus/chunks/marketing-hero-cta.json +102 -0
- package/corpus/chunks/marketing-page-shell.json +352 -0
- package/corpus/chunks/masonry-gallery.json +154 -0
- package/corpus/chunks/member-edit-drawer.json +236 -0
- package/corpus/chunks/members-active-table-search-filter.json +184 -0
- package/corpus/chunks/members-pending-invites-cards.json +251 -0
- package/corpus/chunks/members-roles-permissions-list.json +146 -0
- package/corpus/chunks/menu-context-actions.json +113 -0
- package/corpus/chunks/metadata-description-list.json +178 -0
- package/corpus/chunks/modal-create-project-form.json +133 -0
- package/corpus/chunks/modal-preferences-tabs.json +147 -0
- package/corpus/chunks/multi-field-form-validation.json +394 -0
- package/corpus/chunks/nav-menu-icons.json +74 -0
- package/corpus/chunks/newsletter-subscription.json +190 -0
- package/corpus/chunks/notification-badges-feed.json +411 -0
- package/corpus/chunks/notification-preferences-panel.json +238 -0
- package/corpus/chunks/onb-completion.json +139 -0
- package/corpus/chunks/onb-extension-install.json +172 -0
- package/corpus/chunks/onb-hero-welcome.json +156 -0
- package/corpus/chunks/onb-import-picker.json +86 -0
- package/corpus/chunks/onb-mobile-handoff.json +121 -0
- package/corpus/chunks/onb-notification-prefs.json +83 -0
- package/corpus/chunks/onb-persona-picker.json +82 -0
- package/corpus/chunks/onb-provider-tiles.json +137 -0
- package/corpus/chunks/onb-settings-review.json +257 -0
- package/corpus/chunks/onb-step-footer.json +121 -0
- package/corpus/chunks/onb-step-header.json +121 -0
- package/corpus/chunks/onb-step-progress.json +140 -0
- package/corpus/chunks/onb-step-shell.json +380 -0
- package/corpus/chunks/onb-story-pane.json +121 -0
- package/corpus/chunks/onb-tutorial-steps.json +193 -0
- package/corpus/chunks/order-confirmation-success-card.json +177 -0
- package/corpus/chunks/order-tracking-timeline.json +131 -0
- package/corpus/chunks/pagination-controls.json +82 -0
- package/corpus/chunks/pane-settings-sidebar.json +204 -0
- package/corpus/chunks/patient-visit-shell.json +191 -0
- package/corpus/chunks/payment-checkout-form.json +341 -0
- package/corpus/chunks/payment-method-form.json +328 -0
- package/corpus/chunks/period-comparison.json +236 -0
- package/corpus/chunks/permission-matrix-table.json +438 -0
- package/corpus/chunks/permissions-matrix-grid.json +111 -0
- package/corpus/chunks/permissions-matrix-summary.json +157 -0
- package/corpus/chunks/permissions-role-picker-radio.json +107 -0
- package/corpus/chunks/permissions-role-picker-select.json +101 -0
- package/corpus/chunks/permissions-share-link.json +256 -0
- package/corpus/chunks/permissions-share-people.json +297 -0
- package/corpus/chunks/permissions-sharing-scopes.json +109 -0
- package/corpus/chunks/plan-selection-form.json +529 -0
- package/corpus/chunks/playground-a2ui.json +181 -0
- package/corpus/chunks/playground-agent-admin.json +117 -0
- package/corpus/chunks/playground-agent-chat.json +126 -0
- package/corpus/chunks/playground-app-shell.json +488 -0
- package/corpus/chunks/playground-chat.json +265 -0
- package/corpus/chunks/playground-construct-canvas.json +118 -0
- package/corpus/chunks/playground-css-channel.json +487 -0
- package/corpus/chunks/playground-gen-ui.json +224 -0
- package/corpus/chunks/playground-render-preview.json +369 -0
- package/corpus/chunks/playground-streams-bridge.json +437 -0
- package/corpus/chunks/playground-table-toolbar.json +38 -0
- package/corpus/chunks/popover-with-content.json +118 -0
- package/corpus/chunks/pricing-tiers.json +561 -0
- package/corpus/chunks/product-tour.json +158 -0
- package/corpus/chunks/profile-public.json +297 -0
- package/corpus/chunks/progress-tracker-milestones.json +294 -0
- package/corpus/chunks/radio-button-group.json +83 -0
- package/corpus/chunks/rating-stars-review-summary.json +259 -0
- package/corpus/chunks/reactions-bar.json +75 -0
- package/corpus/chunks/reactions-picker.json +245 -0
- package/corpus/chunks/real-time-metrics-dashboard.json +344 -0
- package/corpus/chunks/record-detail-drawer-simple-detail.json +296 -0
- package/corpus/chunks/record-detail-drawer-tabbed-detail.json +443 -0
- package/corpus/chunks/referral-share-link.json +128 -0
- package/corpus/chunks/referral-status.json +243 -0
- package/corpus/chunks/reg-address-form.json +825 -0
- package/corpus/chunks/reg-billing-card.json +210 -0
- package/corpus/chunks/reg-brand-scrape.json +599 -0
- package/corpus/chunks/reg-departments-toggle.json +259 -0
- package/corpus/chunks/reg-extended-profile.json +356 -0
- package/corpus/chunks/reg-final-done.json +457 -0
- package/corpus/chunks/reg-helpdesk-grid.json +571 -0
- package/corpus/chunks/reg-import-picker.json +112 -0
- package/corpus/chunks/reg-integrations-grid.json +418 -0
- package/corpus/chunks/reg-invite-form.json +245 -0
- package/corpus/chunks/reg-legal-entity.json +260 -0
- package/corpus/chunks/reg-org-chart-review.json +891 -0
- package/corpus/chunks/reg-profile-identity.json +188 -0
- package/corpus/chunks/reg-step-footer.json +201 -0
- package/corpus/chunks/reg-step-header.json +201 -0
- package/corpus/chunks/reg-step-progress.json +236 -0
- package/corpus/chunks/reg-step-shell.json +605 -0
- package/corpus/chunks/reg-story-pane.json +201 -0
- package/corpus/chunks/reg-success-summary.json +257 -0
- package/corpus/chunks/reg-team-size.json +128 -0
- package/corpus/chunks/reg-usecase-picker.json +104 -0
- package/corpus/chunks/reg-workspace-name.json +159 -0
- package/corpus/chunks/responsive-grid-pattern.json +71 -0
- package/corpus/chunks/responsive-kpi-grid.json +166 -0
- package/corpus/chunks/responsive-row-pattern.json +71 -0
- package/corpus/chunks/responsive-shell-sidebar.json +308 -0
- package/corpus/chunks/responsive-wrap-at-pattern.json +124 -0
- package/corpus/chunks/retention-cohort-default-retention.json +80 -0
- package/corpus/chunks/retention-cohort-stat-pair.json +163 -0
- package/corpus/chunks/retention-cohort-with-legend.json +135 -0
- package/corpus/chunks/revenue-heatmap.json +82 -0
- package/corpus/chunks/role-management.json +272 -0
- package/corpus/chunks/row-action-cluster.json +54 -0
- package/corpus/chunks/row-avatar-name-role.json +71 -0
- package/corpus/chunks/row-icon-label.json +52 -0
- package/corpus/chunks/row-spread-label-value.json +54 -0
- package/corpus/chunks/row-wrap-tags.json +72 -0
- package/corpus/chunks/schedule-meeting-form-card.json +229 -0
- package/corpus/chunks/search-recents-menu.json +195 -0
- package/corpus/chunks/search-results-grouped.json +357 -0
- package/corpus/chunks/search-results-list.json +202 -0
- package/corpus/chunks/search-saved-views.json +356 -0
- package/corpus/chunks/search-with-filters.json +311 -0
- package/corpus/chunks/searchable-picker-modal.json +164 -0
- package/corpus/chunks/section-with-stack.json +48 -0
- package/corpus/chunks/security-active-sessions-devices.json +287 -0
- package/corpus/chunks/security-change-password-form.json +102 -0
- package/corpus/chunks/security-delete-account-danger.json +79 -0
- package/corpus/chunks/segmented-control-billing-tabs.json +164 -0
- package/corpus/chunks/select-multiple-preselected.json +70 -0
- package/corpus/chunks/settings-2fa-setup.json +307 -0
- package/corpus/chunks/settings-admin-page.json +1205 -0
- package/corpus/chunks/settings-appearance-primitives.json +145 -0
- package/corpus/chunks/settings-appearance-theme-panel.json +55 -0
- package/corpus/chunks/settings-appearance.json +81 -0
- package/corpus/chunks/settings-danger-zone-delete-workspace.json +93 -0
- package/corpus/chunks/settings-general-form.json +69 -0
- package/corpus/chunks/settings-integrations.json +298 -0
- package/corpus/chunks/settings-members-invite.json +112 -0
- package/corpus/chunks/settings-notification-activity-checkboxes.json +108 -0
- package/corpus/chunks/settings-notification-channels-switches.json +101 -0
- package/corpus/chunks/settings-page-shell.json +190 -0
- package/corpus/chunks/settings-privacy.json +83 -0
- package/corpus/chunks/settings-profile-security.json +122 -0
- package/corpus/chunks/settings-toggle-switches.json +66 -0
- package/corpus/chunks/sidebar-nav.json +120 -0
- package/corpus/chunks/sidebar-navigation-panel.json +165 -0
- package/corpus/chunks/signup-form-card.json +218 -0
- package/corpus/chunks/signup-team-size-form.json +259 -0
- package/corpus/chunks/single-select-card-form.json +231 -0
- package/corpus/chunks/slider-range-controls.json +119 -0
- package/corpus/chunks/social-media-post-card.json +159 -0
- package/corpus/chunks/sortable-list.json +307 -0
- package/corpus/chunks/sortable-search-paginate-table.json +162 -0
- package/corpus/chunks/split-pane-editor.json +146 -0
- package/corpus/chunks/stack-avatar-badge-overlay.json +53 -0
- package/corpus/chunks/stack-image-shimmer.json +51 -0
- package/corpus/chunks/stat-cards-kpi-dashboard.json +178 -0
- package/corpus/chunks/stats-band-big-numbers.json +175 -0
- package/corpus/chunks/status-dashboard.json +282 -0
- package/corpus/chunks/stepper-form-wizard.json +165 -0
- package/corpus/chunks/subscription-status-renewal-card.json +285 -0
- package/corpus/chunks/survey-rating-form.json +165 -0
- package/corpus/chunks/swiper-product-carousel.json +349 -0
- package/corpus/chunks/swiper-testimonial-carousel.json +279 -0
- package/corpus/chunks/table-empty-state.json +116 -0
- package/corpus/chunks/table-inline-edit-row.json +269 -0
- package/corpus/chunks/table-spreadsheet-cells.json +334 -0
- package/corpus/chunks/table-toolbar-no-search.json +42 -0
- package/corpus/chunks/table-toolbar-with-table.json +208 -0
- package/corpus/chunks/table-with-toolbar-card.json +80 -0
- package/corpus/chunks/tabs-with-panels.json +187 -0
- package/corpus/chunks/tag-chips-filter.json +100 -0
- package/corpus/chunks/team-invite-form.json +380 -0
- package/corpus/chunks/team-members-list.json +341 -0
- package/corpus/chunks/testimonial-grid.json +269 -0
- package/corpus/chunks/testimonial-pull-quote.json +137 -0
- package/corpus/chunks/testimonials-avatar-cards.json +286 -0
- package/corpus/chunks/timeline-events.json +89 -0
- package/corpus/chunks/timezone-selector-basic.json +99 -0
- package/corpus/chunks/timezone-selector-preview.json +104 -0
- package/corpus/chunks/toolbar-icons.json +216 -0
- package/corpus/chunks/toolbar-rich-text-editor.json +230 -0
- package/corpus/chunks/toolbar-tooltips.json +191 -0
- package/corpus/chunks/tooltip-hover-button.json +106 -0
- package/corpus/chunks/tree-file-explorer.json +136 -0
- package/corpus/chunks/tree-table-basic.json +171 -0
- package/corpus/chunks/trial-banner.json +158 -0
- package/corpus/chunks/url-import-form.json +728 -0
- package/corpus/chunks/usage-quota-meter-card.json +217 -0
- package/corpus/chunks/user-identity-row.json +81 -0
- package/corpus/chunks/user-onboarding-checklist.json +301 -0
- package/corpus/chunks/user-profile-card.json +192 -0
- package/corpus/chunks/users-table-badge.json +135 -0
- package/corpus/chunks/verification-document-upload.json +179 -0
- package/corpus/chunks/verification-status.json +97 -0
- package/corpus/chunks/verification-stepper.json +111 -0
- package/corpus/chunks/video-player-controls.json +120 -0
- package/corpus/chunks/webhook-config.json +209 -0
- package/corpus/chunks/webhooks-list.json +204 -0
- package/corpus/chunks/wizard-drawer-three-step-wizard.json +443 -0
- package/corpus/manifest.d.ts +4 -0
- package/corpus/manifest.json +6 -0
- package/corpus/scripts/chunk-library.d.ts +4 -0
- package/corpus/scripts/chunk-library.js +335 -0
- package/node-shims.d.ts +48 -0
- package/package.json +215 -0
- package/retrieval/CHANGELOG.md +1073 -0
- package/retrieval/README.md +71 -0
- package/retrieval/anti-patterns.js +189 -0
- package/retrieval/authoring/index.d.ts +4 -0
- package/retrieval/authoring/index.js +9 -0
- package/retrieval/authoring/web-research.js +220 -0
- package/retrieval/catalog.js +250 -0
- package/retrieval/component-catalog.js +168 -0
- package/retrieval/component-entry.js +80 -0
- package/retrieval/context-assembler.js +174 -0
- package/retrieval/domain-router.js +417 -0
- package/retrieval/embedding/chunk-embedding-retriever.js +117 -0
- package/retrieval/embedding/embedding-provider.js +72 -0
- package/retrieval/embedding/index.d.ts +4 -0
- package/retrieval/embedding/index.js +2 -0
- package/retrieval/feedback/dialog-recorder.js +107 -0
- package/retrieval/feedback/feedback-analyzer.js +180 -0
- package/retrieval/feedback/feedback-store.js +194 -0
- package/retrieval/feedback/feedback.js +117 -0
- package/retrieval/feedback/gap-registry.js +80 -0
- package/retrieval/feedback/human-signal.js +113 -0
- package/retrieval/feedback/index.d.ts +4 -0
- package/retrieval/feedback/index.js +24 -0
- package/retrieval/feedback/submit-feedback.js +45 -0
- package/retrieval/index.d.ts +4 -0
- package/retrieval/index.js +53 -0
- package/retrieval/intent/clarity.js +139 -0
- package/retrieval/intent/decomposer.js +124 -0
- package/retrieval/intent/index.d.ts +4 -0
- package/retrieval/intent/index.js +18 -0
- package/retrieval/intent/intent-alignment.js +172 -0
- package/retrieval/intent/intent-categorizer.js +69 -0
- package/retrieval/intent/intent-gate.js +96 -0
- package/retrieval/intent/prompt-analyzer.js +162 -0
- package/retrieval/wiring-catalog.js +168 -0
- package/validate/catalog-validator.d.ts +4 -0
- package/validate/catalog-validator.js +327 -0
- package/validate/semantic/cache.js +54 -0
- package/validate/semantic/classify-intent.js +128 -0
- package/validate/semantic/index.js +163 -0
- package/validate/semantic/intent-specs.js +162 -0
- package/validate/semantic/judge.js +180 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# `@adia-ai/a2ui-retrieval`
|
|
2
|
+
|
|
3
|
+
Retrieval layer for the A2UI (Agent-to-UI) protocol — catalog lookup,
|
|
4
|
+
intent classification, domain routing, pattern + anti-pattern matching,
|
|
5
|
+
clarity + context assembly. Consumed by
|
|
6
|
+
[`@adia-ai/a2ui-compose`](../compose/) and any A2UI-protocol tooling
|
|
7
|
+
that needs to reason about user intent against the catalog.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @adia-ai/a2ui-retrieval
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## What's here
|
|
16
|
+
|
|
17
|
+
The package groups its 26 source files into 4 sub-concerns plus a
|
|
18
|
+
top-level lookup surface. Importers can pull the top-level barrel
|
|
19
|
+
(`@adia-ai/a2ui-retrieval`) for the previously-public surface, the
|
|
20
|
+
per-subdir barrels (`@adia-ai/a2ui-retrieval/intent` etc.), or
|
|
21
|
+
individual files for fine-grained imports.
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
a2ui-retrieval/
|
|
25
|
+
├── catalog.js top-level — catalog lookup (loaded from corpus)
|
|
26
|
+
├── pattern-library.js top-level — keyword + semantic pattern search
|
|
27
|
+
├── concept-mapper.js top-level — concept → catalog-entry mapping
|
|
28
|
+
├── domain-router.js top-level — intent → catalog-domain classifier
|
|
29
|
+
├── wiring-catalog.js top-level — controller / handler reference
|
|
30
|
+
├── anti-patterns.js top-level — known-bad pattern detector
|
|
31
|
+
├── context-assembler.js top-level — retrieval results → LLM context
|
|
32
|
+
├── component-entry.js top-level — catalog row serializer
|
|
33
|
+
├── index.js top-level — barrel
|
|
34
|
+
│
|
|
35
|
+
├── intent/ intent classification + decomposition
|
|
36
|
+
│ ├── intent-alignment.js
|
|
37
|
+
│ ├── intent-categorizer.js
|
|
38
|
+
│ ├── intent-gate.js UI-generating vs conversational
|
|
39
|
+
│ ├── prompt-analyzer.js
|
|
40
|
+
│ ├── decomposer.js compound intents → subtasks
|
|
41
|
+
│ └── clarity.js clarity scoring
|
|
42
|
+
│
|
|
43
|
+
├── embedding/ dense-vector retrieval
|
|
44
|
+
│ ├── embedding-provider.js adapter (Voyage / OpenAI / fallback)
|
|
45
|
+
│ ├── embedding-retriever.js top-N pattern retrieval
|
|
46
|
+
│ └── chunk-embedding-retriever.js chunk-level retrieval
|
|
47
|
+
│
|
|
48
|
+
├── feedback/ user-feedback ingestion loop
|
|
49
|
+
│ ├── feedback.js
|
|
50
|
+
│ ├── feedback-store.js JSONL store under .brain/feedback/
|
|
51
|
+
│ ├── feedback-analyzer.js
|
|
52
|
+
│ ├── dialog-recorder.js LLM round-trip capture (gated by env)
|
|
53
|
+
│ └── gap-registry.js tracked gaps in catalog coverage
|
|
54
|
+
│
|
|
55
|
+
└── authoring/ corpus-authoring helpers (upstream of retrieval)
|
|
56
|
+
├── synthetic-data.js
|
|
57
|
+
├── web-research.js
|
|
58
|
+
└── pattern-promotion.js
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Runtime
|
|
62
|
+
|
|
63
|
+
Framework-agnostic JS. Depends only on
|
|
64
|
+
[`@adia-ai/a2ui-runtime`](https://www.npmjs.com/package/@adia-ai/a2ui-runtime)
|
|
65
|
+
for the A2UI registry + runtime primitives.
|
|
66
|
+
|
|
67
|
+
## Links
|
|
68
|
+
|
|
69
|
+
- Repo: [`adiahealth/gen-ui-kit`](https://github.com/adiahealth/gen-ui-kit)
|
|
70
|
+
- Architecture: [`.claude/docs/specs/package-architecture.md`](https://github.com/adiahealth/gen-ui-kit/blob/main/docs/specs/package-architecture.md)
|
|
71
|
+
- CHANGELOG: [`CHANGELOG.md`](./CHANGELOG.md)
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anti-Pattern Registry — known bad patterns from AdiaUI best practices.
|
|
3
|
+
*
|
|
4
|
+
* Each anti-pattern has:
|
|
5
|
+
* - name: machine identifier
|
|
6
|
+
* - description: what the anti-pattern is
|
|
7
|
+
* - check: regex or function to detect it in HTML strings
|
|
8
|
+
* - fix: guidance on how to correct it
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { registry } from '@adia-ai/a2ui/registry';
|
|
12
|
+
import { getAllComponentData } from './component-catalog.js';
|
|
13
|
+
|
|
14
|
+
// `noInventedComponents`'s allowlist, below, used to be a hand-frozen Set —
|
|
15
|
+
// it drifted stale at least once in production (missing field-ui, a core
|
|
16
|
+
// primitive) before being "regenerated" as a one-time manual snapshot on
|
|
17
|
+
// 2026-06-10, which is itself already stale again. Built live instead, from
|
|
18
|
+
// the two sources every registered tag actually comes from:
|
|
19
|
+
// - `registry` (@adia-ai/a2ui) — the A2UI-emittable compose types
|
|
20
|
+
// (validator.js's checkAllTypesRegistered already imports this same Map).
|
|
21
|
+
// - `component-catalog.js`'s per-component `.a2ui.json` sidecars (the
|
|
22
|
+
// dual-mode Node/browser/static loader AGENTS.md names as the canonical
|
|
23
|
+
// pattern for this directory) — covers every component with a yaml SoT,
|
|
24
|
+
// including ones like agent-artifact-ui/aside-ui/preview-ui that exist
|
|
25
|
+
// but were never wired into the compose-emission registry.
|
|
26
|
+
// `CORE_INFRA_TAGS` covers the residual few real elements neither source
|
|
27
|
+
// carries: `router-ui` is defined directly in core/provider.js with no
|
|
28
|
+
// yaml/generated sidecar and is never an A2UI-emittable type.
|
|
29
|
+
const CORE_INFRA_TAGS = ['router-ui'];
|
|
30
|
+
|
|
31
|
+
function buildKnownTags() {
|
|
32
|
+
const tags = new Set(registry.values());
|
|
33
|
+
for (const data of Object.values(getAllComponentData())) {
|
|
34
|
+
const tag = data?.['x-adiaui']?.tag;
|
|
35
|
+
if (tag) tags.add(tag);
|
|
36
|
+
}
|
|
37
|
+
for (const tag of CORE_INFRA_TAGS) tags.add(tag);
|
|
38
|
+
return tags;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const KNOWN_TAGS = buildKnownTags();
|
|
42
|
+
|
|
43
|
+
const antiPatterns = [
|
|
44
|
+
{
|
|
45
|
+
name: 'noBareDivs',
|
|
46
|
+
description: 'All elements should be AdiaUI components, not bare <div> elements.',
|
|
47
|
+
check: /<div[\s>]/i,
|
|
48
|
+
fix: 'Replace <div> with the appropriate AdiaUI layout component: Row, Column, Grid, Card, or Section.',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'noBareInputs',
|
|
52
|
+
description: 'Form controls should use component wrappers, not native <input>/<select>/<textarea>.',
|
|
53
|
+
check: /<(input|select|textarea)[\s>]/i,
|
|
54
|
+
fix: 'Use input-ui, select-ui, textarea-ui, check-ui, switch-ui, slider-ui, or datetime-ui instead.',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'cardStructure',
|
|
58
|
+
description: 'Card children must follow the header/section/footer anatomy. Header and footer are direct children of card.',
|
|
59
|
+
check: (html) => {
|
|
60
|
+
// Detect section > header or section > footer (wrong nesting)
|
|
61
|
+
return /<section[^>]*>\s*<header/i.test(html) || /<section[^>]*>\s*<footer/i.test(html);
|
|
62
|
+
},
|
|
63
|
+
fix: 'Header and Footer must be direct children of Card, not nested inside Section. Structure: Card > Header + Section + Footer.',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'flatAdjacency',
|
|
67
|
+
description: 'AdiaUI uses flat component lists with ID references, not deeply nested component trees.',
|
|
68
|
+
check: (html) => {
|
|
69
|
+
// Heuristic: detect 5+ levels of nesting with AdiaUI components
|
|
70
|
+
const nested = html.match(/<[a-z]+-(?:n|ui)[^>]*>\s*<[a-z]+-(?:n|ui)[^>]*>\s*<[a-z]+-(?:n|ui)[^>]*>\s*<[a-z]+-(?:n|ui)[^>]*>\s*<[a-z]+-(?:n|ui)/i);
|
|
71
|
+
return !!nested;
|
|
72
|
+
},
|
|
73
|
+
fix: 'Use a flat adjacency list with unique IDs and children arrays referencing IDs.',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'columnWrap',
|
|
77
|
+
description: 'Content inside Section must be wrapped in a Column (col-ui), not placed directly.',
|
|
78
|
+
check: (html) => {
|
|
79
|
+
// Detect section > text-ui or section > p (without col-ui wrapper)
|
|
80
|
+
return /<section[^>]*>\s*<(text-ui|p |p>|h[1-6])/i.test(html);
|
|
81
|
+
},
|
|
82
|
+
fix: 'Wrap section content in <col-ui>: Section > Column > Text/content.',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'noHardcodedColors',
|
|
86
|
+
description: 'Use design token colors (--a-*) instead of hardcoded hex/rgb/hsl values.',
|
|
87
|
+
check: /(style\s*=\s*"[^"]*(?:color|background)\s*:\s*(?:#[0-9a-f]{3,8}|rgb|hsl))/i,
|
|
88
|
+
fix: 'Use token-based colors via variant attributes or CSS custom properties (--a-canvas-*, --a-primary-*, etc.).',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'noInlineLayout',
|
|
92
|
+
description: 'Use declarative layout attributes instead of inline display/flex/grid styles.',
|
|
93
|
+
check: /(style\s*=\s*"[^"]*(?:display\s*:|flex|grid-template))/i,
|
|
94
|
+
fix: 'Use Row, Column, Grid components with gap/columns attributes instead of inline CSS layout.',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'noInventedComponents',
|
|
98
|
+
description: 'Only use components from the AdiaUI registry. Do not invent custom component tags.',
|
|
99
|
+
check: (html) => {
|
|
100
|
+
const tags = html.match(/<([a-z]+-(?:n|ui))\b/gi) || [];
|
|
101
|
+
for (const match of tags) {
|
|
102
|
+
const tag = match.slice(1).toLowerCase();
|
|
103
|
+
if (!KNOWN_TAGS.has(tag)) return true;
|
|
104
|
+
}
|
|
105
|
+
return false;
|
|
106
|
+
},
|
|
107
|
+
fix: 'Only use registered AdiaUI types. Check the registry for available components.',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'noCssPropAttrs',
|
|
111
|
+
description: 'CSS properties (display, visibility) are not markup attributes. Components silently ignore unknown attributes, so display="none" content renders VISIBLY — overlapping its siblings.',
|
|
112
|
+
check: /\s(?:display|visibility)\s*=\s*"/i,
|
|
113
|
+
fix: 'Remove the attribute. To hide content conditionally, omit the element from the tree (or use the component\'s documented state attribute, e.g. [hidden] on plain containers).',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'inputTypeTextarea',
|
|
117
|
+
description: 'input-ui has no type="textarea" — multi-line input is its own component.',
|
|
118
|
+
check: /<input-ui[^>]*\btype\s*=\s*"textarea"/i,
|
|
119
|
+
fix: 'Use <textarea-ui rows="…"> for multi-line text input.',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'fieldOwnsLabelHintError',
|
|
123
|
+
description: 'field-ui OWNS the label / hint / error chrome via its label= / hint= / error= attributes. Emitting a sibling text-ui "label", a raw <label>, or a <small> error inside field-ui double-renders and breaks the label-to-control binding (field-ui binds the first slot-less child as the control — a text-ui label steals that binding).',
|
|
124
|
+
check: (html) => {
|
|
125
|
+
// LLM-emitted label-ish children inside field-ui. The stamped internal
|
|
126
|
+
// label carries data-field-label — exclude it so post-render HTML
|
|
127
|
+
// doesn't false-positive.
|
|
128
|
+
if (/<field-ui[^>]*>\s*(?:<text-ui[^>]*variant\s*=\s*"label"|<label(?![^>]*data-field-label))/i.test(html)) return true;
|
|
129
|
+
// <small> is not an AdiaUI component anywhere; inside field-ui it is
|
|
130
|
+
// always a hand-rolled error line.
|
|
131
|
+
return /<field-ui[^>]*>[\s\S]*?<small[\s>]/i.test(html);
|
|
132
|
+
},
|
|
133
|
+
fix: 'Use <field-ui label="Full Name" hint="…" error="…"><input-ui …/></field-ui> — exactly ONE slot-less child (the control); field-ui renders the label, hint, and error itself.',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: 'slotOnContainer',
|
|
137
|
+
description: 'Slot attributes (slot="heading", slot="description", slot="action") must go on the content children inside Header/Footer, not on Header/Footer elements themselves.',
|
|
138
|
+
check: (html) => {
|
|
139
|
+
return /<header[^>]*\bslot\s*=/i.test(html) || /<footer[^>]*\bslot\s*=/i.test(html);
|
|
140
|
+
},
|
|
141
|
+
fix: 'Move slot="heading" from <header> to the Text/heading child inside it. Header is a grid container — slots go on its children.',
|
|
142
|
+
},
|
|
143
|
+
];
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Get all registered anti-patterns.
|
|
147
|
+
* @returns {Array<{name: string, description: string, fix: string}>}
|
|
148
|
+
*/
|
|
149
|
+
export function getAntiPatterns() {
|
|
150
|
+
return antiPatterns.map(({ name, description, fix }) => ({ name, description, fix }));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Check an HTML string against a specific anti-pattern.
|
|
155
|
+
*
|
|
156
|
+
* @param {string} name — Anti-pattern name
|
|
157
|
+
* @param {string} html — HTML string to check
|
|
158
|
+
* @returns {{ violated: boolean, name: string, description: string, fix: string } | null}
|
|
159
|
+
* Returns the violation object if detected, null if the pattern name is unknown.
|
|
160
|
+
*/
|
|
161
|
+
export function checkAntiPattern(name, html) {
|
|
162
|
+
const pattern = antiPatterns.find(p => p.name === name);
|
|
163
|
+
if (!pattern) return null;
|
|
164
|
+
|
|
165
|
+
const violated = typeof pattern.check === 'function'
|
|
166
|
+
? pattern.check(html)
|
|
167
|
+
: pattern.check.test(html);
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
violated,
|
|
171
|
+
name: pattern.name,
|
|
172
|
+
description: pattern.description,
|
|
173
|
+
fix: pattern.fix,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Check HTML against all anti-patterns. Returns only violations.
|
|
179
|
+
*
|
|
180
|
+
* @param {string} html — HTML string to check
|
|
181
|
+
* @returns {Array<{name: string, description: string, fix: string}>}
|
|
182
|
+
*/
|
|
183
|
+
export function checkAllAntiPatterns(html) {
|
|
184
|
+
return antiPatterns
|
|
185
|
+
.filter(p => {
|
|
186
|
+
return typeof p.check === 'function' ? p.check(html) : p.check.test(html);
|
|
187
|
+
})
|
|
188
|
+
.map(({ name, description, fix }) => ({ name, description, fix }));
|
|
189
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @adia-ai/gen-ui/retrieval/authoring — corpus authoring helpers.
|
|
3
|
+
*
|
|
4
|
+
* Web-research helpers used by `compose/core/generator.js` to enrich
|
|
5
|
+
* intent before generation. Synthetic-data + pattern-promotion retired
|
|
6
|
+
* in §64 alongside `pattern-library.js`.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from './web-research.js';
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web Research — Enriches generation context with web search results.
|
|
3
|
+
*
|
|
4
|
+
* Detects reference mentions in intents ("like Stripe", "Notion-style"),
|
|
5
|
+
* generates targeted search queries, fetches results, and extracts
|
|
6
|
+
* UI-relevant patterns to feed into the generation prompt.
|
|
7
|
+
*
|
|
8
|
+
* Works with any search function that matches:
|
|
9
|
+
* search(query) → Promise<{ results: { title, snippet, url }[] }>
|
|
10
|
+
*
|
|
11
|
+
* Falls back to LLM knowledge when no search function is provided.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// ── Reference detection ──────────────────────────────────────────────────
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Patterns split by signal strength:
|
|
18
|
+
*
|
|
19
|
+
* EXPLICIT_PATTERNS — the surrounding language declares the captured
|
|
20
|
+
* token IS a brand reference ("like X", "X-style", "similar to X").
|
|
21
|
+
* The capture is accepted as a reference even if not in KNOWN_REFERENCES.
|
|
22
|
+
*
|
|
23
|
+
* IMPLICIT_PATTERNS — the surrounding language is a UI-shape verb
|
|
24
|
+
* ("X pricing page"); the capture COULD be a brand or COULD be a
|
|
25
|
+
* generic noun. Accept ONLY if in KNOWN_REFERENCES, otherwise drop.
|
|
26
|
+
*
|
|
27
|
+
* Splitting this way fixes the 2026-05-02 bug where "tier pricing page"
|
|
28
|
+
* extracted "tier" as a reference and seeded a research query for it. The
|
|
29
|
+
* regex was working as designed — `\w+ pricing page` captures the prefix
|
|
30
|
+
* word — but a generic noun like "tier" or "subscription" or "fancy"
|
|
31
|
+
* isn't a brand reference, so research and downstream prompt enrichment
|
|
32
|
+
* shouldn't act on it.
|
|
33
|
+
*/
|
|
34
|
+
const EXPLICIT_PATTERNS = [
|
|
35
|
+
/\blike\s+(\w[\w\s]*?)(?:\s*['']s|\s+style|\s+design|\s*$)/i,
|
|
36
|
+
/\b(\w[\w\s]*?)[\s-]style\b/i,
|
|
37
|
+
/\b(\w[\w\s]*?)[\s-]inspired\b/i,
|
|
38
|
+
/\bsimilar\s+to\s+(\w[\w\s]*?)(?:\s|$|,)/i,
|
|
39
|
+
/\bbased\s+on\s+(\w[\w\s]*?)(?:\s|$|,)/i,
|
|
40
|
+
/\bcopy\s+(\w[\w\s]*?)(?:\s|$|,)/i,
|
|
41
|
+
/\bclone\s+(\w[\w\s]*?)(?:\s|$|,)/i,
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
const IMPLICIT_PATTERNS = [
|
|
45
|
+
/\b(\w+)\s+(?:pricing|dashboard|landing|login|settings|profile)\s+page\b/i,
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
/** Well-known product/brand names for UI reference */
|
|
49
|
+
const KNOWN_REFERENCES = new Set([
|
|
50
|
+
'stripe', 'notion', 'linear', 'figma', 'slack', 'discord', 'spotify',
|
|
51
|
+
'github', 'vercel', 'netlify', 'supabase', 'firebase', 'tailwind',
|
|
52
|
+
'shadcn', 'radix', 'chakra', 'material', 'ant', 'bootstrap',
|
|
53
|
+
'shopify', 'airbnb', 'uber', 'twitter', 'instagram', 'dribbble',
|
|
54
|
+
'apple', 'google', 'microsoft', 'amazon', 'netflix',
|
|
55
|
+
]);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Detect product/brand references in an intent.
|
|
59
|
+
*
|
|
60
|
+
* @param {string} intent
|
|
61
|
+
* @returns {{ references: string[], queries: string[] }}
|
|
62
|
+
*/
|
|
63
|
+
export function detectReferences(intent) {
|
|
64
|
+
const references = [];
|
|
65
|
+
const lower = intent.toLowerCase();
|
|
66
|
+
|
|
67
|
+
// Explicit-signal patterns — accept the capture as a reference.
|
|
68
|
+
for (const pattern of EXPLICIT_PATTERNS) {
|
|
69
|
+
const match = intent.match(pattern);
|
|
70
|
+
if (match) {
|
|
71
|
+
let ref = (match[1] || '').trim();
|
|
72
|
+
ref = ref.replace(/^(the|a|an)\s+/i, '');
|
|
73
|
+
if (ref && ref.length > 1 && ref.length < 30) {
|
|
74
|
+
references.push(ref);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Implicit-signal patterns — gate by KNOWN_REFERENCES so generic nouns
|
|
80
|
+
// ("tier", "fancy", "simple") don't get treated as brands.
|
|
81
|
+
for (const pattern of IMPLICIT_PATTERNS) {
|
|
82
|
+
const match = intent.match(pattern);
|
|
83
|
+
if (match) {
|
|
84
|
+
let ref = (match[1] || '').trim();
|
|
85
|
+
ref = ref.replace(/^(the|a|an)\s+/i, '');
|
|
86
|
+
if (ref && ref.length > 1 && ref.length < 30 && KNOWN_REFERENCES.has(ref.toLowerCase())) {
|
|
87
|
+
references.push(ref);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Direct brand name detection (only as whole words)
|
|
93
|
+
for (const brand of KNOWN_REFERENCES) {
|
|
94
|
+
const re = new RegExp(`\\b${brand}\\b`, 'i');
|
|
95
|
+
if (re.test(lower) && !references.some(r => r.toLowerCase() === brand)) {
|
|
96
|
+
references.push(brand);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Filter out non-brand captures from the explicit patterns — words like
|
|
101
|
+
// "inspired" can sneak through when the intent is "X-inspired" with no
|
|
102
|
+
// X (e.g. "is this AI-inspired?"). Belt and suspenders.
|
|
103
|
+
const NON_BRANDS = new Set(['inspired', 'style', 'based', 'like', 'similar', 'the']);
|
|
104
|
+
for (let i = references.length - 1; i >= 0; i--) {
|
|
105
|
+
if (NON_BRANDS.has(references[i].toLowerCase())) references.splice(i, 1);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Generate search queries from references + intent context
|
|
109
|
+
const queries = [];
|
|
110
|
+
const uniqueRefs = [...new Set(references.map(r => r.toLowerCase()))];
|
|
111
|
+
|
|
112
|
+
for (const ref of uniqueRefs.slice(0, 2)) {
|
|
113
|
+
// Extract the UI type from the intent
|
|
114
|
+
const uiType = extractUIType(intent);
|
|
115
|
+
if (uiType) {
|
|
116
|
+
queries.push(`${ref} ${uiType} UI design components`);
|
|
117
|
+
} else {
|
|
118
|
+
queries.push(`${ref} UI design pattern layout`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// If no references but intent mentions specific UI patterns
|
|
123
|
+
if (queries.length === 0) {
|
|
124
|
+
const uiType = extractUIType(intent);
|
|
125
|
+
if (uiType && intent.split(/\s+/).length < 6) {
|
|
126
|
+
// Short intent about a UI type — search for best practices
|
|
127
|
+
queries.push(`best ${uiType} UI design patterns 2024`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return { references: uniqueRefs, queries };
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Extract the UI type/pattern from an intent (pricing, dashboard, login, etc.)
|
|
136
|
+
*/
|
|
137
|
+
function extractUIType(intent) {
|
|
138
|
+
const lower = intent.toLowerCase();
|
|
139
|
+
const types = [
|
|
140
|
+
'pricing', 'dashboard', 'landing page', 'login', 'signup', 'settings',
|
|
141
|
+
'profile', 'onboarding', 'checkout', 'notification', 'kanban', 'calendar',
|
|
142
|
+
'chat', 'sidebar', 'navbar', 'hero', 'footer', 'table', 'form',
|
|
143
|
+
'modal', 'card', 'timeline', 'analytics', 'admin',
|
|
144
|
+
];
|
|
145
|
+
return types.find(t => lower.includes(t)) || null;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Research UI patterns for an intent using web search.
|
|
150
|
+
*
|
|
151
|
+
* @param {string} intent — User's generation intent
|
|
152
|
+
* @param {object} [options]
|
|
153
|
+
* @param {(query: string) => Promise<{ results: { title: string, snippet: string, url: string }[] }>} [options.search] — Search function
|
|
154
|
+
* @param {object} [options.llmAdapter] — LLM adapter for summarization
|
|
155
|
+
* @returns {Promise<{ references: string[], insights: string[], searchResults: object[], context: string }>}
|
|
156
|
+
*/
|
|
157
|
+
export async function researchIntent(intent, options = {}) {
|
|
158
|
+
const { search, llmAdapter } = options;
|
|
159
|
+
const { references, queries } = detectReferences(intent);
|
|
160
|
+
|
|
161
|
+
// No references and no search → return empty
|
|
162
|
+
if (references.length === 0 && queries.length === 0) {
|
|
163
|
+
return { references: [], insights: [], searchResults: [], context: '' };
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// ── Fetch search results ──
|
|
167
|
+
const searchResults = [];
|
|
168
|
+
if (search && queries.length > 0) {
|
|
169
|
+
for (const query of queries.slice(0, 2)) {
|
|
170
|
+
try {
|
|
171
|
+
const result = await search(query);
|
|
172
|
+
if (result?.results?.length) {
|
|
173
|
+
searchResults.push(...result.results.slice(0, 3));
|
|
174
|
+
}
|
|
175
|
+
} catch {
|
|
176
|
+
// Search failed — continue without it
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// ── Build context from results ──
|
|
182
|
+
const insights = [];
|
|
183
|
+
|
|
184
|
+
if (searchResults.length > 0) {
|
|
185
|
+
// Extract UI-relevant snippets
|
|
186
|
+
for (const result of searchResults) {
|
|
187
|
+
if (result.snippet) {
|
|
188
|
+
insights.push(`${result.title}: ${result.snippet}`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// ── LLM-powered reference description (when search has no results) ──
|
|
194
|
+
if (insights.length === 0 && llmAdapter && references.length > 0) {
|
|
195
|
+
try {
|
|
196
|
+
const refList = references.join(', ');
|
|
197
|
+
const uiType = extractUIType(intent) || 'UI';
|
|
198
|
+
const response = await llmAdapter.complete({
|
|
199
|
+
messages: [{ role: 'user', content: `Briefly describe the ${uiType} design of ${refList}. Focus on: layout structure, key components, visual hierarchy, and interaction patterns. 3-4 sentences max.` }],
|
|
200
|
+
systemPrompt: 'You are a UI design expert. Give concise, factual descriptions of well-known product UIs. Focus on structure and components, not opinions.',
|
|
201
|
+
});
|
|
202
|
+
if (response.content) {
|
|
203
|
+
insights.push(response.content);
|
|
204
|
+
}
|
|
205
|
+
} catch {
|
|
206
|
+
// LLM failed — continue without it
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// ── Compile context string for the generation prompt ──
|
|
211
|
+
let context = '';
|
|
212
|
+
if (references.length > 0) {
|
|
213
|
+
context += `Reference designs: ${references.join(', ')}\n`;
|
|
214
|
+
}
|
|
215
|
+
if (insights.length > 0) {
|
|
216
|
+
context += `Design insights:\n${insights.map(i => `- ${i}`).join('\n')}`;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return { references, insights, searchResults, context };
|
|
220
|
+
}
|