@xopcai/xopc 0.0.355 → 0.0.357
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-X7CG9pzB.js → activity-store-Bj0GuUUk.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DiEBNuSv.js → agent-avatar-dicebear-5q-LyRB2.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DpBmB3QX.js → agent-defaults-settings-panel-BOojrPNq.js} +1 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-3fkKAT0r.js +1 -0
- package/dist/gateway/static/root/assets/agents-DJyRK5vN.js +66 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-Ck2x78jq.js → agents-admin-api-CYqmO7gb.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-MkSa6isi.js → app-management-settings-panel-8ODazg-Y.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-B7hCkaT_.js → appearance-settings-0G9nGAsa.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-D_CduJuC.js → apps-page-CJyfU05v.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-QfOaQPL_.js → archive-plugin-BZHSbFiu.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-uEnQawd7.js → automations-page-egZn4y94.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CI1EK1eb.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BF2lVwR9.js → binary-plugins-x2-RmzUs.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-r4mKGacz.js → block-editor-Bi-NBvGE.js} +39 -39
- package/dist/gateway/static/root/assets/{browser-automation-inputs-FW3bYZ-z.js → browser-automation-inputs-uQ2AGFFU.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-Blrxyy_h.js → browser-automations-page-D2AYNyC2.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-DGuwrO7j.js → browser-settings-page-DVMJRsch.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-CF4-mrIa.js → capabilities-Btku0cS3.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BCF_160Z.js → capabilities-Cl1RErL_.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-CBdEzKy1.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-B7f1WLgL.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-CyvI2F5x.js → capability-header-actions-BuYo4ONV.js} +1 -1
- package/dist/gateway/static/root/assets/channels-COGpGGqA.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-YdxhecE7.js → chat-terminal-dock-DJnrcf3F.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-BuCrA8yD.js → computer-settings-page-CbKp1tj0.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BiB2GYkp.js → connector-service-page-BxJquXDl.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DJocZ_mY.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-BJtADyRQ.js → date-picker-CYQyKepm.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-D-Ko0G40.js → dependency-picker-dc-q0G_j.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CVPWcWwC.js → desktop-pet-gvvvaJ51.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BcN_I-7y.js → desktop-pet-settings-w8qYvD9r.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-CAQ2qJIZ.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-m0CubGEP.js → directory-picker-path-field-BfJOJnPB.js} +1 -1
- package/dist/gateway/static/root/assets/dist-C3DSFZCi.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BrGWLJg9.js → extension-debug-page-DPc3vTw0.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Dd88ynHj.js → extension-page-BpyU7d5e.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-CUpbXB2k.js → extension-provider-D-0AeFhE.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Dq1MXh6D.js → extension-settings-page-BlzNJ6hK.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-B31I6Gbq.js → gateway-config-swr-Da3Oob_s.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-D6ffOiPe.js → gateway-realtime-BDh3i8n7.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-B5Oq6VCQ.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-C_bTRQeE.js → gateway-settings-DyreTpro.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DVol958v.js → gateway-startup-retry-BEj_bcbm.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-rKyHpQpb.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-TVgJfz9r.js → image-generation-api-8jfU8AlD.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-Cd4tcbLU.js → imports-page-BHUlyE3u.js} +1 -1
- package/dist/gateway/static/root/assets/index-DOFuObNM.js +106 -0
- package/dist/gateway/static/root/assets/index-DUgsBdV3.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CmalfzgQ.js → keyboard-shortcuts-settings-Pb-3Ryr9.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-BquHHLj6.js → local-app-workbench-page-yWS0QdRe.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-RPLHMvYs.js → local-apps-page-DgQHDdZh.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-wiq_12oN.js → local-session-drafts-jOqfUlwj.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Y1aBayM_.js → locale-store-DodizOrj.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-7NMGltSw.js → logs-page-CwTIW0J0.js} +2 -2
- package/dist/gateway/static/root/assets/loopi-C09I2mNj.css +1 -0
- package/dist/gateway/static/root/assets/loopi-Djb8XU3l.js +1 -0
- package/dist/gateway/static/root/assets/{management-settings-zwFewbhp.js → management-settings-Dm2Fa1QY.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-7tzqIp_G.js → markdown-view-Bb6ohqHz.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-cjgrKnne.js → media-plugins-DIhqKSK5.js} +1 -1
- package/dist/gateway/static/root/assets/messages-D8PmAUB-.js +3 -0
- package/dist/gateway/static/root/assets/models-hub-cache-CaYi043g.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-D9iPUCQq.js +5 -0
- package/dist/gateway/static/root/assets/{notes-api-J0yhflxC.js → notes-api-DYfvIxWh.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-CbzhN_on.js +8 -0
- package/dist/gateway/static/root/assets/{oauth-api-CYe61zfD.js → oauth-api-gSu-iTk5.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-DqmAq4Ov.js → page-context-capture-button-B6i0R1qQ.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-DopSoSDc.js +1 -0
- package/dist/gateway/static/root/assets/{popover-select-DcsFzD_i.js → popover-select-BNZZDJpO.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-SsG2sljT.js → product-open-page-CMmB1iyB.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-wp5cFhM7.js → project-detail-page-BrGdrlhx.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-Brfi519S.js → projects-page-CmjHjX8D.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-DqDOrPQ0.js → registry-api-D0eYNizR.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-WKPLG5V4.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CT6HKczq.js → runtime-tools-settings-panel-D1IEye-5.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-BmlI42OR.js → scenes-page-CDxjO8IH.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DEcsbgne.js → schema-form-DrSp5o9r.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-C7Nqy0sK.js → send-session-input-DstpmO44.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CTN4qwiN.js → session-api-qy4gMa5t.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-DsH1DZI_.js → session-manager-CFqOuGy-.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-tL7mZG6X.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-Dq5CfiKV.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-P50kLPUz.js → settings-page-CLx4gCfD.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-DtnwH0wN.js → setup-status-panel-TBkyBEiM.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-COlX10Dc.js → share-link-dialog-B3Io5mOY.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-NtRLUieq.js → share-preview-page-BpZqXsgR.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-DICV5EKH.js → shares-api-BNNaREyB.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Bz0BI8lL.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-CcdHQhxd.js → skill-api-Bom72qsC.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-CWH3Fmx4.js → skill-reload-api-Dm6GgUYK.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-BIQrMkmI.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-DAR0w3Xi.js → system-settings-panel-CzAezoel.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-GOqAjMLD.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-BKgBPLH4.js → theme-store-AXut7b8R.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-CBy97LfF.js → tunnel-api-DtkDWId1.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-BdX6VPQC.js → usage-page-ZKtrJ73f.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-Cn6hqqyM.js → use-autosave-BT3l-ETP.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-DL61XeSu.js → use-composer-attachments-zfL8zvRu.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-Cl9mU32w.js → use-file-preview-expanded-C4bBXf4j.js} +2 -2
- package/dist/gateway/static/root/assets/user-model-page-B6E9ihaw.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-Bw05QB_V.js → voice-api-key-field-BF9hOZ_1.js} +1 -1
- package/dist/gateway/static/root/assets/voice-config-api-D8G4fALX.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-overlay-cD0OrAiy.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BQ3fmhM-.js → workflow-run-setup-panel-4yISOYK9.js} +2 -2
- package/dist/gateway/static/root/assets/{workflows-page-Bl8rd4fM.js → workflows-page-B2_1T6js.js} +3 -3
- package/dist/gateway/static/root/assets/{workspace-api-BbBT75Kg.js → workspace-api-C4q2GwGV.js} +2 -2
- package/dist/gateway/static/root/index.html +32 -30
- package/dist/package.js +1 -1
- package/dist/packages/realtime-protocol/src/voice-catalog.js +4 -1
- package/dist/src/agent/agent-manager.js +3 -3
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-config/schema.d.ts +15 -0
- package/dist/src/agent-config/schema.js +5 -0
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/models.js +18 -0
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/personal-agent.js +118 -6
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/voice.js +26 -1
- package/dist/src/gateway/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/security/gateway-scopes.js +2 -0
- package/dist/src/gateway/service.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +2 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +105 -9
- package/dist/src/gateway/xopc-cloud-onboarding.d.ts +3 -0
- package/dist/src/gateway/xopc-cloud-onboarding.js +27 -0
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/personal-agent/onboarding.d.ts +27 -0
- package/dist/src/personal-agent/onboarding.js +48 -0
- package/dist/src/personal-agent/repository.d.ts +6 -1
- package/dist/src/personal-agent/repository.js +7 -2
- package/dist/src/personal-agent/service.d.ts +31 -8
- package/dist/src/personal-agent/service.js +24 -13
- package/dist/src/providers/model-catalog-persistence.js +2 -2
- package/dist/src/storage/sqlite/migrations/230_personal_agent_onboarding.sql +8 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tui/backends/embedded-backend.js +2 -2
- package/dist/src/voice/language-profile.js +1 -1
- package/dist/src/voice/metadata/builtin.js +16 -39
- package/dist/src/voice/metadata/types.d.ts +2 -0
- package/dist/src/voice/platform-catalog.d.ts +3 -0
- package/dist/src/voice/realtime/agentEngine.js +30 -11
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/runtime.js +16 -1
- package/dist/src/voice/stt/providers/alibaba-transcription.js +3 -3
- package/dist/src/voice/stt/types.js +1 -1
- package/dist/src/voice/tts/providers/alibaba-speech.js +4 -16
- package/dist/src/voice/tts/providers/alibaba-voices.d.ts +3 -0
- package/dist/src/voice/tts/providers/alibaba-voices.js +197 -0
- package/dist/src/voice/tts/speech-provider-types.d.ts +1 -0
- package/dist/src/voice/tts/types.js +1 -1
- package/package.json +7 -7
- package/dist/gateway/static/root/assets/agent-plugin-dialog-DlojWUY_.js +0 -1
- package/dist/gateway/static/root/assets/agents-CeSCdUHP.js +0 -66
- package/dist/gateway/static/root/assets/automations-workspace-pdiSK3Qk.js +0 -7
- package/dist/gateway/static/root/assets/capabilities-page-DUIA2K--.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CwPNQsJS.js +0 -8
- package/dist/gateway/static/root/assets/channels-DBxDJV8I.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-nQAgZk-5.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-CoKKoUlt.js +0 -1
- package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DQuFWNjA.js +0 -1
- package/dist/gateway/static/root/assets/home-page-xbqSikkK.js +0 -1
- package/dist/gateway/static/root/assets/index-BuzC93X-.css +0 -1
- package/dist/gateway/static/root/assets/index-CYeGnj-L.js +0 -106
- package/dist/gateway/static/root/assets/messages-DPw2X06D.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-cache-HGrORbzR.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-CwMg9cvF.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CWJwrvo7.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-Bbgx_dgV.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BdtF8Cvk.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-C_G8fZwV.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CDxdzwDs.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-7Ak_MsJg.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-ChjXDxdX.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-DEx0kXDV.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-CRxiQnWG.js +0 -2
- package/dist/gateway/static/root/assets/voice-config-api-BM75K3mR.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-DvwmD9Ma.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { ComputerConfigSchema, init_config } from "../computer/config.js";
|
|
2
3
|
import { AgentModelsOverrideSchema, ImageGenerationRouteSchema, ModelRouteSchema } from "../agent-config/schema.js";
|
|
3
4
|
import { resolveEffectiveAgentConfig } from "../agent-config/resolver.js";
|
|
4
5
|
import { init_agent_config } from "../agent-config/index.js";
|
|
5
6
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
6
|
-
import { ComputerConfigSchema, init_config } from "../computer/config.js";
|
|
7
7
|
import { DEFAULT_CONTEXT_COMPACTION_POLICY, UserContextConfigSchema, init_config as init_config$1 } from "../user-context/config.js";
|
|
8
8
|
import { init_public_url, validatePublicUrl } from "./public-url.js";
|
|
9
9
|
import { PlatformConfigSchema, init_contracts } from "../platform/contracts.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
2
2
|
import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import yaml from "js-yaml";
|
|
5
4
|
import { validateHeaderName, validateHeaderValue } from "node:http";
|
|
5
|
+
import yaml from "js-yaml";
|
|
6
6
|
//#region src/extensions/agent-plugins/validation.ts
|
|
7
7
|
const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
8
8
|
const MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
4
3
|
import { init_paths, resolveExtensionsDir, resolveExtensionsLockPath } from "../config/paths.js";
|
|
4
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
5
5
|
import { dirname, join } from "path";
|
|
6
6
|
import { existsSync, lstatSync, readFileSync, readdirSync, readlinkSync } from "fs";
|
|
7
7
|
import { mkdir, readFile } from "fs/promises";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { normalizeAgentId, validateAgentIdForNewAgent } from "../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
3
|
import { init_agent_scope, listAgentEntries, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath } from "../agent/agent-scope.js";
|
|
4
|
-
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
5
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
6
4
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
5
|
+
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
7
6
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
8
8
|
import { GATEWAY_BUILTIN_TOOL_IDS } from "./agent-builtin-tools.js";
|
|
9
9
|
import { resolve } from "node:path";
|
|
10
10
|
import { mkdir, readFile, realpath, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeAgentId } from "../../../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../../../agent-catalog/repository.js";
|
|
3
|
-
import { init_agent_scope, listAgentEntries, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
4
3
|
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
4
|
+
import { init_agent_scope, listAgentEntries, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
5
5
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
6
6
|
import { init_models_json, loadModelsJson } from "../../../config/models-json.js";
|
|
7
7
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { BindingsSchema, init_binding_schema } from "../../../../routing/binding-schema.js";
|
|
2
|
-
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
3
1
|
import { ComputerConfigSchema, init_config } from "../../../../computer/config.js";
|
|
2
|
+
import { BindingsSchema, init_binding_schema } from "../../../../routing/binding-schema.js";
|
|
4
3
|
import { ContextPlanningConfigSchema, HomeIntelligenceConfigSchema, KnowledgeMemoryConfigSchema, UserContextConfigSchema, UserModelConfigSchema, init_config as init_config$1 } from "../../../../user-context/config.js";
|
|
5
4
|
import { BrowserConfigSchema, McpConfigSchema, VoiceConfigSchema, init_schema } from "../../../../config/schema.js";
|
|
6
5
|
import { CredentialResolver, init_credentials } from "../../../../auth/credentials.js";
|
|
7
6
|
import { canonicalizeConfiguredMcpServer } from "../../../../config/mcp-config-normalize.js";
|
|
7
|
+
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
8
8
|
import { mergeGatewaySkillsMarketplacePatch, mergeSessionConfigPatch, mergeUpdateConfigPatch } from "../../../../config/web-patch.js";
|
|
9
9
|
import { assertGatewayAuthConfigured, resolveGatewayAuth } from "../../../auth.js";
|
|
10
10
|
import { isMaskedSecretPatchValue } from "../../lib/mask-secret-length.js";
|
|
@@ -19,6 +19,7 @@ import { applyImageGenerationCatalogUpdate, getAgentImageGenerationConfig, getDe
|
|
|
19
19
|
import { discoverProviderModels, isProviderApiDiscoverable } from "../../../providers/model-discovery.js";
|
|
20
20
|
import { getXopcCloudCatalogCoordinator } from "../../../providers/xopc-cloud-catalog-coordinator.js";
|
|
21
21
|
import { respondStartupUnavailable } from "../lib/startup-unavailable.js";
|
|
22
|
+
import { dismissXopcCloudOnboarding, getXopcCloudOnboardingStatus } from "../../xopc-cloud-onboarding.js";
|
|
22
23
|
import { getDomesticProviderPreset, getDomesticProviderPresetIds } from "../../../providers/domestic-presets.js";
|
|
23
24
|
import { auditModelReferences } from "../../../providers/model-reference-auditor.js";
|
|
24
25
|
import { getOnboardingFeaturedProviders, getProviderHint, getRecommendedModelsForProvider, isRecommendedModel, sortModelsForPicker, sortProvidersForPicker } from "../../../providers/presentation.js";
|
|
@@ -85,6 +86,23 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
85
86
|
const { service, strictRateLimitMiddleware } = deps;
|
|
86
87
|
const catalogSync = service.getModelCatalogSync();
|
|
87
88
|
const xopcCloudAccount = new XopcCloudAccountService();
|
|
89
|
+
authenticated.get("/api/models/cloud-onboarding", async (c) => {
|
|
90
|
+
const [status, auth] = await Promise.all([getXopcCloudOnboardingStatus(), getProviderAuthState("xopc-cloud")]);
|
|
91
|
+
return c.json({
|
|
92
|
+
ok: true,
|
|
93
|
+
payload: {
|
|
94
|
+
status,
|
|
95
|
+
hasGrant: auth.authMode === "oauth"
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
authenticated.put("/api/models/cloud-onboarding", strictRateLimitMiddleware, async (c) => {
|
|
100
|
+
await dismissXopcCloudOnboarding();
|
|
101
|
+
return c.json({
|
|
102
|
+
ok: true,
|
|
103
|
+
payload: { status: "dismissed" }
|
|
104
|
+
});
|
|
105
|
+
});
|
|
88
106
|
authenticated.get("/api/models/catalog/status", (c) => {
|
|
89
107
|
const readiness = getXopcCloudCatalogCoordinator().snapshot();
|
|
90
108
|
return c.json({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { NoteDeleteOutputSchema, NoteGetOutputSchema, ProductReadContracts } from "../../../../packages/gateway-contract/src/capabilities.js";
|
|
2
2
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
4
|
-
import "../../../capabilities/runtime/dispatcher.js";
|
|
5
3
|
import { init_session_key, resolveConversationId } from "../../../routing/session-key.js";
|
|
6
4
|
import { agentExists, getDefaultAgentId, init_resolve_route } from "../../../routing/resolve-route.js";
|
|
5
|
+
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
6
|
+
import "../../../capabilities/runtime/dispatcher.js";
|
|
7
7
|
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
8
8
|
import { getShareStore } from "../../../share/share-store.js";
|
|
9
9
|
import { resolveShareUrl } from "../../../share/share-url.js";
|
|
@@ -1,15 +1,40 @@
|
|
|
1
|
+
import { getDevice, init_device_access_repository } from "../../../storage/sqlite/device-access-repository.js";
|
|
1
2
|
import { TaskOriginRepository } from "../../../tasks/task-origin-repository.js";
|
|
2
3
|
import { getPersonalAgent } from "../../../personal-agent/repository.js";
|
|
4
|
+
import { PersonalOnboardingDraftSchema, PersonalOnboardingStepSchema, finishPersonalWelcome, getPersonalOnboarding, savePersonalOnboarding } from "../../../personal-agent/onboarding.js";
|
|
3
5
|
import { PersonalAppearanceSchema, PersonalPreferencesSchema, createOrResumePersonalAgent, ensurePersonalConversationVisibility, listPersonalModels, patchPersonalProfile, refreshPersonalDelegationGuidance } from "../../../personal-agent/service.js";
|
|
4
6
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
5
7
|
import { z } from "zod";
|
|
6
8
|
//#region src/gateway/hono/routes/personal-agent.ts
|
|
7
|
-
|
|
9
|
+
init_device_access_repository();
|
|
10
|
+
const CreateSchema = z.object({
|
|
11
|
+
model: z.string().trim().min(3).optional(),
|
|
12
|
+
displayName: z.string().trim().min(1).max(60).optional(),
|
|
13
|
+
appearance: z.enum([
|
|
14
|
+
"loopi",
|
|
15
|
+
"loopi-curious",
|
|
16
|
+
"loopi-care"
|
|
17
|
+
]).optional(),
|
|
18
|
+
voicePreference: z.object({
|
|
19
|
+
provider: z.string().trim().min(1).max(100),
|
|
20
|
+
model: z.string().trim().min(1).max(200),
|
|
21
|
+
voice: z.string().trim().min(1).max(200)
|
|
22
|
+
}).strict().optional()
|
|
23
|
+
}).strict();
|
|
24
|
+
const OnboardingSchema = z.object({
|
|
25
|
+
step: PersonalOnboardingStepSchema,
|
|
26
|
+
draft: PersonalOnboardingDraftSchema
|
|
27
|
+
}).strict();
|
|
8
28
|
const ProfileSchema = z.object({
|
|
9
29
|
revision: z.number().int().positive(),
|
|
10
30
|
displayName: z.string().trim().min(1).max(60),
|
|
11
31
|
appearance: PersonalAppearanceSchema,
|
|
12
|
-
preferences: PersonalPreferencesSchema
|
|
32
|
+
preferences: PersonalPreferencesSchema,
|
|
33
|
+
voicePreference: z.object({
|
|
34
|
+
provider: z.string().trim().min(1).max(100),
|
|
35
|
+
model: z.string().trim().min(1).max(200),
|
|
36
|
+
voice: z.string().trim().min(1).max(200)
|
|
37
|
+
}).strict().nullable().optional()
|
|
13
38
|
}).strict();
|
|
14
39
|
const ActivityQuerySchema = z.object({
|
|
15
40
|
limit: z.coerce.number().int().min(1).max(20).default(5),
|
|
@@ -17,7 +42,11 @@ const ActivityQuerySchema = z.object({
|
|
|
17
42
|
});
|
|
18
43
|
function registerPersonalAgentRoutes(authenticated, deps) {
|
|
19
44
|
const owner = (c) => {
|
|
20
|
-
|
|
45
|
+
const principal = getGatewayPrincipal(c);
|
|
46
|
+
if (principal.kind === "owner") return "local-owner";
|
|
47
|
+
if (principal.kind !== "device" || !principal.deviceId) return null;
|
|
48
|
+
const platform = getDevice(principal.deviceId)?.platform;
|
|
49
|
+
return platform === "harmonyos" || platform === "ios" || platform === "android" ? "local-owner" : null;
|
|
21
50
|
};
|
|
22
51
|
authenticated.get("/api/personal-agent", async (c) => {
|
|
23
52
|
const ownerId = owner(c);
|
|
@@ -42,6 +71,54 @@ function registerPersonalAgentRoutes(authenticated, deps) {
|
|
|
42
71
|
payload: await listPersonalModels()
|
|
43
72
|
});
|
|
44
73
|
});
|
|
74
|
+
authenticated.get("/api/personal-agent/onboarding", (c) => {
|
|
75
|
+
const ownerId = owner(c);
|
|
76
|
+
if (!ownerId) return c.json({
|
|
77
|
+
ok: false,
|
|
78
|
+
error: "Owner access is required"
|
|
79
|
+
}, 403);
|
|
80
|
+
return c.json({
|
|
81
|
+
ok: true,
|
|
82
|
+
payload: getPersonalOnboarding(ownerId)
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
authenticated.put("/api/personal-agent/onboarding", deps.strictRateLimitMiddleware, async (c) => {
|
|
86
|
+
const ownerId = owner(c);
|
|
87
|
+
if (!ownerId) return c.json({
|
|
88
|
+
ok: false,
|
|
89
|
+
error: "Owner access is required"
|
|
90
|
+
}, 403);
|
|
91
|
+
if (getPersonalAgent(ownerId)?.state === "ready") return c.json({
|
|
92
|
+
ok: false,
|
|
93
|
+
error: "Onboarding is complete"
|
|
94
|
+
}, 409);
|
|
95
|
+
const parsed = OnboardingSchema.safeParse(await c.req.json().catch(() => null));
|
|
96
|
+
if (!parsed.success) return c.json({
|
|
97
|
+
ok: false,
|
|
98
|
+
error: "Invalid onboarding draft"
|
|
99
|
+
}, 400);
|
|
100
|
+
savePersonalOnboarding(ownerId, parsed.data.step, parsed.data.draft);
|
|
101
|
+
return c.json({
|
|
102
|
+
ok: true,
|
|
103
|
+
payload: getPersonalOnboarding(ownerId)
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
authenticated.post("/api/personal-agent/onboarding/welcome", deps.strictRateLimitMiddleware, (c) => {
|
|
107
|
+
const ownerId = owner(c);
|
|
108
|
+
if (!ownerId) return c.json({
|
|
109
|
+
ok: false,
|
|
110
|
+
error: "Owner access is required"
|
|
111
|
+
}, 403);
|
|
112
|
+
if (getPersonalAgent(ownerId)?.state !== "ready") return c.json({
|
|
113
|
+
ok: false,
|
|
114
|
+
error: "Personal Agent is unavailable"
|
|
115
|
+
}, 409);
|
|
116
|
+
finishPersonalWelcome(ownerId);
|
|
117
|
+
return c.json({
|
|
118
|
+
ok: true,
|
|
119
|
+
payload: getPersonalOnboarding(ownerId)
|
|
120
|
+
});
|
|
121
|
+
});
|
|
45
122
|
authenticated.get("/api/personal-agent/activity", (c) => {
|
|
46
123
|
const ownerId = owner(c);
|
|
47
124
|
if (!ownerId) return c.json({
|
|
@@ -84,7 +161,27 @@ function registerPersonalAgentRoutes(authenticated, deps) {
|
|
|
84
161
|
error: "Invalid create request"
|
|
85
162
|
}, 400);
|
|
86
163
|
try {
|
|
87
|
-
const
|
|
164
|
+
const selected = parsed.data.voicePreference;
|
|
165
|
+
if (selected) {
|
|
166
|
+
const { resolveStreamingTts } = await import("../../../voice/realtime/runtime.js");
|
|
167
|
+
const route = resolveStreamingTts(deps.service.currentConfig);
|
|
168
|
+
if (!route?.provider.plugin.listVoices || route.route.provider !== selected.provider || route.route.model !== selected.model) return c.json({
|
|
169
|
+
ok: false,
|
|
170
|
+
error: "Selected voice is unavailable"
|
|
171
|
+
}, 400);
|
|
172
|
+
if (!(await route.provider.plugin.listVoices({
|
|
173
|
+
cfg: deps.service.currentConfig,
|
|
174
|
+
providerConfig: route.provider.providerConfig
|
|
175
|
+
})).some((voice) => voice.id === selected.voice)) return c.json({
|
|
176
|
+
ok: false,
|
|
177
|
+
error: "Selected voice is unavailable"
|
|
178
|
+
}, 400);
|
|
179
|
+
}
|
|
180
|
+
const record = await createOrResumePersonalAgent(deps.service, ownerId, parsed.data.model, listPersonalModels, parsed.data.displayName && parsed.data.appearance ? {
|
|
181
|
+
displayName: parsed.data.displayName,
|
|
182
|
+
appearance: parsed.data.appearance,
|
|
183
|
+
...selected ? { voicePreference: selected } : {}
|
|
184
|
+
} : void 0);
|
|
88
185
|
return c.json({
|
|
89
186
|
ok: true,
|
|
90
187
|
payload: record
|
|
@@ -107,8 +204,23 @@ function registerPersonalAgentRoutes(authenticated, deps) {
|
|
|
107
204
|
ok: false,
|
|
108
205
|
error: "Invalid profile"
|
|
109
206
|
}, 400);
|
|
110
|
-
const { revision, displayName, appearance, preferences } = parsed.data;
|
|
111
|
-
|
|
207
|
+
const { revision, displayName, appearance, preferences, voicePreference } = parsed.data;
|
|
208
|
+
if (voicePreference) {
|
|
209
|
+
const { resolveStreamingTts } = await import("../../../voice/realtime/runtime.js");
|
|
210
|
+
const route = resolveStreamingTts(deps.service.currentConfig);
|
|
211
|
+
if (!route?.provider.plugin.listVoices || route.route.provider !== voicePreference.provider || route.route.model !== voicePreference.model) return c.json({
|
|
212
|
+
ok: false,
|
|
213
|
+
error: "Selected voice is unavailable"
|
|
214
|
+
}, 400);
|
|
215
|
+
if (!(await route.provider.plugin.listVoices({
|
|
216
|
+
cfg: deps.service.currentConfig,
|
|
217
|
+
providerConfig: route.provider.providerConfig
|
|
218
|
+
})).some((voice) => voice.id === voicePreference.voice)) return c.json({
|
|
219
|
+
ok: false,
|
|
220
|
+
error: "Selected voice is unavailable"
|
|
221
|
+
}, 400);
|
|
222
|
+
}
|
|
223
|
+
const updated = await patchPersonalProfile(deps.service, ownerId, revision, displayName, preferences, appearance, voicePreference);
|
|
112
224
|
return updated ? c.json({
|
|
113
225
|
ok: true,
|
|
114
226
|
payload: updated
|
|
@@ -7,12 +7,12 @@ import { loadTranscriptRowsForSession } from "../../../storage/sqlite/transcript
|
|
|
7
7
|
import { init_sqlite } from "../../../storage/sqlite/index.js";
|
|
8
8
|
import { ActivityService } from "../../../activity/service.js";
|
|
9
9
|
import "../../../activity/index.js";
|
|
10
|
-
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
11
|
-
import "../../../capabilities/runtime/dispatcher.js";
|
|
12
10
|
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
13
11
|
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
14
12
|
import { listKnowledgeItems, writeKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
15
13
|
import "../../../knowledge-memory/index.js";
|
|
14
|
+
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
15
|
+
import "../../../capabilities/runtime/dispatcher.js";
|
|
16
16
|
import { ProjectWorkspaceConflictError, ProjectWorkspaceMissingError } from "../../../projects/workspace-project.js";
|
|
17
17
|
import { inferProjectExecutionMode, inferProjectKind } from "../../../projects/project-kind.js";
|
|
18
18
|
import { ProjectDeletionBlockedError, ProjectWorkspaceInUseError } from "../../../projects/project-service.js";
|
|
@@ -4,9 +4,9 @@ import { browserPageContextsInputSchema } from "../../../../packages/gateway-con
|
|
|
4
4
|
import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packages/gateway-contract/src/user-turn-document.js";
|
|
5
5
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
6
6
|
import { endpointTurnClaimSchema, init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
7
|
+
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
7
8
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
8
9
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
9
|
-
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
10
10
|
import { getModelThinking } from "../../../providers/model-thinking.js";
|
|
11
11
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
12
12
|
import { isTaskDestructiveCommand } from "../../../session/reset-triggers.js";
|
|
@@ -6,9 +6,9 @@ import { hasGatewayScope, init_gateway_scopes } from "../../security/gateway-sco
|
|
|
6
6
|
import { enqueueTaskChangedEvent, init_task_change_events } from "../../../tasks/task-change-events.js";
|
|
7
7
|
import { TaskRepository, init_task_repository } from "../../../tasks/task-repository.js";
|
|
8
8
|
import { TaskRunRepository, init_task_run_repository } from "../../../tasks/task-run-repository.js";
|
|
9
|
+
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
9
10
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
10
11
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
11
|
-
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
12
12
|
import { TaskCriterionReviewRepository } from "../../../tasks/task-criterion-review-repository.js";
|
|
13
13
|
import { TaskContextMutationOutputSchema } from "../../../tasks/capabilities/relations.js";
|
|
14
14
|
import { TaskDeleteOutputSchema } from "../../../tasks/capabilities/management.js";
|
|
@@ -209,6 +209,31 @@ function registerVoiceRoutes(authenticated, deps) {
|
|
|
209
209
|
ok: false,
|
|
210
210
|
error: { message: "Realtime voice output is not configured" }
|
|
211
211
|
}, 503);
|
|
212
|
+
const body = await c.req.json().catch(() => ({}));
|
|
213
|
+
const selectedVoice = typeof body.voice === "string" ? body.voice.trim() : "";
|
|
214
|
+
if (selectedVoice) {
|
|
215
|
+
if (selectedVoice.length > 200 || !route.provider.plugin.listVoices) return c.json({
|
|
216
|
+
ok: false,
|
|
217
|
+
error: { message: "Voice is unavailable" }
|
|
218
|
+
}, 400);
|
|
219
|
+
if (!(await route.provider.plugin.listVoices({
|
|
220
|
+
cfg: config,
|
|
221
|
+
providerConfig: route.provider.providerConfig
|
|
222
|
+
})).some((voice) => voice.id === selectedVoice)) return c.json({
|
|
223
|
+
ok: false,
|
|
224
|
+
error: { message: "Voice is unavailable" }
|
|
225
|
+
}, 400);
|
|
226
|
+
}
|
|
227
|
+
const previewConfig = selectedVoice ? {
|
|
228
|
+
...route.config,
|
|
229
|
+
providers: {
|
|
230
|
+
...route.config.providers,
|
|
231
|
+
[route.route.provider]: {
|
|
232
|
+
...route.config.providers?.[route.route.provider],
|
|
233
|
+
voice: selectedVoice
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
} : route.config;
|
|
212
237
|
const controller = new AbortController();
|
|
213
238
|
const signal = AbortSignal.any([
|
|
214
239
|
c.req.raw.signal,
|
|
@@ -218,7 +243,7 @@ function registerVoiceRoutes(authenticated, deps) {
|
|
|
218
243
|
let result;
|
|
219
244
|
let reader;
|
|
220
245
|
try {
|
|
221
|
-
result = await speakStream(config.voice?.language === "en" ? "Hello, I am your assistant. You can talk to me naturally." : "你好,我是你的助手。现在可以和我自然对话了。",
|
|
246
|
+
result = await speakStream(config.voice?.language === "en" ? "Hello, I am your assistant. You can talk to me naturally." : "你好,我是你的助手。现在可以和我自然对话了。", previewConfig, {
|
|
222
247
|
signal,
|
|
223
248
|
appConfig: config,
|
|
224
249
|
allowFallback: false,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
|
-
import { init_agent_scope } from "../agent/agent-scope.js";
|
|
4
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
5
3
|
import { ConfigSchema, init_schema } from "../config/schema.js";
|
|
4
|
+
import { init_agent_scope } from "../agent/agent-scope.js";
|
|
6
5
|
import { resolveEffectiveAgentConfigForAgent } from "../config/agent-profile.js";
|
|
7
6
|
import { fetchWithTimeoutGuarded } from "../media-shared/http/provider-http.js";
|
|
8
7
|
import "../media-shared/http/index.js";
|
|
8
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
9
9
|
import { getImageGenerationProvider, listImageGenerationProvidersSummary } from "../agent/image/generation/provider-registry.js";
|
|
10
10
|
//#region src/gateway/image-generation-setup.ts
|
|
11
11
|
init_repository();
|
package/dist/src/gateway/lock.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
|
-
import fs$1 from "node:fs/promises";
|
|
5
4
|
import net from "node:net";
|
|
5
|
+
import fs$1 from "node:fs/promises";
|
|
6
6
|
import { homedir } from "os";
|
|
7
7
|
//#region src/gateway/lock.ts
|
|
8
8
|
/**
|
|
@@ -18,6 +18,8 @@ function requiredGatewayScope(method, path) {
|
|
|
18
18
|
if (path === "/api/device-auth/refresh" || path === "/api/devices/me") return "device.self";
|
|
19
19
|
if (path.startsWith("/api/devices/me/push")) return "notifications.self";
|
|
20
20
|
if (path.startsWith("/api/endpoint-tools")) return "device.self";
|
|
21
|
+
if (path === "/api/personal-agent/activity") return "tasks.read";
|
|
22
|
+
if (path === "/api/personal-agent" || path.startsWith("/api/personal-agent/")) return methodScope(method, "sessions.read", "sessions.write");
|
|
21
23
|
if (path.startsWith("/api/browser/tab-bindings") || path.startsWith("/api/browser/approvals")) return methodScope(method, "sessions.read", "sessions.write");
|
|
22
24
|
if (method === "GET" && path === "/api/connectors/approvals") return "sessions.read";
|
|
23
25
|
if (method === "POST" && path === "/api/connectors/approvals/respond") return "sessions.write";
|
|
@@ -17,9 +17,9 @@ import { init_session_repository, listSessionMetadata, patchSessionMetadata } fr
|
|
|
17
17
|
import { getSessionConfig, init_config_repository } from "../storage/sqlite/config-repository.js";
|
|
18
18
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
19
19
|
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
20
|
-
import { init_agent_scope, listAgentEntries, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
21
20
|
import { init_config, resolveKnowledgeReadPolicy } from "../user-context/config.js";
|
|
22
21
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
22
|
+
import { init_agent_scope, listAgentEntries, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
23
23
|
import { init_agent_session_key, resolveAgentMainConversationId } from "../routing/agent-session-key.js";
|
|
24
24
|
import { init_session_key, resolveConversationId, sanitizeSegment } from "../routing/session-key.js";
|
|
25
25
|
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
@@ -31,7 +31,8 @@ export type PrepareXopcCloudCapabilitySetupResult = {
|
|
|
31
31
|
};
|
|
32
32
|
export type ApplyXopcCloudCapabilitySetupResult = {
|
|
33
33
|
configured: true;
|
|
34
|
-
selection: XopcCloudCapabilitySelection
|
|
34
|
+
selection: Partial<XopcCloudCapabilitySelection>;
|
|
35
|
+
missing: CloudCapability[];
|
|
35
36
|
} | {
|
|
36
37
|
configured: false;
|
|
37
38
|
error: string;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
2
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
3
2
|
import { getModelCatalogStore, init_model_catalog_store } from "../providers/model-catalog-store.js";
|
|
3
|
+
import { getAvailableModels, init_providers } from "../providers/index.js";
|
|
4
4
|
import { compareCatalogModels } from "../providers/model-catalog-ranking.js";
|
|
5
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
5
6
|
import { prepareUpdateGlobalDefaults } from "./global-defaults-admin.js";
|
|
6
7
|
//#region src/gateway/xopc-cloud-capability-setup.ts
|
|
7
8
|
init_repository();
|
|
8
9
|
init_model_catalog_store();
|
|
10
|
+
init_providers();
|
|
9
11
|
function supportsCapability(model, capability) {
|
|
10
12
|
if (model.availability !== "available") return false;
|
|
11
13
|
if (capability === "chat") return model.kind === "language" && (model.operations.includes("chat.completions") || model.operations.includes("responses"));
|
|
@@ -24,7 +26,7 @@ function recommendedVoiceModel(source, mode) {
|
|
|
24
26
|
}
|
|
25
27
|
function selectedVoice(model) {
|
|
26
28
|
const voices = model.voice?.voices ?? [];
|
|
27
|
-
return voices.find((voice) => voice.id === model.voice?.defaultVoice)?.id ?? voices[0].id;
|
|
29
|
+
return voices.find((voice) => voice.id === "Cherry")?.id ?? voices.find((voice) => voice.id === model.voice?.defaultVoice)?.id ?? voices[0].id;
|
|
28
30
|
}
|
|
29
31
|
function selectXopcCloudCapabilities(source) {
|
|
30
32
|
const chat = recommendedModel(source, "chat");
|
|
@@ -177,21 +179,115 @@ async function applyXopcCloudCapabilitySetup(service) {
|
|
|
177
179
|
configured: false,
|
|
178
180
|
error: "XOPC Cloud model catalog is unavailable"
|
|
179
181
|
};
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
+
const selection = selectXopcCloudCapabilities(source);
|
|
183
|
+
const currentDefaults = new AgentCatalogRepository().getSettings().defaults;
|
|
184
|
+
const availableModels = new Set((await getAvailableModels()).map((model) => `${model.provider}/${model.id}`));
|
|
185
|
+
const nextDefaults = structuredClone(currentDefaults);
|
|
186
|
+
const nextConfig = structuredClone(service.currentConfig);
|
|
187
|
+
const chat = recommendedModel(source, "chat");
|
|
188
|
+
const vision = recommendedModel(source, "vision");
|
|
189
|
+
const imageGeneration = recommendedModel(source, "image-generation");
|
|
190
|
+
const stt = recommendedModel(source, "stt");
|
|
191
|
+
const tts = recommendedModel(source, "tts");
|
|
192
|
+
const realtimeStt = recommendedVoiceModel(source, "transcription.stream");
|
|
193
|
+
const realtimeTts = recommendedVoiceModel(source, "speech.stream");
|
|
194
|
+
const realtimeOmni = recommendedVoiceModel(source, "conversation");
|
|
195
|
+
if (chat && !availableModels.has(currentDefaults.models.chat.primary)) nextDefaults.models.chat = {
|
|
196
|
+
primary: `xopc-cloud/${chat.id}`,
|
|
197
|
+
fallbacks: []
|
|
198
|
+
};
|
|
199
|
+
if (vision && !currentDefaults.models.imageUnderstanding) nextDefaults.models.imageUnderstanding = {
|
|
200
|
+
primary: `xopc-cloud/${vision.id}`,
|
|
201
|
+
fallbacks: []
|
|
202
|
+
};
|
|
203
|
+
if (imageGeneration && !currentDefaults.models.imageGeneration) nextDefaults.models.imageGeneration = {
|
|
204
|
+
primary: `xopc-cloud/${imageGeneration.id}`,
|
|
205
|
+
fallbacks: [],
|
|
206
|
+
autoProviderFallback: false
|
|
207
|
+
};
|
|
208
|
+
if (stt && !nextConfig.tools?.media?.audio) {
|
|
209
|
+
nextConfig.tools ??= {};
|
|
210
|
+
nextConfig.tools.media ??= {};
|
|
211
|
+
nextConfig.tools.media.audio = {
|
|
212
|
+
enabled: true,
|
|
213
|
+
provider: "xopc-cloud",
|
|
214
|
+
fallback: {
|
|
215
|
+
enabled: false,
|
|
216
|
+
order: ["xopc-cloud"]
|
|
217
|
+
},
|
|
218
|
+
providers: { "xopc-cloud": { model: stt.id } }
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
if (tts && tts.tts?.defaultVoice && !nextConfig.messages?.tts) {
|
|
222
|
+
nextConfig.messages ??= {};
|
|
223
|
+
nextConfig.messages.tts = {
|
|
224
|
+
enabled: true,
|
|
225
|
+
provider: "xopc-cloud",
|
|
226
|
+
trigger: "off",
|
|
227
|
+
maxTextLength: 512,
|
|
228
|
+
timeoutMs: 6e4,
|
|
229
|
+
providers: { "xopc-cloud": {
|
|
230
|
+
model: tts.id,
|
|
231
|
+
voice: tts.tts.defaultVoice
|
|
232
|
+
} }
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
const realtime = nextConfig.voice?.realtime;
|
|
236
|
+
if (realtime?.enabled) {
|
|
237
|
+
if (realtimeStt && !realtime.stt) realtime.stt = {
|
|
238
|
+
provider: "xopc-cloud",
|
|
239
|
+
model: realtimeStt.id
|
|
240
|
+
};
|
|
241
|
+
if (realtimeTts && !realtime.tts) realtime.tts = {
|
|
242
|
+
provider: "xopc-cloud",
|
|
243
|
+
model: realtimeTts.id,
|
|
244
|
+
voice: selectedVoice(realtimeTts)
|
|
245
|
+
};
|
|
246
|
+
if (realtimeOmni && !realtime.omni) realtime.omni = {
|
|
247
|
+
provider: "xopc-cloud",
|
|
248
|
+
model: realtimeOmni.id,
|
|
249
|
+
voice: selectedVoice(realtimeOmni),
|
|
250
|
+
instructions: "Keep replies conversational and concise. You cannot execute tools."
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
if (!chat && !vision && !imageGeneration && !stt && !tts && !realtimeStt && !realtimeTts && !realtimeOmni) return {
|
|
182
254
|
configured: false,
|
|
183
|
-
error:
|
|
184
|
-
missing:
|
|
255
|
+
error: "XOPC Cloud published no usable models",
|
|
256
|
+
missing: selection.missing
|
|
185
257
|
};
|
|
186
|
-
const
|
|
258
|
+
const defaultsUpdate = prepareUpdateGlobalDefaults({ defaults: nextDefaults });
|
|
259
|
+
if (defaultsUpdate.ok === false) return {
|
|
260
|
+
configured: false,
|
|
261
|
+
error: defaultsUpdate.error
|
|
262
|
+
};
|
|
263
|
+
const saved = await service.saveConfig(nextConfig);
|
|
187
264
|
if (!saved.saved) return {
|
|
188
265
|
configured: false,
|
|
189
266
|
error: saved.error ?? "Failed to save XOPC Cloud capability configuration"
|
|
190
267
|
};
|
|
191
|
-
new AgentCatalogService().updateDefaults(
|
|
268
|
+
new AgentCatalogService().updateDefaults(defaultsUpdate.data.defaults);
|
|
192
269
|
return {
|
|
193
270
|
configured: true,
|
|
194
|
-
|
|
271
|
+
missing: selection.missing,
|
|
272
|
+
selection: {
|
|
273
|
+
...chat ? { chat: chat.id } : {},
|
|
274
|
+
...vision ? { vision: vision.id } : {},
|
|
275
|
+
...imageGeneration ? { imageGeneration: imageGeneration.id } : {},
|
|
276
|
+
...stt ? { stt: stt.id } : {},
|
|
277
|
+
...tts ? {
|
|
278
|
+
tts: tts.id,
|
|
279
|
+
ttsVoice: tts.tts?.defaultVoice
|
|
280
|
+
} : {},
|
|
281
|
+
...realtimeStt ? { realtimeStt: realtimeStt.id } : {},
|
|
282
|
+
...realtimeTts ? { realtimeTts: {
|
|
283
|
+
model: realtimeTts.id,
|
|
284
|
+
voice: selectedVoice(realtimeTts)
|
|
285
|
+
} } : {},
|
|
286
|
+
...realtimeOmni ? { realtimeOmni: {
|
|
287
|
+
model: realtimeOmni.id,
|
|
288
|
+
voice: selectedVoice(realtimeOmni)
|
|
289
|
+
} } : {}
|
|
290
|
+
}
|
|
195
291
|
};
|
|
196
292
|
}
|
|
197
293
|
//#endregion
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { init_paths_state, resolveStateDir } from "../config/paths-state.js";
|
|
2
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { readFile } from "node:fs/promises";
|
|
5
|
+
//#region src/gateway/xopc-cloud-onboarding.ts
|
|
6
|
+
init_paths_state();
|
|
7
|
+
init_write_file_atomic();
|
|
8
|
+
function statePath() {
|
|
9
|
+
return join(resolveStateDir(), "xopc-cloud-onboarding.json");
|
|
10
|
+
}
|
|
11
|
+
async function getXopcCloudOnboardingStatus() {
|
|
12
|
+
try {
|
|
13
|
+
const parsed = JSON.parse(await readFile(statePath(), "utf8"));
|
|
14
|
+
return parsed && typeof parsed === "object" && "status" in parsed && parsed.status === "dismissed" ? "dismissed" : "unseen";
|
|
15
|
+
} catch (error) {
|
|
16
|
+
if (error.code === "ENOENT") return "unseen";
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function dismissXopcCloudOnboarding() {
|
|
21
|
+
await writeTextAtomic(statePath(), JSON.stringify({
|
|
22
|
+
version: 1,
|
|
23
|
+
status: "dismissed"
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { dismissXopcCloudOnboarding, getXopcCloudOnboardingStatus };
|
|
@@ -5,10 +5,10 @@ import { currentOperationId, init_operation_context } from "../infra/operation-c
|
|
|
5
5
|
import { afterSqliteCommit, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
6
6
|
import { ExtensionCapabilityBindingsSchema, extensionCapabilityPermissions } from "../../packages/gateway-contract/src/extension-capabilities.js";
|
|
7
7
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
8
|
-
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
9
8
|
import { init_paths, resolveExtensionsDir } from "../config/paths.js";
|
|
10
9
|
import { LocalAppStore } from "./store.js";
|
|
11
10
|
import { slugifyProjectName } from "../projects/project-store.js";
|
|
11
|
+
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
12
12
|
import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
|
|
13
13
|
import { validateLocalAppCapabilityContracts } from "./capabilities/contracts.js";
|
|
14
14
|
import { buildLocalAppFixGuidance } from "./fix-guidance.js";
|