veryfront 0.1.996 → 0.1.998
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/esm/cli/templates/manifest.js +1 -1
- package/esm/deno.d.ts +8 -0
- package/esm/deno.js +12 -3
- package/esm/deps/esm.sh/react-dom@19.2.4.d.ts +2 -0
- package/esm/deps/esm.sh/react-dom@19.2.4.d.ts.map +1 -0
- package/esm/deps/esm.sh/react-dom@19.2.4.js +3 -0
- package/esm/react/react-dom.d.ts +3 -0
- package/esm/react/react-dom.d.ts.map +1 -0
- package/esm/react/react-dom.js +2 -0
- package/esm/src/agent/ag-ui/host-support.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/host-support.js +12 -0
- package/esm/src/agent/react/index.d.ts +4 -2
- package/esm/src/agent/react/index.d.ts.map +1 -1
- package/esm/src/agent/react/index.js +2 -1
- package/esm/src/agent/react/use-agent-metadata.d.ts +5 -0
- package/esm/src/agent/react/use-agent-metadata.d.ts.map +1 -1
- package/esm/src/agent/react/use-agent-metadata.js +18 -9
- package/esm/src/agent/react/use-agents.d.ts +33 -0
- package/esm/src/agent/react/use-agents.d.ts.map +1 -0
- package/esm/src/agent/react/use-agents.js +72 -0
- package/esm/src/agent/react/use-chat/index.d.ts +1 -1
- package/esm/src/agent/react/use-chat/index.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/types.d.ts +3 -2
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts +12 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +47 -7
- package/esm/src/agent/react/use-chat/utils.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/utils.js +4 -0
- package/esm/src/agent/runtime/message-adapter.d.ts.map +1 -1
- package/esm/src/agent/runtime/message-adapter.js +3 -1
- package/esm/src/agent/runtime/text-generation-runtime-message-converter.d.ts.map +1 -1
- package/esm/src/agent/runtime/text-generation-runtime-message-converter.js +6 -2
- package/esm/src/chat/index.d.ts +17 -7
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/chat/index.js +33 -7
- package/esm/src/chat/protocol.d.ts +13 -1
- package/esm/src/chat/protocol.d.ts.map +1 -1
- package/esm/src/chat/upload-handler.d.ts +55 -0
- package/esm/src/chat/upload-handler.d.ts.map +1 -0
- package/esm/src/chat/upload-handler.js +180 -0
- package/esm/src/discovery/import-rewriter.d.ts +1 -1
- package/esm/src/discovery/import-rewriter.d.ts.map +1 -1
- package/esm/src/discovery/import-rewriter.js +2 -0
- package/esm/src/discovery/transpiler.d.ts.map +1 -1
- package/esm/src/discovery/transpiler.js +2 -0
- package/esm/src/react/components/chat/agent-card.d.ts +84 -11
- package/esm/src/react/components/chat/agent-card.d.ts.map +1 -1
- package/esm/src/react/components/chat/agent-card.js +151 -57
- package/esm/src/react/components/chat/agent-picker.d.ts +166 -0
- package/esm/src/react/components/chat/agent-picker.d.ts.map +1 -0
- package/esm/src/react/components/chat/agent-picker.js +183 -0
- package/esm/src/react/components/chat/chat/components/animations.js +1 -1
- package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts +125 -3
- package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/attachment-pill.js +209 -25
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts +149 -0
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/attachments-panel.js +187 -0
- package/esm/src/react/components/chat/chat/components/branch-picker.d.ts +13 -2
- package/esm/src/react/components/chat/chat/components/branch-picker.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/branch-picker.js +6 -8
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts +20 -0
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.js +31 -0
- package/esm/src/react/components/chat/chat/components/code-block.d.ts +9 -1
- package/esm/src/react/components/chat/chat/components/code-block.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/code-block.js +14 -6
- package/esm/src/react/components/chat/chat/components/drop-zone.d.ts +11 -4
- package/esm/src/react/components/chat/chat/components/drop-zone.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/drop-zone.js +10 -8
- package/esm/src/react/components/chat/chat/components/empty-state.d.ts +2 -1
- package/esm/src/react/components/chat/chat/components/empty-state.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/empty-state.js +7 -8
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts +6 -2
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/inference-badge.js +5 -4
- package/esm/src/react/components/chat/chat/components/inline-citation.d.ts +9 -1
- package/esm/src/react/components/chat/chat/components/inline-citation.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/inline-citation.js +19 -20
- package/esm/src/react/components/chat/chat/components/message-actions.d.ts +28 -5
- package/esm/src/react/components/chat/chat/components/message-actions.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-actions.js +24 -36
- package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts +7 -2
- package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-edit-form.js +5 -5
- package/esm/src/react/components/chat/chat/components/message-feedback.d.ts +11 -1
- package/esm/src/react/components/chat/chat/components/message-feedback.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-feedback.js +9 -11
- package/esm/src/react/components/chat/chat/components/quick-actions.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/quick-actions.js +3 -1
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts +66 -3
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/reasoning.js +95 -21
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts +178 -12
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sidebar.js +228 -45
- package/esm/src/react/components/chat/chat/components/skill-badge.d.ts +6 -1
- package/esm/src/react/components/chat/chat/components/skill-badge.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/skill-badge.js +6 -5
- package/esm/src/react/components/chat/chat/components/skill-tool.d.ts +37 -0
- package/esm/src/react/components/chat/chat/components/skill-tool.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/skill-tool.js +46 -0
- package/esm/src/react/components/chat/chat/components/sources.d.ts +55 -3
- package/esm/src/react/components/chat/chat/components/sources.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sources.js +50 -16
- package/esm/src/react/components/chat/chat/components/step-indicator.d.ts +42 -3
- package/esm/src/react/components/chat/chat/components/step-indicator.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/step-indicator.js +55 -12
- package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/tab-switcher.js +3 -3
- package/esm/src/react/components/chat/chat/components/tool-ui.d.ts +96 -3
- package/esm/src/react/components/chat/chat/components/tool-ui.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/tool-ui.js +158 -36
- package/esm/src/react/components/chat/chat/composition/api.d.ts +4 -2
- package/esm/src/react/components/chat/chat/composition/api.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/api.js +4 -2
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +112 -5
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.js +251 -61
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts +78 -0
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.js +63 -0
- package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts +4 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty.js +11 -10
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts +11 -3
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-message-list.js +81 -111
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts +4 -0
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-root.js +3 -1
- package/esm/src/react/components/chat/chat/composition/error-banner.d.ts +4 -0
- package/esm/src/react/components/chat/chat/composition/error-banner.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/error-banner.js +10 -7
- package/esm/src/react/components/chat/chat/composition/message.d.ts +123 -5
- package/esm/src/react/components/chat/chat/composition/message.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/message.js +332 -53
- package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts +6 -1
- package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/model-avatar.js +3 -4
- package/esm/src/react/components/chat/chat/composition/pending-message.d.ts +31 -0
- package/esm/src/react/components/chat/chat/composition/pending-message.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/composition/pending-message.js +31 -0
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts +4 -0
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts +1 -0
- package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts +29 -0
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/contexts/conversations-context.js +39 -0
- package/esm/src/react/components/chat/chat/contexts/index.d.ts +1 -1
- package/esm/src/react/components/chat/chat/contexts/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/index.js +1 -1
- package/esm/src/react/components/chat/chat/contexts/message-context.d.ts +2 -0
- package/esm/src/react/components/chat/chat/contexts/message-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-clipboard.d.ts +10 -0
- package/esm/src/react/components/chat/chat/hooks/use-clipboard.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-clipboard.js +34 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation.d.ts +21 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation.js +54 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversations.d.ts +67 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversations.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversations.js +317 -0
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts +27 -0
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.js +50 -0
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts +49 -0
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.js +120 -0
- package/esm/src/react/components/chat/chat/hooks/use-upload.d.ts +34 -0
- package/esm/src/react/components/chat/chat/hooks/use-upload.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-upload.js +147 -0
- package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.d.ts +37 -0
- package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.js +178 -0
- package/esm/src/react/components/chat/chat/index.d.ts +171 -31
- package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/index.js +371 -77
- package/esm/src/react/components/chat/chat/persistence/conversation-store.d.ts +63 -0
- package/esm/src/react/components/chat/chat/persistence/conversation-store.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/persistence/conversation-store.js +1 -0
- package/esm/src/react/components/chat/chat/persistence/local-conversation-store.d.ts +13 -0
- package/esm/src/react/components/chat/chat/persistence/local-conversation-store.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/persistence/local-conversation-store.js +102 -0
- package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.d.ts +11 -0
- package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.js +33 -0
- package/esm/src/react/components/chat/chat/utils/message-parts.d.ts +4 -1
- package/esm/src/react/components/chat/chat/utils/message-parts.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/utils/message-parts.js +4 -0
- package/esm/src/react/components/chat/chat-actions.d.ts +164 -0
- package/esm/src/react/components/chat/chat-actions.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat-actions.js +191 -0
- package/esm/src/react/components/chat/chat-agent-picker.d.ts +50 -0
- package/esm/src/react/components/chat/chat-agent-picker.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat-agent-picker.js +40 -0
- package/esm/src/react/components/chat/chat-theme-scope.d.ts +26 -0
- package/esm/src/react/components/chat/chat-theme-scope.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat-theme-scope.js +27 -0
- package/esm/src/react/components/chat/chat-tokens-style.d.ts +21 -0
- package/esm/src/react/components/chat/chat-tokens-style.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat-tokens-style.js +24 -0
- package/esm/src/react/components/chat/chat.d.ts +5 -5
- package/esm/src/react/components/chat/chat.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat.js +5 -5
- package/esm/src/react/components/chat/color-mode.d.ts +46 -0
- package/esm/src/react/components/chat/color-mode.d.ts.map +1 -0
- package/esm/src/react/components/chat/color-mode.js +123 -0
- package/esm/src/react/components/chat/error-boundary.js +2 -2
- package/esm/src/react/components/chat/icons/index.d.ts +8 -0
- package/esm/src/react/components/chat/icons/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/icons/index.js +64 -0
- package/esm/src/react/components/chat/markdown.d.ts +24 -1
- package/esm/src/react/components/chat/markdown.d.ts.map +1 -1
- package/esm/src/react/components/chat/markdown.js +122 -38
- package/esm/src/react/components/chat/model-selector.d.ts +130 -8
- package/esm/src/react/components/chat/model-selector.d.ts.map +1 -1
- package/esm/src/react/components/chat/model-selector.js +148 -121
- package/esm/src/react/components/chat/theme.d.ts +9 -12
- package/esm/src/react/components/chat/theme.d.ts.map +1 -1
- package/esm/src/react/components/chat/theme.js +149 -93
- package/esm/src/react/components/chat/ui/alert.d.ts +30 -0
- package/esm/src/react/components/chat/ui/alert.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/alert.js +35 -0
- package/esm/src/react/components/chat/ui/app-shell.d.ts +155 -0
- package/esm/src/react/components/chat/ui/app-shell.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/app-shell.js +276 -0
- package/esm/src/react/components/chat/ui/avatar.d.ts +24 -0
- package/esm/src/react/components/chat/ui/avatar.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/avatar.js +44 -0
- package/esm/src/react/components/chat/ui/badge.d.ts +24 -0
- package/esm/src/react/components/chat/ui/badge.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/badge.js +30 -0
- package/esm/src/react/components/chat/ui/button.d.ts +44 -0
- package/esm/src/react/components/chat/ui/button.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/button.js +108 -0
- package/esm/src/react/components/chat/ui/card.d.ts +42 -0
- package/esm/src/react/components/chat/ui/card.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/card.js +55 -0
- package/esm/src/react/components/chat/ui/checkbox.d.ts +28 -0
- package/esm/src/react/components/chat/ui/checkbox.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/checkbox.js +36 -0
- package/esm/src/react/components/chat/ui/code-block.d.ts +89 -0
- package/esm/src/react/components/chat/ui/code-block.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/code-block.js +277 -0
- package/esm/src/react/components/chat/ui/collapsible.d.ts +30 -0
- package/esm/src/react/components/chat/ui/collapsible.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/collapsible.js +44 -0
- package/esm/src/react/components/chat/ui/command.d.ts +65 -0
- package/esm/src/react/components/chat/ui/command.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/command.js +121 -0
- package/esm/src/react/components/chat/ui/cva.d.ts +36 -0
- package/esm/src/react/components/chat/ui/cva.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/cva.js +45 -0
- package/esm/src/react/components/chat/ui/dialog.d.ts +55 -0
- package/esm/src/react/components/chat/ui/dialog.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/dialog.js +116 -0
- package/esm/src/react/components/chat/ui/drawer.d.ts +41 -0
- package/esm/src/react/components/chat/ui/drawer.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/drawer.js +92 -0
- package/esm/src/react/components/chat/ui/dropdown-menu.d.ts +63 -0
- package/esm/src/react/components/chat/ui/dropdown-menu.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/dropdown-menu.js +76 -0
- package/esm/src/react/components/chat/ui/file-type.d.ts +26 -0
- package/esm/src/react/components/chat/ui/file-type.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/file-type.js +235 -0
- package/esm/src/react/components/chat/ui/floating.d.ts +29 -0
- package/esm/src/react/components/chat/ui/floating.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/floating.js +90 -0
- package/esm/src/react/components/chat/ui/icon-button.d.ts +19 -0
- package/esm/src/react/components/chat/ui/icon-button.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/icon-button.js +20 -0
- package/esm/src/react/components/chat/ui/index.d.ts +43 -0
- package/esm/src/react/components/chat/ui/index.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/index.js +42 -0
- package/esm/src/react/components/chat/ui/input.d.ts +27 -0
- package/esm/src/react/components/chat/ui/input.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/input.js +41 -0
- package/esm/src/react/components/chat/ui/label.d.ts +29 -0
- package/esm/src/react/components/chat/ui/label.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/label.js +40 -0
- package/esm/src/react/components/chat/ui/list.d.ts +47 -0
- package/esm/src/react/components/chat/ui/list.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/list.js +40 -0
- package/esm/src/react/components/chat/ui/pill.d.ts +26 -0
- package/esm/src/react/components/chat/ui/pill.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/pill.js +39 -0
- package/esm/src/react/components/chat/ui/popover.d.ts +47 -0
- package/esm/src/react/components/chat/ui/popover.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/popover.js +68 -0
- package/esm/src/react/components/chat/ui/progress-bar.d.ts +20 -0
- package/esm/src/react/components/chat/ui/progress-bar.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/progress-bar.js +31 -0
- package/esm/src/react/components/chat/ui/radio.d.ts +25 -0
- package/esm/src/react/components/chat/ui/radio.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/radio.js +29 -0
- package/esm/src/react/components/chat/ui/scroll-fade.d.ts +23 -0
- package/esm/src/react/components/chat/ui/scroll-fade.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/scroll-fade.js +40 -0
- package/esm/src/react/components/chat/ui/select.d.ts +64 -0
- package/esm/src/react/components/chat/ui/select.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/select.js +148 -0
- package/esm/src/react/components/chat/ui/shimmer.d.ts +25 -0
- package/esm/src/react/components/chat/ui/shimmer.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/shimmer.js +24 -0
- package/esm/src/react/components/chat/ui/skeleton.d.ts +14 -0
- package/esm/src/react/components/chat/ui/skeleton.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/skeleton.js +12 -0
- package/esm/src/react/components/chat/ui/slot.d.ts +21 -0
- package/esm/src/react/components/chat/ui/slot.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/slot.js +70 -0
- package/esm/src/react/components/chat/ui/status.d.ts +28 -0
- package/esm/src/react/components/chat/ui/status.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/status.js +23 -0
- package/esm/src/react/components/chat/ui/switch.d.ts +34 -0
- package/esm/src/react/components/chat/ui/switch.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/switch.js +58 -0
- package/esm/src/react/components/chat/ui/tabs.d.ts +44 -0
- package/esm/src/react/components/chat/ui/tabs.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/tabs.js +51 -0
- package/esm/src/react/components/chat/ui/tag.d.ts +22 -0
- package/esm/src/react/components/chat/ui/tag.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/tag.js +27 -0
- package/esm/src/react/components/chat/ui/textarea.d.ts +22 -0
- package/esm/src/react/components/chat/ui/textarea.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/textarea.js +35 -0
- package/esm/src/react/components/chat/ui/tooltip.d.ts +40 -0
- package/esm/src/react/components/chat/ui/tooltip.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/tooltip.js +132 -0
- package/esm/src/react/primitives/input-box.d.ts.map +1 -1
- package/esm/src/react/primitives/input-box.js +17 -4
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +9437 -1064
- package/esm/src/server/handlers/dev/projects/html-shell.d.ts +1 -1
- package/esm/src/server/handlers/dev/projects/html-shell.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/projects/html-shell.js +1 -12
- package/esm/src/server/handlers/request/public-agents-list.handler.d.ts +18 -0
- package/esm/src/server/handlers/request/public-agents-list.handler.d.ts.map +1 -0
- package/esm/src/server/handlers/request/public-agents-list.handler.js +44 -0
- package/esm/src/server/runtime-handler/index.d.ts +1 -1
- package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/index.js +3 -0
- package/esm/src/studio/bridge/bridge-bundle.generated.d.ts +1 -1
- package/esm/src/studio/bridge/bridge-bundle.generated.d.ts.map +1 -1
- package/esm/src/studio/bridge/bridge-bundle.generated.js +3 -2
- package/esm/src/task/discovery.d.ts +95 -0
- package/esm/src/task/discovery.d.ts.map +1 -0
- package/esm/src/task/discovery.js +192 -0
- package/esm/src/task/index.d.ts +27 -0
- package/esm/src/task/index.d.ts.map +1 -0
- package/esm/src/task/index.js +22 -0
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/blob/local-storage.d.ts +32 -0
- package/esm/src/workflow/blob/local-storage.d.ts.map +1 -0
- package/esm/src/workflow/blob/local-storage.js +179 -0
- package/esm/src/workflow/blob/types.d.ts +5 -0
- package/esm/src/workflow/blob/types.d.ts.map +1 -1
- package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts +11 -0
- package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts.map +1 -1
- package/esm/src/workflow/blob/veryfront-cloud-storage.js +36 -0
- package/package.json +9 -1
- package/esm/src/react/components/chat/chat/components/uploads-panel.d.ts +0 -20
- package/esm/src/react/components/chat/chat/components/uploads-panel.d.ts.map +0 -1
- package/esm/src/react/components/chat/chat/components/uploads-panel.js +0 -49
- package/esm/src/react/components/chat/chat/contexts/thread-list-context.d.ts +0 -28
- package/esm/src/react/components/chat/chat/contexts/thread-list-context.d.ts.map +0 -1
- package/esm/src/react/components/chat/chat/contexts/thread-list-context.js +0 -27
- package/esm/src/react/components/chat/chat/hooks/use-threads.d.ts +0 -28
- package/esm/src/react/components/chat/chat/hooks/use-threads.d.ts.map +0 -1
- package/esm/src/react/components/chat/chat/hooks/use-threads.js +0 -151
- package/esm/src/react/components/chat/chat-with-sidebar.d.ts +0 -110
- package/esm/src/react/components/chat/chat-with-sidebar.d.ts.map +0 -1
- package/esm/src/react/components/chat/chat-with-sidebar.js +0 -167
- package/esm/src/react/components/chat/message.d.ts +0 -42
- package/esm/src/react/components/chat/message.d.ts.map +0 -1
- package/esm/src/react/components/chat/message.js +0 -69
|
@@ -1,6 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChatSidebar — a conversation rail, available as a one-shot preset or as a
|
|
3
|
+
* composable compound (mirroring `Chat` / `Message`).
|
|
4
|
+
*
|
|
5
|
+
* Conversation-native: it lists {@link ConversationSummary} rows and, inside a
|
|
6
|
+
* {@link ConversationsProvider}, needs **no props at all** — it reads the list,
|
|
7
|
+
* the active id, and select/new/delete/rename straight from context. Pass props
|
|
8
|
+
* to override any of them (controlled), or drop to the compound parts for a
|
|
9
|
+
* custom layout.
|
|
10
|
+
*
|
|
11
|
+
* @example Zero-config inside a provider
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <ConversationsProvider store={store}>
|
|
14
|
+
* <ChatSidebar /> // conversations + actions come from context
|
|
15
|
+
* </ConversationsProvider>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @example Preset — the whole rail from props
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <ChatSidebar
|
|
21
|
+
* conversations={conversations}
|
|
22
|
+
* activeId={activeId}
|
|
23
|
+
* onSelect={select}
|
|
24
|
+
* onDelete={remove}
|
|
25
|
+
* onRename={rename}
|
|
26
|
+
* onNew={create}
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example Composition — drive the layout yourself
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <ChatSidebar.Root>
|
|
33
|
+
* <ChatSidebar.NewButton>New chat</ChatSidebar.NewButton>
|
|
34
|
+
* <ChatSidebar.List />
|
|
35
|
+
* </ChatSidebar.Root>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* `<ChatSidebar.List />` with no children auto-groups the conversations by recency.
|
|
39
|
+
*
|
|
40
|
+
* @module react/components/chat/chat/components/sidebar
|
|
41
|
+
*/
|
|
1
42
|
import * as React from "../../../../../../react/react.js";
|
|
43
|
+
import { COMPONENT_ERROR } from "../../../../../errors/error-registry.js";
|
|
2
44
|
import { cn } from "../../theme.js";
|
|
3
|
-
import {
|
|
45
|
+
import { PencilIcon, TrashIcon } from "../../icons/index.js";
|
|
46
|
+
import { Button } from "../../ui/button.js";
|
|
47
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "../../ui/dropdown-menu.js";
|
|
48
|
+
import { List, ListItem, ListLabel } from "../../ui/list.js";
|
|
49
|
+
import { Skeleton } from "../../ui/skeleton.js";
|
|
50
|
+
import { ChatTokens } from "../../chat-tokens-style.js";
|
|
51
|
+
import { useConversationsContextOptional } from "../contexts/conversations-context.js";
|
|
52
|
+
/** Three-dots "more actions" glyph (not in the shared icons barrel). */
|
|
53
|
+
function MoreGlyph({ className }) {
|
|
54
|
+
return (React.createElement("svg", { className: cn("size-3.5", className), viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true" },
|
|
55
|
+
React.createElement("circle", { cx: "5", cy: "12", r: "1.6" }),
|
|
56
|
+
React.createElement("circle", { cx: "12", cy: "12", r: "1.6" }),
|
|
57
|
+
React.createElement("circle", { cx: "19", cy: "12", r: "1.6" })));
|
|
58
|
+
}
|
|
59
|
+
const ChatSidebarContext = React.createContext(null);
|
|
60
|
+
function useChatSidebarContext() {
|
|
61
|
+
const context = React.useContext(ChatSidebarContext);
|
|
62
|
+
if (!context) {
|
|
63
|
+
throw COMPONENT_ERROR.create({
|
|
64
|
+
detail: "ChatSidebar sub-components must be used within <ChatSidebar.Root>",
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return context;
|
|
68
|
+
}
|
|
69
|
+
const noop = () => { };
|
|
70
|
+
/**
|
|
71
|
+
* Resolve the sidebar's data + actions from the explicit conversation props,
|
|
72
|
+
* falling back to the surrounding {@link ConversationsProvider}. Inside a
|
|
73
|
+
* provider the sidebar needs no props.
|
|
74
|
+
*/
|
|
75
|
+
function useResolvedSidebar(props) {
|
|
76
|
+
const ctx = useConversationsContextOptional();
|
|
77
|
+
const conversations = props.conversations ?? ctx?.conversations ?? [];
|
|
78
|
+
const activeId = props.activeId !== undefined ? props.activeId : ctx?.activeId ?? null;
|
|
79
|
+
const onSelect = props.onSelect ?? ctx?.select ?? noop;
|
|
80
|
+
const onDelete = props.onDelete ?? ctx?.remove ?? noop;
|
|
81
|
+
const onRename = props.onRename ?? ctx?.rename;
|
|
82
|
+
const onNew = props.onNew ?? (ctx ? () => void ctx.create() : undefined);
|
|
83
|
+
const renderItem = props.renderItem;
|
|
84
|
+
return { conversations, activeId, onSelect, onDelete, onRename, onNew, renderItem };
|
|
85
|
+
}
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
// Recency grouping
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
4
89
|
function getRelativeGroup(timestamp) {
|
|
5
90
|
const day = 86_400_000;
|
|
6
91
|
const diff = Date.now() - timestamp;
|
|
@@ -15,15 +100,15 @@ function getRelativeGroup(timestamp) {
|
|
|
15
100
|
return "Previous 7 days";
|
|
16
101
|
return "Older";
|
|
17
102
|
}
|
|
18
|
-
function
|
|
103
|
+
function groupConversations(conversations) {
|
|
19
104
|
const groups = new Map();
|
|
20
105
|
const order = ["Today", "Yesterday", "Previous 7 days", "Older"];
|
|
21
106
|
for (const label of order) {
|
|
22
107
|
groups.set(label, []);
|
|
23
108
|
}
|
|
24
|
-
for (const
|
|
25
|
-
const label = getRelativeGroup(
|
|
26
|
-
groups.get(label).push(
|
|
109
|
+
for (const conversation of conversations) {
|
|
110
|
+
const label = getRelativeGroup(conversation.updatedAt);
|
|
111
|
+
groups.get(label).push(conversation);
|
|
27
112
|
}
|
|
28
113
|
for (const [key, value] of groups) {
|
|
29
114
|
if (value.length === 0)
|
|
@@ -31,63 +116,161 @@ function groupThreads(threads) {
|
|
|
31
116
|
}
|
|
32
117
|
return groups;
|
|
33
118
|
}
|
|
34
|
-
|
|
119
|
+
/** Context provider + outer rail container for the compound sidebar. */
|
|
120
|
+
export function ChatSidebarRoot(props) {
|
|
121
|
+
const { icons, loading, isOpen = true, fill = false, className, children } = props;
|
|
122
|
+
const resolved = useResolvedSidebar(props);
|
|
123
|
+
const value = React.useMemo(() => ({ ...resolved, icons, loading }), [
|
|
124
|
+
resolved.conversations,
|
|
125
|
+
resolved.activeId,
|
|
126
|
+
resolved.onSelect,
|
|
127
|
+
resolved.onDelete,
|
|
128
|
+
resolved.onRename,
|
|
129
|
+
resolved.onNew,
|
|
130
|
+
resolved.renderItem,
|
|
131
|
+
icons,
|
|
132
|
+
loading,
|
|
133
|
+
]);
|
|
134
|
+
if (!isOpen)
|
|
135
|
+
return null;
|
|
136
|
+
return (React.createElement(ChatSidebarContext.Provider, { value: value },
|
|
137
|
+
React.createElement(ChatTokens, null),
|
|
138
|
+
React.createElement("div", { "data-vf-chat": "", className: cn("flex flex-col h-full", fill
|
|
139
|
+
? "w-full"
|
|
140
|
+
: "shrink-0 max-sm:absolute max-sm:z-20 max-sm:shadow-xl max-sm:bg-[var(--background)]", className), style: fill ? undefined : { width: 240 } }, children)));
|
|
141
|
+
}
|
|
142
|
+
ChatSidebarRoot.displayName = "ChatSidebar.Root";
|
|
143
|
+
/** The primary "new conversation" action. Wires `onNew` from context. */
|
|
144
|
+
export function ChatSidebarNewButton({ children, className, }) {
|
|
145
|
+
const { onNew, icons } = useChatSidebarContext();
|
|
146
|
+
return (React.createElement("div", { className: "px-3 pt-4 pb-1" },
|
|
147
|
+
React.createElement(Button, { type: "button", variant: "primary", onClick: onNew, className: cn("w-full", className) },
|
|
148
|
+
icons?.newConversation,
|
|
149
|
+
children ?? "New chat")));
|
|
150
|
+
}
|
|
151
|
+
ChatSidebarNewButton.displayName = "ChatSidebar.NewButton";
|
|
152
|
+
/** A single conversation row — select on click, rename/delete via a "…" menu. */
|
|
153
|
+
export function ChatSidebarItem({ conversation, className, }) {
|
|
154
|
+
const { activeId, onSelect, onDelete, onRename, icons, } = useChatSidebarContext();
|
|
155
|
+
const isActive = conversation.id === activeId;
|
|
35
156
|
const [editing, setEditing] = React.useState(false);
|
|
36
|
-
const [editValue, setEditValue] = React.useState(
|
|
157
|
+
const [editValue, setEditValue] = React.useState(conversation.title);
|
|
158
|
+
const [menuOpen, setMenuOpen] = React.useState(false);
|
|
37
159
|
const inputRef = React.useRef(null);
|
|
38
160
|
React.useEffect(() => {
|
|
39
161
|
if (editing)
|
|
40
|
-
inputRef.current?.
|
|
162
|
+
inputRef.current?.select();
|
|
41
163
|
}, [editing]);
|
|
42
|
-
function
|
|
164
|
+
function startRename() {
|
|
43
165
|
if (!onRename)
|
|
44
166
|
return;
|
|
45
|
-
setEditValue(
|
|
167
|
+
setEditValue(conversation.title);
|
|
46
168
|
setEditing(true);
|
|
47
169
|
}
|
|
48
170
|
function commitRename() {
|
|
49
171
|
setEditing(false);
|
|
50
172
|
const trimmed = editValue.trim();
|
|
51
|
-
if (trimmed && trimmed !==
|
|
52
|
-
onRename?.(trimmed);
|
|
173
|
+
if (trimmed && trimmed !== conversation.title) {
|
|
174
|
+
onRename?.(conversation.id, trimmed);
|
|
53
175
|
}
|
|
54
176
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
React.createElement(
|
|
59
|
-
|
|
60
|
-
? (React.createElement("input", { ref: inputRef, value: editValue, onChange: (e) => setEditValue(e.target.value), onBlur: commitRename, onKeyDown: (e) => {
|
|
177
|
+
if (editing) {
|
|
178
|
+
// Fixed `h-8` = the display row's height (py-1.5 + a size-5 action button),
|
|
179
|
+
// so entering rename mode never resizes the row.
|
|
180
|
+
return (React.createElement("div", { className: "flex h-8 items-center gap-1 rounded-[var(--radius-sm)] bg-[var(--accent)] px-2.5" },
|
|
181
|
+
React.createElement("input", { ref: inputRef, value: editValue, onChange: (e) => setEditValue(e.target.value), onBlur: commitRename, onKeyDown: (e) => {
|
|
61
182
|
if (e.key === "Enter")
|
|
62
183
|
commitRename();
|
|
63
184
|
if (e.key === "Escape")
|
|
64
185
|
setEditing(false);
|
|
65
|
-
}, className: "flex-1
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
186
|
+
}, className: "min-w-0 flex-1 appearance-none border-0 bg-transparent p-0 text-[13px] leading-snug outline-none" })));
|
|
187
|
+
}
|
|
188
|
+
return (React.createElement(ListItem, { title: conversation.title, active: isActive || menuOpen, className: className, onClick: () => onSelect(conversation.id), action: React.createElement(DropdownMenu, { open: menuOpen, onOpenChange: setMenuOpen },
|
|
189
|
+
React.createElement(DropdownMenuTrigger, { asChild: true },
|
|
190
|
+
React.createElement(Button, { type: "button", variant: "icon-ghost", size: "icon-xs", on: "card", "aria-label": `More actions for ${conversation.title}` }, icons?.more ?? React.createElement(MoreGlyph, null))),
|
|
191
|
+
React.createElement(DropdownMenuContent, { align: "end", className: "min-w-[160px]" },
|
|
192
|
+
onRename && (React.createElement(DropdownMenuItem, { onSelect: startRename },
|
|
193
|
+
icons?.rename ?? React.createElement(PencilIcon, null),
|
|
194
|
+
"Rename")),
|
|
195
|
+
React.createElement(DropdownMenuItem, { onSelect: () => onDelete(conversation.id), className: "text-[var(--destructive)] hover:bg-[color-mix(in_oklch,var(--destructive),transparent_92%)]" },
|
|
196
|
+
icons?.delete ?? React.createElement(TrashIcon, null),
|
|
197
|
+
"Delete"))) }));
|
|
72
198
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
199
|
+
ChatSidebarItem.displayName = "ChatSidebar.Item";
|
|
200
|
+
/** A labeled cluster of conversation rows. */
|
|
201
|
+
export function ChatSidebarGroup({ label, children, className, }) {
|
|
202
|
+
return (React.createElement(List, { className: className },
|
|
203
|
+
label !== undefined && React.createElement(ListLabel, null, label),
|
|
204
|
+
children));
|
|
205
|
+
}
|
|
206
|
+
ChatSidebarGroup.displayName = "ChatSidebar.Group";
|
|
207
|
+
/** Placeholder shown when there are no conversations to list. */
|
|
208
|
+
export function ChatSidebarEmpty({ children, className, }) {
|
|
209
|
+
return (React.createElement("div", { className: cn("flex h-full flex-col items-center justify-center px-4 text-center text-[var(--faint)]", className) }, children ?? React.createElement("p", { className: "text-sm" }, "No chats yet")));
|
|
210
|
+
}
|
|
211
|
+
ChatSidebarEmpty.displayName = "ChatSidebar.Empty";
|
|
212
|
+
/**
|
|
213
|
+
* Loading placeholder for the list — shown until the client mounts (or while
|
|
214
|
+
* `loading`). Mirrors a real recency group (`List` + `ListLabel` + rows) so it
|
|
215
|
+
* sits at exactly the same position as the loaded list.
|
|
216
|
+
*/
|
|
217
|
+
function ChatSidebarSkeleton() {
|
|
218
|
+
return (React.createElement("output", { "aria-label": "Loading conversations", className: "block pt-1.5" },
|
|
219
|
+
React.createElement("span", { className: "sr-only" }, "Loading conversations"),
|
|
220
|
+
React.createElement(List, { "aria-hidden": "true" },
|
|
221
|
+
React.createElement(ListLabel, null,
|
|
222
|
+
React.createElement(Skeleton, { className: "h-2! w-10! bg-[var(--edge)]!" })),
|
|
223
|
+
["w-3/4", "w-1/2", "w-2/3", "w-3/5", "w-1/2"].map((width, index) => (React.createElement("div", { key: `${index}-${width}`, className: "px-2.5 py-1.5" },
|
|
224
|
+
React.createElement(Skeleton, { className: cn("h-3! bg-[var(--edge)]!", width) })))))));
|
|
225
|
+
}
|
|
226
|
+
/** Scrollable region. Auto-groups by recency unless given `children`. */
|
|
227
|
+
export function ChatSidebarList({ children, className, }) {
|
|
228
|
+
const { conversations, activeId, onSelect, onDelete, onRename, loading, renderItem, } = useChatSidebarContext();
|
|
229
|
+
// Conversations may load from localStorage (client-only), so the very first
|
|
230
|
+
// paint has none. Show a skeleton until mounted rather than flashing the
|
|
231
|
+
// "no chats yet" state — or whenever the caller explicitly signals `loading`.
|
|
232
|
+
const [mounted, setMounted] = React.useState(false);
|
|
233
|
+
React.useEffect(() => setMounted(true), []);
|
|
234
|
+
const visible = React.useMemo(
|
|
235
|
+
// Newest activity first. (spread first — never sort the source array.)
|
|
236
|
+
() => [...conversations].sort((a, b) => b.updatedAt - a.updatedAt), [conversations]);
|
|
237
|
+
const grouped = React.useMemo(() => groupConversations(visible), [visible]);
|
|
238
|
+
const body = children ?? (!mounted || loading
|
|
239
|
+
? React.createElement(ChatSidebarSkeleton, null)
|
|
240
|
+
: visible.length > 0
|
|
241
|
+
? Array.from(grouped.entries()).map(([label, items]) => (React.createElement(ChatSidebarGroup, { key: label, label: label }, items.map((conversation) => {
|
|
242
|
+
if (renderItem) {
|
|
243
|
+
return (React.createElement(React.Fragment, { key: conversation.id }, renderItem(conversation, {
|
|
244
|
+
isActive: conversation.id === activeId,
|
|
245
|
+
onSelect: () => onSelect(conversation.id),
|
|
246
|
+
onDelete: () => onDelete(conversation.id),
|
|
247
|
+
onRename: onRename
|
|
248
|
+
? (title) => onRename(conversation.id, title)
|
|
249
|
+
: undefined,
|
|
250
|
+
})));
|
|
251
|
+
}
|
|
252
|
+
return React.createElement(ChatSidebarItem, { key: conversation.id, conversation: conversation });
|
|
253
|
+
}))))
|
|
254
|
+
: React.createElement(ChatSidebarEmpty, null));
|
|
255
|
+
return (React.createElement("div", { className: cn("flex-1 overflow-y-auto px-2 pt-2 pb-3 space-y-3", className) }, body));
|
|
256
|
+
}
|
|
257
|
+
ChatSidebarList.displayName = "ChatSidebar.List";
|
|
258
|
+
/** The one-shot preset — composes Root + NewButton + auto List. */
|
|
259
|
+
function ChatSidebarBase(props) {
|
|
260
|
+
// Show the "new" button whenever an action is available (explicit or context).
|
|
261
|
+
const ctx = useConversationsContextOptional();
|
|
262
|
+
const hasNew = props.onNew !== undefined || ctx !== null;
|
|
263
|
+
return (React.createElement(ChatSidebarRoot, { ...props },
|
|
264
|
+
hasNew && React.createElement(ChatSidebarNewButton, null),
|
|
265
|
+
React.createElement(ChatSidebarList, null)));
|
|
93
266
|
}
|
|
267
|
+
ChatSidebarBase.displayName = "ChatSidebar";
|
|
268
|
+
/** Render a chat sidebar — usable as `<ChatSidebar />` or `<ChatSidebar.Root>…`. */
|
|
269
|
+
export const ChatSidebar = Object.assign(ChatSidebarBase, {
|
|
270
|
+
Root: ChatSidebarRoot,
|
|
271
|
+
NewButton: ChatSidebarNewButton,
|
|
272
|
+
List: ChatSidebarList,
|
|
273
|
+
Group: ChatSidebarGroup,
|
|
274
|
+
Item: ChatSidebarItem,
|
|
275
|
+
Empty: ChatSidebarEmpty,
|
|
276
|
+
});
|
|
@@ -8,7 +8,12 @@ import type { ChatDynamicToolPart, ChatToolPart } from "../../../../../agent/rea
|
|
|
8
8
|
export interface SkillBadgeProps {
|
|
9
9
|
tool: ChatToolPart | ChatDynamicToolPart;
|
|
10
10
|
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Override the state icon. When provided, it replaces the built-in
|
|
13
|
+
* loading/complete/error glyphs for all states.
|
|
14
|
+
*/
|
|
15
|
+
icon?: React.ReactNode;
|
|
11
16
|
}
|
|
12
17
|
/** Render skill badge. */
|
|
13
|
-
export declare function SkillBadge({ tool, className }: SkillBadgeProps): React.JSX.Element;
|
|
18
|
+
export declare function SkillBadge({ tool, className, icon }: SkillBadgeProps): React.JSX.Element;
|
|
14
19
|
//# sourceMappingURL=skill-badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-badge.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/skill-badge.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAG1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAE7F,qCAAqC;AACrC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,GAAG,mBAAmB,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"skill-badge.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/skill-badge.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAG1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAE7F,qCAAqC;AACrC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,GAAG,mBAAmB,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,0BAA0B;AAC1B,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA2CxF"}
|
|
@@ -6,7 +6,7 @@ import * as React from "../../../../../../react/react.js";
|
|
|
6
6
|
import { cn } from "../../theme.js";
|
|
7
7
|
import { CheckCircleIcon, SparklesIcon, XCircleIcon } from "../../icons/index.js";
|
|
8
8
|
/** Render skill badge. */
|
|
9
|
-
export function SkillBadge({ tool, className }) {
|
|
9
|
+
export function SkillBadge({ tool, className, icon }) {
|
|
10
10
|
const input = tool.input;
|
|
11
11
|
const skillId = input?.skillId;
|
|
12
12
|
const isComplete = tool.state === "output-available";
|
|
@@ -27,9 +27,10 @@ export function SkillBadge({ tool, className }) {
|
|
|
27
27
|
? `Script: ${script ?? "complete"}`
|
|
28
28
|
: `Running${script ? `: ${script}` : ""}...`;
|
|
29
29
|
}
|
|
30
|
-
return (React.createElement("span", { className: cn("inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium", "
|
|
31
|
-
React.createElement(SparklesIcon, { className: cn("size-3", !isComplete && !isError && "animate-pulse") }),
|
|
30
|
+
return (React.createElement("span", { className: cn("inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium", "border border-[var(--outline-border)] bg-transparent text-[var(--faint)]", className) },
|
|
31
|
+
icon ?? (React.createElement(SparklesIcon, { className: cn("size-3", !isComplete && !isError && "animate-pulse") })),
|
|
32
32
|
React.createElement("span", null, label),
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
icon ? null : (React.createElement(React.Fragment, null,
|
|
34
|
+
isComplete && React.createElement(CheckCircleIcon, { className: "size-3 text-[var(--success)]" }),
|
|
35
|
+
isError && React.createElement(XCircleIcon, { className: "size-3 text-[var(--destructive)]" })))));
|
|
35
36
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SkillTool — tool-call row for the `load_skill` skill tool.
|
|
3
|
+
*
|
|
4
|
+
* Rebuilt from the old `SkillBadge` pill into a tool-call ROW that reads as a
|
|
5
|
+
* sibling of the other tool rows (see `tool-ui.tsx`). Forked dependency-light
|
|
6
|
+
* from Studio's `LoadSkillTool` → `ChatTool` (no radix / cva-from-Studio / `@/`
|
|
7
|
+
* imports, no licensed fonts). Variants are built with our private `ui/cva.ts`.
|
|
8
|
+
*
|
|
9
|
+
* Studio labels (from `toolConfigs` `load_skill`):
|
|
10
|
+
* loading → "Loading skill: X" · loaded → "Loaded skill: X"
|
|
11
|
+
*
|
|
12
|
+
* @module react/components/chat/components/skill-tool
|
|
13
|
+
*/
|
|
14
|
+
import * as React from "../../../../../../react/react.js";
|
|
15
|
+
import type { ChatDynamicToolPart, ChatToolPart } from "../../../../../agent/react/index.js";
|
|
16
|
+
/** Props accepted by {@link SkillTool}. */
|
|
17
|
+
export interface SkillToolProps {
|
|
18
|
+
/** The skill being loaded (id or filename). Renders in the row label. */
|
|
19
|
+
skill: string;
|
|
20
|
+
/**
|
|
21
|
+
* Tool-call state.
|
|
22
|
+
* - `loading` — Sparkles pulses, label shimmers.
|
|
23
|
+
* - `loaded` — Check appears, label is solid.
|
|
24
|
+
* @default "loaded"
|
|
25
|
+
*/
|
|
26
|
+
state?: "loading" | "loaded";
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Render a skill-load tool-call row. */
|
|
30
|
+
export declare function SkillTool({ skill, state, className, }: SkillToolProps): React.JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* Derive `SkillTool` props from a skill tool-call part (`load_skill`,
|
|
33
|
+
* `load_skill_reference`, `execute_skill_script`). Lets the message list route
|
|
34
|
+
* skill parts to the `SkillTool` row rather than the old `SkillBadge` pill.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getSkillToolProps(tool: ChatToolPart | ChatDynamicToolPart): SkillToolProps;
|
|
37
|
+
//# sourceMappingURL=skill-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-tool.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/skill-tool.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAW7F,2CAA2C;AAC3C,MAAM,WAAW,cAAc;IAC7B,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,yCAAyC;AACzC,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAgB,EAChB,SAAS,GACV,EAAE,cAAc,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAkBpC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,YAAY,GAAG,mBAAmB,GACvC,cAAc,CAQhB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SkillTool — tool-call row for the `load_skill` skill tool.
|
|
3
|
+
*
|
|
4
|
+
* Rebuilt from the old `SkillBadge` pill into a tool-call ROW that reads as a
|
|
5
|
+
* sibling of the other tool rows (see `tool-ui.tsx`). Forked dependency-light
|
|
6
|
+
* from Studio's `LoadSkillTool` → `ChatTool` (no radix / cva-from-Studio / `@/`
|
|
7
|
+
* imports, no licensed fonts). Variants are built with our private `ui/cva.ts`.
|
|
8
|
+
*
|
|
9
|
+
* Studio labels (from `toolConfigs` `load_skill`):
|
|
10
|
+
* loading → "Loading skill: X" · loaded → "Loaded skill: X"
|
|
11
|
+
*
|
|
12
|
+
* @module react/components/chat/components/skill-tool
|
|
13
|
+
*/
|
|
14
|
+
import * as React from "../../../../../../react/react.js";
|
|
15
|
+
import { cn } from "../../theme.js";
|
|
16
|
+
import { cva } from "../../ui/cva.js";
|
|
17
|
+
import { Shimmer } from "../../ui/shimmer.js";
|
|
18
|
+
import { CheckIcon, SparklesIcon } from "../../icons/index.js";
|
|
19
|
+
/** Row chrome — mirrors `ChatTool`: 14px text, soft, single-line. */
|
|
20
|
+
const skillToolRow = cva("flex min-w-0 items-center gap-2 truncate text-sm text-[var(--foreground)]");
|
|
21
|
+
/** Render a skill-load tool-call row. */
|
|
22
|
+
export function SkillTool({ skill, state = "loaded", className, }) {
|
|
23
|
+
const isLoading = state === "loading";
|
|
24
|
+
const label = isLoading ? `Loading skill: ${skill}` : `Loaded skill: ${skill}`;
|
|
25
|
+
return (React.createElement("p", { className: cn(skillToolRow(), className) },
|
|
26
|
+
isLoading
|
|
27
|
+
? React.createElement(SparklesIcon, { className: "size-3.5! shrink-0 animate-pulse" })
|
|
28
|
+
: React.createElement(CheckIcon, { className: "size-3.5! shrink-0" }),
|
|
29
|
+
isLoading
|
|
30
|
+
? (React.createElement(Shimmer, { as: "span", duration: 1, className: "min-w-0 truncate" }, label))
|
|
31
|
+
: React.createElement("span", { className: "min-w-0 truncate" }, label)));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Derive `SkillTool` props from a skill tool-call part (`load_skill`,
|
|
35
|
+
* `load_skill_reference`, `execute_skill_script`). Lets the message list route
|
|
36
|
+
* skill parts to the `SkillTool` row rather than the old `SkillBadge` pill.
|
|
37
|
+
*/
|
|
38
|
+
export function getSkillToolProps(tool) {
|
|
39
|
+
const input = tool.input;
|
|
40
|
+
const skill = (input?.skillId ?? input?.reference ?? input?.script ??
|
|
41
|
+
"unknown");
|
|
42
|
+
return {
|
|
43
|
+
skill,
|
|
44
|
+
state: tool.state === "output-available" ? "loaded" : "loading",
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -6,12 +6,64 @@ export interface Source {
|
|
|
6
6
|
score?: number;
|
|
7
7
|
snippet?: string;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
9
|
+
/** Per-list state shared with `Sources.*` sub-parts. */
|
|
10
|
+
export interface SourcesContextValue {
|
|
11
|
+
sources: Source[];
|
|
12
|
+
onSourceClick?: (source: Source, index: number) => void;
|
|
13
|
+
}
|
|
14
|
+
/** Read the enclosing `Sources` state. Throws when used outside a `Sources`. */
|
|
15
|
+
export declare function useSources(): SourcesContextValue;
|
|
16
|
+
/** Props accepted by `Sources` / `Sources.Root`. */
|
|
10
17
|
export interface SourcesProps {
|
|
11
18
|
sources: Source[];
|
|
12
19
|
className?: string;
|
|
13
20
|
onSourceClick?: (source: Source, index: number) => void;
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Compose `Sources.Pill` children instead. Optional render-prop
|
|
23
|
+
* for each source pill; when provided, the default anatomy maps items through
|
|
24
|
+
* it rather than rendering `Sources.Pill` directly.
|
|
25
|
+
*/
|
|
26
|
+
renderPill?: (source: Source, index: number) => React.ReactNode;
|
|
27
|
+
/** Compose your own row; when omitted, the default anatomy is rendered. */
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/** Props for `Sources.List` — the flex-wrap row of pills. */
|
|
31
|
+
export interface SourcesListProps {
|
|
32
|
+
className?: string;
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated Compose `Sources.Pill` children instead. Optional render-prop
|
|
35
|
+
* for each source pill.
|
|
36
|
+
*/
|
|
37
|
+
renderPill?: (source: Source, index: number) => React.ReactNode;
|
|
38
|
+
/** Compose your own pills; when omitted, one `Sources.Pill` per source. */
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
}
|
|
41
|
+
/** The flex-wrap row. Renders one `Sources.Pill` per source by default. */
|
|
42
|
+
declare function SourcesList({ className, renderPill, children }: SourcesListProps): React.JSX.Element;
|
|
43
|
+
declare namespace SourcesList {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
46
|
+
/** Props accepted by an individual source pill. */
|
|
47
|
+
export interface SourcePillProps {
|
|
48
|
+
source: Source;
|
|
49
|
+
index: number;
|
|
50
|
+
onClick?: () => void;
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
53
|
+
/** Render a single source pill with hover preview and score-color behaviour. */
|
|
54
|
+
export declare function SourcePill({ source, index, onClick, className }: SourcePillProps): React.ReactElement;
|
|
55
|
+
export declare namespace SourcePill {
|
|
56
|
+
var displayName: string;
|
|
14
57
|
}
|
|
15
|
-
/**
|
|
16
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Sources — render `<Sources sources={…} />` for the default row, or compose
|
|
60
|
+
* `Sources.Root` + `Sources.List` + `Sources.Pill` for a custom layout.
|
|
61
|
+
* Mirrors the `ToolCall` / `Reasoning` compounds: render it, or compose it.
|
|
62
|
+
*/
|
|
63
|
+
export declare const Sources: React.ForwardRefExoticComponent<SourcesProps & React.RefAttributes<HTMLDivElement>> & {
|
|
64
|
+
Root: React.ForwardRefExoticComponent<SourcesProps & React.RefAttributes<HTMLDivElement>>;
|
|
65
|
+
List: typeof SourcesList;
|
|
66
|
+
Pill: typeof SourcePill;
|
|
67
|
+
};
|
|
68
|
+
export {};
|
|
17
69
|
//# sourceMappingURL=sources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/sources.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/sources.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAI1D,sCAAsC;AACtC,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAWD,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzD;AAID,gFAAgF;AAChF,wBAAgB,UAAU,IAAI,mBAAmB,CAQhD;AAED,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IAChE,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA8BD,6DAA6D;AAC7D,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IAChE,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,2EAA2E;AAC3E,iBAAS,WAAW,CAClB,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,gBAAgB,GACpD,KAAK,CAAC,GAAG,CAAC,OAAO,CAsBnB;kBAxBQ,WAAW;;;AA2BpB,mDAAmD;AACnD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,gFAAgF;AAChF,wBAAgB,UAAU,CACxB,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,eAAe,GACrD,KAAK,CAAC,YAAY,CAkDpB;yBApDe,UAAU;;;AAuD1B;;;;GAIG;AACH,eAAO,MAAM,OAAO;;;;CAIlB,CAAC"}
|
|
@@ -1,29 +1,63 @@
|
|
|
1
1
|
import * as React from "../../../../../../react/react.js";
|
|
2
2
|
import { cn } from "../../theme.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { COMPONENT_ERROR } from "../../../../../errors/error-registry.js";
|
|
4
|
+
const SourcesContext = React.createContext(null);
|
|
5
|
+
/** Read the enclosing `Sources` state. Throws when used outside a `Sources`. */
|
|
6
|
+
export function useSources() {
|
|
7
|
+
const ctx = React.useContext(SourcesContext);
|
|
8
|
+
if (!ctx) {
|
|
9
|
+
throw COMPONENT_ERROR.create({
|
|
10
|
+
detail: "useSources must be used within a Sources",
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return ctx;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `Sources.Root` — context provider + the row wrapper. No children renders the
|
|
17
|
+
* default anatomy (`List` of `Pill`s); pass children to recompose. Renders
|
|
18
|
+
* nothing when the source list is empty.
|
|
19
|
+
*/
|
|
20
|
+
const SourcesRoot = React.forwardRef(function Sources({ sources, className, onSourceClick, renderPill, children }, ref) {
|
|
5
21
|
if (sources.length === 0)
|
|
6
22
|
return null;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
React.createElement("div", { className: "
|
|
23
|
+
const context = { sources, onSourceClick };
|
|
24
|
+
return (React.createElement(SourcesContext.Provider, { value: context },
|
|
25
|
+
React.createElement("div", { ref: ref, className: cn("mt-1", className) }, children ?? React.createElement(SourcesList, { renderPill: renderPill }))));
|
|
10
26
|
});
|
|
11
|
-
|
|
12
|
-
|
|
27
|
+
SourcesRoot.displayName = "Sources.Root";
|
|
28
|
+
/** The flex-wrap row. Renders one `Sources.Pill` per source by default. */
|
|
29
|
+
function SourcesList({ className, renderPill, children }) {
|
|
30
|
+
const { sources, onSourceClick } = useSources();
|
|
31
|
+
return (React.createElement("div", { className: cn("flex flex-wrap gap-2", className) }, children ?? sources.map((source, index) => renderPill
|
|
32
|
+
? (React.createElement(React.Fragment, { key: `${source.title}-${index}` }, renderPill(source, index)))
|
|
33
|
+
: (React.createElement(SourcePill, { key: `${source.title}-${index}`, source: source, index: index, onClick: onSourceClick ? () => onSourceClick(source, index) : undefined })))));
|
|
34
|
+
}
|
|
35
|
+
SourcesList.displayName = "Sources.List";
|
|
36
|
+
/** Render a single source pill with hover preview and score-color behaviour. */
|
|
37
|
+
export function SourcePill({ source, index, onClick, className }) {
|
|
13
38
|
const [showPreview, setShowPreview] = React.useState(false);
|
|
14
39
|
return (React.createElement("span", { className: "relative" },
|
|
15
|
-
React.createElement("button", { type: "button", onClick: onClick, onMouseEnter: () => setShowPreview(true), onMouseLeave: () => setShowPreview(false), className: cn("inline-flex items-center gap-1
|
|
16
|
-
React.createElement("span", { className: "flex items-center justify-center
|
|
17
|
-
React.createElement("span", { className: "
|
|
18
|
-
source.score != null && (React.createElement("span", { className: "flex items-center gap-1
|
|
40
|
+
React.createElement("button", { type: "button", onClick: onClick, onMouseEnter: () => setShowPreview(true), onMouseLeave: () => setShowPreview(false), className: cn("inline-flex max-w-full items-center gap-1 rounded-full border border-[var(--outline-border)] py-1 pl-1 pr-2 text-xs no-underline", "bg-transparent text-[var(--foreground)]", "transition-colors hover:bg-[var(--tertiary)]", onClick ? "cursor-pointer" : "cursor-default", className) },
|
|
41
|
+
React.createElement("span", { className: "flex size-4 shrink-0 items-center justify-center rounded-full border border-[var(--outline-border)] text-xs font-medium" }, index + 1),
|
|
42
|
+
React.createElement("span", { className: "ml-0.5 max-w-[150px] truncate" }, source.title),
|
|
43
|
+
source.score != null && (React.createElement("span", { className: "ml-0.5 flex shrink-0 items-center gap-1" },
|
|
19
44
|
React.createElement("span", { className: cn("size-1.5 rounded-full", source.score >= 0.7
|
|
20
45
|
? "bg-emerald-500"
|
|
21
46
|
: source.score >= 0.4
|
|
22
47
|
? "bg-amber-500"
|
|
23
48
|
: "bg-neutral-400") })))),
|
|
24
|
-
showPreview && source.snippet && (React.createElement("div", { className: "absolute bottom-full left-0 mb-2 z-50 w-
|
|
25
|
-
React.createElement("div", { className: "
|
|
26
|
-
React.createElement("p", { className: "text-xs text-[var(--
|
|
27
|
-
source.snippet.slice(0, 150),
|
|
28
|
-
source.snippet.length > 150 ? "..." : ""))))));
|
|
49
|
+
showPreview && source.snippet && (React.createElement("div", { className: "absolute bottom-full left-0 mb-2 z-50 w-64 pointer-events-none animate-in fade-in duration-150" },
|
|
50
|
+
React.createElement("div", { className: "rounded-lg border border-[var(--outline-border)] bg-[var(--popover)] px-3 py-2 text-left shadow-md" },
|
|
51
|
+
React.createElement("p", { className: "text-xs text-[var(--foreground)] line-clamp-3 leading-relaxed" }, source.snippet))))));
|
|
29
52
|
}
|
|
53
|
+
SourcePill.displayName = "Sources.Pill";
|
|
54
|
+
/**
|
|
55
|
+
* Sources — render `<Sources sources={…} />` for the default row, or compose
|
|
56
|
+
* `Sources.Root` + `Sources.List` + `Sources.Pill` for a custom layout.
|
|
57
|
+
* Mirrors the `ToolCall` / `Reasoning` compounds: render it, or compose it.
|
|
58
|
+
*/
|
|
59
|
+
export const Sources = Object.assign(SourcesRoot, {
|
|
60
|
+
Root: SourcesRoot,
|
|
61
|
+
List: SourcesList,
|
|
62
|
+
Pill: SourcePill,
|
|
63
|
+
});
|