@xopcai/xopc 0.0.454 → 0.0.455
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/eventEmitter2.js +40 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/index.js +56 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/shared/conout.js +16 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/terminal.js +190 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/unixTerminal.js +287 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/utils.js +49 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/windowsConoutConnection.js +190 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/windowsPtyAgent.js +265 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/windowsTerminal.js +178 -0
- package/dist/_virtual/_rolldown/runtime.js +10 -2
- 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-BKH-qNPt.js → activity-store-DYwR1u3f.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DY6IWy0_.js → agent-avatar-dicebear-CsRBprL-.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-tnAtQOAZ.js → agent-avatar-display-DqFYHXCS.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BLQ2N_dY.js → agent-defaults-settings-panel-DOAJrMLe.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-Bfsm4GOs.js → agent-plugin-dialog-vqlN3ORH.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-CDNiLv0W.js → agents-BgHlOVRV.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-DGZsm8U4.js → agents-admin-api-CKscfdvA.js} +1 -1
- package/dist/gateway/static/root/assets/{api-BhipC15e.js → api-CHM2c_Ah.js} +1 -1
- package/dist/gateway/static/root/assets/{api-Bbj5k-7e.js → api-DPNeNCmR.js} +1 -1
- package/dist/gateway/static/root/assets/{app-link-CCZ-LmVT.js → app-link-DImAfVs5.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-fwhXHKxt.js → app-management-settings-panel-Bhz6bj1C.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BHkl-vFO.js → appearance-settings-BX32aogA.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DtCWwdsK.js → apps-page-0Yo3jBsQ.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-B9xaxa7V.js → archive-plugin-Bha8obMe.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-BHMjSwcy.js → automation-api-mn8ihWJ_.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-BgAjEoNV.js → automation-result-state-COzakzak.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-D3Eon5C0.js → automation-run-list-BhtaMpTb.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-DJRg72t-.js → automation-task-card-BY_k6iWp.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DdAzXb7s.js → automations-page-Dt_Z1UTT.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-D0nNat6N.js → automations-workspace-BhHgruhH.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-CgsjdprR.js → binary-plugins-DUbrJFLU.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-r6vj6dZO.js → block-editor-DW--pXAc.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-APCGT8Yr.js → browser-settings-page-CDh6nxs9.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-0gYkjdax.js → capabilities-DKbXv8Ck.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BgBwcqvY.js → capabilities-kG175Q-7.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-B1x3TwdV.js → capabilities-page-D1wQ2sPI.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BW5jQz5R.js +8 -0
- package/dist/gateway/static/root/assets/{channels-8Y08v4Q2.js → channels-BzZp42yO.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-BRQDNNI5.js → chat-agents-api-UOdNWZ0_.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-qMGhfeQZ.js → chat-chart-block-NSy-B0NS.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-CSTyfO9c.js → chat-page-dY6aCCRx.js} +4 -4
- package/dist/gateway/static/root/assets/{chat-terminal-dock-0PJ9dURQ.js → chat-terminal-dock-CAaHWS7F.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-C4U_-rDo.js → command-palette-api-Dkn9bbYd.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-model-config-control-B9Q40ptH.js → composer-model-config-control-BrK8-SNz.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-notifications-ByuA8h5Z.js → composer-notifications-B-kL3qAA.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-zr1JDn3p.js → composer-payload-handoff-DBE1mvOS.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-D2F1quZR.js → computer-settings-page-C9KdEecx.js} +1 -1
- package/dist/gateway/static/root/assets/connected-providers-grid-D_8v6Qex.js +1 -0
- package/dist/gateway/static/root/assets/{connection-usage-guide-DkDsHm_l.js → connection-usage-guide-CiVpcbds.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-1AcvESmp.js → connector-service-page-B919cKSm.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-C1OML7OO.js → connectors-api-CgsSm-Av.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-CMIY0Zj_.js → connectors-page-CEpfDCLA.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-D1eFhoMI.js → date-picker-dx284jQI.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-CqplKVk6.js → date-time-picker-Dj-bhLNP.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-UmrjWSq-.js → desktop-pet-DlTuGzZ2.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-narrative-B7I1II0Z.js → desktop-pet-narrative-cBFIPXzR.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DRRDJMu6.js → desktop-pet-settings-CsmrvoxU.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-CtKJMK52.js → dev-view-store-BOxbj1ie.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-C4aSCbqo.js → device-pairing-wizard-CAqFIFRC.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-D9U9yfnb.js → directory-picker-path-field-BxEw5OrT.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-D-eGt1_L.js → discussion-annotation-sync-CyntTwIa.js} +1 -1
- package/dist/gateway/static/root/assets/extension-authoritative-grants-C0ReZguU.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BTLcC8-r.js → extension-debug-page-Cd3HMUbi.js} +1 -1
- package/dist/gateway/static/root/assets/extension-iframe-host-DiIqM2JO.js +1 -0
- package/dist/gateway/static/root/assets/{extension-marketplace-api-DLRCNlej.js → extension-marketplace-api-CK5CMKTs.js} +1 -1
- package/dist/gateway/static/root/assets/extension-message-router-Dn8JzOdR.js +8 -0
- package/dist/gateway/static/root/assets/{extension-page-CdpI-Plq.js → extension-page-CLZtAtqm.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-DUDaMvQg.js → extension-provider-CbVokTvd.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-biWCnMGr.js → extension-settings-page-BM79cwUy.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-CnBRiQo8.js → file-preview-surface-z7_HV0WN.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BV5fpBSK.js → gateway-config-swr-OGhON-s6.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-CIqLQXlm.js → gateway-realtime-B9u4uSXW.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-xB7Bq4Zs.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-DBkfCzT5.js → gateway-restart-DKAweWmg.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DTzXUm9f.js → gateway-settings-Dc7qUbG-.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-B49N_Ngm.js → gateway-startup-retry-BaaoKBoB.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-DVpxe45P.js → global-defaults-api-BIr3ApRj.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-DvaxBrjG.js → home-page-i_PIrDCU.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-CAKYslID.js → image-generation-api-C7D2IetZ.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-C2KmQJ2H.js → imports-page-BjEdZJxZ.js} +1 -1
- package/dist/gateway/static/root/assets/index-Bj5exyow.css +1 -0
- package/dist/gateway/static/root/assets/{index-BpzvsoS1.js → index-CZI3VGGW.js} +5 -5
- package/dist/gateway/static/root/assets/{install-connector-dialog-CmNvZt8M.js → install-connector-dialog-BsiyYQhx.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-syG2KRr2.js → keyboard-shortcuts-settings-CIthQ1lp.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-DGA4EHGm.js → local-app-workbench-page-CSCIHvZV.js} +1 -1
- package/dist/gateway/static/root/assets/local-apps-DeqzkJiF.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-I0O2ybpp.js → local-apps-page-EntiM0tz.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-DsPDloiq.js → local-session-drafts-XurtjR58.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-D3c8DIm-.js → locale-store-cg9cm2EL.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-u9FTZaTh.js → logs-page-rmS9VSem.js} +1 -1
- package/dist/gateway/static/root/assets/{management-api-uxRxRX-6.js → management-api-B6jVuJ6W.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BCbDfM7f.js → management-settings-DdI9gs51.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-ohhExTMC.js → markdown-view-D1zBWkfB.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-382BGqQC.js → mcp-conversation-setup-page-Bn49Ph1n.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-B5wtLz3Z.js → media-plugins-Cd6hAGDp.js} +1 -1
- package/dist/gateway/static/root/assets/messages-eQ2CYlpG.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-CoKcq0AZ.js → model-selector-CL6WT-jw.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-CtooMAQW.js → models-hub-cache-s0FMNhq9.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-DiGQtSD0.js → note-detail-panel-anM38aV6.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-DfK2KSgu.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-Cvet94d8.js → notes-api-CR75RHd0.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-DwlmKweX.js → notes-page-BsZmT7Zw.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-BHp5dVNh.js → oauth-api-CvPnQTlH.js} +1 -1
- package/dist/gateway/static/root/assets/oauth-provider-connect-Dk1NeeqD.js +1 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-BwsK2uDe.js → page-context-capture-button-BPtX67hZ.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-ieK9IN3R.js → page-context-draft-Ckb8baxj.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-DU4NnGap.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-BZSC0BLP.js → personal-avatar-CZSnrSfc.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-CbiD8Wn7.js → personal-page-BSCNuRMT.js} +1 -1
- package/dist/gateway/static/root/assets/personal-profile-settings-DJRDcK2c.js +1 -0
- package/dist/gateway/static/root/assets/{personal-settings-panel-_cxSzWsN.js → personal-settings-panel-C6p25Noq.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-C2OWtG2B.js → phone-dependencies-card-DKkFFpqi.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-CqmafRhr.js → phone-model-connection-CRRHq4PQ.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-BwYQtl_5.js → phone-model-picker-CN_I0-46.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-CPteZZWu.js → phone-settings-page-CkdSOA7D.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-ReUEjG9m.js → phone-workspace-store-CC61pIuJ.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-BlNVtbEU.js → plugin-details-dialog-Bqz4jT53.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-BbA-g7Zq.js → preference-select-fields-DHeNbAvn.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-DcPY76PG.js → product-automation-feedback-BN2HTA9T.js} +1 -1
- package/dist/gateway/static/root/assets/{product-delivery-2Ks17_OH.js → product-delivery-BFfqdKLe.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BBJ7glAm.js → product-open-page-B-j4gpLD.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-UTOSc_ii.js → product-preview-content-EqrTk7kU.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-Q1RZqeMo.js → product-preview-modal-aurFBFq4.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-BlrtsEZK.js → project-detail-page-ibZZ_w51.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-B35f5MkG.js → project-understanding-HNK9lFVy.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-CBH-sHOU.js → projects-page-CugSyKl5.js} +1 -1
- package/dist/gateway/static/root/assets/providers-api-DUntOOqr.js +1 -0
- package/dist/gateway/static/root/assets/{recording-upload-P1WcsdEY.js → recording-upload-DIwP541B.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-DnVlwJ6M.js → registry-api-BTd_OgbD.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-CVEj3p0J.js → remote-access-hub-f5mIfsBF.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-B_S1dFze.js → resource-unavailable-DtQ2rfu_.js} +1 -1
- package/dist/gateway/static/root/assets/{route-preload-DGmrxJSb.js → route-preload-anuckzRl.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-970sp5zI.js → runtime-tools-api-C1iI8EPo.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-au6vZ0sL.js → runtime-tools-settings-panel-0tdI1z0g.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-XeRFtJ-Z.js → service-recommendation-list-DSIe-NRe.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CuT7EPI0.js → session-api-CQlEq0MB.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-CyZHiuWY.js → session-manager-C7RfUfqI.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-BIxDwAIX.js → sessions-page-DdS8U0RV.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DnfH22f_.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-nbkGHQ_4.js → settings-advanced-section-C6dPu5i1.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-EQHfksdV.js → settings-mode-store-BSiiowQa.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-D6RNHRHq.js → settings-page-DAc5n-mM.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-19GJ_a45.js → settings-page-header-BSMu5Zq3.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-B2WCzSel.js → settings-page-layout-B_vMffB1.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-C5i7y_pM.js → setup-interaction-page-DKXfFdNt.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-Cwp8YKdT.js → setup-status-panel-BbAZ9w77.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-DDsVTMZ-.js → share-link-dialog-ztX1WPXG.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-C1S_gWGf.js → share-preview-page-Ds2Ydfg6.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-CepTFl1f.js → shares-api-CSZqeNL4.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Cv-tdcAN.js → shares-settings-CX3TNAmI.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-CsT-iHnl.js → skill-api-CGzAQ-MX.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-CMJTjvSo.js → skill-list-api-DfUsku-x.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-S6B7P9ur.js → skill-reload-api-Y9qSMnBd.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-BKcsJtYx.js → skills-page-DnMN50Ot.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DhHPM5qU.js → system-settings-panel-DWNkQmme.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-BHH2_Z9_.js → task-detail-page-BJok6V1K.js} +1 -1
- package/dist/gateway/static/root/assets/{task-input-card-D_2rNF31.js → task-input-card-lCMSy6YY.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-CcUWpqvC.js → terminal-panel-store-D8eZPvql.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-D9pquJiM.js → theme-store-GZQ3pTgy.js} +1 -1
- package/dist/gateway/static/root/assets/tool-friendly-title-DC8_9-Lo.js +2 -0
- package/dist/gateway/static/root/assets/{tracing-settings-page-CjNrKILr.js → tracing-settings-page-DM3-7Hlw.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-GtLO40pc.js → tunnel-api-DOGAIXRR.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-BhB5wAbq.js → understanding-activity-store-CuPfe0eQ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-BxtpXRfV.js → understanding-refresh-store-Ihz2p9Vg.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-CZa_a6_7.js → usage-page-BA9Yrvqu.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BtOp6W9H.js → use-autosave-CO0IPCVg.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-BTQZx8Nj.js → use-composer-attachments-CLIrD0mm.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-B7nscYS4.js → use-file-preview-expanded-dhNMHf5b.js} +3 -3
- package/dist/gateway/static/root/assets/{use-personal-profile-Cj7WGOfv.js → use-personal-profile-CVqDWBDS.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-BS1rygyV.js → use-realtime-voice-DDVVlX1R.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-DYosm4Gz.js → use-workspace-tree-CZej8mhf.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-DmmJODQ4.js → user-model-page-1eYattnk.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-8voN8dQG.js → voice-api-key-field-DpwUDAvu.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-CrZd2aqw.js → voice-config-api-GIuXoHXw.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-DcFp_fy4.js → voice-input-shortcut-events-Cc30ZcFy.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-AckvhNnP.js → voice-settings-DA3m5MT0.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DAIk5csp.js → work-discovery-overlay-yGUkk1NV.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-CJeixeWQ.js → work-discovery-page-RN6iuY-0.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-BW76VaD5.js → working-directory-picker-modal-CeXl9w6z.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-Cu2gzmVn.js → workspace-api-B1Uirhxf.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-Nos5ebMv.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-DyqI793w.js → workspace-file-preview-dialog-D0h2yJ3v.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-DTYkApy8.js → workspace-open-location-menu-DWGNOIE2.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Rytp_NWV.js → xopc-cloud-account-card-x-XT4bKF.js} +1 -1
- package/dist/gateway/static/root/index.html +91 -91
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/extension-capabilities.js +69 -4
- package/dist/packages/gateway-contract/src/local-app-delegation.js +4 -1
- package/dist/src/agent/agent-manager.js +1 -1
- package/dist/src/agent/child-agent-factory.js +24 -1
- package/dist/src/agent/commands/command-registry.d.ts +10 -0
- package/dist/src/agent/commands/command-registry.js +37 -16
- package/dist/src/agent/commands/command-transport.d.ts +19 -0
- package/dist/src/agent/commands/command-transport.js +92 -0
- package/dist/src/agent/context/project-context.js +1 -1
- package/dist/src/agent/embedded/execution-tool-policy.d.ts +1 -0
- package/dist/src/agent/embedded/execution-tool-policy.js +16 -5
- package/dist/src/agent/embedded/index.js +1 -1
- package/dist/src/agent/embedded/run-turn.js +74 -14
- package/dist/src/agent/embedded/runs.d.ts +2 -0
- package/dist/src/agent/embedded/runs.js +8 -1
- package/dist/src/agent/embedded/session-runner.js +2 -2
- package/dist/src/agent/external-tools/endpoint-provider.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
- package/dist/src/agent/orchestration/child-run-monitor.d.ts +35 -0
- package/dist/src/agent/orchestration/child-run-monitor.js +104 -0
- package/dist/src/agent/orchestration/child-run-resume.d.ts +3 -0
- package/dist/src/agent/orchestration/child-run-resume.js +67 -0
- package/dist/src/agent/sandbox/native-command.d.ts +15 -0
- package/dist/src/agent/sandbox/native-command.js +65 -0
- package/dist/src/agent/service/btw-query.d.ts +1 -0
- package/dist/src/agent/service/btw-query.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +2 -2
- package/dist/src/agent/service/process-direct-streaming.js +2 -2
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/interaction-policy.d.ts +21 -0
- package/dist/src/agent/session/interaction-policy.js +58 -0
- package/dist/src/agent/session/session-inspector.js +3 -2
- package/dist/src/agent/tools/create-share-tool.js +1 -1
- package/dist/src/agent/tools/exec-command.js +5 -0
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/index.js +1 -1
- package/dist/src/agent/tools/list-dir.js +1 -1
- package/dist/src/agent/tools/managed-job-tool.js +16 -1
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/publish-artifacts.js +1 -1
- package/dist/src/agent/tools/read.js +1 -1
- package/dist/src/agent/tools/send-media.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +4 -4
- package/dist/src/automations/capabilities/drafts.js +5 -1
- package/dist/src/automations/capabilities/read.js +58 -8
- package/dist/src/automations/capabilities/write.js +53 -0
- package/dist/src/automations/delivery/delivery-router.js +3 -1
- package/dist/src/automations/run-changes.d.ts +2 -0
- package/dist/src/automations/run-changes.js +18 -0
- package/dist/src/automations/service/automation-service.d.ts +2 -9
- package/dist/src/automations/service/automation-service.js +3 -2
- package/dist/src/automations/storage/automation-run-repository.d.ts +5 -0
- package/dist/src/automations/storage/automation-run-repository.js +15 -1
- package/dist/src/capabilities/runtime/dispatcher.d.ts +1 -0
- package/dist/src/capabilities/runtime/product.d.ts +2 -0
- package/dist/src/capabilities/runtime/product.js +26 -6
- package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
- package/dist/src/chat-commands/types.d.ts +2 -0
- package/dist/src/cli/commands/tui-runner.d.ts +1 -1
- package/dist/src/cli/commands/tui-runner.js +1 -0
- package/dist/src/cli/commands/tui.js +1 -1
- package/dist/src/config/schema.d.ts +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +107 -10
- package/dist/src/gateway/hono/routes/imports.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +2 -2
- package/dist/src/gateway/hono/routes/local-app-capabilities.js +12 -2
- package/dist/src/gateway/hono/routes/local-app-run-streams.d.ts +4 -0
- package/dist/src/gateway/hono/routes/local-app-run-streams.js +105 -0
- package/dist/src/gateway/hono/routes/sessions.js +2 -2
- package/dist/src/gateway/hono/routes/shares.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +2 -2
- package/dist/src/gateway/hono/routes/tui.js +308 -0
- package/dist/src/gateway/media-access.js +1 -1
- package/dist/src/gateway/security/gateway-scopes.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +1 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +1 -1
- package/dist/src/gateway/service/sessions-api.d.ts +1 -1
- package/dist/src/gateway/service/sessions-api.js +3 -3
- package/dist/src/gateway/service.js +8 -8
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/infra/execution-authority.d.ts +12 -0
- package/dist/src/infra/execution-authority.js +27 -0
- package/dist/src/local-apps/automation-proposals.d.ts +754 -0
- package/dist/src/local-apps/automation-proposals.js +185 -0
- package/dist/src/local-apps/capabilities/automation-policy.d.ts +7 -0
- package/dist/src/local-apps/capabilities/automation-policy.js +46 -0
- package/dist/src/local-apps/capabilities/contracts.js +23 -0
- package/dist/src/local-apps/capabilities/delegate.js +21 -4
- package/dist/src/local-apps/capabilities/projections.d.ts +588 -0
- package/dist/src/local-apps/capabilities/projections.js +135 -2
- package/dist/src/local-apps/capabilities/resource-policy.js +76 -0
- package/dist/src/local-apps/capabilities/runtime.js +2 -1
- package/dist/src/local-apps/execution-authority.d.ts +13 -0
- package/dist/src/local-apps/execution-authority.js +104 -0
- package/dist/src/local-apps/p1-services.d.ts +189 -0
- package/dist/src/local-apps/p1-services.js +620 -0
- package/dist/src/local-apps/preview-sessions.d.ts +1 -1
- package/dist/src/local-apps/preview-sessions.js +2 -2
- package/dist/src/local-apps/preview-worker.js +11 -2
- package/dist/src/local-apps/service.d.ts +81 -1
- package/dist/src/local-apps/service.js +18 -1
- package/dist/src/local-apps/store.js +1 -1
- package/dist/src/notes/agent-context.js +1 -1
- package/dist/src/personal-agent/request-service.js +1 -1
- package/dist/src/personal-agent/task-cancel.js +1 -1
- package/dist/src/platform/contracts.d.ts +3 -3
- package/dist/src/projects/capabilities/read.js +43 -2
- package/dist/src/projects/capabilities/write.js +25 -0
- package/dist/src/projects/project-store.js +12 -1
- package/dist/src/projects/types.d.ts +1 -0
- package/dist/src/review/review-git.js +14 -1
- package/dist/src/share/share-store.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/resource-scope.js +2 -2
- package/dist/src/tasks/capabilities/management.js +3 -0
- package/dist/src/tasks/capabilities/write.js +11 -2
- package/dist/src/tasks/index.js +1 -1
- package/dist/src/tui/backend-services.d.ts +14 -0
- package/dist/src/tui/backend-services.js +67 -0
- package/dist/src/tui/backends/embedded-backend.d.ts +48 -4
- package/dist/src/tui/backends/embedded-backend.js +248 -42
- package/dist/src/tui/backends/gateway-realtime-backend.d.ts +46 -2
- package/dist/src/tui/backends/gateway-realtime-backend.js +205 -62
- package/dist/src/tui/components/chat-log.d.ts +1 -0
- package/dist/src/tui/components/chat-log.js +11 -5
- package/dist/src/tui/components/scoped-models-selector.js +1 -1
- package/dist/src/tui/components/session-selector.js +1 -1
- package/dist/src/tui/components/text-viewer.d.ts +32 -0
- package/dist/src/tui/components/text-viewer.js +132 -0
- package/dist/src/tui/components/tui-bottom-bar.js +3 -0
- package/dist/src/tui/extension-host/autocomplete.js +9 -1
- package/dist/src/tui/extension-host/runtime.d.ts +1 -0
- package/dist/src/tui/extension-host/runtime.js +1 -0
- package/dist/src/tui/tui-backend.d.ts +36 -3
- package/dist/src/tui/tui-capabilities.d.ts +15 -0
- package/dist/src/tui/tui-capabilities.js +46 -0
- package/dist/src/tui/tui-capability-controls.d.ts +9 -0
- package/dist/src/tui/tui-capability-controls.js +250 -0
- package/dist/src/tui/tui-clarification.d.ts +15 -0
- package/dist/src/tui/tui-clarification.js +91 -0
- package/dist/src/tui/tui-command-formatters.d.ts +0 -4
- package/dist/src/tui/tui-command-formatters.js +3 -43
- package/dist/src/tui/tui-commands.d.ts +4 -4
- package/dist/src/tui/tui-commands.js +219 -127
- package/dist/src/tui/tui-control-commands.d.ts +12 -0
- package/dist/src/tui/tui-control-commands.js +127 -0
- package/dist/src/tui/tui-image-files.d.ts +2 -0
- package/dist/src/tui/tui-image-files.js +47 -0
- package/dist/src/tui/tui-local-shell.d.ts +6 -0
- package/dist/src/tui/tui-local-shell.js +36 -2
- package/dist/src/tui/tui-management.d.ts +114 -0
- package/dist/src/tui/tui-management.js +233 -0
- package/dist/src/tui/tui-picker-overlay.d.ts +1 -6
- package/dist/src/tui/tui-picker-overlay.js +1 -62
- package/dist/src/tui/tui-session-actions.d.ts +1 -0
- package/dist/src/tui/tui-session-actions.js +97 -29
- package/dist/src/tui/tui-settings.js +1 -1
- package/dist/src/tui/tui-side-chat.d.ts +10 -0
- package/dist/src/tui/tui-side-chat.js +56 -0
- package/dist/src/tui/tui-terminal.d.ts +3 -0
- package/dist/src/tui/tui-terminal.js +52 -0
- package/dist/src/tui/tui-types.d.ts +4 -1
- package/dist/src/tui/tui.js +422 -211
- package/dist/src/tui/xopc-tui-keybindings.d.ts +29 -9
- package/dist/src/tui/xopc-tui-keybindings.js +27 -7
- package/dist/src/usage/recorder.js +2 -0
- package/package.json +2 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CZ78ckHR.js +0 -8
- package/dist/gateway/static/root/assets/connected-providers-grid-CgULhOBZ.js +0 -1
- package/dist/gateway/static/root/assets/extension-authoritative-grants-8ONVOjPW.js +0 -1
- package/dist/gateway/static/root/assets/extension-iframe-host-D0-OvFV2.js +0 -1
- package/dist/gateway/static/root/assets/extension-message-router-DboLTCVp.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-B6T1Xzag.js +0 -1
- package/dist/gateway/static/root/assets/index-B49yIcMR.css +0 -1
- package/dist/gateway/static/root/assets/local-apps-CB-MZAaL.js +0 -1
- package/dist/gateway/static/root/assets/messages-DPLud9GK.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-Ds4M9fJJ.js +0 -1
- package/dist/gateway/static/root/assets/oauth-provider-connect-cvxtmf3C.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-Xe8CP_4a.js +0 -1
- package/dist/gateway/static/root/assets/personal-profile-settings-KvdNnaNv.js +0 -1
- package/dist/gateway/static/root/assets/providers-api-BSmKlQ8K.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cy7xeKmH.js +0 -1
- package/dist/gateway/static/root/assets/tool-friendly-title-YQmN1S2k.js +0 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-pVOYuH7u.js +0 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { searchSessionTranscript } from "../storage/sqlite/transcript-repository.js";
|
|
3
|
+
import { commandRegistry } from "../agent/commands/command-registry.js";
|
|
4
|
+
import { getSessionInteractionPolicy } from "../agent/session/interaction-policy.js";
|
|
5
|
+
import { buildReviewDiffBundle, resolveGitRoot } from "../review/review-git.js";
|
|
6
|
+
//#region src/tui/backend-services.ts
|
|
7
|
+
init_transaction();
|
|
8
|
+
function projectJob(job) {
|
|
9
|
+
return {
|
|
10
|
+
id: job.id,
|
|
11
|
+
command: job.command,
|
|
12
|
+
cwd: job.cwd,
|
|
13
|
+
status: job.status,
|
|
14
|
+
tty: job.tty,
|
|
15
|
+
cols: job.cols,
|
|
16
|
+
rows: job.rows,
|
|
17
|
+
outputLength: job.outputLength,
|
|
18
|
+
exitCode: job.exitCode,
|
|
19
|
+
durationMs: job.durationMs,
|
|
20
|
+
aggregatedOutput: job.aggregatedOutput.slice(-8e3)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function listTuiJobs(conversationId) {
|
|
24
|
+
return commandRegistry().list(conversationId).map(projectJob);
|
|
25
|
+
}
|
|
26
|
+
function getTuiJob(conversationId, id) {
|
|
27
|
+
const job = commandRegistry().get(conversationId, id);
|
|
28
|
+
if (!job) throw new Error("Background job not found in this conversation.");
|
|
29
|
+
return projectJob(job);
|
|
30
|
+
}
|
|
31
|
+
async function stopTuiJob(conversationId, id) {
|
|
32
|
+
if (!await commandRegistry().cancel(conversationId, id)) throw new Error("Background job not found in this conversation.");
|
|
33
|
+
}
|
|
34
|
+
function writeTuiJob(conversationId, id, text) {
|
|
35
|
+
const policy = getSessionInteractionPolicy(conversationId);
|
|
36
|
+
if ((policy.mode === "plan" || policy.access === "read-only") && commandRegistry().get(conversationId, id)?.sandbox !== "read-only") throw new Error("Process input requires a job started inside the read-only OS sandbox.");
|
|
37
|
+
if (!commandRegistry().write(conversationId, id, text)) throw new Error("Background job is unavailable or its input is closed.");
|
|
38
|
+
}
|
|
39
|
+
async function getTuiWorkspaceDiff(workspace) {
|
|
40
|
+
const bundle = await buildReviewDiffBundle(await resolveGitRoot(workspace), { kind: "uncommitted" });
|
|
41
|
+
if (!bundle.diff) return "Working tree is clean.";
|
|
42
|
+
return bundle.diff.length > 1e6 ? `${bundle.diff.slice(0, 1e6)}\n[Diff preview truncated; inspect the full working tree with Git.]` : bundle.diff;
|
|
43
|
+
}
|
|
44
|
+
function resizeTuiJob(conversationId, id, cols, rows) {
|
|
45
|
+
if (!commandRegistry().resize(conversationId, id, cols, rows)) throw new Error("Terminal job is unavailable in this conversation.");
|
|
46
|
+
}
|
|
47
|
+
function searchTuiHistory(conversationId, query) {
|
|
48
|
+
if (!query.trim() || query.length > 1e3) throw new Error("Search needs 1–1000 characters.");
|
|
49
|
+
const matches = searchSessionTranscript(conversationId, query, {
|
|
50
|
+
limit: 20,
|
|
51
|
+
matchMode: "phrase"
|
|
52
|
+
});
|
|
53
|
+
if (!matches.length) return [];
|
|
54
|
+
const rows = getSqliteDatabase().prepare(`WITH ordered AS (
|
|
55
|
+
SELECT e.entry_id, ROW_NUMBER() OVER (ORDER BY t.created_at, t.rowid, e.seq) AS rowNumber
|
|
56
|
+
FROM transcript_entries e JOIN transcripts t ON t.transcript_id = e.transcript_id
|
|
57
|
+
WHERE t.conversation_id = ? AND (t.status = 'active' OR t.archive_reason IN ('reset', 'stale'))
|
|
58
|
+
) SELECT entry_id, rowNumber FROM ordered WHERE entry_id IN (${matches.map(() => "?").join(",")})`).all(conversationId, ...matches.map((match) => match.entryId));
|
|
59
|
+
const positions = new Map(rows.map((row) => [row.entry_id, row.rowNumber]));
|
|
60
|
+
return matches.filter((match) => positions.has(match.entryId)).map((match) => ({
|
|
61
|
+
rowNumber: positions.get(match.entryId),
|
|
62
|
+
role: match.role ?? "context",
|
|
63
|
+
preview: match.content.slice(0, 400)
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
export { getTuiJob, getTuiWorkspaceDiff, listTuiJobs, resizeTuiJob, searchTuiHistory, stopTuiJob, writeTuiJob };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { type ClarificationResponseCommand } from '@xopcai/gateway-contract';
|
|
2
|
+
import { type TuiManagementCommand } from '../tui-management.js';
|
|
3
|
+
import { type TuiCapabilityKind } from '../tui-capabilities.js';
|
|
4
|
+
import type { TuiClarification } from '../tui-clarification.js';
|
|
5
|
+
import { type SessionInteractionPolicy } from '../../agent/session/interaction-policy.js';
|
|
1
6
|
import type { ExtensionRegistryImpl } from '../../extensions/extension-registry-impl.js';
|
|
2
7
|
import { type SessionTimelineItem } from '../../session/transcript-outline.js';
|
|
3
8
|
import { type Config } from '../../config/schema.js';
|
|
4
|
-
import type
|
|
9
|
+
import { type ExportFormat } from '../../session/types.js';
|
|
5
10
|
import type { ChatSendOptions, HistoryMessage, TuiBackend, TuiCompactionResult, TuiComposerHistoryItem, TuiEvent, TuiModelChoice, TuiShareRequest, TuiShareResult, TuiSessionStats, TuiSessionItem, TuiTranscriptTreeEntry, TuiAgentInfo, TuiWorkspaceFileSearchEntry, TuiStartupProjectResult, TuiChatInputState } from '../tui-backend.js';
|
|
6
11
|
import type { SessionInfo } from '../tui-types.js';
|
|
7
12
|
interface EmbeddedBackendOptions {
|
|
@@ -26,6 +31,8 @@ export declare class EmbeddedBackend implements TuiBackend {
|
|
|
26
31
|
private sessionIndex;
|
|
27
32
|
private sessionIndexReady;
|
|
28
33
|
private running;
|
|
34
|
+
private readonly visitedConversations;
|
|
35
|
+
private readonly clarificationWaits;
|
|
29
36
|
private chatAbort;
|
|
30
37
|
private readonly chatInputStates;
|
|
31
38
|
private readonly drafts;
|
|
@@ -42,7 +49,7 @@ export declare class EmbeddedBackend implements TuiBackend {
|
|
|
42
49
|
private ensureAgent;
|
|
43
50
|
private createAgent;
|
|
44
51
|
private refreshXopcCloudModels;
|
|
45
|
-
stop(): void
|
|
52
|
+
stop(): Promise<void>;
|
|
46
53
|
getActiveSignal(): AbortSignal | undefined;
|
|
47
54
|
private activeConfig;
|
|
48
55
|
private isWorkspaceTrusted;
|
|
@@ -119,7 +126,39 @@ export declare class EmbeddedBackend implements TuiBackend {
|
|
|
119
126
|
loadTranscriptTree(conversationId: string): Promise<TuiTranscriptTreeEntry[]>;
|
|
120
127
|
loadTimeline(conversationId: string): Promise<SessionTimelineItem[]>;
|
|
121
128
|
getSessionStats(conversationId: string): Promise<TuiSessionStats>;
|
|
122
|
-
|
|
129
|
+
private askClarification;
|
|
130
|
+
getClarification(conversationId: string): Promise<TuiClarification | null>;
|
|
131
|
+
submitClarification(conversationId: string, id: string, command: ClarificationResponseCommand): Promise<void>;
|
|
132
|
+
manageCapability(conversationId: string, command: TuiManagementCommand): Promise<unknown>;
|
|
133
|
+
listCapabilities(conversationId: string, kind: TuiCapabilityKind): Promise<import("../tui-capabilities.js").TuiCapability[]>;
|
|
134
|
+
listSubagents(conversationId: string): Promise<import("../../agent/orchestration/child-run-monitor.js").ChildRunView[]>;
|
|
135
|
+
getSubagent(conversationId: string, id: string): Promise<import("../../agent/orchestration/child-run-monitor.js").ChildRunView>;
|
|
136
|
+
steerSubagent(conversationId: string, id: string, text: string): Promise<void>;
|
|
137
|
+
resumeSubagent(conversationId: string, id: string, text: string): Promise<void>;
|
|
138
|
+
getSubagentTranscript(conversationId: string, id: string): Promise<string>;
|
|
139
|
+
stopSubagent(conversationId: string, id: string): Promise<void>;
|
|
140
|
+
getInteractionPolicy(conversationId: string): Promise<{
|
|
141
|
+
mode: "default" | "plan";
|
|
142
|
+
access: "read-only" | "configured";
|
|
143
|
+
sandbox?: "workspace-write" | "unrestricted";
|
|
144
|
+
network?: boolean;
|
|
145
|
+
}>;
|
|
146
|
+
setInteractionPolicy(conversationId: string, policy: SessionInteractionPolicy): Promise<{
|
|
147
|
+
mode: "default" | "plan";
|
|
148
|
+
access: "read-only" | "configured";
|
|
149
|
+
sandbox?: "workspace-write" | "unrestricted";
|
|
150
|
+
network?: boolean;
|
|
151
|
+
}>;
|
|
152
|
+
getWorkspaceDiff(conversationId: string): Promise<string>;
|
|
153
|
+
searchHistory(conversationId: string, query: string): Promise<import("../backend-services.js").TuiHistoryMatch[]>;
|
|
154
|
+
listJobs(conversationId: string): Promise<import("../backend-services.js").TuiJob[]>;
|
|
155
|
+
getJob(conversationId: string, id: string): Promise<import("../backend-services.js").TuiJob>;
|
|
156
|
+
resizeJob(conversationId: string, id: string, cols: number, rows: number): Promise<void>;
|
|
157
|
+
stopJob(conversationId: string, id: string): Promise<void>;
|
|
158
|
+
writeJob(conversationId: string, id: string, text: string): Promise<void>;
|
|
159
|
+
listSessions(options?: {
|
|
160
|
+
archived?: boolean;
|
|
161
|
+
}): Promise<TuiSessionItem[]>;
|
|
123
162
|
listAgents(): Promise<TuiAgentInfo[]>;
|
|
124
163
|
setTuiDefaultAgent(agentId: string): Promise<{
|
|
125
164
|
agentId: string;
|
|
@@ -127,6 +166,8 @@ export declare class EmbeddedBackend implements TuiBackend {
|
|
|
127
166
|
renameSession(conversationId: string, name: string): Promise<{
|
|
128
167
|
ok: boolean;
|
|
129
168
|
}>;
|
|
169
|
+
restoreSession(conversationId: string): Promise<void>;
|
|
170
|
+
archiveSession(conversationId: string): Promise<void>;
|
|
130
171
|
deleteSession(conversationId: string): Promise<{
|
|
131
172
|
ok: boolean;
|
|
132
173
|
}>;
|
|
@@ -149,7 +190,10 @@ export declare class EmbeddedBackend implements TuiBackend {
|
|
|
149
190
|
createShare(_conversationId: string, request: TuiShareRequest, _options?: {
|
|
150
191
|
agentId?: string;
|
|
151
192
|
}): Promise<TuiShareResult>;
|
|
152
|
-
|
|
193
|
+
sideQuery(conversationId: string, question: string, options?: {
|
|
194
|
+
signal?: AbortSignal;
|
|
195
|
+
onDelta?: (text: string) => void;
|
|
196
|
+
}): Promise<{
|
|
153
197
|
text: string;
|
|
154
198
|
error?: string;
|
|
155
199
|
}>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { resolveStateDir } from "../../config/paths-state.js";
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
|
-
import { openXopcDatabase } from "../../storage/sqlite/connection.js";
|
|
4
|
+
import { isXopcDatabaseOpen, openXopcDatabase } from "../../storage/sqlite/connection.js";
|
|
5
5
|
import { canonicalSessionCommand, sessionInputCommandSchema } from "../../../packages/gateway-contract/src/session-input-command.js";
|
|
6
|
+
import { normalizeClarificationSubmission } from "../../../packages/gateway-contract/src/clarifications.js";
|
|
6
7
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
7
8
|
import { cancelQueuedSessionInput, claimNextSessionInput, finishSessionInputRun, getSessionInputById, getSessionInputState, init_session_input_repository, setSessionInputStatus } from "../../storage/sqlite/session-input-repository.js";
|
|
9
|
+
import "../../session/types.js";
|
|
8
10
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
9
11
|
import { appendComposerInputHistory, listComposerInputHistory } from "../../storage/sqlite/composer-input-history-repository.js";
|
|
12
|
+
import { getSessionConfig } from "../../storage/sqlite/config-repository.js";
|
|
10
13
|
import "../../storage/sqlite/index.js";
|
|
11
14
|
import { normalizeAgentId } from "../../agent-catalog/id.js";
|
|
12
15
|
import { init_agent_scope, listAgentEntries } from "../../agent/agent-scope.js";
|
|
@@ -15,6 +18,9 @@ import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
|
15
18
|
import { resolveEffectiveAgentProfile } from "../../config/agent-profile.js";
|
|
16
19
|
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
17
20
|
import { effectiveWorkspacePathForSession } from "../../session/session-workspace.js";
|
|
21
|
+
import { commandRegistry } from "../../agent/commands/command-registry.js";
|
|
22
|
+
import { getChildRun, getChildRunMessages, listChildRuns, steerChildRun, stopChildRun } from "../../agent/orchestration/child-run-monitor.js";
|
|
23
|
+
import { getSessionInteractionPolicy, setSessionInteractionPolicy } from "../../agent/session/interaction-policy.js";
|
|
18
24
|
import { ProjectService } from "../../projects/project-service.js";
|
|
19
25
|
import { inferSuggestedProjectDefaultAgentId } from "../../projects/project-agent-suggestion.js";
|
|
20
26
|
import "../../projects/index.js";
|
|
@@ -36,12 +42,16 @@ import { ChatStreamMapper } from "../../gateway/chat-stream/mapper.js";
|
|
|
36
42
|
import { getXopcCloudCatalogCoordinator } from "../../providers/xopc-cloud-catalog-coordinator.js";
|
|
37
43
|
import { acceptSessionCommand } from "../../storage/sqlite/session-creation-repository.js";
|
|
38
44
|
import { fuzzySearchWorkspaceFiles } from "../../gateway/workspace-file-search.js";
|
|
45
|
+
import { getTuiJob, getTuiWorkspaceDiff, listTuiJobs, resizeTuiJob, searchTuiHistory, stopTuiJob, writeTuiJob } from "../backend-services.js";
|
|
39
46
|
import { commitDeliveredChatInput } from "../tui-chat-input-state.js";
|
|
47
|
+
import { listTuiCapabilities } from "../tui-capabilities.js";
|
|
40
48
|
import { sessionMetadataToTuiItem } from "../tui-session-format.js";
|
|
41
49
|
import { buildTuiTranscriptTree, transcriptTreeEntryIdToRowNumber } from "../tui-transcript-tree.js";
|
|
50
|
+
import { manageTuiCapability } from "../tui-management.js";
|
|
42
51
|
import { computeTuiSessionStats } from "../tui-session-stats.js";
|
|
43
52
|
import { collectTuiStartupResources } from "../tui-startup-resources.js";
|
|
44
53
|
import { EmbeddedDraftStore } from "./embedded-drafts.js";
|
|
54
|
+
import { resumeChildRun } from "../../agent/orchestration/child-run-resume.js";
|
|
45
55
|
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
46
56
|
//#region src/tui/backends/embedded-backend.ts
|
|
47
57
|
init_src();
|
|
@@ -54,7 +64,7 @@ const log = createLogger("TUI:Embedded");
|
|
|
54
64
|
function clampHistoryWindowSpan(value, fallback) {
|
|
55
65
|
const parsed = Math.trunc(value ?? fallback);
|
|
56
66
|
if (!Number.isFinite(parsed)) return fallback;
|
|
57
|
-
return Math.min(
|
|
67
|
+
return Math.min(2e3, Math.max(0, parsed));
|
|
58
68
|
}
|
|
59
69
|
function isPathSameOrInside(parentDir, childDir) {
|
|
60
70
|
const rel = relative(resolve(parentDir), resolve(childDir));
|
|
@@ -83,6 +93,8 @@ var EmbeddedBackend = class {
|
|
|
83
93
|
sessionIndex = null;
|
|
84
94
|
sessionIndexReady = null;
|
|
85
95
|
running = false;
|
|
96
|
+
visitedConversations = /* @__PURE__ */ new Set();
|
|
97
|
+
clarificationWaits = /* @__PURE__ */ new Map();
|
|
86
98
|
chatAbort = null;
|
|
87
99
|
chatInputStates = /* @__PURE__ */ new Map();
|
|
88
100
|
drafts = new EmbeddedDraftStore();
|
|
@@ -161,6 +173,7 @@ var EmbeddedBackend = class {
|
|
|
161
173
|
config,
|
|
162
174
|
sessionStore: sessionIndex.getStore(),
|
|
163
175
|
extensionRegistry: this.opts?.extensionRegistry,
|
|
176
|
+
gatewayClarify: { requestClarification: (context, request) => this.askClarification(context.conversationId, context.runId, request) },
|
|
164
177
|
isWorkspaceTrusted: (workspaceDir) => this.isWorkspaceTrusted(workspaceDir)
|
|
165
178
|
});
|
|
166
179
|
this.agent = agent;
|
|
@@ -188,12 +201,23 @@ var EmbeddedBackend = class {
|
|
|
188
201
|
}, `XOPC Cloud model catalog refresh failed: ${errorMessage}`);
|
|
189
202
|
}
|
|
190
203
|
}
|
|
191
|
-
stop() {
|
|
204
|
+
async stop() {
|
|
192
205
|
this.running = false;
|
|
206
|
+
for (const wait of this.clarificationWaits.values()) {
|
|
207
|
+
wait.dispose();
|
|
208
|
+
wait.reject(/* @__PURE__ */ new Error("TUI stopped"));
|
|
209
|
+
}
|
|
210
|
+
this.clarificationWaits.clear();
|
|
193
211
|
this.chatAbort?.abort();
|
|
194
212
|
this.chatAbort = null;
|
|
195
213
|
this.bus.shutdown();
|
|
196
|
-
|
|
214
|
+
const jobs = [];
|
|
215
|
+
for (const conversationId of this.visitedConversations) {
|
|
216
|
+
for (const child of listChildRuns(conversationId)) if (child.status === "running") stopChildRun(conversationId, child.id);
|
|
217
|
+
for (const job of isXopcDatabaseOpen() ? commandRegistry().list(conversationId) : []) if (job.status === "running") jobs.push(commandRegistry().cancel(conversationId, job.id));
|
|
218
|
+
}
|
|
219
|
+
await Promise.allSettled(jobs);
|
|
220
|
+
await this.agent?.stop();
|
|
197
221
|
this.agent = null;
|
|
198
222
|
}
|
|
199
223
|
getActiveSignal() {
|
|
@@ -623,27 +647,26 @@ var EmbeddedBackend = class {
|
|
|
623
647
|
async loadHistory(opts) {
|
|
624
648
|
const draft = this.drafts.read(opts.conversationId);
|
|
625
649
|
if (draft && (!draft.command || !getSessionMetadata(opts.conversationId))) return { messages: [] };
|
|
626
|
-
|
|
650
|
+
await this.sessionIndexReady;
|
|
651
|
+
const store = this.agent?.sessionStore ?? this.sessionIndex?.getStore();
|
|
652
|
+
if (!store) throw new Error("Session store is unavailable.");
|
|
627
653
|
try {
|
|
628
|
-
return { messages: transcriptRowsToClientHistory(await
|
|
654
|
+
return { messages: transcriptRowsToClientHistory(await store.loadTranscriptRows(opts.conversationId), { limit: opts.limit }) };
|
|
629
655
|
} catch (error) {
|
|
630
656
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
631
657
|
log.warn({
|
|
632
658
|
err: error,
|
|
633
659
|
errorMessage
|
|
634
660
|
}, `Embedded loadHistory failed: ${errorMessage}`);
|
|
635
|
-
|
|
661
|
+
throw error;
|
|
636
662
|
}
|
|
637
663
|
}
|
|
638
664
|
async loadHistoryWindow(opts) {
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
endRowNumber: 0,
|
|
643
|
-
totalRows: 0
|
|
644
|
-
};
|
|
665
|
+
await this.sessionIndexReady;
|
|
666
|
+
const store = this.agent?.sessionStore ?? this.sessionIndex?.getStore();
|
|
667
|
+
if (!store) throw new Error("Session store is unavailable.");
|
|
645
668
|
try {
|
|
646
|
-
const rows = await
|
|
669
|
+
const rows = await store.loadTranscriptHistoryRows(opts.conversationId);
|
|
647
670
|
const totalRows = rows.length;
|
|
648
671
|
if (totalRows === 0) return {
|
|
649
672
|
messages: [],
|
|
@@ -673,18 +696,14 @@ var EmbeddedBackend = class {
|
|
|
673
696
|
rowNumber: opts.rowNumber,
|
|
674
697
|
errorMessage
|
|
675
698
|
}, `Embedded loadHistoryWindow failed: ${errorMessage}`);
|
|
676
|
-
|
|
677
|
-
messages: [],
|
|
678
|
-
startRowNumber: 0,
|
|
679
|
-
endRowNumber: 0,
|
|
680
|
-
totalRows: 0
|
|
681
|
-
};
|
|
699
|
+
throw error;
|
|
682
700
|
}
|
|
683
701
|
}
|
|
684
702
|
async loadTranscriptTree(conversationId) {
|
|
685
|
-
|
|
703
|
+
const store = this.agent?.sessionStore ?? this.sessionIndex?.getStore();
|
|
704
|
+
if (!store) throw new Error("Session store is not ready.");
|
|
686
705
|
try {
|
|
687
|
-
return buildTuiTranscriptTree(await
|
|
706
|
+
return buildTuiTranscriptTree(await store.loadTranscriptRows(conversationId));
|
|
688
707
|
} catch (error) {
|
|
689
708
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
690
709
|
log.warn({
|
|
@@ -692,13 +711,14 @@ var EmbeddedBackend = class {
|
|
|
692
711
|
conversationId,
|
|
693
712
|
errorMessage
|
|
694
713
|
}, `Embedded loadTranscriptTree failed: ${errorMessage}`);
|
|
695
|
-
|
|
714
|
+
throw error;
|
|
696
715
|
}
|
|
697
716
|
}
|
|
698
717
|
async loadTimeline(conversationId) {
|
|
699
|
-
|
|
718
|
+
const store = this.agent?.sessionStore ?? this.sessionIndex?.getStore();
|
|
719
|
+
if (!store) throw new Error("Session store is not ready.");
|
|
700
720
|
try {
|
|
701
|
-
return buildSessionTimeline(await
|
|
721
|
+
return buildSessionTimeline(await store.loadTranscriptRows(conversationId));
|
|
702
722
|
} catch (error) {
|
|
703
723
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
704
724
|
log.warn({
|
|
@@ -706,7 +726,7 @@ var EmbeddedBackend = class {
|
|
|
706
726
|
conversationId,
|
|
707
727
|
errorMessage
|
|
708
728
|
}, `Embedded loadTimeline failed: ${errorMessage}`);
|
|
709
|
-
|
|
729
|
+
throw error;
|
|
710
730
|
}
|
|
711
731
|
}
|
|
712
732
|
async getSessionStats(conversationId) {
|
|
@@ -724,10 +744,151 @@ var EmbeddedBackend = class {
|
|
|
724
744
|
return computeTuiSessionStats([]);
|
|
725
745
|
}
|
|
726
746
|
}
|
|
727
|
-
|
|
728
|
-
|
|
747
|
+
askClarification(conversationId, runId, request) {
|
|
748
|
+
const id = crypto.randomUUID();
|
|
749
|
+
const signal = this.chatAbort?.signal;
|
|
750
|
+
const expiresAt = request.kind === "approval" ? Date.now() + 10 * 6e4 : void 0;
|
|
751
|
+
const presentation = {
|
|
752
|
+
...request,
|
|
753
|
+
id,
|
|
754
|
+
conversationId,
|
|
755
|
+
version: 1,
|
|
756
|
+
kind: request.kind ?? "input",
|
|
757
|
+
expiresAt
|
|
758
|
+
};
|
|
759
|
+
return new Promise((resolveAnswer, reject) => {
|
|
760
|
+
const cancel = () => {
|
|
761
|
+
this.clarificationWaits.delete(id);
|
|
762
|
+
clearTimeout(timer);
|
|
763
|
+
reject(/* @__PURE__ */ new Error("Clarification cancelled"));
|
|
764
|
+
};
|
|
765
|
+
const timer = expiresAt ? setTimeout(cancel, Math.max(0, expiresAt - Date.now())) : void 0;
|
|
766
|
+
const dispose = () => {
|
|
767
|
+
clearTimeout(timer);
|
|
768
|
+
signal?.removeEventListener("abort", cancel);
|
|
769
|
+
};
|
|
770
|
+
signal?.addEventListener("abort", cancel, { once: true });
|
|
771
|
+
this.clarificationWaits.set(id, {
|
|
772
|
+
request: presentation,
|
|
773
|
+
resolve: resolveAnswer,
|
|
774
|
+
reject,
|
|
775
|
+
dispose
|
|
776
|
+
});
|
|
777
|
+
if (signal?.aborted) {
|
|
778
|
+
cancel();
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
this.onEvent?.({
|
|
782
|
+
event: "clarify_request",
|
|
783
|
+
data: {
|
|
784
|
+
runId,
|
|
785
|
+
conversationId,
|
|
786
|
+
payload: {
|
|
787
|
+
...presentation,
|
|
788
|
+
requestId: id
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
source: "embedded"
|
|
792
|
+
});
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
async getClarification(conversationId) {
|
|
796
|
+
return [...this.clarificationWaits.values()].find((wait) => wait.request.conversationId === conversationId)?.request ?? null;
|
|
797
|
+
}
|
|
798
|
+
async submitClarification(conversationId, id, command) {
|
|
799
|
+
const wait = this.clarificationWaits.get(id);
|
|
800
|
+
if (!wait || wait.request.conversationId !== conversationId || wait.request.version !== command.expectedVersion) throw new Error("This question is no longer active.");
|
|
801
|
+
if (wait.request.expiresAt && wait.request.expiresAt <= Date.now()) throw new Error("This approval has expired.");
|
|
802
|
+
const answer = command.action === "answer" ? normalizeClarificationSubmission(wait.request, {
|
|
803
|
+
...command.schemaVersion ? { schemaVersion: command.schemaVersion } : {},
|
|
804
|
+
...command.answers ? { answers: command.answers } : {},
|
|
805
|
+
...command.response ? { response: command.response } : {},
|
|
806
|
+
...command.decision ? { decision: command.decision } : {}
|
|
807
|
+
}).answer : void 0;
|
|
808
|
+
this.clarificationWaits.delete(id);
|
|
809
|
+
wait.dispose();
|
|
810
|
+
if (answer === void 0) wait.reject(/* @__PURE__ */ new Error("Clarification cancelled by the user."));
|
|
811
|
+
else wait.resolve({
|
|
812
|
+
status: "answered",
|
|
813
|
+
answer
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
async manageCapability(conversationId, command) {
|
|
817
|
+
const info = await this.getSessionInfo(conversationId);
|
|
818
|
+
if (!info.effectiveWorkspacePath) throw new Error("Workspace is unavailable");
|
|
819
|
+
return manageTuiCapability({
|
|
820
|
+
command,
|
|
821
|
+
conversationId,
|
|
822
|
+
config: this.activeConfig(),
|
|
823
|
+
workspace: info.effectiveWorkspacePath,
|
|
824
|
+
owner: "gateway-owner"
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
async listCapabilities(conversationId, kind) {
|
|
828
|
+
const info = await this.getSessionInfo(conversationId);
|
|
829
|
+
if (!info.effectiveWorkspacePath) throw new Error("Workspace is unavailable.");
|
|
830
|
+
return listTuiCapabilities({
|
|
831
|
+
config: this.activeConfig(),
|
|
832
|
+
workspace: info.effectiveWorkspacePath,
|
|
833
|
+
agentId: info.agentId,
|
|
834
|
+
kind,
|
|
835
|
+
trusted: this.isWorkspaceTrusted(info.effectiveWorkspacePath)
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
async listSubagents(conversationId) {
|
|
839
|
+
return listChildRuns(conversationId);
|
|
840
|
+
}
|
|
841
|
+
async getSubagent(conversationId, id) {
|
|
842
|
+
return getChildRun(conversationId, id);
|
|
843
|
+
}
|
|
844
|
+
async steerSubagent(conversationId, id, text) {
|
|
845
|
+
await steerChildRun(conversationId, id, text);
|
|
846
|
+
}
|
|
847
|
+
async resumeSubagent(conversationId, id, text) {
|
|
848
|
+
await resumeChildRun(conversationId, id, text, this.activeConfig());
|
|
849
|
+
}
|
|
850
|
+
async getSubagentTranscript(conversationId, id) {
|
|
851
|
+
return JSON.stringify(getChildRunMessages(conversationId, id), null, 2);
|
|
852
|
+
}
|
|
853
|
+
async stopSubagent(conversationId, id) {
|
|
854
|
+
stopChildRun(conversationId, id);
|
|
855
|
+
}
|
|
856
|
+
async getInteractionPolicy(conversationId) {
|
|
857
|
+
return getSessionInteractionPolicy(conversationId);
|
|
858
|
+
}
|
|
859
|
+
async setInteractionPolicy(conversationId, policy) {
|
|
860
|
+
return setSessionInteractionPolicy(conversationId, policy);
|
|
861
|
+
}
|
|
862
|
+
async getWorkspaceDiff(conversationId) {
|
|
863
|
+
const info = await this.getSessionInfo(conversationId);
|
|
864
|
+
if (!info.effectiveWorkspacePath) throw new Error("Workspace is unavailable.");
|
|
865
|
+
return getTuiWorkspaceDiff(info.effectiveWorkspacePath);
|
|
866
|
+
}
|
|
867
|
+
async searchHistory(conversationId, query) {
|
|
868
|
+
return searchTuiHistory(conversationId, query);
|
|
869
|
+
}
|
|
870
|
+
async listJobs(conversationId) {
|
|
871
|
+
return listTuiJobs(conversationId);
|
|
872
|
+
}
|
|
873
|
+
async getJob(conversationId, id) {
|
|
874
|
+
return getTuiJob(conversationId, id);
|
|
875
|
+
}
|
|
876
|
+
async resizeJob(conversationId, id, cols, rows) {
|
|
877
|
+
resizeTuiJob(conversationId, id, cols, rows);
|
|
878
|
+
}
|
|
879
|
+
async stopJob(conversationId, id) {
|
|
880
|
+
await stopTuiJob(conversationId, id);
|
|
881
|
+
}
|
|
882
|
+
async writeJob(conversationId, id, text) {
|
|
883
|
+
writeTuiJob(conversationId, id, text);
|
|
884
|
+
}
|
|
885
|
+
async listSessions(options) {
|
|
886
|
+
await this.sessionIndexReady;
|
|
887
|
+
const store = this.agent?.sessionStore ?? this.sessionIndex?.getStore();
|
|
888
|
+
if (!store) throw new Error("Session store is unavailable.");
|
|
729
889
|
try {
|
|
730
|
-
return (await
|
|
890
|
+
return (await store.list({
|
|
891
|
+
status: options?.archived ? ["archived"] : ["active", "pinned"],
|
|
731
892
|
limit: 200,
|
|
732
893
|
sortBy: "updatedAt",
|
|
733
894
|
sortOrder: "desc"
|
|
@@ -738,7 +899,7 @@ var EmbeddedBackend = class {
|
|
|
738
899
|
err: error,
|
|
739
900
|
errorMessage
|
|
740
901
|
}, `Embedded listSessions failed: ${errorMessage}`);
|
|
741
|
-
|
|
902
|
+
throw error;
|
|
742
903
|
}
|
|
743
904
|
}
|
|
744
905
|
async listAgents() {
|
|
@@ -758,9 +919,11 @@ var EmbeddedBackend = class {
|
|
|
758
919
|
return { agentId: agentId.trim().toLowerCase() };
|
|
759
920
|
}
|
|
760
921
|
async renameSession(conversationId, name) {
|
|
761
|
-
|
|
922
|
+
await this.sessionIndexReady;
|
|
923
|
+
const store = this.agent?.sessionStore ?? this.sessionIndex?.getStore();
|
|
924
|
+
if (!store) return { ok: false };
|
|
762
925
|
try {
|
|
763
|
-
await
|
|
926
|
+
await store.updateMetadata(conversationId, { name: name.trim() });
|
|
764
927
|
return { ok: true };
|
|
765
928
|
} catch (error) {
|
|
766
929
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -772,6 +935,18 @@ var EmbeddedBackend = class {
|
|
|
772
935
|
return { ok: false };
|
|
773
936
|
}
|
|
774
937
|
}
|
|
938
|
+
async restoreSession(conversationId) {
|
|
939
|
+
await this.sessionIndexReady;
|
|
940
|
+
const store = this.agent?.sessionStore ?? this.sessionIndex?.getStore();
|
|
941
|
+
if (!store) throw new Error("Session store is unavailable");
|
|
942
|
+
await store.unarchive(conversationId);
|
|
943
|
+
}
|
|
944
|
+
async archiveSession(conversationId) {
|
|
945
|
+
await this.sessionIndexReady;
|
|
946
|
+
const store = this.agent?.sessionStore ?? this.sessionIndex?.getStore();
|
|
947
|
+
if (!store || !getSessionMetadata(conversationId)) throw new Error("Only saved conversations can be archived.");
|
|
948
|
+
await store.archive(conversationId);
|
|
949
|
+
}
|
|
775
950
|
async deleteSession(conversationId) {
|
|
776
951
|
const draft = this.drafts.read(conversationId);
|
|
777
952
|
if (draft && !draft.command && !draft.materialization) {
|
|
@@ -840,6 +1015,7 @@ var EmbeddedBackend = class {
|
|
|
840
1015
|
this.drafts.remove(conversationId);
|
|
841
1016
|
}
|
|
842
1017
|
async getSessionInfo(conversationId) {
|
|
1018
|
+
this.visitedConversations.add(conversationId);
|
|
843
1019
|
const draft = this.drafts.read(conversationId);
|
|
844
1020
|
if (draft) {
|
|
845
1021
|
const model = parseModelRef(draft.creation.model);
|
|
@@ -857,7 +1033,28 @@ var EmbeddedBackend = class {
|
|
|
857
1033
|
effectiveWorkspacePath: project?.workspaceRoot || draft.config.workingDirectoryOverride || profile.resolvedWorkspacePath
|
|
858
1034
|
};
|
|
859
1035
|
}
|
|
860
|
-
if (!this.agent)
|
|
1036
|
+
if (!this.agent) {
|
|
1037
|
+
await this.sessionIndexReady;
|
|
1038
|
+
const metadata = getSessionMetadata(conversationId);
|
|
1039
|
+
if (!metadata) throw new Error("Session not found.");
|
|
1040
|
+
const profile = resolveEffectiveAgentProfile(metadata.agentId);
|
|
1041
|
+
const cfg = getSessionConfig(conversationId);
|
|
1042
|
+
const project = metadata.projectId ? new ProjectService().get(metadata.projectId) : null;
|
|
1043
|
+
const parsed = parseModelRef(cfg?.modelOverride ?? profile.primaryModelRef);
|
|
1044
|
+
return {
|
|
1045
|
+
agentId: metadata.agentId,
|
|
1046
|
+
displayName: metadata.name,
|
|
1047
|
+
model: parsed?.model,
|
|
1048
|
+
modelProvider: parsed?.provider,
|
|
1049
|
+
thinkingLevel: cfg?.thinkingLevel,
|
|
1050
|
+
reasoningLevel: cfg?.reasoningLevel,
|
|
1051
|
+
verboseLevel: cfg?.verboseLevel,
|
|
1052
|
+
projectId: metadata.projectId,
|
|
1053
|
+
effectiveWorkspacePath: effectiveWorkspacePathForSession(this.activeConfig(), conversationId, cfg, project),
|
|
1054
|
+
workingDirectoryLocked: Boolean(project),
|
|
1055
|
+
interactionPolicy: getSessionInteractionPolicy(conversationId)
|
|
1056
|
+
};
|
|
1057
|
+
}
|
|
861
1058
|
try {
|
|
862
1059
|
const cfg = await this.agent.sessionInspector.agentConfig(conversationId);
|
|
863
1060
|
const parsed = parseModelRef(cfg.model);
|
|
@@ -883,7 +1080,7 @@ var EmbeddedBackend = class {
|
|
|
883
1080
|
conversationId,
|
|
884
1081
|
errorMessage
|
|
885
1082
|
}, `getSessionInfo failed: ${errorMessage}`);
|
|
886
|
-
|
|
1083
|
+
throw err;
|
|
887
1084
|
}
|
|
888
1085
|
}
|
|
889
1086
|
async listModels() {
|
|
@@ -978,8 +1175,11 @@ var EmbeddedBackend = class {
|
|
|
978
1175
|
}
|
|
979
1176
|
}
|
|
980
1177
|
async exportSession(conversationId, format) {
|
|
981
|
-
if (
|
|
982
|
-
|
|
1178
|
+
if (this.drafts.read(conversationId) && !getSessionMetadata(conversationId)) throw new Error("This conversation is an unsent draft; there is no persisted transcript yet.");
|
|
1179
|
+
await this.sessionIndexReady;
|
|
1180
|
+
const store = this.agent?.sessionStore ?? this.sessionIndex?.getStore();
|
|
1181
|
+
if (!store) throw new Error("Session store is unavailable.");
|
|
1182
|
+
return store.exportSession(conversationId, format);
|
|
983
1183
|
}
|
|
984
1184
|
async importSession(targetConversationId, jsonContent) {
|
|
985
1185
|
if (!this.agent) throw new Error("Agent not started");
|
|
@@ -1022,12 +1222,18 @@ var EmbeddedBackend = class {
|
|
|
1022
1222
|
routingHint: typeof details.routing?.hint === "string" ? details.routing.hint : void 0
|
|
1023
1223
|
};
|
|
1024
1224
|
}
|
|
1025
|
-
async
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1225
|
+
async sideQuery(conversationId, question, options) {
|
|
1226
|
+
const agent = await this.ensureAgent();
|
|
1227
|
+
const draft = this.drafts.read(conversationId);
|
|
1228
|
+
return agent.sessionInspector.btwQuery(conversationId, question, {
|
|
1229
|
+
signal: options?.signal,
|
|
1230
|
+
onTextDelta: options?.onDelta,
|
|
1231
|
+
...draft ? {
|
|
1232
|
+
agentId: draft.creation.agentId,
|
|
1233
|
+
modelRef: draft.creation.model,
|
|
1234
|
+
includeSessionContext: false
|
|
1235
|
+
} : {}
|
|
1236
|
+
});
|
|
1031
1237
|
}
|
|
1032
1238
|
async forkSession(sourceConversationId, targetConversationId) {
|
|
1033
1239
|
if (!this.agent) throw new Error("Agent not started");
|