@xopcai/xopc 0.0.433 → 0.0.434
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-CmxICTM4.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-R6YNDdAO.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-BJ8PlDjZ.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-DWQ4LbBn.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-l9_vYfdJ.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-BbyV8EiG.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-BWpw9qxc.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-XJXcnE1_.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-DvX9JoEd.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/agent-manager.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- 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 +26 -6
- package/dist/src/agent/external-tools/composio-provider.d.ts +3 -3
- package/dist/src/agent/external-tools/composio-provider.js +8 -5
- 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/endpoint-provider.js +2 -2
- 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/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 +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/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/phone-use-tool.js +2 -2
- package/dist/src/agent/tools/web.js +22 -3
- 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/agent-matching/service.js +2 -2
- 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/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- 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/utils/init-workspace-core.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 +28 -2
- package/dist/src/computer/broker.js +95 -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/agent-profile.js +1 -1
- package/dist/src/config/schema.d.ts +6 -0
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- 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/skill-catalog.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.d.ts +1 -0
- package/dist/src/extensions/agent-plugins/validation.js +3 -2
- package/dist/src/gateway/agent-builtin-tools.d.ts +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/agents.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/phone-dependencies.js +26 -5
- package/dist/src/gateway/hono/routes/phone-setup.js +43 -17
- package/dist/src/gateway/hono/routes/phone.js +22 -7
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- 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 +23 -1
- package/dist/src/gateway/hono/routes/sessions.js +4 -0
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- 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 +4 -1
- 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/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/service.js +1 -1
- 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/archive.js +1 -1
- 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/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/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
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { HDC_DISTRIBUTION } from "./hdc-dependency-catalog.js";
|
|
2
|
+
import { RuntimeError } from "./errors.js";
|
|
3
|
+
import { downloadVerifiedArchive, sha256File } from "./downloader.js";
|
|
4
|
+
import { runtimeDownloadPath } from "./paths.js";
|
|
5
|
+
import { basename, isAbsolute, join } from "node:path";
|
|
6
|
+
import { chmod, copyFile, mkdir, stat, writeFile } from "node:fs/promises";
|
|
7
|
+
//#region src/runtime-tools/hdc-files.ts
|
|
8
|
+
async function verifyFile(path, file) {
|
|
9
|
+
const info = await stat(path);
|
|
10
|
+
if (!info.isFile() || info.size !== file.sizeBytes || await sha256File(path) !== file.sha256) throw new RuntimeError(`HDC file checksum mismatch: ${file.targetName}`, "RUNTIME_CHECKSUM_MISMATCH", "hdc", "verify", true);
|
|
11
|
+
}
|
|
12
|
+
function hdcFiles(asset) {
|
|
13
|
+
if (asset.files?.length !== 2 || asset.archive) throw new Error("A pinned standalone HDC file catalog is required");
|
|
14
|
+
for (const file of asset.files) if (basename(file.targetName) !== file.targetName || file.targetName === "." || file.targetName === ".." || file.targetName.includes("\\")) throw new Error("Invalid HDC target name");
|
|
15
|
+
return asset.files;
|
|
16
|
+
}
|
|
17
|
+
async function verifyHdcFiles(root, asset) {
|
|
18
|
+
for (const file of hdcFiles(asset)) await verifyFile(join(root, file.targetName), file);
|
|
19
|
+
}
|
|
20
|
+
/** Fetch only the host executable and USB library; never download npm packages or SDK archives. */
|
|
21
|
+
async function stageHdcFiles(params) {
|
|
22
|
+
const files = hdcFiles(params.asset);
|
|
23
|
+
const bundle = params.config.download.bundleDir;
|
|
24
|
+
if (bundle && !isAbsolute(bundle)) throw new Error("Offline bundle directory must be an absolute path on the Gateway host");
|
|
25
|
+
if (!bundle && params.config.download.source === "website-only") throw new Error("Select Auto or Direct downloads, or configure an offline bundle directory");
|
|
26
|
+
const totalBytes = files.reduce((sum, file) => sum + file.sizeBytes, 0);
|
|
27
|
+
let completedBytes = 0;
|
|
28
|
+
await mkdir(params.root, { recursive: true });
|
|
29
|
+
for (const file of files) {
|
|
30
|
+
params.check();
|
|
31
|
+
let source;
|
|
32
|
+
if (bundle) source = join(bundle, file.filename);
|
|
33
|
+
else {
|
|
34
|
+
params.progress({
|
|
35
|
+
kind: "hdc",
|
|
36
|
+
phase: "download",
|
|
37
|
+
downloadedBytes: completedBytes,
|
|
38
|
+
totalBytes
|
|
39
|
+
});
|
|
40
|
+
for (const url of [file.url, ...file.fallbackUrls ?? []]) {
|
|
41
|
+
params.check();
|
|
42
|
+
try {
|
|
43
|
+
source = await downloadVerifiedArchive({
|
|
44
|
+
runtime: "hdc",
|
|
45
|
+
url,
|
|
46
|
+
expectedSha256: file.sha256,
|
|
47
|
+
targetPath: runtimeDownloadPath(params.stateDir, file.filename),
|
|
48
|
+
expectedBytes: file.sizeBytes,
|
|
49
|
+
timeoutMs: params.config.download.timeoutMs,
|
|
50
|
+
proxy: params.config.download.proxy,
|
|
51
|
+
signal: params.signal,
|
|
52
|
+
onProgress: (downloadedBytes) => params.progress({
|
|
53
|
+
kind: "hdc",
|
|
54
|
+
phase: "download",
|
|
55
|
+
downloadedBytes: completedBytes + downloadedBytes,
|
|
56
|
+
totalBytes
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
break;
|
|
60
|
+
} catch (error) {
|
|
61
|
+
params.check();
|
|
62
|
+
if (!(error instanceof RuntimeError) || error.code !== "RUNTIME_DOWNLOAD_FAILED" || url === file.fallbackUrls?.at(-1) || !file.fallbackUrls?.length) throw error;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (!source) throw new Error("No standalone HDC file source is available");
|
|
67
|
+
params.check();
|
|
68
|
+
params.progress({
|
|
69
|
+
kind: "hdc",
|
|
70
|
+
phase: "verify"
|
|
71
|
+
});
|
|
72
|
+
await verifyFile(source, file);
|
|
73
|
+
const target = join(params.root, file.targetName);
|
|
74
|
+
await copyFile(source, target);
|
|
75
|
+
if (process.platform !== "win32") await chmod(target, 493);
|
|
76
|
+
completedBytes += file.sizeBytes;
|
|
77
|
+
}
|
|
78
|
+
await writeFile(join(params.root, "source.json"), JSON.stringify({
|
|
79
|
+
distribution: HDC_DISTRIBUTION,
|
|
80
|
+
version: params.asset.version,
|
|
81
|
+
files
|
|
82
|
+
}, null, 2) + "\n", { mode: 384 });
|
|
83
|
+
params.check();
|
|
84
|
+
return params.root;
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { stageHdcFiles, verifyHdcFiles };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
|
+
import type { PhoneConfig } from '../phone/contracts.js';
|
|
2
3
|
import type { RuntimeToolsConfig } from '../config/schema.js';
|
|
3
4
|
import { type PhoneDependencyKind } from './phone-dependency-catalog.js';
|
|
4
5
|
export type PhoneDependencyStatus = {
|
|
@@ -10,6 +11,8 @@ export type PhoneDependencyStatus = {
|
|
|
10
11
|
source?: 'managed' | 'system' | 'custom';
|
|
11
12
|
canInstall: boolean;
|
|
12
13
|
error?: string;
|
|
14
|
+
distribution?: string;
|
|
15
|
+
downloadUrl?: string;
|
|
13
16
|
};
|
|
14
17
|
export type PhoneDependencyProgress = {
|
|
15
18
|
kind: PhoneDependencyKind;
|
|
@@ -27,9 +30,11 @@ export declare class PhoneDependencyManager extends EventEmitter {
|
|
|
27
30
|
stateDir: string;
|
|
28
31
|
config: RuntimeToolsConfig;
|
|
29
32
|
adbPath?: string;
|
|
33
|
+
phone?: PhoneConfig;
|
|
30
34
|
});
|
|
35
|
+
private harmony;
|
|
31
36
|
private operationKey;
|
|
32
|
-
status(): Promise<PhoneDependencyStatus[]>;
|
|
37
|
+
status(kinds?: readonly PhoneDependencyKind[]): Promise<PhoneDependencyStatus[]>;
|
|
33
38
|
private progress;
|
|
34
39
|
private verifyServer;
|
|
35
40
|
/** Installation is explicit; readiness checks and phone viewing never provision tools. */
|
|
@@ -6,6 +6,7 @@ import { runRuntimeCommand } from "./command.js";
|
|
|
6
6
|
import { downloadVerifiedArchive, sha256File } from "./downloader.js";
|
|
7
7
|
import { withInstallLock } from "./install-lock.js";
|
|
8
8
|
import { runtimeDownloadPath } from "./paths.js";
|
|
9
|
+
import { HarmonyDependencyManager } from "./harmony-dependencies.js";
|
|
9
10
|
import { dirname, isAbsolute, join } from "node:path";
|
|
10
11
|
import { randomUUID } from "node:crypto";
|
|
11
12
|
import { EventEmitter } from "node:events";
|
|
@@ -29,11 +30,24 @@ var PhoneDependencyManager = class extends EventEmitter {
|
|
|
29
30
|
super();
|
|
30
31
|
this.options = options;
|
|
31
32
|
}
|
|
33
|
+
harmony() {
|
|
34
|
+
return new HarmonyDependencyManager({
|
|
35
|
+
...this.options,
|
|
36
|
+
phone: this.options.phone ?? { hdcPath: void 0 }
|
|
37
|
+
}, (event) => this.emit("progress", event));
|
|
38
|
+
}
|
|
32
39
|
operationKey(kind) {
|
|
33
40
|
return `${this.options.stateDir}:${kind}`;
|
|
34
41
|
}
|
|
35
|
-
async status(
|
|
36
|
-
|
|
42
|
+
async status(kinds = [
|
|
43
|
+
"adb",
|
|
44
|
+
"scrcpy",
|
|
45
|
+
"hdc",
|
|
46
|
+
"hoscrcpy",
|
|
47
|
+
"java"
|
|
48
|
+
]) {
|
|
49
|
+
return Promise.all(kinds.map(async (kind) => {
|
|
50
|
+
if (kind === "hdc" || kind === "hoscrcpy" || kind === "java") return this.harmony().status(kind);
|
|
37
51
|
const canInstall = this.options.config.enabled && Boolean(phoneDependencyAsset(kind));
|
|
38
52
|
const requestedVersion = kind === "adb" ? ADB_VERSION : SCRCPY_VERSION;
|
|
39
53
|
if (operations.has(this.operationKey(kind))) return {
|
|
@@ -79,6 +93,10 @@ var PhoneDependencyManager = class extends EventEmitter {
|
|
|
79
93
|
}
|
|
80
94
|
/** Installation is explicit; readiness checks and phone viewing never provision tools. */
|
|
81
95
|
async install(kind, options = {}) {
|
|
96
|
+
if (kind === "hdc" || kind === "hoscrcpy" || kind === "java") {
|
|
97
|
+
if (options.sourcePath) throw new Error("Use verified offline bundles for HarmonyOS dependencies");
|
|
98
|
+
return this.harmony().install(kind, options);
|
|
99
|
+
}
|
|
82
100
|
const check = () => {
|
|
83
101
|
options.signal?.throwIfAborted();
|
|
84
102
|
options.beforeCommit?.();
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
export declare const ADB_VERSION = "37.0.1";
|
|
2
2
|
export declare const SCRCPY_VERSION = "3.3.3";
|
|
3
3
|
export declare const SCRCPY_SHA256 = "7e70323ba7f259649dd4acce97ac4fefbae8102b2c6d91e2e7be613fd5354be0";
|
|
4
|
-
export type PhoneDependencyKind = 'adb' | 'scrcpy';
|
|
4
|
+
export type PhoneDependencyKind = 'adb' | 'scrcpy' | 'hdc' | 'hoscrcpy' | 'java';
|
|
5
|
+
export type PhoneDependencyFile = {
|
|
6
|
+
targetName: string;
|
|
7
|
+
filename: string;
|
|
8
|
+
url: string;
|
|
9
|
+
fallbackUrls?: readonly string[];
|
|
10
|
+
sha256: string;
|
|
11
|
+
sizeBytes: number;
|
|
12
|
+
};
|
|
5
13
|
export type PhoneDependencyAsset = {
|
|
6
14
|
kind: PhoneDependencyKind;
|
|
7
15
|
version: string;
|
|
@@ -9,6 +17,7 @@ export type PhoneDependencyAsset = {
|
|
|
9
17
|
url: string;
|
|
10
18
|
sha256: string;
|
|
11
19
|
archive: boolean;
|
|
20
|
+
files?: readonly PhoneDependencyFile[];
|
|
12
21
|
};
|
|
13
22
|
export declare function phoneDependencyAsset(kind: PhoneDependencyKind, platform?: NodeJS.Platform, arch?: NodeJS.Architecture): PhoneDependencyAsset | undefined;
|
|
14
23
|
export declare const managedPhoneAdbDir: (stateDir?: string) => string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../config/paths-state.js";
|
|
2
|
+
import { harmonyDependencyAsset } from "./harmony-dependency-catalog.js";
|
|
2
3
|
import { join } from "node:path";
|
|
3
4
|
//#region src/runtime-tools/phone-dependency-catalog.ts
|
|
4
5
|
init_paths_state();
|
|
@@ -21,6 +22,7 @@ const ADB_ASSETS = {
|
|
|
21
22
|
}
|
|
22
23
|
};
|
|
23
24
|
function phoneDependencyAsset(kind, platform = process.platform, arch = process.arch) {
|
|
25
|
+
if (kind === "hdc" || kind === "hoscrcpy" || kind === "java") return harmonyDependencyAsset(kind, platform, arch);
|
|
24
26
|
if (kind === "scrcpy") {
|
|
25
27
|
const filename = `scrcpy-server-v${SCRCPY_VERSION}`;
|
|
26
28
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RuntimeToolsConfig } from '../config/schema.js';
|
|
2
2
|
export type RuntimeKind = 'node' | 'uv' | 'python';
|
|
3
|
-
export type RuntimeArtifactKind = RuntimeKind | 'adb' | 'scrcpy';
|
|
3
|
+
export type RuntimeArtifactKind = RuntimeKind | 'adb' | 'scrcpy' | 'hdc' | 'hoscrcpy' | 'java';
|
|
4
4
|
export type RuntimeSource = 'managed' | 'system';
|
|
5
5
|
export type RuntimeState = 'disabled' | 'unsupported' | 'absent' | 'installing' | 'ready' | 'degraded' | 'corrupted' | 'failed';
|
|
6
6
|
export interface RuntimeExecutables {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DatabaseSync } from 'node:sqlite';
|
|
2
2
|
export { SCHEMA_META_SCHEMA_VERSION_KEY, readSchemaVersionForTest, readSchemaVersion, setSchemaVersion, ensureSchemaMetaTable } from './schema-version.js';
|
|
3
|
-
export declare const XOPC_DB_SCHEMA_VERSION =
|
|
4
|
-
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION =
|
|
3
|
+
export declare const XOPC_DB_SCHEMA_VERSION = 262;
|
|
4
|
+
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 262;
|
|
5
5
|
export { XOPC_DB_MINIMUM_SCHEMA_VERSION } from './schema-upgrade.js';
|
|
6
6
|
/** Initialize fresh databases directly; upgrade supported installed databases transactionally. */
|
|
7
7
|
export declare function ensureXopcDatabaseSchema(db: DatabaseSync): void;
|
|
@@ -14,18 +14,18 @@ function ensureXopcDatabaseSchema(db) {
|
|
|
14
14
|
const hasMetadata = tables.some((row) => row.name === "schema_meta");
|
|
15
15
|
if (!hasMetadata && tables.length) throw new Error("An unversioned database cannot be initialized");
|
|
16
16
|
const version = hasMetadata ? readSchemaVersion(db) : 0;
|
|
17
|
-
if (version >
|
|
17
|
+
if (version > 262) throw new DatabaseSchemaTooNewError(version, 262);
|
|
18
18
|
if (version > 0 && version < 202) throw new DatabaseSchemaTooOldError(version, 202);
|
|
19
|
-
if (version >= 202 && version <
|
|
20
|
-
upgradeXopcDatabase(db, version,
|
|
19
|
+
if (version >= 202 && version < 262) {
|
|
20
|
+
upgradeXopcDatabase(db, version, 262);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
if (version ===
|
|
23
|
+
if (version === 262) return;
|
|
24
24
|
if (db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name != 'schema_meta' AND name NOT LIKE 'sqlite_%' LIMIT 1").get()) throw new Error("An unversioned database cannot be initialized");
|
|
25
25
|
db.exec("BEGIN IMMEDIATE");
|
|
26
26
|
try {
|
|
27
27
|
db.exec(readSqliteAsset("schema.sql"));
|
|
28
|
-
setSchemaVersion(db,
|
|
28
|
+
setSchemaVersion(db, 262);
|
|
29
29
|
db.exec("COMMIT");
|
|
30
30
|
} catch (error) {
|
|
31
31
|
db.exec("ROLLBACK");
|
|
@@ -40,8 +40,8 @@ var init_schema = __esmMin((() => {
|
|
|
40
40
|
init_schema_version();
|
|
41
41
|
init_schema_errors();
|
|
42
42
|
init_schema_upgrade();
|
|
43
|
-
XOPC_DB_SCHEMA_VERSION =
|
|
44
|
-
XOPC_DB_BASELINE_SCHEMA_VERSION =
|
|
43
|
+
XOPC_DB_SCHEMA_VERSION = 262;
|
|
44
|
+
XOPC_DB_BASELINE_SCHEMA_VERSION = 262;
|
|
45
45
|
}));
|
|
46
46
|
//#endregion
|
|
47
47
|
init_schema();
|
|
@@ -3642,3 +3642,19 @@ CREATE TABLE browser_setup_runs (
|
|
|
3642
3642
|
payload_json TEXT NOT NULL
|
|
3643
3643
|
);
|
|
3644
3644
|
CREATE INDEX browser_setup_conversation ON browser_setup_runs(conversation_id, agent_id, updated_at);
|
|
3645
|
+
|
|
3646
|
+
CREATE TABLE session_input_control (
|
|
3647
|
+
conversation_id TEXT PRIMARY KEY REFERENCES sessions(conversation_id) ON DELETE CASCADE,
|
|
3648
|
+
paused INTEGER NOT NULL DEFAULT 0,
|
|
3649
|
+
version INTEGER NOT NULL DEFAULT 0,
|
|
3650
|
+
stop_run_id TEXT,
|
|
3651
|
+
permitted_input_id TEXT,
|
|
3652
|
+
review_required INTEGER NOT NULL DEFAULT 0
|
|
3653
|
+
);
|
|
3654
|
+
CREATE TABLE session_input_control_operations (
|
|
3655
|
+
conversation_id TEXT NOT NULL REFERENCES sessions(conversation_id) ON DELETE CASCADE,
|
|
3656
|
+
operation_id TEXT NOT NULL,
|
|
3657
|
+
request_json TEXT NOT NULL,
|
|
3658
|
+
run_id TEXT,
|
|
3659
|
+
PRIMARY KEY (conversation_id, operation_id)
|
|
3660
|
+
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
2
|
import { sessionCommandIdentity } from "../../../packages/gateway-contract/src/session-input-command.js";
|
|
3
3
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
4
|
+
import { authorizeSessionInput, init_session_input_control_repository } from "./session-input-control-repository.js";
|
|
4
5
|
import { init_session_input_repository, insertSessionInput } from "./session-input-repository.js";
|
|
5
6
|
import { cancelConnectionObjective, init_connection_wait_repository } from "./connection-wait-repository.js";
|
|
6
7
|
import { getSessionMetadata } from "./session-read-repository.js";
|
|
@@ -13,6 +14,7 @@ import { createHash, randomUUID } from "node:crypto";
|
|
|
13
14
|
init_src();
|
|
14
15
|
init_conversation_repository();
|
|
15
16
|
init_session_repository();
|
|
17
|
+
init_session_input_control_repository();
|
|
16
18
|
init_session_input_repository();
|
|
17
19
|
init_connection_wait_repository();
|
|
18
20
|
init_transaction();
|
|
@@ -103,6 +105,7 @@ function acceptSessionCommand(input) {
|
|
|
103
105
|
}
|
|
104
106
|
const transcriptId = session.transcriptId;
|
|
105
107
|
const inputId = input.preparedInput ? randomUUID() : null;
|
|
108
|
+
if ("kind" in command && command.kind === "append" && inputId) authorizeSessionInput(conversationId, inputId, command.controlVersion, command.execution === "single");
|
|
106
109
|
if (input.preparedInput && inputId) insertSessionInput({
|
|
107
110
|
...input.preparedInput,
|
|
108
111
|
conversationId,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type SessionInputControlCommand, type SessionInputControlView } from '@xopcai/gateway-contract';
|
|
2
|
+
export declare class SessionInputControlConflict extends Error {
|
|
3
|
+
}
|
|
4
|
+
export declare function readSessionInputControl(conversationId: string): SessionInputControlView;
|
|
5
|
+
export declare function hasSessionInputControlOperation(conversationId: string, operationId: string): boolean;
|
|
6
|
+
/** The pause fence commits before any asynchronous cancellation or context preparation. */
|
|
7
|
+
export declare function acceptSessionInputControl(conversationId: string, command: SessionInputControlCommand): {
|
|
8
|
+
runId?: string;
|
|
9
|
+
replay: boolean;
|
|
10
|
+
};
|
|
11
|
+
/** Called inside the input acceptance transaction, never as a later HTTP side effect. */
|
|
12
|
+
export declare function authorizeSessionInput(conversationId: string, inputId: string, version?: number, single?: boolean): void;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "./transaction.js";
|
|
3
|
+
import { canonicalSessionCommand } from "../../../packages/gateway-contract/src/session-input-command.js";
|
|
4
|
+
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
5
|
+
import { init_session_instance_repository, readCurrentTranscriptId } from "./session-instance-repository.js";
|
|
6
|
+
//#region src/storage/sqlite/session-input-control-repository.ts
|
|
7
|
+
function readSessionInputControl(conversationId) {
|
|
8
|
+
const db = getSqliteDatabase();
|
|
9
|
+
const row = db.prepare(`SELECT paused, version, stop_run_id, review_required FROM session_input_control WHERE conversation_id = ?`).get(conversationId);
|
|
10
|
+
const runtime = db.prepare("SELECT active_run_id FROM session_input_runtime WHERE conversation_id = ?").get(conversationId);
|
|
11
|
+
return {
|
|
12
|
+
paused: Boolean(row?.paused),
|
|
13
|
+
version: row?.version ?? 0,
|
|
14
|
+
reviewRequired: Boolean(row?.review_required),
|
|
15
|
+
phase: row?.stop_run_id ? "stopping" : runtime?.active_run_id ? "running" : "idle"
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function hasSessionInputControlOperation(conversationId, operationId) {
|
|
19
|
+
return Boolean(getSqliteDatabase().prepare("SELECT 1 FROM session_input_control_operations WHERE conversation_id = ? AND operation_id = ?").get(conversationId, operationId));
|
|
20
|
+
}
|
|
21
|
+
/** The pause fence commits before any asynchronous cancellation or context preparation. */
|
|
22
|
+
function acceptSessionInputControl(conversationId, command) {
|
|
23
|
+
return runSqliteWriteTransaction((db) => {
|
|
24
|
+
const request = canonicalSessionCommand(command);
|
|
25
|
+
const previous = db.prepare("SELECT request_json, run_id FROM session_input_control_operations WHERE conversation_id = ? AND operation_id = ?").get(conversationId, command.operationId);
|
|
26
|
+
if (previous) {
|
|
27
|
+
if (previous.request_json !== request) throw new SessionInputControlConflict("Operation identity was reused");
|
|
28
|
+
return {
|
|
29
|
+
replay: true,
|
|
30
|
+
runId: db.prepare("SELECT stop_run_id FROM session_input_control WHERE conversation_id = ?").get(conversationId)?.stop_run_id === previous.run_id ? previous.run_id ?? void 0 : void 0
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (readCurrentTranscriptId(db, conversationId) !== command.expectedTranscriptId) throw new SessionInputControlConflict("Conversation transcript changed");
|
|
34
|
+
const state = readSessionInputControl(conversationId);
|
|
35
|
+
if (state.version !== command.expectedVersion) throw new SessionInputControlConflict("Queue control changed");
|
|
36
|
+
if ((command.action === "resume" || command.action === "send" || command.action === "steer") && state.phase === "stopping") throw new SessionInputControlConflict("Wait for stopping to finish");
|
|
37
|
+
if ((command.action === "send" || command.action === "steer") && !command.inputId) throw new SessionInputControlConflict("Select an input");
|
|
38
|
+
if (command.action === "send" && state.phase !== "idle") throw new SessionInputControlConflict("Wait for the active input to finish");
|
|
39
|
+
if (command.action === "send" && db.prepare("SELECT 1 FROM session_input_control WHERE conversation_id = ? AND permitted_input_id IS NOT NULL").get(conversationId)) throw new SessionInputControlConflict("Another input is awaiting execution");
|
|
40
|
+
if (command.action === "steer" && state.phase !== "running") throw new SessionInputControlConflict("No active reply to steer");
|
|
41
|
+
if (command.inputId) {
|
|
42
|
+
const row = db.prepare("SELECT status, version, expected_transcript_id FROM session_inputs WHERE conversation_id = ? AND id = ?").get(conversationId, command.inputId);
|
|
43
|
+
if (row?.expected_transcript_id && row.expected_transcript_id !== command.expectedTranscriptId) throw new SessionInputControlConflict("Input belongs to an earlier transcript");
|
|
44
|
+
if (!row || row.status !== "queued" && !(command.action === "send" && row.status === "interrupted") || row.version !== command.inputVersion) throw new SessionInputControlConflict("This input changed or has started");
|
|
45
|
+
}
|
|
46
|
+
const runtime = db.prepare("SELECT active_run_id FROM session_input_runtime WHERE conversation_id = ?").get(conversationId);
|
|
47
|
+
const runId = command.action === "stop" || command.action === "steer" ? runtime?.active_run_id ?? void 0 : void 0;
|
|
48
|
+
db.prepare(`INSERT INTO session_input_runtime(conversation_id, revision, updated_at_ms) VALUES (?, 0, ?) ON CONFLICT DO NOTHING`).run(conversationId, Date.now());
|
|
49
|
+
db.prepare(`INSERT INTO session_input_control(conversation_id) VALUES (?) ON CONFLICT DO NOTHING`).run(conversationId);
|
|
50
|
+
db.prepare(`UPDATE session_input_control SET paused = ?, version = version + 1,
|
|
51
|
+
stop_run_id = CASE WHEN ? = 'stop' THEN ? ELSE stop_run_id END,
|
|
52
|
+
permitted_input_id = ?, review_required = CASE WHEN ? = 'resume' THEN 0 ELSE review_required END WHERE conversation_id = ?`).run(command.action === "steer" ? Number(state.paused) : command.action === "resume" ? 0 : 1, command.action, command.action === "stop" ? runId ?? null : null, command.action === "send" ? command.inputId : null, command.action, conversationId);
|
|
53
|
+
if (command.action === "send") db.prepare("UPDATE session_inputs SET status = 'queued', effective_delivery = 'next', target_run_id = NULL, version = version + 1, updated_at_ms = ? WHERE id = ?").run(Date.now(), command.inputId);
|
|
54
|
+
if (command.action === "steer") db.prepare("UPDATE session_inputs SET status = 'injecting', effective_delivery = 'steer', target_run_id = ?, version = version + 1, updated_at_ms = ? WHERE id = ?").run(runId, Date.now(), command.inputId);
|
|
55
|
+
db.prepare(`INSERT INTO session_input_control_operations(conversation_id, operation_id, request_json, run_id) VALUES (?, ?, ?, ?)`).run(conversationId, command.operationId, request, runId ?? null);
|
|
56
|
+
db.prepare(`UPDATE session_input_runtime SET revision = revision + 1 WHERE conversation_id = ?`).run(conversationId);
|
|
57
|
+
return {
|
|
58
|
+
runId,
|
|
59
|
+
replay: false
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/** Called inside the input acceptance transaction, never as a later HTTP side effect. */
|
|
64
|
+
function authorizeSessionInput(conversationId, inputId, version, single = false) {
|
|
65
|
+
const db = getSqliteDatabase();
|
|
66
|
+
const state = readSessionInputControl(conversationId);
|
|
67
|
+
if (version !== void 0 && state.version !== version) throw new SessionInputControlConflict("Queue control changed; retry after refreshing");
|
|
68
|
+
if (!single) return;
|
|
69
|
+
if (version === void 0 || state.phase !== "idle") throw new SessionInputControlConflict("Wait for the active input to finish");
|
|
70
|
+
if (db.prepare("SELECT permitted_input_id FROM session_input_control WHERE conversation_id = ?").get(conversationId)?.permitted_input_id) throw new SessionInputControlConflict("Another input is awaiting execution");
|
|
71
|
+
db.prepare(`INSERT INTO session_input_control(conversation_id, paused, permitted_input_id, version) VALUES (?, 1, ?, 1)
|
|
72
|
+
ON CONFLICT(conversation_id) DO UPDATE SET paused = 1, permitted_input_id = excluded.permitted_input_id, version = version + 1`).run(conversationId, inputId);
|
|
73
|
+
}
|
|
74
|
+
var SessionInputControlConflict;
|
|
75
|
+
var init_session_input_control_repository = __esmMin((() => {
|
|
76
|
+
init_src();
|
|
77
|
+
init_session_instance_repository();
|
|
78
|
+
init_transaction();
|
|
79
|
+
SessionInputControlConflict = class extends Error {};
|
|
80
|
+
}));
|
|
81
|
+
//#endregion
|
|
82
|
+
init_session_input_control_repository();
|
|
83
|
+
export { SessionInputControlConflict, acceptSessionInputControl, authorizeSessionInput, hasSessionInputControlOperation, init_session_input_control_repository, readSessionInputControl };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readSessionInputControl } from './session-input-control-repository.js';
|
|
1
2
|
import { getSqliteDatabase } from './transaction.js';
|
|
2
3
|
import { type TurnOrigin } from '@xopcai/endpoint-tools-protocol';
|
|
3
4
|
import type { SessionPreparationView } from '@xopcai/gateway-contract';
|
|
@@ -56,6 +57,7 @@ export type SessionInput = {
|
|
|
56
57
|
updatedAtMs: number;
|
|
57
58
|
};
|
|
58
59
|
export type SessionInputState = {
|
|
60
|
+
control: ReturnType<typeof readSessionInputControl>;
|
|
59
61
|
preparation?: SessionPreparationView;
|
|
60
62
|
conversationId: string;
|
|
61
63
|
revision: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "./transaction.js";
|
|
3
3
|
import { init_session_instance_repository, readCurrentTranscriptId } from "./session-instance-repository.js";
|
|
4
|
+
import { init_session_input_control_repository, readSessionInputControl } from "./session-input-control-repository.js";
|
|
4
5
|
import { init_src, turnOriginSchema } from "../../../packages/endpoint-tools-protocol/src/index.js";
|
|
5
6
|
//#region src/storage/sqlite/session-input-repository.ts
|
|
6
7
|
function mapInput(row) {
|
|
@@ -50,6 +51,7 @@ function getSessionInputState(conversationId) {
|
|
|
50
51
|
('queued','running','injecting','interrupted') ORDER BY position, created_at_ms, id`).all(conversationId);
|
|
51
52
|
return {
|
|
52
53
|
conversationId,
|
|
54
|
+
control: readSessionInputControl(conversationId),
|
|
53
55
|
...preparation ? { preparation } : {},
|
|
54
56
|
revision: runtime?.revision ?? 0,
|
|
55
57
|
activeRunId: runtime?.active_run_id ?? void 0,
|
|
@@ -148,19 +150,24 @@ function claimNextSessionInput(conversationId, runId, expectedInputId) {
|
|
|
148
150
|
if (db.prepare("SELECT 1 FROM session_tombstones WHERE conversation_id=?").get(conversationId)) return void 0;
|
|
149
151
|
ensureRuntime(db, conversationId);
|
|
150
152
|
if (db.prepare(`SELECT active_run_id FROM session_input_runtime WHERE conversation_id = ?`).get(conversationId).active_run_id) return void 0;
|
|
153
|
+
const control = db.prepare("SELECT paused, stop_run_id, permitted_input_id FROM session_input_control WHERE conversation_id = ?").get(conversationId);
|
|
154
|
+
if (control?.stop_run_id || control?.paused && !control.permitted_input_id) return void 0;
|
|
151
155
|
if (db.prepare(`UPDATE session_inputs SET status = 'interrupted', error = 'Session changed before delivery',
|
|
152
156
|
version = version + 1, updated_at_ms = ? WHERE conversation_id = ? AND status = 'queued'
|
|
153
157
|
AND expected_transcript_id IS NOT NULL AND expected_transcript_id IS NOT ?`).run(Date.now(), conversationId, readCurrentTranscriptId(db, conversationId)).changes) bumpSessionInputRevision(db, conversationId);
|
|
154
158
|
const row = db.prepare(`${SELECT_INPUTS} WHERE conversation_id = ? AND effective_delivery = 'next'
|
|
155
|
-
AND status = 'queued' AND (kind != 'connection_resume' OR NOT EXISTS (
|
|
159
|
+
AND status = 'queued' AND (? IS NULL OR id = ?) AND (kind != 'connection_resume' OR NOT EXISTS (
|
|
156
160
|
SELECT 1 FROM session_inputs barrier WHERE barrier.conversation_id = session_inputs.conversation_id
|
|
157
161
|
AND barrier.status = 'interrupted' AND barrier.kind = 'message'
|
|
158
162
|
AND json_extract(barrier.payload_json, '$.connectionBarrier') = 1
|
|
159
163
|
AND json_extract(barrier.payload_json, '$.waitId') = json_extract(session_inputs.payload_json, '$.waitId')
|
|
160
164
|
AND json_extract(barrier.payload_json, '$.objectiveRevision') = json_extract(session_inputs.payload_json, '$.objectiveRevision')
|
|
161
165
|
)) ORDER BY CASE WHEN kind = 'connection_resume' THEN 1 ELSE 0 END,
|
|
162
|
-
interrupt_requested DESC, position, created_at_ms, id LIMIT 1`).get(conversationId);
|
|
163
|
-
if (!row)
|
|
166
|
+
interrupt_requested DESC, position, created_at_ms, id LIMIT 1`).get(conversationId, control?.paused ? control.permitted_input_id : null, control?.paused ? control.permitted_input_id : null);
|
|
167
|
+
if (!row) {
|
|
168
|
+
if (control?.permitted_input_id) db.prepare("UPDATE session_input_control SET permitted_input_id = NULL WHERE conversation_id = ?").run(conversationId);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
164
171
|
if (expectedInputId && row.id !== expectedInputId) return void 0;
|
|
165
172
|
const now = Date.now();
|
|
166
173
|
if (row.kind === "message" && !JSON.parse(row.payload_json ?? "{}").connectionAction) db.prepare(`UPDATE session_inputs SET payload_json = COALESCE((
|
|
@@ -174,9 +181,10 @@ function claimNextSessionInput(conversationId, runId, expectedInputId) {
|
|
|
174
181
|
updated_at_ms = ? WHERE id = ?`).run(runId, now, row.id);
|
|
175
182
|
db.prepare(`UPDATE session_input_runtime SET active_run_id = ?, active_input_id = ?,
|
|
176
183
|
revision = revision + 1, updated_at_ms = ? WHERE conversation_id = ?`).run(runId, row.id, now, conversationId);
|
|
184
|
+
db.prepare("UPDATE session_input_control SET permitted_input_id = NULL WHERE conversation_id = ?").run(conversationId);
|
|
177
185
|
const claimed = mapInput(db.prepare(`${SELECT_INPUTS} WHERE id = ?`).get(row.id));
|
|
178
186
|
const hasMaterial = (value) => Boolean(value.attachments_json && JSON.parse(value.attachments_json).length || value.context_snapshots_json && JSON.parse(value.context_snapshots_json).length);
|
|
179
|
-
if (row.interrupt_requested && !claimed.payload?.connectionAction && !hasMaterial(row)) {
|
|
187
|
+
if (!control?.paused && row.interrupt_requested && !claimed.payload?.connectionAction && !hasMaterial(row)) {
|
|
180
188
|
const pending = db.prepare(`${SELECT_INPUTS} WHERE conversation_id = ? AND status = 'queued'
|
|
181
189
|
ORDER BY interrupt_requested DESC, position, created_at_ms, id LIMIT 10`).all(conversationId);
|
|
182
190
|
for (const next of pending) {
|
|
@@ -203,6 +211,7 @@ function finishSessionInputRun(conversationId, runId, status, error) {
|
|
|
203
211
|
db.prepare(`UPDATE session_input_runtime SET active_run_id = NULL, active_input_id = NULL,
|
|
204
212
|
revision = revision + 1, updated_at_ms = ?
|
|
205
213
|
WHERE conversation_id = ?`).run(now, conversationId);
|
|
214
|
+
db.prepare("UPDATE session_input_control SET stop_run_id = NULL WHERE conversation_id = ? AND stop_run_id = ?").run(conversationId, runId);
|
|
206
215
|
return true;
|
|
207
216
|
});
|
|
208
217
|
}
|
|
@@ -219,7 +228,7 @@ function setSessionInputStatus(id, status, patch) {
|
|
|
219
228
|
function mutateQueuedSessionInput(input) {
|
|
220
229
|
return runSqliteWriteTransaction((db) => {
|
|
221
230
|
const row = db.prepare(`${SELECT_INPUTS} WHERE id = ? AND conversation_id = ?`).get(input.id, input.conversationId);
|
|
222
|
-
if (!row || row.kind !== "message" || row.status !== "queued" || row.version !== input.version) return false;
|
|
231
|
+
if (!row || row.kind !== "message" || row.status !== "queued" || row.version !== input.version || row.expected_transcript_id && row.expected_transcript_id !== readCurrentTranscriptId(db, input.conversationId)) return false;
|
|
223
232
|
const now = Date.now();
|
|
224
233
|
if (input.position !== void 0) {
|
|
225
234
|
const ordered = db.prepare(`${SELECT_INPUTS} WHERE conversation_id = ? AND status = 'queued' ORDER BY position, created_at_ms, id`).all(input.conversationId).filter((item) => item.id !== input.id);
|
|
@@ -241,6 +250,7 @@ function cancelQueuedSessionInput(conversationId, id, version) {
|
|
|
241
250
|
const result = db.prepare(`UPDATE session_inputs SET status = 'cancelled', version = version + 1,
|
|
242
251
|
updated_at_ms = ? WHERE id = ? AND conversation_id = ? AND version = ? AND kind = 'message' AND status IN ('queued','interrupted')`).run(Date.now(), id, conversationId, version);
|
|
243
252
|
if (Number(result.changes) === 0) return false;
|
|
253
|
+
db.prepare("UPDATE session_input_control SET permitted_input_id = NULL, version = version + 1 WHERE conversation_id = ? AND permitted_input_id = ?").run(conversationId, id);
|
|
244
254
|
bumpSessionInputRevision(db, conversationId);
|
|
245
255
|
return true;
|
|
246
256
|
});
|
|
@@ -268,11 +278,13 @@ function recoverSessionInputState() {
|
|
|
268
278
|
AND json_extract(payload_json, '$.connectionAction') IN ('continue','cancel')`).run(now);
|
|
269
279
|
db.prepare(`UPDATE session_input_runtime SET active_run_id = NULL, active_input_id = NULL,
|
|
270
280
|
revision = revision + 1, updated_at_ms = ?`).run(now);
|
|
281
|
+
db.prepare("UPDATE session_input_control SET stop_run_id = NULL").run();
|
|
271
282
|
return keys.map((row) => row.conversation_id);
|
|
272
283
|
});
|
|
273
284
|
}
|
|
274
285
|
var SELECT_INPUTS, SessionInstanceChangedError;
|
|
275
286
|
var init_session_input_repository = __esmMin((() => {
|
|
287
|
+
init_session_input_control_repository();
|
|
276
288
|
init_session_instance_repository();
|
|
277
289
|
init_transaction();
|
|
278
290
|
init_src();
|
|
@@ -60,6 +60,7 @@ function listSessionMetadata(query = {}) {
|
|
|
60
60
|
conditions.push(`s.hidden_from_session_list = 0`);
|
|
61
61
|
conditions.push(`NOT (s.source_channel = 'automation' AND (COALESCE(CASE WHEN json_valid(s.custom_data_json) THEN json_extract(s.custom_data_json, '$.systemInternal') END, 0) = 1 OR COALESCE(CASE WHEN json_valid(s.custom_data_json) THEN json_extract(s.custom_data_json, '$.automationId') END, '') LIKE 'system-memory-%'))`);
|
|
62
62
|
}
|
|
63
|
+
if (query.excludeAutomationRuns) conditions.push(`${SESSION_SOURCE_SQL} != 'automation'`);
|
|
63
64
|
if (query.rootConversationsOnly && !query.search?.trim()) {
|
|
64
65
|
conditions.push(`NOT EXISTS (
|
|
65
66
|
SELECT 1 FROM task_sessions worker
|
|
@@ -4,6 +4,8 @@ import type { AgentSourceContext, SourceContextRefSummary } from '../../agent/so
|
|
|
4
4
|
export type ReplaceLatestSessionTurnInput = {
|
|
5
5
|
conversationId: string;
|
|
6
6
|
targetTurnId: string;
|
|
7
|
+
expectedTranscriptId?: string;
|
|
8
|
+
controlVersion?: number;
|
|
7
9
|
clientMessageId: string;
|
|
8
10
|
content: string;
|
|
9
11
|
attachments?: unknown[];
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { getXopcDatabase, init_connection } from "./connection.js";
|
|
2
2
|
import { init_transaction, runSqliteWriteTransaction } from "./transaction.js";
|
|
3
|
+
import { authorizeSessionInput, init_session_input_control_repository, readSessionInputControl } from "./session-input-control-repository.js";
|
|
3
4
|
import { buildSessionContextForLlm, buildSessionDisplayMessages, init_session_context_for_llm } from "../../session/session-context-for-llm.js";
|
|
4
5
|
import { estimateTokensFromMessages, init_row_mappers, transcriptEntryRowToStoredRow } from "./row-mappers.js";
|
|
5
6
|
import { randomUUID } from "node:crypto";
|
|
6
7
|
//#region src/storage/sqlite/session-turn-replace-repository.ts
|
|
7
8
|
init_session_context_for_llm();
|
|
8
9
|
init_row_mappers();
|
|
10
|
+
init_session_input_control_repository();
|
|
9
11
|
init_connection();
|
|
10
12
|
init_transaction();
|
|
11
13
|
function isUserRow(row) {
|
|
@@ -65,10 +67,16 @@ function replaceLatestSessionTurnAndQueueInput(input) {
|
|
|
65
67
|
db.prepare(`INSERT INTO session_input_runtime(conversation_id, revision, updated_at_ms)
|
|
66
68
|
VALUES (?, 0, ?) ON CONFLICT(conversation_id) DO NOTHING`).run(input.conversationId, Date.now());
|
|
67
69
|
const runtime = db.prepare(`SELECT active_run_id FROM session_input_runtime WHERE conversation_id = ?`).get(input.conversationId);
|
|
70
|
+
const control = readSessionInputControl(input.conversationId);
|
|
71
|
+
if (input.expectedTranscriptId && session.transcript_id !== input.expectedTranscriptId) return {
|
|
72
|
+
ok: false,
|
|
73
|
+
code: "TARGET_NOT_FOUND"
|
|
74
|
+
};
|
|
68
75
|
const pending = db.prepare(`SELECT 1 AS found FROM session_inputs
|
|
69
|
-
WHERE conversation_id = ? AND status IN ('
|
|
76
|
+
WHERE conversation_id = ? AND status IN ('running', 'injecting', 'interrupted')
|
|
70
77
|
LIMIT 1`).get(input.conversationId);
|
|
71
|
-
|
|
78
|
+
const queued = !control.paused && db.prepare("SELECT 1 FROM session_inputs WHERE conversation_id = ? AND status = 'queued' LIMIT 1").get(input.conversationId);
|
|
79
|
+
if (runtime?.active_run_id || pending || queued || control.phase === "stopping") return {
|
|
72
80
|
ok: false,
|
|
73
81
|
code: "SESSION_BUSY"
|
|
74
82
|
};
|
|
@@ -95,6 +103,10 @@ function replaceLatestSessionTurnAndQueueInput(input) {
|
|
|
95
103
|
const maxPosition = db.prepare(`SELECT COALESCE(MAX(position), 0) AS value FROM session_inputs
|
|
96
104
|
WHERE conversation_id = ? AND status IN ('queued', 'running', 'injecting', 'interrupted')`).get(input.conversationId);
|
|
97
105
|
const inputId = randomUUID();
|
|
106
|
+
if (control.paused) {
|
|
107
|
+
authorizeSessionInput(input.conversationId, inputId, input.controlVersion, true);
|
|
108
|
+
db.prepare("UPDATE session_input_control SET review_required = 1 WHERE conversation_id = ?").run(input.conversationId);
|
|
109
|
+
}
|
|
98
110
|
db.prepare(`INSERT INTO session_inputs(id, conversation_id, client_message_id,
|
|
99
111
|
requested_delivery, effective_delivery, status, content, attachments_json,
|
|
100
112
|
context_refs_json, context_snapshots_json, thinking, origin_json, position,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
CREATE TABLE session_input_control (
|
|
2
|
+
conversation_id TEXT PRIMARY KEY REFERENCES sessions(conversation_id) ON DELETE CASCADE,
|
|
3
|
+
paused INTEGER NOT NULL DEFAULT 0,
|
|
4
|
+
version INTEGER NOT NULL DEFAULT 0,
|
|
5
|
+
stop_run_id TEXT,
|
|
6
|
+
permitted_input_id TEXT,
|
|
7
|
+
review_required INTEGER NOT NULL DEFAULT 0
|
|
8
|
+
);
|
|
9
|
+
CREATE TABLE session_input_control_operations (
|
|
10
|
+
conversation_id TEXT NOT NULL REFERENCES sessions(conversation_id) ON DELETE CASCADE,
|
|
11
|
+
operation_id TEXT NOT NULL,
|
|
12
|
+
request_json TEXT NOT NULL,
|
|
13
|
+
run_id TEXT,
|
|
14
|
+
PRIMARY KEY (conversation_id, operation_id)
|
|
15
|
+
);
|
|
@@ -2,10 +2,10 @@ import { ProductReadContracts } from "../../../packages/gateway-contract/src/cap
|
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
3
|
import { TaskRepository, init_task_repository } from "../task-repository.js";
|
|
4
4
|
import { TaskRunRepository, init_task_run_repository } from "../task-run-repository.js";
|
|
5
|
-
import { TaskReadModelProjector } from "../task-read-model-projector.js";
|
|
6
|
-
import { TaskConversationRepository } from "../task-conversation-repository.js";
|
|
7
5
|
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
8
6
|
import { defineReadCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
7
|
+
import { TaskReadModelProjector } from "../task-read-model-projector.js";
|
|
8
|
+
import { TaskConversationRepository } from "../task-conversation-repository.js";
|
|
9
9
|
import { TaskContextRepository } from "../task-context-repository.js";
|
|
10
10
|
import { TaskDependencyService } from "../task-dependency-service.js";
|
|
11
11
|
import { TaskCriterionReviewRepository } from "../task-criterion-review-repository.js";
|
|
@@ -2,9 +2,9 @@ import { TaskCommandRequestSchema, TaskCreateRequestSchema, TaskDetailResponseSc
|
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
3
|
import { TaskRepository, init_task_repository } from "../task-repository.js";
|
|
4
4
|
import { TaskRunRepository, init_task_run_repository } from "../task-run-repository.js";
|
|
5
|
-
import { resolveTaskLocale } from "../task-language.js";
|
|
6
5
|
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
7
6
|
import { defineAtomicCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
7
|
+
import { resolveTaskLocale } from "../task-language.js";
|
|
8
8
|
import { resolveProjectAgentId } from "../../projects/project-agent.js";
|
|
9
9
|
import { TaskApplicationService } from "../task-application-service.js";
|
|
10
10
|
import { TaskSignalService } from "../task-signal-service.js";
|
|
@@ -10,6 +10,7 @@ import { appendComposerInputHistory, listComposerInputHistory } from "../../stor
|
|
|
10
10
|
import "../../storage/sqlite/index.js";
|
|
11
11
|
import { normalizeAgentId } from "../../agent-catalog/id.js";
|
|
12
12
|
import { init_agent_scope, listAgentEntries } from "../../agent/agent-scope.js";
|
|
13
|
+
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
13
14
|
import { init_paths } from "../../config/paths.js";
|
|
14
15
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
15
16
|
import { resolveEffectiveAgentProfile } from "../../config/agent-profile.js";
|
|
@@ -18,7 +19,6 @@ import { effectiveWorkspacePathForSession } from "../../session/session-workspac
|
|
|
18
19
|
import { ProjectService } from "../../projects/project-service.js";
|
|
19
20
|
import { inferSuggestedProjectDefaultAgentId } from "../../projects/project-agent-suggestion.js";
|
|
20
21
|
import "../../projects/index.js";
|
|
21
|
-
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
22
22
|
import { buildSessionTimeline } from "../../session/transcript-outline.js";
|
|
23
23
|
import { transcriptRowsToClientHistory } from "../../session/client-history.js";
|
|
24
24
|
import { createCreateShareTool, isShareToolAvailable } from "../../agent/tools/create-share-tool.js";
|