@myagentroam/server 0.13.11 → 0.13.12
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/node_modules/@myagentroam/protocol/dist/index.d.ts +986 -797
- package/node_modules/@myagentroam/protocol/dist/index.js +5 -0
- package/node_modules/@myagentroam/protocol/dist/remote-desktop.d.ts +789 -0
- package/node_modules/@myagentroam/protocol/dist/remote-desktop.js +341 -0
- package/node_modules/@myagentroam/protocol/package.json +1 -1
- package/node_modules/@myagentroam/server-core/dist/direct-transfer-coordinator.d.ts +6 -0
- package/node_modules/@myagentroam/server-core/dist/direct-transfer-coordinator.js +10 -1
- package/node_modules/@myagentroam/server-core/dist/node-identity-control.d.ts +19 -3
- package/node_modules/@myagentroam/server-core/dist/node-identity-control.js +4 -1
- package/node_modules/@myagentroam/server-core/dist/node-projection.d.ts +16 -0
- package/node_modules/@myagentroam/server-core/dist/node-projection.js +4 -1
- package/node_modules/@myagentroam/server-core/dist/remote-desktop-admission.d.ts +54 -0
- package/node_modules/@myagentroam/server-core/dist/remote-desktop-admission.js +197 -0
- package/node_modules/@myagentroam/server-core/dist/remote-desktop-direct-coordinator.d.ts +33 -0
- package/node_modules/@myagentroam/server-core/dist/remote-desktop-direct-coordinator.js +388 -0
- package/node_modules/@myagentroam/server-core/dist/remote-desktop-relay-coordinator.d.ts +34 -0
- package/node_modules/@myagentroam/server-core/dist/remote-desktop-relay-coordinator.js +383 -0
- package/node_modules/@myagentroam/server-core/dist/remote-desktop-relay-pair.d.ts +25 -0
- package/node_modules/@myagentroam/server-core/dist/remote-desktop-relay-pair.js +94 -0
- package/node_modules/@myagentroam/server-core/dist/remote-desktop-relay-pairing.d.ts +34 -0
- package/node_modules/@myagentroam/server-core/dist/remote-desktop-relay-pairing.js +218 -0
- package/node_modules/@myagentroam/server-core/dist/remote-desktop-relay-sockets.d.ts +26 -0
- package/node_modules/@myagentroam/server-core/dist/remote-desktop-relay-sockets.js +121 -0
- package/node_modules/@myagentroam/server-core/dist/workbench-relay-service.d.ts +13 -1
- package/node_modules/@myagentroam/server-core/dist/workbench-relay-service.js +33 -1
- package/node_modules/@myagentroam/server-core/package.json +27 -2
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/composition/node-control-factory.js +92 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/node-control.d.ts +15 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/node-control.js +74 -3
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/rbac/resource-access-service.js +3 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/rbac/resource-management-directory.d.ts +16 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/route/node-routes.d.ts +1 -1
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/route/node-routes.js +3 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/route/realtime-routes.js +13 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/route/remote-desktop-discovery-route.d.ts +12 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/route/remote-desktop-discovery-route.js +54 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/service/desktop-websocket-dispatcher.d.ts +10 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/service/desktop-websocket-dispatcher.js +40 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/package.json +3 -3
- package/package.json +6 -6
- package/web/THIRD_PARTY_NOTICES.txt +542 -0
- package/web/assets/AuditManagementPage-B3GNsvZB.js +1 -0
- package/web/assets/BusyIndicator-BNt82qgn.js +1 -0
- package/web/assets/{CodeFileEditor-DHWQnh-o.js → CodeFileEditor-D57iVLg9.js} +10 -10
- package/web/assets/ConversationTemplateManagementPage-CoNa6jhD.js +1 -0
- package/web/assets/ConversationTemplateManagementPage-DpU2svWM.js +1 -0
- package/web/assets/EnterpriseUserManagementPage-CWekJuDr.js +1 -0
- package/web/assets/EnvironmentSecretManager-CTKZKvfB.js +1 -0
- package/web/assets/FilePreviewLoading-GheT8tXY.js +23 -0
- package/web/assets/HtmlPreviewFrame-Cc-6Urnf.js +6 -0
- package/web/assets/LicenseManagementPage-BjLxf6Xr.js +1 -0
- package/web/assets/ManagementPagination-PDHF5PBA.js +1 -0
- package/web/assets/MarAgentModelManagementPage-BgPT4Yih.js +1 -0
- package/web/assets/{MarAgentModelManagementPage-Cyzi07aX.js → MarAgentModelManagementPage-wLSa92jb.js} +1 -1
- package/web/assets/MarIcon-CUvpkWG0.js +1 -0
- package/web/assets/MarkdownFilePreview-CG3MUmyo.js +2 -0
- package/web/assets/McpDetailsDialog-TZ82C95X.js +1 -0
- package/web/assets/McpSourceManagementPage-CJEJGu8R.js +1 -0
- package/web/assets/McpSourceManagementPage-gErPoW5h.js +1 -0
- package/web/assets/{NodeDetailsDialogs-wEWj2T2w.js → NodeDetailsDialogs-5KtggTTx.js} +5 -5
- package/web/assets/{NodeDetailsDialogs-BhUhw2Y_.css → NodeDetailsDialogs-DQ0DRy_G.css} +1 -1
- package/web/assets/NodeManagementPage-BCZGDUuG.js +1 -0
- package/web/assets/NodeManagementPage-DFKpf9a4.js +1 -0
- package/web/assets/OAuthManagementPage-Dx8NQiDI.js +2 -0
- package/web/assets/OrganizationManagementPage-BTa7DBA7.js +1 -0
- package/web/assets/RemoteDesktopPage-BO9zdNV_.css +1 -0
- package/web/assets/RemoteDesktopPage-Bt9tRsTn.js +5 -0
- package/web/assets/{ResourceManagementPanel-DQtbdfv0.css → ResourceManagementPanel-BmAJ59B8.css} +1 -1
- package/web/assets/ResourceManagementPanel-DcQlMmz0.js +2 -0
- package/web/assets/ResourceManagementPanel.vue_vue_type_script_setup_true_lang-DWq9KGLs.js +1 -0
- package/web/assets/{SecretManagementPage-CY-ChCTX.js → SecretManagementPage-CSdNxrhc.js} +1 -1
- package/web/assets/SecretManagementPage-jXCRWqAc.js +1 -0
- package/web/assets/SecretManagementPage.vue_vue_type_script_setup_true_lang-DqXpaQNw.js +1 -0
- package/web/assets/SessionSharePage-B4kuxS6C.js +2 -0
- package/web/assets/SettingsContent-Cs82l7of.js +1 -0
- package/web/assets/SettingsContent-W2k4b8Dq.js +1 -0
- package/web/assets/SkillCenterPage-B6_Vr9HA.js +1 -0
- package/web/assets/SkillCenterPage-DjSmk2nM.js +1 -0
- package/web/assets/SkillDetailsDialog-CzMCTsCj.js +1 -0
- package/web/assets/SkillSourceManagementPage-BXJ4Yd9T.js +1 -0
- package/web/assets/SkillSourceManagementPage-C3QpUz15.js +1 -0
- package/web/assets/StandaloneFilePreviewPage-Bvl8npFz.js +1 -0
- package/web/assets/SystemConfigurationPage-CWaTQHwP.js +1 -0
- package/web/assets/SystemConfigurationPage-W7CPoHMn.js +1 -0
- package/web/assets/SystemInformationPage-CKKJlWO0.js +1 -0
- package/web/assets/{TerminalTabView-DVCYt0fE.js → TerminalTabView-DrEz7e1C.js} +10 -10
- package/web/assets/{WorkbenchPage-BD71afb3.css → WorkbenchPage-DfpWtjdX.css} +1 -1
- package/web/assets/{WorkbenchPage-DEOojXdg.js → WorkbenchPage-WVlZOUqh.js} +15 -15
- package/web/assets/WorkspaceManagementPage-CKjqQIGp.js +1 -0
- package/web/assets/WorkspaceManagementPage-COQpik1d.js +1 -0
- package/web/assets/_baseIteratee-owr0bJ6l.js +1 -0
- package/web/assets/abnfDiagram-VCTEODGH-myemuOWD.js +1 -0
- package/web/assets/advancedFormat-CelTgaZ7.js +1 -0
- package/web/assets/{arc-DPr8Gc-B.js → arc-BjRwj9NO.js} +1 -1
- package/web/assets/architectureDiagram-5GKGNRK7-ClecpyN_.js +36 -0
- package/web/assets/{blockDiagram-OSKFZWR5-ClhXRBhx.js → blockDiagram-OSKFZWR5-DZ-4wWb8.js} +2 -2
- package/web/assets/{c4Diagram-7LVT6UL2-jKj0JNVS.js → c4Diagram-7LVT6UL2-Dc-hXE9s.js} +2 -2
- package/web/assets/{catalog-ownership-service-DG9J4Whj.js → catalog-ownership-service-I8XNR0Qz.js} +1 -1
- package/web/assets/{catalog-page-service-uW8GGgTl.js → catalog-page-service-CQSzg464.js} +1 -1
- package/web/assets/channel-DTVapq8S.js +1 -0
- package/web/assets/{chunk-2Q5K7J3B-BFPAAxdO.js → chunk-2Q5K7J3B-BDP5KTY0.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-CoraATO4.js → chunk-5VM5RSS4-4tVCn4h5.js} +1 -1
- package/web/assets/{chunk-F27PBJKO-Cu2c-DqL.js → chunk-F27PBJKO-Bt7Pq3eU.js} +1 -1
- package/web/assets/{chunk-HLEWEB6X-B0mNHYc5.js → chunk-HLEWEB6X-C8Odhg40.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-uRezlmYw.js → chunk-JWPE2WC7-0jTVv6-g.js} +1 -1
- package/web/assets/{chunk-POPQ4Y6H-DKtzovYi.js → chunk-POPQ4Y6H-Cox8tr2A.js} +1 -1
- package/web/assets/{chunk-SVP7TREG-CHDyQwHW.js → chunk-SVP7TREG-DIho7QDl.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-DdWtTM_D.js → chunk-XXDRQBXY-CKvBB7iL.js} +1 -1
- package/web/assets/{chunk-ZLD2IHE6-CTbkxyTO.js → chunk-ZLD2IHE6-CBLCsepB.js} +1 -1
- package/web/assets/classDiagram-CYGNFDIV-BLPPi2ku.js +1 -0
- package/web/assets/classDiagram-v2-TLXNO2FR-BLPPi2ku.js +1 -0
- package/web/assets/{conversation-history-zzn2wjLr.js → conversation-history-BTsHzKIv.js} +3 -3
- package/web/assets/cose-bilkent-JH36ORCC-kPlBBSKt.js +1 -0
- package/web/assets/{cynefin-OW5HDTMX-CygKQcJZ.js → cynefin-OW5HDTMX-DYQ5I5rj.js} +1 -1
- package/web/assets/cynefinDiagram-5FMLGOSQ-TvVu_cy5.js +62 -0
- package/web/assets/{dagre-OS7QT2EB-DZw1A2vK.js → dagre-OS7QT2EB-6GFFOU7T.js} +2 -2
- package/web/assets/{diagram-S7CK7UJ4-B8WFZqgl.js → diagram-S7CK7UJ4-CqOwpVf6.js} +2 -2
- package/web/assets/diagram-UQ7AKVKN-CdPKJxWp.js +41 -0
- package/web/assets/{diagram-VSXAHHWV-BtAEo6iX.js → diagram-VSXAHHWV-ChkzC0jL.js} +2 -2
- package/web/assets/diagram-VX7I27RA-dw50wzTd.js +24 -0
- package/web/assets/diagram-Z3DM3KII-Db2TPKoB.js +24 -0
- package/web/assets/ebnfDiagram-PWID7BFC-DCKpfy9K.js +1 -0
- package/web/assets/el-alert-D4YB4Rdk.js +1 -0
- package/web/assets/el-cascader-7blM0Dmv.js +12 -0
- package/web/assets/el-checkbox-bPnal28g.js +1 -0
- package/web/assets/el-date-picker-BEg7uElh.js +1 -0
- package/web/assets/el-descriptions-BZCieEOU.js +1 -0
- package/web/assets/el-form-item-DJF-7yxs.js +12 -0
- package/web/assets/{el-input-BpWDYUjR.js → el-input-CYgfv6kQ.js} +2 -2
- package/web/assets/el-input-number-BWQwy_iS.js +1 -0
- package/web/assets/el-radio-Dyq7u_E4.js +1 -0
- package/web/assets/el-scrollbar-BAB_ZL4S.js +1 -0
- package/web/assets/el-scrollbar-GF-yQkxY.css +1 -0
- package/web/assets/el-select-Bx7SyuQk.js +1 -0
- package/web/assets/el-switch-Bf3FBlgg.js +1 -0
- package/web/assets/el-tab-pane-Cm600Oi1.js +1 -0
- package/web/assets/el-table-column-E7EpLEDR.js +1 -0
- package/web/assets/{enterprise-management-service-B6KyNDyG.js → enterprise-management-service-CeT6s6QL.js} +1 -1
- package/web/assets/{erDiagram-2YWLMYGG-B2jcqlY5.js → erDiagram-2YWLMYGG-DdT31f4X.js} +2 -2
- package/web/assets/{error-presentation-cyVRuBgz.js → error-presentation-BweY3_jw.js} +1 -1
- package/web/assets/{flowDiagram-T62WH6J4-9c5G5NB6.js → flowDiagram-T62WH6J4-DUBILrIG.js} +1 -1
- package/web/assets/{ganttDiagram-EL5Y4UJY-DYDs9vX6.js → ganttDiagram-EL5Y4UJY-D3cWTRYD.js} +2 -2
- package/web/assets/gitGraphDiagram-WWUBYQGX-Dck8--33.js +106 -0
- package/web/assets/{hosted-conversation-template-client-Ndxn-PJK.js → hosted-conversation-template-client-o7rTdHX7.js} +1 -1
- package/web/assets/{index-DsfpHPPY.js → index-3DBRpHu_.js} +1 -1
- package/web/assets/{index-EW1VHqsl.js → index-B7f3Sbrl.js} +1 -1
- package/web/assets/{index-CAh_jqmY.js → index-BJWac6Lq.js} +1 -1
- package/web/assets/{index-8MbTKHFT.js → index-BL3Zzqnh.js} +1 -1
- package/web/assets/{index-B7diW13Y.js → index-BXGEDKQM.js} +1 -1
- package/web/assets/{index-Czl2u09b.js → index-BkrvevGa.js} +1 -1
- package/web/assets/{index-CEfWr1ey.js → index-BvZhS8k_.js} +1 -1
- package/web/assets/{index-DIITYNnE.js → index-C-1KTy9v.js} +1 -1
- package/web/assets/{index-DHjAnr6w.js → index-C4JlygoG.js} +1 -1
- package/web/assets/{index-DSKFmNJ4.js → index-C9Pi3HXj.js} +1 -1
- package/web/assets/{index-CA0x6n5X.js → index-CmeadIsa.js} +1 -1
- package/web/assets/{index-MMz-YtJL.js → index-CrBgtemt.js} +1 -1
- package/web/assets/index-D0EbZsol.js +1 -0
- package/web/assets/{index-Dks60iGm.js → index-DB6_6U7l.js} +1 -1
- package/web/assets/{index-D9XujVzN.js → index-DE2nRMOH.js} +1 -1
- package/web/assets/{index-BVdJAvRe.js → index-DI3_YI0H.js} +1 -1
- package/web/assets/{index-DnPVd3rb.js → index-DL2QDtsO.js} +1 -1
- package/web/assets/{index-D2_hyQuZ.js → index-DLtG_esT.js} +1 -1
- package/web/assets/{index-BkEsG_f_.js → index-D_ofz8Jm.js} +1 -1
- package/web/assets/{index-DZx2t7da.css → index-DbbfyLAB.css} +1 -1
- package/web/assets/{index-Dgzn8VE8.js → index-Dd1_MbR7.js} +1 -1
- package/web/assets/{index-C1PoPZgN.js → index-Dr661a5b.js} +19 -19
- package/web/assets/{index-DEZvlUsn.js → index-DrhbaLYO.js} +1 -1
- package/web/assets/{index-DZ60H2e0.js → index-DrsnfxFD.js} +7 -7
- package/web/assets/{index-ClN_hEFy.js → index-DuV2kLZW.js} +1 -1
- package/web/assets/{index-RXBhQ8vk.js → index-DyN5hXIa.js} +1 -1
- package/web/assets/{index-DW5vUEXW.js → index-DyoXB6va.js} +1 -1
- package/web/assets/{index-DI9U2zD6.js → index-TFRbceNP.js} +1 -1
- package/web/assets/{index-D0wg5bz3.js → index-cDVOyssr.js} +1 -1
- package/web/assets/{index-CZAfCBll.js → index-xPrZcDrp.js} +1 -1
- package/web/assets/infoDiagram-FKFFQAWI-Bx5UysxP.js +2 -0
- package/web/assets/isArrayLikeObject-DqnBcNVt.js +1 -0
- package/web/assets/{ishikawaDiagram-5VMMS53U-D_tjMGvs.js → ishikawaDiagram-5VMMS53U-BYp0L8KC.js} +2 -2
- package/web/assets/{journeyDiagram-EYS64GPL-BZiHIxJR.js → journeyDiagram-EYS64GPL-BPZUHX1u.js} +2 -2
- package/web/assets/{kanban-definition-UXKFOSKX-BjL6xGLm.js → kanban-definition-UXKFOSKX-DDIFsBsa.js} +2 -2
- package/web/assets/layout-DY_yrcB9.js +1 -0
- package/web/assets/{linear-BHGa3xmy.js → linear-ZIkt2Y3G.js} +1 -1
- package/web/assets/{management-url-service-HtCACFrT.js → management-url-service-CTLPlZQG.js} +1 -1
- package/web/assets/{mcp-center-service-wjewnEoZ.js → mcp-center-service-Bw4zhRyg.js} +1 -1
- package/web/assets/merge-BzylYBxw.js +1 -0
- package/web/assets/{mermaid.core-ECfdkvrI.js → mermaid.core-Dnw6_YOj.js} +5 -5
- package/web/assets/message-box-service-BUNT7HPv.js +1 -0
- package/web/assets/{mindmap-definition-THT77NOG-D_Wf456_.js → mindmap-definition-THT77NOG-KkmvxHud.js} +2 -2
- package/web/assets/mobile-dialog-return-service-BEAIB0Ir.js +1 -0
- package/web/assets/mobile-dialog-return-service-TSZfE1b8.css +1 -0
- package/web/assets/{oauth-callback-Dl61nHUW.js → oauth-callback-Sraq5LbT.js} +1 -1
- package/web/assets/pegDiagram-XKGWAZYB-azqNe2Pg.js +1 -0
- package/web/assets/{pieDiagram-E7YTZNPT-DNlzSfh4.js → pieDiagram-E7YTZNPT-I2RwFtPh.js} +2 -2
- package/web/assets/{quadrantDiagram-AXDQQJYC-p_L-Ri82.js → quadrantDiagram-AXDQQJYC-8BlX6epF.js} +2 -2
- package/web/assets/railroadDiagram-O6MQD6OU-B50voMf6.js +1 -0
- package/web/assets/{requirementDiagram-IS5BZ75X-DENmRcwx.js → requirementDiagram-IS5BZ75X-C5QWjktx.js} +9 -9
- package/web/assets/{runner-presentation-4fDZAYhc.js → runner-presentation-PCLEG6x8.js} +1 -1
- package/web/assets/{sankeyDiagram-P5KCCOFB-By_-wAs2.js → sankeyDiagram-P5KCCOFB-CAFALS2H.js} +2 -2
- package/web/assets/{sequenceDiagram-WJ2MYXX4-D-NNf_IA.js → sequenceDiagram-WJ2MYXX4-DHMdEeSR.js} +2 -2
- package/web/assets/{session-share-client-service-D9Bx6YdT.js → session-share-client-service-Cy3ASP8q.js} +1 -1
- package/web/assets/sizeCapture-INFHLROL-BLWNQAyC.js +1 -0
- package/web/assets/stateDiagram-XQSTLZYL-BG65G0JC.js +1 -0
- package/web/assets/stateDiagram-v2-IH3M54BS-C0zuVGiD.js +1 -0
- package/web/assets/swimlanes-V6O3JKXN-D-wjP4yW.js +1 -0
- package/web/assets/swimlanesDiagram-JKAHXJPX-nTWKGN-Q.js +8 -0
- package/web/assets/{time-presentation-COCAmFXN.js → time-presentation-DjAc7WKL.js} +1 -1
- package/web/assets/{timeline-definition-24CTP7MA-BGSMK4o4.js → timeline-definition-24CTP7MA-BQ3z7sNX.js} +2 -2
- package/web/assets/union-Msgjlg8g.js +1 -0
- package/web/assets/{use-form-common-props-Qasxkz0k.js → use-form-common-props-D3qDsnlg.js} +1 -1
- package/web/assets/use-wheel-CmtKbbqP.js +1 -0
- package/web/assets/{vennDiagram-4TSXK5OY-CogALo2v.js → vennDiagram-4TSXK5OY-FFYLndB2.js} +2 -2
- package/web/assets/vnode-BdgIus5q.js +1 -0
- package/web/assets/{wardleyDiagram-VM6X3IG4-Cy8XLNG3.js → wardleyDiagram-VM6X3IG4-DMyzxw0G.js} +2 -2
- package/web/assets/{workbench-composer-interaction-controller-CDcdFflI.js → workbench-composer-interaction-controller-DwOqc5FK.js} +15 -15
- package/web/assets/workbench-live-service-DSm6i_DJ.js +1 -0
- package/web/assets/workbench-presentation-DMa7HmIl.js +1 -0
- package/web/assets/workspace-direct-transfer-service-COT51fe6.js +2 -0
- package/web/assets/{xychartDiagram-S5SC5T6Z-DbCZmzen.js → xychartDiagram-S5SC5T6Z-D4mb51di.js} +2 -2
- package/web/docs/404.html +2 -2
- package/web/docs/administration/account.html +4 -4
- package/web/docs/administration/audit.html +4 -4
- package/web/docs/administration/conversation-templates.html +4 -4
- package/web/docs/administration/email-notifications.html +4 -4
- package/web/docs/administration/license.html +4 -4
- package/web/docs/administration/nodes-workspaces.html +4 -4
- package/web/docs/administration/oauth.html +4 -4
- package/web/docs/administration/secrets.html +4 -4
- package/web/docs/administration/template-workspace-maintenance.html +4 -4
- package/web/docs/administration/users-organizations.html +4 -4
- package/web/docs/assets/{app.BcnxJDd9.js → app.BhQUfHav.js} +1 -1
- package/web/docs/assets/chunks/@localSearchIndexen-US.DiL37-bd.js +1 -0
- package/web/docs/assets/chunks/@localSearchIndexroot.FDLmZyRK.js +1 -0
- package/web/docs/assets/chunks/{VPLocalSearchBox.DPZN2_XI.js → VPLocalSearchBox.Bv5t-eMM.js} +1 -1
- package/web/docs/assets/chunks/{theme.CQ0UXGRU.js → theme.QEVSOy48.js} +2 -2
- package/web/docs/assets/en-US_workbench_remote-desktop.md.6_E4xK1c.js +1 -0
- package/web/docs/assets/en-US_workbench_remote-desktop.md.6_E4xK1c.lean.js +1 -0
- package/web/docs/assets/workbench_remote-desktop.md.BRksW46R.js +1 -0
- package/web/docs/assets/workbench_remote-desktop.md.BRksW46R.lean.js +1 -0
- package/web/docs/concepts/architecture.html +4 -4
- package/web/docs/concepts/data-and-security.html +4 -4
- package/web/docs/concepts/files-git-terminal.html +4 -4
- package/web/docs/concepts/node-and-workspace.html +4 -4
- package/web/docs/concepts/permissions-and-sharing.html +4 -4
- package/web/docs/concepts/runner-control.html +4 -4
- package/web/docs/concepts/secrets.html +4 -4
- package/web/docs/concepts/session-run-turn.html +4 -4
- package/web/docs/deployment/backup-restore.html +4 -4
- package/web/docs/deployment/network.html +4 -4
- package/web/docs/deployment/node-installation.html +4 -4
- package/web/docs/deployment/node-linux.html +4 -4
- package/web/docs/deployment/node-macos.html +4 -4
- package/web/docs/deployment/node-windows.html +4 -4
- package/web/docs/deployment/production.html +4 -4
- package/web/docs/deployment/security-checklist.html +4 -4
- package/web/docs/deployment/upgrade.html +4 -4
- package/web/docs/en-US/administration/account.html +4 -4
- package/web/docs/en-US/administration/audit.html +4 -4
- package/web/docs/en-US/administration/conversation-templates.html +4 -4
- package/web/docs/en-US/administration/email-notifications.html +4 -4
- package/web/docs/en-US/administration/license.html +4 -4
- package/web/docs/en-US/administration/nodes-workspaces.html +4 -4
- package/web/docs/en-US/administration/oauth.html +4 -4
- package/web/docs/en-US/administration/secrets.html +4 -4
- package/web/docs/en-US/administration/template-workspace-maintenance.html +4 -4
- package/web/docs/en-US/administration/users-organizations.html +4 -4
- package/web/docs/en-US/concepts/architecture.html +4 -4
- package/web/docs/en-US/concepts/data-and-security.html +4 -4
- package/web/docs/en-US/concepts/files-git-terminal.html +4 -4
- package/web/docs/en-US/concepts/node-and-workspace.html +4 -4
- package/web/docs/en-US/concepts/permissions-and-sharing.html +4 -4
- package/web/docs/en-US/concepts/runner-control.html +4 -4
- package/web/docs/en-US/concepts/secrets.html +4 -4
- package/web/docs/en-US/concepts/session-run-turn.html +4 -4
- package/web/docs/en-US/deployment/backup-restore.html +4 -4
- package/web/docs/en-US/deployment/network.html +4 -4
- package/web/docs/en-US/deployment/node-installation.html +4 -4
- package/web/docs/en-US/deployment/node-linux.html +4 -4
- package/web/docs/en-US/deployment/node-macos.html +4 -4
- package/web/docs/en-US/deployment/node-windows.html +4 -4
- package/web/docs/en-US/deployment/production.html +4 -4
- package/web/docs/en-US/deployment/security-checklist.html +4 -4
- package/web/docs/en-US/deployment/upgrade.html +4 -4
- package/web/docs/en-US/getting-started/connect-node.html +4 -4
- package/web/docs/en-US/getting-started/first-agent-session.html +4 -4
- package/web/docs/en-US/getting-started/first-login.html +4 -4
- package/web/docs/en-US/getting-started/next-steps.html +4 -4
- package/web/docs/en-US/getting-started/npm-quick-start.html +4 -4
- package/web/docs/en-US/getting-started/overview.html +4 -4
- package/web/docs/en-US/getting-started/prerequisites.html +4 -4
- package/web/docs/en-US/getting-started/register-workspace.html +4 -4
- package/web/docs/en-US/getting-started/server-installation.html +4 -4
- package/web/docs/en-US/operations/marctl.html +4 -4
- package/web/docs/en-US/reference/configuration.html +4 -4
- package/web/docs/en-US/reference/keyboard-shortcuts.html +4 -4
- package/web/docs/en-US/reference/limits.html +4 -4
- package/web/docs/en-US/reference/ports-paths-data.html +4 -4
- package/web/docs/en-US/reference/status-and-errors.html +4 -4
- package/web/docs/en-US/runners/claude-code.html +4 -4
- package/web/docs/en-US/runners/codex.html +4 -4
- package/web/docs/en-US/runners/mar-agent.html +4 -4
- package/web/docs/en-US/runners/opencode.html +4 -4
- package/web/docs/en-US/runners/overview.html +4 -4
- package/web/docs/en-US/runners/runner-troubleshooting.html +4 -4
- package/web/docs/en-US/troubleshooting/node-offline.html +4 -4
- package/web/docs/en-US/troubleshooting/quick-diagnosis.html +4 -4
- package/web/docs/en-US/troubleshooting/session-run.html +4 -4
- package/web/docs/en-US/troubleshooting/terminal.html +4 -4
- package/web/docs/en-US/troubleshooting/workspace-files.html +4 -4
- package/web/docs/en-US/workbench/composer.html +4 -4
- package/web/docs/en-US/workbench/context-and-plan.html +4 -4
- package/web/docs/en-US/workbench/conversation.html +4 -4
- package/web/docs/en-US/workbench/file-reference-and-attachment.html +4 -4
- package/web/docs/en-US/workbench/files.html +4 -4
- package/web/docs/en-US/workbench/git-changes.html +4 -4
- package/web/docs/en-US/workbench/git-history.html +4 -4
- package/web/docs/en-US/workbench/hosted-conversations.html +4 -4
- package/web/docs/en-US/workbench/mobile.html +4 -4
- package/web/docs/en-US/workbench/navigation.html +4 -4
- package/web/docs/en-US/workbench/remote-desktop.html +25 -0
- package/web/docs/en-US/workbench/sessions.html +4 -4
- package/web/docs/en-US/workbench/skills.html +4 -4
- package/web/docs/en-US/workbench/terminal.html +4 -4
- package/web/docs/getting-started/connect-node.html +4 -4
- package/web/docs/getting-started/first-agent-session.html +4 -4
- package/web/docs/getting-started/first-login.html +4 -4
- package/web/docs/getting-started/next-steps.html +4 -4
- package/web/docs/getting-started/npm-quick-start.html +4 -4
- package/web/docs/getting-started/overview.html +4 -4
- package/web/docs/getting-started/prerequisites.html +4 -4
- package/web/docs/getting-started/register-workspace.html +4 -4
- package/web/docs/getting-started/server-installation.html +4 -4
- package/web/docs/hashmap.json +1 -1
- package/web/docs/operations/marctl.html +4 -4
- package/web/docs/reference/configuration.html +4 -4
- package/web/docs/reference/keyboard-shortcuts.html +4 -4
- package/web/docs/reference/limits.html +4 -4
- package/web/docs/reference/ports-paths-data.html +4 -4
- package/web/docs/reference/status-and-errors.html +4 -4
- package/web/docs/runners/claude-code.html +4 -4
- package/web/docs/runners/codex.html +4 -4
- package/web/docs/runners/mar-agent.html +4 -4
- package/web/docs/runners/opencode.html +4 -4
- package/web/docs/runners/overview.html +4 -4
- package/web/docs/runners/runner-troubleshooting.html +4 -4
- package/web/docs/troubleshooting/node-offline.html +4 -4
- package/web/docs/troubleshooting/quick-diagnosis.html +4 -4
- package/web/docs/troubleshooting/session-run.html +4 -4
- package/web/docs/troubleshooting/terminal.html +4 -4
- package/web/docs/troubleshooting/workspace-files.html +4 -4
- package/web/docs/workbench/composer.html +4 -4
- package/web/docs/workbench/context-and-plan.html +4 -4
- package/web/docs/workbench/conversation.html +4 -4
- package/web/docs/workbench/file-reference-and-attachment.html +4 -4
- package/web/docs/workbench/files.html +4 -4
- package/web/docs/workbench/git-changes.html +4 -4
- package/web/docs/workbench/git-history.html +4 -4
- package/web/docs/workbench/hosted-conversations.html +4 -4
- package/web/docs/workbench/mobile.html +4 -4
- package/web/docs/workbench/navigation.html +4 -4
- package/web/docs/workbench/remote-desktop.html +25 -0
- package/web/docs/workbench/sessions.html +4 -4
- package/web/docs/workbench/skills.html +4 -4
- package/web/docs/workbench/terminal.html +4 -4
- package/web/index.html +2 -2
- package/web/service-worker.js +1 -1
- package/web/web-version.json +1 -1
- package/web/assets/AuditManagementPage-DDpkb6iu.js +0 -1
- package/web/assets/BusyIndicator-DJPKdj7P.js +0 -1
- package/web/assets/ConversationTemplateManagementPage-BwzYTnCM.js +0 -1
- package/web/assets/ConversationTemplateManagementPage-DQ6FaVLQ.js +0 -1
- package/web/assets/EnterpriseUserManagementPage-BST3IqcQ.js +0 -1
- package/web/assets/EnvironmentSecretManager-BftWs0wS.js +0 -1
- package/web/assets/FilePreviewLoading-CJ5VLGu6.js +0 -23
- package/web/assets/HtmlPreviewFrame-B7vpYm3x.js +0 -7
- package/web/assets/LicenseManagementPage-CZUYN0A5.js +0 -1
- package/web/assets/ManagementPagination-DHSJOUUG.js +0 -1
- package/web/assets/MarAgentModelManagementPage-BcJA65mU.js +0 -1
- package/web/assets/MarIcon-BG4oszgR.js +0 -1
- package/web/assets/MarkdownFilePreview-CEadWA03.js +0 -2
- package/web/assets/McpDetailsDialog-C7zDHYpR.js +0 -1
- package/web/assets/McpSourceManagementPage-Bxa29fjL.js +0 -1
- package/web/assets/McpSourceManagementPage-DHJVieZJ.js +0 -1
- package/web/assets/NodeManagementPage-CFk_gfX6.js +0 -1
- package/web/assets/NodeManagementPage-TqqcVd3V.js +0 -1
- package/web/assets/OAuthManagementPage-wWLyvvMw.js +0 -2
- package/web/assets/OrganizationManagementPage-CXg83jd2.js +0 -1
- package/web/assets/ResourceManagementPanel-iBwitvZw.js +0 -2
- package/web/assets/ResourceManagementPanel.vue_vue_type_script_setup_true_lang-Btp4_en9.js +0 -1
- package/web/assets/SecretManagementPage-Cu4PYqAM.js +0 -1
- package/web/assets/SecretManagementPage.vue_vue_type_script_setup_true_lang-Bep4WQl2.js +0 -1
- package/web/assets/SessionSharePage-2UPqwt8m.js +0 -2
- package/web/assets/SettingsContent-BhTtkd24.js +0 -1
- package/web/assets/SettingsContent-JWXFzqNV.js +0 -1
- package/web/assets/SkillCenterPage-Br4i8Flw.js +0 -1
- package/web/assets/SkillCenterPage-CvhfmdSM.js +0 -1
- package/web/assets/SkillDetailsDialog-DWLYQQjl.js +0 -1
- package/web/assets/SkillSourceManagementPage-C8lC34vi.js +0 -1
- package/web/assets/SkillSourceManagementPage-CT3mUj58.js +0 -1
- package/web/assets/StandaloneFilePreviewPage-DBxqHpQr.js +0 -1
- package/web/assets/SystemConfigurationPage-Bu52pfMf.js +0 -1
- package/web/assets/SystemConfigurationPage-iivE-urf.js +0 -1
- package/web/assets/SystemInformationPage-DggNu1_5.js +0 -1
- package/web/assets/WorkspaceManagementPage-BlG9GMdx.js +0 -1
- package/web/assets/WorkspaceManagementPage-C_FawYEL.js +0 -1
- package/web/assets/_baseIteratee-DymaJqOo.js +0 -1
- package/web/assets/abnfDiagram-VCTEODGH-CZ0eLvTq.js +0 -1
- package/web/assets/advancedFormat-BuXJ43Ll.js +0 -1
- package/web/assets/architectureDiagram-5GKGNRK7--QGii2Ew.js +0 -36
- package/web/assets/channel-BORKaqRb.js +0 -1
- package/web/assets/classDiagram-CYGNFDIV-BPa4z-gv.js +0 -1
- package/web/assets/classDiagram-v2-TLXNO2FR-BPa4z-gv.js +0 -1
- package/web/assets/cose-bilkent-JH36ORCC-BKvPnBMj.js +0 -1
- package/web/assets/cynefinDiagram-5FMLGOSQ-2bWOzv3Q.js +0 -62
- package/web/assets/diagram-UQ7AKVKN-CwlODirx.js +0 -41
- package/web/assets/diagram-VX7I27RA-D-hLYgih.js +0 -24
- package/web/assets/diagram-Z3DM3KII-CsVM1_2N.js +0 -24
- package/web/assets/ebnfDiagram-PWID7BFC-CbiJcKPC.js +0 -1
- package/web/assets/el-alert-D_HcHAtv.js +0 -1
- package/web/assets/el-cascader-DtHRyBg6.js +0 -12
- package/web/assets/el-checkbox-CyD10PJl.js +0 -1
- package/web/assets/el-date-picker-Cw7477MJ.js +0 -1
- package/web/assets/el-descriptions-_8vFS-Hf.js +0 -1
- package/web/assets/el-form-item-B38mTD0f.js +0 -12
- package/web/assets/el-input-number-dggMLw2c.js +0 -1
- package/web/assets/el-radio-DuEE2nbq.js +0 -1
- package/web/assets/el-select-DQdVntOz.js +0 -1
- package/web/assets/el-switch-uikLmwI-.js +0 -1
- package/web/assets/el-tab-pane-dw4hOWXx.js +0 -1
- package/web/assets/el-table-column-ewnVNWdG.js +0 -1
- package/web/assets/gitGraphDiagram-WWUBYQGX-Cz_hlT9S.js +0 -106
- package/web/assets/index-B3jFpujj.js +0 -1
- package/web/assets/infoDiagram-FKFFQAWI-Bsumzg70.js +0 -2
- package/web/assets/isArrayLikeObject-DMc4IHcV.js +0 -1
- package/web/assets/layout-M-S1STc5.js +0 -1
- package/web/assets/merge-B10XqAbO.js +0 -1
- package/web/assets/message-box-service-DNN6Zli9.js +0 -1
- package/web/assets/mobile-dialog-return-service-B3gEe5CK.js +0 -1
- package/web/assets/mobile-dialog-return-service-pE1w6qia.css +0 -1
- package/web/assets/pegDiagram-XKGWAZYB-Dp928xtJ.js +0 -1
- package/web/assets/railroadDiagram-O6MQD6OU-CiuGDZvx.js +0 -1
- package/web/assets/sizeCapture-INFHLROL-Bpu7aOj_.js +0 -1
- package/web/assets/stateDiagram-XQSTLZYL-BHH486Ve.js +0 -1
- package/web/assets/stateDiagram-v2-IH3M54BS-DfjKoh1G.js +0 -1
- package/web/assets/swimlanes-V6O3JKXN-n3tGpQ4z.js +0 -1
- package/web/assets/swimlanesDiagram-JKAHXJPX-CO8cAhiR.js +0 -8
- package/web/assets/union-vNt3EAwE.js +0 -1
- package/web/assets/use-wheel-B3Q5vuXa.js +0 -1
- package/web/assets/workbench-presentation-DA1cZQta.js +0 -1
- package/web/docs/assets/chunks/@localSearchIndexen-US.CbjDKf82.js +0 -1
- package/web/docs/assets/chunks/@localSearchIndexroot.D9CYPMbv.js +0 -1
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
const OPEN_MS = 15_000;
|
|
2
|
+
const SETUP_MS = 15_000;
|
|
3
|
+
const LEASE_MS = 30_000;
|
|
4
|
+
/** Server-side attachment phase owner shared by Direct and relay, not a transport or input writer. */
|
|
5
|
+
export class RemoteDesktopAdmission {
|
|
6
|
+
#entries = new Map();
|
|
7
|
+
reserve(binding, now) {
|
|
8
|
+
if (this.#entries.has(binding.attachmentId) ||
|
|
9
|
+
[...this.#entries.values()].some((entry) => entry.workbenchConnectionId === binding.workbenchConnectionId &&
|
|
10
|
+
entry.requestId === binding.requestId))
|
|
11
|
+
return undefined;
|
|
12
|
+
const entry = {
|
|
13
|
+
...binding,
|
|
14
|
+
phase: 'RESERVED',
|
|
15
|
+
dispatched: false,
|
|
16
|
+
browserReady: false,
|
|
17
|
+
pageGone: false,
|
|
18
|
+
openExpiresAt: now + OPEN_MS,
|
|
19
|
+
expiresAt: now + LEASE_MS
|
|
20
|
+
};
|
|
21
|
+
this.#entries.set(entry.attachmentId, entry);
|
|
22
|
+
return { ...entry };
|
|
23
|
+
}
|
|
24
|
+
get(attachmentId) {
|
|
25
|
+
const entry = this.#entries.get(attachmentId);
|
|
26
|
+
return entry && { ...entry };
|
|
27
|
+
}
|
|
28
|
+
countNode(nodeId) {
|
|
29
|
+
return [...this.#entries.values()].filter((entry) => entry.nodeId === nodeId).length;
|
|
30
|
+
}
|
|
31
|
+
dispatched(attachmentId, now) {
|
|
32
|
+
const entry = this.#entries.get(attachmentId);
|
|
33
|
+
if (!entry || entry.phase !== 'RESERVED' || entry.dispatched || this.#expired(entry, now))
|
|
34
|
+
return false;
|
|
35
|
+
entry.dispatched = true;
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
/** Only for a transport that definitely rejected submission before writing anything. */
|
|
39
|
+
notSubmitted(attachmentId) {
|
|
40
|
+
const entry = this.#entries.get(attachmentId);
|
|
41
|
+
if (!entry || entry.phase !== 'RESERVED' || !entry.dispatched)
|
|
42
|
+
return false;
|
|
43
|
+
this.#entries.delete(attachmentId);
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
prepared(attachmentId, nodeId, generation, now) {
|
|
47
|
+
const entry = this.#nodeEntry(attachmentId, nodeId, generation);
|
|
48
|
+
if (!entry || entry.phase !== 'RESERVED' || !entry.dispatched || this.#expired(entry, now))
|
|
49
|
+
return false;
|
|
50
|
+
entry.phase = 'PREPARED';
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
open(attachmentId, nodeId, generation, now) {
|
|
54
|
+
const entry = this.#nodeEntry(attachmentId, nodeId, generation);
|
|
55
|
+
if (!entry || entry.phase !== 'PREPARED' || this.#expired(entry, now))
|
|
56
|
+
return false;
|
|
57
|
+
entry.phase = 'SETTING_UP';
|
|
58
|
+
entry.setupExpiresAt = now + SETUP_MS;
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
attached(attachmentId, nodeId, generation, now) {
|
|
62
|
+
const entry = this.#nodeEntry(attachmentId, nodeId, generation);
|
|
63
|
+
if (!entry || entry.phase !== 'SETTING_UP' || this.#expired(entry, now))
|
|
64
|
+
return false;
|
|
65
|
+
entry.phase = 'ATTACHED';
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
browserReady(attachmentId, identity, now) {
|
|
69
|
+
const entry = this.#browserEntry(attachmentId, identity);
|
|
70
|
+
// The page's data channel can outrun Node lifecycle events on the control connection.
|
|
71
|
+
if (!entry ||
|
|
72
|
+
!['PREPARED', 'SETTING_UP', 'ATTACHED'].includes(entry.phase) ||
|
|
73
|
+
entry.browserReady ||
|
|
74
|
+
this.#expired(entry, now))
|
|
75
|
+
return false;
|
|
76
|
+
entry.browserReady = true;
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
active(attachmentId, nodeId, generation, now) {
|
|
80
|
+
const entry = this.#nodeEntry(attachmentId, nodeId, generation);
|
|
81
|
+
if (!entry || entry.phase !== 'ATTACHED' || !entry.browserReady || this.#expired(entry, now))
|
|
82
|
+
return false;
|
|
83
|
+
entry.phase = 'ACTIVE';
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
heartbeat(attachmentId, identity, now) {
|
|
87
|
+
const entry = this.#browserEntry(attachmentId, identity);
|
|
88
|
+
if (!entry || entry.phase === 'CLOSING' || this.#expired(entry, now))
|
|
89
|
+
return false;
|
|
90
|
+
entry.expiresAt = now + LEASE_MS;
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
/** Close is synchronous to fence admission; dispatched entries remain until Node settles. */
|
|
94
|
+
beginClose(attachmentId) {
|
|
95
|
+
const entry = this.#entries.get(attachmentId);
|
|
96
|
+
if (!entry || entry.phase === 'CLOSING')
|
|
97
|
+
return undefined;
|
|
98
|
+
entry.phase = 'CLOSING';
|
|
99
|
+
if (!entry.dispatched)
|
|
100
|
+
this.#entries.delete(attachmentId);
|
|
101
|
+
return { ...entry };
|
|
102
|
+
}
|
|
103
|
+
closeForBrowser(attachmentId, identity) {
|
|
104
|
+
return this.#browserEntry(attachmentId, identity) ? this.beginClose(attachmentId) : undefined;
|
|
105
|
+
}
|
|
106
|
+
closeForConnection(connectionId, path) {
|
|
107
|
+
for (const entry of this.#entries.values()) {
|
|
108
|
+
if (entry.workbenchConnectionId === connectionId && (!path || entry.path === path))
|
|
109
|
+
entry.pageGone = true;
|
|
110
|
+
}
|
|
111
|
+
return this.#closeMatching((entry) => entry.workbenchConnectionId === connectionId && (!path || entry.path === path));
|
|
112
|
+
}
|
|
113
|
+
/** After a page is gone and its lease expires, Node owns any remaining cleanup. */
|
|
114
|
+
retireExpiredGonePages(now, path) {
|
|
115
|
+
const retired = [];
|
|
116
|
+
for (const entry of this.#entries.values()) {
|
|
117
|
+
if (entry.path !== path ||
|
|
118
|
+
!entry.pageGone ||
|
|
119
|
+
entry.phase !== 'CLOSING' ||
|
|
120
|
+
now < entry.expiresAt)
|
|
121
|
+
continue;
|
|
122
|
+
retired.push({ ...entry });
|
|
123
|
+
this.#entries.delete(entry.attachmentId);
|
|
124
|
+
}
|
|
125
|
+
return retired;
|
|
126
|
+
}
|
|
127
|
+
closeForSession(sessionHash, path) {
|
|
128
|
+
return this.#closeMatching((entry) => entry.sessionHash === sessionHash && (!path || entry.path === path));
|
|
129
|
+
}
|
|
130
|
+
closeForUser(userId, path) {
|
|
131
|
+
return this.#closeMatching((entry) => entry.userId === userId && (!path || entry.path === path));
|
|
132
|
+
}
|
|
133
|
+
closeForNode(nodeId, path) {
|
|
134
|
+
return this.#closeMatching((entry) => entry.nodeId === nodeId && (!path || entry.path === path));
|
|
135
|
+
}
|
|
136
|
+
/** Forget old-process bookkeeping, without asserting that native cleanup completed. */
|
|
137
|
+
retireOtherGenerations(nodeId, currentGeneration, path) {
|
|
138
|
+
const retired = [];
|
|
139
|
+
for (const entry of this.#entries.values()) {
|
|
140
|
+
if (entry.nodeId !== nodeId ||
|
|
141
|
+
entry.nodeGeneration === currentGeneration ||
|
|
142
|
+
entry.path !== path)
|
|
143
|
+
continue;
|
|
144
|
+
retired.push({ ...entry });
|
|
145
|
+
this.#entries.delete(entry.attachmentId);
|
|
146
|
+
}
|
|
147
|
+
return retired;
|
|
148
|
+
}
|
|
149
|
+
closeAll(path) {
|
|
150
|
+
return this.#closeMatching((entry) => !path || entry.path === path);
|
|
151
|
+
}
|
|
152
|
+
settled(attachmentId, nodeId, generation) {
|
|
153
|
+
const entry = this.#nodeEntry(attachmentId, nodeId, generation);
|
|
154
|
+
if (!entry || entry.phase !== 'CLOSING')
|
|
155
|
+
return false;
|
|
156
|
+
this.#entries.delete(attachmentId);
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
expire(now, path) {
|
|
160
|
+
return this.#closeMatching((entry) => (!path || entry.path === path) && this.#expired(entry, now));
|
|
161
|
+
}
|
|
162
|
+
/** Dispatched closures are retried until the owning Node confirms cleanup. */
|
|
163
|
+
pendingClosures(path) {
|
|
164
|
+
return [...this.#entries.values()]
|
|
165
|
+
.filter((entry) => entry.path === path && entry.phase === 'CLOSING' && entry.dispatched)
|
|
166
|
+
.map((entry) => ({ ...entry }));
|
|
167
|
+
}
|
|
168
|
+
#closeMatching(predicate) {
|
|
169
|
+
const expired = [];
|
|
170
|
+
for (const entry of this.#entries.values()) {
|
|
171
|
+
if (entry.phase !== 'CLOSING' && predicate(entry)) {
|
|
172
|
+
const closing = this.beginClose(entry.attachmentId);
|
|
173
|
+
if (closing)
|
|
174
|
+
expired.push(closing);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return expired;
|
|
178
|
+
}
|
|
179
|
+
#expired(entry, now) {
|
|
180
|
+
return (entry.expiresAt <= now ||
|
|
181
|
+
((entry.phase === 'RESERVED' || entry.phase === 'PREPARED') && entry.openExpiresAt <= now) ||
|
|
182
|
+
((entry.phase === 'SETTING_UP' || entry.phase === 'ATTACHED') && entry.setupExpiresAt <= now));
|
|
183
|
+
}
|
|
184
|
+
#nodeEntry(id, nodeId, generation) {
|
|
185
|
+
const entry = this.#entries.get(id);
|
|
186
|
+
return entry?.nodeId === nodeId && entry.nodeGeneration === generation ? entry : undefined;
|
|
187
|
+
}
|
|
188
|
+
#browserEntry(id, identity) {
|
|
189
|
+
const entry = this.#entries.get(id);
|
|
190
|
+
return entry &&
|
|
191
|
+
entry.userId === identity.userId &&
|
|
192
|
+
entry.sessionHash === identity.sessionHash &&
|
|
193
|
+
entry.workbenchConnectionId === identity.workbenchConnectionId
|
|
194
|
+
? entry
|
|
195
|
+
: undefined;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { RemoteDesktopDirectBrowserMessage, RemoteDesktopDirectNodeCommand, RemoteDesktopDirectNodeEvent, RemoteDesktopDirectServerMessage } from '@myagentroam/protocol';
|
|
2
|
+
import type { DirectTransferBrowserIdentity, DirectTransferCoordinator } from './direct-transfer-coordinator.js';
|
|
3
|
+
import { RemoteDesktopAdmission } from './remote-desktop-admission.js';
|
|
4
|
+
type Prepare = Extract<RemoteDesktopDirectBrowserMessage, {
|
|
5
|
+
type: 'desktop.direct.prepare';
|
|
6
|
+
}>;
|
|
7
|
+
type Delivery = 'delivered' | 'unavailable' | 'authorization-revoked';
|
|
8
|
+
export interface RemoteDesktopDirectOptions {
|
|
9
|
+
readonly admission: RemoteDesktopAdmission;
|
|
10
|
+
readonly transport: Pick<DirectTransferCoordinator, 'authorizedTransport'>;
|
|
11
|
+
readonly authorize: (userId: number, nodeId: string, mode: 'VIEW' | 'CONTROL') => boolean | Promise<boolean>;
|
|
12
|
+
/** Checks the current native description and Node capability. */
|
|
13
|
+
readonly preflight: (request: Prepare, identity: DirectTransferBrowserIdentity, signal: AbortSignal) => Promise<unknown>;
|
|
14
|
+
/** false means the command was not submitted to the Node connection. */
|
|
15
|
+
readonly sendNode: (nodeId: string, command: RemoteDesktopDirectNodeCommand) => boolean;
|
|
16
|
+
readonly sendBrowser: (connectionId: string, message: RemoteDesktopDirectServerMessage) => Promise<Delivery>;
|
|
17
|
+
readonly now?: () => number;
|
|
18
|
+
}
|
|
19
|
+
/** Owns Direct authorization messages; admission and transport are shared external owners. */
|
|
20
|
+
export declare class RemoteDesktopDirectCoordinator {
|
|
21
|
+
#private;
|
|
22
|
+
private readonly options;
|
|
23
|
+
constructor(options: RemoteDesktopDirectOptions);
|
|
24
|
+
handleBrowser(identity: DirectTransferBrowserIdentity, message: RemoteDesktopDirectBrowserMessage): Promise<void>;
|
|
25
|
+
onNodeEvent(nodeId: string, nodeGeneration: string, event: RemoteDesktopDirectNodeEvent): Promise<void>;
|
|
26
|
+
revokeConnection(id: string, code?: string): void;
|
|
27
|
+
revokeSession(id: string): void;
|
|
28
|
+
revokeUser(id: number): void;
|
|
29
|
+
revokeNode(id: string, code?: string): void;
|
|
30
|
+
retireOtherGenerations(nodeId: string, currentGeneration: string): void;
|
|
31
|
+
close(): void;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { randomBytes } from 'node:crypto';
|
|
2
|
+
import { NodeRequestError } from './node-request-error.js';
|
|
3
|
+
function untilAbort(promise, signal) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
const abort = () => reject(new Error('Desktop operation expired'));
|
|
6
|
+
signal.addEventListener('abort', abort, { once: true });
|
|
7
|
+
promise.then((value) => {
|
|
8
|
+
signal.removeEventListener('abort', abort);
|
|
9
|
+
resolve(value);
|
|
10
|
+
}, (error) => {
|
|
11
|
+
signal.removeEventListener('abort', abort);
|
|
12
|
+
reject(error);
|
|
13
|
+
});
|
|
14
|
+
if (signal.aborted)
|
|
15
|
+
abort();
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/** Owns Direct authorization messages; admission and transport are shared external owners. */
|
|
19
|
+
export class RemoteDesktopDirectCoordinator {
|
|
20
|
+
options;
|
|
21
|
+
#records = new Map();
|
|
22
|
+
#nodeEvents = new Map();
|
|
23
|
+
#nodeEventCounts = new Map();
|
|
24
|
+
#now;
|
|
25
|
+
#timer;
|
|
26
|
+
#closed = false;
|
|
27
|
+
constructor(options) {
|
|
28
|
+
this.options = options;
|
|
29
|
+
const epoch = Date.now() - performance.now();
|
|
30
|
+
this.#now = options.now ?? (() => Math.floor(epoch + performance.now()));
|
|
31
|
+
this.#timer = setInterval(() => {
|
|
32
|
+
this.#closeEntries(this.options.admission.expire(this.#now(), 'DIRECT'), 'DESKTOP_TIMEOUT');
|
|
33
|
+
for (const entry of this.options.admission.retireExpiredGonePages(this.#now(), 'DIRECT'))
|
|
34
|
+
this.#records.delete(entry.attachmentId);
|
|
35
|
+
for (const entry of this.options.admission.pendingClosures('DIRECT'))
|
|
36
|
+
this.#sendNode(entry.nodeId, {
|
|
37
|
+
type: 'desktop.direct.cancel',
|
|
38
|
+
attachmentId: entry.attachmentId,
|
|
39
|
+
code: this.#records.get(entry.attachmentId)?.closeCode ?? 'DESKTOP_CANCELLED'
|
|
40
|
+
});
|
|
41
|
+
}, 1000);
|
|
42
|
+
this.#timer.unref();
|
|
43
|
+
}
|
|
44
|
+
async handleBrowser(identity, message) {
|
|
45
|
+
if (message.type === 'desktop.direct.prepare')
|
|
46
|
+
return this.#prepare(identity, message);
|
|
47
|
+
const entry = this.options.admission.get(message.attachmentId);
|
|
48
|
+
const record = this.#records.get(message.attachmentId);
|
|
49
|
+
if (!entry || entry.path !== 'DIRECT' || !record || !this.#samePage(entry, identity))
|
|
50
|
+
return;
|
|
51
|
+
if (message.type === 'desktop.direct.cancel') {
|
|
52
|
+
this.#closeEntries([this.options.admission.beginClose(entry.attachmentId)], 'DESKTOP_CANCELLED');
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (!(await this.#authorized(entry, record)) || !this.#current(entry.attachmentId, record)) {
|
|
56
|
+
this.#closeEntries([this.options.admission.beginClose(entry.attachmentId)], 'DESKTOP_NOT_AUTHORIZED');
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (message.type === 'desktop.ready') {
|
|
60
|
+
if (!this.options.admission.browserReady(entry.attachmentId, identity, this.#now()))
|
|
61
|
+
return;
|
|
62
|
+
if (!this.#sendNode(entry.nodeId, { type: 'desktop.ready', attachmentId: entry.attachmentId }))
|
|
63
|
+
this.#closeEntries([this.options.admission.beginClose(entry.attachmentId)], 'NODE_OFFLINE');
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (!this.options.admission.heartbeat(entry.attachmentId, identity, this.#now()))
|
|
67
|
+
return;
|
|
68
|
+
const current = this.options.admission.get(entry.attachmentId);
|
|
69
|
+
if (!this.#sendNode(entry.nodeId, {
|
|
70
|
+
type: 'desktop.direct.heartbeat',
|
|
71
|
+
attachmentId: entry.attachmentId,
|
|
72
|
+
expiresAt: current.expiresAt
|
|
73
|
+
})) {
|
|
74
|
+
this.#closeEntries([this.options.admission.beginClose(entry.attachmentId)], 'NODE_OFFLINE');
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const delivered = await this.#sendBrowser(entry.workbenchConnectionId, {
|
|
78
|
+
type: 'desktop.direct.heartbeat',
|
|
79
|
+
attachmentId: entry.attachmentId,
|
|
80
|
+
expiresAt: current.expiresAt
|
|
81
|
+
});
|
|
82
|
+
if (delivered !== 'delivered')
|
|
83
|
+
this.#closeEntries([this.options.admission.beginClose(entry.attachmentId)], 'DESKTOP_CONTROL_UNAVAILABLE');
|
|
84
|
+
}
|
|
85
|
+
onNodeEvent(nodeId, nodeGeneration, event) {
|
|
86
|
+
if (event.nodeGeneration !== nodeGeneration)
|
|
87
|
+
return Promise.resolve();
|
|
88
|
+
if (event.type === 'desktop.direct.closed')
|
|
89
|
+
return this.#handleNodeEvent(nodeId, nodeGeneration, event);
|
|
90
|
+
const entry = this.options.admission.get(event.attachmentId);
|
|
91
|
+
if (!entry ||
|
|
92
|
+
entry.path !== 'DIRECT' ||
|
|
93
|
+
!this.#records.has(event.attachmentId) ||
|
|
94
|
+
entry.nodeId !== nodeId ||
|
|
95
|
+
entry.nodeGeneration !== nodeGeneration)
|
|
96
|
+
return Promise.resolve();
|
|
97
|
+
const count = this.#nodeEventCounts.get(event.attachmentId) ?? 0;
|
|
98
|
+
if (count >= 4) {
|
|
99
|
+
this.#closeEntries([this.options.admission.beginClose(event.attachmentId)], 'DESKTOP_PROTOCOL_ERROR');
|
|
100
|
+
return Promise.resolve();
|
|
101
|
+
}
|
|
102
|
+
this.#nodeEventCounts.set(event.attachmentId, count + 1);
|
|
103
|
+
const previous = this.#nodeEvents.get(event.attachmentId) ?? Promise.resolve();
|
|
104
|
+
const pending = previous.then(() => this.#handleNodeEvent(nodeId, nodeGeneration, event));
|
|
105
|
+
this.#nodeEvents.set(event.attachmentId, pending);
|
|
106
|
+
const release = () => {
|
|
107
|
+
const remaining = (this.#nodeEventCounts.get(event.attachmentId) ?? 1) - 1;
|
|
108
|
+
if (remaining)
|
|
109
|
+
this.#nodeEventCounts.set(event.attachmentId, remaining);
|
|
110
|
+
else
|
|
111
|
+
this.#nodeEventCounts.delete(event.attachmentId);
|
|
112
|
+
if (this.#nodeEvents.get(event.attachmentId) === pending)
|
|
113
|
+
this.#nodeEvents.delete(event.attachmentId);
|
|
114
|
+
};
|
|
115
|
+
void pending.then(release, release);
|
|
116
|
+
return pending;
|
|
117
|
+
}
|
|
118
|
+
async #handleNodeEvent(nodeId, nodeGeneration, event) {
|
|
119
|
+
const entry = this.options.admission.get(event.attachmentId);
|
|
120
|
+
const record = this.#records.get(event.attachmentId);
|
|
121
|
+
if (!entry || !record || entry.nodeId !== nodeId || entry.nodeGeneration !== nodeGeneration)
|
|
122
|
+
return;
|
|
123
|
+
if (event.type === 'desktop.direct.closed') {
|
|
124
|
+
this.options.admission.beginClose(entry.attachmentId);
|
|
125
|
+
if (this.options.admission.settled(entry.attachmentId, nodeId, nodeGeneration)) {
|
|
126
|
+
this.#records.delete(entry.attachmentId);
|
|
127
|
+
void this.#error(entry, entry.requestId, event.code, true);
|
|
128
|
+
if (entry.phase !== 'CLOSING')
|
|
129
|
+
await this.#sendBrowser(entry.workbenchConnectionId, {
|
|
130
|
+
type: 'desktop.direct.closed',
|
|
131
|
+
attachmentId: entry.attachmentId,
|
|
132
|
+
code: event.code
|
|
133
|
+
});
|
|
134
|
+
void this.#sendBrowser(entry.workbenchConnectionId, {
|
|
135
|
+
type: 'desktop.direct.settled',
|
|
136
|
+
attachmentId: entry.attachmentId,
|
|
137
|
+
code: event.code
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (!(await this.#authorized(entry, record)) || !this.#current(entry.attachmentId, record)) {
|
|
143
|
+
this.#closeEntries([this.options.admission.beginClose(entry.attachmentId)], 'DESKTOP_NOT_AUTHORIZED');
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const now = this.#now();
|
|
147
|
+
if (event.phase === 'OPEN') {
|
|
148
|
+
if (!this.options.admission.open(entry.attachmentId, nodeId, nodeGeneration, now))
|
|
149
|
+
this.#closeEntries([this.options.admission.beginClose(entry.attachmentId)], 'DESKTOP_PROTOCOL_ERROR');
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (event.phase === 'ATTACHED') {
|
|
153
|
+
if (!this.options.admission.attached(entry.attachmentId, nodeId, nodeGeneration, now))
|
|
154
|
+
this.#closeEntries([this.options.admission.beginClose(entry.attachmentId)], 'DESKTOP_PROTOCOL_ERROR');
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
if (event.phase === 'ACTIVE') {
|
|
158
|
+
if (!this.options.admission.active(entry.attachmentId, nodeId, nodeGeneration, now))
|
|
159
|
+
this.#closeEntries([this.options.admission.beginClose(entry.attachmentId)], 'DESKTOP_PROTOCOL_ERROR');
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (!this.options.admission.prepared(entry.attachmentId, nodeId, nodeGeneration, now)) {
|
|
163
|
+
this.#closeEntries([this.options.admission.beginClose(entry.attachmentId)], 'DESKTOP_PROTOCOL_ERROR');
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const current = this.options.admission.get(entry.attachmentId);
|
|
167
|
+
const delivered = await this.#sendBrowser(entry.workbenchConnectionId, {
|
|
168
|
+
type: 'desktop.direct.prepared',
|
|
169
|
+
requestId: entry.requestId,
|
|
170
|
+
attachmentId: entry.attachmentId,
|
|
171
|
+
grant: record.grant,
|
|
172
|
+
openExpiresAt: current.openExpiresAt,
|
|
173
|
+
expiresAt: current.expiresAt
|
|
174
|
+
});
|
|
175
|
+
if (delivered !== 'delivered')
|
|
176
|
+
this.#closeEntries([this.options.admission.beginClose(entry.attachmentId)], 'DESKTOP_CONTROL_UNAVAILABLE');
|
|
177
|
+
}
|
|
178
|
+
revokeConnection(id, code = 'DESKTOP_NOT_AUTHORIZED') {
|
|
179
|
+
this.#closeEntries(this.options.admission.closeForConnection(id, 'DIRECT'), code);
|
|
180
|
+
}
|
|
181
|
+
revokeSession(id) {
|
|
182
|
+
this.#closeEntries(this.options.admission.closeForSession(id, 'DIRECT'), 'DESKTOP_NOT_AUTHORIZED');
|
|
183
|
+
}
|
|
184
|
+
revokeUser(id) {
|
|
185
|
+
this.#closeEntries(this.options.admission.closeForUser(id, 'DIRECT'), 'DESKTOP_NOT_AUTHORIZED');
|
|
186
|
+
}
|
|
187
|
+
revokeNode(id, code = 'NODE_OFFLINE') {
|
|
188
|
+
this.#closeEntries(this.options.admission.closeForNode(id, 'DIRECT'), code);
|
|
189
|
+
}
|
|
190
|
+
retireOtherGenerations(nodeId, currentGeneration) {
|
|
191
|
+
for (const entry of this.options.admission.retireOtherGenerations(nodeId, currentGeneration, 'DIRECT')) {
|
|
192
|
+
this.#records.delete(entry.attachmentId);
|
|
193
|
+
if (entry.phase !== 'CLOSING')
|
|
194
|
+
void this.#sendBrowser(entry.workbenchConnectionId, {
|
|
195
|
+
type: 'desktop.direct.closed',
|
|
196
|
+
attachmentId: entry.attachmentId,
|
|
197
|
+
code: 'NODE_CONNECTION_REPLACED'
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
close() {
|
|
202
|
+
if (this.#closed)
|
|
203
|
+
return;
|
|
204
|
+
this.#closed = true;
|
|
205
|
+
clearInterval(this.#timer);
|
|
206
|
+
this.#closeEntries(this.options.admission.closeAll('DIRECT'), 'DESKTOP_SERVER_SHUTDOWN');
|
|
207
|
+
}
|
|
208
|
+
async #prepare(identity, request) {
|
|
209
|
+
const transport = () => {
|
|
210
|
+
try {
|
|
211
|
+
return this.options.transport.authorizedTransport(identity, request.transportSessionId, request.nodeId, request.nodeGeneration);
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
return undefined;
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
if (this.#closed || !transport()) {
|
|
218
|
+
await this.#error(identity, request.requestId, 'DESKTOP_CONTROL_UNAVAILABLE', true);
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const attachmentId = randomBytes(24).toString('base64url');
|
|
222
|
+
const grant = randomBytes(32).toString('base64url');
|
|
223
|
+
const now = this.#now();
|
|
224
|
+
const entry = this.options.admission.reserve({
|
|
225
|
+
...identity,
|
|
226
|
+
attachmentId,
|
|
227
|
+
requestId: request.requestId,
|
|
228
|
+
nodeId: request.nodeId,
|
|
229
|
+
nodeGeneration: request.nodeGeneration,
|
|
230
|
+
desktopGeneration: request.desktopGeneration,
|
|
231
|
+
topologyRevision: request.topologyRevision,
|
|
232
|
+
mode: request.mode,
|
|
233
|
+
path: 'DIRECT'
|
|
234
|
+
}, now);
|
|
235
|
+
if (!entry) {
|
|
236
|
+
await this.#error(identity, request.requestId, 'DESKTOP_CONTROL_UNAVAILABLE', true);
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
const deadline = AbortSignal.timeout(15_000);
|
|
240
|
+
let failureCode = 'DESKTOP_CONTROL_UNAVAILABLE';
|
|
241
|
+
try {
|
|
242
|
+
if (!(await untilAbort(Promise.resolve(this.options.authorize(identity.userId, request.nodeId, request.mode)), deadline))) {
|
|
243
|
+
failureCode = 'DESKTOP_NOT_AUTHORIZED';
|
|
244
|
+
throw new Error();
|
|
245
|
+
}
|
|
246
|
+
await untilAbort(this.options.preflight(request, identity, deadline), deadline);
|
|
247
|
+
if (!(await untilAbort(Promise.resolve(this.options.authorize(identity.userId, request.nodeId, request.mode)), deadline))) {
|
|
248
|
+
failureCode = 'DESKTOP_NOT_AUTHORIZED';
|
|
249
|
+
throw new Error();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
if (error instanceof NodeRequestError &&
|
|
254
|
+
[
|
|
255
|
+
'DESKTOP_TOPOLOGY_UNAVAILABLE',
|
|
256
|
+
'DESKTOP_SESSION_UNAVAILABLE',
|
|
257
|
+
'DESKTOP_UNAVAILABLE'
|
|
258
|
+
].includes(error.code))
|
|
259
|
+
failureCode = error.code;
|
|
260
|
+
this.options.admission.beginClose(attachmentId);
|
|
261
|
+
await this.#error(identity, request.requestId, failureCode, true);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
const current = transport();
|
|
265
|
+
// Admission revocation removes only matching pending reservations before dispatch.
|
|
266
|
+
if (this.#closed || !current || !this.options.admission.dispatched(attachmentId, this.#now())) {
|
|
267
|
+
this.options.admission.beginClose(attachmentId);
|
|
268
|
+
await this.#error(identity, request.requestId, 'DESKTOP_CONTROL_UNAVAILABLE', true);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
this.#records.set(attachmentId, {
|
|
272
|
+
transportSessionId: request.transportSessionId,
|
|
273
|
+
grant,
|
|
274
|
+
...current
|
|
275
|
+
});
|
|
276
|
+
const command = {
|
|
277
|
+
type: 'desktop.direct.prepare',
|
|
278
|
+
attachmentId,
|
|
279
|
+
transportSessionId: request.transportSessionId,
|
|
280
|
+
workbenchConnectionId: entry.workbenchConnectionId,
|
|
281
|
+
nodeGeneration: entry.nodeGeneration,
|
|
282
|
+
desktopGeneration: entry.desktopGeneration,
|
|
283
|
+
topologyRevision: entry.topologyRevision,
|
|
284
|
+
mode: entry.mode,
|
|
285
|
+
grant,
|
|
286
|
+
browserFingerprint: current.browserFingerprint,
|
|
287
|
+
nodeFingerprint: current.nodeFingerprint,
|
|
288
|
+
openExpiresAt: entry.openExpiresAt,
|
|
289
|
+
expiresAt: entry.expiresAt
|
|
290
|
+
};
|
|
291
|
+
let sent;
|
|
292
|
+
try {
|
|
293
|
+
sent = this.options.sendNode(entry.nodeId, command);
|
|
294
|
+
}
|
|
295
|
+
catch {
|
|
296
|
+
// Submission is ambiguous: fence and retain the record until Node confirms cleanup.
|
|
297
|
+
this.#closeEntries([this.options.admission.beginClose(attachmentId)], 'NODE_OFFLINE');
|
|
298
|
+
await this.#error(identity, request.requestId, 'NODE_OFFLINE');
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
if (!sent) {
|
|
302
|
+
const notSubmitted = this.options.admission.notSubmitted(attachmentId);
|
|
303
|
+
if (notSubmitted)
|
|
304
|
+
this.#records.delete(attachmentId);
|
|
305
|
+
else
|
|
306
|
+
this.#closeEntries([this.options.admission.beginClose(attachmentId)], 'NODE_OFFLINE');
|
|
307
|
+
await this.#error(identity, request.requestId, 'NODE_OFFLINE', notSubmitted);
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
async #authorized(entry, record) {
|
|
312
|
+
try {
|
|
313
|
+
const transportMatches = () => {
|
|
314
|
+
const current = this.options.transport.authorizedTransport(entry, record.transportSessionId, entry.nodeId, entry.nodeGeneration);
|
|
315
|
+
return (current?.browserFingerprint === record.browserFingerprint &&
|
|
316
|
+
current.nodeFingerprint === record.nodeFingerprint);
|
|
317
|
+
};
|
|
318
|
+
return (transportMatches() &&
|
|
319
|
+
(await untilAbort(Promise.resolve(this.options.authorize(entry.userId, entry.nodeId, entry.mode)), AbortSignal.timeout(10_000))) &&
|
|
320
|
+
transportMatches());
|
|
321
|
+
}
|
|
322
|
+
catch {
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
#current(id, record) {
|
|
327
|
+
const entry = this.options.admission.get(id);
|
|
328
|
+
return (!this.#closed && this.#records.get(id) === record && !!entry && entry.phase !== 'CLOSING');
|
|
329
|
+
}
|
|
330
|
+
#samePage(a, b) {
|
|
331
|
+
return (a.userId === b.userId &&
|
|
332
|
+
a.sessionHash === b.sessionHash &&
|
|
333
|
+
a.workbenchConnectionId === b.workbenchConnectionId);
|
|
334
|
+
}
|
|
335
|
+
#closeEntries(entries, code) {
|
|
336
|
+
for (const entry of entries) {
|
|
337
|
+
if (!entry || entry.path !== 'DIRECT')
|
|
338
|
+
continue;
|
|
339
|
+
const record = this.#records.get(entry.attachmentId);
|
|
340
|
+
if (record)
|
|
341
|
+
record.closeCode = code;
|
|
342
|
+
if (entry.dispatched)
|
|
343
|
+
this.#sendNode(entry.nodeId, {
|
|
344
|
+
type: 'desktop.direct.cancel',
|
|
345
|
+
attachmentId: entry.attachmentId,
|
|
346
|
+
code
|
|
347
|
+
});
|
|
348
|
+
else
|
|
349
|
+
this.#records.delete(entry.attachmentId);
|
|
350
|
+
void this.#sendBrowser(entry.workbenchConnectionId, {
|
|
351
|
+
type: 'desktop.direct.closed',
|
|
352
|
+
attachmentId: entry.attachmentId,
|
|
353
|
+
code
|
|
354
|
+
});
|
|
355
|
+
if (!entry.dispatched)
|
|
356
|
+
void this.#sendBrowser(entry.workbenchConnectionId, {
|
|
357
|
+
type: 'desktop.direct.settled',
|
|
358
|
+
attachmentId: entry.attachmentId,
|
|
359
|
+
code
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
#sendNode(nodeId, command) {
|
|
364
|
+
try {
|
|
365
|
+
return this.options.sendNode(nodeId, command);
|
|
366
|
+
}
|
|
367
|
+
catch {
|
|
368
|
+
return false;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
async #sendBrowser(connectionId, message) {
|
|
372
|
+
try {
|
|
373
|
+
return await untilAbort(this.options.sendBrowser(connectionId, message), AbortSignal.timeout(10_000));
|
|
374
|
+
}
|
|
375
|
+
catch {
|
|
376
|
+
return 'unavailable';
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
async #error(identity, requestId, code, settled = false) {
|
|
380
|
+
await this.#sendBrowser(identity.workbenchConnectionId, {
|
|
381
|
+
type: 'desktop.direct.error',
|
|
382
|
+
requestId,
|
|
383
|
+
code,
|
|
384
|
+
...(settled ? { settled: true } : {}),
|
|
385
|
+
message: 'The desktop attachment could not be prepared.'
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { RemoteDesktopRelayBrowserMessage, RemoteDesktopRelayNodeCommand, RemoteDesktopRelayNodeEvent, RemoteDesktopRelayServerMessage } from '@myagentroam/protocol';
|
|
2
|
+
import type { DirectTransferBrowserIdentity } from './direct-transfer-coordinator.js';
|
|
3
|
+
import type { RemoteDesktopAdmission } from './remote-desktop-admission.js';
|
|
4
|
+
import type { RemoteDesktopRelayPairing } from './remote-desktop-relay-pairing.js';
|
|
5
|
+
type Prepare = Extract<RemoteDesktopRelayBrowserMessage, {
|
|
6
|
+
type: 'desktop.relay.prepare';
|
|
7
|
+
}>;
|
|
8
|
+
type Delivery = 'delivered' | 'unavailable' | 'authorization-revoked';
|
|
9
|
+
export interface RemoteDesktopRelayOptions {
|
|
10
|
+
readonly admission: RemoteDesktopAdmission;
|
|
11
|
+
readonly pairing: Pick<RemoteDesktopRelayPairing, 'prepare' | 'opened' | 'cancel'>;
|
|
12
|
+
readonly authorize: (userId: number, nodeId: string, mode: 'VIEW' | 'CONTROL') => boolean | Promise<boolean>;
|
|
13
|
+
readonly preflight: (request: Prepare, identity: DirectTransferBrowserIdentity, signal: AbortSignal) => Promise<unknown>;
|
|
14
|
+
readonly sendNode: (nodeId: string, command: RemoteDesktopRelayNodeCommand) => boolean;
|
|
15
|
+
readonly sendBrowser: (connectionId: string, message: RemoteDesktopRelayServerMessage) => Promise<Delivery>;
|
|
16
|
+
readonly now?: () => number;
|
|
17
|
+
}
|
|
18
|
+
/** Owns relay grants and control messages, not the paired socket I/O or native cleanup. */
|
|
19
|
+
export declare class RemoteDesktopRelayCoordinator {
|
|
20
|
+
#private;
|
|
21
|
+
private readonly options;
|
|
22
|
+
constructor(options: RemoteDesktopRelayOptions);
|
|
23
|
+
handleBrowser(identity: DirectTransferBrowserIdentity, message: RemoteDesktopRelayBrowserMessage): Promise<void>;
|
|
24
|
+
onNodeEvent(nodeId: string, generation: string, event: RemoteDesktopRelayNodeEvent): Promise<void>;
|
|
25
|
+
/** Pairing has already fenced admission before invoking this callback. */
|
|
26
|
+
pairingClosed(id: string): void;
|
|
27
|
+
revokeConnection(id: string): void;
|
|
28
|
+
revokeSession(id: string): void;
|
|
29
|
+
revokeUser(id: number): void;
|
|
30
|
+
revokeNode(id: string): void;
|
|
31
|
+
retireOtherGenerations(nodeId: string, currentGeneration: string): void;
|
|
32
|
+
close(): void;
|
|
33
|
+
}
|
|
34
|
+
export {};
|