@agent-native/core 0.128.4 → 0.129.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +90 -0
- package/corpus/core/docs/content/template-design-collaboration-and-full-apps.mdx +3 -1
- package/corpus/core/package.json +6 -3
- package/corpus/core/src/a2a/client.ts +18 -4
- package/corpus/core/src/a2a/server.ts +19 -3
- package/corpus/core/src/a2a/types.ts +7 -0
- package/corpus/core/src/action.ts +43 -16
- package/corpus/core/src/agent/engine/ai-sdk-engine.ts +14 -10
- package/corpus/core/src/agent/production-agent.ts +41 -3
- package/corpus/core/src/agent/thread-data-builder.ts +5 -0
- package/corpus/core/src/chat-threads/migrations.ts +53 -0
- package/corpus/core/src/cli/create.ts +4 -0
- package/corpus/core/src/cli/skills-content/design-visual-edit-skill.ts +36 -16
- package/corpus/core/src/cli/skills.ts +16 -0
- package/corpus/core/src/client/AgentPanel.tsx +9 -5
- package/corpus/core/src/client/AssistantChat.tsx +138 -46
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +16 -10
- package/corpus/core/src/client/agent-chat-adapter.ts +21 -3
- package/corpus/core/src/client/analytics.ts +159 -102
- package/corpus/core/src/client/chat/message-components.tsx +12 -5
- package/corpus/core/src/client/chat/runtime.ts +2 -1
- package/corpus/core/src/client/chat/tool-call-display.tsx +25 -2
- package/corpus/core/src/client/chat-model-groups.ts +3 -0
- package/corpus/core/src/client/client-status-requests.ts +161 -0
- package/corpus/core/src/client/org/OrgSwitcher.tsx +4 -4
- package/corpus/core/src/client/settings/VoiceTranscriptionSection.tsx +2 -2
- package/corpus/core/src/client/sse-event-processor.ts +15 -3
- package/corpus/core/src/client/use-agent-engine-configured.ts +54 -50
- package/corpus/core/src/client/use-chat-models.ts +16 -11
- package/corpus/core/src/client/use-chat-threads.ts +32 -9
- package/corpus/core/src/client/use-session.ts +4 -5
- package/corpus/core/src/db/client.ts +83 -8
- package/corpus/core/src/db/ensure-additive-columns.ts +31 -20
- package/corpus/core/src/db/migrations.ts +22 -2
- package/corpus/core/src/mcp/approval-store.ts +99 -0
- package/corpus/core/src/mcp/build-server.ts +579 -303
- package/corpus/core/src/mcp/embed-app.ts +1 -1
- package/corpus/core/src/mcp/oauth-client-metadata.ts +380 -0
- package/corpus/core/src/mcp/oauth-route.ts +57 -52
- package/corpus/core/src/mcp/screen-memory-stdio.ts +400 -378
- package/corpus/core/src/mcp/server.ts +29 -145
- package/corpus/core/src/mcp/stdio.ts +72 -80
- package/corpus/core/src/mcp-client/manager.ts +6 -10
- package/corpus/core/src/mcp-client/oauth-client.ts +127 -36
- package/corpus/core/src/mcp-client/oauth-routes.ts +16 -6
- package/corpus/core/src/mcp-client/routes.ts +6 -5
- package/corpus/core/src/server/agent-capabilities.ts +20 -0
- package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +27 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +18 -0
- package/corpus/core/src/server/transcribe-voice.ts +14 -5
- package/corpus/core/src/templates/default/.agents/skills/security/SKILL.md +13 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +5 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +18 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/analytics/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/analytics/app/components/dashboard/DashboardPanelSkeleton.tsx +1 -10
- package/corpus/templates/analytics/app/global.css +0 -31
- package/corpus/templates/analytics/app/lib/sql-query.ts +46 -20
- package/corpus/templates/analytics/changelog/2026-07-28-analytics-dashboard-loading-states-now-use-a-simpler-standar.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-28-analytics-dashboards-now-load-first-party-charts-reliably-in.md +6 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics-cache.ts +42 -16
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +4 -2
- package/corpus/templates/analytics/shared/sql-query-limits.ts +1 -0
- package/corpus/templates/assets/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/brain/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/calendar/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/chat/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/chat/README.md +0 -2
- package/corpus/templates/clips/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/clips/app/components/player/player-controls.tsx +3 -6
- package/corpus/templates/clips/app/components/player/recording-views-badge.tsx +6 -2
- package/corpus/templates/clips/app/components/sharing/share-ui.tsx +25 -10
- package/corpus/templates/clips/app/components/sharing/viewed-by-popover.tsx +28 -6
- package/corpus/templates/clips/app/lib/use-visible-avatar-url.ts +34 -0
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +6 -2
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +3 -1
- package/corpus/templates/clips/changelog/2026-07-28-copied-share-links-no-longer-leave-an-unnecessary-confirmati.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-28-playback-skip-controls-no-longer-show-overlapping-numbers.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-28-profile-avatars-now-appear-in-viewer-and-share-access-lists.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-28-public-clips-share-buttons-now-use-a-clean-text-only-label.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +14 -17
- package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +3 -1
- package/corpus/templates/clips/desktop/src/styles.css +13 -10
- package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +2 -2
- package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +36 -0
- package/corpus/templates/content/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/content/actions/_builder-cms-read-client.ts +155 -34
- package/corpus/templates/content/actions/_builder-docs-client.ts +151 -30
- package/corpus/templates/content/actions/stage-builder-source-bulk-update.ts +5 -2
- package/corpus/templates/content/app/root.tsx +35 -14
- package/corpus/templates/content/changelog/2026-07-28-builder-backed-files-media-fields-now-accept-direct-file-url.md +6 -0
- package/corpus/templates/content/changelog/2026-07-28-builder-content-reads-now-negotiate-the-newest-mcp-protocol-.md +6 -0
- package/corpus/templates/content/changelog/2026-07-28-public-content-pages-load-faster-before-the-optional-ask-sid.md +6 -0
- package/corpus/templates/design/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +36 -16
- package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +42 -3
- package/corpus/templates/design/actions/open-visual-edit.ts +2 -1
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +2 -2
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +14 -15
- package/corpus/templates/design/app/components/design/ResponsiveInteractBar.tsx +314 -0
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +88 -3
- package/corpus/templates/design/app/components/design/keyboard-shortcuts.ts +1 -1
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +7 -6
- package/corpus/templates/design/app/i18n-data.ts +56 -11
- package/corpus/templates/design/app/i18n-responsive-interact.ts +183 -0
- package/corpus/templates/design/app/lib/agent-chat.ts +60 -0
- package/corpus/templates/design/app/pages/design-editor/responsive-interact.ts +89 -0
- package/corpus/templates/design/changelog/2026-07-28-design-edits-can-be-applied-through-the-host-coding-agent-fr.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-interact-mode-can-preview-designs-in-responsive-device-sizes.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-interact-mode-now-opens-a-full-screen-responsive-preview-wit.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-show-or-hide-design-editing-chrome-with-cmd-on-apple-devices.md +2 -2
- package/corpus/templates/design/changelog/2026-07-28-visual-edit-now-always-shows-the-live-running-app-in-the-can.md +6 -0
- package/corpus/templates/dispatch/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/forms/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/macros/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/mail/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/plan/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/slides/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/tasks/.agents/skills/security/SKILL.md +13 -2
- package/corpus/toolkit/CHANGELOG.md +13 -0
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/chat-history.css +1 -2
- package/corpus/toolkit/src/composer/TiptapComposer.tsx +45 -0
- package/dist/a2a/client.d.ts +7 -0
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +8 -3
- package/dist/a2a/client.js.map +1 -1
- package/dist/a2a/server.d.ts.map +1 -1
- package/dist/a2a/server.js +18 -3
- package/dist/a2a/server.js.map +1 -1
- package/dist/a2a/types.d.ts +7 -0
- package/dist/a2a/types.d.ts.map +1 -1
- package/dist/a2a/types.js.map +1 -1
- package/dist/action.d.ts +15 -1
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +39 -16
- package/dist/action.js.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.js +14 -10
- package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +35 -7
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts +2 -0
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +3 -0
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/chat-threads/migrations.d.ts +21 -0
- package/dist/chat-threads/migrations.d.ts.map +1 -0
- package/dist/chat-threads/migrations.js +45 -0
- package/dist/chat-threads/migrations.js.map +1 -0
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +4 -0
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts +1 -1
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/design-visual-edit-skill.js +36 -16
- package/dist/cli/skills-content/design-visual-edit-skill.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +15 -0
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +6 -5
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +37 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +41 -8
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +11 -10
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +19 -3
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +150 -101
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +2 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +11 -4
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/runtime.d.ts.map +1 -1
- package/dist/client/chat/runtime.js +2 -1
- package/dist/client/chat/runtime.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +4 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +14 -8
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/chat-model-groups.d.ts.map +1 -1
- package/dist/client/chat-model-groups.js +3 -0
- package/dist/client/chat-model-groups.js.map +1 -1
- package/dist/client/client-status-requests.d.ts +14 -0
- package/dist/client/client-status-requests.d.ts.map +1 -0
- package/dist/client/client-status-requests.js +126 -0
- package/dist/client/client-status-requests.js.map +1 -0
- package/dist/client/org/OrgSwitcher.js +2 -2
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.js +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts +7 -0
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +8 -3
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/client/use-agent-engine-configured.d.ts.map +1 -1
- package/dist/client/use-agent-engine-configured.js +29 -43
- package/dist/client/use-agent-engine-configured.js.map +1 -1
- package/dist/client/use-chat-models.d.ts.map +1 -1
- package/dist/client/use-chat-models.js +11 -11
- package/dist/client/use-chat-models.js.map +1 -1
- package/dist/client/use-chat-threads.d.ts.map +1 -1
- package/dist/client/use-chat-threads.js +23 -7
- package/dist/client/use-chat-threads.js.map +1 -1
- package/dist/client/use-session.d.ts.map +1 -1
- package/dist/client/use-session.js +4 -4
- package/dist/client/use-session.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +48 -4
- package/dist/db/client.js.map +1 -1
- package/dist/db/ensure-additive-columns.d.ts.map +1 -1
- package/dist/db/ensure-additive-columns.js +32 -21
- package/dist/db/ensure-additive-columns.js.map +1 -1
- package/dist/db/migrations.d.ts +9 -0
- package/dist/db/migrations.d.ts.map +1 -1
- package/dist/db/migrations.js +14 -3
- package/dist/db/migrations.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/mcp/approval-store.d.ts +16 -0
- package/dist/mcp/approval-store.d.ts.map +1 -0
- package/dist/mcp/approval-store.js +85 -0
- package/dist/mcp/approval-store.js.map +1 -0
- package/dist/mcp/build-server.d.ts +1 -34
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +220 -23
- package/dist/mcp/build-server.js.map +1 -1
- package/dist/mcp/embed-app.js +1 -1
- package/dist/mcp/embed-app.js.map +1 -1
- package/dist/mcp/oauth-client-metadata.d.ts +15 -0
- package/dist/mcp/oauth-client-metadata.d.ts.map +1 -0
- package/dist/mcp/oauth-client-metadata.js +297 -0
- package/dist/mcp/oauth-client-metadata.js.map +1 -0
- package/dist/mcp/oauth-route.d.ts.map +1 -1
- package/dist/mcp/oauth-route.js +39 -53
- package/dist/mcp/oauth-route.js.map +1 -1
- package/dist/mcp/screen-memory-stdio.d.ts.map +1 -1
- package/dist/mcp/screen-memory-stdio.js +304 -296
- package/dist/mcp/screen-memory-stdio.js.map +1 -1
- package/dist/mcp/server.d.ts +12 -25
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +24 -133
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/stdio.d.ts.map +1 -1
- package/dist/mcp/stdio.js +36 -35
- package/dist/mcp/stdio.js.map +1 -1
- package/dist/mcp-client/manager.d.ts.map +1 -1
- package/dist/mcp-client/manager.js +6 -6
- package/dist/mcp-client/manager.js.map +1 -1
- package/dist/mcp-client/oauth-client.d.ts +13 -17
- package/dist/mcp-client/oauth-client.d.ts.map +1 -1
- package/dist/mcp-client/oauth-client.js +74 -16
- package/dist/mcp-client/oauth-client.js.map +1 -1
- package/dist/mcp-client/oauth-routes.d.ts +2 -2
- package/dist/mcp-client/oauth-routes.d.ts.map +1 -1
- package/dist/mcp-client/oauth-routes.js +16 -6
- package/dist/mcp-client/oauth-routes.js.map +1 -1
- package/dist/mcp-client/routes.js +5 -5
- package/dist/mcp-client/routes.js.map +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
- package/dist/provider-api/actions/provider-api.d.ts +8 -8
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-capabilities.d.ts.map +1 -1
- package/dist/server/agent-capabilities.js +21 -0
- package/dist/server/agent-capabilities.js.map +1 -1
- package/dist/server/agent-chat/action-filters-a2a.d.ts +14 -0
- package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -1
- package/dist/server/agent-chat/action-filters-a2a.js +16 -0
- package/dist/server/agent-chat/action-filters-a2a.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +11 -1
- 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/realtime-token.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/server/transcribe-voice.js +12 -6
- package/dist/server/transcribe-voice.js.map +1 -1
- package/dist/templates/chat/.agents/skills/security/SKILL.md +13 -2
- package/dist/templates/chat/README.md +0 -2
- package/dist/templates/default/.agents/skills/security/SKILL.md +13 -2
- package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +5 -2
- package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +18 -0
- package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +13 -2
- package/docs/content/template-design-collaboration-and-full-apps.mdx +3 -1
- package/package.json +7 -4
- package/src/a2a/client.ts +18 -4
- package/src/a2a/server.ts +19 -3
- package/src/a2a/types.ts +7 -0
- package/src/action.ts +43 -16
- package/src/agent/engine/ai-sdk-engine.ts +14 -10
- package/src/agent/production-agent.ts +41 -3
- package/src/agent/thread-data-builder.ts +5 -0
- package/src/chat-threads/migrations.ts +53 -0
- package/src/cli/create.ts +4 -0
- package/src/cli/skills-content/design-visual-edit-skill.ts +36 -16
- package/src/cli/skills.ts +16 -0
- package/src/client/AgentPanel.tsx +9 -5
- package/src/client/AssistantChat.tsx +138 -46
- package/src/client/MultiTabAssistantChat.tsx +16 -10
- package/src/client/agent-chat-adapter.ts +21 -3
- package/src/client/analytics.ts +159 -102
- package/src/client/chat/message-components.tsx +12 -5
- package/src/client/chat/runtime.ts +2 -1
- package/src/client/chat/tool-call-display.tsx +25 -2
- package/src/client/chat-model-groups.ts +3 -0
- package/src/client/client-status-requests.ts +161 -0
- package/src/client/org/OrgSwitcher.tsx +4 -4
- package/src/client/settings/VoiceTranscriptionSection.tsx +2 -2
- package/src/client/sse-event-processor.ts +15 -3
- package/src/client/use-agent-engine-configured.ts +54 -50
- package/src/client/use-chat-models.ts +16 -11
- package/src/client/use-chat-threads.ts +32 -9
- package/src/client/use-session.ts +4 -5
- package/src/db/client.ts +83 -8
- package/src/db/ensure-additive-columns.ts +31 -20
- package/src/db/migrations.ts +22 -2
- package/src/mcp/approval-store.ts +99 -0
- package/src/mcp/build-server.ts +579 -303
- package/src/mcp/embed-app.ts +1 -1
- package/src/mcp/oauth-client-metadata.ts +380 -0
- package/src/mcp/oauth-route.ts +57 -52
- package/src/mcp/screen-memory-stdio.ts +400 -378
- package/src/mcp/server.ts +29 -145
- package/src/mcp/stdio.ts +72 -80
- package/src/mcp-client/manager.ts +6 -10
- package/src/mcp-client/oauth-client.ts +127 -36
- package/src/mcp-client/oauth-routes.ts +16 -6
- package/src/mcp-client/routes.ts +6 -5
- package/src/server/agent-capabilities.ts +20 -0
- package/src/server/agent-chat/action-filters-a2a.ts +27 -0
- package/src/server/agent-chat-plugin.ts +18 -0
- package/src/server/transcribe-voice.ts +14 -5
- package/src/templates/chat/.agents/skills/security/SKILL.md +13 -2
- package/src/templates/chat/README.md +0 -2
- package/src/templates/default/.agents/skills/security/SKILL.md +13 -2
- package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +5 -2
- package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +18 -0
- package/src/templates/workspace-core/.agents/skills/security/SKILL.md +13 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/client/analytics.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/client/analytics.ts"],"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AG,cAAc,GAAG,aAAa,CAAC;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,uBAAuB,GAAG,IAAI,CAiD5E;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAuCzE;AAED,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAUvE;AA0TD,wBAAsB,kBAAkB,CACtC,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,wBAAwB,CAAC,CAenC;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,wBAAwB,CAAC,CAcnC;AAED,wBAAsB,iBAAiB,CAAC,MAAM,SAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxE;AA6MD,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,IAAI,CAaN;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAE1D"}
|
package/dist/client/analytics.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import * as amplitude from "@amplitude/analytics-browser";
|
|
2
|
-
import * as Sentry from "@sentry/browser";
|
|
3
1
|
import { llmConnectionTrackingProperties, } from "../shared/llm-connection.js";
|
|
4
2
|
import { getOrCreateAnalyticsAnonymousId, getOrCreateAnalyticsSessionId, } from "./analytics-session.js";
|
|
5
|
-
import {
|
|
3
|
+
import { fetchAgentEngineStatus, fetchAuthSessionStatus, } from "./client-status-requests.js";
|
|
6
4
|
import { installErrorCapture, } from "./error-capture.js";
|
|
7
5
|
import { isDynamicImportFailureMessage } from "./route-chunk-recovery.js";
|
|
8
6
|
import { scrubUrl } from "./url-scrub.js";
|
|
@@ -13,7 +11,14 @@ let _getDefaultProps = null;
|
|
|
13
11
|
let _agentNativeAnalyticsPublicKey = null;
|
|
14
12
|
let _agentNativeAnalyticsEndpoint = null;
|
|
15
13
|
let _amplitudeInitialized = false;
|
|
14
|
+
let _amplitudeModule = null;
|
|
15
|
+
let _amplitudeLoadPromise = null;
|
|
16
|
+
let _amplitudeApiKey = null;
|
|
17
|
+
let _pendingAmplitudeEvents = [];
|
|
16
18
|
let _sentryInitialized = false;
|
|
19
|
+
let _sentryModule = null;
|
|
20
|
+
let _sentryLoadPromise = null;
|
|
21
|
+
let _pendingSentryCaptures = [];
|
|
17
22
|
let _llmConnectionStatus = null;
|
|
18
23
|
let _llmConnectionRefresh = null;
|
|
19
24
|
let _llmConnectionRefreshInstalled = false;
|
|
@@ -134,21 +139,13 @@ function refreshLlmConnectionStatus() {
|
|
|
134
139
|
}
|
|
135
140
|
if (_llmConnectionRefresh)
|
|
136
141
|
return _llmConnectionRefresh;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
_llmConnectionRefresh = request
|
|
145
|
-
.then((res) => (res.ok ? res.json() : null))
|
|
146
|
-
.then((data) => {
|
|
147
|
-
_llmConnectionStatus = normalizeAgentEngineStatus(data);
|
|
148
|
-
cacheLlmConnectionStatus(_llmConnectionStatus);
|
|
149
|
-
})
|
|
150
|
-
.catch(() => {
|
|
151
|
-
if (!_llmConnectionStatus) {
|
|
142
|
+
_llmConnectionRefresh = fetchAgentEngineStatus()
|
|
143
|
+
.then((result) => {
|
|
144
|
+
if (result.state === "available") {
|
|
145
|
+
_llmConnectionStatus = normalizeAgentEngineStatus(result.value);
|
|
146
|
+
cacheLlmConnectionStatus(_llmConnectionStatus);
|
|
147
|
+
}
|
|
148
|
+
else if (!_llmConnectionStatus) {
|
|
152
149
|
_llmConnectionStatus = readCachedLlmConnectionStatus();
|
|
153
150
|
}
|
|
154
151
|
})
|
|
@@ -225,13 +222,11 @@ function refreshTrackingAuthSession() {
|
|
|
225
222
|
}
|
|
226
223
|
if (_trackingSessionRefresh)
|
|
227
224
|
return _trackingSessionRefresh;
|
|
228
|
-
_trackingSessionRefresh =
|
|
229
|
-
.then((
|
|
230
|
-
.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
.catch(() => {
|
|
234
|
-
clearTrackingIdentity();
|
|
225
|
+
_trackingSessionRefresh = fetchAuthSessionStatus()
|
|
226
|
+
.then((result) => {
|
|
227
|
+
if (result.state === "available") {
|
|
228
|
+
setTrackingIdentityFromSession(result.value);
|
|
229
|
+
}
|
|
235
230
|
})
|
|
236
231
|
.finally(() => {
|
|
237
232
|
_trackingIdentityResolved = true;
|
|
@@ -446,12 +441,31 @@ function ensureAmplitude() {
|
|
|
446
441
|
?.VITE_AMPLITUDE_API_KEY;
|
|
447
442
|
if (!key)
|
|
448
443
|
return false;
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
444
|
+
_amplitudeApiKey = key;
|
|
445
|
+
if (_amplitudeLoadPromise)
|
|
446
|
+
return false;
|
|
447
|
+
_amplitudeLoadPromise = import("@amplitude/analytics-browser")
|
|
448
|
+
.then((module) => {
|
|
449
|
+
// Standard pageviews and explicit events are emitted below. Keep SDK-level
|
|
450
|
+
// DOM/network autocapture off so rendered user content is never collected as
|
|
451
|
+
// an implicit analytics side effect.
|
|
452
|
+
module.init(key, { autocapture: false });
|
|
453
|
+
_amplitudeModule = module;
|
|
454
|
+
_amplitudeInitialized = true;
|
|
455
|
+
for (const [name, properties] of _pendingAmplitudeEvents) {
|
|
456
|
+
module.track(name, properties);
|
|
457
|
+
}
|
|
458
|
+
_pendingAmplitudeEvents = [];
|
|
459
|
+
return module;
|
|
460
|
+
})
|
|
461
|
+
.catch(() => {
|
|
462
|
+
_pendingAmplitudeEvents = [];
|
|
463
|
+
return null;
|
|
464
|
+
})
|
|
465
|
+
.finally(() => {
|
|
466
|
+
_amplitudeLoadPromise = null;
|
|
467
|
+
});
|
|
468
|
+
return false;
|
|
455
469
|
}
|
|
456
470
|
function hasOnlySourcelessFrames(value) {
|
|
457
471
|
const frames = value.stacktrace?.frames ?? [];
|
|
@@ -654,59 +668,101 @@ function getClientSentryDsn() {
|
|
|
654
668
|
window.__AGENT_NATIVE_CONFIG__?.sentryDsn ||
|
|
655
669
|
resolveClientSentryDsnFromKeyProject(env));
|
|
656
670
|
}
|
|
657
|
-
function
|
|
658
|
-
|
|
671
|
+
function captureWithSentry(module, error, context) {
|
|
672
|
+
return module.withScope((scope) => {
|
|
673
|
+
if (context.tags) {
|
|
674
|
+
for (const [k, v] of Object.entries(context.tags)) {
|
|
675
|
+
if (typeof v === "string")
|
|
676
|
+
scope.setTag(k, v);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
if (context.extra) {
|
|
680
|
+
for (const [k, v] of Object.entries(context.extra)) {
|
|
681
|
+
if (v !== undefined)
|
|
682
|
+
scope.setExtra(k, v);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
if (context.contexts) {
|
|
686
|
+
for (const [k, v] of Object.entries(context.contexts)) {
|
|
687
|
+
scope.setContext(k, v);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
return module.captureException(error);
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
function ensureSentry(loadWithoutDsn = false) {
|
|
694
|
+
if (_sentryInitialized || _sentryLoadPromise)
|
|
659
695
|
return;
|
|
660
696
|
const dsn = getClientSentryDsn();
|
|
661
|
-
if (!dsn)
|
|
697
|
+
if (!dsn && !loadWithoutDsn)
|
|
662
698
|
return;
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
if (shouldDropBrowserSentryNoise(event)) {
|
|
670
|
-
return null;
|
|
671
|
-
}
|
|
672
|
-
// Strip sensitive query params from the request URL. React Router
|
|
673
|
-
// history can include share tokens, ?signin=1, password reset codes,
|
|
674
|
-
// public-share password params (audit F-07), etc.
|
|
675
|
-
if (event.request?.url) {
|
|
676
|
-
event.request.url = scrubUrl(event.request.url);
|
|
699
|
+
_sentryLoadPromise = import("@sentry/browser")
|
|
700
|
+
.then((module) => {
|
|
701
|
+
_sentryModule = module;
|
|
702
|
+
if (!dsn) {
|
|
703
|
+
for (const pending of _pendingSentryCaptures) {
|
|
704
|
+
captureWithSentry(module, pending.error, pending.context);
|
|
677
705
|
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
706
|
+
_pendingSentryCaptures = [];
|
|
707
|
+
return module;
|
|
708
|
+
}
|
|
709
|
+
module.init({
|
|
710
|
+
dsn,
|
|
711
|
+
environment: window.__AGENT_NATIVE_CONFIG__?.sentryEnvironment ||
|
|
712
|
+
import.meta.env?.MODE ||
|
|
713
|
+
"production",
|
|
714
|
+
beforeSend(event) {
|
|
715
|
+
if (shouldDropBrowserSentryNoise(event)) {
|
|
716
|
+
return null;
|
|
717
|
+
}
|
|
718
|
+
// Strip sensitive query params from the request URL. React Router
|
|
719
|
+
// history can include share tokens, ?signin=1, password reset codes,
|
|
720
|
+
// public-share password params (audit F-07), etc.
|
|
721
|
+
if (event.request?.url) {
|
|
722
|
+
event.request.url = scrubUrl(event.request.url);
|
|
723
|
+
}
|
|
724
|
+
// Clean the same params from breadcrumb URLs (Sentry captures
|
|
725
|
+
// history.pushState breadcrumbs by default).
|
|
726
|
+
if (Array.isArray(event.breadcrumbs)) {
|
|
727
|
+
for (const crumb of event.breadcrumbs) {
|
|
728
|
+
if (crumb && typeof crumb === "object" && "data" in crumb) {
|
|
729
|
+
const data = crumb.data;
|
|
730
|
+
if (data && typeof data.url === "string") {
|
|
731
|
+
data.url = scrubUrl(data.url);
|
|
732
|
+
}
|
|
733
|
+
if (data && typeof data.from === "string") {
|
|
734
|
+
data.from = scrubUrl(data.from);
|
|
735
|
+
}
|
|
736
|
+
if (data && typeof data.to === "string") {
|
|
737
|
+
data.to = scrubUrl(data.to);
|
|
738
|
+
}
|
|
692
739
|
}
|
|
693
740
|
}
|
|
694
741
|
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
}
|
|
742
|
+
return event;
|
|
743
|
+
},
|
|
744
|
+
});
|
|
745
|
+
module.setTag("runtime", "browser");
|
|
746
|
+
_sentryInitialized = true;
|
|
747
|
+
// Flush any user/tag that was set before init.
|
|
748
|
+
if (_pendingSentryUser !== undefined) {
|
|
749
|
+
module.setUser(_pendingSentryUser);
|
|
750
|
+
_pendingSentryUser = undefined;
|
|
751
|
+
}
|
|
752
|
+
if (_pendingSentryOrgId !== undefined) {
|
|
753
|
+
module.setTag("orgId", _pendingSentryOrgId);
|
|
754
|
+
_pendingSentryOrgId = undefined;
|
|
755
|
+
}
|
|
756
|
+
for (const pending of _pendingSentryCaptures) {
|
|
757
|
+
captureWithSentry(module, pending.error, pending.context);
|
|
758
|
+
}
|
|
759
|
+
_pendingSentryCaptures = [];
|
|
760
|
+
return module;
|
|
761
|
+
})
|
|
762
|
+
.catch(() => null)
|
|
763
|
+
.finally(() => {
|
|
764
|
+
_sentryLoadPromise = null;
|
|
698
765
|
});
|
|
699
|
-
Sentry.setTag("runtime", "browser");
|
|
700
|
-
_sentryInitialized = true;
|
|
701
|
-
// Flush any user/tag that was set before init.
|
|
702
|
-
if (_pendingSentryUser !== undefined) {
|
|
703
|
-
Sentry.setUser(_pendingSentryUser);
|
|
704
|
-
_pendingSentryUser = undefined;
|
|
705
|
-
}
|
|
706
|
-
if (_pendingSentryOrgId !== undefined) {
|
|
707
|
-
Sentry.setTag("orgId", _pendingSentryOrgId);
|
|
708
|
-
_pendingSentryOrgId = undefined;
|
|
709
|
-
}
|
|
710
766
|
}
|
|
711
767
|
/**
|
|
712
768
|
* Attach the current user to Sentry events from the browser. Pass `null` to
|
|
@@ -742,10 +798,10 @@ export function setSentryUser(user, orgId) {
|
|
|
742
798
|
_sessionReplayOptions?.requireSignedInUser) {
|
|
743
799
|
void startConfiguredSessionReplay(_sessionReplayOptions);
|
|
744
800
|
}
|
|
745
|
-
if (_sentryInitialized) {
|
|
746
|
-
|
|
801
|
+
if (_sentryInitialized && _sentryModule) {
|
|
802
|
+
_sentryModule.setUser(user);
|
|
747
803
|
if (orgId !== undefined) {
|
|
748
|
-
|
|
804
|
+
_sentryModule.setTag("orgId", orgId ?? null);
|
|
749
805
|
}
|
|
750
806
|
return;
|
|
751
807
|
}
|
|
@@ -772,27 +828,13 @@ export function captureClientException(error, context = {}) {
|
|
|
772
828
|
if (typeof window === "undefined")
|
|
773
829
|
return undefined;
|
|
774
830
|
try {
|
|
775
|
-
ensureSentry();
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
}
|
|
783
|
-
if (context.extra) {
|
|
784
|
-
for (const [k, v] of Object.entries(context.extra)) {
|
|
785
|
-
if (v !== undefined)
|
|
786
|
-
scope.setExtra(k, v);
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
if (context.contexts) {
|
|
790
|
-
for (const [k, v] of Object.entries(context.contexts)) {
|
|
791
|
-
scope.setContext(k, v);
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
return Sentry.captureException(error);
|
|
795
|
-
});
|
|
831
|
+
ensureSentry(true);
|
|
832
|
+
if (_sentryModule)
|
|
833
|
+
return captureWithSentry(_sentryModule, error, context);
|
|
834
|
+
if (_pendingSentryCaptures.length < 50) {
|
|
835
|
+
_pendingSentryCaptures.push({ error, context });
|
|
836
|
+
}
|
|
837
|
+
return undefined;
|
|
796
838
|
}
|
|
797
839
|
catch {
|
|
798
840
|
return undefined;
|
|
@@ -1317,6 +1359,8 @@ function pageviewProperties(reason) {
|
|
|
1317
1359
|
return properties;
|
|
1318
1360
|
}
|
|
1319
1361
|
function emitPageview(reason) {
|
|
1362
|
+
if (typeof window === "undefined")
|
|
1363
|
+
return;
|
|
1320
1364
|
if (isLocalAnalyticsHostname(window.location.hostname))
|
|
1321
1365
|
return;
|
|
1322
1366
|
const state = getPageviewTrackingState();
|
|
@@ -1420,7 +1464,12 @@ export function trackEvent(name, params) {
|
|
|
1420
1464
|
const props = resolveProps(name, params);
|
|
1421
1465
|
window.gtag?.("event", name.replace(/\s+/g, "_"), props);
|
|
1422
1466
|
if (ensureAmplitude()) {
|
|
1423
|
-
|
|
1467
|
+
_amplitudeModule?.track(name, props);
|
|
1468
|
+
}
|
|
1469
|
+
else if (_amplitudeApiKey) {
|
|
1470
|
+
if (_pendingAmplitudeEvents.length < 100) {
|
|
1471
|
+
_pendingAmplitudeEvents.push([name, props]);
|
|
1472
|
+
}
|
|
1424
1473
|
}
|
|
1425
1474
|
sendAgentNativeAnalytics(name, props);
|
|
1426
1475
|
}
|