@agent-native/core 0.120.1 → 0.120.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +3 -3
- package/corpus/core/CHANGELOG.md +29 -0
- package/corpus/core/docs/content/extensions.mdx +23 -4
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/production-agent.ts +4 -0
- package/corpus/core/src/agent/run-manager.ts +36 -10
- package/corpus/core/src/agent/types.ts +2 -0
- package/corpus/core/src/cli/context-xray-local.ts +1 -1
- package/corpus/core/src/cli/index.ts +63 -18
- package/corpus/core/src/cli/skills.ts +5 -0
- package/corpus/core/src/cli/telemetry.ts +118 -1
- package/corpus/core/src/client/AgentPanel.tsx +10 -0
- package/corpus/core/src/client/CommandMenu.tsx +13 -1
- package/corpus/core/src/client/agent-page/AgentTabsPage.tsx +39 -4
- package/corpus/core/src/client/analytics.ts +13 -0
- package/corpus/core/src/client/error-capture.ts +6 -1
- package/corpus/core/src/client/extensions/ExtensionsListPage.tsx +28 -8
- package/corpus/core/src/client/extensions/agent-native-extension-runtime.ts +1 -1
- package/corpus/core/src/client/navigation/index.ts +2 -0
- package/corpus/core/src/client/org/OrgSwitcher.tsx +14 -32
- package/corpus/core/src/client/settings/ExtensionsSettingsContent.tsx +24 -0
- package/corpus/core/src/client/settings/SettingsPanel.tsx +10 -0
- package/corpus/core/src/deploy/build.ts +3 -0
- package/corpus/core/src/extensions/theme.ts +1 -1
- package/corpus/core/src/localization/default-messages.ts +2 -0
- package/corpus/core/src/server/analytics.ts +154 -25
- package/corpus/core/src/server/core-routes-plugin.ts +10 -1
- package/corpus/core/src/server/framework-request-handler.ts +17 -26
- package/corpus/core/src/styles/agent-native.css +13 -0
- package/corpus/core/src/templates/chat/app/components/layout/Layout.tsx +3 -0
- package/corpus/core/src/templates/chat/app/components/layout/Sidebar.tsx +113 -51
- package/corpus/core/src/templates/chat/app/global.css +1 -1
- package/corpus/core/src/templates/chat/app/routes/extensions._index.tsx +2 -2
- package/corpus/core/src/templates/chat/netlify.toml +1 -0
- package/corpus/core/src/templates/default/app/global.css +1 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +16 -0
- package/corpus/core/src/tracking/error-capture.ts +151 -0
- package/corpus/core/src/tracking/index.ts +5 -0
- package/corpus/core/src/vite/client.ts +6 -0
- package/corpus/templates/analytics/.agents/skills/adhoc-analysis/SKILL.md +27 -43
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +19 -8
- package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +2 -2
- package/corpus/templates/analytics/AGENTS.md +20 -8
- package/corpus/templates/analytics/actions/get-explorer-dashboard.ts +3 -0
- package/corpus/templates/analytics/actions/list-dashboard-usage-stats.ts +140 -46
- package/corpus/templates/analytics/actions/migrate-analytics-artifacts.ts +48 -0
- package/corpus/templates/analytics/actions/save-analysis.ts +2 -3
- package/corpus/templates/analytics/actions/view-screen.ts +1 -1
- package/corpus/templates/analytics/app/components/dashboard/CumulativeNetChart.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/DashboardHistoryPanel.tsx +1 -4
- package/corpus/templates/analytics/app/components/dashboard/DashboardMetadata.tsx +77 -0
- package/corpus/templates/analytics/app/components/dashboard/DashboardPanelSkeleton.tsx +7 -1
- package/corpus/templates/analytics/app/components/dashboard/DataTable.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/DateRangePicker.tsx +2 -2
- package/corpus/templates/analytics/app/components/dashboard/MetricCard.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/RecentActivity.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/RevenueChart.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/RevenueComparisonChart.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +41 -9
- package/corpus/templates/analytics/app/components/dashboard/StatsCard.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/TimeSeriesChart.tsx +1 -1
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +2 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +28 -14
- package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +1 -0
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +255 -626
- package/corpus/templates/analytics/app/global.css +31 -1
- package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +2 -2
- package/corpus/templates/analytics/app/i18n-data.ts +80 -0
- package/corpus/templates/analytics/app/lib/dashboard-report-capture.ts +42 -0
- package/corpus/templates/analytics/app/pages/Agents.tsx +49 -2
- package/corpus/templates/analytics/app/pages/adhoc/_shared/KpiChart.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/ChartTypePicker.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/DateRangePicker.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventRow.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +2 -2
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +54 -11
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +3 -3
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/EmailReportDialog.tsx +2 -2
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +4 -54
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +178 -69
- package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +2 -2
- package/corpus/templates/analytics/app/root.tsx +28 -0
- package/corpus/templates/analytics/app/routes/analyses._index.tsx +3 -2
- package/corpus/templates/analytics/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/analytics/changelog/2026-07-23-analytics-now-groups-saved-analyses-and-embedded-extensions-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-23-dashboard-menus-show-who-created-and-last-updated-each-dashb.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-23-dashboard-usage-now-loads-reliably-for-organizations-with-ma.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-23-long-dashboard-building-requests-now-continue-without-stoppi.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-analytics-charts-now-explain-slow-loads-and-offer-a-direct-r.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-daily-dashboard-emails-now-load-signed-reports-more-reliably.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-manage-agent-is-clearly-marked-as-a-link-to-its-dedicated-pa.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/analytics/netlify.toml +4 -0
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +1 -1
- package/corpus/templates/analytics/server/db/schema.ts +9 -0
- package/corpus/templates/analytics/server/jobs/dashboard-report.ts +21 -0
- package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +0 -1
- package/corpus/templates/analytics/server/lib/agent-readable-resource-context.ts +1 -0
- package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +11 -0
- package/corpus/templates/analytics/server/lib/dashboard-report-subscriptions.ts +54 -0
- package/corpus/templates/analytics/server/lib/dashboard-report.ts +235 -26
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +4 -1
- package/corpus/templates/analytics/server/lib/migrate-analytics-artifacts.ts +1062 -0
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +6 -52
- package/corpus/templates/analytics/server/plugins/core-routes.ts +1 -1
- package/corpus/templates/analytics/server/plugins/db.ts +19 -0
- package/corpus/templates/analytics/shared/dashboard-report-timeouts.ts +1 -1
- package/corpus/templates/assets/actions/generate-image-batch.ts +36 -1
- package/corpus/templates/assets/actions/generate-image.ts +28 -1
- package/corpus/templates/assets/app/components/asset/AssetPreviewDialog.tsx +376 -0
- package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +14 -4
- package/corpus/templates/assets/app/components/layout/Layout.tsx +5 -0
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +164 -82
- package/corpus/templates/assets/app/global.css +1 -1
- package/corpus/templates/assets/app/i18n-data.ts +10 -0
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +99 -10
- package/corpus/templates/assets/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/assets/app/routes/library.tsx +21 -198
- package/corpus/templates/assets/changelog/2026-07-21-unified-asset-preview-click-any-asset-to-open-one-preview-wi.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-23-assets-image-generation-now-recovers-after-a-completed-tool-.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/assets/netlify.toml +1 -0
- package/corpus/templates/brain/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +114 -51
- package/corpus/templates/brain/app/global.css +1 -1
- package/corpus/templates/brain/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/brain/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/brain/netlify.toml +1 -0
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +110 -57
- package/corpus/templates/calendar/app/global.css +1 -1
- package/corpus/templates/calendar/app/routes/_app.extensions._index.tsx +2 -16
- package/corpus/templates/calendar/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/calendar/netlify.toml +1 -0
- package/corpus/templates/chat/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +113 -51
- package/corpus/templates/chat/app/global.css +1 -1
- package/corpus/templates/chat/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/chat/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/chat/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/chat/netlify.toml +1 -0
- package/corpus/templates/clips/app/components/library/library-layout.tsx +117 -37
- package/corpus/templates/clips/app/components/library/organization-switcher.tsx +2 -2
- package/corpus/templates/clips/app/components/player/video-player.tsx +16 -1
- package/corpus/templates/clips/app/global.css +1 -1
- package/corpus/templates/clips/app/hooks/use-view-tracking.ts +55 -12
- package/corpus/templates/clips/app/routes/_app.extensions._index.tsx +2 -16
- package/corpus/templates/clips/app/routes/embed.$shareId.tsx +6 -5
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +7 -7
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +6 -5
- package/corpus/templates/clips/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-23-meeting-recording-meters-and-dismissed-prompts.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/clips/desktop/src/hooks/useMicMeter.ts +1 -1
- package/corpus/templates/clips/desktop/src/lib/meeting-notification-dismissal.ts +2 -0
- package/corpus/templates/clips/desktop/src/lib/voice-dictation.ts +1 -3
- package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +86 -0
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +24 -0
- package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +5 -69
- package/corpus/templates/clips/desktop/src/styles.css +35 -3
- package/corpus/templates/clips/desktop/src-tauri/src/adhoc_meetings_watcher.rs +13 -44
- package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +119 -17
- package/corpus/templates/clips/netlify.toml +1 -0
- package/corpus/templates/clips/server/plugins/db.ts +113 -68
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +69 -49
- package/corpus/templates/content/app/global.css +1 -1
- package/corpus/templates/content/app/routes/_app.extensions._index.tsx +2 -2
- package/corpus/templates/content/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/content/netlify.toml +1 -0
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +115 -42
- package/corpus/templates/design/app/entry.client.tsx +14 -1
- package/corpus/templates/design/app/global.css +1 -1
- package/corpus/templates/design/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/design/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
- package/corpus/templates/design/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/design/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/design/netlify.toml +1 -0
- package/corpus/templates/dispatch/app/dispatch-extensions.tsx +1 -1
- package/corpus/templates/dispatch/app/global.css +1 -1
- package/corpus/templates/dispatch/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/dispatch/netlify.toml +1 -0
- package/corpus/templates/forms/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +113 -82
- package/corpus/templates/forms/app/global.css +1 -1
- package/corpus/templates/forms/app/routes/_app.extensions._index.tsx +2 -2
- package/corpus/templates/forms/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
- package/corpus/templates/forms/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/forms/changelog/2026-07-24-forms-sidebar-actions-now-keep-search-language-feedback-and-.md +6 -0
- package/corpus/templates/forms/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/forms/netlify.toml +1 -0
- package/corpus/templates/macros/app/components/DailyProgress.tsx +5 -5
- package/corpus/templates/macros/app/components/ExerciseCard.tsx +2 -2
- package/corpus/templates/macros/app/components/MealCard.tsx +2 -2
- package/corpus/templates/macros/app/components/WeightCard.tsx +2 -2
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +92 -34
- package/corpus/templates/macros/app/components/ui/button.tsx +1 -2
- package/corpus/templates/macros/app/components/ui/card.tsx +1 -1
- package/corpus/templates/macros/app/global.css +1 -1
- package/corpus/templates/macros/app/routes/_index.tsx +1 -1
- package/corpus/templates/macros/app/routes/analytics.tsx +4 -7
- package/corpus/templates/macros/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/macros/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/macros/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/macros/netlify.toml +1 -0
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +125 -46
- package/corpus/templates/mail/app/global.css +1 -1
- package/corpus/templates/mail/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/mail/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/mail/netlify.toml +1 -0
- package/corpus/templates/plan/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +128 -65
- package/corpus/templates/plan/app/global.css +1 -1
- package/corpus/templates/plan/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/plan/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/plan/netlify.toml +1 -0
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +116 -36
- package/corpus/templates/slides/app/global.css +1 -1
- package/corpus/templates/slides/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/slides/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/slides/netlify.toml +1 -0
- package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +37 -6
- package/corpus/templates/tasks/app/global.css +1 -1
- package/corpus/templates/tasks/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/tasks/app/routes/settings.tsx +31 -0
- package/corpus/templates/tasks/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/tasks/netlify.toml +1 -0
- package/corpus/toolkit/CHANGELOG.md +8 -0
- package/corpus/toolkit/README.md +8 -1
- package/corpus/toolkit/agent-native.eject.json +1 -1
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/app-shell/index.ts +1 -0
- package/corpus/toolkit/src/app-shell/sidebar-footer-actions.tsx +48 -0
- package/corpus/toolkit/src/chat-history.css +52 -1
- package/corpus/toolkit/src/design-system/default-adapter.tsx +1 -1
- package/corpus/toolkit/src/ui/button.tsx +1 -2
- package/corpus/toolkit/src/ui/card.tsx +1 -1
- package/corpus/toolkit/src/ui/table.tsx +4 -11
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +4 -0
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-manager.d.ts +9 -0
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +25 -10
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/types.d.ts +2 -2
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/cli/context-xray-local.js +1 -1
- package/dist/cli/context-xray-local.js.map +1 -1
- package/dist/cli/index.js +56 -17
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +5 -0
- package/dist/cli/skills.js.map +1 -1
- package/dist/cli/telemetry.d.ts +7 -0
- package/dist/cli/telemetry.d.ts.map +1 -1
- package/dist/cli/telemetry.js +91 -1
- package/dist/cli/telemetry.js.map +1 -1
- package/dist/client/AgentPanel.d.ts +7 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +2 -2
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/CommandMenu.d.ts +2 -0
- package/dist/client/CommandMenu.d.ts.map +1 -1
- package/dist/client/CommandMenu.js +12 -1
- package/dist/client/CommandMenu.js.map +1 -1
- package/dist/client/agent-page/AgentTabsPage.d.ts +4 -0
- package/dist/client/agent-page/AgentTabsPage.d.ts.map +1 -1
- package/dist/client/agent-page/AgentTabsPage.js +8 -4
- package/dist/client/agent-page/AgentTabsPage.js.map +1 -1
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +7 -0
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/error-capture.d.ts.map +1 -1
- package/dist/client/error-capture.js +8 -1
- package/dist/client/error-capture.js.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.d.ts +5 -1
- package/dist/client/extensions/ExtensionsListPage.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.js +6 -4
- package/dist/client/extensions/ExtensionsListPage.js.map +1 -1
- package/dist/client/extensions/agent-native-extension-runtime.js +1 -1
- package/dist/client/extensions/agent-native-extension-runtime.js.map +1 -1
- package/dist/client/navigation/index.d.ts +1 -1
- package/dist/client/navigation/index.d.ts.map +1 -1
- package/dist/client/navigation/index.js +1 -1
- package/dist/client/navigation/index.js.map +1 -1
- package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +9 -13
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/settings/ExtensionsSettingsContent.d.ts +2 -0
- package/dist/client/settings/ExtensionsSettingsContent.d.ts.map +1 -0
- package/dist/client/settings/ExtensionsSettingsContent.js +10 -0
- package/dist/client/settings/ExtensionsSettingsContent.js.map +1 -0
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +10 -1
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/deploy/build.js +1 -0
- package/dist/deploy/build.js.map +1 -1
- package/dist/extensions/theme.js +1 -1
- package/dist/extensions/theme.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/localization/default-messages.d.ts +2 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +2 -0
- package/dist/localization/default-messages.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 +7 -7
- package/dist/provider-api/actions/provider-api.d.ts +9 -9
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/server/analytics.d.ts +9 -4
- package/dist/server/analytics.d.ts.map +1 -1
- package/dist/server/analytics.js +111 -22
- package/dist/server/analytics.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +8 -1
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/framework-request-handler.d.ts.map +1 -1
- package/dist/server/framework-request-handler.js +17 -27
- package/dist/server/framework-request-handler.js.map +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/styles/agent-native.css +13 -0
- package/dist/templates/chat/app/components/layout/Layout.tsx +3 -0
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +113 -51
- package/dist/templates/chat/app/global.css +1 -1
- package/dist/templates/chat/app/routes/extensions._index.tsx +2 -2
- package/dist/templates/chat/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/dist/templates/chat/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/dist/templates/chat/netlify.toml +1 -0
- package/dist/templates/default/app/global.css +1 -1
- package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +16 -0
- package/dist/tracking/error-capture.d.ts +14 -0
- package/dist/tracking/error-capture.d.ts.map +1 -0
- package/dist/tracking/error-capture.js +113 -0
- package/dist/tracking/error-capture.js.map +1 -0
- package/dist/tracking/index.d.ts +1 -0
- package/dist/tracking/index.d.ts.map +1 -1
- package/dist/tracking/index.js +1 -0
- package/dist/tracking/index.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +2 -0
- package/dist/vite/client.js.map +1 -1
- package/docs/content/extensions.mdx +23 -4
- package/package.json +2 -2
- package/src/agent/production-agent.ts +4 -0
- package/src/agent/run-manager.ts +36 -10
- package/src/agent/types.ts +2 -0
- package/src/cli/context-xray-local.ts +1 -1
- package/src/cli/index.ts +63 -18
- package/src/cli/skills.ts +5 -0
- package/src/cli/telemetry.ts +118 -1
- package/src/client/AgentPanel.tsx +10 -0
- package/src/client/CommandMenu.tsx +13 -1
- package/src/client/agent-page/AgentTabsPage.tsx +39 -4
- package/src/client/analytics.ts +13 -0
- package/src/client/error-capture.ts +6 -1
- package/src/client/extensions/ExtensionsListPage.tsx +28 -8
- package/src/client/extensions/agent-native-extension-runtime.ts +1 -1
- package/src/client/navigation/index.ts +2 -0
- package/src/client/org/OrgSwitcher.tsx +14 -32
- package/src/client/settings/ExtensionsSettingsContent.tsx +24 -0
- package/src/client/settings/SettingsPanel.tsx +10 -0
- package/src/deploy/build.ts +3 -0
- package/src/extensions/theme.ts +1 -1
- package/src/localization/default-messages.ts +2 -0
- package/src/server/analytics.ts +154 -25
- package/src/server/core-routes-plugin.ts +10 -1
- package/src/server/framework-request-handler.ts +17 -26
- package/src/styles/agent-native.css +13 -0
- package/src/templates/chat/app/components/layout/Layout.tsx +3 -0
- package/src/templates/chat/app/components/layout/Sidebar.tsx +113 -51
- package/src/templates/chat/app/global.css +1 -1
- package/src/templates/chat/app/routes/extensions._index.tsx +2 -2
- package/src/templates/chat/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/src/templates/chat/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/src/templates/chat/netlify.toml +1 -0
- package/src/templates/default/app/global.css +1 -1
- package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +16 -0
- package/src/tracking/error-capture.ts +151 -0
- package/src/tracking/index.ts +5 -0
- package/src/vite/client.ts +6 -0
- package/corpus/templates/analytics/app/components/layout/NewAnalysisDialog.tsx +0 -165
- package/corpus/templates/analytics/app/pages/analyses/AnalysesList.tsx +0 -175
package/dist/cli/telemetry.d.ts
CHANGED
|
@@ -7,7 +7,14 @@ export interface CliTelemetryOptions {
|
|
|
7
7
|
}
|
|
8
8
|
export interface CliTelemetry {
|
|
9
9
|
track(event: string, properties?: Record<string, unknown>): void;
|
|
10
|
+
captureException(error: unknown, context?: CliExceptionContext): void;
|
|
10
11
|
flush(): Promise<void>;
|
|
11
12
|
}
|
|
13
|
+
export interface CliExceptionContext {
|
|
14
|
+
handled?: boolean;
|
|
15
|
+
level?: "fatal" | "error" | "warning" | "info" | "debug";
|
|
16
|
+
tags?: Record<string, string | number | boolean | null | undefined>;
|
|
17
|
+
extra?: Record<string, unknown>;
|
|
18
|
+
}
|
|
12
19
|
export declare function createCliTelemetry(options: CliTelemetryOptions): CliTelemetry;
|
|
13
20
|
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/cli/telemetry.ts"],"names":[],"mappings":"AA8BA,MAAM,WAAW,mBAAmB;IAClC,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACjE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/cli/telemetry.ts"],"names":[],"mappings":"AA8BA,MAAM,WAAW,mBAAmB;IAClC,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACjE,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACtE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAmJD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAwD7E"}
|
package/dist/cli/telemetry.js
CHANGED
|
@@ -39,6 +39,92 @@ function telemetryDisabled() {
|
|
|
39
39
|
process.env.NODE_ENV === "test" ||
|
|
40
40
|
typeof fetch !== "function");
|
|
41
41
|
}
|
|
42
|
+
const MAX_EXCEPTION_MESSAGE_LENGTH = 1000;
|
|
43
|
+
const MAX_EXCEPTION_STACK_LENGTH = 8000;
|
|
44
|
+
const MAX_EXCEPTION_TAGS = 30;
|
|
45
|
+
const MAX_EXCEPTION_EXTRA_KEYS = 30;
|
|
46
|
+
const MAX_EXCEPTION_VALUE_LENGTH = 1000;
|
|
47
|
+
const SECRET_RE = /\b(?:bearer|basic)\s+[^\s]+/gi;
|
|
48
|
+
const SECRET_KEY_RE = /(?:authorization|cookie|set[-_]?cookie|token|secret|password|passwd|pwd|api[-_]?key|apikey|credential)/i;
|
|
49
|
+
function redactExceptionText(value) {
|
|
50
|
+
return value
|
|
51
|
+
.replace(SECRET_RE, (match) => `${match.split(/\s+/, 1)[0]} <redacted>`)
|
|
52
|
+
.replace(/([A-Za-z0-9_$.-]*(?:authorization|cookie|token|secret|password|passwd|pwd|api[-_]?key|apikey|credential)[A-Za-z0-9_$.-]*\s*[:=]\s*)([^\s,;}]+)/gi, "$1<redacted>");
|
|
53
|
+
}
|
|
54
|
+
function boundedExceptionText(value, max) {
|
|
55
|
+
const text = typeof value === "string" ? value : String(value ?? "Unknown error");
|
|
56
|
+
const safe = redactExceptionText(text);
|
|
57
|
+
return safe.length > max ? safe.slice(0, max) : safe;
|
|
58
|
+
}
|
|
59
|
+
function safeExceptionValue(value, depth = 2) {
|
|
60
|
+
if (value == null ||
|
|
61
|
+
typeof value === "boolean" ||
|
|
62
|
+
typeof value === "number") {
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
if (typeof value === "string") {
|
|
66
|
+
return boundedExceptionText(value, MAX_EXCEPTION_VALUE_LENGTH);
|
|
67
|
+
}
|
|
68
|
+
if (depth <= 0)
|
|
69
|
+
return boundedExceptionText(value, MAX_EXCEPTION_VALUE_LENGTH);
|
|
70
|
+
if (Array.isArray(value)) {
|
|
71
|
+
return value
|
|
72
|
+
.slice(0, 20)
|
|
73
|
+
.map((item) => safeExceptionValue(item, depth - 1));
|
|
74
|
+
}
|
|
75
|
+
if (typeof value === "object") {
|
|
76
|
+
const out = {};
|
|
77
|
+
for (const [key, child] of Object.entries(value)) {
|
|
78
|
+
if (Object.keys(out).length >= MAX_EXCEPTION_EXTRA_KEYS)
|
|
79
|
+
break;
|
|
80
|
+
const safeKey = boundedExceptionText(key, 100);
|
|
81
|
+
out[safeKey] = SECRET_KEY_RE.test(safeKey)
|
|
82
|
+
? "<redacted>"
|
|
83
|
+
: safeExceptionValue(child, depth - 1);
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
return boundedExceptionText(value, MAX_EXCEPTION_VALUE_LENGTH);
|
|
88
|
+
}
|
|
89
|
+
function captureException(error, context, trackEvent) {
|
|
90
|
+
const exception = error instanceof Error
|
|
91
|
+
? {
|
|
92
|
+
type: boundedExceptionText(error.name || "Error", 200),
|
|
93
|
+
message: boundedExceptionText(error.message || error.name || "Error", MAX_EXCEPTION_MESSAGE_LENGTH),
|
|
94
|
+
stack: error.stack
|
|
95
|
+
? boundedExceptionText(error.stack, MAX_EXCEPTION_STACK_LENGTH)
|
|
96
|
+
: undefined,
|
|
97
|
+
}
|
|
98
|
+
: {
|
|
99
|
+
type: "Error",
|
|
100
|
+
message: boundedExceptionText(error, MAX_EXCEPTION_MESSAGE_LENGTH),
|
|
101
|
+
stack: undefined,
|
|
102
|
+
};
|
|
103
|
+
const tags = {};
|
|
104
|
+
for (const [key, value] of Object.entries(context.tags ?? {})) {
|
|
105
|
+
if (Object.keys(tags).length >= MAX_EXCEPTION_TAGS || value == null)
|
|
106
|
+
break;
|
|
107
|
+
const safeKey = boundedExceptionText(key, 100);
|
|
108
|
+
tags[safeKey] = SECRET_KEY_RE.test(safeKey)
|
|
109
|
+
? "<redacted>"
|
|
110
|
+
: boundedExceptionText(value, 200);
|
|
111
|
+
}
|
|
112
|
+
const extra = safeExceptionValue(context.extra);
|
|
113
|
+
trackEvent("$exception", {
|
|
114
|
+
app: "agent-native-cli",
|
|
115
|
+
template: "cli",
|
|
116
|
+
runtime: "cli",
|
|
117
|
+
source: "cli",
|
|
118
|
+
exceptionType: exception.type,
|
|
119
|
+
exceptionMessage: exception.message,
|
|
120
|
+
...(exception.stack ? { exceptionStack: exception.stack } : {}),
|
|
121
|
+
handled: context.handled ?? false,
|
|
122
|
+
level: context.level ?? "error",
|
|
123
|
+
occurredAt: new Date().toISOString(),
|
|
124
|
+
...(Object.keys(tags).length ? { exceptionTags: tags } : {}),
|
|
125
|
+
...(extra && typeof extra === "object" ? { exceptionExtra: extra } : {}),
|
|
126
|
+
});
|
|
127
|
+
}
|
|
42
128
|
/**
|
|
43
129
|
* Read (or lazily create) a stable per-machine install id, shared across both
|
|
44
130
|
* skills CLIs so one developer counts once. Best-effort: an unwritable home
|
|
@@ -110,6 +196,10 @@ export function createCliTelemetry(options) {
|
|
|
110
196
|
new Promise((resolve) => setTimeout(resolve, FLUSH_TIMEOUT_MS)),
|
|
111
197
|
]);
|
|
112
198
|
}
|
|
113
|
-
return {
|
|
199
|
+
return {
|
|
200
|
+
track,
|
|
201
|
+
captureException: (error, context = {}) => captureException(error, context, track),
|
|
202
|
+
flush,
|
|
203
|
+
};
|
|
114
204
|
}
|
|
115
205
|
//# sourceMappingURL=telemetry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/cli/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO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,UAAoC;QAChE,IAAI,QAAQ;YAAE,OAAO;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;YAC1B,SAAS;YACT,KAAK;YACL,WAAW,EAAE,SAAS;YACtB,SAAS,EAAE,KAAK;YAChB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,UAAU,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,EAAE;SACvC,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE;YAC9B,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI;YACJ,SAAS,EAAE,IAAI;SAChB,CAAC;aACC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;aACrB,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC1B,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACtB,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,UAAU,KAAK;QAClB,IAAI,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC;YAAE,OAAO;QAC5C,MAAM,OAAO,CAAC,IAAI,CAAC;YACjB,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC;YACjC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;SAChE,CAAC,CAAC;IACL,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC1B,CAAC","sourcesContent":["/**\n * Best-effort install-funnel telemetry for the core CLI.\n *\n * Events are POSTed to the first-party Agent Native Analytics endpoint\n * (analytics.agent-native.com/track) using a PUBLIC, write-only key — the same\n * mechanism every agent-native app uses to report client-side events. Nothing\n * here ever blocks or throws into the install flow: sends are fire-and-forget\n * and `flush()` awaits any in-flight requests with a short cap before exit.\n *\n * Privacy: we report skill NAMES, client ids, scope, counts, platform, and the\n * CLI version — never file paths, repo names, cwd, skill sources, or anything\n * user-identifying. A random per-machine install id (unique installs) and a\n * per-invocation run id (step-by-step dropoff) are the only identifiers.\n *\n * Opt out with DO_NOT_TRACK=1 or AGENT_NATIVE_TELEMETRY_DISABLED=1.\n */\nimport crypto from \"node:crypto\";\nimport fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\n// Public, write-only analytics key. Safe to embed (revocable from the Analytics\n// settings UI). Override with AGENT_NATIVE_ANALYTICS_PUBLIC_KEY for testing or\n// to point telemetry at a different first-party analytics instance.\n// guard:allow-public-key -- first-party analytics write key is public by design.\nconst EMBEDDED_PUBLIC_KEY =\n \"anpk_dc523e34b99bc34d76e82d94c46593544e4a8509a4bfc93c\";\nconst DEFAULT_ENDPOINT = \"https://analytics.agent-native.com/track\";\nconst FLUSH_TIMEOUT_MS = 1500;\n\nexport interface CliTelemetryOptions {\n /** Stable identifier for the emitting CLI, e.g. \"skills-installer\". */\n cli: string;\n cliVersion: string;\n command: string;\n interactive: boolean;\n}\n\nexport interface CliTelemetry {\n track(event: string, properties?: Record<string, unknown>): void;\n flush(): Promise<void>;\n}\n\nfunction resolvePublicKey(): string {\n const fromEnv = process.env.AGENT_NATIVE_ANALYTICS_PUBLIC_KEY?.trim();\n return fromEnv || EMBEDDED_PUBLIC_KEY;\n}\n\nfunction resolveEndpoint(): string {\n const fromEnv = process.env.AGENT_NATIVE_ANALYTICS_ENDPOINT?.trim();\n return (fromEnv || DEFAULT_ENDPOINT).replace(/\\/+$/, \"\");\n}\n\nfunction telemetryDisabled(): boolean {\n return (\n process.env.DO_NOT_TRACK === \"1\" ||\n process.env.AGENT_NATIVE_TELEMETRY_DISABLED === \"1\" ||\n process.env.NODE_ENV === \"test\" ||\n typeof fetch !== \"function\"\n );\n}\n\n/**\n * Read (or lazily create) a stable per-machine install id, shared across both\n * skills CLIs so one developer counts once. Best-effort: an unwritable home\n * directory just yields an ephemeral id for this run.\n */\nfunction resolveInstallId(): string {\n try {\n const dir = path.join(os.homedir(), \".agent-native\");\n const file = path.join(dir, \"installation-id\");\n const existing = fs.existsSync(file)\n ? fs.readFileSync(file, \"utf8\").trim()\n : \"\";\n if (existing) return existing;\n const id = crypto.randomUUID();\n fs.mkdirSync(dir, { recursive: true });\n fs.writeFileSync(file, `${id}\\n`, \"utf8\");\n return id;\n } catch {\n return crypto.randomUUID();\n }\n}\n\nexport function createCliTelemetry(options: CliTelemetryOptions): CliTelemetry {\n const publicKey = resolvePublicKey();\n const disabled = telemetryDisabled() || !publicKey;\n const endpoint = resolveEndpoint();\n const installId = disabled ? \"\" : resolveInstallId();\n const runId = crypto.randomUUID();\n const inFlight = new Set<Promise<void>>();\n\n const base = {\n cli: options.cli,\n cliVersion: options.cliVersion,\n command: options.command,\n node: process.version,\n platform: process.platform,\n ci: process.env.CI === \"true\",\n interactive: options.interactive,\n runId,\n installId,\n };\n\n function track(event: string, properties?: Record<string, unknown>): void {\n if (disabled) return;\n const body = JSON.stringify({\n publicKey,\n event,\n anonymousId: installId,\n sessionId: runId,\n timestamp: new Date().toISOString(),\n properties: { ...base, ...properties },\n });\n const promise = fetch(endpoint, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body,\n keepalive: true,\n })\n .then(() => undefined)\n .catch(() => undefined);\n inFlight.add(promise);\n void promise.finally(() => inFlight.delete(promise));\n }\n\n async function flush(): Promise<void> {\n if (disabled || inFlight.size === 0) return;\n await Promise.race([\n Promise.allSettled([...inFlight]),\n new Promise((resolve) => setTimeout(resolve, FLUSH_TIMEOUT_MS)),\n ]);\n }\n\n return { track, flush };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/cli/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;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I,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC;YAAE,OAAO;QAC5C,MAAM,OAAO,CAAC,IAAI,CAAC;YACjB,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC;YACjC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;SAChE,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,KAAK;QACL,gBAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,CACxC,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC;QACzC,KAAK;KACN,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Best-effort install-funnel telemetry for the core CLI.\n *\n * Events are POSTed to the first-party Agent Native Analytics endpoint\n * (analytics.agent-native.com/track) using a PUBLIC, write-only key — the same\n * mechanism every agent-native app uses to report client-side events. Nothing\n * here ever blocks or throws into the install flow: sends are fire-and-forget\n * and `flush()` awaits any in-flight requests with a short cap before exit.\n *\n * Privacy: we report skill NAMES, client ids, scope, counts, platform, and the\n * CLI version — never file paths, repo names, cwd, skill sources, or anything\n * user-identifying. A random per-machine install id (unique installs) and a\n * per-invocation run id (step-by-step dropoff) are the only identifiers.\n *\n * Opt out with DO_NOT_TRACK=1 or AGENT_NATIVE_TELEMETRY_DISABLED=1.\n */\nimport crypto from \"node:crypto\";\nimport fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\n// Public, write-only analytics key. Safe to embed (revocable from the Analytics\n// settings UI). Override with AGENT_NATIVE_ANALYTICS_PUBLIC_KEY for testing or\n// to point telemetry at a different first-party analytics instance.\n// guard:allow-public-key -- first-party analytics write key is public by design.\nconst EMBEDDED_PUBLIC_KEY =\n \"anpk_dc523e34b99bc34d76e82d94c46593544e4a8509a4bfc93c\";\nconst DEFAULT_ENDPOINT = \"https://analytics.agent-native.com/track\";\nconst FLUSH_TIMEOUT_MS = 1500;\n\nexport interface CliTelemetryOptions {\n /** Stable identifier for the emitting CLI, e.g. \"skills-installer\". */\n cli: string;\n cliVersion: string;\n command: string;\n interactive: boolean;\n}\n\nexport interface CliTelemetry {\n track(event: string, properties?: Record<string, unknown>): void;\n captureException(error: unknown, context?: CliExceptionContext): void;\n flush(): Promise<void>;\n}\n\nexport interface CliExceptionContext {\n handled?: boolean;\n level?: \"fatal\" | \"error\" | \"warning\" | \"info\" | \"debug\";\n tags?: Record<string, string | number | boolean | null | undefined>;\n extra?: Record<string, unknown>;\n}\n\nfunction resolvePublicKey(): string {\n const fromEnv = process.env.AGENT_NATIVE_ANALYTICS_PUBLIC_KEY?.trim();\n return fromEnv || EMBEDDED_PUBLIC_KEY;\n}\n\nfunction resolveEndpoint(): string {\n const fromEnv = process.env.AGENT_NATIVE_ANALYTICS_ENDPOINT?.trim();\n return (fromEnv || DEFAULT_ENDPOINT).replace(/\\/+$/, \"\");\n}\n\nfunction telemetryDisabled(): boolean {\n return (\n process.env.DO_NOT_TRACK === \"1\" ||\n process.env.AGENT_NATIVE_TELEMETRY_DISABLED === \"1\" ||\n process.env.NODE_ENV === \"test\" ||\n typeof fetch !== \"function\"\n );\n}\n\nconst MAX_EXCEPTION_MESSAGE_LENGTH = 1000;\nconst MAX_EXCEPTION_STACK_LENGTH = 8000;\nconst MAX_EXCEPTION_TAGS = 30;\nconst MAX_EXCEPTION_EXTRA_KEYS = 30;\nconst MAX_EXCEPTION_VALUE_LENGTH = 1000;\nconst SECRET_RE = /\\b(?:bearer|basic)\\s+[^\\s]+/gi;\nconst SECRET_KEY_RE =\n /(?:authorization|cookie|set[-_]?cookie|token|secret|password|passwd|pwd|api[-_]?key|apikey|credential)/i;\n\nfunction redactExceptionText(value: string): string {\n return value\n .replace(SECRET_RE, (match) => `${match.split(/\\s+/, 1)[0]} <redacted>`)\n .replace(\n /([A-Za-z0-9_$.-]*(?:authorization|cookie|token|secret|password|passwd|pwd|api[-_]?key|apikey|credential)[A-Za-z0-9_$.-]*\\s*[:=]\\s*)([^\\s,;}]+)/gi,\n \"$1<redacted>\",\n );\n}\n\nfunction boundedExceptionText(value: unknown, max: number): string {\n const text =\n typeof value === \"string\" ? value : String(value ?? \"Unknown error\");\n const safe = redactExceptionText(text);\n return safe.length > max ? safe.slice(0, max) : safe;\n}\n\nfunction safeExceptionValue(value: unknown, depth = 2): unknown {\n if (\n value == null ||\n typeof value === \"boolean\" ||\n typeof value === \"number\"\n ) {\n return value;\n }\n if (typeof value === \"string\") {\n return boundedExceptionText(value, MAX_EXCEPTION_VALUE_LENGTH);\n }\n if (depth <= 0)\n return boundedExceptionText(value, MAX_EXCEPTION_VALUE_LENGTH);\n if (Array.isArray(value)) {\n return value\n .slice(0, 20)\n .map((item) => safeExceptionValue(item, depth - 1));\n }\n if (typeof value === \"object\") {\n const out: Record<string, unknown> = {};\n for (const [key, child] of Object.entries(value)) {\n if (Object.keys(out).length >= MAX_EXCEPTION_EXTRA_KEYS) break;\n const safeKey = boundedExceptionText(key, 100);\n out[safeKey] = SECRET_KEY_RE.test(safeKey)\n ? \"<redacted>\"\n : safeExceptionValue(child, depth - 1);\n }\n return out;\n }\n return boundedExceptionText(value, MAX_EXCEPTION_VALUE_LENGTH);\n}\n\nfunction captureException(\n error: unknown,\n context: CliExceptionContext,\n trackEvent: (event: string, properties?: Record<string, unknown>) => void,\n): void {\n const exception =\n error instanceof Error\n ? {\n type: boundedExceptionText(error.name || \"Error\", 200),\n message: boundedExceptionText(\n error.message || error.name || \"Error\",\n MAX_EXCEPTION_MESSAGE_LENGTH,\n ),\n stack: error.stack\n ? boundedExceptionText(error.stack, MAX_EXCEPTION_STACK_LENGTH)\n : undefined,\n }\n : {\n type: \"Error\",\n message: boundedExceptionText(error, MAX_EXCEPTION_MESSAGE_LENGTH),\n stack: undefined,\n };\n const tags: Record<string, string> = {};\n for (const [key, value] of Object.entries(context.tags ?? {})) {\n if (Object.keys(tags).length >= MAX_EXCEPTION_TAGS || value == null) break;\n const safeKey = boundedExceptionText(key, 100);\n tags[safeKey] = SECRET_KEY_RE.test(safeKey)\n ? \"<redacted>\"\n : boundedExceptionText(value, 200);\n }\n const extra = safeExceptionValue(context.extra);\n trackEvent(\"$exception\", {\n app: \"agent-native-cli\",\n template: \"cli\",\n runtime: \"cli\",\n source: \"cli\",\n exceptionType: exception.type,\n exceptionMessage: exception.message,\n ...(exception.stack ? { exceptionStack: exception.stack } : {}),\n handled: context.handled ?? false,\n level: context.level ?? \"error\",\n occurredAt: new Date().toISOString(),\n ...(Object.keys(tags).length ? { exceptionTags: tags } : {}),\n ...(extra && typeof extra === \"object\" ? { exceptionExtra: extra } : {}),\n });\n}\n\n/**\n * Read (or lazily create) a stable per-machine install id, shared across both\n * skills CLIs so one developer counts once. Best-effort: an unwritable home\n * directory just yields an ephemeral id for this run.\n */\nfunction resolveInstallId(): string {\n try {\n const dir = path.join(os.homedir(), \".agent-native\");\n const file = path.join(dir, \"installation-id\");\n const existing = fs.existsSync(file)\n ? fs.readFileSync(file, \"utf8\").trim()\n : \"\";\n if (existing) return existing;\n const id = crypto.randomUUID();\n fs.mkdirSync(dir, { recursive: true });\n fs.writeFileSync(file, `${id}\\n`, \"utf8\");\n return id;\n } catch {\n return crypto.randomUUID();\n }\n}\n\nexport function createCliTelemetry(options: CliTelemetryOptions): CliTelemetry {\n const publicKey = resolvePublicKey();\n const disabled = telemetryDisabled() || !publicKey;\n const endpoint = resolveEndpoint();\n const installId = disabled ? \"\" : resolveInstallId();\n const runId = crypto.randomUUID();\n const inFlight = new Set<Promise<void>>();\n\n const base = {\n cli: options.cli,\n cliVersion: options.cliVersion,\n command: options.command,\n node: process.version,\n platform: process.platform,\n ci: process.env.CI === \"true\",\n interactive: options.interactive,\n runId,\n installId,\n };\n\n function track(event: string, properties?: Record<string, unknown>): void {\n if (disabled) return;\n const body = JSON.stringify({\n publicKey,\n event,\n anonymousId: installId,\n sessionId: runId,\n timestamp: new Date().toISOString(),\n properties: { ...base, ...properties },\n });\n const promise = fetch(endpoint, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body,\n keepalive: true,\n })\n .then(() => undefined)\n .catch(() => undefined);\n inFlight.add(promise);\n void promise.finally(() => inFlight.delete(promise));\n }\n\n async function flush(): Promise<void> {\n if (disabled || inFlight.size === 0) return;\n await Promise.race([\n Promise.allSettled([...inFlight]),\n new Promise((resolve) => setTimeout(resolve, FLUSH_TIMEOUT_MS)),\n ]);\n }\n\n return {\n track,\n captureException: (error, context = {}) =>\n captureException(error, context, track),\n flush,\n };\n}\n"]}
|
|
@@ -162,6 +162,12 @@ export interface AgentSidebarProps {
|
|
|
162
162
|
* page-level AgentChatSurface can morph into it on navigation.
|
|
163
163
|
*/
|
|
164
164
|
chatViewTransition?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Mark the initial panel mount as the destination of a page-to-sidebar chat
|
|
167
|
+
* handoff. This suppresses only the drawer's initial entry animation; normal
|
|
168
|
+
* sidebar open/close transitions remain enabled.
|
|
169
|
+
*/
|
|
170
|
+
chatViewTransitionHandoff?: boolean;
|
|
165
171
|
/** Namespace for persisted chat state. Use the same key as AgentChatHome. */
|
|
166
172
|
storageKey?: string;
|
|
167
173
|
/** Open the sidebar when a chat run is active or reconnects. */
|
|
@@ -183,7 +189,7 @@ export interface AgentSidebarProps {
|
|
|
183
189
|
* Wraps app content with a toggleable agent sidebar.
|
|
184
190
|
* Use AgentToggleButton in your header to open/close it.
|
|
185
191
|
*/
|
|
186
|
-
export declare function AgentSidebar({ children, emptyStateText, suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position, defaultOpen, animateMobile, animateDesktop, chatViewTransition, storageKey, openOnChatRunning, onFullscreenRequest, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, }: AgentSidebarProps): React.JSX.Element;
|
|
192
|
+
export declare function AgentSidebar({ children, emptyStateText, suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position, defaultOpen, animateMobile, animateDesktop, chatViewTransition, chatViewTransitionHandoff, storageKey, openOnChatRunning, onFullscreenRequest, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, }: AgentSidebarProps): React.JSX.Element;
|
|
187
193
|
/**
|
|
188
194
|
* Focus the agent chat composer input.
|
|
189
195
|
* Opens the sidebar if closed, then focuses the text input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentPanel.d.ts","sourceRoot":"","sources":["../../src/client/AgentPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAmBH,OAAO,KASN,MAAM,OAAO,CAAC;AA6Bf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAapE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAY7D,OAAO,KAAK,EACV,gCAAgC,EAChC,0BAA0B,EAC3B,MAAM,4BAA4B,CAAC;AA0FpC,KAAK,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,UAAU,CAAC;AAC3D,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,SAAS,EACf,iBAAiB,EAAE,OAAO,GACzB,SAAS,CAEX;AAoLD,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,gCAAgC,CAAC,MAAM,CAAC,EAC9C,WAAW,EAAE,MAAM;;;;;;EAcpB;AAED,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,gCAAgC,CAAC,MAAM,CAAC,EAC9C,WAAW,EAAE,MAAM,WAOpB;AAED,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,gCAAgC,CAAC,MAAM,CAAC,WAG/C;AAED,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,gCAAgC,CAAC,MAAM,CAAC,EAC9C,WAAW,EAAE,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;IAC/D,iEAAiE;IACjE,cAAc,CAAC,EAAE,0BAA0B,CAAC,gBAAgB,CAAC,CAAC;IAC9D,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,0BAA0B,CAAC,eAAe,CAAC,CAAC;IAC5D,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,cAAsC,EACtC,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,QAAkB,EAClB,WAAmB,EACnB,aAAoB,EACpB,cAAqB,EACrB,kBAA0B,EAC1B,yBAAiC,EACjC,UAAU,EACV,iBAAyB,EACzB,mBAAmB,EACnB,KAAK,EACL,cAAc,EACd,YAAY,EACZ,aAAa,EACb,aAAa,GACd,EAAE,iBAAiB,qBAqmBnB;AAED;;;GAGG;AACH,wBAAgB,cAAc,SAqB7B;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,4BAkCtE"}
|
|
@@ -1287,7 +1287,7 @@ export function AgentChatSurface({ mode = "panel", className, defaultMode = "cha
|
|
|
1287
1287
|
* Wraps app content with a toggleable agent sidebar.
|
|
1288
1288
|
* Use AgentToggleButton in your header to open/close it.
|
|
1289
1289
|
*/
|
|
1290
|
-
export function AgentSidebar({ children, emptyStateText = "How can I help you?", suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position = "right", defaultOpen = false, animateMobile = true, animateDesktop = true, chatViewTransition = false, storageKey, openOnChatRunning = false, onFullscreenRequest, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, }) {
|
|
1290
|
+
export function AgentSidebar({ children, emptyStateText = "How can I help you?", suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position = "right", defaultOpen = false, animateMobile = true, animateDesktop = true, chatViewTransition = false, chatViewTransitionHandoff = false, storageKey, openOnChatRunning = false, onFullscreenRequest, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, }) {
|
|
1291
1291
|
const initialWidth = defaultSidebarWidth ?? sidebarWidth ?? 380;
|
|
1292
1292
|
const [open, setOpen] = useState(() => openOnChatRunning || getInitialAgentSidebarOpen(defaultOpen, storageKey));
|
|
1293
1293
|
const [presentationMode, setPresentationMode] = useState(false);
|
|
@@ -1710,7 +1710,7 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1710
1710
|
? "mobile"
|
|
1711
1711
|
: desktopAnimationEnabled
|
|
1712
1712
|
? "desktop"
|
|
1713
|
-
: undefined, "data-agent-sidebar-layout": panelLayout, "data-agent-sidebar-position": position, "data-agent-sidebar-state": panelOpen ? "open" : "closed", "data-agent-sidebar-resizing": isResizing ? "true" : undefined, style: chatViewTransition
|
|
1713
|
+
: undefined, "data-agent-sidebar-layout": panelLayout, "data-agent-sidebar-position": position, "data-agent-sidebar-state": panelOpen ? "open" : "closed", "data-agent-sidebar-resizing": isResizing ? "true" : undefined, "data-agent-sidebar-chat-handoff": chatViewTransitionHandoff ? "true" : undefined, style: chatViewTransition
|
|
1714
1714
|
? getAgentChatViewTransitionStyle(panelStyle)
|
|
1715
1715
|
: panelStyle, inert: sidebarAnimationEnabled && !panelOpen ? true : undefined, "aria-hidden": sidebarAnimationEnabled && !panelOpen ? true : undefined, children: _jsx("div", { className: "agent-sidebar-panel-inner flex min-h-0 flex-1 flex-col", children: _jsx(AgentPanel, { emptyStateText: emptyStateText, suggestions: suggestions, dynamicSuggestions: dynamicSuggestions, composerToolbarSlot: composerToolbarSlot, composerSlot: composerSlot, onComposerTextChange: onComposerTextChange, imageModelMenu: imageModelMenu, threadFooterSlot: threadFooterSlot, missingApiKeySetupLayout: "sidebar", onCollapse: () => setOpenPersisted(false), isFullscreen: effectiveFullscreen, onToggleFullscreen: isMobile ? undefined : (onFullscreenRequest ?? toggleFullscreen), storageKey: storageKey, scope: scope, showScopeBadge: showScopeBadge, browserTabId: browserTabId, threadUrlSync: threadUrlSync, agentPageHref: agentPageHref, allowSettingsMode: false }) }) }), showResizeHandle && isLeft && (_jsx(ResizeHandle, { position: position, onDrag: handleDrag, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd }))] })) : null;
|
|
1716
1716
|
return (_jsx(RealtimeVoiceModeProvider, { browserTabId: browserTabId, children: _jsxs("div", { className: "agent-sidebar-shell flex min-w-0 flex-1 h-screen overflow-hidden", "data-agent-sidebar-position": position, "data-agent-sidebar-resizing": isResizing ? "true" : undefined, children: [_jsx(AgentNativeRouteWarmup, {}), isMobile &&
|