@agent-native/core 0.122.4 → 0.123.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 +538 -0
- package/corpus/core/docs/content/actions.mdx +33 -20
- package/corpus/core/docs/content/agent-mentions.mdx +30 -19
- package/corpus/core/docs/content/agent-native-toolkit.mdx +8 -6
- package/corpus/core/docs/content/agent-resources.mdx +11 -0
- package/corpus/core/docs/content/agent-surfaces.mdx +41 -30
- package/corpus/core/docs/content/audit-log.mdx +78 -0
- package/corpus/core/docs/content/authentication.mdx +7 -5
- package/corpus/core/docs/content/automations.mdx +15 -9
- package/corpus/core/docs/content/client.mdx +11 -11
- package/corpus/core/docs/content/cloneable-saas.mdx +7 -1
- package/corpus/core/docs/content/code-agents-ui.mdx +9 -1
- package/corpus/core/docs/content/components.mdx +7 -0
- package/corpus/core/docs/content/context-awareness.mdx +1 -0
- package/corpus/core/docs/content/creating-templates.mdx +9 -1
- package/corpus/core/docs/content/custom-design-system.mdx +8 -0
- package/corpus/core/docs/content/data-programs.mdx +6 -0
- package/corpus/core/docs/content/deployment.mdx +2 -0
- package/corpus/core/docs/content/doctor.mdx +5 -3
- package/corpus/core/docs/content/extensions.mdx +26 -0
- package/corpus/core/docs/content/external-agents-catalog.mdx +533 -0
- package/corpus/core/docs/content/external-agents.mdx +20 -514
- package/corpus/core/docs/content/faq.mdx +2 -2
- package/corpus/core/docs/content/file-uploads.mdx +44 -0
- package/corpus/core/docs/content/frames.mdx +2 -2
- package/corpus/core/docs/content/generative-ui.mdx +8 -0
- package/corpus/core/docs/content/getting-started.mdx +45 -17
- package/corpus/core/docs/content/human-approval.mdx +9 -0
- package/corpus/core/docs/content/integrations.mdx +4 -3
- package/corpus/core/docs/content/internationalization.mdx +4 -11
- package/corpus/core/docs/content/key-concepts.mdx +1 -1
- package/corpus/core/docs/content/local-file-mode.mdx +5 -0
- package/corpus/core/docs/content/mcp-apps.mdx +2 -1
- package/corpus/core/docs/content/mcp-clients.mdx +32 -1
- package/corpus/core/docs/content/mcp-protocol.mdx +4 -3
- package/corpus/core/docs/content/messaging-internals.mdx +328 -0
- package/corpus/core/docs/content/messaging-recipes.mdx +194 -0
- package/corpus/core/docs/content/messaging.mdx +9 -307
- package/corpus/core/docs/content/multi-app-workspace.mdx +1 -1
- package/corpus/core/docs/content/multi-tenancy.mdx +1 -0
- package/corpus/core/docs/content/native-chat-ui.mdx +8 -0
- package/corpus/core/docs/content/notifications.mdx +18 -20
- package/corpus/core/docs/content/observability.mdx +1 -0
- package/corpus/core/docs/content/onboarding.mdx +20 -6
- package/corpus/core/docs/content/organizations-teams-permissions.mdx +99 -124
- package/corpus/core/docs/content/package-lifecycle.mdx +19 -7
- package/corpus/core/docs/content/progress.mdx +11 -0
- package/corpus/core/docs/content/real-time-collaboration.mdx +44 -3
- package/corpus/core/docs/content/recurring-jobs.mdx +14 -1
- package/corpus/core/docs/content/security.mdx +5 -2
- package/corpus/core/docs/content/server.mdx +2 -1
- package/corpus/core/docs/content/sharing.mdx +22 -3
- package/corpus/core/docs/content/skills-guide.mdx +62 -19
- package/corpus/core/docs/content/syncing-template-changes.mdx +9 -0
- package/corpus/core/docs/content/template-analytics-connectors.mdx +75 -0
- package/corpus/core/docs/content/template-analytics-dashboards.mdx +106 -0
- package/corpus/core/docs/content/template-analytics-developers.mdx +287 -0
- package/corpus/core/docs/content/template-analytics-monitoring-and-sessions.mdx +109 -0
- package/corpus/core/docs/content/template-analytics.mdx +21 -263
- package/corpus/core/docs/content/template-assets-developers.mdx +456 -0
- package/corpus/core/docs/content/template-assets-generation.mdx +147 -0
- package/corpus/core/docs/content/template-assets-integrations.mdx +319 -0
- package/corpus/core/docs/content/template-assets-presets.mdx +185 -0
- package/corpus/core/docs/content/template-assets.mdx +12 -562
- package/corpus/core/docs/content/template-brain-agent.mdx +103 -0
- package/corpus/core/docs/content/template-brain-developers.mdx +379 -0
- package/corpus/core/docs/content/template-brain-knowledge.mdx +50 -0
- package/corpus/core/docs/content/template-brain-sources.mdx +163 -0
- package/corpus/core/docs/content/template-brain.mdx +30 -390
- package/corpus/core/docs/content/template-calendar-agent.mdx +133 -0
- package/corpus/core/docs/content/template-calendar-booking-links.mdx +73 -0
- package/corpus/core/docs/content/template-calendar-developers.mdx +366 -0
- package/corpus/core/docs/content/template-calendar-scheduling.mdx +128 -0
- package/corpus/core/docs/content/template-calendar.mdx +13 -260
- package/corpus/core/docs/content/template-chat-developers.mdx +88 -0
- package/corpus/core/docs/content/template-chat-first-edits.mdx +145 -0
- package/corpus/core/docs/content/template-chat.mdx +12 -77
- package/corpus/core/docs/content/template-clips-ai-and-editing.mdx +114 -0
- package/corpus/core/docs/content/template-clips-capture-everywhere.mdx +120 -0
- package/corpus/core/docs/content/template-clips-developers.mdx +373 -0
- package/corpus/core/docs/content/template-clips-sharing-and-teams.mdx +182 -0
- package/corpus/core/docs/content/template-clips.mdx +19 -508
- package/corpus/core/docs/content/template-content-databases.mdx +406 -0
- package/corpus/core/docs/content/template-content-developers.mdx +364 -0
- package/corpus/core/docs/content/template-content-editing.mdx +60 -0
- package/corpus/core/docs/content/template-content-sync.mdx +149 -0
- package/corpus/core/docs/content/template-content.mdx +21 -561
- package/corpus/core/docs/content/template-design-brand-and-figma.mdx +150 -0
- package/corpus/core/docs/content/template-design-collaboration-and-full-apps.mdx +125 -0
- package/corpus/core/docs/content/template-design-developers.mdx +358 -0
- package/corpus/core/docs/content/template-design-quality-and-components.mdx +95 -0
- package/corpus/core/docs/content/template-design.mdx +20 -344
- package/corpus/core/docs/content/template-dispatch-developers.mdx +121 -0
- package/corpus/core/docs/content/template-dispatch-messaging-routing.mdx +114 -0
- package/corpus/core/docs/content/template-dispatch-operations.mdx +160 -0
- package/corpus/core/docs/content/template-dispatch-vault-integrations.mdx +316 -0
- package/corpus/core/docs/content/template-dispatch.mdx +24 -283
- package/corpus/core/docs/content/template-forms-building-publishing.mdx +135 -0
- package/corpus/core/docs/content/template-forms-developers.mdx +195 -0
- package/corpus/core/docs/content/template-forms-responses.mdx +120 -0
- package/corpus/core/docs/content/template-forms.mdx +21 -230
- package/corpus/core/docs/content/template-mail-agent.mdx +114 -0
- package/corpus/core/docs/content/template-mail-developers.mdx +356 -0
- package/corpus/core/docs/content/template-mail-drafts-and-queue.mdx +103 -0
- package/corpus/core/docs/content/template-mail-inbox.mdx +118 -0
- package/corpus/core/docs/content/template-mail.mdx +23 -274
- package/corpus/core/docs/content/template-plan-automations.mdx +213 -0
- package/corpus/core/docs/content/template-plan-developers.mdx +703 -0
- package/corpus/core/docs/content/template-plan-local-and-desktop.mdx +236 -0
- package/corpus/core/docs/content/template-plan-review-workflow.mdx +180 -0
- package/corpus/core/docs/content/template-plan.mdx +60 -910
- package/corpus/core/docs/content/template-slides-agent.mdx +102 -0
- package/corpus/core/docs/content/template-slides-design-and-media.mdx +94 -0
- package/corpus/core/docs/content/template-slides-developers.mdx +488 -0
- package/corpus/core/docs/content/template-slides-editing.mdx +56 -0
- package/corpus/core/docs/content/template-slides.mdx +20 -362
- package/corpus/core/docs/content/toolkit-capability-packages.mdx +38 -13
- package/corpus/core/docs/content/toolkit-context-knowledge.mdx +49 -9
- package/corpus/core/docs/content/toolkit-editors-canvases.mdx +72 -10
- package/corpus/core/docs/content/toolkit-resources.mdx +16 -0
- package/corpus/core/docs/content/toolkit-settings.mdx +3 -3
- package/corpus/core/docs/content/toolkit-sharing.mdx +5 -7
- package/corpus/core/docs/content/using-your-agent.mdx +25 -2
- package/corpus/core/docs/content/voice-input.mdx +11 -7
- package/corpus/core/docs/content/what-is-agent-native.mdx +1 -0
- package/corpus/core/docs/content/workspace-connections.mdx +21 -11
- package/corpus/core/docs/content/workspace-management.mdx +1 -1
- package/corpus/core/package.json +1 -3
- package/corpus/core/src/a2a/client.ts +4 -2
- package/corpus/core/src/agent/action-warnings.ts +103 -0
- package/corpus/core/src/agent/durable-background.ts +42 -5
- package/corpus/core/src/agent/engine/ai-sdk-engine.ts +58 -6
- package/corpus/core/src/agent/engine/anthropic-engine.ts +51 -8
- package/corpus/core/src/agent/engine/builder-engine.ts +56 -18
- package/corpus/core/src/agent/engine/continuation-dispatch-retry.ts +10 -9
- package/corpus/core/src/agent/engine/credential-errors.ts +11 -0
- package/corpus/core/src/agent/engine/error-detail.ts +39 -0
- package/corpus/core/src/agent/engine/prompt-cache.ts +44 -0
- package/corpus/core/src/agent/engine/registry.ts +22 -30
- package/corpus/core/src/agent/engine/tool-call-journal-seed.ts +2 -1
- package/corpus/core/src/agent/engine/translate-anthropic.ts +99 -0
- package/corpus/core/src/agent/loop-settings.ts +94 -7
- package/corpus/core/src/agent/production-agent.ts +667 -157
- package/corpus/core/src/agent/run-loop-with-resume.ts +27 -1
- package/corpus/core/src/agent/run-manager.ts +229 -39
- package/corpus/core/src/agent/run-store.ts +397 -64
- package/corpus/core/src/agent/thread-data-builder.ts +5 -1
- package/corpus/core/src/agent/types.ts +23 -6
- package/corpus/core/src/application-state/script-helpers.ts +5 -2
- package/corpus/core/src/cli/agents.ts +69 -1
- package/corpus/core/src/cli/app-skill.ts +1 -1
- package/corpus/core/src/cli/code-agent-executor.ts +7 -3
- package/corpus/core/src/cli/design-connect.ts +82 -8
- package/corpus/core/src/cli/skills-content/design-visual-edit-skill.ts +169 -24
- package/corpus/core/src/client/AssistantChat.tsx +623 -607
- package/corpus/core/src/client/agent-chat-adapter.ts +176 -29
- package/corpus/core/src/client/chat/message-components.tsx +13 -0
- package/corpus/core/src/client/embed-auth.ts +3 -1
- package/corpus/core/src/client/integrations/IntegrationCard.tsx +41 -24
- package/corpus/core/src/client/integrations/IntegrationsPanel.tsx +37 -21
- package/corpus/core/src/client/integrations/webhook-url.ts +29 -0
- package/corpus/core/src/client/org/OrgSwitcher.tsx +41 -27
- package/corpus/core/src/client/org/RequireActiveOrg.tsx +7 -0
- package/corpus/core/src/client/org/TeamPage.tsx +144 -14
- package/corpus/core/src/client/org/hooks.ts +27 -0
- package/corpus/core/src/client/org/index.ts +2 -0
- package/corpus/core/src/client/require-session.tsx +40 -29
- package/corpus/core/src/client/session-replay.ts +1 -1
- package/corpus/core/src/client/settings/DemoModeSection.tsx +0 -5
- package/corpus/core/src/client/settings/SecretsSection.tsx +47 -42
- package/corpus/core/src/client/settings/VoiceTranscriptionSection.tsx +0 -5
- package/corpus/core/src/client/sse-event-processor.ts +83 -8
- package/corpus/core/src/client/use-action.ts +22 -13
- package/corpus/core/src/client/use-agent-engine-configured.ts +36 -4
- package/corpus/core/src/client/use-db-sync.ts +21 -1
- package/corpus/core/src/credentials/index.ts +124 -2
- package/corpus/core/src/deploy/build.ts +93 -30
- package/corpus/core/src/deploy/workspace-deploy.ts +21 -16
- package/corpus/core/src/guards/no-localhost-fallback.ts +76 -14
- package/corpus/core/src/integrations/google-docs-poller.ts +19 -12
- package/corpus/core/src/integrations/webhook-handler.ts +56 -33
- package/corpus/core/src/jobs/scheduler.ts +57 -23
- package/corpus/core/src/localization/default-messages.ts +23 -1
- package/corpus/core/src/observability/evals.ts +7 -8
- package/corpus/core/src/observability/traces.ts +2 -0
- package/corpus/core/src/org/accept-pending.ts +2 -2
- package/corpus/core/src/org/active-org.ts +73 -0
- package/corpus/core/src/org/auto-join-domain.ts +7 -2
- package/corpus/core/src/org/context.ts +169 -66
- package/corpus/core/src/org/handlers.ts +148 -10
- package/corpus/core/src/org/plugin.ts +8 -1
- package/corpus/core/src/org/types.ts +6 -1
- package/corpus/core/src/provider-api/index.ts +6 -1
- package/corpus/core/src/resources/handlers.ts +2 -6
- package/corpus/core/src/resources/script-helpers.ts +2 -1
- package/corpus/core/src/scripts/chat/search-chats.ts +5 -2
- package/corpus/core/src/scripts/describe-workspace-apps.ts +59 -0
- package/corpus/core/src/scripts/resources/delete-memory.ts +5 -2
- package/corpus/core/src/scripts/resources/delete.ts +5 -2
- package/corpus/core/src/scripts/resources/effective.ts +5 -2
- package/corpus/core/src/scripts/resources/list.ts +5 -2
- package/corpus/core/src/scripts/resources/read.ts +5 -2
- package/corpus/core/src/scripts/resources/save-memory.ts +5 -2
- package/corpus/core/src/scripts/resources/write.ts +5 -2
- package/corpus/core/src/server/agent-capabilities.ts +147 -0
- package/corpus/core/src/server/agent-chat/framework-prompts.ts +11 -13
- package/corpus/core/src/server/agent-chat/prompt-resources.ts +183 -57
- package/corpus/core/src/server/agent-chat/script-entries.ts +20 -7
- package/corpus/core/src/server/agent-chat-plugin.ts +27 -0
- package/corpus/core/src/server/auth.ts +38 -32
- package/corpus/core/src/server/core-routes-plugin.ts +229 -179
- package/corpus/core/src/server/credential-provider.ts +196 -44
- package/corpus/core/src/server/embed-session.ts +10 -0
- package/corpus/core/src/server/framework-request-handler.ts +43 -0
- package/corpus/core/src/server/google-auth-plugin.ts +13 -450
- package/corpus/core/src/server/index.ts +4 -1
- package/corpus/core/src/server/onboarding-html.ts +20 -56
- package/corpus/core/src/server/open-route.ts +6 -1
- package/corpus/core/src/server/poll.ts +1 -1
- package/corpus/core/src/server/prompts/framework-core-compact.ts +5 -5
- package/corpus/core/src/server/prompts/framework-core.ts +7 -9
- package/corpus/core/src/server/prompts/shared-rules.ts +20 -9
- package/corpus/core/src/server/request-context.ts +58 -2
- package/corpus/core/src/server/scoped-key-storage.ts +1 -1
- package/corpus/core/src/settings/org-settings.ts +9 -0
- package/corpus/core/src/settings/store.ts +29 -0
- package/corpus/core/src/shared/index.ts +13 -0
- package/corpus/core/src/shared/sign-in-journey.ts +331 -0
- package/corpus/core/src/styles/agent-native.css +8 -0
- package/corpus/core/src/templates/chat/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/core/src/templates/chat/.agents/skills/adding-a-feature/SKILL.md +2 -0
- package/corpus/core/src/templates/chat/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/core/src/templates/chat/.agents/skills/security/SKILL.md +2 -0
- package/corpus/core/src/templates/chat/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/core/src/templates/chat/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/core/src/templates/chat/AGENTS.md +8 -0
- package/corpus/core/src/templates/chat/app/entry.client.tsx +3 -0
- package/corpus/core/src/templates/chat/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/core/src/templates/chat/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/core/src/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/core/src/templates/default/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/core/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +2 -0
- package/corpus/core/src/templates/default/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/core/src/templates/default/.agents/skills/security/SKILL.md +2 -0
- package/corpus/core/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/core/src/templates/default/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/core/src/templates/default/AGENTS.md +68 -195
- package/corpus/core/src/templates/default/app/entry.client.tsx +3 -0
- package/corpus/core/src/templates/default/app/i18n/ar-SA.ts +8 -0
- package/corpus/core/src/templates/default/app/i18n/de-DE.ts +8 -0
- package/corpus/core/src/templates/default/app/i18n/en-US.ts +8 -0
- package/corpus/core/src/templates/default/app/i18n/es-ES.ts +8 -0
- package/corpus/core/src/templates/default/app/i18n/fr-FR.ts +8 -0
- package/corpus/core/src/templates/default/app/i18n/hi-IN.ts +8 -0
- package/corpus/core/src/templates/default/app/i18n/ja-JP.ts +8 -0
- package/corpus/core/src/templates/default/app/i18n/ko-KR.ts +8 -0
- package/corpus/core/src/templates/default/app/i18n/pt-BR.ts +8 -0
- package/corpus/core/src/templates/default/app/i18n/zh-CN.ts +8 -0
- package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +8 -0
- package/corpus/core/src/templates/headless/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +2 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +100 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +2 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +28 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +14 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/core/src/templates/workspace-core/.agents/skills/qa/SKILL.md +6 -3
- package/corpus/core/src/templates/workspace-core/.agents/skills/security/SKILL.md +2 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/core/src/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/core/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +91 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +60 -0
- package/corpus/core/src/templates/workspace-core/AGENTS.md +62 -124
- package/corpus/core/src/templates/workspace-root/AGENTS.md +6 -1
- package/corpus/core/src/triggers/dispatcher.ts +28 -17
- package/corpus/core/src/vite/client.ts +20 -8
- package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +41 -1
- package/corpus/templates/analytics/.agents/skills/dashboard-ops/SKILL.md +50 -22
- package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +1 -1
- package/corpus/templates/analytics/.agents/skills/data-querying/references/inline-chart-embeds.md +8 -0
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/analytics/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/analytics/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/templates/analytics/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/analytics/.agents/skills/sharing/SKILL.md +228 -0
- package/corpus/templates/analytics/.builder/skills/charts/SKILL.md +2 -2
- package/corpus/templates/analytics/actions/delete-dashboard-view.ts +24 -0
- package/corpus/templates/analytics/actions/delete-user-pref.ts +22 -0
- package/corpus/templates/analytics/actions/generate-chart.ts +8 -245
- package/corpus/templates/analytics/actions/get-theme.ts +27 -0
- package/corpus/templates/analytics/actions/get-user-pref.ts +22 -0
- package/corpus/templates/analytics/actions/list-dashboard-views.ts +25 -0
- package/corpus/templates/analytics/actions/save-dashboard-view.ts +33 -0
- package/corpus/templates/analytics/actions/set-theme.ts +22 -0
- package/corpus/templates/analytics/actions/set-user-pref.ts +24 -0
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +134 -27
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +2 -9
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +0 -17
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +10 -5
- package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +22 -52
- package/corpus/templates/analytics/app/hooks/use-user-pref.ts +21 -31
- package/corpus/templates/analytics/app/i18n-data.ts +10 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +2 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/dual-axis.ts +73 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +8 -27
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/report-panel-window.ts +0 -57
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +8 -0
- package/corpus/templates/analytics/app/root.tsx +0 -28
- package/corpus/templates/analytics/changelog/2026-07-26-error-issues-now-group-by-message-as-well-as-stack-frame-and.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-26-line-area-and-bar-dashboard-panels-can-plot-series-on-a-seco.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-26-scheduled-dashboard-email-reports-now-arrive-complete-and-re.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-26-session-replays-now-detect-rage-clicks-so-the-rage-click-fil.md +6 -0
- package/corpus/templates/analytics/docs/error-capture.md +8 -4
- package/corpus/templates/analytics/package.json +1 -2
- package/corpus/templates/analytics/scripts/preview-dashboard-report.ts +221 -0
- package/corpus/templates/analytics/server/jobs/dashboard-report.ts +39 -32
- package/corpus/templates/analytics/server/lib/dashboard-report-render.ts +1168 -0
- package/corpus/templates/analytics/server/lib/dashboard-report.ts +111 -1358
- package/corpus/templates/analytics/server/lib/error-capture.ts +32 -15
- package/corpus/templates/analytics/server/lib/report-chart-svg.ts +901 -0
- package/corpus/templates/analytics/server/lib/session-replay.ts +77 -1
- package/corpus/templates/analytics/shared/dashboard-report-timeouts.ts +3 -4
- package/corpus/templates/assets/.agents/skills/a2a-assets/SKILL.md +28 -0
- package/corpus/templates/assets/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/templates/assets/.agents/skills/assets-navigation/SKILL.md +46 -0
- package/corpus/templates/assets/.agents/skills/creative-context/SKILL.md +12 -0
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/assets/.agents/skills/image-generation/SKILL.md +28 -0
- package/corpus/templates/assets/.agents/skills/library-management/SKILL.md +9 -0
- package/corpus/templates/assets/.agents/skills/logo-composite/SKILL.md +11 -0
- package/corpus/templates/assets/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/assets/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/templates/assets/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/assets/.agents/skills/sharing/SKILL.md +228 -0
- package/corpus/templates/assets/AGENTS.md +58 -125
- package/corpus/templates/assets/actions/variant-slots.ts +8 -4
- package/corpus/templates/assets/app/entry.client.tsx +3 -0
- package/corpus/templates/assets/package.json +0 -2
- package/corpus/templates/brain/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/templates/brain/.agents/skills/adding-a-feature/SKILL.md +2 -0
- package/corpus/templates/brain/.agents/skills/brain/SKILL.md +78 -4
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/brain/.agents/skills/ingestion-and-connectors/SKILL.md +15 -3
- package/corpus/templates/brain/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/brain/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/templates/brain/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/brain/.agents/skills/sharing/SKILL.md +228 -0
- package/corpus/templates/brain/.agents/skills/storing-data/SKILL.md +178 -0
- package/corpus/templates/brain/AGENTS.md +73 -119
- package/corpus/templates/brain/app/entry.client.tsx +3 -0
- package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +56 -3
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/calendar/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/calendar/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/templates/calendar/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/calendar/.agents/skills/sharing/SKILL.md +228 -0
- package/corpus/templates/calendar/AGENTS.md +22 -45
- package/corpus/templates/calendar/app/entry.client.tsx +3 -0
- package/corpus/templates/calendar/server/handlers/events.ts +0 -364
- package/corpus/templates/chat/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/templates/chat/.agents/skills/adding-a-feature/SKILL.md +2 -0
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/chat/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/chat/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/templates/chat/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/chat/.agents/skills/sharing/SKILL.md +228 -0
- package/corpus/templates/chat/.agents/skills/storing-data/SKILL.md +178 -0
- package/corpus/templates/chat/AGENTS.md +8 -0
- package/corpus/templates/chat/app/entry.client.tsx +3 -0
- package/corpus/templates/clips/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/templates/clips/.agents/skills/ai-video-tools/SKILL.md +42 -0
- package/corpus/templates/clips/.agents/skills/brain-export/SKILL.md +59 -0
- package/corpus/templates/clips/.agents/skills/bug-reports/SKILL.md +37 -0
- package/corpus/templates/clips/.agents/skills/crm-call-evidence/SKILL.md +41 -0
- package/corpus/templates/clips/.agents/skills/dictate/SKILL.md +4 -0
- package/corpus/templates/clips/.agents/skills/external-integrations/SKILL.md +45 -0
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/clips/.agents/skills/meetings/SKILL.md +9 -0
- package/corpus/templates/clips/.agents/skills/recording/SKILL.md +45 -0
- package/corpus/templates/clips/.agents/skills/screen-memory/SKILL.md +43 -0
- package/corpus/templates/clips/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/clips/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/templates/clips/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/clips/.agents/skills/video-sharing/SKILL.md +38 -1
- package/corpus/templates/clips/AGENTS.md +82 -224
- package/corpus/templates/clips/actions/create-recording.ts +4 -0
- package/corpus/templates/clips/app/components/player/sign-in-prompt-dialog.tsx +6 -10
- package/corpus/templates/clips/app/routes/invite.$token.tsx +6 -5
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +4 -5
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +8 -8
- package/corpus/templates/clips/changelog/2026-07-26-long-agent-chat-turns-now-finish-instead-of-stopping-partway.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-26-recordings-no-longer-get-stuck-on-uploading-uploads-now-hold.md +6 -0
- package/corpus/templates/clips/server/db/schema.ts +3 -0
- package/corpus/templates/clips/server/jobs/brain-export.ts +4 -0
- package/corpus/templates/clips/server/lib/recording-upload-state.ts +0 -52
- package/corpus/templates/clips/server/lib/upload-lease.ts +241 -0
- package/corpus/templates/clips/server/plugins/agent-chat.ts +4 -0
- package/corpus/templates/clips/server/plugins/db.ts +18 -347
- package/corpus/templates/clips/server/routes/api/clips/brain-export/run.post.ts +7 -1
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +123 -126
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/reset-chunks.post.ts +4 -0
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/resume.get.ts +118 -0
- package/corpus/templates/clips/server/routes/api/uploads/reap.post.ts +69 -0
- package/corpus/templates/content/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/templates/content/.agents/skills/content/SKILL.md +4 -0
- package/corpus/templates/content/.agents/skills/creative-context/SKILL.md +8 -0
- package/corpus/templates/content/.agents/skills/document-editing/SKILL.md +55 -0
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/content/.agents/skills/notion-integration/SKILL.md +12 -1
- package/corpus/templates/content/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/content/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/templates/content/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/content/.agents/skills/sharing/SKILL.md +228 -0
- package/corpus/templates/content/AGENTS.md +63 -131
- package/corpus/templates/content/app/routes/_app.tsx +4 -4
- package/corpus/templates/content/server/routes/api/notion/callback.get.ts +6 -24
- package/corpus/templates/design/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +16 -0
- package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +15 -0
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/design/.agents/skills/full-app-build/SKILL.md +12 -0
- package/corpus/templates/design/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/design/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/templates/design/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/design/.agents/skills/sharing/SKILL.md +228 -0
- package/corpus/templates/design/.agents/skills/storing-data/SKILL.md +178 -0
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +201 -102
- package/corpus/templates/design/AGENTS.md +58 -71
- package/corpus/templates/design/actions/open-visual-edit.ts +111 -2
- package/corpus/templates/design/app/components/design/AddLocalhostScreenDialog.tsx +236 -0
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +1 -1
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +2 -2
- package/corpus/templates/design/app/entry.client.tsx +3 -0
- package/corpus/templates/design/app/i18n-data.ts +180 -0
- package/corpus/templates/design/app/pages/Present.tsx +6 -9
- package/corpus/templates/design/app/pages/VisualEdit.tsx +4 -7
- package/corpus/templates/design/app/pages/design-editor/design-data-geometry-utils.ts +20 -0
- package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/dispatch/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/dispatch/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/templates/dispatch/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/dispatch/.agents/skills/sharing/SKILL.md +228 -0
- package/corpus/templates/dispatch/.agents/skills/storing-data/SKILL.md +178 -0
- package/corpus/templates/dispatch/app/entry.client.tsx +3 -0
- package/corpus/templates/dispatch/server/plugins/identity-sso.ts +27 -16
- package/corpus/templates/forms/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/forms/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/forms/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/templates/forms/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/forms/.agents/skills/sharing/SKILL.md +228 -0
- package/corpus/templates/forms/DEVELOPING.md +1 -1
- package/corpus/templates/forms/app/entry.client.tsx +3 -0
- package/corpus/templates/forms/app/pages/FormsListPage.tsx +3 -5
- package/corpus/templates/forms/app/routes/_app.tsx +4 -4
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/macros/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/macros/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/macros/.agents/skills/sharing/SKILL.md +228 -0
- package/corpus/templates/macros/.agents/skills/storing-data/SKILL.md +178 -0
- package/corpus/templates/macros/app/entry.client.tsx +3 -0
- package/corpus/templates/mail/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/templates/mail/.agents/skills/contacts-and-crm/SKILL.md +10 -0
- package/corpus/templates/mail/.agents/skills/draft-queue/SKILL.md +3 -0
- package/corpus/templates/mail/.agents/skills/email-drafts/SKILL.md +26 -2
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/mail/.agents/skills/inbox-automations/SKILL.md +37 -0
- package/corpus/templates/mail/.agents/skills/inbox-reads-and-triage/SKILL.md +58 -0
- package/corpus/templates/mail/.agents/skills/mail-backends/SKILL.md +33 -0
- package/corpus/templates/mail/.agents/skills/provider-api-scans/SKILL.md +39 -0
- package/corpus/templates/mail/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/mail/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/templates/mail/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/mail/.agents/skills/sharing/SKILL.md +228 -0
- package/corpus/templates/mail/AGENTS.md +74 -143
- package/corpus/templates/mail/actions/create-alias.ts +36 -0
- package/corpus/templates/mail/actions/create-automation.ts +28 -0
- package/corpus/templates/mail/actions/create-scheduled-job.ts +45 -0
- package/corpus/templates/mail/actions/delete-alias.ts +26 -0
- package/corpus/templates/mail/actions/delete-automation.ts +21 -0
- package/corpus/templates/mail/actions/get-automation-settings.ts +32 -0
- package/corpus/templates/mail/actions/get-mail-preferences.ts +18 -0
- package/corpus/templates/mail/actions/list-aliases.ts +17 -0
- package/corpus/templates/mail/actions/list-automations.ts +18 -0
- package/corpus/templates/mail/actions/list-scheduled-jobs.ts +18 -0
- package/corpus/templates/mail/actions/update-alias.ts +37 -0
- package/corpus/templates/mail/actions/update-automation-settings.ts +33 -0
- package/corpus/templates/mail/actions/update-automation.ts +33 -0
- package/corpus/templates/mail/actions/update-mail-preferences.ts +68 -0
- package/corpus/templates/mail/actions/update-scheduled-job.ts +25 -0
- package/corpus/templates/mail/app/entry.client.tsx +3 -0
- package/corpus/templates/mail/app/hooks/use-aliases.ts +6 -36
- package/corpus/templates/mail/app/hooks/use-automations.ts +9 -16
- package/corpus/templates/mail/app/hooks/use-emails.ts +6 -5
- package/corpus/templates/mail/app/hooks/use-scheduled-jobs.ts +12 -15
- package/corpus/templates/mail/app/pages/SettingsPage.tsx +15 -9
- package/corpus/templates/mail/server/handlers/automations.ts +5 -142
- package/corpus/templates/mail/server/handlers/emails.ts +1 -56
- package/corpus/templates/mail/server/handlers/scheduled-jobs.ts +0 -134
- package/corpus/templates/mail/server/lib/aliases.ts +18 -0
- package/corpus/templates/mail/server/lib/automations.ts +104 -0
- package/corpus/templates/mail/server/lib/jobs.ts +34 -0
- package/corpus/templates/mail/server/lib/mail-settings.ts +43 -0
- package/corpus/templates/mail/shared/automation-schema.ts +10 -0
- package/corpus/templates/plan/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/templates/plan/.agents/skills/adding-a-feature/SKILL.md +2 -0
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/plan/.agents/skills/plan-authoring-flow/SKILL.md +98 -0
- package/corpus/templates/plan/.agents/skills/plan-browser-editing/SKILL.md +42 -0
- package/corpus/templates/plan/.agents/skills/plan-comments-and-feedback/SKILL.md +68 -0
- package/corpus/templates/plan/.agents/skills/plan-events/SKILL.md +22 -0
- package/corpus/templates/plan/.agents/skills/plan-hosted-writes/SKILL.md +42 -0
- package/corpus/templates/plan/.agents/skills/plan-local-codebase-chat/SKILL.md +38 -0
- package/corpus/templates/plan/.agents/skills/plan-review-recaps/SKILL.md +25 -0
- package/corpus/templates/plan/.agents/skills/plan-source-sync/SKILL.md +68 -0
- package/corpus/templates/plan/.agents/skills/plan-version-history/SKILL.md +25 -0
- package/corpus/templates/plan/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/plan/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/templates/plan/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/plan/.agents/skills/sharing/SKILL.md +228 -0
- package/corpus/templates/plan/.agents/skills/storing-data/SKILL.md +178 -0
- package/corpus/templates/plan/AGENTS.md +64 -296
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +9 -8
- package/corpus/templates/plan/app/pages/PlansPage.tsx +5 -10
- package/corpus/templates/slides/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/templates/slides/.agents/skills/deck-management/SKILL.md +7 -7
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/slides/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/slides/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/templates/slides/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/slides/.agents/skills/sharing/SKILL.md +228 -0
- package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +3 -2
- package/corpus/templates/slides/.agents/skills/storing-data/SKILL.md +178 -0
- package/corpus/templates/slides/DEVELOPING.md +3 -3
- package/corpus/templates/slides/actions/_deck-write.ts +52 -0
- package/corpus/templates/slides/actions/add-deck.ts +73 -0
- package/corpus/templates/slides/actions/delete-deck.ts +60 -0
- package/corpus/templates/slides/actions/get-deck.ts +3 -1
- package/corpus/templates/slides/actions/save-deck.ts +144 -0
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +27 -20
- package/corpus/templates/slides/app/context/DeckContext.tsx +173 -100
- package/corpus/templates/slides/app/pages/Index.tsx +3 -6
- package/corpus/templates/slides/app/routes/slide.tsx +16 -12
- package/corpus/templates/slides/changelog/2026-07-26-a-newly-created-deck-now-appears-in-the-deck-list-right-away.md +6 -0
- package/corpus/templates/slides/server/handlers/decks.ts +2 -378
- package/corpus/templates/tasks/.agents/skills/action-reference/SKILL.md +47 -0
- package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +19 -1
- package/corpus/templates/tasks/.agents/skills/adding-a-feature/SKILL.md +2 -0
- package/corpus/templates/tasks/.agents/skills/change-summary/SKILL.md +19 -1
- package/corpus/templates/tasks/.agents/skills/custom-fields/SKILL.md +63 -0
- package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +20 -6
- package/corpus/templates/tasks/.agents/skills/security/SKILL.md +2 -0
- package/corpus/templates/tasks/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/corpus/templates/tasks/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/corpus/templates/tasks/.agents/skills/sharing/SKILL.md +228 -0
- package/corpus/templates/tasks/.agents/skills/store-conventions/SKILL.md +45 -0
- package/corpus/templates/tasks/.agents/skills/storing-data/SKILL.md +178 -0
- package/corpus/templates/tasks/.agents/skills/task-inbox-workflow/SKILL.md +66 -0
- package/corpus/templates/tasks/AGENTS.md +48 -113
- package/corpus/templates/tasks/app/entry.client.tsx +3 -0
- package/corpus/toolkit/CHANGELOG.md +12 -0
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/composer/PromptComposer.tsx +23 -20
- package/dist/a2a/client.d.ts +3 -1
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +4 -2
- package/dist/a2a/client.js.map +1 -1
- package/dist/agent/action-warnings.d.ts +27 -0
- package/dist/agent/action-warnings.d.ts.map +1 -0
- package/dist/agent/action-warnings.js +73 -0
- package/dist/agent/action-warnings.js.map +1 -0
- package/dist/agent/durable-background.d.ts +8 -0
- package/dist/agent/durable-background.d.ts.map +1 -1
- package/dist/agent/durable-background.js +37 -5
- package/dist/agent/durable-background.js.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.js +47 -6
- package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
- package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
- package/dist/agent/engine/anthropic-engine.js +41 -9
- package/dist/agent/engine/anthropic-engine.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.js +46 -19
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/engine/continuation-dispatch-retry.d.ts.map +1 -1
- package/dist/agent/engine/continuation-dispatch-retry.js +11 -9
- package/dist/agent/engine/continuation-dispatch-retry.js.map +1 -1
- package/dist/agent/engine/credential-errors.d.ts +6 -0
- package/dist/agent/engine/credential-errors.d.ts.map +1 -1
- package/dist/agent/engine/credential-errors.js +10 -0
- package/dist/agent/engine/credential-errors.js.map +1 -1
- package/dist/agent/engine/error-detail.d.ts +2 -0
- package/dist/agent/engine/error-detail.d.ts.map +1 -0
- package/dist/agent/engine/error-detail.js +37 -0
- package/dist/agent/engine/error-detail.js.map +1 -0
- package/dist/agent/engine/prompt-cache.d.ts +34 -0
- package/dist/agent/engine/prompt-cache.d.ts.map +1 -0
- package/dist/agent/engine/prompt-cache.js +39 -0
- package/dist/agent/engine/prompt-cache.js.map +1 -0
- package/dist/agent/engine/registry.d.ts.map +1 -1
- package/dist/agent/engine/registry.js +23 -33
- package/dist/agent/engine/registry.js.map +1 -1
- package/dist/agent/engine/tool-call-journal-seed.d.ts +1 -1
- package/dist/agent/engine/tool-call-journal-seed.d.ts.map +1 -1
- package/dist/agent/engine/tool-call-journal-seed.js +2 -2
- package/dist/agent/engine/tool-call-journal-seed.js.map +1 -1
- package/dist/agent/engine/translate-anthropic.d.ts +28 -0
- package/dist/agent/engine/translate-anthropic.d.ts.map +1 -1
- package/dist/agent/engine/translate-anthropic.js +75 -0
- package/dist/agent/engine/translate-anthropic.js.map +1 -1
- package/dist/agent/loop-settings.d.ts +35 -2
- package/dist/agent/loop-settings.d.ts.map +1 -1
- package/dist/agent/loop-settings.js +71 -8
- package/dist/agent/loop-settings.js.map +1 -1
- package/dist/agent/production-agent.d.ts +105 -20
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +516 -123
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
- package/dist/agent/run-loop-with-resume.js +24 -2
- package/dist/agent/run-loop-with-resume.js.map +1 -1
- package/dist/agent/run-manager.d.ts +52 -9
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +191 -36
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/run-store.d.ts +87 -14
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +331 -59
- package/dist/agent/run-store.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +6 -1
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/agent/types.d.ts +18 -6
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js +9 -5
- package/dist/agent/types.js.map +1 -1
- package/dist/application-state/script-helpers.d.ts.map +1 -1
- package/dist/application-state/script-helpers.js +2 -2
- package/dist/application-state/script-helpers.js.map +1 -1
- package/dist/cli/agents.d.ts +2 -0
- package/dist/cli/agents.d.ts.map +1 -1
- package/dist/cli/agents.js +48 -1
- package/dist/cli/agents.js.map +1 -1
- package/dist/cli/app-skill.js +1 -1
- package/dist/cli/app-skill.js.map +1 -1
- package/dist/cli/code-agent-executor.d.ts.map +1 -1
- package/dist/cli/code-agent-executor.js +3 -3
- package/dist/cli/code-agent-executor.js.map +1 -1
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +73 -8
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts +1 -1
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/design-visual-edit-skill.js +169 -24
- package/dist/cli/skills-content/design-visual-edit-skill.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +135 -125
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts +17 -0
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +141 -31
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +9 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +12 -1
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/embed-auth.d.ts.map +1 -1
- package/dist/client/embed-auth.js +3 -1
- package/dist/client/embed-auth.js.map +1 -1
- package/dist/client/integrations/IntegrationCard.d.ts.map +1 -1
- package/dist/client/integrations/IntegrationCard.js +9 -4
- package/dist/client/integrations/IntegrationCard.js.map +1 -1
- package/dist/client/integrations/IntegrationsPanel.d.ts.map +1 -1
- package/dist/client/integrations/IntegrationsPanel.js +13 -7
- package/dist/client/integrations/IntegrationsPanel.js.map +1 -1
- package/dist/client/integrations/webhook-url.d.ts +7 -0
- package/dist/client/integrations/webhook-url.d.ts.map +1 -0
- package/dist/client/integrations/webhook-url.js +32 -0
- package/dist/client/integrations/webhook-url.js.map +1 -0
- package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +13 -11
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/org/RequireActiveOrg.d.ts.map +1 -1
- package/dist/client/org/RequireActiveOrg.js +2 -2
- package/dist/client/org/RequireActiveOrg.js.map +1 -1
- package/dist/client/org/TeamPage.d.ts.map +1 -1
- package/dist/client/org/TeamPage.js +52 -13
- package/dist/client/org/TeamPage.js.map +1 -1
- package/dist/client/org/hooks.d.ts +9 -0
- package/dist/client/org/hooks.d.ts.map +1 -1
- package/dist/client/org/hooks.js +24 -0
- package/dist/client/org/hooks.js.map +1 -1
- package/dist/client/org/index.d.ts +1 -1
- package/dist/client/org/index.d.ts.map +1 -1
- package/dist/client/org/index.js +1 -1
- package/dist/client/org/index.js.map +1 -1
- package/dist/client/require-session.d.ts +12 -17
- package/dist/client/require-session.d.ts.map +1 -1
- package/dist/client/require-session.js +36 -23
- package/dist/client/require-session.js.map +1 -1
- package/dist/client/session-replay.js +1 -1
- package/dist/client/session-replay.js.map +1 -1
- package/dist/client/settings/DemoModeSection.d.ts +0 -1
- package/dist/client/settings/DemoModeSection.d.ts.map +1 -1
- package/dist/client/settings/DemoModeSection.js +0 -4
- package/dist/client/settings/DemoModeSection.js.map +1 -1
- package/dist/client/settings/SecretsSection.d.ts.map +1 -1
- package/dist/client/settings/SecretsSection.js +12 -8
- package/dist/client/settings/SecretsSection.js.map +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.d.ts +0 -1
- package/dist/client/settings/VoiceTranscriptionSection.d.ts.map +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.js +1 -4
- package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts +33 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +83 -8
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/client/use-action.d.ts.map +1 -1
- package/dist/client/use-action.js +23 -14
- package/dist/client/use-action.js.map +1 -1
- package/dist/client/use-agent-engine-configured.d.ts +9 -3
- package/dist/client/use-agent-engine-configured.d.ts.map +1 -1
- package/dist/client/use-agent-engine-configured.js +30 -3
- package/dist/client/use-agent-engine-configured.js.map +1 -1
- package/dist/client/use-db-sync.d.ts +3 -0
- package/dist/client/use-db-sync.d.ts.map +1 -1
- package/dist/client/use-db-sync.js +18 -1
- package/dist/client/use-db-sync.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/credentials/index.d.ts +29 -1
- package/dist/credentials/index.d.ts.map +1 -1
- package/dist/credentials/index.js +111 -2
- package/dist/credentials/index.js.map +1 -1
- package/dist/deploy/build.d.ts +14 -3
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +81 -24
- package/dist/deploy/build.js.map +1 -1
- package/dist/deploy/workspace-deploy.d.ts +15 -0
- package/dist/deploy/workspace-deploy.d.ts.map +1 -1
- package/dist/deploy/workspace-deploy.js +19 -18
- package/dist/deploy/workspace-deploy.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +2 -2
- package/dist/guards/no-localhost-fallback.d.ts +7 -0
- package/dist/guards/no-localhost-fallback.d.ts.map +1 -1
- package/dist/guards/no-localhost-fallback.js +75 -16
- package/dist/guards/no-localhost-fallback.js.map +1 -1
- package/dist/integrations/google-docs-poller.d.ts.map +1 -1
- package/dist/integrations/google-docs-poller.js +8 -3
- package/dist/integrations/google-docs-poller.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +22 -4
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/jobs/scheduler.d.ts +17 -0
- package/dist/jobs/scheduler.d.ts.map +1 -1
- package/dist/jobs/scheduler.js +60 -33
- package/dist/jobs/scheduler.js.map +1 -1
- package/dist/localization/default-messages.d.ts +17 -1
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +17 -1
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/evals.d.ts.map +1 -1
- package/dist/observability/evals.js +7 -10
- package/dist/observability/evals.js.map +1 -1
- package/dist/observability/routes.d.ts +1 -1
- package/dist/observability/traces.d.ts +2 -0
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js.map +1 -1
- package/dist/org/accept-pending.js +2 -2
- package/dist/org/accept-pending.js.map +1 -1
- package/dist/org/active-org.d.ts +16 -0
- package/dist/org/active-org.d.ts.map +1 -0
- package/dist/org/active-org.js +57 -0
- package/dist/org/active-org.js.map +1 -0
- package/dist/org/auto-join-domain.d.ts.map +1 -1
- package/dist/org/auto-join-domain.js +3 -2
- package/dist/org/auto-join-domain.js.map +1 -1
- package/dist/org/context.d.ts +19 -1
- package/dist/org/context.d.ts.map +1 -1
- package/dist/org/context.js +159 -71
- package/dist/org/context.js.map +1 -1
- package/dist/org/handlers.d.ts +24 -1
- package/dist/org/handlers.d.ts.map +1 -1
- package/dist/org/handlers.js +129 -10
- package/dist/org/handlers.js.map +1 -1
- package/dist/org/plugin.d.ts +2 -0
- package/dist/org/plugin.d.ts.map +1 -1
- package/dist/org/plugin.js +9 -2
- package/dist/org/plugin.js.map +1 -1
- package/dist/org/types.d.ts +6 -1
- package/dist/org/types.d.ts.map +1 -1
- package/dist/org/types.js.map +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +9 -9
- package/dist/provider-api/actions/provider-api.d.ts +11 -11
- package/dist/provider-api/index.d.ts.map +1 -1
- package/dist/provider-api/index.js +3 -2
- package/dist/provider-api/index.js.map +1 -1
- package/dist/resources/handlers.d.ts.map +1 -1
- package/dist/resources/handlers.js +2 -7
- package/dist/resources/handlers.js.map +1 -1
- package/dist/resources/script-helpers.d.ts.map +1 -1
- package/dist/resources/script-helpers.js +2 -2
- package/dist/resources/script-helpers.js.map +1 -1
- package/dist/scripts/chat/search-chats.d.ts.map +1 -1
- package/dist/scripts/chat/search-chats.js +2 -2
- package/dist/scripts/chat/search-chats.js.map +1 -1
- package/dist/scripts/describe-workspace-apps.d.ts +4 -0
- package/dist/scripts/describe-workspace-apps.d.ts.map +1 -0
- package/dist/scripts/describe-workspace-apps.js +34 -0
- package/dist/scripts/describe-workspace-apps.js.map +1 -0
- package/dist/scripts/resources/delete-memory.d.ts.map +1 -1
- package/dist/scripts/resources/delete-memory.js +2 -2
- package/dist/scripts/resources/delete-memory.js.map +1 -1
- package/dist/scripts/resources/delete.d.ts.map +1 -1
- package/dist/scripts/resources/delete.js +2 -2
- package/dist/scripts/resources/delete.js.map +1 -1
- package/dist/scripts/resources/effective.d.ts.map +1 -1
- package/dist/scripts/resources/effective.js +2 -2
- package/dist/scripts/resources/effective.js.map +1 -1
- package/dist/scripts/resources/list.d.ts.map +1 -1
- package/dist/scripts/resources/list.js +2 -2
- package/dist/scripts/resources/list.js.map +1 -1
- package/dist/scripts/resources/read.d.ts.map +1 -1
- package/dist/scripts/resources/read.js +2 -2
- package/dist/scripts/resources/read.js.map +1 -1
- package/dist/scripts/resources/save-memory.d.ts.map +1 -1
- package/dist/scripts/resources/save-memory.js +2 -2
- package/dist/scripts/resources/save-memory.js.map +1 -1
- package/dist/scripts/resources/write.d.ts.map +1 -1
- package/dist/scripts/resources/write.js +2 -2
- package/dist/scripts/resources/write.js.map +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-capabilities.d.ts +21 -0
- package/dist/server/agent-capabilities.d.ts.map +1 -0
- package/dist/server/agent-capabilities.js +106 -0
- package/dist/server/agent-capabilities.js.map +1 -0
- package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -1
- package/dist/server/agent-chat/framework-prompts.js +11 -13
- package/dist/server/agent-chat/framework-prompts.js.map +1 -1
- package/dist/server/agent-chat/prompt-resources.d.ts +32 -0
- package/dist/server/agent-chat/prompt-resources.d.ts.map +1 -1
- package/dist/server/agent-chat/prompt-resources.js +117 -56
- package/dist/server/agent-chat/prompt-resources.js.map +1 -1
- package/dist/server/agent-chat/script-entries.d.ts.map +1 -1
- package/dist/server/agent-chat/script-entries.js +18 -8
- package/dist/server/agent-chat/script-entries.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +27 -1
- 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/auth.d.ts +9 -9
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +32 -33
- package/dist/server/auth.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts +45 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +162 -139
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/credential-provider.d.ts +35 -2
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +155 -40
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/embed-session.d.ts.map +1 -1
- package/dist/server/embed-session.js +10 -0
- package/dist/server/embed-session.js.map +1 -1
- package/dist/server/framework-request-handler.d.ts.map +1 -1
- package/dist/server/framework-request-handler.js +38 -0
- package/dist/server/framework-request-handler.js.map +1 -1
- package/dist/server/google-auth-plugin.d.ts.map +1 -1
- package/dist/server/google-auth-plugin.js +12 -444
- package/dist/server/google-auth-plugin.js.map +1 -1
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +20 -56
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/open-route.d.ts.map +1 -1
- package/dist/server/open-route.js +6 -1
- package/dist/server/open-route.js.map +1 -1
- package/dist/server/poll.js +1 -1
- package/dist/server/poll.js.map +1 -1
- package/dist/server/prompts/framework-core-compact.d.ts.map +1 -1
- package/dist/server/prompts/framework-core-compact.js +5 -6
- package/dist/server/prompts/framework-core-compact.js.map +1 -1
- package/dist/server/prompts/framework-core.d.ts.map +1 -1
- package/dist/server/prompts/framework-core.js +7 -10
- package/dist/server/prompts/framework-core.js.map +1 -1
- package/dist/server/prompts/shared-rules.d.ts +20 -2
- package/dist/server/prompts/shared-rules.d.ts.map +1 -1
- package/dist/server/prompts/shared-rules.js +20 -10
- package/dist/server/prompts/shared-rules.js.map +1 -1
- package/dist/server/request-context.d.ts +26 -1
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/request-context.js +52 -2
- package/dist/server/request-context.js.map +1 -1
- package/dist/server/scoped-key-storage.js +1 -1
- package/dist/server/scoped-key-storage.js.map +1 -1
- package/dist/settings/org-settings.d.ts +2 -0
- package/dist/settings/org-settings.d.ts.map +1 -1
- package/dist/settings/org-settings.js +5 -1
- package/dist/settings/org-settings.js.map +1 -1
- package/dist/settings/store.d.ts +6 -0
- package/dist/settings/store.d.ts.map +1 -1
- package/dist/settings/store.js +25 -0
- package/dist/settings/store.js.map +1 -1
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +1 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/sign-in-journey.d.ts +102 -0
- package/dist/shared/sign-in-journey.d.ts.map +1 -0
- package/dist/shared/sign-in-journey.js +269 -0
- package/dist/shared/sign-in-journey.js.map +1 -0
- package/dist/styles/agent-native.css +8 -0
- package/dist/templates/chat/.agents/skills/actions/SKILL.md +19 -1
- package/dist/templates/chat/.agents/skills/adding-a-feature/SKILL.md +2 -0
- package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +20 -6
- package/dist/templates/chat/.agents/skills/security/SKILL.md +2 -0
- package/dist/templates/chat/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/dist/templates/chat/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/dist/templates/chat/.agents/skills/sharing/SKILL.md +228 -0
- package/dist/templates/chat/.agents/skills/storing-data/SKILL.md +178 -0
- package/dist/templates/chat/AGENTS.md +8 -0
- package/dist/templates/chat/app/entry.client.tsx +3 -0
- package/dist/templates/default/.agents/skills/actions/SKILL.md +19 -1
- package/dist/templates/default/.agents/skills/adding-a-feature/SKILL.md +2 -0
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +20 -6
- package/dist/templates/default/.agents/skills/security/SKILL.md +2 -0
- package/dist/templates/default/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/dist/templates/default/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/dist/templates/default/AGENTS.md +68 -195
- package/dist/templates/default/app/entry.client.tsx +3 -0
- package/dist/templates/default/app/i18n/ar-SA.ts +8 -0
- package/dist/templates/default/app/i18n/de-DE.ts +8 -0
- package/dist/templates/default/app/i18n/en-US.ts +8 -0
- package/dist/templates/default/app/i18n/es-ES.ts +8 -0
- package/dist/templates/default/app/i18n/fr-FR.ts +8 -0
- package/dist/templates/default/app/i18n/hi-IN.ts +8 -0
- package/dist/templates/default/app/i18n/ja-JP.ts +8 -0
- package/dist/templates/default/app/i18n/ko-KR.ts +8 -0
- package/dist/templates/default/app/i18n/pt-BR.ts +8 -0
- package/dist/templates/default/app/i18n/zh-CN.ts +8 -0
- package/dist/templates/default/app/i18n/zh-TW.ts +8 -0
- package/dist/templates/headless/.agents/skills/actions/SKILL.md +19 -1
- package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +19 -1
- package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +2 -0
- package/dist/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +100 -0
- package/dist/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +2 -1
- package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +28 -0
- package/dist/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +14 -1
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +20 -6
- package/dist/templates/workspace-core/.agents/skills/qa/SKILL.md +6 -3
- package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +2 -0
- package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/dist/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +91 -0
- package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +60 -0
- package/dist/templates/workspace-core/AGENTS.md +62 -124
- package/dist/templates/workspace-root/AGENTS.md +6 -1
- package/dist/triggers/dispatcher.d.ts.map +1 -1
- package/dist/triggers/dispatcher.js +10 -3
- package/dist/triggers/dispatcher.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +18 -8
- package/dist/vite/client.js.map +1 -1
- package/docs/content/actions.mdx +33 -20
- package/docs/content/agent-mentions.mdx +30 -19
- package/docs/content/agent-native-toolkit.mdx +8 -6
- package/docs/content/agent-resources.mdx +11 -0
- package/docs/content/agent-surfaces.mdx +41 -30
- package/docs/content/audit-log.mdx +78 -0
- package/docs/content/authentication.mdx +7 -5
- package/docs/content/automations.mdx +15 -9
- package/docs/content/client.mdx +11 -11
- package/docs/content/cloneable-saas.mdx +7 -1
- package/docs/content/code-agents-ui.mdx +9 -1
- package/docs/content/components.mdx +7 -0
- package/docs/content/context-awareness.mdx +1 -0
- package/docs/content/creating-templates.mdx +9 -1
- package/docs/content/custom-design-system.mdx +8 -0
- package/docs/content/data-programs.mdx +6 -0
- package/docs/content/deployment.mdx +2 -0
- package/docs/content/doctor.mdx +5 -3
- package/docs/content/extensions.mdx +26 -0
- package/docs/content/external-agents-catalog.mdx +533 -0
- package/docs/content/external-agents.mdx +20 -514
- package/docs/content/faq.mdx +2 -2
- package/docs/content/file-uploads.mdx +44 -0
- package/docs/content/frames.mdx +2 -2
- package/docs/content/generative-ui.mdx +8 -0
- package/docs/content/getting-started.mdx +45 -17
- package/docs/content/human-approval.mdx +9 -0
- package/docs/content/integrations.mdx +4 -3
- package/docs/content/internationalization.mdx +4 -11
- package/docs/content/key-concepts.mdx +1 -1
- package/docs/content/local-file-mode.mdx +5 -0
- package/docs/content/mcp-apps.mdx +2 -1
- package/docs/content/mcp-clients.mdx +32 -1
- package/docs/content/mcp-protocol.mdx +4 -3
- package/docs/content/messaging-internals.mdx +328 -0
- package/docs/content/messaging-recipes.mdx +194 -0
- package/docs/content/messaging.mdx +9 -307
- package/docs/content/multi-app-workspace.mdx +1 -1
- package/docs/content/multi-tenancy.mdx +1 -0
- package/docs/content/native-chat-ui.mdx +8 -0
- package/docs/content/notifications.mdx +18 -20
- package/docs/content/observability.mdx +1 -0
- package/docs/content/onboarding.mdx +20 -6
- package/docs/content/organizations-teams-permissions.mdx +99 -124
- package/docs/content/package-lifecycle.mdx +19 -7
- package/docs/content/progress.mdx +11 -0
- package/docs/content/real-time-collaboration.mdx +44 -3
- package/docs/content/recurring-jobs.mdx +14 -1
- package/docs/content/security.mdx +5 -2
- package/docs/content/server.mdx +2 -1
- package/docs/content/sharing.mdx +22 -3
- package/docs/content/skills-guide.mdx +62 -19
- package/docs/content/syncing-template-changes.mdx +9 -0
- package/docs/content/template-analytics-connectors.mdx +75 -0
- package/docs/content/template-analytics-dashboards.mdx +106 -0
- package/docs/content/template-analytics-developers.mdx +287 -0
- package/docs/content/template-analytics-monitoring-and-sessions.mdx +109 -0
- package/docs/content/template-analytics.mdx +21 -263
- package/docs/content/template-assets-developers.mdx +456 -0
- package/docs/content/template-assets-generation.mdx +147 -0
- package/docs/content/template-assets-integrations.mdx +319 -0
- package/docs/content/template-assets-presets.mdx +185 -0
- package/docs/content/template-assets.mdx +12 -562
- package/docs/content/template-brain-agent.mdx +103 -0
- package/docs/content/template-brain-developers.mdx +379 -0
- package/docs/content/template-brain-knowledge.mdx +50 -0
- package/docs/content/template-brain-sources.mdx +163 -0
- package/docs/content/template-brain.mdx +30 -390
- package/docs/content/template-calendar-agent.mdx +133 -0
- package/docs/content/template-calendar-booking-links.mdx +73 -0
- package/docs/content/template-calendar-developers.mdx +366 -0
- package/docs/content/template-calendar-scheduling.mdx +128 -0
- package/docs/content/template-calendar.mdx +13 -260
- package/docs/content/template-chat-developers.mdx +88 -0
- package/docs/content/template-chat-first-edits.mdx +145 -0
- package/docs/content/template-chat.mdx +12 -77
- package/docs/content/template-clips-ai-and-editing.mdx +114 -0
- package/docs/content/template-clips-capture-everywhere.mdx +120 -0
- package/docs/content/template-clips-developers.mdx +373 -0
- package/docs/content/template-clips-sharing-and-teams.mdx +182 -0
- package/docs/content/template-clips.mdx +19 -508
- package/docs/content/template-content-databases.mdx +406 -0
- package/docs/content/template-content-developers.mdx +364 -0
- package/docs/content/template-content-editing.mdx +60 -0
- package/docs/content/template-content-sync.mdx +149 -0
- package/docs/content/template-content.mdx +21 -561
- package/docs/content/template-design-brand-and-figma.mdx +150 -0
- package/docs/content/template-design-collaboration-and-full-apps.mdx +125 -0
- package/docs/content/template-design-developers.mdx +358 -0
- package/docs/content/template-design-quality-and-components.mdx +95 -0
- package/docs/content/template-design.mdx +20 -344
- package/docs/content/template-dispatch-developers.mdx +121 -0
- package/docs/content/template-dispatch-messaging-routing.mdx +114 -0
- package/docs/content/template-dispatch-operations.mdx +160 -0
- package/docs/content/template-dispatch-vault-integrations.mdx +316 -0
- package/docs/content/template-dispatch.mdx +24 -283
- package/docs/content/template-forms-building-publishing.mdx +135 -0
- package/docs/content/template-forms-developers.mdx +195 -0
- package/docs/content/template-forms-responses.mdx +120 -0
- package/docs/content/template-forms.mdx +21 -230
- package/docs/content/template-mail-agent.mdx +114 -0
- package/docs/content/template-mail-developers.mdx +356 -0
- package/docs/content/template-mail-drafts-and-queue.mdx +103 -0
- package/docs/content/template-mail-inbox.mdx +118 -0
- package/docs/content/template-mail.mdx +23 -274
- package/docs/content/template-plan-automations.mdx +213 -0
- package/docs/content/template-plan-developers.mdx +703 -0
- package/docs/content/template-plan-local-and-desktop.mdx +236 -0
- package/docs/content/template-plan-review-workflow.mdx +180 -0
- package/docs/content/template-plan.mdx +60 -910
- package/docs/content/template-slides-agent.mdx +102 -0
- package/docs/content/template-slides-design-and-media.mdx +94 -0
- package/docs/content/template-slides-developers.mdx +488 -0
- package/docs/content/template-slides-editing.mdx +56 -0
- package/docs/content/template-slides.mdx +20 -362
- package/docs/content/toolkit-capability-packages.mdx +38 -13
- package/docs/content/toolkit-context-knowledge.mdx +49 -9
- package/docs/content/toolkit-editors-canvases.mdx +72 -10
- package/docs/content/toolkit-resources.mdx +16 -0
- package/docs/content/toolkit-settings.mdx +3 -3
- package/docs/content/toolkit-sharing.mdx +5 -7
- package/docs/content/using-your-agent.mdx +25 -2
- package/docs/content/voice-input.mdx +11 -7
- package/docs/content/what-is-agent-native.mdx +1 -0
- package/docs/content/workspace-connections.mdx +21 -11
- package/docs/content/workspace-management.mdx +1 -1
- package/package.json +2 -4
- package/src/a2a/client.ts +4 -2
- package/src/agent/action-warnings.ts +103 -0
- package/src/agent/durable-background.ts +42 -5
- package/src/agent/engine/ai-sdk-engine.ts +58 -6
- package/src/agent/engine/anthropic-engine.ts +51 -8
- package/src/agent/engine/builder-engine.ts +56 -18
- package/src/agent/engine/continuation-dispatch-retry.ts +10 -9
- package/src/agent/engine/credential-errors.ts +11 -0
- package/src/agent/engine/error-detail.ts +39 -0
- package/src/agent/engine/prompt-cache.ts +44 -0
- package/src/agent/engine/registry.ts +22 -30
- package/src/agent/engine/tool-call-journal-seed.ts +2 -1
- package/src/agent/engine/translate-anthropic.ts +99 -0
- package/src/agent/loop-settings.ts +94 -7
- package/src/agent/production-agent.ts +667 -157
- package/src/agent/run-loop-with-resume.ts +27 -1
- package/src/agent/run-manager.ts +229 -39
- package/src/agent/run-store.ts +397 -64
- package/src/agent/thread-data-builder.ts +5 -1
- package/src/agent/types.ts +23 -6
- package/src/application-state/script-helpers.ts +5 -2
- package/src/cli/agents.ts +69 -1
- package/src/cli/app-skill.ts +1 -1
- package/src/cli/code-agent-executor.ts +7 -3
- package/src/cli/design-connect.ts +82 -8
- package/src/cli/skills-content/design-visual-edit-skill.ts +169 -24
- package/src/client/AssistantChat.tsx +623 -607
- package/src/client/agent-chat-adapter.ts +176 -29
- package/src/client/chat/message-components.tsx +13 -0
- package/src/client/embed-auth.ts +3 -1
- package/src/client/integrations/IntegrationCard.tsx +41 -24
- package/src/client/integrations/IntegrationsPanel.tsx +37 -21
- package/src/client/integrations/webhook-url.ts +29 -0
- package/src/client/org/OrgSwitcher.tsx +41 -27
- package/src/client/org/RequireActiveOrg.tsx +7 -0
- package/src/client/org/TeamPage.tsx +144 -14
- package/src/client/org/hooks.ts +27 -0
- package/src/client/org/index.ts +2 -0
- package/src/client/require-session.tsx +40 -29
- package/src/client/session-replay.ts +1 -1
- package/src/client/settings/DemoModeSection.tsx +0 -5
- package/src/client/settings/SecretsSection.tsx +47 -42
- package/src/client/settings/VoiceTranscriptionSection.tsx +0 -5
- package/src/client/sse-event-processor.ts +83 -8
- package/src/client/use-action.ts +22 -13
- package/src/client/use-agent-engine-configured.ts +36 -4
- package/src/client/use-db-sync.ts +21 -1
- package/src/credentials/index.ts +124 -2
- package/src/deploy/build.ts +93 -30
- package/src/deploy/workspace-deploy.ts +21 -16
- package/src/guards/no-localhost-fallback.ts +76 -14
- package/src/integrations/google-docs-poller.ts +19 -12
- package/src/integrations/webhook-handler.ts +56 -33
- package/src/jobs/scheduler.ts +57 -23
- package/src/localization/default-messages.ts +23 -1
- package/src/observability/evals.ts +7 -8
- package/src/observability/traces.ts +2 -0
- package/src/org/accept-pending.ts +2 -2
- package/src/org/active-org.ts +73 -0
- package/src/org/auto-join-domain.ts +7 -2
- package/src/org/context.ts +169 -66
- package/src/org/handlers.ts +148 -10
- package/src/org/plugin.ts +8 -1
- package/src/org/types.ts +6 -1
- package/src/provider-api/index.ts +6 -1
- package/src/resources/handlers.ts +2 -6
- package/src/resources/script-helpers.ts +2 -1
- package/src/scripts/chat/search-chats.ts +5 -2
- package/src/scripts/describe-workspace-apps.ts +59 -0
- package/src/scripts/resources/delete-memory.ts +5 -2
- package/src/scripts/resources/delete.ts +5 -2
- package/src/scripts/resources/effective.ts +5 -2
- package/src/scripts/resources/list.ts +5 -2
- package/src/scripts/resources/read.ts +5 -2
- package/src/scripts/resources/save-memory.ts +5 -2
- package/src/scripts/resources/write.ts +5 -2
- package/src/server/__snapshots__/agent-chat-plugin.surface.spec.ts.snap +11 -31
- package/src/server/agent-capabilities.ts +147 -0
- package/src/server/agent-chat/framework-prompts.ts +11 -13
- package/src/server/agent-chat/prompt-resources.ts +183 -57
- package/src/server/agent-chat/script-entries.ts +20 -7
- package/src/server/agent-chat-plugin.ts +27 -0
- package/src/server/auth.ts +38 -32
- package/src/server/core-routes-plugin.ts +229 -179
- package/src/server/credential-provider.ts +196 -44
- package/src/server/embed-session.ts +10 -0
- package/src/server/framework-request-handler.ts +43 -0
- package/src/server/google-auth-plugin.ts +13 -450
- package/src/server/index.ts +4 -1
- package/src/server/onboarding-html.ts +20 -56
- package/src/server/open-route.ts +6 -1
- package/src/server/poll.ts +1 -1
- package/src/server/prompts/framework-core-compact.ts +5 -5
- package/src/server/prompts/framework-core.ts +7 -9
- package/src/server/prompts/shared-rules.ts +20 -9
- package/src/server/request-context.ts +58 -2
- package/src/server/scoped-key-storage.ts +1 -1
- package/src/settings/org-settings.ts +9 -0
- package/src/settings/store.ts +29 -0
- package/src/shared/index.ts +13 -0
- package/src/shared/sign-in-journey.ts +331 -0
- package/src/styles/agent-native.css +8 -0
- package/src/templates/chat/.agents/skills/actions/SKILL.md +19 -1
- package/src/templates/chat/.agents/skills/adding-a-feature/SKILL.md +2 -0
- package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +20 -6
- package/src/templates/chat/.agents/skills/security/SKILL.md +2 -0
- package/src/templates/chat/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/src/templates/chat/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/src/templates/chat/.agents/skills/sharing/SKILL.md +228 -0
- package/src/templates/chat/.agents/skills/storing-data/SKILL.md +178 -0
- package/src/templates/chat/AGENTS.md +8 -0
- package/src/templates/chat/app/entry.client.tsx +3 -0
- package/src/templates/default/.agents/skills/actions/SKILL.md +19 -1
- package/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +2 -0
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +20 -6
- package/src/templates/default/.agents/skills/security/SKILL.md +2 -0
- package/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/src/templates/default/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/src/templates/default/AGENTS.md +68 -195
- package/src/templates/default/app/entry.client.tsx +3 -0
- package/src/templates/default/app/i18n/ar-SA.ts +8 -0
- package/src/templates/default/app/i18n/de-DE.ts +8 -0
- package/src/templates/default/app/i18n/en-US.ts +8 -0
- package/src/templates/default/app/i18n/es-ES.ts +8 -0
- package/src/templates/default/app/i18n/fr-FR.ts +8 -0
- package/src/templates/default/app/i18n/hi-IN.ts +8 -0
- package/src/templates/default/app/i18n/ja-JP.ts +8 -0
- package/src/templates/default/app/i18n/ko-KR.ts +8 -0
- package/src/templates/default/app/i18n/pt-BR.ts +8 -0
- package/src/templates/default/app/i18n/zh-CN.ts +8 -0
- package/src/templates/default/app/i18n/zh-TW.ts +8 -0
- package/src/templates/headless/.agents/skills/actions/SKILL.md +19 -1
- package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +19 -1
- package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +2 -0
- package/src/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +100 -0
- package/src/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +2 -1
- package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +28 -0
- package/src/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +14 -1
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +20 -6
- package/src/templates/workspace-core/.agents/skills/qa/SKILL.md +6 -3
- package/src/templates/workspace-core/.agents/skills/security/SKILL.md +2 -0
- package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +4 -3
- package/src/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +7 -3
- package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +91 -0
- package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +60 -0
- package/src/templates/workspace-core/AGENTS.md +62 -124
- package/src/templates/workspace-root/AGENTS.md +6 -1
- package/src/triggers/dispatcher.ts +28 -17
- package/src/vite/client.ts +20 -8
- package/corpus/core/src/client/components/MissingKeyCard.tsx +0 -61
- package/corpus/core/src/client/extensions/agent-native-extension-runtime.ts +0 -495
- package/corpus/core/src/client/settings/BackgroundAgentSection.tsx +0 -193
- package/corpus/core/src/client/settings/BrowserSection.tsx +0 -110
- package/corpus/templates/analytics/app/components/InlineMetric.tsx +0 -31
- package/corpus/templates/analytics/app/components/auth/LoginScreen.tsx +0 -4
- package/corpus/templates/analytics/app/components/dashboard/CumulativeNetChart.tsx +0 -128
- package/corpus/templates/analytics/app/components/dashboard/DataTable.tsx +0 -264
- package/corpus/templates/analytics/app/components/dashboard/RecentActivity.tsx +0 -84
- package/corpus/templates/analytics/app/components/dashboard/RevenueChart.tsx +0 -92
- package/corpus/templates/analytics/app/components/dashboard/RevenueComparisonChart.tsx +0 -154
- package/corpus/templates/analytics/app/components/dashboard/StatsCard.tsx +0 -49
- package/corpus/templates/analytics/app/components/dashboard/TimeSeriesChart.tsx +0 -120
- package/corpus/templates/analytics/server/handlers/dashboard-views.ts +0 -85
- package/corpus/templates/analytics/server/handlers/user-prefs.ts +0 -58
- package/corpus/templates/analytics/server/routes/api/dashboard-views/[dashboardId]/[viewId].delete.ts +0 -1
- package/corpus/templates/analytics/server/routes/api/dashboard-views/[dashboardId].get.ts +0 -1
- package/corpus/templates/analytics/server/routes/api/dashboard-views/[dashboardId].post.ts +0 -1
- package/corpus/templates/analytics/server/routes/api/theme.get.ts +0 -17
- package/corpus/templates/analytics/server/routes/api/theme.post.ts +0 -15
- package/corpus/templates/analytics/server/routes/api/user-prefs/[key].delete.ts +0 -1
- package/corpus/templates/analytics/server/routes/api/user-prefs/[key].get.ts +0 -1
- package/corpus/templates/analytics/server/routes/api/user-prefs/[key].put.ts +0 -1
- package/corpus/templates/assets/app/components/library/CreateLibraryDialog.tsx +0 -156
- package/corpus/templates/assets/app/components/library/LibraryCard.tsx +0 -213
- package/corpus/templates/calendar/app/components/calendar/GoogleSyncButton.tsx +0 -49
- package/corpus/templates/calendar/server/routes/api/events/[id].delete.ts +0 -1
- package/corpus/templates/calendar/server/routes/api/events/[id].get.ts +0 -1
- package/corpus/templates/calendar/server/routes/api/events/[id].put.ts +0 -1
- package/corpus/templates/content/app/components/layout/AppLayout.tsx +0 -9
- package/corpus/templates/content/server/routes/api/comments/[id].delete.ts +0 -69
- package/corpus/templates/content/server/routes/api/comments/[id].patch.ts +0 -109
- package/corpus/templates/content/server/routes/api/documents/[id]/versions.get.ts +0 -53
- package/corpus/templates/design/app/components/design/code-workbench/ActivityBar.tsx +0 -85
- package/corpus/templates/design/app/components/design-system/DesignSystemCard.tsx +0 -129
- package/corpus/templates/forms/app/components/layout/AppLayout.tsx +0 -9
- package/corpus/templates/mail/app/components/email/SnoozePopover.tsx +0 -213
- package/corpus/templates/mail/server/handlers/aliases.ts +0 -98
- package/corpus/templates/mail/server/routes/api/aliases/[id].delete.ts +0 -1
- package/corpus/templates/mail/server/routes/api/aliases/[id].patch.ts +0 -1
- package/corpus/templates/mail/server/routes/api/aliases/index.get.ts +0 -1
- package/corpus/templates/mail/server/routes/api/aliases/index.post.ts +0 -1
- package/corpus/templates/mail/server/routes/api/automations/[id].delete.ts +0 -1
- package/corpus/templates/mail/server/routes/api/automations/[id].patch.ts +0 -1
- package/corpus/templates/mail/server/routes/api/automations/index.get.ts +0 -1
- package/corpus/templates/mail/server/routes/api/automations/index.post.ts +0 -1
- package/corpus/templates/mail/server/routes/api/automations/settings.get.ts +0 -22
- package/corpus/templates/mail/server/routes/api/automations/settings.put.ts +0 -25
- package/corpus/templates/mail/server/routes/api/scheduled-jobs/[id].delete.ts +0 -1
- package/corpus/templates/mail/server/routes/api/scheduled-jobs/[id].patch.ts +0 -1
- package/corpus/templates/mail/server/routes/api/scheduled-jobs/index.get.ts +0 -1
- package/corpus/templates/mail/server/routes/api/scheduled-jobs/index.post.ts +0 -1
- package/corpus/templates/mail/server/routes/api/settings.get.ts +0 -1
- package/corpus/templates/mail/server/routes/api/settings.patch.ts +0 -1
- package/corpus/templates/slides/app/components/deck/BuilderLogo.tsx +0 -22
- package/corpus/templates/slides/app/components/design-system/DesignSystemPreview.tsx +0 -176
- package/corpus/templates/slides/app/components/editor/GenerateSlidesDialog.tsx +0 -244
- package/corpus/templates/slides/app/components/editor/ImportButton.tsx +0 -84
- package/corpus/templates/slides/server/routes/api/comments/[id].delete.ts +0 -43
- package/corpus/templates/slides/server/routes/api/comments/[id].patch.ts +0 -50
- package/corpus/templates/slides/server/routes/api/decks/[id].delete.ts +0 -1
- package/corpus/templates/slides/server/routes/api/decks/[id].get.ts +0 -1
- package/corpus/templates/slides/server/routes/api/decks/[id].put.ts +0 -1
- package/corpus/templates/slides/server/routes/api/decks/index.get.ts +0 -1
- package/corpus/templates/slides/server/routes/api/decks/index.post.ts +0 -1
- package/dist/client/components/MissingKeyCard.d.ts +0 -7
- package/dist/client/components/MissingKeyCard.d.ts.map +0 -1
- package/dist/client/components/MissingKeyCard.js +0 -32
- package/dist/client/components/MissingKeyCard.js.map +0 -1
- package/dist/client/extensions/agent-native-extension-runtime.d.ts +0 -69
- package/dist/client/extensions/agent-native-extension-runtime.d.ts.map +0 -1
- package/dist/client/extensions/agent-native-extension-runtime.js +0 -348
- package/dist/client/extensions/agent-native-extension-runtime.js.map +0 -1
- package/dist/client/settings/BackgroundAgentSection.d.ts +0 -2
- package/dist/client/settings/BackgroundAgentSection.d.ts.map +0 -1
- package/dist/client/settings/BackgroundAgentSection.js +0 -68
- package/dist/client/settings/BackgroundAgentSection.js.map +0 -1
- package/dist/client/settings/BrowserSection.d.ts +0 -2
- package/dist/client/settings/BrowserSection.d.ts.map +0 -1
- package/dist/client/settings/BrowserSection.js +0 -40
- package/dist/client/settings/BrowserSection.js.map +0 -1
- package/dist/templates/chat/.react-router/types/+server-build.d.ts +0 -18
- package/dist/templates/chat/.react-router/types/app/+types/root.ts +0 -68
- package/src/client/components/MissingKeyCard.tsx +0 -61
- package/src/client/extensions/agent-native-extension-runtime.ts +0 -495
- package/src/client/settings/BackgroundAgentSection.tsx +0 -193
- package/src/client/settings/BrowserSection.tsx +0 -110
- package/src/templates/chat/.react-router/types/+server-build.d.ts +0 -18
- package/src/templates/chat/.react-router/types/app/+types/root.ts +0 -68
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceTranscriptionSection.js","sourceRoot":"","sources":["../../../src/client/settings/VoiceTranscriptionSection.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EACL,eAAe,EACf,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAkC/B,MAAM,SAAS,GAAG,eAAe,CAC/B,4DAA4D,CAC7D,CAAC;AACF,MAAM,iBAAiB,GAAG,eAAe,CACvC,sDAAsD,CACvD,CAAC;AACF,MAAM,WAAW,GAAG,eAAe,CAAC,wBAAwB,CAAC,CAAC;AAC9D,MAAM,mBAAmB,GAAG,eAAe,CACzC,uCAAuC,CACxC,CAAC;AACF,MAAM,0BAA0B,GAAsB,OAAO,CAAC;AAC9D,MAAM,sBAAsB,GAAa,MAAM,CAAC;AAEhD,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,CACL,KAAK,KAAK,MAAM;QAChB,KAAK,KAAK,QAAQ;QAClB,KAAK,KAAK,gBAAgB;QAC1B,KAAK,KAAK,S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,EACF,wGAEO,IACH,CACP,CAAC;IACJ,CAAC;IAED,SAAS;IACT,OAAO,CACL,eAAK,SAAS,EAAC,wEAAwE,aACrF,KAAC,eAAe,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,kCAAkC,GAAG,EAC1E,eAAK,SAAS,EAAC,QAAQ,aACrB,8FAEO,EACP,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,WAAW,EACpB,SAAS,EAAC,2JAA2J,aAErK,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,GAAI,4BAEnB,IACL,IACF,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,KAAC,cAAc,IAAC,IAAI,EAAE,EAAE,GAAI,CAAC;AACtC,CAAC","sourcesContent":["/**\n * <VoiceTranscriptionSection /> — source + cleanup settings for voice input.\n *\n * Writes the selection to application_state under `voice-transcription-prefs`\n * so the composer's `useVoiceDictation` hook picks it up on next record. The\n * legacy `provider` field is still written alongside `transcriptionMode` so\n * older clients continue to normalize safely.\n *\n * Provider status comes from `/_agent-native/voice-providers/status`, which\n * mirrors the server transcription route's key/env resolution.\n */\n\nimport { Switch } from \"@agent-native/toolkit/design-system\";\nimport {\n IconAlertCircle,\n IconCheck,\n IconChevronDown,\n IconChevronRight,\n IconExternalLink,\n IconLoader2,\n IconLockOpen,\n IconMicrophone,\n} from \"@tabler/icons-react\";\nimport React, { useCallback, useEffect, useState } from \"react\";\n\nimport { agentNativePath } from \"../api-path.js\";\nimport {\n openBuilderConnectPopup,\n useBuilderStatus,\n} from \"./useBuilderStatus.js\";\n\ntype TranscriptionMode = \"mac-native\" | \"google-realtime\" | \"batch\";\n\ntype Provider =\n | \"auto\"\n | \"openai\"\n | \"builder-gemini\"\n | \"builder\"\n | \"browser\"\n | \"gemini\"\n | \"groq\";\n\ninterface Prefs {\n transcriptionMode?: TranscriptionMode;\n provider?: Provider;\n instructions?: string;\n}\n\ninterface SecretStatus {\n key: string;\n status: \"set\" | \"unset\" | \"invalid\";\n}\n\ninterface ProviderStatus {\n builder: boolean;\n gemini: boolean;\n openai: boolean;\n groq: boolean;\n googleRealtime?: boolean;\n browser: true;\n native?: true;\n}\n\nconst PREFS_URL = agentNativePath(\n \"/_agent-native/application-state/voice-transcription-prefs\",\n);\nconst CLEANUP_PREFS_URL = agentNativePath(\n \"/_agent-native/application-state/voice-cleanup-prefs\",\n);\nconst SECRETS_URL = agentNativePath(\"/_agent-native/secrets\");\nconst PROVIDER_STATUS_URL = agentNativePath(\n \"/_agent-native/voice-providers/status\",\n);\nconst DEFAULT_TRANSCRIPTION_MODE: TranscriptionMode = \"batch\";\nconst DEFAULT_BATCH_PROVIDER: Provider = \"auto\";\n\nfunction isProvider(value: unknown): value is Provider {\n return (\n value === \"auto\" ||\n value === \"openai\" ||\n value === \"builder-gemini\" ||\n value === \"builder\" ||\n value === \"browser\" ||\n value === \"gemini\" ||\n value === \"groq\"\n );\n}\n\nfunction isTranscriptionMode(value: unknown): value is TranscriptionMode {\n return (\n value === \"mac-native\" || value === \"google-realtime\" || value === \"batch\"\n );\n}\n\nfunction normalizeProvider(value: unknown): Provider | null {\n if (!isProvider(value)) return null;\n return value === \"builder\" ? \"builder-gemini\" : value;\n}\n\nfunction legacyModeFromProvider(provider: Provider | null): TranscriptionMode {\n if (provider === \"browser\") return \"mac-native\";\n return \"batch\";\n}\n\nfunction providerForMode(\n mode: TranscriptionMode,\n currentProvider: Provider | null,\n): Provider {\n if (mode === \"mac-native\") return \"browser\";\n if (mode === \"google-realtime\") return \"auto\";\n if (!currentProvider || currentProvider === \"browser\") {\n return DEFAULT_BATCH_PROVIDER;\n }\n return currentProvider;\n}\n\nfunction batchProvider(provider: Provider | null): Provider {\n if (!provider || provider === \"browser\") return DEFAULT_BATCH_PROVIDER;\n return provider;\n}\n\nexport function VoiceTranscriptionSection() {\n const [transcriptionMode, setTranscriptionMode] =\n useState<TranscriptionMode | null>(null);\n const [provider, setProvider] = useState<Provider>(DEFAULT_BATCH_PROVIDER);\n const [instructions, setInstructions] = useState(\"\");\n const [openAiConfigured, setOpenAiConfigured] = useState<boolean | null>(\n null,\n );\n const [geminiConfigured, setGeminiConfigured] = useState<boolean | null>(\n null,\n );\n const [groqConfigured, setGroqConfigured] = useState<boolean | null>(null);\n const [googleRealtimeConfigured, setGoogleRealtimeConfigured] = useState<\n boolean | null\n >(null);\n const [saving, setSaving] = useState(false);\n const [saveError, setSaveError] = useState<string | null>(null);\n const [showAdvanced, setShowAdvanced] = useState(false);\n const [cleanupEnabled, setCleanupEnabled] = useState<boolean | null>(null);\n const { status: builderStatus } = useBuilderStatus();\n const builderRealtimeReady =\n !!builderStatus?.privateKeyConfigured &&\n !!builderStatus?.publicKeyConfigured;\n const googleRealtimeReady =\n !!googleRealtimeConfigured && builderRealtimeReady;\n\n // Read cleanup pref (default: true if Builder is connected).\n useEffect(() => {\n let cancelled = false;\n fetch(CLEANUP_PREFS_URL)\n .then((r) => (r.ok ? r.json() : null))\n .then(\n (\n body:\n | { enabled?: boolean }\n | { value?: { enabled?: boolean } }\n | null,\n ) => {\n if (cancelled) return;\n const stored =\n (body as { enabled?: boolean } | null)?.enabled ??\n (body as { value?: { enabled?: boolean } } | null)?.value?.enabled;\n if (typeof stored === \"boolean\") setCleanupEnabled(stored);\n else setCleanupEnabled(null); // resolve once builderStatus arrives\n },\n )\n .catch(() => !cancelled && setCleanupEnabled(null));\n return () => {\n cancelled = true;\n };\n }, []);\n\n useEffect(() => {\n if (cleanupEnabled !== null) return;\n if (builderStatus?.configured !== undefined) {\n setCleanupEnabled(!!builderStatus.configured);\n }\n }, [builderStatus?.configured, cleanupEnabled]);\n\n const toggleCleanup = async (next: boolean) => {\n const previous = cleanupEnabled;\n setCleanupEnabled(next);\n try {\n const res = await fetch(CLEANUP_PREFS_URL, {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ enabled: next }),\n });\n if (!res.ok) {\n throw new Error(`HTTP ${res.status}`);\n }\n } catch {\n setCleanupEnabled(previous);\n }\n };\n\n useEffect(() => {\n let cancelled = false;\n fetch(PREFS_URL)\n .then((r) => (r.ok ? r.json() : null))\n .then((body: Prefs | { value?: Prefs } | null) => {\n if (cancelled) return;\n const value =\n (body as { value?: Prefs } | null)?.value ?? (body as Prefs | null);\n const p = normalizeProvider(\n (body as Prefs | null)?.provider ??\n (body as { value?: Prefs } | null)?.value?.provider,\n );\n const storedMode = isTranscriptionMode(value?.transcriptionMode)\n ? value.transcriptionMode\n : null;\n const mode =\n storedMode ??\n (p ? legacyModeFromProvider(p) : DEFAULT_TRANSCRIPTION_MODE);\n const savedInstructions =\n (body as Prefs | null)?.instructions ??\n (body as { value?: Prefs } | null)?.value?.instructions;\n setTranscriptionMode(mode);\n setProvider(providerForMode(mode, p));\n if (typeof savedInstructions === \"string\") {\n setInstructions(savedInstructions);\n }\n })\n .catch(() => {\n if (!cancelled) {\n setTranscriptionMode(DEFAULT_TRANSCRIPTION_MODE);\n setProvider(DEFAULT_BATCH_PROVIDER);\n }\n });\n return () => {\n cancelled = true;\n };\n }, []);\n\n useEffect(() => {\n let cancelled = false;\n fetch(PROVIDER_STATUS_URL)\n .then((r) => (r.ok ? r.json() : null))\n .then((status: ProviderStatus | null) => {\n if (cancelled) return;\n if (status) {\n setOpenAiConfigured(status.openai);\n setGeminiConfigured(status.gemini);\n setGroqConfigured(status.groq);\n setGoogleRealtimeConfigured(!!status.googleRealtime);\n return;\n }\n return fetch(SECRETS_URL)\n .then((r) => (r.ok ? r.json() : []))\n .then((list: SecretStatus[]) => {\n if (cancelled) return;\n const find = (key: string) =>\n Array.isArray(list) ? list.find((s) => s.key === key) : null;\n setOpenAiConfigured(find(\"OPENAI_API_KEY\")?.status === \"set\");\n setGeminiConfigured(find(\"GEMINI_API_KEY\")?.status === \"set\");\n setGroqConfigured(find(\"GROQ_API_KEY\")?.status === \"set\");\n setGoogleRealtimeConfigured(\n find(\"GOOGLE_APPLICATION_CREDENTIALS\")?.status === \"set\",\n );\n });\n })\n .catch(() => {\n if (!cancelled) {\n setOpenAiConfigured(false);\n setGeminiConfigured(false);\n setGroqConfigured(false);\n setGoogleRealtimeConfigured(false);\n }\n });\n return () => {\n cancelled = true;\n };\n }, []);\n\n const persist = useCallback(\n async (\n nextMode: TranscriptionMode,\n nextProvider: Provider,\n nextInstructions: string,\n previous: {\n transcriptionMode: TranscriptionMode | null;\n provider: Provider;\n instructions: string;\n },\n ) => {\n setSaving(true);\n setSaveError(null);\n try {\n const res = await fetch(PREFS_URL, {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n transcriptionMode: nextMode,\n provider: nextProvider,\n instructions: nextInstructions.trim(),\n }),\n });\n if (!res.ok) {\n throw new Error(`HTTP ${res.status}`);\n }\n } catch (err) {\n // Revert the optimistic update so the UI matches server state.\n setTranscriptionMode(previous.transcriptionMode);\n setProvider(previous.provider);\n setInstructions(previous.instructions);\n setSaveError(\n `Couldn't save: ${(err as Error)?.message ?? \"network error\"}. Try again.`,\n );\n } finally {\n setSaving(false);\n }\n },\n [],\n );\n\n const focusKey = (key: string) => {\n if (typeof window === \"undefined\") return;\n window.location.hash = `#secrets:${key}`;\n };\n\n const chooseSource = (next: TranscriptionMode) => {\n if (next === transcriptionMode) return;\n if (next === \"google-realtime\" && !googleRealtimeReady) {\n setShowAdvanced(true);\n if (!googleRealtimeConfigured) {\n focusKey(\"GOOGLE_APPLICATION_CREDENTIALS\");\n } else if (!builderRealtimeReady) {\n openBuilderConnect();\n }\n return;\n }\n const previous = { transcriptionMode, provider, instructions };\n const nextProvider = providerForMode(next, provider);\n setTranscriptionMode(next);\n setProvider(nextProvider);\n void persist(next, nextProvider, instructions, previous);\n };\n\n const openBuilderConnect = () => {\n openBuilderConnectPopup({\n url: builderStatus?.cliAuthUrl ?? builderStatus?.connectUrl,\n source: \"voice_transcription_settings\",\n features: \"noopener,noreferrer,width=600,height=700\",\n });\n };\n\n const chooseBatchProvider = (next: Provider) => {\n const nextProvider = batchProvider(normalizeProvider(next));\n if (transcriptionMode === \"batch\" && nextProvider === provider) return;\n const previous = { transcriptionMode, provider, instructions };\n setTranscriptionMode(\"batch\");\n setProvider(nextProvider);\n void persist(\"batch\", nextProvider, instructions, previous);\n };\n\n const updateInstructions = (next: string) => {\n const previous = { transcriptionMode, provider, instructions };\n setInstructions(next);\n if (transcriptionMode) {\n void persist(transcriptionMode, provider, next, previous);\n }\n };\n\n if (transcriptionMode === null) {\n return (\n <div className=\"flex items-center gap-1.5 text-[10px] text-muted-foreground\">\n <IconLoader2 size={10} className=\"animate-spin\" />\n Loading…\n </div>\n );\n }\n\n return (\n <div className=\"space-y-2\">\n <div className=\"rounded-md border border-border bg-background p-2\">\n <div className=\"mb-2 flex items-start justify-between gap-3 px-0.5\">\n <div>\n <div className=\"text-[11px] font-medium text-foreground\">\n Live transcription\n </div>\n <p className=\"mt-0.5 text-[10px] text-muted-foreground\">\n Choose where real-time words come from. Batch still runs after\n recording stops.\n </p>\n </div>\n </div>\n <div className=\"space-y-2\">\n <ProviderOption\n id=\"mac-native\"\n selected={transcriptionMode === \"mac-native\"}\n onSelect={() => chooseSource(\"mac-native\")}\n title=\"Mac Native\"\n subtitle=\"Free and fast in the macOS Tauri app. Web clients use the existing browser-native path when available.\"\n rightSlot={\n <span className=\"text-[10px] text-muted-foreground\">\n Tauri default\n </span>\n }\n />\n <ProviderOption\n id=\"google-realtime\"\n selected={transcriptionMode === \"google-realtime\"}\n onSelect={() => chooseSource(\"google-realtime\")}\n disabled={!googleRealtimeReady}\n title=\"Google Realtime\"\n subtitle={\n googleRealtimeReady\n ? \"BYOK only for v1. Streams live partials and finals through Google Speech-to-Text.\"\n : googleRealtimeConfigured\n ? \"Google credentials are set. Connect Builder completely to mint the managed realtime session.\"\n : \"BYOK only for v1. Configure Google service account before selecting this source.\"\n }\n rightSlot={\n googleRealtimeReady ? (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Ready\n </span>\n ) : googleRealtimeConfigured ? (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n openBuilderConnect();\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-accent/40 hover:text-foreground\"\n >\n Connect Builder.io\n <IconExternalLink size={10} />\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n setShowAdvanced(true);\n focusKey(\"GOOGLE_APPLICATION_CREDENTIALS\");\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-accent/40 hover:text-foreground\"\n >\n Configure\n <IconExternalLink size={10} />\n </button>\n )\n }\n />\n <ProviderOption\n id=\"batch\"\n selected={transcriptionMode === \"batch\"}\n onSelect={() => chooseSource(\"batch\")}\n title=\"Batch\"\n subtitle=\"Universal fallback. Sends audio after recording stops through Builder Gemini, Gemini, Groq, then OpenAI.\"\n />\n <SystemAudioStatus />\n </div>\n </div>\n\n <div className=\"flex items-start justify-between gap-3 rounded-md border border-border bg-accent/30 px-2.5 py-2\">\n <div className=\"min-w-0\">\n <div className=\"text-[11px] font-medium text-foreground\">\n AI cleanup\n </div>\n <p className=\"text-[10px] text-muted-foreground mt-0.5\">\n Polish punctuation, casing, filler words, titles, and summaries\n after capture. Builder Gemini is tried first; BYOK Gemini is the\n fallback.\n </p>\n </div>\n <div className=\"flex shrink-0 flex-col items-end gap-1\">\n <Switch\n checked={!!cleanupEnabled}\n onChange={toggleCleanup}\n aria-label=\"AI cleanup\"\n className=\"shrink-0\"\n />\n {cleanupEnabled && (\n <span className=\"text-[10px] text-muted-foreground\">\n {builderStatus?.configured\n ? \"Builder ready\"\n : geminiConfigured\n ? \"Gemini key set\"\n : \"Needs key\"}\n </span>\n )}\n </div>\n </div>\n\n <div className=\"rounded-md border border-border bg-background\">\n <button\n type=\"button\"\n onClick={() => setShowAdvanced((v) => !v)}\n className=\"w-full flex items-center justify-between gap-2 px-2.5 py-2 cursor-pointer\"\n >\n <span className=\"text-[11px] font-medium text-foreground inline-flex items-center gap-1\">\n {showAdvanced ? (\n <IconChevronDown size={12} />\n ) : (\n <IconChevronRight size={12} className=\"rtl:-scale-x-100\" />\n )}\n Add API keys\n </span>\n <span className=\"text-[10px] text-muted-foreground\">\n Google STT · Gemini · Groq · OpenAI\n </span>\n </button>\n\n {showAdvanced && (\n <div className=\"px-2 pb-2 space-y-2\">\n <ProviderOption\n id=\"google-service-account\"\n selected={transcriptionMode === \"google-realtime\"}\n onSelect={() => chooseSource(\"google-realtime\")}\n disabled={!googleRealtimeReady}\n title=\"Google Speech-to-Text service account\"\n subtitle={\n googleRealtimeConfigured\n ? \"Service-account JSON is set. Connect Builder to mint the managed realtime WebSocket session.\"\n : \"Service-account JSON for the dedicated realtime WebSocket to Google StreamingRecognize.\"\n }\n rightSlot={\n googleRealtimeConfigured ===\n null ? null : googleRealtimeReady ? (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Ready\n </span>\n ) : googleRealtimeConfigured ? (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n openBuilderConnect();\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n Connect Builder.io\n <IconExternalLink size={10} />\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n focusKey(\"GOOGLE_APPLICATION_CREDENTIALS\");\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n Configure\n <IconExternalLink size={10} />\n </button>\n )\n }\n />\n\n <ProviderOption\n id=\"auto\"\n selected={transcriptionMode === \"batch\" && provider === \"auto\"}\n onSelect={() => chooseBatchProvider(\"auto\")}\n title=\"Automatic batch fallback\"\n subtitle=\"Keep the current Clips fallback chain: Builder Gemini, Gemini, Groq, then OpenAI.\"\n />\n\n <ProviderOption\n id=\"builder-gemini\"\n selected={\n transcriptionMode === \"batch\" && provider === \"builder-gemini\"\n }\n onSelect={() => chooseBatchProvider(\"builder-gemini\")}\n disabled={!builderStatus?.configured}\n title=\"Builder.io Connect\"\n subtitle={\n builderStatus?.configured\n ? \"Use Builder-hosted Gemini Flash-Lite for batch transcription and cleanup.\"\n : \"One-click connect for Gemini Flash-Lite cleanup and batch transcription. No Google key needed.\"\n }\n rightSlot={\n builderStatus?.configured ? (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Connected\n </span>\n ) : (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n openBuilderConnect();\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n Connect Builder.io\n <IconExternalLink size={10} />\n </button>\n )\n }\n />\n\n <ProviderOption\n id=\"gemini\"\n selected={transcriptionMode === \"batch\" && provider === \"gemini\"}\n onSelect={() => chooseBatchProvider(\"gemini\")}\n title=\"Google Gemini\"\n subtitle=\"BYOK Gemini for AI cleanup and optional strict batch transcription.\"\n rightSlot={\n geminiConfigured === null ? null : geminiConfigured ? (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Key set\n </span>\n ) : (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n focusKey(\"GEMINI_API_KEY\");\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n Add key\n <IconExternalLink size={10} />\n </button>\n )\n }\n />\n\n <ProviderOption\n id=\"openai\"\n selected={transcriptionMode === \"batch\" && provider === \"openai\"}\n onSelect={() => chooseBatchProvider(\"openai\")}\n title=\"OpenAI Whisper\"\n subtitle=\"Batch Whisper provider. Requires an OpenAI API key.\"\n rightSlot={\n openAiConfigured === null ? null : openAiConfigured ? (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Key set\n </span>\n ) : (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n focusKey(\"OPENAI_API_KEY\");\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n Add key\n <IconExternalLink size={10} />\n </button>\n )\n }\n />\n\n <ProviderOption\n id=\"groq\"\n selected={transcriptionMode === \"batch\" && provider === \"groq\"}\n onSelect={() => chooseBatchProvider(\"groq\")}\n title=\"Groq Whisper\"\n subtitle=\"Fast Whisper batch provider. Requires a Groq API key.\"\n rightSlot={\n groqConfigured === null ? null : groqConfigured ? (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Key set\n </span>\n ) : (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n focusKey(\"GROQ_API_KEY\");\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n Add key\n <IconExternalLink size={10} />\n </button>\n )\n }\n />\n </div>\n )}\n </div>\n\n {(cleanupEnabled || transcriptionMode === \"batch\") && (\n <div className=\"rounded-md border border-border bg-accent/20 px-2.5 py-2\">\n <label\n htmlFor=\"voice-transcription-instructions\"\n className=\"block text-[10px] font-medium text-foreground\"\n >\n Custom instructions\n </label>\n <textarea\n id=\"voice-transcription-instructions\"\n value={instructions}\n onChange={(event) => updateInstructions(event.target.value)}\n placeholder=\"Names, casing, punctuation, style, or terms to preserve.\"\n className=\"mt-1 min-h-16 w-full resize-y rounded border border-border bg-background px-2 py-1.5 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n />\n <p className=\"mt-1 text-[10px] text-muted-foreground\">\n Included with batch transcription and AI cleanup.\n </p>\n </div>\n )}\n\n {saveError && !saving && (\n <p className=\"text-[10px] text-red-500\" role=\"alert\">\n {saveError}\n </p>\n )}\n </div>\n );\n}\n\ninterface ProviderOptionProps {\n id: string;\n selected: boolean;\n disabled?: boolean;\n onSelect: () => void;\n title: string;\n subtitle?: React.ReactNode;\n rightSlot?: React.ReactNode;\n}\n\nfunction ProviderOption({\n id: _id,\n selected,\n disabled,\n onSelect,\n title,\n subtitle,\n rightSlot,\n}: ProviderOptionProps) {\n const select = () => {\n if (!disabled) onSelect();\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (disabled) return;\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n onSelect();\n }\n };\n\n return (\n <div\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n onClick={select}\n onKeyDown={onKeyDown}\n aria-pressed={selected}\n aria-disabled={disabled || undefined}\n // Theme tokens; streaming agent owns layout.\n className={`w-full text-start rounded-md border px-2.5 py-2 flex items-start gap-2 ${\n selected\n ? \"border-primary bg-primary/10\"\n : \"border-border bg-accent/30 hover:bg-accent/50\"\n } ${disabled ? \"opacity-60 cursor-not-allowed\" : \"\"}`}\n >\n <span\n className={`mt-[2px] shrink-0 flex h-3.5 w-3.5 items-center justify-center rounded-full border ${\n selected\n ? \"border-primary bg-primary\"\n : \"border-muted-foreground/40 bg-background\"\n }`}\n >\n {selected && (\n <span className=\"h-1.5 w-1.5 rounded-full bg-primary-foreground\" />\n )}\n </span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"text-[11px] font-medium text-foreground\">{title}</div>\n {rightSlot && <div className=\"shrink-0\">{rightSlot}</div>}\n </div>\n {subtitle && (\n <p className=\"text-[10px] text-muted-foreground mt-0.5\">{subtitle}</p>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * Surfaces the desktop app's system-audio capture readiness inside the live\n * transcription box. Renders nothing in non-Tauri contexts (web users) so the\n * existing browser-only flow is unaffected. The Rust side\n * (`templates/clips/desktop/src-tauri/src/system_audio.rs`) returns either a\n * structured `VersionStatus` via `system_audio_version_status` (preferred,\n * no error-string parsing) or an unsupported-OS error from\n * `system_audio_request_permission`. We surface three states:\n *\n * - macOS 13+ + permission granted -> green check (\"System audio capture available\")\n * - macOS < 13 -> red dot (\"...requires macOS 13 or later\")\n * - permission denied / pending -> amber + \"Open System Settings\" affordance\n */\ntype SystemAudioState =\n | { kind: \"loading\" }\n | { kind: \"available\" }\n | { kind: \"unsupported\"; reason: string }\n | { kind: \"denied\" };\n\ninterface VersionStatusPayload {\n supported: boolean;\n os_version: string;\n reason?: string;\n}\n\n// Tauri v2 exposes `window.__TAURI_INTERNALS__.invoke` as the runtime entry\n// point that `@tauri-apps/api/core` itself wraps. Calling it directly avoids\n// pulling `@tauri-apps/api` into the web bundle's import graph — a dynamic\n// `import(\"@tauri-apps/api/core\")` survives Vite's prebundle as a literal\n// specifier and trips `vite:import-analysis` with a \"Failed to resolve\" error\n// in fresh CLI installs that don't have the desktop dep installed.\ntype TauriInvoke = (cmd: string, args?: unknown) => Promise<unknown>;\nfunction getTauriInvoke(): TauriInvoke | null {\n if (typeof window === \"undefined\") return null;\n const internals = (\n window as unknown as { __TAURI_INTERNALS__?: { invoke?: TauriInvoke } }\n ).__TAURI_INTERNALS__;\n return internals?.invoke ?? null;\n}\n\nfunction SystemAudioStatus() {\n const [state, setState] = useState<SystemAudioState | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n const invoke = getTauriInvoke();\n if (!invoke) return; // Web users: render nothing.\n setState({ kind: \"loading\" });\n void (async () => {\n try {\n const status = (await invoke(\"system_audio_version_status\")) as\n | VersionStatusPayload\n | undefined;\n if (cancelled) return;\n if (status && !status.supported) {\n setState({\n kind: \"unsupported\",\n reason:\n status.reason ??\n `ScreenCaptureKit is unavailable on ${status.os_version}.`,\n });\n return;\n }\n // Supported — now probe permission. This may prompt; calling it\n // here matches the original on-mount semantics requested in the\n // settings flow.\n try {\n const granted = (await invoke(\n \"system_audio_request_permission\",\n )) as boolean;\n if (cancelled) return;\n setState(granted ? { kind: \"available\" } : { kind: \"denied\" });\n } catch (err) {\n if (cancelled) return;\n const msg = String(err ?? \"\");\n if (/macOS\\s*1[0-2]|requires macOS 13/i.test(msg)) {\n setState({ kind: \"unsupported\", reason: msg });\n } else {\n setState({ kind: \"denied\" });\n }\n }\n } catch {\n // Older desktop builds may not have the new command yet —\n // fall back to the permission probe.\n if (cancelled) return;\n try {\n const granted = (await invoke(\n \"system_audio_request_permission\",\n )) as boolean;\n if (cancelled) return;\n setState(granted ? { kind: \"available\" } : { kind: \"denied\" });\n } catch (err) {\n if (cancelled) return;\n const msg = String(err ?? \"\");\n if (/macOS|ScreenCaptureKit/i.test(msg)) {\n setState({ kind: \"unsupported\", reason: msg });\n } else {\n setState({ kind: \"denied\" });\n }\n }\n }\n })();\n return () => {\n cancelled = true;\n };\n }, []);\n\n const openPrivacy = useCallback(() => {\n const invoke = getTauriInvoke();\n if (!invoke) return;\n void invoke(\"system_audio_open_privacy_settings\").catch(() => {\n // Older desktop builds without this command — no-op.\n });\n }, []);\n\n if (!state || state.kind === \"loading\") return null;\n\n if (state.kind === \"available\") {\n return (\n <div className=\"flex items-center gap-1.5 px-0.5 pt-1 text-[10px] text-muted-foreground\">\n <IconCheck size={11} className=\"text-green-500\" />\n <span>System audio capture available.</span>\n </div>\n );\n }\n\n if (state.kind === \"unsupported\") {\n return (\n <div className=\"flex items-center gap-1.5 px-0.5 pt-1 text-[10px] text-muted-foreground\">\n <span\n className=\"inline-block h-1.5 w-1.5 shrink-0 rounded-full bg-red-500\"\n aria-hidden\n />\n <span>\n System audio requires macOS 13 or later — meetings will use mic-only.\n </span>\n </div>\n );\n }\n\n // denied\n return (\n <div className=\"flex items-start gap-1.5 px-0.5 pt-1 text-[10px] text-muted-foreground\">\n <IconAlertCircle size={11} className=\"mt-[1px] shrink-0 text-amber-500\" />\n <div className=\"flex-1\">\n <span>\n Grant Screen Recording permission in System Settings -> Privacy.\n </span>\n <button\n type=\"button\"\n onClick={openPrivacy}\n className=\"ms-1 inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-accent/40 hover:text-foreground\"\n >\n <IconLockOpen size={10} />\n Open System Settings\n </button>\n </div>\n </div>\n );\n}\n\nexport function VoiceTranscriptionIcon() {\n return <IconMicrophone size={14} />;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"VoiceTranscriptionSection.js","sourceRoot":"","sources":["../../../src/client/settings/VoiceTranscriptionSection.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EACL,eAAe,EACf,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAkC/B,MAAM,SAAS,GAAG,eAAe,CAC/B,4DAA4D,CAC7D,CAAC;AACF,MAAM,iBAAiB,GAAG,eAAe,CACvC,sDAAsD,CACvD,CAAC;AACF,MAAM,WAAW,GAAG,eAAe,CAAC,wBAAwB,CAAC,CAAC;AAC9D,MAAM,mBAAmB,GAAG,eAAe,CACzC,uCAAuC,CACxC,CAAC;AACF,MAAM,0BAA0B,GAAsB,OAAO,CAAC;AAC9D,MAAM,sBAAsB,GAAa,MAAM,CAAC;AAEhD,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,CACL,KAAK,KAAK,MAAM;QAChB,KAAK,KAAK,QAAQ;QAClB,KAAK,KAAK,gBAAgB;QAC1B,KAAK,KAAK,SAAS;QACnB,KAAK,KAAK,SAAS;QACnB,K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AAC;IAED,SAAS;IACT,OAAO,CACL,eAAK,SAAS,EAAC,wEAAwE,aACrF,KAAC,eAAe,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,kCAAkC,GAAG,EAC1E,eAAK,SAAS,EAAC,QAAQ,aACrB,8FAEO,EACP,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,WAAW,EACpB,SAAS,EAAC,2JAA2J,aAErK,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,GAAI,4BAEnB,IACL,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["/**\n * <VoiceTranscriptionSection /> — source + cleanup settings for voice input.\n *\n * Writes the selection to application_state under `voice-transcription-prefs`\n * so the composer's `useVoiceDictation` hook picks it up on next record. The\n * legacy `provider` field is still written alongside `transcriptionMode` so\n * older clients continue to normalize safely.\n *\n * Provider status comes from `/_agent-native/voice-providers/status`, which\n * mirrors the server transcription route's key/env resolution.\n */\n\nimport { Switch } from \"@agent-native/toolkit/design-system\";\nimport {\n IconAlertCircle,\n IconCheck,\n IconChevronDown,\n IconChevronRight,\n IconExternalLink,\n IconLoader2,\n IconLockOpen,\n} from \"@tabler/icons-react\";\nimport React, { useCallback, useEffect, useState } from \"react\";\n\nimport { agentNativePath } from \"../api-path.js\";\nimport {\n openBuilderConnectPopup,\n useBuilderStatus,\n} from \"./useBuilderStatus.js\";\n\ntype TranscriptionMode = \"mac-native\" | \"google-realtime\" | \"batch\";\n\ntype Provider =\n | \"auto\"\n | \"openai\"\n | \"builder-gemini\"\n | \"builder\"\n | \"browser\"\n | \"gemini\"\n | \"groq\";\n\ninterface Prefs {\n transcriptionMode?: TranscriptionMode;\n provider?: Provider;\n instructions?: string;\n}\n\ninterface SecretStatus {\n key: string;\n status: \"set\" | \"unset\" | \"invalid\";\n}\n\ninterface ProviderStatus {\n builder: boolean;\n gemini: boolean;\n openai: boolean;\n groq: boolean;\n googleRealtime?: boolean;\n browser: true;\n native?: true;\n}\n\nconst PREFS_URL = agentNativePath(\n \"/_agent-native/application-state/voice-transcription-prefs\",\n);\nconst CLEANUP_PREFS_URL = agentNativePath(\n \"/_agent-native/application-state/voice-cleanup-prefs\",\n);\nconst SECRETS_URL = agentNativePath(\"/_agent-native/secrets\");\nconst PROVIDER_STATUS_URL = agentNativePath(\n \"/_agent-native/voice-providers/status\",\n);\nconst DEFAULT_TRANSCRIPTION_MODE: TranscriptionMode = \"batch\";\nconst DEFAULT_BATCH_PROVIDER: Provider = \"auto\";\n\nfunction isProvider(value: unknown): value is Provider {\n return (\n value === \"auto\" ||\n value === \"openai\" ||\n value === \"builder-gemini\" ||\n value === \"builder\" ||\n value === \"browser\" ||\n value === \"gemini\" ||\n value === \"groq\"\n );\n}\n\nfunction isTranscriptionMode(value: unknown): value is TranscriptionMode {\n return (\n value === \"mac-native\" || value === \"google-realtime\" || value === \"batch\"\n );\n}\n\nfunction normalizeProvider(value: unknown): Provider | null {\n if (!isProvider(value)) return null;\n return value === \"builder\" ? \"builder-gemini\" : value;\n}\n\nfunction legacyModeFromProvider(provider: Provider | null): TranscriptionMode {\n if (provider === \"browser\") return \"mac-native\";\n return \"batch\";\n}\n\nfunction providerForMode(\n mode: TranscriptionMode,\n currentProvider: Provider | null,\n): Provider {\n if (mode === \"mac-native\") return \"browser\";\n if (mode === \"google-realtime\") return \"auto\";\n if (!currentProvider || currentProvider === \"browser\") {\n return DEFAULT_BATCH_PROVIDER;\n }\n return currentProvider;\n}\n\nfunction batchProvider(provider: Provider | null): Provider {\n if (!provider || provider === \"browser\") return DEFAULT_BATCH_PROVIDER;\n return provider;\n}\n\nexport function VoiceTranscriptionSection() {\n const [transcriptionMode, setTranscriptionMode] =\n useState<TranscriptionMode | null>(null);\n const [provider, setProvider] = useState<Provider>(DEFAULT_BATCH_PROVIDER);\n const [instructions, setInstructions] = useState(\"\");\n const [openAiConfigured, setOpenAiConfigured] = useState<boolean | null>(\n null,\n );\n const [geminiConfigured, setGeminiConfigured] = useState<boolean | null>(\n null,\n );\n const [groqConfigured, setGroqConfigured] = useState<boolean | null>(null);\n const [googleRealtimeConfigured, setGoogleRealtimeConfigured] = useState<\n boolean | null\n >(null);\n const [saving, setSaving] = useState(false);\n const [saveError, setSaveError] = useState<string | null>(null);\n const [showAdvanced, setShowAdvanced] = useState(false);\n const [cleanupEnabled, setCleanupEnabled] = useState<boolean | null>(null);\n const { status: builderStatus } = useBuilderStatus();\n const builderRealtimeReady =\n !!builderStatus?.privateKeyConfigured &&\n !!builderStatus?.publicKeyConfigured;\n const googleRealtimeReady =\n !!googleRealtimeConfigured && builderRealtimeReady;\n\n // Read cleanup pref (default: true if Builder is connected).\n useEffect(() => {\n let cancelled = false;\n fetch(CLEANUP_PREFS_URL)\n .then((r) => (r.ok ? r.json() : null))\n .then(\n (\n body:\n | { enabled?: boolean }\n | { value?: { enabled?: boolean } }\n | null,\n ) => {\n if (cancelled) return;\n const stored =\n (body as { enabled?: boolean } | null)?.enabled ??\n (body as { value?: { enabled?: boolean } } | null)?.value?.enabled;\n if (typeof stored === \"boolean\") setCleanupEnabled(stored);\n else setCleanupEnabled(null); // resolve once builderStatus arrives\n },\n )\n .catch(() => !cancelled && setCleanupEnabled(null));\n return () => {\n cancelled = true;\n };\n }, []);\n\n useEffect(() => {\n if (cleanupEnabled !== null) return;\n if (builderStatus?.configured !== undefined) {\n setCleanupEnabled(!!builderStatus.configured);\n }\n }, [builderStatus?.configured, cleanupEnabled]);\n\n const toggleCleanup = async (next: boolean) => {\n const previous = cleanupEnabled;\n setCleanupEnabled(next);\n try {\n const res = await fetch(CLEANUP_PREFS_URL, {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ enabled: next }),\n });\n if (!res.ok) {\n throw new Error(`HTTP ${res.status}`);\n }\n } catch {\n setCleanupEnabled(previous);\n }\n };\n\n useEffect(() => {\n let cancelled = false;\n fetch(PREFS_URL)\n .then((r) => (r.ok ? r.json() : null))\n .then((body: Prefs | { value?: Prefs } | null) => {\n if (cancelled) return;\n const value =\n (body as { value?: Prefs } | null)?.value ?? (body as Prefs | null);\n const p = normalizeProvider(\n (body as Prefs | null)?.provider ??\n (body as { value?: Prefs } | null)?.value?.provider,\n );\n const storedMode = isTranscriptionMode(value?.transcriptionMode)\n ? value.transcriptionMode\n : null;\n const mode =\n storedMode ??\n (p ? legacyModeFromProvider(p) : DEFAULT_TRANSCRIPTION_MODE);\n const savedInstructions =\n (body as Prefs | null)?.instructions ??\n (body as { value?: Prefs } | null)?.value?.instructions;\n setTranscriptionMode(mode);\n setProvider(providerForMode(mode, p));\n if (typeof savedInstructions === \"string\") {\n setInstructions(savedInstructions);\n }\n })\n .catch(() => {\n if (!cancelled) {\n setTranscriptionMode(DEFAULT_TRANSCRIPTION_MODE);\n setProvider(DEFAULT_BATCH_PROVIDER);\n }\n });\n return () => {\n cancelled = true;\n };\n }, []);\n\n useEffect(() => {\n let cancelled = false;\n fetch(PROVIDER_STATUS_URL)\n .then((r) => (r.ok ? r.json() : null))\n .then((status: ProviderStatus | null) => {\n if (cancelled) return;\n if (status) {\n setOpenAiConfigured(status.openai);\n setGeminiConfigured(status.gemini);\n setGroqConfigured(status.groq);\n setGoogleRealtimeConfigured(!!status.googleRealtime);\n return;\n }\n return fetch(SECRETS_URL)\n .then((r) => (r.ok ? r.json() : []))\n .then((list: SecretStatus[]) => {\n if (cancelled) return;\n const find = (key: string) =>\n Array.isArray(list) ? list.find((s) => s.key === key) : null;\n setOpenAiConfigured(find(\"OPENAI_API_KEY\")?.status === \"set\");\n setGeminiConfigured(find(\"GEMINI_API_KEY\")?.status === \"set\");\n setGroqConfigured(find(\"GROQ_API_KEY\")?.status === \"set\");\n setGoogleRealtimeConfigured(\n find(\"GOOGLE_APPLICATION_CREDENTIALS\")?.status === \"set\",\n );\n });\n })\n .catch(() => {\n if (!cancelled) {\n setOpenAiConfigured(false);\n setGeminiConfigured(false);\n setGroqConfigured(false);\n setGoogleRealtimeConfigured(false);\n }\n });\n return () => {\n cancelled = true;\n };\n }, []);\n\n const persist = useCallback(\n async (\n nextMode: TranscriptionMode,\n nextProvider: Provider,\n nextInstructions: string,\n previous: {\n transcriptionMode: TranscriptionMode | null;\n provider: Provider;\n instructions: string;\n },\n ) => {\n setSaving(true);\n setSaveError(null);\n try {\n const res = await fetch(PREFS_URL, {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n transcriptionMode: nextMode,\n provider: nextProvider,\n instructions: nextInstructions.trim(),\n }),\n });\n if (!res.ok) {\n throw new Error(`HTTP ${res.status}`);\n }\n } catch (err) {\n // Revert the optimistic update so the UI matches server state.\n setTranscriptionMode(previous.transcriptionMode);\n setProvider(previous.provider);\n setInstructions(previous.instructions);\n setSaveError(\n `Couldn't save: ${(err as Error)?.message ?? \"network error\"}. Try again.`,\n );\n } finally {\n setSaving(false);\n }\n },\n [],\n );\n\n const focusKey = (key: string) => {\n if (typeof window === \"undefined\") return;\n window.location.hash = `#secrets:${key}`;\n };\n\n const chooseSource = (next: TranscriptionMode) => {\n if (next === transcriptionMode) return;\n if (next === \"google-realtime\" && !googleRealtimeReady) {\n setShowAdvanced(true);\n if (!googleRealtimeConfigured) {\n focusKey(\"GOOGLE_APPLICATION_CREDENTIALS\");\n } else if (!builderRealtimeReady) {\n openBuilderConnect();\n }\n return;\n }\n const previous = { transcriptionMode, provider, instructions };\n const nextProvider = providerForMode(next, provider);\n setTranscriptionMode(next);\n setProvider(nextProvider);\n void persist(next, nextProvider, instructions, previous);\n };\n\n const openBuilderConnect = () => {\n openBuilderConnectPopup({\n url: builderStatus?.cliAuthUrl ?? builderStatus?.connectUrl,\n source: \"voice_transcription_settings\",\n features: \"noopener,noreferrer,width=600,height=700\",\n });\n };\n\n const chooseBatchProvider = (next: Provider) => {\n const nextProvider = batchProvider(normalizeProvider(next));\n if (transcriptionMode === \"batch\" && nextProvider === provider) return;\n const previous = { transcriptionMode, provider, instructions };\n setTranscriptionMode(\"batch\");\n setProvider(nextProvider);\n void persist(\"batch\", nextProvider, instructions, previous);\n };\n\n const updateInstructions = (next: string) => {\n const previous = { transcriptionMode, provider, instructions };\n setInstructions(next);\n if (transcriptionMode) {\n void persist(transcriptionMode, provider, next, previous);\n }\n };\n\n if (transcriptionMode === null) {\n return (\n <div className=\"flex items-center gap-1.5 text-[10px] text-muted-foreground\">\n <IconLoader2 size={10} className=\"animate-spin\" />\n Loading…\n </div>\n );\n }\n\n return (\n <div className=\"space-y-2\">\n <div className=\"rounded-md border border-border bg-background p-2\">\n <div className=\"mb-2 flex items-start justify-between gap-3 px-0.5\">\n <div>\n <div className=\"text-[11px] font-medium text-foreground\">\n Live transcription\n </div>\n <p className=\"mt-0.5 text-[10px] text-muted-foreground\">\n Choose where real-time words come from. Batch still runs after\n recording stops.\n </p>\n </div>\n </div>\n <div className=\"space-y-2\">\n <ProviderOption\n id=\"mac-native\"\n selected={transcriptionMode === \"mac-native\"}\n onSelect={() => chooseSource(\"mac-native\")}\n title=\"Mac Native\"\n subtitle=\"Free and fast in the macOS Tauri app. Web clients use the existing browser-native path when available.\"\n rightSlot={\n <span className=\"text-[10px] text-muted-foreground\">\n Tauri default\n </span>\n }\n />\n <ProviderOption\n id=\"google-realtime\"\n selected={transcriptionMode === \"google-realtime\"}\n onSelect={() => chooseSource(\"google-realtime\")}\n disabled={!googleRealtimeReady}\n title=\"Google Realtime\"\n subtitle={\n googleRealtimeReady\n ? \"BYOK only for v1. Streams live partials and finals through Google Speech-to-Text.\"\n : googleRealtimeConfigured\n ? \"Google credentials are set. Connect Builder completely to mint the managed realtime session.\"\n : \"BYOK only for v1. Configure Google service account before selecting this source.\"\n }\n rightSlot={\n googleRealtimeReady ? (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Ready\n </span>\n ) : googleRealtimeConfigured ? (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n openBuilderConnect();\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-accent/40 hover:text-foreground\"\n >\n Connect Builder.io\n <IconExternalLink size={10} />\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n setShowAdvanced(true);\n focusKey(\"GOOGLE_APPLICATION_CREDENTIALS\");\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-accent/40 hover:text-foreground\"\n >\n Configure\n <IconExternalLink size={10} />\n </button>\n )\n }\n />\n <ProviderOption\n id=\"batch\"\n selected={transcriptionMode === \"batch\"}\n onSelect={() => chooseSource(\"batch\")}\n title=\"Batch\"\n subtitle=\"Universal fallback. Sends audio after recording stops through Builder Gemini, Gemini, Groq, then OpenAI.\"\n />\n <SystemAudioStatus />\n </div>\n </div>\n\n <div className=\"flex items-start justify-between gap-3 rounded-md border border-border bg-accent/30 px-2.5 py-2\">\n <div className=\"min-w-0\">\n <div className=\"text-[11px] font-medium text-foreground\">\n AI cleanup\n </div>\n <p className=\"text-[10px] text-muted-foreground mt-0.5\">\n Polish punctuation, casing, filler words, titles, and summaries\n after capture. Builder Gemini is tried first; BYOK Gemini is the\n fallback.\n </p>\n </div>\n <div className=\"flex shrink-0 flex-col items-end gap-1\">\n <Switch\n checked={!!cleanupEnabled}\n onChange={toggleCleanup}\n aria-label=\"AI cleanup\"\n className=\"shrink-0\"\n />\n {cleanupEnabled && (\n <span className=\"text-[10px] text-muted-foreground\">\n {builderStatus?.configured\n ? \"Builder ready\"\n : geminiConfigured\n ? \"Gemini key set\"\n : \"Needs key\"}\n </span>\n )}\n </div>\n </div>\n\n <div className=\"rounded-md border border-border bg-background\">\n <button\n type=\"button\"\n onClick={() => setShowAdvanced((v) => !v)}\n className=\"w-full flex items-center justify-between gap-2 px-2.5 py-2 cursor-pointer\"\n >\n <span className=\"text-[11px] font-medium text-foreground inline-flex items-center gap-1\">\n {showAdvanced ? (\n <IconChevronDown size={12} />\n ) : (\n <IconChevronRight size={12} className=\"rtl:-scale-x-100\" />\n )}\n Add API keys\n </span>\n <span className=\"text-[10px] text-muted-foreground\">\n Google STT · Gemini · Groq · OpenAI\n </span>\n </button>\n\n {showAdvanced && (\n <div className=\"px-2 pb-2 space-y-2\">\n <ProviderOption\n id=\"google-service-account\"\n selected={transcriptionMode === \"google-realtime\"}\n onSelect={() => chooseSource(\"google-realtime\")}\n disabled={!googleRealtimeReady}\n title=\"Google Speech-to-Text service account\"\n subtitle={\n googleRealtimeConfigured\n ? \"Service-account JSON is set. Connect Builder to mint the managed realtime WebSocket session.\"\n : \"Service-account JSON for the dedicated realtime WebSocket to Google StreamingRecognize.\"\n }\n rightSlot={\n googleRealtimeConfigured ===\n null ? null : googleRealtimeReady ? (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Ready\n </span>\n ) : googleRealtimeConfigured ? (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n openBuilderConnect();\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n Connect Builder.io\n <IconExternalLink size={10} />\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n focusKey(\"GOOGLE_APPLICATION_CREDENTIALS\");\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n Configure\n <IconExternalLink size={10} />\n </button>\n )\n }\n />\n\n <ProviderOption\n id=\"auto\"\n selected={transcriptionMode === \"batch\" && provider === \"auto\"}\n onSelect={() => chooseBatchProvider(\"auto\")}\n title=\"Automatic batch fallback\"\n subtitle=\"Keep the current Clips fallback chain: Builder Gemini, Gemini, Groq, then OpenAI.\"\n />\n\n <ProviderOption\n id=\"builder-gemini\"\n selected={\n transcriptionMode === \"batch\" && provider === \"builder-gemini\"\n }\n onSelect={() => chooseBatchProvider(\"builder-gemini\")}\n disabled={!builderStatus?.configured}\n title=\"Builder.io Connect\"\n subtitle={\n builderStatus?.configured\n ? \"Use Builder-hosted Gemini Flash-Lite for batch transcription and cleanup.\"\n : \"One-click connect for Gemini Flash-Lite cleanup and batch transcription. No Google key needed.\"\n }\n rightSlot={\n builderStatus?.configured ? (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Connected\n </span>\n ) : (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n openBuilderConnect();\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n Connect Builder.io\n <IconExternalLink size={10} />\n </button>\n )\n }\n />\n\n <ProviderOption\n id=\"gemini\"\n selected={transcriptionMode === \"batch\" && provider === \"gemini\"}\n onSelect={() => chooseBatchProvider(\"gemini\")}\n title=\"Google Gemini\"\n subtitle=\"BYOK Gemini for AI cleanup and optional strict batch transcription.\"\n rightSlot={\n geminiConfigured === null ? null : geminiConfigured ? (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Key set\n </span>\n ) : (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n focusKey(\"GEMINI_API_KEY\");\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n Add key\n <IconExternalLink size={10} />\n </button>\n )\n }\n />\n\n <ProviderOption\n id=\"openai\"\n selected={transcriptionMode === \"batch\" && provider === \"openai\"}\n onSelect={() => chooseBatchProvider(\"openai\")}\n title=\"OpenAI Whisper\"\n subtitle=\"Batch Whisper provider. Requires an OpenAI API key.\"\n rightSlot={\n openAiConfigured === null ? null : openAiConfigured ? (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Key set\n </span>\n ) : (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n focusKey(\"OPENAI_API_KEY\");\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n Add key\n <IconExternalLink size={10} />\n </button>\n )\n }\n />\n\n <ProviderOption\n id=\"groq\"\n selected={transcriptionMode === \"batch\" && provider === \"groq\"}\n onSelect={() => chooseBatchProvider(\"groq\")}\n title=\"Groq Whisper\"\n subtitle=\"Fast Whisper batch provider. Requires a Groq API key.\"\n rightSlot={\n groqConfigured === null ? null : groqConfigured ? (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Key set\n </span>\n ) : (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n focusKey(\"GROQ_API_KEY\");\n }}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-accent/40\"\n >\n Add key\n <IconExternalLink size={10} />\n </button>\n )\n }\n />\n </div>\n )}\n </div>\n\n {(cleanupEnabled || transcriptionMode === \"batch\") && (\n <div className=\"rounded-md border border-border bg-accent/20 px-2.5 py-2\">\n <label\n htmlFor=\"voice-transcription-instructions\"\n className=\"block text-[10px] font-medium text-foreground\"\n >\n Custom instructions\n </label>\n <textarea\n id=\"voice-transcription-instructions\"\n value={instructions}\n onChange={(event) => updateInstructions(event.target.value)}\n placeholder=\"Names, casing, punctuation, style, or terms to preserve.\"\n className=\"mt-1 min-h-16 w-full resize-y rounded border border-border bg-background px-2 py-1.5 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n />\n <p className=\"mt-1 text-[10px] text-muted-foreground\">\n Included with batch transcription and AI cleanup.\n </p>\n </div>\n )}\n\n {saveError && !saving && (\n <p className=\"text-[10px] text-red-500\" role=\"alert\">\n {saveError}\n </p>\n )}\n </div>\n );\n}\n\ninterface ProviderOptionProps {\n id: string;\n selected: boolean;\n disabled?: boolean;\n onSelect: () => void;\n title: string;\n subtitle?: React.ReactNode;\n rightSlot?: React.ReactNode;\n}\n\nfunction ProviderOption({\n id: _id,\n selected,\n disabled,\n onSelect,\n title,\n subtitle,\n rightSlot,\n}: ProviderOptionProps) {\n const select = () => {\n if (!disabled) onSelect();\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (disabled) return;\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n onSelect();\n }\n };\n\n return (\n <div\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n onClick={select}\n onKeyDown={onKeyDown}\n aria-pressed={selected}\n aria-disabled={disabled || undefined}\n // Theme tokens; streaming agent owns layout.\n className={`w-full text-start rounded-md border px-2.5 py-2 flex items-start gap-2 ${\n selected\n ? \"border-primary bg-primary/10\"\n : \"border-border bg-accent/30 hover:bg-accent/50\"\n } ${disabled ? \"opacity-60 cursor-not-allowed\" : \"\"}`}\n >\n <span\n className={`mt-[2px] shrink-0 flex h-3.5 w-3.5 items-center justify-center rounded-full border ${\n selected\n ? \"border-primary bg-primary\"\n : \"border-muted-foreground/40 bg-background\"\n }`}\n >\n {selected && (\n <span className=\"h-1.5 w-1.5 rounded-full bg-primary-foreground\" />\n )}\n </span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"text-[11px] font-medium text-foreground\">{title}</div>\n {rightSlot && <div className=\"shrink-0\">{rightSlot}</div>}\n </div>\n {subtitle && (\n <p className=\"text-[10px] text-muted-foreground mt-0.5\">{subtitle}</p>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * Surfaces the desktop app's system-audio capture readiness inside the live\n * transcription box. Renders nothing in non-Tauri contexts (web users) so the\n * existing browser-only flow is unaffected. The Rust side\n * (`templates/clips/desktop/src-tauri/src/system_audio.rs`) returns either a\n * structured `VersionStatus` via `system_audio_version_status` (preferred,\n * no error-string parsing) or an unsupported-OS error from\n * `system_audio_request_permission`. We surface three states:\n *\n * - macOS 13+ + permission granted -> green check (\"System audio capture available\")\n * - macOS < 13 -> red dot (\"...requires macOS 13 or later\")\n * - permission denied / pending -> amber + \"Open System Settings\" affordance\n */\ntype SystemAudioState =\n | { kind: \"loading\" }\n | { kind: \"available\" }\n | { kind: \"unsupported\"; reason: string }\n | { kind: \"denied\" };\n\ninterface VersionStatusPayload {\n supported: boolean;\n os_version: string;\n reason?: string;\n}\n\n// Tauri v2 exposes `window.__TAURI_INTERNALS__.invoke` as the runtime entry\n// point that `@tauri-apps/api/core` itself wraps. Calling it directly avoids\n// pulling `@tauri-apps/api` into the web bundle's import graph — a dynamic\n// `import(\"@tauri-apps/api/core\")` survives Vite's prebundle as a literal\n// specifier and trips `vite:import-analysis` with a \"Failed to resolve\" error\n// in fresh CLI installs that don't have the desktop dep installed.\ntype TauriInvoke = (cmd: string, args?: unknown) => Promise<unknown>;\nfunction getTauriInvoke(): TauriInvoke | null {\n if (typeof window === \"undefined\") return null;\n const internals = (\n window as unknown as { __TAURI_INTERNALS__?: { invoke?: TauriInvoke } }\n ).__TAURI_INTERNALS__;\n return internals?.invoke ?? null;\n}\n\nfunction SystemAudioStatus() {\n const [state, setState] = useState<SystemAudioState | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n const invoke = getTauriInvoke();\n if (!invoke) return; // Web users: render nothing.\n setState({ kind: \"loading\" });\n void (async () => {\n try {\n const status = (await invoke(\"system_audio_version_status\")) as\n | VersionStatusPayload\n | undefined;\n if (cancelled) return;\n if (status && !status.supported) {\n setState({\n kind: \"unsupported\",\n reason:\n status.reason ??\n `ScreenCaptureKit is unavailable on ${status.os_version}.`,\n });\n return;\n }\n // Supported — now probe permission. This may prompt; calling it\n // here matches the original on-mount semantics requested in the\n // settings flow.\n try {\n const granted = (await invoke(\n \"system_audio_request_permission\",\n )) as boolean;\n if (cancelled) return;\n setState(granted ? { kind: \"available\" } : { kind: \"denied\" });\n } catch (err) {\n if (cancelled) return;\n const msg = String(err ?? \"\");\n if (/macOS\\s*1[0-2]|requires macOS 13/i.test(msg)) {\n setState({ kind: \"unsupported\", reason: msg });\n } else {\n setState({ kind: \"denied\" });\n }\n }\n } catch {\n // Older desktop builds may not have the new command yet —\n // fall back to the permission probe.\n if (cancelled) return;\n try {\n const granted = (await invoke(\n \"system_audio_request_permission\",\n )) as boolean;\n if (cancelled) return;\n setState(granted ? { kind: \"available\" } : { kind: \"denied\" });\n } catch (err) {\n if (cancelled) return;\n const msg = String(err ?? \"\");\n if (/macOS|ScreenCaptureKit/i.test(msg)) {\n setState({ kind: \"unsupported\", reason: msg });\n } else {\n setState({ kind: \"denied\" });\n }\n }\n }\n })();\n return () => {\n cancelled = true;\n };\n }, []);\n\n const openPrivacy = useCallback(() => {\n const invoke = getTauriInvoke();\n if (!invoke) return;\n void invoke(\"system_audio_open_privacy_settings\").catch(() => {\n // Older desktop builds without this command — no-op.\n });\n }, []);\n\n if (!state || state.kind === \"loading\") return null;\n\n if (state.kind === \"available\") {\n return (\n <div className=\"flex items-center gap-1.5 px-0.5 pt-1 text-[10px] text-muted-foreground\">\n <IconCheck size={11} className=\"text-green-500\" />\n <span>System audio capture available.</span>\n </div>\n );\n }\n\n if (state.kind === \"unsupported\") {\n return (\n <div className=\"flex items-center gap-1.5 px-0.5 pt-1 text-[10px] text-muted-foreground\">\n <span\n className=\"inline-block h-1.5 w-1.5 shrink-0 rounded-full bg-red-500\"\n aria-hidden\n />\n <span>\n System audio requires macOS 13 or later — meetings will use mic-only.\n </span>\n </div>\n );\n }\n\n // denied\n return (\n <div className=\"flex items-start gap-1.5 px-0.5 pt-1 text-[10px] text-muted-foreground\">\n <IconAlertCircle size={11} className=\"mt-[1px] shrink-0 text-amber-500\" />\n <div className=\"flex-1\">\n <span>\n Grant Screen Recording permission in System Settings -> Privacy.\n </span>\n <button\n type=\"button\"\n onClick={openPrivacy}\n className=\"ms-1 inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-accent/40 hover:text-foreground\"\n >\n <IconLockOpen size={10} />\n Open System Settings\n </button>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -110,15 +110,47 @@ export declare class AgentAutoContinueSignal extends Error {
|
|
|
110
110
|
readonly maxIterations?: number;
|
|
111
111
|
readonly activityTrail: AgentActivityTrailEntry[];
|
|
112
112
|
readonly errorInfo?: AgentAutoContinueErrorInfo;
|
|
113
|
+
/**
|
|
114
|
+
* True when a CLIENT watchdog produced this signal rather than the server
|
|
115
|
+
* asking for a continuation. The two need opposite handling: a server
|
|
116
|
+
* `auto_continue` wants a fresh POST, a client watchdog only means "the
|
|
117
|
+
* browser stopped seeing bytes" and must reattach instead.
|
|
118
|
+
*/
|
|
119
|
+
readonly clientWatchdog: boolean;
|
|
113
120
|
constructor(options: {
|
|
114
121
|
reason: AgentAutoContinueReason;
|
|
115
122
|
maxIterations?: number;
|
|
116
123
|
activityTrail?: AgentActivityTrailEntry[];
|
|
117
124
|
errorInfo?: AgentAutoContinueErrorInfo;
|
|
125
|
+
clientWatchdog?: boolean;
|
|
118
126
|
});
|
|
119
127
|
}
|
|
120
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Client no-progress window for foreground runs. MUST stay ABOVE the server's
|
|
130
|
+
* authoritative backstop (`RUN_NO_PROGRESS_HARD_TIMEOUT_MS`, 150s in
|
|
131
|
+
* agent/run-manager.ts) so the server's recovery ladder always gets first
|
|
132
|
+
* chance and the browser is never the primary stall detector. At the old 75s
|
|
133
|
+
* this fired below every server bound, so the whole server ladder was dead
|
|
134
|
+
* code and the median hosted foreground turn ended as a client-declared stall.
|
|
135
|
+
* Progress accounting here deliberately mirrors the server's
|
|
136
|
+
* `shouldBumpProgressForEvent` (keepalives and zero-byte prep activity do not
|
|
137
|
+
* count) so the two never disagree about what "progress" means.
|
|
138
|
+
*/
|
|
139
|
+
export declare const SSE_NO_PROGRESS_TIMEOUT_MS = 180000;
|
|
121
140
|
export declare const SSE_ACTION_PREPARATION_STALL_TIMEOUT_MS = 90000;
|
|
141
|
+
/**
|
|
142
|
+
* Window applied instead of the normal no-progress budget while a tool call or
|
|
143
|
+
* A2A delegation is open. The server deliberately suspends its own backstop for
|
|
144
|
+
* exactly this case — tool execution legitimately emits nothing for minutes —
|
|
145
|
+
* so without the mirror here the browser silently caps every long tool at the
|
|
146
|
+
* shorter window and kills a run the server believes is healthy.
|
|
147
|
+
*/
|
|
148
|
+
export declare const SSE_IN_FLIGHT_WORK_TIMEOUT_MS: number;
|
|
149
|
+
/**
|
|
150
|
+
* Open-work delta for one event: +1 when a tool call or A2A delegation starts,
|
|
151
|
+
* -1 when it settles. Mirrors the server's `in_flight_since` marker.
|
|
152
|
+
*/
|
|
153
|
+
export declare function sseInFlightWorkDelta(ev: SSEEvent): number;
|
|
122
154
|
/**
|
|
123
155
|
* Widened client watchdog windows for durable background runs. The SERVER is
|
|
124
156
|
* the recovery brain for these runs: its run-manager no-progress backstop
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse-event-processor.d.ts","sourceRoot":"","sources":["../../src/client/sse-event-processor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAK1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAQtE,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IACE;;;;;OAKG;IACH,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,M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GAAG,SAAS,EACzB,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,EAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EACrB,OAAO,CAAC,EAAE,gBAAgB,GACzB,cAAc,CAAC,kBAAkB,CAAC,CA0NpC;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,EAChC,OAAO,EAAE,WAAW,EAAE,EACtB,eAAe,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,EAClC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,IAAI,EAC1C,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,EAC7B,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,IAAI,CAAC,CAkLf"}
|
|
@@ -37,6 +37,13 @@ export class AgentAutoContinueSignal extends Error {
|
|
|
37
37
|
maxIterations;
|
|
38
38
|
activityTrail;
|
|
39
39
|
errorInfo;
|
|
40
|
+
/**
|
|
41
|
+
* True when a CLIENT watchdog produced this signal rather than the server
|
|
42
|
+
* asking for a continuation. The two need opposite handling: a server
|
|
43
|
+
* `auto_continue` wants a fresh POST, a client watchdog only means "the
|
|
44
|
+
* browser stopped seeing bytes" and must reattach instead.
|
|
45
|
+
*/
|
|
46
|
+
clientWatchdog;
|
|
40
47
|
constructor(options) {
|
|
41
48
|
super(`Agent run needs automatic continuation: ${options.reason}`);
|
|
42
49
|
this.name = "AgentAutoContinueSignal";
|
|
@@ -44,10 +51,47 @@ export class AgentAutoContinueSignal extends Error {
|
|
|
44
51
|
this.maxIterations = options.maxIterations;
|
|
45
52
|
this.activityTrail = options.activityTrail ?? [];
|
|
46
53
|
this.errorInfo = options.errorInfo;
|
|
54
|
+
this.clientWatchdog = options.clientWatchdog === true;
|
|
47
55
|
}
|
|
48
56
|
}
|
|
49
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Client no-progress window for foreground runs. MUST stay ABOVE the server's
|
|
59
|
+
* authoritative backstop (`RUN_NO_PROGRESS_HARD_TIMEOUT_MS`, 150s in
|
|
60
|
+
* agent/run-manager.ts) so the server's recovery ladder always gets first
|
|
61
|
+
* chance and the browser is never the primary stall detector. At the old 75s
|
|
62
|
+
* this fired below every server bound, so the whole server ladder was dead
|
|
63
|
+
* code and the median hosted foreground turn ended as a client-declared stall.
|
|
64
|
+
* Progress accounting here deliberately mirrors the server's
|
|
65
|
+
* `shouldBumpProgressForEvent` (keepalives and zero-byte prep activity do not
|
|
66
|
+
* count) so the two never disagree about what "progress" means.
|
|
67
|
+
*/
|
|
68
|
+
export const SSE_NO_PROGRESS_TIMEOUT_MS = 180_000;
|
|
50
69
|
export const SSE_ACTION_PREPARATION_STALL_TIMEOUT_MS = 90_000;
|
|
70
|
+
/**
|
|
71
|
+
* Window applied instead of the normal no-progress budget while a tool call or
|
|
72
|
+
* A2A delegation is open. The server deliberately suspends its own backstop for
|
|
73
|
+
* exactly this case — tool execution legitimately emits nothing for minutes —
|
|
74
|
+
* so without the mirror here the browser silently caps every long tool at the
|
|
75
|
+
* shorter window and kills a run the server believes is healthy.
|
|
76
|
+
*/
|
|
77
|
+
export const SSE_IN_FLIGHT_WORK_TIMEOUT_MS = 15 * 60_000;
|
|
78
|
+
/**
|
|
79
|
+
* Open-work delta for one event: +1 when a tool call or A2A delegation starts,
|
|
80
|
+
* -1 when it settles. Mirrors the server's `in_flight_since` marker.
|
|
81
|
+
*/
|
|
82
|
+
export function sseInFlightWorkDelta(ev) {
|
|
83
|
+
if (ev.type === "tool_start")
|
|
84
|
+
return 1;
|
|
85
|
+
if (ev.type === "tool_done")
|
|
86
|
+
return -1;
|
|
87
|
+
if (ev.type === "agent_call") {
|
|
88
|
+
if (ev.status === "start")
|
|
89
|
+
return 1;
|
|
90
|
+
if (ev.status === "done" || ev.status === "error")
|
|
91
|
+
return -1;
|
|
92
|
+
}
|
|
93
|
+
return 0;
|
|
94
|
+
}
|
|
51
95
|
/**
|
|
52
96
|
* Widened client watchdog windows for durable background runs. The SERVER is
|
|
53
97
|
* the recovery brain for these runs: its run-manager no-progress backstop
|
|
@@ -347,7 +391,10 @@ async function readChunkWithProgressTimeout(reader, lastMeaningfulEventAt, noPro
|
|
|
347
391
|
}
|
|
348
392
|
if (result === "timeout") {
|
|
349
393
|
await reader.cancel("no_progress").catch(() => { });
|
|
350
|
-
throw new AgentAutoContinueSignal({
|
|
394
|
+
throw new AgentAutoContinueSignal({
|
|
395
|
+
reason: "no_progress",
|
|
396
|
+
clientWatchdog: true,
|
|
397
|
+
});
|
|
351
398
|
}
|
|
352
399
|
return result;
|
|
353
400
|
}
|
|
@@ -391,7 +438,15 @@ function isAutoRecoverableError(ev, errMsg) {
|
|
|
391
438
|
// the recovery banner reads "stopped before finishing", but it must NOT
|
|
392
439
|
// auto-continue: another POST would hit the same ~40s wall and churn. The
|
|
393
440
|
// user retries deliberately (ideally as a single bulk action).
|
|
394
|
-
code === "run_budget_exhausted"
|
|
441
|
+
code === "run_budget_exhausted" ||
|
|
442
|
+
// `aborted_<reason>` is emitted by `terminalEventForAbortReason` for every
|
|
443
|
+
// abort that is neither a user stop nor a continuation boundary — a Slack
|
|
444
|
+
// cancel, a stuck-banner auto-retry, an operator kill. Whoever aborted the
|
|
445
|
+
// run owns the retry; auto-continuing here restarts work someone just
|
|
446
|
+
// stopped (and double-fires alongside the stuck banner's own retry). They
|
|
447
|
+
// stay `recoverable: true` so the banner still reads "stopped before
|
|
448
|
+
// finishing".
|
|
449
|
+
code.startsWith("aborted_")) {
|
|
395
450
|
return false;
|
|
396
451
|
}
|
|
397
452
|
if (code === "builder_gateway_network_error" ||
|
|
@@ -1345,6 +1400,10 @@ export async function* readSSEStream(body, content, toolCallCounter, tabId, onSe
|
|
|
1345
1400
|
};
|
|
1346
1401
|
let renderUpdatesThisTurn = 0;
|
|
1347
1402
|
let nextEventLoopTurn = null;
|
|
1403
|
+
let inFlightWork = 0;
|
|
1404
|
+
const currentNoProgressTimeoutMs = () => inFlightWork > 0
|
|
1405
|
+
? Math.max(noProgressTimeoutMs, SSE_IN_FLIGHT_WORK_TIMEOUT_MS)
|
|
1406
|
+
: noProgressTimeoutMs;
|
|
1348
1407
|
const paceRenderUpdate = async () => {
|
|
1349
1408
|
renderUpdatesThisTurn += 1;
|
|
1350
1409
|
if (!nextEventLoopTurn) {
|
|
@@ -1392,7 +1451,7 @@ export async function* readSSEStream(body, content, toolCallCounter, tabId, onSe
|
|
|
1392
1451
|
while (true) {
|
|
1393
1452
|
let readResult;
|
|
1394
1453
|
try {
|
|
1395
|
-
readResult = await readChunkWithProgressTimeout(reader, lastMeaningfulEventAt,
|
|
1454
|
+
readResult = await readChunkWithProgressTimeout(reader, lastMeaningfulEventAt, currentNoProgressTimeoutMs());
|
|
1396
1455
|
}
|
|
1397
1456
|
catch (err) {
|
|
1398
1457
|
if (err instanceof AgentAutoContinueSignal) {
|
|
@@ -1401,6 +1460,7 @@ export async function* readSSEStream(body, content, toolCallCounter, tabId, onSe
|
|
|
1401
1460
|
maxIterations: err.maxIterations,
|
|
1402
1461
|
activityTrail: [...activityTrail],
|
|
1403
1462
|
errorInfo: err.errorInfo,
|
|
1463
|
+
clientWatchdog: err.clientWatchdog,
|
|
1404
1464
|
});
|
|
1405
1465
|
}
|
|
1406
1466
|
throw err;
|
|
@@ -1426,6 +1486,7 @@ export async function* readSSEStream(body, content, toolCallCounter, tabId, onSe
|
|
|
1426
1486
|
continue;
|
|
1427
1487
|
}
|
|
1428
1488
|
const now = Date.now();
|
|
1489
|
+
inFlightWork = Math.max(0, inFlightWork + sseInFlightWorkDelta(ev));
|
|
1429
1490
|
const actionPreparationProgress = updatePreparingActionState(preparingActionState, ev, now);
|
|
1430
1491
|
if (isMeaningfulProgressEvent(ev, actionPreparationProgress, options)) {
|
|
1431
1492
|
sawProgressEvent = true;
|
|
@@ -1469,6 +1530,7 @@ export async function* readSSEStream(body, content, toolCallCounter, tabId, onSe
|
|
|
1469
1530
|
throw new AgentAutoContinueSignal({
|
|
1470
1531
|
reason: "no_progress",
|
|
1471
1532
|
activityTrail: [...activityTrail],
|
|
1533
|
+
clientWatchdog: true,
|
|
1472
1534
|
});
|
|
1473
1535
|
}
|
|
1474
1536
|
if (action === "auto_continue") {
|
|
@@ -1483,10 +1545,11 @@ export async function* readSSEStream(body, content, toolCallCounter, tabId, onSe
|
|
|
1483
1545
|
}
|
|
1484
1546
|
}
|
|
1485
1547
|
if (!sawProgressEvent &&
|
|
1486
|
-
Date.now() - lastMeaningfulEventAt >=
|
|
1548
|
+
Date.now() - lastMeaningfulEventAt >= currentNoProgressTimeoutMs()) {
|
|
1487
1549
|
throw new AgentAutoContinueSignal({
|
|
1488
1550
|
reason: "no_progress",
|
|
1489
1551
|
activityTrail: [...activityTrail],
|
|
1552
|
+
clientWatchdog: true,
|
|
1490
1553
|
});
|
|
1491
1554
|
}
|
|
1492
1555
|
}
|
|
@@ -1507,6 +1570,7 @@ export async function* readSSEStream(body, content, toolCallCounter, tabId, onSe
|
|
|
1507
1570
|
throw new AgentAutoContinueSignal({
|
|
1508
1571
|
reason: "stream_ended",
|
|
1509
1572
|
activityTrail: [...activityTrail],
|
|
1573
|
+
clientWatchdog: true,
|
|
1510
1574
|
});
|
|
1511
1575
|
}
|
|
1512
1576
|
/**
|
|
@@ -1533,11 +1597,15 @@ export async function readSSEStreamRaw(body, content, toolCallCounter, tabId, on
|
|
|
1533
1597
|
// identical content a second time when the stream closes without a terminal
|
|
1534
1598
|
// event.
|
|
1535
1599
|
let emittedLatestContent = false;
|
|
1600
|
+
let inFlightWork = 0;
|
|
1601
|
+
const currentNoProgressTimeoutMs = () => inFlightWork > 0
|
|
1602
|
+
? Math.max(noProgressTimeoutMs, SSE_IN_FLIGHT_WORK_TIMEOUT_MS)
|
|
1603
|
+
: noProgressTimeoutMs;
|
|
1536
1604
|
try {
|
|
1537
1605
|
while (true) {
|
|
1538
1606
|
let readResult;
|
|
1539
1607
|
try {
|
|
1540
|
-
readResult = await readChunkWithProgressTimeout(reader, lastMeaningfulEventAt,
|
|
1608
|
+
readResult = await readChunkWithProgressTimeout(reader, lastMeaningfulEventAt, currentNoProgressTimeoutMs());
|
|
1541
1609
|
}
|
|
1542
1610
|
catch (err) {
|
|
1543
1611
|
if (err instanceof AgentAutoContinueSignal) {
|
|
@@ -1546,6 +1614,7 @@ export async function readSSEStreamRaw(body, content, toolCallCounter, tabId, on
|
|
|
1546
1614
|
maxIterations: err.maxIterations,
|
|
1547
1615
|
activityTrail: [...activityTrail],
|
|
1548
1616
|
errorInfo: err.errorInfo,
|
|
1617
|
+
clientWatchdog: err.clientWatchdog,
|
|
1549
1618
|
});
|
|
1550
1619
|
}
|
|
1551
1620
|
throw err;
|
|
@@ -1571,6 +1640,7 @@ export async function readSSEStreamRaw(body, content, toolCallCounter, tabId, on
|
|
|
1571
1640
|
continue;
|
|
1572
1641
|
}
|
|
1573
1642
|
const now = Date.now();
|
|
1643
|
+
inFlightWork = Math.max(0, inFlightWork + sseInFlightWorkDelta(ev));
|
|
1574
1644
|
const actionPreparationProgress = updatePreparingActionState(preparingActionState, ev, now);
|
|
1575
1645
|
if (isMeaningfulProgressEvent(ev, actionPreparationProgress, options)) {
|
|
1576
1646
|
sawProgressEvent = true;
|
|
@@ -1624,6 +1694,7 @@ export async function readSSEStreamRaw(body, content, toolCallCounter, tabId, on
|
|
|
1624
1694
|
throw new AgentAutoContinueSignal({
|
|
1625
1695
|
reason: "no_progress",
|
|
1626
1696
|
activityTrail: [...activityTrail],
|
|
1697
|
+
clientWatchdog: true,
|
|
1627
1698
|
});
|
|
1628
1699
|
}
|
|
1629
1700
|
if (action === "done" ||
|
|
@@ -1633,10 +1704,11 @@ export async function readSSEStreamRaw(body, content, toolCallCounter, tabId, on
|
|
|
1633
1704
|
}
|
|
1634
1705
|
}
|
|
1635
1706
|
if (!sawProgressEvent &&
|
|
1636
|
-
Date.now() - lastMeaningfulEventAt >=
|
|
1707
|
+
Date.now() - lastMeaningfulEventAt >= currentNoProgressTimeoutMs()) {
|
|
1637
1708
|
throw new AgentAutoContinueSignal({
|
|
1638
1709
|
reason: "no_progress",
|
|
1639
1710
|
activityTrail: [...activityTrail],
|
|
1711
|
+
clientWatchdog: true,
|
|
1640
1712
|
});
|
|
1641
1713
|
}
|
|
1642
1714
|
}
|
|
@@ -1652,6 +1724,9 @@ export async function readSSEStreamRaw(body, content, toolCallCounter, tabId, on
|
|
|
1652
1724
|
if (content.length > 0 && !emittedLatestContent) {
|
|
1653
1725
|
onUpdate(contentSnapshot(content));
|
|
1654
1726
|
}
|
|
1655
|
-
throw new AgentAutoContinueSignal({
|
|
1727
|
+
throw new AgentAutoContinueSignal({
|
|
1728
|
+
reason: "stream_ended",
|
|
1729
|
+
clientWatchdog: true,
|
|
1730
|
+
});
|
|
1656
1731
|
}
|
|
1657
1732
|
//# sourceMappingURL=sse-event-processor.js.map
|