@qwen-code/qwen-code 0.21.1-simplify-system-prompt.0 → 0.21.2
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/model-providers.md +2 -0
- package/bundled/qc-helper/docs/configuration/settings.md +39 -28
- package/bundled/qc-helper/docs/features/channels/_meta.ts +2 -0
- package/bundled/qc-helper/docs/features/channels/github.md +139 -0
- package/bundled/qc-helper/docs/features/channels/gitlab.md +171 -0
- package/bundled/qc-helper/docs/features/channels/overview.md +61 -6
- package/bundled/qc-helper/docs/features/code-review.md +21 -1
- package/bundled/qc-helper/docs/features/hooks.md +72 -15
- package/bundled/qc-helper/docs/features/mcp.md +9 -1
- package/bundled/qc-helper/docs/features/scheduled-tasks.md +3 -1
- package/bundled/qc-helper/docs/features/sub-agents.md +42 -8
- package/bundled/qc-helper/docs/qwen-serve.md +11 -7
- package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +2 -2
- package/bundled/qc-helper/docs/support/troubleshooting.md +2 -1
- package/bundled/review/DESIGN.md +19 -0
- package/bundled/review/SKILL.md +120 -61
- package/chunks/MaxSizedBox-TQBQ247P.js +88 -0
- package/chunks/{StandaloneSessionPicker-O6RKBPU4.js → StandaloneSessionPicker-2HPTKCLX.js} +71 -69
- package/chunks/{acp-startup-profiler-RV3IV562.js → acp-startup-profiler-2C4A5ZTJ.js} +2 -2
- package/chunks/{acpAgent-HYFVXVDR.js → acpAgent-PS6EDGH3.js} +1628 -590
- package/chunks/agent-VDOUB35F.js +84 -0
- package/chunks/agent-headless-EO53EFS2.js +78 -0
- package/chunks/{anthropicContentGenerator-LXUXMOE7.js → anthropicContentGenerator-OFHSZJBF.js} +61 -20
- package/chunks/{artifact-tool-Y5T7GG7F.js → artifact-tool-RDN2W7ND.js} +4 -4
- package/chunks/{askUserQuestion-2H6747FR.js → askUserQuestion-OZERWH5R.js} +4 -4
- package/chunks/bridge-W7AZSRZQ.js +94 -0
- package/chunks/{build-RV63TIRH.js → build-GDBLPA24.js} +1 -1
- package/chunks/{ca-25EDXPFZ.js → ca-6W3SK7OQ.js} +6 -1
- package/chunks/{channel-management-service-G74LFADV.js → channel-management-service-5S7YCWX5.js} +20 -5
- package/chunks/channel-settings-store-JFVRSNER.js +91 -0
- package/chunks/{channel-worker-group-PTJIJSKC.js → channel-worker-group-OVWGYMZS.js} +9 -5
- package/chunks/{channel-worker-manager-WIMGM2FD.js → channel-worker-manager-H55GKOQA.js} +9 -5
- package/chunks/{channel-worker-supervisor-KUFTR6P5.js → channel-worker-supervisor-CABBXYHK.js} +5 -4
- package/chunks/{chunk-6GMVPFB2.js → chunk-2IIJTXYF.js} +45 -16
- package/chunks/{chunk-BPJSQIJX.js → chunk-2J3OJGTL.js} +0 -2
- package/chunks/{chunk-I7XZ3RY5.js → chunk-2KKCCLPT.js} +1 -1
- package/chunks/{chunk-MSLKI6C2.js → chunk-2LEOZTBT.js} +49 -26
- package/chunks/{chunk-3QMGYBFN.js → chunk-3APUUXRF.js} +1 -80
- package/chunks/{chunk-VV6XU5L7.js → chunk-3F2WDAV6.js} +16 -11
- package/chunks/{chunk-MUP3T3AD.js → chunk-3I6DUGQD.js} +1 -35
- package/chunks/{chunk-66RMLJHC.js → chunk-44F4LBWZ.js} +577 -208
- package/chunks/{chunk-VAK25FTU.js → chunk-45IOTAUS.js} +1 -1
- package/chunks/{chunk-JZA3JUDJ.js → chunk-4KP2F2TE.js} +1 -1
- package/chunks/{chunk-DM4Q4JJH.js → chunk-54YCNSK5.js} +36562 -45062
- package/chunks/{chunk-2Q3OT4OV.js → chunk-56Z7QEAQ.js} +200 -77
- package/chunks/{chunk-ZOIFNCKL.js → chunk-5NNHICSA.js} +3 -23
- package/chunks/{chunk-A4UCTEB5.js → chunk-5WV5S2GT.js} +0 -1
- package/chunks/{chunk-RHLZR4E5.js → chunk-675H6PLP.js} +1 -1
- package/chunks/{chunk-YAF5VNU7.js → chunk-6CQWRWUC.js} +4 -5
- package/chunks/chunk-6FMJLI5M.js +1591 -0
- package/chunks/{chunk-HV3G62R6.js → chunk-6MPDY6ZG.js} +1 -1
- package/chunks/{chunk-32MVHM4T.js → chunk-6PQPKTXP.js} +1 -1
- package/chunks/{chunk-LG4GZIVV.js → chunk-6TAASXWL.js} +4 -4
- package/chunks/{chunk-OJGCZBB7.js → chunk-77V3VIKL.js} +41 -36
- package/chunks/{chunk-2OM7GEXO.js → chunk-7KAXXBER.js} +3 -3
- package/chunks/{chunk-2JM6GZ5D.js → chunk-7SJN2IWT.js} +8 -13
- package/chunks/{chunk-UUUTRMI2.js → chunk-7ULQIS27.js} +1 -1
- package/chunks/{chunk-2YZJCM5T.js → chunk-A7Y5H4TX.js} +4 -4
- package/chunks/{chunk-TOFQCPDC.js → chunk-AOHY3QJ3.js} +14 -8
- package/chunks/chunk-AQ37AY7B.js +93 -0
- package/chunks/{chunk-B6ZJ7SI6.js → chunk-AUOULH6Q.js} +383 -320
- package/chunks/{chunk-PJIZUQVC.js → chunk-AZQ3DT76.js} +2 -2
- package/chunks/{chunk-UH3WSE5L.js → chunk-B4AJNNOL.js} +1 -6
- package/chunks/{chunk-7FZEBPKS.js → chunk-BBIQAX4V.js} +23 -18
- package/chunks/{chunk-L26JL52R.js → chunk-CBBP4BMC.js} +64 -67
- package/chunks/{chunk-ZD6UTE4A.js → chunk-CNTR4GR6.js} +1 -1
- package/chunks/{chunk-4M377AZG.js → chunk-CO2U743O.js} +6 -6
- package/chunks/{chunk-3SJ43L4W.js → chunk-CPZAH673.js} +6 -0
- package/chunks/{chunk-VFSJ5VRH.js → chunk-CU47KXB5.js} +3 -3
- package/chunks/{chunk-EPDRMGT4.js → chunk-D4HTUMGX.js} +4 -28
- package/chunks/{chunk-XHRTVPG2.js → chunk-D6MDRSZ6.js} +7 -7
- package/chunks/{chunk-BYFNTGKI.js → chunk-DEEABGH2.js} +3111 -989
- package/chunks/{chunk-XVNQMZ2I.js → chunk-DGEIYUC3.js} +0 -1
- package/chunks/{chunk-BPZALHVR.js → chunk-DI35ZN7T.js} +1 -1
- package/chunks/{chunk-B4UMZKMU.js → chunk-DQ2O5QOJ.js} +1 -1
- package/chunks/{chunk-DLWL3Z7A.js → chunk-DSFHVTWD.js} +3 -3
- package/chunks/{chunk-RWS5VYWC.js → chunk-DUNI4EBW.js} +950 -446
- package/chunks/{chunk-NL7LTRLR.js → chunk-E2BHWIDT.js} +48 -72
- package/chunks/{chunk-3MSHSCSN.js → chunk-E2FN6SM7.js} +93 -3
- package/chunks/{chunk-USTWD7QV.js → chunk-E6CJ2SMM.js} +26 -16
- package/chunks/{chunk-TF2X2WCT.js → chunk-EQNUDTL6.js} +2 -2
- package/chunks/{chunk-PANH4R3B.js → chunk-EU5TBFJI.js} +18 -12
- package/chunks/{chunk-W4CQXHT6.js → chunk-FANRZEAJ.js} +1 -1
- package/chunks/{chunk-WBL3FJEU.js → chunk-FC4KQFCS.js} +1 -1
- package/chunks/{chunk-N3FAY5CM.js → chunk-FCYYAB4S.js} +157 -4
- package/chunks/{chunk-OKY7HXPG.js → chunk-FJ5WUMUQ.js} +2 -2
- package/chunks/{chunk-M4UKFCZ2.js → chunk-FNDXMN7I.js} +231 -171
- package/chunks/{chunk-FQK6JAFG.js → chunk-FS674JW4.js} +4 -4
- package/chunks/chunk-FYJ7W2PI.js +194 -0
- package/chunks/{chunk-INADJJGW.js → chunk-G7XXKQYS.js} +2 -2
- package/chunks/{chunk-LNARWLZQ.js → chunk-GJ2GBPBD.js} +2 -2
- package/chunks/{chunk-E5WH5O3C.js → chunk-GL4JOZXU.js} +4 -4
- package/chunks/{chunk-LS77BEZP.js → chunk-GLCZKT5V.js} +1 -5
- package/chunks/{chunk-KU5XMLDK.js → chunk-GURGAJTX.js} +4 -1
- package/chunks/{chunk-5THCYPLO.js → chunk-H6I4PGRV.js} +15 -8
- package/chunks/{chunk-A5L3JMUA.js → chunk-HC45LTEN.js} +18 -4
- package/chunks/{chunk-U7TXFVUN.js → chunk-HIVKI6O6.js} +118 -95
- package/chunks/{chunk-QY5MMZ6O.js → chunk-HX6RLYUO.js} +3 -3
- package/chunks/{chunk-GZXCZHCT.js → chunk-I3G5JWBV.js} +1 -1
- package/chunks/{chunk-ER5LWJR6.js → chunk-I5BT7ADR.js} +3 -3
- package/chunks/{chunk-L5UHQJTJ.js → chunk-IGTHU3T4.js} +1 -1
- package/chunks/{chunk-BIQWWWJN.js → chunk-IIUGIWWY.js} +1 -1
- package/chunks/{chunk-ML52PL6O.js → chunk-JCJ7LKNA.js} +5856 -5334
- package/chunks/{chunk-B7QDM6Z7.js → chunk-JE2CEOBO.js} +2 -2
- package/chunks/{chunk-S3TWXGKA.js → chunk-JE7KQ2UP.js} +4 -2
- package/chunks/{chunk-P5V4T7NK.js → chunk-JJPKFJBT.js} +11 -3
- package/chunks/{chunk-J6D3VXCC.js → chunk-JLZ3RBQG.js} +18 -5
- package/chunks/{chunk-PWTZEM3C.js → chunk-JXVC2PL3.js} +3 -37
- package/chunks/chunk-JYBU6YUE.js +378 -0
- package/chunks/{chunk-JCW2R7WC.js → chunk-K623ENWT.js} +3 -79
- package/chunks/{chunk-T2NCM2ET.js → chunk-K6KS3LTN.js} +2 -749
- package/chunks/{chunk-Z5BLYMZM.js → chunk-KR32NIAN.js} +6 -6
- package/chunks/{chunk-MK7VQDN3.js → chunk-KWHKHSIS.js} +8 -6
- package/chunks/{chunk-5U4IPFBR.js → chunk-KXDONCPU.js} +4 -4
- package/chunks/{chunk-DHHOYAPR.js → chunk-L2E5GFAG.js} +7 -7
- package/chunks/{chunk-V6VRAM7B.js → chunk-L32VV3ZJ.js} +12 -12
- package/chunks/{chunk-2W3OOD4W.js → chunk-L55JWS76.js} +6 -3
- package/chunks/{chunk-E5TUC6CA.js → chunk-LHKCY7DY.js} +3 -3
- package/chunks/{chunk-NH6KE4JX.js → chunk-LOY7RWQG.js} +3 -3
- package/chunks/{chunk-CC4N4M36.js → chunk-LYI2PZDK.js} +1 -1
- package/chunks/{chunk-3JAQDSXN.js → chunk-MB32MS4U.js} +80 -9
- package/chunks/{chunk-PR75REBZ.js → chunk-MM7TH7ZM.js} +12 -82
- package/chunks/{chunk-FODK6UMO.js → chunk-MPHPFVKK.js} +0 -2
- package/chunks/{chunk-M5JM7OSF.js → chunk-N4ACHWNH.js} +2 -3
- package/chunks/{chunk-JESCGQM3.js → chunk-NAVJD2PQ.js} +8 -7
- package/chunks/{chunk-J56UI34H.js → chunk-NBD76HUW.js} +4 -2
- package/chunks/{chunk-C3NS4F2Q.js → chunk-NHFEMWAZ.js} +1 -1
- package/chunks/{chunk-6PSLCFQ2.js → chunk-NTDH4IML.js} +18 -9
- package/chunks/{chunk-6OUGMXDC.js → chunk-NWNEANAT.js} +7 -7
- package/chunks/chunk-O6GEWCJA.js +21 -0
- package/chunks/chunk-OCPBI7J5.js +18 -0
- package/chunks/{chunk-ZE5WPL4I.js → chunk-OFZKFPYG.js} +3 -3
- package/chunks/{chunk-KIUFNBHR.js → chunk-P5VC5USY.js} +1 -1
- package/chunks/chunk-P755N4CS.js +2196 -0
- package/chunks/{chunk-BRRAJXPA.js → chunk-PCK4B6LR.js} +1 -1
- package/chunks/{chunk-TQCBGUHN.js → chunk-PJOHNFIY.js} +5 -5
- package/chunks/{chunk-G4WFQUYQ.js → chunk-PVNQRENX.js} +1 -1
- package/chunks/{chunk-DM22XS4K.js → chunk-PZEXDV3H.js} +357 -13
- package/chunks/{chunk-2JZBVYTU.js → chunk-Q3T5KA2V.js} +1 -8
- package/chunks/{chunk-SASBXAQL.js → chunk-Q5WZTTWE.js} +4 -4
- package/chunks/{chunk-SRZ6DXVG.js → chunk-QARJNL2V.js} +44 -136
- package/chunks/{chunk-YH6G52F2.js → chunk-QCXGC7QB.js} +4 -4
- package/chunks/{chunk-SQBYH7PX.js → chunk-QDK4F2N5.js} +1 -1
- package/chunks/{chunk-VDDGDZMA.js → chunk-QHWCP53L.js} +14 -7
- package/chunks/{chunk-H5FFA6TH.js → chunk-QTHQ6Z5X.js} +16 -3
- package/chunks/{chunk-5I2IWRSH.js → chunk-R2XWGR75.js} +2 -2
- package/chunks/{chunk-PHVR5UUY.js → chunk-RDJOB6S3.js} +1 -1
- package/chunks/{chunk-GDIPH4JY.js → chunk-RG64CDT2.js} +6 -6
- package/chunks/{chunk-3HBZKBMQ.js → chunk-RSVPYAGK.js} +5 -5
- package/chunks/{chunk-6AM5D4ME.js → chunk-S6LOFUVP.js} +0 -12
- package/chunks/{chunk-K4XWPEWB.js → chunk-SHN4KHDK.js} +4 -33
- package/chunks/{chunk-VYPFXUCB.js → chunk-SZ3KHTDR.js} +1 -1
- package/chunks/chunk-T26EAKDL.js +13 -0
- package/chunks/chunk-T3CHYWJZ.js +758 -0
- package/chunks/{chunk-FNQ6T3CV.js → chunk-TEGJSJDF.js} +10 -7
- package/chunks/{chunk-OHNBB4XR.js → chunk-THVU3RNH.js} +1 -1
- package/chunks/{record-artifact-RQKFYO5B.js → chunk-TIRRPCFS.js} +22 -7
- package/chunks/chunk-TTJZAIFP.js +319 -0
- package/chunks/{chunk-63P4EL5V.js → chunk-TZTAV5RH.js} +1 -1
- package/chunks/{chunk-52O2CIUL.js → chunk-UV6KF7T3.js} +130 -5
- package/chunks/{chunk-QPDRAXDJ.js → chunk-V25K5ID7.js} +1 -1
- package/chunks/{chunk-3IXOIAKE.js → chunk-V4XNUDPE.js} +18 -6
- package/chunks/{chunk-WDSWXQU3.js → chunk-VEMNQMHA.js} +2 -2
- package/chunks/{chunk-LNURQEMZ.js → chunk-VMX5RZQH.js} +12 -10
- package/chunks/{chunk-JALU3ZDU.js → chunk-W3UKBMSI.js} +154 -16
- package/chunks/{chunk-DN6ZX5AY.js → chunk-WWCMSZII.js} +61 -14
- package/chunks/{chunk-COH43MRJ.js → chunk-XCGIMOLN.js} +27 -1
- package/chunks/{chunk-FY3M44RD.js → chunk-XP4L6KS3.js} +3 -3
- package/chunks/{chunk-6FGBXPWM.js → chunk-XQK4XXTN.js} +38 -44
- package/chunks/{chunk-A6UO2C7C.js → chunk-XUGZYLDH.js} +167 -81
- package/chunks/{chunk-LZEMEFKY.js → chunk-YANIWTRZ.js} +1 -1
- package/chunks/{chunk-IPUUTYMV.js → chunk-YDLJGZHL.js} +1 -1
- package/chunks/{chunk-HIJQF5B5.js → chunk-YGE3IXJP.js} +1 -1
- package/chunks/{chunk-BJX6ZSUK.js → chunk-YUFIEIWC.js} +2 -2
- package/chunks/{chunk-BO4XCS7P.js → chunk-Z3S5EMOW.js} +20 -85
- package/chunks/chunk-Z4X5MTRT.js +133 -0
- package/chunks/{chunk-UW5EOVUN.js → chunk-ZBVS26BY.js} +4 -4
- package/chunks/{chunk-PSWQZHEA.js → chunk-ZMOJ7ISP.js} +1 -1
- package/chunks/{chunk-HTO4JFDZ.js → chunk-ZPJWUGCS.js} +0 -1
- package/chunks/{chunk-MVS3NS2N.js → chunk-ZPZ7ZJEE.js} +28 -5
- package/chunks/{computer-use-DOFAHZAB.js → computer-use-5QWCFNKD.js} +52 -50
- package/chunks/{config-utils-VFQXVGNR.js → config-utils-WADIDWGG.js} +4 -4
- package/chunks/contextCommand-4Z7T7TUM.js +83 -0
- package/chunks/core-runtime-6N4EFC2Q.js +137 -0
- package/chunks/{create-sub-session-IWW2IZ2T.js → create-sub-session-62YZWVAY.js} +3 -3
- package/chunks/{create-sub-session-7543K2QA.js → create-sub-session-AEREHZBQ.js} +49 -47
- package/chunks/{cron-create-YIID5XAW.js → cron-create-6E7GIQTG.js} +6 -6
- package/chunks/{cron-delete-ZVHYCEP2.js → cron-delete-JD26XY3W.js} +5 -5
- package/chunks/{cron-list-XEGS463Q.js → cron-list-CUWFB44G.js} +6 -6
- package/chunks/{daemon-VOMQW7KZ.js → daemon-PCNCI5YU.js} +239 -18
- package/chunks/daemon-status-provider-DDF7C5M7.js +93 -0
- package/chunks/daemon-trust-policy-Q4KSOJTR.js +88 -0
- package/chunks/daemon-trust-policy-monitor-V6FTE3IY.js +175 -0
- package/chunks/{de-HGRCYDEJ.js → de-SY6O76BF.js} +6 -1
- package/chunks/deferred-core-runtime-GHJ5GQHK.js +92 -0
- package/chunks/dist-26BIMQT6.js +4487 -0
- package/chunks/{dist-KTYYJ2C5.js → dist-2PERFI23.js} +12 -9
- package/chunks/{dist-NNVBBOGU.js → dist-OAOC5OV4.js} +2 -2
- package/chunks/{dist-K6Y4E7FX.js → dist-PVEAFLHY.js} +5 -4
- package/chunks/{dist-RTJFMNEZ.js → dist-SL2LUMML.js} +1449 -14
- package/chunks/dist-ULIG4M5H.js +13415 -0
- package/chunks/{dist-ANLAT3GS.js → dist-WGMNT3JQ.js} +2 -1
- package/chunks/{dist-BRB6EXK4.js → dist-ZHXOBXDN.js} +3 -3
- package/chunks/earlyInputCapture-TQXLLISD.js +85 -0
- package/chunks/{edit-RIEOJWKB.js → edit-FJEUV6KZ.js} +51 -49
- package/chunks/{en-MTWBNGDO.js → en-NBK3JKCE.js} +9 -1
- package/chunks/{enter-worktree-OGK5FQ3R.js → enter-worktree-7GE3TZ4P.js} +51 -49
- package/chunks/{enterPlanMode-IWZYALIB.js → enterPlanMode-KR5TMPCJ.js} +51 -49
- package/chunks/environment-SWL3CMB3.js +105 -0
- package/chunks/errors-XQE7BGZV.js +91 -0
- package/chunks/esm-K5FARBNI.js +5548 -0
- package/chunks/{exit-worktree-4TEYVIVP.js → exit-worktree-CHKTYNCV.js} +51 -49
- package/chunks/exitPlanMode-QYAG6LWX.js +76 -0
- package/chunks/{fast-path-HYE7IFEV.js → fast-path-Z2K7W6DC.js} +13 -3
- package/chunks/{fr-45RLL55O.js → fr-4KG5V7UT.js} +6 -1
- package/chunks/{gemini-NGRQX3YJ.js → gemini-YU4XKEDG.js} +107 -103
- package/chunks/{geminiContentGenerator-FQHPFZSR.js → geminiContentGenerator-ZZX6NBO4.js} +7 -7
- package/chunks/{getMachineId-bsd-V7W3GODC.js → getMachineId-bsd-FG7IUY6U.js} +1 -1
- package/chunks/{getMachineId-darwin-TDO75DQP.js → getMachineId-darwin-GLCJI2RA.js} +1 -1
- package/chunks/{getMachineId-linux-TF43WQT2.js → getMachineId-linux-O6OPPAKO.js} +1 -1
- package/chunks/{getMachineId-unsupported-ZGUO3TXT.js → getMachineId-unsupported-S6CKYVGC.js} +1 -1
- package/chunks/{getMachineId-win-ECFYZZFQ.js → getMachineId-win-X5SRNEH7.js} +1 -1
- package/chunks/{glob-FRTM3X2E.js → glob-VYF5CXSX.js} +51 -49
- package/chunks/goal-tools-HGO6VXPB.js +335 -0
- package/chunks/{grep-RKWVROCW.js → grep-5DP5ZUTW.js} +53 -50
- package/chunks/handleAutoUpdate-UVBJ56DL.js +84 -0
- package/chunks/i18n-UQNYHEUD.js +100 -0
- package/chunks/{image-gen-WIEM7KZA.js → image-gen-WHPIZNWF.js} +12 -12
- package/chunks/initializer-GMIICF4W.js +89 -0
- package/chunks/installationInfo-4MGG4WVI.js +83 -0
- package/chunks/{ja-B7DF7DFG.js → ja-F3GSQXMF.js} +6 -1
- package/chunks/{keychain-token-storage-MDTG3WRM.js → keychain-token-storage-IKO4G53C.js} +3 -3
- package/chunks/lib-RUF3WZA6.js +9 -0
- package/chunks/list-CPN2W334.js +92 -0
- package/chunks/{list-agents-5KJJHR6I.js → list-agents-PXJ7ZUFB.js} +3 -3
- package/chunks/loadedSettingsAdapter-ZQAV5NDO.js +86 -0
- package/chunks/{loggingContentGenerator-WGM27QAW.js → loggingContentGenerator-5E7W4IEP.js} +31 -30
- package/chunks/{loop-wakeup-FXKNNYSY.js → loop-wakeup-Y26NQZ5I.js} +15 -8
- package/chunks/{ls-NTK6VOQJ.js → ls-ONQTTMQR.js} +5 -5
- package/chunks/{lsp-2JI24STP.js → lsp-YGHHRGMD.js} +3 -3
- package/chunks/{managed-npm-update-JQ2CG3RH.js → managed-npm-update-MKKAXYXA.js} +50 -48
- package/chunks/mcp-V5NTJF6X.js +86 -0
- package/chunks/{monitor-7FEWXX5F.js → monitor-CO3ASY6E.js} +51 -49
- package/chunks/nonInteractiveCli-ZJYEOO7U.js +148 -0
- package/chunks/{notebook-edit-JGJV2K6J.js → notebook-edit-Z7AEE6FM.js} +51 -49
- package/chunks/{openaiContentGenerator-JPVXDTAO.js → openaiContentGenerator-CA3MQOP3.js} +25 -27
- package/chunks/pidfile-NL7MKDRU.js +89 -0
- package/chunks/process-registry-2CHQBXH5.js +157 -0
- package/chunks/{processUtils-V2LCK6T6.js → processUtils-PB5K2DYH.js} +2 -2
- package/chunks/{pt-22Q3FP73.js → pt-EQ33KWEN.js} +6 -1
- package/chunks/{qwenContentGenerator-TICV2W2Z.js → qwenContentGenerator-JYFNDCOS.js} +55 -53
- package/chunks/{qwenOAuth2-XGFI5XJG.js → qwenOAuth2-W2ALKQDD.js} +10 -10
- package/chunks/read-file-IEOR5H5W.js +29 -0
- package/chunks/{read-mcp-resource-4DKQWGHD.js → read-mcp-resource-U2IJN5HM.js} +4 -4
- package/chunks/record-artifact-MGPJ7EG4.js +21 -0
- package/chunks/resumeHistoryUtils-BNBTP5AS.js +94 -0
- package/chunks/ripGrep-UMQODKEB.js +76 -0
- package/chunks/{ru-FZCNZHDC.js → ru-7OZAUKGG.js} +6 -1
- package/chunks/{run-qwen-serve-3VCV4I7E.js → run-qwen-serve-RN2R6QQW.js} +982 -263
- package/chunks/runtime-QFJ2MJF5.js +122 -0
- package/chunks/{scheduler-RS2I6RU5.js → scheduler-AMYUFOZI.js} +49 -47
- package/chunks/{sdk-exporters-grpc-AK3LGHNO.js → sdk-exporters-grpc-54L4LS5L.js} +4 -4
- package/chunks/{sdk-exporters-http-FS6ZV7MF.js → sdk-exporters-http-4BQANSJ6.js} +7 -7
- package/chunks/{sdk-impl-7FZSCSXB.js → sdk-impl-Z4VXWVFX.js} +10 -10
- package/chunks/{send-message-Q6OOR6BR.js → send-message-PMP4ATVM.js} +8 -13
- package/chunks/serve-EIIYJVX3.js +92 -0
- package/chunks/{server-HRZ23U7M.js → server-EP2LLAPD.js} +4816 -1298
- package/chunks/{session-7XHZKTVV.js → session-GMPZBLOW.js} +101 -97
- package/chunks/{settings-7ZGZDXAS.js → settings-LN7RNKBS.js} +53 -51
- package/chunks/shell-EM2OWU5X.js +86 -0
- package/chunks/{skill-LIWXNLDW.js → skill-T5VPSK73.js} +22 -23
- package/chunks/skill-settings-GMR3GMNY.js +94 -0
- package/chunks/spawnChannel-YPCU62DI.js +85 -0
- package/chunks/standalone-update-JAKIM2NF.js +95 -0
- package/chunks/{startInteractiveUI-IW3CSKHA.js → startInteractiveUI-YETQWGYF.js} +1240 -903
- package/chunks/{syntheticOutput-I3757IWH.js → syntheticOutput-D7E6ZFKR.js} +4 -4
- package/chunks/task-create-NFCYD43L.js +26 -0
- package/chunks/{task-list-FOPULZEP.js → task-list-TAVMGEVD.js} +7 -7
- package/chunks/{task-stop-H6RHXFVQ.js → task-stop-ZDF2UJRM.js} +3 -3
- package/chunks/{task-update-M57TFZJT.js → task-update-6L7LHGEX.js} +12 -11
- package/chunks/{team-create-O2FROQ4R.js → team-create-LFJ6HGNY.js} +53 -51
- package/chunks/{team-delete-QE2UXJL7.js → team-delete-DPGGRQBU.js} +7 -7
- package/chunks/{team-plan-approval-Q6WDBXTQ.js → team-plan-approval-C2KLSDGO.js} +51 -49
- package/chunks/theme-manager-JQ3ZGBP5.js +80 -0
- package/chunks/{todoWrite-VQ7FKOHL.js → todoWrite-2UO5G6G6.js} +34 -6
- package/chunks/{tool-search-APECNQ3Z.js → tool-search-FAZBFRJZ.js} +21 -22
- package/chunks/total-session-admission-5CALIVYO.js +88 -0
- package/chunks/{tree-sitter-FS4VPMZA.js → tree-sitter-4D7QS7F6.js} +1 -1
- package/chunks/{tree-sitter-bash-6B46JJCV.js → tree-sitter-bash-VEJGF5XF.js} +1 -1
- package/chunks/trustedFolders-KOPSP44S.js +98 -0
- package/chunks/{update-relaunch-ON5MDJQG.js → update-relaunch-6QL2TICS.js} +5 -5
- package/chunks/updateCheck-4Q6RIKFW.js +95 -0
- package/chunks/useAutoAcceptIndicator-Q5BMKZV3.js +96 -0
- package/chunks/{validateNonInterActiveAuth-JBLKBKRD.js → validateNonInterActiveAuth-GKOC5F6Z.js} +95 -91
- package/chunks/{version-LTNUBQJY.js → version-VSATY2LD.js} +1 -1
- package/chunks/{web-fetch-L5UTI53V.js → web-fetch-JCLKL6NL.js} +19 -21
- package/chunks/{web-search-KM33JOS3.js → web-search-DSQTFUBX.js} +13 -13
- package/chunks/{workflow-K7FAWV77.js → workflow-M6QAVKVJ.js} +52 -50
- package/chunks/workspace-providers-status-YKLTLMJA.js +89 -0
- package/chunks/{workspace-registration-store-6TGVDJV5.js → workspace-registration-store-5DMGKU64.js} +1 -1
- package/chunks/workspace-registry-PTYUSYXX.js +96 -0
- package/chunks/workspace-service-25ML3T47.js +103 -0
- package/chunks/workspace-skills-status-YKZWOYRX.js +89 -0
- package/chunks/workspace-trust-reconciler-5FI2S3OS.js +349 -0
- package/chunks/write-file-AY7VLP5X.js +78 -0
- package/chunks/xterm-headless-NTYVIBT3.js +3475 -0
- package/chunks/{zh-LUIGBD55.js → zh-H3YDK5QW.js} +9 -1
- package/chunks/{zh-TW-F5KG2IYD.js → zh-TW-JYCP7XUA.js} +9 -1
- package/chunks/zoom-image-S4LJZMD5.js +224 -0
- package/cli.js +50 -16
- package/locales/ca.js +7 -2
- package/locales/de.js +7 -2
- package/locales/en.js +10 -2
- package/locales/fr.js +7 -2
- package/locales/ja.js +7 -2
- package/locales/pt.js +7 -2
- package/locales/ru.js +7 -2
- package/locales/zh-TW.js +10 -2
- package/locales/zh.js +10 -2
- package/package.json +5 -4
- package/web-shell/assets/{arc-BbHijhiN.js → arc-xjArKHU2.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-Cb4B_JD0.js → architectureDiagram-3BPJPVTR-BgrQDNYG.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-Dsjlh3H-.js → blockDiagram-GPEHLZMM-CXxWC-1_.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-Cp5AeR4U.js → c4Diagram-AAUBKEIU-Dx1tLm3v.js} +1 -1
- package/web-shell/assets/channel-B1cyk94G.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-CLcY7W2e.js → chunk-2J33WTMH-CBxjogVR.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-BUhvY2LR.js → chunk-4BX2VUAB-izb-rY5W.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-kDIFC_71.js → chunk-55IACEB6-NzLyvSb8.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-CIBO15f2.js → chunk-727SXJPM-DVyKb0dl.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-BJ_T_slV.js → chunk-AQP2D5EJ-BtqL7NzB.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-BEkW35J8.js → chunk-FMBD7UC4-iNpdKIO0.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-GGPxofay.js → chunk-ND2GUHAM-DI7cbFmX.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-Bifllrb6.js → chunk-QZHKN3VN-3Y_-xFYs.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-BpBYZoRE.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-BpBYZoRE.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-C-Add_Dp.js → cose-bilkent-S5V4N54A--raRatZn.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-B7MfwNq2.js → dagre-BM42HDAG-B8SU70mO.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-CY_0zuDz.js → diagram-2AECGRRQ-ewgoakXo.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-VyYSbCgA.js → diagram-5GNKFQAL-Bm_JLTnS.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-CBiIZ2PL.js → diagram-KO2AKTUF-DEIUjUy9.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-BL3CrVOx.js → diagram-LMA3HP47-C2Wmrpj-.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-CZUPx96P.js → diagram-OG6HWLK6-CtYe6bFx.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-B81xHr1-.js → erDiagram-TEJ5UH35-DfpHcWLV.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-EZWhir-J.js → flowDiagram-I6XJVG4X-CAiUhio5.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-CVFSuIAg.js → ganttDiagram-6RSMTGT7-CYc7ezr4.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-C1H2uQDv.js → gitGraphDiagram-PVQCEYII-70lbkcRS.js} +1 -1
- package/web-shell/assets/index-C1k3PDuU.css +5 -0
- package/web-shell/assets/index-C2GE3DAF.js +74 -0
- package/web-shell/assets/index-DZLIXILO.js +1750 -0
- package/web-shell/assets/{index-BYo99NBH.js → index-Ww86nT9f.js} +1 -1
- package/web-shell/assets/{infoDiagram-5YYISTIA-BwyFMlF8.js → infoDiagram-5YYISTIA-C7e8DWPa.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-CQ7Yhn2Y.js → ishikawaDiagram-YF4QCWOH-BYLr2op-.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-CJn2sf0l.js → journeyDiagram-JHISSGLW-hEibAHKX.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-DaNRqwVN.js → kanban-definition-UN3LZRKU-F2rt8Uhp.js} +1 -1
- package/web-shell/assets/{linear-DCKODZe2.js → linear-DPhyNezd.js} +1 -1
- package/web-shell/assets/{mermaid.core-CTGJOk27.js → mermaid.core-ZUtnug0n.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-BKU3_3rg.js → mindmap-definition-RKZ34NQL-DDWcMoi8.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-COcwBJ82.js → pieDiagram-4H26LBE5-CTRKzw1_.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-CQnQ443x.js → quadrantDiagram-W4KKPZXB-CAEwYG_z.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-CZ2oj5cD.js → requirementDiagram-4Y6WPE33-CRjnH9D9.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-BxAv5mNu.js → sankeyDiagram-5OEKKPKP-LPQT_sOd.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CztaySPs.js → sequenceDiagram-3UESZ5HK-Ht2Iqvb0.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-CTQT1oGD.js → stateDiagram-AJRCARHV-CIUdqOXu.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BmqqQZ6w.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-K9Mkex5A.js → timeline-definition-PNZ67QCA-BcilneZF.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-B2rVIw76.js → vennDiagram-CIIHVFJN-BljwiiH1.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-Z1w2JR4M.js → wardley-L42UT6IY-DeKjkYjq.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-CIX9aKXf.js → wardleyDiagram-YWT4CUSO-L3U1H7KG.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-CI9DLIKB.js → xychartDiagram-2RQKCTM6-IJnWsgMT.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/MaxSizedBox-INHRH72H.js +0 -86
- package/chunks/agent-VXDAN5JK.js +0 -82
- package/chunks/agent-headless-K4ZMMNBD.js +0 -76
- package/chunks/bridge-LGPZCFHO.js +0 -91
- package/chunks/channel-settings-store-CHCDRTPY.js +0 -89
- package/chunks/chunk-SZRN75WQ.js +0 -29
- package/chunks/chunk-UGYMA4EI.js +0 -219
- package/chunks/chunk-VCBZUOSI.js +0 -8575
- package/chunks/contextCommand-QIZYHDR5.js +0 -81
- package/chunks/daemon-status-provider-OS5UWBHV.js +0 -90
- package/chunks/earlyInputCapture-WQT24RWD.js +0 -83
- package/chunks/environment-VZ7BRI4Q.js +0 -103
- package/chunks/errors-PCX25DVP.js +0 -89
- package/chunks/exitPlanMode-GHPUHBZJ.js +0 -423
- package/chunks/handleAutoUpdate-2CZQRJ66.js +0 -82
- package/chunks/i18n-XEQVMRKN.js +0 -98
- package/chunks/initializer-OVGZ4FLY.js +0 -87
- package/chunks/installationInfo-5UUQJI6Y.js +0 -81
- package/chunks/list-HODU6RXD.js +0 -90
- package/chunks/loadedSettingsAdapter-TYNLBALY.js +0 -84
- package/chunks/mcp-J3DFWX4A.js +0 -84
- package/chunks/nonInteractiveCli-F4GYSMHT.js +0 -144
- package/chunks/pidfile-4VNAR3EP.js +0 -87
- package/chunks/read-file-LZXUR4TO.js +0 -31
- package/chunks/resumeHistoryUtils-65OX3SGJ.js +0 -92
- package/chunks/ripGrep-2U2FRGMV.js +0 -74
- package/chunks/runtime-AXJWIEDU.js +0 -120
- package/chunks/serve-W2GC47CM.js +0 -90
- package/chunks/shell-45IPBDP5.js +0 -84
- package/chunks/spawnChannel-PVXQ5AGV.js +0 -83
- package/chunks/src-AY65BYR7.js +0 -3166
- package/chunks/standalone-update-ZMFNKAEY.js +0 -93
- package/chunks/task-create-N7WQSGYA.js +0 -25
- package/chunks/theme-manager-YYPZFBAH.js +0 -78
- package/chunks/total-session-admission-JXES723M.js +0 -85
- package/chunks/trustedFolders-HVI7IXUH.js +0 -94
- package/chunks/updateCheck-WUJGHWZZ.js +0 -93
- package/chunks/useAutoAcceptIndicator-CHSTZLZD.js +0 -94
- package/chunks/workspace-providers-status-GAKSF4LL.js +0 -87
- package/chunks/workspace-registry-A7NQUONG.js +0 -89
- package/chunks/workspace-service-STGVSO4N.js +0 -99
- package/chunks/workspace-skills-status-66AK3DUA.js +0 -86
- package/chunks/write-file-HUUCEG4P.js +0 -74
- package/web-shell/assets/channel-Bzdx6E8P.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-Cd6wbiuK.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Cd6wbiuK.js +0 -1
- package/web-shell/assets/index-B2bXx96W.js +0 -1249
- package/web-shell/assets/index-_8mKjx8q.css +0 -5
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BjMdT6E_.js +0 -1
- package/chunks/{chunk-TARRHLLG.js → chunk-QUGAUQGJ.js} +25 -25
- package/chunks/{chunk-U7ZFW55U.js → chunk-VOQXFAY5.js} +977 -977
- /package/chunks/{chunk-LXXMOYPL.js → chunk-VXZBKKQR.js} +0 -0
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import {
|
|
4
|
-
buildPermissionSuggestions
|
|
5
|
-
} from "./chunk-43T5WDQ7.js";
|
|
6
|
-
import {
|
|
7
|
-
startPostRenderPrefetches
|
|
8
|
-
} from "./chunk-V6VRAM7B.js";
|
|
9
|
-
import {
|
|
10
|
-
stopAndGetCapturedInput
|
|
11
|
-
} from "./chunk-63P4EL5V.js";
|
|
12
|
-
import {
|
|
13
|
-
useAutoAcceptIndicator
|
|
14
|
-
} from "./chunk-QY5MMZ6O.js";
|
|
15
3
|
import {
|
|
16
4
|
classifyApiError
|
|
17
5
|
} from "./chunk-V7RNNPGC.js";
|
|
6
|
+
import {
|
|
7
|
+
buildPermissionSuggestions
|
|
8
|
+
} from "./chunk-43T5WDQ7.js";
|
|
18
9
|
import {
|
|
19
10
|
TUI_CHAT_RECORDING_FAILURE_MESSAGE,
|
|
20
11
|
reportChatRecordingFailureToAdapter
|
|
21
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JE2CEOBO.js";
|
|
22
13
|
import {
|
|
23
14
|
MAX_SUGGESTIONS_TO_SHOW,
|
|
24
15
|
SESSION_MENTION_PREFIX,
|
|
@@ -30,10 +21,10 @@ import {
|
|
|
30
21
|
matchMcpServerPrefix,
|
|
31
22
|
resolveAtCommandQuery,
|
|
32
23
|
sanitizeDisplayText
|
|
33
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-RG64CDT2.js";
|
|
34
25
|
import {
|
|
35
26
|
StreamJsonOutputAdapter
|
|
36
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-JJPKFJBT.js";
|
|
37
28
|
import {
|
|
38
29
|
BuiltinCommandLoader,
|
|
39
30
|
BundledSkillLoader,
|
|
@@ -63,6 +54,8 @@ import {
|
|
|
63
54
|
isBtwCommand,
|
|
64
55
|
isMidInputCompletableCommand,
|
|
65
56
|
isSlashCommand,
|
|
57
|
+
isStackedSkillCompletableCommand,
|
|
58
|
+
isValidStackedSkillPrefix,
|
|
66
59
|
normalizePartList,
|
|
67
60
|
parseDayKey,
|
|
68
61
|
parseSlashCommand,
|
|
@@ -71,21 +64,18 @@ import {
|
|
|
71
64
|
resetBackgroundStateForSessionSwitch,
|
|
72
65
|
serializeUserPromptExpansionPrompt,
|
|
73
66
|
supportsMatchers
|
|
74
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-FNDXMN7I.js";
|
|
68
|
+
import "./chunk-H6I4PGRV.js";
|
|
69
|
+
import {
|
|
70
|
+
startPostRenderPrefetches
|
|
71
|
+
} from "./chunk-L32VV3ZJ.js";
|
|
75
72
|
import {
|
|
76
73
|
EXTENSION_RELOAD_FAILED_REASON,
|
|
77
74
|
ExtensionRefreshState,
|
|
78
75
|
appEvents,
|
|
79
76
|
cleanupReviewWorktreeLeases,
|
|
80
77
|
loadHierarchicalGeminiMemory
|
|
81
|
-
} from "./chunk-
|
|
82
|
-
import {
|
|
83
|
-
disableKittyProtocol,
|
|
84
|
-
isKittyProtocolEnabled,
|
|
85
|
-
isKittyProtocolSupported,
|
|
86
|
-
pushKittyProtocolFlags
|
|
87
|
-
} from "./chunk-PQNHRFJC.js";
|
|
88
|
-
import "./chunk-5THCYPLO.js";
|
|
78
|
+
} from "./chunk-DEEABGH2.js";
|
|
89
79
|
import {
|
|
90
80
|
AboutBox,
|
|
91
81
|
BaseSelectionList,
|
|
@@ -117,6 +107,7 @@ import {
|
|
|
117
107
|
UIStateContext,
|
|
118
108
|
USER_AGREEMENT_RATE_HIGH,
|
|
119
109
|
USER_AGREEMENT_RATE_MEDIUM,
|
|
110
|
+
VirtualViewportContext,
|
|
120
111
|
checkExhaustive,
|
|
121
112
|
colorizeCode,
|
|
122
113
|
countMarkdownSourceBlocks,
|
|
@@ -157,41 +148,23 @@ import {
|
|
|
157
148
|
useTerminalSize,
|
|
158
149
|
useTextBuffer,
|
|
159
150
|
useUIActions,
|
|
160
|
-
useUIState
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
KeypressProvider,
|
|
164
|
-
useFocus,
|
|
165
|
-
useKeypress,
|
|
166
|
-
useKeypressContext
|
|
167
|
-
} from "./chunk-LNURQEMZ.js";
|
|
151
|
+
useUIState,
|
|
152
|
+
useVirtualViewport
|
|
153
|
+
} from "./chunk-AUOULH6Q.js";
|
|
168
154
|
import {
|
|
169
155
|
getCommandDisplayName,
|
|
170
156
|
getCommandSourceBadge
|
|
171
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-RDJOB6S3.js";
|
|
172
158
|
import {
|
|
173
159
|
computeSessionStats,
|
|
174
160
|
levelLabel
|
|
175
|
-
} from "./chunk-
|
|
176
|
-
import {
|
|
177
|
-
BEL,
|
|
178
|
-
OSC_PREFIX,
|
|
179
|
-
cleanupOldClipboardImages,
|
|
180
|
-
clipboardHasImage,
|
|
181
|
-
detectTerminal,
|
|
182
|
-
generateKittyId,
|
|
183
|
-
oscGhosttyNotify,
|
|
184
|
-
oscITerm2Notify,
|
|
185
|
-
oscKittyNotify,
|
|
186
|
-
saveClipboardImage,
|
|
187
|
-
writeOsc52
|
|
188
|
-
} from "./chunk-J56UI34H.js";
|
|
161
|
+
} from "./chunk-UV6KF7T3.js";
|
|
189
162
|
import "./chunk-4WGODMVR.js";
|
|
190
163
|
import {
|
|
191
164
|
MaxSizedBox,
|
|
192
165
|
OverflowProvider,
|
|
193
166
|
useOverflowState
|
|
194
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-FS674JW4.js";
|
|
195
168
|
import {
|
|
196
169
|
GeminiRespondingSpinner,
|
|
197
170
|
GeminiSpinner,
|
|
@@ -205,10 +178,41 @@ import {
|
|
|
205
178
|
expandCollapsedHistory,
|
|
206
179
|
isCollapsibleTool,
|
|
207
180
|
useStreamingContext
|
|
208
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-WWCMSZII.js";
|
|
209
182
|
import {
|
|
210
183
|
theme
|
|
211
|
-
} from "./chunk-
|
|
184
|
+
} from "./chunk-45IOTAUS.js";
|
|
185
|
+
import {
|
|
186
|
+
stopAndGetCapturedInput
|
|
187
|
+
} from "./chunk-TZTAV5RH.js";
|
|
188
|
+
import {
|
|
189
|
+
disableKittyProtocol,
|
|
190
|
+
isKittyProtocolEnabled,
|
|
191
|
+
isKittyProtocolSupported,
|
|
192
|
+
pushKittyProtocolFlags
|
|
193
|
+
} from "./chunk-PQNHRFJC.js";
|
|
194
|
+
import {
|
|
195
|
+
useAutoAcceptIndicator
|
|
196
|
+
} from "./chunk-HX6RLYUO.js";
|
|
197
|
+
import {
|
|
198
|
+
KeypressProvider,
|
|
199
|
+
useFocus,
|
|
200
|
+
useKeypress,
|
|
201
|
+
useKeypressContext
|
|
202
|
+
} from "./chunk-VMX5RZQH.js";
|
|
203
|
+
import {
|
|
204
|
+
BEL,
|
|
205
|
+
OSC_PREFIX,
|
|
206
|
+
cleanupOldClipboardImages,
|
|
207
|
+
clipboardHasImage,
|
|
208
|
+
detectTerminal,
|
|
209
|
+
generateKittyId,
|
|
210
|
+
oscGhosttyNotify,
|
|
211
|
+
oscITerm2Notify,
|
|
212
|
+
oscKittyNotify,
|
|
213
|
+
saveClipboardImage,
|
|
214
|
+
writeOsc52
|
|
215
|
+
} from "./chunk-NBD76HUW.js";
|
|
212
216
|
import {
|
|
213
217
|
require_jsx_runtime
|
|
214
218
|
} from "./chunk-SV5PQVQE.js";
|
|
@@ -225,42 +229,40 @@ import {
|
|
|
225
229
|
use_is_screen_reader_enabled_default,
|
|
226
230
|
use_stdin_default,
|
|
227
231
|
use_stdout_default
|
|
228
|
-
} from "./chunk-
|
|
229
|
-
import {
|
|
230
|
-
require_react
|
|
231
|
-
} from "./chunk-5QWWOFGG.js";
|
|
232
|
-
import "./chunk-TQCBGUHN.js";
|
|
232
|
+
} from "./chunk-2IIJTXYF.js";
|
|
233
233
|
import {
|
|
234
234
|
relaunchApp
|
|
235
|
-
} from "./chunk-
|
|
235
|
+
} from "./chunk-NHFEMWAZ.js";
|
|
236
236
|
import {
|
|
237
237
|
setUpdateHandler
|
|
238
|
-
} from "./chunk-
|
|
239
|
-
import "./chunk-
|
|
240
|
-
import "./chunk-YAF2MQZ6.js";
|
|
241
|
-
import "./chunk-3HBZKBMQ.js";
|
|
238
|
+
} from "./chunk-CO2U743O.js";
|
|
239
|
+
import "./chunk-RSVPYAGK.js";
|
|
242
240
|
import {
|
|
243
241
|
AUTO_THEME_NAME,
|
|
244
242
|
DEFAULT_THEME,
|
|
245
243
|
themeManager
|
|
246
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-IGTHU3T4.js";
|
|
247
245
|
import "./chunk-KW7NOTN6.js";
|
|
248
|
-
import
|
|
249
|
-
|
|
250
|
-
|
|
246
|
+
import {
|
|
247
|
+
require_react
|
|
248
|
+
} from "./chunk-5QWWOFGG.js";
|
|
249
|
+
import "./chunk-KXDONCPU.js";
|
|
251
250
|
import {
|
|
252
251
|
getErrorMessage as getErrorMessage2
|
|
253
|
-
} from "./chunk-
|
|
252
|
+
} from "./chunk-CU47KXB5.js";
|
|
253
|
+
import "./chunk-PJOHNFIY.js";
|
|
254
|
+
import "./chunk-OFZKFPYG.js";
|
|
255
|
+
import "./chunk-YAF2MQZ6.js";
|
|
254
256
|
import {
|
|
255
257
|
openQwenAsrRealtimeStream,
|
|
256
258
|
openVoiceStream,
|
|
257
259
|
openVoiceStreamWithRetry
|
|
258
|
-
} from "./chunk-
|
|
260
|
+
} from "./chunk-YUFIEIWC.js";
|
|
259
261
|
import {
|
|
260
262
|
recordGoalStatusItem,
|
|
261
263
|
restoreGoalFromHistory
|
|
262
|
-
} from "./chunk-
|
|
263
|
-
import "./chunk-
|
|
264
|
+
} from "./chunk-PZEXDV3H.js";
|
|
265
|
+
import "./chunk-675H6PLP.js";
|
|
264
266
|
import {
|
|
265
267
|
cpLen,
|
|
266
268
|
cpSlice,
|
|
@@ -272,8 +274,8 @@ import {
|
|
|
272
274
|
sanitizeTerminalText,
|
|
273
275
|
stripUnsafeCharacters,
|
|
274
276
|
toCodePoints
|
|
275
|
-
} from "./chunk-
|
|
276
|
-
import "./chunk-
|
|
277
|
+
} from "./chunk-YDLJGZHL.js";
|
|
278
|
+
import "./chunk-PCK4B6LR.js";
|
|
277
279
|
import {
|
|
278
280
|
stringWidth
|
|
279
281
|
} from "./chunk-2MIN6GRR.js";
|
|
@@ -283,30 +285,26 @@ import {
|
|
|
283
285
|
} from "./chunk-QTERJVPZ.js";
|
|
284
286
|
import "./chunk-3Z43GZUQ.js";
|
|
285
287
|
import "./chunk-RXFQM6FQ.js";
|
|
288
|
+
import "./chunk-V4XNUDPE.js";
|
|
289
|
+
import "./chunk-6H67XLET.js";
|
|
286
290
|
import {
|
|
287
291
|
assertVoiceBaseUrlNetworkAllowed,
|
|
288
292
|
isKeytermEcho,
|
|
289
293
|
isStreamingVoiceModel,
|
|
290
294
|
resolveVoiceStreamConfig,
|
|
291
295
|
transcribeVoiceAudio
|
|
292
|
-
} from "./chunk-
|
|
296
|
+
} from "./chunk-7KAXXBER.js";
|
|
293
297
|
import {
|
|
294
298
|
formatUnsupportedVoiceModelMessage,
|
|
295
299
|
isSelectableVoiceModel
|
|
296
|
-
} from "./chunk-
|
|
297
|
-
import "./chunk-
|
|
298
|
-
import "./chunk-XHRTVPG2.js";
|
|
299
|
-
import {
|
|
300
|
-
requestConsentInteractive,
|
|
301
|
-
requestConsentOrFail
|
|
302
|
-
} from "./chunk-2YZJCM5T.js";
|
|
303
|
-
import "./chunk-57OAHC2Y.js";
|
|
300
|
+
} from "./chunk-P5VC5USY.js";
|
|
301
|
+
import "./chunk-CNTR4GR6.js";
|
|
304
302
|
import {
|
|
305
303
|
createLoadedSettingsAdapter
|
|
306
|
-
} from "./chunk-
|
|
304
|
+
} from "./chunk-PVNQRENX.js";
|
|
307
305
|
import {
|
|
308
306
|
getExtendedSystemInfo
|
|
309
|
-
} from "./chunk-
|
|
307
|
+
} from "./chunk-Q5WZTTWE.js";
|
|
310
308
|
import {
|
|
311
309
|
formatDuration,
|
|
312
310
|
formatMemoryUsage,
|
|
@@ -314,29 +312,39 @@ import {
|
|
|
314
312
|
formatTokenCount
|
|
315
313
|
} from "./chunk-E5Z2AVNV.js";
|
|
316
314
|
import "./chunk-GLWP3FDB.js";
|
|
317
|
-
import "./chunk-
|
|
315
|
+
import "./chunk-XCGIMOLN.js";
|
|
318
316
|
import {
|
|
319
317
|
isInlineModelOverrideAllowed
|
|
320
|
-
} from "./chunk-
|
|
321
|
-
import "./chunk-MVS3NS2N.js";
|
|
322
|
-
import "./chunk-ER5LWJR6.js";
|
|
323
|
-
import "./chunk-W4CQXHT6.js";
|
|
324
|
-
import "./chunk-MK7VQDN3.js";
|
|
325
|
-
import "./chunk-V6WHFGST.js";
|
|
318
|
+
} from "./chunk-6TAASXWL.js";
|
|
326
319
|
import {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
320
|
+
computeWorkspaceSkillListUpdates,
|
|
321
|
+
resolveSkillSettings,
|
|
322
|
+
skillSettingStrings
|
|
323
|
+
} from "./chunk-Z4X5MTRT.js";
|
|
324
|
+
import "./chunk-D6MDRSZ6.js";
|
|
325
|
+
import {
|
|
326
|
+
requestConsentInteractive,
|
|
327
|
+
requestConsentOrFail
|
|
328
|
+
} from "./chunk-A7Y5H4TX.js";
|
|
329
|
+
import "./chunk-57OAHC2Y.js";
|
|
330
|
+
import "./chunk-I5BT7ADR.js";
|
|
331
|
+
import "./chunk-FANRZEAJ.js";
|
|
332
|
+
import "./chunk-KWHKHSIS.js";
|
|
333
|
+
import "./chunk-V6WHFGST.js";
|
|
331
334
|
import "./chunk-2RFKHEXL.js";
|
|
335
|
+
import "./chunk-FYJ7W2PI.js";
|
|
332
336
|
import "./chunk-U4VTUMMK.js";
|
|
333
|
-
import "./chunk-
|
|
337
|
+
import "./chunk-6MPDY6ZG.js";
|
|
334
338
|
import "./chunk-ALMR3E6Q.js";
|
|
335
339
|
import "./chunk-BK2UNYWD.js";
|
|
336
340
|
import "./chunk-M5GB774H.js";
|
|
337
|
-
import "./chunk-
|
|
341
|
+
import "./chunk-IIUGIWWY.js";
|
|
342
|
+
import "./chunk-ZPZ7ZJEE.js";
|
|
343
|
+
import "./chunk-JCJ7LKNA.js";
|
|
338
344
|
import "./chunk-UDXSXLER.js";
|
|
339
|
-
import
|
|
345
|
+
import {
|
|
346
|
+
loadMcpApprovals
|
|
347
|
+
} from "./chunk-KR32NIAN.js";
|
|
340
348
|
import {
|
|
341
349
|
CORRUPTED_SUFFIX,
|
|
342
350
|
SettingScope,
|
|
@@ -359,7 +367,7 @@ import {
|
|
|
359
367
|
settingExistsInScope,
|
|
360
368
|
validateSettingValue,
|
|
361
369
|
writeOutputLanguageAndRegisterPath
|
|
362
|
-
} from "./chunk-
|
|
370
|
+
} from "./chunk-W3UKBMSI.js";
|
|
363
371
|
import "./chunk-RKUWKYED.js";
|
|
364
372
|
import "./chunk-GOXKNSDZ.js";
|
|
365
373
|
import "./chunk-IDS7MSUP.js";
|
|
@@ -368,27 +376,30 @@ import {
|
|
|
368
376
|
localizeToolDisplayName,
|
|
369
377
|
t,
|
|
370
378
|
ta
|
|
371
|
-
} from "./chunk-
|
|
372
|
-
import "./chunk-
|
|
379
|
+
} from "./chunk-3F2WDAV6.js";
|
|
380
|
+
import "./chunk-EU5TBFJI.js";
|
|
373
381
|
import "./chunk-6PEXNQTX.js";
|
|
374
|
-
import "./chunk-
|
|
375
|
-
import
|
|
376
|
-
getCliVersion
|
|
377
|
-
} from "./chunk-I7XZ3RY5.js";
|
|
378
|
-
import "./chunk-VJNBRRZG.js";
|
|
382
|
+
import "./chunk-DP3IHZGG.js";
|
|
383
|
+
import "./chunk-GJ2GBPBD.js";
|
|
379
384
|
import {
|
|
380
385
|
isWorkspaceTrusted,
|
|
381
386
|
loadTrustedFolders
|
|
382
|
-
} from "./chunk-
|
|
387
|
+
} from "./chunk-P755N4CS.js";
|
|
383
388
|
import {
|
|
384
389
|
require_strip_json_comments
|
|
385
390
|
} from "./chunk-ALGGS7UH.js";
|
|
386
391
|
import "./chunk-MR3PXB6E.js";
|
|
392
|
+
import "./chunk-XFSFZCM5.js";
|
|
393
|
+
import "./chunk-URK542T4.js";
|
|
394
|
+
import {
|
|
395
|
+
getCliVersion
|
|
396
|
+
} from "./chunk-2KKCCLPT.js";
|
|
397
|
+
import "./chunk-VJNBRRZG.js";
|
|
387
398
|
import {
|
|
388
399
|
clearScreen,
|
|
389
|
-
writeStderrLine
|
|
400
|
+
writeStderrLine,
|
|
401
|
+
writeStderrLineSafe
|
|
390
402
|
} from "./chunk-OWAK7LMW.js";
|
|
391
|
-
import "./chunk-XFSFZCM5.js";
|
|
392
403
|
import {
|
|
393
404
|
ALIBABA_PROVIDERS,
|
|
394
405
|
AsyncFzf,
|
|
@@ -476,7 +487,6 @@ import {
|
|
|
476
487
|
parseInstallSource,
|
|
477
488
|
parseRule,
|
|
478
489
|
parseVisionModelSetting,
|
|
479
|
-
promptIdContext,
|
|
480
490
|
readWorktreeSession,
|
|
481
491
|
readWorktreeSessionMarker,
|
|
482
492
|
redactUrlCredentials,
|
|
@@ -495,68 +505,74 @@ import {
|
|
|
495
505
|
validateWorkflowName,
|
|
496
506
|
watchRepoBranch,
|
|
497
507
|
writeRuntimeStatus
|
|
498
|
-
} from "./chunk-
|
|
508
|
+
} from "./chunk-54YCNSK5.js";
|
|
499
509
|
import "./chunk-5M6IDOMF.js";
|
|
500
510
|
import "./chunk-TWPJO254.js";
|
|
501
511
|
import "./chunk-H6XPXXMH.js";
|
|
502
|
-
import "./chunk-
|
|
503
|
-
import "./chunk-
|
|
504
|
-
import "./chunk-
|
|
505
|
-
import "./chunk-
|
|
506
|
-
import "./chunk-FNQ6T3CV.js";
|
|
507
|
-
import "./chunk-ZOIFNCKL.js";
|
|
508
|
-
import "./chunk-PWTZEM3C.js";
|
|
512
|
+
import "./chunk-AOHY3QJ3.js";
|
|
513
|
+
import "./chunk-5NNHICSA.js";
|
|
514
|
+
import "./chunk-SHN4KHDK.js";
|
|
515
|
+
import "./chunk-JXVC2PL3.js";
|
|
509
516
|
import "./chunk-KRXPRVGL.js";
|
|
510
517
|
import "./chunk-6PVPNMXU.js";
|
|
511
518
|
import {
|
|
512
519
|
resolveModelId
|
|
513
|
-
} from "./chunk-
|
|
514
|
-
import "./chunk-
|
|
515
|
-
import "./chunk-
|
|
520
|
+
} from "./chunk-ZMOJ7ISP.js";
|
|
521
|
+
import "./chunk-IRH27ZC2.js";
|
|
522
|
+
import "./chunk-QHWCP53L.js";
|
|
523
|
+
import "./chunk-TEGJSJDF.js";
|
|
524
|
+
import "./chunk-TIRRPCFS.js";
|
|
525
|
+
import {
|
|
526
|
+
promptIdContext
|
|
527
|
+
} from "./chunk-O6GEWCJA.js";
|
|
528
|
+
import "./chunk-T26EAKDL.js";
|
|
516
529
|
import "./chunk-CPBF7KYF.js";
|
|
530
|
+
import "./chunk-4KP2F2TE.js";
|
|
531
|
+
import {
|
|
532
|
+
HOOKS_CONFIG_FIELDS
|
|
533
|
+
} from "./chunk-3APUUXRF.js";
|
|
534
|
+
import "./chunk-THVU3RNH.js";
|
|
535
|
+
import "./chunk-LHKCY7DY.js";
|
|
536
|
+
import "./chunk-6FMJLI5M.js";
|
|
517
537
|
import {
|
|
518
538
|
APPROVAL_MODES,
|
|
519
539
|
getStartupContextLength,
|
|
520
540
|
isSystemReminderContent,
|
|
521
541
|
runOutsideAgentContext
|
|
522
|
-
} from "./chunk-
|
|
523
|
-
import "./chunk-
|
|
524
|
-
import "./chunk-
|
|
525
|
-
import
|
|
526
|
-
HOOKS_CONFIG_FIELDS
|
|
527
|
-
} from "./chunk-3QMGYBFN.js";
|
|
528
|
-
import "./chunk-JCW2R7WC.js";
|
|
542
|
+
} from "./chunk-CBBP4BMC.js";
|
|
543
|
+
import "./chunk-S6LOFUVP.js";
|
|
544
|
+
import "./chunk-K623ENWT.js";
|
|
545
|
+
import "./chunk-AQ37AY7B.js";
|
|
529
546
|
import {
|
|
530
547
|
isPathWithinRoot
|
|
531
|
-
} from "./chunk-
|
|
532
|
-
import "./chunk-
|
|
533
|
-
import "./chunk-E5TUC6CA.js";
|
|
548
|
+
} from "./chunk-N4ACHWNH.js";
|
|
549
|
+
import "./chunk-ZPJWUGCS.js";
|
|
534
550
|
import {
|
|
535
551
|
osc8Hyperlink,
|
|
536
552
|
qwenOAuth2Events,
|
|
537
553
|
sanitizeForOsc,
|
|
538
554
|
supportsHyperlinks,
|
|
539
555
|
wrapForMultiplexer
|
|
540
|
-
} from "./chunk-
|
|
541
|
-
import "./chunk-
|
|
542
|
-
import "./chunk-
|
|
543
|
-
import "./chunk-
|
|
556
|
+
} from "./chunk-D4HTUMGX.js";
|
|
557
|
+
import "./chunk-NAVJD2PQ.js";
|
|
558
|
+
import "./chunk-LOY7RWQG.js";
|
|
559
|
+
import "./chunk-E6CJ2SMM.js";
|
|
544
560
|
import {
|
|
545
561
|
REASONING_EFFORT_TIERS
|
|
546
|
-
} from "./chunk-
|
|
562
|
+
} from "./chunk-DGEIYUC3.js";
|
|
547
563
|
import {
|
|
548
564
|
getUnsupportedImageFormatWarning,
|
|
549
565
|
isSupportedImageMimeType
|
|
550
|
-
} from "./chunk-
|
|
566
|
+
} from "./chunk-MPHPFVKK.js";
|
|
551
567
|
import "./chunk-GLNBDYUX.js";
|
|
552
568
|
import "./chunk-DJ2GSRLV.js";
|
|
553
|
-
import "./chunk-
|
|
554
|
-
import "./chunk-
|
|
555
|
-
import "./chunk-
|
|
569
|
+
import "./chunk-6CQWRWUC.js";
|
|
570
|
+
import "./chunk-Z3S5EMOW.js";
|
|
571
|
+
import "./chunk-2J3OJGTL.js";
|
|
556
572
|
import "./chunk-P3QQPMQA.js";
|
|
557
|
-
import "./chunk-
|
|
558
|
-
import "./chunk-
|
|
559
|
-
import "./chunk-
|
|
573
|
+
import "./chunk-XQK4XXTN.js";
|
|
574
|
+
import "./chunk-GLCZKT5V.js";
|
|
575
|
+
import "./chunk-QDK4F2N5.js";
|
|
560
576
|
import {
|
|
561
577
|
ApiCancelEvent,
|
|
562
578
|
AuthEvent,
|
|
@@ -597,7 +613,7 @@ import {
|
|
|
597
613
|
runVisionBridge,
|
|
598
614
|
shouldRunVisionBridge,
|
|
599
615
|
splitImageParts
|
|
600
|
-
} from "./chunk-
|
|
616
|
+
} from "./chunk-DUNI4EBW.js";
|
|
601
617
|
import "./chunk-VGC4I5JJ.js";
|
|
602
618
|
import {
|
|
603
619
|
AUTO_MEMORY_INDEX_FILENAME,
|
|
@@ -605,30 +621,27 @@ import {
|
|
|
605
621
|
getAutoMemoryRoot,
|
|
606
622
|
getUserAutoMemoryRoot,
|
|
607
623
|
isAnyAutoMemPath
|
|
608
|
-
} from "./chunk-
|
|
624
|
+
} from "./chunk-3I6DUGQD.js";
|
|
625
|
+
import "./chunk-7ULQIS27.js";
|
|
626
|
+
import {
|
|
627
|
+
ToolNames,
|
|
628
|
+
isShellProgressData
|
|
629
|
+
} from "./chunk-MM7TH7ZM.js";
|
|
609
630
|
import {
|
|
610
631
|
MAINLINE_CODER_MODEL
|
|
611
|
-
} from "./chunk-
|
|
632
|
+
} from "./chunk-HIVKI6O6.js";
|
|
612
633
|
import "./chunk-46UV252V.js";
|
|
613
|
-
import "./chunk-A4UCTEB5.js";
|
|
614
|
-
import "./chunk-XWRJCPHC.js";
|
|
615
634
|
import {
|
|
616
635
|
DEFAULT_TOKEN_LIMIT
|
|
617
|
-
} from "./chunk-
|
|
618
|
-
import "./chunk-
|
|
619
|
-
import "./chunk-
|
|
636
|
+
} from "./chunk-ZBVS26BY.js";
|
|
637
|
+
import "./chunk-Q3T5KA2V.js";
|
|
638
|
+
import "./chunk-R2XWGR75.js";
|
|
620
639
|
import {
|
|
621
640
|
atomicWriteFileSync
|
|
622
|
-
} from "./chunk-
|
|
623
|
-
import "./chunk-
|
|
641
|
+
} from "./chunk-HC45LTEN.js";
|
|
642
|
+
import "./chunk-QARJNL2V.js";
|
|
624
643
|
import "./chunk-W4RQUHY3.js";
|
|
625
|
-
import "./chunk-
|
|
626
|
-
import "./chunk-U7ZFW55U.js";
|
|
627
|
-
import "./chunk-UUUTRMI2.js";
|
|
628
|
-
import {
|
|
629
|
-
ToolNames,
|
|
630
|
-
isShellProgressData
|
|
631
|
-
} from "./chunk-PR75REBZ.js";
|
|
644
|
+
import "./chunk-G7XXKQYS.js";
|
|
632
645
|
import {
|
|
633
646
|
Storage,
|
|
634
647
|
UnauthorizedError,
|
|
@@ -640,17 +653,18 @@ import {
|
|
|
640
653
|
isNodeError,
|
|
641
654
|
shortenPath,
|
|
642
655
|
tildeifyPath
|
|
643
|
-
} from "./chunk-
|
|
644
|
-
import "./chunk-
|
|
656
|
+
} from "./chunk-E2BHWIDT.js";
|
|
657
|
+
import "./chunk-VOQXFAY5.js";
|
|
658
|
+
import "./chunk-6PQPKTXP.js";
|
|
659
|
+
import {
|
|
660
|
+
registerCleanup,
|
|
661
|
+
runExitCleanup
|
|
662
|
+
} from "./chunk-DQ2O5QOJ.js";
|
|
645
663
|
import {
|
|
646
664
|
finalizeStartupProfile,
|
|
647
665
|
profileCheckpoint
|
|
648
666
|
} from "./chunk-QSWDGAIC.js";
|
|
649
667
|
import "./chunk-Q7YDKOGY.js";
|
|
650
|
-
import {
|
|
651
|
-
registerCleanup,
|
|
652
|
-
runExitCleanup
|
|
653
|
-
} from "./chunk-B4UMZKMU.js";
|
|
654
668
|
import "./chunk-75DOP5OR.js";
|
|
655
669
|
import "./chunk-DMTGGOSA.js";
|
|
656
670
|
import "./chunk-YQ3U5MUC.js";
|
|
@@ -660,7 +674,7 @@ import {
|
|
|
660
674
|
import "./chunk-TYAMGABM.js";
|
|
661
675
|
import "./chunk-FCMNKVXT.js";
|
|
662
676
|
import "./chunk-AMDSOFFV.js";
|
|
663
|
-
import "./chunk-
|
|
677
|
+
import "./chunk-QUGAUQGJ.js";
|
|
664
678
|
import {
|
|
665
679
|
init_esbuild_shims
|
|
666
680
|
} from "./chunk-5O2XNYP6.js";
|
|
@@ -672,7 +686,7 @@ import {
|
|
|
672
686
|
// packages/cli/src/ui/startInteractiveUI.tsx
|
|
673
687
|
init_esbuild_shims();
|
|
674
688
|
import { basename as basename4 } from "node:path";
|
|
675
|
-
var
|
|
689
|
+
var import_react166 = __toESM(require_react(), 1);
|
|
676
690
|
|
|
677
691
|
// packages/cli/src/dualOutput/DualOutputBridge.ts
|
|
678
692
|
init_esbuild_shims();
|
|
@@ -1288,7 +1302,7 @@ var useRemoteInput = /* @__PURE__ */ __name(() => (0, import_react2.useContext)(
|
|
|
1288
1302
|
|
|
1289
1303
|
// packages/cli/src/ui/AppContainer.tsx
|
|
1290
1304
|
init_esbuild_shims();
|
|
1291
|
-
var
|
|
1305
|
+
var import_react164 = __toESM(require_react(), 1);
|
|
1292
1306
|
|
|
1293
1307
|
// packages/cli/src/ui/App.tsx
|
|
1294
1308
|
init_esbuild_shims();
|
|
@@ -5236,6 +5250,11 @@ var SessionTab = /* @__PURE__ */ __name(() => {
|
|
|
5236
5250
|
totalCached += m.tokens.cached;
|
|
5237
5251
|
}
|
|
5238
5252
|
const cacheRate = totalInput > 0 ? totalCached / totalInput * 100 : 0;
|
|
5253
|
+
const generation = metrics.generation;
|
|
5254
|
+
const lastGeneration = generation?.last;
|
|
5255
|
+
const lastTps = lastGeneration && lastGeneration.generationDurationMs > 0 ? lastGeneration.outputTokens / (lastGeneration.generationDurationMs / 1e3) : void 0;
|
|
5256
|
+
const averageTtft = generation && generation.timedRequests > 0 ? generation.totalTtftMs / generation.timedRequests : void 0;
|
|
5257
|
+
const sessionTps = generation && generation.totalGenerationDurationMs > 0 ? generation.totalThroughputOutputTokens / (generation.totalGenerationDurationMs / 1e3) : void 0;
|
|
5239
5258
|
const successColor = getStatusColor(computed.successRate, {
|
|
5240
5259
|
green: TOOL_SUCCESS_RATE_HIGH,
|
|
5241
5260
|
yellow: TOOL_SUCCESS_RATE_MEDIUM
|
|
@@ -5347,6 +5366,67 @@ var SessionTab = /* @__PURE__ */ __name(() => {
|
|
|
5347
5366
|
] })
|
|
5348
5367
|
] })
|
|
5349
5368
|
] }),
|
|
5369
|
+
lastGeneration && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
5370
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { bold: true, color: theme.text.primary, children: [
|
|
5371
|
+
t("Generation Metrics"),
|
|
5372
|
+
" (",
|
|
5373
|
+
t("Latest Request"),
|
|
5374
|
+
")"
|
|
5375
|
+
] }),
|
|
5376
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
|
|
5377
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: labelWidth, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
5378
|
+
t("Model"),
|
|
5379
|
+
":"
|
|
5380
|
+
] }) }),
|
|
5381
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: lastGeneration.model })
|
|
5382
|
+
] }),
|
|
5383
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
|
|
5384
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: labelWidth, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.secondary, children: "TTFT:" }) }),
|
|
5385
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: formatDuration(lastGeneration.ttftMs) })
|
|
5386
|
+
] }),
|
|
5387
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
|
|
5388
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: labelWidth, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
5389
|
+
t("Generation Time"),
|
|
5390
|
+
":"
|
|
5391
|
+
] }) }),
|
|
5392
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: formatDuration(lastGeneration.generationDurationMs) })
|
|
5393
|
+
] }),
|
|
5394
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
|
|
5395
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: labelWidth, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
5396
|
+
t("Output Tokens"),
|
|
5397
|
+
":"
|
|
5398
|
+
] }) }),
|
|
5399
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: lastGeneration.outputTokens.toLocaleString() })
|
|
5400
|
+
] }),
|
|
5401
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
|
|
5402
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: labelWidth, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.secondary, children: "TPS:" }) }),
|
|
5403
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: lastTps === void 0 ? "\u2014" : `${lastTps.toFixed(1)} tok/s` })
|
|
5404
|
+
] }),
|
|
5405
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { paddingLeft: 2, children: [
|
|
5406
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
5407
|
+
"\xBB ",
|
|
5408
|
+
t("Requests"),
|
|
5409
|
+
":"
|
|
5410
|
+
] }) }),
|
|
5411
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: generation.timedRequests })
|
|
5412
|
+
] }),
|
|
5413
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { paddingLeft: 2, children: [
|
|
5414
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
5415
|
+
"\xBB ",
|
|
5416
|
+
t("Average TTFT"),
|
|
5417
|
+
":"
|
|
5418
|
+
] }) }),
|
|
5419
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: averageTtft === void 0 ? "\u2014" : formatDuration(averageTtft) })
|
|
5420
|
+
] }),
|
|
5421
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { paddingLeft: 2, children: [
|
|
5422
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
5423
|
+
"\xBB ",
|
|
5424
|
+
t("Session TPS"),
|
|
5425
|
+
":"
|
|
5426
|
+
] }) }),
|
|
5427
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: sessionTps === void 0 ? "\u2014" : `${sessionTps.toFixed(1)} tok/s` })
|
|
5428
|
+
] })
|
|
5429
|
+
] }),
|
|
5350
5430
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
5351
5431
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { bold: true, color: theme.text.primary, children: t("Tokens") }),
|
|
5352
5432
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
|
|
@@ -9924,19 +10004,43 @@ var useTrustModify = /* @__PURE__ */ __name((onExit, addItem) => {
|
|
|
9924
10004
|
setPendingTrustLevel(trustLevel);
|
|
9925
10005
|
setNeedsRestart(true);
|
|
9926
10006
|
} else {
|
|
10007
|
+
setPendingTrustLevel(void 0);
|
|
10008
|
+
setNeedsRestart(false);
|
|
9927
10009
|
const folders = loadTrustedFolders();
|
|
9928
|
-
|
|
10010
|
+
try {
|
|
10011
|
+
folders.setValue(cwd3, trustLevel);
|
|
10012
|
+
} catch (error) {
|
|
10013
|
+
addItem(
|
|
10014
|
+
{
|
|
10015
|
+
type: "error" /* ERROR */,
|
|
10016
|
+
text: `Could not update workspace trust: ${error instanceof Error ? error.message : String(error)}`
|
|
10017
|
+
},
|
|
10018
|
+
Date.now()
|
|
10019
|
+
);
|
|
10020
|
+
return;
|
|
10021
|
+
}
|
|
9929
10022
|
onExit();
|
|
9930
10023
|
}
|
|
9931
10024
|
},
|
|
9932
10025
|
[cwd3, settings.merged, onExit, addItem]
|
|
9933
10026
|
);
|
|
9934
10027
|
const commitTrustLevelChange = (0, import_react32.useCallback)(() => {
|
|
9935
|
-
if (pendingTrustLevel)
|
|
9936
|
-
|
|
10028
|
+
if (!pendingTrustLevel) return false;
|
|
10029
|
+
const folders = loadTrustedFolders();
|
|
10030
|
+
try {
|
|
9937
10031
|
folders.setValue(cwd3, pendingTrustLevel);
|
|
10032
|
+
return true;
|
|
10033
|
+
} catch (error) {
|
|
10034
|
+
addItem(
|
|
10035
|
+
{
|
|
10036
|
+
type: "error" /* ERROR */,
|
|
10037
|
+
text: `Could not update workspace trust: ${error instanceof Error ? error.message : String(error)}`
|
|
10038
|
+
},
|
|
10039
|
+
Date.now()
|
|
10040
|
+
);
|
|
10041
|
+
return false;
|
|
9938
10042
|
}
|
|
9939
|
-
}, [cwd3, pendingTrustLevel]);
|
|
10043
|
+
}, [addItem, cwd3, pendingTrustLevel]);
|
|
9940
10044
|
return {
|
|
9941
10045
|
cwd: cwd3,
|
|
9942
10046
|
currentTrustLevel,
|
|
@@ -9987,9 +10091,10 @@ function TrustDialog({
|
|
|
9987
10091
|
onExit();
|
|
9988
10092
|
}
|
|
9989
10093
|
if (needsRestart && key.name === "r") {
|
|
9990
|
-
commitTrustLevelChange()
|
|
9991
|
-
|
|
9992
|
-
|
|
10094
|
+
if (commitTrustLevelChange()) {
|
|
10095
|
+
relaunchApp();
|
|
10096
|
+
onExit();
|
|
10097
|
+
}
|
|
9993
10098
|
}
|
|
9994
10099
|
},
|
|
9995
10100
|
{ isActive: true }
|
|
@@ -14663,8 +14768,8 @@ function SkillsManagerDialog({
|
|
|
14663
14768
|
const [loadError, setLoadError] = (0, import_react52.useState)(null);
|
|
14664
14769
|
const [query, setQuery] = (0, import_react52.useState)("");
|
|
14665
14770
|
const [activeValue, setActiveValue] = (0, import_react52.useState)(null);
|
|
14666
|
-
const
|
|
14667
|
-
() =>
|
|
14771
|
+
const initialResolved = (0, import_react52.useMemo)(
|
|
14772
|
+
() => resolveSkillSettings(settings),
|
|
14668
14773
|
[settings]
|
|
14669
14774
|
);
|
|
14670
14775
|
const higher = (0, import_react52.useMemo)(() => buildHigherDisabled(settings), [settings]);
|
|
@@ -14701,12 +14806,19 @@ function SkillsManagerDialog({
|
|
|
14701
14806
|
() => allSkills.filter((s) => !higher.set.has(lower(s.name))),
|
|
14702
14807
|
[allSkills, higher.set]
|
|
14703
14808
|
);
|
|
14809
|
+
const initialSelectedKeys = (0, import_react52.useMemo)(
|
|
14810
|
+
() => new Set(
|
|
14811
|
+
unlockedSkills.filter(
|
|
14812
|
+
(skill) => !initialResolved.disabledNames.has(lower(skill.name))
|
|
14813
|
+
).map((skill) => skill.name)
|
|
14814
|
+
),
|
|
14815
|
+
[initialResolved, unlockedSkills]
|
|
14816
|
+
);
|
|
14704
14817
|
const [selectedKeys, setSelectedKeys] = (0, import_react52.useState)(null);
|
|
14705
14818
|
(0, import_react52.useEffect)(() => {
|
|
14706
14819
|
if (selectedKeys !== null || unlockedSkills.length === 0) return;
|
|
14707
|
-
|
|
14708
|
-
|
|
14709
|
-
}, [unlockedSkills, initialWorkspaceDisabled, selectedKeys]);
|
|
14820
|
+
setSelectedKeys([...initialSelectedKeys]);
|
|
14821
|
+
}, [unlockedSkills, initialSelectedKeys, selectedKeys]);
|
|
14710
14822
|
const filteredUnlocked = (0, import_react52.useMemo)(() => {
|
|
14711
14823
|
const normalizedQuery = query.trim().toLowerCase();
|
|
14712
14824
|
if (!normalizedQuery) return unlockedSkills;
|
|
@@ -14761,33 +14873,40 @@ function SkillsManagerDialog({
|
|
|
14761
14873
|
return "untrusted";
|
|
14762
14874
|
}
|
|
14763
14875
|
const selected = new Set(selectedKeys ?? []);
|
|
14764
|
-
const
|
|
14765
|
-
|
|
14766
|
-
|
|
14876
|
+
const workspaceDisabled = namesFromScope(
|
|
14877
|
+
settings,
|
|
14878
|
+
"Workspace" /* Workspace */
|
|
14879
|
+
).filter((name) => typeof name === "string");
|
|
14880
|
+
const lockedNames = new Set(lockedSkills.map((skill) => lower(skill.name)));
|
|
14881
|
+
const { disabled, enabled, disabledChanged, enabledChanged } = computeWorkspaceSkillListUpdates(
|
|
14882
|
+
workspaceDisabled,
|
|
14883
|
+
lockedNames,
|
|
14884
|
+
skillSettingStrings(settings, "Workspace" /* Workspace */, "enabled"),
|
|
14885
|
+
unlockedSkills.map((skill) => ({
|
|
14886
|
+
name: skill.name,
|
|
14887
|
+
wasEnabled: initialSelectedKeys.has(skill.name),
|
|
14888
|
+
isEnabled: selected.has(skill.name),
|
|
14889
|
+
defaultDisabled: initialResolved.defaultDisabledNames.has(lower(skill.name)) && !initialResolved.enabledNames.has(lower(skill.name))
|
|
14890
|
+
}))
|
|
14767
14891
|
);
|
|
14768
|
-
|
|
14769
|
-
const nextDisabled = [];
|
|
14770
|
-
const allKnownLower = new Set(allSkills.map((s) => lower(s.name)));
|
|
14771
|
-
for (const prev of previousStrings) {
|
|
14772
|
-
if (!allKnownLower.has(lower(prev))) {
|
|
14773
|
-
nextDisabled.push(prev);
|
|
14774
|
-
}
|
|
14775
|
-
}
|
|
14776
|
-
for (const s of unlockedSkills) {
|
|
14777
|
-
if (selected.has(s.name)) continue;
|
|
14778
|
-
const existing = previousMap.get(lower(s.name));
|
|
14779
|
-
nextDisabled.push(existing ?? s.name);
|
|
14780
|
-
}
|
|
14781
|
-
const prevNormalized = normalizeNames(previousWorkspace).sort();
|
|
14782
|
-
const nextNormalized = normalizeNames(nextDisabled).sort();
|
|
14783
|
-
const unchanged = prevNormalized.length === nextNormalized.length && prevNormalized.every((n, i) => n === nextNormalized[i]);
|
|
14784
|
-
if (unchanged) return "ok";
|
|
14892
|
+
if (!disabledChanged && !enabledChanged) return "ok";
|
|
14785
14893
|
try {
|
|
14786
|
-
settings.
|
|
14787
|
-
|
|
14788
|
-
|
|
14789
|
-
|
|
14790
|
-
|
|
14894
|
+
settings.setValues([
|
|
14895
|
+
...disabledChanged ? [
|
|
14896
|
+
{
|
|
14897
|
+
scope: "Workspace" /* Workspace */,
|
|
14898
|
+
key: "skills.disabled",
|
|
14899
|
+
value: disabled.length > 0 ? disabled : void 0
|
|
14900
|
+
}
|
|
14901
|
+
] : [],
|
|
14902
|
+
...enabledChanged ? [
|
|
14903
|
+
{
|
|
14904
|
+
scope: "Workspace" /* Workspace */,
|
|
14905
|
+
key: "skills.enabled",
|
|
14906
|
+
value: enabled.length > 0 ? enabled : void 0
|
|
14907
|
+
}
|
|
14908
|
+
] : []
|
|
14909
|
+
]);
|
|
14791
14910
|
} catch (e) {
|
|
14792
14911
|
addItem(
|
|
14793
14912
|
{
|
|
@@ -14822,7 +14941,9 @@ function SkillsManagerDialog({
|
|
|
14822
14941
|
return "ok";
|
|
14823
14942
|
}, [
|
|
14824
14943
|
addItem,
|
|
14825
|
-
|
|
14944
|
+
initialResolved,
|
|
14945
|
+
initialSelectedKeys,
|
|
14946
|
+
lockedSkills,
|
|
14826
14947
|
reloadCommands,
|
|
14827
14948
|
selectedKeys,
|
|
14828
14949
|
settings,
|
|
@@ -26373,7 +26494,7 @@ function useCommandCompletion(buffer, cwd3, slashCommands, commandContext, rever
|
|
|
26373
26494
|
query,
|
|
26374
26495
|
completionStart,
|
|
26375
26496
|
completionEnd,
|
|
26376
|
-
|
|
26497
|
+
slashCompletionContext
|
|
26377
26498
|
} = (0, import_react88.useMemo)(() => {
|
|
26378
26499
|
const currentLine = buffer.lines[cursorRow] || "";
|
|
26379
26500
|
const codePoints = toCodePoints(currentLine);
|
|
@@ -26408,49 +26529,61 @@ function useCommandCompletion(buffer, cwd3, slashCommands, commandContext, rever
|
|
|
26408
26529
|
query: partialPath,
|
|
26409
26530
|
completionStart: pathStart,
|
|
26410
26531
|
completionEnd: end,
|
|
26411
|
-
|
|
26532
|
+
slashCompletionContext: null
|
|
26412
26533
|
};
|
|
26413
26534
|
}
|
|
26414
26535
|
}
|
|
26415
|
-
if (cursorRow === 0 && isSlashCommand(currentLine.trim())) {
|
|
26416
|
-
return {
|
|
26417
|
-
completionMode: "SLASH" /* SLASH */,
|
|
26418
|
-
query: currentLine,
|
|
26419
|
-
completionStart: 0,
|
|
26420
|
-
completionEnd: currentLine.length,
|
|
26421
|
-
isMidInputSlashCompletion: false
|
|
26422
|
-
};
|
|
26423
|
-
}
|
|
26424
26536
|
const cursorOffset = logicalPosToOffset(buffer.lines, cursorRow, cursorCol);
|
|
26425
26537
|
const midCmd = findMidInputSlashCommand(buffer.text, cursorOffset);
|
|
26426
|
-
if (midCmd
|
|
26427
|
-
midCmd.partialCommand,
|
|
26428
|
-
slashCommands
|
|
26429
|
-
)) {
|
|
26538
|
+
if (midCmd) {
|
|
26430
26539
|
const lineStartOffset = logicalPosToOffset(buffer.lines, cursorRow, 0);
|
|
26431
26540
|
const startOnLine = midCmd.startPos - lineStartOffset;
|
|
26432
|
-
|
|
26541
|
+
const isInitialCommandOnFirstLine = cursorRow === 0 && isSlashCommand(currentLine.trim()) && startOnLine >= 0 && codePoints.slice(0, startOnLine).join("").trim().length === 0;
|
|
26542
|
+
const inputCodePoints = toCodePoints(buffer.text);
|
|
26543
|
+
const prefix = inputCodePoints.slice(0, midCmd.startPos).join("");
|
|
26544
|
+
const isStackedSkill = !isInitialCommandOnFirstLine && isValidStackedSkillPrefix(prefix, slashCommands);
|
|
26545
|
+
const isSlashLedInput = isSlashCommand(prefix.trimStart());
|
|
26546
|
+
const isRegularMidInput = !isInitialCommandOnFirstLine && !isSlashLedInput;
|
|
26547
|
+
if (startOnLine >= 0 && (isStackedSkill || isRegularMidInput && !isExactMidInputModelInvocableCommand(
|
|
26548
|
+
midCmd.partialCommand,
|
|
26549
|
+
slashCommands
|
|
26550
|
+
))) {
|
|
26433
26551
|
return {
|
|
26434
26552
|
completionMode: "SLASH" /* SLASH */,
|
|
26435
26553
|
query: midCmd.token,
|
|
26436
26554
|
completionStart: startOnLine,
|
|
26437
26555
|
completionEnd: startOnLine + midCmd.token.length,
|
|
26438
|
-
|
|
26556
|
+
slashCompletionContext: isStackedSkill ? "stacked-skill" /* STACKED_SKILL */ : "mid-input" /* MID_INPUT */
|
|
26439
26557
|
};
|
|
26440
26558
|
}
|
|
26441
26559
|
}
|
|
26560
|
+
if (cursorRow === 0 && isSlashCommand(currentLine.trim())) {
|
|
26561
|
+
return {
|
|
26562
|
+
completionMode: "SLASH" /* SLASH */,
|
|
26563
|
+
query: currentLine,
|
|
26564
|
+
completionStart: 0,
|
|
26565
|
+
completionEnd: currentLine.length,
|
|
26566
|
+
slashCompletionContext: "line-start" /* LINE_START */
|
|
26567
|
+
};
|
|
26568
|
+
}
|
|
26442
26569
|
return {
|
|
26443
26570
|
completionMode: "IDLE" /* IDLE */,
|
|
26444
26571
|
query: null,
|
|
26445
26572
|
completionStart: -1,
|
|
26446
26573
|
completionEnd: -1,
|
|
26447
|
-
|
|
26574
|
+
slashCompletionContext: null
|
|
26448
26575
|
};
|
|
26449
26576
|
}, [cursorRow, cursorCol, buffer.lines, buffer.text, slashCommands]);
|
|
26450
|
-
const
|
|
26451
|
-
|
|
26452
|
-
|
|
26453
|
-
|
|
26577
|
+
const isMidInputSlashCompletion = slashCompletionContext === "mid-input" /* MID_INPUT */ || slashCompletionContext === "stacked-skill" /* STACKED_SKILL */;
|
|
26578
|
+
const slashCommandsForCompletion = (0, import_react88.useMemo)(() => {
|
|
26579
|
+
if (slashCompletionContext === "stacked-skill" /* STACKED_SKILL */) {
|
|
26580
|
+
return slashCommands.filter(isStackedSkillCompletableCommand);
|
|
26581
|
+
}
|
|
26582
|
+
if (slashCompletionContext === "mid-input" /* MID_INPUT */) {
|
|
26583
|
+
return slashCommands.filter(isMidInputCompletableCommand);
|
|
26584
|
+
}
|
|
26585
|
+
return slashCommands;
|
|
26586
|
+
}, [slashCompletionContext, slashCommands]);
|
|
26454
26587
|
const {
|
|
26455
26588
|
suggestions,
|
|
26456
26589
|
activeSuggestionIndex,
|
|
@@ -26564,6 +26697,8 @@ function useCommandCompletion(buffer, cwd3, slashCommands, commandContext, rever
|
|
|
26564
26697
|
const midCmd = findMidInputSlashCommand(buffer.text, cursorOffset);
|
|
26565
26698
|
if (midCmd) {
|
|
26566
26699
|
if (isMidInputSlashCompletion) return null;
|
|
26700
|
+
const prefix = toCodePoints(buffer.text).slice(0, midCmd.startPos).join("");
|
|
26701
|
+
if (isSlashCommand(prefix.trimStart())) return null;
|
|
26567
26702
|
const match = getBestSlashCommandMatch(
|
|
26568
26703
|
midCmd.partialCommand,
|
|
26569
26704
|
slashCommands,
|
|
@@ -27737,10 +27872,7 @@ var BaseTextInput = /* @__PURE__ */ __name(({
|
|
|
27737
27872
|
linesToRender,
|
|
27738
27873
|
prefixWidth
|
|
27739
27874
|
});
|
|
27740
|
-
(
|
|
27741
|
-
setCursorPosition(cursorPosition);
|
|
27742
|
-
return () => setCursorPosition(void 0);
|
|
27743
|
-
}, [setCursorPosition, cursorPosition]);
|
|
27875
|
+
setCursorPosition(cursorPosition);
|
|
27744
27876
|
const resolvedBorderColor = borderColor ?? theme.border.focused;
|
|
27745
27877
|
const resolvedPrefix = prefix ?? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Text, { color: theme.text.accent, children: "> " });
|
|
27746
27878
|
const columns = process.stdout.columns || 80;
|
|
@@ -29026,7 +29158,9 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
29026
29158
|
const uiState = useUIState();
|
|
29027
29159
|
const uiActions = useUIActions();
|
|
29028
29160
|
const settings = useSettings();
|
|
29029
|
-
const mouseInteractionsEnabled =
|
|
29161
|
+
const mouseInteractionsEnabled = useVirtualViewport(
|
|
29162
|
+
settings.merged.ui?.useTerminalBuffer
|
|
29163
|
+
);
|
|
29030
29164
|
const { pasteWorkaround } = useKeypressContext();
|
|
29031
29165
|
const { agents, agentTabBarFocused } = useAgentViewState();
|
|
29032
29166
|
const { setAgentTabBarFocused } = useAgentViewActions();
|
|
@@ -29045,7 +29179,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
29045
29179
|
setPillFocused: setBgPillFocused
|
|
29046
29180
|
} = useBackgroundTaskViewActions();
|
|
29047
29181
|
const hasAgents = agents.size > 0;
|
|
29048
|
-
const liveAgentPanelMaxRows =
|
|
29182
|
+
const liveAgentPanelMaxRows = uiState.useTerminalBuffer ? getLiveAgentPanelVpMaxRows(uiState.terminalHeight) : LIVE_AGENT_PANEL_MAX_ROWS;
|
|
29049
29183
|
const getVisibleBgAgents = (0, import_react98.useCallback)(
|
|
29050
29184
|
() => panelDisplayOrder(
|
|
29051
29185
|
bgEntries.filter((e) => isLiveAgentPanelVisibleEntry(e, Date.now()))
|
|
@@ -29283,6 +29417,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
29283
29417
|
const handleSubmitAndClear = (0, import_react98.useCallback)(
|
|
29284
29418
|
(submittedValue, deferUntilIdle = false) => {
|
|
29285
29419
|
exportCompletion.reset();
|
|
29420
|
+
const submittedPrompt = submittedValue;
|
|
29286
29421
|
let finalValue = submittedValue;
|
|
29287
29422
|
if (pendingPastes.size > 0) {
|
|
29288
29423
|
finalValue = expandPendingPastePlaceholders(finalValue, pendingPastes);
|
|
@@ -29300,11 +29435,7 @@ ${finalValue.trim()}`;
|
|
|
29300
29435
|
}
|
|
29301
29436
|
buffer.setText("");
|
|
29302
29437
|
clearPromptStash(targetDir);
|
|
29303
|
-
|
|
29304
|
-
onSubmit(finalValue, { deferUntilIdle: true });
|
|
29305
|
-
} else {
|
|
29306
|
-
onSubmit(finalValue);
|
|
29307
|
-
}
|
|
29438
|
+
onSubmit(finalValue, { deferUntilIdle, submittedPrompt });
|
|
29308
29439
|
resetHistoryNavRef.current();
|
|
29309
29440
|
followup.dismiss();
|
|
29310
29441
|
onPromptSuggestionDismiss?.();
|
|
@@ -29333,10 +29464,11 @@ ${finalValue.trim()}`;
|
|
|
29333
29464
|
voiceSubmitRef.current = (text) => handleSubmitAndClear(text);
|
|
29334
29465
|
const customSetTextAndResetCompletionSignal = (0, import_react98.useCallback)(
|
|
29335
29466
|
(newText) => {
|
|
29467
|
+
uiActions.invalidateSubmittedPromptProvenance();
|
|
29336
29468
|
buffer.setText(newText);
|
|
29337
29469
|
setHistoryRestoredText(newText);
|
|
29338
29470
|
},
|
|
29339
|
-
[buffer]
|
|
29471
|
+
[buffer, uiActions]
|
|
29340
29472
|
);
|
|
29341
29473
|
const inputHistory = useInputHistory({
|
|
29342
29474
|
userMessages,
|
|
@@ -29767,6 +29899,7 @@ ${currentText}`);
|
|
|
29767
29899
|
}
|
|
29768
29900
|
}
|
|
29769
29901
|
if (keyMatchers["acceptSuggestionReverseSearch" /* ACCEPT_SUGGESTION_REVERSE_SEARCH */](key)) {
|
|
29902
|
+
uiActions.invalidateSubmittedPromptProvenance();
|
|
29770
29903
|
sc.handleAutocomplete(activeSuggestionIndex);
|
|
29771
29904
|
resetState();
|
|
29772
29905
|
setActive(false);
|
|
@@ -29775,6 +29908,9 @@ ${currentText}`);
|
|
|
29775
29908
|
}
|
|
29776
29909
|
if (keyMatchers["submitReverseSearch" /* SUBMIT_REVERSE_SEARCH */](key)) {
|
|
29777
29910
|
const textToSubmit = showSuggestions && activeSuggestionIndex > -1 ? suggestions[activeSuggestionIndex].value : buffer.text;
|
|
29911
|
+
if (showSuggestions && activeSuggestionIndex > -1) {
|
|
29912
|
+
uiActions.invalidateSubmittedPromptProvenance();
|
|
29913
|
+
}
|
|
29778
29914
|
handleSubmitAndClear(textToSubmit);
|
|
29779
29915
|
resetState();
|
|
29780
29916
|
setActive(false);
|
|
@@ -29970,12 +30106,18 @@ ${currentText}`);
|
|
|
29970
30106
|
} else {
|
|
29971
30107
|
if (keyMatchers["navigationUp" /* NAVIGATION_UP */](key)) {
|
|
29972
30108
|
const prevCommand = shellHistory.getPreviousCommand();
|
|
29973
|
-
if (prevCommand !== null)
|
|
30109
|
+
if (prevCommand !== null) {
|
|
30110
|
+
uiActions.invalidateSubmittedPromptProvenance();
|
|
30111
|
+
buffer.setText(prevCommand);
|
|
30112
|
+
}
|
|
29974
30113
|
return true;
|
|
29975
30114
|
}
|
|
29976
30115
|
if (keyMatchers["navigationDown" /* NAVIGATION_DOWN */](key)) {
|
|
29977
30116
|
const nextCommand = shellHistory.getNextCommand();
|
|
29978
|
-
if (nextCommand !== null)
|
|
30117
|
+
if (nextCommand !== null) {
|
|
30118
|
+
uiActions.invalidateSubmittedPromptProvenance();
|
|
30119
|
+
buffer.setText(nextCommand);
|
|
30120
|
+
}
|
|
29979
30121
|
return true;
|
|
29980
30122
|
}
|
|
29981
30123
|
}
|
|
@@ -30242,6 +30384,7 @@ ${currentText}`);
|
|
|
30242
30384
|
if (commandSearchActive || reverseSearchActive) {
|
|
30243
30385
|
const isCommandSearch = commandSearchActive;
|
|
30244
30386
|
const sc = isCommandSearch ? commandSearchCompletion : reverseSearchCompletion;
|
|
30387
|
+
uiActions.invalidateSubmittedPromptProvenance();
|
|
30245
30388
|
sc.handleAutocomplete(index);
|
|
30246
30389
|
sc.resetCompletionState();
|
|
30247
30390
|
(isCommandSearch ? setCommandSearchActive : setReverseSearchActive)(
|
|
@@ -30271,7 +30414,8 @@ ${currentText}`);
|
|
|
30271
30414
|
handleSubmitAndClear,
|
|
30272
30415
|
setExpandedSuggestionIndex,
|
|
30273
30416
|
setCommandSearchActive,
|
|
30274
|
-
setReverseSearchActive
|
|
30417
|
+
setReverseSearchActive,
|
|
30418
|
+
uiActions
|
|
30275
30419
|
]
|
|
30276
30420
|
);
|
|
30277
30421
|
const hasTabConsumer = shouldShowSuggestions || buffer.text.length === 0 && Boolean(availableSuggestion) || Boolean(completion.midInputGhostText?.acceptText);
|
|
@@ -31630,6 +31774,15 @@ function isRecentHistoryTodoSnapshot(snapshotItemIndex, historyLength) {
|
|
|
31630
31774
|
return historyItemsAfterSnapshot < MIN_HISTORY_ITEMS_AFTER_TODO_BEFORE_STICKY;
|
|
31631
31775
|
}
|
|
31632
31776
|
__name(isRecentHistoryTodoSnapshot, "isRecentHistoryTodoSnapshot");
|
|
31777
|
+
function hasUserMessageAfter(items, afterIndex) {
|
|
31778
|
+
for (let i = afterIndex + 1; i < items.length; i++) {
|
|
31779
|
+
if (items[i].type === "user") {
|
|
31780
|
+
return true;
|
|
31781
|
+
}
|
|
31782
|
+
}
|
|
31783
|
+
return false;
|
|
31784
|
+
}
|
|
31785
|
+
__name(hasUserMessageAfter, "hasUserMessageAfter");
|
|
31633
31786
|
function getStickyTodos(history, pendingHistoryItems) {
|
|
31634
31787
|
const pendingSnapshot = findLatestTodoSnapshot(pendingHistoryItems);
|
|
31635
31788
|
if (pendingSnapshot !== void 0) {
|
|
@@ -31642,6 +31795,9 @@ function getStickyTodos(history, pendingHistoryItems) {
|
|
|
31642
31795
|
if (isRecentHistoryTodoSnapshot(historySnapshot.itemIndex, history.length)) {
|
|
31643
31796
|
return null;
|
|
31644
31797
|
}
|
|
31798
|
+
if (hasUserMessageAfter(history, historySnapshot.itemIndex)) {
|
|
31799
|
+
return null;
|
|
31800
|
+
}
|
|
31645
31801
|
if (areAllTodosCompleted(historySnapshot.todos)) {
|
|
31646
31802
|
return null;
|
|
31647
31803
|
}
|
|
@@ -33013,7 +33169,7 @@ var App = /* @__PURE__ */ __name(() => {
|
|
|
33013
33169
|
}, "App");
|
|
33014
33170
|
|
|
33015
33171
|
// packages/cli/src/ui/AppContainer.tsx
|
|
33016
|
-
import
|
|
33172
|
+
import process17 from "node:process";
|
|
33017
33173
|
|
|
33018
33174
|
// packages/cli/src/ui/hooks/useMemoryMonitor.ts
|
|
33019
33175
|
init_esbuild_shims();
|
|
@@ -33088,34 +33244,15 @@ var useMemoryMonitor = /* @__PURE__ */ __name(({
|
|
|
33088
33244
|
}, [addItem, compactOldItems]);
|
|
33089
33245
|
}, "useMemoryMonitor");
|
|
33090
33246
|
|
|
33091
|
-
// packages/cli/src/ui/hooks/useResizeSettleRepaint.ts
|
|
33092
|
-
init_esbuild_shims();
|
|
33093
|
-
var import_react117 = __toESM(require_react(), 1);
|
|
33094
|
-
var RESIZE_REPAINT_SETTLE_MS = 200;
|
|
33095
|
-
function useResizeSettleRepaint(terminalWidth, refreshStatic) {
|
|
33096
|
-
const settledTerminalWidthRef = (0, import_react117.useRef)(terminalWidth);
|
|
33097
|
-
(0, import_react117.useEffect)(() => {
|
|
33098
|
-
if (settledTerminalWidthRef.current === terminalWidth) {
|
|
33099
|
-
return;
|
|
33100
|
-
}
|
|
33101
|
-
const timer = setTimeout(() => {
|
|
33102
|
-
settledTerminalWidthRef.current = terminalWidth;
|
|
33103
|
-
refreshStatic();
|
|
33104
|
-
}, RESIZE_REPAINT_SETTLE_MS);
|
|
33105
|
-
return () => clearTimeout(timer);
|
|
33106
|
-
}, [terminalWidth, refreshStatic]);
|
|
33107
|
-
}
|
|
33108
|
-
__name(useResizeSettleRepaint, "useResizeSettleRepaint");
|
|
33109
|
-
|
|
33110
33247
|
// packages/cli/src/ui/hooks/use-wake-repaint.ts
|
|
33111
33248
|
init_esbuild_shims();
|
|
33112
|
-
var
|
|
33249
|
+
var import_react117 = __toESM(require_react(), 1);
|
|
33113
33250
|
var HEARTBEAT_INTERVAL_MS = 5e3;
|
|
33114
33251
|
var WAKE_THRESHOLD_MS = HEARTBEAT_INTERVAL_MS * 2;
|
|
33115
33252
|
function useWakeRepaint(repaint) {
|
|
33116
|
-
const repaintRef = (0,
|
|
33253
|
+
const repaintRef = (0, import_react117.useRef)(repaint);
|
|
33117
33254
|
repaintRef.current = repaint;
|
|
33118
|
-
(0,
|
|
33255
|
+
(0, import_react117.useEffect)(() => {
|
|
33119
33256
|
let lastTick = Date.now();
|
|
33120
33257
|
const timer = setInterval(() => {
|
|
33121
33258
|
const now = Date.now();
|
|
@@ -33141,12 +33278,12 @@ __name(useWakeRepaint, "useWakeRepaint");
|
|
|
33141
33278
|
|
|
33142
33279
|
// packages/cli/src/ui/hooks/useThemeCommand.ts
|
|
33143
33280
|
init_esbuild_shims();
|
|
33144
|
-
var
|
|
33281
|
+
var import_react118 = __toESM(require_react(), 1);
|
|
33145
33282
|
import process13 from "node:process";
|
|
33146
33283
|
var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, addItem, initialThemeError) => {
|
|
33147
|
-
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0,
|
|
33148
|
-
const [themeBeforeDialogOpen, setThemeBeforeDialogOpen] = (0,
|
|
33149
|
-
const openThemeDialog = (0,
|
|
33284
|
+
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0, import_react118.useState)(!!initialThemeError);
|
|
33285
|
+
const [themeBeforeDialogOpen, setThemeBeforeDialogOpen] = (0, import_react118.useState)(themeManager.getActiveTheme().name);
|
|
33286
|
+
const openThemeDialog = (0, import_react118.useCallback)(() => {
|
|
33150
33287
|
if (process13.env["NO_COLOR"]) {
|
|
33151
33288
|
addItem(
|
|
33152
33289
|
{
|
|
@@ -33162,7 +33299,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
33162
33299
|
setThemeBeforeDialogOpen(themeManager.getActiveTheme().name);
|
|
33163
33300
|
setIsThemeDialogOpen(true);
|
|
33164
33301
|
}, [addItem]);
|
|
33165
|
-
const applyTheme = (0,
|
|
33302
|
+
const applyTheme = (0, import_react118.useCallback)(
|
|
33166
33303
|
(themeName) => {
|
|
33167
33304
|
if (!themeManager.setActiveTheme(themeName)) {
|
|
33168
33305
|
setIsThemeDialogOpen(true);
|
|
@@ -33177,13 +33314,13 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
33177
33314
|
},
|
|
33178
33315
|
[setThemeError]
|
|
33179
33316
|
);
|
|
33180
|
-
const handleThemeHighlight = (0,
|
|
33317
|
+
const handleThemeHighlight = (0, import_react118.useCallback)(
|
|
33181
33318
|
(themeName) => {
|
|
33182
33319
|
applyTheme(themeName);
|
|
33183
33320
|
},
|
|
33184
33321
|
[applyTheme]
|
|
33185
33322
|
);
|
|
33186
|
-
const handleThemeSelect = (0,
|
|
33323
|
+
const handleThemeSelect = (0, import_react118.useCallback)(
|
|
33187
33324
|
(themeName, scope) => {
|
|
33188
33325
|
if (themeName === void 0) {
|
|
33189
33326
|
applyTheme(themeBeforeDialogOpen);
|
|
@@ -33230,7 +33367,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
33230
33367
|
|
|
33231
33368
|
// packages/cli/src/ui/hooks/useFeedbackDialog.ts
|
|
33232
33369
|
init_esbuild_shims();
|
|
33233
|
-
var
|
|
33370
|
+
var import_react119 = __toESM(require_react(), 1);
|
|
33234
33371
|
import * as fs15 from "node:fs";
|
|
33235
33372
|
var import_strip_json_comments = __toESM(require_strip_json_comments(), 1);
|
|
33236
33373
|
var FEEDBACK_SHOW_PROBABILITY = 0.25;
|
|
@@ -33276,20 +33413,20 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
33276
33413
|
history,
|
|
33277
33414
|
sessionStats
|
|
33278
33415
|
}) => {
|
|
33279
|
-
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = (0,
|
|
33280
|
-
const [isFeedbackDismissedTemporarily, setIsFeedbackDismissedTemporarily] = (0,
|
|
33281
|
-
const openFeedbackDialog = (0,
|
|
33416
|
+
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = (0, import_react119.useState)(false);
|
|
33417
|
+
const [isFeedbackDismissedTemporarily, setIsFeedbackDismissedTemporarily] = (0, import_react119.useState)(false);
|
|
33418
|
+
const openFeedbackDialog = (0, import_react119.useCallback)(() => {
|
|
33282
33419
|
setIsFeedbackDialogOpen(true);
|
|
33283
33420
|
}, []);
|
|
33284
|
-
const closeFeedbackDialog = (0,
|
|
33421
|
+
const closeFeedbackDialog = (0, import_react119.useCallback)(
|
|
33285
33422
|
() => setIsFeedbackDialogOpen(false),
|
|
33286
33423
|
[]
|
|
33287
33424
|
);
|
|
33288
|
-
const temporaryCloseFeedbackDialog = (0,
|
|
33425
|
+
const temporaryCloseFeedbackDialog = (0, import_react119.useCallback)(() => {
|
|
33289
33426
|
setIsFeedbackDialogOpen(false);
|
|
33290
33427
|
setIsFeedbackDismissedTemporarily(true);
|
|
33291
33428
|
}, []);
|
|
33292
|
-
const submitFeedback = (0,
|
|
33429
|
+
const submitFeedback = (0, import_react119.useCallback)(
|
|
33293
33430
|
(rating) => {
|
|
33294
33431
|
if (rating >= FEEDBACK_OPTIONS.GOOD && rating <= FEEDBACK_OPTIONS.FINE) {
|
|
33295
33432
|
const feedbackEvent = new UserFeedbackEvent(
|
|
@@ -33309,7 +33446,7 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
33309
33446
|
},
|
|
33310
33447
|
[closeFeedbackDialog, sessionStats.sessionId, config, settings]
|
|
33311
33448
|
);
|
|
33312
|
-
(0,
|
|
33449
|
+
(0, import_react119.useEffect)(() => {
|
|
33313
33450
|
const checkAndShowFeedback = /* @__PURE__ */ __name(() => {
|
|
33314
33451
|
if (streamingState === "idle" /* Idle */ && history.length > 0) {
|
|
33315
33452
|
if (!config.getUsageStatisticsEnabled() || settings.merged.ui?.enableUserFeedback === false || !lastMessageIsAIResponse(history) || Math.random() > FEEDBACK_SHOW_PROBABILITY || !meetsMinimumSessionRequirements(sessionStats) || isFeedbackDismissedTemporarily) {
|
|
@@ -33331,7 +33468,7 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
33331
33468
|
settings.merged.ui?.enableUserFeedback,
|
|
33332
33469
|
config
|
|
33333
33470
|
]);
|
|
33334
|
-
(0,
|
|
33471
|
+
(0, import_react119.useEffect)(() => {
|
|
33335
33472
|
if (streamingState === "responding" /* Responding */ && isFeedbackDismissedTemporarily) {
|
|
33336
33473
|
setIsFeedbackDismissedTemporarily(false);
|
|
33337
33474
|
}
|
|
@@ -33347,13 +33484,13 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
33347
33484
|
|
|
33348
33485
|
// packages/cli/src/ui/hooks/useEditorSettings.ts
|
|
33349
33486
|
init_esbuild_shims();
|
|
33350
|
-
var
|
|
33487
|
+
var import_react120 = __toESM(require_react(), 1);
|
|
33351
33488
|
var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError, addItem) => {
|
|
33352
|
-
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0,
|
|
33353
|
-
const openEditorDialog = (0,
|
|
33489
|
+
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0, import_react120.useState)(false);
|
|
33490
|
+
const openEditorDialog = (0, import_react120.useCallback)(() => {
|
|
33354
33491
|
setIsEditorDialogOpen(true);
|
|
33355
33492
|
}, []);
|
|
33356
|
-
const handleEditorSelect = (0,
|
|
33493
|
+
const handleEditorSelect = (0, import_react120.useCallback)(
|
|
33357
33494
|
(editorType, scope) => {
|
|
33358
33495
|
if (editorType && (!checkHasEditorType(editorType) || !allowEditorTypeInSandbox(editorType))) {
|
|
33359
33496
|
return;
|
|
@@ -33375,7 +33512,7 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
33375
33512
|
},
|
|
33376
33513
|
[loadedSettings, setEditorError, addItem]
|
|
33377
33514
|
);
|
|
33378
|
-
const exitEditorDialog = (0,
|
|
33515
|
+
const exitEditorDialog = (0, import_react120.useCallback)(() => {
|
|
33379
33516
|
setIsEditorDialogOpen(false);
|
|
33380
33517
|
}, []);
|
|
33381
33518
|
return {
|
|
@@ -33388,13 +33525,13 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
33388
33525
|
|
|
33389
33526
|
// packages/cli/src/ui/hooks/useSettingsCommand.ts
|
|
33390
33527
|
init_esbuild_shims();
|
|
33391
|
-
var
|
|
33528
|
+
var import_react121 = __toESM(require_react(), 1);
|
|
33392
33529
|
function useSettingsCommand() {
|
|
33393
|
-
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0,
|
|
33394
|
-
const openSettingsDialog = (0,
|
|
33530
|
+
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0, import_react121.useState)(false);
|
|
33531
|
+
const openSettingsDialog = (0, import_react121.useCallback)(() => {
|
|
33395
33532
|
setIsSettingsDialogOpen(true);
|
|
33396
33533
|
}, []);
|
|
33397
|
-
const closeSettingsDialog = (0,
|
|
33534
|
+
const closeSettingsDialog = (0, import_react121.useCallback)(() => {
|
|
33398
33535
|
setIsSettingsDialogOpen(false);
|
|
33399
33536
|
}, []);
|
|
33400
33537
|
return {
|
|
@@ -33405,17 +33542,44 @@ function useSettingsCommand() {
|
|
|
33405
33542
|
}
|
|
33406
33543
|
__name(useSettingsCommand, "useSettingsCommand");
|
|
33407
33544
|
|
|
33545
|
+
// packages/cli/src/ui/utils/terminal-buffer.ts
|
|
33546
|
+
init_esbuild_shims();
|
|
33547
|
+
import process14 from "node:process";
|
|
33548
|
+
function isCiEnvKey(key) {
|
|
33549
|
+
return key === "CI" || key === "CONTINUOUS_INTEGRATION" || key.startsWith("CI_");
|
|
33550
|
+
}
|
|
33551
|
+
__name(isCiEnvKey, "isCiEnvKey");
|
|
33552
|
+
function isActiveCiValue(value) {
|
|
33553
|
+
const normalizedValue = value?.toLowerCase();
|
|
33554
|
+
return value !== void 0 && value !== "" && normalizedValue !== "0" && normalizedValue !== "false";
|
|
33555
|
+
}
|
|
33556
|
+
__name(isActiveCiValue, "isActiveCiValue");
|
|
33557
|
+
function isCiEnvironment(env) {
|
|
33558
|
+
return Object.keys(env).some(
|
|
33559
|
+
(key) => isCiEnvKey(key) && isActiveCiValue(env[key])
|
|
33560
|
+
);
|
|
33561
|
+
}
|
|
33562
|
+
__name(isCiEnvironment, "isCiEnvironment");
|
|
33563
|
+
function isInteractiveTerminal(stdoutIsTTY = process14.stdout.isTTY, env = process14.env) {
|
|
33564
|
+
return Boolean(stdoutIsTTY) && !isCiEnvironment(env) && env["TERM"]?.toLowerCase() !== "dumb";
|
|
33565
|
+
}
|
|
33566
|
+
__name(isInteractiveTerminal, "isInteractiveTerminal");
|
|
33567
|
+
function shouldUseVirtualViewport(useTerminalBuffer, screenReader, terminalInteractive) {
|
|
33568
|
+
return terminalInteractive && (useTerminalBuffer ?? true) && !screenReader;
|
|
33569
|
+
}
|
|
33570
|
+
__name(shouldUseVirtualViewport, "shouldUseVirtualViewport");
|
|
33571
|
+
|
|
33408
33572
|
// packages/cli/src/ui/hooks/useModelCommand.ts
|
|
33409
33573
|
init_esbuild_shims();
|
|
33410
|
-
var
|
|
33574
|
+
var import_react122 = __toESM(require_react(), 1);
|
|
33411
33575
|
var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
33412
|
-
const [isModelDialogOpen, setIsModelDialogOpen] = (0,
|
|
33413
|
-
const [isFastModelMode, setIsFastModelMode] = (0,
|
|
33414
|
-
const [isVoiceModelMode, setIsVoiceModelMode] = (0,
|
|
33415
|
-
const [isVisionModelMode, setIsVisionModelMode] = (0,
|
|
33416
|
-
const [isImageModelMode, setIsImageModelMode] = (0,
|
|
33417
|
-
const [modelDialogPersistScope, setModelDialogPersistScope] = (0,
|
|
33418
|
-
const openModelDialog = (0,
|
|
33576
|
+
const [isModelDialogOpen, setIsModelDialogOpen] = (0, import_react122.useState)(false);
|
|
33577
|
+
const [isFastModelMode, setIsFastModelMode] = (0, import_react122.useState)(false);
|
|
33578
|
+
const [isVoiceModelMode, setIsVoiceModelMode] = (0, import_react122.useState)(false);
|
|
33579
|
+
const [isVisionModelMode, setIsVisionModelMode] = (0, import_react122.useState)(false);
|
|
33580
|
+
const [isImageModelMode, setIsImageModelMode] = (0, import_react122.useState)(false);
|
|
33581
|
+
const [modelDialogPersistScope, setModelDialogPersistScope] = (0, import_react122.useState)(void 0);
|
|
33582
|
+
const openModelDialog = (0, import_react122.useCallback)(
|
|
33419
33583
|
(options) => {
|
|
33420
33584
|
const voiceModelMode = options?.voiceModelMode ?? false;
|
|
33421
33585
|
const visionModelMode = options?.visionModelMode ?? false;
|
|
@@ -33433,7 +33597,7 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
33433
33597
|
},
|
|
33434
33598
|
[]
|
|
33435
33599
|
);
|
|
33436
|
-
const closeModelDialog = (0,
|
|
33600
|
+
const closeModelDialog = (0, import_react122.useCallback)(() => {
|
|
33437
33601
|
setIsModelDialogOpen(false);
|
|
33438
33602
|
setIsFastModelMode(false);
|
|
33439
33603
|
setIsVoiceModelMode(false);
|
|
@@ -33455,13 +33619,13 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
33455
33619
|
|
|
33456
33620
|
// packages/cli/src/ui/hooks/useApprovalModeCommand.ts
|
|
33457
33621
|
init_esbuild_shims();
|
|
33458
|
-
var
|
|
33622
|
+
var import_react123 = __toESM(require_react(), 1);
|
|
33459
33623
|
var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) => {
|
|
33460
|
-
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0,
|
|
33461
|
-
const openApprovalModeDialog = (0,
|
|
33624
|
+
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0, import_react123.useState)(false);
|
|
33625
|
+
const openApprovalModeDialog = (0, import_react123.useCallback)(() => {
|
|
33462
33626
|
setIsApprovalModeDialogOpen(true);
|
|
33463
33627
|
}, []);
|
|
33464
|
-
const handleApprovalModeSelect = (0,
|
|
33628
|
+
const handleApprovalModeSelect = (0, import_react123.useCallback)(
|
|
33465
33629
|
(mode, scope) => {
|
|
33466
33630
|
try {
|
|
33467
33631
|
if (!mode) {
|
|
@@ -33487,13 +33651,13 @@ var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) =>
|
|
|
33487
33651
|
|
|
33488
33652
|
// packages/cli/src/ui/hooks/use-effort-command.ts
|
|
33489
33653
|
init_esbuild_shims();
|
|
33490
|
-
var
|
|
33654
|
+
var import_react124 = __toESM(require_react(), 1);
|
|
33491
33655
|
var useEffortCommand = /* @__PURE__ */ __name((loadedSettings, config, addItem) => {
|
|
33492
|
-
const [isEffortDialogOpen, setIsEffortDialogOpen] = (0,
|
|
33493
|
-
const openEffortDialog = (0,
|
|
33656
|
+
const [isEffortDialogOpen, setIsEffortDialogOpen] = (0, import_react124.useState)(false);
|
|
33657
|
+
const openEffortDialog = (0, import_react124.useCallback)(() => {
|
|
33494
33658
|
setIsEffortDialogOpen(true);
|
|
33495
33659
|
}, []);
|
|
33496
|
-
const handleEffortSelect = (0,
|
|
33660
|
+
const handleEffortSelect = (0, import_react124.useCallback)(
|
|
33497
33661
|
(effort) => {
|
|
33498
33662
|
try {
|
|
33499
33663
|
if (!effort) {
|
|
@@ -33545,7 +33709,7 @@ var useEffortCommand = /* @__PURE__ */ __name((loadedSettings, config, addItem)
|
|
|
33545
33709
|
|
|
33546
33710
|
// packages/cli/src/ui/hooks/useBranchCommand.ts
|
|
33547
33711
|
init_esbuild_shims();
|
|
33548
|
-
var
|
|
33712
|
+
var import_react125 = __toESM(require_react(), 1);
|
|
33549
33713
|
import { randomUUID } from "node:crypto";
|
|
33550
33714
|
var BACKGROUND_WORK_BRANCH_BLOCKED_MESSAGE = "Stop the current session's running background tasks before branching the conversation.";
|
|
33551
33715
|
function deriveFirstPrompt(messages) {
|
|
@@ -33566,7 +33730,7 @@ function deriveFirstPrompt(messages) {
|
|
|
33566
33730
|
__name(deriveFirstPrompt, "deriveFirstPrompt");
|
|
33567
33731
|
function useBranchCommand(options) {
|
|
33568
33732
|
const { config, historyManager, startNewSession, setSessionName, remount } = options;
|
|
33569
|
-
const handleBranch = (0,
|
|
33733
|
+
const handleBranch = (0, import_react125.useCallback)(
|
|
33570
33734
|
async (name) => {
|
|
33571
33735
|
if (!config) return;
|
|
33572
33736
|
if (hasBlockingBackgroundWork(config)) {
|
|
@@ -33708,19 +33872,19 @@ __name(useBranchCommand, "useBranchCommand");
|
|
|
33708
33872
|
|
|
33709
33873
|
// packages/cli/src/ui/hooks/useResumeCommand.ts
|
|
33710
33874
|
init_esbuild_shims();
|
|
33711
|
-
var
|
|
33875
|
+
var import_react126 = __toESM(require_react(), 1);
|
|
33712
33876
|
var BACKGROUND_WORK_SWITCH_BLOCKED_MESSAGE = "Stop the current session's running background tasks before resuming another session.";
|
|
33713
33877
|
function useResumeCommand(options) {
|
|
33714
|
-
const [isResumeDialogOpen, setIsResumeDialogOpen] = (0,
|
|
33715
|
-
const [resumeMatchedSessions, setResumeMatchedSessions] = (0,
|
|
33716
|
-
const openResumeDialog = (0,
|
|
33878
|
+
const [isResumeDialogOpen, setIsResumeDialogOpen] = (0, import_react126.useState)(false);
|
|
33879
|
+
const [resumeMatchedSessions, setResumeMatchedSessions] = (0, import_react126.useState)();
|
|
33880
|
+
const openResumeDialog = (0, import_react126.useCallback)(
|
|
33717
33881
|
(matchedSessions) => {
|
|
33718
33882
|
setResumeMatchedSessions(matchedSessions);
|
|
33719
33883
|
setIsResumeDialogOpen(true);
|
|
33720
33884
|
},
|
|
33721
33885
|
[]
|
|
33722
33886
|
);
|
|
33723
|
-
const closeResumeDialog = (0,
|
|
33887
|
+
const closeResumeDialog = (0, import_react126.useCallback)(() => {
|
|
33724
33888
|
setIsResumeDialogOpen(false);
|
|
33725
33889
|
setResumeMatchedSessions(void 0);
|
|
33726
33890
|
}, []);
|
|
@@ -33733,7 +33897,7 @@ function useResumeCommand(options) {
|
|
|
33733
33897
|
remount
|
|
33734
33898
|
} = options;
|
|
33735
33899
|
const { addItem, clearItems, loadHistory } = historyManager;
|
|
33736
|
-
const handleResume = (0,
|
|
33900
|
+
const handleResume = (0, import_react126.useCallback)(
|
|
33737
33901
|
async (sessionId) => {
|
|
33738
33902
|
if (!config) {
|
|
33739
33903
|
return;
|
|
@@ -33858,18 +34022,18 @@ __name(useResumeCommand, "useResumeCommand");
|
|
|
33858
34022
|
|
|
33859
34023
|
// packages/cli/src/ui/hooks/useDeleteCommand.ts
|
|
33860
34024
|
init_esbuild_shims();
|
|
33861
|
-
var
|
|
34025
|
+
var import_react127 = __toESM(require_react(), 1);
|
|
33862
34026
|
function useDeleteCommand(options) {
|
|
33863
|
-
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = (0,
|
|
33864
|
-
const openDeleteDialog = (0,
|
|
34027
|
+
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = (0, import_react127.useState)(false);
|
|
34028
|
+
const openDeleteDialog = (0, import_react127.useCallback)(() => {
|
|
33865
34029
|
setIsDeleteDialogOpen(true);
|
|
33866
34030
|
}, []);
|
|
33867
|
-
const closeDeleteDialog = (0,
|
|
34031
|
+
const closeDeleteDialog = (0, import_react127.useCallback)(() => {
|
|
33868
34032
|
setIsDeleteDialogOpen(false);
|
|
33869
34033
|
}, []);
|
|
33870
34034
|
const { config, addItem } = options ?? {};
|
|
33871
|
-
const isDeletingManyRef = (0,
|
|
33872
|
-
const handleDelete = (0,
|
|
34035
|
+
const isDeletingManyRef = (0, import_react127.useRef)(false);
|
|
34036
|
+
const handleDelete = (0, import_react127.useCallback)(
|
|
33873
34037
|
async (sessionId) => {
|
|
33874
34038
|
if (!config) {
|
|
33875
34039
|
return;
|
|
@@ -33928,7 +34092,7 @@ function useDeleteCommand(options) {
|
|
|
33928
34092
|
},
|
|
33929
34093
|
[closeDeleteDialog, config, addItem]
|
|
33930
34094
|
);
|
|
33931
|
-
const handleDeleteMany = (0,
|
|
34095
|
+
const handleDeleteMany = (0, import_react127.useCallback)(
|
|
33932
34096
|
async (sessionIds) => {
|
|
33933
34097
|
if (!config) {
|
|
33934
34098
|
return;
|
|
@@ -34060,7 +34224,7 @@ __name(useDeleteCommand, "useDeleteCommand");
|
|
|
34060
34224
|
|
|
34061
34225
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
34062
34226
|
init_esbuild_shims();
|
|
34063
|
-
var
|
|
34227
|
+
var import_react128 = __toESM(require_react(), 1);
|
|
34064
34228
|
var debugLogger33 = createDebugLogger("SLASH_COMMAND_PROCESSOR");
|
|
34065
34229
|
function hasUserPromptExpansionHooks(config) {
|
|
34066
34230
|
return !!config && !config.getDisableAllHooks?.() && (config.hasHooksForEvent?.("UserPromptExpansion") ?? false);
|
|
@@ -34092,33 +34256,33 @@ function getSkillCommandName(command) {
|
|
|
34092
34256
|
}
|
|
34093
34257
|
__name(getSkillCommandName, "getSkillCommandName");
|
|
34094
34258
|
var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, isProcessing, setIsProcessing, isIdleRef, setGeminiMdFileCount, actions, extensionsUpdateState, isConfigInitialized, logger, updateItem, setSessionName, extensionRefreshState) => {
|
|
34095
|
-
const fallbackExtensionRefreshStateRef = (0,
|
|
34259
|
+
const fallbackExtensionRefreshStateRef = (0, import_react128.useRef)(
|
|
34096
34260
|
null
|
|
34097
34261
|
);
|
|
34098
34262
|
if (!fallbackExtensionRefreshStateRef.current) {
|
|
34099
34263
|
fallbackExtensionRefreshStateRef.current = new ExtensionRefreshState();
|
|
34100
34264
|
}
|
|
34101
34265
|
const activeExtensionRefreshState = extensionRefreshState ?? fallbackExtensionRefreshStateRef.current;
|
|
34102
|
-
const historyRef = (0,
|
|
34103
|
-
(0,
|
|
34266
|
+
const historyRef = (0, import_react128.useRef)(history);
|
|
34267
|
+
(0, import_react128.useLayoutEffect)(() => {
|
|
34104
34268
|
historyRef.current = history;
|
|
34105
34269
|
}, [history]);
|
|
34106
34270
|
const { stats: sessionStats, startNewSession } = useSessionStats();
|
|
34107
|
-
const [commands, setCommands] = (0,
|
|
34108
|
-
const [recentCommands, setRecentCommands] = (0,
|
|
34109
|
-
const [reloadTrigger, setReloadTrigger] = (0,
|
|
34110
|
-
const commandReloadResolversRef = (0,
|
|
34111
|
-
const extensionContentRefreshTimerRef = (0,
|
|
34112
|
-
const extensionContentRefreshRunningRef = (0,
|
|
34113
|
-
const extensionContentRefreshPendingRef = (0,
|
|
34114
|
-
const mountedRef = (0,
|
|
34115
|
-
(0,
|
|
34271
|
+
const [commands, setCommands] = (0, import_react128.useState)([]);
|
|
34272
|
+
const [recentCommands, setRecentCommands] = (0, import_react128.useState)(/* @__PURE__ */ new Map());
|
|
34273
|
+
const [reloadTrigger, setReloadTrigger] = (0, import_react128.useState)(0);
|
|
34274
|
+
const commandReloadResolversRef = (0, import_react128.useRef)([]);
|
|
34275
|
+
const extensionContentRefreshTimerRef = (0, import_react128.useRef)(null);
|
|
34276
|
+
const extensionContentRefreshRunningRef = (0, import_react128.useRef)(false);
|
|
34277
|
+
const extensionContentRefreshPendingRef = (0, import_react128.useRef)(false);
|
|
34278
|
+
const mountedRef = (0, import_react128.useRef)(true);
|
|
34279
|
+
(0, import_react128.useEffect)(() => {
|
|
34116
34280
|
mountedRef.current = true;
|
|
34117
34281
|
return () => {
|
|
34118
34282
|
mountedRef.current = false;
|
|
34119
34283
|
};
|
|
34120
34284
|
}, []);
|
|
34121
|
-
const resolveCommandReloads = (0,
|
|
34285
|
+
const resolveCommandReloads = (0, import_react128.useCallback)((completedTrigger) => {
|
|
34122
34286
|
if (commandReloadResolversRef.current.length === 0) {
|
|
34123
34287
|
return;
|
|
34124
34288
|
}
|
|
@@ -34132,7 +34296,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34132
34296
|
}
|
|
34133
34297
|
commandReloadResolversRef.current = remaining;
|
|
34134
34298
|
}, []);
|
|
34135
|
-
const reloadCommands = (0,
|
|
34299
|
+
const reloadCommands = (0, import_react128.useCallback)(() => {
|
|
34136
34300
|
if (!config) {
|
|
34137
34301
|
return Promise.resolve();
|
|
34138
34302
|
}
|
|
@@ -34147,14 +34311,14 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34147
34311
|
});
|
|
34148
34312
|
});
|
|
34149
34313
|
}, [config]);
|
|
34150
|
-
const clearPendingExtensionContentRefresh = (0,
|
|
34314
|
+
const clearPendingExtensionContentRefresh = (0, import_react128.useCallback)(() => {
|
|
34151
34315
|
if (!extensionContentRefreshTimerRef.current) {
|
|
34152
34316
|
return;
|
|
34153
34317
|
}
|
|
34154
34318
|
clearTimeout(extensionContentRefreshTimerRef.current);
|
|
34155
34319
|
extensionContentRefreshTimerRef.current = null;
|
|
34156
34320
|
}, []);
|
|
34157
|
-
const showExtensionContentRefreshError = (0,
|
|
34321
|
+
const showExtensionContentRefreshError = (0, import_react128.useCallback)(
|
|
34158
34322
|
(error) => {
|
|
34159
34323
|
if (!mountedRef.current) {
|
|
34160
34324
|
return;
|
|
@@ -34174,7 +34338,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34174
34338
|
},
|
|
34175
34339
|
[addItem]
|
|
34176
34340
|
);
|
|
34177
|
-
const runExtensionContentRefresh = (0,
|
|
34341
|
+
const runExtensionContentRefresh = (0, import_react128.useCallback)(async () => {
|
|
34178
34342
|
if (!config) {
|
|
34179
34343
|
return;
|
|
34180
34344
|
}
|
|
@@ -34218,23 +34382,23 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34218
34382
|
reloadCommands,
|
|
34219
34383
|
showExtensionContentRefreshError
|
|
34220
34384
|
]);
|
|
34221
|
-
const [shellConfirmationRequest, setShellConfirmationRequest] = (0,
|
|
34222
|
-
const [confirmationRequest, setConfirmationRequest] = (0,
|
|
34223
|
-
const [sessionShellAllowlist, setSessionShellAllowlist] = (0,
|
|
34385
|
+
const [shellConfirmationRequest, setShellConfirmationRequest] = (0, import_react128.useState)(null);
|
|
34386
|
+
const [confirmationRequest, setConfirmationRequest] = (0, import_react128.useState)(null);
|
|
34387
|
+
const [sessionShellAllowlist, setSessionShellAllowlist] = (0, import_react128.useState)(
|
|
34224
34388
|
/* @__PURE__ */ new Set()
|
|
34225
34389
|
);
|
|
34226
|
-
const [pendingItem, setPendingItem] = (0,
|
|
34390
|
+
const [pendingItem, setPendingItem] = (0, import_react128.useState)(
|
|
34227
34391
|
null
|
|
34228
34392
|
);
|
|
34229
|
-
const [btwItem, setBtwItem] = (0,
|
|
34230
|
-
const btwAbortControllerRef = (0,
|
|
34231
|
-
const cancelBtw = (0,
|
|
34393
|
+
const [btwItem, setBtwItem] = (0, import_react128.useState)(null);
|
|
34394
|
+
const btwAbortControllerRef = (0, import_react128.useRef)(null);
|
|
34395
|
+
const cancelBtw = (0, import_react128.useCallback)(() => {
|
|
34232
34396
|
btwAbortControllerRef.current?.abort();
|
|
34233
34397
|
btwAbortControllerRef.current = null;
|
|
34234
34398
|
setBtwItem(null);
|
|
34235
34399
|
}, []);
|
|
34236
|
-
const abortControllerRef = (0,
|
|
34237
|
-
const cancelSlashCommand = (0,
|
|
34400
|
+
const abortControllerRef = (0, import_react128.useRef)(null);
|
|
34401
|
+
const cancelSlashCommand = (0, import_react128.useCallback)(() => {
|
|
34238
34402
|
cancelBtw();
|
|
34239
34403
|
if (!abortControllerRef.current) {
|
|
34240
34404
|
return;
|
|
@@ -34258,14 +34422,14 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34258
34422
|
},
|
|
34259
34423
|
{ isActive: isProcessing }
|
|
34260
34424
|
);
|
|
34261
|
-
const pendingHistoryItems = (0,
|
|
34425
|
+
const pendingHistoryItems = (0, import_react128.useMemo)(() => {
|
|
34262
34426
|
const items = [];
|
|
34263
34427
|
if (pendingItem != null) {
|
|
34264
34428
|
items.push(pendingItem);
|
|
34265
34429
|
}
|
|
34266
34430
|
return items;
|
|
34267
34431
|
}, [pendingItem]);
|
|
34268
|
-
const addMessage = (0,
|
|
34432
|
+
const addMessage = (0, import_react128.useCallback)(
|
|
34269
34433
|
(message) => {
|
|
34270
34434
|
let historyItemContent;
|
|
34271
34435
|
if (message.type === "about" /* ABOUT */) {
|
|
@@ -34325,7 +34489,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34325
34489
|
},
|
|
34326
34490
|
[addItem]
|
|
34327
34491
|
);
|
|
34328
|
-
const commandContext = (0,
|
|
34492
|
+
const commandContext = (0, import_react128.useMemo)(
|
|
34329
34493
|
() => ({
|
|
34330
34494
|
services: {
|
|
34331
34495
|
config,
|
|
@@ -34397,7 +34561,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34397
34561
|
activeExtensionRefreshState
|
|
34398
34562
|
]
|
|
34399
34563
|
);
|
|
34400
|
-
(0,
|
|
34564
|
+
(0, import_react128.useEffect)(() => {
|
|
34401
34565
|
if (!config) {
|
|
34402
34566
|
return;
|
|
34403
34567
|
}
|
|
@@ -34415,7 +34579,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34415
34579
|
})();
|
|
34416
34580
|
};
|
|
34417
34581
|
}, [config, reloadCommands]);
|
|
34418
|
-
(0,
|
|
34582
|
+
(0, import_react128.useEffect)(() => {
|
|
34419
34583
|
if (!config) {
|
|
34420
34584
|
return;
|
|
34421
34585
|
}
|
|
@@ -34440,7 +34604,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34440
34604
|
}
|
|
34441
34605
|
};
|
|
34442
34606
|
}, [config, reloadCommands]);
|
|
34443
|
-
(0,
|
|
34607
|
+
(0, import_react128.useEffect)(() => {
|
|
34444
34608
|
if (!isConfigInitialized) {
|
|
34445
34609
|
return;
|
|
34446
34610
|
}
|
|
@@ -34455,7 +34619,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34455
34619
|
reloadCommands();
|
|
34456
34620
|
});
|
|
34457
34621
|
}, [config, isConfigInitialized, reloadCommands]);
|
|
34458
|
-
(0,
|
|
34622
|
+
(0, import_react128.useEffect)(() => {
|
|
34459
34623
|
const listener = /* @__PURE__ */ __name((reason) => {
|
|
34460
34624
|
clearPendingExtensionContentRefresh();
|
|
34461
34625
|
addItem(
|
|
@@ -34482,7 +34646,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34482
34646
|
addItem,
|
|
34483
34647
|
clearPendingExtensionContentRefresh
|
|
34484
34648
|
]);
|
|
34485
|
-
(0,
|
|
34649
|
+
(0, import_react128.useEffect)(() => {
|
|
34486
34650
|
activeExtensionRefreshState.on(
|
|
34487
34651
|
"extensions-reload-started" /* ExtensionsReloadStarted */,
|
|
34488
34652
|
clearPendingExtensionContentRefresh
|
|
@@ -34502,7 +34666,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34502
34666
|
);
|
|
34503
34667
|
};
|
|
34504
34668
|
}, [activeExtensionRefreshState, clearPendingExtensionContentRefresh]);
|
|
34505
|
-
(0,
|
|
34669
|
+
(0, import_react128.useEffect)(() => {
|
|
34506
34670
|
if (!config) {
|
|
34507
34671
|
return;
|
|
34508
34672
|
}
|
|
@@ -34528,7 +34692,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34528
34692
|
activeExtensionRefreshState,
|
|
34529
34693
|
runExtensionContentRefresh
|
|
34530
34694
|
]);
|
|
34531
|
-
(0,
|
|
34695
|
+
(0, import_react128.useEffect)(() => {
|
|
34532
34696
|
const controller = new AbortController();
|
|
34533
34697
|
const load = /* @__PURE__ */ __name(async () => {
|
|
34534
34698
|
try {
|
|
@@ -34625,7 +34789,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34625
34789
|
settings,
|
|
34626
34790
|
resolveCommandReloads
|
|
34627
34791
|
]);
|
|
34628
|
-
const handleSlashCommand = (0,
|
|
34792
|
+
const handleSlashCommand = (0, import_react128.useCallback)(
|
|
34629
34793
|
async (rawQuery, oneTimeShellAllowlist, overwriteConfirmed, existingInvocationItemId) => {
|
|
34630
34794
|
if (typeof rawQuery !== "string") {
|
|
34631
34795
|
return false;
|
|
@@ -35187,11 +35351,11 @@ ${commandToExecute.subCommands.map((sc) => ` - ${sc.name}: ${sc.description ||
|
|
|
35187
35351
|
|
|
35188
35352
|
// packages/cli/src/ui/hooks/useDoublePress.ts
|
|
35189
35353
|
init_esbuild_shims();
|
|
35190
|
-
var
|
|
35354
|
+
var import_react129 = __toESM(require_react(), 1);
|
|
35191
35355
|
var DOUBLE_PRESS_TIMEOUT_MS = 800;
|
|
35192
35356
|
function useDoublePress(onDoublePress, onPending) {
|
|
35193
|
-
const timeoutRef = (0,
|
|
35194
|
-
(0,
|
|
35357
|
+
const timeoutRef = (0, import_react129.useRef)(null);
|
|
35358
|
+
(0, import_react129.useEffect)(
|
|
35195
35359
|
() => () => {
|
|
35196
35360
|
if (timeoutRef.current !== null) {
|
|
35197
35361
|
clearTimeout(timeoutRef.current);
|
|
@@ -35200,7 +35364,7 @@ function useDoublePress(onDoublePress, onPending) {
|
|
|
35200
35364
|
},
|
|
35201
35365
|
[]
|
|
35202
35366
|
);
|
|
35203
|
-
return (0,
|
|
35367
|
+
return (0, import_react129.useCallback)(() => {
|
|
35204
35368
|
if (timeoutRef.current !== null) {
|
|
35205
35369
|
clearTimeout(timeoutRef.current);
|
|
35206
35370
|
timeoutRef.current = null;
|
|
@@ -35264,10 +35428,10 @@ __name(formatSessionWindowTitle, "formatSessionWindowTitle");
|
|
|
35264
35428
|
|
|
35265
35429
|
// packages/cli/src/ui/hooks/useLogger.ts
|
|
35266
35430
|
init_esbuild_shims();
|
|
35267
|
-
var
|
|
35431
|
+
var import_react130 = __toESM(require_react(), 1);
|
|
35268
35432
|
var useLogger = /* @__PURE__ */ __name((storage, sessionId) => {
|
|
35269
|
-
const [logger, setLogger] = (0,
|
|
35270
|
-
(0,
|
|
35433
|
+
const [logger, setLogger] = (0, import_react130.useState)(null);
|
|
35434
|
+
(0, import_react130.useEffect)(() => {
|
|
35271
35435
|
if (!sessionId) {
|
|
35272
35436
|
return;
|
|
35273
35437
|
}
|
|
@@ -35288,11 +35452,11 @@ var useLogger = /* @__PURE__ */ __name((storage, sessionId) => {
|
|
|
35288
35452
|
|
|
35289
35453
|
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
35290
35454
|
init_esbuild_shims();
|
|
35291
|
-
var
|
|
35455
|
+
var import_react135 = __toESM(require_react(), 1);
|
|
35292
35456
|
|
|
35293
35457
|
// packages/cli/src/ui/hooks/shellCommandProcessor.ts
|
|
35294
35458
|
init_esbuild_shims();
|
|
35295
|
-
var
|
|
35459
|
+
var import_react131 = __toESM(require_react(), 1);
|
|
35296
35460
|
import crypto2 from "node:crypto";
|
|
35297
35461
|
import path10 from "node:path";
|
|
35298
35462
|
import os5 from "node:os";
|
|
@@ -35325,8 +35489,8 @@ ${modelContent}
|
|
|
35325
35489
|
}
|
|
35326
35490
|
__name(addShellCommandToGeminiHistory, "addShellCommandToGeminiHistory");
|
|
35327
35491
|
var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPendingHistoryItem, onExec, onDebugMessage, config, geminiClient, setShellInputFocused, terminalWidth, terminalHeight) => {
|
|
35328
|
-
const [activeShellPtyId, setActiveShellPtyId] = (0,
|
|
35329
|
-
const handleShellCommand = (0,
|
|
35492
|
+
const [activeShellPtyId, setActiveShellPtyId] = (0, import_react131.useState)(null);
|
|
35493
|
+
const handleShellCommand = (0, import_react131.useCallback)(
|
|
35330
35494
|
(rawQuery, abortSignal) => {
|
|
35331
35495
|
if (typeof rawQuery !== "string" || rawQuery.trim() === "") {
|
|
35332
35496
|
return false;
|
|
@@ -35580,11 +35744,11 @@ ${finalOutput}`;
|
|
|
35580
35744
|
|
|
35581
35745
|
// packages/cli/src/ui/hooks/useStateAndRef.ts
|
|
35582
35746
|
init_esbuild_shims();
|
|
35583
|
-
var
|
|
35747
|
+
var import_react132 = __toESM(require_react(), 1);
|
|
35584
35748
|
var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
35585
|
-
const [state, setState] =
|
|
35586
|
-
const ref =
|
|
35587
|
-
const setStateInternal =
|
|
35749
|
+
const [state, setState] = import_react132.default.useState(initialValue);
|
|
35750
|
+
const ref = import_react132.default.useRef(initialValue);
|
|
35751
|
+
const setStateInternal = import_react132.default.useCallback(
|
|
35588
35752
|
(newStateOrCallback) => {
|
|
35589
35753
|
let newValue;
|
|
35590
35754
|
if (typeof newStateOrCallback === "function") {
|
|
@@ -35602,12 +35766,12 @@ var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
|
35602
35766
|
|
|
35603
35767
|
// packages/cli/src/ui/hooks/useReactToolScheduler.ts
|
|
35604
35768
|
init_esbuild_shims();
|
|
35605
|
-
var
|
|
35769
|
+
var import_react133 = __toESM(require_react(), 1);
|
|
35606
35770
|
import * as path11 from "node:path";
|
|
35607
35771
|
var debugLogger35 = createDebugLogger("REACT_TOOL_SCHEDULER");
|
|
35608
|
-
function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorClose) {
|
|
35609
|
-
const [toolCallsForDisplay, setToolCallsForDisplay] = (0,
|
|
35610
|
-
const outputUpdateHandler = (0,
|
|
35772
|
+
function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorClose, onToolResultFullTurnModel) {
|
|
35773
|
+
const [toolCallsForDisplay, setToolCallsForDisplay] = (0, import_react133.useState)([]);
|
|
35774
|
+
const outputUpdateHandler = (0, import_react133.useCallback)(
|
|
35611
35775
|
(toolCallId, outputChunk) => {
|
|
35612
35776
|
if (isShellProgressData(outputChunk)) {
|
|
35613
35777
|
return;
|
|
@@ -35625,13 +35789,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35625
35789
|
},
|
|
35626
35790
|
[]
|
|
35627
35791
|
);
|
|
35628
|
-
const allToolCallsCompleteHandler = (0,
|
|
35792
|
+
const allToolCallsCompleteHandler = (0, import_react133.useCallback)(
|
|
35629
35793
|
async (completedToolCalls) => {
|
|
35630
35794
|
await onComplete(completedToolCalls);
|
|
35631
35795
|
},
|
|
35632
35796
|
[onComplete]
|
|
35633
35797
|
);
|
|
35634
|
-
const toolCallsUpdateHandler = (0,
|
|
35798
|
+
const toolCallsUpdateHandler = (0, import_react133.useCallback)(
|
|
35635
35799
|
(updatedCoreToolCalls) => {
|
|
35636
35800
|
setToolCallsForDisplay(
|
|
35637
35801
|
(prevTrackedCalls) => updatedCoreToolCalls.map((coreTc) => {
|
|
@@ -35658,14 +35822,15 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35658
35822
|
},
|
|
35659
35823
|
[setToolCallsForDisplay]
|
|
35660
35824
|
);
|
|
35661
|
-
const scheduler = (0,
|
|
35825
|
+
const scheduler = (0, import_react133.useMemo)(
|
|
35662
35826
|
() => new CoreToolScheduler({
|
|
35663
35827
|
config,
|
|
35664
35828
|
outputUpdateHandler,
|
|
35665
35829
|
onAllToolCallsComplete: allToolCallsCompleteHandler,
|
|
35666
35830
|
onToolCallsUpdate: toolCallsUpdateHandler,
|
|
35667
35831
|
getPreferredEditor,
|
|
35668
|
-
onEditorClose
|
|
35832
|
+
onEditorClose,
|
|
35833
|
+
onToolResultFullTurnModel
|
|
35669
35834
|
}),
|
|
35670
35835
|
[
|
|
35671
35836
|
config,
|
|
@@ -35673,10 +35838,11 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35673
35838
|
allToolCallsCompleteHandler,
|
|
35674
35839
|
toolCallsUpdateHandler,
|
|
35675
35840
|
getPreferredEditor,
|
|
35676
|
-
onEditorClose
|
|
35841
|
+
onEditorClose,
|
|
35842
|
+
onToolResultFullTurnModel
|
|
35677
35843
|
]
|
|
35678
35844
|
);
|
|
35679
|
-
const schedule = (0,
|
|
35845
|
+
const schedule = (0, import_react133.useCallback)(
|
|
35680
35846
|
(request, signal, modelOverride) => {
|
|
35681
35847
|
if (!modelOverride?.endsWith("\0")) {
|
|
35682
35848
|
void scheduler.schedule(request, signal);
|
|
@@ -35725,7 +35891,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35725
35891
|
},
|
|
35726
35892
|
[allToolCallsCompleteHandler, config, scheduler]
|
|
35727
35893
|
);
|
|
35728
|
-
const markToolsAsSubmitted = (0,
|
|
35894
|
+
const markToolsAsSubmitted = (0, import_react133.useCallback)(
|
|
35729
35895
|
(callIdsToMark) => {
|
|
35730
35896
|
setToolCallsForDisplay(
|
|
35731
35897
|
(prevCalls) => prevCalls.map(
|
|
@@ -35808,6 +35974,9 @@ function mapToDisplay(toolOrTools, projectRoot) {
|
|
|
35808
35974
|
resultDisplay: compactToolResultDisplayForHistory(
|
|
35809
35975
|
trackedCall.response.resultDisplay
|
|
35810
35976
|
),
|
|
35977
|
+
...trackedCall.response.visionBridgeNotice !== void 0 ? {
|
|
35978
|
+
visionBridgeNotice: trackedCall.response.visionBridgeNotice
|
|
35979
|
+
} : {},
|
|
35811
35980
|
// Full detail for the Ctrl+O transcript (§4.9): derived from the
|
|
35812
35981
|
// already-persisted functionResponse parts; NOT char-capped (the
|
|
35813
35982
|
// bound is whatever core already applied). Consumed ONLY by the
|
|
@@ -35827,6 +35996,9 @@ function mapToDisplay(toolOrTools, projectRoot) {
|
|
|
35827
35996
|
resultDisplay: compactToolResultDisplayForHistory(
|
|
35828
35997
|
trackedCall.response.resultDisplay
|
|
35829
35998
|
),
|
|
35999
|
+
...trackedCall.response.visionBridgeNotice !== void 0 ? {
|
|
36000
|
+
visionBridgeNotice: trackedCall.response.visionBridgeNotice
|
|
36001
|
+
} : {},
|
|
35830
36002
|
confirmationDetails: void 0
|
|
35831
36003
|
};
|
|
35832
36004
|
case "cancelled":
|
|
@@ -35836,6 +36008,9 @@ function mapToDisplay(toolOrTools, projectRoot) {
|
|
|
35836
36008
|
resultDisplay: compactToolResultDisplayForHistory(
|
|
35837
36009
|
trackedCall.response.resultDisplay
|
|
35838
36010
|
),
|
|
36011
|
+
...trackedCall.response.visionBridgeNotice !== void 0 ? {
|
|
36012
|
+
visionBridgeNotice: trackedCall.response.visionBridgeNotice
|
|
36013
|
+
} : {},
|
|
35839
36014
|
confirmationDetails: void 0
|
|
35840
36015
|
};
|
|
35841
36016
|
case "awaiting_approval":
|
|
@@ -35890,74 +36065,90 @@ __name(mapToDisplay, "mapToDisplay");
|
|
|
35890
36065
|
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
35891
36066
|
import { promises as fs17 } from "node:fs";
|
|
35892
36067
|
import path12 from "node:path";
|
|
35893
|
-
import
|
|
36068
|
+
import process15 from "node:process";
|
|
35894
36069
|
|
|
35895
36070
|
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
35896
36071
|
init_esbuild_shims();
|
|
35897
|
-
var
|
|
36072
|
+
var import_react134 = __toESM(require_react(), 1);
|
|
35898
36073
|
var GOAL_COMMAND_RE = /^\/goal(?:\s|$)/;
|
|
36074
|
+
function aggregateMessages(messages) {
|
|
36075
|
+
const modelText = messages.map((message) => message.modelText).join("\n\n");
|
|
36076
|
+
const submittedPrompts = messages.map((message) => message.submittedPrompt);
|
|
36077
|
+
return submittedPrompts.every(
|
|
36078
|
+
(submittedPrompt) => submittedPrompt !== void 0
|
|
36079
|
+
) ? { modelText, submittedPrompt: submittedPrompts.join("\n\n") } : { modelText };
|
|
36080
|
+
}
|
|
36081
|
+
__name(aggregateMessages, "aggregateMessages");
|
|
35899
36082
|
function useMessageQueue() {
|
|
35900
|
-
const [queuedMessages, setQueuedMessages] = (0,
|
|
35901
|
-
const queueRef = (0,
|
|
35902
|
-
const addMessage = (0,
|
|
35903
|
-
|
|
35904
|
-
|
|
35905
|
-
|
|
35906
|
-
|
|
35907
|
-
|
|
35908
|
-
|
|
35909
|
-
|
|
35910
|
-
|
|
35911
|
-
|
|
35912
|
-
|
|
36083
|
+
const [queuedMessages, setQueuedMessages] = (0, import_react134.useState)([]);
|
|
36084
|
+
const queueRef = (0, import_react134.useRef)([]);
|
|
36085
|
+
const addMessage = (0, import_react134.useCallback)(
|
|
36086
|
+
(message, deferUntilIdle = false, submittedPrompt) => {
|
|
36087
|
+
const modelText = message.trim();
|
|
36088
|
+
if (modelText.length > 0) {
|
|
36089
|
+
queueRef.current = [
|
|
36090
|
+
...queueRef.current,
|
|
36091
|
+
{ modelText, deferUntilIdle, submittedPrompt }
|
|
36092
|
+
];
|
|
36093
|
+
setQueuedMessages(queueRef.current);
|
|
36094
|
+
}
|
|
36095
|
+
},
|
|
36096
|
+
[]
|
|
36097
|
+
);
|
|
36098
|
+
const clearQueue = (0, import_react134.useCallback)(() => {
|
|
35913
36099
|
queueRef.current = [];
|
|
35914
36100
|
setQueuedMessages([]);
|
|
35915
36101
|
}, []);
|
|
35916
|
-
const getQueuedMessagesText = (0,
|
|
36102
|
+
const getQueuedMessagesText = (0, import_react134.useCallback)(() => {
|
|
35917
36103
|
if (queuedMessages.length === 0) return "";
|
|
35918
|
-
return queuedMessages.map(({
|
|
36104
|
+
return queuedMessages.map(({ modelText }) => modelText).join("\n\n");
|
|
35919
36105
|
}, [queuedMessages]);
|
|
35920
|
-
const popAllMessages = (0,
|
|
36106
|
+
const popAllMessages = (0, import_react134.useCallback)(() => {
|
|
35921
36107
|
const current = queueRef.current;
|
|
35922
36108
|
if (current.length === 0) return null;
|
|
35923
36109
|
queueRef.current = [];
|
|
35924
36110
|
setQueuedMessages([]);
|
|
35925
|
-
return current
|
|
36111
|
+
return aggregateMessages(current);
|
|
35926
36112
|
}, []);
|
|
35927
|
-
const restoreMessages = (0,
|
|
35928
|
-
const restored = messages.map((text) => text.trim()).filter(Boolean).map((
|
|
36113
|
+
const restoreMessages = (0, import_react134.useCallback)((messages) => {
|
|
36114
|
+
const restored = messages.map((text) => text.trim()).filter(Boolean).map((modelText) => ({ modelText, deferUntilIdle: false }));
|
|
35929
36115
|
if (restored.length === 0) return;
|
|
35930
36116
|
queueRef.current = [...restored, ...queueRef.current];
|
|
35931
36117
|
setQueuedMessages(queueRef.current);
|
|
35932
36118
|
}, []);
|
|
35933
|
-
const drainQueue = (0,
|
|
36119
|
+
const drainQueue = (0, import_react134.useCallback)((includeDeferred = false) => {
|
|
35934
36120
|
const current = queueRef.current;
|
|
35935
36121
|
if (current.length === 0) return [];
|
|
35936
|
-
const shouldDrain = /* @__PURE__ */ __name((message) => (!isSlashCommand(message.
|
|
36122
|
+
const shouldDrain = /* @__PURE__ */ __name((message) => (!isSlashCommand(message.modelText) || !includeDeferred && GOAL_COMMAND_RE.test(message.modelText)) && (includeDeferred || !message.deferUntilIdle), "shouldDrain");
|
|
35937
36123
|
const drained = current.filter(shouldDrain);
|
|
35938
36124
|
if (drained.length === 0) return [];
|
|
35939
36125
|
const rest = current.filter((message) => !shouldDrain(message));
|
|
35940
36126
|
queueRef.current = rest;
|
|
35941
36127
|
setQueuedMessages(rest);
|
|
35942
|
-
return drained.map(({
|
|
36128
|
+
return drained.map(({ modelText }) => modelText);
|
|
35943
36129
|
}, []);
|
|
35944
|
-
const
|
|
36130
|
+
const popNextTurn = (0, import_react134.useCallback)(() => {
|
|
35945
36131
|
const current = queueRef.current;
|
|
35946
36132
|
if (current.length === 0) return null;
|
|
35947
|
-
const
|
|
36133
|
+
const plainMessages = current.filter(
|
|
36134
|
+
(message) => !isSlashCommand(message.modelText)
|
|
36135
|
+
);
|
|
36136
|
+
const messages = plainMessages.length > 0 ? plainMessages : [current[0]];
|
|
36137
|
+
const selected = new Set(messages);
|
|
36138
|
+
const rest = current.filter((message) => !selected.has(message));
|
|
35948
36139
|
queueRef.current = rest;
|
|
35949
36140
|
setQueuedMessages(rest);
|
|
35950
|
-
return
|
|
36141
|
+
return aggregateMessages(messages);
|
|
35951
36142
|
}, []);
|
|
35952
36143
|
return {
|
|
35953
|
-
messageQueue: queuedMessages.map(({
|
|
36144
|
+
messageQueue: queuedMessages.map(({ modelText }) => modelText),
|
|
35954
36145
|
addMessage,
|
|
35955
36146
|
clearQueue,
|
|
35956
36147
|
getQueuedMessagesText,
|
|
35957
36148
|
popAllMessages,
|
|
35958
36149
|
restoreMessages,
|
|
35959
36150
|
drainQueue,
|
|
35960
|
-
|
|
36151
|
+
popNextTurn
|
|
35961
36152
|
};
|
|
35962
36153
|
}
|
|
35963
36154
|
__name(useMessageQueue, "useMessageQueue");
|
|
@@ -36105,16 +36296,17 @@ function charIndexAfterLine(text, keptLines) {
|
|
|
36105
36296
|
}
|
|
36106
36297
|
__name(charIndexAfterLine, "charIndexAfterLine");
|
|
36107
36298
|
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) => {
|
|
36108
|
-
const [initError, setInitError] = (0,
|
|
36109
|
-
const abortControllerRef = (0,
|
|
36110
|
-
const flushBufferedStreamEventsRef = (0,
|
|
36111
|
-
const turnCancelledRef = (0,
|
|
36112
|
-
const isSubmittingQueryRef = (0,
|
|
36113
|
-
const lastPromptRef = (0,
|
|
36114
|
-
const lastTurnUserItemRef = (0,
|
|
36115
|
-
const
|
|
36116
|
-
const
|
|
36117
|
-
const
|
|
36299
|
+
const [initError, setInitError] = (0, import_react135.useState)(null);
|
|
36300
|
+
const abortControllerRef = (0, import_react135.useRef)(null);
|
|
36301
|
+
const flushBufferedStreamEventsRef = (0, import_react135.useRef)(/* @__PURE__ */ new Set());
|
|
36302
|
+
const turnCancelledRef = (0, import_react135.useRef)(false);
|
|
36303
|
+
const isSubmittingQueryRef = (0, import_react135.useRef)(false);
|
|
36304
|
+
const lastPromptRef = (0, import_react135.useRef)(null);
|
|
36305
|
+
const lastTurnUserItemRef = (0, import_react135.useRef)(null);
|
|
36306
|
+
const canUndoLastLoggedUserMessageRef = (0, import_react135.useRef)(false);
|
|
36307
|
+
const turnSawContentEventRef = (0, import_react135.useRef)(false);
|
|
36308
|
+
const lastPromptErroredRef = (0, import_react135.useRef)(false);
|
|
36309
|
+
const commitItem = (0, import_react135.useCallback)(
|
|
36118
36310
|
(item, userMessageTimestamp) => {
|
|
36119
36311
|
if (item.type === "gemini" && !item.timestamp) {
|
|
36120
36312
|
item.timestamp = Date.now();
|
|
@@ -36124,17 +36316,17 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36124
36316
|
[addItem]
|
|
36125
36317
|
);
|
|
36126
36318
|
const dualOutput = useDualOutput();
|
|
36127
|
-
const [isResponding, setIsResponding] = (0,
|
|
36128
|
-
const activeModelStreamsRef = (0,
|
|
36129
|
-
const [thought, setThought] = (0,
|
|
36130
|
-
const historyRef = (0,
|
|
36131
|
-
(0,
|
|
36319
|
+
const [isResponding, setIsResponding] = (0, import_react135.useState)(false);
|
|
36320
|
+
const activeModelStreamsRef = (0, import_react135.useRef)(0);
|
|
36321
|
+
const [thought, setThought] = (0, import_react135.useState)(null);
|
|
36322
|
+
const historyRef = (0, import_react135.useRef)(history);
|
|
36323
|
+
(0, import_react135.useLayoutEffect)(() => {
|
|
36132
36324
|
historyRef.current = history;
|
|
36133
36325
|
}, [history]);
|
|
36134
|
-
const auxiliaryAbortRefsRef = (0,
|
|
36326
|
+
const auxiliaryAbortRefsRef = (0, import_react135.useRef)(/* @__PURE__ */ new Set());
|
|
36135
36327
|
const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
|
|
36136
36328
|
const [pendingThoughtItem, pendingThoughtItemRef, setPendingThoughtItem] = useStateAndRef(null);
|
|
36137
|
-
const thoughtStartTimeRef = (0,
|
|
36329
|
+
const thoughtStartTimeRef = (0, import_react135.useRef)(null);
|
|
36138
36330
|
const [
|
|
36139
36331
|
pendingRetryErrorItem,
|
|
36140
36332
|
pendingRetryErrorItemRef,
|
|
@@ -36145,21 +36337,25 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36145
36337
|
pendingRetryCountdownItemRef,
|
|
36146
36338
|
setPendingRetryCountdownItem
|
|
36147
36339
|
] = useStateAndRef(null);
|
|
36148
|
-
const retryCountdownTimerRef = (0,
|
|
36340
|
+
const retryCountdownTimerRef = (0, import_react135.useRef)(
|
|
36149
36341
|
null
|
|
36150
36342
|
);
|
|
36151
|
-
const processedMemoryToolsRef = (0,
|
|
36152
|
-
const submitPromptOnCompleteRef = (0,
|
|
36153
|
-
const modelOverrideRef = (0,
|
|
36154
|
-
const inlineModelOverrideActiveRef = (0,
|
|
36155
|
-
const
|
|
36156
|
-
|
|
36343
|
+
const processedMemoryToolsRef = (0, import_react135.useRef)(/* @__PURE__ */ new Set());
|
|
36344
|
+
const submitPromptOnCompleteRef = (0, import_react135.useRef)(null);
|
|
36345
|
+
const modelOverrideRef = (0, import_react135.useRef)(void 0);
|
|
36346
|
+
const inlineModelOverrideActiveRef = (0, import_react135.useRef)(false);
|
|
36347
|
+
const canUseToolResultFullTurnModel = (0, import_react135.useCallback)((model) => {
|
|
36348
|
+
const current = modelOverrideRef.current;
|
|
36349
|
+
return !inlineModelOverrideActiveRef.current && (!current?.endsWith("\0") || current === model);
|
|
36350
|
+
}, []);
|
|
36351
|
+
const handledProviderToolCallIdsRef = (0, import_react135.useRef)(/* @__PURE__ */ new Set());
|
|
36352
|
+
const duplicateProviderToolCallResponseIdsRef = (0, import_react135.useRef)(
|
|
36157
36353
|
/* @__PURE__ */ new Set()
|
|
36158
36354
|
);
|
|
36159
|
-
const pendingDuplicateToolResponsesRef = (0,
|
|
36160
|
-
const immediateDuplicateToolResponsesRef = (0,
|
|
36161
|
-
const streamingResponseLengthRef = (0,
|
|
36162
|
-
const [isReceivingContent, setIsReceivingContent] = (0,
|
|
36355
|
+
const pendingDuplicateToolResponsesRef = (0, import_react135.useRef)([]);
|
|
36356
|
+
const immediateDuplicateToolResponsesRef = (0, import_react135.useRef)(null);
|
|
36357
|
+
const streamingResponseLengthRef = (0, import_react135.useRef)(0);
|
|
36358
|
+
const [isReceivingContent, setIsReceivingContent] = (0, import_react135.useState)(false);
|
|
36163
36359
|
const {
|
|
36164
36360
|
startNewPrompt,
|
|
36165
36361
|
getPromptCount,
|
|
@@ -36182,13 +36378,14 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36182
36378
|
},
|
|
36183
36379
|
config,
|
|
36184
36380
|
getPreferredEditor,
|
|
36185
|
-
onEditorClose
|
|
36381
|
+
onEditorClose,
|
|
36382
|
+
canUseToolResultFullTurnModel
|
|
36186
36383
|
);
|
|
36187
|
-
const pendingToolCallGroupDisplay = (0,
|
|
36384
|
+
const pendingToolCallGroupDisplay = (0, import_react135.useMemo)(
|
|
36188
36385
|
() => toolCalls.length ? mapToDisplay(toolCalls, config.getProjectRoot()) : void 0,
|
|
36189
36386
|
[toolCalls, config]
|
|
36190
36387
|
);
|
|
36191
|
-
const activeToolPtyId = (0,
|
|
36388
|
+
const activeToolPtyId = (0, import_react135.useMemo)(() => {
|
|
36192
36389
|
const executingShellTool = toolCalls?.find(
|
|
36193
36390
|
(tc) => tc.status === "executing" && tc.request.name === "run_shell_command"
|
|
36194
36391
|
);
|
|
@@ -36197,18 +36394,18 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36197
36394
|
}
|
|
36198
36395
|
return void 0;
|
|
36199
36396
|
}, [toolCalls]);
|
|
36200
|
-
const loopDetectedRef = (0,
|
|
36397
|
+
const loopDetectedRef = (0, import_react135.useRef)(false);
|
|
36201
36398
|
const [
|
|
36202
36399
|
loopDetectionConfirmationRequest,
|
|
36203
36400
|
setLoopDetectionConfirmationRequest
|
|
36204
|
-
] = (0,
|
|
36205
|
-
const stopRetryCountdownTimer = (0,
|
|
36401
|
+
] = (0, import_react135.useState)(null);
|
|
36402
|
+
const stopRetryCountdownTimer = (0, import_react135.useCallback)(() => {
|
|
36206
36403
|
if (retryCountdownTimerRef.current) {
|
|
36207
36404
|
clearInterval(retryCountdownTimerRef.current);
|
|
36208
36405
|
retryCountdownTimerRef.current = null;
|
|
36209
36406
|
}
|
|
36210
36407
|
}, []);
|
|
36211
|
-
const clearRetryCountdown = (0,
|
|
36408
|
+
const clearRetryCountdown = (0, import_react135.useCallback)(() => {
|
|
36212
36409
|
stopRetryCountdownTimer();
|
|
36213
36410
|
skipRetryDelayRef.current = null;
|
|
36214
36411
|
setPendingRetryErrorItem(null);
|
|
@@ -36218,8 +36415,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36218
36415
|
setPendingRetryCountdownItem,
|
|
36219
36416
|
stopRetryCountdownTimer
|
|
36220
36417
|
]);
|
|
36221
|
-
const skipRetryDelayRef = (0,
|
|
36222
|
-
const startRetryCountdown = (0,
|
|
36418
|
+
const skipRetryDelayRef = (0, import_react135.useRef)(null);
|
|
36419
|
+
const startRetryCountdown = (0, import_react135.useCallback)(
|
|
36223
36420
|
(retryInfo) => {
|
|
36224
36421
|
stopRetryCountdownTimer();
|
|
36225
36422
|
skipRetryDelayRef.current = retryInfo.skipDelay;
|
|
@@ -36260,8 +36457,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36260
36457
|
stopRetryCountdownTimer
|
|
36261
36458
|
]
|
|
36262
36459
|
);
|
|
36263
|
-
(0,
|
|
36264
|
-
const onExec = (0,
|
|
36460
|
+
(0, import_react135.useEffect)(() => () => stopRetryCountdownTimer(), [stopRetryCountdownTimer]);
|
|
36461
|
+
const onExec = (0, import_react135.useCallback)(async (done) => {
|
|
36265
36462
|
setIsResponding(true);
|
|
36266
36463
|
await done;
|
|
36267
36464
|
setIsResponding(false);
|
|
@@ -36278,12 +36475,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36278
36475
|
terminalHeight
|
|
36279
36476
|
);
|
|
36280
36477
|
const activePtyId = activeShellPtyId || activeToolPtyId;
|
|
36281
|
-
(0,
|
|
36478
|
+
(0, import_react135.useEffect)(() => {
|
|
36282
36479
|
if (!activePtyId) {
|
|
36283
36480
|
setShellInputFocused(false);
|
|
36284
36481
|
}
|
|
36285
36482
|
}, [activePtyId, setShellInputFocused]);
|
|
36286
|
-
const streamingState = (0,
|
|
36483
|
+
const streamingState = (0, import_react135.useMemo)(() => {
|
|
36287
36484
|
if (toolCalls.some((tc) => tc.status === "awaiting_approval")) {
|
|
36288
36485
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
36289
36486
|
}
|
|
@@ -36301,7 +36498,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36301
36498
|
}
|
|
36302
36499
|
return "idle" /* Idle */;
|
|
36303
36500
|
}, [isResponding, toolCalls]);
|
|
36304
|
-
(0,
|
|
36501
|
+
(0, import_react135.useEffect)(() => {
|
|
36305
36502
|
if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
|
|
36306
36503
|
const lastUserMessageIndex = findLastUserItemIndex(history);
|
|
36307
36504
|
const turnCount = lastUserMessageIndex === -1 ? 0 : history.length - lastUserMessageIndex;
|
|
@@ -36313,7 +36510,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36313
36510
|
}
|
|
36314
36511
|
}
|
|
36315
36512
|
}, [streamingState, config, history]);
|
|
36316
|
-
const cancelOngoingRequest = (0,
|
|
36513
|
+
const cancelOngoingRequest = (0, import_react135.useCallback)(() => {
|
|
36317
36514
|
if (streamingState !== "responding" /* Responding */) {
|
|
36318
36515
|
return;
|
|
36319
36516
|
}
|
|
@@ -36366,6 +36563,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36366
36563
|
onCancelSubmit({
|
|
36367
36564
|
pendingItem: pendingItemAtCancel,
|
|
36368
36565
|
lastTurnUserItem: lastTurnUserItemRef.current,
|
|
36566
|
+
canUndoLastLoggedUserMessage: canUndoLastLoggedUserMessageRef.current,
|
|
36369
36567
|
turnProducedMeaningfulContent: turnSawContentEventRef.current
|
|
36370
36568
|
});
|
|
36371
36569
|
} finally {
|
|
@@ -36384,7 +36582,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36384
36582
|
config,
|
|
36385
36583
|
getPromptCount
|
|
36386
36584
|
]);
|
|
36387
|
-
const applyVisionBridgeIfNeeded = (0,
|
|
36585
|
+
const applyVisionBridgeIfNeeded = (0, import_react135.useCallback)(
|
|
36388
36586
|
async (parts, timestamp, signal) => {
|
|
36389
36587
|
if (parts === null || !hasImageParts(parts)) {
|
|
36390
36588
|
return { parts, shouldProceed: true };
|
|
@@ -36449,15 +36647,17 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36449
36647
|
},
|
|
36450
36648
|
[addItem, config]
|
|
36451
36649
|
);
|
|
36452
|
-
const prepareQueryForGemini = (0,
|
|
36453
|
-
async (query, userMessageTimestamp, abortSignal, prompt_id, submitType) => {
|
|
36650
|
+
const prepareQueryForGemini = (0, import_react135.useCallback)(
|
|
36651
|
+
async (query, userMessageTimestamp, abortSignal, prompt_id, submitType, submittedPrompt, preserveTurnOwnership) => {
|
|
36454
36652
|
if (turnCancelledRef.current) {
|
|
36455
36653
|
return { queryToSend: null, shouldProceed: false };
|
|
36456
36654
|
}
|
|
36457
36655
|
if (typeof query === "string" && query.trim().length === 0) {
|
|
36458
36656
|
return { queryToSend: null, shouldProceed: false };
|
|
36459
36657
|
}
|
|
36460
|
-
|
|
36658
|
+
if (!preserveTurnOwnership) {
|
|
36659
|
+
lastTurnUserItemRef.current = null;
|
|
36660
|
+
}
|
|
36461
36661
|
let localQueryToSendToGemini = null;
|
|
36462
36662
|
if (typeof query === "string") {
|
|
36463
36663
|
const trimmedQuery = query.trim();
|
|
@@ -36475,6 +36675,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36475
36675
|
}
|
|
36476
36676
|
onDebugMessage(`Received user query (${trimmedQuery.length} chars)`);
|
|
36477
36677
|
await logger?.logMessage("user" /* USER */, trimmedQuery);
|
|
36678
|
+
canUndoLastLoggedUserMessageRef.current = !preserveTurnOwnership && logger != null;
|
|
36478
36679
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
36479
36680
|
if (slashCommandResult) {
|
|
36480
36681
|
switch (slashCommandResult.type) {
|
|
@@ -36548,10 +36749,13 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36548
36749
|
},
|
|
36549
36750
|
userMessageTimestamp
|
|
36550
36751
|
);
|
|
36551
|
-
|
|
36552
|
-
|
|
36553
|
-
|
|
36554
|
-
|
|
36752
|
+
if (!preserveTurnOwnership) {
|
|
36753
|
+
lastTurnUserItemRef.current = {
|
|
36754
|
+
id: insertedId,
|
|
36755
|
+
text: trimmedQuery,
|
|
36756
|
+
...submittedPrompt === void 0 ? {} : { submittedPrompt }
|
|
36757
|
+
};
|
|
36758
|
+
}
|
|
36555
36759
|
await new Promise((r) => setImmediate(r));
|
|
36556
36760
|
}
|
|
36557
36761
|
if (isAtCommand(trimmedQuery)) {
|
|
@@ -36600,7 +36804,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36600
36804
|
applyVisionBridgeIfNeeded
|
|
36601
36805
|
]
|
|
36602
36806
|
);
|
|
36603
|
-
const handleContentEvent = (0,
|
|
36807
|
+
const handleContentEvent = (0, import_react135.useCallback)(
|
|
36604
36808
|
(eventValue, currentGeminiMessageBuffer, userMessageTimestamp) => {
|
|
36605
36809
|
if (turnCancelledRef.current) {
|
|
36606
36810
|
return "";
|
|
@@ -36725,7 +36929,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36725
36929
|
terminalWidthRef
|
|
36726
36930
|
]
|
|
36727
36931
|
);
|
|
36728
|
-
const mergeThought = (0,
|
|
36932
|
+
const mergeThought = (0, import_react135.useCallback)(
|
|
36729
36933
|
(incoming) => {
|
|
36730
36934
|
setThought((prev) => {
|
|
36731
36935
|
const incomingDescription = incoming.description ? clampLoadingThoughtDescription(incoming.description) : incoming.description;
|
|
@@ -36754,7 +36958,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36754
36958
|
},
|
|
36755
36959
|
[setThought]
|
|
36756
36960
|
);
|
|
36757
|
-
const handleThoughtEvent = (0,
|
|
36961
|
+
const handleThoughtEvent = (0, import_react135.useCallback)(
|
|
36758
36962
|
(eventValue, currentThoughtBuffer, userMessageTimestamp) => {
|
|
36759
36963
|
if (turnCancelledRef.current) {
|
|
36760
36964
|
return "";
|
|
@@ -36816,7 +37020,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36816
37020
|
},
|
|
36817
37021
|
[addItem, mergeThought, pendingThoughtItemRef, setPendingThoughtItem]
|
|
36818
37022
|
);
|
|
36819
|
-
const commitPendingThought = (0,
|
|
37023
|
+
const commitPendingThought = (0, import_react135.useCallback)(
|
|
36820
37024
|
(userMessageTimestamp) => {
|
|
36821
37025
|
if (pendingThoughtItemRef.current) {
|
|
36822
37026
|
const item = { ...pendingThoughtItemRef.current };
|
|
@@ -36830,7 +37034,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36830
37034
|
},
|
|
36831
37035
|
[addItem, pendingThoughtItemRef, setPendingThoughtItem]
|
|
36832
37036
|
);
|
|
36833
|
-
const handleUserCancelledEvent = (0,
|
|
37037
|
+
const handleUserCancelledEvent = (0, import_react135.useCallback)(
|
|
36834
37038
|
(userMessageTimestamp) => {
|
|
36835
37039
|
if (turnCancelledRef.current) {
|
|
36836
37040
|
return;
|
|
@@ -36870,7 +37074,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36870
37074
|
clearRetryCountdown
|
|
36871
37075
|
]
|
|
36872
37076
|
);
|
|
36873
|
-
const handleErrorEvent = (0,
|
|
37077
|
+
const handleErrorEvent = (0, import_react135.useCallback)(
|
|
36874
37078
|
(eventValue, userMessageTimestamp) => {
|
|
36875
37079
|
lastPromptErroredRef.current = true;
|
|
36876
37080
|
commitPendingThought(userMessageTimestamp);
|
|
@@ -36913,7 +37117,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36913
37117
|
clearRetryCountdown
|
|
36914
37118
|
]
|
|
36915
37119
|
);
|
|
36916
|
-
const handleCitationEvent = (0,
|
|
37120
|
+
const handleCitationEvent = (0, import_react135.useCallback)(
|
|
36917
37121
|
(text, userMessageTimestamp) => {
|
|
36918
37122
|
if (!showCitations(settings)) {
|
|
36919
37123
|
return;
|
|
@@ -36932,7 +37136,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36932
37136
|
settings
|
|
36933
37137
|
]
|
|
36934
37138
|
);
|
|
36935
|
-
const handleFinishedEvent = (0,
|
|
37139
|
+
const handleFinishedEvent = (0, import_react135.useCallback)(
|
|
36936
37140
|
(event, userMessageTimestamp) => {
|
|
36937
37141
|
const finishReason = event.value.reason;
|
|
36938
37142
|
if (!finishReason) {
|
|
@@ -36973,8 +37177,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36973
37177
|
},
|
|
36974
37178
|
[addItem, clearRetryCountdown]
|
|
36975
37179
|
);
|
|
36976
|
-
const autonomousLoopTickResolverRef = (0,
|
|
36977
|
-
const handleChatCompressionEvent = (0,
|
|
37180
|
+
const autonomousLoopTickResolverRef = (0, import_react135.useRef)(null);
|
|
37181
|
+
const handleChatCompressionEvent = (0, import_react135.useCallback)(
|
|
36978
37182
|
(eventValue, userMessageTimestamp) => {
|
|
36979
37183
|
autonomousLoopTickResolverRef.current?.resetCache();
|
|
36980
37184
|
if (pendingHistoryItemRef.current) {
|
|
@@ -36993,7 +37197,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36993
37197
|
},
|
|
36994
37198
|
[addItem, commitItem, config, pendingHistoryItemRef, setPendingHistoryItem]
|
|
36995
37199
|
);
|
|
36996
|
-
const handleMaxSessionTurnsEvent = (0,
|
|
37200
|
+
const handleMaxSessionTurnsEvent = (0, import_react135.useCallback)(
|
|
36997
37201
|
() => addItem(
|
|
36998
37202
|
{
|
|
36999
37203
|
type: "info",
|
|
@@ -37003,7 +37207,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37003
37207
|
),
|
|
37004
37208
|
[addItem, config]
|
|
37005
37209
|
);
|
|
37006
|
-
const handleSessionTokenLimitExceededEvent = (0,
|
|
37210
|
+
const handleSessionTokenLimitExceededEvent = (0, import_react135.useCallback)(
|
|
37007
37211
|
(value) => addItem(
|
|
37008
37212
|
{
|
|
37009
37213
|
type: "error",
|
|
@@ -37018,7 +37222,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37018
37222
|
),
|
|
37019
37223
|
[addItem]
|
|
37020
37224
|
);
|
|
37021
|
-
const handleLoopDetectionConfirmation = (0,
|
|
37225
|
+
const handleLoopDetectionConfirmation = (0, import_react135.useCallback)(
|
|
37022
37226
|
(result) => {
|
|
37023
37227
|
setLoopDetectionConfirmationRequest(null);
|
|
37024
37228
|
if (result.userSelection === "disable") {
|
|
@@ -37042,12 +37246,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37042
37246
|
},
|
|
37043
37247
|
[config, addItem]
|
|
37044
37248
|
);
|
|
37045
|
-
const handleLoopDetectedEvent = (0,
|
|
37249
|
+
const handleLoopDetectedEvent = (0, import_react135.useCallback)(() => {
|
|
37046
37250
|
setLoopDetectionConfirmationRequest({
|
|
37047
37251
|
onComplete: handleLoopDetectionConfirmation
|
|
37048
37252
|
});
|
|
37049
37253
|
}, [handleLoopDetectionConfirmation]);
|
|
37050
|
-
const handleUserPromptSubmitBlockedEvent = (0,
|
|
37254
|
+
const handleUserPromptSubmitBlockedEvent = (0, import_react135.useCallback)(
|
|
37051
37255
|
(value, userMessageTimestamp) => {
|
|
37052
37256
|
if (pendingHistoryItemRef.current) {
|
|
37053
37257
|
commitItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -37064,7 +37268,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37064
37268
|
},
|
|
37065
37269
|
[addItem, commitItem, pendingHistoryItemRef, setPendingHistoryItem]
|
|
37066
37270
|
);
|
|
37067
|
-
const handleStopHookLoopEvent = (0,
|
|
37271
|
+
const handleStopHookLoopEvent = (0, import_react135.useCallback)(
|
|
37068
37272
|
(value, userMessageTimestamp) => {
|
|
37069
37273
|
if (pendingHistoryItemRef.current) {
|
|
37070
37274
|
commitItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -37098,7 +37302,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37098
37302
|
},
|
|
37099
37303
|
[addItem, commitItem, config, pendingHistoryItemRef, setPendingHistoryItem]
|
|
37100
37304
|
);
|
|
37101
|
-
const handleActiveGoalEvent = (0,
|
|
37305
|
+
const handleActiveGoalEvent = (0, import_react135.useCallback)(
|
|
37102
37306
|
(activeGoal) => {
|
|
37103
37307
|
const sessionId = config.getSessionId();
|
|
37104
37308
|
const currentActiveGoal = getActiveGoal(sessionId);
|
|
@@ -37116,7 +37320,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37116
37320
|
},
|
|
37117
37321
|
[config]
|
|
37118
37322
|
);
|
|
37119
|
-
const processGeminiStreamEvents = (0,
|
|
37323
|
+
const processGeminiStreamEvents = (0, import_react135.useCallback)(
|
|
37120
37324
|
async (stream, userMessageTimestamp, signal) => {
|
|
37121
37325
|
let geminiMessageBuffer = "";
|
|
37122
37326
|
let thoughtBuffer = "";
|
|
@@ -37344,6 +37548,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37344
37548
|
case "active_goal" /* ActiveGoal */:
|
|
37345
37549
|
handleActiveGoalEvent(event.value);
|
|
37346
37550
|
break;
|
|
37551
|
+
case "goal_state" /* GoalState */:
|
|
37552
|
+
break;
|
|
37347
37553
|
default: {
|
|
37348
37554
|
const unreachable = event;
|
|
37349
37555
|
return unreachable;
|
|
@@ -37456,7 +37662,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37456
37662
|
dualOutput
|
|
37457
37663
|
]
|
|
37458
37664
|
);
|
|
37459
|
-
const resolveSteeredMessages = (0,
|
|
37665
|
+
const resolveSteeredMessages = (0, import_react135.useCallback)(
|
|
37460
37666
|
async (messages, signal) => {
|
|
37461
37667
|
const resolvedSegments = [];
|
|
37462
37668
|
const resolvedForRecording = [];
|
|
@@ -37625,7 +37831,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37625
37831
|
onDebugMessage
|
|
37626
37832
|
]
|
|
37627
37833
|
);
|
|
37628
|
-
const resolveDrainedSteerMessages = (0,
|
|
37834
|
+
const resolveDrainedSteerMessages = (0, import_react135.useCallback)(
|
|
37629
37835
|
async (messages, signal) => {
|
|
37630
37836
|
try {
|
|
37631
37837
|
const resolved = await resolveSteeredMessages(messages, signal);
|
|
@@ -37662,7 +37868,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37662
37868
|
},
|
|
37663
37869
|
[midTurnRestoreRef, onDebugMessage, resolveSteeredMessages]
|
|
37664
37870
|
);
|
|
37665
|
-
const drainSteerAtBoundary = (0,
|
|
37871
|
+
const drainSteerAtBoundary = (0, import_react135.useCallback)(
|
|
37666
37872
|
async (signal) => {
|
|
37667
37873
|
const messages = midTurnDrainRef?.current?.() ?? [];
|
|
37668
37874
|
if (messages.length === 0) return void 0;
|
|
@@ -37670,10 +37876,11 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37670
37876
|
},
|
|
37671
37877
|
[midTurnDrainRef, resolveDrainedSteerMessages]
|
|
37672
37878
|
);
|
|
37673
|
-
const submitQuery = (0,
|
|
37879
|
+
const submitQuery = (0, import_react135.useCallback)(
|
|
37674
37880
|
async (query, submitType = "userQuery" /* UserQuery */, prompt_id, metadata) => {
|
|
37675
37881
|
const allowConcurrentBtwDuringResponse = submitType === "userQuery" /* UserQuery */ && streamingState === "responding" /* Responding */ && typeof query === "string" && isBtwCommand(query);
|
|
37676
37882
|
const isTurnContinuation = submitType === "toolResult" /* ToolResult */ || submitType === "steer" /* Steer */;
|
|
37883
|
+
const submittedPrompt = submitType === "userQuery" /* UserQuery */ ? metadata?.submittedPrompt : void 0;
|
|
37677
37884
|
if (isSubmittingQueryRef.current && !isTurnContinuation && !allowConcurrentBtwDuringResponse) {
|
|
37678
37885
|
metadata?.onDeliveryFailed?.();
|
|
37679
37886
|
return;
|
|
@@ -37686,6 +37893,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37686
37893
|
loopDetectedRef.current = false;
|
|
37687
37894
|
if (!isTurnContinuation && !allowConcurrentBtwDuringResponse) {
|
|
37688
37895
|
lastTurnUserItemRef.current = null;
|
|
37896
|
+
canUndoLastLoggedUserMessageRef.current = false;
|
|
37689
37897
|
turnSawContentEventRef.current = false;
|
|
37690
37898
|
handledProviderToolCallIdsRef.current.clear();
|
|
37691
37899
|
duplicateProviderToolCallResponseIdsRef.current.clear();
|
|
@@ -37732,7 +37940,9 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37732
37940
|
userMessageTimestamp,
|
|
37733
37941
|
abortSignal,
|
|
37734
37942
|
prompt_id,
|
|
37735
|
-
submitType
|
|
37943
|
+
submitType,
|
|
37944
|
+
submittedPrompt,
|
|
37945
|
+
allowConcurrentBtwDuringResponse
|
|
37736
37946
|
);
|
|
37737
37947
|
if (!shouldProceed || queryToSend === null) {
|
|
37738
37948
|
isSubmittingQueryRef.current = false;
|
|
@@ -37790,17 +38000,20 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37790
38000
|
);
|
|
37791
38001
|
dualOutput.emitUserMessage(userParts);
|
|
37792
38002
|
}
|
|
38003
|
+
const sendOptions = {
|
|
38004
|
+
type: submitType,
|
|
38005
|
+
notificationDisplayText: metadata?.notificationDisplayText,
|
|
38006
|
+
todoWorkChainId: metadata?.todoWorkChainId,
|
|
38007
|
+
modelOverride: modelOverrideRef.current,
|
|
38008
|
+
steerInput: metadata?.steerInput,
|
|
38009
|
+
...submittedPrompt !== void 0 ? { submittedPrompt } : {},
|
|
38010
|
+
...!allowConcurrentBtwDuringResponse && midTurnDrainRef ? { getSteerInput: drainSteerAtBoundary } : {}
|
|
38011
|
+
};
|
|
37793
38012
|
const stream = geminiClient.sendMessageStream(
|
|
37794
38013
|
finalQueryToSend,
|
|
37795
38014
|
abortSignal,
|
|
37796
38015
|
prompt_id,
|
|
37797
|
-
|
|
37798
|
-
type: submitType,
|
|
37799
|
-
notificationDisplayText: metadata?.notificationDisplayText,
|
|
37800
|
-
modelOverride: modelOverrideRef.current,
|
|
37801
|
-
steerInput: metadata?.steerInput,
|
|
37802
|
-
...!allowConcurrentBtwDuringResponse && midTurnDrainRef ? { getSteerInput: drainSteerAtBoundary } : {}
|
|
37803
|
-
}
|
|
38016
|
+
sendOptions
|
|
37804
38017
|
);
|
|
37805
38018
|
const processingStatus = await processGeminiStreamEvents(
|
|
37806
38019
|
stream,
|
|
@@ -37955,7 +38168,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37955
38168
|
midTurnDrainRef
|
|
37956
38169
|
]
|
|
37957
38170
|
);
|
|
37958
|
-
const retryLastPrompt = (0,
|
|
38171
|
+
const retryLastPrompt = (0, import_react135.useCallback)(async () => {
|
|
37959
38172
|
if (skipRetryDelayRef.current) {
|
|
37960
38173
|
skipRetryDelayRef.current();
|
|
37961
38174
|
skipRetryDelayRef.current = null;
|
|
@@ -37979,7 +38192,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37979
38192
|
clearRetryCountdown();
|
|
37980
38193
|
await submitQuery(lastPrompt, "retry" /* Retry */);
|
|
37981
38194
|
}, [streamingState, addItem, clearRetryCountdown, submitQuery]);
|
|
37982
|
-
const handleApprovalModeChange = (0,
|
|
38195
|
+
const handleApprovalModeChange = (0, import_react135.useCallback)(
|
|
37983
38196
|
async (newApprovalMode) => {
|
|
37984
38197
|
if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "auto-edit" /* AUTO_EDIT */) {
|
|
37985
38198
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
@@ -38014,7 +38227,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38014
38227
|
},
|
|
38015
38228
|
[toolCalls]
|
|
38016
38229
|
);
|
|
38017
|
-
const handleCompletedTools = (0,
|
|
38230
|
+
const handleCompletedTools = (0, import_react135.useCallback)(
|
|
38018
38231
|
async (completedToolCallsFromScheduler) => {
|
|
38019
38232
|
const completedAndReadyToSubmitTools = completedToolCallsFromScheduler.filter(
|
|
38020
38233
|
(tc) => {
|
|
@@ -38325,7 +38538,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38325
38538
|
resolveDrainedSteerMessages
|
|
38326
38539
|
]
|
|
38327
38540
|
);
|
|
38328
|
-
const pendingHistoryItems = (0,
|
|
38541
|
+
const pendingHistoryItems = (0, import_react135.useMemo)(
|
|
38329
38542
|
() => [
|
|
38330
38543
|
// Reasoning renders above the streaming answer.
|
|
38331
38544
|
pendingThoughtItem,
|
|
@@ -38342,7 +38555,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38342
38555
|
pendingToolCallGroupDisplay
|
|
38343
38556
|
]
|
|
38344
38557
|
);
|
|
38345
|
-
(0,
|
|
38558
|
+
(0, import_react135.useEffect)(() => {
|
|
38346
38559
|
const saveRestorableToolCalls = /* @__PURE__ */ __name(async () => {
|
|
38347
38560
|
if (!config.getFileCheckpointingEnabled()) {
|
|
38348
38561
|
return;
|
|
@@ -38413,14 +38626,14 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38413
38626
|
}, "saveRestorableToolCalls");
|
|
38414
38627
|
saveRestorableToolCalls();
|
|
38415
38628
|
}, [toolCalls, config, onDebugMessage, history, geminiClient, storage]);
|
|
38416
|
-
const notificationQueueRef = (0,
|
|
38417
|
-
const [notificationTrigger, setNotificationTrigger] = (0,
|
|
38418
|
-
const getAutonomousLoopTickResolver = (0,
|
|
38629
|
+
const notificationQueueRef = (0, import_react135.useRef)([]);
|
|
38630
|
+
const [notificationTrigger, setNotificationTrigger] = (0, import_react135.useState)(0);
|
|
38631
|
+
const getAutonomousLoopTickResolver = (0, import_react135.useCallback)(() => {
|
|
38419
38632
|
autonomousLoopTickResolverRef.current ??= new AutonomousLoopTickResolver();
|
|
38420
38633
|
return autonomousLoopTickResolverRef.current;
|
|
38421
38634
|
}, []);
|
|
38422
|
-
const notificationQueueSessionIdRef = (0,
|
|
38423
|
-
(0,
|
|
38635
|
+
const notificationQueueSessionIdRef = (0, import_react135.useRef)(sessionStates.sessionId);
|
|
38636
|
+
(0, import_react135.useEffect)(() => {
|
|
38424
38637
|
if (notificationQueueSessionIdRef.current === sessionStates.sessionId) {
|
|
38425
38638
|
return;
|
|
38426
38639
|
}
|
|
@@ -38428,9 +38641,9 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38428
38641
|
notificationQueueRef.current = [];
|
|
38429
38642
|
autonomousLoopTickResolverRef.current?.resetCache();
|
|
38430
38643
|
}, [sessionStates.sessionId]);
|
|
38431
|
-
const cronSessionIdRef = (0,
|
|
38644
|
+
const cronSessionIdRef = (0, import_react135.useRef)(sessionStates.sessionId);
|
|
38432
38645
|
cronSessionIdRef.current = sessionStates.sessionId;
|
|
38433
|
-
(0,
|
|
38646
|
+
(0, import_react135.useEffect)(() => {
|
|
38434
38647
|
if (!isConfigInitialized) return;
|
|
38435
38648
|
if (!config.isCronEnabled()) return;
|
|
38436
38649
|
const scheduler = config.getCronScheduler();
|
|
@@ -38460,6 +38673,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38460
38673
|
displayText: `${job.missed ? "Missed" : source}: ${label}`,
|
|
38461
38674
|
modelText,
|
|
38462
38675
|
sendMessageType: "cron" /* Cron */,
|
|
38676
|
+
todoWorkChainId: job.todoWorkChainId,
|
|
38463
38677
|
onDelivered: /* @__PURE__ */ __name(() => resolver.markDelivered(), "onDelivered")
|
|
38464
38678
|
});
|
|
38465
38679
|
setNotificationTrigger((n) => n + 1);
|
|
@@ -38468,7 +38682,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38468
38682
|
notificationQueueRef.current.push({
|
|
38469
38683
|
displayText: `${job.missed ? "Missed" : source}: ${label}`,
|
|
38470
38684
|
modelText,
|
|
38471
|
-
sendMessageType: "cron" /* Cron
|
|
38685
|
+
sendMessageType: "cron" /* Cron */,
|
|
38686
|
+
todoWorkChainId: job.todoWorkChainId
|
|
38472
38687
|
});
|
|
38473
38688
|
setNotificationTrigger((n) => n + 1);
|
|
38474
38689
|
}
|
|
@@ -38479,17 +38694,18 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38479
38694
|
const summary = scheduler.getExitSummary();
|
|
38480
38695
|
scheduler.stop();
|
|
38481
38696
|
if (summary) {
|
|
38482
|
-
|
|
38697
|
+
process15.stderr.write(summary + "\n");
|
|
38483
38698
|
}
|
|
38484
38699
|
};
|
|
38485
38700
|
}, [config, getAutonomousLoopTickResolver, isConfigInitialized]);
|
|
38486
|
-
(0,
|
|
38701
|
+
(0, import_react135.useEffect)(() => {
|
|
38487
38702
|
const registry = config.getBackgroundTaskRegistry();
|
|
38488
|
-
registry.setNotificationCallback((displayText, modelText) => {
|
|
38703
|
+
registry.setNotificationCallback((displayText, modelText, meta) => {
|
|
38489
38704
|
notificationQueueRef.current.push({
|
|
38490
38705
|
displayText,
|
|
38491
38706
|
modelText,
|
|
38492
|
-
sendMessageType: "notification" /* Notification
|
|
38707
|
+
sendMessageType: "notification" /* Notification */,
|
|
38708
|
+
todoWorkChainId: meta?.todoWorkChainId
|
|
38493
38709
|
});
|
|
38494
38710
|
setNotificationTrigger((n) => n + 1);
|
|
38495
38711
|
});
|
|
@@ -38497,13 +38713,14 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38497
38713
|
registry.setNotificationCallback(void 0);
|
|
38498
38714
|
};
|
|
38499
38715
|
}, [config]);
|
|
38500
|
-
(0,
|
|
38716
|
+
(0, import_react135.useEffect)(() => {
|
|
38501
38717
|
const registry = config.getBackgroundShellRegistry();
|
|
38502
|
-
registry.setNotificationCallback((displayText, modelText) => {
|
|
38718
|
+
registry.setNotificationCallback((displayText, modelText, meta) => {
|
|
38503
38719
|
notificationQueueRef.current.push({
|
|
38504
38720
|
displayText,
|
|
38505
38721
|
modelText,
|
|
38506
|
-
sendMessageType: "notification" /* Notification
|
|
38722
|
+
sendMessageType: "notification" /* Notification */,
|
|
38723
|
+
todoWorkChainId: meta?.todoWorkChainId
|
|
38507
38724
|
});
|
|
38508
38725
|
setNotificationTrigger((n) => n + 1);
|
|
38509
38726
|
});
|
|
@@ -38511,7 +38728,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38511
38728
|
registry.setNotificationCallback(void 0);
|
|
38512
38729
|
};
|
|
38513
38730
|
}, [config]);
|
|
38514
|
-
(0,
|
|
38731
|
+
(0, import_react135.useEffect)(() => {
|
|
38515
38732
|
const registry = config.getMonitorRegistry();
|
|
38516
38733
|
registry.setNotificationCallback((displayText, modelText, meta) => {
|
|
38517
38734
|
if (meta.status === "running" && typeof registry.get === "function") {
|
|
@@ -38522,7 +38739,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38522
38739
|
displayText,
|
|
38523
38740
|
modelText,
|
|
38524
38741
|
sendMessageType: "notification" /* Notification */,
|
|
38525
|
-
monitor: { id: meta.monitorId, status: meta.status }
|
|
38742
|
+
monitor: { id: meta.monitorId, status: meta.status },
|
|
38743
|
+
todoWorkChainId: meta.todoWorkChainId
|
|
38526
38744
|
});
|
|
38527
38745
|
setNotificationTrigger((n) => n + 1);
|
|
38528
38746
|
});
|
|
@@ -38530,7 +38748,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38530
38748
|
registry.setNotificationCallback(void 0);
|
|
38531
38749
|
};
|
|
38532
38750
|
}, [config]);
|
|
38533
|
-
(0,
|
|
38751
|
+
(0, import_react135.useEffect)(() => {
|
|
38534
38752
|
if (streamingState === "idle" /* Idle */ && !isSubmittingQueryRef.current && notificationQueueRef.current.length > 0) {
|
|
38535
38753
|
runOutsideAgentContext(() => {
|
|
38536
38754
|
const queue = notificationQueueRef.current;
|
|
@@ -38553,13 +38771,14 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38553
38771
|
);
|
|
38554
38772
|
submitQuery(item.modelText, item.sendMessageType, void 0, {
|
|
38555
38773
|
notificationDisplayText: item.displayText,
|
|
38774
|
+
todoWorkChainId: item.todoWorkChainId,
|
|
38556
38775
|
onDelivered: item.onDelivered,
|
|
38557
38776
|
onDeliveryFailed: item.onDeliveryFailed
|
|
38558
38777
|
});
|
|
38559
38778
|
return;
|
|
38560
38779
|
}
|
|
38561
38780
|
let splitIdx = 0;
|
|
38562
|
-
while (splitIdx < queue.length && queue[splitIdx].sendMessageType === targetType) {
|
|
38781
|
+
while (splitIdx < queue.length && queue[splitIdx].sendMessageType === targetType && queue[splitIdx].todoWorkChainId === queue[0].todoWorkChainId) {
|
|
38563
38782
|
splitIdx++;
|
|
38564
38783
|
}
|
|
38565
38784
|
const batch = queue.splice(0, splitIdx);
|
|
@@ -38573,14 +38792,15 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38573
38792
|
const combinedModelText = batch.map((e) => e.modelText).join("\n\n");
|
|
38574
38793
|
const combinedDisplayText = batch.map((e) => e.displayText).join("; ");
|
|
38575
38794
|
submitQuery(combinedModelText, targetType, void 0, {
|
|
38576
|
-
notificationDisplayText: combinedDisplayText
|
|
38795
|
+
notificationDisplayText: combinedDisplayText,
|
|
38796
|
+
todoWorkChainId: batch[0]?.todoWorkChainId
|
|
38577
38797
|
});
|
|
38578
38798
|
});
|
|
38579
38799
|
}
|
|
38580
38800
|
}, [streamingState, submitQuery, notificationTrigger, addItem, config]);
|
|
38581
|
-
const teammateQueueRef = (0,
|
|
38582
|
-
const [teammateTrigger, setTeammateTrigger] = (0,
|
|
38583
|
-
(0,
|
|
38801
|
+
const teammateQueueRef = (0, import_react135.useRef)([]);
|
|
38802
|
+
const [teammateTrigger, setTeammateTrigger] = (0, import_react135.useState)(0);
|
|
38803
|
+
(0, import_react135.useEffect)(() => {
|
|
38584
38804
|
let boundManager = null;
|
|
38585
38805
|
const handleManagerChange = /* @__PURE__ */ __name((manager) => {
|
|
38586
38806
|
if (boundManager && boundManager !== manager) {
|
|
@@ -38610,7 +38830,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38610
38830
|
}
|
|
38611
38831
|
};
|
|
38612
38832
|
}, [config]);
|
|
38613
|
-
(0,
|
|
38833
|
+
(0, import_react135.useEffect)(() => {
|
|
38614
38834
|
if (streamingState === "idle" /* Idle */ && !isSubmittingQueryRef.current && teammateQueueRef.current.length > 0) {
|
|
38615
38835
|
runOutsideAgentContext(() => {
|
|
38616
38836
|
const batch = teammateQueueRef.current.splice(0);
|
|
@@ -38647,7 +38867,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38647
38867
|
|
|
38648
38868
|
// packages/cli/src/ui/hooks/vim.ts
|
|
38649
38869
|
init_esbuild_shims();
|
|
38650
|
-
var
|
|
38870
|
+
var import_react136 = __toESM(require_react(), 1);
|
|
38651
38871
|
import { execFile as execFile7, execFileSync as execFileSync2 } from "child_process";
|
|
38652
38872
|
var DIGIT_MULTIPLIER = 10;
|
|
38653
38873
|
var DEFAULT_COUNT = 1;
|
|
@@ -38883,26 +39103,26 @@ __name(findCharInLineReverse, "findCharInLineReverse");
|
|
|
38883
39103
|
function useVim(buffer, onSubmit) {
|
|
38884
39104
|
const { vimEnabled, vimMode } = useVimModeState();
|
|
38885
39105
|
const { setVimMode } = useVimModeActions();
|
|
38886
|
-
const [state, dispatch] = (0,
|
|
38887
|
-
const bufferRef = (0,
|
|
38888
|
-
const stateRef = (0,
|
|
39106
|
+
const [state, dispatch] = (0, import_react136.useReducer)(vimReducer, initialVimState);
|
|
39107
|
+
const bufferRef = (0, import_react136.useRef)(buffer);
|
|
39108
|
+
const stateRef = (0, import_react136.useRef)(state);
|
|
38889
39109
|
bufferRef.current = buffer;
|
|
38890
39110
|
stateRef.current = state;
|
|
38891
|
-
(0,
|
|
39111
|
+
(0, import_react136.useEffect)(() => {
|
|
38892
39112
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
38893
39113
|
}, [vimMode]);
|
|
38894
|
-
const updateMode = (0,
|
|
39114
|
+
const updateMode = (0, import_react136.useCallback)(
|
|
38895
39115
|
(mode) => {
|
|
38896
39116
|
setVimMode(mode);
|
|
38897
39117
|
dispatch({ type: "SET_MODE", mode });
|
|
38898
39118
|
},
|
|
38899
39119
|
[setVimMode]
|
|
38900
39120
|
);
|
|
38901
|
-
const getCurrentCount = (0,
|
|
39121
|
+
const getCurrentCount = (0, import_react136.useCallback)(
|
|
38902
39122
|
() => stateRef.current.count || DEFAULT_COUNT,
|
|
38903
39123
|
[]
|
|
38904
39124
|
);
|
|
38905
|
-
const yankRange = (0,
|
|
39125
|
+
const yankRange = (0, import_react136.useCallback)(
|
|
38906
39126
|
(startRow, startCol, endRow, endCol, linewise) => {
|
|
38907
39127
|
const lines = bufferRef.current.lines;
|
|
38908
39128
|
let text = "";
|
|
@@ -38917,7 +39137,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38917
39137
|
},
|
|
38918
39138
|
[]
|
|
38919
39139
|
);
|
|
38920
|
-
const executeCommand = (0,
|
|
39140
|
+
const executeCommand = (0, import_react136.useCallback)(
|
|
38921
39141
|
(cmdType, count) => {
|
|
38922
39142
|
switch (cmdType) {
|
|
38923
39143
|
case CMD_TYPES.DELETE_WORD_FORWARD:
|
|
@@ -39318,7 +39538,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39318
39538
|
return { text, linewise: movement === "j" || movement === "k" };
|
|
39319
39539
|
}
|
|
39320
39540
|
__name(extractMovementText, "extractMovementText");
|
|
39321
|
-
const executeFind = (0,
|
|
39541
|
+
const executeFind = (0, import_react136.useCallback)(
|
|
39322
39542
|
(findType, char, count = 1) => {
|
|
39323
39543
|
const [startRow, startCol] = buffer.cursor;
|
|
39324
39544
|
const line = buffer.lines[startRow] ?? "";
|
|
@@ -39354,7 +39574,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39354
39574
|
},
|
|
39355
39575
|
[buffer, dispatch]
|
|
39356
39576
|
);
|
|
39357
|
-
const handleCharRead = (0,
|
|
39577
|
+
const handleCharRead = (0, import_react136.useCallback)(
|
|
39358
39578
|
(char) => {
|
|
39359
39579
|
const readType = state.pendingCharRead;
|
|
39360
39580
|
if (!readType) return false;
|
|
@@ -39397,7 +39617,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39397
39617
|
},
|
|
39398
39618
|
[state.pendingCharRead, buffer, dispatch, executeFind]
|
|
39399
39619
|
);
|
|
39400
|
-
const handleInsertModeInput = (0,
|
|
39620
|
+
const handleInsertModeInput = (0, import_react136.useCallback)(
|
|
39401
39621
|
(normalizedKey) => {
|
|
39402
39622
|
if (normalizedKey.name === "escape") {
|
|
39403
39623
|
buffer.vimEscapeInsertMode();
|
|
@@ -39428,7 +39648,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39428
39648
|
},
|
|
39429
39649
|
[buffer, dispatch, updateMode, onSubmit]
|
|
39430
39650
|
);
|
|
39431
|
-
const normalizeKey = (0,
|
|
39651
|
+
const normalizeKey = (0, import_react136.useCallback)(
|
|
39432
39652
|
(key) => ({
|
|
39433
39653
|
name: key.name || "",
|
|
39434
39654
|
sequence: key.sequence || "",
|
|
@@ -39439,7 +39659,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39439
39659
|
}),
|
|
39440
39660
|
[]
|
|
39441
39661
|
);
|
|
39442
|
-
const handleChangeMovement = (0,
|
|
39662
|
+
const handleChangeMovement = (0, import_react136.useCallback)(
|
|
39443
39663
|
(movement) => {
|
|
39444
39664
|
const count = getCurrentCount();
|
|
39445
39665
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -39460,7 +39680,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39460
39680
|
},
|
|
39461
39681
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
39462
39682
|
);
|
|
39463
|
-
const handleDeleteMovement = (0,
|
|
39683
|
+
const handleDeleteMovement = (0, import_react136.useCallback)(
|
|
39464
39684
|
(movement) => {
|
|
39465
39685
|
const count = getCurrentCount();
|
|
39466
39686
|
const [row, col] = bufferRef.current.cursor;
|
|
@@ -39495,7 +39715,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39495
39715
|
},
|
|
39496
39716
|
[getCurrentCount, dispatch, buffer]
|
|
39497
39717
|
);
|
|
39498
|
-
const handleYankMovement = (0,
|
|
39718
|
+
const handleYankMovement = (0, import_react136.useCallback)(
|
|
39499
39719
|
(movement) => {
|
|
39500
39720
|
const count = getCurrentCount();
|
|
39501
39721
|
const [row, col] = bufferRef.current.cursor;
|
|
@@ -39529,7 +39749,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39529
39749
|
},
|
|
39530
39750
|
[getCurrentCount, dispatch]
|
|
39531
39751
|
);
|
|
39532
|
-
const handleOperatorMotion = (0,
|
|
39752
|
+
const handleOperatorMotion = (0, import_react136.useCallback)(
|
|
39533
39753
|
(operator, motion) => {
|
|
39534
39754
|
const count = getCurrentCount();
|
|
39535
39755
|
const commandMap = {
|
|
@@ -39561,7 +39781,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39561
39781
|
},
|
|
39562
39782
|
[getCurrentCount, executeCommand, dispatch]
|
|
39563
39783
|
);
|
|
39564
|
-
const handleInput = (0,
|
|
39784
|
+
const handleInput = (0, import_react136.useCallback)(
|
|
39565
39785
|
(key) => {
|
|
39566
39786
|
if (!vimEnabled) {
|
|
39567
39787
|
return false;
|
|
@@ -40283,7 +40503,7 @@ __name(buildWorkflowSteeringNotice, "buildWorkflowSteeringNotice");
|
|
|
40283
40503
|
|
|
40284
40504
|
// packages/cli/src/ui/hooks/useAwaySummary.ts
|
|
40285
40505
|
init_esbuild_shims();
|
|
40286
|
-
var
|
|
40506
|
+
var import_react137 = __toESM(require_react(), 1);
|
|
40287
40507
|
var DEFAULT_AWAY_THRESHOLD_MINUTES = 5;
|
|
40288
40508
|
var MIN_USER_MESSAGES_TO_FIRE = 3;
|
|
40289
40509
|
var MIN_USER_MESSAGES_SINCE_LAST_RECAP = 2;
|
|
@@ -40315,15 +40535,15 @@ function useAwaySummary(options) {
|
|
|
40315
40535
|
history,
|
|
40316
40536
|
awayThresholdMinutes
|
|
40317
40537
|
} = options;
|
|
40318
|
-
const blurredAtRef = (0,
|
|
40319
|
-
const recapPendingRef = (0,
|
|
40320
|
-
const inFlightRef = (0,
|
|
40321
|
-
const isIdleRef = (0,
|
|
40538
|
+
const blurredAtRef = (0, import_react137.useRef)(null);
|
|
40539
|
+
const recapPendingRef = (0, import_react137.useRef)(false);
|
|
40540
|
+
const inFlightRef = (0, import_react137.useRef)(null);
|
|
40541
|
+
const isIdleRef = (0, import_react137.useRef)(isIdle);
|
|
40322
40542
|
isIdleRef.current = isIdle;
|
|
40323
|
-
const historyRef = (0,
|
|
40543
|
+
const historyRef = (0, import_react137.useRef)(history);
|
|
40324
40544
|
historyRef.current = history;
|
|
40325
40545
|
const thresholdMs = (awayThresholdMinutes && awayThresholdMinutes > 0 ? awayThresholdMinutes : DEFAULT_AWAY_THRESHOLD_MINUTES) * 60 * 1e3;
|
|
40326
|
-
(0,
|
|
40546
|
+
(0, import_react137.useEffect)(() => {
|
|
40327
40547
|
if (!enabled || !config) {
|
|
40328
40548
|
inFlightRef.current?.abort();
|
|
40329
40549
|
inFlightRef.current = null;
|
|
@@ -40375,7 +40595,7 @@ function useAwaySummary(options) {
|
|
|
40375
40595
|
recapPendingRef.current = false;
|
|
40376
40596
|
});
|
|
40377
40597
|
}, [enabled, config, isFocused, isIdle, addItem, thresholdMs]);
|
|
40378
|
-
(0,
|
|
40598
|
+
(0, import_react137.useEffect)(
|
|
40379
40599
|
() => () => {
|
|
40380
40600
|
inFlightRef.current?.abort();
|
|
40381
40601
|
},
|
|
@@ -40386,14 +40606,14 @@ __name(useAwaySummary, "useAwaySummary");
|
|
|
40386
40606
|
|
|
40387
40607
|
// packages/cli/src/ui/hooks/useBracketedPaste.ts
|
|
40388
40608
|
init_esbuild_shims();
|
|
40389
|
-
var
|
|
40609
|
+
var import_react138 = __toESM(require_react(), 1);
|
|
40390
40610
|
var ENABLE_BRACKETED_PASTE = "\x1B[?2004h";
|
|
40391
40611
|
var DISABLE_BRACKETED_PASTE = "\x1B[?2004l";
|
|
40392
40612
|
var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
40393
40613
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
40394
40614
|
process.stdout.write(DISABLE_BRACKETED_PASTE);
|
|
40395
40615
|
}, "cleanup");
|
|
40396
|
-
(0,
|
|
40616
|
+
(0, import_react138.useEffect)(() => {
|
|
40397
40617
|
process.stdout.write(ENABLE_BRACKETED_PASTE);
|
|
40398
40618
|
process.on("exit", cleanup);
|
|
40399
40619
|
process.on("SIGINT", cleanup);
|
|
@@ -40412,23 +40632,23 @@ init_esbuild_shims();
|
|
|
40412
40632
|
|
|
40413
40633
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
40414
40634
|
init_esbuild_shims();
|
|
40415
|
-
var
|
|
40635
|
+
var import_react139 = __toESM(require_react(), 1);
|
|
40416
40636
|
var WITTY_LOADING_PHRASES = ["I'm Feeling Lucky"];
|
|
40417
40637
|
var PHRASE_CHANGE_INTERVAL_MS = 15e3;
|
|
40418
40638
|
var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases) => {
|
|
40419
40639
|
const currentLanguage = getCurrentLanguage();
|
|
40420
|
-
const loadingPhrases = (0,
|
|
40640
|
+
const loadingPhrases = (0, import_react139.useMemo)(() => {
|
|
40421
40641
|
if (customPhrases && customPhrases.length > 0) {
|
|
40422
40642
|
return customPhrases;
|
|
40423
40643
|
}
|
|
40424
40644
|
const translatedPhrases = ta("WITTY_LOADING_PHRASES");
|
|
40425
40645
|
return translatedPhrases.length > 0 ? translatedPhrases : WITTY_LOADING_PHRASES;
|
|
40426
40646
|
}, [customPhrases, currentLanguage]);
|
|
40427
|
-
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0,
|
|
40647
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0, import_react139.useState)(
|
|
40428
40648
|
loadingPhrases[0]
|
|
40429
40649
|
);
|
|
40430
|
-
const phraseIntervalRef = (0,
|
|
40431
|
-
(0,
|
|
40650
|
+
const phraseIntervalRef = (0, import_react139.useRef)(null);
|
|
40651
|
+
(0, import_react139.useEffect)(() => {
|
|
40432
40652
|
if (isWaiting) {
|
|
40433
40653
|
setCurrentLoadingPhrase(t("Waiting for user confirmation..."));
|
|
40434
40654
|
if (phraseIntervalRef.current) {
|
|
@@ -40465,9 +40685,9 @@ var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases
|
|
|
40465
40685
|
}, "usePhraseCycler");
|
|
40466
40686
|
|
|
40467
40687
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
40468
|
-
var
|
|
40688
|
+
var import_react140 = __toESM(require_react(), 1);
|
|
40469
40689
|
var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhrases, currentCandidatesTokens, currentStreamingChars, isToolExecuting2 = false) => {
|
|
40470
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
40690
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react140.useState)(0);
|
|
40471
40691
|
const isTimerActive = streamingState === "responding" /* Responding */;
|
|
40472
40692
|
const elapsedTimeFromTimer = useTimer(
|
|
40473
40693
|
isTimerActive,
|
|
@@ -40481,17 +40701,17 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
40481
40701
|
isWaiting,
|
|
40482
40702
|
customWittyPhrases
|
|
40483
40703
|
);
|
|
40484
|
-
const [retainedElapsedTime, setRetainedElapsedTime] = (0,
|
|
40485
|
-
const [taskStartTokens, setTaskStartTokensState] = (0,
|
|
40486
|
-
const [taskStartStreamingChars, setTaskStartStreamingCharsState] = (0,
|
|
40487
|
-
const taskStartTokensRef = (0,
|
|
40488
|
-
const taskStartStreamingCharsRef = (0,
|
|
40489
|
-
const pauseStartTokensRef = (0,
|
|
40490
|
-
const pauseStartStreamingCharsRef = (0,
|
|
40491
|
-
const pauseBaseTaskStartTokensRef = (0,
|
|
40492
|
-
const pauseBaseTaskStartStreamingCharsRef = (0,
|
|
40493
|
-
const prevStreamingStateRef = (0,
|
|
40494
|
-
(0,
|
|
40704
|
+
const [retainedElapsedTime, setRetainedElapsedTime] = (0, import_react140.useState)(0);
|
|
40705
|
+
const [taskStartTokens, setTaskStartTokensState] = (0, import_react140.useState)(0);
|
|
40706
|
+
const [taskStartStreamingChars, setTaskStartStreamingCharsState] = (0, import_react140.useState)(0);
|
|
40707
|
+
const taskStartTokensRef = (0, import_react140.useRef)(0);
|
|
40708
|
+
const taskStartStreamingCharsRef = (0, import_react140.useRef)(0);
|
|
40709
|
+
const pauseStartTokensRef = (0, import_react140.useRef)(null);
|
|
40710
|
+
const pauseStartStreamingCharsRef = (0, import_react140.useRef)(null);
|
|
40711
|
+
const pauseBaseTaskStartTokensRef = (0, import_react140.useRef)(0);
|
|
40712
|
+
const pauseBaseTaskStartStreamingCharsRef = (0, import_react140.useRef)(0);
|
|
40713
|
+
const prevStreamingStateRef = (0, import_react140.useRef)(null);
|
|
40714
|
+
(0, import_react140.useEffect)(() => {
|
|
40495
40715
|
const currentTokens = currentCandidatesTokens ?? 0;
|
|
40496
40716
|
const currentChars = currentStreamingChars ?? 0;
|
|
40497
40717
|
const setTaskStartTokens = /* @__PURE__ */ __name((tokens) => {
|
|
@@ -40562,7 +40782,7 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
40562
40782
|
|
|
40563
40783
|
// packages/cli/src/ui/hooks/useTerminalProgress.ts
|
|
40564
40784
|
init_esbuild_shims();
|
|
40565
|
-
var
|
|
40785
|
+
var import_react141 = __toESM(require_react(), 1);
|
|
40566
40786
|
var PROGRESS_CLEAR = wrapForMultiplexer(`${OSC_PREFIX}9;4;0;${BEL}`);
|
|
40567
40787
|
var PROGRESS_INDETERMINATE = wrapForMultiplexer(`${OSC_PREFIX}9;4;3;;${BEL}`);
|
|
40568
40788
|
function isProgressBarSupported() {
|
|
@@ -40577,13 +40797,13 @@ function isProgressBarSupported() {
|
|
|
40577
40797
|
__name(isProgressBarSupported, "isProgressBarSupported");
|
|
40578
40798
|
function useTerminalProgress(streamingState, hasToolExecuting) {
|
|
40579
40799
|
const { stdout } = use_stdout_default();
|
|
40580
|
-
const writeProgress = (0,
|
|
40800
|
+
const writeProgress = (0, import_react141.useCallback)(
|
|
40581
40801
|
(seq) => {
|
|
40582
40802
|
stdout?.write(seq);
|
|
40583
40803
|
},
|
|
40584
40804
|
[stdout]
|
|
40585
40805
|
);
|
|
40586
|
-
(0,
|
|
40806
|
+
(0, import_react141.useEffect)(() => {
|
|
40587
40807
|
if (!isProgressBarSupported()) return;
|
|
40588
40808
|
if (streamingState === "responding" /* Responding */ && hasToolExecuting) {
|
|
40589
40809
|
writeProgress(PROGRESS_INDETERMINATE);
|
|
@@ -40594,7 +40814,7 @@ function useTerminalProgress(streamingState, hasToolExecuting) {
|
|
|
40594
40814
|
writeProgress(PROGRESS_CLEAR);
|
|
40595
40815
|
};
|
|
40596
40816
|
}, [streamingState, hasToolExecuting, writeProgress]);
|
|
40597
|
-
(0,
|
|
40817
|
+
(0, import_react141.useEffect)(() => {
|
|
40598
40818
|
if (!isProgressBarSupported()) return;
|
|
40599
40819
|
const clearOnExit = /* @__PURE__ */ __name(() => {
|
|
40600
40820
|
stdout?.write(PROGRESS_CLEAR);
|
|
@@ -40609,23 +40829,23 @@ __name(useTerminalProgress, "useTerminalProgress");
|
|
|
40609
40829
|
|
|
40610
40830
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
40611
40831
|
init_esbuild_shims();
|
|
40612
|
-
var
|
|
40613
|
-
import * as
|
|
40832
|
+
var import_react142 = __toESM(require_react(), 1);
|
|
40833
|
+
import * as process16 from "node:process";
|
|
40614
40834
|
var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
40615
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
40616
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
40617
|
-
const [isRestarting, setIsRestarting] = (0,
|
|
40835
|
+
const [isTrusted, setIsTrusted] = (0, import_react142.useState)(void 0);
|
|
40836
|
+
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0, import_react142.useState)(false);
|
|
40837
|
+
const [isRestarting, setIsRestarting] = (0, import_react142.useState)(false);
|
|
40618
40838
|
const folderTrust = settings.merged.security?.folderTrust?.enabled;
|
|
40619
|
-
(0,
|
|
40839
|
+
(0, import_react142.useEffect)(() => {
|
|
40620
40840
|
const { isTrusted: trusted } = isWorkspaceTrusted(settings.merged);
|
|
40621
40841
|
setIsTrusted(trusted);
|
|
40622
40842
|
setIsFolderTrustDialogOpen(trusted === void 0);
|
|
40623
40843
|
onTrustChange(trusted);
|
|
40624
40844
|
}, [folderTrust, onTrustChange, settings.merged]);
|
|
40625
|
-
const handleFolderTrustSelect = (0,
|
|
40845
|
+
const handleFolderTrustSelect = (0, import_react142.useCallback)(
|
|
40626
40846
|
(choice) => {
|
|
40627
40847
|
const trustedFolders = loadTrustedFolders();
|
|
40628
|
-
const cwd3 =
|
|
40848
|
+
const cwd3 = process16.cwd();
|
|
40629
40849
|
let trustLevel;
|
|
40630
40850
|
const wasTrusted = isTrusted ?? true;
|
|
40631
40851
|
switch (choice) {
|
|
@@ -40641,7 +40861,15 @@ var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
|
40641
40861
|
default:
|
|
40642
40862
|
return;
|
|
40643
40863
|
}
|
|
40644
|
-
|
|
40864
|
+
try {
|
|
40865
|
+
trustedFolders.setValue(cwd3, trustLevel);
|
|
40866
|
+
} catch (error) {
|
|
40867
|
+
writeStderrLineSafe("Error saving trusted folders file.");
|
|
40868
|
+
writeStderrLineSafe(
|
|
40869
|
+
error instanceof Error ? error.message : String(error)
|
|
40870
|
+
);
|
|
40871
|
+
return;
|
|
40872
|
+
}
|
|
40645
40873
|
const currentIsTrusted = trustLevel === "TRUST_FOLDER" /* TRUST_FOLDER */ || trustLevel === "TRUST_PARENT" /* TRUST_PARENT */;
|
|
40646
40874
|
setIsTrusted(currentIsTrusted);
|
|
40647
40875
|
onTrustChange(currentIsTrusted);
|
|
@@ -40665,7 +40893,7 @@ var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
|
40665
40893
|
|
|
40666
40894
|
// packages/cli/src/ui/hooks/useMcpApproval.ts
|
|
40667
40895
|
init_esbuild_shims();
|
|
40668
|
-
var
|
|
40896
|
+
var import_react143 = __toESM(require_react(), 1);
|
|
40669
40897
|
function sourceLabel(scope) {
|
|
40670
40898
|
switch (scope) {
|
|
40671
40899
|
case "workspace":
|
|
@@ -40701,8 +40929,8 @@ function summarize(config) {
|
|
|
40701
40929
|
}
|
|
40702
40930
|
__name(summarize, "summarize");
|
|
40703
40931
|
var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
40704
|
-
const [queue, setQueue] = (0,
|
|
40705
|
-
const computePending = (0,
|
|
40932
|
+
const [queue, setQueue] = (0, import_react143.useState)([]);
|
|
40933
|
+
const computePending = (0, import_react143.useCallback)(() => {
|
|
40706
40934
|
if (config.getApprovalMode() === "yolo" /* YOLO */) return [];
|
|
40707
40935
|
const servers = config.getMcpServers() ?? {};
|
|
40708
40936
|
const approvals = loadMcpApprovals();
|
|
@@ -40714,10 +40942,10 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40714
40942
|
source: sourceLabel(c.scope)
|
|
40715
40943
|
}));
|
|
40716
40944
|
}, [config]);
|
|
40717
|
-
(0,
|
|
40945
|
+
(0, import_react143.useEffect)(() => {
|
|
40718
40946
|
setQueue(computePending());
|
|
40719
40947
|
}, [computePending]);
|
|
40720
|
-
(0,
|
|
40948
|
+
(0, import_react143.useEffect)(() => {
|
|
40721
40949
|
const onPendingChanged = /* @__PURE__ */ __name(() => {
|
|
40722
40950
|
setQueue(computePending());
|
|
40723
40951
|
}, "onPendingChanged");
|
|
@@ -40726,7 +40954,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40726
40954
|
appEvents.off("mcp-pending-approval-changed" /* McpPendingApprovalChanged */, onPendingChanged);
|
|
40727
40955
|
};
|
|
40728
40956
|
}, [computePending]);
|
|
40729
|
-
const reconnect = (0,
|
|
40957
|
+
const reconnect = (0, import_react143.useCallback)(
|
|
40730
40958
|
(name) => {
|
|
40731
40959
|
config.approveMcpServerForSession(name);
|
|
40732
40960
|
const registry = config.getToolRegistry();
|
|
@@ -40738,7 +40966,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40738
40966
|
},
|
|
40739
40967
|
[config]
|
|
40740
40968
|
);
|
|
40741
|
-
const handleMcpApprovalSelect = (0,
|
|
40969
|
+
const handleMcpApprovalSelect = (0, import_react143.useCallback)(
|
|
40742
40970
|
async (choice) => {
|
|
40743
40971
|
const approvals = loadMcpApprovals();
|
|
40744
40972
|
const root = config.getWorkingDir();
|
|
@@ -40790,7 +41018,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40790
41018
|
|
|
40791
41019
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
40792
41020
|
init_esbuild_shims();
|
|
40793
|
-
var
|
|
41021
|
+
var import_react144 = __toESM(require_react(), 1);
|
|
40794
41022
|
|
|
40795
41023
|
// packages/cli/src/services/command-migration-tool.ts
|
|
40796
41024
|
init_esbuild_shims();
|
|
@@ -40861,9 +41089,9 @@ __name(migrateTomlCommands, "migrateTomlCommands");
|
|
|
40861
41089
|
|
|
40862
41090
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
40863
41091
|
function useCommandMigration(settings, storage) {
|
|
40864
|
-
const [showMigrationNudge, setShowMigrationNudge] = (0,
|
|
40865
|
-
const [tomlFiles, setTomlFiles] = (0,
|
|
40866
|
-
(0,
|
|
41092
|
+
const [showMigrationNudge, setShowMigrationNudge] = (0, import_react144.useState)(false);
|
|
41093
|
+
const [tomlFiles, setTomlFiles] = (0, import_react144.useState)([]);
|
|
41094
|
+
(0, import_react144.useEffect)(() => {
|
|
40867
41095
|
let cancelled = false;
|
|
40868
41096
|
const checkTomlCommands = /* @__PURE__ */ __name(async () => {
|
|
40869
41097
|
const allFiles = [];
|
|
@@ -40931,15 +41159,23 @@ __name(sendNotification, "sendNotification");
|
|
|
40931
41159
|
|
|
40932
41160
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
40933
41161
|
init_esbuild_shims();
|
|
40934
|
-
var
|
|
41162
|
+
var import_react145 = __toESM(require_react(), 1);
|
|
41163
|
+
var BRANCH_POLL_INTERVAL_MS = 5e3;
|
|
40935
41164
|
function useGitBranchName(cwd3) {
|
|
40936
|
-
const [branchName, setBranchName] = (0,
|
|
40937
|
-
(0,
|
|
41165
|
+
const [branchName, setBranchName] = (0, import_react145.useState)(void 0);
|
|
41166
|
+
const branchNameRef = (0, import_react145.useRef)(branchName);
|
|
41167
|
+
branchNameRef.current = branchName;
|
|
41168
|
+
(0, import_react145.useEffect)(() => {
|
|
40938
41169
|
let cancelled = false;
|
|
40939
41170
|
let dispose;
|
|
41171
|
+
let pollTimer;
|
|
41172
|
+
let refreshGeneration = 0;
|
|
40940
41173
|
const refresh = /* @__PURE__ */ __name(async () => {
|
|
41174
|
+
const generation = ++refreshGeneration;
|
|
40941
41175
|
const name = await resolveBranchName(cwd3);
|
|
40942
|
-
if (!cancelled
|
|
41176
|
+
if (!cancelled && generation === refreshGeneration && name !== branchNameRef.current) {
|
|
41177
|
+
setBranchName(name);
|
|
41178
|
+
}
|
|
40943
41179
|
}, "refresh");
|
|
40944
41180
|
const init = /* @__PURE__ */ __name(async () => {
|
|
40945
41181
|
await refresh();
|
|
@@ -40953,12 +41189,20 @@ function useGitBranchName(cwd3) {
|
|
|
40953
41189
|
} else {
|
|
40954
41190
|
dispose = disposer;
|
|
40955
41191
|
}
|
|
41192
|
+
if (!cancelled) {
|
|
41193
|
+
pollTimer = setInterval(() => {
|
|
41194
|
+
void refresh().catch(() => {
|
|
41195
|
+
});
|
|
41196
|
+
}, BRANCH_POLL_INTERVAL_MS);
|
|
41197
|
+
pollTimer.unref?.();
|
|
41198
|
+
}
|
|
40956
41199
|
}, "init");
|
|
40957
41200
|
void init().catch(() => {
|
|
40958
41201
|
});
|
|
40959
41202
|
return () => {
|
|
40960
41203
|
cancelled = true;
|
|
40961
41204
|
dispose?.();
|
|
41205
|
+
if (pollTimer) clearInterval(pollTimer);
|
|
40962
41206
|
};
|
|
40963
41207
|
}, [cwd3]);
|
|
40964
41208
|
return branchName;
|
|
@@ -40967,13 +41211,13 @@ __name(useGitBranchName, "useGitBranchName");
|
|
|
40967
41211
|
|
|
40968
41212
|
// packages/cli/src/ui/hooks/useWorktreeSession.ts
|
|
40969
41213
|
init_esbuild_shims();
|
|
40970
|
-
var
|
|
41214
|
+
var import_react146 = __toESM(require_react(), 1);
|
|
40971
41215
|
import fs19 from "node:fs";
|
|
40972
41216
|
import fsPromises from "node:fs/promises";
|
|
40973
41217
|
import path14 from "node:path";
|
|
40974
41218
|
function useWorktreeSession(config) {
|
|
40975
|
-
const [session, setSession] = (0,
|
|
40976
|
-
(0,
|
|
41219
|
+
const [session, setSession] = (0, import_react146.useState)(null);
|
|
41220
|
+
(0, import_react146.useEffect)(() => {
|
|
40977
41221
|
let cancelled = false;
|
|
40978
41222
|
const safeLoad = /* @__PURE__ */ __name(async () => {
|
|
40979
41223
|
try {
|
|
@@ -41013,7 +41257,7 @@ __name(useWorktreeSession, "useWorktreeSession");
|
|
|
41013
41257
|
|
|
41014
41258
|
// packages/cli/src/ui/hooks/useExtensionUpdates.ts
|
|
41015
41259
|
init_esbuild_shims();
|
|
41016
|
-
var
|
|
41260
|
+
var import_react147 = __toESM(require_react(), 1);
|
|
41017
41261
|
function confirmationRequestsReducer(state, action) {
|
|
41018
41262
|
switch (action.type) {
|
|
41019
41263
|
case "add":
|
|
@@ -41030,8 +41274,8 @@ var useConfirmUpdateRequests = /* @__PURE__ */ __name(() => {
|
|
|
41030
41274
|
const [
|
|
41031
41275
|
confirmUpdateExtensionRequests,
|
|
41032
41276
|
dispatchConfirmUpdateExtensionRequests
|
|
41033
|
-
] = (0,
|
|
41034
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
41277
|
+
] = (0, import_react147.useReducer)(confirmationRequestsReducer, []);
|
|
41278
|
+
const addConfirmUpdateExtensionRequest = (0, import_react147.useCallback)(
|
|
41035
41279
|
(original) => {
|
|
41036
41280
|
const wrappedRequest = {
|
|
41037
41281
|
prompt: original.prompt,
|
|
@@ -41069,11 +41313,11 @@ function settingInputRequestsReducer(state, action) {
|
|
|
41069
41313
|
}
|
|
41070
41314
|
__name(settingInputRequestsReducer, "settingInputRequestsReducer");
|
|
41071
41315
|
var useSettingInputRequests = /* @__PURE__ */ __name(() => {
|
|
41072
|
-
const [settingInputRequests, dispatchSettingInputRequests] = (0,
|
|
41316
|
+
const [settingInputRequests, dispatchSettingInputRequests] = (0, import_react147.useReducer)(
|
|
41073
41317
|
settingInputRequestsReducer,
|
|
41074
41318
|
[]
|
|
41075
41319
|
);
|
|
41076
|
-
const addSettingInputRequest = (0,
|
|
41320
|
+
const addSettingInputRequest = (0, import_react147.useCallback)(
|
|
41077
41321
|
(original) => {
|
|
41078
41322
|
const wrappedRequest = {
|
|
41079
41323
|
settingName: original.settingName,
|
|
@@ -41120,11 +41364,11 @@ function pluginChoiceRequestsReducer(state, action) {
|
|
|
41120
41364
|
}
|
|
41121
41365
|
__name(pluginChoiceRequestsReducer, "pluginChoiceRequestsReducer");
|
|
41122
41366
|
var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
41123
|
-
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0,
|
|
41367
|
+
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0, import_react147.useReducer)(
|
|
41124
41368
|
pluginChoiceRequestsReducer,
|
|
41125
41369
|
[]
|
|
41126
41370
|
);
|
|
41127
|
-
const addPluginChoiceRequest = (0,
|
|
41371
|
+
const addPluginChoiceRequest = (0, import_react147.useCallback)(
|
|
41128
41372
|
(original) => {
|
|
41129
41373
|
const wrappedRequest = {
|
|
41130
41374
|
marketplaceName: original.marketplaceName,
|
|
@@ -41158,12 +41402,12 @@ var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
|
41158
41402
|
};
|
|
41159
41403
|
}, "usePluginChoiceRequests");
|
|
41160
41404
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd3) => {
|
|
41161
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
41405
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react147.useReducer)(
|
|
41162
41406
|
extensionUpdatesReducer,
|
|
41163
41407
|
initialExtensionUpdatesState
|
|
41164
41408
|
);
|
|
41165
41409
|
const extensions = extensionManager.getLoadedExtensions();
|
|
41166
|
-
(0,
|
|
41410
|
+
(0, import_react147.useEffect)(() => {
|
|
41167
41411
|
(async () => {
|
|
41168
41412
|
const extensionsToCheck = extensions.filter((extension) => {
|
|
41169
41413
|
const currentStatus = extensionsUpdateState.extensionStatuses.get(
|
|
@@ -41191,7 +41435,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
41191
41435
|
extensionsUpdateState.extensionStatuses,
|
|
41192
41436
|
dispatchExtensionStateUpdate
|
|
41193
41437
|
]);
|
|
41194
|
-
(0,
|
|
41438
|
+
(0, import_react147.useEffect)(() => {
|
|
41195
41439
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
41196
41440
|
return;
|
|
41197
41441
|
}
|
|
@@ -41260,7 +41504,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
41260
41504
|
);
|
|
41261
41505
|
}
|
|
41262
41506
|
}, [extensions, extensionManager, extensionsUpdateState, addItem, cwd3]);
|
|
41263
|
-
const extensionsUpdateStateComputed = (0,
|
|
41507
|
+
const extensionsUpdateStateComputed = (0, import_react147.useMemo)(() => {
|
|
41264
41508
|
const result = /* @__PURE__ */ new Map();
|
|
41265
41509
|
for (const [
|
|
41266
41510
|
key,
|
|
@@ -41279,11 +41523,11 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
41279
41523
|
|
|
41280
41524
|
// packages/cli/src/ui/components/TranscriptView.tsx
|
|
41281
41525
|
init_esbuild_shims();
|
|
41282
|
-
var
|
|
41526
|
+
var import_react150 = __toESM(require_react(), 1);
|
|
41283
41527
|
|
|
41284
41528
|
// packages/cli/src/ui/components/AlternateScreen.tsx
|
|
41285
41529
|
init_esbuild_shims();
|
|
41286
|
-
var
|
|
41530
|
+
var import_react148 = __toESM(require_react(), 1);
|
|
41287
41531
|
var import_jsx_runtime132 = __toESM(require_jsx_runtime(), 1);
|
|
41288
41532
|
var ENTER_ALT_SCREEN = "\x1B[?1049h";
|
|
41289
41533
|
var EXIT_ALT_SCREEN = "\x1B[?1049l";
|
|
@@ -41296,7 +41540,7 @@ var AlternateScreen = /* @__PURE__ */ __name(({
|
|
|
41296
41540
|
}) => {
|
|
41297
41541
|
const writeRaw = useTerminalOutput();
|
|
41298
41542
|
const { rows } = useTerminalSize();
|
|
41299
|
-
(0,
|
|
41543
|
+
(0, import_react148.useEffect)(() => {
|
|
41300
41544
|
if (disabled || !process.stdout.isTTY) return;
|
|
41301
41545
|
const safeWrite = /* @__PURE__ */ __name((data) => {
|
|
41302
41546
|
try {
|
|
@@ -41317,7 +41561,7 @@ var AlternateScreen = /* @__PURE__ */ __name(({
|
|
|
41317
41561
|
|
|
41318
41562
|
// packages/cli/src/ui/components/shared/ErrorBoundary.tsx
|
|
41319
41563
|
init_esbuild_shims();
|
|
41320
|
-
var
|
|
41564
|
+
var import_react149 = __toESM(require_react(), 1);
|
|
41321
41565
|
var import_jsx_runtime133 = __toESM(require_jsx_runtime(), 1);
|
|
41322
41566
|
function normalizeError(error) {
|
|
41323
41567
|
if (error instanceof Error) {
|
|
@@ -41326,7 +41570,7 @@ function normalizeError(error) {
|
|
|
41326
41570
|
return new Error(String(error));
|
|
41327
41571
|
}
|
|
41328
41572
|
__name(normalizeError, "normalizeError");
|
|
41329
|
-
var ErrorBoundary = class extends
|
|
41573
|
+
var ErrorBoundary = class extends import_react149.Component {
|
|
41330
41574
|
static {
|
|
41331
41575
|
__name(this, "ErrorBoundary");
|
|
41332
41576
|
}
|
|
@@ -41385,11 +41629,11 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
41385
41629
|
const headerHeight = 1;
|
|
41386
41630
|
const footerHeight = 1;
|
|
41387
41631
|
const contentHeight = Math.max(rows - headerHeight - footerHeight, 1);
|
|
41388
|
-
const estimatedItemHeight = (0,
|
|
41632
|
+
const estimatedItemHeight = (0, import_react150.useCallback)(
|
|
41389
41633
|
(index) => estimateTranscriptItemHeight(items[index]),
|
|
41390
41634
|
[items]
|
|
41391
41635
|
);
|
|
41392
|
-
const renderItem = (0,
|
|
41636
|
+
const renderItem = (0, import_react150.useCallback)(
|
|
41393
41637
|
({ item }) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
41394
41638
|
HistoryItemDisplay,
|
|
41395
41639
|
{
|
|
@@ -41402,7 +41646,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
41402
41646
|
[columns]
|
|
41403
41647
|
);
|
|
41404
41648
|
const title = t("Transcript");
|
|
41405
|
-
const content = (0,
|
|
41649
|
+
const content = (0, import_react150.useMemo)(
|
|
41406
41650
|
() => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(OverflowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
41407
41651
|
ScrollableListWithForwardRef,
|
|
41408
41652
|
{
|
|
@@ -41417,7 +41661,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
41417
41661
|
) }),
|
|
41418
41662
|
[items, renderItem, estimatedItemHeight, contentHeight]
|
|
41419
41663
|
);
|
|
41420
|
-
const errorFallback = (0,
|
|
41664
|
+
const errorFallback = (0, import_react150.useCallback)(
|
|
41421
41665
|
(error) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [
|
|
41422
41666
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text, { color: theme.status.error, bold: true, children: t("Failed to render transcript.") }),
|
|
41423
41667
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text, { color: theme.text.secondary, children: sanitizeTerminalText(error.message) }),
|
|
@@ -41428,7 +41672,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
41428
41672
|
] }),
|
|
41429
41673
|
[]
|
|
41430
41674
|
);
|
|
41431
|
-
const onRenderError = (0,
|
|
41675
|
+
const onRenderError = (0, import_react150.useCallback)((error, info) => {
|
|
41432
41676
|
debugLogger39.error(
|
|
41433
41677
|
`render error: ${error.message}`,
|
|
41434
41678
|
info.componentStack ?? ""
|
|
@@ -41452,19 +41696,19 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
41452
41696
|
] }) })
|
|
41453
41697
|
] }) });
|
|
41454
41698
|
}, "TranscriptViewImpl");
|
|
41455
|
-
var TranscriptView = (0,
|
|
41699
|
+
var TranscriptView = (0, import_react150.memo)(TranscriptViewImpl);
|
|
41456
41700
|
TranscriptView.displayName = "TranscriptView";
|
|
41457
41701
|
|
|
41458
41702
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
41459
41703
|
init_esbuild_shims();
|
|
41460
|
-
var
|
|
41704
|
+
var import_react151 = __toESM(require_react(), 1);
|
|
41461
41705
|
function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
41462
|
-
const [welcomeBackInfo, setWelcomeBackInfo] = (0,
|
|
41463
|
-
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0,
|
|
41464
|
-
const [welcomeBackChoice, setWelcomeBackChoice] = (0,
|
|
41465
|
-
const [shouldFillInput, setShouldFillInput] = (0,
|
|
41466
|
-
const [inputFillText, setInputFillText] = (0,
|
|
41467
|
-
const checkWelcomeBack = (0,
|
|
41706
|
+
const [welcomeBackInfo, setWelcomeBackInfo] = (0, import_react151.useState)(null);
|
|
41707
|
+
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0, import_react151.useState)(false);
|
|
41708
|
+
const [welcomeBackChoice, setWelcomeBackChoice] = (0, import_react151.useState)(null);
|
|
41709
|
+
const [shouldFillInput, setShouldFillInput] = (0, import_react151.useState)(false);
|
|
41710
|
+
const [inputFillText, setInputFillText] = (0, import_react151.useState)(null);
|
|
41711
|
+
const checkWelcomeBack = (0, import_react151.useCallback)(async () => {
|
|
41468
41712
|
if (settings.ui?.enableWelcomeBack === false) {
|
|
41469
41713
|
return;
|
|
41470
41714
|
}
|
|
@@ -41483,7 +41727,7 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
41483
41727
|
config.getDebugLogger().debug("Welcome back check failed:", error);
|
|
41484
41728
|
}
|
|
41485
41729
|
}, [config, settings.ui?.enableWelcomeBack]);
|
|
41486
|
-
const handleWelcomeBackSelection = (0,
|
|
41730
|
+
const handleWelcomeBackSelection = (0, import_react151.useCallback)(
|
|
41487
41731
|
(choice) => {
|
|
41488
41732
|
setWelcomeBackChoice(choice);
|
|
41489
41733
|
setShowWelcomeBackDialog(false);
|
|
@@ -41507,21 +41751,21 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
41507
41751
|
},
|
|
41508
41752
|
[config, welcomeBackInfo]
|
|
41509
41753
|
);
|
|
41510
|
-
const handleWelcomeBackClose = (0,
|
|
41754
|
+
const handleWelcomeBackClose = (0, import_react151.useCallback)(() => {
|
|
41511
41755
|
setWelcomeBackChoice("restart");
|
|
41512
41756
|
setShowWelcomeBackDialog(false);
|
|
41513
41757
|
}, []);
|
|
41514
|
-
const clearInputFill = (0,
|
|
41758
|
+
const clearInputFill = (0, import_react151.useCallback)(() => {
|
|
41515
41759
|
setShouldFillInput(false);
|
|
41516
41760
|
setInputFillText(null);
|
|
41517
41761
|
}, []);
|
|
41518
|
-
(0,
|
|
41762
|
+
(0, import_react151.useEffect)(() => {
|
|
41519
41763
|
if (shouldFillInput && inputFillText) {
|
|
41520
41764
|
buffer.setText(inputFillText);
|
|
41521
41765
|
clearInputFill();
|
|
41522
41766
|
}
|
|
41523
41767
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
41524
|
-
(0,
|
|
41768
|
+
(0, import_react151.useEffect)(() => {
|
|
41525
41769
|
checkWelcomeBack();
|
|
41526
41770
|
}, [checkWelcomeBack]);
|
|
41527
41771
|
return {
|
|
@@ -41542,9 +41786,9 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
41542
41786
|
|
|
41543
41787
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
41544
41788
|
init_esbuild_shims();
|
|
41545
|
-
var
|
|
41789
|
+
var import_react152 = __toESM(require_react(), 1);
|
|
41546
41790
|
function useDialogClose(options) {
|
|
41547
|
-
const closeAnyOpenDialog = (0,
|
|
41791
|
+
const closeAnyOpenDialog = (0, import_react152.useCallback)(() => {
|
|
41548
41792
|
if (options.isThemeDialogOpen) {
|
|
41549
41793
|
options.handleThemeSelect(void 0, "User" /* User */);
|
|
41550
41794
|
return true;
|
|
@@ -41616,14 +41860,14 @@ __name(useDialogClose, "useDialogClose");
|
|
|
41616
41860
|
|
|
41617
41861
|
// packages/cli/src/ui/hooks/useInitializationAuthError.ts
|
|
41618
41862
|
init_esbuild_shims();
|
|
41619
|
-
var
|
|
41863
|
+
var import_react153 = __toESM(require_react(), 1);
|
|
41620
41864
|
var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError) => {
|
|
41621
|
-
const hasHandled = (0,
|
|
41622
|
-
const authErrorRef = (0,
|
|
41623
|
-
const onAuthErrorRef = (0,
|
|
41865
|
+
const hasHandled = (0, import_react153.useRef)(false);
|
|
41866
|
+
const authErrorRef = (0, import_react153.useRef)(authError);
|
|
41867
|
+
const onAuthErrorRef = (0, import_react153.useRef)(onAuthError);
|
|
41624
41868
|
authErrorRef.current = authError;
|
|
41625
41869
|
onAuthErrorRef.current = onAuthError;
|
|
41626
|
-
(0,
|
|
41870
|
+
(0, import_react153.useEffect)(() => {
|
|
41627
41871
|
if (hasHandled.current) {
|
|
41628
41872
|
return;
|
|
41629
41873
|
}
|
|
@@ -41636,13 +41880,13 @@ var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError)
|
|
|
41636
41880
|
|
|
41637
41881
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
41638
41882
|
init_esbuild_shims();
|
|
41639
|
-
var
|
|
41883
|
+
var import_react154 = __toESM(require_react(), 1);
|
|
41640
41884
|
function useSubagentCreateDialog() {
|
|
41641
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
41642
|
-
const openSubagentCreateDialog = (0,
|
|
41885
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react154.useState)(false);
|
|
41886
|
+
const openSubagentCreateDialog = (0, import_react154.useCallback)(() => {
|
|
41643
41887
|
setIsSubagentCreateDialogOpen(true);
|
|
41644
41888
|
}, []);
|
|
41645
|
-
const closeSubagentCreateDialog = (0,
|
|
41889
|
+
const closeSubagentCreateDialog = (0, import_react154.useCallback)(() => {
|
|
41646
41890
|
setIsSubagentCreateDialogOpen(false);
|
|
41647
41891
|
}, []);
|
|
41648
41892
|
return {
|
|
@@ -41655,13 +41899,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
41655
41899
|
|
|
41656
41900
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
41657
41901
|
init_esbuild_shims();
|
|
41658
|
-
var
|
|
41902
|
+
var import_react155 = __toESM(require_react(), 1);
|
|
41659
41903
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41660
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
41661
|
-
const openAgentsManagerDialog = (0,
|
|
41904
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react155.useState)(false);
|
|
41905
|
+
const openAgentsManagerDialog = (0, import_react155.useCallback)(() => {
|
|
41662
41906
|
setIsAgentsManagerDialogOpen(true);
|
|
41663
41907
|
}, []);
|
|
41664
|
-
const closeAgentsManagerDialog = (0,
|
|
41908
|
+
const closeAgentsManagerDialog = (0, import_react155.useCallback)(() => {
|
|
41665
41909
|
setIsAgentsManagerDialogOpen(false);
|
|
41666
41910
|
}, []);
|
|
41667
41911
|
return {
|
|
@@ -41673,13 +41917,13 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41673
41917
|
|
|
41674
41918
|
// packages/cli/src/ui/hooks/useSkillsManagerDialog.ts
|
|
41675
41919
|
init_esbuild_shims();
|
|
41676
|
-
var
|
|
41920
|
+
var import_react156 = __toESM(require_react(), 1);
|
|
41677
41921
|
var useSkillsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41678
|
-
const [isSkillsManagerDialogOpen, setIsSkillsManagerDialogOpen] = (0,
|
|
41679
|
-
const openSkillsManagerDialog = (0,
|
|
41922
|
+
const [isSkillsManagerDialogOpen, setIsSkillsManagerDialogOpen] = (0, import_react156.useState)(false);
|
|
41923
|
+
const openSkillsManagerDialog = (0, import_react156.useCallback)(() => {
|
|
41680
41924
|
setIsSkillsManagerDialogOpen(true);
|
|
41681
41925
|
}, []);
|
|
41682
|
-
const closeSkillsManagerDialog = (0,
|
|
41926
|
+
const closeSkillsManagerDialog = (0, import_react156.useCallback)(() => {
|
|
41683
41927
|
setIsSkillsManagerDialogOpen(false);
|
|
41684
41928
|
}, []);
|
|
41685
41929
|
return {
|
|
@@ -41691,13 +41935,13 @@ var useSkillsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41691
41935
|
|
|
41692
41936
|
// packages/cli/src/ui/hooks/useExtensionsManagerDialog.ts
|
|
41693
41937
|
init_esbuild_shims();
|
|
41694
|
-
var
|
|
41938
|
+
var import_react157 = __toESM(require_react(), 1);
|
|
41695
41939
|
var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41696
|
-
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0,
|
|
41697
|
-
const openExtensionsManagerDialog = (0,
|
|
41940
|
+
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0, import_react157.useState)(false);
|
|
41941
|
+
const openExtensionsManagerDialog = (0, import_react157.useCallback)(() => {
|
|
41698
41942
|
setIsExtensionsManagerDialogOpen(true);
|
|
41699
41943
|
}, []);
|
|
41700
|
-
const closeExtensionsManagerDialog = (0,
|
|
41944
|
+
const closeExtensionsManagerDialog = (0, import_react157.useCallback)(() => {
|
|
41701
41945
|
setIsExtensionsManagerDialogOpen(false);
|
|
41702
41946
|
}, []);
|
|
41703
41947
|
return {
|
|
@@ -41709,13 +41953,13 @@ var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41709
41953
|
|
|
41710
41954
|
// packages/cli/src/ui/hooks/useMcpDialog.ts
|
|
41711
41955
|
init_esbuild_shims();
|
|
41712
|
-
var
|
|
41956
|
+
var import_react158 = __toESM(require_react(), 1);
|
|
41713
41957
|
var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
41714
|
-
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0,
|
|
41715
|
-
const openMcpDialog = (0,
|
|
41958
|
+
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0, import_react158.useState)(false);
|
|
41959
|
+
const openMcpDialog = (0, import_react158.useCallback)(() => {
|
|
41716
41960
|
setIsMcpDialogOpen(true);
|
|
41717
41961
|
}, []);
|
|
41718
|
-
const closeMcpDialog = (0,
|
|
41962
|
+
const closeMcpDialog = (0, import_react158.useCallback)(() => {
|
|
41719
41963
|
setIsMcpDialogOpen(false);
|
|
41720
41964
|
}, []);
|
|
41721
41965
|
return {
|
|
@@ -41727,13 +41971,13 @@ var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
|
41727
41971
|
|
|
41728
41972
|
// packages/cli/src/ui/hooks/useHooksDialog.ts
|
|
41729
41973
|
init_esbuild_shims();
|
|
41730
|
-
var
|
|
41974
|
+
var import_react159 = __toESM(require_react(), 1);
|
|
41731
41975
|
var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
41732
|
-
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0,
|
|
41733
|
-
const openHooksDialog = (0,
|
|
41976
|
+
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0, import_react159.useState)(false);
|
|
41977
|
+
const openHooksDialog = (0, import_react159.useCallback)(() => {
|
|
41734
41978
|
setIsHooksDialogOpen(true);
|
|
41735
41979
|
}, []);
|
|
41736
|
-
const closeHooksDialog = (0,
|
|
41980
|
+
const closeHooksDialog = (0, import_react159.useCallback)(() => {
|
|
41737
41981
|
setIsHooksDialogOpen(false);
|
|
41738
41982
|
}, []);
|
|
41739
41983
|
return {
|
|
@@ -41745,23 +41989,23 @@ var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
|
41745
41989
|
|
|
41746
41990
|
// packages/cli/src/ui/hooks/useStatsDialog.ts
|
|
41747
41991
|
init_esbuild_shims();
|
|
41748
|
-
var
|
|
41992
|
+
var import_react160 = __toESM(require_react(), 1);
|
|
41749
41993
|
var useStatsDialog = /* @__PURE__ */ __name(() => {
|
|
41750
|
-
const [isStatsDialogOpen, setIsStatsDialogOpen] = (0,
|
|
41751
|
-
const openStatsDialog = (0,
|
|
41752
|
-
const closeStatsDialog = (0,
|
|
41994
|
+
const [isStatsDialogOpen, setIsStatsDialogOpen] = (0, import_react160.useState)(false);
|
|
41995
|
+
const openStatsDialog = (0, import_react160.useCallback)(() => setIsStatsDialogOpen(true), []);
|
|
41996
|
+
const closeStatsDialog = (0, import_react160.useCallback)(() => setIsStatsDialogOpen(false), []);
|
|
41753
41997
|
return { isStatsDialogOpen, openStatsDialog, closeStatsDialog };
|
|
41754
41998
|
}, "useStatsDialog");
|
|
41755
41999
|
|
|
41756
42000
|
// packages/cli/src/ui/hooks/useMemoryDialog.ts
|
|
41757
42001
|
init_esbuild_shims();
|
|
41758
|
-
var
|
|
42002
|
+
var import_react161 = __toESM(require_react(), 1);
|
|
41759
42003
|
var useMemoryDialog = /* @__PURE__ */ __name(() => {
|
|
41760
|
-
const [isMemoryDialogOpen, setIsMemoryDialogOpen] = (0,
|
|
41761
|
-
const openMemoryDialog = (0,
|
|
42004
|
+
const [isMemoryDialogOpen, setIsMemoryDialogOpen] = (0, import_react161.useState)(false);
|
|
42005
|
+
const openMemoryDialog = (0, import_react161.useCallback)(() => {
|
|
41762
42006
|
setIsMemoryDialogOpen(true);
|
|
41763
42007
|
}, []);
|
|
41764
|
-
const closeMemoryDialog = (0,
|
|
42008
|
+
const closeMemoryDialog = (0, import_react161.useCallback)(() => {
|
|
41765
42009
|
setIsMemoryDialogOpen(false);
|
|
41766
42010
|
}, []);
|
|
41767
42011
|
return {
|
|
@@ -41773,7 +42017,7 @@ var useMemoryDialog = /* @__PURE__ */ __name(() => {
|
|
|
41773
42017
|
|
|
41774
42018
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
41775
42019
|
init_esbuild_shims();
|
|
41776
|
-
var
|
|
42020
|
+
var import_react162 = __toESM(require_react(), 1);
|
|
41777
42021
|
var LONG_TASK_NOTIFICATION_THRESHOLD_SECONDS = 20;
|
|
41778
42022
|
var NOTIFICATION_TITLE = "Qwen Code";
|
|
41779
42023
|
var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
@@ -41788,16 +42032,16 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
41788
42032
|
const terminalBellEnabled = settings?.merged?.general?.terminalBell ?? true;
|
|
41789
42033
|
const notificationMode = settings?.merged?.general?.notificationMode === "task-complete" ? "task-complete" : "all";
|
|
41790
42034
|
const approvalNotificationsEnabled = notificationMode === "all";
|
|
41791
|
-
const awaitingNotificationSentRef = (0,
|
|
41792
|
-
const respondingElapsedRef = (0,
|
|
41793
|
-
const idleNotificationSentRef = (0,
|
|
41794
|
-
const awaitingToolName = (0,
|
|
42035
|
+
const awaitingNotificationSentRef = (0, import_react162.useRef)(false);
|
|
42036
|
+
const respondingElapsedRef = (0, import_react162.useRef)(0);
|
|
42037
|
+
const idleNotificationSentRef = (0, import_react162.useRef)(false);
|
|
42038
|
+
const awaitingToolName = (0, import_react162.useMemo)(() => {
|
|
41795
42039
|
const awaitingTool = pendingToolCalls?.find(
|
|
41796
42040
|
(tc) => tc.status === "awaiting_approval"
|
|
41797
42041
|
);
|
|
41798
42042
|
return awaitingTool?.request.name;
|
|
41799
42043
|
}, [pendingToolCalls]);
|
|
41800
|
-
(0,
|
|
42044
|
+
(0, import_react162.useEffect)(() => {
|
|
41801
42045
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current && terminalBellEnabled && approvalNotificationsEnabled) {
|
|
41802
42046
|
const message = awaitingToolName ? `Qwen Code needs your permission to use ${awaitingToolName}` : "Qwen Code is waiting for your input";
|
|
41803
42047
|
sendNotification(
|
|
@@ -41818,7 +42062,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
41818
42062
|
terminal,
|
|
41819
42063
|
awaitingToolName
|
|
41820
42064
|
]);
|
|
41821
|
-
(0,
|
|
42065
|
+
(0, import_react162.useEffect)(() => {
|
|
41822
42066
|
if (streamingState === "responding" /* Responding */) {
|
|
41823
42067
|
respondingElapsedRef.current = elapsedTime;
|
|
41824
42068
|
idleNotificationSentRef.current = false;
|
|
@@ -41971,7 +42215,7 @@ __name(buildTerminalNotification, "buildTerminalNotification");
|
|
|
41971
42215
|
|
|
41972
42216
|
// packages/cli/src/ui/hooks/useContextualTips.ts
|
|
41973
42217
|
init_esbuild_shims();
|
|
41974
|
-
var
|
|
42218
|
+
var import_react163 = __toESM(require_react(), 1);
|
|
41975
42219
|
function useContextualTips({
|
|
41976
42220
|
streamingState,
|
|
41977
42221
|
lastPromptTokenCount,
|
|
@@ -41981,9 +42225,9 @@ function useContextualTips({
|
|
|
41981
42225
|
addItem,
|
|
41982
42226
|
hideTips
|
|
41983
42227
|
}) {
|
|
41984
|
-
const prevStreamingState = (0,
|
|
41985
|
-
const hadResponsePhase = (0,
|
|
41986
|
-
(0,
|
|
42228
|
+
const prevStreamingState = (0, import_react163.useRef)("idle" /* Idle */);
|
|
42229
|
+
const hadResponsePhase = (0, import_react163.useRef)(false);
|
|
42230
|
+
(0, import_react163.useEffect)(() => {
|
|
41987
42231
|
if (streamingState === "responding" /* Responding */ || prevStreamingState.current === "responding" /* Responding */ && streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */) {
|
|
41988
42232
|
hadResponsePhase.current = true;
|
|
41989
42233
|
}
|
|
@@ -42119,7 +42363,7 @@ function getResponseCandidateTokens(pendingGeminiHistoryItems) {
|
|
|
42119
42363
|
__name(getResponseCandidateTokens, "getResponseCandidateTokens");
|
|
42120
42364
|
function useStableStickyTodos(todos) {
|
|
42121
42365
|
const renderKey = getStickyTodosRenderKey(todos);
|
|
42122
|
-
const stableTodosRef = (0,
|
|
42366
|
+
const stableTodosRef = (0, import_react164.useRef)(null);
|
|
42123
42367
|
if (stableTodosRef.current?.renderKey !== renderKey) {
|
|
42124
42368
|
stableTodosRef.current = { renderKey, todos };
|
|
42125
42369
|
}
|
|
@@ -42149,30 +42393,30 @@ __name(shouldAutoOpenSkillReview, "shouldAutoOpenSkillReview");
|
|
|
42149
42393
|
var SHELL_WIDTH_FRACTION = 0.89;
|
|
42150
42394
|
var SHELL_HEIGHT_PADDING = 10;
|
|
42151
42395
|
var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
42152
|
-
const { settings, config, initializationResult } = props;
|
|
42153
|
-
const extensionRefreshState = (0,
|
|
42396
|
+
const { settings, config, initializationResult, initialUseVirtualViewport } = props;
|
|
42397
|
+
const extensionRefreshState = (0, import_react164.useMemo)(
|
|
42154
42398
|
() => props.extensionRefreshState ?? new ExtensionRefreshState(),
|
|
42155
42399
|
[props.extensionRefreshState]
|
|
42156
42400
|
);
|
|
42157
42401
|
const historyManager = useHistory();
|
|
42158
|
-
const historyRef = (0,
|
|
42402
|
+
const historyRef = (0, import_react164.useRef)(historyManager.history);
|
|
42159
42403
|
historyRef.current = historyManager.history;
|
|
42160
42404
|
useMemoryMonitor(historyManager);
|
|
42161
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
42162
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
42163
|
-
const [themeError, setThemeError] = (0,
|
|
42405
|
+
const [debugMessage, setDebugMessage] = (0, import_react164.useState)("");
|
|
42406
|
+
const [quittingMessages, setQuittingMessages] = (0, import_react164.useState)(null);
|
|
42407
|
+
const [themeError, setThemeError] = (0, import_react164.useState)(
|
|
42164
42408
|
initializationResult.themeError
|
|
42165
42409
|
);
|
|
42166
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
42167
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
42168
|
-
const [geminiMdFileCount, setGeminiMdFileCount] = (0,
|
|
42410
|
+
const [isProcessing, setIsProcessing] = (0, import_react164.useState)(false);
|
|
42411
|
+
const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react164.useState)(false);
|
|
42412
|
+
const [geminiMdFileCount, setGeminiMdFileCount] = (0, import_react164.useState)(
|
|
42169
42413
|
initializationResult.geminiMdFileCount
|
|
42170
42414
|
);
|
|
42171
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
42172
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
42173
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
42174
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
42175
|
-
const [isTrustedFolder, setIsTrustedFolder] = (0,
|
|
42415
|
+
const [shellModeActive, setShellModeActive] = (0, import_react164.useState)(false);
|
|
42416
|
+
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react164.useState)(false);
|
|
42417
|
+
const [historyRemountKey, setHistoryRemountKey] = (0, import_react164.useState)(0);
|
|
42418
|
+
const [updateInfo, setUpdateInfo] = (0, import_react164.useState)(null);
|
|
42419
|
+
const [isTrustedFolder, setIsTrustedFolder] = (0, import_react164.useState)(
|
|
42176
42420
|
config.isTrustedFolder()
|
|
42177
42421
|
);
|
|
42178
42422
|
const extensionManager = config.getExtensionManager();
|
|
@@ -42231,31 +42475,31 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42231
42475
|
config,
|
|
42232
42476
|
historyManager.addItem
|
|
42233
42477
|
);
|
|
42234
|
-
const [isTrustDialogOpen, setTrustDialogOpen] = (0,
|
|
42235
|
-
const openTrustDialog = (0,
|
|
42236
|
-
const closeTrustDialog = (0,
|
|
42237
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
42238
|
-
const openPermissionsDialog = (0,
|
|
42478
|
+
const [isTrustDialogOpen, setTrustDialogOpen] = (0, import_react164.useState)(false);
|
|
42479
|
+
const openTrustDialog = (0, import_react164.useCallback)(() => setTrustDialogOpen(true), []);
|
|
42480
|
+
const closeTrustDialog = (0, import_react164.useCallback)(() => setTrustDialogOpen(false), []);
|
|
42481
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react164.useState)(false);
|
|
42482
|
+
const openPermissionsDialog = (0, import_react164.useCallback)(
|
|
42239
42483
|
() => setPermissionsDialogOpen(true),
|
|
42240
42484
|
[]
|
|
42241
42485
|
);
|
|
42242
|
-
const closePermissionsDialog = (0,
|
|
42486
|
+
const closePermissionsDialog = (0, import_react164.useCallback)(
|
|
42243
42487
|
() => setPermissionsDialogOpen(false),
|
|
42244
42488
|
[]
|
|
42245
42489
|
);
|
|
42246
|
-
const [currentModel, setCurrentModel] = (0,
|
|
42247
|
-
const [isConfigInitialized, setConfigInitialized] = (0,
|
|
42248
|
-
const [userMessages, setUserMessages] = (0,
|
|
42249
|
-
const [transcriptFreeze, setTranscriptFreeze] = (0,
|
|
42490
|
+
const [currentModel, setCurrentModel] = (0, import_react164.useState)(() => config.getModel());
|
|
42491
|
+
const [isConfigInitialized, setConfigInitialized] = (0, import_react164.useState)(false);
|
|
42492
|
+
const [userMessages, setUserMessages] = (0, import_react164.useState)([]);
|
|
42493
|
+
const [transcriptFreeze, setTranscriptFreeze] = (0, import_react164.useState)(null);
|
|
42250
42494
|
const isTranscriptOpen = transcriptFreeze != null;
|
|
42251
|
-
const isTranscriptOpenRef = (0,
|
|
42495
|
+
const isTranscriptOpenRef = (0, import_react164.useRef)(isTranscriptOpen);
|
|
42252
42496
|
isTranscriptOpenRef.current = isTranscriptOpen;
|
|
42253
|
-
const closeTranscript = (0,
|
|
42497
|
+
const closeTranscript = (0, import_react164.useCallback)(() => {
|
|
42254
42498
|
setTranscriptFreeze(null);
|
|
42255
42499
|
}, []);
|
|
42256
|
-
const [thoughtExpanded, setThoughtExpanded] = (0,
|
|
42257
|
-
const [expandedThoughtHeadIds, setExpandedThoughtHeadIds] = (0,
|
|
42258
|
-
const toggleThoughtExpanded = (0,
|
|
42500
|
+
const [thoughtExpanded, setThoughtExpanded] = (0, import_react164.useState)(false);
|
|
42501
|
+
const [expandedThoughtHeadIds, setExpandedThoughtHeadIds] = (0, import_react164.useState)(() => /* @__PURE__ */ new Set());
|
|
42502
|
+
const toggleThoughtExpanded = (0, import_react164.useCallback)((headId) => {
|
|
42259
42503
|
setExpandedThoughtHeadIds((prev) => {
|
|
42260
42504
|
const next = new Set(prev);
|
|
42261
42505
|
if (next.has(headId)) {
|
|
@@ -42269,10 +42513,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42269
42513
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
42270
42514
|
const { stdin, setRawMode } = use_stdin_default();
|
|
42271
42515
|
const { stdout } = use_stdout_default();
|
|
42272
|
-
const writeRaw = (0,
|
|
42273
|
-
|
|
42516
|
+
const writeRaw = (0, import_react164.useCallback)((data) => {
|
|
42517
|
+
process17.stdout.write(data);
|
|
42274
42518
|
}, []);
|
|
42275
|
-
const terminal = (0,
|
|
42519
|
+
const terminal = (0, import_react164.useMemo)(
|
|
42276
42520
|
() => buildTerminalNotification(writeRaw),
|
|
42277
42521
|
[writeRaw]
|
|
42278
42522
|
);
|
|
@@ -42286,10 +42530,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42286
42530
|
const branchName = useGitBranchName(
|
|
42287
42531
|
worktreeSession?.worktreePath ?? config.getTargetDir()
|
|
42288
42532
|
);
|
|
42289
|
-
const [showWorktreeExitDialog, setShowWorktreeExitDialog] = (0,
|
|
42290
|
-
const [workflowKeywordActive, setWorkflowKeywordActive] = (0,
|
|
42291
|
-
const pendingWorktreeNoticeRef = (0,
|
|
42292
|
-
const activeWorktree = (0,
|
|
42533
|
+
const [showWorktreeExitDialog, setShowWorktreeExitDialog] = (0, import_react164.useState)(false);
|
|
42534
|
+
const [workflowKeywordActive, setWorkflowKeywordActive] = (0, import_react164.useState)(false);
|
|
42535
|
+
const pendingWorktreeNoticeRef = (0, import_react164.useRef)(null);
|
|
42536
|
+
const activeWorktree = (0, import_react164.useMemo)(
|
|
42293
42537
|
() => worktreeSession ? {
|
|
42294
42538
|
slug: worktreeSession.slug,
|
|
42295
42539
|
branch: worktreeSession.worktreeBranch,
|
|
@@ -42300,20 +42544,20 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42300
42544
|
} : null,
|
|
42301
42545
|
[worktreeSession]
|
|
42302
42546
|
);
|
|
42303
|
-
const mainControlsRef = (0,
|
|
42304
|
-
const lastTitleRef = (0,
|
|
42305
|
-
const [startupWarnings, setStartupWarnings] = (0,
|
|
42547
|
+
const mainControlsRef = (0, import_react164.useRef)(null);
|
|
42548
|
+
const lastTitleRef = (0, import_react164.useRef)(null);
|
|
42549
|
+
const [startupWarnings, setStartupWarnings] = (0, import_react164.useState)(
|
|
42306
42550
|
() => props.startupWarnings || []
|
|
42307
42551
|
);
|
|
42308
42552
|
const staticExtraHeight = 3;
|
|
42309
|
-
(0,
|
|
42553
|
+
(0, import_react164.useEffect)(() => {
|
|
42310
42554
|
void loadLowlight().catch((err) => {
|
|
42311
42555
|
debugLogger40.warn(
|
|
42312
42556
|
`Failed to load lowlight chunk; code blocks will render as plain text: ${err instanceof Error ? err.message : String(err)}`
|
|
42313
42557
|
);
|
|
42314
42558
|
});
|
|
42315
42559
|
}, []);
|
|
42316
|
-
(0,
|
|
42560
|
+
(0, import_react164.useEffect)(() => {
|
|
42317
42561
|
(async () => {
|
|
42318
42562
|
profileCheckpoint("config_initialize_start");
|
|
42319
42563
|
await config.initialize();
|
|
@@ -42403,7 +42647,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42403
42647
|
await ideClient.disconnect();
|
|
42404
42648
|
});
|
|
42405
42649
|
}, [config]);
|
|
42406
|
-
(0,
|
|
42650
|
+
(0, import_react164.useEffect)(() => {
|
|
42407
42651
|
if (!isConfigInitialized) return void 0;
|
|
42408
42652
|
const geminiClient2 = config.getGeminiClient();
|
|
42409
42653
|
if (!geminiClient2) return void 0;
|
|
@@ -42467,11 +42711,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42467
42711
|
clearTimeout(finalizeCap);
|
|
42468
42712
|
};
|
|
42469
42713
|
}, [isConfigInitialized, config]);
|
|
42470
|
-
const isIdleRef = (0,
|
|
42471
|
-
const availableTerminalHeightRef = (0,
|
|
42472
|
-
const terminalWidthRef = (0,
|
|
42473
|
-
const updateHandlerRef = (0,
|
|
42474
|
-
(0,
|
|
42714
|
+
const isIdleRef = (0, import_react164.useRef)(true);
|
|
42715
|
+
const availableTerminalHeightRef = (0, import_react164.useRef)(0);
|
|
42716
|
+
const terminalWidthRef = (0, import_react164.useRef)(0);
|
|
42717
|
+
const updateHandlerRef = (0, import_react164.useRef)(null);
|
|
42718
|
+
(0, import_react164.useEffect)(() => {
|
|
42475
42719
|
const handler = setUpdateHandler(
|
|
42476
42720
|
historyManager.addItem,
|
|
42477
42721
|
setUpdateInfo,
|
|
@@ -42480,13 +42724,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42480
42724
|
updateHandlerRef.current = handler;
|
|
42481
42725
|
return () => handler?.cleanup();
|
|
42482
42726
|
}, [historyManager.addItem]);
|
|
42483
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
42727
|
+
const { inputWidth, suggestionsWidth } = (0, import_react164.useMemo)(() => {
|
|
42484
42728
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
42485
42729
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
42486
42730
|
}, [terminalWidth]);
|
|
42487
42731
|
const mainAreaWidth = Math.min(terminalWidth - 4, 100);
|
|
42488
42732
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
42489
|
-
const isValidPath = (0,
|
|
42733
|
+
const isValidPath = (0, import_react164.useCallback)((filePath) => {
|
|
42490
42734
|
try {
|
|
42491
42735
|
return fs20.existsSync(filePath) && fs20.statSync(filePath).isFile();
|
|
42492
42736
|
} catch (_e) {
|
|
@@ -42494,6 +42738,27 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42494
42738
|
}
|
|
42495
42739
|
}, []);
|
|
42496
42740
|
const preferredEditor = usePreferredEditor();
|
|
42741
|
+
const restoredSubmissionRef = (0, import_react164.useRef)(null);
|
|
42742
|
+
const submittedPromptProvenanceUnavailableRef = (0, import_react164.useRef)(false);
|
|
42743
|
+
const setBufferTextRef = (0, import_react164.useRef)(null);
|
|
42744
|
+
const invalidateSubmittedPromptProvenance = (0, import_react164.useCallback)(() => {
|
|
42745
|
+
restoredSubmissionRef.current = null;
|
|
42746
|
+
submittedPromptProvenanceUnavailableRef.current = true;
|
|
42747
|
+
}, []);
|
|
42748
|
+
const handleBufferChange = (0, import_react164.useCallback)((text) => {
|
|
42749
|
+
if (text.length === 0) {
|
|
42750
|
+
if (restoredSubmissionRef.current !== null || submittedPromptProvenanceUnavailableRef.current) {
|
|
42751
|
+
setBufferTextRef.current?.("", { clearUndoHistory: true });
|
|
42752
|
+
}
|
|
42753
|
+
restoredSubmissionRef.current = null;
|
|
42754
|
+
submittedPromptProvenanceUnavailableRef.current = false;
|
|
42755
|
+
return;
|
|
42756
|
+
}
|
|
42757
|
+
if (restoredSubmissionRef.current !== null && restoredSubmissionRef.current.modelText !== text) {
|
|
42758
|
+
restoredSubmissionRef.current = null;
|
|
42759
|
+
submittedPromptProvenanceUnavailableRef.current = true;
|
|
42760
|
+
}
|
|
42761
|
+
}, []);
|
|
42497
42762
|
const buffer = useTextBuffer({
|
|
42498
42763
|
initialText: "",
|
|
42499
42764
|
viewport: { height: 10, width: inputWidth },
|
|
@@ -42501,22 +42766,25 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42501
42766
|
setRawMode,
|
|
42502
42767
|
isValidPath,
|
|
42503
42768
|
shellModeActive,
|
|
42504
|
-
preferredEditor
|
|
42769
|
+
preferredEditor,
|
|
42770
|
+
onChange: handleBufferChange
|
|
42505
42771
|
});
|
|
42506
|
-
const
|
|
42772
|
+
const setBufferText = buffer.setText;
|
|
42773
|
+
setBufferTextRef.current = setBufferText;
|
|
42774
|
+
const restoredPromptStashTargetsRef = (0, import_react164.useRef)(/* @__PURE__ */ new Set());
|
|
42507
42775
|
const promptStashTargetDir = config.getTargetDir();
|
|
42508
|
-
(0,
|
|
42776
|
+
(0, import_react164.useEffect)(() => {
|
|
42509
42777
|
if (restoredPromptStashTargetsRef.current.has(promptStashTargetDir)) {
|
|
42510
42778
|
return;
|
|
42511
42779
|
}
|
|
42512
42780
|
restoredPromptStashTargetsRef.current.add(promptStashTargetDir);
|
|
42513
|
-
restorePromptStash(
|
|
42514
|
-
|
|
42515
|
-
|
|
42516
|
-
|
|
42517
|
-
);
|
|
42781
|
+
restorePromptStash(promptStashTargetDir, buffer.text, (text) => {
|
|
42782
|
+
restoredSubmissionRef.current = null;
|
|
42783
|
+
submittedPromptProvenanceUnavailableRef.current = true;
|
|
42784
|
+
buffer.setText(text);
|
|
42785
|
+
});
|
|
42518
42786
|
}, [buffer, promptStashTargetDir]);
|
|
42519
|
-
(0,
|
|
42787
|
+
(0, import_react164.useEffect)(() => {
|
|
42520
42788
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
42521
42789
|
const pastMessagesRaw = await logger?.getPreviousUserMessages() || [];
|
|
42522
42790
|
const currentSessionUserMessages = realUserPromptTexts(
|
|
@@ -42530,12 +42798,18 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42530
42798
|
}, "fetchUserMessages");
|
|
42531
42799
|
fetchUserMessages();
|
|
42532
42800
|
}, [historyManager.history, logger]);
|
|
42533
|
-
const remountStaticHistory = (0,
|
|
42801
|
+
const remountStaticHistory = (0, import_react164.useCallback)(() => {
|
|
42534
42802
|
setHistoryRemountKey((prev) => prev + 1);
|
|
42535
42803
|
}, []);
|
|
42536
|
-
const useTerminalBuffer =
|
|
42804
|
+
const [useTerminalBuffer] = (0, import_react164.useState)(
|
|
42805
|
+
() => initialUseVirtualViewport ?? shouldUseVirtualViewport(
|
|
42806
|
+
settings.merged.ui?.useTerminalBuffer,
|
|
42807
|
+
config.getScreenReader(),
|
|
42808
|
+
isInteractiveTerminal()
|
|
42809
|
+
)
|
|
42810
|
+
);
|
|
42537
42811
|
const showScrollbar = settings.merged.ui?.showScrollbar ?? true;
|
|
42538
|
-
const refreshStatic = (0,
|
|
42812
|
+
const refreshStatic = (0, import_react164.useCallback)(() => {
|
|
42539
42813
|
if (isTranscriptOpenRef.current) {
|
|
42540
42814
|
return;
|
|
42541
42815
|
}
|
|
@@ -42544,15 +42818,15 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42544
42818
|
}
|
|
42545
42819
|
remountStaticHistory();
|
|
42546
42820
|
}, [useTerminalBuffer, remountStaticHistory, stdout]);
|
|
42547
|
-
const prevTranscriptOpenRef = (0,
|
|
42821
|
+
const prevTranscriptOpenRef = (0, import_react164.useRef)(isTranscriptOpen);
|
|
42548
42822
|
const wasOpenPrevRender = prevTranscriptOpenRef.current;
|
|
42549
42823
|
prevTranscriptOpenRef.current = isTranscriptOpen;
|
|
42550
|
-
const transcriptCloseCountRef = (0,
|
|
42824
|
+
const transcriptCloseCountRef = (0, import_react164.useRef)(0);
|
|
42551
42825
|
if (wasOpenPrevRender && !isTranscriptOpen) {
|
|
42552
42826
|
transcriptCloseCountRef.current += 1;
|
|
42553
42827
|
}
|
|
42554
42828
|
const transcriptCloseCount = transcriptCloseCountRef.current;
|
|
42555
|
-
(0,
|
|
42829
|
+
(0, import_react164.useEffect)(() => {
|
|
42556
42830
|
if (transcriptCloseCount === 0 || useTerminalBuffer) {
|
|
42557
42831
|
return void 0;
|
|
42558
42832
|
}
|
|
@@ -42565,8 +42839,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42565
42839
|
}, 0);
|
|
42566
42840
|
return () => clearTimeout(id);
|
|
42567
42841
|
}, [transcriptCloseCount, useTerminalBuffer, stdout, remountStaticHistory]);
|
|
42568
|
-
const lastNotifiedModelRef = (0,
|
|
42569
|
-
(0,
|
|
42842
|
+
const lastNotifiedModelRef = (0, import_react164.useRef)(currentModel);
|
|
42843
|
+
(0, import_react164.useEffect)(() => {
|
|
42570
42844
|
const unsubscribe = config.onModelChange((model) => {
|
|
42571
42845
|
if (lastNotifiedModelRef.current === model) {
|
|
42572
42846
|
return;
|
|
@@ -42604,7 +42878,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42604
42878
|
const { onAuthError, openAuthDialog, closeAuthDialog } = authActions;
|
|
42605
42879
|
const { isAuthDialogOpen, isAuthenticating, pendingAuthType } = authState;
|
|
42606
42880
|
useInitializationAuthError(initializationResult.authError, onAuthError);
|
|
42607
|
-
(0,
|
|
42881
|
+
(0, import_react164.useEffect)(() => {
|
|
42608
42882
|
const currentAuthType = config.getModelsConfig().getCurrentAuthType();
|
|
42609
42883
|
if (settings.merged.security?.auth?.enforcedType && currentAuthType && settings.merged.security?.auth.enforcedType !== currentAuthType) {
|
|
42610
42884
|
onAuthError(
|
|
@@ -42618,7 +42892,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42618
42892
|
);
|
|
42619
42893
|
}
|
|
42620
42894
|
}, [settings.merged.security?.auth?.enforcedType, config, onAuthError]);
|
|
42621
|
-
const [editorError, setEditorError] = (0,
|
|
42895
|
+
const [editorError, setEditorError] = (0, import_react164.useState)(null);
|
|
42622
42896
|
const {
|
|
42623
42897
|
isEditorDialogOpen,
|
|
42624
42898
|
openEditorDialog,
|
|
@@ -42626,18 +42900,18 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42626
42900
|
exitEditorDialog
|
|
42627
42901
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
42628
42902
|
const { isSettingsDialogOpen, openSettingsDialog, closeSettingsDialog } = useSettingsCommand();
|
|
42629
|
-
const [isStatusLineDialogOpen, setStatusLineDialogOpen] = (0,
|
|
42630
|
-
const openStatusLineDialog = (0,
|
|
42903
|
+
const [isStatusLineDialogOpen, setStatusLineDialogOpen] = (0, import_react164.useState)(false);
|
|
42904
|
+
const openStatusLineDialog = (0, import_react164.useCallback)(
|
|
42631
42905
|
() => setStatusLineDialogOpen(true),
|
|
42632
42906
|
[]
|
|
42633
42907
|
);
|
|
42634
|
-
const closeStatusLineDialog = (0,
|
|
42908
|
+
const closeStatusLineDialog = (0, import_react164.useCallback)(
|
|
42635
42909
|
() => setStatusLineDialogOpen(false),
|
|
42636
42910
|
[]
|
|
42637
42911
|
);
|
|
42638
|
-
const [statusLineSettingsVersion, setStatusLineSettingsVersion] = (0,
|
|
42639
|
-
const [statusLineConfigOverride, setStatusLineConfigOverride] = (0,
|
|
42640
|
-
const notifyStatusLineSettingsChanged = (0,
|
|
42912
|
+
const [statusLineSettingsVersion, setStatusLineSettingsVersion] = (0, import_react164.useState)(0);
|
|
42913
|
+
const [statusLineConfigOverride, setStatusLineConfigOverride] = (0, import_react164.useState)(void 0);
|
|
42914
|
+
const notifyStatusLineSettingsChanged = (0, import_react164.useCallback)(
|
|
42641
42915
|
(newConfig) => {
|
|
42642
42916
|
setStatusLineConfigOverride(newConfig);
|
|
42643
42917
|
setStatusLineSettingsVersion((version) => version + 1);
|
|
@@ -42656,8 +42930,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42656
42930
|
closeModelDialog
|
|
42657
42931
|
} = useModelCommand();
|
|
42658
42932
|
const { activeArenaDialog, openArenaDialog, closeArenaDialog } = useArenaCommand();
|
|
42659
|
-
const [sessionName, setSessionName] = (0,
|
|
42660
|
-
(0,
|
|
42933
|
+
const [sessionName, setSessionName] = (0, import_react164.useState)(null);
|
|
42934
|
+
(0, import_react164.useEffect)(() => {
|
|
42661
42935
|
const chatRecordingService = config.getChatRecordingService();
|
|
42662
42936
|
if (!chatRecordingService?.setTitleRecordedCallback) return;
|
|
42663
42937
|
const existingCallback = chatRecordingService.getTitleRecordedCallback();
|
|
@@ -42674,7 +42948,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42674
42948
|
};
|
|
42675
42949
|
}, [config]);
|
|
42676
42950
|
const addHistoryItem = historyManager.addItem;
|
|
42677
|
-
(0,
|
|
42951
|
+
(0, import_react164.useEffect)(() => {
|
|
42678
42952
|
if (typeof config.onChatRecordingFailure !== "function") return;
|
|
42679
42953
|
return config.onChatRecordingFailure(() => {
|
|
42680
42954
|
addHistoryItem(
|
|
@@ -42718,12 +42992,17 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42718
42992
|
config,
|
|
42719
42993
|
addItem: historyManager.addItem
|
|
42720
42994
|
});
|
|
42721
|
-
const [isHelpDialogOpen, setHelpDialogOpen] = (0,
|
|
42722
|
-
const [activeHelpTab, setHelpTab] = (0,
|
|
42723
|
-
const openHelpDialog = (0,
|
|
42724
|
-
const closeHelpDialog = (0,
|
|
42995
|
+
const [isHelpDialogOpen, setHelpDialogOpen] = (0, import_react164.useState)(false);
|
|
42996
|
+
const [activeHelpTab, setHelpTab] = (0, import_react164.useState)("general");
|
|
42997
|
+
const openHelpDialog = (0, import_react164.useCallback)(() => setHelpDialogOpen(true), []);
|
|
42998
|
+
const closeHelpDialog = (0, import_react164.useCallback)(() => setHelpDialogOpen(false), []);
|
|
42725
42999
|
const { vimEnabled, vimMode } = useVimModeState();
|
|
42726
43000
|
const { toggleVimEnabled } = useVimModeActions();
|
|
43001
|
+
(0, import_react164.useLayoutEffect)(() => {
|
|
43002
|
+
if (vimEnabled && buffer.text.length > 0) {
|
|
43003
|
+
invalidateSubmittedPromptProvenance();
|
|
43004
|
+
}
|
|
43005
|
+
}, [buffer.text, invalidateSubmittedPromptProvenance, vimEnabled]);
|
|
42727
43006
|
const {
|
|
42728
43007
|
isSubagentCreateDialogOpen,
|
|
42729
43008
|
openSubagentCreateDialog,
|
|
@@ -42747,31 +43026,31 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42747
43026
|
const { isMcpDialogOpen, openMcpDialog, closeMcpDialog } = useMcpDialog();
|
|
42748
43027
|
const { isHooksDialogOpen, openHooksDialog, closeHooksDialog } = useHooksDialog();
|
|
42749
43028
|
const { isStatsDialogOpen, openStatsDialog, closeStatsDialog } = useStatsDialog();
|
|
42750
|
-
const openRewindSelectorRef = (0,
|
|
43029
|
+
const openRewindSelectorRef = (0, import_react164.useRef)(() => {
|
|
42751
43030
|
});
|
|
42752
|
-
const cancelOngoingRequestRef = (0,
|
|
43031
|
+
const cancelOngoingRequestRef = (0, import_react164.useRef)(() => {
|
|
42753
43032
|
});
|
|
42754
|
-
const [isDiffDialogOpen, setIsDiffDialogOpen] = (0,
|
|
42755
|
-
const openDiffDialog = (0,
|
|
43033
|
+
const [isDiffDialogOpen, setIsDiffDialogOpen] = (0, import_react164.useState)(false);
|
|
43034
|
+
const openDiffDialog = (0, import_react164.useCallback)(() => {
|
|
42756
43035
|
setIsDiffDialogOpen(true);
|
|
42757
43036
|
}, []);
|
|
42758
|
-
const closeDiffDialog = (0,
|
|
43037
|
+
const closeDiffDialog = (0, import_react164.useCallback)(() => {
|
|
42759
43038
|
setIsDiffDialogOpen(false);
|
|
42760
43039
|
}, []);
|
|
42761
|
-
const [isSkillReviewDialogOpen, setIsSkillReviewDialogOpen] = (0,
|
|
42762
|
-
const [skillReviewPending, setSkillReviewPending] = (0,
|
|
42763
|
-
const skillReviewDismissedTaskIdsRef = (0,
|
|
42764
|
-
const dismissSkillReviewDialog = (0,
|
|
43040
|
+
const [isSkillReviewDialogOpen, setIsSkillReviewDialogOpen] = (0, import_react164.useState)(false);
|
|
43041
|
+
const [skillReviewPending, setSkillReviewPending] = (0, import_react164.useState)(null);
|
|
43042
|
+
const skillReviewDismissedTaskIdsRef = (0, import_react164.useRef)(/* @__PURE__ */ new Set());
|
|
43043
|
+
const dismissSkillReviewDialog = (0, import_react164.useCallback)(() => {
|
|
42765
43044
|
if (skillReviewPending) {
|
|
42766
43045
|
skillReviewDismissedTaskIdsRef.current.add(skillReviewPending.taskId);
|
|
42767
43046
|
}
|
|
42768
43047
|
setIsSkillReviewDialogOpen(false);
|
|
42769
43048
|
}, [skillReviewPending]);
|
|
42770
|
-
const closeSkillReviewDialog = (0,
|
|
43049
|
+
const closeSkillReviewDialog = (0, import_react164.useCallback)(
|
|
42771
43050
|
() => setIsSkillReviewDialogOpen(false),
|
|
42772
43051
|
[]
|
|
42773
43052
|
);
|
|
42774
|
-
const acceptPendingSkill = (0,
|
|
43053
|
+
const acceptPendingSkill = (0, import_react164.useCallback)(
|
|
42775
43054
|
(skillName) => {
|
|
42776
43055
|
if (!skillReviewPending) return;
|
|
42777
43056
|
void config.getMemoryManager().acceptPendingSkillFromTask(skillReviewPending.taskId, skillName).catch(() => {
|
|
@@ -42779,7 +43058,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42779
43058
|
},
|
|
42780
43059
|
[config, skillReviewPending]
|
|
42781
43060
|
);
|
|
42782
|
-
const rejectPendingSkill = (0,
|
|
43061
|
+
const rejectPendingSkill = (0, import_react164.useCallback)(
|
|
42783
43062
|
(skillName) => {
|
|
42784
43063
|
if (!skillReviewPending) return;
|
|
42785
43064
|
void config.getMemoryManager().rejectPendingSkillFromTask(skillReviewPending.taskId, skillName).catch(() => {
|
|
@@ -42787,7 +43066,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42787
43066
|
},
|
|
42788
43067
|
[config, skillReviewPending]
|
|
42789
43068
|
);
|
|
42790
|
-
(0,
|
|
43069
|
+
(0, import_react164.useEffect)(() => {
|
|
42791
43070
|
const mgr = config.getMemoryManager();
|
|
42792
43071
|
const projectRoot = config.getProjectRoot();
|
|
42793
43072
|
let lastSig = "";
|
|
@@ -42821,7 +43100,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42821
43100
|
refresh();
|
|
42822
43101
|
return unsub;
|
|
42823
43102
|
}, [config]);
|
|
42824
|
-
const slashCommandActions = (0,
|
|
43103
|
+
const slashCommandActions = (0, import_react164.useMemo)(
|
|
42825
43104
|
() => ({
|
|
42826
43105
|
openAuthDialog,
|
|
42827
43106
|
openThemeDialog,
|
|
@@ -42845,7 +43124,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42845
43124
|
config.getGeminiClient()?.requestShutdown();
|
|
42846
43125
|
setTimeout(async () => {
|
|
42847
43126
|
await runExitCleanup();
|
|
42848
|
-
|
|
43127
|
+
process17.exit(0);
|
|
42849
43128
|
}, 100);
|
|
42850
43129
|
}, "quit"),
|
|
42851
43130
|
setDebugMessage,
|
|
@@ -42931,13 +43210,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42931
43210
|
setSessionName,
|
|
42932
43211
|
extensionRefreshState
|
|
42933
43212
|
);
|
|
42934
|
-
const onDebugMessage = (0,
|
|
43213
|
+
const onDebugMessage = (0, import_react164.useCallback)(
|
|
42935
43214
|
(message) => {
|
|
42936
43215
|
config.getDebugLogger().debug(message);
|
|
42937
43216
|
},
|
|
42938
43217
|
[config]
|
|
42939
43218
|
);
|
|
42940
|
-
const handleWorktreeExit = (0,
|
|
43219
|
+
const handleWorktreeExit = (0, import_react164.useCallback)(
|
|
42941
43220
|
async (choice) => {
|
|
42942
43221
|
if (choice === "cancel") {
|
|
42943
43222
|
setShowWorktreeExitDialog(false);
|
|
@@ -43002,7 +43281,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43002
43281
|
},
|
|
43003
43282
|
[activeWorktree, config, handleSlashCommand, historyManager]
|
|
43004
43283
|
);
|
|
43005
|
-
const performMemoryRefresh = (0,
|
|
43284
|
+
const performMemoryRefresh = (0, import_react164.useCallback)(async () => {
|
|
43006
43285
|
if (config.isSafeMode()) {
|
|
43007
43286
|
config.setUserMemory("");
|
|
43008
43287
|
config.setGeminiMdFileCount(0);
|
|
@@ -43028,7 +43307,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43028
43307
|
);
|
|
43029
43308
|
try {
|
|
43030
43309
|
const { memoryContent, fileCount, conditionalRules, projectRoot } = await loadHierarchicalGeminiMemory(
|
|
43031
|
-
|
|
43310
|
+
process17.cwd(),
|
|
43032
43311
|
settings.merged.context?.loadFromIncludeDirectories ? config.getWorkspaceContext().getDirectories() : [],
|
|
43033
43312
|
config.getFileService(),
|
|
43034
43313
|
config.getExtensionContextFilePaths(),
|
|
@@ -43074,10 +43353,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43074
43353
|
debugLogger40.error("Error refreshing memory:", error);
|
|
43075
43354
|
}
|
|
43076
43355
|
}, [config, historyManager, settings.merged]);
|
|
43077
|
-
const cancelHandlerRef = (0,
|
|
43356
|
+
const cancelHandlerRef = (0, import_react164.useRef)(() => {
|
|
43078
43357
|
});
|
|
43079
|
-
const midTurnDrainRef = (0,
|
|
43080
|
-
const midTurnRestoreRef = (0,
|
|
43358
|
+
const midTurnDrainRef = (0, import_react164.useRef)(null);
|
|
43359
|
+
const midTurnRestoreRef = (0, import_react164.useRef)(null);
|
|
43081
43360
|
const {
|
|
43082
43361
|
streamingState,
|
|
43083
43362
|
submitQuery,
|
|
@@ -43120,13 +43399,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43120
43399
|
);
|
|
43121
43400
|
cancelOngoingRequestRef.current = cancelOngoingRequest;
|
|
43122
43401
|
isIdleRef.current = streamingState === "idle" /* Idle */;
|
|
43123
|
-
(0,
|
|
43402
|
+
(0, import_react164.useEffect)(() => {
|
|
43124
43403
|
if (streamingState === "idle" /* Idle */) {
|
|
43125
43404
|
updateHandlerRef.current?.flush();
|
|
43126
43405
|
setWorkflowKeywordActive(false);
|
|
43127
43406
|
}
|
|
43128
43407
|
}, [streamingState]);
|
|
43129
|
-
(0,
|
|
43408
|
+
(0, import_react164.useEffect)(() => {
|
|
43130
43409
|
if (shouldAutoOpenSkillReview({
|
|
43131
43410
|
pending: skillReviewPending,
|
|
43132
43411
|
streamingState,
|
|
@@ -43138,7 +43417,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43138
43417
|
}
|
|
43139
43418
|
}, [skillReviewPending, streamingState, isMemoryDialogOpen, config]);
|
|
43140
43419
|
const tipsDisabled = !!(settings.merged.ui?.hideTips || config.getScreenReader());
|
|
43141
|
-
const tipHistory = (0,
|
|
43420
|
+
const tipHistory = (0, import_react164.useMemo)(
|
|
43142
43421
|
() => tipsDisabled ? null : getTipHistory(),
|
|
43143
43422
|
[tipsDisabled]
|
|
43144
43423
|
);
|
|
@@ -43151,7 +43430,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43151
43430
|
addItem: historyManager.addItem,
|
|
43152
43431
|
hideTips: tipsDisabled
|
|
43153
43432
|
});
|
|
43154
|
-
const [hasTabConsumer, setHasTabConsumer] = (0,
|
|
43433
|
+
const [hasTabConsumer, setHasTabConsumer] = (0, import_react164.useState)(false);
|
|
43155
43434
|
const agentViewState = useAgentViewState();
|
|
43156
43435
|
const {
|
|
43157
43436
|
dialogOpen: bgTasksDialogOpen,
|
|
@@ -43159,11 +43438,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43159
43438
|
livePanelFocused: bgLivePanelFocused
|
|
43160
43439
|
} = useBackgroundTaskViewState();
|
|
43161
43440
|
const { closeDialog: closeBgTasksDialog } = useBackgroundTaskViewActions();
|
|
43162
|
-
const [promptSuggestion, setPromptSuggestion] = (0,
|
|
43163
|
-
const prevStreamingStateRef = (0,
|
|
43164
|
-
const speculationRef = (0,
|
|
43165
|
-
const suggestionAbortRef = (0,
|
|
43166
|
-
const abortPromptSuggestion = (0,
|
|
43441
|
+
const [promptSuggestion, setPromptSuggestion] = (0, import_react164.useState)(null);
|
|
43442
|
+
const prevStreamingStateRef = (0, import_react164.useRef)("idle" /* Idle */);
|
|
43443
|
+
const speculationRef = (0, import_react164.useRef)(IDLE_SPECULATION);
|
|
43444
|
+
const suggestionAbortRef = (0, import_react164.useRef)(null);
|
|
43445
|
+
const abortPromptSuggestion = (0, import_react164.useCallback)(() => {
|
|
43167
43446
|
suggestionAbortRef.current?.abort();
|
|
43168
43447
|
suggestionAbortRef.current = null;
|
|
43169
43448
|
if (speculationRef.current.status !== "idle") {
|
|
@@ -43187,26 +43466,42 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43187
43466
|
popAllMessages,
|
|
43188
43467
|
restoreMessages,
|
|
43189
43468
|
drainQueue,
|
|
43190
|
-
|
|
43469
|
+
popNextTurn
|
|
43191
43470
|
} = useMessageQueue();
|
|
43471
|
+
const submitUserQuery = (0, import_react164.useCallback)(
|
|
43472
|
+
(submission) => submitQuery(
|
|
43473
|
+
submission.modelText,
|
|
43474
|
+
"userQuery" /* UserQuery */,
|
|
43475
|
+
void 0,
|
|
43476
|
+
submission.submittedPrompt === void 0 ? void 0 : { submittedPrompt: submission.submittedPrompt }
|
|
43477
|
+
),
|
|
43478
|
+
[submitQuery]
|
|
43479
|
+
);
|
|
43480
|
+
const popAllQueuedMessages = (0, import_react164.useCallback)(() => {
|
|
43481
|
+
const submission = popAllMessages();
|
|
43482
|
+
if (submission === null) return null;
|
|
43483
|
+
restoredSubmissionRef.current = submission;
|
|
43484
|
+
submittedPromptProvenanceUnavailableRef.current = false;
|
|
43485
|
+
return submission.modelText;
|
|
43486
|
+
}, [popAllMessages]);
|
|
43192
43487
|
midTurnDrainRef.current = drainQueue;
|
|
43193
43488
|
midTurnRestoreRef.current = restoreMessages;
|
|
43194
43489
|
const remoteInput = useRemoteInput();
|
|
43195
|
-
(0,
|
|
43490
|
+
(0, import_react164.useEffect)(() => {
|
|
43196
43491
|
if (!remoteInput) return;
|
|
43197
43492
|
remoteInput.setSubmitFn((text) => submitQuery(text));
|
|
43198
43493
|
}, [remoteInput, submitQuery]);
|
|
43199
|
-
(0,
|
|
43494
|
+
(0, import_react164.useEffect)(() => {
|
|
43200
43495
|
if (!remoteInput) return;
|
|
43201
43496
|
if (streamingState === "idle" /* Idle */) {
|
|
43202
43497
|
remoteInput.notifyIdle();
|
|
43203
43498
|
}
|
|
43204
43499
|
}, [remoteInput, streamingState]);
|
|
43205
43500
|
const dualOutput = useDualOutput();
|
|
43206
|
-
const confirmRequestMap = (0,
|
|
43207
|
-
const confirmCallIdMap = (0,
|
|
43208
|
-
const confirmEmitted = (0,
|
|
43209
|
-
(0,
|
|
43501
|
+
const confirmRequestMap = (0, import_react164.useRef)(/* @__PURE__ */ new Map());
|
|
43502
|
+
const confirmCallIdMap = (0, import_react164.useRef)(/* @__PURE__ */ new Map());
|
|
43503
|
+
const confirmEmitted = (0, import_react164.useRef)(/* @__PURE__ */ new Set());
|
|
43504
|
+
(0, import_react164.useEffect)(() => {
|
|
43210
43505
|
if (!dualOutput || !dualOutput.isConnected) return;
|
|
43211
43506
|
for (const tc of pendingToolCalls) {
|
|
43212
43507
|
if (tc.status === "awaiting_approval" && !confirmEmitted.current.has(tc.request.callId)) {
|
|
@@ -43235,11 +43530,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43235
43530
|
}
|
|
43236
43531
|
}
|
|
43237
43532
|
}, [dualOutput, pendingToolCalls]);
|
|
43238
|
-
const pendingToolCallsRef = (0,
|
|
43533
|
+
const pendingToolCallsRef = (0, import_react164.useRef)(pendingToolCalls);
|
|
43239
43534
|
pendingToolCallsRef.current = pendingToolCalls;
|
|
43240
|
-
const dualOutputRef = (0,
|
|
43535
|
+
const dualOutputRef = (0, import_react164.useRef)(dualOutput);
|
|
43241
43536
|
dualOutputRef.current = dualOutput;
|
|
43242
|
-
(0,
|
|
43537
|
+
(0, import_react164.useEffect)(() => {
|
|
43243
43538
|
if (!remoteInput) return;
|
|
43244
43539
|
remoteInput.setConfirmationHandler(
|
|
43245
43540
|
(requestId, allowed) => {
|
|
@@ -43279,8 +43574,22 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43279
43574
|
});
|
|
43280
43575
|
};
|
|
43281
43576
|
}, [remoteInput]);
|
|
43282
|
-
const handleFinalSubmit = (0,
|
|
43577
|
+
const handleFinalSubmit = (0, import_react164.useCallback)(
|
|
43283
43578
|
(submittedValue, options) => {
|
|
43579
|
+
const consumesComposerState = options !== void 0;
|
|
43580
|
+
const restoredSubmission = consumesComposerState ? restoredSubmissionRef.current : null;
|
|
43581
|
+
const submittedPromptProvenanceUnavailable = consumesComposerState && submittedPromptProvenanceUnavailableRef.current;
|
|
43582
|
+
if (consumesComposerState) {
|
|
43583
|
+
restoredSubmissionRef.current = null;
|
|
43584
|
+
submittedPromptProvenanceUnavailableRef.current = false;
|
|
43585
|
+
}
|
|
43586
|
+
const submittedPromptCandidate = options?.submittedPrompt;
|
|
43587
|
+
const provenanceEnabled = !vimEnabled && submittedPromptCandidate !== void 0;
|
|
43588
|
+
const trimmedSubmittedPrompt = submittedPromptCandidate?.trim();
|
|
43589
|
+
const submittedPrompt = submittedPromptProvenanceUnavailable || !provenanceEnabled ? void 0 : restoredSubmission === null ? trimmedSubmittedPrompt || void 0 : restoredSubmission.modelText === submittedValue ? restoredSubmission.submittedPrompt : void 0;
|
|
43590
|
+
if (restoredSubmission !== null || submittedPromptProvenanceUnavailable) {
|
|
43591
|
+
setBufferText("", { clearUndoHistory: true });
|
|
43592
|
+
}
|
|
43284
43593
|
if (agentViewState.activeView !== "main") {
|
|
43285
43594
|
const agent = agentViewState.agents.get(agentViewState.activeView);
|
|
43286
43595
|
if (agent) {
|
|
@@ -43326,11 +43635,14 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43326
43635
|
` + submittedValue;
|
|
43327
43636
|
}
|
|
43328
43637
|
if (options?.deferUntilIdle) {
|
|
43329
|
-
addMessage(submittedValue, true);
|
|
43638
|
+
addMessage(submittedValue, true, submittedPrompt);
|
|
43330
43639
|
return;
|
|
43331
43640
|
}
|
|
43332
43641
|
if (streamingState === "responding" /* Responding */ && isBtwCommand(submittedValue)) {
|
|
43333
|
-
void
|
|
43642
|
+
void submitUserQuery({
|
|
43643
|
+
modelText: submittedValue,
|
|
43644
|
+
submittedPrompt
|
|
43645
|
+
});
|
|
43334
43646
|
return;
|
|
43335
43647
|
}
|
|
43336
43648
|
const spec = speculationRef.current;
|
|
@@ -43404,7 +43716,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43404
43716
|
setPromptSuggestion(result.nextSuggestion);
|
|
43405
43717
|
}
|
|
43406
43718
|
}).catch(() => {
|
|
43407
|
-
addMessage(submittedValue);
|
|
43719
|
+
addMessage(submittedValue, false, submittedPrompt);
|
|
43408
43720
|
});
|
|
43409
43721
|
speculationRef.current = IDLE_SPECULATION;
|
|
43410
43722
|
return;
|
|
@@ -43415,25 +43727,30 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43415
43727
|
speculationRef.current = IDLE_SPECULATION;
|
|
43416
43728
|
}
|
|
43417
43729
|
if (streamingState === "idle" /* Idle */ && !isProcessing && isSlashCommand(submittedValue)) {
|
|
43418
|
-
void
|
|
43730
|
+
void submitUserQuery({
|
|
43731
|
+
modelText: submittedValue,
|
|
43732
|
+
submittedPrompt
|
|
43733
|
+
});
|
|
43419
43734
|
return;
|
|
43420
43735
|
}
|
|
43421
|
-
addMessage(submittedValue);
|
|
43736
|
+
addMessage(submittedValue, false, submittedPrompt);
|
|
43422
43737
|
},
|
|
43423
43738
|
[
|
|
43424
43739
|
addMessage,
|
|
43425
43740
|
agentViewState,
|
|
43426
43741
|
streamingState,
|
|
43427
43742
|
isProcessing,
|
|
43428
|
-
|
|
43743
|
+
submitUserQuery,
|
|
43429
43744
|
handleSlashCommand,
|
|
43430
43745
|
config,
|
|
43431
43746
|
geminiClient,
|
|
43432
43747
|
historyManager,
|
|
43433
|
-
settings.merged.ui?.disableWorkflowKeywordTrigger
|
|
43748
|
+
settings.merged.ui?.disableWorkflowKeywordTrigger,
|
|
43749
|
+
setBufferText,
|
|
43750
|
+
vimEnabled
|
|
43434
43751
|
]
|
|
43435
43752
|
);
|
|
43436
|
-
const handleArenaModelsSelected = (0,
|
|
43753
|
+
const handleArenaModelsSelected = (0, import_react164.useCallback)(
|
|
43437
43754
|
(models) => {
|
|
43438
43755
|
const value = models.join(",");
|
|
43439
43756
|
buffer.setText(`/arena start --models ${value} `);
|
|
@@ -43448,15 +43765,15 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43448
43765
|
handleWelcomeBackSelection,
|
|
43449
43766
|
handleWelcomeBackClose
|
|
43450
43767
|
} = useWelcomeBack(config, handleFinalSubmit, buffer, settings.merged);
|
|
43451
|
-
const pendingHistoryItems = (0,
|
|
43768
|
+
const pendingHistoryItems = (0, import_react164.useMemo)(
|
|
43452
43769
|
() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
|
|
43453
43770
|
[pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]
|
|
43454
43771
|
);
|
|
43455
|
-
const historyForTranscriptRef = (0,
|
|
43772
|
+
const historyForTranscriptRef = (0, import_react164.useRef)(historyManager.history);
|
|
43456
43773
|
historyForTranscriptRef.current = historyManager.history;
|
|
43457
|
-
const pendingForTranscriptRef = (0,
|
|
43774
|
+
const pendingForTranscriptRef = (0, import_react164.useRef)(pendingHistoryItems);
|
|
43458
43775
|
pendingForTranscriptRef.current = pendingHistoryItems;
|
|
43459
|
-
const openTranscript = (0,
|
|
43776
|
+
const openTranscript = (0, import_react164.useCallback)(() => {
|
|
43460
43777
|
setTranscriptFreeze({
|
|
43461
43778
|
// Share MainContent's visibility predicate so the transcript shows exactly
|
|
43462
43779
|
// what the main view shows. Items collapsed on session resume
|
|
@@ -43468,7 +43785,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43468
43785
|
pendingItems: [...pendingForTranscriptRef.current]
|
|
43469
43786
|
});
|
|
43470
43787
|
}, []);
|
|
43471
|
-
const transcriptItems = (0,
|
|
43788
|
+
const transcriptItems = (0, import_react164.useMemo)(() => {
|
|
43472
43789
|
if (!transcriptFreeze) return EMPTY_HISTORY_ITEMS;
|
|
43473
43790
|
return [
|
|
43474
43791
|
...transcriptFreeze.committedItems,
|
|
@@ -43480,7 +43797,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43480
43797
|
}))
|
|
43481
43798
|
];
|
|
43482
43799
|
}, [transcriptFreeze]);
|
|
43483
|
-
const rawStickyTodos = (0,
|
|
43800
|
+
const rawStickyTodos = (0, import_react164.useMemo)(
|
|
43484
43801
|
() => getStickyTodos(historyManager.history, pendingHistoryItems),
|
|
43485
43802
|
[historyManager.history, pendingHistoryItems]
|
|
43486
43803
|
);
|
|
@@ -43488,7 +43805,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43488
43805
|
const hasExecutingTool = isToolExecuting(pendingHistoryItems);
|
|
43489
43806
|
const hasPendingCompression = isCompressionPending(pendingHistoryItems);
|
|
43490
43807
|
useTerminalProgress(streamingState, hasExecutingTool);
|
|
43491
|
-
cancelHandlerRef.current = (0,
|
|
43808
|
+
cancelHandlerRef.current = (0, import_react164.useCallback)(
|
|
43492
43809
|
(info) => {
|
|
43493
43810
|
const pendingHistoryItems2 = [
|
|
43494
43811
|
...pendingSlashCommandHistoryItems,
|
|
@@ -43500,9 +43817,13 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43500
43817
|
const draftWasEmpty = buffer.text.length === 0;
|
|
43501
43818
|
const popped = popAllMessages();
|
|
43502
43819
|
if (popped) {
|
|
43820
|
+
restoredSubmissionRef.current = popped;
|
|
43821
|
+
submittedPromptProvenanceUnavailableRef.current = false;
|
|
43503
43822
|
const currentText = buffer.text;
|
|
43504
|
-
buffer.setText(
|
|
43505
|
-
|
|
43823
|
+
buffer.setText(
|
|
43824
|
+
currentText ? `${popped.modelText}
|
|
43825
|
+
${currentText}` : popped.modelText
|
|
43826
|
+
);
|
|
43506
43827
|
}
|
|
43507
43828
|
if (!draftWasEmpty) {
|
|
43508
43829
|
debugLogger40.debug("auto-restore bail: buffer was non-empty");
|
|
@@ -43521,6 +43842,14 @@ ${currentText}` : popped);
|
|
|
43521
43842
|
);
|
|
43522
43843
|
return;
|
|
43523
43844
|
}
|
|
43845
|
+
const restoreCancelledPrompt = /* @__PURE__ */ __name(() => {
|
|
43846
|
+
restoredSubmissionRef.current = {
|
|
43847
|
+
modelText: cancelledTurnUserItem.text,
|
|
43848
|
+
...cancelledTurnUserItem.submittedPrompt === void 0 ? {} : { submittedPrompt: cancelledTurnUserItem.submittedPrompt }
|
|
43849
|
+
};
|
|
43850
|
+
submittedPromptProvenanceUnavailableRef.current = false;
|
|
43851
|
+
buffer.setText(cancelledTurnUserItem.text);
|
|
43852
|
+
}, "restoreCancelledPrompt");
|
|
43524
43853
|
if (pendingHistoryItems2.some((item) => item.type === "tool_group")) {
|
|
43525
43854
|
debugLogger40.debug(
|
|
43526
43855
|
"auto-restore bail: tool execution is pending or committed"
|
|
@@ -43531,7 +43860,7 @@ ${currentText}` : popped);
|
|
|
43531
43860
|
debugLogger40.debug(
|
|
43532
43861
|
"auto-restore: preserving streamed output and restoring prompt text"
|
|
43533
43862
|
);
|
|
43534
|
-
|
|
43863
|
+
restoreCancelledPrompt();
|
|
43535
43864
|
return;
|
|
43536
43865
|
}
|
|
43537
43866
|
if (pendingHistoryItems2.some((item) => !isSyntheticHistoryItem(item))) {
|
|
@@ -43550,7 +43879,7 @@ ${currentText}` : popped);
|
|
|
43550
43879
|
debugLogger40.debug(
|
|
43551
43880
|
"auto-restore: preserving committed output and restoring prompt text"
|
|
43552
43881
|
);
|
|
43553
|
-
|
|
43882
|
+
restoreCancelledPrompt();
|
|
43554
43883
|
return;
|
|
43555
43884
|
}
|
|
43556
43885
|
const lastUserItem = history[lastUserIdx];
|
|
@@ -43571,11 +43900,13 @@ ${currentText}` : popped);
|
|
|
43571
43900
|
);
|
|
43572
43901
|
historyManager.truncateToItem(lastUserItem.id);
|
|
43573
43902
|
refreshStatic();
|
|
43574
|
-
|
|
43903
|
+
restoreCancelledPrompt();
|
|
43575
43904
|
geminiClient?.stripOrphanedUserEntriesFromHistory?.();
|
|
43576
|
-
|
|
43577
|
-
|
|
43578
|
-
|
|
43905
|
+
if (info?.canUndoLastLoggedUserMessage) {
|
|
43906
|
+
void logger?.removeLastUserMessage().catch((err) => {
|
|
43907
|
+
debugLogger40.debug("Failed to undo cancelled prompt from log:", err);
|
|
43908
|
+
});
|
|
43909
|
+
}
|
|
43579
43910
|
},
|
|
43580
43911
|
[
|
|
43581
43912
|
buffer,
|
|
@@ -43588,7 +43919,7 @@ ${currentText}` : popped);
|
|
|
43588
43919
|
pendingGeminiHistoryItems
|
|
43589
43920
|
]
|
|
43590
43921
|
);
|
|
43591
|
-
const handleClearScreen = (0,
|
|
43922
|
+
const handleClearScreen = (0, import_react164.useCallback)(() => {
|
|
43592
43923
|
historyManager.clearItems();
|
|
43593
43924
|
clearScreen();
|
|
43594
43925
|
remountStaticHistory();
|
|
@@ -43611,13 +43942,13 @@ ${currentText}` : popped);
|
|
|
43611
43942
|
history: historyManager.history,
|
|
43612
43943
|
awayThresholdMinutes: settings.merged.general?.sessionRecapAwayThresholdMinutes
|
|
43613
43944
|
});
|
|
43614
|
-
const contextFileNames = (0,
|
|
43945
|
+
const contextFileNames = (0, import_react164.useMemo)(() => {
|
|
43615
43946
|
const fromSettings = settings.merged.context?.fileName;
|
|
43616
43947
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllGeminiMdFilenames();
|
|
43617
43948
|
}, [settings.merged.context?.fileName]);
|
|
43618
|
-
const initialPrompt = (0,
|
|
43619
|
-
const initialPromptSubmitted = (0,
|
|
43620
|
-
(0,
|
|
43949
|
+
const initialPrompt = (0, import_react164.useMemo)(() => config.getQuestion(), [config]);
|
|
43950
|
+
const initialPromptSubmitted = (0, import_react164.useRef)(false);
|
|
43951
|
+
(0, import_react164.useEffect)(() => {
|
|
43621
43952
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && welcomeBackChoice !== "restart" && geminiClient?.isInitialized?.()) {
|
|
43622
43953
|
handleFinalSubmit(initialPrompt);
|
|
43623
43954
|
initialPromptSubmitted.current = true;
|
|
@@ -43635,7 +43966,7 @@ ${currentText}` : popped);
|
|
|
43635
43966
|
geminiClient
|
|
43636
43967
|
]);
|
|
43637
43968
|
const followupSuggestionsEnabled = settings.merged.ui?.enableFollowupSuggestions !== false;
|
|
43638
|
-
(0,
|
|
43969
|
+
(0, import_react164.useEffect)(() => {
|
|
43639
43970
|
if (!followupSuggestionsEnabled) {
|
|
43640
43971
|
suggestionAbortRef.current?.abort();
|
|
43641
43972
|
setPromptSuggestion(null);
|
|
@@ -43704,17 +44035,17 @@ ${currentText}` : popped);
|
|
|
43704
44035
|
isPermissionsDialogOpen,
|
|
43705
44036
|
settingInputRequests
|
|
43706
44037
|
]);
|
|
43707
|
-
(0,
|
|
44038
|
+
(0, import_react164.useEffect)(() => {
|
|
43708
44039
|
if (!promptSuggestion && speculationRef.current.status !== "idle") {
|
|
43709
44040
|
abortSpeculation(speculationRef.current).catch(() => {
|
|
43710
44041
|
});
|
|
43711
44042
|
speculationRef.current = IDLE_SPECULATION;
|
|
43712
44043
|
}
|
|
43713
44044
|
}, [promptSuggestion]);
|
|
43714
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
43715
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
43716
|
-
const [startupIdeConnectionStatus, setStartupIdeConnectionStatus] = (0,
|
|
43717
|
-
(0,
|
|
44045
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react164.useState)(false);
|
|
44046
|
+
const [currentIDE, setCurrentIDE] = (0, import_react164.useState)(null);
|
|
44047
|
+
const [startupIdeConnectionStatus, setStartupIdeConnectionStatus] = (0, import_react164.useState)({ state: "idle" });
|
|
44048
|
+
(0, import_react164.useEffect)(() => {
|
|
43718
44049
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
43719
44050
|
const ideClient = await IdeClient.getInstance();
|
|
43720
44051
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -43730,40 +44061,40 @@ ${currentText}` : popped);
|
|
|
43730
44061
|
tomlFiles: commandMigrationTomlFiles,
|
|
43731
44062
|
setShowMigrationNudge: setShowCommandMigrationNudge
|
|
43732
44063
|
} = useCommandMigration(settings, config.storage);
|
|
43733
|
-
const [showToolDescriptions, setShowToolDescriptions] = (0,
|
|
44064
|
+
const [showToolDescriptions, setShowToolDescriptions] = (0, import_react164.useState)(false);
|
|
43734
44065
|
const configuredRenderMode = settings.merged.ui?.renderMode;
|
|
43735
|
-
const [renderMode, setRenderMode] = (0,
|
|
44066
|
+
const [renderMode, setRenderMode] = (0, import_react164.useState)(
|
|
43736
44067
|
configuredRenderMode === "raw" ? "raw" : "render"
|
|
43737
44068
|
);
|
|
43738
|
-
const renderModeConfigMountedRef = (0,
|
|
43739
|
-
(0,
|
|
44069
|
+
const renderModeConfigMountedRef = (0, import_react164.useRef)(false);
|
|
44070
|
+
(0, import_react164.useEffect)(() => {
|
|
43740
44071
|
if (!renderModeConfigMountedRef.current) {
|
|
43741
44072
|
renderModeConfigMountedRef.current = true;
|
|
43742
44073
|
return;
|
|
43743
44074
|
}
|
|
43744
44075
|
setRenderMode(configuredRenderMode === "raw" ? "raw" : "render");
|
|
43745
44076
|
}, [configuredRenderMode]);
|
|
43746
|
-
const renderModeMountedRef = (0,
|
|
43747
|
-
(0,
|
|
44077
|
+
const renderModeMountedRef = (0, import_react164.useRef)(false);
|
|
44078
|
+
(0, import_react164.useEffect)(() => {
|
|
43748
44079
|
if (!renderModeMountedRef.current) {
|
|
43749
44080
|
renderModeMountedRef.current = true;
|
|
43750
44081
|
return;
|
|
43751
44082
|
}
|
|
43752
44083
|
refreshStatic();
|
|
43753
44084
|
}, [renderMode, refreshStatic]);
|
|
43754
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0,
|
|
43755
|
-
const ctrlCTimerRef = (0,
|
|
43756
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0,
|
|
43757
|
-
const ctrlDTimerRef = (0,
|
|
43758
|
-
const [escapePressedOnce, setEscapePressedOnce] = (0,
|
|
43759
|
-
const escapeTimerRef = (0,
|
|
43760
|
-
const dialogsVisibleRef = (0,
|
|
43761
|
-
const [isRewindSelectorOpen, setIsRewindSelectorOpen] = (0,
|
|
43762
|
-
const [rewindEscPending, setRewindEscPending] = (0,
|
|
43763
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
43764
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
43765
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
43766
|
-
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0,
|
|
44085
|
+
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0, import_react164.useState)(false);
|
|
44086
|
+
const ctrlCTimerRef = (0, import_react164.useRef)(null);
|
|
44087
|
+
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0, import_react164.useState)(false);
|
|
44088
|
+
const ctrlDTimerRef = (0, import_react164.useRef)(null);
|
|
44089
|
+
const [escapePressedOnce, setEscapePressedOnce] = (0, import_react164.useState)(false);
|
|
44090
|
+
const escapeTimerRef = (0, import_react164.useRef)(null);
|
|
44091
|
+
const dialogsVisibleRef = (0, import_react164.useRef)(false);
|
|
44092
|
+
const [isRewindSelectorOpen, setIsRewindSelectorOpen] = (0, import_react164.useState)(false);
|
|
44093
|
+
const [rewindEscPending, setRewindEscPending] = (0, import_react164.useState)(false);
|
|
44094
|
+
const [constrainHeight, setConstrainHeight] = (0, import_react164.useState)(true);
|
|
44095
|
+
const [ideContextState, setIdeContextState] = (0, import_react164.useState)();
|
|
44096
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react164.useState)(false);
|
|
44097
|
+
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react164.useState)(false);
|
|
43767
44098
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings, setIsTrustedFolder);
|
|
43768
44099
|
const {
|
|
43769
44100
|
isMcpApprovalDialogOpen,
|
|
@@ -43792,7 +44123,7 @@ ${currentText}` : popped);
|
|
|
43792
44123
|
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);
|
|
43793
44124
|
dialogsVisibleRef.current = dialogsVisible;
|
|
43794
44125
|
const needsBlockingInput = dialogsVisible || streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
43795
|
-
(0,
|
|
44126
|
+
(0, import_react164.useEffect)(() => {
|
|
43796
44127
|
if (needsBlockingInput && isTranscriptOpen) {
|
|
43797
44128
|
closeTranscript();
|
|
43798
44129
|
}
|
|
@@ -43808,12 +44139,12 @@ ${currentText}` : popped);
|
|
|
43808
44139
|
stickyTodoWidth,
|
|
43809
44140
|
stickyTodoMaxVisibleItems
|
|
43810
44141
|
) : "hidden";
|
|
43811
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
44142
|
+
const [controlsHeight, setControlsHeight] = (0, import_react164.useState)(0);
|
|
43812
44143
|
const liveAgentPanelLayoutKey = getLiveAgentPanelLayoutKey(
|
|
43813
44144
|
bgTaskEntries,
|
|
43814
44145
|
bgLivePanelFocused
|
|
43815
44146
|
);
|
|
43816
|
-
(0,
|
|
44147
|
+
(0, import_react164.useLayoutEffect)(() => {
|
|
43817
44148
|
if (!mainControlsRef.current) {
|
|
43818
44149
|
setControlsHeight(
|
|
43819
44150
|
(previousHeight) => previousHeight === 0 ? previousHeight : 0
|
|
@@ -43860,7 +44191,7 @@ ${currentText}` : popped);
|
|
|
43860
44191
|
pager: settings.merged.tools?.shell?.pager,
|
|
43861
44192
|
showColor: settings.merged.tools?.shell?.showColor
|
|
43862
44193
|
});
|
|
43863
|
-
(0,
|
|
44194
|
+
(0, import_react164.useEffect)(() => {
|
|
43864
44195
|
if (activePtyId) {
|
|
43865
44196
|
ShellExecutionService.resizePty(
|
|
43866
44197
|
activePtyId,
|
|
@@ -43869,19 +44200,18 @@ ${currentText}` : popped);
|
|
|
43869
44200
|
);
|
|
43870
44201
|
}
|
|
43871
44202
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
43872
|
-
useResizeSettleRepaint(terminalWidth, refreshStatic);
|
|
43873
44203
|
useWakeRepaint(refreshStatic);
|
|
43874
|
-
(0,
|
|
44204
|
+
(0, import_react164.useEffect)(() => {
|
|
43875
44205
|
if (ideNeedsRestart) {
|
|
43876
44206
|
setShowIdeRestartPrompt(true);
|
|
43877
44207
|
}
|
|
43878
44208
|
}, [ideNeedsRestart]);
|
|
43879
|
-
(0,
|
|
44209
|
+
(0, import_react164.useEffect)(() => {
|
|
43880
44210
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
43881
44211
|
setIdeContextState(ideContextStore.get());
|
|
43882
44212
|
return unsubscribe;
|
|
43883
44213
|
}, []);
|
|
43884
|
-
(0,
|
|
44214
|
+
(0, import_react164.useEffect)(() => {
|
|
43885
44215
|
const listener = /* @__PURE__ */ __name((status) => {
|
|
43886
44216
|
setStartupIdeConnectionStatus(status);
|
|
43887
44217
|
}, "listener");
|
|
@@ -43890,10 +44220,10 @@ ${currentText}` : popped);
|
|
|
43890
44220
|
appEvents.off("startup-ide-connection-status-changed" /* StartupIdeConnectionStatusChanged */, listener);
|
|
43891
44221
|
};
|
|
43892
44222
|
}, []);
|
|
43893
|
-
const handleEscapePromptChange = (0,
|
|
44223
|
+
const handleEscapePromptChange = (0, import_react164.useCallback)((showPrompt) => {
|
|
43894
44224
|
setShowEscapePrompt(showPrompt);
|
|
43895
44225
|
}, []);
|
|
43896
|
-
const openRewindSelector = (0,
|
|
44226
|
+
const openRewindSelector = (0, import_react164.useCallback)(() => {
|
|
43897
44227
|
if (streamingState !== "idle" /* Idle */) return;
|
|
43898
44228
|
if (dialogsVisibleRef.current) return;
|
|
43899
44229
|
if (config.getIdeMode()) {
|
|
@@ -43911,10 +44241,10 @@ ${currentText}` : popped);
|
|
|
43911
44241
|
setIsRewindSelectorOpen(true);
|
|
43912
44242
|
}, [streamingState, config, historyManager]);
|
|
43913
44243
|
openRewindSelectorRef.current = openRewindSelector;
|
|
43914
|
-
const closeRewindSelector = (0,
|
|
44244
|
+
const closeRewindSelector = (0, import_react164.useCallback)(() => {
|
|
43915
44245
|
setIsRewindSelectorOpen(false);
|
|
43916
44246
|
}, []);
|
|
43917
|
-
const handleRewindConfirm = (0,
|
|
44247
|
+
const handleRewindConfirm = (0, import_react164.useCallback)(
|
|
43918
44248
|
async (userItem, option) => {
|
|
43919
44249
|
try {
|
|
43920
44250
|
const needsConversation = option === "conversation" || option === "both";
|
|
@@ -44016,6 +44346,8 @@ ${currentText}` : popped);
|
|
|
44016
44346
|
historyManager.loadHistory(truncatedUi);
|
|
44017
44347
|
refreshStatic();
|
|
44018
44348
|
if (userItem.type === "user" && userItem.text) {
|
|
44349
|
+
restoredSubmissionRef.current = null;
|
|
44350
|
+
submittedPromptProvenanceUnavailableRef.current = true;
|
|
44019
44351
|
buffer.setText(userItem.text);
|
|
44020
44352
|
}
|
|
44021
44353
|
historyManager.addItem(
|
|
@@ -44076,7 +44408,7 @@ ${currentText}` : popped);
|
|
|
44076
44408
|
openRewindSelector,
|
|
44077
44409
|
(pending) => setRewindEscPending(pending)
|
|
44078
44410
|
);
|
|
44079
|
-
const handleIdePromptComplete = (0,
|
|
44411
|
+
const handleIdePromptComplete = (0, import_react164.useCallback)(
|
|
44080
44412
|
(result) => {
|
|
44081
44413
|
if (result.userSelection === "yes") {
|
|
44082
44414
|
if (result.isExtensionPreInstalled) {
|
|
@@ -44092,7 +44424,7 @@ ${currentText}` : popped);
|
|
|
44092
44424
|
},
|
|
44093
44425
|
[handleSlashCommand, settings]
|
|
44094
44426
|
);
|
|
44095
|
-
const handleCommandMigrationComplete = (0,
|
|
44427
|
+
const handleCommandMigrationComplete = (0, import_react164.useCallback)(
|
|
44096
44428
|
async (result) => {
|
|
44097
44429
|
setShowCommandMigrationNudge(false);
|
|
44098
44430
|
if (result.userSelection === "yes") {
|
|
@@ -44184,7 +44516,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44184
44516
|
pendingToolCalls
|
|
44185
44517
|
});
|
|
44186
44518
|
const workflowBellEnabled = settings.merged.general?.terminalBell ?? true;
|
|
44187
|
-
(0,
|
|
44519
|
+
(0, import_react164.useEffect)(() => {
|
|
44188
44520
|
const registry = config.getWorkflowRunRegistry?.();
|
|
44189
44521
|
if (!registry?.setNotificationCallback) return;
|
|
44190
44522
|
registry.setNotificationCallback((entry) => {
|
|
@@ -44234,7 +44566,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44234
44566
|
showWorktreeExitDialog,
|
|
44235
44567
|
closeWorktreeExitDialog: /* @__PURE__ */ __name(() => setShowWorktreeExitDialog(false), "closeWorktreeExitDialog")
|
|
44236
44568
|
});
|
|
44237
|
-
const handleExit = (0,
|
|
44569
|
+
const handleExit = (0, import_react164.useCallback)(
|
|
44238
44570
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
44239
44571
|
if (pressedOnce) {
|
|
44240
44572
|
if (timerRef.current) {
|
|
@@ -44287,7 +44619,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44287
44619
|
activeWorktree
|
|
44288
44620
|
]
|
|
44289
44621
|
);
|
|
44290
|
-
const handleGlobalKeypress = (0,
|
|
44622
|
+
const handleGlobalKeypress = (0, import_react164.useCallback)(
|
|
44291
44623
|
(key) => {
|
|
44292
44624
|
if (settings.merged.general?.debugKeystrokeLogging) {
|
|
44293
44625
|
debugLogger40.debug("[DEBUG] Keystroke:", JSON.stringify(key));
|
|
@@ -44477,7 +44809,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44477
44809
|
]
|
|
44478
44810
|
);
|
|
44479
44811
|
useKeypress(handleGlobalKeypress, { isActive: true });
|
|
44480
|
-
(0,
|
|
44812
|
+
(0, import_react164.useEffect)(() => {
|
|
44481
44813
|
if (settings.merged.ui?.hideWindowTitle) {
|
|
44482
44814
|
return;
|
|
44483
44815
|
}
|
|
@@ -44486,7 +44818,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44486
44818
|
lastTitleRef.current = null;
|
|
44487
44819
|
const folderName2 = basename3(config.getTargetDir());
|
|
44488
44820
|
writeTerminalTitle(
|
|
44489
|
-
(value) =>
|
|
44821
|
+
(value) => process17.stdout.write(value),
|
|
44490
44822
|
formatSessionWindowTitle(null, folderName2)
|
|
44491
44823
|
);
|
|
44492
44824
|
}
|
|
@@ -44496,7 +44828,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44496
44828
|
const title = formatSessionWindowTitle(sessionName, folderName);
|
|
44497
44829
|
if (lastTitleRef.current !== title) {
|
|
44498
44830
|
lastTitleRef.current = title;
|
|
44499
|
-
writeTerminalTitle((value) =>
|
|
44831
|
+
writeTerminalTitle((value) => process17.stdout.write(value), title);
|
|
44500
44832
|
}
|
|
44501
44833
|
}, [
|
|
44502
44834
|
sessionName,
|
|
@@ -44504,9 +44836,9 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44504
44836
|
settings.merged.ui?.showStatusInTitle,
|
|
44505
44837
|
config
|
|
44506
44838
|
]);
|
|
44507
|
-
const queueDrainingRef = (0,
|
|
44508
|
-
const [queueDrainNonce, setQueueDrainNonce] = (0,
|
|
44509
|
-
(0,
|
|
44839
|
+
const queueDrainingRef = (0, import_react164.useRef)(false);
|
|
44840
|
+
const [queueDrainNonce, setQueueDrainNonce] = (0, import_react164.useState)(0);
|
|
44841
|
+
(0, import_react164.useEffect)(() => {
|
|
44510
44842
|
if (queueDrainingRef.current) return;
|
|
44511
44843
|
if (!shouldDrainMessageQueue({
|
|
44512
44844
|
isConfigInitialized,
|
|
@@ -44518,11 +44850,10 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44518
44850
|
return;
|
|
44519
44851
|
}
|
|
44520
44852
|
if (isTranscriptOpenRef.current) return;
|
|
44521
|
-
const
|
|
44522
|
-
const submission = plainPrompts.length > 0 ? plainPrompts.join("\n\n") : popNextSegment();
|
|
44853
|
+
const submission = popNextTurn();
|
|
44523
44854
|
if (submission === null) return;
|
|
44524
44855
|
queueDrainingRef.current = true;
|
|
44525
|
-
Promise.resolve(
|
|
44856
|
+
Promise.resolve(submitUserQuery(submission)).finally(() => {
|
|
44526
44857
|
queueDrainingRef.current = false;
|
|
44527
44858
|
setQueueDrainNonce((n) => n + 1);
|
|
44528
44859
|
});
|
|
@@ -44534,13 +44865,12 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44534
44865
|
// Re-run the drain when the transcript closes so queued messages resume.
|
|
44535
44866
|
isTranscriptOpen,
|
|
44536
44867
|
messageQueue,
|
|
44537
|
-
|
|
44538
|
-
|
|
44539
|
-
submitQuery,
|
|
44868
|
+
popNextTurn,
|
|
44869
|
+
submitUserQuery,
|
|
44540
44870
|
queueDrainNonce
|
|
44541
44871
|
]);
|
|
44542
44872
|
const nightly = props.version.includes("nightly");
|
|
44543
|
-
const uiState = (0,
|
|
44873
|
+
const uiState = (0, import_react164.useMemo)(
|
|
44544
44874
|
() => ({
|
|
44545
44875
|
history: historyManager.history,
|
|
44546
44876
|
historyManager,
|
|
@@ -44833,7 +45163,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44833
45163
|
isDiffDialogOpen
|
|
44834
45164
|
]
|
|
44835
45165
|
);
|
|
44836
|
-
const uiActions = (0,
|
|
45166
|
+
const uiActions = (0, import_react164.useMemo)(
|
|
44837
45167
|
() => ({
|
|
44838
45168
|
openThemeDialog,
|
|
44839
45169
|
openEditorDialog,
|
|
@@ -44874,7 +45204,8 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44874
45204
|
handleFinalSubmit,
|
|
44875
45205
|
handleRetryLastPrompt: retryLastPrompt,
|
|
44876
45206
|
handleClearScreen,
|
|
44877
|
-
popAllQueuedMessages
|
|
45207
|
+
popAllQueuedMessages,
|
|
45208
|
+
invalidateSubmittedPromptProvenance,
|
|
44878
45209
|
// Welcome back dialog
|
|
44879
45210
|
handleWelcomeBackSelection,
|
|
44880
45211
|
handleWelcomeBackClose,
|
|
@@ -44964,7 +45295,8 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44964
45295
|
handleFinalSubmit,
|
|
44965
45296
|
retryLastPrompt,
|
|
44966
45297
|
handleClearScreen,
|
|
44967
|
-
|
|
45298
|
+
popAllQueuedMessages,
|
|
45299
|
+
invalidateSubmittedPromptProvenance,
|
|
44968
45300
|
handleWelcomeBackSelection,
|
|
44969
45301
|
handleWelcomeBackClose,
|
|
44970
45302
|
handleWorktreeExit,
|
|
@@ -45014,11 +45346,11 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
45014
45346
|
closeDiffDialog
|
|
45015
45347
|
]
|
|
45016
45348
|
);
|
|
45017
|
-
const renderModeValue = (0,
|
|
45349
|
+
const renderModeValue = (0, import_react164.useMemo)(
|
|
45018
45350
|
() => ({ renderMode, setRenderMode }),
|
|
45019
45351
|
[renderMode, setRenderMode]
|
|
45020
45352
|
);
|
|
45021
|
-
const thoughtExpandedValue = (0,
|
|
45353
|
+
const thoughtExpandedValue = (0, import_react164.useMemo)(
|
|
45022
45354
|
() => ({
|
|
45023
45355
|
allExpanded: thoughtExpanded,
|
|
45024
45356
|
expandedHeadIds: expandedThoughtHeadIds,
|
|
@@ -45026,7 +45358,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
45026
45358
|
}),
|
|
45027
45359
|
[thoughtExpanded, expandedThoughtHeadIds, toggleThoughtExpanded]
|
|
45028
45360
|
);
|
|
45029
|
-
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(UIStateContext.Provider, { value: uiState, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(UIActionsContext.Provider, { value: uiActions, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
45361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(VirtualViewportContext.Provider, { value: useTerminalBuffer, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(UIStateContext.Provider, { value: uiState, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(UIActionsContext.Provider, { value: uiActions, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
45030
45362
|
AppContext.Provider,
|
|
45031
45363
|
{
|
|
45032
45364
|
value: {
|
|
@@ -45050,14 +45382,14 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
45050
45382
|
) })
|
|
45051
45383
|
) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(App, {}) }) }) }) })
|
|
45052
45384
|
}
|
|
45053
|
-
) }) }) });
|
|
45385
|
+
) }) }) }) });
|
|
45054
45386
|
}, "AppContainer");
|
|
45055
45387
|
|
|
45056
45388
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
45057
45389
|
init_esbuild_shims();
|
|
45058
|
-
var
|
|
45390
|
+
var import_react165 = __toESM(require_react(), 1);
|
|
45059
45391
|
function useKittyKeyboardProtocol() {
|
|
45060
|
-
const [status] = (0,
|
|
45392
|
+
const [status] = (0, import_react165.useState)({
|
|
45061
45393
|
supported: isKittyProtocolSupported(),
|
|
45062
45394
|
enabled: isKittyProtocolEnabled(),
|
|
45063
45395
|
checking: false
|
|
@@ -45311,6 +45643,11 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
45311
45643
|
}
|
|
45312
45644
|
}
|
|
45313
45645
|
const initialCapturedInput = stopAndGetCapturedInput();
|
|
45646
|
+
const useVP = shouldUseVirtualViewport(
|
|
45647
|
+
settings.merged.ui?.useTerminalBuffer,
|
|
45648
|
+
config.getScreenReader(),
|
|
45649
|
+
isInteractiveTerminal()
|
|
45650
|
+
);
|
|
45314
45651
|
const AppWrapper = /* @__PURE__ */ __name(() => {
|
|
45315
45652
|
const kittyProtocolStatus = useKittyKeyboardProtocol();
|
|
45316
45653
|
const nodeMajorVersion = parseInt(process.versions.node.split(".")[0], 10);
|
|
@@ -45330,13 +45667,13 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
45330
45667
|
startupWarnings,
|
|
45331
45668
|
version,
|
|
45332
45669
|
initializationResult,
|
|
45670
|
+
initialUseVirtualViewport: useVP,
|
|
45333
45671
|
extensionRefreshState: options.extensionRefreshState
|
|
45334
45672
|
}
|
|
45335
45673
|
) }) }) }) })
|
|
45336
45674
|
}
|
|
45337
45675
|
) }) }) });
|
|
45338
45676
|
}, "AppWrapper");
|
|
45339
|
-
const useVP = settings.merged.ui?.useTerminalBuffer ?? false;
|
|
45340
45677
|
const stdoutMaxListeners = process.stdout.getMaxListeners();
|
|
45341
45678
|
if (useVP) {
|
|
45342
45679
|
process.stdout.setMaxListeners(0);
|
|
@@ -45358,7 +45695,7 @@ ${error.stack ?? ""}`
|
|
|
45358
45695
|
}
|
|
45359
45696
|
);
|
|
45360
45697
|
const instance = render_default(
|
|
45361
|
-
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
45698
|
+
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_react166.default.StrictMode, { children: appTree }) : appTree,
|
|
45362
45699
|
{
|
|
45363
45700
|
exitOnCtrlC: false,
|
|
45364
45701
|
isScreenReaderEnabled: config.getScreenReader(),
|