@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutomationsSection.js","sourceRoot":"","sources":["../../../src/client/settings/AutomationsSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EACL,QAAQ,EACR,SAAS,EACT,WAAW,EACX,cAAc,EACd,QAAQ,EACR,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AAuCrC,SAAS,WAAW,CAAC,KAAiB;IACpC,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;Y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AE,oCAAoC;KAC9C,CAAC;IAEF,OAAO,CACL,eACE,SAAS,EAAE,+EAA+E,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,YAE3H,MAAM,GACF,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { agentNativePath } from \"../api-path.js\";\nimport { useEffect, useState, useCallback } from \"react\";\nimport {\n IconBolt,\n IconClock,\n IconLoader2,\n IconPlayerPlay,\n IconPlus,\n IconTrash,\n} from \"@tabler/icons-react\";\nimport { sendToAgentChat } from \"../agent-chat.js\";\nimport { PromptComposer } from \"../composer/PromptComposer.js\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../components/ui/popover.js\";\n\ninterface TreeNode {\n name: string;\n path: string;\n type: \"file\" | \"folder\";\n kind?: string;\n children?: TreeNode[];\n resource?: {\n id: string;\n path: string;\n owner: string;\n mimeType: string;\n size: number;\n createdAt: number;\n updatedAt: number;\n };\n jobMeta?: {\n schedule?: string;\n scheduleDescription?: string;\n enabled?: boolean;\n lastStatus?: string;\n lastRun?: string;\n nextRun?: string;\n };\n}\n\ninterface AutomationItem {\n id: string;\n name: string;\n path: string;\n schedule?: string;\n scheduleDescription?: string;\n enabled: boolean;\n lastStatus?: string;\n lastRun?: string;\n nextRun?: string;\n}\n\nfunction flattenJobs(nodes: TreeNode[]): AutomationItem[] {\n const items: AutomationItem[] = [];\n for (const node of nodes) {\n if (node.type === \"folder\" && node.children) {\n items.push(...flattenJobs(node.children));\n }\n if (\n node.type === \"file\" &&\n node.kind === \"job\" &&\n node.resource &&\n node.jobMeta\n ) {\n const name = node.name.replace(/\\.md$/, \"\").replace(/-/g, \" \");\n items.push({\n id: node.resource.id,\n name,\n path: node.resource.path,\n schedule: node.jobMeta.schedule,\n scheduleDescription: node.jobMeta.scheduleDescription,\n enabled: node.jobMeta.enabled ?? false,\n lastStatus: node.jobMeta.lastStatus,\n lastRun: node.jobMeta.lastRun,\n nextRun: node.jobMeta.nextRun,\n });\n }\n }\n return items;\n}\n\nexport function AutomationsSection() {\n const [automations, setAutomations] = useState<AutomationItem[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n const [togglingId, setTogglingId] = useState<string | null>(null);\n const [deletingId, setDeletingId] = useState<string | null>(null);\n const [confirmDeleteId, setConfirmDeleteId] = useState<string | null>(null);\n const [toast, setToast] = useState<{\n kind: \"ok\" | \"err\";\n text: string;\n } | null>(null);\n const [reloadToken, setReloadToken] = useState(0);\n\n const showToast = useCallback(\n (kind: \"ok\" | \"err\", text: string, ms = 2500) => {\n setToast({ kind, text });\n setTimeout(() => setToast(null), ms);\n },\n [],\n );\n\n useEffect(() => {\n let cancelled = false;\n setLoading(true);\n fetch(agentNativePath(\"/_agent-native/resources/tree\"))\n .then(async (r) => {\n if (!r.ok) throw new Error(`Failed to load (${r.status})`);\n return (await r.json()) as { tree: TreeNode[] };\n })\n .then(({ tree }) => {\n if (cancelled) return;\n const jobsFolder = tree.find(\n (n) => n.name === \"jobs\" && n.type === \"folder\",\n );\n const items = jobsFolder?.children\n ? flattenJobs(jobsFolder.children)\n : [];\n setAutomations(items);\n setLoading(false);\n })\n .catch((err) => {\n if (cancelled) return;\n setError(err?.message ?? \"Failed to load\");\n setLoading(false);\n });\n return () => {\n cancelled = true;\n };\n }, [reloadToken]);\n\n const reload = useCallback(() => setReloadToken((t) => t + 1), []);\n\n const handleToggle = useCallback(\n async (item: AutomationItem) => {\n setTogglingId(item.id);\n try {\n const res = await fetch(\n agentNativePath(\n `/_agent-native/resources/${encodeURIComponent(item.id)}`,\n ),\n );\n if (!res.ok) {\n showToast(\"err\", \"Failed to read automation\");\n return;\n }\n const resource = await res.json();\n const content: string = resource.content ?? \"\";\n\n const newEnabled = !item.enabled;\n const updated = content.replace(\n /^(enabled:\\s*)(true|false)/m,\n `$1${newEnabled}`,\n );\n\n const putRes = await fetch(\n agentNativePath(\n `/_agent-native/resources/${encodeURIComponent(item.id)}`,\n ),\n {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ content: updated }),\n },\n );\n if (!putRes.ok) {\n showToast(\"err\", \"Failed to update automation\");\n return;\n }\n showToast(\"ok\", newEnabled ? \"Enabled\" : \"Disabled\");\n reload();\n } finally {\n setTogglingId(null);\n }\n },\n [reload, showToast],\n );\n\n const handleDelete = useCallback(\n async (item: AutomationItem) => {\n setDeletingId(item.id);\n try {\n const res = await fetch(\n agentNativePath(\n `/_agent-native/resources/${encodeURIComponent(item.id)}`,\n ),\n {\n method: \"DELETE\",\n headers: { \"Content-Type\": \"application/json\" },\n },\n );\n if (!res.ok) {\n showToast(\"err\", \"Failed to delete automation\");\n return;\n }\n showToast(\"ok\", \"Deleted\");\n setConfirmDeleteId(null);\n reload();\n } finally {\n setDeletingId(null);\n }\n },\n [reload, showToast],\n );\n\n const handleFireTestEvent = useCallback(async () => {\n showToast(\"ok\", \"Firing test event...\");\n try {\n const res = await fetch(\n agentNativePath(\"/_agent-native/automations/fire-test\"),\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ data: {} }),\n },\n );\n if (!res.ok) {\n showToast(\"err\", `Failed to fire event (${res.status})`);\n return;\n }\n showToast(\"ok\", \"Event fired\");\n } catch (err: any) {\n showToast(\"err\", err?.message ?? \"Failed to fire event\");\n }\n }, [showToast]);\n\n const [newOpen, setNewOpen] = useState(false);\n const [newScope, setNewScope] = useState<\"personal\" | \"organization\">(\n \"personal\",\n );\n\n const handleNewSubmit = useCallback(\n (text: string) => {\n const trimmed = text.trim();\n if (!trimmed) return;\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:set-mode\", {\n detail: { mode: \"chat\" },\n }),\n );\n sendToAgentChat({\n message: trimmed,\n context: `The user wants to create a new automation. Scope: ${newScope}. Use manage-automations with action=define to create it. Ask clarifying questions if needed about what event to trigger on, conditions, and what actions to take.`,\n submit: true,\n newTab: true,\n });\n setNewOpen(false);\n },\n [newScope],\n );\n\n if (error) {\n return (\n <p className=\"text-[10px] text-red-500\">\n Failed to load automations: {error}\n </p>\n );\n }\n\n if (loading) {\n return (\n <div className=\"flex items-center gap-1.5 text-[10px] text-muted-foreground\">\n <IconLoader2 size={10} className=\"animate-spin\" />\n Loading...\n </div>\n );\n }\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-1.5\">\n <Popover open={newOpen} onOpenChange={setNewOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n <IconPlus size={10} />\n New Automation\n </button>\n </PopoverTrigger>\n <PopoverContent\n align=\"start\"\n sideOffset={6}\n collisionPadding={8}\n className=\"z-[260] w-[calc(100vw-24px)] max-w-[380px] p-3\"\n >\n <p className=\"px-1 pb-2 text-sm font-semibold text-foreground\">\n New automation\n </p>\n <PromptComposer\n autoFocus\n placeholder=\"Describe what you want to automate...\"\n draftScope=\"automations:create\"\n onSubmit={handleNewSubmit}\n />\n <div className=\"mt-2\">\n <select\n value={newScope}\n onChange={(e) =>\n setNewScope(e.target.value as \"personal\" | \"organization\")\n }\n className=\"w-full cursor-pointer rounded-md border border-input bg-background px-3 py-1.5 text-[12px] text-foreground\"\n >\n <option value=\"personal\">Personal</option>\n <option value=\"organization\">Organization</option>\n </select>\n </div>\n </PopoverContent>\n </Popover>\n {automations.length > 0 && (\n <button\n type=\"button\"\n onClick={handleFireTestEvent}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n <IconPlayerPlay size={10} />\n Fire Test Event\n </button>\n )}\n </div>\n\n {automations.length === 0 ? (\n <p className=\"text-[10px] text-muted-foreground\">\n No automations yet. Click \"New Automation\" to create one, or ask the\n agent to set up a scheduled or event-triggered task.\n </p>\n ) : (\n automations.map((item) => (\n <div\n key={item.id}\n className=\"rounded-md border border-border px-2.5 py-2 bg-accent/30\"\n >\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-muted-foreground shrink-0\">\n {item.schedule ? (\n <IconClock size={11} />\n ) : (\n <IconBolt size={11} />\n )}\n </span>\n <span className=\"text-[11px] font-medium text-foreground truncate capitalize\">\n {item.name}\n </span>\n </div>\n {item.scheduleDescription && (\n <p className=\"text-[10px] text-muted-foreground mt-0.5 ml-[17px]\">\n {item.scheduleDescription}\n </p>\n )}\n {item.schedule && !item.scheduleDescription && (\n <p className=\"text-[10px] text-muted-foreground mt-0.5 ml-[17px] font-mono\">\n {item.schedule}\n </p>\n )}\n </div>\n <div className=\"flex items-center gap-1.5 shrink-0\">\n <StatusBadge status={item.lastStatus} />\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() => handleToggle(item)}\n disabled={togglingId === item.id}\n className={`rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide ${\n item.enabled\n ? \"bg-green-500/15 text-green-500\"\n : \"bg-accent/60 text-muted-foreground\"\n } hover:opacity-80 disabled:opacity-40`}\n >\n {togglingId === item.id ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : item.enabled ? (\n \"On\"\n ) : (\n \"Off\"\n )}\n </button>\n </TooltipTrigger>\n <TooltipContent>\n {item.enabled ? \"Disable\" : \"Enable\"}\n </TooltipContent>\n </Tooltip>\n {confirmDeleteId === item.id ? (\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => handleDelete(item)}\n disabled={deletingId === item.id}\n className=\"rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-red-500/15 text-red-500 hover:bg-red-500/25 disabled:opacity-40\"\n >\n {deletingId === item.id ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Confirm\"\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => setConfirmDeleteId(null)}\n className=\"rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-accent/60 text-muted-foreground hover:text-foreground\"\n >\n Cancel\n </button>\n </div>\n ) : (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() => setConfirmDeleteId(item.id)}\n className=\"text-muted-foreground hover:text-red-500 disabled:opacity-40\"\n >\n <IconTrash size={12} />\n </button>\n </TooltipTrigger>\n <TooltipContent>Delete</TooltipContent>\n </Tooltip>\n )}\n </div>\n </div>\n {item.lastRun && (\n <p className=\"text-[10px] text-muted-foreground mt-1 ml-[17px]\">\n Last run:{\" \"}\n {new Date(item.lastRun).toLocaleString(undefined, {\n month: \"short\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"2-digit\",\n })}\n </p>\n )}\n </div>\n ))\n )}\n\n {toast && (\n <p\n className={`text-[10px] ${toast.kind === \"ok\" ? \"text-green-500\" : \"text-red-500\"}`}\n >\n {toast.text}\n </p>\n )}\n </div>\n );\n}\n\nfunction StatusBadge({ status }: { status?: string }) {\n if (!status) return null;\n\n const styles: Record<string, string> = {\n success: \"bg-green-500/15 text-green-500\",\n error: \"bg-red-500/15 text-red-500\",\n running: \"bg-blue-500/15 text-blue-500\",\n skipped: \"bg-accent/60 text-muted-foreground\",\n };\n\n return (\n <span\n className={`rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide ${styles[status] ?? styles.skipped}`}\n >\n {status}\n </span>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AutomationsSection.js","sourceRoot":"","sources":["../../../src/client/settings/AutomationsSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EACL,QAAQ,EACR,SAAS,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I,EAAE,SAAS;gCACf,MAAM,EAAE,SAAS;6BAClB,CAAC,IACA,CACL,KAvGI,IAAI,CAAC,EAAE,CAwGR,CACP,CAAC,CACH,EAEA,KAAK,IAAI,CACR,YACE,SAAS,EAAE,eAAe,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAc,EAAE,YAElF,KAAK,CAAC,IAAI,GACT,CACL,IACG,CACP,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,MAAM,EAAuB;IAClD,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEzB,MAAM,MAAM,GAA2B;QACrC,OAAO,EAAE,gCAAgC;QACzC,KAAK,EAAE,4BAA4B;QACnC,OAAO,EAAE,8BAA8B;QACvC,OAAO,EAAE,oCAAoC;KAC9C,CAAC;IAEF,OAAO,CACL,eACE,SAAS,EAAE,+EAA+E,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,YAE3H,MAAM,GACF,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { agentNativePath } from \"../api-path.js\";\nimport { useEffect, useState, useCallback } from \"react\";\nimport {\n IconBolt,\n IconClock,\n IconLoader2,\n IconPlayerPlay,\n IconPlus,\n IconTrash,\n} from \"@tabler/icons-react\";\nimport { sendToAgentChat } from \"../agent-chat.js\";\nimport { PromptComposer } from \"../composer/PromptComposer.js\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../components/ui/popover.js\";\n\ninterface TreeNode {\n name: string;\n path: string;\n type: \"file\" | \"folder\";\n kind?: string;\n children?: TreeNode[];\n resource?: {\n id: string;\n path: string;\n owner: string;\n mimeType: string;\n size: number;\n createdAt: number;\n updatedAt: number;\n };\n jobMeta?: {\n schedule?: string;\n scheduleDescription?: string;\n enabled?: boolean;\n lastStatus?: string;\n lastRun?: string;\n nextRun?: string;\n };\n}\n\ninterface AutomationItem {\n id: string;\n name: string;\n path: string;\n schedule?: string;\n scheduleDescription?: string;\n enabled: boolean;\n lastStatus?: string;\n lastRun?: string;\n nextRun?: string;\n}\n\nfunction flattenJobs(nodes: TreeNode[]): AutomationItem[] {\n const items: AutomationItem[] = [];\n for (const node of nodes) {\n if (node.type === \"folder\" && node.children) {\n items.push(...flattenJobs(node.children));\n }\n if (\n node.type === \"file\" &&\n node.kind === \"job\" &&\n node.resource &&\n node.jobMeta\n ) {\n const name = node.name.replace(/\\.md$/, \"\").replace(/-/g, \" \");\n items.push({\n id: node.resource.id,\n name,\n path: node.resource.path,\n schedule: node.jobMeta.schedule,\n scheduleDescription: node.jobMeta.scheduleDescription,\n enabled: node.jobMeta.enabled ?? false,\n lastStatus: node.jobMeta.lastStatus,\n lastRun: node.jobMeta.lastRun,\n nextRun: node.jobMeta.nextRun,\n });\n }\n }\n return items;\n}\n\nexport function AutomationsSection() {\n const [automations, setAutomations] = useState<AutomationItem[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n const [togglingId, setTogglingId] = useState<string | null>(null);\n const [deletingId, setDeletingId] = useState<string | null>(null);\n const [confirmDeleteId, setConfirmDeleteId] = useState<string | null>(null);\n const [toast, setToast] = useState<{\n kind: \"ok\" | \"err\";\n text: string;\n } | null>(null);\n const [reloadToken, setReloadToken] = useState(0);\n\n const showToast = useCallback(\n (kind: \"ok\" | \"err\", text: string, ms = 2500) => {\n setToast({ kind, text });\n setTimeout(() => setToast(null), ms);\n },\n [],\n );\n\n useEffect(() => {\n let cancelled = false;\n setLoading(true);\n fetch(agentNativePath(\"/_agent-native/resources/tree\"))\n .then(async (r) => {\n if (!r.ok) throw new Error(`Failed to load (${r.status})`);\n return (await r.json()) as { tree: TreeNode[] };\n })\n .then(({ tree }) => {\n if (cancelled) return;\n const jobsFolder = tree.find(\n (n) => n.name === \"jobs\" && n.type === \"folder\",\n );\n const items = jobsFolder?.children\n ? flattenJobs(jobsFolder.children)\n : [];\n setAutomations(items);\n setLoading(false);\n })\n .catch((err) => {\n if (cancelled) return;\n setError(err?.message ?? \"Failed to load\");\n setLoading(false);\n });\n return () => {\n cancelled = true;\n };\n }, [reloadToken]);\n\n const reload = useCallback(() => setReloadToken((t) => t + 1), []);\n\n const handleToggle = useCallback(\n async (item: AutomationItem) => {\n setTogglingId(item.id);\n try {\n const res = await fetch(\n agentNativePath(\n `/_agent-native/resources/${encodeURIComponent(item.id)}`,\n ),\n );\n if (!res.ok) {\n showToast(\"err\", \"Failed to read automation\");\n return;\n }\n const resource = await res.json();\n const content: string = resource.content ?? \"\";\n\n const newEnabled = !item.enabled;\n const updated = content.replace(\n /^(enabled:\\s*)(true|false)/m,\n `$1${newEnabled}`,\n );\n\n const putRes = await fetch(\n agentNativePath(\n `/_agent-native/resources/${encodeURIComponent(item.id)}`,\n ),\n {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ content: updated }),\n },\n );\n if (!putRes.ok) {\n showToast(\"err\", \"Failed to update automation\");\n return;\n }\n showToast(\"ok\", newEnabled ? \"Enabled\" : \"Disabled\");\n reload();\n } finally {\n setTogglingId(null);\n }\n },\n [reload, showToast],\n );\n\n const handleDelete = useCallback(\n async (item: AutomationItem) => {\n setDeletingId(item.id);\n try {\n const res = await fetch(\n agentNativePath(\n `/_agent-native/resources/${encodeURIComponent(item.id)}`,\n ),\n {\n method: \"DELETE\",\n headers: { \"Content-Type\": \"application/json\" },\n },\n );\n if (!res.ok) {\n showToast(\"err\", \"Failed to delete automation\");\n return;\n }\n showToast(\"ok\", \"Deleted\");\n setConfirmDeleteId(null);\n reload();\n } finally {\n setDeletingId(null);\n }\n },\n [reload, showToast],\n );\n\n const handleFireTestEvent = useCallback(async () => {\n showToast(\"ok\", \"Firing test event...\");\n try {\n const res = await fetch(\n agentNativePath(\"/_agent-native/automations/fire-test\"),\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ data: {} }),\n },\n );\n if (!res.ok) {\n showToast(\"err\", `Failed to fire event (${res.status})`);\n return;\n }\n showToast(\"ok\", \"Event fired\");\n } catch (err: any) {\n showToast(\"err\", err?.message ?? \"Failed to fire event\");\n }\n }, [showToast]);\n\n const [newOpen, setNewOpen] = useState(false);\n const [newScope, setNewScope] = useState<\"personal\" | \"organization\">(\n \"personal\",\n );\n\n const handleNewSubmit = useCallback(\n (text: string) => {\n const trimmed = text.trim();\n if (!trimmed) return;\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:set-mode\", {\n detail: { mode: \"chat\" },\n }),\n );\n sendToAgentChat({\n message: trimmed,\n context: `The user wants to create a new automation. Scope: ${newScope}. Use manage-automations with action=define to create it. Ask clarifying questions if needed about what event to trigger on, conditions, and what actions to take.`,\n submit: true,\n newTab: true,\n });\n setNewOpen(false);\n },\n [newScope],\n );\n\n if (error) {\n return (\n <p className=\"text-[10px] text-red-500\">\n Failed to load automations: {error}\n </p>\n );\n }\n\n if (loading) {\n return (\n <div className=\"flex items-center gap-1.5 text-[10px] text-muted-foreground\">\n <IconLoader2 size={10} className=\"animate-spin\" />\n Loading...\n </div>\n );\n }\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-1.5\">\n <Popover open={newOpen} onOpenChange={setNewOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n <IconPlus size={10} />\n New Automation\n </button>\n </PopoverTrigger>\n <PopoverContent\n align=\"start\"\n sideOffset={6}\n collisionPadding={8}\n className=\"z-[260] w-[calc(100vw-24px)] max-w-[380px] p-3\"\n >\n <p className=\"px-1 pb-2 text-sm font-semibold text-foreground\">\n New automation\n </p>\n <PromptComposer\n autoFocus\n placeholder=\"Describe what you want to automate...\"\n draftScope=\"automations:create\"\n onSubmit={handleNewSubmit}\n />\n <div className=\"mt-2\">\n <select\n value={newScope}\n onChange={(e) =>\n setNewScope(e.target.value as \"personal\" | \"organization\")\n }\n className=\"w-full cursor-pointer rounded-md border border-input bg-background px-3 py-1.5 text-[12px] text-foreground\"\n >\n <option value=\"personal\">Personal</option>\n <option value=\"organization\">Organization</option>\n </select>\n </div>\n </PopoverContent>\n </Popover>\n {automations.length > 0 && (\n <button\n type=\"button\"\n onClick={handleFireTestEvent}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n <IconPlayerPlay size={10} />\n Fire Test Event\n </button>\n )}\n </div>\n\n {automations.length === 0 ? (\n <p className=\"text-[10px] text-muted-foreground\">\n No automations yet. Click \"New Automation\" to create one, or ask the\n agent to set up a scheduled or event-triggered task.\n </p>\n ) : (\n automations.map((item) => (\n <div\n key={item.id}\n className=\"rounded-md border border-border px-2.5 py-2 bg-accent/30\"\n >\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-muted-foreground shrink-0\">\n {item.schedule ? (\n <IconClock size={11} />\n ) : (\n <IconBolt size={11} />\n )}\n </span>\n <span className=\"text-[11px] font-medium text-foreground truncate capitalize\">\n {item.name}\n </span>\n </div>\n {item.scheduleDescription && (\n <p className=\"text-[10px] text-muted-foreground mt-0.5 ms-[17px]\">\n {item.scheduleDescription}\n </p>\n )}\n {item.schedule && !item.scheduleDescription && (\n <p className=\"text-[10px] text-muted-foreground mt-0.5 ms-[17px] font-mono\">\n {item.schedule}\n </p>\n )}\n </div>\n <div className=\"flex items-center gap-1.5 shrink-0\">\n <StatusBadge status={item.lastStatus} />\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() => handleToggle(item)}\n disabled={togglingId === item.id}\n className={`rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide ${\n item.enabled\n ? \"bg-green-500/15 text-green-500\"\n : \"bg-accent/60 text-muted-foreground\"\n } hover:opacity-80 disabled:opacity-40`}\n >\n {togglingId === item.id ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : item.enabled ? (\n \"On\"\n ) : (\n \"Off\"\n )}\n </button>\n </TooltipTrigger>\n <TooltipContent>\n {item.enabled ? \"Disable\" : \"Enable\"}\n </TooltipContent>\n </Tooltip>\n {confirmDeleteId === item.id ? (\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => handleDelete(item)}\n disabled={deletingId === item.id}\n className=\"rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-red-500/15 text-red-500 hover:bg-red-500/25 disabled:opacity-40\"\n >\n {deletingId === item.id ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Confirm\"\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => setConfirmDeleteId(null)}\n className=\"rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-accent/60 text-muted-foreground hover:text-foreground\"\n >\n Cancel\n </button>\n </div>\n ) : (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() => setConfirmDeleteId(item.id)}\n className=\"text-muted-foreground hover:text-red-500 disabled:opacity-40\"\n >\n <IconTrash size={12} />\n </button>\n </TooltipTrigger>\n <TooltipContent>Delete</TooltipContent>\n </Tooltip>\n )}\n </div>\n </div>\n {item.lastRun && (\n <p className=\"text-[10px] text-muted-foreground mt-1 ms-[17px]\">\n Last run:{\" \"}\n {new Date(item.lastRun).toLocaleString(undefined, {\n month: \"short\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"2-digit\",\n })}\n </p>\n )}\n </div>\n ))\n )}\n\n {toast && (\n <p\n className={`text-[10px] ${toast.kind === \"ok\" ? \"text-green-500\" : \"text-red-500\"}`}\n >\n {toast.text}\n </p>\n )}\n </div>\n );\n}\n\nfunction StatusBadge({ status }: { status?: string }) {\n if (!status) return null;\n\n const styles: Record<string, string> = {\n success: \"bg-green-500/15 text-green-500\",\n error: \"bg-red-500/15 text-red-500\",\n running: \"bg-blue-500/15 text-blue-500\",\n skipped: \"bg-accent/60 text-muted-foreground\",\n };\n\n return (\n <span\n className={`rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide ${styles[status] ?? styles.skipped}`}\n >\n {status}\n </span>\n );\n}\n"]}
|
|
@@ -158,7 +158,7 @@ function SecretCard({ secret, onChanged, focusInput }) {
|
|
|
158
158
|
handleSave();
|
|
159
159
|
}, placeholder: secret.status === "set"
|
|
160
160
|
? "Enter new value to rotate"
|
|
161
|
-
: "Paste key", className: "flex-1 rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent" }), _jsx("button", { type: "button", onClick: handleSave, disabled: !value.trim() || busy !== null, className: "inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40", style: { backgroundColor: "#00B5FF", color: "white" }, children: busy === "save" ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : secret.status === "set" ? (_jsxs(_Fragment, { children: [_jsx(IconRefresh, { size: 10 }), "Rotate"] })) : ("Save") })] }), _jsxs("div", { className: "flex items-center gap-1.5", children: [secret.status === "set" && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: handleTest, disabled: busy !== null, className: "inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-foreground disabled:opacity-40", children: busy === "test" ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : ("Test") }), _jsxs("button", { type: "button", onClick: () => setConfirmDelete(true), disabled: busy !== null, className: "inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-red-500 disabled:opacity-40", children: [_jsx(IconTrash, { size: 10 }), "Remove"] })] })), secret.docsUrl && (_jsxs("a", { href: secret.docsUrl, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] no-underline text-muted-foreground hover:text-foreground
|
|
161
|
+
: "Paste key", className: "flex-1 rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent" }), _jsx("button", { type: "button", onClick: handleSave, disabled: !value.trim() || busy !== null, className: "inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40", style: { backgroundColor: "#00B5FF", color: "white" }, children: busy === "save" ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : secret.status === "set" ? (_jsxs(_Fragment, { children: [_jsx(IconRefresh, { size: 10 }), "Rotate"] })) : ("Save") })] }), _jsxs("div", { className: "flex items-center gap-1.5", children: [secret.status === "set" && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: handleTest, disabled: busy !== null, className: "inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-foreground disabled:opacity-40", children: busy === "test" ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : ("Test") }), _jsxs("button", { type: "button", onClick: () => setConfirmDelete(true), disabled: busy !== null, className: "inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-red-500 disabled:opacity-40", children: [_jsx(IconTrash, { size: 10 }), "Remove"] })] })), secret.docsUrl && (_jsxs("a", { href: secret.docsUrl, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] no-underline text-muted-foreground hover:text-foreground ms-auto", children: ["Get key", _jsx(IconExternalLink, { size: 10 })] }))] }), confirmDelete && (_jsxs("div", { className: "flex items-center gap-1.5 rounded border border-red-500/30 bg-red-500/10 px-2 py-1.5 text-[10px] text-red-500", children: [_jsx("span", { className: "min-w-0 flex-1", children: "Remove this saved value?" }), _jsx("button", { type: "button", onClick: handleDelete, disabled: busy !== null, className: "inline-flex items-center gap-1 rounded border border-red-500/40 px-1.5 py-0.5 font-medium disabled:opacity-40", children: busy === "delete" ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : ("Confirm") }), _jsx("button", { type: "button", onClick: () => setConfirmDelete(false), disabled: busy !== null, className: "rounded border border-border px-1.5 py-0.5 text-muted-foreground hover:text-foreground disabled:opacity-40", children: "Cancel" })] }))] })), toast && (_jsx("p", { className: `mt-1.5 text-[10px] ${toast.kind === "ok" ? "text-green-500" : "text-red-500"}`, children: toast.text }))] }));
|
|
162
162
|
}
|
|
163
163
|
const ADHOC_ENDPOINT = agentNativePath("/_agent-native/secrets/adhoc");
|
|
164
164
|
function AdHocKeysSection() {
|
|
@@ -278,7 +278,7 @@ function AdHocKeysSection() {
|
|
|
278
278
|
setDeletingName(null);
|
|
279
279
|
}
|
|
280
280
|
}, [showToast, reload]);
|
|
281
|
-
return (_jsxs("div", { className: "mt-3 space-y-2", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("p", { className: "text-[11px] font-medium text-foreground", children: "Additional Keys" }), !showForm && (_jsxs("button", { type: "button", onClick: () => setShowForm(true), className: "inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] font-medium text-muted-foreground hover:text-foreground hover:bg-accent/40", children: [_jsx(IconPlus, { size: 10 }), "Add Key"] }))] }), _jsxs("p", { className: "text-[10px] text-muted-foreground/60 leading-relaxed", children: ["Keys are referenced in automations as", " ", _jsx("code", { className: "rounded bg-background px-1 py-0.5 text-[9px]", children: "${keys.KEY_NAME}" }), ". Values are encrypted and never shown to the AI agent."] }), showForm && (_jsxs("div", { className: "rounded-md border border-border px-2.5 py-2 bg-accent/30 space-y-1.5", children: [_jsx("input", { value: formName, onChange: (e) => setFormName(e.target.value.toUpperCase().replace(/[^A-Z0-9_-]/g, "")), className: "w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent", placeholder: "KEY_NAME (e.g. SLACK_WEBHOOK)" }), _jsx("input", { type: "password", value: formValue, onChange: (e) => setFormValue(e.target.value), className: "w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent", placeholder: "Secret value" }), _jsx("input", { value: formDescription, onChange: (e) => setFormDescription(e.target.value), className: "w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent", placeholder: "Description (optional)" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("select", { value: formScope, onChange: (e) => setFormScope(e.target.value), className: "rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none focus:ring-1 focus:ring-accent", children: [_jsx("option", { value: "user", children: "Personal" }), _jsx("option", { value: "workspace", children: "Workspace" })] }), _jsxs("div", { className: "
|
|
281
|
+
return (_jsxs("div", { className: "mt-3 space-y-2", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("p", { className: "text-[11px] font-medium text-foreground", children: "Additional Keys" }), !showForm && (_jsxs("button", { type: "button", onClick: () => setShowForm(true), className: "inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] font-medium text-muted-foreground hover:text-foreground hover:bg-accent/40", children: [_jsx(IconPlus, { size: 10 }), "Add Key"] }))] }), _jsxs("p", { className: "text-[10px] text-muted-foreground/60 leading-relaxed", children: ["Keys are referenced in automations as", " ", _jsx("code", { className: "rounded bg-background px-1 py-0.5 text-[9px]", children: "${keys.KEY_NAME}" }), ". Values are encrypted and never shown to the AI agent."] }), showForm && (_jsxs("div", { className: "rounded-md border border-border px-2.5 py-2 bg-accent/30 space-y-1.5", children: [_jsx("input", { value: formName, onChange: (e) => setFormName(e.target.value.toUpperCase().replace(/[^A-Z0-9_-]/g, "")), className: "w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent", placeholder: "KEY_NAME (e.g. SLACK_WEBHOOK)" }), _jsx("input", { type: "password", value: formValue, onChange: (e) => setFormValue(e.target.value), className: "w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent", placeholder: "Secret value" }), _jsx("input", { value: formDescription, onChange: (e) => setFormDescription(e.target.value), className: "w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent", placeholder: "Description (optional)" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("select", { value: formScope, onChange: (e) => setFormScope(e.target.value), className: "rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none focus:ring-1 focus:ring-accent", children: [_jsx("option", { value: "user", children: "Personal" }), _jsx("option", { value: "workspace", children: "Workspace" })] }), _jsxs("div", { className: "ms-auto flex items-center gap-1.5", children: [_jsx("button", { type: "button", onClick: resetForm, className: "rounded border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground hover:text-foreground", children: "Cancel" }), _jsx("button", { type: "button", onClick: handleAdd, disabled: !formName.trim() || !formValue.trim() || formBusy, className: "inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40", style: { backgroundColor: "#00B5FF", color: "white" }, children: formBusy ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : ("Save") })] })] }), formError && _jsx("p", { className: "text-[10px] text-red-500", children: formError })] })), loading ? (_jsxs("div", { className: "flex items-center gap-1.5 text-[10px] text-muted-foreground", children: [_jsx(IconLoader2, { size: 10, className: "animate-spin" }), "Loading..."] })) : keys.length === 0 && !showForm ? (_jsx("p", { className: "text-[10px] text-muted-foreground", children: "No additional keys yet." })) : (keys.map((key) => (_jsx("div", { className: "rounded-md border border-border px-2.5 py-2 bg-accent/30", children: _jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "text-[11px] font-medium text-foreground font-mono truncate", children: key.name }), _jsx("span", { className: `rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide ${key.scope === "workspace"
|
|
282
282
|
? "bg-blue-500/15 text-blue-500"
|
|
283
283
|
: "bg-accent/60 text-muted-foreground"}`, children: key.scope === "workspace" ? "workspace" : "personal" })] }), key.description && (_jsx("p", { className: "text-[10px] text-muted-foreground mt-0.5", children: key.description })), _jsx("div", { className: "flex items-center gap-2 text-[10px] text-muted-foreground mt-0.5", children: _jsxs("span", { children: ["Ending in", " ", _jsx("code", { className: "rounded bg-background px-1 py-0.5 text-foreground", children: key.last4 })] }) })] }), _jsx("div", { className: "shrink-0", children: confirmDeleteName === key.name ? (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("button", { type: "button", onClick: () => handleDelete(key.name), disabled: deletingName === key.name, className: "rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-red-500/15 text-red-500 hover:bg-red-500/25 disabled:opacity-40", children: deletingName === key.name ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : ("Confirm") }), _jsx("button", { type: "button", onClick: () => setConfirmDeleteName(null), className: "rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-accent/60 text-muted-foreground hover:text-foreground", children: "Cancel" })] })) : (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: () => setConfirmDeleteName(key.name), className: "text-muted-foreground hover:text-red-500", children: _jsx(IconTrash, { size: 12 }) }) }), _jsx(TooltipContent, { children: "Delete" })] })) })] }) }, `${key.scope}-${key.name}`)))), toast && (_jsx("p", { className: `text-[10px] ${toast.kind === "ok" ? "text-green-500" : "text-red-500"}`, children: toast.text }))] }));
|
|
284
284
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretsSection.js","sourceRoot":"","sources":["../../../src/client/settings/SecretsSection.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,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ACrC,QAAQ,EAAE,YAAY,KAAK,GAAG,CAAC,IAAI,EACnC,SAAS,EAAC,2IAA2I,YAEpJ,YAAY,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAC3B,KAAC,WAAW,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,cAAc,GAAG,CACnD,CAAC,CAAC,CAAC,CACF,SAAS,CACV,GACM,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,EACzC,SAAS,EAAC,iIAAiI,uBAGpI,IACL,CACP,CAAC,CAAC,CAAC,CACF,MAAC,OAAO,eACN,KAAC,cAAc,IAAC,OAAO,kBACrB,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,EAC7C,SAAS,EAAC,0CAA0C,YAEpD,KAAC,SAAS,IAAC,IAAI,EAAE,EAAE,GAAI,GAChB,GACM,EACjB,KAAC,cAAc,yBAAwB,IAC/B,CACX,GACG,IACF,IAvED,GAAG,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,IAAI,EAAE,CAwE3B,CACP,CAAC,CACH,EAEA,KAAK,IAAI,CACR,YACE,SAAS,EAAE,eAAe,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAc,EAAE,YAElF,KAAK,CAAC,IAAI,GACT,CACL,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["/**\n * <SecretsSection /> — renders the registered secrets from the framework\n * secrets registry. Fetches `/_agent-native/secrets` on mount and shows a\n * card per secret with a masked input + Save / Rotate / Delete / Test\n * buttons (api-key kind) or a Connect / Disconnect button (oauth kind).\n */\n\nimport React, { useEffect, useMemo, useState, useCallback } from \"react\";\nimport { agentNativePath } from \"../api-path.js\";\nimport {\n IconCheck,\n IconExternalLink,\n IconLoader2,\n IconPlugConnected,\n IconPlus,\n IconTrash,\n IconRefresh,\n} from \"@tabler/icons-react\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\n\ninterface SecretStatus {\n key: string;\n label: string;\n description?: string;\n docsUrl?: string;\n scope: \"user\" | \"workspace\";\n kind: \"api-key\" | \"oauth\";\n required: boolean;\n status: \"set\" | \"unset\" | \"invalid\";\n last4?: string;\n updatedAt?: number;\n oauthProvider?: string;\n oauthConnectUrl?: string;\n error?: string;\n}\n\nconst ENDPOINT = agentNativePath(\"/_agent-native/secrets\");\n\nfunction notifySecretsChanged() {\n if (typeof window === \"undefined\") return;\n window.dispatchEvent(\n new CustomEvent(\"agent-engine:configured-changed\", {\n detail: { source: \"secrets\" },\n }),\n );\n}\n\nexport interface SecretsSectionProps {\n /** Optional hash fragment to focus a specific secret (e.g. \"secrets:OPENAI_API_KEY\"). */\n focusKey?: string;\n}\n\nexport function SecretsSection({ focusKey }: SecretsSectionProps) {\n const [secrets, setSecrets] = useState<SecretStatus[] | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [reloadToken, setReloadToken] = useState(0);\n\n useEffect(() => {\n let cancelled = false;\n fetch(ENDPOINT)\n .then(async (r) => {\n if (!r.ok) {\n throw new Error(`Failed to load secrets (${r.status})`);\n }\n return (await r.json()) as SecretStatus[];\n })\n .then((data) => {\n if (!cancelled) setSecrets(data);\n })\n .catch((err) => {\n if (!cancelled) setError(err?.message ?? \"Failed to load\");\n });\n return () => {\n cancelled = true;\n };\n }, [reloadToken]);\n\n const reload = useCallback(() => setReloadToken((t) => t + 1), []);\n\n if (error) {\n return (\n <p className=\"text-[10px] text-red-500\">\n Failed to load secrets: {error}\n </p>\n );\n }\n if (secrets === null) {\n return (\n <div className=\"flex items-center gap-1.5 text-[10px] text-muted-foreground\">\n <IconLoader2 size={10} className=\"animate-spin\" />\n Loading…\n </div>\n );\n }\n if (secrets.length === 0) {\n return (\n <div className=\"space-y-2\">\n <p className=\"text-[10px] text-muted-foreground\">\n No secrets registered yet. Templates register API keys and connections\n via <code>registerRequiredSecret()</code>.\n </p>\n <AdHocKeysSection />\n </div>\n );\n }\n\n return (\n <div className=\"space-y-2\">\n {secrets.map((secret) => (\n <SecretCard\n key={secret.key}\n secret={secret}\n onChanged={reload}\n focusInput={focusKey === secret.key}\n />\n ))}\n <AdHocKeysSection />\n </div>\n );\n}\n\ninterface SecretCardProps {\n secret: SecretStatus;\n onChanged: () => void;\n focusInput?: boolean;\n}\n\nfunction SecretCard({ secret, onChanged, focusInput }: SecretCardProps) {\n const [value, setValue] = useState(\"\");\n const [busy, setBusy] = useState<null | \"save\" | \"delete\" | \"test\">(null);\n const [confirmDelete, setConfirmDelete] = useState(false);\n const [toast, setToast] = useState<{\n kind: \"ok\" | \"err\";\n text: string;\n } | null>(null);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (focusInput && inputRef.current) {\n inputRef.current.focus();\n }\n }, [focusInput]);\n\n const setToastAndClear = (kind: \"ok\" | \"err\", text: string, ms = 2500) => {\n setToast({ kind, text });\n setTimeout(() => setToast(null), ms);\n };\n\n const handleSave = async () => {\n if (!value.trim() || busy) return;\n setBusy(\"save\");\n try {\n const res = await fetch(`${ENDPOINT}/${encodeURIComponent(secret.key)}`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ value: value.trim() }),\n });\n if (!res.ok) {\n const err = await res\n .json()\n .then((j: { error?: string }) => j.error)\n .catch(() => null);\n setToastAndClear(\"err\", err ?? `Save failed (${res.status})`);\n return;\n }\n setValue(\"\");\n setConfirmDelete(false);\n setToastAndClear(\"ok\", \"Saved\");\n notifySecretsChanged();\n onChanged();\n } finally {\n setBusy(null);\n }\n };\n\n const handleDelete = async () => {\n if (busy) return;\n setBusy(\"delete\");\n try {\n const res = await fetch(`${ENDPOINT}/${encodeURIComponent(secret.key)}`, {\n method: \"DELETE\",\n headers: { \"Content-Type\": \"application/json\" },\n });\n if (!res.ok) {\n const err = await res\n .json()\n .then((j: { error?: string }) => j.error)\n .catch(() => null);\n setToastAndClear(\"err\", err ?? `Delete failed (${res.status})`);\n return;\n }\n setToastAndClear(\"ok\", \"Removed\");\n setConfirmDelete(false);\n notifySecretsChanged();\n onChanged();\n } finally {\n setBusy(null);\n }\n };\n\n const handleTest = async () => {\n if (busy) return;\n setBusy(\"test\");\n try {\n const res = await fetch(\n `${ENDPOINT}/${encodeURIComponent(secret.key)}/test`,\n {\n method: \"POST\",\n },\n );\n const body = (await res.json().catch(() => ({}))) as {\n ok?: boolean;\n error?: string;\n };\n if (res.ok && body.ok) {\n setToastAndClear(\"ok\", \"Working\");\n } else {\n setToastAndClear(\n \"err\",\n body.error ?? (body.ok === false ? \"Invalid\" : `Test failed`),\n );\n }\n } finally {\n setBusy(null);\n }\n };\n\n const pill = useMemo(() => {\n if (secret.status === \"set\") {\n return (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Set\n </span>\n );\n }\n if (secret.required) {\n return (\n <span className=\"rounded-full bg-red-500/15 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-red-500\">\n Required\n </span>\n );\n }\n return (\n <span className=\"rounded-full bg-accent/60 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground\">\n Optional\n </span>\n );\n }, [secret.status, secret.required]);\n\n const isOAuth = secret.kind === \"oauth\";\n\n return (\n <div className=\"rounded-md border border-border px-2.5 py-2 bg-accent/30\">\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"min-w-0\">\n <div className=\"text-[11px] font-medium text-foreground truncate\">\n {secret.label}\n </div>\n {secret.description && (\n <p className=\"text-[10px] text-muted-foreground mt-0.5\">\n {secret.description}\n </p>\n )}\n </div>\n <div className=\"shrink-0\">{pill}</div>\n </div>\n\n {isOAuth ? (\n <div className=\"mt-2 flex items-center gap-1.5\">\n {secret.oauthConnectUrl && (\n <a\n href={secret.oauthConnectUrl}\n className=\"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium no-underline\"\n style={{ backgroundColor: \"#00B5FF\", color: \"white\" }}\n >\n <IconPlugConnected size={10} />\n {secret.status === \"set\" ? \"Reconnect\" : \"Connect\"}\n </a>\n )}\n {secret.docsUrl && (\n <a\n href={secret.docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] no-underline text-muted-foreground hover:text-foreground\"\n >\n Docs\n <IconExternalLink size={10} />\n </a>\n )}\n </div>\n ) : (\n <div className=\"mt-2 space-y-1.5\">\n {secret.status === \"set\" && (\n <div className=\"flex items-center gap-2 text-[10px] text-muted-foreground\">\n <span>Stored value ending in</span>\n <code className=\"rounded bg-background px-1 py-0.5 text-foreground\">\n {secret.last4}\n </code>\n </div>\n )}\n <div className=\"flex gap-1.5\">\n <input\n ref={inputRef}\n type=\"password\"\n value={value}\n onChange={(e) => setValue(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") handleSave();\n }}\n placeholder={\n secret.status === \"set\"\n ? \"Enter new value to rotate\"\n : \"Paste key\"\n }\n className=\"flex-1 rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n />\n <button\n type=\"button\"\n onClick={handleSave}\n disabled={!value.trim() || busy !== null}\n className=\"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40\"\n style={{ backgroundColor: \"#00B5FF\", color: \"white\" }}\n >\n {busy === \"save\" ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : secret.status === \"set\" ? (\n <>\n <IconRefresh size={10} />\n Rotate\n </>\n ) : (\n \"Save\"\n )}\n </button>\n </div>\n <div className=\"flex items-center gap-1.5\">\n {secret.status === \"set\" && (\n <>\n <button\n type=\"button\"\n onClick={handleTest}\n disabled={busy !== null}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-foreground disabled:opacity-40\"\n >\n {busy === \"test\" ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Test\"\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => setConfirmDelete(true)}\n disabled={busy !== null}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-red-500 disabled:opacity-40\"\n >\n <IconTrash size={10} />\n Remove\n </button>\n </>\n )}\n {secret.docsUrl && (\n <a\n href={secret.docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] no-underline text-muted-foreground hover:text-foreground ml-auto\"\n >\n Get key\n <IconExternalLink size={10} />\n </a>\n )}\n </div>\n {confirmDelete && (\n <div className=\"flex items-center gap-1.5 rounded border border-red-500/30 bg-red-500/10 px-2 py-1.5 text-[10px] text-red-500\">\n <span className=\"min-w-0 flex-1\">Remove this saved value?</span>\n <button\n type=\"button\"\n onClick={handleDelete}\n disabled={busy !== null}\n className=\"inline-flex items-center gap-1 rounded border border-red-500/40 px-1.5 py-0.5 font-medium disabled:opacity-40\"\n >\n {busy === \"delete\" ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Confirm\"\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => setConfirmDelete(false)}\n disabled={busy !== null}\n className=\"rounded border border-border px-1.5 py-0.5 text-muted-foreground hover:text-foreground disabled:opacity-40\"\n >\n Cancel\n </button>\n </div>\n )}\n </div>\n )}\n\n {toast && (\n <p\n className={`mt-1.5 text-[10px] ${\n toast.kind === \"ok\" ? \"text-green-500\" : \"text-red-500\"\n }`}\n >\n {toast.text}\n </p>\n )}\n </div>\n );\n}\n\n// ─── Ad-hoc Keys Section ──────────────────────────────────────────────────\n\ninterface AdHocKey {\n name: string;\n scope: \"user\" | \"workspace\";\n scopeId: string;\n description: string | null;\n last4: string;\n createdAt: number;\n updatedAt: number;\n}\n\nconst ADHOC_ENDPOINT = agentNativePath(\"/_agent-native/secrets/adhoc\");\n\nfunction AdHocKeysSection() {\n const [keys, setKeys] = useState<AdHocKey[]>([]);\n const [loading, setLoading] = useState(true);\n const [reloadToken, setReloadToken] = useState(0);\n const [showForm, setShowForm] = useState(false);\n const [formName, setFormName] = useState(\"\");\n const [formValue, setFormValue] = useState(\"\");\n const [formDescription, setFormDescription] = useState(\"\");\n const [formScope, setFormScope] = useState<\"user\" | \"workspace\">(\"user\");\n const [formBusy, setFormBusy] = useState(false);\n const [formError, setFormError] = useState<string | null>(null);\n const [confirmDeleteName, setConfirmDeleteName] = useState<string | null>(\n null,\n );\n const [deletingName, setDeletingName] = useState<string | null>(null);\n const [toast, setToast] = useState<{\n kind: \"ok\" | \"err\";\n text: string;\n } | null>(null);\n\n const showToast = useCallback(\n (kind: \"ok\" | \"err\", text: string, ms = 2500) => {\n setToast({ kind, text });\n setTimeout(() => setToast(null), ms);\n },\n [],\n );\n\n const reload = useCallback(() => setReloadToken((t) => t + 1), []);\n\n useEffect(() => {\n let cancelled = false;\n setLoading(true);\n fetch(ADHOC_ENDPOINT)\n .then(async (r) => {\n if (!r.ok) throw new Error(`Failed to load (${r.status})`);\n return (await r.json()) as AdHocKey[];\n })\n .then((data) => {\n if (!cancelled) {\n setKeys(data);\n setLoading(false);\n }\n })\n .catch(() => {\n if (!cancelled) {\n setKeys([]);\n setLoading(false);\n }\n });\n return () => {\n cancelled = true;\n };\n }, [reloadToken]);\n\n const resetForm = useCallback(() => {\n setShowForm(false);\n setFormName(\"\");\n setFormValue(\"\");\n setFormDescription(\"\");\n setFormScope(\"user\");\n setFormError(null);\n }, []);\n\n const handleAdd = useCallback(async () => {\n const name = formName.trim();\n const value = formValue.trim();\n if (!name || !value || formBusy) return;\n setFormBusy(true);\n setFormError(null);\n try {\n const res = await fetch(ADHOC_ENDPOINT, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n name,\n value,\n description: formDescription.trim() || undefined,\n scope: formScope,\n }),\n });\n if (!res.ok) {\n const body = await res\n .json()\n .then((j: { error?: string }) => j.error)\n .catch(() => null);\n setFormError(body ?? `Save failed (${res.status})`);\n return;\n }\n resetForm();\n showToast(\"ok\", \"Key saved\");\n reload();\n } catch (err: any) {\n setFormError(err?.message ?? \"Failed to save\");\n } finally {\n setFormBusy(false);\n }\n }, [\n formName,\n formValue,\n formDescription,\n formScope,\n formBusy,\n resetForm,\n showToast,\n reload,\n ]);\n\n const handleDelete = useCallback(\n async (name: string) => {\n setDeletingName(name);\n try {\n const res = await fetch(\n `${ADHOC_ENDPOINT}/${encodeURIComponent(name)}`,\n {\n method: \"DELETE\",\n headers: { \"Content-Type\": \"application/json\" },\n },\n );\n if (!res.ok) {\n showToast(\"err\", \"Failed to delete key\");\n return;\n }\n showToast(\"ok\", \"Key deleted\");\n setConfirmDeleteName(null);\n reload();\n } finally {\n setDeletingName(null);\n }\n },\n [showToast, reload],\n );\n\n return (\n <div className=\"mt-3 space-y-2\">\n <div className=\"flex items-center justify-between\">\n <p className=\"text-[11px] font-medium text-foreground\">\n Additional Keys\n </p>\n {!showForm && (\n <button\n type=\"button\"\n onClick={() => setShowForm(true)}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] font-medium text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n <IconPlus size={10} />\n Add Key\n </button>\n )}\n </div>\n <p className=\"text-[10px] text-muted-foreground/60 leading-relaxed\">\n Keys are referenced in automations as{\" \"}\n <code className=\"rounded bg-background px-1 py-0.5 text-[9px]\">\n {\"${keys.KEY_NAME}\"}\n </code>\n . Values are encrypted and never shown to the AI agent.\n </p>\n\n {showForm && (\n <div className=\"rounded-md border border-border px-2.5 py-2 bg-accent/30 space-y-1.5\">\n <input\n value={formName}\n onChange={(e) =>\n setFormName(\n e.target.value.toUpperCase().replace(/[^A-Z0-9_-]/g, \"\"),\n )\n }\n className=\"w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"KEY_NAME (e.g. SLACK_WEBHOOK)\"\n />\n <input\n type=\"password\"\n value={formValue}\n onChange={(e) => setFormValue(e.target.value)}\n className=\"w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"Secret value\"\n />\n <input\n value={formDescription}\n onChange={(e) => setFormDescription(e.target.value)}\n className=\"w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"Description (optional)\"\n />\n <div className=\"flex items-center gap-2\">\n <select\n value={formScope}\n onChange={(e) =>\n setFormScope(e.target.value as \"user\" | \"workspace\")\n }\n className=\"rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none focus:ring-1 focus:ring-accent\"\n >\n <option value=\"user\">Personal</option>\n <option value=\"workspace\">Workspace</option>\n </select>\n <div className=\"ml-auto flex items-center gap-1.5\">\n <button\n type=\"button\"\n onClick={resetForm}\n className=\"rounded border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground hover:text-foreground\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={handleAdd}\n disabled={!formName.trim() || !formValue.trim() || formBusy}\n className=\"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40\"\n style={{ backgroundColor: \"#00B5FF\", color: \"white\" }}\n >\n {formBusy ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Save\"\n )}\n </button>\n </div>\n </div>\n {formError && <p className=\"text-[10px] text-red-500\">{formError}</p>}\n </div>\n )}\n\n {loading ? (\n <div className=\"flex items-center gap-1.5 text-[10px] text-muted-foreground\">\n <IconLoader2 size={10} className=\"animate-spin\" />\n Loading...\n </div>\n ) : keys.length === 0 && !showForm ? (\n <p className=\"text-[10px] text-muted-foreground\">\n No additional keys yet.\n </p>\n ) : (\n keys.map((key) => (\n <div\n key={`${key.scope}-${key.name}`}\n className=\"rounded-md border border-border px-2.5 py-2 bg-accent/30\"\n >\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-[11px] font-medium text-foreground font-mono truncate\">\n {key.name}\n </span>\n <span\n className={`rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide ${\n key.scope === \"workspace\"\n ? \"bg-blue-500/15 text-blue-500\"\n : \"bg-accent/60 text-muted-foreground\"\n }`}\n >\n {key.scope === \"workspace\" ? \"workspace\" : \"personal\"}\n </span>\n </div>\n {key.description && (\n <p className=\"text-[10px] text-muted-foreground mt-0.5\">\n {key.description}\n </p>\n )}\n <div className=\"flex items-center gap-2 text-[10px] text-muted-foreground mt-0.5\">\n <span>\n Ending in{\" \"}\n <code className=\"rounded bg-background px-1 py-0.5 text-foreground\">\n {key.last4}\n </code>\n </span>\n </div>\n </div>\n <div className=\"shrink-0\">\n {confirmDeleteName === key.name ? (\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => handleDelete(key.name)}\n disabled={deletingName === key.name}\n className=\"rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-red-500/15 text-red-500 hover:bg-red-500/25 disabled:opacity-40\"\n >\n {deletingName === key.name ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Confirm\"\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => setConfirmDeleteName(null)}\n className=\"rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-accent/60 text-muted-foreground hover:text-foreground\"\n >\n Cancel\n </button>\n </div>\n ) : (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() => setConfirmDeleteName(key.name)}\n className=\"text-muted-foreground hover:text-red-500\"\n >\n <IconTrash size={12} />\n </button>\n </TooltipTrigger>\n <TooltipContent>Delete</TooltipContent>\n </Tooltip>\n )}\n </div>\n </div>\n </div>\n ))\n )}\n\n {toast && (\n <p\n className={`text-[10px] ${toast.kind === \"ok\" ? \"text-green-500\" : \"text-red-500\"}`}\n >\n {toast.text}\n </p>\n )}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SecretsSection.js","sourceRoot":"","sources":["../../../src/client/settings/SecretsSection.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AAkBrC,MAAM,QAAQ,GAAG,eAAe,CAAC,wBAAwB,CAAC,CAAC;AAE3D,SAAS,oBAAoB;IAC3B,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO;IAC1C,MAAM,CAAC,aAAa,CAClB,IAAI,WAAW,CAAC,iCAAiC,EAAE;QACjD,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;KAC9B,CAAC,CACH,CAAC;AACJ,CAAC;AAOD,MAAM,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAuB;IAC9D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAwB,IAAI,CAAC,CAAC;IACpE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC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cAAc,EAAE,YAElF,KAAK,CAAC,IAAI,GACT,CACL,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["/**\n * <SecretsSection /> — renders the registered secrets from the framework\n * secrets registry. Fetches `/_agent-native/secrets` on mount and shows a\n * card per secret with a masked input + Save / Rotate / Delete / Test\n * buttons (api-key kind) or a Connect / Disconnect button (oauth kind).\n */\n\nimport React, { useEffect, useMemo, useState, useCallback } from \"react\";\nimport { agentNativePath } from \"../api-path.js\";\nimport {\n IconCheck,\n IconExternalLink,\n IconLoader2,\n IconPlugConnected,\n IconPlus,\n IconTrash,\n IconRefresh,\n} from \"@tabler/icons-react\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\n\ninterface SecretStatus {\n key: string;\n label: string;\n description?: string;\n docsUrl?: string;\n scope: \"user\" | \"workspace\";\n kind: \"api-key\" | \"oauth\";\n required: boolean;\n status: \"set\" | \"unset\" | \"invalid\";\n last4?: string;\n updatedAt?: number;\n oauthProvider?: string;\n oauthConnectUrl?: string;\n error?: string;\n}\n\nconst ENDPOINT = agentNativePath(\"/_agent-native/secrets\");\n\nfunction notifySecretsChanged() {\n if (typeof window === \"undefined\") return;\n window.dispatchEvent(\n new CustomEvent(\"agent-engine:configured-changed\", {\n detail: { source: \"secrets\" },\n }),\n );\n}\n\nexport interface SecretsSectionProps {\n /** Optional hash fragment to focus a specific secret (e.g. \"secrets:OPENAI_API_KEY\"). */\n focusKey?: string;\n}\n\nexport function SecretsSection({ focusKey }: SecretsSectionProps) {\n const [secrets, setSecrets] = useState<SecretStatus[] | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [reloadToken, setReloadToken] = useState(0);\n\n useEffect(() => {\n let cancelled = false;\n fetch(ENDPOINT)\n .then(async (r) => {\n if (!r.ok) {\n throw new Error(`Failed to load secrets (${r.status})`);\n }\n return (await r.json()) as SecretStatus[];\n })\n .then((data) => {\n if (!cancelled) setSecrets(data);\n })\n .catch((err) => {\n if (!cancelled) setError(err?.message ?? \"Failed to load\");\n });\n return () => {\n cancelled = true;\n };\n }, [reloadToken]);\n\n const reload = useCallback(() => setReloadToken((t) => t + 1), []);\n\n if (error) {\n return (\n <p className=\"text-[10px] text-red-500\">\n Failed to load secrets: {error}\n </p>\n );\n }\n if (secrets === null) {\n return (\n <div className=\"flex items-center gap-1.5 text-[10px] text-muted-foreground\">\n <IconLoader2 size={10} className=\"animate-spin\" />\n Loading…\n </div>\n );\n }\n if (secrets.length === 0) {\n return (\n <div className=\"space-y-2\">\n <p className=\"text-[10px] text-muted-foreground\">\n No secrets registered yet. Templates register API keys and connections\n via <code>registerRequiredSecret()</code>.\n </p>\n <AdHocKeysSection />\n </div>\n );\n }\n\n return (\n <div className=\"space-y-2\">\n {secrets.map((secret) => (\n <SecretCard\n key={secret.key}\n secret={secret}\n onChanged={reload}\n focusInput={focusKey === secret.key}\n />\n ))}\n <AdHocKeysSection />\n </div>\n );\n}\n\ninterface SecretCardProps {\n secret: SecretStatus;\n onChanged: () => void;\n focusInput?: boolean;\n}\n\nfunction SecretCard({ secret, onChanged, focusInput }: SecretCardProps) {\n const [value, setValue] = useState(\"\");\n const [busy, setBusy] = useState<null | \"save\" | \"delete\" | \"test\">(null);\n const [confirmDelete, setConfirmDelete] = useState(false);\n const [toast, setToast] = useState<{\n kind: \"ok\" | \"err\";\n text: string;\n } | null>(null);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (focusInput && inputRef.current) {\n inputRef.current.focus();\n }\n }, [focusInput]);\n\n const setToastAndClear = (kind: \"ok\" | \"err\", text: string, ms = 2500) => {\n setToast({ kind, text });\n setTimeout(() => setToast(null), ms);\n };\n\n const handleSave = async () => {\n if (!value.trim() || busy) return;\n setBusy(\"save\");\n try {\n const res = await fetch(`${ENDPOINT}/${encodeURIComponent(secret.key)}`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ value: value.trim() }),\n });\n if (!res.ok) {\n const err = await res\n .json()\n .then((j: { error?: string }) => j.error)\n .catch(() => null);\n setToastAndClear(\"err\", err ?? `Save failed (${res.status})`);\n return;\n }\n setValue(\"\");\n setConfirmDelete(false);\n setToastAndClear(\"ok\", \"Saved\");\n notifySecretsChanged();\n onChanged();\n } finally {\n setBusy(null);\n }\n };\n\n const handleDelete = async () => {\n if (busy) return;\n setBusy(\"delete\");\n try {\n const res = await fetch(`${ENDPOINT}/${encodeURIComponent(secret.key)}`, {\n method: \"DELETE\",\n headers: { \"Content-Type\": \"application/json\" },\n });\n if (!res.ok) {\n const err = await res\n .json()\n .then((j: { error?: string }) => j.error)\n .catch(() => null);\n setToastAndClear(\"err\", err ?? `Delete failed (${res.status})`);\n return;\n }\n setToastAndClear(\"ok\", \"Removed\");\n setConfirmDelete(false);\n notifySecretsChanged();\n onChanged();\n } finally {\n setBusy(null);\n }\n };\n\n const handleTest = async () => {\n if (busy) return;\n setBusy(\"test\");\n try {\n const res = await fetch(\n `${ENDPOINT}/${encodeURIComponent(secret.key)}/test`,\n {\n method: \"POST\",\n },\n );\n const body = (await res.json().catch(() => ({}))) as {\n ok?: boolean;\n error?: string;\n };\n if (res.ok && body.ok) {\n setToastAndClear(\"ok\", \"Working\");\n } else {\n setToastAndClear(\n \"err\",\n body.error ?? (body.ok === false ? \"Invalid\" : `Test failed`),\n );\n }\n } finally {\n setBusy(null);\n }\n };\n\n const pill = useMemo(() => {\n if (secret.status === \"set\") {\n return (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Set\n </span>\n );\n }\n if (secret.required) {\n return (\n <span className=\"rounded-full bg-red-500/15 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-red-500\">\n Required\n </span>\n );\n }\n return (\n <span className=\"rounded-full bg-accent/60 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground\">\n Optional\n </span>\n );\n }, [secret.status, secret.required]);\n\n const isOAuth = secret.kind === \"oauth\";\n\n return (\n <div className=\"rounded-md border border-border px-2.5 py-2 bg-accent/30\">\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"min-w-0\">\n <div className=\"text-[11px] font-medium text-foreground truncate\">\n {secret.label}\n </div>\n {secret.description && (\n <p className=\"text-[10px] text-muted-foreground mt-0.5\">\n {secret.description}\n </p>\n )}\n </div>\n <div className=\"shrink-0\">{pill}</div>\n </div>\n\n {isOAuth ? (\n <div className=\"mt-2 flex items-center gap-1.5\">\n {secret.oauthConnectUrl && (\n <a\n href={secret.oauthConnectUrl}\n className=\"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium no-underline\"\n style={{ backgroundColor: \"#00B5FF\", color: \"white\" }}\n >\n <IconPlugConnected size={10} />\n {secret.status === \"set\" ? \"Reconnect\" : \"Connect\"}\n </a>\n )}\n {secret.docsUrl && (\n <a\n href={secret.docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] no-underline text-muted-foreground hover:text-foreground\"\n >\n Docs\n <IconExternalLink size={10} />\n </a>\n )}\n </div>\n ) : (\n <div className=\"mt-2 space-y-1.5\">\n {secret.status === \"set\" && (\n <div className=\"flex items-center gap-2 text-[10px] text-muted-foreground\">\n <span>Stored value ending in</span>\n <code className=\"rounded bg-background px-1 py-0.5 text-foreground\">\n {secret.last4}\n </code>\n </div>\n )}\n <div className=\"flex gap-1.5\">\n <input\n ref={inputRef}\n type=\"password\"\n value={value}\n onChange={(e) => setValue(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") handleSave();\n }}\n placeholder={\n secret.status === \"set\"\n ? \"Enter new value to rotate\"\n : \"Paste key\"\n }\n className=\"flex-1 rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n />\n <button\n type=\"button\"\n onClick={handleSave}\n disabled={!value.trim() || busy !== null}\n className=\"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40\"\n style={{ backgroundColor: \"#00B5FF\", color: \"white\" }}\n >\n {busy === \"save\" ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : secret.status === \"set\" ? (\n <>\n <IconRefresh size={10} />\n Rotate\n </>\n ) : (\n \"Save\"\n )}\n </button>\n </div>\n <div className=\"flex items-center gap-1.5\">\n {secret.status === \"set\" && (\n <>\n <button\n type=\"button\"\n onClick={handleTest}\n disabled={busy !== null}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-foreground disabled:opacity-40\"\n >\n {busy === \"test\" ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Test\"\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => setConfirmDelete(true)}\n disabled={busy !== null}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-red-500 disabled:opacity-40\"\n >\n <IconTrash size={10} />\n Remove\n </button>\n </>\n )}\n {secret.docsUrl && (\n <a\n href={secret.docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] no-underline text-muted-foreground hover:text-foreground ms-auto\"\n >\n Get key\n <IconExternalLink size={10} />\n </a>\n )}\n </div>\n {confirmDelete && (\n <div className=\"flex items-center gap-1.5 rounded border border-red-500/30 bg-red-500/10 px-2 py-1.5 text-[10px] text-red-500\">\n <span className=\"min-w-0 flex-1\">Remove this saved value?</span>\n <button\n type=\"button\"\n onClick={handleDelete}\n disabled={busy !== null}\n className=\"inline-flex items-center gap-1 rounded border border-red-500/40 px-1.5 py-0.5 font-medium disabled:opacity-40\"\n >\n {busy === \"delete\" ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Confirm\"\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => setConfirmDelete(false)}\n disabled={busy !== null}\n className=\"rounded border border-border px-1.5 py-0.5 text-muted-foreground hover:text-foreground disabled:opacity-40\"\n >\n Cancel\n </button>\n </div>\n )}\n </div>\n )}\n\n {toast && (\n <p\n className={`mt-1.5 text-[10px] ${\n toast.kind === \"ok\" ? \"text-green-500\" : \"text-red-500\"\n }`}\n >\n {toast.text}\n </p>\n )}\n </div>\n );\n}\n\n// ─── Ad-hoc Keys Section ──────────────────────────────────────────────────\n\ninterface AdHocKey {\n name: string;\n scope: \"user\" | \"workspace\";\n scopeId: string;\n description: string | null;\n last4: string;\n createdAt: number;\n updatedAt: number;\n}\n\nconst ADHOC_ENDPOINT = agentNativePath(\"/_agent-native/secrets/adhoc\");\n\nfunction AdHocKeysSection() {\n const [keys, setKeys] = useState<AdHocKey[]>([]);\n const [loading, setLoading] = useState(true);\n const [reloadToken, setReloadToken] = useState(0);\n const [showForm, setShowForm] = useState(false);\n const [formName, setFormName] = useState(\"\");\n const [formValue, setFormValue] = useState(\"\");\n const [formDescription, setFormDescription] = useState(\"\");\n const [formScope, setFormScope] = useState<\"user\" | \"workspace\">(\"user\");\n const [formBusy, setFormBusy] = useState(false);\n const [formError, setFormError] = useState<string | null>(null);\n const [confirmDeleteName, setConfirmDeleteName] = useState<string | null>(\n null,\n );\n const [deletingName, setDeletingName] = useState<string | null>(null);\n const [toast, setToast] = useState<{\n kind: \"ok\" | \"err\";\n text: string;\n } | null>(null);\n\n const showToast = useCallback(\n (kind: \"ok\" | \"err\", text: string, ms = 2500) => {\n setToast({ kind, text });\n setTimeout(() => setToast(null), ms);\n },\n [],\n );\n\n const reload = useCallback(() => setReloadToken((t) => t + 1), []);\n\n useEffect(() => {\n let cancelled = false;\n setLoading(true);\n fetch(ADHOC_ENDPOINT)\n .then(async (r) => {\n if (!r.ok) throw new Error(`Failed to load (${r.status})`);\n return (await r.json()) as AdHocKey[];\n })\n .then((data) => {\n if (!cancelled) {\n setKeys(data);\n setLoading(false);\n }\n })\n .catch(() => {\n if (!cancelled) {\n setKeys([]);\n setLoading(false);\n }\n });\n return () => {\n cancelled = true;\n };\n }, [reloadToken]);\n\n const resetForm = useCallback(() => {\n setShowForm(false);\n setFormName(\"\");\n setFormValue(\"\");\n setFormDescription(\"\");\n setFormScope(\"user\");\n setFormError(null);\n }, []);\n\n const handleAdd = useCallback(async () => {\n const name = formName.trim();\n const value = formValue.trim();\n if (!name || !value || formBusy) return;\n setFormBusy(true);\n setFormError(null);\n try {\n const res = await fetch(ADHOC_ENDPOINT, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n name,\n value,\n description: formDescription.trim() || undefined,\n scope: formScope,\n }),\n });\n if (!res.ok) {\n const body = await res\n .json()\n .then((j: { error?: string }) => j.error)\n .catch(() => null);\n setFormError(body ?? `Save failed (${res.status})`);\n return;\n }\n resetForm();\n showToast(\"ok\", \"Key saved\");\n reload();\n } catch (err: any) {\n setFormError(err?.message ?? \"Failed to save\");\n } finally {\n setFormBusy(false);\n }\n }, [\n formName,\n formValue,\n formDescription,\n formScope,\n formBusy,\n resetForm,\n showToast,\n reload,\n ]);\n\n const handleDelete = useCallback(\n async (name: string) => {\n setDeletingName(name);\n try {\n const res = await fetch(\n `${ADHOC_ENDPOINT}/${encodeURIComponent(name)}`,\n {\n method: \"DELETE\",\n headers: { \"Content-Type\": \"application/json\" },\n },\n );\n if (!res.ok) {\n showToast(\"err\", \"Failed to delete key\");\n return;\n }\n showToast(\"ok\", \"Key deleted\");\n setConfirmDeleteName(null);\n reload();\n } finally {\n setDeletingName(null);\n }\n },\n [showToast, reload],\n );\n\n return (\n <div className=\"mt-3 space-y-2\">\n <div className=\"flex items-center justify-between\">\n <p className=\"text-[11px] font-medium text-foreground\">\n Additional Keys\n </p>\n {!showForm && (\n <button\n type=\"button\"\n onClick={() => setShowForm(true)}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] font-medium text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n <IconPlus size={10} />\n Add Key\n </button>\n )}\n </div>\n <p className=\"text-[10px] text-muted-foreground/60 leading-relaxed\">\n Keys are referenced in automations as{\" \"}\n <code className=\"rounded bg-background px-1 py-0.5 text-[9px]\">\n {\"${keys.KEY_NAME}\"}\n </code>\n . Values are encrypted and never shown to the AI agent.\n </p>\n\n {showForm && (\n <div className=\"rounded-md border border-border px-2.5 py-2 bg-accent/30 space-y-1.5\">\n <input\n value={formName}\n onChange={(e) =>\n setFormName(\n e.target.value.toUpperCase().replace(/[^A-Z0-9_-]/g, \"\"),\n )\n }\n className=\"w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"KEY_NAME (e.g. SLACK_WEBHOOK)\"\n />\n <input\n type=\"password\"\n value={formValue}\n onChange={(e) => setFormValue(e.target.value)}\n className=\"w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"Secret value\"\n />\n <input\n value={formDescription}\n onChange={(e) => setFormDescription(e.target.value)}\n className=\"w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"Description (optional)\"\n />\n <div className=\"flex items-center gap-2\">\n <select\n value={formScope}\n onChange={(e) =>\n setFormScope(e.target.value as \"user\" | \"workspace\")\n }\n className=\"rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none focus:ring-1 focus:ring-accent\"\n >\n <option value=\"user\">Personal</option>\n <option value=\"workspace\">Workspace</option>\n </select>\n <div className=\"ms-auto flex items-center gap-1.5\">\n <button\n type=\"button\"\n onClick={resetForm}\n className=\"rounded border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground hover:text-foreground\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={handleAdd}\n disabled={!formName.trim() || !formValue.trim() || formBusy}\n className=\"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40\"\n style={{ backgroundColor: \"#00B5FF\", color: \"white\" }}\n >\n {formBusy ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Save\"\n )}\n </button>\n </div>\n </div>\n {formError && <p className=\"text-[10px] text-red-500\">{formError}</p>}\n </div>\n )}\n\n {loading ? (\n <div className=\"flex items-center gap-1.5 text-[10px] text-muted-foreground\">\n <IconLoader2 size={10} className=\"animate-spin\" />\n Loading...\n </div>\n ) : keys.length === 0 && !showForm ? (\n <p className=\"text-[10px] text-muted-foreground\">\n No additional keys yet.\n </p>\n ) : (\n keys.map((key) => (\n <div\n key={`${key.scope}-${key.name}`}\n className=\"rounded-md border border-border px-2.5 py-2 bg-accent/30\"\n >\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-[11px] font-medium text-foreground font-mono truncate\">\n {key.name}\n </span>\n <span\n className={`rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide ${\n key.scope === \"workspace\"\n ? \"bg-blue-500/15 text-blue-500\"\n : \"bg-accent/60 text-muted-foreground\"\n }`}\n >\n {key.scope === \"workspace\" ? \"workspace\" : \"personal\"}\n </span>\n </div>\n {key.description && (\n <p className=\"text-[10px] text-muted-foreground mt-0.5\">\n {key.description}\n </p>\n )}\n <div className=\"flex items-center gap-2 text-[10px] text-muted-foreground mt-0.5\">\n <span>\n Ending in{\" \"}\n <code className=\"rounded bg-background px-1 py-0.5 text-foreground\">\n {key.last4}\n </code>\n </span>\n </div>\n </div>\n <div className=\"shrink-0\">\n {confirmDeleteName === key.name ? (\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => handleDelete(key.name)}\n disabled={deletingName === key.name}\n className=\"rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-red-500/15 text-red-500 hover:bg-red-500/25 disabled:opacity-40\"\n >\n {deletingName === key.name ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Confirm\"\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => setConfirmDeleteName(null)}\n className=\"rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-accent/60 text-muted-foreground hover:text-foreground\"\n >\n Cancel\n </button>\n </div>\n ) : (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() => setConfirmDeleteName(key.name)}\n className=\"text-muted-foreground hover:text-red-500\"\n >\n <IconTrash size={12} />\n </button>\n </TooltipTrigger>\n <TooltipContent>Delete</TooltipContent>\n </Tooltip>\n )}\n </div>\n </div>\n </div>\n ))\n )}\n\n {toast && (\n <p\n className={`text-[10px] ${toast.kind === \"ok\" ? \"text-green-500\" : \"text-red-500\"}`}\n >\n {toast.text}\n </p>\n )}\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPanel.d.ts","sourceRoot":"","sources":["../../../src/client/settings/SettingsPanel.tsx"],"names":[],"mappings":"AAwyDA,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;
|
|
1
|
+
{"version":3,"file":"SettingsPanel.d.ts","sourceRoot":"","sources":["../../../src/client/settings/SettingsPanel.tsx"],"names":[],"mappings":"AAwyDA,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAwRD,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,eAAe,EACf,aAAa,EACb,SAAS,EACT,cAAc,EACd,iBAAiB,GAClB,EAAE,kBAAkB,2CAwYpB"}
|
|
@@ -31,7 +31,7 @@ const CONTROL_STYLE = {
|
|
|
31
31
|
};
|
|
32
32
|
function SettingsSelect({ label, labelAdornment, value, options, onValueChange, }) {
|
|
33
33
|
const selected = options.find((option) => option.value === value);
|
|
34
|
-
return (_jsxs("div", { className: "space-y-1.5", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("p", { className: "text-[12px] font-medium text-foreground", children: label }), labelAdornment] }), _jsxs(SelectPrimitive.Root, { value: value, onValueChange: onValueChange, children: [_jsxs(SelectPrimitive.Trigger, { className: "flex h-9 w-full items-center justify-between rounded-md border border-border bg-background px-3 text-
|
|
34
|
+
return (_jsxs("div", { className: "space-y-1.5", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("p", { className: "text-[12px] font-medium text-foreground", children: label }), labelAdornment] }), _jsxs(SelectPrimitive.Root, { value: value, onValueChange: onValueChange, children: [_jsxs(SelectPrimitive.Trigger, { className: "flex h-9 w-full items-center justify-between rounded-md border border-border bg-background px-3 text-start text-[12px] text-foreground outline-none transition-colors hover:bg-accent/40 data-[placeholder]:text-muted-foreground", "aria-label": label, style: CONTROL_STYLE, children: [_jsx(SelectPrimitive.Value, { children: selected?.label ?? value }), _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(IconChevronDown, { size: 14, className: "text-muted-foreground" }) })] }), _jsx(SelectPrimitive.Portal, { children: _jsx(SelectPrimitive.Content, { position: "popper", sideOffset: 6, className: "z-[9999] w-[var(--radix-select-trigger-width)] overflow-hidden rounded-lg border border-border bg-popover shadow-lg", children: _jsx(SelectPrimitive.Viewport, { className: "p-1", children: options.map((option) => (_jsxs(SelectPrimitive.Item, { value: option.value, className: "relative flex w-full cursor-pointer select-none items-start gap-2 rounded-md px-8 py-2.5 text-[12px] outline-none data-[highlighted]:bg-accent/60 data-[state=checked]:bg-accent/40", style: CONTROL_STYLE, children: [_jsx("span", { className: "absolute start-2 top-2.5 flex h-4 w-4 items-center justify-center text-muted-foreground", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(IconCheck, { size: 14 }) }) }), _jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx(SelectPrimitive.ItemText, { children: _jsx("span", { className: "text-foreground", children: option.label }) }), option.description ? (_jsx("span", { className: "mt-0.5 text-[11px] leading-relaxed text-muted-foreground", children: option.description })) : null] })] }, option.value))) }) }) })] })] }));
|
|
35
35
|
}
|
|
36
36
|
// ─── Disconnect button for the Builder card's connected state ───────────────
|
|
37
37
|
//
|
|
@@ -147,7 +147,7 @@ function UseBuilderCard({ builderFlow, connectUrl, connected, orgName, envManage
|
|
|
147
147
|
}
|
|
148
148
|
if (!connectUrl)
|
|
149
149
|
return null;
|
|
150
|
-
return (_jsx("button", { type: "button", onClick: () => builderFlow.start({ trackingSource, trackingFlow }), disabled: builderFlow.connecting, className: `block w-full rounded-md border border-border px-3 py-3 text-
|
|
150
|
+
return (_jsx("button", { type: "button", onClick: () => builderFlow.start({ trackingSource, trackingFlow }), disabled: builderFlow.connecting, className: `block w-full rounded-md border border-border px-3 py-3 text-start no-underline bg-gradient-to-br from-teal-500/10 via-transparent to-transparent hover:border-foreground/30 transition-colors disabled:cursor-wait disabled:opacity-70`, children: _jsxs("div", { className: "flex items-start gap-2.5", children: [_jsx("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-foreground text-background", children: _jsx(BuilderBMark, { className: "h-3.5 w-3.5" }) }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [_jsx("span", { className: "text-[12px] font-semibold text-foreground", children: builderFlow.connecting ? "Connecting Builder.io..." : label }), builderFlow.connecting && (_jsx(IconLoader2, { size: 12, className: "shrink-0 animate-spin text-muted-foreground" }))] }), _jsx("p", { className: "text-[10.5px] text-muted-foreground mt-0.5 leading-snug", children: subtitle }), builderFlow.error && (_jsx("p", { className: "mt-1 text-[10px] text-destructive", children: builderFlow.error }))] }), _jsx(IconExternalLink, { size: 12, className: "shrink-0 text-muted-foreground mt-0.5" })] }) }));
|
|
151
151
|
}
|
|
152
152
|
// ─── Manual setup card ──────────────────────────────────────────────────────
|
|
153
153
|
function ManualSetupCard({ hint, docsUrl, docsLabel = "Read the docs", children, dim, sourceBadge, }) {
|
|
@@ -422,7 +422,7 @@ function LLMSectionInner({ builderFlow, builderLoading, connectUrl, connected, o
|
|
|
422
422
|
} }), _jsxs("div", { className: "space-y-1.5", children: [_jsx("p", { className: "text-[12px] font-medium text-foreground", children: "Model" }), _jsx("input", { type: "text", list: `model-suggestions-${selectedEngine}`, value: selectedModel, onChange: (e) => setSelectedModel(e.target.value), placeholder: selectedEngineInfo?.defaultModel ?? "e.g. model-id", spellCheck: false, autoComplete: "off", className: "flex h-9 w-full rounded-md border border-border bg-background px-3 text-[12px] text-foreground outline-none transition-colors hover:bg-accent/40 focus:ring-1 focus:ring-accent placeholder:text-muted-foreground/50", style: CONTROL_STYLE }), modelOptions.length > 0 && (_jsx("datalist", { id: `model-suggestions-${selectedEngine}`, children: modelOptions.map((opt) => (_jsx("option", { value: opt.value, label: opt.label }, opt.value))) }))] }), envVar && envConfigured ? (_jsxs("div", { className: "flex items-center gap-1.5 text-[10px] text-green-500", children: [_jsx(IconCheck, { size: 10 }), envVar, " configured"] })) : envVar ? (_jsxs("div", { className: "flex gap-1.5", children: [_jsx("input", { type: "password", value: apiKey, onChange: (e) => setApiKey(e.target.value), onKeyDown: (e) => {
|
|
423
423
|
if (e.key === "Enter")
|
|
424
424
|
handleSave();
|
|
425
|
-
}, placeholder: PROVIDER_ENV_PLACEHOLDERS[envVar] ?? "...", className: "flex-1 rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent" }), _jsx("button", { onClick: handleSave, disabled: !apiKey.trim() || saving, className: "rounded bg-accent px-2 py-1 text-[10px] font-medium text-foreground hover:bg-accent/80 disabled:opacity-40", children: saving ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : saved ? (_jsx(IconCheck, { size: 10 })) : ("Save") })] })) : null, _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("button", { onClick: handleTest, disabled: testing, className: "rounded border border-border px-2.5 py-1 text-[10px] font-medium text-foreground hover:bg-accent/40 disabled:opacity-40", children: testing ? (_jsxs("span", { className: "flex items-center gap-1", children: [_jsx(IconLoader2, { size: 10, className: "animate-spin" }), "Testing\u2026"] })) : ("Test") }), engineChanged && (_jsx("button", { onClick: handleApply, className: "rounded bg-accent px-2.5 py-1 text-[10px] font-medium text-foreground hover:bg-accent/80", children: "Apply" })), settingsStatus != null && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { onClick: handleDisconnect, className: "
|
|
425
|
+
}, placeholder: PROVIDER_ENV_PLACEHOLDERS[envVar] ?? "...", className: "flex-1 rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent" }), _jsx("button", { onClick: handleSave, disabled: !apiKey.trim() || saving, className: "rounded bg-accent px-2 py-1 text-[10px] font-medium text-foreground hover:bg-accent/80 disabled:opacity-40", children: saving ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : saved ? (_jsx(IconCheck, { size: 10 })) : ("Save") })] })) : null, _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("button", { onClick: handleTest, disabled: testing, className: "rounded border border-border px-2.5 py-1 text-[10px] font-medium text-foreground hover:bg-accent/40 disabled:opacity-40", children: testing ? (_jsxs("span", { className: "flex items-center gap-1", children: [_jsx(IconLoader2, { size: 10, className: "animate-spin" }), "Testing\u2026"] })) : ("Test") }), engineChanged && (_jsx("button", { onClick: handleApply, className: "rounded bg-accent px-2.5 py-1 text-[10px] font-medium text-foreground hover:bg-accent/80", children: "Apply" })), settingsStatus != null && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { onClick: handleDisconnect, className: "ms-auto rounded border border-border px-2.5 py-1 text-[10px] font-medium text-muted-foreground hover:bg-destructive/10 hover:text-destructive hover:border-destructive/40", children: "Disconnect" }) }), _jsx(TooltipContent, { children: "Clear the saved engine \u2014 the app will fall back to the default until you re-apply." })] }))] }), testResult && testResult.ok && (_jsxs("p", { className: "flex items-center gap-1 text-[10px] text-green-500", children: [_jsx(IconCheck, { size: 10 }), "Test passed \u2014 ", testResult.latencyMs, "ms"] })), testResult && testResult.ok === false && (_jsxs("p", { className: "text-[10px] text-destructive", children: ["Test failed: ", testResult.error] })), disconnectError && (_jsxs("p", { className: "text-[10px] text-destructive", children: ["Disconnect failed: ", disconnectError] })), applyNote && (_jsx("p", { className: "text-[10px] text-muted-foreground", children: "Changes take effect on next conversation" }))] }) }))] })) }));
|
|
426
426
|
}
|
|
427
427
|
function friendlyAppName(appId) {
|
|
428
428
|
return appId
|
|
@@ -833,7 +833,7 @@ const agentModeOptions = [
|
|
|
833
833
|
},
|
|
834
834
|
];
|
|
835
835
|
function CapabilityStatusRow({ label, value, active, }) {
|
|
836
|
-
return (_jsxs("div", { className: "flex items-center justify-between gap-2 text-[10px]", children: [_jsxs("span", { className: "flex items-center gap-1.5 text-muted-foreground", children: [_jsx("span", { className: `h-1.5 w-1.5 rounded-full ${active ? "bg-green-500" : "bg-muted-foreground/30"}`, "aria-hidden": "true" }), label] }), _jsx("span", { className: "min-w-0 truncate text-
|
|
836
|
+
return (_jsxs("div", { className: "flex items-center justify-between gap-2 text-[10px]", children: [_jsxs("span", { className: "flex items-center gap-1.5 text-muted-foreground", children: [_jsx("span", { className: `h-1.5 w-1.5 rounded-full ${active ? "bg-green-500" : "bg-muted-foreground/30"}`, "aria-hidden": "true" }), label] }), _jsx("span", { className: "min-w-0 truncate text-end text-foreground", children: value })] }));
|
|
837
837
|
}
|
|
838
838
|
function CapabilityStatusStrip({ isDevMode, builderConnected, builderLoading, builderBranchesAvailable, onOpenLlm, }) {
|
|
839
839
|
const codeAvailable = isDevMode || (builderConnected && builderBranchesAvailable);
|