@xopcai/xopc 0.0.445 → 0.0.446
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/assets/{auth-DAIwDtVp.js → auth-CQmxIyWw.js} +225 -8
- package/dist/browser-ext/dist/background.js +254 -16
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +3 -49
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-CuPXAoLe.js → activity-store-Ddf-02Rf.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-D92uHOFV.js → agent-avatar-dicebear-Dcu4ggpV.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-DINzeGs0.js → agent-avatar-display-CarpM_qc.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-rH1QpgiR.js → agent-defaults-settings-panel-B4GynTfH.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-B2vXlrDW.js → agent-plugin-dialog-BWQ_Diyv.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-lvQfOQPN.js → agents-DKaImiga.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-DPLtjJtX.js → agents-admin-api-BwoePPTG.js} +1 -1
- package/dist/gateway/static/root/assets/{api-snfMD8_Y.js → api-Cc72Y3ct.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CEzBruRJ.js → api-MJxs2HLk.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CONwDpqL.js → app-management-settings-panel-Cy6szt9g.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Bu7K-_ri.js → appearance-settings-Dy75gAe7.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-C3iDd3ZQ.js → apps-page-DlwW9ClN.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-CfLz9o-2.js → archive-plugin-_5jgYMZC.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-Dl9fi8t0.js → automation-api-DrxC4rCG.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-BjjZCxee.js → automation-result-state-Ba_q8_Jj.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-9IPHu_UC.js → automation-run-list-DuyMQwtf.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-CKbHMLSy.js → automation-task-card-D4Ojt-Q4.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-K3trjTZl.js → automations-page-D-Sl7Dhr.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-D7m3w_9B.js → automations-workspace-ND9J7xtt.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-Bv4ixxo4.js → binary-plugins-BYHCUreq.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CtaJSB9U.js → block-editor-DI_JHx-P.js} +3 -2
- package/dist/gateway/static/root/assets/{browser-settings-page-CmBsnx24.js → browser-settings-page-DXBM5lpK.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-DDJJhQ40.js → capabilities-CUHCbQ5N.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-DJYgOjeq.js → capabilities-C_mZ4wUq.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-CBqvHAyp.js → capabilities-page-RJnyR_V9.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-wjezs0OE.js → capabilities-settings-panel-CxSrK6bJ.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-D4q8hiD0.js → channels-CBXmRfVR.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-BOB3dILf.js → chat-agents-api-D6sJpLeT.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-DsaCatBN.js → chat-chart-block-B2U7epTQ.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-U5hc4rIa.js +72 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-D9o0nUEV.js → chat-terminal-dock-XNPvQhNw.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-Cj0_7g9o.js → command-palette-api-DbL0oPXq.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-CoDWKzBm.js → composer-payload-handoff-CaxZicbL.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-DJ9BIOHC.js → computer-settings-page-Velpw46s.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-C5-3MDIj.js → connected-providers-grid-Y79g354a.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-bD1sKiAp.js → connection-usage-guide-BaDoesqn.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BEq3i3Vi.js → connector-service-page-C5mVM3zg.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-DEExP6a7.js → connectors-api-Cgiy3Dyn.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-QVWuoxuK.js → connectors-page-DDSTfe3M.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-D2whl8Ci.js → date-picker-BCxU-AEv.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-qnIdmNnH.js → desktop-pet-D1buh7JC.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-C54b1FY4.js → desktop-pet-settings-CVs5timB.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-bryv5YRw.js → dev-view-store-rdp0Stsh.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-Du-yOxZv.js → device-pairing-wizard-ZX1oup6S.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-GsMkjw59.js → directory-picker-path-field-BN57kiUt.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-CrpDiC7J.js → discussion-annotation-sync-BG-sbtYu.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CDZfdMAR.js → extension-debug-page-DuuOhNRp.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-CG70QWPS.js → extension-iframe-host-DzzKhhvD.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-D7Av-sOf.js → extension-marketplace-api-5BBPFsmU.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DpJTL6-v.js → extension-page-DDmRVcIm.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-BZTbdvCF.js → extension-provider-CFzHYMV0.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CC4rmiFC.js → extension-settings-page-DGAD52bm.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-Dtla5oAW.js → file-preview-surface-DgG6OJyj.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-B5THNdYK.js → gateway-config-swr-D0yocd87.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-DpNC3Y7U.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-BQELP9Or.js +1 -0
- package/dist/gateway/static/root/assets/gateway-restart-C_8Z4DRU.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-CGlpz-Ft.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CqtCJzWJ.js → gateway-startup-retry-BPSM56sw.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-BQMdHLlp.js → global-defaults-api-BFsm77dC.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-Df3X6-Ko.js → home-page-UXS36f7M.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-G3tQFhif.js → image-generation-api-wJi7zpES.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BmEqiunH.js → imports-page-iddP3PVx.js} +1 -1
- package/dist/gateway/static/root/assets/index-D0p4v0SG.js +11 -0
- package/dist/gateway/static/root/assets/index-Uxz0OdzD.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-BU4l6KJv.js → install-connector-dialog-DSIVSJRz.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CtNI6i7K.js → keyboard-shortcuts-settings-Cxdd0r3Z.js} +1 -1
- package/dist/gateway/static/root/assets/languages-kF11aUYU.js +2 -0
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CE46mHc0.js → local-app-workbench-page-jfkZZHHd.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-DqZT5hLH.js → local-apps-page-BwWuY0x2.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-Bt_e3A8f.js → local-session-drafts-cTAkoNSf.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Bld7_m-Q.js → locale-store-DJYUYPdV.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-CzajqK40.js → logs-page-CuxC8O1E.js} +1 -1
- package/dist/gateway/static/root/assets/management-api-CmBUdfsn.js +1 -0
- package/dist/gateway/static/root/assets/management-settings-CYn1EOVo.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-editor-BuuGlcfG.js → markdown-editor-CjQJ-Nho.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-B3cFKCfO.js → markdown-view-DrcA6Cfr.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-ZcY1nqMO.js → mcp-conversation-setup-page-C5D5oueS.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DSOplRhW.js → media-plugins-CQZ0Jh_x.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-CGO1P4mz.js → messages-DziUGfxF.js} +2 -2
- package/dist/gateway/static/root/assets/{model-selector-yAKlOR3O.js → model-selector-CbKl8YPf.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-8V-ZpAIa.js → models-hub-cache-CwxnL3rY.js} +1 -1
- package/dist/gateway/static/root/assets/navigation-ByOzYT0t.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-uQO4kymH.js +7 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-CaO_VuWl.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-CVQqqmGI.js → notes-api-DoCb3QlH.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-DIugUbkV.js → notes-page-DOl7cqLg.js} +2 -2
- package/dist/gateway/static/root/assets/{oauth-api-DGa6PTuq.js → oauth-api-3b_QtYeo.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-Bc-KLH1e.js → oauth-provider-connect-D1JQ4FBf.js} +1 -1
- package/dist/gateway/static/root/assets/page-context-capture-button-CVIVl1MQ.js +1 -0
- package/dist/gateway/static/root/assets/{page-context-draft-GveHK8e2.js → page-context-draft-Ky5J09qv.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-Jt0XBQxm.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-Cu8lGBXZ.js → personal-avatar-Dh4qjZYy.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-BZWJKyZ8.js → personal-page-edoGNvVa.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-awr10jTV.js → personal-settings-panel-BtTwDaw0.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-CAxn3usD.js → phone-dependencies-card-B6rA2lO_.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-BBG3LxRP.js → phone-model-connection-xqaXDOVF.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-CfPjKpnd.js → phone-model-picker-yuGXKCM9.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-C4dJdwRW.js → phone-settings-page-DhjuPpF4.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-BKltFHtG.js → phone-workspace-store-2xQhZsJr.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-BqcFfZFH.js → plugin-details-dialog-CIS3SUKM.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-QlyIA8ve.js → preference-select-fields-BAZSKhoi.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-CRsfuAXl.js → product-automation-feedback-Bh37tBpR.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CQ4dk-_l.js → product-open-page-BXcS7lCW.js} +1 -1
- package/dist/gateway/static/root/assets/product-preview-content-BNultFGN.js +1 -0
- package/dist/gateway/static/root/assets/product-preview-modal-BTlUoG48.js +2 -0
- package/dist/gateway/static/root/assets/project-detail-page-DNvQzRnU.js +7 -0
- package/dist/gateway/static/root/assets/project-overview-model-DrLXaO-t.js +1 -0
- package/dist/gateway/static/root/assets/{project-understanding-CU2af95r.js → project-understanding-CrYVzB8i.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BsgZb6n9.js → projects-page-nEhOaONB.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-CspehmSU.js → providers-api-MimHCxo_.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-BOZAOdCI.js → recording-upload-BUe8jmx8.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-Bdp3UUyz.js → registry-api-CkrGCW-C.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-Bos3uwAT.js → remote-access-hub-QqFEiO0m.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-DJR3SCy6.js → resource-unavailable-CSc5SeHy.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-BTPpGwjV.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-DsbahxzE.js → runtime-tools-api-BzLDrYX8.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DW9_OFi2.js → runtime-tools-settings-panel-DST1lBFY.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-Bd1JDO5T.js → service-recommendation-list-DezuXPLs.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-DjnHJ-0n.js → session-api-QnBTnXGH.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-ChHnJOWW.js → session-manager-b2zxVzZI.js} +2 -2
- package/dist/gateway/static/root/assets/{sessions-page-BM-oqd22.js → sessions-page-uarYA2Xw.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Bq6eQ3It.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-CM44UlF8.js → settings-advanced-section-Crhl0mQp.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-Blc4C8aw.js → settings-mode-store-CrM7SFWJ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-irv-JoTz.js → settings-page-BrogpvEd.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-BYFaTD8a.js → settings-page-header-DPKy790x.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-CnUQSxT3.js → settings-page-layout-8kCWtU5m.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-DqaiLQ0I.js → setup-interaction-page-BVnMLwC-.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-iOYgfkoK.js → setup-status-panel--Fb7FwVG.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-C_uYNUlp.js → share-link-dialog-C45dGG9y.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CFebGqyB.js → share-preview-page-ConV6wRP.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-C2GDyqxP.js → shares-api-BsDhQwd3.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-B-7la3QN.js → shares-settings-DJz0p2PL.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-BnpTSZGc.js → skill-api-BrM5Ctxg.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-7MY9ewiu.js → skill-list-api-DWCkzC6W.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-DkDpu3Wd.js → skill-reload-api-C2jfZi01.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-sL2kGqHZ.js → skills-page-DbAc1Y4C.js} +1 -1
- package/dist/gateway/static/root/assets/{source-workspace-editor-kxosllTu.js → source-workspace-editor-BwYU5OEh.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BltKPJdb.js → system-settings-panel-BiswiIqg.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-6awKGnOr.js → task-detail-page-R0_AM-IE.js} +1 -1
- package/dist/gateway/static/root/assets/{task-result-evidence-Cy9txdqV.js → task-result-evidence-C1AEUu9S.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-DUEJoa1M.js → terminal-panel-store-qS6f2G-H.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DsvYj7Vy.js → theme-store-Docer0tD.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-B_Xdc2VF.js → tracing-settings-page-DiXHv8C3.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-B6BhWTh3.js → tunnel-api-UYBm3Hqd.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-B7rFXhDk.js → understanding-activity-store-CK6cQ0iJ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-DCFASve5.js → understanding-refresh-store-DVNqbtHk.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DqzosTxy.js → usage-page-DmA7kQI2.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DsqcLHV9.js → use-autosave-D1tFBLQO.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-ClakaDU1.js → use-composer-attachments-CwJslPRU.js} +1 -1
- package/dist/gateway/static/root/assets/use-file-preview-expanded-CK1OJENF.js +15 -0
- package/dist/gateway/static/root/assets/{use-personal-profile-T2e6P5Ed.js → use-personal-profile-CpsJdlEs.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-Dq0qgK3N.js → use-workspace-tree-CW9hcMwg.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-Ziz55hVM.js → user-model-page-BlYKXzCa.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-D7NPAc1E.js → voice-api-key-field-DD9V94Y7.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-UQDTh6hh.js → voice-config-api-Cr6IkfV2.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-SD2gZVg8.js → voice-input-shortcut-events-hsEdKDO6.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-Bf9FaI-p.js → voice-transcribe-api-DKain9tL.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-B41GOFXh.js → work-discovery-overlay-yYdAqtrO.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-NNhExALx.js → work-discovery-page-8hTykUqr.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-DeNWVFFK.js → working-directory-picker-modal-CXPSsy2J.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-DrVss2Fd.js → workspace-api-DNSoGsW8.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-ENv6zDBq.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-C2egBzza.js → workspace-file-preview-dialog-BVYsAXwp.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-XFUtwfLY.js → workspace-open-location-menu-DN7E_-eH.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-BlhFT1q9.js → xopc-cloud-account-card-CGs77iKb.js} +1 -1
- package/dist/gateway/static/root/index.html +83 -82
- package/dist/package.js +1 -1
- package/dist/packages/endpoint-tools-client/src/index.js +309 -17
- package/dist/packages/endpoint-tools-protocol/src/index.js +62 -10
- package/dist/packages/endpoint-tools-protocol/src/provider-execution.js +32 -0
- package/dist/packages/endpoint-tools-protocol/src/providers.js +233 -0
- package/dist/packages/gateway-contract/src/clarifications.js +1 -1
- package/dist/packages/gateway-contract/src/device-pairing.js +2 -1
- package/dist/packages/gateway-contract/src/device-request-proof.js +32 -0
- package/dist/packages/gateway-contract/src/index.js +2 -2
- package/dist/packages/realtime-client/src/index.js +1 -0
- package/dist/packages/realtime-protocol/src/index.js +4 -1
- package/dist/src/agent/agent-manager.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/commands/command-registry.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/embedded/session-runner.js +7 -2
- package/dist/src/agent/embedded/tool-metadata.d.ts +1 -1
- package/dist/src/agent/embedded/tool-search-extension.d.ts +1 -0
- package/dist/src/agent/embedded/tool-search-extension.js +35 -2
- package/dist/src/agent/external-tools/cliProvider.js +2 -2
- package/dist/src/agent/external-tools/composio-provider.js +2 -2
- package/dist/src/agent/external-tools/endpoint-provider.d.ts +3 -0
- package/dist/src/agent/external-tools/endpoint-provider.js +96 -18
- package/dist/src/agent/external-tools/index.js +2 -2
- package/dist/src/agent/external-tools/personal-request-scope.js +6 -0
- package/dist/src/agent/external-tools/read-policy.js +15 -8
- package/dist/src/agent/external-tools/service.js +8 -0
- package/dist/src/agent/external-tools/types.d.ts +1 -0
- package/dist/src/agent/inbound/inbound-loop.js +2 -1
- package/dist/src/agent/mcp/continuation-guard.js +1 -1
- package/dist/src/agent/mcp/conversation-setup.js +1 -1
- package/dist/src/agent/mcp/discovery.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.d.ts +2 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +6 -5
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +2 -0
- package/dist/src/agent/tools/clarify-tool.d.ts +1 -0
- package/dist/src/agent/tools/device-use-tool.d.ts +9 -0
- package/dist/src/agent/tools/device-use-tool.js +158 -0
- package/dist/src/agent/tools/factory.js +24 -3
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/automations/api/routes.js +2 -2
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/write.js +1 -1
- package/dist/src/automations/configuration-conversation.js +1 -1
- package/dist/src/automations/mcp-source.js +1 -1
- package/dist/src/automations/service/action-executor.js +10 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/browser/remote/device-driver.js +7 -3
- package/dist/src/browser/remote/device-target.d.ts +1 -1
- package/dist/src/browser/remote/device-target.js +8 -6
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/channels/lifecycle-supervisor.js +2 -1
- package/dist/src/channels/verified-inbound.d.ts +13 -0
- package/dist/src/channels/verified-inbound.js +29 -0
- package/dist/src/cli/command-loaders.js +1 -0
- package/dist/src/cli/command-manifest.js +4 -0
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/device-host.d.ts +1 -0
- package/dist/src/cli/commands/device-host.js +52 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/index.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/computer/diagnostics.d.ts +3 -3
- package/dist/src/computer/endpoint-transport.js +1 -1
- package/dist/src/computer/errors.js +4 -0
- package/dist/src/computer/evaluation.d.ts +2 -2
- package/dist/src/computer/flows.js +1 -1
- package/dist/src/computer/runtime.d.ts +1 -0
- package/dist/src/computer/runtime.js +25 -3
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/schema.d.ts +2 -0
- package/dist/src/config/schema.js +1 -0
- package/dist/src/connectors/composio-triggers.js +1 -1
- package/dist/src/endpoint-tools/bridge-host.d.ts +5 -4
- package/dist/src/endpoint-tools/bridge-host.js +165 -30
- package/dist/src/endpoint-tools/bridge.d.ts +1 -1
- package/dist/src/endpoint-tools/bridge.js +39 -7
- package/dist/src/endpoint-tools/capability-catalog.d.ts +1 -1
- package/dist/src/endpoint-tools/capability-catalog.js +1 -1
- package/dist/src/endpoint-tools/delegation.d.ts +60 -0
- package/dist/src/endpoint-tools/delegation.js +130 -0
- package/dist/src/endpoint-tools/desktop-execution.js +1 -1
- package/dist/src/endpoint-tools/device-host.d.ts +98 -0
- package/dist/src/endpoint-tools/device-host.js +89 -0
- package/dist/src/endpoint-tools/execution-actor.d.ts +6 -0
- package/dist/src/endpoint-tools/execution-actor.js +53 -0
- package/dist/src/endpoint-tools/grant-service.d.ts +7 -4
- package/dist/src/endpoint-tools/grant-service.js +12 -4
- package/dist/src/endpoint-tools/host-credentials.d.ts +42 -0
- package/dist/src/endpoint-tools/host-credentials.js +144 -0
- package/dist/src/endpoint-tools/index.d.ts +1 -1
- package/dist/src/endpoint-tools/index.js +3 -3
- package/dist/src/endpoint-tools/invocation-service.d.ts +47 -4
- package/dist/src/endpoint-tools/invocation-service.js +328 -36
- package/dist/src/endpoint-tools/mcp-provider.d.ts +32 -0
- package/dist/src/endpoint-tools/mcp-provider.js +258 -0
- package/dist/src/endpoint-tools/policy.js +0 -3
- package/dist/src/endpoint-tools/provider-catalog.d.ts +45 -0
- package/dist/src/endpoint-tools/provider-catalog.js +202 -0
- package/dist/src/endpoint-tools/provider-operation-journal.d.ts +18 -0
- package/dist/src/endpoint-tools/provider-operation-journal.js +111 -0
- package/dist/src/endpoint-tools/provider-operation-status.d.ts +33 -0
- package/dist/src/endpoint-tools/provider-operation-status.js +80 -0
- package/dist/src/endpoint-tools/registry.d.ts +14 -1
- package/dist/src/endpoint-tools/registry.js +15 -1
- package/dist/src/endpoint-tools/result-projector.d.ts +1 -2
- package/dist/src/endpoint-tools/result-projector.js +3 -11
- package/dist/src/endpoint-tools/runtime.d.ts +10 -2
- package/dist/src/endpoint-tools/runtime.js +102 -11
- package/dist/src/endpoint-tools/target-resolver.d.ts +8 -3
- package/dist/src/endpoint-tools/target-resolver.js +24 -5
- package/dist/src/endpoint-tools/task-targets.d.ts +38 -0
- package/dist/src/endpoint-tools/task-targets.js +95 -0
- package/dist/src/endpoint-tools/upload-service.d.ts +34 -1
- package/dist/src/endpoint-tools/upload-service.js +88 -2
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/routes/agent-stream.js +12 -1
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/device-authorizations.js +4 -10
- package/dist/src/gateway/hono/routes/device-hosts.d.ts +3 -0
- package/dist/src/gateway/hono/routes/device-hosts.js +82 -0
- package/dist/src/gateway/hono/routes/device-providers.d.ts +3 -0
- package/dist/src/gateway/hono/routes/device-providers.js +297 -0
- package/dist/src/gateway/hono/routes/device-targets.d.ts +3 -0
- package/dist/src/gateway/hono/routes/device-targets.js +117 -0
- package/dist/src/gateway/hono/routes/endpoint-compatibility.js +2 -1
- package/dist/src/gateway/hono/routes/endpoint-tools.js +2 -78
- package/dist/src/gateway/hono/routes/lazy-bundles.js +24 -8
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-command-handler.js +2 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +3 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/security/device-request-proof.js +8 -18
- package/dist/src/gateway/security/gateway-scopes.js +1 -0
- package/dist/src/gateway/service/agent-runner.d.ts +3 -0
- package/dist/src/gateway/service/agent-runner.js +21 -5
- package/dist/src/gateway/service/config-coordinator.d.ts +1 -0
- package/dist/src/gateway/service.js +5 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/imports/importService.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/mcp/capability-server.js +1 -1
- package/dist/src/notes/agent-context.d.ts +3 -0
- package/dist/src/notes/agent-context.js +32 -4
- package/dist/src/personal-agent/proactivity/repository.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +1 -1
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/phone/assistance.js +1 -1
- package/dist/src/phone/location-environment.js +1 -1
- package/dist/src/phone/repository.js +1 -1
- package/dist/src/phone/setup/service.js +1 -1
- package/dist/src/realtime/runtime.js +5 -0
- package/dist/src/runtime-tools/archive.js +1 -1
- package/dist/src/session/session-context-for-llm.js +9 -1
- package/dist/src/session/store.js +1 -1
- package/dist/src/share/hosted-session-share.js +1 -1
- package/dist/src/share/share-store.js +1 -1
- package/dist/src/storage/sqlite/clarification-wait-repository.d.ts +7 -1
- package/dist/src/storage/sqlite/clarification-wait-repository.js +40 -2
- package/dist/src/storage/sqlite/device-access-repository.d.ts +2 -8
- package/dist/src/storage/sqlite/device-access-repository.js +1 -3
- package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.js +2 -2
- package/dist/src/storage/sqlite/index.d.ts +0 -1
- package/dist/src/storage/sqlite/index.js +3 -3
- package/dist/src/storage/sqlite/schema.d.ts +2 -2
- package/dist/src/storage/sqlite/schema.js +7 -7
- package/dist/src/storage/sqlite/schema.sql +2 -10
- package/dist/src/storage/sqlite/session-input-repository.js +8 -0
- package/dist/src/storage/sqlite/upgrades/270_device_bridge_kind.sql +30 -0
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/chat-page-CeHOmJqM.js +0 -72
- package/dist/gateway/static/root/assets/gateway-realtime-hnEaDFaA.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-ugwtyD4q.js +0 -1
- package/dist/gateway/static/root/assets/gateway-restart-kwv0njYq.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CxYPJTy8.js +0 -1
- package/dist/gateway/static/root/assets/index-DE2bG5EI.css +0 -1
- package/dist/gateway/static/root/assets/index-PewrhviZ.js +0 -11
- package/dist/gateway/static/root/assets/languages-zXtNocoy.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-BgdAP0kf.js +0 -1
- package/dist/gateway/static/root/assets/navigation-D62kPsA9.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-DWIWloib.js +0 -5
- package/dist/gateway/static/root/assets/note-image-lightbox-BbNYW2Rw.js +0 -1
- package/dist/gateway/static/root/assets/page-context-capture-button-B9L7V_n2.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-YZfSLNTg.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-content-CGbqoID0.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-modal-0wvIDcVr.js +0 -2
- package/dist/gateway/static/root/assets/project-detail-page-Bkxs8knZ.js +0 -7
- package/dist/gateway/static/root/assets/route-preload-BVo8JPwW.js +0 -2
- package/dist/gateway/static/root/assets/settings-advanced-gate-DyGT3o1e.js +0 -1
- package/dist/gateway/static/root/assets/use-file-preview-expanded-9DED7ohY.js +0 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-CmSYxTmk.js +0 -1
- package/dist/packages/endpoint-tools-protocol/src/bridge.js +0 -105
- package/dist/packages/gateway-contract/src/desktop-chat.js +0 -29
- package/dist/src/endpoint-tools/binding-service.d.ts +0 -24
- package/dist/src/endpoint-tools/binding-service.js +0 -57
- package/dist/src/gateway/hono/routes/desktop-chat.d.ts +0 -3
- package/dist/src/gateway/hono/routes/desktop-chat.js +0 -30
- package/dist/src/storage/sqlite/endpoint-session-binding-repository.d.ts +0 -9
- package/dist/src/storage/sqlite/endpoint-session-binding-repository.js +0 -41
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ClientEndpointMessage } from '@xopcai/endpoint-tools-protocol';
|
|
2
|
+
import type { EndpointRegistry } from './registry.js';
|
|
3
|
+
type StatusMessage = Extract<ClientEndpointMessage, {
|
|
4
|
+
type: 'provider.operation.status';
|
|
5
|
+
}>['payload'];
|
|
6
|
+
/** Read-only reconciliation. A receipt never replays a write or reconstructs a missing payload. */
|
|
7
|
+
export declare class ProviderOperationStatusService {
|
|
8
|
+
private readonly registry;
|
|
9
|
+
private readonly pending;
|
|
10
|
+
private readonly evidence;
|
|
11
|
+
constructor(registry: EndpointRegistry);
|
|
12
|
+
query(operationId: string): Promise<{
|
|
13
|
+
operationId: string;
|
|
14
|
+
gatewayState: string;
|
|
15
|
+
deviceStatus: string;
|
|
16
|
+
receipt: {
|
|
17
|
+
intent: {
|
|
18
|
+
operationId: string;
|
|
19
|
+
providerDigest: string;
|
|
20
|
+
toolRevision: string;
|
|
21
|
+
argumentsDigest: string;
|
|
22
|
+
};
|
|
23
|
+
state: "unknown" | "succeeded" | "running";
|
|
24
|
+
updatedAt: number;
|
|
25
|
+
resultDigest?: string;
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
28
|
+
receive(endpointId: string, connectionId: string, message: StatusMessage): void;
|
|
29
|
+
disconnect(endpointId: string, connectionId: string): void;
|
|
30
|
+
close(): void;
|
|
31
|
+
private finish;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
3
|
+
import { parseExternalToolRef } from "../agent/external-tools/refs.js";
|
|
4
|
+
import { randomUUID } from "node:crypto";
|
|
5
|
+
//#region src/endpoint-tools/provider-operation-status.ts
|
|
6
|
+
init_transaction();
|
|
7
|
+
/** Read-only reconciliation. A receipt never replays a write or reconstructs a missing payload. */
|
|
8
|
+
var ProviderOperationStatusService = class {
|
|
9
|
+
pending = /* @__PURE__ */ new Map();
|
|
10
|
+
evidence = new DurableState("device.operation-receipts");
|
|
11
|
+
constructor(registry) {
|
|
12
|
+
this.registry = registry;
|
|
13
|
+
}
|
|
14
|
+
async query(operationId) {
|
|
15
|
+
const operation = getSqliteDatabase().prepare(`SELECT principal_id, capability_id, descriptor_digest, request_digest, state
|
|
16
|
+
FROM capability_operations WHERE operation_id=?`).get(operationId);
|
|
17
|
+
if (!operation) return;
|
|
18
|
+
const ref = parseExternalToolRef(operation.capability_id, "endpoint");
|
|
19
|
+
if (!ref?.namespace.startsWith(operation.principal_id + "/")) return;
|
|
20
|
+
const providerId = ref.namespace.slice(operation.principal_id.length + 1);
|
|
21
|
+
const endpoint = this.registry.list().find((endpoint) => endpoint.principalId === operation.principal_id && endpoint.tools.some((tool) => tool.provider?.localId === providerId && tool.provider.name === ref.toolName && tool.provider.durableOperations === 1));
|
|
22
|
+
const previous = this.evidence.get(operationId);
|
|
23
|
+
if (!endpoint || this.pending.size >= 32) return {
|
|
24
|
+
operationId,
|
|
25
|
+
gatewayState: operation.state,
|
|
26
|
+
deviceStatus: "unavailable",
|
|
27
|
+
receipt: previous
|
|
28
|
+
};
|
|
29
|
+
const requestId = randomUUID();
|
|
30
|
+
const receipt = await new Promise((resolve) => {
|
|
31
|
+
this.pending.set(requestId, {
|
|
32
|
+
endpointId: endpoint.endpointId,
|
|
33
|
+
connectionId: endpoint.connectionId,
|
|
34
|
+
operationId,
|
|
35
|
+
providerDigest: operation.descriptor_digest,
|
|
36
|
+
argumentsDigest: operation.request_digest,
|
|
37
|
+
complete: resolve,
|
|
38
|
+
timer: setTimeout(() => this.finish(requestId), 3e3)
|
|
39
|
+
});
|
|
40
|
+
try {
|
|
41
|
+
this.registry.send(endpoint.endpointId, "provider.operation.query", {
|
|
42
|
+
requestId,
|
|
43
|
+
operationId,
|
|
44
|
+
providerDigest: operation.descriptor_digest
|
|
45
|
+
});
|
|
46
|
+
} catch {
|
|
47
|
+
this.finish(requestId);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const latest = this.evidence.get(operationId);
|
|
51
|
+
if (receipt && receipt.state !== "running" && latest?.state !== "succeeded") this.evidence.set(operationId, receipt);
|
|
52
|
+
return {
|
|
53
|
+
operationId,
|
|
54
|
+
gatewayState: operation.state,
|
|
55
|
+
deviceStatus: receipt ? "recorded" : "unavailable",
|
|
56
|
+
receipt: latest?.state === "succeeded" ? latest : receipt ?? latest
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
receive(endpointId, connectionId, message) {
|
|
60
|
+
const pending = this.pending.get(message.requestId), receipt = message.receipt;
|
|
61
|
+
if (!pending || pending.endpointId !== endpointId || pending.connectionId !== connectionId || pending.operationId !== message.operationId || pending.providerDigest !== message.providerDigest) return;
|
|
62
|
+
if (receipt && (receipt.intent.operationId !== pending.operationId || receipt.intent.providerDigest !== pending.providerDigest || receipt.intent.argumentsDigest !== pending.argumentsDigest)) return;
|
|
63
|
+
this.finish(message.requestId, receipt);
|
|
64
|
+
}
|
|
65
|
+
disconnect(endpointId, connectionId) {
|
|
66
|
+
for (const [id, pending] of this.pending) if (pending.endpointId === endpointId && pending.connectionId === connectionId) this.finish(id);
|
|
67
|
+
}
|
|
68
|
+
close() {
|
|
69
|
+
for (const id of this.pending.keys()) this.finish(id);
|
|
70
|
+
}
|
|
71
|
+
finish(id, receipt) {
|
|
72
|
+
const pending = this.pending.get(id);
|
|
73
|
+
if (!pending) return;
|
|
74
|
+
this.pending.delete(id);
|
|
75
|
+
clearTimeout(pending.timer);
|
|
76
|
+
pending.complete(receipt);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
//#endregion
|
|
80
|
+
export { ProviderOperationStatusService };
|
|
@@ -8,6 +8,18 @@ export interface EndpointTransport {
|
|
|
8
8
|
export interface RegisteredEndpointTool {
|
|
9
9
|
descriptor: EndpointToolDescriptor;
|
|
10
10
|
revision: string;
|
|
11
|
+
provider?: {
|
|
12
|
+
principalId: string;
|
|
13
|
+
localId: string;
|
|
14
|
+
name: string;
|
|
15
|
+
summary: string;
|
|
16
|
+
instructions?: string;
|
|
17
|
+
digest: string;
|
|
18
|
+
durableOperations?: 1;
|
|
19
|
+
artifactInput?: string;
|
|
20
|
+
gatewayFormInput?: 1;
|
|
21
|
+
resourceId?: string;
|
|
22
|
+
};
|
|
11
23
|
}
|
|
12
24
|
export interface EndpointConnectionSnapshot {
|
|
13
25
|
principalId: string;
|
|
@@ -32,7 +44,7 @@ export declare class EndpointRegistry {
|
|
|
32
44
|
private readonly policy;
|
|
33
45
|
private readonly connectionByEndpointId;
|
|
34
46
|
private readonly changeListeners;
|
|
35
|
-
onChange(listener: (endpointId: string, reason?: 'connection' | 'authorization') => void): () => void;
|
|
47
|
+
onChange(listener: (endpointId: string, reason?: 'connection' | 'authorization' | 'catalog') => void): () => void;
|
|
36
48
|
private readonly principalRevocationListeners;
|
|
37
49
|
onPrincipalRevoked(principalId: string, listener: () => void): () => void;
|
|
38
50
|
revokePrincipal(principalId: string): void;
|
|
@@ -44,6 +56,7 @@ export declare class EndpointRegistry {
|
|
|
44
56
|
isCurrentConnection(endpointId: string, connectionId: string): boolean;
|
|
45
57
|
list(): EndpointConnectionSnapshot[];
|
|
46
58
|
getTool(endpointId: string, toolName: string): RegisteredEndpointTool | undefined;
|
|
59
|
+
replaceProviderTools(endpointId: string, connectionId: string, tools: readonly RegisteredEndpointTool[]): void;
|
|
47
60
|
verifyTurnClaim(endpointId: string, turnToken: string): boolean;
|
|
48
61
|
send(endpointId: string, type: ServerEndpointMessage['type'], payload: unknown): void;
|
|
49
62
|
disconnect(endpointId: string, code?: number, reason?: string): boolean;
|
|
@@ -112,6 +112,20 @@ var EndpointRegistry = class {
|
|
|
112
112
|
getTool(endpointId, toolName) {
|
|
113
113
|
return this.connectionByEndpointId.get(endpointId)?.toolByName.get(toolName);
|
|
114
114
|
}
|
|
115
|
+
replaceProviderTools(endpointId, connectionId, tools) {
|
|
116
|
+
const connection = this.requireConnection(endpointId, connectionId);
|
|
117
|
+
const next = new Map([...connection.toolByName].filter(([, tool]) => !tool.provider));
|
|
118
|
+
for (const tool of tools) {
|
|
119
|
+
if (!tool.provider || tool.provider.principalId !== connection.principalId || next.has(tool.descriptor.name)) throw new Error("Provider tool identity conflicts with this endpoint");
|
|
120
|
+
next.set(tool.descriptor.name, tool);
|
|
121
|
+
}
|
|
122
|
+
const invalidated = [...connection.toolByName].some(([name, tool]) => {
|
|
123
|
+
const replacement = next.get(name);
|
|
124
|
+
return replacement?.revision !== tool.revision || replacement?.provider?.digest !== tool.provider?.digest;
|
|
125
|
+
});
|
|
126
|
+
connection.toolByName = next;
|
|
127
|
+
for (const listener of this.changeListeners) listener(endpointId, invalidated ? "authorization" : "catalog");
|
|
128
|
+
}
|
|
115
129
|
verifyTurnClaim(endpointId, turnToken) {
|
|
116
130
|
const connection = this.connectionByEndpointId.get(endpointId);
|
|
117
131
|
if (!connection || connection.transport.readyState !== 1) return false;
|
|
@@ -123,7 +137,7 @@ var EndpointRegistry = class {
|
|
|
123
137
|
const connection = this.connectionByEndpointId.get(endpointId);
|
|
124
138
|
if (!connection || connection.transport.readyState !== 1) throw new Error(`Endpoint is offline: ${endpointId}`);
|
|
125
139
|
const message = {
|
|
126
|
-
protocolVersion:
|
|
140
|
+
protocolVersion: 3,
|
|
127
141
|
messageId: crypto.randomUUID(),
|
|
128
142
|
type,
|
|
129
143
|
sentAt: Date.now(),
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { EndpointToolContent } from '@xopcai/endpoint-tools-protocol';
|
|
2
2
|
/** Only fixed bounded state contracts are retained; personal tools use their existing policies. */
|
|
3
|
-
export declare function projectDeviceReading(toolName: string, endpointId: string, principalId: string, content: EndpointToolContent[], receivedAt?: number
|
|
3
|
+
export declare function projectDeviceReading(toolName: string, endpointId: string, principalId: string, content: EndpointToolContent[], receivedAt?: number): {
|
|
4
4
|
version: number;
|
|
5
5
|
source: {
|
|
6
|
-
resourceId?: unknown;
|
|
7
6
|
endpointId: string;
|
|
8
7
|
principalId: string;
|
|
9
8
|
};
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
//#region src/endpoint-tools/result-projector.ts
|
|
2
2
|
/** Only fixed bounded state contracts are retained; personal tools use their existing policies. */
|
|
3
|
-
function projectDeviceReading(toolName, endpointId, principalId, content, receivedAt = Date.now()
|
|
4
|
-
|
|
5
|
-
if (!sensor && !/^(mobile|desktop|web|browser)\.device\.get_(state|power)$/.test(toolName)) return void 0;
|
|
3
|
+
function projectDeviceReading(toolName, endpointId, principalId, content, receivedAt = Date.now()) {
|
|
4
|
+
if (!/^(mobile|desktop|web|browser)\.device\.get_(state|power)$/.test(toolName)) return void 0;
|
|
6
5
|
const item = content[0];
|
|
7
6
|
if (item?.type !== "json" || !item.value || typeof item.value !== "object") throw new Error("Invalid device reading");
|
|
8
|
-
if (sensor) {
|
|
9
|
-
const reading = item.value;
|
|
10
|
-
if (reading.resourceId !== args?.resourceId) throw new Error("Bridge returned a different resource");
|
|
11
|
-
const expectedUnit = reading.measurement === "humidity" ? "percent" : "celsius";
|
|
12
|
-
if (reading.unit !== expectedUnit || reading.measurement === "humidity" && reading.value !== null && (typeof reading.value !== "number" || reading.value < 0 || reading.value > 100)) throw new Error("Invalid Bridge measurement");
|
|
13
|
-
}
|
|
14
7
|
const capturedAt = item.value.capturedAt;
|
|
15
8
|
if (typeof capturedAt !== "number" || !Number.isSafeInteger(capturedAt) || capturedAt > receivedAt + 6e4 || capturedAt < receivedAt - 3e4) throw new Error("Device sample is stale or has an invalid clock");
|
|
16
9
|
return {
|
|
17
10
|
version: 1,
|
|
18
11
|
source: {
|
|
19
12
|
endpointId,
|
|
20
|
-
principalId
|
|
21
|
-
...sensor ? { resourceId: item.value.resourceId } : {}
|
|
13
|
+
principalId
|
|
22
14
|
},
|
|
23
15
|
capturedAt,
|
|
24
16
|
receivedAt,
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import type { DeviceInteractionCheckpoint } from '@xopcai/gateway-contract';
|
|
1
2
|
import { type ClientEndpointMessage, type EndpointHelloPayload, type EndpointDesktopExecutionAuthority } from '@xopcai/endpoint-tools-protocol';
|
|
2
3
|
import { type EndpointAuthenticatorDeps } from './auth.js';
|
|
3
4
|
import { DeviceGrantService } from './grant-service.js';
|
|
4
|
-
import {
|
|
5
|
+
import { EndpointTaskTargetService } from './task-targets.js';
|
|
5
6
|
import { EndpointInvocationService, type EndpointInvocationAuditSink } from './invocation-service.js';
|
|
6
7
|
import { EndpointRegistry, type EndpointRegistration, type EndpointTransport } from './registry.js';
|
|
7
8
|
import { EndpointUploadService } from './upload-service.js';
|
|
8
9
|
import { EndpointContextStore } from './context-store.js';
|
|
9
10
|
import { LocationSharingService } from './location-sharing.js';
|
|
10
11
|
import { DesktopTerminalGatewayBroker } from './terminal-broker.js';
|
|
12
|
+
import { ProviderOperationStatusService } from './provider-operation-status.js';
|
|
13
|
+
import { EndpointProviderCatalog } from './provider-catalog.js';
|
|
11
14
|
export declare class EndpointToolRuntime {
|
|
12
15
|
readonly registry: EndpointRegistry;
|
|
13
16
|
readonly contexts: EndpointContextStore;
|
|
@@ -15,17 +18,22 @@ export declare class EndpointToolRuntime {
|
|
|
15
18
|
readonly grants: DeviceGrantService;
|
|
16
19
|
readonly invocations: EndpointInvocationService;
|
|
17
20
|
readonly uploads: EndpointUploadService;
|
|
18
|
-
readonly
|
|
21
|
+
readonly targets: EndpointTaskTargetService;
|
|
19
22
|
readonly terminals: DesktopTerminalGatewayBroker;
|
|
23
|
+
readonly providers: EndpointProviderCatalog;
|
|
24
|
+
readonly providerOperations: ProviderOperationStatusService;
|
|
20
25
|
private readonly authenticator;
|
|
26
|
+
private readonly providerMessageBudget;
|
|
21
27
|
private closed;
|
|
22
28
|
constructor(options?: {
|
|
23
29
|
auth?: EndpointAuthenticatorDeps;
|
|
24
30
|
audit?: EndpointInvocationAuditSink;
|
|
25
31
|
uploadRoot?: string;
|
|
26
32
|
});
|
|
33
|
+
setProvidersEnabled(enabled: boolean): void;
|
|
27
34
|
connect(hello: EndpointHelloPayload, connectionId: string, transport: EndpointTransport, executionAuthority?: EndpointDesktopExecutionAuthority): EndpointRegistration;
|
|
28
35
|
handleMessage(endpointId: string, connectionId: string, message: ClientEndpointMessage): void;
|
|
36
|
+
canResumeDeviceInteraction(conversationId: string, checkpoint: DeviceInteractionCheckpoint): boolean;
|
|
29
37
|
touch(endpointId: string, connectionId: string): void;
|
|
30
38
|
remove(endpointId: string, connectionId: string): void;
|
|
31
39
|
disconnect(endpointId: string, reason: string): void;
|
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { deleteEndpointSessionBinding, getEndpointSessionBinding, setEndpointSessionBinding } from "../storage/sqlite/endpoint-session-binding-repository.js";
|
|
5
4
|
import { deleteBrowserTabBindingsByEndpoint } from "../storage/sqlite/browser-tab-binding-repository.js";
|
|
5
|
+
import { init_session_input_control_repository, readSessionInputControl } from "../storage/sqlite/session-input-control-repository.js";
|
|
6
|
+
import { findSessionInputByRunId, init_session_input_repository } from "../storage/sqlite/session-input-repository.js";
|
|
7
|
+
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
8
|
+
import { currentDeviceExecutionActor } from "./execution-actor.js";
|
|
9
|
+
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
10
|
+
import { init_session_repository } from "../storage/sqlite/session-repository.js";
|
|
6
11
|
import { bindEndpointPrincipal, getEndpointPrincipal, touchEndpointPrincipal } from "../storage/sqlite/endpoint-principal-repository.js";
|
|
7
12
|
import { finishEndpointToolInvocationAudit, startEndpointToolInvocationAudit } from "../storage/sqlite/endpoint-tool-invocation-repository.js";
|
|
8
13
|
import "../storage/sqlite/index.js";
|
|
9
14
|
import { init_paths } from "../config/paths.js";
|
|
10
15
|
import { EndpointToolPolicy } from "./policy.js";
|
|
16
|
+
import { EndpointRegistry } from "./registry.js";
|
|
11
17
|
import { EndpointInvocationService } from "./invocation-service.js";
|
|
12
18
|
import { EndpointAuthenticator } from "./auth.js";
|
|
13
|
-
import { EndpointBindingService } from "./binding-service.js";
|
|
14
19
|
import { EndpointContextStore } from "./context-store.js";
|
|
15
|
-
import { EndpointRegistry } from "./registry.js";
|
|
16
20
|
import { DeviceGrantService } from "./grant-service.js";
|
|
17
21
|
import { recordDeviceGrantEvent } from "../storage/sqlite/device-grant-audit-repository.js";
|
|
22
|
+
import { EndpointTaskTargetService } from "./task-targets.js";
|
|
18
23
|
import { EndpointUploadService } from "./upload-service.js";
|
|
19
24
|
import { LocationSharingService } from "./location-sharing.js";
|
|
20
25
|
import { DesktopTerminalGatewayBroker } from "./terminal-broker.js";
|
|
26
|
+
import { ProviderOperationStatusService } from "./provider-operation-status.js";
|
|
27
|
+
import { EndpointProviderCatalog } from "./provider-catalog.js";
|
|
21
28
|
import { join } from "node:path";
|
|
22
29
|
//#region src/endpoint-tools/runtime.ts
|
|
23
30
|
init_paths();
|
|
31
|
+
init_session_repository();
|
|
32
|
+
init_session_input_repository();
|
|
33
|
+
init_session_input_control_repository();
|
|
24
34
|
init_logger();
|
|
25
35
|
const log = createLogger("EndpointTools");
|
|
26
36
|
const MAX_MESSAGE_CLOCK_SKEW_MS = 6e4;
|
|
@@ -31,21 +41,22 @@ var EndpointToolRuntime = class {
|
|
|
31
41
|
grants;
|
|
32
42
|
invocations;
|
|
33
43
|
uploads;
|
|
34
|
-
|
|
44
|
+
targets;
|
|
35
45
|
terminals;
|
|
46
|
+
providers;
|
|
47
|
+
providerOperations;
|
|
36
48
|
authenticator;
|
|
49
|
+
providerMessageBudget = /* @__PURE__ */ new Map();
|
|
37
50
|
closed = false;
|
|
38
51
|
constructor(options = {}) {
|
|
39
52
|
const policy = new EndpointToolPolicy();
|
|
40
53
|
this.registry = new EndpointRegistry(policy);
|
|
54
|
+
this.providers = new EndpointProviderCatalog(this.registry);
|
|
55
|
+
this.providerOperations = new ProviderOperationStatusService(this.registry);
|
|
41
56
|
this.contexts = new EndpointContextStore(this.registry);
|
|
42
57
|
this.locations = new LocationSharingService(this.registry, this.contexts);
|
|
43
58
|
this.grants = new DeviceGrantService(this.registry, Date.now, recordDeviceGrantEvent);
|
|
44
|
-
this.
|
|
45
|
-
get: getEndpointSessionBinding,
|
|
46
|
-
set: setEndpointSessionBinding,
|
|
47
|
-
delete: deleteEndpointSessionBinding
|
|
48
|
-
});
|
|
59
|
+
this.targets = new EndpointTaskTargetService(this.registry, (id) => getSessionMetadata(id)?.transcriptId, (id) => currentDeviceExecutionActor(id)?.principalId, new DurableState("device.task-targets"));
|
|
49
60
|
this.authenticator = new EndpointAuthenticator(options.auth ?? {
|
|
50
61
|
getPrincipal: getEndpointPrincipal,
|
|
51
62
|
bindEndpoint: bindEndpointPrincipal,
|
|
@@ -58,20 +69,37 @@ var EndpointToolRuntime = class {
|
|
|
58
69
|
finished: finishEndpointToolInvocationAudit
|
|
59
70
|
},
|
|
60
71
|
uploads: this.uploads,
|
|
61
|
-
policy
|
|
72
|
+
policy,
|
|
73
|
+
authorizeProvider: (endpointId, toolName) => this.providers.assertExecutable(endpointId, toolName),
|
|
74
|
+
authorizeInteractionRecovery: (origin, endpointId) => {
|
|
75
|
+
if (getSessionMetadata(origin.conversationId)?.transcriptId !== origin.transcriptId) return false;
|
|
76
|
+
const actor = currentDeviceExecutionActor(origin.conversationId, origin.runId);
|
|
77
|
+
const target = this.targets.get(origin.conversationId);
|
|
78
|
+
const input = findSessionInputByRunId(origin.conversationId, origin.runId);
|
|
79
|
+
return actor?.kind === "owner" && actor.principalId === origin.actorPrincipalId && actor.scopes.includes("gateway.admin") && !!input && input.status !== "cancelled" && !readSessionInputControl(origin.conversationId).paused && target?.executionRef === origin.targetRef && (!target || target.endpointId === endpointId && target.expiresAt > Date.now());
|
|
80
|
+
}
|
|
62
81
|
});
|
|
63
82
|
this.terminals = new DesktopTerminalGatewayBroker(this.registry, this.invocations);
|
|
83
|
+
this.registry.onChange((endpointId, reason) => {
|
|
84
|
+
if (reason === "authorization") this.invocations.invalidateContracts(endpointId);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
setProvidersEnabled(enabled) {
|
|
88
|
+
this.providers.setEnabled(enabled);
|
|
89
|
+
if (!enabled) this.invocations.discardDetachedInteractions();
|
|
64
90
|
}
|
|
65
91
|
connect(hello, connectionId, transport, executionAuthority) {
|
|
66
92
|
if (this.closed) throw new Error("Endpoint runtime is closed");
|
|
67
93
|
this.authenticator.authenticate(hello);
|
|
68
94
|
if (hello.execution && !executionAuthority) throw new Error("DESKTOP_EXECUTION_AUTHORITY_REQUIRED");
|
|
69
95
|
const previous = this.registry.get(hello.endpointId);
|
|
96
|
+
const registration = this.registry.register(hello, connectionId, transport, Date.now(), executionAuthority);
|
|
70
97
|
if (previous) {
|
|
98
|
+
this.providers.disconnect(previous.endpointId, previous.connectionId);
|
|
99
|
+
this.providerOperations.disconnect(previous.endpointId, previous.connectionId);
|
|
71
100
|
this.grants.revokeEndpoint(previous.endpointId, previous.principalId);
|
|
72
101
|
this.invocations.failEndpoint(previous.endpointId);
|
|
73
102
|
}
|
|
74
|
-
const registration = this.registry.register(hello, connectionId, transport, Date.now(), executionAuthority);
|
|
75
103
|
log.info({
|
|
76
104
|
endpointId: hello.endpointId,
|
|
77
105
|
connectionId,
|
|
@@ -82,20 +110,81 @@ var EndpointToolRuntime = class {
|
|
|
82
110
|
handleMessage(endpointId, connectionId, message) {
|
|
83
111
|
if (!this.registry.isCurrentConnection(endpointId, connectionId)) throw new Error("Endpoint connection is no longer active");
|
|
84
112
|
if (Math.abs(Date.now() - message.sentAt) > MAX_MESSAGE_CLOCK_SKEW_MS) throw new Error("Endpoint message timestamp is outside the allowed window");
|
|
113
|
+
if (message.type.startsWith("provider.")) {
|
|
114
|
+
const now = Date.now(), previous = this.providerMessageBudget.get(connectionId);
|
|
115
|
+
const budget = previous && now - previous.startedAt < 1e4 ? previous : {
|
|
116
|
+
startedAt: now,
|
|
117
|
+
count: 0
|
|
118
|
+
};
|
|
119
|
+
if (++budget.count > 128) throw new Error("PROVIDER_MESSAGE_RATE_LIMITED");
|
|
120
|
+
this.providerMessageBudget.set(connectionId, budget);
|
|
121
|
+
}
|
|
85
122
|
if (message.type === "endpoint.availability_changed") {
|
|
86
123
|
this.registry.heartbeat(endpointId, connectionId, message.payload.availability);
|
|
87
124
|
return;
|
|
88
125
|
}
|
|
126
|
+
if (message.type === "provider.catalog.replace") {
|
|
127
|
+
const { revision } = message.payload;
|
|
128
|
+
try {
|
|
129
|
+
this.providers.replace(endpointId, connectionId, message.payload);
|
|
130
|
+
} catch (err) {
|
|
131
|
+
const reason = err instanceof Error ? err.message : "";
|
|
132
|
+
const code = reason === "PROVIDER_CATALOG_RATE_LIMITED" || reason === "PROVIDER_CATALOG_REVISION_CONFLICT" || reason === "PROVIDER_CONNECTION_CONFLICT" ? reason : "PROVIDER_CATALOG_REJECTED";
|
|
133
|
+
log.warn({
|
|
134
|
+
endpointId,
|
|
135
|
+
connectionId,
|
|
136
|
+
revision,
|
|
137
|
+
code
|
|
138
|
+
}, "Provider catalog rejected");
|
|
139
|
+
this.registry.send(endpointId, "provider.catalog.ack", {
|
|
140
|
+
revision,
|
|
141
|
+
accepted: false,
|
|
142
|
+
code
|
|
143
|
+
});
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
this.registry.send(endpointId, "provider.catalog.ack", {
|
|
147
|
+
revision,
|
|
148
|
+
accepted: true
|
|
149
|
+
});
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (message.type === "provider.state.changed") {
|
|
153
|
+
this.providers.reportState(endpointId, connectionId, message.payload);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (message.type === "provider.operation.status") {
|
|
157
|
+
this.providerOperations.receive(endpointId, connectionId, message.payload);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (message.type === "provider.interaction.request") {
|
|
161
|
+
this.invocations.requestInteraction(endpointId, message.payload);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
89
164
|
if (message.type === "terminal.event" && this.registry.get(endpointId)?.terminalVersion !== 1) throw new Error("DESKTOP_TERMINAL_NOT_NEGOTIATED");
|
|
90
165
|
this.invocations.handleMessage(endpointId, message);
|
|
91
166
|
}
|
|
167
|
+
canResumeDeviceInteraction(conversationId, checkpoint) {
|
|
168
|
+
const target = this.targets.get(conversationId);
|
|
169
|
+
if (!target || target.actorPrincipalId !== checkpoint.actorPrincipalId || target.expiresAt <= Date.now() || target.endpointId !== checkpoint.endpointId || target.principalId !== checkpoint.principalId) return false;
|
|
170
|
+
if (this.registry.get(target.endpointId)?.connectionId !== target.connectionId || this.registry.getTool(target.endpointId, checkpoint.toolName)?.provider?.digest !== checkpoint.providerDigest) return false;
|
|
171
|
+
try {
|
|
172
|
+
this.providers.assertExecutable(target.endpointId, checkpoint.toolName);
|
|
173
|
+
return true;
|
|
174
|
+
} catch {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
92
178
|
touch(endpointId, connectionId) {
|
|
93
179
|
const endpoint = this.registry.get(endpointId);
|
|
94
180
|
if (endpoint?.connectionId === connectionId) this.registry.heartbeat(endpointId, connectionId, endpoint.availability);
|
|
95
181
|
}
|
|
96
182
|
remove(endpointId, connectionId) {
|
|
183
|
+
this.providerMessageBudget.delete(connectionId);
|
|
97
184
|
const principalId = this.registry.get(endpointId)?.principalId;
|
|
98
185
|
if (!this.registry.remove(endpointId, connectionId)) return;
|
|
186
|
+
this.providers.disconnect(endpointId, connectionId);
|
|
187
|
+
this.providerOperations.disconnect(endpointId, connectionId);
|
|
99
188
|
this.grants.revokeEndpoint(endpointId, principalId);
|
|
100
189
|
this.invocations.failEndpoint(endpointId);
|
|
101
190
|
deleteBrowserTabBindingsByEndpoint(endpointId);
|
|
@@ -111,7 +200,9 @@ var EndpointToolRuntime = class {
|
|
|
111
200
|
close() {
|
|
112
201
|
if (this.closed) return;
|
|
113
202
|
this.closed = true;
|
|
203
|
+
this.providerMessageBudget.clear();
|
|
114
204
|
this.terminals.close();
|
|
205
|
+
this.providerOperations.close();
|
|
115
206
|
this.grants.close();
|
|
116
207
|
this.invocations.close();
|
|
117
208
|
this.uploads.close();
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import type { TurnOrigin } from '@xopcai/endpoint-tools-protocol';
|
|
2
2
|
import type { DeviceGrantService } from './grant-service.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { EndpointTaskTargetService } from './task-targets.js';
|
|
4
4
|
import type { EndpointRegistry } from './registry.js';
|
|
5
|
+
import type { GatewayPrincipal } from '../gateway/security/gateway-principal.js';
|
|
5
6
|
export declare class DeviceTargetResolver {
|
|
6
7
|
private readonly registry;
|
|
7
|
-
private readonly
|
|
8
|
+
private readonly targets;
|
|
8
9
|
private readonly grants?;
|
|
9
|
-
|
|
10
|
+
private readonly actor?;
|
|
11
|
+
private readonly cacheSnapshot;
|
|
12
|
+
private readonly snapshots;
|
|
13
|
+
private snapshot;
|
|
14
|
+
constructor(registry: EndpointRegistry, targets: EndpointTaskTargetService, grants?: DeviceGrantService, actor?: GatewayPrincipal, cacheSnapshot?: boolean);
|
|
10
15
|
candidates(conversationId: string, origin: TurnOrigin): import("./registry.js").EndpointConnectionSnapshot[];
|
|
11
16
|
resolve(conversationId: string, origin: TurnOrigin, endpointId: string, toolName: string): import("./registry.js").EndpointConnectionSnapshot;
|
|
12
17
|
}
|
|
@@ -1,25 +1,44 @@
|
|
|
1
1
|
import { deviceCapabilityTarget } from "./capability-catalog.js";
|
|
2
2
|
//#region src/endpoint-tools/target-resolver.ts
|
|
3
3
|
var DeviceTargetResolver = class {
|
|
4
|
-
|
|
4
|
+
snapshots = /* @__PURE__ */ new Map();
|
|
5
|
+
snapshot(conversationId) {
|
|
6
|
+
if (!this.cacheSnapshot || !this.snapshots.has(conversationId)) this.snapshots.set(conversationId, {
|
|
7
|
+
target: this.targets.get(conversationId),
|
|
8
|
+
resolved: this.targets.resolve(conversationId)
|
|
9
|
+
});
|
|
10
|
+
return this.snapshots.get(conversationId);
|
|
11
|
+
}
|
|
12
|
+
constructor(registry, targets, grants, actor, cacheSnapshot = false) {
|
|
5
13
|
this.registry = registry;
|
|
6
|
-
this.
|
|
14
|
+
this.targets = targets;
|
|
7
15
|
this.grants = grants;
|
|
16
|
+
this.actor = actor;
|
|
17
|
+
this.cacheSnapshot = cacheSnapshot;
|
|
8
18
|
}
|
|
9
19
|
candidates(conversationId, origin) {
|
|
10
20
|
const source = origin.type === "endpoint" ? this.registry.get(origin.endpointId) : void 0;
|
|
11
|
-
const execution = this.
|
|
21
|
+
const execution = this.snapshot(conversationId).target ? this.snapshot(conversationId).resolved : source;
|
|
12
22
|
const authorized = (this.grants?.candidates(conversationId, origin) ?? []).map((grant) => this.registry.get(grant.targetEndpointId));
|
|
23
|
+
const discoverable = this.actor && this.actor.kind !== "device" && this.actor.scopes.includes("gateway.admin") ? this.registry.list() : [];
|
|
13
24
|
return [...new Map([
|
|
14
25
|
source,
|
|
15
26
|
execution,
|
|
16
|
-
...authorized
|
|
27
|
+
...authorized,
|
|
28
|
+
...discoverable
|
|
17
29
|
].filter((endpoint) => endpoint !== void 0).map((endpoint) => [endpoint.endpointId, endpoint])).values()];
|
|
18
30
|
}
|
|
19
31
|
resolve(conversationId, origin, endpointId, toolName) {
|
|
20
32
|
const grant = this.grants?.find(conversationId, origin, endpointId, toolName);
|
|
21
33
|
if (grant) return this.registry.get(grant.targetEndpointId);
|
|
22
|
-
const binding = this.
|
|
34
|
+
const binding = this.snapshot(conversationId).target;
|
|
35
|
+
if (deviceCapabilityTarget(toolName) !== "turn_origin" && binding) {
|
|
36
|
+
const selected = binding.endpointId === endpointId ? this.snapshot(conversationId).resolved : void 0;
|
|
37
|
+
if (this.actor && this.actor.kind !== "device" && this.actor.scopes.includes("gateway.admin")) return selected;
|
|
38
|
+
const source = origin.type === "endpoint" ? this.registry.get(origin.endpointId) : void 0;
|
|
39
|
+
return selected && selected.principalId === source?.principalId && (!this.actor || this.actor.deviceId === selected.principalId) ? selected : void 0;
|
|
40
|
+
}
|
|
41
|
+
if (deviceCapabilityTarget(toolName) !== "turn_origin" && this.actor && this.actor.kind !== "device" && this.actor.scopes.includes("gateway.admin")) return this.registry.get(endpointId);
|
|
23
42
|
return (deviceCapabilityTarget(toolName) === "turn_origin" ? origin.type === "endpoint" ? origin.endpointId : void 0 : binding?.endpointId ?? (origin.type === "endpoint" ? origin.endpointId : void 0)) === endpointId ? this.registry.get(endpointId) : void 0;
|
|
24
43
|
}
|
|
25
44
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { EndpointConnectionSnapshot } from './registry.js';
|
|
2
|
+
import type { EndpointRegistry } from './registry.js';
|
|
3
|
+
export interface EndpointExecutionTarget {
|
|
4
|
+
conversationId: string;
|
|
5
|
+
endpointId: string;
|
|
6
|
+
principalId: string;
|
|
7
|
+
connectionId: string;
|
|
8
|
+
executionRef: string;
|
|
9
|
+
selectedAt: number;
|
|
10
|
+
expiresAt: number;
|
|
11
|
+
transcriptId?: string;
|
|
12
|
+
actorPrincipalId?: string;
|
|
13
|
+
}
|
|
14
|
+
interface TaskTargetStore {
|
|
15
|
+
get(key: string): EndpointExecutionTarget | undefined;
|
|
16
|
+
set(key: string, value: EndpointExecutionTarget): unknown;
|
|
17
|
+
delete(key: string): boolean;
|
|
18
|
+
entries(): Iterable<[string, EndpointExecutionTarget]>;
|
|
19
|
+
}
|
|
20
|
+
/** An execution target is pinned to a connection and transcript; reconnect never retargets it. */
|
|
21
|
+
export declare class EndpointTaskTargetService {
|
|
22
|
+
private readonly registry;
|
|
23
|
+
private readonly transcriptId;
|
|
24
|
+
private readonly actorPrincipalId;
|
|
25
|
+
private readonly targets;
|
|
26
|
+
private readonly resources;
|
|
27
|
+
private readonly listeners;
|
|
28
|
+
constructor(registry: EndpointRegistry, transcriptId?: (conversationId: string) => string | undefined, actorPrincipalId?: (conversationId: string) => string | undefined, targets?: TaskTargetStore);
|
|
29
|
+
onChange(listener: (conversationId: string) => void): () => void;
|
|
30
|
+
select(conversationId: string, endpointId: string, now?: number, actorPrincipalId?: string): EndpointExecutionTarget;
|
|
31
|
+
get(conversationId: string): EndpointExecutionTarget | undefined;
|
|
32
|
+
resolve(conversationId: string): EndpointConnectionSnapshot | undefined;
|
|
33
|
+
hold(conversationId: string, resourceId: string): () => void;
|
|
34
|
+
private assertReleased;
|
|
35
|
+
clear(conversationId: string): boolean;
|
|
36
|
+
private key;
|
|
37
|
+
}
|
|
38
|
+
export {};
|