@agent-native/core 0.90.10 → 0.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +30 -0
- package/corpus/core/docs/content/toolkit-settings.mdx +56 -3
- package/corpus/core/package.json +2 -1
- package/corpus/core/src/agent/durable-background.ts +5 -5
- package/corpus/core/src/agent/engine/ai-sdk-engine.ts +40 -8
- package/corpus/core/src/agent/engine/anthropic-engine.ts +25 -7
- package/corpus/core/src/agent/engine/output-tokens.ts +94 -0
- package/corpus/core/src/agent/production-agent.ts +34 -6
- package/corpus/core/src/agent/run-ownership.ts +29 -1
- package/corpus/core/src/agent/types.ts +3 -2
- package/corpus/core/src/changelog/parse.ts +78 -0
- package/corpus/core/src/chat-threads/schema.ts +43 -0
- package/corpus/core/src/chat-threads/store.ts +144 -12
- package/corpus/core/src/cli/workspace-dev.ts +25 -5
- package/corpus/core/src/client/AgentPanel.tsx +79 -14
- package/corpus/core/src/client/AssistantChat.tsx +359 -425
- package/corpus/core/src/client/analytics-session.ts +70 -0
- package/corpus/core/src/client/analytics.ts +175 -49
- package/corpus/core/src/client/chat/message-components.tsx +22 -2
- package/corpus/core/src/client/components/ui/message-scroller.tsx +131 -0
- package/corpus/core/src/client/conversation/AgentConversation.tsx +63 -41
- package/corpus/core/src/client/error-capture.ts +616 -0
- package/corpus/core/src/client/index.ts +12 -0
- package/corpus/core/src/client/session-replay.ts +57 -7
- package/corpus/core/src/client/settings/SettingsPanel.tsx +123 -1
- package/corpus/core/src/client/settings/SettingsTabsPage.tsx +292 -45
- package/corpus/core/src/client/settings/index.ts +1 -0
- package/corpus/core/src/client/sharing/ShareButton.tsx +14 -11
- package/corpus/core/src/client/sharing/ShareDialog.tsx +13 -10
- package/corpus/core/src/db/client.ts +12 -9
- package/corpus/core/src/mcp/builtin-tools.ts +29 -2
- package/corpus/core/src/server/agent-chat-plugin.ts +174 -79
- package/corpus/core/src/server/onboarding-html.ts +28 -16
- package/corpus/core/src/shared/reasoning-effort.ts +23 -0
- package/corpus/core/src/sharing/actions/list-resource-shares.ts +45 -1
- package/corpus/core/src/sharing/actions/share-resource.ts +9 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +4 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/changelog/SKILL.md +9 -6
- package/corpus/core/src/vite/client.ts +217 -35
- package/corpus/templates/analytics/.agents/skills/adhoc-analysis/SKILL.md +8 -7
- package/corpus/templates/analytics/.agents/skills/analysis-workspace/SKILL.md +14 -10
- package/corpus/templates/analytics/.agents/skills/bigquery/SKILL.md +15 -15
- package/corpus/templates/analytics/.agents/skills/cross-source-analysis/SKILL.md +1 -0
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +38 -22
- package/corpus/templates/analytics/.agents/skills/data-programs/SKILL.md +114 -61
- package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +1 -0
- package/corpus/templates/analytics/.agents/skills/gong/SKILL.md +7 -7
- package/corpus/templates/analytics/.agents/skills/hubspot/SKILL.md +1 -0
- package/corpus/templates/analytics/.agents/skills/prometheus/SKILL.md +1 -1
- package/corpus/templates/analytics/.builder/skills/bigquery/SKILL.md +17 -17
- package/corpus/templates/analytics/.builder/skills/gcloud/SKILL.md +5 -5
- package/corpus/templates/analytics/.builder/skills/github/SKILL.md +7 -7
- package/corpus/templates/analytics/.builder/skills/gong/SKILL.md +12 -12
- package/corpus/templates/analytics/.builder/skills/grafana/SKILL.md +7 -7
- package/corpus/templates/analytics/.builder/skills/sentry/SKILL.md +7 -7
- package/corpus/templates/analytics/.builder/skills/slack/SKILL.md +6 -6
- package/corpus/templates/analytics/.builder/skills/stripe/SKILL.md +7 -7
- package/corpus/templates/analytics/AGENTS.md +47 -2
- package/corpus/templates/analytics/actions/add-status-page-monitor.ts +36 -0
- package/corpus/templates/analytics/actions/capture-test-error.ts +33 -0
- package/corpus/templates/analytics/actions/delete-monitor.ts +24 -0
- package/corpus/templates/analytics/actions/delete-status-page.ts +23 -0
- package/corpus/templates/analytics/actions/get-error-issue.ts +36 -0
- package/corpus/templates/analytics/actions/get-monitor-stats.ts +55 -0
- package/corpus/templates/analytics/actions/get-monitor.ts +27 -0
- package/corpus/templates/analytics/actions/get-public-status-page.ts +41 -0
- package/corpus/templates/analytics/actions/get-status-page.ts +29 -0
- package/corpus/templates/analytics/actions/list-error-issues.ts +40 -0
- package/corpus/templates/analytics/actions/list-monitors.ts +21 -0
- package/corpus/templates/analytics/actions/list-status-pages.ts +21 -0
- package/corpus/templates/analytics/actions/match-error-issues.ts +51 -0
- package/corpus/templates/analytics/actions/navigate.ts +58 -4
- package/corpus/templates/analytics/actions/remove-status-page-monitor.ts +22 -0
- package/corpus/templates/analytics/actions/reorder-status-page-monitors.ts +25 -0
- package/corpus/templates/analytics/actions/resolve-error-issue.ts +38 -0
- package/corpus/templates/analytics/actions/run-monitor-check.ts +23 -0
- package/corpus/templates/analytics/actions/save-analysis.ts +1 -0
- package/corpus/templates/analytics/actions/save-monitor.ts +145 -0
- package/corpus/templates/analytics/actions/save-status-page.ts +47 -0
- package/corpus/templates/analytics/actions/view-screen.ts +212 -0
- package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +10 -1
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +134 -39
- package/corpus/templates/analytics/app/components/monitoring/PublicStatusView.tsx +351 -0
- package/corpus/templates/analytics/app/components/monitoring/ResponseTimeChart.tsx +174 -0
- package/corpus/templates/analytics/app/components/monitoring/UptimeStatCards.tsx +85 -0
- package/corpus/templates/analytics/app/components/monitoring/UptimeTimelineBars.tsx +106 -0
- package/corpus/templates/analytics/app/components/monitoring/chart-utils.ts +101 -0
- package/corpus/templates/analytics/app/components/monitoring/index.ts +28 -0
- package/corpus/templates/analytics/app/components/monitoring/types.ts +42 -0
- package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +34 -0
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +6 -0
- package/corpus/templates/analytics/app/i18n-data.ts +33 -0
- package/corpus/templates/analytics/app/pages/DataSources.tsx +28 -0
- package/corpus/templates/analytics/app/pages/Settings.tsx +77 -9
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +3 -3
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/dashboard-layout.ts +7 -0
- package/corpus/templates/analytics/app/pages/monitoring/ErrorsPanel.tsx +205 -0
- package/corpus/templates/analytics/app/pages/monitoring/MonitoringPage.tsx +100 -0
- package/corpus/templates/analytics/app/pages/monitoring/UptimePanel.tsx +475 -0
- package/corpus/templates/analytics/app/pages/monitoring/errors/IssueDetail.tsx +372 -0
- package/corpus/templates/analytics/app/pages/monitoring/errors/IssueList.tsx +360 -0
- package/corpus/templates/analytics/app/pages/monitoring/errors/Sparkline.tsx +55 -0
- package/corpus/templates/analytics/app/pages/monitoring/errors/i18n.ts +106 -0
- package/corpus/templates/analytics/app/pages/monitoring/errors/types.ts +75 -0
- package/corpus/templates/analytics/app/pages/monitoring/errors/utils.ts +132 -0
- package/corpus/templates/analytics/app/pages/monitoring/uptime/MonitorDetail.tsx +535 -0
- package/corpus/templates/analytics/app/pages/monitoring/uptime/MonitorFormPage.tsx +1026 -0
- package/corpus/templates/analytics/app/pages/monitoring/uptime/MonitorList.tsx +311 -0
- package/corpus/templates/analytics/app/pages/monitoring/uptime/i18n.ts +235 -0
- package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/StatusPageEditor.tsx +661 -0
- package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/StatusPagesView.tsx +355 -0
- package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/i18n.ts +106 -0
- package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/slug.ts +24 -0
- package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/types.ts +20 -0
- package/corpus/templates/analytics/app/pages/monitoring/uptime/status-summary.ts +87 -0
- package/corpus/templates/analytics/app/pages/monitoring/uptime/types.ts +161 -0
- package/corpus/templates/analytics/app/pages/monitoring/uptime/utils.ts +210 -0
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +76 -1
- package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +74 -9
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +197 -20
- package/corpus/templates/analytics/app/root.tsx +33 -1
- package/corpus/templates/analytics/app/routes/monitoring._index.tsx +10 -0
- package/corpus/templates/analytics/app/routes/status.$slug.tsx +118 -0
- package/corpus/templates/analytics/changelog/2026-07-08-add-uptime-monitors-that-ping-your-urls-and-alert-you-when-t.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-analytics-chats-keep-large-data-dictionaries-compact-so-prov.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-create-public-status-pages-that-share-the-live-health-of-cho.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-dashboard-extension-panels-use-clearer-open-copy.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-error-capture.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-fixed-single-panel-dashboard-drags-so-they-no-longer-rewrite.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-jump-straight-from-an-error-in-a-session-recording-to-its-fu.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-monitor-detail-and-list-now-show-colorful-uptime-timelines-r.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-pinned-ask-chats-now-show-a-pin-icon-in-the-sidebar.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-publish-a-public-uptime-status-page-with-colorful-uptime-tim.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-sessions-now-hide-visitor-emails-in-demo-mode-and-show-clean.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-settings-are-cleaner-searchable-and-alerts-have-their-own-tab.md +5 -0
- package/corpus/templates/analytics/changelog/2026-07-08-sidebar-sections-stay-collapsed-until-opened.md +5 -0
- package/corpus/templates/analytics/changelog/2026-07-08-the-uptime-monitor-list-now-has-a-current-status-overview-wi.md +6 -0
- package/corpus/templates/analytics/docs/error-capture.md +172 -0
- package/corpus/templates/analytics/docs/uptime-monitoring.md +150 -0
- package/corpus/templates/analytics/server/db/schema-errors.ts +150 -0
- package/corpus/templates/analytics/server/db/schema-monitoring.ts +177 -0
- package/corpus/templates/analytics/server/db/schema.ts +6 -0
- package/corpus/templates/analytics/server/jobs/uptime-monitors.ts +123 -0
- package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +41 -0
- package/corpus/templates/analytics/server/lib/data-dictionary-context.ts +55 -12
- package/corpus/templates/analytics/server/lib/error-capture.ts +1331 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +47 -1
- package/corpus/templates/analytics/server/lib/monitor-stats.ts +494 -0
- package/corpus/templates/analytics/server/lib/status-pages.ts +798 -0
- package/corpus/templates/analytics/server/lib/uptime-monitors.ts +1665 -0
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +7 -37
- package/corpus/templates/analytics/server/plugins/auth.ts +11 -1
- package/corpus/templates/analytics/server/plugins/db.ts +408 -0
- package/corpus/templates/analytics/server/plugins/uptime-monitor-jobs.ts +63 -0
- package/corpus/templates/assets/app/routes/_index.tsx +1 -1
- package/corpus/templates/assets/app/routes/settings.tsx +22 -1
- package/corpus/templates/assets/changelog/2026-07-08-recent-drafts-keep-comfortable-side-padding.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
- package/corpus/templates/brain/app/routes/settings.tsx +43 -5
- package/corpus/templates/brain/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
- package/corpus/templates/calendar/app/pages/Settings.tsx +44 -6
- package/corpus/templates/calendar/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
- package/corpus/templates/chat/app/routes/settings.tsx +16 -1
- package/corpus/templates/chat/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
- package/corpus/templates/clips/actions/lib/audio-only-transcription.ts +79 -37
- package/corpus/templates/clips/actions/regenerate-chapters.ts +7 -0
- package/corpus/templates/clips/app/components/player/player-controls.tsx +35 -0
- package/corpus/templates/clips/app/components/player/video-player.tsx +162 -18
- package/corpus/templates/clips/app/hooks/use-auto-title.ts +15 -5
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +63 -6
- package/corpus/templates/clips/app/routes/download.tsx +12 -4
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +1 -0
- package/corpus/templates/clips/app/routes/record.tsx +18 -1
- package/corpus/templates/clips/changelog/2026-07-07-auto-generated-chapter-requests-now-open-the-matching-agent-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-shared-clips-start-playback-reliably-from-the-first-play-click.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-the-clips-desktop-download-page-now-uses-the-agent-native-ap.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-chrome-extension-camera-and-microphone-menus-now-show-which-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-chrome-extension-copies-new-clip-links-after-saving.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-chrome-extension-recordings-now-continue-after-granting-came.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-mobile-shared-clips-now-have-loom-style-tap-and-skip-controls.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-recordings-and-uploads-copy-links-after-saving.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-settings-are-cleaner-searchable-and-collapse-s3-with-builder.md +5 -0
- package/corpus/templates/clips/changelog/2026-07-08-transcripts-are-more-reliable-for-longer-desktop-recordings-.md +6 -0
- package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -0
- package/corpus/templates/clips/chrome-extension/src/background.ts +162 -13
- package/corpus/templates/clips/chrome-extension/src/content-script.ts +14 -0
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +36 -0
- package/corpus/templates/clips/chrome-extension/src/overlay.ts +99 -25
- package/corpus/templates/clips/chrome-extension/src/permission.ts +63 -14
- package/corpus/templates/clips/chrome-extension/src/popup.ts +123 -23
- package/corpus/templates/content/actions/_builder-cms-read-client.ts +47 -0
- package/corpus/templates/content/actions/_database-source-utils.ts +33 -4
- package/corpus/templates/content/actions/add-content-database-source-field-property.ts +214 -29
- package/corpus/templates/content/actions/attach-content-database-source.ts +3 -0
- package/corpus/templates/content/actions/change-content-database-source-role.ts +1 -0
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +42 -32
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +352 -81
- package/corpus/templates/content/app/components/editor/database/settings.tsx +49 -24
- package/corpus/templates/content/app/routes/_app.settings.tsx +19 -1
- package/corpus/templates/content/changelog/2026-07-07-builder-source-tag-fields-now-import-as-multi-select.md +6 -0
- package/corpus/templates/content/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
- package/corpus/templates/content/shared/api.ts +3 -0
- package/corpus/templates/content/shared/properties.ts +42 -0
- package/corpus/templates/design/actions/generate-design.ts +3 -0
- package/corpus/templates/design/actions/get-design-system.ts +147 -1
- package/corpus/templates/design/app/routes/settings.tsx +16 -1
- package/corpus/templates/design/changelog/2026-07-08-design-generation-now-follows-hydrated-builder-design-system.md +6 -0
- package/corpus/templates/design/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
- package/corpus/templates/dispatch/app/routes/settings.tsx +23 -2
- package/corpus/templates/dispatch/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
- package/corpus/templates/forms/app/routes/_app.settings.tsx +16 -1
- package/corpus/templates/forms/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
- package/corpus/templates/macros/app/routes/settings.tsx +16 -1
- package/corpus/templates/macros/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
- package/corpus/templates/mail/app/components/settings/GmailFiltersSection.tsx +1 -1
- package/corpus/templates/mail/app/components/settings/SnippetsSection.tsx +1 -1
- package/corpus/templates/mail/app/pages/SettingsPage.tsx +123 -105
- package/corpus/templates/mail/changelog/2026-07-08-settings-redesigned-with-a-consistent-searchable-layout.md +5 -0
- package/corpus/templates/plan/app/routes/settings.tsx +23 -2
- package/corpus/templates/plan/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
- package/corpus/templates/slides/actions/add-slide.ts +1 -0
- package/corpus/templates/slides/actions/get-design-system.ts +147 -1
- package/corpus/templates/slides/app/pages/Index.tsx +46 -1
- package/corpus/templates/slides/app/routes/settings.tsx +16 -1
- package/corpus/templates/slides/changelog/2026-07-08-deck-generation-now-follows-hydrated-builder-design-system-g.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
- package/dist/agent/durable-background.d.ts +1 -1
- package/dist/agent/durable-background.d.ts.map +1 -1
- package/dist/agent/durable-background.js +5 -3
- package/dist/agent/durable-background.js.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.js +24 -4
- package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
- package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
- package/dist/agent/engine/anthropic-engine.js +13 -3
- package/dist/agent/engine/anthropic-engine.js.map +1 -1
- package/dist/agent/engine/output-tokens.d.ts +27 -0
- package/dist/agent/engine/output-tokens.d.ts.map +1 -1
- package/dist/agent/engine/output-tokens.js +70 -0
- package/dist/agent/engine/output-tokens.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +28 -7
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-ownership.d.ts +6 -0
- package/dist/agent/run-ownership.d.ts.map +1 -1
- package/dist/agent/run-ownership.js +11 -1
- package/dist/agent/run-ownership.js.map +1 -1
- package/dist/agent/types.d.ts +3 -2
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/changelog/parse.d.ts +7 -0
- package/dist/changelog/parse.d.ts.map +1 -1
- package/dist/changelog/parse.js +64 -0
- package/dist/changelog/parse.js.map +1 -1
- package/dist/chat-threads/schema.d.ts +445 -0
- package/dist/chat-threads/schema.d.ts.map +1 -0
- package/dist/chat-threads/schema.js +39 -0
- package/dist/chat-threads/schema.js.map +1 -0
- package/dist/chat-threads/store.d.ts +12 -0
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +99 -10
- package/dist/chat-threads/store.js.map +1 -1
- package/dist/cli/workspace-dev.d.ts.map +1 -1
- package/dist/cli/workspace-dev.js +20 -5
- package/dist/cli/workspace-dev.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +35 -7
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +105 -183
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/analytics-session.d.ts +3 -0
- package/dist/client/analytics-session.d.ts.map +1 -0
- package/dist/client/analytics-session.js +66 -0
- package/dist/client/analytics-session.js.map +1 -0
- package/dist/client/analytics.d.ts +32 -0
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +116 -46
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +2 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +16 -6
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/components/ui/message-scroller.d.ts +16 -0
- package/dist/client/components/ui/message-scroller.d.ts.map +1 -0
- package/dist/client/components/ui/message-scroller.js +25 -0
- package/dist/client/components/ui/message-scroller.js.map +1 -0
- package/dist/client/conversation/AgentConversation.d.ts +1 -1
- package/dist/client/conversation/AgentConversation.d.ts.map +1 -1
- package/dist/client/conversation/AgentConversation.js +3 -8
- package/dist/client/conversation/AgentConversation.js.map +1 -1
- package/dist/client/error-capture.d.ts +99 -0
- package/dist/client/error-capture.d.ts.map +1 -0
- package/dist/client/error-capture.js +437 -0
- package/dist/client/error-capture.js.map +1 -0
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/session-replay.d.ts +22 -0
- package/dist/client/session-replay.d.ts.map +1 -1
- package/dist/client/session-replay.js +45 -4
- package/dist/client/session-replay.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +100 -5
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/SettingsTabsPage.d.ts +49 -1
- package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
- package/dist/client/settings/SettingsTabsPage.js +131 -19
- package/dist/client/settings/SettingsTabsPage.js.map +1 -1
- package/dist/client/settings/index.d.ts +1 -1
- package/dist/client/settings/index.d.ts.map +1 -1
- package/dist/client/settings/index.js.map +1 -1
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +13 -8
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/client/sharing/ShareDialog.d.ts.map +1 -1
- package/dist/client/sharing/ShareDialog.js +12 -7
- package/dist/client/sharing/ShareDialog.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +12 -7
- package/dist/db/client.js.map +1 -1
- package/dist/mcp/builtin-tools.d.ts.map +1 -1
- package/dist/mcp/builtin-tools.js +21 -2
- package/dist/mcp/builtin-tools.js.map +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +5 -5
- package/dist/org/schema.d.ts +15 -15
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +3 -3
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +109 -73
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +28 -16
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/shared/reasoning-effort.d.ts +1 -0
- package/dist/shared/reasoning-effort.d.ts.map +1 -1
- package/dist/shared/reasoning-effort.js +18 -0
- package/dist/shared/reasoning-effort.js.map +1 -1
- package/dist/sharing/actions/list-resource-shares.js +30 -1
- package/dist/sharing/actions/list-resource-shares.js.map +1 -1
- package/dist/sharing/actions/share-resource.js +6 -0
- package/dist/sharing/actions/share-resource.js.map +1 -1
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +4 -2
- package/dist/templates/workspace-core/.agents/skills/changelog/SKILL.md +9 -6
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +192 -30
- package/dist/vite/client.js.map +1 -1
- package/docs/content/toolkit-settings.mdx +56 -3
- package/package.json +2 -1
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +4 -2
- package/src/templates/workspace-core/.agents/skills/changelog/SKILL.md +9 -6
|
@@ -22,6 +22,13 @@ type InputDevice = {
|
|
|
22
22
|
label: string;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
type InputDevices = {
|
|
26
|
+
cameras: InputDevice[];
|
|
27
|
+
microphones: InputDevice[];
|
|
28
|
+
defaultCameraName: string;
|
|
29
|
+
defaultMicrophoneName: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
25
32
|
type PopupStartResponse = {
|
|
26
33
|
ok?: boolean;
|
|
27
34
|
error?: string;
|
|
@@ -59,6 +66,11 @@ type PopupStatusResponse = {
|
|
|
59
66
|
|
|
60
67
|
type AuthStatus = "checking" | "signed-in" | "signed-out";
|
|
61
68
|
|
|
69
|
+
type CachedMediaPermission = {
|
|
70
|
+
camera?: boolean;
|
|
71
|
+
microphone?: boolean;
|
|
72
|
+
};
|
|
73
|
+
|
|
62
74
|
type StoredAuth = {
|
|
63
75
|
token: string;
|
|
64
76
|
email?: string;
|
|
@@ -205,35 +217,66 @@ function isVirtualDefaultDevice(device: MediaDeviceInfo): boolean {
|
|
|
205
217
|
return VIRTUAL_DEVICE_ID_RE.test(device.deviceId);
|
|
206
218
|
}
|
|
207
219
|
|
|
220
|
+
function isSystemDefaultDevice(device: MediaDeviceInfo): boolean {
|
|
221
|
+
return /^default$/i.test(device.deviceId);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function normalizeDefaultDeviceName(label: string): string {
|
|
225
|
+
const value = label.trim();
|
|
226
|
+
const parenthesized = value.match(/^default\s*\((.+)\)$/i);
|
|
227
|
+
const normalized = (parenthesized?.[1] ?? value)
|
|
228
|
+
.replace(/^default\s*[-–—:]\s*/i, "")
|
|
229
|
+
.replace(/\s*\((?:default|communications)\)\s*$/i, "")
|
|
230
|
+
.trim();
|
|
231
|
+
return /^(?:default|communications)$/i.test(normalized) ? "" : normalized;
|
|
232
|
+
}
|
|
233
|
+
|
|
208
234
|
// Enumerate the user's input devices for the camera/mic pickers. Labels only
|
|
209
235
|
// populate after camera/mic permission is granted (the extension's permission
|
|
210
236
|
// onboarding page handles that), so fall back to a generic label otherwise.
|
|
211
|
-
async function enumerateInputDevices(): Promise<{
|
|
212
|
-
cameras: InputDevice[];
|
|
213
|
-
microphones: InputDevice[];
|
|
214
|
-
}> {
|
|
237
|
+
async function enumerateInputDevices(): Promise<InputDevices> {
|
|
215
238
|
try {
|
|
216
239
|
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
217
240
|
const cameras: InputDevice[] = [];
|
|
218
241
|
const microphones: InputDevice[] = [];
|
|
242
|
+
let defaultCameraName = "";
|
|
243
|
+
let defaultMicrophoneName = "";
|
|
219
244
|
for (const device of devices) {
|
|
220
245
|
if (!device.deviceId) continue;
|
|
221
|
-
|
|
246
|
+
const label = device.label.trim();
|
|
247
|
+
if (isVirtualDefaultDevice(device)) {
|
|
248
|
+
if (isSystemDefaultDevice(device)) {
|
|
249
|
+
const defaultName = normalizeDefaultDeviceName(label);
|
|
250
|
+
if (device.kind === "videoinput") defaultCameraName ||= defaultName;
|
|
251
|
+
if (device.kind === "audioinput") {
|
|
252
|
+
defaultMicrophoneName ||= defaultName;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
222
257
|
if (device.kind === "videoinput") {
|
|
258
|
+
defaultCameraName ||= label;
|
|
223
259
|
cameras.push({
|
|
224
260
|
deviceId: device.deviceId,
|
|
225
|
-
label:
|
|
261
|
+
label: label || `Camera ${cameras.length + 1}`,
|
|
226
262
|
});
|
|
227
|
-
} else if (
|
|
263
|
+
} else if (device.kind === "audioinput") {
|
|
264
|
+
defaultMicrophoneName ||= label;
|
|
265
|
+
if (!isSelectableAudioInputDevice(device)) continue;
|
|
228
266
|
microphones.push({
|
|
229
267
|
deviceId: device.deviceId,
|
|
230
|
-
label:
|
|
268
|
+
label: label || `Microphone ${microphones.length + 1}`,
|
|
231
269
|
});
|
|
232
270
|
}
|
|
233
271
|
}
|
|
234
|
-
return { cameras, microphones };
|
|
272
|
+
return { cameras, microphones, defaultCameraName, defaultMicrophoneName };
|
|
235
273
|
} catch {
|
|
236
|
-
return {
|
|
274
|
+
return {
|
|
275
|
+
cameras: [],
|
|
276
|
+
microphones: [],
|
|
277
|
+
defaultCameraName: "",
|
|
278
|
+
defaultMicrophoneName: "",
|
|
279
|
+
};
|
|
237
280
|
}
|
|
238
281
|
}
|
|
239
282
|
|
|
@@ -368,20 +411,41 @@ function createTab(url: string): Promise<void> {
|
|
|
368
411
|
});
|
|
369
412
|
}
|
|
370
413
|
|
|
371
|
-
|
|
414
|
+
function permissionPageUrl(settings: ExtensionSettings): string {
|
|
415
|
+
const url = new URL(chrome.runtime.getURL("src/permission.html"));
|
|
416
|
+
url.searchParams.set("startAfterGrant", "1");
|
|
417
|
+
url.searchParams.set(
|
|
418
|
+
"needsCamera",
|
|
419
|
+
String(settings.captureSurface === "camera" || settings.includeCamera),
|
|
420
|
+
);
|
|
421
|
+
url.searchParams.set("needsMicrophone", String(settings.includeMicrophone));
|
|
422
|
+
return url.toString();
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
async function mediaPermissionState(
|
|
372
426
|
name: "camera" | "microphone",
|
|
373
|
-
): Promise<
|
|
427
|
+
): Promise<PermissionState | "unknown"> {
|
|
374
428
|
try {
|
|
375
429
|
const status = await navigator.permissions.query({
|
|
376
430
|
name: name as PermissionName,
|
|
377
431
|
});
|
|
378
|
-
return status.state
|
|
432
|
+
return status.state;
|
|
379
433
|
} catch {
|
|
380
|
-
|
|
381
|
-
return true;
|
|
434
|
+
return "unknown";
|
|
382
435
|
}
|
|
383
436
|
}
|
|
384
437
|
|
|
438
|
+
function readCachedMediaPermission(): Promise<CachedMediaPermission> {
|
|
439
|
+
return new Promise((resolve) => {
|
|
440
|
+
chrome.storage.local.get("clipsMediaPermission", (value) => {
|
|
441
|
+
const cached = value.clipsMediaPermission as
|
|
442
|
+
| CachedMediaPermission
|
|
443
|
+
| undefined;
|
|
444
|
+
resolve(cached && typeof cached === "object" ? cached : {});
|
|
445
|
+
});
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
|
|
385
449
|
// True when every device the chosen mode needs is already granted to the
|
|
386
450
|
// extension. If not, the caller routes the user to the permission page.
|
|
387
451
|
async function ensureMediaPermission(
|
|
@@ -390,8 +454,17 @@ async function ensureMediaPermission(
|
|
|
390
454
|
const needsCamera =
|
|
391
455
|
settings.captureSurface === "camera" || settings.includeCamera;
|
|
392
456
|
const needsMic = settings.includeMicrophone;
|
|
393
|
-
|
|
394
|
-
if (
|
|
457
|
+
const cached = await readCachedMediaPermission();
|
|
458
|
+
if (needsCamera) {
|
|
459
|
+
const state = await mediaPermissionState("camera");
|
|
460
|
+
if (state === "denied") return false;
|
|
461
|
+
if (state !== "granted" && cached.camera !== true) return false;
|
|
462
|
+
}
|
|
463
|
+
if (needsMic) {
|
|
464
|
+
const state = await mediaPermissionState("microphone");
|
|
465
|
+
if (state === "denied") return false;
|
|
466
|
+
if (state !== "granted" && cached.microphone !== true) return false;
|
|
467
|
+
}
|
|
395
468
|
return true;
|
|
396
469
|
}
|
|
397
470
|
|
|
@@ -574,9 +647,11 @@ function renderSource(settings: ExtensionSettings): void {
|
|
|
574
647
|
|
|
575
648
|
// Holds the most recent device enumeration so the menus and labels can render
|
|
576
649
|
// without re-querying on every paint. Refreshed by refreshDevices().
|
|
577
|
-
let inputDevices:
|
|
650
|
+
let inputDevices: InputDevices = {
|
|
578
651
|
cameras: [],
|
|
579
652
|
microphones: [],
|
|
653
|
+
defaultCameraName: "",
|
|
654
|
+
defaultMicrophoneName: "",
|
|
580
655
|
};
|
|
581
656
|
|
|
582
657
|
// Distinguishes "the user explicitly picked the OS default" from "the id we
|
|
@@ -594,6 +669,10 @@ function deviceLabel(
|
|
|
594
669
|
return match ? match.label : `${fallback} (device disconnected)`;
|
|
595
670
|
}
|
|
596
671
|
|
|
672
|
+
function defaultDeviceLabel(fallback: string, deviceName: string): string {
|
|
673
|
+
return deviceName ? `${fallback} (${deviceName})` : fallback;
|
|
674
|
+
}
|
|
675
|
+
|
|
597
676
|
function renderDeviceMenu(
|
|
598
677
|
menu: HTMLDivElement,
|
|
599
678
|
devices: InputDevice[],
|
|
@@ -640,16 +719,20 @@ function renderDevicePickers(settings: ExtensionSettings): void {
|
|
|
640
719
|
settings.captureSurface === "camera" || settings.includeCamera;
|
|
641
720
|
cameraButton.hidden = !showCamera;
|
|
642
721
|
if (showCamera) {
|
|
722
|
+
const defaultCameraLabel = defaultDeviceLabel(
|
|
723
|
+
"System default",
|
|
724
|
+
inputDevices.defaultCameraName,
|
|
725
|
+
);
|
|
643
726
|
cameraLabel.textContent = deviceLabel(
|
|
644
727
|
inputDevices.cameras,
|
|
645
728
|
settings.videoDeviceId,
|
|
646
|
-
|
|
729
|
+
defaultCameraLabel,
|
|
647
730
|
);
|
|
648
731
|
renderDeviceMenu(
|
|
649
732
|
cameraMenu,
|
|
650
733
|
inputDevices.cameras,
|
|
651
734
|
settings.videoDeviceId,
|
|
652
|
-
|
|
735
|
+
defaultCameraLabel,
|
|
653
736
|
);
|
|
654
737
|
} else {
|
|
655
738
|
cameraMenu.hidden = true;
|
|
@@ -661,16 +744,20 @@ function renderDevicePickers(settings: ExtensionSettings): void {
|
|
|
661
744
|
const micMenu = byId<HTMLDivElement>("microphone-device-menu");
|
|
662
745
|
micButton.hidden = !settings.includeMicrophone;
|
|
663
746
|
if (settings.includeMicrophone) {
|
|
747
|
+
const defaultMicrophoneLabel = defaultDeviceLabel(
|
|
748
|
+
"System default",
|
|
749
|
+
inputDevices.defaultMicrophoneName,
|
|
750
|
+
);
|
|
664
751
|
micLabel.textContent = deviceLabel(
|
|
665
752
|
inputDevices.microphones,
|
|
666
753
|
settings.audioDeviceId,
|
|
667
|
-
|
|
754
|
+
defaultMicrophoneLabel,
|
|
668
755
|
);
|
|
669
756
|
renderDeviceMenu(
|
|
670
757
|
micMenu,
|
|
671
758
|
inputDevices.microphones,
|
|
672
759
|
settings.audioDeviceId,
|
|
673
|
-
|
|
760
|
+
defaultMicrophoneLabel,
|
|
674
761
|
);
|
|
675
762
|
} else {
|
|
676
763
|
micMenu.hidden = true;
|
|
@@ -1187,9 +1274,22 @@ async function init(): Promise<void> {
|
|
|
1187
1274
|
// there (a real extension page) is the only place Chrome reliably shows the
|
|
1188
1275
|
// permission dialog and persists the grant for the offscreen recorder + bubble.
|
|
1189
1276
|
if (!(await ensureMediaPermission(settings))) {
|
|
1277
|
+
const prepare = await sendRuntimeMessage<PopupStartResponse>({
|
|
1278
|
+
type: "CLIPS_POPUP_PREPARE_PERMISSION_START",
|
|
1279
|
+
settings,
|
|
1280
|
+
targetTabId: activeTab?.id,
|
|
1281
|
+
});
|
|
1282
|
+
if (!prepare.ok) {
|
|
1283
|
+
start.disabled = false;
|
|
1284
|
+
setStatus(
|
|
1285
|
+
prepare.error || "Could not prepare the recording tab.",
|
|
1286
|
+
"error",
|
|
1287
|
+
);
|
|
1288
|
+
return;
|
|
1289
|
+
}
|
|
1190
1290
|
start.disabled = false;
|
|
1191
1291
|
setStatus("Allow camera & microphone, then start recording.", "error");
|
|
1192
|
-
await createTab(
|
|
1292
|
+
await createTab(permissionPageUrl(settings));
|
|
1193
1293
|
window.close();
|
|
1194
1294
|
return;
|
|
1195
1295
|
}
|
|
@@ -321,12 +321,35 @@ function normalizeBuilderCmsModel(
|
|
|
321
321
|
const fieldName =
|
|
322
322
|
typeof fieldRecord.name === "string" ? fieldRecord.name.trim() : "";
|
|
323
323
|
if (!fieldName) return null;
|
|
324
|
+
const inputType =
|
|
325
|
+
typeof fieldRecord.inputType === "string" &&
|
|
326
|
+
fieldRecord.inputType.trim()
|
|
327
|
+
? fieldRecord.inputType.trim()
|
|
328
|
+
: typeof fieldRecord.input === "string" &&
|
|
329
|
+
fieldRecord.input.trim()
|
|
330
|
+
? fieldRecord.input.trim()
|
|
331
|
+
: undefined;
|
|
332
|
+
const label =
|
|
333
|
+
typeof fieldRecord.label === "string" && fieldRecord.label.trim()
|
|
334
|
+
? fieldRecord.label.trim()
|
|
335
|
+
: typeof fieldRecord.friendlyName === "string" &&
|
|
336
|
+
fieldRecord.friendlyName.trim()
|
|
337
|
+
? fieldRecord.friendlyName.trim()
|
|
338
|
+
: undefined;
|
|
339
|
+
const enumOptions = stringOptionsFromUnknown(fieldRecord.enum);
|
|
340
|
+
const options = stringOptionsFromUnknown(
|
|
341
|
+
fieldRecord.options ?? fieldRecord.allowedValues,
|
|
342
|
+
);
|
|
324
343
|
return {
|
|
325
344
|
name: fieldName,
|
|
345
|
+
...(label ? { label } : {}),
|
|
326
346
|
type:
|
|
327
347
|
typeof fieldRecord.type === "string" && fieldRecord.type.trim()
|
|
328
348
|
? fieldRecord.type.trim()
|
|
329
349
|
: "unknown",
|
|
350
|
+
...(inputType ? { inputType } : {}),
|
|
351
|
+
...(enumOptions ? { enum: enumOptions } : {}),
|
|
352
|
+
...(options ? { options } : {}),
|
|
330
353
|
required: fieldRecord.required === true,
|
|
331
354
|
};
|
|
332
355
|
})
|
|
@@ -338,6 +361,30 @@ function normalizeBuilderCmsModel(
|
|
|
338
361
|
return { id, name, displayName, kind, fields };
|
|
339
362
|
}
|
|
340
363
|
|
|
364
|
+
function stringOptionsFromUnknown(value: unknown): string[] | undefined {
|
|
365
|
+
if (!Array.isArray(value)) return undefined;
|
|
366
|
+
const options = value
|
|
367
|
+
.map((option) => {
|
|
368
|
+
if (typeof option === "string" || typeof option === "number") {
|
|
369
|
+
return String(option).trim();
|
|
370
|
+
}
|
|
371
|
+
if (!option || typeof option !== "object") return "";
|
|
372
|
+
const record = option as Record<string, unknown>;
|
|
373
|
+
for (const key of ["label", "name", "value"]) {
|
|
374
|
+
const candidate = record[key];
|
|
375
|
+
if (typeof candidate === "string" && candidate.trim()) {
|
|
376
|
+
return candidate.trim();
|
|
377
|
+
}
|
|
378
|
+
if (typeof candidate === "number" && Number.isFinite(candidate)) {
|
|
379
|
+
return String(candidate);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return "";
|
|
383
|
+
})
|
|
384
|
+
.filter(Boolean);
|
|
385
|
+
return options.length > 0 ? Array.from(new Set(options)) : undefined;
|
|
386
|
+
}
|
|
387
|
+
|
|
341
388
|
function builderMcpModelsFromToolResponse(
|
|
342
389
|
response: unknown,
|
|
343
390
|
): BuilderCmsModelSummary[] {
|
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
} from "../shared/builder-mdx.js";
|
|
44
44
|
import {
|
|
45
45
|
normalizePropertyValue,
|
|
46
|
+
normalizePropertyValueWithOptions,
|
|
46
47
|
parsePropertyOptions,
|
|
47
48
|
serializePropertyOptions,
|
|
48
49
|
serializePropertyValue,
|
|
@@ -131,6 +132,7 @@ type SourceMetadataRecord = {
|
|
|
131
132
|
allowPublishWrites?: boolean;
|
|
132
133
|
allowedWriteModes?: ContentDatabaseSourcePushMode[];
|
|
133
134
|
federation?: ContentDatabaseSourceFederation;
|
|
135
|
+
builderModelFields?: BuilderCmsModelFieldSummary[];
|
|
134
136
|
};
|
|
135
137
|
|
|
136
138
|
function parseObject<T extends object>(
|
|
@@ -1983,8 +1985,8 @@ export async function getContentDatabaseSourceSnapshotForWrite(
|
|
|
1983
1985
|
database: ContentDatabaseRow | ContentDatabase,
|
|
1984
1986
|
sourceId?: string | null,
|
|
1985
1987
|
): Promise<ContentDatabaseSource | null> {
|
|
1988
|
+
const db = getDb();
|
|
1986
1989
|
if (sourceId) {
|
|
1987
|
-
const db = getDb();
|
|
1988
1990
|
const [source] = await db
|
|
1989
1991
|
.select()
|
|
1990
1992
|
.from(schema.contentDatabaseSources)
|
|
@@ -2000,7 +2002,6 @@ export async function getContentDatabaseSourceSnapshotForWrite(
|
|
|
2000
2002
|
})
|
|
2001
2003
|
: null;
|
|
2002
2004
|
}
|
|
2003
|
-
const db = getDb();
|
|
2004
2005
|
const [source] = await db
|
|
2005
2006
|
.select()
|
|
2006
2007
|
.from(schema.contentDatabaseSources)
|
|
@@ -2647,10 +2648,19 @@ export function normalizeSourceFederation(
|
|
|
2647
2648
|
export function serializeSourceMetadataRecord(args: {
|
|
2648
2649
|
sourceType: ContentDatabaseSourceType;
|
|
2649
2650
|
sourceTable: string;
|
|
2651
|
+
builderModelFields?: BuilderCmsModelFieldSummary[];
|
|
2652
|
+
existingMetadataJson?: string | null;
|
|
2650
2653
|
}) {
|
|
2651
2654
|
const isBuilder = args.sourceType === "builder-cms";
|
|
2652
2655
|
if (isBuilder) {
|
|
2653
|
-
|
|
2656
|
+
const existingMetadata = parseObject<SourceMetadataRecord>(
|
|
2657
|
+
args.existingMetadataJson,
|
|
2658
|
+
);
|
|
2659
|
+
return JSON.stringify({
|
|
2660
|
+
...builderCmsSourceMetadata(args.sourceTable),
|
|
2661
|
+
builderModelFields:
|
|
2662
|
+
args.builderModelFields ?? existingMetadata?.builderModelFields,
|
|
2663
|
+
});
|
|
2654
2664
|
}
|
|
2655
2665
|
return JSON.stringify({
|
|
2656
2666
|
primaryKey: "id",
|
|
@@ -2672,9 +2682,16 @@ export function serializeBuilderCmsSourceReadMetadataRecord(args: {
|
|
|
2672
2682
|
progress?: BuilderCmsReadProgress;
|
|
2673
2683
|
sourceFetchState?: "idle" | "fetching" | "error";
|
|
2674
2684
|
activeReadSourceRowIds?: string[];
|
|
2685
|
+
builderModelFields?: BuilderCmsModelFieldSummary[];
|
|
2686
|
+
existingMetadataJson?: string | null;
|
|
2675
2687
|
}) {
|
|
2688
|
+
const existingMetadata = parseObject<SourceMetadataRecord>(
|
|
2689
|
+
args.existingMetadataJson,
|
|
2690
|
+
);
|
|
2676
2691
|
return JSON.stringify({
|
|
2677
2692
|
...builderCmsSourceMetadata(args.sourceTable),
|
|
2693
|
+
builderModelFields:
|
|
2694
|
+
args.builderModelFields ?? existingMetadata?.builderModelFields,
|
|
2678
2695
|
readMode: args.readState === "live" ? "builder-api" : "fixture",
|
|
2679
2696
|
liveReadConfigured: args.readState === "live",
|
|
2680
2697
|
lastReadEntryCount: args.entryCount,
|
|
@@ -3196,9 +3213,10 @@ async function materializeSourceFieldPropertyValues(args: {
|
|
|
3196
3213
|
const propertyId = field.propertyId!;
|
|
3197
3214
|
const definition = definitionById.get(propertyId);
|
|
3198
3215
|
if (!definition) continue;
|
|
3199
|
-
const normalized =
|
|
3216
|
+
const normalized = normalizePropertyValueWithOptions(
|
|
3200
3217
|
definition.type as DocumentProperty["definition"]["type"],
|
|
3201
3218
|
sourceValues[field.sourceFieldKey],
|
|
3219
|
+
parsePropertyOptions(definition.optionsJson),
|
|
3202
3220
|
);
|
|
3203
3221
|
if (normalized === null) continue;
|
|
3204
3222
|
const valueJson = serializePropertyValue(normalized);
|
|
@@ -3466,6 +3484,7 @@ export async function resyncMockSourceSnapshot(args: {
|
|
|
3466
3484
|
metadataJson: serializeSourceMetadataRecord({
|
|
3467
3485
|
sourceType: normalizeSourceType(args.source.sourceType),
|
|
3468
3486
|
sourceTable: args.source.sourceTable,
|
|
3487
|
+
existingMetadataJson: args.source.metadataJson,
|
|
3469
3488
|
}),
|
|
3470
3489
|
lastRefreshedAt: args.now,
|
|
3471
3490
|
lastSourceUpdatedAt: args.now,
|
|
@@ -3871,6 +3890,7 @@ export async function resyncBuilderCmsSourceSnapshot(args: {
|
|
|
3871
3890
|
fetchedAt: builderRead.fetchedAt,
|
|
3872
3891
|
now: args.now,
|
|
3873
3892
|
message: builderRead.message,
|
|
3893
|
+
builderModelFields,
|
|
3874
3894
|
progress: {
|
|
3875
3895
|
...builderRead.progress,
|
|
3876
3896
|
partial: hasMore,
|
|
@@ -3981,6 +4001,7 @@ export async function resyncBuilderCmsSourceSnapshot(args: {
|
|
|
3981
4001
|
fetchedAt: builderRead.fetchedAt,
|
|
3982
4002
|
now: args.now,
|
|
3983
4003
|
message: builderRead.message,
|
|
4004
|
+
builderModelFields,
|
|
3984
4005
|
progress: builderRead.progress,
|
|
3985
4006
|
sourceFetchState: builderRead.state === "error" ? "error" : "idle",
|
|
3986
4007
|
activeReadSourceRowIds: undefined,
|
|
@@ -4082,6 +4103,11 @@ export async function replaceSourceMetadata(args: {
|
|
|
4082
4103
|
metadataJson: serializeSourceMetadataRecord({
|
|
4083
4104
|
sourceType: args.sourceType,
|
|
4084
4105
|
sourceTable: args.sourceTable,
|
|
4106
|
+
existingMetadataJson:
|
|
4107
|
+
args.source.sourceType === args.sourceType &&
|
|
4108
|
+
args.source.sourceTable === args.sourceTable
|
|
4109
|
+
? args.source.metadataJson
|
|
4110
|
+
: null,
|
|
4085
4111
|
}),
|
|
4086
4112
|
lastRefreshedAt: args.now,
|
|
4087
4113
|
lastSourceUpdatedAt: args.now,
|
|
@@ -4313,6 +4339,7 @@ export async function updateBuilderCmsSourceReadMetadata(args: {
|
|
|
4313
4339
|
sourceFetchState?: "idle" | "fetching" | "error";
|
|
4314
4340
|
activeReadSourceRowIds?: string[];
|
|
4315
4341
|
syncState?: ContentDatabaseSourceSyncState;
|
|
4342
|
+
builderModelFields?: BuilderCmsModelFieldSummary[];
|
|
4316
4343
|
}) {
|
|
4317
4344
|
const db = getDb();
|
|
4318
4345
|
const [currentSource] = await db
|
|
@@ -4336,6 +4363,8 @@ export async function updateBuilderCmsSourceReadMetadata(args: {
|
|
|
4336
4363
|
progress: args.progress,
|
|
4337
4364
|
sourceFetchState: args.sourceFetchState,
|
|
4338
4365
|
activeReadSourceRowIds: args.activeReadSourceRowIds,
|
|
4366
|
+
builderModelFields: args.builderModelFields,
|
|
4367
|
+
existingMetadataJson: currentSource?.metadataJson,
|
|
4339
4368
|
}),
|
|
4340
4369
|
});
|
|
4341
4370
|
await db
|