@agent-native/core 0.76.3 → 0.76.4
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/corpus/core/CHANGELOG.md +6 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/client/AgentPanel.tsx +3 -3
- package/corpus/core/src/client/AgentTaskCard.tsx +2 -1
- package/corpus/core/src/client/AppearancePicker.tsx +1 -1
- package/corpus/core/src/client/AssistantChat.tsx +3 -3
- package/corpus/core/src/client/CommandMenu.tsx +4 -4
- package/corpus/core/src/client/ErrorBoundary.tsx +1 -1
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +11 -11
- package/corpus/core/src/client/NewWorkspaceAppFlow.tsx +5 -5
- package/corpus/core/src/client/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/core/src/client/components/ui/sheet.tsx +1 -1
- package/corpus/core/src/client/composer/ComposerPlusMenu.tsx +6 -6
- package/corpus/core/src/client/composer/MentionPopover.tsx +4 -4
- package/corpus/core/src/client/composer/PastedTextChip.tsx +3 -3
- package/corpus/core/src/client/composer/PromptComposer.tsx +3 -3
- package/corpus/core/src/client/composer/TiptapComposer.tsx +16 -16
- package/corpus/core/src/client/guided-questions.tsx +6 -8
- package/corpus/core/src/client/i18n.tsx +2 -2
- package/corpus/core/src/client/integrations/IntegrationCard.tsx +2 -2
- package/corpus/core/src/client/integrations/IntegrationsPanel.tsx +4 -4
- package/corpus/core/src/client/notifications/NotificationsBell.tsx +3 -3
- package/corpus/core/src/client/onboarding/OnboardingBanner.tsx +3 -3
- package/corpus/core/src/client/onboarding/OnboardingPanel.tsx +17 -10
- package/corpus/core/src/client/org/OrgSwitcher.tsx +13 -11
- package/corpus/core/src/client/org/TeamPage.tsx +2 -2
- package/corpus/core/src/client/settings/AgentsSection.tsx +3 -3
- package/corpus/core/src/client/settings/AutomationsSection.tsx +3 -3
- package/corpus/core/src/client/settings/SecretsSection.tsx +2 -2
- package/corpus/core/src/client/settings/SettingsPanel.tsx +5 -7
- package/corpus/core/src/client/settings/SettingsSection.tsx +1 -1
- package/corpus/core/src/client/settings/UsageSection.tsx +3 -3
- package/corpus/core/src/client/settings/VoiceTranscriptionSection.tsx +3 -3
- package/corpus/core/src/client/sharing/ShareButton.tsx +7 -7
- package/corpus/core/src/client/sharing/ShareDialog.tsx +3 -3
- package/corpus/core/src/styles/agent-conversation.css +10 -10
- package/corpus/core/src/styles/blocks.css +2 -2
- package/corpus/core/src/styles/rich-markdown-editor.css +2 -2
- package/corpus/templates/analytics/app/components/layout/MobileNav.tsx +1 -1
- package/corpus/templates/analytics/app/components/ui/alert-dialog.tsx +1 -1
- package/corpus/templates/analytics/app/components/ui/alert.tsx +1 -1
- package/corpus/templates/analytics/app/components/ui/breadcrumb.tsx +1 -1
- package/corpus/templates/analytics/app/components/ui/calendar.tsx +6 -6
- package/corpus/templates/analytics/app/components/ui/carousel.tsx +6 -6
- package/corpus/templates/analytics/app/components/ui/command.tsx +2 -2
- package/corpus/templates/analytics/app/components/ui/context-menu.tsx +9 -9
- package/corpus/templates/analytics/app/components/ui/date-picker.tsx +1 -1
- package/corpus/templates/analytics/app/components/ui/dialog.tsx +2 -2
- package/corpus/templates/analytics/app/components/ui/drawer.tsx +1 -1
- package/corpus/templates/analytics/app/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/templates/analytics/app/components/ui/input-otp.tsx +1 -1
- package/corpus/templates/analytics/app/components/ui/menubar.tsx +9 -9
- package/corpus/templates/analytics/app/components/ui/navigation-menu.tsx +3 -3
- package/corpus/templates/analytics/app/components/ui/pagination.tsx +4 -4
- package/corpus/templates/analytics/app/components/ui/scroll-area.tsx +1 -1
- package/corpus/templates/analytics/app/components/ui/select.tsx +3 -3
- package/corpus/templates/analytics/app/components/ui/sheet.tsx +2 -2
- package/corpus/templates/analytics/app/components/ui/sidebar.tsx +6 -6
- package/corpus/templates/analytics/app/components/ui/table.tsx +2 -2
- package/corpus/templates/analytics/app/components/ui/toast.tsx +3 -3
- package/corpus/templates/assets/app/components/layout/Layout.tsx +2 -2
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +12 -12
- package/corpus/templates/assets/app/components/ui/alert-dialog.tsx +1 -1
- package/corpus/templates/assets/app/components/ui/alert.tsx +1 -1
- package/corpus/templates/assets/app/components/ui/breadcrumb.tsx +1 -1
- package/corpus/templates/assets/app/components/ui/dialog.tsx +2 -2
- package/corpus/templates/assets/app/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/templates/assets/app/components/ui/pagination.tsx +4 -4
- package/corpus/templates/assets/app/components/ui/scroll-area.tsx +1 -1
- package/corpus/templates/assets/app/components/ui/select.tsx +3 -3
- package/corpus/templates/assets/app/components/ui/sheet.tsx +2 -2
- package/corpus/templates/assets/app/components/ui/table.tsx +2 -2
- package/corpus/templates/assets/app/routes/library.tsx +3 -3
- package/corpus/templates/assets/app/routes/settings.tsx +1 -1
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +5 -5
- package/corpus/templates/brain/app/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/templates/brain/app/components/ui/select.tsx +3 -3
- package/corpus/templates/brain/app/components/ui/sheet.tsx +2 -2
- package/corpus/templates/brain/app/components/ui/table.tsx +2 -2
- package/corpus/templates/calendar/app/components/calendar/GoogleConnectBanner.tsx +6 -6
- package/corpus/templates/calendar/app/components/calendar/GoogleSetupWizard.tsx +3 -3
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +11 -9
- package/corpus/templates/calendar/app/components/ui/alert-dialog.tsx +1 -1
- package/corpus/templates/calendar/app/components/ui/alert.tsx +1 -1
- package/corpus/templates/calendar/app/components/ui/breadcrumb.tsx +1 -1
- package/corpus/templates/calendar/app/components/ui/calendar.tsx +5 -5
- package/corpus/templates/calendar/app/components/ui/carousel.tsx +6 -6
- package/corpus/templates/calendar/app/components/ui/command.tsx +2 -2
- package/corpus/templates/calendar/app/components/ui/context-menu.tsx +9 -9
- package/corpus/templates/calendar/app/components/ui/dialog.tsx +2 -2
- package/corpus/templates/calendar/app/components/ui/drawer.tsx +1 -1
- package/corpus/templates/calendar/app/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/templates/calendar/app/components/ui/input-otp.tsx +1 -1
- package/corpus/templates/calendar/app/components/ui/menubar.tsx +9 -9
- package/corpus/templates/calendar/app/components/ui/navigation-menu.tsx +3 -3
- package/corpus/templates/calendar/app/components/ui/pagination.tsx +4 -4
- package/corpus/templates/calendar/app/components/ui/scroll-area.tsx +1 -1
- package/corpus/templates/calendar/app/components/ui/select.tsx +3 -3
- package/corpus/templates/calendar/app/components/ui/sheet.tsx +2 -2
- package/corpus/templates/calendar/app/components/ui/sidebar.tsx +6 -6
- package/corpus/templates/calendar/app/components/ui/sonner.tsx +1 -1
- package/corpus/templates/calendar/app/components/ui/table.tsx +2 -2
- package/corpus/templates/calendar/app/components/ui/toast.tsx +3 -3
- package/corpus/templates/calendar/app/pages/Settings.tsx +5 -5
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +9 -9
- package/corpus/templates/chat/app/components/ui/alert-dialog.tsx +1 -1
- package/corpus/templates/chat/app/components/ui/alert.tsx +1 -1
- package/corpus/templates/chat/app/components/ui/breadcrumb.tsx +1 -1
- package/corpus/templates/chat/app/components/ui/calendar.tsx +5 -5
- package/corpus/templates/chat/app/components/ui/carousel.tsx +6 -6
- package/corpus/templates/chat/app/components/ui/command.tsx +2 -2
- package/corpus/templates/chat/app/components/ui/context-menu.tsx +9 -9
- package/corpus/templates/chat/app/components/ui/dialog.tsx +2 -2
- package/corpus/templates/chat/app/components/ui/drawer.tsx +1 -1
- package/corpus/templates/chat/app/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/templates/chat/app/components/ui/input-otp.tsx +1 -1
- package/corpus/templates/chat/app/components/ui/menubar.tsx +9 -9
- package/corpus/templates/chat/app/components/ui/navigation-menu.tsx +3 -3
- package/corpus/templates/chat/app/components/ui/pagination.tsx +4 -4
- package/corpus/templates/chat/app/components/ui/scroll-area.tsx +1 -1
- package/corpus/templates/chat/app/components/ui/select.tsx +3 -3
- package/corpus/templates/chat/app/components/ui/sheet.tsx +2 -2
- package/corpus/templates/chat/app/components/ui/sidebar.tsx +6 -6
- package/corpus/templates/chat/app/components/ui/table.tsx +2 -2
- package/corpus/templates/chat/app/components/ui/toast.tsx +3 -3
- package/corpus/templates/clips/app/components/capture-install-options.tsx +3 -3
- package/corpus/templates/clips/app/components/editable-recording-title.tsx +1 -1
- package/corpus/templates/clips/app/components/library/bulk-action-toolbar.tsx +3 -3
- package/corpus/templates/clips/app/components/library/folder-tree.tsx +5 -5
- package/corpus/templates/clips/app/components/library/library-layout.tsx +3 -3
- package/corpus/templates/clips/app/components/library/organization-switcher.tsx +4 -4
- package/corpus/templates/clips/app/components/library/recording-card.tsx +11 -11
- package/corpus/templates/clips/app/components/library/search-bar.tsx +4 -4
- package/corpus/templates/clips/app/components/library/space-card.tsx +1 -1
- package/corpus/templates/clips/app/components/library/tag-input.tsx +1 -1
- package/corpus/templates/clips/app/components/meetings/quick-ask-sidebar.tsx +2 -2
- package/corpus/templates/clips/app/components/recorder/camera-visualizer.tsx +2 -2
- package/corpus/templates/clips/app/components/recorder/microphone-visualizer.tsx +1 -1
- package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +4 -4
- package/corpus/templates/clips/app/components/recorder/storage-setup-card.tsx +1 -1
- package/corpus/templates/clips/app/components/sharing/share-ui.tsx +2 -2
- package/corpus/templates/clips/app/components/ui/alert-dialog.tsx +1 -1
- package/corpus/templates/clips/app/components/ui/alert.tsx +1 -1
- package/corpus/templates/clips/app/components/ui/breadcrumb.tsx +1 -1
- package/corpus/templates/clips/app/components/ui/calendar.tsx +5 -5
- package/corpus/templates/clips/app/components/ui/carousel.tsx +6 -6
- package/corpus/templates/clips/app/components/ui/command.tsx +2 -2
- package/corpus/templates/clips/app/components/ui/context-menu.tsx +9 -9
- package/corpus/templates/clips/app/components/ui/dialog.tsx +2 -2
- package/corpus/templates/clips/app/components/ui/drawer.tsx +1 -1
- package/corpus/templates/clips/app/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/templates/clips/app/components/ui/input-otp.tsx +1 -1
- package/corpus/templates/clips/app/components/ui/menubar.tsx +9 -9
- package/corpus/templates/clips/app/components/ui/navigation-menu.tsx +3 -3
- package/corpus/templates/clips/app/components/ui/pagination.tsx +4 -4
- package/corpus/templates/clips/app/components/ui/scroll-area.tsx +1 -1
- package/corpus/templates/clips/app/components/ui/select.tsx +3 -3
- package/corpus/templates/clips/app/components/ui/sheet.tsx +2 -2
- package/corpus/templates/clips/app/components/ui/sidebar.tsx +6 -6
- package/corpus/templates/clips/app/components/ui/table.tsx +2 -2
- package/corpus/templates/clips/app/components/ui/toast.tsx +3 -3
- package/corpus/templates/clips/app/components/workspace/branding-editor.tsx +1 -1
- package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +2 -2
- package/corpus/templates/clips/app/components/workspace/invite-dialog.tsx +2 -2
- package/corpus/templates/clips/app/components/workspace/top-creators-table.tsx +6 -6
- package/corpus/templates/clips/app/components/workspace/top-videos-table.tsx +2 -2
- package/corpus/templates/clips/app/routes/_app.dictate.tsx +4 -4
- package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +7 -7
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +1 -1
- package/corpus/templates/clips/app/routes/download.tsx +2 -2
- package/corpus/templates/clips/app/routes/invite.$token.tsx +2 -2
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +3 -3
- package/corpus/templates/clips/app/routes/record.tsx +5 -5
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +7 -7
- package/corpus/templates/content/app/components/EmptyState.tsx +1 -1
- package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +17 -17
- package/corpus/templates/content/app/components/layout/Layout.tsx +2 -2
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +10 -9
- package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +10 -6
- package/corpus/templates/content/app/components/sidebar/NotionButton.tsx +3 -3
- package/corpus/templates/content/app/components/ui/alert-dialog.tsx +1 -1
- package/corpus/templates/content/app/components/ui/dialog.tsx +2 -2
- package/corpus/templates/content/app/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/templates/content/app/components/ui/scroll-area.tsx +1 -1
- package/corpus/templates/content/app/components/ui/sheet.tsx +2 -2
- package/corpus/templates/content/app/components/ui/table.tsx +2 -2
- package/corpus/templates/content/app/components/ui/toast.tsx +3 -3
- package/corpus/templates/design/app/components/layout/Layout.tsx +3 -3
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +3 -3
- package/corpus/templates/design/app/components/ui/alert-dialog.tsx +1 -1
- package/corpus/templates/design/app/components/ui/alert.tsx +1 -1
- package/corpus/templates/design/app/components/ui/breadcrumb.tsx +1 -1
- package/corpus/templates/design/app/components/ui/calendar.tsx +5 -5
- package/corpus/templates/design/app/components/ui/carousel.tsx +6 -6
- package/corpus/templates/design/app/components/ui/command.tsx +2 -2
- package/corpus/templates/design/app/components/ui/context-menu.tsx +9 -9
- package/corpus/templates/design/app/components/ui/dialog.tsx +2 -2
- package/corpus/templates/design/app/components/ui/drawer.tsx +1 -1
- package/corpus/templates/design/app/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/templates/design/app/components/ui/input-otp.tsx +1 -1
- package/corpus/templates/design/app/components/ui/menubar.tsx +9 -9
- package/corpus/templates/design/app/components/ui/navigation-menu.tsx +3 -3
- package/corpus/templates/design/app/components/ui/pagination.tsx +4 -4
- package/corpus/templates/design/app/components/ui/scroll-area.tsx +1 -1
- package/corpus/templates/design/app/components/ui/select.tsx +3 -3
- package/corpus/templates/design/app/components/ui/sheet.tsx +2 -2
- package/corpus/templates/design/app/components/ui/sidebar.tsx +6 -6
- package/corpus/templates/design/app/components/ui/table.tsx +2 -2
- package/corpus/templates/design/app/components/ui/toast.tsx +3 -3
- package/corpus/templates/design/app/pages/DesignSystems.tsx +6 -8
- package/corpus/templates/design/app/pages/Index.tsx +8 -8
- package/corpus/templates/design/app/pages/NotFound.tsx +1 -1
- package/corpus/templates/design/app/pages/Templates.tsx +2 -2
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +3 -3
- package/corpus/templates/forms/app/components/ui/alert-dialog.tsx +1 -1
- package/corpus/templates/forms/app/components/ui/alert.tsx +1 -1
- package/corpus/templates/forms/app/components/ui/breadcrumb.tsx +1 -1
- package/corpus/templates/forms/app/components/ui/calendar.tsx +9 -6
- package/corpus/templates/forms/app/components/ui/carousel.tsx +6 -6
- package/corpus/templates/forms/app/components/ui/command.tsx +2 -2
- package/corpus/templates/forms/app/components/ui/context-menu.tsx +9 -9
- package/corpus/templates/forms/app/components/ui/dialog.tsx +2 -2
- package/corpus/templates/forms/app/components/ui/drawer.tsx +1 -1
- package/corpus/templates/forms/app/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/templates/forms/app/components/ui/input-otp.tsx +1 -1
- package/corpus/templates/forms/app/components/ui/menubar.tsx +9 -9
- package/corpus/templates/forms/app/components/ui/navigation-menu.tsx +3 -3
- package/corpus/templates/forms/app/components/ui/pagination.tsx +4 -4
- package/corpus/templates/forms/app/components/ui/scroll-area.tsx +1 -1
- package/corpus/templates/forms/app/components/ui/select.tsx +3 -3
- package/corpus/templates/forms/app/components/ui/sheet.tsx +2 -2
- package/corpus/templates/forms/app/components/ui/sidebar.tsx +6 -6
- package/corpus/templates/forms/app/components/ui/table.tsx +2 -2
- package/corpus/templates/forms/app/components/ui/toast.tsx +3 -3
- package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +18 -18
- package/corpus/templates/forms/app/pages/FormsListPage.tsx +9 -9
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +4 -4
- package/corpus/templates/macros/app/components/ui/alert-dialog.tsx +1 -1
- package/corpus/templates/macros/app/components/ui/alert.tsx +1 -1
- package/corpus/templates/macros/app/components/ui/breadcrumb.tsx +1 -1
- package/corpus/templates/macros/app/components/ui/command.tsx +2 -2
- package/corpus/templates/macros/app/components/ui/context-menu.tsx +9 -9
- package/corpus/templates/macros/app/components/ui/dialog.tsx +2 -2
- package/corpus/templates/macros/app/components/ui/drawer.tsx +1 -1
- package/corpus/templates/macros/app/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/templates/macros/app/components/ui/menubar.tsx +9 -9
- package/corpus/templates/macros/app/components/ui/navigation-menu.tsx +3 -3
- package/corpus/templates/macros/app/components/ui/pagination.tsx +4 -4
- package/corpus/templates/macros/app/components/ui/scroll-area.tsx +1 -1
- package/corpus/templates/macros/app/components/ui/select.tsx +3 -3
- package/corpus/templates/macros/app/components/ui/sheet.tsx +2 -2
- package/corpus/templates/macros/app/components/ui/table.tsx +2 -2
- package/corpus/templates/macros/app/components/ui/toast.tsx +3 -3
- package/corpus/templates/macros/app/routes/_index.tsx +2 -2
- package/corpus/templates/macros/app/routes/analytics.tsx +1 -1
- package/corpus/templates/mail/app/components/GoogleConnectBanner.tsx +6 -6
- package/corpus/templates/mail/app/components/email/AttachmentStrip.tsx +2 -2
- package/corpus/templates/mail/app/components/email/EmailListItem.tsx +5 -5
- package/corpus/templates/mail/app/components/email/IntegrationsSidebar.tsx +5 -5
- package/corpus/templates/mail/app/components/email/MobileActionBar.tsx +3 -3
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +10 -10
- package/corpus/templates/mail/app/components/layout/CommandPalette.tsx +1 -1
- package/corpus/templates/mail/app/components/layout/SearchBar.tsx +3 -3
- package/corpus/templates/mail/app/components/ui/alert-dialog.tsx +1 -1
- package/corpus/templates/mail/app/components/ui/alert.tsx +1 -1
- package/corpus/templates/mail/app/components/ui/breadcrumb.tsx +1 -1
- package/corpus/templates/mail/app/components/ui/calendar.tsx +4 -4
- package/corpus/templates/mail/app/components/ui/carousel.tsx +6 -6
- package/corpus/templates/mail/app/components/ui/command.tsx +2 -2
- package/corpus/templates/mail/app/components/ui/context-menu.tsx +9 -9
- package/corpus/templates/mail/app/components/ui/dialog.tsx +2 -2
- package/corpus/templates/mail/app/components/ui/drawer.tsx +1 -1
- package/corpus/templates/mail/app/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/templates/mail/app/components/ui/input-otp.tsx +1 -1
- package/corpus/templates/mail/app/components/ui/menubar.tsx +9 -9
- package/corpus/templates/mail/app/components/ui/navigation-menu.tsx +3 -3
- package/corpus/templates/mail/app/components/ui/pagination.tsx +4 -4
- package/corpus/templates/mail/app/components/ui/scroll-area.tsx +1 -1
- package/corpus/templates/mail/app/components/ui/select.tsx +3 -3
- package/corpus/templates/mail/app/components/ui/sheet.tsx +2 -2
- package/corpus/templates/mail/app/components/ui/sidebar.tsx +6 -6
- package/corpus/templates/mail/app/components/ui/sonner.tsx +2 -2
- package/corpus/templates/mail/app/components/ui/table.tsx +2 -2
- package/corpus/templates/mail/app/components/ui/toast.tsx +3 -3
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +10 -10
- package/corpus/templates/plan/app/components/ui/alert-dialog.tsx +1 -1
- package/corpus/templates/plan/app/components/ui/alert.tsx +1 -1
- package/corpus/templates/plan/app/components/ui/breadcrumb.tsx +1 -1
- package/corpus/templates/plan/app/components/ui/calendar.tsx +5 -5
- package/corpus/templates/plan/app/components/ui/carousel.tsx +6 -6
- package/corpus/templates/plan/app/components/ui/command.tsx +2 -2
- package/corpus/templates/plan/app/components/ui/context-menu.tsx +9 -9
- package/corpus/templates/plan/app/components/ui/dialog.tsx +2 -2
- package/corpus/templates/plan/app/components/ui/drawer.tsx +1 -1
- package/corpus/templates/plan/app/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/templates/plan/app/components/ui/input-otp.tsx +1 -1
- package/corpus/templates/plan/app/components/ui/menubar.tsx +9 -9
- package/corpus/templates/plan/app/components/ui/navigation-menu.tsx +3 -3
- package/corpus/templates/plan/app/components/ui/pagination.tsx +4 -4
- package/corpus/templates/plan/app/components/ui/scroll-area.tsx +1 -1
- package/corpus/templates/plan/app/components/ui/select.tsx +3 -3
- package/corpus/templates/plan/app/components/ui/sheet.tsx +2 -2
- package/corpus/templates/plan/app/components/ui/sidebar.tsx +6 -6
- package/corpus/templates/plan/app/components/ui/table.tsx +2 -2
- package/corpus/templates/plan/app/components/ui/toast.tsx +3 -3
- package/corpus/templates/slides/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/slides/app/components/ui/alert-dialog.tsx +1 -1
- package/corpus/templates/slides/app/components/ui/alert.tsx +1 -1
- package/corpus/templates/slides/app/components/ui/breadcrumb.tsx +1 -1
- package/corpus/templates/slides/app/components/ui/calendar.tsx +5 -5
- package/corpus/templates/slides/app/components/ui/carousel.tsx +6 -6
- package/corpus/templates/slides/app/components/ui/command.tsx +2 -2
- package/corpus/templates/slides/app/components/ui/context-menu.tsx +9 -9
- package/corpus/templates/slides/app/components/ui/dialog.tsx +2 -2
- package/corpus/templates/slides/app/components/ui/drawer.tsx +1 -1
- package/corpus/templates/slides/app/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/templates/slides/app/components/ui/input-otp.tsx +1 -1
- package/corpus/templates/slides/app/components/ui/menubar.tsx +9 -9
- package/corpus/templates/slides/app/components/ui/navigation-menu.tsx +3 -3
- package/corpus/templates/slides/app/components/ui/pagination.tsx +4 -4
- package/corpus/templates/slides/app/components/ui/scroll-area.tsx +1 -1
- package/corpus/templates/slides/app/components/ui/select.tsx +3 -3
- package/corpus/templates/slides/app/components/ui/sheet.tsx +2 -2
- package/corpus/templates/slides/app/components/ui/sidebar.tsx +6 -6
- package/corpus/templates/slides/app/components/ui/table.tsx +2 -2
- package/corpus/templates/slides/app/components/ui/toast.tsx +3 -3
- package/corpus/templates/videos/app/components/ui/alert-dialog.tsx +1 -1
- package/corpus/templates/videos/app/components/ui/alert.tsx +1 -1
- package/corpus/templates/videos/app/components/ui/breadcrumb.tsx +1 -1
- package/corpus/templates/videos/app/components/ui/calendar.tsx +5 -5
- package/corpus/templates/videos/app/components/ui/carousel.tsx +6 -6
- package/corpus/templates/videos/app/components/ui/command.tsx +2 -2
- package/corpus/templates/videos/app/components/ui/context-menu.tsx +9 -9
- package/corpus/templates/videos/app/components/ui/dialog.tsx +2 -2
- package/corpus/templates/videos/app/components/ui/drawer.tsx +1 -1
- package/corpus/templates/videos/app/components/ui/dropdown-menu.tsx +9 -9
- package/corpus/templates/videos/app/components/ui/input-otp.tsx +1 -1
- package/corpus/templates/videos/app/components/ui/menubar.tsx +9 -9
- package/corpus/templates/videos/app/components/ui/navigation-menu.tsx +3 -3
- package/corpus/templates/videos/app/components/ui/pagination.tsx +4 -4
- package/corpus/templates/videos/app/components/ui/scroll-area.tsx +1 -1
- package/corpus/templates/videos/app/components/ui/select.tsx +3 -3
- package/corpus/templates/videos/app/components/ui/sheet.tsx +2 -2
- package/corpus/templates/videos/app/components/ui/sidebar.tsx +6 -6
- package/corpus/templates/videos/app/components/ui/table.tsx +2 -2
- package/corpus/templates/videos/app/components/ui/toast.tsx +3 -3
- package/dist/client/AgentPanel.js +3 -3
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AgentTaskCard.d.ts.map +1 -1
- package/dist/client/AgentTaskCard.js +1 -1
- package/dist/client/AgentTaskCard.js.map +1 -1
- package/dist/client/AppearancePicker.js +1 -1
- package/dist/client/AppearancePicker.js.map +1 -1
- package/dist/client/AssistantChat.js +3 -3
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/CommandMenu.js +4 -4
- package/dist/client/CommandMenu.js.map +1 -1
- package/dist/client/ErrorBoundary.js +1 -1
- package/dist/client/ErrorBoundary.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +9 -9
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/NewWorkspaceAppFlow.js +5 -5
- package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
- package/dist/client/components/ui/dropdown-menu.js +6 -6
- package/dist/client/components/ui/dropdown-menu.js.map +1 -1
- package/dist/client/components/ui/sheet.js +1 -1
- package/dist/client/components/ui/sheet.js.map +1 -1
- package/dist/client/composer/ComposerPlusMenu.js +5 -5
- package/dist/client/composer/ComposerPlusMenu.js.map +1 -1
- package/dist/client/composer/MentionPopover.js +4 -4
- package/dist/client/composer/MentionPopover.js.map +1 -1
- package/dist/client/composer/PastedTextChip.js +2 -2
- package/dist/client/composer/PastedTextChip.js.map +1 -1
- package/dist/client/composer/PromptComposer.js +3 -3
- package/dist/client/composer/PromptComposer.js.map +1 -1
- package/dist/client/composer/TiptapComposer.js +12 -12
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/guided-questions.d.ts.map +1 -1
- package/dist/client/guided-questions.js +5 -5
- package/dist/client/guided-questions.js.map +1 -1
- package/dist/client/i18n.js +2 -2
- package/dist/client/i18n.js.map +1 -1
- package/dist/client/integrations/IntegrationCard.js +1 -1
- package/dist/client/integrations/IntegrationCard.js.map +1 -1
- package/dist/client/integrations/IntegrationsPanel.js +4 -4
- package/dist/client/integrations/IntegrationsPanel.js.map +1 -1
- package/dist/client/notifications/NotificationsBell.js +3 -3
- package/dist/client/notifications/NotificationsBell.js.map +1 -1
- package/dist/client/onboarding/OnboardingBanner.js +3 -3
- package/dist/client/onboarding/OnboardingBanner.js.map +1 -1
- package/dist/client/onboarding/OnboardingPanel.d.ts.map +1 -1
- package/dist/client/onboarding/OnboardingPanel.js +15 -10
- package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
- package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +7 -7
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/org/TeamPage.js +2 -2
- package/dist/client/org/TeamPage.js.map +1 -1
- package/dist/client/settings/AgentsSection.js +3 -3
- package/dist/client/settings/AgentsSection.js.map +1 -1
- package/dist/client/settings/AutomationsSection.js +2 -2
- package/dist/client/settings/AutomationsSection.js.map +1 -1
- package/dist/client/settings/SecretsSection.js +2 -2
- package/dist/client/settings/SecretsSection.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +4 -4
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/SettingsSection.js +1 -1
- package/dist/client/settings/SettingsSection.js.map +1 -1
- package/dist/client/settings/UsageSection.js +2 -2
- package/dist/client/settings/UsageSection.js.map +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.js +3 -3
- package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
- package/dist/client/sharing/ShareButton.js +6 -6
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/client/sharing/ShareDialog.js +3 -3
- package/dist/client/sharing/ShareDialog.js.map +1 -1
- package/dist/styles/agent-conversation.css +10 -10
- package/dist/styles/blocks.css +2 -2
- package/dist/styles/rich-markdown-editor.css +2 -2
- package/package.json +1 -1
|
@@ -138,7 +138,7 @@ function ImagePreviewLightbox({ src, alt, onClose, }) {
|
|
|
138
138
|
document.body.style.overflow = "";
|
|
139
139
|
};
|
|
140
140
|
}, [onClose]);
|
|
141
|
-
return (_jsxs("div", { role: "dialog", "aria-label": "Image preview", onClick: onClose, className: "fixed inset-0 z-[300] flex items-center justify-center bg-black/80 p-6 cursor-zoom-out", children: [_jsx("img", { src: src, alt: alt, onClick: (e) => e.stopPropagation(), className: "max-h-full max-w-full object-contain rounded-md shadow-2xl cursor-default" }), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close preview", className: "absolute
|
|
141
|
+
return (_jsxs("div", { role: "dialog", "aria-label": "Image preview", onClick: onClose, className: "fixed inset-0 z-[300] flex items-center justify-center bg-black/80 p-6 cursor-zoom-out", children: [_jsx("img", { src: src, alt: alt, onClick: (e) => e.stopPropagation(), className: "max-h-full max-w-full object-contain rounded-md shadow-2xl cursor-default" }), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close preview", className: "absolute end-4 top-4 flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-white/30 bg-black/40 text-white hover:bg-black/60", children: _jsx(IconX, { className: "h-4 w-4" }) })] }));
|
|
142
142
|
}
|
|
143
143
|
function AttachmentChip({ attachment, onRemove, }) {
|
|
144
144
|
const src = useMemo(() => getImageSrc(attachment), [attachment]);
|
|
@@ -160,7 +160,7 @@ function AttachmentChip({ attachment, onRemove, }) {
|
|
|
160
160
|
e.stopPropagation();
|
|
161
161
|
onRemove(attachment.id);
|
|
162
162
|
}
|
|
163
|
-
}, "aria-label": `Remove ${attachment.name}`, className: "absolute
|
|
163
|
+
}, "aria-label": `Remove ${attachment.name}`, className: "absolute end-1 top-1 flex h-5 w-5 cursor-pointer items-center justify-center rounded-full border border-border/60 bg-background/90 text-muted-foreground hover:text-foreground", children: _jsx(IconX, { className: "h-3 w-3" }) })] }), previewOpen ? (_jsx(ImagePreviewLightbox, { src: src, alt: attachment.name, onClose: () => setPreviewOpen(false) })) : null] }));
|
|
164
164
|
}
|
|
165
165
|
return (_jsxs("div", { className: "agent-composer-attachment-chip group relative inline-flex max-w-[200px] items-center gap-2 rounded-md border border-border/70 bg-muted/50 px-2 py-1.5 text-xs", children: [_jsx("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded bg-background text-[9px] font-semibold uppercase text-muted-foreground", children: attachment.name.split(".").pop() || "file" }), _jsx("span", { className: "min-w-0 truncate font-medium", children: attachment.name }), _jsx("button", { type: "button", onClick: () => onRemove(attachment.id), "aria-label": `Remove ${attachment.name}`, className: "flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded text-muted-foreground hover:text-foreground", children: _jsx(IconX, { className: "h-3 w-3" }) })] }));
|
|
166
166
|
}
|
|
@@ -229,7 +229,7 @@ function PromptComposerInner({ onSubmit, placeholder, disabled, autoFocus, class
|
|
|
229
229
|
effort: composerEffort,
|
|
230
230
|
});
|
|
231
231
|
}, [composerEffort, composerEngine, composerModel, onSubmit]);
|
|
232
|
-
return (_jsxs(AgentComposerFrame, { className: cn("text-
|
|
232
|
+
return (_jsxs(AgentComposerFrame, { className: cn("text-start", className), rootClassName: rootClassName, style: style, rootStyle: rootStyle, layoutVariant: layoutVariant, children: [_jsx(PromptAttachmentStrip, {}), _jsx(TiptapComposer, { focusRef: handleRef, disabled: disabled, placeholder: placeholder, initialText: initialText, initialTextKey: initialTextKey, onSubmit: handleSubmit, clearOnSubmit: !preserveDraftOnSubmit, plusMenuMode: plusMenuMode ?? (attachmentsEnabled ? "upload-only" : "hidden"), attachButton: attachButton, modeControl: modeControl, toolbarSlot: toolbarSlot, actionButton: actionButton, extraActionButton: extraActionButton, layoutVariant: layoutVariant, slashCommands: slashCommands, slashSkills: slashSkills, includeDefaultSlashCommands: includeDefaultSlashCommands, includeDefaultSlashSkills: includeDefaultSlashSkills, onSlashCommand: onSlashCommand, voiceEnabled: voiceEnabled, onTextChange: onTextChange, draftScope: draftScope, selectedModel: composerModel, selectedEffort: composerEffort, availableModels: composerModelGroups, onModelChange: handleModelChange, onEffortChange: handleEffortChange, providerConnectStatusEnabled: resolvedModelStatusChecksEnabled, onConnectProvider: onConnectProvider })] }));
|
|
233
233
|
}
|
|
234
234
|
/**
|
|
235
235
|
* Standalone composer that mirrors the agent sidebar's input experience —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromptComposer.js","sourceRoot":"","sources":["../../../src/client/composer/PromptComposer.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAC;AACf,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,MAAM,EACN,WAAW,EACX,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACL,+BAA+B,EAC/B,cAAc,GAIf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,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AAE,EAAE,OAAO,EAAE,UAAU,EAAE,YAE9B,KAAC,kCAAkC,IACjC,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAC,gBAAgB,YAE9B,KAAC,mBAAmB,OAAK,KAAK,GAAI,GACC,GAChB,GACE,GACX,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type Ref,\n type ReactNode,\n} from \"react\";\nimport {\n AssistantRuntimeProvider,\n ThreadPrimitive,\n useAui,\n useComposer,\n useLocalRuntime,\n} from \"@assistant-ui/react\";\nimport type {\n Attachment,\n AttachmentAdapter,\n ChatModelAdapter,\n CompleteAttachment,\n PendingAttachment,\n} from \"@assistant-ui/react\";\nimport {\n CompositeAttachmentAdapter,\n SimpleImageAttachmentAdapter,\n} from \"@assistant-ui/react\";\nimport { IconX } from \"@tabler/icons-react\";\nimport { cn } from \"../utils.js\";\nimport { AgentComposerFrame } from \"./AgentComposerFrame.js\";\nimport {\n DEFAULT_VOICE_DICTATION_ENABLED,\n TiptapComposer,\n type ComposerSubmitIntent,\n type TiptapComposerHandle,\n type TiptapComposerSubmitOptions,\n} from \"./TiptapComposer.js\";\nimport { IMAGE_ATTACHMENT_ACCEPT } from \"./attachment-accept.js\";\nimport type {\n AgentComposerLayoutVariant,\n Reference,\n SkillResult,\n SlashCommand,\n} from \"./types.js\";\nimport { useChatModels, type EngineModelGroup } from \"../use-chat-models.js\";\nimport { TooltipProvider } from \"../components/ui/tooltip.js\";\nimport { AssistantUiStaleIndexErrorBoundary } from \"../assistant-ui-recovery.js\";\nimport type { ReasoningEffort } from \"../../shared/reasoning-effort.js\";\nimport { isPastedTextAttachmentName } from \"./pasted-text.js\";\nimport { PastedTextChip } from \"./PastedTextChip.js\";\nimport {\n PROMPT_DOCUMENT_ATTACHMENT_ACCEPT,\n TextAttachmentAdapter,\n} from \"./attachment-accept.js\";\nimport { escapePromptAttachmentAttribute } from \"./prompt-attachments.js\";\n\nconst MAX_INLINE_TEXT_FILE_CHARS = 60_000;\n\n/**\n * Files the user attached via the \"+\" button in PromptComposer. The host owns\n * what to do with them — typically POST to a per-app upload endpoint and pass\n * the resulting URLs/paths into the prompt that gets sent to the agent.\n */\nexport type PromptComposerFile = File;\n\nexport interface PromptComposerSubmitOptions {\n intent?: ComposerSubmitIntent;\n model?: string;\n engine?: string;\n effort?: ReasoningEffort;\n}\n\nexport interface PromptComposerProps {\n /** Called when the user submits the composer. */\n onSubmit: (\n text: string,\n files: PromptComposerFile[],\n references: Reference[],\n options: PromptComposerSubmitOptions,\n ) => void;\n placeholder?: string;\n disabled?: boolean;\n autoFocus?: boolean;\n className?: string;\n style?: CSSProperties;\n rootClassName?: string;\n rootStyle?: CSSProperties;\n /** Forwarded to TiptapComposer for draft persistence. */\n draftScope?: string;\n /** Keep the submitted prompt in the editor. Default: false. */\n preserveDraftOnSubmit?: boolean;\n /** Show the model selector (default: true). */\n showModelSelector?: boolean;\n /** Show the voice dictation button. Defaults to DEFAULT_VOICE_DICTATION_ENABLED. */\n voiceEnabled?: boolean;\n /** Show file upload controls and pass submitted files to onSubmit (default: true). */\n attachmentsEnabled?: boolean;\n /**\n * Controls the shared \"+\" affordance. Defaults to upload-only for standalone\n * prompt forms; chat surfaces can opt into the full sidebar menu.\n */\n plusMenuMode?: \"full\" | \"upload-only\" | \"hidden\";\n /** Programmatically seed the composer with plain text. */\n initialText?: string;\n /** Stable key used to re-apply `initialText` when the host picks a preset. */\n initialTextKey?: string | number;\n /** Optional host-owned control rendered directly after the \"+\" button. */\n modeControl?: ReactNode;\n /** Explicit host-owned toolbar slot rendered directly after the \"+\" button. */\n toolbarSlot?: ReactNode;\n /** Custom attachment button to render instead of the default \"+\" affordance. */\n attachButton?: ReactNode;\n /** Custom action button to render instead of the default send button. */\n actionButton?: ReactNode;\n /** Extra button rendered alongside the default send button. */\n extraActionButton?: ReactNode;\n /** Shared sizing/layout variant for host surfaces. Default keeps sidebar behavior. */\n layoutVariant?: AgentComposerLayoutVariant;\n /** Additional slash commands surfaced in the shared / menu. */\n slashCommands?: SlashCommand[];\n /** Additional slash skills surfaced in the shared / menu. */\n slashSkills?: SkillResult[];\n /** Include built-in sidebar slash commands like /clear and /help. Default true. */\n includeDefaultSlashCommands?: boolean;\n /** Include app-discovered skills from the default agent endpoint. Default true. */\n includeDefaultSlashSkills?: boolean;\n /** Called when a slash command from the shared / menu is executed. */\n onSlashCommand?: (command: string) => void;\n /** External model list for hosts that already resolve models outside the app. */\n availableModels?: EngineModelGroup[];\n selectedModel?: string;\n selectedEngine?: string;\n selectedEffort?: ReasoningEffort;\n onModelChange?: (model: string, engine: string) => void;\n onEffortChange?: (effort: ReasoningEffort) => void;\n /**\n * Enable server-backed model/provider status checks. Defaults off when the\n * host supplies model state and callbacks, otherwise on.\n */\n modelStatusChecksEnabled?: boolean;\n /** Called whenever the plain editor text changes. */\n onTextChange?: (text: string) => void;\n /**\n * Override the Builder.io connect action in the model picker. When provided,\n * clicking \"Connect Builder.io\" calls this instead of opening a browser popup.\n * Used by the Electron desktop app to route through the native IPC handler.\n */\n onConnectProvider?: () => void;\n /** Imperative handle for focusing the composer. */\n composerRef?: Ref<TiptapComposerHandle>;\n}\n\n// Minimal pass-through adapter. PromptComposer always submits through\n// onSubmitOverride, so the runtime never actually calls this — but\n// `useLocalRuntime` needs *something* shaped like a ChatModelAdapter.\nconst NOOP_ADAPTER: ChatModelAdapter = {\n async *run() {\n return;\n },\n};\n\n/**\n * Local binary document adapter so reference PDFs, decks, and docs can be\n * attached without dragging the whole assistant chat module into bundles that\n * just want a prompt popover.\n */\nclass BinaryDocumentAttachmentAdapter implements AttachmentAdapter {\n public accept = PROMPT_DOCUMENT_ATTACHMENT_ACCEPT;\n\n public async add(state: { file: File }): Promise<PendingAttachment> {\n return {\n id: state.file.name,\n type: \"document\",\n name: state.file.name,\n contentType: state.file.type || \"application/octet-stream\",\n file: state.file,\n status: { type: \"requires-action\", reason: \"composer-send\" },\n };\n }\n\n public async send(\n attachment: PendingAttachment,\n ): Promise<CompleteAttachment> {\n return {\n ...attachment,\n status: { type: \"complete\" },\n content: [],\n };\n }\n\n public async remove() {\n /* noop */\n }\n}\n\nclass RasterImageAttachmentAdapter extends SimpleImageAttachmentAdapter {\n public accept = IMAGE_ATTACHMENT_ACCEPT;\n}\n\nfunction isInlineableTextFile(file: File): boolean {\n if (file.type.startsWith(\"text/\")) return true;\n if (file.type === \"application/json\") return true;\n return /\\.(txt|md|markdown|csv|json|yaml|yml|html?|css|xml)$/i.test(\n file.name,\n );\n}\n\nfunction formatInlineTextFile(name: string, text: string): string {\n const truncated = text.length > MAX_INLINE_TEXT_FILE_CHARS;\n const body = truncated ? text.slice(0, MAX_INLINE_TEXT_FILE_CHARS) : text;\n return [\n `<uploaded-text-file name=\"${escapePromptAttachmentAttribute(name)}\">`,\n body,\n truncated\n ? `[Truncated after ${MAX_INLINE_TEXT_FILE_CHARS} characters.]`\n : \"\",\n \"</uploaded-text-file>\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n}\n\nexport async function buildPromptComposerSubmission(options: {\n text: string;\n attachments?: ReadonlyArray<unknown>;\n}): Promise<{ text: string; files: File[] }> {\n const files: File[] = [];\n const pastedTextBlocks: string[] = [];\n const rawText = options.text;\n\n for (const att of options.attachments ?? []) {\n const a = att as Attachment;\n if (\"file\" in a && a.file instanceof File) {\n const file = a.file;\n if (isPastedTextAttachmentName(file.name)) {\n try {\n pastedTextBlocks.push(await file.text());\n } catch {\n files.push(file);\n }\n } else {\n if (isInlineableTextFile(file)) {\n try {\n pastedTextBlocks.push(\n formatInlineTextFile(file.name, await file.text()),\n );\n } catch {\n // Keep the upload path fallback below.\n }\n }\n // Note: images are NOT inlined into the prompt text even when small.\n // Inlining a base64 data-URL into a text string consumes an enormous\n // number of tokens (≈ 700 K per MB) and most hosts handle images via\n // proper attachment channels. The `files` array below carries the image\n // for the host to process through a dedicated attachment pipeline.\n files.push(file);\n }\n }\n }\n\n return {\n text: pastedTextBlocks.length\n ? [rawText.trim(), ...pastedTextBlocks].filter(Boolean).join(\"\\n\\n\")\n : rawText,\n files,\n };\n}\n\nfunction getImageSrc(attachment: Attachment): string | null {\n if (attachment.type !== \"image\") return null;\n if (\"file\" in attachment && attachment.file) {\n return URL.createObjectURL(attachment.file);\n }\n const imagePart = attachment.content?.find((part) => part.type === \"image\");\n return imagePart && \"image\" in imagePart ? imagePart.image : null;\n}\n\nfunction ImagePreviewLightbox({\n src,\n alt,\n onClose,\n}: {\n src: string;\n alt: string;\n onClose: () => void;\n}) {\n useEffect(() => {\n const handler = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onClose();\n };\n document.addEventListener(\"keydown\", handler);\n document.body.style.overflow = \"hidden\";\n return () => {\n document.removeEventListener(\"keydown\", handler);\n document.body.style.overflow = \"\";\n };\n }, [onClose]);\n\n return (\n <div\n role=\"dialog\"\n aria-label=\"Image preview\"\n onClick={onClose}\n className=\"fixed inset-0 z-[300] flex items-center justify-center bg-black/80 p-6 cursor-zoom-out\"\n >\n <img\n src={src}\n alt={alt}\n onClick={(e) => e.stopPropagation()}\n className=\"max-h-full max-w-full object-contain rounded-md shadow-2xl cursor-default\"\n />\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close preview\"\n className=\"absolute right-4 top-4 flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-white/30 bg-black/40 text-white hover:bg-black/60\"\n >\n <IconX className=\"h-4 w-4\" />\n </button>\n </div>\n );\n}\n\nfunction AttachmentChip({\n attachment,\n onRemove,\n}: {\n attachment: Attachment;\n onRemove: (id: string) => void;\n}) {\n const src = useMemo(() => getImageSrc(attachment), [attachment]);\n const [previewOpen, setPreviewOpen] = useState(false);\n useEffect(\n () => () => {\n if (src?.startsWith(\"blob:\")) URL.revokeObjectURL(src);\n },\n [src],\n );\n\n if (isPastedTextAttachmentName(attachment.name)) {\n return <PastedTextChip attachment={attachment} onRemove={onRemove} />;\n }\n\n if (src) {\n return (\n <>\n <button\n type=\"button\"\n onClick={() => setPreviewOpen(true)}\n aria-label={`Preview ${attachment.name}`}\n className=\"agent-composer-attachment-image group relative flex h-16 min-w-16 max-w-28 cursor-zoom-in items-center justify-center overflow-hidden rounded-lg border border-border/70 bg-muted/50\"\n >\n <img\n src={src}\n alt={attachment.name}\n className=\"max-h-full max-w-full object-contain p-1\"\n />\n <span\n role=\"button\"\n tabIndex={0}\n onClick={(e) => {\n e.stopPropagation();\n onRemove(attachment.id);\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n e.stopPropagation();\n onRemove(attachment.id);\n }\n }}\n aria-label={`Remove ${attachment.name}`}\n className=\"absolute right-1 top-1 flex h-5 w-5 cursor-pointer items-center justify-center rounded-full border border-border/60 bg-background/90 text-muted-foreground hover:text-foreground\"\n >\n <IconX className=\"h-3 w-3\" />\n </span>\n </button>\n {previewOpen ? (\n <ImagePreviewLightbox\n src={src}\n alt={attachment.name}\n onClose={() => setPreviewOpen(false)}\n />\n ) : null}\n </>\n );\n }\n\n return (\n <div className=\"agent-composer-attachment-chip group relative inline-flex max-w-[200px] items-center gap-2 rounded-md border border-border/70 bg-muted/50 px-2 py-1.5 text-xs\">\n <div className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded bg-background text-[9px] font-semibold uppercase text-muted-foreground\">\n {attachment.name.split(\".\").pop() || \"file\"}\n </div>\n <span className=\"min-w-0 truncate font-medium\">{attachment.name}</span>\n <button\n type=\"button\"\n onClick={() => onRemove(attachment.id)}\n aria-label={`Remove ${attachment.name}`}\n className=\"flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded text-muted-foreground hover:text-foreground\"\n >\n <IconX className=\"h-3 w-3\" />\n </button>\n </div>\n );\n}\n\nfunction PromptAttachmentStrip() {\n const attachments = useComposer((state) => state.attachments);\n const aui = useAui();\n\n const handleRemove = useCallback(\n (id: string) => {\n void aui.composer().attachment({ id }).remove();\n },\n [aui],\n );\n\n if (attachments.length === 0) return null;\n return (\n <div className=\"agent-composer-attachment-strip flex flex-wrap gap-2 px-2 pt-2\">\n {attachments.map((attachment) => (\n <AttachmentChip\n key={attachment.id}\n attachment={attachment}\n onRemove={handleRemove}\n />\n ))}\n </div>\n );\n}\n\nfunction PromptComposerInner({\n onSubmit,\n placeholder,\n disabled,\n autoFocus,\n className,\n style,\n rootClassName,\n rootStyle,\n draftScope,\n preserveDraftOnSubmit = false,\n showModelSelector = true,\n voiceEnabled = DEFAULT_VOICE_DICTATION_ENABLED,\n attachmentsEnabled = true,\n plusMenuMode,\n initialText,\n initialTextKey,\n modeControl,\n toolbarSlot,\n attachButton,\n actionButton,\n extraActionButton,\n layoutVariant,\n slashCommands,\n slashSkills,\n includeDefaultSlashCommands,\n includeDefaultSlashSkills,\n onSlashCommand,\n availableModels,\n selectedModel,\n selectedEngine,\n selectedEffort,\n onModelChange,\n onEffortChange,\n modelStatusChecksEnabled,\n onTextChange,\n onConnectProvider,\n composerRef,\n}: PromptComposerProps) {\n const localRef = useRef<TiptapComposerHandle>(null);\n const handleRef = composerRef ?? localRef;\n const hostManagedModels = Boolean(\n availableModels && selectedModel && onModelChange,\n );\n const resolvedModelStatusChecksEnabled =\n modelStatusChecksEnabled ?? !hostManagedModels;\n const models = useChatModels({\n enabled: showModelSelector && resolvedModelStatusChecksEnabled,\n });\n const composerModel = showModelSelector\n ? (selectedModel ?? models.selectedModel)\n : undefined;\n const composerEngine = showModelSelector\n ? (selectedEngine ?? models.selectedEngine)\n : undefined;\n const composerEffort = showModelSelector\n ? (selectedEffort ?? models.selectedEffort)\n : undefined;\n const composerModelGroups = showModelSelector\n ? (availableModels ?? models.availableModels)\n : undefined;\n const handleModelChange = showModelSelector\n ? (onModelChange ?? models.onModelChange)\n : undefined;\n const handleEffortChange = showModelSelector\n ? (onEffortChange ?? models.onEffortChange)\n : undefined;\n\n useEffect(() => {\n if (!autoFocus) return;\n const id = window.setTimeout(() => {\n const target =\n typeof handleRef === \"object\" && handleRef && \"current\" in handleRef\n ? handleRef.current\n : null;\n target?.focus();\n }, 50);\n return () => window.clearTimeout(id);\n }, [autoFocus, handleRef]);\n\n const handleSubmit = useCallback(\n async (\n text: string,\n references: Reference[],\n attachments?: ReadonlyArray<unknown>,\n submitOptions?: TiptapComposerSubmitOptions,\n ) => {\n // PromptComposer hosts (NewWorkspaceAppFlow, create-extension, create-deck,\n // …) submit a single string prompt — they don't run the assistant-ui\n // attachment send pipeline. TiptapComposer auto-converts large pastes\n // into a \"Pasted text\" chip, which would otherwise disappear into an\n // unprocessed File. Inline the chip body back into the prompt text so\n // newlines and full content survive the round-trip.\n const { text: finalText, files } = await buildPromptComposerSubmission({\n text,\n attachments,\n });\n onSubmit(finalText, files, references, {\n intent: submitOptions?.intent ?? \"immediate\",\n model: composerModel,\n engine: composerEngine,\n effort: composerEffort,\n });\n },\n [composerEffort, composerEngine, composerModel, onSubmit],\n );\n\n return (\n <AgentComposerFrame\n className={cn(\"text-left\", className)}\n rootClassName={rootClassName}\n style={style}\n rootStyle={rootStyle}\n layoutVariant={layoutVariant}\n >\n <PromptAttachmentStrip />\n <TiptapComposer\n focusRef={handleRef}\n disabled={disabled}\n placeholder={placeholder}\n initialText={initialText}\n initialTextKey={initialTextKey}\n onSubmit={handleSubmit}\n clearOnSubmit={!preserveDraftOnSubmit}\n plusMenuMode={\n plusMenuMode ?? (attachmentsEnabled ? \"upload-only\" : \"hidden\")\n }\n attachButton={attachButton}\n modeControl={modeControl}\n toolbarSlot={toolbarSlot}\n actionButton={actionButton}\n extraActionButton={extraActionButton}\n layoutVariant={layoutVariant}\n slashCommands={slashCommands}\n slashSkills={slashSkills}\n includeDefaultSlashCommands={includeDefaultSlashCommands}\n includeDefaultSlashSkills={includeDefaultSlashSkills}\n onSlashCommand={onSlashCommand}\n voiceEnabled={voiceEnabled}\n onTextChange={onTextChange}\n draftScope={draftScope}\n selectedModel={composerModel}\n selectedEffort={composerEffort}\n availableModels={composerModelGroups}\n onModelChange={handleModelChange}\n onEffortChange={handleEffortChange}\n providerConnectStatusEnabled={resolvedModelStatusChecksEnabled}\n onConnectProvider={onConnectProvider}\n />\n </AgentComposerFrame>\n );\n}\n\n/**\n * Standalone composer that mirrors the agent sidebar's input experience —\n * voice dictation, file upload, model selector, submit-on-Enter — for use in\n * popovers and inline prompt forms (create tool, create deck, create dashboard,\n * the Dispatch new-app flow, etc.).\n *\n * The host owns submission: when the user presses Enter or clicks submit,\n * `onSubmit(text, files, references, options)` is called. PromptComposer runs\n * its own minimal assistant-ui runtime so it can be dropped into any subtree\n * without needing the outer chat to be mounted.\n */\nexport function PromptComposer(props: PromptComposerProps) {\n const attachmentAdapter = useMemo(\n () =>\n new CompositeAttachmentAdapter([\n new RasterImageAttachmentAdapter(),\n new BinaryDocumentAttachmentAdapter(),\n new TextAttachmentAdapter(),\n ]),\n [],\n );\n const runtime = useLocalRuntime(NOOP_ADAPTER, {\n adapters: { attachments: attachmentAdapter },\n });\n const resetKey = [\n props.draftScope ?? \"\",\n props.initialTextKey ?? \"\",\n props.initialText ?? \"\",\n ].join(\":\");\n\n return (\n <TooltipProvider delayDuration={200}>\n <AssistantRuntimeProvider runtime={runtime}>\n <ThreadPrimitive.Root\n className=\"contents\"\n style={{ display: \"contents\" }}\n >\n <AssistantUiStaleIndexErrorBoundary\n resetKey={resetKey}\n componentName=\"PromptComposer\"\n >\n <PromptComposerInner {...props} />\n </AssistantUiStaleIndexErrorBoundary>\n </ThreadPrimitive.Root>\n </AssistantRuntimeProvider>\n </TooltipProvider>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PromptComposer.js","sourceRoot":"","sources":["../../../src/client/composer/PromptComposer.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAC;AACf,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,MAAM,EACN,WAAW,EACX,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAQ7B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U,IAAI,EAAE;QACtB,KAAK,CAAC,cAAc,IAAI,EAAE;QAC1B,KAAK,CAAC,WAAW,IAAI,EAAE;KACxB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEZ,OAAO,CACL,KAAC,eAAe,IAAC,aAAa,EAAE,GAAG,YACjC,KAAC,wBAAwB,IAAC,OAAO,EAAE,OAAO,YACxC,KAAC,eAAe,CAAC,IAAI,IACnB,SAAS,EAAC,UAAU,EACpB,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,YAE9B,KAAC,kCAAkC,IACjC,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAC,gBAAgB,YAE9B,KAAC,mBAAmB,OAAK,KAAK,GAAI,GACC,GAChB,GACE,GACX,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type Ref,\n type ReactNode,\n} from \"react\";\nimport {\n AssistantRuntimeProvider,\n ThreadPrimitive,\n useAui,\n useComposer,\n useLocalRuntime,\n} from \"@assistant-ui/react\";\nimport type {\n Attachment,\n AttachmentAdapter,\n ChatModelAdapter,\n CompleteAttachment,\n PendingAttachment,\n} from \"@assistant-ui/react\";\nimport {\n CompositeAttachmentAdapter,\n SimpleImageAttachmentAdapter,\n} from \"@assistant-ui/react\";\nimport { IconX } from \"@tabler/icons-react\";\nimport { cn } from \"../utils.js\";\nimport { AgentComposerFrame } from \"./AgentComposerFrame.js\";\nimport {\n DEFAULT_VOICE_DICTATION_ENABLED,\n TiptapComposer,\n type ComposerSubmitIntent,\n type TiptapComposerHandle,\n type TiptapComposerSubmitOptions,\n} from \"./TiptapComposer.js\";\nimport { IMAGE_ATTACHMENT_ACCEPT } from \"./attachment-accept.js\";\nimport type {\n AgentComposerLayoutVariant,\n Reference,\n SkillResult,\n SlashCommand,\n} from \"./types.js\";\nimport { useChatModels, type EngineModelGroup } from \"../use-chat-models.js\";\nimport { TooltipProvider } from \"../components/ui/tooltip.js\";\nimport { AssistantUiStaleIndexErrorBoundary } from \"../assistant-ui-recovery.js\";\nimport type { ReasoningEffort } from \"../../shared/reasoning-effort.js\";\nimport { isPastedTextAttachmentName } from \"./pasted-text.js\";\nimport { PastedTextChip } from \"./PastedTextChip.js\";\nimport {\n PROMPT_DOCUMENT_ATTACHMENT_ACCEPT,\n TextAttachmentAdapter,\n} from \"./attachment-accept.js\";\nimport { escapePromptAttachmentAttribute } from \"./prompt-attachments.js\";\n\nconst MAX_INLINE_TEXT_FILE_CHARS = 60_000;\n\n/**\n * Files the user attached via the \"+\" button in PromptComposer. The host owns\n * what to do with them — typically POST to a per-app upload endpoint and pass\n * the resulting URLs/paths into the prompt that gets sent to the agent.\n */\nexport type PromptComposerFile = File;\n\nexport interface PromptComposerSubmitOptions {\n intent?: ComposerSubmitIntent;\n model?: string;\n engine?: string;\n effort?: ReasoningEffort;\n}\n\nexport interface PromptComposerProps {\n /** Called when the user submits the composer. */\n onSubmit: (\n text: string,\n files: PromptComposerFile[],\n references: Reference[],\n options: PromptComposerSubmitOptions,\n ) => void;\n placeholder?: string;\n disabled?: boolean;\n autoFocus?: boolean;\n className?: string;\n style?: CSSProperties;\n rootClassName?: string;\n rootStyle?: CSSProperties;\n /** Forwarded to TiptapComposer for draft persistence. */\n draftScope?: string;\n /** Keep the submitted prompt in the editor. Default: false. */\n preserveDraftOnSubmit?: boolean;\n /** Show the model selector (default: true). */\n showModelSelector?: boolean;\n /** Show the voice dictation button. Defaults to DEFAULT_VOICE_DICTATION_ENABLED. */\n voiceEnabled?: boolean;\n /** Show file upload controls and pass submitted files to onSubmit (default: true). */\n attachmentsEnabled?: boolean;\n /**\n * Controls the shared \"+\" affordance. Defaults to upload-only for standalone\n * prompt forms; chat surfaces can opt into the full sidebar menu.\n */\n plusMenuMode?: \"full\" | \"upload-only\" | \"hidden\";\n /** Programmatically seed the composer with plain text. */\n initialText?: string;\n /** Stable key used to re-apply `initialText` when the host picks a preset. */\n initialTextKey?: string | number;\n /** Optional host-owned control rendered directly after the \"+\" button. */\n modeControl?: ReactNode;\n /** Explicit host-owned toolbar slot rendered directly after the \"+\" button. */\n toolbarSlot?: ReactNode;\n /** Custom attachment button to render instead of the default \"+\" affordance. */\n attachButton?: ReactNode;\n /** Custom action button to render instead of the default send button. */\n actionButton?: ReactNode;\n /** Extra button rendered alongside the default send button. */\n extraActionButton?: ReactNode;\n /** Shared sizing/layout variant for host surfaces. Default keeps sidebar behavior. */\n layoutVariant?: AgentComposerLayoutVariant;\n /** Additional slash commands surfaced in the shared / menu. */\n slashCommands?: SlashCommand[];\n /** Additional slash skills surfaced in the shared / menu. */\n slashSkills?: SkillResult[];\n /** Include built-in sidebar slash commands like /clear and /help. Default true. */\n includeDefaultSlashCommands?: boolean;\n /** Include app-discovered skills from the default agent endpoint. Default true. */\n includeDefaultSlashSkills?: boolean;\n /** Called when a slash command from the shared / menu is executed. */\n onSlashCommand?: (command: string) => void;\n /** External model list for hosts that already resolve models outside the app. */\n availableModels?: EngineModelGroup[];\n selectedModel?: string;\n selectedEngine?: string;\n selectedEffort?: ReasoningEffort;\n onModelChange?: (model: string, engine: string) => void;\n onEffortChange?: (effort: ReasoningEffort) => void;\n /**\n * Enable server-backed model/provider status checks. Defaults off when the\n * host supplies model state and callbacks, otherwise on.\n */\n modelStatusChecksEnabled?: boolean;\n /** Called whenever the plain editor text changes. */\n onTextChange?: (text: string) => void;\n /**\n * Override the Builder.io connect action in the model picker. When provided,\n * clicking \"Connect Builder.io\" calls this instead of opening a browser popup.\n * Used by the Electron desktop app to route through the native IPC handler.\n */\n onConnectProvider?: () => void;\n /** Imperative handle for focusing the composer. */\n composerRef?: Ref<TiptapComposerHandle>;\n}\n\n// Minimal pass-through adapter. PromptComposer always submits through\n// onSubmitOverride, so the runtime never actually calls this — but\n// `useLocalRuntime` needs *something* shaped like a ChatModelAdapter.\nconst NOOP_ADAPTER: ChatModelAdapter = {\n async *run() {\n return;\n },\n};\n\n/**\n * Local binary document adapter so reference PDFs, decks, and docs can be\n * attached without dragging the whole assistant chat module into bundles that\n * just want a prompt popover.\n */\nclass BinaryDocumentAttachmentAdapter implements AttachmentAdapter {\n public accept = PROMPT_DOCUMENT_ATTACHMENT_ACCEPT;\n\n public async add(state: { file: File }): Promise<PendingAttachment> {\n return {\n id: state.file.name,\n type: \"document\",\n name: state.file.name,\n contentType: state.file.type || \"application/octet-stream\",\n file: state.file,\n status: { type: \"requires-action\", reason: \"composer-send\" },\n };\n }\n\n public async send(\n attachment: PendingAttachment,\n ): Promise<CompleteAttachment> {\n return {\n ...attachment,\n status: { type: \"complete\" },\n content: [],\n };\n }\n\n public async remove() {\n /* noop */\n }\n}\n\nclass RasterImageAttachmentAdapter extends SimpleImageAttachmentAdapter {\n public accept = IMAGE_ATTACHMENT_ACCEPT;\n}\n\nfunction isInlineableTextFile(file: File): boolean {\n if (file.type.startsWith(\"text/\")) return true;\n if (file.type === \"application/json\") return true;\n return /\\.(txt|md|markdown|csv|json|yaml|yml|html?|css|xml)$/i.test(\n file.name,\n );\n}\n\nfunction formatInlineTextFile(name: string, text: string): string {\n const truncated = text.length > MAX_INLINE_TEXT_FILE_CHARS;\n const body = truncated ? text.slice(0, MAX_INLINE_TEXT_FILE_CHARS) : text;\n return [\n `<uploaded-text-file name=\"${escapePromptAttachmentAttribute(name)}\">`,\n body,\n truncated\n ? `[Truncated after ${MAX_INLINE_TEXT_FILE_CHARS} characters.]`\n : \"\",\n \"</uploaded-text-file>\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n}\n\nexport async function buildPromptComposerSubmission(options: {\n text: string;\n attachments?: ReadonlyArray<unknown>;\n}): Promise<{ text: string; files: File[] }> {\n const files: File[] = [];\n const pastedTextBlocks: string[] = [];\n const rawText = options.text;\n\n for (const att of options.attachments ?? []) {\n const a = att as Attachment;\n if (\"file\" in a && a.file instanceof File) {\n const file = a.file;\n if (isPastedTextAttachmentName(file.name)) {\n try {\n pastedTextBlocks.push(await file.text());\n } catch {\n files.push(file);\n }\n } else {\n if (isInlineableTextFile(file)) {\n try {\n pastedTextBlocks.push(\n formatInlineTextFile(file.name, await file.text()),\n );\n } catch {\n // Keep the upload path fallback below.\n }\n }\n // Note: images are NOT inlined into the prompt text even when small.\n // Inlining a base64 data-URL into a text string consumes an enormous\n // number of tokens (≈ 700 K per MB) and most hosts handle images via\n // proper attachment channels. The `files` array below carries the image\n // for the host to process through a dedicated attachment pipeline.\n files.push(file);\n }\n }\n }\n\n return {\n text: pastedTextBlocks.length\n ? [rawText.trim(), ...pastedTextBlocks].filter(Boolean).join(\"\\n\\n\")\n : rawText,\n files,\n };\n}\n\nfunction getImageSrc(attachment: Attachment): string | null {\n if (attachment.type !== \"image\") return null;\n if (\"file\" in attachment && attachment.file) {\n return URL.createObjectURL(attachment.file);\n }\n const imagePart = attachment.content?.find((part) => part.type === \"image\");\n return imagePart && \"image\" in imagePart ? imagePart.image : null;\n}\n\nfunction ImagePreviewLightbox({\n src,\n alt,\n onClose,\n}: {\n src: string;\n alt: string;\n onClose: () => void;\n}) {\n useEffect(() => {\n const handler = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onClose();\n };\n document.addEventListener(\"keydown\", handler);\n document.body.style.overflow = \"hidden\";\n return () => {\n document.removeEventListener(\"keydown\", handler);\n document.body.style.overflow = \"\";\n };\n }, [onClose]);\n\n return (\n <div\n role=\"dialog\"\n aria-label=\"Image preview\"\n onClick={onClose}\n className=\"fixed inset-0 z-[300] flex items-center justify-center bg-black/80 p-6 cursor-zoom-out\"\n >\n <img\n src={src}\n alt={alt}\n onClick={(e) => e.stopPropagation()}\n className=\"max-h-full max-w-full object-contain rounded-md shadow-2xl cursor-default\"\n />\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close preview\"\n className=\"absolute end-4 top-4 flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-white/30 bg-black/40 text-white hover:bg-black/60\"\n >\n <IconX className=\"h-4 w-4\" />\n </button>\n </div>\n );\n}\n\nfunction AttachmentChip({\n attachment,\n onRemove,\n}: {\n attachment: Attachment;\n onRemove: (id: string) => void;\n}) {\n const src = useMemo(() => getImageSrc(attachment), [attachment]);\n const [previewOpen, setPreviewOpen] = useState(false);\n useEffect(\n () => () => {\n if (src?.startsWith(\"blob:\")) URL.revokeObjectURL(src);\n },\n [src],\n );\n\n if (isPastedTextAttachmentName(attachment.name)) {\n return <PastedTextChip attachment={attachment} onRemove={onRemove} />;\n }\n\n if (src) {\n return (\n <>\n <button\n type=\"button\"\n onClick={() => setPreviewOpen(true)}\n aria-label={`Preview ${attachment.name}`}\n className=\"agent-composer-attachment-image group relative flex h-16 min-w-16 max-w-28 cursor-zoom-in items-center justify-center overflow-hidden rounded-lg border border-border/70 bg-muted/50\"\n >\n <img\n src={src}\n alt={attachment.name}\n className=\"max-h-full max-w-full object-contain p-1\"\n />\n <span\n role=\"button\"\n tabIndex={0}\n onClick={(e) => {\n e.stopPropagation();\n onRemove(attachment.id);\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n e.stopPropagation();\n onRemove(attachment.id);\n }\n }}\n aria-label={`Remove ${attachment.name}`}\n className=\"absolute end-1 top-1 flex h-5 w-5 cursor-pointer items-center justify-center rounded-full border border-border/60 bg-background/90 text-muted-foreground hover:text-foreground\"\n >\n <IconX className=\"h-3 w-3\" />\n </span>\n </button>\n {previewOpen ? (\n <ImagePreviewLightbox\n src={src}\n alt={attachment.name}\n onClose={() => setPreviewOpen(false)}\n />\n ) : null}\n </>\n );\n }\n\n return (\n <div className=\"agent-composer-attachment-chip group relative inline-flex max-w-[200px] items-center gap-2 rounded-md border border-border/70 bg-muted/50 px-2 py-1.5 text-xs\">\n <div className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded bg-background text-[9px] font-semibold uppercase text-muted-foreground\">\n {attachment.name.split(\".\").pop() || \"file\"}\n </div>\n <span className=\"min-w-0 truncate font-medium\">{attachment.name}</span>\n <button\n type=\"button\"\n onClick={() => onRemove(attachment.id)}\n aria-label={`Remove ${attachment.name}`}\n className=\"flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded text-muted-foreground hover:text-foreground\"\n >\n <IconX className=\"h-3 w-3\" />\n </button>\n </div>\n );\n}\n\nfunction PromptAttachmentStrip() {\n const attachments = useComposer((state) => state.attachments);\n const aui = useAui();\n\n const handleRemove = useCallback(\n (id: string) => {\n void aui.composer().attachment({ id }).remove();\n },\n [aui],\n );\n\n if (attachments.length === 0) return null;\n return (\n <div className=\"agent-composer-attachment-strip flex flex-wrap gap-2 px-2 pt-2\">\n {attachments.map((attachment) => (\n <AttachmentChip\n key={attachment.id}\n attachment={attachment}\n onRemove={handleRemove}\n />\n ))}\n </div>\n );\n}\n\nfunction PromptComposerInner({\n onSubmit,\n placeholder,\n disabled,\n autoFocus,\n className,\n style,\n rootClassName,\n rootStyle,\n draftScope,\n preserveDraftOnSubmit = false,\n showModelSelector = true,\n voiceEnabled = DEFAULT_VOICE_DICTATION_ENABLED,\n attachmentsEnabled = true,\n plusMenuMode,\n initialText,\n initialTextKey,\n modeControl,\n toolbarSlot,\n attachButton,\n actionButton,\n extraActionButton,\n layoutVariant,\n slashCommands,\n slashSkills,\n includeDefaultSlashCommands,\n includeDefaultSlashSkills,\n onSlashCommand,\n availableModels,\n selectedModel,\n selectedEngine,\n selectedEffort,\n onModelChange,\n onEffortChange,\n modelStatusChecksEnabled,\n onTextChange,\n onConnectProvider,\n composerRef,\n}: PromptComposerProps) {\n const localRef = useRef<TiptapComposerHandle>(null);\n const handleRef = composerRef ?? localRef;\n const hostManagedModels = Boolean(\n availableModels && selectedModel && onModelChange,\n );\n const resolvedModelStatusChecksEnabled =\n modelStatusChecksEnabled ?? !hostManagedModels;\n const models = useChatModels({\n enabled: showModelSelector && resolvedModelStatusChecksEnabled,\n });\n const composerModel = showModelSelector\n ? (selectedModel ?? models.selectedModel)\n : undefined;\n const composerEngine = showModelSelector\n ? (selectedEngine ?? models.selectedEngine)\n : undefined;\n const composerEffort = showModelSelector\n ? (selectedEffort ?? models.selectedEffort)\n : undefined;\n const composerModelGroups = showModelSelector\n ? (availableModels ?? models.availableModels)\n : undefined;\n const handleModelChange = showModelSelector\n ? (onModelChange ?? models.onModelChange)\n : undefined;\n const handleEffortChange = showModelSelector\n ? (onEffortChange ?? models.onEffortChange)\n : undefined;\n\n useEffect(() => {\n if (!autoFocus) return;\n const id = window.setTimeout(() => {\n const target =\n typeof handleRef === \"object\" && handleRef && \"current\" in handleRef\n ? handleRef.current\n : null;\n target?.focus();\n }, 50);\n return () => window.clearTimeout(id);\n }, [autoFocus, handleRef]);\n\n const handleSubmit = useCallback(\n async (\n text: string,\n references: Reference[],\n attachments?: ReadonlyArray<unknown>,\n submitOptions?: TiptapComposerSubmitOptions,\n ) => {\n // PromptComposer hosts (NewWorkspaceAppFlow, create-extension, create-deck,\n // …) submit a single string prompt — they don't run the assistant-ui\n // attachment send pipeline. TiptapComposer auto-converts large pastes\n // into a \"Pasted text\" chip, which would otherwise disappear into an\n // unprocessed File. Inline the chip body back into the prompt text so\n // newlines and full content survive the round-trip.\n const { text: finalText, files } = await buildPromptComposerSubmission({\n text,\n attachments,\n });\n onSubmit(finalText, files, references, {\n intent: submitOptions?.intent ?? \"immediate\",\n model: composerModel,\n engine: composerEngine,\n effort: composerEffort,\n });\n },\n [composerEffort, composerEngine, composerModel, onSubmit],\n );\n\n return (\n <AgentComposerFrame\n className={cn(\"text-start\", className)}\n rootClassName={rootClassName}\n style={style}\n rootStyle={rootStyle}\n layoutVariant={layoutVariant}\n >\n <PromptAttachmentStrip />\n <TiptapComposer\n focusRef={handleRef}\n disabled={disabled}\n placeholder={placeholder}\n initialText={initialText}\n initialTextKey={initialTextKey}\n onSubmit={handleSubmit}\n clearOnSubmit={!preserveDraftOnSubmit}\n plusMenuMode={\n plusMenuMode ?? (attachmentsEnabled ? \"upload-only\" : \"hidden\")\n }\n attachButton={attachButton}\n modeControl={modeControl}\n toolbarSlot={toolbarSlot}\n actionButton={actionButton}\n extraActionButton={extraActionButton}\n layoutVariant={layoutVariant}\n slashCommands={slashCommands}\n slashSkills={slashSkills}\n includeDefaultSlashCommands={includeDefaultSlashCommands}\n includeDefaultSlashSkills={includeDefaultSlashSkills}\n onSlashCommand={onSlashCommand}\n voiceEnabled={voiceEnabled}\n onTextChange={onTextChange}\n draftScope={draftScope}\n selectedModel={composerModel}\n selectedEffort={composerEffort}\n availableModels={composerModelGroups}\n onModelChange={handleModelChange}\n onEffortChange={handleEffortChange}\n providerConnectStatusEnabled={resolvedModelStatusChecksEnabled}\n onConnectProvider={onConnectProvider}\n />\n </AgentComposerFrame>\n );\n}\n\n/**\n * Standalone composer that mirrors the agent sidebar's input experience —\n * voice dictation, file upload, model selector, submit-on-Enter — for use in\n * popovers and inline prompt forms (create tool, create deck, create dashboard,\n * the Dispatch new-app flow, etc.).\n *\n * The host owns submission: when the user presses Enter or clicks submit,\n * `onSubmit(text, files, references, options)` is called. PromptComposer runs\n * its own minimal assistant-ui runtime so it can be dropped into any subtree\n * without needing the outer chat to be mounted.\n */\nexport function PromptComposer(props: PromptComposerProps) {\n const attachmentAdapter = useMemo(\n () =>\n new CompositeAttachmentAdapter([\n new RasterImageAttachmentAdapter(),\n new BinaryDocumentAttachmentAdapter(),\n new TextAttachmentAdapter(),\n ]),\n [],\n );\n const runtime = useLocalRuntime(NOOP_ADAPTER, {\n adapters: { attachments: attachmentAdapter },\n });\n const resetKey = [\n props.draftScope ?? \"\",\n props.initialTextKey ?? \"\",\n props.initialText ?? \"\",\n ].join(\":\");\n\n return (\n <TooltipProvider delayDuration={200}>\n <AssistantRuntimeProvider runtime={runtime}>\n <ThreadPrimitive.Root\n className=\"contents\"\n style={{ display: \"contents\" }}\n >\n <AssistantUiStaleIndexErrorBoundary\n resetKey={resetKey}\n componentName=\"PromptComposer\"\n >\n <PromptComposerInner {...props} />\n </AssistantUiStaleIndexErrorBoundary>\n </ThreadPrimitive.Root>\n </AssistantRuntimeProvider>\n </TooltipProvider>\n );\n}\n"]}
|
|
@@ -204,7 +204,7 @@ Prefer appAction()/appFetch() for app data. Some actions return JSON strings for
|
|
|
204
204
|
function ComposerModeChip({ mode, onRemove, }) {
|
|
205
205
|
const config = COMPOSER_MODE_CONFIGS[mode];
|
|
206
206
|
const Icon = config.icon;
|
|
207
|
-
return (_jsxs("span", { className: "inline-flex items-center gap-1 rounded-md border border-border bg-muted/50 px-1.5 py-0.5 text-xs font-medium text-foreground", children: [_jsx(Icon, { className: "h-3 w-3 text-muted-foreground" }), config.label, _jsx("button", { type: "button", onClick: onRemove, className: "
|
|
207
|
+
return (_jsxs("span", { className: "inline-flex items-center gap-1 rounded-md border border-border bg-muted/50 px-1.5 py-0.5 text-xs font-medium text-foreground", children: [_jsx(Icon, { className: "h-3 w-3 text-muted-foreground" }), config.label, _jsx("button", { type: "button", onClick: onRemove, className: "ms-0.5 rounded-sm text-muted-foreground hover:text-foreground cursor-pointer", children: _jsx(IconX, { className: "h-3 w-3" }) })] }));
|
|
208
208
|
}
|
|
209
209
|
function plainTextToDoc(text) {
|
|
210
210
|
const lines = text.length > 0 ? text.split(/\r?\n/) : [""];
|
|
@@ -252,12 +252,12 @@ function ModeSelector({ mode, onChange, planModeDisabled = false, planModeDisabl
|
|
|
252
252
|
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", "aria-label": mode === "build" ? "Act mode" : "Plan mode", "data-agent-composer-slot": "mode-button", className: "agent-composer-mode-button shrink-0 flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium text-muted-foreground hover:bg-accent/50 hover:text-foreground", children: [mode === "build" ? "Act" : "Plan", _jsx(IconChevronDown, { className: "h-3 w-3 opacity-60" })] }) }), _jsxs(PopoverContent, { side: "top", align: "end", sideOffset: 6, collisionPadding: 8, "data-agent-native-composer-popover": "true", className: "z-[260] w-60 rounded-lg border-border p-0 py-1 shadow-lg", style: { fontSize: 13 }, children: [_jsxs("button", { type: "button", onClick: () => {
|
|
253
253
|
onChange("build");
|
|
254
254
|
setOpen(false);
|
|
255
|
-
}, className: "flex w-full items-center gap-3 px-3 py-2 hover:bg-accent/50 text-
|
|
255
|
+
}, className: "flex w-full items-center gap-3 px-3 py-2 hover:bg-accent/50 text-start", children: [_jsx(IconPencil, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("span", { className: "font-medium text-foreground text-[13px]", children: "Act" }), _jsx("p", { className: "text-[11px] text-muted-foreground mt-0.5", children: "Use tools and make approved changes" })] }), mode === "build" && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }), _jsxs("button", { type: "button", disabled: planModeDisabled, title: planModeDisabled ? planModeDisabledReason : undefined, onClick: () => {
|
|
256
256
|
if (planModeDisabled)
|
|
257
257
|
return;
|
|
258
258
|
onChange("plan");
|
|
259
259
|
setOpen(false);
|
|
260
|
-
}, className: `flex w-full items-center gap-3 px-3 py-2 text-
|
|
260
|
+
}, className: `flex w-full items-center gap-3 px-3 py-2 text-start ${planModeDisabled
|
|
261
261
|
? "cursor-not-allowed opacity-60"
|
|
262
262
|
: "hover:bg-accent/50"}`, children: [_jsx(IconClipboardList, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("span", { className: "font-medium text-foreground text-[13px]", children: "Plan" }), _jsx("p", { className: "text-[11px] text-muted-foreground mt-0.5", children: planModeDisabled
|
|
263
263
|
? planModeDisabledReason
|
|
@@ -444,21 +444,21 @@ function ModelSelector({ model, effort = "auto", engines, onChange, onEffortChan
|
|
|
444
444
|
else {
|
|
445
445
|
builderFlow.start();
|
|
446
446
|
}
|
|
447
|
-
}, disabled: !onConnectProvider && builderFlow.connecting, className: "flex w-full items-start gap-2 px-3 py-2 text-
|
|
447
|
+
}, disabled: !onConnectProvider && builderFlow.connecting, className: "flex w-full items-start gap-2 px-3 py-2 text-start hover:bg-accent/50 disabled:opacity-60", children: [_jsx(IconPlugConnected, { className: "h-4 w-4 shrink-0 mt-0.5 text-blue-500" }), _jsxs("span", { className: "flex-1 min-w-0", children: [_jsx("span", { className: "block text-[12px] font-medium text-foreground", children: !onConnectProvider && builderFlow.connecting
|
|
448
448
|
? "Connecting Builder.io…"
|
|
449
|
-
: "Connect Builder.io" }), _jsx("span", { className: "block text-[11px] text-muted-foreground", children: "Free credits for Claude, OpenAI & Gemini" })] })] }), _jsx("div", { className: "my-1 border-t border-border" })] })), imageModel && imageModel.options.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex items-center hover:bg-accent/30", children: _jsxs("button", { type: "button", "aria-expanded": imageExpanded, onClick: () => setImageExpanded((prev) => !prev), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-
|
|
449
|
+
: "Connect Builder.io" }), _jsx("span", { className: "block text-[11px] text-muted-foreground", children: "Free credits for Claude, OpenAI & Gemini" })] })] }), _jsx("div", { className: "my-1 border-t border-border" })] })), imageModel && imageModel.options.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex items-center hover:bg-accent/30", children: _jsxs("button", { type: "button", "aria-expanded": imageExpanded, onClick: () => setImageExpanded((prev) => !prev), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-start", children: [imageExpanded ? (_jsx(IconChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground" })) : (_jsx(IconChevronRight, { className: "h-3 w-3 shrink-0 text-muted-foreground rtl:-scale-x-100" })), _jsx("span", { className: "text-[11px] font-medium text-muted-foreground uppercase tracking-wide shrink-0", children: imageModel.label ?? "Image model" }), !imageExpanded && imageModelLabel && (_jsx("span", { className: "text-[11px] text-muted-foreground/80 truncate", children: imageModelLabel }))] }) }), imageExpanded &&
|
|
450
450
|
imageModel.options.map((option) => (_jsxs("button", { type: "button", onClick: () => {
|
|
451
451
|
imageModel.onChange(option.value);
|
|
452
452
|
setImageExpanded(false);
|
|
453
|
-
}, className: "flex w-full items-center gap-3
|
|
453
|
+
}, className: "flex w-full items-center gap-3 ps-7 pe-3 py-1.5 text-start hover:bg-accent/50", children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: option.label }), option.value === imageModel.value && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }, option.value))), _jsx("div", { className: "my-1 border-t border-border" })] })), autoModelGroup && (_jsxs("button", { type: "button", onClick: () => {
|
|
454
454
|
onChange("auto", autoModelGroup.engine);
|
|
455
455
|
setOpen(false);
|
|
456
|
-
}, className: "flex w-full items-center gap-3 px-3 py-1.5 text-
|
|
456
|
+
}, className: "flex w-full items-center gap-3 px-3 py-1.5 text-start hover:bg-accent/50", children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: "Auto" }), model === "auto" && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] })), autoModelGroup && providerGroups.length > 0 && (_jsx("div", { className: "my-1 border-t border-border" })), providerGroups.map((group) => {
|
|
457
457
|
const models = latestModelsOnly(group.models);
|
|
458
458
|
const groupKey = `${group.engine}:${group.label}`;
|
|
459
459
|
const isExpanded = expandedGroups.has(groupKey);
|
|
460
460
|
const ChevronIcon = isExpanded ? IconChevronDown : IconChevronRight;
|
|
461
|
-
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center hover:bg-accent/30", children: [_jsxs("button", { type: "button", "aria-expanded": isExpanded, onClick: () => toggleGroup(groupKey), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-
|
|
461
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center hover:bg-accent/30", children: [_jsxs("button", { type: "button", "aria-expanded": isExpanded, onClick: () => toggleGroup(groupKey), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-start", children: [_jsx(ChevronIcon, { className: "h-3 w-3 shrink-0 text-muted-foreground rtl:-scale-x-100" }), _jsx("span", { className: "text-[11px] font-medium text-muted-foreground uppercase tracking-wide shrink-0", children: group.label }), !isExpanded && groupKey === selectedGroupKey && (_jsx("span", { className: "text-[11px] text-muted-foreground/80 truncate", children: friendlyModelName(model) }))] }), !group.configured && (_jsx("button", { type: "button", className: "text-[10px] text-muted-foreground/60 hover:text-foreground cursor-pointer pe-3 py-1.5", onClick: openLlmSettings, children: "needs API key" }))] }), isExpanded &&
|
|
462
462
|
models.map((m) => (_jsxs("button", { type: "button", onClick: () => {
|
|
463
463
|
if (!group.configured) {
|
|
464
464
|
openLlmSettings();
|
|
@@ -472,11 +472,11 @@ function ModelSelector({ model, effort = "auto", engines, onChange, onEffortChan
|
|
|
472
472
|
onEffortChange?.("auto");
|
|
473
473
|
}
|
|
474
474
|
setOpen(false);
|
|
475
|
-
}, className: `flex w-full items-center gap-3
|
|
475
|
+
}, className: `flex w-full items-center gap-3 ps-7 pe-3 py-1.5 text-start ${group.configured
|
|
476
476
|
? "hover:bg-accent/50"
|
|
477
477
|
: "opacity-40 cursor-default"}`, children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: friendlyModelName(m) }), m === model && group.configured && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }, m)))] }, groupKey));
|
|
478
|
-
}), effortOptions.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "my-1 border-t border-border" }), _jsx("div", { className: "flex items-center hover:bg-accent/30", children: _jsxs("button", { type: "button", "aria-expanded": reasoningExpanded, onClick: () => setReasoningExpanded((prev) => !prev), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-
|
|
479
|
-
effortOptions.map((option) => (_jsxs("button", { type: "button", onClick: () => onEffortChange?.(option), className: "flex w-full items-center gap-3
|
|
478
|
+
}), effortOptions.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "my-1 border-t border-border" }), _jsx("div", { className: "flex items-center hover:bg-accent/30", children: _jsxs("button", { type: "button", "aria-expanded": reasoningExpanded, onClick: () => setReasoningExpanded((prev) => !prev), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-start", children: [reasoningExpanded ? (_jsx(IconChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground" })) : (_jsx(IconChevronRight, { className: "h-3 w-3 shrink-0 text-muted-foreground rtl:-scale-x-100" })), _jsx("span", { className: "text-[11px] font-medium text-muted-foreground uppercase tracking-wide shrink-0", children: "Reasoning" }), !reasoningExpanded && (_jsx("span", { className: "text-[11px] text-muted-foreground/80 truncate", children: reasoningEffortLabel(effort) }))] }) }), reasoningExpanded &&
|
|
479
|
+
effortOptions.map((option) => (_jsxs("button", { type: "button", onClick: () => onEffortChange?.(option), className: "flex w-full items-center gap-3 ps-7 pe-3 py-1.5 text-start hover:bg-accent/50", children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: reasoningEffortLabel(option) }), option === effort && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }, option)))] }))] })] }));
|
|
480
480
|
}
|
|
481
481
|
export function TiptapComposer({ placeholder = "Message agent...", disabled = false, focusRef, initialText, initialTextKey, onSubmit, clearOnSubmit = true, onTextChange, actionButton, extraActionButton, attachButton, modeControl, toolbarSlot, layoutVariant = "default", slashCommands = [], slashSkills = [], includeDefaultSlashCommands = true, includeDefaultSlashSkills = true, onSlashCommand, execMode, onExecModeChange, planModeDisabled = false, planModeDisabledReason, voiceEnabled = DEFAULT_VOICE_DICTATION_ENABLED, selectedModel, selectedEffort, availableModels, onModelChange, onEffortChange, providerConnectStatusEnabled, onConnectProvider, imageModelMenu, draftScope, contextItems = [], onRemoveContextItem, plusMenuMode = "full", interceptBuildRequestsForBuilder = false, onAttachmentError, }) {
|
|
482
482
|
const [popover, setPopover] = useState(null);
|
|
@@ -1373,7 +1373,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1373
1373
|
setComposerMode(null);
|
|
1374
1374
|
composerModeRef.current = null;
|
|
1375
1375
|
editor?.commands.focus("end");
|
|
1376
|
-
} }) })), hasContextItems && (_jsx("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "context-row", className: "agent-composer-context-row flex flex-wrap gap-1.5 px-2.5 pt-2 pb-0", children: contextItems.map((item) => (_jsxs("span", { className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted/50 px-2 py-1 text-[11px] font-medium text-foreground", children: [_jsx(IconClipboardList, { className: "h-3 w-3 shrink-0 text-muted-foreground" }), _jsx("span", { className: "min-w-0 truncate", children: item.title }), _jsx("button", { type: "button", onClick: () => onRemoveContextItem?.(item.key), "aria-label": `Remove ${item.title} context`, className: "
|
|
1376
|
+
} }) })), hasContextItems && (_jsx("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "context-row", className: "agent-composer-context-row flex flex-wrap gap-1.5 px-2.5 pt-2 pb-0", children: contextItems.map((item) => (_jsxs("span", { className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted/50 px-2 py-1 text-[11px] font-medium text-foreground", children: [_jsx(IconClipboardList, { className: "h-3 w-3 shrink-0 text-muted-foreground" }), _jsx("span", { className: "min-w-0 truncate", children: item.title }), _jsx("button", { type: "button", onClick: () => onRemoveContextItem?.(item.key), "aria-label": `Remove ${item.title} context`, className: "ms-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground", children: _jsx(IconX, { className: "h-3 w-3" }) })] }, item.key))) })), _jsx("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "editor-wrap", className: `agent-composer-editor-wrap ${composerMode || hasContextItems ? "px-2 pt-1 pb-1" : "px-2 pt-2 pb-1"}`, children: _jsx(EditorContent, { editor: editor, "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "editor", className: "agent-composer-editor aui-composer flex-1 min-w-0 [&_.ProseMirror]:outline-none [&_.ProseMirror_p]:m-0 px-0.5" }) }), voiceEnabled && _jsx(VoiceRecordingOverlay, { voice: voice }), _jsxs("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "toolbar", className: "agent-composer-toolbar flex items-center gap-1 px-2 py-1.5", children: [attachButton ??
|
|
1377
1377
|
(plusMenuMode === "hidden" ? null : (_jsx(ComposerPlusMenu, { onSelectMode: handleSelectMode, mode: plusMenuMode, onAttachmentError: onAttachmentError }))), toolbarSlot ?? modeControl, _jsx("div", { "data-agent-composer-slot": "toolbar-spacer", className: "flex-1" }), selectedModel && availableModels && onModelChange && (_jsx(ModelSelector, { model: selectedModel, effort: selectedEffort, engines: availableModels, onChange: onModelChange, onEffortChange: onEffortChange, providerConnectStatusEnabled: providerConnectStatusEnabled, onConnectProvider: onConnectProvider, imageModel: imageModelMenu })), execMode && onExecModeChange && (_jsx(ModeSelector, { mode: execMode, onChange: onExecModeChange, planModeDisabled: planModeDisabled, planModeDisabledReason: planModeDisabledReason })), actionButton ?? (_jsxs(_Fragment, { children: [extraActionButton, voiceEnabled && (_jsx(VoiceButton, { voice: voice, isMac: isMac, disabled: disabled })), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: () => submitComposer("immediate"), disabled: !canSend, "data-agent-composer-slot": "send-button", className: "agent-composer-send-button shrink-0 flex h-7 w-7 items-center justify-center rounded-md bg-primary text-primary-foreground hover:opacity-90 disabled:opacity-30 disabled:cursor-not-allowed", children: _jsx(IconArrowUp, { className: "h-3.5 w-3.5" }) }) }), _jsx(TooltipContent, { children: "Send message" })] })] }))] }), _jsx(MentionPopover, { ref: popoverRef, type: popover?.type ?? "@", position: popover?.position ?? null, mentionItems: mentionItems, skills: filteredSkills, commands: filteredCommands, hint: hint, isLoading: popover?.type === "@" ? mentionsLoading : skillsLoading, query: popover?.query ?? "", onSelectMention: handleSelectMention, onSelectSkill: handleSelectSkill, onSelectCommand: handleSelectCommand, onClose: closePopover })] }));
|
|
1378
1378
|
}
|
|
1379
1379
|
//# sourceMappingURL=TiptapComposer.js.map
|