@xopcai/xopc 0.0.231 → 0.0.232
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 +1 -0
- package/README.zh-CN.md +1 -0
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/schema/config-schema.d.ts +3 -3
- package/dist/extensions/telegram/src/config-schema.d.ts +4 -4
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/config-schema.d.ts +3 -3
- package/dist/gateway/static/root/assets/{activity-store-M0nAY5XB.js → activity-store-VXCWz43N.js} +1 -1
- package/dist/gateway/static/root/assets/agent-avatar-dicebear-BXRaZYW8.js +1 -0
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-dR7HMaRX.js +1 -0
- package/dist/gateway/static/root/assets/agents-Bileycwe.js +1 -0
- package/dist/gateway/static/root/assets/api-wGPgL8xY.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DP7YVRPn.js → app-management-settings-panel-BJfClfPx.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CVQ5n7y6.js → appearance-settings-C_R0vUAu.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DSCia0DT.js → apps-page-CBow8pBI.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-7_DXaMTP.js → archive-plugin-DnFHkSHE.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-mmr_mHRr.js → attachment-load-DZrEwytM.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DfY-T6Ga.js → automations-page-DpkKajui.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BBntVWgv.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CO9QMEh2.js → binary-plugins-Ckc_Csue.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CE14CVOy.js → block-editor-DAC6w-iV.js} +4 -4
- package/dist/gateway/static/root/assets/browser-settings-page-DrsMd-Po.js +8 -0
- package/dist/gateway/static/root/assets/browser-workflow-inputs-BGd7R8GO.js +1 -0
- package/dist/gateway/static/root/assets/{browser-workflows-page-1wgXyoSO.js → browser-workflows-page-DUfj7ntM.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-97gkGeSV.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-CuBsz8UI.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-C5ABr73b.js → channels-status-swr-CfboECLt.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CdRW6Euc.js → chat-terminal-dock-CA9fndbZ.js} +2 -2
- package/dist/gateway/static/root/assets/{code-editor-dFzqyDXS.js → code-editor-D4_k-6QN.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-SuL7td7Z.js +2 -0
- package/dist/gateway/static/root/assets/cron-expression-CqPu7HYJ.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-C8dJsCgk.js +1 -0
- package/dist/gateway/static/root/assets/dependency-picker-Iz2wYimy.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-CMO-J3cG.js → desktop-pet-C3h40FmG.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-MmOR4A3u.js → desktop-pet-settings-YfeVVzLe.js} +1 -1
- package/dist/gateway/static/root/assets/dist-DqPZM2MH2.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-DdH0dG2_.js → extension-debug-page-CChgztz_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Clg-KktN.js → extension-page-DF6ct6_y.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-jgBsjn0F.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-api-DEHnF4Wm.js → gateway-config-api-CVajuIGL.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-config-swr-BGQn8duh.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-BbssNGid.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-B_zrtccP.js → gateway-startup-retry-D2Rnh9fX.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-CJtXu8iD.js +1 -0
- package/dist/gateway/static/root/assets/home-page-Be1o1AXQ.js +1 -0
- package/dist/gateway/static/root/assets/html-workspace-editor-C3DKAkMc.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-YKP2me5Z.js → image-generation-api-D7W2p5_8.js} +1 -1
- package/dist/gateway/static/root/assets/index-B2OJSXX9.js +70 -0
- package/dist/gateway/static/root/assets/index-rHjAElxG.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BvpEeHnm.js → keyboard-shortcuts-settings-BvHYyNus.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-COfelgk7.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-Bzvn99eH.js → local-apps-page-Cb8t2wWM.js} +1 -1
- package/dist/gateway/static/root/assets/locale-store-DLwVxS3V.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-DA8oDjeB.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-B8Jie4-J.js +1 -0
- package/dist/gateway/static/root/assets/markdown-editor-nDLmA_LF.js +2 -0
- package/dist/gateway/static/root/assets/markdown-split-BD1r4o2i.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-RxNHwlNo.js → markdown-view-B-BHEcNd.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-D8I7OGnT.js → media-plugins-BCev8fkW.js} +1 -1
- package/dist/gateway/static/root/assets/messages-Dp1OxSKt.js +3 -0
- package/dist/gateway/static/root/assets/mobile-device-api-DACoHhhk.js +1 -0
- package/dist/gateway/static/root/assets/{models-hub-cache-0RjEwafI.js → models-hub-cache-C8zjqmIv.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-api-EpgG-OQc.js → notes-api-DEdNKw0I.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CCvjGMhN.js → notes-page-BBTLjJwa.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DICgUGPv.js +4 -0
- package/dist/gateway/static/root/assets/{oauth-api-BwNLwbI8.js → oauth-api-BNCO2YK5.js} +1 -1
- package/dist/gateway/static/root/assets/popover-select-3E24E65N.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-MmMswmOU.js → product-open-page-fEBbRekH.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CqdkznYJ.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-dHDXpMCg.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BFZrVYfy.js → registry-api-Cvr4Qm7N.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-2feZudJw.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Dx6o7sLu.js → runtime-tools-settings-panel-BT5B74IH.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-Cdd9c4vt.js → schema-form-C4tB34S5.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CO2JCFdy.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DxMVaqdn.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-D0YxMnhm.js → settings-form-section-D1oXhkgI.js} +1 -1
- package/dist/gateway/static/root/assets/settings-loading-skeleton-CldfX6FJ.js +1 -0
- package/dist/gateway/static/root/assets/settings-page-c3LJnbvE.js +1 -0
- package/dist/gateway/static/root/assets/settings-shell-layer-context-DCp6ykjQ.js +1 -0
- package/dist/gateway/static/root/assets/setup-status-panel-DZNHb6A5.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DiqBn-oE.js → share-preview-page-DptCK_mk.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DakZ2AGN.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-BOiNkWJC.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-CZwhWiRl.js → skills-page-OHBeBtSg.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-kBGr8opZ.js → skills-page.utils-B9WZbOLC.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CPBs6lWi.js → system-settings-panel-Dj_DpOGw.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-D5Nbe3C8.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-Qgvo0Ga7.js → theme-store-Cpd3Gd5R.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-C4YcEiP9.js → use-autosave-DCl5Yq7N.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-CAPSUK8B.js +1 -0
- package/dist/gateway/static/root/assets/{vendor-codemirror-DRr7hFaD.js → vendor-codemirror--gTq3YAI.js} +16 -16
- package/dist/gateway/static/root/assets/voice-api-key-field-BB_ZQV8F.js +1 -0
- package/dist/gateway/static/root/assets/voice-config-api-BNiYmpl5.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CKIdPEen.js → work-discovery-overlay-BrIdtdum.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BK44Vm5W.js → workflow-run-setup-panel-hKh-uCLo.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-ahDvypGO.js +5 -0
- package/dist/gateway/static/root/index.html +16 -16
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +1 -2
- package/dist/src/agent/agent-manager.js +29 -44
- package/dist/src/agent/background-review/run-background-review.js +10 -15
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/external-tools/mcp-provider.js +3 -13
- package/dist/src/agent/image/generation/runtime.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +13 -14
- package/dist/src/agent/mcp/bundle-mcp-policy.d.ts +0 -9
- package/dist/src/agent/mcp/bundle-mcp-policy.js +1 -13
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/agent/media-generation/runtime-shared.d.ts +1 -1
- package/dist/src/agent/media-generation/runtime-shared.js +1 -1
- package/dist/src/agent/memory/create-memory-manager.js +1 -1
- package/dist/src/agent/memory/manager.d.ts +1 -1
- package/dist/src/{agent-runtime/memory-runtime.d.ts → agent/memory/runtime.d.ts} +1 -1
- package/dist/src/{agent-runtime/memory-runtime.js → agent/memory/runtime.js} +2 -3
- package/dist/src/agent/orchestration/agent-orchestrator.d.ts +0 -3
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -3
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +2 -2
- package/dist/src/agent/service.js +0 -1
- package/dist/src/agent/starter-agents.js +1 -8
- package/dist/src/agent/tools/executor.d.ts +1 -1
- package/dist/src/agent/tools/workflow-tool.js +1 -5
- package/dist/src/agent-config/index.d.ts +2 -0
- package/dist/src/agent-config/index.js +11 -0
- package/dist/src/agent-config/resolver.d.ts +11 -0
- package/dist/src/agent-config/resolver.js +113 -0
- package/dist/src/agent-config/schema.d.ts +491 -0
- package/dist/src/agent-config/schema.js +172 -0
- package/dist/src/chat-commands/builtins/config.js +2 -2
- package/dist/src/chat-commands/builtins/review.js +1 -1
- package/dist/src/chat-commands/config-paths.js +1 -1
- package/dist/src/cli/commands/agents.js +2 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +12 -4
- package/dist/src/cli/commands/image.js +3 -4
- package/dist/src/cli/commands/models.js +9 -3
- package/dist/src/cli/commands/onboard/model.js +12 -11
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/tunnel.js +3 -18
- package/dist/src/cli/utils/init-workspace-core.d.ts +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/commands/agents.config.d.ts +1 -3
- package/dist/src/commands/agents.config.js +9 -26
- package/dist/src/config/agent-model-intents.d.ts +10 -0
- package/dist/src/config/agent-model-intents.js +39 -0
- package/dist/src/config/agent-profile.d.ts +7 -9
- package/dist/src/config/agent-profile.js +30 -28
- package/dist/src/config/default-model.d.ts +1 -11
- package/dist/src/config/default-model.js +3 -11
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/integration.d.ts +1 -1
- package/dist/src/config/reload.js +1 -1
- package/dist/src/config/rules.js +3 -3
- package/dist/src/config/schema.d.ts +187 -452
- package/dist/src/config/schema.js +53 -131
- package/dist/src/extensions/activation-context.js +7 -11
- package/dist/src/gateway/agent-builtin-tools.d.ts +250 -6
- package/dist/src/gateway/agent-builtin-tools.js +284 -46
- package/dist/src/gateway/agents-admin.d.ts +20 -62
- package/dist/src/gateway/agents-admin.js +36 -228
- package/dist/src/gateway/device-routes.d.ts +3 -0
- package/dist/src/gateway/device-routes.js +47 -0
- package/dist/src/gateway/global-defaults-admin.d.ts +6 -20
- package/dist/src/gateway/global-defaults-admin.js +20 -120
- package/dist/src/gateway/hono/app.js +4 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +54 -137
- package/dist/src/gateway/hono/lib/config-payload.js +2 -4
- package/dist/src/gateway/hono/middleware/auth.js +33 -1
- package/dist/src/gateway/hono/middleware/scopes.d.ts +2 -12
- package/dist/src/gateway/hono/middleware/scopes.js +9 -18
- package/dist/src/gateway/hono/routes/agents.js +64 -100
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/device-push.d.ts +2 -0
- package/dist/src/gateway/hono/routes/{mobile.js → device-push.js} +40 -18
- package/dist/src/gateway/hono/routes/devices.d.ts +4 -0
- package/dist/src/gateway/hono/routes/devices.js +214 -0
- package/dist/src/gateway/hono/routes/files.js +5 -1
- package/dist/src/gateway/hono/routes/global-defaults.js +5 -9
- package/dist/src/gateway/hono/routes/index.js +4 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +4 -20
- package/dist/src/gateway/hono/routes/models.js +2 -2
- package/dist/src/gateway/hono/routes/realtime.js +8 -1
- package/dist/src/gateway/hono/routes/status.js +9 -16
- package/dist/src/gateway/hono/routes/tunnel.d.ts +0 -2
- package/dist/src/gateway/hono/routes/tunnel.js +10 -199
- package/dist/src/gateway/image-generation-setup.d.ts +2 -2
- package/dist/src/gateway/image-generation-setup.js +8 -7
- package/dist/src/gateway/public-url.d.ts +1 -1
- package/dist/src/gateway/security/gateway-principal.d.ts +11 -0
- package/dist/src/gateway/security/gateway-principal.js +12 -0
- package/dist/src/gateway/security/gateway-scopes.d.ts +7 -0
- package/dist/src/gateway/security/gateway-scopes.js +66 -0
- package/dist/src/gateway/security/index.d.ts +2 -1
- package/dist/src/gateway/security/index.js +3 -2
- package/dist/src/gateway/service.js +7 -7
- package/dist/src/gateway/xopc-cloud-capability-setup.js +19 -21
- package/dist/src/migrations/index.d.ts +0 -1
- package/dist/src/migrations/index.js +1 -2
- package/dist/src/migrations/runner.js +1 -2
- package/dist/src/notifications/device-store.d.ts +1 -1
- package/dist/src/notifications/device-store.js +11 -11
- package/dist/src/notifications/store.js +3 -3
- package/dist/src/providers/index.js +1 -1
- package/dist/src/providers/model-reference-auditor.js +14 -9
- package/dist/src/realtime/runtime.d.ts +2 -0
- package/dist/src/realtime/runtime.js +27 -3
- package/dist/src/realtime/tickets.d.ts +6 -1
- package/dist/src/realtime/tickets.js +2 -1
- package/dist/src/remote-access/exposure-manager.js +3 -3
- package/dist/src/share/share-url.js +2 -2
- package/dist/src/storage/sqlite/device-access-repository.d.ts +54 -0
- package/dist/src/storage/sqlite/device-access-repository.js +194 -0
- package/dist/src/storage/sqlite/device-pairing-repository.d.ts +22 -0
- package/dist/src/storage/sqlite/device-pairing-repository.js +86 -0
- package/dist/src/storage/sqlite/gateway-identity-repository.d.ts +10 -0
- package/dist/src/storage/sqlite/gateway-identity-repository.js +50 -0
- package/dist/src/storage/sqlite/index.d.ts +3 -0
- package/dist/src/storage/sqlite/index.js +4 -1
- package/dist/src/storage/sqlite/migrations/138_device_access.sql +96 -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/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tunnel/consent.d.ts +1 -1
- package/dist/src/tunnel/consent.js +1 -1
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/tunnel/index.d.ts +1 -4
- package/dist/src/tunnel/index.js +3 -5
- package/dist/src/tunnel/tunnel-audit.d.ts +1 -1
- package/dist/src/tunnel/tunnel-config.js +1 -1
- package/dist/src/tunnel/tunnel-service.d.ts +2 -3
- package/dist/src/tunnel/tunnel-service.js +1 -20
- package/dist/src/tunnel/tunnel-types.d.ts +0 -6
- package/dist/src/workflows/draft/workflow-draft-service.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.js +3 -3
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-avatar-dicebear-CBqUnlvL.js +0 -1
- package/dist/gateway/static/root/assets/agents-7YO6znTT.js +0 -68
- package/dist/gateway/static/root/assets/api-BywYxpaS.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-BpvD54D6.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CeESA4Oj.js +0 -8
- package/dist/gateway/static/root/assets/browser-workflow-inputs-8NC2qDRF.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-B_OXTojB.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-api-o0y9WgAI.js +0 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-D5nZecxV.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-BzmnWx6X.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-38FsOnR0.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DX6OkwFQ.js +0 -2
- package/dist/gateway/static/root/assets/cron-expression-DYSMZsms.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-DGCfX4tK.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-DHDa4ht1.js +0 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-B9qoxDcn.js +0 -1
- package/dist/gateway/static/root/assets/dist-J_ySZvz0.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-eP3fJ2M6.js +0 -1
- package/dist/gateway/static/root/assets/file-code-corner-byQA1VfD.js +0 -1
- package/dist/gateway/static/root/assets/gateway-config-swr-BWGjnmDl.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-DKkEXXj9.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-DlBPNubY.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BnOrLRfs.js +0 -1
- package/dist/gateway/static/root/assets/html-workspace-editor-bXK5tq64.js +0 -1
- package/dist/gateway/static/root/assets/index-0xQO5B_Q.js +0 -70
- package/dist/gateway/static/root/assets/index-CCyIdGuQ.css +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-Ch1rdUo8.js +0 -2
- package/dist/gateway/static/root/assets/locale-store-CXhjfe4q.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-zxx2ExlY.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-BQaeyOYm.js +0 -1
- package/dist/gateway/static/root/assets/markdown-editor-TWGaF7Xa.js +0 -2
- package/dist/gateway/static/root/assets/markdown-split-D9tmIiEm.js +0 -1
- package/dist/gateway/static/root/assets/messages-BMdD0LWk.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-9cgh77VH.js +0 -4
- package/dist/gateway/static/root/assets/popover-select-CccGri5Y.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-hf6pmH4p.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-By2U-Wdh.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CUcpp7CQ.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-ByI82xS1.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BCoI5IJ8.js +0 -1
- package/dist/gateway/static/root/assets/settings-loading-skeleton-y53gEKsF.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-BoE_tToG.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BQmyb5KC.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-Bf3VpZ-R.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CXHlbuGS.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-Bo0KSZ2v.js +0 -1
- package/dist/gateway/static/root/assets/typed-models-lib-q5-Vfqd8.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-Cnj7gMX2.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-BML8zCwZ.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-CB98MTwG.js +0 -5
- package/dist/src/agent-manifest/index.d.ts +0 -5
- package/dist/src/agent-manifest/index.js +0 -10
- package/dist/src/agent-manifest/preset-chain.d.ts +0 -10
- package/dist/src/agent-manifest/preset-chain.js +0 -30
- package/dist/src/agent-manifest/prompt.d.ts +0 -2
- package/dist/src/agent-manifest/prompt.js +0 -49
- package/dist/src/agent-manifest/resolver.d.ts +0 -32
- package/dist/src/agent-manifest/resolver.js +0 -114
- package/dist/src/agent-manifest/schema.d.ts +0 -695
- package/dist/src/agent-manifest/schema.js +0 -226
- package/dist/src/agent-manifest/validator.d.ts +0 -25
- package/dist/src/agent-manifest/validator.js +0 -74
- package/dist/src/agent-runtime/boundary-guard.d.ts +0 -12
- package/dist/src/agent-runtime/boundary-guard.js +0 -21
- package/dist/src/agent-runtime/index.d.ts +0 -7
- package/dist/src/agent-runtime/index.js +0 -8
- package/dist/src/agent-runtime/model-router.d.ts +0 -11
- package/dist/src/agent-runtime/model-router.js +0 -14
- package/dist/src/agent-runtime/run-trace.d.ts +0 -27
- package/dist/src/agent-runtime/run-trace.js +0 -51
- package/dist/src/agent-runtime/runtime-profile.d.ts +0 -26
- package/dist/src/agent-runtime/runtime-profile.js +0 -42
- package/dist/src/agent-runtime/tool-registry.d.ts +0 -28
- package/dist/src/agent-runtime/tool-registry.js +0 -50
- package/dist/src/agent-runtime/workflow-runtime.d.ts +0 -31
- package/dist/src/agent-runtime/workflow-runtime.js +0 -32
- package/dist/src/config/agent-typed-models.d.ts +0 -13
- package/dist/src/config/agent-typed-models.js +0 -48
- package/dist/src/gateway/capability-presets-admin.d.ts +0 -88
- package/dist/src/gateway/capability-presets-admin.js +0 -303
- package/dist/src/gateway/hono/lib/agent-model.d.ts +0 -35
- package/dist/src/gateway/hono/lib/agent-model.js +0 -97
- package/dist/src/gateway/hono/routes/capability-presets.d.ts +0 -3
- package/dist/src/gateway/hono/routes/capability-presets.js +0 -187
- package/dist/src/gateway/hono/routes/mobile.d.ts +0 -3
- package/dist/src/gateway/security/operator-scopes.d.ts +0 -37
- package/dist/src/gateway/security/operator-scopes.js +0 -147
- package/dist/src/migrations/config/default-capability-preset.d.ts +0 -10
- package/dist/src/migrations/config/default-capability-preset.js +0 -133
- package/dist/src/tunnel/enable-lan-pairing.d.ts +0 -8
- package/dist/src/tunnel/enable-lan-pairing.js +0 -41
- package/dist/src/tunnel/pair-context.d.ts +0 -36
- package/dist/src/tunnel/pair-context.js +0 -77
- package/dist/src/tunnel/pair-url.d.ts +0 -43
- package/dist/src/tunnel/pair-url.js +0 -117
- package/dist/src/tunnel/pairing-rate-limit.d.ts +0 -12
- package/dist/src/tunnel/pairing-rate-limit.js +0 -28
- package/dist/src/tunnel/pairing.d.ts +0 -21
- package/dist/src/tunnel/pairing.js +0 -103
- package/dist/src/tunnel/tunnel-qr.d.ts +0 -9
- package/dist/src/tunnel/tunnel-qr.js +0 -29
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/agent-config/schema.ts
|
|
4
|
+
var DEFAULT_AGENT_MODEL_REF, AgentIdSchema, ModelRefSchema, ModelRouteSchema, ImageGenerationRouteSchema, ModelIntentSchema, ModelIntentRoutesSchema, ModelIntentOverridesSchema, AgentModelsDefaultsSchema, AgentModelsOverrideSchema, ToolModeSchema, ToolPolicySchema, ToolPoliciesSchema, SkillDefaultsSchema, SkillOverrideSchema, WorkflowPolicySchema, RuntimePolicySchema, AgentDefaultsSchema, AgentProfileSchema, AgentEntrySchema, AgentsConfigSchema, EffectiveAgentConfigSchema;
|
|
5
|
+
var init_schema = __esmMin((() => {
|
|
6
|
+
DEFAULT_AGENT_MODEL_REF = "deepseek/deepseek-v4-flash";
|
|
7
|
+
AgentIdSchema = z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/);
|
|
8
|
+
ModelRefSchema = z.string().trim().min(1).refine((value) => {
|
|
9
|
+
const separator = value.indexOf("/");
|
|
10
|
+
return separator > 0 && separator < value.length - 1;
|
|
11
|
+
}, "model must use provider/model format");
|
|
12
|
+
ModelRouteSchema = z.object({
|
|
13
|
+
primary: ModelRefSchema,
|
|
14
|
+
fallbacks: z.array(ModelRefSchema).default([])
|
|
15
|
+
}).strict();
|
|
16
|
+
ImageGenerationRouteSchema = ModelRouteSchema.extend({
|
|
17
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
18
|
+
autoProviderFallback: z.boolean().default(false)
|
|
19
|
+
}).strict();
|
|
20
|
+
ModelIntentSchema = z.enum([
|
|
21
|
+
"fast",
|
|
22
|
+
"reasoning",
|
|
23
|
+
"coding",
|
|
24
|
+
"review",
|
|
25
|
+
"vision",
|
|
26
|
+
"understanding"
|
|
27
|
+
]);
|
|
28
|
+
ModelIntentRoutesSchema = z.partialRecord(ModelIntentSchema, ModelRouteSchema);
|
|
29
|
+
ModelIntentOverridesSchema = z.partialRecord(ModelIntentSchema, ModelRouteSchema.nullable());
|
|
30
|
+
AgentModelsDefaultsSchema = z.object({
|
|
31
|
+
chat: ModelRouteSchema,
|
|
32
|
+
intents: ModelIntentRoutesSchema.default({}),
|
|
33
|
+
imageUnderstanding: ModelRouteSchema.optional(),
|
|
34
|
+
imageGeneration: ImageGenerationRouteSchema.optional()
|
|
35
|
+
}).strict();
|
|
36
|
+
AgentModelsOverrideSchema = z.object({
|
|
37
|
+
chat: ModelRouteSchema.optional(),
|
|
38
|
+
intents: ModelIntentOverridesSchema.optional(),
|
|
39
|
+
imageUnderstanding: ModelRouteSchema.nullable().optional(),
|
|
40
|
+
imageGeneration: ImageGenerationRouteSchema.nullable().optional()
|
|
41
|
+
}).strict();
|
|
42
|
+
ToolModeSchema = z.enum([
|
|
43
|
+
"allow",
|
|
44
|
+
"ask",
|
|
45
|
+
"deny"
|
|
46
|
+
]);
|
|
47
|
+
ToolPolicySchema = z.object({
|
|
48
|
+
mode: ToolModeSchema,
|
|
49
|
+
maxCallsPerTurn: z.number().int().positive().optional(),
|
|
50
|
+
timeoutMs: z.number().int().positive().optional()
|
|
51
|
+
}).strict();
|
|
52
|
+
ToolPoliciesSchema = z.record(z.string().min(1), ToolPolicySchema);
|
|
53
|
+
SkillDefaultsSchema = z.discriminatedUnion("mode", [z.object({
|
|
54
|
+
mode: z.literal("all-enabled"),
|
|
55
|
+
exclude: z.array(z.string().min(1)).default([])
|
|
56
|
+
}).strict(), z.object({
|
|
57
|
+
mode: z.literal("selected"),
|
|
58
|
+
include: z.array(z.string().min(1)).default([])
|
|
59
|
+
}).strict()]);
|
|
60
|
+
SkillOverrideSchema = z.discriminatedUnion("mode", [z.object({
|
|
61
|
+
mode: z.literal("merge"),
|
|
62
|
+
add: z.array(z.string().min(1)).default([]),
|
|
63
|
+
remove: z.array(z.string().min(1)).default([])
|
|
64
|
+
}).strict().superRefine((value, context) => {
|
|
65
|
+
const additions = new Set(value.add);
|
|
66
|
+
for (const skill of value.remove) if (additions.has(skill)) context.addIssue({
|
|
67
|
+
code: "custom",
|
|
68
|
+
path: ["remove"],
|
|
69
|
+
message: `skill "${skill}" cannot be both added and removed`
|
|
70
|
+
});
|
|
71
|
+
}), z.object({
|
|
72
|
+
mode: z.literal("replace"),
|
|
73
|
+
include: z.array(z.string().min(1)).default([])
|
|
74
|
+
}).strict()]);
|
|
75
|
+
WorkflowPolicySchema = z.object({
|
|
76
|
+
default: z.string().min(1).optional(),
|
|
77
|
+
allowed: z.array(z.string().min(1)).optional()
|
|
78
|
+
}).strict();
|
|
79
|
+
RuntimePolicySchema = z.object({
|
|
80
|
+
maxTurns: z.number().int().positive().optional(),
|
|
81
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
82
|
+
maxToolFailuresPerTurn: z.number().int().positive().optional(),
|
|
83
|
+
promptCache: z.object({
|
|
84
|
+
mode: z.enum(["off", "auto"]).default("auto"),
|
|
85
|
+
lifetime: z.enum(["short", "long"]).default("short")
|
|
86
|
+
}).strict().optional()
|
|
87
|
+
}).strict();
|
|
88
|
+
AgentDefaultsSchema = z.object({
|
|
89
|
+
models: AgentModelsDefaultsSchema,
|
|
90
|
+
skills: SkillDefaultsSchema.default({
|
|
91
|
+
mode: "all-enabled",
|
|
92
|
+
exclude: []
|
|
93
|
+
}),
|
|
94
|
+
tools: ToolPoliciesSchema.default({}),
|
|
95
|
+
workflows: WorkflowPolicySchema.default({}),
|
|
96
|
+
runtime: RuntimePolicySchema.default({})
|
|
97
|
+
}).strict();
|
|
98
|
+
AgentProfileSchema = z.object({
|
|
99
|
+
name: z.string().trim().min(1),
|
|
100
|
+
instructions: z.string().trim().min(1).optional()
|
|
101
|
+
}).strict();
|
|
102
|
+
AgentEntrySchema = z.object({
|
|
103
|
+
id: AgentIdSchema,
|
|
104
|
+
enabled: z.boolean().default(true),
|
|
105
|
+
workspace: z.string().trim().min(1).optional(),
|
|
106
|
+
profile: AgentProfileSchema.optional(),
|
|
107
|
+
models: AgentModelsOverrideSchema.optional(),
|
|
108
|
+
skills: SkillOverrideSchema.optional(),
|
|
109
|
+
tools: ToolPoliciesSchema.optional(),
|
|
110
|
+
workflows: WorkflowPolicySchema.optional(),
|
|
111
|
+
runtime: RuntimePolicySchema.optional()
|
|
112
|
+
}).strict();
|
|
113
|
+
AgentsConfigSchema = z.object({
|
|
114
|
+
default: AgentIdSchema.default("main"),
|
|
115
|
+
defaults: AgentDefaultsSchema.default({
|
|
116
|
+
models: {
|
|
117
|
+
chat: {
|
|
118
|
+
primary: DEFAULT_AGENT_MODEL_REF,
|
|
119
|
+
fallbacks: []
|
|
120
|
+
},
|
|
121
|
+
intents: {}
|
|
122
|
+
},
|
|
123
|
+
skills: {
|
|
124
|
+
mode: "all-enabled",
|
|
125
|
+
exclude: []
|
|
126
|
+
},
|
|
127
|
+
tools: {},
|
|
128
|
+
workflows: {},
|
|
129
|
+
runtime: {}
|
|
130
|
+
}),
|
|
131
|
+
list: z.array(AgentEntrySchema).default([{
|
|
132
|
+
id: "main",
|
|
133
|
+
enabled: true
|
|
134
|
+
}])
|
|
135
|
+
}).strict().superRefine((value, context) => {
|
|
136
|
+
const seen = /* @__PURE__ */ new Set();
|
|
137
|
+
value.list.forEach((agent, index) => {
|
|
138
|
+
if (seen.has(agent.id)) context.addIssue({
|
|
139
|
+
code: "custom",
|
|
140
|
+
path: [
|
|
141
|
+
"list",
|
|
142
|
+
index,
|
|
143
|
+
"id"
|
|
144
|
+
],
|
|
145
|
+
message: `duplicate agent id "${agent.id}"`
|
|
146
|
+
});
|
|
147
|
+
seen.add(agent.id);
|
|
148
|
+
});
|
|
149
|
+
if (!value.list.some((agent) => agent.id === value.default && agent.enabled)) context.addIssue({
|
|
150
|
+
code: "custom",
|
|
151
|
+
path: ["default"],
|
|
152
|
+
message: `default agent "${value.default}" must reference an enabled entry`
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
EffectiveAgentConfigSchema = z.object({
|
|
156
|
+
id: AgentIdSchema,
|
|
157
|
+
enabled: z.boolean(),
|
|
158
|
+
workspace: z.string().min(1),
|
|
159
|
+
profile: z.object({
|
|
160
|
+
name: z.string().min(1),
|
|
161
|
+
instructions: z.string().optional()
|
|
162
|
+
}).strict().optional(),
|
|
163
|
+
models: AgentModelsDefaultsSchema,
|
|
164
|
+
skills: SkillDefaultsSchema,
|
|
165
|
+
tools: ToolPoliciesSchema,
|
|
166
|
+
workflows: WorkflowPolicySchema,
|
|
167
|
+
runtime: RuntimePolicySchema
|
|
168
|
+
}).strict();
|
|
169
|
+
}));
|
|
170
|
+
//#endregion
|
|
171
|
+
init_schema();
|
|
172
|
+
export { AgentDefaultsSchema, AgentEntrySchema, AgentModelsDefaultsSchema, AgentModelsOverrideSchema, AgentProfileSchema, AgentsConfigSchema, DEFAULT_AGENT_MODEL_REF, EffectiveAgentConfigSchema, ImageGenerationRouteSchema, ModelIntentSchema, ModelRefSchema, ModelRouteSchema, RuntimePolicySchema, SkillDefaultsSchema, SkillOverrideSchema, ToolModeSchema, ToolPoliciesSchema, ToolPolicySchema, WorkflowPolicySchema, init_schema };
|
|
@@ -76,7 +76,7 @@ const configCommand = {
|
|
|
76
76
|
"/config show",
|
|
77
77
|
"/config show agents.list",
|
|
78
78
|
"/config set agents.default=main",
|
|
79
|
-
"/config show agents.
|
|
79
|
+
"/config show agents.defaults",
|
|
80
80
|
"/config unset tts"
|
|
81
81
|
],
|
|
82
82
|
handler: async (ctx, args) => {
|
|
@@ -176,7 +176,7 @@ const configCommand = {
|
|
|
176
176
|
log.info({ path: rest }, "Config key removed via /config unset");
|
|
177
177
|
return { content: `⚙️ Config updated: \`${rest}\` removed.` };
|
|
178
178
|
}
|
|
179
|
-
return { content: "⚙️ *Config Command*\n\n`/config show [path]` — view config (or a specific path)\n`/config set path=value` — update a config value\n`/config unset path` — remove a config key\n\nExamples:\n`/config show agents.list`\n`/config set agents.default=main`\n`/config show agents.
|
|
179
|
+
return { content: "⚙️ *Config Command*\n\n`/config show [path]` — view config (or a specific path)\n`/config set path=value` — update a config value\n`/config unset path` — remove a config key\n\nExamples:\n`/config show agents.list`\n`/config set agents.default=main`\n`/config show agents.defaults`\n`/config unset tts`" };
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
182
|
function registerConfigCommand() {
|
|
@@ -136,7 +136,7 @@ async function reviewModelRef(ctx) {
|
|
|
136
136
|
if (sessionOverride) return sessionOverride;
|
|
137
137
|
try {
|
|
138
138
|
const profile = resolveEffectiveAgentProfileForSession(ctx.config, ctx.sessionKey);
|
|
139
|
-
return profile.
|
|
139
|
+
return profile.config.models.intents.review?.primary || profile.primaryModelRef;
|
|
140
140
|
} catch {
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
@@ -3,7 +3,7 @@ function parseConfigPath(raw) {
|
|
|
3
3
|
const parts = raw.trim().split(".").map((p) => p.trim());
|
|
4
4
|
if (parts.some((p) => !p)) return {
|
|
5
5
|
ok: false,
|
|
6
|
-
error: "Invalid path. Use dot notation (e.g. agents.
|
|
6
|
+
error: "Invalid path. Use dot notation (e.g. agents.defaults.models.chat.primary)."
|
|
7
7
|
};
|
|
8
8
|
return {
|
|
9
9
|
ok: true,
|
|
@@ -20,7 +20,7 @@ function registerAgentsCli(program) {
|
|
|
20
20
|
id: normalizeAgentId(a.id),
|
|
21
21
|
enabled: a.enabled !== false,
|
|
22
22
|
workspace: a.workspace,
|
|
23
|
-
model: a.models.
|
|
23
|
+
model: a.models?.chat?.primary ?? cfg.agents.defaults.models.chat.primary
|
|
24
24
|
}));
|
|
25
25
|
const def = resolveDefaultAgentId(cfg);
|
|
26
26
|
if (opts.json) {
|
|
@@ -51,6 +51,7 @@ function registerAgentsCli(program) {
|
|
|
51
51
|
const next = applyAgentConfig(cfg, {
|
|
52
52
|
agentId,
|
|
53
53
|
workspace: opts.workspace.trim(),
|
|
54
|
+
profile: { name: name.trim() },
|
|
54
55
|
...opts.model?.trim() ? { model: opts.model.trim() } : {}
|
|
55
56
|
});
|
|
56
57
|
await saveConfig(next, resolveConfigPath());
|
|
@@ -76,7 +76,7 @@ function setNestedValue(obj, path, value) {
|
|
|
76
76
|
function createConfigCommand(ctx) {
|
|
77
77
|
const cmd = new Command("config").description("View and edit configuration").option("--show", "Show full configuration (alias for `config show`)").option("--validate", "Validate configuration file (alias for `config validate`)").addHelpText("after", formatExamples([
|
|
78
78
|
"xopc config get agents.list",
|
|
79
|
-
"xopc config get agents.
|
|
79
|
+
"xopc config get agents.defaults",
|
|
80
80
|
"xopc config set agents.default main",
|
|
81
81
|
"xopc config show",
|
|
82
82
|
"xopc config validate",
|
|
@@ -52,7 +52,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
52
52
|
id: "database-schema",
|
|
53
53
|
label: "Database schema",
|
|
54
54
|
status: "pass",
|
|
55
|
-
message: `SQLite schema v${status.dbVersion} (current release
|
|
55
|
+
message: `SQLite schema v${status.dbVersion} (current release v138).`,
|
|
56
56
|
hints: []
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -14,12 +14,20 @@ function collectProviderIdsFromConfig(cfg) {
|
|
|
14
14
|
if (parsed) ids.add(parsed.provider.toLowerCase());
|
|
15
15
|
};
|
|
16
16
|
addRef(getAgentDefaultModelRef(cfg));
|
|
17
|
-
const
|
|
18
|
-
for (const
|
|
17
|
+
const addRoutes = (routes) => {
|
|
18
|
+
for (const route of Object.values(routes ?? {})) addRef(route?.primary);
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
addRef(cfg.agents.defaults.models.chat.primary);
|
|
21
|
+
addRoutes(cfg.agents.defaults.models.intents);
|
|
22
|
+
addRef(cfg.agents.defaults.models.imageUnderstanding?.primary);
|
|
23
|
+
addRef(cfg.agents.defaults.models.imageGeneration?.primary);
|
|
21
24
|
const list = cfg.agents?.list;
|
|
22
|
-
if (Array.isArray(list)) for (const e of list)
|
|
25
|
+
if (Array.isArray(list)) for (const e of list) {
|
|
26
|
+
addRef(e?.models?.chat?.primary);
|
|
27
|
+
addRoutes(e?.models?.intents);
|
|
28
|
+
addRef(e?.models?.imageUnderstanding?.primary);
|
|
29
|
+
addRef(e?.models?.imageGeneration?.primary);
|
|
30
|
+
}
|
|
23
31
|
return ids;
|
|
24
32
|
}
|
|
25
33
|
function anyProviderEnvPresent() {
|
|
@@ -4,11 +4,10 @@ import "../../agent/image/index.js";
|
|
|
4
4
|
import { Command } from "commander";
|
|
5
5
|
//#region src/cli/commands/image.ts
|
|
6
6
|
function createImageCommand(_ctx) {
|
|
7
|
-
const cmd = new Command("image").description("Inspect image provider availability").addHelpText("after", formatExamples(["xopc image providers # List available image generation providers", "xopc image status # Explain current
|
|
7
|
+
const cmd = new Command("image").description("Inspect image provider availability").addHelpText("after", formatExamples(["xopc image providers # List available image generation providers", "xopc image status # Explain current image behavior"]));
|
|
8
8
|
cmd.command("status").description("Show image runtime status").action(() => {
|
|
9
|
-
console.log("Image
|
|
10
|
-
console.log("
|
|
11
|
-
console.log("Agent-specific capability policy belongs in agent manifests or capability presets.");
|
|
9
|
+
console.log("Image understanding and generation inherit from agents.defaults.models.");
|
|
10
|
+
console.log("An agent may override either route in agents.list[].models.");
|
|
12
11
|
});
|
|
13
12
|
cmd.command("providers").description("List image generation providers").option("--json", "Output as JSON").action((opts) => {
|
|
14
13
|
const providers = listImageGenerationProvidersSummary();
|
|
@@ -47,9 +47,15 @@ function currentModelRef(config) {
|
|
|
47
47
|
return getAgentDefaultModelRef(config);
|
|
48
48
|
}
|
|
49
49
|
function setDefaultModel(config, modelRef) {
|
|
50
|
-
const prep = prepareUpdateGlobalDefaults(config, {
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
const prep = prepareUpdateGlobalDefaults(config, { defaults: {
|
|
51
|
+
...config.agents.defaults,
|
|
52
|
+
models: {
|
|
53
|
+
...config.agents.defaults.models,
|
|
54
|
+
chat: {
|
|
55
|
+
primary: modelRef,
|
|
56
|
+
fallbacks: []
|
|
57
|
+
}
|
|
58
|
+
}
|
|
53
59
|
} });
|
|
54
60
|
if (prep.ok === false) throw new Error(prep.error);
|
|
55
61
|
return prep.data.nextConfig;
|
|
@@ -5,11 +5,11 @@ import { getApiKeyFromEnv } from "../../../providers/env-keys.js";
|
|
|
5
5
|
import { getModelRegistry } from "../../../providers/model-registry.js";
|
|
6
6
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
7
7
|
import { getAllProviders, getModelsByProvider, getProviderDisplayName, init_providers, providerSupportsApiKey, providerSupportsOAuth } from "../../../providers/index.js";
|
|
8
|
-
import { getDomesticProviderBaseUrl, getDomesticProviderPreset, getDomesticProviderPresetIds, providerConfigFromDomesticPreset } from "../../../providers/domestic-presets.js";
|
|
9
|
-
import { getProviderHint, getRecommendedModelsForProvider, sortModelsForPicker, sortProvidersForPicker } from "../../../providers/presentation.js";
|
|
10
8
|
import { prepareUpdateGlobalDefaults } from "../../../gateway/global-defaults-admin.js";
|
|
11
9
|
import { discoverProviderModels, isProviderApiDiscoverable } from "../../../providers/model-discovery.js";
|
|
12
10
|
import { getXopcCloudCatalogCoordinator } from "../../../providers/xopc-cloud-catalog-coordinator.js";
|
|
11
|
+
import { getDomesticProviderBaseUrl, getDomesticProviderPreset, getDomesticProviderPresetIds, providerConfigFromDomesticPreset } from "../../../providers/domestic-presets.js";
|
|
12
|
+
import { getProviderHint, getRecommendedModelsForProvider, sortModelsForPicker, sortProvidersForPicker } from "../../../providers/presentation.js";
|
|
13
13
|
import { listProfilesForProvider } from "../../../auth/profiles/profiles.js";
|
|
14
14
|
import { getOAuthProvider } from "../../utils/oauth-providers.js";
|
|
15
15
|
import { colors } from "../../utils/colors.js";
|
|
@@ -32,7 +32,7 @@ function setPrimaryModel(config, workspacePath, modelRef) {
|
|
|
32
32
|
const nextList = [...config.agents.list];
|
|
33
33
|
nextList[index] = {
|
|
34
34
|
...agent,
|
|
35
|
-
workspace:
|
|
35
|
+
workspace: workspacePath
|
|
36
36
|
};
|
|
37
37
|
nextConfig = {
|
|
38
38
|
...config,
|
|
@@ -42,14 +42,15 @@ function setPrimaryModel(config, workspacePath, modelRef) {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
const currentModels = nextConfig.agents.defaults.models;
|
|
46
|
+
const prep = prepareUpdateGlobalDefaults(nextConfig, { defaults: {
|
|
47
|
+
...nextConfig.agents.defaults,
|
|
48
|
+
models: {
|
|
49
|
+
...currentModels,
|
|
50
|
+
chat: {
|
|
51
|
+
primary: modelRef,
|
|
52
|
+
fallbacks: []
|
|
53
|
+
}
|
|
53
54
|
}
|
|
54
55
|
} });
|
|
55
56
|
if (prep.ok === false) throw new Error(prep.error);
|
|
@@ -24,7 +24,7 @@ function printGitHubStarHint() {
|
|
|
24
24
|
}
|
|
25
25
|
async function setupNonInteractive(_configPath, existingConfig) {
|
|
26
26
|
console.log("\n🤖 AI Model Configuration (Non-Interactive Mode)\n");
|
|
27
|
-
console.log("Current agent
|
|
27
|
+
console.log("Current agent overrides:", JSON.stringify(existingConfig.agents?.list ?? [], null, 2));
|
|
28
28
|
console.log("\n💡 To configure in interactive mode, run: xopc onboard");
|
|
29
29
|
console.log("💡 Or set up manually in:", _configPath);
|
|
30
30
|
return existingConfig;
|
|
@@ -5,10 +5,10 @@ import { resolveGatewayEffectiveHost } from "../../config/gateway-bind.js";
|
|
|
5
5
|
import { loadTunnelState } from "../../tunnel/tunnel-state.js";
|
|
6
6
|
import { formatExamples, register } from "../registry.js";
|
|
7
7
|
import "../../config/index.js";
|
|
8
|
-
import { TUNNEL_RISK_SUMMARY_LINES, TunnelConsentError, assertTunnelMayStart, hasValidTunnelConsent } from "../../tunnel/consent.js";
|
|
9
|
-
import { resolveTunnelBrokerUrl, resolveTunnelRegistrationSecret } from "../../tunnel/env.js";
|
|
10
8
|
import { ensureFrpcBinary } from "../../tunnel/frpc-binary.js";
|
|
9
|
+
import { resolveTunnelBrokerUrl, resolveTunnelRegistrationSecret } from "../../tunnel/env.js";
|
|
11
10
|
import { getTunnelService } from "../../tunnel/tunnel-service.js";
|
|
11
|
+
import { TUNNEL_RISK_SUMMARY_LINES, TunnelConsentError, assertTunnelMayStart, hasValidTunnelConsent } from "../../tunnel/consent.js";
|
|
12
12
|
import { resolveFrpSubdomainHost } from "../../tunnel/frp-subdomain-host.js";
|
|
13
13
|
import { applyTunnelConsentToConfig, mergeTunnelConfigPatch, setTunnelEnabledInConfig } from "../../tunnel/tunnel-config.js";
|
|
14
14
|
import "../../tunnel/index.js";
|
|
@@ -99,7 +99,6 @@ function createTunnelCommand(ctx) {
|
|
|
99
99
|
"xopc tunnel start --accept-risk",
|
|
100
100
|
"xopc tunnel stop",
|
|
101
101
|
"xopc tunnel status",
|
|
102
|
-
"xopc tunnel qr",
|
|
103
102
|
"xopc tunnel consent",
|
|
104
103
|
"xopc tunnel prefetch",
|
|
105
104
|
"xopc tunnel secret set",
|
|
@@ -161,17 +160,13 @@ function createTunnelCommand(ctx) {
|
|
|
161
160
|
const tunnel = getTunnelService();
|
|
162
161
|
console.log("🚀 Starting tunnel...");
|
|
163
162
|
try {
|
|
164
|
-
|
|
163
|
+
await tunnel.start(port, token);
|
|
165
164
|
setTunnelEnabledInConfig(config, true);
|
|
166
165
|
await saveConfig(config, ctx.configPath);
|
|
167
166
|
const status = tunnel.getStatus();
|
|
168
167
|
console.log("");
|
|
169
168
|
console.log("✅ Tunnel is active");
|
|
170
169
|
if (status.publicUrl) console.log(` URL: ${status.publicUrl}`);
|
|
171
|
-
if (qr.lanUrl) console.log(` LAN: ${qr.lanUrl}`);
|
|
172
|
-
console.log("");
|
|
173
|
-
console.log("📱 Mobile connect QR payload:");
|
|
174
|
-
console.log(qr.qrPayload);
|
|
175
170
|
console.log("");
|
|
176
171
|
console.log(`💡 Gateway must be running at ${host}:${port}. Keep frpc alive or use gateway / Web console.`);
|
|
177
172
|
} catch (err) {
|
|
@@ -211,16 +206,6 @@ function createTunnelCommand(ctx) {
|
|
|
211
206
|
consentValid: hasValidTunnelConsent(config)
|
|
212
207
|
}, null, 2));
|
|
213
208
|
});
|
|
214
|
-
cmd.command("qr").description("Print mobile connect QR payload (tunnel must be active)").action(async () => {
|
|
215
|
-
configureTunnel(ctx);
|
|
216
|
-
const { port, host } = resolveGatewayPortHost(loadConfig(ctx.configPath));
|
|
217
|
-
const qr = await getTunnelService().buildQr(port, host);
|
|
218
|
-
if (!qr.qrPayload) {
|
|
219
|
-
console.error("No active tunnel. Run: xopc tunnel start");
|
|
220
|
-
process.exit(1);
|
|
221
|
-
}
|
|
222
|
-
console.log(qr.qrPayload);
|
|
223
|
-
});
|
|
224
209
|
cmd.command("broker").description("Self-hosted FRP broker helpers").addCommand(new Command("init").description("Print a starter frps + broker configuration template").option("--domain <domain>", "Public domain for frps", "tunnel.example.com").action((opts) => {
|
|
225
210
|
const domain = String(opts.domain ?? "tunnel.example.com");
|
|
226
211
|
console.log(`# Self-hosted FRP broker sketch for ${domain}`);
|
|
@@ -4,7 +4,7 @@ export interface InitWorkspaceCoreOptions {
|
|
|
4
4
|
workspacePath: string;
|
|
5
5
|
/** When set with a new config file, overrides schema default port (e.g. Electron). */
|
|
6
6
|
gatewayPort?: number;
|
|
7
|
-
/** When true, sets the default agent
|
|
7
|
+
/** When true, sets the default agent workspace to `workspacePath`. */
|
|
8
8
|
persistWorkspacePath?: boolean;
|
|
9
9
|
/** Optional channel plugin validator (CLI/gateway only; Electron omits). */
|
|
10
10
|
assertChannelPlugins?: (cfg: Config) => void | Promise<void>;
|
|
@@ -53,7 +53,7 @@ async function initWorkspaceCore(options) {
|
|
|
53
53
|
const defaultAgentId = config.agents.default ?? config.agents.list[0]?.id ?? "main";
|
|
54
54
|
const agentsList = persistedWorkspaceRoot === void 0 ? config.agents.list : config.agents.list.map((agent) => agent.id === defaultAgentId ? {
|
|
55
55
|
...agent,
|
|
56
|
-
workspace:
|
|
56
|
+
workspace: persistedWorkspaceRoot
|
|
57
57
|
} : agent);
|
|
58
58
|
const nextConfig = {
|
|
59
59
|
...config,
|
|
@@ -8,12 +8,10 @@ export { listAgentEntries };
|
|
|
8
8
|
export declare function findAgentEntryIndex(list: AgentEntry[], agentId: string): number;
|
|
9
9
|
export declare function applyAgentConfig(cfg: Config, params: {
|
|
10
10
|
agentId: string;
|
|
11
|
-
/** Used only when creating a previously absent agent entry. */
|
|
12
|
-
identity?: AgentEntry['identity'];
|
|
13
11
|
workspace?: string;
|
|
12
|
+
profile?: AgentEntry['profile'];
|
|
14
13
|
model?: string;
|
|
15
14
|
models?: AgentEntry['models'];
|
|
16
|
-
extends?: AgentEntry['extends'];
|
|
17
15
|
skills?: string[];
|
|
18
16
|
tools?: AgentEntry['tools'];
|
|
19
17
|
}): Config;
|
|
@@ -17,33 +17,24 @@ function applyAgentConfig(cfg, params) {
|
|
|
17
17
|
const nextTools = params.tools;
|
|
18
18
|
const base = index >= 0 ? list[index] : {
|
|
19
19
|
id: agentId,
|
|
20
|
-
enabled: true
|
|
21
|
-
identity: params.identity ?? {
|
|
22
|
-
name: agentId,
|
|
23
|
-
role: "Agent",
|
|
24
|
-
language: "en",
|
|
25
|
-
tone: "direct"
|
|
26
|
-
},
|
|
27
|
-
responsibilities: { primary: ["Help the user complete tasks"] },
|
|
28
|
-
workspace: { root: `~/.xopc/workspace/${agentId}` }
|
|
20
|
+
enabled: true
|
|
29
21
|
};
|
|
30
22
|
const nextEntry = {
|
|
31
23
|
...base,
|
|
32
24
|
enabled: base.enabled ?? true,
|
|
33
|
-
...params.
|
|
34
|
-
...params.
|
|
25
|
+
...params.workspace ? { workspace: params.workspace } : {},
|
|
26
|
+
...params.profile ? { profile: params.profile } : {},
|
|
35
27
|
...params.models ? { models: params.models } : {},
|
|
36
28
|
...params.model ? { models: {
|
|
37
29
|
...base.models ?? {},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
deep: { model: params.model }
|
|
30
|
+
chat: {
|
|
31
|
+
primary: params.model,
|
|
32
|
+
fallbacks: []
|
|
42
33
|
}
|
|
43
34
|
} } : {},
|
|
44
35
|
...params.skills ? { skills: {
|
|
45
|
-
mode: "
|
|
46
|
-
|
|
36
|
+
mode: "replace",
|
|
37
|
+
include: params.skills
|
|
47
38
|
} } : {},
|
|
48
39
|
...nextTools ? { tools: nextTools } : {}
|
|
49
40
|
};
|
|
@@ -52,15 +43,7 @@ function applyAgentConfig(cfg, params) {
|
|
|
52
43
|
else {
|
|
53
44
|
if (nextList.length === 0 && agentId !== normalizeAgentId(resolveDefaultAgentId(cfg))) nextList.push({
|
|
54
45
|
id: resolveDefaultAgentId(cfg),
|
|
55
|
-
enabled: true
|
|
56
|
-
identity: {
|
|
57
|
-
name: resolveDefaultAgentId(cfg),
|
|
58
|
-
role: "Agent",
|
|
59
|
-
language: "en",
|
|
60
|
-
tone: "direct"
|
|
61
|
-
},
|
|
62
|
-
responsibilities: { primary: ["Help the user complete tasks"] },
|
|
63
|
-
workspace: { root: `~/.xopc/workspace/${resolveDefaultAgentId(cfg)}` }
|
|
46
|
+
enabled: true
|
|
64
47
|
});
|
|
65
48
|
nextList.push(nextEntry);
|
|
66
49
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ModelIntent } from '../agent-config/index.js';
|
|
2
|
+
import { type Config } from './schema.js';
|
|
3
|
+
export interface ResolvedModelIntent {
|
|
4
|
+
intent: ModelIntent;
|
|
5
|
+
model: string;
|
|
6
|
+
fallbacks: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare function resolveEffectiveModelIntents(config: Config, agentId: string): Map<ModelIntent, ResolvedModelIntent>;
|
|
9
|
+
export declare function resolveModelIntentRef(config: Config, agentId: string, intent: ModelIntent): string | undefined;
|
|
10
|
+
export declare function resolveModelSelector(config: Config, agentId: string, selector: string): string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ModelIntentSchema } from "../agent-config/schema.js";
|
|
2
|
+
import { init_agent_config } from "../agent-config/index.js";
|
|
3
|
+
import { init_schema, parseModelRef } from "./schema.js";
|
|
4
|
+
import { resolveEffectiveAgentConfigForAgent } from "./agent-profile.js";
|
|
5
|
+
//#region src/config/agent-model-intents.ts
|
|
6
|
+
init_agent_config();
|
|
7
|
+
init_schema();
|
|
8
|
+
function resolveEffectiveModelIntents(config, agentId) {
|
|
9
|
+
const intents = /* @__PURE__ */ new Map();
|
|
10
|
+
const effective = resolveEffectiveAgentConfigForAgent(config, agentId).config;
|
|
11
|
+
for (const [intent, route] of Object.entries(effective.models.intents)) {
|
|
12
|
+
const parsedIntent = ModelIntentSchema.safeParse(intent);
|
|
13
|
+
if (parsedIntent.success && route) intents.set(parsedIntent.data, {
|
|
14
|
+
intent: parsedIntent.data,
|
|
15
|
+
model: route.primary,
|
|
16
|
+
fallbacks: [...route.fallbacks]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return intents;
|
|
20
|
+
}
|
|
21
|
+
function resolveModelIntentRef(config, agentId, intent) {
|
|
22
|
+
return resolveEffectiveModelIntents(config, agentId).get(intent)?.model;
|
|
23
|
+
}
|
|
24
|
+
function resolveModelSelector(config, agentId, selector) {
|
|
25
|
+
const trimmed = selector.trim();
|
|
26
|
+
if (!trimmed) throw new Error("model selector must not be empty");
|
|
27
|
+
if (trimmed.includes("/")) {
|
|
28
|
+
if (!parseModelRef(trimmed)) throw new Error(`model ref must be provider/model format (got '${trimmed}')`);
|
|
29
|
+
return trimmed;
|
|
30
|
+
}
|
|
31
|
+
const intentText = trimmed.startsWith("@") ? trimmed.slice(1).trim() : trimmed;
|
|
32
|
+
const intent = ModelIntentSchema.safeParse(intentText);
|
|
33
|
+
if (!intent.success) throw new Error(`Unknown model intent '${intentText}'`);
|
|
34
|
+
const resolved = resolveModelIntentRef(config, agentId, intent.data);
|
|
35
|
+
if (resolved) return resolved;
|
|
36
|
+
return resolveEffectiveAgentConfigForAgent(config, agentId).config.models.chat.primary;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { resolveEffectiveModelIntents, resolveModelIntentRef, resolveModelSelector };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type { ThinkLevel, ReasoningLevel, VerboseLevel } from '../agent/transcript/thinking-types.js';
|
|
1
|
+
import { type EffectiveAgentConfig, type ResolveEffectiveAgentConfigResult } from '../agent-config/index.js';
|
|
3
2
|
import type { Config } from './schema.js';
|
|
4
3
|
export { resolveAgentWorkspaceDir } from '../agent/agent-scope.js';
|
|
5
4
|
export interface EffectiveAgentTools {
|
|
@@ -7,20 +6,19 @@ export interface EffectiveAgentTools {
|
|
|
7
6
|
}
|
|
8
7
|
export interface EffectiveAgentProfile {
|
|
9
8
|
agentId: string;
|
|
10
|
-
|
|
9
|
+
config: EffectiveAgentConfig;
|
|
10
|
+
sources: ResolveEffectiveAgentConfigResult['sources'];
|
|
11
11
|
resolvedWorkspacePath: string;
|
|
12
|
-
primaryModelRef: string
|
|
12
|
+
primaryModelRef: string;
|
|
13
13
|
fallbacks: string[];
|
|
14
|
-
thinkingDefault?: ThinkLevel;
|
|
15
|
-
reasoningDefault?: ReasoningLevel;
|
|
16
|
-
verboseDefault?: VerboseLevel;
|
|
17
14
|
customInstructions?: string;
|
|
18
15
|
skillsAllowlist?: string[];
|
|
16
|
+
skillsDenylist: string[];
|
|
19
17
|
tools: EffectiveAgentTools;
|
|
20
18
|
params: Record<string, unknown>;
|
|
21
19
|
}
|
|
22
20
|
export declare function extractProfileAgentId(sessionKey: string | undefined | null, config: Config): string;
|
|
23
|
-
export declare function
|
|
24
|
-
export declare function
|
|
21
|
+
export declare function resolveEffectiveAgentConfigForAgent(config: Config, agentId: string): ResolveEffectiveAgentConfigResult;
|
|
22
|
+
export declare function resolveEffectiveAgentConfigForSession(config: Config, sessionKey: string | undefined | null): ResolveEffectiveAgentConfigResult;
|
|
25
23
|
export declare function resolveEffectiveAgentProfile(config: Config, agentId: string): EffectiveAgentProfile;
|
|
26
24
|
export declare function resolveEffectiveAgentProfileForSession(config: Config, sessionKey: string | undefined | null): EffectiveAgentProfile;
|