@xopcai/xopc 0.0.463 → 0.0.465
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/dist/browser-ext/dist/sidepanel.js +5 -0
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/adapters/cli-login.js +23 -49
- package/dist/extensions/feishu/src/adapters/gateway-setup.d.ts +3 -0
- package/dist/extensions/feishu/src/adapters/gateway-setup.js +180 -128
- package/dist/extensions/feishu/src/adapters/onboard-cli.d.ts +1 -1
- package/dist/extensions/feishu/src/adapters/onboard-cli.js +27 -15
- package/dist/extensions/feishu/src/auth/app-registration.d.ts +1 -0
- package/dist/extensions/feishu/src/auth/app-registration.js +12 -9
- package/dist/extensions/feishu/src/outbound/outbound-adapter.js +40 -16
- package/dist/extensions/feishu/src/plugin.d.ts +2 -0
- package/dist/extensions/feishu/src/plugin.js +37 -23
- package/dist/extensions/feishu/src/status/status-adapter.d.ts +1 -1
- package/dist/extensions/feishu/src/status/status-adapter.js +8 -5
- package/dist/extensions/feishu/src/streaming/streaming-adapter.js +97 -69
- package/dist/extensions/feishu/src/transport/client/bot-info.d.ts +10 -0
- package/dist/extensions/feishu/src/transport/client/bot-info.js +34 -0
- package/dist/extensions/feishu/src/transport/client/client.d.ts +7 -1
- package/dist/extensions/feishu/src/transport/client/client.js +6 -5
- package/dist/extensions/feishu/src/transport/client/install-sdk.d.ts +2 -0
- package/dist/extensions/feishu/src/transport/client/install-sdk.js +77 -0
- package/dist/extensions/feishu/src/transport/client/lark-sdk.d.ts +2 -0
- package/dist/extensions/feishu/src/transport/client/lark-sdk.js +27 -3
- package/dist/extensions/feishu/src/transport/client/sdk-catalog.d.ts +1 -0
- package/dist/extensions/feishu/src/transport/client/sdk-catalog.js +317 -0
- package/dist/extensions/feishu/src/transport/reliability/inbound-pipeline.d.ts +1 -1
- package/dist/extensions/feishu/src/transport/reliability/inbound-pipeline.js +13 -5
- package/dist/extensions/feishu/src/transport/reliability/message-ingress.d.ts +21 -0
- package/dist/extensions/feishu/src/transport/reliability/message-ingress.js +313 -0
- package/dist/extensions/feishu/src/transport/socket-mode/monitor.d.ts +1 -0
- package/dist/extensions/feishu/src/transport/socket-mode/monitor.js +56 -171
- package/dist/extensions/feishu/src/transport/webhook/monitor.d.ts +1 -0
- package/dist/extensions/feishu/src/transport/webhook/monitor.js +10 -102
- package/dist/extensions/telegram/src/account-manager.d.ts +1 -0
- package/dist/extensions/telegram/src/account-manager.js +3 -0
- package/dist/extensions/telegram/src/adapters/debounce-keys.js +7 -2
- package/dist/extensions/telegram/src/adapters/gateway-setup.js +113 -63
- package/dist/extensions/telegram/src/adapters/streaming-adapter.js +8 -4
- package/dist/extensions/telegram/src/doctor.js +1 -1
- package/dist/extensions/telegram/src/inbound-coalescer.d.ts +8 -6
- package/dist/extensions/telegram/src/inbound-coalescer.js +47 -88
- package/dist/extensions/telegram/src/inbound-processor.js +5 -1
- package/dist/extensions/telegram/src/outbound-sender.js +16 -23
- package/dist/extensions/telegram/src/plugin.js +80 -57
- package/dist/extensions/telegram/src/polling-session.d.ts +3 -6
- package/dist/extensions/telegram/src/polling-session.js +107 -94
- package/dist/extensions/telegram/src/rich-message.d.ts +4 -0
- package/dist/extensions/telegram/src/rich-message.js +23 -0
- package/dist/extensions/telegram/src/timeout-abort.d.ts +1 -1
- package/dist/extensions/telegram/src/timeout-abort.js +9 -3
- package/dist/extensions/telegram/src/update-offset-store.d.ts +1 -0
- package/dist/extensions/telegram/src/update-offset-store.js +6 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.d.ts +1 -0
- package/dist/extensions/weixin/src/api/api.js +12 -6
- package/dist/extensions/weixin/src/api/types.d.ts +5 -2
- package/dist/extensions/weixin/src/auth/login-qr.d.ts +7 -1
- package/dist/extensions/weixin/src/auth/login-qr.js +48 -13
- package/dist/extensions/weixin/src/cdn/pic-decrypt.d.ts +2 -2
- package/dist/extensions/weixin/src/cdn/pic-decrypt.js +37 -25
- package/dist/extensions/weixin/src/cli/gateway-qr-login.d.ts +8 -0
- package/dist/extensions/weixin/src/cli/gateway-qr-login.js +45 -6
- package/dist/extensions/weixin/src/cli/qr-login.d.ts +1 -1
- package/dist/extensions/weixin/src/cli/qr-login.js +9 -3
- package/dist/extensions/weixin/src/media/media-download.d.ts +1 -0
- package/dist/extensions/weixin/src/media/media-download.js +4 -5
- package/dist/extensions/weixin/src/messaging/process-message.d.ts +2 -0
- package/dist/extensions/weixin/src/messaging/process-message.js +90 -65
- package/dist/extensions/weixin/src/messaging/quote-cache.d.ts +10 -0
- package/dist/extensions/weixin/src/messaging/quote-cache.js +46 -0
- package/dist/extensions/weixin/src/monitor/monitor.d.ts +3 -3
- package/dist/extensions/weixin/src/monitor/monitor.js +108 -104
- package/dist/extensions/weixin/src/plugin.d.ts +5 -1
- package/dist/extensions/weixin/src/plugin.js +138 -42
- package/dist/gateway/static/root/assets/{activity-store-CQHh48Zf.js → activity-store-B9heFbtJ.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CAz-Ke6Q.js → agent-avatar-dicebear-nzhB7Xjk.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-loBdGw_i.js → agent-avatar-display-DBzgoHMD.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-By2Q-6JS.js → agent-defaults-settings-panel-BJrNV93g.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-C_rlXuEe.js → agent-plugin-dialog-DLbTHALG.js} +1 -1
- package/dist/gateway/static/root/assets/agents-C2xG8f56.js +77 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-D0N09mqJ.js → agents-admin-api-CqQbYIiY.js} +1 -1
- package/dist/gateway/static/root/assets/{api-B1J5ajiP.js → api-8tNOT72p.js} +1 -1
- package/dist/gateway/static/root/assets/{api-B4FJ51EC.js → api-BGodd--L.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BHlUDZOG.js → app-management-settings-panel-Q7apF7KE.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Du5JLyV1.js → appearance-settings-ClVZeUmo.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-D1qzENN_.js → apps-page-BsJJwpKj.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BAvglLfu.js → archive-plugin-Bl_M0WJp.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-DxBmyzp0.js → automation-api-BOnIc_vw.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-CAsqgMNR.js → automation-result-state-BwDSJs05.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-BmYeWB_N.js → automation-run-list-CqlIq4BG.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-CJbIHRxN.js → automation-task-card-D3WXVKRs.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-HYFnPiNG.js → automations-page-Bimqx5Pc.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-2SOvmw-f.js +9 -0
- package/dist/gateway/static/root/assets/{binary-plugins-D2bFqG6K.js → binary-plugins-DDNKe1Io.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DrZyRQQ0.js → block-editor-BQ3amsRP.js} +5 -5
- package/dist/gateway/static/root/assets/{browser-settings-page-CGcgZOWh.js → browser-settings-page-CHf1_RVl.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-hSb-qEgL.js → capabilities-C5oWMC-Z.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-Dr-vvMez.js → capabilities-Cj8vl1ZY.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-U_hQx5ou.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-B08mjrGB.js → capabilities-settings-panel-k5CcwhXN.js} +1 -1
- package/dist/gateway/static/root/assets/channels-BUzno8Pi.js +1 -0
- package/dist/gateway/static/root/assets/chat-agents-api-C3JChTsh.js +1 -0
- package/dist/gateway/static/root/assets/{chat-chart-block-ClCZyIi0.js → chat-chart-block-DrtmYOIo.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-CalELOKj.js → chat-page-qnsMsF_s.js} +29 -29
- package/dist/gateway/static/root/assets/{chat-terminal-dock-eneTvxV3.js → chat-terminal-dock-B0D220I-.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-CP0F6sIm.js → command-palette-api-CkJ6_Yf3.js} +1 -1
- package/dist/gateway/static/root/assets/composer-handoff-params-GKGdXjMZ.js +1 -0
- package/dist/gateway/static/root/assets/{composer-model-config-control-DAagrRx_.js → composer-model-config-control-DQCOWHzJ.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-notifications-CqV6Xj-H.js → composer-notifications-D__OU_xx.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-Dc43dgSg.js → composer-payload-handoff-BBTbJ1bO.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-f-vcEpeF.js → computer-settings-page-DGRUCkOt.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-CZ-FXxaW.js → connected-providers-grid-BoDipD2g.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-Cibh2lrV.js → connection-usage-guide-B1VUqibv.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-Btz68iy8.js → connector-service-page-bwQ1PekA.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-CTuVWwBf.js → connectors-api-BvYGL65q.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-B9mpz_Rt.js → connectors-page-BX6Jt6w5.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-XnE3iFhG.js → date-picker-ClRDaNBJ.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-VGKm0HVn.js → date-time-picker-CA6H47M6.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CBm3DySQ.js → desktop-pet-Bi8Hgf-x.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-6O77QXGo.js → desktop-pet-settings-CQ6qE8lf.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-B8fGILny.js → dev-view-store-UCqQeWa2.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-qtUvtdDT.js → device-pairing-wizard-gC-XZxt2.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-ByDqf5fE.js → directory-picker-path-field-Y8snl5Xl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-authoritative-grants-BfL8dMBf.js → extension-authoritative-grants-D2abOXTl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-Bn_5xu_M.js → extension-debug-page-OOlRCInL.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-Vs6USa0c.js → extension-iframe-host-D_WXBf6a.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-BIzkukYp.js → extension-marketplace-api-Bmtm6-L1.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-GIekDj_w.js → extension-message-router-xqjjSxcp.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C_3bIjSB.js → extension-page-bpQnyNz-.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-D-LolObs.js → extension-provider-l7SvHEK1.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-BvUtZGLT.js +1 -0
- package/dist/gateway/static/root/assets/{file-preview-surface-i5UOFnQF.js → file-preview-surface-B-r2ZnCV.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-1Rk0LeEM.js → gateway-config-swr-DOwezeL2.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-DIs1pjkQ.js → gateway-realtime-Br7dErHY.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-OaEqjNTb.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-DTmlcJps.js → gateway-restart-B3Xro3qd.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-ClcCloqQ.js → gateway-settings-DCnP-HPj.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-D6WPS0RW.js → gateway-startup-retry-vteSIhYI.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-BpDMnJe7.js → global-defaults-api-Bpje9rVk.js} +1 -1
- package/dist/gateway/static/root/assets/grip-horizontal-CqVA8V1e.js +1 -0
- package/dist/gateway/static/root/assets/home-page-CNEgNWEQ.js +8 -0
- package/dist/gateway/static/root/assets/{image-generation-api-sbtx4NiC.js → image-generation-api-BvpAa3Lj.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-CBlaxUhl.js → imports-page-Dx5T5pqw.js} +1 -1
- package/dist/gateway/static/root/assets/index-Cdo4_zon.js +11 -0
- package/dist/gateway/static/root/assets/index-DYTktubl.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-DxSv1wS2.js → install-connector-dialog-Cb4ufypG.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CnAV96nr.js → keyboard-shortcuts-settings-BEuXrnv0.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CfnixDO3.js → local-app-workbench-page-CPFIbEbv.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BI3Be5qo.js → local-apps-page-DxHcRSxc.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-Cmc-GCVa.js +4 -0
- package/dist/gateway/static/root/assets/{locale-store-Dy1EByeG.js → locale-store-tI9VX7dp.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-CMW34T31.js → logs-page-BcibwftP.js} +1 -1
- package/dist/gateway/static/root/assets/{management-api-B5w5DdXH.js → management-api-C9tFjLcE.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-DfcMIqbQ.js → management-settings-DbnAlXoB.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-CNJaAdNN.js → markdown-view-CSpQhSka.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-DCIEL5bA.js → mcp-conversation-setup-page-DedbjJbF.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DGhWjPIU.js → media-plugins-BYnP_orq.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-BAnhwALN.js → messages-e5MhDONm.js} +2 -2
- package/dist/gateway/static/root/assets/{model-selector-C-CqPBao.js → model-selector-B4oTiJI6.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-Bgh3Gfgl.js → models-hub-cache-DpEClnsE.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-DsXb1qjW.js → note-detail-panel-D8asMfBm.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-DcDw5kp4.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-BOIM9Q_D.js → notes-api-pVC1amyp.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-BTpiOw67.js → notes-page-CG1_6PLz.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-B560CHeD.js → oauth-api-BsVPwufr.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-D63M8Iv7.js → oauth-provider-connect-Bu20kmPq.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-B_Vdo2Ai.js → page-context-capture-button-CDsnNXjS.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-Cr5GqS2D.js → page-context-draft-D6tu8c_9.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-DeaRqZgV.js +1 -0
- package/dist/gateway/static/root/assets/panels-top-left-BKvp2Dag.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-BMRVyTrE.js → personal-avatar-BboNc6e2.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-I3IGVSJh.js → personal-page-gMRmLCWG.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-profile-settings-C4CxmQLQ.js → personal-profile-settings-Cd4QyseL.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-CnxI2TL0.js → personal-settings-panel-CtBY_Uk1.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-flTci8mm.js → phone-dependencies-card-BgH1LluB.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-Vi_Swyv6.js → phone-model-connection-DkdKU5Kv.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-BOv3mb_F.js → phone-model-picker-0g1z4RPL.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-vD0bTcHj.js → phone-settings-page-DlIUajBY.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-Ltrevdsx.js → phone-workspace-store-DW2sZtkh.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-F08k_k2u.js → plugin-details-dialog-9KUkZk_t.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-D1pZekPs.js → preference-select-fields-DH5QZhIc.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-CGso8wGv.js → product-automation-feedback-a1thJ0M9.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BO8lUvw3.js → product-open-page-DCzQh7tr.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-Dgtb4LF7.js → product-preview-content-C5TLcagj.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-C35EWUps.js → product-preview-modal-D9f-7kcI.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-Dy46uSEt.js → project-detail-page-C4Z2HTRZ.js} +2 -2
- package/dist/gateway/static/root/assets/{project-understanding-Cg8WbBNB.js → project-understanding-CoPBvlqf.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-C6Pt6OdT.js → projects-page-k1v8Fry8.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-Nytkkop9.js → providers-api-BSJZyO8n.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-CFX7CANT.js → recording-upload-CExCePtr.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-DuDIthjL.js → registry-api-CqcJj60w.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DePwafOK.js → remote-access-hub-BLFkNl1y.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-BRKhKJA0.js → resource-unavailable-B_BXTQa7.js} +1 -1
- package/dist/gateway/static/root/assets/{right-workspace-store-HPw7Gw0n.js → right-workspace-store-OceFhUjM.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-ClsAFFQc.js +2 -0
- package/dist/gateway/static/root/assets/{routine-panel-KH1VaEdC.js → routine-panel-BsE9o9uu.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-Dd8a07eo.js → runtime-tools-api-aAZChVm4.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CvHQoqHu.js → runtime-tools-settings-panel-Bn9HTrK5.js} +1 -1
- package/dist/gateway/static/root/assets/schema-form-BxBDgLrg.js +1 -0
- package/dist/gateway/static/root/assets/{service-recommendation-list-BmRtbJz2.js → service-recommendation-list-BNIVRGDf.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-BFiIYodK.js → session-api-DdW7Wix2.js} +1 -1
- package/dist/gateway/static/root/assets/session-channel-icon-DUJbB-Km.js +1 -0
- package/dist/gateway/static/root/assets/{session-identity-label-D5SAi0Uh.js → session-identity-label-DjhlQ6LU.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-XgtApqIh.js +25 -0
- package/dist/gateway/static/root/assets/sessions-page-CfhKeUkZ.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BBG8dTIY.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-B-H1gYOs.js → settings-advanced-section-BOoJfJuB.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-YH60sibB.js → settings-mode-store-BMh_BQ9a.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-C39lKVRv.js → settings-page-M6XwzIyu.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-DEZZ8D0S.js → settings-page-header-Bfu4cuQd.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-De2j64Lo.js → settings-page-layout-BnZa1qHH.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-Dh6BPwv0.js → setup-interaction-page-CVlrVNrm.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-DGAAczL-.js → setup-status-panel-FFyDODEx.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-C1t_HB6f.js → share-link-dialog-Cv-eDEw_.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Cqy-7-rd.js → share-preview-page-BctH6eFs.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-Dm07CnXw.js → shares-api-cLTEcQLE.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DcetAN8K.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-BV8oFqeE.js → skill-api-CgEZJoy9.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-1o_YRCu9.js → skill-list-api-BWVr2PL5.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-fGsO9Y86.js → skill-reload-api-BLhHNvaK.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DReUQ4Ug.js → skills-page-DIjcAvA0.js} +1 -1
- package/dist/gateway/static/root/assets/sliding-segmented-DagP0myu.js +1 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-CUI6QHEP.js → system-settings-panel-C7LAPaN_.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-D1dNWTnP.js → task-detail-page-DmNEMg-l.js} +1 -1
- package/dist/gateway/static/root/assets/{task-result-evidence-CW_tN93T.js → task-result-evidence-BsBn3n_l.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-Du53Upr2.js → terminal-panel-store-DJbLuUku.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BaWep_o7.js → theme-store-QGcjV6pN.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-CnciBMVH.js → tracing-settings-page-BKCiPwYL.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-Iz7JCBt3.js → tunnel-api-S7J5Lpzt.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-BFc8PamJ.js → understanding-activity-store-BNVhtJkn.js} +1 -1
- package/dist/gateway/static/root/assets/understanding-refresh-store-CM6bUcaJ.js +1 -0
- package/dist/gateway/static/root/assets/undo-2-6IMTwK4M.js +1 -0
- package/dist/gateway/static/root/assets/{unlink-BEuthaaq.js → unlink-NsCMuCT1.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DL2fmeOh.js → usage-page-D-AqzjIx.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-N_SjHXTw.js → use-autosave-CqZbhhCc.js} +1 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-BfLhIb2_.js +2 -0
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-D0IBFhM9.js → use-file-preview-expanded-DufxDues.js} +3 -3
- package/dist/gateway/static/root/assets/{use-personal-profile-C1vqD9yV.js → use-personal-profile-RnjxZnLa.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-B5IsKrRW.js → use-realtime-voice-w3aHR2dr.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-7X2ydgS8.js → use-workspace-tree-2Ck-ql5c.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-CBcGMhrR.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-B_GApUQP.js → voice-api-key-field-C4rhpgco.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DhJ3l8fk.js → voice-config-api-7AHN-ns6.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-CEeFBhp3.js → voice-input-shortcut-events-BbRrj833.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-57pwZeKD.js → voice-settings-wamtp0lg.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BJ15p4rH.js → work-discovery-overlay-fVofN7aP.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-8XciWNs5.js → work-discovery-page-DcQG5GWy.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-BGZduAXV.js → working-directory-picker-modal-D8Stwszr.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-Dd_UDfeo.js → workspace-api-D3iuTdNK.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-C-J7vr2o.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-Clj9hMj5.js → workspace-file-preview-dialog-BXbL5Y1h.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-CvZxU9de.js → workspace-open-location-menu-1gFO_BdL.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-preview-store-imhtuEIP.js → workspace-preview-store-adwmi4nx.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Q_jezTUy.js → xopc-cloud-account-card-DhGh4rm7.js} +1 -1
- package/dist/gateway/static/root/index.html +97 -93
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/session-input-command.js +5 -0
- package/dist/src/agent/inbound/inbound-loop.js +14 -0
- package/dist/src/agent/messaging/outbound-coordinator.js +1 -1
- package/dist/src/agent/prompt/response-language.js +9 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +3 -0
- package/dist/src/channels/connection-probe.d.ts +23 -0
- package/dist/src/channels/connection-probe.js +98 -0
- package/dist/src/channels/manager.d.ts +2 -0
- package/dist/src/channels/manager.js +5 -0
- package/dist/src/channels/message-journal.d.ts +25 -0
- package/dist/src/channels/message-journal.js +79 -0
- package/dist/src/channels/outbound-sender.d.ts +8 -0
- package/dist/src/channels/outbound-sender.js +60 -1
- package/dist/src/channels/plugins/types.adapters.d.ts +4 -0
- package/dist/src/channels/verified-inbound.js +20 -14
- package/dist/src/cli/commands/gateway/lifecycle.js +2 -2
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/config/schema.d.ts +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -1
- package/dist/src/gateway/hono/middleware/auth.js +1 -1
- package/dist/src/gateway/hono/routes/channels.js +23 -10
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/desktop-host.js +1 -1
- package/dist/src/gateway/hono/routes/imports.js +1 -1
- package/dist/src/gateway/hono/routes/personal-agent.js +3 -3
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/hono/routes/user-model.js +48 -20
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +2 -2
- package/dist/src/gateway/service/agent-runner.js +1 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +1 -1
- package/dist/src/gateway/service.js +8 -8
- package/dist/src/i18n/response-language.d.ts +1 -1
- package/dist/src/infra/bus/index.d.ts +1 -1
- package/dist/src/infra/bus/queue.d.ts +16 -3
- package/dist/src/infra/bus/queue.js +74 -3
- package/dist/src/infra/debounce.d.ts +1 -0
- package/dist/src/infra/debounce.js +40 -35
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/update-restart.js +2 -2
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/knowledge-memory/index.js +2 -2
- package/dist/src/knowledge-memory/repository.d.ts +9 -0
- package/dist/src/knowledge-memory/repository.js +12 -2
- package/dist/src/notifications/service.js +2 -2
- package/dist/src/phone/stream-gateway.js +1 -1
- package/dist/src/runtime-tools/types.d.ts +1 -1
- package/dist/src/storage/sqlite/session-creation-repository.js +6 -1
- package/dist/src/user-context/config.d.ts +1 -1
- package/package.json +4 -5
- package/dist/extensions/demo-memory/src/index.d.ts +0 -6
- package/dist/extensions/demo-memory/src/index.js +0 -146
- package/dist/extensions/demo-memory/xopc.extension.json +0 -15
- package/dist/gateway/static/root/assets/agents-DC0lHtl5.js +0 -77
- package/dist/gateway/static/root/assets/automations-workspace-JCQ1IXFk.js +0 -9
- package/dist/gateway/static/root/assets/capabilities-page-kPv2dOzf.js +0 -2
- package/dist/gateway/static/root/assets/channels-B--IHNs4.js +0 -1
- package/dist/gateway/static/root/assets/chat-agents-api-CjlzCSmC.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-BV51dk16.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-sx7B8kdC.js +0 -1
- package/dist/gateway/static/root/assets/home-page-DefKShSW.js +0 -8
- package/dist/gateway/static/root/assets/index-CChzK_5b.css +0 -1
- package/dist/gateway/static/root/assets/index-DUo6H0PC.js +0 -11
- package/dist/gateway/static/root/assets/local-session-drafts-BIBHRkpM.js +0 -4
- package/dist/gateway/static/root/assets/note-image-lightbox-D6mvMSKr.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-Bm8oxpFR.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-ChTaYgpA.js +0 -2
- package/dist/gateway/static/root/assets/schema-form-C9TYGa0_.js +0 -1
- package/dist/gateway/static/root/assets/session-channel-icon-BzkFo-Ci.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-63NaXb1s.js +0 -25
- package/dist/gateway/static/root/assets/sessions-page-DQEq_VJS.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cvx7DnU8.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BDr50uTV.js +0 -1
- package/dist/gateway/static/root/assets/sliding-segmented-CgQ3BFdb.js +0 -1
- package/dist/gateway/static/root/assets/understanding-refresh-store-CdEfR40A.js +0 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-Xn6eUus2.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-D2FHjLi7.js +0 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-DVPJcbuE.js +0 -1
|
@@ -20,6 +20,7 @@ import { createConnectorSetupSecretRequest, submitConnectorSetupSecret } from ".
|
|
|
20
20
|
import { recordConnectorHealthUsage } from "../../../connectors/usage.js";
|
|
21
21
|
import { getConnectorInstance, getInstalledConnectorDefinition, listConnectorInstances } from "../../../connectors/instances.js";
|
|
22
22
|
import { installConnector, installConnectorDefinition, uninstallConnector, updateConnectorConfig } from "../../../connectors/install.js";
|
|
23
|
+
import { ConfigPersistenceError, persistConfigMutation } from "../../../config/config-mutation.js";
|
|
23
24
|
import { resumeApprovedConnectorAction } from "../../../connectors/approval-resume.js";
|
|
24
25
|
import { startConnectorAuthorization } from "../../../connectors/auth-provider-registry.js";
|
|
25
26
|
import { composioLogoResponse } from "../../../connectors/composio-logo.js";
|
|
@@ -27,7 +28,6 @@ import { inspectManagedComposioStatus } from "../../../connectors/composio-manag
|
|
|
27
28
|
import { appendComposioTriggerEvent, listComposioTriggerEvents } from "../../../connectors/composio-triggers.js";
|
|
28
29
|
import { listUnderstandingSourceGrants, revokeUnderstandingSourceGrant } from "../../../user-context/sources/repository.js";
|
|
29
30
|
import { ingestLocalFolderSource } from "../../../connectors/connected-source-ingestion.js";
|
|
30
|
-
import { ConfigPersistenceError, persistConfigMutation } from "../../../config/config-mutation.js";
|
|
31
31
|
import { testConnectorInstance } from "../../../connectors/health.js";
|
|
32
32
|
import { setConnectorEnabled } from "../../../connectors/lifecycle.js";
|
|
33
33
|
import { projectComposioConnectionStatus } from "../../../connectors/runtime-status.js";
|
|
@@ -8,8 +8,8 @@ import { init_src as init_src$1 } from "../../../../packages/endpoint-tools-prot
|
|
|
8
8
|
import { getDesktopExecutionGrant, revokeDesktopExecutionGrant, setDesktopExecutionGrant } from "../../../storage/sqlite/desktop-execution-repository.js";
|
|
9
9
|
import { getDesktopOperationForReview, listDesktopOperationsForReview, reviewDesktopOperation } from "../../../storage/sqlite/desktop-operation-repository.js";
|
|
10
10
|
import { signDesktopAuthorityResponse } from "../../../endpoint-tools/desktop-authority-response.js";
|
|
11
|
-
import { PROOF_HEADER, parseRequestProof } from "../../security/device-request-proof.js";
|
|
12
11
|
import { resolveSecureDeviceRoutes } from "../../device-routes.js";
|
|
12
|
+
import { PROOF_HEADER, parseRequestProof } from "../../security/device-request-proof.js";
|
|
13
13
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
//#region src/gateway/hono/routes/desktop-host.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
1
2
|
import { ImportError } from "../../../imports/types.js";
|
|
2
3
|
import { isImportSource } from "../../../imports/sources.js";
|
|
3
4
|
import { ImportSelectionRepository } from "../../../storage/sqlite/import-selection-repository.js";
|
|
4
5
|
import { getLiveInventory, previewInventoryItem, publicInventory, scanProduct } from "../../../imports/inventory.js";
|
|
5
6
|
import { importSelection, listImportSources } from "../../../imports/productImport.js";
|
|
6
7
|
import { createRuntimeImportService } from "../../../imports/runtime.js";
|
|
7
|
-
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
//#region src/gateway/hono/routes/imports.ts
|
|
10
10
|
const selectionSchema = z.object({
|
|
@@ -4,12 +4,12 @@ import { init_voice, voiceCallPreferencesPatchSchema } from "../../../../package
|
|
|
4
4
|
import { getPersonalAgent } from "../../../personal-agent/repository.js";
|
|
5
5
|
import { TaskOriginRepository } from "../../../tasks/task-origin-repository.js";
|
|
6
6
|
import { cancelPersonalRequest, personalRequestSnapshot, publishPersonalRequest } from "../../../personal-agent/request-service.js";
|
|
7
|
-
import { PersonalOnboardingDraftSchema, PersonalOnboardingStepSchema, finishPersonalWelcome, getPersonalOnboarding, savePersonalOnboarding } from "../../../personal-agent/onboarding.js";
|
|
8
|
-
import { PersonalAppearanceSchema, createOrResumePersonalAgent, ensurePersonalConversationVisibility, listPersonalModels, patchPersonalProfile, refreshPersonalDelegationGuidance } from "../../../personal-agent/service.js";
|
|
9
|
-
import { markPersonalRead, personalUnreadSnapshot } from "../../../personal-agent/unread.js";
|
|
10
7
|
import { writeAgentAvatarFromBase64 } from "../../agents-admin.js";
|
|
11
8
|
import { legacyNaturalModel } from "../../../voice/realtime/omniRoute.js";
|
|
12
9
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
10
|
+
import { PersonalOnboardingDraftSchema, PersonalOnboardingStepSchema, finishPersonalWelcome, getPersonalOnboarding, savePersonalOnboarding } from "../../../personal-agent/onboarding.js";
|
|
11
|
+
import { PersonalAppearanceSchema, createOrResumePersonalAgent, ensurePersonalConversationVisibility, listPersonalModels, patchPersonalProfile, refreshPersonalDelegationGuidance } from "../../../personal-agent/service.js";
|
|
12
|
+
import { markPersonalRead, personalUnreadSnapshot } from "../../../personal-agent/unread.js";
|
|
13
13
|
import { registerProactivityRoutes } from "../../../personal-agent/proactivity/routes.js";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
//#region src/gateway/hono/routes/personal-agent.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, init_package_version } from "../../../package-version.js";
|
|
2
2
|
import { loadConfig } from "../../../config/loader.js";
|
|
3
3
|
import "../../../config/index.js";
|
|
4
|
-
import { normalizeUpdateChannel } from "../../../infra/update-channels.js";
|
|
5
4
|
import { acquireUpdateLock } from "../../../infra/update-lock.js";
|
|
6
|
-
import {
|
|
5
|
+
import { normalizeUpdateChannel } from "../../../infra/update-channels.js";
|
|
7
6
|
import { getUpdateAvailable, runGatewayUpdateCheck } from "../../../infra/update-startup.js";
|
|
8
7
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
8
|
+
import { formatUpdateApiResult, runGatewayUpdateWithPostSteps } from "../../../infra/update-runner.js";
|
|
9
9
|
import { streamSSE } from "hono/streaming";
|
|
10
10
|
//#region src/gateway/hono/routes/update.ts
|
|
11
11
|
init_package_version();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_transaction, runSqliteWriteTransaction } from "../../../storage/sqlite/transaction.js";
|
|
2
2
|
import { createCollaborationRule, getCollaborationRule, listCollaborationRules, setCollaborationRuleStatus } from "../../../storage/sqlite/collaboration-rule-repository.js";
|
|
3
3
|
import { getActiveUnderstandingConsent } from "../../../user-context/sources/consent-repository.js";
|
|
4
|
-
import { KnowledgeReviewConflictError, deleteKnowledgeItem, getKnowledgeItem, listKnowledgeItems, reviewKnowledgeItem, searchKnowledgeItems, setKnowledgeScope } from "../../../knowledge-memory/repository.js";
|
|
4
|
+
import { KnowledgeReviewConflictError, deleteKnowledgeItem, getKnowledgeItem, listKnowledgeItems, listManagedWorkMemory, reviewKnowledgeItem, searchKnowledgeItems, setKnowledgeScope } from "../../../knowledge-memory/repository.js";
|
|
5
5
|
import "../../../knowledge-memory/index.js";
|
|
6
6
|
import { listUserAssertionEdges, listUserModelObservations } from "../../../user-model/observation-repository.js";
|
|
7
7
|
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus, updatePriorityWindow, updateUserGoal } from "../../../user-model/goals.js";
|
|
@@ -201,14 +201,14 @@ function matchesMobileSearch(item, query) {
|
|
|
201
201
|
])
|
|
202
202
|
].join(" ")).includes(query);
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
return Buffer.from(JSON.stringify([
|
|
204
|
+
function encodeTimeCursor(timestamp, id) {
|
|
205
|
+
return Buffer.from(JSON.stringify([timestamp, id])).toString("base64url");
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function decodeTimeCursor(value) {
|
|
208
208
|
if (!value) return void 0;
|
|
209
209
|
try {
|
|
210
210
|
const parsed = JSON.parse(Buffer.from(value, "base64url").toString("utf8"));
|
|
211
|
-
return Array.isArray(parsed) && typeof parsed[0] === "number" && typeof parsed[1] === "string" ? [parsed[0], parsed[1]] : void 0;
|
|
211
|
+
return Array.isArray(parsed) && typeof parsed[0] === "number" && Number.isSafeInteger(parsed[0]) && typeof parsed[1] === "string" ? [parsed[0], parsed[1]] : void 0;
|
|
212
212
|
} catch {
|
|
213
213
|
return;
|
|
214
214
|
}
|
|
@@ -225,7 +225,7 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
225
225
|
sensitiveWritePolicy: userContext.userModel.sensitiveWritePolicy
|
|
226
226
|
};
|
|
227
227
|
};
|
|
228
|
-
const snapshot = () => {
|
|
228
|
+
const snapshot = (aboutOnly = false) => {
|
|
229
229
|
const rawAssertions = listUserAssertions({
|
|
230
230
|
statuses: [
|
|
231
231
|
"active",
|
|
@@ -240,10 +240,6 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
240
240
|
const assertions = rawAssertions.map((item) => assertionView(item, assertionSources.get(item.id) ?? []));
|
|
241
241
|
const goals = listUserGoals();
|
|
242
242
|
const priorities = listPriorityWindows();
|
|
243
|
-
const knowledge = listKnowledgeItems({
|
|
244
|
-
recordClass: "memory",
|
|
245
|
-
limit: 1e3
|
|
246
|
-
});
|
|
247
243
|
const profile = getUserProfileSnapshot();
|
|
248
244
|
const sources = listUnderstandingSourceGrants().map((source) => ({
|
|
249
245
|
id: source.id,
|
|
@@ -254,23 +250,31 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
254
250
|
...source.lastCollectedAt ? { lastCollectedAt: source.lastCollectedAt } : {},
|
|
255
251
|
consent: getActiveUnderstandingConsent(source.id)
|
|
256
252
|
}));
|
|
257
|
-
|
|
253
|
+
const about = {
|
|
258
254
|
assertions,
|
|
259
|
-
assertionEdges: listUserAssertionEdges(assertions.map((item) => item.id)),
|
|
260
|
-
observations: listUserModelObservations({ limit: 500 }),
|
|
261
255
|
goals,
|
|
262
256
|
priorities,
|
|
263
257
|
rules: listCollaborationRules(),
|
|
264
258
|
ruleSuggestions: listActionRuleSuggestions(),
|
|
259
|
+
profile,
|
|
260
|
+
sources,
|
|
261
|
+
suggestedCallName: profile.callName || machineCallName(),
|
|
262
|
+
settings: memorySettings()
|
|
263
|
+
};
|
|
264
|
+
if (aboutOnly) return about;
|
|
265
|
+
const knowledge = listKnowledgeItems({
|
|
266
|
+
recordClass: "memory",
|
|
267
|
+
limit: 1e3
|
|
268
|
+
});
|
|
269
|
+
return {
|
|
270
|
+
...about,
|
|
271
|
+
assertionEdges: listUserAssertionEdges(assertions.map((item) => item.id)),
|
|
272
|
+
observations: listUserModelObservations({ limit: 500 }),
|
|
265
273
|
knowledge: knowledge.map((item) => ({
|
|
266
274
|
...item,
|
|
267
275
|
version: memoryVersion(item)
|
|
268
276
|
})),
|
|
269
277
|
maintenance: { lastRun: listMemoryMaintenanceRuns(1)[0] ?? null },
|
|
270
|
-
profile,
|
|
271
|
-
sources,
|
|
272
|
-
suggestedCallName: profile.callName || machineCallName(),
|
|
273
|
-
settings: memorySettings(),
|
|
274
278
|
counts: {
|
|
275
279
|
activeAssertions: assertions.filter((item) => item.status === "active").length,
|
|
276
280
|
reviewAssertions: assertions.filter((item) => item.status === "needs_review" || item.status === "conflicted").length,
|
|
@@ -280,7 +284,7 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
280
284
|
}
|
|
281
285
|
};
|
|
282
286
|
};
|
|
283
|
-
authenticated.get("/api/user-model", (c) => c.json(snapshot()));
|
|
287
|
+
authenticated.get("/api/user-model", (c) => c.json(snapshot(c.req.query("view") === "about")));
|
|
284
288
|
authenticated.patch("/api/user-model/settings", write, async (c) => {
|
|
285
289
|
const input = await body(c);
|
|
286
290
|
const memoryEnabled = input?.memoryEnabled;
|
|
@@ -433,7 +437,7 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
433
437
|
const limit = Number.isFinite(requestedLimit) ? Math.max(1, Math.min(50, Math.trunc(requestedLimit))) : 20;
|
|
434
438
|
const query = normalizeMobileSearch(c.req.query("q"), 100);
|
|
435
439
|
const cursorValue = c.req.query("cursor");
|
|
436
|
-
const cursor =
|
|
440
|
+
const cursor = decodeTimeCursor(cursorValue);
|
|
437
441
|
if (cursorValue && !cursor) return c.json({ error: "Invalid cursor" }, 400);
|
|
438
442
|
const assertions = listUserAssertions({
|
|
439
443
|
statuses: [
|
|
@@ -450,7 +454,7 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
450
454
|
const items = filtered.slice(0, limit);
|
|
451
455
|
const result = {
|
|
452
456
|
items,
|
|
453
|
-
...filtered.length > limit && items.length ? { nextCursor:
|
|
457
|
+
...filtered.length > limit && items.length ? { nextCursor: encodeTimeCursor(items[items.length - 1].recordedAt, items[items.length - 1].id) } : {}
|
|
454
458
|
};
|
|
455
459
|
return c.json(result);
|
|
456
460
|
}
|
|
@@ -736,6 +740,30 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
736
740
|
});
|
|
737
741
|
authenticated.get("/api/knowledge-memory", (c) => {
|
|
738
742
|
const query = c.req.query("q")?.trim();
|
|
743
|
+
if (c.req.query("view") === "manage") {
|
|
744
|
+
const cursor = c.req.query("cursor");
|
|
745
|
+
const before = cursor ? decodeTimeCursor(cursor) : void 0;
|
|
746
|
+
if (cursor && !before) return c.json({ error: "Invalid memory cursor" }, 400);
|
|
747
|
+
const limit = 24;
|
|
748
|
+
const records = listManagedWorkMemory({
|
|
749
|
+
query: query ?? "",
|
|
750
|
+
kind: c.req.query("kind"),
|
|
751
|
+
before: before && {
|
|
752
|
+
updatedAt: before[0],
|
|
753
|
+
id: before[1]
|
|
754
|
+
},
|
|
755
|
+
limit: limit + 1
|
|
756
|
+
});
|
|
757
|
+
const items = records.slice(0, limit);
|
|
758
|
+
const last = items.at(-1);
|
|
759
|
+
return c.json({
|
|
760
|
+
items: items.map((item) => ({
|
|
761
|
+
...item,
|
|
762
|
+
version: memoryVersion(item)
|
|
763
|
+
})),
|
|
764
|
+
...last && records.length > limit ? { nextCursor: encodeTimeCursor(last.updatedAt, last.id) } : {}
|
|
765
|
+
});
|
|
766
|
+
}
|
|
739
767
|
if (!query) return c.json({ items: listKnowledgeItems({
|
|
740
768
|
recordClass: "memory",
|
|
741
769
|
limit: 500
|
|
@@ -3,7 +3,6 @@ import { buildDefaultCorsOrigins, isAllInterfacesHost, isLoopbackHost, resolveEf
|
|
|
3
3
|
import { isGatewayStrictSecurityEnabled } from "./rate-limit/env-flags.js";
|
|
4
4
|
import "./rate-limit/index.js";
|
|
5
5
|
import { defaultGatewayBindMode, isContainerEnvironment, resolveGatewayBindHost, resolveGatewayBindHostSync, resolveGatewayBindMode, resolveGatewayEffectiveHost } from "../config/gateway-bind.js";
|
|
6
|
-
import { checkPortAvailable, forceFreePortAndWait, listPortListeners, parseLsofOutput } from "./ports.js";
|
|
7
6
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
8
7
|
import { resolveGatewayListenHost, resolveGatewayListenPlan } from "./listen.js";
|
|
9
8
|
import { assertGatewayRuntimeConfig } from "./runtime-config.js";
|
|
@@ -13,6 +12,7 @@ import { createHonoApp } from "./hono/app.js";
|
|
|
13
12
|
import { GatewayServer } from "./server.js";
|
|
14
13
|
import { GatewayLockError, acquireGatewayLock } from "./lock.js";
|
|
15
14
|
import { runGatewayLoop } from "./run-loop.js";
|
|
15
|
+
import { checkPortAvailable, forceFreePortAndWait, listPortListeners, parseLsofOutput } from "./ports.js";
|
|
16
16
|
import { apiError, apiOk } from "./protocol.js";
|
|
17
17
|
import "./hono/index.js";
|
|
18
18
|
import { assertSecureGatewayHttpUrl, assertSecureWebSocketUrl, isInsecurePrivateWsAllowed, isSecureWebSocketUrl } from "./ws-security.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { loadConfig } from "../config/loader.js";
|
|
2
2
|
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
3
|
-
import { consumeGatewayRestartIntentSync, consumeGatewaySigusr1RestartAuthorization, isGatewaySigusr1RestartExternallyAllowed, resetGatewayRestartStateForInProcessRestart, scheduleGatewaySigusr1Restart, setGatewaySigusr1RestartPolicy } from "../infra/restart.js";
|
|
4
|
-
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
5
3
|
import { restartGatewayProcessWithFreshPid } from "./respawn.js";
|
|
6
4
|
import { acquireGatewayLock } from "./lock.js";
|
|
5
|
+
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
6
|
+
import { consumeGatewayRestartIntentSync, consumeGatewaySigusr1RestartAuthorization, isGatewaySigusr1RestartExternallyAllowed, resetGatewayRestartStateForInProcessRestart, scheduleGatewaySigusr1Restart, setGatewaySigusr1RestartPolicy } from "../infra/restart.js";
|
|
7
7
|
//#region src/gateway/run-loop.ts
|
|
8
8
|
/**
|
|
9
9
|
* Gateway Run Loop - Core run loop for gateway process management
|
|
@@ -15,8 +15,8 @@ import { TaskConversationRepository } from "../../tasks/task-conversation-reposi
|
|
|
15
15
|
import { TaskCollaborationRepository } from "../../tasks/task-collaboration-repository.js";
|
|
16
16
|
import { reserveEmbeddedRunCancellation } from "../../agent/embedded/runs.js";
|
|
17
17
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
18
|
-
import { completePhoneAssistanceFromUser, preparePhoneContinuation } from "../../phone/assistance-service.js";
|
|
19
18
|
import { EphemeralClarificationWaiter } from "../ephemeral-clarification-waiter.js";
|
|
19
|
+
import { completePhoneAssistanceFromUser, preparePhoneContinuation } from "../../phone/assistance-service.js";
|
|
20
20
|
import { describeActiveExecution } from "./active-execution.js";
|
|
21
21
|
import { runGatewayAgent } from "./run-gateway-agent.js";
|
|
22
22
|
import { NextTurnSuggestionService } from "../next-turn-suggestions/service.js";
|
|
@@ -20,8 +20,8 @@ import { recordPersonalPerformance } from "../../personal-agent/performance.js";
|
|
|
20
20
|
import { formatAgentRunErrorForClient } from "../../agent/client-error-format.js";
|
|
21
21
|
import "../chat-limits.js";
|
|
22
22
|
import { prependEnvelopeTimestamp } from "../../channels/envelope-timestamp.js";
|
|
23
|
-
import { markdownNotificationPreview } from "../../notifications/plain-text.js";
|
|
24
23
|
import { ChatStreamMapper } from "../chat-stream/mapper.js";
|
|
24
|
+
import { markdownNotificationPreview } from "../../notifications/plain-text.js";
|
|
25
25
|
import { resolveWebchatConversationId } from "../resolve-webchat-session-key.js";
|
|
26
26
|
import { recordExplicitRelationshipFollowUp } from "../../user-context/relationship-continuity.js";
|
|
27
27
|
import { coalesceThinkingDeltas } from "../chat-stream/thinking-delta-coalescer.js";
|
|
@@ -111,13 +111,6 @@ import { HomeCapabilityPreflightService } from "../home-intelligence/capability-
|
|
|
111
111
|
import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
|
|
112
112
|
import { HomeIntelligenceHost } from "../home-intelligence/host.js";
|
|
113
113
|
import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
|
|
114
|
-
import { createBackgroundTask } from "../infra/background-task.js";
|
|
115
|
-
import { scheduleGatewayUpdateCheck } from "../infra/update-startup.js";
|
|
116
|
-
import "../local-apps/index.js";
|
|
117
|
-
import "../notes/index.js";
|
|
118
|
-
import { NotificationService } from "../notifications/service.js";
|
|
119
|
-
import { allowsPersonalTaskNotification, personalReplyNotification, personalRunDelegated } from "../personal-agent/notifications.js";
|
|
120
|
-
import { PhoneStreamGateway } from "../phone/stream-gateway.js";
|
|
121
114
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
122
115
|
import { prepareAutomationAgentSession } from "./automation-agent-session.js";
|
|
123
116
|
import { deliverAutomationCompletion } from "./automation-completion-delivery.js";
|
|
@@ -128,8 +121,10 @@ import { createPhoneSetupService } from "./hono/routes/phone-setup.js";
|
|
|
128
121
|
import { BrowserSetupService } from "../browser/setup/service.js";
|
|
129
122
|
import { McpConversationSetup } from "../agent/mcp/conversation-setup.js";
|
|
130
123
|
import { withGatewayConfigWriteLock } from "./hono/lib/config-write-lock.js";
|
|
124
|
+
import { PhoneStreamGateway } from "../phone/stream-gateway.js";
|
|
131
125
|
import { PersonalProactivityService } from "../personal-agent/proactivity/service.js";
|
|
132
126
|
import { reconcilePersonalProactivityAutomation } from "../personal-agent/proactivity/automation.js";
|
|
127
|
+
import { createBackgroundTask } from "../infra/background-task.js";
|
|
133
128
|
import { buildFileAgentContext } from "../agent/source-context/file-context.js";
|
|
134
129
|
import { buildSessionAgentContext } from "../agent/source-context/session-context.js";
|
|
135
130
|
import { buildBrowserTabAgentContext } from "../agent/source-context/browser-tab.js";
|
|
@@ -138,6 +133,7 @@ import { buildVoiceMemoryContext } from "../voice/realtime/memory-context.js";
|
|
|
138
133
|
import { buildVoicePersonaContext } from "../voice/realtime/persona-context.js";
|
|
139
134
|
import { buildVoiceUserContext } from "../voice/realtime/user-context.js";
|
|
140
135
|
import { buildVoiceHistory, voiceMemoryBudget, voicePersonaBudget } from "../voice/realtime/conversation-context.js";
|
|
136
|
+
import "../notes/index.js";
|
|
141
137
|
import { EphemeralSideChatManager } from "./side-chat/manager.js";
|
|
142
138
|
import { SideChatRunService } from "./side-chat/run-service.js";
|
|
143
139
|
import { SideChatPromotionService } from "./side-chat/promotion-service.js";
|
|
@@ -150,8 +146,11 @@ import { assertGatewayRuntimeConfig } from "./runtime-config.js";
|
|
|
150
146
|
import { auditGatewayConfig } from "./security/audit.js";
|
|
151
147
|
import { getXopcCloudCatalogCoordinator } from "../providers/xopc-cloud-catalog-coordinator.js";
|
|
152
148
|
import { ModelCatalogSyncService } from "../providers/model-catalog-sync-service.js";
|
|
149
|
+
import { NotificationService } from "../notifications/service.js";
|
|
150
|
+
import "../local-apps/index.js";
|
|
153
151
|
import { TaskAllocationDispatcher } from "../tasks/task-allocation-service.js";
|
|
154
152
|
import { TaskResultDeliveryService } from "../tasks/task-result-delivery-service.js";
|
|
153
|
+
import { scheduleGatewayUpdateCheck } from "../infra/update-startup.js";
|
|
155
154
|
import { resolveChannelConnectDeferSet } from "./resolve-channel-connect-defer.js";
|
|
156
155
|
import { restartGatewayProcessWithFreshPid } from "./respawn.js";
|
|
157
156
|
import { GatewaySessionsApi } from "./service/sessions-api.js";
|
|
@@ -170,6 +169,7 @@ import { TaskCollaborationDelivery } from "../tasks/task-collaboration-delivery.
|
|
|
170
169
|
import { enqueueTaskDelayNotices } from "../tasks/task-delay-notice.js";
|
|
171
170
|
import { TaskMainUpdateExhaustedError } from "../tasks/task-main-update-retry.js";
|
|
172
171
|
import { TaskMainUpdateDelivery } from "../tasks/task-main-update-delivery.js";
|
|
172
|
+
import { allowsPersonalTaskNotification, personalReplyNotification, personalRunDelegated } from "../personal-agent/notifications.js";
|
|
173
173
|
import { TaskMainUpdateDecisionService } from "../tasks/task-main-update-decision-service.js";
|
|
174
174
|
import { selectTaskMainUpdateAttempt, submitAndConfirmTaskMainUpdate } from "../tasks/task-main-update-input.js";
|
|
175
175
|
import { checkAppContextAccess, prepareAppContext } from "./service/app-context-access.js";
|
|
@@ -1803,7 +1803,7 @@ var GatewayService = class {
|
|
|
1803
1803
|
log.debug("Starting outbound message processor");
|
|
1804
1804
|
while (this.running) try {
|
|
1805
1805
|
const msg = await this.bus.consumeOutbound();
|
|
1806
|
-
await this.channelManager.
|
|
1806
|
+
await this.channelManager.sendQueuedOutboundMessage(msg);
|
|
1807
1807
|
} catch (error) {
|
|
1808
1808
|
if (error instanceof MessageBusShutdownError) break;
|
|
1809
1809
|
const em = error instanceof Error ? error.message : String(error);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const ResponseLanguageSchema: z.ZodEnum<{
|
|
3
3
|
en: "en";
|
|
4
|
-
auto: "auto";
|
|
5
4
|
"zh-CN": "zh-CN";
|
|
5
|
+
auto: "auto";
|
|
6
6
|
}>;
|
|
7
7
|
export type ResponseLanguage = z.infer<typeof ResponseLanguageSchema>;
|
|
8
8
|
export declare function resolveResponseLanguage(userPreference: ResponseLanguage, sessionPreference?: ResponseLanguage): ResponseLanguage;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { bus, MessageBus, MessageBusShutdownError } from './queue.js';
|
|
2
|
-
export type { MessageBusEvents } from './queue.js';
|
|
2
|
+
export type { InboundDelivery, MessageBusEvents } from './queue.js';
|
|
3
3
|
export type { InboundMessage, OutboundMessage } from '../../channels/transport-types.js';
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import { InboundMessage, OutboundMessage } from '../../channels/transport-types.js';
|
|
2
|
+
import type { InboundMessage, OutboundMessage } from '../../channels/transport-types.js';
|
|
3
|
+
export type InboundDelivery = {
|
|
4
|
+
scope: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
3
7
|
interface MessageBusEvents {
|
|
4
8
|
inbound: (msg: InboundMessage) => void;
|
|
5
9
|
outbound: (msg: OutboundMessage) => void;
|
|
@@ -16,8 +20,17 @@ declare class MessageBus extends EventEmitter {
|
|
|
16
20
|
private inboundConsumers;
|
|
17
21
|
private outboundConsumers;
|
|
18
22
|
private isShutdown;
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
private readonly durableInboundJournals;
|
|
24
|
+
private readonly inboundReceipts;
|
|
25
|
+
private persistOutboundReply?;
|
|
26
|
+
publishInbound(msg: InboundMessage, delivery?: InboundDelivery, verify?: (msg: InboundMessage) => void): Promise<void>;
|
|
27
|
+
restoreDurableInbound(channel: string, scope: string, verify?: (msg: InboundMessage, acceptedAt: number) => void): void;
|
|
28
|
+
beginInboundProcessing(msg: InboundMessage): boolean;
|
|
29
|
+
finishInboundProcessing(msg: InboundMessage, completed: boolean): void;
|
|
30
|
+
private durableInboundJournal;
|
|
31
|
+
private enqueueInbound;
|
|
32
|
+
setOutboundReplyPersistence(persist: (msg: OutboundMessage, delivery: InboundDelivery) => boolean): void;
|
|
33
|
+
publishOutbound(msg: OutboundMessage, replyingTo?: InboundMessage): Promise<void>;
|
|
21
34
|
consumeInbound(): Promise<InboundMessage>;
|
|
22
35
|
consumeOutbound(): Promise<OutboundMessage>;
|
|
23
36
|
/**
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { createLogger } from "../../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { persistInboundAttachments } from "../../channels/attachments/inbound-persist.js";
|
|
4
|
+
import { ChannelMessageJournal } from "../../channels/message-journal.js";
|
|
1
5
|
import { EventEmitter } from "events";
|
|
2
6
|
//#region src/infra/bus/queue.ts
|
|
7
|
+
init_logger();
|
|
8
|
+
const log = createLogger("ChannelInbox");
|
|
3
9
|
/**
|
|
4
10
|
* Error thrown when MessageBus is shut down
|
|
5
11
|
*/
|
|
@@ -15,13 +21,77 @@ var MessageBus = class extends EventEmitter {
|
|
|
15
21
|
inboundConsumers = [];
|
|
16
22
|
outboundConsumers = [];
|
|
17
23
|
isShutdown = false;
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
durableInboundJournals = /* @__PURE__ */ new Map();
|
|
25
|
+
inboundReceipts = /* @__PURE__ */ new WeakMap();
|
|
26
|
+
persistOutboundReply;
|
|
27
|
+
async publishInbound(msg, delivery, verify) {
|
|
28
|
+
if (!delivery) {
|
|
29
|
+
if (!this.isShutdown) this.enqueueInbound(msg);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const journal = this.durableInboundJournal(msg.channel, delivery.scope);
|
|
33
|
+
const attachments = await persistInboundAttachments(msg.attachments);
|
|
34
|
+
const payload = attachments ? {
|
|
35
|
+
...msg,
|
|
36
|
+
attachments
|
|
37
|
+
} : msg;
|
|
38
|
+
if (!journal.accept([{
|
|
39
|
+
id: delivery.id,
|
|
40
|
+
payload
|
|
41
|
+
}]).length) return;
|
|
42
|
+
verify?.(payload);
|
|
43
|
+
this.inboundReceipts.set(payload, {
|
|
44
|
+
journal,
|
|
45
|
+
...delivery
|
|
46
|
+
});
|
|
47
|
+
if (!this.isShutdown) this.enqueueInbound(payload);
|
|
48
|
+
}
|
|
49
|
+
restoreDurableInbound(channel, scope, verify) {
|
|
50
|
+
const key = JSON.stringify([channel, scope]);
|
|
51
|
+
if (this.durableInboundJournals.has(key)) return;
|
|
52
|
+
const journal = this.durableInboundJournal(channel, scope);
|
|
53
|
+
const interrupted = journal.recoverInterrupted();
|
|
54
|
+
if (interrupted) log.warn({
|
|
55
|
+
channel,
|
|
56
|
+
interrupted
|
|
57
|
+
}, "Channel inputs interrupted during execution");
|
|
58
|
+
for (const { id, payload, enqueuedAt } of journal.pending(500)) {
|
|
59
|
+
verify?.(payload, enqueuedAt);
|
|
60
|
+
this.inboundReceipts.set(payload, {
|
|
61
|
+
journal,
|
|
62
|
+
id,
|
|
63
|
+
scope
|
|
64
|
+
});
|
|
65
|
+
if (!this.isShutdown) this.enqueueInbound(payload);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
beginInboundProcessing(msg) {
|
|
69
|
+
const receipt = this.inboundReceipts.get(msg);
|
|
70
|
+
return !receipt || receipt.journal.begin(receipt.id);
|
|
71
|
+
}
|
|
72
|
+
finishInboundProcessing(msg, completed) {
|
|
73
|
+
const receipt = this.inboundReceipts.get(msg);
|
|
74
|
+
receipt?.journal.finish(receipt.id, completed ? "completed" : "interrupted");
|
|
75
|
+
}
|
|
76
|
+
durableInboundJournal(channel, scope) {
|
|
77
|
+
const key = JSON.stringify([channel, scope]);
|
|
78
|
+
const existing = this.durableInboundJournals.get(key);
|
|
79
|
+
if (existing) return existing;
|
|
80
|
+
const journal = new ChannelMessageJournal(`${channel}:agent`, scope);
|
|
81
|
+
this.durableInboundJournals.set(key, journal);
|
|
82
|
+
return journal;
|
|
83
|
+
}
|
|
84
|
+
enqueueInbound(msg) {
|
|
20
85
|
this.emit("inbound", msg);
|
|
21
86
|
if (this.inboundConsumers.length > 0) this.inboundConsumers.shift()(msg);
|
|
22
87
|
else this.inboundQueue.push(msg);
|
|
23
88
|
}
|
|
24
|
-
|
|
89
|
+
setOutboundReplyPersistence(persist) {
|
|
90
|
+
this.persistOutboundReply = persist;
|
|
91
|
+
}
|
|
92
|
+
async publishOutbound(msg, replyingTo) {
|
|
93
|
+
const receipt = replyingTo && this.inboundReceipts.get(replyingTo);
|
|
94
|
+
if (receipt && this.persistOutboundReply && !this.persistOutboundReply(msg, receipt)) return;
|
|
25
95
|
if (this.isShutdown) return;
|
|
26
96
|
this.emit("outbound", msg);
|
|
27
97
|
if (this.outboundConsumers.length > 0) this.outboundConsumers.shift()(msg);
|
|
@@ -71,6 +141,7 @@ var MessageBus = class extends EventEmitter {
|
|
|
71
141
|
*/
|
|
72
142
|
reset() {
|
|
73
143
|
this.isShutdown = false;
|
|
144
|
+
this.durableInboundJournals.clear();
|
|
74
145
|
this.clear();
|
|
75
146
|
}
|
|
76
147
|
clear() {
|
|
@@ -11,6 +11,7 @@ export interface InboundDebounceOptions<T> {
|
|
|
11
11
|
}
|
|
12
12
|
export declare function createInboundDebouncer<T>(options: InboundDebounceOptions<T>): {
|
|
13
13
|
enqueue: (item: T) => Promise<void>;
|
|
14
|
+
enqueueAndWait: (item: T) => Promise<void>;
|
|
14
15
|
flushKey: (key: string) => Promise<void>;
|
|
15
16
|
flushAll: () => Promise<void>;
|
|
16
17
|
getBufferCount: () => number;
|
|
@@ -14,11 +14,7 @@ function createInboundDebouncer(options) {
|
|
|
14
14
|
buffer.timeout = null;
|
|
15
15
|
}
|
|
16
16
|
if (buffer.items.length === 0) return;
|
|
17
|
-
|
|
18
|
-
await onFlush(buffer.items);
|
|
19
|
-
} catch (err) {
|
|
20
|
-
onError?.(err, buffer.items);
|
|
21
|
-
}
|
|
17
|
+
await process(buffer.items);
|
|
22
18
|
}
|
|
23
19
|
async function flushKey(key) {
|
|
24
20
|
const buffer = buffers.get(key);
|
|
@@ -32,40 +28,48 @@ function createInboundDebouncer(options) {
|
|
|
32
28
|
}, buffer.debounceMs);
|
|
33
29
|
buffer.timeout.unref?.();
|
|
34
30
|
}
|
|
35
|
-
async function
|
|
31
|
+
async function process(entries) {
|
|
32
|
+
const items = entries.map((entry) => entry.item);
|
|
33
|
+
try {
|
|
34
|
+
await onFlush(items);
|
|
35
|
+
for (const entry of entries) entry.resolve?.();
|
|
36
|
+
} catch (err) {
|
|
37
|
+
for (const entry of entries) entry.reject?.(err);
|
|
38
|
+
onError?.(err, items);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async function enqueueEntry(entry) {
|
|
42
|
+
const { item } = entry;
|
|
36
43
|
const key = buildKey(item);
|
|
37
44
|
const debounceMs = resolveMs(item);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} catch (err) {
|
|
43
|
-
onError?.(err, [item]);
|
|
44
|
-
}
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (!key) {
|
|
48
|
-
try {
|
|
49
|
-
await onFlush([item]);
|
|
50
|
-
} catch (err) {
|
|
51
|
-
onError?.(err, [item]);
|
|
52
|
-
}
|
|
45
|
+
const canDebounce = debounceMs > 0 && (shouldDebounce?.(item) ?? true);
|
|
46
|
+
if (!key || !canDebounce) {
|
|
47
|
+
if (key) await flushKey(key);
|
|
48
|
+
await process([entry]);
|
|
53
49
|
return;
|
|
54
50
|
}
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
51
|
+
const buffer = buffers.get(key) ?? {
|
|
52
|
+
items: [],
|
|
53
|
+
timeout: null,
|
|
54
|
+
debounceMs
|
|
55
|
+
};
|
|
56
|
+
buffer.items.push(entry);
|
|
57
|
+
buffer.debounceMs = debounceMs;
|
|
58
|
+
buffers.set(key, buffer);
|
|
59
|
+
scheduleFlush(key, buffer);
|
|
60
|
+
}
|
|
61
|
+
function enqueue(item) {
|
|
62
|
+
return enqueueEntry({ item });
|
|
63
|
+
}
|
|
64
|
+
/** Resolve only after buffered items are dispatched. Used by durable ingress. */
|
|
65
|
+
function enqueueAndWait(item) {
|
|
66
|
+
return new Promise((resolve, reject) => {
|
|
67
|
+
enqueueEntry({
|
|
68
|
+
item,
|
|
69
|
+
resolve,
|
|
70
|
+
reject
|
|
71
|
+
}).catch(reject);
|
|
72
|
+
});
|
|
69
73
|
}
|
|
70
74
|
async function flushAll() {
|
|
71
75
|
const keys = Array.from(buffers.keys());
|
|
@@ -76,6 +80,7 @@ function createInboundDebouncer(options) {
|
|
|
76
80
|
}
|
|
77
81
|
return {
|
|
78
82
|
enqueue,
|
|
83
|
+
enqueueAndWait,
|
|
79
84
|
flushKey,
|
|
80
85
|
flushAll,
|
|
81
86
|
getBufferCount
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isGatewayArgv, parseProcCmdline } from "./gateway-process-argv.js";
|
|
2
1
|
import { listPortListeners } from "../gateway/ports.js";
|
|
2
|
+
import { isGatewayArgv, parseProcCmdline } from "./gateway-process-argv.js";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { spawnSync } from "node:child_process";
|
|
5
5
|
//#region src/infra/gateway-processes.ts
|
|
@@ -2,10 +2,10 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { init_paths, resolveConfigPath } from "../config/paths.js";
|
|
4
4
|
import { loadConfig } from "../config/loader.js";
|
|
5
|
-
import { resolveGatewayService } from "../daemon/service.js";
|
|
6
5
|
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
7
|
-
import {
|
|
6
|
+
import { resolveGatewayService } from "../daemon/service.js";
|
|
8
7
|
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "./restart.js";
|
|
8
|
+
import { findVerifiedGatewayListenerPidsOnPortSync, signalVerifiedGatewayPidSync } from "./gateway-processes.js";
|
|
9
9
|
import { refreshGatewayServiceAfterUpdate } from "./update-service-refresh.js";
|
|
10
10
|
//#region src/infra/update-restart.ts
|
|
11
11
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, init_package_version } from "../package-version.js";
|
|
2
2
|
import { runPostUpdateExtensionSync } from "../extensions/update.js";
|
|
3
|
+
import "./update-channels.js";
|
|
4
|
+
import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
|
|
3
5
|
import { readPackageName, readPackageVersion } from "./package-json.js";
|
|
4
6
|
import { runCommandWithTimeout } from "./run-command.js";
|
|
5
7
|
import { XOPC_PACKAGE_NAME, cleanupGlobalRenameDirs, createGlobalInstallEnv, detectGlobalInstallManagerForRoot, resolveGlobalInstallSpec, resolveGlobalInstallTarget } from "./update-global.js";
|
|
6
8
|
import { runGlobalPackageUpdateSteps } from "./package-update-steps.js";
|
|
7
9
|
import { resolveStableNodePath } from "./stable-node-path.js";
|
|
8
|
-
import "./update-channels.js";
|
|
9
|
-
import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
|
|
10
10
|
import { trimLogTail } from "./update-log.js";
|
|
11
11
|
import { maybeRestartGatewayAfterUpdate, prepareGatewayRestart } from "./update-restart.js";
|
|
12
12
|
import path from "node:path";
|