@agent-native/core 0.98.0 → 0.98.2
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 +32 -0
- package/corpus/core/docs/content/locales/ar-SA/pr-visual-recap.mdx +25 -1
- package/corpus/core/docs/content/locales/ar-SA/template-plan.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/pr-visual-recap.mdx +25 -1
- package/corpus/core/docs/content/locales/de-DE/template-plan.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/pr-visual-recap.mdx +25 -1
- package/corpus/core/docs/content/locales/es-ES/template-plan.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/pr-visual-recap.mdx +25 -1
- package/corpus/core/docs/content/locales/fr-FR/template-plan.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/pr-visual-recap.mdx +25 -1
- package/corpus/core/docs/content/locales/hi-IN/template-plan.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/pr-visual-recap.mdx +25 -1
- package/corpus/core/docs/content/locales/ja-JP/template-plan.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/pr-visual-recap.mdx +25 -1
- package/corpus/core/docs/content/locales/ko-KR/template-plan.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/pr-visual-recap.mdx +25 -1
- package/corpus/core/docs/content/locales/pt-BR/template-plan.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/pr-visual-recap.mdx +25 -1
- package/corpus/core/docs/content/locales/zh-CN/template-plan.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/pr-visual-recap.mdx +25 -1
- package/corpus/core/docs/content/locales/zh-TW/template-plan.mdx +1 -1
- package/corpus/core/docs/content/pr-visual-recap.mdx +50 -1
- package/corpus/core/docs/content/template-plan.mdx +1 -1
- package/corpus/core/package.json +2 -2
- package/corpus/core/src/action-change-marker.ts +8 -1
- package/corpus/core/src/changelog/parse.ts +8 -3
- package/corpus/core/src/cli/plan-local.ts +43 -11
- package/corpus/core/src/cli/pr-visual-recap-workflow.ts +2 -9
- package/corpus/core/src/cli/recap.ts +356 -4
- package/corpus/core/src/cli/skills-content/local-files.ts +17 -12
- package/corpus/core/src/client/AgentPanel.tsx +2 -3
- package/corpus/core/src/client/AssistantChat.tsx +83 -39
- package/corpus/core/src/client/analytics.ts +125 -14
- package/corpus/core/src/client/blocks/library/wireframe-kit.tsx +16 -2
- package/corpus/core/src/client/chat-model-groups.ts +28 -0
- package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +442 -85
- package/corpus/core/src/client/composer/TiptapComposer.tsx +46 -29
- package/corpus/core/src/client/composer/VoiceButton.tsx +2 -1
- package/corpus/core/src/client/composer/index.ts +5 -0
- package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +1206 -67
- package/corpus/core/src/client/index.ts +10 -0
- package/corpus/core/src/client/progress/RunsTray.tsx +13 -1
- package/corpus/core/src/client/session-replay.ts +10 -0
- package/corpus/core/src/client/settings/DemoModeSection.tsx +4 -28
- package/corpus/core/src/client/settings/SecretsSection.tsx +387 -266
- package/corpus/core/src/client/settings/SettingsPanel.tsx +117 -38
- package/corpus/core/src/client/url-scrub.ts +13 -0
- package/corpus/core/src/client/use-action.ts +12 -0
- package/corpus/core/src/client/use-agent-chat-home-handoff.ts +8 -1
- package/corpus/core/src/client/use-agent-engine-configured.ts +17 -3
- package/corpus/core/src/client/use-db-sync.ts +84 -34
- package/corpus/core/src/client/use-demo-mode-status.ts +44 -0
- package/corpus/core/src/client/use-pausing-interval.ts +14 -4
- package/corpus/core/src/integrations/scope-store.ts +1 -1
- package/corpus/core/src/integrations/usage-budget-store.ts +1 -1
- package/corpus/core/src/localization/default-messages.ts +44 -1
- package/corpus/core/src/mcp-client/workspace-servers.ts +4 -4
- package/corpus/core/src/secrets/crypto.ts +28 -8
- package/corpus/core/src/server/action-change.ts +5 -1
- package/corpus/core/src/server/action-routes.ts +8 -0
- package/corpus/core/src/server/poll.ts +1 -0
- package/corpus/core/src/server/realtime-voice.ts +299 -13
- package/corpus/core/src/styles/agent-native.css +2 -2
- package/corpus/core/src/templates/default/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +7 -3
- package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -9
- package/corpus/core/src/vite/client.ts +9 -1
- package/corpus/templates/analytics/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/analytics/.agents/skills/session-replay/SKILL.md +10 -5
- package/corpus/templates/analytics/AGENTS.md +17 -13
- package/corpus/templates/analytics/actions/navigate.ts +59 -5
- package/corpus/templates/analytics/actions/view-screen.ts +3 -6
- package/corpus/templates/analytics/app/components/ProviderCorpusJobNotifier.tsx +20 -3
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +20 -5
- package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -1
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +21 -6
- package/corpus/templates/analytics/app/global.css +19 -20
- package/corpus/templates/analytics/app/lib/demo-chart-trend.ts +156 -0
- package/corpus/templates/analytics/app/lib/provider-corpus-job-sync.ts +26 -0
- package/corpus/templates/analytics/app/pages/Settings.tsx +35 -341
- package/corpus/templates/analytics/app/pages/monitoring/ErrorsPanel.tsx +38 -7
- package/corpus/templates/analytics/app/pages/monitoring/MonitoringPage.tsx +1 -1
- package/corpus/templates/analytics/app/pages/monitoring/errors/i18n.ts +3 -0
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +333 -272
- package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +72 -17
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +297 -108
- package/corpus/templates/analytics/app/root.tsx +28 -8
- package/corpus/templates/analytics/changelog/2026-06-24-first-party-signup-and-pageview-panels-now-honor-dashboard-filters.md +2 -1
- package/corpus/templates/analytics/changelog/2026-06-25-referrer-dashboard-panels-show-external-domains.md +2 -1
- package/corpus/templates/analytics/changelog/2026-07-06-mobile-chat-header-is-more-compact-and-the-menu-button-opens-navigation.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-08-dashboard-history-and-chat-context.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-08-settings-are-cleaner-searchable-and-alerts-have-their-own-tab.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-08-sidebar-sections-stay-collapsed-until-opened.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-11-analytics-no-longer-repeatedly-restarts-background-requests-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-analytics-only-asks-for-replay-storage-when-you-enable-sessi.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-charts-now-show-their-loading-skeleton-while-refreshing.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-realtime-voice-now-shows-a-clear-connection-indicator-comple.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-replay-event-counts-stay-hidden-until-recordings-finish-load.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-replay-storage-key-mismatches-show-actionable-setup-guidance.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-replay-timelines-group-continuous-scrolling-and-dev-tools-co.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-filters-now-stay-compact-in-a-settings-menu-at-mediu.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replay-console-errors-now-link-to-matching-issues-or.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replays-load-large-recordings-faster-and-surface-fai.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replays-preserve-recorded-styles-and-viewport-layout.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replays-stay-centered-instead-of-clipping-wide-recor.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-12-daily-dashboard-emails-reliably-include-the-complete-dashboa.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-12-demo-mode-charts-trend-upward.md +6 -0
- package/corpus/templates/analytics/package.json +1 -1
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +1 -303
- package/corpus/templates/analytics/server/handlers/session-replay.ts +57 -0
- package/corpus/templates/analytics/server/jobs/dashboard-report.ts +2 -0
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +1 -1
- package/corpus/templates/analytics/server/lib/dashboard-report.ts +17 -33
- package/corpus/templates/analytics/server/lib/demo-dashboards.ts +16 -3
- package/corpus/templates/analytics/server/lib/session-replay-agent-context.ts +12 -0
- package/corpus/templates/analytics/server/lib/session-replay.ts +208 -2
- package/corpus/templates/analytics/server/plugins/onboarding.ts +7 -79
- package/corpus/templates/analytics/server/routes/api/session-replay/recordings/[recordingId]/chunks.get.ts +1 -0
- package/corpus/templates/assets/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/assets/app/global.css +4 -4
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +0 -1
- package/corpus/templates/assets/app/routes/library.tsx +0 -1
- package/corpus/templates/brain/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/brain/app/global.css +5 -5
- package/corpus/templates/brain/app/root.tsx +0 -3
- package/corpus/templates/calendar/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/calendar/app/root.tsx +1 -0
- package/corpus/templates/chat/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/clips/app/components/player/video-player.tsx +5 -1
- package/corpus/templates/clips/app/hooks/use-auto-title.ts +74 -8
- package/corpus/templates/clips/app/hooks/use-library.ts +12 -25
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +20 -22
- package/corpus/templates/clips/changelog/2026-07-11-clips-no-longer-stay-stuck-on-preparing-clip-when-they-are-r.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-generated-titles-no-longer-cause-continuous-background-refreshes.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-s3-storage-setup-stays-collapsed-until-you-choose-it-as-the-.md +6 -0
- package/corpus/templates/content/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +2 -2
- package/corpus/templates/content/app/hooks/use-comments.ts +0 -1
- package/corpus/templates/content/changelog/2026-07-11-comments-now-update-from-live-collaboration-events-without-c.md +6 -0
- package/corpus/templates/content/changelog/2026-07-12-the-left-sidebar-stays-fixed-horizontally-while-scrolling-on.md +6 -0
- package/corpus/templates/design/app/components/layout/Header.tsx +1 -1
- package/corpus/templates/forms/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +1 -2
- package/corpus/templates/macros/app/root.tsx +0 -3
- package/corpus/templates/mail/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/mail/app/hooks/use-compose-state.ts +1 -0
- package/corpus/templates/mail/app/root.tsx +1 -12
- package/corpus/templates/plan/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/plan/.agents/skills/visual-plan/references/local-files.md +17 -12
- package/corpus/templates/plan/.agents/skills/visual-recap/references/local-files.md +17 -12
- package/corpus/templates/plan/actions/validate-local-plan-source.ts +4 -4
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +2 -1
- package/corpus/templates/plan/app/hooks/use-navigation-state.ts +5 -2
- package/corpus/templates/plan/app/hooks/use-plans.ts +6 -13
- package/corpus/templates/plan/app/lib/plan-local-bridge.ts +41 -0
- package/corpus/templates/plan/app/lib/plan-tracking.ts +3 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +14 -36
- package/corpus/templates/plan/app/root.tsx +13 -3
- package/corpus/templates/plan/changelog/2026-07-11-plan-refreshes-only-when-content-changes.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-12-local-plan-source-now-stays-on-device.md +6 -0
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +4 -1
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +1 -1
- package/corpus/templates/slides/app/components/layout/Header.tsx +1 -1
- package/corpus/templates/slides/app/context/DeckContext.tsx +1 -0
- package/corpus/templates/slides/app/hooks/use-slide-comments.ts +7 -31
- package/corpus/templates/slides/changelog/2026-07-11-comments-now-update-from-live-collaboration-events-without-c.md +6 -0
- package/dist/action-change-marker.d.ts +1 -0
- package/dist/action-change-marker.d.ts.map +1 -1
- package/dist/action-change-marker.js +7 -1
- package/dist/action-change-marker.js.map +1 -1
- package/dist/changelog/parse.d.ts +4 -2
- package/dist/changelog/parse.d.ts.map +1 -1
- package/dist/changelog/parse.js +5 -3
- package/dist/changelog/parse.js.map +1 -1
- package/dist/cli/plan-local.d.ts +6 -6
- package/dist/cli/plan-local.d.ts.map +1 -1
- package/dist/cli/plan-local.js +36 -7
- package/dist/cli/plan-local.js.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.d.ts +2 -8
- package/dist/cli/pr-visual-recap-workflow.d.ts.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.js +2 -8
- package/dist/cli/pr-visual-recap-workflow.js.map +1 -1
- package/dist/cli/recap.d.ts +22 -1
- package/dist/cli/recap.d.ts.map +1 -1
- package/dist/cli/recap.js +286 -2
- package/dist/cli/recap.js.map +1 -1
- package/dist/cli/skills-content/local-files.d.ts +1 -1
- package/dist/cli/skills-content/local-files.d.ts.map +1 -1
- package/dist/cli/skills-content/local-files.js +17 -12
- package/dist/cli/skills-content/local-files.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +2 -3
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +7 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +62 -40
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/analytics.d.ts +8 -0
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +103 -13
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/blocks/library/wireframe-kit.d.ts +2 -0
- package/dist/client/blocks/library/wireframe-kit.d.ts.map +1 -1
- package/dist/client/blocks/library/wireframe-kit.js +9 -2
- package/dist/client/blocks/library/wireframe-kit.js.map +1 -1
- package/dist/client/chat-model-groups.d.ts.map +1 -1
- package/dist/client/chat-model-groups.js +24 -0
- package/dist/client/chat-model-groups.js.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts +40 -4
- package/dist/client/composer/RealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.js +172 -42
- package/dist/client/composer/RealtimeVoiceMode.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts +4 -0
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +47 -29
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/VoiceButton.d.ts.map +1 -1
- package/dist/client/composer/VoiceButton.js +2 -2
- package/dist/client/composer/VoiceButton.js.map +1 -1
- package/dist/client/composer/index.d.ts +2 -2
- package/dist/client/composer/index.d.ts.map +1 -1
- package/dist/client/composer/index.js +1 -1
- package/dist/client/composer/index.js.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.d.ts +100 -3
- package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.js +952 -51
- package/dist/client/composer/useRealtimeVoiceMode.js.map +1 -1
- package/dist/client/index.d.ts +3 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/progress/RunsTray.d.ts.map +1 -1
- package/dist/client/progress/RunsTray.js +10 -1
- package/dist/client/progress/RunsTray.js.map +1 -1
- package/dist/client/session-replay.d.ts +2 -0
- package/dist/client/session-replay.d.ts.map +1 -1
- package/dist/client/session-replay.js +7 -0
- package/dist/client/session-replay.js.map +1 -1
- package/dist/client/settings/DemoModeSection.d.ts.map +1 -1
- package/dist/client/settings/DemoModeSection.js +4 -23
- package/dist/client/settings/DemoModeSection.js.map +1 -1
- package/dist/client/settings/SecretsSection.d.ts +2 -3
- package/dist/client/settings/SecretsSection.d.ts.map +1 -1
- package/dist/client/settings/SecretsSection.js +46 -22
- package/dist/client/settings/SecretsSection.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts +9 -0
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +46 -12
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/url-scrub.d.ts.map +1 -1
- package/dist/client/url-scrub.js +14 -0
- package/dist/client/url-scrub.js.map +1 -1
- package/dist/client/use-action.d.ts +2 -0
- package/dist/client/use-action.d.ts.map +1 -1
- package/dist/client/use-action.js +10 -0
- package/dist/client/use-action.js.map +1 -1
- package/dist/client/use-agent-chat-home-handoff.d.ts +2 -0
- package/dist/client/use-agent-chat-home-handoff.d.ts.map +1 -1
- package/dist/client/use-agent-chat-home-handoff.js +7 -1
- package/dist/client/use-agent-chat-home-handoff.js.map +1 -1
- package/dist/client/use-agent-engine-configured.d.ts.map +1 -1
- package/dist/client/use-agent-engine-configured.js +17 -3
- package/dist/client/use-agent-engine-configured.js.map +1 -1
- package/dist/client/use-db-sync.d.ts +8 -2
- package/dist/client/use-db-sync.d.ts.map +1 -1
- package/dist/client/use-db-sync.js +57 -32
- package/dist/client/use-db-sync.js.map +1 -1
- package/dist/client/use-demo-mode-status.d.ts +12 -0
- package/dist/client/use-demo-mode-status.d.ts.map +1 -0
- package/dist/client/use-demo-mode-status.js +30 -0
- package/dist/client/use-demo-mode-status.js.map +1 -0
- package/dist/client/use-pausing-interval.d.ts.map +1 -1
- package/dist/client/use-pausing-interval.js +16 -4
- package/dist/client/use-pausing-interval.js.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/integrations/scope-store.js +1 -1
- package/dist/integrations/scope-store.js.map +1 -1
- package/dist/integrations/usage-budget-store.js +1 -1
- package/dist/integrations/usage-budget-store.js.map +1 -1
- package/dist/localization/default-messages.d.ts +41 -1
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +41 -1
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp-client/workspace-servers.js +4 -4
- package/dist/mcp-client/workspace-servers.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- 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/crypto.d.ts +7 -6
- package/dist/secrets/crypto.d.ts.map +1 -1
- package/dist/secrets/crypto.js +30 -11
- package/dist/secrets/crypto.js.map +1 -1
- package/dist/server/action-change.d.ts +1 -0
- package/dist/server/action-change.d.ts.map +1 -1
- package/dist/server/action-change.js +4 -1
- package/dist/server/action-change.js.map +1 -1
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +5 -0
- package/dist/server/action-routes.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/poll.d.ts.map +1 -1
- package/dist/server/poll.js +1 -0
- package/dist/server/poll.js.map +1 -1
- package/dist/server/realtime-voice.d.ts +7 -0
- package/dist/server/realtime-voice.d.ts.map +1 -1
- package/dist/server/realtime-voice.js +222 -12
- package/dist/server/realtime-voice.js.map +1 -1
- package/dist/styles/agent-native.css +2 -2
- package/dist/templates/default/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/dist/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +7 -3
- package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -9
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +6 -1
- package/dist/vite/client.js.map +1 -1
- package/docs/content/locales/ar-SA/pr-visual-recap.mdx +25 -1
- package/docs/content/locales/ar-SA/template-plan.mdx +1 -1
- package/docs/content/locales/de-DE/pr-visual-recap.mdx +25 -1
- package/docs/content/locales/de-DE/template-plan.mdx +1 -1
- package/docs/content/locales/es-ES/pr-visual-recap.mdx +25 -1
- package/docs/content/locales/es-ES/template-plan.mdx +1 -1
- package/docs/content/locales/fr-FR/pr-visual-recap.mdx +25 -1
- package/docs/content/locales/fr-FR/template-plan.mdx +1 -1
- package/docs/content/locales/hi-IN/pr-visual-recap.mdx +25 -1
- package/docs/content/locales/hi-IN/template-plan.mdx +1 -1
- package/docs/content/locales/ja-JP/pr-visual-recap.mdx +25 -1
- package/docs/content/locales/ja-JP/template-plan.mdx +1 -1
- package/docs/content/locales/ko-KR/pr-visual-recap.mdx +25 -1
- package/docs/content/locales/ko-KR/template-plan.mdx +1 -1
- package/docs/content/locales/pt-BR/pr-visual-recap.mdx +25 -1
- package/docs/content/locales/pt-BR/template-plan.mdx +1 -1
- package/docs/content/locales/zh-CN/pr-visual-recap.mdx +25 -1
- package/docs/content/locales/zh-CN/template-plan.mdx +1 -1
- package/docs/content/locales/zh-TW/pr-visual-recap.mdx +25 -1
- package/docs/content/locales/zh-TW/template-plan.mdx +1 -1
- package/docs/content/pr-visual-recap.mdx +50 -1
- package/docs/content/template-plan.mdx +1 -1
- package/package.json +2 -2
- package/src/templates/default/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +7 -3
- package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -9
|
@@ -42,6 +42,13 @@ export type ConfigureTrackingOptions = {
|
|
|
42
42
|
/** First-party analytics track endpoint. */
|
|
43
43
|
endpoint?: string;
|
|
44
44
|
getDefaultProps?: GetDefaultProps;
|
|
45
|
+
/**
|
|
46
|
+
* Disable content-capturing analytics such as interaction autocapture and
|
|
47
|
+
* session replay while retaining pageviews, explicit events, and Sentry.
|
|
48
|
+
*/
|
|
49
|
+
contentCapture?: boolean;
|
|
50
|
+
/** Resolve content capture synchronously for each browser pathname. */
|
|
51
|
+
contentCaptureForPath?: (pathname: string) => boolean;
|
|
45
52
|
sessionReplay?: boolean | SessionReplayOptions;
|
|
46
53
|
/**
|
|
47
54
|
* First-party, Sentry-style error capture. Auto-captures uncaught errors
|
|
@@ -124,6 +131,7 @@ export declare function captureClientException(error: unknown, context?: ClientC
|
|
|
124
131
|
*/
|
|
125
132
|
export declare function captureError(error: unknown, context?: ClientCaptureContext): string | undefined;
|
|
126
133
|
export declare function configureTracking(options: ConfigureTrackingOptions): void;
|
|
134
|
+
export declare function setTrackingContentCaptureEnabled(enabled: boolean): void;
|
|
127
135
|
export declare function startSessionReplay(options?: SessionReplayOptions): Promise<SessionReplayStartResult>;
|
|
128
136
|
export declare function maybeStartSessionReplay(options?: SessionReplayOptions): Promise<SessionReplayStartResult>;
|
|
129
137
|
export declare function stopSessionReplay(reason?: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/client/analytics.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,2BAA2B,EAC3B,2BAA2B,EAC3B,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,IAAI,CAAC,EAAE,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-25,6 +25,8 @@ let _sessionReplayStartPromise = null;
|
|
|
25
25
|
let _errorCaptureInstalled = false;
|
|
26
26
|
let _errorCaptureDisposer = null;
|
|
27
27
|
let _sessionReplayModuleForCapture = null;
|
|
28
|
+
let _trackingContentCaptureEnabled = true;
|
|
29
|
+
let _contentCaptureForPath = null;
|
|
28
30
|
// Buffer for setSentryUser calls made before Sentry has initialized.
|
|
29
31
|
// `undefined` means "no pending update"; `null` means "pending clear".
|
|
30
32
|
let _pendingSentryUser = undefined;
|
|
@@ -439,7 +441,10 @@ function ensureAmplitude() {
|
|
|
439
441
|
?.VITE_AMPLITUDE_API_KEY;
|
|
440
442
|
if (!key)
|
|
441
443
|
return false;
|
|
442
|
-
|
|
444
|
+
// Standard pageviews and explicit events are emitted below. Keep SDK-level
|
|
445
|
+
// DOM/network autocapture off so rendered user content is never collected as
|
|
446
|
+
// an implicit analytics side effect.
|
|
447
|
+
amplitude.init(key, { autocapture: false });
|
|
443
448
|
_amplitudeInitialized = true;
|
|
444
449
|
return true;
|
|
445
450
|
}
|
|
@@ -467,11 +472,37 @@ function isAgentNativeDocsUrl(url) {
|
|
|
467
472
|
return false;
|
|
468
473
|
}
|
|
469
474
|
}
|
|
475
|
+
function isSessionReplayUrl(url) {
|
|
476
|
+
if (!url)
|
|
477
|
+
return false;
|
|
478
|
+
try {
|
|
479
|
+
const parsed = new URL(url);
|
|
480
|
+
return /^\/sessions\/[^/]+\/?$/.test(parsed.pathname);
|
|
481
|
+
}
|
|
482
|
+
catch {
|
|
483
|
+
return false;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
470
486
|
function shouldDropBrowserSentryNoise(event) {
|
|
471
487
|
const exceptionValues = event.exception?.values ?? [];
|
|
472
488
|
const taggedUrl = typeof event.tags?.url === "string" ? event.tags.url : undefined;
|
|
473
489
|
const requestUrl = (event.request?.url ?? taggedUrl ?? "").toLowerCase();
|
|
474
490
|
const isDocsPage = isAgentNativeDocsUrl(requestUrl);
|
|
491
|
+
// rrweb 2.1.0 replays recorded media interactions with `void media.play()`.
|
|
492
|
+
// Browsers may reject that promise when the recorded media was unmuted and
|
|
493
|
+
// no user activation is still active, which becomes a source-less unhandled
|
|
494
|
+
// rejection even though the replay player keeps working. Keep this scoped to
|
|
495
|
+
// the replay detail route and the exact browser autoplay-policy message.
|
|
496
|
+
if (isSessionReplayUrl(requestUrl) &&
|
|
497
|
+
exceptionValues.some((value) => {
|
|
498
|
+
const exceptionValue = String(value.value ?? "")
|
|
499
|
+
.trim()
|
|
500
|
+
.toLowerCase();
|
|
501
|
+
return (exceptionValue.includes("notallowederror: play() failed") &&
|
|
502
|
+
exceptionValue.includes("user didn't interact with the document first"));
|
|
503
|
+
})) {
|
|
504
|
+
return true;
|
|
505
|
+
}
|
|
475
506
|
// AgentAutoContinueSignal is a control-flow sentinel thrown to bubble
|
|
476
507
|
// out of the SSE stream parser when the agent run needs to be
|
|
477
508
|
// auto-continued. It's caught by the chat adapter and is never a real
|
|
@@ -684,7 +715,9 @@ export function setSentryUser(user, orgId) {
|
|
|
684
715
|
clearTrackingIdentity();
|
|
685
716
|
}
|
|
686
717
|
_trackingIdentityResolved = true;
|
|
687
|
-
if (shouldRetryReplay &&
|
|
718
|
+
if (shouldRetryReplay &&
|
|
719
|
+
_trackingContentCaptureEnabled &&
|
|
720
|
+
_sessionReplayOptions?.requireSignedInUser) {
|
|
688
721
|
void startConfiguredSessionReplay(_sessionReplayOptions);
|
|
689
722
|
}
|
|
690
723
|
if (_sentryInitialized) {
|
|
@@ -769,6 +802,11 @@ export function configureTracking(options) {
|
|
|
769
802
|
if (options.getDefaultProps) {
|
|
770
803
|
_getDefaultProps = options.getDefaultProps;
|
|
771
804
|
}
|
|
805
|
+
_contentCaptureForPath = options.contentCaptureForPath ?? null;
|
|
806
|
+
_trackingContentCaptureEnabled =
|
|
807
|
+
_contentCaptureForPath && typeof window !== "undefined"
|
|
808
|
+
? _contentCaptureForPath(window.location.pathname)
|
|
809
|
+
: options.contentCapture !== false;
|
|
772
810
|
if (typeof window !== "undefined") {
|
|
773
811
|
ensureSentry();
|
|
774
812
|
ensureAmplitude();
|
|
@@ -779,10 +817,28 @@ export function configureTracking(options) {
|
|
|
779
817
|
maybeInstallSessionReplay(options.sessionReplay, {
|
|
780
818
|
endpoint: options.endpoint,
|
|
781
819
|
publicKey,
|
|
782
|
-
});
|
|
820
|
+
}, _trackingContentCaptureEnabled);
|
|
783
821
|
maybeInstallErrorCapture(options.errorCapture);
|
|
784
822
|
}
|
|
785
823
|
}
|
|
824
|
+
export function setTrackingContentCaptureEnabled(enabled) {
|
|
825
|
+
if (_trackingContentCaptureEnabled === enabled)
|
|
826
|
+
return;
|
|
827
|
+
_trackingContentCaptureEnabled = enabled;
|
|
828
|
+
if (enabled) {
|
|
829
|
+
if (_sessionReplayOptions) {
|
|
830
|
+
void startConfiguredSessionReplay(_sessionReplayOptions);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
else {
|
|
834
|
+
void stopSessionReplay("content-capture-disabled");
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
function syncTrackingContentCaptureForLocation() {
|
|
838
|
+
if (!_contentCaptureForPath)
|
|
839
|
+
return;
|
|
840
|
+
setTrackingContentCaptureEnabled(_contentCaptureForPath(window.location.pathname));
|
|
841
|
+
}
|
|
786
842
|
/**
|
|
787
843
|
* Lazily load the session-replay module so error capture can read the active
|
|
788
844
|
* replay id and surface manual captures on the replay timeline without a
|
|
@@ -977,13 +1033,13 @@ function replayEndpointFromTrackingEndpoint(value) {
|
|
|
977
1033
|
}
|
|
978
1034
|
return undefined;
|
|
979
1035
|
}
|
|
980
|
-
function maybeInstallSessionReplay(config, tracking) {
|
|
1036
|
+
function maybeInstallSessionReplay(config, tracking, start = true) {
|
|
981
1037
|
if (typeof window === "undefined")
|
|
982
1038
|
return;
|
|
983
1039
|
const options = configuredSessionReplayOptions(config, tracking);
|
|
984
|
-
if (!options)
|
|
985
|
-
return;
|
|
986
1040
|
_sessionReplayOptions = options;
|
|
1041
|
+
if (!options || !start)
|
|
1042
|
+
return;
|
|
987
1043
|
void startConfiguredSessionReplay(options);
|
|
988
1044
|
}
|
|
989
1045
|
async function waitForSessionReplayAuthIfRequired(options) {
|
|
@@ -1008,11 +1064,23 @@ async function startConfiguredSessionReplay(options) {
|
|
|
1008
1064
|
if (_sessionReplayStartPromise)
|
|
1009
1065
|
return _sessionReplayStartPromise;
|
|
1010
1066
|
_sessionReplayStartPromise = (async () => {
|
|
1067
|
+
if (!_trackingContentCaptureEnabled) {
|
|
1068
|
+
return { started: false, reason: "disabled" };
|
|
1069
|
+
}
|
|
1011
1070
|
if (!(await waitForSessionReplayAuthIfRequired(options))) {
|
|
1012
1071
|
return { started: false, reason: "missing-user-id" };
|
|
1013
1072
|
}
|
|
1073
|
+
if (!_trackingContentCaptureEnabled) {
|
|
1074
|
+
return { started: false, reason: "disabled" };
|
|
1075
|
+
}
|
|
1014
1076
|
const mod = await import("./session-replay.js");
|
|
1015
|
-
|
|
1077
|
+
if (!_trackingContentCaptureEnabled) {
|
|
1078
|
+
return { started: false, reason: "disabled" };
|
|
1079
|
+
}
|
|
1080
|
+
return mod.startSessionReplay({
|
|
1081
|
+
...options,
|
|
1082
|
+
shouldStart: () => _trackingContentCaptureEnabled && (options.shouldStart?.() ?? true),
|
|
1083
|
+
});
|
|
1016
1084
|
})()
|
|
1017
1085
|
.catch(() => ({ started: false, reason: "import-failed" }))
|
|
1018
1086
|
.finally(() => {
|
|
@@ -1021,20 +1089,32 @@ async function startConfiguredSessionReplay(options) {
|
|
|
1021
1089
|
return _sessionReplayStartPromise;
|
|
1022
1090
|
}
|
|
1023
1091
|
export async function startSessionReplay(options = {}) {
|
|
1092
|
+
if (!_trackingContentCaptureEnabled) {
|
|
1093
|
+
return { started: false, reason: "disabled" };
|
|
1094
|
+
}
|
|
1024
1095
|
const configured = configuredSessionReplayOptions(options) ?? options;
|
|
1025
1096
|
if (!(await waitForSessionReplayAuthIfRequired(configured))) {
|
|
1026
1097
|
return { started: false, reason: "missing-user-id" };
|
|
1027
1098
|
}
|
|
1028
1099
|
const mod = await import("./session-replay.js");
|
|
1029
|
-
return mod.startSessionReplay(
|
|
1100
|
+
return mod.startSessionReplay({
|
|
1101
|
+
...configured,
|
|
1102
|
+
shouldStart: () => _trackingContentCaptureEnabled && (configured.shouldStart?.() ?? true),
|
|
1103
|
+
});
|
|
1030
1104
|
}
|
|
1031
1105
|
export async function maybeStartSessionReplay(options = {}) {
|
|
1106
|
+
if (!_trackingContentCaptureEnabled) {
|
|
1107
|
+
return { started: false, reason: "disabled" };
|
|
1108
|
+
}
|
|
1032
1109
|
const configured = configuredSessionReplayOptions(options) ?? options;
|
|
1033
1110
|
if (!(await waitForSessionReplayAuthIfRequired(configured))) {
|
|
1034
1111
|
return { started: false, reason: "missing-user-id" };
|
|
1035
1112
|
}
|
|
1036
1113
|
const mod = await import("./session-replay.js");
|
|
1037
|
-
return mod.maybeStartSessionReplay(
|
|
1114
|
+
return mod.maybeStartSessionReplay({
|
|
1115
|
+
...configured,
|
|
1116
|
+
shouldStart: () => _trackingContentCaptureEnabled && (configured.shouldStart?.() ?? true),
|
|
1117
|
+
});
|
|
1038
1118
|
}
|
|
1039
1119
|
export async function stopSessionReplay(reason = "manual") {
|
|
1040
1120
|
const mod = await import("./session-replay.js");
|
|
@@ -1083,15 +1163,17 @@ function pageviewKey() {
|
|
|
1083
1163
|
}
|
|
1084
1164
|
function pageviewProperties(reason) {
|
|
1085
1165
|
const properties = {
|
|
1086
|
-
url:
|
|
1166
|
+
url: !_trackingContentCaptureEnabled
|
|
1167
|
+
? window.location.origin + window.location.pathname
|
|
1168
|
+
: scrubUrl(window.location.href),
|
|
1087
1169
|
path: window.location.pathname,
|
|
1088
1170
|
hostname: window.location.hostname,
|
|
1089
1171
|
navigation_type: reason,
|
|
1090
1172
|
};
|
|
1091
|
-
if (window.location.search) {
|
|
1173
|
+
if (_trackingContentCaptureEnabled && window.location.search) {
|
|
1092
1174
|
properties.search = scrubUrl(window.location.search);
|
|
1093
1175
|
}
|
|
1094
|
-
if (typeof document !== "undefined") {
|
|
1176
|
+
if (_trackingContentCaptureEnabled && typeof document !== "undefined") {
|
|
1095
1177
|
if (document.referrer) {
|
|
1096
1178
|
properties.referrer = scrubUrl(document.referrer);
|
|
1097
1179
|
}
|
|
@@ -1112,6 +1194,9 @@ function emitPageview(reason) {
|
|
|
1112
1194
|
trackEvent("pageview", pageviewProperties(reason));
|
|
1113
1195
|
}
|
|
1114
1196
|
function schedulePageview(reason) {
|
|
1197
|
+
if (!_trackingContentCaptureEnabled) {
|
|
1198
|
+
void stopSessionReplay("local-plan-privacy");
|
|
1199
|
+
}
|
|
1115
1200
|
const run = () => emitPageview(reason);
|
|
1116
1201
|
const pendingStartupContext = [];
|
|
1117
1202
|
if (_llmConnectionRefresh && !_llmConnectionStatus) {
|
|
@@ -1141,15 +1226,20 @@ function installPageviewTracking() {
|
|
|
1141
1226
|
const originalReplaceState = window.history.replaceState;
|
|
1142
1227
|
window.history.pushState = function pushState(...args) {
|
|
1143
1228
|
const result = originalPushState.apply(this, args);
|
|
1229
|
+
syncTrackingContentCaptureForLocation();
|
|
1144
1230
|
schedulePageview("pushState");
|
|
1145
1231
|
return result;
|
|
1146
1232
|
};
|
|
1147
1233
|
window.history.replaceState = function replaceState(...args) {
|
|
1148
1234
|
const result = originalReplaceState.apply(this, args);
|
|
1235
|
+
syncTrackingContentCaptureForLocation();
|
|
1149
1236
|
schedulePageview("replaceState");
|
|
1150
1237
|
return result;
|
|
1151
1238
|
};
|
|
1152
|
-
window.addEventListener("popstate", () =>
|
|
1239
|
+
window.addEventListener("popstate", () => {
|
|
1240
|
+
syncTrackingContentCaptureForLocation();
|
|
1241
|
+
schedulePageview("popstate");
|
|
1242
|
+
});
|
|
1153
1243
|
}
|
|
1154
1244
|
function sendAgentNativeAnalytics(name, properties) {
|
|
1155
1245
|
if (isLocalAnalyticsHostname(window.location.hostname))
|