@xopcai/xopc 0.0.187 → 0.0.189
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 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/demo-memory/src/index.js +1 -0
- package/dist/extensions/feishu/src/streaming/streaming-adapter.js +1 -3
- package/dist/extensions/telegram/src/adapters/streaming-adapter.js +0 -2
- package/dist/extensions/telegram/src/draft-stream.d.ts +0 -4
- package/dist/extensions/telegram/src/draft-stream.js +1 -53
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-WlR2zEvA.js → activity-store-DTFKTPs8.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-RedDszrG.js → agent-avatar-dicebear-DqO25Qe5.js} +1 -1
- package/dist/gateway/static/root/assets/agents-BvdqdER9.js +2 -0
- package/dist/gateway/static/root/assets/{api-tVOllncq.js → api-DWeXfwVU.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-C9hKBzaF.js → app-management-settings-panel-BRpV8PXG.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-5cQvq7hd.js → appearance-settings-3ntKM9nQ.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-nKLsfy6C.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-Ct-shK4n.js → archive-plugin-Df7Ycj_7.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CpPj3m-q.js → attachment-load-UHgfZYtj.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-Dh5bdZiN.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BpSXZBle.js → binary-plugins-BJah99wE.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-B8hR2tXc.js → block-editor-DNlY5KqF.js} +46 -46
- package/dist/gateway/static/root/assets/browser-settings-page-CRJ_nAuh.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-D_LAXUrh.js → browser-workflow-inputs-vyUfdzAd.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-CPAs7-6s.js → browser-workflows-page-C1cKZjx-.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DeQR5BZt.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-CKklVY2p.js → capability-presets-api-D7tkhDMv.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-D7uK3q1p.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-WWN-nbFL.js → channel-recipient-api-BGG2kpJB.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-Bw6Dniyq.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-BrUTz4uU.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-CdNkVFdB.js → connector-logo-8YU53RUT.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-k9tMiOL5.js +2 -0
- package/dist/gateway/static/root/assets/{desktop-pet-Bm_IEAf3.js → desktop-pet-BUuBEJuP.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-C0Ve04-G.js → desktop-pet-settings-BGfVIJM3.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-B2cvhvAI.js → directory-picker-path-field-DrQFfHH_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DNashgGu.js → extension-debug-page-CEnIFOX-.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Bvo-5htX.js → extension-page-CCqHbexs.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BBESdISV.js → extension-settings-page-DEZw_7zN.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-ClQvokMo.js → gateway-config-api-CgUE2Ii1.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-Dg8qCiIp.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CntXJF6W.js → gateway-startup-retry-DxhKNiCF.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-CWKcZuvc.js → heartbeat-settings-27tRzDEo.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-VA511kMr.js +3 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DjSAQwGy.js → image-generation-api-DCFdc-HD.js} +1 -1
- package/dist/gateway/static/root/assets/index-BvR-i-m6.js +216 -0
- package/dist/gateway/static/root/assets/index-zybP34zk.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-ahKHpjoW.js → keyboard-shortcuts-settings-Bf2VLtXW.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CaJq4-wV.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-B6GKdgza.js → local-apps-page-Ca1RuI13.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Bff30u5V.js → locale-store-DUW5YE3R.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-BLTCg69e.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-B3Eop1zn.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-split-BeNMJm_i.js → markdown-split-BGOYjgnM.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Bdzrj_-6.js → media-plugins-CT0txyM4.js} +1 -1
- package/dist/gateway/static/root/assets/messages-CMjnbdbn.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-MYIi-9S9.js → notes-page-DfKgAe78.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-Bp1w9UM1.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-3t88bbGx.js → page-tabs-DNrbCgmC.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Cf_BWbeE.js → preview-open-alternatives-BTqViDOR.js} +1 -1
- package/dist/gateway/static/root/assets/product-delivery-tRr-7IxY.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-CKq73c98.js → product-open-page-C_2L4_Iu.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CZmbPDQN.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-D5pzqfm5.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-CC-XhVGI.js +1 -0
- package/dist/gateway/static/root/assets/{schema-form-NqOm-OG1.js → schema-form-BFLfkDGG.js} +1 -1
- package/dist/gateway/static/root/assets/{schemas-C6onAggk.js → schemas-zIBW3wiV.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-B2eTLVDV.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CRuZ_bl0.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-DYAS8p8z.js → settings-form-section-C4GXGeA4.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DZFhxihA.js → settings-loading-skeleton-C9a-EbTZ.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-DI9qDH5x.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-layout-DfFfkdED.js → settings-page-layout-D-LWQdI5.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CJwmPvgs.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-CYtrQaZN.js → share-preview-page-BKSMG9r5.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-YzSDS4G_.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-CwOo8zZk.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-xd1cgSGN.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-BBXirAjc.js → skills-page.utils-zsz2HIlZ.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DLf5YvFl.js → system-settings-panel-IWNDBI1O.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-DFGkuYfl.js → task-detail-page-CgtK02kP.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-y7e_tvYi.js → theme-store-BkJe7UDo.js} +1 -1
- package/dist/gateway/static/root/assets/time-picker-CstQ___Y.js +1 -0
- package/dist/gateway/static/root/assets/{typed-models-lib-DR12j_dr.js → typed-models-lib-C07LGthO.js} +1 -1
- package/dist/gateway/static/root/assets/{use-save-bar-registration-BsvcJgZl.js → use-save-bar-registration-CQYE0l6z.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-BnQAWS_B.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DKADXFWD.js → voice-api-key-field-Boue1D46.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BC1nExf8.js → work-discovery-overlay-bbmvCmc8.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-CAszL1y8.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-C8X5W-8k.js → workflow-run-setup-panel-DlHv-GZC.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DxGzo3-x.js +11 -0
- package/dist/gateway/static/root/index.html +9 -9
- package/dist/package.js +1 -1
- package/dist/packages/endpoint-tools-protocol/src/index.js +184 -0
- package/dist/packages/gateway-contract/src/tool-activity.js +223 -0
- package/dist/packages/realtime-client/src/index.js +199 -0
- package/dist/packages/realtime-protocol/src/index.js +83 -0
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +3 -8
- package/dist/src/agent/background-review/prompts.d.ts +1 -1
- package/dist/src/agent/background-review/prompts.js +3 -1
- package/dist/src/agent/background-review/run-background-review.d.ts +2 -0
- package/dist/src/agent/background-review/run-background-review.js +5 -2
- package/dist/src/agent/client-error-format.d.ts +1 -1
- package/dist/src/agent/client-error-format.js +1 -1
- package/dist/src/agent/code-intelligence/binary.js +1 -1
- package/dist/src/agent/embedded/run-for-session.d.ts +0 -2
- package/dist/src/agent/embedded/run-for-session.js +99 -112
- package/dist/src/agent/external-tools/composio-provider.d.ts +29 -0
- package/dist/src/agent/external-tools/composio-provider.js +307 -0
- package/dist/src/agent/external-tools/endpoint-provider.d.ts +17 -0
- package/dist/src/agent/external-tools/endpoint-provider.js +93 -0
- package/dist/src/agent/external-tools/extension-provider.d.ts +20 -0
- package/dist/src/agent/external-tools/extension-provider.js +68 -0
- package/dist/src/agent/external-tools/gateway-tools.d.ts +8 -0
- package/dist/src/agent/external-tools/gateway-tools.js +89 -0
- package/dist/src/agent/external-tools/index.d.ts +23 -0
- package/dist/src/agent/external-tools/index.js +46 -0
- package/dist/src/agent/external-tools/mcp-provider.d.ts +29 -0
- package/dist/src/agent/external-tools/mcp-provider.js +118 -0
- package/dist/src/agent/external-tools/memory-provider.d.ts +21 -0
- package/dist/src/agent/external-tools/memory-provider.js +56 -0
- package/dist/src/agent/external-tools/refs.d.ts +5 -0
- package/dist/src/agent/external-tools/refs.js +18 -0
- package/dist/src/agent/external-tools/service.d.ts +26 -0
- package/dist/src/agent/external-tools/service.js +117 -0
- package/dist/src/agent/external-tools/types.d.ts +35 -0
- package/dist/src/agent/external-tools/types.js +10 -0
- package/dist/src/agent/inbound/inbound-loop.d.ts +0 -2
- package/dist/src/agent/inbound/inbound-loop.js +4 -3
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +9 -8
- package/dist/src/agent/inbound/turn-dispatcher.js +13 -11
- package/dist/src/agent/mcp/{bundle-mcp-materialize.d.ts → bundle-mcp-gateway.d.ts} +1 -19
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +60 -0
- package/dist/src/agent/mcp/bundle-mcp-names.d.ts +0 -8
- package/dist/src/agent/mcp/bundle-mcp-names.js +2 -29
- package/dist/src/agent/mcp/bundle-mcp-policy.d.ts +4 -7
- package/dist/src/agent/mcp/bundle-mcp-policy.js +6 -20
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +2 -2
- package/dist/src/agent/mcp/bundle-mcp-tools.d.ts +1 -2
- package/dist/src/agent/mcp/bundle-mcp-tools.js +1 -2
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +0 -5
- package/dist/src/agent/mcp/index.d.ts +0 -2
- package/dist/src/agent/mcp/index.js +2 -5
- package/dist/src/agent/mcp/mcp-stdio-transport.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/memory/context/planner.d.ts +1 -0
- package/dist/src/agent/memory/context/planner.js +22 -7
- package/dist/src/agent/memory/manager.d.ts +4 -1
- package/dist/src/agent/memory/manager.js +5 -2
- package/dist/src/agent/memory/types.d.ts +2 -0
- package/dist/src/agent/messaging/command-handler.d.ts +2 -2
- package/dist/src/agent/messaging/command-handler.js +3 -3
- package/dist/src/agent/messaging/stream-manager.d.ts +2 -14
- package/dist/src/agent/messaging/stream-manager.js +0 -12
- package/dist/src/agent/orchestration/agent-event-handler.d.ts +1 -3
- package/dist/src/agent/orchestration/agent-event-handler.js +0 -36
- package/dist/src/agent/orchestration/agent-orchestrator.d.ts +0 -5
- package/dist/src/agent/orchestration/agent-orchestrator.js +0 -5
- package/dist/src/agent/prompt/sections/behavior.js +6 -4
- package/dist/src/agent/service/async-queue.d.ts +1 -1
- package/dist/src/agent/service/async-queue.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +1 -1
- package/dist/src/agent/service/process-direct-one-shot.d.ts +3 -1
- package/dist/src/agent/service/process-direct-one-shot.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.d.ts +7 -5
- package/dist/src/agent/service/process-direct-streaming.js +5 -5
- package/dist/src/agent/service.d.ts +1 -4
- package/dist/src/agent/service.js +6 -32
- package/dist/src/agent/service.types.d.ts +2 -3
- package/dist/src/agent/session/index.d.ts +1 -1
- package/dist/src/agent/session/session-context.d.ts +2 -0
- package/dist/src/agent/session/session-context.js +4 -0
- package/dist/src/agent/session/session-state-bag.d.ts +4 -4
- package/dist/src/agent/session/session-state-bag.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +1 -1
- package/dist/src/agent/starter-agents.js +2 -2
- package/dist/src/agent/streaming/reasoning-visibility.d.ts +6 -0
- package/dist/src/agent/streaming/{reasoning-visibility-sse.js → reasoning-visibility.js} +3 -6
- package/dist/src/agent/tools/delegate-tool.js +5 -1
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.d.ts +6 -1
- package/dist/src/agent/tools/factory.js +17 -22
- package/dist/src/agent/tools/index.d.ts +0 -1
- package/dist/src/agent/tools/index.js +1 -2
- package/dist/src/agent/workflow/workflow-child-tools.js +7 -1
- package/dist/src/automations/domain/types.d.ts +2 -1
- package/dist/src/automations/domain/validation.d.ts +1 -1
- package/dist/src/automations/service/action-executor.js +4 -1
- package/dist/src/browser/providers/cloakbrowser.js +1 -1
- package/dist/src/channels/channel-domain.d.ts +0 -4
- package/dist/src/channels/pairing/pairing-challenge.d.ts +1 -1
- package/dist/src/channels/pairing/pairing-challenge.js +1 -1
- package/dist/src/channels/plugin-types.d.ts +0 -2
- package/dist/src/cli/commands/agent/stream-renderer.js +4 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/rules.js +0 -5
- package/dist/src/config/schema.d.ts +3 -5
- package/dist/src/config/schema.js +0 -3
- package/dist/src/config/web-patch.js +0 -1
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/endpoint-tools/auth.d.ts +20 -0
- package/dist/src/endpoint-tools/auth.js +51 -0
- package/dist/src/endpoint-tools/index.d.ts +5 -0
- package/dist/src/endpoint-tools/index.js +6 -0
- package/dist/src/endpoint-tools/invocation-service.d.ts +68 -0
- package/dist/src/endpoint-tools/invocation-service.js +190 -0
- package/dist/src/endpoint-tools/policy.d.ts +10 -0
- package/dist/src/endpoint-tools/policy.js +18 -0
- package/dist/src/endpoint-tools/registry.d.ts +45 -0
- package/dist/src/endpoint-tools/registry.js +121 -0
- package/dist/src/endpoint-tools/runtime.d.ts +23 -0
- package/dist/src/endpoint-tools/runtime.js +86 -0
- package/dist/src/endpoint-tools/upload-service.d.ts +41 -0
- package/dist/src/endpoint-tools/upload-service.js +103 -0
- package/dist/src/extensions/extension-registry-impl.d.ts +3 -1
- package/dist/src/extensions/extension-registry-impl.js +7 -1
- package/dist/src/extensions/loader.js +1 -1
- package/dist/src/extensions/types/core.d.ts +2 -1
- package/dist/src/extensions/types/hooks.d.ts +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agent-builtin-tools.js +5 -2
- package/dist/src/gateway/chat-stream/mapper.js +16 -1
- package/dist/src/gateway/chat-stream/protocol.d.ts +4 -1
- package/dist/src/gateway/clarify-bridge.d.ts +5 -4
- package/dist/src/gateway/clarify-bridge.js +3 -4
- package/dist/src/gateway/file-reference-errors.d.ts +6 -0
- package/dist/src/gateway/file-reference-errors.js +21 -0
- package/dist/src/gateway/heartbeat/service.js +5 -2
- package/dist/src/gateway/hono/app.js +1 -5
- package/dist/src/gateway/hono/index.d.ts +0 -1
- package/dist/src/gateway/hono/index.js +1 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -2
- package/dist/src/gateway/hono/lib/config-payload.js +1 -2
- package/dist/src/gateway/hono/middleware/auth.js +3 -5
- package/dist/src/gateway/hono/routes/agent-stream.js +49 -6
- package/dist/src/gateway/hono/routes/config-patch/gateway.d.ts +2 -2
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +0 -19
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/deps.d.ts +0 -2
- package/dist/src/gateway/hono/routes/endpoint-tools.d.ts +3 -0
- package/dist/src/gateway/hono/routes/endpoint-tools.js +196 -0
- package/dist/src/gateway/hono/routes/index.js +4 -0
- package/dist/src/gateway/hono/routes/logs.js +0 -4
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +34 -13
- package/dist/src/gateway/hono/routes/public-gateway.js +2 -2
- package/dist/src/gateway/hono/routes/realtime.d.ts +3 -0
- package/dist/src/gateway/hono/routes/realtime.js +35 -0
- package/dist/src/gateway/hono/routes/workspace.js +34 -13
- package/dist/src/gateway/hono/routes/you.d.ts +0 -9
- package/dist/src/gateway/hono/routes/you.js +81 -128
- package/dist/src/gateway/index.d.ts +1 -1
- package/dist/src/gateway/index.js +1 -2
- package/dist/src/gateway/protocol.d.ts +1 -7
- package/dist/src/gateway/security/index.js +1 -1
- package/dist/src/gateway/security/operator-scopes.js +1 -1
- package/dist/src/gateway/server.js +4 -4
- package/dist/src/gateway/service/agent-runner.d.ts +11 -9
- package/dist/src/gateway/service/agent-runner.js +18 -18
- package/dist/src/gateway/service/config-coordinator.d.ts +2 -2
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.d.ts +4 -3
- package/dist/src/gateway/service/run-gateway-agent.js +17 -14
- package/dist/src/gateway/service/session-input-coordinator.d.ts +3 -0
- package/dist/src/gateway/service/session-input-coordinator.js +4 -2
- package/dist/src/gateway/service/types.d.ts +0 -5
- package/dist/src/gateway/service.d.ts +7 -6
- package/dist/src/gateway/service.js +39 -22
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/mcp/channel-bridge.d.ts +6 -9
- package/dist/src/mcp/channel-bridge.js +48 -76
- package/dist/src/mcp/channel-server.js +2 -6
- package/dist/src/realtime/broker.d.ts +30 -0
- package/dist/src/realtime/broker.js +97 -0
- package/dist/src/realtime/runtime.d.ts +20 -0
- package/dist/src/realtime/runtime.js +258 -0
- package/dist/src/realtime/tickets.d.ts +15 -0
- package/dist/src/realtime/tickets.js +38 -0
- package/dist/src/realtime/writer.d.ts +15 -0
- package/dist/src/realtime/writer.js +78 -0
- package/dist/src/share/share-config.js +0 -1
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/share/site-share-config.js +0 -1
- package/dist/src/storage/sqlite/endpoint-principal-repository.d.ts +17 -0
- package/dist/src/storage/sqlite/endpoint-principal-repository.js +54 -0
- package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.d.ts +25 -0
- package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.js +42 -0
- package/dist/src/storage/sqlite/index.d.ts +2 -0
- package/dist/src/storage/sqlite/index.js +3 -1
- package/dist/src/storage/sqlite/memory-records-repository.js +3 -1
- package/dist/src/storage/sqlite/migrations/108_repair_user_memory_provider.sql +18 -0
- package/dist/src/storage/sqlite/migrations/109_endpoint_principals.sql +14 -0
- package/dist/src/storage/sqlite/migrations/110_session_input_origin.sql +43 -0
- package/dist/src/storage/sqlite/migrations/111_endpoint_tool_invocations.sql +18 -0
- package/dist/src/storage/sqlite/migrations/112_endpoint_instance_bindings.sql +8 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/session-input-repository.js +5 -3
- package/dist/src/tasks/home-query-service.d.ts +1 -1
- package/dist/src/tui/backends/embedded-backend.js +5 -2
- package/dist/src/tui/backends/{gateway-sse-backend.d.ts → gateway-realtime-backend.d.ts} +13 -10
- package/dist/src/tui/backends/{gateway-sse-backend.js → gateway-realtime-backend.js} +114 -151
- package/dist/src/tui/tool-summary.d.ts +1 -2
- package/dist/src/tui/tool-summary.js +2 -18
- package/dist/src/tui/tui-agent-events.d.ts +0 -1
- package/dist/src/tui/tui-agent-events.js +2 -15
- package/dist/src/tui/tui-backend.d.ts +4 -4
- package/dist/src/tui/tui-run-state.js +0 -4
- package/dist/src/tui/tui-types.d.ts +2 -9
- package/dist/src/tui/tui-types.js +0 -1
- package/dist/src/tui/tui.js +5 -5
- package/dist/src/tunnel/frpc-binary.js +1 -1
- package/dist/src/tunnel/gateway-lifecycle.d.ts +1 -1
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/user-context/actionableInsights.d.ts +14 -0
- package/dist/src/user-context/actionableInsights.js +34 -0
- package/dist/src/user-context/manual-understanding.js +6 -1
- package/dist/src/user-context/projection.d.ts +2 -1
- package/dist/src/user-context/projection.js +2 -1
- package/dist/src/user-context/understandingQuality.d.ts +5 -0
- package/dist/src/user-context/understandingQuality.js +44 -0
- package/dist/src/utils/logger/log-stream.d.ts +3 -10
- package/dist/src/utils/logger/log-stream.js +2 -73
- package/dist/src/utils/logger/pino-record.d.ts +1 -1
- package/dist/src/utils/logger/streams.js +1 -1
- package/dist/src/voice/local/model-files.js +1 -1
- package/dist/src/work-discovery/service.js +1 -1
- package/package.json +6 -3
- package/dist/gateway/static/root/assets/agents-Df9mTa-K.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-Bd3tN-k2.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-w6K9GZQ7.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-jb5Hf-hm.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BjUe4raq.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-DiWIMYRr.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-D8IkjMuX.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-CySs1GQX.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BT2ahw52.js +0 -2
- package/dist/gateway/static/root/assets/gateway-settings-CIRs2QVy.js +0 -1
- package/dist/gateway/static/root/assets/home-page-C59f8UJw.js +0 -3
- package/dist/gateway/static/root/assets/index-D-YfWVyS.css +0 -1
- package/dist/gateway/static/root/assets/index-vi5KlR5_.js +0 -222
- package/dist/gateway/static/root/assets/local-app-workbench-page-DRB4UQBE.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-CNp4XiBN.js +0 -7
- package/dist/gateway/static/root/assets/messages-CPxz48hr.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-DqSkeDXX.js +0 -4
- package/dist/gateway/static/root/assets/product-delivery-C8JbSj5Y.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-BrbHs4Wp.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-B80rtkj6.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-_Q3GEznb.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-55dJOUVg.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CSFCZj14.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-BSIiMLi-.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-q_yE6-H1.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-gYkRX9Ik.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BoNBMKW6.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-GZHKDFSb.js +0 -2
- package/dist/gateway/static/root/assets/time-picker-5sHEZ5w5.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-q5dr8JFG.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-fNvSg40M.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-YJBKmPYK.js +0 -11
- package/dist/src/agent/feedback/feedback-coordinator.d.ts +0 -73
- package/dist/src/agent/feedback/feedback-coordinator.js +0 -156
- package/dist/src/agent/feedback/index.d.ts +0 -4
- package/dist/src/agent/feedback/index.js +0 -2
- package/dist/src/agent/lifecycle/progress.d.ts +0 -90
- package/dist/src/agent/lifecycle/progress.js +0 -339
- package/dist/src/agent/mcp/bundle-mcp-materialize.js +0 -183
- package/dist/src/agent/mcp/mcp-tool-meta.d.ts +0 -8
- package/dist/src/agent/mcp/mcp-tool-meta.js +0 -13
- package/dist/src/agent/mcp/resolve-embedded-mcp-tools.d.ts +0 -14
- package/dist/src/agent/mcp/resolve-embedded-mcp-tools.js +0 -48
- package/dist/src/agent/streaming/reasoning-visibility-sse.d.ts +0 -15
- package/dist/src/agent/tools/composio-tool.d.ts +0 -21
- package/dist/src/agent/tools/composio-tool.js +0 -261
- package/dist/src/gateway/agent-run-relay.d.ts +0 -19
- package/dist/src/gateway/agent-run-relay.js +0 -169
- package/dist/src/gateway/hono/sse.d.ts +0 -53
- package/dist/src/gateway/hono/sse.js +0 -207
- package/dist/src/gateway/service/sse-hub.d.ts +0 -10
- package/dist/src/gateway/service/sse-hub.js +0 -53
- package/dist/src/tui/sse-consumer.d.ts +0 -15
- package/dist/src/tui/sse-consumer.js +0 -73
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { consumeConnectorApproval, createConnectorApproval, getConnectorApproval, getConnectorInstallation, listConnectorActionMetadata, listConnectorConnections, listConnectorInstallations, upsertConnectorActionMetadata, upsertConnectorInstallation } from "../../storage/sqlite/connector-repository.js";
|
|
2
|
+
import "../../storage/sqlite/index.js";
|
|
3
|
+
import { init_session_key, parseSessionKey } from "../../routing/session-key.js";
|
|
4
|
+
import { connectorArgumentsHash, connectorArgumentsPreview } from "../../connectors/approval.js";
|
|
5
|
+
import { ComposioSessionsAdapter } from "../../connectors/composio-sessions.js";
|
|
6
|
+
import { getComposioToolkitScope, isComposioActionAllowedByCatalog, scopeForComposioAction } from "../../connectors/composio.js";
|
|
7
|
+
import { getConnectorDefinition } from "../../connectors/catalog.js";
|
|
8
|
+
import { externalToolRef, parseExternalToolRef } from "./refs.js";
|
|
9
|
+
//#region src/agent/external-tools/composio-provider.ts
|
|
10
|
+
init_session_key();
|
|
11
|
+
const CONNECT_ACTION = "$connect";
|
|
12
|
+
const CONNECTION_ARGUMENT = "xopcConnectionId";
|
|
13
|
+
function textResult(value) {
|
|
14
|
+
return {
|
|
15
|
+
content: [{
|
|
16
|
+
type: "text",
|
|
17
|
+
text: typeof value === "string" ? value : JSON.stringify(value, null, 2)
|
|
18
|
+
}],
|
|
19
|
+
details: {}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function connectorPrincipalForSession(sessionKey) {
|
|
23
|
+
const parsed = parseSessionKey(sessionKey);
|
|
24
|
+
if (!parsed || parsed.source === "cli" || parsed.source === "webchat") return {
|
|
25
|
+
principalId: "local-owner",
|
|
26
|
+
agentId: parsed?.agentId,
|
|
27
|
+
isLocalOwner: true
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
principalId: `channel:${parsed.source}:${parsed.accountId}:${parsed.peerKind}:${parsed.peerId}`,
|
|
31
|
+
agentId: parsed.agentId,
|
|
32
|
+
isLocalOwner: false
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function installedConfigToolkits(config) {
|
|
36
|
+
return Object.values(config?.connectors?.instances ?? {}).flatMap((record) => {
|
|
37
|
+
if (!record || typeof record !== "object" || Array.isArray(record)) return [];
|
|
38
|
+
const row = record;
|
|
39
|
+
const marker = row.xopcConnector;
|
|
40
|
+
const markerRecord = marker && typeof marker === "object" && !Array.isArray(marker) ? marker : void 0;
|
|
41
|
+
if (markerRecord?.enabled === false) return [];
|
|
42
|
+
const runtime = row.runtime;
|
|
43
|
+
if (typeof markerRecord?.connectorId !== "string" || !runtime || typeof runtime !== "object" || Array.isArray(runtime) || runtime.type !== "composio" || runtime.role !== "toolkit" || typeof runtime.toolkit !== "string") return [];
|
|
44
|
+
return [{
|
|
45
|
+
connectorId: markerRecord.connectorId,
|
|
46
|
+
toolkit: runtime.toolkit
|
|
47
|
+
}];
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function composioToolkitFromConnectorId(connectorId) {
|
|
51
|
+
const definition = getConnectorDefinition(connectorId);
|
|
52
|
+
return definition?.runtime.type === "composio" && definition.runtime.role === "toolkit" ? definition.runtime.toolkit : void 0;
|
|
53
|
+
}
|
|
54
|
+
function toolkitFromInstallation(installation) {
|
|
55
|
+
const toolkit = composioToolkitFromConnectorId(installation.connectorId);
|
|
56
|
+
if (!toolkit) throw new Error(`Connector installation is not a Composio toolkit: ${installation.connectorId}`);
|
|
57
|
+
return toolkit;
|
|
58
|
+
}
|
|
59
|
+
function syncLocalOwnerInstallations(config) {
|
|
60
|
+
for (const { connectorId, toolkit } of installedConfigToolkits(config)) {
|
|
61
|
+
const id = `${connectorId}-local-owner`;
|
|
62
|
+
const existing = getConnectorInstallation(id);
|
|
63
|
+
upsertConnectorInstallation({
|
|
64
|
+
id,
|
|
65
|
+
connectorId,
|
|
66
|
+
principalId: "local-owner",
|
|
67
|
+
enabled: true,
|
|
68
|
+
allowedAgentIds: existing?.allowedAgentIds ?? [],
|
|
69
|
+
maxScope: getComposioToolkitScope(config, toolkit),
|
|
70
|
+
confirmationPolicy: existing?.confirmationPolicy ?? "writes",
|
|
71
|
+
selectedConnectionIds: existing?.selectedConnectionIds ?? [],
|
|
72
|
+
createdAt: existing?.createdAt
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function toolkitForAction(actionId, candidates) {
|
|
77
|
+
const normalizedAction = actionId.trim().toUpperCase();
|
|
78
|
+
return [...candidates].sort((left, right) => right.length - left.length).find((toolkit) => normalizedAction === toolkit.toUpperCase() || normalizedAction.startsWith(`${toolkit.toUpperCase()}_`));
|
|
79
|
+
}
|
|
80
|
+
function contractFromSearch(connectorId, toolkit, actionId, value) {
|
|
81
|
+
const row = value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
82
|
+
const risk = scopeForComposioAction(actionId);
|
|
83
|
+
return {
|
|
84
|
+
connectorId,
|
|
85
|
+
actionId,
|
|
86
|
+
toolkit,
|
|
87
|
+
scope: risk.scope,
|
|
88
|
+
curated: risk.curated,
|
|
89
|
+
inputSchema: row.inputSchema,
|
|
90
|
+
cachedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function schemaSummary(value, fallback) {
|
|
94
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return fallback;
|
|
95
|
+
const row = value;
|
|
96
|
+
for (const candidate of [
|
|
97
|
+
row.description,
|
|
98
|
+
row.title,
|
|
99
|
+
row.name
|
|
100
|
+
]) if (typeof candidate === "string" && candidate.trim()) return candidate.trim();
|
|
101
|
+
return fallback;
|
|
102
|
+
}
|
|
103
|
+
function actionInputSchema(action) {
|
|
104
|
+
const schema = action.inputSchema && typeof action.inputSchema === "object" && !Array.isArray(action.inputSchema) ? action.inputSchema : { type: "object" };
|
|
105
|
+
const properties = schema.properties && typeof schema.properties === "object" && !Array.isArray(schema.properties) ? schema.properties : {};
|
|
106
|
+
return {
|
|
107
|
+
...schema,
|
|
108
|
+
type: "object",
|
|
109
|
+
properties: {
|
|
110
|
+
...properties,
|
|
111
|
+
[CONNECTION_ARGUMENT]: {
|
|
112
|
+
type: "string",
|
|
113
|
+
description: "Optional local connection id when more than one account is connected."
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
var ComposioToolProvider = class {
|
|
119
|
+
source = "composio";
|
|
120
|
+
adapter;
|
|
121
|
+
constructor(deps) {
|
|
122
|
+
this.deps = deps;
|
|
123
|
+
this.adapter = deps.adapter ?? new ComposioSessionsAdapter();
|
|
124
|
+
}
|
|
125
|
+
async search(query) {
|
|
126
|
+
const available = this.availableInstallations();
|
|
127
|
+
const toolkits = available.installations.map(toolkitFromInstallation);
|
|
128
|
+
if (toolkits.length === 0) return [];
|
|
129
|
+
const result = await (await this.adapter.createSession({
|
|
130
|
+
principalId: available.principalId,
|
|
131
|
+
toolkits
|
|
132
|
+
})).search({
|
|
133
|
+
query,
|
|
134
|
+
toolkits
|
|
135
|
+
});
|
|
136
|
+
const schemas = result && typeof result === "object" && !Array.isArray(result) ? result.toolSchemas : void 0;
|
|
137
|
+
const hits = available.installations.map((installation) => {
|
|
138
|
+
const toolkit = toolkitFromInstallation(installation);
|
|
139
|
+
return {
|
|
140
|
+
toolRef: externalToolRef(this.source, installation.id, CONNECT_ACTION),
|
|
141
|
+
source: this.source,
|
|
142
|
+
namespace: toolkit,
|
|
143
|
+
title: `Connect ${toolkit}`,
|
|
144
|
+
summary: `Authorize an account for the installed ${toolkit} app.`
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
if (!schemas || typeof schemas !== "object" || Array.isArray(schemas)) return hits;
|
|
148
|
+
for (const [actionId, schema] of Object.entries(schemas)) {
|
|
149
|
+
const toolkit = toolkitForAction(actionId, toolkits);
|
|
150
|
+
if (!toolkit || !isComposioActionAllowedByCatalog(actionId)) continue;
|
|
151
|
+
const installation = available.installations.find((candidate) => toolkitFromInstallation(candidate) === toolkit);
|
|
152
|
+
if (!installation) continue;
|
|
153
|
+
upsertConnectorActionMetadata(contractFromSearch(installation.connectorId, toolkit, actionId, schema));
|
|
154
|
+
hits.push({
|
|
155
|
+
toolRef: externalToolRef(this.source, installation.id, actionId),
|
|
156
|
+
source: this.source,
|
|
157
|
+
namespace: toolkit,
|
|
158
|
+
title: actionId,
|
|
159
|
+
summary: schemaSummary(schema, `Run ${actionId} in ${toolkit}.`)
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
return hits;
|
|
163
|
+
}
|
|
164
|
+
async describe(toolRef) {
|
|
165
|
+
const resolved = this.resolve(toolRef);
|
|
166
|
+
if (!resolved) return void 0;
|
|
167
|
+
const toolkit = toolkitFromInstallation(resolved.installation);
|
|
168
|
+
if (resolved.actionId === CONNECT_ACTION) {
|
|
169
|
+
const summary = `Authorize an account for the installed ${toolkit} app.`;
|
|
170
|
+
return {
|
|
171
|
+
toolRef,
|
|
172
|
+
source: this.source,
|
|
173
|
+
namespace: toolkit,
|
|
174
|
+
title: `Connect ${toolkit}`,
|
|
175
|
+
summary,
|
|
176
|
+
description: `${summary} Never claim the connection succeeded until it is checked again.`,
|
|
177
|
+
inputSchema: {
|
|
178
|
+
type: "object",
|
|
179
|
+
properties: { alias: {
|
|
180
|
+
type: "string",
|
|
181
|
+
description: "Optional account label."
|
|
182
|
+
} },
|
|
183
|
+
additionalProperties: false
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
const action = listConnectorActionMetadata(resolved.installation.connectorId).find((candidate) => candidate.actionId === resolved.actionId);
|
|
188
|
+
if (!action?.inputSchema || !isComposioActionAllowedByCatalog(action.actionId)) return void 0;
|
|
189
|
+
const summary = `Run ${action.actionId} in ${toolkit}.`;
|
|
190
|
+
return {
|
|
191
|
+
toolRef,
|
|
192
|
+
source: this.source,
|
|
193
|
+
namespace: toolkit,
|
|
194
|
+
title: action.actionId,
|
|
195
|
+
summary,
|
|
196
|
+
description: summary,
|
|
197
|
+
inputSchema: actionInputSchema(action)
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
async execute(toolRef, args, approvalId, _context) {
|
|
201
|
+
const available = this.availableInstallations();
|
|
202
|
+
const resolved = this.resolve(toolRef, available.installations);
|
|
203
|
+
if (!resolved) return textResult("This connected app tool is not allowed for this user and agent.");
|
|
204
|
+
let executionArgs = args;
|
|
205
|
+
if (this.deps.hookRunner) {
|
|
206
|
+
const hook = await this.deps.hookRunner.runBeforeToolCall(toolRef, args, { sessionKey: available.context?.sessionKey });
|
|
207
|
+
if (!hook.allowed) throw new Error(hook.reason ?? "Connected app tool call blocked by policy hook.");
|
|
208
|
+
executionArgs = hook.params ?? args;
|
|
209
|
+
}
|
|
210
|
+
const toolkit = toolkitFromInstallation(resolved.installation);
|
|
211
|
+
if (resolved.actionId === CONNECT_ACTION) {
|
|
212
|
+
const authorization = await this.adapter.authorize({
|
|
213
|
+
principalId: available.principalId,
|
|
214
|
+
toolkit,
|
|
215
|
+
installationId: resolved.installation.id,
|
|
216
|
+
alias: typeof executionArgs.alias === "string" ? executionArgs.alias : void 0
|
|
217
|
+
});
|
|
218
|
+
return textResult({
|
|
219
|
+
status: authorization.status,
|
|
220
|
+
toolkit,
|
|
221
|
+
authorizationUrl: authorization.connectUrl,
|
|
222
|
+
connectionId: authorization.connectionId,
|
|
223
|
+
instruction: "Ask the user to open the authorization URL. Check the connection again after they finish."
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
const action = listConnectorActionMetadata(resolved.installation.connectorId).find((candidate) => candidate.actionId === resolved.actionId);
|
|
227
|
+
if (!action?.inputSchema || !isComposioActionAllowedByCatalog(resolved.actionId)) return textResult("The exact action contract is unavailable. Search and describe the tool again.");
|
|
228
|
+
await this.adapter.syncConnections({ principalId: available.principalId }).catch(() => []);
|
|
229
|
+
const connections = listConnectorConnections({
|
|
230
|
+
principalId: available.principalId,
|
|
231
|
+
connectorId: resolved.installation.connectorId
|
|
232
|
+
}).filter((connection) => connection.status === "active");
|
|
233
|
+
const requestedConnection = typeof executionArgs[CONNECTION_ARGUMENT] === "string" ? executionArgs[CONNECTION_ARGUMENT] : void 0;
|
|
234
|
+
const connection = requestedConnection ? connections.find((candidate) => candidate.id === requestedConnection) : connections.find((candidate) => candidate.isDefault) ?? connections[0];
|
|
235
|
+
const actionArgs = { ...executionArgs };
|
|
236
|
+
delete actionArgs[CONNECTION_ARGUMENT];
|
|
237
|
+
const argsHash = connectorArgumentsHash(actionArgs);
|
|
238
|
+
let confirmed = false;
|
|
239
|
+
if (approvalId) {
|
|
240
|
+
const pending = getConnectorApproval(approvalId);
|
|
241
|
+
if (!pending || pending.principalId !== available.principalId || pending.connectorId !== resolved.installation.connectorId || pending.actionId !== action.actionId || pending.sessionKey !== available.context?.sessionKey) return textResult("The connector approval is invalid for this session or action.");
|
|
242
|
+
confirmed = Boolean(consumeConnectorApproval(approvalId, argsHash));
|
|
243
|
+
if (!confirmed) return textResult("The connector approval is not approved, has expired, or was already used.");
|
|
244
|
+
}
|
|
245
|
+
const result = await this.adapter.executeWithPolicy({
|
|
246
|
+
context: {
|
|
247
|
+
principalId: available.principalId,
|
|
248
|
+
toolkits: [toolkit]
|
|
249
|
+
},
|
|
250
|
+
installation: resolved.installation,
|
|
251
|
+
connection,
|
|
252
|
+
action,
|
|
253
|
+
args: actionArgs,
|
|
254
|
+
agentId: available.agentId,
|
|
255
|
+
sessionKey: available.context?.sessionKey,
|
|
256
|
+
confirmed
|
|
257
|
+
});
|
|
258
|
+
if (result.decision === "confirmation_required") {
|
|
259
|
+
const approval = createConnectorApproval({
|
|
260
|
+
principalId: available.principalId,
|
|
261
|
+
connectorId: resolved.installation.connectorId,
|
|
262
|
+
connectionId: connection?.id,
|
|
263
|
+
agentId: available.agentId,
|
|
264
|
+
sessionKey: available.context?.sessionKey,
|
|
265
|
+
actionId: action.actionId,
|
|
266
|
+
scope: action.scope,
|
|
267
|
+
argumentsHash: argsHash,
|
|
268
|
+
argumentsPreview: connectorArgumentsPreview(actionArgs),
|
|
269
|
+
expiresAt: new Date(Date.now() + 10 * 6e4).toISOString()
|
|
270
|
+
});
|
|
271
|
+
return textResult({
|
|
272
|
+
status: "confirmation_required",
|
|
273
|
+
approvalId: approval.id,
|
|
274
|
+
actionId: approval.actionId,
|
|
275
|
+
scope: approval.scope,
|
|
276
|
+
argumentsPreview: approval.argumentsPreview,
|
|
277
|
+
expiresAt: approval.expiresAt,
|
|
278
|
+
instruction: "Ask the user to approve this exact action in xopc, then retry with the approvalId and unchanged arguments."
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
return textResult(result.decision === "allowed" ? result.result : result.reason);
|
|
282
|
+
}
|
|
283
|
+
availableInstallations() {
|
|
284
|
+
const context = this.deps.getCurrentContext();
|
|
285
|
+
const principal = connectorPrincipalForSession(context?.sessionKey);
|
|
286
|
+
if (principal.isLocalOwner) syncLocalOwnerInstallations(this.deps.getConfig());
|
|
287
|
+
const agentId = this.deps.agentId ?? principal.agentId;
|
|
288
|
+
const installations = listConnectorInstallations(principal.principalId).filter((installation) => installation.enabled && composioToolkitFromConnectorId(installation.connectorId) !== void 0 && (installation.allowedAgentIds.length === 0 || Boolean(agentId && installation.allowedAgentIds.includes(agentId))));
|
|
289
|
+
return {
|
|
290
|
+
principalId: principal.principalId,
|
|
291
|
+
agentId,
|
|
292
|
+
context,
|
|
293
|
+
installations
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
resolve(toolRef, installations = this.availableInstallations().installations) {
|
|
297
|
+
const parsed = parseExternalToolRef(toolRef, this.source);
|
|
298
|
+
if (!parsed) return void 0;
|
|
299
|
+
const installation = installations.find((candidate) => candidate.id === parsed.namespace);
|
|
300
|
+
return installation ? {
|
|
301
|
+
installation,
|
|
302
|
+
actionId: parsed.toolName
|
|
303
|
+
} : void 0;
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
//#endregion
|
|
307
|
+
export { ComposioToolProvider };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AgentToolResult } from '@earendil-works/pi-agent-core';
|
|
2
|
+
import type { EndpointToolRuntime } from '../../endpoint-tools/index.js';
|
|
3
|
+
import type { ExternalToolDescriptor, ExternalToolExecutionContext, ExternalToolProvider, ExternalToolSearchHit, ExternalToolTurnContext } from './types.js';
|
|
4
|
+
export interface EndpointToolProviderDeps {
|
|
5
|
+
runtime: EndpointToolRuntime;
|
|
6
|
+
getCurrentContext: () => ExternalToolTurnContext | null;
|
|
7
|
+
}
|
|
8
|
+
export declare class EndpointToolProvider implements ExternalToolProvider {
|
|
9
|
+
private readonly deps;
|
|
10
|
+
readonly source: "endpoint";
|
|
11
|
+
constructor(deps: EndpointToolProviderDeps);
|
|
12
|
+
search(_query: string): Promise<ExternalToolSearchHit[]>;
|
|
13
|
+
describe(toolRef: string): Promise<ExternalToolDescriptor | undefined>;
|
|
14
|
+
execute(toolRef: string, args: Record<string, unknown>, _approvalId: string | undefined, context: ExternalToolExecutionContext): Promise<AgentToolResult<Record<string, unknown>>>;
|
|
15
|
+
private currentEndpoint;
|
|
16
|
+
private resolve;
|
|
17
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { externalToolRef, parseExternalToolRef } from "./refs.js";
|
|
2
|
+
//#region src/agent/external-tools/endpoint-provider.ts
|
|
3
|
+
function contentText(content) {
|
|
4
|
+
if (content.type === "text") return content.text;
|
|
5
|
+
if (content.type === "json") return JSON.stringify(content.value, null, 2);
|
|
6
|
+
return `[File: ${content.name}, ${content.mimeType}, ${content.size} bytes, id=${content.fileId}]`;
|
|
7
|
+
}
|
|
8
|
+
var EndpointToolProvider = class {
|
|
9
|
+
source = "endpoint";
|
|
10
|
+
constructor(deps) {
|
|
11
|
+
this.deps = deps;
|
|
12
|
+
}
|
|
13
|
+
async search(_query) {
|
|
14
|
+
const endpoint = this.currentEndpoint();
|
|
15
|
+
if (!endpoint) return [];
|
|
16
|
+
return endpoint.tools.map(({ descriptor }) => ({
|
|
17
|
+
toolRef: externalToolRef(this.source, endpoint.endpointId, descriptor.name),
|
|
18
|
+
source: this.source,
|
|
19
|
+
namespace: endpoint.endpointId,
|
|
20
|
+
title: descriptor.title,
|
|
21
|
+
summary: `${descriptor.description} (${endpoint.displayName})`
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
async describe(toolRef) {
|
|
25
|
+
const resolved = this.resolve(toolRef);
|
|
26
|
+
if (!resolved) return void 0;
|
|
27
|
+
return {
|
|
28
|
+
toolRef,
|
|
29
|
+
source: this.source,
|
|
30
|
+
namespace: resolved.endpointId,
|
|
31
|
+
title: resolved.tool.descriptor.title,
|
|
32
|
+
summary: `${resolved.tool.descriptor.description} (${resolved.displayName})`,
|
|
33
|
+
description: resolved.tool.descriptor.description,
|
|
34
|
+
inputSchema: resolved.tool.descriptor.inputSchema
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
async execute(toolRef, args, _approvalId, context) {
|
|
38
|
+
const resolved = this.resolve(toolRef);
|
|
39
|
+
if (!resolved) throw new Error(`Endpoint tool is unavailable for this turn: ${toolRef}`);
|
|
40
|
+
const result = await this.deps.runtime.invocations.invoke({
|
|
41
|
+
endpointId: resolved.endpointId,
|
|
42
|
+
toolCallId: context.toolCallId,
|
|
43
|
+
toolName: resolved.tool.descriptor.name,
|
|
44
|
+
arguments: args,
|
|
45
|
+
descriptorRevision: resolved.tool.revision,
|
|
46
|
+
signal: context.signal,
|
|
47
|
+
onProgress: (progress) => {
|
|
48
|
+
context.onUpdate?.({
|
|
49
|
+
content: [{
|
|
50
|
+
type: "text",
|
|
51
|
+
text: progress.message ?? "Endpoint tool is running"
|
|
52
|
+
}],
|
|
53
|
+
details: {
|
|
54
|
+
endpointId: resolved.endpointId,
|
|
55
|
+
...progress.percent === void 0 ? {} : { percent: progress.percent }
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
const files = result.content.filter((item) => item.type === "file");
|
|
61
|
+
return {
|
|
62
|
+
content: result.content.map((item) => ({
|
|
63
|
+
type: "text",
|
|
64
|
+
text: contentText(item)
|
|
65
|
+
})),
|
|
66
|
+
details: {
|
|
67
|
+
endpointId: resolved.endpointId,
|
|
68
|
+
endpointToolName: resolved.tool.descriptor.name,
|
|
69
|
+
...result.details ?? {},
|
|
70
|
+
...files.length === 0 ? {} : { endpointFiles: files }
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
currentEndpoint() {
|
|
75
|
+
const origin = this.deps.getCurrentContext()?.origin;
|
|
76
|
+
if (origin?.type !== "endpoint") return void 0;
|
|
77
|
+
return this.deps.runtime.registry.get(origin.endpointId);
|
|
78
|
+
}
|
|
79
|
+
resolve(toolRef) {
|
|
80
|
+
const parsed = parseExternalToolRef(toolRef, this.source);
|
|
81
|
+
if (!parsed) return void 0;
|
|
82
|
+
const endpoint = this.currentEndpoint();
|
|
83
|
+
if (!endpoint || endpoint.endpointId !== parsed.namespace) return void 0;
|
|
84
|
+
const tool = this.deps.runtime.registry.getTool(endpoint.endpointId, parsed.toolName);
|
|
85
|
+
return tool ? {
|
|
86
|
+
endpointId: endpoint.endpointId,
|
|
87
|
+
displayName: endpoint.displayName,
|
|
88
|
+
tool
|
|
89
|
+
} : void 0;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
//#endregion
|
|
93
|
+
export { EndpointToolProvider };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ExtensionHookRunner } from '../../extensions/index.js';
|
|
2
|
+
import type { ExtensionRegistry } from '../../extensions/types/index.js';
|
|
3
|
+
import { type ToolExecutorConfig } from '../tools/executor.js';
|
|
4
|
+
import type { ExternalToolDescriptor, ExternalToolExecutionContext, ExternalToolProvider, ExternalToolSearchHit } from './types.js';
|
|
5
|
+
export interface ExtensionToolProviderDeps {
|
|
6
|
+
registry?: ExtensionRegistry;
|
|
7
|
+
disabledTools?: Set<string>;
|
|
8
|
+
getSessionKey: () => string | undefined;
|
|
9
|
+
hookRunner?: ExtensionHookRunner;
|
|
10
|
+
toolExecutorConfig?: Partial<ToolExecutorConfig>;
|
|
11
|
+
}
|
|
12
|
+
export declare class ExtensionToolProvider implements ExternalToolProvider {
|
|
13
|
+
private readonly deps;
|
|
14
|
+
readonly source: "extension";
|
|
15
|
+
constructor(deps: ExtensionToolProviderDeps);
|
|
16
|
+
search(_query: string): Promise<ExternalToolSearchHit[]>;
|
|
17
|
+
describe(toolRef: string): Promise<ExternalToolDescriptor | undefined>;
|
|
18
|
+
execute(toolRef: string, args: Record<string, unknown>, _approvalId: string | undefined, context: ExternalToolExecutionContext): Promise<import("@earendil-works/pi-agent-core").AgentToolResult<any>>;
|
|
19
|
+
private resolve;
|
|
20
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { externalToolRef, parseExternalToolRef } from "./refs.js";
|
|
2
|
+
import { executeToolWithProtection } from "../tools/executor.js";
|
|
3
|
+
//#region src/agent/external-tools/extension-provider.ts
|
|
4
|
+
function toolSummary(tool) {
|
|
5
|
+
return tool.description || tool.label || tool.name;
|
|
6
|
+
}
|
|
7
|
+
var ExtensionToolProvider = class {
|
|
8
|
+
source = "extension";
|
|
9
|
+
constructor(deps) {
|
|
10
|
+
this.deps = deps;
|
|
11
|
+
}
|
|
12
|
+
async search(_query) {
|
|
13
|
+
if (!this.deps.registry) return [];
|
|
14
|
+
return this.deps.registry.getAllTools().filter((tool) => !this.deps.disabledTools?.has(tool.name)).flatMap((tool) => {
|
|
15
|
+
const extensionId = this.deps.registry.getToolExtensionId(tool.name);
|
|
16
|
+
if (!extensionId) return [];
|
|
17
|
+
return [{
|
|
18
|
+
toolRef: externalToolRef(this.source, extensionId, tool.name),
|
|
19
|
+
source: this.source,
|
|
20
|
+
namespace: extensionId,
|
|
21
|
+
title: tool.label || tool.name,
|
|
22
|
+
summary: toolSummary(tool)
|
|
23
|
+
}];
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
async describe(toolRef) {
|
|
27
|
+
const resolved = this.resolve(toolRef);
|
|
28
|
+
if (!resolved) return void 0;
|
|
29
|
+
const { extensionId, tool } = resolved;
|
|
30
|
+
const summary = toolSummary(tool);
|
|
31
|
+
return {
|
|
32
|
+
toolRef,
|
|
33
|
+
source: this.source,
|
|
34
|
+
namespace: extensionId,
|
|
35
|
+
title: tool.label || tool.name,
|
|
36
|
+
summary,
|
|
37
|
+
description: summary,
|
|
38
|
+
inputSchema: tool.parameters
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async execute(toolRef, args, _approvalId, context) {
|
|
42
|
+
const resolved = this.resolve(toolRef);
|
|
43
|
+
if (!resolved) throw new Error(`Extension tool is unavailable: ${toolRef}`);
|
|
44
|
+
let executionArgs = args;
|
|
45
|
+
if (this.deps.hookRunner) {
|
|
46
|
+
const hook = await this.deps.hookRunner.runBeforeToolCall(resolved.tool.name, args, {
|
|
47
|
+
extensionId: resolved.extensionId,
|
|
48
|
+
sessionKey: this.deps.getSessionKey()
|
|
49
|
+
});
|
|
50
|
+
if (!hook.allowed) throw new Error(hook.reason ?? "Extension tool call blocked by policy hook.");
|
|
51
|
+
executionArgs = hook.params ?? args;
|
|
52
|
+
}
|
|
53
|
+
return executeToolWithProtection(resolved.tool, context.toolCallId, executionArgs, context.signal, context.onUpdate, this.deps.toolExecutorConfig);
|
|
54
|
+
}
|
|
55
|
+
resolve(toolRef) {
|
|
56
|
+
if (!this.deps.registry) return void 0;
|
|
57
|
+
const parsed = parseExternalToolRef(toolRef, this.source);
|
|
58
|
+
if (!parsed || this.deps.disabledTools?.has(parsed.toolName)) return void 0;
|
|
59
|
+
const tool = this.deps.registry.getTool(parsed.toolName);
|
|
60
|
+
if (!tool || this.deps.registry.getToolExtensionId(parsed.toolName) !== parsed.namespace) return;
|
|
61
|
+
return {
|
|
62
|
+
extensionId: parsed.namespace,
|
|
63
|
+
tool
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
//#endregion
|
|
68
|
+
export { ExtensionToolProvider };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
+
import { type ExternalToolProvider } from './types.js';
|
|
3
|
+
export declare const EXTERNAL_TOOL_NAMES: {
|
|
4
|
+
readonly search: "xopc_tool_search";
|
|
5
|
+
readonly describe: "xopc_tool_describe";
|
|
6
|
+
readonly execute: "xopc_tool_execute";
|
|
7
|
+
};
|
|
8
|
+
export declare function createExternalToolGatewayTools(providers: ExternalToolProvider[]): AgentTool[];
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ExternalToolService } from "./service.js";
|
|
2
|
+
import { EXTERNAL_TOOL_SOURCES } from "./types.js";
|
|
3
|
+
import { Type } from "@sinclair/typebox";
|
|
4
|
+
//#region src/agent/external-tools/gateway-tools.ts
|
|
5
|
+
const EXTERNAL_TOOL_NAMES = {
|
|
6
|
+
search: "xopc_tool_search",
|
|
7
|
+
describe: "xopc_tool_describe",
|
|
8
|
+
execute: "xopc_tool_execute"
|
|
9
|
+
};
|
|
10
|
+
const ToolSearchSchema = Type.Object({
|
|
11
|
+
query: Type.String({ description: "Describe the capability or task you need." }),
|
|
12
|
+
sources: Type.Optional(Type.Array(Type.Union(EXTERNAL_TOOL_SOURCES.map((source) => Type.Literal(source))), {
|
|
13
|
+
maxItems: EXTERNAL_TOOL_SOURCES.length,
|
|
14
|
+
description: "Optional external tool sources to search."
|
|
15
|
+
})),
|
|
16
|
+
limit: Type.Optional(Type.Integer({
|
|
17
|
+
minimum: 1,
|
|
18
|
+
maximum: 20
|
|
19
|
+
}))
|
|
20
|
+
});
|
|
21
|
+
const ToolDescribeSchema = Type.Object({ toolRefs: Type.Array(Type.String(), {
|
|
22
|
+
minItems: 1,
|
|
23
|
+
maxItems: 3,
|
|
24
|
+
description: "Exact tool references returned by xopc_tool_search."
|
|
25
|
+
}) });
|
|
26
|
+
const ToolExecuteSchema = Type.Object({
|
|
27
|
+
toolRef: Type.String({ description: "Exact tool reference returned by xopc_tool_search." }),
|
|
28
|
+
revision: Type.String({ description: "Exact contract revision returned by xopc_tool_describe." }),
|
|
29
|
+
arguments: Type.Optional(Type.Record(Type.String(), Type.Unknown())),
|
|
30
|
+
approvalId: Type.Optional(Type.String({ description: "One-time approval id when execution requested confirmation." }))
|
|
31
|
+
});
|
|
32
|
+
function textResult(value, details = {}) {
|
|
33
|
+
return {
|
|
34
|
+
content: [{
|
|
35
|
+
type: "text",
|
|
36
|
+
text: JSON.stringify(value, null, 2)
|
|
37
|
+
}],
|
|
38
|
+
details
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function createExternalToolGatewayTools(providers) {
|
|
42
|
+
const service = new ExternalToolService(providers);
|
|
43
|
+
return [
|
|
44
|
+
{
|
|
45
|
+
name: EXTERNAL_TOOL_NAMES.search,
|
|
46
|
+
label: "🔎 External Tool Search",
|
|
47
|
+
description: "Search MCP, connected-app, extension, remote-memory, and current-endpoint tools. Use concise English capability keywords. Returns compact references only; call xopc_tool_describe before execution.",
|
|
48
|
+
parameters: ToolSearchSchema,
|
|
49
|
+
async execute(_toolCallId, params) {
|
|
50
|
+
return textResult(await service.search(params));
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: EXTERNAL_TOOL_NAMES.describe,
|
|
55
|
+
label: "📋 External Tool Contract",
|
|
56
|
+
description: "Load exact contracts for up to three external tools returned by xopc_tool_search.",
|
|
57
|
+
parameters: ToolDescribeSchema,
|
|
58
|
+
async execute(_toolCallId, params) {
|
|
59
|
+
return textResult(await service.describe(params.toolRefs));
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: EXTERNAL_TOOL_NAMES.execute,
|
|
64
|
+
label: "▶️ External Tool Execute",
|
|
65
|
+
description: "Execute one external tool using its exact reference, contract revision, and validated arguments.",
|
|
66
|
+
parameters: ToolExecuteSchema,
|
|
67
|
+
async execute(toolCallId, params, signal, onUpdate) {
|
|
68
|
+
const result = await service.execute({
|
|
69
|
+
...params,
|
|
70
|
+
context: {
|
|
71
|
+
toolCallId,
|
|
72
|
+
signal,
|
|
73
|
+
onUpdate
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return {
|
|
77
|
+
...result,
|
|
78
|
+
details: {
|
|
79
|
+
...result.details ?? {},
|
|
80
|
+
delegatedToolRef: params.toolRef,
|
|
81
|
+
delegatedToolRevision: params.revision
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export { EXTERNAL_TOOL_NAMES, createExternalToolGatewayTools };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Config } from '../../config/schema.js';
|
|
2
|
+
import type { ExtensionHookRunner } from '../../extensions/index.js';
|
|
3
|
+
import type { ExtensionRegistry } from '../../extensions/types/index.js';
|
|
4
|
+
import type { MemoryManager } from '../memory/manager.js';
|
|
5
|
+
import type { EndpointToolRuntime } from '../../endpoint-tools/index.js';
|
|
6
|
+
import type { ToolExecutorConfig } from '../tools/executor.js';
|
|
7
|
+
import type { ExternalToolTurnContext } from './types.js';
|
|
8
|
+
export interface DefaultExternalToolGatewayDeps {
|
|
9
|
+
workspace: string;
|
|
10
|
+
getConfig: () => Config | undefined;
|
|
11
|
+
getCurrentContext: () => ExternalToolTurnContext | null;
|
|
12
|
+
endpointTools?: EndpointToolRuntime;
|
|
13
|
+
agentId?: string;
|
|
14
|
+
extensionRegistry?: ExtensionRegistry;
|
|
15
|
+
disabledTools?: Set<string>;
|
|
16
|
+
hookRunner?: ExtensionHookRunner;
|
|
17
|
+
toolExecutorConfig?: Partial<ToolExecutorConfig>;
|
|
18
|
+
getMemoryManager?: () => MemoryManager;
|
|
19
|
+
}
|
|
20
|
+
export declare function createDefaultExternalToolGatewayTools(deps: DefaultExternalToolGatewayDeps): import("@earendil-works/pi-agent-core").AgentTool<import("typebox").TSchema, any>[];
|
|
21
|
+
export { ExternalToolService } from './service.js';
|
|
22
|
+
export { EXTERNAL_TOOL_NAMES } from './gateway-tools.js';
|
|
23
|
+
export type * from './types.js';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ComposioToolProvider } from "./composio-provider.js";
|
|
2
|
+
import { ExtensionToolProvider } from "./extension-provider.js";
|
|
3
|
+
import { ExternalToolService } from "./service.js";
|
|
4
|
+
import { EXTERNAL_TOOL_NAMES, createExternalToolGatewayTools } from "./gateway-tools.js";
|
|
5
|
+
import { McpToolProvider } from "./mcp-provider.js";
|
|
6
|
+
import { MemoryToolProvider } from "./memory-provider.js";
|
|
7
|
+
import { EndpointToolProvider } from "./endpoint-provider.js";
|
|
8
|
+
//#region src/agent/external-tools/index.ts
|
|
9
|
+
function createDefaultExternalToolGatewayTools(deps) {
|
|
10
|
+
const providers = [
|
|
11
|
+
new McpToolProvider({
|
|
12
|
+
workspace: deps.workspace,
|
|
13
|
+
getConfig: deps.getConfig,
|
|
14
|
+
getSessionKey: () => deps.getCurrentContext()?.sessionKey,
|
|
15
|
+
agentId: deps.agentId,
|
|
16
|
+
hookRunner: deps.hookRunner
|
|
17
|
+
}),
|
|
18
|
+
new ComposioToolProvider({
|
|
19
|
+
getConfig: deps.getConfig,
|
|
20
|
+
getCurrentContext: deps.getCurrentContext,
|
|
21
|
+
agentId: deps.agentId,
|
|
22
|
+
hookRunner: deps.hookRunner
|
|
23
|
+
}),
|
|
24
|
+
new ExtensionToolProvider({
|
|
25
|
+
registry: deps.extensionRegistry,
|
|
26
|
+
disabledTools: deps.disabledTools,
|
|
27
|
+
getSessionKey: () => deps.getCurrentContext()?.sessionKey,
|
|
28
|
+
hookRunner: deps.hookRunner,
|
|
29
|
+
toolExecutorConfig: deps.toolExecutorConfig
|
|
30
|
+
}),
|
|
31
|
+
new MemoryToolProvider({
|
|
32
|
+
getMemoryManager: deps.getMemoryManager,
|
|
33
|
+
disabledTools: deps.disabledTools,
|
|
34
|
+
getSessionKey: () => deps.getCurrentContext()?.sessionKey,
|
|
35
|
+
hookRunner: deps.hookRunner,
|
|
36
|
+
toolExecutorConfig: deps.toolExecutorConfig
|
|
37
|
+
})
|
|
38
|
+
];
|
|
39
|
+
if (deps.endpointTools) providers.push(new EndpointToolProvider({
|
|
40
|
+
runtime: deps.endpointTools,
|
|
41
|
+
getCurrentContext: deps.getCurrentContext
|
|
42
|
+
}));
|
|
43
|
+
return createExternalToolGatewayTools(providers);
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { EXTERNAL_TOOL_NAMES, ExternalToolService, createDefaultExternalToolGatewayTools };
|