@xopcai/xopc 0.0.242 → 0.0.244
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/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-MU5XrVv8.js → activity-store-CAah-_8h.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-B_Wc0wuL.js → agent-avatar-dicebear-BhXGsupm.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Blzn2H6t.js +1 -0
- package/dist/gateway/static/root/assets/agents-Cmp-z8Y_.js +1 -0
- package/dist/gateway/static/root/assets/{api-DLyc8BQp.js → api-B2tKxbcz.js} +1 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-CezjAP1K.js +1 -0
- package/dist/gateway/static/root/assets/{appearance-settings-DB5gEQhN.js → appearance-settings-C-CfS05x.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-7Y13_bqZ.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BOx0EJZs.js → archive-plugin-BmSx7wzY.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CYnYIyLr.js → attachment-load-DI4CoIga.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-ChTflpmA.js → automations-page-D04Xceck.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-wEO1OWk0.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BjbLfNwG.js → binary-plugins-BJQe8TRu.js} +1 -1
- package/dist/gateway/static/root/assets/block-editor-BSzGjJC6.js +185 -0
- package/dist/gateway/static/root/assets/browser-settings-page-DjAZ_LF2.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-DGQxD0vD.js → browser-workflow-inputs-CRnkgZHI.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-B9gfdd7L.js → browser-workflows-page-CwbxA3B7.js} +2 -2
- package/dist/gateway/static/root/assets/{button-CSEbl4zT.js → button-CtTvuElV.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-jt9bqUMK.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-Cz_TWY3a.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-TkU42f-W.js → channels-status-swr-DuY4MGxe.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CWMPcnoN.js → chat-terminal-dock-D3gj2D3U.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-Shs5vbzx.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-3h3rR0cf.js → cron-expression-DgWHw0jX.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-Bz1sLBEx.js → date-picker-CKg-RPbs.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-p9DWR8uU.js → dependency-picker-CVYkw-NN.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-D1TDB_gR.js → desktop-pet-Bf46oXTY.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DWPZpoB7.js → desktop-pet-settings-BJO_klc7.js} +1 -1
- package/dist/gateway/static/root/assets/dist-CpzYSoz7.js +1 -0
- package/dist/gateway/static/root/assets/{dist-DaxPZj9e.js → dist-DBS3OB8K.js} +1 -1
- package/dist/gateway/static/root/assets/dist-DLmwHyAh.js +1 -0
- package/dist/gateway/static/root/assets/es2015-BvLh9GaE.js +41 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BrRbK2rJ.js → extension-debug-page-T2PmFFOW.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CD65czfS.js → extension-page-2wAE2RCe.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BRDDKhpi.js → extension-settings-page-Y9ZiCJ21.js} +1 -1
- package/dist/gateway/static/root/assets/{files-DQjhZjr2.js → files-D6vf3S30.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-CjbBsr5M.js → gateway-config-api-DaYY1Gkn.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-HT7sLeO9.js → gateway-config-swr-BC3pgb_P.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BQjmfYD4.js → gateway-settings-eO3IzW_J.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-iBCtaAuT.js → gateway-startup-retry-uMcSfLru.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-BzZxLgrw.js → heartbeat-settings-BAgrkyHc.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-GTjKH7LK.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-dj9TNEn2.js → image-generation-api-D1qlQA-A.js} +1 -1
- package/dist/gateway/static/root/assets/index-DUz0O54y.js +71 -0
- package/dist/gateway/static/root/assets/index-Dbh5SXyV.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BEnuEPD3.js → keyboard-shortcuts-settings-CWGqL6o5.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DKJ-rks0.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DXQtppWq.js → local-apps-page-Bfidv29d.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DVzTJSj2.js → locale-store-CMZljTJx.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DwAHrPbF.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-DIpBMWrA.js → management-settings-BG7j1I9f.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-BFHyGwNF.js → markdown-split-AnmmpLs6.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DR3yVwtV.js → markdown-view-PPCLt7fu.js} +3 -3
- package/dist/gateway/static/root/assets/{media-plugins-BjjMxC5_.js → media-plugins-CGS-05cE.js} +1 -1
- package/dist/gateway/static/root/assets/messages-CTSgFlE4.js +3 -0
- package/dist/gateway/static/root/assets/mobile-pairing-wizard-DoKK5GfV.js +1 -0
- package/dist/gateway/static/root/assets/models-hub-cache-ZrbGRiGY.js +1 -0
- package/dist/gateway/static/root/assets/{notes-page-BbvtelJa.js → notes-page-Lr8rsFAR.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-ISWnKLxO.js +4 -0
- package/dist/gateway/static/root/assets/{oauth-api-BB-VYJ5j.js → oauth-api-4VeMbkTJ.js} +1 -1
- package/dist/gateway/static/root/assets/popover-select-C-Hj-nXR.js +1 -0
- package/dist/gateway/static/root/assets/{product-delivery-dUJgmBQZ.js → product-delivery-CV4pDOtG.js} +1 -1
- package/dist/gateway/static/root/assets/product-open-page-BU0HiZtv.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-BZqr4yam.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-Dau8733A.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-DXsR8oGN.js → registry-api-CWOtPFrE.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DdChlvGP.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DoEfLjPB.js → runtime-tools-settings-panel-CmZTNv1W.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-BsqpbBDv.js → schema-form-XlVPyiVQ.js} +1 -1
- package/dist/gateway/static/root/assets/{schemas-zIBW3wiV.js → schemas-BHS7bo06.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-C3kADsd4.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CSYy6SUa.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-CE7ZcCTK.js → settings-page-DblUeM3V.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-CGlne9i0.js → setup-status-panel-bDfRfSnq.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Bn0qMX8V.js → share-preview-page-DBMWFMN-.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Bu6lIStj.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-BNMc4l04.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-dRkeYh5P.js → skills-page-CSOseeQe.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page.utils-CniRGhkJ.js +1 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-C0ZCuCM4.js → system-settings-panel-D0GqNpKy.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-BRCq-nR7.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-Cth-eChE.js → theme-store-uxUwr10D.js} +1 -1
- package/dist/gateway/static/root/assets/tunnel-api-BtjS2nrM.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-PSV89QuQ.js → use-autosave-TwuAycG8.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-CbqPu8xZ.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DXWdJ8cR.js → voice-api-key-field-CzwG5plu.js} +1 -1
- package/dist/gateway/static/root/assets/voice-config-api-MqyI6cgq.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-overlay-DS15FzQA.js +1 -0
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-C_boCemi.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-CaI2ruyy.js +5 -0
- package/dist/gateway/static/root/index.html +21 -22
- package/dist/package.js +1 -1
- package/dist/packages/realtime-protocol/src/voice-audio.js +20 -0
- package/dist/packages/realtime-protocol/src/voice.js +208 -0
- package/dist/src/agent/agent-manager.js +4 -4
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.d.ts +1 -0
- package/dist/src/agent/embedded/run-for-session.js +3 -2
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +1 -0
- package/dist/src/agent/inbound/turn-dispatcher.js +2 -1
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/prompt/voice-presentation.d.ts +2 -0
- package/dist/src/agent/prompt/voice-presentation.js +12 -0
- package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -0
- package/dist/src/agent/service/direct-turn-helpers.js +1 -0
- package/dist/src/agent/service/process-direct-streaming.d.ts +1 -0
- package/dist/src/agent/service/process-direct-streaming.js +2 -1
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-config-service.js +4 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/cli/commands/agent.js +2 -2
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/profile.js +1 -1
- package/dist/src/cli/commands/tunnel.js +1 -1
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.d.ts +8 -8
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +60 -0
- package/dist/src/config/schema.js +31 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/files/file-service.d.ts +1 -0
- package/dist/src/files/file-service.js +4 -0
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/chat-stream/thinking-delta-coalescer.js +8 -3
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -11
- package/dist/src/gateway/hono/lib/config-payload.js +3 -3
- package/dist/src/gateway/hono/lib/safe-voice-config.d.ts +14 -0
- package/dist/src/gateway/hono/lib/safe-voice-config.js +29 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/connectors.js +23 -23
- package/dist/src/gateway/hono/routes/files.js +7 -0
- package/dist/src/gateway/hono/routes/lazy-fallback.js +18 -4
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/session-input-handler.js +14 -0
- package/dist/src/gateway/hono/routes/sessions.js +3 -0
- package/dist/src/gateway/hono/routes/voice.js +139 -2
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/server.js +1 -0
- package/dist/src/gateway/service/agent-runner.d.ts +1 -0
- package/dist/src/gateway/service/agent-runner.js +1 -6
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.d.ts +1 -0
- package/dist/src/gateway/service/run-gateway-agent.js +19 -1
- package/dist/src/gateway/service.d.ts +2 -0
- package/dist/src/gateway/service.js +78 -5
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/media-understanding/types.d.ts +61 -0
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/session/client-history.js +12 -0
- package/dist/src/session/manager.d.ts +1 -0
- package/dist/src/session/session-context-for-llm.js +8 -0
- package/dist/src/session/store.d.ts +1 -0
- package/dist/src/session/store.js +1 -0
- package/dist/src/session/stored-rows-to-file-entries.js +5 -1
- package/dist/src/session/voice-transcript.d.ts +9 -0
- package/dist/src/session/voice-transcript.js +45 -0
- package/dist/src/share/hosted-session-share.js +1 -1
- package/dist/src/storage/sqlite/config-repository.js +9 -0
- package/dist/src/storage/sqlite/remote-context-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/remote-context-repository.js +40 -0
- package/dist/src/storage/sqlite/session-repository.js +13 -0
- package/dist/src/storage/sqlite/user-context-repository.d.ts +3 -1
- package/dist/src/storage/sqlite/user-context-repository.js +50 -4
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +3 -2
- package/dist/src/user-context/automatic-context.d.ts +17 -0
- package/dist/src/user-context/automatic-context.js +85 -0
- package/dist/src/user-context/changes.d.ts +7 -0
- package/dist/src/user-context/changes.js +28 -0
- package/dist/src/user-context/planner.js +1 -24
- package/dist/src/user-context/retriever.js +10 -11
- package/dist/src/user-context/selection-policy.d.ts +20 -0
- package/dist/src/user-context/selection-policy.js +33 -0
- package/dist/src/user-context/sources/index.js +2 -2
- package/dist/src/user-context/sources/repository.d.ts +2 -1
- package/dist/src/user-context/sources/repository.js +26 -5
- package/dist/src/voice/dashscope/streaming-stt-session.d.ts +2 -0
- package/dist/src/voice/dashscope/streaming-stt-session.js +249 -0
- package/dist/src/voice/dashscope/streaming-tts-stream.d.ts +12 -0
- package/dist/src/voice/dashscope/streaming-tts-stream.js +153 -0
- package/dist/src/voice/realtime/agentEngine.d.ts +10 -0
- package/dist/src/voice/realtime/agentEngine.js +403 -0
- package/dist/src/voice/realtime/audio-playback-window.d.ts +9 -0
- package/dist/src/voice/realtime/audio-playback-window.js +49 -0
- package/dist/src/voice/realtime/conversation-context.d.ts +11 -0
- package/dist/src/voice/realtime/conversation-context.js +76 -0
- package/dist/src/voice/realtime/engine.d.ts +13 -0
- package/dist/src/voice/realtime/engine.js +1 -0
- package/dist/src/voice/realtime/memory-context.d.ts +17 -0
- package/dist/src/voice/realtime/memory-context.js +100 -0
- package/dist/src/voice/realtime/omniEngine.d.ts +18 -0
- package/dist/src/voice/realtime/omniEngine.js +443 -0
- package/dist/src/voice/realtime/omniRoute.d.ts +10 -0
- package/dist/src/voice/realtime/omniRoute.js +31 -0
- package/dist/src/voice/realtime/runtime.d.ts +99 -0
- package/dist/src/voice/realtime/runtime.js +622 -0
- package/dist/src/voice/realtime/speakable-segmenter.d.ts +10 -0
- package/dist/src/voice/realtime/speakable-segmenter.js +87 -0
- package/dist/src/voice/stt/list-providers.js +2 -1
- package/dist/src/voice/stt/providers/alibaba-transcription.js +13 -1
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +23 -0
- package/dist/src/voice/tts/factory.js +1 -0
- package/dist/src/voice/tts/openai-compatible-speech.js +3 -1
- package/dist/src/voice/tts/providers/alibaba-speech.d.ts +1 -5
- package/dist/src/voice/tts/providers/alibaba-speech.js +25 -8
- package/dist/src/voice/tts/providers/edge-speech.js +21 -22
- package/dist/src/voice/tts/providers/minimax-speech.js +6 -3
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +26 -1
- package/dist/src/voice/tts/speak-core.d.ts +6 -2
- package/dist/src/voice/tts/speak-core.js +46 -34
- package/dist/src/voice/tts/speech-provider-types.d.ts +1 -0
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +7 -7
- package/dist/gateway/static/root/assets/Combination-14nmIgxH.js +0 -41
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Cf7U2aUi.js +0 -1
- package/dist/gateway/static/root/assets/agents-Ce9oOnwE.js +0 -1
- package/dist/gateway/static/root/assets/app-chrome-BeB4KgOf.js +0 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-CACOOS-a.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BaTFOCmR.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-DK6EreCr.js +0 -6
- package/dist/gateway/static/root/assets/block-editor-DgAs5aJc.js +0 -184
- package/dist/gateway/static/root/assets/browser-settings-page-CHStw5UW.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-JGH6Kfkr.js +0 -7
- package/dist/gateway/static/root/assets/channels-settings-YkUaaWkY.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BI0FG3gA.js +0 -2
- package/dist/gateway/static/root/assets/dist-BPoKqzeH.js +0 -1
- package/dist/gateway/static/root/assets/dist-DqPZM2MH.js +0 -1
- package/dist/gateway/static/root/assets/home-page--9fKq0mL.js +0 -1
- package/dist/gateway/static/root/assets/index-D499B1qS.css +0 -2
- package/dist/gateway/static/root/assets/index-J3FsIvTs.js +0 -70
- package/dist/gateway/static/root/assets/local-app-workbench-page-FqG00zS1.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-c6CfZ8PA.js +0 -2
- package/dist/gateway/static/root/assets/messages-_tYhRAHD.js +0 -3
- package/dist/gateway/static/root/assets/mobile-pairing-wizard-CHnXZTwb.js +0 -1
- package/dist/gateway/static/root/assets/models-hub-cache-DiXjKuuY.js +0 -1
- package/dist/gateway/static/root/assets/notes-workbench-DIR37b-K.js +0 -4
- package/dist/gateway/static/root/assets/popover-select-DrILF6mR.js +0 -1
- package/dist/gateway/static/root/assets/product-open-page-CRm9Q66h.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-DHiLTiRW.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-God7NCcI.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-YpF0-mx2.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-CP8O1TxR.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DzdbK3j9.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-B7NeVl4g.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DDTmi4a7.js +0 -1
- package/dist/gateway/static/root/assets/skills-page.utils--q8p7MAn.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-yiMzii2b.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-CC3jOB4n.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-Vtwg7fQc.js +0 -1
- package/dist/gateway/static/root/assets/voice-config-api-BDoeXgww.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-BV_Jj5iD.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-DNHbWGPq.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-BkFIbMrz.js +0 -5
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region packages/realtime-protocol/src/voice-audio.ts
|
|
2
|
+
const HEADER_BYTES = 12;
|
|
3
|
+
const MAGIC = 1481592882;
|
|
4
|
+
const MAX_FRAME_BYTES = 64 * 1024;
|
|
5
|
+
const encoder = new TextEncoder();
|
|
6
|
+
new TextDecoder("utf-8", { fatal: true });
|
|
7
|
+
function encodeVoiceAudioFrame(frame) {
|
|
8
|
+
const id = encoder.encode(frame.responseId);
|
|
9
|
+
if (!id.length || id.length > 160 || !Number.isInteger(frame.seq) || frame.seq < 1 || frame.seq > 4294967295 || !frame.audio.length || frame.audio.length % 2 || HEADER_BYTES + id.length + frame.audio.length > MAX_FRAME_BYTES) throw new Error("Invalid voice audio frame");
|
|
10
|
+
const bytes = new Uint8Array(HEADER_BYTES + id.length + frame.audio.length);
|
|
11
|
+
const header = new DataView(bytes.buffer);
|
|
12
|
+
header.setUint32(0, MAGIC);
|
|
13
|
+
header.setUint32(4, frame.seq);
|
|
14
|
+
header.setUint32(8, id.length);
|
|
15
|
+
bytes.set(id, HEADER_BYTES);
|
|
16
|
+
bytes.set(frame.audio, HEADER_BYTES + id.length);
|
|
17
|
+
return bytes;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { encodeVoiceAudioFrame };
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import "./voice-audio.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
const VOICE_REALTIME_WS_PATH = "/api/voice/realtime/v2/ws";
|
|
4
|
+
const VOICE_REALTIME_MAX_BINARY_FRAME_BYTES = 64 * 1024;
|
|
5
|
+
const VOICE_REALTIME_START_TIMEOUT_MS = 1e4;
|
|
6
|
+
const VOICE_REALTIME_HEARTBEAT_INTERVAL_MS = 15e3;
|
|
7
|
+
const idSchema = z.uuid();
|
|
8
|
+
const timestampSchema = z.number().int().nonnegative();
|
|
9
|
+
const voicePurposeSchema = z.enum(["dictation", "conversation"]);
|
|
10
|
+
const voiceEngineSchema = z.enum(["agent", "omni"]);
|
|
11
|
+
const voiceInputModeSchema = z.literal("server_vad");
|
|
12
|
+
const voiceLanguageSchema = z.enum(["zh", "en"]);
|
|
13
|
+
const voicePcmFormatSchema = z.strictObject({
|
|
14
|
+
encoding: z.literal("pcm_s16le"),
|
|
15
|
+
sampleRate: z.union([z.literal(16e3), z.literal(24e3)]),
|
|
16
|
+
channels: z.literal(1)
|
|
17
|
+
});
|
|
18
|
+
const voiceProviderRouteSchema = z.strictObject({
|
|
19
|
+
provider: z.string().min(1).max(100),
|
|
20
|
+
model: z.string().min(1).max(200),
|
|
21
|
+
managed: z.boolean()
|
|
22
|
+
});
|
|
23
|
+
const voiceRouteSchema = z.discriminatedUnion("engine", [
|
|
24
|
+
z.strictObject({
|
|
25
|
+
engine: z.literal("dictation"),
|
|
26
|
+
stt: voiceProviderRouteSchema
|
|
27
|
+
}),
|
|
28
|
+
z.strictObject({
|
|
29
|
+
engine: z.literal("agent"),
|
|
30
|
+
stt: voiceProviderRouteSchema,
|
|
31
|
+
tts: voiceProviderRouteSchema
|
|
32
|
+
}),
|
|
33
|
+
z.strictObject({
|
|
34
|
+
engine: z.literal("omni"),
|
|
35
|
+
omni: voiceProviderRouteSchema
|
|
36
|
+
})
|
|
37
|
+
]);
|
|
38
|
+
const availabilitySchema = z.strictObject({
|
|
39
|
+
available: z.boolean(),
|
|
40
|
+
reasonCode: z.enum(["VOICE_DISABLED", "PROVIDER_UNAVAILABLE"]).optional()
|
|
41
|
+
});
|
|
42
|
+
z.object({
|
|
43
|
+
enabled: z.boolean(),
|
|
44
|
+
defaultEngine: voiceEngineSchema,
|
|
45
|
+
omni: voiceProviderRouteSchema.nullable(),
|
|
46
|
+
stt: voiceProviderRouteSchema.nullable(),
|
|
47
|
+
tts: voiceProviderRouteSchema.extend({ voice: z.string().optional() }).nullable(),
|
|
48
|
+
capabilities: z.strictObject({
|
|
49
|
+
dictation: availabilitySchema,
|
|
50
|
+
agent: availabilitySchema,
|
|
51
|
+
omni: availabilitySchema,
|
|
52
|
+
languages: z.array(voiceLanguageSchema),
|
|
53
|
+
bargeIn: z.boolean()
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
const createVoiceSessionRequestSchema = z.strictObject({
|
|
57
|
+
purpose: voicePurposeSchema,
|
|
58
|
+
engine: voiceEngineSchema.optional(),
|
|
59
|
+
sessionKey: z.string().min(1).max(512).optional(),
|
|
60
|
+
language: voiceLanguageSchema.optional()
|
|
61
|
+
}).superRefine((value, context) => {
|
|
62
|
+
if (value.purpose === "conversation" && !value.sessionKey) context.addIssue({
|
|
63
|
+
code: "custom",
|
|
64
|
+
path: ["sessionKey"],
|
|
65
|
+
message: "sessionKey is required for conversation"
|
|
66
|
+
});
|
|
67
|
+
if (value.purpose !== "conversation" && value.engine !== void 0) context.addIssue({
|
|
68
|
+
code: "custom",
|
|
69
|
+
path: ["engine"],
|
|
70
|
+
message: "engine is only supported for conversation"
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
z.strictObject({
|
|
74
|
+
sessionId: idSchema,
|
|
75
|
+
ticket: z.string().min(32).max(512),
|
|
76
|
+
ticketExpiresAt: z.iso.datetime(),
|
|
77
|
+
websocketPath: z.literal(VOICE_REALTIME_WS_PATH),
|
|
78
|
+
protocolVersion: z.literal(2),
|
|
79
|
+
purpose: voicePurposeSchema,
|
|
80
|
+
inputMode: voiceInputModeSchema,
|
|
81
|
+
bargeIn: z.boolean(),
|
|
82
|
+
inputFormat: voicePcmFormatSchema,
|
|
83
|
+
limits: z.strictObject({
|
|
84
|
+
maxBinaryFrameBytes: z.literal(VOICE_REALTIME_MAX_BINARY_FRAME_BYTES),
|
|
85
|
+
maxSessionMs: z.number().int().positive(),
|
|
86
|
+
idleTimeoutMs: z.number().int().positive()
|
|
87
|
+
}),
|
|
88
|
+
route: voiceRouteSchema
|
|
89
|
+
});
|
|
90
|
+
const clientEnvelope = (type, payload) => z.strictObject({
|
|
91
|
+
protocolVersion: z.literal(2),
|
|
92
|
+
messageId: idSchema,
|
|
93
|
+
type: z.literal(type),
|
|
94
|
+
sentAt: timestampSchema,
|
|
95
|
+
payload
|
|
96
|
+
});
|
|
97
|
+
const voiceClientMessageSchema = z.discriminatedUnion("type", [
|
|
98
|
+
clientEnvelope("session.start", z.strictObject({
|
|
99
|
+
sessionId: idSchema,
|
|
100
|
+
ticket: z.string().min(32).max(512)
|
|
101
|
+
})),
|
|
102
|
+
clientEnvelope("session.metric", z.strictObject({
|
|
103
|
+
responseId: z.string().min(1).max(160),
|
|
104
|
+
metric: z.enum(["speech_end_to_audio_received", "local_stop"]),
|
|
105
|
+
durationMs: z.number().finite().min(0).max(6e5)
|
|
106
|
+
})),
|
|
107
|
+
clientEnvelope("input.mute", z.strictObject({ muted: z.boolean() })),
|
|
108
|
+
clientEnvelope("input.commit", z.strictObject({})),
|
|
109
|
+
clientEnvelope("response.cancel", z.strictObject({ responseId: z.string().min(1).max(160) })),
|
|
110
|
+
clientEnvelope("response.audio.played", z.strictObject({
|
|
111
|
+
responseId: z.string().min(1).max(160),
|
|
112
|
+
playedBytes: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).multipleOf(2)
|
|
113
|
+
})),
|
|
114
|
+
clientEnvelope("session.stop", z.strictObject({ reason: z.enum([
|
|
115
|
+
"user_finished",
|
|
116
|
+
"surface_closed",
|
|
117
|
+
"replaced"
|
|
118
|
+
]) })),
|
|
119
|
+
clientEnvelope("session.ping", z.strictObject({}))
|
|
120
|
+
]);
|
|
121
|
+
const transcriptPayloadSchema = z.strictObject({
|
|
122
|
+
utteranceId: z.string().min(1).max(160),
|
|
123
|
+
revision: z.number().int().positive(),
|
|
124
|
+
text: z.string().max(32 * 1024),
|
|
125
|
+
language: voiceLanguageSchema.optional()
|
|
126
|
+
});
|
|
127
|
+
const serverEnvelope = (type, payload) => z.strictObject({
|
|
128
|
+
protocolVersion: z.literal(2),
|
|
129
|
+
eventId: idSchema,
|
|
130
|
+
seq: z.number().int().positive(),
|
|
131
|
+
type: z.literal(type),
|
|
132
|
+
sentAt: timestampSchema,
|
|
133
|
+
sessionId: idSchema,
|
|
134
|
+
payload
|
|
135
|
+
});
|
|
136
|
+
z.discriminatedUnion("type", [
|
|
137
|
+
serverEnvelope("session.ready", z.strictObject({
|
|
138
|
+
purpose: voicePurposeSchema,
|
|
139
|
+
inputMode: voiceInputModeSchema,
|
|
140
|
+
inputFormat: voicePcmFormatSchema,
|
|
141
|
+
route: voiceRouteSchema,
|
|
142
|
+
heartbeatIntervalMs: z.literal(VOICE_REALTIME_HEARTBEAT_INTERVAL_MS)
|
|
143
|
+
})),
|
|
144
|
+
serverEnvelope("input.speech_started", z.strictObject({ utteranceId: z.string().min(1).max(160) })),
|
|
145
|
+
serverEnvelope("input.speech_stopped", z.strictObject({ utteranceId: z.string().min(1).max(160) })),
|
|
146
|
+
serverEnvelope("input.transcript.delta", transcriptPayloadSchema),
|
|
147
|
+
serverEnvelope("input.transcript.final", transcriptPayloadSchema),
|
|
148
|
+
serverEnvelope("response.created", z.strictObject({ responseId: z.string().min(1).max(160) })),
|
|
149
|
+
serverEnvelope("response.activity", z.strictObject({
|
|
150
|
+
responseId: z.string().min(1).max(160),
|
|
151
|
+
toolCallId: z.string().min(1).max(160),
|
|
152
|
+
toolName: z.string().min(1).max(256),
|
|
153
|
+
status: z.enum([
|
|
154
|
+
"running",
|
|
155
|
+
"completed",
|
|
156
|
+
"failed"
|
|
157
|
+
])
|
|
158
|
+
})),
|
|
159
|
+
serverEnvelope("response.clarification", z.strictObject({
|
|
160
|
+
responseId: z.string().min(1).max(160),
|
|
161
|
+
requestId: z.string().min(1).max(160),
|
|
162
|
+
question: z.string().min(1).max(8e3),
|
|
163
|
+
choices: z.array(z.string().max(1e3)).max(20).optional()
|
|
164
|
+
})),
|
|
165
|
+
serverEnvelope("response.text.delta", z.strictObject({
|
|
166
|
+
responseId: z.string().min(1).max(160),
|
|
167
|
+
delta: z.string().max(32 * 1024)
|
|
168
|
+
})),
|
|
169
|
+
serverEnvelope("response.text.done", z.strictObject({ responseId: z.string().min(1).max(160) })),
|
|
170
|
+
serverEnvelope("response.audio.started", z.strictObject({
|
|
171
|
+
responseId: z.string().min(1).max(160),
|
|
172
|
+
format: voicePcmFormatSchema
|
|
173
|
+
})),
|
|
174
|
+
serverEnvelope("response.audio.done", z.strictObject({ responseId: z.string().min(1).max(160) })),
|
|
175
|
+
serverEnvelope("response.done", z.strictObject({
|
|
176
|
+
responseId: z.string().min(1).max(160),
|
|
177
|
+
finishReason: z.enum([
|
|
178
|
+
"completed",
|
|
179
|
+
"text_only",
|
|
180
|
+
"audio_partial"
|
|
181
|
+
]),
|
|
182
|
+
audio: z.boolean()
|
|
183
|
+
})),
|
|
184
|
+
serverEnvelope("response.cancelled", z.strictObject({
|
|
185
|
+
responseId: z.string().min(1).max(160),
|
|
186
|
+
reason: z.enum([
|
|
187
|
+
"barge_in",
|
|
188
|
+
"client_cancelled",
|
|
189
|
+
"session_closed"
|
|
190
|
+
])
|
|
191
|
+
})),
|
|
192
|
+
serverEnvelope("session.pong", z.strictObject({})),
|
|
193
|
+
serverEnvelope("session.error", z.strictObject({
|
|
194
|
+
code: z.string().min(1).max(80),
|
|
195
|
+
message: z.string().min(1).max(500),
|
|
196
|
+
recoverable: z.boolean()
|
|
197
|
+
})),
|
|
198
|
+
serverEnvelope("session.closed", z.strictObject({ reason: z.string().min(1).max(160) }))
|
|
199
|
+
]);
|
|
200
|
+
function parseVoiceClientMessage(value) {
|
|
201
|
+
return voiceClientMessageSchema.parse(value);
|
|
202
|
+
}
|
|
203
|
+
function parseVoiceClientJsonFrame(text) {
|
|
204
|
+
if (new TextEncoder().encode(text).byteLength > 16 * 1024) throw new Error("Voice control frame exceeds 16384 bytes");
|
|
205
|
+
return JSON.parse(text);
|
|
206
|
+
}
|
|
207
|
+
//#endregion
|
|
208
|
+
export { VOICE_REALTIME_HEARTBEAT_INTERVAL_MS, VOICE_REALTIME_MAX_BINARY_FRAME_BYTES, VOICE_REALTIME_START_TIMEOUT_MS, VOICE_REALTIME_WS_PATH, createVoiceSessionRequestSchema, parseVoiceClientJsonFrame, parseVoiceClientMessage };
|
|
@@ -5,16 +5,16 @@ import { getSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
|
5
5
|
import { getSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
6
6
|
import "../storage/sqlite/index.js";
|
|
7
7
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
8
|
+
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
8
9
|
import { expandWorkspacePathString, init_workspace_path } from "../config/workspace-path.js";
|
|
9
10
|
import { init_agent_scope, resolveAgentProfileDir } from "./agent-scope.js";
|
|
10
|
-
import { init_paths, resolveBundledSkillsDir } from "../config/paths.js";
|
|
11
|
-
import { CredentialResolver, init_credentials } from "../auth/credentials.js";
|
|
12
11
|
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
12
|
+
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
13
|
+
import { init_paths, resolveBundledSkillsDir } from "../config/paths.js";
|
|
13
14
|
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../auth/sync-provider-auth.js";
|
|
15
|
+
import { CredentialResolver, init_credentials } from "../auth/credentials.js";
|
|
14
16
|
import { getApiKeySync, getDefaultModelSync, init_providers, resolveModel } from "../providers/index.js";
|
|
15
17
|
import { createExtensionAwareStreamFn } from "../providers/extension-stream-bridge.js";
|
|
16
|
-
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
17
|
-
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
18
18
|
import { extractTextContent } from "./context/workspace.js";
|
|
19
19
|
import { buildExecutionScopeContextForPrompt } from "./context/execution-scope.js";
|
|
20
20
|
import { clearBootstrapSnapshot } from "./bootstrap/bootstrap-cache.js";
|
|
@@ -4,10 +4,10 @@ import { finishContextExtractionRun } from "../../storage/sqlite/context-extract
|
|
|
4
4
|
import { getTurnPersonalization } from "../../storage/sqlite/user-context-repository.js";
|
|
5
5
|
import { loadCompactionSourceSnapshot } from "../../storage/sqlite/transcript-repository.js";
|
|
6
6
|
import "../../storage/sqlite/index.js";
|
|
7
|
+
import { extractProfileAgentId } from "../../config/agent-profile.js";
|
|
7
8
|
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../../auth/sync-provider-auth.js";
|
|
8
9
|
import { getApiKeySync, init_providers, resolveModel } from "../../providers/index.js";
|
|
9
10
|
import { createExtensionAwareStreamFn } from "../../providers/extension-stream-bridge.js";
|
|
10
|
-
import { extractProfileAgentId } from "../../config/agent-profile.js";
|
|
11
11
|
import { extractTextContent } from "../context/workspace.js";
|
|
12
12
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
13
13
|
import { resolveAgentTurnTimeoutMs, runAgentTurnWithTimeout } from "../orchestration/run-agent-turn-with-timeout.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_paths, resolveModelsJsonPath } from "../../config/paths.js";
|
|
2
|
-
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
3
2
|
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../../auth/sync-provider-auth.js";
|
|
3
|
+
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
4
4
|
import { XopcModelCredentialStore, init_model_credential_store } from "../../auth/model-credential-store.js";
|
|
5
5
|
import { init_register_bundled_oauth_flows, registerBundledOAuthFlows } from "../../providers/register-bundled-oauth-flows.js";
|
|
6
6
|
import { init_register_runtime_providers, registerRuntimeProviders } from "../../providers/register-runtime-providers.js";
|
|
@@ -13,6 +13,7 @@ export type RunEmbeddedForSessionParams = {
|
|
|
13
13
|
agentManager: AgentInstanceGateway;
|
|
14
14
|
modelManager: ModelManager;
|
|
15
15
|
thinkingOverride?: string | null;
|
|
16
|
+
presentation?: 'voice';
|
|
16
17
|
abortSignal?: AbortSignal;
|
|
17
18
|
/** Absolute parent deadline. The turn's own timeout is capped to the remaining budget. */
|
|
18
19
|
deadlineAtMs?: number;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { parseTurnOutcome } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
4
|
-
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
5
4
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
|
+
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
6
6
|
import { resolveAgentTurnTimeoutMs } from "../orchestration/run-agent-turn-with-timeout.js";
|
|
7
7
|
import { resolvePromptCachePolicy } from "../../providers/prompt-cache-plan.js";
|
|
8
8
|
import { evaluateContextBudget } from "../memory/context-budget.js";
|
|
9
9
|
import { resolveCompactionPolicy } from "../memory/compaction-policy.js";
|
|
10
10
|
import { projectTurnOutcome } from "../../session/turn-outcome-projector.js";
|
|
11
11
|
import { runXopcEmbeddedTurn } from "./run-turn.js";
|
|
12
|
+
import { voicePresentationPrompt } from "../prompt/voice-presentation.js";
|
|
12
13
|
import { applyStartupContextToUserMessage } from "../reply/apply-turn-user-enrichment.js";
|
|
13
14
|
import { AgentRunSupervisor } from "../orchestration/agent-run-supervisor.js";
|
|
14
15
|
import crypto from "node:crypto";
|
|
@@ -95,7 +96,7 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
95
96
|
agentManager.setModelForSession(sessionKey, modelRef);
|
|
96
97
|
const tools = agent.state.tools;
|
|
97
98
|
const turnPolicy = agentManager.createAgentTurnPolicy(sessionKey);
|
|
98
|
-
const systemPrompt = agent.state.systemPrompt ?? "";
|
|
99
|
+
const systemPrompt = [agent.state.systemPrompt ?? "", params.presentation === "voice" ? voicePresentationPrompt : ""].filter(Boolean).join("\n\n");
|
|
99
100
|
const thinkingLevel = params.thinkingOverride ?? agent.state.thinkingLevel;
|
|
100
101
|
const workspaceDir = agentManager.getResolvedWorkspaceForSession(sessionKey);
|
|
101
102
|
const promptCachePolicy = resolvePromptCachePolicy(config ? resolveEffectiveAgentProfileForSession(config, sessionKey).config.runtime.promptCache : void 0);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "../../config/schema.js";
|
|
2
2
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
3
|
-
import { getDefaultModelSync, getModelsByProvider, init_providers, isProviderConfiguredSync, resolveModel } from "../../providers/index.js";
|
|
4
3
|
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
4
|
+
import { getDefaultModelSync, getModelsByProvider, init_providers, isProviderConfiguredSync, resolveModel } from "../../providers/index.js";
|
|
5
5
|
import { resolveAgentModelFallbackValues, resolveAgentModelPrimaryValue } from "../../config/model-input.js";
|
|
6
6
|
import { buildCapabilityPlansForConfig } from "../../capabilities/readiness/from-config.js";
|
|
7
7
|
import "../../capabilities/readiness/index.js";
|
|
@@ -75,6 +75,7 @@ export declare class TurnDispatcher {
|
|
|
75
75
|
signal?: AbortSignal;
|
|
76
76
|
runId?: string;
|
|
77
77
|
sourceContexts?: AgentSourceContext[];
|
|
78
|
+
presentation?: 'voice';
|
|
78
79
|
}): AsyncGenerator<ProcessDirectStreamEvent, void, unknown>;
|
|
79
80
|
/** Push an out-of-band event into the live webchat stream for a session. */
|
|
80
81
|
enqueueWebchatStreamEvent(sessionKey: string, event: {
|
|
@@ -34,7 +34,8 @@ var TurnDispatcher = class {
|
|
|
34
34
|
thinking,
|
|
35
35
|
signal: options?.signal,
|
|
36
36
|
runId: options?.runId,
|
|
37
|
-
sourceContexts: options?.sourceContexts
|
|
37
|
+
sourceContexts: options?.sourceContexts,
|
|
38
|
+
presentation: options?.presentation
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
/** Push an out-of-band event into the live webchat stream for a session. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
4
3
|
import { init_paths, resolveAgentDir } from "../../config/paths.js";
|
|
4
|
+
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
5
5
|
import { join } from "path";
|
|
6
6
|
import { existsSync, watch } from "fs";
|
|
7
7
|
import { mkdir, readFile, readdir, rename } from "fs/promises";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_write_file_atomic, writeTextAtomic } from "../../../infra/write-file-atomic.js";
|
|
2
1
|
import { init_paths, resolveMcpOAuthPath } from "../../../config/paths.js";
|
|
2
|
+
import { init_write_file_atomic, writeTextAtomic } from "../../../infra/write-file-atomic.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { readFile, rm } from "node:fs/promises";
|
|
5
5
|
//#region src/agent/mcp/oauth/mcp-oauth-store.ts
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/** Per-turn presentation only; never persisted as a user message or Agent identity. */
|
|
2
|
+
export declare const voicePresentationPrompt = "This turn is a live voice conversation in the same Chat.\nLead with the useful answer. Prefer one to three natural spoken sentences unless the user asks for detail.\nAllow silence. Do not repeatedly greet, recap unrelated old tasks, or end every reply with a question.\nFor work, briefly say what you are doing, use the available tools, then report the actual result.\nKeep code, long URLs, tables and detailed reference material in Chat; introduce them with a short spoken explanation.\nDo not imply a task continues in the background unless an existing task or workflow actually started it.\nUse the existing clarification and approval mechanisms. A background sound or ambiguous interjection is not permission for an action.\nStopping speech does not undo a completed tool action. State consequential results accurately.";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/agent/prompt/voice-presentation.ts
|
|
2
|
+
/** Per-turn presentation only; never persisted as a user message or Agent identity. */
|
|
3
|
+
const voicePresentationPrompt = `This turn is a live voice conversation in the same Chat.
|
|
4
|
+
Lead with the useful answer. Prefer one to three natural spoken sentences unless the user asks for detail.
|
|
5
|
+
Allow silence. Do not repeatedly greet, recap unrelated old tasks, or end every reply with a question.
|
|
6
|
+
For work, briefly say what you are doing, use the available tools, then report the actual result.
|
|
7
|
+
Keep code, long URLs, tables and detailed reference material in Chat; introduce them with a short spoken explanation.
|
|
8
|
+
Do not imply a task continues in the background unless an existing task or workflow actually started it.
|
|
9
|
+
Use the existing clarification and approval mechanisms. A background sound or ambiguous interjection is not permission for an action.
|
|
10
|
+
Stopping speech does not undo a completed tool action. State consequential results accurately.`;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { voicePresentationPrompt };
|
|
@@ -69,6 +69,7 @@ export interface RunDirectAgentTurnInput {
|
|
|
69
69
|
deadlineAtMs?: number;
|
|
70
70
|
sourceImages?: ImageContent[];
|
|
71
71
|
sourceContexts?: AgentSourceContext[];
|
|
72
|
+
presentation?: 'voice';
|
|
72
73
|
onEvent?: (event: EmbeddedStreamEvent) => void;
|
|
73
74
|
}
|
|
74
75
|
export interface RunDirectAgentTurnResult {
|
|
@@ -107,6 +107,7 @@ async function runDirectAgentTurn(deps, input) {
|
|
|
107
107
|
runId: turnId,
|
|
108
108
|
userMessage: userMessageForModel,
|
|
109
109
|
llmImages,
|
|
110
|
+
presentation: input.presentation,
|
|
110
111
|
sessionStore: deps.sessionStore,
|
|
111
112
|
agentManager: deps.agentManager,
|
|
112
113
|
modelManager: deps.modelManager,
|
|
@@ -298,6 +298,7 @@ async function* runProcessDirectStreaming(deps, input) {
|
|
|
298
298
|
userMessage,
|
|
299
299
|
abortSignal: signal,
|
|
300
300
|
sourceContexts,
|
|
301
|
+
presentation: input.presentation,
|
|
301
302
|
runId: input.runId,
|
|
302
303
|
onEvent: (embeddedEvent) => {
|
|
303
304
|
const event = { ...embeddedEvent };
|
|
@@ -332,7 +333,7 @@ async function* runProcessDirectStreaming(deps, input) {
|
|
|
332
333
|
sessionKey,
|
|
333
334
|
droppedEvents: queue.droppedCount
|
|
334
335
|
}, "Coalesced stream progress events because the consumer fell behind");
|
|
335
|
-
if (!userAborted && !streamOverflowed && channel === "webchat" && !explicitTtsEmitted) try {
|
|
336
|
+
if (!userAborted && !streamOverflowed && channel === "webchat" && !explicitTtsEmitted && input.presentation !== "voice") try {
|
|
336
337
|
const ttsAudioEvent = await deps.maybeEmitWebchatTts(sessionKey, inboundVoice);
|
|
337
338
|
if (ttsAudioEvent) queue.push(ttsAudioEvent);
|
|
338
339
|
} catch (ttsErr) {
|
|
@@ -3,10 +3,10 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { getUserProfile } from "../storage/sqlite/user-context-repository.js";
|
|
4
4
|
import { parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
|
|
5
5
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
6
|
-
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
7
|
-
import { init_providers, resolveModel } from "../providers/index.js";
|
|
8
6
|
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
7
|
+
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
9
8
|
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
9
|
+
import { init_providers, resolveModel } from "../providers/index.js";
|
|
10
10
|
import { extractTextContent } from "./context/workspace.js";
|
|
11
11
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
12
12
|
import { getProjectForSession } from "../projects/workspace.js";
|
|
@@ -76,8 +76,10 @@ var SessionConfigService = class {
|
|
|
76
76
|
});
|
|
77
77
|
this.opts.modelManager.restoreSessionModel(sessionKey, modelRef, updated.fixedModel === true);
|
|
78
78
|
try {
|
|
79
|
-
this.opts.agentManager.
|
|
80
|
-
|
|
79
|
+
if (this.opts.agentManager.getAgent(sessionKey)) {
|
|
80
|
+
this.opts.agentManager.setModelForSession(sessionKey, modelRef);
|
|
81
|
+
this.opts.agentManager.setThinkingLevel(sessionKey, thinkingLevel);
|
|
82
|
+
}
|
|
81
83
|
} catch (err) {
|
|
82
84
|
this.opts.agentManager.removeAgent(sessionKey);
|
|
83
85
|
log.warn({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { init_workspace_defaults, resolveDefaultAgentWorkspaceDir } from "../../config/workspace-defaults.js";
|
|
4
|
-
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
5
4
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
|
+
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
6
6
|
import { getExecutionEnvironmentForSession } from "../../execution-environments/subject.js";
|
|
7
7
|
import { effectiveWorkspacePathForSession, projectWorkspacePath } from "../../session/session-workspace.js";
|
|
8
8
|
import { getProjectForSession } from "../../projects/workspace.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
1
|
import { init_paths, resolveSkillsLockPath } from "../../config/paths.js";
|
|
2
|
+
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
//#region src/agent/skills/hub-lock.ts
|
|
5
5
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
4
3
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
5
|
-
import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
|
|
6
|
-
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
7
4
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
|
+
import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
|
|
8
6
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
9
7
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
10
8
|
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
9
|
+
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
11
10
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
11
|
+
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
12
12
|
//#region src/agent/tasks/task-judge-service.ts
|
|
13
13
|
init_schema();
|
|
14
14
|
init_providers();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { getAssistantMessageErrorReason, stripCodeFences } from "../providers/model-response.js";
|
|
4
3
|
import { getDefaultModelSync, init_providers, resolveModel } from "../providers/index.js";
|
|
5
4
|
import { createExtensionAwareStreamFn } from "../providers/extension-stream-bridge.js";
|
|
6
5
|
import { isLocalModelBaseUrl, resolveModelCallApiKey, resolveModelCallOptions } from "../providers/model-call.js";
|
|
6
|
+
import { getAssistantMessageErrorReason, stripCodeFences } from "../providers/model-response.js";
|
|
7
7
|
//#region src/ai-assist/text-assist.ts
|
|
8
8
|
init_providers();
|
|
9
9
|
init_logger();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
5
4
|
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveCredentialsDir, resolveOAuthPath } from "../config/paths.js";
|
|
6
|
-
import {
|
|
5
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
7
6
|
import { getOAuthProviderDefinition, init_registry } from "./oauth/registry.js";
|
|
7
|
+
import { getApiKeyFromEnv, init_env_keys } from "../providers/env-keys.js";
|
|
8
8
|
import { init_oauth_provider_lock, withOAuthProviderLock } from "./oauth-provider-lock.js";
|
|
9
9
|
import { dirname, join } from "path";
|
|
10
10
|
import { mkdir, readFile, readdir, rm } from "fs/promises";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
1
|
import { init_paths, resolveCredentialsDir } from "../../config/paths.js";
|
|
2
|
+
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { chmodSync, existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
5
5
|
//#region src/auth/profiles/store.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
2
3
|
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveOAuthPath } from "../config/paths.js";
|
|
3
|
-
import { init_registry, isOAuthOnlyProvider } from "./oauth/registry.js";
|
|
4
4
|
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
|
-
import {
|
|
5
|
+
import { init_registry, isOAuthOnlyProvider } from "./oauth/registry.js";
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
7
7
|
//#region src/auth/sync-provider-auth.ts
|
|
8
8
|
/**
|
|
@@ -2,8 +2,8 @@ import { PACKAGE_VERSION, init_package_version } from "../../package-version.js"
|
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
4
|
import { assertCacheDir, init_cache_dir_policy } from "../cache-dir-policy.js";
|
|
5
|
-
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
6
5
|
import { init_paths, resolveBinDir } from "../../config/paths.js";
|
|
6
|
+
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
7
7
|
import { shouldRunExtensionBridgeServer } from "../backend-from-config.js";
|
|
8
8
|
import { resolvePackageRoot } from "../../infra/update-check.js";
|
|
9
9
|
import { dirname, join } from "node:path";
|
|
@@ -8,10 +8,10 @@ import { MessageBus, MessageBusShutdownError } from "../../infra/bus/queue.js";
|
|
|
8
8
|
import "../../infra/bus/index.js";
|
|
9
9
|
import { AgentService } from "../../agent/service.js";
|
|
10
10
|
import "../../agent/index.js";
|
|
11
|
-
import { formatExamples, register } from "../registry.js";
|
|
12
|
-
import { getContextWithOpts } from "../context.js";
|
|
13
11
|
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
14
12
|
import "../../config/index.js";
|
|
13
|
+
import { formatExamples, register } from "../registry.js";
|
|
14
|
+
import { getContextWithOpts } from "../context.js";
|
|
15
15
|
import { getXopcCloudCatalogCoordinator } from "../../providers/xopc-cloud-catalog-coordinator.js";
|
|
16
16
|
import { listSessions } from "./agent/sessions.js";
|
|
17
17
|
import { renderStreamToTerminal } from "./agent/stream-renderer.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAgentDefaultModelRef, init_schema, parseModelRef } from "../../../../config/schema.js";
|
|
2
|
-
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "../../../../providers/env-keys.js";
|
|
3
2
|
import { init_loader, loadConfig } from "../../../../config/loader.js";
|
|
3
|
+
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "../../../../providers/env-keys.js";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
//#region src/cli/commands/doctor/checks/provider-auth.ts
|
|
6
6
|
init_loader();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_paths, resolveConfigPath } from "../../../config/paths.js";
|
|
2
2
|
import { loadConfig } from "../../../config/loader.js";
|
|
3
|
-
import "../../../config/index.js";
|
|
4
3
|
import { isRestartEnabled } from "../../../config/commands.flags.js";
|
|
4
|
+
import "../../../config/index.js";
|
|
5
5
|
import { resolveGatewayService } from "../../../daemon/service.js";
|
|
6
6
|
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "../../../infra/restart.js";
|
|
7
7
|
import { findVerifiedGatewayListenerPidsOnPortSync, formatGatewayPidList, signalVerifiedGatewayPidSync } from "../../../infra/gateway-processes.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
2
|
-
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
3
2
|
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
3
|
+
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
4
4
|
import { getAllModels, getAvailableModels, getConfiguredProviders, getProviderAuthState, getProviderDisplayName, init_providers, isProviderConfigured, providerSupportsApiKey, providerSupportsOAuth, resolveModel } from "../../providers/index.js";
|
|
5
|
+
import "../../config/index.js";
|
|
5
6
|
import { formatExamples, register } from "../registry.js";
|
|
6
7
|
import { getContextWithOpts } from "../context.js";
|
|
7
|
-
import "../../config/index.js";
|
|
8
8
|
import { prepareUpdateGlobalDefaults } from "../../gateway/global-defaults-admin.js";
|
|
9
9
|
import { disconnectProvider } from "../../providers/provider-disconnect.js";
|
|
10
10
|
import { colors } from "../utils/colors.js";
|
|
@@ -2,8 +2,8 @@ import { init_paths_state, resolveStateDir } from "../../config/paths-state.js";
|
|
|
2
2
|
import { ConfigSchema, init_schema } from "../../config/schema.js";
|
|
3
3
|
import { saveConfig } from "../../config/loader.js";
|
|
4
4
|
import { resolveGatewayLocalClientHost } from "../../config/gateway-bind.js";
|
|
5
|
-
import { formatExamples, register } from "../registry.js";
|
|
6
5
|
import "../../config/index.js";
|
|
6
|
+
import { formatExamples, register } from "../registry.js";
|
|
7
7
|
import { provisionEagerRuntimes } from "../../runtime-tools/bootstrap.js";
|
|
8
8
|
import { colors } from "../utils/colors.js";
|
|
9
9
|
import { initWorkspace } from "../utils/init-workspace.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { formatExamples, register } from "../registry.js";
|
|
4
3
|
import { createProfile, deleteProfile, getCurrentProfile, getSwitchCommand, listProfiles, resolveProfileStateDir } from "../../config/profile.js";
|
|
4
|
+
import { formatExamples, register } from "../registry.js";
|
|
5
5
|
import { colors } from "../utils/colors.js";
|
|
6
6
|
import { Command } from "commander";
|
|
7
7
|
import Table from "cli-table3";
|