@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,18 +1,16 @@
|
|
|
1
1
|
import { createUnderstanding, listUnderstandings } from "../storage/sqlite/user-context-repository.js";
|
|
2
2
|
import "../storage/sqlite/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { canonicalUnderstandingKey, findDuplicateUnderstanding } from "./understanding.js";
|
|
4
4
|
//#region src/user-context/manual-understanding.ts
|
|
5
|
-
function canonicalKey(kind, statement) {
|
|
6
|
-
const normalized = statement.toLocaleLowerCase().replace(/[^\p{L}\p{N}]+/gu, " ").trim();
|
|
7
|
-
return `${kind}:${createHash("sha256").update(normalized).digest("hex").slice(0, 20)}`;
|
|
8
|
-
}
|
|
9
|
-
function sameScope(left, right) {
|
|
10
|
-
return left.type === right.type && left.id === right.id;
|
|
11
|
-
}
|
|
12
5
|
function createManualUnderstanding(input) {
|
|
13
6
|
const statement = input.content.trim();
|
|
14
|
-
const key =
|
|
15
|
-
const duplicate = listUnderstandings()
|
|
7
|
+
const key = canonicalUnderstandingKey(input.kind, statement);
|
|
8
|
+
const duplicate = findDuplicateUnderstanding(listUnderstandings(), {
|
|
9
|
+
kind: input.kind,
|
|
10
|
+
statement,
|
|
11
|
+
canonicalKey: key,
|
|
12
|
+
scope: input.scope
|
|
13
|
+
});
|
|
16
14
|
if (duplicate) return {
|
|
17
15
|
understanding: duplicate,
|
|
18
16
|
created: false
|
|
@@ -176,12 +176,7 @@ var UserContextPlanner = class {
|
|
|
176
176
|
injectedChars: rule.statement.length
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
const ranked = listUnderstandings([
|
|
180
|
-
"active",
|
|
181
|
-
"candidate",
|
|
182
|
-
"needs_review",
|
|
183
|
-
"stale"
|
|
184
|
-
]).filter((item) => !excluded.has(item.id)).map((item) => ({
|
|
179
|
+
const ranked = listUnderstandings(["active"]).filter((item) => !excluded.has(item.id)).map((item) => ({
|
|
185
180
|
item,
|
|
186
181
|
score: relevance(query, item)
|
|
187
182
|
})).sort((left, right) => right.score - left.score).slice(0, Math.max(maxResults * 5, 50));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { UnderstandingSourceItem, UserFocus } from './types.js';
|
|
2
|
+
export type ActivityTopic = Pick<UserFocus, 'canonicalKey' | 'title' | 'summary' | 'horizon' | 'confidence' | 'evidenceRefs'> & {
|
|
3
|
+
sourceIds: string[];
|
|
4
|
+
};
|
|
5
|
+
export declare function clusterActivityTopics(items: UnderstandingSourceItem[], now?: number): ActivityTopic[];
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
//#region src/user-context/sources/activity-clustering.ts
|
|
3
|
+
const STOP_WORDS = new Set([
|
|
4
|
+
"about",
|
|
5
|
+
"and",
|
|
6
|
+
"bookmark",
|
|
7
|
+
"bookmarks",
|
|
8
|
+
"desktop",
|
|
9
|
+
"document",
|
|
10
|
+
"documents",
|
|
11
|
+
"download",
|
|
12
|
+
"downloads",
|
|
13
|
+
"file",
|
|
14
|
+
"files",
|
|
15
|
+
"from",
|
|
16
|
+
"guide",
|
|
17
|
+
"home",
|
|
18
|
+
"index",
|
|
19
|
+
"into",
|
|
20
|
+
"latest",
|
|
21
|
+
"new",
|
|
22
|
+
"notes",
|
|
23
|
+
"official",
|
|
24
|
+
"overview",
|
|
25
|
+
"page",
|
|
26
|
+
"plan",
|
|
27
|
+
"profile",
|
|
28
|
+
"project",
|
|
29
|
+
"recent",
|
|
30
|
+
"roadmap",
|
|
31
|
+
"the",
|
|
32
|
+
"this",
|
|
33
|
+
"with",
|
|
34
|
+
"www"
|
|
35
|
+
]);
|
|
36
|
+
function activityTimestamp(item) {
|
|
37
|
+
return item.modifiedAt ?? item.occurredAt ?? item.startsAt ?? 0;
|
|
38
|
+
}
|
|
39
|
+
function tokenize(value) {
|
|
40
|
+
const normalized = value.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLocaleLowerCase().replace(/\.[a-z0-9]{1,8}$/i, "").replace(/https?:\/\//g, " ");
|
|
41
|
+
const tokens = /* @__PURE__ */ new Set();
|
|
42
|
+
for (const token of normalized.match(/[a-z0-9][a-z0-9-]{2,}|[\p{Script=Han}]{2,}/gu) ?? []) {
|
|
43
|
+
if (/^[\p{Script=Han}]+$/u.test(token)) {
|
|
44
|
+
if (token.length <= 4) tokens.add(token);
|
|
45
|
+
else for (let index = 0; index < token.length - 1; index += 1) tokens.add(token.slice(index, index + 2));
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const clean = token.replace(/^-+|-+$/g, "");
|
|
49
|
+
if (clean.length >= 3 && !STOP_WORDS.has(clean) && !/^\d+$/.test(clean)) tokens.add(clean);
|
|
50
|
+
}
|
|
51
|
+
return tokens;
|
|
52
|
+
}
|
|
53
|
+
function itemTokens(item) {
|
|
54
|
+
let host = "";
|
|
55
|
+
if (item.resourceUri) try {
|
|
56
|
+
host = new URL(item.resourceUri).hostname.replace(/^www\./, "");
|
|
57
|
+
} catch {}
|
|
58
|
+
return tokenize([
|
|
59
|
+
item.title,
|
|
60
|
+
item.group ?? "",
|
|
61
|
+
host
|
|
62
|
+
].join(" "));
|
|
63
|
+
}
|
|
64
|
+
function overlap(left, right) {
|
|
65
|
+
let count = 0;
|
|
66
|
+
for (const token of left) if (right.has(token)) count += 1;
|
|
67
|
+
return count;
|
|
68
|
+
}
|
|
69
|
+
function related(left, right) {
|
|
70
|
+
const shared = overlap(left.tokens, right.tokens);
|
|
71
|
+
if (shared >= 2) return true;
|
|
72
|
+
const smallest = Math.min(left.tokens.size, right.tokens.size);
|
|
73
|
+
if (shared === 1 && smallest <= 2) return true;
|
|
74
|
+
return Boolean(shared === 1 && left.item.group && left.item.group === right.item.group);
|
|
75
|
+
}
|
|
76
|
+
function displayTitle(cluster) {
|
|
77
|
+
const frequency = /* @__PURE__ */ new Map();
|
|
78
|
+
for (const entry of cluster) for (const token of entry.tokens) frequency.set(token, (frequency.get(token) ?? 0) + 1);
|
|
79
|
+
const shared = [...frequency.entries()].filter(([, count]) => count >= 2).sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).slice(0, 3).map(([token]) => token);
|
|
80
|
+
if (shared.length && shared.every((token) => /^[\p{Script=Han}]+$/u.test(token))) return cluster[0].item.title.replace(/\.[a-z0-9]{1,8}$/i, "").slice(0, 80);
|
|
81
|
+
if (shared.length) return shared.map((token) => token.charAt(0).toUpperCase() + token.slice(1)).join(" ");
|
|
82
|
+
return cluster[0].item.title.replace(/\.[a-z0-9]{1,8}$/i, "").slice(0, 80);
|
|
83
|
+
}
|
|
84
|
+
function clusterActivityTopics(items, now = Date.now()) {
|
|
85
|
+
const prepared = items.filter((item) => item.type === "document" || item.type === "bookmark").map((item) => ({
|
|
86
|
+
item,
|
|
87
|
+
tokens: itemTokens(item),
|
|
88
|
+
timestamp: activityTimestamp(item)
|
|
89
|
+
})).filter((entry) => entry.tokens.size > 0);
|
|
90
|
+
const parent = prepared.map((_, index) => index);
|
|
91
|
+
const find = (index) => parent[index] === index ? index : parent[index] = find(parent[index]);
|
|
92
|
+
const union = (left, right) => {
|
|
93
|
+
const leftRoot = find(left);
|
|
94
|
+
const rightRoot = find(right);
|
|
95
|
+
if (leftRoot !== rightRoot) parent[rightRoot] = leftRoot;
|
|
96
|
+
};
|
|
97
|
+
for (let left = 0; left < prepared.length; left += 1) for (let right = left + 1; right < prepared.length; right += 1) if (related(prepared[left], prepared[right])) union(left, right);
|
|
98
|
+
const clusters = /* @__PURE__ */ new Map();
|
|
99
|
+
prepared.forEach((entry, index) => clusters.set(find(index), [...clusters.get(find(index)) ?? [], entry]));
|
|
100
|
+
return [...clusters.values()].flatMap((cluster) => {
|
|
101
|
+
if (cluster.length < 2) return [];
|
|
102
|
+
const sourceIds = [...new Set(cluster.map(({ item }) => item.sourceId))];
|
|
103
|
+
const types = new Set(cluster.map(({ item }) => item.type));
|
|
104
|
+
if (types.size === 1 && types.has("bookmark") && cluster.length < 3) return [];
|
|
105
|
+
const newestAt = Math.max(...cluster.map(({ timestamp }) => timestamp));
|
|
106
|
+
const ageDays = newestAt ? Math.max(0, (now - newestAt) / 864e5) : 90;
|
|
107
|
+
const recency = Math.max(0, 1 - ageDays / 90);
|
|
108
|
+
const confidence = Math.min(.92, .48 + Math.min(cluster.length, 5) * .06 + Math.min(sourceIds.length, 3) * .09 + recency * .08);
|
|
109
|
+
const title = displayTitle(cluster);
|
|
110
|
+
const fileCount = cluster.filter(({ item }) => item.type === "document").length;
|
|
111
|
+
const bookmarkCount = cluster.length - fileCount;
|
|
112
|
+
const evidenceRefs = cluster.map(({ item }) => item.evidenceRef);
|
|
113
|
+
const sharedTokens = /* @__PURE__ */ new Map();
|
|
114
|
+
for (const entry of cluster) for (const token of entry.tokens) sharedTokens.set(token, (sharedTokens.get(token) ?? 0) + 1);
|
|
115
|
+
const stableTopicTokens = [...sharedTokens.entries()].filter(([, count]) => count >= 2).map(([token]) => token).sort();
|
|
116
|
+
const key = createHash("sha256").update(stableTopicTokens.join("|")).digest("hex").slice(0, 16);
|
|
117
|
+
const signals = [fileCount ? `${fileCount} recent file${fileCount === 1 ? "" : "s"}` : "", bookmarkCount ? `${bookmarkCount} bookmark${bookmarkCount === 1 ? "" : "s"}` : ""].filter(Boolean).join(" and ");
|
|
118
|
+
return [{
|
|
119
|
+
canonicalKey: `activity-focus:${key}`,
|
|
120
|
+
title,
|
|
121
|
+
summary: `${signals} suggest sustained attention to ${title}.`,
|
|
122
|
+
horizon: ageDays <= 14 ? "current" : "ongoing",
|
|
123
|
+
confidence,
|
|
124
|
+
evidenceRefs,
|
|
125
|
+
sourceIds
|
|
126
|
+
}];
|
|
127
|
+
}).sort((left, right) => right.confidence - left.confidence).slice(0, 5);
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
export { clusterActivityTopics };
|
|
@@ -13,6 +13,32 @@ const COMMON = [
|
|
|
13
13
|
recommended: true,
|
|
14
14
|
sensitive: false
|
|
15
15
|
},
|
|
16
|
+
{
|
|
17
|
+
id: "local-recent-files",
|
|
18
|
+
category: "recent_documents",
|
|
19
|
+
platform: "all",
|
|
20
|
+
displayName: "Recent files",
|
|
21
|
+
description: "Read-only metadata for recent documents on Desktop, Documents, and Downloads.",
|
|
22
|
+
availability: "available",
|
|
23
|
+
permission: "not_requested",
|
|
24
|
+
defaultAccessMode: "once",
|
|
25
|
+
supportedAccessModes: ["once"],
|
|
26
|
+
recommended: true,
|
|
27
|
+
sensitive: true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "chromium-bookmarks",
|
|
31
|
+
category: "recent_documents",
|
|
32
|
+
platform: "all",
|
|
33
|
+
displayName: "Recent bookmarks",
|
|
34
|
+
description: "Titles, folders, and sanitized domains for recently added Chromium bookmarks.",
|
|
35
|
+
availability: "available",
|
|
36
|
+
permission: "not_requested",
|
|
37
|
+
defaultAccessMode: "once",
|
|
38
|
+
supportedAccessModes: ["once"],
|
|
39
|
+
recommended: true,
|
|
40
|
+
sensitive: true
|
|
41
|
+
},
|
|
16
42
|
{
|
|
17
43
|
id: "connector-github",
|
|
18
44
|
category: "code_activity",
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const LOCAL_UNDERSTANDING_SOURCE_IDS: readonly ["local-recent-files", "chromium-bookmarks", "apple-notes", "apple-calendar", "apple-reminders", "windows-recent-documents", "linux-recent-documents"];
|
|
2
|
+
export type LocalUnderstandingSourceId = typeof LOCAL_UNDERSTANDING_SOURCE_IDS[number];
|
|
3
|
+
export declare function isLocalUnderstandingSourceId(value: string): value is LocalUnderstandingSourceId;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/user-context/sources/local-source-contract.ts
|
|
2
|
+
const LOCAL_UNDERSTANDING_SOURCE_IDS = [
|
|
3
|
+
"local-recent-files",
|
|
4
|
+
"chromium-bookmarks",
|
|
5
|
+
"apple-notes",
|
|
6
|
+
"apple-calendar",
|
|
7
|
+
"apple-reminders",
|
|
8
|
+
"windows-recent-documents",
|
|
9
|
+
"linux-recent-documents"
|
|
10
|
+
];
|
|
11
|
+
function isLocalUnderstandingSourceId(value) {
|
|
12
|
+
return LOCAL_UNDERSTANDING_SOURCE_IDS.includes(value);
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { LOCAL_UNDERSTANDING_SOURCE_IDS, isLocalUnderstandingSourceId };
|
|
@@ -144,7 +144,13 @@ function upsertUserFocus(input) {
|
|
|
144
144
|
evidence_refs_json, source_run_id, created_at, updated_at
|
|
145
145
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
146
146
|
ON CONFLICT(canonical_key) DO UPDATE SET title = excluded.title, summary = excluded.summary,
|
|
147
|
-
horizon = excluded.horizon,
|
|
147
|
+
horizon = excluded.horizon,
|
|
148
|
+
status = CASE
|
|
149
|
+
WHEN user_focuses.status IN ('active', 'paused', 'completed', 'rejected') AND excluded.status = 'candidate'
|
|
150
|
+
THEN user_focuses.status
|
|
151
|
+
ELSE excluded.status
|
|
152
|
+
END,
|
|
153
|
+
confidence = excluded.confidence,
|
|
148
154
|
project_id = excluded.project_id, evidence_refs_json = excluded.evidence_refs_json,
|
|
149
155
|
source_run_id = excluded.source_run_id, updated_at = excluded.updated_at
|
|
150
156
|
`).run(id, input.canonicalKey, input.title, input.summary, input.horizon, input.status, input.confidence, input.projectId ?? null, JSON.stringify(input.evidenceRefs), input.sourceRunId ?? null, now, now));
|
|
@@ -36,10 +36,12 @@ export interface UnderstandingSourceGrant {
|
|
|
36
36
|
export interface UnderstandingSourceItem {
|
|
37
37
|
id: string;
|
|
38
38
|
sourceId: string;
|
|
39
|
-
type: 'document' | 'calendar_event' | 'task' | 'note' | 'mail' | 'message' | 'code_activity';
|
|
39
|
+
type: 'document' | 'calendar_event' | 'task' | 'note' | 'mail' | 'message' | 'code_activity' | 'bookmark';
|
|
40
40
|
title: string;
|
|
41
41
|
text?: string;
|
|
42
42
|
group?: string;
|
|
43
|
+
/** Sanitized locator. It must not contain credentials, query parameters, or fragments. */
|
|
44
|
+
resourceUri?: string;
|
|
43
45
|
occurredAt?: number;
|
|
44
46
|
modifiedAt?: number;
|
|
45
47
|
startsAt?: number;
|
|
@@ -52,6 +54,10 @@ export interface UnderstandingSourceCollectionResult {
|
|
|
52
54
|
sourceId: string;
|
|
53
55
|
status: 'completed' | 'denied' | 'failed';
|
|
54
56
|
items: UnderstandingSourceItem[];
|
|
57
|
+
checkpoint?: {
|
|
58
|
+
fingerprint: string;
|
|
59
|
+
collectedAt: number;
|
|
60
|
+
};
|
|
55
61
|
error?: string;
|
|
56
62
|
}
|
|
57
63
|
export interface UnderstandingSourceRun {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { UnderstandingKind, UserContextScope, UserUnderstanding } from './domain.js';
|
|
2
|
+
export declare function canonicalUnderstandingKey(kind: UnderstandingKind, statement: string): string;
|
|
3
|
+
export declare function isSameUserContextScope(left: UserContextScope, right: UserContextScope): boolean;
|
|
4
|
+
export declare function findDuplicateUnderstanding(understandings: UserUnderstanding[], input: {
|
|
5
|
+
kind: UnderstandingKind;
|
|
6
|
+
statement: string;
|
|
7
|
+
canonicalKey: string;
|
|
8
|
+
scope: UserContextScope;
|
|
9
|
+
excludeId?: string;
|
|
10
|
+
}): UserUnderstanding | undefined;
|
|
11
|
+
export declare function findContradictoryUnderstanding(understandings: UserUnderstanding[], input: {
|
|
12
|
+
kind: UnderstandingKind;
|
|
13
|
+
statement: string;
|
|
14
|
+
scope: UserContextScope;
|
|
15
|
+
}): UserUnderstanding | undefined;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { isNearDuplicateUnderstanding } from "./understandingQuality.js";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
//#region src/user-context/understanding.ts
|
|
4
|
+
function canonicalUnderstandingKey(kind, statement) {
|
|
5
|
+
const normalized = statement.normalize("NFKC").toLocaleLowerCase().replace(/[^\p{L}\p{N}]+/gu, " ").trim();
|
|
6
|
+
return `${kind}:${createHash("sha256").update(normalized).digest("hex").slice(0, 20)}`;
|
|
7
|
+
}
|
|
8
|
+
function isSameUserContextScope(left, right) {
|
|
9
|
+
return left.type === right.type && left.id === right.id;
|
|
10
|
+
}
|
|
11
|
+
const NEGATION = /\b(?:do not|don't|never|avoid|without)\b|(?:不要|不用|无需|从不|避免|禁止)/i;
|
|
12
|
+
function withoutNegation(statement) {
|
|
13
|
+
return statement.replace(NEGATION, "").replace(/\s+/g, " ").trim();
|
|
14
|
+
}
|
|
15
|
+
function findDuplicateUnderstanding(understandings, input) {
|
|
16
|
+
const inputIsNegative = NEGATION.test(input.statement);
|
|
17
|
+
return understandings.find((item) => item.id !== input.excludeId && item.kind === input.kind && item.status !== "archived" && item.status !== "rejected" && isSameUserContextScope(item.scope, input.scope) && (item.canonicalKey === input.canonicalKey || NEGATION.test(item.statement) === inputIsNegative && isNearDuplicateUnderstanding(item.statement, input.statement)));
|
|
18
|
+
}
|
|
19
|
+
function findContradictoryUnderstanding(understandings, input) {
|
|
20
|
+
const inputIsNegative = NEGATION.test(input.statement);
|
|
21
|
+
return understandings.find((item) => item.kind === input.kind && item.status === "active" && isSameUserContextScope(item.scope, input.scope) && NEGATION.test(item.statement) !== inputIsNegative && isNearDuplicateUnderstanding(withoutNegation(item.statement), withoutNegation(input.statement)));
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { canonicalUnderstandingKey, findContradictoryUnderstanding, findDuplicateUnderstanding, isSameUserContextScope };
|
|
@@ -2,8 +2,8 @@ import { dirname, join } from "node:path";
|
|
|
2
2
|
import { createReadStream, createWriteStream } from "node:fs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { mkdir, rm, stat } from "node:fs/promises";
|
|
5
|
-
import { Readable } from "node:stream";
|
|
6
5
|
import { pipeline } from "node:stream/promises";
|
|
6
|
+
import { Readable } from "node:stream";
|
|
7
7
|
//#region src/voice/local/model-files.ts
|
|
8
8
|
function resolveModelFileUrl(remoteHost, model, file) {
|
|
9
9
|
const base = remoteHost.endsWith("/") ? remoteHost : `${remoteHost}/`;
|
|
@@ -12,24 +12,10 @@ function options(values, names) {
|
|
|
12
12
|
name: names?.[id] ?? titleCase(id)
|
|
13
13
|
}));
|
|
14
14
|
}
|
|
15
|
-
const alibabaSttModels = [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
id: "paraformer-v1",
|
|
22
|
-
name: "Paraformer v1"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: "paraformer-8k-v1",
|
|
26
|
-
name: "Paraformer 8k v1 (Phone)"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: "paraformer-mtl-v1",
|
|
30
|
-
name: "Paraformer MTL v1 (Multilingual)"
|
|
31
|
-
}
|
|
32
|
-
];
|
|
15
|
+
const alibabaSttModels = [{
|
|
16
|
+
id: "qwen-audio-3.0-asr-flash",
|
|
17
|
+
name: "Qwen Audio 3.0 ASR Flash"
|
|
18
|
+
}];
|
|
33
19
|
const localSttModels = [
|
|
34
20
|
{
|
|
35
21
|
id: "sensevoice-small",
|
|
@@ -179,12 +165,33 @@ const builtinVoiceProviderMetadata = [
|
|
|
179
165
|
configPath: "tools.media.audio.providers.xopc-local"
|
|
180
166
|
}
|
|
181
167
|
},
|
|
168
|
+
{
|
|
169
|
+
id: "xopc-cloud",
|
|
170
|
+
capability: "stt",
|
|
171
|
+
displayName: "XOPC Cloud",
|
|
172
|
+
description: "OAuth-based speech recognition using models published by XOPC Cloud.",
|
|
173
|
+
models: [],
|
|
174
|
+
fields: [{
|
|
175
|
+
key: "model",
|
|
176
|
+
label: "Public model ID",
|
|
177
|
+
type: "string"
|
|
178
|
+
}, {
|
|
179
|
+
key: "language",
|
|
180
|
+
label: "Language hint",
|
|
181
|
+
type: "string",
|
|
182
|
+
placeholder: "zh"
|
|
183
|
+
}],
|
|
184
|
+
diagnostics: {
|
|
185
|
+
requiresApiKey: false,
|
|
186
|
+
configPath: "tools.media.audio.providers.xopc-cloud"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
182
189
|
{
|
|
183
190
|
id: "alibaba",
|
|
184
191
|
capability: "stt",
|
|
185
192
|
displayName: "Alibaba DashScope",
|
|
186
|
-
description: "DashScope
|
|
187
|
-
aliases: ["dashscope"
|
|
193
|
+
description: "DashScope Qwen Audio speech-to-text for Chinese and multilingual recognition.",
|
|
194
|
+
aliases: ["dashscope"],
|
|
188
195
|
models: alibabaSttModels,
|
|
189
196
|
fields: [
|
|
190
197
|
{
|
|
@@ -200,7 +207,7 @@ const builtinVoiceProviderMetadata = [
|
|
|
200
207
|
label: "Model",
|
|
201
208
|
type: "select",
|
|
202
209
|
options: alibabaSttModels,
|
|
203
|
-
defaultValue: "
|
|
210
|
+
defaultValue: "qwen-audio-3.0-asr-flash"
|
|
204
211
|
},
|
|
205
212
|
{
|
|
206
213
|
key: "language",
|
|
@@ -218,12 +225,22 @@ const builtinVoiceProviderMetadata = [
|
|
|
218
225
|
{
|
|
219
226
|
id: "openai",
|
|
220
227
|
capability: "stt",
|
|
221
|
-
displayName: "OpenAI
|
|
222
|
-
description: "OpenAI
|
|
223
|
-
models: [
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
228
|
+
displayName: "OpenAI",
|
|
229
|
+
description: "OpenAI transcription endpoint.",
|
|
230
|
+
models: [
|
|
231
|
+
{
|
|
232
|
+
id: "gpt-transcribe",
|
|
233
|
+
name: "GPT Transcribe"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
id: "gpt-4o-transcribe",
|
|
237
|
+
name: "GPT-4o Transcribe"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
id: "gpt-4o-mini-transcribe",
|
|
241
|
+
name: "GPT-4o Mini Transcribe"
|
|
242
|
+
}
|
|
243
|
+
],
|
|
227
244
|
fields: [
|
|
228
245
|
{
|
|
229
246
|
key: "apiKey",
|
|
@@ -237,11 +254,21 @@ const builtinVoiceProviderMetadata = [
|
|
|
237
254
|
key: "model",
|
|
238
255
|
label: "Model",
|
|
239
256
|
type: "select",
|
|
240
|
-
options: [
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
257
|
+
options: [
|
|
258
|
+
{
|
|
259
|
+
id: "gpt-transcribe",
|
|
260
|
+
name: "GPT Transcribe"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
id: "gpt-4o-transcribe",
|
|
264
|
+
name: "GPT-4o Transcribe"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
id: "gpt-4o-mini-transcribe",
|
|
268
|
+
name: "GPT-4o Mini Transcribe"
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
defaultValue: "gpt-transcribe"
|
|
245
272
|
},
|
|
246
273
|
{
|
|
247
274
|
key: "baseUrl",
|
|
@@ -267,6 +294,46 @@ const builtinVoiceProviderMetadata = [
|
|
|
267
294
|
configPath: "tools.media.audio.providers.openai"
|
|
268
295
|
}
|
|
269
296
|
},
|
|
297
|
+
{
|
|
298
|
+
id: "xopc-cloud",
|
|
299
|
+
capability: "tts",
|
|
300
|
+
displayName: "XOPC Cloud",
|
|
301
|
+
description: "OAuth-based speech synthesis using models and voices published by XOPC Cloud.",
|
|
302
|
+
models: [],
|
|
303
|
+
voices: [],
|
|
304
|
+
fields: [
|
|
305
|
+
{
|
|
306
|
+
key: "model",
|
|
307
|
+
label: "Public model ID",
|
|
308
|
+
type: "string"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
key: "voice",
|
|
312
|
+
label: "Voice ID",
|
|
313
|
+
type: "string"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
key: "speed",
|
|
317
|
+
label: "Speed",
|
|
318
|
+
type: "number",
|
|
319
|
+
defaultValue: 1,
|
|
320
|
+
min: .25,
|
|
321
|
+
max: 4,
|
|
322
|
+
step: .05,
|
|
323
|
+
description: "Speech speed from 0.25× to 4×."
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
key: "instructions",
|
|
327
|
+
label: "Speaking instructions",
|
|
328
|
+
type: "textarea",
|
|
329
|
+
placeholder: "Speak warmly and clearly."
|
|
330
|
+
}
|
|
331
|
+
],
|
|
332
|
+
diagnostics: {
|
|
333
|
+
requiresApiKey: false,
|
|
334
|
+
configPath: "messages.tts.providers.xopc-cloud"
|
|
335
|
+
}
|
|
336
|
+
},
|
|
270
337
|
{
|
|
271
338
|
id: "openai",
|
|
272
339
|
capability: "tts",
|
|
@@ -15,6 +15,9 @@ export interface VoiceConfigFieldMetadata {
|
|
|
15
15
|
description?: string;
|
|
16
16
|
options?: VoiceOptionMetadata[];
|
|
17
17
|
defaultValue?: string | number | boolean;
|
|
18
|
+
min?: number;
|
|
19
|
+
max?: number;
|
|
20
|
+
step?: number;
|
|
18
21
|
}
|
|
19
22
|
export interface VoiceProviderDiagnosticMetadata {
|
|
20
23
|
requiresApiKey: boolean;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { getVoiceProviderMetadata } from "../metadata/registry.js";
|
|
2
|
+
import "../metadata/index.js";
|
|
1
3
|
//#region src/voice/stt/availability.ts
|
|
2
4
|
function providerHasConfig(config, providerId) {
|
|
3
5
|
const provider = config.providers?.[providerId];
|
|
4
6
|
if (provider && Object.keys(provider).length > 0) return true;
|
|
5
|
-
|
|
7
|
+
if ([...config.models ?? [], ...config.sharedModels ?? []].some((entry) => entry.provider === providerId && entry.capabilities?.includes("audio"))) return true;
|
|
8
|
+
return getVoiceProviderMetadata("stt", providerId)?.diagnostics.requiresApiKey === false;
|
|
6
9
|
}
|
|
7
10
|
/**
|
|
8
11
|
* Lightweight availability check for channel routing. Do not import the STT
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
* Reads `tools.media.audio.providers.<id>` only — there is no legacy flat-key form.
|
|
5
5
|
*/
|
|
6
6
|
import type { STTConfig } from './types.js';
|
|
7
|
-
/** Built-in env fallbacks when config slice has no apiKey. */
|
|
8
|
-
export declare const STT_LEGACY_ENV_KEYS: Record<string, string>;
|
|
9
7
|
/** Collect provider-id → raw config entries from the `providers` map. */
|
|
10
8
|
export declare function collectSttProviderConfigEntries(config: Partial<STTConfig> | Record<string, unknown> | undefined): Record<string, Record<string, unknown>>;
|
|
11
9
|
/** Resolve the raw config slice for one provider id. */
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
//#region src/voice/stt/config-slice.ts
|
|
2
|
-
/** Built-in env fallbacks when config slice has no apiKey. */
|
|
3
|
-
const STT_LEGACY_ENV_KEYS = {
|
|
4
|
-
openai: "OPENAI_API_KEY",
|
|
5
|
-
alibaba: "DASHSCOPE_API_KEY"
|
|
6
|
-
};
|
|
7
2
|
function asRecord(value) {
|
|
8
3
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
9
4
|
}
|
|
@@ -50,4 +45,4 @@ function readSttProviderFields(slice, entryOverride) {
|
|
|
50
45
|
};
|
|
51
46
|
}
|
|
52
47
|
//#endregion
|
|
53
|
-
export {
|
|
48
|
+
export { collectSttProviderConfigEntries, readSttProviderFields, resolveSttProviderConfigSlice };
|
|
@@ -3,12 +3,12 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
import { getMediaUnderstandingProvider, listMediaUnderstandingProviders } from "../../media-understanding/registry.js";
|
|
4
4
|
import "./providers/index.js";
|
|
5
5
|
import { resolveModelEntries } from "../../media-understanding/resolve-entries.js";
|
|
6
|
-
import {
|
|
6
|
+
import { readSttProviderFields, resolveSttProviderConfigSlice } from "./config-slice.js";
|
|
7
7
|
//#region src/voice/stt/factory.ts
|
|
8
8
|
init_logger();
|
|
9
9
|
const log = createLogger("STT:Factory");
|
|
10
10
|
function resolveApiKey(providerId, fields, envKey) {
|
|
11
|
-
return fields.apiKey ?? (envKey ? process.env[envKey] : void 0)
|
|
11
|
+
return fields.apiKey ?? (envKey ? process.env[envKey] : void 0);
|
|
12
12
|
}
|
|
13
13
|
/** Resolve a single STT provider config slice → runner-shaped resolved config, or null when unavailable. */
|
|
14
14
|
function resolveSTTProviderConfig(providerId, config, entry) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* STT (Speech-to-Text) Module
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `isSTTAvailable()` API surface is preserved for channel adapters.
|
|
4
|
+
* Providers implement MediaUnderstandingProvider; orchestration goes through
|
|
5
|
+
* the media-understanding runner. Channel adapters use the public helpers below.
|
|
7
6
|
*/
|
|
8
7
|
import './providers/index.js';
|
|
9
8
|
import type { STTConfig, STTOptions, STTResult } from './types.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { listMediaUnderstandingProviders } from "../../media-understanding/registry.js";
|
|
2
2
|
import { resolveSTTProviderConfig } from "./factory.js";
|
|
3
|
-
import { mergeSttConfigFromAppConfig } from "./config.js";
|
|
4
3
|
import { getVoiceProviderMetadata } from "../metadata/registry.js";
|
|
5
4
|
import "../metadata/index.js";
|
|
5
|
+
import { mergeSttConfigFromAppConfig } from "./config.js";
|
|
6
6
|
//#region src/voice/stt/list-providers.ts
|
|
7
7
|
function fallbackMetadata(providerId, aliases) {
|
|
8
8
|
return {
|
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Alibaba DashScope Paraformer STT — implements MediaUnderstandingProvider.transcribeAudio.
|
|
3
|
-
*
|
|
4
|
-
* DashScope's async API is a 4-step dance:
|
|
5
|
-
* 1. POST /api/v1/services/audio/asr/transcription with `X-DashScope-Async: enable`
|
|
6
|
-
* and `input.file_urls = [data:audio/ogg;base64,...]` → returns task_id
|
|
7
|
-
* 2. Poll GET /api/v1/tasks/{task_id} until task_status === 'SUCCEEDED'
|
|
8
|
-
* 3. The success result contains `transcription_url` pointing at a JSON document
|
|
9
|
-
* 4. Fetch that JSON to extract the actual `transcripts[].text`
|
|
10
|
-
*
|
|
11
|
-
* All HTTP calls go through `fetchWithTimeoutGuarded` so the SSRF guard catches
|
|
12
|
-
* malicious config injection. The transcription_url is a public OSS URL
|
|
13
|
-
* (CDN-hosted); we keep `allowPrivateNetwork: false` so a malicious tenant
|
|
14
|
-
* cannot redirect to an internal address.
|
|
15
|
-
*
|
|
16
|
-
* Polling caps at 60s by default (60 * 1s). The runner's `timeoutMs` controls
|
|
17
|
-
* HTTP timeouts on each individual submit/poll/fetch call, not the overall
|
|
18
|
-
* poll loop ceiling.
|
|
19
|
-
*/
|
|
20
1
|
import type { MediaUnderstandingProvider } from '../../../media-understanding/types.js';
|
|
21
2
|
export declare const alibabaTranscriptionProvider: MediaUnderstandingProvider;
|