@agent-native/core 0.108.0 → 0.109.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 +25 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/a2a/client.ts +162 -17
- package/corpus/core/src/a2a/correlation.ts +50 -0
- package/corpus/core/src/a2a/handlers.ts +200 -14
- package/corpus/core/src/a2a/index.ts +7 -1
- package/corpus/core/src/a2a/invoke.ts +77 -1
- package/corpus/core/src/a2a/server.ts +13 -1
- package/corpus/core/src/a2a/task-store.ts +146 -6
- package/corpus/core/src/a2a/types.ts +32 -0
- package/corpus/core/src/action.ts +5 -2
- package/corpus/core/src/agent/production-agent.ts +33 -4
- package/corpus/core/src/client/AssistantChat.tsx +648 -603
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +31 -4
- package/corpus/core/src/client/agent-chat-adapter.ts +23 -37
- package/corpus/core/src/client/agent-sidebar-state.ts +4 -0
- package/corpus/core/src/client/analytics.ts +84 -0
- package/corpus/core/src/client/chat/message-components.tsx +94 -22
- package/corpus/core/src/client/chat/tool-call-display.tsx +170 -47
- package/corpus/core/src/client/chat/use-agent-chat-lifecycle-tracking.ts +74 -0
- package/corpus/core/src/client/chat-thread-url.ts +11 -0
- package/corpus/core/src/client/error-capture.ts +12 -0
- package/corpus/core/src/client/extensions/ExtensionSlot.tsx +37 -1
- package/corpus/core/src/client/index.ts +2 -0
- package/corpus/core/src/client/route-chunk-recovery.ts +20 -8
- package/corpus/core/src/client/session-replay.ts +31 -0
- package/corpus/core/src/client/use-run-stuck-detection.ts +27 -1
- package/corpus/core/src/db/client.ts +55 -0
- package/corpus/core/src/extensions/actions.ts +2 -14
- package/corpus/core/src/extensions/store.ts +1 -1
- package/corpus/core/src/localization/default-messages.ts +3 -0
- package/corpus/core/src/mcp/build-server.ts +2 -2
- package/corpus/core/src/observability/traces.ts +172 -19
- package/corpus/core/src/progress/actions.ts +4 -2
- package/corpus/core/src/provider-api/index.ts +205 -105
- package/corpus/core/src/scripts/call-agent.ts +190 -19
- package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +112 -25
- package/corpus/core/src/server/agent-chat-plugin.ts +136 -4
- package/corpus/core/src/styles/agent-conversation.css +7 -0
- package/corpus/core/src/templates/default/app/i18n/ar-SA.ts +20 -0
- package/corpus/core/src/templates/default/app/i18n/de-DE.ts +20 -0
- package/corpus/core/src/templates/default/app/i18n/en-US.ts +20 -0
- package/corpus/core/src/templates/default/app/i18n/es-ES.ts +20 -0
- package/corpus/core/src/templates/default/app/i18n/fr-FR.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/hi-IN.ts +19 -0
- package/corpus/core/src/templates/default/app/i18n/ja-JP.ts +20 -0
- package/corpus/core/src/templates/default/app/i18n/ko-KR.ts +19 -0
- package/corpus/core/src/templates/default/app/i18n/pt-BR.ts +20 -0
- package/corpus/core/src/templates/default/app/i18n/zh-CN.ts +19 -0
- package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +19 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +49 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +5 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/observability/SKILL.md +7 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/performance/SKILL.md +13 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/tracking/SKILL.md +1 -1
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +29 -10
- package/corpus/templates/analytics/.agents/skills/gong/SKILL.md +54 -23
- package/corpus/templates/analytics/.builder/skills/apollo/SKILL.md +19 -41
- package/corpus/templates/analytics/.builder/skills/commonroom/SKILL.md +20 -35
- package/corpus/templates/analytics/.builder/skills/github/SKILL.md +23 -67
- package/corpus/templates/analytics/.builder/skills/pylon/SKILL.md +25 -43
- package/corpus/templates/analytics/AGENTS.md +22 -13
- package/corpus/templates/analytics/actions/account-deep-dive.ts +1 -0
- package/corpus/templates/analytics/actions/configure-gong-native-insights.ts +29 -0
- package/corpus/templates/analytics/actions/content-calendar-schema.ts +8 -4
- package/corpus/templates/analytics/actions/content-calendar.ts +12 -4
- package/corpus/templates/analytics/actions/dashboard-mutation-api.ts +2 -1
- package/corpus/templates/analytics/actions/gong-calls.ts +113 -22
- package/corpus/templates/analytics/actions/gong-native-insights.ts +166 -0
- package/corpus/templates/analytics/actions/hubspot-deals.ts +190 -46
- package/corpus/templates/analytics/actions/pylon-issues.ts +123 -0
- package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +1 -1
- package/corpus/templates/analytics/actions/slack-messages.ts +179 -27
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +48 -152
- package/corpus/templates/analytics/app/components/ui/chart.tsx +1 -1
- package/corpus/templates/analytics/app/hooks/use-chart-tooltip-flip.ts +21 -6
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +13 -0
- package/corpus/templates/analytics/app/i18n-data.ts +134 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +181 -30
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +6 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +4 -3
- package/corpus/templates/analytics/changelog/2026-07-17-analytics-now-includes-a-default-alert-for-spikes-in-stuck-agent-chats.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-17-dashboard-editors-can-add-shared-extensions-or-opt-into-per-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-17-dashboard-extensions-show-a-loading-skeleton.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-17-errors-now-group-repeat-failures-consistently-and-keep-priva.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-17-gong-transcript-reviews-now-batch-bounded-call-windows-for-f.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-17-hubspot-deal-filters-now-run-in-hubspot-before-paging-result.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-17-notion-content-calendars-now-discover-the-matching-database-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-17-pylon-dashboard-reads-now-use-the-paginated-issue-search-api.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-17-slack-reads-no-longer-join-channels-and-report-pagination-coverage.md +6 -0
- package/corpus/templates/analytics/docs/schemas/first-party-analytics.md +23 -14
- package/corpus/templates/analytics/docs/schemas/tracked-events.md +5 -1
- package/corpus/templates/analytics/server/handlers/notion.ts +14 -3
- package/corpus/templates/analytics/server/handlers/slack.ts +182 -29
- package/corpus/templates/analytics/server/jobs/analytics-alerts.ts +3 -3
- package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +2 -6
- package/corpus/templates/analytics/server/lib/analytics-alerts.ts +209 -87
- package/corpus/templates/analytics/server/lib/analytics-connector-catalog.ts +6 -2
- package/corpus/templates/analytics/server/lib/error-capture.ts +75 -8
- package/corpus/templates/analytics/server/lib/gong-native-policy.ts +72 -0
- package/corpus/templates/analytics/server/lib/gong.ts +54 -66
- package/corpus/templates/analytics/server/lib/hubspot.ts +40 -3
- package/corpus/templates/analytics/server/lib/notion.ts +83 -8
- package/corpus/templates/analytics/server/lib/real-data-actions.ts +4 -0
- package/corpus/templates/analytics/server/lib/slack.ts +242 -90
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +3 -3
- package/corpus/templates/analytics/server/routes/api/pylon/accounts.get.ts +42 -1
- package/corpus/templates/analytics/server/routes/api/pylon/issues.get.ts +71 -1
- package/corpus/templates/analytics/server/routes/api/test-connection.post.ts +44 -4
- package/corpus/templates/clips/actions/finalize-recording.ts +541 -62
- package/corpus/templates/clips/app/components/library/bulk-action-toolbar.tsx +19 -1
- package/corpus/templates/clips/app/components/library/create-folder-dialog.tsx +123 -0
- package/corpus/templates/clips/app/components/library/library-grid.tsx +42 -4
- package/corpus/templates/clips/app/components/library/recording-card.tsx +30 -0
- package/corpus/templates/clips/app/components/player/playback-comment-overlay.tsx +17 -2
- package/corpus/templates/clips/app/components/player/video-player.tsx +14 -2
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +2 -2
- package/corpus/templates/clips/app/entry.client.tsx +6 -1
- package/corpus/templates/clips/app/i18n/ar-SA.ts +12 -1
- package/corpus/templates/clips/app/i18n/de-DE.ts +12 -1
- package/corpus/templates/clips/app/i18n/en-US.ts +12 -1
- package/corpus/templates/clips/app/i18n/es-ES.ts +11 -1
- package/corpus/templates/clips/app/i18n/fr-FR.ts +11 -1
- package/corpus/templates/clips/app/i18n/hi-IN.ts +10 -1
- package/corpus/templates/clips/app/i18n/ja-JP.ts +12 -1
- package/corpus/templates/clips/app/i18n/ko-KR.ts +11 -1
- package/corpus/templates/clips/app/i18n/pt-BR.ts +11 -1
- package/corpus/templates/clips/app/i18n/zh-CN.ts +11 -1
- package/corpus/templates/clips/app/i18n/zh-TW.ts +11 -1
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +72 -1
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +1 -1
- package/corpus/templates/clips/app/routes/record.tsx +3 -3
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +6 -3
- package/corpus/templates/clips/changelog/2026-07-17-choose-which-workspace-receives-new-clips-recordings-and-des.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-clips-now-retries-storage-verification-in-the-background-ins.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-create-folders-directly-from-the-move-menu.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-failed-desktop-uploads-now-offer-a-direct-way-to-reopen-clip.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-fixed-broken-thumbnail-icons-appearing-over-playable-clip-em.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-playback-comments-stay-readable-at-faster-playback-speeds.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/finalize-recovery.ts +3 -0
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +3 -3
- package/corpus/templates/clips/desktop/src/app.tsx +19 -7
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +111 -13
- package/corpus/templates/clips/desktop/src/lib/upload-verification.ts +16 -7
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +2 -4
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen/live_upload.rs +32 -15
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +45 -18
- package/corpus/templates/clips/server/jobs/media-verification.ts +130 -0
- package/corpus/templates/clips/server/lib/builder-media-compression.ts +15 -0
- package/corpus/templates/clips/server/lib/media-verification-state.ts +38 -0
- package/corpus/templates/clips/server/lib/player-thumbnail-url.ts +31 -0
- package/corpus/templates/clips/server/lib/post-finalize-dispatch.ts +10 -3
- package/corpus/templates/clips/server/plugins/auth.ts +5 -5
- package/corpus/templates/clips/server/plugins/calendar-jobs.ts +2 -0
- package/corpus/templates/clips/server/routes/api/_agent-native-background/post-finalize-worker.post.ts +12 -2
- package/corpus/templates/clips/server/routes/api/public-recording.get.ts +6 -1
- package/corpus/templates/clips/server/routes/api/thumbnail/[recordingId].get.ts +340 -0
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/abort.post.ts +24 -7
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +91 -7
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/status.get.ts +14 -0
- package/corpus/templates/clips/shared/finalize-recovery.ts +61 -2
- package/corpus/templates/clips/shared/share-meta.ts +1 -1
- package/corpus/templates/content/app/entry.client.tsx +6 -1
- package/corpus/templates/dispatch/AGENTS.md +5 -0
- package/corpus/templates/dispatch/changelog/2026-07-17-apps-page-links-to-other-available-apps.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-17-curated-template-remixes.md +6 -0
- package/corpus/templates/mail/app/entry.client.tsx +6 -1
- package/corpus/templates/slides/.agents/skills/slide-images/SKILL.md +11 -7
- package/corpus/templates/slides/.env.example +0 -1
- package/corpus/templates/slides/AGENTS.md +4 -0
- package/corpus/templates/slides/DEVELOPING.md +2 -2
- package/corpus/templates/slides/actions/index-design-system-with-builder.ts +1 -1
- package/corpus/templates/slides/actions/logo-config.ts +6 -7
- package/corpus/templates/slides/actions/search-images.ts +11 -39
- package/corpus/templates/slides/actions/search-logos.ts +5 -52
- package/corpus/templates/slides/app/components/editor/ImageSearchPanel.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/LogoSearchPanel.tsx +16 -26
- package/corpus/templates/slides/app/entry.client.tsx +6 -1
- package/corpus/templates/slides/server/lib/media-search-providers.ts +216 -0
- package/corpus/templates/slides/server/register-secrets.ts +30 -0
- package/dist/a2a/client.d.ts +47 -1
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +94 -12
- package/dist/a2a/client.js.map +1 -1
- package/dist/a2a/correlation.d.ts +10 -0
- package/dist/a2a/correlation.d.ts.map +1 -0
- package/dist/a2a/correlation.js +40 -0
- package/dist/a2a/correlation.js.map +1 -0
- package/dist/a2a/handlers.d.ts.map +1 -1
- package/dist/a2a/handlers.js +147 -15
- package/dist/a2a/handlers.js.map +1 -1
- package/dist/a2a/index.d.ts +4 -4
- package/dist/a2a/index.d.ts.map +1 -1
- package/dist/a2a/index.js +2 -2
- package/dist/a2a/index.js.map +1 -1
- package/dist/a2a/invoke.d.ts +29 -2
- package/dist/a2a/invoke.d.ts.map +1 -1
- package/dist/a2a/invoke.js +33 -1
- package/dist/a2a/invoke.js.map +1 -1
- package/dist/a2a/server.d.ts.map +1 -1
- package/dist/a2a/server.js +14 -1
- package/dist/a2a/server.js.map +1 -1
- package/dist/a2a/task-store.d.ts +12 -1
- package/dist/a2a/task-store.d.ts.map +1 -1
- package/dist/a2a/task-store.js +96 -6
- package/dist/a2a/task-store.js.map +1 -1
- package/dist/a2a/types.d.ts +27 -0
- package/dist/a2a/types.d.ts.map +1 -1
- package/dist/a2a/types.js.map +1 -1
- package/dist/action.d.ts +5 -2
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js.map +1 -1
- package/dist/agent/production-agent.d.ts +14 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +19 -3
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +14 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +158 -136
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +27 -4
- 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 +21 -39
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/agent-sidebar-state.d.ts +1 -0
- package/dist/client/agent-sidebar-state.d.ts.map +1 -1
- package/dist/client/agent-sidebar-state.js +4 -0
- package/dist/client/agent-sidebar-state.js.map +1 -1
- package/dist/client/analytics.d.ts +14 -0
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +67 -0
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +8 -0
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +62 -19
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +6 -0
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +83 -14
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/chat/use-agent-chat-lifecycle-tracking.d.ts +8 -0
- package/dist/client/chat/use-agent-chat-lifecycle-tracking.d.ts.map +1 -0
- package/dist/client/chat/use-agent-chat-lifecycle-tracking.js +51 -0
- package/dist/client/chat/use-agent-chat-lifecycle-tracking.js.map +1 -0
- package/dist/client/chat-thread-url.d.ts +2 -0
- package/dist/client/chat-thread-url.d.ts.map +1 -0
- package/dist/client/chat-thread-url.js +12 -0
- package/dist/client/chat-thread-url.js.map +1 -0
- package/dist/client/error-capture.d.ts.map +1 -1
- package/dist/client/error-capture.js +7 -0
- package/dist/client/error-capture.js.map +1 -1
- package/dist/client/extensions/ExtensionSlot.d.ts +3 -1
- package/dist/client/extensions/ExtensionSlot.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionSlot.js +28 -3
- package/dist/client/extensions/ExtensionSlot.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/route-chunk-recovery.d.ts.map +1 -1
- package/dist/client/route-chunk-recovery.js +14 -9
- package/dist/client/route-chunk-recovery.js.map +1 -1
- package/dist/client/session-replay.d.ts +15 -0
- package/dist/client/session-replay.d.ts.map +1 -1
- package/dist/client/session-replay.js +20 -0
- package/dist/client/session-replay.js.map +1 -1
- package/dist/client/use-run-stuck-detection.d.ts.map +1 -1
- package/dist/client/use-run-stuck-detection.js +25 -1
- package/dist/client/use-run-stuck-detection.js.map +1 -1
- package/dist/db/client.d.ts +7 -0
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +33 -0
- package/dist/db/client.js.map +1 -1
- package/dist/extensions/actions.d.ts.map +1 -1
- package/dist/extensions/actions.js +2 -10
- package/dist/extensions/actions.js.map +1 -1
- package/dist/extensions/store.js +1 -1
- package/dist/extensions/store.js.map +1 -1
- package/dist/localization/default-messages.d.ts +3 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +3 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp/build-server.d.ts +2 -0
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +2 -2
- package/dist/mcp/build-server.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +5 -5
- package/dist/observability/traces.d.ts +9 -0
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js +137 -19
- package/dist/observability/traces.js.map +1 -1
- package/dist/progress/actions.d.ts.map +1 -1
- package/dist/progress/actions.js +3 -2
- package/dist/progress/actions.js.map +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/provider-api/index.d.ts.map +1 -1
- package/dist/provider-api/index.js +91 -8
- package/dist/provider-api/index.js.map +1 -1
- package/dist/scripts/call-agent.d.ts.map +1 -1
- package/dist/scripts/call-agent.js +140 -17
- package/dist/scripts/call-agent.js.map +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-chat/action-filters-a2a.d.ts +24 -2
- package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -1
- package/dist/server/agent-chat/action-filters-a2a.js +62 -7
- 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 +118 -5
- 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/transcribe-voice.d.ts +1 -1
- package/dist/styles/agent-conversation.css +7 -0
- package/dist/templates/default/app/i18n/ar-SA.ts +20 -0
- package/dist/templates/default/app/i18n/de-DE.ts +20 -0
- package/dist/templates/default/app/i18n/en-US.ts +20 -0
- package/dist/templates/default/app/i18n/es-ES.ts +20 -0
- package/dist/templates/default/app/i18n/fr-FR.ts +21 -0
- package/dist/templates/default/app/i18n/hi-IN.ts +19 -0
- package/dist/templates/default/app/i18n/ja-JP.ts +20 -0
- package/dist/templates/default/app/i18n/ko-KR.ts +19 -0
- package/dist/templates/default/app/i18n/pt-BR.ts +20 -0
- package/dist/templates/default/app/i18n/zh-CN.ts +19 -0
- package/dist/templates/default/app/i18n/zh-TW.ts +19 -0
- package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +49 -0
- package/dist/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +5 -0
- package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +7 -1
- package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +13 -0
- package/dist/templates/workspace-core/.agents/skills/tracking/SKILL.md +1 -1
- package/package.json +1 -1
- package/src/templates/default/app/i18n/ar-SA.ts +20 -0
- package/src/templates/default/app/i18n/de-DE.ts +20 -0
- package/src/templates/default/app/i18n/en-US.ts +20 -0
- package/src/templates/default/app/i18n/es-ES.ts +20 -0
- package/src/templates/default/app/i18n/fr-FR.ts +21 -0
- package/src/templates/default/app/i18n/hi-IN.ts +19 -0
- package/src/templates/default/app/i18n/ja-JP.ts +20 -0
- package/src/templates/default/app/i18n/ko-KR.ts +19 -0
- package/src/templates/default/app/i18n/pt-BR.ts +20 -0
- package/src/templates/default/app/i18n/zh-CN.ts +19 -0
- package/src/templates/default/app/i18n/zh-TW.ts +19 -0
- package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +49 -0
- package/src/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +5 -0
- package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +7 -1
- package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +13 -0
- package/src/templates/workspace-core/.agents/skills/tracking/SKILL.md +1 -1
- package/corpus/templates/analytics/server/handlers/github.ts +0 -200
- package/corpus/templates/analytics/server/handlers/pylon.ts +0 -43
- package/corpus/templates/analytics/server/lib/apollo.ts +0 -167
- package/corpus/templates/analytics/server/lib/commonroom.ts +0 -149
- package/corpus/templates/analytics/server/lib/github.ts +0 -660
- package/corpus/templates/analytics/server/lib/mixpanel.ts +0 -156
- package/corpus/templates/analytics/server/lib/posthog.ts +0 -194
- package/corpus/templates/analytics/server/lib/pylon.ts +0 -109
- package/corpus/templates/analytics/server/routes/api/github/graphql.post.ts +0 -1
- package/corpus/templates/analytics/server/routes/api/github/issue.get.ts +0 -1
- package/corpus/templates/analytics/server/routes/api/github/org-prs.get.ts +0 -1
- package/corpus/templates/analytics/server/routes/api/github/pr.get.ts +0 -1
- package/corpus/templates/analytics/server/routes/api/github/prs.get.ts +0 -1
- package/corpus/templates/analytics/server/routes/api/github/search.get.ts +0 -1
- package/corpus/templates/slides/actions/fetch-logos.ts +0 -90
- package/corpus/templates/slides/actions/image-search.ts +0 -64
- package/corpus/templates/slides/actions/import-github.ts +0 -182
- package/corpus/templates/slides/actions/logo-lookup.ts +0 -113
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { hasChatThreadDeepLink } from "./chat-thread-url.js";
|
|
1
2
|
export declare const SIDEBAR_OPEN_KEY = "agent-native-sidebar-open";
|
|
2
3
|
export declare const SIDEBAR_STATE_CHANGE_EVENT = "agent-panel:state-change";
|
|
3
4
|
export declare const SIDEBAR_URL_CHANGE_EVENT = "agent-panel:url-change";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-sidebar-state.d.ts","sourceRoot":"","sources":["../../src/client/agent-sidebar-state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-sidebar-state.d.ts","sourceRoot":"","sources":["../../src/client/agent-sidebar-state.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,eAAO,MAAM,gBAAgB,8BAA8B,CAAC;AAC5D,eAAO,MAAM,0BAA0B,6BAA6B,CAAC;AACrE,eAAO,MAAM,wBAAwB,2BAA2B,CAAC;AAIjE,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,OAAO,CAAC;AACtD,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,MAAM,CAAC;AAEnD,MAAM,WAAW,6BAA6B;IAC5C,oDAAoD;IACpD,IAAI,EAAE,OAAO,CAAC;IACd,kDAAkD;IAClD,MAAM,EAAE,uBAAuB,CAAC;IAChC,uEAAuE;IACvE,IAAI,EAAE,qBAAqB,CAAC;CAC7B;AAED,wBAAgB,gCAAgC,CAC9C,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GACzB,MAAM,CAGR;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,6BAA6B,GACpC,IAAI,CAON;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,OAAO,EACb,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GACzB,IAAI,CAQN;AAED,wBAAgB,uBAAuB,IAAI,IAAI,CAG9C;AAED,wBAAgB,8BAA8B,IAAI,OAAO,GAAG,IAAI,CAQ/D;AAED,wBAAgB,kCAAkC,CAChD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GACzB,OAAO,GAAG,IAAI,CAiBhB;AA8BD,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,MAAM,IAAI,GACnB,MAAM,IAAI,CAaZ;AAED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,OAAO,EACpB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GACzB,OAAO,CAwBT"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { AGENT_SIDEBAR_QUERY_PARAM, AGENT_SIDEBAR_QUERY_VALUE_CLOSED, } from "../shared/agent-sidebar-url.js";
|
|
2
|
+
import { hasChatThreadDeepLink } from "./chat-thread-url.js";
|
|
3
|
+
export { hasChatThreadDeepLink } from "./chat-thread-url.js";
|
|
2
4
|
export const SIDEBAR_OPEN_KEY = "agent-native-sidebar-open";
|
|
3
5
|
export const SIDEBAR_STATE_CHANGE_EVENT = "agent-panel:state-change";
|
|
4
6
|
export const SIDEBAR_URL_CHANGE_EVENT = "agent-panel:url-change";
|
|
@@ -94,6 +96,8 @@ export function getInitialAgentSidebarOpen(defaultOpen, storageKey) {
|
|
|
94
96
|
const urlOverride = getAgentSidebarUrlOpenOverride();
|
|
95
97
|
if (urlOverride !== null)
|
|
96
98
|
return urlOverride;
|
|
99
|
+
if (hasChatThreadDeepLink())
|
|
100
|
+
return true;
|
|
97
101
|
// On mobile viewports the sidebar would cover most of the screen, so
|
|
98
102
|
// always start closed regardless of any persisted desktop preference.
|
|
99
103
|
if (typeof window !== "undefined" &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-sidebar-state.js","sourceRoot":"","sources":["../../src/client/agent-sidebar-state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-sidebar-state.js","sourceRoot":"","sources":["../../src/client/agent-sidebar-state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AAC5D,MAAM,CAAC,MAAM,0BAA0B,GAAG,0BAA0B,CAAC;AACrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,wBAAwB,CAAC;AAEjE,MAAM,mBAAmB,GAAG,oCAAoC,CAAC;AAcjE,MAAM,UAAU,gCAAgC,CAC9C,UAA0B;IAE1B,MAAM,MAAM,GAAG,UAAU,EAAE,IAAI,EAAE,CAAC;IAClC,OAAO,MAAM,CAAC,CAAC,CAAC,gBAAgB,MAAM,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,+BAA+B,CAC7C,MAAqC;IAErC,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO;IAC1C,MAAM,CAAC,aAAa,CAClB,IAAI,WAAW,CAAgC,0BAA0B,EAAE;QACzE,MAAM;KACP,CAAC,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,IAAa,EACb,UAA0B;IAE1B,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO;IAC1C,IAAI,CAAC;QACH,YAAY,CAAC,OAAO,CAClB,gCAAgC,CAA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asChatThreadDeepLink } from \"./chat-thread-url.js\";\n\nexport { hasChatThreadDeepLink } from \"./chat-thread-url.js\";\n\nexport const SIDEBAR_OPEN_KEY = \"agent-native-sidebar-open\";\nexport const SIDEBAR_STATE_CHANGE_EVENT = \"agent-panel:state-change\";\nexport const SIDEBAR_URL_CHANGE_EVENT = \"agent-panel:url-change\";\n\nconst HISTORY_PATCHED_KEY = \"__agentNativeSidebarHistoryPatched\";\n\nexport type AgentSidebarStateSource = \"app\" | \"frame\";\nexport type AgentSidebarStateMode = \"app\" | \"code\";\n\nexport interface AgentSidebarStateChangeDetail {\n /** Whether the user-visible agent panel is open. */\n open: boolean;\n /** Which surface owns the visible agent panel. */\n source: AgentSidebarStateSource;\n /** Frame protocol mode: \"code\" is parent-owned, \"app\" is app-owned. */\n mode: AgentSidebarStateMode;\n}\n\nexport function getAgentSidebarOpenPreferenceKey(\n storageKey?: string | null,\n): string {\n const suffix = storageKey?.trim();\n return suffix ? `agent-native.${suffix}.sidebar-open` : SIDEBAR_OPEN_KEY;\n}\n\nexport function dispatchAgentSidebarStateChange(\n detail: AgentSidebarStateChangeDetail,\n): void {\n if (typeof window === \"undefined\") return;\n window.dispatchEvent(\n new CustomEvent<AgentSidebarStateChangeDetail>(SIDEBAR_STATE_CHANGE_EVENT, {\n detail,\n }),\n );\n}\n\nexport function setAgentSidebarOpenPreference(\n open: boolean,\n storageKey?: string | null,\n): void {\n if (typeof window === \"undefined\") return;\n try {\n localStorage.setItem(\n getAgentSidebarOpenPreferenceKey(storageKey),\n String(open),\n );\n } catch {}\n}\n\nexport function requestAgentSidebarOpen(): void {\n if (typeof window === \"undefined\") return;\n window.dispatchEvent(new CustomEvent(\"agent-panel:open\"));\n}\n\nexport function getAgentSidebarUrlOpenOverride(): boolean | null {\n if (typeof window === \"undefined\") return null;\n try {\n const url = new URL(window.location.href);\n const value = url.searchParams.get(AGENT_SIDEBAR_QUERY_PARAM);\n if (value === AGENT_SIDEBAR_QUERY_VALUE_CLOSED) return false;\n } catch {}\n return null;\n}\n\nexport function consumeAgentSidebarUrlOpenOverride(\n storageKey?: string | null,\n): boolean | null {\n const override = getAgentSidebarUrlOpenOverride();\n if (override === null || typeof window === \"undefined\") return override;\n\n setAgentSidebarOpenPreference(override, storageKey);\n\n try {\n const url = new URL(window.location.href);\n url.searchParams.delete(AGENT_SIDEBAR_QUERY_PARAM);\n window.history.replaceState(\n window.history.state,\n \"\",\n `${url.pathname}${url.search}${url.hash}`,\n );\n } catch {}\n\n return override;\n}\n\nfunction emitSidebarUrlChange(): void {\n if (typeof window === \"undefined\") return;\n window.dispatchEvent(new Event(SIDEBAR_URL_CHANGE_EVENT));\n}\n\nfunction installSidebarUrlChangeEvents(): void {\n if (typeof window === \"undefined\") return;\n const historyWithFlag = window.history as History & {\n [HISTORY_PATCHED_KEY]?: boolean;\n };\n if (historyWithFlag[HISTORY_PATCHED_KEY]) return;\n\n const pushState = window.history.pushState;\n const replaceState = window.history.replaceState;\n\n window.history.pushState = function pushStateWithSidebarEvent(...args) {\n const result = pushState.apply(this, args);\n emitSidebarUrlChange();\n return result;\n };\n window.history.replaceState = function replaceStateWithSidebarEvent(...args) {\n const result = replaceState.apply(this, args);\n emitSidebarUrlChange();\n return result;\n };\n historyWithFlag[HISTORY_PATCHED_KEY] = true;\n}\n\nexport function subscribeAgentSidebarUrlChanges(\n listener: () => void,\n): () => void {\n if (typeof window === \"undefined\") return () => {};\n\n installSidebarUrlChangeEvents();\n window.addEventListener(SIDEBAR_URL_CHANGE_EVENT, listener);\n window.addEventListener(\"popstate\", listener);\n window.addEventListener(\"hashchange\", listener);\n\n return () => {\n window.removeEventListener(SIDEBAR_URL_CHANGE_EVENT, listener);\n window.removeEventListener(\"popstate\", listener);\n window.removeEventListener(\"hashchange\", listener);\n };\n}\n\nexport function getInitialAgentSidebarOpen(\n defaultOpen: boolean,\n storageKey?: string | null,\n): boolean {\n const urlOverride = getAgentSidebarUrlOpenOverride();\n if (urlOverride !== null) return urlOverride;\n if (hasChatThreadDeepLink()) return true;\n\n // On mobile viewports the sidebar would cover most of the screen, so\n // always start closed regardless of any persisted desktop preference.\n if (\n typeof window !== \"undefined\" &&\n window.matchMedia(\"(max-width: 767px)\").matches\n ) {\n return false;\n }\n\n try {\n const saved = localStorage.getItem(\n getAgentSidebarOpenPreferenceKey(storageKey),\n );\n if (saved === \"false\") return false;\n // Never let durable storage turn on a sidebar that is default-closed.\n // Programmatic chat handoffs open the current sidebar transiently instead.\n if (defaultOpen && saved === \"true\") return true;\n } catch {}\n return defaultOpen;\n}\n"]}
|
|
@@ -142,6 +142,20 @@ export declare function captureClientException(error: unknown, context?: ClientC
|
|
|
142
142
|
* is configured; otherwise this is a quiet no-op.
|
|
143
143
|
*/
|
|
144
144
|
export declare function captureError(error: unknown, context?: ClientCaptureContext): string | undefined;
|
|
145
|
+
export type AgentChatLifecycleEvent = {
|
|
146
|
+
phase: "surface-mounted" | "run-observed" | "run-stopped";
|
|
147
|
+
surface?: string;
|
|
148
|
+
threadId?: string;
|
|
149
|
+
runId?: string;
|
|
150
|
+
tabId?: string;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Record a content-free, browser-session-linked chat lifecycle marker and add
|
|
154
|
+
* the same marker to session replay when replay is configured. The bounded
|
|
155
|
+
* global de-dupe survives React Strict Mode remounts without retaining keys
|
|
156
|
+
* forever.
|
|
157
|
+
*/
|
|
158
|
+
export declare function trackAgentChatLifecycle(input: AgentChatLifecycleEvent): void;
|
|
145
159
|
export declare function configureTracking(options: ConfigureTrackingOptions): void;
|
|
146
160
|
export declare function setTrackingContentCaptureEnabled(enabled: boolean): void;
|
|
147
161
|
export declare function startSessionReplay(options?: SessionReplayOptions): Promise<SessionReplayStartResult>;
|
|
@@ -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,q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AE,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;AA4MD,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,IAAI,CASN;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAE1D"}
|
package/dist/client/analytics.js
CHANGED
|
@@ -41,6 +41,9 @@ const AGENT_NATIVE_ANALYTICS_DEFAULT_ENDPOINT = "https://analytics.agent-native.
|
|
|
41
41
|
*/
|
|
42
42
|
export const AGENT_NATIVE_EXCEPTION_EVENT_NAME = "$exception";
|
|
43
43
|
const PAGEVIEW_TRACKING_STATE_KEY = Symbol.for("agent-native.client.pageviewTracking");
|
|
44
|
+
const AGENT_CHAT_TRACKING_STATE_KEY = Symbol.for("agent-native.client.agentChatTracking");
|
|
45
|
+
const AGENT_CHAT_LIFECYCLE_DEDUPE_TTL_MS = 10 * 60 * 1_000;
|
|
46
|
+
const MAX_AGENT_CHAT_LIFECYCLE_DEDUPE_KEYS = 1_000;
|
|
44
47
|
const LLM_CONNECTION_STORAGE_KEY = "agent-native.llm_connection_status";
|
|
45
48
|
const LLM_CONNECTION_CACHE_TTL_MS = 5 * 60 * 1000;
|
|
46
49
|
// First-touch referral attribution (viral attribution). Captured once on the
|
|
@@ -807,6 +810,70 @@ function getPageviewTrackingState() {
|
|
|
807
810
|
}
|
|
808
811
|
return g[PAGEVIEW_TRACKING_STATE_KEY];
|
|
809
812
|
}
|
|
813
|
+
function getAgentChatTrackingState() {
|
|
814
|
+
const g = globalThis;
|
|
815
|
+
if (!g[AGENT_CHAT_TRACKING_STATE_KEY]) {
|
|
816
|
+
g[AGENT_CHAT_TRACKING_STATE_KEY] = { seen: new Map() };
|
|
817
|
+
}
|
|
818
|
+
return g[AGENT_CHAT_TRACKING_STATE_KEY];
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* Record a content-free, browser-session-linked chat lifecycle marker and add
|
|
822
|
+
* the same marker to session replay when replay is configured. The bounded
|
|
823
|
+
* global de-dupe survives React Strict Mode remounts without retaining keys
|
|
824
|
+
* forever.
|
|
825
|
+
*/
|
|
826
|
+
export function trackAgentChatLifecycle(input) {
|
|
827
|
+
if (typeof window === "undefined")
|
|
828
|
+
return;
|
|
829
|
+
const surface = input.surface?.trim() || "app";
|
|
830
|
+
const dedupeKey = [
|
|
831
|
+
input.phase,
|
|
832
|
+
surface,
|
|
833
|
+
input.threadId ?? "",
|
|
834
|
+
input.runId ?? "",
|
|
835
|
+
input.tabId ?? "",
|
|
836
|
+
].join(":");
|
|
837
|
+
const state = getAgentChatTrackingState();
|
|
838
|
+
const now = Date.now();
|
|
839
|
+
for (const [key, seenAt] of state.seen) {
|
|
840
|
+
if (now - seenAt >= AGENT_CHAT_LIFECYCLE_DEDUPE_TTL_MS) {
|
|
841
|
+
state.seen.delete(key);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
if (state.seen.has(dedupeKey))
|
|
845
|
+
return;
|
|
846
|
+
state.seen.set(dedupeKey, now);
|
|
847
|
+
while (state.seen.size > MAX_AGENT_CHAT_LIFECYCLE_DEDUPE_KEYS) {
|
|
848
|
+
const oldestKey = state.seen.keys().next().value;
|
|
849
|
+
if (oldestKey === undefined)
|
|
850
|
+
break;
|
|
851
|
+
state.seen.delete(oldestKey);
|
|
852
|
+
}
|
|
853
|
+
void (async () => {
|
|
854
|
+
const replayResult = _sessionReplayOptions && _trackingContentCaptureEnabled
|
|
855
|
+
? await startConfiguredSessionReplay(_sessionReplayOptions)
|
|
856
|
+
: null;
|
|
857
|
+
const properties = {
|
|
858
|
+
phase: input.phase,
|
|
859
|
+
chat_surface: surface,
|
|
860
|
+
...(input.threadId ? { thread_id: input.threadId } : {}),
|
|
861
|
+
...(input.runId ? { run_id: input.runId } : {}),
|
|
862
|
+
...(input.tabId ? { chat_tab_id: input.tabId } : {}),
|
|
863
|
+
replay_status: replayResult?.started
|
|
864
|
+
? "active"
|
|
865
|
+
: (replayResult?.reason ?? "not-configured"),
|
|
866
|
+
};
|
|
867
|
+
trackEvent("agent_chat_lifecycle", properties);
|
|
868
|
+
_sessionReplayModuleForCapture?.emitSessionReplayAgentChatEvent?.({
|
|
869
|
+
phase: input.phase,
|
|
870
|
+
surface,
|
|
871
|
+
...(input.threadId ? { threadId: input.threadId } : {}),
|
|
872
|
+
...(input.runId ? { runId: input.runId } : {}),
|
|
873
|
+
...(input.tabId ? { tabId: input.tabId } : {}),
|
|
874
|
+
});
|
|
875
|
+
})();
|
|
876
|
+
}
|
|
810
877
|
export function configureTracking(options) {
|
|
811
878
|
const publicKey = options.key || options.publicKey;
|
|
812
879
|
if (publicKey) {
|