@xopcai/xopc 0.0.486 → 0.0.488
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 +9 -3
- package/README.zh-CN.md +9 -3
- package/dist/browser-ext/_locales/en/messages.json +1 -1
- package/dist/browser-ext/_locales/zh_CN/messages.json +1 -1
- package/dist/browser-ext/dist/assets/{auth-8EjgHa-n.js → page-context-DCkQH5LX.js} +237 -172
- package/dist/browser-ext/dist/background.js +650 -108
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +22 -4
- package/dist/browser-ext/manifest.json +2 -1
- package/dist/extensions/telegram/src/update-offset-store.js +2 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/messaging/quote-cache.js +3 -1
- package/dist/extensions/weixin/src/storage/sync-buf.js +2 -1
- package/dist/gateway/server/chunks.bin +1733 -1553
- package/dist/gateway/server/chunks.json +1 -1
- package/dist/gateway/server/dependency-records.json +42 -0
- package/dist/gateway/static/root/assets/{activity-store-hSe5Nbgk.js → activity-store-DyHjQrpP.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BY2wRiwY.js → agent-avatar-dicebear-gADhOk89.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-D_UDgOr9.js → agent-avatar-display-Dyyk4GdM.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BrcyLG9M.js → agent-defaults-settings-panel-DD5mU7h6.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-CSJC1yud.js → agent-plugin-dialog-RZpnW9HG.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-DX-t3X7K.js → agents-Ckt9wMj7.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-DSr-PWuW.js → agents-admin-api-BW3Mzst8.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CGrHK9ij.js → api-Cd5TqEwc.js} +1 -1
- package/dist/gateway/static/root/assets/{api-B3T06TLl.js → api-DVQaJzrB.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-D6ZoYKaA.js → app-management-settings-panel-Cim6ZmGT.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BRb6kZT8.js → appearance-settings-BVMDvmUO.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-6xeWvMpF.js → apps-page-B7T55D7Y.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-CQ5UXgZk.js → archive-plugin-DVoAuR_a.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-D-gn6x5E.js → automation-api-B6YcuEsE.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-B7hq0XOL.js → automation-result-state-BycWqFXM.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-CM59-qm5.js → automation-run-list-DDDHtKq0.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-C453Q-Wa.js → automation-task-card-BBEA23Zb.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BLFBqaPX.js → automations-page-DelDZorh.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-DiO3Iyuj.js → automations-workspace-leY4yCvw.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-D_zw0TgG.js → binary-plugins-o-jwYyMd.js} +1 -1
- package/dist/gateway/static/root/assets/block-editor-BFDeQtYs.css +1 -0
- package/dist/gateway/static/root/assets/{block-editor-Cesz2DqP.js → block-editor-Bp6TLleA.js} +46 -46
- package/dist/gateway/static/root/assets/{browser-settings-page-BHElJSFt.js → browser-settings-page-CtPARtRA.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-CW-vdkz6.js → capabilities-B5gHYD8r.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-DZrjA95P.js → capabilities-G2ZaAAs2.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-DQrfkrBA.js → capabilities-page-C6KCaaHR.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-DIT2dvtc.js → capabilities-settings-panel-CVwdxuL4.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-Dcr5dgqw.js → channels-Bh2bHLni.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-CyvBfBbp.js → chat-agents-api-DRKlkcuv.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-B83s8HE9.js → chat-chart-block-DxTCx__V.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-DWZCzxY7.js → chat-page-XqG9aYBd.js} +31 -31
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DCUuwiTt.js → chat-terminal-dock-Ch74AWYF.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-UrqPvWR1.js → command-palette-api-CAKoTF_-.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-model-config-control-C2Bku39S.js → composer-model-config-control-Bas1wFVW.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-notifications-MGKffwC7.js → composer-notifications-CpBgWAE4.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-a0quQ25p.js → composer-payload-handoff-uT_hvvap.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-DUzQe6Bz.js → computer-settings-page-x8YUBBuX.js} +1 -1
- package/dist/gateway/static/root/assets/confirm-dialog-yhRKgG72.js +1 -0
- package/dist/gateway/static/root/assets/{connected-providers-grid-BJKEp0SE.js → connected-providers-grid-DS21-u3Q.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-B9hoSOnN.js → connection-usage-guide-DNNFESD9.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-e67KylnM.js → connector-service-page-BS7IJ6oc.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-CRGq-TSw.js → connectors-api-B27sJ651.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-BteRI1XM.js → connectors-page-DM6TppXV.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-DwITf4I2.js → date-picker-D3N2BGVY.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-ChG1CqR1.js → date-time-picker-BNw099Is.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BHoFymL4.js → desktop-pet-BtY6aGrh.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BYeBN4jj.js → desktop-pet-settings-DVXfAMaU.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-DsjH8x76.js → dev-view-store-D4EyUkRI.js} +1 -1
- package/dist/gateway/static/root/assets/{device-connections-panel-DE01vyK_.js → device-connections-panel-DYK_DQzO.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-action-w1enAo76.js → device-pairing-action-DXo8MWy2.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-Dt737tSq.js → device-pairing-wizard-NddAztJ2.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-B-eUnbng.js → directory-picker-path-field-Bbq7ZyGn.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-authoritative-grants-DYp2nNol.js → extension-authoritative-grants-qpYvHriJ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-4jJ1uVQJ.js → extension-debug-page-BOb-6rpq.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-CJV5JETm.js → extension-iframe-host-DpgIPfJe.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-DGV5FC-v.js → extension-marketplace-api-BhGNQYHl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-B4I-Y6qs.js → extension-message-router-QjbtEYyu.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-lc7a84nG.js → extension-page-BOp7wU9Y.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-D8_mIBI0.js → extension-provider-CFPicsnW.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Uw2lfWRh.js → extension-settings-page-cXjBvPwg.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BD-ams0X.js → gateway-config-swr-DxelrRtx.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-D2B_nv2b.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-DrVbjYfI.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-Dos1Pp84.js → gateway-restart-Ce6rCCAr.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DUC1iOVK.js → gateway-settings-BTr0Gwdo.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DgmvR-hb.js → gateway-startup-retry-Dm0dK8BT.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-B7suATYU.js → global-defaults-api-BZnu44eA.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-mSRCU81k.js → home-page-Bxr3V5lc.js} +3 -3
- package/dist/gateway/static/root/assets/{home-task-actions-_ZAc57Y7.js → home-task-actions-GAO06s1_.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-Baz4xdZ4.js → image-generation-api-DrZPmWFt.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DR0eLPgB.js → imports-page-D-x5kijk.js} +1 -1
- package/dist/gateway/static/root/assets/index-BjU5H5hz.js +11 -0
- package/dist/gateway/static/root/assets/index-CREeN6C_.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-CntHi8Rh.js → install-connector-dialog-st2O1bez.js} +1 -1
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-DnKkQoqR.js +1 -0
- package/dist/gateway/static/root/assets/{local-app-workbench-page-C3Lqi8E1.js → local-app-workbench-page-CKHJa4K8.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BoCtITdL.js → local-apps-page-D28d-sO0.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-CGSV1RQg.js → local-session-drafts-KkAOxXk5.js} +2 -2
- package/dist/gateway/static/root/assets/{locale-store-CHjsq5NR.js → locale-store-Dy0B0XDJ.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-0hkRbcUR.js → logs-page-BPuHO-iA.js} +1 -1
- package/dist/gateway/static/root/assets/{management-api-FVu7eYXD.js → management-api-BtTRehT0.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-QQB1r71U.js → management-settings-B2R43Itv.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-ihzUc4ud.js → markdown-view-ByuzuGRb.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-DffQKrjd.js → mcp-conversation-setup-page-D_6XeyXG.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-C78NkHfB.js → media-plugins-B9Q7WvNF.js} +1 -1
- package/dist/gateway/static/root/assets/messages-Bj6DCoic.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-QFZY5XNN.js → model-selector-8FTrQQ2N.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-BrD6r5Qs.js → models-hub-cache-DMBOw544.js} +1 -1
- package/dist/gateway/static/root/assets/{new-session-preferences-gb411vZP.js → new-session-preferences-CxCn2Jxk.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-BTNX68oO.js +7 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-D20oZuOM.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-D5SvfybU.js → notes-api-M1FuRZbW.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-RPfvHnl6.js → notes-page-FocipOyc.js} +2 -2
- package/dist/gateway/static/root/assets/{oauth-api-DnMpUoyx.js → oauth-api-Dza1tHcr.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-DGYky6ut.js → oauth-provider-connect-BPNIEiMv.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-CVHz9b6c.js → page-context-capture-button-DpGnxSrD.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-Bk7jVvAG.js → page-context-draft-CHAS3BY3.js} +1 -1
- package/dist/gateway/static/root/assets/{page-header-store-NP7MCIaP.js → page-header-store-BXED3zhV.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-avatar-1TVnHakL.js → personal-avatar-BCk4KoeZ.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-Dt1d3tQT.js → personal-page-CSc2n5UD.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-profile-settings-XiT1MgTK.js → personal-profile-settings-C86FBPOH.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-bcw04REt.js → personal-settings-panel-BlPLE0Ip.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-B4QsgIEF.js → phone-dependencies-card-BCob98OY.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-Dk5kE1Ll.js → phone-model-connection-D-CcYcch.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-CFoxQiws.js → phone-model-picker-eMe7fmZu.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-Bv1xm8sh.js → phone-settings-page-D7yXeGmR.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-DGaibcsi.js → phone-workspace-store-CcA_vo-t.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-FcOJaeP0.js → plugin-details-dialog-BAmodjSZ.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-B-yK91If.js → preference-select-fields-BBd5CWkM.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-runtime-FtWOW5i4.js → preview-runtime-DUJ7XhMP.js} +3 -3
- package/dist/gateway/static/root/assets/product-automation-feedback-BDFpFrSs.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-C09VEZjY.js → product-open-page-t3hsoYql.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-B3mzl6-f.js → product-preview-content-BM0pjf0F.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-5kTp_7Qk.js → product-preview-modal-CLQcCVjI.js} +2 -2
- package/dist/gateway/static/root/assets/project-detail-page-CK_EN6Jq.js +7 -0
- package/dist/gateway/static/root/assets/{project-understanding-4IyHVmus.js → project-understanding-CwtdVbMP.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-C-9x23LR.js → projects-page-ESAmJ4I_.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-D9NuB7w3.js → providers-api-CR7FJzt-.js} +1 -1
- package/dist/gateway/static/root/assets/recording-upload-DrgujKBt.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-CDpUAb2R.js → registry-api-CaBz9f4g.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DVTs8pwO.js → remote-access-hub-CB-Js5gd.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-CZlqZYk-.js → resource-unavailable-DiPPmZsR.js} +1 -1
- package/dist/gateway/static/root/assets/right-workspace-store-CcRApllu.js +1 -0
- package/dist/gateway/static/root/assets/{route-preload-CzorjVc9.js → route-preload-Ab7Zw-df.js} +2 -2
- package/dist/gateway/static/root/assets/{routine-panel-n4IstC8Y.js → routine-panel-DzdJGicv.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-BhS0RWf2.js → runtime-tools-api-utBemmh4.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-jTbGPGeA.js → runtime-tools-settings-panel-ChXrIluB.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-wfd0Mjtu.js → service-recommendation-list-Dm5GcMRy.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CR3NLqvs.js → session-api-vEn4BzjV.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-C2MCS4C5.js → session-manager-7nbjJYyy.js} +2 -2
- package/dist/gateway/static/root/assets/{sessions-page-9ibCNP9o.js → sessions-page-B__ftjgG.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DV-_ZdXD.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-CTLdGPvx.js → settings-advanced-section-DhKzGl03.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-CCQVvItG.js → settings-mode-store-CQofc337.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DsM_f07M.js → settings-page-CzW5GM5r.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-C21Iw2rD.js → settings-page-header-CiS6x6sn.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BXcLlp6p.js → settings-page-layout-B-rj_rso.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-W2F5ZaR_.js → setup-interaction-page-DTgwtj55.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BFNwZuhp.js → setup-status-panel-BhKPMIds.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-2JjvWs0q.js → share-link-dialog-WR7Op1vL.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-C32Mq-BY.js → share-preview-page-DonmTI11.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-BhWvN3LS.js → shares-api-CoRLwDnw.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-BDGbs8wz.js → shares-settings-UA91fiMV.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-BG9A1WF0.js → skill-api-BE-iPtTQ.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-B26hHnXq.js → skill-list-api-Dsfjdtuu.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-B9Eu5Yk_.js → skill-reload-api-BIZJWow-.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-kL8E5zgi.js → skills-page-1wvItQag.js} +1 -1
- package/dist/gateway/static/root/assets/{space-api-_uKFiASp.js → space-api-E8VbAaEl.js} +1 -1
- package/dist/gateway/static/root/assets/space-page-BCzDsNJd.js +2 -0
- package/dist/gateway/static/root/assets/{space-workbook-BAwHwK6O.js → space-workbook-CwltZeHG.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-0e2zfQLt.js → system-settings-panel-03a25GEc.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-DdCpNW8K.js → task-detail-page-B_YXsT9W.js} +1 -1
- package/dist/gateway/static/root/assets/{task-header-title-CLt_lmjb.js → task-header-title-bZVPIbyR.js} +1 -1
- package/dist/gateway/static/root/assets/{task-result-presentation-CgvcqEMD.js → task-result-presentation-_VWkiekf.js} +1 -1
- package/dist/gateway/static/root/assets/{task-run-issue-notice-8FX876PP.js → task-run-issue-notice-BXOES2t9.js} +1 -1
- package/dist/gateway/static/root/assets/{tasks-CvOAtEHv.js → tasks-D8bnpu0N.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-Cy90Ix5U.js → terminal-panel-store-BOHv5O2x.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-CvG266p8.js → theme-store-XNsFzxSj.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-Cx_fOH70.js → tracing-settings-page-Y9z2HoGj.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-Cph-ZBBy.js → tunnel-api-XHGjcUi9.js} +1 -1
- package/dist/gateway/static/root/assets/turn-outcome-Bf3N3Bmj.js +1 -0
- package/dist/gateway/static/root/assets/{understanding-activity-store-CN4JzOIO.js → understanding-activity-store-BDBAkksk.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-BuZZ1_VH.js → understanding-refresh-store-D7gBfD26.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-Du42x0ej.js → usage-page-DxESTMwa.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-B_WH_LBE.js → use-autosave-D7zZrcsj.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-BEuyorVm.js → use-composer-attachments-DWiIdMIi.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-Cehu0745.js → use-file-preview-expanded-CA9vFUTT.js} +1 -1
- package/dist/gateway/static/root/assets/{use-generated-media-CzRbgtcv.js → use-generated-media-DX4_ne7C.js} +1 -1
- package/dist/gateway/static/root/assets/{use-personal-profile-D4gLM6Wi.js → use-personal-profile-CaCORKeL.js} +1 -1
- package/dist/gateway/static/root/assets/{use-personal-work-B25WRGHj.js → use-personal-work-D0tMU1bP.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-CV3GIt_T.js → use-realtime-voice-D9k997EW.js} +1 -1
- package/dist/gateway/static/root/assets/{use-share-link-WKZLlEqr.js → use-share-link-CqV3o-VZ.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-C0C861cb.js → use-workspace-tree-nnrez9-d.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-AK2U8vGc.js → user-model-page-CpVdbSxS.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-BqXQj51r.js → voice-api-key-field-CVi3dBKx.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-sXEIG6lz.js → voice-config-api-DZbcg7qD.js} +1 -1
- package/dist/gateway/static/root/assets/voice-input-shortcut-events-CwKpIInD.js +1 -0
- package/dist/gateway/static/root/assets/{voice-player-store-CTbnOdeM.js → voice-player-store-DT0f9GPa.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-JpPo3BvX.js → voice-settings-CJdWnHas.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BjfTRFX8.js → work-discovery-overlay-qEN1Ikir.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-CSRkFiXc.js → work-discovery-page-JjCyt1Kw.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-DgM21YVT.js → working-directory-picker-modal-DX6bRmkQ.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-CQOuWbVv.js → workspace-api-CD_6YyPI.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-BuYdf4CO.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-CmMueTmW.js → workspace-file-preview-dialog-DPHnm_7A.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-BAbIGS01.js → workspace-open-location-menu-BdXn5F2i.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-e8HJFnTs.js → xopc-cloud-account-card-CLM7hfkN.js} +1 -1
- package/dist/gateway/static/root/index.html +97 -97
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/session-input-command.js +2 -1
- package/dist/packages/gateway-contract/src/task-display.js +1 -1
- package/dist/packages/gateway-contract/src/task-research-result.js +5 -0
- package/dist/packages/realtime-client/src/index.js +6 -1
- package/dist/packages/realtime-protocol/src/browser-preview.js +111 -0
- package/dist/packages/realtime-protocol/src/index.js +5 -1
- package/dist/src/agent/agent-manager.d.ts +2 -2
- package/dist/src/agent/agent-manager.js +6 -3
- package/dist/src/agent/commands/command-registry.js +2 -1
- package/dist/src/agent/embedded/execution-tool-policy.d.ts +1 -0
- package/dist/src/agent/embedded/execution-tool-policy.js +7 -3
- package/dist/src/agent/embedded/run-turn.js +9 -3
- package/dist/src/agent/mcp/continuation-guard.js +2 -1
- package/dist/src/agent/mcp/conversation-setup.js +2 -1
- package/dist/src/agent/mcp/discovery.js +2 -1
- package/dist/src/agent/orchestration/child-run-monitor.js +2 -1
- package/dist/src/agent/session/interaction-policy-state.js +2 -1
- package/dist/src/agent/tools/browser/tool/browser-use-tool.js +24 -16
- package/dist/src/agent/tools/browser/tool/schemas.d.ts +1 -0
- package/dist/src/agent/tools/browser/tool/schemas.js +6 -1
- package/dist/src/agent/tools/clarify-tool.js +1 -1
- package/dist/src/agent/tools/factory.js +9 -1
- package/dist/src/agent/tools/personal-task-tool.js +79 -16
- package/dist/src/agent/tools/session-recall-tool.js +10 -2
- package/dist/src/agent/tools/skill-install-tool.js +2 -1
- package/dist/src/agent/tools/task-collaboration-tool.js +1 -1
- package/dist/src/agent/tools/task-result-tool.js +10 -9
- package/dist/src/agent/tools/web.js +5 -3
- package/dist/src/agent/tools/xopc-use-tool.js +11 -5
- package/dist/src/automations/capabilities/write.js +2 -1
- package/dist/src/automations/mcp-source.js +2 -1
- package/dist/src/browser/drivers/browser-driver.d.ts +1 -0
- package/dist/src/browser/drivers/extension-driver.d.ts +2 -0
- package/dist/src/browser/drivers/extension-driver.js +11 -1
- package/dist/src/browser/runtime/browser-runtime.d.ts +6 -0
- package/dist/src/browser/runtime/browser-runtime.js +13 -1
- package/dist/src/capabilities/runtime/dispatcher.d.ts +6 -0
- package/dist/src/capabilities/runtime/dispatcher.js +47 -12
- package/dist/src/channels/attachments/inbound-persist.js +1 -0
- package/dist/src/channels/attachments/outbound-tts-persist.js +1 -0
- package/dist/src/channels/message-journal.js +2 -1
- package/dist/src/cli/cli-log-level-preset.js +5 -1
- package/dist/src/cli/commands/mcp.js +44 -5
- package/dist/src/cli/index.js +9 -1
- package/dist/src/computer/flows.js +2 -1
- package/dist/src/config/schema.d.ts +18 -0
- package/dist/src/config/schema.js +6 -0
- package/dist/src/connectors/composio-triggers.js +2 -1
- package/dist/src/endpoint-tools/delegation.js +2 -1
- package/dist/src/endpoint-tools/device-capability-grants.js +2 -1
- package/dist/src/endpoint-tools/execution-actor.js +2 -1
- package/dist/src/endpoint-tools/folder-connections.js +2 -1
- package/dist/src/endpoint-tools/invocation-service.js +2 -1
- package/dist/src/endpoint-tools/provider-catalog.js +2 -1
- package/dist/src/endpoint-tools/provider-operation-status.js +2 -1
- package/dist/src/endpoint-tools/runtime.js +2 -1
- package/dist/src/execution-environments/session-environment-service.js +1 -1
- package/dist/src/files/workspace-file-spaces.d.ts +4 -0
- package/dist/src/files/workspace-file-spaces.js +14 -0
- package/dist/src/gateway/file-space-service.d.ts +1 -1
- package/dist/src/gateway/file-space-service.js +2 -8
- package/dist/src/gateway/hono/app.js +29 -8
- package/dist/src/gateway/hono/lib/extension-store.js +2 -1
- package/dist/src/gateway/hono/lib/mcp-dispatcher.d.ts +2 -0
- package/dist/src/gateway/hono/lib/mcp-dispatcher.js +19 -0
- package/dist/src/gateway/hono/routes/browser.js +38 -0
- package/dist/src/gateway/hono/routes/capability-operations.d.ts +1 -0
- package/dist/src/gateway/hono/routes/capability-operations.js +6 -3
- package/dist/src/gateway/hono/routes/device-push.js +7 -2
- package/dist/src/gateway/hono/routes/execution-environments.js +4 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +19 -0
- package/dist/src/gateway/hono/routes/mcp-bridge.d.ts +3 -0
- package/dist/src/gateway/hono/routes/mcp-bridge.js +87 -0
- package/dist/src/gateway/hono/routes/mcp-remote.d.ts +3 -0
- package/dist/src/gateway/hono/routes/mcp-remote.js +169 -0
- package/dist/src/gateway/hono/routes/notifications.js +11 -7
- package/dist/src/gateway/hono/routes/personal-agent.js +2 -1
- package/dist/src/gateway/hono/routes/projects.js +2 -3
- package/dist/src/gateway/hono/routes/session-command-handler.js +2 -1
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -0
- package/dist/src/gateway/security/gateway-scopes.js +2 -0
- package/dist/src/gateway/service/agent-runner.js +9 -4
- package/dist/src/gateway/service/config-coordinator.d.ts +9 -0
- package/dist/src/gateway/service/session-command-service.js +4 -2
- package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -0
- package/dist/src/gateway/service/session-input-coordinator.js +30 -2
- package/dist/src/gateway/service/session-preparation-worker.js +6 -2
- package/dist/src/gateway/service.d.ts +6 -0
- package/dist/src/gateway/service.js +44 -3
- package/dist/src/local-apps/access-audit.js +2 -1
- package/dist/src/local-apps/automation-proposals.js +2 -1
- package/dist/src/local-apps/capabilities/automation-policy.js +2 -1
- package/dist/src/local-apps/capabilities/delegate.js +2 -1
- package/dist/src/local-apps/execution-authority.js +2 -1
- package/dist/src/local-apps/p1-services.js +2 -1
- package/dist/src/local-apps/public-assets.js +2 -1
- package/dist/src/local-apps/service.js +2 -1
- package/dist/src/local-apps/store.js +2 -1
- package/dist/src/mcp/callback-config.d.ts +5 -0
- package/dist/src/mcp/callback-config.js +16 -0
- package/dist/src/mcp/capability-server.d.ts +1 -2
- package/dist/src/mcp/capability-server.js +34 -79
- package/dist/src/mcp/connection-grants.d.ts +15 -0
- package/dist/src/mcp/connection-grants.js +73 -0
- package/dist/src/mcp/delegation.d.ts +329 -0
- package/dist/src/mcp/delegation.js +610 -0
- package/dist/src/mcp/gateway-http-client.d.ts +2 -2
- package/dist/src/mcp/gateway-http-client.js +4 -4
- package/dist/src/mcp/product-tools.d.ts +7 -0
- package/dist/src/mcp/product-tools.js +292 -0
- package/dist/src/mcp/remote-auth.d.ts +8 -0
- package/dist/src/mcp/remote-auth.js +51 -0
- package/dist/src/mcp/remote-config.d.ts +11 -0
- package/dist/src/mcp/remote-config.js +31 -0
- package/dist/src/mcp/remote-grants.d.ts +20 -0
- package/dist/src/mcp/remote-grants.js +60 -0
- package/dist/src/mcp/run-callback-subscriptions.d.ts +13 -0
- package/dist/src/mcp/run-callback-subscriptions.js +17 -0
- package/dist/src/mcp/run-callbacks.d.ts +6 -0
- package/dist/src/mcp/run-callbacks.js +125 -0
- package/dist/src/mcp/tool-contract.d.ts +30 -0
- package/dist/src/mcp/tool-contract.js +81 -0
- package/dist/src/mcp/workspace-search.d.ts +16 -0
- package/dist/src/mcp/workspace-search.js +68 -0
- package/dist/src/media/index.js +4 -1
- package/dist/src/media/media-reference.js +2 -1
- package/dist/src/media/session-references.js +4 -2
- package/dist/src/media/store.js +2 -1
- package/dist/src/media/uri.js +17 -12
- package/dist/src/music-generation/artifact.js +2 -1
- package/dist/src/music-generation/settings.js +2 -1
- package/dist/src/notes/capabilities/write.js +2 -1
- package/dist/src/notifications/device-store.js +1 -1
- package/dist/src/notifications/platform-push.d.ts +2 -1
- package/dist/src/notifications/platform-push.js +4 -3
- package/dist/src/notifications/service.js +4 -4
- package/dist/src/personal-agent/proactivity/repository.js +2 -1
- package/dist/src/personal-agent/proactivity/service.js +2 -1
- package/dist/src/personal-agent/reply-result.js +4 -2
- package/dist/src/personal-agent/result-reader.d.ts +2 -0
- package/dist/src/personal-agent/result-reader.js +12 -1
- package/dist/src/personal-agent/specialist-capabilities.js +3 -2
- package/dist/src/phone/assistance.js +2 -1
- package/dist/src/phone/location-environment.js +2 -1
- package/dist/src/phone/repository.js +2 -1
- package/dist/src/phone/setup/service.js +2 -1
- package/dist/src/projects/index.js +2 -2
- package/dist/src/projects/project-kind.d.ts +0 -7
- package/dist/src/projects/project-kind.js +1 -6
- package/dist/src/projects/project-service.js +1 -9
- package/dist/src/realtime/browser-preview-ice.d.ts +2 -0
- package/dist/src/realtime/browser-preview-ice.js +42 -0
- package/dist/src/realtime/browser-preview.d.ts +45 -0
- package/dist/src/realtime/browser-preview.js +191 -0
- package/dist/src/realtime/runtime.d.ts +4 -1
- package/dist/src/realtime/runtime.js +53 -2
- package/dist/src/session/store.js +2 -1
- package/dist/src/share/hosted-session-share.js +2 -1
- package/dist/src/share/note-share-revocation.js +2 -1
- package/dist/src/share/share-store.js +2 -1
- package/dist/src/share/site-share-store.js +2 -1
- package/dist/src/space/ingest.js +2 -1
- package/dist/src/space/workbook-proposals.js +2 -1
- package/dist/src/space/workbook-turn.js +2 -1
- package/dist/src/space/worker.js +2 -1
- package/dist/src/storage/sqlite/durable-state.js +43 -39
- package/dist/src/storage/sqlite/session-creation-repository.d.ts +2 -0
- package/dist/src/storage/sqlite/session-creation-repository.js +24 -5
- package/dist/src/storage/sqlite/session-input-control-repository.js +2 -1
- package/dist/src/storage/sqlite/session-input-repository.js +9 -6
- package/dist/src/tasks/capabilities/read.js +2 -1
- package/dist/src/tasks/capabilities/runs.d.ts +101 -0
- package/dist/src/tasks/capabilities/runs.js +41 -34
- package/dist/src/tasks/capabilities/write.js +2 -1
- package/dist/src/tasks/delegated-run-result.d.ts +16 -0
- package/dist/src/tasks/delegated-run-result.js +47 -0
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/task-application-service.d.ts +6 -0
- package/dist/src/tasks/task-application-service.js +20 -5
- package/dist/src/tasks/task-context-assembler.js +10 -6
- package/dist/src/tasks/task-contract-planner.js +1 -0
- package/dist/src/tasks/task-deliverables.js +19 -14
- package/dist/src/tasks/task-handoff.d.ts +20 -3
- package/dist/src/tasks/task-handoff.js +207 -146
- package/dist/src/tasks/task-json-acceptance.js +3 -2
- package/dist/src/tasks/task-main-update-decision-service.js +1 -0
- package/dist/src/tasks/task-main-update-delivery.js +4 -2
- package/dist/src/tasks/task-origin-repository.d.ts +2 -0
- package/dist/src/tasks/task-origin-repository.js +17 -0
- package/dist/src/tasks/task-repository.js +3 -0
- package/dist/src/tasks/task-research-repair.js +4 -1
- package/dist/src/tasks/task-research-result.d.ts +7 -0
- package/dist/src/tasks/task-research-result.js +132 -30
- package/dist/src/tasks/task-result-delivery-service.js +2 -1
- package/dist/src/tasks/task-run-coordinator.js +3 -2
- package/dist/src/tasks/task-run-repository.d.ts +2 -1
- package/dist/src/tasks/task-run-repository.js +9 -4
- package/dist/src/video-generation/artifact.js +2 -1
- package/dist/src/video-generation/drafts.js +2 -1
- package/dist/src/video-generation/repository.js +2 -1
- package/dist/src/video-generation/settings.js +2 -1
- package/package.json +3 -1
- package/dist/gateway/static/root/assets/block-editor-Cvy3D_4T.css +0 -1
- package/dist/gateway/static/root/assets/confirm-dialog-MHCmEEUZ.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-CoIFB3im.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CTWm23Qi.js +0 -1
- package/dist/gateway/static/root/assets/index-B_TGvH_k.css +0 -1
- package/dist/gateway/static/root/assets/index-CJAEAcZV.js +0 -11
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-DlGDLJI2.js +0 -1
- package/dist/gateway/static/root/assets/messages-C7QSnTdg.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-uc-5k3a2.js +0 -7
- package/dist/gateway/static/root/assets/note-image-lightbox-Bvjumefe.js +0 -1
- package/dist/gateway/static/root/assets/product-automation-feedback-DdFoCDzG.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-DGPfKx5M.js +0 -7
- package/dist/gateway/static/root/assets/recording-upload-plrQDkLa.js +0 -1
- package/dist/gateway/static/root/assets/right-workspace-store-Cehybf-G.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cq4HDQu2.js +0 -1
- package/dist/gateway/static/root/assets/space-page-DwyuUvI3.js +0 -2
- package/dist/gateway/static/root/assets/turn-outcome-Dtw6OgwL.js +0 -1
- package/dist/gateway/static/root/assets/voice-input-shortcut-events-DN-_rY5a.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-CX8zX9eZ.js +0 -1
|
@@ -37,6 +37,7 @@ export declare function acceptSessionCommand(input: {
|
|
|
37
37
|
command: SessionInputCommand | SessionMaterializeCommand;
|
|
38
38
|
preparedInput?: Omit<Parameters<typeof insertSessionInput>[0], 'conversationId' | 'id' | 'clientMessageId' | 'expectedTranscriptId'>;
|
|
39
39
|
config?: SessionAgentConfig;
|
|
40
|
+
defaultExecution?: SessionCreation['execution'];
|
|
40
41
|
sourceChannel?: 'webchat' | 'tui';
|
|
41
42
|
attachProject?: (conversationId: string, projectId: string) => void;
|
|
42
43
|
}): SessionInputReceipt;
|
|
@@ -47,4 +48,5 @@ export declare function retrySessionPreparation(conversationId: string, principa
|
|
|
47
48
|
operationId: string;
|
|
48
49
|
expectedRevision: number;
|
|
49
50
|
idempotencyKey: string;
|
|
51
|
+
executionMode?: 'local_checkout';
|
|
50
52
|
}): SessionPreparation;
|
|
@@ -67,7 +67,10 @@ function acceptSessionCommand(input) {
|
|
|
67
67
|
const pending = db.prepare(`SELECT count(*) AS count FROM session_inputs WHERE conversation_id=?
|
|
68
68
|
AND status IN ('queued','running','injecting','interrupted')`).get(conversationId);
|
|
69
69
|
if (input.preparedInput && pending.count >= 10) throw new SessionCommandError("QUEUE_FULL", "Input queue is full");
|
|
70
|
-
const creation = "creation" in command ?
|
|
70
|
+
const creation = "creation" in command ? {
|
|
71
|
+
...command.creation,
|
|
72
|
+
execution: command.creation.execution ?? input.defaultExecution ?? null
|
|
73
|
+
} : void 0;
|
|
71
74
|
let session = getSessionMetadata(conversationId);
|
|
72
75
|
if (creation) {
|
|
73
76
|
if (session) throw new SessionCommandError("CONVERSATION_EXISTS", "Conversation already exists");
|
|
@@ -159,14 +162,30 @@ function retrySessionPreparation(conversationId, principalId, input) {
|
|
|
159
162
|
const operation = getSessionPreparation(conversationId);
|
|
160
163
|
if (!operation) throw new SessionCommandError("NOT_FOUND", "Preparation not found");
|
|
161
164
|
if (db.prepare("SELECT principal_id FROM session_input_receipts WHERE conversation_id=? ORDER BY accepted_at LIMIT 1").get(conversationId)?.principal_id !== principalId) throw new SessionCommandError("FORBIDDEN", "Preparation belongs to another principal");
|
|
162
|
-
const
|
|
165
|
+
const useLocalCheckout = input.executionMode === "local_checkout";
|
|
166
|
+
const retryKey = useLocalCheckout ? "\0local_checkout:" + input.idempotencyKey : input.idempotencyKey;
|
|
167
|
+
const previous = db.prepare("SELECT * FROM session_preparation_retries WHERE conversation_id=? AND idempotency_key=?").get(conversationId, retryKey);
|
|
163
168
|
if (previous) {
|
|
164
169
|
if (previous.operation_id !== input.operationId || previous.expected_revision !== input.expectedRevision || previous.principal_id !== principalId) throw new SessionCommandError("IDEMPOTENCY_CONFLICT", "Retry identity was reused");
|
|
165
170
|
return operation;
|
|
166
171
|
}
|
|
167
|
-
if (
|
|
168
|
-
|
|
169
|
-
|
|
172
|
+
if (operation.operationId !== input.operationId || operation.revision !== input.expectedRevision || operation.state !== "preparation_failed") throw new SessionCommandError("SESSION_CHANGED", "Preparation state changed");
|
|
173
|
+
const reserved = db.prepare("SELECT 1 FROM execution_environments WHERE environment_id=?").get(operation.environmentId);
|
|
174
|
+
const now = Date.now();
|
|
175
|
+
if (useLocalCheckout) {
|
|
176
|
+
const binding = db.prepare("SELECT 1 FROM execution_environment_bindings WHERE conversation_id=? AND released_at IS NULL").get(conversationId);
|
|
177
|
+
if (operation.creation.execution?.mode !== "managed_worktree" || binding) throw new SessionCommandError("SESSION_CHANGED", "Only an unbound Worktree preparation can switch to the project folder");
|
|
178
|
+
if (reserved) db.prepare(`INSERT INTO session_preparation_cleanup (environment_id,conversation_id,not_before)
|
|
179
|
+
VALUES (?,?,?) ON CONFLICT(environment_id) DO NOTHING`).run(operation.environmentId, conversationId, now + 5e3);
|
|
180
|
+
}
|
|
181
|
+
const creation = useLocalCheckout ? {
|
|
182
|
+
...operation.creation,
|
|
183
|
+
execution: { mode: "local_checkout" }
|
|
184
|
+
} : operation.creation;
|
|
185
|
+
const baseCommit = !useLocalCheckout && reserved ? operation.baseCommit : null;
|
|
186
|
+
db.prepare(`UPDATE session_preparations SET state='preparing',revision=revision+1,lease_until=0,last_error=NULL,
|
|
187
|
+
updated_at=?,creation_json=?,environment_id=?,base_commit=? WHERE conversation_id=?`).run(now, JSON.stringify(creation), useLocalCheckout ? randomUUID() : operation.environmentId, baseCommit, conversationId);
|
|
188
|
+
db.prepare("INSERT INTO session_preparation_retries VALUES (?,?,?,?,?)").run(conversationId, retryKey, input.operationId, input.expectedRevision, principalId);
|
|
170
189
|
return getSessionPreparation(conversationId);
|
|
171
190
|
});
|
|
172
191
|
}
|
|
@@ -41,7 +41,8 @@ function acceptSessionInputControl(conversationId, command) {
|
|
|
41
41
|
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");
|
|
42
42
|
if (command.action === "steer" && state.phase !== "running") throw new SessionInputControlConflict("No active reply to steer");
|
|
43
43
|
if (command.inputId) {
|
|
44
|
-
const row = db.prepare("SELECT status, version, expected_transcript_id FROM session_inputs WHERE conversation_id = ? AND id = ?").get(conversationId, command.inputId);
|
|
44
|
+
const row = db.prepare("SELECT status, version, expected_transcript_id, task_run_id, effective_delivery FROM session_inputs WHERE conversation_id = ? AND id = ?").get(conversationId, command.inputId);
|
|
45
|
+
if (row?.task_run_id && row.effective_delivery === "steer") throw new SessionInputControlConflict("This steering message belongs to a specific task turn");
|
|
45
46
|
if (row?.expected_transcript_id && row.expected_transcript_id !== command.expectedTranscriptId) throw new SessionInputControlConflict("Input belongs to an earlier transcript");
|
|
46
47
|
if (!row || row.status !== "queued" && !(command.action === "send" && row.status === "interrupted") || row.version !== command.inputVersion) throw new SessionInputControlConflict("This input changed or has started");
|
|
47
48
|
}
|
|
@@ -44,7 +44,8 @@ function bumpSessionInputRevision(db, conversationId) {
|
|
|
44
44
|
}
|
|
45
45
|
function getSessionInputState(conversationId) {
|
|
46
46
|
const db = getSqliteDatabase();
|
|
47
|
-
const preparation = db.prepare(
|
|
47
|
+
const preparation = db.prepare(`SELECT operation_id AS operationId, revision, state, last_error AS lastError,
|
|
48
|
+
json_extract(creation_json, '$.execution.mode') AS executionMode FROM session_preparations WHERE conversation_id=?`).get(conversationId);
|
|
48
49
|
const runtime = db.prepare(`SELECT revision, active_run_id, active_input_id
|
|
49
50
|
FROM session_input_runtime WHERE conversation_id = ?`).get(conversationId);
|
|
50
51
|
const rows = db.prepare(`${SELECT_INPUTS} WHERE conversation_id = ? AND status IN
|
|
@@ -207,10 +208,11 @@ function finishSessionInputRun(conversationId, runId, status, error) {
|
|
|
207
208
|
if (runtime.active_input_id) db.prepare(`UPDATE session_inputs SET status = ?, error = ?,
|
|
208
209
|
version = version + 1, updated_at_ms = ? WHERE id = ?`).run(status, error ?? null, now, runtime.active_input_id);
|
|
209
210
|
db.prepare(`UPDATE session_inputs SET
|
|
210
|
-
status = CASE WHEN ? AND json_extract(origin_json, '$.type') != 'endpoint' THEN 'completed' ELSE 'interrupted' END,
|
|
211
|
-
error = CASE WHEN ? AND json_extract(origin_json, '$.type') != 'endpoint' THEN NULL ELSE 'Current reply ended before steer delivery was confirmed' END,
|
|
211
|
+
status = CASE WHEN ? AND json_extract(origin_json, '$.type') != 'endpoint' AND task_run_id IS NULL THEN 'completed' ELSE 'interrupted' END,
|
|
212
|
+
error = CASE WHEN ? AND json_extract(origin_json, '$.type') != 'endpoint' AND task_run_id IS NULL THEN NULL ELSE 'Current reply ended before steer delivery was confirmed' END,
|
|
212
213
|
version = version + 1,
|
|
213
|
-
updated_at_ms = ? WHERE conversation_id = ? AND target_run_id = ?
|
|
214
|
+
updated_at_ms = ? WHERE conversation_id = ? AND target_run_id = ?
|
|
215
|
+
AND (status = 'injecting' OR (status = 'queued' AND effective_delivery = 'steer' AND task_run_id IS NOT NULL))`).run(Number(status === "completed"), Number(status === "completed"), now, conversationId, runId);
|
|
214
216
|
db.prepare(`UPDATE session_input_runtime SET active_run_id = NULL, active_input_id = NULL,
|
|
215
217
|
revision = revision + 1, updated_at_ms = ?
|
|
216
218
|
WHERE conversation_id = ?`).run(now, conversationId);
|
|
@@ -231,7 +233,7 @@ function setSessionInputStatus(id, status, patch) {
|
|
|
231
233
|
function mutateQueuedSessionInput(input) {
|
|
232
234
|
return runSqliteWriteTransaction((db) => {
|
|
233
235
|
const row = db.prepare(`${SELECT_INPUTS} WHERE id = ? AND conversation_id = ?`).get(input.id, input.conversationId);
|
|
234
|
-
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;
|
|
236
|
+
if (!row || row.kind !== "message" || row.status !== "queued" || row.version !== input.version || row.task_run_id && row.effective_delivery === "steer" || row.expected_transcript_id && row.expected_transcript_id !== readCurrentTranscriptId(db, input.conversationId)) return false;
|
|
235
237
|
const now = Date.now();
|
|
236
238
|
if (input.position !== void 0) {
|
|
237
239
|
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);
|
|
@@ -274,7 +276,8 @@ function recoverSessionInputState() {
|
|
|
274
276
|
) WHERE kind = 'message' AND status IN ('running','injecting')
|
|
275
277
|
AND (payload_json IS NULL OR json_extract(payload_json, '$.connectionBarrier') = 1)`).run();
|
|
276
278
|
db.prepare(`UPDATE session_inputs SET status = 'interrupted', error = 'Gateway restarted during delivery',
|
|
277
|
-
version = version + 1, updated_at_ms = ? WHERE status IN ('running','injecting')
|
|
279
|
+
version = version + 1, updated_at_ms = ? WHERE status IN ('running','injecting')
|
|
280
|
+
OR (status = 'queued' AND effective_delivery = 'steer' AND task_run_id IS NOT NULL)`).run(now);
|
|
278
281
|
db.prepare(`UPDATE session_inputs SET status = 'queued', error = NULL, version = version + 1,
|
|
279
282
|
updated_at_ms = ? WHERE status = 'interrupted' AND kind = 'message'
|
|
280
283
|
AND error = 'Gateway restarted during delivery'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { taskCheckId } from "../../../packages/gateway-contract/src/tasks.js";
|
|
2
2
|
import { ProductReadContracts } from "../../../packages/gateway-contract/src/capabilities.js";
|
|
3
3
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
4
|
+
import { init_task_deliverables, listDeliverables } from "../task-deliverables.js";
|
|
4
5
|
import { TaskRepository, init_task_repository } from "../task-repository.js";
|
|
5
6
|
import { init_task_result_versions, listTaskResultVersions } from "../task-result-versions.js";
|
|
6
7
|
import { TaskRunRepository, init_task_run_repository } from "../task-run-repository.js";
|
|
@@ -13,11 +14,11 @@ import { defineReadCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
|
13
14
|
import { LocalAppTaskListSchema, LocalAppTaskOutputSchema } from "../../local-apps/capabilities/projections.js";
|
|
14
15
|
import { TaskDependencyService } from "../task-dependency-service.js";
|
|
15
16
|
import { TaskValueMetricsService } from "../task-value-metrics-service.js";
|
|
16
|
-
import { listDeliverables } from "../task-deliverables.js";
|
|
17
17
|
//#region src/tasks/capabilities/read.ts
|
|
18
18
|
init_src();
|
|
19
19
|
init_task_repository();
|
|
20
20
|
init_task_run_repository();
|
|
21
|
+
init_task_deliverables();
|
|
21
22
|
init_task_result_versions();
|
|
22
23
|
function registerTaskReadCapabilities(dispatcher) {
|
|
23
24
|
dispatcher.register(defineReadCapability({
|
|
@@ -1,2 +1,103 @@
|
|
|
1
|
+
import { type ActorRef } from '@xopcai/gateway-contract';
|
|
1
2
|
import { type CapabilityDispatcher } from '../../capabilities/runtime/dispatcher.js';
|
|
3
|
+
export declare function cancelTaskRun({ id, expectedVersion, reason, actor, suppressAttention }: {
|
|
4
|
+
id: string;
|
|
5
|
+
expectedVersion: number;
|
|
6
|
+
reason: string;
|
|
7
|
+
actor?: ActorRef;
|
|
8
|
+
suppressAttention?: boolean;
|
|
9
|
+
}): {
|
|
10
|
+
ok: true;
|
|
11
|
+
run: {
|
|
12
|
+
id: string;
|
|
13
|
+
taskId: string;
|
|
14
|
+
rootRunId: string;
|
|
15
|
+
attempt: number;
|
|
16
|
+
status: "queued" | "cancelled" | "waiting" | "failed" | "succeeded" | "running" | "verifying";
|
|
17
|
+
executorKind: "agent" | "human" | "external";
|
|
18
|
+
executorRef: Record<string, unknown>;
|
|
19
|
+
trigger: Record<string, unknown>;
|
|
20
|
+
correlationId: string;
|
|
21
|
+
idempotencyKey: string;
|
|
22
|
+
contractVersion: number;
|
|
23
|
+
queuedAt: number;
|
|
24
|
+
retryPolicy: Record<string, unknown>;
|
|
25
|
+
version: number;
|
|
26
|
+
parentRunId?: string;
|
|
27
|
+
causationId?: string;
|
|
28
|
+
instructionSequenceAtStart?: number;
|
|
29
|
+
contextSnapshotId?: string;
|
|
30
|
+
policySnapshot?: Record<string, unknown>;
|
|
31
|
+
conversationId?: string;
|
|
32
|
+
scheduledAt?: number;
|
|
33
|
+
startedAt?: number;
|
|
34
|
+
heartbeatAt?: number;
|
|
35
|
+
completedAt?: number;
|
|
36
|
+
timeoutAt?: number;
|
|
37
|
+
leaseOwner?: string;
|
|
38
|
+
leaseExpiresAt?: number;
|
|
39
|
+
retryOfRunId?: string;
|
|
40
|
+
terminalCode?: string;
|
|
41
|
+
terminalMessage?: string;
|
|
42
|
+
};
|
|
43
|
+
receipt: {
|
|
44
|
+
runId: string;
|
|
45
|
+
status: "cancelled" | "failed" | "succeeded";
|
|
46
|
+
summary: string;
|
|
47
|
+
changes: {
|
|
48
|
+
kind: "state" | "source" | "artifact" | "test";
|
|
49
|
+
title: string;
|
|
50
|
+
summary: string;
|
|
51
|
+
provenance: "user" | "external" | "tool" | "judge";
|
|
52
|
+
strength: "verified" | "observed";
|
|
53
|
+
observedAt: number;
|
|
54
|
+
uri?: string;
|
|
55
|
+
verifies?: string[];
|
|
56
|
+
}[];
|
|
57
|
+
evidence: {
|
|
58
|
+
kind: "state" | "source" | "artifact" | "test";
|
|
59
|
+
title: string;
|
|
60
|
+
summary: string;
|
|
61
|
+
provenance: "user" | "external" | "tool" | "judge";
|
|
62
|
+
strength: "verified" | "observed";
|
|
63
|
+
observedAt: number;
|
|
64
|
+
uri?: string;
|
|
65
|
+
verifies?: string[];
|
|
66
|
+
}[];
|
|
67
|
+
verification: {
|
|
68
|
+
status: "passed" | "failed" | "unverified";
|
|
69
|
+
checks: {
|
|
70
|
+
criterion: string;
|
|
71
|
+
status: "passed" | "failed" | "unverified";
|
|
72
|
+
evidenceTitles: string[];
|
|
73
|
+
checkId?: string;
|
|
74
|
+
note?: string;
|
|
75
|
+
method?: "unverified" | "tool_verified" | "model_reviewed";
|
|
76
|
+
}[];
|
|
77
|
+
};
|
|
78
|
+
remainingWork: string[];
|
|
79
|
+
needsUser: boolean;
|
|
80
|
+
finalizedAt: number;
|
|
81
|
+
nextAction?: string;
|
|
82
|
+
completionVerdict?: "partial" | "achieved" | "not_achieved";
|
|
83
|
+
failure?: {
|
|
84
|
+
code: string;
|
|
85
|
+
phase: string;
|
|
86
|
+
recoveryAction: string;
|
|
87
|
+
};
|
|
88
|
+
judgment?: {
|
|
89
|
+
recommendation: string;
|
|
90
|
+
reasons: string[];
|
|
91
|
+
rejectedAlternatives: {
|
|
92
|
+
option: string;
|
|
93
|
+
reason: string;
|
|
94
|
+
}[];
|
|
95
|
+
confidence: number;
|
|
96
|
+
uncertainty?: string;
|
|
97
|
+
};
|
|
98
|
+
contextTraceId?: string;
|
|
99
|
+
};
|
|
100
|
+
model: import("../task-read-model-projector.js").TaskReadModel;
|
|
101
|
+
executionStopConfirmed: false;
|
|
102
|
+
};
|
|
2
103
|
export declare function registerTaskRunWriteCapabilities(dispatcher: CapabilityDispatcher, wake?: (runs: boolean) => void): void;
|
|
@@ -9,6 +9,42 @@ import { TaskApplicationService } from "../task-application-service.js";
|
|
|
9
9
|
init_src();
|
|
10
10
|
init_task_repository();
|
|
11
11
|
init_task_run_repository();
|
|
12
|
+
function cancelTaskRun({ id, expectedVersion, reason, actor, suppressAttention }) {
|
|
13
|
+
const runs = new TaskRunRepository();
|
|
14
|
+
const run = runs.get(id);
|
|
15
|
+
if (!run) throw new CapabilityError("NOT_FOUND", "TaskRun not found");
|
|
16
|
+
if (run.version !== expectedVersion) throw new CapabilityError("REVISION_CONFLICT", "TaskRun changed");
|
|
17
|
+
const task = new TaskRepository().require(run.taskId);
|
|
18
|
+
const result = new TaskApplicationService().completeRun({
|
|
19
|
+
runId: id,
|
|
20
|
+
expectedRunVersion: expectedVersion,
|
|
21
|
+
actor,
|
|
22
|
+
suppressAttention,
|
|
23
|
+
terminalCode: actor?.kind === "agent" ? "cancelled_by_agent" : "cancelled_by_user",
|
|
24
|
+
terminalMessage: reason,
|
|
25
|
+
receipt: {
|
|
26
|
+
status: "cancelled",
|
|
27
|
+
summary: reason,
|
|
28
|
+
changes: [],
|
|
29
|
+
evidence: [],
|
|
30
|
+
verification: {
|
|
31
|
+
status: "unverified",
|
|
32
|
+
checks: []
|
|
33
|
+
},
|
|
34
|
+
remainingWork: [task.contract?.objective ?? task.title],
|
|
35
|
+
needsUser: false,
|
|
36
|
+
completionVerdict: "not_achieved"
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
if (!result.ok) throw new CapabilityError("REVISION_CONFLICT", "TaskRun cannot be cancelled in its current state");
|
|
40
|
+
return {
|
|
41
|
+
ok: true,
|
|
42
|
+
run: runs.require(id),
|
|
43
|
+
receipt: runs.getReceipt(id),
|
|
44
|
+
model: result.model,
|
|
45
|
+
executionStopConfirmed: false
|
|
46
|
+
};
|
|
47
|
+
}
|
|
12
48
|
function registerTaskRunWriteCapabilities(dispatcher, wake) {
|
|
13
49
|
dispatcher.register(defineAtomicCapability({
|
|
14
50
|
id: "xopc.task_runs.feedback",
|
|
@@ -45,40 +81,11 @@ function registerTaskRunWriteCapabilities(dispatcher, wake) {
|
|
|
45
81
|
scopes: ["tasks.write"],
|
|
46
82
|
input: TaskRunCancelInputSchema,
|
|
47
83
|
output: TaskRunCancelOutputSchema,
|
|
48
|
-
execute(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (run.version !== expectedVersion) throw new CapabilityError("REVISION_CONFLICT", "TaskRun changed");
|
|
53
|
-
const task = new TaskRepository().require(run.taskId);
|
|
54
|
-
const result = new TaskApplicationService().completeRun({
|
|
55
|
-
runId: id,
|
|
56
|
-
expectedRunVersion: expectedVersion,
|
|
57
|
-
actor: context.actor,
|
|
58
|
-
terminalCode: context.actor?.kind === "agent" ? "cancelled_by_agent" : "cancelled_by_user",
|
|
59
|
-
terminalMessage: reason,
|
|
60
|
-
receipt: {
|
|
61
|
-
status: "cancelled",
|
|
62
|
-
summary: reason,
|
|
63
|
-
changes: [],
|
|
64
|
-
evidence: [],
|
|
65
|
-
verification: {
|
|
66
|
-
status: "unverified",
|
|
67
|
-
checks: []
|
|
68
|
-
},
|
|
69
|
-
remainingWork: [task.contract?.objective ?? task.title],
|
|
70
|
-
needsUser: false,
|
|
71
|
-
completionVerdict: "not_achieved"
|
|
72
|
-
}
|
|
84
|
+
execute(input, context) {
|
|
85
|
+
return cancelTaskRun({
|
|
86
|
+
...input,
|
|
87
|
+
actor: context.actor
|
|
73
88
|
});
|
|
74
|
-
if (!result.ok) throw new CapabilityError("REVISION_CONFLICT", "TaskRun cannot be cancelled in its current state");
|
|
75
|
-
return {
|
|
76
|
-
ok: true,
|
|
77
|
-
run: runs.require(id),
|
|
78
|
-
receipt: runs.getReceipt(id),
|
|
79
|
-
model: result.model,
|
|
80
|
-
executionStopConfirmed: false
|
|
81
|
-
};
|
|
82
89
|
},
|
|
83
90
|
afterCommit() {
|
|
84
91
|
wake?.(false);
|
|
@@ -86,4 +93,4 @@ function registerTaskRunWriteCapabilities(dispatcher, wake) {
|
|
|
86
93
|
}));
|
|
87
94
|
}
|
|
88
95
|
//#endregion
|
|
89
|
-
export { registerTaskRunWriteCapabilities };
|
|
96
|
+
export { cancelTaskRun, registerTaskRunWriteCapabilities };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TaskCommandRequestSchema, TaskCreateRequestSchema, TaskDetailResponseSchema } from "../../../packages/gateway-contract/src/tasks.js";
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { DurableState } from "../../storage/sqlite/durable-state.js";
|
|
3
|
+
import { DurableState, init_durable_state } from "../../storage/sqlite/durable-state.js";
|
|
4
4
|
import { TaskRepository, init_task_repository } from "../task-repository.js";
|
|
5
5
|
import { TaskRunRepository, init_task_run_repository } from "../task-run-repository.js";
|
|
6
6
|
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
@@ -17,6 +17,7 @@ import { z } from "zod";
|
|
|
17
17
|
init_src();
|
|
18
18
|
init_task_run_repository();
|
|
19
19
|
init_task_repository();
|
|
20
|
+
init_durable_state();
|
|
20
21
|
const modelSchema = TaskDetailResponseSchema.pick({
|
|
21
22
|
task: true,
|
|
22
23
|
operationalState: true,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DurableState } from '../storage/sqlite/durable-state.js';
|
|
2
|
+
export declare const delegatedRunText: DurableState<string>;
|
|
3
|
+
type PublishedArtifact = {
|
|
4
|
+
artifactId: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
kind: string;
|
|
7
|
+
mimeType?: string;
|
|
8
|
+
sizeBytes?: number;
|
|
9
|
+
sha256?: string;
|
|
10
|
+
fileId?: string;
|
|
11
|
+
mediaId?: string;
|
|
12
|
+
shareUrl?: string;
|
|
13
|
+
available: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare function listDelegatedRunArtifacts(runId: string): PublishedArtifact[];
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
3
|
+
import { parseFileResourceArtifactUri, parseTurnOutcome } from "../../packages/gateway-contract/src/turn-outcome.js";
|
|
4
|
+
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
5
|
+
import { DurableState, init_durable_state } from "../storage/sqlite/durable-state.js";
|
|
6
|
+
import { init_uri, tryParseMediaUri } from "../media/uri.js";
|
|
7
|
+
import { init_task_deliverables, isAvailableDeliverable } from "./task-deliverables.js";
|
|
8
|
+
//#region src/tasks/delegated-run-result.ts
|
|
9
|
+
function listDelegatedRunArtifacts(runId) {
|
|
10
|
+
const rows = getSqliteDatabase().prepare(`SELECT outcome_json FROM task_run_outcomes
|
|
11
|
+
WHERE task_run_id = ? ORDER BY rowid`).iterate(runId);
|
|
12
|
+
const now = Date.now();
|
|
13
|
+
const artifacts = /* @__PURE__ */ new Map();
|
|
14
|
+
for (const row of rows) for (const item of parseTurnOutcome(JSON.parse(row.outcome_json))?.deliverables ?? []) {
|
|
15
|
+
const publishedFileId = item.sourceFileId ?? parseFileResourceArtifactUri(item.uri ?? "");
|
|
16
|
+
const fileId = publishedFileId?.startsWith("host-") ? void 0 : publishedFileId ?? void 0;
|
|
17
|
+
const media = item.location === "artifact_store" && item.uri && tryParseMediaUri(item.uri);
|
|
18
|
+
const mediaId = media && media.bucket === "outbound" && media.id === item.artifactId ? media.id : void 0;
|
|
19
|
+
const { artifactId, title, kind, mimeType, sizeBytes, sha256, shareUrl } = item;
|
|
20
|
+
const url = shareUrl && URL.parse(shareUrl);
|
|
21
|
+
artifacts.set(artifactId, {
|
|
22
|
+
artifactId,
|
|
23
|
+
title,
|
|
24
|
+
kind,
|
|
25
|
+
mimeType,
|
|
26
|
+
sizeBytes,
|
|
27
|
+
sha256,
|
|
28
|
+
fileId,
|
|
29
|
+
mediaId,
|
|
30
|
+
shareUrl: url && url.protocol === "https:" && !url.username && !url.password ? shareUrl : void 0,
|
|
31
|
+
available: isAvailableDeliverable(item, now)
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return [...artifacts.values()].filter((artifact) => artifact.available);
|
|
35
|
+
}
|
|
36
|
+
var delegatedRunText;
|
|
37
|
+
var init_delegated_run_result = __esmMin((() => {
|
|
38
|
+
init_src();
|
|
39
|
+
init_uri();
|
|
40
|
+
init_durable_state();
|
|
41
|
+
init_transaction();
|
|
42
|
+
init_task_deliverables();
|
|
43
|
+
delegatedRunText = new DurableState("delegated-run-result");
|
|
44
|
+
}));
|
|
45
|
+
//#endregion
|
|
46
|
+
init_delegated_run_result();
|
|
47
|
+
export { delegatedRunText, init_delegated_run_result, listDelegatedRunArtifacts };
|
package/dist/src/tasks/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { enqueueTaskAttentionRequiredEvent, enqueueTaskChanged, enqueueTaskChangedEvent, init_task_change_events } from "./task-change-events.js";
|
|
2
2
|
import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
3
|
-
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
3
|
+
import { TaskRunRepository, init_task_run_repository, mcpDelegatedRunPrincipal } from "./task-run-repository.js";
|
|
4
4
|
import { TaskContextRepository } from "./task-context-repository.js";
|
|
5
5
|
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
6
6
|
import { TaskConversationConflictError, TaskConversationRepository } from "./task-conversation-repository.js";
|
|
@@ -24,4 +24,4 @@ init_task_repository();
|
|
|
24
24
|
init_task_change_events();
|
|
25
25
|
init_task_run_repository();
|
|
26
26
|
//#endregion
|
|
27
|
-
export { AttentionGovernor, HomeQueryService, ModelTaskContractPlanner, ProjectOperatingViewService, TaskApplicationService, TaskContextRepository, TaskConversationConflictError, TaskConversationRepository, TaskDeletionService, TaskDependencyError, TaskDependencyService, TaskHandoffService, TaskReadModelProjector, TaskRepository, TaskRunCoordinator, TaskRunDispatcher, TaskRunRepository, TaskSignalService, TaskValueMetricsService, assembleTaskContext, buildDelegatedTaskDirective, buildHomeWorkbench, buildTaskExecutionDirective, buildTaskRunMessage, compareHomeDecisions, decisionFromTask, defineTaskContract, enqueueTaskAttentionRequiredEvent, enqueueTaskChanged, enqueueTaskChangedEvent, getTaskContextManifest, getTaskExecutionBrief, parseTaskContractResponse, resolveExecutionContext, summarizeProjectOperatingView };
|
|
27
|
+
export { AttentionGovernor, HomeQueryService, ModelTaskContractPlanner, ProjectOperatingViewService, TaskApplicationService, TaskContextRepository, TaskConversationConflictError, TaskConversationRepository, TaskDeletionService, TaskDependencyError, TaskDependencyService, TaskHandoffService, TaskReadModelProjector, TaskRepository, TaskRunCoordinator, TaskRunDispatcher, TaskRunRepository, TaskSignalService, TaskValueMetricsService, assembleTaskContext, buildDelegatedTaskDirective, buildHomeWorkbench, buildTaskExecutionDirective, buildTaskRunMessage, compareHomeDecisions, decisionFromTask, defineTaskContract, enqueueTaskAttentionRequiredEvent, enqueueTaskChanged, enqueueTaskChangedEvent, getTaskContextManifest, getTaskExecutionBrief, mcpDelegatedRunPrincipal, parseTaskContractResponse, resolveExecutionContext, summarizeProjectOperatingView };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ActorRef, TaskCommand, TaskChangeSource, TaskCreateRequest, TaskResultPolicy, TaskRunReceipt } from '@xopcai/gateway-contract';
|
|
2
2
|
import { type TaskReadModel } from './task-read-model-projector.js';
|
|
3
3
|
import type { TurnContextRef } from '../agent/source-context/types.js';
|
|
4
|
+
import { type WorkspaceFileInput } from './task-handoff.js';
|
|
4
5
|
import type { UnconfirmedToolEffect } from '../agent/orchestration/turn-recovery.js';
|
|
5
6
|
export type TaskApplicationResult = {
|
|
6
7
|
ok: true;
|
|
@@ -27,6 +28,10 @@ export declare class TaskApplicationService {
|
|
|
27
28
|
create(input: TaskCreateRequest, actor?: ActorRef, options?: {
|
|
28
29
|
linkRunningOriginInput?: boolean;
|
|
29
30
|
resultPolicy?: TaskResultPolicy;
|
|
31
|
+
workspaceHandoff?: {
|
|
32
|
+
prompt: string;
|
|
33
|
+
files: readonly WorkspaceFileInput[];
|
|
34
|
+
};
|
|
30
35
|
}): TaskApplicationResult;
|
|
31
36
|
/** Atomically open a new work revision; allocation and source IO remain background work. */
|
|
32
37
|
reviseCompleted(input: {
|
|
@@ -49,6 +54,7 @@ export declare class TaskApplicationService {
|
|
|
49
54
|
triggerContext?: Record<string, unknown>;
|
|
50
55
|
source?: TaskChangeSource;
|
|
51
56
|
retry?: TaskRunRetry;
|
|
57
|
+
allocationSources?: TurnContextRef[];
|
|
52
58
|
}): TaskApplicationResult;
|
|
53
59
|
completeRun(input: {
|
|
54
60
|
runId: string;
|
|
@@ -3,17 +3,18 @@ import { TaskExecutorSelectionSchema, taskCheckId, verifiedTaskCheckIds } from "
|
|
|
3
3
|
import { resultReferenceId, resultReferenceVersion } from "../../packages/gateway-contract/src/result-reference.js";
|
|
4
4
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
5
5
|
import { enqueueTaskAttentionRequiredEvent, enqueueTaskChangedEvent, init_task_change_events } from "./task-change-events.js";
|
|
6
|
+
import { delegatedRunText, init_delegated_run_result } from "./delegated-run-result.js";
|
|
6
7
|
import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
7
8
|
import { init_task_instruction_sequence, taskInstructionSequence } from "./task-instruction-sequence.js";
|
|
8
9
|
import { init_task_workspace_verification, verifyTaskWorkspace } from "./task-workspace-verification.js";
|
|
9
|
-
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
10
|
+
import { TaskRunRepository, init_task_run_repository, mcpDelegatedRunPrincipal } from "./task-run-repository.js";
|
|
10
11
|
import { init_request_repository, personalRequestForTask } from "../personal-agent/request-repository.js";
|
|
11
12
|
import { resolveTaskLocale } from "./task-language.js";
|
|
12
13
|
import { TaskAllocationRepository } from "./task-allocation-repository.js";
|
|
13
14
|
import { TaskCriterionReviewRepository } from "./task-criterion-review-repository.js";
|
|
14
15
|
import { resolvePersonalResultReference } from "../personal-agent/result-reader.js";
|
|
15
16
|
import { TaskContextRepository } from "./task-context-repository.js";
|
|
16
|
-
import { captureTaskHandoff } from "./task-handoff.js";
|
|
17
|
+
import { captureTaskHandoff, captureWorkspaceFileHandoff, replaceUnresolvedTaskHandoffReferences } from "./task-handoff.js";
|
|
17
18
|
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
18
19
|
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
19
20
|
import { TaskCollaborationRepository } from "./task-collaboration-repository.js";
|
|
@@ -24,6 +25,7 @@ import { createHash, randomUUID } from "node:crypto";
|
|
|
24
25
|
//#region src/tasks/task-application-service.ts
|
|
25
26
|
init_src();
|
|
26
27
|
init_transaction();
|
|
28
|
+
init_delegated_run_result();
|
|
27
29
|
init_task_change_events();
|
|
28
30
|
init_request_repository();
|
|
29
31
|
init_task_repository();
|
|
@@ -132,6 +134,7 @@ var TaskApplicationService = class {
|
|
|
132
134
|
createdBy: actor
|
|
133
135
|
});
|
|
134
136
|
if (input.originConversationId && input.activation.mode === "allocate") captureTaskHandoff(task.id, input.originConversationId, input.body ?? input.contract.objective);
|
|
137
|
+
else if (options?.workspaceHandoff?.files.length) captureWorkspaceFileHandoff(task.id, options.workspaceHandoff.prompt, options.workspaceHandoff.files);
|
|
135
138
|
for (const grant of input.authorityGrants) this.#context.grant({
|
|
136
139
|
taskId: task.id,
|
|
137
140
|
...grant,
|
|
@@ -348,7 +351,17 @@ var TaskApplicationService = class {
|
|
|
348
351
|
reason: "conflict",
|
|
349
352
|
model
|
|
350
353
|
};
|
|
351
|
-
if (
|
|
354
|
+
if (input.allocationSources && input.command.type !== "retry_allocation") return {
|
|
355
|
+
ok: false,
|
|
356
|
+
reason: "invalid_transition",
|
|
357
|
+
model
|
|
358
|
+
};
|
|
359
|
+
const commandHash = requestHash(input.allocationSources ? {
|
|
360
|
+
taskId: input.taskId,
|
|
361
|
+
command: input.command,
|
|
362
|
+
sources: input.allocationSources
|
|
363
|
+
} : input.command);
|
|
364
|
+
if (this.readCommand(input.idempotencyKey, commandHash)) return {
|
|
352
365
|
ok: true,
|
|
353
366
|
model
|
|
354
367
|
};
|
|
@@ -399,7 +412,7 @@ var TaskApplicationService = class {
|
|
|
399
412
|
break;
|
|
400
413
|
case "retry_allocation": {
|
|
401
414
|
const allocation = new TaskAllocationRepository().get(task.id);
|
|
402
|
-
if (!allocation || !["blocked", "failed"].includes(allocation.status) || task.phase === "closed" || this.#runs.getActiveRoot(task.id) || this.#runs.listActiveWaits(task.id).length) {
|
|
415
|
+
if (!allocation || !["blocked", "failed"].includes(allocation.status) || task.phase === "closed" || this.#runs.getActiveRoot(task.id) || this.#runs.listActiveWaits(task.id).length || input.allocationSources && (allocation.reason_code !== "source_reference_unavailable" || this.#runs.getLatestRoot(task.id))) {
|
|
403
416
|
result = {
|
|
404
417
|
ok: false,
|
|
405
418
|
reason: "invalid_transition",
|
|
@@ -416,6 +429,7 @@ var TaskApplicationService = class {
|
|
|
416
429
|
};
|
|
417
430
|
break;
|
|
418
431
|
}
|
|
432
|
+
if (input.allocationSources) replaceUnresolvedTaskHandoffReferences(task.id, input.allocationSources);
|
|
419
433
|
db.prepare("UPDATE task_allocations SET status = 'pending', attempts = 0, reason_code = NULL, task_version = ?, next_attempt_at = ?, updated_at = ? WHERE task_id = ?").run(updated.version, Date.now(), Date.now(), task.id);
|
|
420
434
|
new TaskAllocationRepository().publish(task.id, `任务「${task.title}」正在重新分配执行者。`);
|
|
421
435
|
result = {
|
|
@@ -644,7 +658,7 @@ var TaskApplicationService = class {
|
|
|
644
658
|
key: input.idempotencyKey,
|
|
645
659
|
type: `task.${input.command.type}`,
|
|
646
660
|
subjectId: task.id,
|
|
647
|
-
hash:
|
|
661
|
+
hash: commandHash,
|
|
648
662
|
result: {
|
|
649
663
|
taskId: task.id,
|
|
650
664
|
runId: result.runId
|
|
@@ -731,6 +745,7 @@ var TaskApplicationService = class {
|
|
|
731
745
|
reason: "conflict",
|
|
732
746
|
model: this.#projector.get(run.taskId)
|
|
733
747
|
};
|
|
748
|
+
if (mcpDelegatedRunPrincipal(run) && input.resultText?.trim() && input.resultText.trim() !== "NO_REPLY") delegatedRunText.set(run.id, input.resultText);
|
|
734
749
|
const activeConversationId = new TaskConversationRepository().getState(task.id)?.activeConversationId;
|
|
735
750
|
const alreadyWaiting = this.#runs.listActiveWaits(task.id).length > 0;
|
|
736
751
|
const current = !run.parentRunId && run.contractVersion === task.latestContractVersion && (!run.conversationId || !activeConversationId || run.conversationId === activeConversationId);
|
|
@@ -4,7 +4,7 @@ import { verifiedTaskCriteria } from "../../packages/gateway-contract/src/tasks.
|
|
|
4
4
|
import { PERSONAL_WORKER_RESULT_GUIDANCE } from "../../packages/gateway-contract/src/task-display.js";
|
|
5
5
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
6
6
|
import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
7
|
-
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
7
|
+
import { TaskRunRepository, init_task_run_repository, mcpDelegatedRunPrincipal } from "./task-run-repository.js";
|
|
8
8
|
import { init_request_repository, personalRequestForTask } from "../personal-agent/request-repository.js";
|
|
9
9
|
import "../storage/sqlite/index.js";
|
|
10
10
|
import { TaskContextRepository } from "./task-context-repository.js";
|
|
@@ -123,11 +123,13 @@ function assembleTaskContext(conversationId, userQuery) {
|
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
function buildTaskExecutionDirective(conversationId) {
|
|
126
|
-
const
|
|
127
|
-
const
|
|
126
|
+
const conversations = new TaskConversationRepository();
|
|
127
|
+
const active = isXopcDatabaseOpen() ? conversations.resolveActiveExecutionSession(conversationId) : void 0;
|
|
128
|
+
const brief = active ? getTaskExecutionBrief(active.taskId) : void 0;
|
|
128
129
|
if (!brief) return "";
|
|
129
130
|
const { task, remainingCriteria } = brief;
|
|
130
|
-
const
|
|
131
|
+
const mcpDelegation = active?.runId && mcpDelegatedRunPrincipal(new TaskRunRepository().get(active.runId));
|
|
132
|
+
const handoff = conversations.getLatestHandoff(task.id);
|
|
131
133
|
const handoffPayload = handoff?.toConversationId === conversationId ? JSON.stringify(handoff.payload).slice(0, 12e3) : "";
|
|
132
134
|
const contract = task.contract;
|
|
133
135
|
const contextEdges = new TaskContextRepository().list(task.id);
|
|
@@ -160,7 +162,8 @@ function buildTaskExecutionDirective(conversationId) {
|
|
|
160
162
|
})))}`,
|
|
161
163
|
verifyJson ? "For this exact JSON-only request, the host directly checks the published file against every criterion. Publish only the requested final JSON file, then finish. This check replaces publish_task_result for this request." : "",
|
|
162
164
|
contract.resultPolicy === "selected" && !verifyJson ? PERSONAL_WORKER_RESULT_GUIDANCE : "",
|
|
163
|
-
verifyJson ? "" : "For research or evidence-based conclusions, use publish_task_result before finishing when that tool is available. Cite exact excerpts from successful reads in this TaskRun, link each claim to source ids, and distinguish facts, inferences and recommendations. Publish required files first, then
|
|
165
|
+
verifyJson ? "" : "For research or evidence-based conclusions, use publish_task_result before finishing when that tool is available. Cite exact excerpts from successful reads in this TaskRun, link each claim to source ids, and distinguish facts, inferences and recommendations. Publish required files first, then select only the final deliverables from their publication receipts. Use finalArtifactIds for a new or changed set of outputs. For republication of selected files, use mode=amend and replacementArtifactIds with only their new receipts. Read its per-criterion review; correct unsupported claims or explicitly disclose unmet/unverified criteria. Never replace missing evidence with a self-declared pass. Use task_collaboration get section evidence to recover real toolCallIds and exact excerpts. If the chat reply itself is a deliverable, include the exact reply in finalText, including any required limitations, links and formatting. The host will review that text and deliver it verbatim. Keep it within the requested limits and amend finalText if the review finds gaps. Do not cite it as a source or create a separate file to prove its wording. A source quote match proves provenance, not factual truth. Keep the final reply concise; full evidence belongs in the result and report.",
|
|
166
|
+
verifyJson ? "" : "When the request has material coverage requirements, search the distinct parts of the requested scope. Use targeted follow-up reads to resolve thin, duplicate or failed results and check original sources when summaries lack the required details. In the final result state the actual scope covered and any remaining gap. A few supported examples only satisfy a request for examples.",
|
|
164
167
|
"For chat delivery, lead with the result and keep the evidence, material changes, and limitations that affect use. Use the shortest form that covers what the user asked for. General brevity is an editorial preference. Apply numerical length limits only when requested. When files contain the full report, leave methodology and repeated detail there unless requested.",
|
|
165
168
|
`Acceptance policy: ${contract.acceptancePolicy}. Automatic tasks close after verified completion. Request user input only for a real missing decision or authorization; do not ask for routine acceptance.`,
|
|
166
169
|
contract.constraints.length ? `Constraints: ${contract.constraints.join("; ")}` : "",
|
|
@@ -172,7 +175,8 @@ function buildTaskExecutionDirective(conversationId) {
|
|
|
172
175
|
handoffPayload ? `Handoff snapshot: ${handoffPayload}` : "",
|
|
173
176
|
collaboration.length ? `Recent task collaboration:\n${collaboration.map((entry) => `- ${entry.sequence} id=${entry.id} ${entry.authorKind} ${entry.kind} superseded=${superseded.has(entry.id)} delivery=${entry.deliveryStatus ?? "none"}${entry.causationId ? ` replyTo=${entry.causationId}` : ""}: ${JSON.stringify(entry.body)}`).join("\n")}` : "",
|
|
174
177
|
`Initial handoff snapshots, source references and toolCallIds are not collaboration entries and require no ack. Before continuing, acknowledge only delivered user/main_agent collaboration entries of kind answer or instruction with ${postTool}, kind ack, causationId equal to its entry ID. Explain your interpretation and how the final output will incorporate it. Acknowledgement records receipt and intent, not proof of completion. Do not act on or acknowledge superseded directions. Apply all remaining applicable user directions on this same Task; report its actual adoption and any unmet requirements in the final result.`,
|
|
175
|
-
`Report meaningful progress with ${postTool}
|
|
178
|
+
`Report meaningful progress with ${postTool}.`,
|
|
179
|
+
mcpDelegation ? "If blocked by a missing decision, ask the MCP requester with clarify and stop this execution turn until answered." : "If blocked, post a question and stop this execution turn until answered.",
|
|
176
180
|
(contract.brief?.length ?? 0) > 12e3 ? "Task details above are an excerpt. Read every page with task_collaboration(command=\"get\", section=\"brief\", offset=0) and nextOffset before execution." : "",
|
|
177
181
|
connected ? `Connected request ${connected.requestId}: retain connector ${connected.connectorId} and account ${connected.accountId}. Text answers and instructions do not authorize account changes or writes. Use personal_request_connection for expired access; only the main connection UI can authorize recovery. Publish the latest adopted result with personal_request_result after all answers/instructions, then call publish_task_result using exact evidence from successful xopc_tool_execute reads to verify the saved summary, structured items and coverage. Correct and resave the connected result before resubmitting evidence. Do not use unavailable artifact tools.` : "",
|
|
178
182
|
connected ? "Connected results and structured items return to the originating conversation automatically after this Task completes." : "For user-facing files, publish completed outputs with publish_artifacts before finishing. image_generate already publishes its images. Return structured artifact references rather than only local file paths. Published final outcomes are delivered automatically to the originating chat. Keep the final summary short and distinguish generated outputs from verified or accepted results.",
|
|
@@ -93,6 +93,7 @@ var ModelTaskContractPlanner = class {
|
|
|
93
93
|
"Keep each criterion concise and concrete. For simple work use the fewest checks that cover all explicit deliverables and material constraints. Prefer observable checks such as the required file, format, fields or count. Treat optional analysis, extra conclusions and aesthetic improvements as optional unless the user requires them. Do not invent work to make the contract more elaborate.",
|
|
94
94
|
"Keep delivery format and character limits in their own criteria, separate from factual accuracy, publication dates and source requirements. For explicit chat format and limits, use concrete wording such as \"The final reply must be plain text\" or \"The final reply must be at most 500 characters\". For explicitly requested HTML structure, describe the required file name or page elements separately from what those elements must substantively say.",
|
|
95
95
|
"Define criteria for the deliverables requested by the user. When the requested answer is a chat reply, list it explicitly in expectedOutputs and preserve its concrete requirements, including language and any length limits the user actually set. Treat general brevity or “keep it short” as a presentation preference. Do not turn it into a word or character quota or an acceptance check. Keep source support, calculations, completeness and requested limitations as separate criteria. Do not create self-referential criteria about calling publish_task_result, receiving this review or wording a routine delivery acknowledgement.",
|
|
96
|
+
"When the user asks for a survey, roundup, comparison, or other scoped retrieval, define a separate coverage criterion. Describe the intended population or scope and the material dimensions the request implies, such as time range, source groups, entities, or topics. Require disclosure of gaps. Do not infer completeness from correctness of the items returned, invent arbitrary quotas, or require broad coverage for a single factual lookup.",
|
|
96
97
|
"requiredCapabilities is a minimal subset of read_input, execute_code, publish_files, web_research, browser, generate_image. Include only operations necessary for the requested inputs/outputs; this list selects registered tools and grants no permissions. Do not require browser when ordinary web fetch suffices. Preserve explicit executor/Skill and scope constraints.",
|
|
97
98
|
"List assumptions explicitly. Put only irreversible, external, financial, privacy, or permission decisions in approvalRequired.",
|
|
98
99
|
"Return one JSON object only. Every array contains flat strings, never objects or nested arrays. Schema example: {\"objective\":\"Deliver the requested work\",\"expectedOutputs\":[\"report.md\"],\"acceptanceCriteria\":[\"report.md contains the requested evidence\"],\"constraints\":[],\"approvalRequired\":[],\"assumptions\":[],\"risks\":[],\"requiredCapabilities\":[\"read_input\",\"publish_files\"]}. Capabilities must use the allowed enum values.",
|