@xopcai/xopc 0.0.191 → 0.0.192
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-B-tzXpDD.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DvEkT222.js → agent-avatar-dicebear-xOu0qNwc.js} +1 -1
- package/dist/gateway/static/root/assets/agents-CxuwvDk0.js +68 -0
- package/dist/gateway/static/root/assets/{api-BTL9kayv.js → api-fMItZb-h.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-COpP_pKN.js → app-management-settings-panel-D6Rv3OWI.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DTVNUEDq.js → appearance-settings-CKoNCwco.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-wAb5dnHZ.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-IpX6VA0o.js → archive-plugin-BokNQBwH.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CKVFNUi1.js → attachment-load-Dx1HglsM.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-Drgazevs.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BrfvfOS4.js → binary-plugins-CPYAflIG.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-D9sEfg32.js → block-editor-BFLgl8SS.js} +47 -47
- package/dist/gateway/static/root/assets/browser-settings-page-DmYlFJW7.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-BixZ5lCR.js → browser-workflow-inputs-CqLnqA9z.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-YEFuodJI.js → browser-workflows-page-Db5v3HtE.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-D7Z8T0o5.js +7 -0
- package/dist/gateway/static/root/assets/capability-presets-api-lov0J9A2.js +1 -0
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-COjnwO0U.js +3 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-BThDGiO3.js → channel-recipient-api-DSJznouK.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-DcRYBNN7.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-C2UYdebT.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-3ccRyS3L.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-FVmvBG9H.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-Bm8koRoD.js → cron-expression-C9hhCiuo.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-CTtZFZug.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-CMG3mcaJ.js → desktop-pet-DOUeNVmC.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-D8aaPb0x.js → desktop-pet-settings-D4704vtl.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-C95yW03b.js → directory-picker-path-field-DJDXeA1B.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DsG7Z9lV.js → extension-debug-page-C0n2NMF1.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CUAXEbAt.js → extension-page-vG-xxRNs.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-CtuY2THd.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-api-DL70Nakc.js → gateway-config-api-CZra7GuI.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BgDxQ08c.js → gateway-settings-Cz33jRkR.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-EO9mKvzE.js → gateway-startup-retry-BbVV0udv.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-BX7q55uZ.js → heartbeat-settings-D2XMlA_U.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-CPrHkPN6.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-BgrOvhaJ.js} +1 -1
- package/dist/gateway/static/root/assets/index-Cg7Xnlu3.css +1 -0
- package/dist/gateway/static/root/assets/index-DzmbmOGA.js +150 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Dt6wS5zW.js → keyboard-shortcuts-settings-BfyAEG1G.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Clz47vSr.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DcD3-N00.js → local-apps-page-BYalcRSY.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-deR2zRaE.js → locale-store-VOY1wMO9.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-Cxq9WMf5.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-B6EVkJQy.js → management-settings-BQf-6s32.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-Cy_2SN1Q.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DRrtI2O0.js → media-plugins-CkDupqb2.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DMJ-6-1m.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-fermYvpI.js → notes-page-kiGRR9jo.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DkYkPGyB.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-BO262zuu.js → page-tabs-CvzSdYVj.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-yZYTy-2e.js → preview-open-alternatives-kZ0nco7e.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Dgy8XWhR.js → product-open-page-DgoieqQC.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CeSjJd-N.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-fZ1rm4b9.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-CbYI6KC8.js +1 -0
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-Bud_NTEZ.js +5 -0
- package/dist/gateway/static/root/assets/{schema-form-DdE4gtw_.js → schema-form-GlbsCBmv.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-sOJ_TnLm.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BI0u77dt.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CiYU8AvV.js → settings-form-section-CKLns16d.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-Bv03cWib.js → settings-loading-skeleton-BDzpxgk0.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-BH0pF7QB.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-layout-t_Ox1slk.js → settings-page-layout-J793iqfm.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-HRG_lK4_.js → setup-status-panel-CGsml89P.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-DF8gW6bo.js → share-preview-page-UTm_7r0l.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BM--lgUS.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-CGCOC-rV.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-iLyaOl48.js +2 -0
- package/dist/gateway/static/root/assets/skills-page.utils-Bwid1TGB.js +1 -0
- package/dist/gateway/static/root/assets/style-TIDOdKy0.js +7 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-Bv7GXFc6.js → system-settings-panel-BcB3p1e3.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-DQYEf08v.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-DnBOcGXi.js → theme-store-GVZOImyb.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-4XBsLEuv.js → typed-models-lib-CT2c85Ju.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BN2QgFGn.js → use-autosave-CcvY7DTh.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-CGI41bfO.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-Ricc3QGo.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-nmEAafFl.js → work-discovery-overlay-BoomfqhX.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-C5Kwe_bc.js → work-discovery-page-mbnepbQk.js} +1 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-DSWG2xqL.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-DtV0ruyk.js +5 -0
- package/dist/gateway/static/root/index.html +7 -7
- 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/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/heartbeat/service.js +1 -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/workflows.js +1 -1
- 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.js +5 -5
- package/dist/src/heartbeat/index.js +1 -1
- 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 +3 -3
- 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/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/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/workflow-run-setup-panel-BnNWBDwz.js +0 -3
- 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
|
@@ -83,7 +83,7 @@ export declare class GatewayMarketplaceService {
|
|
|
83
83
|
reloadSkills(): void;
|
|
84
84
|
patchSkillEnabled(skillName: string, enabled: boolean): void;
|
|
85
85
|
fetchSkillsCatalog(params: SkillsStoreListParams, provider?: string): Promise<UnifiedMarketplaceListResponse>;
|
|
86
|
-
fetchSkillsCategories(provider?: string): Promise<{
|
|
86
|
+
fetchSkillsCategories(provider?: string, locale?: string): Promise<{
|
|
87
87
|
items: MarketplaceCategoryOption[];
|
|
88
88
|
}>;
|
|
89
89
|
fetchSkillsPackageDetail(packageName: string, provider?: string): Promise<UnifiedMarketplacePackageDetail>;
|
|
@@ -112,9 +112,9 @@ var GatewayMarketplaceService = class {
|
|
|
112
112
|
const { listMarketplacePackages } = await import("../../agent/skills/skills-marketplace.js");
|
|
113
113
|
return listMarketplacePackages(this.opts.getConfig(), params, provider);
|
|
114
114
|
}
|
|
115
|
-
async fetchSkillsCategories(provider) {
|
|
115
|
+
async fetchSkillsCategories(provider, locale) {
|
|
116
116
|
const { listMarketplaceCategories } = await import("../../agent/skills/skills-marketplace.js");
|
|
117
|
-
return listMarketplaceCategories(this.opts.getConfig(), provider);
|
|
117
|
+
return listMarketplaceCategories(this.opts.getConfig(), provider, locale);
|
|
118
118
|
}
|
|
119
119
|
async fetchSkillsPackageDetail(packageName, provider) {
|
|
120
120
|
const { getMarketplacePackageDetail } = await import("../../agent/skills/skills-marketplace.js");
|
|
@@ -66,11 +66,6 @@ import { DiscussionSealer } from "../discussions/sealer.js";
|
|
|
66
66
|
import "../discussions/index.js";
|
|
67
67
|
import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
|
|
68
68
|
import "../endpoint-tools/index.js";
|
|
69
|
-
import { scheduleGatewayUpdateCheck } from "../infra/update-startup.js";
|
|
70
|
-
import { LocalAppService } from "../local-apps/service.js";
|
|
71
|
-
import "../local-apps/index.js";
|
|
72
|
-
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
73
|
-
import { MobileNotificationService } from "../mobile/notification-service.js";
|
|
74
69
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
75
70
|
import { reconcileDreamingAutomations } from "./dreaming-automation-reconciler.js";
|
|
76
71
|
import { NotesStore } from "../notes/store.js";
|
|
@@ -88,6 +83,10 @@ import { assertGatewayAuthNotKnownWeak } from "./security/known-weak-secrets.js"
|
|
|
88
83
|
import { assertGatewayRuntimeConfig } from "./runtime-config.js";
|
|
89
84
|
import { auditGatewayConfig } from "./security/audit.js";
|
|
90
85
|
import { ModelCatalogSyncService } from "../providers/model-catalog-sync-service.js";
|
|
86
|
+
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
87
|
+
import { MobileNotificationService } from "../mobile/notification-service.js";
|
|
88
|
+
import { LocalAppService } from "../local-apps/service.js";
|
|
89
|
+
import "../local-apps/index.js";
|
|
91
90
|
import { createRuntimeBrowserRecipeService } from "../browser/recipes/runtime-service.js";
|
|
92
91
|
import "../browser/recipes/index.js";
|
|
93
92
|
import { mapProductEventToProactive } from "../proactive/events/product-event-bridge.js";
|
|
@@ -99,6 +98,7 @@ import { ProactiveTemporalWorker } from "../proactive/temporal/worker.js";
|
|
|
99
98
|
import { ProactiveInboxService } from "../proactive/inbox/service.js";
|
|
100
99
|
import { ProactiveInboxWorker } from "../proactive/inbox/worker.js";
|
|
101
100
|
import "../proactive/index.js";
|
|
101
|
+
import { scheduleGatewayUpdateCheck } from "../infra/update-startup.js";
|
|
102
102
|
import { resolveChannelConnectDeferSet } from "./resolve-channel-connect-defer.js";
|
|
103
103
|
import { restartGatewayProcessWithFreshPid } from "./respawn.js";
|
|
104
104
|
import { GatewaySessionsApi } from "./service/sessions-api.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, shouldSilence, stripHeartbeatToken } from "./tokens.js";
|
|
2
|
+
import { appendCronEventLines } from "./event-prompt.js";
|
|
2
3
|
import { isWithinActiveHours } from "./active-hours.js";
|
|
3
4
|
import { isHeartbeatContentEmpty } from "./content-check.js";
|
|
4
|
-
import { appendCronEventLines } from "./event-prompt.js";
|
|
5
5
|
import { createHeartbeatWake } from "./wake.js";
|
|
6
6
|
export { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, appendCronEventLines, createHeartbeatWake, isHeartbeatContentEmpty, isWithinActiveHours, shouldSilence, stripHeartbeatToken };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isGatewayArgv, parseProcCmdline } from "./gateway-process-argv.js";
|
|
2
1
|
import { listPortListeners } from "../gateway/ports.js";
|
|
2
|
+
import { isGatewayArgv, parseProcCmdline } from "./gateway-process-argv.js";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { spawnSync } from "node:child_process";
|
|
5
5
|
//#region src/infra/gateway-processes.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { applyPathPrepend } from "./path-prepend.js";
|
|
1
2
|
import { resolveExecPathBinPrepend } from "./path-env.js";
|
|
2
3
|
import { readPackageVersion } from "./package-json.js";
|
|
3
|
-
import { applyPathPrepend } from "./path-prepend.js";
|
|
4
4
|
import { createDefaultCommandRunner } from "./run-command.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fs from "node:fs";
|
|
@@ -4,8 +4,8 @@ import { init_paths, resolveConfigPath } from "../config/paths.js";
|
|
|
4
4
|
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
5
|
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
6
6
|
import { resolveGatewayService } from "../daemon/service.js";
|
|
7
|
-
import { findVerifiedGatewayListenerPidsOnPortSync, signalVerifiedGatewayPidSync } from "./gateway-processes.js";
|
|
8
7
|
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "./restart.js";
|
|
8
|
+
import { findVerifiedGatewayListenerPidsOnPortSync, signalVerifiedGatewayPidSync } from "./gateway-processes.js";
|
|
9
9
|
import { refreshGatewayServiceAfterUpdate } from "./update-service-refresh.js";
|
|
10
10
|
//#region src/infra/update-restart.ts
|
|
11
11
|
init_loader();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { runPostUpdateExtensionSync } from "../extensions/update.js";
|
|
2
|
+
import "./update-channels.js";
|
|
3
|
+
import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
|
|
2
4
|
import { readPackageName, readPackageVersion } from "./package-json.js";
|
|
3
5
|
import { createDefaultCommandRunner, runCommandWithTimeout } from "./run-command.js";
|
|
4
6
|
import { XOPC_PACKAGE_NAME, cleanupGlobalRenameDirs, createGlobalInstallEnv, detectGlobalInstallManagerForRoot, resolveGlobalInstallSpec, resolveGlobalInstallTarget } from "./update-global.js";
|
|
5
7
|
import { runGlobalPackageUpdateSteps } from "./package-update-steps.js";
|
|
6
8
|
import { resolveStableNodePath } from "./stable-node-path.js";
|
|
7
|
-
import "./update-channels.js";
|
|
8
|
-
import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
|
|
9
9
|
import { trimLogTail } from "./update-log.js";
|
|
10
10
|
import { maybeRestartGatewayAfterUpdate } from "./update-restart.js";
|
|
11
11
|
import path from "node:path";
|
|
@@ -3,9 +3,9 @@ import { init_paths_state, resolveUpdateCheckStatePath } from "../config/paths-s
|
|
|
3
3
|
import { createLogger } from "../utils/logger/index.js";
|
|
4
4
|
import { init_logger } from "../utils/logger.js";
|
|
5
5
|
import { init_write_file_atomic, writeTextAtomic } from "./write-file-atomic.js";
|
|
6
|
+
import { acquireUpdateLock } from "./update-lock.js";
|
|
6
7
|
import { normalizeUpdateChannel } from "./update-channels.js";
|
|
7
8
|
import { compareSemver, detectInstallKind, resolveNpmChannelTag, resolvePackageRoot } from "./update-check.js";
|
|
8
|
-
import { acquireUpdateLock } from "./update-lock.js";
|
|
9
9
|
import { createHash, randomUUID } from "node:crypto";
|
|
10
10
|
import { readFile } from "node:fs/promises";
|
|
11
11
|
//#region src/infra/update-startup.ts
|
|
@@ -3,6 +3,7 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import "./constants.js";
|
|
4
4
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
5
5
|
import { init_providers } from "./index.js";
|
|
6
|
+
import { stripPromptCacheBoundary } from "../agent/prompt/cache-boundary.js";
|
|
6
7
|
import { createAssistantMessageEventStream, streamSimple } from "@earendil-works/pi-ai/compat";
|
|
7
8
|
//#region src/providers/extension-stream-bridge.ts
|
|
8
9
|
init_plugin_registry();
|
|
@@ -80,7 +81,7 @@ function createExtensionAwareStreamFn() {
|
|
|
80
81
|
const stream = createAssistantMessageEventStream();
|
|
81
82
|
const params = {
|
|
82
83
|
model: model.id,
|
|
83
|
-
systemPrompt: context.systemPrompt,
|
|
84
|
+
systemPrompt: context.systemPrompt ? stripPromptCacheBoundary(context.systemPrompt) : void 0,
|
|
84
85
|
messages: context.messages,
|
|
85
86
|
tools: context.tools,
|
|
86
87
|
temperature: options?.temperature,
|
|
@@ -200,15 +201,15 @@ function createExtensionAwareStreamFn() {
|
|
|
200
201
|
partial.usage = {
|
|
201
202
|
input: chunk.usage.input,
|
|
202
203
|
output: chunk.usage.output,
|
|
203
|
-
cacheRead: 0,
|
|
204
|
-
cacheWrite: 0,
|
|
205
|
-
totalTokens: chunk.usage.total ?? chunk.usage.input + chunk.usage.output,
|
|
204
|
+
cacheRead: chunk.usage.cacheRead ?? 0,
|
|
205
|
+
cacheWrite: chunk.usage.cacheWrite ?? 0,
|
|
206
|
+
totalTokens: chunk.usage.total ?? chunk.usage.input + chunk.usage.output + (chunk.usage.cacheRead ?? 0) + (chunk.usage.cacheWrite ?? 0),
|
|
206
207
|
cost: {
|
|
207
208
|
input: inputCost,
|
|
208
209
|
output: outputCost,
|
|
209
|
-
cacheRead: 0,
|
|
210
|
-
cacheWrite: 0,
|
|
211
|
-
total: inputCost + outputCost
|
|
210
|
+
cacheRead: (chunk.usage.cacheRead ?? 0) / 1e6 * (model.cost?.cacheRead ?? 0),
|
|
211
|
+
cacheWrite: (chunk.usage.cacheWrite ?? 0) / 1e6 * (model.cost?.cacheWrite ?? 0),
|
|
212
|
+
total: inputCost + outputCost + (chunk.usage.cacheRead ?? 0) / 1e6 * (model.cost?.cacheRead ?? 0) + (chunk.usage.cacheWrite ?? 0) / 1e6 * (model.cost?.cacheWrite ?? 0)
|
|
212
213
|
}
|
|
213
214
|
};
|
|
214
215
|
}
|
|
@@ -2,10 +2,10 @@ export interface CatalogModel {
|
|
|
2
2
|
id: string;
|
|
3
3
|
name: string;
|
|
4
4
|
availability: 'available' | 'unavailable';
|
|
5
|
-
kind: 'language' | 'image';
|
|
6
|
-
input: Array<'text' | 'image'>;
|
|
7
|
-
output: Array<'text' | 'image'>;
|
|
8
|
-
operations: Array<'chat.completions' | 'responses' | 'images.generate' | 'images.edit'>;
|
|
5
|
+
kind: 'language' | 'image' | 'stt' | 'tts';
|
|
6
|
+
input: Array<'text' | 'image' | 'audio'>;
|
|
7
|
+
output: Array<'text' | 'image' | 'audio'>;
|
|
8
|
+
operations: Array<'chat.completions' | 'responses' | 'images.generate' | 'images.edit' | 'audio.transcription' | 'audio.speech'>;
|
|
9
9
|
reasoning: boolean;
|
|
10
10
|
contextWindow: number;
|
|
11
11
|
maxOutputTokens: number | null;
|
|
@@ -18,6 +18,26 @@ export interface CatalogModel {
|
|
|
18
18
|
backgrounds: Array<'transparent' | 'opaque' | 'auto'>;
|
|
19
19
|
maxInputImages: number;
|
|
20
20
|
};
|
|
21
|
+
stt?: {
|
|
22
|
+
inputFormats: string[];
|
|
23
|
+
maxBytes: number;
|
|
24
|
+
maxDurationSeconds: number;
|
|
25
|
+
languages: string[];
|
|
26
|
+
languageHint: boolean;
|
|
27
|
+
prompt: boolean;
|
|
28
|
+
timestamps: Array<'segment' | 'word'>;
|
|
29
|
+
diarization: boolean;
|
|
30
|
+
};
|
|
31
|
+
tts?: {
|
|
32
|
+
maxCharacters: number;
|
|
33
|
+
languages: string[];
|
|
34
|
+
outputFormats: Array<'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm'>;
|
|
35
|
+
streaming: boolean;
|
|
36
|
+
speed: boolean;
|
|
37
|
+
pitch: boolean;
|
|
38
|
+
instructions: boolean;
|
|
39
|
+
defaultVoice?: string;
|
|
40
|
+
};
|
|
21
41
|
}
|
|
22
42
|
export interface CatalogSource {
|
|
23
43
|
providerId: string;
|
|
@@ -65,6 +65,17 @@ var init_model_catalog_store = __esmMin((() => {
|
|
|
65
65
|
qualities: [...model.imageGeneration.qualities],
|
|
66
66
|
formats: [...model.imageGeneration.formats],
|
|
67
67
|
backgrounds: [...model.imageGeneration.backgrounds]
|
|
68
|
+
} } : {},
|
|
69
|
+
...model.stt ? { stt: {
|
|
70
|
+
...model.stt,
|
|
71
|
+
inputFormats: [...model.stt.inputFormats],
|
|
72
|
+
languages: [...model.stt.languages],
|
|
73
|
+
timestamps: [...model.stt.timestamps]
|
|
74
|
+
} } : {},
|
|
75
|
+
...model.tts ? { tts: {
|
|
76
|
+
...model.tts,
|
|
77
|
+
languages: [...model.tts.languages],
|
|
78
|
+
outputFormats: [...model.tts.outputFormats]
|
|
68
79
|
} } : {}
|
|
69
80
|
}))
|
|
70
81
|
};
|
|
@@ -243,7 +243,7 @@ var init_model_registry = __esmMin((() => {
|
|
|
243
243
|
provider: source.providerId,
|
|
244
244
|
baseUrl: source.baseUrl,
|
|
245
245
|
reasoning: model.reasoning,
|
|
246
|
-
input: model.input,
|
|
246
|
+
input: model.input.filter((value) => value === "text" || value === "image"),
|
|
247
247
|
cost: {
|
|
248
248
|
input: 0,
|
|
249
249
|
output: 0,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Api, Model, SimpleStreamOptions } from '@earendil-works/pi-ai';
|
|
2
|
+
export declare function transformPromptCachePayload(model: Model<Api>, payload: unknown): unknown;
|
|
3
|
+
export declare function buildPromptCacheKey(model: Model<Api>, context: {
|
|
4
|
+
systemPrompt?: string;
|
|
5
|
+
tools?: unknown[];
|
|
6
|
+
}): string;
|
|
7
|
+
export declare function preparePromptCacheContext<T extends {
|
|
8
|
+
systemPrompt?: string;
|
|
9
|
+
}>(model: Model<Api>, context: T): T;
|
|
10
|
+
export declare function withPromptCachePayloadTransform(model: Model<Api>, context: {
|
|
11
|
+
systemPrompt?: string;
|
|
12
|
+
tools?: unknown[];
|
|
13
|
+
}, options: SimpleStreamOptions | undefined): SimpleStreamOptions | undefined;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { splitPromptCacheBoundary, stripPromptCacheBoundary } from "../agent/prompt/cache-boundary.js";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
//#region src/providers/prompt-cache-payload.ts
|
|
4
|
+
function asRecord(value) {
|
|
5
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
6
|
+
}
|
|
7
|
+
function supportsPromptCacheKey(model) {
|
|
8
|
+
if (model.api === "openai-codex-responses" || model.api === "azure-openai-responses") return true;
|
|
9
|
+
if (model.api !== "openai-completions" && model.api !== "openai-responses") return false;
|
|
10
|
+
return model.provider === "openai" || model.baseUrl?.includes("api.openai.com") === true;
|
|
11
|
+
}
|
|
12
|
+
function splitAnthropicSystem(payload) {
|
|
13
|
+
const record = asRecord(payload);
|
|
14
|
+
if (!record || !Array.isArray(record.system)) return payload;
|
|
15
|
+
let changed = false;
|
|
16
|
+
const system = record.system.flatMap((value) => {
|
|
17
|
+
const block = asRecord(value);
|
|
18
|
+
if (!block || typeof block.text !== "string") return [value];
|
|
19
|
+
const split = splitPromptCacheBoundary(block.text);
|
|
20
|
+
if (!split) return [value];
|
|
21
|
+
changed = true;
|
|
22
|
+
const { text: _text, ...rest } = block;
|
|
23
|
+
return [{
|
|
24
|
+
...rest,
|
|
25
|
+
type: block.type ?? "text",
|
|
26
|
+
text: split.stablePrefix
|
|
27
|
+
}, ...split.dynamicSuffix ? [{
|
|
28
|
+
type: block.type ?? "text",
|
|
29
|
+
text: split.dynamicSuffix
|
|
30
|
+
}] : []];
|
|
31
|
+
});
|
|
32
|
+
return changed ? {
|
|
33
|
+
...record,
|
|
34
|
+
system
|
|
35
|
+
} : payload;
|
|
36
|
+
}
|
|
37
|
+
function splitBedrockSystem(payload) {
|
|
38
|
+
const record = asRecord(payload);
|
|
39
|
+
if (!record || !Array.isArray(record.system)) return payload;
|
|
40
|
+
let changed = false;
|
|
41
|
+
const system = [];
|
|
42
|
+
for (let index = 0; index < record.system.length; index += 1) {
|
|
43
|
+
const value = record.system[index];
|
|
44
|
+
const block = asRecord(value);
|
|
45
|
+
const split = block && typeof block.text === "string" ? splitPromptCacheBoundary(block.text) : void 0;
|
|
46
|
+
if (!split) {
|
|
47
|
+
system.push(value);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
changed = true;
|
|
51
|
+
system.push({
|
|
52
|
+
...block,
|
|
53
|
+
text: split.stablePrefix
|
|
54
|
+
});
|
|
55
|
+
const next = asRecord(record.system[index + 1]);
|
|
56
|
+
if (next?.cachePoint) {
|
|
57
|
+
system.push(next);
|
|
58
|
+
index += 1;
|
|
59
|
+
}
|
|
60
|
+
if (split.dynamicSuffix) system.push({ text: split.dynamicSuffix });
|
|
61
|
+
}
|
|
62
|
+
return changed ? {
|
|
63
|
+
...record,
|
|
64
|
+
system
|
|
65
|
+
} : payload;
|
|
66
|
+
}
|
|
67
|
+
function transformPromptCachePayload(model, payload) {
|
|
68
|
+
if (model.api === "anthropic-messages") return splitAnthropicSystem(payload);
|
|
69
|
+
if (model.api === "bedrock-converse-stream") return splitBedrockSystem(payload);
|
|
70
|
+
return payload;
|
|
71
|
+
}
|
|
72
|
+
function canonicalJson(value) {
|
|
73
|
+
if (Array.isArray(value)) return `[${value.map(canonicalJson).join(",")}]`;
|
|
74
|
+
const record = asRecord(value);
|
|
75
|
+
if (record) return `{${Object.keys(record).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson(record[key])}`).join(",")}}`;
|
|
76
|
+
return JSON.stringify(value) ?? "null";
|
|
77
|
+
}
|
|
78
|
+
function buildPromptCacheKey(model, context) {
|
|
79
|
+
const stablePrompt = context.systemPrompt ? splitPromptCacheBoundary(context.systemPrompt)?.stablePrefix ?? stripPromptCacheBoundary(context.systemPrompt) : "";
|
|
80
|
+
return `xopc-${createHash("sha256").update(`${model.provider}\0${model.id}\0${stablePrompt}\0${canonicalJson(context.tools ?? [])}`).digest("base64url")}`;
|
|
81
|
+
}
|
|
82
|
+
function preparePromptCacheContext(model, context) {
|
|
83
|
+
if (model.api === "anthropic-messages" || model.api === "bedrock-converse-stream") return context;
|
|
84
|
+
if (!context.systemPrompt) return context;
|
|
85
|
+
return {
|
|
86
|
+
...context,
|
|
87
|
+
systemPrompt: stripPromptCacheBoundary(context.systemPrompt)
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function withPromptCachePayloadTransform(model, context, options) {
|
|
91
|
+
const explicitBoundary = model.api === "anthropic-messages" || model.api === "bedrock-converse-stream";
|
|
92
|
+
const openAiCacheKey = supportsPromptCacheKey(model) && options?.cacheRetention !== "none";
|
|
93
|
+
if (!explicitBoundary && !openAiCacheKey) return options;
|
|
94
|
+
const upstream = options?.onPayload;
|
|
95
|
+
const promptCacheKey = openAiCacheKey ? buildPromptCacheKey(model, context) : void 0;
|
|
96
|
+
return {
|
|
97
|
+
...options,
|
|
98
|
+
onPayload: async (payload, payloadModel) => {
|
|
99
|
+
const upstreamPayload = await upstream?.(payload, payloadModel);
|
|
100
|
+
const transformed = transformPromptCachePayload(model, upstreamPayload === void 0 ? payload : upstreamPayload);
|
|
101
|
+
const record = asRecord(transformed);
|
|
102
|
+
return record && promptCacheKey ? {
|
|
103
|
+
...record,
|
|
104
|
+
prompt_cache_key: promptCacheKey
|
|
105
|
+
} : transformed;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { buildPromptCacheKey, preparePromptCacheContext, transformPromptCachePayload, withPromptCachePayloadTransform };
|
|
@@ -20,7 +20,7 @@ function registerRuntimeProvider(modelRuntime, source) {
|
|
|
20
20
|
id: model.id,
|
|
21
21
|
name: model.name,
|
|
22
22
|
reasoning: model.reasoning,
|
|
23
|
-
input: model.input,
|
|
23
|
+
input: model.input.filter((value) => value === "text" || value === "image"),
|
|
24
24
|
cost: {
|
|
25
25
|
input: 0,
|
|
26
26
|
output: 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;
|