@agent-native/core 0.145.4 → 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/editor/editor-layout.tsx +8 -3
- package/corpus/templates/clips/app/components/editor/waveform.tsx +2 -1
- package/corpus/templates/clips/app/components/library/search-bar.tsx +1 -1
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +3 -10
- package/corpus/templates/clips/app/global.css +9 -0
- 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/desktop/src-tauri/src/silence_detector.rs +10 -11
- 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/design/actions/view-screen.ts +1 -0
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +14 -1
- package/corpus/templates/design/changelog/2026-08-07-cmd-c-now-copies-selected-text-in-the-agent-panel-instead-of.md +6 -0
- package/corpus/templates/design/changelog/2026-08-07-real-time-voice-can-now-read-the-current-selection-and-edit-.md +6 -0
- package/corpus/templates/design/server/lib/reprompt-action-guard.ts +7 -3
- 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/struct-routes.d.ts +1 -1
- package/dist/config.d.ts +26 -3
- package/dist/config.js +106 -14
- package/dist/db/ddl-guard.d.ts +15 -2
- package/dist/db/ddl-guard.js +53 -5
- package/dist/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/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 +9 -9
- package/dist/provider-api/actions/provider-api.d.ts +7 -7
- package/dist/provider-api/corpus-jobs.d.ts +12 -2
- package/dist/provider-api/corpus-jobs.js +31 -1
- package/dist/provider-api/index.d.ts +2 -0
- package/dist/provider-api/index.js +7 -1
- package/dist/secrets/routes.d.ts +6 -6
- 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/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/realtime-voice.d.ts +2 -1
- package/dist/server/realtime-voice.js +38 -56
- package/dist/server/short-lived-token.d.ts +43 -0
- package/dist/server/short-lived-token.js +74 -0
- 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 +2 -2
- 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
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Fresh Project source guide
|
|
2
|
+
|
|
3
|
+
Use this guide when `/turn-into-app` is invoked in a new Claude or ChatGPT
|
|
4
|
+
Project rather than after a completed thread.
|
|
5
|
+
|
|
6
|
+
## What the host can provide
|
|
7
|
+
|
|
8
|
+
The source is whatever the host put in the model's current context:
|
|
9
|
+
|
|
10
|
+
- Project instructions: the job, audience, constraints, quality bar, and
|
|
11
|
+
approved tools or integrations.
|
|
12
|
+
- Knowledge files and attachments: reference material, templates, examples,
|
|
13
|
+
and links that the app should use.
|
|
14
|
+
- Past runs: only conversations or outputs the host actually supplied. They
|
|
15
|
+
are examples and evaluation material, not an automatic import of every
|
|
16
|
+
private Project conversation.
|
|
17
|
+
- The current request: the app boundary, target workspace, name, and explicit
|
|
18
|
+
corrections.
|
|
19
|
+
|
|
20
|
+
Do not infer hidden system prompts, account settings, private history, API keys,
|
|
21
|
+
or credentials. The Dispatch MCP connector can start a workspace app creation,
|
|
22
|
+
but it cannot unlock or scrape private Project content.
|
|
23
|
+
|
|
24
|
+
## Source brief
|
|
25
|
+
|
|
26
|
+
Write a compact brief before starting the app:
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
Source: host-provided Claude/ChatGPT Project context
|
|
30
|
+
Provenance: project instructions, selected knowledge files, and visible runs
|
|
31
|
+
Project goal:
|
|
32
|
+
Configuration and constraints:
|
|
33
|
+
Knowledge sources:
|
|
34
|
+
Repeatable workflow:
|
|
35
|
+
Inputs and outputs:
|
|
36
|
+
Judgment and review points:
|
|
37
|
+
Representative runs: none, or 1-3 selected examples
|
|
38
|
+
Integrations and permissions:
|
|
39
|
+
Unknowns and follow-up:
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Keep source references bounded. Prefer a file name, URL, resource ID, or short
|
|
43
|
+
summary over a large pasted document. Do not put secrets or raw customer data
|
|
44
|
+
in the brief.
|
|
45
|
+
|
|
46
|
+
## Fresh-box setup
|
|
47
|
+
|
|
48
|
+
Install the exported `turn-into-app` skill in the host when the host supports
|
|
49
|
+
skills. For a ChatGPT Project or any host that exposes only the MCP connector,
|
|
50
|
+
also place the skill instructions or this reference in the Project
|
|
51
|
+
instructions/knowledge files. Then add and authenticate the Dispatch MCP
|
|
52
|
+
connector from the packaged `adapters/chatgpt-mcp/connector.json`.
|
|
53
|
+
|
|
54
|
+
In a new Project chat, say:
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
Turn this project into an app. Use the visible Project instructions,
|
|
58
|
+
knowledge files, and any selected successful runs as the source. Create the
|
|
59
|
+
app in the connected Agent-Native workspace, keep the source brief bounded,
|
|
60
|
+
and report the real path and verification result.
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If the host does not show the Project instructions or files to the model, stop
|
|
64
|
+
and request an export or attachment. Do not claim that the Project was read.
|
|
@@ -2,4 +2,7 @@
|
|
|
2
2
|
PING_MESSAGE=pong
|
|
3
3
|
|
|
4
4
|
# Skip login/signup (local dev / preview only)
|
|
5
|
+
# Auth is enabled when AUTH_DISABLED is unset. Standalone production deploys
|
|
6
|
+
# need a stable BETTER_AUTH_SECRET; BETTER_AUTH_URL is inferred automatically.
|
|
7
|
+
# BETTER_AUTH_SECRET=
|
|
5
8
|
# AUTH_DISABLED=true
|
|
@@ -646,6 +646,13 @@ const TOOL_INPUT_ACTIVITY_INTERVAL_MS = 1500;
|
|
|
646
646
|
const ACTION_PREPARATION_NO_PROGRESS_TIMEOUT_MS = 90_000;
|
|
647
647
|
const ACTION_PREPARATION_ZERO_BYTE_RESTART_LIMIT = 2;
|
|
648
648
|
const MODEL_STREAM_NO_PROGRESS_TIMEOUT_MS = 90_000;
|
|
649
|
+
/**
|
|
650
|
+
* How long an attempt must have run before its retry is worth narrating.
|
|
651
|
+
*
|
|
652
|
+
* Below this, the retry is invisible: the clear-and-retry completes faster
|
|
653
|
+
* than a person can register the blank. Above it, silence reads as a freeze.
|
|
654
|
+
*/
|
|
655
|
+
const VISIBLE_RETRY_THRESHOLD_MS = 10_000;
|
|
649
656
|
/**
|
|
650
657
|
* FIX 2 (durable-background incident): tighter no-progress deadline for ONLY
|
|
651
658
|
* the FIRST engine-stream event of a model call, and ONLY on the clamped
|
|
@@ -3125,6 +3132,7 @@ export async function runAgentLoop(opts) {
|
|
|
3125
3132
|
}
|
|
3126
3133
|
}
|
|
3127
3134
|
for (let retry = 0;; retry++) {
|
|
3135
|
+
const attemptStartedAt = Date.now();
|
|
3128
3136
|
assistantContent = undefined;
|
|
3129
3137
|
streamedAssistantText = "";
|
|
3130
3138
|
streamedAssistantToolCalls.length = 0;
|
|
@@ -3543,9 +3551,22 @@ export async function runAgentLoop(opts) {
|
|
|
3543
3551
|
isRetryableError(err) &&
|
|
3544
3552
|
hasBudgetForEngineRetry(budgetStartedAt, retry)) {
|
|
3545
3553
|
// Clear partial text from the failed attempt so the retry
|
|
3546
|
-
// doesn't produce garbled duplicate output.
|
|
3547
|
-
// silent
|
|
3548
|
-
//
|
|
3554
|
+
// doesn't produce garbled duplicate output. A fast provider blip
|
|
3555
|
+
// stays silent — it must not leak into the assistant's answer.
|
|
3556
|
+
//
|
|
3557
|
+
// A retry the user WAITED THROUGH is a different event. A 90s model
|
|
3558
|
+
// stall retried three times wiped the visible output at 92s, 182s,
|
|
3559
|
+
// and 272s with no explanation; the screen simply went blank and
|
|
3560
|
+
// stayed blank for four and a half minutes, which is what people
|
|
3561
|
+
// report as "the chat froze". Say what is happening, but only once
|
|
3562
|
+
// the silence is long enough that someone noticed it.
|
|
3563
|
+
const stalledMs = Date.now() - attemptStartedAt;
|
|
3564
|
+
if (stalledMs >= VISIBLE_RETRY_THRESHOLD_MS) {
|
|
3565
|
+
send({
|
|
3566
|
+
type: "activity",
|
|
3567
|
+
label: `Model did not respond — retrying (${retry + 2}/${maxRetriesForError(err) + 1})`,
|
|
3568
|
+
});
|
|
3569
|
+
}
|
|
3549
3570
|
send({ type: "clear" });
|
|
3550
3571
|
await retryDelay(retry, signal);
|
|
3551
3572
|
continue;
|
|
@@ -70,6 +70,12 @@ export interface AgentPanelProps extends Omit<AssistantChatProps, "onSwitchToCli
|
|
|
70
70
|
isFullscreen?: boolean;
|
|
71
71
|
/** Called when the user clicks the maximize/minimize button. If provided, the button appears next to the collapse button. */
|
|
72
72
|
onToggleFullscreen?: () => void;
|
|
73
|
+
/** Called when the user asks the sidebar to use the wide chat width preset. */
|
|
74
|
+
onSnapTo75Percent?: () => void;
|
|
75
|
+
/** Whether the sidebar is currently using the wide fixed drawer presentation. */
|
|
76
|
+
isWideDrawer?: boolean;
|
|
77
|
+
/** Called when the user returns the wide drawer to the normal layout. */
|
|
78
|
+
onExitWideDrawer?: () => void;
|
|
73
79
|
/** URL of the app being developed (shown as "Open app in new tab" in settings). Set by frame. */
|
|
74
80
|
devAppUrl?: string;
|
|
75
81
|
/** Namespace for localStorage keys — used to isolate chat state per app in the frame. */
|
|
@@ -22,7 +22,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
22
22
|
* <AgentChatSurface mode="page" className="h-screen" />
|
|
23
23
|
*/
|
|
24
24
|
import { Tooltip as DesignSystemTooltip } from "@agent-native/toolkit/design-system";
|
|
25
|
-
import { IconMessageCircle, IconMessageDots, IconTerminal2, IconSettings, IconLayoutSidebarRightCollapse, IconLayoutGrid, IconCheck, IconPlus, IconX, IconDotsVertical, IconHistory, IconArrowsMaximize, IconArrowsMinimize, IconExternalLink, } from "@tabler/icons-react";
|
|
25
|
+
import { IconMessageCircle, IconMessageDots, IconTerminal2, IconSettings, IconLayoutSidebarRightCollapse, IconLayoutGrid, IconCheck, IconPlus, IconX, IconDotsVertical, IconHistory, IconArrowsHorizontal, IconArrowsMaximize, IconArrowsMinimize, IconExternalLink, } from "@tabler/icons-react";
|
|
26
26
|
import React, { useState, useEffect, useRef, useCallback, useMemo, lazy, Suspense, startTransition, } from "react";
|
|
27
27
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, } from "./components/ui/dropdown-menu.js";
|
|
28
28
|
import { normalizeTooltipText } from "./components/ui/tooltip.js";
|
|
@@ -40,13 +40,13 @@ const MultiTabAssistantChatLazy = lazy(() => import("./MultiTabAssistantChat.js"
|
|
|
40
40
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
41
41
|
import { Link, useLocation, useNavigate } from "react-router";
|
|
42
42
|
import { withBuilderUtmTrackingParams } from "../shared/builder-link-tracking.js";
|
|
43
|
-
import { consumeAgentSidebarUrlOpenOverride, dispatchAgentSidebarStateChange, getInitialAgentSidebarOpen, setAgentSidebarOpenPreference, subscribeAgentSidebarUrlChanges, SIDEBAR_STATE_CHANGE_EVENT, } from "./agent-sidebar-state.js";
|
|
43
|
+
import { AGENT_SIDEBAR_MIN_WIDTH, consumeAgentSidebarUrlOpenOverride, clampAgentSidebarWidth, dispatchAgentSidebarStateChange, getAgentSidebarMaxWidth, getInitialAgentSidebarOpen, getAgentSidebarWideWidth, setAgentSidebarOpenPreference, subscribeAgentSidebarUrlChanges, SIDEBAR_STATE_CHANGE_EVENT, } from "./agent-sidebar-state.js";
|
|
44
44
|
import { trackEvent } from "./analytics.js";
|
|
45
45
|
import { agentNativePath, appPath, isWorkspaceAppPath } from "./api-path.js";
|
|
46
46
|
import { readClientAppState } from "./application-state.js";
|
|
47
47
|
import { assistantUiRecoverableRenderErrorKind } from "./assistant-ui-recovery.js";
|
|
48
48
|
import { shouldParentFrameOwnAgentPanel } from "./builder-frame.js";
|
|
49
|
-
import { AGENT_CHAT_VIEW_TRANSITION_CLASS, getAgentChatViewTransitionStyle, } from "./chat-view-transition.js";
|
|
49
|
+
import { AGENT_CHAT_VIEW_TRANSITION_CLASS, getAgentChatViewTransitionStyle, startAgentChatViewTransition, } from "./chat-view-transition.js";
|
|
50
50
|
import { fetchBuilderStatus } from "./client-status-requests.js";
|
|
51
51
|
import { RealtimeVoiceModeProvider } from "./composer/index.js";
|
|
52
52
|
import { getFramePostMessageTargetOrigin, isTrustedFrameMessage, } from "./frame.js";
|
|
@@ -388,7 +388,7 @@ function CodeAccessUnavailablePanel({ title, description, ctaLabel, ctaHref, sec
|
|
|
388
388
|
});
|
|
389
389
|
}, className: "inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent", children: secondaryCtaLabel })] })] }));
|
|
390
390
|
}
|
|
391
|
-
function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, emptyStateText, emptyStateAddon, suggestions, dynamicSuggestions, showHeader = true, onCollapse, isFullscreen, onToggleFullscreen, devAppUrl, storageKey, restoreActiveThread = true, scope, showScopeBadge, browserTabId, threadUrlSync, chatNotice, showTabBar = true, showPageNewChatButton = false, allowSettingsMode = true, chatOnly = false, agentPageHref, codeAccess, ...assistantChatProps }) {
|
|
391
|
+
function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, emptyStateText, emptyStateAddon, suggestions, dynamicSuggestions, showHeader = true, onCollapse, isFullscreen, onToggleFullscreen, onSnapTo75Percent, isWideDrawer, onExitWideDrawer, devAppUrl, storageKey, restoreActiveThread = true, scope, showScopeBadge, browserTabId, threadUrlSync, chatNotice, showTabBar = true, showPageNewChatButton = false, allowSettingsMode = true, chatOnly = false, agentPageHref, codeAccess, ...assistantChatProps }) {
|
|
392
392
|
const t = useT();
|
|
393
393
|
const navigate = useNavigate();
|
|
394
394
|
const mounted = useClientOnly();
|
|
@@ -405,6 +405,8 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
405
405
|
const closeTabHint = isMac ? "\u2303W" : "Alt+W";
|
|
406
406
|
const closeAllTabsHint = isMac ? "\u2303\u2325W" : "Ctrl+Alt+W";
|
|
407
407
|
const toggleSidebarHint = isMac ? "\u2318\\" : "Ctrl+\\";
|
|
408
|
+
const widenChatHint = isMac ? "\u2318\u21e7\\" : "Ctrl+Shift+\\";
|
|
409
|
+
const fullscreenHint = isMac ? "\u2318\u21e7F" : "Ctrl+Shift+F";
|
|
408
410
|
const [execMode, setExecMode] = useState(() => {
|
|
409
411
|
try {
|
|
410
412
|
const saved = localStorage.getItem(execModeKey);
|
|
@@ -646,6 +648,33 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
646
648
|
url.searchParams.set("thread", threadId);
|
|
647
649
|
return url.toString();
|
|
648
650
|
}, [threadUrlSync]);
|
|
651
|
+
const wideDrawerAction = isWideDrawer ? onExitWideDrawer : onSnapTo75Percent;
|
|
652
|
+
const wideDrawerLabel = t(isWideDrawer ? "agentPanel.returnChatToLayout" : "agentPanel.widenChat");
|
|
653
|
+
const showFullViewAction = Boolean(agentPageHref &&
|
|
654
|
+
shouldShowAgentPanelFullViewAction(agentPageHref, mode, chatOnly));
|
|
655
|
+
useEffect(() => {
|
|
656
|
+
const handleKeyDown = (event) => {
|
|
657
|
+
if (!(event.metaKey || event.ctrlKey) ||
|
|
658
|
+
!event.shiftKey ||
|
|
659
|
+
event.altKey) {
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
if (event.code === "Backslash" &&
|
|
663
|
+
onCollapse &&
|
|
664
|
+
mode === "chat" &&
|
|
665
|
+
wideDrawerAction) {
|
|
666
|
+
event.preventDefault();
|
|
667
|
+
wideDrawerAction();
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
if (event.code === "KeyF" && onToggleFullscreen) {
|
|
671
|
+
event.preventDefault();
|
|
672
|
+
onToggleFullscreen();
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
676
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
677
|
+
}, [mode, onCollapse, onToggleFullscreen, wideDrawerAction]);
|
|
649
678
|
const renderHeaderActions = useCallback(({ activeChatSessionId, activeTabId, activeTabMessageCount, addTab, clearActiveTab, closeAllTabs, closeOtherTabs, closeTab, showHistory, tabs, toggleHistory, }) => (_jsxs("div", { className: "relative flex shrink-0 items-center gap-0.5", children: [!onCollapse && SHOW_ONBOARDING && (_jsx(Suspense, { fallback: null, children: _jsx(SetupButton, {}) })), !onCollapse &&
|
|
650
679
|
(() => {
|
|
651
680
|
const activeTab = mode === "chat" && activeChatSessionId
|
|
@@ -656,9 +685,12 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
656
685
|
return null;
|
|
657
686
|
}
|
|
658
687
|
return (_jsx(ShareButton, { resourceType: "chat_thread", resourceId: activeTab.id, resourceTitle: activeTab.label || "Chat", shareUrl: getChatThreadShareUrl(activeTab.id), trigger: "icon", triggerClassName: "h-7 w-7" }));
|
|
659
|
-
})(), feedbackEnabled ? (_jsx(FeedbackButton, { variant: "icon", side: "bottom", align: "end", chatSessionId: activeChatSessionId, chatStorageKey: storageKey, open: feedbackOpen, onOpenChange: setFeedbackOpen, trigger: _jsx("button", { type: "button", tabIndex: -1, "aria-hidden": "true", className: "pointer-events-none absolute end-0 top-full h-px w-px opacity-0" }) })) : null, mode === "chat" && (_jsx(IconTooltip, { content: t("agentPanel.newChat"), children: _jsx("button", { onClick: addTab, "aria-label": t("agentPanel.newChat"), className: "flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconPlus, { size: 14 }) }) })), !onCollapse && mode === "cli" && canUseCodeTools && (_jsx(IconTooltip, { content: t("agentPanel.newTerminal"), children: _jsx("button", { onClick: addCliTab, "aria-label": t("agentPanel.newTerminal"), className: "flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconPlus, { size: 14 }) }) })),
|
|
660
|
-
|
|
661
|
-
|
|
688
|
+
})(), feedbackEnabled ? (_jsx(FeedbackButton, { variant: "icon", side: "bottom", align: "end", chatSessionId: activeChatSessionId, chatStorageKey: storageKey, open: feedbackOpen, onOpenChange: setFeedbackOpen, trigger: _jsx("button", { type: "button", tabIndex: -1, "aria-hidden": "true", className: "pointer-events-none absolute end-0 top-full h-px w-px opacity-0" }) })) : null, mode === "chat" && (_jsx(IconTooltip, { content: t("agentPanel.newChat"), children: _jsx("button", { onClick: addTab, "aria-label": t("agentPanel.newChat"), className: "flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconPlus, { size: 14 }) }) })), !onCollapse && mode === "cli" && canUseCodeTools && (_jsx(IconTooltip, { content: t("agentPanel.newTerminal"), children: _jsx("button", { onClick: addCliTab, "aria-label": t("agentPanel.newTerminal"), className: "flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconPlus, { size: 14 }) }) })), _jsxs(DropdownMenu, { open: headerMenuOpen, onOpenChange: setHeaderMenuOpen, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { className: cn("flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", (headerMenuOpen || mode === "settings") &&
|
|
689
|
+
"bg-accent text-foreground"), "aria-label": t("agentPanel.panelOptions"), children: _jsx(IconDotsVertical, { size: 14 }) }) }), _jsxs(DropdownMenuContent, { align: "end", sideOffset: 6, className: "w-48", children: [onCollapse && (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { onSelect: onCollapse, children: [_jsx(IconLayoutSidebarRightCollapse, { size: 14, className: "shrink-0" }), t("agentPanel.collapseSidebar"), _jsx(DropdownMenuShortcut, { children: toggleSidebarHint })] }), _jsx(DropdownMenuSeparator, {})] })), onCollapse && mode === "chat" && wideDrawerAction ? (_jsxs(DropdownMenuItem, { onSelect: wideDrawerAction, children: [_jsx(IconArrowsHorizontal, { size: 14, className: "shrink-0" }), wideDrawerLabel, _jsx(DropdownMenuShortcut, { children: widenChatHint })] })) : null, showFullViewAction && agentPageHref ? (_jsx(DropdownMenuItem, { asChild: true, children: _jsxs(Link, { to: agentPageHref, "aria-label": t("agentPanel.openFullView"), children: [_jsx(IconArrowsMaximize, { size: 14, className: "shrink-0" }), t("agentPanel.openFullView")] }) })) : null, onToggleFullscreen && (_jsxs(DropdownMenuItem, { onSelect: onToggleFullscreen, children: [isFullscreen ? (_jsx(IconArrowsMinimize, { size: 14, className: "shrink-0" })) : (_jsx(IconArrowsMaximize, { size: 14, className: "shrink-0" })), isFullscreen
|
|
690
|
+
? t("agentPanel.exitFullscreen")
|
|
691
|
+
: t("agentPanel.fullscreen"), _jsx(DropdownMenuShortcut, { children: fullscreenHint })] })), (onCollapse && mode === "chat" && wideDrawerAction) ||
|
|
692
|
+
showFullViewAction ||
|
|
693
|
+
onToggleFullscreen ? (_jsx(DropdownMenuSeparator, {})) : null, onCollapse && mode === "chat" && (_jsxs(DropdownMenuItem, { onSelect: addTab, children: [_jsx(IconPlus, { size: 14, className: "shrink-0" }), t("agentPanel.newChat")] })), mode === "chat" && toggleHistory && (_jsxs(DropdownMenuItem, { onSelect: toggleHistory, children: [_jsx(IconHistory, { size: 14, className: "shrink-0" }), showHistory
|
|
662
694
|
? t("agentPanel.hideChats")
|
|
663
695
|
: t("agentPanel.allChats")] })), mode === "chat" && (_jsx(RunsTrayMenuItem, { pollMs: 0, limit: 12, showRecent: true, onOpenThread: openRunThread })), mode === "chat" && _jsx(DropdownMenuSeparator, {}), mode === "cli" && availableClis.length > 0 && (_jsxs(_Fragment, { children: [availableClis.map((cli) => (_jsxs(DropdownMenuItem, { onSelect: () => selectCli(cli.command), className: cn(cli.command === selectedCli
|
|
664
696
|
? "font-medium"
|
|
@@ -667,9 +699,7 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
667
699
|
// teardown, otherwise it can immediately dismiss the Popover we're
|
|
668
700
|
// opening in the same tick (Radix nested-overlay race).
|
|
669
701
|
setTimeout(() => setFeedbackOpen(true), 0);
|
|
670
|
-
}, children: [_jsx(IconMessageDots, { size: 14, className: "shrink-0" }), t("agentPanel.feedback")] })) : null,
|
|
671
|
-
? t("agentPanel.exitFullscreen")
|
|
672
|
-
: t("agentPanel.fullscreen")] })), ((mode === "chat" && activeTabId) ||
|
|
702
|
+
}, children: [_jsx(IconMessageDots, { size: 14, className: "shrink-0" }), t("agentPanel.feedback")] })) : null, ((mode === "chat" && activeTabId) ||
|
|
673
703
|
(mode === "cli" && canUseCodeTools && activeCliTab)) && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), mode === "chat" ? (shouldShowAgentPanelChatTabBar(tabs, activeTabId) ? (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { onSelect: () => closeTab(activeTabId), children: [_jsx(IconX, { size: 14, className: "shrink-0" }), t("agentPanel.closeTab"), _jsx(DropdownMenuShortcut, { children: closeTabHint })] }), _jsx(DropdownMenuItem, { onSelect: () => closeOtherTabs(activeTabId), children: t("agentPanel.closeOtherTabs") }), _jsxs(DropdownMenuItem, { onSelect: () => closeAllTabs(), children: [t("agentPanel.closeAllTabs"), _jsx(DropdownMenuShortcut, { children: closeAllTabsHint })] })] })) : (_jsxs(DropdownMenuItem, { onSelect: clearActiveTab, children: [_jsx(IconX, { size: 14, className: "shrink-0" }), t("agentPanel.clearChat")] }))) : (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { onSelect: () => closeCliTab(activeCliTab), children: [_jsx(IconX, { size: 14, className: "shrink-0" }), t("agentPanel.closeTab"), _jsx(DropdownMenuShortcut, { children: closeTabHint })] }), _jsx(DropdownMenuItem, { onSelect: () => closeOtherCliTabs(activeCliTab), children: t("agentPanel.closeOtherTabs") }), _jsxs(DropdownMenuItem, { onSelect: () => closeAllCliTabs(), children: [t("agentPanel.closeAllTabs"), _jsx(DropdownMenuShortcut, { children: closeAllTabsHint })] })] }))] }))] })] }), onCollapse && (_jsx(IconTooltip, { content: t("agentPanel.collapseSidebar"), children: _jsx("button", { type: "button", onClick: onCollapse, "aria-label": t("agentPanel.collapseSidebar"), className: "flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconX, { size: 14 }) }) }))] })), [
|
|
674
704
|
activeCliTab,
|
|
675
705
|
addCliTab,
|
|
@@ -686,9 +716,12 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
686
716
|
getChatThreadShareUrl,
|
|
687
717
|
headerMenuOpen,
|
|
688
718
|
isFullscreen,
|
|
719
|
+
isWideDrawer,
|
|
689
720
|
mode,
|
|
690
721
|
agentPageHref,
|
|
691
722
|
onCollapse,
|
|
723
|
+
onExitWideDrawer,
|
|
724
|
+
onSnapTo75Percent,
|
|
692
725
|
onToggleFullscreen,
|
|
693
726
|
openRunThread,
|
|
694
727
|
selectCli,
|
|
@@ -696,6 +729,11 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
696
729
|
storageKey,
|
|
697
730
|
switchMode,
|
|
698
731
|
t,
|
|
732
|
+
wideDrawerAction,
|
|
733
|
+
wideDrawerLabel,
|
|
734
|
+
widenChatHint,
|
|
735
|
+
fullscreenHint,
|
|
736
|
+
showFullViewAction,
|
|
699
737
|
]);
|
|
700
738
|
const renderPageChatOverlay = useCallback(({ activeTabId, activeTabMessageCount, addTab, tabs, }) => {
|
|
701
739
|
if (!shouldShowAgentPanelPageNewChatButton(tabs, activeTabId, activeTabMessageCount)) {
|
|
@@ -902,11 +940,13 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
902
940
|
// ─── Resize handle ──────────────────────────────────────────────────────────
|
|
903
941
|
const SIDEBAR_STORAGE_KEY = "agent-native-sidebar-width";
|
|
904
942
|
const SIDEBAR_FULLSCREEN_KEY = "agent-native-sidebar-fullscreen";
|
|
905
|
-
const
|
|
906
|
-
const
|
|
943
|
+
const SIDEBAR_DRAWER_KEY = "agent-native-sidebar-wide-drawer";
|
|
944
|
+
const SIDEBAR_DRAWER_PLACEHOLDER_KEY = "agent-native-sidebar-drawer-placeholder-width";
|
|
907
945
|
const SIDEBAR_ANIMATION_MS = 260;
|
|
908
946
|
const SIDEBAR_OVERLAY_Z_INDEX = 70;
|
|
947
|
+
const SIDEBAR_DRAWER_Z_INDEX = 80;
|
|
909
948
|
const SIDEBAR_FULLSCREEN_Z_INDEX = 90;
|
|
949
|
+
const SIDEBAR_DRAWER_VIEW_TRANSITION_NAME = "agent-native-sidebar-drawer";
|
|
910
950
|
/** Shared max width of the centered fullscreen chat column and composer. */
|
|
911
951
|
const FULLSCREEN_CHAT_COLUMN_MAX_PX = 684;
|
|
912
952
|
export function getActiveTabScrollDelta(containerRect, tabRect, margin = 24) {
|
|
@@ -1333,6 +1373,31 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1333
1373
|
const [open, setOpen] = useState(() => openOnChatRunning || getInitialAgentSidebarOpen(defaultOpen, storageKey));
|
|
1334
1374
|
const [presentationMode, setPresentationMode] = useState(false);
|
|
1335
1375
|
const [width, setWidth] = useState(initialWidth);
|
|
1376
|
+
const [isWideDrawer, setIsWideDrawer] = useState(() => {
|
|
1377
|
+
if (typeof window === "undefined")
|
|
1378
|
+
return false;
|
|
1379
|
+
try {
|
|
1380
|
+
return localStorage.getItem(SIDEBAR_DRAWER_KEY) === "true";
|
|
1381
|
+
}
|
|
1382
|
+
catch {
|
|
1383
|
+
// coercion-ok: the drawer defaults to the normal inline presentation when storage is unavailable.
|
|
1384
|
+
return false;
|
|
1385
|
+
}
|
|
1386
|
+
});
|
|
1387
|
+
const [drawerPlaceholderWidth, setDrawerPlaceholderWidth] = useState(() => {
|
|
1388
|
+
const fallback = Number.isFinite(initialWidth) ? initialWidth : 380;
|
|
1389
|
+
try {
|
|
1390
|
+
const saved = localStorage.getItem(SIDEBAR_DRAWER_PLACEHOLDER_KEY);
|
|
1391
|
+
const parsed = saved ? Number.parseInt(saved, 10) : Number.NaN;
|
|
1392
|
+
if (Number.isFinite(parsed))
|
|
1393
|
+
return clampAgentSidebarWidth(parsed);
|
|
1394
|
+
}
|
|
1395
|
+
catch {
|
|
1396
|
+
// coercion-ok: the normal sidebar width is a safe placeholder fallback.
|
|
1397
|
+
}
|
|
1398
|
+
return clampAgentSidebarWidth(fallback);
|
|
1399
|
+
});
|
|
1400
|
+
const drawerExitTimerRef = useRef(null);
|
|
1336
1401
|
const [isResizing, setIsResizing] = useState(false);
|
|
1337
1402
|
const [fullscreen, setFullscreen] = useState(() => {
|
|
1338
1403
|
// Force-disable on mobile: a Claude-style centered column makes no sense
|
|
@@ -1361,13 +1426,18 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1361
1426
|
try {
|
|
1362
1427
|
const saved = localStorage.getItem(SIDEBAR_STORAGE_KEY);
|
|
1363
1428
|
if (saved) {
|
|
1364
|
-
const n = parseInt(saved, 10);
|
|
1365
|
-
if (n
|
|
1366
|
-
setWidth(n);
|
|
1429
|
+
const n = Number.parseInt(saved, 10);
|
|
1430
|
+
if (Number.isFinite(n))
|
|
1431
|
+
setWidth(clampAgentSidebarWidth(n));
|
|
1367
1432
|
}
|
|
1368
1433
|
}
|
|
1369
1434
|
catch { }
|
|
1370
1435
|
}, []);
|
|
1436
|
+
useEffect(() => () => {
|
|
1437
|
+
if (drawerExitTimerRef.current !== null) {
|
|
1438
|
+
clearTimeout(drawerExitTimerRef.current);
|
|
1439
|
+
}
|
|
1440
|
+
}, []);
|
|
1371
1441
|
const setOpenPersisted = useCallback((next) => {
|
|
1372
1442
|
setOpen((prev) => {
|
|
1373
1443
|
const value = typeof next === "function" ? next(prev) : next;
|
|
@@ -1553,7 +1623,7 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1553
1623
|
return;
|
|
1554
1624
|
if (event.source !== window.parent || !isTrustedFrameMessage(event))
|
|
1555
1625
|
return;
|
|
1556
|
-
const { mode, appMode, width: frameWidth, open: frameOpen, } = event.data.data || {};
|
|
1626
|
+
const { mode, appMode, width: frameWidth, open: frameOpen, wide: frameWide, placeholderWidth: framePlaceholderWidth, } = event.data.data || {};
|
|
1557
1627
|
if (mode === "code") {
|
|
1558
1628
|
// Frame is showing its own sidebar — hide the app's
|
|
1559
1629
|
setFrameCodeMode(true);
|
|
@@ -1567,11 +1637,21 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1567
1637
|
setFrameSidebarOpen(false);
|
|
1568
1638
|
setHasFrameSidebarState(true);
|
|
1569
1639
|
setOpenPersisted(frameOpen !== false);
|
|
1570
|
-
if (frameWidth &&
|
|
1571
|
-
frameWidth
|
|
1572
|
-
frameWidth
|
|
1640
|
+
if (typeof frameWidth === "number" &&
|
|
1641
|
+
Number.isFinite(frameWidth) &&
|
|
1642
|
+
frameWidth >= AGENT_SIDEBAR_MIN_WIDTH &&
|
|
1643
|
+
frameWidth <= getAgentSidebarMaxWidth()) {
|
|
1573
1644
|
setWidth(frameWidth);
|
|
1574
1645
|
}
|
|
1646
|
+
if (frameWide === true || frameWide === false) {
|
|
1647
|
+
setIsWideDrawer(frameWide);
|
|
1648
|
+
if (typeof framePlaceholderWidth === "number" &&
|
|
1649
|
+
Number.isFinite(framePlaceholderWidth) &&
|
|
1650
|
+
framePlaceholderWidth >= AGENT_SIDEBAR_MIN_WIDTH &&
|
|
1651
|
+
framePlaceholderWidth <= getAgentSidebarMaxWidth()) {
|
|
1652
|
+
setDrawerPlaceholderWidth(framePlaceholderWidth);
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1575
1655
|
// Sync the panel mode from frame tab selection
|
|
1576
1656
|
if (appMode === "cli" ||
|
|
1577
1657
|
appMode === "resources" ||
|
|
@@ -1638,7 +1718,7 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1638
1718
|
}, []);
|
|
1639
1719
|
const handleDrag = useCallback((delta) => {
|
|
1640
1720
|
setWidth((prev) => {
|
|
1641
|
-
const next =
|
|
1721
|
+
const next = clampAgentSidebarWidth(prev + delta);
|
|
1642
1722
|
try {
|
|
1643
1723
|
localStorage.setItem(SIDEBAR_STORAGE_KEY, String(next));
|
|
1644
1724
|
}
|
|
@@ -1646,6 +1726,46 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1646
1726
|
return next;
|
|
1647
1727
|
});
|
|
1648
1728
|
}, []);
|
|
1729
|
+
const snapTo75Percent = useCallback(() => {
|
|
1730
|
+
if (drawerExitTimerRef.current !== null) {
|
|
1731
|
+
clearTimeout(drawerExitTimerRef.current);
|
|
1732
|
+
drawerExitTimerRef.current = null;
|
|
1733
|
+
}
|
|
1734
|
+
const next = getAgentSidebarWideWidth();
|
|
1735
|
+
const placeholder = isWideDrawer ? drawerPlaceholderWidth : width;
|
|
1736
|
+
const apply = () => {
|
|
1737
|
+
setDrawerPlaceholderWidth(placeholder);
|
|
1738
|
+
setIsWideDrawer(true);
|
|
1739
|
+
setWidth(next);
|
|
1740
|
+
try {
|
|
1741
|
+
localStorage.setItem(SIDEBAR_STORAGE_KEY, String(next));
|
|
1742
|
+
localStorage.setItem(SIDEBAR_DRAWER_KEY, "true");
|
|
1743
|
+
localStorage.setItem(SIDEBAR_DRAWER_PLACEHOLDER_KEY, String(placeholder));
|
|
1744
|
+
// coercion-ok: the drawer remains applied in memory when storage is unavailable.
|
|
1745
|
+
}
|
|
1746
|
+
catch { }
|
|
1747
|
+
};
|
|
1748
|
+
startAgentChatViewTransition(apply);
|
|
1749
|
+
}, [drawerPlaceholderWidth, isWideDrawer, width]);
|
|
1750
|
+
const exitWideDrawer = useCallback(() => {
|
|
1751
|
+
if (!isWideDrawer || drawerExitTimerRef.current !== null)
|
|
1752
|
+
return;
|
|
1753
|
+
const next = drawerPlaceholderWidth;
|
|
1754
|
+
const apply = () => {
|
|
1755
|
+
setWidth(next);
|
|
1756
|
+
try {
|
|
1757
|
+
localStorage.setItem(SIDEBAR_STORAGE_KEY, String(next));
|
|
1758
|
+
localStorage.setItem(SIDEBAR_DRAWER_KEY, "false");
|
|
1759
|
+
// coercion-ok: the normal sidebar remains applied in memory when storage is unavailable.
|
|
1760
|
+
}
|
|
1761
|
+
catch { }
|
|
1762
|
+
drawerExitTimerRef.current = setTimeout(() => {
|
|
1763
|
+
drawerExitTimerRef.current = null;
|
|
1764
|
+
setIsWideDrawer(false);
|
|
1765
|
+
}, SIDEBAR_ANIMATION_MS + 32);
|
|
1766
|
+
};
|
|
1767
|
+
startAgentChatViewTransition(apply);
|
|
1768
|
+
}, [drawerPlaceholderWidth, isWideDrawer]);
|
|
1649
1769
|
const handleResizeStart = useCallback(() => setIsResizing(true), []);
|
|
1650
1770
|
const handleResizeEnd = useCallback(() => setIsResizing(false), []);
|
|
1651
1771
|
const isLeft = position === "left";
|
|
@@ -1653,6 +1773,7 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1653
1773
|
// already viewport-covering, so the maximize button is hidden and the
|
|
1654
1774
|
// mounted state ignores any persisted value.
|
|
1655
1775
|
const effectiveFullscreen = !onFullscreenRequest && fullscreen && !isMobile;
|
|
1776
|
+
const wideDrawerEnabled = isWideDrawer && !isMobile && !effectiveFullscreen;
|
|
1656
1777
|
const mobileAnimationEnabled = !presentationMode && !effectiveFullscreen && isMobile && animateMobile;
|
|
1657
1778
|
const desktopAnimationEnabled = !presentationMode && !effectiveFullscreen && !isMobile && animateDesktop;
|
|
1658
1779
|
const sidebarAnimationEnabled = mobileAnimationEnabled || desktopAnimationEnabled;
|
|
@@ -1685,10 +1806,12 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1685
1806
|
? "mobile"
|
|
1686
1807
|
: effectiveFullscreen
|
|
1687
1808
|
? "fullscreen"
|
|
1688
|
-
:
|
|
1809
|
+
: wideDrawerEnabled
|
|
1810
|
+
? "drawer"
|
|
1811
|
+
: "desktop";
|
|
1689
1812
|
// On desktop the resize handle is also the visual divider. Avoid painting a
|
|
1690
1813
|
// second panel border next to it.
|
|
1691
|
-
const showResizeHandle = !isMobile && !effectiveFullscreen && panelOpen;
|
|
1814
|
+
const showResizeHandle = !isMobile && !effectiveFullscreen && !wideDrawerEnabled && panelOpen;
|
|
1692
1815
|
// On mobile the sidebar floats as a fixed overlay so the content below isn't
|
|
1693
1816
|
// squashed. On desktop it participates in the flex layout as before, except
|
|
1694
1817
|
// in fullscreen mode where it overlays the entire viewport (Claude-style).
|
|
@@ -1725,6 +1848,25 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1725
1848
|
display: open ? "flex" : "none",
|
|
1726
1849
|
};
|
|
1727
1850
|
}
|
|
1851
|
+
else if (wideDrawerEnabled) {
|
|
1852
|
+
panelStyle = {
|
|
1853
|
+
...AGENT_PANEL_ROOT_STYLE,
|
|
1854
|
+
position: "fixed",
|
|
1855
|
+
top: 0,
|
|
1856
|
+
[isLeft ? "left" : "right"]: 0,
|
|
1857
|
+
height: "100%",
|
|
1858
|
+
width,
|
|
1859
|
+
maxWidth: "100vw",
|
|
1860
|
+
maxHeight: "var(--agent-native-viewport-height, 100vh)",
|
|
1861
|
+
zIndex: SIDEBAR_DRAWER_Z_INDEX,
|
|
1862
|
+
"--agent-sidebar-background": "var(--agent-native-lower-surface, hsl(var(--background)))",
|
|
1863
|
+
background: "var(--agent-sidebar-background)",
|
|
1864
|
+
borderLeft: isLeft ? "none" : "1px solid hsl(var(--border))",
|
|
1865
|
+
borderRight: isLeft ? "1px solid hsl(var(--border))" : "none",
|
|
1866
|
+
display: "flex",
|
|
1867
|
+
viewTransitionName: SIDEBAR_DRAWER_VIEW_TRANSITION_NAME,
|
|
1868
|
+
};
|
|
1869
|
+
}
|
|
1728
1870
|
else {
|
|
1729
1871
|
panelStyle = {
|
|
1730
1872
|
...AGENT_PANEL_ROOT_STYLE,
|
|
@@ -1743,25 +1885,29 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1743
1885
|
display: desktopAnimationEnabled || panelOpen ? "flex" : "none",
|
|
1744
1886
|
minWidth: desktopAnimationEnabled ? 0 : undefined,
|
|
1745
1887
|
pointerEvents: desktopAnimationEnabled && !panelOpen ? "none" : undefined,
|
|
1888
|
+
viewTransitionName: SIDEBAR_DRAWER_VIEW_TRANSITION_NAME,
|
|
1746
1889
|
};
|
|
1747
1890
|
}
|
|
1748
1891
|
// Mount the live chat surface only while visible or actively needed. Keeping
|
|
1749
1892
|
// it mounted while closed starts app-state polling on every public page view.
|
|
1750
|
-
const sidebar = shouldRenderPanel ? (_jsxs(_Fragment, { children: [showResizeHandle && !isLeft && (_jsx(ResizeHandle, { position: position, onDrag: handleDrag, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd })), _jsx("div", { className: cn("agent-sidebar-panel flex shrink-0 flex-col overflow-hidden text-[13px] leading-[1.2] antialiased", chatViewTransition && AGENT_CHAT_VIEW_TRANSITION_CLASS, mobileAnimationEnabled && "shadow-2xl"), "data-agent-sidebar-animation":
|
|
1751
|
-
? "
|
|
1752
|
-
:
|
|
1753
|
-
? "
|
|
1754
|
-
:
|
|
1893
|
+
const sidebar = shouldRenderPanel ? (_jsxs(_Fragment, { children: [showResizeHandle && !isLeft && (_jsx(ResizeHandle, { position: position, onDrag: handleDrag, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd })), _jsx("div", { className: cn("agent-sidebar-panel flex shrink-0 flex-col overflow-hidden text-[13px] leading-[1.2] antialiased", chatViewTransition && AGENT_CHAT_VIEW_TRANSITION_CLASS, mobileAnimationEnabled && "shadow-2xl"), "data-agent-sidebar-animation": wideDrawerEnabled
|
|
1894
|
+
? "drawer"
|
|
1895
|
+
: mobileAnimationEnabled
|
|
1896
|
+
? "mobile"
|
|
1897
|
+
: desktopAnimationEnabled
|
|
1898
|
+
? "desktop"
|
|
1899
|
+
: undefined, "data-agent-sidebar-layout": panelLayout, "data-agent-sidebar-position": position, "data-agent-sidebar-state": panelOpen ? "open" : "closed", "data-agent-sidebar-resizing": isResizing ? "true" : undefined, "data-agent-sidebar-chat-handoff": chatViewTransitionHandoff ? "true" : undefined, style: chatViewTransition
|
|
1755
1900
|
? getAgentChatViewTransitionStyle(panelStyle)
|
|
1756
|
-
: panelStyle, inert: sidebarAnimationEnabled && !panelOpen ? true : undefined, "aria-hidden": sidebarAnimationEnabled && !panelOpen ? true : undefined, children: _jsx("div", { className: "agent-sidebar-panel-inner flex min-h-0 flex-1 flex-col", children: _jsx(AgentPanel, { emptyStateText: emptyStateText, suggestions: suggestions, dynamicSuggestions: dynamicSuggestions, composerToolbarSlot: composerToolbarSlot, composerSlot: composerSlot, onComposerTextChange: onComposerTextChange, imageModelMenu: imageModelMenu, threadFooterSlot: threadFooterSlot, missingApiKeySetupLayout: "sidebar", onCollapse: () => setOpenPersisted(false), isFullscreen: effectiveFullscreen, onToggleFullscreen: isMobile ? undefined : (onFullscreenRequest ?? toggleFullscreen), storageKey: storageKey, scope: scope, showScopeBadge: showScopeBadge, browserTabId: browserTabId, threadUrlSync: threadUrlSync, agentPageHref: agentPageHref, allowSettingsMode: false, chatOnly: true }) }) }), showResizeHandle && isLeft && (_jsx(ResizeHandle, { position: position, onDrag: handleDrag, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd }))] })) : null;
|
|
1901
|
+
: panelStyle, inert: sidebarAnimationEnabled && !panelOpen ? true : undefined, "aria-hidden": sidebarAnimationEnabled && !panelOpen ? true : undefined, children: _jsx("div", { className: "agent-sidebar-panel-inner flex min-h-0 flex-1 flex-col", children: _jsx(AgentPanel, { emptyStateText: emptyStateText, suggestions: suggestions, dynamicSuggestions: dynamicSuggestions, composerToolbarSlot: composerToolbarSlot, composerSlot: composerSlot, onComposerTextChange: onComposerTextChange, imageModelMenu: imageModelMenu, threadFooterSlot: threadFooterSlot, missingApiKeySetupLayout: "sidebar", onCollapse: () => setOpenPersisted(false), isFullscreen: effectiveFullscreen, onToggleFullscreen: isMobile ? undefined : (onFullscreenRequest ?? toggleFullscreen), onSnapTo75Percent: isMobile ? undefined : snapTo75Percent, isWideDrawer: isMobile ? false : isWideDrawer, onExitWideDrawer: isMobile ? undefined : exitWideDrawer, storageKey: storageKey, scope: scope, showScopeBadge: showScopeBadge, browserTabId: browserTabId, threadUrlSync: threadUrlSync, agentPageHref: agentPageHref, allowSettingsMode: false, chatOnly: true }) }) }), showResizeHandle && isLeft && (_jsx(ResizeHandle, { position: position, onDrag: handleDrag, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd }))] })) : null;
|
|
1902
|
+
const drawerPlaceholder = wideDrawerEnabled && !presentationMode && shouldRenderPanel ? (_jsx("div", { "aria-hidden": "true", className: "agent-sidebar-drawer-placeholder shrink-0", "data-agent-sidebar-placeholder": "true", style: { width: drawerPlaceholderWidth + 1 } })) : null;
|
|
1757
1903
|
return (_jsx(AgentSidebarOnboardingContext.Provider, { value: true, children: _jsxs(RealtimeVoiceModeProvider, { browserTabId: browserTabId, children: [showFirstRunOnboarding && (_jsx(Suspense, { fallback: null, children: _jsx(FirstRunOnboarding, {}) })), _jsxs("div", { className: "agent-sidebar-shell flex min-w-0 flex-1 h-screen overflow-hidden", "data-agent-sidebar-position": position, "data-agent-sidebar-resizing": isResizing ? "true" : undefined, children: [isMobile &&
|
|
1758
1904
|
!presentationMode &&
|
|
1759
|
-
(mobileAnimationEnabled ? shouldRenderPanel : open) && (_jsx("div", { className: cn("agent-sidebar-backdrop fixed inset-0 bg-foreground/40", mobileAnimationEnabled && !panelOpen && "pointer-events-none"), "data-agent-sidebar-animation": mobileAnimationEnabled ? "mobile" : undefined, "data-agent-sidebar-state": panelOpen ? "open" : "closed", style: { zIndex: SIDEBAR_OVERLAY_Z_INDEX - 1 }, onClick: () => setOpenPersisted(false) })), shouldMountPanel ? _jsx(URLSync, { browserTabId: browserTabId }) : null, isLeft && !presentationMode ? sidebar : null, _jsx("div", { className: "agent-sidebar-main-surface flex flex-1 flex-col overflow-auto min-w-0", "data-agent-sidebar-main-position": position, "data-agent-sidebar-main-state": !isMobile &&
|
|
1905
|
+
(mobileAnimationEnabled ? shouldRenderPanel : open) && (_jsx("div", { className: cn("agent-sidebar-backdrop fixed inset-0 bg-foreground/40", mobileAnimationEnabled && !panelOpen && "pointer-events-none"), "data-agent-sidebar-animation": mobileAnimationEnabled ? "mobile" : undefined, "data-agent-sidebar-state": panelOpen ? "open" : "closed", style: { zIndex: SIDEBAR_OVERLAY_Z_INDEX - 1 }, onClick: () => setOpenPersisted(false) })), shouldMountPanel ? _jsx(URLSync, { browserTabId: browserTabId }) : null, isLeft && !presentationMode ? sidebar : null, isLeft && !presentationMode ? drawerPlaceholder : null, _jsx("div", { className: "agent-sidebar-main-surface flex flex-1 flex-col overflow-auto min-w-0", "data-agent-sidebar-main-position": position, "data-agent-sidebar-main-state": !isMobile &&
|
|
1760
1906
|
!effectiveFullscreen &&
|
|
1761
1907
|
!presentationMode &&
|
|
1762
1908
|
panelOpen
|
|
1763
1909
|
? "open"
|
|
1764
|
-
: "closed", "data-agent-sidebar-resizing": isResizing ? "true" : undefined, children: _jsx(ScreenRefreshBoundary, { children: children }) }), !isLeft && !presentationMode ? sidebar : null] })] }) }));
|
|
1910
|
+
: "closed", "data-agent-sidebar-resizing": isResizing ? "true" : undefined, children: _jsx(ScreenRefreshBoundary, { children: children }) }), !isLeft && !presentationMode ? drawerPlaceholder : null, !isLeft && !presentationMode ? sidebar : null] })] }) }));
|
|
1765
1911
|
}
|
|
1766
1912
|
/**
|
|
1767
1913
|
* Focus the agent chat composer input.
|
|
@@ -288,6 +288,8 @@ export interface AssistantChatProps {
|
|
|
288
288
|
composerDisabledPlaceholder?: string;
|
|
289
289
|
/** When true, skip the restore skeleton (used for freshly created threads with no messages) */
|
|
290
290
|
isNewThread?: boolean;
|
|
291
|
+
/** Defer restore until the owning thread list has reconciled the active id. */
|
|
292
|
+
isThreadStateLoading?: boolean;
|
|
291
293
|
/** Called when a slash command (e.g. /clear, /help) is executed */
|
|
292
294
|
onSlashCommand?: (command: string) => void;
|
|
293
295
|
/** Current execution mode (build/plan) */
|
|
@@ -1346,7 +1346,7 @@ export function useAutoResumeStatus(tabId, forceStopped) {
|
|
|
1346
1346
|
}, [clearAutoResume, forceStopped]);
|
|
1347
1347
|
return { isAutoResuming, clearAutoResume };
|
|
1348
1348
|
}
|
|
1349
|
-
const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateText, suggestions, dynamicSuggestions, threadFooterSlot, emptyStateAddon, showHeader = true, onSwitchToCli, className, apiUrl, tabId, browserTabId, threadId, contextScope, isActiveComposer = true, onMessageCountChange, onSaveThread, onGenerateTitle, composerSlot, onComposerTextChange, composerAreaClassName, composerPlaceholder, missingApiKeySetupLayout = "default", composerLayoutVariant = "default", centerComposerWhenEmpty = false, emptyStateDisplay = "default", composerToolbarSlot, composerExtraActionButton, composerDisabled = false, composerDisabledPlaceholder, isNewThread, onSlashCommand, execMode, onExecModeChange, approvalActions, planModeDisabled, planModeDisabledReason, selectedModel, defaultModel, selectedEngine, selectedEffort, availableModels, modelListLoading, onModelChange, onEffortChange, imageModelMenu, onForkChat, onConnectProvider, onConnectLocalRuntime, plusMenuMode = "full", providerStatusChecksEnabled = true, loadHistoryRepository, historyReloadKey, externalStreaming = false, agentChatSurface = "app", }, ref) {
|
|
1349
|
+
const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateText, suggestions, dynamicSuggestions, threadFooterSlot, emptyStateAddon, showHeader = true, onSwitchToCli, className, apiUrl, tabId, browserTabId, threadId, contextScope, isActiveComposer = true, onMessageCountChange, onSaveThread, onGenerateTitle, composerSlot, onComposerTextChange, composerAreaClassName, composerPlaceholder, missingApiKeySetupLayout = "default", composerLayoutVariant = "default", centerComposerWhenEmpty = false, emptyStateDisplay = "default", composerToolbarSlot, composerExtraActionButton, composerDisabled = false, composerDisabledPlaceholder, isNewThread, isThreadStateLoading, onSlashCommand, execMode, onExecModeChange, approvalActions, planModeDisabled, planModeDisabledReason, selectedModel, defaultModel, selectedEngine, selectedEffort, availableModels, modelListLoading, onModelChange, onEffortChange, imageModelMenu, onForkChat, onConnectProvider, onConnectLocalRuntime, plusMenuMode = "full", providerStatusChecksEnabled = true, loadHistoryRepository, historyReloadKey, externalStreaming = false, agentChatSurface = "app", }, ref) {
|
|
1350
1350
|
const thread = useThread();
|
|
1351
1351
|
const threadRuntime = useThreadRuntime();
|
|
1352
1352
|
const composerRuntime = useComposerRuntime();
|
|
@@ -2494,6 +2494,8 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2494
2494
|
// first, so what the user sees in the chat panel always matches what the
|
|
2495
2495
|
// history list (and the agent) sees on disk.
|
|
2496
2496
|
useEffect(() => {
|
|
2497
|
+
if (isThreadStateLoading)
|
|
2498
|
+
return;
|
|
2497
2499
|
if (hasRestoredRef.current)
|
|
2498
2500
|
return;
|
|
2499
2501
|
hasRestoredRef.current = true;
|
|
@@ -2613,6 +2615,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2613
2615
|
reconnectActiveRunForThread,
|
|
2614
2616
|
loadHistoryRepository,
|
|
2615
2617
|
isNewThread,
|
|
2618
|
+
isThreadStateLoading,
|
|
2616
2619
|
]);
|
|
2617
2620
|
useEffect(() => {
|
|
2618
2621
|
if (!loadHistoryRepository ||
|
|
@@ -31,19 +31,14 @@ export function ConnectBuilderCard({ configured: initialConfigured, builderEnabl
|
|
|
31
31
|
popupUrl: initialConnectUrl,
|
|
32
32
|
trackingSource: "connect_builder_card",
|
|
33
33
|
});
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
// the
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
? flow.configured
|
|
40
|
-
: initialConfigured;
|
|
41
|
-
const builderEnabled = flow.hasFetchedStatus
|
|
34
|
+
// Keep the server-rendered handoff state until a successful status response
|
|
35
|
+
// arrives. A transient status failure must not replace a valid Send CTA with
|
|
36
|
+
// the hook's initial disconnected defaults.
|
|
37
|
+
const configured = flow.statusResolved ? flow.configured : initialConfigured;
|
|
38
|
+
const builderEnabled = flow.statusResolved
|
|
42
39
|
? flow.builderEnabled
|
|
43
40
|
: initialBuilderEnabled;
|
|
44
|
-
const orgName = flow.
|
|
45
|
-
? flow.orgName
|
|
46
|
-
: (initialOrgName ?? null);
|
|
41
|
+
const orgName = flow.statusResolved ? flow.orgName : (initialOrgName ?? null);
|
|
47
42
|
const connecting = flow.connecting;
|
|
48
43
|
const [waitlistJoined, setWaitlistJoined] = useState(false);
|
|
49
44
|
const [joiningWaitlist, setJoiningWaitlist] = useState(false);
|
|
@@ -1780,7 +1780,7 @@ export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderO
|
|
|
1780
1780
|
else {
|
|
1781
1781
|
chatRefs.current.delete(tabId);
|
|
1782
1782
|
}
|
|
1783
|
-
}, threadId: tabId, tabId: tabId, browserTabId: browserTabId, isActiveComposer: tabId === activeThreadId, apiUrl: apiUrl, isNewThread: newThreadIds.current.has(tabId) || isNewThread(tabId), onMessageCountChange: (count) => setMessageCounts((prev) => prev[tabId] === count
|
|
1783
|
+
}, threadId: tabId, tabId: tabId, browserTabId: browserTabId, isActiveComposer: tabId === activeThreadId, apiUrl: apiUrl, isNewThread: newThreadIds.current.has(tabId) || isNewThread(tabId), isThreadStateLoading: isLoading, onMessageCountChange: (count) => setMessageCounts((prev) => prev[tabId] === count
|
|
1784
1784
|
? prev
|
|
1785
1785
|
: { ...prev, [tabId]: count }), onSaveThread: handleSaveThread, onGenerateTitle: handleGenerateTitle, onSlashCommand: handleSlashCommand, selectedModel: modelSelection?.model, selectedEngine: modelSelection?.engine, selectedEffort: modelSelection?.effort ?? DEFAULT_REASONING_EFFORT, composerSlot: props.composerSlot, defaultModel: defaultModel, availableModels: availableModels, modelListLoading: modelListLoading, onModelChange: handleModelChange, onEffortChange: handleEffortChange, onForkChat: () => handleForkChat(tabId),
|
|
1786
1786
|
// Sub-agent tabs are read-only: sending a new message from the
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function RuntimeConfigNotice(): import("react").JSX.Element | null;
|