@agent-native/core 0.121.2 → 0.122.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/README.md +4 -12
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +148 -0
- package/corpus/core/docs/content/actions.mdx +2 -2
- package/corpus/core/docs/content/agent-surfaces.mdx +1 -1
- package/corpus/core/docs/content/authentication.mdx +2 -0
- package/corpus/core/docs/content/deployment.mdx +36 -0
- package/corpus/core/docs/content/http-api.mdx +266 -0
- package/corpus/core/docs/content/syncing-template-changes.mdx +159 -0
- package/corpus/core/package.json +2 -1
- package/corpus/core/src/a2a/activity.ts +38 -27
- package/corpus/core/src/a2a/client.ts +57 -4
- package/corpus/core/src/agent/engine/builder-engine.ts +35 -4
- package/corpus/core/src/agent/run-manager.ts +20 -1
- package/corpus/core/src/agent/run-store.ts +4 -1
- package/corpus/core/src/agent/types.ts +28 -8
- package/corpus/core/src/chat-threads/store.ts +45 -0
- package/corpus/core/src/checkpoints/index.ts +2 -0
- package/corpus/core/src/checkpoints/route-match.ts +13 -0
- package/corpus/core/src/cli/create.ts +105 -17
- package/corpus/core/src/cli/index.ts +20 -0
- package/corpus/core/src/cli/template-baseline.ts +410 -0
- package/corpus/core/src/cli/template-sync.ts +1004 -0
- package/corpus/core/src/cli/templates-meta.ts +1 -0
- package/corpus/core/src/client/AssistantChat.tsx +38 -12
- package/corpus/core/src/client/NewWorkspaceAppFlow.tsx +75 -10
- package/corpus/core/src/client/chat/message-components.tsx +127 -66
- package/corpus/core/src/client/chat/tool-call-display.tsx +29 -5
- package/corpus/core/src/client/error-format.ts +18 -0
- package/corpus/core/src/client/org/OrgSwitcher.tsx +30 -8
- package/corpus/core/src/client/org/TeamPage.tsx +7 -6
- package/corpus/core/src/client/settings/SettingsPanel.tsx +9 -9
- package/corpus/core/src/client/settings/SettingsTabsPage.tsx +12 -2
- package/corpus/core/src/client/sse-event-processor.ts +3 -0
- package/corpus/core/src/data-widgets/index.ts +41 -0
- package/corpus/core/src/deploy/build.ts +11 -9
- package/corpus/core/src/extensions/url-safety.ts +67 -4
- package/corpus/core/src/integrations/webhook-handler.ts +63 -9
- package/corpus/core/src/org/auto-join-domain.ts +4 -3
- package/corpus/core/src/org/context.ts +108 -39
- package/corpus/core/src/org/index.ts +5 -0
- package/corpus/core/src/org/service-identity.ts +60 -0
- package/corpus/core/src/provider-api/index.ts +22 -1
- package/corpus/core/src/scripts/docs/search.ts +12 -1
- package/corpus/core/src/server/agent-chat/context-tools.ts +9 -4
- package/corpus/core/src/server/agent-chat/framework-prompts.ts +38 -66
- package/corpus/core/src/server/agent-chat-plugin.ts +17 -10
- package/corpus/core/src/server/agents-bundle.ts +84 -5
- package/corpus/core/src/server/auth.ts +4 -3
- package/corpus/core/src/server/builder-browser.ts +47 -19
- package/corpus/core/src/server/core-routes-plugin.ts +2 -2
- package/corpus/core/src/server/credential-provider.ts +209 -68
- package/corpus/core/src/server/index.ts +3 -0
- package/corpus/core/src/server/prompts/framework-core-compact.ts +6 -13
- package/corpus/core/src/server/prompts/framework-core.ts +9 -21
- package/corpus/core/src/server/prompts/index.ts +0 -1
- package/corpus/core/src/server/prompts/shared-rules.ts +19 -11
- package/corpus/core/src/server/ssr-handler.ts +13 -2
- package/corpus/core/src/settings/user-settings.ts +13 -1
- package/corpus/core/src/shared/cache-control.ts +141 -0
- package/corpus/core/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/core/src/templates/chat/_gitignore +1 -0
- package/corpus/core/src/templates/chat/app/components/layout/Sidebar.tsx +0 -7
- package/corpus/core/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/core/src/templates/default/app/root.tsx +1 -1
- package/corpus/core/src/templates/default/public/manifest.json +2 -2
- package/corpus/core/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
- package/corpus/core/src/vite/agents-bundle-plugin.ts +7 -6
- package/corpus/core/src/vite/client.ts +69 -3
- package/corpus/templates/analytics/.agents/skills/adhoc-analysis/SKILL.md +4 -5
- package/corpus/templates/analytics/.agents/skills/admin-surfaces/SKILL.md +55 -0
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +10 -0
- package/corpus/templates/analytics/.agents/skills/dashboard-management/references/template-catalog-and-demo.md +62 -0
- package/corpus/templates/analytics/.agents/skills/dashboard-ops/SKILL.md +85 -0
- package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +27 -2
- package/corpus/templates/analytics/.agents/skills/data-querying/references/inline-chart-embeds.md +139 -0
- package/corpus/templates/analytics/.agents/skills/monitoring/SKILL.md +77 -0
- package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/analytics/AGENTS.md +91 -563
- package/corpus/templates/analytics/_gitignore +1 -0
- package/corpus/templates/analytics/actions/bigquery.ts +12 -4
- package/corpus/templates/analytics/actions/generate-chart.ts +5 -5
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +30 -1
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +1 -23
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +3 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +1 -0
- package/corpus/templates/analytics/app/routes/_index.tsx +1 -1
- package/corpus/templates/analytics/changelog/2026-07-24-analytics-finds-saved-dashboards-and-queries-far-more-reliab.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-notion-access-errors-now-explain-that-a-page-needs-sharing-w.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/analytics/package.json +1 -1
- package/corpus/templates/analytics/public/manifest.json +1 -1
- package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +7 -0
- package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +191 -30
- package/corpus/templates/analytics/server/lib/bigquery.ts +11 -1
- package/corpus/templates/analytics/server/lib/notion.ts +15 -4
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +10 -0
- package/corpus/templates/analytics/server/plugins/auth.ts +1 -1
- package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +0 -2
- package/corpus/templates/assets/app/routes/_index.tsx +1 -1
- package/corpus/templates/assets/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/assets/server/plugins/auth.ts +1 -1
- package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/brain/_gitignore +1 -0
- package/corpus/templates/brain/app/lib/brain.ts +0 -7
- package/corpus/templates/brain/app/routes/_index.tsx +1 -2
- package/corpus/templates/brain/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/brain/package.json +1 -1
- package/corpus/templates/brain/public/manifest.json +1 -1
- package/corpus/templates/brain/server/plugins/auth.ts +1 -1
- package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/calendar/_gitignore +1 -0
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +0 -6
- package/corpus/templates/calendar/app/routes/_app._index.tsx +1 -1
- package/corpus/templates/calendar/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/calendar/package.json +1 -1
- package/corpus/templates/calendar/public/manifest.json +1 -1
- package/corpus/templates/calendar/server/plugins/auth.ts +1 -1
- package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/chat/_gitignore +1 -0
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +0 -7
- package/corpus/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/clips/.agents/skills/video-sharing/SKILL.md +34 -0
- package/corpus/templates/clips/AGENTS.md +5 -4
- package/corpus/templates/clips/_gitignore +1 -0
- package/corpus/templates/clips/actions/cleanup-transcript.ts +5 -0
- package/corpus/templates/clips/actions/get-recording-insights.ts +44 -8
- package/corpus/templates/clips/actions/get-recording-player-data.ts +39 -70
- package/corpus/templates/clips/actions/import-loom-recording.ts +53 -98
- package/corpus/templates/clips/actions/lib/loom-import-job.ts +260 -0
- package/corpus/templates/clips/actions/list-clip-views.ts +2 -4
- package/corpus/templates/clips/actions/list-recordings.ts +69 -19
- package/corpus/templates/clips/actions/list-viewers.ts +5 -2
- package/corpus/templates/clips/actions/regenerate-summary.ts +5 -1
- package/corpus/templates/clips/actions/request-transcript.ts +28 -1
- package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +21 -1
- package/corpus/templates/clips/app/components/library/library-layout.tsx +0 -7
- package/corpus/templates/clips/app/components/meetings/quick-ask-sidebar.tsx +14 -1
- package/corpus/templates/clips/app/components/player/insights-panel.tsx +8 -20
- package/corpus/templates/clips/app/components/player/recording-views-badge.tsx +335 -0
- package/corpus/templates/clips/app/components/player/video-player.tsx +13 -8
- package/corpus/templates/clips/app/components/sharing/share-ui.tsx +2 -1
- package/corpus/templates/clips/app/i18n/en-US.ts +13 -2
- package/corpus/templates/clips/app/lib/capture-permissions.ts +110 -0
- package/corpus/templates/clips/app/lib/recording-link.ts +32 -0
- package/corpus/templates/clips/app/routes/_app.library._index.tsx +1 -1
- package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +27 -0
- package/corpus/templates/clips/app/routes/_index.tsx +1 -1
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +52 -15
- package/corpus/templates/clips/app/routes/record.tsx +82 -31
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +42 -31
- package/corpus/templates/clips/changelog/2026-07-24-clip-pages-now-show-a-view-count-with-viewer-avatars-next-to.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-clip-summaries-read-like-a-description-you-d-write-yourself-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-clip-view-counts-now-separate-human-views-from-agent-views-s.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-clips-actions-can-now-be-called-by-org-service-tokens-so-ext.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-clips-no-longer-briefly-shows-a-dock-icon-while-launching.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-fixed-owner-and-editor-share-links-redirecting-to-the-record.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-meeting-and-note-recordings-now-start-as-a-compact-pill-on-t.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-new-clips-now-copy-a-shareable-link-instead-of-the-owner-onl.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-opening-a-share-link-as-the-clip-s-owner-now-goes-straight-t.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-permissions-and-rewind-controls-now-use-compact-consistent-h.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-quitting-the-desktop-app-no-longer-shows-a-false-macos-crash.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-screen-recording-permission-errors-now-name-the-exact-app-to.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-the-desktop-app-now-copies-a-new-clip-s-share-link-to-your-c.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-the-recording-toolbar-now-stays-above-other-apps-including-o.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-transcript-captions-now-use-real-speech-timings-instead-of-a.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-video-playback-no-longer-stutters-and-replays-the-last-momen.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/background.ts +17 -1
- package/corpus/templates/clips/desktop/package.json +2 -0
- package/corpus/templates/clips/desktop/src/app.tsx +89 -0
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +9 -3
- package/corpus/templates/clips/desktop/src/lib/audio-meter.ts +51 -0
- package/corpus/templates/clips/desktop/src/lib/native-notification.ts +44 -0
- package/corpus/templates/clips/desktop/src/lib/recording-link.ts +67 -0
- package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +35 -35
- package/corpus/templates/clips/desktop/src/overlays/live-transcript.tsx +3 -2
- package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +47 -46
- package/corpus/templates/clips/desktop/src/styles.css +127 -78
- package/corpus/templates/clips/desktop/src-tauri/Cargo.toml +7 -0
- package/corpus/templates/clips/desktop/src-tauri/Info.plist +6 -0
- package/corpus/templates/clips/desktop/src-tauri/capabilities/default.json +1 -0
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +7 -3
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +4 -1
- package/corpus/templates/clips/desktop/src-tauri/src/main.rs +8 -0
- package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +21 -10
- package/corpus/templates/clips/desktop/src-tauri/src/util.rs +40 -0
- package/corpus/templates/clips/server/db/schema.ts +27 -0
- package/corpus/templates/clips/server/lib/agent-views.ts +145 -0
- package/corpus/templates/clips/server/lib/post-finalize-dispatch.ts +2 -1
- package/corpus/templates/clips/server/lib/public-agent-context.ts +7 -0
- package/corpus/templates/clips/server/lib/recording-share-grant.ts +79 -0
- package/corpus/templates/clips/server/lib/recordings.ts +51 -3
- package/corpus/templates/clips/server/plugins/auth.ts +1 -1
- package/corpus/templates/clips/server/plugins/db.ts +31 -0
- package/corpus/templates/clips/server/routes/api/_agent-native-background/post-finalize-worker.post.ts +56 -3
- package/corpus/templates/clips/server/routes/api/public-recording.get.ts +49 -17
- package/corpus/templates/clips/shared/recording-link.ts +43 -0
- package/corpus/templates/clips/shared/share-attribution.ts +4 -0
- package/corpus/templates/clips/shared/share-dashboard-redirect.ts +42 -0
- package/corpus/templates/clips/shared/view-analytics.ts +26 -0
- package/corpus/templates/content/.agents/skills/content/SKILL.md +5 -0
- package/corpus/templates/content/.agents/skills/content/references/local-file-mode.md +135 -0
- package/corpus/templates/content/.agents/skills/document-editing/SKILL.md +12 -0
- package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +238 -0
- package/corpus/templates/content/.agents/skills/document-editing/references/document-behavior.md +91 -0
- package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/content/AGENTS.md +62 -583
- package/corpus/templates/content/_gitignore +1 -0
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -39
- package/corpus/templates/content/app/routes/_app._index.tsx +1 -2
- package/corpus/templates/content/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/content/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/content/package.json +1 -1
- package/corpus/templates/content/public/manifest.json +1 -1
- package/corpus/templates/content/server/plugins/auth.ts +1 -1
- package/corpus/templates/design/.agents/skills/creative-context/SKILL.md +11 -0
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +50 -8
- package/corpus/templates/design/.agents/skills/design-generation/references/code-layers.md +81 -0
- package/corpus/templates/design/.agents/skills/design-generation/references/code-workspace.md +42 -0
- package/corpus/templates/design/.agents/skills/design-generation/references/editor-extensions.md +34 -0
- package/corpus/templates/design/.agents/skills/responsive-breakpoints/SKILL.md +4 -1
- package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +17 -0
- package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +8196 -0
- package/corpus/templates/design/.generated/bridge/embedded-wheel.generated.ts +265 -0
- package/corpus/templates/design/.generated/bridge/hit-test.generated.ts +642 -0
- package/corpus/templates/design/.generated/bridge/motion-preview.generated.ts +571 -0
- package/corpus/templates/design/.generated/bridge/nav.generated.ts +91 -0
- package/corpus/templates/design/.generated/bridge/sample.generated.ts +23 -0
- package/corpus/templates/design/.generated/bridge/shader-fill-preview.generated.ts +263 -0
- package/corpus/templates/design/.generated/bridge/shader-runtime.generated.ts +518 -0
- package/corpus/templates/design/.generated/bridge/tweak.generated.ts +20 -0
- package/corpus/templates/design/.generated/bridge/zoom.generated.ts +32 -0
- package/corpus/templates/design/AGENTS.md +88 -503
- package/corpus/templates/design/_gitignore +1 -0
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +0 -2
- package/corpus/templates/design/app/routes/_index.tsx +1 -1
- package/corpus/templates/design/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/design/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/design/server/plugins/auth.ts +1 -1
- package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/dispatch/_gitignore +1 -0
- package/corpus/templates/dispatch/app/dispatch-extensions.tsx +1 -10
- package/corpus/templates/dispatch/app/routes/overview.tsx +1 -1
- package/corpus/templates/dispatch/changelog/2026-07-24-signing-in-now-puts-you-in-your-companys-workspace.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/dispatch/package.json +1 -1
- package/corpus/templates/dispatch/public/manifest.json +1 -1
- package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/forms/_gitignore +1 -0
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +0 -35
- package/corpus/templates/forms/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/forms/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/forms/package.json +1 -1
- package/corpus/templates/forms/public/manifest.json +1 -1
- package/corpus/templates/forms/server/lib/public-form-ssr.ts +2 -2
- package/corpus/templates/forms/server/plugins/auth.ts +1 -1
- package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/macros/_gitignore +1 -0
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +0 -2
- package/corpus/templates/macros/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/macros/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/macros/package.json +1 -1
- package/corpus/templates/macros/server/plugins/auth.ts +2 -2
- package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/mail/_gitignore +1 -0
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +0 -39
- package/corpus/templates/mail/app/routes/$view.$threadId.tsx +1 -1
- package/corpus/templates/mail/app/routes/$view.tsx +1 -1
- package/corpus/templates/mail/app/routes/_index.tsx +1 -1
- package/corpus/templates/mail/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/mail/package.json +1 -1
- package/corpus/templates/mail/public/manifest.json +1 -1
- package/corpus/templates/mail/server/plugins/auth.ts +1 -1
- package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/plan/_gitignore +1 -0
- package/corpus/templates/plan/agent-native.app-skill.json +1 -1
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +4 -9
- package/corpus/templates/plan/app/lib/app-config.ts +1 -1
- package/corpus/templates/plan/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/plan/package.json +1 -1
- package/corpus/templates/plan/public/manifest.json +1 -1
- package/corpus/templates/plan/server/plugins/auth.ts +1 -1
- package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/slides/_gitignore +1 -0
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +0 -2
- package/corpus/templates/slides/app/routes/_index.tsx +1 -1
- package/corpus/templates/slides/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/slides/package.json +1 -1
- package/corpus/templates/slides/public/manifest.json +1 -1
- package/corpus/templates/slides/server/plugins/auth.ts +1 -1
- package/corpus/templates/slides/server/plugins/db.ts +4 -0
- package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/tasks/AGENTS.md +1 -1
- package/corpus/templates/tasks/_gitignore +1 -0
- package/dist/a2a/activity.d.ts +4 -1
- package/dist/a2a/activity.d.ts.map +1 -1
- package/dist/a2a/activity.js +27 -16
- package/dist/a2a/activity.js.map +1 -1
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +58 -4
- package/dist/a2a/client.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts +1 -0
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.js +31 -4
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +18 -1
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/run-store.d.ts +1 -0
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +2 -1
- package/dist/agent/run-store.js.map +1 -1
- package/dist/agent/types.d.ts +12 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js +21 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/chat-threads/store.d.ts +10 -0
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +41 -0
- package/dist/chat-threads/store.js.map +1 -1
- package/dist/checkpoints/index.d.ts +1 -0
- package/dist/checkpoints/index.d.ts.map +1 -1
- package/dist/checkpoints/index.js +1 -0
- package/dist/checkpoints/index.js.map +1 -1
- package/dist/checkpoints/route-match.d.ts +8 -0
- package/dist/checkpoints/route-match.d.ts.map +1 -0
- package/dist/checkpoints/route-match.js +13 -0
- package/dist/checkpoints/route-match.js.map +1 -0
- package/dist/cli/create.d.ts +35 -4
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +69 -19
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/index.js +19 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/template-baseline.d.ts +54 -0
- package/dist/cli/template-baseline.d.ts.map +1 -0
- package/dist/cli/template-baseline.js +334 -0
- package/dist/cli/template-baseline.js.map +1 -0
- package/dist/cli/template-sync.d.ts +57 -0
- package/dist/cli/template-sync.d.ts.map +1 -0
- package/dist/cli/template-sync.js +787 -0
- package/dist/cli/template-sync.js.map +1 -0
- package/dist/cli/templates-meta.d.ts.map +1 -1
- package/dist/cli/templates-meta.js +1 -0
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +2 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +38 -10
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/NewWorkspaceAppFlow.d.ts.map +1 -1
- package/dist/client/NewWorkspaceAppFlow.js +32 -2
- package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +20 -0
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +81 -46
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +14 -6
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/error-format.d.ts.map +1 -1
- package/dist/client/error-format.js +13 -0
- package/dist/client/error-format.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 +3 -2
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/org/TeamPage.d.ts.map +1 -1
- package/dist/client/org/TeamPage.js +1 -1
- package/dist/client/org/TeamPage.js.map +1 -1
- package/dist/client/settings/SettingsPanel.js +9 -9
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
- package/dist/client/settings/SettingsTabsPage.js +7 -4
- package/dist/client/settings/SettingsTabsPage.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +3 -0
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/data-widgets/index.d.ts +3 -0
- package/dist/data-widgets/index.d.ts.map +1 -1
- package/dist/data-widgets/index.js +33 -0
- package/dist/data-widgets/index.js.map +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +11 -7
- package/dist/deploy/build.js.map +1 -1
- package/dist/eject/provider-api-definitions.d.ts +1 -0
- package/dist/eject/provider-api-definitions.d.ts.map +1 -1
- package/dist/extensions/url-safety.d.ts +9 -16
- package/dist/extensions/url-safety.d.ts.map +1 -1
- package/dist/extensions/url-safety.js +48 -4
- package/dist/extensions/url-safety.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +46 -9
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +3 -3
- package/dist/org/auto-join-domain.d.ts +3 -2
- package/dist/org/auto-join-domain.d.ts.map +1 -1
- package/dist/org/auto-join-domain.js +1 -1
- package/dist/org/auto-join-domain.js.map +1 -1
- package/dist/org/context.d.ts.map +1 -1
- package/dist/org/context.js +84 -28
- package/dist/org/context.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/service-identity.d.ts +43 -0
- package/dist/org/service-identity.d.ts.map +1 -0
- package/dist/org/service-identity.js +34 -0
- package/dist/org/service-identity.js.map +1 -0
- package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
- package/dist/provider-api/actions/provider-api.d.ts +13 -11
- package/dist/provider-api/actions/provider-api.d.ts.map +1 -1
- package/dist/provider-api/index.d.ts +4 -0
- package/dist/provider-api/index.d.ts.map +1 -1
- package/dist/provider-api/index.js +17 -1
- package/dist/provider-api/index.js.map +1 -1
- package/dist/scripts/docs/search.d.ts.map +1 -1
- package/dist/scripts/docs/search.js +12 -1
- package/dist/scripts/docs/search.js.map +1 -1
- package/dist/server/agent-chat/context-tools.d.ts.map +1 -1
- package/dist/server/agent-chat/context-tools.js +3 -3
- package/dist/server/agent-chat/context-tools.js.map +1 -1
- package/dist/server/agent-chat/framework-prompts.d.ts +8 -3
- package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -1
- package/dist/server/agent-chat/framework-prompts.js +33 -62
- package/dist/server/agent-chat/framework-prompts.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +16 -10
- 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/agents-bundle.d.ts +18 -0
- package/dist/server/agents-bundle.d.ts.map +1 -1
- package/dist/server/agents-bundle.js +70 -4
- package/dist/server/agents-bundle.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +4 -3
- package/dist/server/auth.js.map +1 -1
- package/dist/server/builder-browser.d.ts.map +1 -1
- package/dist/server/builder-browser.js +43 -19
- package/dist/server/builder-browser.js.map +1 -1
- package/dist/server/core-routes-plugin.js +2 -2
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/credential-provider.d.ts +38 -2
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +142 -64
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/prompts/framework-core-compact.d.ts +1 -1
- package/dist/server/prompts/framework-core-compact.d.ts.map +1 -1
- package/dist/server/prompts/framework-core-compact.js +7 -13
- package/dist/server/prompts/framework-core-compact.js.map +1 -1
- package/dist/server/prompts/framework-core.d.ts +1 -1
- package/dist/server/prompts/framework-core.d.ts.map +1 -1
- package/dist/server/prompts/framework-core.js +10 -21
- package/dist/server/prompts/framework-core.js.map +1 -1
- package/dist/server/prompts/index.d.ts +1 -1
- package/dist/server/prompts/index.d.ts.map +1 -1
- package/dist/server/prompts/index.js +1 -1
- package/dist/server/prompts/index.js.map +1 -1
- package/dist/server/prompts/shared-rules.d.ts +16 -10
- package/dist/server/prompts/shared-rules.d.ts.map +1 -1
- package/dist/server/prompts/shared-rules.js +19 -10
- package/dist/server/prompts/shared-rules.js.map +1 -1
- package/dist/server/ssr-handler.d.ts +1 -1
- package/dist/server/ssr-handler.d.ts.map +1 -1
- package/dist/server/ssr-handler.js +10 -3
- package/dist/server/ssr-handler.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/settings/user-settings.d.ts.map +1 -1
- package/dist/settings/user-settings.js +13 -1
- package/dist/settings/user-settings.js.map +1 -1
- package/dist/shared/cache-control.d.ts +52 -0
- package/dist/shared/cache-control.d.ts.map +1 -1
- package/dist/shared/cache-control.js +107 -0
- package/dist/shared/cache-control.js.map +1 -1
- package/dist/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/dist/templates/chat/_gitignore +1 -0
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +0 -7
- package/dist/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/dist/templates/default/app/root.tsx +1 -1
- package/dist/templates/default/public/manifest.json +2 -2
- package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
- package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/dist/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
- package/dist/vite/agents-bundle-plugin.d.ts.map +1 -1
- package/dist/vite/agents-bundle-plugin.js +8 -7
- package/dist/vite/agents-bundle-plugin.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +66 -1
- package/dist/vite/client.js.map +1 -1
- package/docs/content/actions.mdx +2 -2
- package/docs/content/agent-surfaces.mdx +1 -1
- package/docs/content/authentication.mdx +2 -0
- package/docs/content/deployment.mdx +36 -0
- package/docs/content/http-api.mdx +266 -0
- package/docs/content/syncing-template-changes.mdx +159 -0
- package/package.json +4 -3
- package/src/a2a/activity.ts +38 -27
- package/src/a2a/client.ts +57 -4
- package/src/agent/engine/builder-engine.ts +35 -4
- package/src/agent/run-manager.ts +20 -1
- package/src/agent/run-store.ts +4 -1
- package/src/agent/types.ts +28 -8
- package/src/chat-threads/store.ts +45 -0
- package/src/checkpoints/index.ts +2 -0
- package/src/checkpoints/route-match.ts +13 -0
- package/src/cli/create.ts +105 -17
- package/src/cli/index.ts +20 -0
- package/src/cli/template-baseline.ts +410 -0
- package/src/cli/template-sync.ts +1004 -0
- package/src/cli/templates-meta.ts +1 -0
- package/src/client/AssistantChat.tsx +38 -12
- package/src/client/NewWorkspaceAppFlow.tsx +75 -10
- package/src/client/chat/message-components.tsx +127 -66
- package/src/client/chat/tool-call-display.tsx +29 -5
- package/src/client/error-format.ts +18 -0
- package/src/client/org/OrgSwitcher.tsx +30 -8
- package/src/client/org/TeamPage.tsx +7 -6
- package/src/client/settings/SettingsPanel.tsx +9 -9
- package/src/client/settings/SettingsTabsPage.tsx +12 -2
- package/src/client/sse-event-processor.ts +3 -0
- package/src/data-widgets/index.ts +41 -0
- package/src/deploy/build.ts +11 -9
- package/src/extensions/url-safety.ts +67 -4
- package/src/integrations/webhook-handler.ts +63 -9
- package/src/org/auto-join-domain.ts +4 -3
- package/src/org/context.ts +108 -39
- package/src/org/index.ts +5 -0
- package/src/org/service-identity.ts +60 -0
- package/src/provider-api/index.ts +22 -1
- package/src/scripts/docs/search.ts +12 -1
- package/src/server/__snapshots__/agent-chat-plugin.surface.spec.ts.snap +25 -36
- package/src/server/agent-chat/context-tools.ts +9 -4
- package/src/server/agent-chat/framework-prompts.ts +38 -66
- package/src/server/agent-chat-plugin.ts +17 -10
- package/src/server/agents-bundle.ts +84 -5
- package/src/server/auth.ts +4 -3
- package/src/server/builder-browser.ts +47 -19
- package/src/server/core-routes-plugin.ts +2 -2
- package/src/server/credential-provider.ts +209 -68
- package/src/server/index.ts +3 -0
- package/src/server/prompts/framework-core-compact.ts +6 -13
- package/src/server/prompts/framework-core.ts +9 -21
- package/src/server/prompts/index.ts +0 -1
- package/src/server/prompts/shared-rules.ts +19 -11
- package/src/server/ssr-handler.ts +13 -2
- package/src/settings/user-settings.ts +13 -1
- package/src/shared/cache-control.ts +141 -0
- package/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/src/templates/chat/_gitignore +1 -0
- package/src/templates/chat/app/components/layout/Sidebar.tsx +0 -7
- package/src/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/src/templates/default/app/root.tsx +1 -1
- package/src/templates/default/public/manifest.json +2 -2
- package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
- package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/src/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
- package/src/vite/agents-bundle-plugin.ts +7 -6
- package/src/vite/client.ts +69 -3
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { writeAppState } from "@agent-native/core/application-state";
|
|
2
|
+
import { uploadFile } from "@agent-native/core/file-upload";
|
|
3
|
+
import { and, eq } from "drizzle-orm";
|
|
4
|
+
|
|
5
|
+
import { getDb, schema } from "../../server/db/index.js";
|
|
6
|
+
import { queueBuilderMediaCompression } from "../../server/lib/builder-media-compression.js";
|
|
7
|
+
import {
|
|
8
|
+
extractLoomVideoId,
|
|
9
|
+
normalizeLoomShareUrl,
|
|
10
|
+
} from "../../shared/loom.js";
|
|
11
|
+
import {
|
|
12
|
+
fetchLoomTranscript,
|
|
13
|
+
loomTranscriptUnavailableMessage,
|
|
14
|
+
} from "./loom-transcript.js";
|
|
15
|
+
import { downloadLoomVideo } from "./loom-video.js";
|
|
16
|
+
|
|
17
|
+
export type LoomImportJobResult = {
|
|
18
|
+
status: "ready" | "failed";
|
|
19
|
+
failureReason?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export async function failLoomImport(
|
|
23
|
+
recordingId: string,
|
|
24
|
+
failureReason: string,
|
|
25
|
+
claimId?: string,
|
|
26
|
+
): Promise<LoomImportJobResult> {
|
|
27
|
+
const now = new Date().toISOString();
|
|
28
|
+
const [updated] = await getDb()
|
|
29
|
+
.update(schema.recordings)
|
|
30
|
+
.set({
|
|
31
|
+
status: "failed",
|
|
32
|
+
failureReason,
|
|
33
|
+
loomImportClaimId: null,
|
|
34
|
+
loomImportClaimedAt: null,
|
|
35
|
+
updatedAt: now,
|
|
36
|
+
})
|
|
37
|
+
.where(
|
|
38
|
+
claimId
|
|
39
|
+
? and(
|
|
40
|
+
eq(schema.recordings.id, recordingId),
|
|
41
|
+
eq(schema.recordings.loomImportClaimId, claimId),
|
|
42
|
+
)
|
|
43
|
+
: eq(schema.recordings.id, recordingId),
|
|
44
|
+
)
|
|
45
|
+
.returning({ id: schema.recordings.id });
|
|
46
|
+
if (!updated) return { status: "failed", failureReason };
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
await writeAppState(`recording-upload-${recordingId}`, {
|
|
50
|
+
recordingId,
|
|
51
|
+
status: "failed",
|
|
52
|
+
failureReason,
|
|
53
|
+
updatedAt: now,
|
|
54
|
+
});
|
|
55
|
+
await writeAppState("refresh-signal", { ts: Date.now() });
|
|
56
|
+
} catch (err) {
|
|
57
|
+
console.warn("[clips] Loom failure state update failed", {
|
|
58
|
+
recordingId,
|
|
59
|
+
error: err instanceof Error ? err.message : String(err),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return { status: "failed", failureReason };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Downloads a Loom video and re-uploads it to Clips storage, off the request
|
|
67
|
+
* that created the "processing" row. Loom's CDN plus a reupload can outlast a
|
|
68
|
+
* synchronous serverless function's execution ceiling; running it here keeps
|
|
69
|
+
* import-loom-recording's own request fast regardless of Loom video length.
|
|
70
|
+
*/
|
|
71
|
+
export async function runLoomImportJob({
|
|
72
|
+
recordingId,
|
|
73
|
+
ownerEmail,
|
|
74
|
+
claimId,
|
|
75
|
+
}: {
|
|
76
|
+
recordingId: string;
|
|
77
|
+
ownerEmail: string;
|
|
78
|
+
claimId: string;
|
|
79
|
+
}): Promise<LoomImportJobResult> {
|
|
80
|
+
const db = getDb();
|
|
81
|
+
const [recording] = await db
|
|
82
|
+
.select({
|
|
83
|
+
id: schema.recordings.id,
|
|
84
|
+
durationMs: schema.recordings.durationMs,
|
|
85
|
+
sourceWindowTitle: schema.recordings.sourceWindowTitle,
|
|
86
|
+
loomImportClaimId: schema.recordings.loomImportClaimId,
|
|
87
|
+
})
|
|
88
|
+
.from(schema.recordings)
|
|
89
|
+
.where(eq(schema.recordings.id, recordingId));
|
|
90
|
+
|
|
91
|
+
const shareUrl = normalizeLoomShareUrl(recording?.sourceWindowTitle ?? "");
|
|
92
|
+
const loomId = shareUrl ? extractLoomVideoId(shareUrl) : null;
|
|
93
|
+
if (
|
|
94
|
+
!recording ||
|
|
95
|
+
recording.loomImportClaimId !== claimId ||
|
|
96
|
+
!shareUrl ||
|
|
97
|
+
!loomId
|
|
98
|
+
) {
|
|
99
|
+
return failLoomImport(
|
|
100
|
+
recordingId,
|
|
101
|
+
"This Loom recording is missing its source URL.",
|
|
102
|
+
claimId,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
let media: Awaited<ReturnType<typeof downloadLoomVideo>>;
|
|
107
|
+
try {
|
|
108
|
+
media = await downloadLoomVideo({ loomId, shareUrl });
|
|
109
|
+
} catch (err) {
|
|
110
|
+
return failLoomImport(
|
|
111
|
+
recordingId,
|
|
112
|
+
err instanceof Error ? err.message : String(err),
|
|
113
|
+
claimId,
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
try {
|
|
118
|
+
const upload = await uploadFile({
|
|
119
|
+
data: media.bytes,
|
|
120
|
+
filename: `${recordingId}.mp4`,
|
|
121
|
+
mimeType: media.mimeType,
|
|
122
|
+
ownerEmail,
|
|
123
|
+
stableUrl: true,
|
|
124
|
+
recordAsset: false,
|
|
125
|
+
});
|
|
126
|
+
if (!upload?.url) {
|
|
127
|
+
return failLoomImport(
|
|
128
|
+
recordingId,
|
|
129
|
+
"File upload returned no URL. Check your storage provider configuration.",
|
|
130
|
+
claimId,
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const now = new Date().toISOString();
|
|
135
|
+
const [mediaReady] = await db
|
|
136
|
+
.update(schema.recordings)
|
|
137
|
+
.set({
|
|
138
|
+
videoUrl: upload.url,
|
|
139
|
+
videoSizeBytes: media.sizeBytes,
|
|
140
|
+
status: "ready",
|
|
141
|
+
failureReason: null,
|
|
142
|
+
updatedAt: now,
|
|
143
|
+
})
|
|
144
|
+
.where(
|
|
145
|
+
and(
|
|
146
|
+
eq(schema.recordings.id, recordingId),
|
|
147
|
+
eq(schema.recordings.loomImportClaimId, claimId),
|
|
148
|
+
),
|
|
149
|
+
)
|
|
150
|
+
.returning({ id: schema.recordings.id });
|
|
151
|
+
if (!mediaReady) {
|
|
152
|
+
return {
|
|
153
|
+
status: "failed",
|
|
154
|
+
failureReason: "The Loom import lease was lost before media was saved.",
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
void queueBuilderMediaCompression({
|
|
159
|
+
recordingId,
|
|
160
|
+
ownerEmail,
|
|
161
|
+
videoUrl: upload.url,
|
|
162
|
+
mimeType: media.mimeType,
|
|
163
|
+
providerId: upload.provider,
|
|
164
|
+
assetDbId: upload.id,
|
|
165
|
+
sourceSizeBytes: media.sizeBytes,
|
|
166
|
+
}).catch((err) => {
|
|
167
|
+
console.warn("[clips] Loom media compression queue failed", {
|
|
168
|
+
recordingId,
|
|
169
|
+
error: err instanceof Error ? err.message : String(err),
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
try {
|
|
174
|
+
let transcript: Awaited<ReturnType<typeof fetchLoomTranscript>> = null;
|
|
175
|
+
try {
|
|
176
|
+
transcript = await fetchLoomTranscript({
|
|
177
|
+
shareUrl,
|
|
178
|
+
durationMs: recording.durationMs,
|
|
179
|
+
});
|
|
180
|
+
} catch (err) {
|
|
181
|
+
console.warn(
|
|
182
|
+
`[clips] Loom transcript import skipped for ${loomId}:`,
|
|
183
|
+
err instanceof Error ? err.message : String(err),
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const transcriptValues = {
|
|
188
|
+
ownerEmail,
|
|
189
|
+
language: transcript?.language ?? "en",
|
|
190
|
+
segmentsJson: transcript ? JSON.stringify(transcript.segments) : "[]",
|
|
191
|
+
fullText: transcript?.fullText ?? "",
|
|
192
|
+
status: transcript ? ("ready" as const) : ("failed" as const),
|
|
193
|
+
failureReason: transcript ? null : loomTranscriptUnavailableMessage(),
|
|
194
|
+
updatedAt: now,
|
|
195
|
+
};
|
|
196
|
+
const [existingTranscript] = await db
|
|
197
|
+
.select({ recordingId: schema.recordingTranscripts.recordingId })
|
|
198
|
+
.from(schema.recordingTranscripts)
|
|
199
|
+
.where(eq(schema.recordingTranscripts.recordingId, recordingId));
|
|
200
|
+
if (existingTranscript) {
|
|
201
|
+
await db
|
|
202
|
+
.update(schema.recordingTranscripts)
|
|
203
|
+
.set(transcriptValues)
|
|
204
|
+
.where(eq(schema.recordingTranscripts.recordingId, recordingId));
|
|
205
|
+
} else {
|
|
206
|
+
await db.insert(schema.recordingTranscripts).values({
|
|
207
|
+
recordingId,
|
|
208
|
+
...transcriptValues,
|
|
209
|
+
createdAt: now,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
} catch (err) {
|
|
213
|
+
console.warn("[clips] Loom transcript persistence skipped", {
|
|
214
|
+
recordingId,
|
|
215
|
+
error: err instanceof Error ? err.message : String(err),
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
try {
|
|
220
|
+
await writeAppState(`recording-upload-${recordingId}`, {
|
|
221
|
+
recordingId,
|
|
222
|
+
status: "ready",
|
|
223
|
+
progress: 100,
|
|
224
|
+
videoUrl: upload.url,
|
|
225
|
+
updatedAt: now,
|
|
226
|
+
});
|
|
227
|
+
await writeAppState("refresh-signal", { ts: Date.now() });
|
|
228
|
+
} catch (err) {
|
|
229
|
+
console.warn("[clips] Loom ready state update skipped", {
|
|
230
|
+
recordingId,
|
|
231
|
+
error: err instanceof Error ? err.message : String(err),
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
try {
|
|
236
|
+
await db
|
|
237
|
+
.update(schema.recordings)
|
|
238
|
+
.set({ loomImportClaimId: null, loomImportClaimedAt: null })
|
|
239
|
+
.where(
|
|
240
|
+
and(
|
|
241
|
+
eq(schema.recordings.id, recordingId),
|
|
242
|
+
eq(schema.recordings.loomImportClaimId, claimId),
|
|
243
|
+
),
|
|
244
|
+
);
|
|
245
|
+
} catch (err) {
|
|
246
|
+
console.warn("[clips] Loom import lease release failed", {
|
|
247
|
+
recordingId,
|
|
248
|
+
error: err instanceof Error ? err.message : String(err),
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return { status: "ready" };
|
|
253
|
+
} catch (err) {
|
|
254
|
+
return failLoomImport(
|
|
255
|
+
recordingId,
|
|
256
|
+
err instanceof Error ? err.message : String(err),
|
|
257
|
+
claimId,
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
@@ -19,6 +19,7 @@ import { desc, eq } from "drizzle-orm";
|
|
|
19
19
|
import { z } from "zod";
|
|
20
20
|
|
|
21
21
|
import { getDb, schema } from "../server/db/index.js";
|
|
22
|
+
import { displayViewerName } from "../shared/view-analytics.js";
|
|
22
23
|
|
|
23
24
|
export default defineAction({
|
|
24
25
|
description:
|
|
@@ -49,10 +50,7 @@ export default defineAction({
|
|
|
49
50
|
views: rows.map((v) => ({
|
|
50
51
|
id: v.id,
|
|
51
52
|
viewerEmail: v.viewerEmail,
|
|
52
|
-
|
|
53
|
-
// viewer_name (same convention as recording_viewers). Return null so
|
|
54
|
-
// callers render "Someone" instead of the raw session key.
|
|
55
|
-
viewerName: v.viewerName?.startsWith("anon:") ? null : v.viewerName,
|
|
53
|
+
viewerName: displayViewerName(v.viewerName),
|
|
56
54
|
viewedAt: v.viewedAt,
|
|
57
55
|
})),
|
|
58
56
|
};
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
} from "../server/lib/agent-recording-access.js";
|
|
22
22
|
import { resolvePlayerVideoUrl } from "../server/lib/player-video-url.js";
|
|
23
23
|
import {
|
|
24
|
+
countedViewCondition,
|
|
24
25
|
getActiveOrganizationId,
|
|
25
26
|
ownerEmailMatches,
|
|
26
27
|
parseSpaceIds,
|
|
@@ -63,6 +64,31 @@ export function resolveListRecordingMedia(
|
|
|
63
64
|
};
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
type ViewCountRow = { recordingId: string; count: number | string | null };
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* `recording_views` only exists from migration v46, so pre-migration clips have
|
|
71
|
+
* no log rows and must fall back to their counted-viewer count instead of
|
|
72
|
+
* dropping to 0. Same floor as `countRecordingViews`, so a library card and the
|
|
73
|
+
* clip page always agree.
|
|
74
|
+
*/
|
|
75
|
+
export function mergeViewCounts(
|
|
76
|
+
countedViewerRows: ViewCountRow[],
|
|
77
|
+
viewLogRows: ViewCountRow[],
|
|
78
|
+
): Record<string, number> {
|
|
79
|
+
const merged: Record<string, number> = {};
|
|
80
|
+
for (const row of countedViewerRows) {
|
|
81
|
+
merged[row.recordingId] = Number(row.count ?? 0);
|
|
82
|
+
}
|
|
83
|
+
for (const row of viewLogRows) {
|
|
84
|
+
merged[row.recordingId] = Math.max(
|
|
85
|
+
merged[row.recordingId] ?? 0,
|
|
86
|
+
Number(row.count ?? 0),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
return merged;
|
|
90
|
+
}
|
|
91
|
+
|
|
66
92
|
export default defineAction({
|
|
67
93
|
description:
|
|
68
94
|
"List recordings visible to the current user. Supports filtering by view (library/shared/space/archive/trash/all), folder, space, tag, free-text, and sort. Public/unlisted recordings are discoverable only when owned by or previously viewed by the current user; the shared view returns accessible recordings owned by someone else.",
|
|
@@ -229,11 +255,26 @@ export default defineAction({
|
|
|
229
255
|
}
|
|
230
256
|
|
|
231
257
|
// Sort
|
|
232
|
-
const
|
|
258
|
+
const countedViewerCount = sql<number>`(
|
|
233
259
|
SELECT COUNT(1)
|
|
234
260
|
FROM ${schema.recordingViewers}
|
|
235
261
|
WHERE ${schema.recordingViewers.recordingId} = ${schema.recordings.id}
|
|
236
|
-
AND ${
|
|
262
|
+
AND ${countedViewCondition()}
|
|
263
|
+
)`;
|
|
264
|
+
const viewLogCount = sql<number>`(
|
|
265
|
+
SELECT COUNT(1)
|
|
266
|
+
FROM ${schema.recordingViews}
|
|
267
|
+
WHERE ${schema.recordingViews.recordingId} = ${schema.recordings.id}
|
|
268
|
+
)`;
|
|
269
|
+
// Same floor as `countRecordingViews`: `recording_views` only exists from
|
|
270
|
+
// migration v46, so pre-migration clips have no log rows and must fall back
|
|
271
|
+
// to the counted-viewer count instead of sorting as zero. CASE rather than
|
|
272
|
+
// MAX()/GREATEST() — the two-argument spelling differs across dialects.
|
|
273
|
+
const viewCountOrder = sql<number>`(
|
|
274
|
+
CASE WHEN ${viewLogCount} > ${countedViewerCount}
|
|
275
|
+
THEN ${viewLogCount}
|
|
276
|
+
ELSE ${countedViewerCount}
|
|
277
|
+
END
|
|
237
278
|
)`;
|
|
238
279
|
const orderBy =
|
|
239
280
|
args.sort === "oldest"
|
|
@@ -321,25 +362,34 @@ export default defineAction({
|
|
|
321
362
|
}
|
|
322
363
|
}
|
|
323
364
|
|
|
324
|
-
// Count views per recording
|
|
365
|
+
// Count views per recording — two set-wide grouped reads, never one per
|
|
366
|
+
// recording.
|
|
325
367
|
let viewsByRec: Record<string, number> = {};
|
|
326
368
|
if (ids.length) {
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
369
|
+
const [countedViewerRows, viewLogRows] = await Promise.all([
|
|
370
|
+
db
|
|
371
|
+
.select({
|
|
372
|
+
recordingId: schema.recordingViewers.recordingId,
|
|
373
|
+
count: sql<number>`COUNT(1)`,
|
|
374
|
+
})
|
|
375
|
+
.from(schema.recordingViewers)
|
|
376
|
+
.where(
|
|
377
|
+
and(
|
|
378
|
+
inArray(schema.recordingViewers.recordingId, ids),
|
|
379
|
+
countedViewCondition(),
|
|
380
|
+
),
|
|
381
|
+
)
|
|
382
|
+
.groupBy(schema.recordingViewers.recordingId),
|
|
383
|
+
db
|
|
384
|
+
.select({
|
|
385
|
+
recordingId: schema.recordingViews.recordingId,
|
|
386
|
+
count: sql<number>`COUNT(1)`,
|
|
387
|
+
})
|
|
388
|
+
.from(schema.recordingViews)
|
|
389
|
+
.where(inArray(schema.recordingViews.recordingId, ids))
|
|
390
|
+
.groupBy(schema.recordingViews.recordingId),
|
|
391
|
+
]);
|
|
392
|
+
viewsByRec = mergeViewCounts(countedViewerRows, viewLogRows);
|
|
343
393
|
}
|
|
344
394
|
|
|
345
395
|
const recordings = rows.map((row) => {
|
|
@@ -11,7 +11,10 @@ import { eq } from "drizzle-orm";
|
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
|
|
13
13
|
import { getDb, schema } from "../server/db/index.js";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
clampCompletionPct,
|
|
16
|
+
displayViewerName,
|
|
17
|
+
} from "../shared/view-analytics.js";
|
|
15
18
|
|
|
16
19
|
export default defineAction({
|
|
17
20
|
description:
|
|
@@ -37,7 +40,7 @@ export default defineAction({
|
|
|
37
40
|
.map((v) => ({
|
|
38
41
|
id: v.id,
|
|
39
42
|
viewerEmail: v.viewerEmail,
|
|
40
|
-
viewerName: v.viewerName,
|
|
43
|
+
viewerName: displayViewerName(v.viewerName),
|
|
41
44
|
totalWatchMs: v.totalWatchMs ?? 0,
|
|
42
45
|
completedPct: clampCompletionPct(v.completedPct),
|
|
43
46
|
countedView: Boolean(v.countedView),
|
|
@@ -101,7 +101,11 @@ export default defineAction({
|
|
|
101
101
|
`Regenerate the description for recording ${args.recordingId}. ` +
|
|
102
102
|
`Read the transcript in this request's context and call ` +
|
|
103
103
|
`\`update-recording --id=${args.recordingId} --description="..."\` with a 2–4 ` +
|
|
104
|
-
`sentence summary of what the recording covers. Title: "${rec.title}"
|
|
104
|
+
`sentence summary of what the recording covers. Title: "${rec.title}". ` +
|
|
105
|
+
`Write the description the way the person who made this recording would ` +
|
|
106
|
+
`describe it themselves: lead with the subject matter, and never use ` +
|
|
107
|
+
`outside-narrator framing like "the speaker", "the presenter", "the video", ` +
|
|
108
|
+
`"this recording", or "this clip".`;
|
|
105
109
|
|
|
106
110
|
const request = {
|
|
107
111
|
kind: "regenerate-summary" as const,
|
|
@@ -437,6 +437,26 @@ function fullTextSegmentJson(
|
|
|
437
437
|
return JSON.stringify(buildCaptionSegmentsFromText(text, durationMs));
|
|
438
438
|
}
|
|
439
439
|
|
|
440
|
+
/**
|
|
441
|
+
* Pick the segments to store after cleanup rewrites the transcript text.
|
|
442
|
+
*
|
|
443
|
+
* Measured timings from the capture engine always win.
|
|
444
|
+
* `buildCaptionSegmentsFromText` spaces cues in proportion to word count, so
|
|
445
|
+
* re-synthesizing over real timestamps spreads a short transcript evenly across
|
|
446
|
+
* the whole recording — which reads as minute-long gaps of dropped speech even
|
|
447
|
+
* when nothing was dropped there.
|
|
448
|
+
*/
|
|
449
|
+
export function resolveCleanupSegmentsJson(
|
|
450
|
+
priorSegmentsJson: string | null | undefined,
|
|
451
|
+
cleanedText: string,
|
|
452
|
+
durationMs: number | null | undefined,
|
|
453
|
+
): string {
|
|
454
|
+
if (parseTranscriptSegments(priorSegmentsJson).length > 1) {
|
|
455
|
+
return priorSegmentsJson as string;
|
|
456
|
+
}
|
|
457
|
+
return fullTextSegmentJson(cleanedText, durationMs);
|
|
458
|
+
}
|
|
459
|
+
|
|
440
460
|
export function isSafeTranscriptCleanupReplacement(
|
|
441
461
|
sourceText: string,
|
|
442
462
|
cleanedText: string,
|
|
@@ -642,12 +662,14 @@ async function cleanupNativeTranscript({
|
|
|
642
662
|
ownerEmail,
|
|
643
663
|
fullText,
|
|
644
664
|
durationMs,
|
|
665
|
+
segmentsJson,
|
|
645
666
|
}: {
|
|
646
667
|
db: ReturnType<typeof getDb>;
|
|
647
668
|
recordingId: string;
|
|
648
669
|
ownerEmail: string;
|
|
649
670
|
fullText: string;
|
|
650
671
|
durationMs: number | null | undefined;
|
|
672
|
+
segmentsJson?: string | null;
|
|
651
673
|
}): Promise<{ cleaned: boolean; provider?: string }> {
|
|
652
674
|
const sourceText = fullText.trim();
|
|
653
675
|
if (!sourceText) return { cleaned: false };
|
|
@@ -704,7 +726,11 @@ async function cleanupNativeTranscript({
|
|
|
704
726
|
status: "ready",
|
|
705
727
|
failureReason: null,
|
|
706
728
|
language,
|
|
707
|
-
segmentsJson:
|
|
729
|
+
segmentsJson: resolveCleanupSegmentsJson(
|
|
730
|
+
segmentsJson,
|
|
731
|
+
cleanedText,
|
|
732
|
+
durationMs,
|
|
733
|
+
),
|
|
708
734
|
fullText: cleanedText,
|
|
709
735
|
retryCount: 0,
|
|
710
736
|
updatedAt: now,
|
|
@@ -855,6 +881,7 @@ async function completeReadyTranscript({
|
|
|
855
881
|
ownerEmail,
|
|
856
882
|
fullText,
|
|
857
883
|
durationMs: recForTitle?.durationMs,
|
|
884
|
+
segmentsJson,
|
|
858
885
|
}).catch((err) => {
|
|
859
886
|
console.warn(
|
|
860
887
|
`[clips] native transcript cleanup failed for ${recordingId}:`,
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
} from "@/components/ui/dialog";
|
|
24
24
|
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
25
25
|
import { exportConcat } from "@/lib/ffmpeg-export";
|
|
26
|
+
import { copyRecordingShareLink } from "@/lib/recording-link";
|
|
26
27
|
import { formatMs } from "@/lib/timestamp-mapping";
|
|
27
28
|
import { uploadFileClient } from "@/lib/upload-file-client";
|
|
28
29
|
import { cn } from "@/lib/utils";
|
|
@@ -142,7 +143,26 @@ export function StitchManager({
|
|
|
142
143
|
videoUrl,
|
|
143
144
|
durationMs: totalDuration,
|
|
144
145
|
});
|
|
145
|
-
|
|
146
|
+
const newRecordingId = (result as { id?: string } | null)?.id;
|
|
147
|
+
if (newRecordingId) {
|
|
148
|
+
const copied = await copyRecordingShareLink(newRecordingId);
|
|
149
|
+
if (copied) {
|
|
150
|
+
toast.success(t("stitchManager.created"), {
|
|
151
|
+
description: t("recordRoute.linkCopied"),
|
|
152
|
+
});
|
|
153
|
+
} else {
|
|
154
|
+
toast.success(t("stitchManager.created"), {
|
|
155
|
+
action: {
|
|
156
|
+
label: t("recordRoute.copyLinkAction"),
|
|
157
|
+
onClick: () => {
|
|
158
|
+
void copyRecordingShareLink(newRecordingId);
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
} else {
|
|
164
|
+
toast.success(t("stitchManager.created"));
|
|
165
|
+
}
|
|
146
166
|
onOpenChange(false);
|
|
147
167
|
return result;
|
|
148
168
|
} catch (err: any) {
|
|
@@ -30,7 +30,6 @@ import {
|
|
|
30
30
|
IconLayoutSidebarLeftExpand,
|
|
31
31
|
IconPlus,
|
|
32
32
|
IconShare,
|
|
33
|
-
IconHierarchy2,
|
|
34
33
|
IconSettings,
|
|
35
34
|
IconSearch,
|
|
36
35
|
} from "@tabler/icons-react";
|
|
@@ -304,12 +303,6 @@ export function LibraryLayout({ children }: LibraryLayoutProps) {
|
|
|
304
303
|
icon: React.ComponentType<{ className?: string }>;
|
|
305
304
|
match: (path: string) => boolean;
|
|
306
305
|
}[] = [
|
|
307
|
-
{
|
|
308
|
-
to: "/agent",
|
|
309
|
-
label: t("settings.agentTitle"),
|
|
310
|
-
icon: IconHierarchy2,
|
|
311
|
-
match: (p) => p.startsWith("/agent"),
|
|
312
|
-
},
|
|
313
306
|
{
|
|
314
307
|
to: "/settings",
|
|
315
308
|
label: t("navigation.settings"),
|
|
@@ -78,6 +78,7 @@ export function QuickAskSidebar({
|
|
|
78
78
|
const [open, setOpen] = useState(false);
|
|
79
79
|
const [draft, setDraft] = useState("");
|
|
80
80
|
const [history, setHistory] = useState<ChatTurn[]>([]);
|
|
81
|
+
const [pendingAsk, setPendingAsk] = useState<string | null>(null);
|
|
81
82
|
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
|
82
83
|
|
|
83
84
|
// Single global keydown listener; toggles on Cmd/Ctrl+J. Esc is handled
|
|
@@ -94,11 +95,17 @@ export function QuickAskSidebar({
|
|
|
94
95
|
return () => window.removeEventListener("keydown", onKeyDown);
|
|
95
96
|
}, []);
|
|
96
97
|
|
|
98
|
+
// The desktop pill's "Ask anything" bar hands its question over as `?ask=`
|
|
99
|
+
// alongside `?chat=1`, so the question the user typed on the overlay lands
|
|
100
|
+
// in the agent chat here instead of being retyped.
|
|
97
101
|
useEffect(() => {
|
|
98
102
|
const params = new URLSearchParams(window.location.search);
|
|
99
|
-
|
|
103
|
+
const askParam = params.get("ask")?.trim();
|
|
104
|
+
if (params.get("chat") !== "1" && !askParam) return;
|
|
100
105
|
setOpen(true);
|
|
106
|
+
if (askParam) setPendingAsk(askParam);
|
|
101
107
|
params.delete("chat");
|
|
108
|
+
params.delete("ask");
|
|
102
109
|
const nextQuery = params.toString();
|
|
103
110
|
window.history.replaceState(
|
|
104
111
|
window.history.state,
|
|
@@ -155,6 +162,12 @@ export function QuickAskSidebar({
|
|
|
155
162
|
[meetingId, meetingTitle, segments, t],
|
|
156
163
|
);
|
|
157
164
|
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
if (!pendingAsk) return;
|
|
167
|
+
setPendingAsk(null);
|
|
168
|
+
send(pendingAsk);
|
|
169
|
+
}, [pendingAsk, send]);
|
|
170
|
+
|
|
158
171
|
return (
|
|
159
172
|
<Sheet open={open} onOpenChange={setOpen}>
|
|
160
173
|
<SheetContent
|
|
@@ -16,8 +16,11 @@ import {
|
|
|
16
16
|
CartesianGrid,
|
|
17
17
|
} from "recharts";
|
|
18
18
|
|
|
19
|
+
import {
|
|
20
|
+
ViewerAvatar,
|
|
21
|
+
viewerLabel,
|
|
22
|
+
} from "@/components/player/recording-views-badge";
|
|
19
23
|
import { ViewedByPopover } from "@/components/sharing/viewed-by-popover";
|
|
20
|
-
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
|
21
24
|
|
|
22
25
|
export interface InsightsPanelProps {
|
|
23
26
|
recordingId: string;
|
|
@@ -152,20 +155,13 @@ export function InsightsPanel({ recordingId, durationMs }: InsightsPanelProps) {
|
|
|
152
155
|
{viewers.slice(0, 12).map((v, i) => (
|
|
153
156
|
<div
|
|
154
157
|
key={i}
|
|
155
|
-
className="flex items-center gap-2 rounded-full border border-border bg-card
|
|
158
|
+
className="flex items-center gap-2 rounded-full border border-border bg-card pe-3 ps-0.5 py-0.5"
|
|
156
159
|
title={v.viewerEmail ?? t("recordingInsights.anonymous")}
|
|
157
160
|
>
|
|
158
|
-
<
|
|
159
|
-
<AvatarFallback className="text-[10px] bg-primary text-primary-foreground">
|
|
160
|
-
{initials(v.viewerName || v.viewerEmail || "?")}
|
|
161
|
-
</AvatarFallback>
|
|
162
|
-
</Avatar>
|
|
161
|
+
<ViewerAvatar viewer={v} />
|
|
163
162
|
<span className="text-xs">
|
|
164
|
-
{v.
|
|
165
|
-
|
|
166
|
-
? v.viewerEmail.split("@")[0]
|
|
167
|
-
: t("recordingInsights.anon"))}
|
|
168
|
-
<span className="text-muted-foreground ml-1">
|
|
163
|
+
{viewerLabel(v, t("recordingInsights.anonymous"))}
|
|
164
|
+
<span className="text-muted-foreground ms-1">
|
|
169
165
|
{Math.round(v.completedPct)}%
|
|
170
166
|
</span>
|
|
171
167
|
</span>
|
|
@@ -207,14 +203,6 @@ function Stat({
|
|
|
207
203
|
);
|
|
208
204
|
}
|
|
209
205
|
|
|
210
|
-
function initials(s: string): string {
|
|
211
|
-
return s
|
|
212
|
-
.split(/\s+|@/)
|
|
213
|
-
.slice(0, 2)
|
|
214
|
-
.map((p) => p[0]?.toUpperCase() ?? "")
|
|
215
|
-
.join("");
|
|
216
|
-
}
|
|
217
|
-
|
|
218
206
|
function msCompact(ms: number): string {
|
|
219
207
|
const s = Math.floor(ms / 1000);
|
|
220
208
|
const m = Math.floor(s / 60);
|