@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
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=20260713-1" />
|
|
12
12
|
<link rel="manifest" href="/site.webmanifest?v=20260713-1" />
|
|
13
13
|
<title>XOPC — Turn goals into loops. Keep what matters moving.</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-BvR-i-m6.js"></script>
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-aKtaBQYM.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-zJ_50EbN.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BOUWij0V.js">
|
|
@@ -23,17 +23,17 @@
|
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon-DPHK1VkS.js">
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/check-DUBLcKHA.js">
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/middleware-Pd0e8Igk.js">
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/messages-
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/locale-store-
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/assets/messages-CMjnbdbn.js">
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/assets/locale-store-DUW5YE3R.js">
|
|
28
28
|
<link rel="modulepreload" crossorigin href="/assets/cn-JdwAhgNB.js">
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/schemas-
|
|
30
|
-
<link rel="modulepreload" crossorigin href="/assets/product-delivery-
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/schemas-zIBW3wiV.js">
|
|
30
|
+
<link rel="modulepreload" crossorigin href="/assets/product-delivery-tRr-7IxY.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/config-reload-event-Bjh2zoKp.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/copy-to-clipboard-HOJ79TWv.js">
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/activity-store-
|
|
35
|
-
<link rel="modulepreload" crossorigin href="/assets/theme-store-
|
|
36
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-DxhKNiCF.js">
|
|
34
|
+
<link rel="modulepreload" crossorigin href="/assets/activity-store-DTFKTPs8.js">
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-store-BkJe7UDo.js">
|
|
36
|
+
<link rel="stylesheet" crossorigin href="/assets/index-zybP34zk.css">
|
|
37
37
|
</head>
|
|
38
38
|
<body>
|
|
39
39
|
<div id="root"></div>
|
package/dist/package.js
CHANGED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const ENDPOINT_MAX_FILE_BYTES = 25 * 1024 * 1024;
|
|
3
|
+
const ENDPOINT_INVOCATION_RECEIPT_TIMEOUT_MS = 3e3;
|
|
4
|
+
const endpointKindSchema = z.enum([
|
|
5
|
+
"web",
|
|
6
|
+
"desktop",
|
|
7
|
+
"mobile"
|
|
8
|
+
]);
|
|
9
|
+
const endpointAvailabilitySchema = z.enum(["foreground", "background"]);
|
|
10
|
+
const endpointEffectSchema = z.enum([
|
|
11
|
+
"read",
|
|
12
|
+
"write",
|
|
13
|
+
"destructive"
|
|
14
|
+
]);
|
|
15
|
+
const endpointConfirmationSchema = z.enum(["never", "always"]);
|
|
16
|
+
const endpointResultKindSchema = z.enum([
|
|
17
|
+
"text",
|
|
18
|
+
"json",
|
|
19
|
+
"file"
|
|
20
|
+
]);
|
|
21
|
+
const identifierSchema = z.string().min(1).max(160);
|
|
22
|
+
const turnTokenSchema = z.string().min(32).max(160).regex(/^[A-Za-z0-9_-]+$/);
|
|
23
|
+
const turnOriginSchema = z.discriminatedUnion("type", [
|
|
24
|
+
z.strictObject({
|
|
25
|
+
type: z.literal("endpoint"),
|
|
26
|
+
endpointId: identifierSchema
|
|
27
|
+
}),
|
|
28
|
+
z.strictObject({
|
|
29
|
+
type: z.literal("channel"),
|
|
30
|
+
channel: z.string().min(1).max(64)
|
|
31
|
+
}),
|
|
32
|
+
z.strictObject({
|
|
33
|
+
type: z.literal("system"),
|
|
34
|
+
source: z.enum([
|
|
35
|
+
"cli",
|
|
36
|
+
"automation",
|
|
37
|
+
"heartbeat",
|
|
38
|
+
"workflow",
|
|
39
|
+
"internal"
|
|
40
|
+
])
|
|
41
|
+
})
|
|
42
|
+
]);
|
|
43
|
+
const endpointTurnClaimSchema = turnOriginSchema.options[0].extend({ token: turnTokenSchema });
|
|
44
|
+
const messageIdSchema = z.uuid();
|
|
45
|
+
const timestampSchema = z.number().int().nonnegative();
|
|
46
|
+
const jsonObjectSchema = z.record(z.string(), z.unknown());
|
|
47
|
+
const endpointToolDescriptorSchema = z.strictObject({
|
|
48
|
+
name: z.string().regex(/^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)+$/).max(120),
|
|
49
|
+
title: z.string().min(1).max(120),
|
|
50
|
+
description: z.string().min(1).max(2e3),
|
|
51
|
+
inputSchema: jsonObjectSchema,
|
|
52
|
+
effect: endpointEffectSchema,
|
|
53
|
+
confirmation: endpointConfirmationSchema,
|
|
54
|
+
requiresForeground: z.boolean(),
|
|
55
|
+
requiredPermissions: z.array(z.string().min(1).max(120)).max(20),
|
|
56
|
+
timeoutMs: z.number().int().min(1e3).max(3e5),
|
|
57
|
+
maxConcurrency: z.number().int().min(1).max(4),
|
|
58
|
+
supportsCancellation: z.boolean(),
|
|
59
|
+
idempotent: z.boolean(),
|
|
60
|
+
resultKinds: z.array(endpointResultKindSchema).min(1).max(3)
|
|
61
|
+
});
|
|
62
|
+
const endpointPrincipalRegistrationSchema = z.strictObject({
|
|
63
|
+
principalId: identifierSchema,
|
|
64
|
+
displayName: z.string().min(1).max(120),
|
|
65
|
+
kind: endpointKindSchema,
|
|
66
|
+
platform: z.string().min(1).max(80),
|
|
67
|
+
publicKey: z.string().min(32).max(2048)
|
|
68
|
+
});
|
|
69
|
+
const endpointHelloPayloadSchema = z.strictObject({
|
|
70
|
+
principalId: identifierSchema,
|
|
71
|
+
endpointId: identifierSchema,
|
|
72
|
+
connectionInstanceId: z.uuid(),
|
|
73
|
+
displayName: z.string().min(1).max(120),
|
|
74
|
+
kind: endpointKindSchema,
|
|
75
|
+
platform: z.string().min(1).max(80),
|
|
76
|
+
appVersion: z.string().min(1).max(80),
|
|
77
|
+
availability: endpointAvailabilitySchema,
|
|
78
|
+
nonce: identifierSchema,
|
|
79
|
+
signedAt: timestampSchema,
|
|
80
|
+
signature: z.string().min(16).max(1024),
|
|
81
|
+
tools: z.array(endpointToolDescriptorSchema).max(100)
|
|
82
|
+
});
|
|
83
|
+
const toolInvokePayloadSchema = z.strictObject({
|
|
84
|
+
invocationId: z.uuid(),
|
|
85
|
+
toolCallId: identifierSchema,
|
|
86
|
+
toolName: endpointToolDescriptorSchema.shape.name,
|
|
87
|
+
arguments: jsonObjectSchema,
|
|
88
|
+
descriptorRevision: z.string().min(1).max(128),
|
|
89
|
+
confirmationRequired: z.boolean(),
|
|
90
|
+
deadlineAt: timestampSchema,
|
|
91
|
+
uploadGrant: z.strictObject({
|
|
92
|
+
path: z.string().startsWith("/").max(500),
|
|
93
|
+
token: identifierSchema,
|
|
94
|
+
maxBytes: z.number().int().positive(),
|
|
95
|
+
maxFiles: z.number().int().min(1).max(20),
|
|
96
|
+
expiresAt: timestampSchema
|
|
97
|
+
}).optional()
|
|
98
|
+
});
|
|
99
|
+
const toolCancelPayloadSchema = z.strictObject({
|
|
100
|
+
invocationId: z.uuid(),
|
|
101
|
+
reason: z.string().min(1).max(500)
|
|
102
|
+
});
|
|
103
|
+
const invocationPayloadSchema = z.strictObject({ invocationId: z.uuid() });
|
|
104
|
+
const endpointToolContentSchema = z.discriminatedUnion("type", [
|
|
105
|
+
z.strictObject({
|
|
106
|
+
type: z.literal("text"),
|
|
107
|
+
text: z.string().max(256 * 1024)
|
|
108
|
+
}),
|
|
109
|
+
z.strictObject({
|
|
110
|
+
type: z.literal("json"),
|
|
111
|
+
value: z.unknown()
|
|
112
|
+
}),
|
|
113
|
+
z.strictObject({
|
|
114
|
+
type: z.literal("file"),
|
|
115
|
+
fileId: identifierSchema,
|
|
116
|
+
name: z.string().min(1).max(255),
|
|
117
|
+
mimeType: z.string().min(1).max(255),
|
|
118
|
+
size: z.number().int().nonnegative(),
|
|
119
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/)
|
|
120
|
+
})
|
|
121
|
+
]);
|
|
122
|
+
const endpointToolErrorCodeSchema = z.enum([
|
|
123
|
+
"ENDPOINT_OFFLINE",
|
|
124
|
+
"ENDPOINT_NOT_FOREGROUND",
|
|
125
|
+
"ENDPOINT_DISCONNECTED",
|
|
126
|
+
"TOOL_NOT_FOUND",
|
|
127
|
+
"TOOL_REVISION_MISMATCH",
|
|
128
|
+
"INVALID_ARGUMENTS",
|
|
129
|
+
"PERMISSION_DENIED",
|
|
130
|
+
"USER_DENIED",
|
|
131
|
+
"TOOL_BUSY",
|
|
132
|
+
"TOOL_TIMEOUT",
|
|
133
|
+
"TOOL_CANCELLED",
|
|
134
|
+
"RESULT_TOO_LARGE",
|
|
135
|
+
"PROTOCOL_ERROR"
|
|
136
|
+
]);
|
|
137
|
+
const envelope = (type, payload) => z.strictObject({
|
|
138
|
+
protocolVersion: z.literal(1),
|
|
139
|
+
messageId: messageIdSchema,
|
|
140
|
+
type: z.literal(type),
|
|
141
|
+
sentAt: timestampSchema,
|
|
142
|
+
payload
|
|
143
|
+
});
|
|
144
|
+
const clientEndpointMessageSchema = z.discriminatedUnion("type", [
|
|
145
|
+
envelope("endpoint.availability_changed", z.strictObject({ availability: endpointAvailabilitySchema })),
|
|
146
|
+
envelope("tool.received", invocationPayloadSchema),
|
|
147
|
+
envelope("tool.progress", z.strictObject({
|
|
148
|
+
invocationId: z.uuid(),
|
|
149
|
+
message: z.string().max(500).optional(),
|
|
150
|
+
percent: z.number().min(0).max(100).optional()
|
|
151
|
+
})),
|
|
152
|
+
envelope("tool.result", z.strictObject({
|
|
153
|
+
invocationId: z.uuid(),
|
|
154
|
+
content: z.array(endpointToolContentSchema).min(1).max(20),
|
|
155
|
+
details: jsonObjectSchema.optional()
|
|
156
|
+
})),
|
|
157
|
+
envelope("tool.error", z.strictObject({
|
|
158
|
+
invocationId: z.uuid(),
|
|
159
|
+
code: endpointToolErrorCodeSchema,
|
|
160
|
+
message: z.string().min(1).max(2e3)
|
|
161
|
+
})),
|
|
162
|
+
envelope("tool.cancelled", invocationPayloadSchema)
|
|
163
|
+
]);
|
|
164
|
+
const serverEndpointMessageSchema = z.discriminatedUnion("type", [envelope("tool.invoke", toolInvokePayloadSchema), envelope("tool.cancel", toolCancelPayloadSchema)]);
|
|
165
|
+
function canonicalJson(value) {
|
|
166
|
+
if (value === null) return "null";
|
|
167
|
+
if (typeof value === "string" || typeof value === "boolean") return JSON.stringify(value);
|
|
168
|
+
if (typeof value === "number") {
|
|
169
|
+
if (!Number.isFinite(value)) throw new Error("Canonical JSON only supports finite numbers");
|
|
170
|
+
return JSON.stringify(value);
|
|
171
|
+
}
|
|
172
|
+
if (typeof value !== "object") throw new Error(`Canonical JSON does not support ${typeof value}`);
|
|
173
|
+
if (Array.isArray(value)) return `[${value.map(canonicalJson).join(",")}]`;
|
|
174
|
+
const prototype = Object.getPrototypeOf(value);
|
|
175
|
+
if (prototype !== Object.prototype && prototype !== null) throw new Error("Canonical JSON only supports plain objects");
|
|
176
|
+
const record = value;
|
|
177
|
+
return `{${Object.keys(record).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson(record[key])}`).join(",")}}`;
|
|
178
|
+
}
|
|
179
|
+
function endpointHelloSigningPayload(payload) {
|
|
180
|
+
const { signature: _signature, ...unsigned } = payload;
|
|
181
|
+
return canonicalJson(unsigned);
|
|
182
|
+
}
|
|
183
|
+
//#endregion
|
|
184
|
+
export { ENDPOINT_INVOCATION_RECEIPT_TIMEOUT_MS, ENDPOINT_MAX_FILE_BYTES, canonicalJson, clientEndpointMessageSchema, endpointHelloPayloadSchema, endpointHelloSigningPayload, endpointPrincipalRegistrationSchema, endpointTurnClaimSchema, serverEndpointMessageSchema, turnOriginSchema };
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
//#region packages/gateway-contract/src/tool-activity.ts
|
|
2
|
+
const OTHER_ACTIVITY = {
|
|
3
|
+
category: "other",
|
|
4
|
+
action: "use",
|
|
5
|
+
source: "unknown",
|
|
6
|
+
sensitivity: "normal"
|
|
7
|
+
};
|
|
8
|
+
const TOOL_ACTIVITY_CATALOG = {
|
|
9
|
+
memory_search: {
|
|
10
|
+
category: "memory",
|
|
11
|
+
action: "search",
|
|
12
|
+
source: "memory",
|
|
13
|
+
sensitivity: "personal",
|
|
14
|
+
purpose: "personal_context"
|
|
15
|
+
},
|
|
16
|
+
memory_get: {
|
|
17
|
+
category: "memory",
|
|
18
|
+
action: "read",
|
|
19
|
+
source: "memory",
|
|
20
|
+
sensitivity: "personal",
|
|
21
|
+
purpose: "personal_context"
|
|
22
|
+
},
|
|
23
|
+
web_search: {
|
|
24
|
+
category: "web",
|
|
25
|
+
action: "search",
|
|
26
|
+
source: "internet",
|
|
27
|
+
sensitivity: "normal"
|
|
28
|
+
},
|
|
29
|
+
brave_search: {
|
|
30
|
+
category: "web",
|
|
31
|
+
action: "search",
|
|
32
|
+
source: "internet",
|
|
33
|
+
sensitivity: "normal"
|
|
34
|
+
},
|
|
35
|
+
image_query: {
|
|
36
|
+
category: "web",
|
|
37
|
+
action: "search",
|
|
38
|
+
source: "internet",
|
|
39
|
+
sensitivity: "normal"
|
|
40
|
+
},
|
|
41
|
+
web_fetch: {
|
|
42
|
+
category: "web",
|
|
43
|
+
action: "read",
|
|
44
|
+
source: "internet",
|
|
45
|
+
sensitivity: "normal"
|
|
46
|
+
},
|
|
47
|
+
fetch_url: {
|
|
48
|
+
category: "web",
|
|
49
|
+
action: "read",
|
|
50
|
+
source: "internet",
|
|
51
|
+
sensitivity: "normal"
|
|
52
|
+
},
|
|
53
|
+
open_url: {
|
|
54
|
+
category: "navigation",
|
|
55
|
+
action: "open",
|
|
56
|
+
source: "internet",
|
|
57
|
+
sensitivity: "normal"
|
|
58
|
+
},
|
|
59
|
+
browser_use: {
|
|
60
|
+
category: "navigation",
|
|
61
|
+
action: "open",
|
|
62
|
+
source: "internet",
|
|
63
|
+
sensitivity: "normal"
|
|
64
|
+
},
|
|
65
|
+
search_graph: {
|
|
66
|
+
category: "code",
|
|
67
|
+
action: "search",
|
|
68
|
+
source: "workspace",
|
|
69
|
+
sensitivity: "normal"
|
|
70
|
+
},
|
|
71
|
+
search_code: {
|
|
72
|
+
category: "code",
|
|
73
|
+
action: "search",
|
|
74
|
+
source: "workspace",
|
|
75
|
+
sensitivity: "normal"
|
|
76
|
+
},
|
|
77
|
+
query_graph: {
|
|
78
|
+
category: "code",
|
|
79
|
+
action: "search",
|
|
80
|
+
source: "workspace",
|
|
81
|
+
sensitivity: "normal"
|
|
82
|
+
},
|
|
83
|
+
trace_path: {
|
|
84
|
+
category: "code",
|
|
85
|
+
action: "search",
|
|
86
|
+
source: "workspace",
|
|
87
|
+
sensitivity: "normal"
|
|
88
|
+
},
|
|
89
|
+
get_architecture: {
|
|
90
|
+
category: "code",
|
|
91
|
+
action: "search",
|
|
92
|
+
source: "workspace",
|
|
93
|
+
sensitivity: "normal"
|
|
94
|
+
},
|
|
95
|
+
get_code_snippet: {
|
|
96
|
+
category: "file",
|
|
97
|
+
action: "read",
|
|
98
|
+
source: "workspace",
|
|
99
|
+
sensitivity: "normal"
|
|
100
|
+
},
|
|
101
|
+
grep: {
|
|
102
|
+
category: "code",
|
|
103
|
+
action: "search",
|
|
104
|
+
source: "workspace",
|
|
105
|
+
sensitivity: "normal"
|
|
106
|
+
},
|
|
107
|
+
glob: {
|
|
108
|
+
category: "code",
|
|
109
|
+
action: "search",
|
|
110
|
+
source: "workspace",
|
|
111
|
+
sensitivity: "normal"
|
|
112
|
+
},
|
|
113
|
+
find_files: {
|
|
114
|
+
category: "code",
|
|
115
|
+
action: "search",
|
|
116
|
+
source: "workspace",
|
|
117
|
+
sensitivity: "normal"
|
|
118
|
+
},
|
|
119
|
+
session_search: {
|
|
120
|
+
category: "other",
|
|
121
|
+
action: "search",
|
|
122
|
+
source: "runtime",
|
|
123
|
+
sensitivity: "normal"
|
|
124
|
+
},
|
|
125
|
+
search: {
|
|
126
|
+
category: "other",
|
|
127
|
+
action: "search",
|
|
128
|
+
source: "unknown",
|
|
129
|
+
sensitivity: "normal"
|
|
130
|
+
},
|
|
131
|
+
read_file: {
|
|
132
|
+
category: "file",
|
|
133
|
+
action: "read",
|
|
134
|
+
source: "workspace",
|
|
135
|
+
sensitivity: "normal"
|
|
136
|
+
},
|
|
137
|
+
"review.prepare_diff": {
|
|
138
|
+
category: "file",
|
|
139
|
+
action: "read",
|
|
140
|
+
source: "workspace",
|
|
141
|
+
sensitivity: "normal"
|
|
142
|
+
},
|
|
143
|
+
list_dir: {
|
|
144
|
+
category: "file",
|
|
145
|
+
action: "list",
|
|
146
|
+
source: "workspace",
|
|
147
|
+
sensitivity: "normal"
|
|
148
|
+
},
|
|
149
|
+
ls: {
|
|
150
|
+
category: "file",
|
|
151
|
+
action: "list",
|
|
152
|
+
source: "workspace",
|
|
153
|
+
sensitivity: "normal"
|
|
154
|
+
},
|
|
155
|
+
write_file: {
|
|
156
|
+
category: "file",
|
|
157
|
+
action: "write",
|
|
158
|
+
source: "workspace",
|
|
159
|
+
sensitivity: "normal"
|
|
160
|
+
},
|
|
161
|
+
apply_patch: {
|
|
162
|
+
category: "file",
|
|
163
|
+
action: "edit",
|
|
164
|
+
source: "workspace",
|
|
165
|
+
sensitivity: "normal"
|
|
166
|
+
},
|
|
167
|
+
exec_command: {
|
|
168
|
+
category: "command",
|
|
169
|
+
action: "execute",
|
|
170
|
+
source: "runtime",
|
|
171
|
+
sensitivity: "normal"
|
|
172
|
+
},
|
|
173
|
+
run_command: {
|
|
174
|
+
category: "command",
|
|
175
|
+
action: "execute",
|
|
176
|
+
source: "runtime",
|
|
177
|
+
sensitivity: "normal"
|
|
178
|
+
},
|
|
179
|
+
update_plan: {
|
|
180
|
+
category: "planning",
|
|
181
|
+
action: "plan",
|
|
182
|
+
source: "runtime",
|
|
183
|
+
sensitivity: "normal"
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
function toolActivityId(name) {
|
|
187
|
+
const normalized = name.trim().toLowerCase().replace(/-/g, "_");
|
|
188
|
+
const namespaced = normalized.split("__").at(-1) ?? normalized;
|
|
189
|
+
return namespaced.split(".").at(-1) ?? namespaced;
|
|
190
|
+
}
|
|
191
|
+
function resolveToolActivityDefinition(name) {
|
|
192
|
+
const normalized = name.trim().toLowerCase().replace(/-/g, "_");
|
|
193
|
+
return TOOL_ACTIVITY_CATALOG[normalized] ?? TOOL_ACTIVITY_CATALOG[toolActivityId(normalized)] ?? OTHER_ACTIVITY;
|
|
194
|
+
}
|
|
195
|
+
function asRecord(value) {
|
|
196
|
+
if (typeof value === "string") try {
|
|
197
|
+
return asRecord(JSON.parse(value));
|
|
198
|
+
} catch {
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
202
|
+
}
|
|
203
|
+
function resultCount(result) {
|
|
204
|
+
const record = asRecord(result);
|
|
205
|
+
const results = asRecord(record?.details)?.results ?? record?.results;
|
|
206
|
+
return Array.isArray(results) ? results.length : void 0;
|
|
207
|
+
}
|
|
208
|
+
function resultHasError(result) {
|
|
209
|
+
const record = asRecord(result);
|
|
210
|
+
return typeof (asRecord(record?.details)?.error ?? record?.error) === "string";
|
|
211
|
+
}
|
|
212
|
+
function resolveToolActivity(name, status, result) {
|
|
213
|
+
const definition = resolveToolActivityDefinition(name);
|
|
214
|
+
const count = resultCount(result);
|
|
215
|
+
const resolvedStatus = status === "completed" && resultHasError(result) ? "failed" : status === "completed" && count === 0 ? "empty" : status;
|
|
216
|
+
return {
|
|
217
|
+
...definition,
|
|
218
|
+
status: resolvedStatus,
|
|
219
|
+
...count === void 0 ? {} : { count }
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
//#endregion
|
|
223
|
+
export { resolveToolActivity };
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { parseServerRealtimeMessage } from "../../realtime-protocol/src/index.js";
|
|
2
|
+
//#region packages/realtime-client/src/index.ts
|
|
3
|
+
function clientMessage(kind, payload) {
|
|
4
|
+
return {
|
|
5
|
+
protocolVersion: 1,
|
|
6
|
+
messageId: crypto.randomUUID(),
|
|
7
|
+
kind,
|
|
8
|
+
sentAt: Date.now(),
|
|
9
|
+
payload
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function frameText(data) {
|
|
13
|
+
if (typeof data === "string") return data;
|
|
14
|
+
if (data instanceof ArrayBuffer) return new TextDecoder().decode(data);
|
|
15
|
+
if (ArrayBuffer.isView(data)) {
|
|
16
|
+
const bytes = Uint8Array.from(new Uint8Array(data.buffer, data.byteOffset, data.byteLength));
|
|
17
|
+
return new TextDecoder().decode(bytes);
|
|
18
|
+
}
|
|
19
|
+
throw new Error("Realtime server sent a non-text frame");
|
|
20
|
+
}
|
|
21
|
+
var RealtimeClient = class {
|
|
22
|
+
desiredSubscriptions = /* @__PURE__ */ new Map();
|
|
23
|
+
cursors = /* @__PURE__ */ new Map();
|
|
24
|
+
socket;
|
|
25
|
+
reconnectTimer;
|
|
26
|
+
heartbeatTimer;
|
|
27
|
+
generation = 0;
|
|
28
|
+
reconnectAttempts = 0;
|
|
29
|
+
shouldReconnect = false;
|
|
30
|
+
ready = false;
|
|
31
|
+
endpointBinding;
|
|
32
|
+
constructor(options) {
|
|
33
|
+
this.options = options;
|
|
34
|
+
}
|
|
35
|
+
connect() {
|
|
36
|
+
if (this.shouldReconnect) return;
|
|
37
|
+
this.shouldReconnect = true;
|
|
38
|
+
this.open(false);
|
|
39
|
+
}
|
|
40
|
+
disconnect() {
|
|
41
|
+
this.shouldReconnect = false;
|
|
42
|
+
this.generation += 1;
|
|
43
|
+
this.clearTimers();
|
|
44
|
+
this.ready = false;
|
|
45
|
+
this.endpointBinding?.onDisconnected?.();
|
|
46
|
+
this.socket?.close(1e3, "Client disconnected");
|
|
47
|
+
this.socket = void 0;
|
|
48
|
+
this.options.onStateChange?.("disconnected");
|
|
49
|
+
}
|
|
50
|
+
reconnect() {
|
|
51
|
+
this.generation += 1;
|
|
52
|
+
this.clearTimers();
|
|
53
|
+
this.ready = false;
|
|
54
|
+
this.endpointBinding?.onDisconnected?.();
|
|
55
|
+
this.socket?.close(1e3, "Client reconnecting");
|
|
56
|
+
this.socket = void 0;
|
|
57
|
+
this.reconnectAttempts = 0;
|
|
58
|
+
this.shouldReconnect = true;
|
|
59
|
+
this.open(true);
|
|
60
|
+
}
|
|
61
|
+
subscribe(topic, afterSeq) {
|
|
62
|
+
this.desiredSubscriptions.set(topic, afterSeq);
|
|
63
|
+
if (this.ready) {
|
|
64
|
+
this.sendSubscriptions([{
|
|
65
|
+
topic,
|
|
66
|
+
afterSeq: afterSeq ?? this.cursors.get(topic)
|
|
67
|
+
}]);
|
|
68
|
+
this.desiredSubscriptions.set(topic, void 0);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
unsubscribe(topic) {
|
|
72
|
+
this.desiredSubscriptions.delete(topic);
|
|
73
|
+
if (this.ready) this.send(clientMessage("realtime.unsubscribe", { topics: [topic] }));
|
|
74
|
+
}
|
|
75
|
+
sendEndpointMessage(message) {
|
|
76
|
+
if (!this.ready) throw new Error("Realtime connection is not ready");
|
|
77
|
+
this.send(clientMessage("endpoint.message", message));
|
|
78
|
+
}
|
|
79
|
+
setEndpoint(binding) {
|
|
80
|
+
this.endpointBinding = binding;
|
|
81
|
+
if (this.shouldReconnect) this.reconnect();
|
|
82
|
+
}
|
|
83
|
+
clearEndpoint(binding) {
|
|
84
|
+
if (binding && this.endpointBinding !== binding) return;
|
|
85
|
+
const previous = this.endpointBinding;
|
|
86
|
+
this.endpointBinding = void 0;
|
|
87
|
+
previous?.onDisconnected?.();
|
|
88
|
+
if (this.shouldReconnect) this.reconnect();
|
|
89
|
+
}
|
|
90
|
+
async open(reconnecting) {
|
|
91
|
+
const generation = ++this.generation;
|
|
92
|
+
this.options.onStateChange?.(reconnecting ? "reconnecting" : "connecting");
|
|
93
|
+
try {
|
|
94
|
+
const [ticket, endpoint] = await Promise.all([this.options.issueTicket(), this.endpointBinding?.createHello()]);
|
|
95
|
+
if (!this.shouldReconnect || generation !== this.generation) return;
|
|
96
|
+
const socket = this.options.createWebSocket(this.options.getWebSocketUrl());
|
|
97
|
+
this.socket = socket;
|
|
98
|
+
socket.onopen = () => {
|
|
99
|
+
if (generation !== this.generation) return;
|
|
100
|
+
const subscriptions = [...this.desiredSubscriptions].map(([topic, afterSeq]) => ({
|
|
101
|
+
topic,
|
|
102
|
+
afterSeq: afterSeq ?? this.cursors.get(topic)
|
|
103
|
+
}));
|
|
104
|
+
for (const topic of this.desiredSubscriptions.keys()) this.desiredSubscriptions.set(topic, void 0);
|
|
105
|
+
this.send(clientMessage("realtime.hello", {
|
|
106
|
+
ticket,
|
|
107
|
+
clientId: this.options.clientId,
|
|
108
|
+
clientKind: this.options.clientKind,
|
|
109
|
+
subscriptions,
|
|
110
|
+
...endpoint ? { endpoint } : {}
|
|
111
|
+
}));
|
|
112
|
+
};
|
|
113
|
+
socket.onmessage = (event) => {
|
|
114
|
+
if (generation !== this.generation) return;
|
|
115
|
+
try {
|
|
116
|
+
this.handleServerMessage(frameText(event.data));
|
|
117
|
+
} catch (error) {
|
|
118
|
+
this.fail(error instanceof Error ? error.message : "Invalid realtime server message");
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
socket.onerror = () => {
|
|
122
|
+
if (generation === this.generation) this.options.onStateChange?.("reconnecting");
|
|
123
|
+
};
|
|
124
|
+
socket.onclose = (event) => {
|
|
125
|
+
if (generation !== this.generation) return;
|
|
126
|
+
this.ready = false;
|
|
127
|
+
this.endpointBinding?.onDisconnected?.();
|
|
128
|
+
this.socket = void 0;
|
|
129
|
+
this.clearHeartbeat();
|
|
130
|
+
if (this.shouldReconnect) this.scheduleReconnect(event.reason || `WebSocket closed (${event.code ?? 0})`);
|
|
131
|
+
else this.options.onStateChange?.("disconnected");
|
|
132
|
+
};
|
|
133
|
+
} catch (error) {
|
|
134
|
+
if (generation !== this.generation) return;
|
|
135
|
+
this.scheduleReconnect(error instanceof Error ? error.message : "Realtime connection failed");
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
handleServerMessage(text) {
|
|
139
|
+
const message = parseServerRealtimeMessage(JSON.parse(text));
|
|
140
|
+
if (message.kind === "realtime.ready") {
|
|
141
|
+
this.ready = true;
|
|
142
|
+
this.reconnectAttempts = 0;
|
|
143
|
+
this.options.onStateChange?.("connected");
|
|
144
|
+
if (message.payload.endpoint) this.endpointBinding?.onReady(message.payload.endpoint);
|
|
145
|
+
this.clearHeartbeat();
|
|
146
|
+
this.heartbeatTimer = setInterval(() => {
|
|
147
|
+
if (this.ready) this.send(clientMessage("realtime.ping", {}));
|
|
148
|
+
}, message.payload.heartbeatIntervalMs);
|
|
149
|
+
} else if (message.kind === "realtime.event") {
|
|
150
|
+
this.cursors.set(message.payload.topic, message.payload.seq);
|
|
151
|
+
this.options.onEvent?.(message.payload);
|
|
152
|
+
} else if (message.kind === "realtime.gap") {
|
|
153
|
+
this.cursors.set(message.payload.topic, message.payload.earliestSeq - 1);
|
|
154
|
+
this.options.onGap?.(message.payload);
|
|
155
|
+
} else if (message.kind === "realtime.error") this.options.onStateChange?.("error", message.payload.message);
|
|
156
|
+
else if (message.kind === "endpoint.message") {
|
|
157
|
+
this.endpointBinding?.onMessage(message.payload);
|
|
158
|
+
this.options.onEndpointMessage?.(message.payload);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
sendSubscriptions(subscriptions) {
|
|
162
|
+
this.send(clientMessage("realtime.subscribe", { subscriptions }));
|
|
163
|
+
}
|
|
164
|
+
send(message) {
|
|
165
|
+
if (!this.socket || this.socket.readyState !== 1) return;
|
|
166
|
+
this.socket.send(JSON.stringify(message));
|
|
167
|
+
}
|
|
168
|
+
scheduleReconnect(error) {
|
|
169
|
+
if (!this.shouldReconnect) return;
|
|
170
|
+
this.reconnectAttempts += 1;
|
|
171
|
+
const max = this.options.maxReconnectAttempts;
|
|
172
|
+
if (max !== void 0 && this.reconnectAttempts > max) {
|
|
173
|
+
this.shouldReconnect = false;
|
|
174
|
+
this.options.onStateChange?.("error", error);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
this.options.onStateChange?.("reconnecting", error);
|
|
178
|
+
const delay = Math.min(3e4, 1e3 * 2 ** Math.min(this.reconnectAttempts - 1, 5));
|
|
179
|
+
this.reconnectTimer = setTimeout(() => {
|
|
180
|
+
this.reconnectTimer = void 0;
|
|
181
|
+
this.open(true);
|
|
182
|
+
}, delay);
|
|
183
|
+
}
|
|
184
|
+
fail(message) {
|
|
185
|
+
this.options.onStateChange?.("error", message);
|
|
186
|
+
this.socket?.close(4400, "Invalid server message");
|
|
187
|
+
}
|
|
188
|
+
clearHeartbeat() {
|
|
189
|
+
if (this.heartbeatTimer) clearInterval(this.heartbeatTimer);
|
|
190
|
+
this.heartbeatTimer = void 0;
|
|
191
|
+
}
|
|
192
|
+
clearTimers() {
|
|
193
|
+
if (this.reconnectTimer) clearTimeout(this.reconnectTimer);
|
|
194
|
+
this.reconnectTimer = void 0;
|
|
195
|
+
this.clearHeartbeat();
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
//#endregion
|
|
199
|
+
export { RealtimeClient };
|