basalt-ui 0.4.2 → 1.0.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/AGENTS.md +70 -0
- package/CHANGELOG.md +199 -41
- package/LICENSE +201 -0
- package/README.md +434 -160
- package/agent/rules/basalt-agent.md +395 -0
- package/agent/rules/basalt-charts.md +170 -0
- package/agent/rules/basalt-commands.md +320 -0
- package/agent/rules/basalt-content.md +390 -0
- package/agent/rules/basalt-data.md +237 -0
- package/agent/rules/basalt-forms.md +186 -0
- package/agent/rules/basalt-mantine.md +327 -0
- package/agent/rules/basalt-notifications.md +264 -0
- package/agent/rules/basalt-query.md +130 -0
- package/agent/rules/basalt-router.md +173 -0
- package/agent/rules/basalt-state.md +99 -0
- package/agent/rules/basalt-tokens.md +148 -0
- package/agent/templates/CLAUDE-block.md.tpl +35 -0
- package/agent/templates/DESIGN.md.tpl +71 -0
- package/agent/templates/__root.tpl +31 -0
- package/agent/templates/query-client.ts.tpl +12 -0
- package/bin/basalt.mjs +14 -0
- package/configs/check.yml +29 -0
- package/configs/lefthook.yml +21 -0
- package/configs/oxfmt.json +8 -0
- package/configs/oxlint-plugin.js +269 -0
- package/configs/oxlint-plugin.test.ts +107 -0
- package/configs/oxlint.json +116 -0
- package/configs/tsconfig.base.json +20 -0
- package/configs/tsconfig.node.json +8 -0
- package/configs/tsconfig.react-app.json +8 -0
- package/dist/agent/ai-sdk-transport.d.ts +85 -0
- package/dist/agent/ai-sdk-transport.d.ts.map +1 -0
- package/dist/agent/ai-sdk-transport.js +109 -0
- package/dist/agent/history.d.ts +55 -0
- package/dist/agent/history.d.ts.map +1 -0
- package/dist/agent/history.js +32 -0
- package/dist/agent/index.d.ts +53 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +23 -0
- package/dist/agent/outcome.d.ts +71 -0
- package/dist/agent/outcome.d.ts.map +1 -0
- package/dist/agent/outcome.js +30 -0
- package/dist/agent/part-list.d.ts +75 -0
- package/dist/agent/part-list.d.ts.map +1 -0
- package/dist/agent/part-list.js +127 -0
- package/dist/agent/parts.d.ts +91 -0
- package/dist/agent/parts.d.ts.map +1 -0
- package/dist/agent/parts.js +49 -0
- package/dist/agent/stick-to-bottom.d.ts +23 -0
- package/dist/agent/stick-to-bottom.d.ts.map +1 -0
- package/dist/agent/stick-to-bottom.js +73 -0
- package/dist/agent/thread.d.ts +124 -0
- package/dist/agent/thread.d.ts.map +1 -0
- package/dist/agent/thread.js +131 -0
- package/dist/agent/transport.d.ts +87 -0
- package/dist/agent/transport.d.ts.map +1 -0
- package/dist/agent/transport.js +21 -0
- package/dist/agent/use-agent-stream.d.ts +34 -0
- package/dist/agent/use-agent-stream.d.ts.map +1 -0
- package/dist/agent/use-agent-stream.js +56 -0
- package/dist/agent/use-agent-thread-runs.d.ts +72 -0
- package/dist/agent/use-agent-thread-runs.d.ts.map +1 -0
- package/dist/agent/use-agent-thread-runs.js +217 -0
- package/dist/agent-chat/composer.d.ts +18 -0
- package/dist/agent-chat/composer.d.ts.map +1 -0
- package/dist/agent-chat/composer.js +86 -0
- package/dist/agent-chat/index.d.ts +24 -0
- package/dist/agent-chat/index.d.ts.map +1 -0
- package/dist/agent-chat/index.js +15 -0
- package/dist/agent-chat/thread-detail-panel.d.ts +27 -0
- package/dist/agent-chat/thread-detail-panel.d.ts.map +1 -0
- package/dist/agent-chat/thread-detail-panel.js +108 -0
- package/dist/agent-chat/thread-feed.d.ts +18 -0
- package/dist/agent-chat/thread-feed.d.ts.map +1 -0
- package/dist/agent-chat/thread-feed.js +42 -0
- package/dist/agent-chat/thread-message.d.ts +31 -0
- package/dist/agent-chat/thread-message.d.ts.map +1 -0
- package/dist/agent-chat/thread-message.js +128 -0
- package/dist/agent-chat/thread-outcome-card.d.ts +19 -0
- package/dist/agent-chat/thread-outcome-card.d.ts.map +1 -0
- package/dist/agent-chat/thread-outcome-card.js +120 -0
- package/dist/agent-chat/thread-workspace.d.ts +27 -0
- package/dist/agent-chat/thread-workspace.d.ts.map +1 -0
- package/dist/agent-chat/thread-workspace.js +95 -0
- package/dist/charts/hooks/useChartSize.d.ts +25 -0
- package/dist/charts/hooks/useChartSize.d.ts.map +1 -0
- package/dist/charts/hooks/useChartSize.js +8 -0
- package/dist/charts/hooks/useChartTooltip.d.ts +13 -0
- package/dist/charts/hooks/useChartTooltip.d.ts.map +1 -0
- package/dist/charts/hooks/useChartTooltip.js +26 -0
- package/dist/charts/hooks/useHoverSync.d.ts +30 -0
- package/dist/charts/hooks/useHoverSync.d.ts.map +1 -0
- package/dist/charts/hooks/useHoverSync.js +70 -0
- package/dist/charts/hover-context.d.ts +21 -0
- package/dist/charts/hover-context.d.ts.map +1 -0
- package/dist/charts/hover-context.js +12 -0
- package/dist/charts/hover-sync.d.ts +14 -0
- package/dist/charts/hover-sync.d.ts.map +1 -0
- package/dist/charts/hover-sync.js +17 -0
- package/dist/charts/index.d.ts +47 -0
- package/dist/charts/index.d.ts.map +1 -0
- package/dist/charts/index.js +129 -0
- package/dist/charts/kinds/Bars.d.ts +129 -0
- package/dist/charts/kinds/Bars.d.ts.map +1 -0
- package/dist/charts/kinds/Bars.js +467 -0
- package/dist/charts/kinds/Donut.d.ts +65 -0
- package/dist/charts/kinds/Donut.d.ts.map +1 -0
- package/dist/charts/kinds/Donut.js +158 -0
- package/dist/charts/kinds/DualPanel.d.ts +67 -0
- package/dist/charts/kinds/DualPanel.d.ts.map +1 -0
- package/dist/charts/kinds/DualPanel.js +326 -0
- package/dist/charts/kinds/Heatmap.d.ts +59 -0
- package/dist/charts/kinds/Heatmap.d.ts.map +1 -0
- package/dist/charts/kinds/Heatmap.js +175 -0
- package/dist/charts/kinds/MultiLine.d.ts +73 -0
- package/dist/charts/kinds/MultiLine.d.ts.map +1 -0
- package/dist/charts/kinds/MultiLine.js +275 -0
- package/dist/charts/kinds/StackedArea.d.ts +35 -0
- package/dist/charts/kinds/StackedArea.d.ts.map +1 -0
- package/dist/charts/kinds/StackedArea.js +151 -0
- package/dist/charts/kinds/ZonedLine.d.ts +94 -0
- package/dist/charts/kinds/ZonedLine.d.ts.map +1 -0
- package/dist/charts/kinds/ZonedLine.js +218 -0
- package/dist/charts/primitives/AreaGradient.d.ts +18 -0
- package/dist/charts/primitives/AreaGradient.d.ts.map +1 -0
- package/dist/charts/primitives/AreaGradient.js +13 -0
- package/dist/charts/primitives/Axes.d.ts +22 -0
- package/dist/charts/primitives/Axes.d.ts.map +1 -0
- package/dist/charts/primitives/Axes.js +79 -0
- package/dist/charts/primitives/ChartCard.d.ts +14 -0
- package/dist/charts/primitives/ChartCard.d.ts.map +1 -0
- package/dist/charts/primitives/ChartCard.js +144 -0
- package/dist/charts/primitives/ChartFrame.d.ts +70 -0
- package/dist/charts/primitives/ChartFrame.d.ts.map +1 -0
- package/dist/charts/primitives/ChartFrame.js +77 -0
- package/dist/charts/primitives/ChartLegend.d.ts +36 -0
- package/dist/charts/primitives/ChartLegend.d.ts.map +1 -0
- package/dist/charts/primitives/ChartLegend.js +234 -0
- package/dist/charts/primitives/ChartTooltip.d.ts +34 -0
- package/dist/charts/primitives/ChartTooltip.d.ts.map +1 -0
- package/dist/charts/primitives/ChartTooltip.js +134 -0
- package/dist/charts/primitives/Crosshair.d.ts +23 -0
- package/dist/charts/primitives/Crosshair.d.ts.map +1 -0
- package/dist/charts/primitives/Crosshair.js +21 -0
- package/dist/charts/primitives/HoverOverlay.d.ts +9 -0
- package/dist/charts/primitives/HoverOverlay.d.ts.map +1 -0
- package/dist/charts/primitives/HoverOverlay.js +21 -0
- package/dist/charts/primitives/ResponsiveChart.d.ts +45 -0
- package/dist/charts/primitives/ResponsiveChart.d.ts.map +1 -0
- package/dist/charts/primitives/ResponsiveChart.js +24 -0
- package/dist/charts/primitives/ZoneRects.d.ts +38 -0
- package/dist/charts/primitives/ZoneRects.d.ts.map +1 -0
- package/dist/charts/primitives/ZoneRects.js +30 -0
- package/dist/charts/series.d.ts +99 -0
- package/dist/charts/series.d.ts.map +1 -0
- package/dist/charts/series.js +55 -0
- package/dist/charts/sparklines/BarSparkline.d.ts +13 -0
- package/dist/charts/sparklines/BarSparkline.d.ts.map +1 -0
- package/dist/charts/sparklines/BarSparkline.js +33 -0
- package/dist/charts/sparklines/LineSparkline.d.ts +15 -0
- package/dist/charts/sparklines/LineSparkline.d.ts.map +1 -0
- package/dist/charts/sparklines/LineSparkline.js +39 -0
- package/dist/charts/sparklines/index.d.ts +3 -0
- package/dist/charts/sparklines/index.d.ts.map +1 -0
- package/dist/charts/sparklines/index.js +6 -0
- package/dist/charts/theme.d.ts +21 -0
- package/dist/charts/theme.d.ts.map +1 -0
- package/dist/charts/theme.js +30 -0
- package/dist/charts/utils/domain.d.ts +20 -0
- package/dist/charts/utils/domain.d.ts.map +1 -0
- package/dist/charts/utils/domain.js +7 -0
- package/dist/charts/utils/format.d.ts +5 -0
- package/dist/charts/utils/format.d.ts.map +1 -0
- package/dist/charts/utils/format.js +27 -0
- package/dist/charts/utils/ticks.d.ts +5 -0
- package/dist/charts/utils/ticks.d.ts.map +1 -0
- package/dist/charts/utils/ticks.js +18 -0
- package/dist/cli/index.d.ts +273 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +907 -0
- package/dist/commands/ShortcutsHelp.d.ts +17 -0
- package/dist/commands/ShortcutsHelp.d.ts.map +1 -0
- package/dist/commands/ShortcutsHelp.js +64 -0
- package/dist/commands/define-commands.d.ts +140 -0
- package/dist/commands/define-commands.d.ts.map +1 -0
- package/dist/commands/define-commands.js +26 -0
- package/dist/commands/define-overlays.d.ts +134 -0
- package/dist/commands/define-overlays.d.ts.map +1 -0
- package/dist/commands/define-overlays.js +53 -0
- package/dist/commands/index.d.ts +42 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +46 -0
- package/dist/commands/overlays-mount.d.ts +117 -0
- package/dist/commands/overlays-mount.d.ts.map +1 -0
- package/dist/commands/overlays-mount.js +116 -0
- package/dist/commands/projectors.d.ts +152 -0
- package/dist/commands/projectors.d.ts.map +1 -0
- package/dist/commands/projectors.js +87 -0
- package/dist/commands/shortcut-format.d.ts +48 -0
- package/dist/commands/shortcut-format.d.ts.map +1 -0
- package/dist/commands/shortcut-format.js +33 -0
- package/dist/commands/useCommandHotkeys.d.ts +14 -0
- package/dist/commands/useCommandHotkeys.d.ts.map +1 -0
- package/dist/commands/useCommandHotkeys.js +45 -0
- package/dist/connectivity/connectivity-indicator.d.ts +8 -0
- package/dist/connectivity/connectivity-indicator.d.ts.map +1 -0
- package/dist/connectivity/connectivity-indicator.js +203 -0
- package/dist/connectivity/connectivity-provider.d.ts +7 -0
- package/dist/connectivity/connectivity-provider.d.ts.map +1 -0
- package/dist/connectivity/connectivity-provider.js +125 -0
- package/dist/connectivity/index.d.ts +13 -0
- package/dist/connectivity/index.d.ts.map +1 -0
- package/dist/connectivity/index.js +8 -0
- package/dist/connectivity/types.d.ts +36 -0
- package/dist/connectivity/types.d.ts.map +1 -0
- package/dist/connectivity/types.js +0 -0
- package/dist/connectivity/use-connectivity.d.ts +3 -0
- package/dist/connectivity/use-connectivity.d.ts.map +1 -0
- package/dist/connectivity/use-connectivity.js +14 -0
- package/dist/content/article-actions.d.ts +39 -0
- package/dist/content/article-actions.d.ts.map +1 -0
- package/dist/content/article-actions.js +28 -0
- package/dist/content/article-card.d.ts +58 -0
- package/dist/content/article-card.d.ts.map +1 -0
- package/dist/content/article-card.js +76 -0
- package/dist/content/article-card.module.css +109 -0
- package/dist/content/article-card.module.css.d.ts +16 -0
- package/dist/content/article-filter-bar.d.ts +40 -0
- package/dist/content/article-filter-bar.d.ts.map +1 -0
- package/dist/content/article-filter-bar.js +56 -0
- package/dist/content/article-layout.d.ts +61 -0
- package/dist/content/article-layout.d.ts.map +1 -0
- package/dist/content/article-layout.js +71 -0
- package/dist/content/article-layout.module.css +131 -0
- package/dist/content/article-layout.module.css.d.ts +20 -0
- package/dist/content/article-model.d.ts +62 -0
- package/dist/content/article-model.d.ts.map +1 -0
- package/dist/content/article-model.js +41 -0
- package/dist/content/block-split.d.ts +24 -0
- package/dist/content/block-split.d.ts.map +1 -0
- package/dist/content/block-split.js +63 -0
- package/dist/content/callout-alert.d.ts +27 -0
- package/dist/content/callout-alert.d.ts.map +1 -0
- package/dist/content/callout-alert.js +59 -0
- package/dist/content/callout.d.ts +24 -0
- package/dist/content/callout.d.ts.map +1 -0
- package/dist/content/callout.js +59 -0
- package/dist/content/callout.module.css +77 -0
- package/dist/content/callout.module.css.d.ts +16 -0
- package/dist/content/code-block.d.ts +26 -0
- package/dist/content/code-block.d.ts.map +1 -0
- package/dist/content/code-block.js +41 -0
- package/dist/content/code-block.module.css +86 -0
- package/dist/content/code-block.module.css.d.ts +14 -0
- package/dist/content/copy-action.d.ts +29 -0
- package/dist/content/copy-action.d.ts.map +1 -0
- package/dist/content/copy-action.js +46 -0
- package/dist/content/fence-block.d.ts +19 -0
- package/dist/content/fence-block.d.ts.map +1 -0
- package/dist/content/fence-block.js +23 -0
- package/dist/content/glyphs.d.ts +18 -0
- package/dist/content/glyphs.d.ts.map +1 -0
- package/dist/content/glyphs.js +43 -0
- package/dist/content/guide.d.ts +47 -0
- package/dist/content/guide.d.ts.map +1 -0
- package/dist/content/guide.js +110 -0
- package/dist/content/guide.module.css +62 -0
- package/dist/content/guide.module.css.d.ts +13 -0
- package/dist/content/heading-anchor.d.ts +8 -0
- package/dist/content/heading-anchor.d.ts.map +1 -0
- package/dist/content/heading-anchor.js +23 -0
- package/dist/content/heading-components.d.ts +5 -0
- package/dist/content/heading-components.d.ts.map +1 -0
- package/dist/content/heading-components.js +41 -0
- package/dist/content/highlighter.d.ts +8 -0
- package/dist/content/highlighter.d.ts.map +1 -0
- package/dist/content/highlighter.js +85 -0
- package/dist/content/index.d.ts +45 -0
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +43 -0
- package/dist/content/markdown-hast.d.ts +23 -0
- package/dist/content/markdown-hast.d.ts.map +1 -0
- package/dist/content/markdown-hast.js +48 -0
- package/dist/content/markdown.d.ts +68 -0
- package/dist/content/markdown.d.ts.map +1 -0
- package/dist/content/markdown.js +180 -0
- package/dist/content/mdx.d.ts +20 -0
- package/dist/content/mdx.d.ts.map +1 -0
- package/dist/content/mdx.js +64 -0
- package/dist/content/mermaid.d.ts +32 -0
- package/dist/content/mermaid.d.ts.map +1 -0
- package/dist/content/mermaid.js +70 -0
- package/dist/content/mermaid.module.css +20 -0
- package/dist/content/mermaid.module.css.d.ts +8 -0
- package/dist/content/prose.d.ts +29 -0
- package/dist/content/prose.d.ts.map +1 -0
- package/dist/content/prose.js +24 -0
- package/dist/content/prose.module.css +330 -0
- package/dist/content/prose.module.css.d.ts +12 -0
- package/dist/content/reading-progress.d.ts +20 -0
- package/dist/content/reading-progress.d.ts.map +1 -0
- package/dist/content/reading-progress.js +38 -0
- package/dist/content/reading-progress.module.css +22 -0
- package/dist/content/reading-progress.module.css.d.ts +9 -0
- package/dist/content/slug.d.ts +28 -0
- package/dist/content/slug.d.ts.map +1 -0
- package/dist/content/slug.js +28 -0
- package/dist/content/toc.d.ts +37 -0
- package/dist/content/toc.d.ts.map +1 -0
- package/dist/content/toc.js +134 -0
- package/dist/content/toc.module.css +51 -0
- package/dist/content/toc.module.css.d.ts +13 -0
- package/dist/content/url-hardening.d.ts +23 -0
- package/dist/content/url-hardening.d.ts.map +1 -0
- package/dist/content/url-hardening.js +23 -0
- package/dist/dashboard/delta-badge.d.ts +13 -0
- package/dist/dashboard/delta-badge.d.ts.map +1 -0
- package/dist/dashboard/delta-badge.js +45 -0
- package/dist/dashboard/empty-state.d.ts +15 -0
- package/dist/dashboard/empty-state.d.ts.map +1 -0
- package/dist/dashboard/empty-state.js +56 -0
- package/dist/dashboard/index.d.ts +5 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +16 -0
- package/dist/dashboard/settings-section.d.ts +24 -0
- package/dist/dashboard/settings-section.d.ts.map +1 -0
- package/dist/dashboard/settings-section.js +61 -0
- package/dist/dashboard/settings-section.module.css +23 -0
- package/dist/dashboard/settings-section.module.css.d.ts +10 -0
- package/dist/dashboard/stat-card.d.ts +18 -0
- package/dist/dashboard/stat-card.d.ts.map +1 -0
- package/dist/dashboard/stat-card.js +74 -0
- package/dist/data/data-table.d.ts +198 -0
- package/dist/data/data-table.d.ts.map +1 -0
- package/dist/data/data-table.js +342 -0
- package/dist/data/index.d.ts +34 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +2 -0
- package/dist/data/table.d.ts +24 -0
- package/dist/data/table.d.ts.map +1 -0
- package/dist/data/table.js +20 -0
- package/dist/data/virtual-list.d.ts +74 -0
- package/dist/data/virtual-list.d.ts.map +1 -0
- package/dist/data/virtual-list.js +86 -0
- package/dist/data/virtual.d.ts +20 -0
- package/dist/data/virtual.d.ts.map +1 -0
- package/dist/data/virtual.js +4 -0
- package/dist/forms/FormErrorSummary.d.ts +29 -0
- package/dist/forms/FormErrorSummary.d.ts.map +1 -0
- package/dist/forms/FormErrorSummary.js +28 -0
- package/dist/forms/create-form.d.ts +31 -0
- package/dist/forms/create-form.d.ts.map +1 -0
- package/dist/forms/create-form.js +18 -0
- package/dist/forms/field.d.ts +22 -0
- package/dist/forms/field.d.ts.map +1 -0
- package/dist/forms/field.js +9 -0
- package/dist/forms/index.d.ts +17 -0
- package/dist/forms/index.d.ts.map +1 -0
- package/dist/forms/index.js +13 -0
- package/dist/forms/use-form-draft.d.ts +61 -0
- package/dist/forms/use-form-draft.d.ts.map +1 -0
- package/dist/forms/use-form-draft.js +55 -0
- package/dist/guard/guard-hook.d.ts +40 -0
- package/dist/guard/guard-hook.d.ts.map +1 -0
- package/dist/guard/guard-hook.js +55 -0
- package/dist/guard/index.d.ts +144 -0
- package/dist/guard/index.d.ts.map +1 -0
- package/dist/guard/index.js +315 -0
- package/dist/guard/types.d.ts +97 -0
- package/dist/guard/types.d.ts.map +1 -0
- package/dist/guard/types.js +0 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +90 -0
- package/dist/motion/index.d.ts +29 -0
- package/dist/motion/index.d.ts.map +1 -0
- package/dist/motion/index.js +12 -0
- package/dist/notifications/bell.d.ts +12 -0
- package/dist/notifications/bell.d.ts.map +1 -0
- package/dist/notifications/bell.js +84 -0
- package/dist/notifications/center.d.ts +20 -0
- package/dist/notifications/center.d.ts.map +1 -0
- package/dist/notifications/center.js +144 -0
- package/dist/notifications/define-notifications.d.ts +97 -0
- package/dist/notifications/define-notifications.d.ts.map +1 -0
- package/dist/notifications/define-notifications.js +27 -0
- package/dist/notifications/index.d.ts +36 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +52 -0
- package/dist/notifications/notify.d.ts +92 -0
- package/dist/notifications/notify.d.ts.map +1 -0
- package/dist/notifications/notify.js +127 -0
- package/dist/notifications/overlay.d.ts +20 -0
- package/dist/notifications/overlay.d.ts.map +1 -0
- package/dist/notifications/overlay.js +12 -0
- package/dist/notifications/store.d.ts +120 -0
- package/dist/notifications/store.d.ts.map +1 -0
- package/dist/notifications/store.js +113 -0
- package/dist/provider/index.d.ts +93 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.js +106 -0
- package/dist/query/devtools.d.ts +21 -0
- package/dist/query/devtools.d.ts.map +1 -0
- package/dist/query/devtools.js +12 -0
- package/dist/query/index.d.ts +65 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +68 -0
- package/dist/register.d.ts +139 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +6 -0
- package/dist/router-tanstack/index.d.ts +74 -0
- package/dist/router-tanstack/index.d.ts.map +1 -0
- package/dist/router-tanstack/index.js +29 -0
- package/dist/router-tanstack/multi-search-param-store.d.ts +78 -0
- package/dist/router-tanstack/multi-search-param-store.d.ts.map +1 -0
- package/dist/router-tanstack/multi-search-param-store.js +35 -0
- package/dist/router-tanstack/search-param-store.d.ts +92 -0
- package/dist/router-tanstack/search-param-store.d.ts.map +1 -0
- package/dist/router-tanstack/search-param-store.js +26 -0
- package/dist/shell/account-types.d.ts +118 -0
- package/dist/shell/account-types.d.ts.map +1 -0
- package/dist/shell/account-types.js +0 -0
- package/dist/shell/app-breadcrumbs.d.ts +17 -0
- package/dist/shell/app-breadcrumbs.d.ts.map +1 -0
- package/dist/shell/app-breadcrumbs.js +39 -0
- package/dist/shell/app-header.module.css +73 -0
- package/dist/shell/app-header.module.css.d.ts +11 -0
- package/dist/shell/app-mobile-nav.d.ts +26 -0
- package/dist/shell/app-mobile-nav.d.ts.map +1 -0
- package/dist/shell/app-mobile-nav.js +106 -0
- package/dist/shell/app-mobile-nav.module.css +100 -0
- package/dist/shell/app-mobile-nav.module.css.d.ts +14 -0
- package/dist/shell/app-sidebar-account.d.ts +3 -0
- package/dist/shell/app-sidebar-account.d.ts.map +1 -0
- package/dist/shell/app-sidebar-account.js +84 -0
- package/dist/shell/app-sidebar.d.ts +56 -0
- package/dist/shell/app-sidebar.d.ts.map +1 -0
- package/dist/shell/app-sidebar.js +455 -0
- package/dist/shell/app-sidebar.module.css +414 -0
- package/dist/shell/app-sidebar.module.css.d.ts +34 -0
- package/dist/shell/index.d.ts +123 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.js +179 -0
- package/dist/shell/page-header.d.ts +13 -0
- package/dist/shell/page-header.d.ts.map +1 -0
- package/dist/shell/page-header.js +23 -0
- package/dist/shell/sidebar-search.d.ts +12 -0
- package/dist/shell/sidebar-search.d.ts.map +1 -0
- package/dist/shell/sidebar-search.js +62 -0
- package/dist/shell/sidebar-search.module.css +62 -0
- package/dist/shell/sidebar-search.module.css.d.ts +11 -0
- package/dist/state.d.ts +62 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +124 -0
- package/dist/styles.css +166 -0
- package/dist/surfaces.d.ts +376 -0
- package/dist/surfaces.d.ts.map +1 -0
- package/dist/surfaces.js +306 -0
- package/dist/theme/controls.module.css +143 -0
- package/dist/theme/controls.module.css.d.ts +17 -0
- package/dist/theme/floating.module.css +35 -0
- package/dist/theme/floating.module.css.d.ts +9 -0
- package/dist/theme/index.d.ts +22 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +733 -0
- package/dist/theme/nav-link.module.css +67 -0
- package/dist/theme/nav-link.module.css.d.ts +8 -0
- package/dist/theme/segmented-control.module.css +14 -0
- package/dist/theme/segmented-control.module.css.d.ts +8 -0
- package/dist/theme/timeline.module.css +29 -0
- package/dist/theme/timeline.module.css.d.ts +9 -0
- package/dist/theme-lab/index.d.ts +59 -0
- package/dist/theme-lab/index.d.ts.map +1 -0
- package/dist/theme-lab/index.js +263 -0
- package/dist/theme-toggle/index.d.ts +8 -0
- package/dist/theme-toggle/index.d.ts.map +1 -0
- package/dist/theme-toggle/index.js +155 -0
- package/dist/tokens/index.d.ts +151 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +246 -0
- package/dist/tokens/palette.d.ts +304 -0
- package/dist/tokens/palette.d.ts.map +1 -0
- package/dist/tokens/palette.js +186 -0
- package/dist/vite.d.ts +30 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +68 -0
- package/llms.txt +149 -0
- package/package.json +243 -46
- package/src/agent/ai-sdk-transport.ts +280 -0
- package/src/agent/history.ts +128 -0
- package/src/agent/index.ts +92 -0
- package/src/agent/outcome.ts +120 -0
- package/src/agent/part-list.tsx +292 -0
- package/src/agent/parts.ts +136 -0
- package/src/agent/stick-to-bottom.tsx +154 -0
- package/src/agent/thread.ts +312 -0
- package/src/agent/transport.ts +114 -0
- package/src/agent/use-agent-stream.ts +141 -0
- package/src/agent/use-agent-thread-runs.ts +440 -0
- package/src/agent-chat/composer.tsx +131 -0
- package/src/agent-chat/index.ts +35 -0
- package/src/agent-chat/thread-detail-panel.tsx +192 -0
- package/src/agent-chat/thread-feed.tsx +81 -0
- package/src/agent-chat/thread-message.tsx +251 -0
- package/src/agent-chat/thread-outcome-card.tsx +196 -0
- package/src/agent-chat/thread-workspace.tsx +179 -0
- package/src/charts/hooks/useChartSize.ts +31 -0
- package/src/charts/hooks/useChartTooltip.ts +31 -0
- package/src/charts/hooks/useHoverSync.ts +116 -0
- package/src/charts/hover-context.ts +28 -0
- package/src/charts/hover-sync.tsx +37 -0
- package/src/charts/index.ts +118 -0
- package/src/charts/kinds/Bars.tsx +634 -0
- package/src/charts/kinds/Donut.tsx +233 -0
- package/src/charts/kinds/DualPanel.tsx +432 -0
- package/src/charts/kinds/Heatmap.tsx +255 -0
- package/src/charts/kinds/MultiLine.tsx +376 -0
- package/src/charts/kinds/StackedArea.tsx +218 -0
- package/src/charts/kinds/ZonedLine.tsx +346 -0
- package/src/charts/primitives/AreaGradient.tsx +26 -0
- package/src/charts/primitives/Axes.tsx +97 -0
- package/src/charts/primitives/ChartCard.tsx +180 -0
- package/src/charts/primitives/ChartFrame.tsx +157 -0
- package/src/charts/primitives/ChartLegend.tsx +302 -0
- package/src/charts/primitives/ChartTooltip.tsx +158 -0
- package/src/charts/primitives/Crosshair.tsx +40 -0
- package/src/charts/primitives/HoverOverlay.tsx +24 -0
- package/src/charts/primitives/ResponsiveChart.tsx +64 -0
- package/src/charts/primitives/ZoneRects.tsx +67 -0
- package/src/charts/series.ts +163 -0
- package/src/charts/sparklines/BarSparkline.tsx +48 -0
- package/src/charts/sparklines/LineSparkline.tsx +57 -0
- package/src/charts/sparklines/index.ts +2 -0
- package/src/charts/theme.tsx +53 -0
- package/src/charts/utils/domain.test.ts +24 -0
- package/src/charts/utils/domain.ts +22 -0
- package/src/charts/utils/format.ts +27 -0
- package/src/charts/utils/ticks.ts +18 -0
- package/src/cli/check-theme.test.ts +658 -0
- package/src/cli/index.ts +1497 -0
- package/src/cli/init-sync.test.ts +160 -0
- package/src/commands/ShortcutsHelp.tsx +129 -0
- package/src/commands/define-commands.ts +184 -0
- package/src/commands/define-overlays.ts +197 -0
- package/src/commands/index.ts +86 -0
- package/src/commands/overlays-mount.tsx +301 -0
- package/src/commands/projectors.ts +267 -0
- package/src/commands/shortcut-format.ts +83 -0
- package/src/commands/useCommandHotkeys.ts +114 -0
- package/src/connectivity/connectivity-indicator.tsx +249 -0
- package/src/connectivity/connectivity-provider.tsx +186 -0
- package/src/connectivity/index.ts +18 -0
- package/src/connectivity/types.ts +39 -0
- package/src/connectivity/use-connectivity.ts +25 -0
- package/src/content/article-actions.test.ts +78 -0
- package/src/content/article-actions.ts +72 -0
- package/src/content/article-card.module.css +109 -0
- package/src/content/article-card.module.css.d.ts +16 -0
- package/src/content/article-card.tsx +173 -0
- package/src/content/article-filter-bar.tsx +88 -0
- package/src/content/article-layout.module.css +131 -0
- package/src/content/article-layout.module.css.d.ts +20 -0
- package/src/content/article-layout.tsx +167 -0
- package/src/content/article-model.test.ts +119 -0
- package/src/content/article-model.ts +110 -0
- package/src/content/block-split.test.ts +75 -0
- package/src/content/block-split.ts +102 -0
- package/src/content/callout-alert.ts +88 -0
- package/src/content/callout.module.css +77 -0
- package/src/content/callout.module.css.d.ts +16 -0
- package/src/content/callout.tsx +96 -0
- package/src/content/code-block.module.css +86 -0
- package/src/content/code-block.module.css.d.ts +14 -0
- package/src/content/code-block.tsx +82 -0
- package/src/content/copy-action.tsx +79 -0
- package/src/content/fence-block.tsx +39 -0
- package/src/content/glyphs.tsx +53 -0
- package/src/content/guide.module.css +62 -0
- package/src/content/guide.module.css.d.ts +13 -0
- package/src/content/guide.tsx +174 -0
- package/src/content/heading-anchor.tsx +54 -0
- package/src/content/heading-components.tsx +62 -0
- package/src/content/highlighter.ts +123 -0
- package/src/content/index.ts +60 -0
- package/src/content/markdown-hast.ts +80 -0
- package/src/content/markdown.tsx +346 -0
- package/src/content/mdx.tsx +127 -0
- package/src/content/mermaid.module.css +20 -0
- package/src/content/mermaid.module.css.d.ts +8 -0
- package/src/content/mermaid.tsx +124 -0
- package/src/content/prose.module.css +330 -0
- package/src/content/prose.module.css.d.ts +12 -0
- package/src/content/prose.tsx +53 -0
- package/src/content/reading-progress.module.css +22 -0
- package/src/content/reading-progress.module.css.d.ts +9 -0
- package/src/content/reading-progress.tsx +67 -0
- package/src/content/slug.test.ts +62 -0
- package/src/content/slug.ts +57 -0
- package/src/content/toc.module.css +51 -0
- package/src/content/toc.module.css.d.ts +13 -0
- package/src/content/toc.tsx +226 -0
- package/src/content/url-hardening.ts +46 -0
- package/src/dashboard/delta-badge.tsx +70 -0
- package/src/dashboard/empty-state.tsx +80 -0
- package/src/dashboard/index.ts +11 -0
- package/src/dashboard/settings-section.module.css +23 -0
- package/src/dashboard/settings-section.module.css.d.ts +10 -0
- package/src/dashboard/settings-section.tsx +118 -0
- package/src/dashboard/stat-card.tsx +105 -0
- package/src/data/data-table.tsx +695 -0
- package/src/data/index.ts +37 -0
- package/src/data/table.ts +46 -0
- package/src/data/virtual-list.tsx +180 -0
- package/src/data/virtual.ts +21 -0
- package/src/forms/FormErrorSummary.tsx +64 -0
- package/src/forms/create-form.ts +57 -0
- package/src/forms/field.ts +30 -0
- package/src/forms/index.ts +26 -0
- package/src/forms/use-form-draft.ts +170 -0
- package/src/guard/check-source.test.ts +834 -0
- package/src/guard/guard-hook.test.ts +173 -0
- package/src/guard/guard-hook.ts +122 -0
- package/src/guard/index.ts +510 -0
- package/src/guard/types.ts +117 -0
- package/src/index.ts +139 -0
- package/src/motion/index.ts +26 -0
- package/src/notifications/bell.tsx +108 -0
- package/src/notifications/center.tsx +245 -0
- package/src/notifications/define-notifications.ts +162 -0
- package/src/notifications/index.ts +79 -0
- package/src/notifications/notify.tsx +260 -0
- package/src/notifications/overlay.tsx +64 -0
- package/src/notifications/store.ts +287 -0
- package/src/provider/index.tsx +234 -0
- package/src/query/devtools.tsx +38 -0
- package/src/query/index.ts +129 -0
- package/src/register.ts +158 -0
- package/src/router-tanstack/index.ts +111 -0
- package/src/router-tanstack/multi-search-param-store.test.ts +56 -0
- package/src/router-tanstack/multi-search-param-store.ts +122 -0
- package/src/router-tanstack/search-param-store.ts +125 -0
- package/src/shell/account-types.ts +119 -0
- package/src/shell/app-breadcrumbs.tsx +90 -0
- package/src/shell/app-header.module.css +73 -0
- package/src/shell/app-header.module.css.d.ts +11 -0
- package/src/shell/app-mobile-nav.module.css +100 -0
- package/src/shell/app-mobile-nav.module.css.d.ts +14 -0
- package/src/shell/app-mobile-nav.tsx +146 -0
- package/src/shell/app-sidebar-account.tsx +142 -0
- package/src/shell/app-sidebar.module.css +414 -0
- package/src/shell/app-sidebar.module.css.d.ts +34 -0
- package/src/shell/app-sidebar.tsx +632 -0
- package/src/shell/index.tsx +343 -0
- package/src/shell/page-header.tsx +35 -0
- package/src/shell/sidebar-search.module.css +62 -0
- package/src/shell/sidebar-search.module.css.d.ts +11 -0
- package/src/shell/sidebar-search.tsx +80 -0
- package/src/state.ts +246 -0
- package/src/styles.css +166 -0
- package/src/styles.floor.test.ts +36 -0
- package/src/surfaces.ts +489 -0
- package/src/theme/border-coverage.test.ts +272 -0
- package/src/theme/contrast.test.ts +306 -0
- package/src/theme/controls.module.css +143 -0
- package/src/theme/controls.module.css.d.ts +17 -0
- package/src/theme/floating.module.css +35 -0
- package/src/theme/floating.module.css.d.ts +9 -0
- package/src/theme/index.ts +933 -0
- package/src/theme/nav-link.module.css +67 -0
- package/src/theme/nav-link.module.css.d.ts +8 -0
- package/src/theme/segmented-control.module.css +14 -0
- package/src/theme/segmented-control.module.css.d.ts +8 -0
- package/src/theme/shadow-surfaces.test.ts +421 -0
- package/src/theme/timeline.module.css +29 -0
- package/src/theme/timeline.module.css.d.ts +9 -0
- package/src/theme-lab/index.tsx +359 -0
- package/src/theme-lab/theme-lab.test.ts +60 -0
- package/src/theme-toggle/index.tsx +180 -0
- package/src/tokens/index.ts +363 -0
- package/src/tokens/palette.ts +288 -0
- package/src/vite.ts +122 -0
- package/src/index.css +0 -877
- package/src/starlight.css +0 -308
- package/tailwind.config.js +0 -78
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAgentThreadRuns — concurrent multi-thread stream run manager.
|
|
3
|
+
*
|
|
4
|
+
* Unlike useAgentStream (ONE in-flight turn — a new send() aborts the previous one),
|
|
5
|
+
* useAgentThreadRuns runs N CONCURRENT streams, one per thread id, so a user can fire many
|
|
6
|
+
* short chats that each stream and resolve independently in the background. Each thread's
|
|
7
|
+
* turn is appended to an injected ThreadsStore and distilled into an AgentOutcome via an
|
|
8
|
+
* injected OutcomeResolver once the stream completes.
|
|
9
|
+
*
|
|
10
|
+
* Rules of hooks are satisfied: all hooks are called unconditionally at the top level of the
|
|
11
|
+
* returned function; no conditional hook invocations.
|
|
12
|
+
*
|
|
13
|
+
* `transport` also accepts a per-thread factory — `(threadId) => AgentTransport` — resolved once
|
|
14
|
+
* per thread id and cached: `transport: (threadId) => aiSdkTransport(opts).forThread(threadId)`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* import { useAgentThreadRuns, createThreadsStore, edenTransport, heuristicOutcome } from 'basalt-ui/agent'
|
|
18
|
+
*
|
|
19
|
+
* const useThreads = createThreadsStore({ key: 'main-threads', version: 1 })
|
|
20
|
+
* const transport = edenTransport((input, signal) =>
|
|
21
|
+
* api.chat.post({ body: { message: input }, fetch: { signal } }),
|
|
22
|
+
* )
|
|
23
|
+
*
|
|
24
|
+
* function ThreadFeed() {
|
|
25
|
+
* const store = useThreads()
|
|
26
|
+
* const { runs, start, stop } = useAgentThreadRuns({
|
|
27
|
+
* transport,
|
|
28
|
+
* store,
|
|
29
|
+
* resolveOutcome: heuristicOutcome,
|
|
30
|
+
* })
|
|
31
|
+
* const id = store.create()
|
|
32
|
+
* return (
|
|
33
|
+
* <div>
|
|
34
|
+
* <button onClick={() => start(id, 'Hello')}>Send</button>
|
|
35
|
+
* {runs.get(id)?.status === 'streaming' && <button onClick={() => stop(id)}>Stop</button>}
|
|
36
|
+
* </div>
|
|
37
|
+
* )
|
|
38
|
+
* }
|
|
39
|
+
*/
|
|
40
|
+
import { useCallback, useEffect, useRef, useState } from 'react'
|
|
41
|
+
import type { Dispatch, MutableRefObject, SetStateAction } from 'react'
|
|
42
|
+
import type { ChatMessage } from './history'
|
|
43
|
+
import type { AgentOutcome, OutcomeResolver } from './outcome'
|
|
44
|
+
import { isStartPart } from './parts'
|
|
45
|
+
import type { AgentPart } from './parts'
|
|
46
|
+
import type { AgentThread, ThreadStatus, ThreadsStore } from './thread'
|
|
47
|
+
import type { AgentTransport } from './transport'
|
|
48
|
+
|
|
49
|
+
// ── ThreadRunState ────────────────────────────────────────────────────────────
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The live stream state of a single thread's in-flight turn.
|
|
53
|
+
*
|
|
54
|
+
* A thread only has an entry in the `runs` map while its turn is actively streaming — once a
|
|
55
|
+
* turn finishes (success or error), its entry is deleted from the map (the outcome lives on the
|
|
56
|
+
* persisted `AgentThread` instead). So `status` only ever holds `'streaming'`; there is no
|
|
57
|
+
* `'done'`/`'idle'`/`'error'` to observe here.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* const state: ThreadRunState = { status: 'streaming', parts: [{ type: 'text', text: 'Hi' }] }
|
|
61
|
+
*/
|
|
62
|
+
export type ThreadRunState<TPart = AgentPart> = {
|
|
63
|
+
/** Always `'streaming'` — see the type doc for why no other status is reachable here. */
|
|
64
|
+
readonly status: 'streaming'
|
|
65
|
+
/** Accumulated parts from the current stream for this thread. */
|
|
66
|
+
readonly parts: TPart[]
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// ── useAgentThreadRuns args ───────────────────────────────────────────────────
|
|
70
|
+
|
|
71
|
+
export type UseAgentThreadRunsArgs<TPart = AgentPart> = {
|
|
72
|
+
/**
|
|
73
|
+
* The injected transport seam — one stream per start() call. Either a single shared transport
|
|
74
|
+
* (today's form — identical behavior across every thread), OR a factory that resolves one
|
|
75
|
+
* transport PER thread id, called at most once per thread and cached thereafter. The factory
|
|
76
|
+
* form is how a per-conversation transport (e.g. aiSdkTransport, which binds a stable chat id
|
|
77
|
+
* per thread) plugs into the multi-thread manager:
|
|
78
|
+
*
|
|
79
|
+
* ```ts
|
|
80
|
+
* transport: (threadId) => aiSdkTransport({ api: '/api/chat' }).forThread(threadId)
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
readonly transport:
|
|
84
|
+
| AgentTransport<TPart, string>
|
|
85
|
+
| ((threadId: string) => AgentTransport<TPart, string>)
|
|
86
|
+
/** The persisted multi-thread registry to append messages and status into. */
|
|
87
|
+
readonly store: ThreadsStore<TPart>
|
|
88
|
+
/** Distills a finished thread into a feed-ready AgentOutcome once a turn completes. */
|
|
89
|
+
readonly resolveOutcome: OutcomeResolver<TPart>
|
|
90
|
+
/**
|
|
91
|
+
* Converts raw user input into the thread's part shape. Defaults to a single text part.
|
|
92
|
+
* Required when TPart is not the default AgentPart union.
|
|
93
|
+
*/
|
|
94
|
+
readonly toUserParts?: (input: string) => TPart[]
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// ── useAgentThreadRuns return type ────────────────────────────────────────────
|
|
98
|
+
|
|
99
|
+
export type UseAgentThreadRunsReturn<TPart = AgentPart> = {
|
|
100
|
+
/** Live stream state per thread id, for threads with a run in progress or just completed. */
|
|
101
|
+
readonly runs: ReadonlyMap<string, ThreadRunState<TPart>>
|
|
102
|
+
/** Start a new turn on `threadId`. No-op if that thread already has a stream in flight. */
|
|
103
|
+
readonly start: (threadId: string, input: string) => void
|
|
104
|
+
/**
|
|
105
|
+
* Replay the last user input sent on `threadId` (same code path as `start`). No-op if
|
|
106
|
+
* `threadId` has never had a turn started, or already has one in flight.
|
|
107
|
+
*/
|
|
108
|
+
readonly retry: (threadId: string) => void
|
|
109
|
+
/** Abort the in-flight stream for `threadId` (no-op if idle). */
|
|
110
|
+
readonly stop: (threadId: string) => void
|
|
111
|
+
/** Abort every in-flight stream across all threads. */
|
|
112
|
+
readonly stopAll: () => void
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// ── defaults ──────────────────────────────────────────────────────────────────
|
|
116
|
+
|
|
117
|
+
/** Default toUserParts: wraps raw input in a single text part. */
|
|
118
|
+
function defaultToUserParts(input: string): AgentPart[] {
|
|
119
|
+
return [{ type: 'text', text: input }]
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Build the 'done' AgentThread snapshot passed to resolveOutcome, from the freshest known
|
|
124
|
+
* thread (read off the store ref) plus the two messages this turn just produced.
|
|
125
|
+
*/
|
|
126
|
+
function buildDoneSnapshot<TPart>(
|
|
127
|
+
priorThread: AgentThread<TPart> | undefined,
|
|
128
|
+
threadId: string,
|
|
129
|
+
userMessage: ChatMessage<TPart>,
|
|
130
|
+
assistantMessage: ChatMessage<TPart>,
|
|
131
|
+
): AgentThread<TPart> {
|
|
132
|
+
const updatedAt = Date.now()
|
|
133
|
+
if (priorThread === undefined) {
|
|
134
|
+
return {
|
|
135
|
+
id: threadId,
|
|
136
|
+
messages: [userMessage, assistantMessage],
|
|
137
|
+
outcome: null,
|
|
138
|
+
status: 'done',
|
|
139
|
+
read: false,
|
|
140
|
+
createdAt: userMessage.createdAt,
|
|
141
|
+
updatedAt,
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
...priorThread,
|
|
146
|
+
messages: [...priorThread.messages, assistantMessage],
|
|
147
|
+
status: 'done',
|
|
148
|
+
updatedAt,
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Consumes an in-flight (or resumed) generator for one thread, accumulating parts into `runs`,
|
|
154
|
+
* skipping StartParts (recording their resumeToken via setResumeToken instead of rendering them),
|
|
155
|
+
* and finalizing into a persisted assistant ChatMessage + distilled AgentOutcome once the stream
|
|
156
|
+
* completes. Shared by both start() (a fresh turn) and the mount-time resume path (reconnecting
|
|
157
|
+
* an orphaned thread) so the ~40-line accumulate/finalize/error logic exists exactly once.
|
|
158
|
+
*
|
|
159
|
+
* `onFailureStatus` is the ThreadStatus to set when the generator throws (excluding AbortError,
|
|
160
|
+
* which is always a no-op): start() passes 'error' (today's behavior for a fresh turn that fails);
|
|
161
|
+
* the resume path passes 'interrupted' (a failed resume falls back to the same terminal state a
|
|
162
|
+
* non-resumable orphaned thread already lands in).
|
|
163
|
+
*/
|
|
164
|
+
async function consumeAndFinalize<TPart>(args: {
|
|
165
|
+
threadId: string
|
|
166
|
+
controller: AbortController
|
|
167
|
+
generator: AsyncGenerator<TPart>
|
|
168
|
+
userMessage: ChatMessage<TPart>
|
|
169
|
+
controllersRef: MutableRefObject<Map<string, AbortController>>
|
|
170
|
+
storeRef: MutableRefObject<ThreadsStore<TPart>>
|
|
171
|
+
resolveOutcome: OutcomeResolver<TPart>
|
|
172
|
+
setRuns: Dispatch<SetStateAction<Map<string, ThreadRunState<TPart>>>>
|
|
173
|
+
onFailureStatus: ThreadStatus
|
|
174
|
+
}): Promise<void> {
|
|
175
|
+
const {
|
|
176
|
+
threadId,
|
|
177
|
+
controller,
|
|
178
|
+
generator,
|
|
179
|
+
userMessage,
|
|
180
|
+
controllersRef,
|
|
181
|
+
storeRef,
|
|
182
|
+
resolveOutcome,
|
|
183
|
+
setRuns,
|
|
184
|
+
onFailureStatus,
|
|
185
|
+
} = args
|
|
186
|
+
const parts: TPart[] = []
|
|
187
|
+
try {
|
|
188
|
+
for await (const part of generator) {
|
|
189
|
+
// Guard: a newer call superseded this stream's controller for this thread, or it
|
|
190
|
+
// was aborted — stop updating state.
|
|
191
|
+
if (controllersRef.current.get(threadId) !== controller) return
|
|
192
|
+
if (controller.signal.aborted) return
|
|
193
|
+
if (isStartPart(part)) {
|
|
194
|
+
storeRef.current.setResumeToken(threadId, part.resumeToken)
|
|
195
|
+
continue
|
|
196
|
+
}
|
|
197
|
+
parts.push(part)
|
|
198
|
+
setRuns((prev) => {
|
|
199
|
+
const next = new Map(prev)
|
|
200
|
+
next.set(threadId, { status: 'streaming', parts: [...parts] })
|
|
201
|
+
return next
|
|
202
|
+
})
|
|
203
|
+
}
|
|
204
|
+
// Only proceed if this stream is still the current one and wasn't aborted.
|
|
205
|
+
if (controllersRef.current.get(threadId) !== controller || controller.signal.aborted) {
|
|
206
|
+
return
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const assistantMessage: ChatMessage<TPart> = {
|
|
210
|
+
id: crypto.randomUUID(),
|
|
211
|
+
role: 'assistant',
|
|
212
|
+
parts,
|
|
213
|
+
createdAt: Date.now(),
|
|
214
|
+
}
|
|
215
|
+
storeRef.current.appendMessage(threadId, assistantMessage)
|
|
216
|
+
|
|
217
|
+
const priorThread = storeRef.current.threads.find((thread) => thread.id === threadId)
|
|
218
|
+
const snapshot = buildDoneSnapshot(priorThread, threadId, userMessage, assistantMessage)
|
|
219
|
+
const outcome: AgentOutcome = await resolveOutcome(snapshot)
|
|
220
|
+
|
|
221
|
+
storeRef.current.setOutcome(threadId, outcome)
|
|
222
|
+
storeRef.current.setStatus(threadId, outcome.status)
|
|
223
|
+
storeRef.current.setResumeToken(threadId, undefined)
|
|
224
|
+
controllersRef.current.delete(threadId)
|
|
225
|
+
setRuns((prev) => {
|
|
226
|
+
if (!prev.has(threadId)) return prev
|
|
227
|
+
const next = new Map(prev)
|
|
228
|
+
next.delete(threadId)
|
|
229
|
+
return next
|
|
230
|
+
})
|
|
231
|
+
} catch (err) {
|
|
232
|
+
// Ignore abort errors — they are intentional (stop() was called or superseded).
|
|
233
|
+
if (err instanceof Error && err.name === 'AbortError') return
|
|
234
|
+
// Guard: don't corrupt state if a newer stream has taken over this thread.
|
|
235
|
+
if (controllersRef.current.get(threadId) !== controller) return
|
|
236
|
+
// Guard: don't overwrite a user-cancelled state if the signal was aborted.
|
|
237
|
+
if (controller.signal.aborted) return
|
|
238
|
+
storeRef.current.setStatus(threadId, onFailureStatus)
|
|
239
|
+
controllersRef.current.delete(threadId)
|
|
240
|
+
setRuns((prev) => {
|
|
241
|
+
if (!prev.has(threadId)) return prev
|
|
242
|
+
const next = new Map(prev)
|
|
243
|
+
next.delete(threadId)
|
|
244
|
+
return next
|
|
245
|
+
})
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// ── useAgentThreadRuns ────────────────────────────────────────────────────────
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Manages N concurrent streaming agent turns — one per thread id — over an injected
|
|
253
|
+
* AgentTransport and ThreadsStore. Starting a turn on a thread that already has one in
|
|
254
|
+
* flight is a no-op; different threads stream fully concurrently.
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* const { runs, start, stop, stopAll } = useAgentThreadRuns({ transport, store, resolveOutcome })
|
|
258
|
+
* start(threadA, 'Summarize this PR')
|
|
259
|
+
* start(threadB, 'What changed in the last release?')
|
|
260
|
+
* // both stream concurrently; runs.get(threadA) / runs.get(threadB) update independently
|
|
261
|
+
*/
|
|
262
|
+
export function useAgentThreadRuns<TPart = AgentPart>({
|
|
263
|
+
transport,
|
|
264
|
+
store,
|
|
265
|
+
resolveOutcome,
|
|
266
|
+
toUserParts,
|
|
267
|
+
}: UseAgentThreadRunsArgs<TPart>): UseAgentThreadRunsReturn<TPart> {
|
|
268
|
+
const [runs, setRuns] = useState<Map<string, ThreadRunState<TPart>>>(new Map())
|
|
269
|
+
|
|
270
|
+
// Refs: mutable per-render state that must not trigger re-renders.
|
|
271
|
+
const controllersRef = useRef<Map<string, AbortController>>(new Map())
|
|
272
|
+
// Caches the last user input per thread so retry() can replay a failed turn without the
|
|
273
|
+
// caller having to hold onto (or re-collect) what was typed.
|
|
274
|
+
const lastInputRef = useRef<Map<string, string>>(new Map())
|
|
275
|
+
// Mirrors the latest store every render so completion callbacks (which fire long after the
|
|
276
|
+
// render that started them) read the freshest threads rather than a stale closure.
|
|
277
|
+
const storeRef = useRef(store)
|
|
278
|
+
storeRef.current = store
|
|
279
|
+
// Mirrors the latest transport prop every render (same pattern as storeRef) so
|
|
280
|
+
// resolveTransport() always reads the freshest value, whether it's a plain object or a factory.
|
|
281
|
+
const transportRef = useRef(transport)
|
|
282
|
+
transportRef.current = transport
|
|
283
|
+
// Per-thread transport cache, only populated when `transport` is a factory: resolved (and
|
|
284
|
+
// memoized) the first time a thread needs one, in either start() or the mount-time resume
|
|
285
|
+
// effect, then reused for every subsequent call on that same thread id.
|
|
286
|
+
const transportsRef = useRef<Map<string, AgentTransport<TPart, string>>>(new Map())
|
|
287
|
+
// The default only applies when TPart is the framework default AgentPart; custom part unions
|
|
288
|
+
// must pass toUserParts explicitly. Cast is scoped to this one fallback assignment.
|
|
289
|
+
const resolvedToUserParts =
|
|
290
|
+
toUserParts ?? (defaultToUserParts as unknown as (input: string) => TPart[])
|
|
291
|
+
const toUserPartsRef = useRef(resolvedToUserParts)
|
|
292
|
+
toUserPartsRef.current = resolvedToUserParts
|
|
293
|
+
|
|
294
|
+
// Resolves the transport for `threadId`: the shared object as-is for the plain-object form
|
|
295
|
+
// (unchanged behavior), or the factory's result — resolved once per thread id and cached in
|
|
296
|
+
// transportsRef thereafter — for the factory form. Not itself memoized (cheap to recreate each
|
|
297
|
+
// render); correctness comes from always reading transportRef/transportsRef, not from stability.
|
|
298
|
+
const resolveTransport = (threadId: string): AgentTransport<TPart, string> => {
|
|
299
|
+
const currentTransport = transportRef.current
|
|
300
|
+
if (typeof currentTransport !== 'function') return currentTransport
|
|
301
|
+
const cached = transportsRef.current.get(threadId)
|
|
302
|
+
if (cached !== undefined) return cached
|
|
303
|
+
const resolved = currentTransport(threadId)
|
|
304
|
+
transportsRef.current.set(threadId, resolved)
|
|
305
|
+
return resolved
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Abort every in-flight stream on unmount to stop the async generators.
|
|
309
|
+
useEffect(
|
|
310
|
+
() => () => {
|
|
311
|
+
controllersRef.current.forEach((controller) => controller.abort())
|
|
312
|
+
},
|
|
313
|
+
[],
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
// Reconcile orphaned in-flight threads on mount: a persisted thread can be stuck 'pending' or
|
|
317
|
+
// 'streaming' after a reload/remount, since controllersRef and `runs` both start empty — nothing
|
|
318
|
+
// would otherwise resolve that skeleton. If the transport supports resumption and the thread has
|
|
319
|
+
// a resumeToken (from a StartPart emitted before the disconnect) plus a user message to resume
|
|
320
|
+
// from, attempt to reconnect the run instead. Any other case — no resume(), no resumeToken, no
|
|
321
|
+
// user message, or the resume itself failing — falls back to 'interrupted' so the UI renders a
|
|
322
|
+
// resend prompt instead of an unresolving skeleton (today's behavior, unchanged as the fallback
|
|
323
|
+
// path). Mount-only by design (empty deps): this is a one-time sweep of whatever was persisted
|
|
324
|
+
// when this manager first attaches, not a recurring check — a thread only needs reconciling once
|
|
325
|
+
// per stale mount.
|
|
326
|
+
useEffect(() => {
|
|
327
|
+
for (const thread of storeRef.current.threads) {
|
|
328
|
+
const orphaned =
|
|
329
|
+
(thread.status === 'pending' || thread.status === 'streaming') &&
|
|
330
|
+
!controllersRef.current.has(thread.id)
|
|
331
|
+
if (!orphaned) continue
|
|
332
|
+
|
|
333
|
+
const resumeToken = thread.resumeToken
|
|
334
|
+
const lastUserMessage = thread.messages.filter((message) => message.role === 'user').at(-1)
|
|
335
|
+
const resolvedTransport = resolveTransport(thread.id)
|
|
336
|
+
|
|
337
|
+
if (
|
|
338
|
+
resolvedTransport.resume === undefined ||
|
|
339
|
+
resumeToken === undefined ||
|
|
340
|
+
lastUserMessage === undefined
|
|
341
|
+
) {
|
|
342
|
+
storeRef.current.setStatus(thread.id, 'interrupted')
|
|
343
|
+
continue
|
|
344
|
+
}
|
|
345
|
+
const resume = resolvedTransport.resume
|
|
346
|
+
|
|
347
|
+
const controller = new AbortController()
|
|
348
|
+
controllersRef.current.set(thread.id, controller)
|
|
349
|
+
setRuns((prev) => {
|
|
350
|
+
const next = new Map(prev)
|
|
351
|
+
next.set(thread.id, { status: 'streaming', parts: [] })
|
|
352
|
+
return next
|
|
353
|
+
})
|
|
354
|
+
|
|
355
|
+
void consumeAndFinalize({
|
|
356
|
+
threadId: thread.id,
|
|
357
|
+
controller,
|
|
358
|
+
generator: resume(resumeToken, controller.signal),
|
|
359
|
+
userMessage: lastUserMessage,
|
|
360
|
+
controllersRef,
|
|
361
|
+
storeRef,
|
|
362
|
+
resolveOutcome,
|
|
363
|
+
setRuns,
|
|
364
|
+
onFailureStatus: 'interrupted',
|
|
365
|
+
})
|
|
366
|
+
}
|
|
367
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
368
|
+
}, [])
|
|
369
|
+
|
|
370
|
+
const start = useCallback(
|
|
371
|
+
(threadId: string, input: string): void => {
|
|
372
|
+
// Ignore a second concurrent turn on the SAME thread; different threads run concurrently.
|
|
373
|
+
if (controllersRef.current.has(threadId)) return
|
|
374
|
+
|
|
375
|
+
lastInputRef.current.set(threadId, input)
|
|
376
|
+
|
|
377
|
+
const userMessage: ChatMessage<TPart> = {
|
|
378
|
+
id: crypto.randomUUID(),
|
|
379
|
+
role: 'user',
|
|
380
|
+
parts: toUserPartsRef.current(input),
|
|
381
|
+
createdAt: Date.now(),
|
|
382
|
+
}
|
|
383
|
+
storeRef.current.appendMessage(threadId, userMessage)
|
|
384
|
+
storeRef.current.setStatus(threadId, 'streaming')
|
|
385
|
+
setRuns((prev) => {
|
|
386
|
+
const next = new Map(prev)
|
|
387
|
+
next.set(threadId, { status: 'streaming', parts: [] })
|
|
388
|
+
return next
|
|
389
|
+
})
|
|
390
|
+
|
|
391
|
+
const controller = new AbortController()
|
|
392
|
+
controllersRef.current.set(threadId, controller)
|
|
393
|
+
const resolvedTransport = resolveTransport(threadId)
|
|
394
|
+
|
|
395
|
+
// Non-awaited: this consumer runs in the background so start() returns immediately and
|
|
396
|
+
// multiple threads can stream at once.
|
|
397
|
+
void consumeAndFinalize({
|
|
398
|
+
threadId,
|
|
399
|
+
controller,
|
|
400
|
+
generator: resolvedTransport.stream(input, controller.signal),
|
|
401
|
+
userMessage,
|
|
402
|
+
controllersRef,
|
|
403
|
+
storeRef,
|
|
404
|
+
resolveOutcome,
|
|
405
|
+
setRuns,
|
|
406
|
+
onFailureStatus: 'error',
|
|
407
|
+
})
|
|
408
|
+
},
|
|
409
|
+
[resolveOutcome],
|
|
410
|
+
)
|
|
411
|
+
|
|
412
|
+
const retry = useCallback(
|
|
413
|
+
(threadId: string): void => {
|
|
414
|
+
const input = lastInputRef.current.get(threadId)
|
|
415
|
+
if (input === undefined) return
|
|
416
|
+
start(threadId, input)
|
|
417
|
+
},
|
|
418
|
+
[start],
|
|
419
|
+
)
|
|
420
|
+
|
|
421
|
+
const stop = useCallback((threadId: string): void => {
|
|
422
|
+
controllersRef.current.get(threadId)?.abort()
|
|
423
|
+
controllersRef.current.delete(threadId)
|
|
424
|
+
storeRef.current.setStatus(threadId, 'done')
|
|
425
|
+
setRuns((prev) => {
|
|
426
|
+
if (!prev.has(threadId)) return prev
|
|
427
|
+
const next = new Map(prev)
|
|
428
|
+
next.delete(threadId)
|
|
429
|
+
return next
|
|
430
|
+
})
|
|
431
|
+
}, [])
|
|
432
|
+
|
|
433
|
+
const stopAll = useCallback((): void => {
|
|
434
|
+
controllersRef.current.forEach((controller) => controller.abort())
|
|
435
|
+
controllersRef.current.clear()
|
|
436
|
+
setRuns(new Map())
|
|
437
|
+
}, [])
|
|
438
|
+
|
|
439
|
+
return { runs, start, retry, stop, stopAll }
|
|
440
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composer — a pure, prop-driven message input: autosize Textarea + send action.
|
|
3
|
+
*
|
|
4
|
+
* Enter submits (trims, ignores empty, then clears); Shift+Enter inserts a newline. No store or
|
|
5
|
+
* fetching coupling — the caller owns wiring `onSubmit` to whatever sends the message.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* import { Composer } from 'basalt-ui'
|
|
9
|
+
*
|
|
10
|
+
* <Composer onSubmit={(text) => send(text)} disabled={streaming} placeholder="Send a message…" />
|
|
11
|
+
*/
|
|
12
|
+
import { ActionIcon, Group, Kbd, Stack, Text, Textarea } from '@mantine/core'
|
|
13
|
+
import type { ComponentProps, JSX, KeyboardEvent } from 'react'
|
|
14
|
+
import { useState } from 'react'
|
|
15
|
+
import { VX } from '../tokens'
|
|
16
|
+
|
|
17
|
+
/** A minimal, dependency-free send-arrow glyph (icons are passed in as ReactNode elsewhere; this
|
|
18
|
+
* one is inline since Composer has no icon prop in its contract). */
|
|
19
|
+
function SendGlyph(): JSX.Element {
|
|
20
|
+
return (
|
|
21
|
+
<svg width={16} height={16} viewBox="0 0 24 24" fill="none" aria-hidden>
|
|
22
|
+
<path
|
|
23
|
+
d="M4 12l16 -7l-7 16l-2 -7l-7 -2z"
|
|
24
|
+
stroke="currentColor"
|
|
25
|
+
strokeWidth={2}
|
|
26
|
+
strokeLinecap="round"
|
|
27
|
+
strokeLinejoin="round"
|
|
28
|
+
/>
|
|
29
|
+
</svg>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type ComposerProps = {
|
|
34
|
+
/** Called with the trimmed, non-empty text on submit. The input is cleared afterward. */
|
|
35
|
+
readonly onSubmit: (text: string) => void
|
|
36
|
+
/** Disables the textarea and the send action (e.g. while a run is streaming). */
|
|
37
|
+
readonly disabled?: boolean
|
|
38
|
+
readonly placeholder?: string
|
|
39
|
+
/** Autofocuses the textarea on mount. */
|
|
40
|
+
readonly autoFocus?: boolean
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* An autosize Textarea + send ActionIcon. Enter submits, Shift+Enter inserts a newline.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* <Composer onSubmit={onSend} disabled={streaming} />
|
|
48
|
+
*/
|
|
49
|
+
export function Composer({
|
|
50
|
+
onSubmit,
|
|
51
|
+
disabled = false,
|
|
52
|
+
placeholder,
|
|
53
|
+
autoFocus,
|
|
54
|
+
}: ComposerProps): JSX.Element {
|
|
55
|
+
const [value, setValue] = useState('')
|
|
56
|
+
|
|
57
|
+
const submit = (): void => {
|
|
58
|
+
const trimmed = value.trim()
|
|
59
|
+
if (trimmed.length === 0 || disabled) return
|
|
60
|
+
onSubmit(trimmed)
|
|
61
|
+
setValue('')
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const handleKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>): void => {
|
|
65
|
+
if (event.key !== 'Enter' || event.shiftKey) return
|
|
66
|
+
event.preventDefault()
|
|
67
|
+
submit()
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const textareaProps: ComponentProps<typeof Textarea> = {
|
|
71
|
+
flex: 1,
|
|
72
|
+
autosize: true,
|
|
73
|
+
minRows: 1,
|
|
74
|
+
maxRows: 6,
|
|
75
|
+
value,
|
|
76
|
+
disabled,
|
|
77
|
+
onChange: (event) => setValue(event.currentTarget.value),
|
|
78
|
+
onKeyDown: handleKeyDown,
|
|
79
|
+
// Composer input surface (docs/DESIGN-SPEC.md §5): panel + shadow-card, control radius (6px,
|
|
80
|
+
// VX.radiusCtrl) — the ring
|
|
81
|
+
// lives in the shadow, so the input carries no separate border.
|
|
82
|
+
styles: {
|
|
83
|
+
input: {
|
|
84
|
+
backgroundColor: 'var(--vx-surface-panel)',
|
|
85
|
+
boxShadow: 'var(--vx-shadow-card)',
|
|
86
|
+
borderRadius: VX.radiusCtrl,
|
|
87
|
+
border: 'none',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
}
|
|
91
|
+
if (placeholder !== undefined) textareaProps.placeholder = placeholder
|
|
92
|
+
if (autoFocus !== undefined) textareaProps.autoFocus = autoFocus
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<Stack gap={6}>
|
|
96
|
+
<Group gap="xs" align="flex-end" wrap="nowrap">
|
|
97
|
+
<Textarea {...textareaProps} />
|
|
98
|
+
<ActionIcon
|
|
99
|
+
size={42}
|
|
100
|
+
radius="md"
|
|
101
|
+
variant="filled"
|
|
102
|
+
onClick={submit}
|
|
103
|
+
disabled={disabled || value.trim().length === 0}
|
|
104
|
+
aria-label="Send message"
|
|
105
|
+
// Send action (docs/DESIGN-SPEC.md §5): the one accent-filled control. It needs no color
|
|
106
|
+
// override — `filled` resolves through the theme to `--vx-accentFill` / `--vx-onAccent`.
|
|
107
|
+
// (It used to hand-wire those two vars inline, which is why this was the ONLY filled
|
|
108
|
+
// control that stayed legible while the rest of the chrome went through Mantine's
|
|
109
|
+
// scheme-blind autoContrast. The theme owns it now, and hover works again — an inline
|
|
110
|
+
// style can't express a `:hover` state.)
|
|
111
|
+
>
|
|
112
|
+
<SendGlyph />
|
|
113
|
+
</ActionIcon>
|
|
114
|
+
</Group>
|
|
115
|
+
<Group gap={4}>
|
|
116
|
+
<Kbd size="xs">Enter</Kbd>
|
|
117
|
+
<Text size="xs" c="dimmed" style={{ fontFamily: 'var(--basalt-font-mono)' }}>
|
|
118
|
+
to send
|
|
119
|
+
</Text>
|
|
120
|
+
<Kbd size="xs">Shift</Kbd>
|
|
121
|
+
<Text size="xs" c="dimmed" style={{ fontFamily: 'var(--basalt-font-mono)' }}>
|
|
122
|
+
+
|
|
123
|
+
</Text>
|
|
124
|
+
<Kbd size="xs">Enter</Kbd>
|
|
125
|
+
<Text size="xs" c="dimmed" style={{ fontFamily: 'var(--basalt-font-mono)' }}>
|
|
126
|
+
for a new line
|
|
127
|
+
</Text>
|
|
128
|
+
</Group>
|
|
129
|
+
</Stack>
|
|
130
|
+
)
|
|
131
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mantine-styled thread-chat components over the headless `basalt-ui/agent` layer, capped by the
|
|
3
|
+
* flagship `ThreadWorkspace` composite.
|
|
4
|
+
*
|
|
5
|
+
* This module is Mantine-coupled by design and lives under the root entry (unlike `basalt-ui/agent`,
|
|
6
|
+
* which stays headless so it can be styled by any consumer).
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { ThreadWorkspace } from 'basalt-ui'
|
|
10
|
+
* import { createThreadsStore, edenTransport, heuristicOutcome } from 'basalt-ui/agent'
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// ── ThreadWorkspace (flagship composite) ──────────────────────────────────────
|
|
14
|
+
export { ThreadWorkspace } from './thread-workspace'
|
|
15
|
+
export type { ThreadWorkspaceProps } from './thread-workspace'
|
|
16
|
+
|
|
17
|
+
// ── ThreadFeed ────────────────────────────────────────────────────────────────
|
|
18
|
+
export { ThreadFeed } from './thread-feed'
|
|
19
|
+
export type { ThreadFeedProps } from './thread-feed'
|
|
20
|
+
|
|
21
|
+
// ── ThreadOutcomeCard ─────────────────────────────────────────────────────────
|
|
22
|
+
export { ThreadOutcomeCard } from './thread-outcome-card'
|
|
23
|
+
export type { ThreadOutcomeCardProps } from './thread-outcome-card'
|
|
24
|
+
|
|
25
|
+
// ── ThreadDetailPanel ─────────────────────────────────────────────────────────
|
|
26
|
+
export { ThreadDetailPanel } from './thread-detail-panel'
|
|
27
|
+
export type { ThreadDetailPanelProps } from './thread-detail-panel'
|
|
28
|
+
|
|
29
|
+
// ── Composer ──────────────────────────────────────────────────────────────────
|
|
30
|
+
export { Composer } from './composer'
|
|
31
|
+
export type { ComposerProps } from './composer'
|
|
32
|
+
|
|
33
|
+
// ── threadPartRenderers + ThreadTranscript ────────────────────────────────────
|
|
34
|
+
export { threadPartRenderers, ThreadTranscript } from './thread-message'
|
|
35
|
+
export type { ThreadTranscriptProps } from './thread-message'
|