@xopcai/xopc 0.0.188 → 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/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store--QoUGhiS.js → activity-store-DTFKTPs8.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-B0yweLNQ.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-5laWqfiE.js → api-DWeXfwVU.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BXJ8Jiv_.js → app-management-settings-panel-BRpV8PXG.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DG9n9D1M.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-Ceh5qrZf.js → archive-plugin-Df7Ycj_7.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-jFW7uYf7.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-XDlkI1r4.js → binary-plugins-BJah99wE.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-kyKc2IhE.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-BJa5Iz_v.js → browser-workflow-inputs-vyUfdzAd.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-CTQQOsn5.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-Dn-7MMEo.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-BgIkWq01.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-TRr9ybf6.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-CSwd00CV.js → desktop-pet-BUuBEJuP.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CuNQvHGu.js → desktop-pet-settings-BGfVIJM3.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-ct0n5Rje.js → directory-picker-path-field-DrQFfHH_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BeRBuMUU.js → extension-debug-page-CEnIFOX-.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DbK-Cwao.js → extension-page-CCqHbexs.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-C9ag5tb5.js → extension-settings-page-DEZw_7zN.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-CC7EvEFp.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-B2DmdlwO.js → gateway-startup-retry-DxhKNiCF.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-fl1oC_-5.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-GMTaS6eI.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-DhGYddbI.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-CmnrBmWi.js → local-apps-page-Ca1RuI13.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-D6hs74o5.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-CZaBPOVn.js → markdown-split-BGOYjgnM.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CiKvSgCv.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-Bisbzqlz.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-BxlwhAbH.js → page-tabs-DNrbCgmC.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-RM8wXxfT.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-DdBlibek.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-BDKbpmXv.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-zxo5ZGOu.js → settings-form-section-C4GXGeA4.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DgIp8_S6.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-97LmwrzC.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-BH7i3g1S.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-s-a5WV9j.js → skills-page.utils-zsz2HIlZ.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BxjeMT5k.js → system-settings-panel-IWNDBI1O.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-BahycnfW.js → task-detail-page-CgtK02kP.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BRxdsmic.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-39MjwPSq.js → typed-models-lib-C07LGthO.js} +1 -1
- package/dist/gateway/static/root/assets/{use-save-bar-registration-5aVSjTjO.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-XU-7sBSg.js → voice-api-key-field-Boue1D46.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CJqu8UHq.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-DXtg8Qxl.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/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 +1 -0
- 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/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/gateway-tools.js +1 -1
- package/dist/src/agent/external-tools/index.d.ts +4 -5
- package/dist/src/agent/external-tools/index.js +8 -2
- package/dist/src/agent/external-tools/types.d.ts +8 -1
- package/dist/src/agent/external-tools/types.js +2 -1
- package/dist/src/agent/inbound/inbound-loop.js +4 -0
- 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/messaging/command-handler.d.ts +2 -2
- package/dist/src/agent/messaging/command-handler.js +3 -3
- 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 -1
- package/dist/src/agent/service.js +6 -4
- package/dist/src/agent/service.types.d.ts +2 -0
- 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/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/factory.d.ts +4 -0
- package/dist/src/agent/tools/factory.js +1 -0
- 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/channels/pairing/pairing-challenge.d.ts +1 -1
- package/dist/src/channels/pairing/pairing-challenge.js +1 -1
- 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/cli/commands/extension-marketplace.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/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/types/hooks.d.ts +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/chat-stream/protocol.d.ts +0 -1
- package/dist/src/gateway/clarify-bridge.d.ts +5 -4
- package/dist/src/gateway/clarify-bridge.js +3 -4
- package/dist/src/gateway/heartbeat/service.js +4 -1
- 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 +0 -1
- 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/auth-registry-extensions.js +1 -1
- 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/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/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/workflows.js +1 -1
- package/dist/src/gateway/hono/routes/you.d.ts +0 -9
- package/dist/src/gateway/hono/routes/you.js +78 -125
- 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/run-gateway-agent.d.ts +4 -3
- package/dist/src/gateway/service/run-gateway-agent.js +13 -13
- 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 +43 -26
- package/dist/src/infra/update-runner.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/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/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/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/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 +1 -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/package.json +6 -3
- package/dist/gateway/static/root/assets/agents-C6OV-gMm.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-Ci14lDeO.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-Q1xmb4Rh.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DbowrHXD.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DoZPFdKF.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-Bt8Hnx0h.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-Bpsebsru.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-DFmdYRE5.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Tg5kl22i.js +0 -2
- package/dist/gateway/static/root/assets/gateway-settings-9g8uIry9.js +0 -1
- package/dist/gateway/static/root/assets/home-page-Bao9jq_z.js +0 -3
- package/dist/gateway/static/root/assets/index-Cl5n1f_U.css +0 -1
- package/dist/gateway/static/root/assets/index-OJgiMh07.js +0 -223
- package/dist/gateway/static/root/assets/local-app-workbench-page-B69NvtvH.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-Cq3cABqg.js +0 -7
- package/dist/gateway/static/root/assets/messages-D02NNLCZ.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-BOZfJFhE.js +0 -4
- package/dist/gateway/static/root/assets/product-delivery-C8JbSj5Y.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-TSKFb2tN.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BokeBrTT.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C56anxCX.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-C7TQADrD.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BDOPKeAX.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-BUPSIa9P.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BRg766eW.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DhEAviQ_.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Ct7AV8ls.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-DoVuprZm.js +0 -2
- package/dist/gateway/static/root/assets/time-picker-BGk_Tbsj.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-B9K41qmy.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BBVnRHju.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-Bs_tYfst.js +0 -11
- package/dist/src/agent/streaming/reasoning-visibility-sse.d.ts +0 -15
- 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
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { endpointTurnClaimSchema } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
1
2
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
2
|
-
import { createAgentResumeHandler, createEventsSSEHandler, createSendHandler } from "../sse.js";
|
|
3
3
|
//#region src/gateway/hono/routes/agent-stream.ts
|
|
4
4
|
function registerAgentStreamRoutes(authenticated, deps) {
|
|
5
|
-
const { service, chatRateLimitMiddleware
|
|
6
|
-
authenticated.post("/api/agent/resume", chatRateLimitMiddleware, createAgentResumeHandler(sseConfig));
|
|
5
|
+
const { service, chatRateLimitMiddleware } = deps;
|
|
7
6
|
authenticated.post("/api/agent/abort", chatRateLimitMiddleware, async (c) => {
|
|
8
7
|
const body = await c.req.json().catch(() => null);
|
|
9
8
|
const runId = body && typeof body === "object" && typeof body.runId === "string" ? body.runId.trim() : "";
|
|
@@ -70,13 +69,32 @@ function registerAgentStreamRoutes(authenticated, deps) {
|
|
|
70
69
|
message: "Missing delivery"
|
|
71
70
|
}
|
|
72
71
|
}, 400);
|
|
72
|
+
const origin = endpointTurnClaimSchema.safeParse(body.origin);
|
|
73
|
+
if (!origin.success) return c.json({
|
|
74
|
+
ok: false,
|
|
75
|
+
error: {
|
|
76
|
+
code: "BAD_REQUEST",
|
|
77
|
+
message: "Invalid endpoint origin"
|
|
78
|
+
}
|
|
79
|
+
}, 400);
|
|
80
|
+
if (!service.endpointTools.registry.verifyTurnClaim(origin.data.endpointId, origin.data.token)) return c.json({
|
|
81
|
+
ok: false,
|
|
82
|
+
error: {
|
|
83
|
+
code: "INVALID_ENDPOINT",
|
|
84
|
+
message: "Endpoint connection is not active"
|
|
85
|
+
}
|
|
86
|
+
}, 401);
|
|
73
87
|
const result = await service.submitSessionInput({
|
|
74
88
|
sessionKey,
|
|
75
89
|
clientMessageId: typeof body.clientMessageId === "string" ? body.clientMessageId : "",
|
|
76
90
|
delivery,
|
|
77
91
|
content,
|
|
78
92
|
attachments,
|
|
79
|
-
thinking: typeof body.thinking === "string" ? body.thinking : void 0
|
|
93
|
+
thinking: typeof body.thinking === "string" ? body.thinking : void 0,
|
|
94
|
+
origin: {
|
|
95
|
+
type: "endpoint",
|
|
96
|
+
endpointId: origin.data.endpointId
|
|
97
|
+
}
|
|
80
98
|
});
|
|
81
99
|
if (result.ok === false) return c.json({
|
|
82
100
|
ok: false,
|
|
@@ -195,8 +213,33 @@ function registerAgentStreamRoutes(authenticated, deps) {
|
|
|
195
213
|
payload: { received: true }
|
|
196
214
|
});
|
|
197
215
|
});
|
|
198
|
-
authenticated.post("/api/send", chatRateLimitMiddleware,
|
|
199
|
-
|
|
216
|
+
authenticated.post("/api/send", chatRateLimitMiddleware, async (c) => {
|
|
217
|
+
const body = await c.req.json().catch(() => null);
|
|
218
|
+
const channel = typeof body?.channel === "string" ? body.channel : "";
|
|
219
|
+
const chatId = typeof body?.chatId === "string" ? body.chatId : "";
|
|
220
|
+
const content = typeof body?.content === "string" ? body.content : "";
|
|
221
|
+
if (!channel || !chatId || !content) return c.json({
|
|
222
|
+
ok: false,
|
|
223
|
+
error: {
|
|
224
|
+
code: "BAD_REQUEST",
|
|
225
|
+
message: "Missing required fields: channel, chatId, content"
|
|
226
|
+
}
|
|
227
|
+
}, 400);
|
|
228
|
+
try {
|
|
229
|
+
return c.json({
|
|
230
|
+
ok: true,
|
|
231
|
+
payload: await service.sendMessage(channel, chatId, content)
|
|
232
|
+
});
|
|
233
|
+
} catch (error) {
|
|
234
|
+
return c.json({
|
|
235
|
+
ok: false,
|
|
236
|
+
error: {
|
|
237
|
+
code: "INTERNAL_ERROR",
|
|
238
|
+
message: error instanceof Error ? error.message : "Unknown error"
|
|
239
|
+
}
|
|
240
|
+
}, 500);
|
|
241
|
+
}
|
|
242
|
+
});
|
|
200
243
|
}
|
|
201
244
|
//#endregion
|
|
202
245
|
export { registerAgentStreamRoutes };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getAllModels, getAvailableModels, init_providers } from "../../../providers/index.js";
|
|
2
2
|
import { ActivationPlanner } from "../../../extensions/activation-planner.js";
|
|
3
3
|
import { mergeActivationContext } from "../../../extensions/activation-context.js";
|
|
4
|
-
import { buildWhenContextSnapshot } from "../../../extensions/when-context.js";
|
|
5
4
|
import { fetchRegistry, listExtensions, searchExtensions } from "../../../extensions/marketplace.js";
|
|
5
|
+
import { buildWhenContextSnapshot } from "../../../extensions/when-context.js";
|
|
6
6
|
import { createOAuthHandler } from "../oauth.js";
|
|
7
7
|
import { createOAuthAsyncHandler } from "../oauth-async.js";
|
|
8
8
|
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* Covers heartbeat, bind/customBindHost/port, tailscale, auth (mode + token +
|
|
5
5
|
* password + rateLimit + trustedProxy), trustedProxies, allowRealIpFallback,
|
|
6
6
|
* dangerouslyAllowHostHeaderOriginFallback, security, share, siteShare, publicUrl, webchat,
|
|
7
|
-
* corsOrigins
|
|
7
|
+
* corsOrigins and channelConnectDefer{Mode,Ids,SkipIds}.
|
|
8
8
|
*
|
|
9
9
|
* Validation policy: each subsection that can reject rejects with a 400 and a
|
|
10
10
|
* specific `message`. The dispatcher converts these into `c.json(...)`.
|
|
11
11
|
*
|
|
12
12
|
* Initial-state branches use the same literal defaults the inline code did
|
|
13
|
-
* (loopback + port 18790 + 1800s heartbeat +
|
|
13
|
+
* (loopback + port 18790 + 1800s heartbeat + empty CORS) so
|
|
14
14
|
* a brand-new install gets a working gateway after the first PATCH.
|
|
15
15
|
*/
|
|
16
16
|
import type { Config } from '../../../../config/schema.js';
|
|
@@ -20,7 +20,6 @@ function ensureGateway(config) {
|
|
|
20
20
|
intervalMs: 18e5,
|
|
21
21
|
includeSystemPromptSection: false
|
|
22
22
|
},
|
|
23
|
-
maxSseConnections: 100,
|
|
24
23
|
corsOrigins: []
|
|
25
24
|
};
|
|
26
25
|
return config.gateway;
|
|
@@ -98,7 +97,6 @@ function applyGatewayPatch(config, body) {
|
|
|
98
97
|
intervalMs: 18e5,
|
|
99
98
|
includeSystemPromptSection: false
|
|
100
99
|
},
|
|
101
|
-
maxSseConnections: 100,
|
|
102
100
|
corsOrigins: []
|
|
103
101
|
};
|
|
104
102
|
else config.gateway.bind = bind;
|
|
@@ -123,7 +121,6 @@ function applyGatewayPatch(config, body) {
|
|
|
123
121
|
intervalMs: 18e5,
|
|
124
122
|
includeSystemPromptSection: false
|
|
125
123
|
},
|
|
126
|
-
maxSseConnections: 100,
|
|
127
124
|
corsOrigins: []
|
|
128
125
|
};
|
|
129
126
|
else config.gateway.port = Math.floor(body.gateway.port);
|
|
@@ -139,7 +136,6 @@ function applyGatewayPatch(config, body) {
|
|
|
139
136
|
intervalMs: 18e5,
|
|
140
137
|
includeSystemPromptSection: false
|
|
141
138
|
},
|
|
142
|
-
maxSseConnections: 100,
|
|
143
139
|
corsOrigins: []
|
|
144
140
|
};
|
|
145
141
|
config.gateway.tailscale = { ...config.gateway.tailscale ?? {
|
|
@@ -251,21 +247,6 @@ function applyGatewayPatch(config, body) {
|
|
|
251
247
|
const gw = ensureGateway(config);
|
|
252
248
|
gw.corsOrigins = body.gateway.corsOrigins.filter((x) => typeof x === "string" && x.trim().length > 0).map((x) => x.trim());
|
|
253
249
|
}
|
|
254
|
-
if (body.gateway?.maxSseConnections !== void 0) {
|
|
255
|
-
if (typeof body.gateway.maxSseConnections !== "number" || !Number.isFinite(body.gateway.maxSseConnections) || body.gateway.maxSseConnections < 1) return patchError("gateway.maxSseConnections must be a positive integer");
|
|
256
|
-
if (!config.gateway) config.gateway = {
|
|
257
|
-
bind: "loopback",
|
|
258
|
-
port: 18790,
|
|
259
|
-
heartbeat: {
|
|
260
|
-
enabled: true,
|
|
261
|
-
intervalMs: 18e5,
|
|
262
|
-
includeSystemPromptSection: false
|
|
263
|
-
},
|
|
264
|
-
maxSseConnections: Math.floor(body.gateway.maxSseConnections),
|
|
265
|
-
corsOrigins: []
|
|
266
|
-
};
|
|
267
|
-
else config.gateway.maxSseConnections = Math.floor(body.gateway.maxSseConnections);
|
|
268
|
-
}
|
|
269
250
|
if (body.gateway?.channelConnectDeferMode !== void 0) {
|
|
270
251
|
const mode = body.gateway.channelConnectDeferMode;
|
|
271
252
|
if (mode !== "auto" && mode !== "off" && mode !== "explicit") return patchError("gateway.channelConnectDeferMode must be auto, off, or explicit");
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { MiddlewareHandler } from 'hono';
|
|
2
2
|
import type { GatewayService } from '../../service.js';
|
|
3
|
-
import type { SSEHandlerConfig } from '../sse.js';
|
|
4
3
|
export interface AuthenticatedRouteDeps {
|
|
5
4
|
service: GatewayService;
|
|
6
5
|
strictRateLimitMiddleware: MiddlewareHandler;
|
|
7
6
|
chatRateLimitMiddleware: MiddlewareHandler;
|
|
8
7
|
xopcCloudPollRateLimitMiddleware: MiddlewareHandler;
|
|
9
8
|
channelRateLimitMiddleware?: MiddlewareHandler;
|
|
10
|
-
sseConfig: SSEHandlerConfig;
|
|
11
9
|
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { endpointPrincipalRegistrationSchema } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
2
|
+
import { createEndpointPrincipal, getEndpointPrincipal, listEndpointPrincipals, revokeEndpointPrincipal } from "../../../storage/sqlite/endpoint-principal-repository.js";
|
|
3
|
+
import { listEndpointToolInvocationAudits } from "../../../storage/sqlite/endpoint-tool-invocation-repository.js";
|
|
4
|
+
import "../../../storage/sqlite/index.js";
|
|
5
|
+
import { parseEndpointPublicKey } from "../../../endpoint-tools/auth.js";
|
|
6
|
+
import { ENDPOINT_UPLOAD_MAX_BYTES, EndpointUploadError } from "../../../endpoint-tools/upload-service.js";
|
|
7
|
+
//#region src/gateway/hono/routes/endpoint-tools.ts
|
|
8
|
+
async function readBoundedBody(body, maxBytes) {
|
|
9
|
+
if (!body) return new Uint8Array();
|
|
10
|
+
const reader = body.getReader();
|
|
11
|
+
const chunks = [];
|
|
12
|
+
let size = 0;
|
|
13
|
+
try {
|
|
14
|
+
while (true) {
|
|
15
|
+
const { done, value } = await reader.read();
|
|
16
|
+
if (done) break;
|
|
17
|
+
size += value.byteLength;
|
|
18
|
+
if (size > maxBytes) throw new EndpointUploadError("Uploaded file is too large");
|
|
19
|
+
chunks.push(value);
|
|
20
|
+
}
|
|
21
|
+
} finally {
|
|
22
|
+
reader.releaseLock();
|
|
23
|
+
}
|
|
24
|
+
const bytes = new Uint8Array(size);
|
|
25
|
+
let offset = 0;
|
|
26
|
+
for (const chunk of chunks) {
|
|
27
|
+
bytes.set(chunk, offset);
|
|
28
|
+
offset += chunk.byteLength;
|
|
29
|
+
}
|
|
30
|
+
return bytes;
|
|
31
|
+
}
|
|
32
|
+
function registerEndpointToolRoutes(authenticated, deps) {
|
|
33
|
+
authenticated.get("/api/endpoint-tools/principals", (c) => {
|
|
34
|
+
const endpointsByPrincipal = /* @__PURE__ */ new Map();
|
|
35
|
+
for (const endpoint of deps.service.endpointTools.registry.list()) {
|
|
36
|
+
const endpoints = endpointsByPrincipal.get(endpoint.principalId) ?? [];
|
|
37
|
+
endpoints.push(endpoint);
|
|
38
|
+
endpointsByPrincipal.set(endpoint.principalId, endpoints);
|
|
39
|
+
}
|
|
40
|
+
return c.json({
|
|
41
|
+
ok: true,
|
|
42
|
+
payload: listEndpointPrincipals().map(({ publicKey: _publicKey, ...principal }) => ({
|
|
43
|
+
...principal,
|
|
44
|
+
endpoints: endpointsByPrincipal.get(principal.id) ?? []
|
|
45
|
+
}))
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
authenticated.post("/api/endpoint-tools/principals", async (c) => {
|
|
49
|
+
const parsed = endpointPrincipalRegistrationSchema.safeParse(await c.req.json().catch(() => null));
|
|
50
|
+
if (!parsed.success) return c.json({
|
|
51
|
+
ok: false,
|
|
52
|
+
error: {
|
|
53
|
+
code: "BAD_REQUEST",
|
|
54
|
+
message: "Invalid endpoint principal"
|
|
55
|
+
}
|
|
56
|
+
}, 400);
|
|
57
|
+
try {
|
|
58
|
+
parseEndpointPublicKey(parsed.data.publicKey);
|
|
59
|
+
} catch {
|
|
60
|
+
return c.json({
|
|
61
|
+
ok: false,
|
|
62
|
+
error: {
|
|
63
|
+
code: "BAD_REQUEST",
|
|
64
|
+
message: "Invalid endpoint public key"
|
|
65
|
+
}
|
|
66
|
+
}, 400);
|
|
67
|
+
}
|
|
68
|
+
const existing = getEndpointPrincipal(parsed.data.principalId);
|
|
69
|
+
if (existing && !existing.revokedAt && existing.displayName === parsed.data.displayName && existing.kind === parsed.data.kind && existing.platform === parsed.data.platform && existing.publicKey === parsed.data.publicKey) return c.json({
|
|
70
|
+
ok: true,
|
|
71
|
+
payload: existing
|
|
72
|
+
}, 200);
|
|
73
|
+
if (existing) {
|
|
74
|
+
if (existing.revokedAt) return c.json({
|
|
75
|
+
ok: false,
|
|
76
|
+
error: {
|
|
77
|
+
code: "PRINCIPAL_REVOKED",
|
|
78
|
+
message: "Endpoint principal was revoked"
|
|
79
|
+
}
|
|
80
|
+
}, 403);
|
|
81
|
+
return c.json({
|
|
82
|
+
ok: false,
|
|
83
|
+
error: {
|
|
84
|
+
code: "CONFLICT",
|
|
85
|
+
message: "Endpoint principal already exists"
|
|
86
|
+
}
|
|
87
|
+
}, 409);
|
|
88
|
+
}
|
|
89
|
+
const principal = createEndpointPrincipal({
|
|
90
|
+
id: parsed.data.principalId,
|
|
91
|
+
displayName: parsed.data.displayName,
|
|
92
|
+
kind: parsed.data.kind,
|
|
93
|
+
platform: parsed.data.platform,
|
|
94
|
+
publicKey: parsed.data.publicKey
|
|
95
|
+
});
|
|
96
|
+
return c.json({
|
|
97
|
+
ok: true,
|
|
98
|
+
payload: principal
|
|
99
|
+
}, 201);
|
|
100
|
+
});
|
|
101
|
+
authenticated.delete("/api/endpoint-tools/principals/:principalId", (c) => {
|
|
102
|
+
const principalId = c.req.param("principalId").trim();
|
|
103
|
+
if (!principalId) return c.json({
|
|
104
|
+
ok: false,
|
|
105
|
+
error: {
|
|
106
|
+
code: "BAD_REQUEST",
|
|
107
|
+
message: "Missing principal id"
|
|
108
|
+
}
|
|
109
|
+
}, 400);
|
|
110
|
+
if (!revokeEndpointPrincipal(principalId)) return c.json({
|
|
111
|
+
ok: false,
|
|
112
|
+
error: {
|
|
113
|
+
code: "NOT_FOUND",
|
|
114
|
+
message: "Endpoint principal not found"
|
|
115
|
+
}
|
|
116
|
+
}, 404);
|
|
117
|
+
for (const endpoint of deps.service.endpointTools.registry.list()) if (endpoint.principalId === principalId) deps.service.endpointTools.disconnect(endpoint.endpointId, "Endpoint principal revoked");
|
|
118
|
+
return c.json({
|
|
119
|
+
ok: true,
|
|
120
|
+
payload: {
|
|
121
|
+
principalId,
|
|
122
|
+
revoked: true
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
authenticated.get("/api/endpoint-tools/invocations", (c) => {
|
|
127
|
+
const limit = Number(c.req.query("limit") ?? 100);
|
|
128
|
+
return c.json({
|
|
129
|
+
ok: true,
|
|
130
|
+
payload: listEndpointToolInvocationAudits(Number.isFinite(limit) ? limit : 100)
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
authenticated.post("/api/endpoint-tools/invocations/:invocationId/files", async (c) => {
|
|
134
|
+
const invocationId = c.req.param("invocationId");
|
|
135
|
+
const endpointId = c.req.header("x-endpoint-id") ?? "";
|
|
136
|
+
const token = c.req.header("x-endpoint-upload-token") ?? "";
|
|
137
|
+
const name = c.req.query("name") ?? "";
|
|
138
|
+
const mimeType = c.req.header("content-type")?.split(";", 1)[0]?.trim() ?? "";
|
|
139
|
+
if (Number(c.req.header("content-length") ?? 0) > ENDPOINT_UPLOAD_MAX_BYTES) return c.json({
|
|
140
|
+
ok: false,
|
|
141
|
+
error: {
|
|
142
|
+
code: "RESULT_TOO_LARGE",
|
|
143
|
+
message: "Uploaded file is too large"
|
|
144
|
+
}
|
|
145
|
+
}, 413);
|
|
146
|
+
try {
|
|
147
|
+
const bytes = await readBoundedBody(c.req.raw.body, ENDPOINT_UPLOAD_MAX_BYTES);
|
|
148
|
+
const file = deps.service.endpointTools.uploads.upload({
|
|
149
|
+
invocationId,
|
|
150
|
+
endpointId,
|
|
151
|
+
token,
|
|
152
|
+
name,
|
|
153
|
+
mimeType,
|
|
154
|
+
bytes
|
|
155
|
+
});
|
|
156
|
+
return c.json({
|
|
157
|
+
ok: true,
|
|
158
|
+
payload: {
|
|
159
|
+
type: "file",
|
|
160
|
+
fileId: file.fileId,
|
|
161
|
+
name: file.name,
|
|
162
|
+
mimeType: file.mimeType,
|
|
163
|
+
size: file.size,
|
|
164
|
+
sha256: file.sha256
|
|
165
|
+
}
|
|
166
|
+
}, 201);
|
|
167
|
+
} catch (error) {
|
|
168
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
169
|
+
return c.json({
|
|
170
|
+
ok: false,
|
|
171
|
+
error: {
|
|
172
|
+
code: error instanceof EndpointUploadError ? "INVALID_UPLOAD_GRANT" : "UPLOAD_FAILED",
|
|
173
|
+
message
|
|
174
|
+
}
|
|
175
|
+
}, 400);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
authenticated.get("/api/endpoint-tools/files/:fileId", (c) => {
|
|
179
|
+
const file = deps.service.endpointTools.uploads.getFile(c.req.param("fileId"));
|
|
180
|
+
const bytes = file && deps.service.endpointTools.uploads.readFile(file.fileId);
|
|
181
|
+
if (!file || !bytes) return c.json({
|
|
182
|
+
ok: false,
|
|
183
|
+
error: {
|
|
184
|
+
code: "NOT_FOUND",
|
|
185
|
+
message: "Endpoint file not found"
|
|
186
|
+
}
|
|
187
|
+
}, 404);
|
|
188
|
+
c.header("Content-Type", file.mimeType);
|
|
189
|
+
c.header("Content-Length", String(file.size));
|
|
190
|
+
c.header("Content-Disposition", `attachment; filename*=UTF-8''${encodeURIComponent(file.name)}`);
|
|
191
|
+
const body = bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
|
|
192
|
+
return c.body(body);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
//#endregion
|
|
196
|
+
export { registerEndpointToolRoutes };
|
|
@@ -10,6 +10,8 @@ import { registerSearchRoutes } from "./search.js";
|
|
|
10
10
|
import { registerMobileRoutes } from "./mobile.js";
|
|
11
11
|
import { registerInteractionStateRoutes } from "./interaction-state.js";
|
|
12
12
|
import { registerComposerHistoryRoutes } from "./composer-history.js";
|
|
13
|
+
import { registerEndpointToolRoutes } from "./endpoint-tools.js";
|
|
14
|
+
import { registerRealtimeRoutes } from "./realtime.js";
|
|
13
15
|
import { registerLocalAppsRoutes } from "./local-apps.js";
|
|
14
16
|
import { registerWorkDiscoveryRoutes } from "./work-discovery.js";
|
|
15
17
|
import { registerTaskRoutes } from "./tasks.js";
|
|
@@ -33,6 +35,8 @@ function registerCoreAuthenticatedRoutes(authenticated, deps) {
|
|
|
33
35
|
registerMobileRoutes(authenticated, deps);
|
|
34
36
|
registerInteractionStateRoutes(authenticated, deps);
|
|
35
37
|
registerComposerHistoryRoutes(authenticated, deps);
|
|
38
|
+
registerEndpointToolRoutes(authenticated, deps);
|
|
39
|
+
registerRealtimeRoutes(authenticated, deps);
|
|
36
40
|
}
|
|
37
41
|
function registerAuthenticatedRoutes(app, authenticated, deps) {
|
|
38
42
|
registerCoreAuthenticatedRoutes(authenticated, deps);
|
|
@@ -131,10 +131,6 @@ function registerLogsRoutes(authenticated, _deps) {
|
|
|
131
131
|
const { getLogLevel } = await import("../../../utils/logger.js");
|
|
132
132
|
return c.json({ level: getLogLevel() });
|
|
133
133
|
});
|
|
134
|
-
authenticated.get("/api/logs/stream", async (c) => {
|
|
135
|
-
const { createLogSSEHandler } = await import("../../../utils/logger/log-stream.js");
|
|
136
|
-
return createLogSSEHandler()(c);
|
|
137
|
-
});
|
|
138
134
|
}
|
|
139
135
|
//#endregion
|
|
140
136
|
export { registerLogsRoutes };
|
|
@@ -110,10 +110,10 @@ function registerPublicGatewayRoutes(app, service) {
|
|
|
110
110
|
"POST /api/sessions/:sessionKey/inputs",
|
|
111
111
|
"GET /api/sessions/:sessionKey/input-state",
|
|
112
112
|
"PATCH/DELETE /api/sessions/:sessionKey/inputs/:inputId",
|
|
113
|
-
"POST /api/agent/resume (SSE stream)",
|
|
114
113
|
"POST /api/agent/abort",
|
|
115
114
|
"POST /api/send",
|
|
116
|
-
"
|
|
115
|
+
"POST /api/realtime/tickets",
|
|
116
|
+
"WS /api/realtime/v1/ws",
|
|
117
117
|
"GET /api/channels/catalog",
|
|
118
118
|
"GET /api/channels/status",
|
|
119
119
|
"POST /api/channels/:channelId/actions/:actionId",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { realtimeClientKindSchema } from "../../../../packages/realtime-protocol/src/index.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/gateway/hono/routes/realtime.ts
|
|
4
|
+
const ticketRequestSchema = z.strictObject({
|
|
5
|
+
clientId: z.string().min(1).max(160),
|
|
6
|
+
clientKind: realtimeClientKindSchema
|
|
7
|
+
});
|
|
8
|
+
function registerRealtimeRoutes(authenticated, deps) {
|
|
9
|
+
authenticated.post("/api/realtime/tickets", async (c) => {
|
|
10
|
+
const parsed = ticketRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
11
|
+
if (!parsed.success) return c.json({
|
|
12
|
+
ok: false,
|
|
13
|
+
error: {
|
|
14
|
+
code: "BAD_REQUEST",
|
|
15
|
+
message: "Invalid realtime ticket request"
|
|
16
|
+
}
|
|
17
|
+
}, 400);
|
|
18
|
+
try {
|
|
19
|
+
return c.json({
|
|
20
|
+
ok: true,
|
|
21
|
+
payload: deps.service.realtime.tickets.issue(parsed.data.clientId, parsed.data.clientKind)
|
|
22
|
+
});
|
|
23
|
+
} catch (error) {
|
|
24
|
+
return c.json({
|
|
25
|
+
ok: false,
|
|
26
|
+
error: {
|
|
27
|
+
code: "TICKET_LIMIT",
|
|
28
|
+
message: error instanceof Error ? error.message : "Ticket issue failed"
|
|
29
|
+
}
|
|
30
|
+
}, 503);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { registerRealtimeRoutes };
|
|
@@ -7,9 +7,9 @@ import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
|
7
7
|
import "../../../workflows/domain/index.js";
|
|
8
8
|
import { resolveWorkflowRunArtifactsDir } from "../../../workflows/store/paths.js";
|
|
9
9
|
import { WorkflowDraftService } from "../../../workflows/draft/workflow-draft-service.js";
|
|
10
|
-
import "../../../workflows/draft/index.js";
|
|
11
10
|
import { WorkflowDraftConflictError, WorkflowDraftStore } from "../../../workflows/authoring/workflow-draft-store.js";
|
|
12
11
|
import "../../../workflows/authoring/index.js";
|
|
12
|
+
import "../../../workflows/draft/index.js";
|
|
13
13
|
import { basename, join } from "node:path";
|
|
14
14
|
import { readFile, stat } from "node:fs/promises";
|
|
15
15
|
//#region src/gateway/hono/routes/workflows.ts
|
|
@@ -21,14 +21,5 @@ export declare function buildPersonalPlaybooks(records: MemoryRecord[]): {
|
|
|
21
21
|
}[];
|
|
22
22
|
updatedAt: string;
|
|
23
23
|
}[];
|
|
24
|
-
export declare function buildInsightSuggestions(records: MemoryRecord[]): {
|
|
25
|
-
id: string;
|
|
26
|
-
insight: string;
|
|
27
|
-
kind: import("../../../agent/memory/types.js").MemoryKind;
|
|
28
|
-
action: "make_repeatable" | "add_playbook" | "start_progress";
|
|
29
|
-
evidenceCount: number;
|
|
30
|
-
confidence: number;
|
|
31
|
-
sourceName: string;
|
|
32
|
-
}[];
|
|
33
24
|
export declare function buildRoutineAutomationDraftHref(record: Pick<MemoryRecord, 'id' | 'content'>): string;
|
|
34
25
|
export declare function registerYouRoutes(authenticated: Hono, deps: AuthenticatedRouteDeps): void;
|