@agent-native/core 0.93.0 → 0.94.1
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 +31 -0
- package/corpus/core/docs/content/a2a-protocol.mdx +21 -5
- package/corpus/core/docs/content/actions.mdx +9 -23
- package/corpus/core/docs/content/agent-mentions.mdx +31 -29
- package/corpus/core/docs/content/agent-native-toolkit.mdx +15 -6
- package/corpus/core/docs/content/agent-surfaces.mdx +9 -13
- package/corpus/core/docs/content/agent-teams.mdx +1 -0
- package/corpus/core/docs/content/authentication.mdx +10 -3
- package/corpus/core/docs/content/automation-connectors.mdx +82 -39
- package/corpus/core/docs/content/automations.mdx +17 -3
- package/corpus/core/docs/content/blueprint-installer.mdx +11 -4
- package/corpus/core/docs/content/cli-adapters.mdx +9 -6
- package/corpus/core/docs/content/client.mdx +16 -0
- package/corpus/core/docs/content/cloneable-saas.mdx +14 -11
- package/corpus/core/docs/content/code-agents-ui.mdx +65 -0
- package/corpus/core/docs/content/components.mdx +30 -14
- package/corpus/core/docs/content/context-awareness.mdx +27 -15
- package/corpus/core/docs/content/creating-templates.mdx +15 -9
- package/corpus/core/docs/content/cross-app-sso.mdx +16 -6
- package/corpus/core/docs/content/data-programs.mdx +1 -1
- package/corpus/core/docs/content/database.mdx +17 -5
- package/corpus/core/docs/content/deployment.mdx +19 -18
- package/corpus/core/docs/content/dispatch.mdx +6 -2
- package/corpus/core/docs/content/drop-in-agent.mdx +10 -4
- package/corpus/core/docs/content/durable-background-runs.mdx +9 -5
- package/corpus/core/docs/content/durable-resume.mdx +9 -4
- package/corpus/core/docs/content/embedding-sdk.mdx +26 -8
- package/corpus/core/docs/content/evals.mdx +3 -5
- package/corpus/core/docs/content/extensions.mdx +22 -9
- package/corpus/core/docs/content/external-agents.mdx +25 -34
- package/corpus/core/docs/content/faq.mdx +8 -0
- package/corpus/core/docs/content/file-uploads.mdx +12 -3
- package/corpus/core/docs/content/frames.mdx +16 -0
- package/corpus/core/docs/content/generative-ui.mdx +1 -1
- package/corpus/core/docs/content/getting-started.mdx +34 -21
- package/corpus/core/docs/content/harness-agents.mdx +8 -4
- package/corpus/core/docs/content/human-approval.mdx +8 -3
- package/corpus/core/docs/content/internationalization.mdx +9 -4
- package/corpus/core/docs/content/key-concepts.mdx +13 -20
- package/corpus/core/docs/content/local-file-mode.mdx +14 -8
- package/corpus/core/docs/content/locales/ar-SA/actions.mdx +2 -2
- package/corpus/core/docs/content/locales/ar-SA/agent-native-toolkit.mdx +2 -2
- package/corpus/core/docs/content/locales/ar-SA/agent-surfaces.mdx +8 -10
- package/corpus/core/docs/content/locales/ar-SA/agent-teams.mdx +1 -0
- package/corpus/core/docs/content/locales/ar-SA/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/components.mdx +11 -1
- package/corpus/core/docs/content/locales/ar-SA/creating-templates.mdx +3 -7
- package/corpus/core/docs/content/locales/ar-SA/cross-app-sso.mdx +16 -6
- package/corpus/core/docs/content/locales/ar-SA/deployment.mdx +8 -0
- package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +2 -7
- package/corpus/core/docs/content/locales/ar-SA/key-concepts.mdx +13 -20
- package/corpus/core/docs/content/locales/ar-SA/multi-tenancy.mdx +5 -5
- package/corpus/core/docs/content/locales/ar-SA/notifications.mdx +18 -10
- package/corpus/core/docs/content/locales/ar-SA/processors.mdx +11 -5
- package/corpus/core/docs/content/locales/ar-SA/server.mdx +17 -10
- package/corpus/core/docs/content/locales/ar-SA/sharing.mdx +10 -10
- package/corpus/core/docs/content/locales/ar-SA/skills-guide.mdx +34 -17
- package/corpus/core/docs/content/locales/ar-SA/template-assets.mdx +16 -13
- package/corpus/core/docs/content/locales/ar-SA/template-brain.mdx +3 -1
- package/corpus/core/docs/content/locales/ar-SA/template-clips.mdx +3 -3
- package/corpus/core/docs/content/locales/ar-SA/template-design.mdx +3 -1
- package/corpus/core/docs/content/locales/ar-SA/template-dispatch.mdx +5 -1
- package/corpus/core/docs/content/locales/ar-SA/template-mail.mdx +8 -0
- package/corpus/core/docs/content/locales/ar-SA/tracking.mdx +9 -6
- package/corpus/core/docs/content/locales/ar-SA/using-your-agent.mdx +0 -7
- package/corpus/core/docs/content/locales/ar-SA/voice-input.mdx +6 -0
- package/corpus/core/docs/content/locales/ar-SA/workspace-connections.mdx +9 -2
- package/corpus/core/docs/content/locales/ar-SA/workspace.mdx +19 -18
- package/corpus/core/docs/content/locales/de-DE/actions.mdx +2 -2
- package/corpus/core/docs/content/locales/de-DE/agent-native-toolkit.mdx +2 -2
- package/corpus/core/docs/content/locales/de-DE/agent-surfaces.mdx +8 -10
- package/corpus/core/docs/content/locales/de-DE/agent-teams.mdx +1 -0
- package/corpus/core/docs/content/locales/de-DE/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/components.mdx +11 -1
- package/corpus/core/docs/content/locales/de-DE/creating-templates.mdx +3 -7
- package/corpus/core/docs/content/locales/de-DE/cross-app-sso.mdx +16 -6
- package/corpus/core/docs/content/locales/de-DE/deployment.mdx +8 -0
- package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +3 -7
- package/corpus/core/docs/content/locales/de-DE/key-concepts.mdx +13 -20
- package/corpus/core/docs/content/locales/de-DE/multi-tenancy.mdx +5 -5
- package/corpus/core/docs/content/locales/de-DE/notifications.mdx +18 -10
- package/corpus/core/docs/content/locales/de-DE/processors.mdx +11 -5
- package/corpus/core/docs/content/locales/de-DE/server.mdx +18 -10
- package/corpus/core/docs/content/locales/de-DE/sharing.mdx +10 -10
- package/corpus/core/docs/content/locales/de-DE/skills-guide.mdx +34 -17
- package/corpus/core/docs/content/locales/de-DE/template-assets.mdx +16 -13
- package/corpus/core/docs/content/locales/de-DE/template-brain.mdx +3 -1
- package/corpus/core/docs/content/locales/de-DE/template-clips.mdx +3 -3
- package/corpus/core/docs/content/locales/de-DE/template-design.mdx +3 -1
- package/corpus/core/docs/content/locales/de-DE/template-dispatch.mdx +5 -1
- package/corpus/core/docs/content/locales/de-DE/template-mail.mdx +8 -0
- package/corpus/core/docs/content/locales/de-DE/tracking.mdx +9 -6
- package/corpus/core/docs/content/locales/de-DE/using-your-agent.mdx +0 -7
- package/corpus/core/docs/content/locales/de-DE/voice-input.mdx +6 -0
- package/corpus/core/docs/content/locales/de-DE/workspace-connections.mdx +9 -2
- package/corpus/core/docs/content/locales/de-DE/workspace.mdx +19 -18
- package/corpus/core/docs/content/locales/es-ES/actions.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/agent-native-toolkit.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/agent-surfaces.mdx +8 -10
- package/corpus/core/docs/content/locales/es-ES/agent-teams.mdx +1 -0
- package/corpus/core/docs/content/locales/es-ES/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/components.mdx +11 -1
- package/corpus/core/docs/content/locales/es-ES/creating-templates.mdx +3 -7
- package/corpus/core/docs/content/locales/es-ES/cross-app-sso.mdx +16 -6
- package/corpus/core/docs/content/locales/es-ES/deployment.mdx +8 -0
- package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +3 -7
- package/corpus/core/docs/content/locales/es-ES/key-concepts.mdx +13 -20
- package/corpus/core/docs/content/locales/es-ES/multi-tenancy.mdx +5 -5
- package/corpus/core/docs/content/locales/es-ES/notifications.mdx +18 -10
- package/corpus/core/docs/content/locales/es-ES/processors.mdx +11 -5
- package/corpus/core/docs/content/locales/es-ES/server.mdx +17 -10
- package/corpus/core/docs/content/locales/es-ES/sharing.mdx +10 -10
- package/corpus/core/docs/content/locales/es-ES/skills-guide.mdx +34 -17
- package/corpus/core/docs/content/locales/es-ES/template-assets.mdx +16 -13
- package/corpus/core/docs/content/locales/es-ES/template-brain.mdx +3 -1
- package/corpus/core/docs/content/locales/es-ES/template-clips.mdx +3 -3
- package/corpus/core/docs/content/locales/es-ES/template-design.mdx +3 -1
- package/corpus/core/docs/content/locales/es-ES/template-dispatch.mdx +5 -1
- package/corpus/core/docs/content/locales/es-ES/template-mail.mdx +8 -0
- package/corpus/core/docs/content/locales/es-ES/tracking.mdx +9 -6
- package/corpus/core/docs/content/locales/es-ES/using-your-agent.mdx +0 -7
- package/corpus/core/docs/content/locales/es-ES/voice-input.mdx +6 -0
- package/corpus/core/docs/content/locales/es-ES/workspace-connections.mdx +9 -2
- package/corpus/core/docs/content/locales/es-ES/workspace.mdx +19 -18
- package/corpus/core/docs/content/locales/fr-FR/actions.mdx +2 -2
- package/corpus/core/docs/content/locales/fr-FR/agent-native-toolkit.mdx +2 -2
- package/corpus/core/docs/content/locales/fr-FR/agent-surfaces.mdx +8 -10
- package/corpus/core/docs/content/locales/fr-FR/agent-teams.mdx +1 -0
- package/corpus/core/docs/content/locales/fr-FR/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/components.mdx +11 -1
- package/corpus/core/docs/content/locales/fr-FR/creating-templates.mdx +3 -7
- package/corpus/core/docs/content/locales/fr-FR/cross-app-sso.mdx +16 -6
- package/corpus/core/docs/content/locales/fr-FR/deployment.mdx +8 -0
- package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +3 -7
- package/corpus/core/docs/content/locales/fr-FR/key-concepts.mdx +13 -20
- package/corpus/core/docs/content/locales/fr-FR/multi-tenancy.mdx +5 -5
- package/corpus/core/docs/content/locales/fr-FR/notifications.mdx +18 -10
- package/corpus/core/docs/content/locales/fr-FR/processors.mdx +11 -5
- package/corpus/core/docs/content/locales/fr-FR/server.mdx +17 -10
- package/corpus/core/docs/content/locales/fr-FR/sharing.mdx +10 -10
- package/corpus/core/docs/content/locales/fr-FR/skills-guide.mdx +34 -17
- package/corpus/core/docs/content/locales/fr-FR/template-assets.mdx +16 -13
- package/corpus/core/docs/content/locales/fr-FR/template-brain.mdx +3 -1
- package/corpus/core/docs/content/locales/fr-FR/template-clips.mdx +3 -3
- package/corpus/core/docs/content/locales/fr-FR/template-design.mdx +3 -1
- package/corpus/core/docs/content/locales/fr-FR/template-dispatch.mdx +5 -1
- package/corpus/core/docs/content/locales/fr-FR/template-mail.mdx +8 -0
- package/corpus/core/docs/content/locales/fr-FR/tracking.mdx +9 -6
- package/corpus/core/docs/content/locales/fr-FR/using-your-agent.mdx +0 -7
- package/corpus/core/docs/content/locales/fr-FR/voice-input.mdx +6 -0
- package/corpus/core/docs/content/locales/fr-FR/workspace-connections.mdx +9 -2
- package/corpus/core/docs/content/locales/fr-FR/workspace.mdx +19 -18
- package/corpus/core/docs/content/locales/hi-IN/actions.mdx +2 -2
- package/corpus/core/docs/content/locales/hi-IN/agent-native-toolkit.mdx +2 -2
- package/corpus/core/docs/content/locales/hi-IN/agent-surfaces.mdx +8 -10
- package/corpus/core/docs/content/locales/hi-IN/agent-teams.mdx +1 -0
- package/corpus/core/docs/content/locales/hi-IN/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/components.mdx +11 -1
- package/corpus/core/docs/content/locales/hi-IN/creating-templates.mdx +3 -7
- package/corpus/core/docs/content/locales/hi-IN/cross-app-sso.mdx +16 -6
- package/corpus/core/docs/content/locales/hi-IN/deployment.mdx +8 -0
- package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +2 -7
- package/corpus/core/docs/content/locales/hi-IN/key-concepts.mdx +13 -20
- package/corpus/core/docs/content/locales/hi-IN/multi-tenancy.mdx +5 -5
- package/corpus/core/docs/content/locales/hi-IN/notifications.mdx +18 -10
- package/corpus/core/docs/content/locales/hi-IN/processors.mdx +11 -5
- package/corpus/core/docs/content/locales/hi-IN/server.mdx +17 -10
- package/corpus/core/docs/content/locales/hi-IN/sharing.mdx +10 -10
- package/corpus/core/docs/content/locales/hi-IN/skills-guide.mdx +34 -17
- package/corpus/core/docs/content/locales/hi-IN/template-assets.mdx +16 -13
- package/corpus/core/docs/content/locales/hi-IN/template-brain.mdx +3 -1
- package/corpus/core/docs/content/locales/hi-IN/template-clips.mdx +3 -3
- package/corpus/core/docs/content/locales/hi-IN/template-design.mdx +3 -1
- package/corpus/core/docs/content/locales/hi-IN/template-dispatch.mdx +5 -1
- package/corpus/core/docs/content/locales/hi-IN/template-mail.mdx +8 -0
- package/corpus/core/docs/content/locales/hi-IN/tracking.mdx +9 -6
- package/corpus/core/docs/content/locales/hi-IN/using-your-agent.mdx +0 -7
- package/corpus/core/docs/content/locales/hi-IN/voice-input.mdx +6 -0
- package/corpus/core/docs/content/locales/hi-IN/workspace-connections.mdx +9 -2
- package/corpus/core/docs/content/locales/hi-IN/workspace.mdx +19 -18
- package/corpus/core/docs/content/locales/ja-JP/actions.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/agent-native-toolkit.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/agent-surfaces.mdx +8 -10
- package/corpus/core/docs/content/locales/ja-JP/agent-teams.mdx +1 -0
- package/corpus/core/docs/content/locales/ja-JP/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/components.mdx +11 -1
- package/corpus/core/docs/content/locales/ja-JP/creating-templates.mdx +3 -7
- package/corpus/core/docs/content/locales/ja-JP/cross-app-sso.mdx +16 -6
- package/corpus/core/docs/content/locales/ja-JP/deployment.mdx +8 -0
- package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +2 -7
- package/corpus/core/docs/content/locales/ja-JP/key-concepts.mdx +13 -20
- package/corpus/core/docs/content/locales/ja-JP/multi-tenancy.mdx +5 -5
- package/corpus/core/docs/content/locales/ja-JP/notifications.mdx +18 -10
- package/corpus/core/docs/content/locales/ja-JP/processors.mdx +11 -5
- package/corpus/core/docs/content/locales/ja-JP/server.mdx +17 -10
- package/corpus/core/docs/content/locales/ja-JP/sharing.mdx +10 -10
- package/corpus/core/docs/content/locales/ja-JP/skills-guide.mdx +34 -17
- package/corpus/core/docs/content/locales/ja-JP/template-assets.mdx +16 -13
- package/corpus/core/docs/content/locales/ja-JP/template-brain.mdx +3 -1
- package/corpus/core/docs/content/locales/ja-JP/template-clips.mdx +3 -4
- package/corpus/core/docs/content/locales/ja-JP/template-design.mdx +3 -1
- package/corpus/core/docs/content/locales/ja-JP/template-dispatch.mdx +5 -1
- package/corpus/core/docs/content/locales/ja-JP/template-mail.mdx +8 -0
- package/corpus/core/docs/content/locales/ja-JP/tracking.mdx +9 -6
- package/corpus/core/docs/content/locales/ja-JP/using-your-agent.mdx +0 -7
- package/corpus/core/docs/content/locales/ja-JP/voice-input.mdx +6 -0
- package/corpus/core/docs/content/locales/ja-JP/workspace-connections.mdx +9 -2
- package/corpus/core/docs/content/locales/ja-JP/workspace.mdx +19 -18
- package/corpus/core/docs/content/locales/ko-KR/actions.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/agent-native-toolkit.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/agent-surfaces.mdx +8 -10
- package/corpus/core/docs/content/locales/ko-KR/agent-teams.mdx +1 -0
- package/corpus/core/docs/content/locales/ko-KR/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/components.mdx +11 -1
- package/corpus/core/docs/content/locales/ko-KR/creating-templates.mdx +3 -7
- package/corpus/core/docs/content/locales/ko-KR/cross-app-sso.mdx +16 -6
- package/corpus/core/docs/content/locales/ko-KR/deployment.mdx +8 -0
- package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +2 -7
- package/corpus/core/docs/content/locales/ko-KR/key-concepts.mdx +13 -20
- package/corpus/core/docs/content/locales/ko-KR/multi-tenancy.mdx +5 -5
- package/corpus/core/docs/content/locales/ko-KR/notifications.mdx +18 -10
- package/corpus/core/docs/content/locales/ko-KR/processors.mdx +11 -5
- package/corpus/core/docs/content/locales/ko-KR/server.mdx +17 -10
- package/corpus/core/docs/content/locales/ko-KR/sharing.mdx +10 -10
- package/corpus/core/docs/content/locales/ko-KR/skills-guide.mdx +34 -17
- package/corpus/core/docs/content/locales/ko-KR/template-assets.mdx +16 -13
- package/corpus/core/docs/content/locales/ko-KR/template-brain.mdx +3 -1
- package/corpus/core/docs/content/locales/ko-KR/template-clips.mdx +3 -4
- package/corpus/core/docs/content/locales/ko-KR/template-design.mdx +3 -1
- package/corpus/core/docs/content/locales/ko-KR/template-dispatch.mdx +5 -1
- package/corpus/core/docs/content/locales/ko-KR/template-mail.mdx +8 -0
- package/corpus/core/docs/content/locales/ko-KR/tracking.mdx +9 -6
- package/corpus/core/docs/content/locales/ko-KR/using-your-agent.mdx +0 -7
- package/corpus/core/docs/content/locales/ko-KR/voice-input.mdx +6 -0
- package/corpus/core/docs/content/locales/ko-KR/workspace-connections.mdx +9 -2
- package/corpus/core/docs/content/locales/ko-KR/workspace.mdx +19 -18
- package/corpus/core/docs/content/locales/pt-BR/actions.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/agent-native-toolkit.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/agent-surfaces.mdx +8 -10
- package/corpus/core/docs/content/locales/pt-BR/agent-teams.mdx +1 -0
- package/corpus/core/docs/content/locales/pt-BR/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/components.mdx +11 -1
- package/corpus/core/docs/content/locales/pt-BR/creating-templates.mdx +3 -7
- package/corpus/core/docs/content/locales/pt-BR/cross-app-sso.mdx +16 -6
- package/corpus/core/docs/content/locales/pt-BR/deployment.mdx +8 -0
- package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +3 -7
- package/corpus/core/docs/content/locales/pt-BR/key-concepts.mdx +13 -20
- package/corpus/core/docs/content/locales/pt-BR/multi-tenancy.mdx +5 -5
- package/corpus/core/docs/content/locales/pt-BR/notifications.mdx +18 -10
- package/corpus/core/docs/content/locales/pt-BR/processors.mdx +11 -5
- package/corpus/core/docs/content/locales/pt-BR/server.mdx +17 -10
- package/corpus/core/docs/content/locales/pt-BR/sharing.mdx +10 -10
- package/corpus/core/docs/content/locales/pt-BR/skills-guide.mdx +34 -17
- package/corpus/core/docs/content/locales/pt-BR/template-assets.mdx +16 -13
- package/corpus/core/docs/content/locales/pt-BR/template-brain.mdx +3 -1
- package/corpus/core/docs/content/locales/pt-BR/template-clips.mdx +3 -3
- package/corpus/core/docs/content/locales/pt-BR/template-design.mdx +3 -1
- package/corpus/core/docs/content/locales/pt-BR/template-dispatch.mdx +5 -1
- package/corpus/core/docs/content/locales/pt-BR/template-mail.mdx +8 -0
- package/corpus/core/docs/content/locales/pt-BR/tracking.mdx +9 -6
- package/corpus/core/docs/content/locales/pt-BR/using-your-agent.mdx +0 -7
- package/corpus/core/docs/content/locales/pt-BR/voice-input.mdx +6 -0
- package/corpus/core/docs/content/locales/pt-BR/workspace-connections.mdx +9 -2
- package/corpus/core/docs/content/locales/pt-BR/workspace.mdx +19 -18
- package/corpus/core/docs/content/locales/zh-CN/actions.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/agent-native-toolkit.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/agent-surfaces.mdx +8 -10
- package/corpus/core/docs/content/locales/zh-CN/agent-teams.mdx +1 -0
- package/corpus/core/docs/content/locales/zh-CN/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/components.mdx +11 -1
- package/corpus/core/docs/content/locales/zh-CN/creating-templates.mdx +3 -7
- package/corpus/core/docs/content/locales/zh-CN/cross-app-sso.mdx +16 -6
- package/corpus/core/docs/content/locales/zh-CN/deployment.mdx +8 -0
- package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +2 -7
- package/corpus/core/docs/content/locales/zh-CN/key-concepts.mdx +13 -20
- package/corpus/core/docs/content/locales/zh-CN/multi-tenancy.mdx +5 -5
- package/corpus/core/docs/content/locales/zh-CN/notifications.mdx +18 -10
- package/corpus/core/docs/content/locales/zh-CN/processors.mdx +11 -5
- package/corpus/core/docs/content/locales/zh-CN/server.mdx +16 -10
- package/corpus/core/docs/content/locales/zh-CN/sharing.mdx +10 -10
- package/corpus/core/docs/content/locales/zh-CN/skills-guide.mdx +34 -17
- package/corpus/core/docs/content/locales/zh-CN/template-assets.mdx +16 -13
- package/corpus/core/docs/content/locales/zh-CN/template-brain.mdx +3 -1
- package/corpus/core/docs/content/locales/zh-CN/template-clips.mdx +3 -4
- package/corpus/core/docs/content/locales/zh-CN/template-design.mdx +3 -1
- package/corpus/core/docs/content/locales/zh-CN/template-dispatch.mdx +5 -1
- package/corpus/core/docs/content/locales/zh-CN/template-mail.mdx +8 -0
- package/corpus/core/docs/content/locales/zh-CN/tracking.mdx +9 -6
- package/corpus/core/docs/content/locales/zh-CN/using-your-agent.mdx +0 -7
- package/corpus/core/docs/content/locales/zh-CN/voice-input.mdx +6 -0
- package/corpus/core/docs/content/locales/zh-CN/workspace-connections.mdx +9 -2
- package/corpus/core/docs/content/locales/zh-CN/workspace.mdx +19 -18
- package/corpus/core/docs/content/locales/zh-TW/actions.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/agent-native-toolkit.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/agent-surfaces.mdx +8 -10
- package/corpus/core/docs/content/locales/zh-TW/agent-teams.mdx +1 -0
- package/corpus/core/docs/content/locales/zh-TW/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/components.mdx +11 -1
- package/corpus/core/docs/content/locales/zh-TW/creating-templates.mdx +3 -7
- package/corpus/core/docs/content/locales/zh-TW/cross-app-sso.mdx +16 -6
- package/corpus/core/docs/content/locales/zh-TW/deployment.mdx +8 -0
- package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +2 -7
- package/corpus/core/docs/content/locales/zh-TW/key-concepts.mdx +13 -20
- package/corpus/core/docs/content/locales/zh-TW/multi-tenancy.mdx +5 -5
- package/corpus/core/docs/content/locales/zh-TW/notifications.mdx +18 -10
- package/corpus/core/docs/content/locales/zh-TW/processors.mdx +11 -5
- package/corpus/core/docs/content/locales/zh-TW/server.mdx +16 -10
- package/corpus/core/docs/content/locales/zh-TW/sharing.mdx +10 -10
- package/corpus/core/docs/content/locales/zh-TW/skills-guide.mdx +34 -17
- package/corpus/core/docs/content/locales/zh-TW/template-assets.mdx +16 -13
- package/corpus/core/docs/content/locales/zh-TW/template-brain.mdx +3 -1
- package/corpus/core/docs/content/locales/zh-TW/template-clips.mdx +3 -4
- package/corpus/core/docs/content/locales/zh-TW/template-design.mdx +3 -1
- package/corpus/core/docs/content/locales/zh-TW/template-dispatch.mdx +5 -1
- package/corpus/core/docs/content/locales/zh-TW/template-mail.mdx +8 -0
- package/corpus/core/docs/content/locales/zh-TW/tracking.mdx +9 -6
- package/corpus/core/docs/content/locales/zh-TW/using-your-agent.mdx +0 -7
- package/corpus/core/docs/content/locales/zh-TW/voice-input.mdx +6 -0
- package/corpus/core/docs/content/locales/zh-TW/workspace-connections.mdx +9 -2
- package/corpus/core/docs/content/locales/zh-TW/workspace.mdx +19 -18
- package/corpus/core/docs/content/mcp-apps.mdx +14 -32
- package/corpus/core/docs/content/mcp-clients.mdx +48 -54
- package/corpus/core/docs/content/mcp-protocol.mdx +25 -10
- package/corpus/core/docs/content/messaging.mdx +19 -11
- package/corpus/core/docs/content/multi-app-workspace.mdx +11 -96
- package/corpus/core/docs/content/multi-tenancy.mdx +5 -5
- package/corpus/core/docs/content/native-chat-ui.mdx +4 -4
- package/corpus/core/docs/content/notifications.mdx +19 -12
- package/corpus/core/docs/content/observability.mdx +2 -4
- package/corpus/core/docs/content/observational-memory.mdx +7 -3
- package/corpus/core/docs/content/onboarding.mdx +9 -2
- package/corpus/core/docs/content/plan-plugin.mdx +10 -2
- package/corpus/core/docs/content/pr-visual-recap.mdx +1 -1
- package/corpus/core/docs/content/processors.mdx +11 -5
- package/corpus/core/docs/content/pure-agent-apps.mdx +5 -1
- package/corpus/core/docs/content/real-time-collaboration.mdx +30 -67
- package/corpus/core/docs/content/recurring-jobs.mdx +8 -6
- package/corpus/core/docs/content/routing.mdx +3 -4
- package/corpus/core/docs/content/sandbox-adapters.mdx +30 -53
- package/corpus/core/docs/content/security.mdx +8 -0
- package/corpus/core/docs/content/server.mdx +17 -10
- package/corpus/core/docs/content/sharing.mdx +10 -10
- package/corpus/core/docs/content/skills-guide.mdx +35 -16
- package/corpus/core/docs/content/template-analytics.mdx +11 -8
- package/corpus/core/docs/content/template-assets.mdx +16 -13
- package/corpus/core/docs/content/template-brain.mdx +3 -1
- package/corpus/core/docs/content/template-calendar.mdx +12 -4
- package/corpus/core/docs/content/template-chat.mdx +4 -4
- package/corpus/core/docs/content/template-clips.mdx +3 -3
- package/corpus/core/docs/content/template-content.mdx +23 -18
- package/corpus/core/docs/content/template-design.mdx +3 -1
- package/corpus/core/docs/content/template-dispatch.mdx +5 -1
- package/corpus/core/docs/content/template-mail.mdx +14 -2
- package/corpus/core/docs/content/template-plan.mdx +22 -15
- package/corpus/core/docs/content/template-slides.mdx +11 -3
- package/corpus/core/docs/content/toolkit-agent-ux.mdx +46 -3
- package/corpus/core/docs/content/toolkit-collaboration.mdx +58 -4
- package/corpus/core/docs/content/toolkit-command-navigation.mdx +8 -2
- package/corpus/core/docs/content/toolkit-comments-review.mdx +10 -2
- package/corpus/core/docs/content/toolkit-history.mdx +8 -3
- package/corpus/core/docs/content/toolkit-observability.mdx +48 -2
- package/corpus/core/docs/content/toolkit-org-team.mdx +8 -2
- package/corpus/core/docs/content/toolkit-resources.mdx +45 -2
- package/corpus/core/docs/content/toolkit-settings.mdx +8 -2
- package/corpus/core/docs/content/toolkit-setup-connections.mdx +7 -2
- package/corpus/core/docs/content/toolkit-sharing.mdx +46 -3
- package/corpus/core/docs/content/toolkit-ui.mdx +82 -11
- package/corpus/core/docs/content/tracking.mdx +10 -8
- package/corpus/core/docs/content/using-your-agent.mdx +0 -12
- package/corpus/core/docs/content/voice-input.mdx +7 -1
- package/corpus/core/docs/content/what-is-agent-native.mdx +7 -8
- package/corpus/core/docs/content/workspace-connections.mdx +16 -23
- package/corpus/core/docs/content/workspace-management.mdx +16 -4
- package/corpus/core/docs/content/workspace.mdx +19 -18
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/context-xray/tokenize.ts +6 -1
- package/corpus/core/src/agent/engine/ai-sdk-engine.ts +9 -5
- package/corpus/core/src/agent/engine/anthropic-engine.ts +2 -4
- package/corpus/core/src/agent/engine/builder-engine.ts +5 -7
- package/corpus/core/src/agent/engine/index.ts +1 -0
- package/corpus/core/src/agent/engine/registry.ts +40 -0
- package/corpus/core/src/agent/harness/ai-sdk-adapter.ts +6 -1
- package/corpus/core/src/agent/harness/background.ts +96 -19
- package/corpus/core/src/agent/harness/index.ts +11 -0
- package/corpus/core/src/agent/harness/lifecycle.ts +498 -0
- package/corpus/core/src/agent/harness/runner.ts +38 -0
- package/corpus/core/src/agent/harness/store.ts +22 -3
- package/corpus/core/src/agent/model-config.ts +4 -1
- package/corpus/core/src/agent/production-agent.ts +190 -6
- package/corpus/core/src/agent/run-manager.ts +5 -1
- package/corpus/core/src/application-state/index.ts +1 -0
- package/corpus/core/src/application-state/store.ts +32 -0
- package/corpus/core/src/cli/code-agent-connector.ts +263 -8
- package/corpus/core/src/cli/code-agent-executor.ts +15 -1
- package/corpus/core/src/client/AgentPanel.tsx +41 -38
- package/corpus/core/src/client/AssistantChat.tsx +98 -6
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +33 -40
- package/corpus/core/src/client/appearance.ts +8 -5
- package/corpus/core/src/client/chat/connectors.ts +293 -29
- package/corpus/core/src/client/chat/message-components.tsx +23 -1
- package/corpus/core/src/client/chat/runtime.ts +126 -25
- package/corpus/core/src/client/chat/tool-call-display.tsx +45 -4
- package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +294 -0
- package/corpus/core/src/client/composer/TiptapComposer.tsx +21 -20
- package/corpus/core/src/client/composer/VoiceButton.tsx +20 -0
- package/corpus/core/src/client/composer/index.ts +22 -0
- package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +640 -0
- package/corpus/core/src/client/guided-questions.tsx +12 -3
- package/corpus/core/src/client/index.ts +18 -0
- package/corpus/core/src/client/settings/DemoModeSection.tsx +4 -3
- package/corpus/core/src/client/settings/SettingsPanel.tsx +4 -0
- package/corpus/core/src/client/settings/SettingsTabsPage.tsx +95 -37
- package/corpus/core/src/client/use-chat-models.ts +17 -17
- package/corpus/core/src/client/use-db-sync.ts +108 -7
- package/corpus/core/src/code-agents/background-controller.ts +18 -0
- package/corpus/core/src/collab/ydoc-manager.ts +41 -6
- package/corpus/core/src/db/migrations.ts +17 -1
- package/corpus/core/src/demo/fetch-interceptor.ts +16 -11
- package/corpus/core/src/integrations/adapters/slack.ts +41 -2
- package/corpus/core/src/integrations/awaiting-input-store.ts +130 -0
- package/corpus/core/src/integrations/computer-supervision-store.ts +423 -0
- package/corpus/core/src/integrations/computer-supervision.ts +213 -0
- package/corpus/core/src/integrations/index.ts +29 -1
- package/corpus/core/src/integrations/plugin.ts +231 -2
- package/corpus/core/src/integrations/remote-commands-store.ts +334 -3
- package/corpus/core/src/integrations/remote-devices-store.ts +68 -9
- package/corpus/core/src/integrations/remote-json-safety.ts +127 -0
- package/corpus/core/src/integrations/remote-run-events-store.ts +104 -19
- package/corpus/core/src/integrations/remote-types.ts +66 -3
- package/corpus/core/src/integrations/webhook-handler.ts +161 -2
- package/corpus/core/src/localization/default-messages.ts +28 -0
- package/corpus/core/src/mcp-client/config.ts +48 -2
- package/corpus/core/src/mcp-client/index.ts +35 -2
- package/corpus/core/src/mcp-client/tool-policy.ts +182 -0
- package/corpus/core/src/secrets/register-framework-secrets.ts +27 -4
- package/corpus/core/src/server/agent-chat-plugin.ts +62 -8
- package/corpus/core/src/server/index.ts +16 -0
- package/corpus/core/src/server/realtime-voice.ts +590 -0
- package/corpus/core/src/shared/reasoning-effort.ts +61 -19
- package/corpus/core/src/styles/agent-conversation.css +17 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -5
- package/corpus/templates/brain/app/lib/settings-navigation.ts +22 -0
- package/corpus/templates/brain/app/routes/settings.tsx +367 -252
- package/corpus/templates/brain/changelog/2026-07-10-brain-settings-now-separate-assistant-behavior-publishing-re.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-10-organization-settings-now-opens-directly-from-the-workspace-.md +6 -0
- package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +36 -4
- package/corpus/templates/calendar/AGENTS.md +4 -0
- package/corpus/templates/calendar/actions/create-event.ts +7 -19
- package/corpus/templates/calendar/actions/delete-event.ts +10 -3
- package/corpus/templates/calendar/actions/rsvp-event.ts +1 -1
- package/corpus/templates/calendar/actions/update-event.ts +4 -3
- package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +100 -13
- package/corpus/templates/calendar/app/components/calendar/DayView.tsx +12 -4
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +3 -3
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +86 -8
- package/corpus/templates/calendar/app/components/calendar/EventDialog.tsx +3 -1
- package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +12 -4
- package/corpus/templates/calendar/app/hooks/use-events.ts +1 -0
- package/corpus/templates/calendar/app/lib/event-account-selection.ts +36 -0
- package/corpus/templates/calendar/app/lib/event-form-initialization.ts +21 -0
- package/corpus/templates/calendar/app/lib/event-mutation-inputs.ts +18 -0
- package/corpus/templates/calendar/app/pages/CalendarView.tsx +119 -26
- package/corpus/templates/calendar/changelog/2026-07-10-choose-which-connected-google-account-receives-a-new-event-w.md +6 -0
- package/corpus/templates/calendar/server/db/schema.ts +2 -0
- package/corpus/templates/calendar/server/handlers/bookings.ts +43 -6
- package/corpus/templates/calendar/server/handlers/events.ts +28 -9
- package/corpus/templates/calendar/server/lib/google-calendar.ts +66 -38
- package/corpus/templates/calendar/server/plugins/db.ts +5 -0
- package/corpus/templates/clips/.agents/skills/ai-video-tools/SKILL.md +12 -3
- package/corpus/templates/clips/.agents/skills/meetings/SKILL.md +1 -1
- package/corpus/templates/clips/AGENTS.md +4 -2
- package/corpus/templates/clips/actions/regenerate-title.ts +53 -7
- package/corpus/templates/clips/actions/request-transcript.ts +152 -41
- package/corpus/templates/clips/actions/save-browser-transcript.ts +11 -9
- package/corpus/templates/clips/app/components/player/comments-panel.tsx +101 -53
- package/corpus/templates/clips/app/components/player/playback-comment-overlay.tsx +102 -0
- package/corpus/templates/clips/app/components/player/video-player.tsx +10 -1
- package/corpus/templates/clips/app/hooks/use-auto-title.ts +14 -0
- package/corpus/templates/clips/app/routes/embed.$shareId.tsx +2 -0
- package/corpus/templates/clips/changelog/2026-07-10-comment-replies-now-open-inline-and-focus-immediately-while-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-dismissed-upload-warnings-now-keep-recordings-in-clip-drafts.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-dragging-the-meeting-recorder-no-longer-opens-the-expanded.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-finishing-meeting-notes-no-longer-opens-your-browser.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-meeting-recordings-now-keep-microphone-audio-and-recover-tra.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-recording-pause-and-resume-controls-now-respond-reliably-on-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-starting-and-joining-a-meeting-now-closes-the-desktop-popover.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-timestamped-comments-now-appear-over-the-video-as-playback-r.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-transcript-backed-titles-and-summaries-now-finish-after-recording.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-zoom-meetings-now-open-directly-in-the-desktop-app.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/overlay.ts +49 -7
- package/corpus/templates/clips/desktop/src/app.tsx +70 -42
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +8 -14
- package/corpus/templates/clips/desktop/src/lib/meeting-join-url.ts +33 -0
- package/corpus/templates/clips/desktop/src/lib/pause-transition.ts +79 -0
- package/corpus/templates/clips/desktop/src/lib/pill-interaction.ts +19 -0
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +90 -39
- package/corpus/templates/clips/desktop/src/lib/transcription-engine.ts +3 -2
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +3 -2
- package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +32 -6
- package/corpus/templates/clips/desktop/src/overlays/toolbar.tsx +50 -5
- package/corpus/templates/clips/desktop/src/styles.css +11 -19
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +2 -1
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +121 -4
- package/corpus/templates/clips/desktop/src-tauri/src/native_speech.rs +97 -17
- package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +80 -5
- package/corpus/templates/clips/desktop/src-tauri/tauri.conf.json +1 -1
- package/corpus/templates/clips/vitest.config.ts +23 -0
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +28 -9
- package/corpus/templates/content/changelog/2026-07-10-open-documents-no-longer-make-constant-background-requests-w.md +6 -0
- package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +21 -4
- package/corpus/templates/design/AGENTS.md +7 -0
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +132 -7
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +73 -18
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +6 -1
- package/corpus/templates/design/app/components/design/multi-screen/frame-geometry.ts +135 -5
- package/corpus/templates/design/app/lib/clipboard-content-lineage.ts +64 -0
- package/corpus/templates/design/app/lib/design-clipboard-managed-styles.ts +247 -0
- package/corpus/templates/design/app/lib/design-clipboard.ts +60 -3
- package/corpus/templates/design/app/lib/design-import.ts +31 -3
- package/corpus/templates/design/app/pages/design-editor/latest-write-queue.ts +56 -0
- package/corpus/templates/design/app/pages/design-editor/performance-buffer-guard.ts +80 -0
- package/corpus/templates/design/changelog/2026-07-10-concurrent-agent-and-artboard-edits-no-longer-show-misleadin.md +6 -0
- package/corpus/templates/design/changelog/2026-07-10-designs-with-html-examples-inside-alpine-attributes-or-comme.md +6 -0
- package/corpus/templates/design/changelog/2026-07-10-interactive-designs-no-longer-appear-blank-in-the-canvas-whe.md +6 -0
- package/corpus/templates/design/changelog/2026-07-10-long-overview-editing-sessions-lots-of-pan-zoom-screen-switc.md +6 -0
- package/corpus/templates/design/changelog/2026-07-10-rapid-breakpoint-and-edit-scope-changes-no-longer-jump-back-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-10-responsive-breakpoint-previews-stay-visible-while-panning-ac.md +6 -0
- package/corpus/templates/design/changelog/2026-07-10-rich-design-clipboard-markers-are-now-accepted-only-from-the.md +6 -0
- package/corpus/templates/design/e2e/helpers.ts +16 -5
- package/corpus/templates/design/server/source-workspace.ts +28 -2
- package/corpus/templates/design/shared/html-integrity.ts +119 -24
- package/corpus/templates/dispatch/AGENTS.md +10 -2
- package/corpus/templates/dispatch/actions/view-screen.ts +11 -0
- package/corpus/templates/dispatch/app/hooks/use-navigation-state.ts +13 -0
- package/corpus/templates/dispatch/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/dispatch/app/i18n-data.ts +37 -1
- package/corpus/templates/dispatch/app/routes/operations.tsx +1 -0
- package/corpus/templates/dispatch/changelog/2026-07-10-dispatch-now-has-a-cleaner-chat-history-and-quieter-sidebar-.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-10-operations-console-brings-agent-monitoring-and-database-inspection-tog.md +6 -0
- package/corpus/templates/mail/actions/get-integration-statuses.ts +36 -0
- package/corpus/templates/mail/app/components/email/EmailThread.tsx +3 -2
- package/corpus/templates/mail/app/components/email/IntegrationsSidebar.tsx +3 -3
- package/corpus/templates/mail/app/hooks/use-apollo.ts +5 -71
- package/corpus/templates/mail/app/hooks/use-draft-queue.ts +1 -1
- package/corpus/templates/mail/app/hooks/use-integrations.ts +51 -48
- package/corpus/templates/mail/app/lib/integration-status.ts +31 -0
- package/corpus/templates/mail/app/lib/sync-invalidation.ts +5 -0
- package/corpus/templates/mail/app/pages/SettingsPage.tsx +3 -0
- package/corpus/templates/mail/app/root.tsx +22 -12
- package/corpus/templates/mail/changelog/2026-07-10-email-content-backgrounds-now-blend-cleanly-with-dark-mode.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-10-mail-settings-now-group-drafting-automation-and-connected-se.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-10-organization-settings-now-opens-directly-from-the-workspace-.md +6 -0
- package/dist/agent/context-xray/tokenize.d.ts.map +1 -1
- package/dist/agent/context-xray/tokenize.js +6 -1
- package/dist/agent/context-xray/tokenize.js.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.js +8 -3
- 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 +2 -4
- package/dist/agent/engine/anthropic-engine.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.js +2 -3
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/engine/index.d.ts +1 -1
- package/dist/agent/engine/index.d.ts.map +1 -1
- package/dist/agent/engine/index.js +1 -1
- package/dist/agent/engine/index.js.map +1 -1
- package/dist/agent/engine/registry.d.ts +13 -0
- package/dist/agent/engine/registry.d.ts.map +1 -1
- package/dist/agent/engine/registry.js +33 -0
- package/dist/agent/engine/registry.js.map +1 -1
- package/dist/agent/harness/ai-sdk-adapter.d.ts.map +1 -1
- package/dist/agent/harness/ai-sdk-adapter.js +3 -1
- package/dist/agent/harness/ai-sdk-adapter.js.map +1 -1
- package/dist/agent/harness/background.d.ts +9 -9
- package/dist/agent/harness/background.d.ts.map +1 -1
- package/dist/agent/harness/background.js +77 -19
- package/dist/agent/harness/background.js.map +1 -1
- package/dist/agent/harness/index.d.ts +1 -0
- package/dist/agent/harness/index.d.ts.map +1 -1
- package/dist/agent/harness/index.js +1 -0
- package/dist/agent/harness/index.js.map +1 -1
- package/dist/agent/harness/lifecycle.d.ts +45 -0
- package/dist/agent/harness/lifecycle.d.ts.map +1 -0
- package/dist/agent/harness/lifecycle.js +318 -0
- package/dist/agent/harness/lifecycle.js.map +1 -0
- package/dist/agent/harness/runner.d.ts.map +1 -1
- package/dist/agent/harness/runner.js +29 -1
- package/dist/agent/harness/runner.js.map +1 -1
- package/dist/agent/harness/store.d.ts +2 -0
- package/dist/agent/harness/store.d.ts.map +1 -1
- package/dist/agent/harness/store.js +17 -3
- package/dist/agent/harness/store.js.map +1 -1
- package/dist/agent/model-config.d.ts +2 -2
- package/dist/agent/model-config.d.ts.map +1 -1
- package/dist/agent/model-config.js +4 -1
- package/dist/agent/model-config.js.map +1 -1
- package/dist/agent/production-agent.d.ts +38 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +135 -4
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/application-state/index.d.ts +1 -1
- package/dist/application-state/index.d.ts.map +1 -1
- package/dist/application-state/index.js +1 -1
- package/dist/application-state/index.js.map +1 -1
- package/dist/application-state/store.d.ts +6 -0
- package/dist/application-state/store.d.ts.map +1 -1
- package/dist/application-state/store.js +31 -0
- package/dist/application-state/store.js.map +1 -1
- package/dist/cli/code-agent-connector.d.ts +9 -0
- package/dist/cli/code-agent-connector.d.ts.map +1 -1
- package/dist/cli/code-agent-connector.js +212 -10
- package/dist/cli/code-agent-connector.js.map +1 -1
- package/dist/cli/code-agent-executor.d.ts +2 -0
- package/dist/cli/code-agent-executor.d.ts.map +1 -1
- package/dist/cli/code-agent-executor.js +8 -1
- package/dist/cli/code-agent-executor.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +6 -5
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +12 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +71 -5
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +16 -37
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/appearance.d.ts +4 -2
- package/dist/client/appearance.d.ts.map +1 -1
- package/dist/client/appearance.js +8 -5
- package/dist/client/appearance.js.map +1 -1
- package/dist/client/chat/connectors.d.ts.map +1 -1
- package/dist/client/chat/connectors.js +206 -28
- package/dist/client/chat/connectors.js.map +1 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +17 -1
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/runtime.d.ts.map +1 -1
- package/dist/client/chat/runtime.js +84 -24
- package/dist/client/chat/runtime.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +8 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +21 -3
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts +54 -0
- package/dist/client/composer/RealtimeVoiceMode.d.ts.map +1 -0
- package/dist/client/composer/RealtimeVoiceMode.js +63 -0
- package/dist/client/composer/RealtimeVoiceMode.js.map +1 -0
- package/dist/client/composer/TiptapComposer.d.ts +1 -0
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +17 -20
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/VoiceButton.d.ts.map +1 -1
- package/dist/client/composer/VoiceButton.js +9 -0
- package/dist/client/composer/VoiceButton.js.map +1 -1
- package/dist/client/composer/index.d.ts +2 -0
- package/dist/client/composer/index.d.ts.map +1 -1
- package/dist/client/composer/index.js +2 -0
- package/dist/client/composer/index.js.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.d.ts +56 -0
- package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +1 -0
- package/dist/client/composer/useRealtimeVoiceMode.js +492 -0
- package/dist/client/composer/useRealtimeVoiceMode.js.map +1 -0
- package/dist/client/guided-questions.d.ts.map +1 -1
- package/dist/client/guided-questions.js +7 -2
- package/dist/client/guided-questions.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/settings/DemoModeSection.d.ts.map +1 -1
- package/dist/client/settings/DemoModeSection.js +4 -3
- package/dist/client/settings/DemoModeSection.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +4 -0
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/SettingsTabsPage.d.ts +10 -3
- package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
- package/dist/client/settings/SettingsTabsPage.js +49 -11
- package/dist/client/settings/SettingsTabsPage.js.map +1 -1
- package/dist/client/use-chat-models.d.ts.map +1 -1
- package/dist/client/use-chat-models.js +6 -14
- package/dist/client/use-chat-models.js.map +1 -1
- package/dist/client/use-db-sync.d.ts.map +1 -1
- package/dist/client/use-db-sync.js +87 -7
- package/dist/client/use-db-sync.js.map +1 -1
- package/dist/code-agents/background-controller.d.ts +1 -1
- package/dist/code-agents/background-controller.d.ts.map +1 -1
- package/dist/code-agents/background-controller.js +17 -1
- package/dist/code-agents/background-controller.js.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/collab/ydoc-manager.d.ts +9 -1
- package/dist/collab/ydoc-manager.d.ts.map +1 -1
- package/dist/collab/ydoc-manager.js +30 -6
- package/dist/collab/ydoc-manager.js.map +1 -1
- package/dist/db/migrations.d.ts.map +1 -1
- package/dist/db/migrations.js +4 -2
- package/dist/db/migrations.js.map +1 -1
- package/dist/demo/fetch-interceptor.d.ts +5 -1
- package/dist/demo/fetch-interceptor.d.ts.map +1 -1
- package/dist/demo/fetch-interceptor.js +16 -12
- package/dist/demo/fetch-interceptor.js.map +1 -1
- package/dist/integrations/adapters/slack.d.ts +2 -0
- package/dist/integrations/adapters/slack.d.ts.map +1 -1
- package/dist/integrations/adapters/slack.js +38 -2
- package/dist/integrations/adapters/slack.js.map +1 -1
- package/dist/integrations/awaiting-input-store.d.ts +27 -0
- package/dist/integrations/awaiting-input-store.d.ts.map +1 -0
- package/dist/integrations/awaiting-input-store.js +112 -0
- package/dist/integrations/awaiting-input-store.js.map +1 -0
- package/dist/integrations/computer-supervision-store.d.ts +65 -0
- package/dist/integrations/computer-supervision-store.d.ts.map +1 -0
- package/dist/integrations/computer-supervision-store.js +296 -0
- package/dist/integrations/computer-supervision-store.js.map +1 -0
- package/dist/integrations/computer-supervision.d.ts +11 -0
- package/dist/integrations/computer-supervision.d.ts.map +1 -0
- package/dist/integrations/computer-supervision.js +160 -0
- package/dist/integrations/computer-supervision.js.map +1 -0
- package/dist/integrations/index.d.ts +6 -3
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +5 -2
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +205 -3
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/integrations/remote-commands-store.d.ts +15 -1
- package/dist/integrations/remote-commands-store.d.ts.map +1 -1
- package/dist/integrations/remote-commands-store.js +273 -3
- package/dist/integrations/remote-commands-store.js.map +1 -1
- package/dist/integrations/remote-devices-store.d.ts +4 -3
- package/dist/integrations/remote-devices-store.d.ts.map +1 -1
- package/dist/integrations/remote-devices-store.js +49 -2
- package/dist/integrations/remote-devices-store.js.map +1 -1
- package/dist/integrations/remote-json-safety.d.ts +6 -0
- package/dist/integrations/remote-json-safety.d.ts.map +1 -0
- package/dist/integrations/remote-json-safety.js +114 -0
- package/dist/integrations/remote-json-safety.js.map +1 -0
- package/dist/integrations/remote-run-events-store.d.ts +11 -1
- package/dist/integrations/remote-run-events-store.d.ts.map +1 -1
- package/dist/integrations/remote-run-events-store.js +85 -17
- package/dist/integrations/remote-run-events-store.js.map +1 -1
- package/dist/integrations/remote-types.d.ts +54 -3
- package/dist/integrations/remote-types.d.ts.map +1 -1
- package/dist/integrations/remote-types.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +133 -4
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/localization/default-messages.d.ts +26 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +26 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp-client/config.d.ts.map +1 -1
- package/dist/mcp-client/config.js +44 -3
- package/dist/mcp-client/config.js.map +1 -1
- package/dist/mcp-client/index.d.ts +6 -1
- package/dist/mcp-client/index.d.ts.map +1 -1
- package/dist/mcp-client/index.js +11 -3
- package/dist/mcp-client/index.js.map +1 -1
- package/dist/mcp-client/tool-policy.d.ts +24 -0
- package/dist/mcp-client/tool-policy.d.ts.map +1 -0
- package/dist/mcp-client/tool-policy.js +139 -0
- package/dist/mcp-client/tool-policy.js.map +1 -0
- package/dist/observability/routes.d.ts +5 -5
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/register-framework-secrets.d.ts +3 -4
- package/dist/secrets/register-framework-secrets.d.ts.map +1 -1
- package/dist/secrets/register-framework-secrets.js +25 -4
- package/dist/secrets/register-framework-secrets.js.map +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +53 -6
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/index.d.ts +2 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +2 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/realtime-voice.d.ts +53 -0
- package/dist/server/realtime-voice.d.ts.map +1 -0
- package/dist/server/realtime-voice.js +404 -0
- package/dist/server/realtime-voice.js.map +1 -0
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/reasoning-effort.d.ts +20 -0
- package/dist/shared/reasoning-effort.d.ts.map +1 -1
- package/dist/shared/reasoning-effort.js +52 -18
- package/dist/shared/reasoning-effort.js.map +1 -1
- package/dist/styles/agent-conversation.css +17 -0
- package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -5
- package/docs/content/a2a-protocol.mdx +21 -5
- package/docs/content/actions.mdx +9 -23
- package/docs/content/agent-mentions.mdx +31 -29
- package/docs/content/agent-native-toolkit.mdx +15 -6
- package/docs/content/agent-surfaces.mdx +9 -13
- package/docs/content/agent-teams.mdx +1 -0
- package/docs/content/authentication.mdx +10 -3
- package/docs/content/automation-connectors.mdx +82 -39
- package/docs/content/automations.mdx +17 -3
- package/docs/content/blueprint-installer.mdx +11 -4
- package/docs/content/cli-adapters.mdx +9 -6
- package/docs/content/client.mdx +16 -0
- package/docs/content/cloneable-saas.mdx +14 -11
- package/docs/content/code-agents-ui.mdx +65 -0
- package/docs/content/components.mdx +30 -14
- package/docs/content/context-awareness.mdx +27 -15
- package/docs/content/creating-templates.mdx +15 -9
- package/docs/content/cross-app-sso.mdx +16 -6
- package/docs/content/data-programs.mdx +1 -1
- package/docs/content/database.mdx +17 -5
- package/docs/content/deployment.mdx +19 -18
- package/docs/content/dispatch.mdx +6 -2
- package/docs/content/drop-in-agent.mdx +10 -4
- package/docs/content/durable-background-runs.mdx +9 -5
- package/docs/content/durable-resume.mdx +9 -4
- package/docs/content/embedding-sdk.mdx +26 -8
- package/docs/content/evals.mdx +3 -5
- package/docs/content/extensions.mdx +22 -9
- package/docs/content/external-agents.mdx +25 -34
- package/docs/content/faq.mdx +8 -0
- package/docs/content/file-uploads.mdx +12 -3
- package/docs/content/frames.mdx +16 -0
- package/docs/content/generative-ui.mdx +1 -1
- package/docs/content/getting-started.mdx +34 -21
- package/docs/content/harness-agents.mdx +8 -4
- package/docs/content/human-approval.mdx +8 -3
- package/docs/content/internationalization.mdx +9 -4
- package/docs/content/key-concepts.mdx +13 -20
- package/docs/content/local-file-mode.mdx +14 -8
- package/docs/content/locales/ar-SA/actions.mdx +2 -2
- package/docs/content/locales/ar-SA/agent-native-toolkit.mdx +2 -2
- package/docs/content/locales/ar-SA/agent-surfaces.mdx +8 -10
- package/docs/content/locales/ar-SA/agent-teams.mdx +1 -0
- package/docs/content/locales/ar-SA/authentication.mdx +1 -1
- package/docs/content/locales/ar-SA/components.mdx +11 -1
- package/docs/content/locales/ar-SA/creating-templates.mdx +3 -7
- package/docs/content/locales/ar-SA/cross-app-sso.mdx +16 -6
- package/docs/content/locales/ar-SA/deployment.mdx +8 -0
- package/docs/content/locales/ar-SA/external-agents.mdx +2 -7
- package/docs/content/locales/ar-SA/key-concepts.mdx +13 -20
- package/docs/content/locales/ar-SA/multi-tenancy.mdx +5 -5
- package/docs/content/locales/ar-SA/notifications.mdx +18 -10
- package/docs/content/locales/ar-SA/processors.mdx +11 -5
- package/docs/content/locales/ar-SA/server.mdx +17 -10
- package/docs/content/locales/ar-SA/sharing.mdx +10 -10
- package/docs/content/locales/ar-SA/skills-guide.mdx +34 -17
- package/docs/content/locales/ar-SA/template-assets.mdx +16 -13
- package/docs/content/locales/ar-SA/template-brain.mdx +3 -1
- package/docs/content/locales/ar-SA/template-clips.mdx +3 -3
- package/docs/content/locales/ar-SA/template-design.mdx +3 -1
- package/docs/content/locales/ar-SA/template-dispatch.mdx +5 -1
- package/docs/content/locales/ar-SA/template-mail.mdx +8 -0
- package/docs/content/locales/ar-SA/tracking.mdx +9 -6
- package/docs/content/locales/ar-SA/using-your-agent.mdx +0 -7
- package/docs/content/locales/ar-SA/voice-input.mdx +6 -0
- package/docs/content/locales/ar-SA/workspace-connections.mdx +9 -2
- package/docs/content/locales/ar-SA/workspace.mdx +19 -18
- package/docs/content/locales/de-DE/actions.mdx +2 -2
- package/docs/content/locales/de-DE/agent-native-toolkit.mdx +2 -2
- package/docs/content/locales/de-DE/agent-surfaces.mdx +8 -10
- package/docs/content/locales/de-DE/agent-teams.mdx +1 -0
- package/docs/content/locales/de-DE/authentication.mdx +1 -1
- package/docs/content/locales/de-DE/components.mdx +11 -1
- package/docs/content/locales/de-DE/creating-templates.mdx +3 -7
- package/docs/content/locales/de-DE/cross-app-sso.mdx +16 -6
- package/docs/content/locales/de-DE/deployment.mdx +8 -0
- package/docs/content/locales/de-DE/external-agents.mdx +3 -7
- package/docs/content/locales/de-DE/key-concepts.mdx +13 -20
- package/docs/content/locales/de-DE/multi-tenancy.mdx +5 -5
- package/docs/content/locales/de-DE/notifications.mdx +18 -10
- package/docs/content/locales/de-DE/processors.mdx +11 -5
- package/docs/content/locales/de-DE/server.mdx +18 -10
- package/docs/content/locales/de-DE/sharing.mdx +10 -10
- package/docs/content/locales/de-DE/skills-guide.mdx +34 -17
- package/docs/content/locales/de-DE/template-assets.mdx +16 -13
- package/docs/content/locales/de-DE/template-brain.mdx +3 -1
- package/docs/content/locales/de-DE/template-clips.mdx +3 -3
- package/docs/content/locales/de-DE/template-design.mdx +3 -1
- package/docs/content/locales/de-DE/template-dispatch.mdx +5 -1
- package/docs/content/locales/de-DE/template-mail.mdx +8 -0
- package/docs/content/locales/de-DE/tracking.mdx +9 -6
- package/docs/content/locales/de-DE/using-your-agent.mdx +0 -7
- package/docs/content/locales/de-DE/voice-input.mdx +6 -0
- package/docs/content/locales/de-DE/workspace-connections.mdx +9 -2
- package/docs/content/locales/de-DE/workspace.mdx +19 -18
- package/docs/content/locales/es-ES/actions.mdx +2 -2
- package/docs/content/locales/es-ES/agent-native-toolkit.mdx +2 -2
- package/docs/content/locales/es-ES/agent-surfaces.mdx +8 -10
- package/docs/content/locales/es-ES/agent-teams.mdx +1 -0
- package/docs/content/locales/es-ES/authentication.mdx +1 -1
- package/docs/content/locales/es-ES/components.mdx +11 -1
- package/docs/content/locales/es-ES/creating-templates.mdx +3 -7
- package/docs/content/locales/es-ES/cross-app-sso.mdx +16 -6
- package/docs/content/locales/es-ES/deployment.mdx +8 -0
- package/docs/content/locales/es-ES/external-agents.mdx +3 -7
- package/docs/content/locales/es-ES/key-concepts.mdx +13 -20
- package/docs/content/locales/es-ES/multi-tenancy.mdx +5 -5
- package/docs/content/locales/es-ES/notifications.mdx +18 -10
- package/docs/content/locales/es-ES/processors.mdx +11 -5
- package/docs/content/locales/es-ES/server.mdx +17 -10
- package/docs/content/locales/es-ES/sharing.mdx +10 -10
- package/docs/content/locales/es-ES/skills-guide.mdx +34 -17
- package/docs/content/locales/es-ES/template-assets.mdx +16 -13
- package/docs/content/locales/es-ES/template-brain.mdx +3 -1
- package/docs/content/locales/es-ES/template-clips.mdx +3 -3
- package/docs/content/locales/es-ES/template-design.mdx +3 -1
- package/docs/content/locales/es-ES/template-dispatch.mdx +5 -1
- package/docs/content/locales/es-ES/template-mail.mdx +8 -0
- package/docs/content/locales/es-ES/tracking.mdx +9 -6
- package/docs/content/locales/es-ES/using-your-agent.mdx +0 -7
- package/docs/content/locales/es-ES/voice-input.mdx +6 -0
- package/docs/content/locales/es-ES/workspace-connections.mdx +9 -2
- package/docs/content/locales/es-ES/workspace.mdx +19 -18
- package/docs/content/locales/fr-FR/actions.mdx +2 -2
- package/docs/content/locales/fr-FR/agent-native-toolkit.mdx +2 -2
- package/docs/content/locales/fr-FR/agent-surfaces.mdx +8 -10
- package/docs/content/locales/fr-FR/agent-teams.mdx +1 -0
- package/docs/content/locales/fr-FR/authentication.mdx +1 -1
- package/docs/content/locales/fr-FR/components.mdx +11 -1
- package/docs/content/locales/fr-FR/creating-templates.mdx +3 -7
- package/docs/content/locales/fr-FR/cross-app-sso.mdx +16 -6
- package/docs/content/locales/fr-FR/deployment.mdx +8 -0
- package/docs/content/locales/fr-FR/external-agents.mdx +3 -7
- package/docs/content/locales/fr-FR/key-concepts.mdx +13 -20
- package/docs/content/locales/fr-FR/multi-tenancy.mdx +5 -5
- package/docs/content/locales/fr-FR/notifications.mdx +18 -10
- package/docs/content/locales/fr-FR/processors.mdx +11 -5
- package/docs/content/locales/fr-FR/server.mdx +17 -10
- package/docs/content/locales/fr-FR/sharing.mdx +10 -10
- package/docs/content/locales/fr-FR/skills-guide.mdx +34 -17
- package/docs/content/locales/fr-FR/template-assets.mdx +16 -13
- package/docs/content/locales/fr-FR/template-brain.mdx +3 -1
- package/docs/content/locales/fr-FR/template-clips.mdx +3 -3
- package/docs/content/locales/fr-FR/template-design.mdx +3 -1
- package/docs/content/locales/fr-FR/template-dispatch.mdx +5 -1
- package/docs/content/locales/fr-FR/template-mail.mdx +8 -0
- package/docs/content/locales/fr-FR/tracking.mdx +9 -6
- package/docs/content/locales/fr-FR/using-your-agent.mdx +0 -7
- package/docs/content/locales/fr-FR/voice-input.mdx +6 -0
- package/docs/content/locales/fr-FR/workspace-connections.mdx +9 -2
- package/docs/content/locales/fr-FR/workspace.mdx +19 -18
- package/docs/content/locales/hi-IN/actions.mdx +2 -2
- package/docs/content/locales/hi-IN/agent-native-toolkit.mdx +2 -2
- package/docs/content/locales/hi-IN/agent-surfaces.mdx +8 -10
- package/docs/content/locales/hi-IN/agent-teams.mdx +1 -0
- package/docs/content/locales/hi-IN/authentication.mdx +1 -1
- package/docs/content/locales/hi-IN/components.mdx +11 -1
- package/docs/content/locales/hi-IN/creating-templates.mdx +3 -7
- package/docs/content/locales/hi-IN/cross-app-sso.mdx +16 -6
- package/docs/content/locales/hi-IN/deployment.mdx +8 -0
- package/docs/content/locales/hi-IN/external-agents.mdx +2 -7
- package/docs/content/locales/hi-IN/key-concepts.mdx +13 -20
- package/docs/content/locales/hi-IN/multi-tenancy.mdx +5 -5
- package/docs/content/locales/hi-IN/notifications.mdx +18 -10
- package/docs/content/locales/hi-IN/processors.mdx +11 -5
- package/docs/content/locales/hi-IN/server.mdx +17 -10
- package/docs/content/locales/hi-IN/sharing.mdx +10 -10
- package/docs/content/locales/hi-IN/skills-guide.mdx +34 -17
- package/docs/content/locales/hi-IN/template-assets.mdx +16 -13
- package/docs/content/locales/hi-IN/template-brain.mdx +3 -1
- package/docs/content/locales/hi-IN/template-clips.mdx +3 -3
- package/docs/content/locales/hi-IN/template-design.mdx +3 -1
- package/docs/content/locales/hi-IN/template-dispatch.mdx +5 -1
- package/docs/content/locales/hi-IN/template-mail.mdx +8 -0
- package/docs/content/locales/hi-IN/tracking.mdx +9 -6
- package/docs/content/locales/hi-IN/using-your-agent.mdx +0 -7
- package/docs/content/locales/hi-IN/voice-input.mdx +6 -0
- package/docs/content/locales/hi-IN/workspace-connections.mdx +9 -2
- package/docs/content/locales/hi-IN/workspace.mdx +19 -18
- package/docs/content/locales/ja-JP/actions.mdx +2 -2
- package/docs/content/locales/ja-JP/agent-native-toolkit.mdx +2 -2
- package/docs/content/locales/ja-JP/agent-surfaces.mdx +8 -10
- package/docs/content/locales/ja-JP/agent-teams.mdx +1 -0
- package/docs/content/locales/ja-JP/authentication.mdx +1 -1
- package/docs/content/locales/ja-JP/components.mdx +11 -1
- package/docs/content/locales/ja-JP/creating-templates.mdx +3 -7
- package/docs/content/locales/ja-JP/cross-app-sso.mdx +16 -6
- package/docs/content/locales/ja-JP/deployment.mdx +8 -0
- package/docs/content/locales/ja-JP/external-agents.mdx +2 -7
- package/docs/content/locales/ja-JP/key-concepts.mdx +13 -20
- package/docs/content/locales/ja-JP/multi-tenancy.mdx +5 -5
- package/docs/content/locales/ja-JP/notifications.mdx +18 -10
- package/docs/content/locales/ja-JP/processors.mdx +11 -5
- package/docs/content/locales/ja-JP/server.mdx +17 -10
- package/docs/content/locales/ja-JP/sharing.mdx +10 -10
- package/docs/content/locales/ja-JP/skills-guide.mdx +34 -17
- package/docs/content/locales/ja-JP/template-assets.mdx +16 -13
- package/docs/content/locales/ja-JP/template-brain.mdx +3 -1
- package/docs/content/locales/ja-JP/template-clips.mdx +3 -4
- package/docs/content/locales/ja-JP/template-design.mdx +3 -1
- package/docs/content/locales/ja-JP/template-dispatch.mdx +5 -1
- package/docs/content/locales/ja-JP/template-mail.mdx +8 -0
- package/docs/content/locales/ja-JP/tracking.mdx +9 -6
- package/docs/content/locales/ja-JP/using-your-agent.mdx +0 -7
- package/docs/content/locales/ja-JP/voice-input.mdx +6 -0
- package/docs/content/locales/ja-JP/workspace-connections.mdx +9 -2
- package/docs/content/locales/ja-JP/workspace.mdx +19 -18
- package/docs/content/locales/ko-KR/actions.mdx +2 -2
- package/docs/content/locales/ko-KR/agent-native-toolkit.mdx +2 -2
- package/docs/content/locales/ko-KR/agent-surfaces.mdx +8 -10
- package/docs/content/locales/ko-KR/agent-teams.mdx +1 -0
- package/docs/content/locales/ko-KR/authentication.mdx +1 -1
- package/docs/content/locales/ko-KR/components.mdx +11 -1
- package/docs/content/locales/ko-KR/creating-templates.mdx +3 -7
- package/docs/content/locales/ko-KR/cross-app-sso.mdx +16 -6
- package/docs/content/locales/ko-KR/deployment.mdx +8 -0
- package/docs/content/locales/ko-KR/external-agents.mdx +2 -7
- package/docs/content/locales/ko-KR/key-concepts.mdx +13 -20
- package/docs/content/locales/ko-KR/multi-tenancy.mdx +5 -5
- package/docs/content/locales/ko-KR/notifications.mdx +18 -10
- package/docs/content/locales/ko-KR/processors.mdx +11 -5
- package/docs/content/locales/ko-KR/server.mdx +17 -10
- package/docs/content/locales/ko-KR/sharing.mdx +10 -10
- package/docs/content/locales/ko-KR/skills-guide.mdx +34 -17
- package/docs/content/locales/ko-KR/template-assets.mdx +16 -13
- package/docs/content/locales/ko-KR/template-brain.mdx +3 -1
- package/docs/content/locales/ko-KR/template-clips.mdx +3 -4
- package/docs/content/locales/ko-KR/template-design.mdx +3 -1
- package/docs/content/locales/ko-KR/template-dispatch.mdx +5 -1
- package/docs/content/locales/ko-KR/template-mail.mdx +8 -0
- package/docs/content/locales/ko-KR/tracking.mdx +9 -6
- package/docs/content/locales/ko-KR/using-your-agent.mdx +0 -7
- package/docs/content/locales/ko-KR/voice-input.mdx +6 -0
- package/docs/content/locales/ko-KR/workspace-connections.mdx +9 -2
- package/docs/content/locales/ko-KR/workspace.mdx +19 -18
- package/docs/content/locales/pt-BR/actions.mdx +2 -2
- package/docs/content/locales/pt-BR/agent-native-toolkit.mdx +2 -2
- package/docs/content/locales/pt-BR/agent-surfaces.mdx +8 -10
- package/docs/content/locales/pt-BR/agent-teams.mdx +1 -0
- package/docs/content/locales/pt-BR/authentication.mdx +1 -1
- package/docs/content/locales/pt-BR/components.mdx +11 -1
- package/docs/content/locales/pt-BR/creating-templates.mdx +3 -7
- package/docs/content/locales/pt-BR/cross-app-sso.mdx +16 -6
- package/docs/content/locales/pt-BR/deployment.mdx +8 -0
- package/docs/content/locales/pt-BR/external-agents.mdx +3 -7
- package/docs/content/locales/pt-BR/key-concepts.mdx +13 -20
- package/docs/content/locales/pt-BR/multi-tenancy.mdx +5 -5
- package/docs/content/locales/pt-BR/notifications.mdx +18 -10
- package/docs/content/locales/pt-BR/processors.mdx +11 -5
- package/docs/content/locales/pt-BR/server.mdx +17 -10
- package/docs/content/locales/pt-BR/sharing.mdx +10 -10
- package/docs/content/locales/pt-BR/skills-guide.mdx +34 -17
- package/docs/content/locales/pt-BR/template-assets.mdx +16 -13
- package/docs/content/locales/pt-BR/template-brain.mdx +3 -1
- package/docs/content/locales/pt-BR/template-clips.mdx +3 -3
- package/docs/content/locales/pt-BR/template-design.mdx +3 -1
- package/docs/content/locales/pt-BR/template-dispatch.mdx +5 -1
- package/docs/content/locales/pt-BR/template-mail.mdx +8 -0
- package/docs/content/locales/pt-BR/tracking.mdx +9 -6
- package/docs/content/locales/pt-BR/using-your-agent.mdx +0 -7
- package/docs/content/locales/pt-BR/voice-input.mdx +6 -0
- package/docs/content/locales/pt-BR/workspace-connections.mdx +9 -2
- package/docs/content/locales/pt-BR/workspace.mdx +19 -18
- package/docs/content/locales/zh-CN/actions.mdx +2 -2
- package/docs/content/locales/zh-CN/agent-native-toolkit.mdx +2 -2
- package/docs/content/locales/zh-CN/agent-surfaces.mdx +8 -10
- package/docs/content/locales/zh-CN/agent-teams.mdx +1 -0
- package/docs/content/locales/zh-CN/authentication.mdx +1 -1
- package/docs/content/locales/zh-CN/components.mdx +11 -1
- package/docs/content/locales/zh-CN/creating-templates.mdx +3 -7
- package/docs/content/locales/zh-CN/cross-app-sso.mdx +16 -6
- package/docs/content/locales/zh-CN/deployment.mdx +8 -0
- package/docs/content/locales/zh-CN/external-agents.mdx +2 -7
- package/docs/content/locales/zh-CN/key-concepts.mdx +13 -20
- package/docs/content/locales/zh-CN/multi-tenancy.mdx +5 -5
- package/docs/content/locales/zh-CN/notifications.mdx +18 -10
- package/docs/content/locales/zh-CN/processors.mdx +11 -5
- package/docs/content/locales/zh-CN/server.mdx +16 -10
- package/docs/content/locales/zh-CN/sharing.mdx +10 -10
- package/docs/content/locales/zh-CN/skills-guide.mdx +34 -17
- package/docs/content/locales/zh-CN/template-assets.mdx +16 -13
- package/docs/content/locales/zh-CN/template-brain.mdx +3 -1
- package/docs/content/locales/zh-CN/template-clips.mdx +3 -4
- package/docs/content/locales/zh-CN/template-design.mdx +3 -1
- package/docs/content/locales/zh-CN/template-dispatch.mdx +5 -1
- package/docs/content/locales/zh-CN/template-mail.mdx +8 -0
- package/docs/content/locales/zh-CN/tracking.mdx +9 -6
- package/docs/content/locales/zh-CN/using-your-agent.mdx +0 -7
- package/docs/content/locales/zh-CN/voice-input.mdx +6 -0
- package/docs/content/locales/zh-CN/workspace-connections.mdx +9 -2
- package/docs/content/locales/zh-CN/workspace.mdx +19 -18
- package/docs/content/locales/zh-TW/actions.mdx +2 -2
- package/docs/content/locales/zh-TW/agent-native-toolkit.mdx +2 -2
- package/docs/content/locales/zh-TW/agent-surfaces.mdx +8 -10
- package/docs/content/locales/zh-TW/agent-teams.mdx +1 -0
- package/docs/content/locales/zh-TW/authentication.mdx +1 -1
- package/docs/content/locales/zh-TW/components.mdx +11 -1
- package/docs/content/locales/zh-TW/creating-templates.mdx +3 -7
- package/docs/content/locales/zh-TW/cross-app-sso.mdx +16 -6
- package/docs/content/locales/zh-TW/deployment.mdx +8 -0
- package/docs/content/locales/zh-TW/external-agents.mdx +2 -7
- package/docs/content/locales/zh-TW/key-concepts.mdx +13 -20
- package/docs/content/locales/zh-TW/multi-tenancy.mdx +5 -5
- package/docs/content/locales/zh-TW/notifications.mdx +18 -10
- package/docs/content/locales/zh-TW/processors.mdx +11 -5
- package/docs/content/locales/zh-TW/server.mdx +16 -10
- package/docs/content/locales/zh-TW/sharing.mdx +10 -10
- package/docs/content/locales/zh-TW/skills-guide.mdx +34 -17
- package/docs/content/locales/zh-TW/template-assets.mdx +16 -13
- package/docs/content/locales/zh-TW/template-brain.mdx +3 -1
- package/docs/content/locales/zh-TW/template-clips.mdx +3 -4
- package/docs/content/locales/zh-TW/template-design.mdx +3 -1
- package/docs/content/locales/zh-TW/template-dispatch.mdx +5 -1
- package/docs/content/locales/zh-TW/template-mail.mdx +8 -0
- package/docs/content/locales/zh-TW/tracking.mdx +9 -6
- package/docs/content/locales/zh-TW/using-your-agent.mdx +0 -7
- package/docs/content/locales/zh-TW/voice-input.mdx +6 -0
- package/docs/content/locales/zh-TW/workspace-connections.mdx +9 -2
- package/docs/content/locales/zh-TW/workspace.mdx +19 -18
- package/docs/content/mcp-apps.mdx +14 -32
- package/docs/content/mcp-clients.mdx +48 -54
- package/docs/content/mcp-protocol.mdx +25 -10
- package/docs/content/messaging.mdx +19 -11
- package/docs/content/multi-app-workspace.mdx +11 -96
- package/docs/content/multi-tenancy.mdx +5 -5
- package/docs/content/native-chat-ui.mdx +4 -4
- package/docs/content/notifications.mdx +19 -12
- package/docs/content/observability.mdx +2 -4
- package/docs/content/observational-memory.mdx +7 -3
- package/docs/content/onboarding.mdx +9 -2
- package/docs/content/plan-plugin.mdx +10 -2
- package/docs/content/pr-visual-recap.mdx +1 -1
- package/docs/content/processors.mdx +11 -5
- package/docs/content/pure-agent-apps.mdx +5 -1
- package/docs/content/real-time-collaboration.mdx +30 -67
- package/docs/content/recurring-jobs.mdx +8 -6
- package/docs/content/routing.mdx +3 -4
- package/docs/content/sandbox-adapters.mdx +30 -53
- package/docs/content/security.mdx +8 -0
- package/docs/content/server.mdx +17 -10
- package/docs/content/sharing.mdx +10 -10
- package/docs/content/skills-guide.mdx +35 -16
- package/docs/content/template-analytics.mdx +11 -8
- package/docs/content/template-assets.mdx +16 -13
- package/docs/content/template-brain.mdx +3 -1
- package/docs/content/template-calendar.mdx +12 -4
- package/docs/content/template-chat.mdx +4 -4
- package/docs/content/template-clips.mdx +3 -3
- package/docs/content/template-content.mdx +23 -18
- package/docs/content/template-design.mdx +3 -1
- package/docs/content/template-dispatch.mdx +5 -1
- package/docs/content/template-mail.mdx +14 -2
- package/docs/content/template-plan.mdx +22 -15
- package/docs/content/template-slides.mdx +11 -3
- package/docs/content/toolkit-agent-ux.mdx +46 -3
- package/docs/content/toolkit-collaboration.mdx +58 -4
- package/docs/content/toolkit-command-navigation.mdx +8 -2
- package/docs/content/toolkit-comments-review.mdx +10 -2
- package/docs/content/toolkit-history.mdx +8 -3
- package/docs/content/toolkit-observability.mdx +48 -2
- package/docs/content/toolkit-org-team.mdx +8 -2
- package/docs/content/toolkit-resources.mdx +45 -2
- package/docs/content/toolkit-settings.mdx +8 -2
- package/docs/content/toolkit-setup-connections.mdx +7 -2
- package/docs/content/toolkit-sharing.mdx +46 -3
- package/docs/content/toolkit-ui.mdx +82 -11
- package/docs/content/tracking.mdx +10 -8
- package/docs/content/using-your-agent.mdx +0 -12
- package/docs/content/voice-input.mdx +7 -1
- package/docs/content/what-is-agent-native.mdx +7 -8
- package/docs/content/workspace-connections.mdx +16 -23
- package/docs/content/workspace-management.mdx +16 -4
- package/docs/content/workspace.mdx +19 -18
- package/package.json +1 -1
- package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -5
- package/corpus/core/docs/content/locales/ar-SA/migration-workbench.mdx +0 -76
- package/corpus/core/docs/content/locales/de-DE/migration-workbench.mdx +0 -76
- package/corpus/core/docs/content/locales/es-ES/migration-workbench.mdx +0 -76
- package/corpus/core/docs/content/locales/fr-FR/migration-workbench.mdx +0 -76
- package/corpus/core/docs/content/locales/hi-IN/migration-workbench.mdx +0 -74
- package/corpus/core/docs/content/locales/ja-JP/migration-workbench.mdx +0 -76
- package/corpus/core/docs/content/locales/ko-KR/migration-workbench.mdx +0 -74
- package/corpus/core/docs/content/locales/pt-BR/migration-workbench.mdx +0 -76
- package/corpus/core/docs/content/locales/zh-CN/migration-workbench.mdx +0 -74
- package/corpus/core/docs/content/locales/zh-TW/migration-workbench.mdx +0 -74
- package/corpus/core/docs/content/migration-workbench.mdx +0 -74
- package/corpus/core/docs/content/toolkit-app-adapters.mdx +0 -55
- package/corpus/core/docs/content/toolkit-collaboration-ui.mdx +0 -60
- package/corpus/core/docs/content/toolkit-sharing-ui.mdx +0 -45
- package/corpus/core/docs/content/toolkit-shell-hooks.mdx +0 -36
- package/docs/content/locales/ar-SA/migration-workbench.mdx +0 -76
- package/docs/content/locales/de-DE/migration-workbench.mdx +0 -76
- package/docs/content/locales/es-ES/migration-workbench.mdx +0 -76
- package/docs/content/locales/fr-FR/migration-workbench.mdx +0 -76
- package/docs/content/locales/hi-IN/migration-workbench.mdx +0 -74
- package/docs/content/locales/ja-JP/migration-workbench.mdx +0 -76
- package/docs/content/locales/ko-KR/migration-workbench.mdx +0 -74
- package/docs/content/locales/pt-BR/migration-workbench.mdx +0 -76
- package/docs/content/locales/zh-CN/migration-workbench.mdx +0 -74
- package/docs/content/locales/zh-TW/migration-workbench.mdx +0 -74
- package/docs/content/migration-workbench.mdx +0 -74
- package/docs/content/toolkit-app-adapters.mdx +0 -55
- package/docs/content/toolkit-collaboration-ui.mdx +0 -60
- package/docs/content/toolkit-sharing-ui.mdx +0 -45
- package/docs/content/toolkit-shell-hooks.mdx +0 -36
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
import { SIDEBAR_STATE_CHANGE_EVENT, } from "../agent-sidebar-state.js";
|
|
5
|
+
import { agentNativePath } from "../api-path.js";
|
|
6
|
+
import { readClientAppState, setClientAppState } from "../application-state.js";
|
|
7
|
+
import { getBrowserTabId } from "../browser-tab-id.js";
|
|
8
|
+
import { useT } from "../i18n.js";
|
|
9
|
+
import { RealtimeVoiceModeDock, } from "./RealtimeVoiceMode.js";
|
|
10
|
+
const REALTIME_VOICE_STATE_KEY = "realtime-voice-session";
|
|
11
|
+
const REALTIME_VOICE_REQUEST_SOURCE = "realtime-voice";
|
|
12
|
+
const REALTIME_VOICE_SESSION_PATH = "/_agent-native/realtime-voice/session";
|
|
13
|
+
const REALTIME_VOICE_TOOL_PATH = "/_agent-native/realtime-voice/tool";
|
|
14
|
+
function errorMessage(error) {
|
|
15
|
+
return error instanceof Error ? error.message : String(error);
|
|
16
|
+
}
|
|
17
|
+
async function readErrorResponse(response) {
|
|
18
|
+
const raw = await response.text().catch(() => "");
|
|
19
|
+
if (!raw)
|
|
20
|
+
return response.statusText || `HTTP ${response.status}`;
|
|
21
|
+
try {
|
|
22
|
+
const parsed = JSON.parse(raw);
|
|
23
|
+
return String(parsed.error ?? parsed.message ?? raw);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return raw.slice(0, 500);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export async function createRealtimeVoiceSession(offerSdp, options = {}) {
|
|
30
|
+
const response = await fetch(agentNativePath(REALTIME_VOICE_SESSION_PATH), {
|
|
31
|
+
method: "POST",
|
|
32
|
+
credentials: "same-origin",
|
|
33
|
+
headers: {
|
|
34
|
+
"Content-Type": "application/sdp",
|
|
35
|
+
...(options.browserTabId
|
|
36
|
+
? { "X-Agent-Native-Browser-Tab": options.browserTabId }
|
|
37
|
+
: {}),
|
|
38
|
+
},
|
|
39
|
+
body: offerSdp,
|
|
40
|
+
signal: options.signal,
|
|
41
|
+
});
|
|
42
|
+
if (!response.ok) {
|
|
43
|
+
const message = await readErrorResponse(response);
|
|
44
|
+
const error = new Error(message);
|
|
45
|
+
error.status = response.status;
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
return response.text();
|
|
49
|
+
}
|
|
50
|
+
export async function executeRealtimeVoiceTool(input) {
|
|
51
|
+
const response = await fetch(agentNativePath(REALTIME_VOICE_TOOL_PATH), {
|
|
52
|
+
method: "POST",
|
|
53
|
+
credentials: "same-origin",
|
|
54
|
+
headers: {
|
|
55
|
+
"Content-Type": "application/json",
|
|
56
|
+
...(input.browserTabId
|
|
57
|
+
? { "X-Agent-Native-Browser-Tab": input.browserTabId }
|
|
58
|
+
: {}),
|
|
59
|
+
},
|
|
60
|
+
body: JSON.stringify({
|
|
61
|
+
name: input.name,
|
|
62
|
+
args: input.args,
|
|
63
|
+
callId: input.callId,
|
|
64
|
+
sessionId: input.sessionId,
|
|
65
|
+
browserTabId: input.browserTabId,
|
|
66
|
+
}),
|
|
67
|
+
signal: input.signal,
|
|
68
|
+
});
|
|
69
|
+
if (!response.ok) {
|
|
70
|
+
throw new Error(await readErrorResponse(response));
|
|
71
|
+
}
|
|
72
|
+
return (await response.json());
|
|
73
|
+
}
|
|
74
|
+
export function extractRealtimeVoiceFunctionCalls(event) {
|
|
75
|
+
if (event.type === "response.function_call_arguments.done") {
|
|
76
|
+
const name = typeof event.name === "string" ? event.name : "";
|
|
77
|
+
const callId = typeof event.call_id === "string" ? event.call_id : "";
|
|
78
|
+
if (!name || !callId)
|
|
79
|
+
return [];
|
|
80
|
+
return [
|
|
81
|
+
{
|
|
82
|
+
name,
|
|
83
|
+
callId,
|
|
84
|
+
argumentsText: typeof event.arguments === "string" ? event.arguments : "{}",
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
if (event.type !== "response.done")
|
|
89
|
+
return [];
|
|
90
|
+
const response = event.response;
|
|
91
|
+
if (!response || typeof response !== "object")
|
|
92
|
+
return [];
|
|
93
|
+
const output = response.output;
|
|
94
|
+
if (!Array.isArray(output))
|
|
95
|
+
return [];
|
|
96
|
+
return output.flatMap((item) => {
|
|
97
|
+
if (!item || typeof item !== "object")
|
|
98
|
+
return [];
|
|
99
|
+
const record = item;
|
|
100
|
+
if (record.type !== "function_call")
|
|
101
|
+
return [];
|
|
102
|
+
const name = typeof record.name === "string" ? record.name : "";
|
|
103
|
+
const callId = typeof record.call_id === "string" ? record.call_id : "";
|
|
104
|
+
if (!name || !callId)
|
|
105
|
+
return [];
|
|
106
|
+
return [
|
|
107
|
+
{
|
|
108
|
+
name,
|
|
109
|
+
callId,
|
|
110
|
+
argumentsText: typeof record.arguments === "string" ? record.arguments : "{}",
|
|
111
|
+
},
|
|
112
|
+
];
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function parseFunctionArguments(text) {
|
|
116
|
+
const parsed = JSON.parse(text || "{}");
|
|
117
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
118
|
+
throw new Error("The voice model returned invalid tool arguments.");
|
|
119
|
+
}
|
|
120
|
+
return parsed;
|
|
121
|
+
}
|
|
122
|
+
function sendDataChannelEvent(channel, event) {
|
|
123
|
+
if (!channel || channel.readyState !== "open")
|
|
124
|
+
return;
|
|
125
|
+
channel.send(JSON.stringify(event));
|
|
126
|
+
}
|
|
127
|
+
function openOpenAiKeySettings() {
|
|
128
|
+
if (typeof window === "undefined")
|
|
129
|
+
return;
|
|
130
|
+
window.location.hash = "#secrets:OPENAI_API_KEY";
|
|
131
|
+
window.dispatchEvent(new Event("agent-panel:open"));
|
|
132
|
+
window.dispatchEvent(new CustomEvent("agent-panel:open-settings", {
|
|
133
|
+
detail: { section: "secrets" },
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
function voiceCopy(t) {
|
|
137
|
+
return {
|
|
138
|
+
entryButtonLabel: t("agentPanel.voiceMode.entryButtonLabel"),
|
|
139
|
+
promptTitle: t("agentPanel.voiceMode.promptTitle"),
|
|
140
|
+
promptDescription: t("agentPanel.voiceMode.promptDescription"),
|
|
141
|
+
startVoiceMode: t("agentPanel.voiceMode.start"),
|
|
142
|
+
keepDictating: t("agentPanel.voiceMode.keepDictating"),
|
|
143
|
+
showChat: t("agentPanel.voiceMode.showChat"),
|
|
144
|
+
hideChat: t("agentPanel.voiceMode.hideChat"),
|
|
145
|
+
endVoiceMode: t("agentPanel.voiceMode.end"),
|
|
146
|
+
status: {
|
|
147
|
+
connecting: t("agentPanel.voiceMode.status.connecting"),
|
|
148
|
+
listening: t("agentPanel.voiceMode.status.listening"),
|
|
149
|
+
speaking: t("agentPanel.voiceMode.status.speaking"),
|
|
150
|
+
working: t("agentPanel.voiceMode.status.working"),
|
|
151
|
+
error: t("agentPanel.voiceMode.status.error"),
|
|
152
|
+
ending: t("agentPanel.voiceMode.status.ending"),
|
|
153
|
+
},
|
|
154
|
+
errors: {
|
|
155
|
+
unsupported: t("agentPanel.voiceMode.errors.unsupported"),
|
|
156
|
+
responseFailed: t("agentPanel.voiceMode.errors.responseFailed"),
|
|
157
|
+
sessionFailed: t("agentPanel.voiceMode.errors.sessionFailed"),
|
|
158
|
+
channelDisconnected: t("agentPanel.voiceMode.errors.channelDisconnected"),
|
|
159
|
+
connectionFailed: t("agentPanel.voiceMode.errors.connectionFailed"),
|
|
160
|
+
offerFailed: t("agentPanel.voiceMode.errors.offerFailed"),
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export function useRealtimeVoiceModeCopy() {
|
|
165
|
+
const t = useT();
|
|
166
|
+
return useMemo(() => voiceCopy(t), [t]);
|
|
167
|
+
}
|
|
168
|
+
function useRealtimeVoiceModeController(browserTabId, copy) {
|
|
169
|
+
const [state, setState] = useState("idle");
|
|
170
|
+
const [error, setError] = useState(null);
|
|
171
|
+
const [chatVisible, setChatVisible] = useState(false);
|
|
172
|
+
const stateRef = useRef(state);
|
|
173
|
+
const peerRef = useRef(null);
|
|
174
|
+
const channelRef = useRef(null);
|
|
175
|
+
const streamRef = useRef(null);
|
|
176
|
+
const audioRef = useRef(null);
|
|
177
|
+
const abortRef = useRef(null);
|
|
178
|
+
const handledCallsRef = useRef(new Set());
|
|
179
|
+
const sessionIdRef = useRef(undefined);
|
|
180
|
+
const startedAtRef = useRef(undefined);
|
|
181
|
+
const lastUserTextRef = useRef("");
|
|
182
|
+
const lastAssistantTextRef = useRef("");
|
|
183
|
+
useEffect(() => {
|
|
184
|
+
stateRef.current = state;
|
|
185
|
+
}, [state]);
|
|
186
|
+
const syncAppState = useCallback((nextState) => {
|
|
187
|
+
const value = nextState === "idle"
|
|
188
|
+
? null
|
|
189
|
+
: {
|
|
190
|
+
active: true,
|
|
191
|
+
status: nextState,
|
|
192
|
+
model: "gpt-realtime-2.1",
|
|
193
|
+
startedAt: startedAtRef.current,
|
|
194
|
+
sessionId: sessionIdRef.current,
|
|
195
|
+
browserTabId,
|
|
196
|
+
lastUserText: lastUserTextRef.current || undefined,
|
|
197
|
+
lastAssistantText: lastAssistantTextRef.current || undefined,
|
|
198
|
+
};
|
|
199
|
+
void setClientAppState(REALTIME_VOICE_STATE_KEY, value, {
|
|
200
|
+
requestSource: REALTIME_VOICE_REQUEST_SOURCE,
|
|
201
|
+
}).catch(() => undefined);
|
|
202
|
+
}, [browserTabId]);
|
|
203
|
+
const transition = useCallback((nextState) => {
|
|
204
|
+
stateRef.current = nextState;
|
|
205
|
+
setState(nextState);
|
|
206
|
+
syncAppState(nextState);
|
|
207
|
+
}, [syncAppState]);
|
|
208
|
+
const cleanupTransport = useCallback(() => {
|
|
209
|
+
abortRef.current?.abort();
|
|
210
|
+
abortRef.current = null;
|
|
211
|
+
channelRef.current?.close();
|
|
212
|
+
channelRef.current = null;
|
|
213
|
+
peerRef.current?.close();
|
|
214
|
+
peerRef.current = null;
|
|
215
|
+
for (const track of streamRef.current?.getTracks() ?? [])
|
|
216
|
+
track.stop();
|
|
217
|
+
streamRef.current = null;
|
|
218
|
+
if (audioRef.current) {
|
|
219
|
+
audioRef.current.pause();
|
|
220
|
+
audioRef.current.srcObject = null;
|
|
221
|
+
}
|
|
222
|
+
audioRef.current = null;
|
|
223
|
+
handledCallsRef.current.clear();
|
|
224
|
+
}, []);
|
|
225
|
+
const fail = useCallback((message, options) => {
|
|
226
|
+
cleanupTransport();
|
|
227
|
+
setError(message);
|
|
228
|
+
transition("error");
|
|
229
|
+
if (options?.openKeySettings)
|
|
230
|
+
openOpenAiKeySettings();
|
|
231
|
+
}, [cleanupTransport, transition]);
|
|
232
|
+
const handleFunctionCall = useCallback(async (call) => {
|
|
233
|
+
if (handledCallsRef.current.has(call.callId))
|
|
234
|
+
return;
|
|
235
|
+
handledCallsRef.current.add(call.callId);
|
|
236
|
+
transition("working");
|
|
237
|
+
let result;
|
|
238
|
+
try {
|
|
239
|
+
const args = parseFunctionArguments(call.argumentsText);
|
|
240
|
+
result = await executeRealtimeVoiceTool({
|
|
241
|
+
name: call.name,
|
|
242
|
+
args,
|
|
243
|
+
callId: call.callId,
|
|
244
|
+
sessionId: sessionIdRef.current,
|
|
245
|
+
browserTabId,
|
|
246
|
+
signal: abortRef.current?.signal,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
catch (toolError) {
|
|
250
|
+
result = {
|
|
251
|
+
callId: call.callId,
|
|
252
|
+
status: "failed",
|
|
253
|
+
output: errorMessage(toolError),
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
sendDataChannelEvent(channelRef.current, {
|
|
257
|
+
type: "conversation.item.create",
|
|
258
|
+
item: {
|
|
259
|
+
type: "function_call_output",
|
|
260
|
+
call_id: call.callId,
|
|
261
|
+
output: JSON.stringify(result),
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
sendDataChannelEvent(channelRef.current, { type: "response.create" });
|
|
265
|
+
}, [browserTabId, transition]);
|
|
266
|
+
const handleServerEvent = useCallback((event) => {
|
|
267
|
+
if (event.type === "session.created") {
|
|
268
|
+
const session = event.session;
|
|
269
|
+
if (session && typeof session === "object") {
|
|
270
|
+
const id = session.id;
|
|
271
|
+
if (typeof id === "string")
|
|
272
|
+
sessionIdRef.current = id;
|
|
273
|
+
}
|
|
274
|
+
transition("listening");
|
|
275
|
+
}
|
|
276
|
+
else if (event.type === "input_audio_buffer.speech_started") {
|
|
277
|
+
transition("listening");
|
|
278
|
+
}
|
|
279
|
+
else if (event.type === "input_audio_buffer.speech_stopped") {
|
|
280
|
+
transition("working");
|
|
281
|
+
}
|
|
282
|
+
else if (event.type === "response.created") {
|
|
283
|
+
lastAssistantTextRef.current = "";
|
|
284
|
+
transition("working");
|
|
285
|
+
}
|
|
286
|
+
else if (event.type === "response.output_audio_transcript.delta") {
|
|
287
|
+
if (typeof event.delta === "string") {
|
|
288
|
+
lastAssistantTextRef.current += event.delta;
|
|
289
|
+
}
|
|
290
|
+
transition("speaking");
|
|
291
|
+
}
|
|
292
|
+
else if (event.type === "response.output_audio_transcript.done") {
|
|
293
|
+
if (typeof event.transcript === "string") {
|
|
294
|
+
lastAssistantTextRef.current = event.transcript;
|
|
295
|
+
}
|
|
296
|
+
syncAppState("speaking");
|
|
297
|
+
}
|
|
298
|
+
else if (event.type === "conversation.item.input_audio_transcription.completed") {
|
|
299
|
+
if (typeof event.transcript === "string") {
|
|
300
|
+
lastUserTextRef.current = event.transcript;
|
|
301
|
+
syncAppState("working");
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
else if (event.type === "response.done") {
|
|
305
|
+
const response = event.response;
|
|
306
|
+
const status = response && typeof response === "object"
|
|
307
|
+
? response.status
|
|
308
|
+
: undefined;
|
|
309
|
+
if (status === "failed") {
|
|
310
|
+
fail(copy?.errors.responseFailed ??
|
|
311
|
+
"OpenAI could not complete the voice response.");
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
else if (event.type === "error") {
|
|
316
|
+
const detail = event.error;
|
|
317
|
+
const message = detail && typeof detail === "object"
|
|
318
|
+
? String(detail.message ?? "")
|
|
319
|
+
: typeof detail === "string"
|
|
320
|
+
? detail
|
|
321
|
+
: "";
|
|
322
|
+
fail(message ||
|
|
323
|
+
copy?.errors.sessionFailed ||
|
|
324
|
+
"The realtime voice session encountered an error.");
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
const calls = extractRealtimeVoiceFunctionCalls(event);
|
|
328
|
+
for (const call of calls)
|
|
329
|
+
void handleFunctionCall(call);
|
|
330
|
+
if (event.type === "response.done" && calls.length === 0) {
|
|
331
|
+
transition("listening");
|
|
332
|
+
}
|
|
333
|
+
}, [copy, fail, handleFunctionCall, syncAppState, transition]);
|
|
334
|
+
const start = useCallback(async () => {
|
|
335
|
+
if (stateRef.current !== "idle")
|
|
336
|
+
return;
|
|
337
|
+
if (typeof RTCPeerConnection === "undefined" ||
|
|
338
|
+
!navigator.mediaDevices?.getUserMedia) {
|
|
339
|
+
fail(copy?.errors.unsupported ??
|
|
340
|
+
"This browser does not support realtime voice conversations.");
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
setError(null);
|
|
344
|
+
startedAtRef.current = new Date().toISOString();
|
|
345
|
+
lastUserTextRef.current = "";
|
|
346
|
+
lastAssistantTextRef.current = "";
|
|
347
|
+
sessionIdRef.current = undefined;
|
|
348
|
+
transition("connecting");
|
|
349
|
+
setChatVisible(false);
|
|
350
|
+
window.dispatchEvent(new Event("agent-panel:close"));
|
|
351
|
+
const abortController = new AbortController();
|
|
352
|
+
abortRef.current = abortController;
|
|
353
|
+
try {
|
|
354
|
+
const stream = await navigator.mediaDevices.getUserMedia({
|
|
355
|
+
audio: {
|
|
356
|
+
echoCancellation: true,
|
|
357
|
+
noiseSuppression: true,
|
|
358
|
+
autoGainControl: true,
|
|
359
|
+
},
|
|
360
|
+
});
|
|
361
|
+
streamRef.current = stream;
|
|
362
|
+
const peer = new RTCPeerConnection();
|
|
363
|
+
peerRef.current = peer;
|
|
364
|
+
for (const track of stream.getAudioTracks())
|
|
365
|
+
peer.addTrack(track, stream);
|
|
366
|
+
const audio = document.createElement("audio");
|
|
367
|
+
audio.autoplay = true;
|
|
368
|
+
audio.setAttribute("playsinline", "");
|
|
369
|
+
audioRef.current = audio;
|
|
370
|
+
peer.ontrack = (trackEvent) => {
|
|
371
|
+
audio.srcObject = trackEvent.streams[0] ?? null;
|
|
372
|
+
void audio.play().catch(() => undefined);
|
|
373
|
+
};
|
|
374
|
+
const channel = peer.createDataChannel("oai-events");
|
|
375
|
+
channelRef.current = channel;
|
|
376
|
+
channel.onopen = () => transition("listening");
|
|
377
|
+
channel.onmessage = (messageEvent) => {
|
|
378
|
+
try {
|
|
379
|
+
handleServerEvent(JSON.parse(String(messageEvent.data)));
|
|
380
|
+
}
|
|
381
|
+
catch {
|
|
382
|
+
// Ignore malformed provider events without ending a healthy call.
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
channel.onerror = () => fail(copy?.errors.channelDisconnected ??
|
|
386
|
+
"The realtime voice control channel disconnected.");
|
|
387
|
+
peer.onconnectionstatechange = () => {
|
|
388
|
+
if (peer.connectionState === "connected")
|
|
389
|
+
transition("listening");
|
|
390
|
+
if (peer.connectionState === "failed") {
|
|
391
|
+
fail(copy?.errors.connectionFailed ??
|
|
392
|
+
"The realtime voice connection failed.");
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
const offer = await peer.createOffer();
|
|
396
|
+
await peer.setLocalDescription(offer);
|
|
397
|
+
if (!offer.sdp) {
|
|
398
|
+
throw new Error(copy?.errors.offerFailed ??
|
|
399
|
+
"The browser did not create an audio offer.");
|
|
400
|
+
}
|
|
401
|
+
const answerSdp = await createRealtimeVoiceSession(offer.sdp, {
|
|
402
|
+
browserTabId,
|
|
403
|
+
signal: abortController.signal,
|
|
404
|
+
});
|
|
405
|
+
await peer.setRemoteDescription({ type: "answer", sdp: answerSdp });
|
|
406
|
+
}
|
|
407
|
+
catch (startError) {
|
|
408
|
+
const status = startError?.status;
|
|
409
|
+
fail(errorMessage(startError), { openKeySettings: status === 400 });
|
|
410
|
+
}
|
|
411
|
+
}, [browserTabId, copy, fail, handleServerEvent, transition]);
|
|
412
|
+
const end = useCallback(() => {
|
|
413
|
+
if (stateRef.current === "idle" || stateRef.current === "ending")
|
|
414
|
+
return;
|
|
415
|
+
transition("ending");
|
|
416
|
+
cleanupTransport();
|
|
417
|
+
setError(null);
|
|
418
|
+
sessionIdRef.current = undefined;
|
|
419
|
+
startedAtRef.current = undefined;
|
|
420
|
+
transition("idle");
|
|
421
|
+
}, [cleanupTransport, transition]);
|
|
422
|
+
const toggleChat = useCallback(() => {
|
|
423
|
+
setChatVisible((current) => !current);
|
|
424
|
+
window.dispatchEvent(new Event("agent-panel:toggle"));
|
|
425
|
+
}, []);
|
|
426
|
+
useEffect(() => {
|
|
427
|
+
const onSidebarState = (event) => {
|
|
428
|
+
const detail = event
|
|
429
|
+
.detail;
|
|
430
|
+
if (detail && typeof detail.open === "boolean") {
|
|
431
|
+
setChatVisible(detail.open);
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
window.addEventListener(SIDEBAR_STATE_CHANGE_EVENT, onSidebarState);
|
|
435
|
+
return () => window.removeEventListener(SIDEBAR_STATE_CHANGE_EVENT, onSidebarState);
|
|
436
|
+
}, []);
|
|
437
|
+
useEffect(() => cleanupTransport, [cleanupTransport]);
|
|
438
|
+
return {
|
|
439
|
+
state,
|
|
440
|
+
active: state !== "idle",
|
|
441
|
+
errorMessage: error,
|
|
442
|
+
chatVisible,
|
|
443
|
+
start,
|
|
444
|
+
end,
|
|
445
|
+
toggleChat,
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
const RealtimeVoiceModeContext = createContext(null);
|
|
449
|
+
export function RealtimeVoiceModeProvider({ children, browserTabId, }) {
|
|
450
|
+
const resolvedBrowserTabId = useMemo(() => browserTabId ?? getBrowserTabId(), [browserTabId]);
|
|
451
|
+
const copy = useRealtimeVoiceModeCopy();
|
|
452
|
+
const voice = useRealtimeVoiceModeController(resolvedBrowserTabId, copy);
|
|
453
|
+
return (_jsxs(RealtimeVoiceModeContext.Provider, { value: voice, children: [children, voice.active && typeof document !== "undefined"
|
|
454
|
+
? createPortal(_jsx(RealtimeVoiceModeDock, { state: voice.state === "idle" ? "ending" : voice.state, copy: copy, chatVisible: voice.chatVisible, onToggleChat: voice.toggleChat, onEndVoiceMode: voice.end, errorMessage: voice.errorMessage, className: "z-[270]" }), document.body)
|
|
455
|
+
: null] }));
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Ensure standalone/full-page composers get realtime voice without nesting a
|
|
459
|
+
* second session owner inside the persistent AgentSidebar provider.
|
|
460
|
+
*/
|
|
461
|
+
export function RealtimeVoiceModeBoundary({ children, browserTabId, }) {
|
|
462
|
+
const existing = useRealtimeVoiceModeOptional();
|
|
463
|
+
if (existing) {
|
|
464
|
+
return (_jsx(RealtimeVoiceModeComposerSurface, { children: children }));
|
|
465
|
+
}
|
|
466
|
+
return (_jsx(RealtimeVoiceModeProvider, { browserTabId: browserTabId, children: _jsx(RealtimeVoiceModeComposerSurface, { children: children }) }));
|
|
467
|
+
}
|
|
468
|
+
/** Hide a composer while voice owns input; the dock can reveal it on demand. */
|
|
469
|
+
function RealtimeVoiceModeComposerSurface({ children, }) {
|
|
470
|
+
const voice = useRealtimeVoiceModeOptional();
|
|
471
|
+
if (voice?.active && !voice.chatVisible)
|
|
472
|
+
return null;
|
|
473
|
+
return children;
|
|
474
|
+
}
|
|
475
|
+
export function useRealtimeVoiceMode() {
|
|
476
|
+
const value = useContext(RealtimeVoiceModeContext);
|
|
477
|
+
if (!value) {
|
|
478
|
+
throw new Error("useRealtimeVoiceMode must be used inside RealtimeVoiceModeProvider.");
|
|
479
|
+
}
|
|
480
|
+
return value;
|
|
481
|
+
}
|
|
482
|
+
export function useRealtimeVoiceModeOptional() {
|
|
483
|
+
return useContext(RealtimeVoiceModeContext);
|
|
484
|
+
}
|
|
485
|
+
export async function readRealtimeVoiceContext() {
|
|
486
|
+
const [navigation, url] = await Promise.all([
|
|
487
|
+
readClientAppState("navigation").catch(() => null),
|
|
488
|
+
readClientAppState("__url__").catch(() => null),
|
|
489
|
+
]);
|
|
490
|
+
return { navigation, url };
|
|
491
|
+
}
|
|
492
|
+
//# sourceMappingURL=useRealtimeVoiceMode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRealtimeVoiceMode.js","sourceRoot":"","sources":["../../../src/client/composer/useRealtimeVoiceMode.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GAET,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EACL,0BAA0B,GAE3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EACL,qBAAqB,GAGtB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,wBAAwB,GAAG,wBAAwB,CAAC;AAC1D,MAAM,6BAA6B,GAAG,gBAAgB,CAAC;AACvD,MAAM,2BAA2B,GAAG,uCAAuC,CAAC;AAC5E,MAAM,wBAAwB,GAAG,oCAAoC,CAAC;AA0BtE,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,KAAK,UAAU,iBAAiB,CAAC,QAAkB;IACjD,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,GAAG;QAAE,OAAO,QAAQ,CAAC,UAAU,IAAI,Q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ACD,OAAO,CACL,KAAC,yBAAyB,IAAC,YAAY,EAAE,YAAY,YACnD,KAAC,gCAAgC,cAC9B,QAAQ,GACwB,GACT,CAC7B,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,SAAS,gCAAgC,CAAC,EACxC,QAAQ,GACyC;IACjD,MAAM,KAAK,GAAG,4BAA4B,EAAE,CAAC;IAC7C,IAAI,KAAK,EAAE,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IACrD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,MAAM,KAAK,GAAG,UAAU,CAAC,wBAAwB,CAAC,CAAC;IACnD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,qEAAqE,CACtE,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,4BAA4B;IAC1C,OAAO,UAAU,CAAC,wBAAwB,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB;IAI5C,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC1C,kBAAkB,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QAClD,kBAAkB,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;KAChD,CAAC,CAAC;IACH,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport {\n SIDEBAR_STATE_CHANGE_EVENT,\n type AgentSidebarStateChangeDetail,\n} from \"../agent-sidebar-state.js\";\nimport { agentNativePath } from \"../api-path.js\";\nimport { readClientAppState, setClientAppState } from \"../application-state.js\";\nimport { getBrowserTabId } from \"../browser-tab-id.js\";\nimport { useT } from \"../i18n.js\";\nimport {\n RealtimeVoiceModeDock,\n type RealtimeVoiceModeCopy,\n type RealtimeVoiceModeState,\n} from \"./RealtimeVoiceMode.js\";\n\nconst REALTIME_VOICE_STATE_KEY = \"realtime-voice-session\";\nconst REALTIME_VOICE_REQUEST_SOURCE = \"realtime-voice\";\nconst REALTIME_VOICE_SESSION_PATH = \"/_agent-native/realtime-voice/session\";\nconst REALTIME_VOICE_TOOL_PATH = \"/_agent-native/realtime-voice/tool\";\n\ntype RealtimeServerEvent = Record<string, unknown> & { type?: string };\n\nexport interface RealtimeVoiceToolResult {\n callId: string;\n status: \"completed\" | \"failed\" | \"approval_required\";\n output: string;\n approvalKey?: string;\n}\n\nexport interface RealtimeVoiceModeApi {\n state: \"idle\" | RealtimeVoiceModeState;\n active: boolean;\n errorMessage: string | null;\n chatVisible: boolean;\n start: () => Promise<void>;\n end: () => void;\n toggleChat: () => void;\n}\n\nexport interface RealtimeVoiceModeProviderProps {\n children: ReactNode;\n browserTabId?: string;\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nasync function readErrorResponse(response: Response): Promise<string> {\n const raw = await response.text().catch(() => \"\");\n if (!raw) return response.statusText || `HTTP ${response.status}`;\n try {\n const parsed = JSON.parse(raw) as { error?: unknown; message?: unknown };\n return String(parsed.error ?? parsed.message ?? raw);\n } catch {\n return raw.slice(0, 500);\n }\n}\n\nexport async function createRealtimeVoiceSession(\n offerSdp: string,\n options: { browserTabId?: string; signal?: AbortSignal } = {},\n): Promise<string> {\n const response = await fetch(agentNativePath(REALTIME_VOICE_SESSION_PATH), {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n \"Content-Type\": \"application/sdp\",\n ...(options.browserTabId\n ? { \"X-Agent-Native-Browser-Tab\": options.browserTabId }\n : {}),\n },\n body: offerSdp,\n signal: options.signal,\n });\n if (!response.ok) {\n const message = await readErrorResponse(response);\n const error = new Error(message);\n (error as { status?: number }).status = response.status;\n throw error;\n }\n return response.text();\n}\n\nexport async function executeRealtimeVoiceTool(input: {\n name: string;\n args: Record<string, unknown>;\n callId: string;\n sessionId?: string;\n browserTabId?: string;\n signal?: AbortSignal;\n}): Promise<RealtimeVoiceToolResult> {\n const response = await fetch(agentNativePath(REALTIME_VOICE_TOOL_PATH), {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...(input.browserTabId\n ? { \"X-Agent-Native-Browser-Tab\": input.browserTabId }\n : {}),\n },\n body: JSON.stringify({\n name: input.name,\n args: input.args,\n callId: input.callId,\n sessionId: input.sessionId,\n browserTabId: input.browserTabId,\n }),\n signal: input.signal,\n });\n if (!response.ok) {\n throw new Error(await readErrorResponse(response));\n }\n return (await response.json()) as RealtimeVoiceToolResult;\n}\n\nexport function extractRealtimeVoiceFunctionCalls(\n event: RealtimeServerEvent,\n): Array<{ name: string; callId: string; argumentsText: string }> {\n if (event.type === \"response.function_call_arguments.done\") {\n const name = typeof event.name === \"string\" ? event.name : \"\";\n const callId = typeof event.call_id === \"string\" ? event.call_id : \"\";\n if (!name || !callId) return [];\n return [\n {\n name,\n callId,\n argumentsText:\n typeof event.arguments === \"string\" ? event.arguments : \"{}\",\n },\n ];\n }\n if (event.type !== \"response.done\") return [];\n const response = event.response;\n if (!response || typeof response !== \"object\") return [];\n const output = (response as { output?: unknown }).output;\n if (!Array.isArray(output)) return [];\n return output.flatMap((item) => {\n if (!item || typeof item !== \"object\") return [];\n const record = item as Record<string, unknown>;\n if (record.type !== \"function_call\") return [];\n const name = typeof record.name === \"string\" ? record.name : \"\";\n const callId = typeof record.call_id === \"string\" ? record.call_id : \"\";\n if (!name || !callId) return [];\n return [\n {\n name,\n callId,\n argumentsText:\n typeof record.arguments === \"string\" ? record.arguments : \"{}\",\n },\n ];\n });\n}\n\nfunction parseFunctionArguments(text: string): Record<string, unknown> {\n const parsed = JSON.parse(text || \"{}\");\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n throw new Error(\"The voice model returned invalid tool arguments.\");\n }\n return parsed as Record<string, unknown>;\n}\n\nfunction sendDataChannelEvent(\n channel: RTCDataChannel | null,\n event: Record<string, unknown>,\n): void {\n if (!channel || channel.readyState !== \"open\") return;\n channel.send(JSON.stringify(event));\n}\n\nfunction openOpenAiKeySettings(): void {\n if (typeof window === \"undefined\") return;\n window.location.hash = \"#secrets:OPENAI_API_KEY\";\n window.dispatchEvent(new Event(\"agent-panel:open\"));\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:open-settings\", {\n detail: { section: \"secrets\" },\n }),\n );\n}\n\nfunction voiceCopy(t: ReturnType<typeof useT>): RealtimeVoiceModeCopy {\n return {\n entryButtonLabel: t(\"agentPanel.voiceMode.entryButtonLabel\"),\n promptTitle: t(\"agentPanel.voiceMode.promptTitle\"),\n promptDescription: t(\"agentPanel.voiceMode.promptDescription\"),\n startVoiceMode: t(\"agentPanel.voiceMode.start\"),\n keepDictating: t(\"agentPanel.voiceMode.keepDictating\"),\n showChat: t(\"agentPanel.voiceMode.showChat\"),\n hideChat: t(\"agentPanel.voiceMode.hideChat\"),\n endVoiceMode: t(\"agentPanel.voiceMode.end\"),\n status: {\n connecting: t(\"agentPanel.voiceMode.status.connecting\"),\n listening: t(\"agentPanel.voiceMode.status.listening\"),\n speaking: t(\"agentPanel.voiceMode.status.speaking\"),\n working: t(\"agentPanel.voiceMode.status.working\"),\n error: t(\"agentPanel.voiceMode.status.error\"),\n ending: t(\"agentPanel.voiceMode.status.ending\"),\n },\n errors: {\n unsupported: t(\"agentPanel.voiceMode.errors.unsupported\"),\n responseFailed: t(\"agentPanel.voiceMode.errors.responseFailed\"),\n sessionFailed: t(\"agentPanel.voiceMode.errors.sessionFailed\"),\n channelDisconnected: t(\"agentPanel.voiceMode.errors.channelDisconnected\"),\n connectionFailed: t(\"agentPanel.voiceMode.errors.connectionFailed\"),\n offerFailed: t(\"agentPanel.voiceMode.errors.offerFailed\"),\n },\n };\n}\n\nexport function useRealtimeVoiceModeCopy(): RealtimeVoiceModeCopy {\n const t = useT();\n return useMemo(() => voiceCopy(t), [t]);\n}\n\nfunction useRealtimeVoiceModeController(\n browserTabId?: string,\n copy?: RealtimeVoiceModeCopy,\n): RealtimeVoiceModeApi {\n const [state, setState] = useState<\"idle\" | RealtimeVoiceModeState>(\"idle\");\n const [error, setError] = useState<string | null>(null);\n const [chatVisible, setChatVisible] = useState(false);\n const stateRef = useRef(state);\n const peerRef = useRef<RTCPeerConnection | null>(null);\n const channelRef = useRef<RTCDataChannel | null>(null);\n const streamRef = useRef<MediaStream | null>(null);\n const audioRef = useRef<HTMLAudioElement | null>(null);\n const abortRef = useRef<AbortController | null>(null);\n const handledCallsRef = useRef(new Set<string>());\n const sessionIdRef = useRef<string | undefined>(undefined);\n const startedAtRef = useRef<string | undefined>(undefined);\n const lastUserTextRef = useRef(\"\");\n const lastAssistantTextRef = useRef(\"\");\n\n useEffect(() => {\n stateRef.current = state;\n }, [state]);\n\n const syncAppState = useCallback(\n (nextState: \"idle\" | RealtimeVoiceModeState) => {\n const value =\n nextState === \"idle\"\n ? null\n : {\n active: true,\n status: nextState,\n model: \"gpt-realtime-2.1\",\n startedAt: startedAtRef.current,\n sessionId: sessionIdRef.current,\n browserTabId,\n lastUserText: lastUserTextRef.current || undefined,\n lastAssistantText: lastAssistantTextRef.current || undefined,\n };\n void setClientAppState(REALTIME_VOICE_STATE_KEY, value, {\n requestSource: REALTIME_VOICE_REQUEST_SOURCE,\n }).catch(() => undefined);\n },\n [browserTabId],\n );\n\n const transition = useCallback(\n (nextState: \"idle\" | RealtimeVoiceModeState) => {\n stateRef.current = nextState;\n setState(nextState);\n syncAppState(nextState);\n },\n [syncAppState],\n );\n\n const cleanupTransport = useCallback(() => {\n abortRef.current?.abort();\n abortRef.current = null;\n channelRef.current?.close();\n channelRef.current = null;\n peerRef.current?.close();\n peerRef.current = null;\n for (const track of streamRef.current?.getTracks() ?? []) track.stop();\n streamRef.current = null;\n if (audioRef.current) {\n audioRef.current.pause();\n audioRef.current.srcObject = null;\n }\n audioRef.current = null;\n handledCallsRef.current.clear();\n }, []);\n\n const fail = useCallback(\n (message: string, options?: { openKeySettings?: boolean }) => {\n cleanupTransport();\n setError(message);\n transition(\"error\");\n if (options?.openKeySettings) openOpenAiKeySettings();\n },\n [cleanupTransport, transition],\n );\n\n const handleFunctionCall = useCallback(\n async (call: { name: string; callId: string; argumentsText: string }) => {\n if (handledCallsRef.current.has(call.callId)) return;\n handledCallsRef.current.add(call.callId);\n transition(\"working\");\n let result: RealtimeVoiceToolResult;\n try {\n const args = parseFunctionArguments(call.argumentsText);\n result = await executeRealtimeVoiceTool({\n name: call.name,\n args,\n callId: call.callId,\n sessionId: sessionIdRef.current,\n browserTabId,\n signal: abortRef.current?.signal,\n });\n } catch (toolError) {\n result = {\n callId: call.callId,\n status: \"failed\",\n output: errorMessage(toolError),\n };\n }\n sendDataChannelEvent(channelRef.current, {\n type: \"conversation.item.create\",\n item: {\n type: \"function_call_output\",\n call_id: call.callId,\n output: JSON.stringify(result),\n },\n });\n sendDataChannelEvent(channelRef.current, { type: \"response.create\" });\n },\n [browserTabId, transition],\n );\n\n const handleServerEvent = useCallback(\n (event: RealtimeServerEvent) => {\n if (event.type === \"session.created\") {\n const session = event.session;\n if (session && typeof session === \"object\") {\n const id = (session as { id?: unknown }).id;\n if (typeof id === \"string\") sessionIdRef.current = id;\n }\n transition(\"listening\");\n } else if (event.type === \"input_audio_buffer.speech_started\") {\n transition(\"listening\");\n } else if (event.type === \"input_audio_buffer.speech_stopped\") {\n transition(\"working\");\n } else if (event.type === \"response.created\") {\n lastAssistantTextRef.current = \"\";\n transition(\"working\");\n } else if (event.type === \"response.output_audio_transcript.delta\") {\n if (typeof event.delta === \"string\") {\n lastAssistantTextRef.current += event.delta;\n }\n transition(\"speaking\");\n } else if (event.type === \"response.output_audio_transcript.done\") {\n if (typeof event.transcript === \"string\") {\n lastAssistantTextRef.current = event.transcript;\n }\n syncAppState(\"speaking\");\n } else if (\n event.type === \"conversation.item.input_audio_transcription.completed\"\n ) {\n if (typeof event.transcript === \"string\") {\n lastUserTextRef.current = event.transcript;\n syncAppState(\"working\");\n }\n } else if (event.type === \"response.done\") {\n const response = event.response;\n const status =\n response && typeof response === \"object\"\n ? (response as { status?: unknown }).status\n : undefined;\n if (status === \"failed\") {\n fail(\n copy?.errors.responseFailed ??\n \"OpenAI could not complete the voice response.\",\n );\n return;\n }\n } else if (event.type === \"error\") {\n const detail = event.error;\n const message =\n detail && typeof detail === \"object\"\n ? String((detail as { message?: unknown }).message ?? \"\")\n : typeof detail === \"string\"\n ? detail\n : \"\";\n fail(\n message ||\n copy?.errors.sessionFailed ||\n \"The realtime voice session encountered an error.\",\n );\n return;\n }\n\n const calls = extractRealtimeVoiceFunctionCalls(event);\n for (const call of calls) void handleFunctionCall(call);\n if (event.type === \"response.done\" && calls.length === 0) {\n transition(\"listening\");\n }\n },\n [copy, fail, handleFunctionCall, syncAppState, transition],\n );\n\n const start = useCallback(async () => {\n if (stateRef.current !== \"idle\") return;\n if (\n typeof RTCPeerConnection === \"undefined\" ||\n !navigator.mediaDevices?.getUserMedia\n ) {\n fail(\n copy?.errors.unsupported ??\n \"This browser does not support realtime voice conversations.\",\n );\n return;\n }\n setError(null);\n startedAtRef.current = new Date().toISOString();\n lastUserTextRef.current = \"\";\n lastAssistantTextRef.current = \"\";\n sessionIdRef.current = undefined;\n transition(\"connecting\");\n setChatVisible(false);\n window.dispatchEvent(new Event(\"agent-panel:close\"));\n\n const abortController = new AbortController();\n abortRef.current = abortController;\n try {\n const stream = await navigator.mediaDevices.getUserMedia({\n audio: {\n echoCancellation: true,\n noiseSuppression: true,\n autoGainControl: true,\n },\n });\n streamRef.current = stream;\n\n const peer = new RTCPeerConnection();\n peerRef.current = peer;\n for (const track of stream.getAudioTracks()) peer.addTrack(track, stream);\n\n const audio = document.createElement(\"audio\");\n audio.autoplay = true;\n audio.setAttribute(\"playsinline\", \"\");\n audioRef.current = audio;\n peer.ontrack = (trackEvent) => {\n audio.srcObject = trackEvent.streams[0] ?? null;\n void audio.play().catch(() => undefined);\n };\n\n const channel = peer.createDataChannel(\"oai-events\");\n channelRef.current = channel;\n channel.onopen = () => transition(\"listening\");\n channel.onmessage = (messageEvent) => {\n try {\n handleServerEvent(JSON.parse(String(messageEvent.data)));\n } catch {\n // Ignore malformed provider events without ending a healthy call.\n }\n };\n channel.onerror = () =>\n fail(\n copy?.errors.channelDisconnected ??\n \"The realtime voice control channel disconnected.\",\n );\n peer.onconnectionstatechange = () => {\n if (peer.connectionState === \"connected\") transition(\"listening\");\n if (peer.connectionState === \"failed\") {\n fail(\n copy?.errors.connectionFailed ??\n \"The realtime voice connection failed.\",\n );\n }\n };\n\n const offer = await peer.createOffer();\n await peer.setLocalDescription(offer);\n if (!offer.sdp) {\n throw new Error(\n copy?.errors.offerFailed ??\n \"The browser did not create an audio offer.\",\n );\n }\n const answerSdp = await createRealtimeVoiceSession(offer.sdp, {\n browserTabId,\n signal: abortController.signal,\n });\n await peer.setRemoteDescription({ type: \"answer\", sdp: answerSdp });\n } catch (startError) {\n const status = (startError as { status?: unknown })?.status;\n fail(errorMessage(startError), { openKeySettings: status === 400 });\n }\n }, [browserTabId, copy, fail, handleServerEvent, transition]);\n\n const end = useCallback(() => {\n if (stateRef.current === \"idle\" || stateRef.current === \"ending\") return;\n transition(\"ending\");\n cleanupTransport();\n setError(null);\n sessionIdRef.current = undefined;\n startedAtRef.current = undefined;\n transition(\"idle\");\n }, [cleanupTransport, transition]);\n\n const toggleChat = useCallback(() => {\n setChatVisible((current) => !current);\n window.dispatchEvent(new Event(\"agent-panel:toggle\"));\n }, []);\n\n useEffect(() => {\n const onSidebarState = (event: Event) => {\n const detail = (event as CustomEvent<AgentSidebarStateChangeDetail>)\n .detail;\n if (detail && typeof detail.open === \"boolean\") {\n setChatVisible(detail.open);\n }\n };\n window.addEventListener(SIDEBAR_STATE_CHANGE_EVENT, onSidebarState);\n return () =>\n window.removeEventListener(SIDEBAR_STATE_CHANGE_EVENT, onSidebarState);\n }, []);\n\n useEffect(() => cleanupTransport, [cleanupTransport]);\n\n return {\n state,\n active: state !== \"idle\",\n errorMessage: error,\n chatVisible,\n start,\n end,\n toggleChat,\n };\n}\n\nconst RealtimeVoiceModeContext = createContext<RealtimeVoiceModeApi | null>(\n null,\n);\n\nexport function RealtimeVoiceModeProvider({\n children,\n browserTabId,\n}: RealtimeVoiceModeProviderProps) {\n const resolvedBrowserTabId = useMemo(\n () => browserTabId ?? getBrowserTabId(),\n [browserTabId],\n );\n const copy = useRealtimeVoiceModeCopy();\n const voice = useRealtimeVoiceModeController(resolvedBrowserTabId, copy);\n\n return (\n <RealtimeVoiceModeContext.Provider value={voice}>\n {children}\n {voice.active && typeof document !== \"undefined\"\n ? createPortal(\n <RealtimeVoiceModeDock\n state={voice.state === \"idle\" ? \"ending\" : voice.state}\n copy={copy}\n chatVisible={voice.chatVisible}\n onToggleChat={voice.toggleChat}\n onEndVoiceMode={voice.end}\n errorMessage={voice.errorMessage}\n className=\"z-[270]\"\n />,\n document.body,\n )\n : null}\n </RealtimeVoiceModeContext.Provider>\n );\n}\n\n/**\n * Ensure standalone/full-page composers get realtime voice without nesting a\n * second session owner inside the persistent AgentSidebar provider.\n */\nexport function RealtimeVoiceModeBoundary({\n children,\n browserTabId,\n}: RealtimeVoiceModeProviderProps) {\n const existing = useRealtimeVoiceModeOptional();\n if (existing) {\n return (\n <RealtimeVoiceModeComposerSurface>\n {children}\n </RealtimeVoiceModeComposerSurface>\n );\n }\n return (\n <RealtimeVoiceModeProvider browserTabId={browserTabId}>\n <RealtimeVoiceModeComposerSurface>\n {children}\n </RealtimeVoiceModeComposerSurface>\n </RealtimeVoiceModeProvider>\n );\n}\n\n/** Hide a composer while voice owns input; the dock can reveal it on demand. */\nfunction RealtimeVoiceModeComposerSurface({\n children,\n}: Pick<RealtimeVoiceModeProviderProps, \"children\">) {\n const voice = useRealtimeVoiceModeOptional();\n if (voice?.active && !voice.chatVisible) return null;\n return children;\n}\n\nexport function useRealtimeVoiceMode(): RealtimeVoiceModeApi {\n const value = useContext(RealtimeVoiceModeContext);\n if (!value) {\n throw new Error(\n \"useRealtimeVoiceMode must be used inside RealtimeVoiceModeProvider.\",\n );\n }\n return value;\n}\n\nexport function useRealtimeVoiceModeOptional(): RealtimeVoiceModeApi | null {\n return useContext(RealtimeVoiceModeContext);\n}\n\nexport async function readRealtimeVoiceContext(): Promise<{\n navigation: unknown;\n url: unknown;\n}> {\n const [navigation, url] = await Promise.all([\n readClientAppState(\"navigation\").catch(() => null),\n readClientAppState(\"__url__\").catch(() => null),\n ]);\n return { navigation, url };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guided-questions.d.ts","sourceRoot":"","sources":["../../src/client/guided-questions.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"guided-questions.d.ts","sourceRoot":"","sources":["../../src/client/guided-questions.tsx"],"names":[],"mappings":"AAeA,MAAM,MAAM,kBAAkB,GAC1B,cAAc,GACd,eAAe,GACf,QAAQ,GACR,MAAM,GACN,UAAU,CAAC;AAEf,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;oEAEgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MA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AM,IAAI,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAA2B,EAC3B,WAAsE,EACtE,SAAkB,EAClB,WAAwB,EACxB,SAAS,GACV,EAAE,uBAAuB,+BA8FzB;AA4ZD,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE;QAC1B,OAAO,EAAE,qBAAqB,CAAC;QAC/B,gBAAgB,EAAE,MAAM,CAAC;KAC1B,KAAK,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,MAAM,MAAM,CAAC;CACjC;AAED,wBAAgB,qBAAqB,CAAC,EACpC,QAA2B,EAC3B,YAAY,EACZ,QAA6B,EAC7B,eAAuB,EACvB,aAAiD,EACjD,WAAmD,EACnD,kBAAkB,EAClB,gBAAgB,GACjB,GAAE,4BAAiC;;;;;;;;4BAqGtB,qBAAqB;;EAmDlC"}
|
|
@@ -5,6 +5,7 @@ import { useCallback, useEffect, useMemo, useState } from "react";
|
|
|
5
5
|
import { sendToAgentChat } from "./agent-chat.js";
|
|
6
6
|
import { agentNativePath } from "./api-path.js";
|
|
7
7
|
import { setClientAppState } from "./application-state.js";
|
|
8
|
+
import { useChangeVersions } from "./use-change-version.js";
|
|
8
9
|
import { cn } from "./utils.js";
|
|
9
10
|
const OTHER_OPTION_PREFIX = "__other__:";
|
|
10
11
|
const EXPLORE_OPTION = {
|
|
@@ -406,7 +407,7 @@ function normalizeBrowserTabId(browserTabId) {
|
|
|
406
407
|
const trimmed = browserTabId.trim();
|
|
407
408
|
return SAFE_BROWSER_TAB_ID_RE.test(trimmed) ? trimmed : undefined;
|
|
408
409
|
}
|
|
409
|
-
export function useGuidedQuestionFlow({ stateKey = "show-questions", browserTabId, queryKey = ["show-questions"], refetchInterval =
|
|
410
|
+
export function useGuidedQuestionFlow({ stateKey = "show-questions", browserTabId, queryKey = ["show-questions"], refetchInterval = false, submitMessage = "Here are my answers — go ahead.", skipMessage = "Skip the questions — decide for me.", buildSubmitContext, buildSkipContext, } = {}) {
|
|
410
411
|
const queryClient = useQueryClient();
|
|
411
412
|
const [payload, setPayload] = useState(null);
|
|
412
413
|
const normalizedBrowserTabId = useMemo(() => normalizeBrowserTabId(browserTabId), [browserTabId]);
|
|
@@ -414,9 +415,13 @@ export function useGuidedQuestionFlow({ stateKey = "show-questions", browserTabI
|
|
|
414
415
|
const scopedKey = normalizedBrowserTabId
|
|
415
416
|
? `${stateKey}:${normalizedBrowserTabId}`
|
|
416
417
|
: stateKey;
|
|
418
|
+
const stateVersionSources = useMemo(() => normalizedBrowserTabId
|
|
419
|
+
? [`app-state:${scopedKey}`, `app-state:${stateKey}`]
|
|
420
|
+
: [`app-state:${stateKey}`], [normalizedBrowserTabId, scopedKey, stateKey]);
|
|
421
|
+
const stateVersion = useChangeVersions(stateVersionSources);
|
|
417
422
|
// Match the queryKey to the scope so two tabs polling different scoped keys
|
|
418
423
|
// don't share a cache entry.
|
|
419
|
-
const resolvedQueryKey = useMemo(() => [...queryKey, normalizedBrowserTabId ?? "global"], [queryKey, normalizedBrowserTabId]);
|
|
424
|
+
const resolvedQueryKey = useMemo(() => [...queryKey, normalizedBrowserTabId ?? "global", stateVersion], [queryKey, normalizedBrowserTabId, stateVersion]);
|
|
420
425
|
const resolvedRefetchInterval = refetchInterval === false
|
|
421
426
|
? false
|
|
422
427
|
: (query) => {
|