@agent-native/core 0.145.5 → 0.145.6
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-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/gong.ts +139 -78
- 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/collab/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/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 +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/resources/handlers.d.ts +1 -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/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
|
@@ -8,6 +8,7 @@ import { ConnectBuilderCard } from "../ConnectBuilderCard.js";
|
|
|
8
8
|
import { useT } from "../i18n.js";
|
|
9
9
|
import { McpAppRenderer } from "../mcp-apps/McpAppRenderer.js";
|
|
10
10
|
import { findMcpIntegrationForToolName } from "../resources/mcp-integration-catalog.js";
|
|
11
|
+
import { McpIntegrationLogo } from "../resources/McpIntegrationLogo.js";
|
|
11
12
|
import { BashCell, EditCell, WriteCell, FilesChangedSummary, } from "../tool-cells/index.js";
|
|
12
13
|
import { humanizeToolName, isCallAgentToolCallShadowed, } from "../tool-display.js";
|
|
13
14
|
import { cn } from "../utils.js";
|
|
@@ -19,6 +20,198 @@ import { isBuiltinDataWidgetActionRenderer, resolveBuiltinActionChatRenderer, re
|
|
|
19
20
|
export const ChatRunningContext = React.createContext(false);
|
|
20
21
|
export const ChatRunDurationContext = React.createContext(null);
|
|
21
22
|
export const ASSISTANT_VISIBLE_TOOL_CALL_LIMIT = 3;
|
|
23
|
+
const TOOL_CALL_ENTRY_DURATION_MS = 220;
|
|
24
|
+
const TOOL_CALL_STACK_MOTION_DURATION_MS = 220;
|
|
25
|
+
const TOOL_CALL_STACK_EASING = "cubic-bezier(0.23, 1, 0.32, 1)";
|
|
26
|
+
function toolStackMotionKey(element, index) {
|
|
27
|
+
const toolCallId = element.dataset.agentToolCallId;
|
|
28
|
+
if (toolCallId)
|
|
29
|
+
return `tool:${toolCallId}`;
|
|
30
|
+
const summaryId = element.dataset.agentToolSummary;
|
|
31
|
+
if (summaryId)
|
|
32
|
+
return `summary:${summaryId}`;
|
|
33
|
+
return `anonymous:${index}`;
|
|
34
|
+
}
|
|
35
|
+
function prefersReducedMotionForToolStack() {
|
|
36
|
+
return (typeof window !== "undefined" &&
|
|
37
|
+
typeof window.matchMedia === "function" &&
|
|
38
|
+
window.matchMedia("(prefers-reduced-motion: reduce)").matches);
|
|
39
|
+
}
|
|
40
|
+
function startToolStackAnimation(element, keyframes) {
|
|
41
|
+
if (typeof element.animate !== "function")
|
|
42
|
+
return null;
|
|
43
|
+
return element.animate(keyframes, {
|
|
44
|
+
duration: TOOL_CALL_STACK_MOTION_DURATION_MS,
|
|
45
|
+
easing: TOOL_CALL_STACK_EASING,
|
|
46
|
+
fill: "both",
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function prepareToolStackExitClone(clone, snapshot) {
|
|
50
|
+
clone.classList.remove("agent-tool-call--entering", "agent-tool-call--stack-entering");
|
|
51
|
+
clone
|
|
52
|
+
.querySelectorAll(".agent-tool-call--entering, .agent-tool-call--stack-entering")
|
|
53
|
+
.forEach((element) => {
|
|
54
|
+
element.classList.remove("agent-tool-call--entering", "agent-tool-call--stack-entering");
|
|
55
|
+
});
|
|
56
|
+
clone.classList.add("agent-tool-call-stack__exit");
|
|
57
|
+
clone.setAttribute("aria-hidden", "true");
|
|
58
|
+
clone.removeAttribute("data-agent-tool-call-id");
|
|
59
|
+
clone.removeAttribute("data-agent-tool-summary");
|
|
60
|
+
clone.removeAttribute("data-agent-tool-motion-token");
|
|
61
|
+
clone.style.left = `${snapshot.left}px`;
|
|
62
|
+
clone.style.top = `${snapshot.top}px`;
|
|
63
|
+
clone.style.width = `${snapshot.width}px`;
|
|
64
|
+
clone.style.height = `${snapshot.height}px`;
|
|
65
|
+
clone.style.transform = "translate3d(0, 0, 0)";
|
|
66
|
+
clone.style.transition = "none";
|
|
67
|
+
clone.style.animation = "none";
|
|
68
|
+
clone.style.opacity = "1";
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Keeps the visible tool stack spatially continuous as streaming calls change
|
|
72
|
+
* which rows belong to the collapsed history bucket. The rendered data stays
|
|
73
|
+
* untouched; this only animates the DOM's before/after positions.
|
|
74
|
+
*/
|
|
75
|
+
export function ToolCallStackMotion({ children, className, }) {
|
|
76
|
+
const stackRef = useRef(null);
|
|
77
|
+
const previousRef = useRef(new Map());
|
|
78
|
+
const activeMotionsRef = useRef(new Map());
|
|
79
|
+
const exitAnimationsRef = useRef(new Map());
|
|
80
|
+
useLayoutEffect(() => {
|
|
81
|
+
const stack = stackRef.current;
|
|
82
|
+
if (!stack)
|
|
83
|
+
return;
|
|
84
|
+
const previous = previousRef.current;
|
|
85
|
+
const visualPrevious = new Map(previous);
|
|
86
|
+
for (const [key, activeMotion] of activeMotionsRef.current) {
|
|
87
|
+
if (stack.contains(activeMotion.element)) {
|
|
88
|
+
const previousSnapshot = previous.get(key);
|
|
89
|
+
if (previousSnapshot) {
|
|
90
|
+
const rect = activeMotion.element.getBoundingClientRect();
|
|
91
|
+
visualPrevious.set(key, {
|
|
92
|
+
...previousSnapshot,
|
|
93
|
+
top: rect.top,
|
|
94
|
+
left: rect.left,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
activeMotion.animation.cancel();
|
|
99
|
+
}
|
|
100
|
+
activeMotionsRef.current.clear();
|
|
101
|
+
for (const [ghost, animation] of exitAnimationsRef.current) {
|
|
102
|
+
animation.cancel();
|
|
103
|
+
ghost.remove();
|
|
104
|
+
}
|
|
105
|
+
exitAnimationsRef.current.clear();
|
|
106
|
+
const elements = Array.from(stack.querySelectorAll("[data-agent-tool-call-id], [data-agent-tool-summary]"));
|
|
107
|
+
const current = new Map();
|
|
108
|
+
for (const [index, element] of elements.entries()) {
|
|
109
|
+
const rect = element.getBoundingClientRect();
|
|
110
|
+
current.set(toolStackMotionKey(element, index), {
|
|
111
|
+
top: rect.top,
|
|
112
|
+
left: rect.left,
|
|
113
|
+
width: rect.width,
|
|
114
|
+
height: rect.height,
|
|
115
|
+
clone: element.cloneNode(true),
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
previousRef.current = current;
|
|
119
|
+
if (previous.size === 0 || prefersReducedMotionForToolStack())
|
|
120
|
+
return;
|
|
121
|
+
const summary = elements.find((element) => element.dataset.agentToolSummary !== undefined);
|
|
122
|
+
const summaryRect = summary?.getBoundingClientRect();
|
|
123
|
+
const elementsByKey = new Map(elements.map((element, index) => [
|
|
124
|
+
toolStackMotionKey(element, index),
|
|
125
|
+
element,
|
|
126
|
+
]));
|
|
127
|
+
for (const [key, after] of current.entries()) {
|
|
128
|
+
const before = visualPrevious.get(key);
|
|
129
|
+
if (!before) {
|
|
130
|
+
const node = elementsByKey.get(key);
|
|
131
|
+
if (!node)
|
|
132
|
+
continue;
|
|
133
|
+
if (node.dataset.agentToolSummary !== undefined)
|
|
134
|
+
continue;
|
|
135
|
+
if (node.dataset.agentToolCallId !== undefined &&
|
|
136
|
+
!node.classList.contains("agent-tool-call--entering")) {
|
|
137
|
+
node.classList.add("agent-tool-call--stack-entering");
|
|
138
|
+
window.setTimeout(() => {
|
|
139
|
+
node.classList.remove("agent-tool-call--stack-entering");
|
|
140
|
+
}, TOOL_CALL_ENTRY_DURATION_MS);
|
|
141
|
+
}
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
const dx = before.left - after.left;
|
|
145
|
+
const dy = before.top - after.top;
|
|
146
|
+
if (Math.abs(dx) < 0.5 && Math.abs(dy) < 0.5)
|
|
147
|
+
continue;
|
|
148
|
+
const node = elementsByKey.get(key);
|
|
149
|
+
if (!node)
|
|
150
|
+
continue;
|
|
151
|
+
if (node.dataset.agentToolSummary !== undefined)
|
|
152
|
+
continue;
|
|
153
|
+
const animation = startToolStackAnimation(node, [
|
|
154
|
+
{ transform: `translate3d(${dx}px, ${dy}px, 0)` },
|
|
155
|
+
{ transform: "translate3d(0, 0, 0)" },
|
|
156
|
+
]);
|
|
157
|
+
if (!animation)
|
|
158
|
+
continue;
|
|
159
|
+
activeMotionsRef.current.set(key, { element: node, animation });
|
|
160
|
+
const clearMotion = () => {
|
|
161
|
+
if (activeMotionsRef.current.get(key)?.animation === animation) {
|
|
162
|
+
activeMotionsRef.current.delete(key);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
animation.onfinish = clearMotion;
|
|
166
|
+
animation.oncancel = clearMotion;
|
|
167
|
+
}
|
|
168
|
+
for (const [key, before] of visualPrevious.entries()) {
|
|
169
|
+
if (current.has(key) || !key.startsWith("tool:"))
|
|
170
|
+
continue;
|
|
171
|
+
const ghost = before.clone;
|
|
172
|
+
prepareToolStackExitClone(ghost, before);
|
|
173
|
+
document.body?.appendChild(ghost);
|
|
174
|
+
if (!ghost.isConnected)
|
|
175
|
+
continue;
|
|
176
|
+
const targetTop = summaryRect?.top ?? before.top - 8;
|
|
177
|
+
const targetLeft = summaryRect?.left ?? before.left;
|
|
178
|
+
const animation = startToolStackAnimation(ghost, [
|
|
179
|
+
{ transform: "translate3d(0, 0, 0)", opacity: 1 },
|
|
180
|
+
{
|
|
181
|
+
transform: `translate3d(${targetLeft - before.left}px, ${targetTop - before.top}px, 0)`,
|
|
182
|
+
opacity: 0,
|
|
183
|
+
},
|
|
184
|
+
]);
|
|
185
|
+
if (!animation) {
|
|
186
|
+
ghost.remove();
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
exitAnimationsRef.current.set(ghost, animation);
|
|
190
|
+
const clearExit = () => {
|
|
191
|
+
if (exitAnimationsRef.current.get(ghost) === animation) {
|
|
192
|
+
exitAnimationsRef.current.delete(ghost);
|
|
193
|
+
}
|
|
194
|
+
ghost.remove();
|
|
195
|
+
};
|
|
196
|
+
animation.onfinish = clearExit;
|
|
197
|
+
animation.oncancel = clearExit;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
useEffect(() => {
|
|
201
|
+
return () => {
|
|
202
|
+
for (const { animation } of activeMotionsRef.current.values()) {
|
|
203
|
+
animation.cancel();
|
|
204
|
+
}
|
|
205
|
+
activeMotionsRef.current.clear();
|
|
206
|
+
for (const [ghost, animation] of exitAnimationsRef.current) {
|
|
207
|
+
animation.cancel();
|
|
208
|
+
ghost.remove();
|
|
209
|
+
}
|
|
210
|
+
exitAnimationsRef.current.clear();
|
|
211
|
+
};
|
|
212
|
+
}, []);
|
|
213
|
+
return (_jsx("div", { ref: stackRef, className: cn("agent-tool-call-stack", className), children: children }));
|
|
214
|
+
}
|
|
22
215
|
export const ApprovalContext = React.createContext(null);
|
|
23
216
|
/** Pending human-in-the-loop gate still waiting for Approve/Deny. */
|
|
24
217
|
export function toolCallHasPendingApproval(part) {
|
|
@@ -28,12 +221,25 @@ export function toolCallHasPendingApproval(part) {
|
|
|
28
221
|
approval.dismissed !== true);
|
|
29
222
|
}
|
|
30
223
|
export const TOOL_LONG_RUNNING_HINT_DELAY_MS = 45_000;
|
|
31
|
-
export function ToolActivityPresentation({ toolName, isRunning, isActiveTail, suppressLongRunningHint = false, children, }) {
|
|
224
|
+
export function ToolActivityPresentation({ toolName, isRunning, isActiveTail, toolCallId, suppressLongRunningHint = false, children, }) {
|
|
32
225
|
const [showLongRunningHint, setShowLongRunningHint] = useState(false);
|
|
33
226
|
// A batched update can first reveal a tool with its result already attached.
|
|
34
227
|
// Presentation follows the active chat tail rather than execution state so
|
|
35
228
|
// that newly revealed completed tools still get their entrance motion.
|
|
36
|
-
const [animateEntry] = useState(isActiveTail);
|
|
229
|
+
const [animateEntry, setAnimateEntry] = useState(isActiveTail);
|
|
230
|
+
const previousActiveTailRef = useRef(isActiveTail);
|
|
231
|
+
useEffect(() => {
|
|
232
|
+
if (isActiveTail && !previousActiveTailRef.current) {
|
|
233
|
+
setAnimateEntry(true);
|
|
234
|
+
}
|
|
235
|
+
previousActiveTailRef.current = isActiveTail;
|
|
236
|
+
}, [isActiveTail]);
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
if (!animateEntry)
|
|
239
|
+
return;
|
|
240
|
+
const timeout = window.setTimeout(() => setAnimateEntry(false), TOOL_CALL_ENTRY_DURATION_MS);
|
|
241
|
+
return () => window.clearTimeout(timeout);
|
|
242
|
+
}, [animateEntry]);
|
|
37
243
|
useEffect(() => {
|
|
38
244
|
if (!isRunning || suppressLongRunningHint) {
|
|
39
245
|
setShowLongRunningHint(false);
|
|
@@ -45,7 +251,7 @@ export function ToolActivityPresentation({ toolName, isRunning, isActiveTail, su
|
|
|
45
251
|
}, TOOL_LONG_RUNNING_HINT_DELAY_MS);
|
|
46
252
|
return () => window.clearTimeout(timeout);
|
|
47
253
|
}, [isRunning, suppressLongRunningHint, toolName]);
|
|
48
|
-
return (
|
|
254
|
+
return (_jsx("div", { className: cn("agent-tool-call", animateEntry && "agent-tool-call--entering"), "data-agent-tool-call-id": toolCallId, "data-running": isRunning ? "true" : undefined, children: _jsxs("div", { className: "agent-tool-call__content", children: [children, isRunning && showLongRunningHint && (_jsx("div", { className: "mt-0.5 px-2.5 pb-2 text-[11px] leading-snug text-muted-foreground/80", children: "Still working. Large updates can take a minute or two." }))] }) }));
|
|
49
255
|
}
|
|
50
256
|
function stringifyToolValue(value, pretty = false) {
|
|
51
257
|
if (typeof value === "string")
|
|
@@ -139,18 +345,19 @@ export function toolResultPayload(result) {
|
|
|
139
345
|
};
|
|
140
346
|
}
|
|
141
347
|
const brandIcons = new Map();
|
|
142
|
-
function brandToolIcon(logoUrl, name) {
|
|
143
|
-
const
|
|
348
|
+
function brandToolIcon(logoUrl, name, integrationId) {
|
|
349
|
+
const cacheKey = integrationId ? `${integrationId}:${logoUrl}` : logoUrl;
|
|
350
|
+
const cached = brandIcons.get(cacheKey);
|
|
144
351
|
if (cached)
|
|
145
352
|
return cached;
|
|
146
|
-
const Icon = ({ className, size }) => (_jsx(
|
|
147
|
-
brandIcons.set(
|
|
353
|
+
const Icon = ({ className, size }) => (_jsx(McpIntegrationLogo, { name: name, logoUrl: logoUrl, integrationId: integrationId, className: cn("size-4 rounded-[3px] border-0", className), imageClassName: "size-full", style: size === undefined ? undefined : { width: size, height: size }, title: name }));
|
|
354
|
+
brandIcons.set(cacheKey, Icon);
|
|
148
355
|
return Icon;
|
|
149
356
|
}
|
|
150
357
|
function resolveToolIcon(toolName) {
|
|
151
358
|
const integration = findMcpIntegrationForToolName(toolName);
|
|
152
359
|
if (integration) {
|
|
153
|
-
return brandToolIcon(integration.logoUrl, integration.name);
|
|
360
|
+
return brandToolIcon(integration.logoUrl, integration.name, integration.id);
|
|
154
361
|
}
|
|
155
362
|
const name = toolName.toLowerCase();
|
|
156
363
|
if (name.includes("slack"))
|
|
@@ -258,13 +465,13 @@ function ApprovalAffordance({ toolName, approval, }) {
|
|
|
258
465
|
}, className: cn("inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium transition-colors", "text-foreground hover:bg-muted"), children: [_jsx(IconX, { className: "h-3.5 w-3.5" }), "Deny"] })] }));
|
|
259
466
|
}
|
|
260
467
|
// ─── ToolCallDisplay ──────────────────────────────────────────────────────────
|
|
261
|
-
export function ToolCallDisplay({ toolName, argsText, args, result, mcpApp, chatUI, isRunning, outcome, structuredMeta, approval, repeatCount, isLatestRunning = isRunning, isActiveTail, }) {
|
|
468
|
+
export function ToolCallDisplay({ toolName, toolCallId, argsText, args, result, mcpApp, chatUI, isRunning, outcome, structuredMeta, approval, repeatCount, isLatestRunning = isRunning, isActiveTail, }) {
|
|
262
469
|
const showActiveTail = isActiveTail ?? isLatestRunning;
|
|
263
470
|
// Delegate to bespoke cells when structured metadata is present.
|
|
264
471
|
// These must be separate components so hook order in ToolCallDisplayGeneric
|
|
265
472
|
// is always stable (no conditional hook calls).
|
|
266
473
|
const toolKind = structuredMeta?.toolKind;
|
|
267
|
-
const wrapToolDisplay = (children) => (_jsx(ToolActivityPresentation, { toolName: toolName, isRunning: isRunning, isActiveTail: showActiveTail, suppressLongRunningHint: toolName === "call-agent" || toolName.startsWith("agent:"), children: children }));
|
|
474
|
+
const wrapToolDisplay = (children) => (_jsx(ToolActivityPresentation, { toolName: toolName, isRunning: isRunning, isActiveTail: showActiveTail, toolCallId: toolCallId, suppressLongRunningHint: toolName === "call-agent" || toolName.startsWith("agent:"), children: children }));
|
|
268
475
|
if (toolKind === "bash") {
|
|
269
476
|
return wrapToolDisplay(_jsx(BashCell, { meta: structuredMeta, output: result, isRunning: isRunning }));
|
|
270
477
|
}
|
|
@@ -426,10 +633,10 @@ function AgentCallCell({ agentName, activity, progress, responseText, isRunning,
|
|
|
426
633
|
function AgentActivityToolCallRow({ tool, isActiveTail, }) {
|
|
427
634
|
const isRunning = tool.status === "running";
|
|
428
635
|
const ToolIcon = resolveToolIcon(tool.name);
|
|
429
|
-
return (_jsx(ToolActivityPresentation, { toolName: tool.name, isRunning: isRunning, isActiveTail: isActiveTail, suppressLongRunningHint: true, children: _jsxs("div", { className: "my-0.5 flex w-full items-center gap-1.5 rounded-md py-0.5 text-left text-[13px] text-muted-foreground", children: [_jsx("span", { className: "flex size-4 shrink-0 items-center justify-center", children: isRunning ? (_jsx(IconLoader2, { className: "size-3.5 animate-spin" })) : (_jsx(ToolIcon, { className: "size-3.5" })) }), _jsx("span", { className: cn("min-w-0 truncate font-normal", isActiveTail && "agent-running-shimmer"), children: humanizeToolName(tool.name) })] }) }));
|
|
636
|
+
return (_jsx(ToolActivityPresentation, { toolName: tool.name, isRunning: isRunning, isActiveTail: isActiveTail, toolCallId: tool.id, suppressLongRunningHint: true, children: _jsxs("div", { className: "my-0.5 flex w-full items-center gap-1.5 rounded-md py-0.5 text-left text-[13px] text-muted-foreground", children: [_jsx("span", { className: "flex size-4 shrink-0 items-center justify-center", children: isRunning ? (_jsx(IconLoader2, { className: "size-3.5 animate-spin" })) : (_jsx(ToolIcon, { className: "size-3.5" })) }), _jsx("span", { className: cn("min-w-0 truncate font-normal", isActiveTail && "agent-running-shimmer"), children: humanizeToolName(tool.name) })] }) }));
|
|
430
637
|
}
|
|
431
638
|
// ─── ToolCallFallback ──────────────────────────────────────────────────────────
|
|
432
|
-
export function ToolCallFallback({ toolName, args, argsText, result, ...rest }) {
|
|
639
|
+
export function ToolCallFallback({ toolName, toolCallId, args, argsText, result, ...rest }) {
|
|
433
640
|
const chatRunning = React.useContext(ChatRunningContext);
|
|
434
641
|
// A spinner is a claim that something is running right now, so it needs an
|
|
435
642
|
// actually-running chat. `chatRunning` already stays true across
|
|
@@ -437,7 +644,7 @@ export function ToolCallFallback({ toolName, args, argsText, result, ...rest })
|
|
|
437
644
|
// so an activity placeholder alone must never resurrect one on rehydrated
|
|
438
645
|
// history.
|
|
439
646
|
const isRunning = result === undefined && chatRunning;
|
|
440
|
-
return (_jsx(ToolCallDisplay, { toolName: toolName, args: args, argsText: argsText, result: typeof result === "string"
|
|
647
|
+
return (_jsx(ToolCallDisplay, { toolName: toolName, toolCallId: toolCallId, args: args, argsText: argsText, result: typeof result === "string"
|
|
441
648
|
? result
|
|
442
649
|
: result !== undefined
|
|
443
650
|
? JSON.stringify(result)
|
|
@@ -467,7 +674,7 @@ export function ReconnectStreamMessage({ content, allowActivitySpinner = true, }
|
|
|
467
674
|
if (part.type === "reasoning") {
|
|
468
675
|
return (_jsx(ReasoningCell, { text: part.text, isStreaming: chatRunning && i === streamingReasoningPartIndex, resetKey: `reconnect-reasoning-${i}`, defaultOpen: i === latestReasoningPartIndex, collapseWhenReplaced: i < latestReasoningPartIndex }, `reconnect-reasoning-${i}`));
|
|
469
676
|
}
|
|
470
|
-
return (_jsx(ToolCallDisplay, { toolName: part.toolName, argsText: part.argsText, args: part.args, result: part.result, mcpApp: part.mcpApp, chatUI: part.chatUI, structuredMeta: part.structuredMeta, outcome: part.outcome, isRunning: part.result === undefined &&
|
|
677
|
+
return (_jsx(ToolCallDisplay, { toolName: part.toolName, toolCallId: part.toolCallId, argsText: part.argsText, args: part.args, result: part.result, mcpApp: part.mcpApp, chatUI: part.chatUI, structuredMeta: part.structuredMeta, outcome: part.outcome, isRunning: part.result === undefined &&
|
|
471
678
|
(chatRunning || (allowActivitySpinner && part.activity === true)), isActiveTail: i === latestActiveToolIndex, approval: part.approval, repeatCount: part.repeatCount }, `reconnect-tool-${i}`));
|
|
472
679
|
};
|
|
473
680
|
const renderedParts = [];
|
|
@@ -476,7 +683,7 @@ export function ReconnectStreamMessage({ content, allowActivitySpinner = true, }
|
|
|
476
683
|
const flushSummary = (endIndex) => {
|
|
477
684
|
if (summaryStartIndex < 0)
|
|
478
685
|
return;
|
|
479
|
-
renderedParts.push(_jsx(RanToolsSummary, { toolCount: summaryToolCount, children: content
|
|
686
|
+
renderedParts.push(_jsx(RanToolsSummary, { toolCount: summaryToolCount, motionKey: `reconnect-${summaryStartIndex}`, children: content
|
|
480
687
|
.slice(summaryStartIndex, endIndex)
|
|
481
688
|
.map((part, offset) => renderPart(part, summaryStartIndex + offset)) }, `reconnect-tool-summary-${summaryStartIndex}`));
|
|
482
689
|
summaryStartIndex = -1;
|
|
@@ -499,7 +706,7 @@ export function ReconnectStreamMessage({ content, allowActivitySpinner = true, }
|
|
|
499
706
|
renderedParts.push(renderPart(part, i));
|
|
500
707
|
}
|
|
501
708
|
flushSummary(content.length);
|
|
502
|
-
return (_jsx("div", { className: "flex justify-start", children: _jsx("div", { className: "w-full max-w-[95%] text-sm leading-relaxed text-foreground space-y-1", children: renderedParts }) }));
|
|
709
|
+
return (_jsx("div", { className: "flex justify-start", children: _jsx("div", { className: "w-full max-w-[95%] text-sm leading-relaxed text-foreground", children: _jsx(ToolCallStackMotion, { className: "space-y-1", children: renderedParts }) }) }));
|
|
503
710
|
}
|
|
504
711
|
function getReconnectToolSummaryInfo(content) {
|
|
505
712
|
const toolCallIndices = content.reduce((indices, part, index) => {
|
|
@@ -625,10 +832,10 @@ export function WorkedForSummary({ durationMs, defaultOpen = false, autoCollapse
|
|
|
625
832
|
: "Worked";
|
|
626
833
|
return (_jsxs("div", { className: "my-1 w-full", children: [_jsxs("button", { type: "button", onClick: () => setOpen((v) => !v), "aria-expanded": open, className: "flex items-center gap-1.5 py-0.5 text-[13px] text-muted-foreground transition-colors hover:text-foreground", children: [_jsx("span", { children: label }), _jsx(IconChevronRight, { className: cn("size-3.5 shrink-0 transition-transform", open && "rotate-90") })] }), _jsx(AnimatedCollapse, { open: open, children: _jsx(WorkSummaryContentContext.Provider, { value: true, children: _jsx("div", { className: "pt-1", children: children }) }) })] }));
|
|
627
834
|
}
|
|
628
|
-
export function RanToolsSummary({ toolCount, children, }) {
|
|
835
|
+
export function RanToolsSummary({ toolCount, motionKey = "summary", children, }) {
|
|
629
836
|
const [open, setOpen] = useState(false);
|
|
630
837
|
const label = `Ran ${toolCount} ${toolCount === 1 ? "tool" : "tools"}`;
|
|
631
|
-
return (_jsxs("div", { className: "my-1 w-full", children: [_jsxs("button", { type: "button", onClick: () => setOpen((v) => !v), "aria-expanded": open, className: "flex items-center gap-1.5 py-0.5 text-[13px] text-muted-foreground transition-colors hover:text-foreground", children: [_jsx("span", { children: label }), _jsx(IconChevronRight, { className: cn("size-3.5 shrink-0 transition-transform", open && "rotate-90") })] }), _jsx(AnimatedCollapse, { open: open, children: _jsx("div", { className: "pt-1", children: children }) })] }));
|
|
838
|
+
return (_jsxs("div", { className: "agent-tool-summary my-1 w-full", "data-agent-tool-summary": motionKey, children: [_jsxs("button", { type: "button", onClick: () => setOpen((v) => !v), "aria-expanded": open, className: "flex items-center gap-1.5 py-0.5 text-[13px] text-muted-foreground transition-colors hover:text-foreground", children: [_jsx("span", { className: "agent-tool-summary__label", children: label }), _jsx(IconChevronRight, { className: cn("size-3.5 shrink-0 transition-transform", open && "rotate-90") })] }), _jsx(AnimatedCollapse, { open: open, children: _jsx("div", { className: "pt-1", children: children }) })] }));
|
|
632
839
|
}
|
|
633
840
|
// ─── Re-export for AssistantMessage ───────────────────────────────────────────
|
|
634
841
|
// AssistantMessage in AssistantChat.tsx uses FilesChangedSummary directly, so
|
|
@@ -665,7 +665,7 @@ export function ExtensionsSidebarSection() {
|
|
|
665
665
|
};
|
|
666
666
|
return (_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs("div", { className: "relative min-w-0 py-1", children: [_jsxs("div", { className: cn("group/extensions-section relative flex w-full min-w-0 items-center rounded-md text-sm font-medium transition-[opacity,color,background-color] hover:text-primary", location.pathname.startsWith("/extensions")
|
|
667
667
|
? "text-sidebar-accent-foreground"
|
|
668
|
-
: "text-muted-foreground hover:bg-sidebar-accent/50", extensionsOpen && sortedTools.length > 0 && "mb-1"), children: [_jsx("button", { type: "button", onClick: toggleExtensionsOpen, className: "absolute inset-0 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "aria-label": extensionsOpen ? copy.collapse : copy.expand, "aria-expanded": extensionsOpen }), _jsxs("div", { className: "pointer-events-none relative z-10 flex min-w-0 flex-1 items-center gap-2 px-3 py-1.5 pr-20", children: [_jsx(IconTool, { className: "h-4 w-4 shrink-0" }), _jsxs(HoverCard, { openDelay: 1200, closeDelay: 200, children: [_jsx(HoverCardTrigger, { asChild: true, children: _jsx("span", { className: "pointer-events-auto min-w-0 select-none truncate", onClick: toggleExtensionsOpen, children: copy.title }) }), _jsxs(HoverCardContent, { side: "top", align: "start", sideOffset: 8, className: "w-72 space-y-3 p-3", children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm font-semibold text-foreground", children: copy.title }), _jsx("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: copy.description })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Link, { to: "/extensions", className: "inline-flex h-8 items-center rounded-md border px-2.5 text-xs font-medium text-foreground transition-colors hover:bg-accent", children: copy.open }), _jsx("a", { href: "https://agent-native.com/docs/extensions", target: "_blank", rel: "noopener noreferrer", className: "inline-flex h-8 items-center rounded-md px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground", children: copy.learnMore })] })] })] })] }), _jsxs("div", { className: "absolute right-1 top-1/2 z-20 flex -translate-y-1/2 items-center", children: [_jsx(ExtensionSortMenu, { value: sortModeState, onChange: setExtensionSortMode, showHidden: showGloballyHidden, onShowHiddenChange: setShowGloballyHidden, copy: copy }), _jsxs(Popover, { open: showCreate, onOpenChange: setShowCreate, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "pointer-events-none inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground/70 opacity-0 transition-[opacity,color,background-color] hover:bg-accent hover:text-accent-foreground focus-visible:pointer-events-auto focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-hover/extensions-section:pointer-events-auto group-hover/extensions-section:opacity-100 group-focus-within/extensions-section:pointer-events-auto group-focus-within/extensions-section:opacity-100 data-[state=open]:pointer-events-auto data-[state=open]:opacity-100", "aria-label": copy.newExtension, children: _jsx(IconPlus, { className: "h-3.5 w-3.5" }) }) }), _jsxs(PopoverContent, { side: "right", align: "start", collisionPadding: 8, className: "relative z-[360] w-[min(420px,calc(100vw-16px))] px-2 pb-2 pt-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-2 ps-1 pb-2", children: [_jsx("p", { className: "text-sm font-semibold text-foreground", children: copy.newExtension }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("a", { href: "https://agent-native.com/docs/extensions", target: "_blank", rel: "noopener noreferrer", className: "inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "aria-label": copy.learnMore, children: _jsx(IconHelpCircle, { className: "size-
|
|
668
|
+
: "text-muted-foreground hover:bg-sidebar-accent/50", extensionsOpen && sortedTools.length > 0 && "mb-1"), children: [_jsx("button", { type: "button", onClick: toggleExtensionsOpen, className: "absolute inset-0 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "aria-label": extensionsOpen ? copy.collapse : copy.expand, "aria-expanded": extensionsOpen }), _jsxs("div", { className: "pointer-events-none relative z-10 flex min-w-0 flex-1 items-center gap-2 px-3 py-1.5 pr-20", children: [_jsx(IconTool, { className: "h-4 w-4 shrink-0" }), _jsxs(HoverCard, { openDelay: 1200, closeDelay: 200, children: [_jsx(HoverCardTrigger, { asChild: true, children: _jsx("span", { className: "pointer-events-auto min-w-0 select-none truncate", onClick: toggleExtensionsOpen, children: copy.title }) }), _jsxs(HoverCardContent, { side: "top", align: "start", sideOffset: 8, className: "w-72 space-y-3 p-3", children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm font-semibold text-foreground", children: copy.title }), _jsx("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: copy.description })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Link, { to: "/extensions", className: "inline-flex h-8 items-center rounded-md border px-2.5 text-xs font-medium text-foreground transition-colors hover:bg-accent", children: copy.open }), _jsx("a", { href: "https://agent-native.com/docs/extensions", target: "_blank", rel: "noopener noreferrer", className: "inline-flex h-8 items-center rounded-md px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground", children: copy.learnMore })] })] })] })] }), _jsxs("div", { className: "absolute right-1 top-1/2 z-20 flex -translate-y-1/2 items-center", children: [_jsx(ExtensionSortMenu, { value: sortModeState, onChange: setExtensionSortMode, showHidden: showGloballyHidden, onShowHiddenChange: setShowGloballyHidden, copy: copy }), _jsxs(Popover, { open: showCreate, onOpenChange: setShowCreate, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "pointer-events-none inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground/70 opacity-0 transition-[opacity,color,background-color] hover:bg-accent hover:text-accent-foreground focus-visible:pointer-events-auto focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-hover/extensions-section:pointer-events-auto group-hover/extensions-section:opacity-100 group-focus-within/extensions-section:pointer-events-auto group-focus-within/extensions-section:opacity-100 data-[state=open]:pointer-events-auto data-[state=open]:opacity-100", "aria-label": copy.newExtension, children: _jsx(IconPlus, { className: "h-3.5 w-3.5" }) }) }), _jsxs(PopoverContent, { side: "right", align: "start", collisionPadding: 8, className: "relative z-[360] w-[min(420px,calc(100vw-16px))] px-2 pb-2 pt-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-2 ps-1 pb-2", children: [_jsx("p", { className: "text-sm font-semibold text-foreground", children: copy.newExtension }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("a", { href: "https://agent-native.com/docs/extensions", target: "_blank", rel: "noopener noreferrer", className: "inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "aria-label": copy.learnMore, children: _jsx(IconHelpCircle, { className: "size-3" }) }) }), _jsx(TooltipContent, { children: copy.learnMore })] })] }), _jsx(PromptComposer, { autoFocus: true, placeholder: copy.createPlaceholder, draftScope: "extensions:sidebar-create", onSubmit: handleCreate })] })] }), _jsx("button", { type: "button", onClick: toggleExtensionsOpen, className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground/70 hover:bg-accent hover:text-foreground", "aria-label": extensionsOpen ? copy.collapse : copy.expand, "aria-expanded": extensionsOpen, children: _jsx(IconChevronDown, { className: cn("h-3.5 w-3.5 shrink-0 transition-transform", !extensionsOpen && "-rotate-90") }) })] })] }), extensionsOpen &&
|
|
669
669
|
(extensionsQuery.isLoading ? (_jsx("div", { className: "min-w-0 space-y-0.5 px-0.5", children: [1, 2, 3].map((i) => (_jsx("div", { className: "flex items-center rounded-md px-2 py-1.5", children: _jsx("div", { className: "h-3 rounded bg-muted animate-pulse", style: { width: `${60 + i * 20}px` } }) }, i))) })) : extensionsQuery.isError ? (_jsx(ExtensionQueryErrorState, { compact: true, message: copy.loadError, onRetry: () => void extensionsQuery.refetch(), retrying: extensionsQuery.isFetching })) : sortedTools.length === 0 ? null : (_jsxs("div", { className: "min-w-0 space-y-0.5 px-0.5", children: [visibleTools.map((extension) => {
|
|
670
670
|
const isActive = isExtensionPathname(location.pathname, extension.id);
|
|
671
671
|
const isFav = favoriteIds.has(extension.id);
|
|
@@ -114,6 +114,10 @@ export interface SidebarModeMessage {
|
|
|
114
114
|
width?: number;
|
|
115
115
|
/** Whether the app's sidebar should be open. */
|
|
116
116
|
open?: boolean;
|
|
117
|
+
/** Whether the sidebar is using the wide fixed drawer presentation. */
|
|
118
|
+
wide?: boolean;
|
|
119
|
+
/** Width reserved in the app layout while the wide drawer overlays it. */
|
|
120
|
+
placeholderWidth?: number;
|
|
117
121
|
};
|
|
118
122
|
}
|
|
119
123
|
export interface DesignInitMessage {
|
package/dist/client/i18n.js
CHANGED
|
@@ -405,6 +405,15 @@ const CORE_FALLBACK_MESSAGES = {
|
|
|
405
405
|
"agentPanel.cliRequiresDevMode": "CLI requires dev mode",
|
|
406
406
|
"agentPanel.cliRequiresDevModeDescription": "Run this app locally with pnpm dev or use Builder.io to access the CLI terminal.",
|
|
407
407
|
"agentPanel.toggleAgent": "Toggle agent",
|
|
408
|
+
"runtimeConfig.warningTitle": "Production configuration warning",
|
|
409
|
+
"runtimeConfig.errorTitle": "Production configuration error",
|
|
410
|
+
"runtimeConfig.issue_one": "{{count}} issue",
|
|
411
|
+
"runtimeConfig.issue_other": "{{count}} issues",
|
|
412
|
+
"runtimeConfig.showDetails": "Show configuration details",
|
|
413
|
+
"runtimeConfig.hideDetails": "Hide configuration details",
|
|
414
|
+
"runtimeConfig.copyPrompt": "Copy prompt for AI",
|
|
415
|
+
"runtimeConfig.copied": "Prompt copied",
|
|
416
|
+
"runtimeConfig.copyFailed": "Copy failed",
|
|
408
417
|
};
|
|
409
418
|
function flattenMessages(value, prefix = "", out = {}) {
|
|
410
419
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
@@ -6,6 +6,7 @@ import { Tooltip, TooltipContent, TooltipTrigger, } from "../components/ui/toolt
|
|
|
6
6
|
import { useT } from "../i18n.js";
|
|
7
7
|
import { getDefaultMcpIntegrations, } from "../resources/mcp-integration-catalog.js";
|
|
8
8
|
import { McpIntegrationDialog } from "../resources/McpIntegrationDialog.js";
|
|
9
|
+
import { McpIntegrationLogo } from "../resources/McpIntegrationLogo.js";
|
|
9
10
|
import { useCreateMcpServer, useDeleteMcpServer, useMcpServers, useReconnectMcpServer, } from "../resources/use-mcp-servers.js";
|
|
10
11
|
import { useIntegrationStatus, } from "./useIntegrationStatus.js";
|
|
11
12
|
import { isNonPublicWebhookUrl } from "./webhook-url.js";
|
|
@@ -253,10 +254,6 @@ function compareMcpUrl(value) {
|
|
|
253
254
|
return value.trim().replace(/\/+$/, "");
|
|
254
255
|
}
|
|
255
256
|
}
|
|
256
|
-
function McpLogo({ integration }) {
|
|
257
|
-
const [failed, setFailed] = useState(false);
|
|
258
|
-
return (_jsx("span", { className: "flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border/70 bg-background text-xs font-semibold text-muted-foreground", children: failed ? (integration.name.slice(0, 1)) : (_jsx("img", { src: integration.logoUrl, alt: "", loading: "lazy", decoding: "async", className: "size-7 object-contain", onError: () => setFailed(true) })) }));
|
|
259
|
-
}
|
|
260
257
|
function McpServerStatus({ server, onReconnect, reconnecting = false, reconnectError, }) {
|
|
261
258
|
const t = useT();
|
|
262
259
|
if (server.status.state === "connected") {
|
|
@@ -274,7 +271,7 @@ function McpServerStatus({ server, onReconnect, reconnecting = false, reconnectE
|
|
|
274
271
|
return (_jsxs("span", { className: "inline-flex items-center gap-1.5 text-xs text-muted-foreground", children: [_jsx("span", { className: "size-1.5 rounded-full bg-muted-foreground/50" }), "Status unknown"] }));
|
|
275
272
|
}
|
|
276
273
|
function McpCatalogItem({ integration, connected, onConnect, }) {
|
|
277
|
-
return (_jsxs("div", { className: "flex min-w-0 items-center gap-3 border-b border-border/60 py-4 last:border-b-0", children: [_jsx(
|
|
274
|
+
return (_jsxs("div", { className: "flex min-w-0 items-center gap-3 border-b border-border/60 py-4 last:border-b-0", children: [_jsx(McpIntegrationLogo, { name: integration.name, logoUrl: integration.logoUrl, integrationId: integration.id }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "truncate text-sm font-medium text-foreground", children: integration.name }), connected && (_jsx("span", { className: "shrink-0 text-[11px] font-medium text-emerald-600 dark:text-emerald-400", children: "Connected" }))] }), _jsx("p", { className: "mt-0.5 line-clamp-1 text-xs leading-5 text-muted-foreground", children: integration.description || integration.useCase })] }), _jsx("button", { type: "button", onClick: () => onConnect(integration.id), className: "shrink-0 rounded-md border border-border bg-background px-2.5 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-accent", children: connected ? "Manage" : "Connect" })] }));
|
|
278
275
|
}
|
|
279
276
|
function McpIntegrationsSection({ query }) {
|
|
280
277
|
const serversQuery = useMcpServers();
|
|
@@ -6,6 +6,7 @@ import { appPath } from "../api-path.js";
|
|
|
6
6
|
import { Tooltip, TooltipContent, TooltipTrigger, } from "../components/ui/tooltip.js";
|
|
7
7
|
import { buildMcpOAuthStartUrl, filterMcpIntegrations, getDefaultMcpIntegrations, navigateToMcpOAuthStart, shouldOfferMcpIntegrationOrganizationScope, } from "../resources/mcp-integration-catalog.js";
|
|
8
8
|
import { McpIntegrationDialog } from "../resources/McpIntegrationDialog.js";
|
|
9
|
+
import { McpIntegrationLogo } from "../resources/McpIntegrationLogo.js";
|
|
9
10
|
import { formatMcpServerError, useCreateMcpServer, useMcpServers, } from "../resources/use-mcp-servers.js";
|
|
10
11
|
import { useBuilderConnectFlow } from "../settings/useBuilderStatus.js";
|
|
11
12
|
import { cn } from "../utils.js";
|
|
@@ -230,9 +231,7 @@ function CapabilityList({ capabilities, compact = false, className, }) {
|
|
|
230
231
|
}
|
|
231
232
|
function McpIntegrationCard({ integration, connected, busy, onConnect, }) {
|
|
232
233
|
const actionLabel = "Connect";
|
|
233
|
-
return (_jsxs("article", { className: "flex min-w-0 items-center gap-3 border-b border-border/70 py-3.5 sm:pe-4", children: [_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
234
|
-
event.currentTarget.hidden = true;
|
|
235
|
-
} })] }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("h3", { className: "truncate text-sm font-medium text-foreground", children: integration.name }), connected ? (_jsx("span", { className: "rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground", children: "Connected" })) : null] }), _jsx("p", { className: "mt-1 line-clamp-2 text-[11px] leading-4 text-muted-foreground", children: integration.description })] })] }), _jsxs("button", { type: "button", onClick: () => onConnect(integration), disabled: connected || busy, "aria-label": `${actionLabel} ${integration.name}`, className: "inline-flex min-h-8 shrink-0 items-center justify-center gap-1.5 rounded-md border border-border bg-background px-3 text-[11px] font-medium text-foreground transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", children: [busy ? _jsx(IconLoader2, { className: "animate-spin", size: 13 }) : null, connected ? "Connected" : actionLabel] })] }));
|
|
234
|
+
return (_jsxs("article", { className: "flex min-w-0 items-center gap-3 border-b border-border/70 py-3.5 sm:pe-4", children: [_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [_jsx(McpIntegrationLogo, { name: integration.name, logoUrl: integration.logoUrl, integrationId: integration.id, className: "size-8 rounded-md", imageClassName: "size-full p-1" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("h3", { className: "truncate text-sm font-medium text-foreground", children: integration.name }), connected ? (_jsx("span", { className: "rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground", children: "Connected" })) : null] }), _jsx("p", { className: "mt-1 line-clamp-2 text-[11px] leading-4 text-muted-foreground", children: integration.description })] })] }), _jsxs("button", { type: "button", onClick: () => onConnect(integration), disabled: connected || busy, "aria-label": `${actionLabel} ${integration.name}`, className: "inline-flex min-h-8 shrink-0 items-center justify-center gap-1.5 rounded-md border border-border bg-background px-3 text-[11px] font-medium text-foreground transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", children: [busy ? _jsx(IconLoader2, { className: "animate-spin", size: 13 }) : null, connected ? "Connected" : actionLabel] })] }));
|
|
236
235
|
}
|
|
237
236
|
function CapabilityRow({ capability, compact, }) {
|
|
238
237
|
return (_jsxs("div", { className: cn("flex items-start justify-between gap-3", compact ? "py-2" : "py-3"), children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: cn("font-medium", compact ? "text-[11px]" : "text-sm"), children: capability.label }), _jsx(CapabilityInfoButton, { capability: capability, ariaLabel: `Why ${capability.label} is needed` })] }), _jsx("p", { className: "mt-1 text-[11px] leading-4 text-muted-foreground", children: capability.keySummary })] }), _jsx("span", { className: cn("shrink-0 text-[10px] uppercase tracking-[0.08em]", capability.required ? "text-primary" : "text-muted-foreground"), children: capability.required ? "Required" : "Optional" })] }));
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "@agent-native/toolkit/ui/alert-dialog";
|
|
3
3
|
import { Button as ToolkitButton } from "@agent-native/toolkit/ui/button";
|
|
4
|
+
import { Pagination, PaginationContent, PaginationItem, PaginationNext, PaginationPrevious, } from "@agent-native/toolkit/ui/pagination";
|
|
4
5
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@agent-native/toolkit/ui/select";
|
|
5
6
|
import { Switch } from "@agent-native/toolkit/ui/switch";
|
|
6
7
|
import { IconUserPlus, IconTrash, IconCrown, IconShieldCheck, IconLoader2, IconCheck, IconPencil, IconAt, IconX, IconKey, IconCopy, IconRefresh, IconEye, IconEyeOff, IconCloudUpload, IconFileImport, IconPlus, IconAlertTriangle, IconUsersGroup, IconHelpCircle, IconExternalLink, } from "@tabler/icons-react";
|
|
7
|
-
import { forwardRef, useMemo, useRef, useState, } from "react";
|
|
8
|
+
import { forwardRef, useEffect, useMemo, useRef, useState, } from "react";
|
|
8
9
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "../components/ui/tooltip.js";
|
|
9
10
|
import { useT } from "../i18n.js";
|
|
10
11
|
import { SettingsGroup, SettingsRow } from "../settings/SettingsRow.js";
|
|
11
12
|
import { cn } from "../utils.js";
|
|
12
|
-
import { useOrg, useOrgMembers, useOrgInvitations, useCreateOrg, useUpdateOrg, useBulkInviteMembers, useChangeMemberRole, useAcceptInvitation, useRemoveMember, useDeleteOrg, useSwitchOrg, useSetOrgDomain, useSetOrgWorkspaceUrl, useSetOrgAuthProvider, useRevealA2ASecret, useSetA2ASecret, useSyncA2ASecret, useJoinByDomain, useAppRoles, useSetAppMemberRole, } from "./hooks.js";
|
|
13
|
+
import { useOrg, useOrgMembers, useOrgInvitations, useCreateOrg, useUpdateOrg, useBulkInviteMembers, useChangeMemberRole, useAcceptInvitation, useRemoveMember, useDeleteOrg, useSwitchOrg, useSetOrgDomain, useSetOrgWorkspaceUrl, useSetOrgAuthProvider, useRevealA2ASecret, useSetA2ASecret, useSyncA2ASecret, useJoinByDomain, useAppRoles, useSetAppMemberRole, ORG_MEMBER_PAGE_SIZE, } from "./hooks.js";
|
|
13
14
|
const Button = forwardRef(({ className, ...props }, ref) => (_jsx(ToolkitButton, { ref: ref, variant: "ghost", className: cn("h-auto p-0 hover:bg-transparent hover:text-inherit active:scale-100 [&_svg]:!size-auto", className), ...props })));
|
|
14
15
|
Button.displayName = "TeamPrimitiveButton";
|
|
15
16
|
function RoleIcon({ role }) {
|
|
@@ -96,19 +97,40 @@ function OrgNameDisplay({ name, canEdit }) {
|
|
|
96
97
|
function MembersCard({ appRoles }) {
|
|
97
98
|
const t = useT();
|
|
98
99
|
const { data: org } = useOrg();
|
|
99
|
-
const
|
|
100
|
+
const [memberOffset, setMemberOffset] = useState(0);
|
|
101
|
+
const { data: membersData, isLoading: isLoadingMembers, isFetching: isFetchingMembers, isPlaceholderData: isPlaceholderMembers, } = useOrgMembers(memberOffset);
|
|
100
102
|
const { data: invitationsData } = useOrgInvitations();
|
|
101
103
|
const switchOrg = useSwitchOrg();
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
setMemberOffset(0);
|
|
106
|
+
}, [org?.orgId]);
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (memberOffset > 0 &&
|
|
109
|
+
membersData &&
|
|
110
|
+
!isLoadingMembers &&
|
|
111
|
+
!isFetchingMembers &&
|
|
112
|
+
!isPlaceholderMembers &&
|
|
113
|
+
membersData.members.length === 0) {
|
|
114
|
+
setMemberOffset((currentOffset) => Math.max(0, currentOffset - ORG_MEMBER_PAGE_SIZE));
|
|
115
|
+
}
|
|
116
|
+
}, [
|
|
117
|
+
isFetchingMembers,
|
|
118
|
+
isLoadingMembers,
|
|
119
|
+
isPlaceholderMembers,
|
|
120
|
+
memberOffset,
|
|
121
|
+
membersData,
|
|
122
|
+
]);
|
|
102
123
|
if (!org?.orgId)
|
|
103
124
|
return null;
|
|
104
125
|
const isOwner = org.role === "owner";
|
|
105
126
|
const isOwnerOrAdmin = isOwner || org.role === "admin";
|
|
106
127
|
const members = membersData?.members ?? [];
|
|
128
|
+
const totalMembers = membersData?.totalCount ?? 0;
|
|
107
129
|
const pendingInvites = invitationsData?.invitations ?? [];
|
|
108
130
|
const hasMultipleOrgs = (org.orgs?.length ?? 0) > 1;
|
|
109
|
-
return (_jsxs("div", { className: "space-y-6", children: [_jsxs(SettingsGroup, { title: "Organization", children: [_jsx(SettingsRow, { id: "organization", label: _jsxs("span", { className: "flex items-center gap-2", children: [_jsx(IconUsersGroup, { className: "size-4 text-muted-foreground" }), _jsx(OrgNameDisplay, { name: org.orgName ?? "", canEdit: isOwnerOrAdmin })] }), description: `${t("org.memberCount", { count:
|
|
131
|
+
return (_jsxs("div", { className: "space-y-6", children: [_jsxs(SettingsGroup, { title: "Organization", children: [_jsx(SettingsRow, { id: "organization", label: _jsxs("span", { className: "flex items-center gap-2", children: [_jsx(IconUsersGroup, { className: "size-4 text-muted-foreground" }), _jsx(OrgNameDisplay, { name: org.orgName ?? "", canEdit: isOwnerOrAdmin })] }), description: `${t("org.memberCount", { count: totalMembers })} · ${t("org.youAreRole", { role: org.role })}`, control: hasMultipleOrgs ? (_jsxs(Select, { value: org.orgId ?? "", onValueChange: (value) => switchOrg.mutate(value || null), disabled: switchOrg.isPending, children: [_jsx(SelectTrigger, { className: "h-auto w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-xs sm:w-auto", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: org.orgs.map((o) => (_jsx(SelectItem, { value: o.orgId, children: o.orgName }, o.orgId))) })] })) : undefined }), isOwnerOrAdmin && (_jsxs(_Fragment, { children: [_jsx(DomainSettingsSection, { domain: org.allowedDomain, ownerEmail: org.email }), _jsx(WorkspaceUrlSettingsSection, { workspaceUrl: org.workspaceUrl }), _jsx(AuthProviderSettingsSection, { requiredAuthProvider: org.requiredAuthProvider }), isOwner && _jsx(A2ASecretSection, { isSet: Boolean(org.a2aSecretSet) })] })), switchOrg.error && (_jsx("div", { className: "px-5 pb-4", children: _jsx(ErrorText, { error: switchOrg.error }) }))] }), _jsx(MembersTableCard, { members: members, totalMembers: totalMembers, pendingInvites: pendingInvites, isLoadingMembers: isLoadingMembers, isFetchingMembers: isFetchingMembers, currentUserEmail: org.email, currentUserRole: org.role ?? null, appRoles: appRoles, memberOffset: memberOffset, hasNextPage: membersData?.hasMore === true, nextMemberOffset: membersData?.nextOffset ?? null, onMemberPageChange: setMemberOffset }), isOwner && _jsx(DangerZoneCard, { orgName: org.orgName ?? "" })] }));
|
|
110
132
|
}
|
|
111
|
-
function MembersTableCard({ members, pendingInvites, isLoadingMembers, currentUserEmail, currentUserRole, appRoles, }) {
|
|
133
|
+
function MembersTableCard({ members, totalMembers, pendingInvites, isLoadingMembers, isFetchingMembers, currentUserEmail, currentUserRole, appRoles, memberOffset, hasNextPage, nextMemberOffset, onMemberPageChange, }) {
|
|
112
134
|
const t = useT();
|
|
113
135
|
const [showInviteForm, setShowInviteForm] = useState(false);
|
|
114
136
|
const canInvite = currentUserRole === "owner" || currentUserRole === "admin";
|
|
@@ -117,7 +139,28 @@ function MembersTableCard({ members, pendingInvites, isLoadingMembers, currentUs
|
|
|
117
139
|
a.email.toLowerCase(),
|
|
118
140
|
a.role,
|
|
119
141
|
]));
|
|
120
|
-
return (_jsxs("section", { className: "overflow-hidden rounded-xl border border-border/70 bg-card text-card-foreground", children: [_jsxs("div", { className: "flex flex-col gap-3 px-5 py-4 sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-sm font-medium", children: t("org.members") }), _jsx("p", { className: "text-xs text-muted-foreground", children: t("org.memberCount", { count:
|
|
142
|
+
return (_jsxs("section", { className: "overflow-hidden rounded-xl border border-border/70 bg-card text-card-foreground", children: [_jsxs("div", { className: "flex flex-col gap-3 px-5 py-4 sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-sm font-medium", children: t("org.members") }), _jsx("p", { className: "text-xs text-muted-foreground", children: t("org.memberCount", { count: totalMembers }) })] }), canInvite && !showInviteForm && (_jsxs(Button, { type: "button", intent: "primary", emphasis: "solid", onClick: () => setShowInviteForm(true), className: "inline-flex items-center justify-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90", children: [_jsx(IconUserPlus, { size: 14 }), t("org.inviteMembers")] }))] }), canInvite && showInviteForm && (_jsx("div", { className: "border-b border-border p-4", children: _jsx(BulkInviteForm, { currentUserRole: currentUserRole, onClose: () => setShowInviteForm(false) }) })), _jsx("div", { className: "divide-y divide-border/60 border-t border-border/60", children: isLoadingMembers && members.length === 0 ? ([0, 1, 2].map((i) => (_jsxs("div", { className: "flex items-center gap-3 px-5 py-4", children: [_jsx("div", { className: "size-8 animate-pulse rounded-full bg-muted" }), _jsxs("div", { className: "space-y-2", children: [_jsx("div", { className: "h-3.5 animate-pulse rounded bg-muted", style: { width: `${180 + i * 48}px` } }), _jsx("div", { className: "h-3 w-20 animate-pulse rounded bg-muted" })] })] }, i)))) : members.length === 0 && pendingInvites.length === 0 ? (_jsx("div", { className: "px-5 py-10 text-center text-sm text-muted-foreground", children: t("org.noMembers") })) : (_jsxs(_Fragment, { children: [members.map((m) => (_jsx(MemberRow, { email: m.email, role: m.role, isCurrentUser: m.email === currentUserEmail, currentUserRole: currentUserRole, appRoles: appRoles, appRole: appRoleByEmail.get(m.email.toLowerCase()) ?? null, canManageAppRoles: Boolean(appRoleData?.canManage) }, m.email))), pendingInvites.map((inv) => (_jsx(PendingInviteRow, { invite: inv }, inv.id)))] })) }), (memberOffset > 0 || hasNextPage) && (_jsx(MemberPagination, { memberOffset: memberOffset, totalMembers: totalMembers, hasNextPage: hasNextPage, nextMemberOffset: nextMemberOffset, isFetchingMembers: isFetchingMembers, onMemberPageChange: onMemberPageChange }))] }));
|
|
143
|
+
}
|
|
144
|
+
function MemberPagination({ memberOffset, totalMembers, hasNextPage, nextMemberOffset, isFetchingMembers, onMemberPageChange, }) {
|
|
145
|
+
const t = useT();
|
|
146
|
+
const currentPage = Math.floor(memberOffset / ORG_MEMBER_PAGE_SIZE) + 1;
|
|
147
|
+
const totalPages = Math.max(1, Math.ceil(totalMembers / ORG_MEMBER_PAGE_SIZE));
|
|
148
|
+
const canGoPrevious = memberOffset > 0 && !isFetchingMembers;
|
|
149
|
+
const canGoNext = hasNextPage && nextMemberOffset !== null && !isFetchingMembers;
|
|
150
|
+
return (_jsxs("div", { className: "flex flex-col gap-3 border-t border-border/60 px-5 py-3 sm:flex-row sm:items-center sm:justify-between", children: [_jsx("p", { className: "text-xs text-muted-foreground", "aria-live": "polite", children: t("org.memberPageStatus", {
|
|
151
|
+
page: currentPage,
|
|
152
|
+
totalPages,
|
|
153
|
+
}) }), _jsx(Pagination, { "aria-label": t("org.memberPagination"), className: "mx-0 w-auto justify-start sm:justify-end", children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { href: "#", "aria-label": t("org.previousMemberPage"), "aria-disabled": !canGoPrevious, tabIndex: canGoPrevious ? undefined : -1, className: cn("text-xs", !canGoPrevious && "pointer-events-none opacity-50"), onClick: (event) => {
|
|
154
|
+
event.preventDefault();
|
|
155
|
+
if (canGoPrevious) {
|
|
156
|
+
onMemberPageChange(Math.max(0, memberOffset - ORG_MEMBER_PAGE_SIZE));
|
|
157
|
+
}
|
|
158
|
+
} }) }), _jsx(PaginationItem, { children: _jsx(PaginationNext, { href: "#", "aria-label": t("org.nextMemberPage"), "aria-disabled": !canGoNext, tabIndex: canGoNext ? undefined : -1, className: cn("text-xs", !canGoNext && "pointer-events-none opacity-50"), onClick: (event) => {
|
|
159
|
+
event.preventDefault();
|
|
160
|
+
if (canGoNext && nextMemberOffset !== null) {
|
|
161
|
+
onMemberPageChange(nextMemberOffset);
|
|
162
|
+
}
|
|
163
|
+
} }) })] }) })] }));
|
|
121
164
|
}
|
|
122
165
|
function DangerZoneCard({ orgName }) {
|
|
123
166
|
const t = useT();
|
|
@@ -11,9 +11,14 @@ export interface UseOrgRoleResult {
|
|
|
11
11
|
error: Error | null;
|
|
12
12
|
}
|
|
13
13
|
export declare function useOrgRole(): UseOrgRoleResult;
|
|
14
|
-
export declare
|
|
14
|
+
export declare const ORG_MEMBER_PAGE_SIZE = 25;
|
|
15
|
+
export interface OrgMembersPage {
|
|
15
16
|
members: OrgMember[];
|
|
16
|
-
|
|
17
|
+
totalCount: number;
|
|
18
|
+
hasMore: boolean;
|
|
19
|
+
nextOffset: number | null;
|
|
20
|
+
}
|
|
21
|
+
export declare function useOrgMembers(offset?: number): import("@tanstack/react-query").UseQueryResult<NoInfer<OrgMembersPage>, Error>;
|
|
17
22
|
export declare function useOrgInvitations(): import("@tanstack/react-query").UseQueryResult<NoInfer<{
|
|
18
23
|
invitations: OrgPendingInvitation[];
|
|
19
24
|
}>, Error>;
|