@agent-native/core 0.141.7 → 0.144.0
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/agent-native.eject.json +9 -0
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/provider-api/SKILL.md +19 -0
- package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/analytics/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/analytics/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/analytics/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/analytics/AGENTS.md +35 -38
- package/corpus/templates/analytics/actions/ensure-native-v2-dashboards.ts +1 -1
- package/corpus/templates/analytics/actions/list-dashboard-usage-stats.ts +17 -22
- package/corpus/templates/analytics/actions/navigate.ts +4 -5
- package/corpus/templates/analytics/actions/provider-api-register.ts +50 -0
- package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +44 -11
- package/corpus/templates/analytics/actions/test-custom-api-connection.ts +106 -0
- package/corpus/templates/analytics/app/components/CustomApiCard.tsx +430 -0
- package/corpus/templates/analytics/app/i18n-data.ts +680 -0
- package/corpus/templates/analytics/app/lib/native-mcp-exclusions.ts +6 -0
- package/corpus/templates/analytics/app/lib/sql-query.ts +33 -6
- package/corpus/templates/analytics/app/pages/DataSources.tsx +4 -0
- package/corpus/templates/analytics/changelog/2026-08-06-analytics-dashboards-load-reliably-during-background-data-sw.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-analytics-dashboards-remain-responsive-while-historical-data.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-analytics-query-results-now-render-as-a-table-with-csv-downl.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-connect-public-https-custom-apis-and-hand-tested-endpoints-t.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-durable-agent-worker-memory.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-live-dashboard-panels-use-the-shared-query-timeout.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-on-demand-billing-is-available-as-a-native-dashboard-with-ta.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-visible-dashboard-names-are-unique.md +6 -0
- package/corpus/templates/analytics/netlify.toml +7 -0
- package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +4 -0
- package/corpus/templates/analytics/server/db/index.ts +27 -0
- package/corpus/templates/analytics/server/db/schema.ts +10 -0
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +227 -60
- package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +133 -44
- package/corpus/templates/analytics/server/lib/native-v2-dashboards.ts +227 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +5 -0
- package/corpus/templates/analytics/server/plugins/analytics-rollup-backfill-jobs.ts +1 -0
- package/corpus/templates/analytics/server/plugins/db.ts +52 -18
- package/corpus/templates/assets/.agents/skills/asset-generation/SKILL.md +28 -2
- package/corpus/templates/assets/.agents/skills/image-generation/SKILL.md +16 -1
- package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/assets/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/assets/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/assets/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/brain/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/brain/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/brain/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/brain/actions/list-connection-providers.ts +24 -3
- package/corpus/templates/brain/app/lib/dispatch-links.ts +44 -0
- package/corpus/templates/brain/app/routes/sources.tsx +15 -7
- package/corpus/templates/brain/changelog/2026-08-06-brain-provider-setup-links-open-dispatch-correctly-in-standa.md +6 -0
- package/corpus/templates/brain/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +26 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/calendar/AGENTS.md +11 -32
- package/corpus/templates/calendar/actions/update-event.ts +107 -1
- package/corpus/templates/calendar/app/components/calendar/EventCalendarSelect.tsx +83 -0
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +57 -0
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +59 -73
- package/corpus/templates/calendar/app/hooks/use-events.ts +4 -1
- package/corpus/templates/calendar/app/i18n-data.ts +20 -0
- package/corpus/templates/calendar/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
- package/corpus/templates/calendar/changelog/2026-08-06-existing-events-can-move-between-connected-google-account-ca.md +6 -0
- package/corpus/templates/calendar/server/lib/google-calendar.ts +101 -0
- package/corpus/templates/calendar/server/plugins/agent-chat.ts +7 -1
- package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/clips/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/clips/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/clips/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/clips/app/components/editor/editor-layout.tsx +9 -24
- package/corpus/templates/clips/app/components/editor/timeline-geometry.ts +15 -0
- package/corpus/templates/clips/app/components/editor/waveform.tsx +4 -17
- package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +14 -3
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +28 -38
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +21 -27
- package/corpus/templates/clips/changelog/2026-08-06-clips-recovers-from-stalled-recording-setup-without-requirin.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-06-clips-starts-faster-after-a-deploy-or-idle-period-startup-no.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-06-deleting-a-recording-returns-cleanly-to-the-library-and-fit-.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-06-hide-clip-insights-from-viewers-without-analytics-access.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +48 -20
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +275 -74
- package/corpus/templates/clips/desktop/src/lib/recording-start-guard.ts +84 -0
- package/corpus/templates/clips/desktop/src/overlays/toolbar.tsx +14 -4
- package/corpus/templates/clips/server/plugins/db.ts +214 -26
- package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/content/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/content/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/content/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/crm/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/crm/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/crm/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/crm/changelog/2026-08-06-crm-starts-faster-after-a-deploy-or-idle-period-one-time-dat.md +6 -0
- package/corpus/templates/crm/server/plugins/db.ts +11 -8
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +36 -1
- package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/design/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/design/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/design/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/design/actions/import-from-url.ts +1 -1
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +27 -18
- package/corpus/templates/design/app/pages/Index.tsx +6 -2
- package/corpus/templates/design/changelog/2026-08-05-deleting-a-design-from-the-home-page-no-longer-leaves-the-ap.md +6 -0
- package/corpus/templates/design/changelog/2026-08-05-renaming-a-layer-now-focuses-its-name-field-automatically.md +6 -0
- package/corpus/templates/design/server/plugins/agent-chat.ts +2 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/dispatch/changelog/2026-08-06-ready-workspace-apps-stay-one-click-away-in-a-compact-dispat.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-08-06-shared-vault-values-and-management-are-now-restricted-to-wor.md +6 -0
- package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/factory/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/factory/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/factory/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/forms/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/forms/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/forms/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/forms/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
- package/corpus/templates/forms/server/plugins/agent-chat.ts +4 -0
- package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/macros/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/macros/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/macros/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/mail/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/mail/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/mail/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/mail/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
- package/corpus/templates/mail/server/plugins/agent-chat.ts +6 -0
- package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/plan/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/plan/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/plan/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +48 -5
- package/corpus/templates/slides/.agents/skills/design-systems/SKILL.md +37 -1
- package/corpus/templates/slides/.agents/skills/image-generation-via-a2a/SKILL.md +6 -0
- package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +15 -2
- package/corpus/templates/slides/.agents/skills/slide-images/SKILL.md +29 -24
- package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/slides/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/slides/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/slides/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/slides/AGENTS.md +7 -9
- package/corpus/templates/slides/_gitignore +1 -0
- package/corpus/templates/slides/actions/export-pptx.ts +402 -36
- package/corpus/templates/slides/actions/import-file.ts +46 -85
- package/corpus/templates/slides/actions/import-google-slides-reference.ts +271 -12
- package/corpus/templates/slides/actions/import-pptx.ts +85 -60
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +10 -13
- package/corpus/templates/slides/app/components/editor/AddSlidePopover.tsx +5 -1
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +25 -12
- package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +112 -57
- package/corpus/templates/slides/app/components/editor/GoogleDriveConnectionCta.tsx +202 -0
- package/corpus/templates/slides/app/components/editor/GoogleSlidesReferenceImport.tsx +26 -14
- package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +173 -0
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +182 -141
- package/corpus/templates/slides/app/components/editor/canvas-interactions/index.ts +1 -0
- package/corpus/templates/slides/app/components/editor/canvas-interactions/slides-canvas-adapter.ts +18 -0
- package/corpus/templates/slides/app/components/editor/slide-text-targets.ts +85 -0
- package/corpus/templates/slides/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/slides/app/components/onboarding/FirstDeckOnboardingFlow.tsx +4 -0
- package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +27 -1
- package/corpus/templates/slides/app/i18n/en-US.ts +1 -0
- package/corpus/templates/slides/app/lib/create-deck-generation.ts +1 -1
- package/corpus/templates/slides/app/lib/deck-preview-frame.ts +15 -0
- package/corpus/templates/slides/app/lib/deck-share-links.ts +9 -0
- package/corpus/templates/slides/app/lib/export-pptx-client.ts +89 -0
- package/corpus/templates/slides/app/lib/slide-animation-elements.ts +3 -0
- package/corpus/templates/slides/app/pages/Index.tsx +91 -1
- package/corpus/templates/slides/changelog/2026-08-06-clicking-the-gray-canvas-around-a-slide-clears-its-selection.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-deck-thumbnails-keep-a-consistent-listing-frame-across-aspec.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-deep-linked-decks-open-directly-instead-of-being-interrupted.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-google-slides-exports-now-show-clear-import-steps-when-direc.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-import-pdf-google-slides-and-powerpoint-decks-directly-from-.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-imported-powerpoint-exports-keep-text-and-images-editable-an.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-presentation-prompts-continue-adding-rendered-slides-until-t.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-public-decks-now-share-read-only-presentation-links-by-defau.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-slides-offers-a-direct-connect-google-button-when-a-drive-co.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-slides-preserve-uploaded-pdf-layouts-accept-larger-reference.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-styled-words-stay-part-of-their-text-box-instead-of-becoming.md +6 -0
- package/corpus/templates/slides/server/handlers/google-docs-auth.ts +7 -20
- package/corpus/templates/slides/server/handlers/import/html-converter.ts +236 -13
- package/corpus/templates/slides/server/handlers/import/pptx-assets.ts +67 -0
- package/corpus/templates/slides/server/handlers/import/pptx-parser.ts +2 -0
- package/corpus/templates/slides/server/handlers/uploads.ts +7 -3
- package/corpus/templates/slides/server/lib/chat-attachments.ts +6 -3
- package/corpus/templates/slides/server/lib/emails.ts +7 -2
- package/corpus/templates/slides/server/lib/google-docs-error.ts +50 -0
- package/corpus/templates/slides/server/lib/google-docs-oauth.ts +1 -0
- package/corpus/templates/slides/server/lib/import-asset-storage.ts +127 -0
- package/corpus/templates/slides/server/plugins/agent-chat.ts +4 -3
- package/corpus/templates/slides/server/routes/api/import-assets/[token].get.ts +70 -0
- package/corpus/templates/slides/shared/upload-types.ts +3 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/agent/production-agent.d.ts +17 -0
- package/dist/agent/production-agent.js +72 -1
- package/dist/cli/agent-plugin.d.ts +112 -0
- package/dist/cli/agent-plugin.js +1081 -0
- package/dist/cli/app-skill.js +39 -1
- package/dist/cli/code-agent-executor.d.ts +3 -0
- package/dist/cli/code-agent-executor.js +51 -13
- package/dist/cli/index.js +13 -0
- package/dist/cli/templates-meta.js +1 -1
- package/dist/client/AgentPanel.d.ts +3 -1
- package/dist/client/AgentPanel.js +9 -2
- package/dist/client/AssistantChat.d.ts +8 -0
- package/dist/client/AssistantChat.js +23 -8
- package/dist/client/NewWorkspaceAppFlow.js +1 -0
- package/dist/client/agent-chat-adapter.js +123 -4
- package/dist/client/assistant-ui-recovery.d.ts +2 -1
- package/dist/client/assistant-ui-recovery.js +7 -3
- package/dist/client/onboarding/FirstRunOnboarding.js +11 -4
- package/dist/client/org/TeamPage.js +1 -1
- package/dist/client/require-session.js +1 -1
- package/dist/client/resources/McpConnectionSuggestion.d.ts +1 -0
- package/dist/client/resources/McpConnectionSuggestion.js +27 -10
- package/dist/client/resources/McpIntegrationDialog.js +77 -45
- package/dist/client/resources/mcp-integration-catalog.d.ts +13 -1
- package/dist/client/resources/mcp-integration-catalog.js +255 -2
- package/dist/client/resources/mcp-integration-logos.js +18 -2
- package/dist/client/settings/AccountSettingsCard.js +2 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/db/client.d.ts +9 -0
- package/dist/db/client.js +51 -16
- package/dist/db/create-get-db.js +2 -2
- package/dist/db/ddl-guard.d.ts +11 -10
- package/dist/db/ddl-guard.js +40 -12
- package/dist/deploy/build.d.ts +2 -0
- package/dist/deploy/build.js +97 -4
- package/dist/deploy/workspace-deploy.js +0 -2
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/guards/no-env-credentials.js +9 -0
- package/dist/ingestion/index.d.ts +1 -1
- package/dist/ingestion/pptx.d.ts +68 -0
- package/dist/ingestion/pptx.js +660 -213
- package/dist/integrations/plugin.js +9 -6
- package/dist/localization/default-messages.d.ts +54 -0
- package/dist/localization/default-messages.js +57 -2
- package/dist/mcp/screen-memory-stdio.d.ts +7 -7
- package/dist/mcp-client/oauth-routes.d.ts +2 -0
- package/dist/mcp-client/oauth-routes.js +73 -6
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/onboarding/app-profile.js +11 -0
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/resources/store.js +15 -1
- package/dist/scripts/call-agent.js +34 -4
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-chat/action-filters-a2a.d.ts +1 -1
- package/dist/server/agent-chat/action-filters-a2a.js +36 -1
- package/dist/server/agent-chat-plugin.js +29 -8
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/auth.js +47 -11
- package/dist/server/better-auth-instance.js +5 -3
- package/dist/server/core-routes-plugin.d.ts +8 -1
- package/dist/server/core-routes-plugin.js +28 -3
- package/dist/server/credential-provider.d.ts +3 -3
- package/dist/server/credential-provider.js +90 -4
- package/dist/server/onboarding-html.d.ts +2 -0
- package/dist/server/onboarding-html.js +115 -29
- package/dist/server/self-dispatch.d.ts +5 -4
- package/dist/server/self-dispatch.js +25 -14
- package/dist/server/ssr-handler.d.ts +1 -1
- package/dist/server/ssr-handler.js +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/cache-control.d.ts +26 -2
- package/dist/shared/cache-control.js +43 -2
- package/dist/shared/password-policy.d.ts +3 -0
- package/dist/shared/password-policy.js +3 -0
- package/dist/sharing/actions/set-resource-visibility.js +16 -4
- package/dist/sharing/registry.d.ts +14 -0
- package/dist/styles/agent-native.css +6 -0
- package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/dist/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/dist/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/dist/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/dist/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/dist/templates/default/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/dist/templates/default/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/dist/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/dist/templates/headless/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/dist/templates/headless/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +6 -0
- package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +51 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/templates/workspace-root/AGENTS.md +7 -0
- package/dist/user-profile/actions/change-password.js +8 -3
- package/dist/user-profile/actions/set-password.js +5 -1
- package/dist/vite/action-types-plugin.js +59 -0
- package/docs/content/skills-guide.mdx +13 -0
- package/package.json +6 -2
- package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/src/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/src/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/src/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/src/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/src/templates/default/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/src/templates/default/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/src/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/src/templates/headless/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/src/templates/headless/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/src/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +6 -0
- package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +51 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/src/templates/workspace-root/AGENTS.md +7 -0
package/dist/cli/app-skill.js
CHANGED
|
@@ -11,6 +11,7 @@ import { createHash } from "node:crypto";
|
|
|
11
11
|
import fs from "node:fs";
|
|
12
12
|
import os from "node:os";
|
|
13
13
|
import path from "node:path";
|
|
14
|
+
import { AGENT_PLUGIN_MCP_SCHEMA, AGENT_PLUGIN_SCHEMA, } from "./agent-plugin.js";
|
|
14
15
|
import { resolveClients, supportsRemoteMcpOAuth, writeConfigs, } from "./connect.js";
|
|
15
16
|
import { buildHttpMcpEntry, removeSameUrlDuplicatesForClient, } from "./mcp-config-writers.js";
|
|
16
17
|
const HELP = `agent-native app-skill
|
|
@@ -23,7 +24,7 @@ Usage:
|
|
|
23
24
|
Commands:
|
|
24
25
|
ensure Register the app skill MCP connector for your local agent clients.
|
|
25
26
|
launch Open the hosted app, or materialize and start a local editable app.
|
|
26
|
-
pack Create marketplace-ready skill, MCP,
|
|
27
|
+
pack Create a standard Agent Plugin plus marketplace-ready skill, MCP, and host adapters.
|
|
27
28
|
|
|
28
29
|
Hosted is the default. Use --local when you want editable source, offline work,
|
|
29
30
|
or a privacy-sensitive local app instance.`;
|
|
@@ -449,6 +450,39 @@ function mcpServerConfig(manifest, serverName) {
|
|
|
449
450
|
mcpServers: Object.fromEntries(mcpServerNames(manifest, serverName).map((name) => [name, entry])),
|
|
450
451
|
};
|
|
451
452
|
}
|
|
453
|
+
function standardAgentPluginManifest(manifest, version) {
|
|
454
|
+
return {
|
|
455
|
+
$schema: AGENT_PLUGIN_SCHEMA,
|
|
456
|
+
name: pluginName(manifest),
|
|
457
|
+
version,
|
|
458
|
+
description: manifest.description,
|
|
459
|
+
author: {
|
|
460
|
+
name: "Agent-Native",
|
|
461
|
+
url: "https://agent-native.com",
|
|
462
|
+
},
|
|
463
|
+
homepage: manifest.hosted.url,
|
|
464
|
+
repository: "https://github.com/BuilderIO/agent-native",
|
|
465
|
+
license: "MIT",
|
|
466
|
+
keywords: [
|
|
467
|
+
"agent-native",
|
|
468
|
+
manifest.id,
|
|
469
|
+
"mcp",
|
|
470
|
+
"skills",
|
|
471
|
+
"app-backed-skill",
|
|
472
|
+
],
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
function standardAgentPluginMcpConfig(manifest) {
|
|
476
|
+
return {
|
|
477
|
+
$schema: AGENT_PLUGIN_MCP_SCHEMA,
|
|
478
|
+
mcpServers: {
|
|
479
|
+
[manifest.mcp.serverName]: {
|
|
480
|
+
type: "streamable-http",
|
|
481
|
+
url: manifest.hosted.mcpUrl,
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
};
|
|
485
|
+
}
|
|
452
486
|
function pluginName(manifest) {
|
|
453
487
|
return `agent-native-${manifest.id}`;
|
|
454
488
|
}
|
|
@@ -691,6 +725,8 @@ export function buildAppSkillPack(loaded, outDir) {
|
|
|
691
725
|
}
|
|
692
726
|
: manifest;
|
|
693
727
|
writeJson(path.join(target, "agent-native.app-skill.json"), packedManifest);
|
|
728
|
+
writeJson(path.join(target, "plugin.json"), standardAgentPluginManifest(manifest, pluginVersion));
|
|
729
|
+
writeJson(path.join(target, "mcp.json"), standardAgentPluginMcpConfig(manifest));
|
|
694
730
|
if (appSource) {
|
|
695
731
|
copyDirFiltered(appSource, path.join(target, "app"));
|
|
696
732
|
}
|
|
@@ -699,6 +735,8 @@ export function buildAppSkillPack(loaded, outDir) {
|
|
|
699
735
|
copySkill(loaded.dir, skill, path.join(target, "skills"));
|
|
700
736
|
const files = [
|
|
701
737
|
path.join(target, "agent-native.app-skill.json"),
|
|
738
|
+
path.join(target, "plugin.json"),
|
|
739
|
+
path.join(target, "mcp.json"),
|
|
702
740
|
...(appSource ? [path.join(target, "app")] : []),
|
|
703
741
|
...exportedSkillNames.map((name) => path.join(target, "skills", name, "SKILL.md")),
|
|
704
742
|
];
|
|
@@ -13,10 +13,13 @@ export interface ExecuteCodeAgentRunOptions {
|
|
|
13
13
|
reasoningEffort?: ReasoningEffort;
|
|
14
14
|
attachments?: AgentPromptAttachment[];
|
|
15
15
|
stdout?: NodeJS.WritableStream;
|
|
16
|
+
/** Keep tool output in transcript events when the caller has a structured UI. */
|
|
17
|
+
streamToolOutputToStdout?: boolean;
|
|
16
18
|
signal?: AbortSignal;
|
|
17
19
|
}
|
|
18
20
|
interface CodeAgentApprovalExecutionOptions {
|
|
19
21
|
stdout?: NodeJS.WritableStream;
|
|
22
|
+
streamToolOutputToStdout?: boolean;
|
|
20
23
|
signal?: AbortSignal;
|
|
21
24
|
}
|
|
22
25
|
export declare function executeCodeAgentRun(options: ExecuteCodeAgentRunOptions): Promise<CodeAgentRunRecord | null>;
|
|
@@ -37,6 +37,8 @@ export async function executeCodeAgentRun(options) {
|
|
|
37
37
|
const existing = getCodeAgentRunRecord(options.runId);
|
|
38
38
|
if (!existing)
|
|
39
39
|
return null;
|
|
40
|
+
const streamToolOutputToStdout = options.streamToolOutputToStdout ??
|
|
41
|
+
process.env.AGENT_NATIVE_CODE_AGENT_STRUCTURED_STDOUT !== "1";
|
|
40
42
|
const prompt = options.prompt ?? latestUserPrompt(existing.id);
|
|
41
43
|
const rawAttachments = options.attachments ?? latestUserPromptAttachments(existing.id, prompt);
|
|
42
44
|
// Split attachments: images (dataUrl) go as engine image parts; text/file
|
|
@@ -102,13 +104,16 @@ export async function executeCodeAgentRun(options) {
|
|
|
102
104
|
model: options.model ?? metadataString(existing, "model"),
|
|
103
105
|
permissionMode: existing.permissionMode ?? "full-auto",
|
|
104
106
|
stdout: options.stdout,
|
|
107
|
+
streamToolOutputToStdout,
|
|
105
108
|
signal: options.signal,
|
|
106
109
|
});
|
|
107
110
|
}
|
|
108
111
|
const engine = options.engine ?? (await resolveExecutorEngine(requestedEngine));
|
|
109
112
|
if (!engine) {
|
|
110
113
|
const message = "No LLM provider key was found. Set ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY, another supported provider key, or run `codex login` to use Codex CLI.";
|
|
111
|
-
|
|
114
|
+
if (streamToolOutputToStdout) {
|
|
115
|
+
options.stdout?.write(`${message}\n`);
|
|
116
|
+
}
|
|
112
117
|
appendCodeAgentTranscriptEvent({
|
|
113
118
|
runId: existing.id,
|
|
114
119
|
kind: "status",
|
|
@@ -145,8 +150,11 @@ export async function executeCodeAgentRun(options) {
|
|
|
145
150
|
// Both "start" and "done" phases update the map; done has richer data.
|
|
146
151
|
pendingToolMeta.set(toolName, meta);
|
|
147
152
|
}, (chunk) => {
|
|
148
|
-
//
|
|
149
|
-
|
|
153
|
+
// Structured desktop transcripts render tool output separately from
|
|
154
|
+
// assistant text. Keep the legacy terminal stream opt-in for them.
|
|
155
|
+
if (streamToolOutputToStdout) {
|
|
156
|
+
options.stdout?.write(chunk);
|
|
157
|
+
}
|
|
150
158
|
}, toolProfile);
|
|
151
159
|
const mcpManager = toolProfile
|
|
152
160
|
? null
|
|
@@ -285,7 +293,9 @@ export async function executeCodeAgentRun(options) {
|
|
|
285
293
|
}
|
|
286
294
|
await outputSmoother.flush();
|
|
287
295
|
if (assistantText.trim()) {
|
|
288
|
-
|
|
296
|
+
if (streamToolOutputToStdout) {
|
|
297
|
+
options.stdout?.write("\n");
|
|
298
|
+
}
|
|
289
299
|
appendCodeAgentTranscriptEvent({
|
|
290
300
|
runId: existing.id,
|
|
291
301
|
kind: "system",
|
|
@@ -301,7 +311,9 @@ export async function executeCodeAgentRun(options) {
|
|
|
301
311
|
const approvalPending = getPendingApproval(existing.id);
|
|
302
312
|
if (approvalPending) {
|
|
303
313
|
const message = `Agent-Native Code run paused for approval: ${approvalPending.reason}`;
|
|
304
|
-
|
|
314
|
+
if (streamToolOutputToStdout) {
|
|
315
|
+
options.stdout?.write(`\n${message}\n`);
|
|
316
|
+
}
|
|
305
317
|
appendCodeAgentTranscriptEvent({
|
|
306
318
|
runId: existing.id,
|
|
307
319
|
kind: "status",
|
|
@@ -382,7 +394,9 @@ export async function executeCodeAgentRun(options) {
|
|
|
382
394
|
catch (err) {
|
|
383
395
|
await outputSmoother.flush().catch(() => undefined);
|
|
384
396
|
const message = err instanceof Error ? err.message : String(err);
|
|
385
|
-
|
|
397
|
+
if (streamToolOutputToStdout) {
|
|
398
|
+
options.stdout?.write(`\nAgent-Native Code run failed: ${message}\n`);
|
|
399
|
+
}
|
|
386
400
|
appendCodeAgentTranscriptEvent({
|
|
387
401
|
runId: existing.id,
|
|
388
402
|
kind: "status",
|
|
@@ -426,6 +440,8 @@ async function executeCodexCliRun(options) {
|
|
|
426
440
|
const outputDir = fs.mkdtempSync(path.join(os.tmpdir(), "agent-native-code-codex-"));
|
|
427
441
|
const outputPath = path.join(outputDir, "last-message.txt");
|
|
428
442
|
const model = normalizeCodexCliModel(options.model);
|
|
443
|
+
const streamToolOutputToStdout = options.streamToolOutputToStdout ??
|
|
444
|
+
process.env.AGENT_NATIVE_CODE_AGENT_STRUCTURED_STDOUT !== "1";
|
|
429
445
|
const args = [
|
|
430
446
|
"--ask-for-approval",
|
|
431
447
|
"never",
|
|
@@ -459,6 +475,7 @@ async function executeCodexCliRun(options) {
|
|
|
459
475
|
cwd,
|
|
460
476
|
prompt: buildCodexCliPrompt(options.run, options.prompt),
|
|
461
477
|
stdout: options.stdout,
|
|
478
|
+
streamToolOutputToStdout,
|
|
462
479
|
signal: options.signal,
|
|
463
480
|
});
|
|
464
481
|
if (result.exitCode !== 0) {
|
|
@@ -469,7 +486,9 @@ async function executeCodexCliRun(options) {
|
|
|
469
486
|
const summary = interrupted
|
|
470
487
|
? "Codex CLI run paused."
|
|
471
488
|
: `Codex CLI run failed: ${message}`;
|
|
472
|
-
|
|
489
|
+
if (streamToolOutputToStdout) {
|
|
490
|
+
options.stdout?.write(`\n${summary}\n`);
|
|
491
|
+
}
|
|
473
492
|
appendCodeAgentTranscriptEvent({
|
|
474
493
|
runId: options.run.id,
|
|
475
494
|
kind: "status",
|
|
@@ -546,6 +565,7 @@ async function executeCodexCliRun(options) {
|
|
|
546
565
|
userPromptAttachmentsForEvent(options.run.id, pendingFollowUp.eventId),
|
|
547
566
|
appendUserEvent: false,
|
|
548
567
|
stdout: options.stdout,
|
|
568
|
+
streamToolOutputToStdout: options.streamToolOutputToStdout,
|
|
549
569
|
signal: options.signal,
|
|
550
570
|
});
|
|
551
571
|
}
|
|
@@ -610,7 +630,9 @@ function runCodexCliProcess(options) {
|
|
|
610
630
|
child.stdout?.on("data", (chunk) => {
|
|
611
631
|
const text = chunk.toString();
|
|
612
632
|
stdout += text;
|
|
613
|
-
options.
|
|
633
|
+
if (options.streamToolOutputToStdout ?? true) {
|
|
634
|
+
options.stdout?.write(text);
|
|
635
|
+
}
|
|
614
636
|
});
|
|
615
637
|
child.stderr?.on("data", (chunk) => {
|
|
616
638
|
stderr += chunk.toString();
|
|
@@ -702,14 +724,20 @@ export async function executePendingCodeAgentApproval(runId, options = {}) {
|
|
|
702
724
|
if (!record)
|
|
703
725
|
return null;
|
|
704
726
|
const approval = getPendingApproval(runId);
|
|
727
|
+
const streamToolOutputToStdout = options.streamToolOutputToStdout ??
|
|
728
|
+
process.env.AGENT_NATIVE_CODE_AGENT_STRUCTURED_STDOUT !== "1";
|
|
705
729
|
if (!approval) {
|
|
706
|
-
|
|
730
|
+
if (streamToolOutputToStdout) {
|
|
731
|
+
options.stdout?.write("No pending approval was found for this run.\n");
|
|
732
|
+
}
|
|
707
733
|
return record;
|
|
708
734
|
}
|
|
709
735
|
const permission = classifyCodeAgentCommandPermission(approval.command);
|
|
710
736
|
if (permission.kind === "forbidden") {
|
|
711
737
|
const message = `Approval cannot run forbidden command: ${permission.reason}`;
|
|
712
|
-
|
|
738
|
+
if (streamToolOutputToStdout) {
|
|
739
|
+
options.stdout?.write(`${message}\n`);
|
|
740
|
+
}
|
|
713
741
|
appendCodeAgentTranscriptEvent({
|
|
714
742
|
runId,
|
|
715
743
|
kind: "status",
|
|
@@ -746,7 +774,9 @@ export async function executePendingCodeAgentApproval(runId, options = {}) {
|
|
|
746
774
|
]
|
|
747
775
|
.filter(Boolean)
|
|
748
776
|
.join("\n\n"), MAX_TOOL_OUTPUT_CHARS);
|
|
749
|
-
|
|
777
|
+
if (streamToolOutputToStdout) {
|
|
778
|
+
options.stdout?.write(`${summary}\n`);
|
|
779
|
+
}
|
|
750
780
|
appendCodeAgentTranscriptEvent({
|
|
751
781
|
runId,
|
|
752
782
|
kind: "status",
|
|
@@ -782,6 +812,7 @@ export async function executePendingCodeAgentApproval(runId, options = {}) {
|
|
|
782
812
|
});
|
|
783
813
|
return executeExistingCodeAgentRun(runId, {
|
|
784
814
|
stdout: options.stdout,
|
|
815
|
+
streamToolOutputToStdout,
|
|
785
816
|
signal: options.signal,
|
|
786
817
|
});
|
|
787
818
|
}
|
|
@@ -795,12 +826,18 @@ export async function executeDenyCodeAgentApproval(runId, options = {}) {
|
|
|
795
826
|
if (!record)
|
|
796
827
|
return null;
|
|
797
828
|
const approval = getPendingApproval(runId);
|
|
829
|
+
const streamToolOutputToStdout = options.streamToolOutputToStdout ??
|
|
830
|
+
process.env.AGENT_NATIVE_CODE_AGENT_STRUCTURED_STDOUT !== "1";
|
|
798
831
|
if (!approval) {
|
|
799
|
-
|
|
832
|
+
if (streamToolOutputToStdout) {
|
|
833
|
+
options.stdout?.write("No pending approval was found for this run.\n");
|
|
834
|
+
}
|
|
800
835
|
return record;
|
|
801
836
|
}
|
|
802
837
|
const message = `User denied command: ${approval.command} (${approval.reason})`;
|
|
803
|
-
|
|
838
|
+
if (streamToolOutputToStdout) {
|
|
839
|
+
options.stdout?.write(`${message}\n`);
|
|
840
|
+
}
|
|
804
841
|
appendCodeAgentTranscriptEvent({
|
|
805
842
|
runId,
|
|
806
843
|
kind: "status",
|
|
@@ -833,6 +870,7 @@ export async function executeDenyCodeAgentApproval(runId, options = {}) {
|
|
|
833
870
|
});
|
|
834
871
|
return executeExistingCodeAgentRun(runId, {
|
|
835
872
|
stdout: options.stdout,
|
|
873
|
+
streamToolOutputToStdout,
|
|
836
874
|
signal: options.signal,
|
|
837
875
|
});
|
|
838
876
|
}
|
package/dist/cli/index.js
CHANGED
|
@@ -882,6 +882,17 @@ switch (command) {
|
|
|
882
882
|
});
|
|
883
883
|
break;
|
|
884
884
|
}
|
|
885
|
+
case "plugin": {
|
|
886
|
+
// Import a standard Agent Plugin's Skills and remote MCP entries into the
|
|
887
|
+
// current Agent-Native workspace.
|
|
888
|
+
import("./agent-plugin.js")
|
|
889
|
+
.then((m) => m.runAgentPlugin(args))
|
|
890
|
+
.catch((err) => {
|
|
891
|
+
console.error(err?.message ?? err);
|
|
892
|
+
process.exit(1);
|
|
893
|
+
});
|
|
894
|
+
break;
|
|
895
|
+
}
|
|
885
896
|
case "skills": {
|
|
886
897
|
// Friendly skill install surface. Wraps open skills installation plus MCP.
|
|
887
898
|
import("./skills.js")
|
|
@@ -1118,6 +1129,8 @@ Usage:
|
|
|
1118
1129
|
reinstalling app skills/connectors.
|
|
1119
1130
|
agent-native app-skill <cmd> Install, launch, or package app-backed skills.
|
|
1120
1131
|
cmds: ensure | launch | pack
|
|
1132
|
+
agent-native plugin import <path> [--into <workspace>] [--yes] [--force]
|
|
1133
|
+
Import standard Agent Plugin Skills and remote MCP servers.
|
|
1121
1134
|
agent-native skills add assets|content|design-exploration|visual-edit|visual-plan|visual-recap|context-xray
|
|
1122
1135
|
Install the skill instructions, register the MCP
|
|
1123
1136
|
connector, AND authenticate it in one step.
|
|
@@ -69,7 +69,7 @@ export const TEMPLATES = [
|
|
|
69
69
|
{
|
|
70
70
|
name: "analytics",
|
|
71
71
|
label: "Analytics",
|
|
72
|
-
hint: "Agent-native
|
|
72
|
+
hint: "Agent-native provider analytics - connect data sources, prompt for charts and deep dives",
|
|
73
73
|
icon: "BarChart2",
|
|
74
74
|
color: "#F59E0B",
|
|
75
75
|
colorRgb: "245 158 11",
|
|
@@ -186,12 +186,14 @@ export interface AgentSidebarProps {
|
|
|
186
186
|
threadUrlSync?: MultiTabAssistantChatProps["threadUrlSync"];
|
|
187
187
|
/** Optional link shown in Resources and Settings modes for the full Agent page. */
|
|
188
188
|
agentPageHref?: string;
|
|
189
|
+
/** Suppress first-run onboarding while a deep-linked resource is open. */
|
|
190
|
+
suppressFirstRunOnboarding?: boolean;
|
|
189
191
|
}
|
|
190
192
|
/**
|
|
191
193
|
* Wraps app content with a toggleable agent sidebar.
|
|
192
194
|
* Use AgentToggleButton in your header to open/close it.
|
|
193
195
|
*/
|
|
194
|
-
export declare function AgentSidebar({ children, emptyStateText, suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position, defaultOpen, animateMobile, animateDesktop, chatViewTransition, chatViewTransitionHandoff, storageKey, openOnChatRunning, onFullscreenRequest, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, }: AgentSidebarProps): React.JSX.Element;
|
|
196
|
+
export declare function AgentSidebar({ children, emptyStateText, suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position, defaultOpen, animateMobile, animateDesktop, chatViewTransition, chatViewTransitionHandoff, storageKey, openOnChatRunning, onFullscreenRequest, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, suppressFirstRunOnboarding, }: AgentSidebarProps): React.JSX.Element;
|
|
195
197
|
/**
|
|
196
198
|
* Focus the agent chat composer input.
|
|
197
199
|
* Opens the sidebar if closed, then focuses the text input.
|
|
@@ -879,6 +879,12 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
879
879
|
`[data-agent-fullscreen='true'] .agent-composer-area,` +
|
|
880
880
|
`[data-agent-fullscreen='true'] .agent-plan-mode-callout{` +
|
|
881
881
|
`max-width:${FULLSCREEN_CHAT_COLUMN_MAX_PX}px;` +
|
|
882
|
+
`margin-left:auto;margin-right:auto;width:100%;}` +
|
|
883
|
+
`[data-agent-fullscreen='true'] .agent-composer-area:not(.agent-composer-area--compact){` +
|
|
884
|
+
`padding-left:0;padding-right:0;}` +
|
|
885
|
+
`[data-agent-fullscreen='true'] .agent-mcp-connection-suggestion--composer,` +
|
|
886
|
+
`[data-agent-fullscreen='true'] .agent-mcp-connection-suggestion-error--composer{` +
|
|
887
|
+
`max-width:${FULLSCREEN_CHAT_COLUMN_MAX_PX}px;` +
|
|
882
888
|
`margin-left:auto;margin-right:auto;width:100%;}`,
|
|
883
889
|
} }), SHOW_ONBOARDING && mounted && (_jsx(Suspense, { fallback: null, children: _jsx(OnboardingPanel, {}) })), showFirstRunOnboarding && mounted && !insideAgentSidebar && (_jsx(Suspense, { fallback: null, children: _jsx(FirstRunOnboarding, {}) })), _jsx("div", { className: cn("flex flex-col min-h-0", mode === "chat" ? "flex-1" : "shrink-0"), children: mounted && (_jsx(Suspense, { fallback: _jsx(ChatLoadingSkeleton, { renderHeader: showHeader ? renderChatHeader : undefined, centerComposerWhenEmpty: assistantChatProps.centerComposerWhenEmpty, composerSlot: assistantChatProps.composerSlot, composerAreaClassName: assistantChatProps.composerAreaClassName, composerLayoutVariant: assistantChatProps.composerLayoutVariant }), children: _jsx(MultiTabAssistantChatLazy, { ...assistantChatProps, agentChatSurface: effectiveAgentChatSurface, apiUrl: apiUrl, showHeader: false, renderHeader: showHeader ? renderChatHeader : undefined, showTabBar: showTabBar, renderOverlay: showPageNewChatButton && !showHeader
|
|
884
890
|
? renderPageChatOverlay
|
|
@@ -1319,9 +1325,10 @@ export function AgentChatSurface({ mode = "panel", className, defaultMode = "cha
|
|
|
1319
1325
|
* Wraps app content with a toggleable agent sidebar.
|
|
1320
1326
|
* Use AgentToggleButton in your header to open/close it.
|
|
1321
1327
|
*/
|
|
1322
|
-
export function AgentSidebar({ children, emptyStateText = "How can I help you?", suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position = "right", defaultOpen = false, animateMobile = true, animateDesktop = true, chatViewTransition = false, chatViewTransitionHandoff = false, storageKey, openOnChatRunning = false, onFullscreenRequest, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, }) {
|
|
1328
|
+
export function AgentSidebar({ children, emptyStateText = "How can I help you?", suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position = "right", defaultOpen = false, animateMobile = true, animateDesktop = true, chatViewTransition = false, chatViewTransitionHandoff = false, storageKey, openOnChatRunning = false, onFullscreenRequest, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, suppressFirstRunOnboarding = false, }) {
|
|
1323
1329
|
const onboardingPreviewMode = useOnboardingPreviewMode();
|
|
1324
|
-
const showFirstRunOnboarding =
|
|
1330
|
+
const showFirstRunOnboarding = !suppressFirstRunOnboarding &&
|
|
1331
|
+
(SHOW_FIRST_RUN_ONBOARDING || onboardingPreviewMode);
|
|
1325
1332
|
const initialWidth = defaultSidebarWidth ?? sidebarWidth ?? 380;
|
|
1326
1333
|
const [open, setOpen] = useState(() => openOnChatRunning || getInitialAgentSidebarOpen(defaultOpen, storageKey));
|
|
1327
1334
|
const [presentationMode, setPresentationMode] = useState(false);
|
|
@@ -14,6 +14,14 @@ import { type ContentPart } from "./sse-event-processor.js";
|
|
|
14
14
|
import type { ChatThreadScope, ChatThreadSnapshot } from "./use-chat-threads.js";
|
|
15
15
|
export { AssistantMessageListErrorBoundary, AssistantUiStaleIndexErrorBoundary, assistantUiRecoverableRenderErrorKind, isAssistantUiRecoverableRenderError, isAssistantUiStaleIndexError, } from "./assistant-ui-recovery.js";
|
|
16
16
|
export { displayableUserMessageText } from "./chat/message-components.js";
|
|
17
|
+
type AssistantUiMessageResourceShape = {
|
|
18
|
+
id: string;
|
|
19
|
+
content: readonly unknown[];
|
|
20
|
+
attachments?: readonly {
|
|
21
|
+
id: string;
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
export declare function assistantUiMessageListStructureKey(messages: readonly AssistantUiMessageResourceShape[]): string;
|
|
17
25
|
export type AgentRequestMode = "act" | "plan";
|
|
18
26
|
export type AgentRecoveryAction = "continue" | "retry";
|
|
19
27
|
export interface AssistantChatSendOptions {
|
|
@@ -29,7 +29,6 @@ import { MessageScroller, MessageScrollerContent, MessageScrollerItem, MessageSc
|
|
|
29
29
|
import { Popover, PopoverContent, PopoverTrigger, } from "./components/ui/popover.js";
|
|
30
30
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./components/ui/tooltip.js";
|
|
31
31
|
import { AgentComposerFrame, TiptapComposer, } from "./composer/index.js";
|
|
32
|
-
import { ContextMeter } from "./context-xray/ContextMeter.js";
|
|
33
32
|
import { useNearBottomAutoscroll } from "./conversation/index.js";
|
|
34
33
|
import { useAgentDynamicSuggestionsResult, } from "./dynamic-suggestions.js";
|
|
35
34
|
import { GuidedQuestionFlow, useGuidedQuestionFlow, } from "./guided-questions.js";
|
|
@@ -44,6 +43,21 @@ import { cn } from "./utils.js";
|
|
|
44
43
|
export { AssistantMessageListErrorBoundary, AssistantUiStaleIndexErrorBoundary, assistantUiRecoverableRenderErrorKind, isAssistantUiRecoverableRenderError, isAssistantUiStaleIndexError, } from "./assistant-ui-recovery.js";
|
|
45
44
|
export { displayableUserMessageText } from "./chat/message-components.js";
|
|
46
45
|
const useBrowserLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
46
|
+
export function assistantUiMessageListStructureKey(messages) {
|
|
47
|
+
return JSON.stringify(messages.map((message) => [
|
|
48
|
+
message.id,
|
|
49
|
+
message.content.map((part, index) => {
|
|
50
|
+
const partObject = typeof part === "object" && part !== null ? part : null;
|
|
51
|
+
const toolCallId = partObject && "toolCallId" in partObject
|
|
52
|
+
? partObject.toolCallId
|
|
53
|
+
: undefined;
|
|
54
|
+
return typeof toolCallId === "string"
|
|
55
|
+
? `toolCallId-${toolCallId}`
|
|
56
|
+
: `index-${index}`;
|
|
57
|
+
}),
|
|
58
|
+
(message.attachments ?? []).map((attachment) => attachment.id),
|
|
59
|
+
]));
|
|
60
|
+
}
|
|
47
61
|
export function createUserMessageRunConfig(references, requestMode, recoveryAction, trackInRunsTray, approvedToolCalls, queuedMessageId, hideUserMessage, modelSnapshot) {
|
|
48
62
|
const custom = {};
|
|
49
63
|
if (modelSnapshot?.model)
|
|
@@ -1354,7 +1368,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1354
1368
|
scope: contextScope,
|
|
1355
1369
|
enabled: messages.length === 0,
|
|
1356
1370
|
});
|
|
1357
|
-
const messageListResetKey =
|
|
1371
|
+
const messageListResetKey = assistantUiMessageListStructureKey(messages);
|
|
1358
1372
|
// Chat-wide drag-and-drop: users expect to drop a file anywhere on the agent
|
|
1359
1373
|
// sidebar (thread, header, composer) and have it attach — same as ChatGPT,
|
|
1360
1374
|
// Claude.ai, Linear, Slack, etc. Tiptap's own `handleDrop` only fires inside
|
|
@@ -3845,8 +3859,6 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
3845
3859
|
!isComposerDisabled &&
|
|
3846
3860
|
!showRunningInUI;
|
|
3847
3861
|
const canImplementPlan = showPlanModeCallout && latestAssistantWasPlan;
|
|
3848
|
-
const contextXRayEnabled = Boolean(threadId &&
|
|
3849
|
-
(messages.length > 0 || isReconnecting || reconnectContent.length > 0));
|
|
3850
3862
|
const handleImplementPlan = useCallback(() => {
|
|
3851
3863
|
onExecModeChange?.("build");
|
|
3852
3864
|
void addToQueue("Implement the plan.", undefined, undefined, undefined, "act");
|
|
@@ -3997,10 +4009,14 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
3997
4009
|
return;
|
|
3998
4010
|
}
|
|
3999
4011
|
void addToQueue(suggestion);
|
|
4000
|
-
}, className: "w-full px-2 py-1 text-center text-[13px] text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", children: suggestion }, suggestion))) })) : null, showInlineEmptyThreadFooterSlot ? (_jsx("div", { className: "agent-thread-footer-slot agent-thread-footer-slot--empty", children: resolvedThreadFooterSlot })) : null] })) : (_jsxs(MessageScrollerContent, { className: "agent-thread-content gap-4 px-4 py-4", children: [_jsx(AssistantMessageListErrorBoundary, { resetKey: messageListResetKey, children: _jsx(ThreadPrimitive.Messages
|
|
4012
|
+
}, className: "w-full px-2 py-1 text-center text-[13px] text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", children: suggestion }, suggestion))) })) : null, showInlineEmptyThreadFooterSlot ? (_jsx("div", { className: "agent-thread-footer-slot agent-thread-footer-slot--empty", children: resolvedThreadFooterSlot })) : null] })) : (_jsxs(MessageScrollerContent, { className: "agent-thread-content gap-4 px-4 py-4", children: [_jsx(AssistantMessageListErrorBoundary, { resetKey: messageListResetKey, children: _jsx(ThreadPrimitive.Messages
|
|
4013
|
+
// assistant-ui indexes message parts through tap resources.
|
|
4014
|
+
// Keep this key tied to that shape so clear/add transitions remount stale
|
|
4015
|
+
// lookups without remounting on every streamed text update.
|
|
4016
|
+
, { components: {
|
|
4001
4017
|
UserMessage: AssistantChatUserMessageItem,
|
|
4002
4018
|
AssistantMessage: AssistantChatAssistantMessageItem,
|
|
4003
|
-
} }) }), visibleLoopLimit && !showRunningInUI && (_jsx(MessageScrollerItem, { children: _jsx(LoopLimitContinueCard, { info: visibleLoopLimit, onContinue: () => {
|
|
4019
|
+
} }, messageListResetKey) }), visibleLoopLimit && !showRunningInUI && (_jsx(MessageScrollerItem, { children: _jsx(LoopLimitContinueCard, { info: visibleLoopLimit, onContinue: () => {
|
|
4004
4020
|
setShowContinue(false);
|
|
4005
4021
|
setLoopLimitInfo(null);
|
|
4006
4022
|
addToQueue("Continue from where you left off.", undefined, undefined, undefined, undefined, "queued", "continue");
|
|
@@ -4063,8 +4079,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
4063
4079
|
isRunning,
|
|
4064
4080
|
requestedIntent: options?.intent,
|
|
4065
4081
|
}), undefined, true)
|
|
4066
|
-
: undefined, willQueue: engineSetupRequired || isRunning, onSlashCommand: onSlashCommand, execMode: execMode, onExecModeChange: onExecModeChange, planModeDisabled: planModeDisabled, planModeDisabledReason: planModeDisabledReason, selectedModel: selectedModel ?? defaultModel, selectedEffort: selectedEffort, availableModels: availableModels, modelListLoading: modelListLoading, onModelChange: onModelChange, onEffortChange: onEffortChange, imageModelMenu: imageModelMenu, onConnectProvider: onConnectProvider, onConnectLocalRuntime: onConnectLocalRuntime, toolbarSlot: composerToolbarSlot, contextItems: composerContextItems, onRemoveContextItem: removeComposerContextItem, plusMenuMode: plusMenuMode, layoutVariant: composerLayoutVariant, providerConnectStatusEnabled: providerStatusChecksEnabled, voiceEnabled: true, draftScope: threadId || tabId, interceptBuildRequestsForBuilder: true, onAttachmentError: setComposerError, extraActionButton:
|
|
4067
|
-
composerExtraActionButton ? (_jsxs(_Fragment, { children: [contextXRayEnabled && (_jsx(ContextMeter, { threadId: threadId })), composerExtraActionButton] })) : undefined, stopButton: showRunningInUI ? (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: () => stopActiveRun(), "aria-label": "Stop response", "data-agent-composer-slot": "stop-button", className: "shrink-0 flex h-7 w-7 cursor-pointer items-center justify-center rounded-full bg-primary text-primary-foreground shadow-sm transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", children: _jsx(IconPlayerStopFilled, { className: "h-3 w-3" }) }) }), _jsx(TooltipContent, { children: "Stop response" })] })) : undefined })] })) }), showMissingKeySetup && !showInlineMissingKeySetup ? (_jsx(PopoverContent, { side: missingApiKeySetupLayout === "sidebar"
|
|
4082
|
+
: undefined, willQueue: engineSetupRequired || isRunning, onSlashCommand: onSlashCommand, execMode: execMode, onExecModeChange: onExecModeChange, planModeDisabled: planModeDisabled, planModeDisabledReason: planModeDisabledReason, selectedModel: selectedModel ?? defaultModel, selectedEffort: selectedEffort, availableModels: availableModels, modelListLoading: modelListLoading, onModelChange: onModelChange, onEffortChange: onEffortChange, imageModelMenu: imageModelMenu, onConnectProvider: onConnectProvider, onConnectLocalRuntime: onConnectLocalRuntime, toolbarSlot: composerToolbarSlot, contextItems: composerContextItems, onRemoveContextItem: removeComposerContextItem, plusMenuMode: plusMenuMode, layoutVariant: composerLayoutVariant, providerConnectStatusEnabled: providerStatusChecksEnabled, voiceEnabled: true, draftScope: threadId || tabId, interceptBuildRequestsForBuilder: true, onAttachmentError: setComposerError, extraActionButton: composerExtraActionButton, stopButton: showRunningInUI ? (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: () => stopActiveRun(), "aria-label": "Stop response", "data-agent-composer-slot": "stop-button", className: "shrink-0 flex h-7 w-7 cursor-pointer items-center justify-center rounded-full bg-primary text-primary-foreground shadow-sm transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", children: _jsx(IconPlayerStopFilled, { className: "h-3 w-3" }) }) }), _jsx(TooltipContent, { children: "Stop response" })] })) : undefined })] })) }), showMissingKeySetup && !showInlineMissingKeySetup ? (_jsx(PopoverContent, { side: missingApiKeySetupLayout === "sidebar"
|
|
4068
4083
|
? "top"
|
|
4069
4084
|
: "bottom", align: "center", sideOffset: 8, collisionPadding: 12, "data-agent-native-composer-popover": "true", className: "z-[260] box-border w-[min(calc(100vw-2rem),var(--radix-popover-content-available-width,26rem),26rem)] rounded-lg border-border p-3 shadow-lg", children: _jsx(BuilderSetupContent, { onConnected: handleBuilderConnected, layout: missingApiKeySetupLayout }) })) : null] })] })] }) }) }) }) }) }) }) }));
|
|
4070
4085
|
});
|
|
@@ -75,6 +75,7 @@ function buildNewWorkspaceAppPrompt(input) {
|
|
|
75
75
|
`Generate a concise one-sentence app description from the user prompt before coding; save it in apps/${input.appId}/package.json "description" so Dispatch and A2A can describe the app.`,
|
|
76
76
|
`If the user mentions a product or company such as Granola, Loom, Superhuman, Linear, or Notion, treat it as product inspiration unless they explicitly ask to connect to that service. Do not invent or require third-party API keys like GRANOLA_API_KEY just because a product is named.`,
|
|
77
77
|
grantRequest,
|
|
78
|
+
`Workspace credential rule: use the Dispatch workspace vault and the app's scoped secret or workspace-connection resolver for provider credentials. Framework apps should use resolveSecret from @agent-native/core/server; existing builder-workspace apps should use their resolveConnectorSecret helper. Do not ask a non-admin builder to add keys to local project settings or .env, and do not copy vault values into app code. If a needed key is not available, request it through Dispatch's vault workflow or surface the provider connection setup path.`,
|
|
78
79
|
`Requested Dispatch workspace resources for this app:\n${resourceList}`,
|
|
79
80
|
`Dispatch workspace resources with scope=all are inherited workspace context. Do not copy or sync them into the new app; every workspace app reads them at runtime and may override with app shared or personal resources.`,
|
|
80
81
|
``,
|
|
@@ -980,6 +980,65 @@ class AgentStartupTimeoutError extends Error {
|
|
|
980
980
|
this.timeoutMs = timeoutMs;
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
|
+
/**
|
|
984
|
+
* Keep the server's error contract intact across the fetch boundary. In
|
|
985
|
+
* particular, a POST response with `retryable: false` must not be fed into the
|
|
986
|
+
* generic reconnect/continuation path: replaying a mutation after the server
|
|
987
|
+
* has started processing it can duplicate work. The previous code discarded
|
|
988
|
+
* this metadata and exposed the raw JSON body to the user instead.
|
|
989
|
+
*/
|
|
990
|
+
class AgentChatHttpError extends Error {
|
|
991
|
+
errorCode;
|
|
992
|
+
details;
|
|
993
|
+
retryable;
|
|
994
|
+
upgradeUrl;
|
|
995
|
+
constructor(error) {
|
|
996
|
+
super(error.message);
|
|
997
|
+
this.name = "AgentChatHttpError";
|
|
998
|
+
this.errorCode = error.errorCode;
|
|
999
|
+
this.details = error.details;
|
|
1000
|
+
this.retryable = error.retryable;
|
|
1001
|
+
this.upgradeUrl = error.upgradeUrl;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
function parseStructuredAgentChatError(body) {
|
|
1005
|
+
if (!body.trim())
|
|
1006
|
+
return null;
|
|
1007
|
+
try {
|
|
1008
|
+
const parsed = JSON.parse(body);
|
|
1009
|
+
if (!parsed || typeof parsed !== "object")
|
|
1010
|
+
return null;
|
|
1011
|
+
const message = typeof parsed.error === "string"
|
|
1012
|
+
? parsed.error
|
|
1013
|
+
: typeof parsed.message === "string"
|
|
1014
|
+
? parsed.message
|
|
1015
|
+
: "";
|
|
1016
|
+
if (!message)
|
|
1017
|
+
return null;
|
|
1018
|
+
return {
|
|
1019
|
+
message,
|
|
1020
|
+
...(typeof parsed.code === "string"
|
|
1021
|
+
? { errorCode: parsed.code }
|
|
1022
|
+
: typeof parsed.errorCode === "string"
|
|
1023
|
+
? { errorCode: parsed.errorCode }
|
|
1024
|
+
: {}),
|
|
1025
|
+
...(typeof parsed.details === "string"
|
|
1026
|
+
? { details: parsed.details }
|
|
1027
|
+
: {}),
|
|
1028
|
+
...(typeof parsed.retryable === "boolean"
|
|
1029
|
+
? { retryable: parsed.retryable }
|
|
1030
|
+
: {}),
|
|
1031
|
+
...(typeof parsed.upgradeUrl === "string"
|
|
1032
|
+
? { upgradeUrl: parsed.upgradeUrl }
|
|
1033
|
+
: {}),
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
catch (error) {
|
|
1037
|
+
if (error instanceof SyntaxError)
|
|
1038
|
+
return null;
|
|
1039
|
+
throw error;
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
983
1042
|
async function fetchWithStartupTimeout(input, init, timeoutMs, abortSignal) {
|
|
984
1043
|
if (abortSignal.aborted) {
|
|
985
1044
|
throw new DOMException("The operation was aborted.", "AbortError");
|
|
@@ -2743,7 +2802,7 @@ export function createAgentChatAdapter(options) {
|
|
|
2743
2802
|
const body = await res.text();
|
|
2744
2803
|
const parsed = JSON.parse(body);
|
|
2745
2804
|
if (parsed.error) {
|
|
2746
|
-
throw new Error(parsed.error);
|
|
2805
|
+
throw new Error(String(parsed.error));
|
|
2747
2806
|
}
|
|
2748
2807
|
}
|
|
2749
2808
|
catch (e) {
|
|
@@ -2877,6 +2936,7 @@ export function createAgentChatAdapter(options) {
|
|
|
2877
2936
|
let errorText = `Server error: ${res.status}`;
|
|
2878
2937
|
try {
|
|
2879
2938
|
const body = await res.text();
|
|
2939
|
+
const structuredError = parseStructuredAgentChatError(body);
|
|
2880
2940
|
if (isAuthErrorMessage(body)) {
|
|
2881
2941
|
if (await tryRecoverAuthOnce()) {
|
|
2882
2942
|
continue;
|
|
@@ -2920,11 +2980,25 @@ export function createAgentChatAdapter(options) {
|
|
|
2920
2980
|
"Agent chat endpoint not found. Make sure the agent-chat plugin is loaded in server/plugins/.";
|
|
2921
2981
|
}
|
|
2922
2982
|
else if (body) {
|
|
2923
|
-
|
|
2924
|
-
|
|
2983
|
+
// A non-retryable structured response is a terminal server
|
|
2984
|
+
// outcome. Preserve its code and stop before the generic
|
|
2985
|
+
// connection recovery below can POST the same turn again.
|
|
2986
|
+
if (structuredError &&
|
|
2987
|
+
(structuredError.retryable === false ||
|
|
2988
|
+
structuredError.errorCode === "database_unavailable")) {
|
|
2989
|
+
throw new AgentChatHttpError(structuredError);
|
|
2990
|
+
}
|
|
2991
|
+
errorText = structuredError
|
|
2992
|
+
? structuredError.message
|
|
2993
|
+
: body.length > 200
|
|
2994
|
+
? body.slice(0, 200) + "..."
|
|
2995
|
+
: body;
|
|
2925
2996
|
}
|
|
2926
2997
|
}
|
|
2927
|
-
catch {
|
|
2998
|
+
catch (error) {
|
|
2999
|
+
if (error instanceof AgentChatHttpError)
|
|
3000
|
+
throw error;
|
|
3001
|
+
}
|
|
2928
3002
|
throw new Error(errorText);
|
|
2929
3003
|
}
|
|
2930
3004
|
if (!res.body) {
|
|
@@ -3095,6 +3169,51 @@ export function createAgentChatAdapter(options) {
|
|
|
3095
3169
|
return;
|
|
3096
3170
|
continue;
|
|
3097
3171
|
}
|
|
3172
|
+
if (err instanceof AgentChatHttpError) {
|
|
3173
|
+
const normalized = normalizeChatError(err.message, err.errorCode);
|
|
3174
|
+
const details = [err.details, normalized.details]
|
|
3175
|
+
.filter(Boolean)
|
|
3176
|
+
.join("\n\n");
|
|
3177
|
+
const runError = {
|
|
3178
|
+
message: normalized.message,
|
|
3179
|
+
...(details ? { details } : {}),
|
|
3180
|
+
...(err.errorCode ? { errorCode: err.errorCode } : {}),
|
|
3181
|
+
recoverable: err.retryable === true,
|
|
3182
|
+
...(runId ? { runId } : {}),
|
|
3183
|
+
};
|
|
3184
|
+
captureChatClientError(err, "server-error", {
|
|
3185
|
+
...(err.errorCode ? { errorCode: err.errorCode } : {}),
|
|
3186
|
+
retryable: err.retryable ?? false,
|
|
3187
|
+
});
|
|
3188
|
+
if (typeof window !== "undefined") {
|
|
3189
|
+
window.dispatchEvent(new CustomEvent("agent-chat:run-error", {
|
|
3190
|
+
detail: {
|
|
3191
|
+
...runError,
|
|
3192
|
+
...(err.upgradeUrl ? { upgradeUrl: err.upgradeUrl } : {}),
|
|
3193
|
+
tabId,
|
|
3194
|
+
},
|
|
3195
|
+
}));
|
|
3196
|
+
}
|
|
3197
|
+
settleInterruptedToolCalls(content, undefined, {
|
|
3198
|
+
includeActivity: true,
|
|
3199
|
+
});
|
|
3200
|
+
content.push({
|
|
3201
|
+
type: "text",
|
|
3202
|
+
text: `Something went wrong: ${normalized.message}`,
|
|
3203
|
+
});
|
|
3204
|
+
yield {
|
|
3205
|
+
content: [...content],
|
|
3206
|
+
status: {
|
|
3207
|
+
type: "incomplete",
|
|
3208
|
+
reason: "error",
|
|
3209
|
+
},
|
|
3210
|
+
metadata: {
|
|
3211
|
+
custom: { ...(runId ? { runId } : {}), runError },
|
|
3212
|
+
},
|
|
3213
|
+
};
|
|
3214
|
+
clearActiveRun();
|
|
3215
|
+
return;
|
|
3216
|
+
}
|
|
3098
3217
|
const errMsg = err instanceof Error ? err.message : "Something went wrong.";
|
|
3099
3218
|
const isAuthError = isAuthErrorMessage(errMsg);
|
|
3100
3219
|
// Don't try to reconnect for auth/client errors — show error directly
|