@xopcai/xopc 0.0.454 → 0.0.456
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-CgQDpSpK.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-D0nNat6N.js → automations-workspace-CWEDraTP.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-BjYumhaI.js} +20 -20
- 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-Cn1TfGz4.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-narrative-B7I1II0Z.js → desktop-pet-narrative-JqMsz4rn.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-BpzvsoS1.js → index-DBlVVXOA.js} +5 -5
- package/dist/gateway/static/root/assets/index-DpkEeFEQ.css +1 -0
- 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-C6s0WlNL.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-CR7dNVDi.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-C89kLOIL.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-sHcdluTm.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-DrfQJkmW.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-C4CYw21O.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-DBnkT1Nj.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-CP35P4VA.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-CIpGYSl0.js +1 -0
- 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-Bbi2MpIS.js +2 -0
- 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 +8 -3
- package/dist/src/agent/background-review/prompts.d.ts +1 -1
- package/dist/src/agent/background-review/prompts.js +8 -1
- package/dist/src/agent/background-review/run-background-review.js +48 -4
- 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/audit.js +18 -0
- package/dist/src/agent/context/coordinator.d.ts +4 -0
- package/dist/src/agent/context/coordinator.js +33 -7
- package/dist/src/agent/context/deep-recall.d.ts +33 -0
- package/dist/src/agent/context/deep-recall.js +190 -0
- package/dist/src/agent/context/execution-context.js +29 -5
- package/dist/src/agent/context/execution-context.types.d.ts +2 -0
- package/dist/src/agent/context/memory-claim-grounding.d.ts +2 -0
- package/dist/src/agent/context/memory-claim-grounding.js +20 -0
- package/dist/src/agent/context/project-context.js +1 -1
- package/dist/src/agent/context/recall-grounding.d.ts +3 -0
- package/dist/src/agent/context/recall-grounding.js +31 -0
- 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 +120 -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/cliProvider.js +2 -2
- package/dist/src/agent/external-tools/composio-provider.js +2 -2
- package/dist/src/agent/external-tools/endpoint-provider.js +4 -4
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/memory/context-recovery.d.ts +1 -1
- package/dist/src/agent/memory/index.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 +3 -3
- package/dist/src/agent/service.d.ts +1 -0
- package/dist/src/agent/service.js +8 -5
- 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/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/tools/create-share-tool.js +1 -1
- package/dist/src/agent/tools/exec-command.js +5 -0
- package/dist/src/agent/tools/factory.js +23 -1
- package/dist/src/agent/tools/index.js +1 -1
- package/dist/src/agent/tools/knowledge-memory-tool.js +7 -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-memory-tool.d.ts +11 -0
- package/dist/src/agent/tools/personal-memory-tool.js +387 -0
- package/dist/src/agent/tools/personal-read-tool.js +2 -2
- 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/session-search-tool.d.ts +2 -0
- package/dist/src/agent/tools/session-search-tool.js +21 -7
- package/dist/src/agent/tools/user-context-tool.js +11 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +6 -6
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/automations/api/routes.js +2 -2
- package/dist/src/automations/capabilities/drafts.js +6 -2
- package/dist/src/automations/capabilities/read.js +58 -8
- package/dist/src/automations/capabilities/write.js +54 -1
- package/dist/src/automations/configuration-conversation.js +1 -1
- 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/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.d.ts +1 -0
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.d.ts +2 -0
- package/dist/src/capabilities/runtime/product.js +27 -7
- 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/agents.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/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/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/computer/endpoint-transport.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/schema.d.ts +7 -1
- package/dist/src/config/schema.js +6 -0
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/gateway/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/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +6 -0
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +108 -11
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- 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/notes.js +2 -2
- package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- 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 +4 -4
- package/dist/src/gateway/hono/routes/tui.js +308 -0
- package/dist/src/gateway/hono/routes/user-model.js +47 -7
- package/dist/src/gateway/image-generation-setup.js +1 -1
- 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 +7 -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 +4 -4
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +2 -2
- package/dist/src/imports/importService.js +1 -1
- package/dist/src/infra/execution-authority.d.ts +12 -0
- package/dist/src/infra/execution-authority.js +27 -0
- package/dist/src/knowledge-memory/index.js +2 -2
- package/dist/src/knowledge-memory/repository.d.ts +6 -0
- package/dist/src/knowledge-memory/repository.js +49 -1
- package/dist/src/knowledge-memory/usage-policy.js +7 -7
- 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 +24 -7
- 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 +19 -2
- package/dist/src/local-apps/store.js +1 -1
- package/dist/src/memory-learning/work-capture.js +3 -1
- package/dist/src/notes/agent-context.js +1 -1
- package/dist/src/personal-agent/policy.d.ts +1 -1
- package/dist/src/personal-agent/policy.js +2 -1
- package/dist/src/personal-agent/prompts.js +7 -1
- package/dist/src/personal-agent/request-service.js +1 -1
- package/dist/src/personal-agent/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/providers/model-catalog-persistence.js +1 -1
- package/dist/src/review/review-git.js +14 -1
- package/dist/src/runtime-tools/archive.js +1 -1
- package/dist/src/session/history-recall-policy.d.ts +6 -0
- package/dist/src/session/history-recall-policy.js +48 -0
- 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/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +12 -3
- 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 +249 -43
- 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/dist/src/user-context/config.d.ts +12 -0
- package/dist/src/user-context/config.js +14 -1
- package/dist/src/user-context/memory-version.d.ts +2 -0
- package/dist/src/user-context/memory-version.js +12 -0
- package/dist/src/user-model/capture/evidence-policy.d.ts +45 -0
- package/dist/src/user-model/capture/evidence-policy.js +143 -0
- package/dist/src/user-model/capture/executor.d.ts +1 -0
- package/dist/src/user-model/capture/executor.js +68 -8
- package/dist/src/user-model/capture/semantic.d.ts +16 -0
- package/dist/src/user-model/capture/semantic.js +66 -12
- package/dist/src/user-model/repository.js +11 -0
- package/dist/src/user-model/usage-policy.js +5 -5
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/work-discovery/service.js +1 -1
- 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/understanding-refresh-store-BxtpXRfV.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-DmmJODQ4.js +0 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-pVOYuH7u.js +0 -1
package/dist/src/tui/tui.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { version } from "../../package.js";
|
|
2
2
|
import { resolveStateDir, resolveXopcDatabasePath } from "../config/paths-state.js";
|
|
3
|
+
import { createLogger } from "../utils/logger/index.js";
|
|
4
|
+
import { init_logger } from "../utils/logger.js";
|
|
3
5
|
import { init_paths } from "../config/paths.js";
|
|
4
6
|
import { init_agent_session_key, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
5
7
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
6
|
-
import {
|
|
8
|
+
import { getAllProviders, init_providers, isProviderConfiguredSync } from "../providers/index.js";
|
|
9
|
+
import { sandboxCommand } from "../agent/sandbox/native-command.js";
|
|
7
10
|
import { ProjectTrustStore, hasTrustRequiringProjectResources } from "../project-trust/trust-store.js";
|
|
8
11
|
import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../gateway/chat-limits.js";
|
|
9
12
|
import { loadConfig } from "../config/loader.js";
|
|
@@ -11,7 +14,7 @@ import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
|
11
14
|
import "../config/index.js";
|
|
12
15
|
import { resolveTuiConversationId, resolveTuiStartupConversationId } from "../routing/resolve-tui-session-key.js";
|
|
13
16
|
import { applyThemeById, getBashExcludeBorderColor, getBashModeBorderColor, getCustomThemesDir, getThemeExports, getThinkingBorderColor, initTuiTheme, listAvailableThemeIds, resolveThemePalette } from "./theme-manager.js";
|
|
14
|
-
import { editorTheme, theme } from "./theme.js";
|
|
17
|
+
import { editorTheme, searchableSelectListTheme, theme } from "./theme.js";
|
|
15
18
|
import { extensionForImageMimeType, readClipboardImage } from "./clipboard-image.js";
|
|
16
19
|
import { copyTextToClipboard } from "./clipboard-text.js";
|
|
17
20
|
import { createTuiComposerHistory } from "./composer-history.js";
|
|
@@ -19,28 +22,37 @@ import { createXopcTuiKeybindingsManager } from "./tui-keybindings-file.js";
|
|
|
19
22
|
import { isActiveRunStreamStale, markActiveRunStalled, markRunRecovering, markRunRecoveryComplete, markRunSending } from "./tui-run-state.js";
|
|
20
23
|
import { clearSeenStreamEvents, clearSeenStreamEventsForRun, dispatchAgentEvent } from "./tui-agent-events.js";
|
|
21
24
|
import { acceptChatInputState, createEmptyChatInputState, findLastEditableChatInput } from "./tui-chat-input-state.js";
|
|
25
|
+
import { createCapabilityControls } from "./tui-capability-controls.js";
|
|
26
|
+
import { collectTuiClarification } from "./tui-clarification.js";
|
|
22
27
|
import { transcriptTreeEntryIdToRowNumber } from "./tui-transcript-tree.js";
|
|
23
28
|
import { formatTuiCompactionResult, formatTuiShareResult } from "./tui-command-formatters.js";
|
|
24
29
|
import { formatTuiStartupText } from "./tui-startup-text.js";
|
|
25
30
|
import { createTuiCommandHandler, getSlashCommands } from "./tui-commands.js";
|
|
31
|
+
import { createTuiControlCommands } from "./tui-control-commands.js";
|
|
26
32
|
import { extensionCustomMessageContentToText, extensionCustomMessageToTurnText, extensionUserMessageContentToText } from "./tui-extension-user-message.js";
|
|
27
33
|
import { resolveFdPath } from "./tui-fd-path.js";
|
|
34
|
+
import { readTuiImageFiles } from "./tui-image-files.js";
|
|
28
35
|
import { createBackspaceDeduper, drainAndStopTuiSafely, isIgnorableTuiStopError, resolveCtrlCAction, stopTuiSafely } from "./tui-lifecycle.js";
|
|
29
36
|
import { createLocalShellRunner } from "./tui-local-shell.js";
|
|
37
|
+
import { SearchableSelectList } from "./components/searchable-select-list.js";
|
|
30
38
|
import { filterModelsForCycle, loadScopedModelRefs, saveScopedModelRefs } from "./tui-scoped-models.js";
|
|
31
39
|
import { openModelPickerOverlay } from "./tui-model-picker.js";
|
|
32
40
|
import { getTuiNewSessionPreferences, rememberTuiAgentModel, rememberTuiSessionContext, tuiGatewayPreferenceKey, tuiInitialAgentConfig } from "./tui-new-session-preferences.js";
|
|
41
|
+
import { ExtensionInputDialog, ExtensionSelectDialog } from "./components/extension-dialog.js";
|
|
33
42
|
import { runTuiOAuthLogin } from "./tui-oauth-login.js";
|
|
34
|
-
import { openAgentPickerOverlay, openProjectTrustOverlay, openReviewLauncherOverlay, openScopedModelsOverlay, openSessionPickerOverlay,
|
|
43
|
+
import { openAgentPickerOverlay, openProjectTrustOverlay, openReviewLauncherOverlay, openScopedModelsOverlay, openSessionPickerOverlay, openSettingsOverlay, openThinkingSelectorOverlay, openTimelineOverlay, openTranscriptTreeOverlay, openUserMessageForkOverlay } from "./tui-picker-overlay.js";
|
|
35
44
|
import { formatActiveRunStatus, formatRunDuration } from "./tui-run-status-format.js";
|
|
36
45
|
import { formatBusyResponseHint, formatSteerUnavailableHint, formatSuspendUnsupportedHint } from "./tui-runtime-hints.js";
|
|
37
46
|
import { createSessionActions } from "./tui-session-actions.js";
|
|
38
47
|
import { TuiSessionSnapshot } from "./tui-session-snapshot.js";
|
|
39
48
|
import { loadTuiSettings, saveTuiSettings } from "./tui-settings.js";
|
|
49
|
+
import { createTuiSideChat } from "./tui-side-chat.js";
|
|
40
50
|
import { installTuiStdioFilter } from "./tui-stdio-filter.js";
|
|
41
51
|
import { createEditorSubmitHandler, createSubmitBurstCoalescer, shouldEnableWindowsGitBashPasteFallback } from "./tui-submit.js";
|
|
42
52
|
import { withTuiSuspended } from "./tui-suspend.js";
|
|
53
|
+
import { attachTuiTerminal } from "./tui-terminal.js";
|
|
43
54
|
import { createInitialState } from "./tui-types.js";
|
|
55
|
+
import { TextViewer } from "./components/text-viewer.js";
|
|
44
56
|
import { TuiDraftFileStore } from "./backends/embedded-drafts.js";
|
|
45
57
|
import { EmbeddedBackend } from "./backends/embedded-backend.js";
|
|
46
58
|
import { GatewayRealtimeBackend } from "./backends/gateway-realtime-backend.js";
|
|
@@ -60,6 +72,7 @@ import { spawnSync } from "node:child_process";
|
|
|
60
72
|
import { Container, Loader, ProcessTerminal, TuiMainScreen, setKeybindings } from "@earendil-works/pi-tui";
|
|
61
73
|
import { Buffer } from "node:buffer";
|
|
62
74
|
//#region src/tui/tui.ts
|
|
75
|
+
init_logger();
|
|
63
76
|
init_paths();
|
|
64
77
|
init_agent_session_key();
|
|
65
78
|
init_providers();
|
|
@@ -72,6 +85,7 @@ const THINK_LEVEL_CYCLE = [
|
|
|
72
85
|
"xhigh",
|
|
73
86
|
"adaptive"
|
|
74
87
|
];
|
|
88
|
+
const log = createLogger("TUI");
|
|
75
89
|
function nextThinkLevel(current) {
|
|
76
90
|
const c = (current ?? "medium").toLowerCase();
|
|
77
91
|
const idx = THINK_LEVEL_CYCLE.indexOf(c);
|
|
@@ -210,7 +224,7 @@ async function runTui(opts) {
|
|
|
210
224
|
state.scopedModelRefs = loadScopedModelRefs();
|
|
211
225
|
state.showThinking = tuiSettings.showThinking;
|
|
212
226
|
state.toolsExpanded = tuiSettings.toolsExpanded;
|
|
213
|
-
let pendingImageAttachments = [];
|
|
227
|
+
let pendingImageAttachments = await readTuiImageFiles(opts.images ?? []);
|
|
214
228
|
const pendingNextTurnCustomMessages = [];
|
|
215
229
|
let lastRetryMessageText = null;
|
|
216
230
|
let setExtensionLabel = (_entryId, _label) => {};
|
|
@@ -469,7 +483,11 @@ async function runTui(opts) {
|
|
|
469
483
|
tui.requestRender();
|
|
470
484
|
};
|
|
471
485
|
let activeEditorSelectorClose = null;
|
|
486
|
+
let cancelPendingDialog;
|
|
472
487
|
const closeEditorSelector = () => {
|
|
488
|
+
const cancel = cancelPendingDialog;
|
|
489
|
+
cancelPendingDialog = void 0;
|
|
490
|
+
cancel?.();
|
|
473
491
|
activeEditorSelectorClose?.();
|
|
474
492
|
};
|
|
475
493
|
const openEditorSelector = (component, focus = component) => {
|
|
@@ -481,6 +499,7 @@ async function runTui(opts) {
|
|
|
481
499
|
const close = () => {
|
|
482
500
|
if (activeEditorSelectorClose !== close) return;
|
|
483
501
|
activeEditorSelectorClose = null;
|
|
502
|
+
component.dispose?.();
|
|
484
503
|
editorContainer.clear();
|
|
485
504
|
editorContainer.addChild(editor);
|
|
486
505
|
tui.setFocus(editor);
|
|
@@ -577,161 +596,10 @@ async function runTui(opts) {
|
|
|
577
596
|
const waitForTuiIdle = async () => {
|
|
578
597
|
while (state.activeRunId != null || state.isCompacting || state.activityStatus === "sending" || state.activityStatus === "waiting" || state.activityStatus === "streaming" || state.activityStatus === "running" || state.activityStatus === "compacting") await new Promise((resolveDelay) => setTimeout(resolveDelay, 50));
|
|
579
598
|
};
|
|
580
|
-
const createReplacementContext = () => {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
ref: state.sessionInfo.modelProvider ? `${state.sessionInfo.modelProvider}/${state.sessionInfo.model}` : state.sessionInfo.model,
|
|
585
|
-
contextWindow: state.sessionInfo.contextWindow ?? null
|
|
586
|
-
} : void 0;
|
|
587
|
-
return {
|
|
588
|
-
mode: "tui",
|
|
589
|
-
hasUI: true,
|
|
590
|
-
signal: client.getActiveSignal?.(),
|
|
591
|
-
ui: {
|
|
592
|
-
select: async () => void 0,
|
|
593
|
-
confirm: async () => false,
|
|
594
|
-
input: async () => void 0,
|
|
595
|
-
notify: (message, level) => {
|
|
596
|
-
const prefix = level === "error" ? "Error: " : level === "warn" || level === "warning" ? "Warning: " : "";
|
|
597
|
-
chatLog.addSystem(`${prefix}${message}`);
|
|
598
|
-
tui.requestRender();
|
|
599
|
-
},
|
|
600
|
-
onTerminalInput: (handler) => tui.addInputListener(handler),
|
|
601
|
-
setStatus: () => {},
|
|
602
|
-
setWorkingMessage: (message) => {
|
|
603
|
-
extensionWorkingMessage = message?.trim() || void 0;
|
|
604
|
-
renderStatus();
|
|
605
|
-
},
|
|
606
|
-
setWorkingVisible: (visible) => {
|
|
607
|
-
extensionWorkingVisible = visible;
|
|
608
|
-
renderStatus();
|
|
609
|
-
},
|
|
610
|
-
setWorkingIndicator: (indicator) => {
|
|
611
|
-
extensionWorkingIndicator = indicator ?? void 0;
|
|
612
|
-
statusLoader?.setIndicator(indicator ?? void 0);
|
|
613
|
-
renderStatus();
|
|
614
|
-
},
|
|
615
|
-
setHiddenThinkingLabel: (label) => {
|
|
616
|
-
chatLog.setHiddenThinkingLabel(label ?? void 0);
|
|
617
|
-
tui.requestRender();
|
|
618
|
-
},
|
|
619
|
-
setWidget: () => {},
|
|
620
|
-
setFooter: () => {},
|
|
621
|
-
setHeader: () => {},
|
|
622
|
-
custom: async () => void 0,
|
|
623
|
-
setTitle: (title) => tui.terminal.setTitle(title),
|
|
624
|
-
pasteToEditor: (text) => editor.handleInput(`\x1b[200~${text}\x1b[201~`),
|
|
625
|
-
setEditorText: (text) => editor.setText(text),
|
|
626
|
-
getEditorText: () => editor.getExpandedText?.() ?? editor.getText(),
|
|
627
|
-
editor: async () => void 0,
|
|
628
|
-
addAutocompleteProvider: () => () => {},
|
|
629
|
-
setEditorComponent,
|
|
630
|
-
getEditorComponent: () => editorComponentFactory,
|
|
631
|
-
theme,
|
|
632
|
-
getAllThemes: getAllExtensionThemes,
|
|
633
|
-
getTheme: getExtensionTheme,
|
|
634
|
-
setTheme: setExtensionTheme,
|
|
635
|
-
getToolsExpanded: () => state.toolsExpanded,
|
|
636
|
-
setToolsExpanded: (expanded) => {
|
|
637
|
-
state.toolsExpanded = expanded;
|
|
638
|
-
tuiSettings = {
|
|
639
|
-
...tuiSettings,
|
|
640
|
-
toolsExpanded: expanded
|
|
641
|
-
};
|
|
642
|
-
saveTuiSettings(tuiSettings);
|
|
643
|
-
chatLog.setToolsExpanded(expanded);
|
|
644
|
-
updateFooter();
|
|
645
|
-
tui.requestRender();
|
|
646
|
-
}
|
|
647
|
-
},
|
|
648
|
-
sessionManager: sessionSnapshot.manager(),
|
|
649
|
-
modelRegistry: {
|
|
650
|
-
find(provider, modelId) {
|
|
651
|
-
return getAllModels().find((candidate) => candidate.provider === provider && candidate.id === modelId);
|
|
652
|
-
},
|
|
653
|
-
async getApiKeyAndHeaders(nextModel) {
|
|
654
|
-
const provider = typeof nextModel.provider === "string" ? nextModel.provider : void 0;
|
|
655
|
-
if (!provider) return {
|
|
656
|
-
ok: false,
|
|
657
|
-
error: "Model provider is missing."
|
|
658
|
-
};
|
|
659
|
-
try {
|
|
660
|
-
return {
|
|
661
|
-
ok: true,
|
|
662
|
-
apiKey: await getApiKey(provider),
|
|
663
|
-
headers: {}
|
|
664
|
-
};
|
|
665
|
-
} catch (error) {
|
|
666
|
-
return {
|
|
667
|
-
ok: false,
|
|
668
|
-
error: error instanceof Error ? error.message : String(error)
|
|
669
|
-
};
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
},
|
|
673
|
-
model,
|
|
674
|
-
cwd: process.cwd(),
|
|
675
|
-
conversationId: state.currentConversationId,
|
|
676
|
-
isProjectTrusted: isCurrentProjectTrusted,
|
|
677
|
-
isIdle: () => !state.activeRunId && !state.isCompacting,
|
|
678
|
-
hasPendingMessages: () => state.compactionQueue.length > 0,
|
|
679
|
-
abort: () => abortActive(),
|
|
680
|
-
shutdown: () => requestExit(),
|
|
681
|
-
compact: (options) => runCompaction(options?.customInstructions, {
|
|
682
|
-
onComplete: options?.onComplete,
|
|
683
|
-
onError: options?.onError
|
|
684
|
-
}),
|
|
685
|
-
getSystemPrompt: getExtensionSystemPrompt,
|
|
686
|
-
getSystemPromptOptions: () => ({
|
|
687
|
-
cwd: process.cwd(),
|
|
688
|
-
conversationId: state.currentConversationId,
|
|
689
|
-
...model ? { model } : {}
|
|
690
|
-
}),
|
|
691
|
-
waitForIdle: waitForTuiIdle,
|
|
692
|
-
newSession: (options) => runExtensionNewSession(options),
|
|
693
|
-
fork: (entryId, options) => runExtensionFork(entryId, options),
|
|
694
|
-
navigateTree: (targetId, options) => runExtensionNavigateTree(targetId, options),
|
|
695
|
-
switchSession: (sessionPath, options) => runExtensionSwitchSession(sessionPath, options),
|
|
696
|
-
reload: async () => {
|
|
697
|
-
await loadSessionHistory({ merge: true });
|
|
698
|
-
await refreshSessionInfoWithBorder();
|
|
699
|
-
},
|
|
700
|
-
getModel: () => model,
|
|
701
|
-
setModel: (modelRef) => switchCurrentModel(modelRef),
|
|
702
|
-
getThinkingLevel: () => state.sessionInfo.thinkingLevel,
|
|
703
|
-
setThinkingLevel,
|
|
704
|
-
getReasoningLevel: () => state.sessionInfo.reasoningLevel,
|
|
705
|
-
setReasoningLevel,
|
|
706
|
-
getVerboseLevel: () => state.sessionInfo.verboseLevel,
|
|
707
|
-
setVerboseLevel,
|
|
708
|
-
getCommands: () => slashCommands.map((command) => ({
|
|
709
|
-
name: command.name,
|
|
710
|
-
description: command.description,
|
|
711
|
-
source: "builtin"
|
|
712
|
-
})),
|
|
713
|
-
getContextUsage: () => {
|
|
714
|
-
const tokens = state.sessionInfo.totalTokens ?? state.sessionInfo.contextTokens ?? null;
|
|
715
|
-
const contextWindow = state.sessionInfo.contextWindow ?? null;
|
|
716
|
-
const percent = state.sessionInfo.contextUsagePercent ?? null;
|
|
717
|
-
if (tokens == null && contextWindow == null) return void 0;
|
|
718
|
-
return {
|
|
719
|
-
estimatedTokens: tokens,
|
|
720
|
-
tokens,
|
|
721
|
-
contextWindow,
|
|
722
|
-
usagePercent: percent,
|
|
723
|
-
percent
|
|
724
|
-
};
|
|
725
|
-
},
|
|
726
|
-
notify: (message, level) => {
|
|
727
|
-
const prefix = level === "error" ? "Error: " : level === "warn" || level === "warning" ? "Warning: " : "";
|
|
728
|
-
chatLog.addSystem(`${prefix}${message}`);
|
|
729
|
-
tui.requestRender();
|
|
730
|
-
},
|
|
731
|
-
sendMessage: async (message, options) => sendExtensionMessage(message, options),
|
|
732
|
-
sendUserMessage: async (content, options) => sendExtensionUserMessage(content, options)
|
|
733
|
-
};
|
|
734
|
-
};
|
|
599
|
+
const createReplacementContext = () => Object.assign(extensionRuntime.createContext("xopc-session"), {
|
|
600
|
+
sendMessage: async (message, options) => sendExtensionMessage(message, options),
|
|
601
|
+
sendUserMessage: async (content, options) => sendExtensionUserMessage(content, options)
|
|
602
|
+
});
|
|
735
603
|
const runWithReplacementContext = async (callback) => {
|
|
736
604
|
if (callback) await callback(createReplacementContext());
|
|
737
605
|
};
|
|
@@ -873,6 +741,7 @@ async function runTui(opts) {
|
|
|
873
741
|
const busyStates = new Set([
|
|
874
742
|
"sending",
|
|
875
743
|
"waiting",
|
|
744
|
+
"awaiting-input",
|
|
876
745
|
"streaming",
|
|
877
746
|
"running",
|
|
878
747
|
"compacting",
|
|
@@ -957,8 +826,8 @@ async function runTui(opts) {
|
|
|
957
826
|
const refreshModelChoices = async () => {
|
|
958
827
|
try {
|
|
959
828
|
modelChoices = await client.listModels();
|
|
960
|
-
} catch {
|
|
961
|
-
|
|
829
|
+
} catch (error) {
|
|
830
|
+
chatLog.addStatus(`Models unavailable: ${error instanceof Error ? error.message : String(error)}`);
|
|
962
831
|
}
|
|
963
832
|
bottomBar.invalidate();
|
|
964
833
|
tui.requestRender();
|
|
@@ -980,7 +849,11 @@ async function runTui(opts) {
|
|
|
980
849
|
}
|
|
981
850
|
tui.terminal.setProgress(false);
|
|
982
851
|
(async () => {
|
|
983
|
-
|
|
852
|
+
try {
|
|
853
|
+
await client.stop();
|
|
854
|
+
} catch (error) {
|
|
855
|
+
log.warn({ err: error }, "TUI backend shutdown failed");
|
|
856
|
+
}
|
|
984
857
|
await drainAndStopTuiSafely(tui);
|
|
985
858
|
restoreStdio();
|
|
986
859
|
if (options?.showResumeHint !== false) process.stdout.write(`\nTo resume this session: ${formatTuiResumeCommand(opts, state.currentConversationId)}\n`);
|
|
@@ -988,7 +861,7 @@ async function runTui(opts) {
|
|
|
988
861
|
process.exit(0);
|
|
989
862
|
})();
|
|
990
863
|
};
|
|
991
|
-
const { refreshSessionInfo, loadHistory: loadSessionHistory, loadHistoryWindow, setSession: changeSession, abortActive, resetCurrentSession, clearChatForSessionSwitch } = createSessionActions({
|
|
864
|
+
const { refreshSessionInfo, loadHistory: loadSessionHistory, loadHistoryWindow, setSession: changeSession, abortActive, resetCurrentSession, clearChatForSessionSwitch, sessionVersion } = createSessionActions({
|
|
992
865
|
client,
|
|
993
866
|
chatLog,
|
|
994
867
|
tui,
|
|
@@ -1009,6 +882,7 @@ async function runTui(opts) {
|
|
|
1009
882
|
pendingImageAttachments = [];
|
|
1010
883
|
editor.setText("");
|
|
1011
884
|
clearTimeout(composerDraftTimer);
|
|
885
|
+
closeEditorSelector();
|
|
1012
886
|
await changeSession(key);
|
|
1013
887
|
restoreComposerDraft();
|
|
1014
888
|
};
|
|
@@ -1039,7 +913,14 @@ async function runTui(opts) {
|
|
|
1039
913
|
persistCurrentNewSessionContext();
|
|
1040
914
|
};
|
|
1041
915
|
const refreshSessionInfoWithBorder = async () => {
|
|
916
|
+
const conversationId = state.currentConversationId;
|
|
1042
917
|
await refreshSessionInfo();
|
|
918
|
+
try {
|
|
919
|
+
const policy = await client.getInteractionPolicy(conversationId);
|
|
920
|
+
if (conversationId === state.currentConversationId) state.sessionInfo.interactionPolicy = policy;
|
|
921
|
+
} catch (error) {
|
|
922
|
+
if (conversationId === state.currentConversationId) chatLog.addStatus(`Mode unavailable: ${error instanceof Error ? error.message : String(error)}`);
|
|
923
|
+
}
|
|
1043
924
|
updateEditorBorderColor();
|
|
1044
925
|
};
|
|
1045
926
|
const refreshStartupResources = async () => {
|
|
@@ -1199,13 +1080,27 @@ async function runTui(opts) {
|
|
|
1199
1080
|
tui.requestRender();
|
|
1200
1081
|
}
|
|
1201
1082
|
};
|
|
1202
|
-
const copyLastAssistant = async () => {
|
|
1203
|
-
|
|
1083
|
+
const copyLastAssistant = async (mode) => {
|
|
1084
|
+
let text = chatLog.getLastAssistantText().trim();
|
|
1085
|
+
const version = sessionVersion();
|
|
1086
|
+
if (mode && mode !== "code") throw new Error("Usage: /copy [code]");
|
|
1204
1087
|
if (!text) {
|
|
1205
1088
|
chatLog.addSystem("No assistant messages to copy yet.");
|
|
1206
1089
|
tui.requestRender();
|
|
1207
1090
|
return;
|
|
1208
1091
|
}
|
|
1092
|
+
if (mode === "code") {
|
|
1093
|
+
const blocks = [...text.matchAll(/^```([^\n]*)\n([\s\S]*?)^```\s*$/gm)];
|
|
1094
|
+
if (!blocks.length) {
|
|
1095
|
+
chatLog.addStatus("The last answer has no fenced code blocks.");
|
|
1096
|
+
tui.requestRender();
|
|
1097
|
+
return;
|
|
1098
|
+
}
|
|
1099
|
+
const choices = blocks.map((block, index) => `${index + 1}. ${block[1]?.trim() || "code"} · ${block[2]?.trim().split("\n")[0]?.slice(0, 80) ?? ""}`);
|
|
1100
|
+
const selected = await dialogs.choose("Copy code block", choices);
|
|
1101
|
+
if (!selected || version !== sessionVersion()) return;
|
|
1102
|
+
text = blocks[choices.indexOf(selected)][2].replace(/\n$/, "");
|
|
1103
|
+
}
|
|
1209
1104
|
try {
|
|
1210
1105
|
await copyTextToClipboard(text);
|
|
1211
1106
|
chatLog.addStatus(theme.dim("Copied last assistant message to clipboard"));
|
|
@@ -1219,7 +1114,7 @@ async function runTui(opts) {
|
|
|
1219
1114
|
const renameCurrentSession = async (name) => {
|
|
1220
1115
|
const nextName = name.trim();
|
|
1221
1116
|
if (!nextName) {
|
|
1222
|
-
chatLog.addSystem("Usage: /
|
|
1117
|
+
chatLog.addSystem("Usage: /rename <name>");
|
|
1223
1118
|
tui.requestRender();
|
|
1224
1119
|
return;
|
|
1225
1120
|
}
|
|
@@ -1363,37 +1258,6 @@ async function runTui(opts) {
|
|
|
1363
1258
|
tui.requestRender();
|
|
1364
1259
|
}
|
|
1365
1260
|
};
|
|
1366
|
-
const runBtwQuery = async (question) => {
|
|
1367
|
-
const previousStatus = state.activityStatus;
|
|
1368
|
-
const runId = `btw-${randomUUID()}`;
|
|
1369
|
-
try {
|
|
1370
|
-
setActivityStatus("waiting");
|
|
1371
|
-
state.progressMessage = "btw";
|
|
1372
|
-
chatLog.addUser(`/btw ${question}`);
|
|
1373
|
-
chatLog.addStatus(theme.dim("BTW running..."));
|
|
1374
|
-
tui.requestRender();
|
|
1375
|
-
const result = await client.btwQuery(state.currentConversationId, question);
|
|
1376
|
-
if (result.error) {
|
|
1377
|
-
chatLog.addSystem(`BTW failed: ${result.error}`);
|
|
1378
|
-
return;
|
|
1379
|
-
}
|
|
1380
|
-
chatLog.finalizeAssistant({
|
|
1381
|
-
role: "assistant",
|
|
1382
|
-
content: [{
|
|
1383
|
-
type: "text",
|
|
1384
|
-
text: `BTW\n\n${result.text}`
|
|
1385
|
-
}],
|
|
1386
|
-
timestamp: Date.now()
|
|
1387
|
-
}, runId);
|
|
1388
|
-
} catch (err) {
|
|
1389
|
-
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
1390
|
-
chatLog.addSystem(`BTW failed: ${errorMessage}`);
|
|
1391
|
-
} finally {
|
|
1392
|
-
state.activityStatus = previousStatus;
|
|
1393
|
-
renderStatus();
|
|
1394
|
-
tui.requestRender();
|
|
1395
|
-
}
|
|
1396
|
-
};
|
|
1397
1261
|
const forkCurrentSession = async (rawKey) => {
|
|
1398
1262
|
const targetKey = resolveConversationId(rawKey?.trim() || randomUUID());
|
|
1399
1263
|
if (targetKey === state.currentConversationId) {
|
|
@@ -1664,7 +1528,6 @@ async function runTui(opts) {
|
|
|
1664
1528
|
openAgentPicker: () => {},
|
|
1665
1529
|
openReviewLauncher: () => {},
|
|
1666
1530
|
openSessionPicker: () => {},
|
|
1667
|
-
openSessionTree: () => {},
|
|
1668
1531
|
openTimeline: (_initialSearch) => {},
|
|
1669
1532
|
openTranscriptTree: () => {},
|
|
1670
1533
|
openUserMessageFork: () => {},
|
|
@@ -1720,11 +1583,300 @@ async function runTui(opts) {
|
|
|
1720
1583
|
updateHeader();
|
|
1721
1584
|
updateFooter();
|
|
1722
1585
|
};
|
|
1586
|
+
const dialogs = {
|
|
1587
|
+
choose: (title, options) => new Promise((resolveChoice) => {
|
|
1588
|
+
const finish = (value) => {
|
|
1589
|
+
cancelPendingDialog = void 0;
|
|
1590
|
+
closeCommandOverlay();
|
|
1591
|
+
resolveChoice(value);
|
|
1592
|
+
};
|
|
1593
|
+
openCommandOverlay(new ExtensionSelectDialog(title, options, {
|
|
1594
|
+
onSelect: finish,
|
|
1595
|
+
onCancel: () => finish()
|
|
1596
|
+
}, keybindings));
|
|
1597
|
+
cancelPendingDialog = () => finish();
|
|
1598
|
+
tui.requestRender();
|
|
1599
|
+
}),
|
|
1600
|
+
input: (title) => new Promise((resolveInput) => {
|
|
1601
|
+
const finish = (value) => {
|
|
1602
|
+
cancelPendingDialog = void 0;
|
|
1603
|
+
closeCommandOverlay();
|
|
1604
|
+
resolveInput(value);
|
|
1605
|
+
};
|
|
1606
|
+
openCommandOverlay(new ExtensionInputDialog(title, void 0, {
|
|
1607
|
+
onSubmit: finish,
|
|
1608
|
+
onCancel: () => finish()
|
|
1609
|
+
}, keybindings));
|
|
1610
|
+
cancelPendingDialog = () => finish();
|
|
1611
|
+
tui.requestRender();
|
|
1612
|
+
})
|
|
1613
|
+
};
|
|
1614
|
+
let answeringRequest;
|
|
1615
|
+
const showPendingClarification = async () => {
|
|
1616
|
+
const conversationId = state.currentConversationId;
|
|
1617
|
+
try {
|
|
1618
|
+
const request = await client.getClarification(conversationId);
|
|
1619
|
+
if (!request || conversationId !== state.currentConversationId || answeringRequest === request.id) return;
|
|
1620
|
+
answeringRequest = request.id;
|
|
1621
|
+
state.progressMessage = request.kind === "approval" ? "Waiting for approval" : "Waiting for your answer";
|
|
1622
|
+
if (state.activeRunId) setActivityStatus("awaiting-input");
|
|
1623
|
+
try {
|
|
1624
|
+
const command = await collectTuiClarification(request, dialogs);
|
|
1625
|
+
if (conversationId !== state.currentConversationId) return;
|
|
1626
|
+
await client.submitClarification(conversationId, request.id, command);
|
|
1627
|
+
chatLog.addStatus(command.action === "cancel" ? "Question cancelled." : "Response submitted.");
|
|
1628
|
+
} finally {
|
|
1629
|
+
if (answeringRequest === request.id) answeringRequest = void 0;
|
|
1630
|
+
if (conversationId === state.currentConversationId) state.progressMessage = null;
|
|
1631
|
+
}
|
|
1632
|
+
} catch (error) {
|
|
1633
|
+
if (conversationId === state.currentConversationId) chatLog.addSystem(`Question response failed: ${error instanceof Error ? error.message : String(error)}. Use /answer to retry.`);
|
|
1634
|
+
} finally {
|
|
1635
|
+
tui.requestRender();
|
|
1636
|
+
}
|
|
1637
|
+
};
|
|
1638
|
+
const executeControlCommand = createTuiControlCommands({
|
|
1639
|
+
client,
|
|
1640
|
+
state,
|
|
1641
|
+
sessionVersion,
|
|
1642
|
+
choose: dialogs.choose,
|
|
1643
|
+
input: dialogs.input,
|
|
1644
|
+
showText: (title, text, load) => {
|
|
1645
|
+
openCommandOverlay(new TextViewer(title, text, {
|
|
1646
|
+
rows: () => tui.terminal.rows,
|
|
1647
|
+
close: closeCommandOverlay,
|
|
1648
|
+
render: () => tui.requestRender(),
|
|
1649
|
+
keybindings,
|
|
1650
|
+
load
|
|
1651
|
+
}));
|
|
1652
|
+
tui.requestRender();
|
|
1653
|
+
},
|
|
1654
|
+
refresh: () => {
|
|
1655
|
+
updateFooter();
|
|
1656
|
+
tui.requestRender();
|
|
1657
|
+
}
|
|
1658
|
+
});
|
|
1659
|
+
const runSideQuery = createTuiSideChat({
|
|
1660
|
+
client,
|
|
1661
|
+
conversationId: () => state.currentConversationId,
|
|
1662
|
+
sessionVersion,
|
|
1663
|
+
input: dialogs.input,
|
|
1664
|
+
notice: (message) => {
|
|
1665
|
+
chatLog.addStatus(message);
|
|
1666
|
+
tui.requestRender();
|
|
1667
|
+
},
|
|
1668
|
+
stream: (read, cancel) => {
|
|
1669
|
+
openCommandOverlay(new TextViewer("Side chat · Escape cancels", read(), {
|
|
1670
|
+
rows: () => tui.terminal.rows,
|
|
1671
|
+
close: closeCommandOverlay,
|
|
1672
|
+
render: () => tui.requestRender(),
|
|
1673
|
+
keybindings,
|
|
1674
|
+
load: async () => read(),
|
|
1675
|
+
onDispose: cancel,
|
|
1676
|
+
intervalMs: 100
|
|
1677
|
+
}));
|
|
1678
|
+
tui.requestRender();
|
|
1679
|
+
},
|
|
1680
|
+
show: (answer, followUp) => {
|
|
1681
|
+
openCommandOverlay(new TextViewer("Side chat", answer, {
|
|
1682
|
+
rows: () => tui.terminal.rows,
|
|
1683
|
+
close: closeCommandOverlay,
|
|
1684
|
+
render: () => tui.requestRender(),
|
|
1685
|
+
keybindings,
|
|
1686
|
+
reply: followUp
|
|
1687
|
+
}));
|
|
1688
|
+
tui.requestRender();
|
|
1689
|
+
}
|
|
1690
|
+
});
|
|
1691
|
+
const capabilityControls = createCapabilityControls({
|
|
1692
|
+
client,
|
|
1693
|
+
conversationId: () => state.currentConversationId,
|
|
1694
|
+
sessionVersion,
|
|
1695
|
+
...dialogs,
|
|
1696
|
+
show: (title, content) => {
|
|
1697
|
+
openCommandOverlay(new TextViewer(title, content, {
|
|
1698
|
+
rows: () => tui.terminal.rows,
|
|
1699
|
+
close: closeCommandOverlay,
|
|
1700
|
+
render: () => tui.requestRender(),
|
|
1701
|
+
keybindings
|
|
1702
|
+
}));
|
|
1703
|
+
tui.requestRender();
|
|
1704
|
+
}
|
|
1705
|
+
});
|
|
1706
|
+
const runControlCommand = async (name, args) => {
|
|
1707
|
+
const version = sessionVersion();
|
|
1708
|
+
if (name === "mcp" || name === "plugins") {
|
|
1709
|
+
await capabilityControls(name, args);
|
|
1710
|
+
return;
|
|
1711
|
+
}
|
|
1712
|
+
if (name === "cd") {
|
|
1713
|
+
if (!args.trim()) throw new Error("Usage: /cd <workspace-path-on-execution-host>");
|
|
1714
|
+
if (state.activeRunId) throw new Error("Stop the run before changing workspaces.");
|
|
1715
|
+
await client.patchSession(state.currentConversationId, { workingDirectory: args.trim() });
|
|
1716
|
+
if (version === sessionVersion()) await refreshSessionInfoWithBorder();
|
|
1717
|
+
return;
|
|
1718
|
+
}
|
|
1719
|
+
if (name === "worktree") {
|
|
1720
|
+
const [action, ...rest] = args.trim().split(/\s+/);
|
|
1721
|
+
const id = rest.join(" ");
|
|
1722
|
+
const command = action === "create" ? {
|
|
1723
|
+
action: "worktree.create",
|
|
1724
|
+
baseRef: id || "HEAD"
|
|
1725
|
+
} : action === "use" ? {
|
|
1726
|
+
action: "worktree.use",
|
|
1727
|
+
id
|
|
1728
|
+
} : action === "remove" ? {
|
|
1729
|
+
action: "worktree.remove",
|
|
1730
|
+
id
|
|
1731
|
+
} : { action: "worktree.list" };
|
|
1732
|
+
if (action && ![
|
|
1733
|
+
"create",
|
|
1734
|
+
"use",
|
|
1735
|
+
"remove",
|
|
1736
|
+
"list"
|
|
1737
|
+
].includes(action)) throw new Error("Usage: /worktree [list|create [base]|use <id>|remove <id>]");
|
|
1738
|
+
if (command.action !== "worktree.list" && await dialogs.choose(`Apply ${command.action}?`, ["Cancel", "Confirm"]) !== "Confirm") return;
|
|
1739
|
+
if (version !== sessionVersion()) return;
|
|
1740
|
+
const result = await client.manageCapability(state.currentConversationId, command);
|
|
1741
|
+
if (version !== sessionVersion()) return;
|
|
1742
|
+
await refreshSessionInfoWithBorder();
|
|
1743
|
+
openCommandOverlay(new TextViewer("Worktrees", JSON.stringify(result, null, 2), {
|
|
1744
|
+
rows: () => tui.terminal.rows,
|
|
1745
|
+
close: closeCommandOverlay,
|
|
1746
|
+
render: () => tui.requestRender(),
|
|
1747
|
+
keybindings
|
|
1748
|
+
}));
|
|
1749
|
+
tui.requestRender();
|
|
1750
|
+
return;
|
|
1751
|
+
}
|
|
1752
|
+
if (name === "terminal") {
|
|
1753
|
+
if (!args.trim()) throw new Error("Usage: /terminal <job-id>");
|
|
1754
|
+
stdioFilter.pause();
|
|
1755
|
+
try {
|
|
1756
|
+
await withTuiSuspended(tui, () => attachTuiTerminal(client, state.currentConversationId, args.trim()));
|
|
1757
|
+
} finally {
|
|
1758
|
+
stdioFilter.resume();
|
|
1759
|
+
}
|
|
1760
|
+
return;
|
|
1761
|
+
}
|
|
1762
|
+
if (name === "raw") {
|
|
1763
|
+
if (args) throw new Error("Usage: /raw");
|
|
1764
|
+
const raw = await client.exportSession(state.currentConversationId, "json");
|
|
1765
|
+
if (version !== sessionVersion()) return;
|
|
1766
|
+
openCommandOverlay(new TextViewer("Persisted transcript · JSON", raw, {
|
|
1767
|
+
rows: () => tui.terminal.rows,
|
|
1768
|
+
close: closeCommandOverlay,
|
|
1769
|
+
render: () => tui.requestRender(),
|
|
1770
|
+
keybindings
|
|
1771
|
+
}));
|
|
1772
|
+
tui.requestRender();
|
|
1773
|
+
return;
|
|
1774
|
+
}
|
|
1775
|
+
if (name === "search") {
|
|
1776
|
+
const query = args.trim() || await dialogs.input("Search this conversation");
|
|
1777
|
+
if (!query || version !== sessionVersion()) return;
|
|
1778
|
+
const matches = await client.searchHistory(state.currentConversationId, query);
|
|
1779
|
+
if (version !== sessionVersion()) return;
|
|
1780
|
+
if (!matches.length) return "No transcript matches.";
|
|
1781
|
+
const labels = matches.map((match) => `Row ${match.rowNumber} [${match.role}] ${match.preview}`);
|
|
1782
|
+
const selected = await dialogs.choose("Transcript matches", labels);
|
|
1783
|
+
const match = matches[labels.indexOf(selected ?? "")];
|
|
1784
|
+
if (match && version === sessionVersion()) await loadHistoryWindow({
|
|
1785
|
+
rowNumber: match.rowNumber,
|
|
1786
|
+
before: 20,
|
|
1787
|
+
after: 40
|
|
1788
|
+
});
|
|
1789
|
+
return;
|
|
1790
|
+
}
|
|
1791
|
+
if (name === "archived") {
|
|
1792
|
+
const items = await client.listSessions({ archived: true });
|
|
1793
|
+
if (version !== sessionVersion()) return;
|
|
1794
|
+
const labels = items.map((item) => `${item.displayName ?? item.key} · ${item.key}`);
|
|
1795
|
+
const selected = await dialogs.choose("Archived conversations", labels);
|
|
1796
|
+
const item = items[labels.indexOf(selected ?? "")];
|
|
1797
|
+
if (!item || version !== sessionVersion()) return;
|
|
1798
|
+
const action = await dialogs.choose("Archived conversation", ["Read transcript", "Restore and continue"]);
|
|
1799
|
+
if (!action || version !== sessionVersion()) return;
|
|
1800
|
+
if (action === "Restore and continue") {
|
|
1801
|
+
await client.restoreSession(item.key);
|
|
1802
|
+
if (version === sessionVersion()) await setSession(item.key);
|
|
1803
|
+
} else {
|
|
1804
|
+
const transcript = await client.exportSession(item.key, "json");
|
|
1805
|
+
if (version === sessionVersion()) {
|
|
1806
|
+
openCommandOverlay(new TextViewer("Archived transcript", transcript, {
|
|
1807
|
+
rows: () => tui.terminal.rows,
|
|
1808
|
+
close: closeCommandOverlay,
|
|
1809
|
+
render: () => tui.requestRender(),
|
|
1810
|
+
keybindings
|
|
1811
|
+
}));
|
|
1812
|
+
tui.requestRender();
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
return;
|
|
1816
|
+
}
|
|
1817
|
+
if (name === "answer") {
|
|
1818
|
+
await showPendingClarification();
|
|
1819
|
+
return;
|
|
1820
|
+
}
|
|
1821
|
+
if (name === "attach") {
|
|
1822
|
+
if (!args.trim()) throw new Error("Usage: /attach <local-image-path>");
|
|
1823
|
+
if (pendingImageAttachments.length >= 10) throw new Error("Attachment limit reached.");
|
|
1824
|
+
const attachments = await readTuiImageFiles([args.trim()]);
|
|
1825
|
+
if (version !== sessionVersion()) return;
|
|
1826
|
+
if (pendingImageAttachments.length + attachments.length > 10) throw new Error("Attachment limit reached.");
|
|
1827
|
+
pendingImageAttachments.push(...attachments);
|
|
1828
|
+
saveComposerDraft();
|
|
1829
|
+
updateFooter();
|
|
1830
|
+
return `Attached local image: ${attachments[0].name}. /attachments to inspect or remove.`;
|
|
1831
|
+
}
|
|
1832
|
+
if (name === "archive" || name === "delete") {
|
|
1833
|
+
const conversationId = state.currentConversationId;
|
|
1834
|
+
const choice = await dialogs.choose(name === "archive" ? "Archive this conversation? Its transcript will be kept." : "Permanently delete this conversation and its transcript?", ["Cancel", name === "archive" ? "Archive" : "Delete permanently"]);
|
|
1835
|
+
if (!choice || choice === "Cancel" || version !== sessionVersion()) return;
|
|
1836
|
+
await abortActive({ clearUi: false });
|
|
1837
|
+
if (version !== sessionVersion()) return;
|
|
1838
|
+
for (const job of await client.listJobs(conversationId)) if (job.status === "running") await client.stopJob(conversationId, job.id);
|
|
1839
|
+
for (const child of await client.listSubagents(conversationId)) if (child.status === "running") await client.stopSubagent(conversationId, child.id);
|
|
1840
|
+
if (name === "archive") await client.archiveSession(conversationId);
|
|
1841
|
+
else if (!(await client.deleteSession(conversationId)).ok) throw new Error("Deletion was not confirmed.");
|
|
1842
|
+
if (version !== sessionVersion()) return;
|
|
1843
|
+
await startPreferredNewSession();
|
|
1844
|
+
return name === "archive" ? "Conversation archived." : "Conversation deleted.";
|
|
1845
|
+
}
|
|
1846
|
+
if (name === "pwd") return `Workspace (${isLocalMode ? "local" : client.connectionLabel}): ${state.sessionInfo.effectiveWorkspacePath ?? "unavailable"}`;
|
|
1847
|
+
if (name === "skills") {
|
|
1848
|
+
const conversationId = state.currentConversationId;
|
|
1849
|
+
const items = await client.listCapabilities(conversationId, name);
|
|
1850
|
+
if (version !== sessionVersion()) return;
|
|
1851
|
+
if (!items.length) return `No ${name} available in this workspace.`;
|
|
1852
|
+
if (name === "skills") {
|
|
1853
|
+
const enabled = items.filter((item) => item.state === "enabled");
|
|
1854
|
+
const selected = await dialogs.choose("Skills", enabled.map((item) => `${item.id} — ${item.description}`));
|
|
1855
|
+
const item = enabled.find((candidate) => `${candidate.id} — ${candidate.description}` === selected);
|
|
1856
|
+
if (item && version === sessionVersion()) editor.setText(`/skill:${item.id} ${editor.getText()}`);
|
|
1857
|
+
return;
|
|
1858
|
+
}
|
|
1859
|
+
return items.map((item) => `${item.id} [${item.state}]${item.description ? ` — ${item.description}` : ""}`).join("\n");
|
|
1860
|
+
}
|
|
1861
|
+
if (name === "attachments") {
|
|
1862
|
+
if (args === "clear") pendingImageAttachments = [];
|
|
1863
|
+
else if (args) {
|
|
1864
|
+
const number = Number(args);
|
|
1865
|
+
if (!Number.isSafeInteger(number) || number < 1 || number > pendingImageAttachments.length) throw new Error("Usage: /attachments [clear|number]");
|
|
1866
|
+
pendingImageAttachments.splice(number - 1, 1);
|
|
1867
|
+
}
|
|
1868
|
+
saveComposerDraft();
|
|
1869
|
+
updateFooter();
|
|
1870
|
+
return pendingImageAttachments.length ? pendingImageAttachments.map((item, index) => `${index + 1}. ${item.name ?? item.type}`).join("\n") + "\n/attachments <number> removes one · /attachments clear removes all" : "No pending attachments.";
|
|
1871
|
+
}
|
|
1872
|
+
return executeControlCommand(name, args);
|
|
1873
|
+
};
|
|
1723
1874
|
const handleCommand = createTuiCommandHandler({
|
|
1724
1875
|
state,
|
|
1725
1876
|
chatLog,
|
|
1726
1877
|
tui,
|
|
1727
1878
|
isLocalMode,
|
|
1879
|
+
runControlCommand,
|
|
1728
1880
|
abortActive,
|
|
1729
1881
|
sendMessage,
|
|
1730
1882
|
requestExit,
|
|
@@ -1754,7 +1906,7 @@ async function runTui(opts) {
|
|
|
1754
1906
|
exportSession: exportCurrentSession,
|
|
1755
1907
|
importSession: importSessionExport,
|
|
1756
1908
|
createShare: createShareLink,
|
|
1757
|
-
|
|
1909
|
+
runSideQuery,
|
|
1758
1910
|
forkSession: forkCurrentSession,
|
|
1759
1911
|
extensionSlashCommands: extensionRuntime.slashCommands,
|
|
1760
1912
|
skillSlashCommands,
|
|
@@ -1790,6 +1942,20 @@ async function runTui(opts) {
|
|
|
1790
1942
|
}
|
|
1791
1943
|
});
|
|
1792
1944
|
const { runLocalShellLine } = createLocalShellRunner({
|
|
1945
|
+
prepareCommand: async (command, cwd) => {
|
|
1946
|
+
const policy = await client.getInteractionPolicy(state.currentConversationId);
|
|
1947
|
+
const readOnly = policy.mode === "plan" || policy.access === "read-only";
|
|
1948
|
+
const launch = {
|
|
1949
|
+
executable: command,
|
|
1950
|
+
args: [],
|
|
1951
|
+
shell: true
|
|
1952
|
+
};
|
|
1953
|
+
return readOnly || policy.sandbox === "workspace-write" ? sandboxCommand(launch, {
|
|
1954
|
+
access: readOnly ? "read-only" : "workspace-write",
|
|
1955
|
+
network: policy.network === true,
|
|
1956
|
+
workspace: cwd
|
|
1957
|
+
}) : launch;
|
|
1958
|
+
},
|
|
1793
1959
|
chatLog,
|
|
1794
1960
|
tui,
|
|
1795
1961
|
editor,
|
|
@@ -1802,6 +1968,7 @@ async function runTui(opts) {
|
|
|
1802
1968
|
},
|
|
1803
1969
|
keybindings,
|
|
1804
1970
|
getCwd: () => {
|
|
1971
|
+
if (!isLocalMode) return process.cwd();
|
|
1805
1972
|
const workspace = state.sessionInfo.effectiveWorkspacePath?.trim();
|
|
1806
1973
|
if (!workspace) throw new Error("Workspace is not loaded yet.");
|
|
1807
1974
|
return workspace;
|
|
@@ -1932,6 +2099,7 @@ async function runTui(opts) {
|
|
|
1932
2099
|
submitBurst(text);
|
|
1933
2100
|
};
|
|
1934
2101
|
const setConversationId = (key) => {
|
|
2102
|
+
closeEditorSelector();
|
|
1935
2103
|
state.currentConversationId = resolveConversationId(key);
|
|
1936
2104
|
composerHistory.switchSession();
|
|
1937
2105
|
state.chatInputState = createEmptyChatInputState(state.currentConversationId);
|
|
@@ -2016,15 +2184,20 @@ async function runTui(opts) {
|
|
|
2016
2184
|
},
|
|
2017
2185
|
keybindings
|
|
2018
2186
|
};
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
uiOverlays.
|
|
2026
|
-
uiOverlays.
|
|
2027
|
-
uiOverlays.
|
|
2187
|
+
const openPicker = (work) => {
|
|
2188
|
+
work.catch((error) => {
|
|
2189
|
+
chatLog.addSystem(`Picker unavailable: ${error instanceof Error ? error.message : String(error)}`);
|
|
2190
|
+
tui.requestRender();
|
|
2191
|
+
});
|
|
2192
|
+
};
|
|
2193
|
+
uiOverlays.openModelPicker = (initialSearch) => openPicker(openModelPickerOverlay(pickerSvc, initialSearch));
|
|
2194
|
+
uiOverlays.openAgentPicker = () => openPicker(openAgentPickerOverlay(pickerSvc));
|
|
2195
|
+
uiOverlays.openReviewLauncher = () => openPicker(openReviewLauncherOverlay(pickerSvc));
|
|
2196
|
+
uiOverlays.openSessionPicker = () => openPicker(openSessionPickerOverlay(pickerSvc));
|
|
2197
|
+
uiOverlays.openTimeline = (initialSearch) => openPicker(openTimelineOverlay(pickerSvc, initialSearch));
|
|
2198
|
+
uiOverlays.openTranscriptTree = () => openPicker(openTranscriptTreeOverlay(pickerSvc));
|
|
2199
|
+
uiOverlays.openUserMessageFork = () => openPicker(openUserMessageForkOverlay(pickerSvc));
|
|
2200
|
+
uiOverlays.openScopedModels = () => openPicker(openScopedModelsOverlay(pickerSvc));
|
|
2028
2201
|
uiOverlays.openThinkingSelector = () => openThinkingSelectorOverlay(pickerSvc);
|
|
2029
2202
|
uiOverlays.openSettings = () => openSettingsOverlay(pickerSvc);
|
|
2030
2203
|
uiOverlays.openProjectTrust = () => openProjectTrustOverlay(pickerSvc);
|
|
@@ -2049,7 +2222,10 @@ async function runTui(opts) {
|
|
|
2049
2222
|
return;
|
|
2050
2223
|
}
|
|
2051
2224
|
if (state.activeRunId) {
|
|
2052
|
-
abortActive()
|
|
2225
|
+
abortActive().catch((error) => {
|
|
2226
|
+
chatLog.addSystem(`Stop not confirmed: ${error instanceof Error ? error.message : String(error)}`);
|
|
2227
|
+
tui.requestRender();
|
|
2228
|
+
});
|
|
2053
2229
|
return;
|
|
2054
2230
|
}
|
|
2055
2231
|
if (editor.getText().trim().length > 0) return;
|
|
@@ -2062,6 +2238,35 @@ async function runTui(opts) {
|
|
|
2062
2238
|
state.lastEscapeAt = now;
|
|
2063
2239
|
};
|
|
2064
2240
|
defaultEditor.onCtrlD = () => requestExit();
|
|
2241
|
+
defaultEditor.onAction("app.mode.cycle", () => {
|
|
2242
|
+
runControlCommand("plan", "").then((message) => {
|
|
2243
|
+
if (message) chatLog.addStatus(message);
|
|
2244
|
+
}).catch((error) => chatLog.addSystem(`Mode change failed: ${error instanceof Error ? error.message : String(error)}`)).finally(() => tui.requestRender());
|
|
2245
|
+
});
|
|
2246
|
+
defaultEditor.onAction("app.response.copy", () => {
|
|
2247
|
+
copyLastAssistant();
|
|
2248
|
+
});
|
|
2249
|
+
defaultEditor.onAction("app.view.clear", () => {
|
|
2250
|
+
chatLog.clearAll();
|
|
2251
|
+
tui.requestRender();
|
|
2252
|
+
});
|
|
2253
|
+
defaultEditor.onAction("app.history.search", () => {
|
|
2254
|
+
const conversationId = state.currentConversationId;
|
|
2255
|
+
const entries = [...new Set(composerHistoryTexts)];
|
|
2256
|
+
const list = new SearchableSelectList(entries.map((text, index) => ({
|
|
2257
|
+
value: String(index),
|
|
2258
|
+
label: text,
|
|
2259
|
+
description: ""
|
|
2260
|
+
})), 10, searchableSelectListTheme);
|
|
2261
|
+
list.onSelect = (item) => {
|
|
2262
|
+
closeCommandOverlay();
|
|
2263
|
+
if (conversationId === state.currentConversationId) editor.setText(entries[Number(item.value)] ?? "");
|
|
2264
|
+
tui.requestRender();
|
|
2265
|
+
};
|
|
2266
|
+
list.onCancel = closeCommandOverlay;
|
|
2267
|
+
openCommandOverlay(list);
|
|
2268
|
+
tui.requestRender();
|
|
2269
|
+
});
|
|
2065
2270
|
defaultEditor.onAction("app.clear", handleCtrlC);
|
|
2066
2271
|
defaultEditor.onAction("app.exit", () => requestExit());
|
|
2067
2272
|
defaultEditor.onAction("app.suspend", handleCtrlZ);
|
|
@@ -2071,7 +2276,7 @@ async function runTui(opts) {
|
|
|
2071
2276
|
defaultEditor.onAction("app.model.cycleForward", () => cycleModel("forward"));
|
|
2072
2277
|
defaultEditor.onAction("app.model.cycleBackward", () => cycleModel("backward"));
|
|
2073
2278
|
defaultEditor.onAction("app.model.select", () => uiOverlays.openModelPicker());
|
|
2074
|
-
defaultEditor.onAction("app.session.resume", () =>
|
|
2279
|
+
defaultEditor.onAction("app.session.resume", () => uiOverlays.openSessionPicker());
|
|
2075
2280
|
defaultEditor.onAction("app.session.tree", showSessionTree);
|
|
2076
2281
|
defaultEditor.onAction("app.session.fork", () => uiOverlays.openUserMessageFork());
|
|
2077
2282
|
defaultEditor.onAction("app.tools.expand", () => {
|
|
@@ -2210,6 +2415,8 @@ async function runTui(opts) {
|
|
|
2210
2415
|
};
|
|
2211
2416
|
client.onEvent = (evt) => {
|
|
2212
2417
|
const data = evt.data ?? {};
|
|
2418
|
+
if (typeof data.conversationId === "string" && data.conversationId !== state.currentConversationId) return;
|
|
2419
|
+
if (evt.event === "clarify_request") showPendingClarification();
|
|
2213
2420
|
if (evt.event === "session.input-state") {
|
|
2214
2421
|
if (data.conversationId === state.currentConversationId && Array.isArray(data.inputs) && typeof data.revision === "number") applyChatInputState(data);
|
|
2215
2422
|
return;
|
|
@@ -2280,6 +2487,7 @@ async function runTui(opts) {
|
|
|
2280
2487
|
} catch {}
|
|
2281
2488
|
await refreshModelChoices();
|
|
2282
2489
|
await loadSessionHistory({ merge: true });
|
|
2490
|
+
showPendingClarification();
|
|
2283
2491
|
showStartupCardOnce();
|
|
2284
2492
|
refreshStartupResources().then(() => {
|
|
2285
2493
|
updateFooter();
|
|
@@ -2293,7 +2501,10 @@ async function runTui(opts) {
|
|
|
2293
2501
|
state.autoMessageSent = true;
|
|
2294
2502
|
sendMessage(opts.message);
|
|
2295
2503
|
}
|
|
2296
|
-
})()
|
|
2504
|
+
})().catch((error) => {
|
|
2505
|
+
chatLog.addSystem(`Session initialization failed: ${error instanceof Error ? error.message : String(error)}. Use /recover to retry.`);
|
|
2506
|
+
tui.requestRender();
|
|
2507
|
+
});
|
|
2297
2508
|
};
|
|
2298
2509
|
client.onDisconnected = (reason) => {
|
|
2299
2510
|
const wasConnected = state.isConnected;
|