@signalflare-ai/ui 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +96 -0
- package/README.md +527 -0
- package/ai/USAGE.md +200 -0
- package/ai/component-registry.json +7103 -0
- package/ai/component-registry.md +3046 -0
- package/ai/schemas.ts +1230 -0
- package/bin/intent.js +23 -0
- package/bin/sf.js +34 -0
- package/dist/.build-complete +1 -0
- package/dist/ai/schemas.d.ts +7056 -0
- package/dist/ai/schemas.d.ts.map +1 -0
- package/dist/ai-actions-DG1dhDMP.js +57 -0
- package/dist/ai-actions-DG1dhDMP.js.map +1 -0
- package/dist/ai-agent-card-BbtL4NII.js +171 -0
- package/dist/ai-agent-card-BbtL4NII.js.map +1 -0
- package/dist/ai-approval-Mb7-BY6i.js +184 -0
- package/dist/ai-approval-Mb7-BY6i.js.map +1 -0
- package/dist/ai-code-block-BI_z0UVR.js +110 -0
- package/dist/ai-code-block-BI_z0UVR.js.map +1 -0
- package/dist/ai-conversation-DYtExcrw.js +184 -0
- package/dist/ai-conversation-DYtExcrw.js.map +1 -0
- package/dist/ai-info-banner-BpzauUAY.js +76 -0
- package/dist/ai-info-banner-BpzauUAY.js.map +1 -0
- package/dist/ai-loader-Cr3eQkNS.js +134 -0
- package/dist/ai-loader-Cr3eQkNS.js.map +1 -0
- package/dist/ai-message-CV8SBoHM.js +286 -0
- package/dist/ai-message-CV8SBoHM.js.map +1 -0
- package/dist/ai-mission-header-ByYkJ6YP.js +171 -0
- package/dist/ai-mission-header-ByYkJ6YP.js.map +1 -0
- package/dist/ai-prompt-input-Bo1YuJly.js +769 -0
- package/dist/ai-prompt-input-Bo1YuJly.js.map +1 -0
- package/dist/ai-question-Dp1g9k2o.js +149 -0
- package/dist/ai-question-Dp1g9k2o.js.map +1 -0
- package/dist/ai-reasoning-UAmNx_LD.js +270 -0
- package/dist/ai-reasoning-UAmNx_LD.js.map +1 -0
- package/dist/ai-response-BWoVsNQG.js +42 -0
- package/dist/ai-response-BWoVsNQG.js.map +1 -0
- package/dist/ai-shimmer-BpOmfonu.js +43 -0
- package/dist/ai-shimmer-BpOmfonu.js.map +1 -0
- package/dist/ai-status-badge-WhbKVeqn.js +63 -0
- package/dist/ai-status-badge-WhbKVeqn.js.map +1 -0
- package/dist/ai-streaming-text-ClL7FwvD.js +81 -0
- package/dist/ai-streaming-text-ClL7FwvD.js.map +1 -0
- package/dist/ai-subagent-BruGN1UE.js +133 -0
- package/dist/ai-subagent-BruGN1UE.js.map +1 -0
- package/dist/ai-suggestion-CNsCZj5P.js +55 -0
- package/dist/ai-suggestion-CNsCZj5P.js.map +1 -0
- package/dist/ai-task-list-B9CpMDYN.js +120 -0
- package/dist/ai-task-list-B9CpMDYN.js.map +1 -0
- package/dist/ai-timeline-Bb5ntsr3.js +373 -0
- package/dist/ai-timeline-Bb5ntsr3.js.map +1 -0
- package/dist/ai-tool-BGH8nQ_D.js +437 -0
- package/dist/ai-tool-BGH8nQ_D.js.map +1 -0
- package/dist/ai-usage-bar-BI-p-JBk.js +70 -0
- package/dist/ai-usage-bar-BI-p-JBk.js.map +1 -0
- package/dist/badge-D_eaA6wv.js +128 -0
- package/dist/badge-D_eaA6wv.js.map +1 -0
- package/dist/banner-B_6oBrsu.js +54 -0
- package/dist/banner-B_6oBrsu.js.map +1 -0
- package/dist/breadcrumbs-BlmeYfgq.js +128 -0
- package/dist/breadcrumbs-BlmeYfgq.js.map +1 -0
- package/dist/button-De0267YU.js +170 -0
- package/dist/button-De0267YU.js.map +1 -0
- package/dist/catalog.js +506 -0
- package/dist/catalog.js.map +1 -0
- package/dist/chart-Bes4MN3C.js +618 -0
- package/dist/chart-Bes4MN3C.js.map +1 -0
- package/dist/checkbox-CPX7lBaU.js +153 -0
- package/dist/checkbox-CPX7lBaU.js.map +1 -0
- package/dist/clipboard-text-92YeCybc.js +176 -0
- package/dist/clipboard-text-92YeCybc.js.map +1 -0
- package/dist/cn-YROP2_ox.js +25 -0
- package/dist/cn-YROP2_ox.js.map +1 -0
- package/dist/code-DE1Yy1Cu.js +97 -0
- package/dist/code-DE1Yy1Cu.js.map +1 -0
- package/dist/collapsible-DWsXeXmS.js +72 -0
- package/dist/collapsible-DWsXeXmS.js.map +1 -0
- package/dist/combobox-B0bLdsX8.js +197 -0
- package/dist/combobox-B0bLdsX8.js.map +1 -0
- package/dist/command-line/cli.js +823 -0
- package/dist/command-palette-CBTY8EiF.js +484 -0
- package/dist/command-palette-CBTY8EiF.js.map +1 -0
- package/dist/components/ai-actions.js +3 -0
- package/dist/components/ai-agent-card.js +3 -0
- package/dist/components/ai-approval.js +3 -0
- package/dist/components/ai-code-block.js +3 -0
- package/dist/components/ai-conversation.js +3 -0
- package/dist/components/ai-info-banner.js +3 -0
- package/dist/components/ai-loader.js +3 -0
- package/dist/components/ai-message.js +3 -0
- package/dist/components/ai-mission-header.js +3 -0
- package/dist/components/ai-prompt-input.js +3 -0
- package/dist/components/ai-question.js +3 -0
- package/dist/components/ai-reasoning.js +3 -0
- package/dist/components/ai-response.js +3 -0
- package/dist/components/ai-shimmer.js +3 -0
- package/dist/components/ai-status-badge.js +3 -0
- package/dist/components/ai-streaming-text.js +3 -0
- package/dist/components/ai-subagent.js +3 -0
- package/dist/components/ai-suggestion.js +3 -0
- package/dist/components/ai-task-list.js +3 -0
- package/dist/components/ai-timeline.js +3 -0
- package/dist/components/ai-tool.js +3 -0
- package/dist/components/ai-usage-bar.js +3 -0
- package/dist/components/badge.js +3 -0
- package/dist/components/banner.js +3 -0
- package/dist/components/breadcrumbs.js +3 -0
- package/dist/components/button.js +3 -0
- package/dist/components/chart.js +3 -0
- package/dist/components/checkbox.js +3 -0
- package/dist/components/clipboard-text.js +3 -0
- package/dist/components/code.js +3 -0
- package/dist/components/collapsible.js +3 -0
- package/dist/components/combobox.js +3 -0
- package/dist/components/command-palette.js +3 -0
- package/dist/components/data-grid.js +3 -0
- package/dist/components/date-picker.js +3 -0
- package/dist/components/date-range-picker.js +3 -0
- package/dist/components/dialog.js +3 -0
- package/dist/components/dropdown.js +3 -0
- package/dist/components/empty.js +3 -0
- package/dist/components/field.js +3 -0
- package/dist/components/filters.js +3 -0
- package/dist/components/flow.js +3 -0
- package/dist/components/grid.js +3 -0
- package/dist/components/input.js +4 -0
- package/dist/components/label.js +3 -0
- package/dist/components/layer-card.js +3 -0
- package/dist/components/link.js +92 -0
- package/dist/components/link.js.map +1 -0
- package/dist/components/loader.js +4 -0
- package/dist/components/menubar.js +3 -0
- package/dist/components/meter.js +3 -0
- package/dist/components/pagination.js +3 -0
- package/dist/components/popover.js +3 -0
- package/dist/components/radio.js +3 -0
- package/dist/components/select.js +3 -0
- package/dist/components/sensitive-input.js +3 -0
- package/dist/components/sidebar.js +3 -0
- package/dist/components/signalflare-ai-logo.js +3 -0
- package/dist/components/surface.js +3 -0
- package/dist/components/switch.js +3 -0
- package/dist/components/table.js +3 -0
- package/dist/components/tabs.js +3 -0
- package/dist/components/text.js +3 -0
- package/dist/components/theme-toggle.js +3 -0
- package/dist/components/toast.js +3 -0
- package/dist/components/tooltip.js +3 -0
- package/dist/components/use-agent-harness.js +3 -0
- package/dist/data-grid-UJ9ja5cu.js +305 -0
- package/dist/data-grid-UJ9ja5cu.js.map +1 -0
- package/dist/date-picker-ebekkC3R.js +57 -0
- package/dist/date-picker-ebekkC3R.js.map +1 -0
- package/dist/date-range-picker-D75LLINc.js +347 -0
- package/dist/date-range-picker-D75LLINc.js.map +1 -0
- package/dist/dialog-CyHEQXEY.js +104 -0
- package/dist/dialog-CyHEQXEY.js.map +1 -0
- package/dist/dist-BNlyONdD.js +3546 -0
- package/dist/dist-BNlyONdD.js.map +1 -0
- package/dist/dropdown-J5T4pHaR.js +202 -0
- package/dist/dropdown-J5T4pHaR.js.map +1 -0
- package/dist/empty-D2TypIId.js +90 -0
- package/dist/empty-D2TypIId.js.map +1 -0
- package/dist/favicon.svg +4 -0
- package/dist/field-Y_UK1_Cg.js +57 -0
- package/dist/field-Y_UK1_Cg.js.map +1 -0
- package/dist/filters-BdBogf7D.js +682 -0
- package/dist/filters-BdBogf7D.js.map +1 -0
- package/dist/flow-BRsYUCJa.js +741 -0
- package/dist/flow-BRsYUCJa.js.map +1 -0
- package/dist/genui.js +40 -0
- package/dist/genui.js.map +1 -0
- package/dist/grid-qUAN9hFx.js +119 -0
- package/dist/grid-qUAN9hFx.js.map +1 -0
- package/dist/highlight-to-react-ClEfL81q.js +57 -0
- package/dist/highlight-to-react-ClEfL81q.js.map +1 -0
- package/dist/index.js +215 -0
- package/dist/index.js.map +1 -0
- package/dist/input-BxQAnXki.js +81 -0
- package/dist/input-BxQAnXki.js.map +1 -0
- package/dist/input-Cn25I4o5.js +121 -0
- package/dist/input-Cn25I4o5.js.map +1 -0
- package/dist/label-QtJxtJ4u.js +70 -0
- package/dist/label-QtJxtJ4u.js.map +1 -0
- package/dist/layer-card-BME0eljh.js +44 -0
- package/dist/layer-card-BME0eljh.js.map +1 -0
- package/dist/link-provider-BUZKXaNE.js +25 -0
- package/dist/link-provider-BUZKXaNE.js.map +1 -0
- package/dist/loader-DAcc-Uag.js +84 -0
- package/dist/loader-DAcc-Uag.js.map +1 -0
- package/dist/logo.svg +1 -0
- package/dist/menubar-C8NzAjfd.js +102 -0
- package/dist/menubar-C8NzAjfd.js.map +1 -0
- package/dist/meter-CpmTenEr.js +37 -0
- package/dist/meter-CpmTenEr.js.map +1 -0
- package/dist/pagination-C_YqCy8l.js +117 -0
- package/dist/pagination-C_YqCy8l.js.map +1 -0
- package/dist/popover-BRQZ2b6z.js +147 -0
- package/dist/popover-BRQZ2b6z.js.map +1 -0
- package/dist/primitives/accordion.js +2 -0
- package/dist/primitives/alert-dialog.js +2 -0
- package/dist/primitives/autocomplete.js +2 -0
- package/dist/primitives/avatar.js +2 -0
- package/dist/primitives/button.js +2 -0
- package/dist/primitives/checkbox-group.js +2 -0
- package/dist/primitives/checkbox.js +2 -0
- package/dist/primitives/collapsible.js +2 -0
- package/dist/primitives/combobox.js +2 -0
- package/dist/primitives/context-menu.js +2 -0
- package/dist/primitives/csp-provider.js +2 -0
- package/dist/primitives/dialog.js +2 -0
- package/dist/primitives/direction-provider.js +2 -0
- package/dist/primitives/drawer.js +2 -0
- package/dist/primitives/field.js +2 -0
- package/dist/primitives/fieldset.js +2 -0
- package/dist/primitives/form.js +2 -0
- package/dist/primitives/input.js +2 -0
- package/dist/primitives/menu.js +2 -0
- package/dist/primitives/menubar.js +2 -0
- package/dist/primitives/meter.js +2 -0
- package/dist/primitives/navigation-menu.js +2 -0
- package/dist/primitives/number-field.js +2 -0
- package/dist/primitives/popover.js +2 -0
- package/dist/primitives/preview-card.js +2 -0
- package/dist/primitives/progress.js +2 -0
- package/dist/primitives/radio-group.js +2 -0
- package/dist/primitives/radio.js +2 -0
- package/dist/primitives/scroll-area.js +2 -0
- package/dist/primitives/select.js +2 -0
- package/dist/primitives/separator.js +2 -0
- package/dist/primitives/slider.js +2 -0
- package/dist/primitives/switch.js +2 -0
- package/dist/primitives/tabs.js +2 -0
- package/dist/primitives/toast.js +2 -0
- package/dist/primitives/toggle-group.js +2 -0
- package/dist/primitives/toggle.js +2 -0
- package/dist/primitives/toolbar.js +2 -0
- package/dist/primitives/tooltip.js +2 -0
- package/dist/primitives.js +40 -0
- package/dist/radio-B7zg1wUI.js +101 -0
- package/dist/radio-B7zg1wUI.js.map +1 -0
- package/dist/registry.js +1 -0
- package/dist/select-9p721G00.js +95 -0
- package/dist/select-9p721G00.js.map +1 -0
- package/dist/sensitive-input-D5je2NLl.js +248 -0
- package/dist/sensitive-input-D5je2NLl.js.map +1 -0
- package/dist/sidebar-DOwBrq57.js +964 -0
- package/dist/sidebar-DOwBrq57.js.map +1 -0
- package/dist/signalflare-ai-logo-DDhxMJD6.js +260 -0
- package/dist/signalflare-ai-logo-DDhxMJD6.js.map +1 -0
- package/dist/skeleton-line-Do3UmGk9.js +36 -0
- package/dist/skeleton-line-Do3UmGk9.js.map +1 -0
- package/dist/src/blocks/agent-harness/agent-harness.d.ts +177 -0
- package/dist/src/blocks/agent-harness/agent-harness.d.ts.map +1 -0
- package/dist/src/blocks/agent-harness/agent-harness.tsx +1122 -0
- package/dist/src/blocks/agent-harness/index.d.ts +2 -0
- package/dist/src/blocks/agent-harness/index.d.ts.map +1 -0
- package/dist/src/blocks/commander/commander.d.ts +101 -0
- package/dist/src/blocks/commander/commander.d.ts.map +1 -0
- package/dist/src/blocks/commander/commander.tsx +477 -0
- package/dist/src/blocks/commander/index.d.ts +2 -0
- package/dist/src/blocks/commander/index.d.ts.map +1 -0
- package/dist/src/blocks/delete-resource/delete-resource.d.ts +46 -0
- package/dist/src/blocks/delete-resource/delete-resource.d.ts.map +1 -0
- package/dist/src/blocks/delete-resource/delete-resource.tsx +214 -0
- package/dist/src/blocks/delete-resource/index.d.ts +2 -0
- package/dist/src/blocks/delete-resource/index.d.ts.map +1 -0
- package/dist/src/blocks/map-block/index.d.ts +2 -0
- package/dist/src/blocks/map-block/index.d.ts.map +1 -0
- package/dist/src/blocks/map-block/map-block.d.ts +79 -0
- package/dist/src/blocks/map-block/map-block.d.ts.map +1 -0
- package/dist/src/blocks/map-block/map-block.tsx +522 -0
- package/dist/src/blocks/page-header/index.d.ts +2 -0
- package/dist/src/blocks/page-header/index.d.ts.map +1 -0
- package/dist/src/blocks/page-header/page-header.d.ts +38 -0
- package/dist/src/blocks/page-header/page-header.d.ts.map +1 -0
- package/dist/src/blocks/page-header/page-header.tsx +96 -0
- package/dist/src/blocks/resource-list/index.d.ts +2 -0
- package/dist/src/blocks/resource-list/index.d.ts.map +1 -0
- package/dist/src/blocks/resource-list/resource-list.d.ts +18 -0
- package/dist/src/blocks/resource-list/resource-list.d.ts.map +1 -0
- package/dist/src/blocks/resource-list/resource-list.test.tsx +27 -0
- package/dist/src/blocks/resource-list/resource-list.tsx +65 -0
- package/dist/src/catalog/catalog.d.ts +75 -0
- package/dist/src/catalog/catalog.d.ts.map +1 -0
- package/dist/src/catalog/data.d.ts +44 -0
- package/dist/src/catalog/data.d.ts.map +1 -0
- package/dist/src/catalog/index.d.ts +35 -0
- package/dist/src/catalog/index.d.ts.map +1 -0
- package/dist/src/catalog/sf-components.d.ts +8 -0
- package/dist/src/catalog/sf-components.d.ts.map +1 -0
- package/dist/src/catalog/sf-registry.d.ts +4 -0
- package/dist/src/catalog/sf-registry.d.ts.map +1 -0
- package/dist/src/catalog/types.d.ts +226 -0
- package/dist/src/catalog/types.d.ts.map +1 -0
- package/dist/src/catalog/visibility.d.ts +37 -0
- package/dist/src/catalog/visibility.d.ts.map +1 -0
- package/dist/src/command-line/build-cli.d.ts +7 -0
- package/dist/src/command-line/build-cli.d.ts.map +1 -0
- package/dist/src/command-line/cli.d.ts +13 -0
- package/dist/src/command-line/cli.d.ts.map +1 -0
- package/dist/src/command-line/commands/add.d.ts +10 -0
- package/dist/src/command-line/commands/add.d.ts.map +1 -0
- package/dist/src/command-line/commands/ai.d.ts +10 -0
- package/dist/src/command-line/commands/ai.d.ts.map +1 -0
- package/dist/src/command-line/commands/blocks.d.ts +10 -0
- package/dist/src/command-line/commands/blocks.d.ts.map +1 -0
- package/dist/src/command-line/commands/doc.d.ts +14 -0
- package/dist/src/command-line/commands/doc.d.ts.map +1 -0
- package/dist/src/command-line/commands/init.d.ts +18 -0
- package/dist/src/command-line/commands/init.d.ts.map +1 -0
- package/dist/src/command-line/commands/ls.d.ts +10 -0
- package/dist/src/command-line/commands/ls.d.ts.map +1 -0
- package/dist/src/command-line/commands/migrate.d.ts +10 -0
- package/dist/src/command-line/commands/migrate.d.ts.map +1 -0
- package/dist/src/command-line/utils/config.d.ts +42 -0
- package/dist/src/command-line/utils/config.d.ts.map +1 -0
- package/dist/src/command-line/utils/transformer.d.ts +21 -0
- package/dist/src/command-line/utils/transformer.d.ts.map +1 -0
- package/dist/src/components/ai-actions/ai-actions.d.ts +35 -0
- package/dist/src/components/ai-actions/ai-actions.d.ts.map +1 -0
- package/dist/src/components/ai-actions/index.d.ts +2 -0
- package/dist/src/components/ai-actions/index.d.ts.map +1 -0
- package/dist/src/components/ai-agent-card/ai-agent-card.d.ts +82 -0
- package/dist/src/components/ai-agent-card/ai-agent-card.d.ts.map +1 -0
- package/dist/src/components/ai-agent-card/index.d.ts +2 -0
- package/dist/src/components/ai-agent-card/index.d.ts.map +1 -0
- package/dist/src/components/ai-approval/ai-approval.d.ts +102 -0
- package/dist/src/components/ai-approval/ai-approval.d.ts.map +1 -0
- package/dist/src/components/ai-approval/index.d.ts +2 -0
- package/dist/src/components/ai-approval/index.d.ts.map +1 -0
- package/dist/src/components/ai-code-block/ai-code-block.d.ts +48 -0
- package/dist/src/components/ai-code-block/ai-code-block.d.ts.map +1 -0
- package/dist/src/components/ai-code-block/index.d.ts +2 -0
- package/dist/src/components/ai-code-block/index.d.ts.map +1 -0
- package/dist/src/components/ai-conversation/ai-conversation.d.ts +125 -0
- package/dist/src/components/ai-conversation/ai-conversation.d.ts.map +1 -0
- package/dist/src/components/ai-conversation/index.d.ts +2 -0
- package/dist/src/components/ai-conversation/index.d.ts.map +1 -0
- package/dist/src/components/ai-info-banner/ai-info-banner.d.ts +55 -0
- package/dist/src/components/ai-info-banner/ai-info-banner.d.ts.map +1 -0
- package/dist/src/components/ai-info-banner/index.d.ts +2 -0
- package/dist/src/components/ai-info-banner/index.d.ts.map +1 -0
- package/dist/src/components/ai-loader/ai-loader.d.ts +44 -0
- package/dist/src/components/ai-loader/ai-loader.d.ts.map +1 -0
- package/dist/src/components/ai-loader/index.d.ts +2 -0
- package/dist/src/components/ai-loader/index.d.ts.map +1 -0
- package/dist/src/components/ai-message/ai-message.d.ts +97 -0
- package/dist/src/components/ai-message/ai-message.d.ts.map +1 -0
- package/dist/src/components/ai-message/index.d.ts +2 -0
- package/dist/src/components/ai-message/index.d.ts.map +1 -0
- package/dist/src/components/ai-mission-header/ai-mission-header.d.ts +62 -0
- package/dist/src/components/ai-mission-header/ai-mission-header.d.ts.map +1 -0
- package/dist/src/components/ai-mission-header/index.d.ts +2 -0
- package/dist/src/components/ai-mission-header/index.d.ts.map +1 -0
- package/dist/src/components/ai-prompt-input/ai-prompt-input.d.ts +260 -0
- package/dist/src/components/ai-prompt-input/ai-prompt-input.d.ts.map +1 -0
- package/dist/src/components/ai-prompt-input/index.d.ts +2 -0
- package/dist/src/components/ai-prompt-input/index.d.ts.map +1 -0
- package/dist/src/components/ai-question/ai-question.d.ts +73 -0
- package/dist/src/components/ai-question/ai-question.d.ts.map +1 -0
- package/dist/src/components/ai-question/index.d.ts +2 -0
- package/dist/src/components/ai-question/index.d.ts.map +1 -0
- package/dist/src/components/ai-reasoning/ai-reasoning.d.ts +107 -0
- package/dist/src/components/ai-reasoning/ai-reasoning.d.ts.map +1 -0
- package/dist/src/components/ai-reasoning/index.d.ts +2 -0
- package/dist/src/components/ai-reasoning/index.d.ts.map +1 -0
- package/dist/src/components/ai-response/ai-response.d.ts +26 -0
- package/dist/src/components/ai-response/ai-response.d.ts.map +1 -0
- package/dist/src/components/ai-response/index.d.ts +2 -0
- package/dist/src/components/ai-response/index.d.ts.map +1 -0
- package/dist/src/components/ai-shimmer/ai-shimmer.d.ts +29 -0
- package/dist/src/components/ai-shimmer/ai-shimmer.d.ts.map +1 -0
- package/dist/src/components/ai-shimmer/index.d.ts +2 -0
- package/dist/src/components/ai-shimmer/index.d.ts.map +1 -0
- package/dist/src/components/ai-status-badge/ai-status-badge.d.ts +46 -0
- package/dist/src/components/ai-status-badge/ai-status-badge.d.ts.map +1 -0
- package/dist/src/components/ai-status-badge/index.d.ts +2 -0
- package/dist/src/components/ai-status-badge/index.d.ts.map +1 -0
- package/dist/src/components/ai-streaming-text/ai-streaming-text.d.ts +27 -0
- package/dist/src/components/ai-streaming-text/ai-streaming-text.d.ts.map +1 -0
- package/dist/src/components/ai-streaming-text/index.d.ts +2 -0
- package/dist/src/components/ai-streaming-text/index.d.ts.map +1 -0
- package/dist/src/components/ai-subagent/ai-subagent.d.ts +74 -0
- package/dist/src/components/ai-subagent/ai-subagent.d.ts.map +1 -0
- package/dist/src/components/ai-subagent/index.d.ts +2 -0
- package/dist/src/components/ai-subagent/index.d.ts.map +1 -0
- package/dist/src/components/ai-suggestion/ai-suggestion.d.ts +40 -0
- package/dist/src/components/ai-suggestion/ai-suggestion.d.ts.map +1 -0
- package/dist/src/components/ai-suggestion/index.d.ts +2 -0
- package/dist/src/components/ai-suggestion/index.d.ts.map +1 -0
- package/dist/src/components/ai-task-list/ai-task-list.d.ts +61 -0
- package/dist/src/components/ai-task-list/ai-task-list.d.ts.map +1 -0
- package/dist/src/components/ai-task-list/index.d.ts +2 -0
- package/dist/src/components/ai-task-list/index.d.ts.map +1 -0
- package/dist/src/components/ai-timeline/ai-timeline.d.ts +130 -0
- package/dist/src/components/ai-timeline/ai-timeline.d.ts.map +1 -0
- package/dist/src/components/ai-timeline/index.d.ts +2 -0
- package/dist/src/components/ai-timeline/index.d.ts.map +1 -0
- package/dist/src/components/ai-tool/ai-tool.d.ts +138 -0
- package/dist/src/components/ai-tool/ai-tool.d.ts.map +1 -0
- package/dist/src/components/ai-tool/index.d.ts +2 -0
- package/dist/src/components/ai-tool/index.d.ts.map +1 -0
- package/dist/src/components/ai-usage-bar/ai-usage-bar.d.ts +38 -0
- package/dist/src/components/ai-usage-bar/ai-usage-bar.d.ts.map +1 -0
- package/dist/src/components/ai-usage-bar/index.d.ts +2 -0
- package/dist/src/components/ai-usage-bar/index.d.ts.map +1 -0
- package/dist/src/components/badge/badge.d.ts +129 -0
- package/dist/src/components/badge/badge.d.ts.map +1 -0
- package/dist/src/components/badge/index.d.ts +2 -0
- package/dist/src/components/badge/index.d.ts.map +1 -0
- package/dist/src/components/banner/banner.d.ts +80 -0
- package/dist/src/components/banner/banner.d.ts.map +1 -0
- package/dist/src/components/banner/index.d.ts +2 -0
- package/dist/src/components/banner/index.d.ts.map +1 -0
- package/dist/src/components/breadcrumbs/breadcrumbs.d.ts +78 -0
- package/dist/src/components/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/dist/src/components/breadcrumbs/index.d.ts +2 -0
- package/dist/src/components/breadcrumbs/index.d.ts.map +1 -0
- package/dist/src/components/button/button.d.ts +212 -0
- package/dist/src/components/button/button.d.ts.map +1 -0
- package/dist/src/components/button/index.d.ts +2 -0
- package/dist/src/components/button/index.d.ts.map +1 -0
- package/dist/src/components/chart/color.d.ts +98 -0
- package/dist/src/components/chart/color.d.ts.map +1 -0
- package/dist/src/components/chart/echart.d.ts +135 -0
- package/dist/src/components/chart/echart.d.ts.map +1 -0
- package/dist/src/components/chart/index.d.ts +5 -0
- package/dist/src/components/chart/index.d.ts.map +1 -0
- package/dist/src/components/chart/legend.d.ts +42 -0
- package/dist/src/components/chart/legend.d.ts.map +1 -0
- package/dist/src/components/chart/timeseries-chart.d.ts +119 -0
- package/dist/src/components/chart/timeseries-chart.d.ts.map +1 -0
- package/dist/src/components/checkbox/checkbox.d.ts +174 -0
- package/dist/src/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/src/components/checkbox/index.d.ts +2 -0
- package/dist/src/components/checkbox/index.d.ts.map +1 -0
- package/dist/src/components/clipboard-text/clipboard-text.d.ts +86 -0
- package/dist/src/components/clipboard-text/clipboard-text.d.ts.map +1 -0
- package/dist/src/components/clipboard-text/index.d.ts +2 -0
- package/dist/src/components/clipboard-text/index.d.ts.map +1 -0
- package/dist/src/components/code/code.d.ts +165 -0
- package/dist/src/components/code/code.d.ts.map +1 -0
- package/dist/src/components/code/index.d.ts +4 -0
- package/dist/src/components/code/index.d.ts.map +1 -0
- package/dist/src/components/collapsible/collapsible.d.ts +72 -0
- package/dist/src/components/collapsible/collapsible.d.ts.map +1 -0
- package/dist/src/components/collapsible/index.d.ts +2 -0
- package/dist/src/components/collapsible/index.d.ts.map +1 -0
- package/dist/src/components/combobox/combobox.d.ts +188 -0
- package/dist/src/components/combobox/combobox.d.ts.map +1 -0
- package/dist/src/components/combobox/index.d.ts +2 -0
- package/dist/src/components/combobox/index.d.ts.map +1 -0
- package/dist/src/components/command-palette/command-palette.d.ts +260 -0
- package/dist/src/components/command-palette/command-palette.d.ts.map +1 -0
- package/dist/src/components/command-palette/index.d.ts +3 -0
- package/dist/src/components/command-palette/index.d.ts.map +1 -0
- package/dist/src/components/command-palette/types.d.ts +149 -0
- package/dist/src/components/command-palette/types.d.ts.map +1 -0
- package/dist/src/components/data-grid/data-grid.d.ts +78 -0
- package/dist/src/components/data-grid/data-grid.d.ts.map +1 -0
- package/dist/src/components/data-grid/index.d.ts +3 -0
- package/dist/src/components/data-grid/index.d.ts.map +1 -0
- package/dist/src/components/data-grid/types.d.ts +236 -0
- package/dist/src/components/data-grid/types.d.ts.map +1 -0
- package/dist/src/components/date-picker/date-picker.d.ts +65 -0
- package/dist/src/components/date-picker/date-picker.d.ts.map +1 -0
- package/dist/src/components/date-picker/index.d.ts +4 -0
- package/dist/src/components/date-picker/index.d.ts.map +1 -0
- package/dist/src/components/date-range-picker/date-range-picker.d.ts +125 -0
- package/dist/src/components/date-range-picker/date-range-picker.d.ts.map +1 -0
- package/dist/src/components/date-range-picker/index.d.ts +5 -0
- package/dist/src/components/date-range-picker/index.d.ts.map +1 -0
- package/dist/src/components/dialog/dialog.d.ts +189 -0
- package/dist/src/components/dialog/dialog.d.ts.map +1 -0
- package/dist/src/components/dialog/index.d.ts +2 -0
- package/dist/src/components/dialog/index.d.ts.map +1 -0
- package/dist/src/components/dropdown/dropdown.d.ts +91 -0
- package/dist/src/components/dropdown/dropdown.d.ts.map +1 -0
- package/dist/src/components/dropdown/index.d.ts +2 -0
- package/dist/src/components/dropdown/index.d.ts.map +1 -0
- package/dist/src/components/empty/empty.d.ts +69 -0
- package/dist/src/components/empty/empty.d.ts.map +1 -0
- package/dist/src/components/empty/index.d.ts +2 -0
- package/dist/src/components/empty/index.d.ts.map +1 -0
- package/dist/src/components/field/field.d.ts +68 -0
- package/dist/src/components/field/field.d.ts.map +1 -0
- package/dist/src/components/field/index.d.ts +2 -0
- package/dist/src/components/field/index.d.ts.map +1 -0
- package/dist/src/components/filters/filters.d.ts +54 -0
- package/dist/src/components/filters/filters.d.ts.map +1 -0
- package/dist/src/components/filters/helpers.d.ts +56 -0
- package/dist/src/components/filters/helpers.d.ts.map +1 -0
- package/dist/src/components/filters/index.d.ts +3 -0
- package/dist/src/components/filters/index.d.ts.map +1 -0
- package/dist/src/components/filters/types.d.ts +148 -0
- package/dist/src/components/filters/types.d.ts.map +1 -0
- package/dist/src/components/flow/connectors.d.ts +35 -0
- package/dist/src/components/flow/connectors.d.ts.map +1 -0
- package/dist/src/components/flow/diagram.d.ts +62 -0
- package/dist/src/components/flow/diagram.d.ts.map +1 -0
- package/dist/src/components/flow/index.d.ts +26 -0
- package/dist/src/components/flow/index.d.ts.map +1 -0
- package/dist/src/components/flow/node.d.ts +52 -0
- package/dist/src/components/flow/node.d.ts.map +1 -0
- package/dist/src/components/flow/parallel.d.ts +5 -0
- package/dist/src/components/flow/parallel.d.ts.map +1 -0
- package/dist/src/components/flow/use-children.d.ts +69 -0
- package/dist/src/components/flow/use-children.d.ts.map +1 -0
- package/dist/src/components/grid/grid.d.ts +135 -0
- package/dist/src/components/grid/grid.d.ts.map +1 -0
- package/dist/src/components/grid/index.d.ts +2 -0
- package/dist/src/components/grid/index.d.ts.map +1 -0
- package/dist/src/components/input/index.d.ts +4 -0
- package/dist/src/components/input/index.d.ts.map +1 -0
- package/dist/src/components/input/input-area.d.ts +65 -0
- package/dist/src/components/input/input-area.d.ts.map +1 -0
- package/dist/src/components/input/input-group.d.ts +39 -0
- package/dist/src/components/input/input-group.d.ts.map +1 -0
- package/dist/src/components/input/input.d.ts +172 -0
- package/dist/src/components/input/input.d.ts.map +1 -0
- package/dist/src/components/label/index.d.ts +2 -0
- package/dist/src/components/label/index.d.ts.map +1 -0
- package/dist/src/components/label/label.d.ts +67 -0
- package/dist/src/components/label/label.d.ts.map +1 -0
- package/dist/src/components/layer-card/index.d.ts +2 -0
- package/dist/src/components/layer-card/index.d.ts.map +1 -0
- package/dist/src/components/layer-card/layer-card.d.ts +29 -0
- package/dist/src/components/layer-card/layer-card.d.ts.map +1 -0
- package/dist/src/components/link/index.d.ts +2 -0
- package/dist/src/components/link/index.d.ts.map +1 -0
- package/dist/src/components/link/link.d.ts +55 -0
- package/dist/src/components/link/link.d.ts.map +1 -0
- package/dist/src/components/loader/index.d.ts +3 -0
- package/dist/src/components/loader/index.d.ts.map +1 -0
- package/dist/src/components/loader/loader.d.ts +65 -0
- package/dist/src/components/loader/loader.d.ts.map +1 -0
- package/dist/src/components/loader/skeleton-line.d.ts +10 -0
- package/dist/src/components/loader/skeleton-line.d.ts.map +1 -0
- package/dist/src/components/menubar/index.d.ts +3 -0
- package/dist/src/components/menubar/index.d.ts.map +1 -0
- package/dist/src/components/menubar/menubar.d.ts +66 -0
- package/dist/src/components/menubar/menubar.d.ts.map +1 -0
- package/dist/src/components/menubar/use-menu-navigation.d.ts +8 -0
- package/dist/src/components/menubar/use-menu-navigation.d.ts.map +1 -0
- package/dist/src/components/meter/index.d.ts +2 -0
- package/dist/src/components/meter/index.d.ts.map +1 -0
- package/dist/src/components/meter/meter.d.ts +44 -0
- package/dist/src/components/meter/meter.d.ts.map +1 -0
- package/dist/src/components/pagination/index.d.ts +2 -0
- package/dist/src/components/pagination/index.d.ts.map +1 -0
- package/dist/src/components/pagination/pagination.d.ts +60 -0
- package/dist/src/components/pagination/pagination.d.ts.map +1 -0
- package/dist/src/components/popover/index.d.ts +3 -0
- package/dist/src/components/popover/index.d.ts.map +1 -0
- package/dist/src/components/popover/popover.d.ts +138 -0
- package/dist/src/components/popover/popover.d.ts.map +1 -0
- package/dist/src/components/radio/index.d.ts +2 -0
- package/dist/src/components/radio/index.d.ts.map +1 -0
- package/dist/src/components/radio/radio.d.ts +163 -0
- package/dist/src/components/radio/radio.d.ts.map +1 -0
- package/dist/src/components/select/index.d.ts +2 -0
- package/dist/src/components/select/index.d.ts.map +1 -0
- package/dist/src/components/select/select.d.ts +150 -0
- package/dist/src/components/select/select.d.ts.map +1 -0
- package/dist/src/components/sensitive-input/index.d.ts +2 -0
- package/dist/src/components/sensitive-input/index.d.ts.map +1 -0
- package/dist/src/components/sensitive-input/sensitive-input.d.ts +94 -0
- package/dist/src/components/sensitive-input/sensitive-input.d.ts.map +1 -0
- package/dist/src/components/sidebar/index.d.ts +2 -0
- package/dist/src/components/sidebar/index.d.ts.map +1 -0
- package/dist/src/components/sidebar/sidebar.d.ts +556 -0
- package/dist/src/components/sidebar/sidebar.d.ts.map +1 -0
- package/dist/src/components/signalflare-ai-logo/index.d.ts +2 -0
- package/dist/src/components/signalflare-ai-logo/index.d.ts.map +1 -0
- package/dist/src/components/signalflare-ai-logo/signalflare-ai-logo.d.ts +171 -0
- package/dist/src/components/signalflare-ai-logo/signalflare-ai-logo.d.ts.map +1 -0
- package/dist/src/components/surface/index.d.ts +2 -0
- package/dist/src/components/surface/index.d.ts.map +1 -0
- package/dist/src/components/surface/surface.d.ts +60 -0
- package/dist/src/components/surface/surface.d.ts.map +1 -0
- package/dist/src/components/switch/index.d.ts +2 -0
- package/dist/src/components/switch/index.d.ts.map +1 -0
- package/dist/src/components/switch/switch.d.ts +169 -0
- package/dist/src/components/switch/switch.d.ts.map +1 -0
- package/dist/src/components/table/index.d.ts +2 -0
- package/dist/src/components/table/index.d.ts.map +1 -0
- package/dist/src/components/table/table.d.ts +89 -0
- package/dist/src/components/table/table.d.ts.map +1 -0
- package/dist/src/components/tabs/index.d.ts +3 -0
- package/dist/src/components/tabs/index.d.ts.map +1 -0
- package/dist/src/components/tabs/tabs.d.ts +105 -0
- package/dist/src/components/tabs/tabs.d.ts.map +1 -0
- package/dist/src/components/text/index.d.ts +2 -0
- package/dist/src/components/text/index.d.ts.map +1 -0
- package/dist/src/components/text/text.d.ts +181 -0
- package/dist/src/components/text/text.d.ts.map +1 -0
- package/dist/src/components/theme-toggle/index.d.ts +2 -0
- package/dist/src/components/theme-toggle/index.d.ts.map +1 -0
- package/dist/src/components/theme-toggle/theme-toggle.d.ts +68 -0
- package/dist/src/components/theme-toggle/theme-toggle.d.ts.map +1 -0
- package/dist/src/components/toast/index.d.ts +5 -0
- package/dist/src/components/toast/index.d.ts.map +1 -0
- package/dist/src/components/toast/toast.d.ts +152 -0
- package/dist/src/components/toast/toast.d.ts.map +1 -0
- package/dist/src/components/tooltip/index.d.ts +2 -0
- package/dist/src/components/tooltip/index.d.ts.map +1 -0
- package/dist/src/components/tooltip/tooltip.d.ts +82 -0
- package/dist/src/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/src/components/use-agent-harness/index.d.ts +2 -0
- package/dist/src/components/use-agent-harness/index.d.ts.map +1 -0
- package/dist/src/components/use-agent-harness/use-agent-harness.d.ts +642 -0
- package/dist/src/components/use-agent-harness/use-agent-harness.d.ts.map +1 -0
- package/dist/src/genui/genui.d.ts +17 -0
- package/dist/src/genui/genui.d.ts.map +1 -0
- package/dist/src/genui/index.d.ts +19 -0
- package/dist/src/genui/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +102 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/lib/utils.d.ts +2 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/primitives/accordion.d.ts +13 -0
- package/dist/src/primitives/accordion.d.ts.map +1 -0
- package/dist/src/primitives/alert-dialog.d.ts +13 -0
- package/dist/src/primitives/alert-dialog.d.ts.map +1 -0
- package/dist/src/primitives/autocomplete.d.ts +13 -0
- package/dist/src/primitives/autocomplete.d.ts.map +1 -0
- package/dist/src/primitives/avatar.d.ts +13 -0
- package/dist/src/primitives/avatar.d.ts.map +1 -0
- package/dist/src/primitives/button.d.ts +13 -0
- package/dist/src/primitives/button.d.ts.map +1 -0
- package/dist/src/primitives/checkbox-group.d.ts +13 -0
- package/dist/src/primitives/checkbox-group.d.ts.map +1 -0
- package/dist/src/primitives/checkbox.d.ts +13 -0
- package/dist/src/primitives/checkbox.d.ts.map +1 -0
- package/dist/src/primitives/collapsible.d.ts +13 -0
- package/dist/src/primitives/collapsible.d.ts.map +1 -0
- package/dist/src/primitives/combobox.d.ts +13 -0
- package/dist/src/primitives/combobox.d.ts.map +1 -0
- package/dist/src/primitives/context-menu.d.ts +13 -0
- package/dist/src/primitives/context-menu.d.ts.map +1 -0
- package/dist/src/primitives/csp-provider.d.ts +13 -0
- package/dist/src/primitives/csp-provider.d.ts.map +1 -0
- package/dist/src/primitives/dialog.d.ts +13 -0
- package/dist/src/primitives/dialog.d.ts.map +1 -0
- package/dist/src/primitives/direction-provider.d.ts +13 -0
- package/dist/src/primitives/direction-provider.d.ts.map +1 -0
- package/dist/src/primitives/drawer.d.ts +13 -0
- package/dist/src/primitives/drawer.d.ts.map +1 -0
- package/dist/src/primitives/field.d.ts +13 -0
- package/dist/src/primitives/field.d.ts.map +1 -0
- package/dist/src/primitives/fieldset.d.ts +13 -0
- package/dist/src/primitives/fieldset.d.ts.map +1 -0
- package/dist/src/primitives/form.d.ts +13 -0
- package/dist/src/primitives/form.d.ts.map +1 -0
- package/dist/src/primitives/index.d.ts +54 -0
- package/dist/src/primitives/index.d.ts.map +1 -0
- package/dist/src/primitives/input.d.ts +13 -0
- package/dist/src/primitives/input.d.ts.map +1 -0
- package/dist/src/primitives/menu.d.ts +13 -0
- package/dist/src/primitives/menu.d.ts.map +1 -0
- package/dist/src/primitives/menubar.d.ts +13 -0
- package/dist/src/primitives/menubar.d.ts.map +1 -0
- package/dist/src/primitives/meter.d.ts +13 -0
- package/dist/src/primitives/meter.d.ts.map +1 -0
- package/dist/src/primitives/navigation-menu.d.ts +13 -0
- package/dist/src/primitives/navigation-menu.d.ts.map +1 -0
- package/dist/src/primitives/number-field.d.ts +13 -0
- package/dist/src/primitives/number-field.d.ts.map +1 -0
- package/dist/src/primitives/popover.d.ts +13 -0
- package/dist/src/primitives/popover.d.ts.map +1 -0
- package/dist/src/primitives/preview-card.d.ts +13 -0
- package/dist/src/primitives/preview-card.d.ts.map +1 -0
- package/dist/src/primitives/progress.d.ts +13 -0
- package/dist/src/primitives/progress.d.ts.map +1 -0
- package/dist/src/primitives/radio-group.d.ts +13 -0
- package/dist/src/primitives/radio-group.d.ts.map +1 -0
- package/dist/src/primitives/radio.d.ts +13 -0
- package/dist/src/primitives/radio.d.ts.map +1 -0
- package/dist/src/primitives/scroll-area.d.ts +13 -0
- package/dist/src/primitives/scroll-area.d.ts.map +1 -0
- package/dist/src/primitives/select.d.ts +13 -0
- package/dist/src/primitives/select.d.ts.map +1 -0
- package/dist/src/primitives/separator.d.ts +13 -0
- package/dist/src/primitives/separator.d.ts.map +1 -0
- package/dist/src/primitives/slider.d.ts +13 -0
- package/dist/src/primitives/slider.d.ts.map +1 -0
- package/dist/src/primitives/switch.d.ts +13 -0
- package/dist/src/primitives/switch.d.ts.map +1 -0
- package/dist/src/primitives/tabs.d.ts +13 -0
- package/dist/src/primitives/tabs.d.ts.map +1 -0
- package/dist/src/primitives/toast.d.ts +13 -0
- package/dist/src/primitives/toast.d.ts.map +1 -0
- package/dist/src/primitives/toggle-group.d.ts +13 -0
- package/dist/src/primitives/toggle-group.d.ts.map +1 -0
- package/dist/src/primitives/toggle.d.ts +13 -0
- package/dist/src/primitives/toggle.d.ts.map +1 -0
- package/dist/src/primitives/toolbar.d.ts +13 -0
- package/dist/src/primitives/toolbar.d.ts.map +1 -0
- package/dist/src/primitives/tooltip.d.ts +13 -0
- package/dist/src/primitives/tooltip.d.ts.map +1 -0
- package/dist/src/registry/index.d.ts +8 -0
- package/dist/src/registry/index.d.ts.map +1 -0
- package/dist/src/registry/types.d.ts +191 -0
- package/dist/src/registry/types.d.ts.map +1 -0
- package/dist/src/utils/cn.d.ts +4 -0
- package/dist/src/utils/cn.d.ts.map +1 -0
- package/dist/src/utils/highlight-to-react.d.ts +12 -0
- package/dist/src/utils/highlight-to-react.d.ts.map +1 -0
- package/dist/src/utils/index.d.ts +3 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/link-provider.d.ts +12 -0
- package/dist/src/utils/link-provider.d.ts.map +1 -0
- package/dist/src/utils/prop-examples.d.ts +36 -0
- package/dist/src/utils/prop-examples.d.ts.map +1 -0
- package/dist/styles/sf-binding.css +255 -0
- package/dist/styles/sf-standalone.css +2 -0
- package/dist/styles/sf.css +596 -0
- package/dist/styles/theme-fedramp.css +22 -0
- package/dist/styles/theme-minimal.css +127 -0
- package/dist/styles/theme-navigator.css +137 -0
- package/dist/styles/theme-sf.css +191 -0
- package/dist/surface-BduI7Ehl.js +18 -0
- package/dist/surface-BduI7Ehl.js.map +1 -0
- package/dist/switch-CzZBRBL7.js +169 -0
- package/dist/switch-CzZBRBL7.js.map +1 -0
- package/dist/table-CIMx0Oq0.js +200 -0
- package/dist/table-CIMx0Oq0.js.map +1 -0
- package/dist/tabs-1cHrYoel.js +54 -0
- package/dist/tabs-1cHrYoel.js.map +1 -0
- package/dist/text-KJmGkwnf.js +103 -0
- package/dist/text-KJmGkwnf.js.map +1 -0
- package/dist/theme-toggle-Dpgnoj_Q.js +129 -0
- package/dist/theme-toggle-Dpgnoj_Q.js.map +1 -0
- package/dist/toast-Nw28a5Cx.js +161 -0
- package/dist/toast-Nw28a5Cx.js.map +1 -0
- package/dist/tooltip-Cb7QW-7H.js +79 -0
- package/dist/tooltip-Cb7QW-7H.js.map +1 -0
- package/dist/use-agent-harness-DZzcn96L.js +929 -0
- package/dist/use-agent-harness-DZzcn96L.js.map +1 -0
- package/dist/utils.js +4 -0
- package/package.json +620 -0
- package/scripts/component-registry/cache.ts +124 -0
- package/scripts/component-registry/discovery.ts +464 -0
- package/scripts/component-registry/example-cleanup.ts +168 -0
- package/scripts/component-registry/index.test.ts +678 -0
- package/scripts/component-registry/index.ts +931 -0
- package/scripts/component-registry/markdown-generator.ts +222 -0
- package/scripts/component-registry/metadata.ts +653 -0
- package/scripts/component-registry/props-filter.ts +313 -0
- package/scripts/component-registry/schema-generator.ts +332 -0
- package/scripts/component-registry/sub-components.ts +350 -0
- package/scripts/component-registry/types.ts +156 -0
- package/scripts/component-registry/utils.ts +280 -0
- package/scripts/component-registry/variant-parser.ts +262 -0
- package/scripts/css-build.ts +117 -0
- package/scripts/generate-primitives.ts +178 -0
- package/scripts/theme-generator/config.ts +538 -0
- package/scripts/theme-generator/generate-css.ts +256 -0
- package/scripts/theme-generator/index.ts +161 -0
- package/scripts/theme-generator/migrate.ts +584 -0
- package/scripts/theme-generator/types.ts +86 -0
- package/skills/component-selection/SKILL.md +64 -0
- package/skills/installing-blocks/SKILL.md +47 -0
- package/skills/theming-and-tokens/SKILL.md +62 -0
|
@@ -0,0 +1,1122 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
BrainIcon,
|
|
5
|
+
EyeIcon,
|
|
6
|
+
RobotIcon,
|
|
7
|
+
SparkleIcon,
|
|
8
|
+
SpinnerGapIcon,
|
|
9
|
+
StopCircleIcon,
|
|
10
|
+
} from "@phosphor-icons/react";
|
|
11
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
12
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
type AgentHarnessState,
|
|
16
|
+
type AgentMessage,
|
|
17
|
+
type AgentNotice,
|
|
18
|
+
type AgentOMActivity,
|
|
19
|
+
type AgentQuestion,
|
|
20
|
+
type AgentPlanApproval,
|
|
21
|
+
type AgentSubagent,
|
|
22
|
+
type AgentTaskList,
|
|
23
|
+
type AgentThinking,
|
|
24
|
+
type AgentToolCall,
|
|
25
|
+
type AgentUsage,
|
|
26
|
+
type HarnessAdapter,
|
|
27
|
+
type HarnessEvent,
|
|
28
|
+
type UseAgentHarnessReturn,
|
|
29
|
+
createAgentHarnessState,
|
|
30
|
+
fromMastraHarness,
|
|
31
|
+
useAgentHarness,
|
|
32
|
+
} from "../../components/use-agent-harness";
|
|
33
|
+
import {
|
|
34
|
+
AiApproval,
|
|
35
|
+
AiConversation,
|
|
36
|
+
AiConversationScrollButton,
|
|
37
|
+
AiInfoBanner,
|
|
38
|
+
AiMessage,
|
|
39
|
+
AiMessageAction,
|
|
40
|
+
AiMessageActions,
|
|
41
|
+
AiMessageContent,
|
|
42
|
+
AiMessageToolbar,
|
|
43
|
+
AiQuestion,
|
|
44
|
+
AiReasoning,
|
|
45
|
+
AiResponse,
|
|
46
|
+
AiSubagent,
|
|
47
|
+
AiTaskList,
|
|
48
|
+
AiToolCallGroup,
|
|
49
|
+
AiUsageBar,
|
|
50
|
+
Button,
|
|
51
|
+
PromptInput,
|
|
52
|
+
PromptInputAttachButton,
|
|
53
|
+
PromptInputBackLayer,
|
|
54
|
+
PromptInputModeSelector,
|
|
55
|
+
PromptInputSpeechButton,
|
|
56
|
+
PromptInputSubmit,
|
|
57
|
+
PromptInputTextarea,
|
|
58
|
+
PromptInputToolbar,
|
|
59
|
+
PromptInputTools,
|
|
60
|
+
cn,
|
|
61
|
+
useConversationVirtualizer,
|
|
62
|
+
type ConversationItem,
|
|
63
|
+
} from "../../index";
|
|
64
|
+
|
|
65
|
+
// ─── Block imports patched at install time to @signalflare-ai/ui ─────────────
|
|
66
|
+
// (fromMastraHarness + useAgentHarness are in the library, so they get
|
|
67
|
+
// rewritten by the CLI transformer alongside the UI imports above)
|
|
68
|
+
|
|
69
|
+
// ─── Variants ─────────────────────────────────────────────────────────────────
|
|
70
|
+
|
|
71
|
+
export const SF_AGENT_HARNESS_VARIANTS = {
|
|
72
|
+
hitlPlacement: {
|
|
73
|
+
inline: {
|
|
74
|
+
description:
|
|
75
|
+
"Render approval/question cards inline in the conversation stream",
|
|
76
|
+
},
|
|
77
|
+
"back-layer": {
|
|
78
|
+
description:
|
|
79
|
+
"Render approval/question cards in the PromptInput back layer",
|
|
80
|
+
},
|
|
81
|
+
both: {
|
|
82
|
+
description:
|
|
83
|
+
"Render approval/question cards both inline and in the back layer",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
} as const;
|
|
87
|
+
|
|
88
|
+
export const SF_AGENT_HARNESS_DEFAULT_VARIANTS = {
|
|
89
|
+
hitlPlacement: "inline",
|
|
90
|
+
} as const;
|
|
91
|
+
|
|
92
|
+
export type SFAgentHarnessHitlPlacement =
|
|
93
|
+
keyof typeof SF_AGENT_HARNESS_VARIANTS.hitlPlacement;
|
|
94
|
+
|
|
95
|
+
// ─── Props ────────────────────────────────────────────────────────────────────
|
|
96
|
+
|
|
97
|
+
export interface AgentHarnessProps extends ComponentProps<"div"> {
|
|
98
|
+
// ── Uncontrolled mode — hook manages state ─────────────────────────────────
|
|
99
|
+
/**
|
|
100
|
+
* A HarnessAdapter to subscribe to, OR a raw Mastra Harness instance.
|
|
101
|
+
* Pass `null` to render in "static/demo" mode with no live events.
|
|
102
|
+
* Ignored when `state` is provided.
|
|
103
|
+
*/
|
|
104
|
+
adapter?: HarnessAdapter | null;
|
|
105
|
+
|
|
106
|
+
// ── Controlled mode — consumer manages state ───────────────────────────────
|
|
107
|
+
/**
|
|
108
|
+
* Provide your own `AgentHarnessState` to fully control rendering.
|
|
109
|
+
* When set, `adapter` is ignored and all action callbacks must be provided.
|
|
110
|
+
*
|
|
111
|
+
* Build state from any source — Durable Streams, Zustand, Redux, a Mastra
|
|
112
|
+
* harness mapped through your own reducer, etc. Use `createAgentHarnessState()`
|
|
113
|
+
* to create the initial empty state.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```tsx
|
|
117
|
+
* const state = useMastraToAgentState(harness);
|
|
118
|
+
* <AgentHarness
|
|
119
|
+
* state={state}
|
|
120
|
+
* onSendMessage={({ content }) => harness.send(content)}
|
|
121
|
+
* onApproveToolCall={(d) => harness.approve(d)}
|
|
122
|
+
* />
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
state?: AgentHarnessState;
|
|
126
|
+
/**
|
|
127
|
+
* Send a user message. Required in controlled mode.
|
|
128
|
+
*/
|
|
129
|
+
onSendMessage?: (params: {
|
|
130
|
+
content: string;
|
|
131
|
+
files?: Array<{ url: string; mediaType: string; filename: string }>;
|
|
132
|
+
}) => void | Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Respond to a pending tool approval. Required in controlled mode when tool approvals are used.
|
|
135
|
+
*/
|
|
136
|
+
onApproveToolCall?: (decision: "approve" | "decline") => void | Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Answer a pending question. Required in controlled mode when questions are used.
|
|
139
|
+
*/
|
|
140
|
+
onAnswerQuestion?: (
|
|
141
|
+
questionId: string,
|
|
142
|
+
answer: string
|
|
143
|
+
) => void | Promise<void>;
|
|
144
|
+
/**
|
|
145
|
+
* Respond to a pending plan approval. Required in controlled mode when plan approvals are used.
|
|
146
|
+
*/
|
|
147
|
+
onApprovePlan?: (
|
|
148
|
+
planId: string,
|
|
149
|
+
response: { action: "approved" | "rejected"; feedback?: string }
|
|
150
|
+
) => void | Promise<void>;
|
|
151
|
+
/**
|
|
152
|
+
* Abort any in-progress generation. Required in controlled mode.
|
|
153
|
+
*/
|
|
154
|
+
onAbort?: () => void;
|
|
155
|
+
|
|
156
|
+
// ── Shared props (work in both modes) ─────────────────────────────────────
|
|
157
|
+
/**
|
|
158
|
+
* Placement for interactive HITL elements (approvals, questions, plans).
|
|
159
|
+
* @default "inline"
|
|
160
|
+
*/
|
|
161
|
+
hitlPlacement?: SFAgentHarnessHitlPlacement;
|
|
162
|
+
/**
|
|
163
|
+
* Show the mode badge in the header (mode name + color dot).
|
|
164
|
+
* @default true
|
|
165
|
+
*/
|
|
166
|
+
showMode?: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Show the model badge in the header.
|
|
169
|
+
* @default true
|
|
170
|
+
*/
|
|
171
|
+
showModel?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Show token usage bar above the prompt input.
|
|
174
|
+
* @default true
|
|
175
|
+
*/
|
|
176
|
+
showUsage?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Show the task list in the back layer when tasks are present.
|
|
179
|
+
* @default true
|
|
180
|
+
*/
|
|
181
|
+
showTaskList?: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Placeholder text for the prompt input.
|
|
184
|
+
* @default "Ask anything..."
|
|
185
|
+
*/
|
|
186
|
+
placeholder?: string;
|
|
187
|
+
/**
|
|
188
|
+
* Header slot — rendered at the top of the block (e.g., mode picker, model
|
|
189
|
+
* dropdown, thread list trigger). When omitted, a minimal default header is
|
|
190
|
+
* rendered showing the current mode + model.
|
|
191
|
+
*/
|
|
192
|
+
header?: ReactNode;
|
|
193
|
+
/**
|
|
194
|
+
* Footer slot — rendered below the prompt input (e.g., disclaimer text).
|
|
195
|
+
*/
|
|
196
|
+
footer?: ReactNode;
|
|
197
|
+
/**
|
|
198
|
+
* Empty state — rendered when there are no messages.
|
|
199
|
+
*/
|
|
200
|
+
emptyState?: ReactNode;
|
|
201
|
+
/**
|
|
202
|
+
* Override the submit button. Receives the current harness state.
|
|
203
|
+
*/
|
|
204
|
+
renderSubmit?: (state: AgentHarnessState) => ReactNode;
|
|
205
|
+
/**
|
|
206
|
+
* Suggestions to show when the conversation is empty.
|
|
207
|
+
*/
|
|
208
|
+
suggestions?: string[];
|
|
209
|
+
/**
|
|
210
|
+
* Callback when a suggestion is clicked — defaults to sending the suggestion
|
|
211
|
+
* as a message.
|
|
212
|
+
*/
|
|
213
|
+
onSuggestionClick?: (suggestion: string) => void;
|
|
214
|
+
/**
|
|
215
|
+
* Allow file attachments in the prompt input.
|
|
216
|
+
* @default false
|
|
217
|
+
*/
|
|
218
|
+
allowAttachments?: boolean;
|
|
219
|
+
/**
|
|
220
|
+
* Allow speech input in the prompt input.
|
|
221
|
+
* @default false
|
|
222
|
+
*/
|
|
223
|
+
allowSpeech?: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* Available modes for the mode selector in the toolbar.
|
|
226
|
+
* When provided, a mode selector will be shown in the prompt input toolbar.
|
|
227
|
+
*/
|
|
228
|
+
availableModes?: { modeId: string; modeName: string }[];
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// ─── Internal helpers ─────────────────────────────────────────────────────────
|
|
232
|
+
|
|
233
|
+
function getModelDisplayName(modelId?: string, modelName?: string): string {
|
|
234
|
+
if (modelName) return modelName;
|
|
235
|
+
if (!modelId) return "";
|
|
236
|
+
return modelId.split("/").pop() ?? modelId;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/** Render a single OM activity as an AiReasoning with the right icon/label. */
|
|
240
|
+
function OmActivityView({ activity }: { activity: AgentOMActivity }) {
|
|
241
|
+
const isObservation = activity.type === "observation";
|
|
242
|
+
return (
|
|
243
|
+
<AiReasoning
|
|
244
|
+
part={{ text: activity.text ?? "" }}
|
|
245
|
+
isStreaming={activity.status === "streaming"}
|
|
246
|
+
icon={isObservation ? EyeIcon : BrainIcon}
|
|
247
|
+
label={isObservation ? "Observed" : "Reflected"}
|
|
248
|
+
streamingLabel={isObservation ? "Observing..." : "Reflecting..."}
|
|
249
|
+
variant="default"
|
|
250
|
+
/>
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/** Render all tool calls for a message / subagent as a group. */
|
|
255
|
+
function ToolCallsView({
|
|
256
|
+
toolCallIds,
|
|
257
|
+
toolCalls,
|
|
258
|
+
pendingApprovalId,
|
|
259
|
+
onApprove,
|
|
260
|
+
onReject,
|
|
261
|
+
}: {
|
|
262
|
+
toolCallIds: string[];
|
|
263
|
+
toolCalls: Record<string, AgentToolCall>;
|
|
264
|
+
pendingApprovalId?: string;
|
|
265
|
+
onApprove?: () => void;
|
|
266
|
+
onReject?: () => void;
|
|
267
|
+
}) {
|
|
268
|
+
const parts = toolCallIds
|
|
269
|
+
.map((id) => toolCalls[id])
|
|
270
|
+
.filter(Boolean)
|
|
271
|
+
.map((tc) => ({
|
|
272
|
+
toolCallId: tc.id,
|
|
273
|
+
toolName: tc.toolName,
|
|
274
|
+
state: tc.state,
|
|
275
|
+
input: tc.input,
|
|
276
|
+
output: tc.output,
|
|
277
|
+
errorText: tc.errorText,
|
|
278
|
+
}));
|
|
279
|
+
|
|
280
|
+
if (parts.length === 0) return null;
|
|
281
|
+
|
|
282
|
+
const approvalStates: Record<
|
|
283
|
+
string,
|
|
284
|
+
"awaiting" | "approved" | "declined" | undefined
|
|
285
|
+
> = {};
|
|
286
|
+
for (const tc of Object.values(toolCalls)) {
|
|
287
|
+
if (toolCallIds.includes(tc.id)) {
|
|
288
|
+
approvalStates[tc.id] = tc.approvalState;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const durations: Record<string, number> = {};
|
|
293
|
+
const summaries: Record<string, string> = {};
|
|
294
|
+
for (const tc of Object.values(toolCalls)) {
|
|
295
|
+
if (toolCallIds.includes(tc.id)) {
|
|
296
|
+
if (tc.durationMs !== undefined) durations[tc.id] = tc.durationMs;
|
|
297
|
+
if (tc.summary) summaries[tc.id] = tc.summary;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
return (
|
|
302
|
+
<AiToolCallGroup
|
|
303
|
+
parts={parts}
|
|
304
|
+
approvalStates={approvalStates}
|
|
305
|
+
durations={Object.keys(durations).length > 0 ? durations : undefined}
|
|
306
|
+
summaries={Object.keys(summaries).length > 0 ? summaries : undefined}
|
|
307
|
+
onApprove={pendingApprovalId ? () => onApprove?.() : undefined}
|
|
308
|
+
onReject={pendingApprovalId ? () => onReject?.() : undefined}
|
|
309
|
+
/>
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/** Render a single subagent with its nested content. */
|
|
314
|
+
function SubagentView({
|
|
315
|
+
subagent,
|
|
316
|
+
toolCalls,
|
|
317
|
+
pendingApprovalId,
|
|
318
|
+
onApprove,
|
|
319
|
+
onReject,
|
|
320
|
+
}: {
|
|
321
|
+
subagent: AgentSubagent;
|
|
322
|
+
toolCalls: Record<string, AgentToolCall>;
|
|
323
|
+
pendingApprovalId?: string;
|
|
324
|
+
onApprove?: () => void;
|
|
325
|
+
onReject?: () => void;
|
|
326
|
+
}) {
|
|
327
|
+
return (
|
|
328
|
+
<AiSubagent
|
|
329
|
+
agentType={subagent.agentType}
|
|
330
|
+
name={subagent.name}
|
|
331
|
+
status={subagent.status}
|
|
332
|
+
modelId={subagent.modelId}
|
|
333
|
+
duration={subagent.durationMs}
|
|
334
|
+
defaultExpanded={subagent.status === "running"}
|
|
335
|
+
>
|
|
336
|
+
<div className="flex flex-col gap-2">
|
|
337
|
+
{subagent.content && (
|
|
338
|
+
<AiResponse isAnimating={subagent.status === "running"}>
|
|
339
|
+
{subagent.content}
|
|
340
|
+
</AiResponse>
|
|
341
|
+
)}
|
|
342
|
+
<ToolCallsView
|
|
343
|
+
toolCallIds={subagent.toolCallIds}
|
|
344
|
+
toolCalls={toolCalls}
|
|
345
|
+
pendingApprovalId={pendingApprovalId}
|
|
346
|
+
onApprove={onApprove}
|
|
347
|
+
onReject={onReject}
|
|
348
|
+
/>
|
|
349
|
+
</div>
|
|
350
|
+
</AiSubagent>
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/** Render a question inline. */
|
|
355
|
+
function QuestionView({
|
|
356
|
+
question,
|
|
357
|
+
onAnswer,
|
|
358
|
+
}: {
|
|
359
|
+
question: AgentQuestion;
|
|
360
|
+
onAnswer: (questionId: string, answer: string) => void;
|
|
361
|
+
}) {
|
|
362
|
+
return (
|
|
363
|
+
<AiQuestion
|
|
364
|
+
questionId={question.questionId}
|
|
365
|
+
question={question.question}
|
|
366
|
+
header={question.header}
|
|
367
|
+
options={question.options}
|
|
368
|
+
multiple={question.multiple}
|
|
369
|
+
allowCustom={question.allowCustom ?? true}
|
|
370
|
+
status={question.status}
|
|
371
|
+
answeredWith={question.answeredWith}
|
|
372
|
+
onAnswer={onAnswer}
|
|
373
|
+
/>
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/** Render a plan approval inline. */
|
|
378
|
+
function PlanApprovalView({
|
|
379
|
+
plan,
|
|
380
|
+
onApprove,
|
|
381
|
+
onReject,
|
|
382
|
+
}: {
|
|
383
|
+
plan: AgentPlanApproval;
|
|
384
|
+
onApprove: () => void;
|
|
385
|
+
onReject: (feedback?: string) => void;
|
|
386
|
+
}) {
|
|
387
|
+
return (
|
|
388
|
+
<AiApproval
|
|
389
|
+
kind="plan"
|
|
390
|
+
title={plan.title}
|
|
391
|
+
description={plan.description}
|
|
392
|
+
items={plan.steps?.map((s) => ({
|
|
393
|
+
id: s.id,
|
|
394
|
+
label: s.label,
|
|
395
|
+
description: s.description,
|
|
396
|
+
}))}
|
|
397
|
+
status={plan.status}
|
|
398
|
+
onApprove={onApprove}
|
|
399
|
+
onReject={onReject}
|
|
400
|
+
showFeedback={plan.status === "pending"}
|
|
401
|
+
/>
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/** Render an assistant message body: reasoning, response, tool calls, subagents, HITL. */
|
|
406
|
+
function AssistantMessageBody({
|
|
407
|
+
message,
|
|
408
|
+
harnessState,
|
|
409
|
+
hitlPlacement,
|
|
410
|
+
onApprove,
|
|
411
|
+
onReject,
|
|
412
|
+
onAnswer,
|
|
413
|
+
onPlanApprove,
|
|
414
|
+
onPlanReject,
|
|
415
|
+
}: {
|
|
416
|
+
message: AgentMessage;
|
|
417
|
+
harnessState: AgentHarnessState;
|
|
418
|
+
hitlPlacement: SFAgentHarnessHitlPlacement;
|
|
419
|
+
onApprove: () => void;
|
|
420
|
+
onReject: () => void;
|
|
421
|
+
onAnswer: (questionId: string, answer: string) => void;
|
|
422
|
+
onPlanApprove: (planId: string) => void;
|
|
423
|
+
onPlanReject: (planId: string, feedback?: string) => void;
|
|
424
|
+
}) {
|
|
425
|
+
// OM activities attached to this message
|
|
426
|
+
const omActivities = Object.values(harnessState.omActivities).filter(
|
|
427
|
+
(a) => a.messageId === message.id
|
|
428
|
+
);
|
|
429
|
+
|
|
430
|
+
// Thinking blocks attached to this message (in order)
|
|
431
|
+
const thinkingBlocks = message.thinkingIds
|
|
432
|
+
.map((id) => harnessState.thinkings[id])
|
|
433
|
+
.filter((t): t is AgentThinking => t != null);
|
|
434
|
+
|
|
435
|
+
// Subagents attached to this message
|
|
436
|
+
const subagents = message.subagentIds
|
|
437
|
+
.map((id) => harnessState.subagents[id])
|
|
438
|
+
.filter(Boolean);
|
|
439
|
+
|
|
440
|
+
// Pending question for this message
|
|
441
|
+
const question = message.questionId
|
|
442
|
+
? harnessState.questions[message.questionId]
|
|
443
|
+
: harnessState.pendingQuestionId
|
|
444
|
+
? harnessState.questions[harnessState.pendingQuestionId]
|
|
445
|
+
: undefined;
|
|
446
|
+
|
|
447
|
+
// Pending plan for this message
|
|
448
|
+
const plan =
|
|
449
|
+
harnessState.pendingPlanId &&
|
|
450
|
+
(message.planId === harnessState.pendingPlanId || !message.planId)
|
|
451
|
+
? harnessState.planApprovals[harnessState.pendingPlanId]
|
|
452
|
+
: undefined;
|
|
453
|
+
|
|
454
|
+
const showInlineHitl = hitlPlacement === "inline" || hitlPlacement === "both";
|
|
455
|
+
|
|
456
|
+
return (
|
|
457
|
+
<div className="flex flex-col gap-2">
|
|
458
|
+
{/* Thinking / reasoning blocks */}
|
|
459
|
+
{thinkingBlocks.map((t) => (
|
|
460
|
+
<AiReasoning
|
|
461
|
+
key={t.id}
|
|
462
|
+
part={{ text: t.text }}
|
|
463
|
+
isStreaming={t.isStreaming}
|
|
464
|
+
icon={SparkleIcon}
|
|
465
|
+
label="Reasoning"
|
|
466
|
+
streamingLabel="Thinking..."
|
|
467
|
+
variant="default"
|
|
468
|
+
/>
|
|
469
|
+
))}
|
|
470
|
+
|
|
471
|
+
{/* OM activities (observations / reflections) */}
|
|
472
|
+
{omActivities.map((a) => (
|
|
473
|
+
<OmActivityView key={a.id} activity={a} />
|
|
474
|
+
))}
|
|
475
|
+
|
|
476
|
+
{/* Response text */}
|
|
477
|
+
{message.content && (
|
|
478
|
+
<AiResponse isAnimating={message.isStreaming}>
|
|
479
|
+
{message.content}
|
|
480
|
+
</AiResponse>
|
|
481
|
+
)}
|
|
482
|
+
|
|
483
|
+
{/* Tool calls (top-level, no subagent) */}
|
|
484
|
+
{message.toolCallIds.length > 0 && (
|
|
485
|
+
<ToolCallsView
|
|
486
|
+
toolCallIds={message.toolCallIds}
|
|
487
|
+
toolCalls={harnessState.toolCalls}
|
|
488
|
+
pendingApprovalId={harnessState.pendingToolApprovalId}
|
|
489
|
+
onApprove={onApprove}
|
|
490
|
+
onReject={onReject}
|
|
491
|
+
/>
|
|
492
|
+
)}
|
|
493
|
+
|
|
494
|
+
{/* Subagents */}
|
|
495
|
+
{subagents.map((sa) => (
|
|
496
|
+
<SubagentView
|
|
497
|
+
key={sa.id}
|
|
498
|
+
subagent={sa}
|
|
499
|
+
toolCalls={harnessState.toolCalls}
|
|
500
|
+
pendingApprovalId={harnessState.pendingToolApprovalId}
|
|
501
|
+
onApprove={onApprove}
|
|
502
|
+
onReject={onReject}
|
|
503
|
+
/>
|
|
504
|
+
))}
|
|
505
|
+
|
|
506
|
+
{/* HITL — Question */}
|
|
507
|
+
{showInlineHitl && question && (
|
|
508
|
+
<QuestionView question={question} onAnswer={onAnswer} />
|
|
509
|
+
)}
|
|
510
|
+
|
|
511
|
+
{/* HITL — Plan approval */}
|
|
512
|
+
{showInlineHitl && plan && (
|
|
513
|
+
<PlanApprovalView
|
|
514
|
+
plan={plan}
|
|
515
|
+
onApprove={() => onPlanApprove(plan.planId)}
|
|
516
|
+
onReject={(feedback) => onPlanReject(plan.planId, feedback)}
|
|
517
|
+
/>
|
|
518
|
+
)}
|
|
519
|
+
</div>
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/** Back-layer content: tasks + optional HITL when hitlPlacement includes back-layer. */
|
|
524
|
+
function BackLayerContent({
|
|
525
|
+
taskList,
|
|
526
|
+
usage,
|
|
527
|
+
showUsage,
|
|
528
|
+
pendingQuestion,
|
|
529
|
+
pendingPlan,
|
|
530
|
+
hitlPlacement,
|
|
531
|
+
onAnswer,
|
|
532
|
+
onPlanApprove,
|
|
533
|
+
onPlanReject,
|
|
534
|
+
}: {
|
|
535
|
+
taskList: AgentTaskList | null;
|
|
536
|
+
usage: AgentUsage | null;
|
|
537
|
+
showUsage: boolean;
|
|
538
|
+
pendingQuestion?: AgentQuestion;
|
|
539
|
+
pendingPlan?: AgentPlanApproval;
|
|
540
|
+
hitlPlacement: SFAgentHarnessHitlPlacement;
|
|
541
|
+
onAnswer: (questionId: string, answer: string) => void;
|
|
542
|
+
onPlanApprove: (planId: string) => void;
|
|
543
|
+
onPlanReject: (planId: string, feedback?: string) => void;
|
|
544
|
+
}) {
|
|
545
|
+
const showBackLayerHitl =
|
|
546
|
+
hitlPlacement === "back-layer" || hitlPlacement === "both";
|
|
547
|
+
|
|
548
|
+
const hasContent =
|
|
549
|
+
taskList ||
|
|
550
|
+
(showUsage && usage) ||
|
|
551
|
+
(showBackLayerHitl && (pendingQuestion || pendingPlan));
|
|
552
|
+
|
|
553
|
+
if (!hasContent) return null;
|
|
554
|
+
|
|
555
|
+
return (
|
|
556
|
+
<PromptInputBackLayer>
|
|
557
|
+
<div className="flex flex-col gap-3">
|
|
558
|
+
{showUsage && usage && <AiUsageBar {...usage} />}
|
|
559
|
+
|
|
560
|
+
{taskList && (
|
|
561
|
+
<AiTaskList tasks={taskList.tasks} title={taskList.title} />
|
|
562
|
+
)}
|
|
563
|
+
|
|
564
|
+
{showBackLayerHitl && pendingQuestion && (
|
|
565
|
+
<QuestionView question={pendingQuestion} onAnswer={onAnswer} />
|
|
566
|
+
)}
|
|
567
|
+
|
|
568
|
+
{showBackLayerHitl && pendingPlan && (
|
|
569
|
+
<PlanApprovalView
|
|
570
|
+
plan={pendingPlan}
|
|
571
|
+
onApprove={() => onPlanApprove(pendingPlan.planId)}
|
|
572
|
+
onReject={(feedback) => onPlanReject(pendingPlan.planId, feedback)}
|
|
573
|
+
/>
|
|
574
|
+
)}
|
|
575
|
+
</div>
|
|
576
|
+
</PromptInputBackLayer>
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/** Default header — mode + model badges. */
|
|
581
|
+
function DefaultHeader({
|
|
582
|
+
isRunning,
|
|
583
|
+
onAbort,
|
|
584
|
+
}: {
|
|
585
|
+
isRunning: boolean;
|
|
586
|
+
onAbort: () => void;
|
|
587
|
+
}) {
|
|
588
|
+
return (
|
|
589
|
+
<div className="flex items-center justify-between gap-3 border-b border-sf-line px-4 py-2.5">
|
|
590
|
+
<div className="flex items-center gap-2">
|
|
591
|
+
<RobotIcon size={16} className="text-sf-subtle" />
|
|
592
|
+
<span className="text-sm font-medium text-sf-default">Agent</span>
|
|
593
|
+
</div>
|
|
594
|
+
{isRunning && (
|
|
595
|
+
<Button
|
|
596
|
+
variant="ghost"
|
|
597
|
+
size="sm"
|
|
598
|
+
shape="square"
|
|
599
|
+
aria-label="Abort generation"
|
|
600
|
+
onClick={onAbort}
|
|
601
|
+
>
|
|
602
|
+
<StopCircleIcon size={16} />
|
|
603
|
+
</Button>
|
|
604
|
+
)}
|
|
605
|
+
</div>
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
// ─── Main Component ───────────────────────────────────────────────────────────
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* `AgentHarness` — a full-chrome agent chat UI block.
|
|
613
|
+
*
|
|
614
|
+
* Composes all SignalFlare AI components into a complete, event-driven chat
|
|
615
|
+
* experience driven by a `HarnessAdapter` (or Mastra Harness instance).
|
|
616
|
+
*
|
|
617
|
+
* **State is decoupled** — use `useAgentHarness` directly when you need a
|
|
618
|
+
* custom layout or headless control.
|
|
619
|
+
*
|
|
620
|
+
* @example
|
|
621
|
+
* ```tsx
|
|
622
|
+
* import { AgentHarness, fromMastraHarness } from "./components/sf/agent-harness/agent-harness";
|
|
623
|
+
*
|
|
624
|
+
* export function App() {
|
|
625
|
+
* const adapter = fromMastraHarness(harness);
|
|
626
|
+
* return <AgentHarness adapter={adapter} />;
|
|
627
|
+
* }
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
export function AgentHarness({
|
|
631
|
+
adapter = null,
|
|
632
|
+
state: controlledState,
|
|
633
|
+
onSendMessage,
|
|
634
|
+
onApproveToolCall,
|
|
635
|
+
onAnswerQuestion,
|
|
636
|
+
onApprovePlan,
|
|
637
|
+
onAbort,
|
|
638
|
+
hitlPlacement = SF_AGENT_HARNESS_DEFAULT_VARIANTS.hitlPlacement,
|
|
639
|
+
showMode = true,
|
|
640
|
+
showModel = true,
|
|
641
|
+
showUsage = true,
|
|
642
|
+
showTaskList = true,
|
|
643
|
+
placeholder = "Ask anything...",
|
|
644
|
+
header,
|
|
645
|
+
footer,
|
|
646
|
+
emptyState,
|
|
647
|
+
renderSubmit,
|
|
648
|
+
suggestions,
|
|
649
|
+
onSuggestionClick,
|
|
650
|
+
allowAttachments = false,
|
|
651
|
+
allowSpeech = false,
|
|
652
|
+
availableModes,
|
|
653
|
+
className,
|
|
654
|
+
...props
|
|
655
|
+
}: AgentHarnessProps) {
|
|
656
|
+
const scrollRef = useRef<HTMLDivElement>(null);
|
|
657
|
+
const [isBackLayerOpen, setIsBackLayerOpen] = useState(false);
|
|
658
|
+
|
|
659
|
+
// Uncontrolled: adapter drives the hook. Controlled: hook is disabled (null adapter).
|
|
660
|
+
const harness = useAgentHarness({
|
|
661
|
+
adapter: controlledState ? null : adapter,
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
// Dev-only warning: in controlled mode, required callbacks should be provided
|
|
665
|
+
if (process.env.NODE_ENV !== "production" && controlledState) {
|
|
666
|
+
if (!onSendMessage) {
|
|
667
|
+
console.warn(
|
|
668
|
+
"[AgentHarness] Controlled mode: `onSendMessage` is not provided — user messages will be silently dropped."
|
|
669
|
+
);
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
// Resolve state — controlled takes priority over hook state
|
|
674
|
+
const state = controlledState ?? harness.state;
|
|
675
|
+
|
|
676
|
+
// Resolve action callbacks — controlled props take priority over hook methods
|
|
677
|
+
const sendMessage = onSendMessage ?? harness.sendMessage;
|
|
678
|
+
const respondToToolApproval =
|
|
679
|
+
onApproveToolCall != null
|
|
680
|
+
? (decision: "approve" | "decline") => onApproveToolCall(decision)
|
|
681
|
+
: harness.respondToToolApproval;
|
|
682
|
+
const respondToQuestion =
|
|
683
|
+
onAnswerQuestion != null
|
|
684
|
+
? (questionId: string, answer: string) =>
|
|
685
|
+
onAnswerQuestion(questionId, answer)
|
|
686
|
+
: harness.respondToQuestion;
|
|
687
|
+
const respondToPlanApproval =
|
|
688
|
+
onApprovePlan != null
|
|
689
|
+
? (
|
|
690
|
+
planId: string,
|
|
691
|
+
response: { action: "approved" | "rejected"; feedback?: string }
|
|
692
|
+
) => onApprovePlan(planId, response)
|
|
693
|
+
: harness.respondToPlanApproval;
|
|
694
|
+
const abort = onAbort ?? harness.abort;
|
|
695
|
+
const selectMode = harness.selectMode;
|
|
696
|
+
|
|
697
|
+
// ── Callbacks ──────────────────────────────────────────────────────────────
|
|
698
|
+
const handleSubmit = useCallback(
|
|
699
|
+
async ({
|
|
700
|
+
text,
|
|
701
|
+
files,
|
|
702
|
+
}: {
|
|
703
|
+
text?: string;
|
|
704
|
+
files?: Array<{ url: string; mediaType: string; filename: string }>;
|
|
705
|
+
}) => {
|
|
706
|
+
if (!text?.trim() && !files?.length) return;
|
|
707
|
+
await sendMessage({ content: text ?? "", files });
|
|
708
|
+
},
|
|
709
|
+
[sendMessage]
|
|
710
|
+
);
|
|
711
|
+
|
|
712
|
+
const handleApprove = useCallback(async () => {
|
|
713
|
+
await respondToToolApproval("approve");
|
|
714
|
+
}, [respondToToolApproval]);
|
|
715
|
+
|
|
716
|
+
const handleReject = useCallback(async () => {
|
|
717
|
+
await respondToToolApproval("decline");
|
|
718
|
+
}, [respondToToolApproval]);
|
|
719
|
+
|
|
720
|
+
const handleAnswer = useCallback(
|
|
721
|
+
async (questionId: string, answer: string) => {
|
|
722
|
+
await respondToQuestion(questionId, answer);
|
|
723
|
+
},
|
|
724
|
+
[respondToQuestion]
|
|
725
|
+
);
|
|
726
|
+
|
|
727
|
+
const handlePlanApprove = useCallback(
|
|
728
|
+
async (planId: string) => {
|
|
729
|
+
await respondToPlanApproval(planId, { action: "approved" });
|
|
730
|
+
},
|
|
731
|
+
[respondToPlanApproval]
|
|
732
|
+
);
|
|
733
|
+
|
|
734
|
+
const handlePlanReject = useCallback(
|
|
735
|
+
async (planId: string, feedback?: string) => {
|
|
736
|
+
await respondToPlanApproval(planId, { action: "rejected", feedback });
|
|
737
|
+
},
|
|
738
|
+
[respondToPlanApproval]
|
|
739
|
+
);
|
|
740
|
+
|
|
741
|
+
const handleSuggestion = useCallback(
|
|
742
|
+
async (suggestion: string) => {
|
|
743
|
+
if (onSuggestionClick) {
|
|
744
|
+
onSuggestionClick(suggestion);
|
|
745
|
+
} else {
|
|
746
|
+
await sendMessage({ content: suggestion });
|
|
747
|
+
}
|
|
748
|
+
},
|
|
749
|
+
[onSuggestionClick, sendMessage]
|
|
750
|
+
);
|
|
751
|
+
|
|
752
|
+
// ── Derived ────────────────────────────────────────────────────────────────
|
|
753
|
+
const pendingQuestion = state.pendingQuestionId
|
|
754
|
+
? state.questions[state.pendingQuestionId]
|
|
755
|
+
: undefined;
|
|
756
|
+
|
|
757
|
+
const pendingPlan = state.pendingPlanId
|
|
758
|
+
? state.planApprovals[state.pendingPlanId]
|
|
759
|
+
: undefined;
|
|
760
|
+
|
|
761
|
+
// Auto-open back layer when pending items appear
|
|
762
|
+
useEffect(() => {
|
|
763
|
+
if (pendingQuestion || pendingPlan) {
|
|
764
|
+
setIsBackLayerOpen(true);
|
|
765
|
+
}
|
|
766
|
+
}, [pendingQuestion, pendingPlan]);
|
|
767
|
+
|
|
768
|
+
const hasBackLayerContent =
|
|
769
|
+
(showTaskList && !!state.taskList) ||
|
|
770
|
+
(showUsage && !!state.usage) ||
|
|
771
|
+
((hitlPlacement === "back-layer" || hitlPlacement === "both") &&
|
|
772
|
+
(!!pendingQuestion || !!pendingPlan));
|
|
773
|
+
|
|
774
|
+
const promptStatus = state.isRunning ? "streaming" : "idle";
|
|
775
|
+
|
|
776
|
+
const isEmpty = state.messageIds.length === 0;
|
|
777
|
+
|
|
778
|
+
// ── Build flat item list for virtualizer ───────────────────────────────────
|
|
779
|
+
const conversationItems: ConversationItem[] = useMemo(() => {
|
|
780
|
+
const items: ConversationItem[] = [];
|
|
781
|
+
|
|
782
|
+
// Empty state
|
|
783
|
+
if (isEmpty) {
|
|
784
|
+
if (emptyState) {
|
|
785
|
+
items.push({
|
|
786
|
+
key: "__empty__",
|
|
787
|
+
render: () => (
|
|
788
|
+
<div className="flex flex-col items-center justify-center py-16 text-center">
|
|
789
|
+
{emptyState}
|
|
790
|
+
</div>
|
|
791
|
+
),
|
|
792
|
+
});
|
|
793
|
+
} else if (suggestions && suggestions.length > 0) {
|
|
794
|
+
items.push({
|
|
795
|
+
key: "__suggestions__",
|
|
796
|
+
render: () => (
|
|
797
|
+
<div className="flex flex-col items-center gap-4 py-16">
|
|
798
|
+
<div className="flex flex-col items-center gap-1">
|
|
799
|
+
<RobotIcon size={32} className="text-sf-subtle" />
|
|
800
|
+
<p className="text-sm text-sf-subtle">
|
|
801
|
+
How can I help you today?
|
|
802
|
+
</p>
|
|
803
|
+
</div>
|
|
804
|
+
<div className="flex flex-wrap justify-center gap-2">
|
|
805
|
+
{suggestions.map((s) => (
|
|
806
|
+
<button
|
|
807
|
+
key={s}
|
|
808
|
+
type="button"
|
|
809
|
+
onClick={() => handleSuggestion(s)}
|
|
810
|
+
className="rounded-full border border-sf-line bg-sf-elevated px-3 py-1.5 text-sm text-sf-strong transition-colors hover:bg-sf-tint hover:text-sf-default"
|
|
811
|
+
>
|
|
812
|
+
{s}
|
|
813
|
+
</button>
|
|
814
|
+
))}
|
|
815
|
+
</div>
|
|
816
|
+
</div>
|
|
817
|
+
),
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
// Spinner when waiting for first message
|
|
822
|
+
if (state.isRunning) {
|
|
823
|
+
items.push({
|
|
824
|
+
key: "__spinner__",
|
|
825
|
+
render: () => (
|
|
826
|
+
<div className="flex items-center gap-2 px-4 py-3 text-sm text-sf-subtle">
|
|
827
|
+
<SpinnerGapIcon
|
|
828
|
+
size={14}
|
|
829
|
+
className="animate-spin text-sf-brand"
|
|
830
|
+
/>
|
|
831
|
+
<span>Thinking…</span>
|
|
832
|
+
</div>
|
|
833
|
+
),
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
return items;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
// Messages + interspersed notices
|
|
841
|
+
for (const msgId of state.messageIds) {
|
|
842
|
+
const msg = state.messages[msgId];
|
|
843
|
+
if (!msg) continue;
|
|
844
|
+
|
|
845
|
+
// Notices attached to this message (render before the message)
|
|
846
|
+
const attachedNotices = state.notices.filter(
|
|
847
|
+
(n) => n.messageId === msgId
|
|
848
|
+
);
|
|
849
|
+
for (const notice of attachedNotices) {
|
|
850
|
+
items.push({
|
|
851
|
+
key: `notice-${notice.id}`,
|
|
852
|
+
render: () => (
|
|
853
|
+
<div className="py-0.5">
|
|
854
|
+
<AiInfoBanner level={notice.level}>{notice.message}</AiInfoBanner>
|
|
855
|
+
</div>
|
|
856
|
+
),
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
if (msg.role === "user") {
|
|
861
|
+
items.push({
|
|
862
|
+
key: msgId,
|
|
863
|
+
render: () => (
|
|
864
|
+
<div>
|
|
865
|
+
<AiMessage from="user">
|
|
866
|
+
<AiMessageContent>
|
|
867
|
+
<AiResponse>{msg.content}</AiResponse>
|
|
868
|
+
</AiMessageContent>
|
|
869
|
+
</AiMessage>
|
|
870
|
+
</div>
|
|
871
|
+
),
|
|
872
|
+
});
|
|
873
|
+
} else {
|
|
874
|
+
items.push({
|
|
875
|
+
key: msgId,
|
|
876
|
+
render: () => (
|
|
877
|
+
<div>
|
|
878
|
+
<AiMessage from="assistant">
|
|
879
|
+
<AiMessageContent>
|
|
880
|
+
<AssistantMessageBody
|
|
881
|
+
message={msg}
|
|
882
|
+
harnessState={state}
|
|
883
|
+
hitlPlacement={hitlPlacement}
|
|
884
|
+
onApprove={handleApprove}
|
|
885
|
+
onReject={handleReject}
|
|
886
|
+
onAnswer={handleAnswer}
|
|
887
|
+
onPlanApprove={handlePlanApprove}
|
|
888
|
+
onPlanReject={handlePlanReject}
|
|
889
|
+
/>
|
|
890
|
+
</AiMessageContent>
|
|
891
|
+
{!msg.isStreaming && msg.content && (
|
|
892
|
+
<AiMessageToolbar>
|
|
893
|
+
<AiMessageActions>
|
|
894
|
+
<AiMessageAction
|
|
895
|
+
tooltip="Copy"
|
|
896
|
+
label="Copy message"
|
|
897
|
+
onClick={() =>
|
|
898
|
+
navigator.clipboard?.writeText(msg.content)
|
|
899
|
+
}
|
|
900
|
+
>
|
|
901
|
+
<svg
|
|
902
|
+
width={14}
|
|
903
|
+
height={14}
|
|
904
|
+
viewBox="0 0 24 24"
|
|
905
|
+
fill="none"
|
|
906
|
+
stroke="currentColor"
|
|
907
|
+
strokeWidth={2}
|
|
908
|
+
strokeLinecap="round"
|
|
909
|
+
strokeLinejoin="round"
|
|
910
|
+
aria-hidden
|
|
911
|
+
>
|
|
912
|
+
<rect x={9} y={9} width={13} height={13} rx={2} />
|
|
913
|
+
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
|
|
914
|
+
</svg>
|
|
915
|
+
</AiMessageAction>
|
|
916
|
+
</AiMessageActions>
|
|
917
|
+
</AiMessageToolbar>
|
|
918
|
+
)}
|
|
919
|
+
</AiMessage>
|
|
920
|
+
</div>
|
|
921
|
+
),
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
// Standalone notices (not attached to a message)
|
|
927
|
+
const standaloneNotices = state.notices.filter((n) => !n.messageId);
|
|
928
|
+
for (const notice of standaloneNotices) {
|
|
929
|
+
items.push({
|
|
930
|
+
key: `notice-${notice.id}`,
|
|
931
|
+
render: () => (
|
|
932
|
+
<div className="py-0.5">
|
|
933
|
+
<AiInfoBanner level={notice.level}>{notice.message}</AiInfoBanner>
|
|
934
|
+
</div>
|
|
935
|
+
),
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
// Workspace error
|
|
940
|
+
if (state.workspaceError) {
|
|
941
|
+
items.push({
|
|
942
|
+
key: "__workspace_error__",
|
|
943
|
+
render: () => (
|
|
944
|
+
<div className="py-0.5">
|
|
945
|
+
<AiInfoBanner level="error">
|
|
946
|
+
Workspace error: {state.workspaceError}
|
|
947
|
+
</AiInfoBanner>
|
|
948
|
+
</div>
|
|
949
|
+
),
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
return items;
|
|
954
|
+
}, [
|
|
955
|
+
isEmpty,
|
|
956
|
+
emptyState,
|
|
957
|
+
suggestions,
|
|
958
|
+
state,
|
|
959
|
+
hitlPlacement,
|
|
960
|
+
handleApprove,
|
|
961
|
+
handleReject,
|
|
962
|
+
handleAnswer,
|
|
963
|
+
handlePlanApprove,
|
|
964
|
+
handlePlanReject,
|
|
965
|
+
handleSuggestion,
|
|
966
|
+
]);
|
|
967
|
+
|
|
968
|
+
// ── Virtualizer ────────────────────────────────────────────────────────────
|
|
969
|
+
const { virtualItems, totalSize, measureRef, isAtBottom, scrollToBottom } =
|
|
970
|
+
useConversationVirtualizer({
|
|
971
|
+
scrollRef,
|
|
972
|
+
items: conversationItems,
|
|
973
|
+
estimateSize: 100,
|
|
974
|
+
overscan: 8,
|
|
975
|
+
});
|
|
976
|
+
|
|
977
|
+
// ── Render ─────────────────────────────────────────────────────────────────
|
|
978
|
+
return (
|
|
979
|
+
<div
|
|
980
|
+
className={cn(
|
|
981
|
+
"flex h-full min-h-0 flex-col overflow-hidden rounded-xl border border-sf-line bg-sf-base",
|
|
982
|
+
className
|
|
983
|
+
)}
|
|
984
|
+
{...props}
|
|
985
|
+
>
|
|
986
|
+
{/* Header */}
|
|
987
|
+
{header ?? <DefaultHeader isRunning={state.isRunning} onAbort={abort} />}
|
|
988
|
+
|
|
989
|
+
{/* Virtualized conversation area */}
|
|
990
|
+
<AiConversation ref={scrollRef} className="flex-1 min-h-0">
|
|
991
|
+
<div className="relative w-full" style={{ height: totalSize }}>
|
|
992
|
+
{virtualItems.map((vi) => {
|
|
993
|
+
const item = conversationItems[vi.index];
|
|
994
|
+
if (!item) return null;
|
|
995
|
+
return (
|
|
996
|
+
<div
|
|
997
|
+
key={item.key}
|
|
998
|
+
ref={measureRef}
|
|
999
|
+
data-index={vi.index}
|
|
1000
|
+
className="absolute left-0 w-full px-4"
|
|
1001
|
+
style={{ top: vi.start }}
|
|
1002
|
+
>
|
|
1003
|
+
{item.render()}
|
|
1004
|
+
</div>
|
|
1005
|
+
);
|
|
1006
|
+
})}
|
|
1007
|
+
</div>
|
|
1008
|
+
|
|
1009
|
+
{!isAtBottom && (
|
|
1010
|
+
<AiConversationScrollButton
|
|
1011
|
+
scrollRef={scrollRef}
|
|
1012
|
+
onClick={() => scrollToBottom()}
|
|
1013
|
+
/>
|
|
1014
|
+
)}
|
|
1015
|
+
</AiConversation>
|
|
1016
|
+
|
|
1017
|
+
{/* Prompt input */}
|
|
1018
|
+
<div className="border-t border-sf-line p-3">
|
|
1019
|
+
<PromptInput
|
|
1020
|
+
onSubmit={(msg) => handleSubmit({ text: msg.text, files: msg.files })}
|
|
1021
|
+
backLayer={
|
|
1022
|
+
hasBackLayerContent ? (
|
|
1023
|
+
<BackLayerContent
|
|
1024
|
+
taskList={showTaskList ? state.taskList : null}
|
|
1025
|
+
usage={state.usage}
|
|
1026
|
+
showUsage={showUsage}
|
|
1027
|
+
pendingQuestion={pendingQuestion}
|
|
1028
|
+
pendingPlan={pendingPlan}
|
|
1029
|
+
hitlPlacement={hitlPlacement}
|
|
1030
|
+
onAnswer={handleAnswer}
|
|
1031
|
+
onPlanApprove={handlePlanApprove}
|
|
1032
|
+
onPlanReject={handlePlanReject}
|
|
1033
|
+
/>
|
|
1034
|
+
) : undefined
|
|
1035
|
+
}
|
|
1036
|
+
backLayerTitle={
|
|
1037
|
+
state.taskList?.title ??
|
|
1038
|
+
(pendingQuestion ? "Question" : undefined) ??
|
|
1039
|
+
(pendingPlan ? "Plan Review" : undefined) ??
|
|
1040
|
+
"Context"
|
|
1041
|
+
}
|
|
1042
|
+
backLayerOpen={isBackLayerOpen}
|
|
1043
|
+
onBackLayerOpenChange={setIsBackLayerOpen}
|
|
1044
|
+
>
|
|
1045
|
+
<PromptInputTextarea placeholder={placeholder} />
|
|
1046
|
+
<PromptInputToolbar>
|
|
1047
|
+
<PromptInputTools>
|
|
1048
|
+
{allowAttachments && <PromptInputAttachButton />}
|
|
1049
|
+
{allowSpeech && <PromptInputSpeechButton />}
|
|
1050
|
+
{availableModes && availableModes.length > 0 ? (
|
|
1051
|
+
<PromptInputModeSelector
|
|
1052
|
+
modes={availableModes}
|
|
1053
|
+
value={state.modeId}
|
|
1054
|
+
onChange={selectMode}
|
|
1055
|
+
/>
|
|
1056
|
+
) : (
|
|
1057
|
+
(showMode || showModel) &&
|
|
1058
|
+
(state.modeName || state.modelId) && (
|
|
1059
|
+
<span className="flex items-center gap-1.5 text-[11px] text-sf-subtle">
|
|
1060
|
+
{showMode && state.modeName && (
|
|
1061
|
+
<span className="font-medium">{state.modeName}</span>
|
|
1062
|
+
)}
|
|
1063
|
+
{showMode &&
|
|
1064
|
+
state.modeName &&
|
|
1065
|
+
showModel &&
|
|
1066
|
+
state.modelId && (
|
|
1067
|
+
<span className="text-sf-inactive">·</span>
|
|
1068
|
+
)}
|
|
1069
|
+
{showModel && state.modelId && (
|
|
1070
|
+
<span>
|
|
1071
|
+
{getModelDisplayName(state.modelId, state.modelName)}
|
|
1072
|
+
</span>
|
|
1073
|
+
)}
|
|
1074
|
+
</span>
|
|
1075
|
+
)
|
|
1076
|
+
)}
|
|
1077
|
+
</PromptInputTools>
|
|
1078
|
+
{renderSubmit ? (
|
|
1079
|
+
renderSubmit(state)
|
|
1080
|
+
) : (
|
|
1081
|
+
<PromptInputSubmit
|
|
1082
|
+
status={promptStatus}
|
|
1083
|
+
{...(state.isRunning && {
|
|
1084
|
+
type: "button",
|
|
1085
|
+
onClick: abort,
|
|
1086
|
+
})}
|
|
1087
|
+
/>
|
|
1088
|
+
)}
|
|
1089
|
+
</PromptInputToolbar>
|
|
1090
|
+
</PromptInput>
|
|
1091
|
+
|
|
1092
|
+
{footer && (
|
|
1093
|
+
<div className="mt-2 text-center text-xs text-sf-subtle">
|
|
1094
|
+
{footer}
|
|
1095
|
+
</div>
|
|
1096
|
+
)}
|
|
1097
|
+
</div>
|
|
1098
|
+
</div>
|
|
1099
|
+
);
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
AgentHarness.displayName = "AgentHarness";
|
|
1103
|
+
|
|
1104
|
+
// Re-export utilities consumers need alongside the block
|
|
1105
|
+
export { createAgentHarnessState, fromMastraHarness, useAgentHarness };
|
|
1106
|
+
export type {
|
|
1107
|
+
// Primary render contract — target this type when building your own state
|
|
1108
|
+
AgentHarnessState,
|
|
1109
|
+
AgentMessage,
|
|
1110
|
+
AgentToolCall,
|
|
1111
|
+
AgentSubagent,
|
|
1112
|
+
AgentOMActivity,
|
|
1113
|
+
AgentQuestion,
|
|
1114
|
+
AgentPlanApproval,
|
|
1115
|
+
AgentTaskList,
|
|
1116
|
+
AgentUsage,
|
|
1117
|
+
AgentNotice,
|
|
1118
|
+
// Uncontrolled-mode API
|
|
1119
|
+
HarnessAdapter,
|
|
1120
|
+
HarnessEvent,
|
|
1121
|
+
UseAgentHarnessReturn,
|
|
1122
|
+
};
|