@organizaone/o1-code 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -66
- package/bundled/qc-helper/docs/overview.md +4 -2
- package/bundled/qc-helper/docs/quickstart.md +8 -11
- package/bundled/qc-helper/docs/support/troubleshooting.md +3 -2
- package/bundled/qc-helper/docs/support/uninstall.md +8 -9
- package/chunks/{MaxSizedBox-WEGNKLVL.js → MaxSizedBox-V73WHA3L.js} +20 -20
- package/chunks/{StandaloneSessionPicker-4SCNXVX7.js → StandaloneSessionPicker-FTDPOEPX.js} +33 -33
- package/chunks/{acp-subagent-executor-VRHBVWBU.js → acp-subagent-executor-VVRNVUN6.js} +23 -23
- package/chunks/{acpAgent-FDKZZ3QM.js → acpAgent-Q4ZW2T2V.js} +60 -60
- package/chunks/{agent-KPM7H4IR.js → agent-GBQJCUDW.js} +10 -10
- package/chunks/{agent-headless-COFRGNNG.js → agent-headless-EOYUGYXK.js} +10 -10
- package/chunks/{anthropicContentGenerator-WEOOSPUN.js → anthropicContentGenerator-PTW3PJN2.js} +4 -4
- package/chunks/{bridge-FDFIFP2N.js → bridge-HA6VKBU3.js} +23 -23
- package/chunks/{chunk-Q7KKIU77.js → chunk-2AWC3WGL.js} +1 -1
- package/chunks/{chunk-AB5FTBJJ.js → chunk-2PXHYHTF.js} +1 -1
- package/chunks/{chunk-5F24EX2I.js → chunk-2TEE2CP4.js} +1 -1
- package/chunks/{chunk-ADO5YDRJ.js → chunk-2TVYS6EJ.js} +4 -4
- package/chunks/{chunk-GNSGGVHR.js → chunk-2X4UQI7O.js} +4 -4
- package/chunks/{chunk-XUTSRWU5.js → chunk-3ZDJLLN3.js} +1 -1
- package/chunks/{chunk-UYGL4XMJ.js → chunk-4ADSMIZN.js} +1 -1
- package/chunks/{chunk-B2JXWCRM.js → chunk-4GBOSJAY.js} +1 -1
- package/chunks/{chunk-DKZXODGO.js → chunk-4GMFMS2A.js} +1 -1
- package/chunks/{chunk-6S6CWEUT.js → chunk-4MP5VB2E.js} +3 -3
- package/chunks/{chunk-ZSPC4CHD.js → chunk-4NVUBXS2.js} +1 -1
- package/chunks/{chunk-T5JTRGNV.js → chunk-4WXTBRBS.js} +5 -5
- package/chunks/{chunk-EPYI3UCJ.js → chunk-52CAXV44.js} +3 -3
- package/chunks/{chunk-M6CUSGKA.js → chunk-5FRGB77D.js} +1 -1
- package/chunks/{chunk-AUMAZUBC.js → chunk-72HJ3I44.js} +4 -4
- package/chunks/{chunk-DDXMQUSB.js → chunk-752ACE23.js} +5 -5
- package/chunks/{chunk-6E66ZJ37.js → chunk-75BJCYVJ.js} +3 -3
- package/chunks/{chunk-BVU26CFN.js → chunk-ALVKYQEP.js} +29 -29
- package/chunks/{chunk-FWZ3QSHF.js → chunk-BDZMDPWU.js} +1 -1
- package/chunks/{chunk-NOA2J4VU.js → chunk-BNZD466Q.js} +3 -3
- package/chunks/{chunk-ECMBM2OW.js → chunk-BXY7MVTK.js} +6 -6
- package/chunks/{chunk-PKQET2TC.js → chunk-C5HYIIJH.js} +2 -2
- package/chunks/{chunk-5YMCKKL5.js → chunk-CL35K5LE.js} +2 -2
- package/chunks/{chunk-TTNKBZEE.js → chunk-CXT46I2S.js} +9 -9
- package/chunks/{chunk-ELXMHBCO.js → chunk-DA2G3AZ5.js} +4 -4
- package/chunks/{chunk-RHVMG6BA.js → chunk-DF74KSMK.js} +9 -9
- package/chunks/{chunk-S34RPNHW.js → chunk-DS5FODU7.js} +4 -4
- package/chunks/{chunk-S6E2LTCY.js → chunk-E6ATIAX3.js} +5 -5
- package/chunks/{chunk-HGHV2B6G.js → chunk-EE3FFILZ.js} +3 -3
- package/chunks/{chunk-RBAWURS2.js → chunk-F2IZCZRC.js} +2 -2
- package/chunks/{chunk-CUWDRCPR.js → chunk-FGVEPCDK.js} +29 -29
- package/chunks/{chunk-B7WOFSQS.js → chunk-FJBLYNZI.js} +3 -3
- package/chunks/{chunk-KSGEEUJR.js → chunk-G3GTYPEZ.js} +1 -1
- package/chunks/{chunk-4QFLAXJU.js → chunk-GGTPGIIC.js} +1 -1
- package/chunks/{chunk-HRFTPOLT.js → chunk-GMOM6IVG.js} +1 -1
- package/chunks/{chunk-7TKZJNS5.js → chunk-H3MGVX2X.js} +3 -3
- package/chunks/{chunk-Q3DGR6GC.js → chunk-H6QMOC36.js} +3 -3
- package/chunks/{chunk-Y6IARWMF.js → chunk-HKASQQYC.js} +3 -3
- package/chunks/{chunk-M4BDKWTG.js → chunk-HLJJOIU5.js} +2 -2
- package/chunks/{chunk-DXBPN44F.js → chunk-ICL5K33X.js} +4 -4
- package/chunks/{chunk-3VHTTB5R.js → chunk-IF2FN2EW.js} +1 -1
- package/chunks/{chunk-PASE2AQF.js → chunk-IGKMRYKE.js} +1 -1
- package/chunks/{chunk-G6NKZHWP.js → chunk-IMUVMGXA.js} +1 -1
- package/chunks/{chunk-VWC2FHDE.js → chunk-KM4VFJWU.js} +1 -1
- package/chunks/{chunk-UNKO3IU2.js → chunk-KMEKGSLT.js} +2 -2
- package/chunks/{chunk-MFLTVOGC.js → chunk-KW4M3XCZ.js} +2 -2
- package/chunks/{chunk-YJPY2GIU.js → chunk-MA24QZMF.js} +5 -5
- package/chunks/{chunk-Z4EQO6GM.js → chunk-MB6SYQBV.js} +1 -1
- package/chunks/{chunk-NHV3HEO4.js → chunk-MLVHTMF6.js} +4 -4
- package/chunks/{chunk-F2HHQCUM.js → chunk-MSFTFIG2.js} +2 -2
- package/chunks/{chunk-PFC5CVEQ.js → chunk-NEDFDKY7.js} +4 -4
- package/chunks/{chunk-SOZPQY6I.js → chunk-NG66G3A4.js} +1 -1
- package/chunks/{chunk-3DRGCENB.js → chunk-NWA3LR74.js} +1 -1
- package/chunks/{chunk-SX7BD3AB.js → chunk-O3RLVPVQ.js} +2 -2
- package/chunks/{chunk-U27EOPXJ.js → chunk-PFUZY3U7.js} +3 -3
- package/chunks/{chunk-PFWZNM27.js → chunk-PRI34PWO.js} +1 -1
- package/chunks/{chunk-SV46GH4L.js → chunk-PRLOFLAQ.js} +1 -1
- package/chunks/{chunk-DXYYJGO7.js → chunk-Q6QQD2YF.js} +1 -1
- package/chunks/{chunk-VTC7MRH5.js → chunk-QIRRSETU.js} +3 -3
- package/chunks/{chunk-RNZRMDVJ.js → chunk-QIXODDVO.js} +1 -1
- package/chunks/{chunk-FHSKLGAG.js → chunk-RCVVSO52.js} +3 -3
- package/chunks/{chunk-5HRRVZIB.js → chunk-RFVTGDNU.js} +3 -3
- package/chunks/{chunk-TX7X63N2.js → chunk-RPQ4TIHM.js} +1 -1
- package/chunks/{chunk-XO65CJOC.js → chunk-RXDOMWT2.js} +7 -7
- package/chunks/{chunk-KTIXQNNK.js → chunk-SVWSVVKU.js} +5 -5
- package/chunks/{chunk-HPHTX437.js → chunk-UB5OHFWY.js} +3 -3
- package/chunks/{chunk-MLCV6EQF.js → chunk-UNVZJ2IX.js} +1 -1
- package/chunks/{chunk-XL252RHK.js → chunk-UQFND4FQ.js} +10 -10
- package/chunks/{chunk-UIMQDVBY.js → chunk-V67HPWC5.js} +1 -1
- package/chunks/{chunk-MKPOB6HB.js → chunk-VRIGHAU6.js} +1 -1
- package/chunks/{chunk-PED2JB7U.js → chunk-W3A6FNTW.js} +3 -3
- package/chunks/{chunk-WQ7DJ7P2.js → chunk-W57V4GR4.js} +13 -13
- package/chunks/{chunk-A3MS2MH5.js → chunk-WEWUIGBV.js} +1 -1
- package/chunks/{chunk-F2K7SLXP.js → chunk-WNMZOGMZ.js} +7 -7
- package/chunks/{chunk-NLAV7ALI.js → chunk-WQCZQWDE.js} +1 -1
- package/chunks/{chunk-SEKKSZBU.js → chunk-WQGG3JTV.js} +1 -1
- package/chunks/{chunk-UU7YW743.js → chunk-XPLSFA6Z.js} +39 -19
- package/chunks/{chunk-43BQTFOH.js → chunk-XYIWNRIS.js} +1 -1
- package/chunks/{chunk-LIRGFHFR.js → chunk-Y6GS7FJE.js} +3 -3
- package/chunks/{chunk-ZAI372KQ.js → chunk-YOIBS52G.js} +2 -2
- package/chunks/{chunk-J2IZLZWN.js → chunk-YWAMOB6V.js} +4 -4
- package/chunks/{chunk-4NP4LYO2.js → chunk-YWP7LG4W.js} +49 -49
- package/chunks/{chunk-ONMU73H3.js → chunk-YXWTKPHK.js} +1 -1
- package/chunks/{chunk-W7X2E7OV.js → chunk-Z3XETWT6.js} +1 -1
- package/chunks/{chunk-EXBPWMAH.js → chunk-ZJYPSOBM.js} +3 -3
- package/chunks/{chunk-65TBUV3M.js → chunk-ZWOP66WW.js} +2 -2
- package/chunks/{codex-subagent-executor-MHGTEEYD.js → codex-subagent-executor-TVPPN655.js} +23 -23
- package/chunks/{contextCommand-SXJWOSN4.js → contextCommand-VLH5U6NN.js} +21 -21
- package/chunks/{core-runtime-QJROIYD7.js → core-runtime-TEBBEX7L.js} +20 -20
- package/chunks/{create-sub-session-EQPPC3IY.js → create-sub-session-VU4ZLM72.js} +21 -21
- package/chunks/{daemon-git-worktree-guard-5V2MBRQD.js → daemon-git-worktree-guard-C5QP7PCU.js} +20 -20
- package/chunks/{daemon-status-provider-SL67WSGN.js → daemon-status-provider-4VIY3HJ5.js} +28 -28
- package/chunks/{daemon-trust-policy-I7ZRNYIW.js → daemon-trust-policy-WAFROOXL.js} +25 -25
- package/chunks/{daemon-trust-policy-monitor-GQ26YGQQ.js → daemon-trust-policy-monitor-QO5RNX4F.js} +25 -25
- package/chunks/{deferred-core-runtime-O7U7PMEW.js → deferred-core-runtime-US2X2TSA.js} +20 -20
- package/chunks/{edit-BC56IBFB.js → edit-MFVBXC46.js} +12 -12
- package/chunks/{enterPlanMode-ZYQIKNOW.js → enterPlanMode-4KSAZCP4.js} +10 -10
- package/chunks/{environment-BCLZ4SOR.js → environment-ARK3AP5K.js} +22 -22
- package/chunks/{errors-X7ABUPZE.js → errors-EP7F3SDZ.js} +22 -22
- package/chunks/{execution-tool-54SJJVGY.js → execution-tool-TETOFNXW.js} +12 -12
- package/chunks/{execution-worker-NH5ZETLU.js → execution-worker-KG2IWAIR.js} +15 -15
- package/chunks/{exitPlanMode-UCTC24R3.js → exitPlanMode-V3GV5WG5.js} +10 -10
- package/chunks/{fast-path-TZCRTZTB.js → fast-path-CPASDXSX.js} +2 -2
- package/chunks/{glob-J4GPDBGA.js → glob-HYH7QGDU.js} +10 -10
- package/chunks/{goal-tools-LJ6RRQXU.js → goal-tools-ZI2C5QDC.js} +10 -10
- package/chunks/{handleAutoUpdate-DD7LEKQW.js → handleAutoUpdate-NJUJCLJH.js} +22 -22
- package/chunks/{i18n-HI5JUXZ5.js → i18n-BZTTMOBV.js} +20 -20
- package/chunks/{initializer-PZQU4RAR.js → initializer-X6VLRRJ6.js} +25 -25
- package/chunks/{installationInfo-JOZYCXXG.js → installationInfo-MVMIXHPQ.js} +20 -20
- package/chunks/{list-G5IQCQI7.js → list-3VDXHUJD.js} +27 -27
- package/chunks/{llm-V6VMXKL7.js → llm-EJ26UDUT.js} +51 -51
- package/chunks/{llm-content-generator-W7TJYNA7.js → llm-content-generator-E3WAIAZS.js} +3 -3
- package/chunks/{loadedSettingsAdapter-UB5WFLBD.js → loadedSettingsAdapter-WNWZXREY.js} +25 -25
- package/chunks/{local-execution-environment-SJGR6GX6.js → local-execution-environment-FOCXJ4ON.js} +15 -15
- package/chunks/{loggingContentGenerator-DLVRF2GS.js → loggingContentGenerator-NHJMUX5Z.js} +11 -11
- package/chunks/{managed-npm-update-I6ZFAFUP.js → managed-npm-update-6RMNFVD5.js} +20 -20
- package/chunks/{mcp-BFH7DS3Q.js → mcp-AB4AAG6B.js} +25 -25
- package/chunks/{model-call-collection-HO4BM2LR.js → model-call-collection-BNFZLO6L.js} +1 -1
- package/chunks/{model-configuration-ETNJJBYI.js → model-configuration-XYTNKKMB.js} +26 -26
- package/chunks/{modelConfigUtils-DVVI23PC.js → modelConfigUtils-WT2ABPC5.js} +22 -22
- package/chunks/{monitor-VL5LTFK2.js → monitor-PZIN2OWB.js} +10 -10
- package/chunks/{nonInteractiveCli-FPYKW567.js → nonInteractiveCli-7IGU7YYX.js} +50 -50
- package/chunks/{nonInteractiveToolExecutor-SOYFBVYX.js → nonInteractiveToolExecutor-DE6AOKSD.js} +11 -11
- package/chunks/{notebook-edit-ZGMJ6KXA.js → notebook-edit-YD636F6G.js} +11 -11
- package/chunks/{omni-LR6CFWUA.js → omni-6IG5C3VK.js} +8 -8
- package/chunks/{openaiContentGenerator-IVHZAWPV.js → openaiContentGenerator-MVIH4NAI.js} +6 -6
- package/chunks/{openaiResponsesContentGenerator-PEISTQI6.js → openaiResponsesContentGenerator-4XSNRRX2.js} +3 -3
- package/chunks/{processUtils-VRBU5GOJ.js → processUtils-AZK3LDTF.js} +2 -2
- package/chunks/{prompt-terminal-ledger-ED7SXRQJ.js → prompt-terminal-ledger-OPZETIYM.js} +21 -21
- package/chunks/{reactive-degrade-GCQ5HPYQ.js → reactive-degrade-SJ6ORTGN.js} +7 -7
- package/chunks/{read-file-DC3GDX5G.js → read-file-ADBQNZGS.js} +2 -2
- package/chunks/{resumeHistoryUtils-5SJHHP2W.js → resumeHistoryUtils-FW4AZHA4.js} +21 -21
- package/chunks/{ripGrep-AHJBSIRQ.js → ripGrep-SQXXHC7O.js} +3 -3
- package/chunks/{run-o1-code-serve-BPH6QA4R.js → run-o1-code-serve-FEUD6TQT.js} +32 -32
- package/chunks/{sandboxConfig-XLDUYNU4.js → sandboxConfig-2IUK55F4.js} +20 -20
- package/chunks/{scheduled-tasks-ER6PDIBR.js → scheduled-tasks-AEZTYJRL.js} +26 -26
- package/chunks/{scheduler-K3PCPK4Y.js → scheduler-JSW4BQQT.js} +22 -22
- package/chunks/{serve-I66K4TOS.js → serve-4E4FNN2Z.js} +25 -25
- package/chunks/{server-PAHRULB2.js → server-7IA2ELA4.js} +53 -53
- package/chunks/{session-KDLDVVM7.js → session-TMTS5KDD.js} +51 -51
- package/chunks/{session-attachments-root-KVABOICM.js → session-attachments-root-PQAEMYZC.js} +20 -20
- package/chunks/{session-pr-refresh-NMEYXVUI.js → session-pr-refresh-YMHERG3N.js} +25 -25
- package/chunks/{settings-HDU7NBPB.js → settings-RJ3JXS2H.js} +24 -24
- package/chunks/{shell-2VPUN34H.js → shell-J4MUL2K5.js} +10 -10
- package/chunks/{skill-A3LKS233.js → skill-IFJT5A5Q.js} +3 -3
- package/chunks/{skill-settings-Y2IK2AEL.js → skill-settings-XSBDZQ4P.js} +25 -25
- package/chunks/{spawnChannel-NK4USCZX.js → spawnChannel-3YRAHZYC.js} +22 -22
- package/chunks/{standalone-update-Q6B72WRP.js → standalone-update-TAPIQGCS.js} +21 -21
- package/chunks/{startInteractiveUI-Z3KYLNUN.js → startInteractiveUI-A5E2XZDS.js} +891 -836
- package/chunks/{team-create-FG4KQ2LL.js → team-create-LQQF7SHV.js} +10 -10
- package/chunks/{team-plan-approval-T2AGXV5W.js → team-plan-approval-RPZK4IUT.js} +10 -10
- package/chunks/{terminal-image-renderer-ED2FNSLU.js → terminal-image-renderer-W7CDT6WT.js} +20 -20
- package/chunks/{theme-manager-4BJB3REJ.js → theme-manager-5YX645BD.js} +20 -20
- package/chunks/{tool-result-media-QZQCKGVI.js → tool-result-media-FX2LTMCF.js} +8 -8
- package/chunks/{tool-search-HOLJTBRU.js → tool-search-IZCJTIH4.js} +2 -2
- package/chunks/{total-session-admission-SC4DLNEV.js → total-session-admission-6PICEJXD.js} +23 -23
- package/chunks/{trustedFolders-H5DLDBKQ.js → trustedFolders-5S2UMQON.js} +21 -21
- package/chunks/{update-relaunch-WWGG5DZP.js → update-relaunch-FD66JHGR.js} +5 -5
- package/chunks/{updateCheck-YEXYDKY7.js → updateCheck-2EIG5IUN.js} +20 -20
- package/chunks/{upload-config-ODXSZ2II.js → upload-config-NDKI6DAB.js} +5 -5
- package/chunks/{useAutoAcceptIndicator-HXGUOFGU.js → useAutoAcceptIndicator-B7Y4WMST.js} +27 -27
- package/chunks/{validateNonInterActiveAuth-UHFL2ETY.js → validateNonInterActiveAuth-O3MGKE7Q.js} +48 -48
- package/chunks/{version-ARPWPNBL.js → version-XCWZM57S.js} +1 -1
- package/chunks/{web-fetch-RBRCUTLV.js → web-fetch-EQO2O2VQ.js} +2 -2
- package/chunks/{web-search-WPLDQALT.js → web-search-Q5EEHHVM.js} +6 -6
- package/chunks/{workflow-PXKDJYMD.js → workflow-22KQDI75.js} +11 -11
- package/chunks/{workspace-providers-status-P4INQ23W.js → workspace-providers-status-Q6X4XUYQ.js} +31 -31
- package/chunks/{workspace-registration-store-PVCW3QCZ.js → workspace-registration-store-CNAVIECG.js} +1 -1
- package/chunks/{workspace-registry-ZFYHC7U6.js → workspace-registry-HKNRFBFC.js} +23 -23
- package/chunks/{workspace-runtime-coordinator-7EUILGDF.js → workspace-runtime-coordinator-FXUIMXJM.js} +24 -24
- package/chunks/{workspace-service-4OPPAAGC.js → workspace-service-SOZF52CR.js} +28 -28
- package/chunks/{workspace-skills-status-DVWOMNFX.js → workspace-skills-status-UHFUOJ6A.js} +28 -28
- package/chunks/{workspace-trust-reconciler-DKVNDLKU.js → workspace-trust-reconciler-ZHT6NLS7.js} +28 -28
- package/chunks/{write-file-TE3ID46B.js → write-file-VB37UMJ3.js} +12 -12
- package/chunks/{zoom-image-FFI3MSNB.js → zoom-image-VAFGD3HT.js} +2 -2
- package/cli.js +12 -12
- package/execution-worker.js +1 -1
- package/export-transcript-document.js +1 -1
- package/package.json +2 -2
- package/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/vendor/ripgrep/arm64-linux/rg +0 -0
- package/vendor/ripgrep/x64-darwin/rg +0 -0
- package/vendor/ripgrep/x64-linux/rg +0 -0
- package/vendor/tree-sitter/tree-sitter-bash.wasm +0 -0
- package/vendor/tree-sitter/tree-sitter.wasm +0 -0
- package/web-shell/assets/{abnfDiagram-VCTEODGH-BFLfPnWT.js → abnfDiagram-VCTEODGH-B5Ke_KA5.js} +1 -1
- package/web-shell/assets/{arc-BymsNVok.js → arc-B1qynd1m.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-DI-3RWbZ.js → architectureDiagram-5GKGNRK7-Bo2Og8So.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-KhSV6m_8.js → blockDiagram-NRAW4CY4-kalc7i2S.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-DOepG-aZ.js → c4Diagram-UCG6FXSJ-oX7qDAy5.js} +1 -1
- package/web-shell/assets/channel-B-Ry6wUm.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-DPVdjFDg.js → chunk-2Q5K7J3B-CdsvFoWz.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-Nnge1oqS.js → chunk-5VM5RSS4-h6a94_sB.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-BmDpSlLm.js → chunk-F27PBJKO-CEwYaABr.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-DVHxpj9S.js → chunk-G27WJ6UU-yEWrtz51.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-CDKY6Fmz.js → chunk-JWPE2WC7-CNt8svY0.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-IsNKy22T.js → chunk-LCL6LL3I-CO8h8N4s.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-BqhuB9i-.js → chunk-POPQ4Y6H--97nZCs4.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-Bn56fJkm.js → chunk-SVP7TREG-CrBqH_0p.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-D5srSYOc.js → chunk-XXDRQBXY-DYBwZlEC.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-D_sONtS4.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-D_sONtS4.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-0jfa9as_.js → cose-bilkent-JH36ORCC-BI6cg4Nw.js} +1 -1
- package/web-shell/assets/{cynefin-OW5HDTMX-BmZ_vulB.js → cynefin-OW5HDTMX-DWsVe9_U.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-Dq_70ydo.js → cynefinDiagram-5FMLGOSQ-DAxM2E5v.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-IadmOrzg.js → dagre-3AP2YEHR-Csd4TrEZ.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-BihggcdS.js → diagram-S7CK7UJ4-CZ6KoFvv.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-0Hm67HSx.js → diagram-UQ7AKVKN-C_zSZZrU.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-CiHa3uK3.js → diagram-VSXAHHWV-D21OQ6jJ.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-D3EbXpMK.js → diagram-VX7I27RA-Bh8doGDX.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-CVZdlI2K.js → diagram-Z3DM3KII-ycuZhkFW.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-Bh1PubWM.js → ebnfDiagram-PWID7BFC-dP4KzRYn.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-R0CdkT3b.js → erDiagram-SSCWMZ5O-DoRwOt_Y.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-fpxiU9Qr.js → flowDiagram-A5DVABFB-Bs_Q8wlJ.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-CjxWTs1r.js → ganttDiagram-EL5Y4UJY-CW2vcPYN.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-q0OxO5mS.js → gitGraphDiagram-WWUBYQGX-DZ2UuoGO.js} +1 -1
- package/web-shell/assets/{index-_LyFUzZh.js → index-btdIWcPL.js} +1 -1
- package/web-shell/assets/{index-BPKiTm_r.js → index-dZaziiFt.js} +3 -3
- package/web-shell/assets/{infoDiagram-RXCK75RN-Bi34qIls.js → infoDiagram-RXCK75RN-DjwP-C9t.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-CG7Se6Jg.js → ishikawaDiagram-5VMMS53U-CzlNr5A6.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-Cf0vulzk.js → journeyDiagram-EYS64GPL-BxI_Odzn.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-C_4yX9xf.js → kanban-definition-3QL26DDD-CIXIFlN5.js} +1 -1
- package/web-shell/assets/{layout-BSk990pn.js → layout-zhMMoLb5.js} +1 -1
- package/web-shell/assets/{linear-CtkMZ_Z2.js → linear-DlmiiwPB.js} +1 -1
- package/web-shell/assets/{mermaid.core-CUaQQfyz.js → mermaid.core-DG4XCyc-.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-3HwSHDLt.js → mindmap-definition-FBJOCRG2-CPdP5QyM.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-WArQOlNM.js → pegDiagram-XKGWAZYB-TTLkUBQq.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-AtQN4WwB.js → pieDiagram-E7YTZNPT-CHMG5WAd.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-Dv8-1nqt.js → quadrantDiagram-AXDQQJYC-B6v717XG.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-BJ5MnGvm.js → railroadDiagram-O6MQD6OU-7REF-aZC.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-CIfVdUd5.js → requirementDiagram-EFPCY7ZU-BjFz3Hm4.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-BELxFY2x.js → sankeyDiagram-P5KCCOFB-Lk_RCjBf.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-Bwj8-sku.js → sequenceDiagram-WJ2MYXX4-DivlUEQF.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-UYKI0kqH.js → sizeCapture-X5ZJPWSS-286tElfp.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-CqWdrsTd.js → stateDiagram-HBIQ2CUA-BdRjq5u2.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-Def1pisf.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-DWW1oh-R.js → swimlanes-XN3QIQJK-BluwdYxC.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-BeMgzclT.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-CvAdvix0.js → timeline-definition-24CTP7MA-rcFET3EF.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-Bv87oeFs.js → vennDiagram-4TSXK5OY-CT4_CP7r.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-C_GDHDeD.js → wardleyDiagram-VM6X3IG4-BqO1UfYm.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-D1wslvix.js → xychartDiagram-S5SC5T6Z-DCvzC9lc.js} +1 -1
- package/web-shell/index.html +1 -1
- package/web-shell/sw.js +1 -1
- package/web-shell/assets/channel-CdSVAoYO.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-CVCSQb-C.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-CVCSQb-C.js +0 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-CUFA4utz.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Bx12nX_J.js +0 -8
|
@@ -5,19 +5,19 @@ import {
|
|
|
5
5
|
} from "./chunk-CPURT2SU.js";
|
|
6
6
|
import {
|
|
7
7
|
startPostRenderPrefetches
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UQFND4FQ.js";
|
|
9
9
|
import {
|
|
10
10
|
stopAndGetCapturedInput
|
|
11
11
|
} from "./chunk-VFLUNXD6.js";
|
|
12
12
|
import {
|
|
13
13
|
useAutoAcceptIndicator
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-3ZDJLLN3.js";
|
|
15
15
|
import {
|
|
16
16
|
MAX_ACCEPTED_BACKLOG,
|
|
17
17
|
PeerMessaging,
|
|
18
18
|
classifyApiError,
|
|
19
19
|
fireSessionDeleteHook
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-GGTPGIIC.js";
|
|
21
21
|
import {
|
|
22
22
|
TUI_CHAT_RECORDING_FAILURE_MESSAGE,
|
|
23
23
|
reportChatRecordingFailureToAdapter
|
|
@@ -34,10 +34,10 @@ import {
|
|
|
34
34
|
normalizeDescription,
|
|
35
35
|
normalizePartList,
|
|
36
36
|
resolveAtCommandQuery
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-WNMZOGMZ.js";
|
|
38
38
|
import {
|
|
39
39
|
StreamJsonOutputAdapter
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-MLVHTMF6.js";
|
|
41
41
|
import {
|
|
42
42
|
BuiltinCommandLoader,
|
|
43
43
|
BundledSkillLoader,
|
|
@@ -90,14 +90,14 @@ import {
|
|
|
90
90
|
resolveOutputStyleChoice,
|
|
91
91
|
serializeUserPromptExpansionPrompt,
|
|
92
92
|
supportsMatchers
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-ALVKYQEP.js";
|
|
94
94
|
import {
|
|
95
95
|
EXTENSION_RELOAD_FAILED_REASON,
|
|
96
96
|
ExtensionRefreshState,
|
|
97
97
|
appEvents,
|
|
98
98
|
cleanupReviewWorktreeLeases,
|
|
99
99
|
loadHierarchicalMemory
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-FGVEPCDK.js";
|
|
101
101
|
import {
|
|
102
102
|
disableKittyProtocol,
|
|
103
103
|
isKittyProtocolEnabled,
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
} from "./chunk-AYSIXE44.js";
|
|
107
107
|
import {
|
|
108
108
|
sanitizeDisplayText
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-2TVYS6EJ.js";
|
|
110
110
|
import {
|
|
111
111
|
AboutBox,
|
|
112
112
|
BaseSelectionList,
|
|
@@ -202,13 +202,13 @@ import {
|
|
|
202
202
|
useUIActions,
|
|
203
203
|
useUIState,
|
|
204
204
|
useVirtualViewport
|
|
205
|
-
} from "./chunk-
|
|
205
|
+
} from "./chunk-XPLSFA6Z.js";
|
|
206
206
|
import {
|
|
207
207
|
KeypressProvider,
|
|
208
208
|
useFocus,
|
|
209
209
|
useKeypress,
|
|
210
210
|
useKeypressContext
|
|
211
|
-
} from "./chunk-
|
|
211
|
+
} from "./chunk-CL35K5LE.js";
|
|
212
212
|
import {
|
|
213
213
|
BRAND,
|
|
214
214
|
MAX_EXTENSION_OWNER_LABEL_WIDTH,
|
|
@@ -217,7 +217,7 @@ import {
|
|
|
217
217
|
getCommandSourceBadge,
|
|
218
218
|
repoDocUrl,
|
|
219
219
|
skillOriginLabel
|
|
220
|
-
} from "./chunk-
|
|
220
|
+
} from "./chunk-FJBLYNZI.js";
|
|
221
221
|
import {
|
|
222
222
|
BEL,
|
|
223
223
|
OSC_PREFIX,
|
|
@@ -230,7 +230,7 @@ import {
|
|
|
230
230
|
oscKittyNotify,
|
|
231
231
|
saveClipboardImage,
|
|
232
232
|
writeOsc52
|
|
233
|
-
} from "./chunk-
|
|
233
|
+
} from "./chunk-WQCZQWDE.js";
|
|
234
234
|
import "./chunk-AHKE26WU.js";
|
|
235
235
|
import {
|
|
236
236
|
MaxSizedBox,
|
|
@@ -256,7 +256,7 @@ import {
|
|
|
256
256
|
shouldDisplayGoalStateCause,
|
|
257
257
|
useStreamingContext,
|
|
258
258
|
waitForGoalRuntime
|
|
259
|
-
} from "./chunk-
|
|
259
|
+
} from "./chunk-ZJYPSOBM.js";
|
|
260
260
|
import {
|
|
261
261
|
contextUsageLabel,
|
|
262
262
|
formatDuration,
|
|
@@ -296,11 +296,11 @@ import {
|
|
|
296
296
|
} from "./chunk-KIN34HCU.js";
|
|
297
297
|
import {
|
|
298
298
|
setUpdateHandler
|
|
299
|
-
} from "./chunk-
|
|
299
|
+
} from "./chunk-G3GTYPEZ.js";
|
|
300
300
|
import {
|
|
301
301
|
isHistoryItemVisibleAfterRestore
|
|
302
302
|
} from "./chunk-64WBFX5X.js";
|
|
303
|
-
import "./chunk-
|
|
303
|
+
import "./chunk-F2IZCZRC.js";
|
|
304
304
|
import {
|
|
305
305
|
AUTO_THEME_NAME,
|
|
306
306
|
DEFAULT_THEME,
|
|
@@ -313,29 +313,29 @@ import {
|
|
|
313
313
|
import {
|
|
314
314
|
requestConsentInteractive,
|
|
315
315
|
requestConsentOrFail
|
|
316
|
-
} from "./chunk-
|
|
316
|
+
} from "./chunk-YWAMOB6V.js";
|
|
317
317
|
import "./chunk-XZ3MQL2U.js";
|
|
318
318
|
import {
|
|
319
319
|
relaunchApp
|
|
320
|
-
} from "./chunk-
|
|
320
|
+
} from "./chunk-WEWUIGBV.js";
|
|
321
321
|
import "./chunk-XG36NMOI.js";
|
|
322
322
|
import "./chunk-7QM44EGU.js";
|
|
323
323
|
import "./chunk-YNJSBU2B.js";
|
|
324
324
|
import "./chunk-CI53XHRQ.js";
|
|
325
|
-
import "./chunk-
|
|
325
|
+
import "./chunk-XYIWNRIS.js";
|
|
326
326
|
import "./chunk-K5SPVYI4.js";
|
|
327
327
|
import "./chunk-KD7GIK2D.js";
|
|
328
|
-
import "./chunk-
|
|
328
|
+
import "./chunk-H6QMOC36.js";
|
|
329
329
|
import "./chunk-LXUIOY3M.js";
|
|
330
330
|
import {
|
|
331
331
|
getErrorMessage as getErrorMessage2
|
|
332
|
-
} from "./chunk-
|
|
332
|
+
} from "./chunk-H3MGVX2X.js";
|
|
333
333
|
import {
|
|
334
334
|
openDashScopeAsrRealtimeStream,
|
|
335
335
|
openVoiceStream,
|
|
336
336
|
openVoiceStreamWithRetry
|
|
337
337
|
} from "./chunk-MTSHGY6F.js";
|
|
338
|
-
import "./chunk-
|
|
338
|
+
import "./chunk-DF74KSMK.js";
|
|
339
339
|
import "./chunk-LL7XM3LM.js";
|
|
340
340
|
import {
|
|
341
341
|
cpLen,
|
|
@@ -360,7 +360,7 @@ import {
|
|
|
360
360
|
isStreamingVoiceModel,
|
|
361
361
|
resolveVoiceStreamConfig,
|
|
362
362
|
transcribeVoiceAudio
|
|
363
|
-
} from "./chunk-
|
|
363
|
+
} from "./chunk-4GMFMS2A.js";
|
|
364
364
|
import {
|
|
365
365
|
formatUnsupportedVoiceModelMessage,
|
|
366
366
|
isSelectableVoiceModel
|
|
@@ -373,8 +373,8 @@ import {
|
|
|
373
373
|
} from "./chunk-KQCQCJBL.js";
|
|
374
374
|
import {
|
|
375
375
|
getExtendedSystemInfo
|
|
376
|
-
} from "./chunk-
|
|
377
|
-
import "./chunk-
|
|
376
|
+
} from "./chunk-HKASQQYC.js";
|
|
377
|
+
import "./chunk-HLJJOIU5.js";
|
|
378
378
|
import "./chunk-LPCPB2S5.js";
|
|
379
379
|
import "./chunk-LD2T7YET.js";
|
|
380
380
|
import "./chunk-QTAUA6ED.js";
|
|
@@ -383,26 +383,26 @@ import "./chunk-W3YES77O.js";
|
|
|
383
383
|
import {
|
|
384
384
|
getReasoningEffortsForConfig,
|
|
385
385
|
getReasoningForDisplay
|
|
386
|
-
} from "./chunk-
|
|
387
|
-
import "./chunk-
|
|
388
|
-
import "./chunk-
|
|
386
|
+
} from "./chunk-52CAXV44.js";
|
|
387
|
+
import "./chunk-VRIGHAU6.js";
|
|
388
|
+
import "./chunk-DS5FODU7.js";
|
|
389
389
|
import {
|
|
390
390
|
isInlineModelOverrideAllowed
|
|
391
|
-
} from "./chunk-
|
|
391
|
+
} from "./chunk-YOIBS52G.js";
|
|
392
392
|
import {
|
|
393
393
|
buildHigherDisabled,
|
|
394
394
|
computeWorkspaceSkillListUpdates,
|
|
395
395
|
skillSettingStrings
|
|
396
|
-
} from "./chunk-
|
|
396
|
+
} from "./chunk-UNVZJ2IX.js";
|
|
397
397
|
import {
|
|
398
398
|
loadMcpApprovals
|
|
399
|
-
} from "./chunk-
|
|
399
|
+
} from "./chunk-4WXTBRBS.js";
|
|
400
400
|
import "./chunk-U4T5CWGD.js";
|
|
401
401
|
import "./chunk-PHTNY4JK.js";
|
|
402
402
|
import {
|
|
403
403
|
createLoadedSettingsAdapter,
|
|
404
404
|
getRawModelProviders
|
|
405
|
-
} from "./chunk-
|
|
405
|
+
} from "./chunk-ICL5K33X.js";
|
|
406
406
|
import {
|
|
407
407
|
CORRUPTED_SUFFIX,
|
|
408
408
|
SettingScope,
|
|
@@ -425,7 +425,7 @@ import {
|
|
|
425
425
|
settingExistsInScope,
|
|
426
426
|
validateSettingValue,
|
|
427
427
|
writeOutputLanguageAndRegisterPath
|
|
428
|
-
} from "./chunk-
|
|
428
|
+
} from "./chunk-DA2G3AZ5.js";
|
|
429
429
|
import "./chunk-EDRKBK4B.js";
|
|
430
430
|
import {
|
|
431
431
|
LOGO_ANIMATIONS,
|
|
@@ -436,7 +436,7 @@ import {
|
|
|
436
436
|
pickLogoAnimation,
|
|
437
437
|
renderLogoRows,
|
|
438
438
|
restFrame
|
|
439
|
-
} from "./chunk-
|
|
439
|
+
} from "./chunk-4MP5VB2E.js";
|
|
440
440
|
import "./chunk-2JJLDP4A.js";
|
|
441
441
|
import {
|
|
442
442
|
getCurrentLanguage,
|
|
@@ -445,21 +445,21 @@ import {
|
|
|
445
445
|
ta
|
|
446
446
|
} from "./chunk-CCT46CLM.js";
|
|
447
447
|
import "./chunk-Q2V34OV7.js";
|
|
448
|
-
import "./chunk-
|
|
448
|
+
import "./chunk-4NVUBXS2.js";
|
|
449
449
|
import "./chunk-7N5GDAXK.js";
|
|
450
450
|
import "./chunk-JVJT5UI7.js";
|
|
451
451
|
import "./chunk-FMWE3YMM.js";
|
|
452
452
|
import {
|
|
453
453
|
formatVersionLabel,
|
|
454
454
|
getCliVersion
|
|
455
|
-
} from "./chunk-
|
|
455
|
+
} from "./chunk-YXWTKPHK.js";
|
|
456
456
|
import "./chunk-HQ5DN5W7.js";
|
|
457
457
|
import "./chunk-FRITN2AG.js";
|
|
458
458
|
import "./chunk-F4S6U26O.js";
|
|
459
459
|
import {
|
|
460
460
|
isWorkspaceTrusted,
|
|
461
461
|
loadTrustedFolders
|
|
462
|
-
} from "./chunk-
|
|
462
|
+
} from "./chunk-NG66G3A4.js";
|
|
463
463
|
import "./chunk-BHXBXELA.js";
|
|
464
464
|
import "./chunk-MXCWSDSC.js";
|
|
465
465
|
import {
|
|
@@ -500,12 +500,12 @@ import {
|
|
|
500
500
|
subagentGenerator,
|
|
501
501
|
supportsHyperlinks,
|
|
502
502
|
wrapForMultiplexer
|
|
503
|
-
} from "./chunk-
|
|
503
|
+
} from "./chunk-NEDFDKY7.js";
|
|
504
504
|
import "./chunk-MYMATZAY.js";
|
|
505
505
|
import "./chunk-6IFQXZTP.js";
|
|
506
506
|
import "./chunk-CJ7JDQEG.js";
|
|
507
507
|
import "./chunk-YO3SEHXM.js";
|
|
508
|
-
import "./chunk-
|
|
508
|
+
import "./chunk-5FRGB77D.js";
|
|
509
509
|
import "./chunk-P7UNPKJM.js";
|
|
510
510
|
import {
|
|
511
511
|
clearWorktreeSession,
|
|
@@ -513,7 +513,7 @@ import {
|
|
|
513
513
|
readWorktreeSession,
|
|
514
514
|
restoreWorktreeContext
|
|
515
515
|
} from "./chunk-KXN7Q6SB.js";
|
|
516
|
-
import "./chunk-
|
|
516
|
+
import "./chunk-RCVVSO52.js";
|
|
517
517
|
import "./chunk-YIEC5SIW.js";
|
|
518
518
|
import "./chunk-4JDEAIW5.js";
|
|
519
519
|
import {
|
|
@@ -523,8 +523,8 @@ import {
|
|
|
523
523
|
describeHoldCause,
|
|
524
524
|
parseHeldExpiry
|
|
525
525
|
} from "./chunk-TIYFDYIF.js";
|
|
526
|
-
import "./chunk-
|
|
527
|
-
import "./chunk-
|
|
526
|
+
import "./chunk-E6ATIAX3.js";
|
|
527
|
+
import "./chunk-4GBOSJAY.js";
|
|
528
528
|
import "./chunk-NWCDFCWK.js";
|
|
529
529
|
import "./chunk-ZMZRVR62.js";
|
|
530
530
|
import {
|
|
@@ -532,19 +532,19 @@ import {
|
|
|
532
532
|
isToolHiddenBehindToolSearch,
|
|
533
533
|
resolveWorkflowAuthoringSurface,
|
|
534
534
|
toolSearchBridgeSentence
|
|
535
|
-
} from "./chunk-
|
|
535
|
+
} from "./chunk-2X4UQI7O.js";
|
|
536
536
|
import "./chunk-AQVYFR7E.js";
|
|
537
|
-
import "./chunk-
|
|
538
|
-
import "./chunk-
|
|
537
|
+
import "./chunk-PRI34PWO.js";
|
|
538
|
+
import "./chunk-RFVTGDNU.js";
|
|
539
539
|
import "./chunk-F3FKDGHN.js";
|
|
540
|
-
import "./chunk-
|
|
540
|
+
import "./chunk-RPQ4TIHM.js";
|
|
541
541
|
import "./chunk-UBWL27PO.js";
|
|
542
542
|
import "./chunk-BWRP5ZMP.js";
|
|
543
543
|
import "./chunk-DM6W2QYB.js";
|
|
544
544
|
import "./chunk-UAACCQBD.js";
|
|
545
545
|
import "./chunk-GVWQRVLV.js";
|
|
546
546
|
import "./chunk-2QYMJSSC.js";
|
|
547
|
-
import "./chunk-
|
|
547
|
+
import "./chunk-Q6QQD2YF.js";
|
|
548
548
|
import "./chunk-AVCUVYSA.js";
|
|
549
549
|
import {
|
|
550
550
|
ConditionalRulesRegistry,
|
|
@@ -610,7 +610,7 @@ import {
|
|
|
610
610
|
saveWorkflowScript,
|
|
611
611
|
validateWorkflowName,
|
|
612
612
|
watchRepoBranch
|
|
613
|
-
} from "./chunk-
|
|
613
|
+
} from "./chunk-YWP7LG4W.js";
|
|
614
614
|
import "./chunk-FNALBCC7.js";
|
|
615
615
|
import "./chunk-BZOAEOYF.js";
|
|
616
616
|
import "./chunk-BIDB75DA.js";
|
|
@@ -636,7 +636,7 @@ import {
|
|
|
636
636
|
elapsedActiveTime,
|
|
637
637
|
goalPauseReasonForFailure,
|
|
638
638
|
goalRequiresExactPermit
|
|
639
|
-
} from "./chunk-
|
|
639
|
+
} from "./chunk-BDZMDPWU.js";
|
|
640
640
|
import "./chunk-GLYO25OO.js";
|
|
641
641
|
import {
|
|
642
642
|
GitWorktreeService,
|
|
@@ -651,7 +651,7 @@ import "./chunk-OI7IVUEO.js";
|
|
|
651
651
|
import "./chunk-DS3COGEF.js";
|
|
652
652
|
import {
|
|
653
653
|
resolveModelId
|
|
654
|
-
} from "./chunk-
|
|
654
|
+
} from "./chunk-4ADSMIZN.js";
|
|
655
655
|
import {
|
|
656
656
|
glob
|
|
657
657
|
} from "./chunk-OBPGYMIV.js";
|
|
@@ -680,9 +680,9 @@ import "./chunk-GUMLL5KC.js";
|
|
|
680
680
|
import "./chunk-HPQNI3OQ.js";
|
|
681
681
|
import "./chunk-3XCL57IX.js";
|
|
682
682
|
import "./chunk-YCZXGP63.js";
|
|
683
|
-
import "./chunk-
|
|
683
|
+
import "./chunk-QIXODDVO.js";
|
|
684
684
|
import "./chunk-CI2ZHR5C.js";
|
|
685
|
-
import "./chunk-
|
|
685
|
+
import "./chunk-NWA3LR74.js";
|
|
686
686
|
import "./chunk-ZFZB6WC5.js";
|
|
687
687
|
import "./chunk-4J6KRUQB.js";
|
|
688
688
|
import "./chunk-QFQQICSQ.js";
|
|
@@ -702,7 +702,7 @@ import {
|
|
|
702
702
|
} from "./chunk-IO32UWHY.js";
|
|
703
703
|
import "./chunk-OSMXNPJP.js";
|
|
704
704
|
import "./chunk-HX6AICAX.js";
|
|
705
|
-
import "./chunk-
|
|
705
|
+
import "./chunk-Y6GS7FJE.js";
|
|
706
706
|
import {
|
|
707
707
|
runOutsideAgentContext
|
|
708
708
|
} from "./chunk-PPR5SHEF.js";
|
|
@@ -712,7 +712,7 @@ import "./chunk-65B6QBMP.js";
|
|
|
712
712
|
import "./chunk-4OCNSFYL.js";
|
|
713
713
|
import "./chunk-O4IWNFDK.js";
|
|
714
714
|
import "./chunk-NGE3GHMN.js";
|
|
715
|
-
import "./chunk-
|
|
715
|
+
import "./chunk-2AWC3WGL.js";
|
|
716
716
|
import "./chunk-WMJL2XAM.js";
|
|
717
717
|
import "./chunk-CP63SY5N.js";
|
|
718
718
|
import {
|
|
@@ -736,7 +736,7 @@ import {
|
|
|
736
736
|
resolveBaseUrl,
|
|
737
737
|
resolveSavedModelApiKey,
|
|
738
738
|
shouldShowStep
|
|
739
|
-
} from "./chunk-
|
|
739
|
+
} from "./chunk-IF2FN2EW.js";
|
|
740
740
|
import "./chunk-POHJY7RJ.js";
|
|
741
741
|
import {
|
|
742
742
|
ApiCancelEvent,
|
|
@@ -776,7 +776,7 @@ import {
|
|
|
776
776
|
runVisionBridge,
|
|
777
777
|
shouldRunVisionBridge,
|
|
778
778
|
splitImageParts
|
|
779
|
-
} from "./chunk-
|
|
779
|
+
} from "./chunk-2TEE2CP4.js";
|
|
780
780
|
import "./chunk-242JUBPM.js";
|
|
781
781
|
import {
|
|
782
782
|
DEFAULT_CONTEXT_FILENAME,
|
|
@@ -810,7 +810,7 @@ import {
|
|
|
810
810
|
MAINLINE_CODER_MODEL,
|
|
811
811
|
REASONING_EFFORT_TIERS,
|
|
812
812
|
applyReasoningEffort
|
|
813
|
-
} from "./chunk-
|
|
813
|
+
} from "./chunk-752ACE23.js";
|
|
814
814
|
import "./chunk-PLWOHBC7.js";
|
|
815
815
|
import "./chunk-LEXKU5FI.js";
|
|
816
816
|
import "./chunk-IQEM74QW.js";
|
|
@@ -865,7 +865,7 @@ import {
|
|
|
865
865
|
import "./chunk-EPSJPAHV.js";
|
|
866
866
|
import "./chunk-HBBBH6YA.js";
|
|
867
867
|
import "./chunk-HHIX6THS.js";
|
|
868
|
-
import "./chunk-
|
|
868
|
+
import "./chunk-2PXHYHTF.js";
|
|
869
869
|
import "./chunk-LPFK3TO2.js";
|
|
870
870
|
import {
|
|
871
871
|
finalizeStartupProfile,
|
|
@@ -875,7 +875,7 @@ import "./chunk-H7HA2YLC.js";
|
|
|
875
875
|
import {
|
|
876
876
|
registerCleanup,
|
|
877
877
|
runExitCleanup
|
|
878
|
-
} from "./chunk-
|
|
878
|
+
} from "./chunk-IMUVMGXA.js";
|
|
879
879
|
import {
|
|
880
880
|
clearScreen,
|
|
881
881
|
writeStderrLine,
|
|
@@ -909,7 +909,7 @@ import {
|
|
|
909
909
|
init_esbuild_shims();
|
|
910
910
|
import { stat as stat2 } from "node:fs/promises";
|
|
911
911
|
import { basename as basename4 } from "node:path";
|
|
912
|
-
var
|
|
912
|
+
var import_react174 = __toESM(require_react(), 1);
|
|
913
913
|
|
|
914
914
|
// packages/cli/src/peerMessaging/PeerMessagingContext.tsx
|
|
915
915
|
init_esbuild_shims();
|
|
@@ -1555,7 +1555,7 @@ var useRemoteInput = /* @__PURE__ */ __name(() => (0, import_react3.useContext)(
|
|
|
1555
1555
|
|
|
1556
1556
|
// packages/cli/src/ui/AppContainer.tsx
|
|
1557
1557
|
init_esbuild_shims();
|
|
1558
|
-
var
|
|
1558
|
+
var import_react172 = __toESM(require_react(), 1);
|
|
1559
1559
|
|
|
1560
1560
|
// packages/cli/src/ui/App.tsx
|
|
1561
1561
|
init_esbuild_shims();
|
|
@@ -1744,6 +1744,139 @@ var UpdateNotification = /* @__PURE__ */ __name(({ message }) => /* @__PURE__ */
|
|
|
1744
1744
|
init_esbuild_shims();
|
|
1745
1745
|
var import_react22 = __toESM(require_react(), 1);
|
|
1746
1746
|
|
|
1747
|
+
// packages/cli/src/ui/utils/turn-marker.ts
|
|
1748
|
+
init_esbuild_shims();
|
|
1749
|
+
|
|
1750
|
+
// packages/cli/src/ui/utils/historyUtils.ts
|
|
1751
|
+
init_esbuild_shims();
|
|
1752
|
+
function isSyntheticHistoryItem(item) {
|
|
1753
|
+
switch (item.type) {
|
|
1754
|
+
// Synthetic: system-generated notices that don't represent meaningful
|
|
1755
|
+
// model output or user action. Safe to wipe on auto-restore.
|
|
1756
|
+
//
|
|
1757
|
+
// `gemini_thought` / `gemini_thought_content` are deliberately
|
|
1758
|
+
// CLASSIFIED AS SYNTHETIC even though they're visible to the user:
|
|
1759
|
+
// (1) Claude Code's auto-restore behavior treats <thinking> output
|
|
1760
|
+
// identically — auto-restore fires when the model emitted thoughts
|
|
1761
|
+
// but no real `gemini_content` (i.e. the model was still reasoning
|
|
1762
|
+
// when the user cancelled);
|
|
1763
|
+
// (2) Promoting thoughts to MEANINGFUL would block restore on every
|
|
1764
|
+
// cancel-during-thinking case, which is exactly the case where
|
|
1765
|
+
// restore is most valuable (user wanted to abandon the in-flight
|
|
1766
|
+
// turn before any committed text). The user can still see the
|
|
1767
|
+
// thoughts in scrollback if the terminal preserves them; the
|
|
1768
|
+
// restore only affects the next ↑-history pull and prompt buffer.
|
|
1769
|
+
case "info":
|
|
1770
|
+
case "error":
|
|
1771
|
+
case "warning":
|
|
1772
|
+
case "success":
|
|
1773
|
+
case "retry_countdown":
|
|
1774
|
+
case "vision_notice":
|
|
1775
|
+
case "notification":
|
|
1776
|
+
case "tool_use_summary":
|
|
1777
|
+
case "gemini_thought":
|
|
1778
|
+
case "gemini_thought_content":
|
|
1779
|
+
case "away_recap":
|
|
1780
|
+
case "insight_progress":
|
|
1781
|
+
case "user_prompt_submit_blocked":
|
|
1782
|
+
case "stop_hook_loop":
|
|
1783
|
+
case "stop_hook_system_message":
|
|
1784
|
+
return true;
|
|
1785
|
+
// Steer messages (mid-turn user injections) are typed 'user' but
|
|
1786
|
+
// carry sentToModel === false; treat them as synthetic so the
|
|
1787
|
+
// cancel handler can still do a full rewind when only a steer
|
|
1788
|
+
// follows the real prompt.
|
|
1789
|
+
case "user":
|
|
1790
|
+
return item.sentToModel === false;
|
|
1791
|
+
// Meaningful: user input, model text, tool runs, slash-command
|
|
1792
|
+
// results the user explicitly asked for. Auto-restore must bail
|
|
1793
|
+
// when any of these appear after the candidate user prompt.
|
|
1794
|
+
case "user_shell":
|
|
1795
|
+
case "gemini":
|
|
1796
|
+
case "gemini_content":
|
|
1797
|
+
case "tool_group":
|
|
1798
|
+
case "btw":
|
|
1799
|
+
case "advisor":
|
|
1800
|
+
case "memory_saved":
|
|
1801
|
+
case "about":
|
|
1802
|
+
case "help":
|
|
1803
|
+
case "stats":
|
|
1804
|
+
case "model_stats":
|
|
1805
|
+
case "tool_stats":
|
|
1806
|
+
case "skill_stats":
|
|
1807
|
+
case "quit":
|
|
1808
|
+
case "compression":
|
|
1809
|
+
case "summary":
|
|
1810
|
+
case "extensions_list":
|
|
1811
|
+
case "tools_list":
|
|
1812
|
+
case "skills_list":
|
|
1813
|
+
case "mcp_status":
|
|
1814
|
+
case "context_usage":
|
|
1815
|
+
case "doctor":
|
|
1816
|
+
case "diff_stats":
|
|
1817
|
+
case "arena_agent_complete":
|
|
1818
|
+
case "arena_session_complete":
|
|
1819
|
+
case "goal_status":
|
|
1820
|
+
case "goal_state":
|
|
1821
|
+
return false;
|
|
1822
|
+
default: {
|
|
1823
|
+
const _exhaustive = item;
|
|
1824
|
+
void _exhaustive;
|
|
1825
|
+
return false;
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
__name(isSyntheticHistoryItem, "isSyntheticHistoryItem");
|
|
1830
|
+
function itemsAfterAreOnlySynthetic(history, fromIndex) {
|
|
1831
|
+
for (let i = fromIndex + 1; i < history.length; i++) {
|
|
1832
|
+
if (!isSyntheticHistoryItem(history[i])) return false;
|
|
1833
|
+
}
|
|
1834
|
+
return true;
|
|
1835
|
+
}
|
|
1836
|
+
__name(itemsAfterAreOnlySynthetic, "itemsAfterAreOnlySynthetic");
|
|
1837
|
+
function findLastUserItemIndex(history) {
|
|
1838
|
+
for (let i = history.length - 1; i >= 0; i--) {
|
|
1839
|
+
const item = history[i];
|
|
1840
|
+
if (item.type === "user" && item.sentToModel !== false) return i;
|
|
1841
|
+
}
|
|
1842
|
+
return -1;
|
|
1843
|
+
}
|
|
1844
|
+
__name(findLastUserItemIndex, "findLastUserItemIndex");
|
|
1845
|
+
function realUserPromptTexts(history) {
|
|
1846
|
+
return history.filter(
|
|
1847
|
+
(item) => item.type === "user" && item.sentToModel !== false && typeof item.text === "string" && item.text.trim() !== ""
|
|
1848
|
+
).map((item) => item.text);
|
|
1849
|
+
}
|
|
1850
|
+
__name(realUserPromptTexts, "realUserPromptTexts");
|
|
1851
|
+
function buildThoughtHeadIdMap(items) {
|
|
1852
|
+
const map = /* @__PURE__ */ new Map();
|
|
1853
|
+
for (let i = 0; i < items.length; i++) {
|
|
1854
|
+
const item = items[i];
|
|
1855
|
+
if (item.type !== "gemini_thought") continue;
|
|
1856
|
+
const headId = item.id;
|
|
1857
|
+
map.set(item, headId);
|
|
1858
|
+
for (let j = i + 1; j < items.length; j++) {
|
|
1859
|
+
const next = items[j];
|
|
1860
|
+
if (next.type !== "gemini_thought_content") break;
|
|
1861
|
+
map.set(next, headId);
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
return map;
|
|
1865
|
+
}
|
|
1866
|
+
__name(buildThoughtHeadIdMap, "buildThoughtHeadIdMap");
|
|
1867
|
+
|
|
1868
|
+
// packages/cli/src/ui/utils/turn-marker.ts
|
|
1869
|
+
function getLiveTurn(streamingState, history, pendingHistoryItems) {
|
|
1870
|
+
if (streamingState === "idle" /* Idle */) return null;
|
|
1871
|
+
const index = findLastUserItemIndex(history);
|
|
1872
|
+
if (index === -1) return null;
|
|
1873
|
+
const item = history[index];
|
|
1874
|
+
if (item.type !== "user" || item.turnOutcome !== void 0) return null;
|
|
1875
|
+
const marker = index === history.length - 1 && pendingHistoryItems.length === 0 ? "waiting" : "running";
|
|
1876
|
+
return { itemId: item.id, marker };
|
|
1877
|
+
}
|
|
1878
|
+
__name(getLiveTurn, "getLiveTurn");
|
|
1879
|
+
|
|
1747
1880
|
// packages/cli/src/ui/components/ShowMoreLines.tsx
|
|
1748
1881
|
init_esbuild_shims();
|
|
1749
1882
|
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -2608,124 +2741,6 @@ var DebugModeNotification = /* @__PURE__ */ __name(() => {
|
|
|
2608
2741
|
] });
|
|
2609
2742
|
}, "DebugModeNotification");
|
|
2610
2743
|
|
|
2611
|
-
// packages/cli/src/ui/utils/historyUtils.ts
|
|
2612
|
-
init_esbuild_shims();
|
|
2613
|
-
function isSyntheticHistoryItem(item) {
|
|
2614
|
-
switch (item.type) {
|
|
2615
|
-
// Synthetic: system-generated notices that don't represent meaningful
|
|
2616
|
-
// model output or user action. Safe to wipe on auto-restore.
|
|
2617
|
-
//
|
|
2618
|
-
// `gemini_thought` / `gemini_thought_content` are deliberately
|
|
2619
|
-
// CLASSIFIED AS SYNTHETIC even though they're visible to the user:
|
|
2620
|
-
// (1) Claude Code's auto-restore behavior treats <thinking> output
|
|
2621
|
-
// identically — auto-restore fires when the model emitted thoughts
|
|
2622
|
-
// but no real `gemini_content` (i.e. the model was still reasoning
|
|
2623
|
-
// when the user cancelled);
|
|
2624
|
-
// (2) Promoting thoughts to MEANINGFUL would block restore on every
|
|
2625
|
-
// cancel-during-thinking case, which is exactly the case where
|
|
2626
|
-
// restore is most valuable (user wanted to abandon the in-flight
|
|
2627
|
-
// turn before any committed text). The user can still see the
|
|
2628
|
-
// thoughts in scrollback if the terminal preserves them; the
|
|
2629
|
-
// restore only affects the next ↑-history pull and prompt buffer.
|
|
2630
|
-
case "info":
|
|
2631
|
-
case "error":
|
|
2632
|
-
case "warning":
|
|
2633
|
-
case "success":
|
|
2634
|
-
case "retry_countdown":
|
|
2635
|
-
case "vision_notice":
|
|
2636
|
-
case "notification":
|
|
2637
|
-
case "tool_use_summary":
|
|
2638
|
-
case "gemini_thought":
|
|
2639
|
-
case "gemini_thought_content":
|
|
2640
|
-
case "away_recap":
|
|
2641
|
-
case "insight_progress":
|
|
2642
|
-
case "user_prompt_submit_blocked":
|
|
2643
|
-
case "stop_hook_loop":
|
|
2644
|
-
case "stop_hook_system_message":
|
|
2645
|
-
return true;
|
|
2646
|
-
// Steer messages (mid-turn user injections) are typed 'user' but
|
|
2647
|
-
// carry sentToModel === false; treat them as synthetic so the
|
|
2648
|
-
// cancel handler can still do a full rewind when only a steer
|
|
2649
|
-
// follows the real prompt.
|
|
2650
|
-
case "user":
|
|
2651
|
-
return item.sentToModel === false;
|
|
2652
|
-
// Meaningful: user input, model text, tool runs, slash-command
|
|
2653
|
-
// results the user explicitly asked for. Auto-restore must bail
|
|
2654
|
-
// when any of these appear after the candidate user prompt.
|
|
2655
|
-
case "user_shell":
|
|
2656
|
-
case "gemini":
|
|
2657
|
-
case "gemini_content":
|
|
2658
|
-
case "tool_group":
|
|
2659
|
-
case "btw":
|
|
2660
|
-
case "advisor":
|
|
2661
|
-
case "memory_saved":
|
|
2662
|
-
case "about":
|
|
2663
|
-
case "help":
|
|
2664
|
-
case "stats":
|
|
2665
|
-
case "model_stats":
|
|
2666
|
-
case "tool_stats":
|
|
2667
|
-
case "skill_stats":
|
|
2668
|
-
case "quit":
|
|
2669
|
-
case "compression":
|
|
2670
|
-
case "summary":
|
|
2671
|
-
case "extensions_list":
|
|
2672
|
-
case "tools_list":
|
|
2673
|
-
case "skills_list":
|
|
2674
|
-
case "mcp_status":
|
|
2675
|
-
case "context_usage":
|
|
2676
|
-
case "doctor":
|
|
2677
|
-
case "diff_stats":
|
|
2678
|
-
case "arena_agent_complete":
|
|
2679
|
-
case "arena_session_complete":
|
|
2680
|
-
case "goal_status":
|
|
2681
|
-
case "goal_state":
|
|
2682
|
-
return false;
|
|
2683
|
-
default: {
|
|
2684
|
-
const _exhaustive = item;
|
|
2685
|
-
void _exhaustive;
|
|
2686
|
-
return false;
|
|
2687
|
-
}
|
|
2688
|
-
}
|
|
2689
|
-
}
|
|
2690
|
-
__name(isSyntheticHistoryItem, "isSyntheticHistoryItem");
|
|
2691
|
-
function itemsAfterAreOnlySynthetic(history, fromIndex) {
|
|
2692
|
-
for (let i = fromIndex + 1; i < history.length; i++) {
|
|
2693
|
-
if (!isSyntheticHistoryItem(history[i])) return false;
|
|
2694
|
-
}
|
|
2695
|
-
return true;
|
|
2696
|
-
}
|
|
2697
|
-
__name(itemsAfterAreOnlySynthetic, "itemsAfterAreOnlySynthetic");
|
|
2698
|
-
function findLastUserItemIndex(history) {
|
|
2699
|
-
for (let i = history.length - 1; i >= 0; i--) {
|
|
2700
|
-
const item = history[i];
|
|
2701
|
-
if (item.type === "user" && item.sentToModel !== false) return i;
|
|
2702
|
-
}
|
|
2703
|
-
return -1;
|
|
2704
|
-
}
|
|
2705
|
-
__name(findLastUserItemIndex, "findLastUserItemIndex");
|
|
2706
|
-
function realUserPromptTexts(history) {
|
|
2707
|
-
return history.filter(
|
|
2708
|
-
(item) => item.type === "user" && item.sentToModel !== false && typeof item.text === "string" && item.text.trim() !== ""
|
|
2709
|
-
).map((item) => item.text);
|
|
2710
|
-
}
|
|
2711
|
-
__name(realUserPromptTexts, "realUserPromptTexts");
|
|
2712
|
-
function buildThoughtHeadIdMap(items) {
|
|
2713
|
-
const map = /* @__PURE__ */ new Map();
|
|
2714
|
-
for (let i = 0; i < items.length; i++) {
|
|
2715
|
-
const item = items[i];
|
|
2716
|
-
if (item.type !== "gemini_thought") continue;
|
|
2717
|
-
const headId = item.id;
|
|
2718
|
-
map.set(item, headId);
|
|
2719
|
-
for (let j = i + 1; j < items.length; j++) {
|
|
2720
|
-
const next = items[j];
|
|
2721
|
-
if (next.type !== "gemini_thought_content") break;
|
|
2722
|
-
map.set(next, headId);
|
|
2723
|
-
}
|
|
2724
|
-
}
|
|
2725
|
-
return map;
|
|
2726
|
-
}
|
|
2727
|
-
__name(buildThoughtHeadIdMap, "buildThoughtHeadIdMap");
|
|
2728
|
-
|
|
2729
2744
|
// packages/cli/src/ui/components/shared/ScrollableList.tsx
|
|
2730
2745
|
init_esbuild_shims();
|
|
2731
2746
|
var import_react19 = __toESM(require_react(), 1);
|
|
@@ -4628,6 +4643,13 @@ var MainContent = /* @__PURE__ */ __name(({
|
|
|
4628
4643
|
embeddedShellFocused: uiState.embeddedShellFocused,
|
|
4629
4644
|
isEditorDialogOpen: uiState.isEditorDialogOpen
|
|
4630
4645
|
};
|
|
4646
|
+
const liveTurn = getLiveTurn(
|
|
4647
|
+
uiState.streamingState,
|
|
4648
|
+
uiState.history,
|
|
4649
|
+
pendingHistoryItems
|
|
4650
|
+
);
|
|
4651
|
+
const liveTurnItemId = liveTurn?.itemId;
|
|
4652
|
+
const liveTurnMarker = liveTurn?.marker;
|
|
4631
4653
|
const pendingAvailableTerminalHeight = pendingHistoryItems.length > 0 && uiState.constrainHeight ? availableTerminalHeight : void 0;
|
|
4632
4654
|
const hasPendingPlainTextConfirmation = pendingHistoryItems.some(
|
|
4633
4655
|
(item) => item.type === "tool_group" && item.tools.some(
|
|
@@ -4678,7 +4700,8 @@ var MainContent = /* @__PURE__ */ __name(({
|
|
|
4678
4700
|
commands: uiState.slashCommands,
|
|
4679
4701
|
sourceCopyIndexOffsets,
|
|
4680
4702
|
thoughtHeadId: thoughtHeadIdByItemRef.current.get(item),
|
|
4681
|
-
fullDetail
|
|
4703
|
+
fullDetail,
|
|
4704
|
+
turnMarker: liveTurnItemId === item.id ? liveTurnMarker : void 0
|
|
4682
4705
|
}
|
|
4683
4706
|
);
|
|
4684
4707
|
},
|
|
@@ -4690,7 +4713,9 @@ var MainContent = /* @__PURE__ */ __name(({
|
|
|
4690
4713
|
sourceCopyOffsetsByHistoryItem,
|
|
4691
4714
|
fullDetail,
|
|
4692
4715
|
pendingAvailableTerminalHeight,
|
|
4693
|
-
uiState.constrainHeight
|
|
4716
|
+
uiState.constrainHeight,
|
|
4717
|
+
liveTurnItemId,
|
|
4718
|
+
liveTurnMarker
|
|
4694
4719
|
]
|
|
4695
4720
|
);
|
|
4696
4721
|
if (useVirtualScroll) {
|
|
@@ -4785,7 +4810,8 @@ var MainContent = /* @__PURE__ */ __name(({
|
|
|
4785
4810
|
commands: uiState.slashCommands,
|
|
4786
4811
|
sourceCopyIndexOffsets,
|
|
4787
4812
|
thoughtHeadId: thoughtHeadIdByItem.get(h),
|
|
4788
|
-
fullDetail
|
|
4813
|
+
fullDetail,
|
|
4814
|
+
turnMarker: liveTurnItemId === h.id ? liveTurnMarker : void 0
|
|
4789
4815
|
},
|
|
4790
4816
|
h.id
|
|
4791
4817
|
)
|
|
@@ -35443,9 +35469,30 @@ function useTurnStartIndex(streamingState, historyLength) {
|
|
|
35443
35469
|
}
|
|
35444
35470
|
__name(useTurnStartIndex, "useTurnStartIndex");
|
|
35445
35471
|
|
|
35446
|
-
// packages/cli/src/ui/hooks/
|
|
35472
|
+
// packages/cli/src/ui/hooks/use-turn-outcome.ts
|
|
35447
35473
|
init_esbuild_shims();
|
|
35448
35474
|
var import_react125 = __toESM(require_react(), 1);
|
|
35475
|
+
function useTurnOutcome(streamingState, history, updateItem, cancelledItemIdRef) {
|
|
35476
|
+
const wasActiveRef = (0, import_react125.useRef)(false);
|
|
35477
|
+
(0, import_react125.useEffect)(() => {
|
|
35478
|
+
const active = streamingState !== "idle" /* Idle */;
|
|
35479
|
+
if (wasActiveRef.current && !active) {
|
|
35480
|
+
const index = findLastUserItemIndex(history);
|
|
35481
|
+
const item = index === -1 ? void 0 : history[index];
|
|
35482
|
+
if (item?.type === "user" && item.turnOutcome === void 0) {
|
|
35483
|
+
const outcome = cancelledItemIdRef.current === item.id ? "cancelled" : history[history.length - 1]?.type === "error" ? "error" : "done";
|
|
35484
|
+
updateItem(item.id, { turnOutcome: outcome });
|
|
35485
|
+
}
|
|
35486
|
+
cancelledItemIdRef.current = null;
|
|
35487
|
+
}
|
|
35488
|
+
wasActiveRef.current = active;
|
|
35489
|
+
}, [streamingState, history, updateItem, cancelledItemIdRef]);
|
|
35490
|
+
}
|
|
35491
|
+
__name(useTurnOutcome, "useTurnOutcome");
|
|
35492
|
+
|
|
35493
|
+
// packages/cli/src/ui/hooks/useMemoryMonitor.ts
|
|
35494
|
+
init_esbuild_shims();
|
|
35495
|
+
var import_react126 = __toESM(require_react(), 1);
|
|
35449
35496
|
import process12 from "node:process";
|
|
35450
35497
|
import os5 from "node:os";
|
|
35451
35498
|
import v8 from "v8";
|
|
@@ -35462,8 +35509,8 @@ var useMemoryMonitor = /* @__PURE__ */ __name(({
|
|
|
35462
35509
|
addItem,
|
|
35463
35510
|
compactOldItems
|
|
35464
35511
|
}) => {
|
|
35465
|
-
const lastCompactRef = (0,
|
|
35466
|
-
(0,
|
|
35512
|
+
const lastCompactRef = (0, import_react126.useRef)(0);
|
|
35513
|
+
(0, import_react126.useEffect)(() => {
|
|
35467
35514
|
const debugIntervalId = setInterval(() => {
|
|
35468
35515
|
const memUsage = process12.memoryUsage();
|
|
35469
35516
|
const heapUsed = memUsage.heapUsed / 1024 / 1024;
|
|
@@ -35518,13 +35565,13 @@ var useMemoryMonitor = /* @__PURE__ */ __name(({
|
|
|
35518
35565
|
|
|
35519
35566
|
// packages/cli/src/ui/hooks/use-wake-repaint.ts
|
|
35520
35567
|
init_esbuild_shims();
|
|
35521
|
-
var
|
|
35568
|
+
var import_react127 = __toESM(require_react(), 1);
|
|
35522
35569
|
var HEARTBEAT_INTERVAL_MS = 5e3;
|
|
35523
35570
|
var WAKE_THRESHOLD_MS = HEARTBEAT_INTERVAL_MS * 2;
|
|
35524
35571
|
function useWakeRepaint(repaint) {
|
|
35525
|
-
const repaintRef = (0,
|
|
35572
|
+
const repaintRef = (0, import_react127.useRef)(repaint);
|
|
35526
35573
|
repaintRef.current = repaint;
|
|
35527
|
-
(0,
|
|
35574
|
+
(0, import_react127.useEffect)(() => {
|
|
35528
35575
|
let lastTick = Date.now();
|
|
35529
35576
|
const timer = setInterval(() => {
|
|
35530
35577
|
const now = Date.now();
|
|
@@ -35550,12 +35597,12 @@ __name(useWakeRepaint, "useWakeRepaint");
|
|
|
35550
35597
|
|
|
35551
35598
|
// packages/cli/src/ui/hooks/useThemeCommand.ts
|
|
35552
35599
|
init_esbuild_shims();
|
|
35553
|
-
var
|
|
35600
|
+
var import_react128 = __toESM(require_react(), 1);
|
|
35554
35601
|
import process13 from "node:process";
|
|
35555
35602
|
var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, addItem, initialThemeError, config) => {
|
|
35556
|
-
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0,
|
|
35557
|
-
const [themeBeforeDialogOpen, setThemeBeforeDialogOpen] = (0,
|
|
35558
|
-
const openThemeDialog = (0,
|
|
35603
|
+
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0, import_react128.useState)(!!initialThemeError);
|
|
35604
|
+
const [themeBeforeDialogOpen, setThemeBeforeDialogOpen] = (0, import_react128.useState)(themeManager.getActiveTheme().name);
|
|
35605
|
+
const openThemeDialog = (0, import_react128.useCallback)(() => {
|
|
35559
35606
|
if (process13.env["NO_COLOR"]) {
|
|
35560
35607
|
const feedbackItem = {
|
|
35561
35608
|
type: "info" /* INFO */,
|
|
@@ -35574,7 +35621,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
35574
35621
|
setThemeBeforeDialogOpen(themeManager.getActiveTheme().name);
|
|
35575
35622
|
setIsThemeDialogOpen(true);
|
|
35576
35623
|
}, [addItem, config]);
|
|
35577
|
-
const applyTheme = (0,
|
|
35624
|
+
const applyTheme = (0, import_react128.useCallback)(
|
|
35578
35625
|
(themeName) => {
|
|
35579
35626
|
if (!themeManager.setActiveTheme(themeName)) {
|
|
35580
35627
|
setIsThemeDialogOpen(true);
|
|
@@ -35589,13 +35636,13 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
35589
35636
|
},
|
|
35590
35637
|
[setThemeError]
|
|
35591
35638
|
);
|
|
35592
|
-
const handleThemeHighlight = (0,
|
|
35639
|
+
const handleThemeHighlight = (0, import_react128.useCallback)(
|
|
35593
35640
|
(themeName) => {
|
|
35594
35641
|
applyTheme(themeName);
|
|
35595
35642
|
},
|
|
35596
35643
|
[applyTheme]
|
|
35597
35644
|
);
|
|
35598
|
-
const handleThemeSelect = (0,
|
|
35645
|
+
const handleThemeSelect = (0, import_react128.useCallback)(
|
|
35599
35646
|
(themeName, scope) => {
|
|
35600
35647
|
if (themeName === void 0) {
|
|
35601
35648
|
applyTheme(themeBeforeDialogOpen);
|
|
@@ -35642,7 +35689,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
35642
35689
|
|
|
35643
35690
|
// packages/cli/src/ui/hooks/useFeedbackDialog.ts
|
|
35644
35691
|
init_esbuild_shims();
|
|
35645
|
-
var
|
|
35692
|
+
var import_react129 = __toESM(require_react(), 1);
|
|
35646
35693
|
import * as fs13 from "node:fs";
|
|
35647
35694
|
var import_strip_json_comments = __toESM(require_strip_json_comments(), 1);
|
|
35648
35695
|
var FEEDBACK_SHOW_PROBABILITY = 0.25;
|
|
@@ -35688,20 +35735,20 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
35688
35735
|
history,
|
|
35689
35736
|
sessionStats
|
|
35690
35737
|
}) => {
|
|
35691
|
-
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = (0,
|
|
35692
|
-
const [isFeedbackDismissedTemporarily, setIsFeedbackDismissedTemporarily] = (0,
|
|
35693
|
-
const openFeedbackDialog = (0,
|
|
35738
|
+
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = (0, import_react129.useState)(false);
|
|
35739
|
+
const [isFeedbackDismissedTemporarily, setIsFeedbackDismissedTemporarily] = (0, import_react129.useState)(false);
|
|
35740
|
+
const openFeedbackDialog = (0, import_react129.useCallback)(() => {
|
|
35694
35741
|
setIsFeedbackDialogOpen(true);
|
|
35695
35742
|
}, []);
|
|
35696
|
-
const closeFeedbackDialog = (0,
|
|
35743
|
+
const closeFeedbackDialog = (0, import_react129.useCallback)(
|
|
35697
35744
|
() => setIsFeedbackDialogOpen(false),
|
|
35698
35745
|
[]
|
|
35699
35746
|
);
|
|
35700
|
-
const temporaryCloseFeedbackDialog = (0,
|
|
35747
|
+
const temporaryCloseFeedbackDialog = (0, import_react129.useCallback)(() => {
|
|
35701
35748
|
setIsFeedbackDialogOpen(false);
|
|
35702
35749
|
setIsFeedbackDismissedTemporarily(true);
|
|
35703
35750
|
}, []);
|
|
35704
|
-
const submitFeedback = (0,
|
|
35751
|
+
const submitFeedback = (0, import_react129.useCallback)(
|
|
35705
35752
|
(rating) => {
|
|
35706
35753
|
if (rating >= FEEDBACK_OPTIONS.GOOD && rating <= FEEDBACK_OPTIONS.FINE) {
|
|
35707
35754
|
const feedbackEvent = new UserFeedbackEvent(
|
|
@@ -35721,7 +35768,7 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
35721
35768
|
},
|
|
35722
35769
|
[closeFeedbackDialog, sessionStats.sessionId, config, settings]
|
|
35723
35770
|
);
|
|
35724
|
-
(0,
|
|
35771
|
+
(0, import_react129.useEffect)(() => {
|
|
35725
35772
|
const checkAndShowFeedback = /* @__PURE__ */ __name(() => {
|
|
35726
35773
|
if (streamingState === "idle" /* Idle */ && history.length > 0) {
|
|
35727
35774
|
if (!config.getUsageStatisticsEnabled() || settings.merged.ui?.enableUserFeedback === false || !lastMessageIsAIResponse(history) || Math.random() > FEEDBACK_SHOW_PROBABILITY || !meetsMinimumSessionRequirements(sessionStats) || isFeedbackDismissedTemporarily) {
|
|
@@ -35743,7 +35790,7 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
35743
35790
|
settings.merged.ui?.enableUserFeedback,
|
|
35744
35791
|
config
|
|
35745
35792
|
]);
|
|
35746
|
-
(0,
|
|
35793
|
+
(0, import_react129.useEffect)(() => {
|
|
35747
35794
|
if (streamingState === "responding" /* Responding */ && isFeedbackDismissedTemporarily) {
|
|
35748
35795
|
setIsFeedbackDismissedTemporarily(false);
|
|
35749
35796
|
}
|
|
@@ -35759,13 +35806,13 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
35759
35806
|
|
|
35760
35807
|
// packages/cli/src/ui/hooks/useEditorSettings.ts
|
|
35761
35808
|
init_esbuild_shims();
|
|
35762
|
-
var
|
|
35809
|
+
var import_react130 = __toESM(require_react(), 1);
|
|
35763
35810
|
var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError, addItem, config) => {
|
|
35764
|
-
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0,
|
|
35765
|
-
const openEditorDialog = (0,
|
|
35811
|
+
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0, import_react130.useState)(false);
|
|
35812
|
+
const openEditorDialog = (0, import_react130.useCallback)(() => {
|
|
35766
35813
|
setIsEditorDialogOpen(true);
|
|
35767
35814
|
}, []);
|
|
35768
|
-
const handleEditorSelect = (0,
|
|
35815
|
+
const handleEditorSelect = (0, import_react130.useCallback)(
|
|
35769
35816
|
(editorType, scope) => {
|
|
35770
35817
|
if (editorType && (!checkHasEditorType(editorType) || !allowEditorTypeInSandbox(editorType))) {
|
|
35771
35818
|
return;
|
|
@@ -35790,7 +35837,7 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
35790
35837
|
},
|
|
35791
35838
|
[loadedSettings, setEditorError, addItem, config]
|
|
35792
35839
|
);
|
|
35793
|
-
const exitEditorDialog = (0,
|
|
35840
|
+
const exitEditorDialog = (0, import_react130.useCallback)(() => {
|
|
35794
35841
|
setIsEditorDialogOpen(false);
|
|
35795
35842
|
}, []);
|
|
35796
35843
|
return {
|
|
@@ -35803,13 +35850,13 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
35803
35850
|
|
|
35804
35851
|
// packages/cli/src/ui/hooks/useSettingsCommand.ts
|
|
35805
35852
|
init_esbuild_shims();
|
|
35806
|
-
var
|
|
35853
|
+
var import_react131 = __toESM(require_react(), 1);
|
|
35807
35854
|
function useSettingsCommand() {
|
|
35808
|
-
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0,
|
|
35809
|
-
const openSettingsDialog = (0,
|
|
35855
|
+
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0, import_react131.useState)(false);
|
|
35856
|
+
const openSettingsDialog = (0, import_react131.useCallback)(() => {
|
|
35810
35857
|
setIsSettingsDialogOpen(true);
|
|
35811
35858
|
}, []);
|
|
35812
|
-
const closeSettingsDialog = (0,
|
|
35859
|
+
const closeSettingsDialog = (0, import_react131.useCallback)(() => {
|
|
35813
35860
|
setIsSettingsDialogOpen(false);
|
|
35814
35861
|
}, []);
|
|
35815
35862
|
return {
|
|
@@ -35849,16 +35896,16 @@ __name(shouldUseVirtualViewport, "shouldUseVirtualViewport");
|
|
|
35849
35896
|
|
|
35850
35897
|
// packages/cli/src/ui/hooks/useModelCommand.ts
|
|
35851
35898
|
init_esbuild_shims();
|
|
35852
|
-
var
|
|
35899
|
+
var import_react132 = __toESM(require_react(), 1);
|
|
35853
35900
|
var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
35854
|
-
const [isModelDialogOpen, setIsModelDialogOpen] = (0,
|
|
35855
|
-
const [isFastModelMode, setIsFastModelMode] = (0,
|
|
35856
|
-
const [isVoiceModelMode, setIsVoiceModelMode] = (0,
|
|
35857
|
-
const [isVisionModelMode, setIsVisionModelMode] = (0,
|
|
35858
|
-
const [isCompactionModelMode, setIsCompactionModelMode] = (0,
|
|
35859
|
-
const [isImageModelMode, setIsImageModelMode] = (0,
|
|
35860
|
-
const [modelDialogPersistScope, setModelDialogPersistScope] = (0,
|
|
35861
|
-
const openModelDialog = (0,
|
|
35901
|
+
const [isModelDialogOpen, setIsModelDialogOpen] = (0, import_react132.useState)(false);
|
|
35902
|
+
const [isFastModelMode, setIsFastModelMode] = (0, import_react132.useState)(false);
|
|
35903
|
+
const [isVoiceModelMode, setIsVoiceModelMode] = (0, import_react132.useState)(false);
|
|
35904
|
+
const [isVisionModelMode, setIsVisionModelMode] = (0, import_react132.useState)(false);
|
|
35905
|
+
const [isCompactionModelMode, setIsCompactionModelMode] = (0, import_react132.useState)(false);
|
|
35906
|
+
const [isImageModelMode, setIsImageModelMode] = (0, import_react132.useState)(false);
|
|
35907
|
+
const [modelDialogPersistScope, setModelDialogPersistScope] = (0, import_react132.useState)(void 0);
|
|
35908
|
+
const openModelDialog = (0, import_react132.useCallback)(
|
|
35862
35909
|
(options) => {
|
|
35863
35910
|
const voiceModelMode = options?.voiceModelMode ?? false;
|
|
35864
35911
|
const visionModelMode = options?.visionModelMode ?? false;
|
|
@@ -35880,7 +35927,7 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
35880
35927
|
},
|
|
35881
35928
|
[]
|
|
35882
35929
|
);
|
|
35883
|
-
const closeModelDialog = (0,
|
|
35930
|
+
const closeModelDialog = (0, import_react132.useCallback)(() => {
|
|
35884
35931
|
setIsModelDialogOpen(false);
|
|
35885
35932
|
setIsFastModelMode(false);
|
|
35886
35933
|
setIsVoiceModelMode(false);
|
|
@@ -35904,13 +35951,13 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
35904
35951
|
|
|
35905
35952
|
// packages/cli/src/ui/hooks/useApprovalModeCommand.ts
|
|
35906
35953
|
init_esbuild_shims();
|
|
35907
|
-
var
|
|
35954
|
+
var import_react133 = __toESM(require_react(), 1);
|
|
35908
35955
|
var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config, addItem) => {
|
|
35909
|
-
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0,
|
|
35910
|
-
const openApprovalModeDialog = (0,
|
|
35956
|
+
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0, import_react133.useState)(false);
|
|
35957
|
+
const openApprovalModeDialog = (0, import_react133.useCallback)(() => {
|
|
35911
35958
|
setIsApprovalModeDialogOpen(true);
|
|
35912
35959
|
}, []);
|
|
35913
|
-
const handleApprovalModeSelect = (0,
|
|
35960
|
+
const handleApprovalModeSelect = (0, import_react133.useCallback)(
|
|
35914
35961
|
(mode, scope) => {
|
|
35915
35962
|
try {
|
|
35916
35963
|
if (!mode) {
|
|
@@ -35947,13 +35994,13 @@ var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config, add
|
|
|
35947
35994
|
|
|
35948
35995
|
// packages/cli/src/ui/hooks/use-effort-command.ts
|
|
35949
35996
|
init_esbuild_shims();
|
|
35950
|
-
var
|
|
35997
|
+
var import_react134 = __toESM(require_react(), 1);
|
|
35951
35998
|
var useEffortCommand = /* @__PURE__ */ __name((loadedSettings, config, addItem) => {
|
|
35952
|
-
const [isEffortDialogOpen, setIsEffortDialogOpen] = (0,
|
|
35953
|
-
const openEffortDialog = (0,
|
|
35999
|
+
const [isEffortDialogOpen, setIsEffortDialogOpen] = (0, import_react134.useState)(false);
|
|
36000
|
+
const openEffortDialog = (0, import_react134.useCallback)(() => {
|
|
35954
36001
|
setIsEffortDialogOpen(true);
|
|
35955
36002
|
}, []);
|
|
35956
|
-
const handleEffortSelect = (0,
|
|
36003
|
+
const handleEffortSelect = (0, import_react134.useCallback)(
|
|
35957
36004
|
(effort) => {
|
|
35958
36005
|
try {
|
|
35959
36006
|
if (!effort) {
|
|
@@ -35992,7 +36039,7 @@ var useEffortCommand = /* @__PURE__ */ __name((loadedSettings, config, addItem)
|
|
|
35992
36039
|
|
|
35993
36040
|
// packages/cli/src/ui/hooks/use-output-style-command.ts
|
|
35994
36041
|
init_esbuild_shims();
|
|
35995
|
-
var
|
|
36042
|
+
var import_react135 = __toESM(require_react(), 1);
|
|
35996
36043
|
var debugLogger35 = createDebugLogger("OUTPUT_STYLE_COMMAND");
|
|
35997
36044
|
function containsStyle(styles, name) {
|
|
35998
36045
|
const wanted = name.toLowerCase();
|
|
@@ -36000,13 +36047,13 @@ function containsStyle(styles, name) {
|
|
|
36000
36047
|
}
|
|
36001
36048
|
__name(containsStyle, "containsStyle");
|
|
36002
36049
|
var useOutputStyleCommand = /* @__PURE__ */ __name((loadedSettings, config, addItem) => {
|
|
36003
|
-
const [isOutputStyleDialogOpen, setIsOutputStyleDialogOpen] = (0,
|
|
36004
|
-
const [outputStyleChoices, setOutputStyleChoices] = (0,
|
|
36005
|
-
const choicesRef = (0,
|
|
36050
|
+
const [isOutputStyleDialogOpen, setIsOutputStyleDialogOpen] = (0, import_react135.useState)(false);
|
|
36051
|
+
const [outputStyleChoices, setOutputStyleChoices] = (0, import_react135.useState)(BUILT_IN_OUTPUT_STYLES);
|
|
36052
|
+
const choicesRef = (0, import_react135.useRef)(
|
|
36006
36053
|
BUILT_IN_OUTPUT_STYLES
|
|
36007
36054
|
);
|
|
36008
|
-
const openGenerationRef = (0,
|
|
36009
|
-
const report = (0,
|
|
36055
|
+
const openGenerationRef = (0, import_react135.useRef)(0);
|
|
36056
|
+
const report = (0, import_react135.useCallback)(
|
|
36010
36057
|
(type, text) => {
|
|
36011
36058
|
if (!addItem) {
|
|
36012
36059
|
return;
|
|
@@ -36024,7 +36071,7 @@ var useOutputStyleCommand = /* @__PURE__ */ __name((loadedSettings, config, addI
|
|
|
36024
36071
|
},
|
|
36025
36072
|
[addItem, config]
|
|
36026
36073
|
);
|
|
36027
|
-
const openOutputStyleDialog = (0,
|
|
36074
|
+
const openOutputStyleDialog = (0, import_react135.useCallback)(() => {
|
|
36028
36075
|
const generation = ++openGenerationRef.current;
|
|
36029
36076
|
choicesRef.current = [];
|
|
36030
36077
|
setOutputStyleChoices([]);
|
|
@@ -36058,7 +36105,7 @@ var useOutputStyleCommand = /* @__PURE__ */ __name((loadedSettings, config, addI
|
|
|
36058
36105
|
setOutputStyleChoices(choices);
|
|
36059
36106
|
})();
|
|
36060
36107
|
}, [config, report]);
|
|
36061
|
-
const handleOutputStyleSelect = (0,
|
|
36108
|
+
const handleOutputStyleSelect = (0, import_react135.useCallback)(
|
|
36062
36109
|
(styleName) => {
|
|
36063
36110
|
openGenerationRef.current += 1;
|
|
36064
36111
|
setIsOutputStyleDialogOpen(false);
|
|
@@ -36103,7 +36150,7 @@ var useOutputStyleCommand = /* @__PURE__ */ __name((loadedSettings, config, addI
|
|
|
36103
36150
|
|
|
36104
36151
|
// packages/cli/src/ui/hooks/useBranchCommand.ts
|
|
36105
36152
|
init_esbuild_shims();
|
|
36106
|
-
var
|
|
36153
|
+
var import_react136 = __toESM(require_react(), 1);
|
|
36107
36154
|
import { randomUUID } from "node:crypto";
|
|
36108
36155
|
var BACKGROUND_WORK_BRANCH_BLOCKED_MESSAGE = "Stop the current session's running background tasks before branching the conversation.";
|
|
36109
36156
|
function deriveFirstPrompt(messages) {
|
|
@@ -36131,7 +36178,7 @@ function useBranchCommand(options) {
|
|
|
36131
36178
|
setSessionName,
|
|
36132
36179
|
remount
|
|
36133
36180
|
} = options;
|
|
36134
|
-
const handleBranch = (0,
|
|
36181
|
+
const handleBranch = (0, import_react136.useCallback)(
|
|
36135
36182
|
async (name) => {
|
|
36136
36183
|
if (!config) return;
|
|
36137
36184
|
if (hasBlockingBackgroundWork(config)) {
|
|
@@ -36286,19 +36333,19 @@ __name(useBranchCommand, "useBranchCommand");
|
|
|
36286
36333
|
|
|
36287
36334
|
// packages/cli/src/ui/hooks/useResumeCommand.ts
|
|
36288
36335
|
init_esbuild_shims();
|
|
36289
|
-
var
|
|
36336
|
+
var import_react137 = __toESM(require_react(), 1);
|
|
36290
36337
|
var BACKGROUND_WORK_SWITCH_BLOCKED_MESSAGE = "Stop the current session's running background tasks before resuming another session.";
|
|
36291
36338
|
function useResumeCommand(options) {
|
|
36292
|
-
const [isResumeDialogOpen, setIsResumeDialogOpen] = (0,
|
|
36293
|
-
const [resumeMatchedSessions, setResumeMatchedSessions] = (0,
|
|
36294
|
-
const openResumeDialog = (0,
|
|
36339
|
+
const [isResumeDialogOpen, setIsResumeDialogOpen] = (0, import_react137.useState)(false);
|
|
36340
|
+
const [resumeMatchedSessions, setResumeMatchedSessions] = (0, import_react137.useState)();
|
|
36341
|
+
const openResumeDialog = (0, import_react137.useCallback)(
|
|
36295
36342
|
(matchedSessions) => {
|
|
36296
36343
|
setResumeMatchedSessions(matchedSessions);
|
|
36297
36344
|
setIsResumeDialogOpen(true);
|
|
36298
36345
|
},
|
|
36299
36346
|
[]
|
|
36300
36347
|
);
|
|
36301
|
-
const closeResumeDialog = (0,
|
|
36348
|
+
const closeResumeDialog = (0, import_react137.useCallback)(() => {
|
|
36302
36349
|
setIsResumeDialogOpen(false);
|
|
36303
36350
|
setResumeMatchedSessions(void 0);
|
|
36304
36351
|
}, []);
|
|
@@ -36314,7 +36361,7 @@ function useResumeCommand(options) {
|
|
|
36314
36361
|
} = options;
|
|
36315
36362
|
const { addItem, clearItems } = historyManager;
|
|
36316
36363
|
const loadHistory = loadHistoryOverride ?? historyManager.loadHistory;
|
|
36317
|
-
const handleResume = (0,
|
|
36364
|
+
const handleResume = (0, import_react137.useCallback)(
|
|
36318
36365
|
async (sessionId) => {
|
|
36319
36366
|
if (!config) {
|
|
36320
36367
|
return;
|
|
@@ -36467,18 +36514,18 @@ __name(useResumeCommand, "useResumeCommand");
|
|
|
36467
36514
|
|
|
36468
36515
|
// packages/cli/src/ui/hooks/useDeleteCommand.ts
|
|
36469
36516
|
init_esbuild_shims();
|
|
36470
|
-
var
|
|
36517
|
+
var import_react138 = __toESM(require_react(), 1);
|
|
36471
36518
|
function useDeleteCommand(options) {
|
|
36472
|
-
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = (0,
|
|
36473
|
-
const openDeleteDialog = (0,
|
|
36519
|
+
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = (0, import_react138.useState)(false);
|
|
36520
|
+
const openDeleteDialog = (0, import_react138.useCallback)(() => {
|
|
36474
36521
|
setIsDeleteDialogOpen(true);
|
|
36475
36522
|
}, []);
|
|
36476
|
-
const closeDeleteDialog = (0,
|
|
36523
|
+
const closeDeleteDialog = (0, import_react138.useCallback)(() => {
|
|
36477
36524
|
setIsDeleteDialogOpen(false);
|
|
36478
36525
|
}, []);
|
|
36479
36526
|
const { config, addItem, logger } = options ?? {};
|
|
36480
|
-
const isDeletingManyRef = (0,
|
|
36481
|
-
const purgeSessionLogs = (0,
|
|
36527
|
+
const isDeletingManyRef = (0, import_react138.useRef)(false);
|
|
36528
|
+
const purgeSessionLogs = (0, import_react138.useCallback)(
|
|
36482
36529
|
(sessionIds) => {
|
|
36483
36530
|
if (sessionIds.length === 0) return;
|
|
36484
36531
|
void logger?.removeSessionsMessages(sessionIds).catch((error) => {
|
|
@@ -36487,7 +36534,7 @@ function useDeleteCommand(options) {
|
|
|
36487
36534
|
},
|
|
36488
36535
|
[logger]
|
|
36489
36536
|
);
|
|
36490
|
-
const handleDelete = (0,
|
|
36537
|
+
const handleDelete = (0, import_react138.useCallback)(
|
|
36491
36538
|
async (sessionId) => {
|
|
36492
36539
|
if (!config) {
|
|
36493
36540
|
return;
|
|
@@ -36548,7 +36595,7 @@ function useDeleteCommand(options) {
|
|
|
36548
36595
|
},
|
|
36549
36596
|
[closeDeleteDialog, config, addItem, purgeSessionLogs]
|
|
36550
36597
|
);
|
|
36551
|
-
const handleDeleteMany = (0,
|
|
36598
|
+
const handleDeleteMany = (0, import_react138.useCallback)(
|
|
36552
36599
|
async (sessionIds) => {
|
|
36553
36600
|
if (!config) {
|
|
36554
36601
|
return;
|
|
@@ -36684,7 +36731,7 @@ __name(useDeleteCommand, "useDeleteCommand");
|
|
|
36684
36731
|
|
|
36685
36732
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
36686
36733
|
init_esbuild_shims();
|
|
36687
|
-
var
|
|
36734
|
+
var import_react139 = __toESM(require_react(), 1);
|
|
36688
36735
|
import process15 from "node:process";
|
|
36689
36736
|
var debugLogger36 = createDebugLogger("SLASH_COMMAND_PROCESSOR");
|
|
36690
36737
|
function hasUserPromptExpansionHooks(config) {
|
|
@@ -36742,7 +36789,7 @@ function getSkillCommandName(command) {
|
|
|
36742
36789
|
}
|
|
36743
36790
|
__name(getSkillCommandName, "getSkillCommandName");
|
|
36744
36791
|
var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, isProcessing, setIsProcessing, isIdleRef, setMemoryFileCount, actions, extensionsUpdateState, isConfigInitialized, logger, updateItem, setSessionName, extensionRefreshState) => {
|
|
36745
|
-
const fallbackExtensionRefreshStateRef = (0,
|
|
36792
|
+
const fallbackExtensionRefreshStateRef = (0, import_react139.useRef)(
|
|
36746
36793
|
null
|
|
36747
36794
|
);
|
|
36748
36795
|
if (!fallbackExtensionRefreshStateRef.current) {
|
|
@@ -36750,26 +36797,26 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
36750
36797
|
}
|
|
36751
36798
|
const activeExtensionRefreshState = extensionRefreshState ?? fallbackExtensionRefreshStateRef.current;
|
|
36752
36799
|
const peerMessaging = usePeerMessaging();
|
|
36753
|
-
const historyRef = (0,
|
|
36754
|
-
(0,
|
|
36800
|
+
const historyRef = (0, import_react139.useRef)(history);
|
|
36801
|
+
(0, import_react139.useLayoutEffect)(() => {
|
|
36755
36802
|
historyRef.current = history;
|
|
36756
36803
|
}, [history]);
|
|
36757
36804
|
const { stats: sessionStats, startNewSession } = useSessionStats();
|
|
36758
|
-
const [commands, setCommands] = (0,
|
|
36759
|
-
const [recentCommands, setRecentCommands] = (0,
|
|
36760
|
-
const [reloadTrigger, setReloadTrigger] = (0,
|
|
36761
|
-
const commandReloadResolversRef = (0,
|
|
36762
|
-
const extensionContentRefreshTimerRef = (0,
|
|
36763
|
-
const extensionContentRefreshRunningRef = (0,
|
|
36764
|
-
const extensionContentRefreshPendingRef = (0,
|
|
36765
|
-
const mountedRef = (0,
|
|
36766
|
-
(0,
|
|
36805
|
+
const [commands, setCommands] = (0, import_react139.useState)([]);
|
|
36806
|
+
const [recentCommands, setRecentCommands] = (0, import_react139.useState)(/* @__PURE__ */ new Map());
|
|
36807
|
+
const [reloadTrigger, setReloadTrigger] = (0, import_react139.useState)(0);
|
|
36808
|
+
const commandReloadResolversRef = (0, import_react139.useRef)([]);
|
|
36809
|
+
const extensionContentRefreshTimerRef = (0, import_react139.useRef)(null);
|
|
36810
|
+
const extensionContentRefreshRunningRef = (0, import_react139.useRef)(false);
|
|
36811
|
+
const extensionContentRefreshPendingRef = (0, import_react139.useRef)(false);
|
|
36812
|
+
const mountedRef = (0, import_react139.useRef)(true);
|
|
36813
|
+
(0, import_react139.useEffect)(() => {
|
|
36767
36814
|
mountedRef.current = true;
|
|
36768
36815
|
return () => {
|
|
36769
36816
|
mountedRef.current = false;
|
|
36770
36817
|
};
|
|
36771
36818
|
}, []);
|
|
36772
|
-
const resolveCommandReloads = (0,
|
|
36819
|
+
const resolveCommandReloads = (0, import_react139.useCallback)((completedTrigger) => {
|
|
36773
36820
|
if (commandReloadResolversRef.current.length === 0) {
|
|
36774
36821
|
return;
|
|
36775
36822
|
}
|
|
@@ -36783,7 +36830,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
36783
36830
|
}
|
|
36784
36831
|
commandReloadResolversRef.current = remaining;
|
|
36785
36832
|
}, []);
|
|
36786
|
-
const reloadCommands = (0,
|
|
36833
|
+
const reloadCommands = (0, import_react139.useCallback)(() => {
|
|
36787
36834
|
if (!config) {
|
|
36788
36835
|
return Promise.resolve();
|
|
36789
36836
|
}
|
|
@@ -36798,14 +36845,14 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
36798
36845
|
});
|
|
36799
36846
|
});
|
|
36800
36847
|
}, [config]);
|
|
36801
|
-
const clearPendingExtensionContentRefresh = (0,
|
|
36848
|
+
const clearPendingExtensionContentRefresh = (0, import_react139.useCallback)(() => {
|
|
36802
36849
|
if (!extensionContentRefreshTimerRef.current) {
|
|
36803
36850
|
return;
|
|
36804
36851
|
}
|
|
36805
36852
|
clearTimeout(extensionContentRefreshTimerRef.current);
|
|
36806
36853
|
extensionContentRefreshTimerRef.current = null;
|
|
36807
36854
|
}, []);
|
|
36808
|
-
const showExtensionContentRefreshError = (0,
|
|
36855
|
+
const showExtensionContentRefreshError = (0, import_react139.useCallback)(
|
|
36809
36856
|
(error) => {
|
|
36810
36857
|
if (!mountedRef.current) {
|
|
36811
36858
|
return;
|
|
@@ -36825,7 +36872,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
36825
36872
|
},
|
|
36826
36873
|
[addItem]
|
|
36827
36874
|
);
|
|
36828
|
-
const runExtensionContentRefresh = (0,
|
|
36875
|
+
const runExtensionContentRefresh = (0, import_react139.useCallback)(async () => {
|
|
36829
36876
|
if (!config) {
|
|
36830
36877
|
return;
|
|
36831
36878
|
}
|
|
@@ -36869,23 +36916,23 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
36869
36916
|
reloadCommands,
|
|
36870
36917
|
showExtensionContentRefreshError
|
|
36871
36918
|
]);
|
|
36872
|
-
const [shellConfirmationRequest, setShellConfirmationRequest] = (0,
|
|
36873
|
-
const [confirmationRequest, setConfirmationRequest] = (0,
|
|
36874
|
-
const [sessionShellAllowlist, setSessionShellAllowlist] = (0,
|
|
36919
|
+
const [shellConfirmationRequest, setShellConfirmationRequest] = (0, import_react139.useState)(null);
|
|
36920
|
+
const [confirmationRequest, setConfirmationRequest] = (0, import_react139.useState)(null);
|
|
36921
|
+
const [sessionShellAllowlist, setSessionShellAllowlist] = (0, import_react139.useState)(
|
|
36875
36922
|
/* @__PURE__ */ new Set()
|
|
36876
36923
|
);
|
|
36877
|
-
const [pendingItem, setPendingItem] = (0,
|
|
36924
|
+
const [pendingItem, setPendingItem] = (0, import_react139.useState)(
|
|
36878
36925
|
null
|
|
36879
36926
|
);
|
|
36880
|
-
const [btwItem, setBtwItem] = (0,
|
|
36881
|
-
const btwAbortControllerRef = (0,
|
|
36882
|
-
const cancelBtw = (0,
|
|
36927
|
+
const [btwItem, setBtwItem] = (0, import_react139.useState)(null);
|
|
36928
|
+
const btwAbortControllerRef = (0, import_react139.useRef)(null);
|
|
36929
|
+
const cancelBtw = (0, import_react139.useCallback)(() => {
|
|
36883
36930
|
btwAbortControllerRef.current?.abort();
|
|
36884
36931
|
btwAbortControllerRef.current = null;
|
|
36885
36932
|
setBtwItem(null);
|
|
36886
36933
|
}, []);
|
|
36887
|
-
const abortControllerRef = (0,
|
|
36888
|
-
const cancelSlashCommand = (0,
|
|
36934
|
+
const abortControllerRef = (0, import_react139.useRef)(null);
|
|
36935
|
+
const cancelSlashCommand = (0, import_react139.useCallback)(() => {
|
|
36889
36936
|
cancelBtw();
|
|
36890
36937
|
if (!abortControllerRef.current) {
|
|
36891
36938
|
return;
|
|
@@ -36909,14 +36956,14 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
36909
36956
|
},
|
|
36910
36957
|
{ isActive: isProcessing }
|
|
36911
36958
|
);
|
|
36912
|
-
const pendingHistoryItems = (0,
|
|
36959
|
+
const pendingHistoryItems = (0, import_react139.useMemo)(() => {
|
|
36913
36960
|
const items = [];
|
|
36914
36961
|
if (pendingItem != null) {
|
|
36915
36962
|
items.push(pendingItem);
|
|
36916
36963
|
}
|
|
36917
36964
|
return items;
|
|
36918
36965
|
}, [pendingItem]);
|
|
36919
|
-
const addMessage = (0,
|
|
36966
|
+
const addMessage = (0, import_react139.useCallback)(
|
|
36920
36967
|
(message) => {
|
|
36921
36968
|
let historyItemContent;
|
|
36922
36969
|
if (message.type === "about" /* ABOUT */) {
|
|
@@ -36976,7 +37023,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
36976
37023
|
},
|
|
36977
37024
|
[addItem]
|
|
36978
37025
|
);
|
|
36979
|
-
const commandContext = (0,
|
|
37026
|
+
const commandContext = (0, import_react139.useMemo)(
|
|
36980
37027
|
() => ({
|
|
36981
37028
|
services: {
|
|
36982
37029
|
config,
|
|
@@ -37052,7 +37099,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
37052
37099
|
peerMessaging
|
|
37053
37100
|
]
|
|
37054
37101
|
);
|
|
37055
|
-
(0,
|
|
37102
|
+
(0, import_react139.useEffect)(() => {
|
|
37056
37103
|
if (!config || config.getShellExecutionSandbox?.()) {
|
|
37057
37104
|
return;
|
|
37058
37105
|
}
|
|
@@ -37070,7 +37117,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
37070
37117
|
})();
|
|
37071
37118
|
};
|
|
37072
37119
|
}, [config, reloadCommands]);
|
|
37073
|
-
(0,
|
|
37120
|
+
(0, import_react139.useEffect)(() => {
|
|
37074
37121
|
if (!config) {
|
|
37075
37122
|
return;
|
|
37076
37123
|
}
|
|
@@ -37095,7 +37142,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
37095
37142
|
}
|
|
37096
37143
|
};
|
|
37097
37144
|
}, [config, reloadCommands]);
|
|
37098
|
-
(0,
|
|
37145
|
+
(0, import_react139.useEffect)(() => {
|
|
37099
37146
|
if (!isConfigInitialized) {
|
|
37100
37147
|
return;
|
|
37101
37148
|
}
|
|
@@ -37110,7 +37157,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
37110
37157
|
reloadCommands();
|
|
37111
37158
|
});
|
|
37112
37159
|
}, [config, isConfigInitialized, reloadCommands]);
|
|
37113
|
-
(0,
|
|
37160
|
+
(0, import_react139.useEffect)(() => {
|
|
37114
37161
|
const listener = /* @__PURE__ */ __name((reason) => {
|
|
37115
37162
|
clearPendingExtensionContentRefresh();
|
|
37116
37163
|
addItem(
|
|
@@ -37137,7 +37184,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
37137
37184
|
addItem,
|
|
37138
37185
|
clearPendingExtensionContentRefresh
|
|
37139
37186
|
]);
|
|
37140
|
-
(0,
|
|
37187
|
+
(0, import_react139.useEffect)(() => {
|
|
37141
37188
|
activeExtensionRefreshState.on(
|
|
37142
37189
|
"extensions-reload-started" /* ExtensionsReloadStarted */,
|
|
37143
37190
|
clearPendingExtensionContentRefresh
|
|
@@ -37157,7 +37204,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
37157
37204
|
);
|
|
37158
37205
|
};
|
|
37159
37206
|
}, [activeExtensionRefreshState, clearPendingExtensionContentRefresh]);
|
|
37160
|
-
(0,
|
|
37207
|
+
(0, import_react139.useEffect)(() => {
|
|
37161
37208
|
if (!config) {
|
|
37162
37209
|
return;
|
|
37163
37210
|
}
|
|
@@ -37183,7 +37230,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
37183
37230
|
activeExtensionRefreshState,
|
|
37184
37231
|
runExtensionContentRefresh
|
|
37185
37232
|
]);
|
|
37186
|
-
(0,
|
|
37233
|
+
(0, import_react139.useEffect)(() => {
|
|
37187
37234
|
const controller = new AbortController();
|
|
37188
37235
|
const load = /* @__PURE__ */ __name(async () => {
|
|
37189
37236
|
try {
|
|
@@ -37280,7 +37327,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
37280
37327
|
settings,
|
|
37281
37328
|
resolveCommandReloads
|
|
37282
37329
|
]);
|
|
37283
|
-
const handleSlashCommand = (0,
|
|
37330
|
+
const handleSlashCommand = (0, import_react139.useCallback)(
|
|
37284
37331
|
async (rawQuery, oneTimeShellAllowlist, overwriteConfirmed, existingInvocationItemId) => {
|
|
37285
37332
|
if (typeof rawQuery !== "string") {
|
|
37286
37333
|
return false;
|
|
@@ -37910,11 +37957,11 @@ ${commandToExecute.subCommands.map((sc) => ` - ${sc.name}: ${sc.description ||
|
|
|
37910
37957
|
|
|
37911
37958
|
// packages/cli/src/ui/hooks/useDoublePress.ts
|
|
37912
37959
|
init_esbuild_shims();
|
|
37913
|
-
var
|
|
37960
|
+
var import_react140 = __toESM(require_react(), 1);
|
|
37914
37961
|
var DOUBLE_PRESS_TIMEOUT_MS = 800;
|
|
37915
37962
|
function useDoublePress(onDoublePress, onPending) {
|
|
37916
|
-
const timeoutRef = (0,
|
|
37917
|
-
(0,
|
|
37963
|
+
const timeoutRef = (0, import_react140.useRef)(null);
|
|
37964
|
+
(0, import_react140.useEffect)(
|
|
37918
37965
|
() => () => {
|
|
37919
37966
|
if (timeoutRef.current !== null) {
|
|
37920
37967
|
clearTimeout(timeoutRef.current);
|
|
@@ -37923,7 +37970,7 @@ function useDoublePress(onDoublePress, onPending) {
|
|
|
37923
37970
|
},
|
|
37924
37971
|
[]
|
|
37925
37972
|
);
|
|
37926
|
-
return (0,
|
|
37973
|
+
return (0, import_react140.useCallback)(() => {
|
|
37927
37974
|
if (timeoutRef.current !== null) {
|
|
37928
37975
|
clearTimeout(timeoutRef.current);
|
|
37929
37976
|
timeoutRef.current = null;
|
|
@@ -37999,10 +38046,10 @@ __name(titleStatusPrefix, "titleStatusPrefix");
|
|
|
37999
38046
|
|
|
38000
38047
|
// packages/cli/src/ui/hooks/useLogger.ts
|
|
38001
38048
|
init_esbuild_shims();
|
|
38002
|
-
var
|
|
38049
|
+
var import_react141 = __toESM(require_react(), 1);
|
|
38003
38050
|
var useLogger = /* @__PURE__ */ __name((storage, sessionId) => {
|
|
38004
|
-
const [logger, setLogger] = (0,
|
|
38005
|
-
(0,
|
|
38051
|
+
const [logger, setLogger] = (0, import_react141.useState)(null);
|
|
38052
|
+
(0, import_react141.useEffect)(() => {
|
|
38006
38053
|
if (!sessionId) {
|
|
38007
38054
|
return;
|
|
38008
38055
|
}
|
|
@@ -38023,11 +38070,11 @@ var useLogger = /* @__PURE__ */ __name((storage, sessionId) => {
|
|
|
38023
38070
|
|
|
38024
38071
|
// packages/cli/src/ui/hooks/use-llm-stream.ts
|
|
38025
38072
|
init_esbuild_shims();
|
|
38026
|
-
var
|
|
38073
|
+
var import_react146 = __toESM(require_react(), 1);
|
|
38027
38074
|
|
|
38028
38075
|
// packages/cli/src/ui/hooks/shellCommandProcessor.ts
|
|
38029
38076
|
init_esbuild_shims();
|
|
38030
|
-
var
|
|
38077
|
+
var import_react142 = __toESM(require_react(), 1);
|
|
38031
38078
|
import crypto2 from "node:crypto";
|
|
38032
38079
|
import path8 from "node:path";
|
|
38033
38080
|
import os6 from "node:os";
|
|
@@ -38060,8 +38107,8 @@ ${modelContent}
|
|
|
38060
38107
|
}
|
|
38061
38108
|
__name(addShellCommandToLlmHistory, "addShellCommandToLlmHistory");
|
|
38062
38109
|
var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPendingHistoryItem, onExec, onDebugMessage, config, llmClient, setShellInputFocused, terminalWidth, terminalHeight) => {
|
|
38063
|
-
const [activeShellPtyId, setActiveShellPtyId] = (0,
|
|
38064
|
-
const handleShellCommand = (0,
|
|
38110
|
+
const [activeShellPtyId, setActiveShellPtyId] = (0, import_react142.useState)(null);
|
|
38111
|
+
const handleShellCommand = (0, import_react142.useCallback)(
|
|
38065
38112
|
(rawQuery, abortSignal) => {
|
|
38066
38113
|
if (typeof rawQuery !== "string" || rawQuery.trim() === "") {
|
|
38067
38114
|
return false;
|
|
@@ -38316,11 +38363,11 @@ ${finalOutput}`;
|
|
|
38316
38363
|
|
|
38317
38364
|
// packages/cli/src/ui/hooks/useStateAndRef.ts
|
|
38318
38365
|
init_esbuild_shims();
|
|
38319
|
-
var
|
|
38366
|
+
var import_react143 = __toESM(require_react(), 1);
|
|
38320
38367
|
var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
38321
|
-
const [state, setState] =
|
|
38322
|
-
const ref =
|
|
38323
|
-
const setStateInternal =
|
|
38368
|
+
const [state, setState] = import_react143.default.useState(initialValue);
|
|
38369
|
+
const ref = import_react143.default.useRef(initialValue);
|
|
38370
|
+
const setStateInternal = import_react143.default.useCallback(
|
|
38324
38371
|
(newStateOrCallback) => {
|
|
38325
38372
|
let newValue;
|
|
38326
38373
|
if (typeof newStateOrCallback === "function") {
|
|
@@ -38338,16 +38385,16 @@ var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
|
38338
38385
|
|
|
38339
38386
|
// packages/cli/src/ui/hooks/useReactToolScheduler.ts
|
|
38340
38387
|
init_esbuild_shims();
|
|
38341
|
-
var
|
|
38388
|
+
var import_react144 = __toESM(require_react(), 1);
|
|
38342
38389
|
import * as path9 from "node:path";
|
|
38343
38390
|
var debugLogger38 = createDebugLogger("REACT_TOOL_SCHEDULER");
|
|
38344
38391
|
function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorClose, onToolResultFullTurnModel) {
|
|
38345
|
-
const [toolCallsForDisplay, setToolCallsForDisplay] = (0,
|
|
38346
|
-
const onCompleteRef = (0,
|
|
38347
|
-
const getPreferredEditorRef = (0,
|
|
38348
|
-
const onEditorCloseRef = (0,
|
|
38349
|
-
const onToolResultFullTurnModelRef = (0,
|
|
38350
|
-
(0,
|
|
38392
|
+
const [toolCallsForDisplay, setToolCallsForDisplay] = (0, import_react144.useState)([]);
|
|
38393
|
+
const onCompleteRef = (0, import_react144.useRef)(onComplete);
|
|
38394
|
+
const getPreferredEditorRef = (0, import_react144.useRef)(getPreferredEditor);
|
|
38395
|
+
const onEditorCloseRef = (0, import_react144.useRef)(onEditorClose);
|
|
38396
|
+
const onToolResultFullTurnModelRef = (0, import_react144.useRef)(onToolResultFullTurnModel);
|
|
38397
|
+
(0, import_react144.useLayoutEffect)(() => {
|
|
38351
38398
|
onCompleteRef.current = onComplete;
|
|
38352
38399
|
getPreferredEditorRef.current = getPreferredEditor;
|
|
38353
38400
|
onEditorCloseRef.current = onEditorClose;
|
|
@@ -38358,7 +38405,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
38358
38405
|
onEditorClose,
|
|
38359
38406
|
onToolResultFullTurnModel
|
|
38360
38407
|
]);
|
|
38361
|
-
const outputUpdateHandler = (0,
|
|
38408
|
+
const outputUpdateHandler = (0, import_react144.useCallback)(
|
|
38362
38409
|
(toolCallId, outputChunk) => {
|
|
38363
38410
|
if (isShellProgressData(outputChunk)) {
|
|
38364
38411
|
return;
|
|
@@ -38376,13 +38423,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
38376
38423
|
},
|
|
38377
38424
|
[]
|
|
38378
38425
|
);
|
|
38379
|
-
const allToolCallsCompleteHandler = (0,
|
|
38426
|
+
const allToolCallsCompleteHandler = (0, import_react144.useCallback)(
|
|
38380
38427
|
async (completedToolCalls) => {
|
|
38381
38428
|
await onCompleteRef.current(completedToolCalls);
|
|
38382
38429
|
},
|
|
38383
38430
|
[]
|
|
38384
38431
|
);
|
|
38385
|
-
const toolCallsUpdateHandler = (0,
|
|
38432
|
+
const toolCallsUpdateHandler = (0, import_react144.useCallback)(
|
|
38386
38433
|
(updatedCoreToolCalls) => {
|
|
38387
38434
|
setToolCallsForDisplay(
|
|
38388
38435
|
(prevTrackedCalls) => updatedCoreToolCalls.map((coreTc) => {
|
|
@@ -38409,7 +38456,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
38409
38456
|
},
|
|
38410
38457
|
[setToolCallsForDisplay]
|
|
38411
38458
|
);
|
|
38412
|
-
const scheduler = (0,
|
|
38459
|
+
const scheduler = (0, import_react144.useMemo)(
|
|
38413
38460
|
() => new CoreToolScheduler({
|
|
38414
38461
|
config,
|
|
38415
38462
|
outputUpdateHandler,
|
|
@@ -38428,7 +38475,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
38428
38475
|
toolCallsUpdateHandler
|
|
38429
38476
|
]
|
|
38430
38477
|
);
|
|
38431
|
-
const schedule = (0,
|
|
38478
|
+
const schedule = (0, import_react144.useCallback)(
|
|
38432
38479
|
(request, signal, modelOverride) => {
|
|
38433
38480
|
const requests = Array.isArray(request) ? request : [request];
|
|
38434
38481
|
const isQueuedCancellation = /* @__PURE__ */ __name((error) => signal.aborted && error instanceof Error && error.message === "Tool call cancelled while in queue.", "isQueuedCancellation");
|
|
@@ -38535,7 +38582,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
38535
38582
|
},
|
|
38536
38583
|
[allToolCallsCompleteHandler, config, scheduler]
|
|
38537
38584
|
);
|
|
38538
|
-
const markToolsAsSubmitted = (0,
|
|
38585
|
+
const markToolsAsSubmitted = (0, import_react144.useCallback)(
|
|
38539
38586
|
(callIdsToMark) => {
|
|
38540
38587
|
setToolCallsForDisplay(
|
|
38541
38588
|
(prevCalls) => prevCalls.map(
|
|
@@ -38717,7 +38764,7 @@ import process16 from "node:process";
|
|
|
38717
38764
|
|
|
38718
38765
|
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
38719
38766
|
init_esbuild_shims();
|
|
38720
|
-
var
|
|
38767
|
+
var import_react145 = __toESM(require_react(), 1);
|
|
38721
38768
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
38722
38769
|
var GOAL_COMMAND_RE = /^\/goal(?:\s|$)/;
|
|
38723
38770
|
function aggregateUserMessages(messages) {
|
|
@@ -38732,12 +38779,12 @@ function aggregateUserMessages(messages) {
|
|
|
38732
38779
|
}
|
|
38733
38780
|
__name(aggregateUserMessages, "aggregateUserMessages");
|
|
38734
38781
|
function useMessageQueue() {
|
|
38735
|
-
const [queuedMessages, setQueuedMessages] = (0,
|
|
38736
|
-
const [queuedGoalTurns, setQueuedGoalTurns] = (0,
|
|
38737
|
-
const queueRef = (0,
|
|
38738
|
-
const goalQueueRef = (0,
|
|
38739
|
-
const nextMessageKey = (0,
|
|
38740
|
-
const addMessage = (0,
|
|
38782
|
+
const [queuedMessages, setQueuedMessages] = (0, import_react145.useState)([]);
|
|
38783
|
+
const [queuedGoalTurns, setQueuedGoalTurns] = (0, import_react145.useState)([]);
|
|
38784
|
+
const queueRef = (0, import_react145.useRef)([]);
|
|
38785
|
+
const goalQueueRef = (0, import_react145.useRef)([]);
|
|
38786
|
+
const nextMessageKey = (0, import_react145.useCallback)(() => `message-queue:${randomUUID2()}`, []);
|
|
38787
|
+
const addMessage = (0, import_react145.useCallback)(
|
|
38741
38788
|
(message, deferUntilIdle = false, submittedPrompt) => {
|
|
38742
38789
|
const text = message.trim();
|
|
38743
38790
|
if (!text) return;
|
|
@@ -38754,7 +38801,7 @@ function useMessageQueue() {
|
|
|
38754
38801
|
},
|
|
38755
38802
|
[nextMessageKey]
|
|
38756
38803
|
);
|
|
38757
|
-
const addPeerMessage = (0,
|
|
38804
|
+
const addPeerMessage = (0, import_react145.useCallback)(
|
|
38758
38805
|
(message, displayText, delivery) => {
|
|
38759
38806
|
const text = message.trim();
|
|
38760
38807
|
if (!text) return;
|
|
@@ -38777,7 +38824,7 @@ function useMessageQueue() {
|
|
|
38777
38824
|
},
|
|
38778
38825
|
[nextMessageKey]
|
|
38779
38826
|
);
|
|
38780
|
-
const enqueueGoalTurn = (0,
|
|
38827
|
+
const enqueueGoalTurn = (0, import_react145.useCallback)(
|
|
38781
38828
|
(input) => {
|
|
38782
38829
|
if (goalQueueRef.current.some(
|
|
38783
38830
|
({ permit: permit2 }) => permit2.turnId === input.permit.turnId
|
|
@@ -38796,23 +38843,23 @@ function useMessageQueue() {
|
|
|
38796
38843
|
},
|
|
38797
38844
|
[]
|
|
38798
38845
|
);
|
|
38799
|
-
const peekNextUserBatchKey = (0,
|
|
38846
|
+
const peekNextUserBatchKey = (0, import_react145.useCallback)(
|
|
38800
38847
|
(goalTurnActive = false) => goalTurnActive ? void 0 : queueRef.current.find(({ text }) => !isSlashCommand(text))?.key,
|
|
38801
38848
|
[]
|
|
38802
38849
|
);
|
|
38803
|
-
const hasQueuedUserMessages = (0,
|
|
38850
|
+
const hasQueuedUserMessages = (0, import_react145.useCallback)(
|
|
38804
38851
|
() => queueRef.current.length > 0,
|
|
38805
38852
|
[]
|
|
38806
38853
|
);
|
|
38807
|
-
const getPendingSubmissionCount = (0,
|
|
38854
|
+
const getPendingSubmissionCount = (0, import_react145.useCallback)(
|
|
38808
38855
|
() => queueRef.current.length + goalQueueRef.current.length,
|
|
38809
38856
|
[]
|
|
38810
38857
|
);
|
|
38811
|
-
const getQueuedPeerCount = (0,
|
|
38858
|
+
const getQueuedPeerCount = (0, import_react145.useCallback)(
|
|
38812
38859
|
() => queueRef.current.filter(({ peer }) => Boolean(peer)).length,
|
|
38813
38860
|
[]
|
|
38814
38861
|
);
|
|
38815
|
-
const claimGoalTurn = (0,
|
|
38862
|
+
const claimGoalTurn = (0, import_react145.useCallback)(() => {
|
|
38816
38863
|
const [goal, ...remainingGoals] = goalQueueRef.current;
|
|
38817
38864
|
if (goal) {
|
|
38818
38865
|
goalQueueRef.current = remainingGoals;
|
|
@@ -38820,21 +38867,21 @@ function useMessageQueue() {
|
|
|
38820
38867
|
}
|
|
38821
38868
|
return goal;
|
|
38822
38869
|
}, []);
|
|
38823
|
-
const claimDirectUserAdmission = (0,
|
|
38870
|
+
const claimDirectUserAdmission = (0, import_react145.useCallback)(() => {
|
|
38824
38871
|
const goal = claimGoalTurn();
|
|
38825
38872
|
return {
|
|
38826
38873
|
turnKey: nextMessageKey(),
|
|
38827
38874
|
...goal ? { goal } : {}
|
|
38828
38875
|
};
|
|
38829
38876
|
}, [claimGoalTurn, nextMessageKey]);
|
|
38830
|
-
const removeGoalTurns = (0,
|
|
38877
|
+
const removeGoalTurns = (0, import_react145.useCallback)(() => {
|
|
38831
38878
|
const keys = goalQueueRef.current.map(({ turnKey }) => turnKey);
|
|
38832
38879
|
if (keys.length === 0) return [];
|
|
38833
38880
|
goalQueueRef.current = [];
|
|
38834
38881
|
setQueuedGoalTurns([]);
|
|
38835
38882
|
return keys;
|
|
38836
38883
|
}, []);
|
|
38837
|
-
const popNextSubmission = (0,
|
|
38884
|
+
const popNextSubmission = (0, import_react145.useCallback)(
|
|
38838
38885
|
(goalControlMode = "normal") => {
|
|
38839
38886
|
if (goalControlMode !== "normal") {
|
|
38840
38887
|
const goalCommandIndex = queueRef.current.findIndex(
|
|
@@ -38886,15 +38933,15 @@ function useMessageQueue() {
|
|
|
38886
38933
|
},
|
|
38887
38934
|
[claimGoalTurn]
|
|
38888
38935
|
);
|
|
38889
|
-
const clearQueue = (0,
|
|
38936
|
+
const clearQueue = (0, import_react145.useCallback)(() => {
|
|
38890
38937
|
queueRef.current = [];
|
|
38891
38938
|
setQueuedMessages([]);
|
|
38892
38939
|
}, []);
|
|
38893
|
-
const getQueuedMessagesText = (0,
|
|
38940
|
+
const getQueuedMessagesText = (0, import_react145.useCallback)(() => {
|
|
38894
38941
|
if (queuedMessages.length === 0) return "";
|
|
38895
38942
|
return queuedMessages.map(({ text }) => text).join("\n\n");
|
|
38896
38943
|
}, [queuedMessages]);
|
|
38897
|
-
const popAllMessages = (0,
|
|
38944
|
+
const popAllMessages = (0, import_react145.useCallback)(
|
|
38898
38945
|
(onRemoved) => {
|
|
38899
38946
|
const current = queueRef.current;
|
|
38900
38947
|
if (current.length === 0) return null;
|
|
@@ -38907,7 +38954,7 @@ function useMessageQueue() {
|
|
|
38907
38954
|
},
|
|
38908
38955
|
[]
|
|
38909
38956
|
);
|
|
38910
|
-
const restoreMessages = (0,
|
|
38957
|
+
const restoreMessages = (0, import_react145.useCallback)(
|
|
38911
38958
|
(messages, submittedPrompt, deferUntilIdle = false) => {
|
|
38912
38959
|
const restored = messages.map((text) => text.trim()).filter(Boolean).map((text) => ({
|
|
38913
38960
|
key: nextMessageKey(),
|
|
@@ -38921,7 +38968,7 @@ function useMessageQueue() {
|
|
|
38921
38968
|
},
|
|
38922
38969
|
[nextMessageKey]
|
|
38923
38970
|
);
|
|
38924
|
-
const restorePeerMessage = (0,
|
|
38971
|
+
const restorePeerMessage = (0, import_react145.useCallback)(
|
|
38925
38972
|
(message, displayText, displayed = false, delivery) => {
|
|
38926
38973
|
const text = message.trim();
|
|
38927
38974
|
if (!text) return;
|
|
@@ -38941,7 +38988,7 @@ function useMessageQueue() {
|
|
|
38941
38988
|
},
|
|
38942
38989
|
[nextMessageKey]
|
|
38943
38990
|
);
|
|
38944
|
-
const drainQueue = (0,
|
|
38991
|
+
const drainQueue = (0, import_react145.useCallback)(
|
|
38945
38992
|
(includeDeferred = false, goalTurnActive = false) => {
|
|
38946
38993
|
const current = queueRef.current;
|
|
38947
38994
|
if (current.length === 0) return [];
|
|
@@ -39140,14 +39187,14 @@ function charIndexAfterLine(text, keptLines) {
|
|
|
39140
39187
|
}
|
|
39141
39188
|
__name(charIndexAfterLine, "charIndexAfterLine");
|
|
39142
39189
|
var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config, isConfigInitialized, settings, onDebugMessage, handleSlashCommand, shellModeActive, getPreferredEditor, onAuthError, performMemoryRefresh, modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError, onEditorClose, onCancelSubmit, setShellInputFocused, terminalWidth, terminalHeight, midTurnDrainRef, logger, availableTerminalHeightRef, terminalWidthRef, midTurnRestoreRef, goalQueueRef) => {
|
|
39143
|
-
const [initError, setInitError] = (0,
|
|
39144
|
-
const abortControllerRef = (0,
|
|
39145
|
-
const activeInteractionPromptIdRef = (0,
|
|
39146
|
-
const activeInteractionOwnerRef = (0,
|
|
39147
|
-
const activeGoalTurnRef = (0,
|
|
39148
|
-
const activeGoalAdmissionRef = (0,
|
|
39149
|
-
const goalTurnBindingsRef = (0,
|
|
39150
|
-
const bindGoalTurn = (0,
|
|
39190
|
+
const [initError, setInitError] = (0, import_react146.useState)(null);
|
|
39191
|
+
const abortControllerRef = (0, import_react146.useRef)(null);
|
|
39192
|
+
const activeInteractionPromptIdRef = (0, import_react146.useRef)(void 0);
|
|
39193
|
+
const activeInteractionOwnerRef = (0, import_react146.useRef)(void 0);
|
|
39194
|
+
const activeGoalTurnRef = (0, import_react146.useRef)(null);
|
|
39195
|
+
const activeGoalAdmissionRef = (0, import_react146.useRef)(null);
|
|
39196
|
+
const goalTurnBindingsRef = (0, import_react146.useRef)(/* @__PURE__ */ new Map());
|
|
39197
|
+
const bindGoalTurn = (0, import_react146.useCallback)(
|
|
39151
39198
|
(permit, turnKey, origin, controller = new AbortController()) => {
|
|
39152
39199
|
const existing = goalTurnBindingsRef.current.get(permit.turnId);
|
|
39153
39200
|
if (existing && existing.turnKey === turnKey && sameGoalPermit(existing.permit, permit) && !existing.controller.signal.aborted) {
|
|
@@ -39168,7 +39215,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39168
39215
|
},
|
|
39169
39216
|
[]
|
|
39170
39217
|
);
|
|
39171
|
-
const releaseGoalTurn = (0,
|
|
39218
|
+
const releaseGoalTurn = (0, import_react146.useCallback)((binding) => {
|
|
39172
39219
|
if (goalTurnBindingsRef.current.get(binding.permit.turnId) === binding) {
|
|
39173
39220
|
goalTurnBindingsRef.current.delete(binding.permit.turnId);
|
|
39174
39221
|
}
|
|
@@ -39179,7 +39226,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39179
39226
|
activeGoalAdmissionRef.current = null;
|
|
39180
39227
|
}
|
|
39181
39228
|
}, []);
|
|
39182
|
-
const failClosedGoalTurn = (0,
|
|
39229
|
+
const failClosedGoalTurn = (0, import_react146.useCallback)(
|
|
39183
39230
|
async (binding, reason, options) => {
|
|
39184
39231
|
if (!binding.controller.signal.aborted) {
|
|
39185
39232
|
binding.controller.abort(reason);
|
|
@@ -39225,7 +39272,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39225
39272
|
},
|
|
39226
39273
|
[config, releaseGoalTurn]
|
|
39227
39274
|
);
|
|
39228
|
-
const releaseUndeliveredGoalTurn = (0,
|
|
39275
|
+
const releaseUndeliveredGoalTurn = (0, import_react146.useCallback)(
|
|
39229
39276
|
async (turnKey) => {
|
|
39230
39277
|
if (!turnKey) return;
|
|
39231
39278
|
try {
|
|
@@ -39240,11 +39287,11 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39240
39287
|
},
|
|
39241
39288
|
[config]
|
|
39242
39289
|
);
|
|
39243
|
-
const flushBufferedStreamEventsRef = (0,
|
|
39244
|
-
const turnCancelledRef = (0,
|
|
39245
|
-
const isSubmittingQueryRef = (0,
|
|
39246
|
-
const submissionLeaseGenerationRef = (0,
|
|
39247
|
-
const setSubmissionInFlight = (0,
|
|
39290
|
+
const flushBufferedStreamEventsRef = (0, import_react146.useRef)(/* @__PURE__ */ new Set());
|
|
39291
|
+
const turnCancelledRef = (0, import_react146.useRef)(false);
|
|
39292
|
+
const isSubmittingQueryRef = (0, import_react146.useRef)(false);
|
|
39293
|
+
const submissionLeaseGenerationRef = (0, import_react146.useRef)(0);
|
|
39294
|
+
const setSubmissionInFlight = (0, import_react146.useCallback)(
|
|
39248
39295
|
(inFlight) => {
|
|
39249
39296
|
const changed = isSubmittingQueryRef.current !== inFlight;
|
|
39250
39297
|
isSubmittingQueryRef.current = inFlight;
|
|
@@ -39256,10 +39303,10 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39256
39303
|
},
|
|
39257
39304
|
[goalQueueRef]
|
|
39258
39305
|
);
|
|
39259
|
-
const teammateQueueRef = (0,
|
|
39260
|
-
const [teammateTrigger, setTeammateTrigger] = (0,
|
|
39261
|
-
const teammateQueueGenerationRef = (0,
|
|
39262
|
-
const drainTeammateQueue = (0,
|
|
39306
|
+
const teammateQueueRef = (0, import_react146.useRef)([]);
|
|
39307
|
+
const [teammateTrigger, setTeammateTrigger] = (0, import_react146.useState)(0);
|
|
39308
|
+
const teammateQueueGenerationRef = (0, import_react146.useRef)(0);
|
|
39309
|
+
const drainTeammateQueue = (0, import_react146.useCallback)(() => {
|
|
39263
39310
|
const generation = teammateQueueGenerationRef.current;
|
|
39264
39311
|
const entries = teammateQueueRef.current.splice(0);
|
|
39265
39312
|
for (const entry of entries) {
|
|
@@ -39286,14 +39333,14 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39286
39333
|
}, "restore");
|
|
39287
39334
|
return { entries, restore, generation };
|
|
39288
39335
|
}, [addItem]);
|
|
39289
|
-
const lastPromptRef = (0,
|
|
39290
|
-
const lastTurnUserItemRef = (0,
|
|
39291
|
-
const canUndoLastLoggedUserMessageRef = (0,
|
|
39292
|
-
const turnSawContentEventRef = (0,
|
|
39293
|
-
const lastPromptErroredRef = (0,
|
|
39294
|
-
const goalTerminalErrorRef = (0,
|
|
39295
|
-
const boundaryEnvelopeRetryDebtRef = (0,
|
|
39296
|
-
const commitItem = (0,
|
|
39336
|
+
const lastPromptRef = (0, import_react146.useRef)(null);
|
|
39337
|
+
const lastTurnUserItemRef = (0, import_react146.useRef)(null);
|
|
39338
|
+
const canUndoLastLoggedUserMessageRef = (0, import_react146.useRef)(false);
|
|
39339
|
+
const turnSawContentEventRef = (0, import_react146.useRef)(false);
|
|
39340
|
+
const lastPromptErroredRef = (0, import_react146.useRef)(false);
|
|
39341
|
+
const goalTerminalErrorRef = (0, import_react146.useRef)(false);
|
|
39342
|
+
const boundaryEnvelopeRetryDebtRef = (0, import_react146.useRef)([]);
|
|
39343
|
+
const commitItem = (0, import_react146.useCallback)(
|
|
39297
39344
|
(item, userMessageTimestamp) => {
|
|
39298
39345
|
if (item.type === "gemini" && !item.timestamp) {
|
|
39299
39346
|
item.timestamp = Date.now();
|
|
@@ -39303,17 +39350,17 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39303
39350
|
[addItem]
|
|
39304
39351
|
);
|
|
39305
39352
|
const dualOutput = useDualOutput();
|
|
39306
|
-
const [isResponding, setIsResponding] = (0,
|
|
39307
|
-
const activeModelStreamsRef = (0,
|
|
39308
|
-
const submissionActivitiesByGenerationRef = (0,
|
|
39309
|
-
const settleSubmissionStateIfIdle = (0,
|
|
39353
|
+
const [isResponding, setIsResponding] = (0, import_react146.useState)(false);
|
|
39354
|
+
const activeModelStreamsRef = (0, import_react146.useRef)(0);
|
|
39355
|
+
const submissionActivitiesByGenerationRef = (0, import_react146.useRef)(/* @__PURE__ */ new Map());
|
|
39356
|
+
const settleSubmissionStateIfIdle = (0, import_react146.useCallback)(() => {
|
|
39310
39357
|
const currentGeneration = submissionLeaseGenerationRef.current;
|
|
39311
39358
|
if ((submissionActivitiesByGenerationRef.current.get(currentGeneration) ?? 0) === 0 && activeModelStreamsRef.current === 0) {
|
|
39312
39359
|
setIsResponding(false);
|
|
39313
39360
|
setSubmissionInFlight(false);
|
|
39314
39361
|
}
|
|
39315
39362
|
}, [setSubmissionInFlight]);
|
|
39316
|
-
const retainSubmissionActivity = (0,
|
|
39363
|
+
const retainSubmissionActivity = (0, import_react146.useCallback)(
|
|
39317
39364
|
(generation) => {
|
|
39318
39365
|
submissionActivitiesByGenerationRef.current.set(
|
|
39319
39366
|
generation,
|
|
@@ -39337,19 +39384,19 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39337
39384
|
},
|
|
39338
39385
|
[settleSubmissionStateIfIdle]
|
|
39339
39386
|
);
|
|
39340
|
-
const [thought, setThought] = (0,
|
|
39341
|
-
const historyRef = (0,
|
|
39342
|
-
(0,
|
|
39387
|
+
const [thought, setThought] = (0, import_react146.useState)(null);
|
|
39388
|
+
const historyRef = (0, import_react146.useRef)(history);
|
|
39389
|
+
(0, import_react146.useLayoutEffect)(() => {
|
|
39343
39390
|
historyRef.current = history;
|
|
39344
39391
|
}, [history]);
|
|
39345
|
-
const auxiliaryAbortRefsRef = (0,
|
|
39392
|
+
const auxiliaryAbortRefsRef = (0, import_react146.useRef)(/* @__PURE__ */ new Set());
|
|
39346
39393
|
const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
|
|
39347
39394
|
const [
|
|
39348
39395
|
pendingAssistantItems,
|
|
39349
39396
|
pendingAssistantItemsRef,
|
|
39350
39397
|
setPendingAssistantItems
|
|
39351
39398
|
] = useStateAndRef([]);
|
|
39352
|
-
const commitPendingAssistantItems = (0,
|
|
39399
|
+
const commitPendingAssistantItems = (0, import_react146.useCallback)(
|
|
39353
39400
|
(userMessageTimestamp) => {
|
|
39354
39401
|
const items = pendingAssistantItemsRef.current;
|
|
39355
39402
|
if (items.length === 0) {
|
|
@@ -39362,14 +39409,14 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39362
39409
|
},
|
|
39363
39410
|
[commitItem, pendingAssistantItemsRef, setPendingAssistantItems]
|
|
39364
39411
|
);
|
|
39365
|
-
const commitItemInOrder = (0,
|
|
39412
|
+
const commitItemInOrder = (0, import_react146.useCallback)(
|
|
39366
39413
|
(item, userMessageTimestamp) => {
|
|
39367
39414
|
commitPendingAssistantItems(userMessageTimestamp);
|
|
39368
39415
|
return commitItem(item, userMessageTimestamp);
|
|
39369
39416
|
},
|
|
39370
39417
|
[commitItem, commitPendingAssistantItems]
|
|
39371
39418
|
);
|
|
39372
|
-
const stagePendingAssistantItem = (0,
|
|
39419
|
+
const stagePendingAssistantItem = (0, import_react146.useCallback)(() => {
|
|
39373
39420
|
const item = pendingHistoryItemRef.current;
|
|
39374
39421
|
if (item?.type !== "gemini" && item?.type !== "gemini_content") {
|
|
39375
39422
|
return false;
|
|
@@ -39379,7 +39426,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39379
39426
|
return true;
|
|
39380
39427
|
}, [pendingHistoryItemRef, setPendingAssistantItems, setPendingHistoryItem]);
|
|
39381
39428
|
const [pendingThoughtItem, pendingThoughtItemRef, setPendingThoughtItem] = useStateAndRef(null);
|
|
39382
|
-
const thoughtStartTimeRef = (0,
|
|
39429
|
+
const thoughtStartTimeRef = (0, import_react146.useRef)(null);
|
|
39383
39430
|
const [
|
|
39384
39431
|
pendingRetryErrorItem,
|
|
39385
39432
|
pendingRetryErrorItemRef,
|
|
@@ -39390,7 +39437,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39390
39437
|
pendingRetryCountdownItemRef,
|
|
39391
39438
|
setPendingRetryCountdownItem
|
|
39392
39439
|
] = useStateAndRef(null);
|
|
39393
|
-
const clearPendingState = (0,
|
|
39440
|
+
const clearPendingState = (0, import_react146.useCallback)(() => {
|
|
39394
39441
|
setPendingAssistantItems([]);
|
|
39395
39442
|
setPendingHistoryItem(null);
|
|
39396
39443
|
setPendingRetryErrorItem(null);
|
|
@@ -39399,48 +39446,48 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39399
39446
|
setPendingHistoryItem,
|
|
39400
39447
|
setPendingRetryErrorItem
|
|
39401
39448
|
]);
|
|
39402
|
-
const retryCountdownTimerRef = (0,
|
|
39449
|
+
const retryCountdownTimerRef = (0, import_react146.useRef)(
|
|
39403
39450
|
null
|
|
39404
39451
|
);
|
|
39405
|
-
const processedMemoryToolsRef = (0,
|
|
39406
|
-
const submitPromptOnCompleteRef = (0,
|
|
39407
|
-
const refreshContextFilesOnWriteRef = (0,
|
|
39408
|
-
const modelOverrideRef = (0,
|
|
39409
|
-
const inlineModelOverrideActiveRef = (0,
|
|
39410
|
-
const canUseToolResultFullTurnModel = (0,
|
|
39452
|
+
const processedMemoryToolsRef = (0, import_react146.useRef)(/* @__PURE__ */ new Set());
|
|
39453
|
+
const submitPromptOnCompleteRef = (0, import_react146.useRef)(null);
|
|
39454
|
+
const refreshContextFilesOnWriteRef = (0, import_react146.useRef)(false);
|
|
39455
|
+
const modelOverrideRef = (0, import_react146.useRef)(void 0);
|
|
39456
|
+
const inlineModelOverrideActiveRef = (0, import_react146.useRef)(false);
|
|
39457
|
+
const canUseToolResultFullTurnModel = (0, import_react146.useCallback)((model) => {
|
|
39411
39458
|
const current = modelOverrideRef.current;
|
|
39412
39459
|
return !inlineModelOverrideActiveRef.current && (!current?.endsWith("\0") || current === model);
|
|
39413
39460
|
}, []);
|
|
39414
|
-
const handledToolCallFingerprintsRef = (0,
|
|
39415
|
-
const duplicateProviderToolCallResponseIdsRef = (0,
|
|
39461
|
+
const handledToolCallFingerprintsRef = (0, import_react146.useRef)(/* @__PURE__ */ new Map());
|
|
39462
|
+
const duplicateProviderToolCallResponseIdsRef = (0, import_react146.useRef)(
|
|
39416
39463
|
/* @__PURE__ */ new Set()
|
|
39417
39464
|
);
|
|
39418
|
-
const pendingDuplicateToolResponsesRef = (0,
|
|
39419
|
-
const interactionOwnersByToolCallIdRef = (0,
|
|
39465
|
+
const pendingDuplicateToolResponsesRef = (0, import_react146.useRef)([]);
|
|
39466
|
+
const interactionOwnersByToolCallIdRef = (0, import_react146.useRef)(
|
|
39420
39467
|
/* @__PURE__ */ new Map()
|
|
39421
39468
|
);
|
|
39422
|
-
const continuationOwnersByToolCallIdRef = (0,
|
|
39469
|
+
const continuationOwnersByToolCallIdRef = (0, import_react146.useRef)(
|
|
39423
39470
|
/* @__PURE__ */ new Map()
|
|
39424
39471
|
);
|
|
39425
|
-
const detachedToolContinuationAbortControllersRef = (0,
|
|
39472
|
+
const detachedToolContinuationAbortControllersRef = (0, import_react146.useRef)(
|
|
39426
39473
|
/* @__PURE__ */ new Set()
|
|
39427
39474
|
);
|
|
39428
|
-
const pendingCompletedToolBatchesRef = (0,
|
|
39429
|
-
const handleCompletedToolsRef = (0,
|
|
39475
|
+
const pendingCompletedToolBatchesRef = (0, import_react146.useRef)([]);
|
|
39476
|
+
const handleCompletedToolsRef = (0, import_react146.useRef)(async () => {
|
|
39430
39477
|
});
|
|
39431
|
-
const immediateDuplicateToolResponsesRef = (0,
|
|
39432
|
-
const streamingResponseLengthRef = (0,
|
|
39433
|
-
const [isReceivingContent, setIsReceivingContent] = (0,
|
|
39478
|
+
const immediateDuplicateToolResponsesRef = (0, import_react146.useRef)(null);
|
|
39479
|
+
const streamingResponseLengthRef = (0, import_react146.useRef)(0);
|
|
39480
|
+
const [isReceivingContent, setIsReceivingContent] = (0, import_react146.useState)(false);
|
|
39434
39481
|
const {
|
|
39435
39482
|
startNewPrompt,
|
|
39436
39483
|
getPromptCount,
|
|
39437
39484
|
stats: sessionStates
|
|
39438
39485
|
} = useSessionStats();
|
|
39439
39486
|
const storage = config.storage;
|
|
39440
|
-
const toolBatchIdByCallIdRef = (0,
|
|
39441
|
-
const toolBatchCounterRef = (0,
|
|
39442
|
-
const toolBatchNonceRef = (0,
|
|
39443
|
-
const registerToolBatch = (0,
|
|
39487
|
+
const toolBatchIdByCallIdRef = (0, import_react146.useRef)(/* @__PURE__ */ new Map());
|
|
39488
|
+
const toolBatchCounterRef = (0, import_react146.useRef)(0);
|
|
39489
|
+
const toolBatchNonceRef = (0, import_react146.useRef)(Math.random().toString(36).slice(2));
|
|
39490
|
+
const registerToolBatch = (0, import_react146.useCallback)(
|
|
39444
39491
|
(requests) => {
|
|
39445
39492
|
const batchNumber = ++toolBatchCounterRef.current;
|
|
39446
39493
|
const batchId = `tool-batch-${toolBatchNonceRef.current}-${batchNumber}`;
|
|
@@ -39450,7 +39497,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39450
39497
|
},
|
|
39451
39498
|
[]
|
|
39452
39499
|
);
|
|
39453
|
-
const getToolBatchId = (0,
|
|
39500
|
+
const getToolBatchId = (0, import_react146.useCallback)(
|
|
39454
39501
|
(callId) => toolBatchIdByCallIdRef.current.get(callId),
|
|
39455
39502
|
[]
|
|
39456
39503
|
);
|
|
@@ -39491,7 +39538,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39491
39538
|
onEditorClose,
|
|
39492
39539
|
canUseToolResultFullTurnModel
|
|
39493
39540
|
);
|
|
39494
|
-
const pendingToolCallGroupDisplay = (0,
|
|
39541
|
+
const pendingToolCallGroupDisplay = (0, import_react146.useMemo)(() => {
|
|
39495
39542
|
if (!toolCalls.length) return void 0;
|
|
39496
39543
|
const group = mapToDisplay(
|
|
39497
39544
|
toolCalls,
|
|
@@ -39500,7 +39547,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39500
39547
|
group.batchId = getToolBatchId(toolCalls[0].request.callId);
|
|
39501
39548
|
return group;
|
|
39502
39549
|
}, [toolCalls, config, getToolBatchId]);
|
|
39503
|
-
const activeToolPtyId = (0,
|
|
39550
|
+
const activeToolPtyId = (0, import_react146.useMemo)(() => {
|
|
39504
39551
|
const executingShellTool = toolCalls?.find(
|
|
39505
39552
|
(tc) => tc.status === "executing" && tc.request.name === "run_shell_command"
|
|
39506
39553
|
);
|
|
@@ -39509,18 +39556,18 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39509
39556
|
}
|
|
39510
39557
|
return void 0;
|
|
39511
39558
|
}, [toolCalls]);
|
|
39512
|
-
const loopDetectedRef = (0,
|
|
39559
|
+
const loopDetectedRef = (0, import_react146.useRef)(false);
|
|
39513
39560
|
const [
|
|
39514
39561
|
loopDetectionConfirmationRequest,
|
|
39515
39562
|
setLoopDetectionConfirmationRequest
|
|
39516
|
-
] = (0,
|
|
39517
|
-
const stopRetryCountdownTimer = (0,
|
|
39563
|
+
] = (0, import_react146.useState)(null);
|
|
39564
|
+
const stopRetryCountdownTimer = (0, import_react146.useCallback)(() => {
|
|
39518
39565
|
if (retryCountdownTimerRef.current) {
|
|
39519
39566
|
clearInterval(retryCountdownTimerRef.current);
|
|
39520
39567
|
retryCountdownTimerRef.current = null;
|
|
39521
39568
|
}
|
|
39522
39569
|
}, []);
|
|
39523
|
-
const clearRetryCountdown = (0,
|
|
39570
|
+
const clearRetryCountdown = (0, import_react146.useCallback)(() => {
|
|
39524
39571
|
stopRetryCountdownTimer();
|
|
39525
39572
|
skipRetryDelayRef.current = null;
|
|
39526
39573
|
setPendingRetryErrorItem(null);
|
|
@@ -39530,8 +39577,8 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39530
39577
|
setPendingRetryCountdownItem,
|
|
39531
39578
|
stopRetryCountdownTimer
|
|
39532
39579
|
]);
|
|
39533
|
-
const skipRetryDelayRef = (0,
|
|
39534
|
-
const startRetryCountdown = (0,
|
|
39580
|
+
const skipRetryDelayRef = (0, import_react146.useRef)(null);
|
|
39581
|
+
const startRetryCountdown = (0, import_react146.useCallback)(
|
|
39535
39582
|
(retryInfo) => {
|
|
39536
39583
|
stopRetryCountdownTimer();
|
|
39537
39584
|
skipRetryDelayRef.current = retryInfo.skipDelay;
|
|
@@ -39579,8 +39626,8 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39579
39626
|
stopRetryCountdownTimer
|
|
39580
39627
|
]
|
|
39581
39628
|
);
|
|
39582
|
-
(0,
|
|
39583
|
-
const onExec = (0,
|
|
39629
|
+
(0, import_react146.useEffect)(() => () => stopRetryCountdownTimer(), [stopRetryCountdownTimer]);
|
|
39630
|
+
const onExec = (0, import_react146.useCallback)(async (done) => {
|
|
39584
39631
|
setIsResponding(true);
|
|
39585
39632
|
await done;
|
|
39586
39633
|
setIsResponding(false);
|
|
@@ -39597,12 +39644,12 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39597
39644
|
terminalHeight
|
|
39598
39645
|
);
|
|
39599
39646
|
const activePtyId = activeShellPtyId || activeToolPtyId;
|
|
39600
|
-
(0,
|
|
39647
|
+
(0, import_react146.useEffect)(() => {
|
|
39601
39648
|
if (!activePtyId) {
|
|
39602
39649
|
setShellInputFocused(false);
|
|
39603
39650
|
}
|
|
39604
39651
|
}, [activePtyId, setShellInputFocused]);
|
|
39605
|
-
const streamingState = (0,
|
|
39652
|
+
const streamingState = (0, import_react146.useMemo)(() => {
|
|
39606
39653
|
if (toolCalls.some((tc) => tc.status === "awaiting_approval")) {
|
|
39607
39654
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
39608
39655
|
}
|
|
@@ -39620,7 +39667,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39620
39667
|
}
|
|
39621
39668
|
return "idle" /* Idle */;
|
|
39622
39669
|
}, [isResponding, toolCalls]);
|
|
39623
|
-
(0,
|
|
39670
|
+
(0, import_react146.useEffect)(() => {
|
|
39624
39671
|
if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
|
|
39625
39672
|
const lastUserMessageIndex = findLastUserItemIndex(history);
|
|
39626
39673
|
const turnCount = lastUserMessageIndex === -1 ? 0 : history.length - lastUserMessageIndex;
|
|
@@ -39632,7 +39679,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39632
39679
|
}
|
|
39633
39680
|
}
|
|
39634
39681
|
}, [streamingState, config, history]);
|
|
39635
|
-
const cancelOngoingRequest = (0,
|
|
39682
|
+
const cancelOngoingRequest = (0, import_react146.useCallback)(() => {
|
|
39636
39683
|
if (turnCancelledRef.current) {
|
|
39637
39684
|
for (const controller of detachedToolContinuationAbortControllersRef.current) {
|
|
39638
39685
|
controller.abort();
|
|
@@ -39737,7 +39784,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39737
39784
|
getPromptCount,
|
|
39738
39785
|
setSubmissionInFlight
|
|
39739
39786
|
]);
|
|
39740
|
-
const applyVisionBridgeIfNeeded = (0,
|
|
39787
|
+
const applyVisionBridgeIfNeeded = (0, import_react146.useCallback)(
|
|
39741
39788
|
async (parts, timestamp, signal) => {
|
|
39742
39789
|
if (parts === null || !hasImageParts(parts)) {
|
|
39743
39790
|
return { parts, shouldProceed: true };
|
|
@@ -39802,7 +39849,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39802
39849
|
},
|
|
39803
39850
|
[addItem, config]
|
|
39804
39851
|
);
|
|
39805
|
-
const prepareQueryForLlm = (0,
|
|
39852
|
+
const prepareQueryForLlm = (0, import_react146.useCallback)(
|
|
39806
39853
|
async (query, userMessageTimestamp, abortSignal, prompt_id, submitType, submittedPrompt, preserveTurnOwnership) => {
|
|
39807
39854
|
if (turnCancelledRef.current && !preserveTurnOwnership) {
|
|
39808
39855
|
return { queryToSend: null, shouldProceed: false };
|
|
@@ -39973,7 +40020,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
39973
40020
|
applyVisionBridgeIfNeeded
|
|
39974
40021
|
]
|
|
39975
40022
|
);
|
|
39976
|
-
const handleContentEvent = (0,
|
|
40023
|
+
const handleContentEvent = (0, import_react146.useCallback)(
|
|
39977
40024
|
(eventValue, currentLlmMessageBuffer, userMessageTimestamp, startAsContinuation = false) => {
|
|
39978
40025
|
if (turnCancelledRef.current) {
|
|
39979
40026
|
return "";
|
|
@@ -40101,7 +40148,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
40101
40148
|
terminalWidthRef
|
|
40102
40149
|
]
|
|
40103
40150
|
);
|
|
40104
|
-
const mergeThought = (0,
|
|
40151
|
+
const mergeThought = (0, import_react146.useCallback)(
|
|
40105
40152
|
(incoming) => {
|
|
40106
40153
|
setThought((prev) => {
|
|
40107
40154
|
const incomingDescription = incoming.description ? clampLoadingThoughtDescription(incoming.description) : incoming.description;
|
|
@@ -40130,7 +40177,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
40130
40177
|
},
|
|
40131
40178
|
[setThought]
|
|
40132
40179
|
);
|
|
40133
|
-
const handleThoughtEvent = (0,
|
|
40180
|
+
const handleThoughtEvent = (0, import_react146.useCallback)(
|
|
40134
40181
|
(eventValue, currentThoughtBuffer, userMessageTimestamp) => {
|
|
40135
40182
|
if (turnCancelledRef.current) {
|
|
40136
40183
|
return "";
|
|
@@ -40192,7 +40239,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
40192
40239
|
},
|
|
40193
40240
|
[addItem, mergeThought, pendingThoughtItemRef, setPendingThoughtItem]
|
|
40194
40241
|
);
|
|
40195
|
-
const commitPendingThought = (0,
|
|
40242
|
+
const commitPendingThought = (0, import_react146.useCallback)(
|
|
40196
40243
|
(userMessageTimestamp) => {
|
|
40197
40244
|
if (pendingThoughtItemRef.current) {
|
|
40198
40245
|
const item = { ...pendingThoughtItemRef.current };
|
|
@@ -40206,7 +40253,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
40206
40253
|
},
|
|
40207
40254
|
[addItem, pendingThoughtItemRef, setPendingThoughtItem]
|
|
40208
40255
|
);
|
|
40209
|
-
const handleUserCancelledEvent = (0,
|
|
40256
|
+
const handleUserCancelledEvent = (0, import_react146.useCallback)(
|
|
40210
40257
|
(userMessageTimestamp) => {
|
|
40211
40258
|
if (turnCancelledRef.current) {
|
|
40212
40259
|
return;
|
|
@@ -40249,7 +40296,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
40249
40296
|
clearRetryCountdown
|
|
40250
40297
|
]
|
|
40251
40298
|
);
|
|
40252
|
-
const handleErrorEvent = (0,
|
|
40299
|
+
const handleErrorEvent = (0, import_react146.useCallback)(
|
|
40253
40300
|
(eventValue, userMessageTimestamp, submitType) => {
|
|
40254
40301
|
if (submitType !== "goal" /* Goal */) {
|
|
40255
40302
|
lastPromptErroredRef.current = true;
|
|
@@ -40296,7 +40343,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
40296
40343
|
clearRetryCountdown
|
|
40297
40344
|
]
|
|
40298
40345
|
);
|
|
40299
|
-
const handleCitationEvent = (0,
|
|
40346
|
+
const handleCitationEvent = (0, import_react146.useCallback)(
|
|
40300
40347
|
(text, userMessageTimestamp) => {
|
|
40301
40348
|
if (!showCitations(settings)) {
|
|
40302
40349
|
return;
|
|
@@ -40315,7 +40362,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
40315
40362
|
settings
|
|
40316
40363
|
]
|
|
40317
40364
|
);
|
|
40318
|
-
const handleFinishedEvent = (0,
|
|
40365
|
+
const handleFinishedEvent = (0, import_react146.useCallback)(
|
|
40319
40366
|
(event, userMessageTimestamp) => {
|
|
40320
40367
|
const finishReason = event.value.reason;
|
|
40321
40368
|
if (!finishReason) {
|
|
@@ -40356,8 +40403,8 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
40356
40403
|
},
|
|
40357
40404
|
[addItem, clearRetryCountdown]
|
|
40358
40405
|
);
|
|
40359
|
-
const autonomousLoopTickResolverRef = (0,
|
|
40360
|
-
const handleChatCompressionEvent = (0,
|
|
40406
|
+
const autonomousLoopTickResolverRef = (0, import_react146.useRef)(null);
|
|
40407
|
+
const handleChatCompressionEvent = (0, import_react146.useCallback)(
|
|
40361
40408
|
(eventValue, userMessageTimestamp) => {
|
|
40362
40409
|
autonomousLoopTickResolverRef.current?.resetCache();
|
|
40363
40410
|
if (pendingHistoryItemRef.current) {
|
|
@@ -40385,7 +40432,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
40385
40432
|
setPendingHistoryItem
|
|
40386
40433
|
]
|
|
40387
40434
|
);
|
|
40388
|
-
const handleMaxSessionTurnsEvent = (0,
|
|
40435
|
+
const handleMaxSessionTurnsEvent = (0, import_react146.useCallback)(
|
|
40389
40436
|
() => addItem(
|
|
40390
40437
|
{
|
|
40391
40438
|
type: "info",
|
|
@@ -40395,7 +40442,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
40395
40442
|
),
|
|
40396
40443
|
[addItem, config]
|
|
40397
40444
|
);
|
|
40398
|
-
const handleSessionTokenLimitExceededEvent = (0,
|
|
40445
|
+
const handleSessionTokenLimitExceededEvent = (0, import_react146.useCallback)(
|
|
40399
40446
|
(value) => addItem(
|
|
40400
40447
|
{
|
|
40401
40448
|
type: "error",
|
|
@@ -40410,7 +40457,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
40410
40457
|
),
|
|
40411
40458
|
[addItem]
|
|
40412
40459
|
);
|
|
40413
|
-
const handleLoopDetectionConfirmation = (0,
|
|
40460
|
+
const handleLoopDetectionConfirmation = (0, import_react146.useCallback)(
|
|
40414
40461
|
(result) => {
|
|
40415
40462
|
setLoopDetectionConfirmationRequest(null);
|
|
40416
40463
|
if (result.userSelection === "disable") {
|
|
@@ -40434,12 +40481,12 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
40434
40481
|
},
|
|
40435
40482
|
[config, addItem]
|
|
40436
40483
|
);
|
|
40437
|
-
const handleLoopDetectedEvent = (0,
|
|
40484
|
+
const handleLoopDetectedEvent = (0, import_react146.useCallback)(() => {
|
|
40438
40485
|
setLoopDetectionConfirmationRequest({
|
|
40439
40486
|
onComplete: handleLoopDetectionConfirmation
|
|
40440
40487
|
});
|
|
40441
40488
|
}, [handleLoopDetectionConfirmation]);
|
|
40442
|
-
const handleUserPromptSubmitBlockedEvent = (0,
|
|
40489
|
+
const handleUserPromptSubmitBlockedEvent = (0, import_react146.useCallback)(
|
|
40443
40490
|
(value, userMessageTimestamp) => {
|
|
40444
40491
|
if (pendingHistoryItemRef.current) {
|
|
40445
40492
|
commitItemInOrder(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -40456,7 +40503,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
40456
40503
|
},
|
|
40457
40504
|
[addItem, commitItemInOrder, pendingHistoryItemRef, setPendingHistoryItem]
|
|
40458
40505
|
);
|
|
40459
|
-
const handleStopHookLoopEvent = (0,
|
|
40506
|
+
const handleStopHookLoopEvent = (0, import_react146.useCallback)(
|
|
40460
40507
|
(value, userMessageTimestamp) => {
|
|
40461
40508
|
if (pendingHistoryItemRef.current) {
|
|
40462
40509
|
commitItemInOrder(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -40474,7 +40521,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
40474
40521
|
},
|
|
40475
40522
|
[addItem, commitItemInOrder, pendingHistoryItemRef, setPendingHistoryItem]
|
|
40476
40523
|
);
|
|
40477
|
-
const processLlmStreamEvents = (0,
|
|
40524
|
+
const processLlmStreamEvents = (0, import_react146.useCallback)(
|
|
40478
40525
|
async (stream, userMessageTimestamp, signal, submitType, turnAdmission, promptId, trackInteractionOwner = true, toolContinuationOwner) => {
|
|
40479
40526
|
let llmMessageBuffer = "";
|
|
40480
40527
|
let thoughtBuffer = "";
|
|
@@ -41049,7 +41096,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
41049
41096
|
dualOutput
|
|
41050
41097
|
]
|
|
41051
41098
|
);
|
|
41052
|
-
const resolveSteeredMessages = (0,
|
|
41099
|
+
const resolveSteeredMessages = (0, import_react146.useCallback)(
|
|
41053
41100
|
async (messages, signal) => {
|
|
41054
41101
|
const resolvedSegments = [];
|
|
41055
41102
|
const resolvedForRecording = [];
|
|
@@ -41210,7 +41257,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
41210
41257
|
onDebugMessage
|
|
41211
41258
|
]
|
|
41212
41259
|
);
|
|
41213
|
-
const resolveDrainedSteerMessages = (0,
|
|
41260
|
+
const resolveDrainedSteerMessages = (0, import_react146.useCallback)(
|
|
41214
41261
|
async (messages, signal) => {
|
|
41215
41262
|
try {
|
|
41216
41263
|
const resolved = await resolveSteeredMessages(messages, signal);
|
|
@@ -41247,7 +41294,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
41247
41294
|
},
|
|
41248
41295
|
[midTurnRestoreRef, onDebugMessage, resolveSteeredMessages]
|
|
41249
41296
|
);
|
|
41250
|
-
const drainSteerAtBoundary = (0,
|
|
41297
|
+
const drainSteerAtBoundary = (0, import_react146.useCallback)(
|
|
41251
41298
|
async (signal) => {
|
|
41252
41299
|
const messages = midTurnDrainRef?.current?.(
|
|
41253
41300
|
false,
|
|
@@ -41258,7 +41305,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
41258
41305
|
},
|
|
41259
41306
|
[midTurnDrainRef, resolveDrainedSteerMessages]
|
|
41260
41307
|
);
|
|
41261
|
-
const submitQuery = (0,
|
|
41308
|
+
const submitQuery = (0, import_react146.useCallback)(
|
|
41262
41309
|
async (query, submitType = "userQuery" /* UserQuery */, prompt_id, metadata) => {
|
|
41263
41310
|
const allowConcurrentBtwDuringResponse = submitType === "userQuery" /* UserQuery */ && streamingState === "responding" /* Responding */ && activeModelStreamsRef.current > 0 && typeof query === "string" && isBtwCommand(query) && !activeGoalAdmissionRef.current;
|
|
41264
41311
|
let ownsSubmissionLease = false;
|
|
@@ -41811,7 +41858,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
41811
41858
|
setSubmissionInFlight
|
|
41812
41859
|
]
|
|
41813
41860
|
);
|
|
41814
|
-
const stripTrailingTextsFromLastPrompt = (0,
|
|
41861
|
+
const stripTrailingTextsFromLastPrompt = (0, import_react146.useCallback)((texts) => {
|
|
41815
41862
|
if (texts.length === 0) return;
|
|
41816
41863
|
const lastPrompt = lastPromptRef.current;
|
|
41817
41864
|
if (!Array.isArray(lastPrompt)) return;
|
|
@@ -41823,7 +41870,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
41823
41870
|
lastPromptRef.current = cut > 0 ? lastPrompt.slice(0, cut) : null;
|
|
41824
41871
|
}
|
|
41825
41872
|
}, []);
|
|
41826
|
-
const capturePushedTeammateEntry = (0,
|
|
41873
|
+
const capturePushedTeammateEntry = (0, import_react146.useCallback)(
|
|
41827
41874
|
(envelopeParts) => {
|
|
41828
41875
|
try {
|
|
41829
41876
|
const history2 = llmClient?.getHistoryShallow?.() ?? [];
|
|
@@ -41844,7 +41891,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
41844
41891
|
},
|
|
41845
41892
|
[llmClient]
|
|
41846
41893
|
);
|
|
41847
|
-
const reattachOrphanedRetryEnvelopes = (0,
|
|
41894
|
+
const reattachOrphanedRetryEnvelopes = (0, import_react146.useCallback)(
|
|
41848
41895
|
(query) => {
|
|
41849
41896
|
const debt = boundaryEnvelopeRetryDebtRef.current;
|
|
41850
41897
|
if (debt.length === 0) {
|
|
@@ -41913,7 +41960,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
41913
41960
|
},
|
|
41914
41961
|
[llmClient]
|
|
41915
41962
|
);
|
|
41916
|
-
const retryLastPrompt = (0,
|
|
41963
|
+
const retryLastPrompt = (0, import_react146.useCallback)(async () => {
|
|
41917
41964
|
if (skipRetryDelayRef.current) {
|
|
41918
41965
|
skipRetryDelayRef.current();
|
|
41919
41966
|
skipRetryDelayRef.current = null;
|
|
@@ -41982,12 +42029,12 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
41982
42029
|
capturePushedTeammateEntry,
|
|
41983
42030
|
stripTrailingTextsFromLastPrompt
|
|
41984
42031
|
]);
|
|
41985
|
-
const preemptGoalTurn = (0,
|
|
42032
|
+
const preemptGoalTurn = (0, import_react146.useCallback)((reason) => {
|
|
41986
42033
|
const active = activeGoalAdmissionRef.current;
|
|
41987
42034
|
if (!active || active.controller.signal.aborted) return;
|
|
41988
42035
|
active.controller.abort(reason);
|
|
41989
42036
|
}, []);
|
|
41990
|
-
const handleApprovalModeChange = (0,
|
|
42037
|
+
const handleApprovalModeChange = (0, import_react146.useCallback)(
|
|
41991
42038
|
async (newApprovalMode) => {
|
|
41992
42039
|
if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "auto-edit" /* AUTO_EDIT */) {
|
|
41993
42040
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
@@ -42022,7 +42069,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
42022
42069
|
},
|
|
42023
42070
|
[toolCalls]
|
|
42024
42071
|
);
|
|
42025
|
-
const handleCompletedTools = (0,
|
|
42072
|
+
const handleCompletedTools = (0, import_react146.useCallback)(
|
|
42026
42073
|
async (completedToolCallsFromScheduler) => {
|
|
42027
42074
|
const completedAndReadyToSubmitTools = completedToolCallsFromScheduler.filter(
|
|
42028
42075
|
(tc) => {
|
|
@@ -42867,10 +42914,10 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
42867
42914
|
capturePushedTeammateEntry
|
|
42868
42915
|
]
|
|
42869
42916
|
);
|
|
42870
|
-
(0,
|
|
42917
|
+
(0, import_react146.useLayoutEffect)(() => {
|
|
42871
42918
|
handleCompletedToolsRef.current = handleCompletedTools;
|
|
42872
42919
|
}, [handleCompletedTools]);
|
|
42873
|
-
const pendingHistoryItems = (0,
|
|
42920
|
+
const pendingHistoryItems = (0, import_react146.useMemo)(
|
|
42874
42921
|
() => [
|
|
42875
42922
|
// Reasoning renders above the streaming answer.
|
|
42876
42923
|
pendingThoughtItem,
|
|
@@ -42889,7 +42936,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
42889
42936
|
pendingToolCallGroupDisplay
|
|
42890
42937
|
]
|
|
42891
42938
|
);
|
|
42892
|
-
(0,
|
|
42939
|
+
(0, import_react146.useEffect)(() => {
|
|
42893
42940
|
const saveRestorableToolCalls = /* @__PURE__ */ __name(async () => {
|
|
42894
42941
|
if (!config.getFileCheckpointingEnabled()) {
|
|
42895
42942
|
return;
|
|
@@ -42960,13 +43007,13 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
42960
43007
|
}, "saveRestorableToolCalls");
|
|
42961
43008
|
saveRestorableToolCalls();
|
|
42962
43009
|
}, [toolCalls, config, onDebugMessage, history, llmClient, storage]);
|
|
42963
|
-
const notificationQueueRef = (0,
|
|
42964
|
-
const [notificationTrigger, setNotificationTrigger] = (0,
|
|
42965
|
-
const droppedNotificationsRef = (0,
|
|
42966
|
-
const pendingDroppedSummaryRef = (0,
|
|
43010
|
+
const notificationQueueRef = (0, import_react146.useRef)([]);
|
|
43011
|
+
const [notificationTrigger, setNotificationTrigger] = (0, import_react146.useState)(0);
|
|
43012
|
+
const droppedNotificationsRef = (0, import_react146.useRef)(new DroppedNotificationTally());
|
|
43013
|
+
const pendingDroppedSummaryRef = (0, import_react146.useRef)(
|
|
42967
43014
|
void 0
|
|
42968
43015
|
);
|
|
42969
|
-
const admitNotification = (0,
|
|
43016
|
+
const admitNotification = (0, import_react146.useCallback)(
|
|
42970
43017
|
(item) => {
|
|
42971
43018
|
const queue = notificationQueueRef.current;
|
|
42972
43019
|
const admission = decideNotificationAdmission(queue, item, {
|
|
@@ -42995,9 +43042,9 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
42995
43042
|
},
|
|
42996
43043
|
[config]
|
|
42997
43044
|
);
|
|
42998
|
-
const lastInterimMonitorTurnAtRef = (0,
|
|
43045
|
+
const lastInterimMonitorTurnAtRef = (0, import_react146.useRef)(0);
|
|
42999
43046
|
const goalQueuePendingCount = goalQueueRef?.current?.getPendingSubmissionCount?.() ?? 0;
|
|
43000
|
-
const claimSystemGoalTurn = (0,
|
|
43047
|
+
const claimSystemGoalTurn = (0, import_react146.useCallback)(() => {
|
|
43001
43048
|
if (goalQueueRef?.current?.hasQueuedUserMessages?.()) {
|
|
43002
43049
|
return { ready: false };
|
|
43003
43050
|
}
|
|
@@ -43021,12 +43068,12 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
43021
43068
|
}, "claimGoalTurn")
|
|
43022
43069
|
};
|
|
43023
43070
|
}, [config, goalQueueRef]);
|
|
43024
|
-
const getAutonomousLoopTickResolver = (0,
|
|
43071
|
+
const getAutonomousLoopTickResolver = (0, import_react146.useCallback)(() => {
|
|
43025
43072
|
autonomousLoopTickResolverRef.current ??= new AutonomousLoopTickResolver();
|
|
43026
43073
|
return autonomousLoopTickResolverRef.current;
|
|
43027
43074
|
}, []);
|
|
43028
|
-
const notificationQueueSessionIdRef = (0,
|
|
43029
|
-
(0,
|
|
43075
|
+
const notificationQueueSessionIdRef = (0, import_react146.useRef)(sessionStates.sessionId);
|
|
43076
|
+
(0, import_react146.useEffect)(() => {
|
|
43030
43077
|
if (notificationQueueSessionIdRef.current === sessionStates.sessionId) {
|
|
43031
43078
|
return;
|
|
43032
43079
|
}
|
|
@@ -43036,9 +43083,9 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
43036
43083
|
pendingDroppedSummaryRef.current = void 0;
|
|
43037
43084
|
autonomousLoopTickResolverRef.current?.resetCache();
|
|
43038
43085
|
}, [sessionStates.sessionId]);
|
|
43039
|
-
const cronSessionIdRef = (0,
|
|
43086
|
+
const cronSessionIdRef = (0, import_react146.useRef)(sessionStates.sessionId);
|
|
43040
43087
|
cronSessionIdRef.current = sessionStates.sessionId;
|
|
43041
|
-
(0,
|
|
43088
|
+
(0, import_react146.useEffect)(() => {
|
|
43042
43089
|
if (!isConfigInitialized) return;
|
|
43043
43090
|
if (!config.isCronEnabled()) return;
|
|
43044
43091
|
const scheduler = config.getCronScheduler();
|
|
@@ -43100,7 +43147,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
43100
43147
|
getAutonomousLoopTickResolver,
|
|
43101
43148
|
isConfigInitialized
|
|
43102
43149
|
]);
|
|
43103
|
-
(0,
|
|
43150
|
+
(0, import_react146.useEffect)(() => {
|
|
43104
43151
|
const registry = config.getBackgroundTaskRegistry();
|
|
43105
43152
|
registry.setNotificationCallback((displayText, modelText, meta) => {
|
|
43106
43153
|
admitNotification({
|
|
@@ -43116,7 +43163,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
43116
43163
|
registry.setNotificationCallback(void 0);
|
|
43117
43164
|
};
|
|
43118
43165
|
}, [admitNotification, config]);
|
|
43119
|
-
(0,
|
|
43166
|
+
(0, import_react146.useEffect)(() => {
|
|
43120
43167
|
const registry = config.getBackgroundShellRegistry();
|
|
43121
43168
|
registry.setNotificationCallback((displayText, modelText, meta) => {
|
|
43122
43169
|
admitNotification({
|
|
@@ -43132,7 +43179,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
43132
43179
|
registry.setNotificationCallback(void 0);
|
|
43133
43180
|
};
|
|
43134
43181
|
}, [admitNotification, config]);
|
|
43135
|
-
(0,
|
|
43182
|
+
(0, import_react146.useEffect)(() => {
|
|
43136
43183
|
const registry = config.getWorkflowRunRegistry();
|
|
43137
43184
|
registry.setCompletionCallback((displayText, modelText, meta) => {
|
|
43138
43185
|
admitNotification({
|
|
@@ -43148,7 +43195,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
43148
43195
|
registry.setCompletionCallback(void 0);
|
|
43149
43196
|
};
|
|
43150
43197
|
}, [admitNotification, config]);
|
|
43151
|
-
(0,
|
|
43198
|
+
(0, import_react146.useEffect)(() => {
|
|
43152
43199
|
const registry = config.getMonitorRegistry();
|
|
43153
43200
|
registry.setNotificationCallback((displayText, modelText, meta) => {
|
|
43154
43201
|
if (meta.status === "running" && typeof registry.get === "function") {
|
|
@@ -43170,7 +43217,7 @@ var useLlmStream = /* @__PURE__ */ __name((llmClient, history, addItem, config,
|
|
|
43170
43217
|
registry.setNotificationCallback(void 0);
|
|
43171
43218
|
};
|
|
43172
43219
|
}, [admitNotification, config]);
|
|
43173
|
-
(0,
|
|
43220
|
+
(0, import_react146.useEffect)(() => {
|
|
43174
43221
|
if (streamingState !== "idle" /* Idle */ || isSubmittingQueryRef.current || notificationQueueRef.current.length === 0) {
|
|
43175
43222
|
return void 0;
|
|
43176
43223
|
}
|
|
@@ -43331,7 +43378,7 @@ ${text}` : text, "withDroppedSummary");
|
|
|
43331
43378
|
claimSystemGoalTurn,
|
|
43332
43379
|
goalQueuePendingCount
|
|
43333
43380
|
]);
|
|
43334
|
-
(0,
|
|
43381
|
+
(0, import_react146.useEffect)(() => {
|
|
43335
43382
|
let boundManager = null;
|
|
43336
43383
|
const handleManagerChange = /* @__PURE__ */ __name((manager) => {
|
|
43337
43384
|
if (boundManager && boundManager !== manager) {
|
|
@@ -43362,7 +43409,7 @@ ${text}` : text, "withDroppedSummary");
|
|
|
43362
43409
|
}
|
|
43363
43410
|
};
|
|
43364
43411
|
}, [config]);
|
|
43365
|
-
(0,
|
|
43412
|
+
(0, import_react146.useEffect)(() => {
|
|
43366
43413
|
if (streamingState === "idle" /* Idle */ && !isSubmittingQueryRef.current && teammateQueueRef.current.length > 0) {
|
|
43367
43414
|
runOutsideAgentContext(() => {
|
|
43368
43415
|
const admission = claimSystemGoalTurn();
|
|
@@ -43409,7 +43456,7 @@ ${text}` : text, "withDroppedSummary");
|
|
|
43409
43456
|
|
|
43410
43457
|
// packages/cli/src/ui/hooks/vim.ts
|
|
43411
43458
|
init_esbuild_shims();
|
|
43412
|
-
var
|
|
43459
|
+
var import_react147 = __toESM(require_react(), 1);
|
|
43413
43460
|
import { execFile as execFile7, execFileSync as execFileSync2 } from "child_process";
|
|
43414
43461
|
var DIGIT_MULTIPLIER = 10;
|
|
43415
43462
|
var DEFAULT_COUNT = 1;
|
|
@@ -43645,26 +43692,26 @@ __name(findCharInLineReverse, "findCharInLineReverse");
|
|
|
43645
43692
|
function useVim(buffer, onSubmit) {
|
|
43646
43693
|
const { vimEnabled, vimMode } = useVimModeState();
|
|
43647
43694
|
const { setVimMode } = useVimModeActions();
|
|
43648
|
-
const [state, dispatch] = (0,
|
|
43649
|
-
const bufferRef = (0,
|
|
43650
|
-
const stateRef = (0,
|
|
43695
|
+
const [state, dispatch] = (0, import_react147.useReducer)(vimReducer, initialVimState);
|
|
43696
|
+
const bufferRef = (0, import_react147.useRef)(buffer);
|
|
43697
|
+
const stateRef = (0, import_react147.useRef)(state);
|
|
43651
43698
|
bufferRef.current = buffer;
|
|
43652
43699
|
stateRef.current = state;
|
|
43653
|
-
(0,
|
|
43700
|
+
(0, import_react147.useEffect)(() => {
|
|
43654
43701
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
43655
43702
|
}, [vimMode]);
|
|
43656
|
-
const updateMode = (0,
|
|
43703
|
+
const updateMode = (0, import_react147.useCallback)(
|
|
43657
43704
|
(mode) => {
|
|
43658
43705
|
setVimMode(mode);
|
|
43659
43706
|
dispatch({ type: "SET_MODE", mode });
|
|
43660
43707
|
},
|
|
43661
43708
|
[setVimMode]
|
|
43662
43709
|
);
|
|
43663
|
-
const getCurrentCount = (0,
|
|
43710
|
+
const getCurrentCount = (0, import_react147.useCallback)(
|
|
43664
43711
|
() => stateRef.current.count || DEFAULT_COUNT,
|
|
43665
43712
|
[]
|
|
43666
43713
|
);
|
|
43667
|
-
const yankRange = (0,
|
|
43714
|
+
const yankRange = (0, import_react147.useCallback)(
|
|
43668
43715
|
(startRow, startCol, endRow, endCol, linewise) => {
|
|
43669
43716
|
const lines = bufferRef.current.lines;
|
|
43670
43717
|
let text = "";
|
|
@@ -43679,7 +43726,7 @@ function useVim(buffer, onSubmit) {
|
|
|
43679
43726
|
},
|
|
43680
43727
|
[]
|
|
43681
43728
|
);
|
|
43682
|
-
const executeCommand = (0,
|
|
43729
|
+
const executeCommand = (0, import_react147.useCallback)(
|
|
43683
43730
|
(cmdType, count) => {
|
|
43684
43731
|
switch (cmdType) {
|
|
43685
43732
|
case CMD_TYPES.DELETE_WORD_FORWARD:
|
|
@@ -44080,7 +44127,7 @@ function useVim(buffer, onSubmit) {
|
|
|
44080
44127
|
return { text, linewise: movement === "j" || movement === "k" };
|
|
44081
44128
|
}
|
|
44082
44129
|
__name(extractMovementText, "extractMovementText");
|
|
44083
|
-
const executeFind = (0,
|
|
44130
|
+
const executeFind = (0, import_react147.useCallback)(
|
|
44084
44131
|
(findType, char, count = 1) => {
|
|
44085
44132
|
const [startRow, startCol] = buffer.cursor;
|
|
44086
44133
|
const line = buffer.lines[startRow] ?? "";
|
|
@@ -44116,7 +44163,7 @@ function useVim(buffer, onSubmit) {
|
|
|
44116
44163
|
},
|
|
44117
44164
|
[buffer, dispatch]
|
|
44118
44165
|
);
|
|
44119
|
-
const handleCharRead = (0,
|
|
44166
|
+
const handleCharRead = (0, import_react147.useCallback)(
|
|
44120
44167
|
(char) => {
|
|
44121
44168
|
const readType = state.pendingCharRead;
|
|
44122
44169
|
if (!readType) return false;
|
|
@@ -44159,7 +44206,7 @@ function useVim(buffer, onSubmit) {
|
|
|
44159
44206
|
},
|
|
44160
44207
|
[state.pendingCharRead, buffer, dispatch, executeFind]
|
|
44161
44208
|
);
|
|
44162
|
-
const handleInsertModeInput = (0,
|
|
44209
|
+
const handleInsertModeInput = (0, import_react147.useCallback)(
|
|
44163
44210
|
(normalizedKey) => {
|
|
44164
44211
|
if (normalizedKey.name === "escape") {
|
|
44165
44212
|
buffer.vimEscapeInsertMode();
|
|
@@ -44190,7 +44237,7 @@ function useVim(buffer, onSubmit) {
|
|
|
44190
44237
|
},
|
|
44191
44238
|
[buffer, dispatch, updateMode, onSubmit]
|
|
44192
44239
|
);
|
|
44193
|
-
const normalizeKey = (0,
|
|
44240
|
+
const normalizeKey = (0, import_react147.useCallback)(
|
|
44194
44241
|
(key) => ({
|
|
44195
44242
|
name: key.name || "",
|
|
44196
44243
|
sequence: key.sequence || "",
|
|
@@ -44201,7 +44248,7 @@ function useVim(buffer, onSubmit) {
|
|
|
44201
44248
|
}),
|
|
44202
44249
|
[]
|
|
44203
44250
|
);
|
|
44204
|
-
const handleChangeMovement = (0,
|
|
44251
|
+
const handleChangeMovement = (0, import_react147.useCallback)(
|
|
44205
44252
|
(movement) => {
|
|
44206
44253
|
const count = getCurrentCount();
|
|
44207
44254
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -44222,7 +44269,7 @@ function useVim(buffer, onSubmit) {
|
|
|
44222
44269
|
},
|
|
44223
44270
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
44224
44271
|
);
|
|
44225
|
-
const handleDeleteMovement = (0,
|
|
44272
|
+
const handleDeleteMovement = (0, import_react147.useCallback)(
|
|
44226
44273
|
(movement) => {
|
|
44227
44274
|
const count = getCurrentCount();
|
|
44228
44275
|
const [row, col] = bufferRef.current.cursor;
|
|
@@ -44257,7 +44304,7 @@ function useVim(buffer, onSubmit) {
|
|
|
44257
44304
|
},
|
|
44258
44305
|
[getCurrentCount, dispatch, buffer]
|
|
44259
44306
|
);
|
|
44260
|
-
const handleYankMovement = (0,
|
|
44307
|
+
const handleYankMovement = (0, import_react147.useCallback)(
|
|
44261
44308
|
(movement) => {
|
|
44262
44309
|
const count = getCurrentCount();
|
|
44263
44310
|
const [row, col] = bufferRef.current.cursor;
|
|
@@ -44291,7 +44338,7 @@ function useVim(buffer, onSubmit) {
|
|
|
44291
44338
|
},
|
|
44292
44339
|
[getCurrentCount, dispatch]
|
|
44293
44340
|
);
|
|
44294
|
-
const handleOperatorMotion = (0,
|
|
44341
|
+
const handleOperatorMotion = (0, import_react147.useCallback)(
|
|
44295
44342
|
(operator, motion) => {
|
|
44296
44343
|
const count = getCurrentCount();
|
|
44297
44344
|
const commandMap = {
|
|
@@ -44323,7 +44370,7 @@ function useVim(buffer, onSubmit) {
|
|
|
44323
44370
|
},
|
|
44324
44371
|
[getCurrentCount, executeCommand, dispatch]
|
|
44325
44372
|
);
|
|
44326
|
-
const handleInput = (0,
|
|
44373
|
+
const handleInput = (0, import_react147.useCallback)(
|
|
44327
44374
|
(key) => {
|
|
44328
44375
|
if (!vimEnabled) {
|
|
44329
44376
|
return false;
|
|
@@ -45107,7 +45154,7 @@ __name(buildWorkflowSizeGuidelineChangePrefix, "buildWorkflowSizeGuidelineChange
|
|
|
45107
45154
|
|
|
45108
45155
|
// packages/cli/src/ui/hooks/useAwaySummary.ts
|
|
45109
45156
|
init_esbuild_shims();
|
|
45110
|
-
var
|
|
45157
|
+
var import_react148 = __toESM(require_react(), 1);
|
|
45111
45158
|
var DEFAULT_AWAY_THRESHOLD_MINUTES = 5;
|
|
45112
45159
|
var MIN_USER_MESSAGES_TO_FIRE = 3;
|
|
45113
45160
|
var MIN_USER_MESSAGES_SINCE_LAST_RECAP = 2;
|
|
@@ -45139,15 +45186,15 @@ function useAwaySummary(options) {
|
|
|
45139
45186
|
history,
|
|
45140
45187
|
awayThresholdMinutes
|
|
45141
45188
|
} = options;
|
|
45142
|
-
const blurredAtRef = (0,
|
|
45143
|
-
const recapPendingRef = (0,
|
|
45144
|
-
const inFlightRef = (0,
|
|
45145
|
-
const isIdleRef = (0,
|
|
45189
|
+
const blurredAtRef = (0, import_react148.useRef)(null);
|
|
45190
|
+
const recapPendingRef = (0, import_react148.useRef)(false);
|
|
45191
|
+
const inFlightRef = (0, import_react148.useRef)(null);
|
|
45192
|
+
const isIdleRef = (0, import_react148.useRef)(isIdle);
|
|
45146
45193
|
isIdleRef.current = isIdle;
|
|
45147
|
-
const historyRef = (0,
|
|
45194
|
+
const historyRef = (0, import_react148.useRef)(history);
|
|
45148
45195
|
historyRef.current = history;
|
|
45149
45196
|
const thresholdMs = (awayThresholdMinutes && awayThresholdMinutes > 0 ? awayThresholdMinutes : DEFAULT_AWAY_THRESHOLD_MINUTES) * 60 * 1e3;
|
|
45150
|
-
(0,
|
|
45197
|
+
(0, import_react148.useEffect)(() => {
|
|
45151
45198
|
if (!enabled || !config) {
|
|
45152
45199
|
inFlightRef.current?.abort();
|
|
45153
45200
|
inFlightRef.current = null;
|
|
@@ -45199,7 +45246,7 @@ function useAwaySummary(options) {
|
|
|
45199
45246
|
recapPendingRef.current = false;
|
|
45200
45247
|
});
|
|
45201
45248
|
}, [enabled, config, isFocused, isIdle, addItem, thresholdMs]);
|
|
45202
|
-
(0,
|
|
45249
|
+
(0, import_react148.useEffect)(
|
|
45203
45250
|
() => () => {
|
|
45204
45251
|
inFlightRef.current?.abort();
|
|
45205
45252
|
},
|
|
@@ -45210,14 +45257,14 @@ __name(useAwaySummary, "useAwaySummary");
|
|
|
45210
45257
|
|
|
45211
45258
|
// packages/cli/src/ui/hooks/useBracketedPaste.ts
|
|
45212
45259
|
init_esbuild_shims();
|
|
45213
|
-
var
|
|
45260
|
+
var import_react149 = __toESM(require_react(), 1);
|
|
45214
45261
|
var ENABLE_BRACKETED_PASTE = "\x1B[?2004h";
|
|
45215
45262
|
var DISABLE_BRACKETED_PASTE = "\x1B[?2004l";
|
|
45216
45263
|
var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
45217
45264
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
45218
45265
|
process.stdout.write(DISABLE_BRACKETED_PASTE);
|
|
45219
45266
|
}, "cleanup");
|
|
45220
|
-
(0,
|
|
45267
|
+
(0, import_react149.useEffect)(() => {
|
|
45221
45268
|
process.stdout.write(ENABLE_BRACKETED_PASTE);
|
|
45222
45269
|
process.on("exit", cleanup);
|
|
45223
45270
|
process.on("SIGINT", cleanup);
|
|
@@ -45236,23 +45283,23 @@ init_esbuild_shims();
|
|
|
45236
45283
|
|
|
45237
45284
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
45238
45285
|
init_esbuild_shims();
|
|
45239
|
-
var
|
|
45286
|
+
var import_react150 = __toESM(require_react(), 1);
|
|
45240
45287
|
var WITTY_LOADING_PHRASES = ["I'm Feeling Lucky"];
|
|
45241
45288
|
var PHRASE_CHANGE_INTERVAL_MS = 15e3;
|
|
45242
45289
|
var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases) => {
|
|
45243
45290
|
const currentLanguage = getCurrentLanguage();
|
|
45244
|
-
const loadingPhrases = (0,
|
|
45291
|
+
const loadingPhrases = (0, import_react150.useMemo)(() => {
|
|
45245
45292
|
if (customPhrases && customPhrases.length > 0) {
|
|
45246
45293
|
return customPhrases;
|
|
45247
45294
|
}
|
|
45248
45295
|
const translatedPhrases = ta("WITTY_LOADING_PHRASES");
|
|
45249
45296
|
return translatedPhrases.length > 0 ? translatedPhrases : WITTY_LOADING_PHRASES;
|
|
45250
45297
|
}, [customPhrases, currentLanguage]);
|
|
45251
|
-
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0,
|
|
45298
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0, import_react150.useState)(
|
|
45252
45299
|
loadingPhrases[0]
|
|
45253
45300
|
);
|
|
45254
|
-
const phraseIntervalRef = (0,
|
|
45255
|
-
(0,
|
|
45301
|
+
const phraseIntervalRef = (0, import_react150.useRef)(null);
|
|
45302
|
+
(0, import_react150.useEffect)(() => {
|
|
45256
45303
|
if (isWaiting) {
|
|
45257
45304
|
setCurrentLoadingPhrase(t("Waiting for user confirmation..."));
|
|
45258
45305
|
if (phraseIntervalRef.current) {
|
|
@@ -45289,9 +45336,9 @@ var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases
|
|
|
45289
45336
|
}, "usePhraseCycler");
|
|
45290
45337
|
|
|
45291
45338
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
45292
|
-
var
|
|
45339
|
+
var import_react151 = __toESM(require_react(), 1);
|
|
45293
45340
|
var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhrases, currentCandidatesTokens, currentStreamingChars, isToolExecuting2 = false) => {
|
|
45294
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
45341
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react151.useState)(0);
|
|
45295
45342
|
const isTimerActive = streamingState === "responding" /* Responding */;
|
|
45296
45343
|
const elapsedClock = useTimerClock(
|
|
45297
45344
|
isTimerActive,
|
|
@@ -45305,16 +45352,16 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
45305
45352
|
isWaiting,
|
|
45306
45353
|
customWittyPhrases
|
|
45307
45354
|
);
|
|
45308
|
-
const [taskStartTokens, setTaskStartTokensState] = (0,
|
|
45309
|
-
const [taskStartStreamingChars, setTaskStartStreamingCharsState] = (0,
|
|
45310
|
-
const taskStartTokensRef = (0,
|
|
45311
|
-
const taskStartStreamingCharsRef = (0,
|
|
45312
|
-
const pauseStartTokensRef = (0,
|
|
45313
|
-
const pauseStartStreamingCharsRef = (0,
|
|
45314
|
-
const pauseBaseTaskStartTokensRef = (0,
|
|
45315
|
-
const pauseBaseTaskStartStreamingCharsRef = (0,
|
|
45316
|
-
const prevStreamingStateRef = (0,
|
|
45317
|
-
(0,
|
|
45355
|
+
const [taskStartTokens, setTaskStartTokensState] = (0, import_react151.useState)(0);
|
|
45356
|
+
const [taskStartStreamingChars, setTaskStartStreamingCharsState] = (0, import_react151.useState)(0);
|
|
45357
|
+
const taskStartTokensRef = (0, import_react151.useRef)(0);
|
|
45358
|
+
const taskStartStreamingCharsRef = (0, import_react151.useRef)(0);
|
|
45359
|
+
const pauseStartTokensRef = (0, import_react151.useRef)(null);
|
|
45360
|
+
const pauseStartStreamingCharsRef = (0, import_react151.useRef)(null);
|
|
45361
|
+
const pauseBaseTaskStartTokensRef = (0, import_react151.useRef)(0);
|
|
45362
|
+
const pauseBaseTaskStartStreamingCharsRef = (0, import_react151.useRef)(0);
|
|
45363
|
+
const prevStreamingStateRef = (0, import_react151.useRef)(null);
|
|
45364
|
+
(0, import_react151.useEffect)(() => {
|
|
45318
45365
|
const currentTokens = currentCandidatesTokens ?? 0;
|
|
45319
45366
|
const currentChars = currentStreamingChars ?? 0;
|
|
45320
45367
|
const setTaskStartTokens = /* @__PURE__ */ __name((tokens) => {
|
|
@@ -45380,7 +45427,7 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
45380
45427
|
|
|
45381
45428
|
// packages/cli/src/ui/hooks/useTerminalProgress.ts
|
|
45382
45429
|
init_esbuild_shims();
|
|
45383
|
-
var
|
|
45430
|
+
var import_react152 = __toESM(require_react(), 1);
|
|
45384
45431
|
var PROGRESS_CLEAR = wrapForMultiplexer(`${OSC_PREFIX}9;4;0;${BEL}`);
|
|
45385
45432
|
var PROGRESS_INDETERMINATE = wrapForMultiplexer(`${OSC_PREFIX}9;4;3;;${BEL}`);
|
|
45386
45433
|
function isProgressBarSupported() {
|
|
@@ -45395,13 +45442,13 @@ function isProgressBarSupported() {
|
|
|
45395
45442
|
__name(isProgressBarSupported, "isProgressBarSupported");
|
|
45396
45443
|
function useTerminalProgress(streamingState, hasToolExecuting) {
|
|
45397
45444
|
const { stdout } = use_stdout_default();
|
|
45398
|
-
const writeProgress = (0,
|
|
45445
|
+
const writeProgress = (0, import_react152.useCallback)(
|
|
45399
45446
|
(seq) => {
|
|
45400
45447
|
stdout?.write(seq);
|
|
45401
45448
|
},
|
|
45402
45449
|
[stdout]
|
|
45403
45450
|
);
|
|
45404
|
-
(0,
|
|
45451
|
+
(0, import_react152.useEffect)(() => {
|
|
45405
45452
|
if (!isProgressBarSupported()) return;
|
|
45406
45453
|
if (streamingState === "responding" /* Responding */ && hasToolExecuting) {
|
|
45407
45454
|
writeProgress(PROGRESS_INDETERMINATE);
|
|
@@ -45412,7 +45459,7 @@ function useTerminalProgress(streamingState, hasToolExecuting) {
|
|
|
45412
45459
|
writeProgress(PROGRESS_CLEAR);
|
|
45413
45460
|
};
|
|
45414
45461
|
}, [streamingState, hasToolExecuting, writeProgress]);
|
|
45415
|
-
(0,
|
|
45462
|
+
(0, import_react152.useEffect)(() => {
|
|
45416
45463
|
if (!isProgressBarSupported()) return;
|
|
45417
45464
|
const clearOnExit = /* @__PURE__ */ __name(() => {
|
|
45418
45465
|
stdout?.write(PROGRESS_CLEAR);
|
|
@@ -45427,20 +45474,20 @@ __name(useTerminalProgress, "useTerminalProgress");
|
|
|
45427
45474
|
|
|
45428
45475
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
45429
45476
|
init_esbuild_shims();
|
|
45430
|
-
var
|
|
45477
|
+
var import_react153 = __toESM(require_react(), 1);
|
|
45431
45478
|
import * as process17 from "node:process";
|
|
45432
45479
|
var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
45433
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
45434
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
45435
|
-
const [isRestarting, setIsRestarting] = (0,
|
|
45480
|
+
const [isTrusted, setIsTrusted] = (0, import_react153.useState)(void 0);
|
|
45481
|
+
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0, import_react153.useState)(false);
|
|
45482
|
+
const [isRestarting, setIsRestarting] = (0, import_react153.useState)(false);
|
|
45436
45483
|
const folderTrust = settings.merged.security?.folderTrust?.enabled;
|
|
45437
|
-
(0,
|
|
45484
|
+
(0, import_react153.useEffect)(() => {
|
|
45438
45485
|
const { isTrusted: trusted } = isWorkspaceTrusted(settings.merged);
|
|
45439
45486
|
setIsTrusted(trusted);
|
|
45440
45487
|
setIsFolderTrustDialogOpen(trusted === void 0);
|
|
45441
45488
|
onTrustChange(trusted);
|
|
45442
45489
|
}, [folderTrust, onTrustChange, settings.merged]);
|
|
45443
|
-
const handleFolderTrustSelect = (0,
|
|
45490
|
+
const handleFolderTrustSelect = (0, import_react153.useCallback)(
|
|
45444
45491
|
(choice) => {
|
|
45445
45492
|
const trustedFolders = loadTrustedFolders();
|
|
45446
45493
|
const cwd3 = process17.cwd();
|
|
@@ -45491,7 +45538,7 @@ var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
|
45491
45538
|
|
|
45492
45539
|
// packages/cli/src/ui/hooks/useMcpApproval.ts
|
|
45493
45540
|
init_esbuild_shims();
|
|
45494
|
-
var
|
|
45541
|
+
var import_react154 = __toESM(require_react(), 1);
|
|
45495
45542
|
function sourceLabel(scope) {
|
|
45496
45543
|
switch (scope) {
|
|
45497
45544
|
case "workspace":
|
|
@@ -45527,8 +45574,8 @@ function summarize(config) {
|
|
|
45527
45574
|
}
|
|
45528
45575
|
__name(summarize, "summarize");
|
|
45529
45576
|
var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
45530
|
-
const [queue, setQueue] = (0,
|
|
45531
|
-
const computePending = (0,
|
|
45577
|
+
const [queue, setQueue] = (0, import_react154.useState)([]);
|
|
45578
|
+
const computePending = (0, import_react154.useCallback)(() => {
|
|
45532
45579
|
if (config.getApprovalMode() === "yolo" /* YOLO */) return [];
|
|
45533
45580
|
const servers = config.getMcpServers() ?? {};
|
|
45534
45581
|
const approvals = loadMcpApprovals();
|
|
@@ -45540,10 +45587,10 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
45540
45587
|
source: sourceLabel(c.scope)
|
|
45541
45588
|
}));
|
|
45542
45589
|
}, [config]);
|
|
45543
|
-
(0,
|
|
45590
|
+
(0, import_react154.useEffect)(() => {
|
|
45544
45591
|
setQueue(computePending());
|
|
45545
45592
|
}, [computePending]);
|
|
45546
|
-
(0,
|
|
45593
|
+
(0, import_react154.useEffect)(() => {
|
|
45547
45594
|
const onPendingChanged = /* @__PURE__ */ __name(() => {
|
|
45548
45595
|
setQueue(computePending());
|
|
45549
45596
|
}, "onPendingChanged");
|
|
@@ -45552,7 +45599,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
45552
45599
|
appEvents.off("mcp-pending-approval-changed" /* McpPendingApprovalChanged */, onPendingChanged);
|
|
45553
45600
|
};
|
|
45554
45601
|
}, [computePending]);
|
|
45555
|
-
const reconnect = (0,
|
|
45602
|
+
const reconnect = (0, import_react154.useCallback)(
|
|
45556
45603
|
(name) => {
|
|
45557
45604
|
config.approveMcpServerForSession(name);
|
|
45558
45605
|
const registry = config.getToolRegistry();
|
|
@@ -45564,7 +45611,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
45564
45611
|
},
|
|
45565
45612
|
[config]
|
|
45566
45613
|
);
|
|
45567
|
-
const handleMcpApprovalSelect = (0,
|
|
45614
|
+
const handleMcpApprovalSelect = (0, import_react154.useCallback)(
|
|
45568
45615
|
async (choice) => {
|
|
45569
45616
|
const approvals = loadMcpApprovals();
|
|
45570
45617
|
const root = config.getWorkingDir();
|
|
@@ -45616,7 +45663,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
45616
45663
|
|
|
45617
45664
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
45618
45665
|
init_esbuild_shims();
|
|
45619
|
-
var
|
|
45666
|
+
var import_react155 = __toESM(require_react(), 1);
|
|
45620
45667
|
|
|
45621
45668
|
// packages/cli/src/services/command-migration-tool.ts
|
|
45622
45669
|
init_esbuild_shims();
|
|
@@ -45687,9 +45734,9 @@ __name(migrateTomlCommands, "migrateTomlCommands");
|
|
|
45687
45734
|
|
|
45688
45735
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
45689
45736
|
function useCommandMigration(settings, storage) {
|
|
45690
|
-
const [showMigrationNudge, setShowMigrationNudge] = (0,
|
|
45691
|
-
const [tomlFiles, setTomlFiles] = (0,
|
|
45692
|
-
(0,
|
|
45737
|
+
const [showMigrationNudge, setShowMigrationNudge] = (0, import_react155.useState)(false);
|
|
45738
|
+
const [tomlFiles, setTomlFiles] = (0, import_react155.useState)([]);
|
|
45739
|
+
(0, import_react155.useEffect)(() => {
|
|
45693
45740
|
let cancelled = false;
|
|
45694
45741
|
const checkTomlCommands = /* @__PURE__ */ __name(async () => {
|
|
45695
45742
|
const allFiles = [];
|
|
@@ -45757,13 +45804,13 @@ __name(sendNotification, "sendNotification");
|
|
|
45757
45804
|
|
|
45758
45805
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
45759
45806
|
init_esbuild_shims();
|
|
45760
|
-
var
|
|
45807
|
+
var import_react156 = __toESM(require_react(), 1);
|
|
45761
45808
|
var BRANCH_POLL_INTERVAL_MS = 5e3;
|
|
45762
45809
|
function useGitBranchName(cwd3) {
|
|
45763
|
-
const [branchName, setBranchName] = (0,
|
|
45764
|
-
const branchNameRef = (0,
|
|
45810
|
+
const [branchName, setBranchName] = (0, import_react156.useState)(void 0);
|
|
45811
|
+
const branchNameRef = (0, import_react156.useRef)(branchName);
|
|
45765
45812
|
branchNameRef.current = branchName;
|
|
45766
|
-
(0,
|
|
45813
|
+
(0, import_react156.useEffect)(() => {
|
|
45767
45814
|
let cancelled = false;
|
|
45768
45815
|
let dispose;
|
|
45769
45816
|
let pollTimer;
|
|
@@ -45809,13 +45856,13 @@ __name(useGitBranchName, "useGitBranchName");
|
|
|
45809
45856
|
|
|
45810
45857
|
// packages/cli/src/ui/hooks/useWorktreeSession.ts
|
|
45811
45858
|
init_esbuild_shims();
|
|
45812
|
-
var
|
|
45859
|
+
var import_react157 = __toESM(require_react(), 1);
|
|
45813
45860
|
import fs17 from "node:fs";
|
|
45814
45861
|
import fsPromises from "node:fs/promises";
|
|
45815
45862
|
import path12 from "node:path";
|
|
45816
45863
|
function useWorktreeSession(config) {
|
|
45817
|
-
const [session, setSession] = (0,
|
|
45818
|
-
(0,
|
|
45864
|
+
const [session, setSession] = (0, import_react157.useState)(null);
|
|
45865
|
+
(0, import_react157.useEffect)(() => {
|
|
45819
45866
|
if (config.getShellExecutionSandbox?.()) {
|
|
45820
45867
|
setSession(null);
|
|
45821
45868
|
return;
|
|
@@ -45859,7 +45906,7 @@ __name(useWorktreeSession, "useWorktreeSession");
|
|
|
45859
45906
|
|
|
45860
45907
|
// packages/cli/src/ui/hooks/useExtensionUpdates.ts
|
|
45861
45908
|
init_esbuild_shims();
|
|
45862
|
-
var
|
|
45909
|
+
var import_react158 = __toESM(require_react(), 1);
|
|
45863
45910
|
function confirmationRequestsReducer(state, action) {
|
|
45864
45911
|
switch (action.type) {
|
|
45865
45912
|
case "add":
|
|
@@ -45876,8 +45923,8 @@ var useConfirmUpdateRequests = /* @__PURE__ */ __name(() => {
|
|
|
45876
45923
|
const [
|
|
45877
45924
|
confirmUpdateExtensionRequests,
|
|
45878
45925
|
dispatchConfirmUpdateExtensionRequests
|
|
45879
|
-
] = (0,
|
|
45880
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
45926
|
+
] = (0, import_react158.useReducer)(confirmationRequestsReducer, []);
|
|
45927
|
+
const addConfirmUpdateExtensionRequest = (0, import_react158.useCallback)(
|
|
45881
45928
|
(original) => {
|
|
45882
45929
|
const wrappedRequest = {
|
|
45883
45930
|
prompt: original.prompt,
|
|
@@ -45915,11 +45962,11 @@ function settingInputRequestsReducer(state, action) {
|
|
|
45915
45962
|
}
|
|
45916
45963
|
__name(settingInputRequestsReducer, "settingInputRequestsReducer");
|
|
45917
45964
|
var useSettingInputRequests = /* @__PURE__ */ __name(() => {
|
|
45918
|
-
const [settingInputRequests, dispatchSettingInputRequests] = (0,
|
|
45965
|
+
const [settingInputRequests, dispatchSettingInputRequests] = (0, import_react158.useReducer)(
|
|
45919
45966
|
settingInputRequestsReducer,
|
|
45920
45967
|
[]
|
|
45921
45968
|
);
|
|
45922
|
-
const addSettingInputRequest = (0,
|
|
45969
|
+
const addSettingInputRequest = (0, import_react158.useCallback)(
|
|
45923
45970
|
(original) => {
|
|
45924
45971
|
const wrappedRequest = {
|
|
45925
45972
|
settingName: original.settingName,
|
|
@@ -45966,11 +46013,11 @@ function pluginChoiceRequestsReducer(state, action) {
|
|
|
45966
46013
|
}
|
|
45967
46014
|
__name(pluginChoiceRequestsReducer, "pluginChoiceRequestsReducer");
|
|
45968
46015
|
var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
45969
|
-
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0,
|
|
46016
|
+
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0, import_react158.useReducer)(
|
|
45970
46017
|
pluginChoiceRequestsReducer,
|
|
45971
46018
|
[]
|
|
45972
46019
|
);
|
|
45973
|
-
const addPluginChoiceRequest = (0,
|
|
46020
|
+
const addPluginChoiceRequest = (0, import_react158.useCallback)(
|
|
45974
46021
|
(original) => {
|
|
45975
46022
|
const wrappedRequest = {
|
|
45976
46023
|
marketplaceName: original.marketplaceName,
|
|
@@ -46004,12 +46051,12 @@ var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
|
46004
46051
|
};
|
|
46005
46052
|
}, "usePluginChoiceRequests");
|
|
46006
46053
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd3) => {
|
|
46007
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
46054
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react158.useReducer)(
|
|
46008
46055
|
extensionUpdatesReducer,
|
|
46009
46056
|
initialExtensionUpdatesState
|
|
46010
46057
|
);
|
|
46011
46058
|
const extensions = extensionManager.getLoadedExtensions();
|
|
46012
|
-
(0,
|
|
46059
|
+
(0, import_react158.useEffect)(() => {
|
|
46013
46060
|
(async () => {
|
|
46014
46061
|
const extensionsToCheck = extensions.filter((extension) => {
|
|
46015
46062
|
const currentStatus = extensionsUpdateState.extensionStatuses.get(
|
|
@@ -46037,7 +46084,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
46037
46084
|
extensionsUpdateState.extensionStatuses,
|
|
46038
46085
|
dispatchExtensionStateUpdate
|
|
46039
46086
|
]);
|
|
46040
|
-
(0,
|
|
46087
|
+
(0, import_react158.useEffect)(() => {
|
|
46041
46088
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
46042
46089
|
return;
|
|
46043
46090
|
}
|
|
@@ -46106,7 +46153,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
46106
46153
|
);
|
|
46107
46154
|
}
|
|
46108
46155
|
}, [extensions, extensionManager, extensionsUpdateState, addItem, cwd3]);
|
|
46109
|
-
const extensionsUpdateStateComputed = (0,
|
|
46156
|
+
const extensionsUpdateStateComputed = (0, import_react158.useMemo)(() => {
|
|
46110
46157
|
const result = /* @__PURE__ */ new Map();
|
|
46111
46158
|
for (const [
|
|
46112
46159
|
key,
|
|
@@ -46125,14 +46172,14 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
46125
46172
|
|
|
46126
46173
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
46127
46174
|
init_esbuild_shims();
|
|
46128
|
-
var
|
|
46175
|
+
var import_react159 = __toESM(require_react(), 1);
|
|
46129
46176
|
function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
46130
|
-
const [welcomeBackInfo, setWelcomeBackInfo] = (0,
|
|
46131
|
-
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0,
|
|
46132
|
-
const [welcomeBackChoice, setWelcomeBackChoice] = (0,
|
|
46133
|
-
const [shouldFillInput, setShouldFillInput] = (0,
|
|
46134
|
-
const [inputFillText, setInputFillText] = (0,
|
|
46135
|
-
const checkWelcomeBack = (0,
|
|
46177
|
+
const [welcomeBackInfo, setWelcomeBackInfo] = (0, import_react159.useState)(null);
|
|
46178
|
+
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0, import_react159.useState)(false);
|
|
46179
|
+
const [welcomeBackChoice, setWelcomeBackChoice] = (0, import_react159.useState)(null);
|
|
46180
|
+
const [shouldFillInput, setShouldFillInput] = (0, import_react159.useState)(false);
|
|
46181
|
+
const [inputFillText, setInputFillText] = (0, import_react159.useState)(null);
|
|
46182
|
+
const checkWelcomeBack = (0, import_react159.useCallback)(async () => {
|
|
46136
46183
|
if (settings.ui?.enableWelcomeBack === false) {
|
|
46137
46184
|
return;
|
|
46138
46185
|
}
|
|
@@ -46151,7 +46198,7 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
46151
46198
|
config.getDebugLogger().debug("Welcome back check failed:", error);
|
|
46152
46199
|
}
|
|
46153
46200
|
}, [config, settings.ui?.enableWelcomeBack]);
|
|
46154
|
-
const handleWelcomeBackSelection = (0,
|
|
46201
|
+
const handleWelcomeBackSelection = (0, import_react159.useCallback)(
|
|
46155
46202
|
(choice) => {
|
|
46156
46203
|
setWelcomeBackChoice(choice);
|
|
46157
46204
|
setShowWelcomeBackDialog(false);
|
|
@@ -46175,21 +46222,21 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
46175
46222
|
},
|
|
46176
46223
|
[config, welcomeBackInfo]
|
|
46177
46224
|
);
|
|
46178
|
-
const handleWelcomeBackClose = (0,
|
|
46225
|
+
const handleWelcomeBackClose = (0, import_react159.useCallback)(() => {
|
|
46179
46226
|
setWelcomeBackChoice("restart");
|
|
46180
46227
|
setShowWelcomeBackDialog(false);
|
|
46181
46228
|
}, []);
|
|
46182
|
-
const clearInputFill = (0,
|
|
46229
|
+
const clearInputFill = (0, import_react159.useCallback)(() => {
|
|
46183
46230
|
setShouldFillInput(false);
|
|
46184
46231
|
setInputFillText(null);
|
|
46185
46232
|
}, []);
|
|
46186
|
-
(0,
|
|
46233
|
+
(0, import_react159.useEffect)(() => {
|
|
46187
46234
|
if (shouldFillInput && inputFillText) {
|
|
46188
46235
|
buffer.setText(inputFillText);
|
|
46189
46236
|
clearInputFill();
|
|
46190
46237
|
}
|
|
46191
46238
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
46192
|
-
(0,
|
|
46239
|
+
(0, import_react159.useEffect)(() => {
|
|
46193
46240
|
checkWelcomeBack();
|
|
46194
46241
|
}, [checkWelcomeBack]);
|
|
46195
46242
|
return {
|
|
@@ -46210,9 +46257,9 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
46210
46257
|
|
|
46211
46258
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
46212
46259
|
init_esbuild_shims();
|
|
46213
|
-
var
|
|
46260
|
+
var import_react160 = __toESM(require_react(), 1);
|
|
46214
46261
|
function useDialogClose(options) {
|
|
46215
|
-
const closeAnyOpenDialog = (0,
|
|
46262
|
+
const closeAnyOpenDialog = (0, import_react160.useCallback)(() => {
|
|
46216
46263
|
if (options.isThemeDialogOpen) {
|
|
46217
46264
|
options.handleThemeSelect(void 0, "User" /* User */);
|
|
46218
46265
|
return true;
|
|
@@ -46288,14 +46335,14 @@ __name(useDialogClose, "useDialogClose");
|
|
|
46288
46335
|
|
|
46289
46336
|
// packages/cli/src/ui/hooks/useInitializationAuthError.ts
|
|
46290
46337
|
init_esbuild_shims();
|
|
46291
|
-
var
|
|
46338
|
+
var import_react161 = __toESM(require_react(), 1);
|
|
46292
46339
|
var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError) => {
|
|
46293
|
-
const hasHandled = (0,
|
|
46294
|
-
const authErrorRef = (0,
|
|
46295
|
-
const onAuthErrorRef = (0,
|
|
46340
|
+
const hasHandled = (0, import_react161.useRef)(false);
|
|
46341
|
+
const authErrorRef = (0, import_react161.useRef)(authError);
|
|
46342
|
+
const onAuthErrorRef = (0, import_react161.useRef)(onAuthError);
|
|
46296
46343
|
authErrorRef.current = authError;
|
|
46297
46344
|
onAuthErrorRef.current = onAuthError;
|
|
46298
|
-
(0,
|
|
46345
|
+
(0, import_react161.useEffect)(() => {
|
|
46299
46346
|
if (hasHandled.current) {
|
|
46300
46347
|
return;
|
|
46301
46348
|
}
|
|
@@ -46308,13 +46355,13 @@ var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError)
|
|
|
46308
46355
|
|
|
46309
46356
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
46310
46357
|
init_esbuild_shims();
|
|
46311
|
-
var
|
|
46358
|
+
var import_react162 = __toESM(require_react(), 1);
|
|
46312
46359
|
function useSubagentCreateDialog() {
|
|
46313
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
46314
|
-
const openSubagentCreateDialog = (0,
|
|
46360
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react162.useState)(false);
|
|
46361
|
+
const openSubagentCreateDialog = (0, import_react162.useCallback)(() => {
|
|
46315
46362
|
setIsSubagentCreateDialogOpen(true);
|
|
46316
46363
|
}, []);
|
|
46317
|
-
const closeSubagentCreateDialog = (0,
|
|
46364
|
+
const closeSubagentCreateDialog = (0, import_react162.useCallback)(() => {
|
|
46318
46365
|
setIsSubagentCreateDialogOpen(false);
|
|
46319
46366
|
}, []);
|
|
46320
46367
|
return {
|
|
@@ -46327,13 +46374,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
46327
46374
|
|
|
46328
46375
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
46329
46376
|
init_esbuild_shims();
|
|
46330
|
-
var
|
|
46377
|
+
var import_react163 = __toESM(require_react(), 1);
|
|
46331
46378
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
46332
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
46333
|
-
const openAgentsManagerDialog = (0,
|
|
46379
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react163.useState)(false);
|
|
46380
|
+
const openAgentsManagerDialog = (0, import_react163.useCallback)(() => {
|
|
46334
46381
|
setIsAgentsManagerDialogOpen(true);
|
|
46335
46382
|
}, []);
|
|
46336
|
-
const closeAgentsManagerDialog = (0,
|
|
46383
|
+
const closeAgentsManagerDialog = (0, import_react163.useCallback)(() => {
|
|
46337
46384
|
setIsAgentsManagerDialogOpen(false);
|
|
46338
46385
|
}, []);
|
|
46339
46386
|
return {
|
|
@@ -46345,13 +46392,13 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
46345
46392
|
|
|
46346
46393
|
// packages/cli/src/ui/hooks/useSkillsManagerDialog.ts
|
|
46347
46394
|
init_esbuild_shims();
|
|
46348
|
-
var
|
|
46395
|
+
var import_react164 = __toESM(require_react(), 1);
|
|
46349
46396
|
var useSkillsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
46350
|
-
const [isSkillsManagerDialogOpen, setIsSkillsManagerDialogOpen] = (0,
|
|
46351
|
-
const openSkillsManagerDialog = (0,
|
|
46397
|
+
const [isSkillsManagerDialogOpen, setIsSkillsManagerDialogOpen] = (0, import_react164.useState)(false);
|
|
46398
|
+
const openSkillsManagerDialog = (0, import_react164.useCallback)(() => {
|
|
46352
46399
|
setIsSkillsManagerDialogOpen(true);
|
|
46353
46400
|
}, []);
|
|
46354
|
-
const closeSkillsManagerDialog = (0,
|
|
46401
|
+
const closeSkillsManagerDialog = (0, import_react164.useCallback)(() => {
|
|
46355
46402
|
setIsSkillsManagerDialogOpen(false);
|
|
46356
46403
|
}, []);
|
|
46357
46404
|
return {
|
|
@@ -46363,13 +46410,13 @@ var useSkillsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
46363
46410
|
|
|
46364
46411
|
// packages/cli/src/ui/hooks/useExtensionsManagerDialog.ts
|
|
46365
46412
|
init_esbuild_shims();
|
|
46366
|
-
var
|
|
46413
|
+
var import_react165 = __toESM(require_react(), 1);
|
|
46367
46414
|
var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
46368
|
-
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0,
|
|
46369
|
-
const openExtensionsManagerDialog = (0,
|
|
46415
|
+
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0, import_react165.useState)(false);
|
|
46416
|
+
const openExtensionsManagerDialog = (0, import_react165.useCallback)(() => {
|
|
46370
46417
|
setIsExtensionsManagerDialogOpen(true);
|
|
46371
46418
|
}, []);
|
|
46372
|
-
const closeExtensionsManagerDialog = (0,
|
|
46419
|
+
const closeExtensionsManagerDialog = (0, import_react165.useCallback)(() => {
|
|
46373
46420
|
setIsExtensionsManagerDialogOpen(false);
|
|
46374
46421
|
}, []);
|
|
46375
46422
|
return {
|
|
@@ -46381,13 +46428,13 @@ var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
46381
46428
|
|
|
46382
46429
|
// packages/cli/src/ui/hooks/useMcpDialog.ts
|
|
46383
46430
|
init_esbuild_shims();
|
|
46384
|
-
var
|
|
46431
|
+
var import_react166 = __toESM(require_react(), 1);
|
|
46385
46432
|
var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
46386
|
-
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0,
|
|
46387
|
-
const openMcpDialog = (0,
|
|
46433
|
+
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0, import_react166.useState)(false);
|
|
46434
|
+
const openMcpDialog = (0, import_react166.useCallback)(() => {
|
|
46388
46435
|
setIsMcpDialogOpen(true);
|
|
46389
46436
|
}, []);
|
|
46390
|
-
const closeMcpDialog = (0,
|
|
46437
|
+
const closeMcpDialog = (0, import_react166.useCallback)(() => {
|
|
46391
46438
|
setIsMcpDialogOpen(false);
|
|
46392
46439
|
}, []);
|
|
46393
46440
|
return {
|
|
@@ -46399,13 +46446,13 @@ var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
|
46399
46446
|
|
|
46400
46447
|
// packages/cli/src/ui/hooks/useHooksDialog.ts
|
|
46401
46448
|
init_esbuild_shims();
|
|
46402
|
-
var
|
|
46449
|
+
var import_react167 = __toESM(require_react(), 1);
|
|
46403
46450
|
var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
46404
|
-
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0,
|
|
46405
|
-
const openHooksDialog = (0,
|
|
46451
|
+
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0, import_react167.useState)(false);
|
|
46452
|
+
const openHooksDialog = (0, import_react167.useCallback)(() => {
|
|
46406
46453
|
setIsHooksDialogOpen(true);
|
|
46407
46454
|
}, []);
|
|
46408
|
-
const closeHooksDialog = (0,
|
|
46455
|
+
const closeHooksDialog = (0, import_react167.useCallback)(() => {
|
|
46409
46456
|
setIsHooksDialogOpen(false);
|
|
46410
46457
|
}, []);
|
|
46411
46458
|
return {
|
|
@@ -46417,23 +46464,23 @@ var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
|
46417
46464
|
|
|
46418
46465
|
// packages/cli/src/ui/hooks/useStatsDialog.ts
|
|
46419
46466
|
init_esbuild_shims();
|
|
46420
|
-
var
|
|
46467
|
+
var import_react168 = __toESM(require_react(), 1);
|
|
46421
46468
|
var useStatsDialog = /* @__PURE__ */ __name(() => {
|
|
46422
|
-
const [isStatsDialogOpen, setIsStatsDialogOpen] = (0,
|
|
46423
|
-
const openStatsDialog = (0,
|
|
46424
|
-
const closeStatsDialog = (0,
|
|
46469
|
+
const [isStatsDialogOpen, setIsStatsDialogOpen] = (0, import_react168.useState)(false);
|
|
46470
|
+
const openStatsDialog = (0, import_react168.useCallback)(() => setIsStatsDialogOpen(true), []);
|
|
46471
|
+
const closeStatsDialog = (0, import_react168.useCallback)(() => setIsStatsDialogOpen(false), []);
|
|
46425
46472
|
return { isStatsDialogOpen, openStatsDialog, closeStatsDialog };
|
|
46426
46473
|
}, "useStatsDialog");
|
|
46427
46474
|
|
|
46428
46475
|
// packages/cli/src/ui/hooks/useMemoryDialog.ts
|
|
46429
46476
|
init_esbuild_shims();
|
|
46430
|
-
var
|
|
46477
|
+
var import_react169 = __toESM(require_react(), 1);
|
|
46431
46478
|
var useMemoryDialog = /* @__PURE__ */ __name(() => {
|
|
46432
|
-
const [isMemoryDialogOpen, setIsMemoryDialogOpen] = (0,
|
|
46433
|
-
const openMemoryDialog = (0,
|
|
46479
|
+
const [isMemoryDialogOpen, setIsMemoryDialogOpen] = (0, import_react169.useState)(false);
|
|
46480
|
+
const openMemoryDialog = (0, import_react169.useCallback)(() => {
|
|
46434
46481
|
setIsMemoryDialogOpen(true);
|
|
46435
46482
|
}, []);
|
|
46436
|
-
const closeMemoryDialog = (0,
|
|
46483
|
+
const closeMemoryDialog = (0, import_react169.useCallback)(() => {
|
|
46437
46484
|
setIsMemoryDialogOpen(false);
|
|
46438
46485
|
}, []);
|
|
46439
46486
|
return {
|
|
@@ -46445,7 +46492,7 @@ var useMemoryDialog = /* @__PURE__ */ __name(() => {
|
|
|
46445
46492
|
|
|
46446
46493
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
46447
46494
|
init_esbuild_shims();
|
|
46448
|
-
var
|
|
46495
|
+
var import_react170 = __toESM(require_react(), 1);
|
|
46449
46496
|
var LONG_TASK_NOTIFICATION_THRESHOLD_SECONDS = 20;
|
|
46450
46497
|
var NOTIFICATION_TITLE = "O1-Code";
|
|
46451
46498
|
var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
@@ -46460,16 +46507,16 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
46460
46507
|
const terminalBellEnabled = settings?.merged?.general?.terminalBell ?? true;
|
|
46461
46508
|
const notificationMode = settings?.merged?.general?.notificationMode === "task-complete" ? "task-complete" : "all";
|
|
46462
46509
|
const approvalNotificationsEnabled = notificationMode === "all";
|
|
46463
|
-
const awaitingNotificationSentRef = (0,
|
|
46464
|
-
const respondingClockRef = (0,
|
|
46465
|
-
const idleNotificationSentRef = (0,
|
|
46466
|
-
const awaitingToolName = (0,
|
|
46510
|
+
const awaitingNotificationSentRef = (0, import_react170.useRef)(false);
|
|
46511
|
+
const respondingClockRef = (0, import_react170.useRef)(STOPPED_CLOCK);
|
|
46512
|
+
const idleNotificationSentRef = (0, import_react170.useRef)(false);
|
|
46513
|
+
const awaitingToolName = (0, import_react170.useMemo)(() => {
|
|
46467
46514
|
const awaitingTool = pendingToolCalls?.find(
|
|
46468
46515
|
(tc) => tc.status === "awaiting_approval"
|
|
46469
46516
|
);
|
|
46470
46517
|
return awaitingTool?.request.name;
|
|
46471
46518
|
}, [pendingToolCalls]);
|
|
46472
|
-
(0,
|
|
46519
|
+
(0, import_react170.useEffect)(() => {
|
|
46473
46520
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current && terminalBellEnabled && approvalNotificationsEnabled) {
|
|
46474
46521
|
const message = awaitingToolName ? `O1-Code needs your permission to use ${awaitingToolName}` : "O1-Code is waiting for your input";
|
|
46475
46522
|
sendNotification(
|
|
@@ -46490,7 +46537,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
46490
46537
|
terminal,
|
|
46491
46538
|
awaitingToolName
|
|
46492
46539
|
]);
|
|
46493
|
-
(0,
|
|
46540
|
+
(0, import_react170.useEffect)(() => {
|
|
46494
46541
|
if (streamingState !== "idle" /* Idle */) {
|
|
46495
46542
|
respondingClockRef.current = elapsedClock;
|
|
46496
46543
|
}
|
|
@@ -46645,7 +46692,7 @@ __name(buildTerminalNotification, "buildTerminalNotification");
|
|
|
46645
46692
|
|
|
46646
46693
|
// packages/cli/src/ui/hooks/useContextualTips.ts
|
|
46647
46694
|
init_esbuild_shims();
|
|
46648
|
-
var
|
|
46695
|
+
var import_react171 = __toESM(require_react(), 1);
|
|
46649
46696
|
|
|
46650
46697
|
// packages/cli/src/services/tips/index.ts
|
|
46651
46698
|
init_esbuild_shims();
|
|
@@ -46932,9 +46979,9 @@ function useContextualTips({
|
|
|
46932
46979
|
addItem,
|
|
46933
46980
|
hideTips
|
|
46934
46981
|
}) {
|
|
46935
|
-
const prevStreamingState = (0,
|
|
46936
|
-
const hadResponsePhase = (0,
|
|
46937
|
-
(0,
|
|
46982
|
+
const prevStreamingState = (0, import_react171.useRef)("idle" /* Idle */);
|
|
46983
|
+
const hadResponsePhase = (0, import_react171.useRef)(false);
|
|
46984
|
+
(0, import_react171.useEffect)(() => {
|
|
46938
46985
|
if (streamingState === "responding" /* Responding */ || prevStreamingState.current === "responding" /* Responding */ && streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */) {
|
|
46939
46986
|
hadResponsePhase.current = true;
|
|
46940
46987
|
}
|
|
@@ -47062,8 +47109,8 @@ function useQueuedSubmissionDrain({
|
|
|
47062
47109
|
peerMessaging
|
|
47063
47110
|
}) {
|
|
47064
47111
|
const goalRuntimeSessionId = config.getSessionId();
|
|
47065
|
-
const [goalQueueRevision, setGoalQueueRevision] = (0,
|
|
47066
|
-
(0,
|
|
47112
|
+
const [goalQueueRevision, setGoalQueueRevision] = (0, import_react172.useState)(0);
|
|
47113
|
+
(0, import_react172.useEffect)(() => {
|
|
47067
47114
|
try {
|
|
47068
47115
|
return config.getGoalRuntime().subscribe(() => {
|
|
47069
47116
|
setGoalQueueRevision((revision) => revision + 1);
|
|
@@ -47072,10 +47119,10 @@ function useQueuedSubmissionDrain({
|
|
|
47072
47119
|
return void 0;
|
|
47073
47120
|
}
|
|
47074
47121
|
}, [config, goalRuntimeSessionId]);
|
|
47075
|
-
const queueDrainingRef = (0,
|
|
47076
|
-
const admissionFailureRef = (0,
|
|
47077
|
-
const [queueDrainNonce, setQueueDrainNonce] = (0,
|
|
47078
|
-
(0,
|
|
47122
|
+
const queueDrainingRef = (0, import_react172.useRef)(false);
|
|
47123
|
+
const admissionFailureRef = (0, import_react172.useRef)(null);
|
|
47124
|
+
const [queueDrainNonce, setQueueDrainNonce] = (0, import_react172.useState)(0);
|
|
47125
|
+
(0, import_react172.useEffect)(() => {
|
|
47079
47126
|
if (queueDrainingRef.current || submissionInFlightRef.current) return;
|
|
47080
47127
|
const admissionFailure = admissionFailureRef.current;
|
|
47081
47128
|
if (admissionFailure) {
|
|
@@ -47273,7 +47320,7 @@ function getResponseCandidateTokens(pendingLlmHistoryItems) {
|
|
|
47273
47320
|
__name(getResponseCandidateTokens, "getResponseCandidateTokens");
|
|
47274
47321
|
function useStableStickyTodos(todos) {
|
|
47275
47322
|
const renderKey = getStickyTodosRenderKey(todos);
|
|
47276
|
-
const stableTodosRef = (0,
|
|
47323
|
+
const stableTodosRef = (0, import_react172.useRef)(null);
|
|
47277
47324
|
if (stableTodosRef.current?.renderKey !== renderKey) {
|
|
47278
47325
|
stableTodosRef.current = { renderKey, todos };
|
|
47279
47326
|
}
|
|
@@ -47328,29 +47375,29 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47328
47375
|
initialUseVirtualViewport,
|
|
47329
47376
|
repaintViewport
|
|
47330
47377
|
} = props;
|
|
47331
|
-
const extensionRefreshState = (0,
|
|
47378
|
+
const extensionRefreshState = (0, import_react172.useMemo)(
|
|
47332
47379
|
() => props.extensionRefreshState ?? new ExtensionRefreshState(),
|
|
47333
47380
|
[props.extensionRefreshState]
|
|
47334
47381
|
);
|
|
47335
47382
|
const historyManager = useHistory();
|
|
47336
|
-
const historyRef = (0,
|
|
47383
|
+
const historyRef = (0, import_react172.useRef)(historyManager.history);
|
|
47337
47384
|
historyRef.current = historyManager.history;
|
|
47338
47385
|
useMemoryMonitor(historyManager);
|
|
47339
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
47340
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
47341
|
-
const [themeError, setThemeError] = (0,
|
|
47386
|
+
const [debugMessage, setDebugMessage] = (0, import_react172.useState)("");
|
|
47387
|
+
const [quittingMessages, setQuittingMessages] = (0, import_react172.useState)(null);
|
|
47388
|
+
const [themeError, setThemeError] = (0, import_react172.useState)(
|
|
47342
47389
|
initializationResult.themeError
|
|
47343
47390
|
);
|
|
47344
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
47345
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
47346
|
-
const [memoryFileCount, setMemoryFileCount] = (0,
|
|
47391
|
+
const [isProcessing, setIsProcessing] = (0, import_react172.useState)(false);
|
|
47392
|
+
const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react172.useState)(false);
|
|
47393
|
+
const [memoryFileCount, setMemoryFileCount] = (0, import_react172.useState)(
|
|
47347
47394
|
initializationResult.memoryFileCount
|
|
47348
47395
|
);
|
|
47349
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
47350
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
47351
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
47352
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
47353
|
-
const [isTrustedFolder, setIsTrustedFolder] = (0,
|
|
47396
|
+
const [shellModeActive, setShellModeActive] = (0, import_react172.useState)(false);
|
|
47397
|
+
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react172.useState)(false);
|
|
47398
|
+
const [historyRemountKey, setHistoryRemountKey] = (0, import_react172.useState)(0);
|
|
47399
|
+
const [updateInfo, setUpdateInfo] = (0, import_react172.useState)(null);
|
|
47400
|
+
const [isTrustedFolder, setIsTrustedFolder] = (0, import_react172.useState)(
|
|
47354
47401
|
config.isTrustedFolder()
|
|
47355
47402
|
);
|
|
47356
47403
|
const extensionManager = config.getExtensionManager();
|
|
@@ -47409,24 +47456,24 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47409
47456
|
config,
|
|
47410
47457
|
historyManager.addItem
|
|
47411
47458
|
);
|
|
47412
|
-
const [isTrustDialogOpen, setTrustDialogOpen] = (0,
|
|
47413
|
-
const openTrustDialog = (0,
|
|
47414
|
-
const closeTrustDialog = (0,
|
|
47415
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
47416
|
-
const openPermissionsDialog = (0,
|
|
47459
|
+
const [isTrustDialogOpen, setTrustDialogOpen] = (0, import_react172.useState)(false);
|
|
47460
|
+
const openTrustDialog = (0, import_react172.useCallback)(() => setTrustDialogOpen(true), []);
|
|
47461
|
+
const closeTrustDialog = (0, import_react172.useCallback)(() => setTrustDialogOpen(false), []);
|
|
47462
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react172.useState)(false);
|
|
47463
|
+
const openPermissionsDialog = (0, import_react172.useCallback)(
|
|
47417
47464
|
() => setPermissionsDialogOpen(true),
|
|
47418
47465
|
[]
|
|
47419
47466
|
);
|
|
47420
|
-
const closePermissionsDialog = (0,
|
|
47467
|
+
const closePermissionsDialog = (0, import_react172.useCallback)(
|
|
47421
47468
|
() => setPermissionsDialogOpen(false),
|
|
47422
47469
|
[]
|
|
47423
47470
|
);
|
|
47424
|
-
const [currentModel, setCurrentModel] = (0,
|
|
47425
|
-
const [isConfigInitialized, setConfigInitialized] = (0,
|
|
47426
|
-
const [userMessages, setUserMessages] = (0,
|
|
47427
|
-
const [thoughtExpanded, setThoughtExpanded] = (0,
|
|
47428
|
-
const [expandedThoughtHeadIds, setExpandedThoughtHeadIds] = (0,
|
|
47429
|
-
const toggleThoughtExpanded = (0,
|
|
47471
|
+
const [currentModel, setCurrentModel] = (0, import_react172.useState)(() => config.getModel());
|
|
47472
|
+
const [isConfigInitialized, setConfigInitialized] = (0, import_react172.useState)(false);
|
|
47473
|
+
const [userMessages, setUserMessages] = (0, import_react172.useState)([]);
|
|
47474
|
+
const [thoughtExpanded, setThoughtExpanded] = (0, import_react172.useState)(false);
|
|
47475
|
+
const [expandedThoughtHeadIds, setExpandedThoughtHeadIds] = (0, import_react172.useState)(() => /* @__PURE__ */ new Set());
|
|
47476
|
+
const toggleThoughtExpanded = (0, import_react172.useCallback)((headId) => {
|
|
47430
47477
|
setExpandedThoughtHeadIds((prev) => {
|
|
47431
47478
|
const next = new Set(prev);
|
|
47432
47479
|
if (next.has(headId)) {
|
|
@@ -47437,8 +47484,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47437
47484
|
return next;
|
|
47438
47485
|
});
|
|
47439
47486
|
}, []);
|
|
47440
|
-
const [expandedToolBatchIds, setExpandedToolBatchIds] = (0,
|
|
47441
|
-
const expandToolBatch = (0,
|
|
47487
|
+
const [expandedToolBatchIds, setExpandedToolBatchIds] = (0, import_react172.useState)(() => /* @__PURE__ */ new Set());
|
|
47488
|
+
const expandToolBatch = (0, import_react172.useCallback)((batchId) => {
|
|
47442
47489
|
setExpandedToolBatchIds((prev) => {
|
|
47443
47490
|
if (prev.has(batchId)) return prev;
|
|
47444
47491
|
const next = new Set(prev);
|
|
@@ -47449,10 +47496,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47449
47496
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
47450
47497
|
const { stdin, setRawMode } = use_stdin_default();
|
|
47451
47498
|
const { stdout } = use_stdout_default();
|
|
47452
|
-
const writeRaw = (0,
|
|
47499
|
+
const writeRaw = (0, import_react172.useCallback)((data) => {
|
|
47453
47500
|
process18.stdout.write(data);
|
|
47454
47501
|
}, []);
|
|
47455
|
-
const terminal = (0,
|
|
47502
|
+
const terminal = (0, import_react172.useMemo)(
|
|
47456
47503
|
() => buildTerminalNotification(writeRaw),
|
|
47457
47504
|
[writeRaw]
|
|
47458
47505
|
);
|
|
@@ -47466,16 +47513,16 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47466
47513
|
const branchName = useGitBranchName(
|
|
47467
47514
|
worktreeSession?.worktreePath ?? config.getTargetDir()
|
|
47468
47515
|
);
|
|
47469
|
-
const [showWorktreeExitDialog, setShowWorktreeExitDialog] = (0,
|
|
47470
|
-
const [workflowKeywordActive, setWorkflowKeywordActive] = (0,
|
|
47471
|
-
const pendingWorktreeNoticeRef = (0,
|
|
47472
|
-
const announcedWorkflowSizeGuidelineRef = (0,
|
|
47473
|
-
const contextFilesAnnouncedRef = (0,
|
|
47474
|
-
(0,
|
|
47516
|
+
const [showWorktreeExitDialog, setShowWorktreeExitDialog] = (0, import_react172.useState)(false);
|
|
47517
|
+
const [workflowKeywordActive, setWorkflowKeywordActive] = (0, import_react172.useState)(false);
|
|
47518
|
+
const pendingWorktreeNoticeRef = (0, import_react172.useRef)(null);
|
|
47519
|
+
const announcedWorkflowSizeGuidelineRef = (0, import_react172.useRef)(null);
|
|
47520
|
+
const contextFilesAnnouncedRef = (0, import_react172.useRef)(false);
|
|
47521
|
+
(0, import_react172.useEffect)(() => {
|
|
47475
47522
|
contextFilesAnnouncedRef.current = false;
|
|
47476
47523
|
}, [sessionStats.sessionId]);
|
|
47477
47524
|
const { loadHistory: rawLoadHistory } = historyManager;
|
|
47478
|
-
const loadHistoryWithLatchReconciliation = (0,
|
|
47525
|
+
const loadHistoryWithLatchReconciliation = (0, import_react172.useCallback)(
|
|
47479
47526
|
(newHistory) => {
|
|
47480
47527
|
rawLoadHistory(newHistory);
|
|
47481
47528
|
contextFilesAnnouncedRef.current = newHistory.some(
|
|
@@ -47484,7 +47531,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47484
47531
|
},
|
|
47485
47532
|
[rawLoadHistory]
|
|
47486
47533
|
);
|
|
47487
|
-
const activeWorktree = (0,
|
|
47534
|
+
const activeWorktree = (0, import_react172.useMemo)(
|
|
47488
47535
|
() => worktreeSession ? {
|
|
47489
47536
|
slug: worktreeSession.slug,
|
|
47490
47537
|
branch: worktreeSession.worktreeBranch,
|
|
@@ -47495,21 +47542,21 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47495
47542
|
} : null,
|
|
47496
47543
|
[worktreeSession]
|
|
47497
47544
|
);
|
|
47498
|
-
const mainControlsRef = (0,
|
|
47499
|
-
const voiceMicWarnedStatusRef = (0,
|
|
47500
|
-
const lastTitleRef = (0,
|
|
47501
|
-
const [startupWarnings, setStartupWarnings] = (0,
|
|
47545
|
+
const mainControlsRef = (0, import_react172.useRef)(null);
|
|
47546
|
+
const voiceMicWarnedStatusRef = (0, import_react172.useRef)(null);
|
|
47547
|
+
const lastTitleRef = (0, import_react172.useRef)(null);
|
|
47548
|
+
const [startupWarnings, setStartupWarnings] = (0, import_react172.useState)(
|
|
47502
47549
|
() => props.startupWarnings || []
|
|
47503
47550
|
);
|
|
47504
47551
|
const staticExtraHeight = 3;
|
|
47505
|
-
(0,
|
|
47552
|
+
(0, import_react172.useEffect)(() => {
|
|
47506
47553
|
void loadLowlight().catch((err) => {
|
|
47507
47554
|
debugLogger42.warn(
|
|
47508
47555
|
`Failed to load lowlight chunk; code blocks will render as plain text: ${err instanceof Error ? err.message : String(err)}`
|
|
47509
47556
|
);
|
|
47510
47557
|
});
|
|
47511
47558
|
}, []);
|
|
47512
|
-
(0,
|
|
47559
|
+
(0, import_react172.useEffect)(() => {
|
|
47513
47560
|
(async () => {
|
|
47514
47561
|
profileCheckpoint("config_initialize_start");
|
|
47515
47562
|
await config.initialize();
|
|
@@ -47633,7 +47680,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47633
47680
|
await ideClient.disconnect();
|
|
47634
47681
|
});
|
|
47635
47682
|
}, [config]);
|
|
47636
|
-
(0,
|
|
47683
|
+
(0, import_react172.useEffect)(() => {
|
|
47637
47684
|
if (!isConfigInitialized) return void 0;
|
|
47638
47685
|
const llmClient2 = config.getLlmClient();
|
|
47639
47686
|
if (!llmClient2) return void 0;
|
|
@@ -47697,11 +47744,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47697
47744
|
clearTimeout(finalizeCap);
|
|
47698
47745
|
};
|
|
47699
47746
|
}, [isConfigInitialized, config]);
|
|
47700
|
-
const isIdleRef = (0,
|
|
47701
|
-
const availableTerminalHeightRef = (0,
|
|
47702
|
-
const terminalWidthRef = (0,
|
|
47703
|
-
const updateHandlerRef = (0,
|
|
47704
|
-
(0,
|
|
47747
|
+
const isIdleRef = (0, import_react172.useRef)(true);
|
|
47748
|
+
const availableTerminalHeightRef = (0, import_react172.useRef)(0);
|
|
47749
|
+
const terminalWidthRef = (0, import_react172.useRef)(0);
|
|
47750
|
+
const updateHandlerRef = (0, import_react172.useRef)(null);
|
|
47751
|
+
(0, import_react172.useEffect)(() => {
|
|
47705
47752
|
const handler = setUpdateHandler(
|
|
47706
47753
|
historyManager.addItem,
|
|
47707
47754
|
setUpdateInfo,
|
|
@@ -47710,13 +47757,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47710
47757
|
updateHandlerRef.current = handler;
|
|
47711
47758
|
return () => handler?.cleanup();
|
|
47712
47759
|
}, [historyManager.addItem]);
|
|
47713
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
47760
|
+
const { inputWidth, suggestionsWidth } = (0, import_react172.useMemo)(() => {
|
|
47714
47761
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
47715
47762
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
47716
47763
|
}, [terminalWidth]);
|
|
47717
47764
|
const mainAreaWidth = Math.min(terminalWidth - 4, 100);
|
|
47718
47765
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
47719
|
-
const isValidPath = (0,
|
|
47766
|
+
const isValidPath = (0, import_react172.useCallback)((filePath) => {
|
|
47720
47767
|
try {
|
|
47721
47768
|
return fs19.existsSync(filePath) && fs19.statSync(filePath).isFile();
|
|
47722
47769
|
} catch (_e) {
|
|
@@ -47724,14 +47771,14 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47724
47771
|
}
|
|
47725
47772
|
}, []);
|
|
47726
47773
|
const preferredEditor = usePreferredEditor();
|
|
47727
|
-
const restoredSubmissionRef = (0,
|
|
47728
|
-
const submittedPromptProvenanceUnavailableRef = (0,
|
|
47729
|
-
const setBufferTextRef = (0,
|
|
47730
|
-
const invalidateSubmittedPromptProvenance = (0,
|
|
47774
|
+
const restoredSubmissionRef = (0, import_react172.useRef)(null);
|
|
47775
|
+
const submittedPromptProvenanceUnavailableRef = (0, import_react172.useRef)(false);
|
|
47776
|
+
const setBufferTextRef = (0, import_react172.useRef)(null);
|
|
47777
|
+
const invalidateSubmittedPromptProvenance = (0, import_react172.useCallback)(() => {
|
|
47731
47778
|
restoredSubmissionRef.current = null;
|
|
47732
47779
|
submittedPromptProvenanceUnavailableRef.current = true;
|
|
47733
47780
|
}, []);
|
|
47734
|
-
const handleBufferChange = (0,
|
|
47781
|
+
const handleBufferChange = (0, import_react172.useCallback)((text) => {
|
|
47735
47782
|
if (text.length === 0) {
|
|
47736
47783
|
if (restoredSubmissionRef.current !== null || submittedPromptProvenanceUnavailableRef.current) {
|
|
47737
47784
|
setBufferTextRef.current?.("", { clearUndoHistory: true });
|
|
@@ -47757,9 +47804,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47757
47804
|
});
|
|
47758
47805
|
const setBufferText = buffer.setText;
|
|
47759
47806
|
setBufferTextRef.current = setBufferText;
|
|
47760
|
-
const restoredPromptStashTargetsRef = (0,
|
|
47807
|
+
const restoredPromptStashTargetsRef = (0, import_react172.useRef)(/* @__PURE__ */ new Set());
|
|
47761
47808
|
const promptStashTargetDir = config.getTargetDir();
|
|
47762
|
-
(0,
|
|
47809
|
+
(0, import_react172.useEffect)(() => {
|
|
47763
47810
|
if (restoredPromptStashTargetsRef.current.has(promptStashTargetDir)) {
|
|
47764
47811
|
return;
|
|
47765
47812
|
}
|
|
@@ -47770,7 +47817,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47770
47817
|
buffer.setText(text);
|
|
47771
47818
|
});
|
|
47772
47819
|
}, [buffer, promptStashTargetDir]);
|
|
47773
|
-
(0,
|
|
47820
|
+
(0, import_react172.useEffect)(() => {
|
|
47774
47821
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
47775
47822
|
const pastMessagesRaw = await logger?.getPreviousUserMessages() || [];
|
|
47776
47823
|
const currentSessionUserMessages = realUserPromptTexts(
|
|
@@ -47784,21 +47831,21 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47784
47831
|
}, "fetchUserMessages");
|
|
47785
47832
|
fetchUserMessages();
|
|
47786
47833
|
}, [historyManager.history, logger]);
|
|
47787
|
-
const remountStaticHistory = (0,
|
|
47834
|
+
const remountStaticHistory = (0, import_react172.useCallback)(() => {
|
|
47788
47835
|
setHistoryRemountKey((prev) => prev + 1);
|
|
47789
47836
|
}, []);
|
|
47790
|
-
const [useTerminalBuffer] = (0,
|
|
47837
|
+
const [useTerminalBuffer] = (0, import_react172.useState)(
|
|
47791
47838
|
() => initialUseVirtualViewport ?? shouldUseVirtualViewport(
|
|
47792
47839
|
settings.merged.ui?.useTerminalBuffer,
|
|
47793
47840
|
config.getScreenReader(),
|
|
47794
47841
|
isInteractiveTerminal()
|
|
47795
47842
|
)
|
|
47796
47843
|
);
|
|
47797
|
-
const prevTerminalWidthRef = (0,
|
|
47798
|
-
const shrinkRemountTimerRef = (0,
|
|
47844
|
+
const prevTerminalWidthRef = (0, import_react172.useRef)(terminalWidth);
|
|
47845
|
+
const shrinkRemountTimerRef = (0, import_react172.useRef)(
|
|
47799
47846
|
null
|
|
47800
47847
|
);
|
|
47801
|
-
(0,
|
|
47848
|
+
(0, import_react172.useEffect)(() => {
|
|
47802
47849
|
const prev = prevTerminalWidthRef.current;
|
|
47803
47850
|
prevTerminalWidthRef.current = terminalWidth;
|
|
47804
47851
|
if (useTerminalBuffer && terminalWidth < prev) {
|
|
@@ -47809,7 +47856,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47809
47856
|
shrinkRemountTimerRef.current = setTimeout(remountStaticHistory, 650);
|
|
47810
47857
|
}
|
|
47811
47858
|
}, [terminalWidth, useTerminalBuffer, remountStaticHistory]);
|
|
47812
|
-
(0,
|
|
47859
|
+
(0, import_react172.useEffect)(
|
|
47813
47860
|
() => () => {
|
|
47814
47861
|
if (shrinkRemountTimerRef.current) {
|
|
47815
47862
|
clearTimeout(shrinkRemountTimerRef.current);
|
|
@@ -47818,13 +47865,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47818
47865
|
[]
|
|
47819
47866
|
);
|
|
47820
47867
|
const showScrollbar = settings.merged.ui?.showScrollbar ?? true;
|
|
47821
|
-
const refreshStatic = (0,
|
|
47868
|
+
const refreshStatic = (0, import_react172.useCallback)(() => {
|
|
47822
47869
|
if (!useTerminalBuffer) {
|
|
47823
47870
|
stdout.write(base_exports.clearTerminal);
|
|
47824
47871
|
}
|
|
47825
47872
|
remountStaticHistory();
|
|
47826
47873
|
}, [useTerminalBuffer, remountStaticHistory, stdout]);
|
|
47827
|
-
const wakeRepaint = (0,
|
|
47874
|
+
const wakeRepaint = (0, import_react172.useMemo)(
|
|
47828
47875
|
() => buildWakeRepaint({
|
|
47829
47876
|
isVP: useTerminalBuffer,
|
|
47830
47877
|
repaintViewport,
|
|
@@ -47833,8 +47880,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47833
47880
|
}),
|
|
47834
47881
|
[useTerminalBuffer, repaintViewport, refreshStatic, remountStaticHistory]
|
|
47835
47882
|
);
|
|
47836
|
-
const lastNotifiedModelRef = (0,
|
|
47837
|
-
(0,
|
|
47883
|
+
const lastNotifiedModelRef = (0, import_react172.useRef)(currentModel);
|
|
47884
|
+
(0, import_react172.useEffect)(() => {
|
|
47838
47885
|
const unsubscribe = config.onModelChange((model) => {
|
|
47839
47886
|
if (lastNotifiedModelRef.current === model) {
|
|
47840
47887
|
return;
|
|
@@ -47879,7 +47926,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47879
47926
|
const { onAuthError, openAuthDialog, closeAuthDialog } = authActions;
|
|
47880
47927
|
const { isAuthDialogOpen, isAuthenticating, pendingAuthType } = authState;
|
|
47881
47928
|
useInitializationAuthError(initializationResult.authError, onAuthError);
|
|
47882
|
-
(0,
|
|
47929
|
+
(0, import_react172.useEffect)(() => {
|
|
47883
47930
|
const currentAuthType = config.getModelsConfig().getCurrentAuthType();
|
|
47884
47931
|
if (settings.merged.security?.auth?.enforcedType && currentAuthType && settings.merged.security?.auth.enforcedType !== currentAuthType) {
|
|
47885
47932
|
onAuthError(
|
|
@@ -47893,7 +47940,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47893
47940
|
);
|
|
47894
47941
|
}
|
|
47895
47942
|
}, [settings.merged.security?.auth?.enforcedType, config, onAuthError]);
|
|
47896
|
-
const [editorError, setEditorError] = (0,
|
|
47943
|
+
const [editorError, setEditorError] = (0, import_react172.useState)(null);
|
|
47897
47944
|
const {
|
|
47898
47945
|
isEditorDialogOpen,
|
|
47899
47946
|
openEditorDialog,
|
|
@@ -47906,18 +47953,18 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47906
47953
|
config
|
|
47907
47954
|
);
|
|
47908
47955
|
const { isSettingsDialogOpen, openSettingsDialog, closeSettingsDialog } = useSettingsCommand();
|
|
47909
|
-
const [isStatusLineDialogOpen, setStatusLineDialogOpen] = (0,
|
|
47910
|
-
const openStatusLineDialog = (0,
|
|
47956
|
+
const [isStatusLineDialogOpen, setStatusLineDialogOpen] = (0, import_react172.useState)(false);
|
|
47957
|
+
const openStatusLineDialog = (0, import_react172.useCallback)(
|
|
47911
47958
|
() => setStatusLineDialogOpen(true),
|
|
47912
47959
|
[]
|
|
47913
47960
|
);
|
|
47914
|
-
const closeStatusLineDialog = (0,
|
|
47961
|
+
const closeStatusLineDialog = (0, import_react172.useCallback)(
|
|
47915
47962
|
() => setStatusLineDialogOpen(false),
|
|
47916
47963
|
[]
|
|
47917
47964
|
);
|
|
47918
|
-
const [statusLineSettingsVersion, setStatusLineSettingsVersion] = (0,
|
|
47919
|
-
const [statusLineConfigOverride, setStatusLineConfigOverride] = (0,
|
|
47920
|
-
const notifyStatusLineSettingsChanged = (0,
|
|
47965
|
+
const [statusLineSettingsVersion, setStatusLineSettingsVersion] = (0, import_react172.useState)(0);
|
|
47966
|
+
const [statusLineConfigOverride, setStatusLineConfigOverride] = (0, import_react172.useState)(void 0);
|
|
47967
|
+
const notifyStatusLineSettingsChanged = (0, import_react172.useCallback)(
|
|
47921
47968
|
(newConfig) => {
|
|
47922
47969
|
setStatusLineConfigOverride(newConfig);
|
|
47923
47970
|
setStatusLineSettingsVersion((version) => version + 1);
|
|
@@ -47937,8 +47984,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47937
47984
|
closeModelDialog
|
|
47938
47985
|
} = useModelCommand();
|
|
47939
47986
|
const { activeArenaDialog, openArenaDialog, closeArenaDialog } = useArenaCommand();
|
|
47940
|
-
const [sessionName, setSessionName] = (0,
|
|
47941
|
-
(0,
|
|
47987
|
+
const [sessionName, setSessionName] = (0, import_react172.useState)(null);
|
|
47988
|
+
(0, import_react172.useEffect)(() => {
|
|
47942
47989
|
const chatRecordingService = config.getChatRecordingService();
|
|
47943
47990
|
if (!chatRecordingService?.setTitleRecordedCallback) return;
|
|
47944
47991
|
const existingCallback = chatRecordingService.getTitleRecordedCallback();
|
|
@@ -47955,7 +48002,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47955
48002
|
};
|
|
47956
48003
|
}, [config]);
|
|
47957
48004
|
const addHistoryItem = historyManager.addItem;
|
|
47958
|
-
(0,
|
|
48005
|
+
(0, import_react172.useEffect)(() => {
|
|
47959
48006
|
if (typeof config.onChatRecordingFailure !== "function") return;
|
|
47960
48007
|
return config.onChatRecordingFailure(() => {
|
|
47961
48008
|
addHistoryItem(
|
|
@@ -47967,9 +48014,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
47967
48014
|
);
|
|
47968
48015
|
});
|
|
47969
48016
|
}, [addHistoryItem, config]);
|
|
47970
|
-
const clearPendingStateRef = (0,
|
|
48017
|
+
const clearPendingStateRef = (0, import_react172.useRef)(() => {
|
|
47971
48018
|
});
|
|
47972
|
-
const clearPendingStateFromRef = (0,
|
|
48019
|
+
const clearPendingStateFromRef = (0, import_react172.useCallback)(
|
|
47973
48020
|
() => clearPendingStateRef.current(),
|
|
47974
48021
|
[]
|
|
47975
48022
|
);
|
|
@@ -48012,13 +48059,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48012
48059
|
addItem: historyManager.addItem,
|
|
48013
48060
|
logger
|
|
48014
48061
|
});
|
|
48015
|
-
const [isHelpDialogOpen, setHelpDialogOpen] = (0,
|
|
48016
|
-
const [activeHelpTab, setHelpTab] = (0,
|
|
48017
|
-
const openHelpDialog = (0,
|
|
48018
|
-
const closeHelpDialog = (0,
|
|
48062
|
+
const [isHelpDialogOpen, setHelpDialogOpen] = (0, import_react172.useState)(false);
|
|
48063
|
+
const [activeHelpTab, setHelpTab] = (0, import_react172.useState)("general");
|
|
48064
|
+
const openHelpDialog = (0, import_react172.useCallback)(() => setHelpDialogOpen(true), []);
|
|
48065
|
+
const closeHelpDialog = (0, import_react172.useCallback)(() => setHelpDialogOpen(false), []);
|
|
48019
48066
|
const { vimEnabled, vimMode } = useVimModeState();
|
|
48020
48067
|
const { toggleVimEnabled } = useVimModeActions();
|
|
48021
|
-
(0,
|
|
48068
|
+
(0, import_react172.useLayoutEffect)(() => {
|
|
48022
48069
|
if (vimEnabled && buffer.text.length > 0) {
|
|
48023
48070
|
invalidateSubmittedPromptProvenance();
|
|
48024
48071
|
}
|
|
@@ -48046,31 +48093,31 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48046
48093
|
const { isMcpDialogOpen, openMcpDialog, closeMcpDialog } = useMcpDialog();
|
|
48047
48094
|
const { isHooksDialogOpen, openHooksDialog, closeHooksDialog } = useHooksDialog();
|
|
48048
48095
|
const { isStatsDialogOpen, openStatsDialog, closeStatsDialog } = useStatsDialog();
|
|
48049
|
-
const openRewindSelectorRef = (0,
|
|
48096
|
+
const openRewindSelectorRef = (0, import_react172.useRef)(() => {
|
|
48050
48097
|
});
|
|
48051
|
-
const cancelOngoingRequestRef = (0,
|
|
48098
|
+
const cancelOngoingRequestRef = (0, import_react172.useRef)(() => {
|
|
48052
48099
|
});
|
|
48053
|
-
const [isDiffDialogOpen, setIsDiffDialogOpen] = (0,
|
|
48054
|
-
const openDiffDialog = (0,
|
|
48100
|
+
const [isDiffDialogOpen, setIsDiffDialogOpen] = (0, import_react172.useState)(false);
|
|
48101
|
+
const openDiffDialog = (0, import_react172.useCallback)(() => {
|
|
48055
48102
|
setIsDiffDialogOpen(true);
|
|
48056
48103
|
}, []);
|
|
48057
|
-
const closeDiffDialog = (0,
|
|
48104
|
+
const closeDiffDialog = (0, import_react172.useCallback)(() => {
|
|
48058
48105
|
setIsDiffDialogOpen(false);
|
|
48059
48106
|
}, []);
|
|
48060
|
-
const [isSkillReviewDialogOpen, setIsSkillReviewDialogOpen] = (0,
|
|
48061
|
-
const [skillReviewPending, setSkillReviewPending] = (0,
|
|
48062
|
-
const skillReviewDismissedTaskIdsRef = (0,
|
|
48063
|
-
const dismissSkillReviewDialog = (0,
|
|
48107
|
+
const [isSkillReviewDialogOpen, setIsSkillReviewDialogOpen] = (0, import_react172.useState)(false);
|
|
48108
|
+
const [skillReviewPending, setSkillReviewPending] = (0, import_react172.useState)(null);
|
|
48109
|
+
const skillReviewDismissedTaskIdsRef = (0, import_react172.useRef)(/* @__PURE__ */ new Set());
|
|
48110
|
+
const dismissSkillReviewDialog = (0, import_react172.useCallback)(() => {
|
|
48064
48111
|
if (skillReviewPending) {
|
|
48065
48112
|
skillReviewDismissedTaskIdsRef.current.add(skillReviewPending.taskId);
|
|
48066
48113
|
}
|
|
48067
48114
|
setIsSkillReviewDialogOpen(false);
|
|
48068
48115
|
}, [skillReviewPending]);
|
|
48069
|
-
const closeSkillReviewDialog = (0,
|
|
48116
|
+
const closeSkillReviewDialog = (0, import_react172.useCallback)(
|
|
48070
48117
|
() => setIsSkillReviewDialogOpen(false),
|
|
48071
48118
|
[]
|
|
48072
48119
|
);
|
|
48073
|
-
const acceptPendingSkill = (0,
|
|
48120
|
+
const acceptPendingSkill = (0, import_react172.useCallback)(
|
|
48074
48121
|
(skillName) => {
|
|
48075
48122
|
if (!skillReviewPending) return;
|
|
48076
48123
|
void config.getMemoryManager().acceptPendingSkillFromTask(skillReviewPending.taskId, skillName).catch(() => {
|
|
@@ -48078,7 +48125,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48078
48125
|
},
|
|
48079
48126
|
[config, skillReviewPending]
|
|
48080
48127
|
);
|
|
48081
|
-
const rejectPendingSkill = (0,
|
|
48128
|
+
const rejectPendingSkill = (0, import_react172.useCallback)(
|
|
48082
48129
|
(skillName) => {
|
|
48083
48130
|
if (!skillReviewPending) return;
|
|
48084
48131
|
void config.getMemoryManager().rejectPendingSkillFromTask(skillReviewPending.taskId, skillName).catch(() => {
|
|
@@ -48086,7 +48133,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48086
48133
|
},
|
|
48087
48134
|
[config, skillReviewPending]
|
|
48088
48135
|
);
|
|
48089
|
-
(0,
|
|
48136
|
+
(0, import_react172.useEffect)(() => {
|
|
48090
48137
|
const mgr = config.getMemoryManager();
|
|
48091
48138
|
const projectRoot = config.getProjectRoot();
|
|
48092
48139
|
let lastSig = "";
|
|
@@ -48120,7 +48167,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48120
48167
|
refresh();
|
|
48121
48168
|
return unsub;
|
|
48122
48169
|
}, [config]);
|
|
48123
|
-
const slashCommandActions = (0,
|
|
48170
|
+
const slashCommandActions = (0, import_react172.useMemo)(
|
|
48124
48171
|
() => ({
|
|
48125
48172
|
openAuthDialog,
|
|
48126
48173
|
openThemeDialog,
|
|
@@ -48233,13 +48280,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48233
48280
|
setSessionName,
|
|
48234
48281
|
extensionRefreshState
|
|
48235
48282
|
);
|
|
48236
|
-
const onDebugMessage = (0,
|
|
48283
|
+
const onDebugMessage = (0, import_react172.useCallback)(
|
|
48237
48284
|
(message) => {
|
|
48238
48285
|
config.getDebugLogger().debug(message);
|
|
48239
48286
|
},
|
|
48240
48287
|
[config]
|
|
48241
48288
|
);
|
|
48242
|
-
const handleWorktreeExit = (0,
|
|
48289
|
+
const handleWorktreeExit = (0, import_react172.useCallback)(
|
|
48243
48290
|
async (choice) => {
|
|
48244
48291
|
if (choice === "cancel") {
|
|
48245
48292
|
setShowWorktreeExitDialog(false);
|
|
@@ -48314,7 +48361,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48314
48361
|
},
|
|
48315
48362
|
[activeWorktree, config, handleSlashCommand, historyManager]
|
|
48316
48363
|
);
|
|
48317
|
-
const performMemoryRefresh = (0,
|
|
48364
|
+
const performMemoryRefresh = (0, import_react172.useCallback)(async () => {
|
|
48318
48365
|
if (config.isSafeMode()) {
|
|
48319
48366
|
config.setUserMemory("");
|
|
48320
48367
|
config.setMemoryFileCount(0);
|
|
@@ -48395,20 +48442,21 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48395
48442
|
debugLogger42.error("Error refreshing memory:", error);
|
|
48396
48443
|
}
|
|
48397
48444
|
}, [config, historyManager, settings.merged]);
|
|
48398
|
-
const cancelHandlerRef = (0,
|
|
48445
|
+
const cancelHandlerRef = (0, import_react172.useRef)(() => {
|
|
48399
48446
|
});
|
|
48400
|
-
const
|
|
48447
|
+
const cancelledTurnItemIdRef = (0, import_react172.useRef)(null);
|
|
48448
|
+
const midTurnDrainRef = (0, import_react172.useRef)(
|
|
48401
48449
|
null
|
|
48402
48450
|
);
|
|
48403
|
-
const midTurnRestoreRef = (0,
|
|
48404
|
-
const goalQueueRef = (0,
|
|
48405
|
-
const goalReservationSettlementRef = (0,
|
|
48406
|
-
const submissionInFlightRef = (0,
|
|
48407
|
-
const [submissionSettledRevision, setSubmissionSettledRevision] = (0,
|
|
48408
|
-
const onSubmissionSettled = (0,
|
|
48451
|
+
const midTurnRestoreRef = (0, import_react172.useRef)(null);
|
|
48452
|
+
const goalQueueRef = (0, import_react172.useRef)(null);
|
|
48453
|
+
const goalReservationSettlementRef = (0, import_react172.useRef)(Promise.resolve());
|
|
48454
|
+
const submissionInFlightRef = (0, import_react172.useRef)(false);
|
|
48455
|
+
const [submissionSettledRevision, setSubmissionSettledRevision] = (0, import_react172.useState)(0);
|
|
48456
|
+
const onSubmissionSettled = (0, import_react172.useCallback)(() => {
|
|
48409
48457
|
setSubmissionSettledRevision((revision) => revision + 1);
|
|
48410
48458
|
}, []);
|
|
48411
|
-
const waitForReservationSettlement = (0,
|
|
48459
|
+
const waitForReservationSettlement = (0, import_react172.useCallback)(
|
|
48412
48460
|
() => goalReservationSettlementRef.current,
|
|
48413
48461
|
[]
|
|
48414
48462
|
);
|
|
@@ -48457,14 +48505,20 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48457
48505
|
);
|
|
48458
48506
|
cancelOngoingRequestRef.current = cancelOngoingRequest;
|
|
48459
48507
|
clearPendingStateRef.current = clearPendingState;
|
|
48508
|
+
useTurnOutcome(
|
|
48509
|
+
streamingState,
|
|
48510
|
+
historyManager.history,
|
|
48511
|
+
historyManager.updateItem,
|
|
48512
|
+
cancelledTurnItemIdRef
|
|
48513
|
+
);
|
|
48460
48514
|
isIdleRef.current = streamingState === "idle" /* Idle */;
|
|
48461
|
-
(0,
|
|
48515
|
+
(0, import_react172.useEffect)(() => {
|
|
48462
48516
|
if (streamingState === "idle" /* Idle */) {
|
|
48463
48517
|
updateHandlerRef.current?.flush();
|
|
48464
48518
|
setWorkflowKeywordActive(false);
|
|
48465
48519
|
}
|
|
48466
48520
|
}, [streamingState]);
|
|
48467
|
-
(0,
|
|
48521
|
+
(0, import_react172.useEffect)(() => {
|
|
48468
48522
|
if (shouldAutoOpenSkillReview({
|
|
48469
48523
|
pending: skillReviewPending,
|
|
48470
48524
|
streamingState,
|
|
@@ -48476,7 +48530,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48476
48530
|
}
|
|
48477
48531
|
}, [skillReviewPending, streamingState, isMemoryDialogOpen, config]);
|
|
48478
48532
|
const tipsDisabled = !!(settings.merged.ui?.hideTips || config.getScreenReader());
|
|
48479
|
-
const tipHistory = (0,
|
|
48533
|
+
const tipHistory = (0, import_react172.useMemo)(
|
|
48480
48534
|
() => tipsDisabled ? null : getTipHistory(),
|
|
48481
48535
|
[tipsDisabled]
|
|
48482
48536
|
);
|
|
@@ -48489,7 +48543,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48489
48543
|
addItem: historyManager.addItem,
|
|
48490
48544
|
hideTips: tipsDisabled
|
|
48491
48545
|
});
|
|
48492
|
-
const [hasTabConsumer, setHasTabConsumer] = (0,
|
|
48546
|
+
const [hasTabConsumer, setHasTabConsumer] = (0, import_react172.useState)(false);
|
|
48493
48547
|
const agentViewState = useAgentViewState();
|
|
48494
48548
|
const {
|
|
48495
48549
|
dialogOpen: bgTasksDialogOpen,
|
|
@@ -48497,11 +48551,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48497
48551
|
livePanelFocused: bgLivePanelFocused
|
|
48498
48552
|
} = useBackgroundTaskViewState();
|
|
48499
48553
|
const { closeDialog: closeBgTasksDialog } = useBackgroundTaskViewActions();
|
|
48500
|
-
const [promptSuggestion, setPromptSuggestion] = (0,
|
|
48501
|
-
const prevStreamingStateRef = (0,
|
|
48502
|
-
const speculationRef = (0,
|
|
48503
|
-
const suggestionAbortRef = (0,
|
|
48504
|
-
const abortPromptSuggestion = (0,
|
|
48554
|
+
const [promptSuggestion, setPromptSuggestion] = (0, import_react172.useState)(null);
|
|
48555
|
+
const prevStreamingStateRef = (0, import_react172.useRef)("idle" /* Idle */);
|
|
48556
|
+
const speculationRef = (0, import_react172.useRef)(IDLE_SPECULATION);
|
|
48557
|
+
const suggestionAbortRef = (0, import_react172.useRef)(null);
|
|
48558
|
+
const abortPromptSuggestion = (0, import_react172.useCallback)(() => {
|
|
48505
48559
|
suggestionAbortRef.current?.abort();
|
|
48506
48560
|
suggestionAbortRef.current = null;
|
|
48507
48561
|
if (speculationRef.current.status !== "idle") {
|
|
@@ -48550,7 +48604,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48550
48604
|
submissionInFlightRef,
|
|
48551
48605
|
onSubmissionSettled
|
|
48552
48606
|
};
|
|
48553
|
-
const releaseQueuedGoalReservations = (0,
|
|
48607
|
+
const releaseQueuedGoalReservations = (0, import_react172.useCallback)(
|
|
48554
48608
|
(turnKeys) => {
|
|
48555
48609
|
let runtime;
|
|
48556
48610
|
try {
|
|
@@ -48572,7 +48626,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48572
48626
|
},
|
|
48573
48627
|
[config]
|
|
48574
48628
|
);
|
|
48575
|
-
const popAllQueuedMessages = (0,
|
|
48629
|
+
const popAllQueuedMessages = (0, import_react172.useCallback)(() => {
|
|
48576
48630
|
const goalTurnKeys = removeGoalTurns();
|
|
48577
48631
|
if (goalTurnKeys.length > 0) {
|
|
48578
48632
|
releaseQueuedGoalReservations(goalTurnKeys);
|
|
@@ -48583,7 +48637,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48583
48637
|
submittedPromptProvenanceUnavailableRef.current = false;
|
|
48584
48638
|
return submission.modelText;
|
|
48585
48639
|
}, [popAllMessages, releaseQueuedGoalReservations, removeGoalTurns]);
|
|
48586
|
-
(0,
|
|
48640
|
+
(0, import_react172.useEffect)(() => {
|
|
48587
48641
|
const host = {
|
|
48588
48642
|
startGoalTurn: /* @__PURE__ */ __name(async (input) => {
|
|
48589
48643
|
enqueueGoalTurn(input);
|
|
@@ -48596,7 +48650,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48596
48650
|
return config.bindGoalTurnHost(host);
|
|
48597
48651
|
}, [config, enqueueGoalTurn, preemptGoalTurn, removeGoalTurns]);
|
|
48598
48652
|
const remoteInput = useRemoteInput();
|
|
48599
|
-
(0,
|
|
48653
|
+
(0, import_react172.useEffect)(() => {
|
|
48600
48654
|
if (!remoteInput) return;
|
|
48601
48655
|
remoteInput.setSubmitFn((text) => {
|
|
48602
48656
|
addMessage(text);
|
|
@@ -48604,7 +48658,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48604
48658
|
});
|
|
48605
48659
|
}, [addMessage, remoteInput]);
|
|
48606
48660
|
const peerMessaging = usePeerMessaging();
|
|
48607
|
-
(0,
|
|
48661
|
+
(0, import_react172.useEffect)(() => {
|
|
48608
48662
|
if (!peerMessaging) return;
|
|
48609
48663
|
peerMessaging.setSubmitFn(
|
|
48610
48664
|
(modelText, displayText, delivery) => {
|
|
@@ -48620,9 +48674,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48620
48674
|
getQueuedPeerCount,
|
|
48621
48675
|
peerMessaging
|
|
48622
48676
|
]);
|
|
48623
|
-
const announcedHoldsRef = (0,
|
|
48624
|
-
const announcedCountRef = (0,
|
|
48625
|
-
(0,
|
|
48677
|
+
const announcedHoldsRef = (0, import_react172.useRef)(/* @__PURE__ */ new Set());
|
|
48678
|
+
const announcedCountRef = (0, import_react172.useRef)(0);
|
|
48679
|
+
(0, import_react172.useEffect)(() => {
|
|
48626
48680
|
if (!peerMessaging) return;
|
|
48627
48681
|
return peerMessaging.onHeldChange((held) => {
|
|
48628
48682
|
const announced = announcedHoldsRef.current;
|
|
@@ -48645,7 +48699,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48645
48699
|
);
|
|
48646
48700
|
});
|
|
48647
48701
|
}, [historyManager, peerMessaging]);
|
|
48648
|
-
(0,
|
|
48702
|
+
(0, import_react172.useEffect)(() => {
|
|
48649
48703
|
if (!peerMessaging) return;
|
|
48650
48704
|
return peerMessaging.onReceipt((receipt) => {
|
|
48651
48705
|
const { status, address, previous } = receipt;
|
|
@@ -48673,7 +48727,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48673
48727
|
);
|
|
48674
48728
|
});
|
|
48675
48729
|
}, [historyManager, peerMessaging]);
|
|
48676
|
-
(0,
|
|
48730
|
+
(0, import_react172.useEffect)(() => {
|
|
48677
48731
|
if (!peerMessaging) return;
|
|
48678
48732
|
return peerMessaging.onDropped(({ frame, origin, reason, suppressed }) => {
|
|
48679
48733
|
const name = flattenPeerLabel(frame.fromName ?? "");
|
|
@@ -48696,8 +48750,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48696
48750
|
});
|
|
48697
48751
|
}, [historyManager, peerMessaging]);
|
|
48698
48752
|
const peerInboxFailure = usePeerInboxFailure();
|
|
48699
|
-
const announcedInboxFailureRef = (0,
|
|
48700
|
-
(0,
|
|
48753
|
+
const announcedInboxFailureRef = (0, import_react172.useRef)(false);
|
|
48754
|
+
(0, import_react172.useEffect)(() => {
|
|
48701
48755
|
if (!peerInboxFailure || announcedInboxFailureRef.current) return;
|
|
48702
48756
|
announcedInboxFailureRef.current = true;
|
|
48703
48757
|
historyManager.addItem(
|
|
@@ -48709,7 +48763,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48709
48763
|
);
|
|
48710
48764
|
}, [historyManager, peerInboxFailure]);
|
|
48711
48765
|
const approvalModeForPeers = config.getApprovalMode();
|
|
48712
|
-
(0,
|
|
48766
|
+
(0, import_react172.useEffect)(() => {
|
|
48713
48767
|
peerMessaging?.reevaluate("approval-mode-changed");
|
|
48714
48768
|
}, [approvalModeForPeers, peerMessaging]);
|
|
48715
48769
|
const heldExpiryForPeers = parseHeldExpiry(
|
|
@@ -48717,7 +48771,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48717
48771
|
);
|
|
48718
48772
|
const inboundPolicyForPeers = settings.merged.agents?.crossSessionInbound;
|
|
48719
48773
|
const inboundPolicyScopeForPeers = inboundPolicyScope(settings);
|
|
48720
|
-
(0,
|
|
48774
|
+
(0, import_react172.useEffect)(() => {
|
|
48721
48775
|
peerMessaging?.reevaluate("held-expiry-changed");
|
|
48722
48776
|
}, [
|
|
48723
48777
|
heldExpiryForPeers,
|
|
@@ -48725,17 +48779,17 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48725
48779
|
inboundPolicyScopeForPeers,
|
|
48726
48780
|
peerMessaging
|
|
48727
48781
|
]);
|
|
48728
|
-
(0,
|
|
48782
|
+
(0, import_react172.useEffect)(() => {
|
|
48729
48783
|
if (!remoteInput) return;
|
|
48730
48784
|
if (streamingState === "idle" /* Idle */) {
|
|
48731
48785
|
remoteInput.notifyIdle();
|
|
48732
48786
|
}
|
|
48733
48787
|
}, [remoteInput, streamingState]);
|
|
48734
48788
|
const dualOutput = useDualOutput();
|
|
48735
|
-
const confirmRequestMap = (0,
|
|
48736
|
-
const confirmCallIdMap = (0,
|
|
48737
|
-
const confirmEmitted = (0,
|
|
48738
|
-
(0,
|
|
48789
|
+
const confirmRequestMap = (0, import_react172.useRef)(/* @__PURE__ */ new Map());
|
|
48790
|
+
const confirmCallIdMap = (0, import_react172.useRef)(/* @__PURE__ */ new Map());
|
|
48791
|
+
const confirmEmitted = (0, import_react172.useRef)(/* @__PURE__ */ new Set());
|
|
48792
|
+
(0, import_react172.useEffect)(() => {
|
|
48739
48793
|
if (!dualOutput || !dualOutput.isConnected) return;
|
|
48740
48794
|
for (const tc of pendingToolCalls) {
|
|
48741
48795
|
if (tc.status === "awaiting_approval" && !confirmEmitted.current.has(tc.request.callId)) {
|
|
@@ -48764,11 +48818,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48764
48818
|
}
|
|
48765
48819
|
}
|
|
48766
48820
|
}, [dualOutput, pendingToolCalls]);
|
|
48767
|
-
const pendingToolCallsRef = (0,
|
|
48821
|
+
const pendingToolCallsRef = (0, import_react172.useRef)(pendingToolCalls);
|
|
48768
48822
|
pendingToolCallsRef.current = pendingToolCalls;
|
|
48769
|
-
const dualOutputRef = (0,
|
|
48823
|
+
const dualOutputRef = (0, import_react172.useRef)(dualOutput);
|
|
48770
48824
|
dualOutputRef.current = dualOutput;
|
|
48771
|
-
(0,
|
|
48825
|
+
(0, import_react172.useEffect)(() => {
|
|
48772
48826
|
if (!remoteInput) return;
|
|
48773
48827
|
remoteInput.setConfirmationHandler(
|
|
48774
48828
|
(requestId, allowed) => {
|
|
@@ -48808,7 +48862,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
48808
48862
|
});
|
|
48809
48863
|
};
|
|
48810
48864
|
}, [remoteInput]);
|
|
48811
|
-
const handleFinalSubmit = (0,
|
|
48865
|
+
const handleFinalSubmit = (0, import_react172.useCallback)(
|
|
48812
48866
|
(submittedValue, options) => {
|
|
48813
48867
|
const consumesComposerState = options !== void 0;
|
|
48814
48868
|
const restoredSubmission = consumesComposerState ? restoredSubmissionRef.current : null;
|
|
@@ -49027,7 +49081,7 @@ ${worktreeNotice}
|
|
|
49027
49081
|
vimEnabled
|
|
49028
49082
|
]
|
|
49029
49083
|
);
|
|
49030
|
-
const handleArenaModelsSelected = (0,
|
|
49084
|
+
const handleArenaModelsSelected = (0, import_react172.useCallback)(
|
|
49031
49085
|
(models) => {
|
|
49032
49086
|
const value = models.join(",");
|
|
49033
49087
|
buffer.setText(`/arena start --models ${value} `);
|
|
@@ -49042,11 +49096,11 @@ ${worktreeNotice}
|
|
|
49042
49096
|
handleWelcomeBackSelection,
|
|
49043
49097
|
handleWelcomeBackClose
|
|
49044
49098
|
} = useWelcomeBack(config, handleFinalSubmit, buffer, settings.merged);
|
|
49045
|
-
const pendingHistoryItems = (0,
|
|
49099
|
+
const pendingHistoryItems = (0, import_react172.useMemo)(
|
|
49046
49100
|
() => [...pendingSlashCommandHistoryItems, ...pendingLlmHistoryItems],
|
|
49047
49101
|
[pendingSlashCommandHistoryItems, pendingLlmHistoryItems]
|
|
49048
49102
|
);
|
|
49049
|
-
const rawStickyTodos = (0,
|
|
49103
|
+
const rawStickyTodos = (0, import_react172.useMemo)(
|
|
49050
49104
|
() => getStickyTodos(historyManager.history, pendingHistoryItems),
|
|
49051
49105
|
[historyManager.history, pendingHistoryItems]
|
|
49052
49106
|
);
|
|
@@ -49054,8 +49108,9 @@ ${worktreeNotice}
|
|
|
49054
49108
|
const hasExecutingTool = isToolExecuting(pendingHistoryItems);
|
|
49055
49109
|
const hasPendingCompression = isCompressionPending(pendingHistoryItems);
|
|
49056
49110
|
useTerminalProgress(streamingState, hasExecutingTool);
|
|
49057
|
-
cancelHandlerRef.current = (0,
|
|
49111
|
+
cancelHandlerRef.current = (0, import_react172.useCallback)(
|
|
49058
49112
|
(info) => {
|
|
49113
|
+
cancelledTurnItemIdRef.current = info?.lastTurnUserItem?.id ?? null;
|
|
49059
49114
|
const pendingHistoryItems2 = [
|
|
49060
49115
|
...pendingSlashCommandHistoryItems,
|
|
49061
49116
|
...pendingLlmHistoryItems
|
|
@@ -49177,7 +49232,7 @@ ${currentText}` : popped.modelText
|
|
|
49177
49232
|
pendingLlmHistoryItems
|
|
49178
49233
|
]
|
|
49179
49234
|
);
|
|
49180
|
-
const handleClearScreen = (0,
|
|
49235
|
+
const handleClearScreen = (0, import_react172.useCallback)(() => {
|
|
49181
49236
|
clearPendingStateRef.current();
|
|
49182
49237
|
contextFilesAnnouncedRef.current = false;
|
|
49183
49238
|
historyManager.clearItems();
|
|
@@ -49203,13 +49258,13 @@ ${currentText}` : popped.modelText
|
|
|
49203
49258
|
history: historyManager.history,
|
|
49204
49259
|
awayThresholdMinutes: settings.merged.general?.sessionRecapAwayThresholdMinutes
|
|
49205
49260
|
});
|
|
49206
|
-
const contextFileNames = (0,
|
|
49261
|
+
const contextFileNames = (0, import_react172.useMemo)(() => {
|
|
49207
49262
|
const fromSettings = settings.merged.context?.fileName;
|
|
49208
49263
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllMemoryFilenames();
|
|
49209
49264
|
}, [settings.merged.context?.fileName]);
|
|
49210
|
-
const initialPrompt = (0,
|
|
49211
|
-
const initialPromptSubmitted = (0,
|
|
49212
|
-
(0,
|
|
49265
|
+
const initialPrompt = (0, import_react172.useMemo)(() => config.getQuestion(), [config]);
|
|
49266
|
+
const initialPromptSubmitted = (0, import_react172.useRef)(false);
|
|
49267
|
+
(0, import_react172.useEffect)(() => {
|
|
49213
49268
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && welcomeBackChoice !== "restart" && llmClient?.isInitialized?.()) {
|
|
49214
49269
|
handleFinalSubmit(initialPrompt);
|
|
49215
49270
|
initialPromptSubmitted.current = true;
|
|
@@ -49227,7 +49282,7 @@ ${currentText}` : popped.modelText
|
|
|
49227
49282
|
llmClient
|
|
49228
49283
|
]);
|
|
49229
49284
|
const followupSuggestionsEnabled = settings.merged.ui?.enableFollowupSuggestions !== false;
|
|
49230
|
-
(0,
|
|
49285
|
+
(0, import_react172.useEffect)(() => {
|
|
49231
49286
|
if (!followupSuggestionsEnabled) {
|
|
49232
49287
|
suggestionAbortRef.current?.abort();
|
|
49233
49288
|
setPromptSuggestion(null);
|
|
@@ -49302,17 +49357,17 @@ ${currentText}` : popped.modelText
|
|
|
49302
49357
|
isPermissionsDialogOpen,
|
|
49303
49358
|
settingInputRequests
|
|
49304
49359
|
]);
|
|
49305
|
-
(0,
|
|
49360
|
+
(0, import_react172.useEffect)(() => {
|
|
49306
49361
|
if (!promptSuggestion && speculationRef.current.status !== "idle") {
|
|
49307
49362
|
abortSpeculation(speculationRef.current).catch(() => {
|
|
49308
49363
|
});
|
|
49309
49364
|
speculationRef.current = IDLE_SPECULATION;
|
|
49310
49365
|
}
|
|
49311
49366
|
}, [promptSuggestion]);
|
|
49312
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
49313
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
49314
|
-
const [startupIdeConnectionStatus, setStartupIdeConnectionStatus] = (0,
|
|
49315
|
-
(0,
|
|
49367
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react172.useState)(false);
|
|
49368
|
+
const [currentIDE, setCurrentIDE] = (0, import_react172.useState)(null);
|
|
49369
|
+
const [startupIdeConnectionStatus, setStartupIdeConnectionStatus] = (0, import_react172.useState)({ state: "idle" });
|
|
49370
|
+
(0, import_react172.useEffect)(() => {
|
|
49316
49371
|
if (config.getShellExecutionSandbox?.()) return;
|
|
49317
49372
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
49318
49373
|
const ideClient = await IdeClient.getInstance();
|
|
@@ -49329,44 +49384,44 @@ ${currentText}` : popped.modelText
|
|
|
49329
49384
|
tomlFiles: commandMigrationTomlFiles,
|
|
49330
49385
|
setShowMigrationNudge: setShowCommandMigrationNudge
|
|
49331
49386
|
} = useCommandMigration(settings, config.storage);
|
|
49332
|
-
const [showToolDescriptions, setShowToolDescriptions] = (0,
|
|
49387
|
+
const [showToolDescriptions, setShowToolDescriptions] = (0, import_react172.useState)(false);
|
|
49333
49388
|
const configuredRenderMode = settings.merged.ui?.renderMode;
|
|
49334
|
-
const [renderMode, setRenderMode] = (0,
|
|
49389
|
+
const [renderMode, setRenderMode] = (0, import_react172.useState)(
|
|
49335
49390
|
configuredRenderMode === "raw" ? "raw" : "render"
|
|
49336
49391
|
);
|
|
49337
|
-
const renderModeConfigMountedRef = (0,
|
|
49338
|
-
(0,
|
|
49392
|
+
const renderModeConfigMountedRef = (0, import_react172.useRef)(false);
|
|
49393
|
+
(0, import_react172.useEffect)(() => {
|
|
49339
49394
|
if (!renderModeConfigMountedRef.current) {
|
|
49340
49395
|
renderModeConfigMountedRef.current = true;
|
|
49341
49396
|
return;
|
|
49342
49397
|
}
|
|
49343
49398
|
setRenderMode(configuredRenderMode === "raw" ? "raw" : "render");
|
|
49344
49399
|
}, [configuredRenderMode]);
|
|
49345
|
-
const renderModeMountedRef = (0,
|
|
49346
|
-
(0,
|
|
49400
|
+
const renderModeMountedRef = (0, import_react172.useRef)(false);
|
|
49401
|
+
(0, import_react172.useEffect)(() => {
|
|
49347
49402
|
if (!renderModeMountedRef.current) {
|
|
49348
49403
|
renderModeMountedRef.current = true;
|
|
49349
49404
|
return;
|
|
49350
49405
|
}
|
|
49351
49406
|
refreshStatic();
|
|
49352
49407
|
}, [renderMode, refreshStatic]);
|
|
49353
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0,
|
|
49354
|
-
const ctrlCTimerRef = (0,
|
|
49355
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0,
|
|
49356
|
-
const ctrlDTimerRef = (0,
|
|
49357
|
-
const [escapePressedOnce, setEscapePressedOnce] = (0,
|
|
49358
|
-
const escapeTimerRef = (0,
|
|
49359
|
-
const contextMenuOpenRef = (0,
|
|
49360
|
-
const handleContextMenuChange = (0,
|
|
49408
|
+
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0, import_react172.useState)(false);
|
|
49409
|
+
const ctrlCTimerRef = (0, import_react172.useRef)(null);
|
|
49410
|
+
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0, import_react172.useState)(false);
|
|
49411
|
+
const ctrlDTimerRef = (0, import_react172.useRef)(null);
|
|
49412
|
+
const [escapePressedOnce, setEscapePressedOnce] = (0, import_react172.useState)(false);
|
|
49413
|
+
const escapeTimerRef = (0, import_react172.useRef)(null);
|
|
49414
|
+
const contextMenuOpenRef = (0, import_react172.useRef)(false);
|
|
49415
|
+
const handleContextMenuChange = (0, import_react172.useCallback)((open2) => {
|
|
49361
49416
|
contextMenuOpenRef.current = open2;
|
|
49362
49417
|
}, []);
|
|
49363
|
-
const dialogsVisibleRef = (0,
|
|
49364
|
-
const [isRewindSelectorOpen, setIsRewindSelectorOpen] = (0,
|
|
49365
|
-
const [rewindEscPending, setRewindEscPending] = (0,
|
|
49366
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
49367
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
49368
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
49369
|
-
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0,
|
|
49418
|
+
const dialogsVisibleRef = (0, import_react172.useRef)(false);
|
|
49419
|
+
const [isRewindSelectorOpen, setIsRewindSelectorOpen] = (0, import_react172.useState)(false);
|
|
49420
|
+
const [rewindEscPending, setRewindEscPending] = (0, import_react172.useState)(false);
|
|
49421
|
+
const [constrainHeight, setConstrainHeight] = (0, import_react172.useState)(true);
|
|
49422
|
+
const [ideContextState, setIdeContextState] = (0, import_react172.useState)();
|
|
49423
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react172.useState)(false);
|
|
49424
|
+
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react172.useState)(false);
|
|
49370
49425
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings, setIsTrustedFolder);
|
|
49371
49426
|
const {
|
|
49372
49427
|
isMcpApprovalDialogOpen,
|
|
@@ -49405,13 +49460,13 @@ ${currentText}` : popped.modelText
|
|
|
49405
49460
|
stickyTodoWidth,
|
|
49406
49461
|
stickyTodoMaxVisibleItems
|
|
49407
49462
|
) : "hidden";
|
|
49408
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
49409
|
-
const [inputOverlayKey, setInputOverlayKey] = (0,
|
|
49463
|
+
const [controlsHeight, setControlsHeight] = (0, import_react172.useState)(0);
|
|
49464
|
+
const [inputOverlayKey, setInputOverlayKey] = (0, import_react172.useState)("");
|
|
49410
49465
|
const liveAgentPanelLayoutKey = getLiveAgentPanelLayoutKey(
|
|
49411
49466
|
bgTaskEntries,
|
|
49412
49467
|
bgLivePanelFocused
|
|
49413
49468
|
);
|
|
49414
|
-
(0,
|
|
49469
|
+
(0, import_react172.useLayoutEffect)(() => {
|
|
49415
49470
|
if (!mainControlsRef.current) {
|
|
49416
49471
|
setControlsHeight(
|
|
49417
49472
|
(previousHeight) => previousHeight === 0 ? previousHeight : 0
|
|
@@ -49464,7 +49519,7 @@ ${currentText}` : popped.modelText
|
|
|
49464
49519
|
pager: settings.merged.tools?.shell?.pager,
|
|
49465
49520
|
showColor: settings.merged.tools?.shell?.showColor
|
|
49466
49521
|
});
|
|
49467
|
-
(0,
|
|
49522
|
+
(0, import_react172.useEffect)(() => {
|
|
49468
49523
|
if (activePtyId) {
|
|
49469
49524
|
ShellExecutionService.resizePty(
|
|
49470
49525
|
activePtyId,
|
|
@@ -49474,17 +49529,17 @@ ${currentText}` : popped.modelText
|
|
|
49474
49529
|
}
|
|
49475
49530
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
49476
49531
|
useWakeRepaint(wakeRepaint);
|
|
49477
|
-
(0,
|
|
49532
|
+
(0, import_react172.useEffect)(() => {
|
|
49478
49533
|
if (ideNeedsRestart) {
|
|
49479
49534
|
setShowIdeRestartPrompt(true);
|
|
49480
49535
|
}
|
|
49481
49536
|
}, [ideNeedsRestart]);
|
|
49482
|
-
(0,
|
|
49537
|
+
(0, import_react172.useEffect)(() => {
|
|
49483
49538
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
49484
49539
|
setIdeContextState(ideContextStore.get());
|
|
49485
49540
|
return unsubscribe;
|
|
49486
49541
|
}, []);
|
|
49487
|
-
(0,
|
|
49542
|
+
(0, import_react172.useEffect)(() => {
|
|
49488
49543
|
const listener = /* @__PURE__ */ __name((status) => {
|
|
49489
49544
|
setStartupIdeConnectionStatus(status);
|
|
49490
49545
|
}, "listener");
|
|
@@ -49493,10 +49548,10 @@ ${currentText}` : popped.modelText
|
|
|
49493
49548
|
appEvents.off("startup-ide-connection-status-changed" /* StartupIdeConnectionStatusChanged */, listener);
|
|
49494
49549
|
};
|
|
49495
49550
|
}, []);
|
|
49496
|
-
const handleEscapePromptChange = (0,
|
|
49551
|
+
const handleEscapePromptChange = (0, import_react172.useCallback)((showPrompt) => {
|
|
49497
49552
|
setShowEscapePrompt(showPrompt);
|
|
49498
49553
|
}, []);
|
|
49499
|
-
const openRewindSelector = (0,
|
|
49554
|
+
const openRewindSelector = (0, import_react172.useCallback)(() => {
|
|
49500
49555
|
if (streamingState !== "idle" /* Idle */) return;
|
|
49501
49556
|
if (dialogsVisibleRef.current) return;
|
|
49502
49557
|
if (config.getIdeMode()) {
|
|
@@ -49514,10 +49569,10 @@ ${currentText}` : popped.modelText
|
|
|
49514
49569
|
setIsRewindSelectorOpen(true);
|
|
49515
49570
|
}, [streamingState, config, historyManager]);
|
|
49516
49571
|
openRewindSelectorRef.current = openRewindSelector;
|
|
49517
|
-
const closeRewindSelector = (0,
|
|
49572
|
+
const closeRewindSelector = (0, import_react172.useCallback)(() => {
|
|
49518
49573
|
setIsRewindSelectorOpen(false);
|
|
49519
49574
|
}, []);
|
|
49520
|
-
const handleRewindConfirm = (0,
|
|
49575
|
+
const handleRewindConfirm = (0, import_react172.useCallback)(
|
|
49521
49576
|
async (userItem, option) => {
|
|
49522
49577
|
try {
|
|
49523
49578
|
if (config.getShellExecutionSandbox?.() && (option === "code" || option === "both")) {
|
|
@@ -49700,7 +49755,7 @@ ${currentText}` : popped.modelText
|
|
|
49700
49755
|
openRewindSelector,
|
|
49701
49756
|
(pending) => setRewindEscPending(pending)
|
|
49702
49757
|
);
|
|
49703
|
-
const handleIdePromptComplete = (0,
|
|
49758
|
+
const handleIdePromptComplete = (0, import_react172.useCallback)(
|
|
49704
49759
|
(result) => {
|
|
49705
49760
|
if (result.userSelection === "yes") {
|
|
49706
49761
|
if (result.isExtensionPreInstalled) {
|
|
@@ -49716,7 +49771,7 @@ ${currentText}` : popped.modelText
|
|
|
49716
49771
|
},
|
|
49717
49772
|
[handleSlashCommand, settings]
|
|
49718
49773
|
);
|
|
49719
|
-
const handleCommandMigrationComplete = (0,
|
|
49774
|
+
const handleCommandMigrationComplete = (0, import_react172.useCallback)(
|
|
49720
49775
|
async (result) => {
|
|
49721
49776
|
setShowCommandMigrationNudge(false);
|
|
49722
49777
|
if (result.userSelection === "yes") {
|
|
@@ -49813,7 +49868,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
49813
49868
|
pendingToolCalls
|
|
49814
49869
|
});
|
|
49815
49870
|
const workflowBellEnabled = settings.merged.general?.terminalBell ?? true;
|
|
49816
|
-
(0,
|
|
49871
|
+
(0, import_react172.useEffect)(() => {
|
|
49817
49872
|
const registry = config.getWorkflowRunRegistry?.();
|
|
49818
49873
|
if (!registry?.setNotificationCallback) return;
|
|
49819
49874
|
registry.setNotificationCallback((entry) => {
|
|
@@ -49865,7 +49920,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
49865
49920
|
showWorktreeExitDialog,
|
|
49866
49921
|
closeWorktreeExitDialog: /* @__PURE__ */ __name(() => setShowWorktreeExitDialog(false), "closeWorktreeExitDialog")
|
|
49867
49922
|
});
|
|
49868
|
-
const handleExit = (0,
|
|
49923
|
+
const handleExit = (0, import_react172.useCallback)(
|
|
49869
49924
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
49870
49925
|
if (pressedOnce) {
|
|
49871
49926
|
if (timerRef.current) {
|
|
@@ -49918,7 +49973,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
49918
49973
|
activeWorktree
|
|
49919
49974
|
]
|
|
49920
49975
|
);
|
|
49921
|
-
const handleGlobalKeypress = (0,
|
|
49976
|
+
const handleGlobalKeypress = (0, import_react172.useCallback)(
|
|
49922
49977
|
(key) => {
|
|
49923
49978
|
if (settings.merged.general?.debugKeystrokeLogging) {
|
|
49924
49979
|
debugLogger42.debug("[DEBUG] Keystroke:", JSON.stringify(key));
|
|
@@ -50095,7 +50150,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
50095
50150
|
]
|
|
50096
50151
|
);
|
|
50097
50152
|
useKeypress(handleGlobalKeypress, { isActive: true });
|
|
50098
|
-
(0,
|
|
50153
|
+
(0, import_react172.useEffect)(() => {
|
|
50099
50154
|
if (settings.merged.ui?.hideWindowTitle) {
|
|
50100
50155
|
return;
|
|
50101
50156
|
}
|
|
@@ -50146,7 +50201,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
50146
50201
|
peerMessaging
|
|
50147
50202
|
});
|
|
50148
50203
|
const nightly = props.version.includes("nightly");
|
|
50149
|
-
const uiState = (0,
|
|
50204
|
+
const uiState = (0, import_react172.useMemo)(
|
|
50150
50205
|
() => ({
|
|
50151
50206
|
history: historyManager.history,
|
|
50152
50207
|
historyManager,
|
|
@@ -50451,7 +50506,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
50451
50506
|
isDiffDialogOpen
|
|
50452
50507
|
]
|
|
50453
50508
|
);
|
|
50454
|
-
const uiActions = (0,
|
|
50509
|
+
const uiActions = (0, import_react172.useMemo)(
|
|
50455
50510
|
() => ({
|
|
50456
50511
|
setInputOverlayKey,
|
|
50457
50512
|
openThemeDialog,
|
|
@@ -50638,11 +50693,11 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
50638
50693
|
setInputOverlayKey
|
|
50639
50694
|
]
|
|
50640
50695
|
);
|
|
50641
|
-
const renderModeValue = (0,
|
|
50696
|
+
const renderModeValue = (0, import_react172.useMemo)(
|
|
50642
50697
|
() => ({ renderMode, setRenderMode }),
|
|
50643
50698
|
[renderMode, setRenderMode]
|
|
50644
50699
|
);
|
|
50645
|
-
const thoughtExpandedValue = (0,
|
|
50700
|
+
const thoughtExpandedValue = (0, import_react172.useMemo)(
|
|
50646
50701
|
() => ({
|
|
50647
50702
|
allExpanded: thoughtExpanded,
|
|
50648
50703
|
expandedHeadIds: expandedThoughtHeadIds,
|
|
@@ -50650,7 +50705,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
50650
50705
|
}),
|
|
50651
50706
|
[thoughtExpanded, expandedThoughtHeadIds, toggleThoughtExpanded]
|
|
50652
50707
|
);
|
|
50653
|
-
const toolDetailsExpandedValue = (0,
|
|
50708
|
+
const toolDetailsExpandedValue = (0, import_react172.useMemo)(
|
|
50654
50709
|
() => ({
|
|
50655
50710
|
expandedBatchIds: expandedToolBatchIds,
|
|
50656
50711
|
expandBatch: expandToolBatch
|
|
@@ -50677,9 +50732,9 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
50677
50732
|
|
|
50678
50733
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
50679
50734
|
init_esbuild_shims();
|
|
50680
|
-
var
|
|
50735
|
+
var import_react173 = __toESM(require_react(), 1);
|
|
50681
50736
|
function useKittyKeyboardProtocol() {
|
|
50682
|
-
const [status] = (0,
|
|
50737
|
+
const [status] = (0, import_react173.useState)({
|
|
50683
50738
|
supported: isKittyProtocolSupported(),
|
|
50684
50739
|
enabled: isKittyProtocolEnabled(),
|
|
50685
50740
|
checking: false
|
|
@@ -50846,9 +50901,9 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
50846
50901
|
const AppWrapper = /* @__PURE__ */ __name(() => {
|
|
50847
50902
|
const kittyProtocolStatus = useKittyKeyboardProtocol();
|
|
50848
50903
|
const nodeMajorVersion = parseInt(process.versions.node.split(".")[0], 10);
|
|
50849
|
-
const [peerMessaging, setPeerMessaging] =
|
|
50850
|
-
const [peerInboxFailure, setPeerInboxFailure] =
|
|
50851
|
-
|
|
50904
|
+
const [peerMessaging, setPeerMessaging] = import_react174.default.useState(null);
|
|
50905
|
+
const [peerInboxFailure, setPeerInboxFailure] = import_react174.default.useState(null);
|
|
50906
|
+
import_react174.default.useEffect(() => {
|
|
50852
50907
|
let alive = true;
|
|
50853
50908
|
void peerMessagingReady.then((messaging) => {
|
|
50854
50909
|
if (!alive) return;
|
|
@@ -50911,7 +50966,7 @@ ${error.stack ?? ""}`
|
|
|
50911
50966
|
}
|
|
50912
50967
|
);
|
|
50913
50968
|
const instance = render_default(
|
|
50914
|
-
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
50969
|
+
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_react174.default.StrictMode, { children: appTree }) : appTree,
|
|
50915
50970
|
{
|
|
50916
50971
|
exitOnCtrlC: false,
|
|
50917
50972
|
isScreenReaderEnabled: config.getScreenReader(),
|