@xopcai/xopc 0.0.191 → 0.0.193
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-DstnJCS5.js → activity-store-BwmdJ5pv.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DvEkT222.js → agent-avatar-dicebear-DmNq0t2n.js} +1 -1
- package/dist/gateway/static/root/assets/agents-BOo1rVn9.js +68 -0
- package/dist/gateway/static/root/assets/{api-BTL9kayv.js → api-BM1hNzjw.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-COpP_pKN.js → app-management-settings-panel-B3xStqSX.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DTVNUEDq.js → appearance-settings-DglyenDq.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DC9qPFTx.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-IpX6VA0o.js → archive-plugin-DvtcrBss.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CKVFNUi1.js → attachment-load-CALdq4xM.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-BIGGKb0T.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BrfvfOS4.js → binary-plugins-GaVuvrDI.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-D9sEfg32.js → block-editor-C2KrMYa_.js} +4 -4
- package/dist/gateway/static/root/assets/browser-settings-page-CPW_E-xj.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-BixZ5lCR.js → browser-workflow-inputs-FfEEjhIS.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-YEFuodJI.js → browser-workflows-page-DFP9_UQk.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CsD8aGHU.js +7 -0
- package/dist/gateway/static/root/assets/capability-presets-api-BoOzFotX.js +1 -0
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-NCeyWH6Z.js +3 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-BThDGiO3.js → channel-recipient-api-_8IiTxRB.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-CknzwxNC.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-DPaJSYX_.js +1 -0
- package/dist/gateway/static/root/assets/{code-editor-D4_k-6QN.js → code-editor-dFzqyDXS.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-BMMqC0_9.js → connectors-api-vaSrhPF8.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DEGE7xp_.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-Bm8koRoD.js → cron-expression-BjFuXlGY.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-DOdkHdPv.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-CMG3mcaJ.js → desktop-pet-Dz-Yf8Uu.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-D8aaPb0x.js → desktop-pet-settings-C8EHFEtd.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-C95yW03b.js → directory-picker-path-field-DKbfmZlZ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DsG7Z9lV.js → extension-debug-page-Dq0xsr_e.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CUAXEbAt.js → extension-page-IgSLUyWP.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-VC-8Pjn2.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-api-DL70Nakc.js → gateway-config-api-CH2R7yqo.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BgDxQ08c.js → gateway-settings-DLQJWaBQ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-EO9mKvzE.js → gateway-startup-retry--2njcDpC.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-BX7q55uZ.js → heartbeat-settings-43loWoGb.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-DqvpI6LC.js +3 -0
- package/dist/gateway/static/root/assets/html-workspace-editor-bXK5tq64.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-Bu7PyVSh.js → image-generation-api-Cki7jfEV.js} +1 -1
- package/dist/gateway/static/root/assets/index-BpkdvHH0.js +150 -0
- package/dist/gateway/static/root/assets/index-CFVjH-EK.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Dt6wS5zW.js → keyboard-shortcuts-settings-DJDZes_8.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CvNQM6qm.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DcD3-N00.js → local-apps-page-C2ajOn1D.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-deR2zRaE.js → locale-store-Bjvw7jtg.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-BLm5yWqQ.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-B6EVkJQy.js → management-settings--_eXnFVr.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-editor-BvUebh3C.js → markdown-editor-TWGaF7Xa.js} +2 -2
- package/dist/gateway/static/root/assets/{markdown-split-CHUjCnBh.js → markdown-split-iL2oi-x2.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DRrtI2O0.js → media-plugins-BIbkLVpQ.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DQ5X6cXp.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-fermYvpI.js → notes-page-xFxaZ6gT.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-PAftxL3V.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-BO262zuu.js → page-tabs-CROi9zm1.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-yZYTy-2e.js → preview-open-alternatives-BwYcPjOM.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Dgy8XWhR.js → product-open-page-BezeuVFd.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CCdfZcw-.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DOG9zm5e.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-DQBFgveI.js +1 -0
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-Bs6tpSyX.js +5 -0
- package/dist/gateway/static/root/assets/{schema-form-DdE4gtw_.js → schema-form-CWoSjz9s.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-Db6L6M2H.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CcO2bd6q.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CiYU8AvV.js → settings-form-section-BJaMEHsX.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-Bv03cWib.js → settings-loading-skeleton-sn4k17x7.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-D2hfeFPX.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-layout-t_Ox1slk.js → settings-page-layout-CLtUsWsu.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-UmQC_uZ1.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DF8gW6bo.js → share-preview-page-BJ58AluH.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BZKn6Fdc.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-Cx3i24w_.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DjUllGtk.js +2 -0
- package/dist/gateway/static/root/assets/skills-page.utils-CZYIuE26.js +1 -0
- package/dist/gateway/static/root/assets/style-TIDOdKy0.js +7 -0
- package/dist/gateway/static/root/assets/system-settings-panel-DUrgdQMk.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-BGG2cFe9.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-DnBOcGXi.js → theme-store-DtxpMC5S.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-4XBsLEuv.js → typed-models-lib-CRNMvvFX.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BN2QgFGn.js → use-autosave-Dle3-zdQ.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-BLLmw5S1.js +1 -0
- package/dist/gateway/static/root/assets/{vendor-codemirror--gTq3YAI.js → vendor-codemirror-DRr7hFaD.js} +16 -16
- package/dist/gateway/static/root/assets/voice-api-key-field-BrWH0dCl.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-nmEAafFl.js → work-discovery-overlay-BZ1l9CFM.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BnPF2vx7.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BnNWBDwz.js → workflow-run-setup-panel-BK6e9yzK.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-Bp5JxQJa.js +5 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/gateway/static/root/notification-sw.js +15 -0
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +2 -0
- package/dist/src/agent/agent-manager.js +76 -0
- package/dist/src/agent/background-review/prompts.d.ts +1 -1
- package/dist/src/agent/background-review/prompts.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +3 -12
- package/dist/src/agent/embedded/run-for-session.js +3 -0
- package/dist/src/agent/embedded/run-turn.js +4 -1
- package/dist/src/agent/embedded/session-runner.js +3 -4
- package/dist/src/agent/embedded/types.d.ts +10 -1
- package/dist/src/agent/embedded/xopc-stream-bridge.js +3 -2
- package/dist/src/agent/external-tools/mcp-provider.d.ts +1 -0
- package/dist/src/agent/external-tools/mcp-provider.js +21 -6
- package/dist/src/agent/image/generation/provider-registry.js +1 -0
- package/dist/src/agent/image/generation/providers/dashscope.js +20 -0
- package/dist/src/agent/image/generation/providers/fal.d.ts +1 -1
- package/dist/src/agent/image/generation/providers/fal.js +12 -6
- package/dist/src/agent/image/generation/providers/google.js +8 -0
- package/dist/src/agent/image/generation/providers/minimax.js +20 -0
- package/dist/src/agent/image/generation/providers/openai.js +36 -26
- package/dist/src/agent/image/generation/types.d.ts +13 -0
- package/dist/src/agent/mcp/bundle-mcp-gateway.d.ts +1 -0
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +2 -1
- package/dist/src/agent/mcp/bundle-mcp-policy.d.ts +5 -1
- package/dist/src/agent/mcp/bundle-mcp-policy.js +11 -3
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +3 -2
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +2 -1
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/agent/mcp/mcp-stdio-transport.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.d.ts +2 -1
- package/dist/src/agent/mcp/mcp-transport.js +22 -4
- package/dist/src/agent/memory/compaction.js +19 -17
- package/dist/src/agent/memory/context-budget.js +2 -3
- package/dist/src/agent/memory/understanding/service.d.ts +1 -0
- package/dist/src/agent/memory/understanding/service.js +49 -20
- package/dist/src/agent/memory/understanding/types.d.ts +1 -0
- package/dist/src/agent/memory/user-context-coordinator.js +6 -0
- package/dist/src/agent/orchestration/agent-orchestrator.js +15 -1
- package/dist/src/agent/service/direct-turn-helpers.js +14 -5
- package/dist/src/agent/skills/index.d.ts +1 -1
- package/dist/src/agent/skills/index.js +2 -2
- package/dist/src/agent/skills/installer.d.ts +3 -10
- package/dist/src/agent/skills/installer.js +99 -156
- package/dist/src/agent/skills/marketplace/adapter.types.d.ts +3 -1
- package/dist/src/agent/skills/marketplace/adapters/clawhub/adapter.js +30 -6
- package/dist/src/agent/skills/marketplace/adapters/skillhub/adapter.js +21 -4
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +7 -4
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.d.ts +3 -0
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +7 -1
- package/dist/src/agent/skills/marketplace/search.d.ts +2 -2
- package/dist/src/agent/skills/marketplace/search.js +52 -21
- package/dist/src/agent/skills/skills-marketplace.d.ts +1 -1
- package/dist/src/agent/skills/skills-marketplace.js +2 -2
- package/dist/src/agent/skills/types.d.ts +0 -8
- package/dist/src/agent/tools/exec-command.d.ts +1 -0
- package/dist/src/agent/tools/exec-command.js +2 -1
- package/dist/src/agent/tools/factory.d.ts +1 -0
- package/dist/src/agent/tools/factory.js +17 -2
- package/dist/src/agent/tools/managed-job-tool.d.ts +1 -1
- package/dist/src/agent/tools/managed-job-tool.js +3 -2
- package/dist/src/agent/tools/skill-install-tool.d.ts +2 -2
- package/dist/src/agent/tools/skill-install-tool.js +8 -4
- package/dist/src/agent/tools/skills-marketplace-search-tool.js +3 -2
- package/dist/src/agent/tools/workflow-tool.d.ts +1 -0
- package/dist/src/agent/tools/workflow-tool.js +14 -4
- package/dist/src/agent-manifest/schema.d.ts +20 -0
- package/dist/src/agent-manifest/schema.js +6 -1
- package/dist/src/auth/oauth/xopc-cloud.js +163 -7
- package/dist/src/browser/providers/cloakbrowser.js +1 -1
- package/dist/src/cli/command-loaders.js +1 -0
- package/dist/src/cli/command-manifest.js +4 -0
- package/dist/src/cli/commands/doctor/checks/node-version.js +3 -3
- package/dist/src/cli/commands/doctor/checks/tool-runtimes.d.ts +2 -0
- package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +36 -0
- package/dist/src/cli/commands/doctor/flow.js +2 -0
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/models.js +0 -1
- package/dist/src/cli/commands/onboard/model.d.ts +16 -1
- package/dist/src/cli/commands/onboard/model.js +65 -4
- package/dist/src/cli/commands/onboard.js +13 -1
- package/dist/src/cli/commands/runtime.d.ts +1 -0
- package/dist/src/cli/commands/runtime.js +77 -0
- package/dist/src/cli/commands/setup.js +15 -1
- package/dist/src/cli/commands/skills.js +7 -4
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/schema.d.ts +125 -0
- package/dist/src/config/schema.js +77 -2
- package/dist/src/config/voice.d.ts +6 -0
- package/dist/src/config/voice.js +17 -0
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/types/providers.d.ts +4 -0
- package/dist/src/gateway/capability-presets-admin.d.ts +9 -0
- package/dist/src/gateway/capability-presets-admin.js +24 -6
- package/dist/src/gateway/chat-stream/mapper.js +8 -4
- package/dist/src/gateway/chat-stream/protocol.d.ts +10 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
- package/dist/src/gateway/hono/routes/commands-skills.js +2 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/local-apps.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +2 -3
- package/dist/src/gateway/hono/routes/runtime-tools.d.ts +3 -0
- package/dist/src/gateway/hono/routes/runtime-tools.js +142 -0
- package/dist/src/gateway/hono/routes/understanding-sources.js +2 -1
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/hono/routes/voice.js +43 -2
- package/dist/src/gateway/hono/routes/you.js +22 -25
- package/dist/src/gateway/image-generation-setup.d.ts +2 -3
- package/dist/src/gateway/image-generation-setup.js +39 -8
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service/marketplace-service.d.ts +1 -1
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +21 -8
- package/dist/src/gateway/service.js +5 -5
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/update-global.js +1 -1
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/providers/extension-stream-bridge.js +8 -7
- package/dist/src/providers/model-catalog-store.d.ts +24 -4
- package/dist/src/providers/model-catalog-store.js +11 -0
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/prompt-cache-payload.d.ts +13 -0
- package/dist/src/providers/prompt-cache-payload.js +110 -0
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/providers/xopc-cloud-model-source.js +52 -6
- package/dist/src/runtime-tools/archive.d.ts +8 -0
- package/dist/src/runtime-tools/archive.js +99 -0
- package/dist/src/runtime-tools/bootstrap.d.ts +16 -0
- package/dist/src/runtime-tools/bootstrap.js +33 -0
- package/dist/src/runtime-tools/catalog.d.ts +19 -0
- package/dist/src/runtime-tools/catalog.js +59 -0
- package/dist/src/runtime-tools/command.d.ts +15 -0
- package/dist/src/runtime-tools/command.js +59 -0
- package/dist/src/runtime-tools/download-source.d.ts +24 -0
- package/dist/src/runtime-tools/download-source.js +125 -0
- package/dist/src/runtime-tools/downloader.d.ts +21 -0
- package/dist/src/runtime-tools/downloader.js +137 -0
- package/dist/src/runtime-tools/environment.d.ts +20 -0
- package/dist/src/runtime-tools/environment.js +113 -0
- package/dist/src/runtime-tools/errors.d.ts +10 -0
- package/dist/src/runtime-tools/errors.js +14 -0
- package/dist/src/runtime-tools/index.d.ts +7 -0
- package/dist/src/runtime-tools/index.js +7 -0
- package/dist/src/runtime-tools/install-lock.d.ts +1 -0
- package/dist/src/runtime-tools/install-lock.js +50 -0
- package/dist/src/runtime-tools/manager.d.ts +20 -0
- package/dist/src/runtime-tools/manager.js +641 -0
- package/dist/src/runtime-tools/manifest-store.d.ts +3 -0
- package/dist/src/runtime-tools/manifest-store.js +26 -0
- package/dist/src/runtime-tools/network.d.ts +9 -0
- package/dist/src/runtime-tools/network.js +41 -0
- package/dist/src/runtime-tools/offline-bundle.d.ts +16 -0
- package/dist/src/runtime-tools/offline-bundle.js +41 -0
- package/dist/src/runtime-tools/paths.d.ts +7 -0
- package/dist/src/runtime-tools/paths.js +22 -0
- package/dist/src/runtime-tools/probe.d.ts +7 -0
- package/dist/src/runtime-tools/probe.js +71 -0
- package/dist/src/runtime-tools/prune.d.ts +10 -0
- package/dist/src/runtime-tools/prune.js +93 -0
- package/dist/src/runtime-tools/types.d.ts +70 -0
- package/dist/src/runtime-tools/types.js +1 -0
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/storage/sqlite/migrations/113_memory_evidence_single_source.sql +42 -20
- package/dist/src/tasks/home-query-service.js +1 -5
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/project-operating-view-service.d.ts +2 -1
- package/dist/src/tasks/project-operating-view-service.js +6 -4
- package/dist/src/tasks/task-dependency-service.d.ts +2 -1
- package/dist/src/tasks/task-dependency-service.js +15 -0
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tunnel/frpc-binary.js +1 -1
- package/dist/src/user-context/domain.d.ts +2 -1
- package/dist/src/user-context/domain.js +12 -1
- package/dist/src/user-context/manual-understanding.js +8 -10
- package/dist/src/user-context/planner.js +1 -6
- package/dist/src/user-context/sources/activity-clustering.d.ts +5 -0
- package/dist/src/user-context/sources/activity-clustering.js +130 -0
- package/dist/src/user-context/sources/catalog.js +26 -0
- package/dist/src/user-context/sources/local-source-contract.d.ts +3 -0
- package/dist/src/user-context/sources/local-source-contract.js +15 -0
- package/dist/src/user-context/sources/repository.js +7 -1
- package/dist/src/user-context/sources/types.d.ts +7 -1
- package/dist/src/user-context/understanding.d.ts +15 -0
- package/dist/src/user-context/understanding.js +24 -0
- package/dist/src/voice/local/model-files.js +1 -1
- package/dist/src/voice/metadata/builtin.js +99 -32
- package/dist/src/voice/metadata/types.d.ts +3 -0
- package/dist/src/voice/stt/availability.js +4 -1
- package/dist/src/voice/stt/config-slice.d.ts +0 -2
- package/dist/src/voice/stt/config-slice.js +1 -6
- package/dist/src/voice/stt/factory.js +2 -2
- package/dist/src/voice/stt/index.d.ts +2 -3
- package/dist/src/voice/stt/list-providers.js +1 -1
- package/dist/src/voice/stt/providers/alibaba-transcription.d.ts +0 -19
- package/dist/src/voice/stt/providers/alibaba-transcription.js +59 -132
- 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/stt/providers/openai-transcription.d.ts +2 -2
- package/dist/src/voice/stt/providers/openai-transcription.js +4 -4
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.d.ts +2 -0
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +49 -0
- package/dist/src/voice/stt/types.js +2 -2
- 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/providers/xopc-cloud-speech.d.ts +2 -0
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +113 -0
- package/dist/src/voice/tts/types.d.ts +1 -1
- package/dist/src/work-discovery/analyzer.js +9 -4
- package/dist/src/work-discovery/candidate-discovery.d.ts +1 -0
- package/dist/src/work-discovery/candidate-discovery.js +3 -3
- package/dist/src/work-discovery/index.js +2 -2
- package/dist/src/work-discovery/service.d.ts +2 -1
- package/dist/src/work-discovery/service.js +126 -37
- package/dist/src/work-discovery/types.d.ts +1 -0
- package/dist/src/workflows/service/workflow-run-service.js +8 -0
- package/dist/src/workflows/service/workflow-run-service.types.d.ts +1 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/agents-CXyivfqY.js +0 -68
- package/dist/gateway/static/root/assets/apps-page-DsE67BSO.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-D0TVev47.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DpZzq8j2.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-B9Cmcuff.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-api-BB8t4Ja7.js +0 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-C_EpuQtk.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-CvzD5qSv.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-Cz7SAAkm.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BKrm7tJ9.js +0 -2
- package/dist/gateway/static/root/assets/extension-settings-page-CsR7QOJo.js +0 -1
- package/dist/gateway/static/root/assets/home-page-C08Nen5T.js +0 -3
- package/dist/gateway/static/root/assets/html-workspace-editor-C3DKAkMc.js +0 -1
- package/dist/gateway/static/root/assets/index-B-_CEvIX.js +0 -150
- package/dist/gateway/static/root/assets/index-D6e3tPL-.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BQVC0tWq.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-D6yvW-E4.js +0 -2
- package/dist/gateway/static/root/assets/messages-B4XqB8I6.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-BVCwabjq.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-CS4Ujor7.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DMtPC8c4.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BpfHZT88.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BZkyrJBM.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DQlK0A4l.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-C-LdINFj.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-HRG_lK4_.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-v_iLhxxa.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-S-bjtsXX.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BiNBfaX5.js +0 -2
- package/dist/gateway/static/root/assets/skills-page.utils-DlnGtvAH.js +0 -1
- package/dist/gateway/static/root/assets/system-settings-panel-Bv7GXFc6.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-BhQcOpnx.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-PtcY7BoJ.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-DnhJtC5l.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-C5Kwe_bc.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-Z_qzaohv.js +0 -11
- /package/dist/gateway/static/root/assets/{workflows-page-DLioOiRN.css → style-DLioOiRN.css} +0 -0
|
@@ -47,25 +47,30 @@ var XopcCloudModelSource = class {
|
|
|
47
47
|
if (!Array.isArray(body?.data)) throw new XopcCloudModelError("XOPC model discovery returned an invalid response", response.status, "invalid_response");
|
|
48
48
|
const models = [...new Map(body.data.filter((model) => typeof model.id === "string" && model.id.length > 0).map((model) => {
|
|
49
49
|
const declaredInput = model.xopc?.capabilities?.input;
|
|
50
|
-
const parsedInput = Array.isArray(declaredInput) ? declaredInput.filter((value) => value === "text" || value === "image") : [];
|
|
51
|
-
const
|
|
50
|
+
const parsedInput = Array.isArray(declaredInput) ? declaredInput.filter((value) => value === "text" || value === "image" || value === "audio") : [];
|
|
51
|
+
const kind = model.xopc?.kind === "image" || model.xopc?.kind === "stt" || model.xopc?.kind === "tts" ? model.xopc.kind : "language";
|
|
52
|
+
const input = kind === "stt" ? ["audio"] : kind === "tts" ? ["text"] : kind === "language" && !parsedInput.includes("text") ? ["text", ...new Set(parsedInput)] : [...new Set(parsedInput)];
|
|
52
53
|
const maxOutputTokens = model.xopc?.maxOutputTokens;
|
|
53
54
|
const declaredOutput = model.xopc?.capabilities?.output;
|
|
54
|
-
const output = Array.isArray(declaredOutput) ? declaredOutput.filter((value) => value === "text" || value === "image") : ["text"];
|
|
55
|
+
const output = kind === "stt" ? ["text"] : kind === "tts" ? ["audio"] : Array.isArray(declaredOutput) ? declaredOutput.filter((value) => value === "text" || value === "image" || value === "audio") : ["text"];
|
|
55
56
|
const declaredOperations = model.xopc?.operations ?? model.xopc?.capabilities?.operations;
|
|
56
|
-
const operations = Array.isArray(declaredOperations) ? declaredOperations.filter((value) => value === "chat.completions" || value === "responses" || value === "images.generate" || value === "images.edit") : ["chat.completions", "responses"];
|
|
57
|
+
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"];
|
|
57
58
|
const generation = parseImageGenerationCapabilities(model.xopc?.capabilities?.imageGeneration);
|
|
59
|
+
const stt = kind === "stt" ? parseSttCapabilities(model.xopc?.capabilities) : void 0;
|
|
60
|
+
const tts = kind === "tts" ? parseTtsCapabilities(model.xopc?.capabilities, model.xopc?.defaultVoice) : void 0;
|
|
58
61
|
return [model.id, {
|
|
59
62
|
id: model.id,
|
|
60
63
|
name: model.id,
|
|
61
|
-
kind
|
|
64
|
+
kind,
|
|
62
65
|
input,
|
|
63
66
|
output,
|
|
64
67
|
operations,
|
|
65
68
|
reasoning: model.xopc?.capabilities?.reasoning === true,
|
|
66
69
|
contextWindow: 128e3,
|
|
67
70
|
maxOutputTokens: typeof maxOutputTokens === "number" && Number.isSafeInteger(maxOutputTokens) ? maxOutputTokens : null,
|
|
68
|
-
...generation ? { imageGeneration: generation } : {}
|
|
71
|
+
...generation ? { imageGeneration: generation } : {},
|
|
72
|
+
...stt ? { stt } : {},
|
|
73
|
+
...tts ? { tts } : {}
|
|
69
74
|
}];
|
|
70
75
|
})).values()];
|
|
71
76
|
this.catalogStore.replaceSourceModels("xopc-cloud", {
|
|
@@ -85,6 +90,47 @@ var XopcCloudModelSource = class {
|
|
|
85
90
|
};
|
|
86
91
|
}
|
|
87
92
|
};
|
|
93
|
+
function parseSttCapabilities(value) {
|
|
94
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
95
|
+
const raw = value;
|
|
96
|
+
return {
|
|
97
|
+
inputFormats: strings(raw.inputFormats),
|
|
98
|
+
maxBytes: positiveInteger(raw.maxBytes),
|
|
99
|
+
maxDurationSeconds: positiveInteger(raw.maxDurationSeconds),
|
|
100
|
+
languages: strings(raw.languages),
|
|
101
|
+
languageHint: raw.languageHint === true,
|
|
102
|
+
prompt: raw.prompt === true,
|
|
103
|
+
timestamps: strings(raw.timestamps).filter((item) => item === "segment" || item === "word"),
|
|
104
|
+
diarization: raw.diarization === true
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function parseTtsCapabilities(value, defaultVoice) {
|
|
108
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
109
|
+
const raw = value;
|
|
110
|
+
return {
|
|
111
|
+
maxCharacters: positiveInteger(raw.maxCharacters),
|
|
112
|
+
languages: strings(raw.languages),
|
|
113
|
+
outputFormats: strings(raw.outputFormats).filter((item) => [
|
|
114
|
+
"mp3",
|
|
115
|
+
"opus",
|
|
116
|
+
"aac",
|
|
117
|
+
"flac",
|
|
118
|
+
"wav",
|
|
119
|
+
"pcm"
|
|
120
|
+
].includes(item)),
|
|
121
|
+
streaming: raw.streaming === true,
|
|
122
|
+
speed: raw.speed === true,
|
|
123
|
+
pitch: raw.pitch === true,
|
|
124
|
+
instructions: raw.instructions === true,
|
|
125
|
+
...typeof defaultVoice === "string" && defaultVoice ? { defaultVoice } : {}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function strings(value) {
|
|
129
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
130
|
+
}
|
|
131
|
+
function positiveInteger(value) {
|
|
132
|
+
return Number.isSafeInteger(value) && Number(value) > 0 ? Number(value) : 0;
|
|
133
|
+
}
|
|
88
134
|
function parseImageGenerationCapabilities(value) {
|
|
89
135
|
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
90
136
|
const raw = value;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RuntimeKind } from './types.js';
|
|
2
|
+
export declare function extractRuntimeArchive(params: {
|
|
3
|
+
runtime: RuntimeKind;
|
|
4
|
+
archivePath: string;
|
|
5
|
+
archiveType: 'zip' | 'tar.gz';
|
|
6
|
+
stagingDir: string;
|
|
7
|
+
}): Promise<string>;
|
|
8
|
+
export declare function atomicInstallRuntime(extractedRoot: string, installDir: string): Promise<void>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { RuntimeError } from "./errors.js";
|
|
2
|
+
import { isAbsolute, join, posix, relative, resolve } from "node:path";
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { lstat, mkdir, readdir, readlink, rename, rm, stat } from "node:fs/promises";
|
|
5
|
+
import AdmZip from "adm-zip";
|
|
6
|
+
//#region src/runtime-tools/archive.ts
|
|
7
|
+
const MAX_ARCHIVE_ENTRIES = 5e4;
|
|
8
|
+
function validateMemberPath(memberPath) {
|
|
9
|
+
const portablePath = memberPath.replaceAll("\\", "/");
|
|
10
|
+
const normalized = posix.normalize(portablePath);
|
|
11
|
+
if (!memberPath || isAbsolute(memberPath) || portablePath.startsWith("/") || normalized === ".." || normalized.startsWith("../")) throw new Error(`Unsafe archive member: ${memberPath}`);
|
|
12
|
+
}
|
|
13
|
+
async function validateExtractedTree(root, current = root) {
|
|
14
|
+
for (const entry of await readdir(current)) {
|
|
15
|
+
const entryPath = join(current, entry);
|
|
16
|
+
const details = await lstat(entryPath);
|
|
17
|
+
if (details.isSymbolicLink()) {
|
|
18
|
+
const relativeTarget = relative(root, resolve(current, await readlink(entryPath)));
|
|
19
|
+
if (relativeTarget.split(/[\\/]/)[0] === ".." || isAbsolute(relativeTarget)) throw new Error(`Archive symlink escapes extraction root: ${entryPath}`);
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
if (details.isDirectory()) await validateExtractedTree(root, entryPath);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function runTar(args) {
|
|
26
|
+
return await new Promise((resolvePromise, reject) => {
|
|
27
|
+
let stdout = "";
|
|
28
|
+
let stderr = "";
|
|
29
|
+
const child = spawn("tar", args, {
|
|
30
|
+
shell: false,
|
|
31
|
+
windowsHide: true
|
|
32
|
+
});
|
|
33
|
+
child.stdout?.on("data", (chunk) => {
|
|
34
|
+
stdout += chunk.toString();
|
|
35
|
+
});
|
|
36
|
+
child.stderr?.on("data", (chunk) => {
|
|
37
|
+
stderr += chunk.toString();
|
|
38
|
+
});
|
|
39
|
+
child.once("error", reject);
|
|
40
|
+
child.once("close", (code) => {
|
|
41
|
+
if (code === 0) resolvePromise(stdout);
|
|
42
|
+
else reject(new Error(stderr.trim() || `tar exited with code ${code}`));
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async function extractZip(archivePath, destination) {
|
|
47
|
+
const zip = new AdmZip(archivePath);
|
|
48
|
+
const entries = zip.getEntries();
|
|
49
|
+
if (entries.length > MAX_ARCHIVE_ENTRIES) throw new Error("Archive contains too many entries");
|
|
50
|
+
for (const entry of entries) validateMemberPath(entry.entryName);
|
|
51
|
+
zip.extractAllTo(destination, true, false);
|
|
52
|
+
}
|
|
53
|
+
async function extractTarGz(archivePath, destination) {
|
|
54
|
+
const entries = (await runTar(["-tzf", archivePath])).split(/\r?\n/).filter(Boolean);
|
|
55
|
+
if (entries.length > MAX_ARCHIVE_ENTRIES) throw new Error("Archive contains too many entries");
|
|
56
|
+
for (const entry of entries) validateMemberPath(entry);
|
|
57
|
+
await runTar([
|
|
58
|
+
"-xzf",
|
|
59
|
+
archivePath,
|
|
60
|
+
"-C",
|
|
61
|
+
destination
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
async function singleArchiveRoot(destination) {
|
|
65
|
+
const entries = (await readdir(destination)).filter((entry) => entry !== "__MACOSX");
|
|
66
|
+
if (entries.length !== 1) throw new Error("Archive must contain one top-level directory");
|
|
67
|
+
const root = join(destination, entries[0]);
|
|
68
|
+
if (!(await stat(root)).isDirectory()) throw new Error("Archive root is not a directory");
|
|
69
|
+
return root;
|
|
70
|
+
}
|
|
71
|
+
async function extractRuntimeArchive(params) {
|
|
72
|
+
await rm(params.stagingDir, {
|
|
73
|
+
recursive: true,
|
|
74
|
+
force: true
|
|
75
|
+
});
|
|
76
|
+
await mkdir(params.stagingDir, { recursive: true });
|
|
77
|
+
try {
|
|
78
|
+
if (params.archiveType === "zip") await extractZip(params.archivePath, params.stagingDir);
|
|
79
|
+
else await extractTarGz(params.archivePath, params.stagingDir);
|
|
80
|
+
await validateExtractedTree(params.stagingDir);
|
|
81
|
+
return await singleArchiveRoot(params.stagingDir);
|
|
82
|
+
} catch (error) {
|
|
83
|
+
await rm(params.stagingDir, {
|
|
84
|
+
recursive: true,
|
|
85
|
+
force: true
|
|
86
|
+
});
|
|
87
|
+
throw new RuntimeError(`Invalid ${params.runtime} archive: ${error instanceof Error ? error.message : String(error)}`, "RUNTIME_ARCHIVE_INVALID", params.runtime, "extract", true, [], { cause: error });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
async function atomicInstallRuntime(extractedRoot, installDir) {
|
|
91
|
+
await mkdir(resolve(installDir, ".."), { recursive: true });
|
|
92
|
+
await rm(installDir, {
|
|
93
|
+
recursive: true,
|
|
94
|
+
force: true
|
|
95
|
+
});
|
|
96
|
+
await rename(extractedRoot, installDir);
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { atomicInstallRuntime, extractRuntimeArchive };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RuntimeToolsConfig } from '../config/schema.js';
|
|
2
|
+
import { ManagedRuntimeManager } from './manager.js';
|
|
3
|
+
import type { ResolvedRuntime, RuntimeKind } from './types.js';
|
|
4
|
+
export type RuntimeBootstrapResult = {
|
|
5
|
+
runtime: RuntimeKind;
|
|
6
|
+
ok: boolean;
|
|
7
|
+
resolved?: ResolvedRuntime;
|
|
8
|
+
error?: string;
|
|
9
|
+
};
|
|
10
|
+
type RuntimeResolver = Pick<ManagedRuntimeManager, 'resolve'>;
|
|
11
|
+
export declare function provisionEagerRuntimes(params: {
|
|
12
|
+
stateDir: string;
|
|
13
|
+
config: RuntimeToolsConfig;
|
|
14
|
+
manager?: RuntimeResolver;
|
|
15
|
+
}): Promise<RuntimeBootstrapResult[]>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ManagedRuntimeManager } from "./manager.js";
|
|
2
|
+
//#region src/runtime-tools/bootstrap.ts
|
|
3
|
+
async function provisionEagerRuntimes(params) {
|
|
4
|
+
if (!params.config.enabled) return [];
|
|
5
|
+
const manager = params.manager ?? new ManagedRuntimeManager({
|
|
6
|
+
stateDir: params.stateDir,
|
|
7
|
+
config: params.config
|
|
8
|
+
});
|
|
9
|
+
const requested = [];
|
|
10
|
+
if (params.config.node.enabled && params.config.node.provision === "eager") requested.push("node");
|
|
11
|
+
if (params.config.python.enabled && params.config.python.provision === "eager") requested.push("python");
|
|
12
|
+
const results = [];
|
|
13
|
+
for (const runtime of requested) try {
|
|
14
|
+
const resolved = await manager.resolve({
|
|
15
|
+
runtime,
|
|
16
|
+
allowProvision: true
|
|
17
|
+
});
|
|
18
|
+
results.push({
|
|
19
|
+
runtime,
|
|
20
|
+
ok: true,
|
|
21
|
+
resolved
|
|
22
|
+
});
|
|
23
|
+
} catch (error) {
|
|
24
|
+
results.push({
|
|
25
|
+
runtime,
|
|
26
|
+
ok: false,
|
|
27
|
+
error: error instanceof Error ? error.message : String(error)
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return results;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { provisionEagerRuntimes };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RuntimeKind } from './types.js';
|
|
2
|
+
export declare const RUNTIME_CATALOG_VERSION = "2026-08-23";
|
|
3
|
+
export declare const DEFAULT_RUNTIME_VERSIONS: Record<RuntimeKind, string>;
|
|
4
|
+
export type RuntimePlatform = 'darwin-arm64' | 'darwin-x64' | 'win32-x64' | 'linux-x64-gnu' | 'linux-arm64-gnu';
|
|
5
|
+
export interface RuntimeAsset {
|
|
6
|
+
runtime: 'node' | 'uv';
|
|
7
|
+
version: string;
|
|
8
|
+
platform: RuntimePlatform;
|
|
9
|
+
archiveFile: string;
|
|
10
|
+
url: string;
|
|
11
|
+
checksumUrl: string;
|
|
12
|
+
archiveType: 'zip' | 'tar.gz';
|
|
13
|
+
}
|
|
14
|
+
export declare function detectRuntimePlatform(platform?: NodeJS.Platform, arch?: string): RuntimePlatform | null;
|
|
15
|
+
export declare function resolveRuntimeAsset(params: {
|
|
16
|
+
runtime: 'node' | 'uv';
|
|
17
|
+
version: string;
|
|
18
|
+
platform: RuntimePlatform;
|
|
19
|
+
}): RuntimeAsset;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//#region src/runtime-tools/catalog.ts
|
|
2
|
+
const RUNTIME_CATALOG_VERSION = "2026-08-23";
|
|
3
|
+
const DEFAULT_RUNTIME_VERSIONS = {
|
|
4
|
+
node: "22.23.2",
|
|
5
|
+
uv: "0.8.12",
|
|
6
|
+
python: "3.12.11"
|
|
7
|
+
};
|
|
8
|
+
function detectRuntimePlatform(platform = process.platform, arch = process.arch) {
|
|
9
|
+
if (platform === "darwin" && arch === "arm64") return "darwin-arm64";
|
|
10
|
+
if (platform === "darwin" && arch === "x64") return "darwin-x64";
|
|
11
|
+
if (platform === "win32" && arch === "x64") return "win32-x64";
|
|
12
|
+
if (platform === "linux" && arch === "x64") return "linux-x64-gnu";
|
|
13
|
+
if (platform === "linux" && arch === "arm64") return "linux-arm64-gnu";
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
function nodePlatformSuffix(platform) {
|
|
17
|
+
return {
|
|
18
|
+
"darwin-arm64": "darwin-arm64",
|
|
19
|
+
"darwin-x64": "darwin-x64",
|
|
20
|
+
"win32-x64": "win-x64",
|
|
21
|
+
"linux-x64-gnu": "linux-x64",
|
|
22
|
+
"linux-arm64-gnu": "linux-arm64"
|
|
23
|
+
}[platform];
|
|
24
|
+
}
|
|
25
|
+
function uvPlatformSuffix(platform) {
|
|
26
|
+
return {
|
|
27
|
+
"darwin-arm64": "aarch64-apple-darwin",
|
|
28
|
+
"darwin-x64": "x86_64-apple-darwin",
|
|
29
|
+
"win32-x64": "x86_64-pc-windows-msvc",
|
|
30
|
+
"linux-x64-gnu": "x86_64-unknown-linux-gnu",
|
|
31
|
+
"linux-arm64-gnu": "aarch64-unknown-linux-gnu"
|
|
32
|
+
}[platform];
|
|
33
|
+
}
|
|
34
|
+
function resolveRuntimeAsset(params) {
|
|
35
|
+
if (params.runtime === "node") {
|
|
36
|
+
const ext = params.platform === "win32-x64" ? "zip" : "tar.gz";
|
|
37
|
+
const archiveFile = `node-v${params.version}-${nodePlatformSuffix(params.platform)}.${ext}`;
|
|
38
|
+
const releaseBase = `https://nodejs.org/download/release/v${params.version}`;
|
|
39
|
+
return {
|
|
40
|
+
...params,
|
|
41
|
+
archiveFile,
|
|
42
|
+
url: `${releaseBase}/${archiveFile}`,
|
|
43
|
+
checksumUrl: `${releaseBase}/SHASUMS256.txt`,
|
|
44
|
+
archiveType: ext
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const ext = params.platform === "win32-x64" ? "zip" : "tar.gz";
|
|
48
|
+
const archiveFile = `uv-${uvPlatformSuffix(params.platform)}.${ext}`;
|
|
49
|
+
const base = `https://github.com/astral-sh/uv/releases/download/${params.version}`;
|
|
50
|
+
return {
|
|
51
|
+
...params,
|
|
52
|
+
archiveFile,
|
|
53
|
+
url: `${base}/${archiveFile}`,
|
|
54
|
+
checksumUrl: `${base}/${archiveFile}.sha256`,
|
|
55
|
+
archiveType: ext
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { DEFAULT_RUNTIME_VERSIONS, RUNTIME_CATALOG_VERSION, detectRuntimePlatform, resolveRuntimeAsset };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface RuntimeCommandResult {
|
|
2
|
+
ok: boolean;
|
|
3
|
+
stdout: string;
|
|
4
|
+
stderr: string;
|
|
5
|
+
exitCode: number | null;
|
|
6
|
+
timedOut: boolean;
|
|
7
|
+
aborted: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function runRuntimeCommand(params: {
|
|
10
|
+
command: string;
|
|
11
|
+
args: string[];
|
|
12
|
+
env?: NodeJS.ProcessEnv;
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
}): Promise<RuntimeCommandResult>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
//#region src/runtime-tools/command.ts
|
|
3
|
+
const DEFAULT_COMMAND_TIMEOUT_MS = 5e3;
|
|
4
|
+
async function runRuntimeCommand(params) {
|
|
5
|
+
return await new Promise((resolve) => {
|
|
6
|
+
let stdout = "";
|
|
7
|
+
let stderr = "";
|
|
8
|
+
let settled = false;
|
|
9
|
+
let timedOut = false;
|
|
10
|
+
let aborted = false;
|
|
11
|
+
const child = spawn(params.command, params.args, {
|
|
12
|
+
env: params.env,
|
|
13
|
+
shell: false,
|
|
14
|
+
windowsHide: process.platform === "win32",
|
|
15
|
+
stdio: [
|
|
16
|
+
"ignore",
|
|
17
|
+
"pipe",
|
|
18
|
+
"pipe"
|
|
19
|
+
]
|
|
20
|
+
});
|
|
21
|
+
const finish = (exitCode) => {
|
|
22
|
+
if (settled) return;
|
|
23
|
+
settled = true;
|
|
24
|
+
clearTimeout(timeout);
|
|
25
|
+
params.signal?.removeEventListener("abort", abort);
|
|
26
|
+
resolve({
|
|
27
|
+
ok: exitCode === 0 && !timedOut && !aborted,
|
|
28
|
+
stdout: stdout.trim(),
|
|
29
|
+
stderr: stderr.trim(),
|
|
30
|
+
exitCode,
|
|
31
|
+
timedOut,
|
|
32
|
+
aborted
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
const abort = () => {
|
|
36
|
+
aborted = true;
|
|
37
|
+
child.kill("SIGKILL");
|
|
38
|
+
finish(null);
|
|
39
|
+
};
|
|
40
|
+
child.stdout?.on("data", (chunk) => {
|
|
41
|
+
stdout += chunk.toString();
|
|
42
|
+
});
|
|
43
|
+
child.stderr?.on("data", (chunk) => {
|
|
44
|
+
stderr += chunk.toString();
|
|
45
|
+
});
|
|
46
|
+
child.once("error", () => finish(null));
|
|
47
|
+
child.once("close", finish);
|
|
48
|
+
const timeout = setTimeout(() => {
|
|
49
|
+
timedOut = true;
|
|
50
|
+
child.kill("SIGKILL");
|
|
51
|
+
finish(null);
|
|
52
|
+
}, params.timeoutMs ?? DEFAULT_COMMAND_TIMEOUT_MS);
|
|
53
|
+
timeout.unref();
|
|
54
|
+
if (params.signal?.aborted) abort();
|
|
55
|
+
else params.signal?.addEventListener("abort", abort, { once: true });
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { runRuntimeCommand };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { RuntimeToolsConfig } from '../config/schema.js';
|
|
2
|
+
import type { RuntimeAsset, RuntimePlatform } from './catalog.js';
|
|
3
|
+
type DownloadConfig = RuntimeToolsConfig['download'];
|
|
4
|
+
export interface ResolvedRuntimeDownload {
|
|
5
|
+
url: string;
|
|
6
|
+
sha256: string;
|
|
7
|
+
source: 'website' | 'direct';
|
|
8
|
+
}
|
|
9
|
+
export declare function runtimeGatewayPythonMirror(gatewayBaseUrl: string): string;
|
|
10
|
+
export declare function canFallbackPythonInstall(output: string, timedOut: boolean): boolean;
|
|
11
|
+
export declare function validateGatewayDescriptor(params: {
|
|
12
|
+
value: unknown;
|
|
13
|
+
gatewayBaseUrl: string;
|
|
14
|
+
asset: RuntimeAsset;
|
|
15
|
+
platform: RuntimePlatform;
|
|
16
|
+
}): ResolvedRuntimeDownload;
|
|
17
|
+
export declare function resolveRuntimeDownloadSource(params: {
|
|
18
|
+
asset: RuntimeAsset;
|
|
19
|
+
platform: RuntimePlatform;
|
|
20
|
+
config: DownloadConfig;
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
onFallback?: (message: string) => void;
|
|
23
|
+
}): Promise<ResolvedRuntimeDownload>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { RuntimeError } from "./errors.js";
|
|
2
|
+
import { fetchRuntimeResource, readRuntimeResponseText } from "./network.js";
|
|
3
|
+
import { resolveExpectedChecksum } from "./downloader.js";
|
|
4
|
+
//#region src/runtime-tools/download-source.ts
|
|
5
|
+
const MAX_GATEWAY_RESPONSE_BYTES = 64 * 1024;
|
|
6
|
+
function runtimeGatewayPythonMirror(gatewayBaseUrl) {
|
|
7
|
+
return `${gatewayBaseUrl.replace(/\/+$/, "")}/python-build-standalone`;
|
|
8
|
+
}
|
|
9
|
+
function canFallbackPythonInstall(output, timedOut) {
|
|
10
|
+
if (/checksum|digest|hash mismatch|integrity|verification failed|invalid archive/i.test(output)) return false;
|
|
11
|
+
return timedOut || /failed to download|request failed|error sending request|timed? out|connection|dns|429|50[234]/i.test(output);
|
|
12
|
+
}
|
|
13
|
+
var GatewayResolveError = class extends Error {
|
|
14
|
+
constructor(message, allowsDirectFallback, retrySameSource = allowsDirectFallback) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.allowsDirectFallback = allowsDirectFallback;
|
|
17
|
+
this.retrySameSource = retrySameSource;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
function descriptorUrl(baseUrl, asset, platform) {
|
|
21
|
+
const url = new URL(`${baseUrl.replace(/\/+$/, "")}/resolve`);
|
|
22
|
+
url.searchParams.set("runtime", asset.runtime);
|
|
23
|
+
url.searchParams.set("version", asset.version);
|
|
24
|
+
url.searchParams.set("platform", platform);
|
|
25
|
+
return url;
|
|
26
|
+
}
|
|
27
|
+
function validateGatewayDescriptor(params) {
|
|
28
|
+
const value = params.value;
|
|
29
|
+
const archive = value?.archive;
|
|
30
|
+
if (value?.schemaVersion !== 1 || value.runtime !== params.asset.runtime || value.version !== params.asset.version || value.platform !== params.platform || archive?.name !== params.asset.archiveFile || archive.archiveType !== params.asset.archiveType || typeof archive.url !== "string" || typeof archive.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(archive.sha256)) throw new GatewayResolveError("Runtime gateway returned an invalid descriptor", false);
|
|
31
|
+
const base = new URL(`${params.gatewayBaseUrl.replace(/\/+$/, "")}/`);
|
|
32
|
+
const artifact = new URL(archive.url);
|
|
33
|
+
const expectedPath = `${base.pathname}artifacts/${params.asset.runtime}/${params.asset.version}/${params.platform}/${params.asset.archiveFile}`;
|
|
34
|
+
if (artifact.origin !== base.origin || artifact.username || artifact.password || artifact.pathname !== expectedPath || artifact.search || artifact.hash) throw new GatewayResolveError("Runtime gateway returned an untrusted artifact URL", false);
|
|
35
|
+
return {
|
|
36
|
+
url: artifact.href,
|
|
37
|
+
sha256: archive.sha256,
|
|
38
|
+
source: "website"
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async function resolveFromGateway(params) {
|
|
42
|
+
let lastError;
|
|
43
|
+
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
44
|
+
if (params.signal?.aborted) throw params.signal.reason;
|
|
45
|
+
try {
|
|
46
|
+
const response = await fetchRuntimeResource({
|
|
47
|
+
url: descriptorUrl(params.config.gatewayBaseUrl, params.asset, params.platform).href,
|
|
48
|
+
timeoutMs: params.config.timeoutMs,
|
|
49
|
+
proxy: params.config.proxy,
|
|
50
|
+
signal: params.signal,
|
|
51
|
+
init: {
|
|
52
|
+
headers: { "User-Agent": "xopc-runtime-manager/1" },
|
|
53
|
+
redirect: "error"
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const declaredSize = Number(response.headers.get("content-length"));
|
|
57
|
+
if (Number.isFinite(declaredSize) && declaredSize > MAX_GATEWAY_RESPONSE_BYTES) {
|
|
58
|
+
await response.body?.cancel().catch(() => {});
|
|
59
|
+
throw new GatewayResolveError("Runtime gateway response exceeds the size limit", false);
|
|
60
|
+
}
|
|
61
|
+
let responseText;
|
|
62
|
+
try {
|
|
63
|
+
responseText = await readRuntimeResponseText(response, MAX_GATEWAY_RESPONSE_BYTES);
|
|
64
|
+
} catch {
|
|
65
|
+
throw new GatewayResolveError("Runtime gateway response exceeds the size limit", false);
|
|
66
|
+
}
|
|
67
|
+
if (!response.ok) {
|
|
68
|
+
let body = null;
|
|
69
|
+
try {
|
|
70
|
+
body = JSON.parse(responseText);
|
|
71
|
+
} catch {}
|
|
72
|
+
const unsupported = response.status === 404 && body?.error === "unsupported_catalog_entry";
|
|
73
|
+
const retryable = unsupported || response.status === 429 || response.status >= 500;
|
|
74
|
+
throw new GatewayResolveError(`Runtime gateway returned HTTP ${response.status}`, retryable, !unsupported && retryable);
|
|
75
|
+
}
|
|
76
|
+
let descriptor;
|
|
77
|
+
try {
|
|
78
|
+
descriptor = JSON.parse(responseText);
|
|
79
|
+
} catch {
|
|
80
|
+
throw new GatewayResolveError("Runtime gateway returned invalid JSON", false);
|
|
81
|
+
}
|
|
82
|
+
return validateGatewayDescriptor({
|
|
83
|
+
value: descriptor,
|
|
84
|
+
gatewayBaseUrl: params.config.gatewayBaseUrl,
|
|
85
|
+
asset: params.asset,
|
|
86
|
+
platform: params.platform
|
|
87
|
+
});
|
|
88
|
+
} catch (error) {
|
|
89
|
+
if (params.signal?.aborted) throw error;
|
|
90
|
+
const normalized = error instanceof GatewayResolveError ? error : new GatewayResolveError(error instanceof Error ? error.message : String(error), true);
|
|
91
|
+
if (!normalized.allowsDirectFallback) throw normalized;
|
|
92
|
+
lastError = normalized;
|
|
93
|
+
if (!normalized.retrySameSource) break;
|
|
94
|
+
if (attempt === 0) await new Promise((resolve) => setTimeout(resolve, 500));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
throw lastError ?? new GatewayResolveError("Runtime gateway is unavailable", true);
|
|
98
|
+
}
|
|
99
|
+
async function resolveDirect(asset, config, signal) {
|
|
100
|
+
const sha256 = await resolveExpectedChecksum({
|
|
101
|
+
runtime: asset.runtime,
|
|
102
|
+
checksumUrl: asset.checksumUrl,
|
|
103
|
+
archiveFile: asset.archiveFile,
|
|
104
|
+
timeoutMs: config.timeoutMs,
|
|
105
|
+
proxy: config.proxy,
|
|
106
|
+
signal
|
|
107
|
+
});
|
|
108
|
+
return {
|
|
109
|
+
url: asset.url,
|
|
110
|
+
sha256,
|
|
111
|
+
source: "direct"
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
async function resolveRuntimeDownloadSource(params) {
|
|
115
|
+
if (params.config.source === "direct-only") return await resolveDirect(params.asset, params.config, params.signal);
|
|
116
|
+
try {
|
|
117
|
+
return await resolveFromGateway(params);
|
|
118
|
+
} catch (error) {
|
|
119
|
+
if (params.config.source === "website-only" || !(error instanceof GatewayResolveError) || !error.allowsDirectFallback) throw new RuntimeError(`Failed to resolve ${params.asset.runtime} from the runtime gateway: ${error instanceof Error ? error.message : String(error)}`, "RUNTIME_DOWNLOAD_FAILED", params.asset.runtime, "resolve_gateway", true, [], { cause: error });
|
|
120
|
+
params.onFallback?.(`Runtime gateway unavailable; downloading ${params.asset.runtime} directly`);
|
|
121
|
+
return await resolveDirect(params.asset, params.config, params.signal);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
export { canFallbackPythonInstall, resolveRuntimeDownloadSource, runtimeGatewayPythonMirror, validateGatewayDescriptor };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { RuntimeKind } from './types.js';
|
|
2
|
+
export declare function canFallbackRuntimeDownload(error: unknown): boolean;
|
|
3
|
+
export declare function resolveExpectedChecksum(params: {
|
|
4
|
+
runtime: 'node' | 'uv';
|
|
5
|
+
checksumUrl: string;
|
|
6
|
+
archiveFile: string;
|
|
7
|
+
timeoutMs: number;
|
|
8
|
+
proxy?: string;
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
}): Promise<string>;
|
|
11
|
+
export declare function sha256File(path: string): Promise<string>;
|
|
12
|
+
export declare function downloadVerifiedArchive(params: {
|
|
13
|
+
runtime: RuntimeKind;
|
|
14
|
+
url: string;
|
|
15
|
+
targetPath: string;
|
|
16
|
+
expectedSha256: string;
|
|
17
|
+
timeoutMs: number;
|
|
18
|
+
proxy?: string;
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
onProgress?: (downloadedBytes: number, totalBytes?: number) => void;
|
|
21
|
+
}): Promise<string>;
|