@qwen-code/qwen-code 0.20.1-preview.7215 → 0.20.2-gdpval-vl-agent.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/bundled/qc-helper/docs/configuration/settings.md +1 -1
- package/bundled/qc-helper/docs/features/auto-mode.md +19 -16
- package/bundled/qc-helper/docs/features/commands.md +54 -0
- package/bundled/qc-helper/docs/features/sub-agents.md +16 -7
- package/bundled/qc-helper/docs/integration-github-action.md +1 -1
- package/bundled/qc-helper/docs/qwen-serve.md +2 -1
- package/bundled/review/DESIGN.md +2 -2
- package/bundled/review/SKILL.md +4 -4
- package/chunks/{MaxSizedBox-EH6G5AEH.js → MaxSizedBox-KYNG7EN7.js} +38 -35
- package/chunks/{StandaloneSessionPicker-264A3TEA.js → StandaloneSessionPicker-7XN4WVVG.js} +55 -52
- package/chunks/{acpAgent-6RBIJFDI.js → acpAgent-FTFFYP5G.js} +1536 -512
- package/chunks/{agent-QURXGAA3.js → agent-Y76LTTOT.js} +34 -31
- package/chunks/{agent-headless-CRGX4ICQ.js → agent-headless-IVAEQPK6.js} +34 -31
- package/chunks/{anthropicContentGenerator-BWBAZGTW.js → anthropicContentGenerator-HGWAHO24.js} +11 -13
- package/chunks/{artifact-tool-IUJ7QWCX.js → artifact-tool-56T5IMBP.js} +3 -3
- package/chunks/{askUserQuestion-IUMUUTDQ.js → askUserQuestion-E25OBIC2.js} +3 -3
- package/chunks/{bridge-MNFVKPMI.js → bridge-4M77KUEV.js} +39 -36
- package/chunks/{build-SSCNEHZZ.js → build-GHIZ4MSZ.js} +1 -1
- package/chunks/{ca-2SL2BXTK.js → ca-N6VVUFVB.js} +611 -201
- package/chunks/{channel-worker-group-53CMOPFT.js → channel-worker-group-QZV2SP5U.js} +4 -4
- package/chunks/{channel-worker-manager-UTXILKC2.js → channel-worker-manager-3GMAU45H.js} +4 -4
- package/chunks/{channel-worker-supervisor-ZGO2W2MD.js → channel-worker-supervisor-QCXSXCRY.js} +3 -3
- package/chunks/{chunk-UQES76OO.js → chunk-2HGTVAOW.js} +6 -6
- package/chunks/{chunk-2HOVDT7W.js → chunk-2LI23QA6.js} +1 -1
- package/chunks/{chunk-ANHT55MR.js → chunk-2P6CNEHB.js} +1 -1
- package/chunks/chunk-2RFKHEXL.js +74 -0
- package/chunks/{chunk-BF32GYSY.js → chunk-3IABAQR6.js} +1 -1
- package/chunks/chunk-3Z43GZUQ.js +32 -0
- package/chunks/chunk-43T5WDQ7.js +127 -0
- package/chunks/{chunk-DA7OOKVN.js → chunk-4CTP6VR6.js} +29 -2
- package/chunks/{chunk-JD3MKVKL.js → chunk-4K56OJFJ.js} +1 -1
- package/chunks/{chunk-KTUQMDEP.js → chunk-4K7VDKAD.js} +1 -1
- package/chunks/{chunk-QKYTTBYW.js → chunk-4LVZNIDO.js} +1 -1
- package/chunks/{chunk-ZEOZL37W.js → chunk-57FIIFJN.js} +1 -1
- package/chunks/{chunk-7YBZGNEC.js → chunk-5G3ZVADU.js} +308 -199
- package/chunks/{chunk-X4CGDBKA.js → chunk-6GEJX3LE.js} +3 -3
- package/chunks/{chunk-6GUTHAN7.js → chunk-6HOCJNO5.js} +1 -1
- package/chunks/{chunk-GMGDLUC7.js → chunk-6IL7KRLE.js} +1 -1
- package/chunks/chunk-6PVPNMXU.js +29 -0
- package/chunks/{chunk-BDBMYST4.js → chunk-6X4GWOPW.js} +1 -1
- package/chunks/{chunk-4ODB7WIB.js → chunk-6ZBPS62S.js} +1 -1
- package/chunks/{chunk-AYCDXHZB.js → chunk-7Z6JQEL6.js} +1 -1
- package/chunks/{chunk-WAX3ITOA.js → chunk-A3TAEAHX.js} +1 -1
- package/chunks/{chunk-OLMETXLX.js → chunk-ACW3VNUE.js} +2 -2
- package/chunks/{chunk-IB35C3IL.js → chunk-AVQ6EX4J.js} +1 -1
- package/chunks/{chunk-TTSKHF43.js → chunk-BK6UOUJ2.js} +2 -2
- package/chunks/{chunk-6OH6A5EX.js → chunk-BLAEKN6K.js} +20603 -17709
- package/chunks/chunk-BULDBTYC.js +153 -0
- package/chunks/{chunk-XNP57UDV.js → chunk-C3EXYVFX.js} +2 -2
- package/chunks/{chunk-FVS747N7.js → chunk-C54UTDOC.js} +23 -19
- package/chunks/{chunk-MAQQGNQ5.js → chunk-CBOQ3HY7.js} +466 -10
- package/chunks/{chunk-VFAE4AGH.js → chunk-CGZ5SV23.js} +72 -67
- package/chunks/{chunk-WKRXIHD6.js → chunk-COAARUPK.js} +8 -8
- package/chunks/{chunk-GA7VRJVN.js → chunk-E2ZK5M4P.js} +5 -5
- package/chunks/{chunk-5SCI6E3E.js → chunk-E4IMU4Y5.js} +1 -1
- package/chunks/{chunk-E5GIFWE3.js → chunk-EEFRJ5CT.js} +54 -33
- package/chunks/{chunk-WXAXH7IJ.js → chunk-ESQHGKPJ.js} +1 -1
- package/chunks/{chunk-NEEB7UEN.js → chunk-FFFM6NJV.js} +1 -2
- package/chunks/{chunk-Z5R4JMOL.js → chunk-FJ2IUWNQ.js} +4 -4
- package/chunks/{chunk-JVTCARQ6.js → chunk-FQI7LT7T.js} +4 -4
- package/chunks/{chunk-BRXIO5WY.js → chunk-FTNI3D7D.js} +7 -7
- package/chunks/{chunk-OMH3276Y.js → chunk-GHRSKGHF.js} +7 -7
- package/chunks/{chunk-OONJNQ42.js → chunk-GPSKDNEE.js} +3 -3
- package/chunks/{chunk-KPZNOZPC.js → chunk-GWM4PDYK.js} +19 -19
- package/chunks/{chunk-NBMIC7DR.js → chunk-H24SOJIQ.js} +2 -2
- package/chunks/{chunk-FNGK2Z5B.js → chunk-H4AR2JQF.js} +3 -3
- package/chunks/{chunk-WOT64EP2.js → chunk-HCJQORKC.js} +2 -2
- package/chunks/{chunk-7KDI2IB2.js → chunk-HDATOR4J.js} +4 -4
- package/chunks/{chunk-IE4JSQ5L.js → chunk-HIYP7IR4.js} +39 -37
- package/chunks/{chunk-N6YTEVLV.js → chunk-HL6AKUGD.js} +10 -4
- package/chunks/{chunk-BAIEQKR5.js → chunk-HPQFGWOD.js} +5 -5
- package/chunks/chunk-HTR4WV6U.js +327 -0
- package/chunks/{chunk-SDXIH6OA.js → chunk-IFUNDCQ6.js} +137 -5
- package/chunks/{chunk-Z6UEAQTP.js → chunk-IFVECEIK.js} +178 -61
- package/chunks/{chunk-QOK6RMIP.js → chunk-IKP54WUL.js} +4 -4
- package/chunks/{chunk-IUSNI6IX.js → chunk-ISMD2AB3.js} +1 -1
- package/chunks/{chunk-G45X5TRN.js → chunk-JCW2R7WC.js} +1 -72
- package/chunks/{chunk-LZYWWWCZ.js → chunk-KF6CTNTJ.js} +8 -9
- package/chunks/{chunk-EIAK6Q2B.js → chunk-KHOVYUHX.js} +2 -2
- package/chunks/chunk-KWK7UE6L.js +6194 -0
- package/chunks/{chunk-WBTZGWQ6.js → chunk-L5F3T6TQ.js} +1 -1
- package/chunks/{chunk-RELYEO3R.js → chunk-L7ASZD66.js} +244 -1607
- package/chunks/{chunk-UJEZQ562.js → chunk-LESHKUWF.js} +3 -5
- package/chunks/{chunk-OOCI5VVU.js → chunk-LIZRAKPB.js} +1 -1
- package/chunks/{chunk-Q3ZBFXK4.js → chunk-LKB5YL5T.js} +143 -36
- package/chunks/{chunk-MKLKHZAK.js → chunk-LU3RXCM7.js} +1 -1
- package/chunks/{chunk-B453NMZJ.js → chunk-M3EQ3GZC.js} +3 -3
- package/chunks/{chunk-TCKTNY66.js → chunk-M4VFMLQK.js} +6 -6
- package/chunks/{chunk-26LLB6FM.js → chunk-MDZTPSXO.js} +2 -2
- package/chunks/{chunk-4SLLEAQP.js → chunk-MJPBB2GK.js} +591 -316
- package/chunks/chunk-NABLFI57.js +82 -0
- package/chunks/{chunk-T7DDD7CZ.js → chunk-NAXEEGJU.js} +4 -4
- package/chunks/{chunk-467G3SV5.js → chunk-NPQDJGKU.js} +1 -1
- package/chunks/{chunk-FLTN6NRU.js → chunk-O4OT3DM3.js} +5 -1
- package/chunks/{chunk-3EUZWNWA.js → chunk-OPDZT2VG.js} +1 -1
- package/chunks/chunk-OQ5SYCPE.js +10017 -0
- package/chunks/{chunk-C27BYUX6.js → chunk-OQB4EXO4.js} +14 -11
- package/chunks/{chunk-V25Z5UUB.js → chunk-P6PBZL3N.js} +7 -6
- package/chunks/{chunk-5NWV4NFB.js → chunk-PRAUGUNM.js} +3 -3
- package/chunks/{chunk-MC2DOZS7.js → chunk-PVT6E3ZI.js} +3 -3
- package/chunks/{chunk-KXEGCGUG.js → chunk-Q22WWVR6.js} +31 -6
- package/chunks/{chunk-JDI67JFB.js → chunk-Q2YKNMLS.js} +3 -3
- package/chunks/{chunk-PBATSWUQ.js → chunk-QBUDF33N.js} +1 -1
- package/chunks/{chunk-Y2ENGUD6.js → chunk-QKTHJXCS.js} +1 -1
- package/chunks/{chunk-BVLROR2T.js → chunk-QLJUC7TG.js} +1 -1
- package/chunks/{chunk-UEY4AYUL.js → chunk-QNLNLENL.js} +2 -2
- package/chunks/{chunk-OKWRU4NO.js → chunk-RC7A7SSL.js} +3 -3
- package/chunks/chunk-RCUEYZDE.js +2290 -0
- package/chunks/{chunk-EVSTCA7S.js → chunk-RMY5SX7S.js} +368 -113
- package/chunks/{chunk-4WUAQ2DO.js → chunk-RTQSXHS7.js} +2 -2
- package/chunks/{chunk-RFIAR4YL.js → chunk-RV4C2ZFG.js} +1 -1
- package/chunks/{chunk-NIJEXGV6.js → chunk-RVLZCXEE.js} +79 -10
- package/chunks/{chunk-Q4RBU7WX.js → chunk-S333CBIA.js} +6 -6
- package/chunks/{chunk-JNWZQ27S.js → chunk-SP5WRGVG.js} +3 -3
- package/chunks/{chunk-FSL5W5TI.js → chunk-T2L47JJK.js} +3 -3
- package/chunks/{chunk-PWVTCGBP.js → chunk-TA4S377U.js} +30 -20
- package/chunks/{chunk-TB6UDU4T.js → chunk-THJNPLI4.js} +16 -16
- package/chunks/chunk-U6TQGUNB.js +20687 -0
- package/chunks/chunk-U7ZFW55U.js +2098 -0
- package/chunks/{chunk-W7H223ZZ.js → chunk-UGYMA4EI.js} +1 -1
- package/chunks/{chunk-X6YQWCIJ.js → chunk-UH3WSE5L.js} +13 -1
- package/chunks/{chunk-P2YAOGJD.js → chunk-UKU3NGW6.js} +3 -3
- package/chunks/{chunk-NOWTNYC7.js → chunk-UVFCANV5.js} +8 -8
- package/chunks/{chunk-CVDW42JT.js → chunk-V4AKJQ26.js} +1 -1
- package/chunks/{chunk-Z5Q65RVH.js → chunk-VJPRLNLR.js} +1 -1
- package/chunks/{chunk-Y4CRUWFZ.js → chunk-VTXX72XS.js} +60 -35
- package/chunks/{chunk-R3VWUU2E.js → chunk-VYPFXUCB.js} +1 -1
- package/chunks/chunk-WHGVTP7Q.js +1049 -0
- package/chunks/{chunk-IKP5DXZY.js → chunk-WOWQQGGN.js} +5 -5
- package/chunks/{chunk-D2VIDMVM.js → chunk-X6N25LXS.js} +2 -2
- package/chunks/chunk-XHATNRQA.js +1500 -0
- package/chunks/{chunk-2DXOIVUI.js → chunk-YLSB23Y2.js} +11 -11
- package/chunks/{chunk-S35ZDXOS.js → chunk-YM3SZTH4.js} +2 -1
- package/chunks/{chunk-OF2BBLYQ.js → chunk-YNWJAOPL.js} +2 -2
- package/chunks/{chunk-GKY2OJ7R.js → chunk-ZHERRXZJ.js} +1 -1
- package/chunks/{chunk-AR27OPIU.js → chunk-ZKFJKN23.js} +2 -2
- package/chunks/{computer-use-R7KA6UJ6.js → computer-use-UKQBH7UM.js} +39 -36
- package/chunks/{config-utils-6FXFJUYB.js → config-utils-FYTBZLCJ.js} +3 -3
- package/chunks/{contextCommand-KAQQPHZ4.js → contextCommand-ESHGAVWX.js} +36 -33
- package/chunks/{create-sub-session-TDPDBU4K.js → create-sub-session-574EPZUU.js} +34 -31
- package/chunks/{create-sub-session-X5RVIHCK.js → create-sub-session-AZ77LBL3.js} +3 -3
- package/chunks/{cron-create-AC5FFLN7.js → cron-create-KTWJM7QT.js} +5 -5
- package/chunks/{cron-delete-JEB3FAHA.js → cron-delete-2P3I5ULL.js} +5 -5
- package/chunks/{cron-list-NBYPCNIB.js → cron-list-PXDPGEDQ.js} +5 -5
- package/chunks/{daemon-RG2MAI6T.js → daemon-GJRFILYS.js} +323 -99
- package/chunks/daemon-status-provider-GZXZP3NU.js +80 -0
- package/chunks/{de-I7ZIYXZC.js → de-4IBXM7CN.js} +5 -1
- package/chunks/{dist-AU7NQQRP.js → dist-OAV7LJGJ.js} +1 -1
- package/chunks/{dist-FUTEXY6A.js → dist-OMW6WDEO.js} +1 -1
- package/chunks/{dist-2MIU4UUH.js → dist-PJLG2XYX.js} +1 -1
- package/chunks/{dist-53PZYC5B.js → dist-UIFWIFRO.js} +2 -2
- package/chunks/{dist-2BHAYBKP.js → dist-XBJVSWS2.js} +1 -1
- package/chunks/{dist-WGTQO7F2.js → dist-XRYV6TJP.js} +65 -25
- package/chunks/{earlyInputCapture-WC7RI5HV.js → earlyInputCapture-GI3HGQIT.js} +35 -32
- package/chunks/{edit-6MHKCJCM.js → edit-EBJK74B3.js} +42 -41
- package/chunks/{en-XE34GKAA.js → en-USMCCJAJ.js} +5 -1
- package/chunks/{enter-worktree-O7VJ2E7A.js → enter-worktree-2ETY5CSV.js} +39 -36
- package/chunks/{enterPlanMode-5XYAALIO.js → enterPlanMode-NY4U2727.js} +45 -37
- package/chunks/{environment-LSKFNLBU.js → environment-33IR3NOU.js} +36 -33
- package/chunks/{errors-ZFVCY6HG.js → errors-2OCY23IC.js} +36 -33
- package/chunks/{exit-worktree-MYIK66T7.js → exit-worktree-Y4ULJ45U.js} +39 -36
- package/chunks/{exitPlanMode-7MBNU76O.js → exitPlanMode-SECI2EQ6.js} +39 -36
- package/chunks/{fast-path-RNLIB64C.js → fast-path-6Z7RW5J5.js} +3 -2
- package/chunks/{fr-X7KDVZIY.js → fr-WVHEBDDB.js} +5 -1
- package/chunks/{gemini-WK5ISEAQ.js → gemini-XLGLUGSU.js} +93 -89
- package/chunks/{geminiContentGenerator-NUJQBZBW.js → geminiContentGenerator-NNZZDH24.js} +5 -5
- package/chunks/{getMachineId-bsd-EXV7SWPA.js → getMachineId-bsd-QFVLPUPT.js} +1 -1
- package/chunks/{getMachineId-darwin-IUOMFXU3.js → getMachineId-darwin-DGMQQE2E.js} +1 -1
- package/chunks/{getMachineId-linux-K7XJYFHL.js → getMachineId-linux-R4Z6CSWC.js} +1 -1
- package/chunks/{getMachineId-unsupported-EA5FDRJ6.js → getMachineId-unsupported-Z3SBVBUV.js} +1 -1
- package/chunks/{getMachineId-win-KBA6RAI5.js → getMachineId-win-SCK5UFDT.js} +1 -1
- package/chunks/{glob-7P6RYY4L.js → glob-KZA64SSV.js} +41 -38
- package/chunks/{grep-V3QHNP2J.js → grep-ONHQMY3V.js} +41 -38
- package/chunks/handleAutoUpdate-PRTJISXQ.js +73 -0
- package/chunks/{i18n-B7IO7WQT.js → i18n-ZTKKG5R5.js} +35 -32
- package/chunks/{initializer-E5TIC3CW.js → initializer-FPPZGBYN.js} +40 -37
- package/chunks/{installationInfo-XLPNAISK.js → installationInfo-DV2C27HT.js} +37 -32
- package/chunks/{ja-2ICT3KXF.js → ja-KY4ROZTE.js} +5 -1
- package/chunks/{keychain-token-storage-DWRJMNH3.js → keychain-token-storage-6ACJDYIB.js} +3 -3
- package/chunks/{list-3CZR5I42.js → list-KEHCNUAK.js} +42 -39
- package/chunks/{loadedSettingsAdapter-X5BSC6CE.js → loadedSettingsAdapter-7RZ6M3WH.js} +39 -36
- package/chunks/{loop-wakeup-HMHCT5GU.js → loop-wakeup-RNMRVA66.js} +6 -6
- package/chunks/{ls-IW5HYDG4.js → ls-J2ZI5XYK.js} +5 -5
- package/chunks/{lsp-4RL52YIZ.js → lsp-UMS3NUB5.js} +3 -3
- package/chunks/managed-npm-update-EBKNOG37.js +332 -0
- package/chunks/{mcp-4C4HWXAR.js → mcp-NHXKZRRP.js} +39 -36
- package/chunks/{monitor-3CJDNZB2.js → monitor-FMUAIFFH.js} +39 -36
- package/chunks/nonInteractiveCli-I2GPZNTP.js +132 -0
- package/chunks/{notebook-edit-MX366HCT.js → notebook-edit-V7RNXKVL.js} +43 -42
- package/chunks/{openaiContentGenerator-KRPNNJGZ.js → openaiContentGenerator-IBVUUZDH.js} +19 -18
- package/chunks/{pidfile-K7T2JLUJ.js → pidfile-AMTGL2H2.js} +35 -32
- package/chunks/{processUtils-YXL3VIBR.js → processUtils-3ZT2JF6D.js} +2 -2
- package/chunks/{pt-JJ4XPIBP.js → pt-OK455PLH.js} +5 -1
- package/chunks/{qwenContentGenerator-GJVXFZ3U.js → qwenContentGenerator-E72VVWS3.js} +41 -38
- package/chunks/{qwenOAuth2-UZTIBQLY.js → qwenOAuth2-YCC3HP24.js} +17 -16
- package/chunks/{read-file-S5XQSYOW.js → read-file-5EWNGUXN.js} +13 -11
- package/chunks/{read-mcp-resource-OIBCNIX7.js → read-mcp-resource-F6HYMDUY.js} +3 -3
- package/chunks/{record-artifact-HDMK4LHG.js → record-artifact-7GCFLDD7.js} +3 -3
- package/chunks/{resumeHistoryUtils-IKR6XD2S.js → resumeHistoryUtils-IH4RNB76.js} +41 -38
- package/chunks/{ripGrep-H65GRSQX.js → ripGrep-B6A6N7GI.js} +34 -31
- package/chunks/{ru-STR4KTW7.js → ru-7SPDGMGD.js} +5 -1
- package/chunks/{run-qwen-serve-7SKAQOAA.js → run-qwen-serve-6PKSMF6Z.js} +115 -74
- package/chunks/{runtime-I2STBGPR.js → runtime-ASRANXO6.js} +45 -40
- package/chunks/{scheduler-6F7HETNO.js → scheduler-IABM76UZ.js} +34 -31
- package/chunks/sdk-exporters-grpc-ETLH47EP.js +23214 -0
- package/chunks/sdk-exporters-http-6MCQH335.js +563 -0
- package/chunks/sdk-impl-HOLWAXC6.js +9193 -0
- package/chunks/{send-message-WXVVK4DB.js → send-message-KBO6X4ZS.js} +7 -5
- package/chunks/{serve-4ATEWSEA.js → serve-A4DT5D32.js} +39 -36
- package/chunks/{server-YPUPFV2O.js → server-DZ5ZSVRE.js} +2317 -472
- package/chunks/{session-AZFIERIY.js → session-G2R3CYU6.js} +87 -172
- package/chunks/{settings-EFQHLTM3.js → settings-7TNSXUTO.js} +43 -40
- package/chunks/{shell-FWXWBJ4Q.js → shell-5BRFGEMK.js} +34 -31
- package/chunks/{skill-A634MNCD.js → skill-3SWYEK7M.js} +24 -20
- package/chunks/{spawnChannel-KKBGGR47.js → spawnChannel-GGN2WVWW.js} +36 -33
- package/chunks/{src-BVROLD6N.js → src-5BPBNQ5S.js} +314 -236
- package/chunks/{standalone-update-ERLA3BDC.js → standalone-update-AHOZ56LS.js} +37 -34
- package/chunks/{startInteractiveUI-3VZ23WAY.js → startInteractiveUI-TLGOQVV7.js} +1105 -906
- package/chunks/{syntheticOutput-HCUFXSIA.js → syntheticOutput-H7RTI5KL.js} +4 -4
- package/chunks/{task-create-RIY5JTFC.js → task-create-7474AJJD.js} +10 -8
- package/chunks/{task-list-XBUCV3CO.js → task-list-633HGOIB.js} +6 -6
- package/chunks/{task-stop-QDFCCYR5.js → task-stop-MNUGHPIA.js} +3 -3
- package/chunks/{task-update-7PXKJQOI.js → task-update-66GQB5LI.js} +10 -8
- package/chunks/{team-create-ZZO7QFQ7.js → team-create-XHDF7UKM.js} +42 -39
- package/chunks/{team-delete-TNSSE2S5.js → team-delete-BB3CG3QF.js} +6 -6
- package/chunks/{team-plan-approval-3BZBJ46K.js → team-plan-approval-XKSBXWMH.js} +39 -36
- package/chunks/{theme-manager-FSFWNXFJ.js → theme-manager-6ZKLBFAN.js} +35 -32
- package/chunks/{todoWrite-OMAIGB6V.js → todoWrite-KRAUN54W.js} +5 -5
- package/chunks/{tool-search-VYXAAIDW.js → tool-search-UDNJCXYS.js} +21 -17
- package/chunks/{total-session-admission-PSMLQICS.js → total-session-admission-VWRCCDYM.js} +40 -37
- package/chunks/{tree-sitter-4D7QS7F6.js → tree-sitter-L5BFT64K.js} +1 -1
- package/chunks/{tree-sitter-bash-VEJGF5XF.js → tree-sitter-bash-ZKDNQGID.js} +1 -1
- package/chunks/{trustedFolders-QA3RK2NV.js → trustedFolders-TJI6OLAN.js} +35 -32
- package/chunks/{chunk-6EFTQYW7.js → undici-3FJYTMOF.js} +24 -399
- package/chunks/{chunk-L573Z2QZ.js → undici-PYHBDDPN.js} +1 -5
- package/chunks/{update-relaunch-LNLZFX3J.js → update-relaunch-RS5GB74A.js} +17 -17
- package/chunks/updateCheck-T4EEA5YR.js +88 -0
- package/chunks/{useAutoAcceptIndicator-DIWN27LT.js → useAutoAcceptIndicator-LLWMXC7F.js} +44 -41
- package/chunks/{validateNonInterActiveAuth-LOEOFCAF.js → validateNonInterActiveAuth-OJ3KYXAR.js} +74 -71
- package/chunks/{version-HBF2VBLE.js → version-ZCEUV5DO.js} +1 -1
- package/chunks/{web-fetch-BWGSD2BD.js → web-fetch-KQF4YFCI.js} +99 -42
- package/chunks/{web-search-OOHTCVR3.js → web-search-QDDGFGKI.js} +113 -61
- package/chunks/{workflow-LJAJBOR4.js → workflow-GIRKCX4P.js} +47 -43
- package/chunks/{workspace-providers-status-FYV7TTHA.js → workspace-providers-status-UTMAVTNE.js} +42 -39
- package/chunks/{workspace-registration-store-4EHGQW4Y.js → workspace-registration-store-EYJMJFZU.js} +8 -2
- package/chunks/{workspace-registry-BKD7VC4Y.js → workspace-registry-4W4UW6MY.js} +40 -37
- package/chunks/{workspace-service-75RHX6KR.js → workspace-service-DJCPY6ZN.js} +46 -43
- package/chunks/{workspace-skills-status-WBZBZI6A.js → workspace-skills-status-VQ2LKXXX.js} +40 -37
- package/chunks/write-file-PLK6RQ7M.js +65 -0
- package/chunks/{zh-TW-4RR3YHNN.js → zh-TW-BM47YBFH.js} +5 -1
- package/chunks/{zh-6ANG2HTL.js → zh-WY5DWYZD.js} +5 -1
- package/cli-entry.js +164 -12
- package/cli.js +18 -11
- package/locales/ca.js +772 -203
- package/locales/de.js +8 -2
- package/locales/en.js +8 -2
- package/locales/fr.js +8 -2
- package/locales/ja.js +8 -2
- package/locales/pt.js +8 -2
- package/locales/ru.js +8 -2
- package/locales/zh-TW.js +8 -2
- package/locales/zh.js +8 -2
- package/package.json +3 -3
- package/web-shell/assets/{arc-Buk1besA.js → arc-DIQrcXXh.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-B1aUKYDC.js → architectureDiagram-3BPJPVTR-CbPd-DSw.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-CRTdg3Zx.js → blockDiagram-GPEHLZMM-yzBIVhMX.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-DFdRMp5g.js → c4Diagram-AAUBKEIU-B88Swcsu.js} +1 -1
- package/web-shell/assets/channel-BaTMUesZ.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-4rYQdkEI.js → chunk-2J33WTMH-BbOLo6NX.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-Coi-pQJy.js → chunk-4BX2VUAB-Bg6in0r0.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-BtBjz02t.js → chunk-55IACEB6-Bv9QRyLI.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-CGYOWorl.js → chunk-727SXJPM-CFokiv61.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-CH5AKhqx.js → chunk-AQP2D5EJ-DS2Oxf6L.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-Cd50-w85.js → chunk-FMBD7UC4-D2NkHD3B.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-C2wF3KCK.js → chunk-ND2GUHAM-BsT_UC5B.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-pCeRTaWi.js → chunk-QZHKN3VN-tnJo3zln.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-CyBPzWud.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CyBPzWud.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-B-_fAB6D.js → cose-bilkent-S5V4N54A-BTMa6DAZ.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-ChSPNHpL.js → dagre-BM42HDAG-ujGX7Owg.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-BX7cFOF3.js → diagram-2AECGRRQ-fU4-dbPa.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-BQUTW92n.js → diagram-5GNKFQAL-Bdm-TYSA.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-BkYPh3e4.js → diagram-KO2AKTUF-Bkhz85Z9.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-Cl6jsNyx.js → diagram-LMA3HP47-Bzu3q26p.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-DRWoHz8n.js → diagram-OG6HWLK6-CZrXbG5Q.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-CGvFcZco.js → erDiagram-TEJ5UH35-BjozEAYu.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-vms6oVdv.js → flowDiagram-I6XJVG4X-B3a2I8c-.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-ukT_sfmi.js → ganttDiagram-6RSMTGT7-CIMn9fNm.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Bn2ZE2Ut.js → gitGraphDiagram-PVQCEYII-DlFy9KRx.js} +1 -1
- package/web-shell/assets/{index-wFXp7W68.js → index-BODUAzQA.js} +1 -1
- package/web-shell/assets/index-C54DNMF7.js +1209 -0
- package/web-shell/assets/index-lWqBfc78.css +5 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-DHJdSi7x.js → infoDiagram-5YYISTIA-BmKjQgCy.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DOvd2Wph.js → ishikawaDiagram-YF4QCWOH-BrQEMZz2.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-CH_urMCT.js → journeyDiagram-JHISSGLW-D-2r7Xrt.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-FKiBdgbH.js → kanban-definition-UN3LZRKU-CndsFHCX.js} +1 -1
- package/web-shell/assets/{linear-0ZVQFVKf.js → linear-D-IwNnKx.js} +1 -1
- package/web-shell/assets/{mermaid.core-DJ05ZZIK.js → mermaid.core-4ll09sri.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-BPuUhkUm.js → mindmap-definition-RKZ34NQL-maMRIxjo.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-yLFKcXyG.js → pieDiagram-4H26LBE5-aunUDhrJ.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-irWqc1pE.js → quadrantDiagram-W4KKPZXB-D3K0P1NZ.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-B_4uMoIV.js → requirementDiagram-4Y6WPE33-CX2X9HRc.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-ciA4GPwk.js → sankeyDiagram-5OEKKPKP-CDroWk7l.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CRdZvy0U.js → sequenceDiagram-3UESZ5HK-DTk-2b16.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-DaYIkCCn.js → stateDiagram-AJRCARHV-Cud64hQr.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-g-uUpecT.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-oBUKv6iH.js → timeline-definition-PNZ67QCA-DfD5okf_.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-CGW9Sdmb.js → vennDiagram-CIIHVFJN-BYl8ay25.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-CvwKJOCm.js → wardley-L42UT6IY-BZFAt10J.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-Ipc260sN.js → wardleyDiagram-YWT4CUSO-BIWn0GA7.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-D6-CM7pK.js → xychartDiagram-2RQKCTM6-1_H4xblT.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/chunk-ETD6K42I.js +0 -358
- package/chunks/chunk-I5NLVPZJ.js +0 -45
- package/chunks/chunk-ONWW74X6.js +0 -74639
- package/chunks/chunk-W7FJ3N32.js +0 -49
- package/chunks/daemon-status-provider-LVTVJGAD.js +0 -77
- package/chunks/handleAutoUpdate-AAQ6PL3E.js +0 -70
- package/chunks/nonInteractiveCli-QTEHDDFH.js +0 -129
- package/chunks/updateCheck-JJEUQ54U.js +0 -73
- package/chunks/write-file-M2DTFILF.js +0 -599
- package/web-shell/assets/channel-04R0vLbG.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-Bw9SOwAV.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Bw9SOwAV.js +0 -1
- package/web-shell/assets/index-DgkKrjw3.js +0 -1187
- package/web-shell/assets/index-Rv6mOAN9.css +0 -5
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DWBoO4UY.js +0 -1
|
@@ -1,70 +1,18 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
} from "./chunk-
|
|
4
|
+
buildPermissionSuggestions
|
|
5
|
+
} from "./chunk-43T5WDQ7.js";
|
|
6
6
|
import {
|
|
7
7
|
TUI_CHAT_RECORDING_FAILURE_MESSAGE,
|
|
8
8
|
reportChatRecordingFailureToAdapter
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
MAX_SUGGESTIONS_TO_SHOW,
|
|
12
|
-
buildMcpResourceRef,
|
|
13
|
-
buildMcpServerRef,
|
|
14
|
-
getExtensionSuggestions,
|
|
15
|
-
handleAtCommand,
|
|
16
|
-
matchMcpServerPrefix,
|
|
17
|
-
resolveAtCommandQuery,
|
|
18
|
-
sanitizeDisplayText
|
|
19
|
-
} from "./chunk-Z5R4JMOL.js";
|
|
9
|
+
} from "./chunk-RTQSXHS7.js";
|
|
20
10
|
import {
|
|
21
11
|
StreamJsonOutputAdapter
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import {
|
|
24
|
-
BuiltinCommandLoader,
|
|
25
|
-
BundledSkillLoader,
|
|
26
|
-
CommandService,
|
|
27
|
-
DISPLAY_HOOK_EVENTS,
|
|
28
|
-
FileCommandLoader,
|
|
29
|
-
MAX_STACKED_SKILLS,
|
|
30
|
-
McpPromptLoader,
|
|
31
|
-
SavedWorkflowLoader,
|
|
32
|
-
SkillCommandLoader,
|
|
33
|
-
addConfigToMatcherGroup,
|
|
34
|
-
appendUserPromptExpansionAdditionalContext,
|
|
35
|
-
copyToClipboard,
|
|
36
|
-
createEmptyHookEventInfo,
|
|
37
|
-
findMidInputSlashCommand,
|
|
38
|
-
findSlashCommandTokens,
|
|
39
|
-
formatApprovalModeDescription,
|
|
40
|
-
formatApprovalModeName,
|
|
41
|
-
formatUserPromptExpansionBlockedMessage,
|
|
42
|
-
getAllConfigs,
|
|
43
|
-
getBestSlashCommandMatch,
|
|
44
|
-
getTranslatedSourceDisplayMap,
|
|
45
|
-
hasBlockingBackgroundWork,
|
|
46
|
-
hasSlashCommandPathSeparator,
|
|
47
|
-
isAtCommand,
|
|
48
|
-
isBtwCommand,
|
|
49
|
-
isMidInputCompletableCommand,
|
|
50
|
-
isSlashCommand,
|
|
51
|
-
normalizePartList,
|
|
52
|
-
parseSlashCommand,
|
|
53
|
-
parseStackedSlashCommands,
|
|
54
|
-
refreshExtensionContentRuntime,
|
|
55
|
-
resetBackgroundStateForSessionSwitch,
|
|
56
|
-
serializeUserPromptExpansionPrompt,
|
|
57
|
-
supportsMatchers
|
|
58
|
-
} from "./chunk-VFAE4AGH.js";
|
|
12
|
+
} from "./chunk-HPQFGWOD.js";
|
|
59
13
|
import {
|
|
60
14
|
startPostRenderPrefetches
|
|
61
|
-
} from "./chunk-
|
|
62
|
-
import {
|
|
63
|
-
EXTENSION_RELOAD_FAILED_REASON,
|
|
64
|
-
ExtensionRefreshState,
|
|
65
|
-
appEvents,
|
|
66
|
-
loadHierarchicalGeminiMemory
|
|
67
|
-
} from "./chunk-4SLLEAQP.js";
|
|
15
|
+
} from "./chunk-HIYP7IR4.js";
|
|
68
16
|
import {
|
|
69
17
|
AboutBox,
|
|
70
18
|
BaseSelectionList,
|
|
@@ -140,20 +88,7 @@ import {
|
|
|
140
88
|
useTextBuffer,
|
|
141
89
|
useUIActions,
|
|
142
90
|
useUIState
|
|
143
|
-
} from "./chunk-
|
|
144
|
-
import {
|
|
145
|
-
getCommandDisplayName,
|
|
146
|
-
getCommandSourceBadge
|
|
147
|
-
} from "./chunk-3EUZWNWA.js";
|
|
148
|
-
import {
|
|
149
|
-
computeSessionStats,
|
|
150
|
-
levelLabel
|
|
151
|
-
} from "./chunk-WOT64EP2.js";
|
|
152
|
-
import {
|
|
153
|
-
MaxSizedBox,
|
|
154
|
-
OverflowProvider,
|
|
155
|
-
useOverflowState
|
|
156
|
-
} from "./chunk-JNWZQ27S.js";
|
|
91
|
+
} from "./chunk-IFVECEIK.js";
|
|
157
92
|
import {
|
|
158
93
|
GeminiRespondingSpinner,
|
|
159
94
|
GeminiSpinner,
|
|
@@ -166,27 +101,88 @@ import {
|
|
|
166
101
|
expandCollapsedHistory,
|
|
167
102
|
isCollapsibleTool,
|
|
168
103
|
useStreamingContext
|
|
169
|
-
} from "./chunk-
|
|
170
|
-
import {
|
|
171
|
-
theme
|
|
172
|
-
} from "./chunk-GMGDLUC7.js";
|
|
104
|
+
} from "./chunk-S333CBIA.js";
|
|
173
105
|
import {
|
|
174
106
|
stopAndGetCapturedInput
|
|
175
|
-
} from "./chunk-
|
|
176
|
-
import {
|
|
177
|
-
disableKittyProtocol,
|
|
178
|
-
isKittyProtocolEnabled,
|
|
179
|
-
isKittyProtocolSupported
|
|
180
|
-
} from "./chunk-5DTTYNB7.js";
|
|
107
|
+
} from "./chunk-E4IMU4Y5.js";
|
|
181
108
|
import {
|
|
182
109
|
useAutoAcceptIndicator
|
|
183
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-6GEJX3LE.js";
|
|
184
111
|
import {
|
|
185
112
|
KeypressProvider,
|
|
186
113
|
useFocus,
|
|
187
114
|
useKeypress,
|
|
188
115
|
useKeypressContext
|
|
189
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-FTNI3D7D.js";
|
|
117
|
+
import {
|
|
118
|
+
classifyApiError
|
|
119
|
+
} from "./chunk-V7RNNPGC.js";
|
|
120
|
+
import {
|
|
121
|
+
MAX_SUGGESTIONS_TO_SHOW,
|
|
122
|
+
buildMcpResourceRef,
|
|
123
|
+
buildMcpServerRef,
|
|
124
|
+
getExtensionSuggestions,
|
|
125
|
+
handleAtCommand,
|
|
126
|
+
matchMcpServerPrefix,
|
|
127
|
+
resolveAtCommandQuery,
|
|
128
|
+
sanitizeDisplayText
|
|
129
|
+
} from "./chunk-FJ2IUWNQ.js";
|
|
130
|
+
import {
|
|
131
|
+
BuiltinCommandLoader,
|
|
132
|
+
BundledSkillLoader,
|
|
133
|
+
CommandService,
|
|
134
|
+
DISPLAY_HOOK_EVENTS,
|
|
135
|
+
FileCommandLoader,
|
|
136
|
+
MAX_STACKED_SKILLS,
|
|
137
|
+
McpPromptLoader,
|
|
138
|
+
SavedWorkflowLoader,
|
|
139
|
+
SkillCommandLoader,
|
|
140
|
+
addConfigToMatcherGroup,
|
|
141
|
+
appendUserPromptExpansionAdditionalContext,
|
|
142
|
+
copyToClipboard,
|
|
143
|
+
createEmptyHookEventInfo,
|
|
144
|
+
findMidInputSlashCommand,
|
|
145
|
+
findSlashCommandTokens,
|
|
146
|
+
formatApprovalModeDescription,
|
|
147
|
+
formatApprovalModeName,
|
|
148
|
+
formatUserPromptExpansionBlockedMessage,
|
|
149
|
+
getAllConfigs,
|
|
150
|
+
getBestSlashCommandMatch,
|
|
151
|
+
getTranslatedSourceDisplayMap,
|
|
152
|
+
hasBlockingBackgroundWork,
|
|
153
|
+
hasSlashCommandPathSeparator,
|
|
154
|
+
isAtCommand,
|
|
155
|
+
isBtwCommand,
|
|
156
|
+
isMidInputCompletableCommand,
|
|
157
|
+
isSlashCommand,
|
|
158
|
+
normalizePartList,
|
|
159
|
+
parseSlashCommand,
|
|
160
|
+
parseStackedSlashCommands,
|
|
161
|
+
refreshExtensionContentRuntime,
|
|
162
|
+
resetBackgroundStateForSessionSwitch,
|
|
163
|
+
serializeUserPromptExpansionPrompt,
|
|
164
|
+
supportsMatchers
|
|
165
|
+
} from "./chunk-CGZ5SV23.js";
|
|
166
|
+
import {
|
|
167
|
+
EXTENSION_RELOAD_FAILED_REASON,
|
|
168
|
+
ExtensionRefreshState,
|
|
169
|
+
appEvents,
|
|
170
|
+
cleanupReviewWorktreeLeases,
|
|
171
|
+
loadHierarchicalGeminiMemory
|
|
172
|
+
} from "./chunk-MJPBB2GK.js";
|
|
173
|
+
import {
|
|
174
|
+
getCommandDisplayName,
|
|
175
|
+
getCommandSourceBadge
|
|
176
|
+
} from "./chunk-OPDZT2VG.js";
|
|
177
|
+
import {
|
|
178
|
+
computeSessionStats,
|
|
179
|
+
levelLabel
|
|
180
|
+
} from "./chunk-HCJQORKC.js";
|
|
181
|
+
import {
|
|
182
|
+
disableKittyProtocol,
|
|
183
|
+
isKittyProtocolEnabled,
|
|
184
|
+
isKittyProtocolSupported
|
|
185
|
+
} from "./chunk-5DTTYNB7.js";
|
|
190
186
|
import {
|
|
191
187
|
BEL,
|
|
192
188
|
OSC_PREFIX,
|
|
@@ -200,22 +196,22 @@ import {
|
|
|
200
196
|
saveClipboardImage,
|
|
201
197
|
wrapForMultiplexer,
|
|
202
198
|
writeOsc52
|
|
203
|
-
} from "./chunk-
|
|
204
|
-
import
|
|
205
|
-
require_jsx_runtime
|
|
206
|
-
} from "./chunk-SV5PQVQE.js";
|
|
207
|
-
import "./chunk-NOWTNYC7.js";
|
|
199
|
+
} from "./chunk-4LVZNIDO.js";
|
|
200
|
+
import "./chunk-UVFCANV5.js";
|
|
208
201
|
import "./chunk-4WGODMVR.js";
|
|
202
|
+
import "./chunk-WOWQQGGN.js";
|
|
203
|
+
import "./chunk-KW7NOTN6.js";
|
|
209
204
|
import {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
205
|
+
MaxSizedBox,
|
|
206
|
+
OverflowProvider,
|
|
207
|
+
useOverflowState
|
|
208
|
+
} from "./chunk-SP5WRGVG.js";
|
|
213
209
|
import {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
210
|
+
theme
|
|
211
|
+
} from "./chunk-6IL7KRLE.js";
|
|
212
|
+
import {
|
|
213
|
+
require_jsx_runtime
|
|
214
|
+
} from "./chunk-SV5PQVQE.js";
|
|
219
215
|
import {
|
|
220
216
|
Box_default,
|
|
221
217
|
Static,
|
|
@@ -229,32 +225,37 @@ import {
|
|
|
229
225
|
use_is_screen_reader_enabled_default,
|
|
230
226
|
use_stdin_default,
|
|
231
227
|
use_stdout_default
|
|
232
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-FFFM6NJV.js";
|
|
233
229
|
import {
|
|
234
230
|
require_react
|
|
235
231
|
} from "./chunk-5QWWOFGG.js";
|
|
236
|
-
import "./chunk-
|
|
237
|
-
import
|
|
238
|
-
getErrorMessage as getErrorMessage2
|
|
239
|
-
} from "./chunk-P2YAOGJD.js";
|
|
240
|
-
import "./chunk-RELYEO3R.js";
|
|
232
|
+
import "./chunk-IKP54WUL.js";
|
|
233
|
+
import "./chunk-L7ASZD66.js";
|
|
241
234
|
import "./chunk-NHDKSOEY.js";
|
|
242
|
-
import "./chunk-DA7OOKVN.js";
|
|
243
|
-
import "./chunk-LZYWWWCZ.js";
|
|
244
|
-
import "./chunk-YAF2MQZ6.js";
|
|
245
235
|
import {
|
|
246
236
|
relaunchApp
|
|
247
|
-
} from "./chunk-
|
|
237
|
+
} from "./chunk-3IABAQR6.js";
|
|
238
|
+
import {
|
|
239
|
+
setUpdateHandler
|
|
240
|
+
} from "./chunk-EEFRJ5CT.js";
|
|
241
|
+
import "./chunk-KF6CTNTJ.js";
|
|
242
|
+
import "./chunk-YAF2MQZ6.js";
|
|
243
|
+
import {
|
|
244
|
+
AUTO_THEME_NAME,
|
|
245
|
+
DEFAULT_THEME,
|
|
246
|
+
themeManager
|
|
247
|
+
} from "./chunk-7Z6JQEL6.js";
|
|
248
248
|
import {
|
|
249
249
|
openQwenAsrRealtimeStream,
|
|
250
250
|
openVoiceStream,
|
|
251
251
|
openVoiceStreamWithRetry
|
|
252
|
-
} from "./chunk-
|
|
252
|
+
} from "./chunk-ZHERRXZJ.js";
|
|
253
253
|
import {
|
|
254
254
|
recordGoalStatusItem,
|
|
255
255
|
restoreGoalFromHistory
|
|
256
|
-
} from "./chunk-
|
|
257
|
-
import "./chunk-
|
|
256
|
+
} from "./chunk-C54UTDOC.js";
|
|
257
|
+
import "./chunk-4K7VDKAD.js";
|
|
258
|
+
import "./chunk-V4AKJQ26.js";
|
|
258
259
|
import {
|
|
259
260
|
cpLen,
|
|
260
261
|
cpSlice,
|
|
@@ -267,67 +268,69 @@ import {
|
|
|
267
268
|
stripUnsafeCharacters,
|
|
268
269
|
toCodePoints
|
|
269
270
|
} from "./chunk-RS7MT2QG.js";
|
|
270
|
-
import "./chunk-CVDW42JT.js";
|
|
271
271
|
import {
|
|
272
272
|
stringWidth
|
|
273
273
|
} from "./chunk-H2XVO6NE.js";
|
|
274
|
+
import "./chunk-QHTIBUWB.js";
|
|
274
275
|
import {
|
|
275
276
|
isHistoryItemVisibleAfterRestore
|
|
276
277
|
} from "./chunk-QTERJVPZ.js";
|
|
277
|
-
import "./chunk-
|
|
278
|
-
import "./chunk-L573Z2QZ.js";
|
|
278
|
+
import "./chunk-3Z43GZUQ.js";
|
|
279
279
|
import "./chunk-RXFQM6FQ.js";
|
|
280
|
-
import "./chunk-
|
|
280
|
+
import "./chunk-HL6AKUGD.js";
|
|
281
281
|
import "./chunk-6H67XLET.js";
|
|
282
282
|
import {
|
|
283
|
-
|
|
284
|
-
} from "./chunk-
|
|
283
|
+
getErrorMessage as getErrorMessage2
|
|
284
|
+
} from "./chunk-UKU3NGW6.js";
|
|
285
285
|
import {
|
|
286
286
|
getExtendedSystemInfo
|
|
287
|
-
} from "./chunk-
|
|
287
|
+
} from "./chunk-HDATOR4J.js";
|
|
288
288
|
import {
|
|
289
289
|
formatDuration,
|
|
290
290
|
formatMemoryUsage,
|
|
291
291
|
formatRelativeTime,
|
|
292
292
|
formatTokenCount
|
|
293
293
|
} from "./chunk-E5Z2AVNV.js";
|
|
294
|
-
import "./chunk-6RLROE6G.js";
|
|
295
|
-
import "./chunk-COH43MRJ.js";
|
|
296
294
|
import {
|
|
297
295
|
isInlineModelOverrideAllowed
|
|
298
|
-
} from "./chunk-
|
|
296
|
+
} from "./chunk-M4VFMLQK.js";
|
|
299
297
|
import {
|
|
300
298
|
assertVoiceBaseUrlNetworkAllowed,
|
|
301
299
|
isKeytermEcho,
|
|
302
300
|
isStreamingVoiceModel,
|
|
303
301
|
resolveVoiceStreamConfig,
|
|
304
302
|
transcribeVoiceAudio
|
|
305
|
-
} from "./chunk-
|
|
303
|
+
} from "./chunk-M3EQ3GZC.js";
|
|
306
304
|
import {
|
|
307
305
|
formatUnsupportedVoiceModelMessage,
|
|
308
306
|
isSelectableVoiceModel
|
|
309
|
-
} from "./chunk-
|
|
310
|
-
import "./chunk-
|
|
311
|
-
import "./chunk-
|
|
307
|
+
} from "./chunk-AVQ6EX4J.js";
|
|
308
|
+
import "./chunk-QLJUC7TG.js";
|
|
309
|
+
import "./chunk-6RLROE6G.js";
|
|
310
|
+
import "./chunk-COH43MRJ.js";
|
|
311
|
+
import "./chunk-Q22WWVR6.js";
|
|
312
312
|
import {
|
|
313
313
|
requestConsentInteractive,
|
|
314
314
|
requestConsentOrFail
|
|
315
|
-
} from "./chunk-
|
|
315
|
+
} from "./chunk-FQI7LT7T.js";
|
|
316
316
|
import "./chunk-57OAHC2Y.js";
|
|
317
|
-
import "./chunk-
|
|
318
|
-
import "./chunk-
|
|
317
|
+
import "./chunk-GHRSKGHF.js";
|
|
318
|
+
import "./chunk-6ZBPS62S.js";
|
|
319
319
|
import "./chunk-V6WHFGST.js";
|
|
320
320
|
import {
|
|
321
|
-
|
|
322
|
-
} from "./chunk-
|
|
323
|
-
import "./chunk-
|
|
324
|
-
import "./chunk-
|
|
321
|
+
createLoadedSettingsAdapter
|
|
322
|
+
} from "./chunk-VJPRLNLR.js";
|
|
323
|
+
import "./chunk-2RFKHEXL.js";
|
|
324
|
+
import "./chunk-QKTHJXCS.js";
|
|
325
325
|
import "./chunk-TJTKSVIV.js";
|
|
326
326
|
import "./chunk-M5GB774H.js";
|
|
327
|
-
import "./chunk-
|
|
328
|
-
import "./chunk-
|
|
329
|
-
import "./chunk-
|
|
327
|
+
import "./chunk-RV4C2ZFG.js";
|
|
328
|
+
import "./chunk-2LI23QA6.js";
|
|
329
|
+
import "./chunk-RVLZCXEE.js";
|
|
330
330
|
import "./chunk-UDXSXLER.js";
|
|
331
|
+
import {
|
|
332
|
+
loadMcpApprovals
|
|
333
|
+
} from "./chunk-P6PBZL3N.js";
|
|
331
334
|
import {
|
|
332
335
|
CORRUPTED_SUFFIX,
|
|
333
336
|
SettingScope,
|
|
@@ -350,27 +353,30 @@ import {
|
|
|
350
353
|
settingExistsInScope,
|
|
351
354
|
validateSettingValue,
|
|
352
355
|
writeOutputLanguageAndRegisterPath
|
|
353
|
-
} from "./chunk-
|
|
356
|
+
} from "./chunk-GWM4PDYK.js";
|
|
354
357
|
import "./chunk-RKUWKYED.js";
|
|
355
|
-
import "./chunk-GOXKNSDZ.js";
|
|
356
|
-
import "./chunk-IDS7MSUP.js";
|
|
357
358
|
import {
|
|
358
359
|
getCurrentLanguage,
|
|
359
360
|
localizeToolDisplayName,
|
|
360
361
|
t,
|
|
361
362
|
ta
|
|
362
|
-
} from "./chunk-
|
|
363
|
-
import "./chunk-
|
|
363
|
+
} from "./chunk-YLSB23Y2.js";
|
|
364
|
+
import "./chunk-YNWJAOPL.js";
|
|
365
|
+
import "./chunk-XHATNRQA.js";
|
|
366
|
+
import "./chunk-4CTP6VR6.js";
|
|
367
|
+
import "./chunk-GOXKNSDZ.js";
|
|
368
|
+
import "./chunk-IDS7MSUP.js";
|
|
364
369
|
import "./chunk-QRUIS3DN.js";
|
|
370
|
+
import "./chunk-XFSFZCM5.js";
|
|
365
371
|
import "./chunk-URK542T4.js";
|
|
366
372
|
import {
|
|
367
373
|
getCliVersion
|
|
368
|
-
} from "./chunk-
|
|
374
|
+
} from "./chunk-ISMD2AB3.js";
|
|
369
375
|
import "./chunk-VJNBRRZG.js";
|
|
370
376
|
import {
|
|
371
377
|
isWorkspaceTrusted,
|
|
372
378
|
loadTrustedFolders
|
|
373
|
-
} from "./chunk-
|
|
379
|
+
} from "./chunk-PVT6E3ZI.js";
|
|
374
380
|
import {
|
|
375
381
|
require_strip_json_comments
|
|
376
382
|
} from "./chunk-ALGGS7UH.js";
|
|
@@ -379,7 +385,6 @@ import {
|
|
|
379
385
|
clearScreen,
|
|
380
386
|
writeStderrLine
|
|
381
387
|
} from "./chunk-OWAK7LMW.js";
|
|
382
|
-
import "./chunk-XFSFZCM5.js";
|
|
383
388
|
import {
|
|
384
389
|
ALIBABA_PROVIDERS,
|
|
385
390
|
AsyncFzf,
|
|
@@ -430,6 +435,7 @@ import {
|
|
|
430
435
|
detectAutonomousSentinel,
|
|
431
436
|
fetchGitDiff,
|
|
432
437
|
fetchGitDiffHunks,
|
|
438
|
+
finalizeToolResponses,
|
|
433
439
|
findExistingProviderModels,
|
|
434
440
|
findProviderByCredentials,
|
|
435
441
|
findProviderById,
|
|
@@ -444,7 +450,6 @@ import {
|
|
|
444
450
|
getExtensionDisplayName,
|
|
445
451
|
getGitBranch,
|
|
446
452
|
getProjectSummaryInfo,
|
|
447
|
-
getStartupContextLength,
|
|
448
453
|
getTimeRangeBounds,
|
|
449
454
|
getToolResponseDisplayText,
|
|
450
455
|
getWelcomeBackState,
|
|
@@ -457,7 +462,6 @@ import {
|
|
|
457
462
|
isSessionRuntimeActive,
|
|
458
463
|
isSettledStatus,
|
|
459
464
|
isSuccessStatus,
|
|
460
|
-
isSystemReminderContent,
|
|
461
465
|
isTerminalStatus,
|
|
462
466
|
loadUsageHistory,
|
|
463
467
|
markDuplicateProviderToolCallResponseSent,
|
|
@@ -487,42 +491,56 @@ import {
|
|
|
487
491
|
validateWorkflowName,
|
|
488
492
|
watchRepoBranch,
|
|
489
493
|
writeRuntimeStatus
|
|
490
|
-
} from "./chunk-
|
|
491
|
-
import "./chunk-5M6IDOMF.js";
|
|
494
|
+
} from "./chunk-BLAEKN6K.js";
|
|
492
495
|
import "./chunk-T4TZQJ7W.js";
|
|
493
496
|
import "./chunk-H6XPXXMH.js";
|
|
494
|
-
import "./chunk-
|
|
495
|
-
import "./chunk-
|
|
496
|
-
import "./chunk-
|
|
497
|
-
import "./chunk-
|
|
498
|
-
import "./chunk-EIAK6Q2B.js";
|
|
499
|
-
import "./chunk-FSL5W5TI.js";
|
|
500
|
-
import "./chunk-D2VIDMVM.js";
|
|
497
|
+
import "./chunk-5M6IDOMF.js";
|
|
498
|
+
import "./chunk-T2L47JJK.js";
|
|
499
|
+
import "./chunk-GPSKDNEE.js";
|
|
500
|
+
import "./chunk-X6N25LXS.js";
|
|
501
501
|
import "./chunk-E2UVIFI2.js";
|
|
502
502
|
import {
|
|
503
503
|
resolveModelId
|
|
504
|
-
} from "./chunk-
|
|
504
|
+
} from "./chunk-L5F3T6TQ.js";
|
|
505
|
+
import "./chunk-Q2YKNMLS.js";
|
|
506
|
+
import "./chunk-XU457J4V.js";
|
|
507
|
+
import "./chunk-VDDGDZMA.js";
|
|
508
|
+
import "./chunk-KHOVYUHX.js";
|
|
505
509
|
import "./chunk-SZRN75WQ.js";
|
|
506
|
-
import "./chunk-
|
|
510
|
+
import "./chunk-6PVPNMXU.js";
|
|
507
511
|
import "./chunk-CPBF7KYF.js";
|
|
508
|
-
import
|
|
509
|
-
APPROVAL_MODES
|
|
510
|
-
} from "./chunk-ETD6K42I.js";
|
|
511
|
-
import "./chunk-6AM5D4ME.js";
|
|
512
|
-
import "./chunk-G45X5TRN.js";
|
|
512
|
+
import "./chunk-NABLFI57.js";
|
|
513
513
|
import {
|
|
514
514
|
HOOKS_CONFIG_FIELDS
|
|
515
|
-
} from "./chunk-
|
|
515
|
+
} from "./chunk-QBUDF33N.js";
|
|
516
|
+
import "./chunk-LIZRAKPB.js";
|
|
517
|
+
import {
|
|
518
|
+
APPROVAL_MODES,
|
|
519
|
+
getStartupContextLength,
|
|
520
|
+
isSystemReminderContent,
|
|
521
|
+
runOutsideAgentContext
|
|
522
|
+
} from "./chunk-WHGVTP7Q.js";
|
|
523
|
+
import "./chunk-6AM5D4ME.js";
|
|
524
|
+
import "./chunk-JCW2R7WC.js";
|
|
516
525
|
import {
|
|
517
526
|
isPathWithinRoot
|
|
518
|
-
} from "./chunk-
|
|
519
|
-
import "./chunk-
|
|
527
|
+
} from "./chunk-57FIIFJN.js";
|
|
528
|
+
import "./chunk-HTO4JFDZ.js";
|
|
520
529
|
import {
|
|
521
530
|
qwenOAuth2Events
|
|
522
|
-
} from "./chunk-
|
|
523
|
-
import "./chunk-OKWRU4NO.js";
|
|
524
|
-
import "./chunk-XNP57UDV.js";
|
|
531
|
+
} from "./chunk-2HGTVAOW.js";
|
|
525
532
|
import "./chunk-JESCGQM3.js";
|
|
533
|
+
import "./chunk-RC7A7SSL.js";
|
|
534
|
+
import "./chunk-C3EXYVFX.js";
|
|
535
|
+
import {
|
|
536
|
+
REASONING_EFFORT_TIERS
|
|
537
|
+
} from "./chunk-XVNQMZ2I.js";
|
|
538
|
+
import {
|
|
539
|
+
getUnsupportedImageFormatWarning,
|
|
540
|
+
isSupportedImageMimeType
|
|
541
|
+
} from "./chunk-FODK6UMO.js";
|
|
542
|
+
import "./chunk-GLNBDYUX.js";
|
|
543
|
+
import "./chunk-DJ2GSRLV.js";
|
|
526
544
|
import {
|
|
527
545
|
ApiCancelEvent,
|
|
528
546
|
AuthEvent,
|
|
@@ -564,9 +582,7 @@ import {
|
|
|
564
582
|
runVisionBridge,
|
|
565
583
|
shouldRunVisionBridge,
|
|
566
584
|
splitImageParts
|
|
567
|
-
} from "./chunk-
|
|
568
|
-
import "./chunk-4WKAA4KS.js";
|
|
569
|
-
import "./chunk-CR3C7WXL.js";
|
|
585
|
+
} from "./chunk-U6TQGUNB.js";
|
|
570
586
|
import "./chunk-VGC4I5JJ.js";
|
|
571
587
|
import {
|
|
572
588
|
AUTO_MEMORY_INDEX_FILENAME,
|
|
@@ -574,36 +590,30 @@ import {
|
|
|
574
590
|
getAutoMemoryRoot,
|
|
575
591
|
getUserAutoMemoryRoot,
|
|
576
592
|
isAnyAutoMemPath
|
|
577
|
-
} from "./chunk-
|
|
578
|
-
import "./chunk-UEY4AYUL.js";
|
|
579
|
-
import {
|
|
580
|
-
atomicWriteFileSync
|
|
581
|
-
} from "./chunk-BDBMYST4.js";
|
|
582
|
-
import "./chunk-467G3SV5.js";
|
|
583
|
-
import {
|
|
584
|
-
ToolNames,
|
|
585
|
-
isShellProgressData
|
|
586
|
-
} from "./chunk-S35ZDXOS.js";
|
|
587
|
-
import {
|
|
588
|
-
REASONING_EFFORT_TIERS
|
|
589
|
-
} from "./chunk-XVNQMZ2I.js";
|
|
590
|
-
import {
|
|
591
|
-
getUnsupportedImageFormatWarning,
|
|
592
|
-
isSupportedImageMimeType
|
|
593
|
-
} from "./chunk-FODK6UMO.js";
|
|
594
|
-
import "./chunk-GLNBDYUX.js";
|
|
595
|
-
import "./chunk-DJ2GSRLV.js";
|
|
596
|
-
import "./chunk-6EFTQYW7.js";
|
|
593
|
+
} from "./chunk-4K56OJFJ.js";
|
|
597
594
|
import {
|
|
598
595
|
DEFAULT_TOKEN_LIMIT
|
|
599
|
-
} from "./chunk-
|
|
596
|
+
} from "./chunk-CBOQ3HY7.js";
|
|
600
597
|
import "./chunk-A4UCTEB5.js";
|
|
601
598
|
import "./chunk-XWRJCPHC.js";
|
|
599
|
+
import "./chunk-QNLNLENL.js";
|
|
600
|
+
import {
|
|
601
|
+
atomicWriteFileSync
|
|
602
|
+
} from "./chunk-6X4GWOPW.js";
|
|
602
603
|
import {
|
|
603
604
|
FinishReason
|
|
604
605
|
} from "./chunk-TYQMGACW.js";
|
|
605
606
|
import "./chunk-TYAMGABM.js";
|
|
606
607
|
import "./chunk-FCMNKVXT.js";
|
|
608
|
+
import "./chunk-RCUEYZDE.js";
|
|
609
|
+
import "./chunk-HTR4WV6U.js";
|
|
610
|
+
import "./chunk-BULDBTYC.js";
|
|
611
|
+
import "./chunk-U7ZFW55U.js";
|
|
612
|
+
import "./chunk-NPQDJGKU.js";
|
|
613
|
+
import {
|
|
614
|
+
ToolNames,
|
|
615
|
+
isShellProgressData
|
|
616
|
+
} from "./chunk-YM3SZTH4.js";
|
|
607
617
|
import {
|
|
608
618
|
Storage,
|
|
609
619
|
UnauthorizedError,
|
|
@@ -615,21 +625,21 @@ import {
|
|
|
615
625
|
isNodeError,
|
|
616
626
|
shortenPath,
|
|
617
627
|
tildeifyPath
|
|
618
|
-
} from "./chunk-
|
|
619
|
-
import "./chunk-
|
|
620
|
-
import {
|
|
621
|
-
registerCleanup,
|
|
622
|
-
runExitCleanup
|
|
623
|
-
} from "./chunk-FLTN6NRU.js";
|
|
628
|
+
} from "./chunk-OQB4EXO4.js";
|
|
629
|
+
import "./chunk-LU3RXCM7.js";
|
|
624
630
|
import {
|
|
625
631
|
finalizeStartupProfile,
|
|
626
632
|
profileCheckpoint
|
|
627
633
|
} from "./chunk-QSWDGAIC.js";
|
|
628
634
|
import "./chunk-Q7YDKOGY.js";
|
|
635
|
+
import {
|
|
636
|
+
registerCleanup,
|
|
637
|
+
runExitCleanup
|
|
638
|
+
} from "./chunk-O4OT3DM3.js";
|
|
629
639
|
import "./chunk-75DOP5OR.js";
|
|
630
640
|
import "./chunk-DMTGGOSA.js";
|
|
631
641
|
import "./chunk-YQ3U5MUC.js";
|
|
632
|
-
import "./chunk-
|
|
642
|
+
import "./chunk-THJNPLI4.js";
|
|
633
643
|
import {
|
|
634
644
|
init_esbuild_shims
|
|
635
645
|
} from "./chunk-5O2XNYP6.js";
|
|
@@ -641,7 +651,7 @@ import {
|
|
|
641
651
|
// packages/cli/src/ui/startInteractiveUI.tsx
|
|
642
652
|
init_esbuild_shims();
|
|
643
653
|
import { basename as basename4 } from "node:path";
|
|
644
|
-
var
|
|
654
|
+
var import_react167 = __toESM(require_react(), 1);
|
|
645
655
|
|
|
646
656
|
// packages/cli/src/dualOutput/DualOutputBridge.ts
|
|
647
657
|
init_esbuild_shims();
|
|
@@ -834,7 +844,7 @@ var DualOutputBridge = class {
|
|
|
834
844
|
* Emits a `can_use_tool` permission request so an external consumer can
|
|
835
845
|
* approve or deny the tool call. Pairs with {@link emitControlResponse}.
|
|
836
846
|
*/
|
|
837
|
-
emitPermissionRequest(requestId, toolName, toolUseId, input, blockedPath = null) {
|
|
847
|
+
emitPermissionRequest(requestId, toolName, toolUseId, input, blockedPath = null, permissionSuggestions = null) {
|
|
838
848
|
if (!this.active) return;
|
|
839
849
|
this.disableIfBufferOverflowed();
|
|
840
850
|
if (!this.active) return;
|
|
@@ -844,7 +854,8 @@ var DualOutputBridge = class {
|
|
|
844
854
|
toolName,
|
|
845
855
|
toolUseId,
|
|
846
856
|
input,
|
|
847
|
-
blockedPath
|
|
857
|
+
blockedPath,
|
|
858
|
+
permissionSuggestions
|
|
848
859
|
);
|
|
849
860
|
} catch (err) {
|
|
850
861
|
debugLogger.error("DualOutput emitPermissionRequest error:", err);
|
|
@@ -1256,7 +1267,7 @@ var useRemoteInput = /* @__PURE__ */ __name(() => (0, import_react2.useContext)(
|
|
|
1256
1267
|
|
|
1257
1268
|
// packages/cli/src/ui/AppContainer.tsx
|
|
1258
1269
|
init_esbuild_shims();
|
|
1259
|
-
var
|
|
1270
|
+
var import_react165 = __toESM(require_react(), 1);
|
|
1260
1271
|
|
|
1261
1272
|
// packages/cli/src/ui/App.tsx
|
|
1262
1273
|
init_esbuild_shims();
|
|
@@ -1386,30 +1397,15 @@ var useAppContext = /* @__PURE__ */ __name(() => {
|
|
|
1386
1397
|
return context;
|
|
1387
1398
|
}, "useAppContext");
|
|
1388
1399
|
|
|
1389
|
-
// packages/cli/src/ui/components/UpdateNotification.tsx
|
|
1390
|
-
init_esbuild_shims();
|
|
1391
|
-
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
1392
|
-
var UpdateNotification = /* @__PURE__ */ __name(({ message }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1393
|
-
Box_default,
|
|
1394
|
-
{
|
|
1395
|
-
borderStyle: "round",
|
|
1396
|
-
borderColor: theme.status.warning,
|
|
1397
|
-
paddingX: 1,
|
|
1398
|
-
marginY: 1,
|
|
1399
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: theme.status.warning, children: message })
|
|
1400
|
-
}
|
|
1401
|
-
), "UpdateNotification");
|
|
1402
|
-
|
|
1403
1400
|
// packages/cli/src/ui/components/Notifications.tsx
|
|
1404
|
-
var
|
|
1401
|
+
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
1405
1402
|
var Notifications = /* @__PURE__ */ __name(() => {
|
|
1406
1403
|
const { startupWarnings } = useAppContext();
|
|
1407
|
-
const { initError, streamingState
|
|
1404
|
+
const { initError, streamingState } = useUIState();
|
|
1408
1405
|
const showStartupWarnings = startupWarnings.length > 0;
|
|
1409
1406
|
const showInitError = initError && streamingState !== "responding" /* Responding */;
|
|
1410
|
-
return /* @__PURE__ */ (0,
|
|
1411
|
-
|
|
1412
|
-
showStartupWarnings && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
1408
|
+
showStartupWarnings && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1413
1409
|
Box_default,
|
|
1414
1410
|
{
|
|
1415
1411
|
borderStyle: "round",
|
|
@@ -1417,10 +1413,10 @@ var Notifications = /* @__PURE__ */ __name(() => {
|
|
|
1417
1413
|
paddingX: 1,
|
|
1418
1414
|
marginY: 1,
|
|
1419
1415
|
flexDirection: "column",
|
|
1420
|
-
children: startupWarnings.map((warning, index) => /* @__PURE__ */ (0,
|
|
1416
|
+
children: startupWarnings.map((warning, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: theme.status.warning, children: warning }, index))
|
|
1421
1417
|
}
|
|
1422
1418
|
),
|
|
1423
|
-
showInitError && /* @__PURE__ */ (0,
|
|
1419
|
+
showInitError && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1424
1420
|
Box_default,
|
|
1425
1421
|
{
|
|
1426
1422
|
borderStyle: "round",
|
|
@@ -1428,11 +1424,11 @@ var Notifications = /* @__PURE__ */ __name(() => {
|
|
|
1428
1424
|
paddingX: 1,
|
|
1429
1425
|
marginBottom: 1,
|
|
1430
1426
|
children: [
|
|
1431
|
-
/* @__PURE__ */ (0,
|
|
1427
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text, { color: theme.status.error, children: [
|
|
1432
1428
|
"Initialization Error: ",
|
|
1433
1429
|
initError
|
|
1434
1430
|
] }),
|
|
1435
|
-
/* @__PURE__ */ (0,
|
|
1431
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text, { color: theme.status.error, children: [
|
|
1436
1432
|
" ",
|
|
1437
1433
|
"Please check API key and configuration."
|
|
1438
1434
|
] })
|
|
@@ -1442,6 +1438,20 @@ var Notifications = /* @__PURE__ */ __name(() => {
|
|
|
1442
1438
|
] });
|
|
1443
1439
|
}, "Notifications");
|
|
1444
1440
|
|
|
1441
|
+
// packages/cli/src/ui/components/UpdateNotification.tsx
|
|
1442
|
+
init_esbuild_shims();
|
|
1443
|
+
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
|
1444
|
+
var UpdateNotification = /* @__PURE__ */ __name(({ message }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1445
|
+
Box_default,
|
|
1446
|
+
{
|
|
1447
|
+
borderStyle: "round",
|
|
1448
|
+
borderColor: theme.status.warning,
|
|
1449
|
+
paddingX: 1,
|
|
1450
|
+
marginY: 1,
|
|
1451
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: theme.status.warning, children: message })
|
|
1452
|
+
}
|
|
1453
|
+
), "UpdateNotification");
|
|
1454
|
+
|
|
1445
1455
|
// packages/cli/src/ui/components/MainContent.tsx
|
|
1446
1456
|
init_esbuild_shims();
|
|
1447
1457
|
var import_react14 = __toESM(require_react(), 1);
|
|
@@ -30880,7 +30890,13 @@ var Footer = /* @__PURE__ */ __name(() => {
|
|
|
30880
30890
|
t("IDE connecting... context may be unavailable")
|
|
30881
30891
|
] }) : uiState.startupIdeConnectionStatus.state === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text, { color: theme.status.warning, children: t("IDE connection unavailable: {{message}}", {
|
|
30882
30892
|
message: uiState.startupIdeConnectionStatus.message
|
|
30883
|
-
}) }) : uiState.streamingState === "responding" /* Responding */ ? /* @__PURE__ */ (0, import_jsx_runtime116.
|
|
30893
|
+
}) }) : uiState.streamingState === "responding" /* Responding */ ? /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
30894
|
+
t("Enter to steer \xB7 Ctrl+Q to queue"),
|
|
30895
|
+
showAutoAcceptIndicator !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(import_jsx_runtime116.Fragment, { children: [
|
|
30896
|
+
" \xB7 ",
|
|
30897
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(AutoAcceptIndicator, { approvalMode: showAutoAcceptIndicator })
|
|
30898
|
+
] })
|
|
30899
|
+
] }) : showAutoAcceptIndicator !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(AutoAcceptIndicator, { approvalMode: showAutoAcceptIndicator }) : suppressHint ? null : /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text, { color: theme.text.secondary, children: t("? for shortcuts") });
|
|
30884
30900
|
const rightItems = [];
|
|
30885
30901
|
if (sandboxInfo) {
|
|
30886
30902
|
rightItems.push({
|
|
@@ -31460,6 +31476,7 @@ var ScreenReaderAppLayout = /* @__PURE__ */ __name(() => {
|
|
|
31460
31476
|
const dialogHeight = uiState.constrainHeight ? dialogMaxHeight : void 0;
|
|
31461
31477
|
const shouldShowStickyTodos = uiState.stickyTodos !== null && !uiState.dialogsVisible && !uiState.isFeedbackDialogOpen && uiState.streamingState === "responding" /* Responding */;
|
|
31462
31478
|
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Box_default, { flexDirection: "column", width: "90%", height: "100%", children: [
|
|
31479
|
+
!uiState.dialogsVisible && uiState.updateInfo && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(UpdateNotification, { message: uiState.updateInfo.message }),
|
|
31463
31480
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Notifications, {}),
|
|
31464
31481
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Footer, {}),
|
|
31465
31482
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Box_default, { flexGrow: 1, overflow: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(MainContent, {}) }),
|
|
@@ -32541,12 +32558,14 @@ var DefaultAppLayout = /* @__PURE__ */ __name(() => {
|
|
|
32541
32558
|
isAgentTab ? /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
|
|
32542
32559
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(AgentChatView, { agentId: activeView }),
|
|
32543
32560
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(Box_default, { flexDirection: "column", ref: uiState.mainControlsRef, children: [
|
|
32561
|
+
!uiState.dialogsVisible && uiState.updateInfo && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(UpdateNotification, { message: uiState.updateInfo.message }),
|
|
32544
32562
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(AgentComposer, { agentId: activeView }, activeView),
|
|
32545
32563
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(ExitWarning, {})
|
|
32546
32564
|
] })
|
|
32547
32565
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
|
|
32548
32566
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(MainContent, {}),
|
|
32549
32567
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(Box_default, { flexDirection: "column", ref: uiState.mainControlsRef, children: [
|
|
32568
|
+
!uiState.dialogsVisible && uiState.updateInfo && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(UpdateNotification, { message: uiState.updateInfo.message }),
|
|
32550
32569
|
uiState.dialogsVisible ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
32551
32570
|
Box_default,
|
|
32552
32571
|
{
|
|
@@ -32751,14 +32770,46 @@ function useResizeSettleRepaint(terminalWidth, refreshStatic) {
|
|
|
32751
32770
|
}
|
|
32752
32771
|
__name(useResizeSettleRepaint, "useResizeSettleRepaint");
|
|
32753
32772
|
|
|
32754
|
-
// packages/cli/src/ui/hooks/
|
|
32773
|
+
// packages/cli/src/ui/hooks/use-wake-repaint.ts
|
|
32755
32774
|
init_esbuild_shims();
|
|
32756
32775
|
var import_react118 = __toESM(require_react(), 1);
|
|
32776
|
+
var HEARTBEAT_INTERVAL_MS = 5e3;
|
|
32777
|
+
var WAKE_THRESHOLD_MS = HEARTBEAT_INTERVAL_MS * 2;
|
|
32778
|
+
function useWakeRepaint(repaint) {
|
|
32779
|
+
const repaintRef = (0, import_react118.useRef)(repaint);
|
|
32780
|
+
repaintRef.current = repaint;
|
|
32781
|
+
(0, import_react118.useEffect)(() => {
|
|
32782
|
+
let lastTick = Date.now();
|
|
32783
|
+
const timer = setInterval(() => {
|
|
32784
|
+
const now = Date.now();
|
|
32785
|
+
const elapsed = now - lastTick;
|
|
32786
|
+
lastTick = now;
|
|
32787
|
+
if (elapsed > WAKE_THRESHOLD_MS) {
|
|
32788
|
+
repaintRef.current();
|
|
32789
|
+
}
|
|
32790
|
+
}, HEARTBEAT_INTERVAL_MS);
|
|
32791
|
+
timer.unref?.();
|
|
32792
|
+
const onSigcont = /* @__PURE__ */ __name(() => {
|
|
32793
|
+
lastTick = Date.now();
|
|
32794
|
+
repaintRef.current();
|
|
32795
|
+
}, "onSigcont");
|
|
32796
|
+
process.on("SIGCONT", onSigcont);
|
|
32797
|
+
return () => {
|
|
32798
|
+
clearInterval(timer);
|
|
32799
|
+
process.removeListener("SIGCONT", onSigcont);
|
|
32800
|
+
};
|
|
32801
|
+
}, []);
|
|
32802
|
+
}
|
|
32803
|
+
__name(useWakeRepaint, "useWakeRepaint");
|
|
32804
|
+
|
|
32805
|
+
// packages/cli/src/ui/hooks/useThemeCommand.ts
|
|
32806
|
+
init_esbuild_shims();
|
|
32807
|
+
var import_react119 = __toESM(require_react(), 1);
|
|
32757
32808
|
import process13 from "node:process";
|
|
32758
32809
|
var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, addItem, initialThemeError) => {
|
|
32759
|
-
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0,
|
|
32760
|
-
const [themeBeforeDialogOpen, setThemeBeforeDialogOpen] = (0,
|
|
32761
|
-
const openThemeDialog = (0,
|
|
32810
|
+
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0, import_react119.useState)(!!initialThemeError);
|
|
32811
|
+
const [themeBeforeDialogOpen, setThemeBeforeDialogOpen] = (0, import_react119.useState)(themeManager.getActiveTheme().name);
|
|
32812
|
+
const openThemeDialog = (0, import_react119.useCallback)(() => {
|
|
32762
32813
|
if (process13.env["NO_COLOR"]) {
|
|
32763
32814
|
addItem(
|
|
32764
32815
|
{
|
|
@@ -32774,7 +32825,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
32774
32825
|
setThemeBeforeDialogOpen(themeManager.getActiveTheme().name);
|
|
32775
32826
|
setIsThemeDialogOpen(true);
|
|
32776
32827
|
}, [addItem]);
|
|
32777
|
-
const applyTheme = (0,
|
|
32828
|
+
const applyTheme = (0, import_react119.useCallback)(
|
|
32778
32829
|
(themeName) => {
|
|
32779
32830
|
if (!themeManager.setActiveTheme(themeName)) {
|
|
32780
32831
|
setIsThemeDialogOpen(true);
|
|
@@ -32789,13 +32840,13 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
32789
32840
|
},
|
|
32790
32841
|
[setThemeError]
|
|
32791
32842
|
);
|
|
32792
|
-
const handleThemeHighlight = (0,
|
|
32843
|
+
const handleThemeHighlight = (0, import_react119.useCallback)(
|
|
32793
32844
|
(themeName) => {
|
|
32794
32845
|
applyTheme(themeName);
|
|
32795
32846
|
},
|
|
32796
32847
|
[applyTheme]
|
|
32797
32848
|
);
|
|
32798
|
-
const handleThemeSelect = (0,
|
|
32849
|
+
const handleThemeSelect = (0, import_react119.useCallback)(
|
|
32799
32850
|
(themeName, scope) => {
|
|
32800
32851
|
if (themeName === void 0) {
|
|
32801
32852
|
applyTheme(themeBeforeDialogOpen);
|
|
@@ -32842,7 +32893,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
32842
32893
|
|
|
32843
32894
|
// packages/cli/src/ui/hooks/useFeedbackDialog.ts
|
|
32844
32895
|
init_esbuild_shims();
|
|
32845
|
-
var
|
|
32896
|
+
var import_react120 = __toESM(require_react(), 1);
|
|
32846
32897
|
import * as fs15 from "node:fs";
|
|
32847
32898
|
var import_strip_json_comments = __toESM(require_strip_json_comments(), 1);
|
|
32848
32899
|
var FEEDBACK_SHOW_PROBABILITY = 0.25;
|
|
@@ -32888,20 +32939,20 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
32888
32939
|
history,
|
|
32889
32940
|
sessionStats
|
|
32890
32941
|
}) => {
|
|
32891
|
-
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = (0,
|
|
32892
|
-
const [isFeedbackDismissedTemporarily, setIsFeedbackDismissedTemporarily] = (0,
|
|
32893
|
-
const openFeedbackDialog = (0,
|
|
32942
|
+
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = (0, import_react120.useState)(false);
|
|
32943
|
+
const [isFeedbackDismissedTemporarily, setIsFeedbackDismissedTemporarily] = (0, import_react120.useState)(false);
|
|
32944
|
+
const openFeedbackDialog = (0, import_react120.useCallback)(() => {
|
|
32894
32945
|
setIsFeedbackDialogOpen(true);
|
|
32895
32946
|
}, []);
|
|
32896
|
-
const closeFeedbackDialog = (0,
|
|
32947
|
+
const closeFeedbackDialog = (0, import_react120.useCallback)(
|
|
32897
32948
|
() => setIsFeedbackDialogOpen(false),
|
|
32898
32949
|
[]
|
|
32899
32950
|
);
|
|
32900
|
-
const temporaryCloseFeedbackDialog = (0,
|
|
32951
|
+
const temporaryCloseFeedbackDialog = (0, import_react120.useCallback)(() => {
|
|
32901
32952
|
setIsFeedbackDialogOpen(false);
|
|
32902
32953
|
setIsFeedbackDismissedTemporarily(true);
|
|
32903
32954
|
}, []);
|
|
32904
|
-
const submitFeedback = (0,
|
|
32955
|
+
const submitFeedback = (0, import_react120.useCallback)(
|
|
32905
32956
|
(rating) => {
|
|
32906
32957
|
if (rating >= FEEDBACK_OPTIONS.GOOD && rating <= FEEDBACK_OPTIONS.FINE) {
|
|
32907
32958
|
const feedbackEvent = new UserFeedbackEvent(
|
|
@@ -32921,7 +32972,7 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
32921
32972
|
},
|
|
32922
32973
|
[closeFeedbackDialog, sessionStats.sessionId, config, settings]
|
|
32923
32974
|
);
|
|
32924
|
-
(0,
|
|
32975
|
+
(0, import_react120.useEffect)(() => {
|
|
32925
32976
|
const checkAndShowFeedback = /* @__PURE__ */ __name(() => {
|
|
32926
32977
|
if (streamingState === "idle" /* Idle */ && history.length > 0) {
|
|
32927
32978
|
if (!config.getUsageStatisticsEnabled() || settings.merged.ui?.enableUserFeedback === false || !lastMessageIsAIResponse(history) || Math.random() > FEEDBACK_SHOW_PROBABILITY || !meetsMinimumSessionRequirements(sessionStats) || isFeedbackDismissedTemporarily) {
|
|
@@ -32943,7 +32994,7 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
32943
32994
|
settings.merged.ui?.enableUserFeedback,
|
|
32944
32995
|
config
|
|
32945
32996
|
]);
|
|
32946
|
-
(0,
|
|
32997
|
+
(0, import_react120.useEffect)(() => {
|
|
32947
32998
|
if (streamingState === "responding" /* Responding */ && isFeedbackDismissedTemporarily) {
|
|
32948
32999
|
setIsFeedbackDismissedTemporarily(false);
|
|
32949
33000
|
}
|
|
@@ -32959,13 +33010,13 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
32959
33010
|
|
|
32960
33011
|
// packages/cli/src/ui/hooks/useEditorSettings.ts
|
|
32961
33012
|
init_esbuild_shims();
|
|
32962
|
-
var
|
|
33013
|
+
var import_react121 = __toESM(require_react(), 1);
|
|
32963
33014
|
var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError, addItem) => {
|
|
32964
|
-
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0,
|
|
32965
|
-
const openEditorDialog = (0,
|
|
33015
|
+
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0, import_react121.useState)(false);
|
|
33016
|
+
const openEditorDialog = (0, import_react121.useCallback)(() => {
|
|
32966
33017
|
setIsEditorDialogOpen(true);
|
|
32967
33018
|
}, []);
|
|
32968
|
-
const handleEditorSelect = (0,
|
|
33019
|
+
const handleEditorSelect = (0, import_react121.useCallback)(
|
|
32969
33020
|
(editorType, scope) => {
|
|
32970
33021
|
if (editorType && (!checkHasEditorType(editorType) || !allowEditorTypeInSandbox(editorType))) {
|
|
32971
33022
|
return;
|
|
@@ -32987,7 +33038,7 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
32987
33038
|
},
|
|
32988
33039
|
[loadedSettings, setEditorError, addItem]
|
|
32989
33040
|
);
|
|
32990
|
-
const exitEditorDialog = (0,
|
|
33041
|
+
const exitEditorDialog = (0, import_react121.useCallback)(() => {
|
|
32991
33042
|
setIsEditorDialogOpen(false);
|
|
32992
33043
|
}, []);
|
|
32993
33044
|
return {
|
|
@@ -33000,13 +33051,13 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
33000
33051
|
|
|
33001
33052
|
// packages/cli/src/ui/hooks/useSettingsCommand.ts
|
|
33002
33053
|
init_esbuild_shims();
|
|
33003
|
-
var
|
|
33054
|
+
var import_react122 = __toESM(require_react(), 1);
|
|
33004
33055
|
function useSettingsCommand() {
|
|
33005
|
-
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0,
|
|
33006
|
-
const openSettingsDialog = (0,
|
|
33056
|
+
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0, import_react122.useState)(false);
|
|
33057
|
+
const openSettingsDialog = (0, import_react122.useCallback)(() => {
|
|
33007
33058
|
setIsSettingsDialogOpen(true);
|
|
33008
33059
|
}, []);
|
|
33009
|
-
const closeSettingsDialog = (0,
|
|
33060
|
+
const closeSettingsDialog = (0, import_react122.useCallback)(() => {
|
|
33010
33061
|
setIsSettingsDialogOpen(false);
|
|
33011
33062
|
}, []);
|
|
33012
33063
|
return {
|
|
@@ -33019,14 +33070,14 @@ __name(useSettingsCommand, "useSettingsCommand");
|
|
|
33019
33070
|
|
|
33020
33071
|
// packages/cli/src/ui/hooks/useModelCommand.ts
|
|
33021
33072
|
init_esbuild_shims();
|
|
33022
|
-
var
|
|
33073
|
+
var import_react123 = __toESM(require_react(), 1);
|
|
33023
33074
|
var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
33024
|
-
const [isModelDialogOpen, setIsModelDialogOpen] = (0,
|
|
33025
|
-
const [isFastModelMode, setIsFastModelMode] = (0,
|
|
33026
|
-
const [isVoiceModelMode, setIsVoiceModelMode] = (0,
|
|
33027
|
-
const [isVisionModelMode, setIsVisionModelMode] = (0,
|
|
33028
|
-
const [modelDialogPersistScope, setModelDialogPersistScope] = (0,
|
|
33029
|
-
const openModelDialog = (0,
|
|
33075
|
+
const [isModelDialogOpen, setIsModelDialogOpen] = (0, import_react123.useState)(false);
|
|
33076
|
+
const [isFastModelMode, setIsFastModelMode] = (0, import_react123.useState)(false);
|
|
33077
|
+
const [isVoiceModelMode, setIsVoiceModelMode] = (0, import_react123.useState)(false);
|
|
33078
|
+
const [isVisionModelMode, setIsVisionModelMode] = (0, import_react123.useState)(false);
|
|
33079
|
+
const [modelDialogPersistScope, setModelDialogPersistScope] = (0, import_react123.useState)(void 0);
|
|
33080
|
+
const openModelDialog = (0, import_react123.useCallback)(
|
|
33030
33081
|
(options) => {
|
|
33031
33082
|
const voiceModelMode = options?.voiceModelMode ?? false;
|
|
33032
33083
|
const visionModelMode = options?.visionModelMode ?? false;
|
|
@@ -33040,7 +33091,7 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
33040
33091
|
},
|
|
33041
33092
|
[]
|
|
33042
33093
|
);
|
|
33043
|
-
const closeModelDialog = (0,
|
|
33094
|
+
const closeModelDialog = (0, import_react123.useCallback)(() => {
|
|
33044
33095
|
setIsModelDialogOpen(false);
|
|
33045
33096
|
setIsFastModelMode(false);
|
|
33046
33097
|
setIsVoiceModelMode(false);
|
|
@@ -33060,13 +33111,13 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
33060
33111
|
|
|
33061
33112
|
// packages/cli/src/ui/hooks/useApprovalModeCommand.ts
|
|
33062
33113
|
init_esbuild_shims();
|
|
33063
|
-
var
|
|
33114
|
+
var import_react124 = __toESM(require_react(), 1);
|
|
33064
33115
|
var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) => {
|
|
33065
|
-
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0,
|
|
33066
|
-
const openApprovalModeDialog = (0,
|
|
33116
|
+
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0, import_react124.useState)(false);
|
|
33117
|
+
const openApprovalModeDialog = (0, import_react124.useCallback)(() => {
|
|
33067
33118
|
setIsApprovalModeDialogOpen(true);
|
|
33068
33119
|
}, []);
|
|
33069
|
-
const handleApprovalModeSelect = (0,
|
|
33120
|
+
const handleApprovalModeSelect = (0, import_react124.useCallback)(
|
|
33070
33121
|
(mode, scope) => {
|
|
33071
33122
|
try {
|
|
33072
33123
|
if (!mode) {
|
|
@@ -33092,13 +33143,13 @@ var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) =>
|
|
|
33092
33143
|
|
|
33093
33144
|
// packages/cli/src/ui/hooks/use-effort-command.ts
|
|
33094
33145
|
init_esbuild_shims();
|
|
33095
|
-
var
|
|
33146
|
+
var import_react125 = __toESM(require_react(), 1);
|
|
33096
33147
|
var useEffortCommand = /* @__PURE__ */ __name((loadedSettings, config, addItem) => {
|
|
33097
|
-
const [isEffortDialogOpen, setIsEffortDialogOpen] = (0,
|
|
33098
|
-
const openEffortDialog = (0,
|
|
33148
|
+
const [isEffortDialogOpen, setIsEffortDialogOpen] = (0, import_react125.useState)(false);
|
|
33149
|
+
const openEffortDialog = (0, import_react125.useCallback)(() => {
|
|
33099
33150
|
setIsEffortDialogOpen(true);
|
|
33100
33151
|
}, []);
|
|
33101
|
-
const handleEffortSelect = (0,
|
|
33152
|
+
const handleEffortSelect = (0, import_react125.useCallback)(
|
|
33102
33153
|
(effort) => {
|
|
33103
33154
|
try {
|
|
33104
33155
|
if (!effort) {
|
|
@@ -33150,7 +33201,7 @@ var useEffortCommand = /* @__PURE__ */ __name((loadedSettings, config, addItem)
|
|
|
33150
33201
|
|
|
33151
33202
|
// packages/cli/src/ui/hooks/useBranchCommand.ts
|
|
33152
33203
|
init_esbuild_shims();
|
|
33153
|
-
var
|
|
33204
|
+
var import_react126 = __toESM(require_react(), 1);
|
|
33154
33205
|
import { randomUUID } from "node:crypto";
|
|
33155
33206
|
function deriveFirstPrompt(messages) {
|
|
33156
33207
|
for (const record of messages) {
|
|
@@ -33170,7 +33221,7 @@ function deriveFirstPrompt(messages) {
|
|
|
33170
33221
|
__name(deriveFirstPrompt, "deriveFirstPrompt");
|
|
33171
33222
|
function useBranchCommand(options) {
|
|
33172
33223
|
const { config, historyManager, startNewSession, setSessionName, remount } = options;
|
|
33173
|
-
const handleBranch = (0,
|
|
33224
|
+
const handleBranch = (0, import_react126.useCallback)(
|
|
33174
33225
|
async (name) => {
|
|
33175
33226
|
if (!config) return;
|
|
33176
33227
|
const oldSessionId = config.getSessionId();
|
|
@@ -33301,19 +33352,19 @@ __name(useBranchCommand, "useBranchCommand");
|
|
|
33301
33352
|
|
|
33302
33353
|
// packages/cli/src/ui/hooks/useResumeCommand.ts
|
|
33303
33354
|
init_esbuild_shims();
|
|
33304
|
-
var
|
|
33355
|
+
var import_react127 = __toESM(require_react(), 1);
|
|
33305
33356
|
var BACKGROUND_WORK_SWITCH_BLOCKED_MESSAGE = "Stop the current session's running background tasks before resuming another session.";
|
|
33306
33357
|
function useResumeCommand(options) {
|
|
33307
|
-
const [isResumeDialogOpen, setIsResumeDialogOpen] = (0,
|
|
33308
|
-
const [resumeMatchedSessions, setResumeMatchedSessions] = (0,
|
|
33309
|
-
const openResumeDialog = (0,
|
|
33358
|
+
const [isResumeDialogOpen, setIsResumeDialogOpen] = (0, import_react127.useState)(false);
|
|
33359
|
+
const [resumeMatchedSessions, setResumeMatchedSessions] = (0, import_react127.useState)();
|
|
33360
|
+
const openResumeDialog = (0, import_react127.useCallback)(
|
|
33310
33361
|
(matchedSessions) => {
|
|
33311
33362
|
setResumeMatchedSessions(matchedSessions);
|
|
33312
33363
|
setIsResumeDialogOpen(true);
|
|
33313
33364
|
},
|
|
33314
33365
|
[]
|
|
33315
33366
|
);
|
|
33316
|
-
const closeResumeDialog = (0,
|
|
33367
|
+
const closeResumeDialog = (0, import_react127.useCallback)(() => {
|
|
33317
33368
|
setIsResumeDialogOpen(false);
|
|
33318
33369
|
setResumeMatchedSessions(void 0);
|
|
33319
33370
|
}, []);
|
|
@@ -33326,7 +33377,7 @@ function useResumeCommand(options) {
|
|
|
33326
33377
|
remount
|
|
33327
33378
|
} = options;
|
|
33328
33379
|
const { addItem, clearItems, loadHistory } = historyManager;
|
|
33329
|
-
const handleResume = (0,
|
|
33380
|
+
const handleResume = (0, import_react127.useCallback)(
|
|
33330
33381
|
async (sessionId) => {
|
|
33331
33382
|
if (!config) {
|
|
33332
33383
|
return;
|
|
@@ -33442,18 +33493,18 @@ __name(useResumeCommand, "useResumeCommand");
|
|
|
33442
33493
|
|
|
33443
33494
|
// packages/cli/src/ui/hooks/useDeleteCommand.ts
|
|
33444
33495
|
init_esbuild_shims();
|
|
33445
|
-
var
|
|
33496
|
+
var import_react128 = __toESM(require_react(), 1);
|
|
33446
33497
|
function useDeleteCommand(options) {
|
|
33447
|
-
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = (0,
|
|
33448
|
-
const openDeleteDialog = (0,
|
|
33498
|
+
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = (0, import_react128.useState)(false);
|
|
33499
|
+
const openDeleteDialog = (0, import_react128.useCallback)(() => {
|
|
33449
33500
|
setIsDeleteDialogOpen(true);
|
|
33450
33501
|
}, []);
|
|
33451
|
-
const closeDeleteDialog = (0,
|
|
33502
|
+
const closeDeleteDialog = (0, import_react128.useCallback)(() => {
|
|
33452
33503
|
setIsDeleteDialogOpen(false);
|
|
33453
33504
|
}, []);
|
|
33454
33505
|
const { config, addItem } = options ?? {};
|
|
33455
|
-
const isDeletingManyRef = (0,
|
|
33456
|
-
const handleDelete = (0,
|
|
33506
|
+
const isDeletingManyRef = (0, import_react128.useRef)(false);
|
|
33507
|
+
const handleDelete = (0, import_react128.useCallback)(
|
|
33457
33508
|
async (sessionId) => {
|
|
33458
33509
|
if (!config) {
|
|
33459
33510
|
return;
|
|
@@ -33512,7 +33563,7 @@ function useDeleteCommand(options) {
|
|
|
33512
33563
|
},
|
|
33513
33564
|
[closeDeleteDialog, config, addItem]
|
|
33514
33565
|
);
|
|
33515
|
-
const handleDeleteMany = (0,
|
|
33566
|
+
const handleDeleteMany = (0, import_react128.useCallback)(
|
|
33516
33567
|
async (sessionIds) => {
|
|
33517
33568
|
if (!config) {
|
|
33518
33569
|
return;
|
|
@@ -33644,7 +33695,7 @@ __name(useDeleteCommand, "useDeleteCommand");
|
|
|
33644
33695
|
|
|
33645
33696
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
33646
33697
|
init_esbuild_shims();
|
|
33647
|
-
var
|
|
33698
|
+
var import_react129 = __toESM(require_react(), 1);
|
|
33648
33699
|
var debugLogger33 = createDebugLogger("SLASH_COMMAND_PROCESSOR");
|
|
33649
33700
|
function hasUserPromptExpansionHooks(config) {
|
|
33650
33701
|
return !!config && !config.getDisableAllHooks?.() && (config.hasHooksForEvent?.("UserPromptExpansion") ?? false);
|
|
@@ -33676,33 +33727,33 @@ function getSkillCommandName(command) {
|
|
|
33676
33727
|
}
|
|
33677
33728
|
__name(getSkillCommandName, "getSkillCommandName");
|
|
33678
33729
|
var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, isProcessing, setIsProcessing, isIdleRef, setGeminiMdFileCount, actions, extensionsUpdateState, isConfigInitialized, logger, updateItem, setSessionName, extensionRefreshState) => {
|
|
33679
|
-
const fallbackExtensionRefreshStateRef = (0,
|
|
33730
|
+
const fallbackExtensionRefreshStateRef = (0, import_react129.useRef)(
|
|
33680
33731
|
null
|
|
33681
33732
|
);
|
|
33682
33733
|
if (!fallbackExtensionRefreshStateRef.current) {
|
|
33683
33734
|
fallbackExtensionRefreshStateRef.current = new ExtensionRefreshState();
|
|
33684
33735
|
}
|
|
33685
33736
|
const activeExtensionRefreshState = extensionRefreshState ?? fallbackExtensionRefreshStateRef.current;
|
|
33686
|
-
const historyRef = (0,
|
|
33687
|
-
(0,
|
|
33737
|
+
const historyRef = (0, import_react129.useRef)(history);
|
|
33738
|
+
(0, import_react129.useLayoutEffect)(() => {
|
|
33688
33739
|
historyRef.current = history;
|
|
33689
33740
|
}, [history]);
|
|
33690
33741
|
const { stats: sessionStats, startNewSession } = useSessionStats();
|
|
33691
|
-
const [commands, setCommands] = (0,
|
|
33692
|
-
const [recentCommands, setRecentCommands] = (0,
|
|
33693
|
-
const [reloadTrigger, setReloadTrigger] = (0,
|
|
33694
|
-
const commandReloadResolversRef = (0,
|
|
33695
|
-
const extensionContentRefreshTimerRef = (0,
|
|
33696
|
-
const extensionContentRefreshRunningRef = (0,
|
|
33697
|
-
const extensionContentRefreshPendingRef = (0,
|
|
33698
|
-
const mountedRef = (0,
|
|
33699
|
-
(0,
|
|
33742
|
+
const [commands, setCommands] = (0, import_react129.useState)([]);
|
|
33743
|
+
const [recentCommands, setRecentCommands] = (0, import_react129.useState)(/* @__PURE__ */ new Map());
|
|
33744
|
+
const [reloadTrigger, setReloadTrigger] = (0, import_react129.useState)(0);
|
|
33745
|
+
const commandReloadResolversRef = (0, import_react129.useRef)([]);
|
|
33746
|
+
const extensionContentRefreshTimerRef = (0, import_react129.useRef)(null);
|
|
33747
|
+
const extensionContentRefreshRunningRef = (0, import_react129.useRef)(false);
|
|
33748
|
+
const extensionContentRefreshPendingRef = (0, import_react129.useRef)(false);
|
|
33749
|
+
const mountedRef = (0, import_react129.useRef)(true);
|
|
33750
|
+
(0, import_react129.useEffect)(() => {
|
|
33700
33751
|
mountedRef.current = true;
|
|
33701
33752
|
return () => {
|
|
33702
33753
|
mountedRef.current = false;
|
|
33703
33754
|
};
|
|
33704
33755
|
}, []);
|
|
33705
|
-
const resolveCommandReloads = (0,
|
|
33756
|
+
const resolveCommandReloads = (0, import_react129.useCallback)((completedTrigger) => {
|
|
33706
33757
|
if (commandReloadResolversRef.current.length === 0) {
|
|
33707
33758
|
return;
|
|
33708
33759
|
}
|
|
@@ -33716,7 +33767,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33716
33767
|
}
|
|
33717
33768
|
commandReloadResolversRef.current = remaining;
|
|
33718
33769
|
}, []);
|
|
33719
|
-
const reloadCommands = (0,
|
|
33770
|
+
const reloadCommands = (0, import_react129.useCallback)(() => {
|
|
33720
33771
|
if (!config) {
|
|
33721
33772
|
return Promise.resolve();
|
|
33722
33773
|
}
|
|
@@ -33731,14 +33782,14 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33731
33782
|
});
|
|
33732
33783
|
});
|
|
33733
33784
|
}, [config]);
|
|
33734
|
-
const clearPendingExtensionContentRefresh = (0,
|
|
33785
|
+
const clearPendingExtensionContentRefresh = (0, import_react129.useCallback)(() => {
|
|
33735
33786
|
if (!extensionContentRefreshTimerRef.current) {
|
|
33736
33787
|
return;
|
|
33737
33788
|
}
|
|
33738
33789
|
clearTimeout(extensionContentRefreshTimerRef.current);
|
|
33739
33790
|
extensionContentRefreshTimerRef.current = null;
|
|
33740
33791
|
}, []);
|
|
33741
|
-
const showExtensionContentRefreshError = (0,
|
|
33792
|
+
const showExtensionContentRefreshError = (0, import_react129.useCallback)(
|
|
33742
33793
|
(error) => {
|
|
33743
33794
|
if (!mountedRef.current) {
|
|
33744
33795
|
return;
|
|
@@ -33758,7 +33809,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33758
33809
|
},
|
|
33759
33810
|
[addItem]
|
|
33760
33811
|
);
|
|
33761
|
-
const runExtensionContentRefresh = (0,
|
|
33812
|
+
const runExtensionContentRefresh = (0, import_react129.useCallback)(async () => {
|
|
33762
33813
|
if (!config) {
|
|
33763
33814
|
return;
|
|
33764
33815
|
}
|
|
@@ -33802,23 +33853,23 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33802
33853
|
reloadCommands,
|
|
33803
33854
|
showExtensionContentRefreshError
|
|
33804
33855
|
]);
|
|
33805
|
-
const [shellConfirmationRequest, setShellConfirmationRequest] = (0,
|
|
33806
|
-
const [confirmationRequest, setConfirmationRequest] = (0,
|
|
33807
|
-
const [sessionShellAllowlist, setSessionShellAllowlist] = (0,
|
|
33856
|
+
const [shellConfirmationRequest, setShellConfirmationRequest] = (0, import_react129.useState)(null);
|
|
33857
|
+
const [confirmationRequest, setConfirmationRequest] = (0, import_react129.useState)(null);
|
|
33858
|
+
const [sessionShellAllowlist, setSessionShellAllowlist] = (0, import_react129.useState)(
|
|
33808
33859
|
/* @__PURE__ */ new Set()
|
|
33809
33860
|
);
|
|
33810
|
-
const [pendingItem, setPendingItem] = (0,
|
|
33861
|
+
const [pendingItem, setPendingItem] = (0, import_react129.useState)(
|
|
33811
33862
|
null
|
|
33812
33863
|
);
|
|
33813
|
-
const [btwItem, setBtwItem] = (0,
|
|
33814
|
-
const btwAbortControllerRef = (0,
|
|
33815
|
-
const cancelBtw = (0,
|
|
33864
|
+
const [btwItem, setBtwItem] = (0, import_react129.useState)(null);
|
|
33865
|
+
const btwAbortControllerRef = (0, import_react129.useRef)(null);
|
|
33866
|
+
const cancelBtw = (0, import_react129.useCallback)(() => {
|
|
33816
33867
|
btwAbortControllerRef.current?.abort();
|
|
33817
33868
|
btwAbortControllerRef.current = null;
|
|
33818
33869
|
setBtwItem(null);
|
|
33819
33870
|
}, []);
|
|
33820
|
-
const abortControllerRef = (0,
|
|
33821
|
-
const cancelSlashCommand = (0,
|
|
33871
|
+
const abortControllerRef = (0, import_react129.useRef)(null);
|
|
33872
|
+
const cancelSlashCommand = (0, import_react129.useCallback)(() => {
|
|
33822
33873
|
cancelBtw();
|
|
33823
33874
|
if (!abortControllerRef.current) {
|
|
33824
33875
|
return;
|
|
@@ -33842,14 +33893,14 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33842
33893
|
},
|
|
33843
33894
|
{ isActive: isProcessing }
|
|
33844
33895
|
);
|
|
33845
|
-
const pendingHistoryItems = (0,
|
|
33896
|
+
const pendingHistoryItems = (0, import_react129.useMemo)(() => {
|
|
33846
33897
|
const items = [];
|
|
33847
33898
|
if (pendingItem != null) {
|
|
33848
33899
|
items.push(pendingItem);
|
|
33849
33900
|
}
|
|
33850
33901
|
return items;
|
|
33851
33902
|
}, [pendingItem]);
|
|
33852
|
-
const addMessage = (0,
|
|
33903
|
+
const addMessage = (0, import_react129.useCallback)(
|
|
33853
33904
|
(message) => {
|
|
33854
33905
|
let historyItemContent;
|
|
33855
33906
|
if (message.type === "about" /* ABOUT */) {
|
|
@@ -33909,7 +33960,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33909
33960
|
},
|
|
33910
33961
|
[addItem]
|
|
33911
33962
|
);
|
|
33912
|
-
const commandContext = (0,
|
|
33963
|
+
const commandContext = (0, import_react129.useMemo)(
|
|
33913
33964
|
() => ({
|
|
33914
33965
|
services: {
|
|
33915
33966
|
config,
|
|
@@ -33981,7 +34032,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33981
34032
|
activeExtensionRefreshState
|
|
33982
34033
|
]
|
|
33983
34034
|
);
|
|
33984
|
-
(0,
|
|
34035
|
+
(0, import_react129.useEffect)(() => {
|
|
33985
34036
|
if (!config) {
|
|
33986
34037
|
return;
|
|
33987
34038
|
}
|
|
@@ -33999,7 +34050,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33999
34050
|
})();
|
|
34000
34051
|
};
|
|
34001
34052
|
}, [config, reloadCommands]);
|
|
34002
|
-
(0,
|
|
34053
|
+
(0, import_react129.useEffect)(() => {
|
|
34003
34054
|
if (!config) {
|
|
34004
34055
|
return;
|
|
34005
34056
|
}
|
|
@@ -34024,7 +34075,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34024
34075
|
}
|
|
34025
34076
|
};
|
|
34026
34077
|
}, [config, reloadCommands]);
|
|
34027
|
-
(0,
|
|
34078
|
+
(0, import_react129.useEffect)(() => {
|
|
34028
34079
|
if (!isConfigInitialized) {
|
|
34029
34080
|
return;
|
|
34030
34081
|
}
|
|
@@ -34039,7 +34090,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34039
34090
|
reloadCommands();
|
|
34040
34091
|
});
|
|
34041
34092
|
}, [config, isConfigInitialized, reloadCommands]);
|
|
34042
|
-
(0,
|
|
34093
|
+
(0, import_react129.useEffect)(() => {
|
|
34043
34094
|
const listener = /* @__PURE__ */ __name((reason) => {
|
|
34044
34095
|
clearPendingExtensionContentRefresh();
|
|
34045
34096
|
addItem(
|
|
@@ -34066,7 +34117,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34066
34117
|
addItem,
|
|
34067
34118
|
clearPendingExtensionContentRefresh
|
|
34068
34119
|
]);
|
|
34069
|
-
(0,
|
|
34120
|
+
(0, import_react129.useEffect)(() => {
|
|
34070
34121
|
activeExtensionRefreshState.on(
|
|
34071
34122
|
"extensions-reload-started" /* ExtensionsReloadStarted */,
|
|
34072
34123
|
clearPendingExtensionContentRefresh
|
|
@@ -34086,7 +34137,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34086
34137
|
);
|
|
34087
34138
|
};
|
|
34088
34139
|
}, [activeExtensionRefreshState, clearPendingExtensionContentRefresh]);
|
|
34089
|
-
(0,
|
|
34140
|
+
(0, import_react129.useEffect)(() => {
|
|
34090
34141
|
if (!config) {
|
|
34091
34142
|
return;
|
|
34092
34143
|
}
|
|
@@ -34112,7 +34163,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34112
34163
|
activeExtensionRefreshState,
|
|
34113
34164
|
runExtensionContentRefresh
|
|
34114
34165
|
]);
|
|
34115
|
-
(0,
|
|
34166
|
+
(0, import_react129.useEffect)(() => {
|
|
34116
34167
|
const controller = new AbortController();
|
|
34117
34168
|
const load = /* @__PURE__ */ __name(async () => {
|
|
34118
34169
|
try {
|
|
@@ -34209,7 +34260,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34209
34260
|
settings,
|
|
34210
34261
|
resolveCommandReloads
|
|
34211
34262
|
]);
|
|
34212
|
-
const handleSlashCommand = (0,
|
|
34263
|
+
const handleSlashCommand = (0, import_react129.useCallback)(
|
|
34213
34264
|
async (rawQuery, oneTimeShellAllowlist, overwriteConfirmed, existingInvocationItemId) => {
|
|
34214
34265
|
if (typeof rawQuery !== "string") {
|
|
34215
34266
|
return false;
|
|
@@ -34765,11 +34816,11 @@ ${commandToExecute.subCommands.map((sc) => ` - ${sc.name}: ${sc.description ||
|
|
|
34765
34816
|
|
|
34766
34817
|
// packages/cli/src/ui/hooks/useDoublePress.ts
|
|
34767
34818
|
init_esbuild_shims();
|
|
34768
|
-
var
|
|
34819
|
+
var import_react130 = __toESM(require_react(), 1);
|
|
34769
34820
|
var DOUBLE_PRESS_TIMEOUT_MS = 800;
|
|
34770
34821
|
function useDoublePress(onDoublePress, onPending) {
|
|
34771
|
-
const timeoutRef = (0,
|
|
34772
|
-
(0,
|
|
34822
|
+
const timeoutRef = (0, import_react130.useRef)(null);
|
|
34823
|
+
(0, import_react130.useEffect)(
|
|
34773
34824
|
() => () => {
|
|
34774
34825
|
if (timeoutRef.current !== null) {
|
|
34775
34826
|
clearTimeout(timeoutRef.current);
|
|
@@ -34778,7 +34829,7 @@ function useDoublePress(onDoublePress, onPending) {
|
|
|
34778
34829
|
},
|
|
34779
34830
|
[]
|
|
34780
34831
|
);
|
|
34781
|
-
return (0,
|
|
34832
|
+
return (0, import_react130.useCallback)(() => {
|
|
34782
34833
|
if (timeoutRef.current !== null) {
|
|
34783
34834
|
clearTimeout(timeoutRef.current);
|
|
34784
34835
|
timeoutRef.current = null;
|
|
@@ -34842,10 +34893,10 @@ __name(formatSessionWindowTitle, "formatSessionWindowTitle");
|
|
|
34842
34893
|
|
|
34843
34894
|
// packages/cli/src/ui/hooks/useLogger.ts
|
|
34844
34895
|
init_esbuild_shims();
|
|
34845
|
-
var
|
|
34896
|
+
var import_react131 = __toESM(require_react(), 1);
|
|
34846
34897
|
var useLogger = /* @__PURE__ */ __name((storage, sessionId) => {
|
|
34847
|
-
const [logger, setLogger] = (0,
|
|
34848
|
-
(0,
|
|
34898
|
+
const [logger, setLogger] = (0, import_react131.useState)(null);
|
|
34899
|
+
(0, import_react131.useEffect)(() => {
|
|
34849
34900
|
if (!sessionId) {
|
|
34850
34901
|
return;
|
|
34851
34902
|
}
|
|
@@ -34866,11 +34917,11 @@ var useLogger = /* @__PURE__ */ __name((storage, sessionId) => {
|
|
|
34866
34917
|
|
|
34867
34918
|
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
34868
34919
|
init_esbuild_shims();
|
|
34869
|
-
var
|
|
34920
|
+
var import_react136 = __toESM(require_react(), 1);
|
|
34870
34921
|
|
|
34871
34922
|
// packages/cli/src/ui/hooks/shellCommandProcessor.ts
|
|
34872
34923
|
init_esbuild_shims();
|
|
34873
|
-
var
|
|
34924
|
+
var import_react132 = __toESM(require_react(), 1);
|
|
34874
34925
|
import crypto2 from "node:crypto";
|
|
34875
34926
|
import path10 from "node:path";
|
|
34876
34927
|
import os5 from "node:os";
|
|
@@ -34903,8 +34954,8 @@ ${modelContent}
|
|
|
34903
34954
|
}
|
|
34904
34955
|
__name(addShellCommandToGeminiHistory, "addShellCommandToGeminiHistory");
|
|
34905
34956
|
var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPendingHistoryItem, onExec, onDebugMessage, config, geminiClient, setShellInputFocused, terminalWidth, terminalHeight) => {
|
|
34906
|
-
const [activeShellPtyId, setActiveShellPtyId] = (0,
|
|
34907
|
-
const handleShellCommand = (0,
|
|
34957
|
+
const [activeShellPtyId, setActiveShellPtyId] = (0, import_react132.useState)(null);
|
|
34958
|
+
const handleShellCommand = (0, import_react132.useCallback)(
|
|
34908
34959
|
(rawQuery, abortSignal) => {
|
|
34909
34960
|
if (typeof rawQuery !== "string" || rawQuery.trim() === "") {
|
|
34910
34961
|
return false;
|
|
@@ -35158,11 +35209,11 @@ ${finalOutput}`;
|
|
|
35158
35209
|
|
|
35159
35210
|
// packages/cli/src/ui/hooks/useStateAndRef.ts
|
|
35160
35211
|
init_esbuild_shims();
|
|
35161
|
-
var
|
|
35212
|
+
var import_react133 = __toESM(require_react(), 1);
|
|
35162
35213
|
var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
35163
|
-
const [state, setState] =
|
|
35164
|
-
const ref =
|
|
35165
|
-
const setStateInternal =
|
|
35214
|
+
const [state, setState] = import_react133.default.useState(initialValue);
|
|
35215
|
+
const ref = import_react133.default.useRef(initialValue);
|
|
35216
|
+
const setStateInternal = import_react133.default.useCallback(
|
|
35166
35217
|
(newStateOrCallback) => {
|
|
35167
35218
|
let newValue;
|
|
35168
35219
|
if (typeof newStateOrCallback === "function") {
|
|
@@ -35180,12 +35231,12 @@ var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
|
35180
35231
|
|
|
35181
35232
|
// packages/cli/src/ui/hooks/useReactToolScheduler.ts
|
|
35182
35233
|
init_esbuild_shims();
|
|
35183
|
-
var
|
|
35234
|
+
var import_react134 = __toESM(require_react(), 1);
|
|
35184
35235
|
import * as path11 from "node:path";
|
|
35185
35236
|
var debugLogger35 = createDebugLogger("REACT_TOOL_SCHEDULER");
|
|
35186
|
-
function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorClose) {
|
|
35187
|
-
const [toolCallsForDisplay, setToolCallsForDisplay] = (0,
|
|
35188
|
-
const outputUpdateHandler = (0,
|
|
35237
|
+
function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorClose, onToolResultFullTurnModel) {
|
|
35238
|
+
const [toolCallsForDisplay, setToolCallsForDisplay] = (0, import_react134.useState)([]);
|
|
35239
|
+
const outputUpdateHandler = (0, import_react134.useCallback)(
|
|
35189
35240
|
(toolCallId, outputChunk) => {
|
|
35190
35241
|
if (isShellProgressData(outputChunk)) {
|
|
35191
35242
|
return;
|
|
@@ -35203,13 +35254,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35203
35254
|
},
|
|
35204
35255
|
[]
|
|
35205
35256
|
);
|
|
35206
|
-
const allToolCallsCompleteHandler = (0,
|
|
35257
|
+
const allToolCallsCompleteHandler = (0, import_react134.useCallback)(
|
|
35207
35258
|
async (completedToolCalls) => {
|
|
35208
35259
|
await onComplete(completedToolCalls);
|
|
35209
35260
|
},
|
|
35210
35261
|
[onComplete]
|
|
35211
35262
|
);
|
|
35212
|
-
const toolCallsUpdateHandler = (0,
|
|
35263
|
+
const toolCallsUpdateHandler = (0, import_react134.useCallback)(
|
|
35213
35264
|
(updatedCoreToolCalls) => {
|
|
35214
35265
|
setToolCallsForDisplay(
|
|
35215
35266
|
(prevTrackedCalls) => updatedCoreToolCalls.map((coreTc) => {
|
|
@@ -35236,15 +35287,15 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35236
35287
|
},
|
|
35237
35288
|
[setToolCallsForDisplay]
|
|
35238
35289
|
);
|
|
35239
|
-
const scheduler = (0,
|
|
35290
|
+
const scheduler = (0, import_react134.useMemo)(
|
|
35240
35291
|
() => new CoreToolScheduler({
|
|
35241
35292
|
config,
|
|
35242
|
-
chatRecordingService: config.getChatRecordingService(),
|
|
35243
35293
|
outputUpdateHandler,
|
|
35244
35294
|
onAllToolCallsComplete: allToolCallsCompleteHandler,
|
|
35245
35295
|
onToolCallsUpdate: toolCallsUpdateHandler,
|
|
35246
35296
|
getPreferredEditor,
|
|
35247
|
-
onEditorClose
|
|
35297
|
+
onEditorClose,
|
|
35298
|
+
onToolResultFullTurnModel
|
|
35248
35299
|
}),
|
|
35249
35300
|
[
|
|
35250
35301
|
config,
|
|
@@ -35252,10 +35303,11 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35252
35303
|
allToolCallsCompleteHandler,
|
|
35253
35304
|
toolCallsUpdateHandler,
|
|
35254
35305
|
getPreferredEditor,
|
|
35255
|
-
onEditorClose
|
|
35306
|
+
onEditorClose,
|
|
35307
|
+
onToolResultFullTurnModel
|
|
35256
35308
|
]
|
|
35257
35309
|
);
|
|
35258
|
-
const schedule = (0,
|
|
35310
|
+
const schedule = (0, import_react134.useCallback)(
|
|
35259
35311
|
(request, signal, modelOverride) => {
|
|
35260
35312
|
if (!modelOverride?.endsWith("\0")) {
|
|
35261
35313
|
void scheduler.schedule(request, signal);
|
|
@@ -35282,13 +35334,6 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35282
35334
|
message,
|
|
35283
35335
|
message
|
|
35284
35336
|
);
|
|
35285
|
-
config.getChatRecordingService()?.recordToolResult(responseParts, {
|
|
35286
|
-
callId: toolRequest.callId,
|
|
35287
|
-
status: "error",
|
|
35288
|
-
resultDisplay: message,
|
|
35289
|
-
error: toolError,
|
|
35290
|
-
errorType: "unhandled_exception" /* UNHANDLED_EXCEPTION */
|
|
35291
|
-
});
|
|
35292
35337
|
return {
|
|
35293
35338
|
status: "error",
|
|
35294
35339
|
request: toolRequest,
|
|
@@ -35311,7 +35356,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35311
35356
|
},
|
|
35312
35357
|
[allToolCallsCompleteHandler, config, scheduler]
|
|
35313
35358
|
);
|
|
35314
|
-
const markToolsAsSubmitted = (0,
|
|
35359
|
+
const markToolsAsSubmitted = (0, import_react134.useCallback)(
|
|
35315
35360
|
(callIdsToMark) => {
|
|
35316
35361
|
setToolCallsForDisplay(
|
|
35317
35362
|
(prevCalls) => prevCalls.map(
|
|
@@ -35477,6 +35522,78 @@ __name(mapToDisplay, "mapToDisplay");
|
|
|
35477
35522
|
import { promises as fs17 } from "node:fs";
|
|
35478
35523
|
import path12 from "node:path";
|
|
35479
35524
|
import process14 from "node:process";
|
|
35525
|
+
|
|
35526
|
+
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
35527
|
+
init_esbuild_shims();
|
|
35528
|
+
var import_react135 = __toESM(require_react(), 1);
|
|
35529
|
+
var GOAL_COMMAND_RE = /^\/goal(?:\s|$)/;
|
|
35530
|
+
function useMessageQueue() {
|
|
35531
|
+
const [queuedMessages, setQueuedMessages] = (0, import_react135.useState)([]);
|
|
35532
|
+
const queueRef = (0, import_react135.useRef)([]);
|
|
35533
|
+
const addMessage = (0, import_react135.useCallback)((message, deferUntilIdle = false) => {
|
|
35534
|
+
const trimmedMessage = message.trim();
|
|
35535
|
+
if (trimmedMessage.length > 0) {
|
|
35536
|
+
queueRef.current = [
|
|
35537
|
+
...queueRef.current,
|
|
35538
|
+
{ text: trimmedMessage, deferUntilIdle }
|
|
35539
|
+
];
|
|
35540
|
+
setQueuedMessages(queueRef.current);
|
|
35541
|
+
}
|
|
35542
|
+
}, []);
|
|
35543
|
+
const clearQueue = (0, import_react135.useCallback)(() => {
|
|
35544
|
+
queueRef.current = [];
|
|
35545
|
+
setQueuedMessages([]);
|
|
35546
|
+
}, []);
|
|
35547
|
+
const getQueuedMessagesText = (0, import_react135.useCallback)(() => {
|
|
35548
|
+
if (queuedMessages.length === 0) return "";
|
|
35549
|
+
return queuedMessages.map(({ text }) => text).join("\n\n");
|
|
35550
|
+
}, [queuedMessages]);
|
|
35551
|
+
const popAllMessages = (0, import_react135.useCallback)(() => {
|
|
35552
|
+
const current = queueRef.current;
|
|
35553
|
+
if (current.length === 0) return null;
|
|
35554
|
+
queueRef.current = [];
|
|
35555
|
+
setQueuedMessages([]);
|
|
35556
|
+
return current.map(({ text }) => text).join("\n\n");
|
|
35557
|
+
}, []);
|
|
35558
|
+
const restoreMessages = (0, import_react135.useCallback)((messages) => {
|
|
35559
|
+
const restored = messages.map((text) => text.trim()).filter(Boolean).map((text) => ({ text, deferUntilIdle: false }));
|
|
35560
|
+
if (restored.length === 0) return;
|
|
35561
|
+
queueRef.current = [...restored, ...queueRef.current];
|
|
35562
|
+
setQueuedMessages(queueRef.current);
|
|
35563
|
+
}, []);
|
|
35564
|
+
const drainQueue = (0, import_react135.useCallback)((includeDeferred = false) => {
|
|
35565
|
+
const current = queueRef.current;
|
|
35566
|
+
if (current.length === 0) return [];
|
|
35567
|
+
const shouldDrain = /* @__PURE__ */ __name((message) => (!isSlashCommand(message.text) || !includeDeferred && GOAL_COMMAND_RE.test(message.text)) && (includeDeferred || !message.deferUntilIdle), "shouldDrain");
|
|
35568
|
+
const drained = current.filter(shouldDrain);
|
|
35569
|
+
if (drained.length === 0) return [];
|
|
35570
|
+
const rest = current.filter((message) => !shouldDrain(message));
|
|
35571
|
+
queueRef.current = rest;
|
|
35572
|
+
setQueuedMessages(rest);
|
|
35573
|
+
return drained.map(({ text }) => text);
|
|
35574
|
+
}, []);
|
|
35575
|
+
const popNextSegment = (0, import_react135.useCallback)(() => {
|
|
35576
|
+
const current = queueRef.current;
|
|
35577
|
+
if (current.length === 0) return null;
|
|
35578
|
+
const [head, ...rest] = current;
|
|
35579
|
+
queueRef.current = rest;
|
|
35580
|
+
setQueuedMessages(rest);
|
|
35581
|
+
return head.text;
|
|
35582
|
+
}, []);
|
|
35583
|
+
return {
|
|
35584
|
+
messageQueue: queuedMessages.map(({ text }) => text),
|
|
35585
|
+
addMessage,
|
|
35586
|
+
clearQueue,
|
|
35587
|
+
getQueuedMessagesText,
|
|
35588
|
+
popAllMessages,
|
|
35589
|
+
restoreMessages,
|
|
35590
|
+
drainQueue,
|
|
35591
|
+
popNextSegment
|
|
35592
|
+
};
|
|
35593
|
+
}
|
|
35594
|
+
__name(useMessageQueue, "useMessageQueue");
|
|
35595
|
+
|
|
35596
|
+
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
35480
35597
|
var debugLogger36 = createDebugLogger("GEMINI_STREAM");
|
|
35481
35598
|
function applyModelOverride(modelOverrideRef, inlineActiveRef, value, isInline) {
|
|
35482
35599
|
modelOverrideRef.current = value;
|
|
@@ -35619,16 +35736,16 @@ function charIndexAfterLine(text, keptLines) {
|
|
|
35619
35736
|
}
|
|
35620
35737
|
__name(charIndexAfterLine, "charIndexAfterLine");
|
|
35621
35738
|
var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, config, isConfigInitialized, settings, onDebugMessage, handleSlashCommand, shellModeActive, getPreferredEditor, onAuthError, performMemoryRefresh, modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError, onEditorClose, onCancelSubmit, setShellInputFocused, terminalWidth, terminalHeight, midTurnDrainRef, logger, availableTerminalHeightRef, terminalWidthRef, midTurnRestoreRef) => {
|
|
35622
|
-
const [initError, setInitError] = (0,
|
|
35623
|
-
const abortControllerRef = (0,
|
|
35624
|
-
const flushBufferedStreamEventsRef = (0,
|
|
35625
|
-
const turnCancelledRef = (0,
|
|
35626
|
-
const isSubmittingQueryRef = (0,
|
|
35627
|
-
const lastPromptRef = (0,
|
|
35628
|
-
const lastTurnUserItemRef = (0,
|
|
35629
|
-
const turnSawContentEventRef = (0,
|
|
35630
|
-
const lastPromptErroredRef = (0,
|
|
35631
|
-
const commitItem = (0,
|
|
35739
|
+
const [initError, setInitError] = (0, import_react136.useState)(null);
|
|
35740
|
+
const abortControllerRef = (0, import_react136.useRef)(null);
|
|
35741
|
+
const flushBufferedStreamEventsRef = (0, import_react136.useRef)(/* @__PURE__ */ new Set());
|
|
35742
|
+
const turnCancelledRef = (0, import_react136.useRef)(false);
|
|
35743
|
+
const isSubmittingQueryRef = (0, import_react136.useRef)(false);
|
|
35744
|
+
const lastPromptRef = (0, import_react136.useRef)(null);
|
|
35745
|
+
const lastTurnUserItemRef = (0, import_react136.useRef)(null);
|
|
35746
|
+
const turnSawContentEventRef = (0, import_react136.useRef)(false);
|
|
35747
|
+
const lastPromptErroredRef = (0, import_react136.useRef)(false);
|
|
35748
|
+
const commitItem = (0, import_react136.useCallback)(
|
|
35632
35749
|
(item, userMessageTimestamp) => {
|
|
35633
35750
|
if (item.type === "gemini" && !item.timestamp) {
|
|
35634
35751
|
item.timestamp = Date.now();
|
|
@@ -35638,17 +35755,17 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35638
35755
|
[addItem]
|
|
35639
35756
|
);
|
|
35640
35757
|
const dualOutput = useDualOutput();
|
|
35641
|
-
const [isResponding, setIsResponding] = (0,
|
|
35642
|
-
const activeModelStreamsRef = (0,
|
|
35643
|
-
const [thought, setThought] = (0,
|
|
35644
|
-
const historyRef = (0,
|
|
35645
|
-
(0,
|
|
35758
|
+
const [isResponding, setIsResponding] = (0, import_react136.useState)(false);
|
|
35759
|
+
const activeModelStreamsRef = (0, import_react136.useRef)(0);
|
|
35760
|
+
const [thought, setThought] = (0, import_react136.useState)(null);
|
|
35761
|
+
const historyRef = (0, import_react136.useRef)(history);
|
|
35762
|
+
(0, import_react136.useLayoutEffect)(() => {
|
|
35646
35763
|
historyRef.current = history;
|
|
35647
35764
|
}, [history]);
|
|
35648
|
-
const auxiliaryAbortRefsRef = (0,
|
|
35765
|
+
const auxiliaryAbortRefsRef = (0, import_react136.useRef)(/* @__PURE__ */ new Set());
|
|
35649
35766
|
const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
|
|
35650
35767
|
const [pendingThoughtItem, pendingThoughtItemRef, setPendingThoughtItem] = useStateAndRef(null);
|
|
35651
|
-
const thoughtStartTimeRef = (0,
|
|
35768
|
+
const thoughtStartTimeRef = (0, import_react136.useRef)(null);
|
|
35652
35769
|
const [
|
|
35653
35770
|
pendingRetryErrorItem,
|
|
35654
35771
|
pendingRetryErrorItemRef,
|
|
@@ -35659,21 +35776,25 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35659
35776
|
pendingRetryCountdownItemRef,
|
|
35660
35777
|
setPendingRetryCountdownItem
|
|
35661
35778
|
] = useStateAndRef(null);
|
|
35662
|
-
const retryCountdownTimerRef = (0,
|
|
35779
|
+
const retryCountdownTimerRef = (0, import_react136.useRef)(
|
|
35663
35780
|
null
|
|
35664
35781
|
);
|
|
35665
|
-
const processedMemoryToolsRef = (0,
|
|
35666
|
-
const submitPromptOnCompleteRef = (0,
|
|
35667
|
-
const modelOverrideRef = (0,
|
|
35668
|
-
const inlineModelOverrideActiveRef = (0,
|
|
35669
|
-
const
|
|
35670
|
-
|
|
35782
|
+
const processedMemoryToolsRef = (0, import_react136.useRef)(/* @__PURE__ */ new Set());
|
|
35783
|
+
const submitPromptOnCompleteRef = (0, import_react136.useRef)(null);
|
|
35784
|
+
const modelOverrideRef = (0, import_react136.useRef)(void 0);
|
|
35785
|
+
const inlineModelOverrideActiveRef = (0, import_react136.useRef)(false);
|
|
35786
|
+
const canUseToolResultFullTurnModel = (0, import_react136.useCallback)((model) => {
|
|
35787
|
+
const current = modelOverrideRef.current;
|
|
35788
|
+
return !inlineModelOverrideActiveRef.current && (!current?.endsWith("\0") || current === model);
|
|
35789
|
+
}, []);
|
|
35790
|
+
const handledProviderToolCallIdsRef = (0, import_react136.useRef)(/* @__PURE__ */ new Set());
|
|
35791
|
+
const duplicateProviderToolCallResponseIdsRef = (0, import_react136.useRef)(
|
|
35671
35792
|
/* @__PURE__ */ new Set()
|
|
35672
35793
|
);
|
|
35673
|
-
const pendingDuplicateToolResponsesRef = (0,
|
|
35674
|
-
const immediateDuplicateToolResponsesRef = (0,
|
|
35675
|
-
const streamingResponseLengthRef = (0,
|
|
35676
|
-
const [isReceivingContent, setIsReceivingContent] = (0,
|
|
35794
|
+
const pendingDuplicateToolResponsesRef = (0, import_react136.useRef)([]);
|
|
35795
|
+
const immediateDuplicateToolResponsesRef = (0, import_react136.useRef)(null);
|
|
35796
|
+
const streamingResponseLengthRef = (0, import_react136.useRef)(0);
|
|
35797
|
+
const [isReceivingContent, setIsReceivingContent] = (0, import_react136.useState)(false);
|
|
35677
35798
|
const {
|
|
35678
35799
|
startNewPrompt,
|
|
35679
35800
|
getPromptCount,
|
|
@@ -35696,13 +35817,14 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35696
35817
|
},
|
|
35697
35818
|
config,
|
|
35698
35819
|
getPreferredEditor,
|
|
35699
|
-
onEditorClose
|
|
35820
|
+
onEditorClose,
|
|
35821
|
+
canUseToolResultFullTurnModel
|
|
35700
35822
|
);
|
|
35701
|
-
const pendingToolCallGroupDisplay = (0,
|
|
35823
|
+
const pendingToolCallGroupDisplay = (0, import_react136.useMemo)(
|
|
35702
35824
|
() => toolCalls.length ? mapToDisplay(toolCalls, config.getProjectRoot()) : void 0,
|
|
35703
35825
|
[toolCalls, config]
|
|
35704
35826
|
);
|
|
35705
|
-
const activeToolPtyId = (0,
|
|
35827
|
+
const activeToolPtyId = (0, import_react136.useMemo)(() => {
|
|
35706
35828
|
const executingShellTool = toolCalls?.find(
|
|
35707
35829
|
(tc) => tc.status === "executing" && tc.request.name === "run_shell_command"
|
|
35708
35830
|
);
|
|
@@ -35711,18 +35833,18 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35711
35833
|
}
|
|
35712
35834
|
return void 0;
|
|
35713
35835
|
}, [toolCalls]);
|
|
35714
|
-
const loopDetectedRef = (0,
|
|
35836
|
+
const loopDetectedRef = (0, import_react136.useRef)(false);
|
|
35715
35837
|
const [
|
|
35716
35838
|
loopDetectionConfirmationRequest,
|
|
35717
35839
|
setLoopDetectionConfirmationRequest
|
|
35718
|
-
] = (0,
|
|
35719
|
-
const stopRetryCountdownTimer = (0,
|
|
35840
|
+
] = (0, import_react136.useState)(null);
|
|
35841
|
+
const stopRetryCountdownTimer = (0, import_react136.useCallback)(() => {
|
|
35720
35842
|
if (retryCountdownTimerRef.current) {
|
|
35721
35843
|
clearInterval(retryCountdownTimerRef.current);
|
|
35722
35844
|
retryCountdownTimerRef.current = null;
|
|
35723
35845
|
}
|
|
35724
35846
|
}, []);
|
|
35725
|
-
const clearRetryCountdown = (0,
|
|
35847
|
+
const clearRetryCountdown = (0, import_react136.useCallback)(() => {
|
|
35726
35848
|
stopRetryCountdownTimer();
|
|
35727
35849
|
skipRetryDelayRef.current = null;
|
|
35728
35850
|
setPendingRetryErrorItem(null);
|
|
@@ -35732,8 +35854,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35732
35854
|
setPendingRetryCountdownItem,
|
|
35733
35855
|
stopRetryCountdownTimer
|
|
35734
35856
|
]);
|
|
35735
|
-
const skipRetryDelayRef = (0,
|
|
35736
|
-
const startRetryCountdown = (0,
|
|
35857
|
+
const skipRetryDelayRef = (0, import_react136.useRef)(null);
|
|
35858
|
+
const startRetryCountdown = (0, import_react136.useCallback)(
|
|
35737
35859
|
(retryInfo) => {
|
|
35738
35860
|
stopRetryCountdownTimer();
|
|
35739
35861
|
skipRetryDelayRef.current = retryInfo.skipDelay;
|
|
@@ -35774,8 +35896,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35774
35896
|
stopRetryCountdownTimer
|
|
35775
35897
|
]
|
|
35776
35898
|
);
|
|
35777
|
-
(0,
|
|
35778
|
-
const onExec = (0,
|
|
35899
|
+
(0, import_react136.useEffect)(() => () => stopRetryCountdownTimer(), [stopRetryCountdownTimer]);
|
|
35900
|
+
const onExec = (0, import_react136.useCallback)(async (done) => {
|
|
35779
35901
|
setIsResponding(true);
|
|
35780
35902
|
await done;
|
|
35781
35903
|
setIsResponding(false);
|
|
@@ -35792,12 +35914,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35792
35914
|
terminalHeight
|
|
35793
35915
|
);
|
|
35794
35916
|
const activePtyId = activeShellPtyId || activeToolPtyId;
|
|
35795
|
-
(0,
|
|
35917
|
+
(0, import_react136.useEffect)(() => {
|
|
35796
35918
|
if (!activePtyId) {
|
|
35797
35919
|
setShellInputFocused(false);
|
|
35798
35920
|
}
|
|
35799
35921
|
}, [activePtyId, setShellInputFocused]);
|
|
35800
|
-
const streamingState = (0,
|
|
35922
|
+
const streamingState = (0, import_react136.useMemo)(() => {
|
|
35801
35923
|
if (toolCalls.some((tc) => tc.status === "awaiting_approval")) {
|
|
35802
35924
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
35803
35925
|
}
|
|
@@ -35815,7 +35937,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35815
35937
|
}
|
|
35816
35938
|
return "idle" /* Idle */;
|
|
35817
35939
|
}, [isResponding, toolCalls]);
|
|
35818
|
-
(0,
|
|
35940
|
+
(0, import_react136.useEffect)(() => {
|
|
35819
35941
|
if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
|
|
35820
35942
|
const lastUserMessageIndex = history.findLastIndex(
|
|
35821
35943
|
(item) => item.type === "user" /* USER */
|
|
@@ -35829,7 +35951,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35829
35951
|
}
|
|
35830
35952
|
}
|
|
35831
35953
|
}, [streamingState, config, history]);
|
|
35832
|
-
const cancelOngoingRequest = (0,
|
|
35954
|
+
const cancelOngoingRequest = (0, import_react136.useCallback)(() => {
|
|
35833
35955
|
if (streamingState !== "responding" /* Responding */) {
|
|
35834
35956
|
return;
|
|
35835
35957
|
}
|
|
@@ -35900,7 +36022,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35900
36022
|
config,
|
|
35901
36023
|
getPromptCount
|
|
35902
36024
|
]);
|
|
35903
|
-
const applyVisionBridgeIfNeeded = (0,
|
|
36025
|
+
const applyVisionBridgeIfNeeded = (0, import_react136.useCallback)(
|
|
35904
36026
|
async (parts, timestamp, signal) => {
|
|
35905
36027
|
if (parts === null || !hasImageParts(parts)) {
|
|
35906
36028
|
return { parts, shouldProceed: true };
|
|
@@ -35965,7 +36087,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35965
36087
|
},
|
|
35966
36088
|
[addItem, config]
|
|
35967
36089
|
);
|
|
35968
|
-
const prepareQueryForGemini = (0,
|
|
36090
|
+
const prepareQueryForGemini = (0, import_react136.useCallback)(
|
|
35969
36091
|
async (query, userMessageTimestamp, abortSignal, prompt_id, submitType) => {
|
|
35970
36092
|
if (turnCancelledRef.current) {
|
|
35971
36093
|
return { queryToSend: null, shouldProceed: false };
|
|
@@ -36116,7 +36238,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36116
36238
|
applyVisionBridgeIfNeeded
|
|
36117
36239
|
]
|
|
36118
36240
|
);
|
|
36119
|
-
const handleContentEvent = (0,
|
|
36241
|
+
const handleContentEvent = (0, import_react136.useCallback)(
|
|
36120
36242
|
(eventValue, currentGeminiMessageBuffer, userMessageTimestamp) => {
|
|
36121
36243
|
if (turnCancelledRef.current) {
|
|
36122
36244
|
return "";
|
|
@@ -36241,7 +36363,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36241
36363
|
terminalWidthRef
|
|
36242
36364
|
]
|
|
36243
36365
|
);
|
|
36244
|
-
const mergeThought = (0,
|
|
36366
|
+
const mergeThought = (0, import_react136.useCallback)(
|
|
36245
36367
|
(incoming) => {
|
|
36246
36368
|
setThought((prev) => {
|
|
36247
36369
|
const incomingDescription = incoming.description ? clampLoadingThoughtDescription(incoming.description) : incoming.description;
|
|
@@ -36270,7 +36392,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36270
36392
|
},
|
|
36271
36393
|
[setThought]
|
|
36272
36394
|
);
|
|
36273
|
-
const handleThoughtEvent = (0,
|
|
36395
|
+
const handleThoughtEvent = (0, import_react136.useCallback)(
|
|
36274
36396
|
(eventValue, currentThoughtBuffer, userMessageTimestamp) => {
|
|
36275
36397
|
if (turnCancelledRef.current) {
|
|
36276
36398
|
return "";
|
|
@@ -36332,7 +36454,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36332
36454
|
},
|
|
36333
36455
|
[addItem, mergeThought, pendingThoughtItemRef, setPendingThoughtItem]
|
|
36334
36456
|
);
|
|
36335
|
-
const commitPendingThought = (0,
|
|
36457
|
+
const commitPendingThought = (0, import_react136.useCallback)(
|
|
36336
36458
|
(userMessageTimestamp) => {
|
|
36337
36459
|
if (pendingThoughtItemRef.current) {
|
|
36338
36460
|
const item = { ...pendingThoughtItemRef.current };
|
|
@@ -36346,7 +36468,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36346
36468
|
},
|
|
36347
36469
|
[addItem, pendingThoughtItemRef, setPendingThoughtItem]
|
|
36348
36470
|
);
|
|
36349
|
-
const handleUserCancelledEvent = (0,
|
|
36471
|
+
const handleUserCancelledEvent = (0, import_react136.useCallback)(
|
|
36350
36472
|
(userMessageTimestamp) => {
|
|
36351
36473
|
if (turnCancelledRef.current) {
|
|
36352
36474
|
return;
|
|
@@ -36386,7 +36508,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36386
36508
|
clearRetryCountdown
|
|
36387
36509
|
]
|
|
36388
36510
|
);
|
|
36389
|
-
const handleErrorEvent = (0,
|
|
36511
|
+
const handleErrorEvent = (0, import_react136.useCallback)(
|
|
36390
36512
|
(eventValue, userMessageTimestamp) => {
|
|
36391
36513
|
lastPromptErroredRef.current = true;
|
|
36392
36514
|
commitPendingThought(userMessageTimestamp);
|
|
@@ -36429,7 +36551,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36429
36551
|
clearRetryCountdown
|
|
36430
36552
|
]
|
|
36431
36553
|
);
|
|
36432
|
-
const handleCitationEvent = (0,
|
|
36554
|
+
const handleCitationEvent = (0, import_react136.useCallback)(
|
|
36433
36555
|
(text, userMessageTimestamp) => {
|
|
36434
36556
|
if (!showCitations(settings)) {
|
|
36435
36557
|
return;
|
|
@@ -36448,7 +36570,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36448
36570
|
settings
|
|
36449
36571
|
]
|
|
36450
36572
|
);
|
|
36451
|
-
const handleFinishedEvent = (0,
|
|
36573
|
+
const handleFinishedEvent = (0, import_react136.useCallback)(
|
|
36452
36574
|
(event, userMessageTimestamp) => {
|
|
36453
36575
|
const finishReason = event.value.reason;
|
|
36454
36576
|
if (!finishReason) {
|
|
@@ -36489,8 +36611,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36489
36611
|
},
|
|
36490
36612
|
[addItem, clearRetryCountdown]
|
|
36491
36613
|
);
|
|
36492
|
-
const autonomousLoopTickResolverRef = (0,
|
|
36493
|
-
const handleChatCompressionEvent = (0,
|
|
36614
|
+
const autonomousLoopTickResolverRef = (0, import_react136.useRef)(null);
|
|
36615
|
+
const handleChatCompressionEvent = (0, import_react136.useCallback)(
|
|
36494
36616
|
(eventValue, userMessageTimestamp) => {
|
|
36495
36617
|
autonomousLoopTickResolverRef.current?.resetCache();
|
|
36496
36618
|
if (pendingHistoryItemRef.current) {
|
|
@@ -36509,7 +36631,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36509
36631
|
},
|
|
36510
36632
|
[addItem, commitItem, config, pendingHistoryItemRef, setPendingHistoryItem]
|
|
36511
36633
|
);
|
|
36512
|
-
const handleMaxSessionTurnsEvent = (0,
|
|
36634
|
+
const handleMaxSessionTurnsEvent = (0, import_react136.useCallback)(
|
|
36513
36635
|
() => addItem(
|
|
36514
36636
|
{
|
|
36515
36637
|
type: "info",
|
|
@@ -36519,7 +36641,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36519
36641
|
),
|
|
36520
36642
|
[addItem, config]
|
|
36521
36643
|
);
|
|
36522
|
-
const handleSessionTokenLimitExceededEvent = (0,
|
|
36644
|
+
const handleSessionTokenLimitExceededEvent = (0, import_react136.useCallback)(
|
|
36523
36645
|
(value) => addItem(
|
|
36524
36646
|
{
|
|
36525
36647
|
type: "error",
|
|
@@ -36534,7 +36656,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36534
36656
|
),
|
|
36535
36657
|
[addItem]
|
|
36536
36658
|
);
|
|
36537
|
-
const handleLoopDetectionConfirmation = (0,
|
|
36659
|
+
const handleLoopDetectionConfirmation = (0, import_react136.useCallback)(
|
|
36538
36660
|
(result) => {
|
|
36539
36661
|
setLoopDetectionConfirmationRequest(null);
|
|
36540
36662
|
if (result.userSelection === "disable") {
|
|
@@ -36558,12 +36680,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36558
36680
|
},
|
|
36559
36681
|
[config, addItem]
|
|
36560
36682
|
);
|
|
36561
|
-
const handleLoopDetectedEvent = (0,
|
|
36683
|
+
const handleLoopDetectedEvent = (0, import_react136.useCallback)(() => {
|
|
36562
36684
|
setLoopDetectionConfirmationRequest({
|
|
36563
36685
|
onComplete: handleLoopDetectionConfirmation
|
|
36564
36686
|
});
|
|
36565
36687
|
}, [handleLoopDetectionConfirmation]);
|
|
36566
|
-
const handleUserPromptSubmitBlockedEvent = (0,
|
|
36688
|
+
const handleUserPromptSubmitBlockedEvent = (0, import_react136.useCallback)(
|
|
36567
36689
|
(value, userMessageTimestamp) => {
|
|
36568
36690
|
if (pendingHistoryItemRef.current) {
|
|
36569
36691
|
commitItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -36580,7 +36702,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36580
36702
|
},
|
|
36581
36703
|
[addItem, commitItem, pendingHistoryItemRef, setPendingHistoryItem]
|
|
36582
36704
|
);
|
|
36583
|
-
const handleStopHookLoopEvent = (0,
|
|
36705
|
+
const handleStopHookLoopEvent = (0, import_react136.useCallback)(
|
|
36584
36706
|
(value, userMessageTimestamp) => {
|
|
36585
36707
|
if (pendingHistoryItemRef.current) {
|
|
36586
36708
|
commitItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -36614,7 +36736,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36614
36736
|
},
|
|
36615
36737
|
[addItem, commitItem, config, pendingHistoryItemRef, setPendingHistoryItem]
|
|
36616
36738
|
);
|
|
36617
|
-
const handleActiveGoalEvent = (0,
|
|
36739
|
+
const handleActiveGoalEvent = (0, import_react136.useCallback)(
|
|
36618
36740
|
(activeGoal) => {
|
|
36619
36741
|
const sessionId = config.getSessionId();
|
|
36620
36742
|
const currentActiveGoal = getActiveGoal(sessionId);
|
|
@@ -36632,7 +36754,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36632
36754
|
},
|
|
36633
36755
|
[config]
|
|
36634
36756
|
);
|
|
36635
|
-
const processGeminiStreamEvents = (0,
|
|
36757
|
+
const processGeminiStreamEvents = (0, import_react136.useCallback)(
|
|
36636
36758
|
async (stream, userMessageTimestamp, signal) => {
|
|
36637
36759
|
let geminiMessageBuffer = "";
|
|
36638
36760
|
let thoughtBuffer = "";
|
|
@@ -36746,7 +36868,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36746
36868
|
flushBufferedStreamEvents();
|
|
36747
36869
|
toolCallRequests.length = 0;
|
|
36748
36870
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
36749
|
-
|
|
36871
|
+
return 1 /* UserCancelled */;
|
|
36750
36872
|
case "error" /* Error */:
|
|
36751
36873
|
flushBufferedStreamEvents();
|
|
36752
36874
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
@@ -36871,11 +36993,11 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36871
36993
|
commitPendingThought(userMessageTimestamp);
|
|
36872
36994
|
discardBufferedStreamEvents();
|
|
36873
36995
|
flushBufferedStreamEventsRef.current.delete(flushBufferedStreamEvents);
|
|
36996
|
+
dualOutput?.finalizeAssistantMessage();
|
|
36874
36997
|
}
|
|
36875
|
-
dualOutput?.finalizeAssistantMessage();
|
|
36876
36998
|
if (toolCallRequests.length > 0 && !signal.aborted && !loopDetectedRef.current) {
|
|
36877
36999
|
const executableToolCallRequests = [];
|
|
36878
|
-
const
|
|
37000
|
+
const duplicateResponses = [];
|
|
36879
37001
|
let duplicatePromptId;
|
|
36880
37002
|
const historyCallIdsWithResponse = geminiClient ? geminiClient.getHistoryFunctionResponseIds() : /* @__PURE__ */ new Set();
|
|
36881
37003
|
const handledProviderIds = /* @__PURE__ */ new Set([
|
|
@@ -36911,26 +37033,27 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36911
37033
|
`[processGeminiStreamEvents] Suppressing duplicate provider tool-call id: ${providerCallId} (tool: ${request.name})`
|
|
36912
37034
|
);
|
|
36913
37035
|
dualOutput?.emitToolResult(request, response);
|
|
36914
|
-
|
|
37036
|
+
duplicateResponses.push({ request, response });
|
|
36915
37037
|
duplicatePromptId ??= request.prompt_id;
|
|
36916
37038
|
continue;
|
|
36917
37039
|
}
|
|
36918
37040
|
handledProviderToolCallIdsRef.current.add(providerCallId);
|
|
36919
37041
|
executableToolCallRequests.push(request);
|
|
36920
37042
|
}
|
|
36921
|
-
if (
|
|
37043
|
+
if (duplicateResponses.length > 0) {
|
|
36922
37044
|
if (executableToolCallRequests.length > 0) {
|
|
36923
37045
|
pendingDuplicateToolResponsesRef.current.push({
|
|
36924
37046
|
executableCallIds: new Set(
|
|
36925
37047
|
executableToolCallRequests.map((request) => request.callId)
|
|
36926
37048
|
),
|
|
36927
37049
|
promptId: duplicatePromptId ?? executableToolCallRequests[0]?.prompt_id,
|
|
36928
|
-
|
|
37050
|
+
callOrder: toolCallRequests.map((request) => request.callId),
|
|
37051
|
+
duplicateResponses
|
|
36929
37052
|
});
|
|
36930
37053
|
} else {
|
|
36931
37054
|
immediateDuplicateToolResponsesRef.current = {
|
|
36932
37055
|
promptId: duplicatePromptId,
|
|
36933
|
-
|
|
37056
|
+
responses: duplicateResponses
|
|
36934
37057
|
};
|
|
36935
37058
|
}
|
|
36936
37059
|
}
|
|
@@ -36971,14 +37094,38 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36971
37094
|
dualOutput
|
|
36972
37095
|
]
|
|
36973
37096
|
);
|
|
36974
|
-
const resolveSteeredMessages = (0,
|
|
37097
|
+
const resolveSteeredMessages = (0, import_react136.useCallback)(
|
|
36975
37098
|
async (messages, signal) => {
|
|
36976
|
-
const
|
|
37099
|
+
const resolvedSegments = [];
|
|
36977
37100
|
const resolvedForRecording = [];
|
|
37101
|
+
const restoreMessages = [];
|
|
37102
|
+
let pendingGoalSegmentIndex;
|
|
36978
37103
|
const timestamp = Date.now();
|
|
36979
37104
|
for (let index = 0; index < messages.length; index += 1) {
|
|
36980
|
-
if (signal.aborted)
|
|
37105
|
+
if (signal.aborted) {
|
|
37106
|
+
restoreMessages.push(...messages.slice(index));
|
|
37107
|
+
break;
|
|
37108
|
+
}
|
|
36981
37109
|
const message = messages[index];
|
|
37110
|
+
if (GOAL_COMMAND_RE.test(message)) {
|
|
37111
|
+
const activeGoalBeforeCommand = getActiveGoal(config.getSessionId());
|
|
37112
|
+
const result = await handleSlashCommand(message);
|
|
37113
|
+
const activeGoalAfterCommand = getActiveGoal(config.getSessionId());
|
|
37114
|
+
if (result && result.type === "submit_prompt") {
|
|
37115
|
+
if (pendingGoalSegmentIndex !== void 0) {
|
|
37116
|
+
resolvedSegments[pendingGoalSegmentIndex] = [];
|
|
37117
|
+
}
|
|
37118
|
+
pendingGoalSegmentIndex = resolvedSegments.length;
|
|
37119
|
+
resolvedSegments.push(normalizePartList(result.content));
|
|
37120
|
+
} else if (activeGoalBeforeCommand?.hookId !== activeGoalAfterCommand?.hookId) {
|
|
37121
|
+
if (pendingGoalSegmentIndex !== void 0) {
|
|
37122
|
+
resolvedSegments[pendingGoalSegmentIndex] = [];
|
|
37123
|
+
pendingGoalSegmentIndex = void 0;
|
|
37124
|
+
}
|
|
37125
|
+
}
|
|
37126
|
+
continue;
|
|
37127
|
+
}
|
|
37128
|
+
restoreMessages.push(message);
|
|
36982
37129
|
const sideEffects = [];
|
|
36983
37130
|
let resolvedQuery = [{ text: message }];
|
|
36984
37131
|
if (isAtCommand(message)) {
|
|
@@ -37041,7 +37188,10 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37041
37188
|
} finally {
|
|
37042
37189
|
clearTimeout(timeoutId);
|
|
37043
37190
|
}
|
|
37044
|
-
if (signal.aborted)
|
|
37191
|
+
if (signal.aborted) {
|
|
37192
|
+
restoreMessages.push(...messages.slice(index + 1));
|
|
37193
|
+
break;
|
|
37194
|
+
}
|
|
37045
37195
|
}
|
|
37046
37196
|
const bridgeResult = await applyVisionBridgeIfNeeded(
|
|
37047
37197
|
resolvedQuery,
|
|
@@ -37049,7 +37199,10 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37049
37199
|
signal
|
|
37050
37200
|
);
|
|
37051
37201
|
if (!bridgeResult.shouldProceed) {
|
|
37052
|
-
if (signal.aborted)
|
|
37202
|
+
if (signal.aborted) {
|
|
37203
|
+
restoreMessages.push(...messages.slice(index + 1));
|
|
37204
|
+
break;
|
|
37205
|
+
}
|
|
37053
37206
|
continue;
|
|
37054
37207
|
}
|
|
37055
37208
|
const messageParts = normalizePartList(
|
|
@@ -37067,19 +37220,24 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37067
37220
|
)
|
|
37068
37221
|
);
|
|
37069
37222
|
}
|
|
37070
|
-
|
|
37071
|
-
resolvedMessages.push({ text: "\n\n" });
|
|
37072
|
-
}
|
|
37073
|
-
resolvedMessages.push(...messageParts);
|
|
37223
|
+
resolvedSegments.push(messageParts);
|
|
37074
37224
|
resolvedForRecording.push({
|
|
37075
37225
|
message,
|
|
37076
37226
|
parts: messageParts,
|
|
37077
37227
|
sideEffects
|
|
37078
37228
|
});
|
|
37079
37229
|
}
|
|
37080
|
-
|
|
37230
|
+
const resolvedMessages = [];
|
|
37231
|
+
for (const segment of resolvedSegments) {
|
|
37232
|
+
if (segment.length === 0) continue;
|
|
37233
|
+
if (resolvedMessages.length > 0) {
|
|
37234
|
+
resolvedMessages.push({ text: "\n\n" });
|
|
37235
|
+
}
|
|
37236
|
+
resolvedMessages.push(...segment);
|
|
37237
|
+
}
|
|
37081
37238
|
return {
|
|
37082
37239
|
parts: resolvedMessages,
|
|
37240
|
+
restoreMessages,
|
|
37083
37241
|
accept: /* @__PURE__ */ __name(() => {
|
|
37084
37242
|
for (const { message, parts, sideEffects } of resolvedForRecording) {
|
|
37085
37243
|
for (const sideEffect of sideEffects) sideEffect();
|
|
@@ -37092,17 +37250,25 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37092
37250
|
}, "accept")
|
|
37093
37251
|
};
|
|
37094
37252
|
},
|
|
37095
|
-
[
|
|
37253
|
+
[
|
|
37254
|
+
addItem,
|
|
37255
|
+
applyVisionBridgeIfNeeded,
|
|
37256
|
+
config,
|
|
37257
|
+
handleSlashCommand,
|
|
37258
|
+
onDebugMessage
|
|
37259
|
+
]
|
|
37096
37260
|
);
|
|
37097
|
-
const resolveDrainedSteerMessages = (0,
|
|
37261
|
+
const resolveDrainedSteerMessages = (0, import_react136.useCallback)(
|
|
37098
37262
|
async (messages, signal) => {
|
|
37099
37263
|
try {
|
|
37100
37264
|
const resolved = await resolveSteeredMessages(messages, signal);
|
|
37101
37265
|
if (signal.aborted) {
|
|
37102
|
-
|
|
37266
|
+
if (resolved.restoreMessages.length > 0) {
|
|
37267
|
+
midTurnRestoreRef?.current?.(resolved.restoreMessages);
|
|
37268
|
+
}
|
|
37103
37269
|
return void 0;
|
|
37104
37270
|
}
|
|
37105
|
-
if (
|
|
37271
|
+
if (resolved.parts.length === 0) return void 0;
|
|
37106
37272
|
let settled = false;
|
|
37107
37273
|
return {
|
|
37108
37274
|
parts: resolved.parts,
|
|
@@ -37114,7 +37280,9 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37114
37280
|
restore: /* @__PURE__ */ __name(() => {
|
|
37115
37281
|
if (settled) return;
|
|
37116
37282
|
settled = true;
|
|
37117
|
-
|
|
37283
|
+
if (resolved.restoreMessages.length > 0) {
|
|
37284
|
+
midTurnRestoreRef?.current?.(resolved.restoreMessages);
|
|
37285
|
+
}
|
|
37118
37286
|
}, "restore")
|
|
37119
37287
|
};
|
|
37120
37288
|
} catch (error) {
|
|
@@ -37127,7 +37295,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37127
37295
|
},
|
|
37128
37296
|
[midTurnRestoreRef, onDebugMessage, resolveSteeredMessages]
|
|
37129
37297
|
);
|
|
37130
|
-
const drainSteerAtBoundary = (0,
|
|
37298
|
+
const drainSteerAtBoundary = (0, import_react136.useCallback)(
|
|
37131
37299
|
async (signal) => {
|
|
37132
37300
|
const messages = midTurnDrainRef?.current?.() ?? [];
|
|
37133
37301
|
if (messages.length === 0) return void 0;
|
|
@@ -37135,7 +37303,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37135
37303
|
},
|
|
37136
37304
|
[midTurnDrainRef, resolveDrainedSteerMessages]
|
|
37137
37305
|
);
|
|
37138
|
-
const submitQuery = (0,
|
|
37306
|
+
const submitQuery = (0, import_react136.useCallback)(
|
|
37139
37307
|
async (query, submitType = "userQuery" /* UserQuery */, prompt_id, metadata) => {
|
|
37140
37308
|
const allowConcurrentBtwDuringResponse = submitType === "userQuery" /* UserQuery */ && streamingState === "responding" /* Responding */ && typeof query === "string" && isBtwCommand(query);
|
|
37141
37309
|
const isTurnContinuation = submitType === "toolResult" /* ToolResult */ || submitType === "steer" /* Steer */;
|
|
@@ -37246,6 +37414,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37246
37414
|
if (!isTurnContinuation) {
|
|
37247
37415
|
streamingResponseLengthRef.current = 0;
|
|
37248
37416
|
}
|
|
37417
|
+
let cleanupReviewLease = false;
|
|
37249
37418
|
try {
|
|
37250
37419
|
if (dualOutput && submitType !== "toolResult" /* ToolResult */) {
|
|
37251
37420
|
const rawParts = typeof finalQueryToSend === "string" ? [finalQueryToSend] : Array.isArray(finalQueryToSend) ? finalQueryToSend : [finalQueryToSend];
|
|
@@ -37272,6 +37441,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37272
37441
|
abortSignal
|
|
37273
37442
|
);
|
|
37274
37443
|
if (processingStatus === 1 /* UserCancelled */) {
|
|
37444
|
+
cleanupReviewLease = true;
|
|
37275
37445
|
submitPromptOnCompleteRef.current = null;
|
|
37276
37446
|
isSubmittingQueryRef.current = false;
|
|
37277
37447
|
metadata?.onDeliveryFailed?.();
|
|
@@ -37284,8 +37454,33 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37284
37454
|
const immediateDuplicateToolResponses = immediateDuplicateToolResponsesRef.current;
|
|
37285
37455
|
if (immediateDuplicateToolResponses) {
|
|
37286
37456
|
immediateDuplicateToolResponsesRef.current = null;
|
|
37457
|
+
const finalized = await finalizeToolResponses(
|
|
37458
|
+
config,
|
|
37459
|
+
immediateDuplicateToolResponses.responses.map(
|
|
37460
|
+
({ request, response }) => ({
|
|
37461
|
+
callId: request.callId,
|
|
37462
|
+
toolName: request.name,
|
|
37463
|
+
responseParts: response.responseParts,
|
|
37464
|
+
persistedOutputFiles: response.persistedOutputFiles
|
|
37465
|
+
})
|
|
37466
|
+
)
|
|
37467
|
+
);
|
|
37468
|
+
const responseParts = finalized.flatMap(
|
|
37469
|
+
(entry) => entry.responseParts
|
|
37470
|
+
);
|
|
37471
|
+
immediateDuplicateToolResponses.responses.forEach(
|
|
37472
|
+
({ request, response }, index) => {
|
|
37473
|
+
config.getChatRecordingService?.()?.recordToolResult?.(finalized[index].responseParts, {
|
|
37474
|
+
callId: request.callId,
|
|
37475
|
+
status: response.error ? "error" : "success",
|
|
37476
|
+
resultDisplay: response.resultDisplay,
|
|
37477
|
+
error: response.error,
|
|
37478
|
+
errorType: response.errorType
|
|
37479
|
+
});
|
|
37480
|
+
}
|
|
37481
|
+
);
|
|
37287
37482
|
await submitQuery(
|
|
37288
|
-
|
|
37483
|
+
responseParts,
|
|
37289
37484
|
"toolResult" /* ToolResult */,
|
|
37290
37485
|
immediateDuplicateToolResponses.promptId
|
|
37291
37486
|
);
|
|
@@ -37295,6 +37490,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37295
37490
|
}
|
|
37296
37491
|
const loopDetected = loopDetectedRef.current;
|
|
37297
37492
|
if (loopDetected) {
|
|
37493
|
+
cleanupReviewLease = true;
|
|
37298
37494
|
loopDetectedRef.current = false;
|
|
37299
37495
|
handleLoopDetectedEvent();
|
|
37300
37496
|
}
|
|
@@ -37328,6 +37524,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37328
37524
|
}
|
|
37329
37525
|
}
|
|
37330
37526
|
} catch (error) {
|
|
37527
|
+
cleanupReviewLease = true;
|
|
37331
37528
|
metadata?.onDeliveryFailed?.();
|
|
37332
37529
|
if (error instanceof UnauthorizedError) {
|
|
37333
37530
|
onAuthError("Session expired or is unauthorized.");
|
|
@@ -37344,6 +37541,13 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37344
37541
|
});
|
|
37345
37542
|
}
|
|
37346
37543
|
} finally {
|
|
37544
|
+
if (cleanupReviewLease) {
|
|
37545
|
+
cleanupReviewWorktreeLeases({
|
|
37546
|
+
sessionId: config.getSessionId(),
|
|
37547
|
+
promptId: prompt_id,
|
|
37548
|
+
repositoryRoot: config.getProjectRoot()
|
|
37549
|
+
});
|
|
37550
|
+
}
|
|
37347
37551
|
submitPromptOnCompleteRef.current = null;
|
|
37348
37552
|
activeModelStreamsRef.current = Math.max(
|
|
37349
37553
|
0,
|
|
@@ -37382,7 +37586,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37382
37586
|
midTurnDrainRef
|
|
37383
37587
|
]
|
|
37384
37588
|
);
|
|
37385
|
-
const retryLastPrompt = (0,
|
|
37589
|
+
const retryLastPrompt = (0, import_react136.useCallback)(async () => {
|
|
37386
37590
|
if (skipRetryDelayRef.current) {
|
|
37387
37591
|
skipRetryDelayRef.current();
|
|
37388
37592
|
skipRetryDelayRef.current = null;
|
|
@@ -37406,7 +37610,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37406
37610
|
clearRetryCountdown();
|
|
37407
37611
|
await submitQuery(lastPrompt, "retry" /* Retry */);
|
|
37408
37612
|
}, [streamingState, addItem, clearRetryCountdown, submitQuery]);
|
|
37409
|
-
const handleApprovalModeChange = (0,
|
|
37613
|
+
const handleApprovalModeChange = (0, import_react136.useCallback)(
|
|
37410
37614
|
async (newApprovalMode) => {
|
|
37411
37615
|
if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "auto-edit" /* AUTO_EDIT */) {
|
|
37412
37616
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
@@ -37441,7 +37645,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37441
37645
|
},
|
|
37442
37646
|
[toolCalls]
|
|
37443
37647
|
);
|
|
37444
|
-
const handleCompletedTools = (0,
|
|
37648
|
+
const handleCompletedTools = (0, import_react136.useCallback)(
|
|
37445
37649
|
async (completedToolCallsFromScheduler) => {
|
|
37446
37650
|
const completedAndReadyToSubmitTools = completedToolCallsFromScheduler.filter(
|
|
37447
37651
|
(tc) => {
|
|
@@ -37521,8 +37725,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37521
37725
|
}
|
|
37522
37726
|
return !isReady;
|
|
37523
37727
|
});
|
|
37524
|
-
const
|
|
37525
|
-
(batch) => batch.
|
|
37728
|
+
const pendingDuplicateResponses = readyDuplicateBatches.flatMap(
|
|
37729
|
+
(batch) => batch.duplicateResponses
|
|
37526
37730
|
);
|
|
37527
37731
|
const pendingDuplicatePromptId = readyDuplicateBatches[0]?.promptId;
|
|
37528
37732
|
for (const toolCall of geminiTools) {
|
|
@@ -37531,9 +37735,67 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37531
37735
|
toolCall.request.args
|
|
37532
37736
|
);
|
|
37533
37737
|
}
|
|
37534
|
-
if (geminiTools.length === 0 &&
|
|
37738
|
+
if (geminiTools.length === 0 && pendingDuplicateResponses.length === 0) {
|
|
37535
37739
|
return;
|
|
37536
37740
|
}
|
|
37741
|
+
const executableQueues = /* @__PURE__ */ new Map();
|
|
37742
|
+
for (const toolCall of geminiTools) {
|
|
37743
|
+
const queue = executableQueues.get(toolCall.request.callId) ?? [];
|
|
37744
|
+
queue.push({
|
|
37745
|
+
request: toolCall.request,
|
|
37746
|
+
response: toolCall.response,
|
|
37747
|
+
status: toolCall.status
|
|
37748
|
+
});
|
|
37749
|
+
executableQueues.set(toolCall.request.callId, queue);
|
|
37750
|
+
}
|
|
37751
|
+
const duplicateQueues = /* @__PURE__ */ new Map();
|
|
37752
|
+
for (const duplicate of pendingDuplicateResponses) {
|
|
37753
|
+
const queue = duplicateQueues.get(duplicate.request.callId) ?? [];
|
|
37754
|
+
queue.push({
|
|
37755
|
+
...duplicate,
|
|
37756
|
+
status: duplicate.response.error ? "error" : "success"
|
|
37757
|
+
});
|
|
37758
|
+
duplicateQueues.set(duplicate.request.callId, queue);
|
|
37759
|
+
}
|
|
37760
|
+
const orderedResponses = [];
|
|
37761
|
+
for (const batch of readyDuplicateBatches) {
|
|
37762
|
+
for (const callId of batch.callOrder) {
|
|
37763
|
+
const executable = executableQueues.get(callId)?.shift();
|
|
37764
|
+
if (executable) {
|
|
37765
|
+
orderedResponses.push(executable);
|
|
37766
|
+
continue;
|
|
37767
|
+
}
|
|
37768
|
+
const duplicate = duplicateQueues.get(callId)?.shift();
|
|
37769
|
+
if (duplicate) orderedResponses.push(duplicate);
|
|
37770
|
+
}
|
|
37771
|
+
}
|
|
37772
|
+
for (const queue of executableQueues.values()) {
|
|
37773
|
+
orderedResponses.push(...queue);
|
|
37774
|
+
}
|
|
37775
|
+
for (const queue of duplicateQueues.values()) {
|
|
37776
|
+
orderedResponses.push(...queue);
|
|
37777
|
+
}
|
|
37778
|
+
const finalizedResponses = await finalizeToolResponses(
|
|
37779
|
+
config,
|
|
37780
|
+
orderedResponses.map(({ request, response }) => ({
|
|
37781
|
+
callId: request.callId,
|
|
37782
|
+
toolName: request.name,
|
|
37783
|
+
responseParts: response.responseParts,
|
|
37784
|
+
persistedOutputFiles: response.persistedOutputFiles
|
|
37785
|
+
}))
|
|
37786
|
+
);
|
|
37787
|
+
const responsesToSend = finalizedResponses.flatMap(
|
|
37788
|
+
(entry) => entry.responseParts
|
|
37789
|
+
);
|
|
37790
|
+
orderedResponses.forEach(({ request, response, status }, index) => {
|
|
37791
|
+
config.getChatRecordingService?.()?.recordToolResult?.(finalizedResponses[index].responseParts, {
|
|
37792
|
+
callId: request.callId,
|
|
37793
|
+
status,
|
|
37794
|
+
resultDisplay: response.resultDisplay,
|
|
37795
|
+
error: response.error,
|
|
37796
|
+
errorType: response.errorType
|
|
37797
|
+
});
|
|
37798
|
+
});
|
|
37537
37799
|
if (turnCancelledRef.current || abortControllerRef.current?.signal.aborted) {
|
|
37538
37800
|
markToolsAsSubmitted(
|
|
37539
37801
|
geminiTools.map((toolCall) => toolCall.request.callId)
|
|
@@ -37543,14 +37805,11 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37543
37805
|
const allToolsCancelled = geminiTools.every(
|
|
37544
37806
|
(tc) => tc.status === "cancelled"
|
|
37545
37807
|
);
|
|
37546
|
-
if (allToolsCancelled &&
|
|
37808
|
+
if (allToolsCancelled && pendingDuplicateResponses.length === 0) {
|
|
37547
37809
|
if (geminiClient) {
|
|
37548
|
-
const combinedParts = geminiTools.flatMap(
|
|
37549
|
-
(toolCall) => toolCall.response.responseParts
|
|
37550
|
-
);
|
|
37551
37810
|
geminiClient.addHistory({
|
|
37552
37811
|
role: "user",
|
|
37553
|
-
parts:
|
|
37812
|
+
parts: responsesToSend
|
|
37554
37813
|
});
|
|
37555
37814
|
config.getArenaAgentClient()?.reportCancelled();
|
|
37556
37815
|
}
|
|
@@ -37560,10 +37819,6 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37560
37819
|
markToolsAsSubmitted(callIdsToMarkAsSubmitted2);
|
|
37561
37820
|
return;
|
|
37562
37821
|
}
|
|
37563
|
-
const responsesToSend = geminiTools.flatMap(
|
|
37564
|
-
(toolCall) => toolCall.response.responseParts
|
|
37565
|
-
);
|
|
37566
|
-
responsesToSend.push(...pendingDuplicateResponseParts);
|
|
37567
37822
|
const callIdsToMarkAsSubmitted = geminiTools.map(
|
|
37568
37823
|
(toolCall) => toolCall.request.callId
|
|
37569
37824
|
);
|
|
@@ -37692,7 +37947,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37692
37947
|
resolveDrainedSteerMessages
|
|
37693
37948
|
]
|
|
37694
37949
|
);
|
|
37695
|
-
const pendingHistoryItems = (0,
|
|
37950
|
+
const pendingHistoryItems = (0, import_react136.useMemo)(
|
|
37696
37951
|
() => [
|
|
37697
37952
|
// Reasoning renders above the streaming answer.
|
|
37698
37953
|
pendingThoughtItem,
|
|
@@ -37709,7 +37964,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37709
37964
|
pendingToolCallGroupDisplay
|
|
37710
37965
|
]
|
|
37711
37966
|
);
|
|
37712
|
-
(0,
|
|
37967
|
+
(0, import_react136.useEffect)(() => {
|
|
37713
37968
|
const saveRestorableToolCalls = /* @__PURE__ */ __name(async () => {
|
|
37714
37969
|
if (!config.getFileCheckpointingEnabled()) {
|
|
37715
37970
|
return;
|
|
@@ -37780,14 +38035,14 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37780
38035
|
}, "saveRestorableToolCalls");
|
|
37781
38036
|
saveRestorableToolCalls();
|
|
37782
38037
|
}, [toolCalls, config, onDebugMessage, history, geminiClient, storage]);
|
|
37783
|
-
const notificationQueueRef = (0,
|
|
37784
|
-
const [notificationTrigger, setNotificationTrigger] = (0,
|
|
37785
|
-
const getAutonomousLoopTickResolver = (0,
|
|
38038
|
+
const notificationQueueRef = (0, import_react136.useRef)([]);
|
|
38039
|
+
const [notificationTrigger, setNotificationTrigger] = (0, import_react136.useState)(0);
|
|
38040
|
+
const getAutonomousLoopTickResolver = (0, import_react136.useCallback)(() => {
|
|
37786
38041
|
autonomousLoopTickResolverRef.current ??= new AutonomousLoopTickResolver();
|
|
37787
38042
|
return autonomousLoopTickResolverRef.current;
|
|
37788
38043
|
}, []);
|
|
37789
|
-
const notificationQueueSessionIdRef = (0,
|
|
37790
|
-
(0,
|
|
38044
|
+
const notificationQueueSessionIdRef = (0, import_react136.useRef)(sessionStates.sessionId);
|
|
38045
|
+
(0, import_react136.useEffect)(() => {
|
|
37791
38046
|
if (notificationQueueSessionIdRef.current === sessionStates.sessionId) {
|
|
37792
38047
|
return;
|
|
37793
38048
|
}
|
|
@@ -37795,9 +38050,9 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37795
38050
|
notificationQueueRef.current = [];
|
|
37796
38051
|
autonomousLoopTickResolverRef.current?.resetCache();
|
|
37797
38052
|
}, [sessionStates.sessionId]);
|
|
37798
|
-
const cronSessionIdRef = (0,
|
|
38053
|
+
const cronSessionIdRef = (0, import_react136.useRef)(sessionStates.sessionId);
|
|
37799
38054
|
cronSessionIdRef.current = sessionStates.sessionId;
|
|
37800
|
-
(0,
|
|
38055
|
+
(0, import_react136.useEffect)(() => {
|
|
37801
38056
|
if (!isConfigInitialized) return;
|
|
37802
38057
|
if (!config.isCronEnabled()) return;
|
|
37803
38058
|
const scheduler = config.getCronScheduler();
|
|
@@ -37850,7 +38105,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37850
38105
|
}
|
|
37851
38106
|
};
|
|
37852
38107
|
}, [config, getAutonomousLoopTickResolver, isConfigInitialized]);
|
|
37853
|
-
(0,
|
|
38108
|
+
(0, import_react136.useEffect)(() => {
|
|
37854
38109
|
const registry = config.getBackgroundTaskRegistry();
|
|
37855
38110
|
registry.setNotificationCallback((displayText, modelText) => {
|
|
37856
38111
|
notificationQueueRef.current.push({
|
|
@@ -37864,7 +38119,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37864
38119
|
registry.setNotificationCallback(void 0);
|
|
37865
38120
|
};
|
|
37866
38121
|
}, [config]);
|
|
37867
|
-
(0,
|
|
38122
|
+
(0, import_react136.useEffect)(() => {
|
|
37868
38123
|
const registry = config.getBackgroundShellRegistry();
|
|
37869
38124
|
registry.setNotificationCallback((displayText, modelText) => {
|
|
37870
38125
|
notificationQueueRef.current.push({
|
|
@@ -37878,7 +38133,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37878
38133
|
registry.setNotificationCallback(void 0);
|
|
37879
38134
|
};
|
|
37880
38135
|
}, [config]);
|
|
37881
|
-
(0,
|
|
38136
|
+
(0, import_react136.useEffect)(() => {
|
|
37882
38137
|
const registry = config.getMonitorRegistry();
|
|
37883
38138
|
registry.setNotificationCallback((displayText, modelText, meta) => {
|
|
37884
38139
|
if (meta.status === "running" && typeof registry.get === "function") {
|
|
@@ -37896,42 +38151,47 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37896
38151
|
registry.setNotificationCallback(void 0);
|
|
37897
38152
|
};
|
|
37898
38153
|
}, [config]);
|
|
37899
|
-
(0,
|
|
38154
|
+
(0, import_react136.useEffect)(() => {
|
|
37900
38155
|
if (streamingState === "idle" /* Idle */ && !isSubmittingQueryRef.current && notificationQueueRef.current.length > 0) {
|
|
37901
|
-
|
|
37902
|
-
|
|
37903
|
-
|
|
37904
|
-
|
|
37905
|
-
|
|
37906
|
-
|
|
37907
|
-
|
|
37908
|
-
|
|
37909
|
-
|
|
37910
|
-
|
|
37911
|
-
|
|
37912
|
-
|
|
38156
|
+
runOutsideAgentContext(() => {
|
|
38157
|
+
const queue = notificationQueueRef.current;
|
|
38158
|
+
const targetType = queue[0].sendMessageType;
|
|
38159
|
+
if (targetType === "cron" /* Cron */) {
|
|
38160
|
+
const item = queue.shift();
|
|
38161
|
+
addItem(
|
|
38162
|
+
{ type: "notification", text: item.displayText },
|
|
38163
|
+
Date.now()
|
|
38164
|
+
);
|
|
38165
|
+
submitQuery(item.modelText, item.sendMessageType, void 0, {
|
|
38166
|
+
notificationDisplayText: item.displayText,
|
|
38167
|
+
onDelivered: item.onDelivered,
|
|
38168
|
+
onDeliveryFailed: item.onDeliveryFailed
|
|
38169
|
+
});
|
|
38170
|
+
return;
|
|
38171
|
+
}
|
|
38172
|
+
let splitIdx = 0;
|
|
38173
|
+
while (splitIdx < queue.length && queue[splitIdx].sendMessageType === targetType) {
|
|
38174
|
+
splitIdx++;
|
|
38175
|
+
}
|
|
38176
|
+
const batch = queue.splice(0, splitIdx);
|
|
38177
|
+
const now = Date.now();
|
|
38178
|
+
for (const item of batch) {
|
|
38179
|
+
addItem(
|
|
38180
|
+
{ type: "notification", text: item.displayText },
|
|
38181
|
+
now
|
|
38182
|
+
);
|
|
38183
|
+
}
|
|
38184
|
+
const combinedModelText = batch.map((e) => e.modelText).join("\n\n");
|
|
38185
|
+
const combinedDisplayText = batch.map((e) => e.displayText).join("; ");
|
|
38186
|
+
submitQuery(combinedModelText, targetType, void 0, {
|
|
38187
|
+
notificationDisplayText: combinedDisplayText
|
|
37913
38188
|
});
|
|
37914
|
-
return;
|
|
37915
|
-
}
|
|
37916
|
-
let splitIdx = 0;
|
|
37917
|
-
while (splitIdx < queue.length && queue[splitIdx].sendMessageType === targetType) {
|
|
37918
|
-
splitIdx++;
|
|
37919
|
-
}
|
|
37920
|
-
const batch = queue.splice(0, splitIdx);
|
|
37921
|
-
const now = Date.now();
|
|
37922
|
-
for (const item of batch) {
|
|
37923
|
-
addItem({ type: "notification", text: item.displayText }, now);
|
|
37924
|
-
}
|
|
37925
|
-
const combinedModelText = batch.map((e) => e.modelText).join("\n\n");
|
|
37926
|
-
const combinedDisplayText = batch.map((e) => e.displayText).join("; ");
|
|
37927
|
-
submitQuery(combinedModelText, targetType, void 0, {
|
|
37928
|
-
notificationDisplayText: combinedDisplayText
|
|
37929
38189
|
});
|
|
37930
38190
|
}
|
|
37931
38191
|
}, [streamingState, submitQuery, notificationTrigger, addItem]);
|
|
37932
|
-
const teammateQueueRef = (0,
|
|
37933
|
-
const [teammateTrigger, setTeammateTrigger] = (0,
|
|
37934
|
-
(0,
|
|
38192
|
+
const teammateQueueRef = (0, import_react136.useRef)([]);
|
|
38193
|
+
const [teammateTrigger, setTeammateTrigger] = (0, import_react136.useState)(0);
|
|
38194
|
+
(0, import_react136.useEffect)(() => {
|
|
37935
38195
|
let boundManager = null;
|
|
37936
38196
|
const handleManagerChange = /* @__PURE__ */ __name((manager) => {
|
|
37937
38197
|
if (boundManager && boundManager !== manager) {
|
|
@@ -37961,7 +38221,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37961
38221
|
}
|
|
37962
38222
|
};
|
|
37963
38223
|
}, [config]);
|
|
37964
|
-
(0,
|
|
38224
|
+
(0, import_react136.useEffect)(() => {
|
|
37965
38225
|
if (streamingState === "idle" /* Idle */ && !isSubmittingQueryRef.current && teammateQueueRef.current.length > 0) {
|
|
37966
38226
|
const batch = teammateQueueRef.current.splice(0);
|
|
37967
38227
|
for (const entry of batch) {
|
|
@@ -37996,7 +38256,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37996
38256
|
|
|
37997
38257
|
// packages/cli/src/ui/hooks/vim.ts
|
|
37998
38258
|
init_esbuild_shims();
|
|
37999
|
-
var
|
|
38259
|
+
var import_react137 = __toESM(require_react(), 1);
|
|
38000
38260
|
import { execFile as execFile7, execFileSync as execFileSync2 } from "child_process";
|
|
38001
38261
|
var DIGIT_MULTIPLIER = 10;
|
|
38002
38262
|
var DEFAULT_COUNT = 1;
|
|
@@ -38232,26 +38492,26 @@ __name(findCharInLineReverse, "findCharInLineReverse");
|
|
|
38232
38492
|
function useVim(buffer, onSubmit) {
|
|
38233
38493
|
const { vimEnabled, vimMode } = useVimModeState();
|
|
38234
38494
|
const { setVimMode } = useVimModeActions();
|
|
38235
|
-
const [state, dispatch] = (0,
|
|
38236
|
-
const bufferRef = (0,
|
|
38237
|
-
const stateRef = (0,
|
|
38495
|
+
const [state, dispatch] = (0, import_react137.useReducer)(vimReducer, initialVimState);
|
|
38496
|
+
const bufferRef = (0, import_react137.useRef)(buffer);
|
|
38497
|
+
const stateRef = (0, import_react137.useRef)(state);
|
|
38238
38498
|
bufferRef.current = buffer;
|
|
38239
38499
|
stateRef.current = state;
|
|
38240
|
-
(0,
|
|
38500
|
+
(0, import_react137.useEffect)(() => {
|
|
38241
38501
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
38242
38502
|
}, [vimMode]);
|
|
38243
|
-
const updateMode = (0,
|
|
38503
|
+
const updateMode = (0, import_react137.useCallback)(
|
|
38244
38504
|
(mode) => {
|
|
38245
38505
|
setVimMode(mode);
|
|
38246
38506
|
dispatch({ type: "SET_MODE", mode });
|
|
38247
38507
|
},
|
|
38248
38508
|
[setVimMode]
|
|
38249
38509
|
);
|
|
38250
|
-
const getCurrentCount = (0,
|
|
38510
|
+
const getCurrentCount = (0, import_react137.useCallback)(
|
|
38251
38511
|
() => stateRef.current.count || DEFAULT_COUNT,
|
|
38252
38512
|
[]
|
|
38253
38513
|
);
|
|
38254
|
-
const yankRange = (0,
|
|
38514
|
+
const yankRange = (0, import_react137.useCallback)(
|
|
38255
38515
|
(startRow, startCol, endRow, endCol, linewise) => {
|
|
38256
38516
|
const lines = bufferRef.current.lines;
|
|
38257
38517
|
let text = "";
|
|
@@ -38266,7 +38526,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38266
38526
|
},
|
|
38267
38527
|
[]
|
|
38268
38528
|
);
|
|
38269
|
-
const executeCommand = (0,
|
|
38529
|
+
const executeCommand = (0, import_react137.useCallback)(
|
|
38270
38530
|
(cmdType, count) => {
|
|
38271
38531
|
switch (cmdType) {
|
|
38272
38532
|
case CMD_TYPES.DELETE_WORD_FORWARD:
|
|
@@ -38667,7 +38927,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38667
38927
|
return { text, linewise: movement === "j" || movement === "k" };
|
|
38668
38928
|
}
|
|
38669
38929
|
__name(extractMovementText, "extractMovementText");
|
|
38670
|
-
const executeFind = (0,
|
|
38930
|
+
const executeFind = (0, import_react137.useCallback)(
|
|
38671
38931
|
(findType, char, count = 1) => {
|
|
38672
38932
|
const [startRow, startCol] = buffer.cursor;
|
|
38673
38933
|
const line = buffer.lines[startRow] ?? "";
|
|
@@ -38703,7 +38963,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38703
38963
|
},
|
|
38704
38964
|
[buffer, dispatch]
|
|
38705
38965
|
);
|
|
38706
|
-
const handleCharRead = (0,
|
|
38966
|
+
const handleCharRead = (0, import_react137.useCallback)(
|
|
38707
38967
|
(char) => {
|
|
38708
38968
|
const readType = state.pendingCharRead;
|
|
38709
38969
|
if (!readType) return false;
|
|
@@ -38746,7 +39006,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38746
39006
|
},
|
|
38747
39007
|
[state.pendingCharRead, buffer, dispatch, executeFind]
|
|
38748
39008
|
);
|
|
38749
|
-
const handleInsertModeInput = (0,
|
|
39009
|
+
const handleInsertModeInput = (0, import_react137.useCallback)(
|
|
38750
39010
|
(normalizedKey) => {
|
|
38751
39011
|
if (normalizedKey.name === "escape") {
|
|
38752
39012
|
buffer.vimEscapeInsertMode();
|
|
@@ -38777,7 +39037,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38777
39037
|
},
|
|
38778
39038
|
[buffer, dispatch, updateMode, onSubmit]
|
|
38779
39039
|
);
|
|
38780
|
-
const normalizeKey = (0,
|
|
39040
|
+
const normalizeKey = (0, import_react137.useCallback)(
|
|
38781
39041
|
(key) => ({
|
|
38782
39042
|
name: key.name || "",
|
|
38783
39043
|
sequence: key.sequence || "",
|
|
@@ -38788,7 +39048,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38788
39048
|
}),
|
|
38789
39049
|
[]
|
|
38790
39050
|
);
|
|
38791
|
-
const handleChangeMovement = (0,
|
|
39051
|
+
const handleChangeMovement = (0, import_react137.useCallback)(
|
|
38792
39052
|
(movement) => {
|
|
38793
39053
|
const count = getCurrentCount();
|
|
38794
39054
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -38809,7 +39069,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38809
39069
|
},
|
|
38810
39070
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
38811
39071
|
);
|
|
38812
|
-
const handleDeleteMovement = (0,
|
|
39072
|
+
const handleDeleteMovement = (0, import_react137.useCallback)(
|
|
38813
39073
|
(movement) => {
|
|
38814
39074
|
const count = getCurrentCount();
|
|
38815
39075
|
const [row, col] = bufferRef.current.cursor;
|
|
@@ -38844,7 +39104,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38844
39104
|
},
|
|
38845
39105
|
[getCurrentCount, dispatch, buffer]
|
|
38846
39106
|
);
|
|
38847
|
-
const handleYankMovement = (0,
|
|
39107
|
+
const handleYankMovement = (0, import_react137.useCallback)(
|
|
38848
39108
|
(movement) => {
|
|
38849
39109
|
const count = getCurrentCount();
|
|
38850
39110
|
const [row, col] = bufferRef.current.cursor;
|
|
@@ -38878,7 +39138,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38878
39138
|
},
|
|
38879
39139
|
[getCurrentCount, dispatch]
|
|
38880
39140
|
);
|
|
38881
|
-
const handleOperatorMotion = (0,
|
|
39141
|
+
const handleOperatorMotion = (0, import_react137.useCallback)(
|
|
38882
39142
|
(operator, motion) => {
|
|
38883
39143
|
const count = getCurrentCount();
|
|
38884
39144
|
const commandMap = {
|
|
@@ -38910,7 +39170,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38910
39170
|
},
|
|
38911
39171
|
[getCurrentCount, executeCommand, dispatch]
|
|
38912
39172
|
);
|
|
38913
|
-
const handleInput = (0,
|
|
39173
|
+
const handleInput = (0, import_react137.useCallback)(
|
|
38914
39174
|
(key) => {
|
|
38915
39175
|
if (!vimEnabled) {
|
|
38916
39176
|
return false;
|
|
@@ -39632,7 +39892,7 @@ __name(buildWorkflowSteeringNotice, "buildWorkflowSteeringNotice");
|
|
|
39632
39892
|
|
|
39633
39893
|
// packages/cli/src/ui/hooks/useAwaySummary.ts
|
|
39634
39894
|
init_esbuild_shims();
|
|
39635
|
-
var
|
|
39895
|
+
var import_react138 = __toESM(require_react(), 1);
|
|
39636
39896
|
var DEFAULT_AWAY_THRESHOLD_MINUTES = 5;
|
|
39637
39897
|
var MIN_USER_MESSAGES_TO_FIRE = 3;
|
|
39638
39898
|
var MIN_USER_MESSAGES_SINCE_LAST_RECAP = 2;
|
|
@@ -39663,15 +39923,15 @@ function useAwaySummary(options) {
|
|
|
39663
39923
|
history,
|
|
39664
39924
|
awayThresholdMinutes
|
|
39665
39925
|
} = options;
|
|
39666
|
-
const blurredAtRef = (0,
|
|
39667
|
-
const recapPendingRef = (0,
|
|
39668
|
-
const inFlightRef = (0,
|
|
39669
|
-
const isIdleRef = (0,
|
|
39926
|
+
const blurredAtRef = (0, import_react138.useRef)(null);
|
|
39927
|
+
const recapPendingRef = (0, import_react138.useRef)(false);
|
|
39928
|
+
const inFlightRef = (0, import_react138.useRef)(null);
|
|
39929
|
+
const isIdleRef = (0, import_react138.useRef)(isIdle);
|
|
39670
39930
|
isIdleRef.current = isIdle;
|
|
39671
|
-
const historyRef = (0,
|
|
39931
|
+
const historyRef = (0, import_react138.useRef)(history);
|
|
39672
39932
|
historyRef.current = history;
|
|
39673
39933
|
const thresholdMs = (awayThresholdMinutes && awayThresholdMinutes > 0 ? awayThresholdMinutes : DEFAULT_AWAY_THRESHOLD_MINUTES) * 60 * 1e3;
|
|
39674
|
-
(0,
|
|
39934
|
+
(0, import_react138.useEffect)(() => {
|
|
39675
39935
|
if (!enabled || !config) {
|
|
39676
39936
|
inFlightRef.current?.abort();
|
|
39677
39937
|
inFlightRef.current = null;
|
|
@@ -39723,7 +39983,7 @@ function useAwaySummary(options) {
|
|
|
39723
39983
|
recapPendingRef.current = false;
|
|
39724
39984
|
});
|
|
39725
39985
|
}, [enabled, config, isFocused, isIdle, addItem, thresholdMs]);
|
|
39726
|
-
(0,
|
|
39986
|
+
(0, import_react138.useEffect)(
|
|
39727
39987
|
() => () => {
|
|
39728
39988
|
inFlightRef.current?.abort();
|
|
39729
39989
|
},
|
|
@@ -39734,14 +39994,14 @@ __name(useAwaySummary, "useAwaySummary");
|
|
|
39734
39994
|
|
|
39735
39995
|
// packages/cli/src/ui/hooks/useBracketedPaste.ts
|
|
39736
39996
|
init_esbuild_shims();
|
|
39737
|
-
var
|
|
39997
|
+
var import_react139 = __toESM(require_react(), 1);
|
|
39738
39998
|
var ENABLE_BRACKETED_PASTE = "\x1B[?2004h";
|
|
39739
39999
|
var DISABLE_BRACKETED_PASTE = "\x1B[?2004l";
|
|
39740
40000
|
var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
39741
40001
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
39742
40002
|
process.stdout.write(DISABLE_BRACKETED_PASTE);
|
|
39743
40003
|
}, "cleanup");
|
|
39744
|
-
(0,
|
|
40004
|
+
(0, import_react139.useEffect)(() => {
|
|
39745
40005
|
process.stdout.write(ENABLE_BRACKETED_PASTE);
|
|
39746
40006
|
process.on("exit", cleanup);
|
|
39747
40007
|
process.on("SIGINT", cleanup);
|
|
@@ -39760,23 +40020,23 @@ init_esbuild_shims();
|
|
|
39760
40020
|
|
|
39761
40021
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
39762
40022
|
init_esbuild_shims();
|
|
39763
|
-
var
|
|
40023
|
+
var import_react140 = __toESM(require_react(), 1);
|
|
39764
40024
|
var WITTY_LOADING_PHRASES = ["I'm Feeling Lucky"];
|
|
39765
40025
|
var PHRASE_CHANGE_INTERVAL_MS = 15e3;
|
|
39766
40026
|
var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases) => {
|
|
39767
40027
|
const currentLanguage = getCurrentLanguage();
|
|
39768
|
-
const loadingPhrases = (0,
|
|
40028
|
+
const loadingPhrases = (0, import_react140.useMemo)(() => {
|
|
39769
40029
|
if (customPhrases && customPhrases.length > 0) {
|
|
39770
40030
|
return customPhrases;
|
|
39771
40031
|
}
|
|
39772
40032
|
const translatedPhrases = ta("WITTY_LOADING_PHRASES");
|
|
39773
40033
|
return translatedPhrases.length > 0 ? translatedPhrases : WITTY_LOADING_PHRASES;
|
|
39774
40034
|
}, [customPhrases, currentLanguage]);
|
|
39775
|
-
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0,
|
|
40035
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0, import_react140.useState)(
|
|
39776
40036
|
loadingPhrases[0]
|
|
39777
40037
|
);
|
|
39778
|
-
const phraseIntervalRef = (0,
|
|
39779
|
-
(0,
|
|
40038
|
+
const phraseIntervalRef = (0, import_react140.useRef)(null);
|
|
40039
|
+
(0, import_react140.useEffect)(() => {
|
|
39780
40040
|
if (isWaiting) {
|
|
39781
40041
|
setCurrentLoadingPhrase(t("Waiting for user confirmation..."));
|
|
39782
40042
|
if (phraseIntervalRef.current) {
|
|
@@ -39813,9 +40073,9 @@ var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases
|
|
|
39813
40073
|
}, "usePhraseCycler");
|
|
39814
40074
|
|
|
39815
40075
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
39816
|
-
var
|
|
40076
|
+
var import_react141 = __toESM(require_react(), 1);
|
|
39817
40077
|
var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhrases, currentCandidatesTokens, currentStreamingChars, isToolExecuting2 = false) => {
|
|
39818
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
40078
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react141.useState)(0);
|
|
39819
40079
|
const isTimerActive = streamingState === "responding" /* Responding */;
|
|
39820
40080
|
const elapsedTimeFromTimer = useTimer(
|
|
39821
40081
|
isTimerActive,
|
|
@@ -39829,17 +40089,17 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
39829
40089
|
isWaiting,
|
|
39830
40090
|
customWittyPhrases
|
|
39831
40091
|
);
|
|
39832
|
-
const [retainedElapsedTime, setRetainedElapsedTime] = (0,
|
|
39833
|
-
const [taskStartTokens, setTaskStartTokensState] = (0,
|
|
39834
|
-
const [taskStartStreamingChars, setTaskStartStreamingCharsState] = (0,
|
|
39835
|
-
const taskStartTokensRef = (0,
|
|
39836
|
-
const taskStartStreamingCharsRef = (0,
|
|
39837
|
-
const pauseStartTokensRef = (0,
|
|
39838
|
-
const pauseStartStreamingCharsRef = (0,
|
|
39839
|
-
const pauseBaseTaskStartTokensRef = (0,
|
|
39840
|
-
const pauseBaseTaskStartStreamingCharsRef = (0,
|
|
39841
|
-
const prevStreamingStateRef = (0,
|
|
39842
|
-
(0,
|
|
40092
|
+
const [retainedElapsedTime, setRetainedElapsedTime] = (0, import_react141.useState)(0);
|
|
40093
|
+
const [taskStartTokens, setTaskStartTokensState] = (0, import_react141.useState)(0);
|
|
40094
|
+
const [taskStartStreamingChars, setTaskStartStreamingCharsState] = (0, import_react141.useState)(0);
|
|
40095
|
+
const taskStartTokensRef = (0, import_react141.useRef)(0);
|
|
40096
|
+
const taskStartStreamingCharsRef = (0, import_react141.useRef)(0);
|
|
40097
|
+
const pauseStartTokensRef = (0, import_react141.useRef)(null);
|
|
40098
|
+
const pauseStartStreamingCharsRef = (0, import_react141.useRef)(null);
|
|
40099
|
+
const pauseBaseTaskStartTokensRef = (0, import_react141.useRef)(0);
|
|
40100
|
+
const pauseBaseTaskStartStreamingCharsRef = (0, import_react141.useRef)(0);
|
|
40101
|
+
const prevStreamingStateRef = (0, import_react141.useRef)(null);
|
|
40102
|
+
(0, import_react141.useEffect)(() => {
|
|
39843
40103
|
const currentTokens = currentCandidatesTokens ?? 0;
|
|
39844
40104
|
const currentChars = currentStreamingChars ?? 0;
|
|
39845
40105
|
const setTaskStartTokens = /* @__PURE__ */ __name((tokens) => {
|
|
@@ -39910,7 +40170,7 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
39910
40170
|
|
|
39911
40171
|
// packages/cli/src/ui/hooks/useTerminalProgress.ts
|
|
39912
40172
|
init_esbuild_shims();
|
|
39913
|
-
var
|
|
40173
|
+
var import_react142 = __toESM(require_react(), 1);
|
|
39914
40174
|
var PROGRESS_CLEAR = wrapForMultiplexer(`${OSC_PREFIX}9;4;0;${BEL}`);
|
|
39915
40175
|
var PROGRESS_INDETERMINATE = wrapForMultiplexer(`${OSC_PREFIX}9;4;3;;${BEL}`);
|
|
39916
40176
|
function isProgressBarSupported() {
|
|
@@ -39925,13 +40185,13 @@ function isProgressBarSupported() {
|
|
|
39925
40185
|
__name(isProgressBarSupported, "isProgressBarSupported");
|
|
39926
40186
|
function useTerminalProgress(streamingState, hasToolExecuting) {
|
|
39927
40187
|
const { stdout } = use_stdout_default();
|
|
39928
|
-
const writeProgress = (0,
|
|
40188
|
+
const writeProgress = (0, import_react142.useCallback)(
|
|
39929
40189
|
(seq) => {
|
|
39930
40190
|
stdout?.write(seq);
|
|
39931
40191
|
},
|
|
39932
40192
|
[stdout]
|
|
39933
40193
|
);
|
|
39934
|
-
(0,
|
|
40194
|
+
(0, import_react142.useEffect)(() => {
|
|
39935
40195
|
if (!isProgressBarSupported()) return;
|
|
39936
40196
|
if (streamingState === "responding" /* Responding */ && hasToolExecuting) {
|
|
39937
40197
|
writeProgress(PROGRESS_INDETERMINATE);
|
|
@@ -39942,7 +40202,7 @@ function useTerminalProgress(streamingState, hasToolExecuting) {
|
|
|
39942
40202
|
writeProgress(PROGRESS_CLEAR);
|
|
39943
40203
|
};
|
|
39944
40204
|
}, [streamingState, hasToolExecuting, writeProgress]);
|
|
39945
|
-
(0,
|
|
40205
|
+
(0, import_react142.useEffect)(() => {
|
|
39946
40206
|
if (!isProgressBarSupported()) return;
|
|
39947
40207
|
const clearOnExit = /* @__PURE__ */ __name(() => {
|
|
39948
40208
|
stdout?.write(PROGRESS_CLEAR);
|
|
@@ -39957,20 +40217,20 @@ __name(useTerminalProgress, "useTerminalProgress");
|
|
|
39957
40217
|
|
|
39958
40218
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
39959
40219
|
init_esbuild_shims();
|
|
39960
|
-
var
|
|
40220
|
+
var import_react143 = __toESM(require_react(), 1);
|
|
39961
40221
|
import * as process15 from "node:process";
|
|
39962
40222
|
var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
39963
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
39964
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
39965
|
-
const [isRestarting, setIsRestarting] = (0,
|
|
40223
|
+
const [isTrusted, setIsTrusted] = (0, import_react143.useState)(void 0);
|
|
40224
|
+
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0, import_react143.useState)(false);
|
|
40225
|
+
const [isRestarting, setIsRestarting] = (0, import_react143.useState)(false);
|
|
39966
40226
|
const folderTrust = settings.merged.security?.folderTrust?.enabled;
|
|
39967
|
-
(0,
|
|
40227
|
+
(0, import_react143.useEffect)(() => {
|
|
39968
40228
|
const { isTrusted: trusted } = isWorkspaceTrusted(settings.merged);
|
|
39969
40229
|
setIsTrusted(trusted);
|
|
39970
40230
|
setIsFolderTrustDialogOpen(trusted === void 0);
|
|
39971
40231
|
onTrustChange(trusted);
|
|
39972
40232
|
}, [folderTrust, onTrustChange, settings.merged]);
|
|
39973
|
-
const handleFolderTrustSelect = (0,
|
|
40233
|
+
const handleFolderTrustSelect = (0, import_react143.useCallback)(
|
|
39974
40234
|
(choice) => {
|
|
39975
40235
|
const trustedFolders = loadTrustedFolders();
|
|
39976
40236
|
const cwd3 = process15.cwd();
|
|
@@ -40013,7 +40273,7 @@ var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
|
40013
40273
|
|
|
40014
40274
|
// packages/cli/src/ui/hooks/useMcpApproval.ts
|
|
40015
40275
|
init_esbuild_shims();
|
|
40016
|
-
var
|
|
40276
|
+
var import_react144 = __toESM(require_react(), 1);
|
|
40017
40277
|
function sourceLabel(scope) {
|
|
40018
40278
|
switch (scope) {
|
|
40019
40279
|
case "workspace":
|
|
@@ -40049,8 +40309,8 @@ function summarize(config) {
|
|
|
40049
40309
|
}
|
|
40050
40310
|
__name(summarize, "summarize");
|
|
40051
40311
|
var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
40052
|
-
const [queue, setQueue] = (0,
|
|
40053
|
-
const computePending = (0,
|
|
40312
|
+
const [queue, setQueue] = (0, import_react144.useState)([]);
|
|
40313
|
+
const computePending = (0, import_react144.useCallback)(() => {
|
|
40054
40314
|
if (config.getApprovalMode() === "yolo" /* YOLO */) return [];
|
|
40055
40315
|
const servers = config.getMcpServers() ?? {};
|
|
40056
40316
|
const approvals = loadMcpApprovals();
|
|
@@ -40062,10 +40322,10 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40062
40322
|
source: sourceLabel(c.scope)
|
|
40063
40323
|
}));
|
|
40064
40324
|
}, [config]);
|
|
40065
|
-
(0,
|
|
40325
|
+
(0, import_react144.useEffect)(() => {
|
|
40066
40326
|
setQueue(computePending());
|
|
40067
40327
|
}, [computePending]);
|
|
40068
|
-
(0,
|
|
40328
|
+
(0, import_react144.useEffect)(() => {
|
|
40069
40329
|
const onPendingChanged = /* @__PURE__ */ __name(() => {
|
|
40070
40330
|
setQueue(computePending());
|
|
40071
40331
|
}, "onPendingChanged");
|
|
@@ -40074,7 +40334,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40074
40334
|
appEvents.off("mcp-pending-approval-changed" /* McpPendingApprovalChanged */, onPendingChanged);
|
|
40075
40335
|
};
|
|
40076
40336
|
}, [computePending]);
|
|
40077
|
-
const reconnect = (0,
|
|
40337
|
+
const reconnect = (0, import_react144.useCallback)(
|
|
40078
40338
|
(name) => {
|
|
40079
40339
|
config.approveMcpServerForSession(name);
|
|
40080
40340
|
const registry = config.getToolRegistry();
|
|
@@ -40086,7 +40346,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40086
40346
|
},
|
|
40087
40347
|
[config]
|
|
40088
40348
|
);
|
|
40089
|
-
const handleMcpApprovalSelect = (0,
|
|
40349
|
+
const handleMcpApprovalSelect = (0, import_react144.useCallback)(
|
|
40090
40350
|
async (choice) => {
|
|
40091
40351
|
const approvals = loadMcpApprovals();
|
|
40092
40352
|
const root = config.getWorkingDir();
|
|
@@ -40138,7 +40398,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40138
40398
|
|
|
40139
40399
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
40140
40400
|
init_esbuild_shims();
|
|
40141
|
-
var
|
|
40401
|
+
var import_react145 = __toESM(require_react(), 1);
|
|
40142
40402
|
|
|
40143
40403
|
// packages/cli/src/services/command-migration-tool.ts
|
|
40144
40404
|
init_esbuild_shims();
|
|
@@ -40209,9 +40469,9 @@ __name(migrateTomlCommands, "migrateTomlCommands");
|
|
|
40209
40469
|
|
|
40210
40470
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
40211
40471
|
function useCommandMigration(settings, storage) {
|
|
40212
|
-
const [showMigrationNudge, setShowMigrationNudge] = (0,
|
|
40213
|
-
const [tomlFiles, setTomlFiles] = (0,
|
|
40214
|
-
(0,
|
|
40472
|
+
const [showMigrationNudge, setShowMigrationNudge] = (0, import_react145.useState)(false);
|
|
40473
|
+
const [tomlFiles, setTomlFiles] = (0, import_react145.useState)([]);
|
|
40474
|
+
(0, import_react145.useEffect)(() => {
|
|
40215
40475
|
let cancelled = false;
|
|
40216
40476
|
const checkTomlCommands = /* @__PURE__ */ __name(async () => {
|
|
40217
40477
|
const allFiles = [];
|
|
@@ -40277,81 +40537,12 @@ function sendNotification(opts, terminal, enabled) {
|
|
|
40277
40537
|
}
|
|
40278
40538
|
__name(sendNotification, "sendNotification");
|
|
40279
40539
|
|
|
40280
|
-
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
40281
|
-
init_esbuild_shims();
|
|
40282
|
-
var import_react144 = __toESM(require_react(), 1);
|
|
40283
|
-
function useMessageQueue() {
|
|
40284
|
-
const [queuedMessages, setQueuedMessages] = (0, import_react144.useState)([]);
|
|
40285
|
-
const queueRef = (0, import_react144.useRef)([]);
|
|
40286
|
-
const addMessage = (0, import_react144.useCallback)((message, deferUntilIdle = false) => {
|
|
40287
|
-
const trimmedMessage = message.trim();
|
|
40288
|
-
if (trimmedMessage.length > 0) {
|
|
40289
|
-
queueRef.current = [
|
|
40290
|
-
...queueRef.current,
|
|
40291
|
-
{ text: trimmedMessage, deferUntilIdle }
|
|
40292
|
-
];
|
|
40293
|
-
setQueuedMessages(queueRef.current);
|
|
40294
|
-
}
|
|
40295
|
-
}, []);
|
|
40296
|
-
const clearQueue = (0, import_react144.useCallback)(() => {
|
|
40297
|
-
queueRef.current = [];
|
|
40298
|
-
setQueuedMessages([]);
|
|
40299
|
-
}, []);
|
|
40300
|
-
const getQueuedMessagesText = (0, import_react144.useCallback)(() => {
|
|
40301
|
-
if (queuedMessages.length === 0) return "";
|
|
40302
|
-
return queuedMessages.map(({ text }) => text).join("\n\n");
|
|
40303
|
-
}, [queuedMessages]);
|
|
40304
|
-
const popAllMessages = (0, import_react144.useCallback)(() => {
|
|
40305
|
-
const current = queueRef.current;
|
|
40306
|
-
if (current.length === 0) return null;
|
|
40307
|
-
queueRef.current = [];
|
|
40308
|
-
setQueuedMessages([]);
|
|
40309
|
-
return current.map(({ text }) => text).join("\n\n");
|
|
40310
|
-
}, []);
|
|
40311
|
-
const restoreMessages = (0, import_react144.useCallback)((messages) => {
|
|
40312
|
-
const restored = messages.map((text) => text.trim()).filter(Boolean).map((text) => ({ text, deferUntilIdle: false }));
|
|
40313
|
-
if (restored.length === 0) return;
|
|
40314
|
-
queueRef.current = [...restored, ...queueRef.current];
|
|
40315
|
-
setQueuedMessages(queueRef.current);
|
|
40316
|
-
}, []);
|
|
40317
|
-
const drainQueue = (0, import_react144.useCallback)((includeDeferred = false) => {
|
|
40318
|
-
const current = queueRef.current;
|
|
40319
|
-
if (current.length === 0) return [];
|
|
40320
|
-
const shouldDrain = /* @__PURE__ */ __name((message) => !isSlashCommand(message.text) && (includeDeferred || !message.deferUntilIdle), "shouldDrain");
|
|
40321
|
-
const drained = current.filter(shouldDrain);
|
|
40322
|
-
if (drained.length === 0) return [];
|
|
40323
|
-
const rest = current.filter((message) => !shouldDrain(message));
|
|
40324
|
-
queueRef.current = rest;
|
|
40325
|
-
setQueuedMessages(rest);
|
|
40326
|
-
return drained.map(({ text }) => text);
|
|
40327
|
-
}, []);
|
|
40328
|
-
const popNextSegment = (0, import_react144.useCallback)(() => {
|
|
40329
|
-
const current = queueRef.current;
|
|
40330
|
-
if (current.length === 0) return null;
|
|
40331
|
-
const [head, ...rest] = current;
|
|
40332
|
-
queueRef.current = rest;
|
|
40333
|
-
setQueuedMessages(rest);
|
|
40334
|
-
return head.text;
|
|
40335
|
-
}, []);
|
|
40336
|
-
return {
|
|
40337
|
-
messageQueue: queuedMessages.map(({ text }) => text),
|
|
40338
|
-
addMessage,
|
|
40339
|
-
clearQueue,
|
|
40340
|
-
getQueuedMessagesText,
|
|
40341
|
-
popAllMessages,
|
|
40342
|
-
restoreMessages,
|
|
40343
|
-
drainQueue,
|
|
40344
|
-
popNextSegment
|
|
40345
|
-
};
|
|
40346
|
-
}
|
|
40347
|
-
__name(useMessageQueue, "useMessageQueue");
|
|
40348
|
-
|
|
40349
40540
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
40350
40541
|
init_esbuild_shims();
|
|
40351
|
-
var
|
|
40542
|
+
var import_react146 = __toESM(require_react(), 1);
|
|
40352
40543
|
function useGitBranchName(cwd3) {
|
|
40353
|
-
const [branchName, setBranchName] = (0,
|
|
40354
|
-
(0,
|
|
40544
|
+
const [branchName, setBranchName] = (0, import_react146.useState)(void 0);
|
|
40545
|
+
(0, import_react146.useEffect)(() => {
|
|
40355
40546
|
let cancelled = false;
|
|
40356
40547
|
let dispose;
|
|
40357
40548
|
const refresh = /* @__PURE__ */ __name(async () => {
|
|
@@ -40384,13 +40575,13 @@ __name(useGitBranchName, "useGitBranchName");
|
|
|
40384
40575
|
|
|
40385
40576
|
// packages/cli/src/ui/hooks/useWorktreeSession.ts
|
|
40386
40577
|
init_esbuild_shims();
|
|
40387
|
-
var
|
|
40578
|
+
var import_react147 = __toESM(require_react(), 1);
|
|
40388
40579
|
import fs19 from "node:fs";
|
|
40389
40580
|
import fsPromises from "node:fs/promises";
|
|
40390
40581
|
import path14 from "node:path";
|
|
40391
40582
|
function useWorktreeSession(config) {
|
|
40392
|
-
const [session, setSession] = (0,
|
|
40393
|
-
(0,
|
|
40583
|
+
const [session, setSession] = (0, import_react147.useState)(null);
|
|
40584
|
+
(0, import_react147.useEffect)(() => {
|
|
40394
40585
|
let cancelled = false;
|
|
40395
40586
|
const safeLoad = /* @__PURE__ */ __name(async () => {
|
|
40396
40587
|
try {
|
|
@@ -40430,7 +40621,7 @@ __name(useWorktreeSession, "useWorktreeSession");
|
|
|
40430
40621
|
|
|
40431
40622
|
// packages/cli/src/ui/hooks/useExtensionUpdates.ts
|
|
40432
40623
|
init_esbuild_shims();
|
|
40433
|
-
var
|
|
40624
|
+
var import_react148 = __toESM(require_react(), 1);
|
|
40434
40625
|
function confirmationRequestsReducer(state, action) {
|
|
40435
40626
|
switch (action.type) {
|
|
40436
40627
|
case "add":
|
|
@@ -40447,8 +40638,8 @@ var useConfirmUpdateRequests = /* @__PURE__ */ __name(() => {
|
|
|
40447
40638
|
const [
|
|
40448
40639
|
confirmUpdateExtensionRequests,
|
|
40449
40640
|
dispatchConfirmUpdateExtensionRequests
|
|
40450
|
-
] = (0,
|
|
40451
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
40641
|
+
] = (0, import_react148.useReducer)(confirmationRequestsReducer, []);
|
|
40642
|
+
const addConfirmUpdateExtensionRequest = (0, import_react148.useCallback)(
|
|
40452
40643
|
(original) => {
|
|
40453
40644
|
const wrappedRequest = {
|
|
40454
40645
|
prompt: original.prompt,
|
|
@@ -40486,11 +40677,11 @@ function settingInputRequestsReducer(state, action) {
|
|
|
40486
40677
|
}
|
|
40487
40678
|
__name(settingInputRequestsReducer, "settingInputRequestsReducer");
|
|
40488
40679
|
var useSettingInputRequests = /* @__PURE__ */ __name(() => {
|
|
40489
|
-
const [settingInputRequests, dispatchSettingInputRequests] = (0,
|
|
40680
|
+
const [settingInputRequests, dispatchSettingInputRequests] = (0, import_react148.useReducer)(
|
|
40490
40681
|
settingInputRequestsReducer,
|
|
40491
40682
|
[]
|
|
40492
40683
|
);
|
|
40493
|
-
const addSettingInputRequest = (0,
|
|
40684
|
+
const addSettingInputRequest = (0, import_react148.useCallback)(
|
|
40494
40685
|
(original) => {
|
|
40495
40686
|
const wrappedRequest = {
|
|
40496
40687
|
settingName: original.settingName,
|
|
@@ -40537,11 +40728,11 @@ function pluginChoiceRequestsReducer(state, action) {
|
|
|
40537
40728
|
}
|
|
40538
40729
|
__name(pluginChoiceRequestsReducer, "pluginChoiceRequestsReducer");
|
|
40539
40730
|
var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
40540
|
-
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0,
|
|
40731
|
+
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0, import_react148.useReducer)(
|
|
40541
40732
|
pluginChoiceRequestsReducer,
|
|
40542
40733
|
[]
|
|
40543
40734
|
);
|
|
40544
|
-
const addPluginChoiceRequest = (0,
|
|
40735
|
+
const addPluginChoiceRequest = (0, import_react148.useCallback)(
|
|
40545
40736
|
(original) => {
|
|
40546
40737
|
const wrappedRequest = {
|
|
40547
40738
|
marketplaceName: original.marketplaceName,
|
|
@@ -40575,12 +40766,12 @@ var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
|
40575
40766
|
};
|
|
40576
40767
|
}, "usePluginChoiceRequests");
|
|
40577
40768
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd3) => {
|
|
40578
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
40769
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react148.useReducer)(
|
|
40579
40770
|
extensionUpdatesReducer,
|
|
40580
40771
|
initialExtensionUpdatesState
|
|
40581
40772
|
);
|
|
40582
40773
|
const extensions = extensionManager.getLoadedExtensions();
|
|
40583
|
-
(0,
|
|
40774
|
+
(0, import_react148.useEffect)(() => {
|
|
40584
40775
|
(async () => {
|
|
40585
40776
|
const extensionsToCheck = extensions.filter((extension) => {
|
|
40586
40777
|
const currentStatus = extensionsUpdateState.extensionStatuses.get(
|
|
@@ -40608,7 +40799,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
40608
40799
|
extensionsUpdateState.extensionStatuses,
|
|
40609
40800
|
dispatchExtensionStateUpdate
|
|
40610
40801
|
]);
|
|
40611
|
-
(0,
|
|
40802
|
+
(0, import_react148.useEffect)(() => {
|
|
40612
40803
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
40613
40804
|
return;
|
|
40614
40805
|
}
|
|
@@ -40677,7 +40868,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
40677
40868
|
);
|
|
40678
40869
|
}
|
|
40679
40870
|
}, [extensions, extensionManager, extensionsUpdateState, addItem, cwd3]);
|
|
40680
|
-
const extensionsUpdateStateComputed = (0,
|
|
40871
|
+
const extensionsUpdateStateComputed = (0, import_react148.useMemo)(() => {
|
|
40681
40872
|
const result = /* @__PURE__ */ new Map();
|
|
40682
40873
|
for (const [
|
|
40683
40874
|
key,
|
|
@@ -40696,11 +40887,11 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
40696
40887
|
|
|
40697
40888
|
// packages/cli/src/ui/components/TranscriptView.tsx
|
|
40698
40889
|
init_esbuild_shims();
|
|
40699
|
-
var
|
|
40890
|
+
var import_react151 = __toESM(require_react(), 1);
|
|
40700
40891
|
|
|
40701
40892
|
// packages/cli/src/ui/components/AlternateScreen.tsx
|
|
40702
40893
|
init_esbuild_shims();
|
|
40703
|
-
var
|
|
40894
|
+
var import_react149 = __toESM(require_react(), 1);
|
|
40704
40895
|
var import_jsx_runtime132 = __toESM(require_jsx_runtime(), 1);
|
|
40705
40896
|
var ENTER_ALT_SCREEN = "\x1B[?1049h";
|
|
40706
40897
|
var EXIT_ALT_SCREEN = "\x1B[?1049l";
|
|
@@ -40713,7 +40904,7 @@ var AlternateScreen = /* @__PURE__ */ __name(({
|
|
|
40713
40904
|
}) => {
|
|
40714
40905
|
const writeRaw = useTerminalOutput();
|
|
40715
40906
|
const { rows } = useTerminalSize();
|
|
40716
|
-
(0,
|
|
40907
|
+
(0, import_react149.useEffect)(() => {
|
|
40717
40908
|
if (disabled || !process.stdout.isTTY) return;
|
|
40718
40909
|
const safeWrite = /* @__PURE__ */ __name((data) => {
|
|
40719
40910
|
try {
|
|
@@ -40734,9 +40925,9 @@ var AlternateScreen = /* @__PURE__ */ __name(({
|
|
|
40734
40925
|
|
|
40735
40926
|
// packages/cli/src/ui/components/shared/ErrorBoundary.tsx
|
|
40736
40927
|
init_esbuild_shims();
|
|
40737
|
-
var
|
|
40928
|
+
var import_react150 = __toESM(require_react(), 1);
|
|
40738
40929
|
var import_jsx_runtime133 = __toESM(require_jsx_runtime(), 1);
|
|
40739
|
-
var ErrorBoundary = class extends
|
|
40930
|
+
var ErrorBoundary = class extends import_react150.Component {
|
|
40740
40931
|
static {
|
|
40741
40932
|
__name(this, "ErrorBoundary");
|
|
40742
40933
|
}
|
|
@@ -40795,11 +40986,11 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
40795
40986
|
const headerHeight = 1;
|
|
40796
40987
|
const footerHeight = 1;
|
|
40797
40988
|
const contentHeight = Math.max(rows - headerHeight - footerHeight, 1);
|
|
40798
|
-
const estimatedItemHeight = (0,
|
|
40989
|
+
const estimatedItemHeight = (0, import_react151.useCallback)(
|
|
40799
40990
|
(index) => estimateTranscriptItemHeight(items[index]),
|
|
40800
40991
|
[items]
|
|
40801
40992
|
);
|
|
40802
|
-
const renderItem = (0,
|
|
40993
|
+
const renderItem = (0, import_react151.useCallback)(
|
|
40803
40994
|
({ item }) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
40804
40995
|
HistoryItemDisplay,
|
|
40805
40996
|
{
|
|
@@ -40812,7 +41003,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
40812
41003
|
[columns]
|
|
40813
41004
|
);
|
|
40814
41005
|
const title = t("Transcript");
|
|
40815
|
-
const content = (0,
|
|
41006
|
+
const content = (0, import_react151.useMemo)(
|
|
40816
41007
|
() => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(OverflowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
40817
41008
|
ScrollableListWithForwardRef,
|
|
40818
41009
|
{
|
|
@@ -40827,7 +41018,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
40827
41018
|
) }),
|
|
40828
41019
|
[items, renderItem, estimatedItemHeight, contentHeight]
|
|
40829
41020
|
);
|
|
40830
|
-
const errorFallback = (0,
|
|
41021
|
+
const errorFallback = (0, import_react151.useCallback)(
|
|
40831
41022
|
(error) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [
|
|
40832
41023
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text, { color: theme.status.error, bold: true, children: t("Failed to render transcript.") }),
|
|
40833
41024
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text, { color: theme.text.secondary, children: sanitizeTerminalText(error.message) }),
|
|
@@ -40838,7 +41029,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
40838
41029
|
] }),
|
|
40839
41030
|
[]
|
|
40840
41031
|
);
|
|
40841
|
-
const onRenderError = (0,
|
|
41032
|
+
const onRenderError = (0, import_react151.useCallback)((error, info) => {
|
|
40842
41033
|
debugLogger39.error(
|
|
40843
41034
|
`render error: ${error.message}`,
|
|
40844
41035
|
info.componentStack ?? ""
|
|
@@ -40862,19 +41053,19 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
40862
41053
|
] }) })
|
|
40863
41054
|
] }) });
|
|
40864
41055
|
}, "TranscriptViewImpl");
|
|
40865
|
-
var TranscriptView = (0,
|
|
41056
|
+
var TranscriptView = (0, import_react151.memo)(TranscriptViewImpl);
|
|
40866
41057
|
TranscriptView.displayName = "TranscriptView";
|
|
40867
41058
|
|
|
40868
41059
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
40869
41060
|
init_esbuild_shims();
|
|
40870
|
-
var
|
|
41061
|
+
var import_react152 = __toESM(require_react(), 1);
|
|
40871
41062
|
function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
40872
|
-
const [welcomeBackInfo, setWelcomeBackInfo] = (0,
|
|
40873
|
-
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0,
|
|
40874
|
-
const [welcomeBackChoice, setWelcomeBackChoice] = (0,
|
|
40875
|
-
const [shouldFillInput, setShouldFillInput] = (0,
|
|
40876
|
-
const [inputFillText, setInputFillText] = (0,
|
|
40877
|
-
const checkWelcomeBack = (0,
|
|
41063
|
+
const [welcomeBackInfo, setWelcomeBackInfo] = (0, import_react152.useState)(null);
|
|
41064
|
+
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0, import_react152.useState)(false);
|
|
41065
|
+
const [welcomeBackChoice, setWelcomeBackChoice] = (0, import_react152.useState)(null);
|
|
41066
|
+
const [shouldFillInput, setShouldFillInput] = (0, import_react152.useState)(false);
|
|
41067
|
+
const [inputFillText, setInputFillText] = (0, import_react152.useState)(null);
|
|
41068
|
+
const checkWelcomeBack = (0, import_react152.useCallback)(async () => {
|
|
40878
41069
|
if (settings.ui?.enableWelcomeBack === false) {
|
|
40879
41070
|
return;
|
|
40880
41071
|
}
|
|
@@ -40893,7 +41084,7 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
40893
41084
|
config.getDebugLogger().debug("Welcome back check failed:", error);
|
|
40894
41085
|
}
|
|
40895
41086
|
}, [config, settings.ui?.enableWelcomeBack]);
|
|
40896
|
-
const handleWelcomeBackSelection = (0,
|
|
41087
|
+
const handleWelcomeBackSelection = (0, import_react152.useCallback)(
|
|
40897
41088
|
(choice) => {
|
|
40898
41089
|
setWelcomeBackChoice(choice);
|
|
40899
41090
|
setShowWelcomeBackDialog(false);
|
|
@@ -40917,21 +41108,21 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
40917
41108
|
},
|
|
40918
41109
|
[config, welcomeBackInfo]
|
|
40919
41110
|
);
|
|
40920
|
-
const handleWelcomeBackClose = (0,
|
|
41111
|
+
const handleWelcomeBackClose = (0, import_react152.useCallback)(() => {
|
|
40921
41112
|
setWelcomeBackChoice("restart");
|
|
40922
41113
|
setShowWelcomeBackDialog(false);
|
|
40923
41114
|
}, []);
|
|
40924
|
-
const clearInputFill = (0,
|
|
41115
|
+
const clearInputFill = (0, import_react152.useCallback)(() => {
|
|
40925
41116
|
setShouldFillInput(false);
|
|
40926
41117
|
setInputFillText(null);
|
|
40927
41118
|
}, []);
|
|
40928
|
-
(0,
|
|
41119
|
+
(0, import_react152.useEffect)(() => {
|
|
40929
41120
|
if (shouldFillInput && inputFillText) {
|
|
40930
41121
|
buffer.setText(inputFillText);
|
|
40931
41122
|
clearInputFill();
|
|
40932
41123
|
}
|
|
40933
41124
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
40934
|
-
(0,
|
|
41125
|
+
(0, import_react152.useEffect)(() => {
|
|
40935
41126
|
checkWelcomeBack();
|
|
40936
41127
|
}, [checkWelcomeBack]);
|
|
40937
41128
|
return {
|
|
@@ -40952,9 +41143,9 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
40952
41143
|
|
|
40953
41144
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
40954
41145
|
init_esbuild_shims();
|
|
40955
|
-
var
|
|
41146
|
+
var import_react153 = __toESM(require_react(), 1);
|
|
40956
41147
|
function useDialogClose(options) {
|
|
40957
|
-
const closeAnyOpenDialog = (0,
|
|
41148
|
+
const closeAnyOpenDialog = (0, import_react153.useCallback)(() => {
|
|
40958
41149
|
if (options.isThemeDialogOpen) {
|
|
40959
41150
|
options.handleThemeSelect(void 0, "User" /* User */);
|
|
40960
41151
|
return true;
|
|
@@ -41026,14 +41217,14 @@ __name(useDialogClose, "useDialogClose");
|
|
|
41026
41217
|
|
|
41027
41218
|
// packages/cli/src/ui/hooks/useInitializationAuthError.ts
|
|
41028
41219
|
init_esbuild_shims();
|
|
41029
|
-
var
|
|
41220
|
+
var import_react154 = __toESM(require_react(), 1);
|
|
41030
41221
|
var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError) => {
|
|
41031
|
-
const hasHandled = (0,
|
|
41032
|
-
const authErrorRef = (0,
|
|
41033
|
-
const onAuthErrorRef = (0,
|
|
41222
|
+
const hasHandled = (0, import_react154.useRef)(false);
|
|
41223
|
+
const authErrorRef = (0, import_react154.useRef)(authError);
|
|
41224
|
+
const onAuthErrorRef = (0, import_react154.useRef)(onAuthError);
|
|
41034
41225
|
authErrorRef.current = authError;
|
|
41035
41226
|
onAuthErrorRef.current = onAuthError;
|
|
41036
|
-
(0,
|
|
41227
|
+
(0, import_react154.useEffect)(() => {
|
|
41037
41228
|
if (hasHandled.current) {
|
|
41038
41229
|
return;
|
|
41039
41230
|
}
|
|
@@ -41046,13 +41237,13 @@ var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError)
|
|
|
41046
41237
|
|
|
41047
41238
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
41048
41239
|
init_esbuild_shims();
|
|
41049
|
-
var
|
|
41240
|
+
var import_react155 = __toESM(require_react(), 1);
|
|
41050
41241
|
function useSubagentCreateDialog() {
|
|
41051
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
41052
|
-
const openSubagentCreateDialog = (0,
|
|
41242
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react155.useState)(false);
|
|
41243
|
+
const openSubagentCreateDialog = (0, import_react155.useCallback)(() => {
|
|
41053
41244
|
setIsSubagentCreateDialogOpen(true);
|
|
41054
41245
|
}, []);
|
|
41055
|
-
const closeSubagentCreateDialog = (0,
|
|
41246
|
+
const closeSubagentCreateDialog = (0, import_react155.useCallback)(() => {
|
|
41056
41247
|
setIsSubagentCreateDialogOpen(false);
|
|
41057
41248
|
}, []);
|
|
41058
41249
|
return {
|
|
@@ -41065,13 +41256,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
41065
41256
|
|
|
41066
41257
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
41067
41258
|
init_esbuild_shims();
|
|
41068
|
-
var
|
|
41259
|
+
var import_react156 = __toESM(require_react(), 1);
|
|
41069
41260
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41070
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
41071
|
-
const openAgentsManagerDialog = (0,
|
|
41261
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react156.useState)(false);
|
|
41262
|
+
const openAgentsManagerDialog = (0, import_react156.useCallback)(() => {
|
|
41072
41263
|
setIsAgentsManagerDialogOpen(true);
|
|
41073
41264
|
}, []);
|
|
41074
|
-
const closeAgentsManagerDialog = (0,
|
|
41265
|
+
const closeAgentsManagerDialog = (0, import_react156.useCallback)(() => {
|
|
41075
41266
|
setIsAgentsManagerDialogOpen(false);
|
|
41076
41267
|
}, []);
|
|
41077
41268
|
return {
|
|
@@ -41083,13 +41274,13 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41083
41274
|
|
|
41084
41275
|
// packages/cli/src/ui/hooks/useSkillsManagerDialog.ts
|
|
41085
41276
|
init_esbuild_shims();
|
|
41086
|
-
var
|
|
41277
|
+
var import_react157 = __toESM(require_react(), 1);
|
|
41087
41278
|
var useSkillsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41088
|
-
const [isSkillsManagerDialogOpen, setIsSkillsManagerDialogOpen] = (0,
|
|
41089
|
-
const openSkillsManagerDialog = (0,
|
|
41279
|
+
const [isSkillsManagerDialogOpen, setIsSkillsManagerDialogOpen] = (0, import_react157.useState)(false);
|
|
41280
|
+
const openSkillsManagerDialog = (0, import_react157.useCallback)(() => {
|
|
41090
41281
|
setIsSkillsManagerDialogOpen(true);
|
|
41091
41282
|
}, []);
|
|
41092
|
-
const closeSkillsManagerDialog = (0,
|
|
41283
|
+
const closeSkillsManagerDialog = (0, import_react157.useCallback)(() => {
|
|
41093
41284
|
setIsSkillsManagerDialogOpen(false);
|
|
41094
41285
|
}, []);
|
|
41095
41286
|
return {
|
|
@@ -41101,13 +41292,13 @@ var useSkillsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41101
41292
|
|
|
41102
41293
|
// packages/cli/src/ui/hooks/useExtensionsManagerDialog.ts
|
|
41103
41294
|
init_esbuild_shims();
|
|
41104
|
-
var
|
|
41295
|
+
var import_react158 = __toESM(require_react(), 1);
|
|
41105
41296
|
var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41106
|
-
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0,
|
|
41107
|
-
const openExtensionsManagerDialog = (0,
|
|
41297
|
+
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0, import_react158.useState)(false);
|
|
41298
|
+
const openExtensionsManagerDialog = (0, import_react158.useCallback)(() => {
|
|
41108
41299
|
setIsExtensionsManagerDialogOpen(true);
|
|
41109
41300
|
}, []);
|
|
41110
|
-
const closeExtensionsManagerDialog = (0,
|
|
41301
|
+
const closeExtensionsManagerDialog = (0, import_react158.useCallback)(() => {
|
|
41111
41302
|
setIsExtensionsManagerDialogOpen(false);
|
|
41112
41303
|
}, []);
|
|
41113
41304
|
return {
|
|
@@ -41119,13 +41310,13 @@ var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41119
41310
|
|
|
41120
41311
|
// packages/cli/src/ui/hooks/useMcpDialog.ts
|
|
41121
41312
|
init_esbuild_shims();
|
|
41122
|
-
var
|
|
41313
|
+
var import_react159 = __toESM(require_react(), 1);
|
|
41123
41314
|
var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
41124
|
-
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0,
|
|
41125
|
-
const openMcpDialog = (0,
|
|
41315
|
+
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0, import_react159.useState)(false);
|
|
41316
|
+
const openMcpDialog = (0, import_react159.useCallback)(() => {
|
|
41126
41317
|
setIsMcpDialogOpen(true);
|
|
41127
41318
|
}, []);
|
|
41128
|
-
const closeMcpDialog = (0,
|
|
41319
|
+
const closeMcpDialog = (0, import_react159.useCallback)(() => {
|
|
41129
41320
|
setIsMcpDialogOpen(false);
|
|
41130
41321
|
}, []);
|
|
41131
41322
|
return {
|
|
@@ -41137,13 +41328,13 @@ var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
|
41137
41328
|
|
|
41138
41329
|
// packages/cli/src/ui/hooks/useHooksDialog.ts
|
|
41139
41330
|
init_esbuild_shims();
|
|
41140
|
-
var
|
|
41331
|
+
var import_react160 = __toESM(require_react(), 1);
|
|
41141
41332
|
var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
41142
|
-
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0,
|
|
41143
|
-
const openHooksDialog = (0,
|
|
41333
|
+
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0, import_react160.useState)(false);
|
|
41334
|
+
const openHooksDialog = (0, import_react160.useCallback)(() => {
|
|
41144
41335
|
setIsHooksDialogOpen(true);
|
|
41145
41336
|
}, []);
|
|
41146
|
-
const closeHooksDialog = (0,
|
|
41337
|
+
const closeHooksDialog = (0, import_react160.useCallback)(() => {
|
|
41147
41338
|
setIsHooksDialogOpen(false);
|
|
41148
41339
|
}, []);
|
|
41149
41340
|
return {
|
|
@@ -41155,23 +41346,23 @@ var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
|
41155
41346
|
|
|
41156
41347
|
// packages/cli/src/ui/hooks/useStatsDialog.ts
|
|
41157
41348
|
init_esbuild_shims();
|
|
41158
|
-
var
|
|
41349
|
+
var import_react161 = __toESM(require_react(), 1);
|
|
41159
41350
|
var useStatsDialog = /* @__PURE__ */ __name(() => {
|
|
41160
|
-
const [isStatsDialogOpen, setIsStatsDialogOpen] = (0,
|
|
41161
|
-
const openStatsDialog = (0,
|
|
41162
|
-
const closeStatsDialog = (0,
|
|
41351
|
+
const [isStatsDialogOpen, setIsStatsDialogOpen] = (0, import_react161.useState)(false);
|
|
41352
|
+
const openStatsDialog = (0, import_react161.useCallback)(() => setIsStatsDialogOpen(true), []);
|
|
41353
|
+
const closeStatsDialog = (0, import_react161.useCallback)(() => setIsStatsDialogOpen(false), []);
|
|
41163
41354
|
return { isStatsDialogOpen, openStatsDialog, closeStatsDialog };
|
|
41164
41355
|
}, "useStatsDialog");
|
|
41165
41356
|
|
|
41166
41357
|
// packages/cli/src/ui/hooks/useMemoryDialog.ts
|
|
41167
41358
|
init_esbuild_shims();
|
|
41168
|
-
var
|
|
41359
|
+
var import_react162 = __toESM(require_react(), 1);
|
|
41169
41360
|
var useMemoryDialog = /* @__PURE__ */ __name(() => {
|
|
41170
|
-
const [isMemoryDialogOpen, setIsMemoryDialogOpen] = (0,
|
|
41171
|
-
const openMemoryDialog = (0,
|
|
41361
|
+
const [isMemoryDialogOpen, setIsMemoryDialogOpen] = (0, import_react162.useState)(false);
|
|
41362
|
+
const openMemoryDialog = (0, import_react162.useCallback)(() => {
|
|
41172
41363
|
setIsMemoryDialogOpen(true);
|
|
41173
41364
|
}, []);
|
|
41174
|
-
const closeMemoryDialog = (0,
|
|
41365
|
+
const closeMemoryDialog = (0, import_react162.useCallback)(() => {
|
|
41175
41366
|
setIsMemoryDialogOpen(false);
|
|
41176
41367
|
}, []);
|
|
41177
41368
|
return {
|
|
@@ -41183,7 +41374,7 @@ var useMemoryDialog = /* @__PURE__ */ __name(() => {
|
|
|
41183
41374
|
|
|
41184
41375
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
41185
41376
|
init_esbuild_shims();
|
|
41186
|
-
var
|
|
41377
|
+
var import_react163 = __toESM(require_react(), 1);
|
|
41187
41378
|
var LONG_TASK_NOTIFICATION_THRESHOLD_SECONDS = 20;
|
|
41188
41379
|
var NOTIFICATION_TITLE = "Qwen Code";
|
|
41189
41380
|
var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
@@ -41198,16 +41389,16 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
41198
41389
|
const terminalBellEnabled = settings?.merged?.general?.terminalBell ?? true;
|
|
41199
41390
|
const notificationMode = settings?.merged?.general?.notificationMode === "task-complete" ? "task-complete" : "all";
|
|
41200
41391
|
const approvalNotificationsEnabled = notificationMode === "all";
|
|
41201
|
-
const awaitingNotificationSentRef = (0,
|
|
41202
|
-
const respondingElapsedRef = (0,
|
|
41203
|
-
const idleNotificationSentRef = (0,
|
|
41204
|
-
const awaitingToolName = (0,
|
|
41392
|
+
const awaitingNotificationSentRef = (0, import_react163.useRef)(false);
|
|
41393
|
+
const respondingElapsedRef = (0, import_react163.useRef)(0);
|
|
41394
|
+
const idleNotificationSentRef = (0, import_react163.useRef)(false);
|
|
41395
|
+
const awaitingToolName = (0, import_react163.useMemo)(() => {
|
|
41205
41396
|
const awaitingTool = pendingToolCalls?.find(
|
|
41206
41397
|
(tc) => tc.status === "awaiting_approval"
|
|
41207
41398
|
);
|
|
41208
41399
|
return awaitingTool?.request.name;
|
|
41209
41400
|
}, [pendingToolCalls]);
|
|
41210
|
-
(0,
|
|
41401
|
+
(0, import_react163.useEffect)(() => {
|
|
41211
41402
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current && terminalBellEnabled && approvalNotificationsEnabled) {
|
|
41212
41403
|
const message = awaitingToolName ? `Qwen Code needs your permission to use ${awaitingToolName}` : "Qwen Code is waiting for your input";
|
|
41213
41404
|
sendNotification(
|
|
@@ -41228,7 +41419,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
41228
41419
|
terminal,
|
|
41229
41420
|
awaitingToolName
|
|
41230
41421
|
]);
|
|
41231
|
-
(0,
|
|
41422
|
+
(0, import_react163.useEffect)(() => {
|
|
41232
41423
|
if (streamingState === "responding" /* Responding */) {
|
|
41233
41424
|
respondingElapsedRef.current = elapsedTime;
|
|
41234
41425
|
idleNotificationSentRef.current = false;
|
|
@@ -41381,7 +41572,7 @@ __name(buildTerminalNotification, "buildTerminalNotification");
|
|
|
41381
41572
|
|
|
41382
41573
|
// packages/cli/src/ui/hooks/useContextualTips.ts
|
|
41383
41574
|
init_esbuild_shims();
|
|
41384
|
-
var
|
|
41575
|
+
var import_react164 = __toESM(require_react(), 1);
|
|
41385
41576
|
function useContextualTips({
|
|
41386
41577
|
streamingState,
|
|
41387
41578
|
lastPromptTokenCount,
|
|
@@ -41391,9 +41582,9 @@ function useContextualTips({
|
|
|
41391
41582
|
addItem,
|
|
41392
41583
|
hideTips
|
|
41393
41584
|
}) {
|
|
41394
|
-
const prevStreamingState = (0,
|
|
41395
|
-
const hadResponsePhase = (0,
|
|
41396
|
-
(0,
|
|
41585
|
+
const prevStreamingState = (0, import_react164.useRef)("idle" /* Idle */);
|
|
41586
|
+
const hadResponsePhase = (0, import_react164.useRef)(false);
|
|
41587
|
+
(0, import_react164.useEffect)(() => {
|
|
41397
41588
|
if (streamingState === "responding" /* Responding */ || prevStreamingState.current === "responding" /* Responding */ && streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */) {
|
|
41398
41589
|
hadResponsePhase.current = true;
|
|
41399
41590
|
}
|
|
@@ -41529,7 +41720,7 @@ function getResponseCandidateTokens(pendingGeminiHistoryItems) {
|
|
|
41529
41720
|
__name(getResponseCandidateTokens, "getResponseCandidateTokens");
|
|
41530
41721
|
function useStableStickyTodos(todos) {
|
|
41531
41722
|
const renderKey = getStickyTodosRenderKey(todos);
|
|
41532
|
-
const stableTodosRef = (0,
|
|
41723
|
+
const stableTodosRef = (0, import_react165.useRef)(null);
|
|
41533
41724
|
if (stableTodosRef.current?.renderKey !== renderKey) {
|
|
41534
41725
|
stableTodosRef.current = { renderKey, todos };
|
|
41535
41726
|
}
|
|
@@ -41560,29 +41751,29 @@ var SHELL_WIDTH_FRACTION = 0.89;
|
|
|
41560
41751
|
var SHELL_HEIGHT_PADDING = 10;
|
|
41561
41752
|
var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
41562
41753
|
const { settings, config, initializationResult } = props;
|
|
41563
|
-
const extensionRefreshState = (0,
|
|
41754
|
+
const extensionRefreshState = (0, import_react165.useMemo)(
|
|
41564
41755
|
() => props.extensionRefreshState ?? new ExtensionRefreshState(),
|
|
41565
41756
|
[props.extensionRefreshState]
|
|
41566
41757
|
);
|
|
41567
41758
|
const historyManager = useHistory();
|
|
41568
|
-
const historyRef = (0,
|
|
41759
|
+
const historyRef = (0, import_react165.useRef)(historyManager.history);
|
|
41569
41760
|
historyRef.current = historyManager.history;
|
|
41570
41761
|
useMemoryMonitor(historyManager);
|
|
41571
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
41572
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
41573
|
-
const [themeError, setThemeError] = (0,
|
|
41762
|
+
const [debugMessage, setDebugMessage] = (0, import_react165.useState)("");
|
|
41763
|
+
const [quittingMessages, setQuittingMessages] = (0, import_react165.useState)(null);
|
|
41764
|
+
const [themeError, setThemeError] = (0, import_react165.useState)(
|
|
41574
41765
|
initializationResult.themeError
|
|
41575
41766
|
);
|
|
41576
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
41577
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
41578
|
-
const [geminiMdFileCount, setGeminiMdFileCount] = (0,
|
|
41767
|
+
const [isProcessing, setIsProcessing] = (0, import_react165.useState)(false);
|
|
41768
|
+
const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react165.useState)(false);
|
|
41769
|
+
const [geminiMdFileCount, setGeminiMdFileCount] = (0, import_react165.useState)(
|
|
41579
41770
|
initializationResult.geminiMdFileCount
|
|
41580
41771
|
);
|
|
41581
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
41582
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
41583
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
41584
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
41585
|
-
const [isTrustedFolder, setIsTrustedFolder] = (0,
|
|
41772
|
+
const [shellModeActive, setShellModeActive] = (0, import_react165.useState)(false);
|
|
41773
|
+
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react165.useState)(false);
|
|
41774
|
+
const [historyRemountKey, setHistoryRemountKey] = (0, import_react165.useState)(0);
|
|
41775
|
+
const [updateInfo, setUpdateInfo] = (0, import_react165.useState)(null);
|
|
41776
|
+
const [isTrustedFolder, setIsTrustedFolder] = (0, import_react165.useState)(
|
|
41586
41777
|
config.isTrustedFolder()
|
|
41587
41778
|
);
|
|
41588
41779
|
const extensionManager = config.getExtensionManager();
|
|
@@ -41641,31 +41832,31 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41641
41832
|
config,
|
|
41642
41833
|
historyManager.addItem
|
|
41643
41834
|
);
|
|
41644
|
-
const [isTrustDialogOpen, setTrustDialogOpen] = (0,
|
|
41645
|
-
const openTrustDialog = (0,
|
|
41646
|
-
const closeTrustDialog = (0,
|
|
41647
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
41648
|
-
const openPermissionsDialog = (0,
|
|
41835
|
+
const [isTrustDialogOpen, setTrustDialogOpen] = (0, import_react165.useState)(false);
|
|
41836
|
+
const openTrustDialog = (0, import_react165.useCallback)(() => setTrustDialogOpen(true), []);
|
|
41837
|
+
const closeTrustDialog = (0, import_react165.useCallback)(() => setTrustDialogOpen(false), []);
|
|
41838
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react165.useState)(false);
|
|
41839
|
+
const openPermissionsDialog = (0, import_react165.useCallback)(
|
|
41649
41840
|
() => setPermissionsDialogOpen(true),
|
|
41650
41841
|
[]
|
|
41651
41842
|
);
|
|
41652
|
-
const closePermissionsDialog = (0,
|
|
41843
|
+
const closePermissionsDialog = (0, import_react165.useCallback)(
|
|
41653
41844
|
() => setPermissionsDialogOpen(false),
|
|
41654
41845
|
[]
|
|
41655
41846
|
);
|
|
41656
|
-
const [currentModel, setCurrentModel] = (0,
|
|
41657
|
-
const [isConfigInitialized, setConfigInitialized] = (0,
|
|
41658
|
-
const [userMessages, setUserMessages] = (0,
|
|
41659
|
-
const [transcriptFreeze, setTranscriptFreeze] = (0,
|
|
41847
|
+
const [currentModel, setCurrentModel] = (0, import_react165.useState)(() => config.getModel());
|
|
41848
|
+
const [isConfigInitialized, setConfigInitialized] = (0, import_react165.useState)(false);
|
|
41849
|
+
const [userMessages, setUserMessages] = (0, import_react165.useState)([]);
|
|
41850
|
+
const [transcriptFreeze, setTranscriptFreeze] = (0, import_react165.useState)(null);
|
|
41660
41851
|
const isTranscriptOpen = transcriptFreeze != null;
|
|
41661
|
-
const isTranscriptOpenRef = (0,
|
|
41852
|
+
const isTranscriptOpenRef = (0, import_react165.useRef)(isTranscriptOpen);
|
|
41662
41853
|
isTranscriptOpenRef.current = isTranscriptOpen;
|
|
41663
|
-
const closeTranscript = (0,
|
|
41854
|
+
const closeTranscript = (0, import_react165.useCallback)(() => {
|
|
41664
41855
|
setTranscriptFreeze(null);
|
|
41665
41856
|
}, []);
|
|
41666
|
-
const [thoughtExpanded, setThoughtExpanded] = (0,
|
|
41667
|
-
const [expandedThoughtHeadIds, setExpandedThoughtHeadIds] = (0,
|
|
41668
|
-
const toggleThoughtExpanded = (0,
|
|
41857
|
+
const [thoughtExpanded, setThoughtExpanded] = (0, import_react165.useState)(false);
|
|
41858
|
+
const [expandedThoughtHeadIds, setExpandedThoughtHeadIds] = (0, import_react165.useState)(() => /* @__PURE__ */ new Set());
|
|
41859
|
+
const toggleThoughtExpanded = (0, import_react165.useCallback)((headId) => {
|
|
41669
41860
|
setExpandedThoughtHeadIds((prev) => {
|
|
41670
41861
|
const next = new Set(prev);
|
|
41671
41862
|
if (next.has(headId)) {
|
|
@@ -41679,10 +41870,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41679
41870
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
41680
41871
|
const { stdin, setRawMode } = use_stdin_default();
|
|
41681
41872
|
const { stdout } = use_stdout_default();
|
|
41682
|
-
const writeRaw = (0,
|
|
41873
|
+
const writeRaw = (0, import_react165.useCallback)((data) => {
|
|
41683
41874
|
process16.stdout.write(data);
|
|
41684
41875
|
}, []);
|
|
41685
|
-
const terminal = (0,
|
|
41876
|
+
const terminal = (0, import_react165.useMemo)(
|
|
41686
41877
|
() => buildTerminalNotification(writeRaw),
|
|
41687
41878
|
[writeRaw]
|
|
41688
41879
|
);
|
|
@@ -41692,12 +41883,14 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41692
41883
|
seedPromptCount
|
|
41693
41884
|
} = useSessionStats();
|
|
41694
41885
|
const logger = useLogger(config.storage, sessionStats.sessionId);
|
|
41695
|
-
const branchName = useGitBranchName(config.getTargetDir());
|
|
41696
41886
|
const worktreeSession = useWorktreeSession(config);
|
|
41697
|
-
const
|
|
41698
|
-
|
|
41699
|
-
|
|
41700
|
-
const
|
|
41887
|
+
const branchName = useGitBranchName(
|
|
41888
|
+
worktreeSession?.worktreePath ?? config.getTargetDir()
|
|
41889
|
+
);
|
|
41890
|
+
const [showWorktreeExitDialog, setShowWorktreeExitDialog] = (0, import_react165.useState)(false);
|
|
41891
|
+
const [workflowKeywordActive, setWorkflowKeywordActive] = (0, import_react165.useState)(false);
|
|
41892
|
+
const pendingWorktreeNoticeRef = (0, import_react165.useRef)(null);
|
|
41893
|
+
const activeWorktree = (0, import_react165.useMemo)(
|
|
41701
41894
|
() => worktreeSession ? {
|
|
41702
41895
|
slug: worktreeSession.slug,
|
|
41703
41896
|
branch: worktreeSession.worktreeBranch,
|
|
@@ -41708,20 +41901,20 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41708
41901
|
} : null,
|
|
41709
41902
|
[worktreeSession]
|
|
41710
41903
|
);
|
|
41711
|
-
const mainControlsRef = (0,
|
|
41712
|
-
const lastTitleRef = (0,
|
|
41713
|
-
const [startupWarnings, setStartupWarnings] = (0,
|
|
41904
|
+
const mainControlsRef = (0, import_react165.useRef)(null);
|
|
41905
|
+
const lastTitleRef = (0, import_react165.useRef)(null);
|
|
41906
|
+
const [startupWarnings, setStartupWarnings] = (0, import_react165.useState)(
|
|
41714
41907
|
() => props.startupWarnings || []
|
|
41715
41908
|
);
|
|
41716
41909
|
const staticExtraHeight = 3;
|
|
41717
|
-
(0,
|
|
41910
|
+
(0, import_react165.useEffect)(() => {
|
|
41718
41911
|
void loadLowlight().catch((err) => {
|
|
41719
41912
|
debugLogger40.warn(
|
|
41720
41913
|
`Failed to load lowlight chunk; code blocks will render as plain text: ${err instanceof Error ? err.message : String(err)}`
|
|
41721
41914
|
);
|
|
41722
41915
|
});
|
|
41723
41916
|
}, []);
|
|
41724
|
-
(0,
|
|
41917
|
+
(0, import_react165.useEffect)(() => {
|
|
41725
41918
|
(async () => {
|
|
41726
41919
|
profileCheckpoint("config_initialize_start");
|
|
41727
41920
|
await config.initialize();
|
|
@@ -41811,7 +42004,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41811
42004
|
await ideClient.disconnect();
|
|
41812
42005
|
});
|
|
41813
42006
|
}, [config]);
|
|
41814
|
-
(0,
|
|
42007
|
+
(0, import_react165.useEffect)(() => {
|
|
41815
42008
|
if (!isConfigInitialized) return void 0;
|
|
41816
42009
|
const geminiClient2 = config.getGeminiClient();
|
|
41817
42010
|
if (!geminiClient2) return void 0;
|
|
@@ -41875,11 +42068,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41875
42068
|
clearTimeout(finalizeCap);
|
|
41876
42069
|
};
|
|
41877
42070
|
}, [isConfigInitialized, config]);
|
|
41878
|
-
const isIdleRef = (0,
|
|
41879
|
-
const availableTerminalHeightRef = (0,
|
|
41880
|
-
const terminalWidthRef = (0,
|
|
41881
|
-
const updateHandlerRef = (0,
|
|
41882
|
-
(0,
|
|
42071
|
+
const isIdleRef = (0, import_react165.useRef)(true);
|
|
42072
|
+
const availableTerminalHeightRef = (0, import_react165.useRef)(0);
|
|
42073
|
+
const terminalWidthRef = (0, import_react165.useRef)(0);
|
|
42074
|
+
const updateHandlerRef = (0, import_react165.useRef)(null);
|
|
42075
|
+
(0, import_react165.useEffect)(() => {
|
|
41883
42076
|
const handler = setUpdateHandler(
|
|
41884
42077
|
historyManager.addItem,
|
|
41885
42078
|
setUpdateInfo,
|
|
@@ -41888,13 +42081,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41888
42081
|
updateHandlerRef.current = handler;
|
|
41889
42082
|
return () => handler?.cleanup();
|
|
41890
42083
|
}, [historyManager.addItem]);
|
|
41891
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
42084
|
+
const { inputWidth, suggestionsWidth } = (0, import_react165.useMemo)(() => {
|
|
41892
42085
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
41893
42086
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
41894
42087
|
}, [terminalWidth]);
|
|
41895
42088
|
const mainAreaWidth = Math.min(terminalWidth - 4, 100);
|
|
41896
42089
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
41897
|
-
const isValidPath = (0,
|
|
42090
|
+
const isValidPath = (0, import_react165.useCallback)((filePath) => {
|
|
41898
42091
|
try {
|
|
41899
42092
|
return fs20.existsSync(filePath) && fs20.statSync(filePath).isFile();
|
|
41900
42093
|
} catch (_e) {
|
|
@@ -41911,9 +42104,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41911
42104
|
shellModeActive,
|
|
41912
42105
|
preferredEditor
|
|
41913
42106
|
});
|
|
41914
|
-
const restoredPromptStashTargetsRef = (0,
|
|
42107
|
+
const restoredPromptStashTargetsRef = (0, import_react165.useRef)(/* @__PURE__ */ new Set());
|
|
41915
42108
|
const promptStashTargetDir = config.getTargetDir();
|
|
41916
|
-
(0,
|
|
42109
|
+
(0, import_react165.useEffect)(() => {
|
|
41917
42110
|
if (restoredPromptStashTargetsRef.current.has(promptStashTargetDir)) {
|
|
41918
42111
|
return;
|
|
41919
42112
|
}
|
|
@@ -41924,7 +42117,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41924
42117
|
(text) => buffer.setText(text)
|
|
41925
42118
|
);
|
|
41926
42119
|
}, [buffer, promptStashTargetDir]);
|
|
41927
|
-
(0,
|
|
42120
|
+
(0, import_react165.useEffect)(() => {
|
|
41928
42121
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
41929
42122
|
const pastMessagesRaw = await logger?.getPreviousUserMessages() || [];
|
|
41930
42123
|
const currentSessionUserMessages = historyManager.history.filter(
|
|
@@ -41938,12 +42131,12 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41938
42131
|
}, "fetchUserMessages");
|
|
41939
42132
|
fetchUserMessages();
|
|
41940
42133
|
}, [historyManager.history, logger]);
|
|
41941
|
-
const remountStaticHistory = (0,
|
|
42134
|
+
const remountStaticHistory = (0, import_react165.useCallback)(() => {
|
|
41942
42135
|
setHistoryRemountKey((prev) => prev + 1);
|
|
41943
42136
|
}, []);
|
|
41944
42137
|
const useTerminalBuffer = settings.merged.ui?.useTerminalBuffer ?? false;
|
|
41945
42138
|
const showScrollbar = settings.merged.ui?.showScrollbar ?? true;
|
|
41946
|
-
const refreshStatic = (0,
|
|
42139
|
+
const refreshStatic = (0, import_react165.useCallback)(() => {
|
|
41947
42140
|
if (isTranscriptOpenRef.current) {
|
|
41948
42141
|
return;
|
|
41949
42142
|
}
|
|
@@ -41952,15 +42145,15 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41952
42145
|
}
|
|
41953
42146
|
remountStaticHistory();
|
|
41954
42147
|
}, [useTerminalBuffer, remountStaticHistory, stdout]);
|
|
41955
|
-
const prevTranscriptOpenRef = (0,
|
|
42148
|
+
const prevTranscriptOpenRef = (0, import_react165.useRef)(isTranscriptOpen);
|
|
41956
42149
|
const wasOpenPrevRender = prevTranscriptOpenRef.current;
|
|
41957
42150
|
prevTranscriptOpenRef.current = isTranscriptOpen;
|
|
41958
|
-
const transcriptCloseCountRef = (0,
|
|
42151
|
+
const transcriptCloseCountRef = (0, import_react165.useRef)(0);
|
|
41959
42152
|
if (wasOpenPrevRender && !isTranscriptOpen) {
|
|
41960
42153
|
transcriptCloseCountRef.current += 1;
|
|
41961
42154
|
}
|
|
41962
42155
|
const transcriptCloseCount = transcriptCloseCountRef.current;
|
|
41963
|
-
(0,
|
|
42156
|
+
(0, import_react165.useEffect)(() => {
|
|
41964
42157
|
if (transcriptCloseCount === 0 || useTerminalBuffer) {
|
|
41965
42158
|
return void 0;
|
|
41966
42159
|
}
|
|
@@ -41973,8 +42166,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41973
42166
|
}, 0);
|
|
41974
42167
|
return () => clearTimeout(id);
|
|
41975
42168
|
}, [transcriptCloseCount, useTerminalBuffer, stdout, remountStaticHistory]);
|
|
41976
|
-
const lastNotifiedModelRef = (0,
|
|
41977
|
-
(0,
|
|
42169
|
+
const lastNotifiedModelRef = (0, import_react165.useRef)(currentModel);
|
|
42170
|
+
(0, import_react165.useEffect)(() => {
|
|
41978
42171
|
const unsubscribe = config.onModelChange((model) => {
|
|
41979
42172
|
if (lastNotifiedModelRef.current === model) {
|
|
41980
42173
|
return;
|
|
@@ -42012,7 +42205,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42012
42205
|
const { onAuthError, openAuthDialog, closeAuthDialog } = authActions;
|
|
42013
42206
|
const { isAuthDialogOpen, isAuthenticating, pendingAuthType } = authState;
|
|
42014
42207
|
useInitializationAuthError(initializationResult.authError, onAuthError);
|
|
42015
|
-
(0,
|
|
42208
|
+
(0, import_react165.useEffect)(() => {
|
|
42016
42209
|
const currentAuthType = config.getModelsConfig().getCurrentAuthType();
|
|
42017
42210
|
if (settings.merged.security?.auth?.enforcedType && currentAuthType && settings.merged.security?.auth.enforcedType !== currentAuthType) {
|
|
42018
42211
|
onAuthError(
|
|
@@ -42026,7 +42219,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42026
42219
|
);
|
|
42027
42220
|
}
|
|
42028
42221
|
}, [settings.merged.security?.auth?.enforcedType, config, onAuthError]);
|
|
42029
|
-
const [editorError, setEditorError] = (0,
|
|
42222
|
+
const [editorError, setEditorError] = (0, import_react165.useState)(null);
|
|
42030
42223
|
const {
|
|
42031
42224
|
isEditorDialogOpen,
|
|
42032
42225
|
openEditorDialog,
|
|
@@ -42034,18 +42227,18 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42034
42227
|
exitEditorDialog
|
|
42035
42228
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
42036
42229
|
const { isSettingsDialogOpen, openSettingsDialog, closeSettingsDialog } = useSettingsCommand();
|
|
42037
|
-
const [isStatusLineDialogOpen, setStatusLineDialogOpen] = (0,
|
|
42038
|
-
const openStatusLineDialog = (0,
|
|
42230
|
+
const [isStatusLineDialogOpen, setStatusLineDialogOpen] = (0, import_react165.useState)(false);
|
|
42231
|
+
const openStatusLineDialog = (0, import_react165.useCallback)(
|
|
42039
42232
|
() => setStatusLineDialogOpen(true),
|
|
42040
42233
|
[]
|
|
42041
42234
|
);
|
|
42042
|
-
const closeStatusLineDialog = (0,
|
|
42235
|
+
const closeStatusLineDialog = (0, import_react165.useCallback)(
|
|
42043
42236
|
() => setStatusLineDialogOpen(false),
|
|
42044
42237
|
[]
|
|
42045
42238
|
);
|
|
42046
|
-
const [statusLineSettingsVersion, setStatusLineSettingsVersion] = (0,
|
|
42047
|
-
const [statusLineConfigOverride, setStatusLineConfigOverride] = (0,
|
|
42048
|
-
const notifyStatusLineSettingsChanged = (0,
|
|
42239
|
+
const [statusLineSettingsVersion, setStatusLineSettingsVersion] = (0, import_react165.useState)(0);
|
|
42240
|
+
const [statusLineConfigOverride, setStatusLineConfigOverride] = (0, import_react165.useState)(void 0);
|
|
42241
|
+
const notifyStatusLineSettingsChanged = (0, import_react165.useCallback)(
|
|
42049
42242
|
(newConfig) => {
|
|
42050
42243
|
setStatusLineConfigOverride(newConfig);
|
|
42051
42244
|
setStatusLineSettingsVersion((version) => version + 1);
|
|
@@ -42063,8 +42256,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42063
42256
|
closeModelDialog
|
|
42064
42257
|
} = useModelCommand();
|
|
42065
42258
|
const { activeArenaDialog, openArenaDialog, closeArenaDialog } = useArenaCommand();
|
|
42066
|
-
const [sessionName, setSessionName] = (0,
|
|
42067
|
-
(0,
|
|
42259
|
+
const [sessionName, setSessionName] = (0, import_react165.useState)(null);
|
|
42260
|
+
(0, import_react165.useEffect)(() => {
|
|
42068
42261
|
const chatRecordingService = config.getChatRecordingService();
|
|
42069
42262
|
if (!chatRecordingService?.setTitleRecordedCallback) return;
|
|
42070
42263
|
const existingCallback = chatRecordingService.getTitleRecordedCallback();
|
|
@@ -42081,7 +42274,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42081
42274
|
};
|
|
42082
42275
|
}, [config]);
|
|
42083
42276
|
const addHistoryItem = historyManager.addItem;
|
|
42084
|
-
(0,
|
|
42277
|
+
(0, import_react165.useEffect)(() => {
|
|
42085
42278
|
if (typeof config.onChatRecordingFailure !== "function") return;
|
|
42086
42279
|
return config.onChatRecordingFailure(() => {
|
|
42087
42280
|
addHistoryItem(
|
|
@@ -42125,10 +42318,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42125
42318
|
config,
|
|
42126
42319
|
addItem: historyManager.addItem
|
|
42127
42320
|
});
|
|
42128
|
-
const [isHelpDialogOpen, setHelpDialogOpen] = (0,
|
|
42129
|
-
const [activeHelpTab, setHelpTab] = (0,
|
|
42130
|
-
const openHelpDialog = (0,
|
|
42131
|
-
const closeHelpDialog = (0,
|
|
42321
|
+
const [isHelpDialogOpen, setHelpDialogOpen] = (0, import_react165.useState)(false);
|
|
42322
|
+
const [activeHelpTab, setHelpTab] = (0, import_react165.useState)("general");
|
|
42323
|
+
const openHelpDialog = (0, import_react165.useCallback)(() => setHelpDialogOpen(true), []);
|
|
42324
|
+
const closeHelpDialog = (0, import_react165.useCallback)(() => setHelpDialogOpen(false), []);
|
|
42132
42325
|
const { vimEnabled, vimMode } = useVimModeState();
|
|
42133
42326
|
const { toggleVimEnabled } = useVimModeActions();
|
|
42134
42327
|
const {
|
|
@@ -42154,31 +42347,31 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42154
42347
|
const { isMcpDialogOpen, openMcpDialog, closeMcpDialog } = useMcpDialog();
|
|
42155
42348
|
const { isHooksDialogOpen, openHooksDialog, closeHooksDialog } = useHooksDialog();
|
|
42156
42349
|
const { isStatsDialogOpen, openStatsDialog, closeStatsDialog } = useStatsDialog();
|
|
42157
|
-
const openRewindSelectorRef = (0,
|
|
42350
|
+
const openRewindSelectorRef = (0, import_react165.useRef)(() => {
|
|
42158
42351
|
});
|
|
42159
|
-
const cancelOngoingRequestRef = (0,
|
|
42352
|
+
const cancelOngoingRequestRef = (0, import_react165.useRef)(() => {
|
|
42160
42353
|
});
|
|
42161
|
-
const [isDiffDialogOpen, setIsDiffDialogOpen] = (0,
|
|
42162
|
-
const openDiffDialog = (0,
|
|
42354
|
+
const [isDiffDialogOpen, setIsDiffDialogOpen] = (0, import_react165.useState)(false);
|
|
42355
|
+
const openDiffDialog = (0, import_react165.useCallback)(() => {
|
|
42163
42356
|
setIsDiffDialogOpen(true);
|
|
42164
42357
|
}, []);
|
|
42165
|
-
const closeDiffDialog = (0,
|
|
42358
|
+
const closeDiffDialog = (0, import_react165.useCallback)(() => {
|
|
42166
42359
|
setIsDiffDialogOpen(false);
|
|
42167
42360
|
}, []);
|
|
42168
|
-
const [isSkillReviewDialogOpen, setIsSkillReviewDialogOpen] = (0,
|
|
42169
|
-
const [skillReviewPending, setSkillReviewPending] = (0,
|
|
42170
|
-
const skillReviewDismissedTaskIdsRef = (0,
|
|
42171
|
-
const dismissSkillReviewDialog = (0,
|
|
42361
|
+
const [isSkillReviewDialogOpen, setIsSkillReviewDialogOpen] = (0, import_react165.useState)(false);
|
|
42362
|
+
const [skillReviewPending, setSkillReviewPending] = (0, import_react165.useState)(null);
|
|
42363
|
+
const skillReviewDismissedTaskIdsRef = (0, import_react165.useRef)(/* @__PURE__ */ new Set());
|
|
42364
|
+
const dismissSkillReviewDialog = (0, import_react165.useCallback)(() => {
|
|
42172
42365
|
if (skillReviewPending) {
|
|
42173
42366
|
skillReviewDismissedTaskIdsRef.current.add(skillReviewPending.taskId);
|
|
42174
42367
|
}
|
|
42175
42368
|
setIsSkillReviewDialogOpen(false);
|
|
42176
42369
|
}, [skillReviewPending]);
|
|
42177
|
-
const closeSkillReviewDialog = (0,
|
|
42370
|
+
const closeSkillReviewDialog = (0, import_react165.useCallback)(
|
|
42178
42371
|
() => setIsSkillReviewDialogOpen(false),
|
|
42179
42372
|
[]
|
|
42180
42373
|
);
|
|
42181
|
-
const acceptPendingSkill = (0,
|
|
42374
|
+
const acceptPendingSkill = (0, import_react165.useCallback)(
|
|
42182
42375
|
(skillName) => {
|
|
42183
42376
|
if (!skillReviewPending) return;
|
|
42184
42377
|
void config.getMemoryManager().acceptPendingSkillFromTask(skillReviewPending.taskId, skillName).catch(() => {
|
|
@@ -42186,7 +42379,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42186
42379
|
},
|
|
42187
42380
|
[config, skillReviewPending]
|
|
42188
42381
|
);
|
|
42189
|
-
const rejectPendingSkill = (0,
|
|
42382
|
+
const rejectPendingSkill = (0, import_react165.useCallback)(
|
|
42190
42383
|
(skillName) => {
|
|
42191
42384
|
if (!skillReviewPending) return;
|
|
42192
42385
|
void config.getMemoryManager().rejectPendingSkillFromTask(skillReviewPending.taskId, skillName).catch(() => {
|
|
@@ -42194,7 +42387,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42194
42387
|
},
|
|
42195
42388
|
[config, skillReviewPending]
|
|
42196
42389
|
);
|
|
42197
|
-
(0,
|
|
42390
|
+
(0, import_react165.useEffect)(() => {
|
|
42198
42391
|
const mgr = config.getMemoryManager();
|
|
42199
42392
|
const projectRoot = config.getProjectRoot();
|
|
42200
42393
|
let lastSig = "";
|
|
@@ -42228,7 +42421,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42228
42421
|
refresh();
|
|
42229
42422
|
return unsub;
|
|
42230
42423
|
}, [config]);
|
|
42231
|
-
const slashCommandActions = (0,
|
|
42424
|
+
const slashCommandActions = (0, import_react165.useMemo)(
|
|
42232
42425
|
() => ({
|
|
42233
42426
|
openAuthDialog,
|
|
42234
42427
|
openThemeDialog,
|
|
@@ -42338,13 +42531,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42338
42531
|
setSessionName,
|
|
42339
42532
|
extensionRefreshState
|
|
42340
42533
|
);
|
|
42341
|
-
const onDebugMessage = (0,
|
|
42534
|
+
const onDebugMessage = (0, import_react165.useCallback)(
|
|
42342
42535
|
(message) => {
|
|
42343
42536
|
config.getDebugLogger().debug(message);
|
|
42344
42537
|
},
|
|
42345
42538
|
[config]
|
|
42346
42539
|
);
|
|
42347
|
-
const handleWorktreeExit = (0,
|
|
42540
|
+
const handleWorktreeExit = (0, import_react165.useCallback)(
|
|
42348
42541
|
async (choice) => {
|
|
42349
42542
|
if (choice === "cancel") {
|
|
42350
42543
|
setShowWorktreeExitDialog(false);
|
|
@@ -42409,7 +42602,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42409
42602
|
},
|
|
42410
42603
|
[activeWorktree, config, handleSlashCommand, historyManager]
|
|
42411
42604
|
);
|
|
42412
|
-
const performMemoryRefresh = (0,
|
|
42605
|
+
const performMemoryRefresh = (0, import_react165.useCallback)(async () => {
|
|
42413
42606
|
if (config.isSafeMode()) {
|
|
42414
42607
|
config.setUserMemory("");
|
|
42415
42608
|
config.setGeminiMdFileCount(0);
|
|
@@ -42481,10 +42674,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42481
42674
|
debugLogger40.error("Error refreshing memory:", error);
|
|
42482
42675
|
}
|
|
42483
42676
|
}, [config, historyManager, settings.merged]);
|
|
42484
|
-
const cancelHandlerRef = (0,
|
|
42677
|
+
const cancelHandlerRef = (0, import_react165.useRef)(() => {
|
|
42485
42678
|
});
|
|
42486
|
-
const midTurnDrainRef = (0,
|
|
42487
|
-
const midTurnRestoreRef = (0,
|
|
42679
|
+
const midTurnDrainRef = (0, import_react165.useRef)(null);
|
|
42680
|
+
const midTurnRestoreRef = (0, import_react165.useRef)(null);
|
|
42488
42681
|
const {
|
|
42489
42682
|
streamingState,
|
|
42490
42683
|
submitQuery,
|
|
@@ -42527,13 +42720,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42527
42720
|
);
|
|
42528
42721
|
cancelOngoingRequestRef.current = cancelOngoingRequest;
|
|
42529
42722
|
isIdleRef.current = streamingState === "idle" /* Idle */;
|
|
42530
|
-
(0,
|
|
42723
|
+
(0, import_react165.useEffect)(() => {
|
|
42531
42724
|
if (streamingState === "idle" /* Idle */) {
|
|
42532
42725
|
updateHandlerRef.current?.flush();
|
|
42533
42726
|
setWorkflowKeywordActive(false);
|
|
42534
42727
|
}
|
|
42535
42728
|
}, [streamingState]);
|
|
42536
|
-
(0,
|
|
42729
|
+
(0, import_react165.useEffect)(() => {
|
|
42537
42730
|
if (shouldAutoOpenSkillReview({
|
|
42538
42731
|
pending: skillReviewPending,
|
|
42539
42732
|
streamingState,
|
|
@@ -42545,7 +42738,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42545
42738
|
}
|
|
42546
42739
|
}, [skillReviewPending, streamingState, isMemoryDialogOpen, config]);
|
|
42547
42740
|
const tipsDisabled = !!(settings.merged.ui?.hideTips || config.getScreenReader());
|
|
42548
|
-
const tipHistory = (0,
|
|
42741
|
+
const tipHistory = (0, import_react165.useMemo)(
|
|
42549
42742
|
() => tipsDisabled ? null : getTipHistory(),
|
|
42550
42743
|
[tipsDisabled]
|
|
42551
42744
|
);
|
|
@@ -42558,7 +42751,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42558
42751
|
addItem: historyManager.addItem,
|
|
42559
42752
|
hideTips: tipsDisabled
|
|
42560
42753
|
});
|
|
42561
|
-
const [hasTabConsumer, setHasTabConsumer] = (0,
|
|
42754
|
+
const [hasTabConsumer, setHasTabConsumer] = (0, import_react165.useState)(false);
|
|
42562
42755
|
const agentViewState = useAgentViewState();
|
|
42563
42756
|
const {
|
|
42564
42757
|
dialogOpen: bgTasksDialogOpen,
|
|
@@ -42566,11 +42759,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42566
42759
|
livePanelFocused: bgLivePanelFocused
|
|
42567
42760
|
} = useBackgroundTaskViewState();
|
|
42568
42761
|
const { closeDialog: closeBgTasksDialog } = useBackgroundTaskViewActions();
|
|
42569
|
-
const [promptSuggestion, setPromptSuggestion] = (0,
|
|
42570
|
-
const prevStreamingStateRef = (0,
|
|
42571
|
-
const speculationRef = (0,
|
|
42572
|
-
const suggestionAbortRef = (0,
|
|
42573
|
-
const abortPromptSuggestion = (0,
|
|
42762
|
+
const [promptSuggestion, setPromptSuggestion] = (0, import_react165.useState)(null);
|
|
42763
|
+
const prevStreamingStateRef = (0, import_react165.useRef)("idle" /* Idle */);
|
|
42764
|
+
const speculationRef = (0, import_react165.useRef)(IDLE_SPECULATION);
|
|
42765
|
+
const suggestionAbortRef = (0, import_react165.useRef)(null);
|
|
42766
|
+
const abortPromptSuggestion = (0, import_react165.useCallback)(() => {
|
|
42574
42767
|
suggestionAbortRef.current?.abort();
|
|
42575
42768
|
suggestionAbortRef.current = null;
|
|
42576
42769
|
if (speculationRef.current.status !== "idle") {
|
|
@@ -42599,21 +42792,21 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42599
42792
|
midTurnDrainRef.current = drainQueue;
|
|
42600
42793
|
midTurnRestoreRef.current = restoreMessages;
|
|
42601
42794
|
const remoteInput = useRemoteInput();
|
|
42602
|
-
(0,
|
|
42795
|
+
(0, import_react165.useEffect)(() => {
|
|
42603
42796
|
if (!remoteInput) return;
|
|
42604
42797
|
remoteInput.setSubmitFn((text) => submitQuery(text));
|
|
42605
42798
|
}, [remoteInput, submitQuery]);
|
|
42606
|
-
(0,
|
|
42799
|
+
(0, import_react165.useEffect)(() => {
|
|
42607
42800
|
if (!remoteInput) return;
|
|
42608
42801
|
if (streamingState === "idle" /* Idle */) {
|
|
42609
42802
|
remoteInput.notifyIdle();
|
|
42610
42803
|
}
|
|
42611
42804
|
}, [remoteInput, streamingState]);
|
|
42612
42805
|
const dualOutput = useDualOutput();
|
|
42613
|
-
const confirmRequestMap = (0,
|
|
42614
|
-
const confirmCallIdMap = (0,
|
|
42615
|
-
const confirmEmitted = (0,
|
|
42616
|
-
(0,
|
|
42806
|
+
const confirmRequestMap = (0, import_react165.useRef)(/* @__PURE__ */ new Map());
|
|
42807
|
+
const confirmCallIdMap = (0, import_react165.useRef)(/* @__PURE__ */ new Map());
|
|
42808
|
+
const confirmEmitted = (0, import_react165.useRef)(/* @__PURE__ */ new Set());
|
|
42809
|
+
(0, import_react165.useEffect)(() => {
|
|
42617
42810
|
if (!dualOutput || !dualOutput.isConnected) return;
|
|
42618
42811
|
for (const tc of pendingToolCalls) {
|
|
42619
42812
|
if (tc.status === "awaiting_approval" && !confirmEmitted.current.has(tc.request.callId)) {
|
|
@@ -42625,7 +42818,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42625
42818
|
requestId,
|
|
42626
42819
|
tc.request.name,
|
|
42627
42820
|
tc.request.callId,
|
|
42628
|
-
tc.request.args
|
|
42821
|
+
tc.request.args,
|
|
42822
|
+
null,
|
|
42823
|
+
buildPermissionSuggestions(tc.confirmationDetails)
|
|
42629
42824
|
);
|
|
42630
42825
|
}
|
|
42631
42826
|
}
|
|
@@ -42640,11 +42835,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42640
42835
|
}
|
|
42641
42836
|
}
|
|
42642
42837
|
}, [dualOutput, pendingToolCalls]);
|
|
42643
|
-
const pendingToolCallsRef = (0,
|
|
42838
|
+
const pendingToolCallsRef = (0, import_react165.useRef)(pendingToolCalls);
|
|
42644
42839
|
pendingToolCallsRef.current = pendingToolCalls;
|
|
42645
|
-
const dualOutputRef = (0,
|
|
42840
|
+
const dualOutputRef = (0, import_react165.useRef)(dualOutput);
|
|
42646
42841
|
dualOutputRef.current = dualOutput;
|
|
42647
|
-
(0,
|
|
42842
|
+
(0, import_react165.useEffect)(() => {
|
|
42648
42843
|
if (!remoteInput) return;
|
|
42649
42844
|
remoteInput.setConfirmationHandler(
|
|
42650
42845
|
(requestId, allowed) => {
|
|
@@ -42684,7 +42879,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42684
42879
|
});
|
|
42685
42880
|
};
|
|
42686
42881
|
}, [remoteInput]);
|
|
42687
|
-
const handleFinalSubmit = (0,
|
|
42882
|
+
const handleFinalSubmit = (0, import_react165.useCallback)(
|
|
42688
42883
|
(submittedValue, options) => {
|
|
42689
42884
|
if (agentViewState.activeView !== "main") {
|
|
42690
42885
|
const agent = agentViewState.agents.get(agentViewState.activeView);
|
|
@@ -42830,7 +43025,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
42830
43025
|
settings.merged.ui?.disableWorkflowKeywordTrigger
|
|
42831
43026
|
]
|
|
42832
43027
|
);
|
|
42833
|
-
const handleArenaModelsSelected = (0,
|
|
43028
|
+
const handleArenaModelsSelected = (0, import_react165.useCallback)(
|
|
42834
43029
|
(models) => {
|
|
42835
43030
|
const value = models.join(",");
|
|
42836
43031
|
buffer.setText(`/arena start --models ${value} `);
|
|
@@ -42845,15 +43040,15 @@ ${buildWorkflowSteeringNotice()}
|
|
|
42845
43040
|
handleWelcomeBackSelection,
|
|
42846
43041
|
handleWelcomeBackClose
|
|
42847
43042
|
} = useWelcomeBack(config, handleFinalSubmit, buffer, settings.merged);
|
|
42848
|
-
const pendingHistoryItems = (0,
|
|
43043
|
+
const pendingHistoryItems = (0, import_react165.useMemo)(
|
|
42849
43044
|
() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
|
|
42850
43045
|
[pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]
|
|
42851
43046
|
);
|
|
42852
|
-
const historyForTranscriptRef = (0,
|
|
43047
|
+
const historyForTranscriptRef = (0, import_react165.useRef)(historyManager.history);
|
|
42853
43048
|
historyForTranscriptRef.current = historyManager.history;
|
|
42854
|
-
const pendingForTranscriptRef = (0,
|
|
43049
|
+
const pendingForTranscriptRef = (0, import_react165.useRef)(pendingHistoryItems);
|
|
42855
43050
|
pendingForTranscriptRef.current = pendingHistoryItems;
|
|
42856
|
-
const openTranscript = (0,
|
|
43051
|
+
const openTranscript = (0, import_react165.useCallback)(() => {
|
|
42857
43052
|
setTranscriptFreeze({
|
|
42858
43053
|
// Share MainContent's visibility predicate so the transcript shows exactly
|
|
42859
43054
|
// what the main view shows. Items collapsed on session resume
|
|
@@ -42865,7 +43060,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
42865
43060
|
pendingItems: [...pendingForTranscriptRef.current]
|
|
42866
43061
|
});
|
|
42867
43062
|
}, []);
|
|
42868
|
-
const transcriptItems = (0,
|
|
43063
|
+
const transcriptItems = (0, import_react165.useMemo)(() => {
|
|
42869
43064
|
if (!transcriptFreeze) return EMPTY_HISTORY_ITEMS;
|
|
42870
43065
|
return [
|
|
42871
43066
|
...transcriptFreeze.committedItems,
|
|
@@ -42877,7 +43072,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
42877
43072
|
}))
|
|
42878
43073
|
];
|
|
42879
43074
|
}, [transcriptFreeze]);
|
|
42880
|
-
const rawStickyTodos = (0,
|
|
43075
|
+
const rawStickyTodos = (0, import_react165.useMemo)(
|
|
42881
43076
|
() => getStickyTodos(historyManager.history, pendingHistoryItems),
|
|
42882
43077
|
[historyManager.history, pendingHistoryItems]
|
|
42883
43078
|
);
|
|
@@ -42885,7 +43080,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
42885
43080
|
const hasExecutingTool = isToolExecuting(pendingHistoryItems);
|
|
42886
43081
|
const hasPendingCompression = isCompressionPending(pendingHistoryItems);
|
|
42887
43082
|
useTerminalProgress(streamingState, hasExecutingTool);
|
|
42888
|
-
cancelHandlerRef.current = (0,
|
|
43083
|
+
cancelHandlerRef.current = (0, import_react165.useCallback)(
|
|
42889
43084
|
(info) => {
|
|
42890
43085
|
const pendingHistoryItems2 = [
|
|
42891
43086
|
...pendingSlashCommandHistoryItems,
|
|
@@ -42985,7 +43180,7 @@ ${currentText}` : popped);
|
|
|
42985
43180
|
pendingGeminiHistoryItems
|
|
42986
43181
|
]
|
|
42987
43182
|
);
|
|
42988
|
-
const handleClearScreen = (0,
|
|
43183
|
+
const handleClearScreen = (0, import_react165.useCallback)(() => {
|
|
42989
43184
|
historyManager.clearItems();
|
|
42990
43185
|
clearScreen();
|
|
42991
43186
|
remountStaticHistory();
|
|
@@ -43008,13 +43203,13 @@ ${currentText}` : popped);
|
|
|
43008
43203
|
history: historyManager.history,
|
|
43009
43204
|
awayThresholdMinutes: settings.merged.general?.sessionRecapAwayThresholdMinutes
|
|
43010
43205
|
});
|
|
43011
|
-
const contextFileNames = (0,
|
|
43206
|
+
const contextFileNames = (0, import_react165.useMemo)(() => {
|
|
43012
43207
|
const fromSettings = settings.merged.context?.fileName;
|
|
43013
43208
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllGeminiMdFilenames();
|
|
43014
43209
|
}, [settings.merged.context?.fileName]);
|
|
43015
|
-
const initialPrompt = (0,
|
|
43016
|
-
const initialPromptSubmitted = (0,
|
|
43017
|
-
(0,
|
|
43210
|
+
const initialPrompt = (0, import_react165.useMemo)(() => config.getQuestion(), [config]);
|
|
43211
|
+
const initialPromptSubmitted = (0, import_react165.useRef)(false);
|
|
43212
|
+
(0, import_react165.useEffect)(() => {
|
|
43018
43213
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && welcomeBackChoice !== "restart" && geminiClient?.isInitialized?.()) {
|
|
43019
43214
|
handleFinalSubmit(initialPrompt);
|
|
43020
43215
|
initialPromptSubmitted.current = true;
|
|
@@ -43032,7 +43227,7 @@ ${currentText}` : popped);
|
|
|
43032
43227
|
geminiClient
|
|
43033
43228
|
]);
|
|
43034
43229
|
const followupSuggestionsEnabled = settings.merged.ui?.enableFollowupSuggestions !== false;
|
|
43035
|
-
(0,
|
|
43230
|
+
(0, import_react165.useEffect)(() => {
|
|
43036
43231
|
if (!followupSuggestionsEnabled) {
|
|
43037
43232
|
suggestionAbortRef.current?.abort();
|
|
43038
43233
|
setPromptSuggestion(null);
|
|
@@ -43101,17 +43296,17 @@ ${currentText}` : popped);
|
|
|
43101
43296
|
isPermissionsDialogOpen,
|
|
43102
43297
|
settingInputRequests
|
|
43103
43298
|
]);
|
|
43104
|
-
(0,
|
|
43299
|
+
(0, import_react165.useEffect)(() => {
|
|
43105
43300
|
if (!promptSuggestion && speculationRef.current.status !== "idle") {
|
|
43106
43301
|
abortSpeculation(speculationRef.current).catch(() => {
|
|
43107
43302
|
});
|
|
43108
43303
|
speculationRef.current = IDLE_SPECULATION;
|
|
43109
43304
|
}
|
|
43110
43305
|
}, [promptSuggestion]);
|
|
43111
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
43112
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
43113
|
-
const [startupIdeConnectionStatus, setStartupIdeConnectionStatus] = (0,
|
|
43114
|
-
(0,
|
|
43306
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react165.useState)(false);
|
|
43307
|
+
const [currentIDE, setCurrentIDE] = (0, import_react165.useState)(null);
|
|
43308
|
+
const [startupIdeConnectionStatus, setStartupIdeConnectionStatus] = (0, import_react165.useState)({ state: "idle" });
|
|
43309
|
+
(0, import_react165.useEffect)(() => {
|
|
43115
43310
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
43116
43311
|
const ideClient = await IdeClient.getInstance();
|
|
43117
43312
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -43127,40 +43322,40 @@ ${currentText}` : popped);
|
|
|
43127
43322
|
tomlFiles: commandMigrationTomlFiles,
|
|
43128
43323
|
setShowMigrationNudge: setShowCommandMigrationNudge
|
|
43129
43324
|
} = useCommandMigration(settings, config.storage);
|
|
43130
|
-
const [showToolDescriptions, setShowToolDescriptions] = (0,
|
|
43325
|
+
const [showToolDescriptions, setShowToolDescriptions] = (0, import_react165.useState)(false);
|
|
43131
43326
|
const configuredRenderMode = settings.merged.ui?.renderMode;
|
|
43132
|
-
const [renderMode, setRenderMode] = (0,
|
|
43327
|
+
const [renderMode, setRenderMode] = (0, import_react165.useState)(
|
|
43133
43328
|
configuredRenderMode === "raw" ? "raw" : "render"
|
|
43134
43329
|
);
|
|
43135
|
-
const renderModeConfigMountedRef = (0,
|
|
43136
|
-
(0,
|
|
43330
|
+
const renderModeConfigMountedRef = (0, import_react165.useRef)(false);
|
|
43331
|
+
(0, import_react165.useEffect)(() => {
|
|
43137
43332
|
if (!renderModeConfigMountedRef.current) {
|
|
43138
43333
|
renderModeConfigMountedRef.current = true;
|
|
43139
43334
|
return;
|
|
43140
43335
|
}
|
|
43141
43336
|
setRenderMode(configuredRenderMode === "raw" ? "raw" : "render");
|
|
43142
43337
|
}, [configuredRenderMode]);
|
|
43143
|
-
const renderModeMountedRef = (0,
|
|
43144
|
-
(0,
|
|
43338
|
+
const renderModeMountedRef = (0, import_react165.useRef)(false);
|
|
43339
|
+
(0, import_react165.useEffect)(() => {
|
|
43145
43340
|
if (!renderModeMountedRef.current) {
|
|
43146
43341
|
renderModeMountedRef.current = true;
|
|
43147
43342
|
return;
|
|
43148
43343
|
}
|
|
43149
43344
|
refreshStatic();
|
|
43150
43345
|
}, [renderMode, refreshStatic]);
|
|
43151
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0,
|
|
43152
|
-
const ctrlCTimerRef = (0,
|
|
43153
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0,
|
|
43154
|
-
const ctrlDTimerRef = (0,
|
|
43155
|
-
const [escapePressedOnce, setEscapePressedOnce] = (0,
|
|
43156
|
-
const escapeTimerRef = (0,
|
|
43157
|
-
const dialogsVisibleRef = (0,
|
|
43158
|
-
const [isRewindSelectorOpen, setIsRewindSelectorOpen] = (0,
|
|
43159
|
-
const [rewindEscPending, setRewindEscPending] = (0,
|
|
43160
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
43161
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
43162
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
43163
|
-
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0,
|
|
43346
|
+
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0, import_react165.useState)(false);
|
|
43347
|
+
const ctrlCTimerRef = (0, import_react165.useRef)(null);
|
|
43348
|
+
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0, import_react165.useState)(false);
|
|
43349
|
+
const ctrlDTimerRef = (0, import_react165.useRef)(null);
|
|
43350
|
+
const [escapePressedOnce, setEscapePressedOnce] = (0, import_react165.useState)(false);
|
|
43351
|
+
const escapeTimerRef = (0, import_react165.useRef)(null);
|
|
43352
|
+
const dialogsVisibleRef = (0, import_react165.useRef)(false);
|
|
43353
|
+
const [isRewindSelectorOpen, setIsRewindSelectorOpen] = (0, import_react165.useState)(false);
|
|
43354
|
+
const [rewindEscPending, setRewindEscPending] = (0, import_react165.useState)(false);
|
|
43355
|
+
const [constrainHeight, setConstrainHeight] = (0, import_react165.useState)(true);
|
|
43356
|
+
const [ideContextState, setIdeContextState] = (0, import_react165.useState)();
|
|
43357
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react165.useState)(false);
|
|
43358
|
+
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react165.useState)(false);
|
|
43164
43359
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings, setIsTrustedFolder);
|
|
43165
43360
|
const {
|
|
43166
43361
|
isMcpApprovalDialogOpen,
|
|
@@ -43189,7 +43384,7 @@ ${currentText}` : popped);
|
|
|
43189
43384
|
const dialogsVisible = showWelcomeBackDialog || shouldShowIdePrompt || shouldShowCommandMigrationNudge || isFolderTrustDialogOpen || isMcpApprovalDialogOpen || !!shellConfirmationRequest || !!confirmationRequest || confirmUpdateExtensionRequests.length > 0 || !!providerUpdateRequest || settingInputRequests.length > 0 || pluginChoiceRequests.length > 0 || !!loopDetectionConfirmationRequest || isThemeDialogOpen || isSettingsDialogOpen || isStatusLineDialogOpen || isMemoryDialogOpen || isModelDialogOpen || isTrustDialogOpen || activeArenaDialog !== null || isPermissionsDialogOpen || isAuthDialogOpen || isAuthenticating || isEditorDialogOpen || showIdeRestartPrompt || isSubagentCreateDialogOpen || isAgentsManagerDialogOpen || isSkillsManagerDialogOpen || isMcpDialogOpen || isHooksDialogOpen || isStatsDialogOpen || isApprovalModeDialogOpen || isEffortDialogOpen || isResumeDialogOpen || isDeleteDialogOpen || isHelpDialogOpen || isExtensionsManagerDialogOpen || isRewindSelectorOpen || isDiffDialogOpen || isSkillReviewDialogOpen || bgTasksDialogOpen || showWorktreeExitDialog || !!(settings.corruptedPath && !settings.corruptionDialogDismissed);
|
|
43190
43385
|
dialogsVisibleRef.current = dialogsVisible;
|
|
43191
43386
|
const needsBlockingInput = dialogsVisible || streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
43192
|
-
(0,
|
|
43387
|
+
(0, import_react165.useEffect)(() => {
|
|
43193
43388
|
if (needsBlockingInput && isTranscriptOpen) {
|
|
43194
43389
|
closeTranscript();
|
|
43195
43390
|
}
|
|
@@ -43205,12 +43400,12 @@ ${currentText}` : popped);
|
|
|
43205
43400
|
stickyTodoWidth,
|
|
43206
43401
|
stickyTodoMaxVisibleItems
|
|
43207
43402
|
) : "hidden";
|
|
43208
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
43403
|
+
const [controlsHeight, setControlsHeight] = (0, import_react165.useState)(0);
|
|
43209
43404
|
const liveAgentPanelLayoutKey = getLiveAgentPanelLayoutKey(
|
|
43210
43405
|
bgTaskEntries,
|
|
43211
43406
|
bgLivePanelFocused
|
|
43212
43407
|
);
|
|
43213
|
-
(0,
|
|
43408
|
+
(0, import_react165.useLayoutEffect)(() => {
|
|
43214
43409
|
if (!mainControlsRef.current) {
|
|
43215
43410
|
setControlsHeight(
|
|
43216
43411
|
(previousHeight) => previousHeight === 0 ? previousHeight : 0
|
|
@@ -43229,10 +43424,13 @@ ${currentText}` : popped);
|
|
|
43229
43424
|
dialogsVisible,
|
|
43230
43425
|
stickyTodosLayoutKey,
|
|
43231
43426
|
liveAgentPanelLayoutKey,
|
|
43232
|
-
// Composer height also
|
|
43233
|
-
// re-measured during a streaming turn and the VP
|
|
43427
|
+
// Composer and update notification height also shift with these; without
|
|
43428
|
+
// them the footer isn't re-measured during a streaming turn and the VP
|
|
43429
|
+
// viewport bottom clips.
|
|
43234
43430
|
// (elapsedTime/currentLoadingPhrase excluded: they tick without changing rows.)
|
|
43235
43431
|
streamingState,
|
|
43432
|
+
updateInfo,
|
|
43433
|
+
agentViewState.activeView,
|
|
43236
43434
|
embeddedShellFocused,
|
|
43237
43435
|
messageQueue.length,
|
|
43238
43436
|
isInputActive
|
|
@@ -43254,7 +43452,7 @@ ${currentText}` : popped);
|
|
|
43254
43452
|
pager: settings.merged.tools?.shell?.pager,
|
|
43255
43453
|
showColor: settings.merged.tools?.shell?.showColor
|
|
43256
43454
|
});
|
|
43257
|
-
(0,
|
|
43455
|
+
(0, import_react165.useEffect)(() => {
|
|
43258
43456
|
if (activePtyId) {
|
|
43259
43457
|
ShellExecutionService.resizePty(
|
|
43260
43458
|
activePtyId,
|
|
@@ -43264,17 +43462,18 @@ ${currentText}` : popped);
|
|
|
43264
43462
|
}
|
|
43265
43463
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
43266
43464
|
useResizeSettleRepaint(terminalWidth, refreshStatic);
|
|
43267
|
-
(
|
|
43465
|
+
useWakeRepaint(refreshStatic);
|
|
43466
|
+
(0, import_react165.useEffect)(() => {
|
|
43268
43467
|
if (ideNeedsRestart) {
|
|
43269
43468
|
setShowIdeRestartPrompt(true);
|
|
43270
43469
|
}
|
|
43271
43470
|
}, [ideNeedsRestart]);
|
|
43272
|
-
(0,
|
|
43471
|
+
(0, import_react165.useEffect)(() => {
|
|
43273
43472
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
43274
43473
|
setIdeContextState(ideContextStore.get());
|
|
43275
43474
|
return unsubscribe;
|
|
43276
43475
|
}, []);
|
|
43277
|
-
(0,
|
|
43476
|
+
(0, import_react165.useEffect)(() => {
|
|
43278
43477
|
const listener = /* @__PURE__ */ __name((status) => {
|
|
43279
43478
|
setStartupIdeConnectionStatus(status);
|
|
43280
43479
|
}, "listener");
|
|
@@ -43283,10 +43482,10 @@ ${currentText}` : popped);
|
|
|
43283
43482
|
appEvents.off("startup-ide-connection-status-changed" /* StartupIdeConnectionStatusChanged */, listener);
|
|
43284
43483
|
};
|
|
43285
43484
|
}, []);
|
|
43286
|
-
const handleEscapePromptChange = (0,
|
|
43485
|
+
const handleEscapePromptChange = (0, import_react165.useCallback)((showPrompt) => {
|
|
43287
43486
|
setShowEscapePrompt(showPrompt);
|
|
43288
43487
|
}, []);
|
|
43289
|
-
const openRewindSelector = (0,
|
|
43488
|
+
const openRewindSelector = (0, import_react165.useCallback)(() => {
|
|
43290
43489
|
if (streamingState !== "idle" /* Idle */) return;
|
|
43291
43490
|
if (dialogsVisibleRef.current) return;
|
|
43292
43491
|
if (config.getIdeMode()) {
|
|
@@ -43304,10 +43503,10 @@ ${currentText}` : popped);
|
|
|
43304
43503
|
setIsRewindSelectorOpen(true);
|
|
43305
43504
|
}, [streamingState, config, historyManager]);
|
|
43306
43505
|
openRewindSelectorRef.current = openRewindSelector;
|
|
43307
|
-
const closeRewindSelector = (0,
|
|
43506
|
+
const closeRewindSelector = (0, import_react165.useCallback)(() => {
|
|
43308
43507
|
setIsRewindSelectorOpen(false);
|
|
43309
43508
|
}, []);
|
|
43310
|
-
const handleRewindConfirm = (0,
|
|
43509
|
+
const handleRewindConfirm = (0, import_react165.useCallback)(
|
|
43311
43510
|
async (userItem, option) => {
|
|
43312
43511
|
try {
|
|
43313
43512
|
const needsConversation = option === "conversation" || option === "both";
|
|
@@ -43469,7 +43668,7 @@ ${currentText}` : popped);
|
|
|
43469
43668
|
openRewindSelector,
|
|
43470
43669
|
(pending) => setRewindEscPending(pending)
|
|
43471
43670
|
);
|
|
43472
|
-
const handleIdePromptComplete = (0,
|
|
43671
|
+
const handleIdePromptComplete = (0, import_react165.useCallback)(
|
|
43473
43672
|
(result) => {
|
|
43474
43673
|
if (result.userSelection === "yes") {
|
|
43475
43674
|
if (result.isExtensionPreInstalled) {
|
|
@@ -43485,7 +43684,7 @@ ${currentText}` : popped);
|
|
|
43485
43684
|
},
|
|
43486
43685
|
[handleSlashCommand, settings]
|
|
43487
43686
|
);
|
|
43488
|
-
const handleCommandMigrationComplete = (0,
|
|
43687
|
+
const handleCommandMigrationComplete = (0, import_react165.useCallback)(
|
|
43489
43688
|
async (result) => {
|
|
43490
43689
|
setShowCommandMigrationNudge(false);
|
|
43491
43690
|
if (result.userSelection === "yes") {
|
|
@@ -43577,7 +43776,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43577
43776
|
pendingToolCalls
|
|
43578
43777
|
});
|
|
43579
43778
|
const workflowBellEnabled = settings.merged.general?.terminalBell ?? true;
|
|
43580
|
-
(0,
|
|
43779
|
+
(0, import_react165.useEffect)(() => {
|
|
43581
43780
|
const registry = config.getWorkflowRunRegistry?.();
|
|
43582
43781
|
if (!registry?.setNotificationCallback) return;
|
|
43583
43782
|
registry.setNotificationCallback((entry) => {
|
|
@@ -43627,7 +43826,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43627
43826
|
showWorktreeExitDialog,
|
|
43628
43827
|
closeWorktreeExitDialog: /* @__PURE__ */ __name(() => setShowWorktreeExitDialog(false), "closeWorktreeExitDialog")
|
|
43629
43828
|
});
|
|
43630
|
-
const handleExit = (0,
|
|
43829
|
+
const handleExit = (0, import_react165.useCallback)(
|
|
43631
43830
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
43632
43831
|
if (pressedOnce) {
|
|
43633
43832
|
if (timerRef.current) {
|
|
@@ -43680,7 +43879,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43680
43879
|
activeWorktree
|
|
43681
43880
|
]
|
|
43682
43881
|
);
|
|
43683
|
-
const handleGlobalKeypress = (0,
|
|
43882
|
+
const handleGlobalKeypress = (0, import_react165.useCallback)(
|
|
43684
43883
|
(key) => {
|
|
43685
43884
|
if (settings.merged.general?.debugKeystrokeLogging) {
|
|
43686
43885
|
debugLogger40.debug("[DEBUG] Keystroke:", JSON.stringify(key));
|
|
@@ -43870,7 +44069,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43870
44069
|
]
|
|
43871
44070
|
);
|
|
43872
44071
|
useKeypress(handleGlobalKeypress, { isActive: true });
|
|
43873
|
-
(0,
|
|
44072
|
+
(0, import_react165.useEffect)(() => {
|
|
43874
44073
|
if (settings.merged.ui?.hideWindowTitle) {
|
|
43875
44074
|
return;
|
|
43876
44075
|
}
|
|
@@ -43897,9 +44096,9 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43897
44096
|
settings.merged.ui?.showStatusInTitle,
|
|
43898
44097
|
config
|
|
43899
44098
|
]);
|
|
43900
|
-
const queueDrainingRef = (0,
|
|
43901
|
-
const [queueDrainNonce, setQueueDrainNonce] = (0,
|
|
43902
|
-
(0,
|
|
44099
|
+
const queueDrainingRef = (0, import_react165.useRef)(false);
|
|
44100
|
+
const [queueDrainNonce, setQueueDrainNonce] = (0, import_react165.useState)(0);
|
|
44101
|
+
(0, import_react165.useEffect)(() => {
|
|
43903
44102
|
if (queueDrainingRef.current) return;
|
|
43904
44103
|
if (!shouldDrainMessageQueue({
|
|
43905
44104
|
isConfigInitialized,
|
|
@@ -43933,7 +44132,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43933
44132
|
queueDrainNonce
|
|
43934
44133
|
]);
|
|
43935
44134
|
const nightly = props.version.includes("nightly");
|
|
43936
|
-
const uiState = (0,
|
|
44135
|
+
const uiState = (0, import_react165.useMemo)(
|
|
43937
44136
|
() => ({
|
|
43938
44137
|
history: historyManager.history,
|
|
43939
44138
|
historyManager,
|
|
@@ -44224,7 +44423,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44224
44423
|
isDiffDialogOpen
|
|
44225
44424
|
]
|
|
44226
44425
|
);
|
|
44227
|
-
const uiActions = (0,
|
|
44426
|
+
const uiActions = (0, import_react165.useMemo)(
|
|
44228
44427
|
() => ({
|
|
44229
44428
|
openThemeDialog,
|
|
44230
44429
|
openEditorDialog,
|
|
@@ -44405,11 +44604,11 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44405
44604
|
closeDiffDialog
|
|
44406
44605
|
]
|
|
44407
44606
|
);
|
|
44408
|
-
const renderModeValue = (0,
|
|
44607
|
+
const renderModeValue = (0, import_react165.useMemo)(
|
|
44409
44608
|
() => ({ renderMode, setRenderMode }),
|
|
44410
44609
|
[renderMode, setRenderMode]
|
|
44411
44610
|
);
|
|
44412
|
-
const thoughtExpandedValue = (0,
|
|
44611
|
+
const thoughtExpandedValue = (0, import_react165.useMemo)(
|
|
44413
44612
|
() => ({
|
|
44414
44613
|
allExpanded: thoughtExpanded,
|
|
44415
44614
|
expandedHeadIds: expandedThoughtHeadIds,
|
|
@@ -44446,9 +44645,9 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44446
44645
|
|
|
44447
44646
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
44448
44647
|
init_esbuild_shims();
|
|
44449
|
-
var
|
|
44648
|
+
var import_react166 = __toESM(require_react(), 1);
|
|
44450
44649
|
function useKittyKeyboardProtocol() {
|
|
44451
|
-
const [status] = (0,
|
|
44650
|
+
const [status] = (0, import_react166.useState)({
|
|
44452
44651
|
supported: isKittyProtocolSupported(),
|
|
44453
44652
|
enabled: isKittyProtocolEnabled(),
|
|
44454
44653
|
checking: false
|
|
@@ -44733,7 +44932,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
44733
44932
|
process.stdout.setMaxListeners(0);
|
|
44734
44933
|
}
|
|
44735
44934
|
const instance = render_default(
|
|
44736
|
-
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
44935
|
+
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_react167.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(AppWrapper, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(AppWrapper, {}),
|
|
44737
44936
|
{
|
|
44738
44937
|
exitOnCtrlC: false,
|
|
44739
44938
|
isScreenReaderEnabled: config.getScreenReader(),
|