@agent-native/core 0.134.0 → 0.135.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +3 -3
- package/corpus/core/CHANGELOG.md +113 -0
- package/corpus/core/docs/content/template-content-developers.mdx +1 -1
- package/corpus/core/package.json +3 -2
- package/corpus/core/src/automations/service.ts +41 -4
- package/corpus/core/src/cli/mcp-config-writers.ts +27 -21
- package/corpus/core/src/client/agent-page/AgentJobsTab.tsx +187 -85
- package/corpus/core/src/client/agent-page/AutomationDetailsDialog.tsx +208 -0
- package/corpus/core/src/client/agent-page/AutomationScheduleDialog.tsx +180 -0
- package/corpus/core/src/client/agent-page/TimezoneSelect.tsx +241 -0
- package/corpus/core/src/client/agent-page/use-jobs.ts +50 -10
- package/corpus/core/src/client/org/OrgSwitcher.tsx +26 -0
- package/corpus/core/src/client/settings/AccountSettingsCard.tsx +35 -31
- package/corpus/core/src/client/settings/SchedulingTimezoneField.tsx +71 -0
- package/corpus/core/src/client/settings/SettingsRow.tsx +113 -0
- package/corpus/core/src/client/settings/agent-settings-search.ts +2 -1
- package/corpus/core/src/client/settings/index.ts +6 -0
- package/corpus/core/src/integrations/identity.ts +2 -12
- package/corpus/core/src/jobs/actions/list-automation-runs.ts +33 -0
- package/corpus/core/src/jobs/actions/list-recurring-jobs.ts +27 -6
- package/corpus/core/src/jobs/actions/manage-recurring-job.ts +41 -9
- package/corpus/core/src/jobs/background-automation-runner.ts +88 -0
- package/corpus/core/src/jobs/cron.ts +52 -6
- package/corpus/core/src/jobs/frontmatter.ts +20 -0
- package/corpus/core/src/jobs/run-history.ts +242 -0
- package/corpus/core/src/jobs/scheduler.ts +73 -18
- package/corpus/core/src/jobs/tools.ts +54 -6
- package/corpus/core/src/localization/actions/get-localization-preference.ts +2 -2
- package/corpus/core/src/localization/actions/set-localization-preference.ts +49 -11
- package/corpus/core/src/localization/default-messages.ts +27 -0
- package/corpus/core/src/localization/shared.ts +39 -6
- package/corpus/core/src/localization/user-timezone.ts +36 -0
- package/corpus/core/src/org/app-roles-handlers.ts +1 -9
- package/corpus/core/src/org/index.ts +2 -0
- package/corpus/core/src/org/membership.ts +18 -0
- package/corpus/core/src/review/actions/create-review-comment.ts +4 -1
- package/corpus/core/src/review/actions/reply-review-comment.ts +4 -1
- package/corpus/core/src/review/index.ts +5 -0
- package/corpus/core/src/review/notifications.ts +163 -0
- package/corpus/core/src/review/types.ts +7 -0
- package/corpus/core/src/server/action-discovery.ts +4 -0
- package/corpus/core/src/server/activity-notifications.ts +174 -0
- package/corpus/core/src/server/app-name.ts +31 -0
- package/corpus/core/src/server/better-auth-instance.ts +4 -4
- package/corpus/core/src/server/email-templates.ts +70 -14
- package/corpus/core/src/server/email.ts +66 -3
- package/corpus/core/src/server/index.ts +10 -0
- package/corpus/core/src/sharing/index.ts +5 -0
- package/corpus/core/src/sharing/recipients.ts +67 -0
- package/corpus/core/src/triggers/actions/list-automations.ts +27 -8
- package/corpus/core/src/triggers/actions/manage-automation.ts +17 -6
- package/corpus/core/src/triggers/actions.ts +16 -4
- package/corpus/core/src/triggers/dispatcher.ts +44 -30
- package/corpus/core/src/triggers/routes.ts +19 -6
- package/corpus/core/src/vitest-config.ts +68 -0
- package/corpus/core/vitest.config.ts +5 -0
- package/corpus/templates/analytics/app/pages/Settings.tsx +37 -53
- package/corpus/templates/analytics/changelog/2026-08-01-new-error-alerts-now-reach-you-by-email-and-a-scheduled-dash.md +6 -0
- package/corpus/templates/analytics/server/jobs/dashboard-report.ts +43 -0
- package/corpus/templates/analytics/server/lib/error-capture.ts +5 -1
- package/corpus/templates/analytics/vitest.config.ts +16 -12
- package/corpus/templates/assets/actions/refresh-generation-run.ts +3 -0
- package/corpus/templates/assets/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/assets/app/hooks/use-assets-prefs.ts +55 -0
- package/corpus/templates/assets/app/i18n-data.ts +30 -0
- package/corpus/templates/assets/app/routes/settings.tsx +58 -55
- package/corpus/templates/assets/changelog/2026-08-01-get-an-email-when-a-generation-you-started-finishes-or-fails.md +6 -0
- package/corpus/templates/assets/server/lib/generation-run-notifications.ts +89 -0
- package/corpus/templates/assets/server/lib/video-runs.ts +8 -1
- package/corpus/templates/assets/server/routes/_agent-native/assets/user-prefs.get.ts +17 -0
- package/corpus/templates/assets/server/routes/_agent-native/assets/user-prefs.put.ts +36 -0
- package/corpus/templates/assets/shared/assets-user-prefs.ts +10 -0
- package/corpus/templates/assets/vitest.config.ts +16 -12
- package/corpus/templates/brain/app/routes/settings.tsx +15 -15
- package/corpus/templates/brain/vitest.config.ts +16 -12
- package/corpus/templates/calendar/app/pages/Settings.tsx +32 -40
- package/corpus/templates/calendar/changelog/2026-08-01-language-and-appearance-now-sit-together-in-one-preferences-.md +6 -0
- package/corpus/templates/calendar/vitest.config.ts +16 -12
- package/corpus/templates/chat/app/routes/settings.tsx +14 -22
- package/corpus/templates/chat/vitest.config.ts +9 -0
- package/corpus/templates/clips/.agents/skills/video-editing/SKILL.md +31 -0
- package/corpus/templates/clips/AGENTS.md +1 -0
- package/corpus/templates/clips/actions/add-comment.ts +12 -1
- package/corpus/templates/clips/actions/create-meeting.ts +2 -2
- package/corpus/templates/clips/actions/create-recording.ts +2 -2
- package/corpus/templates/clips/actions/finalize-recording.ts +42 -6
- package/corpus/templates/clips/actions/generate-filmstrip.ts +154 -0
- package/corpus/templates/clips/actions/get-recording-player-data.ts +6 -0
- package/corpus/templates/clips/actions/import-loom-recording.ts +2 -2
- package/corpus/templates/clips/actions/lib/ensure-recording-filmstrip.ts +258 -0
- package/corpus/templates/clips/actions/lib/ensure-seekable-video.ts +11 -3
- package/corpus/templates/clips/actions/react-to-comment.ts +13 -0
- package/corpus/templates/clips/actions/react-to-recording.ts +10 -1
- package/corpus/templates/clips/actions/reply-to-comment.ts +12 -1
- package/corpus/templates/clips/actions/stitch-recordings.ts +2 -2
- package/corpus/templates/clips/app/components/editor/editor-layout.tsx +152 -23
- package/corpus/templates/clips/app/components/editor/waveform.tsx +237 -75
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +23 -1
- package/corpus/templates/clips/app/components/settings/ai-setup-section.tsx +441 -0
- package/corpus/templates/clips/app/components/settings/slack-section.tsx +329 -0
- package/corpus/templates/clips/app/components/settings/types.ts +14 -0
- package/corpus/templates/clips/app/components/settings/video-storage-section.tsx +443 -0
- package/corpus/templates/clips/app/hooks/use-secret-status.ts +69 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +9 -1
- package/corpus/templates/clips/app/lib/video-filmstrip.ts +262 -0
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +165 -1351
- package/corpus/templates/clips/changelog/2026-07-27-saved-clips-now-resume-from-the-last-uploaded-byte-after-an-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-29-meeting-notes-no-longer-transcribe-the-other-side-twice-when.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-31-editor-timeline-now-shows-video-frames-behind-the-waveform-g.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-31-email-notifications-now-go-out-when-someone-comments-on-or-r.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-31-you-can-now-set-a-default-visibility-for-new-recordings-in-s.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-01-email-notifications-for-comments-and-reactions-now-actually-.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-03-the-desktop-app-now-opens-directly-beneath-its-tray-icon-on-.md +6 -0
- package/corpus/templates/clips/chrome-extension/package.json +1 -0
- package/corpus/templates/clips/chrome-extension/vitest.config.ts +9 -0
- package/corpus/templates/clips/desktop/package.json +1 -0
- package/corpus/templates/clips/desktop/src/app.tsx +17 -1
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +37 -48
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +331 -36
- package/corpus/templates/clips/desktop/src/lib/transcription-capture.ts +7 -5
- package/corpus/templates/clips/desktop/src/lib/transcription-engine.ts +182 -106
- package/corpus/templates/clips/desktop/src/lib/upload-recovery.ts +129 -0
- package/corpus/templates/clips/desktop/src/overlays/live-transcript.tsx +43 -14
- package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +3 -3
- package/corpus/templates/clips/desktop/src-tauri/src/echo_guard.rs +443 -0
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +1 -0
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +815 -15
- package/corpus/templates/clips/desktop/src-tauri/src/tray.rs +61 -11
- package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +125 -16
- package/corpus/templates/clips/desktop/vitest.config.ts +9 -0
- package/corpus/templates/clips/server/db/schema.ts +17 -0
- package/corpus/templates/clips/server/jobs/media-verification.ts +4 -0
- package/corpus/templates/clips/server/lib/activity-notifications.ts +185 -0
- package/corpus/templates/clips/server/lib/recording-media-cleanup.ts +2 -0
- package/corpus/templates/clips/server/lib/recording-upload-state.ts +46 -9
- package/corpus/templates/clips/server/lib/recordings.ts +24 -0
- package/corpus/templates/clips/server/lib/resumable-session.ts +10 -4
- package/corpus/templates/clips/server/lib/transactional-email-templates.ts +109 -0
- package/corpus/templates/clips/server/lib/upload-interruption.ts +8 -0
- package/corpus/templates/clips/server/lib/upload-lease.ts +50 -4
- package/corpus/templates/clips/server/lib/video-filmstrip-sprite.ts +207 -0
- package/corpus/templates/clips/server/lib/video-remux.ts +13 -4
- package/corpus/templates/clips/server/plugins/db.ts +16 -0
- package/corpus/templates/clips/server/routes/api/_agent-native-background/post-finalize-worker.post.ts +4 -0
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/abort.post.ts +123 -36
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +159 -29
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/interrupt.post.ts +197 -0
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/reset-chunks.post.ts +193 -39
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/resume.get.ts +191 -12
- package/corpus/templates/clips/shared/clips-ai-prefs.ts +6 -0
- package/corpus/templates/clips/shared/feature-flags.ts +12 -0
- package/corpus/templates/clips/shared/recording-core.ts +4 -0
- package/corpus/templates/clips/vitest.config.ts +23 -19
- package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +6 -4
- package/corpus/templates/content/actions/_database-membership-lock.ts +25 -0
- package/corpus/templates/content/actions/_database-row-batch.ts +6 -2
- package/corpus/templates/content/actions/_database-source-utils.ts +289 -129
- package/corpus/templates/content/actions/_database-utils.ts +12 -3
- package/corpus/templates/content/actions/add-comment.ts +15 -1
- package/corpus/templates/content/actions/add-content-database-source-field-property.ts +39 -21
- package/corpus/templates/content/actions/attach-content-database-source.ts +4 -1
- package/corpus/templates/content/actions/change-content-database-source-role.ts +3 -5
- package/corpus/templates/content/actions/duplicate-document-property.ts +59 -46
- package/corpus/templates/content/actions/execute-builder-source-execution.ts +77 -71
- package/corpus/templates/content/actions/list-documents.ts +1 -0
- package/corpus/templates/content/actions/materialize-builder-required-fields.ts +7 -0
- package/corpus/templates/content/actions/remove-database-items.ts +183 -0
- package/corpus/templates/content/actions/set-document-property.ts +57 -39
- package/corpus/templates/content/actions/sync-local-folder-source.ts +7 -0
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +5 -2
- package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +50 -1
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +471 -329
- package/corpus/templates/content/app/components/editor/database/row-access.ts +45 -0
- package/corpus/templates/content/app/components/editor/database/shared.tsx +141 -38
- package/corpus/templates/content/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/content/app/hooks/use-content-database.ts +2 -2
- package/corpus/templates/content/app/hooks/use-content-prefs.ts +55 -0
- package/corpus/templates/content/app/i18n-data.ts +170 -0
- package/corpus/templates/content/app/routes/_app.settings.tsx +47 -18
- package/corpus/templates/content/changelog/2026-07-30-breadcrumb-menus-now-hide-internal-system-pages.md +6 -0
- package/corpus/templates/content/changelog/2026-07-30-database-rows-can-now-be-removed-without-deleting-their-page.md +6 -0
- package/corpus/templates/content/changelog/2026-08-01-get-an-email-when-someone-comments-on-replies-in-or-mentions.md +6 -0
- package/corpus/templates/content/parity/eval-scenarios.ts +2 -2
- package/corpus/templates/content/parity/matrix.md +1 -1
- package/corpus/templates/content/parity/matrix.ts +4 -5
- package/corpus/templates/content/server/lib/comment-notifications.ts +146 -0
- package/corpus/templates/content/server/routes/_agent-native/content/user-prefs.get.ts +17 -0
- package/corpus/templates/content/server/routes/_agent-native/content/user-prefs.put.ts +36 -0
- package/corpus/templates/content/shared/api.ts +4 -0
- package/corpus/templates/content/shared/content-user-prefs.ts +11 -0
- package/corpus/templates/content/vitest.config.ts +20 -16
- package/corpus/templates/crm/app/routes/settings.tsx +14 -22
- package/corpus/templates/crm/vitest.config.ts +8 -4
- package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +26 -11
- package/corpus/templates/design/actions/take-design-screenshot.ts +7 -0
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +11 -3
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +4 -1
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +54 -17
- package/corpus/templates/design/app/components/design/design-canvas/local-runtime.ts +126 -0
- package/corpus/templates/design/app/components/templates/TemplatePreview.tsx +2 -0
- package/corpus/templates/design/app/pages/Index.tsx +3 -1
- package/corpus/templates/design/app/pages/Present.tsx +2 -1
- package/corpus/templates/design/app/routes/settings.tsx +14 -22
- package/corpus/templates/design/changelog/2026-07-30-a-broken-inline-script-in-a-generated-screen-is-now-caught-o.md +6 -0
- package/corpus/templates/design/changelog/2026-07-30-design-html-is-now-validated-with-a-spec-grade-html-parser-i.md +6 -0
- package/corpus/templates/design/changelog/2026-07-30-designs-now-load-their-tailwind-and-alpine-runtimes-from-the.md +6 -0
- package/corpus/templates/design/changelog/2026-07-30-designs-with-a-broken-alpine-expression-are-now-caught-on-sa.md +6 -0
- package/corpus/templates/design/changelog/2026-07-30-editing-a-design-no-longer-strips-its-styling-the-canvas-kep.md +6 -0
- package/corpus/templates/design/changelog/2026-08-01-review-comments-replies-and-mentions-now-send-an-email-to-th.md +6 -0
- package/corpus/templates/design/package.json +4 -0
- package/corpus/templates/design/shared/html-integrity.ts +802 -556
- package/corpus/templates/design/vitest.config.ts +18 -12
- package/corpus/templates/dispatch/app/routes/settings.tsx +26 -40
- package/corpus/templates/dispatch/vitest.config.ts +11 -7
- package/corpus/templates/factory/app/routes/settings.tsx +14 -22
- package/corpus/templates/factory/vitest.config.ts +9 -0
- package/corpus/templates/forms/app/routes/_app.settings.tsx +14 -22
- package/corpus/templates/forms/vitest.config.ts +27 -23
- package/corpus/templates/macros/app/routes/settings.tsx +14 -22
- package/corpus/templates/macros/vitest.config.ts +16 -12
- package/corpus/templates/mail/app/pages/SettingsPage.tsx +14 -16
- package/corpus/templates/mail/vitest.config.ts +16 -12
- package/corpus/templates/plan/app/routes/settings.tsx +30 -44
- package/corpus/templates/plan/vitest.config.ts +24 -20
- package/corpus/templates/slides/actions/add-slide-comment.ts +12 -1
- package/corpus/templates/slides/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/slides/app/hooks/use-slides-prefs.ts +55 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +4 -0
- package/corpus/templates/slides/app/routes/settings.tsx +45 -22
- package/corpus/templates/slides/changelog/2026-08-01-get-an-email-when-someone-comments-on-or-replies-in-your-dec.md +6 -0
- package/corpus/templates/slides/server/lib/comment-notifications.ts +182 -0
- package/corpus/templates/slides/server/routes/_agent-native/slides/user-prefs.get.ts +16 -0
- package/corpus/templates/slides/server/routes/_agent-native/slides/user-prefs.put.ts +36 -0
- package/corpus/templates/slides/shared/slides-user-prefs.ts +11 -0
- package/corpus/templates/slides/vitest.config.ts +17 -13
- package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +2 -0
- package/corpus/templates/tasks/app/routes/settings.tsx +14 -22
- package/corpus/templates/tasks/vitest.config.ts +17 -13
- package/corpus/toolkit/CHANGELOG.md +9 -0
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/vitest.config.ts +3 -0
- package/dist/automations/service.d.ts +2 -0
- package/dist/automations/service.d.ts.map +1 -1
- package/dist/automations/service.js +29 -4
- package/dist/automations/service.js.map +1 -1
- package/dist/cli/mcp-config-writers.d.ts.map +1 -1
- package/dist/cli/mcp-config-writers.js +24 -23
- package/dist/cli/mcp-config-writers.js.map +1 -1
- package/dist/client/agent-page/AgentJobsTab.d.ts.map +1 -1
- package/dist/client/agent-page/AgentJobsTab.js +86 -29
- package/dist/client/agent-page/AgentJobsTab.js.map +1 -1
- package/dist/client/agent-page/AutomationDetailsDialog.d.ts +21 -0
- package/dist/client/agent-page/AutomationDetailsDialog.d.ts.map +1 -0
- package/dist/client/agent-page/AutomationDetailsDialog.js +33 -0
- package/dist/client/agent-page/AutomationDetailsDialog.js.map +1 -0
- package/dist/client/agent-page/AutomationScheduleDialog.d.ts +15 -0
- package/dist/client/agent-page/AutomationScheduleDialog.d.ts.map +1 -0
- package/dist/client/agent-page/AutomationScheduleDialog.js +46 -0
- package/dist/client/agent-page/AutomationScheduleDialog.js.map +1 -0
- package/dist/client/agent-page/TimezoneSelect.d.ts +17 -0
- package/dist/client/agent-page/TimezoneSelect.d.ts.map +1 -0
- package/dist/client/agent-page/TimezoneSelect.js +107 -0
- package/dist/client/agent-page/TimezoneSelect.js.map +1 -0
- package/dist/client/agent-page/use-jobs.d.ts +20 -7
- package/dist/client/agent-page/use-jobs.d.ts.map +1 -1
- package/dist/client/agent-page/use-jobs.js +24 -4
- package/dist/client/agent-page/use-jobs.js.map +1 -1
- package/dist/client/org/OrgSwitcher.d.ts +8 -1
- package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +8 -2
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/settings/AccountSettingsCard.d.ts.map +1 -1
- package/dist/client/settings/AccountSettingsCard.js +10 -9
- package/dist/client/settings/AccountSettingsCard.js.map +1 -1
- package/dist/client/settings/SchedulingTimezoneField.d.ts +10 -0
- package/dist/client/settings/SchedulingTimezoneField.d.ts.map +1 -0
- package/dist/client/settings/SchedulingTimezoneField.js +30 -0
- package/dist/client/settings/SchedulingTimezoneField.js.map +1 -0
- package/dist/client/settings/SettingsRow.d.ts +36 -0
- package/dist/client/settings/SettingsRow.d.ts.map +1 -0
- package/dist/client/settings/SettingsRow.js +15 -0
- package/dist/client/settings/SettingsRow.js.map +1 -0
- package/dist/client/settings/agent-settings-search.d.ts.map +1 -1
- package/dist/client/settings/agent-settings-search.js +1 -1
- package/dist/client/settings/agent-settings-search.js.map +1 -1
- package/dist/client/settings/index.d.ts +1 -0
- package/dist/client/settings/index.d.ts.map +1 -1
- package/dist/client/settings/index.js +1 -0
- package/dist/client/settings/index.js.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/integrations/identity.d.ts.map +1 -1
- package/dist/integrations/identity.js +2 -11
- package/dist/integrations/identity.js.map +1 -1
- package/dist/jobs/actions/list-automation-runs.d.ts +8 -0
- package/dist/jobs/actions/list-automation-runs.d.ts.map +1 -0
- package/dist/jobs/actions/list-automation-runs.js +29 -0
- package/dist/jobs/actions/list-automation-runs.js.map +1 -0
- package/dist/jobs/actions/list-recurring-jobs.d.ts +2 -0
- package/dist/jobs/actions/list-recurring-jobs.d.ts.map +1 -1
- package/dist/jobs/actions/list-recurring-jobs.js +20 -7
- package/dist/jobs/actions/list-recurring-jobs.js.map +1 -1
- package/dist/jobs/actions/manage-recurring-job.d.ts +2 -0
- package/dist/jobs/actions/manage-recurring-job.js +30 -9
- package/dist/jobs/actions/manage-recurring-job.js.map +1 -1
- package/dist/jobs/background-automation-runner.d.ts.map +1 -1
- package/dist/jobs/background-automation-runner.js +60 -0
- package/dist/jobs/background-automation-runner.js.map +1 -1
- package/dist/jobs/cron.d.ts +16 -2
- package/dist/jobs/cron.d.ts.map +1 -1
- package/dist/jobs/cron.js +43 -6
- package/dist/jobs/cron.js.map +1 -1
- package/dist/jobs/frontmatter.d.ts +12 -0
- package/dist/jobs/frontmatter.d.ts.map +1 -1
- package/dist/jobs/frontmatter.js +8 -0
- package/dist/jobs/frontmatter.js.map +1 -1
- package/dist/jobs/run-history.d.ts +56 -0
- package/dist/jobs/run-history.d.ts.map +1 -0
- package/dist/jobs/run-history.js +169 -0
- package/dist/jobs/run-history.js.map +1 -0
- package/dist/jobs/scheduler.d.ts.map +1 -1
- package/dist/jobs/scheduler.js +51 -18
- package/dist/jobs/scheduler.js.map +1 -1
- package/dist/jobs/tools.d.ts.map +1 -1
- package/dist/jobs/tools.js +37 -6
- package/dist/jobs/tools.js.map +1 -1
- package/dist/localization/actions/get-localization-preference.d.ts +1 -2
- package/dist/localization/actions/get-localization-preference.d.ts.map +1 -1
- package/dist/localization/actions/get-localization-preference.js.map +1 -1
- package/dist/localization/actions/set-localization-preference.d.ts +3 -3
- package/dist/localization/actions/set-localization-preference.d.ts.map +1 -1
- package/dist/localization/actions/set-localization-preference.js +33 -8
- package/dist/localization/actions/set-localization-preference.js.map +1 -1
- package/dist/localization/default-messages.d.ts +25 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +25 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/localization/shared.d.ts +16 -1
- package/dist/localization/shared.d.ts.map +1 -1
- package/dist/localization/shared.js +22 -4
- package/dist/localization/shared.js.map +1 -1
- package/dist/localization/user-timezone.d.ts +11 -0
- package/dist/localization/user-timezone.d.ts.map +1 -0
- package/dist/localization/user-timezone.js +31 -0
- package/dist/localization/user-timezone.js.map +1 -0
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +1 -1
- package/dist/org/app-roles-handlers.d.ts.map +1 -1
- package/dist/org/app-roles-handlers.js +1 -8
- package/dist/org/app-roles-handlers.js.map +1 -1
- package/dist/org/index.d.ts +1 -0
- package/dist/org/index.d.ts.map +1 -1
- package/dist/org/index.js +1 -0
- package/dist/org/index.js.map +1 -1
- package/dist/org/membership.d.ts +6 -0
- package/dist/org/membership.d.ts.map +1 -0
- package/dist/org/membership.js +16 -0
- package/dist/org/membership.js.map +1 -0
- package/dist/provider-api/actions/custom-provider-registration.d.ts +10 -10
- package/dist/provider-api/actions/provider-api.d.ts +8 -8
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/review/actions/create-review-comment.d.ts +32 -1
- package/dist/review/actions/create-review-comment.d.ts.map +1 -1
- package/dist/review/actions/create-review-comment.js +3 -1
- package/dist/review/actions/create-review-comment.js.map +1 -1
- package/dist/review/actions/reply-review-comment.d.ts +32 -1
- package/dist/review/actions/reply-review-comment.d.ts.map +1 -1
- package/dist/review/actions/reply-review-comment.js +3 -1
- package/dist/review/actions/reply-review-comment.js.map +1 -1
- package/dist/review/index.d.ts +1 -0
- package/dist/review/index.d.ts.map +1 -1
- package/dist/review/index.js +1 -0
- package/dist/review/index.js.map +1 -1
- package/dist/review/notifications.d.ts +24 -0
- package/dist/review/notifications.d.ts.map +1 -0
- package/dist/review/notifications.js +123 -0
- package/dist/review/notifications.js.map +1 -0
- package/dist/review/types.d.ts +5 -0
- package/dist/review/types.d.ts.map +1 -1
- package/dist/review/types.js.map +1 -1
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +4 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/activity-notifications.d.ts +61 -0
- package/dist/server/activity-notifications.d.ts.map +1 -0
- package/dist/server/activity-notifications.js +103 -0
- package/dist/server/activity-notifications.js.map +1 -0
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/app-name.d.ts +18 -0
- package/dist/server/app-name.d.ts.map +1 -1
- package/dist/server/app-name.js +31 -0
- package/dist/server/app-name.js.map +1 -1
- package/dist/server/better-auth-instance.js +4 -4
- package/dist/server/better-auth-instance.js.map +1 -1
- package/dist/server/email-templates.d.ts +12 -0
- package/dist/server/email-templates.d.ts.map +1 -1
- package/dist/server/email-templates.js +57 -14
- package/dist/server/email-templates.js.map +1 -1
- package/dist/server/email.d.ts +12 -0
- package/dist/server/email.d.ts.map +1 -1
- package/dist/server/email.js +52 -5
- package/dist/server/email.js.map +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -0
- package/dist/server/index.js.map +1 -1
- package/dist/sharing/index.d.ts +1 -0
- package/dist/sharing/index.d.ts.map +1 -1
- package/dist/sharing/index.js +1 -0
- package/dist/sharing/index.js.map +1 -1
- package/dist/sharing/recipients.d.ts +31 -0
- package/dist/sharing/recipients.d.ts.map +1 -0
- package/dist/sharing/recipients.js +40 -0
- package/dist/sharing/recipients.js.map +1 -0
- package/dist/templates/chat/app/routes/settings.tsx +14 -22
- package/dist/templates/chat/vitest.config.ts +9 -0
- package/dist/triggers/actions/list-automations.d.ts +2 -0
- package/dist/triggers/actions/list-automations.d.ts.map +1 -1
- package/dist/triggers/actions/list-automations.js +19 -8
- package/dist/triggers/actions/list-automations.js.map +1 -1
- package/dist/triggers/actions/manage-automation.d.ts +6 -0
- package/dist/triggers/actions/manage-automation.js +12 -6
- package/dist/triggers/actions/manage-automation.js.map +1 -1
- package/dist/triggers/actions.d.ts.map +1 -1
- package/dist/triggers/actions.js +15 -4
- package/dist/triggers/actions.js.map +1 -1
- package/dist/triggers/dispatcher.d.ts.map +1 -1
- package/dist/triggers/dispatcher.js +19 -17
- package/dist/triggers/dispatcher.js.map +1 -1
- package/dist/triggers/routes.d.ts.map +1 -1
- package/dist/triggers/routes.js +6 -6
- package/dist/triggers/routes.js.map +1 -1
- package/dist/vitest-config.d.ts +10 -0
- package/dist/vitest-config.d.ts.map +1 -0
- package/dist/vitest-config.js +55 -0
- package/dist/vitest-config.js.map +1 -0
- package/docs/content/template-content-developers.mdx +1 -1
- package/package.json +5 -4
- package/src/automations/service.ts +41 -4
- package/src/cli/mcp-config-writers.ts +27 -21
- package/src/client/agent-page/AgentJobsTab.tsx +187 -85
- package/src/client/agent-page/AutomationDetailsDialog.tsx +208 -0
- package/src/client/agent-page/AutomationScheduleDialog.tsx +180 -0
- package/src/client/agent-page/TimezoneSelect.tsx +241 -0
- package/src/client/agent-page/use-jobs.ts +50 -10
- package/src/client/org/OrgSwitcher.tsx +26 -0
- package/src/client/settings/AccountSettingsCard.tsx +35 -31
- package/src/client/settings/SchedulingTimezoneField.tsx +71 -0
- package/src/client/settings/SettingsRow.tsx +113 -0
- package/src/client/settings/agent-settings-search.ts +2 -1
- package/src/client/settings/index.ts +6 -0
- package/src/integrations/identity.ts +2 -12
- package/src/jobs/actions/list-automation-runs.ts +33 -0
- package/src/jobs/actions/list-recurring-jobs.ts +27 -6
- package/src/jobs/actions/manage-recurring-job.ts +41 -9
- package/src/jobs/background-automation-runner.ts +88 -0
- package/src/jobs/cron.ts +52 -6
- package/src/jobs/frontmatter.ts +20 -0
- package/src/jobs/run-history.ts +242 -0
- package/src/jobs/scheduler.ts +73 -18
- package/src/jobs/tools.ts +54 -6
- package/src/localization/actions/get-localization-preference.ts +2 -2
- package/src/localization/actions/set-localization-preference.ts +49 -11
- package/src/localization/default-messages.ts +27 -0
- package/src/localization/shared.ts +39 -6
- package/src/localization/user-timezone.ts +36 -0
- package/src/org/app-roles-handlers.ts +1 -9
- package/src/org/index.ts +2 -0
- package/src/org/membership.ts +18 -0
- package/src/review/actions/create-review-comment.ts +4 -1
- package/src/review/actions/reply-review-comment.ts +4 -1
- package/src/review/index.ts +5 -0
- package/src/review/notifications.ts +163 -0
- package/src/review/types.ts +7 -0
- package/src/server/action-discovery.ts +4 -0
- package/src/server/activity-notifications.ts +174 -0
- package/src/server/app-name.ts +31 -0
- package/src/server/better-auth-instance.ts +4 -4
- package/src/server/email-templates.ts +70 -14
- package/src/server/email.ts +66 -3
- package/src/server/index.ts +10 -0
- package/src/sharing/index.ts +5 -0
- package/src/sharing/recipients.ts +67 -0
- package/src/templates/chat/app/routes/settings.tsx +14 -22
- package/src/templates/chat/vitest.config.ts +9 -0
- package/src/triggers/actions/list-automations.ts +27 -8
- package/src/triggers/actions/manage-automation.ts +17 -6
- package/src/triggers/actions.ts +16 -4
- package/src/triggers/dispatcher.ts +44 -30
- package/src/triggers/routes.ts +19 -6
- package/src/vitest-config.ts +68 -0
- package/corpus/templates/content/actions/delete-database-items.ts +0 -89
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrgSwitcher.js","sourceRoot":"","sources":["../../../src/client/org/OrgSwitcher.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,eAAe,EACf,aAAa,EACb,WAAW,EACX,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,QAAQ,EACR,SAAS,EACT,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,SAAS,EACT,cAAc,EACd,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AA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,CAAC,EACD,SAAS,EAAC,aAAa,aAEvB,eAAK,SAAS,EAAC,uEAAuE,2BACzE,GAAG,CAAC,OAAO,IAClB,EACN,gBACE,SAAS,QACT,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC/C,WAAW,EAAC,sBAAsB,EAClC,QAAQ,EAAE,YAAY,CAAC,SAAS,EAChC,SAAS,EAAC,uIAAuI,GACjJ,EACD,YAAY,CAAC,KAAK,IAAI,CACrB,cAAK,SAAS,EAAC,mCAAmC,YAC9C,YAAY,CAAC,KAAe,CAAC,OAAO,GAClC,CACP,EACD,eAAK,SAAS,EAAC,kCAAkC,aAC/C,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAC9B,QAAQ,EAAE,YAAY,CAAC,SAAS,EAChC,SAAS,EAAC,8GAA8G,uBAGjH,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,YAAY,CAAC,SAAS,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,EACvD,SAAS,EAAC,yKAAyK,YAElL,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CACxB,KAAC,WAAW,IAAC,SAAS,EAAC,sBAAsB,GAAG,CACjD,CAAC,CAAC,CAAC,CACF,aAAa,CACd,GACM,IACL,IACD,CACR,IACwB,GACH,IACJ,CACzB,CAAC;AACJ,CAAC","sourcesContent":["import * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport {\n IconApps,\n IconArrowUpRight,\n IconBrain,\n IconBrandJira,\n IconBrush,\n IconCalendar,\n IconCalendarTime,\n IconChartBar,\n IconCheck,\n IconChevronRight,\n IconClipboardList,\n IconCode,\n IconExternalLink,\n IconFileText,\n IconKey,\n IconLayoutBoard,\n IconListCheck,\n IconLoader2,\n IconLogout,\n IconMail,\n IconMessageCircle,\n IconMicrophone,\n IconNote,\n IconPhone,\n IconPhoto,\n IconPlus,\n IconPresentation,\n IconRoute,\n IconScreenShare,\n IconSelector,\n IconSettings,\n IconStack2,\n IconUser,\n IconUserCircle,\n IconUserPlus,\n IconUsers,\n IconUsersGroup,\n IconWorld,\n} from \"@tabler/icons-react\";\nimport { useState } from \"react\";\nimport { useNavigate } from \"react-router\";\n\nimport { shouldOfferWorkspace } from \"../../org/workspace-url.js\";\nimport { agentNativePath } from \"../api-path.js\";\nimport { useT } from \"../i18n.js\";\nimport { useSession } from \"../use-session.js\";\nimport {\n useOrg,\n useSwitchOrg,\n useCreateOrg,\n useInviteMember,\n useAcceptInvitation,\n useJoinByDomain,\n} from \"./hooks.js\";\nimport {\n ORG_SWITCHER_MAX_APP_LINKS,\n useOrgSwitcherAppLinks,\n visibleOrgAppLinks,\n type OrgSwitcherAppLink,\n} from \"./workspace-app-links.js\";\n\nexport interface OrgSwitcherProps {\n className?: string;\n /** Hide entirely when the user only belongs to one org. Default: false. */\n hideWhenSingle?: boolean;\n /** Keep the switcher's button height reserved while org state is loading. */\n reserveSpace?: boolean;\n /**\n * Icon-only trigger for collapsed sidebar rails. The popover — and with it\n * the org list, pending invitations and \"Join your team\" — is identical;\n * dropping the switcher instead leaves a collapsed rail with no way to\n * reach another workspace.\n */\n compact?: boolean;\n /**\n * Path to navigate to when the user clicks \"Organization settings\".\n * Defaults to the Organization tab inside Settings. Templates with an\n * established org surface can pass their own path; pass `null` to only open\n * the in-sidebar settings panel.\n */\n settingsPath?: string | null;\n /** Path to navigate to when the user clicks \"Profile\". Defaults to the shared Account settings section. */\n profilePath?: string | null;\n}\n\nfunction personalLabelFromEmail(email: string | null | undefined): string {\n if (!email) return \"Personal\";\n const local = email.split(\"@\")[0] ?? email;\n const cleaned = local.replace(/[._-]+/g, \" \").trim();\n if (!cleaned) return \"Personal\";\n return cleaned\n .split(\" \")\n .filter(Boolean)\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\" \");\n}\n\ntype Mode = \"list\" | \"create\" | \"invite\";\n\nconst POPOVER_CONTENT_CLASS =\n \"z-50 min-w-[14rem] rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\";\n\nconst ITEM_CLASS =\n \"flex w-full items-center gap-2 px-2.5 py-1.5 text-xs text-foreground hover:bg-accent focus-visible:bg-accent focus:outline-none disabled:opacity-50 disabled:pointer-events-none\";\n\nconst SECTION_LABEL_CLASS =\n \"px-2.5 pt-1 pb-0.5 text-[10px] uppercase tracking-wide text-muted-foreground\";\n\nconst APP_SUBMENU_CONTENT_CLASS =\n \"z-50 w-72 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\";\n\nconst SWITCHER_BUTTON_CLASS =\n \"flex w-full items-center gap-2 rounded-md border-0 bg-accent/50 px-2.5 py-1.5 text-xs font-medium text-muted-foreground hover:bg-accent/70 hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-60 cursor-pointer\";\n\nconst COMPACT_SWITCHER_BUTTON_CLASS =\n \"flex items-center justify-center rounded-md border-0 bg-accent/50 p-1.5 text-muted-foreground hover:bg-accent/70 hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-60 cursor-pointer\";\n\nconst DEFAULT_ORGANIZATION_SETTINGS_PATH = \"/settings#organization\";\nconst DEFAULT_PROFILE_PATH = \"/settings#account\";\n\nconst APP_ICON_MAP: Record<string, typeof IconApps> = {\n Mail: IconMail,\n CalendarDays: IconCalendar,\n FileText: IconFileText,\n LayoutBoard: IconLayoutBoard,\n BarChart2: IconChartBar,\n GalleryHorizontal: IconPresentation,\n BrandJira: IconBrandJira,\n ClipboardList: IconClipboardList,\n Users: IconUsers,\n Code: IconCode,\n MessageCircle: IconMessageCircle,\n Route: IconRoute,\n ScreenShare: IconScreenShare,\n Brush: IconBrush,\n Brain: IconBrain,\n Phone: IconPhone,\n Note: IconNote,\n Microphone: IconMicrophone,\n CalendarTime: IconCalendarTime,\n Globe: IconWorld,\n Photo: IconPhoto,\n ListCheck: IconListCheck,\n};\n\nfunction appMenuIcon(app: OrgSwitcherAppLink): typeof IconApps {\n if (app.icon) return APP_ICON_MAP[app.icon] ?? IconStack2;\n return app.isDispatch ? IconMessageCircle : IconStack2;\n}\n\nfunction organizationSettingsPath(path: string): string {\n if (path.includes(\"#\")) return path;\n const pathname = path.split(\"?\")[0]?.replace(/\\/+$/, \"\");\n return pathname === \"/settings\" ? `${path}#organization` : path;\n}\n\nfunction AppMenuLink({\n app,\n onNavigate,\n}: {\n app: OrgSwitcherAppLink;\n onNavigate: () => void;\n}) {\n const Icon = appMenuIcon(app);\n const description =\n app.status === \"pending\"\n ? \"Building\"\n : app.description?.trim() ||\n (app.isDispatch ? \"Workspace hub\" : `${app.name} workspace`);\n return (\n <a\n href={app.href}\n onClick={onNavigate}\n className=\"flex items-center gap-2 rounded-sm px-2.5 py-2 text-xs outline-none hover:bg-accent focus:bg-accent\"\n >\n <span className=\"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground\">\n <Icon className=\"h-3.5 w-3.5\" />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-medium text-foreground\">\n {app.name}\n </span>\n <span\n className=\"block truncate text-[11px] text-muted-foreground\"\n title={description}\n >\n {description}\n </span>\n </span>\n <IconArrowUpRight className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n </a>\n );\n}\n\nfunction AppsSubmenu({\n apps,\n isLoading,\n dispatchHref,\n dispatchAllAppsHref,\n onNavigate,\n}: {\n apps: OrgSwitcherAppLink[];\n isLoading: boolean;\n dispatchHref: string;\n dispatchAllAppsHref: string;\n onNavigate: () => void;\n}) {\n const { links, overflowCount } = visibleOrgAppLinks(apps);\n const visibleDispatchApp = links.find((app) => app.isDispatch);\n const dispatchApp =\n visibleDispatchApp ??\n ({\n id: \"dispatch\",\n name: \"Dispatch\",\n href: dispatchHref,\n isDispatch: true,\n status: \"ready\",\n } satisfies OrgSwitcherAppLink);\n const visibleNonDispatch = links\n .filter((app) => !app.isDispatch)\n .slice(0, visibleDispatchApp ? undefined : ORG_SWITCHER_MAX_APP_LINKS - 1);\n const shownCount = (dispatchApp ? 1 : 0) + visibleNonDispatch.length;\n const remainingCount = Math.max(overflowCount, apps.length - shownCount);\n\n return (\n <PopoverPrimitive.Root>\n <PopoverPrimitive.Trigger asChild>\n <button type=\"button\" className={`${ITEM_CLASS} cursor-pointer`}>\n <IconApps className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-start\">Apps</span>\n <span className=\"text-[11px] text-muted-foreground\">\n {isLoading ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n apps.length\n )}\n </span>\n <IconChevronRight className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground rtl:-scale-x-100\" />\n </button>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n side=\"right\"\n align=\"start\"\n sideOffset={8}\n collisionPadding={12}\n className={APP_SUBMENU_CONTENT_CLASS}\n >\n <AppMenuLink app={dispatchApp} onNavigate={onNavigate} />\n\n {visibleNonDispatch.length > 0 && (\n <div className=\"my-1 h-px bg-border\" />\n )}\n {visibleNonDispatch.map((app) => (\n <AppMenuLink key={app.id} app={app} onNavigate={onNavigate} />\n ))}\n\n {remainingCount > 0 && (\n <>\n <div className=\"my-1 h-px bg-border\" />\n <a\n href={dispatchAllAppsHref}\n onClick={onNavigate}\n className=\"flex items-center gap-2 rounded-sm px-2.5 py-1.5 text-xs text-foreground outline-none hover:bg-accent focus:bg-accent\"\n >\n <IconApps className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1\">\n {`View ${remainingCount} more in Dispatch`}\n </span>\n <IconArrowUpRight className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n </a>\n </>\n )}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n );\n}\n\nfunction ReservedOrgSwitcherSpace({ className }: { className?: string }) {\n return <div aria-hidden=\"true\" className={`h-8 ${className ?? \"\"}`} />;\n}\n\nfunction OrgSwitcherLoadingPlaceholder({ className }: { className?: string }) {\n return (\n <button\n type=\"button\"\n disabled\n aria-label=\"Loading organization\"\n className={`${SWITCHER_BUTTON_CLASS} animate-pulse ${className ?? \"\"}`}\n >\n <IconUsersGroup className=\"h-3.5 w-3.5 shrink-0 opacity-60\" />\n <span className=\"h-3 min-w-0 flex-1 rounded-sm bg-muted-foreground/20\" />\n <IconSelector className=\"h-3 w-3 shrink-0 opacity-30\" />\n </button>\n );\n}\n\n/**\n * Compact org switcher button. Shows the active org (or \"Personal\" when the\n * user has none); opens a popover with the user's other orgs, pending\n * invitations, inline forms to create a new org / invite a teammate, and a\n * sign-out item. Renders nothing in dev / no-auth mode.\n */\nexport function OrgSwitcher({\n className,\n hideWhenSingle,\n reserveSpace,\n compact,\n settingsPath = DEFAULT_ORGANIZATION_SETTINGS_PATH,\n profilePath = DEFAULT_PROFILE_PATH,\n}: OrgSwitcherProps) {\n const { data: org, isLoading } = useOrg();\n const { session } = useSession();\n const t = useT();\n const switchOrg = useSwitchOrg();\n const createOrg = useCreateOrg();\n const inviteMember = useInviteMember();\n const acceptInvitation = useAcceptInvitation();\n const joinByDomain = useJoinByDomain();\n const navigate = useNavigate();\n const [open, setOpen] = useState(false);\n const [mode, setMode] = useState<Mode>(\"list\");\n const [newName, setNewName] = useState(\"\");\n const [inviteEmail, setInviteEmail] = useState(\"\");\n const [signingOut, setSigningOut] = useState(false);\n const [joiningOrgId, setJoiningOrgId] = useState<string | null>(null);\n const appLinks = useOrgSwitcherAppLinks(open);\n\n const handleOpenChange = (next: boolean) => {\n setOpen(next);\n if (!next) {\n setMode(\"list\");\n setNewName(\"\");\n setInviteEmail(\"\");\n }\n };\n\n const handleSignOut = async () => {\n if (signingOut) return;\n setSigningOut(true);\n try {\n await fetch(agentNativePath(\"/_agent-native/auth/logout\"), {\n method: \"POST\",\n credentials: \"include\",\n });\n } catch {\n /* fall through to reload — server may already have cleared the cookie */\n }\n window.location.reload();\n };\n\n if (!org) {\n return reserveSpace && isLoading ? (\n <OrgSwitcherLoadingPlaceholder className={className} />\n ) : null;\n }\n\n const orgs = org.orgs ?? [];\n const pendingInvitations = org.pendingInvitations ?? [];\n const domainMatches = org.domainMatches ?? [];\n const orgCount = orgs.length;\n const hasAny =\n orgCount > 0 || pendingInvitations.length > 0 || domainMatches.length > 0;\n if (!hasAny && !org.email) {\n return reserveSpace ? (\n <ReservedOrgSwitcherSpace className={className} />\n ) : null;\n }\n if (\n hideWhenSingle &&\n orgCount < 2 &&\n pendingInvitations.length === 0 &&\n domainMatches.length === 0\n ) {\n return reserveSpace ? (\n <ReservedOrgSwitcherSpace className={className} />\n ) : null;\n }\n\n const canInvite =\n !!org.orgId && (org.role === \"owner\" || org.role === \"admin\");\n\n const personalLabel = session?.name || personalLabelFromEmail(org.email);\n const inOrg = !!org.orgId;\n const buttonLabel = org.orgName ?? \"Personal\";\n const ButtonIcon = inOrg ? IconUsersGroup : IconUser;\n const organizationSettingsHref = settingsPath\n ? organizationSettingsPath(settingsPath)\n : null;\n\n return (\n <PopoverPrimitive.Root open={open} onOpenChange={handleOpenChange}>\n <PopoverPrimitive.Trigger asChild>\n {compact ? (\n <button\n type=\"button\"\n title={buttonLabel}\n aria-label={buttonLabel}\n className={`${COMPACT_SWITCHER_BUTTON_CLASS} ${className ?? \"\"}`}\n >\n <ButtonIcon className=\"h-3.5 w-3.5 shrink-0\" />\n </button>\n ) : (\n <button\n type=\"button\"\n className={`${SWITCHER_BUTTON_CLASS} ${className ?? \"\"}`}\n >\n <ButtonIcon className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"truncate flex-1 text-start\">{buttonLabel}</span>\n <IconSelector className=\"h-3 w-3 shrink-0 opacity-50\" />\n </button>\n )}\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n side=\"top\"\n align=\"start\"\n sideOffset={6}\n collisionPadding={12}\n className={`${POPOVER_CONTENT_CLASS} ${mode === \"list\" ? \"\" : \"w-64\"}`}\n onOpenAutoFocus={(e) => {\n // Don't auto-focus the first item — feels heavy on a switcher.\n if (mode === \"list\") e.preventDefault();\n }}\n >\n {mode === \"list\" && (\n <>\n {/* The org name alone is ambiguous: the same org exists on every\n deployment a member has signed into, so the switcher reads\n identically on all of them. The host is what tells them\n which one they're actually looking at. */}\n {typeof window !== \"undefined\" && (\n <div className=\"px-2.5 pb-1.5 pt-1 text-[11px] text-muted-foreground\">\n <div className=\"truncate\">{window.location.host}</div>\n {shouldOfferWorkspace(\n window.location.href,\n org.workspaceUrl,\n ) && (\n <a\n href={org.workspaceUrl ?? undefined}\n className=\"mt-0.5 inline-flex items-center gap-1 text-foreground no-underline hover:underline\"\n >\n <IconExternalLink className=\"h-3 w-3 shrink-0\" />\n Your workspace\n </a>\n )}\n </div>\n )}\n {!inOrg && (\n <div\n className=\"flex w-full items-center gap-2 px-2.5 py-1.5 text-xs text-muted-foreground\"\n aria-disabled=\"true\"\n >\n <IconUser className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"truncate flex-1 text-start\">\n Personal ({personalLabel})\n </span>\n </div>\n )}\n {orgs.length > 0 && (\n <div className={SECTION_LABEL_CLASS}>Organizations</div>\n )}\n {orgs.map((o) => (\n <button\n key={o.orgId}\n type=\"button\"\n onClick={async () => {\n if (o.orgId === org.orgId) {\n setOpen(false);\n return;\n }\n try {\n await switchOrg.mutateAsync(o.orgId);\n setOpen(false);\n } catch {\n /* error surfaced via switchOrg.error */\n }\n }}\n disabled={switchOrg.isPending}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconUsersGroup className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"truncate flex-1 text-start\">\n {o.orgName}\n </span>\n {o.orgId === org.orgId && (\n <IconCheck className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n )}\n </button>\n ))}\n\n {pendingInvitations.length > 0 && (\n <>\n {orgs.length > 0 && <div className=\"my-1 h-px bg-border\" />}\n <div className={SECTION_LABEL_CLASS}>Invitations</div>\n {pendingInvitations.map((inv) => (\n <div key={inv.id} className=\"px-2.5 py-1.5 text-xs\">\n <div className=\"flex items-center gap-2\">\n <IconUsersGroup className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"truncate flex-1 text-foreground\">\n {inv.orgName}\n </span>\n <button\n type=\"button\"\n onClick={async () => {\n try {\n await acceptInvitation.mutateAsync(inv.id);\n setOpen(false);\n } catch {\n /* error surfaced via acceptInvitation.error */\n }\n }}\n disabled={acceptInvitation.isPending}\n className=\"rounded px-1.5 py-0.5 text-[11px] font-medium text-primary hover:bg-primary/10 disabled:opacity-50 cursor-pointer\"\n >\n {acceptInvitation.isPending ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n \"Join\"\n )}\n </button>\n </div>\n {org.orgId && (\n <p className=\"mt-1 flex items-start gap-1.5 text-[11px] leading-snug text-muted-foreground\">\n <IconKey className=\"mt-0.5 h-3 w-3 shrink-0\" />\n <span>\n {t(\"org.acceptInvitationOrgSwitchNotice\", {\n name: inv.orgName,\n })}\n </span>\n </p>\n )}\n </div>\n ))}\n </>\n )}\n\n {domainMatches.length > 0 && (\n <>\n {(orgs.length > 0 || pendingInvitations.length > 0) && (\n <div className=\"my-1 h-px bg-border\" />\n )}\n <div className={SECTION_LABEL_CLASS}>Join your team</div>\n {domainMatches.map((match) => {\n const isJoining =\n joinByDomain.isPending && joiningOrgId === match.orgId;\n return (\n <div\n key={match.orgId}\n className=\"flex items-center gap-2 px-2.5 py-1.5 text-xs\"\n >\n <IconUsersGroup className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"truncate flex-1 text-foreground\">\n {match.orgName}\n </span>\n <button\n type=\"button\"\n onClick={async () => {\n setJoiningOrgId(match.orgId);\n try {\n await joinByDomain.mutateAsync(match.orgId);\n setOpen(false);\n } catch {\n /* error surfaced via joinByDomain.error */\n } finally {\n setJoiningOrgId(null);\n }\n }}\n disabled={joinByDomain.isPending}\n className=\"rounded px-1.5 py-0.5 text-[11px] font-medium text-primary hover:bg-primary/10 disabled:opacity-50 cursor-pointer\"\n >\n {isJoining ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n \"Join\"\n )}\n </button>\n </div>\n );\n })}\n </>\n )}\n\n <div className=\"my-1 h-px bg-border\" />\n <AppsSubmenu\n apps={appLinks.apps}\n isLoading={appLinks.isLoading}\n dispatchHref={appLinks.dispatchHref}\n dispatchAllAppsHref={appLinks.dispatchAllAppsHref}\n onNavigate={() => setOpen(false)}\n />\n {profilePath && (\n <button\n type=\"button\"\n onClick={() => {\n setOpen(false);\n navigate(profilePath);\n }}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconUserCircle className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-start\">\n {t(\"settings.profileMenuItem\")}\n </span>\n </button>\n )}\n {inOrg && (\n <button\n type=\"button\"\n onClick={() => {\n setOpen(false);\n if (organizationSettingsHref) {\n navigate(organizationSettingsHref);\n } else {\n window.dispatchEvent(new CustomEvent(\"agent-panel:open\"));\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:open-settings\", {\n detail: { section: \"workspace-settings\" },\n }),\n );\n }\n }}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconSettings className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-start\">\n Organization settings\n </span>\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => {\n // Clear any leftover input from a prior session — otherwise\n // the create form re-opens prefilled with the just-created\n // org's name and looks like a create dialog for the new org.\n setNewName(\"\");\n setMode(\"create\");\n }}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconPlus className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-start\">Create organization</span>\n </button>\n {canInvite && (\n <button\n type=\"button\"\n onClick={() => {\n setInviteEmail(\"\");\n setMode(\"invite\");\n }}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconUserPlus className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-start\">Invite member</span>\n </button>\n )}\n\n <div className=\"my-1 h-px bg-border\" />\n <button\n type=\"button\"\n onClick={handleSignOut}\n disabled={signingOut}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n {signingOut ? (\n <IconLoader2 className=\"h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground\" />\n ) : (\n <IconLogout className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground rtl:-scale-x-100\" />\n )}\n <span className=\"flex-1 text-start\">\n Sign out\n {org.email ? (\n <span className=\"ms-1 text-muted-foreground\">\n ({org.email})\n </span>\n ) : null}\n </span>\n </button>\n\n {(switchOrg.error ||\n acceptInvitation.error ||\n joinByDomain.error) && (\n <div className=\"px-2.5 pt-1 text-[11px] text-destructive\">\n {\n (\n (switchOrg.error ||\n acceptInvitation.error ||\n joinByDomain.error) as Error\n ).message\n }\n </div>\n )}\n </>\n )}\n\n {mode === \"create\" && (\n <form\n onSubmit={async (e) => {\n e.preventDefault();\n const name = newName.trim();\n if (!name) return;\n try {\n await createOrg.mutateAsync(name);\n handleOpenChange(false);\n } catch {\n /* error surfaced via createOrg.error */\n }\n }}\n className=\"px-2 py-1.5\"\n >\n <div className=\"px-0.5 pb-1 text-[10px] uppercase tracking-wide text-muted-foreground\">\n New organization\n </div>\n <p className=\"pe-0.5 pb-1.5 ps-2 text-[11px] leading-snug text-muted-foreground\">\n <IconKey className=\"me-1.5 inline-block h-3 w-3 align-text-top\" />\n {t(\"org.createOrgVaultNotice\")}\n </p>\n <input\n autoFocus\n value={newName}\n onChange={(e) => setNewName(e.target.value)}\n placeholder=\"Organization name\"\n disabled={createOrg.isPending}\n className=\"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs outline-none focus:ring-2 focus:ring-ring disabled:opacity-50\"\n />\n {createOrg.error && (\n <div className=\"pt-1 text-[11px] text-destructive\">\n {(createOrg.error as Error).message}\n </div>\n )}\n <div className=\"flex items-center gap-1.5 pt-1.5\">\n <button\n type=\"button\"\n onClick={() => setMode(\"list\")}\n disabled={createOrg.isPending}\n className=\"flex-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-accent disabled:opacity-50 cursor-pointer\"\n >\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={createOrg.isPending || !newName.trim()}\n className=\"flex flex-1 items-center justify-center rounded-md bg-primary px-2 py-1 text-xs font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50 cursor-pointer\"\n >\n {createOrg.isPending ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n \"Create\"\n )}\n </button>\n </div>\n </form>\n )}\n\n {mode === \"invite\" && (\n <form\n onSubmit={async (e) => {\n e.preventDefault();\n const email = inviteEmail.trim();\n if (!email) return;\n try {\n await inviteMember.mutateAsync(email);\n setInviteEmail(\"\");\n setMode(\"list\");\n } catch {\n /* error surfaced via inviteMember.error */\n }\n }}\n className=\"px-2 py-1.5\"\n >\n <div className=\"px-0.5 pb-1 text-[10px] uppercase tracking-wide text-muted-foreground\">\n Invite to {org.orgName}\n </div>\n <input\n autoFocus\n type=\"email\"\n value={inviteEmail}\n onChange={(e) => setInviteEmail(e.target.value)}\n placeholder=\"teammate@company.com\"\n disabled={inviteMember.isPending}\n className=\"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs outline-none focus:ring-2 focus:ring-ring disabled:opacity-50\"\n />\n {inviteMember.error && (\n <div className=\"pt-1 text-[11px] text-destructive\">\n {(inviteMember.error as Error).message}\n </div>\n )}\n <div className=\"flex items-center gap-1.5 pt-1.5\">\n <button\n type=\"button\"\n onClick={() => setMode(\"list\")}\n disabled={inviteMember.isPending}\n className=\"flex-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-accent disabled:opacity-50 cursor-pointer\"\n >\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={inviteMember.isPending || !inviteEmail.trim()}\n className=\"flex flex-1 items-center justify-center rounded-md bg-primary px-2 py-1 text-xs font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50 cursor-pointer\"\n >\n {inviteMember.isPending ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n \"Send invite\"\n )}\n </button>\n </div>\n </form>\n )}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"OrgSwitcher.js","sourceRoot":"","sources":["../../../src/client/org/OrgSwitcher.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,eAAe,E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,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC/C,WAAW,EAAC,sBAAsB,EAClC,QAAQ,EAAE,YAAY,CAAC,SAAS,EAChC,SAAS,EAAC,uIAAuI,GACjJ,EACD,YAAY,CAAC,KAAK,IAAI,CACrB,cAAK,SAAS,EAAC,mCAAmC,YAC9C,YAAY,CAAC,KAAe,CAAC,OAAO,GAClC,CACP,EACD,eAAK,SAAS,EAAC,kCAAkC,aAC/C,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAC9B,QAAQ,EAAE,YAAY,CAAC,SAAS,EAChC,SAAS,EAAC,8GAA8G,uBAGjH,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,YAAY,CAAC,SAAS,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,EACvD,SAAS,EAAC,yKAAyK,YAElL,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CACxB,KAAC,WAAW,IAAC,SAAS,EAAC,sBAAsB,GAAG,CACjD,CAAC,CAAC,CAAC,CACF,aAAa,CACd,GACM,IACL,IACD,CACR,IACwB,GACH,IACJ,CACzB,CAAC;AACJ,CAAC","sourcesContent":["import * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport {\n IconApps,\n IconArrowUpRight,\n IconBrain,\n IconBrandJira,\n IconBrush,\n IconCalendar,\n IconCalendarTime,\n IconChartBar,\n IconCheck,\n IconChevronRight,\n IconClipboardList,\n IconCode,\n IconExternalLink,\n IconFileText,\n IconKey,\n IconLayoutBoard,\n IconListCheck,\n IconLoader2,\n IconLogout,\n IconMail,\n IconMessageCircle,\n IconMicrophone,\n IconNote,\n IconPhone,\n IconPhoto,\n IconPlus,\n IconPresentation,\n IconRoute,\n IconScreenShare,\n IconSelector,\n IconSettings,\n IconStack2,\n IconUser,\n IconUserCircle,\n IconUserPlus,\n IconUsers,\n IconUsersGroup,\n IconWorld,\n} from \"@tabler/icons-react\";\nimport { useState } from \"react\";\nimport { useNavigate } from \"react-router\";\n\nimport { shouldOfferWorkspace } from \"../../org/workspace-url.js\";\nimport { agentNativePath } from \"../api-path.js\";\nimport { useT } from \"../i18n.js\";\nimport { useSession } from \"../use-session.js\";\nimport {\n useOrg,\n useSwitchOrg,\n useCreateOrg,\n useInviteMember,\n useAcceptInvitation,\n useJoinByDomain,\n} from \"./hooks.js\";\nimport {\n ORG_SWITCHER_MAX_APP_LINKS,\n useOrgSwitcherAppLinks,\n visibleOrgAppLinks,\n type OrgSwitcherAppLink,\n} from \"./workspace-app-links.js\";\n\nexport interface OrgSwitcherProps {\n className?: string;\n /** Hide entirely when the user only belongs to one org. Default: false. */\n hideWhenSingle?: boolean;\n /** Keep the switcher's button height reserved while org state is loading. */\n reserveSpace?: boolean;\n /**\n * Icon-only trigger for collapsed sidebar rails. The popover — and with it\n * the org list, pending invitations and \"Join your team\" — is identical;\n * dropping the switcher instead leaves a collapsed rail with no way to\n * reach another workspace.\n */\n compact?: boolean;\n /**\n * Path to navigate to when the user clicks \"Organization settings\".\n * Defaults to the Organization tab inside Settings. Templates with an\n * established org surface can pass their own path; pass `null` to only open\n * the in-sidebar settings panel.\n */\n settingsPath?: string | null;\n /** Path to navigate to when the user clicks \"Profile\". Defaults to the shared Account settings section. */\n profilePath?: string | null;\n /**\n * Path to the Manage agent page. Settings links here too, but the switcher\n * is the only always-visible surface, so omitting it leaves Files,\n * Instructions, Memory, Skills and Automations reachable only from Settings.\n * Pass `null` for apps that do not mount the Agent page.\n */\n agentPath?: string | null;\n}\n\nfunction personalLabelFromEmail(email: string | null | undefined): string {\n if (!email) return \"Personal\";\n const local = email.split(\"@\")[0] ?? email;\n const cleaned = local.replace(/[._-]+/g, \" \").trim();\n if (!cleaned) return \"Personal\";\n return cleaned\n .split(\" \")\n .filter(Boolean)\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\" \");\n}\n\ntype Mode = \"list\" | \"create\" | \"invite\";\n\nconst POPOVER_CONTENT_CLASS =\n \"z-50 min-w-[14rem] rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\";\n\nconst ITEM_CLASS =\n \"flex w-full items-center gap-2 px-2.5 py-1.5 text-xs text-foreground hover:bg-accent focus-visible:bg-accent focus:outline-none disabled:opacity-50 disabled:pointer-events-none\";\n\nconst SECTION_LABEL_CLASS =\n \"px-2.5 pt-1 pb-0.5 text-[10px] uppercase tracking-wide text-muted-foreground\";\n\nconst APP_SUBMENU_CONTENT_CLASS =\n \"z-50 w-72 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\";\n\nconst SWITCHER_BUTTON_CLASS =\n \"flex w-full items-center gap-2 rounded-md border-0 bg-accent/50 px-2.5 py-1.5 text-xs font-medium text-muted-foreground hover:bg-accent/70 hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-60 cursor-pointer\";\n\nconst COMPACT_SWITCHER_BUTTON_CLASS =\n \"flex items-center justify-center rounded-md border-0 bg-accent/50 p-1.5 text-muted-foreground hover:bg-accent/70 hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-60 cursor-pointer\";\n\nconst DEFAULT_ORGANIZATION_SETTINGS_PATH = \"/settings#organization\";\nconst DEFAULT_PROFILE_PATH = \"/settings#account\";\nconst DEFAULT_AGENT_PATH = \"/agent\";\n\nconst APP_ICON_MAP: Record<string, typeof IconApps> = {\n Mail: IconMail,\n CalendarDays: IconCalendar,\n FileText: IconFileText,\n LayoutBoard: IconLayoutBoard,\n BarChart2: IconChartBar,\n GalleryHorizontal: IconPresentation,\n BrandJira: IconBrandJira,\n ClipboardList: IconClipboardList,\n Users: IconUsers,\n Code: IconCode,\n MessageCircle: IconMessageCircle,\n Route: IconRoute,\n ScreenShare: IconScreenShare,\n Brush: IconBrush,\n Brain: IconBrain,\n Phone: IconPhone,\n Note: IconNote,\n Microphone: IconMicrophone,\n CalendarTime: IconCalendarTime,\n Globe: IconWorld,\n Photo: IconPhoto,\n ListCheck: IconListCheck,\n};\n\nfunction appMenuIcon(app: OrgSwitcherAppLink): typeof IconApps {\n if (app.icon) return APP_ICON_MAP[app.icon] ?? IconStack2;\n return app.isDispatch ? IconMessageCircle : IconStack2;\n}\n\nfunction organizationSettingsPath(path: string): string {\n if (path.includes(\"#\")) return path;\n const pathname = path.split(\"?\")[0]?.replace(/\\/+$/, \"\");\n return pathname === \"/settings\" ? `${path}#organization` : path;\n}\n\nfunction AppMenuLink({\n app,\n onNavigate,\n}: {\n app: OrgSwitcherAppLink;\n onNavigate: () => void;\n}) {\n const Icon = appMenuIcon(app);\n const description =\n app.status === \"pending\"\n ? \"Building\"\n : app.description?.trim() ||\n (app.isDispatch ? \"Workspace hub\" : `${app.name} workspace`);\n return (\n <a\n href={app.href}\n onClick={onNavigate}\n className=\"flex items-center gap-2 rounded-sm px-2.5 py-2 text-xs outline-none hover:bg-accent focus:bg-accent\"\n >\n <span className=\"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground\">\n <Icon className=\"h-3.5 w-3.5\" />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-medium text-foreground\">\n {app.name}\n </span>\n <span\n className=\"block truncate text-[11px] text-muted-foreground\"\n title={description}\n >\n {description}\n </span>\n </span>\n <IconArrowUpRight className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n </a>\n );\n}\n\nfunction AppsSubmenu({\n apps,\n isLoading,\n dispatchHref,\n dispatchAllAppsHref,\n onNavigate,\n}: {\n apps: OrgSwitcherAppLink[];\n isLoading: boolean;\n dispatchHref: string;\n dispatchAllAppsHref: string;\n onNavigate: () => void;\n}) {\n const { links, overflowCount } = visibleOrgAppLinks(apps);\n const visibleDispatchApp = links.find((app) => app.isDispatch);\n const dispatchApp =\n visibleDispatchApp ??\n ({\n id: \"dispatch\",\n name: \"Dispatch\",\n href: dispatchHref,\n isDispatch: true,\n status: \"ready\",\n } satisfies OrgSwitcherAppLink);\n const visibleNonDispatch = links\n .filter((app) => !app.isDispatch)\n .slice(0, visibleDispatchApp ? undefined : ORG_SWITCHER_MAX_APP_LINKS - 1);\n const shownCount = (dispatchApp ? 1 : 0) + visibleNonDispatch.length;\n const remainingCount = Math.max(overflowCount, apps.length - shownCount);\n\n return (\n <PopoverPrimitive.Root>\n <PopoverPrimitive.Trigger asChild>\n <button type=\"button\" className={`${ITEM_CLASS} cursor-pointer`}>\n <IconApps className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-start\">Apps</span>\n <span className=\"text-[11px] text-muted-foreground\">\n {isLoading ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n apps.length\n )}\n </span>\n <IconChevronRight className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground rtl:-scale-x-100\" />\n </button>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n side=\"right\"\n align=\"start\"\n sideOffset={8}\n collisionPadding={12}\n className={APP_SUBMENU_CONTENT_CLASS}\n >\n <AppMenuLink app={dispatchApp} onNavigate={onNavigate} />\n\n {visibleNonDispatch.length > 0 && (\n <div className=\"my-1 h-px bg-border\" />\n )}\n {visibleNonDispatch.map((app) => (\n <AppMenuLink key={app.id} app={app} onNavigate={onNavigate} />\n ))}\n\n {remainingCount > 0 && (\n <>\n <div className=\"my-1 h-px bg-border\" />\n <a\n href={dispatchAllAppsHref}\n onClick={onNavigate}\n className=\"flex items-center gap-2 rounded-sm px-2.5 py-1.5 text-xs text-foreground outline-none hover:bg-accent focus:bg-accent\"\n >\n <IconApps className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1\">\n {`View ${remainingCount} more in Dispatch`}\n </span>\n <IconArrowUpRight className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n </a>\n </>\n )}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n );\n}\n\nfunction ReservedOrgSwitcherSpace({ className }: { className?: string }) {\n return <div aria-hidden=\"true\" className={`h-8 ${className ?? \"\"}`} />;\n}\n\nfunction OrgSwitcherLoadingPlaceholder({ className }: { className?: string }) {\n return (\n <button\n type=\"button\"\n disabled\n aria-label=\"Loading organization\"\n className={`${SWITCHER_BUTTON_CLASS} animate-pulse ${className ?? \"\"}`}\n >\n <IconUsersGroup className=\"h-3.5 w-3.5 shrink-0 opacity-60\" />\n <span className=\"h-3 min-w-0 flex-1 rounded-sm bg-muted-foreground/20\" />\n <IconSelector className=\"h-3 w-3 shrink-0 opacity-30\" />\n </button>\n );\n}\n\n/**\n * Compact org switcher button. Shows the active org (or \"Personal\" when the\n * user has none); opens a popover with the user's other orgs, pending\n * invitations, inline forms to create a new org / invite a teammate, and a\n * sign-out item. Renders nothing in dev / no-auth mode.\n */\nexport function OrgSwitcher({\n className,\n hideWhenSingle,\n reserveSpace,\n compact,\n settingsPath = DEFAULT_ORGANIZATION_SETTINGS_PATH,\n profilePath = DEFAULT_PROFILE_PATH,\n agentPath = DEFAULT_AGENT_PATH,\n}: OrgSwitcherProps) {\n const { data: org, isLoading } = useOrg();\n const { session } = useSession();\n const t = useT();\n const switchOrg = useSwitchOrg();\n const createOrg = useCreateOrg();\n const inviteMember = useInviteMember();\n const acceptInvitation = useAcceptInvitation();\n const joinByDomain = useJoinByDomain();\n const navigate = useNavigate();\n const [open, setOpen] = useState(false);\n const [mode, setMode] = useState<Mode>(\"list\");\n const [newName, setNewName] = useState(\"\");\n const [inviteEmail, setInviteEmail] = useState(\"\");\n const [signingOut, setSigningOut] = useState(false);\n const [joiningOrgId, setJoiningOrgId] = useState<string | null>(null);\n const appLinks = useOrgSwitcherAppLinks(open);\n\n const handleOpenChange = (next: boolean) => {\n setOpen(next);\n if (!next) {\n setMode(\"list\");\n setNewName(\"\");\n setInviteEmail(\"\");\n }\n };\n\n const handleSignOut = async () => {\n if (signingOut) return;\n setSigningOut(true);\n try {\n await fetch(agentNativePath(\"/_agent-native/auth/logout\"), {\n method: \"POST\",\n credentials: \"include\",\n });\n } catch {\n /* fall through to reload — server may already have cleared the cookie */\n }\n window.location.reload();\n };\n\n if (!org) {\n return reserveSpace && isLoading ? (\n <OrgSwitcherLoadingPlaceholder className={className} />\n ) : null;\n }\n\n const orgs = org.orgs ?? [];\n const pendingInvitations = org.pendingInvitations ?? [];\n const domainMatches = org.domainMatches ?? [];\n const orgCount = orgs.length;\n const hasAny =\n orgCount > 0 || pendingInvitations.length > 0 || domainMatches.length > 0;\n if (!hasAny && !org.email) {\n return reserveSpace ? (\n <ReservedOrgSwitcherSpace className={className} />\n ) : null;\n }\n if (\n hideWhenSingle &&\n orgCount < 2 &&\n pendingInvitations.length === 0 &&\n domainMatches.length === 0\n ) {\n return reserveSpace ? (\n <ReservedOrgSwitcherSpace className={className} />\n ) : null;\n }\n\n const canInvite =\n !!org.orgId && (org.role === \"owner\" || org.role === \"admin\");\n\n const personalLabel = session?.name || personalLabelFromEmail(org.email);\n const inOrg = !!org.orgId;\n const buttonLabel = org.orgName ?? \"Personal\";\n const ButtonIcon = inOrg ? IconUsersGroup : IconUser;\n const organizationSettingsHref = settingsPath\n ? organizationSettingsPath(settingsPath)\n : null;\n\n return (\n <PopoverPrimitive.Root open={open} onOpenChange={handleOpenChange}>\n <PopoverPrimitive.Trigger asChild>\n {compact ? (\n <button\n type=\"button\"\n title={buttonLabel}\n aria-label={buttonLabel}\n className={`${COMPACT_SWITCHER_BUTTON_CLASS} ${className ?? \"\"}`}\n >\n <ButtonIcon className=\"h-3.5 w-3.5 shrink-0\" />\n </button>\n ) : (\n <button\n type=\"button\"\n className={`${SWITCHER_BUTTON_CLASS} ${className ?? \"\"}`}\n >\n <ButtonIcon className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"truncate flex-1 text-start\">{buttonLabel}</span>\n <IconSelector className=\"h-3 w-3 shrink-0 opacity-50\" />\n </button>\n )}\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n side=\"top\"\n align=\"start\"\n sideOffset={6}\n collisionPadding={12}\n className={`${POPOVER_CONTENT_CLASS} ${mode === \"list\" ? \"\" : \"w-64\"}`}\n onOpenAutoFocus={(e) => {\n // Don't auto-focus the first item — feels heavy on a switcher.\n if (mode === \"list\") e.preventDefault();\n }}\n >\n {mode === \"list\" && (\n <>\n {/* The org name alone is ambiguous: the same org exists on every\n deployment a member has signed into, so the switcher reads\n identically on all of them. The host is what tells them\n which one they're actually looking at. */}\n {typeof window !== \"undefined\" && (\n <div className=\"px-2.5 pb-1.5 pt-1 text-[11px] text-muted-foreground\">\n <div className=\"truncate\">{window.location.host}</div>\n {shouldOfferWorkspace(\n window.location.href,\n org.workspaceUrl,\n ) && (\n <a\n href={org.workspaceUrl ?? undefined}\n className=\"mt-0.5 inline-flex items-center gap-1 text-foreground no-underline hover:underline\"\n >\n <IconExternalLink className=\"h-3 w-3 shrink-0\" />\n Your workspace\n </a>\n )}\n </div>\n )}\n {!inOrg && (\n <div\n className=\"flex w-full items-center gap-2 px-2.5 py-1.5 text-xs text-muted-foreground\"\n aria-disabled=\"true\"\n >\n <IconUser className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"truncate flex-1 text-start\">\n Personal ({personalLabel})\n </span>\n </div>\n )}\n {orgs.length > 0 && (\n <div className={SECTION_LABEL_CLASS}>Organizations</div>\n )}\n {orgs.map((o) => (\n <button\n key={o.orgId}\n type=\"button\"\n onClick={async () => {\n if (o.orgId === org.orgId) {\n setOpen(false);\n return;\n }\n try {\n await switchOrg.mutateAsync(o.orgId);\n setOpen(false);\n } catch {\n /* error surfaced via switchOrg.error */\n }\n }}\n disabled={switchOrg.isPending}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconUsersGroup className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"truncate flex-1 text-start\">\n {o.orgName}\n </span>\n {o.orgId === org.orgId && (\n <IconCheck className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n )}\n </button>\n ))}\n\n {pendingInvitations.length > 0 && (\n <>\n {orgs.length > 0 && <div className=\"my-1 h-px bg-border\" />}\n <div className={SECTION_LABEL_CLASS}>Invitations</div>\n {pendingInvitations.map((inv) => (\n <div key={inv.id} className=\"px-2.5 py-1.5 text-xs\">\n <div className=\"flex items-center gap-2\">\n <IconUsersGroup className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"truncate flex-1 text-foreground\">\n {inv.orgName}\n </span>\n <button\n type=\"button\"\n onClick={async () => {\n try {\n await acceptInvitation.mutateAsync(inv.id);\n setOpen(false);\n } catch {\n /* error surfaced via acceptInvitation.error */\n }\n }}\n disabled={acceptInvitation.isPending}\n className=\"rounded px-1.5 py-0.5 text-[11px] font-medium text-primary hover:bg-primary/10 disabled:opacity-50 cursor-pointer\"\n >\n {acceptInvitation.isPending ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n \"Join\"\n )}\n </button>\n </div>\n {org.orgId && (\n <p className=\"mt-1 flex items-start gap-1.5 text-[11px] leading-snug text-muted-foreground\">\n <IconKey className=\"mt-0.5 h-3 w-3 shrink-0\" />\n <span>\n {t(\"org.acceptInvitationOrgSwitchNotice\", {\n name: inv.orgName,\n })}\n </span>\n </p>\n )}\n </div>\n ))}\n </>\n )}\n\n {domainMatches.length > 0 && (\n <>\n {(orgs.length > 0 || pendingInvitations.length > 0) && (\n <div className=\"my-1 h-px bg-border\" />\n )}\n <div className={SECTION_LABEL_CLASS}>Join your team</div>\n {domainMatches.map((match) => {\n const isJoining =\n joinByDomain.isPending && joiningOrgId === match.orgId;\n return (\n <div\n key={match.orgId}\n className=\"flex items-center gap-2 px-2.5 py-1.5 text-xs\"\n >\n <IconUsersGroup className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"truncate flex-1 text-foreground\">\n {match.orgName}\n </span>\n <button\n type=\"button\"\n onClick={async () => {\n setJoiningOrgId(match.orgId);\n try {\n await joinByDomain.mutateAsync(match.orgId);\n setOpen(false);\n } catch {\n /* error surfaced via joinByDomain.error */\n } finally {\n setJoiningOrgId(null);\n }\n }}\n disabled={joinByDomain.isPending}\n className=\"rounded px-1.5 py-0.5 text-[11px] font-medium text-primary hover:bg-primary/10 disabled:opacity-50 cursor-pointer\"\n >\n {isJoining ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n \"Join\"\n )}\n </button>\n </div>\n );\n })}\n </>\n )}\n\n <div className=\"my-1 h-px bg-border\" />\n <AppsSubmenu\n apps={appLinks.apps}\n isLoading={appLinks.isLoading}\n dispatchHref={appLinks.dispatchHref}\n dispatchAllAppsHref={appLinks.dispatchAllAppsHref}\n onNavigate={() => setOpen(false)}\n />\n {profilePath && (\n <button\n type=\"button\"\n onClick={() => {\n setOpen(false);\n navigate(profilePath);\n }}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconUserCircle className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-start\">\n {t(\"settings.profileMenuItem\")}\n </span>\n </button>\n )}\n {agentPath && (\n <button\n type=\"button\"\n onClick={() => {\n setOpen(false);\n navigate(agentPath);\n }}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconBrain className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-start\">\n {t(\"settings.manageAgentMenuItem\", {\n defaultValue: \"Manage agent\",\n })}\n </span>\n </button>\n )}\n {inOrg && (\n <button\n type=\"button\"\n onClick={() => {\n setOpen(false);\n if (organizationSettingsHref) {\n navigate(organizationSettingsHref);\n } else {\n window.dispatchEvent(new CustomEvent(\"agent-panel:open\"));\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:open-settings\", {\n detail: { section: \"workspace-settings\" },\n }),\n );\n }\n }}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconSettings className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-start\">\n Organization settings\n </span>\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => {\n // Clear any leftover input from a prior session — otherwise\n // the create form re-opens prefilled with the just-created\n // org's name and looks like a create dialog for the new org.\n setNewName(\"\");\n setMode(\"create\");\n }}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconPlus className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-start\">Create organization</span>\n </button>\n {canInvite && (\n <button\n type=\"button\"\n onClick={() => {\n setInviteEmail(\"\");\n setMode(\"invite\");\n }}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconUserPlus className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-start\">Invite member</span>\n </button>\n )}\n\n <div className=\"my-1 h-px bg-border\" />\n <button\n type=\"button\"\n onClick={handleSignOut}\n disabled={signingOut}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n {signingOut ? (\n <IconLoader2 className=\"h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground\" />\n ) : (\n <IconLogout className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground rtl:-scale-x-100\" />\n )}\n <span className=\"flex-1 text-start\">\n Sign out\n {org.email ? (\n <span className=\"ms-1 text-muted-foreground\">\n ({org.email})\n </span>\n ) : null}\n </span>\n </button>\n\n {(switchOrg.error ||\n acceptInvitation.error ||\n joinByDomain.error) && (\n <div className=\"px-2.5 pt-1 text-[11px] text-destructive\">\n {\n (\n (switchOrg.error ||\n acceptInvitation.error ||\n joinByDomain.error) as Error\n ).message\n }\n </div>\n )}\n </>\n )}\n\n {mode === \"create\" && (\n <form\n onSubmit={async (e) => {\n e.preventDefault();\n const name = newName.trim();\n if (!name) return;\n try {\n await createOrg.mutateAsync(name);\n handleOpenChange(false);\n } catch {\n /* error surfaced via createOrg.error */\n }\n }}\n className=\"px-2 py-1.5\"\n >\n <div className=\"px-0.5 pb-1 text-[10px] uppercase tracking-wide text-muted-foreground\">\n New organization\n </div>\n <p className=\"pe-0.5 pb-1.5 ps-2 text-[11px] leading-snug text-muted-foreground\">\n <IconKey className=\"me-1.5 inline-block h-3 w-3 align-text-top\" />\n {t(\"org.createOrgVaultNotice\")}\n </p>\n <input\n autoFocus\n value={newName}\n onChange={(e) => setNewName(e.target.value)}\n placeholder=\"Organization name\"\n disabled={createOrg.isPending}\n className=\"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs outline-none focus:ring-2 focus:ring-ring disabled:opacity-50\"\n />\n {createOrg.error && (\n <div className=\"pt-1 text-[11px] text-destructive\">\n {(createOrg.error as Error).message}\n </div>\n )}\n <div className=\"flex items-center gap-1.5 pt-1.5\">\n <button\n type=\"button\"\n onClick={() => setMode(\"list\")}\n disabled={createOrg.isPending}\n className=\"flex-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-accent disabled:opacity-50 cursor-pointer\"\n >\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={createOrg.isPending || !newName.trim()}\n className=\"flex flex-1 items-center justify-center rounded-md bg-primary px-2 py-1 text-xs font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50 cursor-pointer\"\n >\n {createOrg.isPending ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n \"Create\"\n )}\n </button>\n </div>\n </form>\n )}\n\n {mode === \"invite\" && (\n <form\n onSubmit={async (e) => {\n e.preventDefault();\n const email = inviteEmail.trim();\n if (!email) return;\n try {\n await inviteMember.mutateAsync(email);\n setInviteEmail(\"\");\n setMode(\"list\");\n } catch {\n /* error surfaced via inviteMember.error */\n }\n }}\n className=\"px-2 py-1.5\"\n >\n <div className=\"px-0.5 pb-1 text-[10px] uppercase tracking-wide text-muted-foreground\">\n Invite to {org.orgName}\n </div>\n <input\n autoFocus\n type=\"email\"\n value={inviteEmail}\n onChange={(e) => setInviteEmail(e.target.value)}\n placeholder=\"teammate@company.com\"\n disabled={inviteMember.isPending}\n className=\"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs outline-none focus:ring-2 focus:ring-ring disabled:opacity-50\"\n />\n {inviteMember.error && (\n <div className=\"pt-1 text-[11px] text-destructive\">\n {(inviteMember.error as Error).message}\n </div>\n )}\n <div className=\"flex items-center gap-1.5 pt-1.5\">\n <button\n type=\"button\"\n onClick={() => setMode(\"list\")}\n disabled={inviteMember.isPending}\n className=\"flex-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-accent disabled:opacity-50 cursor-pointer\"\n >\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={inviteMember.isPending || !inviteEmail.trim()}\n className=\"flex flex-1 items-center justify-center rounded-md bg-primary px-2 py-1 text-xs font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50 cursor-pointer\"\n >\n {inviteMember.isPending ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n \"Send invite\"\n )}\n </button>\n </div>\n </form>\n )}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountSettingsCard.d.ts","sourceRoot":"","sources":["../../../src/client/settings/AccountSettingsCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AccountSettingsCard.d.ts","sourceRoot":"","sources":["../../../src/client/settings/AccountSettingsCard.tsx"],"names":[],"mappings":"AA4BA,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,mBAAmB,CAAC,EAClC,OAAe,GAChB,EAAE,wBAAwB,+BAoK1B;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,EAAE,wBAAwB,+BA2B1E"}
|
|
@@ -7,6 +7,7 @@ import { useActionMutation, useActionQuery } from "../use-action.js";
|
|
|
7
7
|
import { uploadAvatar, useAvatarUrl } from "../use-avatar.js";
|
|
8
8
|
import { useSession } from "../use-session.js";
|
|
9
9
|
import { cn } from "../utils.js";
|
|
10
|
+
import { SchedulingTimezoneField } from "./SchedulingTimezoneField.js";
|
|
10
11
|
function profileInitials(name) {
|
|
11
12
|
return (name
|
|
12
13
|
.split(/[ @._-]+/)
|
|
@@ -61,15 +62,15 @@ export function AccountSettingsForm({ compact = false, }) {
|
|
|
61
62
|
};
|
|
62
63
|
return (_jsxs("div", { className: cn("space-y-4", compact && "space-y-3"), children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Avatar, { name: displayName, src: avatarUrl, fallback: profileInitials(displayName), size: compact ? "default" : "large", className: cn("shrink-0 rounded-full border border-border bg-accent font-semibold text-muted-foreground", compact ? "size-12 text-[13px]" : "size-14 text-[15px]") }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: cn("truncate font-medium", compact ? "text-xs" : "text-sm"), children: isLoading ? t("settings.profileLoading") : displayName }), email && (_jsx("p", { className: "truncate text-xs text-muted-foreground", children: email })), photoStatus === "saved" && (_jsxs("p", { className: "mt-1 flex items-center gap-1 text-xs text-green-600 dark:text-green-400", children: [_jsx(IconCheck, { className: "size-3" }), t("settings.profilePhotoUpdated")] })), photoStatus === "error" && (_jsx("p", { className: "mt-1 text-xs text-destructive", children: t("settings.profilePhotoError") }))] }), _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handleAvatarChange }), _jsx(ActionButton, { type: "button", intent: "neutral", emphasis: "outline", size: "compact", disabled: !email || uploading, leadingIcon: _jsx(IconCamera, { className: "size-3.5" }), onPress: () => fileInputRef.current?.click(), className: "shrink-0", children: uploading
|
|
63
64
|
? t("settings.profileUploading")
|
|
64
|
-
: t("settings.profileChangePhoto") })] }),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
: t("settings.profileChangePhoto") })] }), _jsx("div", { className: "space-y-3", children: _jsx(TextField, { id: "agent-native-profile-name", label: t("settings.profileNameLabel"), value: name, onChange: (value) => {
|
|
66
|
+
updateProfile.reset();
|
|
67
|
+
setName(value);
|
|
68
|
+
}, placeholder: t("settings.profileNamePlaceholder"), description: t("settings.profileNameDescription"), disabled: !email || profileQuery.isLoading || updateProfile.isPending }) }), _jsx("div", { className: "border-t border-border/60 pt-3", children: _jsx(SchedulingTimezoneField, {}) }), _jsxs("div", { className: "flex items-center justify-between gap-3 border-t border-border/60 pt-3", children: [_jsxs("div", { className: "min-h-4 text-xs", children: [updateProfile.isSuccess && (_jsx("p", { className: "text-green-600 dark:text-green-400", children: t("settings.profileSaved") })), updateProfile.error && (_jsx("p", { className: "text-destructive", children: t("settings.profileSaveError") }))] }), _jsx(ActionButton, { type: "button", intent: "primary", emphasis: "solid", size: "compact", pending: updateProfile.isPending, disabled: !email ||
|
|
69
|
+
profileQuery.isLoading ||
|
|
70
|
+
updateProfile.isPending ||
|
|
71
|
+
!name.trim(), onPress: handleProfileSave, children: updateProfile.isPending
|
|
72
|
+
? t("settings.profileSaving")
|
|
73
|
+
: t("settings.profileSave") })] })] }));
|
|
73
74
|
}
|
|
74
75
|
export function AccountSettingsCard({ className }) {
|
|
75
76
|
const t = useT();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountSettingsCard.js","sourceRoot":"","sources":["../../../src/client/settings/AccountSettingsCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,EACZ,MAAM,EACN,OAAO,EACP,SAAS,GACV,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAoB,MAAM,OAAO,CAAC;AAGtE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO,CACL,IAAI;SACD,KAAK,CAAC,UAAU,CAAC;SACjB,MAAM,CAAC,OAAO,CAAC;SACf,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;SACrC,IAAI,CAAC,EAAE,CAAC,IAAI,GAAG,CACnB,CAAC;AACJ,CAAC;AAMD,MAAM,UAAU,mBAAmB,CAAC,EAClC,OAAO,GAAG,KAAK,GACU;IACzB,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,UAAU,EAAE,CAAC;IAC5C,MAAM,KAAK,GAAG,OAAO,EAAE,KAAK,CAAC;IAC7B,MAAM,YAAY,GAAG,cAAc,CACjC,k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,KAAG,GACnB,IACE,CACX,CAAC;AACJ,CAAC","sourcesContent":["import {\n ActionButton,\n Avatar,\n Surface,\n TextField,\n} from \"@agent-native/toolkit/design-system\";\nimport { IconCamera, IconCheck } from \"@tabler/icons-react\";\nimport { useEffect, useRef, useState, type ChangeEvent } from \"react\";\n\nimport type { UserProfile } from \"../../user-profile/shared.js\";\nimport { useT } from \"../i18n.js\";\nimport { useActionMutation, useActionQuery } from \"../use-action.js\";\nimport { uploadAvatar, useAvatarUrl } from \"../use-avatar.js\";\nimport { useSession } from \"../use-session.js\";\nimport { cn } from \"../utils.js\";\n\nfunction profileInitials(name: string): string {\n return (\n name\n .split(/[ @._-]+/)\n .filter(Boolean)\n .slice(0, 2)\n .map((part) => part[0]?.toUpperCase())\n .join(\"\") || \"?\"\n );\n}\n\nexport interface AccountSettingsFormProps {\n compact?: boolean;\n}\n\nexport function AccountSettingsForm({\n compact = false,\n}: AccountSettingsFormProps) {\n const t = useT();\n const { session, isLoading } = useSession();\n const email = session?.email;\n const profileQuery = useActionQuery<UserProfile>(\n \"get-user-profile\",\n undefined,\n { enabled: !!email },\n );\n const updateProfile = useActionMutation<UserProfile, { name: string }>(\n \"update-user-profile\",\n );\n const avatarUrl = useAvatarUrl(email);\n const fileInputRef = useRef<HTMLInputElement>(null);\n const [uploading, setUploading] = useState(false);\n const [photoStatus, setPhotoStatus] = useState<\"idle\" | \"saved\" | \"error\">(\n \"idle\",\n );\n const [name, setName] = useState(\"\");\n\n const displayName =\n profileQuery.data?.name ||\n session?.name ||\n email ||\n t(\"settings.profileSignedOut\");\n\n useEffect(() => {\n const nextName = profileQuery.data?.name || session?.name;\n if (nextName) setName(nextName);\n }, [profileQuery.data?.name, session?.name]);\n\n const handleAvatarChange = async (event: ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n event.target.value = \"\";\n if (!file || !email) return;\n setUploading(true);\n setPhotoStatus(\"idle\");\n try {\n await uploadAvatar(file, email);\n setPhotoStatus(\"saved\");\n } catch {\n setPhotoStatus(\"error\");\n } finally {\n setUploading(false);\n }\n };\n\n const handleProfileSave = () => {\n const nextName = name.trim();\n if (!nextName || !email) return;\n updateProfile.mutate({ name: nextName });\n };\n\n return (\n <div className={cn(\"space-y-4\", compact && \"space-y-3\")}>\n <div className=\"flex items-center gap-3\">\n <Avatar\n name={displayName}\n src={avatarUrl}\n fallback={profileInitials(displayName)}\n size={compact ? \"default\" : \"large\"}\n className={cn(\n \"shrink-0 rounded-full border border-border bg-accent font-semibold text-muted-foreground\",\n compact ? \"size-12 text-[13px]\" : \"size-14 text-[15px]\",\n )}\n />\n <div className=\"min-w-0 flex-1\">\n <p\n className={cn(\n \"truncate font-medium\",\n compact ? \"text-xs\" : \"text-sm\",\n )}\n >\n {isLoading ? t(\"settings.profileLoading\") : displayName}\n </p>\n {email && (\n <p className=\"truncate text-xs text-muted-foreground\">{email}</p>\n )}\n {photoStatus === \"saved\" && (\n <p className=\"mt-1 flex items-center gap-1 text-xs text-green-600 dark:text-green-400\">\n <IconCheck className=\"size-3\" />\n {t(\"settings.profilePhotoUpdated\")}\n </p>\n )}\n {photoStatus === \"error\" && (\n <p className=\"mt-1 text-xs text-destructive\">\n {t(\"settings.profilePhotoError\")}\n </p>\n )}\n </div>\n <input\n ref={fileInputRef}\n type=\"file\"\n accept=\"image/*\"\n className=\"hidden\"\n onChange={handleAvatarChange}\n />\n <ActionButton\n type=\"button\"\n intent=\"neutral\"\n emphasis=\"outline\"\n size=\"compact\"\n disabled={!email || uploading}\n leadingIcon={<IconCamera className=\"size-3.5\" />}\n onPress={() => fileInputRef.current?.click()}\n className=\"shrink-0\"\n >\n {uploading\n ? t(\"settings.profileUploading\")\n : t(\"settings.profileChangePhoto\")}\n </ActionButton>\n </div>\n\n <div className=\"space-y-3\">\n <TextField\n id=\"agent-native-profile-name\"\n label={t(\"settings.profileNameLabel\")}\n value={name}\n onChange={(value) => {\n updateProfile.reset();\n setName(value);\n }}\n placeholder={t(\"settings.profileNamePlaceholder\")}\n description={t(\"settings.profileNameDescription\")}\n disabled={!email || profileQuery.isLoading || updateProfile.isPending}\n />\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"min-h-4 text-xs\">\n {updateProfile.isSuccess && (\n <p className=\"text-green-600 dark:text-green-400\">\n {t(\"settings.profileSaved\")}\n </p>\n )}\n {updateProfile.error && (\n <p className=\"text-destructive\">\n {t(\"settings.profileSaveError\")}\n </p>\n )}\n </div>\n <ActionButton\n type=\"button\"\n intent=\"primary\"\n emphasis=\"solid\"\n size=\"compact\"\n pending={updateProfile.isPending}\n disabled={\n !email ||\n profileQuery.isLoading ||\n updateProfile.isPending ||\n !name.trim()\n }\n onPress={handleProfileSave}\n >\n {updateProfile.isPending\n ? t(\"settings.profileSaving\")\n : t(\"settings.profileSave\")}\n </ActionButton>\n </div>\n </div>\n </div>\n );\n}\n\nexport interface AccountSettingsCardProps {\n className?: string;\n}\n\nexport function AccountSettingsCard({ className }: AccountSettingsCardProps) {\n const t = useT();\n\n return (\n <Surface\n as=\"section\"\n id=\"account\"\n elevation=\"low\"\n padding=\"none\"\n className={cn(\n \"mx-auto w-full max-w-2xl scroll-mt-4 rounded-lg border border-border bg-card p-5 text-card-foreground shadow-sm\",\n className,\n )}\n >\n <div className=\"space-y-1\">\n <h2 className=\"text-base font-semibold\">\n {t(\"settings.profileTitle\")}\n </h2>\n <p className=\"text-sm leading-6 text-muted-foreground\">\n {t(\"settings.profileDescription\")}\n </p>\n </div>\n <div className=\"mt-5\">\n <AccountSettingsForm />\n </div>\n </Surface>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AccountSettingsCard.js","sourceRoot":"","sources":["../../../src/client/settings/AccountSettingsCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,EACZ,MAAM,EACN,OAAO,EACP,SAAS,GACV,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,SA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CACtB,YAAG,SAAS,EAAC,kBAAkB,YAAE,CAAC,CAAC,2BAA2B,CAAC,GAAK,CACrE,IACG,EACN,KAAC,YAAY,IACX,IAAI,EAAC,QAAQ,EACb,MAAM,EAAC,SAAS,EAChB,QAAQ,EAAC,OAAO,EAChB,IAAI,EAAC,SAAS,EACd,OAAO,EAAE,aAAa,CAAC,SAAS,EAChC,QAAQ,EACN,CAAC,KAAK;4BACN,YAAY,CAAC,SAAS;4BACtB,aAAa,CAAC,SAAS;4BACvB,CAAC,IAAI,CAAC,IAAI,EAAE,EAEd,OAAO,EAAE,iBAAiB,YAEzB,aAAa,CAAC,SAAS;4BACtB,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC;4BAC7B,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,GAChB,IACX,IACF,CACP,CAAC;AACJ,CAAC;AAMD,MAAM,UAAU,mBAAmB,CAAC,EAAE,SAAS,EAA4B;IACzE,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IAEjB,OAAO,CACL,MAAC,OAAO,IACN,EAAE,EAAC,SAAS,EACZ,EAAE,EAAC,SAAS,EACZ,SAAS,EAAC,KAAK,EACf,OAAO,EAAC,MAAM,EACd,SAAS,EAAE,EAAE,CACX,iHAAiH,EACjH,SAAS,CACV,aAED,eAAK,SAAS,EAAC,WAAW,aACxB,aAAI,SAAS,EAAC,yBAAyB,YACpC,CAAC,CAAC,uBAAuB,CAAC,GACxB,EACL,YAAG,SAAS,EAAC,yCAAyC,YACnD,CAAC,CAAC,6BAA6B,CAAC,GAC/B,IACA,EACN,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,mBAAmB,KAAG,GACnB,IACE,CACX,CAAC;AACJ,CAAC","sourcesContent":["import {\n ActionButton,\n Avatar,\n Surface,\n TextField,\n} from \"@agent-native/toolkit/design-system\";\nimport { IconCamera, IconCheck } from \"@tabler/icons-react\";\nimport { useEffect, useRef, useState, type ChangeEvent } from \"react\";\n\nimport type { UserProfile } from \"../../user-profile/shared.js\";\nimport { useT } from \"../i18n.js\";\nimport { useActionMutation, useActionQuery } from \"../use-action.js\";\nimport { uploadAvatar, useAvatarUrl } from \"../use-avatar.js\";\nimport { useSession } from \"../use-session.js\";\nimport { cn } from \"../utils.js\";\nimport { SchedulingTimezoneField } from \"./SchedulingTimezoneField.js\";\n\nfunction profileInitials(name: string): string {\n return (\n name\n .split(/[ @._-]+/)\n .filter(Boolean)\n .slice(0, 2)\n .map((part) => part[0]?.toUpperCase())\n .join(\"\") || \"?\"\n );\n}\n\nexport interface AccountSettingsFormProps {\n compact?: boolean;\n}\n\nexport function AccountSettingsForm({\n compact = false,\n}: AccountSettingsFormProps) {\n const t = useT();\n const { session, isLoading } = useSession();\n const email = session?.email;\n const profileQuery = useActionQuery<UserProfile>(\n \"get-user-profile\",\n undefined,\n { enabled: !!email },\n );\n const updateProfile = useActionMutation<UserProfile, { name: string }>(\n \"update-user-profile\",\n );\n const avatarUrl = useAvatarUrl(email);\n const fileInputRef = useRef<HTMLInputElement>(null);\n const [uploading, setUploading] = useState(false);\n const [photoStatus, setPhotoStatus] = useState<\"idle\" | \"saved\" | \"error\">(\n \"idle\",\n );\n const [name, setName] = useState(\"\");\n\n const displayName =\n profileQuery.data?.name ||\n session?.name ||\n email ||\n t(\"settings.profileSignedOut\");\n\n useEffect(() => {\n const nextName = profileQuery.data?.name || session?.name;\n if (nextName) setName(nextName);\n }, [profileQuery.data?.name, session?.name]);\n\n const handleAvatarChange = async (event: ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n event.target.value = \"\";\n if (!file || !email) return;\n setUploading(true);\n setPhotoStatus(\"idle\");\n try {\n await uploadAvatar(file, email);\n setPhotoStatus(\"saved\");\n } catch {\n setPhotoStatus(\"error\");\n } finally {\n setUploading(false);\n }\n };\n\n const handleProfileSave = () => {\n const nextName = name.trim();\n if (!nextName || !email) return;\n updateProfile.mutate({ name: nextName });\n };\n\n return (\n <div className={cn(\"space-y-4\", compact && \"space-y-3\")}>\n <div className=\"flex items-center gap-3\">\n <Avatar\n name={displayName}\n src={avatarUrl}\n fallback={profileInitials(displayName)}\n size={compact ? \"default\" : \"large\"}\n className={cn(\n \"shrink-0 rounded-full border border-border bg-accent font-semibold text-muted-foreground\",\n compact ? \"size-12 text-[13px]\" : \"size-14 text-[15px]\",\n )}\n />\n <div className=\"min-w-0 flex-1\">\n <p\n className={cn(\n \"truncate font-medium\",\n compact ? \"text-xs\" : \"text-sm\",\n )}\n >\n {isLoading ? t(\"settings.profileLoading\") : displayName}\n </p>\n {email && (\n <p className=\"truncate text-xs text-muted-foreground\">{email}</p>\n )}\n {photoStatus === \"saved\" && (\n <p className=\"mt-1 flex items-center gap-1 text-xs text-green-600 dark:text-green-400\">\n <IconCheck className=\"size-3\" />\n {t(\"settings.profilePhotoUpdated\")}\n </p>\n )}\n {photoStatus === \"error\" && (\n <p className=\"mt-1 text-xs text-destructive\">\n {t(\"settings.profilePhotoError\")}\n </p>\n )}\n </div>\n <input\n ref={fileInputRef}\n type=\"file\"\n accept=\"image/*\"\n className=\"hidden\"\n onChange={handleAvatarChange}\n />\n <ActionButton\n type=\"button\"\n intent=\"neutral\"\n emphasis=\"outline\"\n size=\"compact\"\n disabled={!email || uploading}\n leadingIcon={<IconCamera className=\"size-3.5\" />}\n onPress={() => fileInputRef.current?.click()}\n className=\"shrink-0\"\n >\n {uploading\n ? t(\"settings.profileUploading\")\n : t(\"settings.profileChangePhoto\")}\n </ActionButton>\n </div>\n\n <div className=\"space-y-3\">\n <TextField\n id=\"agent-native-profile-name\"\n label={t(\"settings.profileNameLabel\")}\n value={name}\n onChange={(value) => {\n updateProfile.reset();\n setName(value);\n }}\n placeholder={t(\"settings.profileNamePlaceholder\")}\n description={t(\"settings.profileNameDescription\")}\n disabled={!email || profileQuery.isLoading || updateProfile.isPending}\n />\n </div>\n\n <div className=\"border-t border-border/60 pt-3\">\n <SchedulingTimezoneField />\n </div>\n\n <div className=\"flex items-center justify-between gap-3 border-t border-border/60 pt-3\">\n <div className=\"min-h-4 text-xs\">\n {updateProfile.isSuccess && (\n <p className=\"text-green-600 dark:text-green-400\">\n {t(\"settings.profileSaved\")}\n </p>\n )}\n {updateProfile.error && (\n <p className=\"text-destructive\">{t(\"settings.profileSaveError\")}</p>\n )}\n </div>\n <ActionButton\n type=\"button\"\n intent=\"primary\"\n emphasis=\"solid\"\n size=\"compact\"\n pending={updateProfile.isPending}\n disabled={\n !email ||\n profileQuery.isLoading ||\n updateProfile.isPending ||\n !name.trim()\n }\n onPress={handleProfileSave}\n >\n {updateProfile.isPending\n ? t(\"settings.profileSaving\")\n : t(\"settings.profileSave\")}\n </ActionButton>\n </div>\n </div>\n );\n}\n\nexport interface AccountSettingsCardProps {\n className?: string;\n}\n\nexport function AccountSettingsCard({ className }: AccountSettingsCardProps) {\n const t = useT();\n\n return (\n <Surface\n as=\"section\"\n id=\"account\"\n elevation=\"low\"\n padding=\"none\"\n className={cn(\n \"mx-auto w-full max-w-2xl scroll-mt-4 rounded-lg border border-border bg-card p-5 text-card-foreground shadow-sm\",\n className,\n )}\n >\n <div className=\"space-y-1\">\n <h2 className=\"text-base font-semibold\">\n {t(\"settings.profileTitle\")}\n </h2>\n <p className=\"text-sm leading-6 text-muted-foreground\">\n {t(\"settings.profileDescription\")}\n </p>\n </div>\n <div className=\"mt-5\">\n <AccountSettingsForm />\n </div>\n </Surface>\n );\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timezone used when the agent schedules work for this user.
|
|
3
|
+
*
|
|
4
|
+
* This is deliberately a stored preference rather than a per-request read of
|
|
5
|
+
* the browser zone: automations are created and run by callers that have no
|
|
6
|
+
* browser at all (cron ticks, chat integrations, A2A), and those callers would
|
|
7
|
+
* otherwise fall back to the host zone and schedule the user's 8am job in UTC.
|
|
8
|
+
*/
|
|
9
|
+
export declare function SchedulingTimezoneField(): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=SchedulingTimezoneField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchedulingTimezoneField.d.ts","sourceRoot":"","sources":["../../../src/client/settings/SchedulingTimezoneField.tsx"],"names":[],"mappings":"AAcA;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,gCAgDtC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TimezoneSelect, browserTimezone, } from "../agent-page/TimezoneSelect.js";
|
|
3
|
+
import { useT } from "../i18n.js";
|
|
4
|
+
import { useActionMutation, useActionQuery } from "../use-action.js";
|
|
5
|
+
const SYSTEM = "system";
|
|
6
|
+
/**
|
|
7
|
+
* Timezone used when the agent schedules work for this user.
|
|
8
|
+
*
|
|
9
|
+
* This is deliberately a stored preference rather than a per-request read of
|
|
10
|
+
* the browser zone: automations are created and run by callers that have no
|
|
11
|
+
* browser at all (cron ticks, chat integrations, A2A), and those callers would
|
|
12
|
+
* otherwise fall back to the host zone and schedule the user's 8am job in UTC.
|
|
13
|
+
*/
|
|
14
|
+
export function SchedulingTimezoneField() {
|
|
15
|
+
const t = useT();
|
|
16
|
+
const detected = browserTimezone();
|
|
17
|
+
const preference = useActionQuery("get-localization-preference");
|
|
18
|
+
const save = useActionMutation("set-localization-preference");
|
|
19
|
+
// Selecting a zone commits it, matching the language picker beside it.
|
|
20
|
+
const stored = preference.data?.timezone ?? SYSTEM;
|
|
21
|
+
const pending = save.isPending ? save.variables?.timezone : undefined;
|
|
22
|
+
const value = pending ?? stored;
|
|
23
|
+
return (_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-sm font-medium", htmlFor: "agent-native-scheduling-timezone", children: t("settings.timezoneLabel", { defaultValue: "Timezone" }) }), _jsx(TimezoneSelect, { id: "agent-native-scheduling-timezone", value: value, disabled: preference.isLoading || save.isPending, suggested: [detected], systemLabel: t("settings.timezoneSystem", {
|
|
24
|
+
defaultValue: "Follow this browser ({{zone}})",
|
|
25
|
+
zone: detected,
|
|
26
|
+
}), onChange: (timezone) => save.mutate({ timezone }) }), _jsx("p", { className: "min-h-4 text-xs text-muted-foreground", children: save.error ? (_jsx("span", { className: "text-destructive", children: save.error.message })) : (t("settings.timezoneHint", {
|
|
27
|
+
defaultValue: "Used for timestamps and scheduled automations.",
|
|
28
|
+
})) })] }));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=SchedulingTimezoneField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchedulingTimezoneField.js","sourceRoot":"","sources":["../../../src/client/settings/SchedulingTimezoneField.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,cAAc,EACd,eAAe,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOrE,MAAM,MAAM,GAAG,QAAQ,CAAC;AAExB;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB;IACrC,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAC;IACnC,MAAM,UAAU,GAAG,cAAc,CAC/B,6BAA6B,CAC9B,CAAC;IACF,MAAM,IAAI,GAAG,iBAAiB,CAG5B,6BAA6B,CAAC,CAAC;IAEjC,uEAAuE;IACvE,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,EAAE,QAAQ,IAAI,MAAM,CAAC;IACnD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IACtE,MAAM,KAAK,GAAG,OAAO,IAAI,MAAM,CAAC;IAEhC,OAAO,CACL,eAAK,SAAS,EAAC,WAAW,aACxB,gBACE,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAC,kCAAkC,YAEzC,CAAC,CAAC,wBAAwB,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC,GACpD,EAER,KAAC,cAAc,IACb,EAAE,EAAC,kCAAkC,EACrC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,UAAU,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,EAChD,SAAS,EAAE,CAAC,QAAQ,CAAC,EACrB,WAAW,EAAE,CAAC,CAAC,yBAAyB,EAAE;oBACxC,YAAY,EAAE,gCAAgC;oBAC9C,IAAI,EAAE,QAAQ;iBACf,CAAC,EACF,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,GACjD,EAEF,YAAG,SAAS,EAAC,uCAAuC,YACjD,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACZ,eAAM,SAAS,EAAC,kBAAkB,YAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAQ,CAC/D,CAAC,CAAC,CAAC,CACF,CAAC,CAAC,uBAAuB,EAAE;oBACzB,YAAY,EAAE,gDAAgD;iBAC/D,CAAC,CACH,GACC,IACA,CACP,CAAC;AACJ,CAAC","sourcesContent":["import {\n TimezoneSelect,\n browserTimezone,\n} from \"../agent-page/TimezoneSelect.js\";\nimport { useT } from \"../i18n.js\";\nimport { useActionMutation, useActionQuery } from \"../use-action.js\";\n\ninterface LocalizationPreferenceResult {\n locale: string;\n timezone: string;\n}\n\nconst SYSTEM = \"system\";\n\n/**\n * Timezone used when the agent schedules work for this user.\n *\n * This is deliberately a stored preference rather than a per-request read of\n * the browser zone: automations are created and run by callers that have no\n * browser at all (cron ticks, chat integrations, A2A), and those callers would\n * otherwise fall back to the host zone and schedule the user's 8am job in UTC.\n */\nexport function SchedulingTimezoneField() {\n const t = useT();\n const detected = browserTimezone();\n const preference = useActionQuery<LocalizationPreferenceResult>(\n \"get-localization-preference\",\n );\n const save = useActionMutation<\n LocalizationPreferenceResult,\n { timezone: string }\n >(\"set-localization-preference\");\n\n // Selecting a zone commits it, matching the language picker beside it.\n const stored = preference.data?.timezone ?? SYSTEM;\n const pending = save.isPending ? save.variables?.timezone : undefined;\n const value = pending ?? stored;\n\n return (\n <div className=\"space-y-2\">\n <label\n className=\"text-sm font-medium\"\n htmlFor=\"agent-native-scheduling-timezone\"\n >\n {t(\"settings.timezoneLabel\", { defaultValue: \"Timezone\" })}\n </label>\n\n <TimezoneSelect\n id=\"agent-native-scheduling-timezone\"\n value={value}\n disabled={preference.isLoading || save.isPending}\n suggested={[detected]}\n systemLabel={t(\"settings.timezoneSystem\", {\n defaultValue: \"Follow this browser ({{zone}})\",\n zone: detected,\n })}\n onChange={(timezone) => save.mutate({ timezone })}\n />\n\n <p className=\"min-h-4 text-xs text-muted-foreground\">\n {save.error ? (\n <span className=\"text-destructive\">{save.error.message}</span>\n ) : (\n t(\"settings.timezoneHint\", {\n defaultValue: \"Used for timestamps and scheduled automations.\",\n })\n )}\n </p>\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface SettingsGroupProps {
|
|
3
|
+
/** Anchor target so a settings search hit can scroll the whole group. */
|
|
4
|
+
id?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A bordered card holding several one-line settings instead of one card per
|
|
12
|
+
* control. Copy is passed in already translated — core components do not
|
|
13
|
+
* resolve an app's i18n keys.
|
|
14
|
+
*/
|
|
15
|
+
export declare function SettingsGroup({ id, title, description, className, children, }: SettingsGroupProps): import("react").JSX.Element;
|
|
16
|
+
export interface SettingsRowProps {
|
|
17
|
+
/**
|
|
18
|
+
* Anchor target. Rows keep the ids their former standalone cards used, so
|
|
19
|
+
* existing settings-search hashes still resolve after a card collapses into
|
|
20
|
+
* a row.
|
|
21
|
+
*/
|
|
22
|
+
id?: string;
|
|
23
|
+
label: ReactNode;
|
|
24
|
+
description?: ReactNode;
|
|
25
|
+
icon?: ReactNode;
|
|
26
|
+
/** Badge or pill rendered beside the label. */
|
|
27
|
+
status?: ReactNode;
|
|
28
|
+
/** The input itself: switch, select, button, link. */
|
|
29
|
+
control?: ReactNode;
|
|
30
|
+
/** Extra content below the row, e.g. a disclosure panel. */
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
/** One setting: label and description on the start side, control on the end. */
|
|
35
|
+
export declare function SettingsRow({ id, label, description, icon, status, control, children, className, }: SettingsRowProps): import("react").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=SettingsRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsRow.d.ts","sourceRoot":"","sources":["../../../src/client/settings/SettingsRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,EAAE,EACF,KAAK,EACL,WAAW,EACX,SAAS,EACT,QAAQ,GACT,EAAE,kBAAkB,+BA0BpB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,sDAAsD;IACtD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,EAC1B,EAAE,EACF,KAAK,EACL,WAAW,EACX,IAAI,EACJ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,GACV,EAAE,gBAAgB,+BA+BlB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../utils.js";
|
|
3
|
+
/**
|
|
4
|
+
* A bordered card holding several one-line settings instead of one card per
|
|
5
|
+
* control. Copy is passed in already translated — core components do not
|
|
6
|
+
* resolve an app's i18n keys.
|
|
7
|
+
*/
|
|
8
|
+
export function SettingsGroup({ id, title, description, className, children, }) {
|
|
9
|
+
return (_jsxs("section", { id: id, className: cn("scroll-mt-16 overflow-hidden rounded-lg border border-border bg-card text-card-foreground shadow-sm", className), children: [(title || description) && (_jsxs("header", { className: "border-b border-border/60 px-5 py-4 sm:px-6", children: [title && (_jsx("h2", { className: "text-base font-semibold leading-none tracking-tight", children: title })), description && (_jsx("p", { className: "mt-1.5 text-sm leading-snug text-muted-foreground", children: description }))] })), _jsx("div", { className: "divide-y divide-border/60", children: children })] }));
|
|
10
|
+
}
|
|
11
|
+
/** One setting: label and description on the start side, control on the end. */
|
|
12
|
+
export function SettingsRow({ id, label, description, icon, status, control, children, className, }) {
|
|
13
|
+
return (_jsxs("div", { id: id, className: cn("scroll-mt-16 px-5 py-4 sm:px-6", className), children: [_jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("div", { className: "flex min-w-0 gap-3", children: [icon && (_jsx("span", { className: "mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md border border-border bg-background text-muted-foreground [&>svg]:size-[18px]", children: icon })), _jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "text-sm font-medium text-foreground", children: label }), status] }), description && (_jsx("p", { className: "mt-1 max-w-xl text-sm leading-6 text-muted-foreground", children: description }))] })] }), control && (_jsx("div", { className: "shrink-0 sm:ms-4 sm:text-end", children: control }))] }), children && _jsx("div", { className: "mt-4", children: children })] }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SettingsRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsRow.js","sourceRoot":"","sources":["../../../src/client/settings/SettingsRow.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAWjC;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,EAAE,EACF,KAAK,EACL,WAAW,EACX,SAAS,EACT,QAAQ,GACW;IACnB,OAAO,CACL,mBACE,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,EAAE,CACX,qGAAqG,EACrG,SAAS,CACV,aAEA,CAAC,KAAK,IAAI,WAAW,CAAC,IAAI,CACzB,kBAAQ,SAAS,EAAC,6CAA6C,aAC5D,KAAK,IAAI,CACR,aAAI,SAAS,EAAC,qDAAqD,YAChE,KAAK,GACH,CACN,EACA,WAAW,IAAI,CACd,YAAG,SAAS,EAAC,mDAAmD,YAC7D,WAAW,GACV,CACL,IACM,CACV,EACD,cAAK,SAAS,EAAC,2BAA2B,YAAE,QAAQ,GAAO,IACnD,CACX,CAAC;AACJ,CAAC;AAqBD,gFAAgF;AAChF,MAAM,UAAU,WAAW,CAAC,EAC1B,EAAE,EACF,KAAK,EACL,WAAW,EACX,IAAI,EACJ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,GACQ;IACjB,OAAO,CACL,eAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,gCAAgC,EAAE,SAAS,CAAC,aACrE,eAAK,SAAS,EAAC,oEAAoE,aACjF,eAAK,SAAS,EAAC,oBAAoB,aAChC,IAAI,IAAI,CACP,eAAM,SAAS,EAAC,iJAAiJ,YAC9J,IAAI,GACA,CACR,EACD,eAAK,SAAS,EAAC,SAAS,aACtB,eAAK,SAAS,EAAC,mCAAmC,aAChD,eAAM,SAAS,EAAC,qCAAqC,YAClD,KAAK,GACD,EACN,MAAM,IACH,EACL,WAAW,IAAI,CACd,YAAG,SAAS,EAAC,uDAAuD,YACjE,WAAW,GACV,CACL,IACG,IACF,EACL,OAAO,IAAI,CACV,cAAK,SAAS,EAAC,8BAA8B,YAAE,OAAO,GAAO,CAC9D,IACG,EACL,QAAQ,IAAI,cAAK,SAAS,EAAC,MAAM,YAAE,QAAQ,GAAO,IAC/C,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { cn } from \"../utils.js\";\n\nexport interface SettingsGroupProps {\n /** Anchor target so a settings search hit can scroll the whole group. */\n id?: string;\n title?: string;\n description?: string;\n className?: string;\n children: ReactNode;\n}\n\n/**\n * A bordered card holding several one-line settings instead of one card per\n * control. Copy is passed in already translated — core components do not\n * resolve an app's i18n keys.\n */\nexport function SettingsGroup({\n id,\n title,\n description,\n className,\n children,\n}: SettingsGroupProps) {\n return (\n <section\n id={id}\n className={cn(\n \"scroll-mt-16 overflow-hidden rounded-lg border border-border bg-card text-card-foreground shadow-sm\",\n className,\n )}\n >\n {(title || description) && (\n <header className=\"border-b border-border/60 px-5 py-4 sm:px-6\">\n {title && (\n <h2 className=\"text-base font-semibold leading-none tracking-tight\">\n {title}\n </h2>\n )}\n {description && (\n <p className=\"mt-1.5 text-sm leading-snug text-muted-foreground\">\n {description}\n </p>\n )}\n </header>\n )}\n <div className=\"divide-y divide-border/60\">{children}</div>\n </section>\n );\n}\n\nexport interface SettingsRowProps {\n /**\n * Anchor target. Rows keep the ids their former standalone cards used, so\n * existing settings-search hashes still resolve after a card collapses into\n * a row.\n */\n id?: string;\n label: ReactNode;\n description?: ReactNode;\n icon?: ReactNode;\n /** Badge or pill rendered beside the label. */\n status?: ReactNode;\n /** The input itself: switch, select, button, link. */\n control?: ReactNode;\n /** Extra content below the row, e.g. a disclosure panel. */\n children?: ReactNode;\n className?: string;\n}\n\n/** One setting: label and description on the start side, control on the end. */\nexport function SettingsRow({\n id,\n label,\n description,\n icon,\n status,\n control,\n children,\n className,\n}: SettingsRowProps) {\n return (\n <div id={id} className={cn(\"scroll-mt-16 px-5 py-4 sm:px-6\", className)}>\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex min-w-0 gap-3\">\n {icon && (\n <span className=\"mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md border border-border bg-background text-muted-foreground [&>svg]:size-[18px]\">\n {icon}\n </span>\n )}\n <div className=\"min-w-0\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-sm font-medium text-foreground\">\n {label}\n </span>\n {status}\n </div>\n {description && (\n <p className=\"mt-1 max-w-xl text-sm leading-6 text-muted-foreground\">\n {description}\n </p>\n )}\n </div>\n </div>\n {control && (\n <div className=\"shrink-0 sm:ms-4 sm:text-end\">{control}</div>\n )}\n </div>\n {children && <div className=\"mt-4\">{children}</div>}\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-settings-search.d.ts","sourceRoot":"","sources":["../../../src/client/settings/agent-settings-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,KAAK,GACL,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,WAAW,GACX,aAAa,GACb,SAAS,GACT,SAAS,GACT,UAAU,GACV,SAAS,GACT,MAAM,GACN,OAAO,GACP,SAAS,GACT,YAAY,GACZ,cAAc,GACd,OAAO,GACP,KAAK,CAAC;AAEV,eAAO,MAAM,oBAAoB,wBAmB/B,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,SAAS,iBAAiB,EAkB7D,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,SAAS,iBAAiB,EAQ/D,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,SAAS,iBAAiB,EAMpE,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,SAAS,iBAAiB,EAMnE,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-settings-search.d.ts","sourceRoot":"","sources":["../../../src/client/settings/agent-settings-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,KAAK,GACL,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,WAAW,GACX,aAAa,GACb,SAAS,GACT,SAAS,GACT,UAAU,GACV,SAAS,GACT,MAAM,GACN,OAAO,GACP,SAAS,GACT,YAAY,GACZ,cAAc,GACd,OAAO,GACP,KAAK,CAAC;AAEV,eAAO,MAAM,oBAAoB,wBAmB/B,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,SAAS,iBAAiB,EAkB7D,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,SAAS,iBAAiB,EAQ/D,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,SAAS,iBAAiB,EAMpE,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,SAAS,iBAAiB,EAMnE,CAAC;AAkFF,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,GACrC,mBAAmB,EAAE,CAWvB;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACvC;AAED,wBAAgB,0BAA0B,IAAI,sBAAsB,EAAE,CA2BrE"}
|
|
@@ -63,7 +63,7 @@ export const WORKSPACE_SETTINGS_SECTIONS = [
|
|
|
63
63
|
const SETTINGS_SECTION_SEARCH_META = {
|
|
64
64
|
account: {
|
|
65
65
|
label: "Account",
|
|
66
|
-
keywords: "profile photo avatar identity signed in email name",
|
|
66
|
+
keywords: "profile photo avatar identity signed in email name timezone time zone schedule scheduling clock",
|
|
67
67
|
},
|
|
68
68
|
llm: {
|
|
69
69
|
label: "LLM",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-settings-search.js","sourceRoot":"","sources":["../../../src/client/settings/agent-settings-search.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAoB;IAC7D,SAAS;IACT,KAAK;IACL,YAAY;IACZ,QAAQ;IACR,OAAO;IACP,WAAW;IACX,aAAa;IACb,SAAS;IACT,SAAS;IACT,UAAU;IACV,SAAS;IACT,MAAM;IACN,OAAO;IACP,SAAS;IACT,YAAY;IACZ,cAAc;IACd,OAAO;IACP,KAAK;CACN,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAiC;IACjE,KAAK;IACL,YAAY;IACZ,QAAQ;IACR,OAAO;IACP,WAAW;IACX,aAAa;IACb,SAAS;IACT,SAAS;IACT,UAAU;IACV,SAAS;IACT,MAAM;IACN,OAAO;IACP,SAAS;IACT,YAAY;IACZ,cAAc;IACd,OAAO;IACP,KAAK;CACN,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAiC;IACnE,KAAK;IACL,YAAY;IACZ,QAAQ;IACR,OAAO;IACP,aAAa;IACb,YAAY;IACZ,KAAK;CACN,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAiC;IACxE,SAAS;IACT,cAAc;IACd,OAAO;IACP,SAAS;IACT,OAAO;CACR,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAiC;IACvE,WAAW;IACX,SAAS;IACT,UAAU;IACV,SAAS;IACT,MAAM;CACP,CAAC;AAEF,MAAM,4BAA4B,GAG9B;IACF,OAAO,EAAE;QACP,KAAK,EAAE,SAAS;QAChB,QAAQ,
|
|
1
|
+
{"version":3,"file":"agent-settings-search.js","sourceRoot":"","sources":["../../../src/client/settings/agent-settings-search.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAoB;IAC7D,SAAS;IACT,KAAK;IACL,YAAY;IACZ,QAAQ;IACR,OAAO;IACP,WAAW;IACX,aAAa;IACb,SAAS;IACT,SAAS;IACT,UAAU;IACV,SAAS;IACT,MAAM;IACN,OAAO;IACP,SAAS;IACT,YAAY;IACZ,cAAc;IACd,OAAO;IACP,KAAK;CACN,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAiC;IACjE,KAAK;IACL,YAAY;IACZ,QAAQ;IACR,OAAO;IACP,WAAW;IACX,aAAa;IACb,SAAS;IACT,SAAS;IACT,UAAU;IACV,SAAS;IACT,MAAM;IACN,OAAO;IACP,SAAS;IACT,YAAY;IACZ,cAAc;IACd,OAAO;IACP,KAAK;CACN,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAiC;IACnE,KAAK;IACL,YAAY;IACZ,QAAQ;IACR,OAAO;IACP,aAAa;IACb,YAAY;IACZ,KAAK;CACN,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAiC;IACxE,SAAS;IACT,cAAc;IACd,OAAO;IACP,SAAS;IACT,OAAO;CACR,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAiC;IACvE,WAAW;IACX,SAAS;IACT,UAAU;IACV,SAAS;IACT,MAAM;CACP,CAAC;AAEF,MAAM,4BAA4B,GAG9B;IACF,OAAO,EAAE;QACP,KAAK,EAAE,SAAS;QAChB,QAAQ,EACN,iGAAiG;KACpG;IACD,GAAG,EAAE;QACH,KAAK,EAAE,KAAK;QACZ,QAAQ,EACN,yEAAyE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AAM,UAAU,yBAAyB,CACvC,QAAsC;IAEtC,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC9B,MAAM,IAAI,GAAG,4BAA4B,CAAC,OAAO,CAAC,CAAC;QACnD,OAAO;YACL,EAAE,EAAE,WAAW,OAAO,EAAE;YACxB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,IAAI,EAAE,OAAO;SACd,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AASD,MAAM,UAAU,0BAA0B;IACxC,OAAO;QACL;YACE,EAAE,EAAE,OAAO;YACX,KAAK,EAAE,cAAc;YACrB,QAAQ,EACN,iEAAiE;YACnE,aAAa,EAAE,yBAAyB,CAAC,uBAAuB,CAAC;SAClE;QACD;YACE,EAAE,EAAE,aAAa;YACjB,KAAK,EAAE,aAAa;YACpB,QAAQ,EAAE,sDAAsD;YAChE,aAAa,EAAE,yBAAyB,CAAC,4BAA4B,CAAC;SACvE;QACD;YACE,EAAE,EAAE,cAAc;YAClB,KAAK,EAAE,cAAc;YACrB,QAAQ,EAAE,qDAAqD;SAChE;QACD;YACE,EAAE,EAAE,WAAW;YACf,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,iDAAiD;YAC3D,aAAa,EAAE,yBAAyB,CAAC,2BAA2B,CAAC;SACtE;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { SettingsSearchEntry } from \"./SettingsTabsPage.js\";\n\nexport type SettingsSectionId =\n | \"account\"\n | \"llm\"\n | \"app-models\"\n | \"limits\"\n | \"voice\"\n | \"demo-mode\"\n | \"automations\"\n | \"secrets\"\n | \"hosting\"\n | \"database\"\n | \"uploads\"\n | \"auth\"\n | \"email\"\n | \"browser\"\n | \"background\"\n | \"integrations\"\n | \"usage\"\n | \"a2a\";\n\nexport const SETTINGS_SECTION_IDS = new Set<SettingsSectionId>([\n \"account\",\n \"llm\",\n \"app-models\",\n \"limits\",\n \"voice\",\n \"demo-mode\",\n \"automations\",\n \"secrets\",\n \"hosting\",\n \"database\",\n \"uploads\",\n \"auth\",\n \"email\",\n \"browser\",\n \"background\",\n \"integrations\",\n \"usage\",\n \"a2a\",\n]);\n\nexport const ALL_SETTINGS_SECTIONS: readonly SettingsSectionId[] = [\n \"llm\",\n \"app-models\",\n \"limits\",\n \"voice\",\n \"demo-mode\",\n \"automations\",\n \"secrets\",\n \"hosting\",\n \"database\",\n \"uploads\",\n \"auth\",\n \"email\",\n \"browser\",\n \"background\",\n \"integrations\",\n \"usage\",\n \"a2a\",\n];\n\nexport const AGENT_SETTINGS_SECTIONS: readonly SettingsSectionId[] = [\n \"llm\",\n \"app-models\",\n \"limits\",\n \"voice\",\n \"automations\",\n \"background\",\n \"a2a\",\n];\n\nexport const CONNECTION_SETTINGS_SECTIONS: readonly SettingsSectionId[] = [\n \"secrets\",\n \"integrations\",\n \"email\",\n \"browser\",\n \"usage\",\n];\n\nexport const WORKSPACE_SETTINGS_SECTIONS: readonly SettingsSectionId[] = [\n \"demo-mode\",\n \"hosting\",\n \"database\",\n \"uploads\",\n \"auth\",\n];\n\nconst SETTINGS_SECTION_SEARCH_META: Record<\n SettingsSectionId,\n { label: string; keywords: string; description?: string }\n> = {\n account: {\n label: \"Account\",\n keywords:\n \"profile photo avatar identity signed in email name timezone time zone schedule scheduling clock\",\n },\n llm: {\n label: \"LLM\",\n keywords:\n \"model claude gpt openai anthropic gemini api key provider ai engine llm\",\n },\n \"app-models\": {\n label: \"App Default Model\",\n keywords: \"default model provider app template composer\",\n },\n limits: {\n label: \"Agent Limits\",\n keywords: \"max iterations budget loop timeout runtime\",\n },\n voice: {\n label: \"Voice Transcription\",\n keywords: \"microphone dictation speech to text whisper\",\n },\n \"demo-mode\": {\n label: \"Demo mode\",\n keywords: \"fake data anonymize redact screenshot privacy mask\",\n },\n automations: {\n label: \"Automations\",\n keywords: \"triggers scheduled events cron jobs\",\n },\n secrets: {\n label: \"API Keys & Connections\",\n keywords: \"secrets credentials tokens api keys environment variables\",\n },\n hosting: {\n label: \"Hosting\",\n keywords: \"deploy netlify vercel cloudflare builder nitro\",\n },\n database: {\n label: \"Database\",\n keywords: \"postgres sqlite neon supabase turso storage sql pglite\",\n },\n uploads: {\n label: \"File uploads\",\n keywords: \"files storage s3 avatars attachments bucket blob\",\n },\n auth: {\n label: \"Authentication\",\n keywords: \"login signup oauth google github better auth access sso\",\n },\n email: {\n label: \"Email\",\n keywords: \"resend sendgrid smtp transactional notifications reports\",\n },\n browser: {\n label: \"Browser Automation\",\n keywords: \"web scraping playwright chrome headless\",\n },\n background: {\n label: \"Background Agent\",\n keywords: \"code changes branches builder production async\",\n },\n integrations: {\n label: \"Integrations\",\n keywords: \"slack telegram whatsapp discord messaging connect\",\n },\n usage: {\n label: \"Usage\",\n keywords: \"tokens cost spend billing consumption\",\n },\n a2a: {\n label: \"Connected Agents (A2A)\",\n keywords: \"remote agents protocol a2a connected\",\n },\n};\n\nexport function buildSectionSearchEntries(\n sections: readonly SettingsSectionId[],\n): SettingsSearchEntry[] {\n return sections.map((section) => {\n const meta = SETTINGS_SECTION_SEARCH_META[section];\n return {\n id: `section:${section}`,\n label: meta.label,\n keywords: meta.keywords,\n description: meta.description,\n hash: section,\n };\n });\n}\n\nexport interface AgentSettingsSearchTab {\n id: string;\n label: string;\n keywords: string;\n searchEntries?: SettingsSearchEntry[];\n}\n\nexport function getAgentSettingsSearchTabs(): AgentSettingsSearchTab[] {\n return [\n {\n id: \"agent\",\n label: \"Manage agent\",\n keywords:\n \"agent workspace manage agent model llm limits voice automations\",\n searchEntries: buildSectionSearchEntries(AGENT_SETTINGS_SECTIONS),\n },\n {\n id: \"connections\",\n label: \"Connections\",\n keywords: \"connections secrets integrations email browser usage\",\n searchEntries: buildSectionSearchEntries(CONNECTION_SETTINGS_SECTIONS),\n },\n {\n id: \"organization\",\n label: \"Organization\",\n keywords: \"organization org team members invites collaborators\",\n },\n {\n id: \"workspace\",\n label: \"Workspace\",\n keywords: \"workspace account hosting database uploads auth\",\n searchEntries: buildSectionSearchEntries(WORKSPACE_SETTINGS_SECTIONS),\n },\n ];\n}\n"]}
|
|
@@ -4,5 +4,6 @@ export { SettingsTabsPage, type SettingsSearchEntry, type SettingsTabItem, type
|
|
|
4
4
|
export { AccountSettingsCard, AccountSettingsForm, type AccountSettingsCardProps, type AccountSettingsFormProps, } from "./AccountSettingsCard.js";
|
|
5
5
|
export { openBuilderConnectPopup, useBuilderConnectFlow, useBuilderStatus, withBuilderConnectTrackingParams, type BuilderConnectFlow, type BuilderConnectFlowOptions, type BuilderConnectStartOptions, type BuilderStatus, type OpenBuilderConnectPopupOptions, } from "./useBuilderStatus.js";
|
|
6
6
|
export { SecretsSection, type SecretsSectionProps } from "./SecretsSection.js";
|
|
7
|
+
export { SettingsGroup, SettingsRow, type SettingsGroupProps, type SettingsRowProps, } from "./SettingsRow.js";
|
|
7
8
|
export { normalizeSettingsSection, settingsSectionDomId, useSettingsPanelController, type SettingsPanelController, type SettingsPanelControllerOptions, } from "./useSettingsPanelController.js";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/settings/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,aAAa,EACb,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,0BAA0B,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,GAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,EAChB,gCAAgC,EAChC,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,8BAA8B,GACpC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,GACpC,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/settings/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,aAAa,EACb,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,0BAA0B,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,GAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,EAChB,gCAAgC,EAChC,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,8BAA8B,GACpC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,aAAa,EACb,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,GACpC,MAAM,iCAAiC,CAAC"}
|