@xopcai/xopc 0.0.190 → 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-9vAbkroX.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-DkFeIdBf.js → app-management-settings-panel-D6Rv3OWI.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Bxs8Fpaj.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-Ch2RmLCC.js → archive-plugin-BokNQBwH.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BhMQM_Ky.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-D6CqlymH.js → binary-plugins-CPYAflIG.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-ClL6HEg9.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-BYy48VhN.js → browser-workflow-inputs-CqLnqA9z.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-zgLibuMH.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-DS9ED-EL.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-CkgsvhtW.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-Cv8rGhYW.js → desktop-pet-DOUeNVmC.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CIeJdwfV.js → desktop-pet-settings-D4704vtl.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-D8jXEiAY.js → directory-picker-path-field-DJDXeA1B.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CCZ9u6TZ.js → extension-debug-page-C0n2NMF1.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CV36ILRG.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-D4_r5iJM.js → gateway-config-api-CZra7GuI.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CYlntpBH.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-D4SyWob8.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-BMhCuVBZ.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-ijIe7_y2.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--V_fovKD.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-Dt9-in6W.js → markdown-split-Cy_2SN1Q.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-B3pj_iO0.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-DZ366lIT.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-C5ge434C.js → page-tabs-CvzSdYVj.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BFa9DgSV.js → preview-open-alternatives-kZ0nco7e.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Dc9CcWdu.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-B84DckWe.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-Dp9itvdy.js → settings-form-section-CKLns16d.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-CCtlhoy7.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-EQIOJa_L.js → settings-page-layout-J793iqfm.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-Cwi-SPja.js → setup-status-panel-CGsml89P.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-C4_B2jvf.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-Dpx2ags2.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-DULmTHUB.js → typed-models-lib-CT2c85Ju.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BrjVk5VH.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-Wr-uF7VA.js → work-discovery-overlay-BoomfqhX.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-BWds95sL.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/openai-images-provider.d.ts +1 -1
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/provider-registry.d.ts +2 -0
- package/dist/src/agent/image/generation/provider-registry.js +21 -10
- 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/providers/xopc-cloud.d.ts +2 -0
- package/dist/src/agent/image/generation/providers/xopc-cloud.js +74 -0
- package/dist/src/agent/image/generation/types.d.ts +15 -2
- 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/models.js +0 -1
- package/dist/src/cli/commands/onboard/model.d.ts +18 -0
- package/dist/src/cli/commands/onboard/model.js +81 -5
- 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/config/agent-profile.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/agents-admin.js +1 -1
- 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/models.js +11 -11
- 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/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/service/marketplace-service.d.ts +1 -1
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/infra/update-global.js +1 -1
- package/dist/src/providers/extension-stream-bridge.js +8 -7
- package/dist/src/providers/model-catalog-store.d.ts +35 -0
- package/dist/src/providers/model-catalog-store.js +25 -1
- package/dist/src/providers/model-catalog-sync-service.js +6 -0
- package/dist/src/providers/model-registry.js +4 -4
- 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 +4 -4
- package/dist/src/providers/xopc-cloud-model-source.js +101 -8
- 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/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 +1 -1
- package/dist/gateway/static/root/assets/agents-D1t4SfMQ.js +0 -68
- package/dist/gateway/static/root/assets/apps-page-Cgrgu5OW.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-CtJxstKh.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DW99iDmD.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CHUrT9EB.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-Cycrv0YV.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-V96gPUAU.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-Cz7SAAkm.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BhlyQoQI.js +0 -2
- package/dist/gateway/static/root/assets/extension-settings-page-IyQrSILY.js +0 -1
- package/dist/gateway/static/root/assets/home-page-B2Kagoh8.js +0 -3
- package/dist/gateway/static/root/assets/html-workspace-editor-C3DKAkMc.js +0 -1
- package/dist/gateway/static/root/assets/index-CYT5DOzr.js +0 -150
- package/dist/gateway/static/root/assets/index-D6e3tPL-.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BHYbFjqy.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-IIn8Tess.js +0 -2
- package/dist/gateway/static/root/assets/messages-B4XqB8I6.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-S2sBVOLw.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-BilzoCJ7.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BoQUyacP.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DUyUaCRF.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-Dzxlq1F0.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-TzwlZxU6.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-DQmMKf8r.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-CkyuGlZK.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BJCePQK5.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BYWLfmJi.js +0 -2
- package/dist/gateway/static/root/assets/skills-page.utils-Jhm24i4h.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DLAdxI6e.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-9AAFpGAL.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-BISTPfq_.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-DHqHP8_6.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-0b4_DFHr.js +0 -11
- /package/dist/gateway/static/root/assets/{workflows-page-DLioOiRN.css → style-DLioOiRN.css} +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { CapabilityPresetSchema, init_schema } from "../agent-manifest/schema.js";
|
|
2
2
|
import { init_preset_chain, linearizePresetIds } from "../agent-manifest/preset-chain.js";
|
|
3
|
-
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
3
|
+
import { resolveCapabilityPresetLayer, resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
4
|
+
import { normalizeConfiguredMcpServers } from "../config/mcp-config-normalize.js";
|
|
4
5
|
import { GATEWAY_BUILTIN_TOOL_IDS } from "./agent-builtin-tools.js";
|
|
6
|
+
import { createWorkflowCatalog } from "../agent/workflow/catalog.js";
|
|
5
7
|
//#region src/gateway/capability-presets-admin.ts
|
|
6
8
|
init_schema();
|
|
7
9
|
init_preset_chain();
|
|
@@ -129,20 +131,36 @@ function nextConfigWithPresets(cfg, presets) {
|
|
|
129
131
|
};
|
|
130
132
|
}
|
|
131
133
|
function listCapabilityPresets(cfg) {
|
|
132
|
-
const presets = Object.values(presetMap(cfg)).map((preset) =>
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
const presets = Object.values(presetMap(cfg)).map((preset) => {
|
|
135
|
+
const inherited = resolveCapabilityPresetLayer({
|
|
136
|
+
presetIds: preset.extends,
|
|
137
|
+
presets: cfg.agents.capabilityPresets,
|
|
138
|
+
defaultPresetId: preset.id === cfg.agents.defaultPreset ? "__none__" : cfg.agents.defaultPreset
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
...preset,
|
|
142
|
+
usage: agentUsage(cfg, preset.id),
|
|
143
|
+
inherited: inherited.patch,
|
|
144
|
+
inheritedSources: inherited.sources
|
|
145
|
+
};
|
|
146
|
+
}).sort((a, b) => a.id.localeCompare(b.id));
|
|
136
147
|
const agents = cfg.agents.list.map((agent) => ({
|
|
137
148
|
id: agent.id,
|
|
138
149
|
...agent.identity.name ? { name: agent.identity.name } : {},
|
|
139
150
|
extends: [...agent.extends ?? []]
|
|
140
151
|
})).sort((a, b) => a.id.localeCompare(b.id));
|
|
152
|
+
const workflows = createWorkflowCatalog().list().map((entry) => ({
|
|
153
|
+
id: entry.name,
|
|
154
|
+
title: entry.title,
|
|
155
|
+
description: entry.description
|
|
156
|
+
}));
|
|
141
157
|
return {
|
|
142
158
|
defaultPresetId: cfg.agents.defaultPreset,
|
|
143
159
|
presets,
|
|
144
160
|
agents,
|
|
145
|
-
builtinToolIds: [...GATEWAY_BUILTIN_TOOL_IDS]
|
|
161
|
+
builtinToolIds: [...GATEWAY_BUILTIN_TOOL_IDS],
|
|
162
|
+
mcpServerIds: Object.keys(normalizeConfiguredMcpServers(cfg.mcp?.servers)).sort(),
|
|
163
|
+
workflows
|
|
146
164
|
};
|
|
147
165
|
}
|
|
148
166
|
function prepareCreateCapabilityPreset(cfg, body) {
|
|
@@ -109,7 +109,8 @@ var ChatStreamMapper = class {
|
|
|
109
109
|
purpose
|
|
110
110
|
}] : [];
|
|
111
111
|
}) : [] })];
|
|
112
|
-
case "memory_captured":
|
|
112
|
+
case "memory_captured":
|
|
113
|
+
case "memory_candidate": return [this.make(event.type, { records: Array.isArray(event.records) ? event.records.flatMap((raw) => {
|
|
113
114
|
if (!raw || typeof raw !== "object") return [];
|
|
114
115
|
const record = raw;
|
|
115
116
|
const id = typeof record.id === "string" ? record.id : "";
|
|
@@ -480,11 +481,14 @@ function extractUsage(message) {
|
|
|
480
481
|
const usage = message.usage;
|
|
481
482
|
if (!usage || typeof usage !== "object") return void 0;
|
|
482
483
|
const rec = usage;
|
|
484
|
+
const cost = asRecord(rec.cost);
|
|
483
485
|
return {
|
|
484
|
-
inputTokens: typeof rec.inputTokens === "number" ? rec.inputTokens : void 0,
|
|
485
|
-
outputTokens: typeof rec.outputTokens === "number" ? rec.outputTokens : void 0,
|
|
486
|
+
inputTokens: typeof rec.input === "number" ? rec.input : typeof rec.inputTokens === "number" ? rec.inputTokens : void 0,
|
|
487
|
+
outputTokens: typeof rec.output === "number" ? rec.output : typeof rec.outputTokens === "number" ? rec.outputTokens : void 0,
|
|
488
|
+
cacheReadTokens: typeof rec.cacheRead === "number" ? rec.cacheRead : typeof rec.cacheReadTokens === "number" ? rec.cacheReadTokens : void 0,
|
|
489
|
+
cacheWriteTokens: typeof rec.cacheWrite === "number" ? rec.cacheWrite : typeof rec.cacheWriteTokens === "number" ? rec.cacheWriteTokens : void 0,
|
|
486
490
|
totalTokens: typeof rec.totalTokens === "number" ? rec.totalTokens : void 0,
|
|
487
|
-
cost: typeof rec.cost === "number" ? rec.cost : void 0
|
|
491
|
+
cost: typeof rec.cost === "number" ? rec.cost : typeof cost?.total === "number" ? cost.total : void 0
|
|
488
492
|
};
|
|
489
493
|
}
|
|
490
494
|
function extractDetails(value) {
|
|
@@ -169,6 +169,8 @@ export type AssistantMessageEndEvent = ChatStreamEnvelope<'assistant_message_end
|
|
|
169
169
|
usage?: {
|
|
170
170
|
inputTokens?: number;
|
|
171
171
|
outputTokens?: number;
|
|
172
|
+
cacheReadTokens?: number;
|
|
173
|
+
cacheWriteTokens?: number;
|
|
172
174
|
totalTokens?: number;
|
|
173
175
|
cost?: number;
|
|
174
176
|
};
|
|
@@ -217,6 +219,13 @@ export type MemoryCapturedEvent = ChatStreamEnvelope<'memory_captured', {
|
|
|
217
219
|
kind: string;
|
|
218
220
|
}>;
|
|
219
221
|
}>;
|
|
222
|
+
export type MemoryCandidateEvent = ChatStreamEnvelope<'memory_candidate', {
|
|
223
|
+
records: Array<{
|
|
224
|
+
id: string;
|
|
225
|
+
content: string;
|
|
226
|
+
kind: string;
|
|
227
|
+
}>;
|
|
228
|
+
}>;
|
|
220
229
|
export type RunEndEvent = ChatStreamEnvelope<'run_end', {
|
|
221
230
|
status: ChatStreamStatus;
|
|
222
231
|
summary?: string;
|
|
@@ -228,4 +237,4 @@ export type StreamErrorEvent = ChatStreamEnvelope<'error', {
|
|
|
228
237
|
recoverable?: boolean;
|
|
229
238
|
petFeedback: PetFeedback;
|
|
230
239
|
}>;
|
|
231
|
-
export type ChatStreamEvent = RunStartEvent | UserMessageEvent | UserTranscriptEvent | AssistantMessageStartEvent | AssistantDeltaEvent | ThinkingDeltaEvent | ThinkingEndEvent | ToolStartEvent | ToolUpdateEvent | ToolEndEvent | CommandStartedEvent | CommandOutputDeltaEvent | CommandCompletedEvent | PatchAppliedEvent | TurnPlanUpdatedEvent | TaskPlanUpdatedEvent | TurnDiffEvent | ReviewStartEvent | ReviewDeltaEvent | ReviewEndEvent | ReviewEvent | AssistantMessageEndEvent | ProgressEvent | CompactionEvent | TtsAudioEvent | ClarifyRequestEvent | MemoryConsentRequiredEvent | MemoryCapturedEvent | RunEndEvent | StreamErrorEvent;
|
|
240
|
+
export type ChatStreamEvent = RunStartEvent | UserMessageEvent | UserTranscriptEvent | AssistantMessageStartEvent | AssistantDeltaEvent | ThinkingDeltaEvent | ThinkingEndEvent | ToolStartEvent | ToolUpdateEvent | ToolEndEvent | CommandStartedEvent | CommandOutputDeltaEvent | CommandCompletedEvent | PatchAppliedEvent | TurnPlanUpdatedEvent | TaskPlanUpdatedEvent | TurnDiffEvent | ReviewStartEvent | ReviewDeltaEvent | ReviewEndEvent | ReviewEvent | AssistantMessageEndEvent | ProgressEvent | CompactionEvent | TtsAudioEvent | ClarifyRequestEvent | MemoryConsentRequiredEvent | MemoryCapturedEvent | MemoryCandidateEvent | RunEndEvent | StreamErrorEvent;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { shouldSilence, stripHeartbeatToken } from "../../heartbeat/tokens.js";
|
|
4
|
+
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
4
5
|
import { isWithinActiveHours } from "../../heartbeat/active-hours.js";
|
|
5
6
|
import { isHeartbeatContentEmpty } from "../../heartbeat/content-check.js";
|
|
6
|
-
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
7
7
|
import { createHeartbeatWake } from "../../heartbeat/wake.js";
|
|
8
8
|
import { resolveHeartbeatMdPath } from "../workspace-heartbeat-path.js";
|
|
9
9
|
import { readFile } from "fs/promises";
|
|
@@ -191,6 +191,7 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
191
191
|
maxTurns?: number;
|
|
192
192
|
timeoutMs?: number;
|
|
193
193
|
maxToolFailuresPerTurn?: number;
|
|
194
|
+
promptCacheRetention?: "none" | "short" | "long";
|
|
194
195
|
};
|
|
195
196
|
locks?: string[];
|
|
196
197
|
}>;
|
|
@@ -207,8 +207,9 @@ function registerCommandsSkillsRoutes(authenticated, deps) {
|
|
|
207
207
|
});
|
|
208
208
|
authenticated.get("/api/skills/marketplace/categories", async (c) => {
|
|
209
209
|
const provider = parseMarketplaceProviderQuery(c.req.query("provider"));
|
|
210
|
+
const locale = c.req.query("locale") ?? c.req.header("X-XOPC-Locale") ?? c.req.header("Accept-Language")?.split(",")[0];
|
|
210
211
|
try {
|
|
211
|
-
const payload = await service.marketplace.fetchSkillsCategories(provider);
|
|
212
|
+
const payload = await service.marketplace.fetchSkillsCategories(provider, locale);
|
|
212
213
|
return c.json({
|
|
213
214
|
ok: true,
|
|
214
215
|
payload
|
|
@@ -3,6 +3,14 @@ function startsWithAny(path, prefixes) {
|
|
|
3
3
|
return prefixes.some((prefix) => path === prefix || path.startsWith(`${prefix}/`));
|
|
4
4
|
}
|
|
5
5
|
const AUTHENTICATED_LAZY_ROUTE_BUNDLES = [
|
|
6
|
+
{
|
|
7
|
+
id: "runtime-tools",
|
|
8
|
+
match: (path) => startsWithAny(path, ["/api/runtime-tools"]),
|
|
9
|
+
load: async () => {
|
|
10
|
+
const { registerRuntimeToolsRoutes } = await import("./runtime-tools.js");
|
|
11
|
+
return { register: registerRuntimeToolsRoutes };
|
|
12
|
+
}
|
|
13
|
+
},
|
|
6
14
|
{
|
|
7
15
|
id: "media",
|
|
8
16
|
match: (path) => startsWithAny(path, ["/api/media"]),
|
|
@@ -7,7 +7,7 @@ import { CredentialResolver, init_credentials } from "../../../auth/credentials.
|
|
|
7
7
|
import "../../../providers/constants.js";
|
|
8
8
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
9
9
|
import { PROVIDER_META, getAllModels, getAllProviders, getAvailableModels, getProviderAuthState, init_providers, isProviderConfigured } from "../../../providers/index.js";
|
|
10
|
-
import { getImageGenerationProvider, reloadImageGenerationProviders } from "../../../agent/image/generation/provider-registry.js";
|
|
10
|
+
import { getImageGenerationProvider, reloadImageGenerationProviders, resolveImageGenerationCredentialMode } from "../../../agent/image/generation/provider-registry.js";
|
|
11
11
|
import { SessionConfigStore } from "../../../session/config-store.js";
|
|
12
12
|
import { deleteCustomImageProvider, listCustomImageProviders, upsertCustomImageProvider } from "../../custom-image-providers.js";
|
|
13
13
|
import { getDomesticProviderPreset, getDomesticProviderPresetIds } from "../../../providers/domestic-presets.js";
|
|
@@ -346,7 +346,7 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
346
346
|
ok: false,
|
|
347
347
|
error: { message: `Unknown image provider: ${providerId}` }
|
|
348
348
|
}, 404);
|
|
349
|
-
if (provider
|
|
349
|
+
if (resolveImageGenerationCredentialMode(provider) !== "api-key") return c.json({
|
|
350
350
|
ok: false,
|
|
351
351
|
error: { message: "This provider does not use an API key" }
|
|
352
352
|
}, 400);
|
|
@@ -465,25 +465,25 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
465
465
|
const prepared = prepareImageGenerationSetup(service.currentConfig, c.req.param("agentId"), {
|
|
466
466
|
providerId: body.providerId,
|
|
467
467
|
...typeof body.modelId === "string" ? { modelId: body.modelId } : {},
|
|
468
|
-
...body.
|
|
469
|
-
...typeof body.baseUrl === "string" ? { baseUrl: body.baseUrl } : {}
|
|
468
|
+
...body.providerConfig && typeof body.providerConfig === "object" && !Array.isArray(body.providerConfig) ? { providerConfig: body.providerConfig } : {}
|
|
470
469
|
});
|
|
471
470
|
if (prepared.ok === false) return c.json({
|
|
472
471
|
ok: false,
|
|
473
472
|
error: { message: prepared.error }
|
|
474
473
|
}, 400);
|
|
475
474
|
const resolver = new CredentialResolver();
|
|
476
|
-
const
|
|
475
|
+
const usesApiKey = resolveImageGenerationCredentialMode(getImageGenerationProvider(prepared.providerId)) === "api-key";
|
|
476
|
+
const previousKey = usesApiKey ? await resolver.revealGatewayStoredApiKey(prepared.providerId) : void 0;
|
|
477
477
|
const suppliedKey = typeof body.apiKey === "string" ? body.apiKey.trim() : "";
|
|
478
|
-
const effectiveKey = suppliedKey || await resolver.resolveApiKey(prepared.providerId);
|
|
479
|
-
if (
|
|
478
|
+
const effectiveKey = usesApiKey ? suppliedKey || await resolver.resolveApiKey(prepared.providerId) : void 0;
|
|
479
|
+
if (usesApiKey && !effectiveKey) return c.json({
|
|
480
480
|
ok: false,
|
|
481
481
|
error: { message: "API key is required" }
|
|
482
482
|
}, 400);
|
|
483
|
-
const verification = suppliedKey ? await verifyImageGenerationCredential({
|
|
483
|
+
const verification = usesApiKey && suppliedKey ? await verifyImageGenerationCredential({
|
|
484
484
|
providerId: prepared.providerId,
|
|
485
485
|
apiKey: suppliedKey,
|
|
486
|
-
baseUrl: typeof body.baseUrl === "string" ? body.baseUrl : void 0
|
|
486
|
+
baseUrl: typeof body.providerConfig?.baseUrl === "string" ? body.providerConfig.baseUrl : void 0
|
|
487
487
|
}) : {
|
|
488
488
|
verified: false,
|
|
489
489
|
supported: false
|
|
@@ -492,10 +492,10 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
492
492
|
ok: false,
|
|
493
493
|
error: { message: verification.message ?? "Credential verification failed" }
|
|
494
494
|
}, 400);
|
|
495
|
-
if (suppliedKey) await resolver.saveApiKey(prepared.providerId, suppliedKey, { profileName: "default" });
|
|
495
|
+
if (usesApiKey && suppliedKey) await resolver.saveApiKey(prepared.providerId, suppliedKey, { profileName: "default" });
|
|
496
496
|
const saved = await service.saveConfig(prepared.config);
|
|
497
497
|
if (!saved.saved) {
|
|
498
|
-
if (suppliedKey) if (previousKey) await resolver.saveApiKey(prepared.providerId, previousKey, { profileName: "default" });
|
|
498
|
+
if (usesApiKey && suppliedKey) if (previousKey) await resolver.saveApiKey(prepared.providerId, previousKey, { profileName: "default" });
|
|
499
499
|
else await resolver.deleteProfile(`${prepared.providerId}:default`);
|
|
500
500
|
return c.json({
|
|
501
501
|
ok: false,
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { init_paths_state, resolveStateDir } from "../../../config/paths-state.js";
|
|
2
|
+
import { RuntimeToolsConfigSchema, init_schema } from "../../../config/schema.js";
|
|
3
|
+
import { ManagedRuntimeManager } from "../../../runtime-tools/manager.js";
|
|
4
|
+
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
5
|
+
import { pruneRuntimeTools } from "../../../runtime-tools/prune.js";
|
|
6
|
+
import { streamSSE } from "hono/streaming";
|
|
7
|
+
//#region src/gateway/hono/routes/runtime-tools.ts
|
|
8
|
+
init_paths_state();
|
|
9
|
+
init_schema();
|
|
10
|
+
const log = createGatewayRouteLogger("RuntimeTools");
|
|
11
|
+
const RUNTIMES = new Set([
|
|
12
|
+
"node",
|
|
13
|
+
"uv",
|
|
14
|
+
"python"
|
|
15
|
+
]);
|
|
16
|
+
function parseRuntime(value) {
|
|
17
|
+
return RUNTIMES.has(value) ? value : null;
|
|
18
|
+
}
|
|
19
|
+
function runtimeManager(config) {
|
|
20
|
+
return new ManagedRuntimeManager({
|
|
21
|
+
stateDir: resolveStateDir(),
|
|
22
|
+
config: config.runtimeTools
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
async function readJson(c) {
|
|
26
|
+
try {
|
|
27
|
+
return await c.req.json();
|
|
28
|
+
} catch {
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function registerRuntimeToolsRoutes(authenticated, deps) {
|
|
33
|
+
const { service, strictRateLimitMiddleware } = deps;
|
|
34
|
+
authenticated.get("/api/runtime-tools", async (c) => {
|
|
35
|
+
const statuses = await runtimeManager(service.currentConfig).statusAll();
|
|
36
|
+
return c.json({
|
|
37
|
+
ok: true,
|
|
38
|
+
payload: {
|
|
39
|
+
config: service.currentConfig.runtimeTools,
|
|
40
|
+
statuses
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
authenticated.patch("/api/runtime-tools/config", strictRateLimitMiddleware, async (c) => {
|
|
45
|
+
const body = await readJson(c);
|
|
46
|
+
const parsed = RuntimeToolsConfigSchema.safeParse(body);
|
|
47
|
+
if (!parsed.success) return c.json({
|
|
48
|
+
ok: false,
|
|
49
|
+
error: "invalid-config",
|
|
50
|
+
message: parsed.error.issues[0]?.message ?? "Invalid runtime tools config"
|
|
51
|
+
}, 400);
|
|
52
|
+
const config = structuredClone(service.currentConfig);
|
|
53
|
+
config.runtimeTools = parsed.data;
|
|
54
|
+
const result = await service.saveConfig(config);
|
|
55
|
+
if (!result.saved) return c.json({
|
|
56
|
+
ok: false,
|
|
57
|
+
error: "save-failed",
|
|
58
|
+
message: result.error
|
|
59
|
+
}, 500);
|
|
60
|
+
service.emit("runtime-tools.updated", { config: parsed.data });
|
|
61
|
+
return c.json({
|
|
62
|
+
ok: true,
|
|
63
|
+
payload: { config: parsed.data }
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
authenticated.post("/api/runtime-tools/prune", strictRateLimitMiddleware, async (c) => {
|
|
67
|
+
const payload = await pruneRuntimeTools({
|
|
68
|
+
stateDir: resolveStateDir(),
|
|
69
|
+
config: service.currentConfig.runtimeTools
|
|
70
|
+
});
|
|
71
|
+
return c.json({
|
|
72
|
+
ok: true,
|
|
73
|
+
payload
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
const registerOperation = (action) => {
|
|
77
|
+
authenticated.post(`/api/runtime-tools/:runtime/${action}/stream`, strictRateLimitMiddleware, async (c) => {
|
|
78
|
+
const runtime = parseRuntime(c.req.param("runtime"));
|
|
79
|
+
if (!runtime) return c.json({
|
|
80
|
+
ok: false,
|
|
81
|
+
error: "invalid-runtime"
|
|
82
|
+
}, 400);
|
|
83
|
+
const body = await readJson(c);
|
|
84
|
+
const version = typeof body.version === "string" && body.version.trim() ? body.version.trim() : void 0;
|
|
85
|
+
return streamSSE(c, async (stream) => {
|
|
86
|
+
const manager = runtimeManager(service.currentConfig);
|
|
87
|
+
let writes = Promise.resolve();
|
|
88
|
+
const onProgress = (event) => {
|
|
89
|
+
writes = writes.then(async () => {
|
|
90
|
+
try {
|
|
91
|
+
await stream.writeSSE({
|
|
92
|
+
event: "progress",
|
|
93
|
+
data: JSON.stringify(event)
|
|
94
|
+
});
|
|
95
|
+
} catch {}
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
manager.on("progress", onProgress);
|
|
99
|
+
try {
|
|
100
|
+
const resolved = action === "repair" ? await manager.repair(runtime) : await manager.install(runtime, version);
|
|
101
|
+
await writes;
|
|
102
|
+
await stream.writeSSE({
|
|
103
|
+
event: "result",
|
|
104
|
+
data: JSON.stringify({
|
|
105
|
+
ok: true,
|
|
106
|
+
payload: resolved
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
service.emit("runtime-tools.updated", {
|
|
110
|
+
runtime,
|
|
111
|
+
action,
|
|
112
|
+
resolved
|
|
113
|
+
});
|
|
114
|
+
} catch (error) {
|
|
115
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
116
|
+
log.warn({
|
|
117
|
+
err: error,
|
|
118
|
+
runtime,
|
|
119
|
+
action
|
|
120
|
+
}, `Runtime ${action} failed: ${message}`);
|
|
121
|
+
await writes;
|
|
122
|
+
try {
|
|
123
|
+
await stream.writeSSE({
|
|
124
|
+
event: "result",
|
|
125
|
+
data: JSON.stringify({
|
|
126
|
+
ok: false,
|
|
127
|
+
error: `${action}-failed`,
|
|
128
|
+
message
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
} catch {}
|
|
132
|
+
} finally {
|
|
133
|
+
manager.off("progress", onProgress);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
registerOperation("install");
|
|
139
|
+
registerOperation("repair");
|
|
140
|
+
}
|
|
141
|
+
//#endregion
|
|
142
|
+
export { registerRuntimeToolsRoutes };
|
|
@@ -150,7 +150,8 @@ function registerUnderstandingSourceRoutes(authenticated, deps) {
|
|
|
150
150
|
error: "No understanding source items were provided"
|
|
151
151
|
}, 400);
|
|
152
152
|
try {
|
|
153
|
-
const
|
|
153
|
+
const checkpoints = body && typeof body === "object" && body.sourceCheckpoints && typeof body.sourceCheckpoints === "object" ? body.sourceCheckpoints : void 0;
|
|
154
|
+
const result = await service.importUnderstandingSources(items, c.req.raw.signal, stringField(body, "workDiscoveryRunId") || void 0, checkpoints);
|
|
154
155
|
return c.json({
|
|
155
156
|
ok: true,
|
|
156
157
|
...result
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getDefaultModelSync, init_providers, resolveModel } from "../../../providers/index.js";
|
|
2
2
|
import { completeWithResolvedCredentials } from "../../../providers/model-call.js";
|
|
3
3
|
import { resolveTtsProviderConfigSlice } from "../../../voice/tts/config-slice.js";
|
|
4
|
-
import { isTTSAvailable } from "../../../voice/tts/factory.js";
|
|
4
|
+
import { isTTSAvailable, resolveSpeechProvider } from "../../../voice/tts/factory.js";
|
|
5
5
|
import { speak } from "../../../voice/tts/speak-core.js";
|
|
6
6
|
import { mergeTtsConfigFromAppConfig } from "../../../voice/tts/merge-config.js";
|
|
7
7
|
import { getLocalVoiceRuntimeClient } from "../../../voice/local/runtime-client.js";
|
|
@@ -144,6 +144,47 @@ function registerVoiceRoutes(authenticated, deps) {
|
|
|
144
144
|
payload
|
|
145
145
|
});
|
|
146
146
|
});
|
|
147
|
+
authenticated.get("/api/voice/tts-voices", async (c) => {
|
|
148
|
+
const provider = c.req.query("provider")?.trim() ?? "";
|
|
149
|
+
const model = c.req.query("model")?.trim() ?? "";
|
|
150
|
+
if (!provider || !model || provider.length > 100 || model.length > 200) return c.json({
|
|
151
|
+
ok: false,
|
|
152
|
+
error: { message: "provider and model are required" }
|
|
153
|
+
}, 400);
|
|
154
|
+
const config = service.currentConfig;
|
|
155
|
+
const baseConfig = mergeTtsConfigFromAppConfig(config.messages?.tts);
|
|
156
|
+
const resolved = resolveSpeechProvider(provider, {
|
|
157
|
+
...baseConfig,
|
|
158
|
+
provider,
|
|
159
|
+
providers: {
|
|
160
|
+
...baseConfig.providers ?? {},
|
|
161
|
+
[provider]: {
|
|
162
|
+
...baseConfig.providers?.[provider] ?? {},
|
|
163
|
+
model
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
if (!resolved?.plugin.listVoices) return c.json({
|
|
168
|
+
ok: true,
|
|
169
|
+
payload: { voices: [] }
|
|
170
|
+
});
|
|
171
|
+
try {
|
|
172
|
+
const voices = await resolved.plugin.listVoices({
|
|
173
|
+
cfg: config,
|
|
174
|
+
providerConfig: resolved.providerConfig
|
|
175
|
+
});
|
|
176
|
+
return c.json({
|
|
177
|
+
ok: true,
|
|
178
|
+
payload: { voices }
|
|
179
|
+
});
|
|
180
|
+
} catch (error) {
|
|
181
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
182
|
+
return c.json({
|
|
183
|
+
ok: false,
|
|
184
|
+
error: { message: `Voice discovery failed: ${message}` }
|
|
185
|
+
}, 502);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
147
188
|
/**
|
|
148
189
|
* GET /api/voice/stt-providers
|
|
149
190
|
*
|
|
@@ -440,7 +481,7 @@ function registerVoiceRoutes(authenticated, deps) {
|
|
|
440
481
|
const startedAt = Date.now();
|
|
441
482
|
try {
|
|
442
483
|
const result = await transcribe(input.audioBuffer, sttConfig, {
|
|
443
|
-
language: input.language
|
|
484
|
+
language: input.language,
|
|
444
485
|
mime: input.mimeType,
|
|
445
486
|
fileName: input.fileName,
|
|
446
487
|
signal: c.req.raw.signal
|
|
@@ -7,9 +7,9 @@ import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
|
7
7
|
import "../../../workflows/domain/index.js";
|
|
8
8
|
import { resolveWorkflowRunArtifactsDir } from "../../../workflows/store/paths.js";
|
|
9
9
|
import { WorkflowDraftService } from "../../../workflows/draft/workflow-draft-service.js";
|
|
10
|
+
import "../../../workflows/draft/index.js";
|
|
10
11
|
import { WorkflowDraftConflictError, WorkflowDraftStore } from "../../../workflows/authoring/workflow-draft-store.js";
|
|
11
12
|
import "../../../workflows/authoring/index.js";
|
|
12
|
-
import "../../../workflows/draft/index.js";
|
|
13
13
|
import { basename, join } from "node:path";
|
|
14
14
|
import { readFile, stat } from "node:fs/promises";
|
|
15
15
|
//#region src/gateway/hono/routes/workflows.ts
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
import { listContextConsolidationRuns } from "../../../storage/sqlite/context-consolidation-repository.js";
|
|
2
|
+
import { UNDERSTANDING_KINDS } from "../../../user-context/domain.js";
|
|
3
|
+
import { summarizeUserUnderstandingQuality } from "../../../storage/sqlite/user-context-quality-repository.js";
|
|
2
4
|
import { createCollaborationRule, createUnderstanding, decideContextConsent, deleteCollaborationRule, deleteUnderstanding, getCollaborationRule, getTurnPersonalization, getUnderstanding, getUserProfile, listCollaborationRules, listUnderstandingEvidence, listUnderstandings, recordContextFeedback, rejectUnderstanding, reviseCollaborationRule, reviseUnderstanding, setCollaborationRuleStatus, setUnderstandingStatus, updateUserProfile } from "../../../storage/sqlite/user-context-repository.js";
|
|
3
5
|
import "../../../storage/sqlite/index.js";
|
|
6
|
+
import { canonicalUnderstandingKey, findDuplicateUnderstanding } from "../../../user-context/understanding.js";
|
|
4
7
|
import { userInfo } from "node:os";
|
|
5
|
-
import { createHash } from "node:crypto";
|
|
6
8
|
//#region src/gateway/hono/routes/you.ts
|
|
7
|
-
const
|
|
8
|
-
"preference",
|
|
9
|
-
"boundary",
|
|
10
|
-
"relationship",
|
|
11
|
-
"routine",
|
|
12
|
-
"current_state",
|
|
13
|
-
"long_term_goal",
|
|
14
|
-
"project_context",
|
|
15
|
-
"task_lesson",
|
|
16
|
-
"derived_insight"
|
|
17
|
-
]);
|
|
9
|
+
const UNDERSTANDING_KIND_SET = new Set(UNDERSTANDING_KINDS);
|
|
18
10
|
const UNDERSTANDING_STATUSES = new Set([
|
|
19
11
|
"candidate",
|
|
20
12
|
"active",
|
|
@@ -68,13 +60,6 @@ function scopeFrom(value) {
|
|
|
68
60
|
id
|
|
69
61
|
} : void 0;
|
|
70
62
|
}
|
|
71
|
-
function canonicalKey(kind, statement) {
|
|
72
|
-
const normalized = statement.toLocaleLowerCase().replace(/[^\p{L}\p{N}]+/gu, " ").trim();
|
|
73
|
-
return `${kind}:${createHash("sha256").update(normalized).digest("hex").slice(0, 20)}`;
|
|
74
|
-
}
|
|
75
|
-
function sameScope(left, right) {
|
|
76
|
-
return left.type === right.type && left.id === right.id;
|
|
77
|
-
}
|
|
78
63
|
function validTimezone(value) {
|
|
79
64
|
if (!value) return true;
|
|
80
65
|
try {
|
|
@@ -103,7 +88,8 @@ function registerYouRoutes(authenticated, deps) {
|
|
|
103
88
|
profile: getUserProfile(),
|
|
104
89
|
understandings: listUnderstandings(),
|
|
105
90
|
rules: listCollaborationRules(),
|
|
106
|
-
consolidation: { lastRun: listContextConsolidationRuns(1)[0] ?? null }
|
|
91
|
+
consolidation: { lastRun: listContextConsolidationRuns(1)[0] ?? null },
|
|
92
|
+
quality: summarizeUserUnderstandingQuality()
|
|
107
93
|
}));
|
|
108
94
|
authenticated.get("/api/you/profile", (c) => {
|
|
109
95
|
const profile = getUserProfile();
|
|
@@ -143,10 +129,15 @@ function registerYouRoutes(authenticated, deps) {
|
|
|
143
129
|
const statement = nonEmptyString(body?.statement);
|
|
144
130
|
const kind = body?.kind;
|
|
145
131
|
const scope = scopeFrom(body?.scope ?? { type: "global" });
|
|
146
|
-
if (!statement || !
|
|
132
|
+
if (!statement || !UNDERSTANDING_KIND_SET.has(kind) || !scope) return c.json({ error: "Valid statement, kind, and scope are required" }, 400);
|
|
147
133
|
const typedKind = kind;
|
|
148
|
-
const key =
|
|
149
|
-
if (listUnderstandings()
|
|
134
|
+
const key = canonicalUnderstandingKey(typedKind, statement);
|
|
135
|
+
if (findDuplicateUnderstanding(listUnderstandings(), {
|
|
136
|
+
kind: typedKind,
|
|
137
|
+
statement,
|
|
138
|
+
canonicalKey: key,
|
|
139
|
+
scope
|
|
140
|
+
})) return c.json({ error: "This understanding already exists" }, 409);
|
|
150
141
|
const understanding = createUnderstanding({
|
|
151
142
|
kind: typedKind,
|
|
152
143
|
canonicalKey: key,
|
|
@@ -177,8 +168,14 @@ function registerYouRoutes(authenticated, deps) {
|
|
|
177
168
|
if (body.statement !== void 0) {
|
|
178
169
|
const statement = nonEmptyString(body.statement);
|
|
179
170
|
if (!statement) return c.json({ error: "statement must be 1-2000 characters" }, 400);
|
|
180
|
-
const key =
|
|
181
|
-
if (listUnderstandings()
|
|
171
|
+
const key = canonicalUnderstandingKey(understanding.kind, statement);
|
|
172
|
+
if (findDuplicateUnderstanding(listUnderstandings(), {
|
|
173
|
+
kind: understanding.kind,
|
|
174
|
+
statement,
|
|
175
|
+
canonicalKey: key,
|
|
176
|
+
scope: understanding.scope,
|
|
177
|
+
excludeId: id
|
|
178
|
+
})) return c.json({ error: "This understanding already exists" }, 409);
|
|
182
179
|
understanding = reviseUnderstanding(id, statement, {
|
|
183
180
|
canonicalKey: key,
|
|
184
181
|
explicitness: "explicit",
|
|
@@ -3,12 +3,11 @@ import { type Config } from '../config/schema.js';
|
|
|
3
3
|
export type ImageGenerationSetupInput = {
|
|
4
4
|
providerId: string;
|
|
5
5
|
modelId?: string;
|
|
6
|
-
|
|
7
|
-
baseUrl?: string;
|
|
6
|
+
providerConfig?: Record<string, unknown>;
|
|
8
7
|
};
|
|
9
8
|
export type ImageGenerationCatalogItem = ReturnType<typeof listImageGenerationProvidersSummary>[number] & {
|
|
10
9
|
configured: boolean;
|
|
11
|
-
|
|
10
|
+
config: Record<string, string>;
|
|
12
11
|
};
|
|
13
12
|
export declare function getImageGenerationCatalog(config: Config): ImageGenerationCatalogItem[];
|
|
14
13
|
export declare function getAgentImageGenerationConfig(config: Config, agentIdRaw: string): {
|
|
@@ -13,10 +13,44 @@ function getImageGenerationCatalog(config) {
|
|
|
13
13
|
return {
|
|
14
14
|
...summary,
|
|
15
15
|
configured: provider.isConfigured({ cfg: config }),
|
|
16
|
-
|
|
16
|
+
config: Object.fromEntries(summary.configFields.flatMap((field) => {
|
|
17
|
+
const value = config.providers?.[summary.id]?.[field.key];
|
|
18
|
+
return typeof value === "string" ? [[field.key, value]] : [];
|
|
19
|
+
}))
|
|
17
20
|
};
|
|
18
21
|
});
|
|
19
22
|
}
|
|
23
|
+
function parseProviderConfig(provider, input) {
|
|
24
|
+
const source = input ?? {};
|
|
25
|
+
const allowedKeys = new Set(provider.configFields?.map((field) => field.key) ?? []);
|
|
26
|
+
const unknownKey = Object.keys(source).find((key) => !allowedKeys.has(key));
|
|
27
|
+
if (unknownKey) return {
|
|
28
|
+
ok: false,
|
|
29
|
+
error: `Unknown ${provider.id} config field: ${unknownKey}`
|
|
30
|
+
};
|
|
31
|
+
const value = {};
|
|
32
|
+
for (const field of provider.configFields ?? []) {
|
|
33
|
+
const raw = source[field.key];
|
|
34
|
+
const resolved = typeof raw === "string" ? raw.trim() : "";
|
|
35
|
+
if (!resolved) {
|
|
36
|
+
if (field.required) return {
|
|
37
|
+
ok: false,
|
|
38
|
+
error: `${provider.id} requires ${field.key}`
|
|
39
|
+
};
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (field.type === "select" && !field.options?.some((option) => option.value === resolved)) return {
|
|
43
|
+
ok: false,
|
|
44
|
+
error: `Invalid ${provider.id} ${field.key}: ${resolved}`
|
|
45
|
+
};
|
|
46
|
+
if (field.key === "region") value.region = resolved;
|
|
47
|
+
else value.baseUrl = resolved;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
ok: true,
|
|
51
|
+
value
|
|
52
|
+
};
|
|
53
|
+
}
|
|
20
54
|
function getAgentImageGenerationConfig(config, agentIdRaw) {
|
|
21
55
|
const agentId = normalizeAgentId(agentIdRaw);
|
|
22
56
|
if (!config.agents.list.some((entry) => entry.enabled !== false && normalizeAgentId(entry.id) === agentId)) throw new Error(`Agent not found: ${agentId}`);
|
|
@@ -42,9 +76,10 @@ function prepareImageGenerationSetup(config, agentIdRaw, input) {
|
|
|
42
76
|
ok: false,
|
|
43
77
|
error: `Unknown ${providerId} image model: ${modelId}`
|
|
44
78
|
};
|
|
45
|
-
|
|
79
|
+
const parsedProviderConfig = parseProviderConfig(provider, input.providerConfig);
|
|
80
|
+
if (parsedProviderConfig.ok === false) return {
|
|
46
81
|
ok: false,
|
|
47
|
-
error:
|
|
82
|
+
error: parsedProviderConfig.error
|
|
48
83
|
};
|
|
49
84
|
const next = structuredClone(config);
|
|
50
85
|
const index = next.agents.list.findIndex((entry) => entry.enabled !== false && normalizeAgentId(entry.id) === agentId);
|
|
@@ -52,15 +87,11 @@ function prepareImageGenerationSetup(config, agentIdRaw, input) {
|
|
|
52
87
|
ok: false,
|
|
53
88
|
error: `Agent not found: ${agentId}`
|
|
54
89
|
};
|
|
55
|
-
const connection = {
|
|
56
|
-
...input.region ? { region: input.region } : {},
|
|
57
|
-
...input.baseUrl?.trim() ? { baseUrl: input.baseUrl.trim() } : {}
|
|
58
|
-
};
|
|
59
90
|
next.providers = {
|
|
60
91
|
...next.providers ?? {},
|
|
61
92
|
[providerId]: {
|
|
62
93
|
...next.providers?.[providerId] ?? {},
|
|
63
|
-
...
|
|
94
|
+
...parsedProviderConfig.value
|
|
64
95
|
}
|
|
65
96
|
};
|
|
66
97
|
const entry = next.agents.list[index];
|
|
@@ -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>;
|