@agent-native/core 0.134.1 → 0.135.1
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/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/access.ts +44 -2
- 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-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/lib/recorder.ts +331 -36
- package/corpus/templates/clips/desktop/src/lib/upload-recovery.ts +129 -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/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/actions/_database-utils.ts +113 -4
- package/corpus/templates/content/actions/add-comment.ts +15 -1
- package/corpus/templates/content/actions/get-document.ts +84 -3
- package/corpus/templates/content/actions/list-documents.ts +1 -0
- package/corpus/templates/content/app/components/editor/BuilderBodySyncingNotice.tsx +9 -2
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +34 -15
- package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +55 -13
- package/corpus/templates/content/app/components/editor/body-hydration.ts +12 -6
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +2 -3
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +5 -12
- package/corpus/templates/content/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/content/app/hooks/use-content-database.ts +16 -27
- package/corpus/templates/content/app/hooks/use-content-prefs.ts +55 -0
- package/corpus/templates/content/app/hooks/use-create-page.ts +3 -6
- package/corpus/templates/content/app/hooks/use-document-properties.ts +9 -16
- package/corpus/templates/content/app/hooks/use-document-versions.ts +3 -3
- package/corpus/templates/content/app/hooks/use-documents.ts +85 -29
- package/corpus/templates/content/app/hooks/use-notion.ts +15 -13
- package/corpus/templates/content/app/i18n-data.ts +72 -1
- package/corpus/templates/content/app/lib/document-query.ts +36 -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-08-01-get-an-email-when-someone-comments-on-replies-in-or-mentions.md +6 -0
- package/corpus/templates/content/changelog/2026-08-02-pages-opened-from-a-database-now-keep-that-database-s-fields.md +6 -0
- package/corpus/templates/content/server/lib/comment-notifications.ts +146 -0
- package/corpus/templates/content/server/lib/document-context.ts +11 -6
- 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 +8 -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/app/routes/settings.tsx +14 -22
- 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/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/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 +4 -4
- package/dist/observability/routes.d.ts +3 -3
- 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/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +13 -13
- package/dist/provider-api/actions/provider-api.d.ts +8 -8
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- 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/server/transcribe-voice.d.ts +1 -1
- package/dist/sharing/access.d.ts.map +1 -1
- package/dist/sharing/access.js +32 -2
- package/dist/sharing/access.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/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/access.ts +44 -2
- 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
|
@@ -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,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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\";\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,E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,IAAI,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,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AAEF,MAAM,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"}
|
|
@@ -4,5 +4,6 @@ export { SettingsTabsPage, } from "./SettingsTabsPage.js";
|
|
|
4
4
|
export { AccountSettingsCard, AccountSettingsForm, } from "./AccountSettingsCard.js";
|
|
5
5
|
export { openBuilderConnectPopup, useBuilderConnectFlow, useBuilderStatus, withBuilderConnectTrackingParams, } from "./useBuilderStatus.js";
|
|
6
6
|
export { SecretsSection } from "./SecretsSection.js";
|
|
7
|
+
export { SettingsGroup, SettingsRow, } from "./SettingsRow.js";
|
|
7
8
|
export { normalizeSettingsSection, settingsSectionDomId, useSettingsPanelController, } from "./useSettingsPanelController.js";
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/settings/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,aAAa,EACb,oBAAoB,GAGrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,0BAA0B,GAE3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,gBAAgB,GAIjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,GAGpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,EAChB,gCAAgC,GAMjC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAA4B,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,GAG3B,MAAM,iCAAiC,CAAC","sourcesContent":["export {\n AgentSettingsContent,\n areExtensionSettingsEnabled,\n SettingsPanel,\n useAgentSettingsTabs,\n type AgentSettingsTabsOptions,\n type SettingsPanelProps,\n} from \"./SettingsPanel.js\";\nexport {\n getAgentSettingsSearchTabs,\n type AgentSettingsSearchTab,\n} from \"./agent-settings-search.js\";\nexport {\n SettingsTabsPage,\n type SettingsSearchEntry,\n type SettingsTabItem,\n type SettingsTabsPageProps,\n} from \"./SettingsTabsPage.js\";\nexport {\n AccountSettingsCard,\n AccountSettingsForm,\n type AccountSettingsCardProps,\n type AccountSettingsFormProps,\n} from \"./AccountSettingsCard.js\";\nexport {\n openBuilderConnectPopup,\n useBuilderConnectFlow,\n useBuilderStatus,\n withBuilderConnectTrackingParams,\n type BuilderConnectFlow,\n type BuilderConnectFlowOptions,\n type BuilderConnectStartOptions,\n type BuilderStatus,\n type OpenBuilderConnectPopupOptions,\n} from \"./useBuilderStatus.js\";\nexport { SecretsSection, type SecretsSectionProps } from \"./SecretsSection.js\";\nexport {\n normalizeSettingsSection,\n settingsSectionDomId,\n useSettingsPanelController,\n type SettingsPanelController,\n type SettingsPanelControllerOptions,\n} from \"./useSettingsPanelController.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/settings/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,aAAa,EACb,oBAAoB,GAGrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,0BAA0B,GAE3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,gBAAgB,GAIjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,GAGpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,EAChB,gCAAgC,GAMjC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAA4B,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,aAAa,EACb,WAAW,GAGZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,GAG3B,MAAM,iCAAiC,CAAC","sourcesContent":["export {\n AgentSettingsContent,\n areExtensionSettingsEnabled,\n SettingsPanel,\n useAgentSettingsTabs,\n type AgentSettingsTabsOptions,\n type SettingsPanelProps,\n} from \"./SettingsPanel.js\";\nexport {\n getAgentSettingsSearchTabs,\n type AgentSettingsSearchTab,\n} from \"./agent-settings-search.js\";\nexport {\n SettingsTabsPage,\n type SettingsSearchEntry,\n type SettingsTabItem,\n type SettingsTabsPageProps,\n} from \"./SettingsTabsPage.js\";\nexport {\n AccountSettingsCard,\n AccountSettingsForm,\n type AccountSettingsCardProps,\n type AccountSettingsFormProps,\n} from \"./AccountSettingsCard.js\";\nexport {\n openBuilderConnectPopup,\n useBuilderConnectFlow,\n useBuilderStatus,\n withBuilderConnectTrackingParams,\n type BuilderConnectFlow,\n type BuilderConnectFlowOptions,\n type BuilderConnectStartOptions,\n type BuilderStatus,\n type OpenBuilderConnectPopupOptions,\n} from \"./useBuilderStatus.js\";\nexport { SecretsSection, type SecretsSectionProps } from \"./SecretsSection.js\";\nexport {\n SettingsGroup,\n SettingsRow,\n type SettingsGroupProps,\n type SettingsRowProps,\n} from \"./SettingsRow.js\";\nexport {\n normalizeSettingsSection,\n settingsSectionDomId,\n useSettingsPanelController,\n type SettingsPanelController,\n type SettingsPanelControllerOptions,\n} from \"./useSettingsPanelController.js\";\n"]}
|
|
@@ -17,12 +17,12 @@ declare const _default: import("../../action.js").ActionDefinition<{
|
|
|
17
17
|
id?: undefined;
|
|
18
18
|
provider?: undefined;
|
|
19
19
|
} | {
|
|
20
|
+
error?: undefined;
|
|
20
21
|
configured?: undefined;
|
|
21
22
|
connectPath?: undefined;
|
|
22
23
|
url: string;
|
|
23
24
|
id: string;
|
|
24
25
|
provider: string;
|
|
25
|
-
error?: undefined;
|
|
26
26
|
}>;
|
|
27
27
|
export default _default;
|
|
28
28
|
//# sourceMappingURL=upload-image.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/integrations/identity.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAE/E,MAAM,MAAM,gCAAgC,GACxC,YAAY,GACZ,OAAO,GACP,oBAAoB,GACpB,yBAAyB,CAAC;AAE9B;;;;;GAKG;AACH,qBAAa,gCAAiC,SAAQ,KAAK;IACzD,QAAQ,CAAC,MAAM,EAAE,gCAAgC,CAAC;IAClD,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IAEnC,YACE,MAAM,EAAE,gCAAgC,EACxC,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,MAAM,EAM1B;CACF;
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/integrations/identity.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAE/E,MAAM,MAAM,gCAAgC,GACxC,YAAY,GACZ,OAAO,GACP,oBAAoB,GACpB,yBAAyB,CAAC;AAE9B;;;;;GAKG;AACH,qBAAa,gCAAiC,SAAQ,KAAK;IACzD,QAAQ,CAAC,MAAM,EAAE,gCAAgC,CAAC;IAClD,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IAEnC,YACE,MAAM,EAAE,gCAAgC,EACxC,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,MAAM,EAM1B;CACF;AAyCD;;;;;;;;;;;;GAYG;AACH,wBAAsB,yCAAyC,CAC7D,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,2BAA2B,CAAC,CA8FtC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isOrgMember as isMemberOfOrg } from "../org/membership.js";
|
|
2
2
|
import { upsertVerifiedIntegrationIdentity } from "./identity-links-store.js";
|
|
3
3
|
import { getActiveIntegrationInstallationByKey, getActiveIntegrationInstallationForTenant, } from "./installations-store.js";
|
|
4
4
|
import { slackInstallationKey } from "./slack-oauth.js";
|
|
@@ -48,15 +48,6 @@ async function resolveSlackInstallation(incoming) {
|
|
|
48
48
|
? getActiveIntegrationInstallationForTenant("slack", teamId ?? enterpriseId)
|
|
49
49
|
: null;
|
|
50
50
|
}
|
|
51
|
-
async function isMemberOfOrg(email, orgId) {
|
|
52
|
-
const { rows } = await getDbExec().execute({
|
|
53
|
-
sql: `SELECT 1 FROM org_members
|
|
54
|
-
WHERE org_id = ? AND LOWER(email) = ?
|
|
55
|
-
LIMIT 1`,
|
|
56
|
-
args: [orgId, email],
|
|
57
|
-
});
|
|
58
|
-
return rows.length > 0;
|
|
59
|
-
}
|
|
60
51
|
/**
|
|
61
52
|
* Resolve the default integration principal.
|
|
62
53
|
*
|
|
@@ -101,7 +92,7 @@ export async function resolveDefaultIntegrationExecutionContext(incoming) {
|
|
|
101
92
|
incoming.senderId &&
|
|
102
93
|
incoming.tenantId) {
|
|
103
94
|
try {
|
|
104
|
-
isOrgMember = await isMemberOfOrg(
|
|
95
|
+
isOrgMember = await isMemberOfOrg(installation.orgId, email);
|
|
105
96
|
}
|
|
106
97
|
catch {
|
|
107
98
|
// A membership-store outage is not evidence that the sender is merely
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/integrations/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iCAAiC,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EACL,qCAAqC,EACrC,yCAAyC,GAC1C,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AASxD;;;;;GAKG;A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AAQ;YAC3B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,cAAc,EAAE,QAAQ,CAAC,QAAQ;YACjC,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,YAAY,CAAC,KAAK;SAC1B,CAAC,CAAC;QACH,OAAO;YACL,UAAU,EAAE,IAAI,CAAC,SAAS;YAC1B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,aAAa,EAAE,MAAM;YACrB,cAAc,EAAE,YAAY,CAAC,EAAE;SAChC,CAAC;IACJ,CAAC;IAED,qEAAqE;IACrE,2EAA2E;IAC3E,6EAA6E;IAC7E,mEAAmE;IACnE,0EAA0E;IAC1E,kCAAkC;IAClC,OAAO,CAAC,IAAI,CACV,gEAAgE,QAAQ,CAAC,QAAQ,WAAW,QAAQ,CAAC,QAAQ,IAAI,SAAS,iBAAiB,OAAO,CAAC,KAAK,CAAC,eAAe,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE,CACzM,CAAC;IACF,OAAO;QACL,UAAU,EAAE,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC3C,KAAK,EAAE,YAAY,CAAC,KAAK;QACzB,aAAa,EAAE,SAAS;QACxB,cAAc,EAAE,YAAY,CAAC,EAAE;QAC/B,eAAe,EAAE,IAAI;KACtB,CAAC;AACJ,CAAC","sourcesContent":["import { getDbExec } from \"../db/client.js\";\nimport { upsertVerifiedIntegrationIdentity } from \"./identity-links-store.js\";\nimport {\n getActiveIntegrationInstallationByKey,\n getActiveIntegrationInstallationForTenant,\n} from \"./installations-store.js\";\nimport { slackInstallationKey } from \"./slack-oauth.js\";\nimport type { IncomingMessage, IntegrationExecutionContext } from \"./types.js\";\n\nexport type IntegrationIdentityDeclineReason =\n | \"unverified\"\n | \"guest\"\n | \"unlinked-workspace\"\n | \"membership-check-failed\";\n\n/**\n * Thrown when the default Slack DM identity ladder declines to run a message.\n * `reason` is a stable machine-readable discriminator (used e.g. to dedupe\n * decline replies); `userFacingMessage` is safe to send back to the sender as\n * a polite reply; `message` stays log-only.\n */\nexport class IntegrationIdentityDeclinedError extends Error {\n readonly reason: IntegrationIdentityDeclineReason;\n readonly userFacingMessage: string;\n\n constructor(\n reason: IntegrationIdentityDeclineReason,\n message: string,\n userFacingMessage: string,\n ) {\n super(message);\n this.name = \"IntegrationIdentityDeclinedError\";\n this.reason = reason;\n this.userFacingMessage = userFacingMessage;\n }\n}\n\nfunction serviceOwner(platform: string): string {\n return `integration@${platform}`;\n}\n\nfunction normalizedEmail(value: unknown): string | null {\n if (typeof value !== \"string\") return null;\n const email = value.trim().toLowerCase();\n if (!email || email.length > 320 || !email.includes(\"@\")) return null;\n return email;\n}\n\nasync function resolveSlackInstallation(incoming: IncomingMessage) {\n const teamId =\n typeof incoming.platformContext.teamId === \"string\"\n ? incoming.platformContext.teamId\n : incoming.tenantId;\n const enterpriseId =\n typeof incoming.platformContext.enterpriseId === \"string\"\n ? incoming.platformContext.enterpriseId\n : undefined;\n const apiAppId =\n typeof incoming.platformContext.apiAppId === \"string\"\n ? incoming.platformContext.apiAppId\n : undefined;\n if (apiAppId && (teamId || enterpriseId)) {\n const byKey = await getActiveIntegrationInstallationByKey(\n \"slack\",\n slackInstallationKey({ teamId, enterpriseId, apiAppId }),\n );\n if (byKey) return byKey;\n }\n return teamId || enterpriseId\n ? getActiveIntegrationInstallationForTenant(\n \"slack\",\n teamId ?? enterpriseId!,\n )\n : null;\n}\n\nasync function isMemberOfOrg(email: string, orgId: string): Promise<boolean> {\n const { rows } = await getDbExec().execute({\n sql: `SELECT 1 FROM org_members\n WHERE org_id = ? AND LOWER(email) = ?\n LIMIT 1`,\n args: [orgId, email],\n });\n return rows.length > 0;\n}\n\n/**\n * Resolve the default integration principal.\n *\n * Slack DMs become a user principal only after the adapter has verified the\n * sender email and the email is already a member of the managed installation's\n * Agent Native organization. Hydrated full workspace members whose email is\n * missing, unverified, or not an organization member run as an anonymous\n * org-scoped service principal instead — the same visibility shared channels\n * get. Hydration failures, guests/external members, and workspaces without a\n * connected organization are declined with a user-facing message. Shared\n * channels deliberately stay service-scoped so a channel message cannot borrow\n * one participant's private permissions.\n */\nexport async function resolveDefaultIntegrationExecutionContext(\n incoming: IncomingMessage,\n): Promise<IntegrationExecutionContext> {\n const installation =\n incoming.platform === \"slack\"\n ? await resolveSlackInstallation(incoming)\n : null;\n\n if (incoming.platform !== \"slack\" || incoming.conversationType !== \"dm\") {\n return {\n ownerEmail: serviceOwner(incoming.platform),\n orgId: installation?.orgId ?? null,\n principalType: \"service\",\n ...(installation?.id ? { installationId: installation.id } : {}),\n };\n }\n\n // Hydration check first: a transient users.info failure must land on the\n // retry decline here, never on the anonymous org-scoped tier below.\n if (incoming.actorTrust?.verified !== true) {\n throw new IntegrationIdentityDeclinedError(\n \"unverified\",\n \"Slack DM sender identity could not be hydrated; declining instead of guessing a principal.\",\n \"I couldn't verify your Slack identity just now, so I can't run this request. Please try again in a moment.\",\n );\n }\n if (\n incoming.actorTrust.memberType === \"guest\" ||\n incoming.actorTrust.memberType === \"external\"\n ) {\n throw new IntegrationIdentityDeclinedError(\n \"guest\",\n \"External or guest Slack members cannot use this integration.\",\n \"This assistant is only available to members of this workspace's organization.\",\n );\n }\n if (!installation?.orgId) {\n throw new IntegrationIdentityDeclinedError(\n \"unlinked-workspace\",\n \"Slack workspace is not connected to an Agent Native organization.\",\n \"This Slack workspace isn't connected to an organization yet.\",\n );\n }\n\n const email = normalizedEmail(incoming.senderEmail);\n let isOrgMember = false;\n if (\n email &&\n incoming.senderVerified === true &&\n incoming.senderId &&\n incoming.tenantId\n ) {\n try {\n isOrgMember = await isMemberOfOrg(email, installation.orgId);\n } catch {\n // A membership-store outage is not evidence that the sender is merely\n // unlinked. Fail closed instead of widening them to org-wide access.\n throw new IntegrationIdentityDeclinedError(\n \"membership-check-failed\",\n \"Slack DM organization membership could not be verified.\",\n \"I couldn't verify your organization membership just now, so I can't run this request. Please try again in a moment.\",\n );\n }\n }\n if (isOrgMember && email && incoming.senderId && incoming.tenantId) {\n const link = await upsertVerifiedIntegrationIdentity({\n platform: incoming.platform,\n tenantId: incoming.tenantId,\n externalUserId: incoming.senderId,\n userEmail: email,\n orgId: installation.orgId,\n });\n return {\n ownerEmail: link.userEmail,\n orgId: link.orgId,\n principalType: \"user\",\n installationId: installation.id,\n };\n }\n\n // Hydrated full workspace member (member/admin/owner) whose email is\n // unverified, missing (legacy install without users:read.email), or not an\n // organization member: run with the anonymous org-scoped service principal —\n // the same visibility shared channels get. Nothing user-private is\n // accessible. One structured line keeps 100%-anonymous workspaces (legacy\n // scope missing) visible in logs.\n console.warn(\n `[integrations] anonymous org-scoped principal used: platform=${incoming.platform} teamId=${incoming.tenantId ?? \"unknown\"} emailPresent=${Boolean(email)} memberType=${incoming.actorTrust.memberType}`,\n );\n return {\n ownerEmail: serviceOwner(incoming.platform),\n orgId: installation.orgId,\n principalType: \"service\",\n installationId: installation.id,\n anonymousMember: true,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/integrations/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,iCAAiC,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EACL,qCAAqC,EACrC,yCAAyC,GAC1C,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AASxD;;;;;GAKG;AACH,MAAM,OAAO,gCAAiC,SAAQ,KAAK;IAChD,MAAM,CAAmC;IACzC,iBAAiB,CAAS;IAEnC,YACE,MAAwC,EACxC,OAAe,EACf,iBAAyB;QAEzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kCAAkC,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;CACF;AAED,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U,EAAE,CACzM,CAAC;IACF,OAAO;QACL,UAAU,EAAE,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC3C,KAAK,EAAE,YAAY,CAAC,KAAK;QACzB,aAAa,EAAE,SAAS;QACxB,cAAc,EAAE,YAAY,CAAC,EAAE;QAC/B,eAAe,EAAE,IAAI;KACtB,CAAC;AACJ,CAAC","sourcesContent":["import { isOrgMember as isMemberOfOrg } from \"../org/membership.js\";\nimport { upsertVerifiedIntegrationIdentity } from \"./identity-links-store.js\";\nimport {\n getActiveIntegrationInstallationByKey,\n getActiveIntegrationInstallationForTenant,\n} from \"./installations-store.js\";\nimport { slackInstallationKey } from \"./slack-oauth.js\";\nimport type { IncomingMessage, IntegrationExecutionContext } from \"./types.js\";\n\nexport type IntegrationIdentityDeclineReason =\n | \"unverified\"\n | \"guest\"\n | \"unlinked-workspace\"\n | \"membership-check-failed\";\n\n/**\n * Thrown when the default Slack DM identity ladder declines to run a message.\n * `reason` is a stable machine-readable discriminator (used e.g. to dedupe\n * decline replies); `userFacingMessage` is safe to send back to the sender as\n * a polite reply; `message` stays log-only.\n */\nexport class IntegrationIdentityDeclinedError extends Error {\n readonly reason: IntegrationIdentityDeclineReason;\n readonly userFacingMessage: string;\n\n constructor(\n reason: IntegrationIdentityDeclineReason,\n message: string,\n userFacingMessage: string,\n ) {\n super(message);\n this.name = \"IntegrationIdentityDeclinedError\";\n this.reason = reason;\n this.userFacingMessage = userFacingMessage;\n }\n}\n\nfunction serviceOwner(platform: string): string {\n return `integration@${platform}`;\n}\n\nfunction normalizedEmail(value: unknown): string | null {\n if (typeof value !== \"string\") return null;\n const email = value.trim().toLowerCase();\n if (!email || email.length > 320 || !email.includes(\"@\")) return null;\n return email;\n}\n\nasync function resolveSlackInstallation(incoming: IncomingMessage) {\n const teamId =\n typeof incoming.platformContext.teamId === \"string\"\n ? incoming.platformContext.teamId\n : incoming.tenantId;\n const enterpriseId =\n typeof incoming.platformContext.enterpriseId === \"string\"\n ? incoming.platformContext.enterpriseId\n : undefined;\n const apiAppId =\n typeof incoming.platformContext.apiAppId === \"string\"\n ? incoming.platformContext.apiAppId\n : undefined;\n if (apiAppId && (teamId || enterpriseId)) {\n const byKey = await getActiveIntegrationInstallationByKey(\n \"slack\",\n slackInstallationKey({ teamId, enterpriseId, apiAppId }),\n );\n if (byKey) return byKey;\n }\n return teamId || enterpriseId\n ? getActiveIntegrationInstallationForTenant(\n \"slack\",\n teamId ?? enterpriseId!,\n )\n : null;\n}\n\n/**\n * Resolve the default integration principal.\n *\n * Slack DMs become a user principal only after the adapter has verified the\n * sender email and the email is already a member of the managed installation's\n * Agent Native organization. Hydrated full workspace members whose email is\n * missing, unverified, or not an organization member run as an anonymous\n * org-scoped service principal instead — the same visibility shared channels\n * get. Hydration failures, guests/external members, and workspaces without a\n * connected organization are declined with a user-facing message. Shared\n * channels deliberately stay service-scoped so a channel message cannot borrow\n * one participant's private permissions.\n */\nexport async function resolveDefaultIntegrationExecutionContext(\n incoming: IncomingMessage,\n): Promise<IntegrationExecutionContext> {\n const installation =\n incoming.platform === \"slack\"\n ? await resolveSlackInstallation(incoming)\n : null;\n\n if (incoming.platform !== \"slack\" || incoming.conversationType !== \"dm\") {\n return {\n ownerEmail: serviceOwner(incoming.platform),\n orgId: installation?.orgId ?? null,\n principalType: \"service\",\n ...(installation?.id ? { installationId: installation.id } : {}),\n };\n }\n\n // Hydration check first: a transient users.info failure must land on the\n // retry decline here, never on the anonymous org-scoped tier below.\n if (incoming.actorTrust?.verified !== true) {\n throw new IntegrationIdentityDeclinedError(\n \"unverified\",\n \"Slack DM sender identity could not be hydrated; declining instead of guessing a principal.\",\n \"I couldn't verify your Slack identity just now, so I can't run this request. Please try again in a moment.\",\n );\n }\n if (\n incoming.actorTrust.memberType === \"guest\" ||\n incoming.actorTrust.memberType === \"external\"\n ) {\n throw new IntegrationIdentityDeclinedError(\n \"guest\",\n \"External or guest Slack members cannot use this integration.\",\n \"This assistant is only available to members of this workspace's organization.\",\n );\n }\n if (!installation?.orgId) {\n throw new IntegrationIdentityDeclinedError(\n \"unlinked-workspace\",\n \"Slack workspace is not connected to an Agent Native organization.\",\n \"This Slack workspace isn't connected to an organization yet.\",\n );\n }\n\n const email = normalizedEmail(incoming.senderEmail);\n let isOrgMember = false;\n if (\n email &&\n incoming.senderVerified === true &&\n incoming.senderId &&\n incoming.tenantId\n ) {\n try {\n isOrgMember = await isMemberOfOrg(installation.orgId, email);\n } catch {\n // A membership-store outage is not evidence that the sender is merely\n // unlinked. Fail closed instead of widening them to org-wide access.\n throw new IntegrationIdentityDeclinedError(\n \"membership-check-failed\",\n \"Slack DM organization membership could not be verified.\",\n \"I couldn't verify your organization membership just now, so I can't run this request. Please try again in a moment.\",\n );\n }\n }\n if (isOrgMember && email && incoming.senderId && incoming.tenantId) {\n const link = await upsertVerifiedIntegrationIdentity({\n platform: incoming.platform,\n tenantId: incoming.tenantId,\n externalUserId: incoming.senderId,\n userEmail: email,\n orgId: installation.orgId,\n });\n return {\n ownerEmail: link.userEmail,\n orgId: link.orgId,\n principalType: \"user\",\n installationId: installation.id,\n };\n }\n\n // Hydrated full workspace member (member/admin/owner) whose email is\n // unverified, missing (legacy install without users:read.email), or not an\n // organization member: run with the anonymous org-scoped service principal —\n // the same visibility shared channels get. Nothing user-private is\n // accessible. One structured line keeps 100%-anonymous workspaces (legacy\n // scope missing) visible in logs.\n console.warn(\n `[integrations] anonymous org-scoped principal used: platform=${incoming.platform} teamId=${incoming.tenantId ?? \"unknown\"} emailPresent=${Boolean(email)} memberType=${incoming.actorTrust.memberType}`,\n );\n return {\n ownerEmail: serviceOwner(incoming.platform),\n orgId: installation.orgId,\n principalType: \"service\",\n installationId: installation.id,\n anonymousMember: true,\n };\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type AutomationRun } from "../run-history.js";
|
|
2
|
+
declare const _default: import("../../action.js").ActionDefinition<{
|
|
3
|
+
name: string;
|
|
4
|
+
scope?: "organization" | "personal";
|
|
5
|
+
limit?: number;
|
|
6
|
+
}, AutomationRun[]>;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=list-automation-runs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-automation-runs.d.ts","sourceRoot":"","sources":["../../../src/jobs/actions/list-automation-runs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineAction } from "../../action.js";
|
|
3
|
+
import { organizationResourceOwner } from "../../resources/store.js";
|
|
4
|
+
import { listAutomationRuns } from "../run-history.js";
|
|
5
|
+
const scopeSchema = z.enum(["personal", "organization"]);
|
|
6
|
+
export default defineAction({
|
|
7
|
+
description: "List past execution records for one automation or recurring job in the selected scope.",
|
|
8
|
+
agentTool: false,
|
|
9
|
+
schema: z.object({
|
|
10
|
+
name: z.string().min(1),
|
|
11
|
+
scope: scopeSchema.default("personal"),
|
|
12
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
13
|
+
}),
|
|
14
|
+
http: { method: "GET" },
|
|
15
|
+
readOnly: true,
|
|
16
|
+
parallelSafe: true,
|
|
17
|
+
run: async ({ name, scope, limit }, ctx) => {
|
|
18
|
+
const userEmail = ctx?.userEmail;
|
|
19
|
+
if (!userEmail)
|
|
20
|
+
throw new Error("Not authenticated.");
|
|
21
|
+
if (scope === "organization" && !ctx?.orgId)
|
|
22
|
+
return [];
|
|
23
|
+
const owner = scope === "organization"
|
|
24
|
+
? organizationResourceOwner(ctx.orgId)
|
|
25
|
+
: userEmail;
|
|
26
|
+
return listAutomationRuns({ owners: [owner], automation: name, limit });
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=list-automation-runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-automation-runs.js","sourceRoot":"","sources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AAC;YAChD,CAAC,CAAC,SAAS,CAAC;QAEhB,OAAO,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\n\nimport { defineAction } from \"../../action.js\";\nimport { organizationResourceOwner } from \"../../resources/store.js\";\nimport { listAutomationRuns, type AutomationRun } from \"../run-history.js\";\n\nconst scopeSchema = z.enum([\"personal\", \"organization\"]);\n\nexport default defineAction({\n description:\n \"List past execution records for one automation or recurring job in the selected scope.\",\n agentTool: false,\n schema: z.object({\n name: z.string().min(1),\n scope: scopeSchema.default(\"personal\"),\n limit: z.number().int().min(1).max(100).optional(),\n }),\n http: { method: \"GET\" },\n readOnly: true,\n parallelSafe: true,\n run: async ({ name, scope, limit }, ctx): Promise<AutomationRun[]> => {\n const userEmail = ctx?.userEmail;\n if (!userEmail) throw new Error(\"Not authenticated.\");\n if (scope === \"organization\" && !ctx?.orgId) return [];\n\n const owner =\n scope === \"organization\"\n ? organizationResourceOwner(ctx.orgId as string)\n : userEmail;\n\n return listAutomationRuns({ owners: [owner], automation: name, limit });\n },\n});\n"]}
|
|
@@ -4,10 +4,12 @@ export interface RecurringJobActionItem {
|
|
|
4
4
|
path: string;
|
|
5
5
|
scope: "personal" | "organization";
|
|
6
6
|
schedule: string;
|
|
7
|
+
timezone: string;
|
|
7
8
|
scheduleDescription: string;
|
|
8
9
|
instructions: string;
|
|
9
10
|
enabled: boolean;
|
|
10
11
|
lastRun: string | null;
|
|
12
|
+
lastCheck: string | null;
|
|
11
13
|
lastStatus: string | null;
|
|
12
14
|
lastError: string | null;
|
|
13
15
|
nextRun: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-recurring-jobs.d.ts","sourceRoot":"","sources":["../../../src/jobs/actions/list-recurring-jobs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-recurring-jobs.d.ts","sourceRoot":"","sources":["../../../src/jobs/actions/list-recurring-jobs.ts"],"names":[],"mappings":"AA6CA,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,GAAG,cAAc,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { defineAction } from "../../action.js";
|
|
3
3
|
import { organizationResourceOwner, resourceGetByPath, resourceList, } from "../../resources/store.js";
|
|
4
|
-
import { describeCron, isValidCron, nextOccurrence } from "../cron.js";
|
|
4
|
+
import { describeCron, effectiveTimezone, isValidCron, nextOccurrence, } from "../cron.js";
|
|
5
5
|
import { classifyJobResource } from "../frontmatter.js";
|
|
6
6
|
import { parseJobFrontmatter } from "../scheduler.js";
|
|
7
7
|
import { authorizeJobMutation } from "../tools.js";
|
|
@@ -9,15 +9,24 @@ const scopeSchema = z.enum(["personal", "organization"]);
|
|
|
9
9
|
function jobName(path) {
|
|
10
10
|
return path.replace(/^jobs\//, "").replace(/\.md$/, "");
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* A stored `nextRun` in the past means the scheduler kept declining to run the
|
|
14
|
+
* job, not that it is due two days ago. Report the real next occurrence and
|
|
15
|
+
* let `lastError` carry the reason it keeps being passed over.
|
|
16
|
+
*/
|
|
12
17
|
function nextRun(meta) {
|
|
13
18
|
if (!meta.enabled)
|
|
14
19
|
return null;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
const scheduled = Boolean(meta.schedule && isValidCron(meta.schedule));
|
|
21
|
+
if (meta.nextRun) {
|
|
22
|
+
const stored = new Date(meta.nextRun).getTime();
|
|
23
|
+
if (!Number.isFinite(stored) || stored > Date.now() || !scheduled) {
|
|
24
|
+
return meta.nextRun;
|
|
25
|
+
}
|
|
19
26
|
}
|
|
20
|
-
return
|
|
27
|
+
return scheduled
|
|
28
|
+
? nextOccurrence(meta.schedule, undefined, meta.timezone).toISOString()
|
|
29
|
+
: null;
|
|
21
30
|
}
|
|
22
31
|
export default defineAction({
|
|
23
32
|
description: "List legacy recurring cron jobs visible in the selected personal or organization scope. This compatibility read surface is used by the Agent Automations page.",
|
|
@@ -55,10 +64,14 @@ export default defineAction({
|
|
|
55
64
|
path: full.path,
|
|
56
65
|
scope,
|
|
57
66
|
schedule: meta.schedule,
|
|
58
|
-
|
|
67
|
+
timezone: effectiveTimezone(meta.timezone),
|
|
68
|
+
scheduleDescription: meta.schedule
|
|
69
|
+
? describeCron(meta.schedule, effectiveTimezone(meta.timezone))
|
|
70
|
+
: "",
|
|
59
71
|
instructions: body,
|
|
60
72
|
enabled: meta.enabled,
|
|
61
73
|
lastRun: meta.lastRun ?? null,
|
|
74
|
+
lastCheck: meta.lastCheck ?? null,
|
|
62
75
|
lastStatus: meta.lastStatus ?? null,
|
|
63
76
|
lastError: meta.lastError ?? null,
|
|
64
77
|
nextRun: nextRun(meta),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-recurring-jobs.js","sourceRoot":"","sources":["../../../src/jobs/actions/list-recurring-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"list-recurring-jobs.js","sourceRoot":"","sources":["../../../src/jobs/actions/list-recurring-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;AAEzD,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AAC1D,CAAC;AAED;;;;GAIG;AACH,SAAS,OAAO,CACd,IAAoD;IAEpD,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC/B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvE,IAAI,IA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SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI;gBACjC,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI;gBACnC,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI;gBACjC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC;gBACtB,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI;gBACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE;gBAC7B,SAAS;aACV,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\n\nimport { defineAction } from \"../../action.js\";\nimport {\n organizationResourceOwner,\n resourceGetByPath,\n resourceList,\n} from \"../../resources/store.js\";\nimport {\n describeCron,\n effectiveTimezone,\n isValidCron,\n nextOccurrence,\n} from \"../cron.js\";\nimport { classifyJobResource } from \"../frontmatter.js\";\nimport { parseJobFrontmatter } from \"../scheduler.js\";\nimport { authorizeJobMutation } from \"../tools.js\";\n\nconst scopeSchema = z.enum([\"personal\", \"organization\"]);\n\nfunction jobName(path: string): string {\n return path.replace(/^jobs\\//, \"\").replace(/\\.md$/, \"\");\n}\n\n/**\n * A stored `nextRun` in the past means the scheduler kept declining to run the\n * job, not that it is due two days ago. Report the real next occurrence and\n * let `lastError` carry the reason it keeps being passed over.\n */\nfunction nextRun(\n meta: ReturnType<typeof parseJobFrontmatter>[\"meta\"],\n): string | null {\n if (!meta.enabled) return null;\n const scheduled = Boolean(meta.schedule && isValidCron(meta.schedule));\n if (meta.nextRun) {\n const stored = new Date(meta.nextRun).getTime();\n if (!Number.isFinite(stored) || stored > Date.now() || !scheduled) {\n return meta.nextRun;\n }\n }\n return scheduled\n ? nextOccurrence(meta.schedule, undefined, meta.timezone).toISOString()\n : null;\n}\n\nexport interface RecurringJobActionItem {\n id: string;\n name: string;\n path: string;\n scope: \"personal\" | \"organization\";\n schedule: string;\n timezone: string;\n scheduleDescription: string;\n instructions: string;\n enabled: boolean;\n lastRun: string | null;\n lastCheck: string | null;\n lastStatus: string | null;\n lastError: string | null;\n nextRun: string | null;\n createdBy: string | null;\n mcpTools: string[];\n canUpdate: boolean;\n}\n\nexport default defineAction({\n description:\n \"List legacy recurring cron jobs visible in the selected personal or organization scope. This compatibility read surface is used by the Agent Automations page.\",\n agentTool: false,\n schema: z.object({\n scope: scopeSchema.default(\"personal\"),\n }),\n http: { method: \"GET\" },\n readOnly: true,\n parallelSafe: true,\n run: async ({ scope }, ctx): Promise<RecurringJobActionItem[]> => {\n const userEmail = ctx?.userEmail;\n if (!userEmail) throw new Error(\"Not authenticated.\");\n\n if (scope === \"organization\" && !ctx?.orgId) return [];\n\n const owner =\n scope === \"organization\"\n ? organizationResourceOwner(ctx.orgId as string)\n : userEmail;\n const resources = await resourceList(owner, \"jobs/\");\n const jobs: RecurringJobActionItem[] = [];\n\n for (const resource of resources) {\n if (!resource.path.endsWith(\".md\") || resource.path.endsWith(\".keep\")) {\n continue;\n }\n const full = await resourceGetByPath(owner, resource.path);\n if (!full || classifyJobResource(full.content).kind === \"automation\") {\n continue;\n }\n\n const { meta, body } = parseJobFrontmatter(full.content);\n const canUpdate =\n scope === \"personal\" || !(await authorizeJobMutation(owner, meta));\n jobs.push({\n id: full.id,\n name: jobName(full.path),\n path: full.path,\n scope,\n schedule: meta.schedule,\n timezone: effectiveTimezone(meta.timezone),\n scheduleDescription: meta.schedule\n ? describeCron(meta.schedule, effectiveTimezone(meta.timezone))\n : \"\",\n instructions: body,\n enabled: meta.enabled,\n lastRun: meta.lastRun ?? null,\n lastCheck: meta.lastCheck ?? null,\n lastStatus: meta.lastStatus ?? null,\n lastError: meta.lastError ?? null,\n nextRun: nextRun(meta),\n createdBy: meta.createdBy ?? null,\n mcpTools: meta.mcpTools ?? [],\n canUpdate,\n });\n }\n\n return jobs;\n },\n});\n"]}
|