@xopcai/xopc 0.0.369 → 0.0.370
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 +59 -174
- package/README.zh-CN.md +59 -174
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js +131 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js +30 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js +252 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js +16 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js +66 -0
- package/dist/browser-ext/dist/sidepanel.js +21 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Stj17S9u.js → agent-avatar-dicebear-C61i1QbX.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-0fCR1DHx.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-Di99mUTT.js +1 -0
- package/dist/gateway/static/root/assets/agents-BRZZmYH_.js +66 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-pJFe6M6c.js → app-management-settings-panel-noqqxkds.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BrxSpBWa.js → appearance-settings-DG8QN0gR.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DegSl5Lh.js → apps-page-CgiyzFYo.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BZQ_VHjp.js → automations-page-CgAcRFDS.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BIkxIpab.js +6 -0
- package/dist/gateway/static/root/assets/{block-editor-3XjFv3kK.js → block-editor-B1VE-jAe.js} +3 -3
- package/dist/gateway/static/root/assets/browser-automations-page-CIjyMS6f.js +3 -0
- package/dist/gateway/static/root/assets/{browser-settings-page-ch2_bQF0.js → browser-settings-page-BMAivBfp.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-DO-vfNKI.js → capabilities-CY4SiHcP.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-B48r0DDa.js → capabilities-gjQtMhKu.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-DRdcfo68.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-NckMsJ5N.js → capabilities-settings-panel-ZuL6pWjM.js} +4 -4
- package/dist/gateway/static/root/assets/{capability-header-actions-CY8KCO9j.js → capability-header-actions-D0GC1FEv.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-CHOS2CGa.js → channels-CgE22Pzd.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Bwknnb4c.js → chat-terminal-dock-CEjh1utz.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-B2xeFCSt.js → computer-settings-page-vFHJAmQr.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-C83DnAqK.js → connector-service-page-DTrwZ4kV.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DRcMiTWu.js +1 -0
- package/dist/gateway/static/root/assets/copy-text-row-C1gaJwlZ.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-Bq9GR-DU.js → date-picker-NfGIPSYY.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-CqguveUi.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-BwsbQw8V.js → desktop-pet-CTx1zkJm.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-sL9i44pP.js → desktop-pet-settings-BRDS3EGc.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-Du4Ciuyw.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BFlDmsS5.js → directory-picker-path-field-CjstlxFl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-7Z1Tp7-w.js → extension-debug-page-BfAtjhoK.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-uGqvb8QX.js → extension-page-BJmudejr.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-xlSyz4Z6.js → extension-provider-Br6LXyIj.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CKHgrjOs.js → extension-settings-page-UvmHniyz.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-BwQg0G1D.js → fallback-models-euw9MGdt.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-F6D4A7N5.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-BAQnSEMJ.js → gateway-settings-C7roPHh1.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BGNCTtM3.js +2 -0
- package/dist/gateway/static/root/assets/{imports-page-re1_Nh64.js → imports-page-DxCoT0VV.js} +1 -1
- package/dist/gateway/static/root/assets/index-BGBkIIzM.css +1 -0
- package/dist/gateway/static/root/assets/index-FCEE325-.js +106 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B_xja9LN.js → keyboard-shortcuts-settings-CnLln9Ds.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CErdCrPX.js → local-app-workbench-page-yXRkSrEj.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BPL2RXdK.js → local-apps-page-D46buzTk.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-pox8evDV.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-DmcCHnH0.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-khN1ThNL.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-C_t58yha.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-BJ0QS6xx.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-tf77xIz3.js → page-context-capture-button-DfRODHv1.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-CiiXwwQE.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-Dc3Y-Y7J.js → product-open-page-_Bp6HRmm.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-MG_hmVA3.js → product-preview-content-BUdiO0Ct.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-Clb-fXYk.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-MllfNLGA.js → projects-page-D9JEEqhh.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-Bs-C70el.js → remote-access-hub-CmyTq3_l.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DpJ5jNzR.js → runtime-tools-settings-panel-B1_inj8L.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-Dpxamkw6.js → scenes-page-CUNAZN2_.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DUeyQ1zh.js → schema-form-CfT-9UVw.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-Dgn4BRk_.js → send-session-input-BW40VHiL.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-BqlvrjPE.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-CXZKScvu.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-B2vKXmzg.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-DouHuBXt.js → settings-page-1h3vyueg.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Cqc7UlZy.js +1 -0
- package/dist/gateway/static/root/assets/{share-link-dialog-DJTabLAM.js → share-link-dialog-HCHM8qnf.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-jw7h4t_B.js → share-preview-page-Ce6FNWt1.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Dh5jisCK.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-CfyX_0zN.js → skill-api-deDZeQS8.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-DZozl9U_.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-DWf256TE.js → system-settings-panel-CtzyMxqq.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-DE6N1ZQe.js → task-detail-page-5f_V0h-p.js} +2 -2
- package/dist/gateway/static/root/assets/{tunnel-api-BBm9esrY.js → tunnel-api-vMtlbJ-m.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-C93x89uW.js → usage-page-B1-BCW8U.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-C7Gaaai1.js → use-composer-attachments-DJya1hIL.js} +1 -1
- package/dist/gateway/static/root/assets/use-file-preview-expanded-C5ONO7sF.js +2 -0
- package/dist/gateway/static/root/assets/user-model-page-D4BSq9HJ.js +2 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Bs2MKiTv.js → work-discovery-overlay-CjiNYJV5.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BR_U_snV.js → workflow-run-setup-panel-DJOetXvm.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CcAPFh2R.js +6 -0
- package/dist/gateway/static/root/assets/{workspace-api-Si2o3inw.js → workspace-api-WhbMvdBE.js} +2 -2
- package/dist/gateway/static/root/index.html +18 -20
- package/dist/package.js +1 -1
- package/dist/packages/endpoint-tools-client/src/index.js +189 -0
- package/dist/packages/endpoint-tools-protocol/src/bridge.js +105 -0
- package/dist/packages/endpoint-tools-protocol/src/index.js +93 -2
- package/dist/packages/endpoint-tools-protocol/src/location.js +109 -0
- package/dist/packages/gateway-contract/src/session-input-command.js +30 -5
- package/dist/src/agent/agent-manager.js +22 -26
- package/dist/src/agent/embedded/codemode-extension.d.ts +7 -0
- package/dist/src/agent/embedded/codemode-extension.js +232 -0
- package/dist/src/agent/embedded/codemode-output.d.ts +2 -0
- package/dist/src/agent/embedded/codemode-output.js +34 -0
- package/dist/src/agent/embedded/external-tool-discovery.d.ts +6 -0
- package/dist/src/agent/embedded/external-tool-discovery.js +60 -0
- package/dist/src/agent/embedded/model-runtime.js +5 -2
- package/dist/src/agent/embedded/run-for-session.js +10 -1
- package/dist/src/agent/embedded/run-turn.js +10 -3
- package/dist/src/agent/embedded/session-runner.d.ts +9 -1
- package/dist/src/agent/embedded/session-runner.js +111 -23
- package/dist/src/agent/embedded/session-tool-result-guard.d.ts +2 -0
- package/dist/src/agent/embedded/session-tool-result-guard.js +17 -0
- package/dist/src/agent/embedded/subscribe-session.js +14 -4
- package/dist/src/agent/embedded/tool-metadata.d.ts +15 -0
- package/dist/src/agent/embedded/tool-metadata.js +38 -0
- package/dist/src/agent/embedded/tool-search-extension.d.ts +5 -0
- package/dist/src/agent/embedded/tool-search-extension.js +31 -0
- package/dist/src/agent/embedded/types.d.ts +7 -0
- package/dist/src/agent/embedded/xopc-tools-bridge.js +6 -0
- package/dist/src/agent/external-tools/endpoint-provider.d.ts +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +148 -56
- package/dist/src/agent/external-tools/extension-provider.js +8 -1
- package/dist/src/agent/external-tools/gateway-tools.d.ts +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +45 -22
- package/dist/src/agent/external-tools/index.js +46 -14
- package/dist/src/agent/external-tools/memory-provider.js +8 -1
- package/dist/src/agent/external-tools/read-policy.js +2 -1
- package/dist/src/agent/external-tools/service.d.ts +2 -0
- package/dist/src/agent/external-tools/service.js +25 -3
- package/dist/src/agent/external-tools/tool-registry.d.ts +14 -0
- package/dist/src/agent/external-tools/tool-registry.js +14 -0
- package/dist/src/agent/external-tools/types.d.ts +8 -1
- package/dist/src/agent/external-tools/types.js +0 -1
- package/dist/src/agent/mcp/config.d.ts +18 -0
- package/dist/src/agent/mcp/{bundle-mcp-config.js → config.js} +8 -25
- package/dist/src/agent/mcp/native-mcp.d.ts +6 -0
- package/dist/src/agent/mcp/native-mcp.js +73 -0
- package/dist/src/agent/service.js +2 -5
- package/dist/src/agent/skills/installer.js +1 -1
- package/dist/src/agent/skills/skill-manager.js +1 -1
- package/dist/src/agent/skills/skill-sources.js +1 -1
- package/dist/src/agent/source-context/index.d.ts +0 -1
- package/dist/src/agent/source-context/index.js +1 -2
- package/dist/src/agent/source-context/injector.js +1 -0
- package/dist/src/agent/source-context/types.d.ts +2 -2
- package/dist/src/agent/source-context/types.js +1 -1
- package/dist/src/agent/tools/cli-clarify.js +1 -1
- package/dist/src/agent/tools/codemode-permissions.d.ts +4 -0
- package/dist/src/agent/tools/codemode-permissions.js +23 -0
- package/dist/src/agent/tools/dataBatch.js +3 -1
- package/dist/src/agent/tools/delegation-parent-policy.js +1 -4
- package/dist/src/agent/tools/factory.js +4 -3
- package/dist/src/agent/transcript/provider-capabilities.js +0 -1
- package/dist/src/agent/transcript/transcript-policy.js +1 -2
- package/dist/src/agent-config/schema.d.ts +28 -0
- package/dist/src/agent-config/schema.js +7 -0
- package/dist/src/auth/credentials.js +7 -20
- package/dist/src/auth/model-credential-store.js +11 -4
- package/dist/src/auth/oauth/index.d.ts +1 -1
- package/dist/src/auth/oauth/index.js +3 -3
- package/dist/src/auth/oauth/openai.d.ts +2 -0
- package/dist/src/auth/oauth/openai.js +90 -0
- package/dist/src/auth/oauth/registry.js +3 -3
- package/dist/src/auth/oauth/types.d.ts +1 -0
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +5 -0
- package/dist/src/chat-commands/builtins/model.js +2 -2
- package/dist/src/cli/command-manifest.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +0 -19
- package/dist/src/cli/commands/mcp.js +36 -2
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/utils/oauth-login.js +2 -2
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/mcp-config-normalize.d.ts +0 -3
- package/dist/src/config/mcp-config-normalize.js +2 -22
- package/dist/src/config/models-json.d.ts +0 -5
- package/dist/src/config/models-json.js +13 -4
- package/dist/src/config/paths.d.ts +0 -1
- package/dist/src/config/paths.js +1 -4
- package/dist/src/config/schema.d.ts +130 -36
- package/dist/src/config/schema.js +52 -35
- package/dist/src/connectors/auth-provider-registry.d.ts +1 -1
- package/dist/src/connectors/auth-provider-registry.js +1 -21
- package/dist/src/connectors/china-catalog.js +5 -5
- package/dist/src/connectors/connection-recovery-service.d.ts +1 -6
- package/dist/src/connectors/connection-recovery-service.js +3 -105
- package/dist/src/connectors/health.d.ts +1 -2
- package/dist/src/connectors/health.js +2 -101
- package/dist/src/connectors/types.d.ts +1 -1
- package/dist/src/endpoint-tools/binding-service.d.ts +2 -0
- package/dist/src/endpoint-tools/binding-service.js +14 -2
- package/dist/src/endpoint-tools/bridge-host.d.ts +15 -0
- package/dist/src/endpoint-tools/bridge-host.js +166 -0
- package/dist/src/endpoint-tools/bridge.d.ts +27 -0
- package/dist/src/endpoint-tools/bridge.js +88 -0
- package/dist/src/endpoint-tools/capability-catalog.d.ts +2 -0
- package/dist/src/endpoint-tools/capability-catalog.js +8 -0
- package/dist/src/endpoint-tools/grant-service.d.ts +69 -0
- package/dist/src/endpoint-tools/grant-service.js +113 -0
- package/dist/src/endpoint-tools/index.js +1 -1
- package/dist/src/endpoint-tools/invocation-service.js +6 -2
- package/dist/src/endpoint-tools/location-task.d.ts +22 -0
- package/dist/src/endpoint-tools/location-task.js +114 -0
- package/dist/src/endpoint-tools/policy.js +16 -1
- package/dist/src/endpoint-tools/registry.d.ts +2 -0
- package/dist/src/endpoint-tools/registry.js +9 -0
- package/dist/src/endpoint-tools/result-projector.d.ts +15 -0
- package/dist/src/endpoint-tools/result-projector.js +31 -0
- package/dist/src/endpoint-tools/runtime.d.ts +2 -0
- package/dist/src/endpoint-tools/runtime.js +15 -2
- package/dist/src/endpoint-tools/target-resolver.d.ts +12 -0
- package/dist/src/endpoint-tools/target-resolver.js +27 -0
- package/dist/src/endpoint-tools/turn-context.d.ts +6 -0
- package/dist/src/endpoint-tools/turn-context.js +29 -0
- package/dist/src/extensions/agent-plugins/auth.d.ts +0 -2
- package/dist/src/extensions/agent-plugins/auth.js +2 -19
- package/dist/src/extensions/agent-plugins/credentials.js +3 -19
- package/dist/src/extensions/agent-plugins/inventory.d.ts +2 -2
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +1 -5
- package/dist/src/extensions/agent-plugins/source-http-fetch.d.ts +2 -0
- package/dist/src/{agent/mcp/plugin-http-fetch.js → extensions/agent-plugins/source-http-fetch.js} +7 -7
- package/dist/src/extensions/agent-plugins/sources.js +2 -2
- package/dist/src/extensions/agent-plugins/store.js +1 -3
- package/dist/src/extensions/agent-plugins/validation.d.ts +0 -4
- package/dist/src/extensions/agent-plugins/validation.js +13 -20
- package/dist/src/gateway/agents-admin.d.ts +5 -0
- package/dist/src/gateway/agents-admin.js +56 -1
- package/dist/src/gateway/chat-stream/mapper.js +9 -0
- package/dist/src/gateway/chat-stream/protocol.d.ts +4 -4
- package/dist/src/gateway/hono/lib/config-payload.d.ts +9 -4
- package/dist/src/gateway/hono/lib/config-payload.js +2 -5
- package/dist/src/gateway/hono/oauth-async.js +9 -2
- package/dist/src/gateway/hono/routes/agent-plugins.js +4 -9
- package/dist/src/gateway/hono/routes/agents.js +4 -3
- package/dist/src/gateway/hono/routes/connection-waits.js +2 -5
- package/dist/src/gateway/hono/routes/connectors.js +5 -60
- package/dist/src/gateway/hono/routes/device-authorizations.d.ts +3 -0
- package/dist/src/gateway/hono/routes/device-authorizations.js +74 -0
- package/dist/src/gateway/hono/routes/endpoint-compatibility.js +7 -0
- package/dist/src/gateway/hono/routes/endpoint-tools.d.ts +1 -0
- package/dist/src/gateway/hono/routes/endpoint-tools.js +53 -3
- package/dist/src/gateway/hono/routes/lazy-bundles.js +17 -1
- package/dist/src/gateway/hono/routes/mcp.d.ts +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +11 -237
- package/dist/src/gateway/hono/routes/session-command-handler.js +11 -1
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +8 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +25 -1
- package/dist/src/gateway/service/config-coordinator.js +2 -5
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +13 -5
- package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -1
- package/dist/src/gateway/service/session-input-coordinator.js +29 -9
- package/dist/src/gateway/service/sessions-api.js +0 -6
- package/dist/src/gateway/service.js +3 -12
- package/dist/src/gateway/session-reset-service.js +0 -6
- package/dist/src/imports/compatibility.js +12 -10
- package/dist/src/mcp/channel-bridge.js +1 -1
- package/dist/src/providers/env-keys.js +1 -1
- package/dist/src/providers/index.js +26 -24
- package/dist/src/providers/model-call.d.ts +0 -2
- package/dist/src/providers/model-call.js +2 -6
- package/dist/src/providers/model-registry.js +4 -2
- package/dist/src/providers/model-supplements.d.ts +3 -3
- package/dist/src/providers/model-supplements.js +6 -27
- package/dist/src/providers/presentation.js +3 -8
- package/dist/src/providers/prompt-cache-plan.js +1 -1
- package/dist/src/providers/provider-auth-service.d.ts +1 -1
- package/dist/src/providers/provider-auth-service.js +7 -2
- package/dist/src/providers/provider-policy.d.ts +3 -0
- package/dist/src/providers/provider-policy.js +14 -0
- package/dist/src/providers/register-runtime-providers.js +6 -1
- package/dist/src/realtime/runtime.js +1 -1
- package/dist/src/session/store.js +7 -1
- package/dist/src/session/transcript-events.d.ts +5 -0
- package/dist/src/session/transcript-events.js +1 -0
- package/dist/src/session/types.d.ts +2 -0
- package/dist/src/storage/sqlite/device-grant-audit-repository.d.ts +11 -0
- package/dist/src/storage/sqlite/device-grant-audit-repository.js +10 -0
- package/dist/src/storage/sqlite/endpoint-device-settings-repository.d.ts +7 -0
- package/dist/src/storage/sqlite/endpoint-device-settings-repository.js +17 -0
- package/dist/src/storage/sqlite/migrations/240_device_settings.sql +5 -0
- package/dist/src/storage/sqlite/migrations/241_device_grant_audit.sql +13 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/session-input-repository.js +5 -1
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/xopc-tui-keybindings.d.ts +4 -4
- package/package.json +19 -8
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CCRfvuov.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CRlzd8El.js +0 -1
- package/dist/gateway/static/root/assets/agents-_ug2LCQb.js +0 -66
- package/dist/gateway/static/root/assets/automations-workspace-BQywN6nG.js +0 -6
- package/dist/gateway/static/root/assets/browser-automations-page-yiEuG1v7.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-BEnFt_dj.js +0 -2
- package/dist/gateway/static/root/assets/connectors-page-D6wTmWA6.js +0 -2
- package/dist/gateway/static/root/assets/copy-text-row-BHDs3cBa.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-BTERkA9X.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DI2bqaKO.js +0 -1
- package/dist/gateway/static/root/assets/dist-Che_jiQF.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-DDWymi-o.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BZDjvwet.js +0 -2
- package/dist/gateway/static/root/assets/index-BB1z8QxA.js +0 -106
- package/dist/gateway/static/root/assets/index-D9R6tU7r.css +0 -1
- package/dist/gateway/static/root/assets/link-2-D_ZKYUW7.js +0 -1
- package/dist/gateway/static/root/assets/local-session-drafts-DRPsDCj1.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-DL-BM0xq.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-BOVRHhXk.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-DJJK2yL4.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-oCxO7ZTv.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-DOk9gUK5.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-3uAzbW4T.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-LInoZ_Yi.js +0 -16
- package/dist/gateway/static/root/assets/sessions-page-BCVlNHtq.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Bz-ue9fZ.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-B5BoZ-1y.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BlnlzGjH.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-DjdTeYzm.js +0 -2
- package/dist/gateway/static/root/assets/use-file-preview-expanded-Db2VYg1b.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-B74LkVbp.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-Crk4SxtC.js +0 -6
- package/dist/src/agent/embedded/system-prompt-override.d.ts +0 -2
- package/dist/src/agent/embedded/system-prompt-override.js +0 -21
- package/dist/src/agent/external-tools/mcp-provider.d.ts +0 -32
- package/dist/src/agent/external-tools/mcp-provider.js +0 -208
- package/dist/src/agent/mcp/bundle-mcp-config.d.ts +0 -20
- package/dist/src/agent/mcp/bundle-mcp-gateway.d.ts +0 -79
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +0 -93
- package/dist/src/agent/mcp/bundle-mcp-names.d.ts +0 -1
- package/dist/src/agent/mcp/bundle-mcp-names.js +0 -25
- package/dist/src/agent/mcp/bundle-mcp-policy.d.ts +0 -1
- package/dist/src/agent/mcp/bundle-mcp-policy.js +0 -6
- package/dist/src/agent/mcp/bundle-mcp-runtime.d.ts +0 -46
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +0 -571
- package/dist/src/agent/mcp/bundle-mcp-tools.d.ts +0 -2
- package/dist/src/agent/mcp/bundle-mcp-tools.js +0 -2
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +0 -76
- package/dist/src/agent/mcp/bundle-mcp-types.js +0 -1
- package/dist/src/agent/mcp/embedded-mcp.d.ts +0 -10
- package/dist/src/agent/mcp/embedded-mcp.js +0 -14
- package/dist/src/agent/mcp/index.d.ts +0 -5
- package/dist/src/agent/mcp/index.js +0 -12
- package/dist/src/agent/mcp/mcp-config-shared.d.ts +0 -8
- package/dist/src/agent/mcp/mcp-config-shared.js +0 -39
- package/dist/src/agent/mcp/mcp-http.d.ts +0 -23
- package/dist/src/agent/mcp/mcp-http.js +0 -67
- package/dist/src/agent/mcp/mcp-resource-id.d.ts +0 -6
- package/dist/src/agent/mcp/mcp-resource-id.js +0 -19
- package/dist/src/agent/mcp/mcp-stdio-transport.d.ts +0 -26
- package/dist/src/agent/mcp/mcp-stdio-transport.js +0 -120
- package/dist/src/agent/mcp/mcp-stdio.d.ts +0 -18
- package/dist/src/agent/mcp/mcp-stdio.js +0 -35
- package/dist/src/agent/mcp/mcp-transport-config.d.ts +0 -28
- package/dist/src/agent/mcp/mcp-transport-config.js +0 -91
- package/dist/src/agent/mcp/mcp-transport.d.ts +0 -17
- package/dist/src/agent/mcp/mcp-transport.js +0 -141
- package/dist/src/agent/mcp/oauth/index.d.ts +0 -6
- package/dist/src/agent/mcp/oauth/index.js +0 -6
- package/dist/src/agent/mcp/oauth/mcp-oauth-errors.d.ts +0 -5
- package/dist/src/agent/mcp/oauth/mcp-oauth-errors.js +0 -14
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.d.ts +0 -30
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +0 -276
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.d.ts +0 -33
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.js +0 -103
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.d.ts +0 -31
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.js +0 -181
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.d.ts +0 -12
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +0 -91
- package/dist/src/agent/mcp/oauth/mcp-oauth-types.d.ts +0 -22
- package/dist/src/agent/mcp/oauth/mcp-oauth-types.js +0 -1
- package/dist/src/agent/mcp/plugin-http-fetch.d.ts +0 -2
- package/dist/src/agent/source-context/mcp-resource-context.d.ts +0 -8
- package/dist/src/agent/source-context/mcp-resource-context.js +0 -30
- package/dist/src/auth/oauth/openai-codex.d.ts +0 -9
- package/dist/src/auth/oauth/openai-codex.js +0 -414
- package/dist/src/connectors/plugin-mcp-recovery.d.ts +0 -28
- package/dist/src/connectors/plugin-mcp-recovery.js +0 -90
- package/dist/src/extensions/agent-plugins/connection.d.ts +0 -8
- package/dist/src/extensions/agent-plugins/connection.js +0 -41
- package/dist/src/extensions/agent-plugins/health.d.ts +0 -4
- package/dist/src/extensions/agent-plugins/health.js +0 -48
- package/dist/src/extensions/agent-plugins/plugin-oauth-scope.d.ts +0 -1
- package/dist/src/extensions/agent-plugins/plugin-oauth-scope.js +0 -8
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../../utils/logger.js";
|
|
3
3
|
import { browserPageContextsInputSchema } from "../../../../packages/gateway-contract/src/browser-page-context.js";
|
|
4
|
+
import { endpointContextSchema } from "../../../../packages/gateway-contract/src/session-input-command.js";
|
|
4
5
|
import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packages/gateway-contract/src/user-turn-document.js";
|
|
5
6
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
6
7
|
import { endpointTurnClaimSchema, init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
@@ -15,6 +16,7 @@ import { commandRegistry } from "../../../chat-commands/registry.js";
|
|
|
15
16
|
import "../../../chat-commands/index.js";
|
|
16
17
|
import { isVoiceLikeAttachment } from "../../../channels/attachments/voice-stt-webchat.js";
|
|
17
18
|
import { parseTurnContextRefs } from "../../../agent/source-context/types.js";
|
|
19
|
+
import { deviceTurnSourceContext, endpointClaimBelongsToPrincipal } from "../../../endpoint-tools/turn-context.js";
|
|
18
20
|
import { withModelConfigLock } from "../../../session/model-config-lock.js";
|
|
19
21
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
20
22
|
import { browserPageContextToAgentContext } from "../../../agent/source-context/browser-page.js";
|
|
@@ -127,6 +129,21 @@ async function submitSessionInput(c, deps, conversationId, options) {
|
|
|
127
129
|
message: "Endpoint connection is not active"
|
|
128
130
|
}
|
|
129
131
|
}, 401);
|
|
132
|
+
if (!endpointClaimBelongsToPrincipal(deps.service.endpointTools.registry, origin.data.endpointId, getGatewayPrincipal(c))) return c.json({
|
|
133
|
+
ok: false,
|
|
134
|
+
error: {
|
|
135
|
+
code: "FORBIDDEN",
|
|
136
|
+
message: "Endpoint does not belong to the authenticated device"
|
|
137
|
+
}
|
|
138
|
+
}, 403);
|
|
139
|
+
const environment = endpointContextSchema.optional().safeParse(body.endpointContext);
|
|
140
|
+
if (!environment.success) return c.json({
|
|
141
|
+
ok: false,
|
|
142
|
+
error: {
|
|
143
|
+
code: "BAD_REQUEST",
|
|
144
|
+
message: "Invalid device context"
|
|
145
|
+
}
|
|
146
|
+
}, 400);
|
|
130
147
|
if (browserContexts.data.length && deps.service.endpointTools.registry.get(origin.data.endpointId)?.kind !== "browser") return c.json({
|
|
131
148
|
ok: false,
|
|
132
149
|
error: {
|
|
@@ -176,7 +193,7 @@ async function submitSessionInput(c, deps, conversationId, options) {
|
|
|
176
193
|
}, 409);
|
|
177
194
|
}
|
|
178
195
|
}
|
|
179
|
-
const sourceContexts = browserContexts.data.map(browserPageContextToAgentContext);
|
|
196
|
+
const sourceContexts = [deviceTurnSourceContext(deps.service.endpointTools.registry.get(origin.data.endpointId), environment.data), ...browserContexts.data.map(browserPageContextToAgentContext)];
|
|
180
197
|
if (body.appContext !== void 0) try {
|
|
181
198
|
sourceContexts.push(await deps.service.prepareSessionAppContext(body.appContext, getGatewayPrincipal(c), conversationId, typeof body.clientMessageId === "string" ? body.clientMessageId.trim() : ""));
|
|
182
199
|
} catch (error) {
|
|
@@ -300,6 +317,13 @@ async function replaceLatestSessionTurn(c, deps, conversationId, targetTurnId) {
|
|
|
300
317
|
message: "Endpoint connection is not active"
|
|
301
318
|
}
|
|
302
319
|
}, 401);
|
|
320
|
+
if (!endpointClaimBelongsToPrincipal(deps.service.endpointTools.registry, origin.data.endpointId, getGatewayPrincipal(c))) return c.json({
|
|
321
|
+
ok: false,
|
|
322
|
+
error: {
|
|
323
|
+
code: "FORBIDDEN",
|
|
324
|
+
message: "Endpoint does not belong to the authenticated device"
|
|
325
|
+
}
|
|
326
|
+
}, 403);
|
|
303
327
|
return withModelConfigLock(conversationId, async () => {
|
|
304
328
|
if (deps.service.voiceRealtime?.hasConversation(conversationId)) return c.json({
|
|
305
329
|
ok: false,
|
|
@@ -3,9 +3,8 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
import { configureTracing } from "../../observability/runtime.js";
|
|
4
4
|
import { getModelRegistry } from "../../providers/model-registry.js";
|
|
5
5
|
import { init_providers } from "../../providers/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { evictAllEmbeddedSessionRunners } from "../../agent/embedded/session-runner.js";
|
|
7
7
|
import { reloadImageGenerationProviders } from "../../agent/image/generation/provider-registry.js";
|
|
8
|
-
import "../../agent/mcp/bundle-mcp-tools.js";
|
|
9
8
|
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
10
9
|
import { ConfigHotReloader } from "../../config/reload.js";
|
|
11
10
|
import "../../config/index.js";
|
|
@@ -280,9 +279,7 @@ var GatewayConfigCoordinator = class {
|
|
|
280
279
|
handleMcpReload(newConfig) {
|
|
281
280
|
log.debug("Reloading MCP config...");
|
|
282
281
|
this.opts.setConfig(newConfig);
|
|
283
|
-
|
|
284
|
-
log.warn({ err }, "MCP runtime dispose on config reload failed");
|
|
285
|
-
});
|
|
282
|
+
evictAllEmbeddedSessionRunners("mcp_config_reload");
|
|
286
283
|
this.opts.emit("config.reload", { section: "mcp" });
|
|
287
284
|
log.debug("MCP config reloaded");
|
|
288
285
|
}
|
|
@@ -5,10 +5,10 @@ import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope
|
|
|
5
5
|
import { init_paths, resolveExtensionsDir } from "../../config/paths.js";
|
|
6
6
|
import { removeSkillsLockEntry } from "../../agent/skills/hub-lock.js";
|
|
7
7
|
import { deleteManagedSkill, installSkillFromZip, listManagedSkillDirs } from "../../agent/skills/managed-store.js";
|
|
8
|
-
import { getExtensionLockfileManager } from "../../extensions/lockfile.js";
|
|
9
|
-
import { AgentPluginStore } from "../../extensions/agent-plugins/store.js";
|
|
10
8
|
import { createSkillConfigManager } from "../../agent/skills/config.js";
|
|
11
9
|
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "../../agent/skills/workspace-skills-dir.js";
|
|
10
|
+
import { getExtensionLockfileManager } from "../../extensions/lockfile.js";
|
|
11
|
+
import { AgentPluginStore } from "../../extensions/agent-plugins/store.js";
|
|
12
12
|
import { normalizeSkillInstallTarget } from "../../agent/skills/install-target.js";
|
|
13
13
|
import { isAgentPluginArchive, withAgentPluginArchive } from "../../extensions/agent-plugins/sources.js";
|
|
14
14
|
import { existsSync, rmSync } from "node:fs";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { inboundCorrelationMetadataFromAsyncLogContext, updateAsyncLogContext } from "../../utils/logger/context.js";
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
|
+
import { parseTurnOutcome } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
5
|
+
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
4
6
|
import { init_session_input_repository, listTaskUpdateTriggers } from "../../storage/sqlite/session-input-repository.js";
|
|
5
7
|
import { init_clarification_wait_repository, isClarificationSuspended } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
6
8
|
import { updateInteractionStateFromMessage } from "../../storage/sqlite/interaction-state-repository.js";
|
|
@@ -23,6 +25,7 @@ import crypto from "crypto";
|
|
|
23
25
|
//#region src/gateway/service/run-gateway-agent.ts
|
|
24
26
|
init_connection_wait_repository();
|
|
25
27
|
init_clarification_wait_repository();
|
|
28
|
+
init_src();
|
|
26
29
|
init_logger();
|
|
27
30
|
init_session_key();
|
|
28
31
|
init_sqlite();
|
|
@@ -165,6 +168,7 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
165
168
|
});
|
|
166
169
|
}
|
|
167
170
|
let streamError;
|
|
171
|
+
let embeddedAborted = false;
|
|
168
172
|
try {
|
|
169
173
|
const eventStream = agentService.turnDispatcher.processDirectStreaming(stampedMessage, conversationId, origin, prepared, thinking, {
|
|
170
174
|
signal: mergedSignal,
|
|
@@ -182,22 +186,26 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
182
186
|
}
|
|
183
187
|
});
|
|
184
188
|
const mappedEvents = (async function* () {
|
|
185
|
-
for await (const event of eventStream)
|
|
189
|
+
for await (const event of eventStream) {
|
|
190
|
+
if (event.type === "turn_outcome" && parseTurnOutcome(event.outcome)?.summary === "aborted") embeddedAborted = true;
|
|
191
|
+
yield* mapper.map(event);
|
|
192
|
+
}
|
|
186
193
|
})();
|
|
187
194
|
for await (const event of coalesceThinkingDeltas(mappedEvents)) yield* emitAndYield([event]);
|
|
188
195
|
const connectionSuspended = isConnectionSuspended(conversationId, runId);
|
|
189
196
|
const clarificationSuspended = isClarificationSuspended(conversationId, runId);
|
|
190
197
|
const suspended = connectionSuspended || clarificationSuspended;
|
|
191
|
-
const
|
|
192
|
-
const
|
|
193
|
-
|
|
198
|
+
const cancelled = mergedSignal.aborted || embeddedAborted;
|
|
199
|
+
const endStatus = cancelled ? "cancelled" : suspended ? "suspended" : "success";
|
|
200
|
+
const endSummary = cancelled ? "Interrupted" : connectionSuspended ? "Waiting for connection" : clarificationSuspended ? "Waiting for user input" : "Message processed successfully";
|
|
201
|
+
taskRunStatus = cancelled ? "cancelled" : "succeeded";
|
|
194
202
|
terminalStatus = endStatus;
|
|
195
203
|
taskRunSummary = endSummary;
|
|
196
204
|
yield* emitAndYield(mapper.end(endStatus, endSummary));
|
|
197
205
|
completeRealtimeTopic(`run:${runId}`);
|
|
198
206
|
runTopicCompleted = true;
|
|
199
207
|
return {
|
|
200
|
-
status:
|
|
208
|
+
status: cancelled ? "aborted" : suspended ? "suspended" : "ok",
|
|
201
209
|
summary: endSummary
|
|
202
210
|
};
|
|
203
211
|
} catch (error) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TurnOrigin } from '@xopcai/endpoint-tools-protocol';
|
|
2
|
-
import type
|
|
2
|
+
import { type SessionInput } from '../../storage/sqlite/session-input-repository.js';
|
|
3
3
|
import type { UserTurnAttachment } from '../user-turn-input.js';
|
|
4
4
|
import { type AgentSourceContext, type TurnContextRef } from '../../agent/source-context/types.js';
|
|
5
5
|
import { type SessionInputDelivery, type SessionInputState } from '../../storage/sqlite/index.js';
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { SessionInstanceChangedError, cancelQueuedSessionInput, claimNextSessionInput, findSessionInput, finishSessionInputRun, getSessionInputById, getSessionInputState, init_session_input_repository, insertSessionInput, mutateQueuedSessionInput, recoverSessionInputState, setSessionInputStatus } from "../../storage/sqlite/session-input-repository.js";
|
|
3
|
+
import { SessionInstanceChangedError, cancelQueuedSessionInput, claimNextSessionInput, findSessionInput, findSessionInputByRunId, finishSessionInputRun, getSessionInputById, getSessionInputState, init_session_input_repository, insertSessionInput, mutateQueuedSessionInput, recoverSessionInputState, setSessionInputStatus } from "../../storage/sqlite/session-input-repository.js";
|
|
4
4
|
import { consumeClarificationResume, init_clarification_wait_repository, supersedeActiveClarification } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
5
5
|
import { replaceLatestSessionTurnAndQueueInput, validateLatestSessionTurnTarget } from "../../storage/sqlite/session-turn-replace-repository.js";
|
|
6
6
|
import { cancelConnectionObjective, consumeConnectionResume, init_connection_wait_repository, invalidateConnectionResumeIntent, publishConnectionWait } from "../../storage/sqlite/connection-wait-repository.js";
|
|
7
7
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
8
8
|
import { summarizeSourceContext } from "../../agent/source-context/types.js";
|
|
9
|
+
import { injectSourceContextsIntoUserMessage } from "../../agent/source-context/injector.js";
|
|
9
10
|
import { deleteMediaUrisNoLongerReferenced } from "../../media/session-references.js";
|
|
10
11
|
import { fitSourceContextsToBudget } from "../../agent/source-context/budget.js";
|
|
11
12
|
import crypto from "node:crypto";
|
|
12
13
|
import { isDeepStrictEqual } from "node:util";
|
|
13
14
|
//#region src/gateway/service/session-input-coordinator.ts
|
|
15
|
+
init_session_input_repository();
|
|
14
16
|
init_connection_wait_repository();
|
|
15
17
|
init_clarification_wait_repository();
|
|
16
|
-
init_session_input_repository();
|
|
17
18
|
init_sqlite();
|
|
18
19
|
init_logger();
|
|
19
20
|
const log = createLogger("SessionInputCoordinator");
|
|
@@ -23,10 +24,23 @@ function sameAppContext(input, existing) {
|
|
|
23
24
|
snapshot: source.appContext,
|
|
24
25
|
principal: source.appContextGrant?.principal.principalId
|
|
25
26
|
})) ?? [];
|
|
26
|
-
return isDeepStrictEqual(identity(input.sourceContexts), identity(existing.contextSnapshots));
|
|
27
|
+
return isDeepStrictEqual(input.origin, existing.origin) && isDeepStrictEqual(identity(input.sourceContexts), identity(existing.contextSnapshots));
|
|
28
|
+
}
|
|
29
|
+
function canSteerContexts(state, origin, contexts) {
|
|
30
|
+
if (!contexts?.length) return true;
|
|
31
|
+
const active = state.activeInputId ? getSessionInputById(state.conversationId, state.activeInputId) : void 0;
|
|
32
|
+
return Boolean(active && isDeepStrictEqual(active.origin, origin) && contexts.every((context) => context.kind === "device_context"));
|
|
33
|
+
}
|
|
34
|
+
function steeringText(content, contexts) {
|
|
35
|
+
if (!contexts?.length) return content;
|
|
36
|
+
return injectSourceContextsIntoUserMessage({
|
|
37
|
+
role: "user",
|
|
38
|
+
content,
|
|
39
|
+
timestamp: Date.now()
|
|
40
|
+
}, contexts).content[0].text;
|
|
27
41
|
}
|
|
28
42
|
function contextRefsMatchFrozenSnapshot(requested, frozen) {
|
|
29
|
-
const editable = frozen?.filter((ref) => ref.kind === "note" || ref.kind === "task" || ref.kind === "file" || ref.kind === "session" || ref.kind === "browser_tab" || ref.kind === "
|
|
43
|
+
const editable = frozen?.filter((ref) => ref.kind === "note" || ref.kind === "task" || ref.kind === "file" || ref.kind === "session" || ref.kind === "browser_tab" || ref.kind === "user_assertion") ?? [];
|
|
30
44
|
if (requested.length !== editable.length) return false;
|
|
31
45
|
return requested.every((ref, index) => {
|
|
32
46
|
const snapshot = editable[index];
|
|
@@ -74,13 +88,13 @@ var SessionInputCoordinator = class {
|
|
|
74
88
|
this.prioritizeAcceptedInput(row, state);
|
|
75
89
|
return;
|
|
76
90
|
}
|
|
77
|
-
if (row.requestedDelivery !== "steer" || !state.activeRunId || row.attachments?.length || row.contextSnapshots
|
|
91
|
+
if (row.requestedDelivery !== "steer" || !state.activeRunId || row.attachments?.length || !canSteerContexts(state, row.origin, row.contextSnapshots) || state.preparation && state.preparation.state !== "ready") return;
|
|
78
92
|
setSessionInputStatus(row.id, "injecting", {
|
|
79
93
|
effectiveDelivery: "steer",
|
|
80
94
|
targetRunId: state.activeRunId
|
|
81
95
|
});
|
|
82
96
|
try {
|
|
83
|
-
if (!await this.deps.steer(row.conversationId, row.content)) setSessionInputStatus(row.id, "queued", {
|
|
97
|
+
if (!await this.deps.steer(row.conversationId, steeringText(row.content, row.contextSnapshots))) setSessionInputStatus(row.id, "queued", {
|
|
84
98
|
effectiveDelivery: "next",
|
|
85
99
|
targetRunId: null
|
|
86
100
|
});
|
|
@@ -180,6 +194,7 @@ var SessionInputCoordinator = class {
|
|
|
180
194
|
};
|
|
181
195
|
const existing = findSessionInput(conversationId, clientMessageId);
|
|
182
196
|
if (existing) {
|
|
197
|
+
input.origin = existing.origin;
|
|
183
198
|
if (!sameAppContext(input, existing)) return {
|
|
184
199
|
ok: false,
|
|
185
200
|
code: "CONTEXT_UNAVAILABLE"
|
|
@@ -192,6 +207,11 @@ var SessionInputCoordinator = class {
|
|
|
192
207
|
}
|
|
193
208
|
const target = validateLatestSessionTurnTarget(conversationId, targetTurnId);
|
|
194
209
|
if (target.ok === false) return target;
|
|
210
|
+
const original = findSessionInputByRunId(conversationId, targetTurnId);
|
|
211
|
+
if (original) {
|
|
212
|
+
input.origin = original.origin;
|
|
213
|
+
input.sourceContexts = [...(input.sourceContexts ?? []).filter((source) => source.kind !== "device_context"), ...(original.contextSnapshots ?? []).filter((source) => source.kind === "device_context")];
|
|
214
|
+
}
|
|
195
215
|
const attachments = await this.deps.prepareAttachments(conversationId, input.attachments);
|
|
196
216
|
let sourceContexts;
|
|
197
217
|
try {
|
|
@@ -284,7 +304,7 @@ var SessionInputCoordinator = class {
|
|
|
284
304
|
}
|
|
285
305
|
const runtime = this.snapshot(conversationId);
|
|
286
306
|
const priority = input.interrupt !== false && this.deps.prioritizeInput?.(input) === true;
|
|
287
|
-
const canSteer = !priority && input.delivery === "steer" && runtime.activeRunId !== void 0 && !attachments?.length &&
|
|
307
|
+
const canSteer = !priority && input.delivery === "steer" && runtime.activeRunId !== void 0 && !attachments?.length && canSteerContexts(runtime, input.origin, sourceContexts);
|
|
288
308
|
const effectiveDelivery = canSteer ? "steer" : "next";
|
|
289
309
|
const row = insertSessionInput({
|
|
290
310
|
expectedTranscriptId: input.expectedTranscriptId,
|
|
@@ -314,7 +334,7 @@ var SessionInputCoordinator = class {
|
|
|
314
334
|
};
|
|
315
335
|
}
|
|
316
336
|
if (canSteer) {
|
|
317
|
-
if (!await this.deps.steer(conversationId, content)) {
|
|
337
|
+
if (!await this.deps.steer(conversationId, steeringText(content, sourceContexts))) {
|
|
318
338
|
setSessionInputStatus(row.id, "queued", {
|
|
319
339
|
effectiveDelivery: "next",
|
|
320
340
|
targetRunId: null
|
|
@@ -414,7 +434,7 @@ var SessionInputCoordinator = class {
|
|
|
414
434
|
const existing = getSessionInputById(conversationId, id);
|
|
415
435
|
if (!contextRefsMatchFrozenSnapshot(body.contextRefs, existing?.contextRefs)) try {
|
|
416
436
|
const resolved = await this.deps.prepareContexts(conversationId, body.contextRefs) ?? [];
|
|
417
|
-
sourceContexts = fitSourceContextsToBudget([...existing?.contextSnapshots?.filter((source) => source.kind === "app_context" || source.kind === "browser_page") ?? [], ...resolved]);
|
|
437
|
+
sourceContexts = fitSourceContextsToBudget([...existing?.contextSnapshots?.filter((source) => source.kind === "app_context" || source.kind === "browser_page" || source.kind === "device_context") ?? [], ...resolved]);
|
|
418
438
|
} catch (err) {
|
|
419
439
|
log.warn({
|
|
420
440
|
err,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../../routing/agent-session-key.js";
|
|
2
2
|
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
3
|
-
import { retireSessionMcpRuntimeForConversationId } from "../../agent/mcp/bundle-mcp-runtime.js";
|
|
4
3
|
import { buildSessionTimeline } from "../../session/transcript-outline.js";
|
|
5
4
|
import { transcriptRowsToClientHistory } from "../../session/client-history.js";
|
|
6
|
-
import "../../agent/mcp/bundle-mcp-tools.js";
|
|
7
5
|
import { collectMediaUrisFromValues, deleteMediaUris } from "../../media/session-references.js";
|
|
8
6
|
import { withModelConfigLock } from "../../session/model-config-lock.js";
|
|
9
7
|
import { publicExecutionDetail } from "../../session/execution-detail.js";
|
|
@@ -180,10 +178,6 @@ var GatewaySessionsApi = class {
|
|
|
180
178
|
if (result) {
|
|
181
179
|
await deleteMediaUris(collectMediaUrisFromValues(transcriptRows));
|
|
182
180
|
this.opts.getAgentService().evictSessionAgent(key);
|
|
183
|
-
await retireSessionMcpRuntimeForConversationId({
|
|
184
|
-
conversationId: key,
|
|
185
|
-
reason: "session-delete"
|
|
186
|
-
});
|
|
187
181
|
}
|
|
188
182
|
return { deleted: result };
|
|
189
183
|
}
|
|
@@ -34,7 +34,6 @@ import "../knowledge-memory/index.js";
|
|
|
34
34
|
import { getPersonalAgentByConversation } from "../personal-agent/repository.js";
|
|
35
35
|
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
36
36
|
import { getEmbeddedExecutionSession } from "../agent/embedded/execution-context.js";
|
|
37
|
-
import { disposeAllSessionMcpRuntimes } from "../agent/mcp/bundle-mcp-runtime.js";
|
|
38
37
|
import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
|
|
39
38
|
import { ProjectService } from "../projects/project-service.js";
|
|
40
39
|
import { resolveProjectAgentId } from "../projects/project-agent.js";
|
|
@@ -44,6 +43,7 @@ import { runMemoryMaintenance } from "../memory-maintenance/service.js";
|
|
|
44
43
|
import "../memory-maintenance/index.js";
|
|
45
44
|
import { RealtimeExtensionBrowserProvider } from "../browser/providers/realtime-extension.js";
|
|
46
45
|
import { onSessionTranscriptUpdate } from "../session/transcript-events.js";
|
|
46
|
+
import { drainEmbeddedSessionRunnerShutdowns, evictAllEmbeddedSessionRunners } from "../agent/embedded/session-runner.js";
|
|
47
47
|
import { buildNoteAgentContext } from "../notes/agent-context.js";
|
|
48
48
|
import { NotesStore } from "../notes/store.js";
|
|
49
49
|
import { NotesService } from "../notes/service.js";
|
|
@@ -56,7 +56,6 @@ import { createProductDispatcher } from "../capabilities/runtime/product.js";
|
|
|
56
56
|
import "../automations/index.js";
|
|
57
57
|
import { TaskRunDispatcher } from "../tasks/task-run-dispatcher.js";
|
|
58
58
|
import "../tasks/index.js";
|
|
59
|
-
import "../agent/mcp/bundle-mcp-tools.js";
|
|
60
59
|
import { areExtensionsGloballyDisabled } from "../extensions/discover-extensions.js";
|
|
61
60
|
import { SessionIndex } from "../session/manager.js";
|
|
62
61
|
import "../session/index.js";
|
|
@@ -103,7 +102,6 @@ import { createBackgroundTask } from "../infra/background-task.js";
|
|
|
103
102
|
import { buildTaskAgentContext } from "../agent/source-context/task-context.js";
|
|
104
103
|
import { buildFileAgentContext } from "../agent/source-context/file-context.js";
|
|
105
104
|
import { buildSessionAgentContext } from "../agent/source-context/session-context.js";
|
|
106
|
-
import { buildMcpResourceAgentContext } from "../agent/source-context/mcp-resource-context.js";
|
|
107
105
|
import { buildBrowserTabAgentContext } from "../agent/source-context/browser-tab.js";
|
|
108
106
|
import { buildUserAssertionAgentContext } from "../agent/source-context/user-assertion-context.js";
|
|
109
107
|
import { WorkDiscoveryService } from "../work-discovery/service.js";
|
|
@@ -538,12 +536,6 @@ var GatewayService = class {
|
|
|
538
536
|
const [metadata, messages] = await Promise.all([this.sessionIndex.getSessionMetadata(ref.sourceId), this.sessionIndex.getStore().loadMessages(ref.sourceId)]);
|
|
539
537
|
return buildSessionAgentContext(metadata, messages, ref.expectedVersion);
|
|
540
538
|
}
|
|
541
|
-
if (ref.kind === "mcp_resource") return buildMcpResourceAgentContext({
|
|
542
|
-
workspaceDir: this.currentWorkspacePath,
|
|
543
|
-
config: this.config,
|
|
544
|
-
sourceId: ref.sourceId,
|
|
545
|
-
expectedVersion: ref.expectedVersion
|
|
546
|
-
});
|
|
547
539
|
if (ref.kind === "browser_tab") {
|
|
548
540
|
const binding = getBrowserTabBindingById(ref.sourceId);
|
|
549
541
|
if (!binding || binding.conversationId !== conversationId || ref.expectedVersion && ref.expectedVersion !== binding.documentId) return null;
|
|
@@ -1596,9 +1588,8 @@ var GatewayService = class {
|
|
|
1596
1588
|
registerClarificationChannelRuntime(null);
|
|
1597
1589
|
this.connectionRecovery.stop();
|
|
1598
1590
|
this.agentRunner.disposeClarifications();
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
});
|
|
1591
|
+
evictAllEmbeddedSessionRunners("gateway_stop");
|
|
1592
|
+
await drainEmbeddedSessionRunnerShutdowns();
|
|
1602
1593
|
await this._agentService?.stop();
|
|
1603
1594
|
this.running = false;
|
|
1604
1595
|
this.bus.shutdown();
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { isPersonalConversation } from "../personal-agent/repository.js";
|
|
4
|
-
import { retireSessionMcpRuntimeForConversationId } from "../agent/mcp/bundle-mcp-runtime.js";
|
|
5
4
|
import { abortEmbeddedRun } from "../agent/embedded/runs.js";
|
|
6
|
-
import "../agent/mcp/bundle-mcp-tools.js";
|
|
7
5
|
//#region src/gateway/session-reset-service.ts
|
|
8
6
|
init_logger();
|
|
9
7
|
const log = createLogger("SessionReset");
|
|
@@ -30,10 +28,6 @@ async function performSessionReset(conversationId, deps) {
|
|
|
30
28
|
};
|
|
31
29
|
try {
|
|
32
30
|
deps.getAgentService().evictSessionAgent(key);
|
|
33
|
-
await retireSessionMcpRuntimeForConversationId({
|
|
34
|
-
conversationId: key,
|
|
35
|
-
reason: "session-reset"
|
|
36
|
-
});
|
|
37
31
|
} catch (err) {
|
|
38
32
|
const em = err instanceof Error ? err.message : String(err);
|
|
39
33
|
log.warn({
|
|
@@ -115,8 +115,12 @@ function inspectMcp(base, name, raw) {
|
|
|
115
115
|
"env",
|
|
116
116
|
"headers",
|
|
117
117
|
"http_headers",
|
|
118
|
-
"
|
|
119
|
-
"
|
|
118
|
+
"tool_timeout_sec",
|
|
119
|
+
"timeout",
|
|
120
|
+
"exposure",
|
|
121
|
+
"toolExposure",
|
|
122
|
+
"description",
|
|
123
|
+
"enabled"
|
|
120
124
|
]);
|
|
121
125
|
for (const [key, v] of Object.entries(value)) {
|
|
122
126
|
if (!supported.has(key)) {
|
|
@@ -131,14 +135,12 @@ function inspectMcp(base, name, raw) {
|
|
|
131
135
|
].includes(key)) {
|
|
132
136
|
if (v && typeof v === "object") item.requiredEnv.push(...Object.keys(v));
|
|
133
137
|
item.findings.push(`${key} values omitted; configure them in xopc`);
|
|
134
|
-
} else if (key === "type")
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
} else if (key === "startup_timeout_sec" || key === "tool_timeout_sec") if (typeof v === "number") draft[key === "startup_timeout_sec" ? "connectionTimeoutMs" : "requestTimeoutMs"] = v * 1e3;
|
|
138
|
+
} else if (key === "type") if (v === "http" || v === "streamable-http" || v === "stdio") draft.type = v;
|
|
139
|
+
else {
|
|
140
|
+
item.compatibility = "blocked";
|
|
141
|
+
item.findings.push("Unsupported MCP transport");
|
|
142
|
+
}
|
|
143
|
+
else if (key === "tool_timeout_sec") if (typeof v === "number") draft.timeout = v;
|
|
142
144
|
else {
|
|
143
145
|
item.compatibility = "blocked";
|
|
144
146
|
item.findings.push("Invalid MCP timeout");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { loadConfig } from "../config/loader.js";
|
|
4
|
-
import { createGatewayHttpClientFromConfig, resolveGatewayHttpBaseUrl } from "./gateway-http-client.js";
|
|
5
4
|
import { RealtimeClient } from "../../packages/realtime-client/src/index.js";
|
|
5
|
+
import { createGatewayHttpClientFromConfig, resolveGatewayHttpBaseUrl } from "./gateway-http-client.js";
|
|
6
6
|
import { toConversation } from "./channel-shared.js";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import crypto from "node:crypto";
|
|
@@ -27,7 +27,7 @@ var init_env_keys = __esmMin((() => {
|
|
|
27
27
|
cerebras: ["CEREBRAS_API_KEY"],
|
|
28
28
|
mistral: ["MISTRAL_API_KEY"],
|
|
29
29
|
openrouter: ["OPENROUTER_API_KEY"],
|
|
30
|
-
|
|
30
|
+
azure: ["AZURE_OPENAI_API_KEY", "AZURE_OPENAI_BASE_URL"],
|
|
31
31
|
"amazon-bedrock": [
|
|
32
32
|
"AWS_ACCESS_KEY_ID",
|
|
33
33
|
"AWS_SECRET_ACCESS_KEY",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __esmMin, __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
3
3
|
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
4
|
+
import { assertCurrentModelProvider, init_provider_policy, isRetiredModelProvider } from "./provider-policy.js";
|
|
4
5
|
import { CredentialResolver, hasCredentials, init_credentials } from "../auth/credentials.js";
|
|
5
6
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
6
7
|
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
@@ -45,12 +46,8 @@ var providers_exports = /* @__PURE__ */ __exportAll({
|
|
|
45
46
|
resolveModel: () => resolveModel
|
|
46
47
|
});
|
|
47
48
|
function normalizeProviderModel(model) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
...correctedModel,
|
|
51
|
-
baseUrl: OPENAI_CODEX_CANONICAL_BASE_URL
|
|
52
|
-
};
|
|
53
|
-
return correctedModel;
|
|
49
|
+
assertCurrentModelProvider(model.provider);
|
|
50
|
+
return applyOfficialModelMetadataCorrections(model);
|
|
54
51
|
}
|
|
55
52
|
/** Map a plugin registry model to the pi-ai {@link Model} shape. */
|
|
56
53
|
function pluginModelToModel(providerId, definition) {
|
|
@@ -77,6 +74,7 @@ function pluginModelToModel(providerId, definition) {
|
|
|
77
74
|
* Use this for Agent's getApiKey callback which must be synchronous.
|
|
78
75
|
*/
|
|
79
76
|
function getApiKeySync(provider) {
|
|
77
|
+
assertCurrentModelProvider(provider);
|
|
80
78
|
if (getProviderRegistry().has(provider)) return "extension-managed";
|
|
81
79
|
const registryKey = getModelRegistry().getApiKey(provider);
|
|
82
80
|
if (registryKey) return registryKey;
|
|
@@ -91,6 +89,8 @@ function getApiKeySync(provider) {
|
|
|
91
89
|
function resolveModel(ref) {
|
|
92
90
|
const trimmedRef = typeof ref === "string" ? ref.trim() : "";
|
|
93
91
|
if (!trimmedRef) throw new Error("No default model configured. Choose a model in onboarding or update global Agent defaults.");
|
|
92
|
+
const requestedProvider = splitProviderModelRef(trimmedRef)?.provider;
|
|
93
|
+
if (requestedProvider) assertCurrentModelProvider(requestedProvider);
|
|
94
94
|
const customModel = getModelRegistry().resolve(trimmedRef);
|
|
95
95
|
if (customModel) return normalizeProviderModel(customModel);
|
|
96
96
|
const qualifiedRef = splitProviderModelRef(trimmedRef);
|
|
@@ -107,11 +107,14 @@ function resolveModel(ref) {
|
|
|
107
107
|
}
|
|
108
108
|
throw new Error(`Model not found: ${trimmedRef}`);
|
|
109
109
|
}
|
|
110
|
-
for (const provider of getProviders())
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
for (const provider of getProviders()) {
|
|
111
|
+
if (isRetiredModelProvider(provider)) continue;
|
|
112
|
+
try {
|
|
113
|
+
const found = getModels(provider).find((m) => m.id === trimmedRef);
|
|
114
|
+
if (found) return normalizeProviderModel(found);
|
|
115
|
+
} catch {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
115
118
|
}
|
|
116
119
|
const supplementalModel = getSupplementalModels().find((m) => m.id === trimmedRef);
|
|
117
120
|
if (supplementalModel) return normalizeProviderModel(supplementalModel);
|
|
@@ -123,6 +126,7 @@ function resolveModel(ref) {
|
|
|
123
126
|
throw new Error(`Model not found: ${trimmedRef}. Use format: provider/model-id`);
|
|
124
127
|
}
|
|
125
128
|
function getModelsByProvider(provider) {
|
|
129
|
+
assertCurrentModelProvider(provider);
|
|
126
130
|
const fromRegistry = getModelRegistry().getAll().filter((m) => m.provider === provider).map(normalizeProviderModel);
|
|
127
131
|
const existingIds = new Set(fromRegistry.map((m) => m.id));
|
|
128
132
|
const supplementalModels = getSupplementalModels().filter((m) => m.provider === provider && !existingIds.has(m.id)).map(normalizeProviderModel);
|
|
@@ -138,13 +142,14 @@ function getModelsByProvider(provider) {
|
|
|
138
142
|
function getAllProviders() {
|
|
139
143
|
const registry = getModelRegistry();
|
|
140
144
|
const providers = /* @__PURE__ */ new Set();
|
|
141
|
-
for (const p of getProviders()) providers.add(p);
|
|
142
|
-
for (const m of registry.getAll()) providers.add(m.provider);
|
|
145
|
+
for (const p of getProviders()) if (!isRetiredModelProvider(p)) providers.add(p);
|
|
146
|
+
for (const m of registry.getAll()) if (!isRetiredModelProvider(m.provider)) providers.add(m.provider);
|
|
143
147
|
for (const plugin of getProviderRegistry().listAll()) providers.add(plugin.id);
|
|
144
148
|
for (const provider of getModelOAuthProviderIds()) providers.add(provider);
|
|
145
149
|
return Array.from(providers);
|
|
146
150
|
}
|
|
147
151
|
async function getApiKey(provider, credentialOptions) {
|
|
152
|
+
assertCurrentModelProvider(provider);
|
|
148
153
|
if (getProviderRegistry().has(provider)) return "extension-managed";
|
|
149
154
|
const credentialKey = await resolveProviderApiKey(provider, credentialOptions);
|
|
150
155
|
if (credentialKey) return credentialKey;
|
|
@@ -157,12 +162,14 @@ async function getApiKey(provider, credentialOptions) {
|
|
|
157
162
|
* Only checks environment variables and registry, not credential system
|
|
158
163
|
*/
|
|
159
164
|
function isProviderConfiguredSync(provider) {
|
|
165
|
+
assertCurrentModelProvider(provider);
|
|
160
166
|
if (getProviderRegistry().has(provider)) return true;
|
|
161
167
|
if (getModelRegistry().getApiKey(provider)) return true;
|
|
162
168
|
if (getApiKeyFromEnv(provider)) return true;
|
|
163
169
|
return hasProviderAuthOnDiskSync(provider);
|
|
164
170
|
}
|
|
165
171
|
async function isProviderConfigured(provider) {
|
|
172
|
+
assertCurrentModelProvider(provider);
|
|
166
173
|
if (getProviderRegistry().has(provider)) return true;
|
|
167
174
|
if (getModelRegistry().getApiKey(provider)) return true;
|
|
168
175
|
return await hasCredentials(provider);
|
|
@@ -310,7 +317,7 @@ function getDefaultModelSync(config) {
|
|
|
310
317
|
if (modelRef) return modelRef;
|
|
311
318
|
return "";
|
|
312
319
|
}
|
|
313
|
-
var
|
|
320
|
+
var PROVIDER_META;
|
|
314
321
|
var init_providers = __esmMin((() => {
|
|
315
322
|
init_schema();
|
|
316
323
|
init_model_registry();
|
|
@@ -322,8 +329,8 @@ var init_providers = __esmMin((() => {
|
|
|
322
329
|
init_model_supplements();
|
|
323
330
|
init_model_ref();
|
|
324
331
|
init_plugin_registry();
|
|
332
|
+
init_provider_policy();
|
|
325
333
|
init_provider_auth_service();
|
|
326
|
-
OPENAI_CODEX_CANONICAL_BASE_URL = "https://chatgpt.com/backend-api/codex";
|
|
327
334
|
PROVIDER_META = {
|
|
328
335
|
"xopc-cloud": {
|
|
329
336
|
name: "XOPC Model Service",
|
|
@@ -334,7 +341,8 @@ var init_providers = __esmMin((() => {
|
|
|
334
341
|
"openai": {
|
|
335
342
|
name: "OpenAI",
|
|
336
343
|
category: "common",
|
|
337
|
-
supportsApiKey: true
|
|
344
|
+
supportsApiKey: true,
|
|
345
|
+
supportsOAuth: true
|
|
338
346
|
},
|
|
339
347
|
"anthropic": {
|
|
340
348
|
name: "Anthropic",
|
|
@@ -556,8 +564,8 @@ var init_providers = __esmMin((() => {
|
|
|
556
564
|
category: "enterprise",
|
|
557
565
|
supportsApiKey: true
|
|
558
566
|
},
|
|
559
|
-
"azure
|
|
560
|
-
name: "Azure
|
|
567
|
+
"azure": {
|
|
568
|
+
name: "Azure",
|
|
561
569
|
category: "enterprise",
|
|
562
570
|
supportsApiKey: true
|
|
563
571
|
},
|
|
@@ -577,12 +585,6 @@ var init_providers = __esmMin((() => {
|
|
|
577
585
|
supportsOAuth: true,
|
|
578
586
|
supportsApiKey: false
|
|
579
587
|
},
|
|
580
|
-
"openai-codex": {
|
|
581
|
-
name: "OpenAI Codex (OAuth)",
|
|
582
|
-
category: "oauth",
|
|
583
|
-
supportsOAuth: true,
|
|
584
|
-
supportsApiKey: false
|
|
585
|
-
},
|
|
586
588
|
"google-gemini-cli": {
|
|
587
589
|
name: "Google Gemini CLI (OAuth)",
|
|
588
590
|
category: "oauth",
|
|
@@ -2,8 +2,6 @@ import { type Api, type AssistantMessage, type Context, type Model, type SimpleS
|
|
|
2
2
|
import type { CredentialResolverOptions } from '../auth/credentials.js';
|
|
3
3
|
import type { AiUsageContext } from '../usage/types.js';
|
|
4
4
|
export declare function isLocalModelBaseUrl(baseUrl: string | undefined): boolean;
|
|
5
|
-
/** Codex Responses rejects the temperature request parameter. */
|
|
6
|
-
export declare function supportsModelTemperature(model: Model<Api>): boolean;
|
|
7
5
|
export declare function resolveModelCallApiKey(model: Model<Api>, credentialOptions?: CredentialResolverOptions): Promise<string | undefined>;
|
|
8
6
|
export declare function resolveModelCallOptions(model: Model<Api>, options?: SimpleStreamOptions, credentialOptions?: CredentialResolverOptions): Promise<SimpleStreamOptions>;
|
|
9
7
|
/**
|
|
@@ -15,10 +15,6 @@ function isLocalModelBaseUrl(baseUrl) {
|
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
/** Codex Responses rejects the temperature request parameter. */
|
|
19
|
-
function supportsModelTemperature(model) {
|
|
20
|
-
return model.api !== "openai-codex-responses";
|
|
21
|
-
}
|
|
22
18
|
async function resolveModelCallApiKey(model, credentialOptions) {
|
|
23
19
|
try {
|
|
24
20
|
const apiKey = credentialOptions ? await getApiKey(model.provider, credentialOptions) : await getApiKey(model.provider);
|
|
@@ -35,7 +31,7 @@ async function resolveModelCallOptions(model, options = {}, credentialOptions) {
|
|
|
35
31
|
return {
|
|
36
32
|
...rest,
|
|
37
33
|
apiKey,
|
|
38
|
-
...temperature !== void 0
|
|
34
|
+
...temperature !== void 0 ? { temperature } : {}
|
|
39
35
|
};
|
|
40
36
|
}
|
|
41
37
|
/**
|
|
@@ -94,4 +90,4 @@ async function createResolvedModelStream(model, context, options, credentialOpti
|
|
|
94
90
|
}
|
|
95
91
|
}
|
|
96
92
|
//#endregion
|
|
97
|
-
export { completeWithResolvedCredentials, createResolvedModelStream, isLocalModelBaseUrl, resolveModelCallApiKey, resolveModelCallOptions
|
|
93
|
+
export { completeWithResolvedCredentials, createResolvedModelStream, isLocalModelBaseUrl, resolveModelCallApiKey, resolveModelCallOptions };
|