@xopcai/xopc 0.0.286 → 0.0.292
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/README.md +16 -0
- package/README.zh-CN.md +16 -0
- package/dist/browser-ext/dist/assets/{auth-BXCWrPlg.js → auth-C8gJZEsn.js} +15 -3
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +36 -10
- 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-xOhV8FHx.js → activity-store-6lmzUBEr.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BzQbYWEj.js → agent-avatar-dicebear-B-KN7Vxe.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Baxstv7m.js +1 -0
- package/dist/gateway/static/root/assets/agents-flPS95X0.js +1 -0
- package/dist/gateway/static/root/assets/{api-CVJQLBv9.js → api-D6yepxBp.js} +1 -1
- package/dist/gateway/static/root/assets/api-Dnfnl1Gd.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CTyuXkNC.js → app-management-settings-panel-Clx3-koM.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Tk-GJtvF.js → appearance-settings-Dh9-tszr.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-BA-7OrhJ.js → apps-page-Dp2xsMsd.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-O49jeeXo.js → archive-plugin-yBbgFmfo.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-r9lBF2tW.js → attachment-load-7erralOU.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CFFLXYgS.js → automations-page-CUonEZ2x.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-B4GlDw5q.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BpM43vsn.js → binary-plugins-DaoKg78d.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DFrfEcGw.js → block-editor-CSzMTtSP.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-CyHGQwxQ.js → browser-automation-inputs-Cq4sIJt2.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CPkOWfM9.js → browser-automations-page-BcoqlR0A.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-settings-page-BOcseZxg.js → browser-settings-page-CNBpt5_s.js} +3 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Cq2xEfFR.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-qriatUpN.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-BArPeImO.js → channels-status-swr-CVzEYBpX.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-D5Aka4S8.js → chat-terminal-dock-8ulboLW3.js} +2 -2
- package/dist/gateway/static/root/assets/computer-model-settings-CC9cAadg.js +1 -0
- package/dist/gateway/static/root/assets/computer-settings-page-Bx4S_5aZ.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-DMmdLl1C.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-DNtRu6EB.js → date-picker-D-PLqwOO.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-Dng3dIQa.js → dependency-picker-Byi8Pj4r.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BicYycxy.js → desktop-pet-Cz65FJT2.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BEse55eX.js → desktop-pet-settings-Bkl4Ze0r.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-be30HuFI.js → device-pairing-wizard-CIA_xQBM.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-YzhYyuay.js → extension-debug-page-X7zxTl6D.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CEXVIkDl.js → extension-page-DCdlL4LI.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CrlbgK8g.js → extension-settings-page-DQJnK5Sk.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BNuoHXiZ.js → gateway-config-swr-BBovMBQ1.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-BjBrlZtF.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-zMPfje0n.js → gateway-startup-retry-NXDtzZED.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-BtxitqZ3.js → heartbeat-settings-B2lYz7Xz.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-DqqyuD7d.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-B_Tyx74A.js → image-generation-api-D01ieqGC.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-eZciuLw_.js → imports-page-DJG1BJzd.js} +1 -1
- package/dist/gateway/static/root/assets/index-BD5uNzie.css +2 -0
- package/dist/gateway/static/root/assets/index-BN6wV2e0.js +75 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B796W039.js → keyboard-shortcuts-settings-CUpJbykV.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-nUjivsK_.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DXmY5jwM.js → local-apps-page-3uXvbS57.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-D0001I7p.js → locale-store-eliqUnBr.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DBvHm-DU.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-b1MG7s-3.js → management-settings-CX-GlWnS.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-2txE_Blz.js → markdown-view-BIg7cei7.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CDEf3ksI.js → media-plugins-Ba0_Rfpy.js} +1 -1
- package/dist/gateway/static/root/assets/messages-NYDOR8-j.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-Dc39UgwB.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-R7kUqGnr.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-Bi_-DA5J.js → page-tabs-BSAf6FWu.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Dhfdf14p.js → preview-open-alternatives-DD-poGvE.js} +1 -1
- package/dist/gateway/static/root/assets/{proactive-page-BNouL7Tv.js → proactive-page-BO0XQvPb.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BkbZBqBr.js → product-open-page-DtgWUAwT.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-Ng3MMqXN.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-CDchhHzo.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-icwoEKYB.js → registry-api-Dpm3N2h0.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BF3vmGvt.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-bmgxwWpW.js → runtime-tools-settings-panel-MlJvsGiE.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DoZeepCg.js → schema-form-DPs22QFN.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-gUejQ_g6.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-C_a6vOHk.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-sw2bbS2b.js → settings-form-section-hi0uaiG8.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BWF8uac0.js → settings-page-D74V1t2j.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BkIWwcLb.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-BIHYD6-O.js → share-preview-page-BSw02mMX.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DoCUNMfG.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-CDf5qL2o.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-CnJdaqt2.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-dvue6Ish.js → skills-page.utils-D1RxQndr.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DCyxPWCl.js → system-settings-panel-CVRCYwdg.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-C985d6ss.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-CZwYGpbY.js → theme-store-DUHPzKzv.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-__auf8Ww.js → tunnel-api-C0rbTyba.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-Iq83UDt3.js → use-autosave-DIKW1_0g.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-BXMU-s3Y.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-D-QssKik.js → voice-api-key-field-fcggfSSi.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-B0wNN_tE.js → voice-config-api-Bjy8EFqi.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-5NRYg1iI.js → work-discovery-overlay-D-Q7woUy.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Ds2SZjLG.js → workflow-run-setup-panel-C0fSWp3X.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DZmh3rJf.js +6 -0
- package/dist/gateway/static/root/index.html +10 -10
- package/dist/package.js +1 -1
- package/dist/packages/computer-control-contract/src/index.js +196 -0
- package/dist/packages/realtime-client/src/index.js +9 -2
- package/dist/packages/realtime-protocol/src/voice-audio.js +15 -10
- package/dist/packages/realtime-protocol/src/voice-catalog.js +61 -0
- package/dist/packages/realtime-protocol/src/voice.js +257 -248
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +5 -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.js +1 -1
- package/dist/src/agent/embedded/run-turn.js +9 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +4 -2
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/service.js +2 -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/skills/index.js +25 -15
- package/dist/src/agent/skills/parse-skill-metadata.d.ts +5 -1
- package/dist/src/agent/skills/parse-skill-metadata.js +21 -1
- package/dist/src/agent/skills/types.d.ts +7 -0
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -0
- package/dist/src/agent/tool-manuals/computer.js +19 -0
- package/dist/src/agent/tool-manuals/index.js +7 -0
- package/dist/src/agent/tools/computer-use-tool.d.ts +11 -0
- package/dist/src/agent/tools/computer-use-tool.js +86 -0
- package/dist/src/agent/tools/factory.d.ts +2 -0
- package/dist/src/agent/tools/factory.js +30 -0
- package/dist/src/agent-config/index.js +2 -2
- package/dist/src/agent-config/resolver.js +5 -0
- package/dist/src/agent-config/schema.d.ts +32 -0
- package/dist/src/agent-config/schema.js +5 -2
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- 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/capabilities/readiness/from-config.js +14 -2
- package/dist/src/capabilities/readiness/planner.js +3 -2
- package/dist/src/capabilities/readiness/types.d.ts +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +3 -3
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/computer/broker.d.ts +97 -0
- package/dist/src/computer/broker.js +337 -0
- package/dist/src/computer/config.d.ts +9 -0
- package/dist/src/computer/config.js +16 -0
- package/dist/src/computer/control-guard.d.ts +4 -0
- package/dist/src/computer/control-guard.js +17 -0
- package/dist/src/computer/errors.d.ts +7 -0
- package/dist/src/computer/errors.js +30 -0
- package/dist/src/computer/model-adapter.d.ts +44 -0
- package/dist/src/computer/model-adapter.js +273 -0
- package/dist/src/computer/model-config.d.ts +3 -0
- package/dist/src/computer/model-config.js +27 -0
- package/dist/src/computer/model-policy.d.ts +3 -0
- package/dist/src/computer/model-policy.js +20 -0
- package/dist/src/computer/runtime.d.ts +128 -0
- package/dist/src/computer/runtime.js +388 -0
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.d.ts +36 -0
- package/dist/src/config/models-json.js +15 -1
- package/dist/src/config/schema.d.ts +37 -0
- package/dist/src/config/schema.js +11 -2
- package/dist/src/config/voice.js +2 -2
- package/dist/src/endpoint-tools/invocation-service.d.ts +1 -0
- package/dist/src/endpoint-tools/invocation-service.js +5 -2
- package/dist/src/endpoint-tools/policy.js +7 -0
- package/dist/src/endpoint-tools/runtime.js +1 -0
- package/dist/src/endpoint-tools/upload-service.d.ts +13 -1
- package/dist/src/endpoint-tools/upload-service.js +73 -8
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +7 -1
- package/dist/src/gateway/agent-builtin-tools.js +7 -0
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/global-defaults-admin.js +16 -0
- package/dist/src/gateway/hono/lib/config-payload.d.ts +15 -0
- package/dist/src/gateway/hono/lib/config-payload.js +2 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +13 -2
- package/dist/src/gateway/hono/routes/endpoint-compatibility.d.ts +2 -0
- package/dist/src/gateway/hono/routes/endpoint-compatibility.js +20 -0
- package/dist/src/gateway/hono/routes/endpoint-tools.js +3 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/models.js +6 -3
- package/dist/src/gateway/hono/routes/voice.js +55 -1
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/security/gateway-scopes.d.ts +1 -1
- package/dist/src/gateway/security/gateway-scopes.js +3 -0
- package/dist/src/gateway/service/config-coordinator.js +4 -1
- package/dist/src/gateway/service.js +5 -5
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-catalog-persistence.js +11 -2
- package/dist/src/providers/model-catalog-store.js +1 -0
- package/dist/src/providers/model-catalog-types.d.ts +7 -2
- package/dist/src/providers/model-reference-auditor.js +6 -3
- package/dist/src/providers/model-registry.js +4 -1
- package/dist/src/providers/model-supplements.js +18 -2
- package/dist/src/providers/presentation.js +4 -2
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/providers/xopc-cloud-model-source.js +10 -4
- package/dist/src/realtime/runtime.js +9 -0
- package/dist/src/storage/sqlite/index.d.ts +1 -1
- package/dist/src/storage/sqlite/index.js +2 -2
- package/dist/src/storage/sqlite/migrations/conversation-backup.d.ts +8 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.js +17 -7
- package/dist/src/storage/sqlite/migrations/conversation-windows-owners.js +5 -2
- package/dist/src/storage/sqlite/migrations/discover.js +2 -2
- package/dist/src/storage/sqlite/migrations/errors.d.ts +5 -0
- package/dist/src/storage/sqlite/migrations/errors.js +12 -2
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -2
- package/dist/src/storage/sqlite/schema.js +2 -2
- package/dist/src/storage/sqlite/schema.sql +2641 -526
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +2 -2
- package/dist/src/voice/platform-catalog.d.ts +81 -0
- package/dist/src/voice/platform-catalog.js +16 -0
- package/dist/src/voice/platform-settings.d.ts +4 -0
- package/dist/src/voice/platform-settings.js +120 -0
- package/dist/src/voice/platform-streams.d.ts +12 -0
- package/dist/src/voice/platform-streams.js +250 -0
- package/dist/src/voice/realtime/omniEngine.js +8 -5
- package/dist/src/voice/realtime/omniRoute.d.ts +1 -0
- package/dist/src/voice/realtime/omniRoute.js +11 -1
- package/dist/src/voice/realtime/runtime.js +14 -6
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +15 -8
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +12 -19
- package/dist/src/work-discovery/service.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +5 -2
- package/skills/creative/algorithmic-art/SKILL.md +7 -0
- package/skills/creative/frontend-design/SKILL.md +8 -0
- package/skills/creative/hatch-pet/SKILL.md +7 -0
- package/skills/creative/theme-factory/SKILL.md +8 -0
- package/skills/documents/doc-coauthoring/SKILL.md +7 -0
- package/skills/documents/docx/SKILL.md +7 -0
- package/skills/documents/pdf/SKILL.md +7 -0
- package/skills/documents/pptx/SKILL.md +7 -0
- package/skills/documents/xlsx/SKILL.md +9 -1
- package/skills/engineering/build-xopc-local-app/SKILL.md +7 -0
- package/skills/engineering/define-task/SKILL.md +7 -0
- package/skills/engineering/diagnose/SKILL.md +8 -0
- package/skills/engineering/tdd/SKILL.md +8 -0
- package/skills/tools/find-skills/SKILL.md +8 -0
- package/skills/tools/github/SKILL.md +7 -0
- package/skills/tools/summarize/SKILL.md +8 -0
- package/skills/tools/webapp-testing/SKILL.md +8 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BxR5eog4.js +0 -1
- package/dist/gateway/static/root/assets/agents-Dx1om1eN.js +0 -1
- package/dist/gateway/static/root/assets/api-q1kIMCLW.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-DUZE1NOH.js +0 -6
- package/dist/gateway/static/root/assets/capabilities-settings-panel-ohEV64hG.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-UOf9mgqt.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BEQR0NRq.js +0 -2
- package/dist/gateway/static/root/assets/gateway-settings-CDJY1AOW.js +0 -1
- package/dist/gateway/static/root/assets/home-page-_oqo0pNR.js +0 -1
- package/dist/gateway/static/root/assets/index--YC42LAz.css +0 -2
- package/dist/gateway/static/root/assets/index-fVtuw2o9.js +0 -75
- package/dist/gateway/static/root/assets/local-app-workbench-page-Z8mpau9d.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-BGOO8ouT.js +0 -2
- package/dist/gateway/static/root/assets/messages-BWANv-N-.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-Bm33_3xJ.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-C32-xssK.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-CZ7glGYw.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DP3ZINZz.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-xqJcPdOO.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BaxIfjpm.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cy3Ab3Vg.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BuYto2mT.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DKtWUneq.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Dn7ElMUk.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-D-7UtJIc.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-efmH43Pq.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-DByIJcQq.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-BJv3eoKR.js +0 -6
- package/dist/src/storage/sqlite/migrations/002_add_flush_columns.sql +0 -3
- package/dist/src/storage/sqlite/migrations/003_add_note_markdown_meta.sql +0 -4
- package/dist/src/storage/sqlite/migrations/004_add_session_type_metadata.sql +0 -15
- package/dist/src/storage/sqlite/migrations/005_add_note_agent_contexts.sql +0 -10
- package/dist/src/storage/sqlite/migrations/006_add_goals.sql +0 -108
- package/dist/src/storage/sqlite/migrations/007_goal_run_judge_schema.sql +0 -4
- package/dist/src/storage/sqlite/migrations/008_goal_queue_workflow_runs.sql +0 -53
- package/dist/src/storage/sqlite/migrations/009_cron_jobs.sql +0 -24
- package/dist/src/storage/sqlite/migrations/010_session_id_identity.sql +0 -30
- package/dist/src/storage/sqlite/migrations/011_goal_context_messages.sql +0 -8
- package/dist/src/storage/sqlite/migrations/012_memory_records.sql +0 -63
- package/dist/src/storage/sqlite/migrations/013_memory_trace_events.sql +0 -21
- package/dist/src/storage/sqlite/migrations/014_memory_record_governance.sql +0 -10
- package/dist/src/storage/sqlite/migrations/015_memory_trace_feedback.sql +0 -4
- package/dist/src/storage/sqlite/migrations/016_automations.sql +0 -47
- package/dist/src/storage/sqlite/migrations/017_automation_run_events.sql +0 -14
- package/dist/src/storage/sqlite/migrations/018_automation_safety.sql +0 -1
- package/dist/src/storage/sqlite/migrations/019_projects.sql +0 -40
- package/dist/src/storage/sqlite/migrations/020_project_default_agent.sql +0 -1
- package/dist/src/storage/sqlite/migrations/021_projects_fts.sql +0 -21
- package/dist/src/storage/sqlite/migrations/022_work_items.sql +0 -61
- package/dist/src/storage/sqlite/migrations/023_work_item_attachments.sql +0 -15
- package/dist/src/storage/sqlite/migrations/024_activity_events.sql +0 -62
- package/dist/src/storage/sqlite/migrations/025_project_pinned_at.sql +0 -5
- package/dist/src/storage/sqlite/migrations/026_goal_contracts.sql +0 -10
- package/dist/src/storage/sqlite/migrations/027_mobile_notifications.sql +0 -43
- package/dist/src/storage/sqlite/migrations/028_goal_evidence_requirements.sql +0 -47
- package/dist/src/storage/sqlite/migrations/029_user_understanding.sql +0 -133
- package/dist/src/storage/sqlite/migrations/030_connectors.sql +0 -94
- package/dist/src/storage/sqlite/migrations/031_connector_approvals.sql +0 -24
- package/dist/src/storage/sqlite/migrations/032_connector_webhook_deliveries.sql +0 -15
- package/dist/src/storage/sqlite/migrations/033_user_trust_policies.sql +0 -6
- package/dist/src/storage/sqlite/migrations/034_allow_global_auto_trust.sql +0 -14
- package/dist/src/storage/sqlite/migrations/035_user_profile_prompt_state.sql +0 -7
- package/dist/src/storage/sqlite/migrations/036_goal_outcome_metric.sql +0 -12
- package/dist/src/storage/sqlite/migrations/037_connected_knowledge_pipeline.sql +0 -47
- package/dist/src/storage/sqlite/migrations/038_user_owned_memory.sql +0 -68
- package/dist/src/storage/sqlite/migrations/039_memory_reference_consents.sql +0 -19
- package/dist/src/storage/sqlite/migrations/040_local_apps.sql +0 -32
- package/dist/src/storage/sqlite/migrations/041_local_app_release_lifecycle.sql +0 -17
- package/dist/src/storage/sqlite/migrations/042_work_discovery.sql +0 -41
- package/dist/src/storage/sqlite/migrations/043_local_app_acceptance_runs.sql +0 -16
- package/dist/src/storage/sqlite/migrations/044_repair_work_discovery_foreign_keys.sql +0 -75
- package/dist/src/storage/sqlite/migrations/045_extension_ui_grants.sql +0 -13
- package/dist/src/storage/sqlite/migrations/046_work_discovery_feedback.sql +0 -13
- package/dist/src/storage/sqlite/migrations/047_work_discovery_sources.sql +0 -16
- package/dist/src/storage/sqlite/migrations/048_work_understanding_investigations.sql +0 -40
- package/dist/src/storage/sqlite/migrations/049_work_understanding_threads.sql +0 -52
- package/dist/src/storage/sqlite/migrations/050_work_discovery_source_refreshes.sql +0 -15
- package/dist/src/storage/sqlite/migrations/051_focus_watches.sql +0 -26
- package/dist/src/storage/sqlite/migrations/052_proactive_insights.sql +0 -25
- package/dist/src/storage/sqlite/migrations/053_browser_recipes.sql +0 -45
- package/dist/src/storage/sqlite/migrations/054_task_outcomes.sql +0 -24
- package/dist/src/storage/sqlite/migrations/055_relationship_settings.sql +0 -14
- package/dist/src/storage/sqlite/migrations/056_task_verification.sql +0 -6
- package/dist/src/storage/sqlite/migrations/057_interaction_states.sql +0 -11
- package/dist/src/storage/sqlite/migrations/058_proactive_value.sql +0 -3
- package/dist/src/storage/sqlite/migrations/059_composer_input_history.sql +0 -8
- package/dist/src/storage/sqlite/migrations/060_remove_runtime_transcript_messages.sql +0 -45
- package/dist/src/storage/sqlite/migrations/061_drop_compaction_checkpoints.sql +0 -2
- package/dist/src/storage/sqlite/migrations/062_connector_learning_jobs.sql +0 -27
- package/dist/src/storage/sqlite/migrations/063_knowledge_collection_scopes.sql +0 -14
- package/dist/src/storage/sqlite/migrations/064_user_claims.sql +0 -60
- package/dist/src/storage/sqlite/migrations/065_knowledge_item_scope_identity.sql +0 -116
- package/dist/src/storage/sqlite/migrations/066_first_class_focuses.sql +0 -126
- package/dist/src/storage/sqlite/migrations/067_home_attention_acknowledgements.sql +0 -9
- package/dist/src/storage/sqlite/migrations/068_proactive_event_spine.sql +0 -71
- package/dist/src/storage/sqlite/migrations/069_proactive_scenario_control.sql +0 -69
- package/dist/src/storage/sqlite/migrations/070_proactive_execution.sql +0 -55
- package/dist/src/storage/sqlite/migrations/071_proactive_inbox.sql +0 -45
- package/dist/src/storage/sqlite/migrations/072_proactive_judgments.sql +0 -14
- package/dist/src/storage/sqlite/migrations/073_enable_default_proactive_scenarios.sql +0 -13
- package/dist/src/storage/sqlite/migrations/074_deduplicate_blocked_work_routing.sql +0 -5
- package/dist/src/storage/sqlite/migrations/075_connector_sync_policies.sql +0 -13
- package/dist/src/storage/sqlite/migrations/076_meeting_preparation_scenario.sql +0 -29
- package/dist/src/storage/sqlite/migrations/077_proactive_insight_fingerprints.sql +0 -4
- package/dist/src/storage/sqlite/migrations/078_discussion_captures.sql +0 -64
- package/dist/src/storage/sqlite/migrations/079_discussion_follow_up_scenario.sql +0 -29
- package/dist/src/storage/sqlite/migrations/080_task_outcome_context.sql +0 -15
- package/dist/src/storage/sqlite/migrations/081_project_monitoring_policies.sql +0 -10
- package/dist/src/storage/sqlite/migrations/082_one_click_live_discussions.sql +0 -100
- package/dist/src/storage/sqlite/migrations/083_session_task_plans.sql +0 -9
- package/dist/src/storage/sqlite/migrations/084_work_intake_lifecycle.sql +0 -26
- package/dist/src/storage/sqlite/migrations/085_task_outcome_projection.sql +0 -19
- package/dist/src/storage/sqlite/migrations/086_outcome_aggregates.sql +0 -168
- package/dist/src/storage/sqlite/migrations/087_context_snapshots.sql +0 -21
- package/dist/src/storage/sqlite/migrations/088_automation_execution_deadlines.sql +0 -5
- package/dist/src/storage/sqlite/migrations/089_automation_run_leases.sql +0 -8
- package/dist/src/storage/sqlite/migrations/090_outcome_contract_judgment.sql +0 -2
- package/dist/src/storage/sqlite/migrations/091_context_allocation.sql +0 -1
- package/dist/src/storage/sqlite/migrations/092_outcome_execution_runtime.sql +0 -88
- package/dist/src/storage/sqlite/migrations/093_remove_legacy_goals.sql +0 -174
- package/dist/src/storage/sqlite/migrations/094_outcome_judgment_and_authority.sql +0 -3
- package/dist/src/storage/sqlite/migrations/095_session_input_queue.sql +0 -35
- package/dist/src/storage/sqlite/migrations/096_drop_work_intakes.sql +0 -6
- package/dist/src/storage/sqlite/migrations/097_work_item_lifecycle.sql +0 -194
- package/dist/src/storage/sqlite/migrations/098_discussion_note_documents.sql +0 -99
- package/dist/src/storage/sqlite/migrations/099_task_model.sql +0 -500
- package/dist/src/storage/sqlite/migrations/100_project_task_taskrun.sql +0 -763
- package/dist/src/storage/sqlite/migrations/101_session_response_language.sql +0 -1
- package/dist/src/storage/sqlite/migrations/102_session_user_context_mode.sql +0 -2
- package/dist/src/storage/sqlite/migrations/103_finalize_structured_memory.sql +0 -3
- package/dist/src/storage/sqlite/migrations/104_turn_memory_feedback.sql +0 -77
- package/dist/src/storage/sqlite/migrations/105_dreaming_ledger.sql +0 -34
- package/dist/src/storage/sqlite/migrations/106_dreaming_run_reproducibility.sql +0 -2
- package/dist/src/storage/sqlite/migrations/107_connector_accounts.sql +0 -146
- package/dist/src/storage/sqlite/migrations/108_repair_user_memory_provider.sql +0 -18
- package/dist/src/storage/sqlite/migrations/109_endpoint_principals.sql +0 -14
- package/dist/src/storage/sqlite/migrations/110_session_input_origin.sql +0 -43
- package/dist/src/storage/sqlite/migrations/111_endpoint_tool_invocations.sql +0 -18
- package/dist/src/storage/sqlite/migrations/112_endpoint_instance_bindings.sql +0 -8
- package/dist/src/storage/sqlite/migrations/113_memory_evidence_single_source.sql +0 -76
- package/dist/src/storage/sqlite/migrations/114_user_context_domain.sql +0 -193
- package/dist/src/storage/sqlite/migrations/115_remove_legacy_user_context.sql +0 -6
- package/dist/src/storage/sqlite/migrations/116_structured_context_consolidation.sql +0 -38
- package/dist/src/storage/sqlite/migrations/117_unified_understanding_sources.sql +0 -110
- package/dist/src/storage/sqlite/migrations/118_task_board_rank.sql +0 -6
- package/dist/src/storage/sqlite/migrations/119_proactive_disposition.sql +0 -13
- package/dist/src/storage/sqlite/migrations/120_task_conversation.sql +0 -112
- package/dist/src/storage/sqlite/migrations/121_automation_inbox.sql +0 -24
- package/dist/src/storage/sqlite/migrations/122_automation_session_projects.sql +0 -18
- package/dist/src/storage/sqlite/migrations/123_remove_v2_compaction_boundaries.sql +0 -25
- package/dist/src/storage/sqlite/migrations/124_workflow_context_snapshots.sql +0 -15
- package/dist/src/storage/sqlite/migrations/125_project_workflow_presets.sql +0 -12
- package/dist/src/storage/sqlite/migrations/126_focus_context_governance.sql +0 -72
- package/dist/src/storage/sqlite/migrations/127_context_object_origin.sql +0 -36
- package/dist/src/storage/sqlite/migrations/128_context_extraction.sql +0 -73
- package/dist/src/storage/sqlite/migrations/129_focus_versions.sql +0 -51
- package/dist/src/storage/sqlite/migrations/130_context_evidence_provenance.sql +0 -18
- package/dist/src/storage/sqlite/migrations/131_session_input_contexts.sql +0 -2
- package/dist/src/storage/sqlite/migrations/132_transcript_source_context_metadata.sql +0 -34
- package/dist/src/storage/sqlite/migrations/133_archive_legacy_work_discovery_profile_facts.sql +0 -11
- package/dist/src/storage/sqlite/migrations/134_memory_provenance.sql +0 -18
- package/dist/src/storage/sqlite/migrations/135_user_people.sql +0 -59
- package/dist/src/storage/sqlite/migrations/136_product_notifications.sql +0 -79
- package/dist/src/storage/sqlite/migrations/137_understanding_status_audit.sql +0 -71
- package/dist/src/storage/sqlite/migrations/138_device_access.sql +0 -96
- package/dist/src/storage/sqlite/migrations/139_turn_outcome_artifact_backfill.sql +0 -231
- package/dist/src/storage/sqlite/migrations/140_endpoint_session_bindings.sql +0 -8
- package/dist/src/storage/sqlite/migrations/141_device_pairing_approval.sql +0 -17
- package/dist/src/storage/sqlite/migrations/142_session_input_instance.sql +0 -1
- package/dist/src/storage/sqlite/migrations/143_fixed_session_model.sql +0 -1
- package/dist/src/storage/sqlite/migrations/144_execution_environments.sql +0 -59
- package/dist/src/storage/sqlite/migrations/145_project_execution_mode.sql +0 -5
- package/dist/src/storage/sqlite/migrations/146_understanding_focus_exclusions.sql +0 -9
- package/dist/src/storage/sqlite/migrations/147_durable_application_state.sql +0 -39
- package/dist/src/storage/sqlite/migrations/148_user_model_foundation.sql +0 -554
- package/dist/src/storage/sqlite/migrations/149_separate_source_index_from_memory.sql +0 -18
- package/dist/src/storage/sqlite/migrations/150_session_connection_waits.sql +0 -47
- package/dist/src/storage/sqlite/migrations/151_proactive_scope_cleanup.sql +0 -6
- package/dist/src/storage/sqlite/migrations/152_proactive_scenario_contract.sql +0 -140
- package/dist/src/storage/sqlite/migrations/153_browser_control_v2.sql +0 -45
- package/dist/src/storage/sqlite/migrations/154_session_clarification_waits.sql +0 -60
- package/dist/src/storage/sqlite/migrations/155_browser_extension.sql +0 -120
- package/dist/src/storage/sqlite/migrations/156_browser_tab_bindings.sql +0 -14
- package/dist/src/storage/sqlite/migrations/157_browser_endpoint_principals.sql +0 -50
- package/dist/src/storage/sqlite/migrations/158_browser_native_enrollment.sql +0 -4
- package/dist/src/storage/sqlite/migrations/159_proactive_controls.sql +0 -68
- package/dist/src/storage/sqlite/migrations/160_proactive_web_push.sql +0 -27
- package/dist/src/storage/sqlite/migrations/161_proactive_delivery_and_lifecycle.sql +0 -51
- package/dist/src/storage/sqlite/migrations/162_proactive_product.sql +0 -7
- package/dist/src/storage/sqlite/migrations/163_proactive_follow_ups.sql +0 -29
- package/dist/src/storage/sqlite/migrations/164_browser_sessions.sql +0 -8
- package/dist/src/storage/sqlite/migrations/165_device_pairing_target.sql +0 -40
- package/dist/src/storage/sqlite/migrations/__tests__/mobile-discussion-source.test.ts +0 -20
- package/dist/src/storage/sqlite/migrations/conversation-backup.ts +0 -66
- package/dist/src/storage/sqlite/migrations/conversation-key-decoder.ts +0 -50
- package/dist/src/storage/sqlite/migrations/conversation-uuid.ts +0 -324
- package/dist/src/storage/sqlite/migrations/conversation-windows-owners.ts +0 -71
- package/dist/src/storage/sqlite/migrations/discover.ts +0 -52
- package/dist/src/storage/sqlite/migrations/errors.ts +0 -32
- package/dist/src/storage/sqlite/migrations/runner.ts +0 -204
- package/dist/src/storage/sqlite/migrations/types.ts +0 -15
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { voiceSelectionSchema } from "../../../../packages/realtime-protocol/src/voice-catalog.js";
|
|
2
|
+
import { createVoiceSessionRequestSchema, init_voice } from "../../../../packages/realtime-protocol/src/voice.js";
|
|
1
3
|
import { getDefaultModelSync, init_providers, resolveModel } from "../../../providers/index.js";
|
|
2
4
|
import { completeWithResolvedCredentials } from "../../../providers/model-call.js";
|
|
3
5
|
import { resolveTtsProviderConfigSlice } from "../../../voice/tts/config-slice.js";
|
|
@@ -14,15 +16,16 @@ import "../../../voice/stt/index.js";
|
|
|
14
16
|
import { listSttProvidersForApi } from "../../../voice/stt/list-providers.js";
|
|
15
17
|
import "../../../voice/tts/index.js";
|
|
16
18
|
import { withModelConfigLock } from "../../../session/model-config-lock.js";
|
|
17
|
-
import { createVoiceSessionRequestSchema } from "../../../../packages/realtime-protocol/src/voice.js";
|
|
18
19
|
import { resolveOmniRoute } from "../../../voice/realtime/omniRoute.js";
|
|
19
20
|
import { VoiceSessionCreationError, resolveStreamingStt, resolveStreamingTts } from "../../../voice/realtime/runtime.js";
|
|
20
21
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
21
22
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
23
|
+
import { selectPlatformVoice, voiceSettingsCatalog } from "../../../voice/platform-settings.js";
|
|
22
24
|
import { listLocalVoiceModelStatuses, removeLocalVoiceModel, startLocalVoiceModelInstall } from "../../../voice/local/model-manager.js";
|
|
23
25
|
import { listTtsProvidersForApi } from "../../../voice/tts/list-providers.js";
|
|
24
26
|
import { z } from "zod";
|
|
25
27
|
//#region src/gateway/hono/routes/voice.ts
|
|
28
|
+
init_voice();
|
|
26
29
|
init_providers();
|
|
27
30
|
const log = createGatewayRouteLogger("Voice");
|
|
28
31
|
function readVoiceApiKeyFromConfigFileOnly(cfg, kind, providerId) {
|
|
@@ -117,6 +120,57 @@ async function refineTranscript(raw, config, signal) {
|
|
|
117
120
|
}
|
|
118
121
|
function registerVoiceRoutes(authenticated, deps) {
|
|
119
122
|
const { service, strictRateLimitMiddleware } = deps;
|
|
123
|
+
authenticated.get("/api/voice/catalog", (c) => c.json({
|
|
124
|
+
ok: true,
|
|
125
|
+
payload: voiceSettingsCatalog(service.currentConfig)
|
|
126
|
+
}));
|
|
127
|
+
authenticated.post("/api/voice/catalog/refresh", strictRateLimitMiddleware, async (c) => {
|
|
128
|
+
const result = await service.getModelCatalogSync().refreshNow();
|
|
129
|
+
if (result.error || result.state !== "ready") return c.json({
|
|
130
|
+
ok: false,
|
|
131
|
+
error: {
|
|
132
|
+
code: "CATALOG_REFRESH_FAILED",
|
|
133
|
+
message: "Voice catalog could not be refreshed"
|
|
134
|
+
}
|
|
135
|
+
}, 503);
|
|
136
|
+
return c.json({
|
|
137
|
+
ok: true,
|
|
138
|
+
payload: voiceSettingsCatalog(service.currentConfig)
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
authenticated.put("/api/voice/selection", strictRateLimitMiddleware, async (c) => {
|
|
142
|
+
const parsed = z.strictObject({
|
|
143
|
+
revision: z.string(),
|
|
144
|
+
selection: voiceSelectionSchema
|
|
145
|
+
}).safeParse(await c.req.json().catch(() => null));
|
|
146
|
+
if (!parsed.success) return c.json({
|
|
147
|
+
ok: false,
|
|
148
|
+
error: { message: "Invalid voice selection" }
|
|
149
|
+
}, 400);
|
|
150
|
+
return withModelConfigLock("__voice_settings__", async () => {
|
|
151
|
+
if (voiceSettingsCatalog(service.currentConfig).revision !== parsed.data.revision) return c.json({
|
|
152
|
+
ok: false,
|
|
153
|
+
error: { message: "Voice settings changed; refresh before saving" }
|
|
154
|
+
}, 409);
|
|
155
|
+
try {
|
|
156
|
+
const next = selectPlatformVoice(service.currentConfig, parsed.data.selection);
|
|
157
|
+
const result = await service.saveConfig(next);
|
|
158
|
+
if (!result.saved) return c.json({
|
|
159
|
+
ok: false,
|
|
160
|
+
error: { message: result.error }
|
|
161
|
+
}, 500);
|
|
162
|
+
return c.json({
|
|
163
|
+
ok: true,
|
|
164
|
+
payload: voiceSettingsCatalog(service.currentConfig)
|
|
165
|
+
});
|
|
166
|
+
} catch (error) {
|
|
167
|
+
return c.json({
|
|
168
|
+
ok: false,
|
|
169
|
+
error: { message: error instanceof Error ? error.message : "Voice selection failed" }
|
|
170
|
+
}, 400);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
});
|
|
120
174
|
authenticated.get("/api/voice/realtime/status", async (c) => {
|
|
121
175
|
const config = service.currentConfig;
|
|
122
176
|
const stt = resolveStreamingStt(config);
|
|
@@ -7,10 +7,10 @@ import { WorkflowNameConflictError, WorkflowRevisionConflictError, createWorkflo
|
|
|
7
7
|
import "../../../workflows/domain/index.js";
|
|
8
8
|
import { resolveWorkflowRunArtifactsDir } from "../../../workflows/store/paths.js";
|
|
9
9
|
import { WorkflowDraftService } from "../../../workflows/draft/workflow-draft-service.js";
|
|
10
|
-
import "../../../workflows/draft/index.js";
|
|
11
|
-
import { ProjectWorkflowPresetRepository } from "../../../workflows/project-presets/project-workflow-preset-repository.js";
|
|
12
10
|
import { WorkflowDraftConflictError, WorkflowDraftStore } from "../../../workflows/authoring/workflow-draft-store.js";
|
|
13
11
|
import "../../../workflows/authoring/index.js";
|
|
12
|
+
import "../../../workflows/draft/index.js";
|
|
13
|
+
import { ProjectWorkflowPresetRepository } from "../../../workflows/project-presets/project-workflow-preset-repository.js";
|
|
14
14
|
import { basename, join } from "node:path";
|
|
15
15
|
import { readFile, stat } from "node:fs/promises";
|
|
16
16
|
//#region src/gateway/hono/routes/workflows.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const GATEWAY_SCOPES: readonly ["gateway.status", "agents.read", "agents.run", "sessions.read", "sessions.write", "workspace.read", "workspace.write", "tasks.read", "tasks.write", "automations.read", "automations.write", "notifications.self", "device.self", "gateway.admin"];
|
|
1
|
+
export declare const GATEWAY_SCOPES: readonly ["voice.configure", "gateway.status", "agents.read", "agents.run", "sessions.read", "sessions.write", "workspace.read", "workspace.write", "tasks.read", "tasks.write", "automations.read", "automations.write", "notifications.self", "device.self", "gateway.admin"];
|
|
2
2
|
export type GatewayScope = typeof GATEWAY_SCOPES[number];
|
|
3
3
|
export declare const DEFAULT_MOBILE_SCOPES: readonly GatewayScope[];
|
|
4
4
|
export declare const DEFAULT_BROWSER_EXTENSION_SCOPES: readonly GatewayScope[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
//#region src/gateway/security/gateway-scopes.ts
|
|
2
2
|
const GATEWAY_SCOPES = [
|
|
3
|
+
"voice.configure",
|
|
3
4
|
"gateway.status",
|
|
4
5
|
"agents.read",
|
|
5
6
|
"agents.run",
|
|
@@ -17,6 +18,7 @@ const GATEWAY_SCOPES = [
|
|
|
17
18
|
];
|
|
18
19
|
const KNOWN_GATEWAY_SCOPES = new Set(GATEWAY_SCOPES);
|
|
19
20
|
const DEFAULT_MOBILE_SCOPES = [
|
|
21
|
+
"voice.configure",
|
|
20
22
|
"gateway.status",
|
|
21
23
|
"agents.read",
|
|
22
24
|
"agents.run",
|
|
@@ -70,6 +72,7 @@ function requiredGatewayScope(method, path) {
|
|
|
70
72
|
if (path.startsWith("/api/home") || path.startsWith("/api/inbox")) return methodScope(method, "tasks.read", "tasks.write");
|
|
71
73
|
if (path.startsWith("/api/automations") || path.startsWith("/api/automation-runs")) return methodScope(method, "automations.read", "automations.write");
|
|
72
74
|
if (path.startsWith("/api/workflows")) return methodScope(method, "automations.read", "automations.write");
|
|
75
|
+
if (path === "/api/voice/selection" || path === "/api/voice/catalog/refresh") return "voice.configure";
|
|
73
76
|
if (path.startsWith("/api/voice") || path.startsWith("/api/media") || path.startsWith("/api/clarifications")) return "sessions.write";
|
|
74
77
|
if (path.startsWith("/api/commands") || path.startsWith("/api/skills")) return methodScope(method, "agents.read", "gateway.admin");
|
|
75
78
|
if (path === "/api/discussions" || path.startsWith("/api/discussions/") || path === "/api/discussion-capture/settings" || path.startsWith("/api/workspace") || path.startsWith("/api/files") || path.startsWith("/api/projects") || path.startsWith("/api/notes") || path.startsWith("/api/shares")) return methodScope(method, "workspace.read", "workspace.write");
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
4
3
|
import { getModelRegistry } from "../../providers/model-registry.js";
|
|
4
|
+
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
5
5
|
import { init_providers } from "../../providers/index.js";
|
|
6
6
|
import { disposeAllSessionMcpRuntimes } from "../../agent/mcp/bundle-mcp-runtime.js";
|
|
7
7
|
import { reloadImageGenerationProviders } from "../../agent/image/generation/provider-registry.js";
|
|
8
8
|
import "../../agent/mcp/bundle-mcp-tools.js";
|
|
9
9
|
import { ConfigHotReloader } from "../../config/reload.js";
|
|
10
10
|
import "../../config/index.js";
|
|
11
|
+
import { validateComputerModelChanges } from "../../computer/model-config.js";
|
|
11
12
|
import { computeBundledExtensionExtensionsPatch } from "../../extensions/bundled-extension-activation.js";
|
|
12
13
|
import { sanitizeTunnelConfig } from "../../tunnel/tunnel-config.js";
|
|
13
14
|
//#region src/gateway/service/config-coordinator.ts
|
|
@@ -72,6 +73,7 @@ var GatewayConfigCoordinator = class {
|
|
|
72
73
|
}
|
|
73
74
|
async saveConfig(config) {
|
|
74
75
|
try {
|
|
76
|
+
validateComputerModelChanges(config, this.opts.getConfig());
|
|
75
77
|
await this.writeConfigAndReloadFromDisk(config);
|
|
76
78
|
this.scheduleChannelPluginsAfterPersist();
|
|
77
79
|
return { saved: true };
|
|
@@ -96,6 +98,7 @@ var GatewayConfigCoordinator = class {
|
|
|
96
98
|
...this.opts.getConfig(),
|
|
97
99
|
...updates
|
|
98
100
|
};
|
|
101
|
+
validateComputerModelChanges(merged, this.opts.getConfig());
|
|
99
102
|
this.opts.setConfig(merged);
|
|
100
103
|
await this.writeConfigAndReloadFromDisk(merged);
|
|
101
104
|
this.scheduleChannelPluginsAfterPersist();
|
|
@@ -13,17 +13,17 @@ import { getSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
|
13
13
|
import "../storage/sqlite/index.js";
|
|
14
14
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
15
15
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
16
|
-
import { init_agent_session_key, resolveAgentMainConversationId } from "../routing/agent-session-key.js";
|
|
17
|
-
import { init_session_key, resolveConversationId, sanitizeSegment } from "../routing/session-key.js";
|
|
18
|
-
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
19
|
-
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
20
16
|
import { init_paths, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
|
|
17
|
+
import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
21
18
|
import { areExtensionsGloballyDisabled } from "../extensions/discover-extensions.js";
|
|
22
19
|
import { buildExtensionMetadataSnapshot } from "../extensions/extension-metadata-snapshot.js";
|
|
23
20
|
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, init_channel_catalog_service } from "../channels/catalog/channel-catalog-service.js";
|
|
24
21
|
import { loadConfig, saveConfig } from "../config/loader.js";
|
|
25
|
-
import {
|
|
22
|
+
import { init_agent_session_key, resolveAgentMainConversationId } from "../routing/agent-session-key.js";
|
|
23
|
+
import { init_session_key, resolveConversationId, sanitizeSegment } from "../routing/session-key.js";
|
|
24
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
26
25
|
import { init_providers, providers_exports } from "../providers/index.js";
|
|
26
|
+
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
27
27
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
28
28
|
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
29
29
|
import { getEmbeddedExecutionSession } from "../agent/embedded/execution-context.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
2
1
|
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
2
|
+
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
3
3
|
import { getDefaultAuthProfileStore } from "./auth-profile-store.js";
|
|
4
4
|
//#region src/providers/auth-runtime/resolve-auth.ts
|
|
5
5
|
init_env_keys();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __esmMin, __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
3
|
-
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
4
|
-
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
5
3
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
6
4
|
import { init_model_ref, splitProviderModelRef } from "./model-ref.js";
|
|
7
5
|
import { ModelRegistry, getModelRegistry, init_model_registry, prewarmModelRegistry, resetModelRegistry } from "./model-registry.js";
|
|
6
|
+
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
8
7
|
import { CredentialResolver, hasCredentials, init_credentials } from "../auth/credentials.js";
|
|
8
|
+
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
9
9
|
import { EXTENSION_PROVIDER_BASE_URL, init_constants } from "./constants.js";
|
|
10
10
|
import { applyOfficialModelMetadataCorrections, getSupplementalModels, init_model_supplements } from "./model-supplements.js";
|
|
11
11
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { init_paths_state, resolveXopcCloudCatalogCachePath } from "../config/paths-state.js";
|
|
3
|
+
import { ComputerProfileSchema, init_src } from "../../packages/computer-control-contract/src/index.js";
|
|
3
4
|
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
5
|
+
import { voiceManifestSchema } from "../../packages/realtime-protocol/src/voice-catalog.js";
|
|
6
|
+
import { init_voice } from "../../packages/realtime-protocol/src/voice.js";
|
|
4
7
|
import { readFileSync, rmSync } from "node:fs";
|
|
5
8
|
import { z } from "zod";
|
|
6
9
|
import { rm } from "node:fs/promises";
|
|
7
10
|
//#region src/providers/model-catalog-persistence.ts
|
|
8
11
|
var MAX_CATALOG_BYTES, imageGenerationSchema, sttSchema, ttsSchema, catalogModelSchema, persistedCatalogSchema, ModelCatalogPersistence;
|
|
9
12
|
var init_model_catalog_persistence = __esmMin((() => {
|
|
13
|
+
init_voice();
|
|
14
|
+
init_src();
|
|
10
15
|
init_paths_state();
|
|
11
16
|
init_write_file_atomic();
|
|
12
17
|
MAX_CATALOG_BYTES = 4 * 1024 * 1024;
|
|
@@ -71,8 +76,11 @@ var init_model_catalog_persistence = __esmMin((() => {
|
|
|
71
76
|
"language",
|
|
72
77
|
"image",
|
|
73
78
|
"stt",
|
|
74
|
-
"tts"
|
|
79
|
+
"tts",
|
|
80
|
+
"omni"
|
|
75
81
|
]),
|
|
82
|
+
voice: voiceManifestSchema.optional(),
|
|
83
|
+
computerUse: z.object({ profile: ComputerProfileSchema }).strict().optional(),
|
|
76
84
|
input: z.array(z.enum([
|
|
77
85
|
"text",
|
|
78
86
|
"image",
|
|
@@ -89,7 +97,8 @@ var init_model_catalog_persistence = __esmMin((() => {
|
|
|
89
97
|
"images.generate",
|
|
90
98
|
"images.edit",
|
|
91
99
|
"audio.transcription",
|
|
92
|
-
"audio.speech"
|
|
100
|
+
"audio.speech",
|
|
101
|
+
"audio.conversation"
|
|
93
102
|
])),
|
|
94
103
|
reasoning: z.boolean(),
|
|
95
104
|
contextWindow: z.number().int().positive(),
|
|
@@ -84,6 +84,7 @@ var init_model_catalog_store = __esmMin((() => {
|
|
|
84
84
|
formats: [...model.imageGeneration.formats],
|
|
85
85
|
backgrounds: [...model.imageGeneration.backgrounds]
|
|
86
86
|
} } : {},
|
|
87
|
+
...model.voice ? { voice: structuredClone(model.voice) } : {},
|
|
87
88
|
...model.stt ? { stt: {
|
|
88
89
|
...model.stt,
|
|
89
90
|
inputFormats: [...model.stt.inputFormats],
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import type { VoiceManifest } from '@xopcai/realtime-protocol/voice';
|
|
1
2
|
export interface CatalogModel {
|
|
3
|
+
voice?: VoiceManifest;
|
|
4
|
+
computerUse?: {
|
|
5
|
+
profile: 'gui-plus-2026-02-26' | 'structured-tools-v1';
|
|
6
|
+
};
|
|
2
7
|
id: string;
|
|
3
8
|
name: string;
|
|
4
9
|
displayNames?: Partial<Record<'zh-CN' | 'en', string>>;
|
|
5
10
|
availability: 'available' | 'unavailable';
|
|
6
|
-
kind: 'language' | 'image' | 'stt' | 'tts';
|
|
11
|
+
kind: 'language' | 'image' | 'stt' | 'tts' | 'omni';
|
|
7
12
|
input: Array<'text' | 'image' | 'audio'>;
|
|
8
13
|
output: Array<'text' | 'image' | 'audio'>;
|
|
9
|
-
operations: Array<'chat.completions' | 'responses' | 'images.generate' | 'images.edit' | 'audio.transcription' | 'audio.speech'>;
|
|
14
|
+
operations: Array<'chat.completions' | 'responses' | 'images.generate' | 'images.edit' | 'audio.transcription' | 'audio.speech' | 'audio.conversation'>;
|
|
10
15
|
reasoning: boolean;
|
|
11
16
|
contextWindow: number;
|
|
12
17
|
maxOutputTokens: number | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { init_model_policy, isComputerModel } from "../computer/model-policy.js";
|
|
1
2
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
2
3
|
import { getModelRegistry, init_model_registry } from "./model-registry.js";
|
|
3
4
|
import { parseImageGenerationModelRef } from "../agent/image/generation/model-ref.js";
|
|
@@ -5,6 +6,7 @@ import { getImageGenerationProvider } from "../agent/image/generation/provider-r
|
|
|
5
6
|
//#region src/providers/model-reference-auditor.ts
|
|
6
7
|
init_model_catalog_store();
|
|
7
8
|
init_model_registry();
|
|
9
|
+
init_model_policy();
|
|
8
10
|
function asRecord(value) {
|
|
9
11
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
10
12
|
}
|
|
@@ -37,6 +39,7 @@ function collectModelPolicy(out, value, location) {
|
|
|
37
39
|
if (Array.isArray(route.fallbacks)) route.fallbacks.forEach((ref, index) => addRef(out, ref, `${location}.intents.${intent}.fallbacks[${index}]`));
|
|
38
40
|
}
|
|
39
41
|
collectToolModel(out, policy.imageUnderstanding, `${location}.imageUnderstanding`);
|
|
42
|
+
collectToolModel(out, policy.computerUse, `${location}.computerUse`, "computer-use");
|
|
40
43
|
collectToolModel(out, policy.imageGeneration, `${location}.imageGeneration`, "image-generation");
|
|
41
44
|
}
|
|
42
45
|
function collectReferences(config, sessionConfigs) {
|
|
@@ -50,9 +53,9 @@ function suggestedRef(ref, catalog) {
|
|
|
50
53
|
const providerId = ref.split("/")[0];
|
|
51
54
|
const source = Object.values(catalog.sources).find((entry) => entry.providerId === providerId);
|
|
52
55
|
if (!source) return void 0;
|
|
53
|
-
const available = new Set(source.models.filter((model) => model.availability === "available").map((model) => model.id));
|
|
56
|
+
const available = new Set(source.models.filter((model) => model.availability === "available" && !model.computerUse).map((model) => model.id));
|
|
54
57
|
if (source.recommendedModel && available.has(source.recommendedModel)) return `${providerId}/${source.recommendedModel}`;
|
|
55
|
-
const first = source.models.find((model) => model.availability === "available");
|
|
58
|
+
const first = source.models.find((model) => model.availability === "available" && !model.computerUse);
|
|
56
59
|
return first ? `${providerId}/${first.id}` : void 0;
|
|
57
60
|
}
|
|
58
61
|
function hasImageGenerationModel(ref) {
|
|
@@ -71,7 +74,7 @@ function auditModelReferences(config, sessionConfigs = /* @__PURE__ */ new Map()
|
|
|
71
74
|
grouped.set(reference.ref, references);
|
|
72
75
|
}
|
|
73
76
|
return [...grouped.entries()].map(([ref, references]) => {
|
|
74
|
-
const availability = references.every((reference) => reference.kind === "image-generation" ? resolveImageGenerationModel(ref) : Boolean(registry.resolve(ref))) ? "available" : "unavailable";
|
|
77
|
+
const availability = references.every((reference) => reference.kind === "image-generation" ? resolveImageGenerationModel(ref) : reference.kind === "computer-use" ? isComputerModel(registry.resolve(ref)) : Boolean(registry.resolve(ref))) ? "available" : "unavailable";
|
|
75
78
|
const textOnly = references.every((reference) => reference.kind === "text");
|
|
76
79
|
const suggestion = availability === "unavailable" && textOnly ? suggestedRef(ref, catalog) : void 0;
|
|
77
80
|
return {
|
|
@@ -1,8 +1,8 @@
|
|
|
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 { resolveModelsJsonPath } from "../config/paths.js";
|
|
5
4
|
import { init_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
5
|
+
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
6
6
|
import { getDefaultModelValues, init_models_json, validateModelsConfig } from "../config/models-json.js";
|
|
7
7
|
import { getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
8
8
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
@@ -78,6 +78,7 @@ function applyModelOverride(model, override) {
|
|
|
78
78
|
} : model.headers;
|
|
79
79
|
}
|
|
80
80
|
result.compat = mergeCompat(model.compat, override.compat);
|
|
81
|
+
if (override.computerUse) Object.assign(result, { computerUse: override.computerUse });
|
|
81
82
|
return result;
|
|
82
83
|
}
|
|
83
84
|
function getModelRegistry() {
|
|
@@ -239,6 +240,7 @@ var init_model_registry = __esmMin((() => {
|
|
|
239
240
|
}
|
|
240
241
|
return Object.values(sources).flatMap((source) => source.models.filter((model) => model.availability === "available" && model.kind === "language").map((model) => ({
|
|
241
242
|
id: model.id,
|
|
243
|
+
computerUse: model.computerUse,
|
|
242
244
|
name: model.name,
|
|
243
245
|
api: source.api,
|
|
244
246
|
provider: source.providerId,
|
|
@@ -364,6 +366,7 @@ var init_model_registry = __esmMin((() => {
|
|
|
364
366
|
}
|
|
365
367
|
models.push({
|
|
366
368
|
id: modelDef.id,
|
|
369
|
+
computerUse: modelDef.computerUse,
|
|
367
370
|
name: modelDef.name ?? modelDef.id,
|
|
368
371
|
api,
|
|
369
372
|
provider: providerName,
|
|
@@ -16,11 +16,27 @@ function applyOfficialModelMetadataCorrections(model) {
|
|
|
16
16
|
*/
|
|
17
17
|
function getSupplementalModels() {
|
|
18
18
|
const gpt56Sol = getModel("openai", "gpt-5.6-sol");
|
|
19
|
-
|
|
20
|
-
return [{
|
|
19
|
+
return [...gpt56Sol ? [{
|
|
21
20
|
...gpt56Sol,
|
|
22
21
|
id: "gpt-5.6",
|
|
23
22
|
name: "GPT-5.6"
|
|
23
|
+
}] : [], {
|
|
24
|
+
id: "gui-plus-2026-02-26",
|
|
25
|
+
name: "GUI-Plus (2026-02-26)",
|
|
26
|
+
provider: "dashscope-cn",
|
|
27
|
+
api: "openai-completions",
|
|
28
|
+
baseUrl: "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
|
29
|
+
reasoning: true,
|
|
30
|
+
input: ["text", "image"],
|
|
31
|
+
contextWindow: 262144,
|
|
32
|
+
maxTokens: 32768,
|
|
33
|
+
cost: {
|
|
34
|
+
input: 0,
|
|
35
|
+
output: 0,
|
|
36
|
+
cacheRead: 0,
|
|
37
|
+
cacheWrite: 0
|
|
38
|
+
},
|
|
39
|
+
computerUse: { profile: "gui-plus-2026-02-26" }
|
|
24
40
|
}];
|
|
25
41
|
}
|
|
26
42
|
var STALE_OPENAI_CONTEXT_WINDOW, OPENAI_CONTEXT_WINDOW_CORRECTIONS;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { init_model_policy, isComputerModel } from "../computer/model-policy.js";
|
|
1
2
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
2
3
|
import { PROVIDER_META, getAllModels, getAllProviders, getModelsByProvider, getProviderDisplayName, init_providers, isProviderConfigured } from "./index.js";
|
|
3
4
|
import { getDomesticProviderPreset, getDomesticProviderPresetIds } from "./domestic-presets.js";
|
|
4
5
|
//#region src/providers/presentation.ts
|
|
5
6
|
init_providers();
|
|
6
7
|
init_plugin_registry();
|
|
8
|
+
init_model_policy();
|
|
7
9
|
const FEATURED_PROVIDER_ORDER = [
|
|
8
10
|
"xopc-cloud",
|
|
9
11
|
"deepseek",
|
|
@@ -244,7 +246,7 @@ function modelToCatalogView(model) {
|
|
|
244
246
|
...model.contextWindow ? { contextWindow: model.contextWindow } : {},
|
|
245
247
|
...model.maxTokens ? { maxTokens: model.maxTokens } : {},
|
|
246
248
|
vision: input.includes("image"),
|
|
247
|
-
recommended: isRecommendedModel(model.provider, model.id)
|
|
249
|
+
recommended: !isComputerModel(model) && isRecommendedModel(model.provider, model.id)
|
|
248
250
|
};
|
|
249
251
|
}
|
|
250
252
|
function presetModelToCatalogView(provider, model) {
|
|
@@ -272,7 +274,7 @@ function sortModelsForPicker(models) {
|
|
|
272
274
|
});
|
|
273
275
|
}
|
|
274
276
|
function getRecommendedModelsForProvider(provider, limit = 4) {
|
|
275
|
-
const fromRegistry = sortModelsForPicker(getModelsByProvider(provider)).filter((model) => isRecommendedModel(provider, model.id)).slice(0, limit).map(modelToCatalogView);
|
|
277
|
+
const fromRegistry = sortModelsForPicker(getModelsByProvider(provider)).filter((model) => !isComputerModel(model) && isRecommendedModel(provider, model.id)).slice(0, limit).map(modelToCatalogView);
|
|
276
278
|
if (fromRegistry.length > 0) return fromRegistry;
|
|
277
279
|
const preset = getDomesticProviderPreset(provider);
|
|
278
280
|
if (!preset) return [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
3
2
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
3
|
+
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
4
4
|
import { XOPC_CLOUD_PROVIDER_ID, init_xopc_cloud_config, resolveXopcModelRouterUrl } from "./xopc-cloud-config.js";
|
|
5
5
|
//#region src/providers/register-runtime-providers.ts
|
|
6
6
|
function registerRuntimeProvider(modelRuntime, source) {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { voiceManifestSchema } from "../../packages/realtime-protocol/src/voice-catalog.js";
|
|
2
|
+
import { init_voice } from "../../packages/realtime-protocol/src/voice.js";
|
|
1
3
|
import { init_xopc_cloud_config, resolveXopcModelRouterUrl } from "./xopc-cloud-config.js";
|
|
2
4
|
import { getProviderAuthService, init_provider_auth_service } from "./provider-auth-service.js";
|
|
3
5
|
//#region src/providers/xopc-cloud-model-source.ts
|
|
6
|
+
init_voice();
|
|
4
7
|
init_provider_auth_service();
|
|
5
8
|
init_xopc_cloud_config();
|
|
6
9
|
var XopcCloudModelError = class extends Error {
|
|
@@ -40,17 +43,20 @@ var XopcCloudModelSource = class {
|
|
|
40
43
|
const models = [...new Map(body.data.filter((model) => typeof model.id === "string" && model.id.length > 0).map((model) => {
|
|
41
44
|
const declaredInput = model.xopc?.capabilities?.input;
|
|
42
45
|
const parsedInput = Array.isArray(declaredInput) ? declaredInput.filter((value) => value === "text" || value === "image" || value === "audio") : [];
|
|
43
|
-
const kind = model.xopc?.kind === "image" || model.xopc?.kind === "stt" || model.xopc?.kind === "tts" ? model.xopc.kind : "language";
|
|
46
|
+
const kind = model.xopc?.kind === "image" || model.xopc?.kind === "stt" || model.xopc?.kind === "tts" || model.xopc?.kind === "omni" ? model.xopc.kind : "language";
|
|
44
47
|
const input = kind === "stt" ? ["audio"] : kind === "tts" ? ["text"] : kind === "language" && !parsedInput.includes("text") ? ["text", ...new Set(parsedInput)] : [...new Set(parsedInput)];
|
|
45
48
|
const maxOutputTokens = model.xopc?.maxOutputTokens;
|
|
46
49
|
const declaredOutput = model.xopc?.capabilities?.output;
|
|
47
50
|
const output = kind === "stt" ? ["text"] : kind === "tts" ? ["audio"] : Array.isArray(declaredOutput) ? declaredOutput.filter((value) => value === "text" || value === "image" || value === "audio") : ["text"];
|
|
48
51
|
const declaredOperations = model.xopc?.operations ?? model.xopc?.capabilities?.operations;
|
|
49
|
-
const operations = kind === "stt" ? ["audio.transcription"] : kind === "tts" ? ["audio.speech"] : Array.isArray(declaredOperations) ? declaredOperations.filter((value) => value === "chat.completions" || value === "responses" || value === "images.generate" || value === "images.edit" || value === "audio.transcription" || value === "audio.speech") : ["chat.completions", "responses"];
|
|
52
|
+
const operations = kind === "omni" ? ["audio.conversation"] : kind === "stt" ? ["audio.transcription"] : kind === "tts" ? ["audio.speech"] : Array.isArray(declaredOperations) ? declaredOperations.filter((value) => value === "chat.completions" || value === "responses" || value === "images.generate" || value === "images.edit" || value === "audio.transcription" || value === "audio.speech") : ["chat.completions", "responses"];
|
|
50
53
|
const generation = parseImageGenerationCapabilities(model.xopc?.capabilities?.imageGeneration);
|
|
51
54
|
const stt = kind === "stt" ? parseSttCapabilities(model.xopc?.capabilities) : void 0;
|
|
52
55
|
const tts = kind === "tts" ? parseTtsCapabilities(model.xopc?.capabilities, model.xopc?.defaultVoice) : void 0;
|
|
56
|
+
const voice = voiceManifestSchema.safeParse(model.xopc?.voice);
|
|
53
57
|
const catalogModel = {
|
|
58
|
+
...voice.success ? { voice: voice.data } : {},
|
|
59
|
+
...["gui-plus-2026-02-26", "structured-tools-v1"].includes(String(model.xopc?.capabilities?.computerUse?.profile)) ? { computerUse: { profile: model.xopc.capabilities.computerUse.profile } } : {},
|
|
54
60
|
id: model.id,
|
|
55
61
|
name: typeof model.xopc?.displayName === "string" && model.xopc.displayName.trim() ? model.xopc.displayName.trim() : model.id,
|
|
56
62
|
...parseDisplayNames(model.xopc?.displayNames),
|
|
@@ -79,7 +85,7 @@ var XopcCloudModelSource = class {
|
|
|
79
85
|
baseUrl: this.routerUrl,
|
|
80
86
|
api: "openai-completions",
|
|
81
87
|
etag: response.headers.get("x-xopc-model-catalog-version"),
|
|
82
|
-
recommendedModel: models
|
|
88
|
+
recommendedModel: models.find((model) => !model.computerUse)?.id ?? null,
|
|
83
89
|
...Object.keys(recommended).length > 0 ? { recommended } : {},
|
|
84
90
|
lastSuccessAt: Date.now()
|
|
85
91
|
},
|
|
@@ -107,7 +113,7 @@ function parseRecommendations(value, models) {
|
|
|
107
113
|
}
|
|
108
114
|
function modelMatchesRecommendation(model, capability) {
|
|
109
115
|
switch (capability) {
|
|
110
|
-
case "vision": return model.kind === "language" && model.input.includes("image");
|
|
116
|
+
case "vision": return model.kind === "language" && model.input.includes("image") && !model.computerUse;
|
|
111
117
|
case "image-generation": return model.kind === "image" && model.operations.includes("images.generate");
|
|
112
118
|
case "stt": return model.kind === "stt" && model.operations.includes("audio.transcription");
|
|
113
119
|
case "tts": return model.kind === "tts" && model.operations.includes("audio.speech");
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { hasGatewayScope } from "../gateway/security/gateway-scopes.js";
|
|
4
|
+
import { EndpointToolPolicyError } from "../endpoint-tools/policy.js";
|
|
4
5
|
import { REALTIME_HEARTBEAT_INTERVAL_MS, REALTIME_HEARTBEAT_TIMEOUT_MS, REALTIME_HELLO_TIMEOUT_MS, REALTIME_MAX_CLIENT_FRAME_BYTES, parseClientRealtimeJsonFrame, parseClientRealtimeMessage } from "../../packages/realtime-protocol/src/index.js";
|
|
5
6
|
import { createPreauthConnectionBudget } from "../gateway/security/preauth-connection-budget.js";
|
|
6
7
|
import { RealtimeBroker } from "./broker.js";
|
|
@@ -246,6 +247,14 @@ var RealtimeRuntime = class {
|
|
|
246
247
|
turnToken: registration.turnToken
|
|
247
248
|
};
|
|
248
249
|
} catch (error) {
|
|
250
|
+
if (error instanceof EndpointToolPolicyError) {
|
|
251
|
+
log.warn({
|
|
252
|
+
err: error,
|
|
253
|
+
principalId: message.payload.endpoint.principalId
|
|
254
|
+
}, "Realtime endpoint contract is incompatible");
|
|
255
|
+
socket.close(4409, "GATEWAY_PROTOCOL_INCOMPATIBLE");
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
249
258
|
log.warn({
|
|
250
259
|
err: error,
|
|
251
260
|
principalId: message.payload.endpoint.principalId
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { resolveXopcDatabasePath, XOPC_DB_FILENAME } from './paths.js';
|
|
2
2
|
export { XOPC_DB_SCHEMA_VERSION, XOPC_DB_BASELINE_SCHEMA_VERSION, SCHEMA_META_SCHEMA_VERSION_KEY, ensureXopcDatabaseSchema, readSchemaVersionForTest, readSchemaVersion, } from './schema.js';
|
|
3
3
|
export { applyPendingMigrations, inspectSchemaMigrationStatus, resolveMigrationsDir, type SchemaMigrationStatus, } from './migrations/runner.js';
|
|
4
|
-
export { DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, } from './migrations/errors.js';
|
|
4
|
+
export { DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, DatabaseSchemaTooOldError, } from './migrations/errors.js';
|
|
5
5
|
export { discoverSqlMigrations, listRegisteredMigrationTargets } from './migrations/discover.js';
|
|
6
6
|
export { closeXopcDatabase, getXopcDatabase, isXopcDatabaseOpen, openXopcDatabase, requireXopcDatabase, resetXopcDatabaseSingletonForTest, type OpenXopcDatabaseOptions, type XopcDatabase, } from './connection.js';
|
|
7
7
|
export { getSqliteDatabase, runSqliteWriteTransaction } from './transaction.js';
|
|
@@ -2,7 +2,7 @@ import { XOPC_DB_FILENAME, resolveXopcDatabasePath } from "../../config/paths-st
|
|
|
2
2
|
import { init_paths } from "./paths.js";
|
|
3
3
|
import { SCHEMA_META_SCHEMA_VERSION_KEY, readSchemaVersion, readSchemaVersionForTest } from "./schema-version.js";
|
|
4
4
|
import { discoverSqlMigrations, init_discover, listRegisteredMigrationTargets } from "./migrations/discover.js";
|
|
5
|
-
import { DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, init_errors } from "./migrations/errors.js";
|
|
5
|
+
import { DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, DatabaseSchemaTooOldError, init_errors } from "./migrations/errors.js";
|
|
6
6
|
import { XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_SCHEMA_VERSION, applyPendingMigrations, init_runner, inspectSchemaMigrationStatus, resolveMigrationsDir } from "./migrations/runner.js";
|
|
7
7
|
import { ensureXopcDatabaseSchema, init_schema } from "./schema.js";
|
|
8
8
|
import { closeXopcDatabase, getXopcDatabase, init_connection, isXopcDatabaseOpen, openXopcDatabase, requireXopcDatabase, resetXopcDatabaseSingletonForTest } from "./connection.js";
|
|
@@ -54,4 +54,4 @@ init_session_metadata();
|
|
|
54
54
|
init_row_mappers();
|
|
55
55
|
init_session_repository();
|
|
56
56
|
//#endregion
|
|
57
|
-
export { COMPOSER_INPUT_HISTORY_LIMIT, DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, SCHEMA_META_SCHEMA_VERSION_KEY, XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_FILENAME, XOPC_DB_SCHEMA_VERSION, acknowledgeHomeAttention, appendCompactionBoundaryIfUnchanged, appendComposerInputHistory, appendConnectorExecutionAudit, appendTranscriptEntry, applyPendingMigrations, authenticateDeviceAccessToken, bindEndpointPrincipal, buildDefaultSessionMetadata, buildGlobalSessionStats, buildRefreshProofMessage, buildRelationshipPrompt, cancelQueuedSessionInput, claimConnectorWebhookDelivery, claimContextExtractionRun, claimKnowledgeSourceItems, claimNextConnectorLearningJob, claimNextSessionInput, classifyStoredRow, clearComposerInputHistory, clearGatewayIdentityForTest, closeTemporalAssertions, closeXopcDatabase, completeConnectorWebhookDelivery, completeKnowledgeSourceItemSynthesis, consumeClarificationApproval, consumeClarificationResume, consumeConnectorApproval, countKnowledgeSourceItems, createClarificationWait, createCollaborationRule, createConnectorApproval, createContextEvidence, createDevice, createDevicePairingSetup, createEndpointPrincipal, createObjectLinkRecord, createTemporalAssertion, decideConnectorApproval, deleteBrowserTabBinding, deleteBrowserTabBindingsByEndpoint, deleteBrowserTabBindingsByPrincipal, deleteConnectorConnection, deleteConnectorInstallation, deleteEndpointSessionBinding, deleteEndpointSessionBindingsByPrincipal, deleteKnowledgeSourceItems, deleteNoteAgentContextRecord, deleteNoteRecord, deleteObjectLinkRecord, deleteSessionConfig, deleteSessionRecord, discoverSqlMigrations, enqueueConnectorLearningJob, ensureSessionRecord, ensureXopcDatabaseSchema, estimateTokensFromMessages, extractFtsContent, findConversationIdByTranscriptId, findSessionInput, finishContextExtractionRun, finishEndpointToolInvocationAudit, finishKnowledgeSyncRun, finishSessionInputRun, getActiveClarification, getActivityEventRecord, getBrowserTabBinding, getBrowserTabBindingById, getCachedConnectorCatalogEntry, getClarification, getClarificationResumeInput, getClarificationSnapshot, getCollaborationRule, getConnectorAccount, getConnectorApproval, getConnectorConnection, getConnectorInstallation, getConnectorSyncPolicy, getConnectorSyncPolicyForConnection, getContextExtractionRun, getCurrentTranscriptId, getDevice, getEndpointPrincipal, getEndpointSessionBinding, getGlobalSessionStats, getInteractionState, getKnowledgeConsumerWatermark, getKnowledgeSourceCursor, getKnowledgeSourceItem, getNoteAgentContextRecord, getNoteRecord, getOrCreateGatewayIdentity, getRelationshipSettings, getSessionConfig, getSessionInputById, getSessionInputState, getSessionMetadata, getSessionPersistedLevels, getSessionTaskPlan, getSqliteDatabase, getUserPeopleIndexState, getUserPerson, getUserTrustPolicy, getXopcDatabase, hasIndependentExtractionOutput, hasSessionConfig, incrementSessionStatsOnAppend, insertSessionInput, inspectSchemaMigrationStatus, isClarificationSuspended, isDevicePairingSetupActive, isHomeAttentionAcknowledged, isProactiveSupportAllowed, isXopcDatabaseOpen, issueDeviceTokenPair, linkContextObjects, listActiveSessionInputRuns, listActivityRecords, listCachedConnectorCatalogEntries, listCollaborationRules, listCompactionBoundaries, listComposerInputHistory, listConnectorAccounts, listConnectorActionMetadata, listConnectorApprovals, listConnectorConnections, listConnectorExecutionAudit, listConnectorInstallations, listConnectorLearningJobs, listConnectorSyncPolicies, listContextExtractionOutputs, listContextExtractionRuns, listContextObjectRelations, listDevices, listEndpointPrincipals, listEndpointToolInvocationAudits, listKnowledgeSourceChanges, listKnowledgeSourceItems, listKnowledgeSyncRuns, listNoteRecords, listObjectActivityRecords, listObjectLinkRecords, listProjectActivityRecords, listRegisteredMigrationTargets, listSessionMetadata, listSessionsByAgent, listTemporalAssertions, listUserPeople, loadCompactionSourceSnapshot, loadLlmMessagesForSession, loadTranscriptHistoryRowsForSession, loadTranscriptRows, loadTranscriptRowsForSession, mergeUserPeople, metadataToSessionInsert, mutateQueuedSessionInput, openXopcDatabase, paginateTranscriptMessages, patchSessionMetadata, pruneBoundedKnowledgeSourceItems, readSchemaVersion, readSchemaVersionForTest, reconcileConnectorAccount, recordActivityEvent, recoverSessionInputState, recoverStaleConnectorLearningJobs, refreshConnectorAccountCurrent, releaseConnectorWebhookDelivery, replaceConnectorCatalogEntries, replaceLatestSessionTurnAndQueueInput, replaceTranscriptRows, replaceUserPeopleIndex, requireXopcDatabase, resetSessionRecord, resetXopcDatabaseSingletonForTest, resolveClarification, resolveMigrationsDir, resolveSessionAgentId, resolveXopcDatabasePath, restoreBeforeCompactionBoundary, revokeDevice, revokeEndpointPrincipal, rotateDeviceRefreshToken, runSqliteWriteTransaction, searchSessionTranscript, sessionConfigRowToConfig, sessionRowToMetadata, setBrowserTabBinding, setCollaborationRuleStatus, setConnectorLearningPaused, setEndpointSessionBinding, setInteractionState, setKnowledgeConsumerWatermark, setKnowledgeSourceCursor, setKnowledgeSourceItemSynthesisStatus, setSessionConfig, setSessionInputStatus, setSessionTaskPlan, setUserTrustPolicy, signGatewayPayload, startEndpointToolInvocationAudit, startKnowledgeSyncRun, summarizeUserPeople, supersedeActiveClarification, touchEndpointPrincipal, transcriptEntryRowToStoredRow, updateConnectorLearningJob, updateInteractionStateFromMessage, updateRelationshipSettings, updateSessionConfig, updateSessionStats, updateUserPerson, upsertConnectorActionMetadata, upsertConnectorCatalogEntry, upsertConnectorConnection, upsertConnectorInstallation, upsertConnectorSyncPolicy, upsertKnowledgeSourceItems, upsertNoteAgentContextRecord, upsertNoteRecord, validateLatestSessionTurnTarget };
|
|
57
|
+
export { COMPOSER_INPUT_HISTORY_LIMIT, DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, DatabaseSchemaTooOldError, SCHEMA_META_SCHEMA_VERSION_KEY, XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_FILENAME, XOPC_DB_SCHEMA_VERSION, acknowledgeHomeAttention, appendCompactionBoundaryIfUnchanged, appendComposerInputHistory, appendConnectorExecutionAudit, appendTranscriptEntry, applyPendingMigrations, authenticateDeviceAccessToken, bindEndpointPrincipal, buildDefaultSessionMetadata, buildGlobalSessionStats, buildRefreshProofMessage, buildRelationshipPrompt, cancelQueuedSessionInput, claimConnectorWebhookDelivery, claimContextExtractionRun, claimKnowledgeSourceItems, claimNextConnectorLearningJob, claimNextSessionInput, classifyStoredRow, clearComposerInputHistory, clearGatewayIdentityForTest, closeTemporalAssertions, closeXopcDatabase, completeConnectorWebhookDelivery, completeKnowledgeSourceItemSynthesis, consumeClarificationApproval, consumeClarificationResume, consumeConnectorApproval, countKnowledgeSourceItems, createClarificationWait, createCollaborationRule, createConnectorApproval, createContextEvidence, createDevice, createDevicePairingSetup, createEndpointPrincipal, createObjectLinkRecord, createTemporalAssertion, decideConnectorApproval, deleteBrowserTabBinding, deleteBrowserTabBindingsByEndpoint, deleteBrowserTabBindingsByPrincipal, deleteConnectorConnection, deleteConnectorInstallation, deleteEndpointSessionBinding, deleteEndpointSessionBindingsByPrincipal, deleteKnowledgeSourceItems, deleteNoteAgentContextRecord, deleteNoteRecord, deleteObjectLinkRecord, deleteSessionConfig, deleteSessionRecord, discoverSqlMigrations, enqueueConnectorLearningJob, ensureSessionRecord, ensureXopcDatabaseSchema, estimateTokensFromMessages, extractFtsContent, findConversationIdByTranscriptId, findSessionInput, finishContextExtractionRun, finishEndpointToolInvocationAudit, finishKnowledgeSyncRun, finishSessionInputRun, getActiveClarification, getActivityEventRecord, getBrowserTabBinding, getBrowserTabBindingById, getCachedConnectorCatalogEntry, getClarification, getClarificationResumeInput, getClarificationSnapshot, getCollaborationRule, getConnectorAccount, getConnectorApproval, getConnectorConnection, getConnectorInstallation, getConnectorSyncPolicy, getConnectorSyncPolicyForConnection, getContextExtractionRun, getCurrentTranscriptId, getDevice, getEndpointPrincipal, getEndpointSessionBinding, getGlobalSessionStats, getInteractionState, getKnowledgeConsumerWatermark, getKnowledgeSourceCursor, getKnowledgeSourceItem, getNoteAgentContextRecord, getNoteRecord, getOrCreateGatewayIdentity, getRelationshipSettings, getSessionConfig, getSessionInputById, getSessionInputState, getSessionMetadata, getSessionPersistedLevels, getSessionTaskPlan, getSqliteDatabase, getUserPeopleIndexState, getUserPerson, getUserTrustPolicy, getXopcDatabase, hasIndependentExtractionOutput, hasSessionConfig, incrementSessionStatsOnAppend, insertSessionInput, inspectSchemaMigrationStatus, isClarificationSuspended, isDevicePairingSetupActive, isHomeAttentionAcknowledged, isProactiveSupportAllowed, isXopcDatabaseOpen, issueDeviceTokenPair, linkContextObjects, listActiveSessionInputRuns, listActivityRecords, listCachedConnectorCatalogEntries, listCollaborationRules, listCompactionBoundaries, listComposerInputHistory, listConnectorAccounts, listConnectorActionMetadata, listConnectorApprovals, listConnectorConnections, listConnectorExecutionAudit, listConnectorInstallations, listConnectorLearningJobs, listConnectorSyncPolicies, listContextExtractionOutputs, listContextExtractionRuns, listContextObjectRelations, listDevices, listEndpointPrincipals, listEndpointToolInvocationAudits, listKnowledgeSourceChanges, listKnowledgeSourceItems, listKnowledgeSyncRuns, listNoteRecords, listObjectActivityRecords, listObjectLinkRecords, listProjectActivityRecords, listRegisteredMigrationTargets, listSessionMetadata, listSessionsByAgent, listTemporalAssertions, listUserPeople, loadCompactionSourceSnapshot, loadLlmMessagesForSession, loadTranscriptHistoryRowsForSession, loadTranscriptRows, loadTranscriptRowsForSession, mergeUserPeople, metadataToSessionInsert, mutateQueuedSessionInput, openXopcDatabase, paginateTranscriptMessages, patchSessionMetadata, pruneBoundedKnowledgeSourceItems, readSchemaVersion, readSchemaVersionForTest, reconcileConnectorAccount, recordActivityEvent, recoverSessionInputState, recoverStaleConnectorLearningJobs, refreshConnectorAccountCurrent, releaseConnectorWebhookDelivery, replaceConnectorCatalogEntries, replaceLatestSessionTurnAndQueueInput, replaceTranscriptRows, replaceUserPeopleIndex, requireXopcDatabase, resetSessionRecord, resetXopcDatabaseSingletonForTest, resolveClarification, resolveMigrationsDir, resolveSessionAgentId, resolveXopcDatabasePath, restoreBeforeCompactionBoundary, revokeDevice, revokeEndpointPrincipal, rotateDeviceRefreshToken, runSqliteWriteTransaction, searchSessionTranscript, sessionConfigRowToConfig, sessionRowToMetadata, setBrowserTabBinding, setCollaborationRuleStatus, setConnectorLearningPaused, setEndpointSessionBinding, setInteractionState, setKnowledgeConsumerWatermark, setKnowledgeSourceCursor, setKnowledgeSourceItemSynthesisStatus, setSessionConfig, setSessionInputStatus, setSessionTaskPlan, setUserTrustPolicy, signGatewayPayload, startEndpointToolInvocationAudit, startKnowledgeSyncRun, summarizeUserPeople, supersedeActiveClarification, touchEndpointPrincipal, transcriptEntryRowToStoredRow, updateConnectorLearningJob, updateInteractionStateFromMessage, updateRelationshipSettings, updateSessionConfig, updateSessionStats, updateUserPerson, upsertConnectorActionMetadata, upsertConnectorCatalogEntry, upsertConnectorConnection, upsertConnectorInstallation, upsertConnectorSyncPolicy, upsertKnowledgeSourceItems, upsertNoteAgentContextRecord, upsertNoteRecord, validateLatestSessionTurnTarget };
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import type { DatabaseSync } from 'node:sqlite';
|
|
2
|
+
type BackupFileSyncOperations = {
|
|
3
|
+
open(path: string, flags: string): number;
|
|
4
|
+
fsync(fd: number): void;
|
|
5
|
+
close(fd: number): void;
|
|
6
|
+
};
|
|
7
|
+
/** Windows requires write access on a file handle before FlushFileBuffers/fsync. */
|
|
8
|
+
export declare function flushBackupFile(backupPath: string, operations?: BackupFileSyncOperations): void;
|
|
2
9
|
/** The old release does not participate in an application lock, so check open handles. */
|
|
3
10
|
export declare function backupBeforeConversationCutover(db: DatabaseSync, databasePath: string): string;
|
|
11
|
+
export {};
|
|
@@ -5,6 +5,15 @@ import { resolve } from "node:path";
|
|
|
5
5
|
import { chmodSync, closeSync, fsyncSync, openSync, readdirSync, readlinkSync, statSync } from "node:fs";
|
|
6
6
|
import { execFileSync } from "node:child_process";
|
|
7
7
|
//#region src/storage/sqlite/migrations/conversation-backup.ts
|
|
8
|
+
/** Windows requires write access on a file handle before FlushFileBuffers/fsync. */
|
|
9
|
+
function flushBackupFile(backupPath, operations = backupFileSyncOperations) {
|
|
10
|
+
const fd = operations.open(backupPath, "r+");
|
|
11
|
+
try {
|
|
12
|
+
operations.fsync(fd);
|
|
13
|
+
} finally {
|
|
14
|
+
operations.close(fd);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
8
17
|
function isSkippableProcError(error) {
|
|
9
18
|
const code = error.code;
|
|
10
19
|
return code === "ENOENT" || code === "EACCES" || code === "EPERM";
|
|
@@ -71,18 +80,19 @@ function backupBeforeConversationCutover(db, databasePath) {
|
|
|
71
80
|
} finally {
|
|
72
81
|
snapshot.close();
|
|
73
82
|
}
|
|
74
|
-
|
|
75
|
-
try {
|
|
76
|
-
fsyncSync(fd);
|
|
77
|
-
} finally {
|
|
78
|
-
closeSync(fd);
|
|
79
|
-
}
|
|
83
|
+
flushBackupFile(backupPath);
|
|
80
84
|
return backupPath;
|
|
81
85
|
}
|
|
86
|
+
var backupFileSyncOperations;
|
|
82
87
|
var init_conversation_backup = __esmMin((() => {
|
|
83
88
|
init_node_sqlite();
|
|
84
89
|
init_conversation_windows_owners();
|
|
90
|
+
backupFileSyncOperations = {
|
|
91
|
+
open: openSync,
|
|
92
|
+
fsync: fsyncSync,
|
|
93
|
+
close: closeSync
|
|
94
|
+
};
|
|
85
95
|
}));
|
|
86
96
|
//#endregion
|
|
87
97
|
init_conversation_backup();
|
|
88
|
-
export { backupBeforeConversationCutover, init_conversation_backup };
|
|
98
|
+
export { backupBeforeConversationCutover, flushBackupFile, init_conversation_backup };
|
|
@@ -38,10 +38,13 @@ using System;
|
|
|
38
38
|
using System.ComponentModel;
|
|
39
39
|
using System.Text;
|
|
40
40
|
using System.Runtime.InteropServices;
|
|
41
|
-
using System.Runtime.InteropServices.ComTypes;
|
|
42
41
|
public static class XopcDatabaseOwners {
|
|
42
|
+
// Keep the native FILETIME layout local. Windows PowerShell exposes two
|
|
43
|
+
// framework FILETIME types, so using that name can make Add-Type ambiguous.
|
|
43
44
|
[StructLayout(LayoutKind.Sequential)]
|
|
44
|
-
public struct
|
|
45
|
+
public struct NativeFileTime { public uint Low; public uint High; }
|
|
46
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
47
|
+
public struct ProcessIdentity { public uint Id; public NativeFileTime StartedAt; }
|
|
45
48
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
|
46
49
|
public struct ProcessInfo {
|
|
47
50
|
public ProcessIdentity Process;
|