veryfront 0.1.997 → 0.1.999
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.d.ts +1 -1
- package/esm/cli/templates/manifest.js +15 -15
- package/esm/deno.d.ts +7 -0
- package/esm/deno.js +11 -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/embedding/index.d.ts +0 -2
- package/esm/src/embedding/index.d.ts.map +1 -1
- package/esm/src/embedding/index.js +0 -1
- package/esm/src/embedding/upload-handler.d.ts +2 -13
- package/esm/src/embedding/upload-handler.d.ts.map +1 -1
- package/esm/src/embedding/upload-handler.js +24 -17
- package/esm/src/modules/import-map/default-import-map.d.ts.map +1 -1
- package/esm/src/modules/import-map/default-import-map.js +0 -5
- 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/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 +5 -1
- package/esm/src/embedding/react/use-uploads.d.ts +0 -33
- package/esm/src/embedding/react/use-uploads.d.ts.map +0 -1
- package/esm/src/embedding/react/use-uploads.js +0 -76
- 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,67 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentCard — a running agent rendered as a `Card` wrapping the `Message`
|
|
3
|
+
* anatomy: a header row (agent Avatar + name on the left, `<Status>` on the
|
|
4
|
+
* right) over the agent's reasoning, tool calls, and message text. Composed
|
|
5
|
+
* entirely from the shared primitives — `Card`, `Avatar`, `Status`,
|
|
6
|
+
* `Reasoning`, `ToolCall`, `Markdown` — so it reads like a `Message` inside a
|
|
7
|
+
* card (mirrors Studio's agent/message anatomy).
|
|
8
|
+
*
|
|
9
|
+
* @module react/components/chat/agent-card
|
|
10
|
+
*/
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// AgentCard — compound, render-or-compose (mirrors `ToolCall` / `Message`).
|
|
13
|
+
//
|
|
14
|
+
// `<AgentCard {...props} />` renders the default anatomy: `Header` (avatar +
|
|
15
|
+
// name + status) over `Reasoning`, `Tools`, and `Body` (the message text).
|
|
16
|
+
// Pass children to recompose from `AgentCard.Header`, `AgentCard.Reasoning`,
|
|
17
|
+
// `AgentCard.Tools`, `AgentCard.Body` — each reads `useAgentCard()`. Every
|
|
18
|
+
// sub-part takes `className`, merged LAST via `cn`. The preset `<AgentCard>`
|
|
19
|
+
// stays fully back-compatible.
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
1
21
|
import * as React from "../../../../react/react.js";
|
|
2
|
-
import {
|
|
3
|
-
import { cn
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
tool.error
|
|
13
|
-
? (React.createElement("div", { className: "mt-2 p-3 bg-red-50 text-red-900 rounded-xl text-sm border border-red-200" },
|
|
14
|
-
"Error: ",
|
|
15
|
-
tool.error))
|
|
16
|
-
: null)));
|
|
17
|
-
const hasToolCalls = toolCalls.length > 0;
|
|
18
|
-
const hasMessages = (messages?.length ?? 0) > 0;
|
|
19
|
-
return (React.createElement(AgentContainer, { ref: ref, className: cn(theme.container, className) },
|
|
20
|
-
React.createElement(AgentStatusPrimitive, { status: status, className: cn(theme.status, getStatusColor(status)) }),
|
|
21
|
-
thinking
|
|
22
|
-
? (React.createElement(ThinkingIndicator, { className: theme.thinking },
|
|
23
|
-
React.createElement("span", { className: "font-semibold" }, "Thinking:"),
|
|
24
|
-
thinking))
|
|
25
|
-
: null,
|
|
26
|
-
hasToolCalls
|
|
27
|
-
? (React.createElement("div", { className: "space-y-3" },
|
|
28
|
-
React.createElement("h3", { className: "text-sm font-semibold text-[var(--card-foreground)]" }, "Tool Calls"),
|
|
29
|
-
React.createElement("div", { className: "space-y-3" }, toolCalls.map((tool) => (React.createElement(React.Fragment, { key: tool.id }, toolRenderer(tool)))))))
|
|
30
|
-
: null,
|
|
31
|
-
hasMessages
|
|
32
|
-
? (React.createElement("div", { className: "space-y-3" },
|
|
33
|
-
React.createElement("h3", { className: "text-sm font-semibold text-[var(--card-foreground)]" }, "Messages"),
|
|
34
|
-
React.createElement("div", { className: "space-y-2 max-h-96 overflow-y-auto" }, messages?.map((msg) => {
|
|
35
|
-
const text = msg.parts
|
|
36
|
-
?.filter((p) => p.type === "text")
|
|
37
|
-
.map((p) => p.text)
|
|
38
|
-
.join("") ?? "";
|
|
39
|
-
return (React.createElement("div", { key: msg.id, className: "text-sm p-3 rounded-xl bg-[var(--accent)]" },
|
|
40
|
-
React.createElement("span", { className: "font-semibold capitalize text-[var(--foreground)]" },
|
|
41
|
-
msg.role,
|
|
42
|
-
":"),
|
|
43
|
-
React.createElement("span", { className: "text-[var(--card-foreground)] ml-1" },
|
|
44
|
-
text.substring(0, 200),
|
|
45
|
-
text.length > 200 ? "..." : "")));
|
|
46
|
-
}))))
|
|
47
|
-
: null));
|
|
48
|
-
});
|
|
49
|
-
AgentCard.displayName = "AgentCard";
|
|
50
|
-
function getStatusColor(status) {
|
|
22
|
+
import { COMPONENT_ERROR } from "../../../errors/error-registry.js";
|
|
23
|
+
import { cn } from "./theme.js";
|
|
24
|
+
import { Avatar } from "./ui/avatar.js";
|
|
25
|
+
import { Card } from "./ui/card.js";
|
|
26
|
+
import { Status } from "./ui/status.js";
|
|
27
|
+
import { Markdown } from "./markdown.js";
|
|
28
|
+
import { ReasoningCard } from "./chat/components/reasoning.js";
|
|
29
|
+
import { ToolCallCard } from "./chat/components/tool-ui.js";
|
|
30
|
+
/** Map the agent status to a `Status` dot colour, label, and pulse. */
|
|
31
|
+
function statusPresentation(status) {
|
|
51
32
|
switch (status) {
|
|
52
|
-
case "idle":
|
|
53
|
-
return "bg-[var(--accent)] text-[var(--card-foreground)]";
|
|
54
33
|
case "thinking":
|
|
55
|
-
return "
|
|
34
|
+
return { color: "blue", label: "Thinking", pulse: true };
|
|
56
35
|
case "tool_execution":
|
|
57
|
-
return "
|
|
36
|
+
return { color: "yellow", label: "Running tools", pulse: true };
|
|
58
37
|
case "streaming":
|
|
59
|
-
return "
|
|
38
|
+
return { color: "green", label: "Responding", pulse: true };
|
|
60
39
|
case "completed":
|
|
61
|
-
return "
|
|
40
|
+
return { color: "green", label: "Completed", pulse: false };
|
|
62
41
|
case "error":
|
|
63
|
-
return "
|
|
42
|
+
return { color: "red", label: "Error", pulse: false };
|
|
43
|
+
case "idle":
|
|
64
44
|
default:
|
|
65
|
-
return "
|
|
45
|
+
return { color: "gray", label: "Idle", pulse: false };
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const TOOL_STATE = {
|
|
49
|
+
pending: "input-available",
|
|
50
|
+
executing: "input-streaming",
|
|
51
|
+
completed: "output-available",
|
|
52
|
+
error: "output-error",
|
|
53
|
+
};
|
|
54
|
+
/** Adapt an agent `ToolCall` to the `ToolCall` card's `ChatToolPart` shape. */
|
|
55
|
+
function toToolPart(tool) {
|
|
56
|
+
return {
|
|
57
|
+
type: `tool-${tool.name}`,
|
|
58
|
+
toolCallId: tool.id,
|
|
59
|
+
toolName: tool.name,
|
|
60
|
+
state: TOOL_STATE[tool.status],
|
|
61
|
+
input: tool.args,
|
|
62
|
+
output: tool.result,
|
|
63
|
+
errorText: tool.error,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** Extract plain text from an agent message's parts. */
|
|
67
|
+
function messageText(message) {
|
|
68
|
+
return message.parts
|
|
69
|
+
?.filter((p) => p.type === "text")
|
|
70
|
+
.map((p) => p.text)
|
|
71
|
+
.join("") ?? "";
|
|
72
|
+
}
|
|
73
|
+
const AgentCardContext = React.createContext(null);
|
|
74
|
+
/** Read the enclosing `AgentCard` state. Throws when used outside an `AgentCard`. */
|
|
75
|
+
export function useAgentCard() {
|
|
76
|
+
const ctx = React.useContext(AgentCardContext);
|
|
77
|
+
if (!ctx) {
|
|
78
|
+
throw COMPONENT_ERROR.create({
|
|
79
|
+
detail: "useAgentCard must be used within an AgentCard",
|
|
80
|
+
});
|
|
66
81
|
}
|
|
82
|
+
return ctx;
|
|
67
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* `AgentCard.Root` — context provider + the `Card` wrapper. No children renders
|
|
86
|
+
* the default anatomy (`Header` + `Reasoning` + `Tools` + `Body`); pass children
|
|
87
|
+
* to recompose.
|
|
88
|
+
*/
|
|
89
|
+
const AgentCardRoot = React.forwardRef(function AgentCard({ name = "Agent", avatarUrl, messages, toolCalls = [], status, thinking, className, renderTool, children, }, ref) {
|
|
90
|
+
const presentation = statusPresentation(status);
|
|
91
|
+
const context = {
|
|
92
|
+
name,
|
|
93
|
+
avatarUrl,
|
|
94
|
+
messages,
|
|
95
|
+
toolCalls,
|
|
96
|
+
status,
|
|
97
|
+
thinking,
|
|
98
|
+
renderTool,
|
|
99
|
+
presentation,
|
|
100
|
+
};
|
|
101
|
+
return (React.createElement(AgentCardContext.Provider, { value: context },
|
|
102
|
+
React.createElement(Card, { ref: ref, surface: "outline", padding: "md", className: cn("flex flex-col gap-3", className) }, children ?? (React.createElement(React.Fragment, null,
|
|
103
|
+
React.createElement(AgentCardHeader, null),
|
|
104
|
+
React.createElement(AgentCardReasoning, null),
|
|
105
|
+
React.createElement(AgentCardTools, null),
|
|
106
|
+
React.createElement(AgentCardBody, null))))));
|
|
107
|
+
});
|
|
108
|
+
AgentCardRoot.displayName = "AgentCard.Root";
|
|
109
|
+
/**
|
|
110
|
+
* The header row: Avatar + name (left), Status (right). Mirrors
|
|
111
|
+
* `ChatMessageHeader` / `Message.Header`.
|
|
112
|
+
*/
|
|
113
|
+
function AgentCardHeader({ className }) {
|
|
114
|
+
const { name, avatarUrl, presentation } = useAgentCard();
|
|
115
|
+
return (React.createElement("div", { className: cn("flex items-center gap-2", className) },
|
|
116
|
+
React.createElement(Avatar, { name: name, avatarSrc: avatarUrl, className: "size-8" }),
|
|
117
|
+
React.createElement("span", { className: "min-w-0 truncate font-medium text-[var(--foreground)]" }, name),
|
|
118
|
+
React.createElement(Status, { className: "ml-auto", color: presentation.color, label: presentation.label, pulse: presentation.pulse })));
|
|
119
|
+
}
|
|
120
|
+
AgentCardHeader.displayName = "AgentCard.Header";
|
|
121
|
+
/** The reasoning block. Renders only when `thinking` text is present. */
|
|
122
|
+
function AgentCardReasoning({ className }) {
|
|
123
|
+
const { thinking } = useAgentCard();
|
|
124
|
+
if (!thinking)
|
|
125
|
+
return null;
|
|
126
|
+
return React.createElement(ReasoningCard, { text: thinking, className: className });
|
|
127
|
+
}
|
|
128
|
+
AgentCardReasoning.displayName = "AgentCard.Reasoning";
|
|
129
|
+
/** The tool-call list. Renders one `ToolCall` card per entry, or `renderTool`. */
|
|
130
|
+
function AgentCardTools({ className }) {
|
|
131
|
+
const { toolCalls, renderTool } = useAgentCard();
|
|
132
|
+
if (toolCalls.length === 0)
|
|
133
|
+
return null;
|
|
134
|
+
return (React.createElement("div", { className: cn("flex flex-col gap-2", className) }, toolCalls.map((tool) => (React.createElement(React.Fragment, { key: tool.id }, renderTool ? renderTool(tool) : React.createElement(ToolCallCard, { tool: toToolPart(tool) }))))));
|
|
135
|
+
}
|
|
136
|
+
AgentCardTools.displayName = "AgentCard.Tools";
|
|
137
|
+
/** The message body — each message's text rendered as `Markdown`. */
|
|
138
|
+
function AgentCardBody({ className }) {
|
|
139
|
+
const { messages } = useAgentCard();
|
|
140
|
+
if (!messages || messages.length === 0)
|
|
141
|
+
return null;
|
|
142
|
+
return (React.createElement("div", { className: cn("flex flex-col gap-2", className) }, messages.map((message) => {
|
|
143
|
+
const text = messageText(message);
|
|
144
|
+
if (!text)
|
|
145
|
+
return null;
|
|
146
|
+
return (React.createElement(Markdown, { key: message.id, className: "text-[15px] leading-7" }, text));
|
|
147
|
+
})));
|
|
148
|
+
}
|
|
149
|
+
AgentCardBody.displayName = "AgentCard.Body";
|
|
150
|
+
/**
|
|
151
|
+
* AgentCard — render `<AgentCard {...props} />` for the default card, or compose
|
|
152
|
+
* `AgentCard.Header` / `Reasoning` / `Tools` / `Body` for a custom layout.
|
|
153
|
+
* Mirrors the `ToolCall` compound: render it, or compose it.
|
|
154
|
+
*/
|
|
155
|
+
export const AgentCard = Object.assign(AgentCardRoot, {
|
|
156
|
+
Root: AgentCardRoot,
|
|
157
|
+
Header: AgentCardHeader,
|
|
158
|
+
Reasoning: AgentCardReasoning,
|
|
159
|
+
Tools: AgentCardTools,
|
|
160
|
+
Body: AgentCardBody,
|
|
161
|
+
});
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentPicker — Popover + Command combobox for switching the active agent.
|
|
3
|
+
* Forked dependency-light 1:1 from Veryfront Studio's `AgentPicker`: a Pill (or
|
|
4
|
+
* input-style) trigger opens a searchable list of agent rows (Avatar + name),
|
|
5
|
+
* a Check marks the selection, and optional "Create Agent" / "Manage Agents"
|
|
6
|
+
* affordances sit at the bottom. Studio's mobile `Drawer`/`ResponsiveSwitch`
|
|
7
|
+
* branch is dropped (Studio-only deps) — the overlay always portals via our
|
|
8
|
+
* `Floating` (through `PopoverContent`) so it never clips in the iframe.
|
|
9
|
+
*
|
|
10
|
+
* Semantic Studio classes remapped to veryfront's `[var(--token)]` vocabulary;
|
|
11
|
+
* icons inherit the Command row's sizing. Composes the private chat/ui
|
|
12
|
+
* primitives (Popover, Command, Avatar) — no radix / cva / `@/` imports.
|
|
13
|
+
*
|
|
14
|
+
* @module react/components/chat/agent-picker
|
|
15
|
+
*/
|
|
16
|
+
import * as React from "../../../../react/react.js";
|
|
17
|
+
/** A selectable agent entry. */
|
|
18
|
+
export interface AgentOption {
|
|
19
|
+
/** Stable identifier — used as the selection value. */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Display name (also the search keyword). */
|
|
22
|
+
name: string;
|
|
23
|
+
/** Avatar image URL; initials are shown when absent. */
|
|
24
|
+
avatarSrc?: string;
|
|
25
|
+
/** Dims the row and blocks selection. */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** A labelled group of agents (e.g. "Connected Agents"). */
|
|
29
|
+
export interface AgentPickerSection {
|
|
30
|
+
/** Omit to render an unlabelled group. */
|
|
31
|
+
label?: string;
|
|
32
|
+
agents: AgentOption[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Icon overrides for {@link AgentPicker}. Each defaults to the built-in glyph.
|
|
36
|
+
*/
|
|
37
|
+
export interface AgentPickerIcons {
|
|
38
|
+
check?: React.ReactNode;
|
|
39
|
+
chevron?: React.ReactNode;
|
|
40
|
+
create?: React.ReactNode;
|
|
41
|
+
more?: React.ReactNode;
|
|
42
|
+
}
|
|
43
|
+
/** Props accepted by `<AgentPicker>`. */
|
|
44
|
+
export interface AgentPickerProps {
|
|
45
|
+
/** Agents shown in the default (top) group. */
|
|
46
|
+
agents: AgentOption[];
|
|
47
|
+
/** Selected agent id. */
|
|
48
|
+
value?: string;
|
|
49
|
+
/** Called with the chosen agent id. */
|
|
50
|
+
onValueChange?: (id: string) => void;
|
|
51
|
+
/** Extra labelled groups rendered below the default group. */
|
|
52
|
+
sections?: AgentPickerSection[];
|
|
53
|
+
/** Shows a "Manage Agents" row at the bottom when provided. */
|
|
54
|
+
onManage?: () => void;
|
|
55
|
+
/** Shows a "Create Agent" row at the bottom when provided. */
|
|
56
|
+
onCreate?: () => void;
|
|
57
|
+
/** Notified whenever the popover opens or closes. */
|
|
58
|
+
onOpenChange?: (open: boolean) => void;
|
|
59
|
+
/** Render the trigger as an input-style field instead of a pill. */
|
|
60
|
+
inputStyle?: boolean;
|
|
61
|
+
/** Mark the input-style trigger invalid. */
|
|
62
|
+
invalid?: boolean;
|
|
63
|
+
/** Show skeleton rows while agents are being fetched. */
|
|
64
|
+
isLoading?: boolean;
|
|
65
|
+
/** Additional class names for the trigger. */
|
|
66
|
+
className?: string;
|
|
67
|
+
/** Override any of the picker icons. */
|
|
68
|
+
icons?: AgentPickerIcons;
|
|
69
|
+
/**
|
|
70
|
+
* Compose your own menu from `AgentPicker.Trigger` / `Content` / `List` /
|
|
71
|
+
* `Item`. When omitted, the default data-driven preset is rendered.
|
|
72
|
+
*/
|
|
73
|
+
children?: React.ReactNode;
|
|
74
|
+
}
|
|
75
|
+
/** Shared selection + open state exposed to `AgentPicker.*` sub-parts. */
|
|
76
|
+
export interface AgentPickerContextValue {
|
|
77
|
+
/** Selected agent id. */
|
|
78
|
+
value?: string;
|
|
79
|
+
/** Select an agent by id (also closes the menu). */
|
|
80
|
+
onSelect: (id: string) => void;
|
|
81
|
+
/** Popover open state. */
|
|
82
|
+
open: boolean;
|
|
83
|
+
/** Set the popover open state (notifies `onOpenChange`). */
|
|
84
|
+
setOpen: (open: boolean) => void;
|
|
85
|
+
/** Icon overrides passed to the picker. */
|
|
86
|
+
icons?: AgentPickerIcons;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Read the enclosing `AgentPicker` selection + open state. Throws when used
|
|
90
|
+
* outside an `<AgentPicker>`.
|
|
91
|
+
*/
|
|
92
|
+
export declare function useAgentPicker(): AgentPickerContextValue;
|
|
93
|
+
/** Props for `AgentPicker.Trigger` — the pill/input combobox button. */
|
|
94
|
+
export interface AgentPickerTriggerProps {
|
|
95
|
+
/** Render as an input-style field instead of a pill. */
|
|
96
|
+
inputStyle?: boolean;
|
|
97
|
+
/** Mark the input-style trigger invalid. */
|
|
98
|
+
invalid?: boolean;
|
|
99
|
+
/** Override the trigger contents; defaults to the selected agent's row. */
|
|
100
|
+
children?: React.ReactNode;
|
|
101
|
+
className?: string;
|
|
102
|
+
}
|
|
103
|
+
/** The pill (or input-style) combobox trigger. Toggles the popover. */
|
|
104
|
+
declare function AgentPickerTrigger({ inputStyle, invalid, children, className }: AgentPickerTriggerProps): React.ReactElement;
|
|
105
|
+
declare namespace AgentPickerTrigger {
|
|
106
|
+
var displayName: string;
|
|
107
|
+
}
|
|
108
|
+
/** Props for `AgentPicker.Content` — the popover surface + `Command` shell. */
|
|
109
|
+
export interface AgentPickerContentProps {
|
|
110
|
+
/** Show the search input above the list. */
|
|
111
|
+
showSearch?: boolean;
|
|
112
|
+
/** Search input placeholder. */
|
|
113
|
+
searchPlaceholder?: string;
|
|
114
|
+
children?: React.ReactNode;
|
|
115
|
+
className?: string;
|
|
116
|
+
}
|
|
117
|
+
/** The popover surface wrapping a `Command` (search + list region). */
|
|
118
|
+
declare function AgentPickerContent({ showSearch, searchPlaceholder, children, className, }: AgentPickerContentProps): React.ReactElement;
|
|
119
|
+
declare namespace AgentPickerContent {
|
|
120
|
+
var displayName: string;
|
|
121
|
+
}
|
|
122
|
+
/** The scrollable `Command` list region. */
|
|
123
|
+
declare function AgentPickerList({ children, className }: {
|
|
124
|
+
children?: React.ReactNode;
|
|
125
|
+
className?: string;
|
|
126
|
+
}): React.ReactElement;
|
|
127
|
+
declare namespace AgentPickerList {
|
|
128
|
+
var displayName: string;
|
|
129
|
+
}
|
|
130
|
+
/** Props for `AgentPicker.Item` — a single selectable agent row. */
|
|
131
|
+
export interface AgentPickerItemProps {
|
|
132
|
+
/** The agent this row represents. Its `id` is the selection value. */
|
|
133
|
+
agent: AgentOption;
|
|
134
|
+
/** Force selected styling; defaults to matching the context `value`. */
|
|
135
|
+
selected?: boolean;
|
|
136
|
+
className?: string;
|
|
137
|
+
}
|
|
138
|
+
/** A single agent row (Avatar + name + selection check). */
|
|
139
|
+
declare function AgentPickerItem({ agent, selected, className }: AgentPickerItemProps): React.ReactElement;
|
|
140
|
+
declare namespace AgentPickerItem {
|
|
141
|
+
var displayName: string;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* `AgentPicker.Root` — context provider + the popover shell. No children
|
|
145
|
+
* renders the default data-driven preset; pass children to recompose from
|
|
146
|
+
* `AgentPicker.Trigger` / `Content` / `List` / `Item`.
|
|
147
|
+
*/
|
|
148
|
+
declare function AgentPickerRoot({ agents, value, onValueChange, sections, onManage, onCreate, onOpenChange, inputStyle, invalid, isLoading, className, icons, children, }: AgentPickerProps): React.ReactElement;
|
|
149
|
+
declare namespace AgentPickerRoot {
|
|
150
|
+
var displayName: string;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* AgentPicker — render `<AgentPicker agents={...} .../>` for the default
|
|
154
|
+
* data-driven combobox, or compose `AgentPicker.Trigger` / `Content` / `List` /
|
|
155
|
+
* `Item` for a custom menu. Mirrors the `ToolCall` compound: render it, or
|
|
156
|
+
* compose it.
|
|
157
|
+
*/
|
|
158
|
+
export declare const AgentPicker: typeof AgentPickerRoot & {
|
|
159
|
+
Root: typeof AgentPickerRoot;
|
|
160
|
+
Trigger: typeof AgentPickerTrigger;
|
|
161
|
+
Content: typeof AgentPickerContent;
|
|
162
|
+
List: typeof AgentPickerList;
|
|
163
|
+
Item: typeof AgentPickerItem;
|
|
164
|
+
};
|
|
165
|
+
export {};
|
|
166
|
+
//# sourceMappingURL=agent-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-picker.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/agent-picker.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentPicker — Popover + Command combobox for switching the active agent.
|
|
3
|
+
* Forked dependency-light 1:1 from Veryfront Studio's `AgentPicker`: a Pill (or
|
|
4
|
+
* input-style) trigger opens a searchable list of agent rows (Avatar + name),
|
|
5
|
+
* a Check marks the selection, and optional "Create Agent" / "Manage Agents"
|
|
6
|
+
* affordances sit at the bottom. Studio's mobile `Drawer`/`ResponsiveSwitch`
|
|
7
|
+
* branch is dropped (Studio-only deps) — the overlay always portals via our
|
|
8
|
+
* `Floating` (through `PopoverContent`) so it never clips in the iframe.
|
|
9
|
+
*
|
|
10
|
+
* Semantic Studio classes remapped to veryfront's `[var(--token)]` vocabulary;
|
|
11
|
+
* icons inherit the Command row's sizing. Composes the private chat/ui
|
|
12
|
+
* primitives (Popover, Command, Avatar) — no radix / cva / `@/` imports.
|
|
13
|
+
*
|
|
14
|
+
* @module react/components/chat/agent-picker
|
|
15
|
+
*/
|
|
16
|
+
import * as React from "../../../../react/react.js";
|
|
17
|
+
import { cn } from "./theme.js";
|
|
18
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from "./ui/command.js";
|
|
19
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover.js";
|
|
20
|
+
import { Pill } from "./ui/pill.js";
|
|
21
|
+
import { Avatar } from "./ui/avatar.js";
|
|
22
|
+
import { CheckIcon, ChevronDownIcon, PlusIcon, SparklesIcon } from "./icons/index.js";
|
|
23
|
+
import { COMPONENT_ERROR } from "../../../errors/error-registry.js";
|
|
24
|
+
/** Search box appears once the combined agent count crosses this. */
|
|
25
|
+
const SEARCH_THRESHOLD = 5;
|
|
26
|
+
const LOADING_ROW_WIDTHS = ["w-3/5", "w-3/4", "w-2/3"];
|
|
27
|
+
function totalAgentCount(agents, sections) {
|
|
28
|
+
return agents.length +
|
|
29
|
+
sections.reduce((acc, section) => acc + section.agents.length, 0);
|
|
30
|
+
}
|
|
31
|
+
function findAgent(id, agents, sections) {
|
|
32
|
+
if (id === undefined)
|
|
33
|
+
return undefined;
|
|
34
|
+
const top = agents.find((agent) => agent.id === id);
|
|
35
|
+
if (top)
|
|
36
|
+
return top;
|
|
37
|
+
for (const section of sections) {
|
|
38
|
+
const hit = section.agents.find((agent) => agent.id === id);
|
|
39
|
+
if (hit)
|
|
40
|
+
return hit;
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
function AgentPickerLoadingRows() {
|
|
45
|
+
return (React.createElement("output", { "aria-label": "Loading agents", className: "block px-1 py-1" },
|
|
46
|
+
React.createElement("span", { className: "sr-only" }, "Loading agents"),
|
|
47
|
+
LOADING_ROW_WIDTHS.map((widthClass, index) => (React.createElement("div", { key: `${index}-${widthClass}`, "aria-hidden": "true", className: "flex items-center gap-3 px-3 py-2" },
|
|
48
|
+
React.createElement("div", { className: "size-5 shrink-0 rounded-full bg-[var(--accent)] animate-pulse" }),
|
|
49
|
+
React.createElement("div", { className: cn("h-3 rounded-md bg-[var(--accent)] animate-pulse", widthClass) }))))));
|
|
50
|
+
}
|
|
51
|
+
const AgentPickerContext = React.createContext(null);
|
|
52
|
+
/**
|
|
53
|
+
* Read the enclosing `AgentPicker` selection + open state. Throws when used
|
|
54
|
+
* outside an `<AgentPicker>`.
|
|
55
|
+
*/
|
|
56
|
+
export function useAgentPicker() {
|
|
57
|
+
const ctx = React.useContext(AgentPickerContext);
|
|
58
|
+
if (!ctx) {
|
|
59
|
+
throw COMPONENT_ERROR.create({
|
|
60
|
+
detail: "useAgentPicker must be used within a AgentPicker",
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return ctx;
|
|
64
|
+
}
|
|
65
|
+
/** The pill (or input-style) combobox trigger. Toggles the popover. */
|
|
66
|
+
function AgentPickerTrigger({ inputStyle = false, invalid = false, children, className }) {
|
|
67
|
+
const { value, icons } = useAgentPicker();
|
|
68
|
+
const sections = React.useContext(AgentDataContext);
|
|
69
|
+
const selected = sections ? findAgent(value, sections.agents, sections.sections) : undefined;
|
|
70
|
+
const triggerLabel = selected?.name ?? "Select agent";
|
|
71
|
+
const content = children ?? (React.createElement(React.Fragment, null,
|
|
72
|
+
selected && (React.createElement(Avatar, { name: selected.name, avatarSrc: selected.avatarSrc, tone: "muted", "aria-hidden": "true", className: "size-5! bg-[var(--background)]" })),
|
|
73
|
+
React.createElement("span", { className: "min-w-0 truncate" }, triggerLabel),
|
|
74
|
+
inputStyle
|
|
75
|
+
? (icons?.chevron ??
|
|
76
|
+
React.createElement(ChevronDownIcon, { className: "ml-auto size-3.5 opacity-50" }))
|
|
77
|
+
: (icons?.chevron ?? React.createElement(ChevronDownIcon, { className: "ml-auto" }))));
|
|
78
|
+
const trigger = inputStyle
|
|
79
|
+
? (React.createElement("button", { type: "button", "data-invalid": invalid || undefined, className: cn("flex w-full items-center gap-2.5 rounded-md border border-[var(--input-border)] bg-[var(--input-bg)] h-[50px] px-3 text-base text-[var(--foreground)]", "data-[invalid=true]:border-[var(--status-error)]", className) }, content))
|
|
80
|
+
: (React.createElement(Pill, { className: cn("min-w-0 max-w-full", className) }, content));
|
|
81
|
+
return React.createElement(PopoverTrigger, { asChild: true }, trigger);
|
|
82
|
+
}
|
|
83
|
+
AgentPickerTrigger.displayName = "AgentPicker.Trigger";
|
|
84
|
+
/** The popover surface wrapping a `Command` (search + list region). */
|
|
85
|
+
function AgentPickerContent({ showSearch = false, searchPlaceholder = "Search agents...", children, className, }) {
|
|
86
|
+
return (React.createElement(PopoverContent, { align: "start", className: cn("min-w-[280px] p-0! rounded-lg", className) },
|
|
87
|
+
React.createElement(Command, { className: "bg-transparent" },
|
|
88
|
+
showSearch && React.createElement(CommandInput, { placeholder: searchPlaceholder }),
|
|
89
|
+
children)));
|
|
90
|
+
}
|
|
91
|
+
AgentPickerContent.displayName = "AgentPicker.Content";
|
|
92
|
+
/** The scrollable `Command` list region. */
|
|
93
|
+
function AgentPickerList({ children, className }) {
|
|
94
|
+
return (React.createElement(CommandList, { className: cn("max-h-[320px]", className) }, children));
|
|
95
|
+
}
|
|
96
|
+
AgentPickerList.displayName = "AgentPicker.List";
|
|
97
|
+
/** A single agent row (Avatar + name + selection check). */
|
|
98
|
+
function AgentPickerItem({ agent, selected, className }) {
|
|
99
|
+
const { value, onSelect, icons } = useAgentPicker();
|
|
100
|
+
const isSelected = selected ?? agent.id === value;
|
|
101
|
+
return (React.createElement(CommandItem, { value: agent.name, disabled: agent.disabled, onSelect: () => onSelect(agent.id), className: className },
|
|
102
|
+
React.createElement(Avatar, { name: agent.name, avatarSrc: agent.avatarSrc, tone: "muted", "aria-hidden": "true", className: "size-5! bg-[var(--background)]" }),
|
|
103
|
+
React.createElement("span", { className: "min-w-0 flex-1 truncate" }, agent.name),
|
|
104
|
+
isSelected &&
|
|
105
|
+
(icons?.check ?? React.createElement(CheckIcon, { className: "ml-auto opacity-70" }))));
|
|
106
|
+
}
|
|
107
|
+
AgentPickerItem.displayName = "AgentPicker.Item";
|
|
108
|
+
/**
|
|
109
|
+
* Data passed down so the default `Trigger` can resolve the selected label from
|
|
110
|
+
* the preset `agents` / `sections`. Only populated on the preset (childless)
|
|
111
|
+
* path; a fully-composed tree supplies its own trigger contents.
|
|
112
|
+
*/
|
|
113
|
+
const AgentDataContext = React.createContext(null);
|
|
114
|
+
/** The default preset body — the data-driven groups + action rows. */
|
|
115
|
+
function AgentPickerPresetBody({ agents, value, sections, onManage, onCreate, isLoading, icons, }) {
|
|
116
|
+
const hasSectionAgents = sections.some((section) => section.agents.length > 0);
|
|
117
|
+
const showLoading = isLoading && !hasSectionAgents;
|
|
118
|
+
return (React.createElement(React.Fragment, null,
|
|
119
|
+
!showLoading && React.createElement(CommandEmpty, null, "No agents found."),
|
|
120
|
+
agents.length > 0 && (React.createElement(CommandGroup, null, agents.map((agent) => (React.createElement(AgentPickerItem, { key: agent.id, agent: agent, selected: agent.id === value }))))),
|
|
121
|
+
showLoading && React.createElement(AgentPickerLoadingRows, null),
|
|
122
|
+
sections.map((section, index) => (React.createElement(CommandGroup, { key: section.label ?? `section-${index}`, heading: section.label }, section.agents.map((agent) => (React.createElement(AgentPickerItem, { key: agent.id, agent: agent, selected: agent.id === value })))))),
|
|
123
|
+
(onCreate || onManage) && (React.createElement(CommandGroup, null,
|
|
124
|
+
onCreate && (React.createElement(CommandItem, { value: "Create Agent", onSelect: onCreate },
|
|
125
|
+
icons?.create ?? React.createElement(PlusIcon, null),
|
|
126
|
+
"Create Agent")),
|
|
127
|
+
onManage && (React.createElement(CommandItem, { value: "Manage Agents", onSelect: onManage },
|
|
128
|
+
icons?.more ?? React.createElement(SparklesIcon, null),
|
|
129
|
+
"Manage Agents"))))));
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* `AgentPicker.Root` — context provider + the popover shell. No children
|
|
133
|
+
* renders the default data-driven preset; pass children to recompose from
|
|
134
|
+
* `AgentPicker.Trigger` / `Content` / `List` / `Item`.
|
|
135
|
+
*/
|
|
136
|
+
function AgentPickerRoot({ agents, value, onValueChange, sections = [], onManage, onCreate, onOpenChange, inputStyle = false, invalid = false, isLoading = false, className, icons, children, }) {
|
|
137
|
+
const [open, setOpen] = React.useState(false);
|
|
138
|
+
const showSearch = totalAgentCount(agents, sections) > SEARCH_THRESHOLD;
|
|
139
|
+
const handleOpenChange = React.useCallback((nextOpen) => {
|
|
140
|
+
setOpen(nextOpen);
|
|
141
|
+
onOpenChange?.(nextOpen);
|
|
142
|
+
}, [onOpenChange]);
|
|
143
|
+
const handleSelect = React.useCallback((id) => {
|
|
144
|
+
handleOpenChange(false);
|
|
145
|
+
onValueChange?.(id);
|
|
146
|
+
}, [handleOpenChange, onValueChange]);
|
|
147
|
+
const handleManage = () => {
|
|
148
|
+
handleOpenChange(false);
|
|
149
|
+
onManage?.();
|
|
150
|
+
};
|
|
151
|
+
const handleCreate = () => {
|
|
152
|
+
handleOpenChange(false);
|
|
153
|
+
onCreate?.();
|
|
154
|
+
};
|
|
155
|
+
const context = {
|
|
156
|
+
value,
|
|
157
|
+
onSelect: handleSelect,
|
|
158
|
+
open,
|
|
159
|
+
setOpen: handleOpenChange,
|
|
160
|
+
icons,
|
|
161
|
+
};
|
|
162
|
+
return (React.createElement(AgentPickerContext.Provider, { value: context },
|
|
163
|
+
React.createElement(AgentDataContext.Provider, { value: { agents, sections } },
|
|
164
|
+
React.createElement(Popover, { open: open, onOpenChange: handleOpenChange }, children ?? (React.createElement(React.Fragment, null,
|
|
165
|
+
React.createElement(AgentPickerTrigger, { inputStyle: inputStyle, invalid: invalid, className: className }),
|
|
166
|
+
React.createElement(AgentPickerContent, { showSearch: showSearch },
|
|
167
|
+
React.createElement(AgentPickerList, null,
|
|
168
|
+
React.createElement(AgentPickerPresetBody, { agents: agents, value: value, sections: sections, onManage: onManage ? handleManage : undefined, onCreate: onCreate ? handleCreate : undefined, isLoading: isLoading, icons: icons })))))))));
|
|
169
|
+
}
|
|
170
|
+
AgentPickerRoot.displayName = "AgentPicker.Root";
|
|
171
|
+
/**
|
|
172
|
+
* AgentPicker — render `<AgentPicker agents={...} .../>` for the default
|
|
173
|
+
* data-driven combobox, or compose `AgentPicker.Trigger` / `Content` / `List` /
|
|
174
|
+
* `Item` for a custom menu. Mirrors the `ToolCall` compound: render it, or
|
|
175
|
+
* compose it.
|
|
176
|
+
*/
|
|
177
|
+
export const AgentPicker = Object.assign(AgentPickerRoot, {
|
|
178
|
+
Root: AgentPickerRoot,
|
|
179
|
+
Trigger: AgentPickerTrigger,
|
|
180
|
+
Content: AgentPickerContent,
|
|
181
|
+
List: AgentPickerList,
|
|
182
|
+
Item: AgentPickerItem,
|
|
183
|
+
});
|
|
@@ -8,7 +8,7 @@ export function Shimmer({ children }) {
|
|
|
8
8
|
/** Render loader. */
|
|
9
9
|
export function Loader({ className, size = 16, }) {
|
|
10
10
|
const dotSize = size / 4;
|
|
11
|
-
return (React.createElement("div", { className: cn("flex items-center gap-1", className) }, ["0ms", "150ms", "300ms"].map((animationDelay) => (React.createElement("span", { key: animationDelay, className: "animate-bounce rounded-full bg-[var(--
|
|
11
|
+
return (React.createElement("div", { className: cn("flex items-center gap-1", className) }, ["0ms", "150ms", "300ms"].map((animationDelay) => (React.createElement("span", { key: animationDelay, className: "animate-bounce rounded-full bg-[var(--faint)]", style: { width: dotSize, height: dotSize, animationDelay } })))));
|
|
12
12
|
}
|
|
13
13
|
/** Render fade in. */
|
|
14
14
|
export function FadeIn({ children, duration = 300, className, }) {
|