@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
|
@@ -21,7 +21,7 @@ import { clearBootstrapSnapshot } from "./bootstrap/bootstrap-cache.js";
|
|
|
21
21
|
import { resolveBootstrapContextSync } from "./bootstrap/bootstrap-files.js";
|
|
22
22
|
import { loadProjectAgentsContextFile } from "./bootstrap/project-agents-context.js";
|
|
23
23
|
import { parseExternalToolRef } from "./external-tools/refs.js";
|
|
24
|
-
import { mcpToolPolicyId
|
|
24
|
+
import { mcpToolPolicyId } from "./mcp/bundle-mcp-policy.js";
|
|
25
25
|
import { disposeAllSessionMcpRuntimes, retireSessionMcpRuntimeForSessionKey } from "./mcp/bundle-mcp-runtime.js";
|
|
26
26
|
import { createSkillConfigManager, isSkillEnabled, resolveSkillConfig } from "./skills/config.js";
|
|
27
27
|
import { isValidSkillEnvVarName } from "./skills/required-env-vars.js";
|
|
@@ -40,7 +40,6 @@ import { WorkspaceRuntimeRegistry } from "./workspace-runtime/registry.js";
|
|
|
40
40
|
import { runTurnUnderstandingReview } from "./background-review/run-background-review.js";
|
|
41
41
|
import { BackgroundReviewCoordinator } from "./background-review/coordinator.js";
|
|
42
42
|
import { maybeRequestChannelExecApproval } from "../channels/exec-approval-runtime.js";
|
|
43
|
-
import { checkBoundary } from "../agent-runtime/boundary-guard.js";
|
|
44
43
|
import { SkillFilesystemWatcher } from "./skills/filesystem-watcher.js";
|
|
45
44
|
import { ProjectTrustStore, hasTrustRequiringProjectResources } from "../project-trust/trust-store.js";
|
|
46
45
|
import { createAgentTurnPolicy } from "./orchestration/agent-turn-policy.js";
|
|
@@ -186,12 +185,6 @@ var AgentManager = class {
|
|
|
186
185
|
if (absolutePath === null || absolutePath === "") this.sessionWorkspaceOverrides.delete(sessionKey);
|
|
187
186
|
else this.sessionWorkspaceOverrides.set(sessionKey, absolutePath);
|
|
188
187
|
}
|
|
189
|
-
/** Merged `thinkingDefault` for this session's agent id (defaults + `agents.list`). */
|
|
190
|
-
getThinkingDefaultForSession(sessionKey) {
|
|
191
|
-
const cfg = this.mergedConfig();
|
|
192
|
-
if (!cfg) return;
|
|
193
|
-
return resolveEffectiveAgentProfileForSession(cfg, sessionKey).thinkingDefault;
|
|
194
|
-
}
|
|
195
188
|
pickDefaultModelRef() {
|
|
196
189
|
const cfg = this.mergedConfig();
|
|
197
190
|
return getAgentDefaultModelRef(cfg)?.trim() || getDefaultModelSync(cfg);
|
|
@@ -243,7 +236,7 @@ var AgentManager = class {
|
|
|
243
236
|
toolExecutorConfig: { resolveTimeoutMs: (toolName) => {
|
|
244
237
|
const config = this.mergedConfig();
|
|
245
238
|
const sessionKey = this.config.getCurrentContext?.()?.sessionKey;
|
|
246
|
-
return resolveEffectiveAgentProfileForSession(config, sessionKey).
|
|
239
|
+
return resolveEffectiveAgentProfileForSession(config, sessionKey).config.tools[toolName]?.timeoutMs;
|
|
247
240
|
} },
|
|
248
241
|
getConfig: () => this.mergedConfig(),
|
|
249
242
|
getPrimaryModel: () => this.resolveModelStringToModel(this.pickDefaultModelRef()),
|
|
@@ -410,7 +403,7 @@ var AgentManager = class {
|
|
|
410
403
|
const rt = this.workspaceRuntimes.getOrCreate(resolvedWorkspacePath, instance.effectiveProfile.agentId);
|
|
411
404
|
const contextFiles = this.resolveContextFilesForSession(instance.sessionKey, instance.effectiveProfile);
|
|
412
405
|
const modelRef = instance.effectiveProfile.primaryModelRef?.trim() || this.defaultModel;
|
|
413
|
-
const thinkingLevel = instance.agent.state.thinkingLevel ??
|
|
406
|
+
const thinkingLevel = instance.agent.state.thinkingLevel ?? this.config.thinkingLevel ?? "medium";
|
|
414
407
|
return rt.systemPromptBuilder.build(contextFiles, {
|
|
415
408
|
externalMemoryInstructions: rt.memoryManager.buildExternalSystemPrompt(),
|
|
416
409
|
workspaceOverride: resolvedWorkspacePath,
|
|
@@ -520,10 +513,11 @@ var AgentManager = class {
|
|
|
520
513
|
status: rt.skillManager.getStatus()
|
|
521
514
|
};
|
|
522
515
|
}
|
|
523
|
-
buildAgentSkillAvailability(
|
|
516
|
+
buildAgentSkillAvailability(unresolvedProfile, workspaceDir, registeredToolNames) {
|
|
524
517
|
const cfg = this.config.config;
|
|
518
|
+
const rt = this.workspaceRuntimes.getOrCreate(workspaceDir, unresolvedProfile.agentId);
|
|
519
|
+
const profile = this.materializeSkillAllowlist(unresolvedProfile, rt);
|
|
525
520
|
const entry = Array.isArray(cfg.agents?.list) ? cfg.agents.list.find((a) => a && a.enabled !== false && a.id.toLowerCase() === profile.agentId.toLowerCase()) : void 0;
|
|
526
|
-
const rt = this.workspaceRuntimes.getOrCreate(workspaceDir, profile.agentId);
|
|
527
521
|
const skillsConfig = createSkillConfigManager(resolveStateDir()).load();
|
|
528
522
|
const lock = loadSkillsLock();
|
|
529
523
|
const workspaceLock = loadSkillsLock(resolveWorkspaceSkillsLockPath(workspaceDir));
|
|
@@ -560,11 +554,19 @@ var AgentManager = class {
|
|
|
560
554
|
loadedAt: rt.skillManager.getLoadedAt(),
|
|
561
555
|
diagnostics: rt.skillManager.getDiagnostics(),
|
|
562
556
|
status: rt.skillManager.getStatus(),
|
|
563
|
-
...entry?.skills?.mode === "
|
|
557
|
+
...entry?.skills?.mode === "replace" ? { agentAllowlist: [...entry.skills.include] } : {},
|
|
564
558
|
...profile.skillsAllowlist !== void 0 ? { effectiveAllowlist: [...profile.skillsAllowlist] } : {},
|
|
565
559
|
skills
|
|
566
560
|
};
|
|
567
561
|
}
|
|
562
|
+
materializeSkillAllowlist(profile, runtime) {
|
|
563
|
+
if (profile.skillsAllowlist !== void 0 || profile.skillsDenylist.length === 0) return profile;
|
|
564
|
+
const denied = new Set(profile.skillsDenylist.map((name) => name.toLowerCase()));
|
|
565
|
+
return {
|
|
566
|
+
...profile,
|
|
567
|
+
skillsAllowlist: runtime.skillManager.getSkills().map((skill) => skill.name).filter((name) => !denied.has(name.toLowerCase()))
|
|
568
|
+
};
|
|
569
|
+
}
|
|
568
570
|
getAgentSkillAvailability(agentId) {
|
|
569
571
|
const profile = resolveEffectiveAgentProfile(this.config.config, agentId);
|
|
570
572
|
return this.buildAgentSkillAvailability(profile, profile.resolvedWorkspacePath);
|
|
@@ -621,7 +623,7 @@ var AgentManager = class {
|
|
|
621
623
|
sessionKey: instance.sessionKey,
|
|
622
624
|
modelRef: instance.effectiveProfile.primaryModelRef?.trim() || this.defaultModel,
|
|
623
625
|
agentId: instance.effectiveProfile.agentId,
|
|
624
|
-
thinkingLevel:
|
|
626
|
+
thinkingLevel: this.config.thinkingLevel ?? "medium",
|
|
625
627
|
activeProjectContext: this.composeDynamicProjectContext(instance.activeProjectContext, instance.activeSelfVerifyContext)
|
|
626
628
|
});
|
|
627
629
|
instance.agent.state.systemPrompt = newPrompt;
|
|
@@ -697,7 +699,7 @@ var AgentManager = class {
|
|
|
697
699
|
sessionKey: instance.sessionKey,
|
|
698
700
|
modelRef: instance.effectiveProfile.primaryModelRef?.trim() || this.defaultModel,
|
|
699
701
|
agentId: instance.effectiveProfile.agentId,
|
|
700
|
-
thinkingLevel:
|
|
702
|
+
thinkingLevel: this.config.thinkingLevel ?? "medium",
|
|
701
703
|
activeProjectContext: this.composeDynamicProjectContext(instance.activeProjectContext, instance.activeSelfVerifyContext)
|
|
702
704
|
});
|
|
703
705
|
instance.agent.state.systemPrompt = newPrompt;
|
|
@@ -718,9 +720,10 @@ var AgentManager = class {
|
|
|
718
720
|
log.debug({ sessionKey }, "Reusing existing agent instance");
|
|
719
721
|
return existing.agent;
|
|
720
722
|
}
|
|
721
|
-
|
|
723
|
+
let profile = resolveEffectiveAgentProfileForSession(cfg, sessionKey);
|
|
722
724
|
const resolvedPath = targetPath;
|
|
723
725
|
const rt = this.workspaceRuntimes.getOrCreate(resolvedPath, profile.agentId);
|
|
726
|
+
profile = this.materializeSkillAllowlist(profile, rt);
|
|
724
727
|
if (isMemorySubsystemEnabled(cfg)) rt.memoryManager.initializeAll(sessionKey, {
|
|
725
728
|
workspace: resolvedPath,
|
|
726
729
|
agentId: profile.agentId
|
|
@@ -828,7 +831,7 @@ var AgentManager = class {
|
|
|
828
831
|
const rt = this.workspaceRuntimes.getOrCreate(resolvedWorkspacePath, instance.effectiveProfile.agentId);
|
|
829
832
|
const contextFiles = this.resolveContextFilesForSession(sessionKey, instance.effectiveProfile);
|
|
830
833
|
const modelRef = instance.effectiveProfile.primaryModelRef?.trim() || this.defaultModel;
|
|
831
|
-
const thinkingLevel =
|
|
834
|
+
const thinkingLevel = this.config.thinkingLevel ?? "medium";
|
|
832
835
|
const activeProjectContext = buildExecutionScopeContextForPrompt(sessionKey);
|
|
833
836
|
const activeSelfVerifyContext = this.getSelfVerifyPromptContext(sessionKey, instance.effectiveProfile.agentId);
|
|
834
837
|
instance.agent.state.systemPrompt = rt.systemPromptBuilder.build(contextFiles, {
|
|
@@ -929,7 +932,7 @@ var AgentManager = class {
|
|
|
929
932
|
getSkillManager: () => rt.skillManager
|
|
930
933
|
});
|
|
931
934
|
const registeredToolNames = tools.map((t) => t.name);
|
|
932
|
-
const thinkingLevel =
|
|
935
|
+
const thinkingLevel = this.config.thinkingLevel ?? "medium";
|
|
933
936
|
const turnPolicy = this.buildAgentTurnPolicy(sessionKey, profile);
|
|
934
937
|
agent = new Agent({
|
|
935
938
|
initialState: {
|
|
@@ -968,11 +971,11 @@ var AgentManager = class {
|
|
|
968
971
|
}
|
|
969
972
|
buildAgentTurnPolicy(sessionKey, profile) {
|
|
970
973
|
return createAgentTurnPolicy({
|
|
971
|
-
maxTurns: profile.
|
|
972
|
-
maxToolFailures: profile.
|
|
974
|
+
maxTurns: profile.config.runtime.maxTurns,
|
|
975
|
+
maxToolFailures: profile.config.runtime.maxToolFailuresPerTurn,
|
|
973
976
|
resolveToolLimit: (toolName, args) => {
|
|
974
977
|
const policy = this.resolveToolPolicy(profile, toolName, args);
|
|
975
|
-
const maxCalls = policy?.
|
|
978
|
+
const maxCalls = policy?.maxCallsPerTurn;
|
|
976
979
|
return policy && maxCalls ? {
|
|
977
980
|
id: policy.id,
|
|
978
981
|
maxCalls
|
|
@@ -982,22 +985,7 @@ var AgentManager = class {
|
|
|
982
985
|
const toolName = toolCall.name;
|
|
983
986
|
const policy = this.resolveToolPolicy(profile, toolName, args);
|
|
984
987
|
const detail = JSON.stringify(args ?? {});
|
|
985
|
-
|
|
986
|
-
manifest: profile.manifest,
|
|
987
|
-
action: policy?.id ?? toolName,
|
|
988
|
-
detail
|
|
989
|
-
});
|
|
990
|
-
if (boundary.decision === "deny") return {
|
|
991
|
-
block: true,
|
|
992
|
-
terminate: true,
|
|
993
|
-
reason: `Blocked by boundary rule: ${boundary.matchedRule}`
|
|
994
|
-
};
|
|
995
|
-
if (boundary.decision === "escalate") return {
|
|
996
|
-
block: true,
|
|
997
|
-
terminate: true,
|
|
998
|
-
reason: `Escalation required by boundary rule: ${boundary.matchedRule}`
|
|
999
|
-
};
|
|
1000
|
-
if (policy?.mode === "confirm" || boundary.decision === "confirm") {
|
|
988
|
+
if (policy?.mode === "ask") {
|
|
1001
989
|
if (!await this.requestToolConfirmation(sessionKey, policy?.id ?? toolName, detail)) return {
|
|
1002
990
|
block: true,
|
|
1003
991
|
terminate: true,
|
|
@@ -1039,7 +1027,7 @@ var AgentManager = class {
|
|
|
1039
1027
|
}
|
|
1040
1028
|
resolveToolPolicy(profile, toolName, args) {
|
|
1041
1029
|
if (toolName !== "xopc_tool_execute") {
|
|
1042
|
-
const policy = profile.
|
|
1030
|
+
const policy = profile.config.tools[toolName];
|
|
1043
1031
|
return policy ? {
|
|
1044
1032
|
id: toolName,
|
|
1045
1033
|
...policy
|
|
@@ -1048,10 +1036,7 @@ var AgentManager = class {
|
|
|
1048
1036
|
const parsed = parseExternalToolRef(typeof args?.toolRef === "string" ? args.toolRef : "", "mcp");
|
|
1049
1037
|
if (!parsed) return void 0;
|
|
1050
1038
|
const id = mcpToolPolicyId(parsed.namespace, parsed.toolName);
|
|
1051
|
-
const policy =
|
|
1052
|
-
serverId: parsed.namespace,
|
|
1053
|
-
policyToolId: id
|
|
1054
|
-
}, profile.manifest.tools.mcp);
|
|
1039
|
+
const policy = profile.config.tools[id];
|
|
1055
1040
|
return policy ? {
|
|
1056
1041
|
id,
|
|
1057
1042
|
...policy
|
|
@@ -1075,7 +1060,7 @@ var AgentManager = class {
|
|
|
1075
1060
|
const rt = this.workspaceRuntimes.getOrCreate(resolvedWorkspacePath, instance.effectiveProfile.agentId);
|
|
1076
1061
|
const contextFiles = this.resolveContextFilesForSession(instance.sessionKey, instance.effectiveProfile);
|
|
1077
1062
|
const modelRef = instance.effectiveProfile.primaryModelRef?.trim() || this.defaultModel;
|
|
1078
|
-
const thinkingLevel = instance.agent.state.thinkingLevel ??
|
|
1063
|
+
const thinkingLevel = instance.agent.state.thinkingLevel ?? this.config.thinkingLevel ?? "medium";
|
|
1079
1064
|
instance.agent.state.systemPrompt = rt.systemPromptBuilder.build(contextFiles, {
|
|
1080
1065
|
externalMemoryInstructions: rt.memoryManager.buildExternalSystemPrompt(),
|
|
1081
1066
|
workspaceOverride: resolvedWorkspacePath,
|
|
@@ -1113,7 +1098,7 @@ var AgentManager = class {
|
|
|
1113
1098
|
const resolvedWorkspacePath = this.getResolvedWorkspaceForSession(sessionKey);
|
|
1114
1099
|
const rt = this.workspaceRuntimes.getOrCreate(resolvedWorkspacePath, instance.effectiveProfile.agentId);
|
|
1115
1100
|
const contextFiles = this.resolveContextFilesForSession(sessionKey, instance.effectiveProfile);
|
|
1116
|
-
const thinkingLevel = instance.agent.state.thinkingLevel ??
|
|
1101
|
+
const thinkingLevel = instance.agent.state.thinkingLevel ?? this.config.thinkingLevel ?? "medium";
|
|
1117
1102
|
const activeProjectContext = buildExecutionScopeContextForPrompt(sessionKey);
|
|
1118
1103
|
const activeSelfVerifyContext = this.getSelfVerifyPromptContext(sessionKey, instance.effectiveProfile.agentId);
|
|
1119
1104
|
instance.agent.state.systemPrompt = rt.systemPromptBuilder.build(contextFiles, {
|
|
@@ -11,9 +11,9 @@ import { createExtensionAwareStreamFn } from "../../providers/extension-stream-b
|
|
|
11
11
|
import { extractTextContent } from "../context/workspace.js";
|
|
12
12
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
13
13
|
import { resolveAgentTurnTimeoutMs, runAgentTurnWithTimeout } from "../orchestration/run-agent-turn-with-timeout.js";
|
|
14
|
-
import { resolveTypedModelRef } from "../../config/agent-typed-models.js";
|
|
15
14
|
import { claimRegisteredExtraction } from "../../user-context/extraction/registry.js";
|
|
16
15
|
import { isAssistantTurnAborted, isAssistantTurnFailed } from "../orchestration/llm-turn-retry.js";
|
|
16
|
+
import { resolveModelIntentRef } from "../../config/agent-model-intents.js";
|
|
17
17
|
import { emptyUnderstandingReview, executeUnderstandingInterpretation } from "../../user-context/extraction/executor.js";
|
|
18
18
|
import { parseSemanticUnderstanding } from "../../user-context/extraction/semantic.js";
|
|
19
19
|
import { UNDERSTANDING_INTERPRETER_SYSTEM_PROMPT, buildUnderstandingInterpreterPrompt } from "./prompts.js";
|
|
@@ -95,20 +95,15 @@ function resolveInterpreterRuntime(params) {
|
|
|
95
95
|
let model;
|
|
96
96
|
if (config) {
|
|
97
97
|
const agentId = extractProfileAgentId(params.sessionKey, config);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
agentId,
|
|
108
|
-
role,
|
|
109
|
-
modelRef: ref
|
|
110
|
-
}, "Configured understanding model could not be resolved");
|
|
111
|
-
}
|
|
98
|
+
const ref = resolveModelIntentRef(config, agentId, "understanding");
|
|
99
|
+
if (ref) try {
|
|
100
|
+
model = resolveModel(ref);
|
|
101
|
+
} catch (err) {
|
|
102
|
+
log.debug({
|
|
103
|
+
err,
|
|
104
|
+
agentId,
|
|
105
|
+
modelRef: ref
|
|
106
|
+
}, "Configured understanding model could not be resolved");
|
|
112
107
|
}
|
|
113
108
|
}
|
|
114
109
|
model ??= params.mainAgent.state.model;
|
|
@@ -61,7 +61,7 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
61
61
|
const systemPrompt = agent.state.systemPrompt ?? "";
|
|
62
62
|
const thinkingLevel = params.thinkingOverride ?? agent.state.thinkingLevel;
|
|
63
63
|
const workspaceDir = agentManager.getResolvedWorkspaceForSession(sessionKey);
|
|
64
|
-
const promptCachePolicy = resolvePromptCachePolicy(config ? resolveEffectiveAgentProfileForSession(config, sessionKey).
|
|
64
|
+
const promptCachePolicy = resolvePromptCachePolicy(config ? resolveEffectiveAgentProfileForSession(config, sessionKey).config.runtime.promptCache : void 0);
|
|
65
65
|
let userMessageForTurn = userMessage;
|
|
66
66
|
if (params.applyStartupContext !== false) {
|
|
67
67
|
userMessageForTurn = await applyStartupContextToUserMessage({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
2
2
|
import { externalToolRef, parseExternalToolRef } from "./refs.js";
|
|
3
|
-
import {
|
|
3
|
+
import { mcpToolPolicyId } from "../mcp/bundle-mcp-policy.js";
|
|
4
4
|
import { getOrCreateSessionMcpRuntime } from "../mcp/bundle-mcp-runtime.js";
|
|
5
5
|
//#region src/agent/external-tools/mcp-provider.ts
|
|
6
6
|
function policyToolId(tool) {
|
|
@@ -90,22 +90,12 @@ var McpToolProvider = class {
|
|
|
90
90
|
const sessionKey = this.deps.getSessionKey();
|
|
91
91
|
const profile = cfg && sessionKey ? resolveEffectiveAgentProfileForSession(cfg, sessionKey) : void 0;
|
|
92
92
|
const policyName = policyToolId(tool);
|
|
93
|
-
return !(
|
|
94
|
-
serverId: tool.safeServerName,
|
|
95
|
-
policyToolId: policyName
|
|
96
|
-
}, profile?.manifest.tools.mcp)?.scope === "readonly" && tool.annotations?.readOnlyHint !== true) && !profile?.tools.denied.has(policyName) && !isMcpCatalogToolDenied({
|
|
97
|
-
serverId: tool.safeServerName,
|
|
98
|
-
policyToolId: policyName
|
|
99
|
-
}, profile?.manifest.tools.mcp);
|
|
93
|
+
return !profile?.tools.denied.has(policyName);
|
|
100
94
|
}
|
|
101
95
|
executionSignal(tool, signal) {
|
|
102
96
|
const cfg = this.deps.getConfig();
|
|
103
97
|
const sessionKey = this.deps.getSessionKey();
|
|
104
|
-
const
|
|
105
|
-
const timeoutMs = resolveMcpToolPolicy({
|
|
106
|
-
serverId: tool.safeServerName,
|
|
107
|
-
policyToolId: policyToolId(tool)
|
|
108
|
-
}, profile?.manifest.tools.mcp)?.limits?.timeoutMs;
|
|
98
|
+
const timeoutMs = (cfg && sessionKey ? resolveEffectiveAgentProfileForSession(cfg, sessionKey) : void 0)?.config.tools[policyToolId(tool)]?.timeoutMs;
|
|
109
99
|
if (!timeoutMs) return signal;
|
|
110
100
|
const timeoutSignal = AbortSignal.timeout(timeoutMs);
|
|
111
101
|
return signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal;
|
|
@@ -169,7 +169,7 @@ function toCapabilityCandidate(provider) {
|
|
|
169
169
|
function buildNoImageGenerationModelConfiguredMessage(cfg, deps) {
|
|
170
170
|
return buildNoCapabilityModelConfiguredMessage({
|
|
171
171
|
capabilityLabel: "image-generation",
|
|
172
|
-
modelConfigKey: "
|
|
172
|
+
modelConfigKey: "imageGeneration",
|
|
173
173
|
providers: (deps.listProviders ?? listImageGenerationProviders)(cfg).map(toCapabilityCandidate),
|
|
174
174
|
getProviderEnvVars: deps.getProviderEnvVars ?? ((id) => PROVIDER_ENV_MAP[id])
|
|
175
175
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "../../config/schema.js";
|
|
2
2
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
3
|
-
import {
|
|
3
|
+
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
4
4
|
import { getDefaultModelSync, getModelsByProvider, init_providers, isProviderConfiguredSync, resolveModel } from "../../providers/index.js";
|
|
5
5
|
import { resolveAgentModelFallbackValues, resolveAgentModelPrimaryValue } from "../../config/model-input.js";
|
|
6
6
|
import { buildCapabilityPlansForConfig } from "../../capabilities/readiness/from-config.js";
|
|
@@ -37,13 +37,13 @@ function resolveEffectiveModelsConfig(params) {
|
|
|
37
37
|
if (!params.cfg) return;
|
|
38
38
|
try {
|
|
39
39
|
const agentId = params.agentId?.trim() || resolveDefaultAgentId(params.cfg);
|
|
40
|
-
return
|
|
40
|
+
return resolveEffectiveAgentConfigForAgent(params.cfg, agentId).config.models;
|
|
41
41
|
} catch {
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
function resolveConfiguredImageModelConfig(params) {
|
|
46
|
-
return coerceToolModelConfig(resolveEffectiveModelsConfig(params)?.
|
|
46
|
+
return coerceToolModelConfig(resolveEffectiveModelsConfig(params)?.imageUnderstanding ?? (params.cfg ? getAgentDefaultImageModelConfig(params.cfg) : void 0));
|
|
47
47
|
}
|
|
48
48
|
function modelRefSupportsImage(modelRef) {
|
|
49
49
|
try {
|
|
@@ -70,27 +70,26 @@ function addCandidate(candidates, seen, entry) {
|
|
|
70
70
|
}
|
|
71
71
|
function collectRoleImageModelCandidates(params) {
|
|
72
72
|
const models = resolveEffectiveModelsConfig(params);
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
const routes = models ? {
|
|
74
|
+
chat: models.chat,
|
|
75
|
+
...models.intents
|
|
76
|
+
} : {};
|
|
77
|
+
const roleIds = Object.keys(routes);
|
|
77
78
|
const seen = /* @__PURE__ */ new Set();
|
|
78
79
|
const candidates = [];
|
|
79
|
-
for (const roleId of
|
|
80
|
-
const role =
|
|
80
|
+
for (const roleId of roleIds) {
|
|
81
|
+
const role = routes[roleId];
|
|
81
82
|
if (!role) continue;
|
|
82
|
-
const refs = [role.
|
|
83
|
+
const refs = [role.primary, ...role.fallbacks];
|
|
83
84
|
for (const ref of refs) addCandidate(candidates, seen, {
|
|
84
85
|
ref,
|
|
85
|
-
roleId
|
|
86
|
-
...role.description ? { roleDescription: role.description } : {}
|
|
86
|
+
roleId
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
return candidates;
|
|
90
90
|
}
|
|
91
91
|
function resolveDefaultModelRefForAgent(params) {
|
|
92
|
-
const
|
|
93
|
-
const ref = (models?.defaultRole ? models.roles?.[models.defaultRole] : void 0)?.model?.trim();
|
|
92
|
+
const ref = resolveEffectiveModelsConfig(params)?.chat.primary.trim();
|
|
94
93
|
if (ref) {
|
|
95
94
|
const parsed = parseModelRef(ref);
|
|
96
95
|
if (parsed) return parsed;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
import type { AgentManifest, ToolPolicy } from '../../agent-manifest/schema.js';
|
|
2
1
|
export declare function mcpToolPolicyId(serverId: string, toolName: string): string;
|
|
3
|
-
export declare function resolveMcpToolPolicy(identity: {
|
|
4
|
-
serverId: string;
|
|
5
|
-
policyToolId: string;
|
|
6
|
-
}, policy: AgentManifest['tools']['mcp']): ToolPolicy | undefined;
|
|
7
|
-
export declare function isMcpCatalogToolDenied(identity: {
|
|
8
|
-
serverId: string;
|
|
9
|
-
policyToolId: string;
|
|
10
|
-
}, policy: AgentManifest['tools']['mcp']): boolean;
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
import { sanitizeServerName } from "./bundle-mcp-names.js";
|
|
2
1
|
//#region src/agent/mcp/bundle-mcp-policy.ts
|
|
3
2
|
function mcpToolPolicyId(serverId, toolName) {
|
|
4
3
|
return `mcp:${encodeURIComponent(serverId)}:${encodeURIComponent(toolName)}`;
|
|
5
4
|
}
|
|
6
|
-
function resolveMcpToolPolicy(identity, policy) {
|
|
7
|
-
const toolPolicy = policy?.tools?.[identity.policyToolId];
|
|
8
|
-
if (toolPolicy) return toolPolicy;
|
|
9
|
-
const directServerPolicy = policy?.servers?.[identity.serverId];
|
|
10
|
-
if (directServerPolicy) return directServerPolicy;
|
|
11
|
-
const usedNames = /* @__PURE__ */ new Set();
|
|
12
|
-
for (const [serverId, serverPolicy] of Object.entries(policy?.servers ?? {})) if (sanitizeServerName(serverId, usedNames) === identity.serverId) return serverPolicy;
|
|
13
|
-
}
|
|
14
|
-
function isMcpCatalogToolDenied(identity, policy) {
|
|
15
|
-
return resolveMcpToolPolicy(identity, policy)?.mode === "deny";
|
|
16
|
-
}
|
|
17
5
|
//#endregion
|
|
18
|
-
export {
|
|
6
|
+
export { mcpToolPolicyId };
|
|
@@ -2,12 +2,12 @@ import { createLogger } from "../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { resolveGlobalSingleton } from "../../utils/global-singleton.js";
|
|
4
4
|
import { init_string_coerce, normalizeOptionalString } from "../../utils/string-coerce.js";
|
|
5
|
-
import { sanitizeServerName } from "./bundle-mcp-names.js";
|
|
6
5
|
import { redactSensitiveUrlLikeString } from "../../utils/redact-sensitive-url.js";
|
|
7
6
|
import { loadEmbeddedMcpConfig } from "./embedded-mcp.js";
|
|
8
7
|
import { resolveConnectorSecretReferences } from "../../connectors/secret-store.js";
|
|
9
8
|
import { isMcpConfigRecord } from "./mcp-config-shared.js";
|
|
10
9
|
import { resolveMcpTransport } from "./mcp-transport.js";
|
|
10
|
+
import { sanitizeServerName } from "./bundle-mcp-names.js";
|
|
11
11
|
import crypto from "node:crypto";
|
|
12
12
|
import Ajv2020 from "ajv/dist/2020.js";
|
|
13
13
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mcpToolPolicyId } from "./bundle-mcp-policy.js";
|
|
2
2
|
import { loadMergedBundleMcpConfig } from "./bundle-mcp-config.js";
|
|
3
3
|
import { loadEmbeddedMcpConfig } from "./embedded-mcp.js";
|
|
4
4
|
import { McpAuthorizationRequiredError, isMcpAuthorizationError } from "./oauth/mcp-oauth-errors.js";
|
|
@@ -9,4 +9,4 @@ import "./bundle-mcp-tools.js";
|
|
|
9
9
|
import { McpOAuthSession } from "./oauth/mcp-oauth-session.js";
|
|
10
10
|
import { McpOAuthManager, getMcpOAuthManager } from "./oauth/mcp-oauth-manager.js";
|
|
11
11
|
import "./oauth/index.js";
|
|
12
|
-
export { McpAuthorizationRequiredError, McpOAuthManager, McpOAuthSession, McpOAuthStore, XopcMcpOAuthClientProvider, __testing, canonicalMcpServerUrl, createSessionMcpRuntime, disposeAllSessionMcpRuntimes, disposeSessionMcpRuntime, getMcpOAuthManager, getOrCreateSessionMcpRuntime, getSessionMcpRuntimeManager, isMcpAuthorizationError,
|
|
12
|
+
export { McpAuthorizationRequiredError, McpOAuthManager, McpOAuthSession, McpOAuthStore, XopcMcpOAuthClientProvider, __testing, canonicalMcpServerUrl, createSessionMcpRuntime, disposeAllSessionMcpRuntimes, disposeSessionMcpRuntime, getMcpOAuthManager, getOrCreateSessionMcpRuntime, getSessionMcpRuntimeManager, isMcpAuthorizationError, loadEmbeddedMcpConfig, loadMergedBundleMcpConfig, mcpOAuthServerKey, mcpToolPolicyId, retireSessionMcpRuntime, retireSessionMcpRuntimeForSessionKey };
|
|
@@ -90,7 +90,7 @@ export declare function throwCapabilityGenerationFailure(params: ThrowCapability
|
|
|
90
90
|
export interface BuildNoCapabilityModelConfiguredMessageParams {
|
|
91
91
|
/** Display label, e.g. "image-generation". */
|
|
92
92
|
capabilityLabel: string;
|
|
93
|
-
/** Config key path, e.g. "
|
|
93
|
+
/** Config key path, e.g. "agents.defaults.models.imageGeneration". */
|
|
94
94
|
modelConfigKey: string;
|
|
95
95
|
providers: ReadonlyArray<CapabilityProviderCandidate>;
|
|
96
96
|
/** Optional env-var lookup, e.g. (id) => PROVIDER_ENV_MAP[id]. */
|
|
@@ -190,7 +190,7 @@ function throwCapabilityGenerationFailure(params) {
|
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
function buildNoCapabilityModelConfiguredMessage(params) {
|
|
193
|
-
const lines = [`No ${params.capabilityLabel} model configured.
|
|
193
|
+
const lines = [`No ${params.capabilityLabel} model configured. Set agents.defaults.models.${params.modelConfigKey} or pass modelOverride at call site.`];
|
|
194
194
|
if (params.providers.length > 0) {
|
|
195
195
|
lines.push("Registered providers:");
|
|
196
196
|
for (const p of params.providers) {
|
|
@@ -2,7 +2,7 @@ import { isMemorySubsystemEnabled } from "./memory-config.js";
|
|
|
2
2
|
import { BuiltinMemoryProvider } from "./builtin-provider.js";
|
|
3
3
|
import { MemoryManager } from "./manager.js";
|
|
4
4
|
import { loadMemoryPluginProviders } from "./plugin-discovery.js";
|
|
5
|
-
import { buildMemoryRuntime } from "
|
|
5
|
+
import { buildMemoryRuntime } from "./runtime.js";
|
|
6
6
|
//#region src/agent/memory/create-memory-manager.ts
|
|
7
7
|
function createMemoryManagerFromConfig(config) {
|
|
8
8
|
const routing = resolveMemoryManagerOptions(config);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
-
import type { MemoryRuntime } from '
|
|
2
|
+
import type { MemoryRuntime } from './runtime.js';
|
|
3
3
|
import type { MemoryProvider, MemoryProviderInitOptions } from './provider.js';
|
|
4
4
|
import type { UnderstandingCandidate } from './understanding/types.js';
|
|
5
5
|
import type { MemoryDeleteRequest, MemoryListRequest, MemoryReadRequest, MemoryReadResult, MemorySearchRequest, MemorySearchResult, MemoryUpdateRequest, MemoryWriteRequest, MemoryWriteResult, MemoryRecord, MemorySignal, MemoryKind } from './types.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UserContextConfig } from '
|
|
1
|
+
import type { UserContextConfig } from '../../user-context/config.js';
|
|
2
2
|
export type MemorySource = 'session' | 'agentProfile' | 'understanding' | 'workspace';
|
|
3
3
|
export type MemoryWriteTarget = 'agentProfile' | 'understanding' | 'workspace';
|
|
4
4
|
export type MemoryWriteDecision = 'allow' | 'confirm' | 'deny';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
//#region src/agent
|
|
2
|
-
const READ_ONLY_MODES = new Set(["readOnly"]);
|
|
1
|
+
//#region src/agent/memory/runtime.ts
|
|
3
2
|
function normalizeConfidence(value) {
|
|
4
3
|
if (typeof value !== "number" || !Number.isFinite(value)) return .5;
|
|
5
4
|
return Math.max(0, Math.min(1, value));
|
|
@@ -16,7 +15,7 @@ function buildMemoryRuntime(userContext) {
|
|
|
16
15
|
decision: "deny",
|
|
17
16
|
reason: "memory is disabled"
|
|
18
17
|
};
|
|
19
|
-
if (
|
|
18
|
+
if (memory.mode === "readOnly") return {
|
|
20
19
|
decision: "deny",
|
|
21
20
|
reason: "memory is read-only"
|
|
22
21
|
};
|
|
@@ -21,8 +21,6 @@ export interface AgentOrchestratorConfig {
|
|
|
21
21
|
/** Per-session hydration (workspace override + model override) before the agent runs. */
|
|
22
22
|
sessionHydrator: SessionHydrator;
|
|
23
23
|
getThinkingDefault: () => ThinkLevel | undefined;
|
|
24
|
-
/** Per-session default from merged `agents.list` / defaults (optional). */
|
|
25
|
-
getThinkingDefaultForSession?: (sessionKey: string) => ThinkLevel | undefined;
|
|
26
24
|
/** Default workspace root when no per-session resolver is set. */
|
|
27
25
|
workspaceRoot: string;
|
|
28
26
|
/** Per-agent workspace root for attachments (optional; defaults to `workspaceRoot`). */
|
|
@@ -45,7 +43,6 @@ export declare class AgentOrchestrator {
|
|
|
45
43
|
private sessionConfigStore;
|
|
46
44
|
private sessionHydrator;
|
|
47
45
|
private getThinkingDefault;
|
|
48
|
-
private getThinkingDefaultForSession?;
|
|
49
46
|
private enqueueAutoTitle?;
|
|
50
47
|
private getConfig?;
|
|
51
48
|
private onEmbeddedStreamEvent?;
|
|
@@ -24,7 +24,6 @@ var AgentOrchestrator = class {
|
|
|
24
24
|
sessionConfigStore;
|
|
25
25
|
sessionHydrator;
|
|
26
26
|
getThinkingDefault;
|
|
27
|
-
getThinkingDefaultForSession;
|
|
28
27
|
enqueueAutoTitle;
|
|
29
28
|
getConfig;
|
|
30
29
|
onEmbeddedStreamEvent;
|
|
@@ -36,7 +35,6 @@ var AgentOrchestrator = class {
|
|
|
36
35
|
this.sessionConfigStore = config.sessionConfigStore;
|
|
37
36
|
this.sessionHydrator = config.sessionHydrator;
|
|
38
37
|
this.getThinkingDefault = config.getThinkingDefault;
|
|
39
|
-
this.getThinkingDefaultForSession = config.getThinkingDefaultForSession;
|
|
40
38
|
this.enqueueAutoTitle = config.enqueueAutoTitle;
|
|
41
39
|
this.getConfig = config.getConfig;
|
|
42
40
|
this.onEmbeddedStreamEvent = config.onEmbeddedStreamEvent;
|
|
@@ -70,7 +68,7 @@ var AgentOrchestrator = class {
|
|
|
70
68
|
this.agentManager.getOrCreateAgent(sessionKey);
|
|
71
69
|
this.agentManager.applyTurnChannelSystemPrompt(sessionKey, channelSystemPrompt);
|
|
72
70
|
}
|
|
73
|
-
const thinkingDefault = this.
|
|
71
|
+
const thinkingDefault = this.getThinkingDefault();
|
|
74
72
|
const thinkingLevel = await resolveEffectiveThinkingLevel(this.sessionConfigStore, sessionKey, null, thinkingDefault);
|
|
75
73
|
this.agentManager.setThinkingLevel(sessionKey, thinkingLevel);
|
|
76
74
|
const persistedAttachments = await persistInboundAttachments(msg.attachments);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveEffectiveAgentConfigForSession } from "../../config/agent-profile.js";
|
|
2
2
|
//#region src/agent/orchestration/run-agent-turn-with-timeout.ts
|
|
3
3
|
/** Minimum per-turn timeout (1 minute). */
|
|
4
4
|
const MIN_AGENT_TURN_TIMEOUT_MS = 6e4;
|
|
@@ -20,7 +20,7 @@ function isAgentTurnUnsettledError(err) {
|
|
|
20
20
|
}
|
|
21
21
|
function resolveAgentTurnTimeoutMs(config, sessionKey) {
|
|
22
22
|
if (!config) return DEFAULT_AGENT_TURN_TIMEOUT_MS;
|
|
23
|
-
const configured =
|
|
23
|
+
const configured = resolveEffectiveAgentConfigForSession(config, sessionKey).config.runtime.timeoutMs;
|
|
24
24
|
if (!configured) return DEFAULT_AGENT_TURN_TIMEOUT_MS;
|
|
25
25
|
return Math.min(MAX_AGENT_TURN_TIMEOUT_MS, Math.max(MIN_AGENT_TURN_TIMEOUT_MS, configured));
|
|
26
26
|
}
|
|
@@ -283,7 +283,6 @@ var AgentService = class {
|
|
|
283
283
|
sessionHydrator: this.sessionHydrator,
|
|
284
284
|
getConfig: () => this.effectiveAppConfig(),
|
|
285
285
|
getThinkingDefault: () => void 0,
|
|
286
|
-
getThinkingDefaultForSession: (sessionKey) => this.agentManager.getThinkingDefaultForSession(sessionKey),
|
|
287
286
|
workspaceRoot: this.workspaceDir,
|
|
288
287
|
getWorkspaceRootForSession: (sessionKey) => this.agentManager.getResolvedWorkspaceForSession(sessionKey),
|
|
289
288
|
getAgentInternalStorageRootForSession: (sessionKey) => resolveAgentHomeDir(this.config.config, extractProfileAgentId(sessionKey, this.config.config)),
|
|
@@ -8,7 +8,7 @@ init_paths();
|
|
|
8
8
|
init_agent_scope();
|
|
9
9
|
const STARTER_AGENTS_INITIALIZED_VERSION = 1;
|
|
10
10
|
function denyTools(names) {
|
|
11
|
-
return
|
|
11
|
+
return Object.fromEntries(names.map((name) => [name, { mode: "deny" }]));
|
|
12
12
|
}
|
|
13
13
|
function identity(params) {
|
|
14
14
|
return `# IDENTITY.md - Who Am I?\n\n- **Name:** ${params.name}\n- **Description:** ${params.description}\n- **Language:** en\n- **Creature:** ${params.creature}\n- **Emoji:** ${params.emoji}\n- **Avatar:**\n`;
|
|
@@ -158,13 +158,6 @@ function ensureStarterAgentsInitialized(cfg) {
|
|
|
158
158
|
if (hasAgentEntry(next, starter.id)) continue;
|
|
159
159
|
next = applyAgentConfig(next, {
|
|
160
160
|
agentId: starter.id,
|
|
161
|
-
identity: {
|
|
162
|
-
name: starter.displayName,
|
|
163
|
-
description: starter.description,
|
|
164
|
-
role: starter.role,
|
|
165
|
-
language: "en",
|
|
166
|
-
tone: "direct"
|
|
167
|
-
},
|
|
168
161
|
...starter.tools ? { tools: starter.tools } : {}
|
|
169
162
|
});
|
|
170
163
|
}
|
|
@@ -18,7 +18,7 @@ import type { ToolConcurrencyController as ToolConcurrencyControllerType } from
|
|
|
18
18
|
export interface ToolExecutorConfig {
|
|
19
19
|
/** Default per-tool timeout when the tool does not declare its own `timeoutMs`. */
|
|
20
20
|
defaultTimeoutMs: number;
|
|
21
|
-
/** Per-session policy
|
|
21
|
+
/** Per-session policy resolved from global defaults and agent overrides. */
|
|
22
22
|
resolveTimeoutMs?: (toolName: string) => number | undefined;
|
|
23
23
|
/** Max retry attempts for tools opted into retry via `idempotent: true`. */
|
|
24
24
|
maxRetries: number;
|
|
@@ -143,11 +143,7 @@ function resolveDefinitionId(params, catalog, config, sessionKey) {
|
|
|
143
143
|
catalog.load(name);
|
|
144
144
|
return name;
|
|
145
145
|
}
|
|
146
|
-
const configuredDefault = config ? (
|
|
147
|
-
const policy = resolveEffectiveAgentProfileForSession(config, sessionKey).manifest.workflows;
|
|
148
|
-
const intent = params.intent?.trim().toLowerCase();
|
|
149
|
-
return (intent ? policy.suggested?.find((entry) => entry.intent.toLowerCase() === intent)?.workflow : void 0) ?? policy.default;
|
|
150
|
-
})() : void 0;
|
|
146
|
+
const configuredDefault = config ? resolveEffectiveAgentProfileForSession(config, sessionKey).config.workflows.default : void 0;
|
|
151
147
|
if (configuredDefault) {
|
|
152
148
|
catalog.load(configuredDefault);
|
|
153
149
|
return configuredDefault;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { AgentDefaultsSchema, AgentEntrySchema, AgentModelsDefaultsSchema, AgentModelsOverrideSchema, AgentProfileSchema, AgentsConfigSchema, DEFAULT_AGENT_MODEL_REF, EffectiveAgentConfigSchema, ImageGenerationRouteSchema, ModelIntentSchema, ModelRefSchema, ModelRouteSchema, RuntimePolicySchema, SkillDefaultsSchema, SkillOverrideSchema, ToolModeSchema, ToolPoliciesSchema, ToolPolicySchema, WorkflowPolicySchema, init_schema } from "./schema.js";
|
|
3
|
+
import { init_resolver, resolveEffectiveAgentConfig } from "./resolver.js";
|
|
4
|
+
//#region src/agent-config/index.ts
|
|
5
|
+
var init_agent_config = __esmMin((() => {
|
|
6
|
+
init_schema();
|
|
7
|
+
init_resolver();
|
|
8
|
+
}));
|
|
9
|
+
//#endregion
|
|
10
|
+
init_agent_config();
|
|
11
|
+
export { AgentDefaultsSchema, AgentEntrySchema, AgentModelsDefaultsSchema, AgentModelsOverrideSchema, AgentProfileSchema, AgentsConfigSchema, DEFAULT_AGENT_MODEL_REF, EffectiveAgentConfigSchema, ImageGenerationRouteSchema, ModelIntentSchema, ModelRefSchema, ModelRouteSchema, RuntimePolicySchema, SkillDefaultsSchema, SkillOverrideSchema, ToolModeSchema, ToolPoliciesSchema, ToolPolicySchema, WorkflowPolicySchema, init_agent_config, resolveEffectiveAgentConfig };
|