@xopcai/xopc 0.0.389 → 0.0.391
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-dvik6t7Z.js → activity-store-DWQCDi8M.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-bWMd5TDC.js → agent-avatar-dicebear-CzS0TUv9.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DE910MyU.js +1 -0
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-UunIxc1q.js → agent-plugin-dialog-0SlvsYl7.js} +1 -1
- package/dist/gateway/static/root/assets/agents-BZh28Qn1.js +77 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-BlNGyXpm.js → agents-admin-api-Bb3Kvz3X.js} +1 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-9A7JN5V5.js +1 -0
- package/dist/gateway/static/root/assets/{appearance-settings-CUAdx44v.js → appearance-settings-BPdLEo6L.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-D5zDB6gp.js → apps-page-Cz7LypV9.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-Du6dJNcl.js → archive-plugin-DFnHPNie.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BO8Ig5Z4.js → automations-page-CnBLPVNh.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BBjS-sk-.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-D7VJjwnr.js → binary-plugins-BQC0Tzoi.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CaJlWTAn.js → block-editor-DSh5019z.js} +4 -4
- package/dist/gateway/static/root/assets/{browser-automation-inputs-iyMBJmQX.js → browser-automation-inputs-C5tIrIRL.js} +1 -1
- package/dist/gateway/static/root/assets/browser-automations-page-CFCMNfJN.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-C__tyPwu.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-CEH1AnXc.js → capabilities-D6RJG4QY.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-MCKRMZDK.js → capabilities-DGEmBQnF.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-B5AZa7ir.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Dskz2_bh.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-BIA0Lwt5.js → capability-header-actions-xzjWZVbg.js} +1 -1
- package/dist/gateway/static/root/assets/channels-DRse_dD3.js +1 -0
- package/dist/gateway/static/root/assets/chat-terminal-dock-CQF0M4kE.js +36 -0
- package/dist/gateway/static/root/assets/{computer-settings-page-DvY3zgyY.js → computer-settings-page-ZfzCTS0N.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-St2-Fj3y.js → connector-service-page-CwAeWVLK.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-CanakKaj.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-C0-D80ny.js → date-picker-hmJlEAQZ.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CNd7mwMU.js → dependency-picker-Us_Juz6I.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-C-2wDANn.js → desktop-pet-CvOTI4uw.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DyhxLrdJ.js → desktop-pet-settings-DYg-Gb8t.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-B1FbZ8C1.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-CNivVIPT.js → directory-picker-path-field-DZN9EDvM.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CGYO3JPw.js → extension-debug-page-YIibp6Kk.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Dc51ALAg.js → extension-page-DkcGyb28.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-BXPILdlw.js → extension-provider-B1PQGTtY.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-C_rJiSKo.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-Bc2MytsF.js → gateway-config-swr-Dv_A5FMu.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-BFK-vlME.js → gateway-realtime-DghCGfY_.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CMJVSnvi.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-CjCWPHNJ.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BDPMttPx.js → gateway-startup-retry-CkTVSESs.js} +1 -1
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-DAlRGMge.js → highlighted-body-KQOG7T2V-DV2wNqBn.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-fAYsd7kG.js +2 -0
- package/dist/gateway/static/root/assets/image-generation-api-B98iXt6A.js +1 -0
- package/dist/gateway/static/root/assets/imports-page-DoBCBN8G.js +1 -0
- package/dist/gateway/static/root/assets/index-DFgXwLsv.js +260 -0
- package/dist/gateway/static/root/assets/index-a6ZvhclR.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BYYC9Qmw.js → keyboard-shortcuts-settings-DXVu4lqV.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-B3fz6uRi.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BU8pUsVM.js → local-apps-page-BC6xhmUh.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-kFc_MAA9.js → local-session-drafts-DFnZQu9A.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Dr43FCty.js → locale-store-BpK9AiDq.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-CSqSFDRU.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-gq5L0THs.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-CdKlPjJM.js → markdown-view-IsYTotu6.js} +18 -18
- package/dist/gateway/static/root/assets/{media-plugins-DE9zt88i.js → media-plugins-oSChWbcP.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-C_QKwqDN.js +1 -0
- package/dist/gateway/static/root/assets/messages-CKTo_sIF.js +3 -0
- package/dist/gateway/static/root/assets/models-hub-cache-TjpL7hZ5.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-CdpNXre-.js +5 -0
- package/dist/gateway/static/root/assets/{notes-api-BHouNL6-.js → notes-api-CBb944yw.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-EGvGw8MN.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-TQr8NnSc.js → page-context-capture-button-CoWb7BYP.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-DYzbNTyN.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-BEl6syFp.js → product-open-page-CTyy7H7-.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-BxSHnbqz.js → product-preview-content-D4xqTaEy.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DIVCw0QQ.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-B4L9VnBN.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BD5IgDOA.js → registry-api-Dsa2LvRt.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-B8PvgLVz.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-CjTRoQWT.js → runtime-tools-api-C2Uw89eY.js} +1 -1
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-Bqnp3tyt.js +1 -0
- package/dist/gateway/static/root/assets/scenes-page-D50g4GM2.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-ByG-R6N2.js → schema-form-h_RCNfiO.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-UAVStisp.js → send-session-input-DypbVTT7.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-DvgEiNRS.js → session-api-ga-SUOq_.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-BOb1tC_Z.js → session-manager-C_OiKblh.js} +8 -8
- package/dist/gateway/static/root/assets/sessions-page-BsqDIbIr.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-D3zJAW4p.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-C1e9m23j.js → settings-page-DPCgrICd.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-jjSYJpDd.js +1 -0
- package/dist/gateway/static/root/assets/{share-link-dialog-kE_6v5Dp.js → share-link-dialog-BGicglAS.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BT-_yR1h.js → share-preview-page-BORe9rLB.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-Dg_SqHQE.js → shares-api-Dbx3z6-1.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-C13FgfWk.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-BslUYMnX.js → skill-api-Cq6O1DZK.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-BQ2rTOP1.js → skill-reload-api-Cq7QDjMA.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-BM1ShEjx.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-GpbPfWwo.js → system-settings-panel-BNCGFO1e.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-4VG82wcF.js +2 -0
- package/dist/gateway/static/root/assets/{task-expandable-content-DJrrEBB4.js → task-expandable-content-DAZGz5YC.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BKpYnggg.js → theme-store-Db7hDESt.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-D71w7dwV.js → tracing-settings-page-C6p2Mu92.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-BV46CvS8.js → tunnel-api-Dw15EJp0.js} +1 -1
- package/dist/gateway/static/root/assets/usage-page-DDrIqgGe.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-CzyqRffr.js → use-autosave-DDjIdW4U.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-Dviq-1f6.js → use-composer-attachments-DNl7O3Vb.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-D5Kk7Hon.js → use-file-preview-expanded-DMHehhwG.js} +2 -2
- package/dist/gateway/static/root/assets/user-model-page-CaS9dOIr.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DWtbmacd.js → voice-api-key-field-ByAxHE4P.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DnIjZm_9.js → voice-config-api-Dl39b27p.js} +1 -1
- package/dist/gateway/static/root/assets/voice-transcribe-api-CVaU83Jc.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-ChEG71hz.js → work-discovery-overlay-BvVvPA1T.js} +1 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-BcFm9QcC.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-DMec_XZB.js +6 -0
- package/dist/gateway/static/root/assets/{workspace-api-CZDvu7uA.js → workspace-api-BpfKsrtP.js} +2 -2
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-CbUgg1SK.js → xopc-cloud-account-card-CU5lzzE9.js} +1 -1
- package/dist/gateway/static/root/index.html +28 -35
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/discussions.js +3 -2
- package/dist/packages/gateway-contract/src/index.js +4 -0
- package/dist/packages/gateway-contract/src/provider-setup.js +6 -0
- package/dist/packages/gateway-contract/src/recording-outcome.js +6 -0
- package/dist/packages/image-providers/src/catalog.js +10 -0
- package/dist/packages/image-providers/src/execute.js +5 -1
- package/dist/packages/image-providers/src/validation.js +19 -1
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +4 -1
- package/dist/src/agent/background-review/run-background-review.d.ts +0 -1
- package/dist/src/agent/background-review/run-background-review.js +10 -2
- package/dist/src/agent/context/execution-scope.js +1 -1
- package/dist/src/agent/embedded/execution-tool-policy.d.ts +2 -0
- package/dist/src/agent/embedded/execution-tool-policy.js +8 -3
- package/dist/src/agent/embedded/run-for-session.js +26 -3
- package/dist/src/agent/embedded/run-turn.js +14 -1
- package/dist/src/agent/embedded/session-runner.js +1 -1
- package/dist/src/agent/embedded/xopc-stream-bridge.js +3 -0
- package/dist/src/agent/image/generation/runtime.js +12 -14
- package/dist/src/agent/image/understanding/runtime.js +5 -0
- package/dist/src/agent/inbound/inbound-loop.d.ts +1 -15
- package/dist/src/agent/inbound/inbound-loop.js +5 -0
- package/dist/src/agent/mcp/connection-errors.d.ts +3 -0
- package/dist/src/agent/mcp/connection-errors.js +32 -0
- package/dist/src/agent/mcp/connection-setup.d.ts +2 -0
- package/dist/src/agent/mcp/connection-setup.js +38 -18
- package/dist/src/agent/memory/compaction.js +5 -1
- package/dist/src/agent/memory/idle-compaction-scheduler.js +3 -1
- package/dist/src/agent/models/manager.d.ts +1 -0
- package/dist/src/agent/models/manager.js +4 -2
- package/dist/src/agent/orchestration/agent-orchestrator.d.ts +1 -6
- package/dist/src/agent/orchestration/agent-orchestrator.js +5 -0
- package/dist/src/agent/service/process-direct-one-shot.js +5 -0
- package/dist/src/agent/service/process-direct-streaming.d.ts +1 -0
- package/dist/src/agent/service/process-direct-streaming.js +17 -1
- package/dist/src/agent/tools/factory.js +14 -12
- package/dist/src/agent/tools/image-generate-tool.js +5 -1
- package/dist/src/agent/tools/personal-read-tool.js +4 -0
- package/dist/src/agent/tools/task-collaboration-tool.js +1 -1
- package/dist/src/agent-config/resolver.js +5 -0
- package/dist/src/agent-config/schema.d.ts +26 -6
- package/dist/src/agent-config/schema.js +2 -0
- package/dist/src/ai-assist/text-assist.js +5 -16
- package/dist/src/automations/service/action-executor.js +3 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/agent-model-intents.js +4 -1
- package/dist/src/config/schema.d.ts +11 -5
- package/dist/src/config/schema.js +11 -3
- package/dist/src/discussions/analyzer.d.ts +2 -0
- package/dist/src/discussions/analyzer.js +38 -9
- package/dist/src/discussions/audio-clip.d.ts +3 -0
- package/dist/src/discussions/audio-clip.js +72 -0
- package/dist/src/discussions/live-worker.js +3 -1
- package/dist/src/discussions/long-review.d.ts +17 -0
- package/dist/src/discussions/long-review.js +278 -0
- package/dist/src/discussions/media-timeline.d.ts +21 -0
- package/dist/src/discussions/media-timeline.js +134 -0
- package/dist/src/discussions/organizer-worker.d.ts +4 -1
- package/dist/src/discussions/organizer-worker.js +17 -12
- package/dist/src/discussions/organizer.js +2 -0
- package/dist/src/discussions/processing.d.ts +43 -0
- package/dist/src/discussions/processing.js +125 -0
- package/dist/src/discussions/recording.js +202 -42
- package/dist/src/discussions/recordingJobs.js +2 -0
- package/dist/src/discussions/repository.js +4 -2
- package/dist/src/discussions/review.d.ts +8 -0
- package/dist/src/discussions/review.js +183 -0
- package/dist/src/discussions/sealer.d.ts +7 -1
- package/dist/src/discussions/sealer.js +163 -87
- package/dist/src/discussions/service.d.ts +7 -1
- package/dist/src/discussions/service.js +51 -15
- package/dist/src/discussions/types.d.ts +2 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/global-defaults-admin.d.ts +3 -1
- package/dist/src/gateway/global-defaults-admin.js +14 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +11 -2
- package/dist/src/gateway/hono/lib/config-payload.js +2 -0
- package/dist/src/gateway/hono/lib/voice-settings-revisions.d.ts +5 -0
- package/dist/src/gateway/hono/lib/voice-settings-revisions.js +24 -0
- package/dist/src/gateway/hono/routes/commands-skills.js +15 -0
- package/dist/src/gateway/hono/routes/config-patch/misc.js +8 -1
- package/dist/src/gateway/hono/routes/config.js +12 -0
- package/dist/src/gateway/hono/routes/discussions.js +63 -1
- package/dist/src/gateway/hono/routes/global-defaults.js +8 -1
- package/dist/src/gateway/hono/routes/models.js +12 -4
- package/dist/src/gateway/hono/routes/provider-setup.d.ts +3 -0
- package/dist/src/gateway/hono/routes/provider-setup.js +106 -0
- package/dist/src/gateway/hono/routes/status.js +2 -0
- package/dist/src/gateway/hono/routes/voice.js +23 -10
- package/dist/src/gateway/provider-model-setup.d.ts +4 -0
- package/dist/src/gateway/provider-model-setup.js +56 -0
- package/dist/src/gateway/service/config-coordinator.d.ts +2 -2
- package/dist/src/gateway/service.js +2 -0
- package/dist/src/media-shared/http/provider-http.d.ts +0 -6
- package/dist/src/media-shared/http/provider-http.js +5 -4
- package/dist/src/media-understanding/runner.d.ts +0 -28
- package/dist/src/media-understanding/runner.js +4 -0
- package/dist/src/platform/client.d.ts +1 -1
- package/dist/src/platform/contracts.d.ts +1 -1
- package/dist/src/providers/env-keys.js +3 -0
- package/dist/src/providers/extension-stream-bridge.js +3 -0
- package/dist/src/providers/index.js +15 -0
- package/dist/src/providers/model-call.d.ts +5 -2
- package/dist/src/providers/model-call.js +13 -2
- package/dist/src/providers/model-reference-auditor.js +1 -0
- package/dist/src/providers/model-response.js +1 -1
- package/dist/src/providers/model-usage.d.ts +15 -0
- package/dist/src/providers/model-usage.js +50 -0
- package/dist/src/providers/presentation.js +8 -0
- package/dist/src/providers/setup/engine.d.ts +37 -0
- package/dist/src/providers/setup/engine.js +177 -0
- package/dist/src/providers/setup/profiles.d.ts +4 -0
- package/dist/src/providers/setup/profiles.js +78 -0
- package/dist/src/providers/setup/voice.d.ts +23 -0
- package/dist/src/providers/setup/voice.js +234 -0
- package/dist/src/scenes/agentExecutor.d.ts +1 -0
- package/dist/src/scenes/agentExecutor.js +5 -0
- package/dist/src/storage/sqlite/migrations/253_discussion_processing_recovery.sql +20 -0
- package/dist/src/storage/sqlite/migrations/254_discussion_annotations.sql +17 -0
- package/dist/src/storage/sqlite/migrations/255_discussion_chapter_progress.sql +10 -0
- package/dist/src/storage/sqlite/migrations/256_task_main_update_retries.sql +21 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tasks/task-collaboration-repository.d.ts +2 -0
- package/dist/src/tasks/task-collaboration-repository.js +7 -1
- package/dist/src/tasks/task-main-update-delivery.js +11 -4
- package/dist/src/tasks/task-main-update-input.js +2 -1
- package/dist/src/tasks/task-main-update-retry.d.ts +5 -0
- package/dist/src/tasks/task-main-update-retry.js +15 -0
- package/dist/src/usage/recorder.js +2 -1
- package/dist/src/usage/scenario-registry.js +128 -123
- package/dist/src/voice/dashscope/streaming-stt-session.js +3 -0
- package/dist/src/voice/dashscope/streaming-tts-stream.js +3 -0
- package/dist/src/voice/dictation.d.ts +12 -0
- package/dist/src/voice/dictation.js +22 -0
- package/dist/src/voice/metadata/builtin.js +54 -0
- package/dist/src/voice/platform-streams.js +3 -0
- package/dist/src/voice/realtime/omniEngine.js +3 -0
- package/dist/src/voice/realtime/omniRoute.js +3 -2
- package/dist/src/voice/realtime/runtime.js +4 -2
- package/dist/src/voice/stt/factory.js +9 -3
- package/dist/src/voice/stt/providers/bailian-plan-transcription.d.ts +2 -0
- package/dist/src/voice/stt/providers/bailian-plan-transcription.js +32 -0
- package/dist/src/voice/stt/providers/index.d.ts +1 -0
- package/dist/src/voice/stt/providers/index.js +2 -1
- package/dist/src/voice/token-plan.d.ts +8 -0
- package/dist/src/voice/token-plan.js +11 -0
- package/dist/src/voice/tts/factory.js +4 -1
- package/dist/src/voice/tts/providers/bailian-plan-speech.d.ts +2 -0
- package/dist/src/voice/tts/providers/bailian-plan-speech.js +84 -0
- package/dist/src/voice/tts/providers/index.d.ts +1 -0
- package/dist/src/voice/tts/providers/index.js +2 -1
- package/dist/src/voice/tts/speak-core.js +10 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Ds0Ue2FB.js +0 -1
- package/dist/gateway/static/root/assets/agents-BLRM4o-U.js +0 -77
- package/dist/gateway/static/root/assets/app-management-settings-panel-Dmy828Pe.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-UcCneEs3.js +0 -6
- package/dist/gateway/static/root/assets/bot-DjLkhyZL.js +0 -1
- package/dist/gateway/static/root/assets/browser-automations-page-BjvQnYfO.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-D5ZghI28.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-MC8qIrXo.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Blz3hEzp.js +0 -8
- package/dist/gateway/static/root/assets/channels-DSg_iCVC.js +0 -1
- package/dist/gateway/static/root/assets/chat-terminal-dock-C97SJEwd.js +0 -36
- package/dist/gateway/static/root/assets/circle-pause-CN9jYH2s.js +0 -1
- package/dist/gateway/static/root/assets/clock-3-DnrAnuyZ.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DXk-GAsd.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-BeSuq__I.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-jYu6qpY2.js +0 -1
- package/dist/gateway/static/root/assets/fallback-models-CoyzvDo7.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-C3vH-Iup.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-JlT1dlSj.js +0 -1
- package/dist/gateway/static/root/assets/git-branch-Dh9uxTot.js +0 -1
- package/dist/gateway/static/root/assets/home-page-DOVl8s-1.js +0 -2
- package/dist/gateway/static/root/assets/image-generation-api-BZBiYDmV.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-DgdBTp_0.js +0 -1
- package/dist/gateway/static/root/assets/index-CmC8JkSM.js +0 -260
- package/dist/gateway/static/root/assets/index-Dgzc0oBu.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BKZfn-MS.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-BSepiACn.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-dE_ykPNY.js +0 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-65SE6j-_.js +0 -1
- package/dist/gateway/static/root/assets/message-square-fVE7Ghj1.js +0 -1
- package/dist/gateway/static/root/assets/messages-DlTNQI92.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-cache-C7FAsEe_.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-D9oqhdyk.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-Bd4_7ph8.js +0 -8
- package/dist/gateway/static/root/assets/pause-DuPxgSxk.js +0 -1
- package/dist/gateway/static/root/assets/personal-page-BvWzq4Wp.js +0 -1
- package/dist/gateway/static/root/assets/play-kxZvpBg8.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-D-qkIXVT.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BQtw1Dfn.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CYFNz0Jc.js +0 -1
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-Qq_NyYx_.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-hGr-ppYk.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-CpX1Rluw.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-D2s_MlxR.js +0 -1
- package/dist/gateway/static/root/assets/settings-loading-skeleton-BTqvr_Fw.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BiHRYDHq.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DfcAu08T.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CvKc5nBN.js +0 -2
- package/dist/gateway/static/root/assets/sparkles-DHlfQFAF.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-5B5ZVAu0.js +0 -2
- package/dist/gateway/static/root/assets/usage-page-rMuwNpJi.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-Dhqw3v_u.js +0 -2
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-pdiRKLxP.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-D9LMxINt.js +0 -6
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ModelSetupPreview, ModelSetupRequest, ProviderSetupProfile } from '@xopcai/gateway-contract';
|
|
2
|
+
import type { AgentDefaults } from '../../agent-config/index.js';
|
|
3
|
+
import type { SetupVoiceState, SetupVoiceModel, VoiceSetupUse } from './voice.js';
|
|
4
|
+
export type SetupModel = {
|
|
5
|
+
ref: string;
|
|
6
|
+
name: string;
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
api?: string;
|
|
9
|
+
vision?: boolean;
|
|
10
|
+
reasoning?: boolean;
|
|
11
|
+
recommended?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type SetupSnapshot = {
|
|
14
|
+
profile: ProviderSetupProfile;
|
|
15
|
+
defaults: AgentDefaults;
|
|
16
|
+
models: SetupModel[];
|
|
17
|
+
images: Array<{
|
|
18
|
+
ref: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}>;
|
|
21
|
+
configured: boolean;
|
|
22
|
+
configuredProviders: Set<string>;
|
|
23
|
+
backgroundRestrictedModels?: Set<string>;
|
|
24
|
+
voice?: SetupVoiceState;
|
|
25
|
+
};
|
|
26
|
+
export declare class SetupConflictError extends Error {
|
|
27
|
+
}
|
|
28
|
+
/** Pure preview over authoritative catalog and defaults; never writes or probes a model. */
|
|
29
|
+
export declare function previewProviderSetup(snapshot: SetupSnapshot, request?: ModelSetupRequest): ModelSetupPreview;
|
|
30
|
+
export declare function applyProviderSetup(snapshot: SetupSnapshot, request: ModelSetupRequest, revision: string): {
|
|
31
|
+
defaults: AgentDefaults;
|
|
32
|
+
preview: ModelSetupPreview;
|
|
33
|
+
voiceAssignments: Array<{
|
|
34
|
+
use: VoiceSetupUse;
|
|
35
|
+
model: SetupVoiceModel;
|
|
36
|
+
}>;
|
|
37
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { init_profiles, isInteractiveOnlyProvider } from "./profiles.js";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
//#region src/providers/setup/engine.ts
|
|
4
|
+
init_profiles();
|
|
5
|
+
const preferred = {
|
|
6
|
+
"qwen-token-plan-cn": {
|
|
7
|
+
fast: [
|
|
8
|
+
"qwen3.8-flash",
|
|
9
|
+
"qwen3.7-plus",
|
|
10
|
+
"qwen3.6-flash"
|
|
11
|
+
],
|
|
12
|
+
reasoning: [
|
|
13
|
+
"qwen3.8-max",
|
|
14
|
+
"deepseek-v4-pro-0813",
|
|
15
|
+
"deepseek-v4-pro"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"xopc-cloud": {
|
|
19
|
+
fast: ["auto"],
|
|
20
|
+
reasoning: ["advanced", "auto"]
|
|
21
|
+
},
|
|
22
|
+
"xiaomi-token-plan-cn": {
|
|
23
|
+
fast: ["mimo-v2.5", "mimo-v2.5-pro"],
|
|
24
|
+
reasoning: ["mimo-v2.5-pro", "mimo-v2.5"]
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const uses = [
|
|
28
|
+
"chat",
|
|
29
|
+
"vision",
|
|
30
|
+
"image",
|
|
31
|
+
"background"
|
|
32
|
+
];
|
|
33
|
+
var SetupConflictError = class extends Error {};
|
|
34
|
+
function choose(models, ids, provider) {
|
|
35
|
+
return ids.map((id) => models.find((model) => model.ref === `${provider}/${id}`)?.ref).find(Boolean) ?? models.find((model) => model.recommended)?.ref ?? (models.length === 1 ? models[0]?.ref : void 0);
|
|
36
|
+
}
|
|
37
|
+
/** Pure preview over authoritative catalog and defaults; never writes or probes a model. */
|
|
38
|
+
function previewProviderSetup(snapshot, request = {}) {
|
|
39
|
+
const { profile, defaults, configured, configuredProviders } = snapshot;
|
|
40
|
+
const models = snapshot.models.filter((model) => !request.modelIds || request.modelIds.some((id) => model.ref === id || model.ref === `${profile.id}/${id}`));
|
|
41
|
+
const vision = models.filter((model) => model.vision);
|
|
42
|
+
const reasoning = models.filter((model) => model.reasoning);
|
|
43
|
+
const preference = preferred[profile.id] ?? {
|
|
44
|
+
fast: [],
|
|
45
|
+
reasoning: []
|
|
46
|
+
};
|
|
47
|
+
const fast = choose(models, preference.fast, profile.id);
|
|
48
|
+
const complex = choose(reasoning, preference.reasoning, profile.id);
|
|
49
|
+
const isRestricted = (ref) => snapshot.backgroundRestrictedModels?.has(ref) || isInteractiveOnlyProvider(ref.split("/")[0], snapshot.models.find((model) => model.ref === ref)?.baseUrl);
|
|
50
|
+
const background = profile.interactiveOnly ? [] : models.filter((model) => !isRestricted(model.ref));
|
|
51
|
+
const recommended = {
|
|
52
|
+
chat: fast,
|
|
53
|
+
vision: choose(vision, preference.fast, profile.id),
|
|
54
|
+
image: snapshot.images[0]?.ref,
|
|
55
|
+
background: choose(background, preference.fast, profile.id)
|
|
56
|
+
};
|
|
57
|
+
const choices = {
|
|
58
|
+
chat: models,
|
|
59
|
+
vision,
|
|
60
|
+
image: snapshot.images,
|
|
61
|
+
background
|
|
62
|
+
};
|
|
63
|
+
const current = {
|
|
64
|
+
chat: defaults.models.chat.primary,
|
|
65
|
+
vision: defaults.models.imageUnderstanding?.primary,
|
|
66
|
+
image: defaults.models.imageGeneration?.primary,
|
|
67
|
+
background: defaults.models.background?.primary ?? (!isRestricted(defaults.models.chat.primary) ? defaults.models.chat.primary : void 0)
|
|
68
|
+
};
|
|
69
|
+
for (const id of Object.keys(snapshot.voice?.choices ?? {})) {
|
|
70
|
+
const options = snapshot.voice.choices[id];
|
|
71
|
+
choices[id] = options;
|
|
72
|
+
recommended[id] = options.find((model) => model.recommended)?.ref ?? (options.length === 1 ? options[0]?.ref : void 0);
|
|
73
|
+
current[id] = snapshot.voice.current[id];
|
|
74
|
+
}
|
|
75
|
+
const revision = createHash("sha256").update(JSON.stringify({
|
|
76
|
+
defaults,
|
|
77
|
+
profile,
|
|
78
|
+
models: snapshot.models,
|
|
79
|
+
images: snapshot.images,
|
|
80
|
+
voice: snapshot.voice,
|
|
81
|
+
backgroundRestrictedModels: [...snapshot.backgroundRestrictedModels ?? []].sort()
|
|
82
|
+
})).digest("hex");
|
|
83
|
+
return {
|
|
84
|
+
providerId: profile.id,
|
|
85
|
+
profile,
|
|
86
|
+
revision,
|
|
87
|
+
configured,
|
|
88
|
+
mode: request.mode ?? "fill",
|
|
89
|
+
taskModels: {
|
|
90
|
+
...fast ? { fast } : {},
|
|
91
|
+
...complex ? {
|
|
92
|
+
reasoning: complex,
|
|
93
|
+
coding: complex,
|
|
94
|
+
review: complex
|
|
95
|
+
} : {},
|
|
96
|
+
...recommended.vision ? { vision: recommended.vision } : {}
|
|
97
|
+
},
|
|
98
|
+
uses: [...uses, ...snapshot.voice ? [
|
|
99
|
+
"transcription",
|
|
100
|
+
"speech",
|
|
101
|
+
"conversation"
|
|
102
|
+
] : []].map((id) => {
|
|
103
|
+
const options = (choices[id] ?? []).map((model) => ({
|
|
104
|
+
id: model.ref,
|
|
105
|
+
name: model.name
|
|
106
|
+
}));
|
|
107
|
+
const override = request.overrides?.[id];
|
|
108
|
+
if (override && !options.some((model) => model.id === override)) throw new Error(`Invalid ${id} model for ${profile.id}`);
|
|
109
|
+
const ref = override ?? recommended[id];
|
|
110
|
+
const currentProvider = current[id]?.split("/")[0];
|
|
111
|
+
const currentConfigured = currentProvider && (configuredProviders.has(currentProvider) || [
|
|
112
|
+
"speech",
|
|
113
|
+
"transcription",
|
|
114
|
+
"conversation"
|
|
115
|
+
].includes(id)) && (id !== "background" || !isRestricted(current[id]));
|
|
116
|
+
const selected = options.length > 0 && Boolean(ref) && (request.selected ? request.selected.includes(id) : request.mode === "replace" || !currentConfigured);
|
|
117
|
+
return {
|
|
118
|
+
id,
|
|
119
|
+
current: current[id],
|
|
120
|
+
recommended: ref,
|
|
121
|
+
choices: options,
|
|
122
|
+
selected,
|
|
123
|
+
...!options.length ? { reason: id === "background" && profile.interactiveOnly ? "interactive_only" : "not_supported" } : !ref ? { reason: "no_recommendation" } : {}
|
|
124
|
+
};
|
|
125
|
+
})
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function applyProviderSetup(snapshot, request, revision) {
|
|
129
|
+
const preview = previewProviderSetup(snapshot, request);
|
|
130
|
+
if (revision !== preview.revision) throw new SetupConflictError("Model catalog or settings changed. Review the refreshed configuration.");
|
|
131
|
+
for (const id of request.selected ?? []) if (!preview.uses.some((use) => use.id === id && use.selected)) throw new Error(`No eligible model selected for ${id}`);
|
|
132
|
+
if (!snapshot.configured) throw new Error("Connect this model service before applying its models.");
|
|
133
|
+
const models = structuredClone(snapshot.defaults.models);
|
|
134
|
+
const voiceAssignments = [];
|
|
135
|
+
const route = (primary) => ({
|
|
136
|
+
primary,
|
|
137
|
+
fallbacks: []
|
|
138
|
+
});
|
|
139
|
+
for (const use of preview.uses) {
|
|
140
|
+
if (!use.selected) continue;
|
|
141
|
+
if (!use.recommended) throw new Error(`Choose a model for ${use.id}`);
|
|
142
|
+
if (use.id === "chat") {
|
|
143
|
+
models.chat = route(use.recommended);
|
|
144
|
+
for (const [intent, ref] of Object.entries(preview.taskModels)) {
|
|
145
|
+
const key = intent;
|
|
146
|
+
const existing = models.intents[key];
|
|
147
|
+
const keep = request.mode !== "replace" && existing && snapshot.configuredProviders.has(existing.primary.split("/")[0]);
|
|
148
|
+
if (ref && !keep && (intent !== "vision" || preview.uses.some((use) => use.id === "vision" && use.selected))) models.intents[key] = route(ref);
|
|
149
|
+
}
|
|
150
|
+
} else if (use.id === "vision") models.imageUnderstanding = route(use.recommended);
|
|
151
|
+
else if (use.id === "image") models.imageGeneration = {
|
|
152
|
+
...models.imageGeneration,
|
|
153
|
+
...route(use.recommended),
|
|
154
|
+
autoProviderFallback: false
|
|
155
|
+
};
|
|
156
|
+
else if (use.id === "background") models.background = route(use.recommended);
|
|
157
|
+
else {
|
|
158
|
+
const voiceUse = use.id;
|
|
159
|
+
const model = snapshot.voice?.choices[voiceUse].find((model) => model.ref === use.recommended);
|
|
160
|
+
if (!model) throw new Error(`No voice binding for ${use.id}`);
|
|
161
|
+
voiceAssignments.push({
|
|
162
|
+
use: voiceUse,
|
|
163
|
+
model
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
defaults: {
|
|
169
|
+
...snapshot.defaults,
|
|
170
|
+
models
|
|
171
|
+
},
|
|
172
|
+
preview,
|
|
173
|
+
voiceAssignments
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
//#endregion
|
|
177
|
+
export { SetupConflictError, applyProviderSetup, previewProviderSetup };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ProviderSetupProfile } from '@xopcai/gateway-contract';
|
|
2
|
+
/** Provider identity and endpoint do not restrict background or unknown calls. */
|
|
3
|
+
export declare function isInteractiveOnlyProvider(_provider: string, _baseUrl?: string): boolean;
|
|
4
|
+
export declare function getProviderSetupProfile(provider: string, name?: string, oauth?: boolean, baseUrl?: string): ProviderSetupProfile;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region src/providers/setup/profiles.ts
|
|
3
|
+
/** Provider identity and endpoint do not restrict background or unknown calls. */
|
|
4
|
+
function isInteractiveOnlyProvider(_provider, _baseUrl) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
function getProviderSetupProfile(provider, name = provider, oauth = false, baseUrl) {
|
|
8
|
+
if (profiles[provider]) return {
|
|
9
|
+
id: provider,
|
|
10
|
+
...profiles[provider]
|
|
11
|
+
};
|
|
12
|
+
const interactiveOnly = isInteractiveOnlyProvider(provider, baseUrl);
|
|
13
|
+
const local = Boolean(baseUrl && /^https?:\/\/(localhost|127\.0\.0\.1|\[::1\])(?=[:/]|$)/.test(baseUrl));
|
|
14
|
+
return {
|
|
15
|
+
id: provider,
|
|
16
|
+
brand: {
|
|
17
|
+
"dashscope-cn": "Alibaba Bailian",
|
|
18
|
+
"dashscope-intl": "Alibaba Bailian",
|
|
19
|
+
"qwen-token-plan": "Alibaba Bailian",
|
|
20
|
+
"qwen-token-plan-individual": "Alibaba Bailian",
|
|
21
|
+
xiaomi: "Xiaomi MiMo",
|
|
22
|
+
"xiaomi-token-plan-ams": "Xiaomi MiMo",
|
|
23
|
+
"xiaomi-token-plan-sgp": "Xiaomi MiMo"
|
|
24
|
+
}[provider] ?? name,
|
|
25
|
+
name,
|
|
26
|
+
access: subscriptionProviders.has(provider.trim().toLowerCase()) ? "subscription" : local ? "local" : "api",
|
|
27
|
+
credential: oauth ? "oauth" : local ? "none" : "api-key",
|
|
28
|
+
interactiveOnly
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
var subscriptionProviders, profiles;
|
|
32
|
+
var init_profiles = __esmMin((() => {
|
|
33
|
+
subscriptionProviders = new Set([
|
|
34
|
+
"qwen-token-plan-cn",
|
|
35
|
+
"qwen-token-plan",
|
|
36
|
+
"qwen-token-plan-individual",
|
|
37
|
+
"xiaomi-token-plan-cn",
|
|
38
|
+
"xiaomi-token-plan-ams",
|
|
39
|
+
"xiaomi-token-plan-sgp",
|
|
40
|
+
"zai-coding-cn",
|
|
41
|
+
"zai-coding-global",
|
|
42
|
+
"zhipu-coding-cn",
|
|
43
|
+
"kimi-coding",
|
|
44
|
+
"volcengine-plan",
|
|
45
|
+
"byteplus-plan",
|
|
46
|
+
"stepfun-plan",
|
|
47
|
+
"stepfun-plan-cn",
|
|
48
|
+
"stepfun-plan-intl"
|
|
49
|
+
]);
|
|
50
|
+
profiles = {
|
|
51
|
+
"qwen-token-plan-cn": {
|
|
52
|
+
brand: "Alibaba Bailian",
|
|
53
|
+
name: "Bailian subscription · Beijing",
|
|
54
|
+
access: "subscription",
|
|
55
|
+
credential: "api-key",
|
|
56
|
+
interactiveOnly: false,
|
|
57
|
+
apiKeyUrl: "https://bailian.console.aliyun.com/cn-beijing/subscription/overview"
|
|
58
|
+
},
|
|
59
|
+
"xopc-cloud": {
|
|
60
|
+
brand: "XOPC Cloud",
|
|
61
|
+
name: "XOPC Cloud",
|
|
62
|
+
access: "account",
|
|
63
|
+
credential: "oauth",
|
|
64
|
+
interactiveOnly: false
|
|
65
|
+
},
|
|
66
|
+
"xiaomi-token-plan-cn": {
|
|
67
|
+
brand: "Xiaomi MiMo",
|
|
68
|
+
name: "MiMo Token Plan · China",
|
|
69
|
+
access: "subscription",
|
|
70
|
+
credential: "api-key",
|
|
71
|
+
interactiveOnly: false,
|
|
72
|
+
apiKeyUrl: "https://platform.xiaomimimo.com/"
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}));
|
|
76
|
+
//#endregion
|
|
77
|
+
init_profiles();
|
|
78
|
+
export { getProviderSetupProfile, init_profiles, isInteractiveOnlyProvider };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ModelSetupUse } from '@xopcai/gateway-contract';
|
|
2
|
+
import { type Config } from '../../config/schema.js';
|
|
3
|
+
export type VoiceSetupUse = Extract<ModelSetupUse, 'speech' | 'transcription' | 'conversation'>;
|
|
4
|
+
export type SetupVoiceModel = {
|
|
5
|
+
ref: string;
|
|
6
|
+
name: string;
|
|
7
|
+
provider: string;
|
|
8
|
+
model: string;
|
|
9
|
+
voice?: string;
|
|
10
|
+
recommended?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type SetupVoiceState = {
|
|
13
|
+
revision: string;
|
|
14
|
+
current: Partial<Record<VoiceSetupUse, string>>;
|
|
15
|
+
choices: Record<VoiceSetupUse, SetupVoiceModel[]>;
|
|
16
|
+
};
|
|
17
|
+
export declare const voiceSetupUses: VoiceSetupUse[];
|
|
18
|
+
export declare function readSetupVoiceState(provider: string, config: Config): SetupVoiceState;
|
|
19
|
+
/** Voice lives in the existing app configuration; never copy the provider secret. */
|
|
20
|
+
export declare function applySetupVoice(config: Config, assignments: Array<{
|
|
21
|
+
use: VoiceSetupUse;
|
|
22
|
+
model: SetupVoiceModel;
|
|
23
|
+
}>): Config;
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { ConfigSchema, init_schema } from "../../config/schema.js";
|
|
2
|
+
import { voiceSupportsMode } from "../../../packages/realtime-protocol/src/voice-catalog.js";
|
|
3
|
+
import { init_voice } from "../../../packages/realtime-protocol/src/voice.js";
|
|
4
|
+
import { getModelCatalogStore, init_model_catalog_store } from "../model-catalog-store.js";
|
|
5
|
+
import { BAILIAN_PLAN_HOST, BAILIAN_PLAN_OMNI_MODEL, BAILIAN_PLAN_OMNI_VOICE, BAILIAN_PLAN_PROVIDER, BAILIAN_PLAN_STT_MODEL, BAILIAN_PLAN_TTS_MODEL, BAILIAN_PLAN_TTS_VOICE } from "../../voice/token-plan.js";
|
|
6
|
+
import { listSttProvidersForApi } from "../../voice/stt/list-providers.js";
|
|
7
|
+
import { listTtsProvidersForApi } from "../../voice/tts/list-providers.js";
|
|
8
|
+
import { selectPlatformVoice } from "../../voice/platform-settings.js";
|
|
9
|
+
import { createHash } from "node:crypto";
|
|
10
|
+
//#region src/providers/setup/voice.ts
|
|
11
|
+
init_voice();
|
|
12
|
+
init_schema();
|
|
13
|
+
init_model_catalog_store();
|
|
14
|
+
const voiceSetupUses = [
|
|
15
|
+
"transcription",
|
|
16
|
+
"speech",
|
|
17
|
+
"conversation"
|
|
18
|
+
];
|
|
19
|
+
function readSetupVoiceState(provider, config) {
|
|
20
|
+
const tts = config.messages?.tts;
|
|
21
|
+
const stt = config.tools.media?.audio;
|
|
22
|
+
const omni = config.voice?.realtime?.omni;
|
|
23
|
+
const choices = {
|
|
24
|
+
speech: [],
|
|
25
|
+
transcription: [],
|
|
26
|
+
conversation: []
|
|
27
|
+
};
|
|
28
|
+
if (provider === "qwen-token-plan-cn") {
|
|
29
|
+
choices.speech.push({
|
|
30
|
+
ref: `${provider}/${BAILIAN_PLAN_TTS_MODEL}`,
|
|
31
|
+
name: "Qwen Audio 3.0 TTS Plus",
|
|
32
|
+
provider,
|
|
33
|
+
model: BAILIAN_PLAN_TTS_MODEL,
|
|
34
|
+
voice: BAILIAN_PLAN_TTS_VOICE
|
|
35
|
+
});
|
|
36
|
+
choices.transcription.push({
|
|
37
|
+
ref: `${provider}/${BAILIAN_PLAN_STT_MODEL}`,
|
|
38
|
+
name: "Qwen Audio 3.0 ASR Flash",
|
|
39
|
+
provider,
|
|
40
|
+
model: BAILIAN_PLAN_STT_MODEL
|
|
41
|
+
});
|
|
42
|
+
choices.conversation.push({
|
|
43
|
+
ref: `${provider}/${BAILIAN_PLAN_OMNI_MODEL}`,
|
|
44
|
+
name: "Qwen Audio 3.0 Realtime Plus",
|
|
45
|
+
provider,
|
|
46
|
+
model: BAILIAN_PLAN_OMNI_MODEL,
|
|
47
|
+
voice: BAILIAN_PLAN_OMNI_VOICE
|
|
48
|
+
});
|
|
49
|
+
} else if (provider === "xopc-cloud") {
|
|
50
|
+
const source = getModelCatalogStore().getSource(provider);
|
|
51
|
+
for (const model of source?.models ?? []) {
|
|
52
|
+
if (model.availability !== "available" || !model.voice) continue;
|
|
53
|
+
for (const use of voiceSetupUses) {
|
|
54
|
+
const kind = {
|
|
55
|
+
speech: "tts",
|
|
56
|
+
transcription: "stt",
|
|
57
|
+
conversation: "omni"
|
|
58
|
+
}[use];
|
|
59
|
+
if (model.kind !== kind) continue;
|
|
60
|
+
if (!model.voice.modes.includes(use)) continue;
|
|
61
|
+
const voice = use === "transcription" ? void 0 : model.voice.voices.find((voice) => voice.id === model.voice?.defaultVoice && voiceSupportsMode(voice, use))?.id ?? model.voice.voices.find((voice) => voiceSupportsMode(voice, use))?.id;
|
|
62
|
+
if (use !== "transcription" && !voice) continue;
|
|
63
|
+
choices[use].push({
|
|
64
|
+
ref: `${provider}/${model.id}`,
|
|
65
|
+
name: model.name,
|
|
66
|
+
provider,
|
|
67
|
+
model: model.id,
|
|
68
|
+
...voice ? { voice } : {},
|
|
69
|
+
recommended: source?.recommended?.[model.kind] === model.id
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (provider !== "qwen-token-plan-cn" && provider !== "xopc-cloud") for (const [use, entries] of [["transcription", listSttProvidersForApi(config).providers], ["speech", listTtsProvidersForApi(config).providers]]) {
|
|
75
|
+
const entry = entries.find((entry) => entry.id === provider && entry.configured);
|
|
76
|
+
if (!entry) continue;
|
|
77
|
+
const configured = use === "speech" ? tts?.providers?.[provider] : stt?.providers?.[provider];
|
|
78
|
+
const models = entry.models?.length ? entry.models : [{
|
|
79
|
+
id: String(configured?.model ?? "default"),
|
|
80
|
+
name: entry.displayName
|
|
81
|
+
}];
|
|
82
|
+
const currentModel = configured?.model ?? entry.fields.find((field) => field.key === "model")?.defaultValue ?? models[0]?.id;
|
|
83
|
+
const voiceDefault = entry.fields.find((field) => field.key === "voice")?.defaultValue;
|
|
84
|
+
const defaultVoice = typeof voiceDefault === "string" ? voiceDefault : entry.voices?.[0]?.id;
|
|
85
|
+
for (const model of models) choices[use].push({
|
|
86
|
+
ref: `${provider}/${model.id}`,
|
|
87
|
+
name: model.name,
|
|
88
|
+
provider,
|
|
89
|
+
model: model.id,
|
|
90
|
+
...use === "speech" ? { voice: currentModel === model.id && typeof configured?.voice === "string" ? configured.voice : defaultVoice } : {}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
const current = {};
|
|
94
|
+
if (tts?.provider) current.speech = `${tts.provider}/${tts.providers?.[tts.provider]?.model ?? "default"}`;
|
|
95
|
+
if (stt?.provider) current.transcription = `${stt.provider}/${stt.providers?.[stt.provider]?.model ?? "default"}`;
|
|
96
|
+
if (omni) current.conversation = `${omni.provider}/${omni.model}`;
|
|
97
|
+
return {
|
|
98
|
+
current,
|
|
99
|
+
choices,
|
|
100
|
+
revision: createHash("sha256").update(JSON.stringify([
|
|
101
|
+
tts,
|
|
102
|
+
stt,
|
|
103
|
+
config.voice,
|
|
104
|
+
choices
|
|
105
|
+
])).digest("hex")
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/** Voice lives in the existing app configuration; never copy the provider secret. */
|
|
109
|
+
function applySetupVoice(config, assignments) {
|
|
110
|
+
let next = structuredClone(config);
|
|
111
|
+
for (const { use, model } of assignments) {
|
|
112
|
+
if (model.provider === "xopc-cloud") next = selectPlatformVoice(next, {
|
|
113
|
+
mode: use,
|
|
114
|
+
model: model.model,
|
|
115
|
+
...model.voice ? { voice: model.voice } : {}
|
|
116
|
+
});
|
|
117
|
+
else if (model.provider === "qwen-token-plan-cn") if (use === "speech") {
|
|
118
|
+
const current = next.messages?.tts;
|
|
119
|
+
const previous = current?.providers?.[model.provider];
|
|
120
|
+
const voice = (!previous?.model || previous.model === model.model) && typeof previous?.voice === "string" ? previous.voice : model.voice;
|
|
121
|
+
next.messages ??= {};
|
|
122
|
+
next.messages.tts = {
|
|
123
|
+
enabled: true,
|
|
124
|
+
provider: model.provider,
|
|
125
|
+
trigger: "off",
|
|
126
|
+
maxTextLength: 512,
|
|
127
|
+
timeoutMs: 6e4,
|
|
128
|
+
...current,
|
|
129
|
+
providers: {
|
|
130
|
+
...current?.providers,
|
|
131
|
+
[model.provider]: {
|
|
132
|
+
...previous,
|
|
133
|
+
model: model.model,
|
|
134
|
+
voice
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
next.messages.tts.provider = model.provider;
|
|
139
|
+
next.messages.tts.enabled = true;
|
|
140
|
+
} else if (use === "transcription") {
|
|
141
|
+
next.tools.media ??= {};
|
|
142
|
+
const current = next.tools.media.audio;
|
|
143
|
+
next.tools.media.audio = {
|
|
144
|
+
...current,
|
|
145
|
+
enabled: true,
|
|
146
|
+
provider: model.provider,
|
|
147
|
+
fallback: {
|
|
148
|
+
enabled: false,
|
|
149
|
+
order: []
|
|
150
|
+
},
|
|
151
|
+
models: [{
|
|
152
|
+
provider: model.provider,
|
|
153
|
+
model: model.model,
|
|
154
|
+
capabilities: ["audio"]
|
|
155
|
+
}],
|
|
156
|
+
providers: {
|
|
157
|
+
...current?.providers,
|
|
158
|
+
[model.provider]: {
|
|
159
|
+
...current?.providers?.[model.provider],
|
|
160
|
+
model: model.model
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
} else {
|
|
165
|
+
next = ConfigSchema.parse({
|
|
166
|
+
...next,
|
|
167
|
+
voice: next.voice ?? {}
|
|
168
|
+
});
|
|
169
|
+
next.voice.realtime.enabled = true;
|
|
170
|
+
next.voice.realtime.omni = {
|
|
171
|
+
provider: BAILIAN_PLAN_PROVIDER,
|
|
172
|
+
model: model.model,
|
|
173
|
+
voice: model.voice,
|
|
174
|
+
baseUrl: `${BAILIAN_PLAN_HOST.replace("https:", "wss:")}/api-ws/v1/realtime`,
|
|
175
|
+
instructions: next.voice?.realtime.omni?.instructions ?? "Keep replies conversational and concise. You cannot execute tools."
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
else if (use === "speech") {
|
|
179
|
+
const current = next.messages?.tts;
|
|
180
|
+
next.messages ??= {};
|
|
181
|
+
next.messages.tts = {
|
|
182
|
+
enabled: true,
|
|
183
|
+
trigger: "off",
|
|
184
|
+
maxTextLength: 512,
|
|
185
|
+
timeoutMs: 6e4,
|
|
186
|
+
...current,
|
|
187
|
+
provider: model.provider,
|
|
188
|
+
providers: {
|
|
189
|
+
...current?.providers,
|
|
190
|
+
[model.provider]: {
|
|
191
|
+
...current?.providers?.[model.provider],
|
|
192
|
+
model: model.model,
|
|
193
|
+
...model.voice ? { voice: model.voice } : {}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
next.messages.tts.enabled = true;
|
|
198
|
+
} else if (use === "transcription") {
|
|
199
|
+
next.tools.media ??= {};
|
|
200
|
+
const current = next.tools.media.audio;
|
|
201
|
+
next.tools.media.audio = {
|
|
202
|
+
...current,
|
|
203
|
+
enabled: true,
|
|
204
|
+
provider: model.provider,
|
|
205
|
+
providers: {
|
|
206
|
+
...current?.providers,
|
|
207
|
+
[model.provider]: {
|
|
208
|
+
...current?.providers?.[model.provider],
|
|
209
|
+
model: model.model
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
} else throw new Error("No realtime voice configuration binding for this provider");
|
|
214
|
+
if (use === "speech" && next.messages?.tts) next.messages.tts.fallback = {
|
|
215
|
+
enabled: false,
|
|
216
|
+
order: []
|
|
217
|
+
};
|
|
218
|
+
if (use === "conversation" && next.voice) next.voice.realtime.defaultEngine = "omni";
|
|
219
|
+
if (use === "transcription" && next.tools.media?.audio) {
|
|
220
|
+
next.tools.media.audio.fallback = {
|
|
221
|
+
enabled: false,
|
|
222
|
+
order: []
|
|
223
|
+
};
|
|
224
|
+
next.tools.media.audio.models = [{
|
|
225
|
+
provider: model.provider,
|
|
226
|
+
model: model.model,
|
|
227
|
+
capabilities: ["audio"]
|
|
228
|
+
}];
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return ConfigSchema.parse(next);
|
|
232
|
+
}
|
|
233
|
+
//#endregion
|
|
234
|
+
export { applySetupVoice, readSetupVoiceState, voiceSetupUses };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { init_model_usage, modelUsageOriginForCall, withModelUsageOrigin } from "../providers/model-usage.js";
|
|
1
2
|
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../auth/sync-provider-auth.js";
|
|
2
3
|
import { getApiKeySync, init_providers } from "../providers/index.js";
|
|
3
4
|
import { createExtensionAwareStreamFn } from "../providers/extension-stream-bridge.js";
|
|
@@ -7,12 +8,16 @@ import { Agent } from "@earendil-works/pi-agent-core";
|
|
|
7
8
|
//#region src/scenes/agentExecutor.ts
|
|
8
9
|
init_sync_provider_auth();
|
|
9
10
|
init_providers();
|
|
11
|
+
init_model_usage();
|
|
10
12
|
/** A single reasoning turn over host-selected evidence; no tools or delegation. */
|
|
11
13
|
var SceneAgentExecutor = class {
|
|
12
14
|
constructor(resolveModel) {
|
|
13
15
|
this.resolveModel = resolveModel;
|
|
14
16
|
}
|
|
15
17
|
async execute(input) {
|
|
18
|
+
return withModelUsageOrigin(modelUsageOriginForCall(input.usage), () => this.executeScoped(input));
|
|
19
|
+
}
|
|
20
|
+
async executeScoped(input) {
|
|
16
21
|
input.signal.throwIfAborted();
|
|
17
22
|
const stream = createExtensionAwareStreamFn();
|
|
18
23
|
let calls = 0;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
CREATE TABLE discussion_processing (
|
|
2
|
+
discussion_id TEXT PRIMARY KEY REFERENCES discussion_captures(id) ON DELETE CASCADE,
|
|
3
|
+
run_id TEXT NOT NULL UNIQUE,
|
|
4
|
+
audio_sha256 TEXT,
|
|
5
|
+
base_transcript_revision INTEGER NOT NULL,
|
|
6
|
+
force_audio INTEGER NOT NULL DEFAULT 0 CHECK(force_audio IN (0,1)),
|
|
7
|
+
retry_stage TEXT,
|
|
8
|
+
attempt_count INTEGER NOT NULL DEFAULT 0,
|
|
9
|
+
next_attempt_at INTEGER,
|
|
10
|
+
lease_owner TEXT,
|
|
11
|
+
lease_until INTEGER
|
|
12
|
+
);
|
|
13
|
+
CREATE TABLE discussion_transcription_checkpoints (
|
|
14
|
+
run_id TEXT NOT NULL REFERENCES discussion_processing(run_id) ON DELETE CASCADE,
|
|
15
|
+
started_at_ms REAL NOT NULL,
|
|
16
|
+
ended_at_ms REAL NOT NULL,
|
|
17
|
+
result_json TEXT NOT NULL,
|
|
18
|
+
created_at INTEGER NOT NULL,
|
|
19
|
+
PRIMARY KEY(run_id, started_at_ms, ended_at_ms)
|
|
20
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
CREATE TABLE discussion_annotations (
|
|
2
|
+
discussion_id TEXT NOT NULL REFERENCES discussion_captures(id) ON DELETE CASCADE,
|
|
3
|
+
id TEXT NOT NULL,
|
|
4
|
+
kind TEXT NOT NULL CHECK(kind IN ('highlight','question','note')),
|
|
5
|
+
text TEXT NOT NULL,
|
|
6
|
+
anchor_json TEXT NOT NULL,
|
|
7
|
+
revision INTEGER NOT NULL,
|
|
8
|
+
deleted INTEGER NOT NULL DEFAULT 0,
|
|
9
|
+
created_at INTEGER NOT NULL,
|
|
10
|
+
updated_at INTEGER NOT NULL,
|
|
11
|
+
PRIMARY KEY(discussion_id,id)
|
|
12
|
+
);
|
|
13
|
+
CREATE TABLE discussion_media_timeline (
|
|
14
|
+
discussion_id TEXT PRIMARY KEY REFERENCES discussion_captures(id) ON DELETE CASCADE,
|
|
15
|
+
audio_sha256 TEXT NOT NULL,
|
|
16
|
+
timeline_json TEXT NOT NULL
|
|
17
|
+
);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
CREATE TABLE discussion_chapter_progress (
|
|
2
|
+
discussion_id TEXT NOT NULL REFERENCES discussion_captures(id) ON DELETE CASCADE,
|
|
3
|
+
source_sha256 TEXT NOT NULL,
|
|
4
|
+
transcript_revision INTEGER NOT NULL,
|
|
5
|
+
transcript_sha256 TEXT NOT NULL,
|
|
6
|
+
input_hash TEXT NOT NULL,
|
|
7
|
+
position INTEGER NOT NULL,
|
|
8
|
+
chapter_json TEXT NOT NULL,
|
|
9
|
+
PRIMARY KEY(discussion_id, source_sha256, transcript_revision, transcript_sha256, input_hash)
|
|
10
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
CREATE TABLE task_main_update_deliveries_new (
|
|
2
|
+
entry_id TEXT PRIMARY KEY REFERENCES task_collaboration_entries(entry_id) ON DELETE CASCADE,
|
|
3
|
+
conversation_id TEXT NOT NULL REFERENCES sessions(conversation_id) ON DELETE CASCADE,
|
|
4
|
+
status TEXT NOT NULL CHECK (status IN ('pending', 'delivered', 'failed')),
|
|
5
|
+
updated_at INTEGER NOT NULL,
|
|
6
|
+
decision TEXT CHECK (decision IN ('notify', 'silent')),
|
|
7
|
+
decision_reason TEXT,
|
|
8
|
+
decided_at INTEGER,
|
|
9
|
+
failure_count INTEGER NOT NULL DEFAULT 0,
|
|
10
|
+
last_error TEXT
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
INSERT INTO task_main_update_deliveries_new
|
|
14
|
+
(entry_id, conversation_id, status, updated_at, decision, decision_reason, decided_at)
|
|
15
|
+
SELECT entry_id, conversation_id, status, updated_at, decision, decision_reason, decided_at
|
|
16
|
+
FROM task_main_update_deliveries;
|
|
17
|
+
|
|
18
|
+
DROP TABLE task_main_update_deliveries;
|
|
19
|
+
ALTER TABLE task_main_update_deliveries_new RENAME TO task_main_update_deliveries;
|
|
20
|
+
CREATE INDEX idx_task_main_update_deliveries_pending
|
|
21
|
+
ON task_main_update_deliveries(status, updated_at);
|
|
@@ -3,7 +3,7 @@ import type { ApplyMigrationsOptions } from './types.js';
|
|
|
3
3
|
/** Baseline schema version applied from schema.sql on first open. */
|
|
4
4
|
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 165;
|
|
5
5
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
6
|
-
export declare const XOPC_DB_SCHEMA_VERSION =
|
|
6
|
+
export declare const XOPC_DB_SCHEMA_VERSION = 256;
|
|
7
7
|
export declare function resolveMigrationsDir(override?: string): string;
|
|
8
8
|
/**
|
|
9
9
|
* Apply sequential SQL migrations from (currentVersion + 1) through targetVersion.
|