@xopcai/xopc 0.0.215 → 0.0.218
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/README.zh-CN.md +4 -4
- 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-k-mNF_Dq.js → activity-store-DF2dYXG1.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-0Am1Zsai.js → agent-avatar-dicebear-Dw9rF5o1.js} +1 -1
- package/dist/gateway/static/root/assets/agents-Dj86bHkl.js +68 -0
- package/dist/gateway/static/root/assets/{api-BjN2udFQ.js → api-_H0Bam-t.js} +1 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-D-M6GN-8.js +1 -0
- package/dist/gateway/static/root/assets/{appearance-settings-CoB0hGf9.js → appearance-settings-XDhmzdIc.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-sfO835uz.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BczSorEI.js → archive-plugin-DZCOhXch.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-D1SDGB0m.js → attachment-load-Bjb0FH2B.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BTgWPOP6.js → automations-page-D4N3ZDhu.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-PptuZgoo.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-6tFOQHNC.js → binary-plugins-uXPt0s47.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Cm7txOU2.js → block-editor-gukkIEro.js} +47 -47
- package/dist/gateway/static/root/assets/browser-settings-page-BoCmzMFV.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-Coz8pWzP.js → browser-workflow-inputs-DAhdS-XZ.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-DJGD7LOd.js → browser-workflows-page-LKjYzXS_.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DhkJsU8Z.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-BF3G84qe.js → capability-presets-api-BBUkH833.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-v85bB-Lt.js → capability-presets-settings-panel-Dm7T61fE.js} +2 -2
- package/dist/gateway/static/root/assets/{channel-recipient-api-8Uz95P40.js → channel-recipient-api-E5mo8M3a.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-dG6UFVqt.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-DgJxfNyK.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DioZkaaj.js → chat-terminal-dock-CT5yoSMD.js} +2 -2
- package/dist/gateway/static/root/assets/circle-check-C23XjkUj.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-BC6Ft9SU.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-BTNvqkwt.js → cron-expression-BGNuaqvI.js} +1 -1
- package/dist/gateway/static/root/assets/date-picker-k7mkklMU.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-PlfH-GH8.js → dependency-picker-DZVSgLXH.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-C3nO_ocM.js → desktop-pet-p9EZyGzV.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-Bw4cCFzI.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BIqsbDII.js → directory-picker-path-field-Cbst7IXR.js} +1 -1
- package/dist/gateway/static/root/assets/electron-env-DH5wF8X8.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-C1o3Jn7L.js → extension-debug-page-Cd4BMKm_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Drjulq3q.js → extension-page-CzEGCkOa.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-XsMPJFYn.js → extension-settings-page-C1PAKSy2.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-D9xHVpb9.js → gateway-config-api-Bch9vO6t.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-l2w9ecXl.js → gateway-config-swr-DNrttVr2.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BaVojQd4.js → gateway-settings-DkDxZFGG.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-XUzMGmLZ.js → gateway-startup-retry-B1vD3vRb.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-dQH2-fGh.js → heartbeat-settings-DXNMxy5b.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-CMqS6l_m.js → home-page-CYcpVFNT.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-CDoOrDMq.js → image-generation-api-BTR0Wk_k.js} +1 -1
- package/dist/gateway/static/root/assets/index-Dgb1R07E.css +2 -0
- package/dist/gateway/static/root/assets/index-DlOYwVFK.js +108 -0
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-CYlS4RGA.js +1 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-BFrgPwGE.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-8w0FZ7TD.js → local-apps-page-CNppYVew.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-BIOMAhmR.js → locale-store-gf9Bg2gb.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-FiVowm1N.js → logs-page-CPweLw3k.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-DdYouU4o.js → management-settings-IYk9xLgt.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-D_kDeT-f.js → markdown-split-D8e6pRMH.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BMDQYc6E.js → markdown-view-D0fiJjBQ.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BDgbIz9p.js → media-plugins-CCq6TtEf.js} +1 -1
- package/dist/gateway/static/root/assets/messages-B9WQcZ1V.js +3 -0
- package/dist/gateway/static/root/assets/{notes-api-lKPk0Voa.js → notes-api-BBtWnlUU.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-Bw2MQ4M8.js → notes-page-BKe1xa3U.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-wieRAd1y.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-B7dlng5v.js → page-tabs-Bsluqyfb.js} +1 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-BrpTWv44.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page--m0DziFF.js → product-open-page-DXe5iWI6.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-Cww6V7HJ.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-D0LKhCCw.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BFwvRxBn.js → registry-api-xj5gOva_.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Sf4Pde6Z.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-6QadzIxb.js → runtime-tools-settings-panel-BJTvmBCA.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-ChJycivC.js → schema-form-DvGBa_7R.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-S5gvgfu5.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-B3XvdEy8.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-DRazyNED.js → settings-form-section-CiGFtdD8.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-CdEdSb5L.js → settings-loading-skeleton-sbef7GTm.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BL0rlziB.js → settings-page-BNGxxXZe.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CGU_Mxjr.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-CKK5swgV.js → share-preview-page-C1523ij3.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-k0UQ8WxO.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DQ1GvL1w.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-OuHd9GcN.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-4_15-T3G.js → skills-page.utils-Ditgz7Vo.js} +1 -1
- package/dist/gateway/static/root/assets/system-settings-panel-CERqCsz2.js +1 -0
- package/dist/gateway/static/root/assets/tab-completion-input-D64VNmiA.js +1 -0
- package/dist/gateway/static/root/assets/tab-completion-input.utils-BP3NH_du.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-BnRNL2sn.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-BrbF9cgL.js → theme-store-DgSjes3O.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-CzB0r79r.js → typed-models-lib-abEJNkCO.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-D_fuJIDo.js → use-autosave-Bp_qFZkl.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-Cnkaiky5.js +1 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-hbzDfErG.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CSgiFeW2.js → work-discovery-overlay-DZVib-04.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DstMFHA8.js → workflow-run-setup-panel-C2RKay1p.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-B_VlcKiK.js +5 -0
- package/dist/gateway/static/root/index.html +13 -11
- package/dist/package.js +1 -1
- package/dist/packages/realtime-client/src/index.js +17 -2
- package/dist/src/agent/agent-manager.js +4 -4
- package/dist/src/agent/background-review/prompts.d.ts +1 -1
- package/dist/src/agent/background-review/prompts.js +4 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/memory/create-memory-manager.js +1 -1
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/connectors/connected-source-ingestion.js +21 -4
- package/dist/src/connectors/connected-source-normalizers.js +51 -4
- package/dist/src/connectors/connected-source-understanding.d.ts +19 -0
- package/dist/src/connectors/connected-source-understanding.js +132 -0
- package/dist/src/connectors/content-enrichment.d.ts +1 -0
- package/dist/src/connectors/content-enrichment.js +11 -7
- package/dist/src/connectors/learning-coordinator.js +55 -4
- package/dist/src/connectors/learning-recipes.js +2 -2
- package/dist/src/document-understanding/extract.d.ts +1 -1
- package/dist/src/document-understanding/extract.js +54 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/lib/static-ui.js +1 -0
- package/dist/src/gateway/hono/oauth-async.d.ts +4 -0
- package/dist/src/gateway/hono/oauth-async.js +24 -1
- package/dist/src/gateway/hono/oauth.js +14 -1
- package/dist/src/gateway/hono/routes/config.js +3 -0
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/public-gateway.js +16 -0
- package/dist/src/gateway/hono/routes/understanding-sources.js +25 -7
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/rate-limit/buckets.d.ts +1 -1
- package/dist/src/gateway/rate-limit/buckets.js +2 -2
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service.js +10 -12
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +41 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.js +142 -0
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/user-context/sources/catalog.js +9 -2
- package/dist/src/user-context/sources/local-source-contract.d.ts +1 -1
- package/dist/src/user-context/sources/local-source-contract.js +1 -0
- package/dist/src/user-context/understanding-writing.d.ts +1 -0
- package/dist/src/user-context/understanding-writing.js +4 -0
- package/dist/src/voice/language-profile.d.ts +0 -2
- package/dist/src/voice/language-profile.js +2 -30
- package/dist/src/voice/local/provider-switch.d.ts +4 -0
- package/dist/src/voice/local/provider-switch.js +36 -0
- package/dist/src/work-discovery/analyzer.d.ts +6 -0
- package/dist/src/work-discovery/analyzer.js +181 -57
- package/dist/src/work-discovery/index.js +1 -1
- package/dist/src/work-discovery/probe.js +20 -0
- package/dist/src/work-discovery/service.d.ts +9 -0
- package/dist/src/work-discovery/service.js +18 -6
- package/dist/src/work-discovery/types.d.ts +5 -0
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/agents-BhWSwa4h.js +0 -68
- package/dist/gateway/static/root/assets/app-management-settings-panel-BCHmLiA7.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-DloObQ8z.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-CbOSi-Uh.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-UhIguuT0.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BPe2vu-c.js +0 -7
- package/dist/gateway/static/root/assets/channels-settings-Dj3wNboO.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-NfU9X-P5.js +0 -1
- package/dist/gateway/static/root/assets/connectors-api-DHBX8LgY.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-B8Z692Fe.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-wMj_1toq.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-BZSODwlA.js +0 -1
- package/dist/gateway/static/root/assets/index-BDwfvp1w.css +0 -2
- package/dist/gateway/static/root/assets/index-CjbvsIPf.js +0 -108
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-so_XFXVC.js +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Dp1zGjrI.js +0 -2
- package/dist/gateway/static/root/assets/messages-CbbZKEfO.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-DpMDd8Sm.js +0 -4
- package/dist/gateway/static/root/assets/preview-open-alternatives-Bzi2ia11.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-D8AglzWN.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-D0X6kb12.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-MxuXgfuY.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-DGZbtPXx.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DLg_9-bb.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-D-nQiA7z.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-IDLLIYA5.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-C_ivBD5y.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-t0eKREk9.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-CERY3Drp.js +0 -1
- package/dist/gateway/static/root/assets/tab-completion-input-B-VsxKhC.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-CS9BX5BO.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-BvBzRI8P.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-ztq8iQAp.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-XD3Pmm1p.js +0 -5
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { getModelCatalogStore, init_model_catalog_store } from "../providers/model-catalog-store.js";
|
|
2
|
+
import { compareCatalogModels } from "../providers/model-catalog-ranking.js";
|
|
3
|
+
import { ensureGlobalDefaultsConfig, prepareUpdateGlobalDefaults } from "./global-defaults-admin.js";
|
|
4
|
+
//#region src/gateway/xopc-cloud-capability-setup.ts
|
|
5
|
+
init_model_catalog_store();
|
|
6
|
+
function supportsCapability(model, capability) {
|
|
7
|
+
if (model.availability !== "available") return false;
|
|
8
|
+
if (capability === "vision") return model.kind === "language" && model.input.includes("image");
|
|
9
|
+
if (capability === "image-generation") return model.kind === "image" && model.operations.includes("images.generate");
|
|
10
|
+
if (capability === "stt") return model.kind === "stt" && model.operations.includes("audio.transcription");
|
|
11
|
+
return model.kind === "tts" && model.operations.includes("audio.speech") && Boolean(model.tts?.defaultVoice);
|
|
12
|
+
}
|
|
13
|
+
function recommendedModel(source, capability) {
|
|
14
|
+
const recommendation = source.recommended?.[capability];
|
|
15
|
+
return source.models.filter((model) => supportsCapability(model, capability)).sort((left, right) => compareCatalogModels(left, right, recommendation))[0];
|
|
16
|
+
}
|
|
17
|
+
function selectXopcCloudCapabilities(source) {
|
|
18
|
+
const vision = recommendedModel(source, "vision");
|
|
19
|
+
const imageGeneration = recommendedModel(source, "image-generation");
|
|
20
|
+
const stt = recommendedModel(source, "stt");
|
|
21
|
+
const tts = recommendedModel(source, "tts");
|
|
22
|
+
const missing = [];
|
|
23
|
+
if (!vision) missing.push("vision");
|
|
24
|
+
if (!imageGeneration) missing.push("image-generation");
|
|
25
|
+
if (!stt) missing.push("stt");
|
|
26
|
+
if (!tts) missing.push("tts");
|
|
27
|
+
if (!vision || !imageGeneration || !stt || !tts || !tts.tts?.defaultVoice) return { missing };
|
|
28
|
+
return {
|
|
29
|
+
missing,
|
|
30
|
+
selection: {
|
|
31
|
+
vision: vision.id,
|
|
32
|
+
imageGeneration: imageGeneration.id,
|
|
33
|
+
stt: stt.id,
|
|
34
|
+
tts: tts.id,
|
|
35
|
+
ttsVoice: tts.tts.defaultVoice
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Build one atomic config update for every managed XOPC Cloud media capability. */
|
|
40
|
+
function prepareXopcCloudCapabilitySetup(config, source) {
|
|
41
|
+
const selected = selectXopcCloudCapabilities(source);
|
|
42
|
+
if (!selected.selection) return {
|
|
43
|
+
ok: false,
|
|
44
|
+
error: `XOPC Cloud is missing required capabilities: ${selected.missing.join(", ")}`,
|
|
45
|
+
missing: selected.missing
|
|
46
|
+
};
|
|
47
|
+
const selection = selected.selection;
|
|
48
|
+
const normalized = ensureGlobalDefaultsConfig(config);
|
|
49
|
+
const presetId = normalized.agents.defaultPreset;
|
|
50
|
+
const currentModels = normalized.agents.capabilityPresets[presetId]?.models;
|
|
51
|
+
const defaultsUpdate = prepareUpdateGlobalDefaults(normalized, { models: {
|
|
52
|
+
...currentModels,
|
|
53
|
+
imageModel: {
|
|
54
|
+
...currentModels?.imageModel,
|
|
55
|
+
primary: `xopc-cloud/${selection.vision}`
|
|
56
|
+
},
|
|
57
|
+
imageGenerationModel: {
|
|
58
|
+
...currentModels?.imageGenerationModel,
|
|
59
|
+
primary: `xopc-cloud/${selection.imageGeneration}`
|
|
60
|
+
}
|
|
61
|
+
} });
|
|
62
|
+
if (defaultsUpdate.ok === false) return {
|
|
63
|
+
ok: false,
|
|
64
|
+
error: defaultsUpdate.error,
|
|
65
|
+
missing: []
|
|
66
|
+
};
|
|
67
|
+
const withDefaults = defaultsUpdate.data.nextConfig;
|
|
68
|
+
const currentStt = withDefaults.tools?.media?.audio;
|
|
69
|
+
const currentTts = withDefaults.messages?.tts;
|
|
70
|
+
return {
|
|
71
|
+
ok: true,
|
|
72
|
+
selection,
|
|
73
|
+
config: {
|
|
74
|
+
...withDefaults,
|
|
75
|
+
tools: {
|
|
76
|
+
...withDefaults.tools,
|
|
77
|
+
media: {
|
|
78
|
+
...withDefaults.tools?.media,
|
|
79
|
+
audio: {
|
|
80
|
+
...currentStt,
|
|
81
|
+
enabled: true,
|
|
82
|
+
provider: "xopc-cloud",
|
|
83
|
+
fallback: {
|
|
84
|
+
enabled: false,
|
|
85
|
+
order: ["xopc-cloud"]
|
|
86
|
+
},
|
|
87
|
+
providers: {
|
|
88
|
+
...currentStt?.providers ?? {},
|
|
89
|
+
"xopc-cloud": {
|
|
90
|
+
...currentStt?.providers?.["xopc-cloud"] ?? {},
|
|
91
|
+
model: selection.stt
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
messages: {
|
|
98
|
+
...withDefaults.messages,
|
|
99
|
+
tts: {
|
|
100
|
+
...currentTts,
|
|
101
|
+
enabled: true,
|
|
102
|
+
provider: "xopc-cloud",
|
|
103
|
+
trigger: currentTts?.trigger ?? "off",
|
|
104
|
+
maxTextLength: currentTts?.maxTextLength ?? 512,
|
|
105
|
+
timeoutMs: currentTts?.timeoutMs ?? 6e4,
|
|
106
|
+
providers: {
|
|
107
|
+
...currentTts?.providers ?? {},
|
|
108
|
+
"xopc-cloud": {
|
|
109
|
+
...currentTts?.providers?.["xopc-cloud"] ?? {},
|
|
110
|
+
model: selection.tts,
|
|
111
|
+
voice: selection.ttsVoice
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
async function applyXopcCloudCapabilitySetup(service) {
|
|
120
|
+
const source = getModelCatalogStore().getSource("xopc-cloud");
|
|
121
|
+
if (!source) return {
|
|
122
|
+
configured: false,
|
|
123
|
+
error: "XOPC Cloud model catalog is unavailable"
|
|
124
|
+
};
|
|
125
|
+
const prepared = prepareXopcCloudCapabilitySetup(service.currentConfig, source);
|
|
126
|
+
if (prepared.ok === false) return {
|
|
127
|
+
configured: false,
|
|
128
|
+
error: prepared.error,
|
|
129
|
+
missing: prepared.missing
|
|
130
|
+
};
|
|
131
|
+
const saved = await service.saveConfig(prepared.config);
|
|
132
|
+
if (!saved.saved) return {
|
|
133
|
+
configured: false,
|
|
134
|
+
error: saved.error ?? "Failed to save XOPC Cloud capability configuration"
|
|
135
|
+
};
|
|
136
|
+
return {
|
|
137
|
+
configured: true,
|
|
138
|
+
selection: prepared.selection
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
//#endregion
|
|
142
|
+
export { applyXopcCloudCapabilitySetup, prepareXopcCloudCapabilitySetup, selectXopcCloudCapabilities };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, shouldSilence, stripHeartbeatToken } from "./tokens.js";
|
|
2
|
-
import { appendCronEventLines } from "./event-prompt.js";
|
|
3
2
|
import { isWithinActiveHours } from "./active-hours.js";
|
|
4
3
|
import { isHeartbeatContentEmpty } from "./content-check.js";
|
|
4
|
+
import { appendCronEventLines } from "./event-prompt.js";
|
|
5
5
|
import { createHeartbeatWake } from "./wake.js";
|
|
6
6
|
export { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, appendCronEventLines, createHeartbeatWake, isHeartbeatContentEmpty, isWithinActiveHours, shouldSilence, stripHeartbeatToken };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
2
1
|
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
2
|
+
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
3
3
|
import { getDefaultAuthProfileStore } from "./auth-profile-store.js";
|
|
4
4
|
//#region src/providers/auth-runtime/resolve-auth.ts
|
|
5
5
|
init_env_keys();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __esmMin, __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
3
|
-
import { getOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
4
|
-
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
5
3
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
6
4
|
import { init_model_ref, splitProviderModelRef } from "./model-ref.js";
|
|
7
5
|
import { ModelRegistry, getModelRegistry, init_model_registry, prewarmModelRegistry, resetModelRegistry } from "./model-registry.js";
|
|
6
|
+
import { getOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
8
7
|
import { CredentialResolver, hasCredentials, init_credentials } from "../auth/credentials.js";
|
|
8
|
+
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
9
9
|
import { EXTENSION_PROVIDER_BASE_URL, init_constants } from "./constants.js";
|
|
10
10
|
import { applyOfficialModelMetadataCorrections, getSupplementalModels, init_model_supplements } from "./model-supplements.js";
|
|
11
11
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
5
4
|
import { init_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
5
|
+
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
6
6
|
import { getDefaultModelValues, init_models_json, validateModelsConfig } from "../config/models-json.js";
|
|
7
7
|
import { getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
8
8
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
3
2
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
3
|
+
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
4
4
|
import { XOPC_CLOUD_PROVIDER_ID, init_xopc_cloud_config, resolveXopcModelRouterUrl } from "./xopc-cloud-config.js";
|
|
5
5
|
//#region src/providers/register-runtime-providers.ts
|
|
6
6
|
function registerRuntimeProvider(modelRuntime, source) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
|
-
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
3
2
|
import { init_paths, resolveAgentProfileDir, resolveBundledSkillsDir } from "../config/paths.js";
|
|
3
|
+
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
4
4
|
import { resolveBootstrapFilesSync } from "../agent/bootstrap/bootstrap-files.js";
|
|
5
5
|
import { createSkillConfigManager, isSkillEnabled } from "../agent/skills/config.js";
|
|
6
6
|
import { loadSkills } from "../agent/skills/index.js";
|
package/dist/src/tui/tui.js
CHANGED
|
@@ -2,10 +2,10 @@ import { version } from "../../package.js";
|
|
|
2
2
|
import { resolveStateDir, resolveXopcDatabasePath } from "../config/paths-state.js";
|
|
3
3
|
import { parseAgentSessionKey } from "../routing/session-key-utils.js";
|
|
4
4
|
import { init_agent_session_key, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
5
|
-
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
6
5
|
import { init_paths } from "../config/paths.js";
|
|
7
6
|
import { loadConfig } from "../config/loader.js";
|
|
8
7
|
import { getAllModels, getAllProviders, getApiKey, init_providers, isProviderConfiguredSync } from "../providers/index.js";
|
|
8
|
+
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
9
9
|
import { ProjectTrustStore, hasTrustRequiringProjectResources } from "../project-trust/trust-store.js";
|
|
10
10
|
import { renderWorkflowFinalSummary, renderWorkflowPanel } from "../agent/workflow/snapshot.js";
|
|
11
11
|
import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
@@ -18,7 +18,7 @@ const COMMON = [
|
|
|
18
18
|
category: "recent_documents",
|
|
19
19
|
platform: "all",
|
|
20
20
|
displayName: "Recent files",
|
|
21
|
-
description: "
|
|
21
|
+
description: "Bounded text from recent readable documents on Desktop, Documents, and Downloads.",
|
|
22
22
|
availability: "available",
|
|
23
23
|
permission: "not_requested",
|
|
24
24
|
defaultAccessMode: "once",
|
|
@@ -114,6 +114,13 @@ const PLATFORM = {
|
|
|
114
114
|
"Recent unlocked notes selected through macOS Automation",
|
|
115
115
|
true
|
|
116
116
|
],
|
|
117
|
+
[
|
|
118
|
+
"apple-mail",
|
|
119
|
+
"mail",
|
|
120
|
+
"Apple Mail",
|
|
121
|
+
"Recent inbox and sent-message content selected through macOS Automation",
|
|
122
|
+
true
|
|
123
|
+
],
|
|
117
124
|
[
|
|
118
125
|
"apple-calendar",
|
|
119
126
|
"calendar",
|
|
@@ -138,7 +145,7 @@ const PLATFORM = {
|
|
|
138
145
|
permission: "not_requested",
|
|
139
146
|
defaultAccessMode: "once",
|
|
140
147
|
supportedAccessModes: ["once"],
|
|
141
|
-
recommended: category !== "notes",
|
|
148
|
+
recommended: category !== "notes" && category !== "mail",
|
|
142
149
|
sensitive: Boolean(sensitive)
|
|
143
150
|
})),
|
|
144
151
|
win32: [{
|
|
@@ -1,3 +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"];
|
|
1
|
+
export declare const LOCAL_UNDERSTANDING_SOURCE_IDS: readonly ["local-recent-files", "chromium-bookmarks", "apple-notes", "apple-mail", "apple-calendar", "apple-reminders", "windows-recent-documents", "linux-recent-documents"];
|
|
2
2
|
export type LocalUnderstandingSourceId = typeof LOCAL_UNDERSTANDING_SOURCE_IDS[number];
|
|
3
3
|
export declare function isLocalUnderstandingSourceId(value: string): value is LocalUnderstandingSourceId;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const USER_FACING_UNDERSTANDING_WRITING_GUIDANCE = "Write each understanding as concise, neutral profile copy that can be shown directly to the person described, not as an internal note about \"the user\". Prefer a subject-omitted predicate or noun phrase. For example, write \u201C\u503E\u5411\u4F7F\u7528 pnpm \u4F5C\u4E3A\u5305\u7BA1\u7406\u5668\u201D or \u201Cxopc \u9879\u76EE\u7684\u6838\u5FC3\u5F00\u53D1\u8005\u201D, not \u201C\u7528\u6237\u503E\u5411\u4E8E\u4F7F\u7528 pnpm\u201D or \u201C\u7528\u6237\u662F xopc \u9879\u76EE\u7684\u5F00\u53D1\u8005\u201D; write \u201CPrefers pnpm as the package manager\u201D or \u201CCore maintainer of xopc\u201D, not \u201CThe user prefers pnpm\u201D or \u201CThe user is a maintainer of xopc\u201D. Do not begin with generic subject labels or pronouns such as \u201C\u7528\u6237\u201D, \u201C\u8BE5\u7528\u6237\u201D, \u201C\u6B64\u7528\u6237\u201D, \u201C\u4F60\u201D, \u201C\u6211\u201D, \u201Cthe user\u201D, \u201Cuser\u201D, \u201Cyou\u201D, or \u201CI\u201D.";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/user-context/understanding-writing.ts
|
|
2
|
+
const USER_FACING_UNDERSTANDING_WRITING_GUIDANCE = `Write each understanding as concise, neutral profile copy that can be shown directly to the person described, not as an internal note about "the user". Prefer a subject-omitted predicate or noun phrase. For example, write “倾向使用 pnpm 作为包管理器” or “xopc 项目的核心开发者”, not “用户倾向于使用 pnpm” or “用户是 xopc 项目的开发者”; write “Prefers pnpm as the package manager” or “Core maintainer of xopc”, not “The user prefers pnpm” or “The user is a maintainer of xopc”. Do not begin with generic subject labels or pronouns such as “用户”, “该用户”, “此用户”, “你”, “我”, “the user”, “user”, “you”, or “I”.`;
|
|
3
|
+
//#endregion
|
|
4
|
+
export { USER_FACING_UNDERSTANDING_WRITING_GUIDANCE };
|
|
@@ -13,5 +13,3 @@ export declare function inferProductLanguageFromEnvironment(): ProductLanguage;
|
|
|
13
13
|
export declare function initializeVoiceDefaults(config: Config, language?: ProductLanguage): boolean;
|
|
14
14
|
/** Apply product language only to providers whose language mapping is known. */
|
|
15
15
|
export declare function applyAutomaticVoiceLanguage(config: Config, language: ProductLanguage): boolean;
|
|
16
|
-
/** Start the model download without delaying gateway readiness. */
|
|
17
|
-
export declare function prepareConfiguredLocalVoiceModel(config: Config): void;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { DEFAULT_LOCAL_VOICE_MODEL_ID, isLocalVoiceModelInstalled } from "./local/models.js";
|
|
4
|
-
import { startLocalVoiceModelInstall } from "./local/model-manager.js";
|
|
1
|
+
import { DEFAULT_LOCAL_VOICE_MODEL_ID } from "./local/models.js";
|
|
5
2
|
//#region src/voice/language-profile.ts
|
|
6
|
-
init_logger();
|
|
7
|
-
const log = createLogger("Voice:Language");
|
|
8
3
|
function resolveVoiceLanguageProfile(language) {
|
|
9
4
|
return language === "zh" ? {
|
|
10
5
|
language,
|
|
@@ -104,28 +99,5 @@ function applyAutomaticVoiceLanguage(config, language) {
|
|
|
104
99
|
tts: config.messages?.tts
|
|
105
100
|
});
|
|
106
101
|
}
|
|
107
|
-
/** Start the model download without delaying gateway readiness. */
|
|
108
|
-
function prepareConfiguredLocalVoiceModel(config) {
|
|
109
|
-
const audio = config.tools?.media?.audio;
|
|
110
|
-
if (audio?.enabled === false || (audio?.provider ?? "xopc-local") !== "xopc-local") return;
|
|
111
|
-
const configuredModel = audio?.providers?.["xopc-local"]?.model;
|
|
112
|
-
const modelId = typeof configuredModel === "string" && configuredModel.trim() ? configuredModel.trim() : DEFAULT_LOCAL_VOICE_MODEL_ID;
|
|
113
|
-
if (isLocalVoiceModelInstalled(modelId)) return;
|
|
114
|
-
try {
|
|
115
|
-
startLocalVoiceModelInstall(modelId);
|
|
116
|
-
log.info({
|
|
117
|
-
modelId,
|
|
118
|
-
phase: "startup_prepare"
|
|
119
|
-
}, "Local voice model preparation started");
|
|
120
|
-
} catch (err) {
|
|
121
|
-
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
122
|
-
log.warn({
|
|
123
|
-
err,
|
|
124
|
-
modelId,
|
|
125
|
-
errorMessage,
|
|
126
|
-
phase: "startup_prepare"
|
|
127
|
-
}, `Local voice model preparation failed: ${errorMessage}`);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
102
|
//#endregion
|
|
131
|
-
export { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults,
|
|
103
|
+
export { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults, resolveVoiceLanguageProfile };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Config } from '../../config/schema.js';
|
|
2
|
+
export declare function localVoiceModelForProviderSwitch(previousProvider: string | undefined, config: Config): string | null;
|
|
3
|
+
/** Start a missing local STT model only after the provider changes to xopc-local. */
|
|
4
|
+
export declare function prepareLocalVoiceModelAfterProviderSwitch(previousProvider: string | undefined, config: Config): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createLogger } from "../../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { DEFAULT_LOCAL_VOICE_MODEL_ID, isLocalVoiceModelInstalled } from "./models.js";
|
|
4
|
+
import { startLocalVoiceModelInstall } from "./model-manager.js";
|
|
5
|
+
//#region src/voice/local/provider-switch.ts
|
|
6
|
+
init_logger();
|
|
7
|
+
const log = createLogger("Voice:Local");
|
|
8
|
+
function localVoiceModelForProviderSwitch(previousProvider, config) {
|
|
9
|
+
const audio = config.tools?.media?.audio;
|
|
10
|
+
const previous = previousProvider?.trim() || "xopc-local";
|
|
11
|
+
if (audio?.enabled === false || previous === "xopc-local" || audio?.provider !== "xopc-local") return null;
|
|
12
|
+
const configuredModel = audio.providers?.["xopc-local"]?.model;
|
|
13
|
+
return typeof configuredModel === "string" && configuredModel.trim() ? configuredModel.trim() : DEFAULT_LOCAL_VOICE_MODEL_ID;
|
|
14
|
+
}
|
|
15
|
+
/** Start a missing local STT model only after the provider changes to xopc-local. */
|
|
16
|
+
function prepareLocalVoiceModelAfterProviderSwitch(previousProvider, config) {
|
|
17
|
+
const modelId = localVoiceModelForProviderSwitch(previousProvider, config);
|
|
18
|
+
if (!modelId || isLocalVoiceModelInstalled(modelId)) return;
|
|
19
|
+
try {
|
|
20
|
+
startLocalVoiceModelInstall(modelId);
|
|
21
|
+
log.info({
|
|
22
|
+
modelId,
|
|
23
|
+
phase: "provider_switch"
|
|
24
|
+
}, "Local voice model preparation started");
|
|
25
|
+
} catch (err) {
|
|
26
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
27
|
+
log.warn({
|
|
28
|
+
err,
|
|
29
|
+
modelId,
|
|
30
|
+
errorMessage,
|
|
31
|
+
phase: "provider_switch"
|
|
32
|
+
}, `Local voice model preparation failed: ${errorMessage}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { localVoiceModelForProviderSwitch, prepareLocalVoiceModelAfterProviderSwitch };
|
|
@@ -10,6 +10,11 @@ export declare function analyzeWorkContext(input: {
|
|
|
10
10
|
modelRef: string;
|
|
11
11
|
result: WorkDiscoveryResult;
|
|
12
12
|
}>;
|
|
13
|
+
export type UnderstandingSourceAnalysisStatus = {
|
|
14
|
+
sourceId: string;
|
|
15
|
+
status: 'completed' | 'partial' | 'failed';
|
|
16
|
+
error?: string;
|
|
17
|
+
};
|
|
13
18
|
export declare function analyzeUnderstandingSources(input: {
|
|
14
19
|
config: Config;
|
|
15
20
|
items: UnderstandingSourceItem[];
|
|
@@ -19,5 +24,6 @@ export declare function analyzeUnderstandingSources(input: {
|
|
|
19
24
|
modelRef: string;
|
|
20
25
|
profileCandidates: WorkDiscoveryProfileCandidate[];
|
|
21
26
|
workThreadCandidates: WorkUnderstandingThreadCandidate[];
|
|
27
|
+
sourceStatuses: UnderstandingSourceAnalysisStatus[];
|
|
22
28
|
}>;
|
|
23
29
|
export declare function workDiscoveryResultMarkdown(result: WorkDiscoveryResult): string;
|