@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,113 @@
|
|
|
1
|
+
const THUMB_UP_MIN = 4;
|
|
2
|
+
const HUMAN_WEIGHT = 0.7;
|
|
3
|
+
const SELF_WEIGHT = 0.3;
|
|
4
|
+
function isType(entry, type) {
|
|
5
|
+
return entry["type"] === type;
|
|
6
|
+
}
|
|
7
|
+
function num(value) {
|
|
8
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
9
|
+
}
|
|
10
|
+
function str(value) {
|
|
11
|
+
return typeof value === "string" && value ? value : void 0;
|
|
12
|
+
}
|
|
13
|
+
function summarizeRatings(entries) {
|
|
14
|
+
const ratings = entries.filter((e) => isType(e, "rating"));
|
|
15
|
+
const up = ratings.filter((r) => (num(r["rating"]) ?? 0) >= THUMB_UP_MIN).length;
|
|
16
|
+
const down = ratings.length - up;
|
|
17
|
+
return {
|
|
18
|
+
up,
|
|
19
|
+
down,
|
|
20
|
+
total: ratings.length,
|
|
21
|
+
thumbUpRate: ratings.length > 0 ? Math.round(up / ratings.length * 100) : 0
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function ratingDomain(rating, execDomainById) {
|
|
25
|
+
return str(rating["domain"]) ?? execDomainById.get(str(rating["executionId"]) ?? "");
|
|
26
|
+
}
|
|
27
|
+
function rankWeakDomains(entries, { limit = 10 } = {}) {
|
|
28
|
+
const executions = entries.filter((e) => isType(e, "execution"));
|
|
29
|
+
const ratings = entries.filter((e) => isType(e, "rating"));
|
|
30
|
+
const execDomainById = /* @__PURE__ */ new Map();
|
|
31
|
+
for (const e of executions) {
|
|
32
|
+
const id = str(e["executionId"]);
|
|
33
|
+
const domain = str(e["domain"]);
|
|
34
|
+
if (id && domain) execDomainById.set(id, domain);
|
|
35
|
+
}
|
|
36
|
+
const buckets = /* @__PURE__ */ new Map();
|
|
37
|
+
const bucket = (domain) => {
|
|
38
|
+
let b = buckets.get(domain);
|
|
39
|
+
if (!b) {
|
|
40
|
+
b = { executions: 0, totalScore: 0, scoreSamples: 0, up: 0, down: 0 };
|
|
41
|
+
buckets.set(domain, b);
|
|
42
|
+
}
|
|
43
|
+
return b;
|
|
44
|
+
};
|
|
45
|
+
const addScore = (b, value) => {
|
|
46
|
+
const s = num(value);
|
|
47
|
+
if (s === void 0) return;
|
|
48
|
+
b.totalScore += s;
|
|
49
|
+
b.scoreSamples++;
|
|
50
|
+
};
|
|
51
|
+
for (const e of executions) {
|
|
52
|
+
const b = bucket(str(e["domain"]) ?? "unknown");
|
|
53
|
+
b.executions++;
|
|
54
|
+
addScore(b, e["score"]);
|
|
55
|
+
}
|
|
56
|
+
for (const r of ratings) {
|
|
57
|
+
const b = bucket(ratingDomain(r, execDomainById) ?? "unknown");
|
|
58
|
+
if ((num(r["rating"]) ?? 0) >= THUMB_UP_MIN) b.up++;
|
|
59
|
+
else b.down++;
|
|
60
|
+
addScore(b, r["score"]);
|
|
61
|
+
}
|
|
62
|
+
const ranked = [];
|
|
63
|
+
for (const [domain, b] of buckets) {
|
|
64
|
+
const humanRatings = b.up + b.down;
|
|
65
|
+
if (b.executions === 0 && humanRatings === 0) continue;
|
|
66
|
+
const hasSelf = b.scoreSamples > 0;
|
|
67
|
+
const hasHuman = humanRatings > 0;
|
|
68
|
+
const selfScore = hasSelf ? Math.round(b.totalScore / b.scoreSamples) : 0;
|
|
69
|
+
const humanScore = hasHuman ? Math.round(b.up / humanRatings * 100) : 0;
|
|
70
|
+
let blendedScore;
|
|
71
|
+
let signal;
|
|
72
|
+
if (hasHuman && hasSelf) {
|
|
73
|
+
blendedScore = Math.round(HUMAN_WEIGHT * humanScore + SELF_WEIGHT * selfScore);
|
|
74
|
+
signal = "human+self";
|
|
75
|
+
} else if (hasHuman) {
|
|
76
|
+
blendedScore = humanScore;
|
|
77
|
+
signal = "human";
|
|
78
|
+
} else if (hasSelf) {
|
|
79
|
+
blendedScore = selfScore;
|
|
80
|
+
signal = "self-only";
|
|
81
|
+
} else {
|
|
82
|
+
blendedScore = 0;
|
|
83
|
+
signal = "none";
|
|
84
|
+
}
|
|
85
|
+
ranked.push({
|
|
86
|
+
domain,
|
|
87
|
+
executions: b.executions,
|
|
88
|
+
selfScore,
|
|
89
|
+
selfScoreSamples: b.scoreSamples,
|
|
90
|
+
humanRatings,
|
|
91
|
+
humanScore,
|
|
92
|
+
blendedScore,
|
|
93
|
+
signal
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
ranked.sort((a, b) => {
|
|
97
|
+
const aNone = a.signal === "none";
|
|
98
|
+
const bNone = b.signal === "none";
|
|
99
|
+
if (aNone !== bNone) return aNone ? 1 : -1;
|
|
100
|
+
if (aNone) return b.executions - a.executions;
|
|
101
|
+
return a.blendedScore - b.blendedScore || b.humanRatings - a.humanRatings;
|
|
102
|
+
});
|
|
103
|
+
return ranked.slice(0, limit);
|
|
104
|
+
}
|
|
105
|
+
const WEIGHTING_RULE = `blendedScore = ${HUMAN_WEIGHT} * humanScore + ${SELF_WEIGHT} * selfScore when a domain has BOTH signals; humanScore alone when it has no self-grade; selfScore alone when it has no thumbs; signal 'none' when it has neither \u2014 those are unranked and sort after every ranked domain, not at the weak end. A missing signal is not a zero. Human thumb outweighs the self-grade on conflict. selfScore averages execution scores plus any score carried inline on a rating; engine/strategy are recorded for triage but are not ranked on.`;
|
|
106
|
+
export {
|
|
107
|
+
HUMAN_WEIGHT,
|
|
108
|
+
SELF_WEIGHT,
|
|
109
|
+
THUMB_UP_MIN,
|
|
110
|
+
WEIGHTING_RULE,
|
|
111
|
+
rankWeakDomains,
|
|
112
|
+
summarizeRatings
|
|
113
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { feedbackStore } from "./feedback-store.js";
|
|
2
|
+
import { submitFeedback, FeedbackValidationError } from "./submit-feedback.js";
|
|
3
|
+
import { rankWeakDomains, summarizeRatings, HUMAN_WEIGHT, SELF_WEIGHT, THUMB_UP_MIN, WEIGHTING_RULE } from "./human-signal.js";
|
|
4
|
+
import { FeedbackAnalyzer } from "./feedback-analyzer.js";
|
|
5
|
+
export * from "./feedback.js";
|
|
6
|
+
import { recordTurn, isRecording } from "./dialog-recorder.js";
|
|
7
|
+
import { loadGaps, addGap, updateGapStatus } from "./gap-registry.js";
|
|
8
|
+
export {
|
|
9
|
+
FeedbackAnalyzer,
|
|
10
|
+
FeedbackValidationError,
|
|
11
|
+
HUMAN_WEIGHT,
|
|
12
|
+
SELF_WEIGHT,
|
|
13
|
+
THUMB_UP_MIN,
|
|
14
|
+
WEIGHTING_RULE,
|
|
15
|
+
addGap,
|
|
16
|
+
feedbackStore,
|
|
17
|
+
isRecording,
|
|
18
|
+
loadGaps,
|
|
19
|
+
rankWeakDomains,
|
|
20
|
+
recordTurn,
|
|
21
|
+
submitFeedback,
|
|
22
|
+
summarizeRatings,
|
|
23
|
+
updateGapStatus
|
|
24
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { feedbackStore } from "./feedback-store.js";
|
|
2
|
+
import { THUMB_UP_MIN } from "./human-signal.js";
|
|
3
|
+
class FeedbackValidationError extends Error {
|
|
4
|
+
status = 400;
|
|
5
|
+
name = "FeedbackValidationError";
|
|
6
|
+
}
|
|
7
|
+
const MAX_TEXT = 2e3;
|
|
8
|
+
function text(value, max = MAX_TEXT) {
|
|
9
|
+
if (typeof value !== "string") return void 0;
|
|
10
|
+
const trimmed = value.trim();
|
|
11
|
+
return trimmed ? trimmed.slice(0, max) : void 0;
|
|
12
|
+
}
|
|
13
|
+
function score(value) {
|
|
14
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return void 0;
|
|
15
|
+
return Math.max(0, Math.min(100, Math.round(value)));
|
|
16
|
+
}
|
|
17
|
+
async function submitFeedback(input) {
|
|
18
|
+
const executionId = text(input?.executionId, 200);
|
|
19
|
+
if (!executionId) throw new FeedbackValidationError("executionId is required");
|
|
20
|
+
const rating = typeof input?.rating === "number" && Number.isFinite(input.rating) ? Math.round(input.rating) : NaN;
|
|
21
|
+
if (!(rating >= 1 && rating <= 5)) throw new FeedbackValidationError("rating must be a number 1-5");
|
|
22
|
+
const source = text(input?.source, 60) ?? "unknown";
|
|
23
|
+
await feedbackStore.logRating({
|
|
24
|
+
executionId,
|
|
25
|
+
rating,
|
|
26
|
+
intent: text(input?.intent) ?? "",
|
|
27
|
+
domain: text(input?.domain, 120),
|
|
28
|
+
engine: text(input?.engine, 60),
|
|
29
|
+
strategy: text(input?.strategy, 60),
|
|
30
|
+
score: score(input?.score),
|
|
31
|
+
source,
|
|
32
|
+
notes: text(input?.notes)
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
recorded: true,
|
|
36
|
+
executionId,
|
|
37
|
+
rating,
|
|
38
|
+
thumb: rating >= THUMB_UP_MIN ? "up" : "down",
|
|
39
|
+
source
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
FeedbackValidationError,
|
|
44
|
+
submitFeedback
|
|
45
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getCatalog,
|
|
3
|
+
getComponent,
|
|
4
|
+
getComponentsByCategory,
|
|
5
|
+
getTraits,
|
|
6
|
+
getTraitsByCategory,
|
|
7
|
+
getFullCatalog
|
|
8
|
+
} from "./catalog.js";
|
|
9
|
+
import { serializeEntry } from "./component-entry.js";
|
|
10
|
+
import { getAntiPatterns, checkAntiPattern, checkAllAntiPatterns } from "./anti-patterns.js";
|
|
11
|
+
import { classifyIntent, getDomain, getAllDomains } from "./domain-router.js";
|
|
12
|
+
import { isConversational } from "./intent/intent-gate.js";
|
|
13
|
+
import { assessClarity } from "./intent/clarity.js";
|
|
14
|
+
import { detectReferences, researchIntent } from "./authoring/web-research.js";
|
|
15
|
+
import { assembleContext } from "./context-assembler.js";
|
|
16
|
+
import { getComponentData, getAllComponentData } from "./component-catalog.js";
|
|
17
|
+
import {
|
|
18
|
+
extractExpectations,
|
|
19
|
+
verifyAlignment,
|
|
20
|
+
checkIntentAlignment
|
|
21
|
+
} from "./intent/intent-alignment.js";
|
|
22
|
+
import { decomposeIntent, composeSubtasks } from "./intent/decomposer.js";
|
|
23
|
+
import { getWiringCatalog, getControllerInfo, getHandlerInfo } from "./wiring-catalog.js";
|
|
24
|
+
export {
|
|
25
|
+
assembleContext,
|
|
26
|
+
assessClarity,
|
|
27
|
+
checkAllAntiPatterns,
|
|
28
|
+
checkAntiPattern,
|
|
29
|
+
checkIntentAlignment,
|
|
30
|
+
classifyIntent,
|
|
31
|
+
composeSubtasks,
|
|
32
|
+
decomposeIntent,
|
|
33
|
+
detectReferences,
|
|
34
|
+
extractExpectations,
|
|
35
|
+
getAllComponentData,
|
|
36
|
+
getAllDomains,
|
|
37
|
+
getAntiPatterns,
|
|
38
|
+
getCatalog,
|
|
39
|
+
getComponent,
|
|
40
|
+
getComponentData,
|
|
41
|
+
getComponentsByCategory,
|
|
42
|
+
getControllerInfo,
|
|
43
|
+
getDomain,
|
|
44
|
+
getFullCatalog,
|
|
45
|
+
getHandlerInfo,
|
|
46
|
+
getTraits,
|
|
47
|
+
getTraitsByCategory,
|
|
48
|
+
getWiringCatalog,
|
|
49
|
+
isConversational,
|
|
50
|
+
researchIntent,
|
|
51
|
+
serializeEntry,
|
|
52
|
+
verifyAlignment
|
|
53
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { classifyIntent } from "../domain-router.js";
|
|
2
|
+
import { searchAll as searchCompositions } from "../../compose/strategies/zettel/composition-library.js";
|
|
3
|
+
const SCOPE_SIGNALS = [
|
|
4
|
+
/\b\d+\b/,
|
|
5
|
+
// contains a number
|
|
6
|
+
/\b(three|two|four|five|six)\b/i,
|
|
7
|
+
// spelled-out numbers
|
|
8
|
+
/\b(with|containing|including|showing|displaying)\b/i,
|
|
9
|
+
// enumerates content
|
|
10
|
+
/\b(and|plus|also)\b/i,
|
|
11
|
+
// multiple items
|
|
12
|
+
/\b(columns?|rows?|items?|cards?|sections?|fields?|buttons?|tabs?|steps?)\b/i
|
|
13
|
+
// structural counts
|
|
14
|
+
];
|
|
15
|
+
const CONTENT_SIGNALS = [
|
|
16
|
+
/\b(name|email|password|title|description|price|date|status|role|avatar)\b/i,
|
|
17
|
+
/\b(revenue|users|growth|sales|orders|metrics|analytics)\b/i,
|
|
18
|
+
/\b(todo|done|in progress|pending|active|completed)\b/i,
|
|
19
|
+
/\b(bleed|margin|trim|crop|preview|artwork|brand|design system)\b/i,
|
|
20
|
+
/\b(approved|approval|production|settings|configure|preference)\b/i,
|
|
21
|
+
/["'][\w\s]+["']/,
|
|
22
|
+
// quoted strings (specific labels)
|
|
23
|
+
/\$[\d,.]+/,
|
|
24
|
+
// dollar amounts
|
|
25
|
+
/\d+%/
|
|
26
|
+
// percentages
|
|
27
|
+
];
|
|
28
|
+
const LAYOUT_SIGNALS = [
|
|
29
|
+
/\b(grid|row|column|sidebar|split|horizontal|vertical|stack|centered)\b/i,
|
|
30
|
+
/\b(full.?width|responsive|mobile|compact|wide|narrow)\b/i,
|
|
31
|
+
/\b(\d+.?col(umn)?s?)\b/i,
|
|
32
|
+
// "3 columns", "2-col"
|
|
33
|
+
/\b(left|right|top|bottom|center)\b/i
|
|
34
|
+
];
|
|
35
|
+
const ACTION_SIGNALS = [
|
|
36
|
+
/\b(button|submit|cancel|save|delete|edit|close|open|toggle|click)\b/i,
|
|
37
|
+
/\b(form|input|select|search|filter|sort|upload|download)\b/i,
|
|
38
|
+
/\b(login|signup|register|checkout|confirm|approve|reject)\b/i,
|
|
39
|
+
/\b(navigate|link|redirect|route)\b/i,
|
|
40
|
+
/\b(drag|drop|resize|expand|collapse)\b/i
|
|
41
|
+
];
|
|
42
|
+
function assessClarity(intent, classification) {
|
|
43
|
+
const text = (intent ?? "").trim();
|
|
44
|
+
if (!text) {
|
|
45
|
+
return {
|
|
46
|
+
clear: false,
|
|
47
|
+
score: 0,
|
|
48
|
+
dimensions: { domain: 0, scope: 0, content: 0, layout: 0, action: 0 },
|
|
49
|
+
questions: [{ text: "What would you like me to build?", dimension: "domain", priority: 1 }],
|
|
50
|
+
summary: "No intent provided"
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const cls = classification || classifyIntent(text);
|
|
54
|
+
const compositionMatches = searchCompositions(text);
|
|
55
|
+
const wordCount = text.split(/\s+/).length;
|
|
56
|
+
const domainScore = cls.confidence >= 0.3 ? 1 : cls.confidence >= 0.15 ? 0.6 : cls.matchedSignals.length > 0 ? 0.3 : 0;
|
|
57
|
+
const scopeHits = SCOPE_SIGNALS.filter((r) => r.test(text)).length;
|
|
58
|
+
const scopeScore = Math.min(1, scopeHits / 2);
|
|
59
|
+
const contentHits = CONTENT_SIGNALS.filter((r) => r.test(text)).length;
|
|
60
|
+
const contentScore = Math.min(1, contentHits / 2);
|
|
61
|
+
const layoutHits = LAYOUT_SIGNALS.filter((r) => r.test(text)).length;
|
|
62
|
+
const layoutScore = Math.min(1, layoutHits);
|
|
63
|
+
const actionHits = ACTION_SIGNALS.filter((r) => r.test(text)).length;
|
|
64
|
+
const actionScore = Math.min(1, actionHits / 2);
|
|
65
|
+
const score = domainScore * 0.25 + scopeScore * 0.25 + contentScore * 0.2 + layoutScore * 0.15 + actionScore * 0.15;
|
|
66
|
+
const patternBonus = compositionMatches.length > 0 ? 0.15 : 0;
|
|
67
|
+
const lengthBonus = wordCount > 10 ? 0.1 : wordCount > 6 ? 0.05 : 0;
|
|
68
|
+
const finalScore = Math.min(1, score + patternBonus + lengthBonus);
|
|
69
|
+
const questions = [];
|
|
70
|
+
if (domainScore < 0.3) {
|
|
71
|
+
questions.push({
|
|
72
|
+
text: "What type of UI is this? (e.g., a form, dashboard, profile card, settings page)",
|
|
73
|
+
dimension: "domain",
|
|
74
|
+
priority: 1
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (scopeScore < 0.5) {
|
|
78
|
+
const domainQuestions = {
|
|
79
|
+
forms: "What fields should the form include?",
|
|
80
|
+
data: "What data should be displayed? How many items or metrics?",
|
|
81
|
+
layout: "How many sections or cards should it have?",
|
|
82
|
+
agent: "What actions should the assistant support?",
|
|
83
|
+
navigation: "What pages or sections should be navigable?"
|
|
84
|
+
};
|
|
85
|
+
questions.push({
|
|
86
|
+
text: domainQuestions[cls.domain] ?? "Can you be more specific about what it should contain?",
|
|
87
|
+
dimension: "scope",
|
|
88
|
+
priority: 2
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (contentScore < 0.3 && scopeScore >= 0.3) {
|
|
92
|
+
const contentQuestions = {
|
|
93
|
+
forms: 'What labels should the fields have? (e.g., "Email", "Password", "Full Name")',
|
|
94
|
+
data: "What metrics or values should be shown? (e.g., revenue, users, growth rate)",
|
|
95
|
+
layout: "What content goes in each section?",
|
|
96
|
+
agent: "What kind of messages or responses should be shown?",
|
|
97
|
+
navigation: "What should the menu items or links be labeled?"
|
|
98
|
+
};
|
|
99
|
+
questions.push({
|
|
100
|
+
text: contentQuestions[cls.domain] ?? "What specific content should be displayed?",
|
|
101
|
+
dimension: "content",
|
|
102
|
+
priority: 3
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
if (layoutScore < 0.3 && scopeScore >= 0.5) {
|
|
106
|
+
questions.push({
|
|
107
|
+
text: "Any layout preference? (e.g., grid of cards, single column, sidebar + content)",
|
|
108
|
+
dimension: "layout",
|
|
109
|
+
priority: 4
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if (actionScore < 0.3 && domainScore >= 0.3) {
|
|
113
|
+
questions.push({
|
|
114
|
+
text: "What actions should users be able to take? (e.g., submit, edit, delete, filter)",
|
|
115
|
+
dimension: "action",
|
|
116
|
+
priority: 5
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
questions.sort((a, b) => a.priority - b.priority);
|
|
120
|
+
const topQuestions = questions.slice(0, 3);
|
|
121
|
+
const clear = finalScore >= 0.4;
|
|
122
|
+
const summary = clear ? `Intent is ${finalScore >= 0.7 ? "clear" : "adequate"} (${Math.round(finalScore * 100)}%)` : `Intent needs clarification (${Math.round(finalScore * 100)}% \u2014 below 40% threshold)`;
|
|
123
|
+
return {
|
|
124
|
+
clear,
|
|
125
|
+
score: Math.round(finalScore * 100) / 100,
|
|
126
|
+
dimensions: {
|
|
127
|
+
domain: Math.round(domainScore * 100) / 100,
|
|
128
|
+
scope: Math.round(scopeScore * 100) / 100,
|
|
129
|
+
content: Math.round(contentScore * 100) / 100,
|
|
130
|
+
layout: Math.round(layoutScore * 100) / 100,
|
|
131
|
+
action: Math.round(actionScore * 100) / 100
|
|
132
|
+
},
|
|
133
|
+
questions: topQuestions,
|
|
134
|
+
summary
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
export {
|
|
138
|
+
assessClarity
|
|
139
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { classifyIntent } from "../domain-router.js";
|
|
2
|
+
const SECTION_SPLITTERS = /\band\b|\bwith\b|\bplus\b|\balso\b|,\s*(?:and\s+)?/gi;
|
|
3
|
+
const SECTION_SIGNALS = [
|
|
4
|
+
/\b(\d+)\s+(sections?|areas?|parts?|panels?|columns?|cards?|tabs?|pages?|views?)\b/i,
|
|
5
|
+
/\bsections?:\s/i,
|
|
6
|
+
/\bincluding\b/i,
|
|
7
|
+
/\beach\s+(with|having|containing)\b/i
|
|
8
|
+
];
|
|
9
|
+
const LAYOUT_KEYWORDS = {
|
|
10
|
+
tabs: { component: "Tabs", child: "Tab" },
|
|
11
|
+
sections: { component: "Column", child: "Card" },
|
|
12
|
+
columns: { component: "Grid", child: "Column" },
|
|
13
|
+
cards: { component: "Grid", child: "Card" },
|
|
14
|
+
panels: { component: "Accordion", child: "Panel" },
|
|
15
|
+
pages: { component: "Tabs", child: "Tab" },
|
|
16
|
+
areas: { component: "Grid", child: "Card" },
|
|
17
|
+
steps: { component: "Steps", child: "Step" }
|
|
18
|
+
};
|
|
19
|
+
function decomposeIntent(intent) {
|
|
20
|
+
const trimmed = (intent || "").trim();
|
|
21
|
+
if (!trimmed) return { shouldDecompose: false, subtasks: [], layout: null, original: trimmed };
|
|
22
|
+
for (const pattern of SECTION_SIGNALS) {
|
|
23
|
+
if (pattern.test(trimmed)) {
|
|
24
|
+
const sections2 = extractSections(trimmed);
|
|
25
|
+
if (sections2.length >= 2) {
|
|
26
|
+
const layout = detectLayout(trimmed, sections2.length);
|
|
27
|
+
return {
|
|
28
|
+
shouldDecompose: true,
|
|
29
|
+
subtasks: sections2,
|
|
30
|
+
layout,
|
|
31
|
+
original: trimmed
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const sections = extractSections(trimmed);
|
|
37
|
+
if (sections.length >= 2) {
|
|
38
|
+
const layout = detectLayout(trimmed, sections.length);
|
|
39
|
+
return {
|
|
40
|
+
shouldDecompose: true,
|
|
41
|
+
subtasks: sections,
|
|
42
|
+
layout,
|
|
43
|
+
original: trimmed
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return { shouldDecompose: false, subtasks: [], layout: null, original: trimmed };
|
|
47
|
+
}
|
|
48
|
+
function extractSections(intent) {
|
|
49
|
+
const withMatch = intent.match(/\bwith\s+(.+)$/i);
|
|
50
|
+
const payload = withMatch ? withMatch[1] ?? intent : intent;
|
|
51
|
+
const parts = payload.split(SECTION_SPLITTERS).map((s) => s.trim()).filter((s) => s.length > 2);
|
|
52
|
+
if (parts.length < 2) return [];
|
|
53
|
+
const baseContext = withMatch ? intent.slice(0, withMatch.index).trim() : "";
|
|
54
|
+
const domain = classifyIntent(intent).domain;
|
|
55
|
+
void domain;
|
|
56
|
+
return parts.map((part) => {
|
|
57
|
+
const label = part.replace(/\b(section|area|panel|tab|page)\b/gi, "").trim();
|
|
58
|
+
const subtaskIntent = baseContext ? `${label} section for a ${baseContext}` : `${label}`;
|
|
59
|
+
return { intent: subtaskIntent, label: capitalizeFirst(label) };
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function detectLayout(intent, sectionCount) {
|
|
63
|
+
const lower = intent.toLowerCase();
|
|
64
|
+
for (const [keyword, layout] of Object.entries(LAYOUT_KEYWORDS)) {
|
|
65
|
+
if (lower.includes(keyword)) return layout;
|
|
66
|
+
}
|
|
67
|
+
if (lower.includes("settings") || lower.includes("preferences") || lower.includes("account")) {
|
|
68
|
+
return { component: "Tabs", child: "Tab" };
|
|
69
|
+
}
|
|
70
|
+
if (lower.includes("dashboard") || lower.includes("overview") || lower.includes("stat")) {
|
|
71
|
+
return { component: "Grid", child: "Card" };
|
|
72
|
+
}
|
|
73
|
+
if (sectionCount <= 4) return { component: "Tabs", child: "Tab" };
|
|
74
|
+
return { component: "Grid", child: "Card" };
|
|
75
|
+
}
|
|
76
|
+
function composeSubtasks(layout, subtaskResults) {
|
|
77
|
+
const rootChildren = [];
|
|
78
|
+
const allComponents = [];
|
|
79
|
+
let idCounter = 0;
|
|
80
|
+
for (const { label, messages } of subtaskResults) {
|
|
81
|
+
const prefix = `s${++idCounter}`;
|
|
82
|
+
const subtaskComponents = messages?.[0]?.components ?? [];
|
|
83
|
+
const idMap = /* @__PURE__ */ new Map();
|
|
84
|
+
const remapped = subtaskComponents.map((c) => {
|
|
85
|
+
const newId = c.id === "root" ? prefix : `${prefix}-${c.id}`;
|
|
86
|
+
idMap.set(c.id, newId);
|
|
87
|
+
return { ...c, id: newId };
|
|
88
|
+
});
|
|
89
|
+
for (const c of remapped) {
|
|
90
|
+
if (c.children) {
|
|
91
|
+
c.children = c.children.map((id) => idMap.get(id) ?? id);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (layout.child === "Tab") {
|
|
95
|
+
const tabId = `${prefix}-tab`;
|
|
96
|
+
allComponents.push({ id: tabId, component: "Tab", text: label, children: [prefix] });
|
|
97
|
+
rootChildren.push(tabId);
|
|
98
|
+
} else {
|
|
99
|
+
rootChildren.push(prefix);
|
|
100
|
+
}
|
|
101
|
+
allComponents.push(...remapped);
|
|
102
|
+
}
|
|
103
|
+
const root = {
|
|
104
|
+
id: "root",
|
|
105
|
+
component: layout.component,
|
|
106
|
+
children: rootChildren
|
|
107
|
+
};
|
|
108
|
+
if (layout.component === "Grid") {
|
|
109
|
+
root["columns"] = String(Math.min(subtaskResults.length, 4));
|
|
110
|
+
root["gap"] = "md";
|
|
111
|
+
}
|
|
112
|
+
return [{
|
|
113
|
+
type: "updateComponents",
|
|
114
|
+
surfaceId: "default",
|
|
115
|
+
components: [root, ...allComponents]
|
|
116
|
+
}];
|
|
117
|
+
}
|
|
118
|
+
function capitalizeFirst(str) {
|
|
119
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
120
|
+
}
|
|
121
|
+
export {
|
|
122
|
+
composeSubtasks,
|
|
123
|
+
decomposeIntent
|
|
124
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { extractExpectations, verifyAlignment, checkIntentAlignment } from "./intent-alignment.js";
|
|
2
|
+
import { categorizeIntent } from "./intent-categorizer.js";
|
|
3
|
+
import { isConversational } from "./intent-gate.js";
|
|
4
|
+
import { analyzePrompt, formatAnalysisForPrompt } from "./prompt-analyzer.js";
|
|
5
|
+
import { decomposeIntent, composeSubtasks } from "./decomposer.js";
|
|
6
|
+
import { assessClarity } from "./clarity.js";
|
|
7
|
+
export {
|
|
8
|
+
analyzePrompt,
|
|
9
|
+
assessClarity,
|
|
10
|
+
categorizeIntent,
|
|
11
|
+
checkIntentAlignment,
|
|
12
|
+
composeSubtasks,
|
|
13
|
+
decomposeIntent,
|
|
14
|
+
extractExpectations,
|
|
15
|
+
formatAnalysisForPrompt,
|
|
16
|
+
isConversational,
|
|
17
|
+
verifyAlignment
|
|
18
|
+
};
|