@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
|
@@ -2278,10 +2278,23 @@ export function createAgentChatAdapter(options) {
|
|
|
2278
2278
|
return "completed";
|
|
2279
2279
|
}
|
|
2280
2280
|
let active = null;
|
|
2281
|
+
// "The poll failed" and "the server reports no active run" are
|
|
2282
|
+
// different facts. Only the second one is evidence the run is
|
|
2283
|
+
// gone; coercing the first into the second lets a flaky network
|
|
2284
|
+
// tick drive a durable abort of a run that is still working.
|
|
2285
|
+
let activeUnreadable = false;
|
|
2281
2286
|
try {
|
|
2282
2287
|
const activeRes = await fetch(`${apiUrl}/runs/active?threadId=${encodeURIComponent(threadId)}`, { signal: abortSignal });
|
|
2283
2288
|
if (activeRes.ok) {
|
|
2284
|
-
active = await activeRes.json().catch(() =>
|
|
2289
|
+
active = await activeRes.json().catch(() => {
|
|
2290
|
+
activeUnreadable = true;
|
|
2291
|
+
return null;
|
|
2292
|
+
});
|
|
2293
|
+
}
|
|
2294
|
+
else {
|
|
2295
|
+
// A 5xx/404 from this route is the route failing, not the run
|
|
2296
|
+
// ending.
|
|
2297
|
+
activeUnreadable = true;
|
|
2285
2298
|
}
|
|
2286
2299
|
}
|
|
2287
2300
|
catch (pollErr) {
|
|
@@ -2289,7 +2302,16 @@ export function createAgentChatAdapter(options) {
|
|
|
2289
2302
|
clearActiveRun();
|
|
2290
2303
|
return "completed";
|
|
2291
2304
|
}
|
|
2292
|
-
|
|
2305
|
+
activeUnreadable = true;
|
|
2306
|
+
}
|
|
2307
|
+
if (activeUnreadable) {
|
|
2308
|
+
// Unreadable: learn nothing, decide nothing, wait and re-ask.
|
|
2309
|
+
await delay(BACKGROUND_FOLLOW_POLL_INTERVAL_MS, abortSignal);
|
|
2310
|
+
if (abortSignal.aborted) {
|
|
2311
|
+
clearActiveRun();
|
|
2312
|
+
return "completed";
|
|
2313
|
+
}
|
|
2314
|
+
continue;
|
|
2293
2315
|
}
|
|
2294
2316
|
const activeRunId = active?.active === true && active.runId
|
|
2295
2317
|
? String(active.runId)
|
|
@@ -2405,10 +2427,67 @@ export function createAgentChatAdapter(options) {
|
|
|
2405
2427
|
});
|
|
2406
2428
|
return "completed";
|
|
2407
2429
|
}
|
|
2408
|
-
|
|
2430
|
+
// Progress read from the PRE-attach snapshot first...
|
|
2431
|
+
const snapshotProgressAt = typeof active?.lastProgressAt === "number" &&
|
|
2409
2432
|
Number.isFinite(active.lastProgressAt)
|
|
2410
2433
|
? active.lastProgressAt
|
|
2411
2434
|
: null;
|
|
2435
|
+
const snapshotSaysStalled = lastObservedServerProgressAt !== null &&
|
|
2436
|
+
(snapshotProgressAt === null ||
|
|
2437
|
+
snapshotProgressAt <= lastObservedServerProgressAt);
|
|
2438
|
+
// ...and re-read ONLY when that snapshot would condemn the run.
|
|
2439
|
+
//
|
|
2440
|
+
// `active` was fetched at the top of this iteration and the attach
|
|
2441
|
+
// above blocked for its whole duration, so judging progress from
|
|
2442
|
+
// it asks "did the server advance before we started listening?" —
|
|
2443
|
+
// never the question. A run that streamed text and a complete
|
|
2444
|
+
// tool-argument payload DURING the attach still looked frozen, and
|
|
2445
|
+
// the client durably aborted it. Measured fleet-wide: 23 of 24
|
|
2446
|
+
// client-watchdog kills landed on runs that had made
|
|
2447
|
+
// server-authoritative progress within the previous 90 seconds.
|
|
2448
|
+
//
|
|
2449
|
+
// Re-reading only on the condemning path keeps the extra request
|
|
2450
|
+
// off the healthy path entirely: a run already observed to be
|
|
2451
|
+
// advancing needs no second opinion.
|
|
2452
|
+
let activeProgressAt = snapshotProgressAt;
|
|
2453
|
+
// Set when the second opinion could not be obtained. The
|
|
2454
|
+
// snapshot is NOT a safe fallback here: it is precisely the
|
|
2455
|
+
// value that condemns the run, so falling back to it turns a
|
|
2456
|
+
// network blip into a kill.
|
|
2457
|
+
let secondOpinionUnreadable = false;
|
|
2458
|
+
if (snapshotSaysStalled) {
|
|
2459
|
+
try {
|
|
2460
|
+
const freshRes = await fetch(`${apiUrl}/runs/active?threadId=${encodeURIComponent(threadId)}`, { signal: abortSignal });
|
|
2461
|
+
if (!freshRes.ok) {
|
|
2462
|
+
// The route failing is not the run ending.
|
|
2463
|
+
secondOpinionUnreadable = true;
|
|
2464
|
+
}
|
|
2465
|
+
else {
|
|
2466
|
+
const fresh = await freshRes.json().catch(() => {
|
|
2467
|
+
secondOpinionUnreadable = true;
|
|
2468
|
+
return null;
|
|
2469
|
+
});
|
|
2470
|
+
const freshProgressAt = typeof fresh?.lastProgressAt === "number" &&
|
|
2471
|
+
Number.isFinite(fresh.lastProgressAt)
|
|
2472
|
+
? fresh.lastProgressAt
|
|
2473
|
+
: null;
|
|
2474
|
+
if (freshProgressAt !== null) {
|
|
2475
|
+
activeProgressAt =
|
|
2476
|
+
snapshotProgressAt === null
|
|
2477
|
+
? freshProgressAt
|
|
2478
|
+
: Math.max(snapshotProgressAt, freshProgressAt);
|
|
2479
|
+
}
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
catch (refetchErr) {
|
|
2483
|
+
if (refetchErr instanceof Error &&
|
|
2484
|
+
refetchErr.name === "AbortError") {
|
|
2485
|
+
clearActiveRun();
|
|
2486
|
+
return "completed";
|
|
2487
|
+
}
|
|
2488
|
+
secondOpinionUnreadable = true;
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2412
2491
|
const runChanged = activeRunId !== lastObservedActiveRunId;
|
|
2413
2492
|
const serverProgressAdvanced = activeProgressAt !== null &&
|
|
2414
2493
|
lastObservedServerProgressAt !== null &&
|
|
@@ -2436,7 +2515,9 @@ export function createAgentChatAdapter(options) {
|
|
|
2436
2515
|
// existing timeout below.
|
|
2437
2516
|
const awaitingRedispatch = active?.awaitingRedispatch === true;
|
|
2438
2517
|
const madeProgress = runChanged || serverProgressAdvanced;
|
|
2439
|
-
if (madeProgress ||
|
|
2518
|
+
if (madeProgress ||
|
|
2519
|
+
awaitingRedispatch ||
|
|
2520
|
+
secondOpinionUnreadable) {
|
|
2440
2521
|
// Only server-authoritative progress resets the idle window:
|
|
2441
2522
|
// a successor run or a newer lastProgressAt timestamp. Raw
|
|
2442
2523
|
// sequence advancement is not enough — keepalives and retry
|
|
@@ -182,7 +182,7 @@ function CopyField({ label, value, docsHref, docsLabel }) {
|
|
|
182
182
|
setCopied(false);
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
|
-
return (_jsxs("div", { className: "flex min-w-0 items-center gap-2 rounded-md border border-border bg-muted/20 p-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/70", children: [label, docsHref && (_jsx("a", { href: docsHref, target: "_blank", rel: "noopener noreferrer", "aria-label": docsLabel ?? `Open ${label} documentation`, title: docsLabel ?? `Open ${label} documentation`, className: "inline-flex size-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground", children: _jsx(IconHelpCircle, { className: "size-
|
|
185
|
+
return (_jsxs("div", { className: "flex min-w-0 items-center gap-2 rounded-md border border-border bg-muted/20 p-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/70", children: [label, docsHref && (_jsx("a", { href: docsHref, target: "_blank", rel: "noopener noreferrer", "aria-label": docsLabel ?? `Open ${label} documentation`, title: docsLabel ?? `Open ${label} documentation`, className: "inline-flex size-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground", children: _jsx(IconHelpCircle, { className: "size-2.5" }) }))] }), _jsx("code", { className: "mt-1 block truncate text-xs text-foreground", children: value })] }), _jsx("button", { type: "button", onClick: () => void copy(), className: "shrink-0 cursor-pointer rounded-md border border-border bg-background px-2.5 py-1.5 text-[11px] font-medium text-foreground hover:bg-accent", children: copied ? "Copied" : "Copy" })] }));
|
|
186
186
|
}
|
|
187
187
|
function AccessTab({ appName: appNameProp, }) {
|
|
188
188
|
const [urls, setUrls] = useState(null);
|
|
@@ -2,6 +2,9 @@ export { hasChatThreadDeepLink } from "./chat-thread-url.js";
|
|
|
2
2
|
export declare const SIDEBAR_OPEN_KEY = "agent-native-sidebar-open";
|
|
3
3
|
export declare const SIDEBAR_STATE_CHANGE_EVENT = "agent-panel:state-change";
|
|
4
4
|
export declare const SIDEBAR_URL_CHANGE_EVENT = "agent-panel:url-change";
|
|
5
|
+
export declare const AGENT_SIDEBAR_MIN_WIDTH = 280;
|
|
6
|
+
export declare const AGENT_SIDEBAR_DEFAULT_MAX_WIDTH = 700;
|
|
7
|
+
export declare const AGENT_SIDEBAR_WIDE_WIDTH_RATIO = 0.75;
|
|
5
8
|
export type AgentSidebarStateSource = "app" | "frame";
|
|
6
9
|
export type AgentSidebarStateMode = "app" | "code";
|
|
7
10
|
export interface AgentSidebarStateChangeDetail {
|
|
@@ -12,6 +15,9 @@ export interface AgentSidebarStateChangeDetail {
|
|
|
12
15
|
/** Frame protocol mode: "code" is parent-owned, "app" is app-owned. */
|
|
13
16
|
mode: AgentSidebarStateMode;
|
|
14
17
|
}
|
|
18
|
+
export declare function getAgentSidebarWideWidth(viewportWidth?: number): number;
|
|
19
|
+
export declare function getAgentSidebarMaxWidth(viewportWidth?: number): number;
|
|
20
|
+
export declare function clampAgentSidebarWidth(width: number, viewportWidth?: number): number;
|
|
15
21
|
export declare function getAgentSidebarOpenPreferenceKey(storageKey?: string | null): string;
|
|
16
22
|
export declare function dispatchAgentSidebarStateChange(detail: AgentSidebarStateChangeDetail): void;
|
|
17
23
|
export declare function setAgentSidebarOpenPreference(open: boolean, storageKey?: string | null): void;
|
|
@@ -4,7 +4,32 @@ export { hasChatThreadDeepLink } from "./chat-thread-url.js";
|
|
|
4
4
|
export const SIDEBAR_OPEN_KEY = "agent-native-sidebar-open";
|
|
5
5
|
export const SIDEBAR_STATE_CHANGE_EVENT = "agent-panel:state-change";
|
|
6
6
|
export const SIDEBAR_URL_CHANGE_EVENT = "agent-panel:url-change";
|
|
7
|
+
export const AGENT_SIDEBAR_MIN_WIDTH = 280;
|
|
8
|
+
export const AGENT_SIDEBAR_DEFAULT_MAX_WIDTH = 700;
|
|
9
|
+
export const AGENT_SIDEBAR_WIDE_WIDTH_RATIO = 0.75;
|
|
7
10
|
const HISTORY_PATCHED_KEY = "__agentNativeSidebarHistoryPatched";
|
|
11
|
+
function resolveViewportWidth(viewportWidth) {
|
|
12
|
+
const resolved = viewportWidth ??
|
|
13
|
+
(typeof window === "undefined"
|
|
14
|
+
? AGENT_SIDEBAR_DEFAULT_MAX_WIDTH
|
|
15
|
+
: window.innerWidth);
|
|
16
|
+
if (!Number.isFinite(resolved)) {
|
|
17
|
+
throw new TypeError("Agent sidebar viewport width must be finite");
|
|
18
|
+
}
|
|
19
|
+
return Math.max(0, resolved);
|
|
20
|
+
}
|
|
21
|
+
export function getAgentSidebarWideWidth(viewportWidth) {
|
|
22
|
+
return Math.max(AGENT_SIDEBAR_MIN_WIDTH, Math.round(resolveViewportWidth(viewportWidth) * AGENT_SIDEBAR_WIDE_WIDTH_RATIO));
|
|
23
|
+
}
|
|
24
|
+
export function getAgentSidebarMaxWidth(viewportWidth) {
|
|
25
|
+
return Math.max(AGENT_SIDEBAR_DEFAULT_MAX_WIDTH, getAgentSidebarWideWidth(viewportWidth));
|
|
26
|
+
}
|
|
27
|
+
export function clampAgentSidebarWidth(width, viewportWidth) {
|
|
28
|
+
if (!Number.isFinite(width)) {
|
|
29
|
+
throw new TypeError("Agent sidebar width must be finite");
|
|
30
|
+
}
|
|
31
|
+
return Math.min(getAgentSidebarMaxWidth(viewportWidth), Math.max(AGENT_SIDEBAR_MIN_WIDTH, width));
|
|
32
|
+
}
|
|
8
33
|
export function getAgentSidebarOpenPreferenceKey(storageKey) {
|
|
9
34
|
const suffix = storageKey?.trim();
|
|
10
35
|
return suffix ? `agent-native.${suffix}.sidebar-open` : SIDEBAR_OPEN_KEY;
|
|
@@ -59,6 +59,7 @@ import { AgentNativeI18nProvider, } from "./i18n.js";
|
|
|
59
59
|
import { RequireSession } from "./require-session.js";
|
|
60
60
|
import { AgentNativeRouteWarmup } from "./route-warmup.js";
|
|
61
61
|
import { RouteTransitionIndicator } from "./RouteTransitionIndicator.js";
|
|
62
|
+
import { RuntimeConfigNotice } from "./RuntimeConfigNotice.js";
|
|
62
63
|
const DEFAULT_TOASTER = _jsx(Toaster, { richColors: true, position: "bottom-left" });
|
|
63
64
|
function RoutedAppEnhancements() {
|
|
64
65
|
const isInRouter = useInRouterContext();
|
|
@@ -68,7 +69,7 @@ function RoutedAppEnhancements() {
|
|
|
68
69
|
}
|
|
69
70
|
function ProvidersInner({ queryClient, defaultTheme = "system", themeAttribute = "class", tooltipDelayDuration, toaster = DEFAULT_TOASTER, disableThemeTransitions = true, i18n, children, }) {
|
|
70
71
|
const localizedChildren = i18n === false ? (children) : (_jsx(AgentNativeI18nProvider, { ...(i18n ?? {}), children: children }));
|
|
71
|
-
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(ThemeProvider, { attribute: themeAttribute, defaultTheme: defaultTheme, enableSystem: true, disableTransitionOnChange: disableThemeTransitions, children: _jsxs(TooltipProvider, { delayDuration: tooltipDelayDuration, children: [localizedChildren, _jsx(RoutedAppEnhancements, {}), toaster] }) }) }));
|
|
72
|
+
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(ThemeProvider, { attribute: themeAttribute, defaultTheme: defaultTheme, enableSystem: true, disableTransitionOnChange: disableThemeTransitions, children: _jsxs(TooltipProvider, { delayDuration: tooltipDelayDuration, children: [localizedChildren, _jsx(RuntimeConfigNotice, {}), _jsx(RoutedAppEnhancements, {}), toaster] }) }) }));
|
|
72
73
|
}
|
|
73
74
|
export function AppProviders({ queryClient, isPublicPath = false, clientOnlyFallback, sessionBypass = false, defaultTheme, themeAttribute, tooltipDelayDuration, toaster, disableThemeTransitions, i18n, children, }) {
|
|
74
75
|
const fallback = clientOnlyFallback ?? _jsx(DefaultSpinner, {});
|
|
@@ -115,7 +115,7 @@ export class AssistantUiStaleIndexErrorBoundary extends React.Component {
|
|
|
115
115
|
this.state.recovery.retryCount > MAX_ASSISTANT_UI_RECOVERABLE_RETRIES) {
|
|
116
116
|
throw this.state.error;
|
|
117
117
|
}
|
|
118
|
-
return this.props.fallback
|
|
118
|
+
return this.props.fallback === undefined ? (_jsx(AssistantUiRecoverableRenderFallback, {})) : (this.props.fallback);
|
|
119
119
|
}
|
|
120
120
|
const fragmentKey = this.props.remountOnResetKey === false
|
|
121
121
|
? String(this.state.retryToken)
|
|
@@ -11,7 +11,7 @@ export * from "./runtime.js";
|
|
|
11
11
|
export { sendToAgentChat, sendToAgentChatAndConfirm, reportAgentChatSubmitResult, AGENT_CHAT_SUBMIT_RESULT_EVENT, type AgentChatMessage, type AgentChatSubmitResult, type SendToAgentChatAndConfirmResult, } from "../agent-chat.js";
|
|
12
12
|
export { useAgentChatGenerating } from "../use-agent-chat.js";
|
|
13
13
|
export { useSendToAgentChat } from "../use-send-to-agent-chat.js";
|
|
14
|
-
export { requestAgentSidebarOpen, SIDEBAR_STATE_CHANGE_EVENT, setAgentSidebarOpenPreference, type AgentSidebarStateChangeDetail, type AgentSidebarStateMode, type AgentSidebarStateSource, } from "../agent-sidebar-state.js";
|
|
14
|
+
export { AGENT_SIDEBAR_DEFAULT_MAX_WIDTH, AGENT_SIDEBAR_MIN_WIDTH, AGENT_SIDEBAR_WIDE_WIDTH_RATIO, clampAgentSidebarWidth, getAgentSidebarMaxWidth, getAgentSidebarWideWidth, requestAgentSidebarOpen, SIDEBAR_STATE_CHANGE_EVENT, setAgentSidebarOpenPreference, type AgentSidebarStateChangeDetail, type AgentSidebarStateMode, type AgentSidebarStateSource, } from "../agent-sidebar-state.js";
|
|
15
15
|
export { clearReservedToolRenderersForTests, clearToolRenderersForTests, registerActionChatRenderer, registerFallbackToolRenderer, registerReservedActionChatRenderer, registerReservedFallbackToolRenderer, registerReservedToolRenderer, registerToolRenderer, resolveToolRenderer, type ActionChatRendererRegistration, type ToolRendererComponent, type ToolRendererContext, type ToolRendererMatch, type ToolRendererProps, type ToolRendererRegistration, } from "./tool-render-registry.js";
|
|
16
16
|
export { ACTION_CHAT_UI_DATA_CHART_RENDERER, ACTION_CHAT_UI_DATA_INSIGHTS_RENDERER, ACTION_CHAT_UI_DATA_TABLE_RENDERER, ACTION_CHAT_UI_DATA_WIDGET_RENDERER, ACTION_CHAT_UI_INLINE_EXTENSION_RENDERER, ACTION_CHAT_UI_WORKSPACE_FILE_RENDERER, type ActionChatUIConfig, } from "../../action-ui.js";
|
|
17
17
|
export { DATA_CHART_WIDGET, DATA_INSIGHTS_WIDGET, DATA_TABLE_WIDGET, createDataChartWidgetResult, createDataInsightsWidgetResult, createDataTableWidgetResult, dataChartWidgetResultSchema, dataChartWidgetSchema, dataInsightsWidgetResultSchema, dataTableWidgetResultSchema, dataTableWidgetSchema, dataWidgetResultSchema, isDataChartWidget, isDataTableWidget, isDataWidgetResult, normalizeDataWidgetKind, normalizeDataWidgetResult, type DataChartSeriesDefinition, type DataChartWidget, type DataChartWidgetResult, type DataChartWidgetResultInput, type DataInsightsWidgetResult, type DataInsightsWidgetResultInput, type DataTableColumn, type DataTableWidget, type DataTableWidgetResult, type DataTableWidgetResultInput, type DataWidgetDisplay, type DataWidgetKind, type DataWidgetResult, type DataWidgetResultMetadata, } from "./widgets/data-widget-types.js";
|
|
@@ -11,7 +11,7 @@ export * from "./runtime.js";
|
|
|
11
11
|
export { sendToAgentChat, sendToAgentChatAndConfirm, reportAgentChatSubmitResult, AGENT_CHAT_SUBMIT_RESULT_EVENT, } from "../agent-chat.js";
|
|
12
12
|
export { useAgentChatGenerating } from "../use-agent-chat.js";
|
|
13
13
|
export { useSendToAgentChat } from "../use-send-to-agent-chat.js";
|
|
14
|
-
export { requestAgentSidebarOpen, SIDEBAR_STATE_CHANGE_EVENT, setAgentSidebarOpenPreference, } from "../agent-sidebar-state.js";
|
|
14
|
+
export { AGENT_SIDEBAR_DEFAULT_MAX_WIDTH, AGENT_SIDEBAR_MIN_WIDTH, AGENT_SIDEBAR_WIDE_WIDTH_RATIO, clampAgentSidebarWidth, getAgentSidebarMaxWidth, getAgentSidebarWideWidth, requestAgentSidebarOpen, SIDEBAR_STATE_CHANGE_EVENT, setAgentSidebarOpenPreference, } from "../agent-sidebar-state.js";
|
|
15
15
|
export { clearReservedToolRenderersForTests, clearToolRenderersForTests, registerActionChatRenderer, registerFallbackToolRenderer, registerReservedActionChatRenderer, registerReservedFallbackToolRenderer, registerReservedToolRenderer, registerToolRenderer, resolveToolRenderer, } from "./tool-render-registry.js";
|
|
16
16
|
export { ACTION_CHAT_UI_DATA_CHART_RENDERER, ACTION_CHAT_UI_DATA_INSIGHTS_RENDERER, ACTION_CHAT_UI_DATA_TABLE_RENDERER, ACTION_CHAT_UI_DATA_WIDGET_RENDERER, ACTION_CHAT_UI_INLINE_EXTENSION_RENDERER, ACTION_CHAT_UI_WORKSPACE_FILE_RENDERER, } from "../../action-ui.js";
|
|
17
17
|
export { DATA_CHART_WIDGET, DATA_INSIGHTS_WIDGET, DATA_TABLE_WIDGET, createDataChartWidgetResult, createDataInsightsWidgetResult, createDataTableWidgetResult, dataChartWidgetResultSchema, dataChartWidgetSchema, dataInsightsWidgetResultSchema, dataTableWidgetResultSchema, dataTableWidgetSchema, dataWidgetResultSchema, isDataChartWidget, isDataTableWidget, isDataWidgetResult, normalizeDataWidgetKind, normalizeDataWidgetResult, } from "./widgets/data-widget-types.js";
|
|
@@ -39,11 +39,12 @@ export declare function useMarkdownReady(): boolean;
|
|
|
39
39
|
export declare const MemoizedMarkdownBlock: React.MemoExoticComponent<({ blockText, }: {
|
|
40
40
|
blockText: string;
|
|
41
41
|
}) => React.JSX.Element | null>;
|
|
42
|
-
export declare function SmoothMarkdownText({ text, streaming, resetKey, statusType, }: {
|
|
42
|
+
export declare function SmoothMarkdownText({ text, streaming, resetKey, statusType, onRevealComplete, }: {
|
|
43
43
|
text: string;
|
|
44
44
|
streaming: boolean;
|
|
45
45
|
resetKey: string;
|
|
46
46
|
statusType?: string;
|
|
47
|
+
onRevealComplete?: () => void;
|
|
47
48
|
}): React.JSX.Element;
|
|
48
49
|
export declare function MarkdownText(): React.JSX.Element;
|
|
49
50
|
export {};
|
|
@@ -236,11 +236,38 @@ function sliceGraphemes(targetText, graphemes, count) {
|
|
|
236
236
|
return "";
|
|
237
237
|
return graphemes.slice(0, count).join("");
|
|
238
238
|
}
|
|
239
|
+
// Grouped message parts are rebuilt as tool calls arrive. A text part can
|
|
240
|
+
// therefore be unmounted and mounted again even though its identity did not
|
|
241
|
+
// change. Keep the reveal cursor outside that subtree so a structural update
|
|
242
|
+
// continues from the current cursor instead of replaying the opening sentence.
|
|
243
|
+
const smoothStreamingTextCache = new Map();
|
|
244
|
+
function cachedStreamingText(resetKey, targetText) {
|
|
245
|
+
const cached = smoothStreamingTextCache.get(resetKey);
|
|
246
|
+
if (!cached)
|
|
247
|
+
return undefined;
|
|
248
|
+
if (!targetText.startsWith(cached.targetText) ||
|
|
249
|
+
!targetText.startsWith(cached.visibleText)) {
|
|
250
|
+
return undefined;
|
|
251
|
+
}
|
|
252
|
+
return cached.visibleText;
|
|
253
|
+
}
|
|
254
|
+
function rememberStreamingText(resetKey, targetText, visibleText) {
|
|
255
|
+
smoothStreamingTextCache.delete(resetKey);
|
|
256
|
+
smoothStreamingTextCache.set(resetKey, { targetText, visibleText });
|
|
257
|
+
if (smoothStreamingTextCache.size <= 128)
|
|
258
|
+
return;
|
|
259
|
+
const oldestKey = smoothStreamingTextCache.keys().next().value;
|
|
260
|
+
if (oldestKey !== undefined)
|
|
261
|
+
smoothStreamingTextCache.delete(oldestKey);
|
|
262
|
+
}
|
|
239
263
|
export function useSmoothStreamingText(targetText, streaming, resetKey) {
|
|
240
264
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
241
265
|
const [visibleText, setVisibleText] = useState(() => {
|
|
242
266
|
if (!streaming || prefersReducedMotion)
|
|
243
267
|
return targetText;
|
|
268
|
+
const cachedText = cachedStreamingText(resetKey, targetText);
|
|
269
|
+
if (cachedText !== undefined)
|
|
270
|
+
return cachedText;
|
|
244
271
|
const graphemes = splitStreamingTextGraphemes(targetText);
|
|
245
272
|
return sliceGraphemes(targetText, graphemes, initialSmoothStreamingGraphemeCount(graphemes));
|
|
246
273
|
});
|
|
@@ -252,7 +279,13 @@ export function useSmoothStreamingText(targetText, streaming, resetKey) {
|
|
|
252
279
|
const lastCommitAtRef = useRef(0);
|
|
253
280
|
const pauseUntilRef = useRef(0);
|
|
254
281
|
const resetKeyRef = useRef(resetKey);
|
|
282
|
+
const cacheKeyRef = useRef(resetKey);
|
|
283
|
+
const cacheStreamingRef = useRef(streaming);
|
|
284
|
+
const cacheReducedMotionRef = useRef(prefersReducedMotion);
|
|
255
285
|
const stepRef = useRef(() => { });
|
|
286
|
+
cacheKeyRef.current = resetKey;
|
|
287
|
+
cacheStreamingRef.current = streaming;
|
|
288
|
+
cacheReducedMotionRef.current = prefersReducedMotion;
|
|
256
289
|
const commitVisibleCount = useCallback((nextCount) => {
|
|
257
290
|
const graphemes = targetGraphemesRef.current;
|
|
258
291
|
const boundedCount = Math.max(0, Math.min(nextCount, graphemes.length));
|
|
@@ -262,6 +295,9 @@ export function useSmoothStreamingText(targetText, streaming, resetKey) {
|
|
|
262
295
|
visibleTextRef.current = nextText;
|
|
263
296
|
setVisibleText(nextText);
|
|
264
297
|
}
|
|
298
|
+
if (cacheStreamingRef.current && !cacheReducedMotionRef.current) {
|
|
299
|
+
rememberStreamingText(cacheKeyRef.current, targetTextRef.current, nextText);
|
|
300
|
+
}
|
|
265
301
|
}, []);
|
|
266
302
|
const cancelFrame = useCallback(() => {
|
|
267
303
|
if (frameRef.current != null &&
|
|
@@ -353,6 +389,11 @@ export function useSmoothStreamingText(targetText, streaming, resetKey) {
|
|
|
353
389
|
commitVisibleCount,
|
|
354
390
|
scheduleFrame,
|
|
355
391
|
]);
|
|
392
|
+
useEffect(() => {
|
|
393
|
+
if (!streaming || prefersReducedMotion)
|
|
394
|
+
return;
|
|
395
|
+
rememberStreamingText(resetKey, targetText, visibleText);
|
|
396
|
+
}, [prefersReducedMotion, resetKey, streaming, targetText, visibleText]);
|
|
356
397
|
// When the tab returns from background, rAF has been paused and the backlog
|
|
357
398
|
// may be tens of thousands of characters. Animating from where we left off
|
|
358
399
|
// would replay minutes of content at the normal rate — instead jump the
|
|
@@ -405,12 +446,17 @@ export const MemoizedMarkdownBlock = React.memo(function MemoizedMarkdownBlock({
|
|
|
405
446
|
return (_jsx(ReactMarkdown, { remarkPlugins: [gfm], components: markdownComponents, urlTransform: markdownUrlTransform, children: wrapLegacyChartShorthandLines(blockText) }));
|
|
406
447
|
});
|
|
407
448
|
// ─── SmoothMarkdownText ────────────────────────────────────────────────────────
|
|
408
|
-
export function SmoothMarkdownText({ text, streaming, resetKey, statusType = "complete", }) {
|
|
449
|
+
export function SmoothMarkdownText({ text, streaming, resetKey, statusType = "complete", onRevealComplete, }) {
|
|
409
450
|
const mdReady = useMarkdownReady();
|
|
410
451
|
const visibleText = useSmoothStreamingText(text, streaming, resetKey);
|
|
411
452
|
const isVisuallyStreaming = streaming && visibleText !== text;
|
|
412
453
|
const ReactMarkdown = markdownModule?.default;
|
|
413
454
|
const gfm = remarkGfmFn;
|
|
455
|
+
useEffect(() => {
|
|
456
|
+
if (!onRevealComplete || !streaming || visibleText !== text)
|
|
457
|
+
return;
|
|
458
|
+
onRevealComplete();
|
|
459
|
+
}, [onRevealComplete, streaming, text, visibleText]);
|
|
414
460
|
// Block-memoized rendering: during streaming split the visible text into
|
|
415
461
|
// stable completed blocks + an in-progress tail. Only the tail re-renders
|
|
416
462
|
// on every commit; completed blocks are React.memo'd and skipped.
|
|
@@ -429,5 +475,5 @@ export function MarkdownText() {
|
|
|
429
475
|
const lastMessage = thread.messages[thread.messages.length - 1];
|
|
430
476
|
const isLastAssistantMessage = message.role === "assistant" && lastMessage?.id === message.id;
|
|
431
477
|
const statusType = textPart.status?.type ?? message.status?.type ?? "complete";
|
|
432
|
-
return (_jsx(SmoothMarkdownText, { text: textPart.text, streaming: textStreaming && isLastAssistantMessage, resetKey:
|
|
478
|
+
return (_jsx(SmoothMarkdownText, { text: textPart.text, streaming: textStreaming && isLastAssistantMessage, resetKey: message.id, statusType: statusType }));
|
|
433
479
|
}
|
|
@@ -56,6 +56,8 @@ export declare function MessageActionsMenu({ showRevert, onRevert, }?: {
|
|
|
56
56
|
}): React.JSX.Element;
|
|
57
57
|
export declare function UserMessage(): React.JSX.Element | null;
|
|
58
58
|
export declare function messageTextFromContent(content: unknown): string;
|
|
59
|
+
export declare function isMissingFinalResponseWarningText(text: string): boolean;
|
|
60
|
+
export declare function completedAssistantToolNamesAfterLastText(content: readonly ContentPart[]): string[];
|
|
59
61
|
export declare function latestUserMessageText(messages: readonly unknown[]): string;
|
|
60
62
|
export declare function userMessageTextBeforeAssistant(messages: readonly unknown[], assistantMessageId: string): string;
|
|
61
63
|
export declare function assistantMessageHasUnresolvedTool(content: unknown): boolean;
|
|
@@ -95,6 +97,10 @@ export declare function shouldShowAssistantWorkSummary({ isLast, isComplete, has
|
|
|
95
97
|
hasUnresolvedTool: boolean;
|
|
96
98
|
chatRunning: boolean;
|
|
97
99
|
}): boolean;
|
|
100
|
+
export declare function isAlwaysVisibleAssistantTool(part: {
|
|
101
|
+
type?: unknown;
|
|
102
|
+
toolName?: unknown;
|
|
103
|
+
}): boolean;
|
|
98
104
|
export declare function isCollapsibleAssistantWorkPart(part: {
|
|
99
105
|
type?: string;
|
|
100
106
|
toolName?: string;
|