@xopcai/xopc 0.0.433 → 0.0.435
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/README.zh-CN.md +5 -5
- package/dist/browser-ext/dist/sidepanel.js +11 -0
- 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-BpYGrRXw.js → activity-store-Cwn_CNwl.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DTgOSv6G.js → agent-avatar-dicebear-Cd23LnJJ.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-BUH7ljEo.js → agent-avatar-display-ByzM7u9S.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-B_FAikHA.js → agent-defaults-settings-panel-B0i37diS.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-DPabZaSE.js → agent-plugin-dialog-XN-tZ-Ox.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-BAPYP1Ka.js → agents-ZDA1OaLv.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-CXCAHNPj.js → agents-admin-api-B5lKH_ps.js} +1 -1
- package/dist/gateway/static/root/assets/{api-oIK4hYkJ.js → api-B9fZL-V8.js} +1 -1
- package/dist/gateway/static/root/assets/{api-DMbimMEi.js → api-Djju8qIR.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BZ3Fy8ZR.js → app-management-settings-panel-IlyzDPJu.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DsRTj1by.js → appearance-settings-BxdFGob3.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-CxEKiOTA.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-Bg1VTieK.js → archive-plugin-4gEvotPr.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-CLPsgcQN.js → automation-api-4fVKv9PJ.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-CKVnR4KG.js → automation-result-state-m7PeK2kl.js} +1 -1
- package/dist/gateway/static/root/assets/automation-run-list-CJOdy_R2.js +1 -0
- package/dist/gateway/static/root/assets/{automation-task-card-D27Mw66U.js → automation-task-card-DZWhCWJa.js} +3 -3
- package/dist/gateway/static/root/assets/{automations-page-DGNTJ8lN.js → automations-page-BjbM15eY.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CqurzLYX.js +9 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CuwSdCG5.js → binary-plugins-69WyJLNW.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Dtl2BG3t.js → block-editor-DUONDIZR.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-uGK086ag.js → browser-automation-inputs-DL4YPCuN.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-Da_edNNS.js → browser-automations-page-1Aq6XmRs.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-control-api-k3OOX3bS.js → browser-control-api-yjru8E7R.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-C1bSw-Jq.js → browser-settings-page-CvwpT8Um.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-DlHPLld_.js → capabilities-C7lnwKKm.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-CoeuLRt6.js → capabilities-DaeQXJT4.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-B5avAOUM.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-CtY-bGIi.js → capabilities-settings-panel-_9yCS78i.js} +1 -1
- package/dist/gateway/static/root/assets/capability-links-DeO34GIF.js +1 -0
- package/dist/gateway/static/root/assets/{channels-Cn1MWBL_.js → channels-CoQb4HOF.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-BB0biwc7.js → chat-agents-api-BUi_7GRo.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-QSvjx4w6.js → chat-chart-block-CcVcKsDZ.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page--wcFhTjW.js +72 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Cd51G9eG.js → chat-terminal-dock-BMXJpPuH.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-CEG10uE-.js → command-palette-api-luUjQPsh.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-Bogdq9Hy.js → composer-payload-handoff-B5XNxNCb.js} +1 -1
- package/dist/gateway/static/root/assets/computer-settings-page-CWtdyEJH.js +1 -0
- package/dist/gateway/static/root/assets/connected-providers-grid-2idMtk65.js +1 -0
- package/dist/gateway/static/root/assets/connection-usage-Cm_McddI.js +1 -0
- package/dist/gateway/static/root/assets/connection-usage-guide-Ddh0bfkj.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-k2rjyjrp.js → connector-service-page-C3msXaBk.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-DtvB9Cjm.js → connectors-api-NcWECWKg.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-Crb6DILX.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-CAankdQw.js → date-picker-Cfjq1hD_.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DjM73fir.js → desktop-pet-ChFn9v-3.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-Rmh-GxHl.js → desktop-pet-settings-DvnVIv25.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-BgW2Riyk.js → dev-view-store-DQJ61P5L.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-UdzSpNa5.js → device-pairing-wizard-KxaIL-OX.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-Rkw3f7lG.js → directory-picker-path-field-Drv864uE.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-Dudoj_Fz.js → discussion-annotation-sync-DfBRkWtw.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DxIGAO23.js → extension-debug-page-DAlBIt_R.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-63KpX6IP.js → extension-iframe-host-Bds-5kY_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-yXNUkQDA.js → extension-marketplace-api-CZg8nBwW.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C811A_Ww.js → extension-page-ZTw-oucT.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-C4jLFIgh.js → extension-provider-NKWfjpdP.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-WJSw5MT0.js → extension-settings-page-CT7PPt_q.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-zE9AcaHM.js → file-preview-surface-BcLeaSNe.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-D6cc6W6E.js → gateway-config-swr-Cq-ByXL4.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-BSRNLciy.js → gateway-realtime-DwMd2PCt.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CHrf6-nR.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-Unun5hRL.js → gateway-restart-DdiVzbkL.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DP-DV-e5.js → gateway-settings-1QUdNwrZ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-C8g666Ja.js → gateway-startup-retry-PMJi5mX4.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-BObi-1ww.js → global-defaults-api-DgzZh3wX.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-CIcs7Mzy.js → home-page-Chn7YTiD.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-C2SqYNyD.js → image-generation-api-CjVpsckq.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-C8ezUkOJ.js → imports-page-CJCvZFaQ.js} +1 -1
- package/dist/gateway/static/root/assets/index-8xLWo0Tt.js +11 -0
- package/dist/gateway/static/root/assets/index-iukJWzxG.css +1 -0
- package/dist/gateway/static/root/assets/install-connector-dialog-Bo06Ry3H.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BRaY4-wA.js → keyboard-shortcuts-settings-BylFJeGu.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-BZtVcjF3.js → local-app-workbench-page-B3MSSFsr.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-MqP4EnJm.js → local-apps-page-BeV86rMJ.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-DTq9776a.js → local-session-drafts-jgw8UGsO.js} +2 -2
- package/dist/gateway/static/root/assets/{locale-store-B6OrWgY1.js → locale-store-CAZaC05J.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-hkHBjblX.js → logs-page-BMmSsUP5.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-DoX4eTM3.js → management-settings-Bu7T8ewk.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DrhYZSmg.js → markdown-view-BatP4qeK.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-BEp5E6TD.js → mcp-conversation-setup-page-rROtr0UN.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-D987i9Gc.js → media-plugins-88OV72YE.js} +1 -1
- package/dist/gateway/static/root/assets/messages-C7fckbyG.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-DXm4NS1_.js → model-selector-raBRBkN_.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-BLcha5rx.js → models-hub-cache-CzC9y3D0.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-Cl851ivY.js → note-detail-panel-BvA8Vkbm.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-D6kUDDd5.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-Ddsf7FVg.js → notes-api-zXpV6UXu.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-DSwA1MU1.js → notes-page-CjYH9Kle.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-CMmu4DzH.js → oauth-api-DmxSaxM1.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-BkhnftBq.js → oauth-provider-connect-D4Gfs-Ba.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-urhQBRaN.js → page-context-capture-button-Mig3d0UX.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-BuNUerth.js → page-context-draft-C4IIZaKd.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-D7G5utVi.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-B49ueeZO.js → personal-avatar-DLa-CpaK.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-f05ceuFn.js → personal-page-BhuT79Wd.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-DLQxzPYr.js → personal-settings-panel-XSUkgcr2.js} +1 -1
- package/dist/gateway/static/root/assets/phone-dependencies-card-DYwnuVh3.js +1 -0
- package/dist/gateway/static/root/assets/phone-model-connection-2F32QTHA.js +1 -0
- package/dist/gateway/static/root/assets/phone-model-picker-DCVzIr0s.js +1 -0
- package/dist/gateway/static/root/assets/phone-settings-page-DJttE4id.js +1 -0
- package/dist/gateway/static/root/assets/{phone-workspace-store-DbqktZbO.js → phone-workspace-store-Dxp-KhFP.js} +1 -1
- package/dist/gateway/static/root/assets/plugin-details-dialog-tyjAjFjA.js +1 -0
- package/dist/gateway/static/root/assets/{preference-select-fields-BZWqG7pu.js → preference-select-fields-BVP3MhGK.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-DDQUsag7.js → product-automation-feedback-DbJvv92z.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BkRP_HmA.js → product-open-page-RImqlhCD.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-o2Y3VNE7.js → product-preview-content-DxSqrKsg.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-7Ohx-7OR.js → product-preview-modal-Cw8Q8Uom.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-B2RsSHya.js → project-detail-page-CuugOYfe.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-BIMouiYX.js → project-understanding-BMKcoUW5.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-C9R5u3tF.js → projects-page-CFsABLvs.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-BOCkRZ7X.js → providers-api-CAeXbJNF.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-C6muEHEO.js → recording-upload-CfpllTe5.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-Bl2guMRg.js → registry-api-fLOqFyrz.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BceSMbCs.js → remote-access-hub-BvKOxy0L.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-CUNbPkdj.js → resource-unavailable-D15jzjV_.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-BQapekpy.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-LopLjgvu.js → runtime-tools-api-D0Nrvuqv.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-9HIPerDP.js → runtime-tools-settings-panel-CA27XgL2.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-CoMI6MB1.js → service-recommendation-list-B0RoYLVT.js} +1 -1
- package/dist/gateway/static/root/assets/session-api-CHRP5Lwf.js +1 -0
- package/dist/gateway/static/root/assets/session-channel-icon-D1ktvt1P.js +1 -0
- package/dist/gateway/static/root/assets/session-identity-label-BP7OIYth.js +1 -0
- package/dist/gateway/static/root/assets/session-manager-DRRWwKE4.js +25 -0
- package/dist/gateway/static/root/assets/{sessions-page-BT0GdXdS.js → sessions-page-uJHS3-6F.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CZ4J3Kuy.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-CEorDLUp.js → settings-advanced-section-D-llwfSj.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-C2LZqBES.js → settings-mode-store-BspMKc9N.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-C_Np_6qZ.js → settings-page-CedwaHM0.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-BAN34UQi.js → settings-page-header-LuOJvqNa.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-B5TVFBV2.js → settings-page-layout-CduQ8w4a.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-BYvTJW3_.js → setup-interaction-page-ujpPGl84.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-UY2dH-sK.js → setup-status-panel-BN2aCJUN.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-BMcXyzr2.js → share-link-dialog-CTATUaa4.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-UQ6eUM2_.js → share-preview-page-Dq0J3VgS.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-DOeDN6Tm.js → shares-api-zegE8pSE.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-W8XhuAoL.js → shares-settings-DXpvsRXq.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-Do_c0d9n.js → skill-api-DCL1EN7f.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-DpHaXI2l.js → skill-list-api-Bv0mmHbu.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-DDRd9IJ2.js → skill-reload-api-DPZbadiO.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-CaeJVKhO.js → skills-page-DMC7Gaku.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DYWlWPJL.js → system-settings-panel-BYFUhlqG.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-De0qD7xw.js → task-detail-page-_Og3plZL.js} +3 -3
- package/dist/gateway/static/root/assets/{task-result-evidence-CICR5K1t.js → task-result-evidence-Bxm8-H0B.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-BbWUcQe7.js → terminal-panel-store-Djf9l2qZ.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-TkG5mo0p.js → theme-store-8GFVtotZ.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-CYXEy4EG.js → tracing-settings-page-oWW3SBZ4.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-DquDm6U2.js → tunnel-api-D-mEsSGF.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-Ot3wZ3oQ.js → understanding-activity-store-CvDjsd0I.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-C5KYFMaC.js → understanding-refresh-store-DzOZJm7A.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-1xFO4smo.js → usage-page-z-o6Uuev.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-HL8XRNR8.js → use-autosave-BVYS8UoK.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-XRlQBdNF.js → use-composer-attachments-lecOV2q5.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-CW956CXS.js → use-file-preview-expanded-nd_CuFsd.js} +2 -2
- package/dist/gateway/static/root/assets/{use-personal-profile-202s6tJt.js → use-personal-profile-CQi2ZCxV.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-CjydkmH1.js → use-workspace-tree-BiaddkzX.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-OGPXx3pe.js → user-model-page-Bks1n0Nj.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-CxFu4MEA.js → voice-api-key-field-BbW8NFeZ.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-MHe5Pn-A.js → voice-config-api-jSMzZWWy.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-B9xc1oK8.js → voice-input-shortcut-events-_SgYmx7X.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-CVEcB6Pe.js → voice-transcribe-api-BJCfiRFU.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-C-JoAg2D.js → work-discovery-overlay-DSTSNyU7.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-B5Kx29Ru.js → work-discovery-page-Dd_QJJvb.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-DGp9cNzH.js → working-directory-picker-modal-q39BUcJ6.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-HBXn8pL9.js → workspace-api-Di2OmCvz.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-B2r9wlix.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-3cpwSG2w.js → workspace-file-preview-dialog-BUGNT765.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-D0VOFvuP.js → workspace-open-location-menu-bMSvmQW7.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-BkdW2p3v.js → xopc-cloud-account-card-Bbe19Del.js} +1 -1
- package/dist/gateway/static/root/index.html +87 -85
- package/dist/package.js +1 -1
- package/dist/packages/computer-control-contract/src/index.js +33 -3
- package/dist/packages/gateway-contract/src/session-identity.js +2 -1
- package/dist/packages/gateway-contract/src/session-input-command.js +19 -2
- package/dist/packages/gateway-contract/src/specialists.js +1 -0
- package/dist/src/agent/embedded/execution-tool-policy.d.ts +1 -1
- package/dist/src/agent/embedded/execution-tool-policy.js +2 -2
- package/dist/src/agent/embedded/run-for-session.js +23 -8
- package/dist/src/agent/embedded/run-turn.js +30 -7
- package/dist/src/agent/embedded/runs.d.ts +2 -2
- package/dist/src/agent/embedded/runs.js +4 -4
- package/dist/src/agent/embedded/session-runner.js +26 -11
- package/dist/src/agent/embedded/tool-search-extension.d.ts +8 -2
- package/dist/src/agent/embedded/tool-search-extension.js +122 -30
- package/dist/src/agent/external-tools/cliProvider.d.ts +10 -9
- package/dist/src/agent/external-tools/cliProvider.js +24 -4
- package/dist/src/agent/external-tools/composio-provider.d.ts +3 -3
- package/dist/src/agent/external-tools/composio-provider.js +6 -3
- package/dist/src/agent/external-tools/discovery.d.ts +47 -0
- package/dist/src/agent/external-tools/discovery.js +56 -0
- package/dist/src/agent/external-tools/gateway-tools.js +26 -46
- package/dist/src/agent/external-tools/index.d.ts +1 -0
- package/dist/src/agent/external-tools/index.js +7 -0
- package/dist/src/agent/external-tools/personal-request-scope.d.ts +7 -0
- package/dist/src/agent/external-tools/personal-request-scope.js +83 -0
- package/dist/src/agent/external-tools/read-policy.js +5 -4
- package/dist/src/agent/external-tools/service.d.ts +2 -0
- package/dist/src/agent/external-tools/service.js +22 -3
- package/dist/src/agent/external-tools/tool-registry.d.ts +6 -0
- package/dist/src/agent/external-tools/types.d.ts +7 -2
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +1 -1
- package/dist/src/agent/inbound/turn-dispatcher.js +3 -2
- package/dist/src/agent/orchestration/llm-turn-retry.d.ts +1 -1
- package/dist/src/agent/orchestration/llm-turn-retry.js +13 -8
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.d.ts +1 -0
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +3 -1
- package/dist/src/agent/prompt/sections/tooling.js +1 -1
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +6 -4
- package/dist/src/agent/tool-manuals/phone.d.ts +1 -1
- package/dist/src/agent/tool-manuals/phone.js +4 -4
- package/dist/src/agent/tool-manuals/xopc-configuration.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-configuration.js +4 -2
- package/dist/src/agent/tools/computer-use-tool.js +7 -6
- package/dist/src/agent/tools/delegation-policy.js +1 -0
- package/dist/src/agent/tools/factory.js +4 -2
- package/dist/src/agent/tools/phone-use-tool.js +2 -2
- package/dist/src/agent/tools/web.js +22 -3
- package/dist/src/agent-matching/service.js +2 -2
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/computer/batch.d.ts +108 -0
- package/dist/src/computer/batch.js +125 -0
- package/dist/src/computer/broker.d.ts +30 -2
- package/dist/src/computer/broker.js +109 -17
- package/dist/src/computer/diagnostics.d.ts +5 -1
- package/dist/src/computer/diagnostics.js +22 -3
- package/dist/src/computer/errors.d.ts +15 -0
- package/dist/src/computer/errors.js +59 -3
- package/dist/src/computer/model-adapter.d.ts +58 -0
- package/dist/src/computer/model-adapter.js +112 -66
- package/dist/src/computer/native-errors.d.ts +2 -0
- package/dist/src/computer/native-errors.js +13 -0
- package/dist/src/computer/program-runtime.d.ts +1 -1
- package/dist/src/computer/program-runtime.js +1 -0
- package/dist/src/computer/runtime.d.ts +11 -0
- package/dist/src/computer/runtime.js +102 -34
- package/dist/src/computer/semantic-actions.js +4 -0
- package/dist/src/config/schema.d.ts +6 -0
- package/dist/src/extensions/agent-plugins/formats.js +2 -1
- package/dist/src/extensions/agent-plugins/inventory.d.ts +2 -0
- package/dist/src/extensions/agent-plugins/inventory.js +4 -1
- package/dist/src/extensions/agent-plugins/validation.d.ts +1 -0
- package/dist/src/extensions/agent-plugins/validation.js +2 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/phone-dependencies.js +26 -5
- package/dist/src/gateway/hono/routes/phone-setup.js +42 -16
- package/dist/src/gateway/hono/routes/phone.js +22 -7
- package/dist/src/gateway/hono/routes/session-command-handler.js +9 -0
- package/dist/src/gateway/hono/routes/session-input-control.d.ts +3 -0
- package/dist/src/gateway/hono/routes/session-input-control.js +37 -0
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +12 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +22 -0
- package/dist/src/gateway/hono/routes/sessions.js +4 -0
- package/dist/src/gateway/service/agent-runner.js +5 -4
- package/dist/src/gateway/service/config-coordinator.d.ts +6 -0
- package/dist/src/gateway/service/session-input-coordinator.d.ts +6 -3
- package/dist/src/gateway/service/session-input-coordinator.js +47 -6
- package/dist/src/gateway/service.d.ts +1 -0
- package/dist/src/gateway/service.js +8 -5
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/personal-agent/capability-service.js +1 -1
- package/dist/src/personal-agent/request-access.d.ts +2 -0
- package/dist/src/personal-agent/request-access.js +22 -2
- package/dist/src/personal-agent/request-service.js +2 -2
- package/dist/src/personal-agent/specialist-capabilities.d.ts +2 -0
- package/dist/src/personal-agent/specialist-capabilities.js +9 -3
- package/dist/src/phone/adb-driver.d.ts +3 -0
- package/dist/src/phone/adb-driver.js +29 -0
- package/dist/src/phone/contracts.d.ts +14 -2
- package/dist/src/phone/contracts.js +8 -1
- package/dist/src/phone/gui-protocol.js +1 -1
- package/dist/src/phone/hdc-driver.d.ts +30 -0
- package/dist/src/phone/hdc-driver.js +331 -0
- package/dist/src/phone/hdc-video-bridge.d.ts +2 -0
- package/dist/src/phone/hdc-video-bridge.js +91 -0
- package/dist/src/phone/hdc-video-tools.d.ts +15 -0
- package/dist/src/phone/hdc-video-tools.js +123 -0
- package/dist/src/phone/hdc-video.d.ts +69 -0
- package/dist/src/phone/hdc-video.js +350 -0
- package/dist/src/phone/interactive-session.js +1 -1
- package/dist/src/phone/live-provider.d.ts +6 -0
- package/dist/src/phone/live-provider.js +1 -0
- package/dist/src/phone/model-adapter.d.ts +3 -0
- package/dist/src/phone/model-adapter.js +5 -3
- package/dist/src/phone/repository.js +2 -1
- package/dist/src/phone/runtime.d.ts +10 -4
- package/dist/src/phone/runtime.js +151 -85
- package/dist/src/phone/setup/service.d.ts +8 -6
- package/dist/src/phone/setup/service.js +33 -16
- package/dist/src/platform/client.d.ts +1 -1
- package/dist/src/platform/contracts.d.ts +1 -1
- package/dist/src/process/phone-process.d.ts +1 -1
- package/dist/src/process/phone-process.js +2 -2
- package/dist/src/runtime-tools/downloader.d.ts +1 -0
- package/dist/src/runtime-tools/downloader.js +8 -4
- package/dist/src/runtime-tools/harmony-dependencies.d.ts +24 -0
- package/dist/src/runtime-tools/harmony-dependencies.js +272 -0
- package/dist/src/runtime-tools/harmony-dependency-catalog.d.ts +4 -0
- package/dist/src/runtime-tools/harmony-dependency-catalog.js +54 -0
- package/dist/src/runtime-tools/harmony-paths.d.ts +9 -0
- package/dist/src/runtime-tools/harmony-paths.js +15 -0
- package/dist/src/runtime-tools/hdc-dependency-catalog.d.ts +8 -0
- package/dist/src/runtime-tools/hdc-dependency-catalog.js +83 -0
- package/dist/src/runtime-tools/hdc-files.d.ts +14 -0
- package/dist/src/runtime-tools/hdc-files.js +87 -0
- package/dist/src/runtime-tools/phone-dependencies.d.ts +6 -1
- package/dist/src/runtime-tools/phone-dependencies.js +20 -2
- package/dist/src/runtime-tools/phone-dependency-catalog.d.ts +10 -1
- package/dist/src/runtime-tools/phone-dependency-catalog.js +2 -0
- package/dist/src/runtime-tools/types.d.ts +1 -1
- 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 +16 -0
- package/dist/src/storage/sqlite/session-creation-repository.js +3 -0
- package/dist/src/storage/sqlite/session-input-control-repository.d.ts +12 -0
- package/dist/src/storage/sqlite/session-input-control-repository.js +83 -0
- package/dist/src/storage/sqlite/session-input-repository.d.ts +2 -0
- package/dist/src/storage/sqlite/session-input-repository.js +17 -5
- package/dist/src/storage/sqlite/session-repository.js +1 -0
- package/dist/src/storage/sqlite/session-turn-replace-repository.d.ts +2 -0
- package/dist/src/storage/sqlite/session-turn-replace-repository.js +14 -2
- package/dist/src/storage/sqlite/upgrades/262_session_input_control.sql +15 -0
- package/package.json +2 -2
- package/skills/tools/configure-xopc/SKILL.md +2 -2
- package/skills/tools/configure-xopc/references/phone/acceptance.md +3 -2
- package/skills/tools/configure-xopc/references/phone/dependencies.md +18 -2
- package/skills/tools/configure-xopc/references/phone/harmonyos.md +16 -0
- package/skills/tools/configure-xopc/references/phone/overview.md +2 -2
- package/skills/tools/configure-xopc/references/scene-index.md +2 -2
- package/dist/gateway/static/root/assets/apps-page-D-n71lO1.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-DWDWy-SG.js +0 -9
- package/dist/gateway/static/root/assets/capabilities-page-IcwojmJK.js +0 -2
- package/dist/gateway/static/root/assets/capability-links-DzQWK1Fh.js +0 -1
- package/dist/gateway/static/root/assets/chat-page-CwP4OMdW.js +0 -72
- package/dist/gateway/static/root/assets/computer-settings-page-DyAlOzqY.js +0 -1
- package/dist/gateway/static/root/assets/connected-providers-grid-D0lXg22c.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DI_Q0CKz.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BFeFfApQ.js +0 -1
- package/dist/gateway/static/root/assets/index-Cz-VjTNd.css +0 -1
- package/dist/gateway/static/root/assets/index-D1_PUrJf.js +0 -11
- package/dist/gateway/static/root/assets/install-connector-dialog-Cn4nRSyt.js +0 -1
- package/dist/gateway/static/root/assets/list-tree-B0OMswgM.js +0 -1
- package/dist/gateway/static/root/assets/messages-jwdBhfL9.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-DGYRJS03.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-CEn_kPsn.js +0 -1
- package/dist/gateway/static/root/assets/phone-dependencies-card-DjmC1Z5j.js +0 -1
- package/dist/gateway/static/root/assets/phone-model-connection-BRjHSgYn.js +0 -1
- package/dist/gateway/static/root/assets/phone-model-picker-DgIiWLhR.js +0 -1
- package/dist/gateway/static/root/assets/phone-settings-page-DCZGCL_z.js +0 -1
- package/dist/gateway/static/root/assets/plugin-details-dialog-D4tGKip4.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-C1BKDjnu.js +0 -2
- package/dist/gateway/static/root/assets/session-api-Bfmlmn9F.js +0 -1
- package/dist/gateway/static/root/assets/session-channel-icon-SsY70Z6t.js +0 -1
- package/dist/gateway/static/root/assets/session-identity-label-B7sgG1PE.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-X4UHOjjO.js +0 -25
- package/dist/gateway/static/root/assets/settings-advanced-gate-Dk9c-Z5e.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-msZa42fU.js +0 -1
|
@@ -11,6 +11,7 @@ import { getAllModels, init_providers, isProviderConfiguredSync } from "../../..
|
|
|
11
11
|
import { normalizePhoneAppAccess, phoneAppAccess } from "../../../phone/app-access.js";
|
|
12
12
|
import { cancelPhoneAssistance, pendingPhoneAssistance, phoneAssistance, phoneAssistanceReport } from "../../../phone/assistance.js";
|
|
13
13
|
import { resolveAdbPath } from "../../../phone/adb-driver.js";
|
|
14
|
+
import { resolveHdcVideoTools } from "../../../phone/hdc-video-tools.js";
|
|
14
15
|
import { createPhoneModel } from "../../../phone/model-adapter.js";
|
|
15
16
|
import { getPhoneRuntime, phoneExecutionContext } from "../../../phone/runtime.js";
|
|
16
17
|
import { registerPhoneSetupRoutes } from "./phone-setup.js";
|
|
@@ -72,6 +73,7 @@ function registerPhoneRoutes(parent, deps, runtime = getPhoneRuntime()) {
|
|
|
72
73
|
body.payload = {
|
|
73
74
|
ownControl: body.payload.ownControl,
|
|
74
75
|
textInput: body.payload.textInput,
|
|
76
|
+
media: body.payload.media,
|
|
75
77
|
report: {
|
|
76
78
|
sessionId,
|
|
77
79
|
deviceId,
|
|
@@ -270,12 +272,18 @@ function registerPhoneRoutes(parent, deps, runtime = getPhoneRuntime()) {
|
|
|
270
272
|
config: service.currentConfig.phone,
|
|
271
273
|
defaultDeviceId: runtime.repository.defaultDevice(),
|
|
272
274
|
runner: "gateway-local",
|
|
273
|
-
agentId: getDefaultAgentId()
|
|
275
|
+
agentId: getDefaultAgentId(),
|
|
276
|
+
hdcVideo: { available: Boolean(resolveHdcVideoTools(service.currentConfig.phone)) }
|
|
274
277
|
}
|
|
275
278
|
}));
|
|
276
279
|
app.patch("/api/phone/settings", strictRateLimitMiddleware, async (c) => {
|
|
277
280
|
const config = PhoneConfigSchema.parse(await c.req.json());
|
|
278
|
-
|
|
281
|
+
const videoChanged = [
|
|
282
|
+
"devecoPath",
|
|
283
|
+
"javaHome",
|
|
284
|
+
"sdkJar"
|
|
285
|
+
].some((key) => config.hdcVideo?.[key] !== service.currentConfig.phone.hdcVideo?.[key]);
|
|
286
|
+
if (!config.enabled || config.adbPath !== service.currentConfig.phone.adbPath || config.hdcPath !== service.currentConfig.phone.hdcPath || videoChanged) await runtime.shutdown();
|
|
279
287
|
const next = structuredClone(service.currentConfig);
|
|
280
288
|
next.phone = config;
|
|
281
289
|
if (!(await service.saveConfig(next)).saved) throw new PhoneError("PHONE_CONFIG_SAVE_FAILED", "Unable to save Phone Use settings");
|
|
@@ -286,10 +294,11 @@ function registerPhoneRoutes(parent, deps, runtime = getPhoneRuntime()) {
|
|
|
286
294
|
});
|
|
287
295
|
});
|
|
288
296
|
app.get("/api/phone/devices", async (c) => {
|
|
297
|
+
const platform = z.enum(["android", "harmonyos"]).optional().parse(c.req.query("platform"));
|
|
289
298
|
let discovery = [];
|
|
290
299
|
let diagnostic;
|
|
291
300
|
try {
|
|
292
|
-
discovery = await runtime.discover(service.currentConfig, c.req.raw.signal);
|
|
301
|
+
discovery = await runtime.discover(service.currentConfig, c.req.raw.signal, platform);
|
|
293
302
|
} catch (error) {
|
|
294
303
|
diagnostic = error instanceof PhoneError ? error.code : "PHONE_ADB_UNAVAILABLE";
|
|
295
304
|
}
|
|
@@ -304,7 +313,10 @@ function registerPhoneRoutes(parent, deps, runtime = getPhoneRuntime()) {
|
|
|
304
313
|
});
|
|
305
314
|
});
|
|
306
315
|
app.get("/api/phone/apps", async (c) => {
|
|
307
|
-
const input = z.object({
|
|
316
|
+
const input = z.object({
|
|
317
|
+
serial: z.string().min(1).max(200),
|
|
318
|
+
platform: z.enum(["android", "harmonyos"]).optional()
|
|
319
|
+
}).strict().parse(c.req.query());
|
|
308
320
|
const applications = await runtime.applications(input, service.currentConfig, c.req.raw.signal);
|
|
309
321
|
c.header("Cache-Control", "no-store");
|
|
310
322
|
return c.json({
|
|
@@ -330,8 +342,8 @@ function registerPhoneRoutes(parent, deps, runtime = getPhoneRuntime()) {
|
|
|
330
342
|
});
|
|
331
343
|
app.post("/api/phone/devices", strictRateLimitMiddleware, async (c) => {
|
|
332
344
|
const input = deviceInput.parse(await c.req.json());
|
|
333
|
-
if (!(await runtime.discover(service.currentConfig, c.req.raw.signal)).some((device) => device.serial === input.serial && device.state === "device")) throw new PhoneError("PHONE_DEVICE_OFFLINE", "Choose a connected and authorized
|
|
334
|
-
const wireless = runtime.wireless.known(input.serial);
|
|
345
|
+
if (!(await runtime.discover(service.currentConfig, c.req.raw.signal, input.platform ?? "android")).some((device) => device.serial === input.serial && (device.platform ?? "android") === (input.platform ?? "android") && device.state === "device")) throw new PhoneError("PHONE_DEVICE_OFFLINE", "Choose a connected and authorized USB device");
|
|
346
|
+
const wireless = input.platform === "harmonyos" ? void 0 : runtime.wireless.known(input.serial);
|
|
335
347
|
if (wireless) input.serial = (await runtime.wireless.connect(resolveAdbPath(service.currentConfig.phone.adbPath), wireless, c.req.raw.signal, wireless)).device.serial;
|
|
336
348
|
const device = runtime.repository.save({
|
|
337
349
|
...input,
|
|
@@ -346,7 +358,10 @@ function registerPhoneRoutes(parent, deps, runtime = getPhoneRuntime()) {
|
|
|
346
358
|
app.patch("/api/phone/devices/:id", strictRateLimitMiddleware, async (c) => {
|
|
347
359
|
const id = c.req.param("id");
|
|
348
360
|
const previous = runtime.repository.get(id);
|
|
349
|
-
const patch = deviceInput.omit({
|
|
361
|
+
const patch = deviceInput.omit({
|
|
362
|
+
serial: true,
|
|
363
|
+
platform: true
|
|
364
|
+
}).partial().parse(await c.req.json());
|
|
350
365
|
const next = normalizePhoneAppAccess({
|
|
351
366
|
...previous,
|
|
352
367
|
...patch,
|
|
@@ -4,6 +4,7 @@ import { conversationIdSchema } from "../../../../packages/gateway-contract/src/
|
|
|
4
4
|
import { sessionInputCommandSchema, sessionMaterializeCommandSchema } from "../../../../packages/gateway-contract/src/session-input-command.js";
|
|
5
5
|
import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packages/gateway-contract/src/user-turn-document.js";
|
|
6
6
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
7
|
+
import { SessionInputControlConflict, init_session_input_control_repository } from "../../../storage/sqlite/session-input-control-repository.js";
|
|
7
8
|
import { endpointTurnClaimSchema, init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
8
9
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
9
10
|
import { parseSlashCommand } from "../../../chat-commands/command-parse.js";
|
|
@@ -17,11 +18,19 @@ import { browserPageContextToAgentContext } from "../../../agent/source-context/
|
|
|
17
18
|
import { receiveSessionCommand, sessionCommandSnapshot } from "../../service/session-command-service.js";
|
|
18
19
|
import { z } from "zod";
|
|
19
20
|
//#region src/gateway/hono/routes/session-command-handler.ts
|
|
21
|
+
init_session_input_control_repository();
|
|
20
22
|
init_src();
|
|
21
23
|
init_src$1();
|
|
22
24
|
init_logger();
|
|
23
25
|
const log = createLogger("Gateway:SessionCommand");
|
|
24
26
|
function commandError(c, error) {
|
|
27
|
+
if (error instanceof SessionInputControlConflict) return c.json({
|
|
28
|
+
ok: false,
|
|
29
|
+
error: {
|
|
30
|
+
code: "CONTROL_CHANGED",
|
|
31
|
+
message: error.message
|
|
32
|
+
}
|
|
33
|
+
}, 409);
|
|
25
34
|
if (error instanceof SessionCommandError) {
|
|
26
35
|
const status = error.code === "BAD_REQUEST" ? 400 : error.code === "SESSION_DELETED" ? 410 : error.code === "FORBIDDEN" ? 403 : error.code === "NOT_FOUND" ? 404 : 409;
|
|
27
36
|
return c.json({
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { sessionInputControlCommandSchema } from "../../../../packages/gateway-contract/src/session-input-command.js";
|
|
2
|
+
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
|
+
import { SessionInputControlConflict, init_session_input_control_repository } from "../../../storage/sqlite/session-input-control-repository.js";
|
|
4
|
+
//#region src/gateway/hono/routes/session-input-control.ts
|
|
5
|
+
init_src();
|
|
6
|
+
init_session_input_control_repository();
|
|
7
|
+
function registerSessionInputControlRoutes(authenticated, { service, chatRateLimitMiddleware }) {
|
|
8
|
+
authenticated.post("/api/sessions/:conversationId/input-control", chatRateLimitMiddleware, async (c) => {
|
|
9
|
+
const command = sessionInputControlCommandSchema.safeParse(await c.req.json().catch(() => null));
|
|
10
|
+
if (!command.success) return c.json({
|
|
11
|
+
ok: false,
|
|
12
|
+
error: {
|
|
13
|
+
code: "BAD_REQUEST",
|
|
14
|
+
message: "Invalid input control"
|
|
15
|
+
}
|
|
16
|
+
}, 400);
|
|
17
|
+
try {
|
|
18
|
+
const state = await service.controlSessionInputs(c.req.param("conversationId"), command.data);
|
|
19
|
+
return c.json({
|
|
20
|
+
ok: true,
|
|
21
|
+
payload: state
|
|
22
|
+
}, state.control.phase === "stopping" ? 202 : 200);
|
|
23
|
+
} catch (error) {
|
|
24
|
+
if (!(error instanceof SessionInputControlConflict)) throw error;
|
|
25
|
+
return c.json({
|
|
26
|
+
ok: false,
|
|
27
|
+
error: {
|
|
28
|
+
code: "CONFLICT",
|
|
29
|
+
message: error.message
|
|
30
|
+
},
|
|
31
|
+
payload: service.getSessionInputState(c.req.param("conversationId"))
|
|
32
|
+
}, 409);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { registerSessionInputControlRoutes };
|
|
@@ -27,6 +27,12 @@ export declare function submitSessionInput(c: Context, deps: AuthenticatedRouteD
|
|
|
27
27
|
ok: true;
|
|
28
28
|
effectiveDelivery: import("../../../storage/sqlite/session-input-repository.js").SessionInputDelivery;
|
|
29
29
|
state: {
|
|
30
|
+
control: {
|
|
31
|
+
paused: boolean;
|
|
32
|
+
version: number;
|
|
33
|
+
phase: "idle" | "running" | "stopping";
|
|
34
|
+
reviewRequired: boolean;
|
|
35
|
+
};
|
|
30
36
|
preparation?: {
|
|
31
37
|
operationId: string;
|
|
32
38
|
revision: number;
|
|
@@ -189,6 +195,12 @@ export declare function replaceLatestSessionTurn(c: Context, deps: Authenticated
|
|
|
189
195
|
ok: true;
|
|
190
196
|
effectiveDelivery: "next";
|
|
191
197
|
state: {
|
|
198
|
+
control: {
|
|
199
|
+
paused: boolean;
|
|
200
|
+
version: number;
|
|
201
|
+
phase: "idle" | "running" | "stopping";
|
|
202
|
+
reviewRequired: boolean;
|
|
203
|
+
};
|
|
192
204
|
preparation?: {
|
|
193
205
|
operationId: string;
|
|
194
206
|
revision: number;
|
|
@@ -4,6 +4,7 @@ import { browserPageContextsInputSchema } from "../../../../packages/gateway-con
|
|
|
4
4
|
import { endpointContextSchema } from "../../../../packages/gateway-contract/src/session-input-command.js";
|
|
5
5
|
import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packages/gateway-contract/src/user-turn-document.js";
|
|
6
6
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
7
|
+
import { SessionInputControlConflict, init_session_input_control_repository } from "../../../storage/sqlite/session-input-control-repository.js";
|
|
7
8
|
import { endpointTurnClaimSchema, init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
8
9
|
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
9
10
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
@@ -21,6 +22,7 @@ import { withModelConfigLock } from "../../../session/model-config-lock.js";
|
|
|
21
22
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
22
23
|
import { browserPageContextToAgentContext } from "../../../agent/source-context/browser-page.js";
|
|
23
24
|
//#region src/gateway/hono/routes/session-input-handler.ts
|
|
25
|
+
init_session_input_control_repository();
|
|
24
26
|
init_src();
|
|
25
27
|
init_src$1();
|
|
26
28
|
init_providers();
|
|
@@ -252,6 +254,15 @@ async function submitSessionInput(c, deps, conversationId, options) {
|
|
|
252
254
|
conversationId
|
|
253
255
|
}
|
|
254
256
|
}, 202);
|
|
257
|
+
}).catch((error) => {
|
|
258
|
+
if (!(error instanceof SessionInputControlConflict)) throw error;
|
|
259
|
+
return c.json({
|
|
260
|
+
ok: false,
|
|
261
|
+
error: {
|
|
262
|
+
code: "CONTROL_CHANGED",
|
|
263
|
+
message: error.message
|
|
264
|
+
}
|
|
265
|
+
}, 409);
|
|
255
266
|
});
|
|
256
267
|
}
|
|
257
268
|
async function replaceLatestSessionTurn(c, deps, conversationId, targetTurnId) {
|
|
@@ -363,6 +374,8 @@ async function replaceLatestSessionTurn(c, deps, conversationId, targetTurnId) {
|
|
|
363
374
|
const result = await deps.service.replaceLatestSessionTurn({
|
|
364
375
|
conversationId,
|
|
365
376
|
targetTurnId,
|
|
377
|
+
expectedTranscriptId: typeof body.expectedTranscriptId === "string" ? body.expectedTranscriptId : void 0,
|
|
378
|
+
controlVersion: typeof body.controlVersion === "number" ? body.controlVersion : void 0,
|
|
366
379
|
clientMessageId: typeof body.clientMessageId === "string" ? body.clientMessageId : "",
|
|
367
380
|
delivery: "next",
|
|
368
381
|
content,
|
|
@@ -392,6 +405,15 @@ async function replaceLatestSessionTurn(c, deps, conversationId, targetTurnId) {
|
|
|
392
405
|
conversationId
|
|
393
406
|
}
|
|
394
407
|
}, 202);
|
|
408
|
+
}).catch((error) => {
|
|
409
|
+
if (!(error instanceof SessionInputControlConflict)) throw error;
|
|
410
|
+
return c.json({
|
|
411
|
+
ok: false,
|
|
412
|
+
error: {
|
|
413
|
+
code: "CONTROL_CHANGED",
|
|
414
|
+
message: error.message
|
|
415
|
+
}
|
|
416
|
+
}, 409);
|
|
395
417
|
});
|
|
396
418
|
}
|
|
397
419
|
//#endregion
|
|
@@ -122,6 +122,7 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
122
122
|
includePinned: true,
|
|
123
123
|
includeConversationId,
|
|
124
124
|
rootConversationsOnly: true,
|
|
125
|
+
excludeAutomationRuns: true,
|
|
125
126
|
sortBy: "updatedAt",
|
|
126
127
|
sortOrder: "desc"
|
|
127
128
|
});
|
|
@@ -141,6 +142,7 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
141
142
|
includePinned: true,
|
|
142
143
|
includeConversationId,
|
|
143
144
|
rootConversationsOnly: true,
|
|
145
|
+
excludeAutomationRuns: true,
|
|
144
146
|
sortBy: "updatedAt",
|
|
145
147
|
sortOrder: "desc"
|
|
146
148
|
});
|
|
@@ -161,6 +163,7 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
161
163
|
includePinned: true,
|
|
162
164
|
includeConversationId,
|
|
163
165
|
rootConversationsOnly: true,
|
|
166
|
+
excludeAutomationRuns: true,
|
|
164
167
|
sortBy: "updatedAt",
|
|
165
168
|
sortOrder: "desc"
|
|
166
169
|
})).items, pinnedLayout, (session) => session.key);
|
|
@@ -277,6 +280,7 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
277
280
|
sources: query.sources?.split(","),
|
|
278
281
|
purposes: query.purposes?.split(","),
|
|
279
282
|
activity: query.activity,
|
|
283
|
+
excludeAutomationRuns: query.excludeAutomationRuns === "true",
|
|
280
284
|
agentId: query.agentId,
|
|
281
285
|
excludeArchived: query.excludeArchived === "true"
|
|
282
286
|
});
|
|
@@ -76,7 +76,7 @@ var GatewayAgentRunner = class {
|
|
|
76
76
|
prioritizeInput: (input) => (input.origin.type !== "system" || input.origin.source === "cli") && isPersonalConversation(input.conversationId),
|
|
77
77
|
interrupt: async (conversationId, runId, reason) => {
|
|
78
78
|
const execution = this.activeExecutionBySession.get(conversationId);
|
|
79
|
-
if (reason !== "connection_cancel" && execution && execution.kind !== "chat") return;
|
|
79
|
+
if (reason !== "connection_cancel" && reason !== "user_stop" && execution && execution.kind !== "chat") return;
|
|
80
80
|
await this.abortAgentRun(runId);
|
|
81
81
|
},
|
|
82
82
|
sessionExists: async (conversationId) => Boolean(await opts.sessionIndex.getSessionMetadata(conversationId)),
|
|
@@ -137,7 +137,7 @@ var GatewayAgentRunner = class {
|
|
|
137
137
|
if (contexts.some((context) => context === null)) throw new Error("A referenced source is unavailable or has changed; select it again");
|
|
138
138
|
return fitSourceContextsToBudget(contexts.filter((context) => context !== null));
|
|
139
139
|
},
|
|
140
|
-
steer: (conversationId, content) => opts.getAgentService().turnDispatcher.steerWebchatSession(conversationId, content),
|
|
140
|
+
steer: (conversationId, content, runId) => opts.getAgentService().turnDispatcher.steerWebchatSession(conversationId, content, runId),
|
|
141
141
|
emit: (type, payload) => {
|
|
142
142
|
opts.emit(type, payload);
|
|
143
143
|
if (type === "session.input-interrupt") opts.publishRealtime("sessions", type, payload);
|
|
@@ -239,10 +239,11 @@ var GatewayAgentRunner = class {
|
|
|
239
239
|
return this.inputs.submit(input);
|
|
240
240
|
}
|
|
241
241
|
replaceLatestSessionTurn(input) {
|
|
242
|
-
return this.inputs.replaceLatestTurn(input, async () => {
|
|
242
|
+
return this.inputs.replaceLatestTurn(input, async (allowAbort) => {
|
|
243
243
|
const activeRunId = this.activeWebchatRunBySession.get(input.conversationId) ?? this.inputs.snapshot(input.conversationId).activeRunId;
|
|
244
|
-
if (activeRunId) await this.abortAgentRun(activeRunId);
|
|
244
|
+
if (activeRunId && allowAbort) await this.abortAgentRun(activeRunId);
|
|
245
245
|
const { evictEmbeddedSessionRunner } = await import("../../agent/embedded/session-runner.js");
|
|
246
|
+
if (!allowAbort && (this.activeWebchatRunBySession.has(input.conversationId) || this.inputs.snapshot(input.conversationId).activeRunId)) return;
|
|
246
247
|
evictEmbeddedSessionRunner(input.conversationId, "gateway_user_turn_replaced");
|
|
247
248
|
this.opts.getAgentService().evictSessionAgent(input.conversationId);
|
|
248
249
|
});
|
|
@@ -341,6 +341,12 @@ export declare class GatewayConfigCoordinator {
|
|
|
341
341
|
maxSessionDurationMs: number;
|
|
342
342
|
idleDisconnectMs: number;
|
|
343
343
|
adbPath?: string;
|
|
344
|
+
hdcPath?: string;
|
|
345
|
+
hdcVideo?: {
|
|
346
|
+
sdkJar?: string;
|
|
347
|
+
devecoPath?: string;
|
|
348
|
+
javaHome?: string;
|
|
349
|
+
};
|
|
344
350
|
};
|
|
345
351
|
tools: {
|
|
346
352
|
web?: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SessionInputControlCommand } from '@xopcai/gateway-contract';
|
|
1
2
|
import { type PhoneAssistance } from '../../phone/assistance.js';
|
|
2
3
|
import type { TurnOrigin } from '@xopcai/endpoint-tools-protocol';
|
|
3
4
|
import type { ConnectionWait } from '@xopcai/gateway-contract';
|
|
@@ -6,6 +7,7 @@ import type { UserTurnAttachment } from '../user-turn-input.js';
|
|
|
6
7
|
import { type AgentSourceContext, type TurnContextRef } from '../../agent/source-context/types.js';
|
|
7
8
|
import { type SessionInputDelivery, type SessionInputState } from '../../storage/sqlite/index.js';
|
|
8
9
|
export type SubmitSessionInput = {
|
|
10
|
+
controlVersion?: number;
|
|
9
11
|
expectedTranscriptId?: string;
|
|
10
12
|
conversationId: string;
|
|
11
13
|
clientMessageId: string;
|
|
@@ -31,7 +33,7 @@ export declare class SessionInputCoordinator {
|
|
|
31
33
|
private readonly pendingConnectionStops;
|
|
32
34
|
constructor(deps: {
|
|
33
35
|
prioritizeInput?: (input: SubmitSessionInput) => boolean;
|
|
34
|
-
interrupt?: (conversationId: string, runId: string, reason?: 'connection_cancel') => Promise<void>;
|
|
36
|
+
interrupt?: (conversationId: string, runId: string, reason?: 'connection_cancel' | 'user_stop') => Promise<void>;
|
|
35
37
|
coalesceWindowMs?: number;
|
|
36
38
|
onInputReceived?: (conversationId: string) => void;
|
|
37
39
|
beforeExecute?: (input: SessionInput) => Promise<boolean>;
|
|
@@ -55,9 +57,10 @@ export declare class SessionInputCoordinator {
|
|
|
55
57
|
}>;
|
|
56
58
|
prepareAttachments: (conversationId: string, attachments?: UserTurnAttachment[]) => Promise<UserTurnAttachment[] | undefined>;
|
|
57
59
|
prepareContexts: (conversationId: string, contextRefs?: TurnContextRef[]) => Promise<AgentSourceContext[] | undefined>;
|
|
58
|
-
steer: (conversationId: string, content: string) => Promise<boolean>;
|
|
60
|
+
steer: (conversationId: string, content: string, runId?: string) => Promise<boolean>;
|
|
59
61
|
emit: (type: string, payload: unknown) => void;
|
|
60
62
|
});
|
|
63
|
+
control(conversationId: string, command: SessionInputControlCommand): Promise<SessionInputState>;
|
|
61
64
|
isAcceptingInput(conversationId: string): boolean;
|
|
62
65
|
snapshot(conversationId: string): SessionInputState;
|
|
63
66
|
resumePhone(conversationId: string, waitId: string): void;
|
|
@@ -97,7 +100,7 @@ export declare class SessionInputCoordinator {
|
|
|
97
100
|
ok: false;
|
|
98
101
|
code: 'BAD_REQUEST' | 'QUEUE_FULL' | 'CONTEXT_UNAVAILABLE' | 'SESSION_CHANGED';
|
|
99
102
|
}>;
|
|
100
|
-
replaceLatestTurn(input: ReplaceLatestTurnInput, beforeReplace: () => Promise<void>): Promise<{
|
|
103
|
+
replaceLatestTurn(input: ReplaceLatestTurnInput, beforeReplace: (allowAbort: boolean) => Promise<void>): Promise<{
|
|
101
104
|
ok: true;
|
|
102
105
|
effectiveDelivery: 'next';
|
|
103
106
|
state: SessionInputState;
|
|
@@ -2,6 +2,7 @@ import { createLogger } from "../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
4
4
|
import { init_session_instance_repository, readCurrentTranscriptId } from "../../storage/sqlite/session-instance-repository.js";
|
|
5
|
+
import { SessionInputControlConflict, acceptSessionInputControl, hasSessionInputControlOperation, init_session_input_control_repository, readSessionInputControl } from "../../storage/sqlite/session-input-control-repository.js";
|
|
5
6
|
import { SessionInstanceChangedError, cancelQueuedSessionInput, claimNextSessionInput, findSessionInput, findSessionInputByRunId, finishSessionInputRun, getSessionInputById, getSessionInputState, init_session_input_repository, insertSessionInput, mutateQueuedSessionInput, recoverSessionInputState, setSessionInputStatus } from "../../storage/sqlite/session-input-repository.js";
|
|
6
7
|
import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-run-repository.js";
|
|
7
8
|
import { cancelConnectionObjective, consumeConnectionResume, getActiveConnectionWait, getConnectionWait, hasPendingConnectionMessages, init_connection_wait_repository, interruptedConnectionMessage, publishConnectionWait, reconcileConnectionWaits } from "../../storage/sqlite/connection-wait-repository.js";
|
|
@@ -19,6 +20,7 @@ import { fitSourceContextsToBudget } from "../../agent/source-context/budget.js"
|
|
|
19
20
|
import crypto from "node:crypto";
|
|
20
21
|
import { isDeepStrictEqual } from "node:util";
|
|
21
22
|
//#region src/gateway/service/session-input-coordinator.ts
|
|
23
|
+
init_session_input_control_repository();
|
|
22
24
|
init_session_input_repository();
|
|
23
25
|
init_connection_wait_repository();
|
|
24
26
|
init_transaction();
|
|
@@ -87,6 +89,36 @@ var SessionInputCoordinator = class {
|
|
|
87
89
|
constructor(deps) {
|
|
88
90
|
this.deps = deps;
|
|
89
91
|
}
|
|
92
|
+
async control(conversationId, command) {
|
|
93
|
+
if (!await this.deps.sessionExists(conversationId)) throw new SessionInputControlConflict("Conversation not found");
|
|
94
|
+
const replay = hasSessionInputControlOperation(conversationId, command.operationId);
|
|
95
|
+
if (!replay && command.turnId) {
|
|
96
|
+
if (!validateLatestSessionTurnTarget(conversationId, command.turnId).ok) throw new SessionInputControlConflict("Only the latest user turn can be edited");
|
|
97
|
+
}
|
|
98
|
+
const row = command.inputId ? getSessionInputById(conversationId, command.inputId) : void 0;
|
|
99
|
+
if (!replay && command.action === "steer" && (!row || row.attachments?.length || row.contextRefs?.length || !canSteerContexts(this.snapshot(conversationId), row.origin, row.contextSnapshots))) throw new SessionInputControlConflict("This input cannot steer the active reply");
|
|
100
|
+
const accepted = acceptSessionInputControl(conversationId, command);
|
|
101
|
+
this.publish(conversationId);
|
|
102
|
+
if (command.action === "steer") {
|
|
103
|
+
if (!accepted.replay && row) try {
|
|
104
|
+
if (!await this.deps.steer(conversationId, steeringText(row.content, row.contextSnapshots), accepted.runId)) setSessionInputStatus(row.id, "interrupted", {
|
|
105
|
+
effectiveDelivery: "next",
|
|
106
|
+
targetRunId: null,
|
|
107
|
+
error: "Current reply ended before steering"
|
|
108
|
+
});
|
|
109
|
+
} catch (err) {
|
|
110
|
+
log.warn({
|
|
111
|
+
err,
|
|
112
|
+
conversationId,
|
|
113
|
+
inputId: row.id
|
|
114
|
+
}, "Steering delivery is awaiting confirmation");
|
|
115
|
+
}
|
|
116
|
+
return this.publish(conversationId);
|
|
117
|
+
}
|
|
118
|
+
if (accepted.runId) await this.deps.interrupt?.(conversationId, accepted.runId, "user_stop");
|
|
119
|
+
if ((command.action === "resume" || command.action === "send") && !accepted.replay) this.drain(conversationId);
|
|
120
|
+
return this.publish(conversationId);
|
|
121
|
+
}
|
|
90
122
|
isAcceptingInput(conversationId) {
|
|
91
123
|
return (this.pendingSubmissions.get(conversationId) ?? 0) > 0;
|
|
92
124
|
}
|
|
@@ -127,7 +159,7 @@ var SessionInputCoordinator = class {
|
|
|
127
159
|
await this.runSubmissionExclusive(input.conversationId, async () => {
|
|
128
160
|
const row = getSessionInputById(conversationId, inputId);
|
|
129
161
|
const state = this.snapshot(input.conversationId);
|
|
130
|
-
if (!row || row.status !== "queued") return;
|
|
162
|
+
if (!row || row.status !== "queued" || state.control.paused) return;
|
|
131
163
|
if (row.payload?.connectionAction === "cancel") this.completeConnectionCancellation(row);
|
|
132
164
|
if (row.payload?.connectionAction || this.connectionTarget(row.conversationId, state)) {
|
|
133
165
|
this.requestConnectionStop(row);
|
|
@@ -143,7 +175,7 @@ var SessionInputCoordinator = class {
|
|
|
143
175
|
targetRunId: state.activeRunId
|
|
144
176
|
});
|
|
145
177
|
try {
|
|
146
|
-
if (!await this.deps.steer(row.conversationId, steeringText(row.content, row.contextSnapshots))) setSessionInputStatus(row.id, "queued", {
|
|
178
|
+
if (!await this.deps.steer(row.conversationId, steeringText(row.content, row.contextSnapshots), state.activeRunId)) setSessionInputStatus(row.id, "queued", {
|
|
147
179
|
effectiveDelivery: "next",
|
|
148
180
|
targetRunId: null
|
|
149
181
|
});
|
|
@@ -276,10 +308,18 @@ var SessionInputCoordinator = class {
|
|
|
276
308
|
code: "CONTEXT_UNAVAILABLE"
|
|
277
309
|
};
|
|
278
310
|
}
|
|
279
|
-
|
|
311
|
+
const controlState = readSessionInputControl(conversationId);
|
|
312
|
+
if (input.controlVersion !== void 0 && input.controlVersion !== controlState.version) throw new SessionInputControlConflict("Queue control changed");
|
|
313
|
+
if ((controlState.paused || input.controlVersion !== void 0) && controlState.phase !== "idle") return {
|
|
314
|
+
ok: false,
|
|
315
|
+
code: "SESSION_BUSY"
|
|
316
|
+
};
|
|
317
|
+
await beforeReplace(input.controlVersion === void 0);
|
|
280
318
|
const result = replaceLatestSessionTurnAndQueueInput({
|
|
281
319
|
conversationId,
|
|
282
320
|
targetTurnId,
|
|
321
|
+
expectedTranscriptId: input.expectedTranscriptId,
|
|
322
|
+
controlVersion: input.controlVersion,
|
|
283
323
|
clientMessageId,
|
|
284
324
|
content,
|
|
285
325
|
attachments,
|
|
@@ -391,8 +431,8 @@ var SessionInputCoordinator = class {
|
|
|
391
431
|
const wait = this.connectionTarget(conversationId, runtime);
|
|
392
432
|
const control = wait?.principalId === "local-owner" ? connectionControl(input, wait) : void 0;
|
|
393
433
|
const payload = connectionInputPayload(wait, control);
|
|
394
|
-
const priority = !wait && input.interrupt !== false && this.deps.prioritizeInput?.(input) === true;
|
|
395
|
-
const canSteer = !wait && !priority && input.delivery === "steer" && runtime.activeRunId !== void 0 && !attachments?.length && canSteerContexts(runtime, input.origin, sourceContexts);
|
|
434
|
+
const priority = !runtime.control.paused && !wait && input.interrupt !== false && this.deps.prioritizeInput?.(input) === true;
|
|
435
|
+
const canSteer = !runtime.control.paused && !wait && !priority && input.delivery === "steer" && runtime.activeRunId !== void 0 && !attachments?.length && canSteerContexts(runtime, input.origin, sourceContexts);
|
|
396
436
|
const effectiveDelivery = canSteer ? "steer" : "next";
|
|
397
437
|
const row = runSqliteWriteTransaction(() => {
|
|
398
438
|
const row = insertSessionInput({
|
|
@@ -428,7 +468,7 @@ var SessionInputCoordinator = class {
|
|
|
428
468
|
};
|
|
429
469
|
}
|
|
430
470
|
if (canSteer) {
|
|
431
|
-
if (!await this.deps.steer(conversationId, steeringText(content, sourceContexts))) {
|
|
471
|
+
if (!await this.deps.steer(conversationId, steeringText(content, sourceContexts), runtime.activeRunId)) {
|
|
432
472
|
setSessionInputStatus(row.id, "queued", {
|
|
433
473
|
effectiveDelivery: "next",
|
|
434
474
|
targetRunId: null
|
|
@@ -478,6 +518,7 @@ var SessionInputCoordinator = class {
|
|
|
478
518
|
this.publish(conversationId);
|
|
479
519
|
continue;
|
|
480
520
|
}
|
|
521
|
+
allowed = allowed && readSessionInputControl(conversationId).phase !== "stopping";
|
|
481
522
|
allowed = allowed && consumeConnectionResume(input) && consumeClarificationResume(input) && consumePhoneAssistance(input);
|
|
482
523
|
} catch (err) {
|
|
483
524
|
log.warn({
|
|
@@ -194,6 +194,7 @@ export declare class GatewayService {
|
|
|
194
194
|
ok: false;
|
|
195
195
|
code: "BAD_REQUEST" | "TARGET_NOT_FOUND" | "NOT_LATEST" | "SESSION_BUSY" | "CONTEXT_UNAVAILABLE";
|
|
196
196
|
}>;
|
|
197
|
+
controlSessionInputs(...args: Parameters<GatewayAgentRunner['inputs']['control']>): Promise<import("../storage/sqlite/session-input-repository.js").SessionInputState>;
|
|
197
198
|
getSessionInputState(...args: Parameters<GatewayAgentRunner['getSessionInputState']>): import("../storage/sqlite/session-input-repository.js").SessionInputState;
|
|
198
199
|
updateSessionInput(...args: Parameters<GatewayAgentRunner['updateSessionInput']>): Promise<{
|
|
199
200
|
ok: boolean;
|
|
@@ -103,6 +103,10 @@ import { DiscussionSealer } from "../discussions/sealer.js";
|
|
|
103
103
|
import "../discussions/index.js";
|
|
104
104
|
import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
|
|
105
105
|
import "../endpoint-tools/index.js";
|
|
106
|
+
import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
|
|
107
|
+
import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
|
|
108
|
+
import { HomeIntelligenceHost } from "../home-intelligence/host.js";
|
|
109
|
+
import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
|
|
106
110
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
107
111
|
import { prepareAutomationAgentSession } from "./automation-agent-session.js";
|
|
108
112
|
import { deliverAutomationCompletion } from "./automation-completion-delivery.js";
|
|
@@ -166,10 +170,6 @@ import { TaskMainUpdateDecisionService } from "../tasks/task-main-update-decisio
|
|
|
166
170
|
import { selectTaskMainUpdateAttempt, submitAndConfirmTaskMainUpdate } from "../tasks/task-main-update-input.js";
|
|
167
171
|
import { checkAppContextAccess, prepareAppContext } from "./service/app-context-access.js";
|
|
168
172
|
import { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults } from "../voice/language-profile.js";
|
|
169
|
-
import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
|
|
170
|
-
import { HomeIntelligenceHost } from "../home-intelligence/host.js";
|
|
171
|
-
import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
|
|
172
|
-
import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
|
|
173
173
|
import crypto from "node:crypto";
|
|
174
174
|
//#region src/gateway/service.ts
|
|
175
175
|
init_session_repository();
|
|
@@ -331,7 +331,7 @@ var GatewayService = class {
|
|
|
331
331
|
type: "system",
|
|
332
332
|
source: "internal"
|
|
333
333
|
},
|
|
334
|
-
content: `MCP configuration is saved. This is the automatic continuation, not the setup turn. Use tool_search with the exact query mcp__${goal.serverId.replace(/-/g, "_")} to discover this server’s native tools, then complete the original user objective. A natural-language tool search may miss the service; retry with this exact namespace before reporting unavailable tools. If the user only requested a connection,
|
|
334
|
+
content: `MCP configuration is saved. This is the automatic continuation, not the setup turn. Use tool_search with the exact query mcp__${goal.serverId.replace(/-/g, "_")} to discover this server’s native tools, then complete the original user objective. A natural-language tool search may miss the service; retry with this exact namespace before reporting unavailable tools. If the user only requested a connection, summarize the discovered capabilities in plain language and recommend three concrete example requests, including the information the user needs to provide, without reading account data or running business tools. Clearly separate a successful connection check from a completed business task; never invent a test result. If the user requested a task, complete it first, then give one or two relevant example requests grounded in the discovered tools, and link the trusted management route ${goal.channel ? `${goal.channel.origin}/#/capabilities/connectors?tab=connected` : "/capabilities/connectors?tab=connected"}. Do not repeat configuration, request secrets, or treat this status as extra write permission. Setup data: ${JSON.stringify({
|
|
335
335
|
serverId: goal.serverId,
|
|
336
336
|
originalObjective: goal.purpose,
|
|
337
337
|
objective: goal.objective
|
|
@@ -1169,6 +1169,9 @@ var GatewayService = class {
|
|
|
1169
1169
|
replaceLatestSessionTurn(...args) {
|
|
1170
1170
|
return this.agentRunner.replaceLatestSessionTurn(...args);
|
|
1171
1171
|
}
|
|
1172
|
+
controlSessionInputs(...args) {
|
|
1173
|
+
return this.agentRunner.inputs.control(...args);
|
|
1174
|
+
}
|
|
1172
1175
|
getSessionInputState(...args) {
|
|
1173
1176
|
return this.agentRunner.getSessionInputState(...args);
|
|
1174
1177
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { HomeAdviceBudgetExceededError, isHomeProseLocalized } from "./generator.js";
|
|
4
3
|
import { homePatternKey } from "./strategy.js";
|
|
5
|
-
import { HomeAdvicePolicy } from "./policy.js";
|
|
6
4
|
import { HomeIntelligenceRepository } from "./repository.js";
|
|
7
5
|
import { HomeOpportunityApplicationService } from "./application-service.js";
|
|
6
|
+
import { HomeAdvicePolicy } from "./policy.js";
|
|
7
|
+
import { HomeAdviceBudgetExceededError, isHomeProseLocalized } from "./generator.js";
|
|
8
8
|
import { buildHomeOpportunityNotification } from "./notification.js";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
//#region src/home-intelligence/host.ts
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { type PersonalRequest } from './request-repository.js';
|
|
2
|
+
/** Pin one tool call to its worker assignment; an account grant cannot revive a superseded call. */
|
|
3
|
+
export declare function createPersonalRequestExecutionAuthorizer(conversationId: string, request: PersonalRequest): () => void;
|
|
2
4
|
/** Revalidate both owner and executor; collaboration cannot grant account access. */
|
|
3
5
|
export declare function assertPersonalRequestAccountAccess(request: PersonalRequest): void;
|
|
@@ -1,16 +1,36 @@
|
|
|
1
1
|
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
2
2
|
import { init_session_instance_repository, readCurrentTranscriptId } from "../storage/sqlite/session-instance-repository.js";
|
|
3
|
-
import {
|
|
3
|
+
import { TaskRunRepository, init_task_run_repository } from "../tasks/task-run-repository.js";
|
|
4
|
+
import { getPersonalRequest, init_request_repository, personalRequestForExecution } from "./request-repository.js";
|
|
4
5
|
import { getConnectorAccount, init_connector_account_repository } from "../storage/sqlite/connector-account-repository.js";
|
|
5
6
|
import { getConnectorConnection, getConnectorInstallation, init_connector_repository } from "../storage/sqlite/connector-repository.js";
|
|
6
7
|
import { canAccessConnectorAccount } from "../connectors/account-access.js";
|
|
7
8
|
import { connectorPrincipalForSession } from "../connectors/principal.js";
|
|
9
|
+
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
8
10
|
//#region src/personal-agent/request-access.ts
|
|
9
11
|
init_connector_account_repository();
|
|
10
12
|
init_connector_repository();
|
|
11
13
|
init_session_instance_repository();
|
|
12
14
|
init_transaction();
|
|
15
|
+
init_task_run_repository();
|
|
13
16
|
init_request_repository();
|
|
17
|
+
/** Pin one tool call to its worker assignment; an account grant cannot revive a superseded call. */
|
|
18
|
+
function createPersonalRequestExecutionAuthorizer(conversationId, request) {
|
|
19
|
+
const conversations = new TaskConversationRepository();
|
|
20
|
+
const runs = new TaskRunRepository();
|
|
21
|
+
const expected = conversations.resolveActiveExecutionSession(conversationId);
|
|
22
|
+
const transcriptId = readCurrentTranscriptId(getSqliteDatabase(), conversationId);
|
|
23
|
+
const authorize = () => {
|
|
24
|
+
const current = conversations.resolveActiveExecutionSession(conversationId);
|
|
25
|
+
const state = request.taskId ? conversations.getState(request.taskId) : void 0;
|
|
26
|
+
const currentRequest = personalRequestForExecution(conversationId);
|
|
27
|
+
const run = request.taskId ? runs.getActiveRoot(request.taskId) : void 0;
|
|
28
|
+
if (!expected || !expected.runId || !current || !run || !transcriptId || expected.taskId !== request.taskId || expected.agentId !== request.executorAgentId || current.id !== expected.id || current.runId !== expected.runId || current.taskId !== expected.taskId || current.agentId !== expected.agentId || current.assignmentEpoch !== expected.assignmentEpoch || state?.status !== "active" || state.activeConversationId !== conversationId || state.currentExecutorAgentId !== expected.agentId || state.assignmentEpoch !== expected.assignmentEpoch || run.id !== expected.runId || run.conversationId !== conversationId || request.parameters.taskRunId && request.parameters.taskRunId !== run.id || currentRequest?.requestId !== request.requestId || currentRequest.taskId !== expected.taskId || currentRequest.parameters.taskRunId && currentRequest.parameters.taskRunId !== run.id || readCurrentTranscriptId(getSqliteDatabase(), conversationId) !== transcriptId) throw new Error("Personal request execution identity changed");
|
|
29
|
+
assertPersonalRequestAccountAccess(request);
|
|
30
|
+
};
|
|
31
|
+
authorize();
|
|
32
|
+
return authorize;
|
|
33
|
+
}
|
|
14
34
|
/** Revalidate both owner and executor; collaboration cannot grant account access. */
|
|
15
35
|
function assertPersonalRequestAccountAccess(request) {
|
|
16
36
|
const current = getPersonalRequest(request.requestId);
|
|
@@ -28,4 +48,4 @@ function assertPersonalRequestAccountAccess(request) {
|
|
|
28
48
|
if (!principal.isLocalOwner || !installation || !connection || account?.connectorId !== request.connectorId || !canAccessConnectorAccount(connection, installation, principal.agentId) || !canAccessConnectorAccount(connection, installation, request.executorAgentId)) throw new Error("Selected account authorization no longer permits this Personal request");
|
|
29
49
|
}
|
|
30
50
|
//#endregion
|
|
31
|
-
export { assertPersonalRequestAccountAccess };
|
|
51
|
+
export { assertPersonalRequestAccountAccess, createPersonalRequestExecutionAuthorizer };
|
|
@@ -50,7 +50,7 @@ function requestAssessment(request, accountId) {
|
|
|
50
50
|
version: 1,
|
|
51
51
|
summary: request.objective.slice(0, 300),
|
|
52
52
|
requiredTools: [
|
|
53
|
-
"
|
|
53
|
+
"tool_search",
|
|
54
54
|
"xopc_tool_describe",
|
|
55
55
|
"xopc_tool_execute"
|
|
56
56
|
],
|
|
@@ -222,7 +222,7 @@ function startPersonalRequest(request, accountId) {
|
|
|
222
222
|
version: 1,
|
|
223
223
|
summary: request.objective.slice(0, 300),
|
|
224
224
|
requiredTools: [
|
|
225
|
-
"
|
|
225
|
+
"tool_search",
|
|
226
226
|
"xopc_tool_describe",
|
|
227
227
|
"xopc_tool_execute"
|
|
228
228
|
],
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { EffectiveAgentConfig } from '../agent-config/index.js';
|
|
2
2
|
import type { Config } from '../config/schema.js';
|
|
3
|
+
/** Legacy allowlists keep their discovery permission; explicit denies still win. */
|
|
4
|
+
export declare function allowsPersonalAgentTool(config: EffectiveAgentConfig, name: string): boolean;
|
|
3
5
|
export declare function getAvailablePersonalAgentTools(config: EffectiveAgentConfig, deps: {
|
|
4
6
|
getConfig?: () => Config | undefined;
|
|
5
7
|
}): string[];
|