@agent-native/core 0.145.5 → 0.145.7
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 +1 -1
- package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +17 -1
- package/corpus/templates/analytics/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/analytics/.agents/skills/gong/SKILL.md +22 -3
- package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/analytics/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/analytics/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/analytics/AGENTS.md +2 -1
- package/corpus/templates/analytics/actions/account-deep-dive.ts +83 -47
- package/corpus/templates/analytics/actions/create-dashboard-folder.ts +27 -0
- package/corpus/templates/analytics/actions/gong-calls.ts +3 -3
- package/corpus/templates/analytics/actions/list-dashboard-folders.ts +26 -0
- package/corpus/templates/analytics/actions/list-sql-dashboards.ts +1 -0
- package/corpus/templates/analytics/actions/set-dashboard-folder.ts +26 -0
- package/corpus/templates/analytics/app/components/ProviderCorpusJobNotifier.tsx +18 -3
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +6 -4
- package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -0
- package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +12 -2
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +35 -20
- package/corpus/templates/analytics/app/global.css +17 -0
- package/corpus/templates/analytics/app/hooks/use-dashboard-revisions.ts +29 -15
- package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +15 -3
- package/corpus/templates/analytics/app/i18n-data.ts +296 -0
- package/corpus/templates/analytics/app/lib/prefetch-keys.ts +23 -2
- package/corpus/templates/analytics/app/pages/DashboardOverview.tsx +642 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +66 -31
- package/corpus/templates/analytics/app/root.tsx +4 -0
- package/corpus/templates/analytics/app/routes/dashboards._index.tsx +5 -1
- package/corpus/templates/analytics/changelog/2026-08-07-added-a-dashboards-overview-with-personal-and-shared-folders.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-analytics-no-longer-stalls-under-bursts-of-event-ingest-key-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-analytics-tracking-and-chat-startup-no-longer-emit-avoidable.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-dashboard-panels-now-load-custom-api-data-programs-reliably.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-gong-searches-conserve-api-quota-and-report-incomplete-coverage.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-searchable-dashboards-make-personal-and-shared-folders-easie.md +6 -0
- package/corpus/templates/analytics/netlify.toml +3 -0
- package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +112 -0
- package/corpus/templates/analytics/server/db/index.ts +12 -0
- package/corpus/templates/analytics/server/db/schema.ts +14 -0
- package/corpus/templates/analytics/server/jobs/analytics-rollup-backfill.ts +4 -0
- package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +1 -0
- package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +85 -15
- package/corpus/templates/analytics/server/lib/dashboard-folders-store.ts +168 -0
- package/corpus/templates/analytics/server/lib/dashboard-panel-query.ts +9 -4
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +116 -1
- package/corpus/templates/analytics/server/lib/first-party-analytics-rollups.ts +4 -8
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +65 -10
- package/corpus/templates/analytics/server/lib/gong.ts +139 -78
- package/corpus/templates/analytics/server/lib/session-replay.ts +5 -5
- package/corpus/templates/analytics/server/plugins/db.ts +55 -15
- package/corpus/templates/analytics/server/plugins/session-replay-retention-jobs.ts +6 -2
- package/corpus/templates/analytics/server/routes/api/session-replay/retention.post.ts +65 -0
- package/corpus/templates/assets/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/assets/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/assets/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/assets/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/brain/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/brain/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/brain/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/brain/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/calendar/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/calendar/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/calendar/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/chat/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/chat/.env.example +3 -0
- package/corpus/templates/chat/AGENTS.md +4 -0
- package/corpus/templates/clips/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/clips/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/clips/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/clips/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/clips/actions/lib/audio-only-transcription.ts +4 -0
- package/corpus/templates/clips/actions/request-transcript.ts +52 -3
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +3 -10
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +1 -0
- package/corpus/templates/clips/changelog/2026-08-07-screen-recordings-now-capture-tab-and-system-audio-even-when.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-07-transcription-now-retries-transient-cloud-failures-automatic.md +6 -0
- package/corpus/templates/clips/server/db/schema.ts +7 -0
- package/corpus/templates/clips/server/plugins/db.ts +8 -0
- package/corpus/templates/clips/shared/recording-capture.ts +38 -0
- package/corpus/templates/clips/shared/transcript-failure.ts +89 -0
- package/corpus/templates/content/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/content/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/content/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/content/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/content/.env.example +9 -3
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -0
- package/corpus/templates/content/changelog/2026-08-07-collapsed-sidebar-utility-buttons-stay-anchored-at-the-botto.md +6 -0
- package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/crm/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/crm/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/design/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/design/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/design/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/design/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/dispatch/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/factory/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/factory/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/factory/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/factory/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/factory/actions/babysit-agent-native-pull-request.ts +279 -0
- package/corpus/templates/factory/actions/get-factory-automation-health.ts +23 -4
- package/corpus/templates/factory/app/components/factory/FactoryCanvas.tsx +1 -1
- package/corpus/templates/factory/app/routes/factory.tsx +21 -3
- package/corpus/templates/factory/changelog/2026-08-07-factory-can-keep-builder-bot-pull-requests-moving-by-request.md +6 -0
- package/corpus/templates/factory/server/lib/require-factory-automation.ts +1 -0
- package/corpus/templates/factory/server/plugins/agent-chat.ts +4 -1
- package/corpus/templates/factory/server/plugins/factory-scheduler-job.ts +81 -12
- package/corpus/templates/factory/server/triage/github-client.ts +31 -0
- package/corpus/templates/factory/server/triage/pr-babysit.ts +75 -1
- package/corpus/templates/forms/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/forms/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/forms/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/forms/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/macros/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/macros/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/mail/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/mail/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/mail/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/mail/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/plan/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/plan/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/plan/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/plan/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +2 -1
- package/corpus/templates/plan/changelog/2026-08-07-inline-help-icons-now-stay-visually-balanced-with-nearby-tex.md +6 -0
- package/corpus/templates/slides/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/slides/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/slides/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/slides/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/slides/.env.example +5 -0
- package/corpus/templates/slides/changelog/2026-08-07-fixed-generated-slides-briefly-disappearing-while-they-are-b.md +6 -0
- package/corpus/templates/slides/server/plugins/collab.ts +20 -8
- package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/tasks/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/tasks/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/tasks/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/tasks/.env.example +3 -0
- package/dist/agent/production-agent.js +24 -3
- package/dist/client/AgentPanel.d.ts +6 -0
- package/dist/client/AgentPanel.js +176 -30
- package/dist/client/AssistantChat.d.ts +2 -0
- package/dist/client/AssistantChat.js +4 -1
- package/dist/client/ConnectBuilderCard.js +6 -11
- package/dist/client/MultiTabAssistantChat.js +1 -1
- package/dist/client/RuntimeConfigNotice.d.ts +1 -0
- package/dist/client/RuntimeConfigNotice.js +94 -0
- package/dist/client/agent-chat/index.d.ts +1 -1
- package/dist/client/agent-chat/index.js +1 -1
- package/dist/client/agent-chat-adapter.js +85 -4
- package/dist/client/agent-page/AgentTabsPage.js +1 -1
- package/dist/client/agent-sidebar-state.d.ts +6 -0
- package/dist/client/agent-sidebar-state.js +25 -0
- package/dist/client/app-providers.js +2 -1
- package/dist/client/assistant-ui-recovery.js +1 -1
- package/dist/client/chat/index.d.ts +1 -1
- package/dist/client/chat/index.js +1 -1
- package/dist/client/chat/markdown-renderer.d.ts +2 -1
- package/dist/client/chat/markdown-renderer.js +48 -2
- package/dist/client/chat/message-components.d.ts +6 -0
- package/dist/client/chat/message-components.js +182 -53
- package/dist/client/chat/tool-call-display.d.ts +16 -4
- package/dist/client/chat/tool-call-display.js +225 -18
- package/dist/client/extensions/ExtensionsSidebarSection.js +1 -1
- package/dist/client/frame-protocol.d.ts +4 -0
- package/dist/client/i18n.js +9 -0
- package/dist/client/integrations/IntegrationsPanel.js +2 -5
- package/dist/client/onboarding/FirstRunOnboarding.js +2 -3
- package/dist/client/org/TeamPage.js +49 -6
- package/dist/client/org/hooks.d.ts +7 -2
- package/dist/client/org/hooks.js +11 -4
- package/dist/client/resources/McpConnectionSuggestion.js +2 -3
- package/dist/client/resources/McpIntegrationDialog.js +2 -16
- package/dist/client/resources/McpIntegrationLogo.d.ts +11 -0
- package/dist/client/resources/McpIntegrationLogo.js +14 -0
- package/dist/client/resources/ResourceTree.js +1 -1
- package/dist/client/resources/mcp-integration-logos.d.ts +1 -0
- package/dist/client/resources/mcp-integration-logos.js +47 -18
- package/dist/client/settings/useBuilderStatus.js +6 -0
- package/dist/client/ui/index.d.ts +1 -0
- package/dist/client/ui/index.js +1 -0
- package/dist/client/use-db-sync.js +4 -0
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/config.d.ts +26 -3
- package/dist/config.js +106 -14
- package/dist/db/ddl-guard.d.ts +15 -2
- package/dist/db/ddl-guard.js +53 -5
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/jobs/scheduler.js +7 -0
- package/dist/localization/default-messages.d.ts +17 -0
- package/dist/localization/default-messages.js +17 -0
- package/dist/mcp/oauth-client-metadata.js +5 -1
- package/dist/mcp/oauth-route.d.ts +5 -4
- package/dist/mcp/oauth-route.js +25 -9
- package/dist/mcp/screen-memory-stdio.d.ts +7 -7
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.js +9 -10
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +3 -3
- package/dist/org/handlers.d.ts +1 -0
- package/dist/org/handlers.js +17 -2
- package/dist/provider-api/actions/custom-provider-registration.d.ts +5 -5
- package/dist/provider-api/actions/provider-api.d.ts +7 -7
- package/dist/provider-api/corpus-jobs.d.ts +12 -2
- package/dist/provider-api/corpus-jobs.js +31 -1
- package/dist/provider-api/index.d.ts +2 -0
- package/dist/provider-api/index.js +7 -1
- package/dist/secrets/routes.d.ts +3 -3
- package/dist/server/agent-chat/recurring-jobs-runtime.d.ts +1 -1
- package/dist/server/agent-chat/recurring-jobs-runtime.js +14 -2
- package/dist/server/agent-chat/script-entries.js +12 -1
- package/dist/server/agent-chat-plugin.js +2 -2
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/auth.d.ts +1 -0
- package/dist/server/auth.js +85 -1
- package/dist/server/better-auth-instance.d.ts +9 -0
- package/dist/server/better-auth-instance.js +25 -11
- package/dist/server/core-routes-plugin.d.ts +7 -0
- package/dist/server/core-routes-plugin.js +51 -5
- package/dist/server/create-server.js +23 -2
- package/dist/server/db-pressure.d.ts +38 -0
- package/dist/server/db-pressure.js +147 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1 -0
- package/dist/server/legacy-auth-migration.d.ts +10 -0
- package/dist/server/legacy-auth-migration.js +37 -0
- package/dist/server/onboarding-html.js +206 -2
- package/dist/server/poll.d.ts +26 -0
- package/dist/server/poll.js +108 -13
- package/dist/server/ssr-handler.js +4 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/shared/runtime-config.d.ts +44 -0
- package/dist/shared/runtime-config.js +284 -0
- package/dist/styles/agent-native.css +48 -1
- package/dist/templates/chat/.agents/skills/actions/SKILL.md +18 -0
- package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
- package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/dist/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/dist/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/dist/templates/chat/.env.example +3 -0
- package/dist/templates/chat/AGENTS.md +4 -0
- package/dist/templates/default/.agents/skills/actions/SKILL.md +18 -0
- package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/default/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +1 -0
- package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/dist/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/dist/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/dist/templates/default/AGENTS.md +6 -1
- package/dist/templates/default/app/i18n/ar-SA.ts +6 -0
- package/dist/templates/default/app/i18n/de-DE.ts +6 -0
- package/dist/templates/default/app/i18n/en-US.ts +6 -0
- package/dist/templates/default/app/i18n/es-ES.ts +6 -0
- package/dist/templates/default/app/i18n/fr-FR.ts +6 -0
- package/dist/templates/default/app/i18n/hi-IN.ts +6 -0
- package/dist/templates/default/app/i18n/ja-JP.ts +6 -0
- package/dist/templates/default/app/i18n/ko-KR.ts +6 -0
- package/dist/templates/default/app/i18n/pt-BR.ts +6 -0
- package/dist/templates/default/app/i18n/zh-CN.ts +6 -0
- package/dist/templates/default/app/i18n/zh-TW.ts +6 -0
- package/dist/templates/headless/.agents/skills/actions/SKILL.md +18 -0
- package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/dist/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/dist/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +18 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -0
- package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +8 -0
- package/dist/templates/workspace-core/AGENTS.md +7 -2
- package/dist/templates/workspace-root/AGENTS.md +5 -0
- package/dist/vite/client.d.ts +3 -3
- package/dist/vite/client.js +47 -1
- package/dist/vite/index.d.ts +1 -1
- package/docs/content/agent-native-config.mdx +240 -139
- package/docs/content/authentication.mdx +17 -0
- package/docs/content/deployment.mdx +19 -14
- package/docs/content/drop-in-agent.mdx +19 -2
- package/docs/content/environment-variables.mdx +63 -38
- package/docs/content/getting-started-actions.mdx +15 -6
- package/docs/content/getting-started-database.mdx +14 -10
- package/docs/content/getting-started-pages.mdx +32 -35
- package/docs/content/getting-started.mdx +7 -6
- package/package.json +1 -1
- package/src/templates/chat/.agents/skills/actions/SKILL.md +18 -0
- package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
- package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/src/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/src/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/src/templates/chat/.env.example +3 -0
- package/src/templates/chat/AGENTS.md +4 -0
- package/src/templates/default/.agents/skills/actions/SKILL.md +18 -0
- package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/default/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -0
- package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/src/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/src/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/src/templates/default/AGENTS.md +6 -1
- package/src/templates/default/app/i18n/ar-SA.ts +6 -0
- package/src/templates/default/app/i18n/de-DE.ts +6 -0
- package/src/templates/default/app/i18n/en-US.ts +6 -0
- package/src/templates/default/app/i18n/es-ES.ts +6 -0
- package/src/templates/default/app/i18n/fr-FR.ts +6 -0
- package/src/templates/default/app/i18n/hi-IN.ts +6 -0
- package/src/templates/default/app/i18n/ja-JP.ts +6 -0
- package/src/templates/default/app/i18n/ko-KR.ts +6 -0
- package/src/templates/default/app/i18n/pt-BR.ts +6 -0
- package/src/templates/default/app/i18n/zh-CN.ts +6 -0
- package/src/templates/default/app/i18n/zh-TW.ts +6 -0
- package/src/templates/headless/.agents/skills/actions/SKILL.md +18 -0
- package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/src/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/src/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +18 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/src/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/src/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -0
- package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +8 -0
- package/src/templates/workspace-core/AGENTS.md +7 -2
- package/src/templates/workspace-root/AGENTS.md +5 -0
- package/corpus/templates/dispatch/app/routes/admin.apps.$appId.tsx +0 -1
- package/corpus/templates/dispatch/app/routes/admin.apps.tsx +0 -1
|
@@ -2,8 +2,8 @@ import { defineAction } from "@agent-native/core";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
getCallDetails,
|
|
6
|
+
getCallTranscripts,
|
|
7
7
|
searchCallsForQueries,
|
|
8
8
|
type GongCall,
|
|
9
9
|
} from "../server/lib/gong";
|
|
@@ -230,6 +230,20 @@ function recordTimestampMs(record: HubSpotObjectRecord) {
|
|
|
230
230
|
return Number.isFinite(time) ? time : 0;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
+
function transcriptRowsByCallId(payload: unknown): Map<string, unknown> {
|
|
234
|
+
const rows = new Map<string, unknown>();
|
|
235
|
+
if (!payload || typeof payload !== "object") return rows;
|
|
236
|
+
const callTranscripts = (payload as { callTranscripts?: unknown })
|
|
237
|
+
.callTranscripts;
|
|
238
|
+
if (!Array.isArray(callTranscripts)) return rows;
|
|
239
|
+
for (const row of callTranscripts) {
|
|
240
|
+
if (!row || typeof row !== "object") continue;
|
|
241
|
+
const callId = (row as { callId?: unknown }).callId;
|
|
242
|
+
if (typeof callId === "string" && callId) rows.set(callId, row);
|
|
243
|
+
}
|
|
244
|
+
return rows;
|
|
245
|
+
}
|
|
246
|
+
|
|
233
247
|
async function loadGongEvidence(options: {
|
|
234
248
|
queries: string[];
|
|
235
249
|
days: number;
|
|
@@ -269,55 +283,77 @@ async function loadGongEvidence(options: {
|
|
|
269
283
|
);
|
|
270
284
|
}
|
|
271
285
|
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
286
|
+
const detailCalls = calls.slice(0, Math.min(5, options.gongLimit));
|
|
287
|
+
let callDetails: Awaited<ReturnType<typeof getCallDetails>> = [];
|
|
288
|
+
if (detailCalls.length) {
|
|
289
|
+
try {
|
|
290
|
+
const details = await getCallDetails(detailCalls.map((call) => call.id));
|
|
291
|
+
const detailsById = new Map(details.map((detail) => [detail.id, detail]));
|
|
292
|
+
callDetails = detailCalls.flatMap((call) => {
|
|
293
|
+
const detail = detailsById.get(call.id);
|
|
294
|
+
if (!detail) {
|
|
295
|
+
gaps.push(`Gong call detail ${call.id}: no detail was returned.`);
|
|
296
|
+
return [];
|
|
297
|
+
}
|
|
298
|
+
return [detail];
|
|
299
|
+
});
|
|
300
|
+
} catch (err) {
|
|
301
|
+
gaps.push(
|
|
302
|
+
`Gong call details: ${err instanceof Error ? err.message : String(err)}`,
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const transcripts: Array<Record<string, unknown>> = [];
|
|
308
|
+
if (options.includeTranscripts) {
|
|
309
|
+
const transcriptCalls = calls.slice(0, options.transcriptLimit);
|
|
310
|
+
try {
|
|
311
|
+
const rows = transcriptRowsByCallId(
|
|
312
|
+
await getCallTranscripts(transcriptCalls.map((call) => call.id)),
|
|
313
|
+
);
|
|
314
|
+
for (const call of transcriptCalls) {
|
|
315
|
+
const transcript = rows.get(call.id);
|
|
316
|
+
if (transcript) {
|
|
317
|
+
transcripts.push({
|
|
318
|
+
callId: call.id,
|
|
319
|
+
title: call.title,
|
|
320
|
+
started: call.started,
|
|
321
|
+
...extractTranscriptText(transcript, options.transcriptMaxChars),
|
|
322
|
+
});
|
|
323
|
+
} else {
|
|
324
|
+
const error = "Gong did not return a transcript for this call.";
|
|
325
|
+
gaps.push(`Gong transcript ${call.id}: ${error}`);
|
|
326
|
+
transcripts.push({
|
|
327
|
+
callId: call.id,
|
|
328
|
+
title: call.title,
|
|
329
|
+
started: call.started,
|
|
330
|
+
text: "",
|
|
331
|
+
sentenceCount: 0,
|
|
332
|
+
truncated: false,
|
|
333
|
+
error,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
283
336
|
}
|
|
284
|
-
})
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
`Gong transcript ${call.id}: ${
|
|
301
|
-
err instanceof Error ? err.message : String(err)
|
|
302
|
-
}`,
|
|
303
|
-
);
|
|
304
|
-
return {
|
|
305
|
-
callId: call.id,
|
|
306
|
-
title: call.title,
|
|
307
|
-
started: call.started,
|
|
308
|
-
text: "",
|
|
309
|
-
sentenceCount: 0,
|
|
310
|
-
truncated: false,
|
|
311
|
-
error: err instanceof Error ? err.message : String(err),
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
}),
|
|
315
|
-
)
|
|
316
|
-
: [];
|
|
337
|
+
} catch (err) {
|
|
338
|
+
const error = err instanceof Error ? err.message : String(err);
|
|
339
|
+
for (const call of transcriptCalls) {
|
|
340
|
+
gaps.push(`Gong transcript ${call.id}: ${error}`);
|
|
341
|
+
transcripts.push({
|
|
342
|
+
callId: call.id,
|
|
343
|
+
title: call.title,
|
|
344
|
+
started: call.started,
|
|
345
|
+
text: "",
|
|
346
|
+
sentenceCount: 0,
|
|
347
|
+
truncated: false,
|
|
348
|
+
error,
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
317
353
|
|
|
318
354
|
return {
|
|
319
355
|
calls,
|
|
320
|
-
callDetails
|
|
356
|
+
callDetails,
|
|
321
357
|
transcripts,
|
|
322
358
|
searchCoverage,
|
|
323
359
|
gaps,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core";
|
|
2
|
+
import {
|
|
3
|
+
getRequestOrgId,
|
|
4
|
+
getRequestUserEmail,
|
|
5
|
+
} from "@agent-native/core/server";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
|
|
8
|
+
import { createDashboardFolder } from "../server/lib/dashboard-folders-store";
|
|
9
|
+
|
|
10
|
+
export default defineAction({
|
|
11
|
+
description: "Create a personal or shared dashboard folder.",
|
|
12
|
+
schema: z.object({
|
|
13
|
+
name: z.string().min(1).max(120),
|
|
14
|
+
scope: z.enum(["personal", "shared"]),
|
|
15
|
+
}),
|
|
16
|
+
http: { method: "POST" },
|
|
17
|
+
run: async ({ name, scope }) => {
|
|
18
|
+
const email = getRequestUserEmail();
|
|
19
|
+
if (!email) throw new Error("no authenticated user");
|
|
20
|
+
return {
|
|
21
|
+
folder: await createDashboardFolder(name, scope, {
|
|
22
|
+
email,
|
|
23
|
+
orgId: getRequestOrgId() || null,
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
});
|
|
@@ -63,7 +63,7 @@ interface TranscriptSearchError {
|
|
|
63
63
|
|
|
64
64
|
function callLimitGuidance(limit: number, truncated: boolean): string {
|
|
65
65
|
return truncated
|
|
66
|
-
? `
|
|
66
|
+
? `Coverage is incomplete: returned the ${limit} most recent matching calls and more Gong pages remain. Do not increase the limit or page this action for broad or exhaustive analysis. Switch to tracker staging with provider-api-request plus query-staged-dataset or a Data Program, or use provider-corpus-job when raw transcript bodies are required.`
|
|
67
67
|
: `Returned ${limit} or fewer matching calls. Answer from these calls; expand limit if broader coverage is needed.`;
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -719,7 +719,7 @@ export default defineAction({
|
|
|
719
719
|
: {}),
|
|
720
720
|
guidance: [
|
|
721
721
|
transcriptSearch
|
|
722
|
-
? `Transcript search inspected ${transcriptSearch.inspectedCalls} of ${result.calls.length} matching call(s) for "${transcriptQuery}" and found ${transcriptSearch.matches.length} matching call(s). Use coverageComplete/errors before making absence claims;
|
|
722
|
+
? `Transcript search inspected ${transcriptSearch.inspectedCalls} of ${result.calls.length} matching call(s) for "${transcriptQuery}" and found ${transcriptSearch.matches.length} matching call(s). Use coverageComplete/errors before making absence claims; if coverage is incomplete, keep any retry bounded by narrowing the window, or switch broad/exhaustive work to tracker staging or provider-corpus-job.`
|
|
723
723
|
: "",
|
|
724
724
|
exhaustive
|
|
725
725
|
? shouldLoadTranscripts
|
|
@@ -854,7 +854,7 @@ export default defineAction({
|
|
|
854
854
|
...(transcripts ? { transcripts } : {}),
|
|
855
855
|
guidance: [
|
|
856
856
|
transcriptSearch
|
|
857
|
-
? `Transcript search inspected ${transcriptSearch.inspectedCalls} of ${returnedCalls.length} returned call(s) for "${transcriptQuery}" and found ${transcriptSearch.matches.length} matching call(s). Use coverageComplete/errors before making absence claims;
|
|
857
|
+
? `Transcript search inspected ${transcriptSearch.inspectedCalls} of ${returnedCalls.length} returned call(s) for "${transcriptQuery}" and found ${transcriptSearch.matches.length} matching call(s). Use coverageComplete/errors before making absence claims; if coverage is incomplete, keep any retry bounded by narrowing the window, or switch broad/exhaustive work to tracker staging or provider-corpus-job.`
|
|
858
858
|
: "",
|
|
859
859
|
exhaustive
|
|
860
860
|
? `Exhaustive discovery returned ${returnedCalls.length} call(s) from the date window${truncated ? ", but Gong has more pages than this request covered" : ""}.`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core";
|
|
2
|
+
import {
|
|
3
|
+
getRequestOrgId,
|
|
4
|
+
getRequestUserEmail,
|
|
5
|
+
} from "@agent-native/core/server";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
|
|
8
|
+
import { listDashboardFolders } from "../server/lib/dashboard-folders-store";
|
|
9
|
+
|
|
10
|
+
export default defineAction({
|
|
11
|
+
description: "List dashboard folders accessible to the current user.",
|
|
12
|
+
schema: z.object({}),
|
|
13
|
+
http: { method: "GET" },
|
|
14
|
+
readOnly: true,
|
|
15
|
+
publicAgent: { expose: true, readOnly: true, requiresAuth: true },
|
|
16
|
+
run: async () => {
|
|
17
|
+
const email = getRequestUserEmail();
|
|
18
|
+
if (!email) throw new Error("no authenticated user");
|
|
19
|
+
return {
|
|
20
|
+
folders: await listDashboardFolders({
|
|
21
|
+
email,
|
|
22
|
+
orgId: getRequestOrgId() || null,
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core";
|
|
2
|
+
import {
|
|
3
|
+
getRequestOrgId,
|
|
4
|
+
getRequestUserEmail,
|
|
5
|
+
} from "@agent-native/core/server";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
|
|
8
|
+
import { assignDashboardToFolder } from "../server/lib/dashboard-folders-store";
|
|
9
|
+
|
|
10
|
+
export default defineAction({
|
|
11
|
+
description: "Assign or remove a dashboard's folder membership.",
|
|
12
|
+
schema: z.object({
|
|
13
|
+
dashboardId: z.string(),
|
|
14
|
+
folderId: z.string().nullable(),
|
|
15
|
+
}),
|
|
16
|
+
http: { method: "POST" },
|
|
17
|
+
run: async ({ dashboardId, folderId }) => {
|
|
18
|
+
const email = getRequestUserEmail();
|
|
19
|
+
if (!email) throw new Error("no authenticated user");
|
|
20
|
+
const dashboard = await assignDashboardToFolder(dashboardId, folderId, {
|
|
21
|
+
email,
|
|
22
|
+
orgId: getRequestOrgId() || null,
|
|
23
|
+
});
|
|
24
|
+
return { id: dashboard.id, folderId };
|
|
25
|
+
},
|
|
26
|
+
});
|
|
@@ -31,6 +31,8 @@ type ProviderCorpusJobEntry = {
|
|
|
31
31
|
totalHits: number;
|
|
32
32
|
storedHits: number;
|
|
33
33
|
truncatedHits: boolean;
|
|
34
|
+
paginationComplete: boolean;
|
|
35
|
+
paginationStopReason: string | null;
|
|
34
36
|
};
|
|
35
37
|
error: string | null;
|
|
36
38
|
nextResumeAt: string | null;
|
|
@@ -117,18 +119,31 @@ function notificationKey(entry: ProviderCorpusJobEntry): string {
|
|
|
117
119
|
entry.coverage.itemsProcessed,
|
|
118
120
|
entry.coverage.totalHits,
|
|
119
121
|
entry.coverage.storedHits,
|
|
122
|
+
entry.coverage.paginationComplete,
|
|
123
|
+
entry.coverage.paginationStopReason ?? "",
|
|
120
124
|
entry.nextResumeAt ?? "",
|
|
121
125
|
entry.error ?? "",
|
|
122
126
|
].join(":");
|
|
123
127
|
}
|
|
124
128
|
|
|
129
|
+
export function providerCorpusJobIsIncomplete(
|
|
130
|
+
entry: ProviderCorpusJobEntry,
|
|
131
|
+
): boolean {
|
|
132
|
+
return (
|
|
133
|
+
entry.job.status === "completed" &&
|
|
134
|
+
entry.coverage.paginationComplete === false
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
125
138
|
function showJobToast(
|
|
126
139
|
entry: ProviderCorpusJobEntry,
|
|
127
140
|
openAsk: () => void, // i18n-ignore TypeScript helper signature
|
|
128
141
|
t: ReturnType<typeof useT>, // i18n-ignore TypeScript helper type
|
|
129
142
|
) {
|
|
130
|
-
const
|
|
131
|
-
|
|
143
|
+
const incomplete = providerCorpusJobIsIncomplete(entry);
|
|
144
|
+
const title = incomplete
|
|
145
|
+
? t("providerCorpusNotifier.incomplete")
|
|
146
|
+
: entry.job.status === "completed"
|
|
132
147
|
? t("providerCorpusNotifier.completed")
|
|
133
148
|
: entry.job.status === "quota_wait"
|
|
134
149
|
? t("providerCorpusNotifier.quotaWait")
|
|
@@ -156,7 +171,7 @@ function showJobToast(
|
|
|
156
171
|
},
|
|
157
172
|
};
|
|
158
173
|
|
|
159
|
-
if (entry.job.status === "failed") {
|
|
174
|
+
if (entry.job.status === "failed" || incomplete) {
|
|
160
175
|
toast.error(title, options);
|
|
161
176
|
} else if (entry.job.status === "completed") {
|
|
162
177
|
toast.success(title, options);
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
} from "react";
|
|
34
34
|
import { useNavigate } from "react-router";
|
|
35
35
|
|
|
36
|
+
import { useAuth } from "@/components/auth/AuthProvider";
|
|
36
37
|
import {
|
|
37
38
|
CommandDialog,
|
|
38
39
|
CommandInput,
|
|
@@ -49,6 +50,7 @@ import {
|
|
|
49
50
|
import { Label } from "@/components/ui/label";
|
|
50
51
|
import { Skeleton } from "@/components/ui/skeleton";
|
|
51
52
|
import { useReplayStorageStatus } from "@/hooks/use-replay-storage-status";
|
|
53
|
+
import { dashboardCacheScope } from "@/lib/prefetch-keys";
|
|
52
54
|
import { dashboards } from "@/pages/adhoc/registry";
|
|
53
55
|
import {
|
|
54
56
|
buildAnalyticsGeneralSettingsSearchEntries,
|
|
@@ -257,6 +259,8 @@ function persistThemePreference(theme: "light" | "dark") {
|
|
|
257
259
|
export function CommandPalette() {
|
|
258
260
|
const t = useT();
|
|
259
261
|
const { canManageOrg } = useOrgRole();
|
|
262
|
+
const { auth } = useAuth();
|
|
263
|
+
const dashboardScope = dashboardCacheScope(auth);
|
|
260
264
|
const [open, setOpen] = useState(false);
|
|
261
265
|
const [changelogOpen, setChangelogOpen] = useState(false);
|
|
262
266
|
const [languageOpen, setLanguageOpen] = useState(false);
|
|
@@ -285,19 +289,17 @@ export function CommandPalette() {
|
|
|
285
289
|
const dashboardsSync = useChangeVersions(["dashboards", "action"]);
|
|
286
290
|
|
|
287
291
|
const explorerDashboardsQuery = useQuery({
|
|
288
|
-
queryKey: ["explorer-dashboards-palette", dashboardsSync],
|
|
292
|
+
queryKey: ["explorer-dashboards-palette", dashboardScope, dashboardsSync],
|
|
289
293
|
queryFn: fetchExplorerDashboards,
|
|
290
294
|
staleTime: 30_000,
|
|
291
295
|
enabled: open,
|
|
292
|
-
placeholderData: (prev) => prev,
|
|
293
296
|
});
|
|
294
297
|
|
|
295
298
|
const sqlDashboardsQuery = useQuery({
|
|
296
|
-
queryKey: ["sql-dashboards-palette", dashboardsSync],
|
|
299
|
+
queryKey: ["sql-dashboards-palette", dashboardScope, dashboardsSync],
|
|
297
300
|
queryFn: () => fetchSqlDashboards(t),
|
|
298
301
|
staleTime: 30_000,
|
|
299
302
|
enabled: open,
|
|
300
|
-
placeholderData: (prev) => prev,
|
|
301
303
|
});
|
|
302
304
|
|
|
303
305
|
const savedCharts = savedChartsQuery.data ?? [];
|
|
@@ -17,6 +17,7 @@ const pageTitleKeys: Record<string, string> = {
|
|
|
17
17
|
"/ask": "navigation.ask",
|
|
18
18
|
"/data-sources": "navigation.dataSources",
|
|
19
19
|
"/data-dictionary": "navigation.dataDictionary",
|
|
20
|
+
"/dashboards": "navigation.dashboards",
|
|
20
21
|
"/analyses": "navigation.analyses",
|
|
21
22
|
"/sessions": "navigation.sessions",
|
|
22
23
|
"/monitoring": "navigation.monitoring",
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
PopoverContent,
|
|
10
10
|
PopoverTrigger,
|
|
11
11
|
} from "@/components/ui/popover";
|
|
12
|
+
import { cn } from "@/lib/utils";
|
|
12
13
|
|
|
13
14
|
const DASHBOARD_CONTEXT =
|
|
14
15
|
"The user wants to create a new analytics dashboard. " +
|
|
@@ -32,7 +33,11 @@ const DASHBOARD_CONTEXT =
|
|
|
32
33
|
"Do not create code files for an ordinary native dashboard. Use `connect-builder` only for an explicitly reusable/native code request. " +
|
|
33
34
|
"After saving, call the `navigate` action with view='adhoc' and dashboardId so the new dashboard opens immediately.";
|
|
34
35
|
|
|
35
|
-
export function NewDashboardDialog(
|
|
36
|
+
export function NewDashboardDialog({
|
|
37
|
+
triggerClassName,
|
|
38
|
+
}: {
|
|
39
|
+
triggerClassName?: string;
|
|
40
|
+
} = {}) {
|
|
36
41
|
const t = useT();
|
|
37
42
|
const [open, setOpen] = useState(false);
|
|
38
43
|
const { send, isGenerating } = useSendToAgentChat();
|
|
@@ -47,7 +52,12 @@ export function NewDashboardDialog() {
|
|
|
47
52
|
return (
|
|
48
53
|
<Popover open={open} onOpenChange={setOpen}>
|
|
49
54
|
<PopoverTrigger asChild>
|
|
50
|
-
<button
|
|
55
|
+
<button
|
|
56
|
+
className={cn(
|
|
57
|
+
"flex w-full cursor-pointer items-center gap-2 rounded-lg px-3 py-1.5 text-xs text-muted-foreground/60 hover:bg-sidebar-accent/50 hover:text-primary",
|
|
58
|
+
triggerClassName,
|
|
59
|
+
)}
|
|
60
|
+
>
|
|
51
61
|
<IconPlus className="h-3 w-3" />
|
|
52
62
|
{t("dialogs.newDashboard")}
|
|
53
63
|
</button>
|
|
@@ -44,6 +44,7 @@ import {
|
|
|
44
44
|
import { Link, useLocation, useNavigate } from "react-router";
|
|
45
45
|
import { toast } from "sonner";
|
|
46
46
|
|
|
47
|
+
import { useAuth } from "@/components/auth/AuthProvider";
|
|
47
48
|
import { getIdToken } from "@/lib/auth";
|
|
48
49
|
import { ANALYTICS_CHAT_STORAGE_KEY } from "@/lib/chat-handoff";
|
|
49
50
|
import { cn, shortcutModifierLabel } from "@/lib/utils";
|
|
@@ -143,6 +144,7 @@ import { useUserPref } from "@/hooks/use-user-pref";
|
|
|
143
144
|
import { shouldRenderDashboardList } from "@/lib/dashboard-list-loading";
|
|
144
145
|
import { usePopularity, popularityOf } from "@/lib/item-popularity";
|
|
145
146
|
import {
|
|
147
|
+
dashboardCacheScope,
|
|
146
148
|
sqlDashboardPrefetchKey,
|
|
147
149
|
type PrefetchSnapshot,
|
|
148
150
|
} from "@/lib/prefetch-keys";
|
|
@@ -1124,17 +1126,22 @@ async function fetchSqlDashboards(
|
|
|
1124
1126
|
): Promise<SqlDashboardListItem[]> {
|
|
1125
1127
|
const rows = await callAction("list-sql-dashboards", {}, { method: "GET" });
|
|
1126
1128
|
return (Array.isArray(rows) ? rows : [])
|
|
1127
|
-
.filter(
|
|
1129
|
+
.filter(
|
|
1130
|
+
(d: any) =>
|
|
1131
|
+
d &&
|
|
1132
|
+
typeof d.id === "string" &&
|
|
1133
|
+
d.id.length > 0 &&
|
|
1134
|
+
(d.visibility === "private" ||
|
|
1135
|
+
d.visibility === "org" ||
|
|
1136
|
+
d.visibility === "public"),
|
|
1137
|
+
)
|
|
1128
1138
|
.map((d: any) => ({
|
|
1129
1139
|
id: d.id,
|
|
1130
1140
|
name:
|
|
1131
1141
|
typeof d.name === "string" && d.name.trim().length > 0
|
|
1132
1142
|
? d.name
|
|
1133
1143
|
: t("sidebar.untitledDashboard"),
|
|
1134
|
-
visibility:
|
|
1135
|
-
d.visibility === "org" || d.visibility === "public"
|
|
1136
|
-
? (d.visibility as Visibility)
|
|
1137
|
-
: ("private" as Visibility),
|
|
1144
|
+
visibility: d.visibility as Visibility,
|
|
1138
1145
|
parentId:
|
|
1139
1146
|
typeof d.parentId === "string" && d.parentId.trim().length > 0
|
|
1140
1147
|
? d.parentId
|
|
@@ -1463,6 +1470,8 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
|
|
|
1463
1470
|
const t = useT();
|
|
1464
1471
|
const queryClient = useQueryClient();
|
|
1465
1472
|
const { setTheme } = useTheme();
|
|
1473
|
+
const { auth } = useAuth();
|
|
1474
|
+
const dashboardScope = dashboardCacheScope(auth);
|
|
1466
1475
|
|
|
1467
1476
|
const isAskRoute = location.pathname === "/ask";
|
|
1468
1477
|
const activeDashboardId = useMemo(() => {
|
|
@@ -1623,10 +1632,9 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
|
|
|
1623
1632
|
isError: sqlDashboardsError,
|
|
1624
1633
|
refetch: refetchSqlDashboards,
|
|
1625
1634
|
} = useQuery({
|
|
1626
|
-
queryKey: ["sql-dashboards-sidebar", dashboardsSync],
|
|
1635
|
+
queryKey: ["sql-dashboards-sidebar", dashboardScope, dashboardsSync],
|
|
1627
1636
|
queryFn: () => fetchSqlDashboards(t),
|
|
1628
1637
|
staleTime: 30_000,
|
|
1629
|
-
placeholderData: (prev) => prev,
|
|
1630
1638
|
});
|
|
1631
1639
|
|
|
1632
1640
|
const {
|
|
@@ -1655,7 +1663,7 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
|
|
|
1655
1663
|
const prefetchDashboard = useCallback(
|
|
1656
1664
|
(d: SidebarDashboard) => {
|
|
1657
1665
|
if (d.source !== "sql") return;
|
|
1658
|
-
const queryKey = sqlDashboardPrefetchKey(d.id);
|
|
1666
|
+
const queryKey = sqlDashboardPrefetchKey(d.id, dashboardScope);
|
|
1659
1667
|
const cached =
|
|
1660
1668
|
queryClient.getQueryData<
|
|
1661
1669
|
PrefetchSnapshot<PrefetchedSqlDashboard | null>
|
|
@@ -1670,7 +1678,7 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
|
|
|
1670
1678
|
staleTime: cached?.syncVersion === dashboardsSync ? 30_000 : 0,
|
|
1671
1679
|
});
|
|
1672
1680
|
},
|
|
1673
|
-
[dashboardsSync, queryClient, t],
|
|
1681
|
+
[dashboardScope, dashboardsSync, queryClient, t],
|
|
1674
1682
|
);
|
|
1675
1683
|
|
|
1676
1684
|
const visibleDashboards = useMemo<SidebarDashboard[]>(() => {
|
|
@@ -1824,7 +1832,7 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
|
|
|
1824
1832
|
// Optimistic: remove from the sidebar query cache immediately so the row
|
|
1825
1833
|
// disappears without waiting for the DELETE round-trip. Snapshot the
|
|
1826
1834
|
// prior value so we can roll back on failure.
|
|
1827
|
-
const activeKey = ["sql-dashboards-sidebar"] as const;
|
|
1835
|
+
const activeKey = ["sql-dashboards-sidebar", dashboardScope] as const;
|
|
1828
1836
|
const prevActive = getQuerySnapshots<SqlDashboardListItem[]>(
|
|
1829
1837
|
queryClient,
|
|
1830
1838
|
activeKey,
|
|
@@ -1835,14 +1843,16 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
|
|
|
1835
1843
|
);
|
|
1836
1844
|
try {
|
|
1837
1845
|
await deleteSqlDashboard({ id: d.id });
|
|
1838
|
-
queryClient.removeQueries({
|
|
1846
|
+
queryClient.removeQueries({
|
|
1847
|
+
queryKey: sqlDashboardPrefetchKey(d.id, dashboardScope),
|
|
1848
|
+
});
|
|
1839
1849
|
queryClient.invalidateQueries({ queryKey: activeKey });
|
|
1840
1850
|
} catch (err) {
|
|
1841
1851
|
restoreQuerySnapshots(queryClient, prevActive);
|
|
1842
1852
|
throw err;
|
|
1843
1853
|
}
|
|
1844
1854
|
},
|
|
1845
|
-
[deleteAnalysisMut, deleteSqlDashboard, queryClient],
|
|
1855
|
+
[dashboardScope, deleteAnalysisMut, deleteSqlDashboard, queryClient],
|
|
1846
1856
|
);
|
|
1847
1857
|
|
|
1848
1858
|
const handleDashboardArchive = useCallback(
|
|
@@ -1855,7 +1865,7 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
|
|
|
1855
1865
|
setHiddenIds(getHiddenDashboards());
|
|
1856
1866
|
return;
|
|
1857
1867
|
}
|
|
1858
|
-
const activeKey = ["sql-dashboards-sidebar"] as const;
|
|
1868
|
+
const activeKey = ["sql-dashboards-sidebar", dashboardScope] as const;
|
|
1859
1869
|
const prevActive = getQuerySnapshots<SqlDashboardListItem[]>(
|
|
1860
1870
|
queryClient,
|
|
1861
1871
|
activeKey,
|
|
@@ -1866,7 +1876,9 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
|
|
|
1866
1876
|
);
|
|
1867
1877
|
try {
|
|
1868
1878
|
await archiveDashboardMut({ id: d.id, archived: true });
|
|
1869
|
-
queryClient.removeQueries({
|
|
1879
|
+
queryClient.removeQueries({
|
|
1880
|
+
queryKey: sqlDashboardPrefetchKey(d.id, dashboardScope),
|
|
1881
|
+
});
|
|
1870
1882
|
queryClient.invalidateQueries({ queryKey: activeKey });
|
|
1871
1883
|
toast.success(t("sidebar.archivedName", { name: d.name }));
|
|
1872
1884
|
} catch (err) {
|
|
@@ -1874,7 +1886,7 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
|
|
|
1874
1886
|
throw err;
|
|
1875
1887
|
}
|
|
1876
1888
|
},
|
|
1877
|
-
[queryClient, archiveDashboardMut, t],
|
|
1889
|
+
[dashboardScope, queryClient, archiveDashboardMut, t],
|
|
1878
1890
|
);
|
|
1879
1891
|
|
|
1880
1892
|
const handleDashboardRename = useCallback(
|
|
@@ -1901,7 +1913,7 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
|
|
|
1901
1913
|
return;
|
|
1902
1914
|
}
|
|
1903
1915
|
|
|
1904
|
-
const queryKey = ["sql-dashboards-sidebar"] as const;
|
|
1916
|
+
const queryKey = ["sql-dashboards-sidebar", dashboardScope] as const;
|
|
1905
1917
|
const prev = getQuerySnapshots<SqlDashboardListItem[]>(
|
|
1906
1918
|
queryClient,
|
|
1907
1919
|
queryKey,
|
|
@@ -1913,17 +1925,19 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
|
|
|
1913
1925
|
);
|
|
1914
1926
|
try {
|
|
1915
1927
|
await renameDashboard({ id: d.id, name: trimmed });
|
|
1916
|
-
queryClient.removeQueries({
|
|
1928
|
+
queryClient.removeQueries({
|
|
1929
|
+
queryKey: sqlDashboardPrefetchKey(d.id, dashboardScope),
|
|
1930
|
+
});
|
|
1917
1931
|
queryClient.invalidateQueries({ queryKey });
|
|
1918
1932
|
queryClient.invalidateQueries({
|
|
1919
|
-
queryKey: ["sql-dashboards-palette"],
|
|
1933
|
+
queryKey: ["sql-dashboards-palette", dashboardScope],
|
|
1920
1934
|
});
|
|
1921
1935
|
} catch (err) {
|
|
1922
1936
|
restoreQuerySnapshots(queryClient, prev);
|
|
1923
1937
|
throw err;
|
|
1924
1938
|
}
|
|
1925
1939
|
},
|
|
1926
|
-
[queryClient, renameAnalysis, renameDashboard],
|
|
1940
|
+
[dashboardScope, queryClient, renameAnalysis, renameDashboard],
|
|
1927
1941
|
);
|
|
1928
1942
|
|
|
1929
1943
|
const handleDashboardSetVisibility = useCallback(
|
|
@@ -1946,6 +1960,7 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
|
|
|
1946
1960
|
}
|
|
1947
1961
|
const queryKey = [
|
|
1948
1962
|
"sql-dashboards-sidebar",
|
|
1963
|
+
dashboardScope,
|
|
1949
1964
|
dashboardsSyncRef.current,
|
|
1950
1965
|
] as const;
|
|
1951
1966
|
const prev = getQuerySnapshots<SqlDashboardListItem[]>(
|
|
@@ -1974,7 +1989,7 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
|
|
|
1974
1989
|
throw err;
|
|
1975
1990
|
}
|
|
1976
1991
|
},
|
|
1977
|
-
[queryClient, setResourceVisibility, t],
|
|
1992
|
+
[dashboardScope, queryClient, setResourceVisibility, t],
|
|
1978
1993
|
);
|
|
1979
1994
|
|
|
1980
1995
|
const sensors = useSensors(
|
|
@@ -457,6 +457,16 @@
|
|
|
457
457
|
container: data-sources / inline-size;
|
|
458
458
|
}
|
|
459
459
|
|
|
460
|
+
.dashboard-overview-layout {
|
|
461
|
+
container: dashboard-overview / inline-size;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.dashboard-overview-toolbar {
|
|
465
|
+
display: flex;
|
|
466
|
+
flex-direction: column;
|
|
467
|
+
gap: 0.5rem;
|
|
468
|
+
}
|
|
469
|
+
|
|
460
470
|
.data-sources-toolbar {
|
|
461
471
|
display: flex;
|
|
462
472
|
flex-direction: column;
|
|
@@ -505,6 +515,13 @@
|
|
|
505
515
|
}
|
|
506
516
|
}
|
|
507
517
|
|
|
518
|
+
@container dashboard-overview (min-width: 640px) {
|
|
519
|
+
.dashboard-overview-toolbar {
|
|
520
|
+
flex-direction: row;
|
|
521
|
+
align-items: center;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
508
525
|
@container data-sources (min-width: 768px) {
|
|
509
526
|
.data-sources-grid {
|
|
510
527
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|