@agent-native/core 0.97.0 → 0.98.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/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +32 -0
- package/corpus/core/docs/content/authentication.mdx +3 -3
- package/corpus/core/docs/content/doctor.mdx +170 -0
- package/corpus/core/docs/content/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ar-SA/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ar-SA/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/security.mdx +2 -0
- package/corpus/core/docs/content/locales/de-DE/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/de-DE/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/security.mdx +2 -0
- package/corpus/core/docs/content/locales/es-ES/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/es-ES/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/security.mdx +2 -0
- package/corpus/core/docs/content/locales/fr-FR/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/fr-FR/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/security.mdx +2 -0
- package/corpus/core/docs/content/locales/hi-IN/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/hi-IN/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/security.mdx +2 -0
- package/corpus/core/docs/content/locales/ja-JP/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ja-JP/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/security.mdx +2 -0
- package/corpus/core/docs/content/locales/ko-KR/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ko-KR/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/security.mdx +2 -0
- package/corpus/core/docs/content/locales/pt-BR/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/pt-BR/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/security.mdx +2 -0
- package/corpus/core/docs/content/locales/zh-CN/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/zh-CN/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/security.mdx +2 -0
- package/corpus/core/docs/content/locales/zh-TW/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/zh-TW/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/security.mdx +2 -0
- package/corpus/core/docs/content/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/security.mdx +2 -0
- package/corpus/core/package.json +5 -1
- package/corpus/core/scripts/finalize-build.mjs +63 -3
- package/corpus/core/scripts/materialize-source-corpus.mjs +101 -15
- package/corpus/core/src/action.ts +42 -0
- package/corpus/core/src/agent/engine/builder-engine.ts +3 -0
- package/corpus/core/src/agent/engine/context-directives-transform.ts +69 -0
- package/corpus/core/src/agent/engine/continuation-dispatch-retry.ts +168 -0
- package/corpus/core/src/agent/engine/tool-call-journal-seed.ts +85 -0
- package/corpus/core/src/agent/production-agent.ts +129 -244
- package/corpus/core/src/cli/doctor.ts +9 -3
- package/corpus/core/src/cli/plan-local.ts +10 -2
- package/corpus/core/src/cli/skills-content/assets-skill.ts +83 -0
- package/corpus/core/src/cli/skills-content/canvas.ts +153 -0
- package/corpus/core/src/cli/skills-content/connection.ts +52 -0
- package/corpus/core/src/cli/skills-content/content-skill.ts +109 -0
- package/corpus/core/src/cli/skills-content/design-exploration-skill.ts +118 -0
- package/corpus/core/src/cli/skills-content/design-visual-edit-skill.ts +228 -0
- package/corpus/core/src/cli/skills-content/document-quality.ts +196 -0
- package/corpus/core/src/cli/skills-content/exemplar.ts +69 -0
- package/corpus/core/src/cli/skills-content/help.ts +77 -0
- package/corpus/core/src/cli/skills-content/index.ts +22 -0
- package/corpus/core/src/cli/skills-content/local-files.ts +95 -0
- package/corpus/core/src/cli/skills-content/plan-setup-auth.ts +80 -0
- package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +470 -0
- package/corpus/core/src/cli/skills-content/visual-recap-skill.ts +547 -0
- package/corpus/core/src/cli/skills-content/visualize-repo-skill.ts +93 -0
- package/corpus/core/src/cli/skills-content/wireframe.ts +349 -0
- package/corpus/core/src/cli/skills.ts +27 -2733
- package/corpus/core/src/client/AgentPanel.tsx +6 -5
- package/corpus/core/src/client/CommandMenu.tsx +16 -5
- package/corpus/core/src/client/FeedbackButton.tsx +2 -2
- package/corpus/core/src/client/app-providers.tsx +18 -5
- package/corpus/core/src/client/chat/tool-call-display.tsx +3 -3
- package/corpus/core/src/client/composer/PastedTextChip.tsx +1 -1
- package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +143 -45
- package/corpus/core/src/client/composer/TiptapComposer.tsx +1 -1
- package/corpus/core/src/client/composer/VoiceButton.tsx +21 -5
- package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +107 -10
- package/corpus/core/src/client/context-xray/ContextXRayPanel.tsx +5 -2
- package/corpus/core/src/client/extensions/ExtensionEditor.tsx +37 -4
- package/corpus/core/src/client/extensions/ExtensionQueryErrorState.tsx +47 -0
- package/corpus/core/src/client/extensions/ExtensionSlot.tsx +39 -10
- package/corpus/core/src/client/extensions/ExtensionViewer.tsx +44 -6
- package/corpus/core/src/client/extensions/ExtensionsListPage.tsx +12 -3
- package/corpus/core/src/client/extensions/ExtensionsSidebarSection.tsx +49 -11
- package/corpus/core/src/client/index.ts +0 -13
- package/corpus/core/src/client/progress/RunsTray.tsx +10 -3
- package/corpus/core/src/client/settings/SettingsTabsPage.tsx +7 -0
- package/corpus/core/src/client/settings/useBuilderStatus.ts +6 -0
- package/corpus/core/src/client/tool-cells/EditCell.tsx +19 -16
- package/corpus/core/src/client/tool-cells/FilesChangedSummary.tsx +26 -23
- package/corpus/core/src/client/tool-cells/WriteCell.tsx +19 -16
- package/corpus/core/src/client/visual-style-controls.tsx +1 -1
- package/corpus/core/src/deploy/build.ts +36 -14
- package/corpus/core/src/integrations/google-docs-poller.ts +23 -2
- package/corpus/core/src/integrations/plugin.ts +10 -0
- package/corpus/core/src/integrations/webhook-handler.ts +27 -2
- package/corpus/core/src/jobs/scheduler.ts +28 -2
- package/corpus/core/src/localization/default-messages.ts +8 -1
- package/corpus/core/src/mcp/oauth-token.ts +6 -1
- package/corpus/core/src/observability/routes.ts +36 -0
- package/corpus/core/src/observability/sentiment.ts +261 -0
- package/corpus/core/src/observability/store.ts +23 -0
- package/corpus/core/src/observability/traces.ts +49 -63
- package/corpus/core/src/observability/tracking-identity.ts +55 -0
- package/corpus/core/src/observability/types.ts +13 -0
- package/corpus/core/src/secrets/storage.ts +67 -3
- package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +199 -0
- package/corpus/core/src/server/agent-chat/browser-team-tools.ts +510 -0
- package/corpus/core/src/server/agent-chat/context-tools.ts +595 -0
- package/corpus/core/src/server/agent-chat/framework-prompts.ts +470 -0
- package/corpus/core/src/server/agent-chat/lazy-fs.ts +11 -0
- package/corpus/core/src/server/agent-chat/mcp-glue.ts +91 -0
- package/corpus/core/src/server/agent-chat/plugin-options.ts +350 -0
- package/corpus/core/src/server/agent-chat/process-run-failure.ts +62 -0
- package/corpus/core/src/server/agent-chat/prompt-resources.ts +688 -0
- package/corpus/core/src/server/agent-chat/recurring-jobs-runtime.ts +80 -0
- package/corpus/core/src/server/agent-chat/request-surface.ts +71 -0
- package/corpus/core/src/server/agent-chat/run-code-tools.ts +67 -0
- package/corpus/core/src/server/agent-chat/script-entries.ts +779 -0
- package/corpus/core/src/server/agent-chat/shared-thread.ts +301 -0
- package/corpus/core/src/server/agent-chat/skill-frontmatter.ts +41 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +364 -4182
- package/corpus/core/src/server/agent-teams.ts +26 -3
- package/corpus/core/src/server/auth.ts +55 -57
- package/corpus/core/src/server/credential-provider.ts +22 -25
- package/corpus/core/src/server/edge.ts +1 -0
- package/corpus/core/src/server/onboarding-html.ts +1 -16
- package/corpus/core/src/server/realtime-voice.ts +40 -5
- package/corpus/core/src/server/request-origin.ts +6 -2
- package/corpus/core/src/server/ssr-handler.ts +55 -2
- package/corpus/core/src/sharing/access.ts +155 -11
- package/corpus/core/src/sharing/registry.ts +7 -0
- package/corpus/core/src/styles/agent-native.css +15 -14
- package/corpus/core/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/core/src/templates/default/app/i18n/ar-SA.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/de-DE.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/en-US.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/es-ES.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/fr-FR.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/hi-IN.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/ja-JP.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/ko-KR.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/pt-BR.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/zh-CN.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +6 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
- package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
- package/corpus/core/src/templates/workspace-core/src/server/index.ts +4 -2
- package/corpus/core/src/testing.ts +26 -0
- package/corpus/core/src/triggers/dispatcher.ts +23 -2
- package/corpus/core/src/vite/client.ts +126 -2
- package/corpus/core/tsconfig.cli.json +1 -1
- package/corpus/core/tsconfig.json +5 -1
- package/corpus/templates/analytics/.agents/skills/bigquery/SKILL.md +2 -2
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/analytics/AGENTS.md +19 -6
- package/corpus/templates/analytics/actions/install-dashboard-template.ts +79 -43
- package/corpus/templates/analytics/actions/list-explorer-dashboards.ts +3 -3
- package/corpus/templates/analytics/actions/list-sql-dashboards.ts +8 -3
- package/corpus/templates/analytics/actions/rename-analysis.ts +8 -2
- package/corpus/templates/analytics/actions/rename-dashboard.ts +8 -7
- package/corpus/templates/analytics/actions/view-screen.ts +4 -23
- package/corpus/templates/analytics/app/components/ResourceLoadError.tsx +42 -0
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +85 -70
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +107 -89
- package/corpus/templates/analytics/app/components/layout/SidebarLoadError.tsx +24 -0
- package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +15 -5
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +4 -0
- package/corpus/templates/analytics/app/i18n-data.ts +40 -0
- package/corpus/templates/analytics/app/pages/Settings.tsx +6 -2
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +36 -20
- package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +34 -20
- package/corpus/templates/analytics/app/pages/adhoc/explorer/use-explorer-config.ts +42 -41
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +43 -36
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewsMenu.tsx +11 -2
- package/corpus/templates/analytics/app/root.tsx +13 -1
- package/corpus/templates/analytics/app/routes/_index.tsx +14 -2
- package/corpus/templates/analytics/changelog/2026-07-03-agent-llm-observability-dashboard.md +1 -1
- package/corpus/templates/analytics/changelog/2026-07-11-agent-feedback-sentiment-dashboard.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-analytics-chats-now-start-faster-by-loading-metric-definitio.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-command-and-sql-previews-now-respond-without-lag.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-command-search-now-reports-loading-failures-and-lets-you-ret.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-dashboard-navigation-now-loads-faster-and-reports-request-fa.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-inferred-message-sentiment-dashboard.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-microphone-settings-from-realtime-voice-mode-now-open-the-vo.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-more-dashboard-edit-paths-are-now-safe-against-simultaneous-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-renaming-a-dashboard-is-now-safe-against-simultaneous-agent-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-renaming-an-analysis-is-now-safe-against-simultaneous-edits.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-workspace-mounted-analytics-now-opens-ask-reliably-and-route.md +6 -0
- package/corpus/templates/analytics/docs/schemas/first-party-analytics.md +37 -3
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +339 -1
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +1 -24
- package/corpus/templates/analytics/server/lib/dashboard-seeds.ts +0 -5
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +289 -20
- package/corpus/templates/analytics/server/lib/data-dictionary-context.ts +106 -34
- package/corpus/templates/analytics/server/lib/demo-dashboards.ts +4 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +11 -39
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +30 -4
- package/corpus/templates/assets/app/routes/library.tsx +49 -5
- package/corpus/templates/assets/changelog/2026-07-11-library-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/calendar/.env.example +5 -0
- package/corpus/templates/calendar/app/components/calendar/EventCard.tsx +2 -2
- package/corpus/templates/calendar/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/calendar/app/i18n-data.ts +20 -0
- package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +37 -1
- package/corpus/templates/calendar/app/pages/BookingsList.tsx +20 -3
- package/corpus/templates/calendar/changelog/2026-07-11-booking-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-11-event-cards-give-subtle-press-feedback-and-smoother-hover.md +6 -0
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/clips/actions/decline-invite.ts +8 -0
- package/corpus/templates/clips/app/components/library/folder-tree.tsx +209 -187
- package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +2 -2
- package/corpus/templates/clips/app/components/player/reactions-tray.tsx +17 -5
- package/corpus/templates/clips/app/components/player/scrubber.tsx +5 -3
- package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +2 -2
- package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +119 -95
- package/corpus/templates/clips/app/global.css +45 -0
- package/corpus/templates/clips/app/root.tsx +4 -0
- package/corpus/templates/clips/app/routes/_app.notifications.tsx +23 -2
- package/corpus/templates/clips/app/routes/_app.trash.tsx +24 -2
- package/corpus/templates/clips/changelog/2026-07-11-controls-and-folders-now-move-more-smoothly.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-declining-an-invitation-now-requires-being-its-recipient.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-recording-overlays-are-lighter-weight-and-no-longer-cause-pa.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-workspace-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/overlay.css +34 -5
- package/corpus/templates/clips/chrome-extension/src/styles.css +2 -2
- package/corpus/templates/clips/desktop/src/styles.css +71 -26
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/content/actions/move-document.ts +34 -18
- package/corpus/templates/content/app/components/QueryErrorState.tsx +39 -0
- package/corpus/templates/content/app/components/editor/LinkHoverPreview.tsx +1 -1
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +225 -1435
- package/corpus/templates/content/app/components/editor/database/GalleryView.tsx +368 -0
- package/corpus/templates/content/app/components/editor/database/ListView.tsx +353 -0
- package/corpus/templates/content/app/components/editor/database/TimelineView.tsx +580 -0
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +11 -2
- package/corpus/templates/content/app/global.css +19 -19
- package/corpus/templates/content/app/root.tsx +2 -2
- package/corpus/templates/content/app/routes/_app._index.tsx +11 -1
- package/corpus/templates/content/changelog/2026-07-11-document-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-editor-toggle-feedback-now-feels-more-responsive.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-moving-documents-at-the-same-time-no-longer-scrambles-their-.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-public-document-chats-now-start-faster-while-keeping-full-do.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-reopening-a-comment-now-uses-consistent-permissions-everywhe.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-sidebar-resizing-now-tracks-your-cursor-instantly-instead-of.md +6 -0
- package/corpus/templates/content/server/lib/public-documents.ts +47 -10
- package/corpus/templates/content/server/routes/api/comments/[id].patch.ts +24 -24
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/design/app/components/QueryErrorState.tsx +24 -0
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +1 -1
- package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +5 -2
- package/corpus/templates/design/app/components/design/EditPanel.tsx +326 -319
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +198 -193
- package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +11 -4
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +1 -1
- package/corpus/templates/design/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/design/app/pages/DesignSystems.tsx +7 -1
- package/corpus/templates/design/app/pages/Index.tsx +14 -2
- package/corpus/templates/design/app/pages/Present.tsx +16 -3
- package/corpus/templates/design/app/pages/Templates.tsx +10 -4
- package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +484 -0
- package/corpus/templates/design/app/pages/design-editor/clone-and-pen-edit.ts +378 -0
- package/corpus/templates/design/app/pages/design-editor/design-data-geometry-utils.ts +138 -0
- package/corpus/templates/design/app/pages/design-editor/dom-utils.ts +15 -0
- package/corpus/templates/design/app/pages/design-editor/generation-prompt-directives.ts +180 -0
- package/corpus/templates/design/app/pages/design-editor/html-layer-positioning.ts +226 -0
- package/corpus/templates/design/app/pages/design-editor/png-export-render.ts +348 -0
- package/corpus/templates/design/app/pages/design-editor/screen-command-utils.ts +160 -0
- package/corpus/templates/design/app/pages/design-editor/text-edit-utils.ts +238 -0
- package/corpus/templates/design/app/pages/design-editor/tool-state.ts +23 -1
- package/corpus/templates/design/app/pages/design-editor/types.ts +25 -0
- package/corpus/templates/design/app/root.tsx +10 -1
- package/corpus/templates/design/changelog/2026-07-11-canvas-context-menus-now-open-without-motion-jitter.md +6 -0
- package/corpus/templates/design/changelog/2026-07-11-design-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/design/changelog/2026-07-11-inspector-tooltips-appear-instantly-as-you-sweep-across-icon.md +6 -0
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/dispatch/app/i18n/zh-TW.ts +10 -0
- package/corpus/templates/dispatch/app/i18n-data.ts +123 -0
- package/corpus/templates/dispatch/app/routes/integrations.tsx +163 -144
- package/corpus/templates/dispatch/changelog/2026-07-11-dispatch-mcp-connections-now-start-with-safer-app-access-and.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-11-overview-and-chat-now-share-a-cleaner-more-stable-flow.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-11-query-errors-now-show-a-retry-option.md +6 -0
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +3 -3
- package/corpus/templates/forms/app/root.tsx +34 -8
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/macros/app/components/DailyProgress.tsx +25 -5
- package/corpus/templates/macros/app/components/QueryErrorState.tsx +31 -0
- package/corpus/templates/macros/app/components/WeightTracker.tsx +5 -1
- package/corpus/templates/macros/app/components/ui/button.tsx +1 -1
- package/corpus/templates/macros/app/components/ui/progress.tsx +1 -1
- package/corpus/templates/macros/app/components/ui/tabs.tsx +1 -1
- package/corpus/templates/macros/app/i18n/ar-SA.ts +2 -0
- package/corpus/templates/macros/app/i18n/de-DE.ts +2 -0
- package/corpus/templates/macros/app/i18n/en-US.ts +2 -0
- package/corpus/templates/macros/app/i18n/es-ES.ts +2 -0
- package/corpus/templates/macros/app/i18n/fr-FR.ts +2 -0
- package/corpus/templates/macros/app/i18n/hi-IN.ts +2 -0
- package/corpus/templates/macros/app/i18n/ja-JP.ts +2 -0
- package/corpus/templates/macros/app/i18n/ko-KR.ts +2 -0
- package/corpus/templates/macros/app/i18n/pt-BR.ts +2 -0
- package/corpus/templates/macros/app/i18n/zh-CN.ts +2 -0
- package/corpus/templates/macros/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/macros/app/routes/_index.tsx +22 -12
- package/corpus/templates/macros/app/routes/analytics.tsx +31 -10
- package/corpus/templates/macros/changelog/2026-07-11-daily-tracking-now-loads-and-updates-more-quickly.md +6 -0
- package/corpus/templates/macros/changelog/2026-07-11-data-load-failures-now-show-a-clear-error-with-a-retry-actio.md +6 -0
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/mail/.env.example +16 -11
- package/corpus/templates/mail/actions/list-emails.ts +39 -35
- package/corpus/templates/mail/app/components/email/ComposeModal.tsx +58 -6
- package/corpus/templates/mail/app/components/email/EmailListItem.tsx +35 -2
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +113 -104
- package/corpus/templates/mail/app/root.tsx +8 -10
- package/corpus/templates/mail/changelog/2026-07-11-compose-and-navigation-motion-now-feel-faster-and-smoother.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-11-swipe-to-archive-or-snooze-now-responds-to-quick-flicks-not-.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-11-the-assistant-now-sees-the-same-inbox-you-do-snoozed-mail-st.md +6 -0
- package/corpus/templates/mail/server/handlers/emails.ts +25 -69
- package/corpus/templates/mail/server/lib/list-inbox-emails.ts +169 -0
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/plan/.env.example +4 -0
- package/corpus/templates/plan/actions/create-plan-design.ts +89 -81
- package/corpus/templates/plan/actions/create-prototype-plan.ts +72 -59
- package/corpus/templates/plan/actions/create-ui-plan.ts +70 -55
- package/corpus/templates/plan/actions/create-visual-plan.ts +65 -51
- package/corpus/templates/plan/actions/update-local-plan-folder.ts +43 -30
- package/corpus/templates/plan/actions/update-visual-plan.ts +81 -64
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +17 -0
- package/corpus/templates/plan/app/components/ui/tabs.tsx +1 -1
- package/corpus/templates/plan/app/i18n/ar-SA.ts +10 -0
- package/corpus/templates/plan/app/i18n/de-DE.ts +10 -0
- package/corpus/templates/plan/app/i18n/en-US.ts +10 -0
- package/corpus/templates/plan/app/i18n/es-ES.ts +10 -0
- package/corpus/templates/plan/app/i18n/fr-FR.ts +10 -0
- package/corpus/templates/plan/app/i18n/hi-IN.ts +10 -0
- package/corpus/templates/plan/app/i18n/ja-JP.ts +10 -0
- package/corpus/templates/plan/app/i18n/ko-KR.ts +10 -0
- package/corpus/templates/plan/app/i18n/pt-BR.ts +10 -0
- package/corpus/templates/plan/app/i18n/zh-CN.ts +10 -0
- package/corpus/templates/plan/app/i18n/zh-TW.ts +10 -0
- package/corpus/templates/plan/app/lib/plan-local-bridge.ts +80 -1
- package/corpus/templates/plan/app/pages/PlansPage.tsx +152 -4
- package/corpus/templates/plan/app/root.tsx +11 -0
- package/corpus/templates/plan/changelog/2026-07-11-local-plans-now-explain-and-recover-from-browser-permission-.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-11-plan-edits-now-save-atomically-and-can-no-longer-partially-a.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-11-plan-lists-now-show-a-clear-error-with-a-retry-action-when-t.md +6 -0
- package/corpus/templates/plan/shared/plan-content.ts +546 -260
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/slides/actions/delete-slide-comment.ts +49 -0
- package/corpus/templates/slides/actions/update-slide-comment.ts +93 -0
- package/corpus/templates/slides/actions/view-screen.ts +14 -6
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +33 -10
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/GenerateSlidesDialog.tsx +2 -2
- package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +4 -2
- package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +4 -3
- package/corpus/templates/slides/app/context/DeckContext.tsx +9 -0
- package/corpus/templates/slides/app/i18n/ar-SA.ts +6 -0
- package/corpus/templates/slides/app/i18n/de-DE.ts +6 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +6 -0
- package/corpus/templates/slides/app/i18n/es-ES.ts +6 -0
- package/corpus/templates/slides/app/i18n/fr-FR.ts +6 -0
- package/corpus/templates/slides/app/i18n/hi-IN.ts +6 -0
- package/corpus/templates/slides/app/i18n/ja-JP.ts +6 -0
- package/corpus/templates/slides/app/i18n/ko-KR.ts +6 -0
- package/corpus/templates/slides/app/i18n/pt-BR.ts +6 -0
- package/corpus/templates/slides/app/i18n/zh-CN.ts +5 -0
- package/corpus/templates/slides/app/i18n/zh-TW.ts +5 -0
- package/corpus/templates/slides/app/pages/DesignSystems.tsx +23 -2
- package/corpus/templates/slides/app/pages/Index.tsx +29 -1
- package/corpus/templates/slides/changelog/2026-07-11-comment-load-failures-now-show-a-retry-action-instead-of-say.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-comment-pins-now-clear-with-a-faster-smoother-confirmation.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-deck-and-design-system-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-editor-toggles-and-toolbar-menus-now-animate-smoothly.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-the-assistant-can-now-resolve-reopen-and-delete-slide-commen.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-viewing-slides-no-longer-loads-every-deck-s-full-contents-in.md +6 -0
- package/corpus/templates/slides/server/routes/api/comments/[id].delete.ts +29 -48
- package/corpus/templates/slides/server/routes/api/comments/[id].patch.ts +29 -65
- package/dist/action.d.ts +23 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +13 -0
- package/dist/action.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.js +3 -0
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/engine/context-directives-transform.d.ts +25 -0
- package/dist/agent/engine/context-directives-transform.d.ts.map +1 -0
- package/dist/agent/engine/context-directives-transform.js +53 -0
- package/dist/agent/engine/context-directives-transform.js.map +1 -0
- package/dist/agent/engine/continuation-dispatch-retry.d.ts +40 -0
- package/dist/agent/engine/continuation-dispatch-retry.d.ts.map +1 -0
- package/dist/agent/engine/continuation-dispatch-retry.js +109 -0
- package/dist/agent/engine/continuation-dispatch-retry.js.map +1 -0
- package/dist/agent/engine/tool-call-journal-seed.d.ts +46 -0
- package/dist/agent/engine/tool-call-journal-seed.d.ts.map +1 -0
- package/dist/agent/engine/tool-call-journal-seed.js +60 -0
- package/dist/agent/engine/tool-call-journal-seed.js.map +1 -0
- package/dist/agent/production-agent.d.ts +7 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +102 -222
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +7 -3
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/plan-local.d.ts.map +1 -1
- package/dist/cli/plan-local.js +8 -2
- package/dist/cli/plan-local.js.map +1 -1
- package/dist/cli/skills-content/assets-skill.d.ts +2 -0
- package/dist/cli/skills-content/assets-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/assets-skill.js +84 -0
- package/dist/cli/skills-content/assets-skill.js.map +1 -0
- package/dist/cli/skills-content/canvas.d.ts +4 -0
- package/dist/cli/skills-content/canvas.d.ts.map +1 -0
- package/dist/cli/skills-content/canvas.js +152 -0
- package/dist/cli/skills-content/canvas.js.map +1 -0
- package/dist/cli/skills-content/connection.d.ts +2 -0
- package/dist/cli/skills-content/connection.d.ts.map +1 -0
- package/dist/cli/skills-content/connection.js +53 -0
- package/dist/cli/skills-content/connection.js.map +1 -0
- package/dist/cli/skills-content/content-skill.d.ts +2 -0
- package/dist/cli/skills-content/content-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/content-skill.js +110 -0
- package/dist/cli/skills-content/content-skill.js.map +1 -0
- package/dist/cli/skills-content/design-exploration-skill.d.ts +2 -0
- package/dist/cli/skills-content/design-exploration-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/design-exploration-skill.js +119 -0
- package/dist/cli/skills-content/design-exploration-skill.js.map +1 -0
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts +2 -0
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/design-visual-edit-skill.js +229 -0
- package/dist/cli/skills-content/design-visual-edit-skill.js.map +1 -0
- package/dist/cli/skills-content/document-quality.d.ts +4 -0
- package/dist/cli/skills-content/document-quality.d.ts.map +1 -0
- package/dist/cli/skills-content/document-quality.js +195 -0
- package/dist/cli/skills-content/document-quality.js.map +1 -0
- package/dist/cli/skills-content/exemplar.d.ts +4 -0
- package/dist/cli/skills-content/exemplar.d.ts.map +1 -0
- package/dist/cli/skills-content/exemplar.js +68 -0
- package/dist/cli/skills-content/exemplar.js.map +1 -0
- package/dist/cli/skills-content/help.d.ts +2 -0
- package/dist/cli/skills-content/help.d.ts.map +1 -0
- package/dist/cli/skills-content/help.js +78 -0
- package/dist/cli/skills-content/help.js.map +1 -0
- package/dist/cli/skills-content/index.d.ts +23 -0
- package/dist/cli/skills-content/index.d.ts.map +1 -0
- package/dist/cli/skills-content/index.js +23 -0
- package/dist/cli/skills-content/index.js.map +1 -0
- package/dist/cli/skills-content/local-files.d.ts +2 -0
- package/dist/cli/skills-content/local-files.d.ts.map +1 -0
- package/dist/cli/skills-content/local-files.js +96 -0
- package/dist/cli/skills-content/local-files.js.map +1 -0
- package/dist/cli/skills-content/plan-setup-auth.d.ts +9 -0
- package/dist/cli/skills-content/plan-setup-auth.d.ts.map +1 -0
- package/dist/cli/skills-content/plan-setup-auth.js +81 -0
- package/dist/cli/skills-content/plan-setup-auth.js.map +1 -0
- package/dist/cli/skills-content/visual-plan-skill.d.ts +2 -0
- package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/visual-plan-skill.js +471 -0
- package/dist/cli/skills-content/visual-plan-skill.js.map +1 -0
- package/dist/cli/skills-content/visual-recap-skill.d.ts +2 -0
- package/dist/cli/skills-content/visual-recap-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/visual-recap-skill.js +548 -0
- package/dist/cli/skills-content/visual-recap-skill.js.map +1 -0
- package/dist/cli/skills-content/visualize-repo-skill.d.ts +2 -0
- package/dist/cli/skills-content/visualize-repo-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/visualize-repo-skill.js +94 -0
- package/dist/cli/skills-content/visualize-repo-skill.js.map +1 -0
- package/dist/cli/skills-content/wireframe.d.ts +4 -0
- package/dist/cli/skills-content/wireframe.d.ts.map +1 -0
- package/dist/cli/skills-content/wireframe.js +347 -0
- package/dist/cli/skills-content/wireframe.js.map +1 -0
- package/dist/cli/skills.d.ts +2 -10
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +2 -2710
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +4 -2
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/CommandMenu.d.ts.map +1 -1
- package/dist/client/CommandMenu.js +15 -3
- package/dist/client/CommandMenu.js.map +1 -1
- package/dist/client/FeedbackButton.js +2 -2
- package/dist/client/FeedbackButton.js.map +1 -1
- package/dist/client/app-providers.d.ts +13 -5
- package/dist/client/app-providers.d.ts.map +1 -1
- package/dist/client/app-providers.js +9 -6
- package/dist/client/app-providers.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +4 -0
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +3 -3
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/composer/PastedTextChip.js +1 -1
- package/dist/client/composer/PastedTextChip.js.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts +3 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.js +35 -14
- package/dist/client/composer/RealtimeVoiceMode.js.map +1 -1
- package/dist/client/composer/TiptapComposer.js +1 -1
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/VoiceButton.d.ts +2 -0
- package/dist/client/composer/VoiceButton.d.ts.map +1 -1
- package/dist/client/composer/VoiceButton.js +9 -3
- package/dist/client/composer/VoiceButton.js.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.d.ts +5 -0
- package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.js +91 -12
- package/dist/client/composer/useRealtimeVoiceMode.js.map +1 -1
- package/dist/client/context-xray/ContextXRayPanel.d.ts.map +1 -1
- package/dist/client/context-xray/ContextXRayPanel.js +4 -1
- package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
- package/dist/client/extensions/ExtensionEditor.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionEditor.js +15 -5
- package/dist/client/extensions/ExtensionEditor.js.map +1 -1
- package/dist/client/extensions/ExtensionQueryErrorState.d.ts +8 -0
- package/dist/client/extensions/ExtensionQueryErrorState.d.ts.map +1 -0
- package/dist/client/extensions/ExtensionQueryErrorState.js +11 -0
- package/dist/client/extensions/ExtensionQueryErrorState.js.map +1 -0
- package/dist/client/extensions/ExtensionSlot.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionSlot.js +17 -7
- package/dist/client/extensions/ExtensionSlot.js.map +1 -1
- package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionViewer.js +17 -7
- package/dist/client/extensions/ExtensionViewer.js.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.js +5 -3
- package/dist/client/extensions/ExtensionsListPage.js.map +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.js +21 -8
- package/dist/client/extensions/ExtensionsSidebarSection.js.map +1 -1
- package/dist/client/index.d.ts +0 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +0 -5
- package/dist/client/index.js.map +1 -1
- package/dist/client/progress/RunsTray.d.ts.map +1 -1
- package/dist/client/progress/RunsTray.js +7 -3
- package/dist/client/progress/RunsTray.js.map +1 -1
- package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
- package/dist/client/settings/SettingsTabsPage.js +4 -0
- package/dist/client/settings/SettingsTabsPage.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.d.ts +2 -0
- package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
- package/dist/client/settings/useBuilderStatus.js +4 -0
- package/dist/client/settings/useBuilderStatus.js.map +1 -1
- package/dist/client/tool-cells/EditCell.d.ts.map +1 -1
- package/dist/client/tool-cells/EditCell.js +2 -1
- package/dist/client/tool-cells/EditCell.js.map +1 -1
- package/dist/client/tool-cells/FilesChangedSummary.d.ts.map +1 -1
- package/dist/client/tool-cells/FilesChangedSummary.js +2 -1
- package/dist/client/tool-cells/FilesChangedSummary.js.map +1 -1
- package/dist/client/tool-cells/WriteCell.d.ts.map +1 -1
- package/dist/client/tool-cells/WriteCell.js +2 -1
- package/dist/client/tool-cells/WriteCell.js.map +1 -1
- package/dist/client/visual-style-controls.js +1 -1
- package/dist/client/visual-style-controls.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +36 -14
- package/dist/deploy/build.js.map +1 -1
- package/dist/integrations/google-docs-poller.d.ts +7 -0
- package/dist/integrations/google-docs-poller.d.ts.map +1 -1
- package/dist/integrations/google-docs-poller.js +13 -3
- package/dist/integrations/google-docs-poller.js.map +1 -1
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +10 -0
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts +11 -0
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +16 -4
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/jobs/scheduler.d.ts +12 -0
- package/dist/jobs/scheduler.d.ts.map +1 -1
- package/dist/jobs/scheduler.js +13 -3
- package/dist/jobs/scheduler.js.map +1 -1
- package/dist/localization/default-messages.d.ts +7 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +8 -1
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp/oauth-token.d.ts +1 -1
- package/dist/mcp/oauth-token.d.ts.map +1 -1
- package/dist/mcp/oauth-token.js +6 -1
- package/dist/mcp/oauth-token.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts.map +1 -1
- package/dist/observability/routes.js +32 -0
- package/dist/observability/routes.js.map +1 -1
- package/dist/observability/sentiment.d.ts +42 -0
- package/dist/observability/sentiment.d.ts.map +1 -0
- package/dist/observability/sentiment.js +196 -0
- package/dist/observability/sentiment.js.map +1 -0
- package/dist/observability/store.d.ts +5 -0
- package/dist/observability/store.d.ts.map +1 -1
- package/dist/observability/store.js +17 -0
- package/dist/observability/store.js.map +1 -1
- package/dist/observability/traces.d.ts +2 -0
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js +42 -57
- package/dist/observability/traces.js.map +1 -1
- package/dist/observability/tracking-identity.d.ts +3 -0
- package/dist/observability/tracking-identity.d.ts.map +1 -0
- package/dist/observability/tracking-identity.js +51 -0
- package/dist/observability/tracking-identity.js.map +1 -0
- package/dist/observability/types.d.ts +10 -0
- package/dist/observability/types.d.ts.map +1 -1
- package/dist/observability/types.js +3 -0
- package/dist/observability/types.js.map +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/storage.d.ts +6 -0
- package/dist/secrets/storage.d.ts.map +1 -1
- package/dist/secrets/storage.js +61 -3
- package/dist/secrets/storage.js.map +1 -1
- package/dist/server/agent-chat/action-filters-a2a.d.ts +50 -0
- package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -0
- package/dist/server/agent-chat/action-filters-a2a.js +127 -0
- package/dist/server/agent-chat/action-filters-a2a.js.map +1 -0
- package/dist/server/agent-chat/browser-team-tools.d.ts +21 -0
- package/dist/server/agent-chat/browser-team-tools.d.ts.map +1 -0
- package/dist/server/agent-chat/browser-team-tools.js +417 -0
- package/dist/server/agent-chat/browser-team-tools.js.map +1 -0
- package/dist/server/agent-chat/context-tools.d.ts +33 -0
- package/dist/server/agent-chat/context-tools.d.ts.map +1 -0
- package/dist/server/agent-chat/context-tools.js +520 -0
- package/dist/server/agent-chat/context-tools.js.map +1 -0
- package/dist/server/agent-chat/framework-prompts.d.ts +65 -0
- package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -0
- package/dist/server/agent-chat/framework-prompts.js +403 -0
- package/dist/server/agent-chat/framework-prompts.js.map +1 -0
- package/dist/server/agent-chat/lazy-fs.d.ts +2 -0
- package/dist/server/agent-chat/lazy-fs.d.ts.map +1 -0
- package/dist/server/agent-chat/lazy-fs.js +11 -0
- package/dist/server/agent-chat/lazy-fs.js.map +1 -0
- package/dist/server/agent-chat/mcp-glue.d.ts +9 -0
- package/dist/server/agent-chat/mcp-glue.d.ts.map +1 -0
- package/dist/server/agent-chat/mcp-glue.js +63 -0
- package/dist/server/agent-chat/mcp-glue.js.map +1 -0
- package/dist/server/agent-chat/plugin-options.d.ts +322 -0
- package/dist/server/agent-chat/plugin-options.d.ts.map +1 -0
- package/dist/server/agent-chat/plugin-options.js +2 -0
- package/dist/server/agent-chat/plugin-options.js.map +1 -0
- package/dist/server/agent-chat/process-run-failure.d.ts +12 -0
- package/dist/server/agent-chat/process-run-failure.d.ts.map +1 -0
- package/dist/server/agent-chat/process-run-failure.js +24 -0
- package/dist/server/agent-chat/process-run-failure.js.map +1 -0
- package/dist/server/agent-chat/prompt-resources.d.ts +28 -0
- package/dist/server/agent-chat/prompt-resources.d.ts.map +1 -0
- package/dist/server/agent-chat/prompt-resources.js +514 -0
- package/dist/server/agent-chat/prompt-resources.js.map +1 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.d.ts +5 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.d.ts.map +1 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.js +53 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.js.map +1 -0
- package/dist/server/agent-chat/request-surface.d.ts +8 -0
- package/dist/server/agent-chat/request-surface.d.ts.map +1 -0
- package/dist/server/agent-chat/request-surface.js +56 -0
- package/dist/server/agent-chat/request-surface.js.map +1 -0
- package/dist/server/agent-chat/run-code-tools.d.ts +17 -0
- package/dist/server/agent-chat/run-code-tools.d.ts.map +1 -0
- package/dist/server/agent-chat/run-code-tools.js +55 -0
- package/dist/server/agent-chat/run-code-tools.js.map +1 -0
- package/dist/server/agent-chat/script-entries.d.ts +47 -0
- package/dist/server/agent-chat/script-entries.d.ts.map +1 -0
- package/dist/server/agent-chat/script-entries.js +633 -0
- package/dist/server/agent-chat/script-entries.js.map +1 -0
- package/dist/server/agent-chat/shared-thread.d.ts +33 -0
- package/dist/server/agent-chat/shared-thread.d.ts.map +1 -0
- package/dist/server/agent-chat/shared-thread.js +242 -0
- package/dist/server/agent-chat/shared-thread.js.map +1 -0
- package/dist/server/agent-chat/skill-frontmatter.d.ts +7 -0
- package/dist/server/agent-chat/skill-frontmatter.d.ts.map +1 -0
- package/dist/server/agent-chat/skill-frontmatter.js +26 -0
- package/dist/server/agent-chat/skill-frontmatter.js.map +1 -0
- package/dist/server/agent-chat-plugin.d.ts +45 -486
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +173 -3005
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-teams.d.ts +10 -0
- package/dist/server/agent-teams.d.ts.map +1 -1
- package/dist/server/agent-teams.js +13 -3
- package/dist/server/agent-teams.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +50 -52
- package/dist/server/auth.js.map +1 -1
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +22 -21
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/edge.d.ts +1 -0
- package/dist/server/edge.d.ts.map +1 -1
- package/dist/server/edge.js +1 -0
- package/dist/server/edge.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +1 -16
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/realtime-voice.d.ts +3 -0
- package/dist/server/realtime-voice.d.ts.map +1 -1
- package/dist/server/realtime-voice.js +29 -5
- package/dist/server/realtime-voice.js.map +1 -1
- package/dist/server/request-origin.d.ts.map +1 -1
- package/dist/server/request-origin.js +6 -3
- package/dist/server/request-origin.js.map +1 -1
- package/dist/server/ssr-handler.d.ts.map +1 -1
- package/dist/server/ssr-handler.js +47 -2
- package/dist/server/ssr-handler.js.map +1 -1
- package/dist/sharing/access.d.ts +63 -3
- package/dist/sharing/access.d.ts.map +1 -1
- package/dist/sharing/access.js +53 -15
- package/dist/sharing/access.js.map +1 -1
- package/dist/sharing/registry.d.ts +7 -0
- package/dist/sharing/registry.d.ts.map +1 -1
- package/dist/sharing/registry.js.map +1 -1
- package/dist/styles/agent-native.css +15 -14
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +1 -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/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
- package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
- package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
- package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
- package/dist/templates/workspace-core/src/server/index.ts +4 -2
- package/dist/testing.d.ts +16 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +16 -0
- package/dist/testing.js.map +1 -0
- package/dist/triggers/dispatcher.d.ts +7 -0
- package/dist/triggers/dispatcher.d.ts.map +1 -1
- package/dist/triggers/dispatcher.js +13 -3
- package/dist/triggers/dispatcher.js.map +1 -1
- package/dist/vite/client.d.ts +16 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +105 -2
- package/dist/vite/client.js.map +1 -1
- package/docs/content/authentication.mdx +3 -3
- package/docs/content/doctor.mdx +170 -0
- package/docs/content/external-agents.mdx +8 -7
- package/docs/content/locales/ar-SA/authentication.mdx +2 -2
- package/docs/content/locales/ar-SA/external-agents.mdx +8 -7
- package/docs/content/locales/ar-SA/mcp-protocol.mdx +1 -1
- package/docs/content/locales/ar-SA/security.mdx +2 -0
- package/docs/content/locales/de-DE/authentication.mdx +1 -1
- package/docs/content/locales/de-DE/external-agents.mdx +8 -7
- package/docs/content/locales/de-DE/mcp-protocol.mdx +1 -1
- package/docs/content/locales/de-DE/security.mdx +2 -0
- package/docs/content/locales/es-ES/authentication.mdx +2 -2
- package/docs/content/locales/es-ES/external-agents.mdx +8 -7
- package/docs/content/locales/es-ES/mcp-protocol.mdx +1 -1
- package/docs/content/locales/es-ES/security.mdx +2 -0
- package/docs/content/locales/fr-FR/authentication.mdx +1 -1
- package/docs/content/locales/fr-FR/external-agents.mdx +8 -7
- package/docs/content/locales/fr-FR/mcp-protocol.mdx +1 -1
- package/docs/content/locales/fr-FR/security.mdx +2 -0
- package/docs/content/locales/hi-IN/authentication.mdx +2 -2
- package/docs/content/locales/hi-IN/external-agents.mdx +8 -7
- package/docs/content/locales/hi-IN/mcp-protocol.mdx +1 -1
- package/docs/content/locales/hi-IN/security.mdx +2 -0
- package/docs/content/locales/ja-JP/authentication.mdx +2 -2
- package/docs/content/locales/ja-JP/external-agents.mdx +8 -7
- package/docs/content/locales/ja-JP/mcp-protocol.mdx +1 -1
- package/docs/content/locales/ja-JP/security.mdx +2 -0
- package/docs/content/locales/ko-KR/authentication.mdx +2 -2
- package/docs/content/locales/ko-KR/external-agents.mdx +8 -7
- package/docs/content/locales/ko-KR/mcp-protocol.mdx +1 -1
- package/docs/content/locales/ko-KR/security.mdx +2 -0
- package/docs/content/locales/pt-BR/authentication.mdx +2 -2
- package/docs/content/locales/pt-BR/external-agents.mdx +8 -7
- package/docs/content/locales/pt-BR/mcp-protocol.mdx +1 -1
- package/docs/content/locales/pt-BR/security.mdx +2 -0
- package/docs/content/locales/zh-CN/authentication.mdx +2 -2
- package/docs/content/locales/zh-CN/external-agents.mdx +8 -7
- package/docs/content/locales/zh-CN/mcp-protocol.mdx +1 -1
- package/docs/content/locales/zh-CN/security.mdx +2 -0
- package/docs/content/locales/zh-TW/authentication.mdx +2 -2
- package/docs/content/locales/zh-TW/external-agents.mdx +8 -7
- package/docs/content/locales/zh-TW/mcp-protocol.mdx +1 -1
- package/docs/content/locales/zh-TW/security.mdx +2 -0
- package/docs/content/mcp-protocol.mdx +1 -1
- package/docs/content/security.mdx +2 -0
- package/package.json +6 -2
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -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/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
- package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
- package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
- package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
- package/src/templates/workspace-core/src/server/index.ts +4 -2
- package/corpus/core/src/client/ProductionAgentPanel.tsx +0 -9
- package/corpus/core/src/client/auth-redirect-url.ts +0 -23
- package/corpus/core/src/client/useProductionAgent.ts +0 -253
- package/corpus/core/src/shared/auth-redirect-url.ts +0 -1
- package/corpus/templates/analytics/app/pages/Index.tsx +0 -16
- package/corpus/templates/analytics/seeds/dashboards/agent-observability-llm.json +0 -173
- package/dist/client/ProductionAgentPanel.d.ts +0 -6
- package/dist/client/ProductionAgentPanel.d.ts.map +0 -1
- package/dist/client/ProductionAgentPanel.js +0 -6
- package/dist/client/ProductionAgentPanel.js.map +0 -1
- package/dist/client/auth-redirect-url.d.ts +0 -2
- package/dist/client/auth-redirect-url.d.ts.map +0 -1
- package/dist/client/auth-redirect-url.js +0 -19
- package/dist/client/auth-redirect-url.js.map +0 -1
- package/dist/client/useProductionAgent.d.ts +0 -24
- package/dist/client/useProductionAgent.d.ts.map +0 -1
- package/dist/client/useProductionAgent.js +0 -179
- package/dist/client/useProductionAgent.js.map +0 -1
- package/dist/shared/auth-redirect-url.d.ts +0 -2
- package/dist/shared/auth-redirect-url.d.ts.map +0 -1
- package/dist/shared/auth-redirect-url.js +0 -2
- package/dist/shared/auth-redirect-url.js.map +0 -1
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
* send button (Cursor replaces send with mic; their users complain — we
|
|
8
8
|
* don't copy that).
|
|
9
9
|
*/
|
|
10
|
+
import { type VoiceProviderStatus } from "../voice-provider-status.js";
|
|
10
11
|
import type { VoiceDictationApi } from "./useVoiceDictation.js";
|
|
11
12
|
export interface VoiceButtonProps {
|
|
12
13
|
voice: VoiceDictationApi;
|
|
13
14
|
isMac: boolean;
|
|
14
15
|
disabled?: boolean;
|
|
15
16
|
}
|
|
17
|
+
export declare function isRealtimeVoiceSetupRequired(status: VoiceProviderStatus | null, builderConfigured: boolean | null): boolean;
|
|
16
18
|
export declare function VoiceButton({ voice, isMac, disabled }: VoiceButtonProps): import("react").JSX.Element | null;
|
|
17
19
|
export interface VoiceRecordingOverlayProps {
|
|
18
20
|
voice: VoiceDictationApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceButton.d.ts","sourceRoot":"","sources":["../../../src/client/composer/VoiceButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"VoiceButton.d.ts","sourceRoot":"","sources":["../../../src/client/composer/VoiceButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAeH,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,6BAA6B,CAAC;AAMrC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAYhE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,iBAAiB,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,mBAAmB,GAAG,IAAI,EAClC,iBAAiB,EAAE,OAAO,GAAG,IAAI,GAChC,OAAO,CAOT;AAED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,gBAAgB,sCA8EvE;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAED,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,EAAE,0BAA0B,sCAqF1E"}
|
|
@@ -11,7 +11,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
11
11
|
import { IconMicrophone, IconPlayerStopFilled, IconLoader2, IconX, } from "@tabler/icons-react";
|
|
12
12
|
import { Tooltip, TooltipContent, TooltipTrigger, } from "../components/ui/tooltip.js";
|
|
13
13
|
import { useBuilderConnectFlow } from "../settings/useBuilderStatus.js";
|
|
14
|
-
import { useVoiceProviderStatus } from "../voice-provider-status.js";
|
|
14
|
+
import { useVoiceProviderStatus, } from "../voice-provider-status.js";
|
|
15
15
|
import { RealtimeVoiceModeEntry } from "./RealtimeVoiceMode.js";
|
|
16
16
|
import { useRealtimeVoiceModeCopy, useRealtimeVoiceModeOptional, } from "./useRealtimeVoiceMode.js";
|
|
17
17
|
function openOpenAiKeySettings() {
|
|
@@ -21,6 +21,12 @@ function openOpenAiKeySettings() {
|
|
|
21
21
|
detail: { section: "secrets" },
|
|
22
22
|
}));
|
|
23
23
|
}
|
|
24
|
+
export function isRealtimeVoiceSetupRequired(status, builderConfigured) {
|
|
25
|
+
return (status !== null &&
|
|
26
|
+
!status.builder &&
|
|
27
|
+
!status.openai &&
|
|
28
|
+
builderConfigured === false);
|
|
29
|
+
}
|
|
24
30
|
export function VoiceButton({ voice, isMac, disabled }) {
|
|
25
31
|
const { state, start, stop, supported } = voice;
|
|
26
32
|
const realtimeVoice = useRealtimeVoiceModeOptional();
|
|
@@ -38,7 +44,7 @@ export function VoiceButton({ voice, isMac, disabled }) {
|
|
|
38
44
|
if (realtimeVoice?.active && !recording && !transcribing)
|
|
39
45
|
return null;
|
|
40
46
|
if (realtimeVoice && !recording && !transcribing) {
|
|
41
|
-
return (_jsx(RealtimeVoiceModeEntry, { copy: realtimeCopy, disabled: disabled, setupRequired: builderConnect.
|
|
47
|
+
return (_jsx(RealtimeVoiceModeEntry, { copy: realtimeCopy, disabled: disabled, setupRequired: isRealtimeVoiceSetupRequired(voiceProviders.status, builderConnect.statusResolved ? builderConnect.configured : null), openAiConfigured: voiceProviders.status?.openai === true, connectingBuilder: builderConnect.connecting, onConnectBuilder: builderConnect.start, onUseOpenAiKey: () => {
|
|
42
48
|
if (voiceProviders.status?.openai)
|
|
43
49
|
void realtimeVoice.start();
|
|
44
50
|
else
|
|
@@ -56,7 +62,7 @@ export function VoiceButton({ voice, isMac, disabled }) {
|
|
|
56
62
|
else if (!transcribing)
|
|
57
63
|
void start();
|
|
58
64
|
};
|
|
59
|
-
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: onClick, disabled: disabled || transcribing, "aria-label": label, "aria-pressed": recording, className: `shrink-0 flex h-7 w-7 items-center justify-center rounded-md disabled:opacity-30 disabled:cursor-not-allowed ${recording
|
|
65
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: onClick, disabled: disabled || transcribing, "aria-label": label, "aria-pressed": recording, className: `shrink-0 flex h-7 w-7 items-center justify-center rounded-md transition-colors duration-150 disabled:opacity-30 disabled:cursor-not-allowed ${recording
|
|
60
66
|
? "text-[#00B5FF] bg-[#00B5FF]/10 hover:bg-[#00B5FF]/20"
|
|
61
67
|
: "text-muted-foreground hover:text-foreground hover:bg-accent/50"}`, children: transcribing ? (_jsx(IconLoader2, { className: "h-4 w-4 animate-spin" })) : recording ? (_jsx(IconPlayerStopFilled, { className: "h-3.5 w-3.5" })) : (_jsx(IconMicrophone, { className: "h-4 w-4" })) }) }), _jsx(TooltipContent, { children: label })] }));
|
|
62
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceButton.js","sourceRoot":"","sources":["../../../src/client/composer/VoiceButton.tsx"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,WAAW,EACX,KAAK,GACN,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AAGnC,SAAS,qBAAqB;IAC5B,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACjD,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACpD,MAAM,CAAC,aAAa,CAClB,IAAI,WAAW,CAAC,2BAA2B,EAAE;QAC3C,MAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;KAC/B,CAAC,CACH,CAAC;AACJ,CAAC;AAQD,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAoB;IACtE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAChD,MAAM,aAAa,GAAG,4BAA4B,EAAE,CAAC;IACrD,MAAM,YAAY,GAAG,wBAAwB,EAAE,CAAC;IAChD,MAAM,cAAc,GAAG,sBAAsB,EAA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ay for the agent composer.\n *\n * UX mirrors Lovable: click-to-toggle record, a live amplitude bar and\n * MM:SS timer replace the editor area while recording, and a cancel X\n * discards without transcribing. The mic is always visible alongside the\n * send button (Cursor replaces send with mic; their users complain — we\n * don't copy that).\n */\n\nimport {\n IconMicrophone,\n IconPlayerStopFilled,\n IconLoader2,\n IconX,\n} from \"@tabler/icons-react\";\n\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\nimport { useBuilderConnectFlow } from \"../settings/useBuilderStatus.js\";\nimport { useVoiceProviderStatus } from \"../voice-provider-status.js\";\nimport { RealtimeVoiceModeEntry } from \"./RealtimeVoiceMode.js\";\nimport {\n useRealtimeVoiceModeCopy,\n useRealtimeVoiceModeOptional,\n} from \"./useRealtimeVoiceMode.js\";\nimport type { VoiceDictationApi } from \"./useVoiceDictation.js\";\n\nfunction openOpenAiKeySettings(): void {\n window.location.hash = \"#secrets:OPENAI_API_KEY\";\n window.dispatchEvent(new Event(\"agent-panel:open\"));\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:open-settings\", {\n detail: { section: \"secrets\" },\n }),\n );\n}\n\nexport interface VoiceButtonProps {\n voice: VoiceDictationApi;\n isMac: boolean;\n disabled?: boolean;\n}\n\nexport function VoiceButton({ voice, isMac, disabled }: VoiceButtonProps) {\n const { state, start, stop, supported } = voice;\n const realtimeVoice = useRealtimeVoiceModeOptional();\n const realtimeCopy = useRealtimeVoiceModeCopy();\n const voiceProviders = useVoiceProviderStatus();\n const builderConnect = useBuilderConnectFlow({\n trackingSource: \"realtime_voice\",\n trackingFlow: \"voice_transcription\",\n onConnected: () => voiceProviders.refresh(),\n });\n\n if (!supported) return null;\n\n const recording = state === \"recording\" || state === \"starting\";\n const transcribing = state === \"transcribing\";\n\n if (realtimeVoice?.active && !recording && !transcribing) return null;\n\n if (realtimeVoice && !recording && !transcribing) {\n return (\n <RealtimeVoiceModeEntry\n copy={realtimeCopy}\n disabled={disabled}\n setupRequired={\n builderConnect.hasFetchedStatus && !builderConnect.configured\n }\n openAiConfigured={voiceProviders.status?.openai === true}\n connectingBuilder={builderConnect.connecting}\n onConnectBuilder={builderConnect.start}\n onUseOpenAiKey={() => {\n if (voiceProviders.status?.openai) void realtimeVoice.start();\n else openOpenAiKeySettings();\n }}\n onStartVoiceMode={() => void realtimeVoice.start()}\n onKeepDictating={() => void start()}\n />\n );\n }\n\n const label = recording\n ? \"Stop recording\"\n : transcribing\n ? \"Transcribing…\"\n : `Dictate (${isMac ? \"⌘⇧M\" : \"Ctrl+Shift+M\"})`;\n\n const onClick = () => {\n if (recording) stop();\n else if (!transcribing) void start();\n };\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled || transcribing}\n aria-label={label}\n aria-pressed={recording}\n className={`shrink-0 flex h-7 w-7 items-center justify-center rounded-md disabled:opacity-30 disabled:cursor-not-allowed ${\n recording\n ? \"text-[#00B5FF] bg-[#00B5FF]/10 hover:bg-[#00B5FF]/20\"\n : \"text-muted-foreground hover:text-foreground hover:bg-accent/50\"\n }`}\n >\n {transcribing ? (\n <IconLoader2 className=\"h-4 w-4 animate-spin\" />\n ) : recording ? (\n <IconPlayerStopFilled className=\"h-3.5 w-3.5\" />\n ) : (\n <IconMicrophone className=\"h-4 w-4\" />\n )}\n </button>\n </TooltipTrigger>\n <TooltipContent>{label}</TooltipContent>\n </Tooltip>\n );\n}\n\nexport interface VoiceRecordingOverlayProps {\n voice: VoiceDictationApi;\n}\n\nexport function VoiceRecordingOverlay({ voice }: VoiceRecordingOverlayProps) {\n const { state, amplitude, durationMs, errorMessage, cancel } = voice;\n const { dismissError, start } = voice;\n\n if (state === \"error\" && errorMessage) {\n return (\n <div\n role=\"alert\"\n className=\"mx-2 mt-1 flex items-start gap-2 rounded-md border border-red-500/40 bg-red-500/10 px-2 py-1.5 text-[11px] text-red-500\"\n >\n <span className=\"flex-1 min-w-0\">{errorMessage}</span>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() => {\n dismissError();\n void start();\n }}\n className=\"shrink-0 cursor-pointer rounded px-1.5 py-0.5 text-[11px] font-medium text-red-500 hover:bg-red-500/20\"\n aria-label=\"Try again\"\n >\n Try again\n </button>\n </TooltipTrigger>\n <TooltipContent>Try again</TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={dismissError}\n className=\"shrink-0 flex h-4 w-4 cursor-pointer items-center justify-center rounded text-red-500 hover:bg-red-500/20\"\n aria-label=\"Dismiss\"\n >\n <IconX className=\"h-3 w-3\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>Dismiss</TooltipContent>\n </Tooltip>\n </div>\n );\n }\n\n if (state !== \"recording\" && state !== \"starting\" && state !== \"transcribing\")\n return null;\n\n return (\n <div\n className=\"flex items-center gap-2 mx-2 mt-2 mb-1 h-[2rem] rounded-md border border-[#00B5FF]/40 bg-[#00B5FF]/10 px-2\"\n aria-live=\"polite\"\n >\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={cancel}\n className=\"shrink-0 flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n aria-label=\"Cancel recording\"\n >\n <IconX className=\"h-3 w-3\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>Cancel (Esc)</TooltipContent>\n </Tooltip>\n\n <div className=\"flex-1 flex items-center gap-[2px] min-w-0 h-4\">\n {state === \"transcribing\" ? (\n <span className=\"text-[11px] text-muted-foreground\">\n Transcribing…\n </span>\n ) : (\n <AmplitudeBars amplitude={amplitude} />\n )}\n </div>\n\n <span className=\"shrink-0 text-[11px] font-medium tabular-nums text-muted-foreground\">\n {state === \"transcribing\" ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n formatDuration(durationMs)\n )}\n </span>\n </div>\n );\n}\n\nconst BAR_COUNT = 24;\n\nfunction AmplitudeBars({ amplitude }: { amplitude: number }) {\n // Render a symmetric meter — the middle bars peak first so the visual\n // matches what voice input looks like in Lovable / iOS dictation.\n const bars = [];\n for (let i = 0; i < BAR_COUNT; i++) {\n const centerDistance =\n Math.abs(i - (BAR_COUNT - 1) / 2) / ((BAR_COUNT - 1) / 2);\n const heightPct =\n Math.max(0.1, amplitude * (1 - centerDistance * 0.6)) * 100;\n bars.push(\n <span\n key={i}\n className=\"flex-1 rounded-full bg-[#00B5FF]\"\n style={{ height: `${heightPct}%`, minHeight: 2 }}\n />,\n );\n }\n return <>{bars}</>;\n}\n\nfunction formatDuration(ms: number): string {\n const total = Math.floor(ms / 1000);\n const m = Math.floor(total / 60);\n const s = total % 60;\n return `${m}:${s.toString().padStart(2, \"0\")}`;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"VoiceButton.js","sourceRoot":"","sources":["../../../src/client/composer/VoiceButton.tsx"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,WAAW,EACX,KAAK,GACN,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAEL,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AAGnC,SAAS,qBAAqB;IAC5B,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACjD,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACpD,MAAM,CAAC,aAAa,CAClB,IAAI,WAAW,CAAC,2BAA2B,EAAE;QAC3C,MAAM,EAAE,EAAE,OAAO,EAAE,SAAS,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I,CACP,eAEE,SAAS,EAAC,kCAAkC,EAC5C,KAAK,EAAE,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,IAF3C,CAAC,CAGN,CACH,CAAC;IACJ,CAAC;IACD,OAAO,4BAAG,IAAI,GAAI,CAAC;AACrB,CAAC;AAED,SAAS,cAAc,CAAC,EAAU;IAChC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;IACjC,MAAM,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;IACrB,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AACjD,CAAC","sourcesContent":["/**\n * Voice dictation button + recording overlay for the agent composer.\n *\n * UX mirrors Lovable: click-to-toggle record, a live amplitude bar and\n * MM:SS timer replace the editor area while recording, and a cancel X\n * discards without transcribing. The mic is always visible alongside the\n * send button (Cursor replaces send with mic; their users complain — we\n * don't copy that).\n */\n\nimport {\n IconMicrophone,\n IconPlayerStopFilled,\n IconLoader2,\n IconX,\n} from \"@tabler/icons-react\";\n\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\nimport { useBuilderConnectFlow } from \"../settings/useBuilderStatus.js\";\nimport {\n type VoiceProviderStatus,\n useVoiceProviderStatus,\n} from \"../voice-provider-status.js\";\nimport { RealtimeVoiceModeEntry } from \"./RealtimeVoiceMode.js\";\nimport {\n useRealtimeVoiceModeCopy,\n useRealtimeVoiceModeOptional,\n} from \"./useRealtimeVoiceMode.js\";\nimport type { VoiceDictationApi } from \"./useVoiceDictation.js\";\n\nfunction openOpenAiKeySettings(): void {\n window.location.hash = \"#secrets:OPENAI_API_KEY\";\n window.dispatchEvent(new Event(\"agent-panel:open\"));\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:open-settings\", {\n detail: { section: \"secrets\" },\n }),\n );\n}\n\nexport interface VoiceButtonProps {\n voice: VoiceDictationApi;\n isMac: boolean;\n disabled?: boolean;\n}\n\nexport function isRealtimeVoiceSetupRequired(\n status: VoiceProviderStatus | null,\n builderConfigured: boolean | null,\n): boolean {\n return (\n status !== null &&\n !status.builder &&\n !status.openai &&\n builderConfigured === false\n );\n}\n\nexport function VoiceButton({ voice, isMac, disabled }: VoiceButtonProps) {\n const { state, start, stop, supported } = voice;\n const realtimeVoice = useRealtimeVoiceModeOptional();\n const realtimeCopy = useRealtimeVoiceModeCopy();\n const voiceProviders = useVoiceProviderStatus();\n const builderConnect = useBuilderConnectFlow({\n trackingSource: \"realtime_voice\",\n trackingFlow: \"voice_transcription\",\n onConnected: () => voiceProviders.refresh(),\n });\n\n if (!supported) return null;\n\n const recording = state === \"recording\" || state === \"starting\";\n const transcribing = state === \"transcribing\";\n\n if (realtimeVoice?.active && !recording && !transcribing) return null;\n\n if (realtimeVoice && !recording && !transcribing) {\n return (\n <RealtimeVoiceModeEntry\n copy={realtimeCopy}\n disabled={disabled}\n setupRequired={isRealtimeVoiceSetupRequired(\n voiceProviders.status,\n builderConnect.statusResolved ? builderConnect.configured : null,\n )}\n openAiConfigured={voiceProviders.status?.openai === true}\n connectingBuilder={builderConnect.connecting}\n onConnectBuilder={builderConnect.start}\n onUseOpenAiKey={() => {\n if (voiceProviders.status?.openai) void realtimeVoice.start();\n else openOpenAiKeySettings();\n }}\n onStartVoiceMode={() => void realtimeVoice.start()}\n onKeepDictating={() => void start()}\n />\n );\n }\n\n const label = recording\n ? \"Stop recording\"\n : transcribing\n ? \"Transcribing…\"\n : `Dictate (${isMac ? \"⌘⇧M\" : \"Ctrl+Shift+M\"})`;\n\n const onClick = () => {\n if (recording) stop();\n else if (!transcribing) void start();\n };\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled || transcribing}\n aria-label={label}\n aria-pressed={recording}\n className={`shrink-0 flex h-7 w-7 items-center justify-center rounded-md transition-colors duration-150 disabled:opacity-30 disabled:cursor-not-allowed ${\n recording\n ? \"text-[#00B5FF] bg-[#00B5FF]/10 hover:bg-[#00B5FF]/20\"\n : \"text-muted-foreground hover:text-foreground hover:bg-accent/50\"\n }`}\n >\n {transcribing ? (\n <IconLoader2 className=\"h-4 w-4 animate-spin\" />\n ) : recording ? (\n <IconPlayerStopFilled className=\"h-3.5 w-3.5\" />\n ) : (\n <IconMicrophone className=\"h-4 w-4\" />\n )}\n </button>\n </TooltipTrigger>\n <TooltipContent>{label}</TooltipContent>\n </Tooltip>\n );\n}\n\nexport interface VoiceRecordingOverlayProps {\n voice: VoiceDictationApi;\n}\n\nexport function VoiceRecordingOverlay({ voice }: VoiceRecordingOverlayProps) {\n const { state, amplitude, durationMs, errorMessage, cancel } = voice;\n const { dismissError, start } = voice;\n\n if (state === \"error\" && errorMessage) {\n return (\n <div\n role=\"alert\"\n className=\"mx-2 mt-1 flex items-start gap-2 rounded-md border border-red-500/40 bg-red-500/10 px-2 py-1.5 text-[11px] text-red-500\"\n >\n <span className=\"flex-1 min-w-0\">{errorMessage}</span>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() => {\n dismissError();\n void start();\n }}\n className=\"shrink-0 cursor-pointer rounded px-1.5 py-0.5 text-[11px] font-medium text-red-500 hover:bg-red-500/20\"\n aria-label=\"Try again\"\n >\n Try again\n </button>\n </TooltipTrigger>\n <TooltipContent>Try again</TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={dismissError}\n className=\"shrink-0 flex h-4 w-4 cursor-pointer items-center justify-center rounded text-red-500 hover:bg-red-500/20\"\n aria-label=\"Dismiss\"\n >\n <IconX className=\"h-3 w-3\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>Dismiss</TooltipContent>\n </Tooltip>\n </div>\n );\n }\n\n if (state !== \"recording\" && state !== \"starting\" && state !== \"transcribing\")\n return null;\n\n return (\n <div\n className=\"flex items-center gap-2 mx-2 mt-2 mb-1 h-[2rem] rounded-md border border-[#00B5FF]/40 bg-[#00B5FF]/10 px-2\"\n aria-live=\"polite\"\n >\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={cancel}\n className=\"shrink-0 flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n aria-label=\"Cancel recording\"\n >\n <IconX className=\"h-3 w-3\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>Cancel (Esc)</TooltipContent>\n </Tooltip>\n\n <div className=\"flex-1 flex items-center gap-[2px] min-w-0 h-4\">\n {state === \"transcribing\" ? (\n <span className=\"text-[11px] text-muted-foreground\">\n Transcribing…\n </span>\n ) : (\n <AmplitudeBars amplitude={amplitude} />\n )}\n </div>\n\n <span className=\"shrink-0 text-[11px] font-medium tabular-nums text-muted-foreground\">\n {state === \"transcribing\" ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n formatDuration(durationMs)\n )}\n </span>\n </div>\n );\n}\n\nconst BAR_COUNT = 24;\n\nfunction AmplitudeBars({ amplitude }: { amplitude: number }) {\n // Render a symmetric meter — the middle bars peak first so the visual\n // matches what voice input looks like in Lovable / iOS dictation.\n const bars = [];\n for (let i = 0; i < BAR_COUNT; i++) {\n const centerDistance =\n Math.abs(i - (BAR_COUNT - 1) / 2) / ((BAR_COUNT - 1) / 2);\n const heightPct =\n Math.max(0.1, amplitude * (1 - centerDistance * 0.6)) * 100;\n bars.push(\n <span\n key={i}\n className=\"flex-1 rounded-full bg-[#00B5FF]\"\n style={{ height: `${heightPct}%`, minHeight: 2 }}\n />,\n );\n }\n return <>{bars}</>;\n}\n\nfunction formatDuration(ms: number): string {\n const total = Math.floor(ms / 1000);\n const m = Math.floor(total / 60);\n const s = total % 60;\n return `${m}:${s.toString().padStart(2, \"0\")}`;\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type RealtimeVoiceAudioLevelStore } from "./realtime-voice-audio-level.js";
|
|
3
3
|
import { type RealtimeVoiceModeCopy, type RealtimeVoiceModeState } from "./RealtimeVoiceMode.js";
|
|
4
|
+
export declare const REALTIME_VOICE_AUDIO_CONSTRAINTS: MediaTrackConstraints;
|
|
4
5
|
type RealtimeServerEvent = Record<string, unknown> & {
|
|
5
6
|
type?: string;
|
|
6
7
|
};
|
|
@@ -36,6 +37,8 @@ export interface RealtimeVoiceModeProviderProps {
|
|
|
36
37
|
children: ReactNode;
|
|
37
38
|
browserTabId?: string;
|
|
38
39
|
}
|
|
40
|
+
export declare function isRealtimeVoiceAbortError(error: unknown): boolean;
|
|
41
|
+
export declare function createRealtimeVoiceConnectionTimeout(onTimeout: () => void, timeoutMs?: number): () => void;
|
|
39
42
|
export declare function createRealtimeVoiceSession(offerSdp: string, options?: {
|
|
40
43
|
browserTabId?: string;
|
|
41
44
|
signal?: AbortSignal;
|
|
@@ -53,6 +56,8 @@ export declare function extractRealtimeVoiceFunctionCalls(event: RealtimeServerE
|
|
|
53
56
|
callId: string;
|
|
54
57
|
argumentsText: string;
|
|
55
58
|
}>;
|
|
59
|
+
export declare function endRealtimeVoiceBeforeNavigation(end: () => void, navigate: () => void): void;
|
|
60
|
+
export declare function listenForRealtimeVoicePageHide(cleanup: () => void): () => void;
|
|
56
61
|
export declare function useRealtimeVoiceModeCopy(): RealtimeVoiceModeCopy;
|
|
57
62
|
export declare function RealtimeVoiceModeProvider({ children, browserTabId, }: RealtimeVoiceModeProviderProps): import("react").JSX.Element;
|
|
58
63
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRealtimeVoiceMode.d.ts","sourceRoot":"","sources":["../../../src/client/composer/useRealtimeVoiceMode.tsx"],"names":[],"mappings":"AAAA,OAAO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AAA;CAAE,CAAC,CAmChE;AAkCD,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,MAAM,IAAI,EACf,QAAQ,EAAE,MAAM,IAAI,GACnB,IAAI,CAGN;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,MAAM,IAAI,GAClB,MAAM,IAAI,CAGZ;AAqCD,wBAAgB,wBAAwB,IAAI,qBAAqB,CAGhE;AAmhBD,wBAAgB,yBAAyB,CAAC,EACxC,QAAQ,EACR,YAAY,GACb,EAAE,8BAA8B,+BAiChC;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,QAAQ,EACR,YAAY,GACb,EAAE,8BAA8B,+BAgBhC;AAWD,wBAAgB,oBAAoB,IAAI,oBAAoB,CAQ3D;AAED,wBAAgB,4BAA4B,IAAI,oBAAoB,GAAG,IAAI,CAE1E;AAED,wBAAsB,wBAAwB,IAAI,OAAO,CAAC;IACxD,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,OAAO,CAAC;CACd,CAAC,CAMD"}
|
|
@@ -3,7 +3,7 @@ import { createContext, useCallback, useContext, useEffect, useMemo, useRef, use
|
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
import { requestAgentChatThreadOpen } from "../agent-chat.js";
|
|
5
5
|
import { SIDEBAR_STATE_CHANGE_EVENT, } from "../agent-sidebar-state.js";
|
|
6
|
-
import { agentNativePath } from "../api-path.js";
|
|
6
|
+
import { agentNativePath, appPath } from "../api-path.js";
|
|
7
7
|
import { readClientAppState, setClientAppState } from "../application-state.js";
|
|
8
8
|
import { getBrowserTabId } from "../browser-tab-id.js";
|
|
9
9
|
import { useT } from "../i18n.js";
|
|
@@ -14,6 +14,16 @@ const REALTIME_VOICE_STATE_KEY = "realtime-voice-session";
|
|
|
14
14
|
const REALTIME_VOICE_REQUEST_SOURCE = "realtime-voice";
|
|
15
15
|
const REALTIME_VOICE_SESSION_PATH = "/_agent-native/realtime-voice/session";
|
|
16
16
|
const REALTIME_VOICE_TOOL_PATH = "/_agent-native/realtime-voice/tool";
|
|
17
|
+
const REALTIME_VOICE_CONNECTION_TIMEOUT_MS = 15_000;
|
|
18
|
+
export const REALTIME_VOICE_AUDIO_CONSTRAINTS = {
|
|
19
|
+
// Prefer the browser/OS-selected input instead of whichever physical device
|
|
20
|
+
// happens to be enumerated first. `ideal` keeps browsers without the
|
|
21
|
+
// synthetic `default` device from failing with OverconstrainedError.
|
|
22
|
+
deviceId: { ideal: "default" },
|
|
23
|
+
echoCancellation: true,
|
|
24
|
+
noiseSuppression: true,
|
|
25
|
+
autoGainControl: true,
|
|
26
|
+
};
|
|
17
27
|
/**
|
|
18
28
|
* Voice mode owns the chat only temporarily. Restore the captured transcript
|
|
19
29
|
* when it is still the user's active thread (or the chat has no active thread)
|
|
@@ -41,6 +51,15 @@ export function extractCompletedRealtimeVoiceTranscript(event) {
|
|
|
41
51
|
function errorMessage(error) {
|
|
42
52
|
return error instanceof Error ? error.message : String(error);
|
|
43
53
|
}
|
|
54
|
+
export function isRealtimeVoiceAbortError(error) {
|
|
55
|
+
return Boolean(error &&
|
|
56
|
+
typeof error === "object" &&
|
|
57
|
+
error.name === "AbortError");
|
|
58
|
+
}
|
|
59
|
+
export function createRealtimeVoiceConnectionTimeout(onTimeout, timeoutMs = REALTIME_VOICE_CONNECTION_TIMEOUT_MS) {
|
|
60
|
+
const timeout = window.setTimeout(onTimeout, timeoutMs);
|
|
61
|
+
return () => window.clearTimeout(timeout);
|
|
62
|
+
}
|
|
44
63
|
async function readErrorResponse(response) {
|
|
45
64
|
const raw = await response.text().catch(() => "");
|
|
46
65
|
if (!raw)
|
|
@@ -160,6 +179,19 @@ function openOpenAiKeySettings() {
|
|
|
160
179
|
detail: { section: "secrets" },
|
|
161
180
|
}));
|
|
162
181
|
}
|
|
182
|
+
function openMicrophoneSettings() {
|
|
183
|
+
if (typeof window === "undefined")
|
|
184
|
+
return;
|
|
185
|
+
window.location.assign(`${appPath("/settings")}#voice`);
|
|
186
|
+
}
|
|
187
|
+
export function endRealtimeVoiceBeforeNavigation(end, navigate) {
|
|
188
|
+
end();
|
|
189
|
+
window.setTimeout(navigate, 0);
|
|
190
|
+
}
|
|
191
|
+
export function listenForRealtimeVoicePageHide(cleanup) {
|
|
192
|
+
window.addEventListener("pagehide", cleanup);
|
|
193
|
+
return () => window.removeEventListener("pagehide", cleanup);
|
|
194
|
+
}
|
|
163
195
|
function voiceCopy(t) {
|
|
164
196
|
return {
|
|
165
197
|
entryButtonLabel: t("agentPanel.voiceMode.entryButtonLabel"),
|
|
@@ -175,6 +207,7 @@ function voiceCopy(t) {
|
|
|
175
207
|
showChat: t("agentPanel.voiceMode.showChat"),
|
|
176
208
|
hideChat: t("agentPanel.voiceMode.hideChat"),
|
|
177
209
|
endVoiceMode: t("agentPanel.voiceMode.end"),
|
|
210
|
+
microphoneSettings: t("agentPanel.voiceMode.microphoneSettings"),
|
|
178
211
|
status: {
|
|
179
212
|
connecting: t("agentPanel.voiceMode.status.connecting"),
|
|
180
213
|
listening: t("agentPanel.voiceMode.status.listening"),
|
|
@@ -217,6 +250,7 @@ function useRealtimeVoiceModeController(browserTabId, copy) {
|
|
|
217
250
|
const meterFrameRef = useRef(null);
|
|
218
251
|
const lastMeterSampleRef = useRef(0);
|
|
219
252
|
const abortRef = useRef(null);
|
|
253
|
+
const cancelConnectionTimeoutRef = useRef(null);
|
|
220
254
|
const handledCallsRef = useRef(new Set());
|
|
221
255
|
const sessionIdRef = useRef(undefined);
|
|
222
256
|
const startedAtRef = useRef(undefined);
|
|
@@ -309,6 +343,8 @@ function useRealtimeVoiceModeController(browserTabId, copy) {
|
|
|
309
343
|
}
|
|
310
344
|
}, [startMeterLoop]);
|
|
311
345
|
const cleanupTransport = useCallback(() => {
|
|
346
|
+
cancelConnectionTimeoutRef.current?.();
|
|
347
|
+
cancelConnectionTimeoutRef.current = null;
|
|
312
348
|
abortRef.current?.abort();
|
|
313
349
|
abortRef.current = null;
|
|
314
350
|
channelRef.current?.close();
|
|
@@ -498,14 +534,29 @@ function useRealtimeVoiceModeController(browserTabId, copy) {
|
|
|
498
534
|
window.dispatchEvent(new Event("agent-panel:close"));
|
|
499
535
|
const abortController = new AbortController();
|
|
500
536
|
abortRef.current = abortController;
|
|
537
|
+
const isCurrentAttempt = () => abortRef.current === abortController && !abortController.signal.aborted;
|
|
538
|
+
const markConnected = () => {
|
|
539
|
+
if (!isCurrentAttempt())
|
|
540
|
+
return;
|
|
541
|
+
cancelConnectionTimeoutRef.current?.();
|
|
542
|
+
cancelConnectionTimeoutRef.current = null;
|
|
543
|
+
transition("listening");
|
|
544
|
+
};
|
|
545
|
+
cancelConnectionTimeoutRef.current = createRealtimeVoiceConnectionTimeout(() => {
|
|
546
|
+
if (!isCurrentAttempt())
|
|
547
|
+
return;
|
|
548
|
+
fail(copy?.errors.connectionFailed ??
|
|
549
|
+
"The realtime voice connection timed out.");
|
|
550
|
+
});
|
|
501
551
|
try {
|
|
502
552
|
const stream = await navigator.mediaDevices.getUserMedia({
|
|
503
|
-
audio:
|
|
504
|
-
echoCancellation: true,
|
|
505
|
-
noiseSuppression: true,
|
|
506
|
-
autoGainControl: true,
|
|
507
|
-
},
|
|
553
|
+
audio: REALTIME_VOICE_AUDIO_CONSTRAINTS,
|
|
508
554
|
});
|
|
555
|
+
if (!isCurrentAttempt()) {
|
|
556
|
+
for (const track of stream.getTracks())
|
|
557
|
+
track.stop();
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
509
560
|
streamRef.current = stream;
|
|
510
561
|
attachAudioMeter(stream, "input");
|
|
511
562
|
const peer = new RTCPeerConnection();
|
|
@@ -525,8 +576,10 @@ function useRealtimeVoiceModeController(browserTabId, copy) {
|
|
|
525
576
|
};
|
|
526
577
|
const channel = peer.createDataChannel("oai-events");
|
|
527
578
|
channelRef.current = channel;
|
|
528
|
-
channel.onopen =
|
|
579
|
+
channel.onopen = markConnected;
|
|
529
580
|
channel.onmessage = (messageEvent) => {
|
|
581
|
+
if (!isCurrentAttempt())
|
|
582
|
+
return;
|
|
530
583
|
try {
|
|
531
584
|
handleServerEvent(JSON.parse(String(messageEvent.data)));
|
|
532
585
|
}
|
|
@@ -534,18 +587,28 @@ function useRealtimeVoiceModeController(browserTabId, copy) {
|
|
|
534
587
|
// Ignore malformed provider events without ending a healthy call.
|
|
535
588
|
}
|
|
536
589
|
};
|
|
537
|
-
channel.onerror = () =>
|
|
538
|
-
|
|
590
|
+
channel.onerror = () => {
|
|
591
|
+
if (!isCurrentAttempt())
|
|
592
|
+
return;
|
|
593
|
+
fail(copy?.errors.channelDisconnected ??
|
|
594
|
+
"The realtime voice control channel disconnected.");
|
|
595
|
+
};
|
|
539
596
|
peer.onconnectionstatechange = () => {
|
|
597
|
+
if (!isCurrentAttempt())
|
|
598
|
+
return;
|
|
540
599
|
if (peer.connectionState === "connected")
|
|
541
|
-
|
|
600
|
+
markConnected();
|
|
542
601
|
if (peer.connectionState === "failed") {
|
|
543
602
|
fail(copy?.errors.connectionFailed ??
|
|
544
603
|
"The realtime voice connection failed.");
|
|
545
604
|
}
|
|
546
605
|
};
|
|
547
606
|
const offer = await peer.createOffer();
|
|
607
|
+
if (!isCurrentAttempt())
|
|
608
|
+
return;
|
|
548
609
|
await peer.setLocalDescription(offer);
|
|
610
|
+
if (!isCurrentAttempt())
|
|
611
|
+
return;
|
|
549
612
|
if (!offer.sdp) {
|
|
550
613
|
throw new Error(copy?.errors.offerFailed ??
|
|
551
614
|
"The browser did not create an audio offer.");
|
|
@@ -554,9 +617,19 @@ function useRealtimeVoiceModeController(browserTabId, copy) {
|
|
|
554
617
|
browserTabId,
|
|
555
618
|
signal: abortController.signal,
|
|
556
619
|
});
|
|
620
|
+
if (!isCurrentAttempt())
|
|
621
|
+
return;
|
|
557
622
|
await peer.setRemoteDescription({ type: "answer", sdp: answerSdp });
|
|
558
623
|
}
|
|
559
624
|
catch (startError) {
|
|
625
|
+
// Ending a connection aborts the SDP request by design. A superseded
|
|
626
|
+
// attempt must never resurrect the dock or surface that cancellation as
|
|
627
|
+
// an error after cleanup.
|
|
628
|
+
if (isRealtimeVoiceAbortError(startError) ||
|
|
629
|
+
abortController.signal.aborted ||
|
|
630
|
+
abortRef.current !== abortController) {
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
560
633
|
const status = startError?.status;
|
|
561
634
|
fail(errorMessage(startError), { openKeySettings: status === 400 });
|
|
562
635
|
}
|
|
@@ -609,7 +682,13 @@ function useRealtimeVoiceModeController(browserTabId, copy) {
|
|
|
609
682
|
window.addEventListener(SIDEBAR_STATE_CHANGE_EVENT, onSidebarState);
|
|
610
683
|
return () => window.removeEventListener(SIDEBAR_STATE_CHANGE_EVENT, onSidebarState);
|
|
611
684
|
}, []);
|
|
612
|
-
useEffect(() =>
|
|
685
|
+
useEffect(() => {
|
|
686
|
+
const stopListening = listenForRealtimeVoicePageHide(cleanupTransport);
|
|
687
|
+
return () => {
|
|
688
|
+
stopListening();
|
|
689
|
+
cleanupTransport();
|
|
690
|
+
};
|
|
691
|
+
}, [cleanupTransport]);
|
|
613
692
|
return {
|
|
614
693
|
state,
|
|
615
694
|
active: state !== "idle",
|
|
@@ -627,7 +706,7 @@ export function RealtimeVoiceModeProvider({ children, browserTabId, }) {
|
|
|
627
706
|
const copy = useRealtimeVoiceModeCopy();
|
|
628
707
|
const voice = useRealtimeVoiceModeController(resolvedBrowserTabId, copy);
|
|
629
708
|
return (_jsxs(RealtimeVoiceModeContext.Provider, { value: voice, children: [children, voice.active && typeof document !== "undefined"
|
|
630
|
-
? createPortal(_jsx(RealtimeVoiceModeDock, { state: voice.state === "idle" ? "ending" : voice.state, copy: copy, chatVisible: voice.chatVisible, audioLevels: voice.audioLevels, onToggleChat: voice.toggleChat, onEndVoiceMode: voice.end, errorMessage: voice.errorMessage }), document.body)
|
|
709
|
+
? createPortal(_jsx(RealtimeVoiceModeDock, { state: voice.state === "idle" ? "ending" : voice.state, copy: copy, chatVisible: voice.chatVisible, audioLevels: voice.audioLevels, onToggleChat: voice.toggleChat, onEndVoiceMode: voice.end, onOpenMicrophoneSettings: () => endRealtimeVoiceBeforeNavigation(voice.end, openMicrophoneSettings), errorMessage: voice.errorMessage }), document.body)
|
|
631
710
|
: null] }));
|
|
632
711
|
}
|
|
633
712
|
/**
|