@qwen-code/qwen-code 0.21.0 → 0.21.1-nightly.20260730.1643a6c9a
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 +117 -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 +1 -1
- package/bundled/qc-helper/docs/features/hooks.md +70 -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 +20 -0
- 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-H77LGFDG.js +86 -0
- package/chunks/{StandaloneSessionPicker-BIRMPLRD.js → StandaloneSessionPicker-NGKLCYX4.js} +68 -67
- package/chunks/{acp-startup-profiler-RV3IV562.js → acp-startup-profiler-DFVPFQ6C.js} +2 -2
- package/chunks/{acpAgent-6J2U72PQ.js → acpAgent-RUN53PRW.js} +1381 -543
- package/chunks/agent-4CFRD2OG.js +82 -0
- package/chunks/agent-headless-XPUCIZLL.js +76 -0
- package/chunks/{anthropicContentGenerator-75BKLTSP.js → anthropicContentGenerator-V2QOGVYD.js} +79 -27
- package/chunks/{artifact-tool-Y5T7GG7F.js → artifact-tool-6K6U7XYJ.js} +4 -4
- package/chunks/{askUserQuestion-2H6747FR.js → askUserQuestion-GD2IJJ7I.js} +4 -4
- package/chunks/bridge-B2YJLSLT.js +92 -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-RAPKQK24.js +418 -0
- package/chunks/channel-settings-store-KJQKY6NN.js +89 -0
- package/chunks/{channel-worker-group-2ZD7TVAT.js → channel-worker-group-7SZ7MR3K.js} +11 -6
- package/chunks/{channel-worker-manager-4OA4BCGB.js → channel-worker-manager-RN5KJYPF.js} +11 -6
- package/chunks/{channel-worker-supervisor-V7KCFJTS.js → channel-worker-supervisor-CABBXYHK.js} +7 -5
- package/chunks/{chunk-M5JM7OSF.js → chunk-2DN4J57Y.js} +2 -3
- package/chunks/{chunk-6GMVPFB2.js → chunk-2IIJTXYF.js} +45 -16
- package/chunks/{chunk-BPJSQIJX.js → chunk-2J3OJGTL.js} +0 -2
- package/chunks/{chunk-EPDRMGT4.js → chunk-2LKVPASC.js} +4 -28
- package/chunks/{chunk-PWTZEM3C.js → chunk-2LQTH543.js} +3 -37
- package/chunks/{chunk-CIKQ7KKO.js → chunk-2Q4CZ3V6.js} +713 -419
- package/chunks/{chunk-HIJQF5B5.js → chunk-3L2SPEBH.js} +1 -1
- package/chunks/{chunk-JXJFVC6E.js → chunk-3QDXECUB.js} +46 -11
- package/chunks/{chunk-PSOO6YXD.js → chunk-3RMX26V7.js} +9 -7
- package/chunks/{chunk-PC6JANNU.js → chunk-4755HD5V.js} +4 -4
- package/chunks/{chunk-GSN55ZRI.js → chunk-4D3MHM5F.js} +19 -7
- package/chunks/{chunk-EBJQ6AXW.js → chunk-4FQ4OKOU.js} +260 -14
- package/chunks/{chunk-BIQWWWJN.js → chunk-4G2BISNC.js} +1 -1
- package/chunks/{chunk-IKYJHJNF.js → chunk-5EHIP3GX.js} +3 -3
- package/chunks/chunk-5IDU2UGL.js +2196 -0
- package/chunks/{chunk-DHHOYAPR.js → chunk-5TBMQLGG.js} +7 -7
- package/chunks/{chunk-A4UCTEB5.js → chunk-5WV5S2GT.js} +0 -1
- package/chunks/chunk-5YKDXHUY.js +463 -0
- package/chunks/{chunk-K36B6G2O.js → chunk-5ZEFGTII.js} +5 -5
- package/chunks/{chunk-K4XWPEWB.js → chunk-64LQLPL7.js} +4 -33
- package/chunks/{chunk-TGILQ3YH.js → chunk-6CH6PHMZ.js} +141 -64
- package/chunks/chunk-6FMJLI5M.js +1591 -0
- package/chunks/chunk-6MPDY6ZG.js +76 -0
- package/chunks/{chunk-2NH6DYI4.js → chunk-6OF62NPQ.js} +12 -12
- package/chunks/{chunk-JZA3JUDJ.js → chunk-6QIGFD5W.js} +1 -1
- package/chunks/{chunk-ETSW4KLJ.js → chunk-72E7TSGG.js} +2 -2
- package/chunks/{chunk-OHNBB4XR.js → chunk-75GFAX4R.js} +1 -1
- package/chunks/{chunk-UDX5OBWR.js → chunk-77IMMLN2.js} +94 -4
- package/chunks/{chunk-TEHGS6UP.js → chunk-7A4V5CJY.js} +154 -16
- package/chunks/{chunk-QAF7NMK7.js → chunk-7BV2P4S3.js} +1 -1
- package/chunks/{chunk-RIBKPMRP.js → chunk-7RFNMXPU.js} +19 -6
- package/chunks/{chunk-KMQ33DO4.js → chunk-7UKQW4JU.js} +4 -4
- package/chunks/{chunk-A5L3JMUA.js → chunk-7XATOOE7.js} +18 -4
- package/chunks/{chunk-5I2IWRSH.js → chunk-A3NDJ5SB.js} +2 -2
- package/chunks/{chunk-JLU636DO.js → chunk-ALMR3E6Q.js} +1 -0
- package/chunks/{chunk-TPRQ7RZH.js → chunk-ANND7YTH.js} +2341 -940
- package/chunks/{chunk-PJIZUQVC.js → chunk-AZQ3DT76.js} +2 -2
- package/chunks/{chunk-KIM5GUMA.js → chunk-B47WVQ7T.js} +400 -162
- package/chunks/{chunk-UH3WSE5L.js → chunk-B4AJNNOL.js} +1 -6
- package/chunks/{chunk-BJX6ZSUK.js → chunk-BCZFQXWK.js} +2 -2
- package/chunks/{chunk-BKHWX6I2.js → chunk-CAEQL6GZ.js} +11 -3
- package/chunks/{chunk-J56UI34H.js → chunk-CI2PGI7Z.js} +4 -2
- package/chunks/{chunk-2SCDWPXI.js → chunk-CUWGNCKW.js} +5 -5
- package/chunks/{chunk-TOFQCPDC.js → chunk-CVHIL5IG.js} +4 -5
- package/chunks/{chunk-VRYUBFMC.js → chunk-CYIBLZBR.js} +1 -1
- package/chunks/{chunk-YBL3QUDD.js → chunk-CYPJYJIX.js} +1 -1
- package/chunks/{chunk-XVNQMZ2I.js → chunk-DGEIYUC3.js} +0 -1
- package/chunks/{chunk-7MVVZO4N.js → chunk-DGV27C34.js} +4 -4
- package/chunks/{chunk-BPZALHVR.js → chunk-DI35ZN7T.js} +1 -1
- package/chunks/chunk-DZLYR4U3.js +1252 -0
- package/chunks/{chunk-PHOF65IG.js → chunk-EYGWU66Z.js} +41594 -50416
- package/chunks/{chunk-7ZCNENPP.js → chunk-FANRZEAJ.js} +1 -1
- package/chunks/{chunk-WBL3FJEU.js → chunk-FC4KQFCS.js} +1 -1
- package/chunks/{chunk-5NBDS5S6.js → chunk-FCYYAB4S.js} +162 -7
- package/chunks/{chunk-L26JL52R.js → chunk-FH6SU2OG.js} +48 -61
- package/chunks/{chunk-OKY7HXPG.js → chunk-FNMZK765.js} +2 -2
- package/chunks/chunk-FYJ7W2PI.js +194 -0
- package/chunks/{chunk-BULDBTYC.js → chunk-G7XXKQYS.js} +3 -28
- package/chunks/{chunk-L5UHQJTJ.js → chunk-GATT5TKW.js} +1 -1
- package/chunks/{chunk-MVSUYZDT.js → chunk-GKWLJW7Z.js} +4 -4
- package/chunks/{chunk-VAK25FTU.js → chunk-GKX7E4CO.js} +1 -1
- package/chunks/{chunk-LS77BEZP.js → chunk-GLCZKT5V.js} +1 -5
- package/chunks/{chunk-FSITMZJH.js → chunk-GOXRFPH5.js} +18 -9
- package/chunks/{chunk-3RN6GBKS.js → chunk-HFAV3POZ.js} +1 -1
- package/chunks/{chunk-YX324OPW.js → chunk-HGQIL6NG.js} +1 -1
- package/chunks/{chunk-55DJUCI2.js → chunk-HOSENQJL.js} +53 -43
- package/chunks/{chunk-GZXCZHCT.js → chunk-I3G5JWBV.js} +1 -1
- package/chunks/{chunk-YH6G52F2.js → chunk-I3V7RKRZ.js} +4 -4
- package/chunks/{chunk-RF3EXIHJ.js → chunk-IQMYZTDI.js} +30 -19
- package/chunks/{chunk-RWTEFFPU.js → chunk-JCJ7LKNA.js} +6140 -5616
- package/chunks/{chunk-S3TWXGKA.js → chunk-JE7KQ2UP.js} +4 -2
- package/chunks/{chunk-63P4EL5V.js → chunk-JMONIXMJ.js} +1 -1
- package/chunks/{chunk-OFDOK3VM.js → chunk-JQTW5CA5.js} +8 -13
- package/chunks/chunk-JYBU6YUE.js +378 -0
- package/chunks/chunk-JZQUOT4B.js +81 -0
- package/chunks/{chunk-Q4M4MDQ4.js → chunk-K4GTOFKY.js} +1 -1
- package/chunks/{chunk-T2NCM2ET.js → chunk-K6KS3LTN.js} +2 -749
- package/chunks/{chunk-YPE6A4GC.js → chunk-KLESQCW6.js} +2 -2
- package/chunks/{chunk-JVPM2ULZ.js → chunk-KQGB3ME2.js} +6 -6
- package/chunks/{chunk-2W3OOD4W.js → chunk-L55JWS76.js} +6 -3
- package/chunks/{chunk-RHLZR4E5.js → chunk-LGAOC3ZS.js} +1 -1
- package/chunks/{chunk-LB6DUZ26.js → chunk-LI53FGDL.js} +258 -184
- package/chunks/{chunk-2X55UKQE.js → chunk-LIJID5PD.js} +3 -3
- package/chunks/{chunk-NH6KE4JX.js → chunk-LW3RFMG7.js} +3 -3
- package/chunks/{chunk-MZAXJAUM.js → chunk-LW67T6GH.js} +1 -1
- package/chunks/{chunk-RZIX2G32.js → chunk-M4O2DCE3.js} +1 -1
- package/chunks/{chunk-4WIZGAH3.js → chunk-MFW7APBA.js} +6 -58
- package/chunks/{chunk-VIA5XA4U.js → chunk-MKQOXP2O.js} +3 -1
- package/chunks/{chunk-FODK6UMO.js → chunk-MPHPFVKK.js} +0 -2
- package/chunks/{chunk-JESCGQM3.js → chunk-NAVJD2PQ.js} +8 -7
- package/chunks/{chunk-H5FFA6TH.js → chunk-NOKIVHOL.js} +16 -3
- package/chunks/{chunk-6OUGMXDC.js → chunk-NWNEANAT.js} +7 -7
- package/chunks/{chunk-LQIW3YFY.js → chunk-OAOPCTG6.js} +9 -7
- package/chunks/chunk-OCPBI7J5.js +18 -0
- package/chunks/{chunk-WCXCRJYB.js → chunk-OCUM7TJA.js} +1 -1
- package/chunks/{chunk-R5AFZNQW.js → chunk-OIG257JR.js} +14 -7
- package/chunks/{chunk-IKCX4CCL.js → chunk-OINT3ZNV.js} +118 -95
- package/chunks/{chunk-E5TUC6CA.js → chunk-OKF7JF3R.js} +3 -3
- package/chunks/chunk-PEK4ARMZ.js +319 -0
- package/chunks/chunk-PGHTM673.js +363 -0
- package/chunks/{record-artifact-RQKFYO5B.js → chunk-PMGFWLAZ.js} +22 -7
- package/chunks/{chunk-FNQ6T3CV.js → chunk-PONHVBRT.js} +10 -7
- package/chunks/{chunk-VDDGDZMA.js → chunk-QHWCP53L.js} +14 -7
- package/chunks/{chunk-ZFDTEDCF.js → chunk-RF4FA22B.js} +6 -6
- package/chunks/{chunk-6FGBXPWM.js → chunk-RPLGZJV2.js} +38 -44
- package/chunks/{chunk-NIBLUX3Y.js → chunk-RQLRERVY.js} +148 -21
- package/chunks/{chunk-LKEJ26GS.js → chunk-RWZPM2BP.js} +16 -11
- package/chunks/{chunk-6AM5D4ME.js → chunk-S6LOFUVP.js} +0 -12
- package/chunks/{chunk-IO3IX5Q4.js → chunk-S7G7Z3MP.js} +1 -1
- package/chunks/{chunk-MUP3T3AD.js → chunk-SGFT55XI.js} +1 -35
- package/chunks/{chunk-PWVFN2LF.js → chunk-SMWPUA2A.js} +1 -1
- package/chunks/{chunk-U7M2DMGW.js → chunk-SWRHIQDT.js} +130 -5
- 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-SQCQ4KO2.js → chunk-TCBP4Q3K.js} +380 -317
- package/chunks/{chunk-ZNAUOR2I.js → chunk-TJHLQ45J.js} +2 -2
- package/chunks/{chunk-LK7CHLVP.js → chunk-U4VTUMMK.js} +0 -60
- package/chunks/{chunk-NL7LTRLR.js → chunk-UHUSJ6X7.js} +29 -68
- package/chunks/{chunk-LH2BYDQ5.js → chunk-UJBURGBH.js} +18 -12
- package/chunks/{chunk-ZOIFNCKL.js → chunk-UPUG4GXM.js} +3 -23
- package/chunks/{chunk-FQK6JAFG.js → chunk-URPQ5QZM.js} +4 -4
- package/chunks/{chunk-M4FMGVY4.js → chunk-V47JGII4.js} +3 -3
- package/chunks/{chunk-Y34KJKDC.js → chunk-VBX5IFEN.js} +1 -1
- package/chunks/{chunk-USTWD7QV.js → chunk-W4MIWP6M.js} +26 -16
- package/chunks/{chunk-HTR4WV6U.js → chunk-W4RQUHY3.js} +31 -1
- package/chunks/{chunk-J24WCGIN.js → chunk-W7D7QTCH.js} +4 -4
- package/chunks/{chunk-DLWL3Z7A.js → chunk-WBSMNTSV.js} +3 -3
- package/chunks/{chunk-2JZBVYTU.js → chunk-WZRWHXFE.js} +1 -8
- package/chunks/{chunk-COH43MRJ.js → chunk-XCGIMOLN.js} +27 -1
- package/chunks/{chunk-IJTOWOD7.js → chunk-XTLTBZIH.js} +83 -9
- package/chunks/{chunk-H4SBPHSA.js → chunk-XVYRMUI5.js} +3 -3
- package/chunks/{chunk-3QMGYBFN.js → chunk-XWWKIXVD.js} +1 -80
- package/chunks/{chunk-VULLI6WQ.js → chunk-XZB72HUB.js} +6 -6
- package/chunks/{chunk-3SJ43L4W.js → chunk-XZC5VLBZ.js} +2 -0
- package/chunks/{chunk-UUUTRMI2.js → chunk-Y4IHBGBP.js} +1 -1
- package/chunks/{chunk-PR75REBZ.js → chunk-Y6AXW2OG.js} +12 -82
- package/chunks/{chunk-IPUUTYMV.js → chunk-YDLJGZHL.js} +1 -1
- package/chunks/{chunk-MB4MZHMJ.js → chunk-YX4DHA6S.js} +211 -522
- package/chunks/chunk-Z4X5MTRT.js +133 -0
- package/chunks/{chunk-UW5EOVUN.js → chunk-ZBVS26BY.js} +4 -4
- package/chunks/{chunk-ZD6UTE4A.js → chunk-ZHBO7WVX.js} +1 -1
- package/chunks/{chunk-7JURR4JT.js → chunk-ZM63TFJH.js} +167 -81
- package/chunks/{chunk-HTO4JFDZ.js → chunk-ZPJWUGCS.js} +0 -1
- package/chunks/{chunk-X5XDDSSH.js → chunk-ZPZ7ZJEE.js} +28 -5
- package/chunks/{chunk-ACY3A37B.js → chunk-ZS6Q44DY.js} +23 -18
- package/chunks/{chunk-ZJHVAS7M.js → chunk-ZWUDSQBD.js} +4 -5
- package/chunks/{computer-use-SOQ4E3VX.js → computer-use-HRVGY7OB.js} +50 -49
- package/chunks/{config-utils-7V7GGIW6.js → config-utils-RUFMEUYD.js} +4 -3
- package/chunks/contextCommand-V3N7Q3UM.js +81 -0
- package/chunks/core-runtime-QGEW6WBW.js +135 -0
- package/chunks/{create-sub-session-IWW2IZ2T.js → create-sub-session-SBYUMSSS.js} +3 -3
- package/chunks/{create-sub-session-QRJLW5BV.js → create-sub-session-ZUWDNFO2.js} +47 -46
- package/chunks/{cron-create-YIID5XAW.js → cron-create-2QK6TCEC.js} +6 -6
- package/chunks/{cron-delete-ZVHYCEP2.js → cron-delete-FDCDFYMG.js} +5 -5
- package/chunks/{cron-list-XEGS463Q.js → cron-list-XN3WVBTP.js} +6 -6
- package/chunks/{daemon-YO6433NF.js → daemon-QH2G5B5E.js} +403 -17
- package/chunks/daemon-status-provider-MB54AMNV.js +91 -0
- package/chunks/daemon-trust-policy-3VFDF5LU.js +86 -0
- package/chunks/daemon-trust-policy-monitor-4KX2OK7G.js +173 -0
- package/chunks/{de-HGRCYDEJ.js → de-SY6O76BF.js} +6 -1
- package/chunks/deferred-core-runtime-UIJL6EEU.js +90 -0
- package/chunks/{dist-F6IBUDR4.js → dist-2PERFI23.js} +12 -9
- package/chunks/dist-AOOUOG5S.js +4389 -0
- package/chunks/{dist-46NQKLTW.js → dist-OAOC5OV4.js} +2 -2
- package/chunks/{dist-YFNEUWSE.js → dist-PVEAFLHY.js} +5 -4
- package/chunks/{dist-AIKFMUKK.js → dist-SL2LUMML.js} +1449 -14
- package/chunks/dist-ULIG4M5H.js +13415 -0
- package/chunks/{dist-WEAHOXDM.js → dist-WGMNT3JQ.js} +2 -1
- package/chunks/{dist-BBLXMS3N.js → dist-ZHXOBXDN.js} +3 -3
- package/chunks/earlyInputCapture-QBC4ZCV7.js +83 -0
- package/chunks/{edit-OBDSQURM.js → edit-7ABV72VV.js} +48 -47
- package/chunks/{en-MTWBNGDO.js → en-NBK3JKCE.js} +9 -1
- package/chunks/{enter-worktree-U6MRPQ2P.js → enter-worktree-4NOWT6I2.js} +48 -47
- package/chunks/{enterPlanMode-BC5QUZZ2.js → enterPlanMode-4NOQ6A56.js} +48 -47
- package/chunks/{environment-W5UFC2CH.js → environment-ABMFNOJO.js} +49 -48
- package/chunks/errors-UAX4AR5Q.js +89 -0
- package/chunks/esm-K5FARBNI.js +5548 -0
- package/chunks/{exit-worktree-DGNYMECB.js → exit-worktree-CF2O5AQM.js} +48 -47
- package/chunks/exitPlanMode-5KEF5DLM.js +74 -0
- package/chunks/{fast-path-JJZFJANL.js → fast-path-RWZGR7A6.js} +16 -6
- package/chunks/{fr-45RLL55O.js → fr-4KG5V7UT.js} +6 -1
- package/chunks/{gemini-QS36EBZV.js → gemini-A4LXWU5S.js} +103 -98
- package/chunks/{geminiContentGenerator-AG4KB6CV.js → geminiContentGenerator-VPXAS3BM.js} +40 -11
- 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-V7R3PSK3.js → glob-P6ZPQOPR.js} +48 -47
- package/chunks/goal-tools-H2NHZKGN.js +335 -0
- package/chunks/{grep-QYPSK7OP.js → grep-56M3IJ36.js} +50 -48
- package/chunks/handleAutoUpdate-N3IMC273.js +82 -0
- package/chunks/i18n-UFV5QINW.js +98 -0
- package/chunks/{image-gen-Z3VPGKRC.js → image-gen-GPYAKETO.js} +12 -12
- package/chunks/initializer-OXWZKLEX.js +87 -0
- package/chunks/installationInfo-V2YEC52N.js +81 -0
- package/chunks/{ja-B7DF7DFG.js → ja-F3GSQXMF.js} +6 -1
- package/chunks/{keychain-token-storage-MDTG3WRM.js → keychain-token-storage-72IYCAZV.js} +3 -3
- package/chunks/lib-RUF3WZA6.js +9 -0
- package/chunks/list-UN6EJ6WB.js +90 -0
- package/chunks/{list-agents-5KJJHR6I.js → list-agents-R6KDXQR3.js} +3 -3
- package/chunks/loadedSettingsAdapter-LZK2PMOY.js +84 -0
- package/chunks/{loggingContentGenerator-HS3S5H3Q.js → loggingContentGenerator-PSFMRX7M.js} +78 -113
- package/chunks/{loop-wakeup-FXKNNYSY.js → loop-wakeup-3IQKCYAH.js} +7 -7
- package/chunks/{ls-NTK6VOQJ.js → ls-DKZ37A7N.js} +5 -5
- package/chunks/{lsp-2JI24STP.js → lsp-QNWN7KN3.js} +3 -3
- package/chunks/{managed-npm-update-JYEMMXA3.js → managed-npm-update-D2AO3F47.js} +48 -47
- package/chunks/mcp-A2VAOKMH.js +84 -0
- package/chunks/{monitor-R3ODH5U6.js → monitor-7EJ3WBER.js} +48 -47
- package/chunks/nonInteractiveCli-43LIVN4A.js +146 -0
- package/chunks/{notebook-edit-BNOK452R.js → notebook-edit-IQD53ULF.js} +48 -47
- package/chunks/{openaiContentGenerator-WMCU3O2H.js → openaiContentGenerator-YPCMNGEZ.js} +26 -27
- package/chunks/pidfile-3SOOBWZA.js +87 -0
- package/chunks/process-registry-2CHQBXH5.js +157 -0
- package/chunks/{processUtils-RT7UNCC2.js → processUtils-FGVHFR4V.js} +2 -2
- package/chunks/{pt-22Q3FP73.js → pt-EQ33KWEN.js} +6 -1
- package/chunks/{qwenContentGenerator-HHCRK4SX.js → qwenContentGenerator-M6YW4D6A.js} +53 -52
- package/chunks/{qwenOAuth2-OWLB5AKH.js → qwenOAuth2-XSYKLMNR.js} +10 -10
- package/chunks/read-file-XOMBFIS7.js +29 -0
- package/chunks/{read-mcp-resource-4DKQWGHD.js → read-mcp-resource-GFTWYXMK.js} +4 -4
- package/chunks/record-artifact-JANPGVS4.js +21 -0
- package/chunks/resumeHistoryUtils-E4EVA4PO.js +92 -0
- package/chunks/ripGrep-M4NYA6AM.js +74 -0
- package/chunks/{ru-FZCNZHDC.js → ru-7OZAUKGG.js} +6 -1
- package/chunks/{run-qwen-serve-FU6HEM4J.js → run-qwen-serve-QLCU2BAZ.js} +953 -248
- package/chunks/{runtime-XXRRTNP6.js → runtime-T36WUYIO.js} +57 -55
- package/chunks/{scheduler-G2ZS2Z7E.js → scheduler-C3J45Z5W.js} +47 -46
- package/chunks/{sdk-exporters-grpc-AK3LGHNO.js → sdk-exporters-grpc-54L4LS5L.js} +4 -4
- package/chunks/{sdk-exporters-http-FYBSUCPD.js → sdk-exporters-http-BFOKQFRD.js} +7 -7
- package/chunks/{sdk-impl-GMVPB7NB.js → sdk-impl-6CJ3JQZL.js} +14 -14
- package/chunks/{send-message-Q6OOR6BR.js → send-message-RJ2R4PIV.js} +6 -12
- package/chunks/serve-7SWJTL3K.js +90 -0
- package/chunks/{server-4UMH7OIZ.js → server-T2B64F4O.js} +3887 -852
- package/chunks/{session-K3O3Q2SV.js → session-D546I4HT.js} +99 -94
- package/chunks/{settings-CR2EWTBA.js → settings-ZQOOTRR7.js} +51 -50
- package/chunks/shell-5OR4RAKF.js +84 -0
- package/chunks/{skill-I3SDA4MB.js → skill-X4E5JMKV.js} +20 -21
- package/chunks/skill-settings-ZS3XPDMT.js +92 -0
- package/chunks/spawnChannel-MILVKB3G.js +83 -0
- package/chunks/standalone-update-UTYCSPUO.js +93 -0
- package/chunks/{startInteractiveUI-SLZGHRPH.js → startInteractiveUI-S4R5J4EN.js} +1220 -895
- package/chunks/{syntheticOutput-I3757IWH.js → syntheticOutput-355CB6CJ.js} +4 -4
- package/chunks/{task-create-N7WQSGYA.js → task-create-KUQIS7RA.js} +10 -10
- package/chunks/{task-list-FOPULZEP.js → task-list-5XNNGTF4.js} +7 -7
- package/chunks/{task-stop-H6RHXFVQ.js → task-stop-4ROAOBXH.js} +3 -3
- package/chunks/{task-update-M57TFZJT.js → task-update-4FPFYGE3.js} +10 -10
- package/chunks/{team-create-YJALH5D2.js → team-create-MGD3Q7W4.js} +50 -49
- package/chunks/{team-delete-QE2UXJL7.js → team-delete-S2RCXA4P.js} +7 -7
- package/chunks/{team-plan-approval-34QFYKGN.js → team-plan-approval-VMVGLPDQ.js} +48 -47
- package/chunks/theme-manager-U4QE2YSY.js +78 -0
- package/chunks/{todoWrite-VQ7FKOHL.js → todoWrite-7WM3VDMY.js} +7 -7
- package/chunks/{tool-search-NF7GB6LE.js → tool-search-6T7VYTYZ.js} +19 -21
- package/chunks/total-session-admission-PLKO4EET.js +86 -0
- package/chunks/trustedFolders-QZU6BO46.js +96 -0
- package/chunks/{update-relaunch-WBUZJC5O.js → update-relaunch-NWPFNM5L.js} +5 -5
- package/chunks/updateCheck-KEOCGBZR.js +93 -0
- package/chunks/useAutoAcceptIndicator-O6XISZEA.js +94 -0
- package/chunks/{validateNonInterActiveAuth-3R223G3R.js → validateNonInterActiveAuth-WCHAHO75.js} +94 -89
- package/chunks/{version-HS7YSFHV.js → version-VP3VZ2BM.js} +1 -1
- package/chunks/{web-fetch-NKCSG7ZE.js → web-fetch-KM2FSOKS.js} +19 -21
- package/chunks/{web-search-S62WAP4S.js → web-search-WUR6PYBO.js} +13 -13
- package/chunks/{workflow-QAGU5RU4.js → workflow-S6XMX55R.js} +49 -48
- package/chunks/workspace-providers-status-JGIZRHVT.js +87 -0
- package/chunks/{workspace-registration-store-24JMHDGF.js → workspace-registration-store-JDEMOOFX.js} +1 -1
- package/chunks/workspace-registry-NIL6253M.js +94 -0
- package/chunks/workspace-service-UYB6MMWL.js +101 -0
- package/chunks/workspace-skills-status-GSJRWER4.js +87 -0
- package/chunks/workspace-trust-reconciler-V2TICK2A.js +347 -0
- package/chunks/write-file-QHD5ELJS.js +76 -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-236QXDRH.js +224 -0
- package/cli.js +13 -13
- 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-DcbWnB9T.js → arc-DQN8gc5j.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-kMMF5sud.js → architectureDiagram-3BPJPVTR-C6Z867cc.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-Htl9vTJS.js → blockDiagram-GPEHLZMM-BkyNf4_J.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-BnZnm0mQ.js → c4Diagram-AAUBKEIU-BA7aurej.js} +1 -1
- package/web-shell/assets/channel-YzToqAUt.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-DziB7kDG.js → chunk-2J33WTMH-Dp_LERgD.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-CmkD8daw.js → chunk-4BX2VUAB-CCwcnkeW.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-CHAd9A_U.js → chunk-55IACEB6-e0ytWiup.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-Dqaam3fE.js → chunk-727SXJPM-DBoZrQ--.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-D_-saBYM.js → chunk-AQP2D5EJ-dmHU5zKq.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-B9r_veWD.js → chunk-FMBD7UC4-PP3UKzsN.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-B3EaCSpL.js → chunk-ND2GUHAM-Bjy0PNsP.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-CYq8x9mn.js → chunk-QZHKN3VN-CM0H6wrK.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-_le9LVNU.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-_le9LVNU.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-D0ng4uiB.js → cose-bilkent-S5V4N54A-B1B_Fozz.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-DCZollQv.js → dagre-BM42HDAG-DGFk7aBN.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-Dfk2pWS0.js → diagram-2AECGRRQ-VdlYGHdV.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-kX38ltWR.js → diagram-5GNKFQAL-xcEMWz6m.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-CJz2vsXh.js → diagram-KO2AKTUF-B6Dd23eT.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-BvMLZm_7.js → diagram-LMA3HP47-C3bjiNTc.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-l7kfStkO.js → diagram-OG6HWLK6-ChXfX8H6.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-BSVa8GGT.js → erDiagram-TEJ5UH35-D7RBC3FG.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-CoawKIXH.js → flowDiagram-I6XJVG4X-bNsx8Fqb.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-DFUDH0zF.js → ganttDiagram-6RSMTGT7-C_m4liOj.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Y2pvpT4e.js → gitGraphDiagram-PVQCEYII-CzAqOmDr.js} +1 -1
- package/web-shell/assets/{index-D0GX0zZf.js → index-BArKGy43.js} +1 -1
- package/web-shell/assets/index-C2GE3DAF.js +74 -0
- package/web-shell/assets/index-_dIfJ82-.js +1625 -0
- package/web-shell/assets/index-heP6zO4t.css +5 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-CU8_zLiX.js → infoDiagram-5YYISTIA-BBw9H4RT.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-AVQiV0DU.js → ishikawaDiagram-YF4QCWOH-C8Ns7cDb.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-DQ0VSKa3.js → journeyDiagram-JHISSGLW-BkW5h5si.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-BqnWqsE_.js → kanban-definition-UN3LZRKU-IUhsF7tq.js} +1 -1
- package/web-shell/assets/{linear-BkoihsaA.js → linear-CeDsMMjT.js} +1 -1
- package/web-shell/assets/{mermaid.core-5RJs-31j.js → mermaid.core-VTPU82QL.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-D33Bxnpd.js → mindmap-definition-RKZ34NQL-DVohXDmC.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-BuEAw3BH.js → pieDiagram-4H26LBE5-SxBFaID8.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Kox_usEq.js → quadrantDiagram-W4KKPZXB-BJt8o3Cs.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-CNjeUif0.js → requirementDiagram-4Y6WPE33-B02G8M7E.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-BCd2OL_U.js → sankeyDiagram-5OEKKPKP-CzMCGPib.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CF2ZTsz0.js → sequenceDiagram-3UESZ5HK-CzbJgSkE.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-qenSzHtm.js → stateDiagram-AJRCARHV-DhiXBOKS.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DILbnhvR.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-B5DyWdgs.js → timeline-definition-PNZ67QCA-Btj5idQV.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-DqP4I_o_.js → vennDiagram-CIIHVFJN-CJz2YZq4.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-CJe2e4mg.js → wardley-L42UT6IY-CavIou7m.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BMDSw-Rr.js → wardleyDiagram-YWT4CUSO-BRf62x8X.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-BTVZYkxD.js → xychartDiagram-2RQKCTM6-ItOGZPM_.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/MaxSizedBox-5DPPWPGT.js +0 -85
- package/chunks/agent-6ODUANDO.js +0 -81
- package/chunks/agent-headless-7BYQTMHW.js +0 -75
- package/chunks/bridge-ZUB64FAE.js +0 -90
- package/chunks/chunk-LEH5C7FV.js +0 -232
- package/chunks/chunk-SZRN75WQ.js +0 -29
- package/chunks/chunk-UGYMA4EI.js +0 -219
- package/chunks/chunk-Z2BC6UJ5.js +0 -8575
- package/chunks/contextCommand-JLHYA34Z.js +0 -80
- package/chunks/daemon-status-provider-2233Q37D.js +0 -89
- package/chunks/earlyInputCapture-A7NDU3PF.js +0 -82
- package/chunks/errors-M7CLORXH.js +0 -88
- package/chunks/exitPlanMode-GXTBWQAR.js +0 -403
- package/chunks/handleAutoUpdate-6DBEZYPV.js +0 -81
- package/chunks/i18n-VUJJZIMU.js +0 -97
- package/chunks/initializer-UWAK5U5O.js +0 -86
- package/chunks/installationInfo-6O2YAA52.js +0 -80
- package/chunks/list-GB4ESM3T.js +0 -89
- package/chunks/loadedSettingsAdapter-OT6JVQ7U.js +0 -83
- package/chunks/mcp-6DBDJPFU.js +0 -83
- package/chunks/nonInteractiveCli-MOYCYBBU.js +0 -141
- package/chunks/pidfile-TFRZZZIO.js +0 -86
- package/chunks/read-file-APMO3PSX.js +0 -31
- package/chunks/resumeHistoryUtils-6KRYEAWZ.js +0 -91
- package/chunks/ripGrep-BEJDEDXW.js +0 -73
- package/chunks/serve-7BSTXJ4T.js +0 -89
- package/chunks/shell-HH3PF3A2.js +0 -83
- package/chunks/spawnChannel-RWNDBXGA.js +0 -82
- package/chunks/src-GE4TTTML.js +0 -3147
- package/chunks/standalone-update-Q6WFRZZQ.js +0 -92
- package/chunks/theme-manager-SWRILQHI.js +0 -77
- package/chunks/total-session-admission-DLHHHLD3.js +0 -84
- package/chunks/trustedFolders-KHXHY6PY.js +0 -93
- package/chunks/updateCheck-RKL6M5XN.js +0 -92
- package/chunks/useAutoAcceptIndicator-CFQ5BUJL.js +0 -93
- package/chunks/workspace-providers-status-QSVZUETE.js +0 -86
- package/chunks/workspace-registry-UT4RBNBM.js +0 -88
- package/chunks/workspace-service-JFWRUS4V.js +0 -98
- package/chunks/workspace-skills-status-ZBBKJOI2.js +0 -85
- package/chunks/write-file-VHIXW5M7.js +0 -73
- package/web-shell/assets/channel-Cq7YKtfC.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-CQ9aC1Tg.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CQ9aC1Tg.js +0 -1
- package/web-shell/assets/index-D9haPt0X.css +0 -5
- package/web-shell/assets/index-ckX9Pq5k.js +0 -1230
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-B7W4zlCr.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,8 +1,5 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import {
|
|
4
|
-
useAutoAcceptIndicator
|
|
5
|
-
} from "./chunk-2X55UKQE.js";
|
|
6
3
|
import {
|
|
7
4
|
classifyApiError
|
|
8
5
|
} from "./chunk-V7RNNPGC.js";
|
|
@@ -12,7 +9,7 @@ import {
|
|
|
12
9
|
import {
|
|
13
10
|
TUI_CHAT_RECORDING_FAILURE_MESSAGE,
|
|
14
11
|
reportChatRecordingFailureToAdapter
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KLESQCW6.js";
|
|
16
13
|
import {
|
|
17
14
|
MAX_SUGGESTIONS_TO_SHOW,
|
|
18
15
|
SESSION_MENTION_PREFIX,
|
|
@@ -24,10 +21,10 @@ import {
|
|
|
24
21
|
matchMcpServerPrefix,
|
|
25
22
|
resolveAtCommandQuery,
|
|
26
23
|
sanitizeDisplayText
|
|
27
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-XZB72HUB.js";
|
|
28
25
|
import {
|
|
29
26
|
StreamJsonOutputAdapter
|
|
30
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-CAEQL6GZ.js";
|
|
31
28
|
import {
|
|
32
29
|
BuiltinCommandLoader,
|
|
33
30
|
BundledSkillLoader,
|
|
@@ -42,6 +39,7 @@ import {
|
|
|
42
39
|
appendUserPromptExpansionAdditionalContext,
|
|
43
40
|
copyToClipboard,
|
|
44
41
|
createEmptyHookEventInfo,
|
|
42
|
+
dayKey,
|
|
45
43
|
findMidInputSlashCommand,
|
|
46
44
|
findSlashCommandTokens,
|
|
47
45
|
formatApprovalModeDescription,
|
|
@@ -56,25 +54,28 @@ import {
|
|
|
56
54
|
isBtwCommand,
|
|
57
55
|
isMidInputCompletableCommand,
|
|
58
56
|
isSlashCommand,
|
|
57
|
+
isStackedSkillCompletableCommand,
|
|
58
|
+
isValidStackedSkillPrefix,
|
|
59
59
|
normalizePartList,
|
|
60
|
+
parseDayKey,
|
|
60
61
|
parseSlashCommand,
|
|
61
62
|
parseStackedSlashCommands,
|
|
62
63
|
refreshExtensionContentRuntime,
|
|
63
64
|
resetBackgroundStateForSessionSwitch,
|
|
64
65
|
serializeUserPromptExpansionPrompt,
|
|
65
66
|
supportsMatchers
|
|
66
|
-
} from "./chunk-
|
|
67
|
-
import "./chunk-
|
|
67
|
+
} from "./chunk-LI53FGDL.js";
|
|
68
|
+
import "./chunk-OIG257JR.js";
|
|
68
69
|
import {
|
|
69
70
|
startPostRenderPrefetches
|
|
70
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-6OF62NPQ.js";
|
|
71
72
|
import {
|
|
72
73
|
EXTENSION_RELOAD_FAILED_REASON,
|
|
73
74
|
ExtensionRefreshState,
|
|
74
75
|
appEvents,
|
|
75
76
|
cleanupReviewWorktreeLeases,
|
|
76
77
|
loadHierarchicalGeminiMemory
|
|
77
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-ANND7YTH.js";
|
|
78
79
|
import {
|
|
79
80
|
AboutBox,
|
|
80
81
|
BaseSelectionList,
|
|
@@ -106,6 +107,7 @@ import {
|
|
|
106
107
|
UIStateContext,
|
|
107
108
|
USER_AGREEMENT_RATE_HIGH,
|
|
108
109
|
USER_AGREEMENT_RATE_MEDIUM,
|
|
110
|
+
VirtualViewportContext,
|
|
109
111
|
checkExhaustive,
|
|
110
112
|
colorizeCode,
|
|
111
113
|
countMarkdownSourceBlocks,
|
|
@@ -146,41 +148,23 @@ import {
|
|
|
146
148
|
useTerminalSize,
|
|
147
149
|
useTextBuffer,
|
|
148
150
|
useUIActions,
|
|
149
|
-
useUIState
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
KeypressProvider,
|
|
153
|
-
useFocus,
|
|
154
|
-
useKeypress,
|
|
155
|
-
useKeypressContext
|
|
156
|
-
} from "./chunk-LQIW3YFY.js";
|
|
151
|
+
useUIState,
|
|
152
|
+
useVirtualViewport
|
|
153
|
+
} from "./chunk-TCBP4Q3K.js";
|
|
157
154
|
import {
|
|
158
155
|
getCommandDisplayName,
|
|
159
156
|
getCommandSourceBadge
|
|
160
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-M4O2DCE3.js";
|
|
161
158
|
import {
|
|
162
159
|
computeSessionStats,
|
|
163
160
|
levelLabel
|
|
164
|
-
} from "./chunk-
|
|
165
|
-
import {
|
|
166
|
-
BEL,
|
|
167
|
-
OSC_PREFIX,
|
|
168
|
-
cleanupOldClipboardImages,
|
|
169
|
-
clipboardHasImage,
|
|
170
|
-
detectTerminal,
|
|
171
|
-
generateKittyId,
|
|
172
|
-
oscGhosttyNotify,
|
|
173
|
-
oscITerm2Notify,
|
|
174
|
-
oscKittyNotify,
|
|
175
|
-
saveClipboardImage,
|
|
176
|
-
writeOsc52
|
|
177
|
-
} from "./chunk-J56UI34H.js";
|
|
161
|
+
} from "./chunk-SWRHIQDT.js";
|
|
178
162
|
import "./chunk-4WGODMVR.js";
|
|
179
163
|
import {
|
|
180
164
|
MaxSizedBox,
|
|
181
165
|
OverflowProvider,
|
|
182
166
|
useOverflowState
|
|
183
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-URPQ5QZM.js";
|
|
184
168
|
import {
|
|
185
169
|
GeminiRespondingSpinner,
|
|
186
170
|
GeminiSpinner,
|
|
@@ -194,10 +178,41 @@ import {
|
|
|
194
178
|
expandCollapsedHistory,
|
|
195
179
|
isCollapsibleTool,
|
|
196
180
|
useStreamingContext
|
|
197
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-3QDXECUB.js";
|
|
198
182
|
import {
|
|
199
183
|
theme
|
|
200
|
-
} from "./chunk-
|
|
184
|
+
} from "./chunk-GKX7E4CO.js";
|
|
185
|
+
import {
|
|
186
|
+
stopAndGetCapturedInput
|
|
187
|
+
} from "./chunk-JMONIXMJ.js";
|
|
188
|
+
import {
|
|
189
|
+
disableKittyProtocol,
|
|
190
|
+
isKittyProtocolEnabled,
|
|
191
|
+
isKittyProtocolSupported,
|
|
192
|
+
pushKittyProtocolFlags
|
|
193
|
+
} from "./chunk-PQNHRFJC.js";
|
|
194
|
+
import {
|
|
195
|
+
useAutoAcceptIndicator
|
|
196
|
+
} from "./chunk-LIJID5PD.js";
|
|
197
|
+
import {
|
|
198
|
+
KeypressProvider,
|
|
199
|
+
useFocus,
|
|
200
|
+
useKeypress,
|
|
201
|
+
useKeypressContext
|
|
202
|
+
} from "./chunk-OAOPCTG6.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-CI2PGI7Z.js";
|
|
201
216
|
import {
|
|
202
217
|
require_jsx_runtime
|
|
203
218
|
} from "./chunk-SV5PQVQE.js";
|
|
@@ -214,51 +229,40 @@ import {
|
|
|
214
229
|
use_is_screen_reader_enabled_default,
|
|
215
230
|
use_stdin_default,
|
|
216
231
|
use_stdout_default
|
|
217
|
-
} from "./chunk-
|
|
218
|
-
import {
|
|
219
|
-
stopAndGetCapturedInput
|
|
220
|
-
} from "./chunk-63P4EL5V.js";
|
|
221
|
-
import {
|
|
222
|
-
disableKittyProtocol,
|
|
223
|
-
isKittyProtocolEnabled,
|
|
224
|
-
isKittyProtocolSupported,
|
|
225
|
-
pushKittyProtocolFlags
|
|
226
|
-
} from "./chunk-PQNHRFJC.js";
|
|
232
|
+
} from "./chunk-2IIJTXYF.js";
|
|
227
233
|
import {
|
|
228
234
|
relaunchApp
|
|
229
|
-
} from "./chunk-
|
|
235
|
+
} from "./chunk-VBX5IFEN.js";
|
|
230
236
|
import {
|
|
231
237
|
setUpdateHandler
|
|
232
|
-
} from "./chunk-
|
|
233
|
-
import "./chunk-
|
|
234
|
-
import "./chunk-K36B6G2O.js";
|
|
238
|
+
} from "./chunk-RF4FA22B.js";
|
|
239
|
+
import "./chunk-5ZEFGTII.js";
|
|
235
240
|
import {
|
|
236
241
|
AUTO_THEME_NAME,
|
|
237
242
|
DEFAULT_THEME,
|
|
238
243
|
themeManager
|
|
239
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-GATT5TKW.js";
|
|
240
245
|
import "./chunk-KW7NOTN6.js";
|
|
241
246
|
import {
|
|
242
247
|
require_react
|
|
243
248
|
} from "./chunk-5QWWOFGG.js";
|
|
244
|
-
import "./chunk-
|
|
245
|
-
import "./chunk-6H67XLET.js";
|
|
246
|
-
import "./chunk-7MVVZO4N.js";
|
|
249
|
+
import "./chunk-DGV27C34.js";
|
|
247
250
|
import {
|
|
248
251
|
getErrorMessage as getErrorMessage2
|
|
249
|
-
} from "./chunk-
|
|
250
|
-
import "./chunk-
|
|
252
|
+
} from "./chunk-5EHIP3GX.js";
|
|
253
|
+
import "./chunk-CUWGNCKW.js";
|
|
254
|
+
import "./chunk-V47JGII4.js";
|
|
251
255
|
import "./chunk-YAF2MQZ6.js";
|
|
252
256
|
import {
|
|
253
257
|
openQwenAsrRealtimeStream,
|
|
254
258
|
openVoiceStream,
|
|
255
259
|
openVoiceStreamWithRetry
|
|
256
|
-
} from "./chunk-
|
|
260
|
+
} from "./chunk-BCZFQXWK.js";
|
|
257
261
|
import {
|
|
258
262
|
recordGoalStatusItem,
|
|
259
263
|
restoreGoalFromHistory
|
|
260
|
-
} from "./chunk-
|
|
261
|
-
import "./chunk-
|
|
264
|
+
} from "./chunk-4FQ4OKOU.js";
|
|
265
|
+
import "./chunk-LGAOC3ZS.js";
|
|
262
266
|
import {
|
|
263
267
|
cpLen,
|
|
264
268
|
cpSlice,
|
|
@@ -270,8 +274,8 @@ import {
|
|
|
270
274
|
sanitizeTerminalText,
|
|
271
275
|
stripUnsafeCharacters,
|
|
272
276
|
toCodePoints
|
|
273
|
-
} from "./chunk-
|
|
274
|
-
import "./chunk-
|
|
277
|
+
} from "./chunk-YDLJGZHL.js";
|
|
278
|
+
import "./chunk-OCUM7TJA.js";
|
|
275
279
|
import {
|
|
276
280
|
stringWidth
|
|
277
281
|
} from "./chunk-2MIN6GRR.js";
|
|
@@ -280,31 +284,27 @@ import {
|
|
|
280
284
|
isHistoryItemVisibleAfterRestore
|
|
281
285
|
} from "./chunk-QTERJVPZ.js";
|
|
282
286
|
import "./chunk-3Z43GZUQ.js";
|
|
287
|
+
import "./chunk-RXFQM6FQ.js";
|
|
288
|
+
import "./chunk-4D3MHM5F.js";
|
|
289
|
+
import "./chunk-6H67XLET.js";
|
|
283
290
|
import {
|
|
284
291
|
assertVoiceBaseUrlNetworkAllowed,
|
|
285
292
|
isKeytermEcho,
|
|
286
293
|
isStreamingVoiceModel,
|
|
287
294
|
resolveVoiceStreamConfig,
|
|
288
295
|
transcribeVoiceAudio
|
|
289
|
-
} from "./chunk-
|
|
296
|
+
} from "./chunk-XVYRMUI5.js";
|
|
290
297
|
import {
|
|
291
298
|
formatUnsupportedVoiceModelMessage,
|
|
292
299
|
isSelectableVoiceModel
|
|
293
|
-
} from "./chunk-
|
|
294
|
-
import "./chunk-
|
|
295
|
-
import "./chunk-RXFQM6FQ.js";
|
|
296
|
-
import "./chunk-PSOO6YXD.js";
|
|
297
|
-
import {
|
|
298
|
-
requestConsentInteractive,
|
|
299
|
-
requestConsentOrFail
|
|
300
|
-
} from "./chunk-PC6JANNU.js";
|
|
301
|
-
import "./chunk-57OAHC2Y.js";
|
|
300
|
+
} from "./chunk-CYPJYJIX.js";
|
|
301
|
+
import "./chunk-ZHBO7WVX.js";
|
|
302
302
|
import {
|
|
303
303
|
createLoadedSettingsAdapter
|
|
304
|
-
} from "./chunk-
|
|
304
|
+
} from "./chunk-S7G7Z3MP.js";
|
|
305
305
|
import {
|
|
306
306
|
getExtendedSystemInfo
|
|
307
|
-
} from "./chunk-
|
|
307
|
+
} from "./chunk-GKWLJW7Z.js";
|
|
308
308
|
import {
|
|
309
309
|
formatDuration,
|
|
310
310
|
formatMemoryUsage,
|
|
@@ -312,27 +312,39 @@ import {
|
|
|
312
312
|
formatTokenCount
|
|
313
313
|
} from "./chunk-E5Z2AVNV.js";
|
|
314
314
|
import "./chunk-GLWP3FDB.js";
|
|
315
|
-
import "./chunk-
|
|
315
|
+
import "./chunk-XCGIMOLN.js";
|
|
316
316
|
import {
|
|
317
317
|
isInlineModelOverrideAllowed
|
|
318
|
-
} from "./chunk-
|
|
319
|
-
import "./chunk-X5XDDSSH.js";
|
|
320
|
-
import "./chunk-4WIZGAH3.js";
|
|
321
|
-
import "./chunk-7ZCNENPP.js";
|
|
322
|
-
import "./chunk-V6WHFGST.js";
|
|
318
|
+
} from "./chunk-7UKQW4JU.js";
|
|
323
319
|
import {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
320
|
+
computeWorkspaceSkillListUpdates,
|
|
321
|
+
resolveSkillSettings,
|
|
322
|
+
skillSettingStrings
|
|
323
|
+
} from "./chunk-Z4X5MTRT.js";
|
|
324
|
+
import "./chunk-3RMX26V7.js";
|
|
325
|
+
import {
|
|
326
|
+
requestConsentInteractive,
|
|
327
|
+
requestConsentOrFail
|
|
328
|
+
} from "./chunk-4755HD5V.js";
|
|
329
|
+
import "./chunk-57OAHC2Y.js";
|
|
330
|
+
import "./chunk-MFW7APBA.js";
|
|
331
|
+
import "./chunk-FANRZEAJ.js";
|
|
332
|
+
import "./chunk-JZQUOT4B.js";
|
|
333
|
+
import "./chunk-V6WHFGST.js";
|
|
328
334
|
import "./chunk-2RFKHEXL.js";
|
|
329
|
-
import "./chunk-
|
|
330
|
-
import "./chunk-
|
|
335
|
+
import "./chunk-FYJ7W2PI.js";
|
|
336
|
+
import "./chunk-U4VTUMMK.js";
|
|
337
|
+
import "./chunk-6MPDY6ZG.js";
|
|
338
|
+
import "./chunk-ALMR3E6Q.js";
|
|
331
339
|
import "./chunk-BK2UNYWD.js";
|
|
332
340
|
import "./chunk-M5GB774H.js";
|
|
333
|
-
import "./chunk-
|
|
341
|
+
import "./chunk-4G2BISNC.js";
|
|
342
|
+
import "./chunk-ZPZ7ZJEE.js";
|
|
343
|
+
import "./chunk-JCJ7LKNA.js";
|
|
334
344
|
import "./chunk-UDXSXLER.js";
|
|
335
|
-
import
|
|
345
|
+
import {
|
|
346
|
+
loadMcpApprovals
|
|
347
|
+
} from "./chunk-KQGB3ME2.js";
|
|
336
348
|
import {
|
|
337
349
|
CORRUPTED_SUFFIX,
|
|
338
350
|
SettingScope,
|
|
@@ -355,7 +367,7 @@ import {
|
|
|
355
367
|
settingExistsInScope,
|
|
356
368
|
validateSettingValue,
|
|
357
369
|
writeOutputLanguageAndRegisterPath
|
|
358
|
-
} from "./chunk-
|
|
370
|
+
} from "./chunk-7A4V5CJY.js";
|
|
359
371
|
import "./chunk-RKUWKYED.js";
|
|
360
372
|
import "./chunk-GOXKNSDZ.js";
|
|
361
373
|
import "./chunk-IDS7MSUP.js";
|
|
@@ -364,27 +376,30 @@ import {
|
|
|
364
376
|
localizeToolDisplayName,
|
|
365
377
|
t,
|
|
366
378
|
ta
|
|
367
|
-
} from "./chunk-
|
|
368
|
-
import "./chunk-
|
|
379
|
+
} from "./chunk-RWZPM2BP.js";
|
|
380
|
+
import "./chunk-UJBURGBH.js";
|
|
369
381
|
import "./chunk-6PEXNQTX.js";
|
|
370
|
-
import "./chunk-
|
|
371
|
-
import
|
|
372
|
-
getCliVersion
|
|
373
|
-
} from "./chunk-YX324OPW.js";
|
|
374
|
-
import "./chunk-VJNBRRZG.js";
|
|
382
|
+
import "./chunk-DP3IHZGG.js";
|
|
383
|
+
import "./chunk-TJHLQ45J.js";
|
|
375
384
|
import {
|
|
376
385
|
isWorkspaceTrusted,
|
|
377
386
|
loadTrustedFolders
|
|
378
|
-
} from "./chunk-
|
|
387
|
+
} from "./chunk-5IDU2UGL.js";
|
|
379
388
|
import {
|
|
380
389
|
require_strip_json_comments
|
|
381
390
|
} from "./chunk-ALGGS7UH.js";
|
|
382
391
|
import "./chunk-MR3PXB6E.js";
|
|
392
|
+
import "./chunk-XFSFZCM5.js";
|
|
393
|
+
import "./chunk-URK542T4.js";
|
|
394
|
+
import {
|
|
395
|
+
getCliVersion
|
|
396
|
+
} from "./chunk-HGQIL6NG.js";
|
|
397
|
+
import "./chunk-VJNBRRZG.js";
|
|
383
398
|
import {
|
|
384
399
|
clearScreen,
|
|
385
|
-
writeStderrLine
|
|
400
|
+
writeStderrLine,
|
|
401
|
+
writeStderrLineSafe
|
|
386
402
|
} from "./chunk-OWAK7LMW.js";
|
|
387
|
-
import "./chunk-XFSFZCM5.js";
|
|
388
403
|
import {
|
|
389
404
|
ALIBABA_PROVIDERS,
|
|
390
405
|
AsyncFzf,
|
|
@@ -491,67 +506,70 @@ import {
|
|
|
491
506
|
validateWorkflowName,
|
|
492
507
|
watchRepoBranch,
|
|
493
508
|
writeRuntimeStatus
|
|
494
|
-
} from "./chunk-
|
|
509
|
+
} from "./chunk-EYGWU66Z.js";
|
|
495
510
|
import "./chunk-5M6IDOMF.js";
|
|
496
511
|
import "./chunk-TWPJO254.js";
|
|
497
512
|
import "./chunk-H6XPXXMH.js";
|
|
498
|
-
import "./chunk-
|
|
499
|
-
import "./chunk-
|
|
500
|
-
import "./chunk-
|
|
501
|
-
import "./chunk-
|
|
502
|
-
import "./chunk-FNQ6T3CV.js";
|
|
503
|
-
import "./chunk-ZOIFNCKL.js";
|
|
504
|
-
import "./chunk-PWTZEM3C.js";
|
|
513
|
+
import "./chunk-CVHIL5IG.js";
|
|
514
|
+
import "./chunk-UPUG4GXM.js";
|
|
515
|
+
import "./chunk-64LQLPL7.js";
|
|
516
|
+
import "./chunk-2LQTH543.js";
|
|
505
517
|
import "./chunk-KRXPRVGL.js";
|
|
506
518
|
import "./chunk-6PVPNMXU.js";
|
|
507
519
|
import {
|
|
508
520
|
resolveModelId
|
|
509
|
-
} from "./chunk-
|
|
510
|
-
import "./chunk-
|
|
511
|
-
import "./chunk-
|
|
521
|
+
} from "./chunk-LW67T6GH.js";
|
|
522
|
+
import "./chunk-IRH27ZC2.js";
|
|
523
|
+
import "./chunk-QHWCP53L.js";
|
|
524
|
+
import "./chunk-PONHVBRT.js";
|
|
525
|
+
import "./chunk-PMGFWLAZ.js";
|
|
526
|
+
import "./chunk-T26EAKDL.js";
|
|
512
527
|
import "./chunk-CPBF7KYF.js";
|
|
528
|
+
import "./chunk-6QIGFD5W.js";
|
|
529
|
+
import {
|
|
530
|
+
HOOKS_CONFIG_FIELDS
|
|
531
|
+
} from "./chunk-XWWKIXVD.js";
|
|
532
|
+
import "./chunk-75GFAX4R.js";
|
|
533
|
+
import "./chunk-OKF7JF3R.js";
|
|
534
|
+
import "./chunk-6FMJLI5M.js";
|
|
513
535
|
import {
|
|
514
536
|
APPROVAL_MODES,
|
|
515
537
|
getStartupContextLength,
|
|
516
538
|
isSystemReminderContent,
|
|
517
539
|
runOutsideAgentContext
|
|
518
|
-
} from "./chunk-
|
|
519
|
-
import "./chunk-
|
|
520
|
-
import "./chunk-JZA3JUDJ.js";
|
|
521
|
-
import {
|
|
522
|
-
HOOKS_CONFIG_FIELDS
|
|
523
|
-
} from "./chunk-3QMGYBFN.js";
|
|
540
|
+
} from "./chunk-FH6SU2OG.js";
|
|
541
|
+
import "./chunk-S6LOFUVP.js";
|
|
524
542
|
import "./chunk-JCW2R7WC.js";
|
|
525
543
|
import {
|
|
526
544
|
isPathWithinRoot
|
|
527
|
-
} from "./chunk-
|
|
528
|
-
import "./chunk-
|
|
529
|
-
import "./chunk-E5TUC6CA.js";
|
|
545
|
+
} from "./chunk-2DN4J57Y.js";
|
|
546
|
+
import "./chunk-ZPJWUGCS.js";
|
|
530
547
|
import {
|
|
531
548
|
osc8Hyperlink,
|
|
532
549
|
qwenOAuth2Events,
|
|
533
550
|
sanitizeForOsc,
|
|
534
551
|
supportsHyperlinks,
|
|
535
552
|
wrapForMultiplexer
|
|
536
|
-
} from "./chunk-
|
|
537
|
-
import "./chunk-
|
|
538
|
-
import "./chunk-
|
|
539
|
-
import "./chunk-
|
|
553
|
+
} from "./chunk-2LKVPASC.js";
|
|
554
|
+
import "./chunk-NAVJD2PQ.js";
|
|
555
|
+
import "./chunk-LW3RFMG7.js";
|
|
556
|
+
import "./chunk-W4MIWP6M.js";
|
|
540
557
|
import {
|
|
541
558
|
REASONING_EFFORT_TIERS
|
|
542
|
-
} from "./chunk-
|
|
559
|
+
} from "./chunk-DGEIYUC3.js";
|
|
543
560
|
import {
|
|
544
561
|
getUnsupportedImageFormatWarning,
|
|
545
562
|
isSupportedImageMimeType
|
|
546
|
-
} from "./chunk-
|
|
563
|
+
} from "./chunk-MPHPFVKK.js";
|
|
547
564
|
import "./chunk-GLNBDYUX.js";
|
|
548
565
|
import "./chunk-DJ2GSRLV.js";
|
|
549
|
-
import "./chunk-
|
|
550
|
-
import "./chunk-
|
|
551
|
-
import "./chunk-
|
|
566
|
+
import "./chunk-ZWUDSQBD.js";
|
|
567
|
+
import "./chunk-RQLRERVY.js";
|
|
568
|
+
import "./chunk-2J3OJGTL.js";
|
|
552
569
|
import "./chunk-P3QQPMQA.js";
|
|
553
|
-
import "./chunk-
|
|
554
|
-
import "./chunk-
|
|
570
|
+
import "./chunk-RPLGZJV2.js";
|
|
571
|
+
import "./chunk-GLCZKT5V.js";
|
|
572
|
+
import "./chunk-DZLYR4U3.js";
|
|
555
573
|
import {
|
|
556
574
|
ApiCancelEvent,
|
|
557
575
|
AuthEvent,
|
|
@@ -592,7 +610,7 @@ import {
|
|
|
592
610
|
runVisionBridge,
|
|
593
611
|
shouldRunVisionBridge,
|
|
594
612
|
splitImageParts
|
|
595
|
-
} from "./chunk-
|
|
613
|
+
} from "./chunk-2Q4CZ3V6.js";
|
|
596
614
|
import "./chunk-VGC4I5JJ.js";
|
|
597
615
|
import {
|
|
598
616
|
AUTO_MEMORY_INDEX_FILENAME,
|
|
@@ -600,30 +618,27 @@ import {
|
|
|
600
618
|
getAutoMemoryRoot,
|
|
601
619
|
getUserAutoMemoryRoot,
|
|
602
620
|
isAnyAutoMemPath
|
|
603
|
-
} from "./chunk-
|
|
621
|
+
} from "./chunk-SGFT55XI.js";
|
|
622
|
+
import "./chunk-Y4IHBGBP.js";
|
|
623
|
+
import {
|
|
624
|
+
ToolNames,
|
|
625
|
+
isShellProgressData
|
|
626
|
+
} from "./chunk-Y6AXW2OG.js";
|
|
604
627
|
import {
|
|
605
628
|
MAINLINE_CODER_MODEL
|
|
606
|
-
} from "./chunk-
|
|
629
|
+
} from "./chunk-OINT3ZNV.js";
|
|
607
630
|
import "./chunk-46UV252V.js";
|
|
608
|
-
import "./chunk-A4UCTEB5.js";
|
|
609
|
-
import "./chunk-XWRJCPHC.js";
|
|
610
631
|
import {
|
|
611
632
|
DEFAULT_TOKEN_LIMIT
|
|
612
|
-
} from "./chunk-
|
|
613
|
-
import "./chunk-
|
|
614
|
-
import "./chunk-
|
|
633
|
+
} from "./chunk-ZBVS26BY.js";
|
|
634
|
+
import "./chunk-WZRWHXFE.js";
|
|
635
|
+
import "./chunk-A3NDJ5SB.js";
|
|
615
636
|
import {
|
|
616
637
|
atomicWriteFileSync
|
|
617
|
-
} from "./chunk-
|
|
618
|
-
import "./chunk-
|
|
619
|
-
import "./chunk-
|
|
620
|
-
import "./chunk-
|
|
621
|
-
import "./chunk-U7ZFW55U.js";
|
|
622
|
-
import "./chunk-UUUTRMI2.js";
|
|
623
|
-
import {
|
|
624
|
-
ToolNames,
|
|
625
|
-
isShellProgressData
|
|
626
|
-
} from "./chunk-PR75REBZ.js";
|
|
638
|
+
} from "./chunk-7XATOOE7.js";
|
|
639
|
+
import "./chunk-YX4DHA6S.js";
|
|
640
|
+
import "./chunk-W4RQUHY3.js";
|
|
641
|
+
import "./chunk-G7XXKQYS.js";
|
|
627
642
|
import {
|
|
628
643
|
Storage,
|
|
629
644
|
UnauthorizedError,
|
|
@@ -635,12 +650,13 @@ import {
|
|
|
635
650
|
isNodeError,
|
|
636
651
|
shortenPath,
|
|
637
652
|
tildeifyPath
|
|
638
|
-
} from "./chunk-
|
|
639
|
-
import "./chunk-
|
|
653
|
+
} from "./chunk-UHUSJ6X7.js";
|
|
654
|
+
import "./chunk-VOQXFAY5.js";
|
|
655
|
+
import "./chunk-7BV2P4S3.js";
|
|
640
656
|
import {
|
|
641
657
|
registerCleanup,
|
|
642
658
|
runExitCleanup
|
|
643
|
-
} from "./chunk-
|
|
659
|
+
} from "./chunk-SMWPUA2A.js";
|
|
644
660
|
import {
|
|
645
661
|
finalizeStartupProfile,
|
|
646
662
|
profileCheckpoint
|
|
@@ -655,7 +671,7 @@ import {
|
|
|
655
671
|
import "./chunk-TYAMGABM.js";
|
|
656
672
|
import "./chunk-FCMNKVXT.js";
|
|
657
673
|
import "./chunk-AMDSOFFV.js";
|
|
658
|
-
import "./chunk-
|
|
674
|
+
import "./chunk-QUGAUQGJ.js";
|
|
659
675
|
import {
|
|
660
676
|
init_esbuild_shims
|
|
661
677
|
} from "./chunk-5O2XNYP6.js";
|
|
@@ -667,7 +683,7 @@ import {
|
|
|
667
683
|
// packages/cli/src/ui/startInteractiveUI.tsx
|
|
668
684
|
init_esbuild_shims();
|
|
669
685
|
import { basename as basename4 } from "node:path";
|
|
670
|
-
var
|
|
686
|
+
var import_react166 = __toESM(require_react(), 1);
|
|
671
687
|
|
|
672
688
|
// packages/cli/src/dualOutput/DualOutputBridge.ts
|
|
673
689
|
init_esbuild_shims();
|
|
@@ -1283,7 +1299,7 @@ var useRemoteInput = /* @__PURE__ */ __name(() => (0, import_react2.useContext)(
|
|
|
1283
1299
|
|
|
1284
1300
|
// packages/cli/src/ui/AppContainer.tsx
|
|
1285
1301
|
init_esbuild_shims();
|
|
1286
|
-
var
|
|
1302
|
+
var import_react164 = __toESM(require_react(), 1);
|
|
1287
1303
|
|
|
1288
1304
|
// packages/cli/src/ui/App.tsx
|
|
1289
1305
|
init_esbuild_shims();
|
|
@@ -5231,6 +5247,11 @@ var SessionTab = /* @__PURE__ */ __name(() => {
|
|
|
5231
5247
|
totalCached += m.tokens.cached;
|
|
5232
5248
|
}
|
|
5233
5249
|
const cacheRate = totalInput > 0 ? totalCached / totalInput * 100 : 0;
|
|
5250
|
+
const generation = metrics.generation;
|
|
5251
|
+
const lastGeneration = generation?.last;
|
|
5252
|
+
const lastTps = lastGeneration && lastGeneration.generationDurationMs > 0 ? lastGeneration.outputTokens / (lastGeneration.generationDurationMs / 1e3) : void 0;
|
|
5253
|
+
const averageTtft = generation && generation.timedRequests > 0 ? generation.totalTtftMs / generation.timedRequests : void 0;
|
|
5254
|
+
const sessionTps = generation && generation.totalGenerationDurationMs > 0 ? generation.totalThroughputOutputTokens / (generation.totalGenerationDurationMs / 1e3) : void 0;
|
|
5234
5255
|
const successColor = getStatusColor(computed.successRate, {
|
|
5235
5256
|
green: TOOL_SUCCESS_RATE_HIGH,
|
|
5236
5257
|
yellow: TOOL_SUCCESS_RATE_MEDIUM
|
|
@@ -5342,6 +5363,67 @@ var SessionTab = /* @__PURE__ */ __name(() => {
|
|
|
5342
5363
|
] })
|
|
5343
5364
|
] })
|
|
5344
5365
|
] }),
|
|
5366
|
+
lastGeneration && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
5367
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { bold: true, color: theme.text.primary, children: [
|
|
5368
|
+
t("Generation Metrics"),
|
|
5369
|
+
" (",
|
|
5370
|
+
t("Latest Request"),
|
|
5371
|
+
")"
|
|
5372
|
+
] }),
|
|
5373
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
|
|
5374
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: labelWidth, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
5375
|
+
t("Model"),
|
|
5376
|
+
":"
|
|
5377
|
+
] }) }),
|
|
5378
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: lastGeneration.model })
|
|
5379
|
+
] }),
|
|
5380
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
|
|
5381
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: labelWidth, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.secondary, children: "TTFT:" }) }),
|
|
5382
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: formatDuration(lastGeneration.ttftMs) })
|
|
5383
|
+
] }),
|
|
5384
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
|
|
5385
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: labelWidth, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
5386
|
+
t("Generation Time"),
|
|
5387
|
+
":"
|
|
5388
|
+
] }) }),
|
|
5389
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: formatDuration(lastGeneration.generationDurationMs) })
|
|
5390
|
+
] }),
|
|
5391
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
|
|
5392
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: labelWidth, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
5393
|
+
t("Output Tokens"),
|
|
5394
|
+
":"
|
|
5395
|
+
] }) }),
|
|
5396
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: lastGeneration.outputTokens.toLocaleString() })
|
|
5397
|
+
] }),
|
|
5398
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
|
|
5399
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: labelWidth, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.secondary, children: "TPS:" }) }),
|
|
5400
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: lastTps === void 0 ? "\u2014" : `${lastTps.toFixed(1)} tok/s` })
|
|
5401
|
+
] }),
|
|
5402
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { paddingLeft: 2, children: [
|
|
5403
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
5404
|
+
"\xBB ",
|
|
5405
|
+
t("Requests"),
|
|
5406
|
+
":"
|
|
5407
|
+
] }) }),
|
|
5408
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: generation.timedRequests })
|
|
5409
|
+
] }),
|
|
5410
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { paddingLeft: 2, children: [
|
|
5411
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
5412
|
+
"\xBB ",
|
|
5413
|
+
t("Average TTFT"),
|
|
5414
|
+
":"
|
|
5415
|
+
] }) }),
|
|
5416
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: averageTtft === void 0 ? "\u2014" : formatDuration(averageTtft) })
|
|
5417
|
+
] }),
|
|
5418
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { paddingLeft: 2, children: [
|
|
5419
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
5420
|
+
"\xBB ",
|
|
5421
|
+
t("Session TPS"),
|
|
5422
|
+
":"
|
|
5423
|
+
] }) }),
|
|
5424
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: sessionTps === void 0 ? "\u2014" : `${sessionTps.toFixed(1)} tok/s` })
|
|
5425
|
+
] })
|
|
5426
|
+
] }),
|
|
5345
5427
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
5346
5428
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { bold: true, color: theme.text.primary, children: t("Tokens") }),
|
|
5347
5429
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
|
|
@@ -5437,21 +5519,13 @@ function computeThresholds2(data) {
|
|
|
5437
5519
|
return [p(0.25), p(0.5), p(0.75), p(0.9)];
|
|
5438
5520
|
}
|
|
5439
5521
|
__name(computeThresholds2, "computeThresholds");
|
|
5440
|
-
function formatDateKey(d) {
|
|
5441
|
-
const y = d.getFullYear();
|
|
5442
|
-
const m = String(d.getMonth() + 1).padStart(2, "0");
|
|
5443
|
-
const day = String(d.getDate()).padStart(2, "0");
|
|
5444
|
-
return `${y}-${m}-${day}`;
|
|
5445
|
-
}
|
|
5446
|
-
__name(formatDateKey, "formatDateKey");
|
|
5447
5522
|
function buildHeatmapData(data, weeks = 52, monthOffset = 0) {
|
|
5448
5523
|
const now = /* @__PURE__ */ new Date();
|
|
5449
5524
|
now.setHours(0, 0, 0, 0);
|
|
5450
5525
|
const dataKeys = Object.keys(data).filter((k) => data[k] > 0).sort();
|
|
5451
5526
|
let endDate = new Date(now);
|
|
5452
5527
|
if (dataKeys.length > 0) {
|
|
5453
|
-
const latest =
|
|
5454
|
-
latest.setHours(0, 0, 0, 0);
|
|
5528
|
+
const latest = parseDayKey(dataKeys[dataKeys.length - 1]);
|
|
5455
5529
|
if (latest.getTime() > endDate.getTime()) endDate = latest;
|
|
5456
5530
|
}
|
|
5457
5531
|
if (monthOffset > 0) {
|
|
@@ -5474,12 +5548,12 @@ function buildHeatmapData(data, weeks = 52, monthOffset = 0) {
|
|
|
5474
5548
|
}
|
|
5475
5549
|
let col = 0;
|
|
5476
5550
|
const colMondays = [];
|
|
5477
|
-
const todayKey =
|
|
5551
|
+
const todayKey = dayKey(/* @__PURE__ */ new Date());
|
|
5478
5552
|
const cursor = new Date(startDate);
|
|
5479
5553
|
while (cursor <= endDate) {
|
|
5480
5554
|
const dayOfWeek = cursor.getDay();
|
|
5481
5555
|
const row = dayOfWeek === 0 ? 6 : dayOfWeek - 1;
|
|
5482
|
-
const key =
|
|
5556
|
+
const key = dayKey(cursor);
|
|
5483
5557
|
const count = data[key] || 0;
|
|
5484
5558
|
const level = intensityLevel(count, thresholds);
|
|
5485
5559
|
const isToday = key === todayKey;
|
|
@@ -5543,8 +5617,8 @@ function buildHeatmapData(data, weeks = 52, monthOffset = 0) {
|
|
|
5543
5617
|
return {
|
|
5544
5618
|
colLabels,
|
|
5545
5619
|
totalCols: maxCells,
|
|
5546
|
-
startDate:
|
|
5547
|
-
endDate:
|
|
5620
|
+
startDate: dayKey(startDate),
|
|
5621
|
+
endDate: dayKey(endDate),
|
|
5548
5622
|
rows
|
|
5549
5623
|
};
|
|
5550
5624
|
}
|
|
@@ -9927,19 +10001,43 @@ var useTrustModify = /* @__PURE__ */ __name((onExit, addItem) => {
|
|
|
9927
10001
|
setPendingTrustLevel(trustLevel);
|
|
9928
10002
|
setNeedsRestart(true);
|
|
9929
10003
|
} else {
|
|
10004
|
+
setPendingTrustLevel(void 0);
|
|
10005
|
+
setNeedsRestart(false);
|
|
9930
10006
|
const folders = loadTrustedFolders();
|
|
9931
|
-
|
|
10007
|
+
try {
|
|
10008
|
+
folders.setValue(cwd3, trustLevel);
|
|
10009
|
+
} catch (error) {
|
|
10010
|
+
addItem(
|
|
10011
|
+
{
|
|
10012
|
+
type: "error" /* ERROR */,
|
|
10013
|
+
text: `Could not update workspace trust: ${error instanceof Error ? error.message : String(error)}`
|
|
10014
|
+
},
|
|
10015
|
+
Date.now()
|
|
10016
|
+
);
|
|
10017
|
+
return;
|
|
10018
|
+
}
|
|
9932
10019
|
onExit();
|
|
9933
10020
|
}
|
|
9934
10021
|
},
|
|
9935
10022
|
[cwd3, settings.merged, onExit, addItem]
|
|
9936
10023
|
);
|
|
9937
10024
|
const commitTrustLevelChange = (0, import_react32.useCallback)(() => {
|
|
9938
|
-
if (pendingTrustLevel)
|
|
9939
|
-
|
|
10025
|
+
if (!pendingTrustLevel) return false;
|
|
10026
|
+
const folders = loadTrustedFolders();
|
|
10027
|
+
try {
|
|
9940
10028
|
folders.setValue(cwd3, pendingTrustLevel);
|
|
10029
|
+
return true;
|
|
10030
|
+
} catch (error) {
|
|
10031
|
+
addItem(
|
|
10032
|
+
{
|
|
10033
|
+
type: "error" /* ERROR */,
|
|
10034
|
+
text: `Could not update workspace trust: ${error instanceof Error ? error.message : String(error)}`
|
|
10035
|
+
},
|
|
10036
|
+
Date.now()
|
|
10037
|
+
);
|
|
10038
|
+
return false;
|
|
9941
10039
|
}
|
|
9942
|
-
}, [cwd3, pendingTrustLevel]);
|
|
10040
|
+
}, [addItem, cwd3, pendingTrustLevel]);
|
|
9943
10041
|
return {
|
|
9944
10042
|
cwd: cwd3,
|
|
9945
10043
|
currentTrustLevel,
|
|
@@ -9990,9 +10088,10 @@ function TrustDialog({
|
|
|
9990
10088
|
onExit();
|
|
9991
10089
|
}
|
|
9992
10090
|
if (needsRestart && key.name === "r") {
|
|
9993
|
-
commitTrustLevelChange()
|
|
9994
|
-
|
|
9995
|
-
|
|
10091
|
+
if (commitTrustLevelChange()) {
|
|
10092
|
+
relaunchApp();
|
|
10093
|
+
onExit();
|
|
10094
|
+
}
|
|
9996
10095
|
}
|
|
9997
10096
|
},
|
|
9998
10097
|
{ isActive: true }
|
|
@@ -14666,8 +14765,8 @@ function SkillsManagerDialog({
|
|
|
14666
14765
|
const [loadError, setLoadError] = (0, import_react52.useState)(null);
|
|
14667
14766
|
const [query, setQuery] = (0, import_react52.useState)("");
|
|
14668
14767
|
const [activeValue, setActiveValue] = (0, import_react52.useState)(null);
|
|
14669
|
-
const
|
|
14670
|
-
() =>
|
|
14768
|
+
const initialResolved = (0, import_react52.useMemo)(
|
|
14769
|
+
() => resolveSkillSettings(settings),
|
|
14671
14770
|
[settings]
|
|
14672
14771
|
);
|
|
14673
14772
|
const higher = (0, import_react52.useMemo)(() => buildHigherDisabled(settings), [settings]);
|
|
@@ -14704,12 +14803,19 @@ function SkillsManagerDialog({
|
|
|
14704
14803
|
() => allSkills.filter((s) => !higher.set.has(lower(s.name))),
|
|
14705
14804
|
[allSkills, higher.set]
|
|
14706
14805
|
);
|
|
14806
|
+
const initialSelectedKeys = (0, import_react52.useMemo)(
|
|
14807
|
+
() => new Set(
|
|
14808
|
+
unlockedSkills.filter(
|
|
14809
|
+
(skill) => !initialResolved.disabledNames.has(lower(skill.name))
|
|
14810
|
+
).map((skill) => skill.name)
|
|
14811
|
+
),
|
|
14812
|
+
[initialResolved, unlockedSkills]
|
|
14813
|
+
);
|
|
14707
14814
|
const [selectedKeys, setSelectedKeys] = (0, import_react52.useState)(null);
|
|
14708
14815
|
(0, import_react52.useEffect)(() => {
|
|
14709
14816
|
if (selectedKeys !== null || unlockedSkills.length === 0) return;
|
|
14710
|
-
|
|
14711
|
-
|
|
14712
|
-
}, [unlockedSkills, initialWorkspaceDisabled, selectedKeys]);
|
|
14817
|
+
setSelectedKeys([...initialSelectedKeys]);
|
|
14818
|
+
}, [unlockedSkills, initialSelectedKeys, selectedKeys]);
|
|
14713
14819
|
const filteredUnlocked = (0, import_react52.useMemo)(() => {
|
|
14714
14820
|
const normalizedQuery = query.trim().toLowerCase();
|
|
14715
14821
|
if (!normalizedQuery) return unlockedSkills;
|
|
@@ -14764,33 +14870,40 @@ function SkillsManagerDialog({
|
|
|
14764
14870
|
return "untrusted";
|
|
14765
14871
|
}
|
|
14766
14872
|
const selected = new Set(selectedKeys ?? []);
|
|
14767
|
-
const
|
|
14768
|
-
|
|
14769
|
-
|
|
14873
|
+
const workspaceDisabled = namesFromScope(
|
|
14874
|
+
settings,
|
|
14875
|
+
"Workspace" /* Workspace */
|
|
14876
|
+
).filter((name) => typeof name === "string");
|
|
14877
|
+
const lockedNames = new Set(lockedSkills.map((skill) => lower(skill.name)));
|
|
14878
|
+
const { disabled, enabled, disabledChanged, enabledChanged } = computeWorkspaceSkillListUpdates(
|
|
14879
|
+
workspaceDisabled,
|
|
14880
|
+
lockedNames,
|
|
14881
|
+
skillSettingStrings(settings, "Workspace" /* Workspace */, "enabled"),
|
|
14882
|
+
unlockedSkills.map((skill) => ({
|
|
14883
|
+
name: skill.name,
|
|
14884
|
+
wasEnabled: initialSelectedKeys.has(skill.name),
|
|
14885
|
+
isEnabled: selected.has(skill.name),
|
|
14886
|
+
defaultDisabled: initialResolved.defaultDisabledNames.has(lower(skill.name)) && !initialResolved.enabledNames.has(lower(skill.name))
|
|
14887
|
+
}))
|
|
14770
14888
|
);
|
|
14771
|
-
|
|
14772
|
-
const nextDisabled = [];
|
|
14773
|
-
const allKnownLower = new Set(allSkills.map((s) => lower(s.name)));
|
|
14774
|
-
for (const prev of previousStrings) {
|
|
14775
|
-
if (!allKnownLower.has(lower(prev))) {
|
|
14776
|
-
nextDisabled.push(prev);
|
|
14777
|
-
}
|
|
14778
|
-
}
|
|
14779
|
-
for (const s of unlockedSkills) {
|
|
14780
|
-
if (selected.has(s.name)) continue;
|
|
14781
|
-
const existing = previousMap.get(lower(s.name));
|
|
14782
|
-
nextDisabled.push(existing ?? s.name);
|
|
14783
|
-
}
|
|
14784
|
-
const prevNormalized = normalizeNames(previousWorkspace).sort();
|
|
14785
|
-
const nextNormalized = normalizeNames(nextDisabled).sort();
|
|
14786
|
-
const unchanged = prevNormalized.length === nextNormalized.length && prevNormalized.every((n, i) => n === nextNormalized[i]);
|
|
14787
|
-
if (unchanged) return "ok";
|
|
14889
|
+
if (!disabledChanged && !enabledChanged) return "ok";
|
|
14788
14890
|
try {
|
|
14789
|
-
settings.
|
|
14790
|
-
|
|
14791
|
-
|
|
14792
|
-
|
|
14793
|
-
|
|
14891
|
+
settings.setValues([
|
|
14892
|
+
...disabledChanged ? [
|
|
14893
|
+
{
|
|
14894
|
+
scope: "Workspace" /* Workspace */,
|
|
14895
|
+
key: "skills.disabled",
|
|
14896
|
+
value: disabled.length > 0 ? disabled : void 0
|
|
14897
|
+
}
|
|
14898
|
+
] : [],
|
|
14899
|
+
...enabledChanged ? [
|
|
14900
|
+
{
|
|
14901
|
+
scope: "Workspace" /* Workspace */,
|
|
14902
|
+
key: "skills.enabled",
|
|
14903
|
+
value: enabled.length > 0 ? enabled : void 0
|
|
14904
|
+
}
|
|
14905
|
+
] : []
|
|
14906
|
+
]);
|
|
14794
14907
|
} catch (e) {
|
|
14795
14908
|
addItem(
|
|
14796
14909
|
{
|
|
@@ -14825,7 +14938,9 @@ function SkillsManagerDialog({
|
|
|
14825
14938
|
return "ok";
|
|
14826
14939
|
}, [
|
|
14827
14940
|
addItem,
|
|
14828
|
-
|
|
14941
|
+
initialResolved,
|
|
14942
|
+
initialSelectedKeys,
|
|
14943
|
+
lockedSkills,
|
|
14829
14944
|
reloadCommands,
|
|
14830
14945
|
selectedKeys,
|
|
14831
14946
|
settings,
|
|
@@ -26376,7 +26491,7 @@ function useCommandCompletion(buffer, cwd3, slashCommands, commandContext, rever
|
|
|
26376
26491
|
query,
|
|
26377
26492
|
completionStart,
|
|
26378
26493
|
completionEnd,
|
|
26379
|
-
|
|
26494
|
+
slashCompletionContext
|
|
26380
26495
|
} = (0, import_react88.useMemo)(() => {
|
|
26381
26496
|
const currentLine = buffer.lines[cursorRow] || "";
|
|
26382
26497
|
const codePoints = toCodePoints(currentLine);
|
|
@@ -26411,49 +26526,61 @@ function useCommandCompletion(buffer, cwd3, slashCommands, commandContext, rever
|
|
|
26411
26526
|
query: partialPath,
|
|
26412
26527
|
completionStart: pathStart,
|
|
26413
26528
|
completionEnd: end,
|
|
26414
|
-
|
|
26529
|
+
slashCompletionContext: null
|
|
26415
26530
|
};
|
|
26416
26531
|
}
|
|
26417
26532
|
}
|
|
26418
|
-
if (cursorRow === 0 && isSlashCommand(currentLine.trim())) {
|
|
26419
|
-
return {
|
|
26420
|
-
completionMode: "SLASH" /* SLASH */,
|
|
26421
|
-
query: currentLine,
|
|
26422
|
-
completionStart: 0,
|
|
26423
|
-
completionEnd: currentLine.length,
|
|
26424
|
-
isMidInputSlashCompletion: false
|
|
26425
|
-
};
|
|
26426
|
-
}
|
|
26427
26533
|
const cursorOffset = logicalPosToOffset(buffer.lines, cursorRow, cursorCol);
|
|
26428
26534
|
const midCmd = findMidInputSlashCommand(buffer.text, cursorOffset);
|
|
26429
|
-
if (midCmd
|
|
26430
|
-
midCmd.partialCommand,
|
|
26431
|
-
slashCommands
|
|
26432
|
-
)) {
|
|
26535
|
+
if (midCmd) {
|
|
26433
26536
|
const lineStartOffset = logicalPosToOffset(buffer.lines, cursorRow, 0);
|
|
26434
26537
|
const startOnLine = midCmd.startPos - lineStartOffset;
|
|
26435
|
-
|
|
26538
|
+
const isInitialCommandOnFirstLine = cursorRow === 0 && isSlashCommand(currentLine.trim()) && startOnLine >= 0 && codePoints.slice(0, startOnLine).join("").trim().length === 0;
|
|
26539
|
+
const inputCodePoints = toCodePoints(buffer.text);
|
|
26540
|
+
const prefix = inputCodePoints.slice(0, midCmd.startPos).join("");
|
|
26541
|
+
const isStackedSkill = !isInitialCommandOnFirstLine && isValidStackedSkillPrefix(prefix, slashCommands);
|
|
26542
|
+
const isSlashLedInput = isSlashCommand(prefix.trimStart());
|
|
26543
|
+
const isRegularMidInput = !isInitialCommandOnFirstLine && !isSlashLedInput;
|
|
26544
|
+
if (startOnLine >= 0 && (isStackedSkill || isRegularMidInput && !isExactMidInputModelInvocableCommand(
|
|
26545
|
+
midCmd.partialCommand,
|
|
26546
|
+
slashCommands
|
|
26547
|
+
))) {
|
|
26436
26548
|
return {
|
|
26437
26549
|
completionMode: "SLASH" /* SLASH */,
|
|
26438
26550
|
query: midCmd.token,
|
|
26439
26551
|
completionStart: startOnLine,
|
|
26440
26552
|
completionEnd: startOnLine + midCmd.token.length,
|
|
26441
|
-
|
|
26553
|
+
slashCompletionContext: isStackedSkill ? "stacked-skill" /* STACKED_SKILL */ : "mid-input" /* MID_INPUT */
|
|
26442
26554
|
};
|
|
26443
26555
|
}
|
|
26444
26556
|
}
|
|
26557
|
+
if (cursorRow === 0 && isSlashCommand(currentLine.trim())) {
|
|
26558
|
+
return {
|
|
26559
|
+
completionMode: "SLASH" /* SLASH */,
|
|
26560
|
+
query: currentLine,
|
|
26561
|
+
completionStart: 0,
|
|
26562
|
+
completionEnd: currentLine.length,
|
|
26563
|
+
slashCompletionContext: "line-start" /* LINE_START */
|
|
26564
|
+
};
|
|
26565
|
+
}
|
|
26445
26566
|
return {
|
|
26446
26567
|
completionMode: "IDLE" /* IDLE */,
|
|
26447
26568
|
query: null,
|
|
26448
26569
|
completionStart: -1,
|
|
26449
26570
|
completionEnd: -1,
|
|
26450
|
-
|
|
26571
|
+
slashCompletionContext: null
|
|
26451
26572
|
};
|
|
26452
26573
|
}, [cursorRow, cursorCol, buffer.lines, buffer.text, slashCommands]);
|
|
26453
|
-
const
|
|
26454
|
-
|
|
26455
|
-
|
|
26456
|
-
|
|
26574
|
+
const isMidInputSlashCompletion = slashCompletionContext === "mid-input" /* MID_INPUT */ || slashCompletionContext === "stacked-skill" /* STACKED_SKILL */;
|
|
26575
|
+
const slashCommandsForCompletion = (0, import_react88.useMemo)(() => {
|
|
26576
|
+
if (slashCompletionContext === "stacked-skill" /* STACKED_SKILL */) {
|
|
26577
|
+
return slashCommands.filter(isStackedSkillCompletableCommand);
|
|
26578
|
+
}
|
|
26579
|
+
if (slashCompletionContext === "mid-input" /* MID_INPUT */) {
|
|
26580
|
+
return slashCommands.filter(isMidInputCompletableCommand);
|
|
26581
|
+
}
|
|
26582
|
+
return slashCommands;
|
|
26583
|
+
}, [slashCompletionContext, slashCommands]);
|
|
26457
26584
|
const {
|
|
26458
26585
|
suggestions,
|
|
26459
26586
|
activeSuggestionIndex,
|
|
@@ -26567,6 +26694,8 @@ function useCommandCompletion(buffer, cwd3, slashCommands, commandContext, rever
|
|
|
26567
26694
|
const midCmd = findMidInputSlashCommand(buffer.text, cursorOffset);
|
|
26568
26695
|
if (midCmd) {
|
|
26569
26696
|
if (isMidInputSlashCompletion) return null;
|
|
26697
|
+
const prefix = toCodePoints(buffer.text).slice(0, midCmd.startPos).join("");
|
|
26698
|
+
if (isSlashCommand(prefix.trimStart())) return null;
|
|
26570
26699
|
const match = getBestSlashCommandMatch(
|
|
26571
26700
|
midCmd.partialCommand,
|
|
26572
26701
|
slashCommands,
|
|
@@ -27740,10 +27869,7 @@ var BaseTextInput = /* @__PURE__ */ __name(({
|
|
|
27740
27869
|
linesToRender,
|
|
27741
27870
|
prefixWidth
|
|
27742
27871
|
});
|
|
27743
|
-
(
|
|
27744
|
-
setCursorPosition(cursorPosition);
|
|
27745
|
-
return () => setCursorPosition(void 0);
|
|
27746
|
-
}, [setCursorPosition, cursorPosition]);
|
|
27872
|
+
setCursorPosition(cursorPosition);
|
|
27747
27873
|
const resolvedBorderColor = borderColor ?? theme.border.focused;
|
|
27748
27874
|
const resolvedPrefix = prefix ?? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Text, { color: theme.text.accent, children: "> " });
|
|
27749
27875
|
const columns = process.stdout.columns || 80;
|
|
@@ -29029,7 +29155,9 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
29029
29155
|
const uiState = useUIState();
|
|
29030
29156
|
const uiActions = useUIActions();
|
|
29031
29157
|
const settings = useSettings();
|
|
29032
|
-
const mouseInteractionsEnabled =
|
|
29158
|
+
const mouseInteractionsEnabled = useVirtualViewport(
|
|
29159
|
+
settings.merged.ui?.useTerminalBuffer
|
|
29160
|
+
);
|
|
29033
29161
|
const { pasteWorkaround } = useKeypressContext();
|
|
29034
29162
|
const { agents, agentTabBarFocused } = useAgentViewState();
|
|
29035
29163
|
const { setAgentTabBarFocused } = useAgentViewActions();
|
|
@@ -29048,7 +29176,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
29048
29176
|
setPillFocused: setBgPillFocused
|
|
29049
29177
|
} = useBackgroundTaskViewActions();
|
|
29050
29178
|
const hasAgents = agents.size > 0;
|
|
29051
|
-
const liveAgentPanelMaxRows =
|
|
29179
|
+
const liveAgentPanelMaxRows = uiState.useTerminalBuffer ? getLiveAgentPanelVpMaxRows(uiState.terminalHeight) : LIVE_AGENT_PANEL_MAX_ROWS;
|
|
29052
29180
|
const getVisibleBgAgents = (0, import_react98.useCallback)(
|
|
29053
29181
|
() => panelDisplayOrder(
|
|
29054
29182
|
bgEntries.filter((e) => isLiveAgentPanelVisibleEntry(e, Date.now()))
|
|
@@ -29286,6 +29414,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
29286
29414
|
const handleSubmitAndClear = (0, import_react98.useCallback)(
|
|
29287
29415
|
(submittedValue, deferUntilIdle = false) => {
|
|
29288
29416
|
exportCompletion.reset();
|
|
29417
|
+
const submittedPrompt = submittedValue;
|
|
29289
29418
|
let finalValue = submittedValue;
|
|
29290
29419
|
if (pendingPastes.size > 0) {
|
|
29291
29420
|
finalValue = expandPendingPastePlaceholders(finalValue, pendingPastes);
|
|
@@ -29303,11 +29432,7 @@ ${finalValue.trim()}`;
|
|
|
29303
29432
|
}
|
|
29304
29433
|
buffer.setText("");
|
|
29305
29434
|
clearPromptStash(targetDir);
|
|
29306
|
-
|
|
29307
|
-
onSubmit(finalValue, { deferUntilIdle: true });
|
|
29308
|
-
} else {
|
|
29309
|
-
onSubmit(finalValue);
|
|
29310
|
-
}
|
|
29435
|
+
onSubmit(finalValue, { deferUntilIdle, submittedPrompt });
|
|
29311
29436
|
resetHistoryNavRef.current();
|
|
29312
29437
|
followup.dismiss();
|
|
29313
29438
|
onPromptSuggestionDismiss?.();
|
|
@@ -29336,10 +29461,11 @@ ${finalValue.trim()}`;
|
|
|
29336
29461
|
voiceSubmitRef.current = (text) => handleSubmitAndClear(text);
|
|
29337
29462
|
const customSetTextAndResetCompletionSignal = (0, import_react98.useCallback)(
|
|
29338
29463
|
(newText) => {
|
|
29464
|
+
uiActions.invalidateSubmittedPromptProvenance();
|
|
29339
29465
|
buffer.setText(newText);
|
|
29340
29466
|
setHistoryRestoredText(newText);
|
|
29341
29467
|
},
|
|
29342
|
-
[buffer]
|
|
29468
|
+
[buffer, uiActions]
|
|
29343
29469
|
);
|
|
29344
29470
|
const inputHistory = useInputHistory({
|
|
29345
29471
|
userMessages,
|
|
@@ -29770,6 +29896,7 @@ ${currentText}`);
|
|
|
29770
29896
|
}
|
|
29771
29897
|
}
|
|
29772
29898
|
if (keyMatchers["acceptSuggestionReverseSearch" /* ACCEPT_SUGGESTION_REVERSE_SEARCH */](key)) {
|
|
29899
|
+
uiActions.invalidateSubmittedPromptProvenance();
|
|
29773
29900
|
sc.handleAutocomplete(activeSuggestionIndex);
|
|
29774
29901
|
resetState();
|
|
29775
29902
|
setActive(false);
|
|
@@ -29778,6 +29905,9 @@ ${currentText}`);
|
|
|
29778
29905
|
}
|
|
29779
29906
|
if (keyMatchers["submitReverseSearch" /* SUBMIT_REVERSE_SEARCH */](key)) {
|
|
29780
29907
|
const textToSubmit = showSuggestions && activeSuggestionIndex > -1 ? suggestions[activeSuggestionIndex].value : buffer.text;
|
|
29908
|
+
if (showSuggestions && activeSuggestionIndex > -1) {
|
|
29909
|
+
uiActions.invalidateSubmittedPromptProvenance();
|
|
29910
|
+
}
|
|
29781
29911
|
handleSubmitAndClear(textToSubmit);
|
|
29782
29912
|
resetState();
|
|
29783
29913
|
setActive(false);
|
|
@@ -29973,12 +30103,18 @@ ${currentText}`);
|
|
|
29973
30103
|
} else {
|
|
29974
30104
|
if (keyMatchers["navigationUp" /* NAVIGATION_UP */](key)) {
|
|
29975
30105
|
const prevCommand = shellHistory.getPreviousCommand();
|
|
29976
|
-
if (prevCommand !== null)
|
|
30106
|
+
if (prevCommand !== null) {
|
|
30107
|
+
uiActions.invalidateSubmittedPromptProvenance();
|
|
30108
|
+
buffer.setText(prevCommand);
|
|
30109
|
+
}
|
|
29977
30110
|
return true;
|
|
29978
30111
|
}
|
|
29979
30112
|
if (keyMatchers["navigationDown" /* NAVIGATION_DOWN */](key)) {
|
|
29980
30113
|
const nextCommand = shellHistory.getNextCommand();
|
|
29981
|
-
if (nextCommand !== null)
|
|
30114
|
+
if (nextCommand !== null) {
|
|
30115
|
+
uiActions.invalidateSubmittedPromptProvenance();
|
|
30116
|
+
buffer.setText(nextCommand);
|
|
30117
|
+
}
|
|
29982
30118
|
return true;
|
|
29983
30119
|
}
|
|
29984
30120
|
}
|
|
@@ -30245,6 +30381,7 @@ ${currentText}`);
|
|
|
30245
30381
|
if (commandSearchActive || reverseSearchActive) {
|
|
30246
30382
|
const isCommandSearch = commandSearchActive;
|
|
30247
30383
|
const sc = isCommandSearch ? commandSearchCompletion : reverseSearchCompletion;
|
|
30384
|
+
uiActions.invalidateSubmittedPromptProvenance();
|
|
30248
30385
|
sc.handleAutocomplete(index);
|
|
30249
30386
|
sc.resetCompletionState();
|
|
30250
30387
|
(isCommandSearch ? setCommandSearchActive : setReverseSearchActive)(
|
|
@@ -30274,7 +30411,8 @@ ${currentText}`);
|
|
|
30274
30411
|
handleSubmitAndClear,
|
|
30275
30412
|
setExpandedSuggestionIndex,
|
|
30276
30413
|
setCommandSearchActive,
|
|
30277
|
-
setReverseSearchActive
|
|
30414
|
+
setReverseSearchActive,
|
|
30415
|
+
uiActions
|
|
30278
30416
|
]
|
|
30279
30417
|
);
|
|
30280
30418
|
const hasTabConsumer = shouldShowSuggestions || buffer.text.length === 0 && Boolean(availableSuggestion) || Boolean(completion.midInputGhostText?.acceptText);
|
|
@@ -31633,6 +31771,15 @@ function isRecentHistoryTodoSnapshot(snapshotItemIndex, historyLength) {
|
|
|
31633
31771
|
return historyItemsAfterSnapshot < MIN_HISTORY_ITEMS_AFTER_TODO_BEFORE_STICKY;
|
|
31634
31772
|
}
|
|
31635
31773
|
__name(isRecentHistoryTodoSnapshot, "isRecentHistoryTodoSnapshot");
|
|
31774
|
+
function hasUserMessageAfter(items, afterIndex) {
|
|
31775
|
+
for (let i = afterIndex + 1; i < items.length; i++) {
|
|
31776
|
+
if (items[i].type === "user") {
|
|
31777
|
+
return true;
|
|
31778
|
+
}
|
|
31779
|
+
}
|
|
31780
|
+
return false;
|
|
31781
|
+
}
|
|
31782
|
+
__name(hasUserMessageAfter, "hasUserMessageAfter");
|
|
31636
31783
|
function getStickyTodos(history, pendingHistoryItems) {
|
|
31637
31784
|
const pendingSnapshot = findLatestTodoSnapshot(pendingHistoryItems);
|
|
31638
31785
|
if (pendingSnapshot !== void 0) {
|
|
@@ -31645,6 +31792,9 @@ function getStickyTodos(history, pendingHistoryItems) {
|
|
|
31645
31792
|
if (isRecentHistoryTodoSnapshot(historySnapshot.itemIndex, history.length)) {
|
|
31646
31793
|
return null;
|
|
31647
31794
|
}
|
|
31795
|
+
if (hasUserMessageAfter(history, historySnapshot.itemIndex)) {
|
|
31796
|
+
return null;
|
|
31797
|
+
}
|
|
31648
31798
|
if (areAllTodosCompleted(historySnapshot.todos)) {
|
|
31649
31799
|
return null;
|
|
31650
31800
|
}
|
|
@@ -33016,7 +33166,7 @@ var App = /* @__PURE__ */ __name(() => {
|
|
|
33016
33166
|
}, "App");
|
|
33017
33167
|
|
|
33018
33168
|
// packages/cli/src/ui/AppContainer.tsx
|
|
33019
|
-
import
|
|
33169
|
+
import process17 from "node:process";
|
|
33020
33170
|
|
|
33021
33171
|
// packages/cli/src/ui/hooks/useMemoryMonitor.ts
|
|
33022
33172
|
init_esbuild_shims();
|
|
@@ -33091,34 +33241,15 @@ var useMemoryMonitor = /* @__PURE__ */ __name(({
|
|
|
33091
33241
|
}, [addItem, compactOldItems]);
|
|
33092
33242
|
}, "useMemoryMonitor");
|
|
33093
33243
|
|
|
33094
|
-
// packages/cli/src/ui/hooks/useResizeSettleRepaint.ts
|
|
33095
|
-
init_esbuild_shims();
|
|
33096
|
-
var import_react117 = __toESM(require_react(), 1);
|
|
33097
|
-
var RESIZE_REPAINT_SETTLE_MS = 200;
|
|
33098
|
-
function useResizeSettleRepaint(terminalWidth, refreshStatic) {
|
|
33099
|
-
const settledTerminalWidthRef = (0, import_react117.useRef)(terminalWidth);
|
|
33100
|
-
(0, import_react117.useEffect)(() => {
|
|
33101
|
-
if (settledTerminalWidthRef.current === terminalWidth) {
|
|
33102
|
-
return;
|
|
33103
|
-
}
|
|
33104
|
-
const timer = setTimeout(() => {
|
|
33105
|
-
settledTerminalWidthRef.current = terminalWidth;
|
|
33106
|
-
refreshStatic();
|
|
33107
|
-
}, RESIZE_REPAINT_SETTLE_MS);
|
|
33108
|
-
return () => clearTimeout(timer);
|
|
33109
|
-
}, [terminalWidth, refreshStatic]);
|
|
33110
|
-
}
|
|
33111
|
-
__name(useResizeSettleRepaint, "useResizeSettleRepaint");
|
|
33112
|
-
|
|
33113
33244
|
// packages/cli/src/ui/hooks/use-wake-repaint.ts
|
|
33114
33245
|
init_esbuild_shims();
|
|
33115
|
-
var
|
|
33246
|
+
var import_react117 = __toESM(require_react(), 1);
|
|
33116
33247
|
var HEARTBEAT_INTERVAL_MS = 5e3;
|
|
33117
33248
|
var WAKE_THRESHOLD_MS = HEARTBEAT_INTERVAL_MS * 2;
|
|
33118
33249
|
function useWakeRepaint(repaint) {
|
|
33119
|
-
const repaintRef = (0,
|
|
33250
|
+
const repaintRef = (0, import_react117.useRef)(repaint);
|
|
33120
33251
|
repaintRef.current = repaint;
|
|
33121
|
-
(0,
|
|
33252
|
+
(0, import_react117.useEffect)(() => {
|
|
33122
33253
|
let lastTick = Date.now();
|
|
33123
33254
|
const timer = setInterval(() => {
|
|
33124
33255
|
const now = Date.now();
|
|
@@ -33144,12 +33275,12 @@ __name(useWakeRepaint, "useWakeRepaint");
|
|
|
33144
33275
|
|
|
33145
33276
|
// packages/cli/src/ui/hooks/useThemeCommand.ts
|
|
33146
33277
|
init_esbuild_shims();
|
|
33147
|
-
var
|
|
33278
|
+
var import_react118 = __toESM(require_react(), 1);
|
|
33148
33279
|
import process13 from "node:process";
|
|
33149
33280
|
var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, addItem, initialThemeError) => {
|
|
33150
|
-
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0,
|
|
33151
|
-
const [themeBeforeDialogOpen, setThemeBeforeDialogOpen] = (0,
|
|
33152
|
-
const openThemeDialog = (0,
|
|
33281
|
+
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0, import_react118.useState)(!!initialThemeError);
|
|
33282
|
+
const [themeBeforeDialogOpen, setThemeBeforeDialogOpen] = (0, import_react118.useState)(themeManager.getActiveTheme().name);
|
|
33283
|
+
const openThemeDialog = (0, import_react118.useCallback)(() => {
|
|
33153
33284
|
if (process13.env["NO_COLOR"]) {
|
|
33154
33285
|
addItem(
|
|
33155
33286
|
{
|
|
@@ -33165,7 +33296,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
33165
33296
|
setThemeBeforeDialogOpen(themeManager.getActiveTheme().name);
|
|
33166
33297
|
setIsThemeDialogOpen(true);
|
|
33167
33298
|
}, [addItem]);
|
|
33168
|
-
const applyTheme = (0,
|
|
33299
|
+
const applyTheme = (0, import_react118.useCallback)(
|
|
33169
33300
|
(themeName) => {
|
|
33170
33301
|
if (!themeManager.setActiveTheme(themeName)) {
|
|
33171
33302
|
setIsThemeDialogOpen(true);
|
|
@@ -33180,13 +33311,13 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
33180
33311
|
},
|
|
33181
33312
|
[setThemeError]
|
|
33182
33313
|
);
|
|
33183
|
-
const handleThemeHighlight = (0,
|
|
33314
|
+
const handleThemeHighlight = (0, import_react118.useCallback)(
|
|
33184
33315
|
(themeName) => {
|
|
33185
33316
|
applyTheme(themeName);
|
|
33186
33317
|
},
|
|
33187
33318
|
[applyTheme]
|
|
33188
33319
|
);
|
|
33189
|
-
const handleThemeSelect = (0,
|
|
33320
|
+
const handleThemeSelect = (0, import_react118.useCallback)(
|
|
33190
33321
|
(themeName, scope) => {
|
|
33191
33322
|
if (themeName === void 0) {
|
|
33192
33323
|
applyTheme(themeBeforeDialogOpen);
|
|
@@ -33233,7 +33364,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
33233
33364
|
|
|
33234
33365
|
// packages/cli/src/ui/hooks/useFeedbackDialog.ts
|
|
33235
33366
|
init_esbuild_shims();
|
|
33236
|
-
var
|
|
33367
|
+
var import_react119 = __toESM(require_react(), 1);
|
|
33237
33368
|
import * as fs15 from "node:fs";
|
|
33238
33369
|
var import_strip_json_comments = __toESM(require_strip_json_comments(), 1);
|
|
33239
33370
|
var FEEDBACK_SHOW_PROBABILITY = 0.25;
|
|
@@ -33279,20 +33410,20 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
33279
33410
|
history,
|
|
33280
33411
|
sessionStats
|
|
33281
33412
|
}) => {
|
|
33282
|
-
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = (0,
|
|
33283
|
-
const [isFeedbackDismissedTemporarily, setIsFeedbackDismissedTemporarily] = (0,
|
|
33284
|
-
const openFeedbackDialog = (0,
|
|
33413
|
+
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = (0, import_react119.useState)(false);
|
|
33414
|
+
const [isFeedbackDismissedTemporarily, setIsFeedbackDismissedTemporarily] = (0, import_react119.useState)(false);
|
|
33415
|
+
const openFeedbackDialog = (0, import_react119.useCallback)(() => {
|
|
33285
33416
|
setIsFeedbackDialogOpen(true);
|
|
33286
33417
|
}, []);
|
|
33287
|
-
const closeFeedbackDialog = (0,
|
|
33418
|
+
const closeFeedbackDialog = (0, import_react119.useCallback)(
|
|
33288
33419
|
() => setIsFeedbackDialogOpen(false),
|
|
33289
33420
|
[]
|
|
33290
33421
|
);
|
|
33291
|
-
const temporaryCloseFeedbackDialog = (0,
|
|
33422
|
+
const temporaryCloseFeedbackDialog = (0, import_react119.useCallback)(() => {
|
|
33292
33423
|
setIsFeedbackDialogOpen(false);
|
|
33293
33424
|
setIsFeedbackDismissedTemporarily(true);
|
|
33294
33425
|
}, []);
|
|
33295
|
-
const submitFeedback = (0,
|
|
33426
|
+
const submitFeedback = (0, import_react119.useCallback)(
|
|
33296
33427
|
(rating) => {
|
|
33297
33428
|
if (rating >= FEEDBACK_OPTIONS.GOOD && rating <= FEEDBACK_OPTIONS.FINE) {
|
|
33298
33429
|
const feedbackEvent = new UserFeedbackEvent(
|
|
@@ -33312,7 +33443,7 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
33312
33443
|
},
|
|
33313
33444
|
[closeFeedbackDialog, sessionStats.sessionId, config, settings]
|
|
33314
33445
|
);
|
|
33315
|
-
(0,
|
|
33446
|
+
(0, import_react119.useEffect)(() => {
|
|
33316
33447
|
const checkAndShowFeedback = /* @__PURE__ */ __name(() => {
|
|
33317
33448
|
if (streamingState === "idle" /* Idle */ && history.length > 0) {
|
|
33318
33449
|
if (!config.getUsageStatisticsEnabled() || settings.merged.ui?.enableUserFeedback === false || !lastMessageIsAIResponse(history) || Math.random() > FEEDBACK_SHOW_PROBABILITY || !meetsMinimumSessionRequirements(sessionStats) || isFeedbackDismissedTemporarily) {
|
|
@@ -33334,7 +33465,7 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
33334
33465
|
settings.merged.ui?.enableUserFeedback,
|
|
33335
33466
|
config
|
|
33336
33467
|
]);
|
|
33337
|
-
(0,
|
|
33468
|
+
(0, import_react119.useEffect)(() => {
|
|
33338
33469
|
if (streamingState === "responding" /* Responding */ && isFeedbackDismissedTemporarily) {
|
|
33339
33470
|
setIsFeedbackDismissedTemporarily(false);
|
|
33340
33471
|
}
|
|
@@ -33350,13 +33481,13 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
33350
33481
|
|
|
33351
33482
|
// packages/cli/src/ui/hooks/useEditorSettings.ts
|
|
33352
33483
|
init_esbuild_shims();
|
|
33353
|
-
var
|
|
33484
|
+
var import_react120 = __toESM(require_react(), 1);
|
|
33354
33485
|
var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError, addItem) => {
|
|
33355
|
-
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0,
|
|
33356
|
-
const openEditorDialog = (0,
|
|
33486
|
+
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0, import_react120.useState)(false);
|
|
33487
|
+
const openEditorDialog = (0, import_react120.useCallback)(() => {
|
|
33357
33488
|
setIsEditorDialogOpen(true);
|
|
33358
33489
|
}, []);
|
|
33359
|
-
const handleEditorSelect = (0,
|
|
33490
|
+
const handleEditorSelect = (0, import_react120.useCallback)(
|
|
33360
33491
|
(editorType, scope) => {
|
|
33361
33492
|
if (editorType && (!checkHasEditorType(editorType) || !allowEditorTypeInSandbox(editorType))) {
|
|
33362
33493
|
return;
|
|
@@ -33378,7 +33509,7 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
33378
33509
|
},
|
|
33379
33510
|
[loadedSettings, setEditorError, addItem]
|
|
33380
33511
|
);
|
|
33381
|
-
const exitEditorDialog = (0,
|
|
33512
|
+
const exitEditorDialog = (0, import_react120.useCallback)(() => {
|
|
33382
33513
|
setIsEditorDialogOpen(false);
|
|
33383
33514
|
}, []);
|
|
33384
33515
|
return {
|
|
@@ -33391,13 +33522,13 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
33391
33522
|
|
|
33392
33523
|
// packages/cli/src/ui/hooks/useSettingsCommand.ts
|
|
33393
33524
|
init_esbuild_shims();
|
|
33394
|
-
var
|
|
33525
|
+
var import_react121 = __toESM(require_react(), 1);
|
|
33395
33526
|
function useSettingsCommand() {
|
|
33396
|
-
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0,
|
|
33397
|
-
const openSettingsDialog = (0,
|
|
33527
|
+
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0, import_react121.useState)(false);
|
|
33528
|
+
const openSettingsDialog = (0, import_react121.useCallback)(() => {
|
|
33398
33529
|
setIsSettingsDialogOpen(true);
|
|
33399
33530
|
}, []);
|
|
33400
|
-
const closeSettingsDialog = (0,
|
|
33531
|
+
const closeSettingsDialog = (0, import_react121.useCallback)(() => {
|
|
33401
33532
|
setIsSettingsDialogOpen(false);
|
|
33402
33533
|
}, []);
|
|
33403
33534
|
return {
|
|
@@ -33408,17 +33539,44 @@ function useSettingsCommand() {
|
|
|
33408
33539
|
}
|
|
33409
33540
|
__name(useSettingsCommand, "useSettingsCommand");
|
|
33410
33541
|
|
|
33542
|
+
// packages/cli/src/ui/utils/terminal-buffer.ts
|
|
33543
|
+
init_esbuild_shims();
|
|
33544
|
+
import process14 from "node:process";
|
|
33545
|
+
function isCiEnvKey(key) {
|
|
33546
|
+
return key === "CI" || key === "CONTINUOUS_INTEGRATION" || key.startsWith("CI_");
|
|
33547
|
+
}
|
|
33548
|
+
__name(isCiEnvKey, "isCiEnvKey");
|
|
33549
|
+
function isActiveCiValue(value) {
|
|
33550
|
+
const normalizedValue = value?.toLowerCase();
|
|
33551
|
+
return value !== void 0 && value !== "" && normalizedValue !== "0" && normalizedValue !== "false";
|
|
33552
|
+
}
|
|
33553
|
+
__name(isActiveCiValue, "isActiveCiValue");
|
|
33554
|
+
function isCiEnvironment(env) {
|
|
33555
|
+
return Object.keys(env).some(
|
|
33556
|
+
(key) => isCiEnvKey(key) && isActiveCiValue(env[key])
|
|
33557
|
+
);
|
|
33558
|
+
}
|
|
33559
|
+
__name(isCiEnvironment, "isCiEnvironment");
|
|
33560
|
+
function isInteractiveTerminal(stdoutIsTTY = process14.stdout.isTTY, env = process14.env) {
|
|
33561
|
+
return Boolean(stdoutIsTTY) && !isCiEnvironment(env) && env["TERM"]?.toLowerCase() !== "dumb";
|
|
33562
|
+
}
|
|
33563
|
+
__name(isInteractiveTerminal, "isInteractiveTerminal");
|
|
33564
|
+
function shouldUseVirtualViewport(useTerminalBuffer, screenReader, terminalInteractive) {
|
|
33565
|
+
return terminalInteractive && (useTerminalBuffer ?? true) && !screenReader;
|
|
33566
|
+
}
|
|
33567
|
+
__name(shouldUseVirtualViewport, "shouldUseVirtualViewport");
|
|
33568
|
+
|
|
33411
33569
|
// packages/cli/src/ui/hooks/useModelCommand.ts
|
|
33412
33570
|
init_esbuild_shims();
|
|
33413
|
-
var
|
|
33571
|
+
var import_react122 = __toESM(require_react(), 1);
|
|
33414
33572
|
var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
33415
|
-
const [isModelDialogOpen, setIsModelDialogOpen] = (0,
|
|
33416
|
-
const [isFastModelMode, setIsFastModelMode] = (0,
|
|
33417
|
-
const [isVoiceModelMode, setIsVoiceModelMode] = (0,
|
|
33418
|
-
const [isVisionModelMode, setIsVisionModelMode] = (0,
|
|
33419
|
-
const [isImageModelMode, setIsImageModelMode] = (0,
|
|
33420
|
-
const [modelDialogPersistScope, setModelDialogPersistScope] = (0,
|
|
33421
|
-
const openModelDialog = (0,
|
|
33573
|
+
const [isModelDialogOpen, setIsModelDialogOpen] = (0, import_react122.useState)(false);
|
|
33574
|
+
const [isFastModelMode, setIsFastModelMode] = (0, import_react122.useState)(false);
|
|
33575
|
+
const [isVoiceModelMode, setIsVoiceModelMode] = (0, import_react122.useState)(false);
|
|
33576
|
+
const [isVisionModelMode, setIsVisionModelMode] = (0, import_react122.useState)(false);
|
|
33577
|
+
const [isImageModelMode, setIsImageModelMode] = (0, import_react122.useState)(false);
|
|
33578
|
+
const [modelDialogPersistScope, setModelDialogPersistScope] = (0, import_react122.useState)(void 0);
|
|
33579
|
+
const openModelDialog = (0, import_react122.useCallback)(
|
|
33422
33580
|
(options) => {
|
|
33423
33581
|
const voiceModelMode = options?.voiceModelMode ?? false;
|
|
33424
33582
|
const visionModelMode = options?.visionModelMode ?? false;
|
|
@@ -33436,7 +33594,7 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
33436
33594
|
},
|
|
33437
33595
|
[]
|
|
33438
33596
|
);
|
|
33439
|
-
const closeModelDialog = (0,
|
|
33597
|
+
const closeModelDialog = (0, import_react122.useCallback)(() => {
|
|
33440
33598
|
setIsModelDialogOpen(false);
|
|
33441
33599
|
setIsFastModelMode(false);
|
|
33442
33600
|
setIsVoiceModelMode(false);
|
|
@@ -33458,13 +33616,13 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
33458
33616
|
|
|
33459
33617
|
// packages/cli/src/ui/hooks/useApprovalModeCommand.ts
|
|
33460
33618
|
init_esbuild_shims();
|
|
33461
|
-
var
|
|
33619
|
+
var import_react123 = __toESM(require_react(), 1);
|
|
33462
33620
|
var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) => {
|
|
33463
|
-
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0,
|
|
33464
|
-
const openApprovalModeDialog = (0,
|
|
33621
|
+
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0, import_react123.useState)(false);
|
|
33622
|
+
const openApprovalModeDialog = (0, import_react123.useCallback)(() => {
|
|
33465
33623
|
setIsApprovalModeDialogOpen(true);
|
|
33466
33624
|
}, []);
|
|
33467
|
-
const handleApprovalModeSelect = (0,
|
|
33625
|
+
const handleApprovalModeSelect = (0, import_react123.useCallback)(
|
|
33468
33626
|
(mode, scope) => {
|
|
33469
33627
|
try {
|
|
33470
33628
|
if (!mode) {
|
|
@@ -33490,13 +33648,13 @@ var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) =>
|
|
|
33490
33648
|
|
|
33491
33649
|
// packages/cli/src/ui/hooks/use-effort-command.ts
|
|
33492
33650
|
init_esbuild_shims();
|
|
33493
|
-
var
|
|
33651
|
+
var import_react124 = __toESM(require_react(), 1);
|
|
33494
33652
|
var useEffortCommand = /* @__PURE__ */ __name((loadedSettings, config, addItem) => {
|
|
33495
|
-
const [isEffortDialogOpen, setIsEffortDialogOpen] = (0,
|
|
33496
|
-
const openEffortDialog = (0,
|
|
33653
|
+
const [isEffortDialogOpen, setIsEffortDialogOpen] = (0, import_react124.useState)(false);
|
|
33654
|
+
const openEffortDialog = (0, import_react124.useCallback)(() => {
|
|
33497
33655
|
setIsEffortDialogOpen(true);
|
|
33498
33656
|
}, []);
|
|
33499
|
-
const handleEffortSelect = (0,
|
|
33657
|
+
const handleEffortSelect = (0, import_react124.useCallback)(
|
|
33500
33658
|
(effort) => {
|
|
33501
33659
|
try {
|
|
33502
33660
|
if (!effort) {
|
|
@@ -33548,7 +33706,7 @@ var useEffortCommand = /* @__PURE__ */ __name((loadedSettings, config, addItem)
|
|
|
33548
33706
|
|
|
33549
33707
|
// packages/cli/src/ui/hooks/useBranchCommand.ts
|
|
33550
33708
|
init_esbuild_shims();
|
|
33551
|
-
var
|
|
33709
|
+
var import_react125 = __toESM(require_react(), 1);
|
|
33552
33710
|
import { randomUUID } from "node:crypto";
|
|
33553
33711
|
var BACKGROUND_WORK_BRANCH_BLOCKED_MESSAGE = "Stop the current session's running background tasks before branching the conversation.";
|
|
33554
33712
|
function deriveFirstPrompt(messages) {
|
|
@@ -33569,7 +33727,7 @@ function deriveFirstPrompt(messages) {
|
|
|
33569
33727
|
__name(deriveFirstPrompt, "deriveFirstPrompt");
|
|
33570
33728
|
function useBranchCommand(options) {
|
|
33571
33729
|
const { config, historyManager, startNewSession, setSessionName, remount } = options;
|
|
33572
|
-
const handleBranch = (0,
|
|
33730
|
+
const handleBranch = (0, import_react125.useCallback)(
|
|
33573
33731
|
async (name) => {
|
|
33574
33732
|
if (!config) return;
|
|
33575
33733
|
if (hasBlockingBackgroundWork(config)) {
|
|
@@ -33711,19 +33869,19 @@ __name(useBranchCommand, "useBranchCommand");
|
|
|
33711
33869
|
|
|
33712
33870
|
// packages/cli/src/ui/hooks/useResumeCommand.ts
|
|
33713
33871
|
init_esbuild_shims();
|
|
33714
|
-
var
|
|
33872
|
+
var import_react126 = __toESM(require_react(), 1);
|
|
33715
33873
|
var BACKGROUND_WORK_SWITCH_BLOCKED_MESSAGE = "Stop the current session's running background tasks before resuming another session.";
|
|
33716
33874
|
function useResumeCommand(options) {
|
|
33717
|
-
const [isResumeDialogOpen, setIsResumeDialogOpen] = (0,
|
|
33718
|
-
const [resumeMatchedSessions, setResumeMatchedSessions] = (0,
|
|
33719
|
-
const openResumeDialog = (0,
|
|
33875
|
+
const [isResumeDialogOpen, setIsResumeDialogOpen] = (0, import_react126.useState)(false);
|
|
33876
|
+
const [resumeMatchedSessions, setResumeMatchedSessions] = (0, import_react126.useState)();
|
|
33877
|
+
const openResumeDialog = (0, import_react126.useCallback)(
|
|
33720
33878
|
(matchedSessions) => {
|
|
33721
33879
|
setResumeMatchedSessions(matchedSessions);
|
|
33722
33880
|
setIsResumeDialogOpen(true);
|
|
33723
33881
|
},
|
|
33724
33882
|
[]
|
|
33725
33883
|
);
|
|
33726
|
-
const closeResumeDialog = (0,
|
|
33884
|
+
const closeResumeDialog = (0, import_react126.useCallback)(() => {
|
|
33727
33885
|
setIsResumeDialogOpen(false);
|
|
33728
33886
|
setResumeMatchedSessions(void 0);
|
|
33729
33887
|
}, []);
|
|
@@ -33736,7 +33894,7 @@ function useResumeCommand(options) {
|
|
|
33736
33894
|
remount
|
|
33737
33895
|
} = options;
|
|
33738
33896
|
const { addItem, clearItems, loadHistory } = historyManager;
|
|
33739
|
-
const handleResume = (0,
|
|
33897
|
+
const handleResume = (0, import_react126.useCallback)(
|
|
33740
33898
|
async (sessionId) => {
|
|
33741
33899
|
if (!config) {
|
|
33742
33900
|
return;
|
|
@@ -33861,18 +34019,18 @@ __name(useResumeCommand, "useResumeCommand");
|
|
|
33861
34019
|
|
|
33862
34020
|
// packages/cli/src/ui/hooks/useDeleteCommand.ts
|
|
33863
34021
|
init_esbuild_shims();
|
|
33864
|
-
var
|
|
34022
|
+
var import_react127 = __toESM(require_react(), 1);
|
|
33865
34023
|
function useDeleteCommand(options) {
|
|
33866
|
-
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = (0,
|
|
33867
|
-
const openDeleteDialog = (0,
|
|
34024
|
+
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = (0, import_react127.useState)(false);
|
|
34025
|
+
const openDeleteDialog = (0, import_react127.useCallback)(() => {
|
|
33868
34026
|
setIsDeleteDialogOpen(true);
|
|
33869
34027
|
}, []);
|
|
33870
|
-
const closeDeleteDialog = (0,
|
|
34028
|
+
const closeDeleteDialog = (0, import_react127.useCallback)(() => {
|
|
33871
34029
|
setIsDeleteDialogOpen(false);
|
|
33872
34030
|
}, []);
|
|
33873
34031
|
const { config, addItem } = options ?? {};
|
|
33874
|
-
const isDeletingManyRef = (0,
|
|
33875
|
-
const handleDelete = (0,
|
|
34032
|
+
const isDeletingManyRef = (0, import_react127.useRef)(false);
|
|
34033
|
+
const handleDelete = (0, import_react127.useCallback)(
|
|
33876
34034
|
async (sessionId) => {
|
|
33877
34035
|
if (!config) {
|
|
33878
34036
|
return;
|
|
@@ -33931,7 +34089,7 @@ function useDeleteCommand(options) {
|
|
|
33931
34089
|
},
|
|
33932
34090
|
[closeDeleteDialog, config, addItem]
|
|
33933
34091
|
);
|
|
33934
|
-
const handleDeleteMany = (0,
|
|
34092
|
+
const handleDeleteMany = (0, import_react127.useCallback)(
|
|
33935
34093
|
async (sessionIds) => {
|
|
33936
34094
|
if (!config) {
|
|
33937
34095
|
return;
|
|
@@ -34063,7 +34221,7 @@ __name(useDeleteCommand, "useDeleteCommand");
|
|
|
34063
34221
|
|
|
34064
34222
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
34065
34223
|
init_esbuild_shims();
|
|
34066
|
-
var
|
|
34224
|
+
var import_react128 = __toESM(require_react(), 1);
|
|
34067
34225
|
var debugLogger33 = createDebugLogger("SLASH_COMMAND_PROCESSOR");
|
|
34068
34226
|
function hasUserPromptExpansionHooks(config) {
|
|
34069
34227
|
return !!config && !config.getDisableAllHooks?.() && (config.hasHooksForEvent?.("UserPromptExpansion") ?? false);
|
|
@@ -34095,33 +34253,33 @@ function getSkillCommandName(command) {
|
|
|
34095
34253
|
}
|
|
34096
34254
|
__name(getSkillCommandName, "getSkillCommandName");
|
|
34097
34255
|
var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, isProcessing, setIsProcessing, isIdleRef, setGeminiMdFileCount, actions, extensionsUpdateState, isConfigInitialized, logger, updateItem, setSessionName, extensionRefreshState) => {
|
|
34098
|
-
const fallbackExtensionRefreshStateRef = (0,
|
|
34256
|
+
const fallbackExtensionRefreshStateRef = (0, import_react128.useRef)(
|
|
34099
34257
|
null
|
|
34100
34258
|
);
|
|
34101
34259
|
if (!fallbackExtensionRefreshStateRef.current) {
|
|
34102
34260
|
fallbackExtensionRefreshStateRef.current = new ExtensionRefreshState();
|
|
34103
34261
|
}
|
|
34104
34262
|
const activeExtensionRefreshState = extensionRefreshState ?? fallbackExtensionRefreshStateRef.current;
|
|
34105
|
-
const historyRef = (0,
|
|
34106
|
-
(0,
|
|
34263
|
+
const historyRef = (0, import_react128.useRef)(history);
|
|
34264
|
+
(0, import_react128.useLayoutEffect)(() => {
|
|
34107
34265
|
historyRef.current = history;
|
|
34108
34266
|
}, [history]);
|
|
34109
34267
|
const { stats: sessionStats, startNewSession } = useSessionStats();
|
|
34110
|
-
const [commands, setCommands] = (0,
|
|
34111
|
-
const [recentCommands, setRecentCommands] = (0,
|
|
34112
|
-
const [reloadTrigger, setReloadTrigger] = (0,
|
|
34113
|
-
const commandReloadResolversRef = (0,
|
|
34114
|
-
const extensionContentRefreshTimerRef = (0,
|
|
34115
|
-
const extensionContentRefreshRunningRef = (0,
|
|
34116
|
-
const extensionContentRefreshPendingRef = (0,
|
|
34117
|
-
const mountedRef = (0,
|
|
34118
|
-
(0,
|
|
34268
|
+
const [commands, setCommands] = (0, import_react128.useState)([]);
|
|
34269
|
+
const [recentCommands, setRecentCommands] = (0, import_react128.useState)(/* @__PURE__ */ new Map());
|
|
34270
|
+
const [reloadTrigger, setReloadTrigger] = (0, import_react128.useState)(0);
|
|
34271
|
+
const commandReloadResolversRef = (0, import_react128.useRef)([]);
|
|
34272
|
+
const extensionContentRefreshTimerRef = (0, import_react128.useRef)(null);
|
|
34273
|
+
const extensionContentRefreshRunningRef = (0, import_react128.useRef)(false);
|
|
34274
|
+
const extensionContentRefreshPendingRef = (0, import_react128.useRef)(false);
|
|
34275
|
+
const mountedRef = (0, import_react128.useRef)(true);
|
|
34276
|
+
(0, import_react128.useEffect)(() => {
|
|
34119
34277
|
mountedRef.current = true;
|
|
34120
34278
|
return () => {
|
|
34121
34279
|
mountedRef.current = false;
|
|
34122
34280
|
};
|
|
34123
34281
|
}, []);
|
|
34124
|
-
const resolveCommandReloads = (0,
|
|
34282
|
+
const resolveCommandReloads = (0, import_react128.useCallback)((completedTrigger) => {
|
|
34125
34283
|
if (commandReloadResolversRef.current.length === 0) {
|
|
34126
34284
|
return;
|
|
34127
34285
|
}
|
|
@@ -34135,7 +34293,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34135
34293
|
}
|
|
34136
34294
|
commandReloadResolversRef.current = remaining;
|
|
34137
34295
|
}, []);
|
|
34138
|
-
const reloadCommands = (0,
|
|
34296
|
+
const reloadCommands = (0, import_react128.useCallback)(() => {
|
|
34139
34297
|
if (!config) {
|
|
34140
34298
|
return Promise.resolve();
|
|
34141
34299
|
}
|
|
@@ -34150,14 +34308,14 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34150
34308
|
});
|
|
34151
34309
|
});
|
|
34152
34310
|
}, [config]);
|
|
34153
|
-
const clearPendingExtensionContentRefresh = (0,
|
|
34311
|
+
const clearPendingExtensionContentRefresh = (0, import_react128.useCallback)(() => {
|
|
34154
34312
|
if (!extensionContentRefreshTimerRef.current) {
|
|
34155
34313
|
return;
|
|
34156
34314
|
}
|
|
34157
34315
|
clearTimeout(extensionContentRefreshTimerRef.current);
|
|
34158
34316
|
extensionContentRefreshTimerRef.current = null;
|
|
34159
34317
|
}, []);
|
|
34160
|
-
const showExtensionContentRefreshError = (0,
|
|
34318
|
+
const showExtensionContentRefreshError = (0, import_react128.useCallback)(
|
|
34161
34319
|
(error) => {
|
|
34162
34320
|
if (!mountedRef.current) {
|
|
34163
34321
|
return;
|
|
@@ -34177,7 +34335,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34177
34335
|
},
|
|
34178
34336
|
[addItem]
|
|
34179
34337
|
);
|
|
34180
|
-
const runExtensionContentRefresh = (0,
|
|
34338
|
+
const runExtensionContentRefresh = (0, import_react128.useCallback)(async () => {
|
|
34181
34339
|
if (!config) {
|
|
34182
34340
|
return;
|
|
34183
34341
|
}
|
|
@@ -34221,23 +34379,23 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34221
34379
|
reloadCommands,
|
|
34222
34380
|
showExtensionContentRefreshError
|
|
34223
34381
|
]);
|
|
34224
|
-
const [shellConfirmationRequest, setShellConfirmationRequest] = (0,
|
|
34225
|
-
const [confirmationRequest, setConfirmationRequest] = (0,
|
|
34226
|
-
const [sessionShellAllowlist, setSessionShellAllowlist] = (0,
|
|
34382
|
+
const [shellConfirmationRequest, setShellConfirmationRequest] = (0, import_react128.useState)(null);
|
|
34383
|
+
const [confirmationRequest, setConfirmationRequest] = (0, import_react128.useState)(null);
|
|
34384
|
+
const [sessionShellAllowlist, setSessionShellAllowlist] = (0, import_react128.useState)(
|
|
34227
34385
|
/* @__PURE__ */ new Set()
|
|
34228
34386
|
);
|
|
34229
|
-
const [pendingItem, setPendingItem] = (0,
|
|
34387
|
+
const [pendingItem, setPendingItem] = (0, import_react128.useState)(
|
|
34230
34388
|
null
|
|
34231
34389
|
);
|
|
34232
|
-
const [btwItem, setBtwItem] = (0,
|
|
34233
|
-
const btwAbortControllerRef = (0,
|
|
34234
|
-
const cancelBtw = (0,
|
|
34390
|
+
const [btwItem, setBtwItem] = (0, import_react128.useState)(null);
|
|
34391
|
+
const btwAbortControllerRef = (0, import_react128.useRef)(null);
|
|
34392
|
+
const cancelBtw = (0, import_react128.useCallback)(() => {
|
|
34235
34393
|
btwAbortControllerRef.current?.abort();
|
|
34236
34394
|
btwAbortControllerRef.current = null;
|
|
34237
34395
|
setBtwItem(null);
|
|
34238
34396
|
}, []);
|
|
34239
|
-
const abortControllerRef = (0,
|
|
34240
|
-
const cancelSlashCommand = (0,
|
|
34397
|
+
const abortControllerRef = (0, import_react128.useRef)(null);
|
|
34398
|
+
const cancelSlashCommand = (0, import_react128.useCallback)(() => {
|
|
34241
34399
|
cancelBtw();
|
|
34242
34400
|
if (!abortControllerRef.current) {
|
|
34243
34401
|
return;
|
|
@@ -34261,14 +34419,14 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34261
34419
|
},
|
|
34262
34420
|
{ isActive: isProcessing }
|
|
34263
34421
|
);
|
|
34264
|
-
const pendingHistoryItems = (0,
|
|
34422
|
+
const pendingHistoryItems = (0, import_react128.useMemo)(() => {
|
|
34265
34423
|
const items = [];
|
|
34266
34424
|
if (pendingItem != null) {
|
|
34267
34425
|
items.push(pendingItem);
|
|
34268
34426
|
}
|
|
34269
34427
|
return items;
|
|
34270
34428
|
}, [pendingItem]);
|
|
34271
|
-
const addMessage = (0,
|
|
34429
|
+
const addMessage = (0, import_react128.useCallback)(
|
|
34272
34430
|
(message) => {
|
|
34273
34431
|
let historyItemContent;
|
|
34274
34432
|
if (message.type === "about" /* ABOUT */) {
|
|
@@ -34328,7 +34486,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34328
34486
|
},
|
|
34329
34487
|
[addItem]
|
|
34330
34488
|
);
|
|
34331
|
-
const commandContext = (0,
|
|
34489
|
+
const commandContext = (0, import_react128.useMemo)(
|
|
34332
34490
|
() => ({
|
|
34333
34491
|
services: {
|
|
34334
34492
|
config,
|
|
@@ -34400,7 +34558,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34400
34558
|
activeExtensionRefreshState
|
|
34401
34559
|
]
|
|
34402
34560
|
);
|
|
34403
|
-
(0,
|
|
34561
|
+
(0, import_react128.useEffect)(() => {
|
|
34404
34562
|
if (!config) {
|
|
34405
34563
|
return;
|
|
34406
34564
|
}
|
|
@@ -34418,7 +34576,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34418
34576
|
})();
|
|
34419
34577
|
};
|
|
34420
34578
|
}, [config, reloadCommands]);
|
|
34421
|
-
(0,
|
|
34579
|
+
(0, import_react128.useEffect)(() => {
|
|
34422
34580
|
if (!config) {
|
|
34423
34581
|
return;
|
|
34424
34582
|
}
|
|
@@ -34443,7 +34601,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34443
34601
|
}
|
|
34444
34602
|
};
|
|
34445
34603
|
}, [config, reloadCommands]);
|
|
34446
|
-
(0,
|
|
34604
|
+
(0, import_react128.useEffect)(() => {
|
|
34447
34605
|
if (!isConfigInitialized) {
|
|
34448
34606
|
return;
|
|
34449
34607
|
}
|
|
@@ -34458,7 +34616,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34458
34616
|
reloadCommands();
|
|
34459
34617
|
});
|
|
34460
34618
|
}, [config, isConfigInitialized, reloadCommands]);
|
|
34461
|
-
(0,
|
|
34619
|
+
(0, import_react128.useEffect)(() => {
|
|
34462
34620
|
const listener = /* @__PURE__ */ __name((reason) => {
|
|
34463
34621
|
clearPendingExtensionContentRefresh();
|
|
34464
34622
|
addItem(
|
|
@@ -34485,7 +34643,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34485
34643
|
addItem,
|
|
34486
34644
|
clearPendingExtensionContentRefresh
|
|
34487
34645
|
]);
|
|
34488
|
-
(0,
|
|
34646
|
+
(0, import_react128.useEffect)(() => {
|
|
34489
34647
|
activeExtensionRefreshState.on(
|
|
34490
34648
|
"extensions-reload-started" /* ExtensionsReloadStarted */,
|
|
34491
34649
|
clearPendingExtensionContentRefresh
|
|
@@ -34505,7 +34663,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34505
34663
|
);
|
|
34506
34664
|
};
|
|
34507
34665
|
}, [activeExtensionRefreshState, clearPendingExtensionContentRefresh]);
|
|
34508
|
-
(0,
|
|
34666
|
+
(0, import_react128.useEffect)(() => {
|
|
34509
34667
|
if (!config) {
|
|
34510
34668
|
return;
|
|
34511
34669
|
}
|
|
@@ -34531,7 +34689,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34531
34689
|
activeExtensionRefreshState,
|
|
34532
34690
|
runExtensionContentRefresh
|
|
34533
34691
|
]);
|
|
34534
|
-
(0,
|
|
34692
|
+
(0, import_react128.useEffect)(() => {
|
|
34535
34693
|
const controller = new AbortController();
|
|
34536
34694
|
const load = /* @__PURE__ */ __name(async () => {
|
|
34537
34695
|
try {
|
|
@@ -34628,7 +34786,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34628
34786
|
settings,
|
|
34629
34787
|
resolveCommandReloads
|
|
34630
34788
|
]);
|
|
34631
|
-
const handleSlashCommand = (0,
|
|
34789
|
+
const handleSlashCommand = (0, import_react128.useCallback)(
|
|
34632
34790
|
async (rawQuery, oneTimeShellAllowlist, overwriteConfirmed, existingInvocationItemId) => {
|
|
34633
34791
|
if (typeof rawQuery !== "string") {
|
|
34634
34792
|
return false;
|
|
@@ -35190,11 +35348,11 @@ ${commandToExecute.subCommands.map((sc) => ` - ${sc.name}: ${sc.description ||
|
|
|
35190
35348
|
|
|
35191
35349
|
// packages/cli/src/ui/hooks/useDoublePress.ts
|
|
35192
35350
|
init_esbuild_shims();
|
|
35193
|
-
var
|
|
35351
|
+
var import_react129 = __toESM(require_react(), 1);
|
|
35194
35352
|
var DOUBLE_PRESS_TIMEOUT_MS = 800;
|
|
35195
35353
|
function useDoublePress(onDoublePress, onPending) {
|
|
35196
|
-
const timeoutRef = (0,
|
|
35197
|
-
(0,
|
|
35354
|
+
const timeoutRef = (0, import_react129.useRef)(null);
|
|
35355
|
+
(0, import_react129.useEffect)(
|
|
35198
35356
|
() => () => {
|
|
35199
35357
|
if (timeoutRef.current !== null) {
|
|
35200
35358
|
clearTimeout(timeoutRef.current);
|
|
@@ -35203,7 +35361,7 @@ function useDoublePress(onDoublePress, onPending) {
|
|
|
35203
35361
|
},
|
|
35204
35362
|
[]
|
|
35205
35363
|
);
|
|
35206
|
-
return (0,
|
|
35364
|
+
return (0, import_react129.useCallback)(() => {
|
|
35207
35365
|
if (timeoutRef.current !== null) {
|
|
35208
35366
|
clearTimeout(timeoutRef.current);
|
|
35209
35367
|
timeoutRef.current = null;
|
|
@@ -35267,10 +35425,10 @@ __name(formatSessionWindowTitle, "formatSessionWindowTitle");
|
|
|
35267
35425
|
|
|
35268
35426
|
// packages/cli/src/ui/hooks/useLogger.ts
|
|
35269
35427
|
init_esbuild_shims();
|
|
35270
|
-
var
|
|
35428
|
+
var import_react130 = __toESM(require_react(), 1);
|
|
35271
35429
|
var useLogger = /* @__PURE__ */ __name((storage, sessionId) => {
|
|
35272
|
-
const [logger, setLogger] = (0,
|
|
35273
|
-
(0,
|
|
35430
|
+
const [logger, setLogger] = (0, import_react130.useState)(null);
|
|
35431
|
+
(0, import_react130.useEffect)(() => {
|
|
35274
35432
|
if (!sessionId) {
|
|
35275
35433
|
return;
|
|
35276
35434
|
}
|
|
@@ -35291,11 +35449,11 @@ var useLogger = /* @__PURE__ */ __name((storage, sessionId) => {
|
|
|
35291
35449
|
|
|
35292
35450
|
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
35293
35451
|
init_esbuild_shims();
|
|
35294
|
-
var
|
|
35452
|
+
var import_react135 = __toESM(require_react(), 1);
|
|
35295
35453
|
|
|
35296
35454
|
// packages/cli/src/ui/hooks/shellCommandProcessor.ts
|
|
35297
35455
|
init_esbuild_shims();
|
|
35298
|
-
var
|
|
35456
|
+
var import_react131 = __toESM(require_react(), 1);
|
|
35299
35457
|
import crypto2 from "node:crypto";
|
|
35300
35458
|
import path10 from "node:path";
|
|
35301
35459
|
import os5 from "node:os";
|
|
@@ -35328,8 +35486,8 @@ ${modelContent}
|
|
|
35328
35486
|
}
|
|
35329
35487
|
__name(addShellCommandToGeminiHistory, "addShellCommandToGeminiHistory");
|
|
35330
35488
|
var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPendingHistoryItem, onExec, onDebugMessage, config, geminiClient, setShellInputFocused, terminalWidth, terminalHeight) => {
|
|
35331
|
-
const [activeShellPtyId, setActiveShellPtyId] = (0,
|
|
35332
|
-
const handleShellCommand = (0,
|
|
35489
|
+
const [activeShellPtyId, setActiveShellPtyId] = (0, import_react131.useState)(null);
|
|
35490
|
+
const handleShellCommand = (0, import_react131.useCallback)(
|
|
35333
35491
|
(rawQuery, abortSignal) => {
|
|
35334
35492
|
if (typeof rawQuery !== "string" || rawQuery.trim() === "") {
|
|
35335
35493
|
return false;
|
|
@@ -35583,11 +35741,11 @@ ${finalOutput}`;
|
|
|
35583
35741
|
|
|
35584
35742
|
// packages/cli/src/ui/hooks/useStateAndRef.ts
|
|
35585
35743
|
init_esbuild_shims();
|
|
35586
|
-
var
|
|
35744
|
+
var import_react132 = __toESM(require_react(), 1);
|
|
35587
35745
|
var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
35588
|
-
const [state, setState] =
|
|
35589
|
-
const ref =
|
|
35590
|
-
const setStateInternal =
|
|
35746
|
+
const [state, setState] = import_react132.default.useState(initialValue);
|
|
35747
|
+
const ref = import_react132.default.useRef(initialValue);
|
|
35748
|
+
const setStateInternal = import_react132.default.useCallback(
|
|
35591
35749
|
(newStateOrCallback) => {
|
|
35592
35750
|
let newValue;
|
|
35593
35751
|
if (typeof newStateOrCallback === "function") {
|
|
@@ -35605,12 +35763,12 @@ var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
|
35605
35763
|
|
|
35606
35764
|
// packages/cli/src/ui/hooks/useReactToolScheduler.ts
|
|
35607
35765
|
init_esbuild_shims();
|
|
35608
|
-
var
|
|
35766
|
+
var import_react133 = __toESM(require_react(), 1);
|
|
35609
35767
|
import * as path11 from "node:path";
|
|
35610
35768
|
var debugLogger35 = createDebugLogger("REACT_TOOL_SCHEDULER");
|
|
35611
|
-
function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorClose) {
|
|
35612
|
-
const [toolCallsForDisplay, setToolCallsForDisplay] = (0,
|
|
35613
|
-
const outputUpdateHandler = (0,
|
|
35769
|
+
function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorClose, onToolResultFullTurnModel) {
|
|
35770
|
+
const [toolCallsForDisplay, setToolCallsForDisplay] = (0, import_react133.useState)([]);
|
|
35771
|
+
const outputUpdateHandler = (0, import_react133.useCallback)(
|
|
35614
35772
|
(toolCallId, outputChunk) => {
|
|
35615
35773
|
if (isShellProgressData(outputChunk)) {
|
|
35616
35774
|
return;
|
|
@@ -35628,13 +35786,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35628
35786
|
},
|
|
35629
35787
|
[]
|
|
35630
35788
|
);
|
|
35631
|
-
const allToolCallsCompleteHandler = (0,
|
|
35789
|
+
const allToolCallsCompleteHandler = (0, import_react133.useCallback)(
|
|
35632
35790
|
async (completedToolCalls) => {
|
|
35633
35791
|
await onComplete(completedToolCalls);
|
|
35634
35792
|
},
|
|
35635
35793
|
[onComplete]
|
|
35636
35794
|
);
|
|
35637
|
-
const toolCallsUpdateHandler = (0,
|
|
35795
|
+
const toolCallsUpdateHandler = (0, import_react133.useCallback)(
|
|
35638
35796
|
(updatedCoreToolCalls) => {
|
|
35639
35797
|
setToolCallsForDisplay(
|
|
35640
35798
|
(prevTrackedCalls) => updatedCoreToolCalls.map((coreTc) => {
|
|
@@ -35661,14 +35819,15 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35661
35819
|
},
|
|
35662
35820
|
[setToolCallsForDisplay]
|
|
35663
35821
|
);
|
|
35664
|
-
const scheduler = (0,
|
|
35822
|
+
const scheduler = (0, import_react133.useMemo)(
|
|
35665
35823
|
() => new CoreToolScheduler({
|
|
35666
35824
|
config,
|
|
35667
35825
|
outputUpdateHandler,
|
|
35668
35826
|
onAllToolCallsComplete: allToolCallsCompleteHandler,
|
|
35669
35827
|
onToolCallsUpdate: toolCallsUpdateHandler,
|
|
35670
35828
|
getPreferredEditor,
|
|
35671
|
-
onEditorClose
|
|
35829
|
+
onEditorClose,
|
|
35830
|
+
onToolResultFullTurnModel
|
|
35672
35831
|
}),
|
|
35673
35832
|
[
|
|
35674
35833
|
config,
|
|
@@ -35676,10 +35835,11 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35676
35835
|
allToolCallsCompleteHandler,
|
|
35677
35836
|
toolCallsUpdateHandler,
|
|
35678
35837
|
getPreferredEditor,
|
|
35679
|
-
onEditorClose
|
|
35838
|
+
onEditorClose,
|
|
35839
|
+
onToolResultFullTurnModel
|
|
35680
35840
|
]
|
|
35681
35841
|
);
|
|
35682
|
-
const schedule = (0,
|
|
35842
|
+
const schedule = (0, import_react133.useCallback)(
|
|
35683
35843
|
(request, signal, modelOverride) => {
|
|
35684
35844
|
if (!modelOverride?.endsWith("\0")) {
|
|
35685
35845
|
void scheduler.schedule(request, signal);
|
|
@@ -35728,7 +35888,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35728
35888
|
},
|
|
35729
35889
|
[allToolCallsCompleteHandler, config, scheduler]
|
|
35730
35890
|
);
|
|
35731
|
-
const markToolsAsSubmitted = (0,
|
|
35891
|
+
const markToolsAsSubmitted = (0, import_react133.useCallback)(
|
|
35732
35892
|
(callIdsToMark) => {
|
|
35733
35893
|
setToolCallsForDisplay(
|
|
35734
35894
|
(prevCalls) => prevCalls.map(
|
|
@@ -35811,6 +35971,9 @@ function mapToDisplay(toolOrTools, projectRoot) {
|
|
|
35811
35971
|
resultDisplay: compactToolResultDisplayForHistory(
|
|
35812
35972
|
trackedCall.response.resultDisplay
|
|
35813
35973
|
),
|
|
35974
|
+
...trackedCall.response.visionBridgeNotice !== void 0 ? {
|
|
35975
|
+
visionBridgeNotice: trackedCall.response.visionBridgeNotice
|
|
35976
|
+
} : {},
|
|
35814
35977
|
// Full detail for the Ctrl+O transcript (§4.9): derived from the
|
|
35815
35978
|
// already-persisted functionResponse parts; NOT char-capped (the
|
|
35816
35979
|
// bound is whatever core already applied). Consumed ONLY by the
|
|
@@ -35830,6 +35993,9 @@ function mapToDisplay(toolOrTools, projectRoot) {
|
|
|
35830
35993
|
resultDisplay: compactToolResultDisplayForHistory(
|
|
35831
35994
|
trackedCall.response.resultDisplay
|
|
35832
35995
|
),
|
|
35996
|
+
...trackedCall.response.visionBridgeNotice !== void 0 ? {
|
|
35997
|
+
visionBridgeNotice: trackedCall.response.visionBridgeNotice
|
|
35998
|
+
} : {},
|
|
35833
35999
|
confirmationDetails: void 0
|
|
35834
36000
|
};
|
|
35835
36001
|
case "cancelled":
|
|
@@ -35839,6 +36005,9 @@ function mapToDisplay(toolOrTools, projectRoot) {
|
|
|
35839
36005
|
resultDisplay: compactToolResultDisplayForHistory(
|
|
35840
36006
|
trackedCall.response.resultDisplay
|
|
35841
36007
|
),
|
|
36008
|
+
...trackedCall.response.visionBridgeNotice !== void 0 ? {
|
|
36009
|
+
visionBridgeNotice: trackedCall.response.visionBridgeNotice
|
|
36010
|
+
} : {},
|
|
35842
36011
|
confirmationDetails: void 0
|
|
35843
36012
|
};
|
|
35844
36013
|
case "awaiting_approval":
|
|
@@ -35893,74 +36062,90 @@ __name(mapToDisplay, "mapToDisplay");
|
|
|
35893
36062
|
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
35894
36063
|
import { promises as fs17 } from "node:fs";
|
|
35895
36064
|
import path12 from "node:path";
|
|
35896
|
-
import
|
|
36065
|
+
import process15 from "node:process";
|
|
35897
36066
|
|
|
35898
36067
|
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
35899
36068
|
init_esbuild_shims();
|
|
35900
|
-
var
|
|
36069
|
+
var import_react134 = __toESM(require_react(), 1);
|
|
35901
36070
|
var GOAL_COMMAND_RE = /^\/goal(?:\s|$)/;
|
|
36071
|
+
function aggregateMessages(messages) {
|
|
36072
|
+
const modelText = messages.map((message) => message.modelText).join("\n\n");
|
|
36073
|
+
const submittedPrompts = messages.map((message) => message.submittedPrompt);
|
|
36074
|
+
return submittedPrompts.every(
|
|
36075
|
+
(submittedPrompt) => submittedPrompt !== void 0
|
|
36076
|
+
) ? { modelText, submittedPrompt: submittedPrompts.join("\n\n") } : { modelText };
|
|
36077
|
+
}
|
|
36078
|
+
__name(aggregateMessages, "aggregateMessages");
|
|
35902
36079
|
function useMessageQueue() {
|
|
35903
|
-
const [queuedMessages, setQueuedMessages] = (0,
|
|
35904
|
-
const queueRef = (0,
|
|
35905
|
-
const addMessage = (0,
|
|
35906
|
-
|
|
35907
|
-
|
|
35908
|
-
|
|
35909
|
-
|
|
35910
|
-
|
|
35911
|
-
|
|
35912
|
-
|
|
35913
|
-
|
|
35914
|
-
|
|
35915
|
-
|
|
36080
|
+
const [queuedMessages, setQueuedMessages] = (0, import_react134.useState)([]);
|
|
36081
|
+
const queueRef = (0, import_react134.useRef)([]);
|
|
36082
|
+
const addMessage = (0, import_react134.useCallback)(
|
|
36083
|
+
(message, deferUntilIdle = false, submittedPrompt) => {
|
|
36084
|
+
const modelText = message.trim();
|
|
36085
|
+
if (modelText.length > 0) {
|
|
36086
|
+
queueRef.current = [
|
|
36087
|
+
...queueRef.current,
|
|
36088
|
+
{ modelText, deferUntilIdle, submittedPrompt }
|
|
36089
|
+
];
|
|
36090
|
+
setQueuedMessages(queueRef.current);
|
|
36091
|
+
}
|
|
36092
|
+
},
|
|
36093
|
+
[]
|
|
36094
|
+
);
|
|
36095
|
+
const clearQueue = (0, import_react134.useCallback)(() => {
|
|
35916
36096
|
queueRef.current = [];
|
|
35917
36097
|
setQueuedMessages([]);
|
|
35918
36098
|
}, []);
|
|
35919
|
-
const getQueuedMessagesText = (0,
|
|
36099
|
+
const getQueuedMessagesText = (0, import_react134.useCallback)(() => {
|
|
35920
36100
|
if (queuedMessages.length === 0) return "";
|
|
35921
|
-
return queuedMessages.map(({
|
|
36101
|
+
return queuedMessages.map(({ modelText }) => modelText).join("\n\n");
|
|
35922
36102
|
}, [queuedMessages]);
|
|
35923
|
-
const popAllMessages = (0,
|
|
36103
|
+
const popAllMessages = (0, import_react134.useCallback)(() => {
|
|
35924
36104
|
const current = queueRef.current;
|
|
35925
36105
|
if (current.length === 0) return null;
|
|
35926
36106
|
queueRef.current = [];
|
|
35927
36107
|
setQueuedMessages([]);
|
|
35928
|
-
return current
|
|
36108
|
+
return aggregateMessages(current);
|
|
35929
36109
|
}, []);
|
|
35930
|
-
const restoreMessages = (0,
|
|
35931
|
-
const restored = messages.map((text) => text.trim()).filter(Boolean).map((
|
|
36110
|
+
const restoreMessages = (0, import_react134.useCallback)((messages) => {
|
|
36111
|
+
const restored = messages.map((text) => text.trim()).filter(Boolean).map((modelText) => ({ modelText, deferUntilIdle: false }));
|
|
35932
36112
|
if (restored.length === 0) return;
|
|
35933
36113
|
queueRef.current = [...restored, ...queueRef.current];
|
|
35934
36114
|
setQueuedMessages(queueRef.current);
|
|
35935
36115
|
}, []);
|
|
35936
|
-
const drainQueue = (0,
|
|
36116
|
+
const drainQueue = (0, import_react134.useCallback)((includeDeferred = false) => {
|
|
35937
36117
|
const current = queueRef.current;
|
|
35938
36118
|
if (current.length === 0) return [];
|
|
35939
|
-
const shouldDrain = /* @__PURE__ */ __name((message) => (!isSlashCommand(message.
|
|
36119
|
+
const shouldDrain = /* @__PURE__ */ __name((message) => (!isSlashCommand(message.modelText) || !includeDeferred && GOAL_COMMAND_RE.test(message.modelText)) && (includeDeferred || !message.deferUntilIdle), "shouldDrain");
|
|
35940
36120
|
const drained = current.filter(shouldDrain);
|
|
35941
36121
|
if (drained.length === 0) return [];
|
|
35942
36122
|
const rest = current.filter((message) => !shouldDrain(message));
|
|
35943
36123
|
queueRef.current = rest;
|
|
35944
36124
|
setQueuedMessages(rest);
|
|
35945
|
-
return drained.map(({
|
|
36125
|
+
return drained.map(({ modelText }) => modelText);
|
|
35946
36126
|
}, []);
|
|
35947
|
-
const
|
|
36127
|
+
const popNextTurn = (0, import_react134.useCallback)(() => {
|
|
35948
36128
|
const current = queueRef.current;
|
|
35949
36129
|
if (current.length === 0) return null;
|
|
35950
|
-
const
|
|
36130
|
+
const plainMessages = current.filter(
|
|
36131
|
+
(message) => !isSlashCommand(message.modelText)
|
|
36132
|
+
);
|
|
36133
|
+
const messages = plainMessages.length > 0 ? plainMessages : [current[0]];
|
|
36134
|
+
const selected = new Set(messages);
|
|
36135
|
+
const rest = current.filter((message) => !selected.has(message));
|
|
35951
36136
|
queueRef.current = rest;
|
|
35952
36137
|
setQueuedMessages(rest);
|
|
35953
|
-
return
|
|
36138
|
+
return aggregateMessages(messages);
|
|
35954
36139
|
}, []);
|
|
35955
36140
|
return {
|
|
35956
|
-
messageQueue: queuedMessages.map(({
|
|
36141
|
+
messageQueue: queuedMessages.map(({ modelText }) => modelText),
|
|
35957
36142
|
addMessage,
|
|
35958
36143
|
clearQueue,
|
|
35959
36144
|
getQueuedMessagesText,
|
|
35960
36145
|
popAllMessages,
|
|
35961
36146
|
restoreMessages,
|
|
35962
36147
|
drainQueue,
|
|
35963
|
-
|
|
36148
|
+
popNextTurn
|
|
35964
36149
|
};
|
|
35965
36150
|
}
|
|
35966
36151
|
__name(useMessageQueue, "useMessageQueue");
|
|
@@ -36108,16 +36293,17 @@ function charIndexAfterLine(text, keptLines) {
|
|
|
36108
36293
|
}
|
|
36109
36294
|
__name(charIndexAfterLine, "charIndexAfterLine");
|
|
36110
36295
|
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) => {
|
|
36111
|
-
const [initError, setInitError] = (0,
|
|
36112
|
-
const abortControllerRef = (0,
|
|
36113
|
-
const flushBufferedStreamEventsRef = (0,
|
|
36114
|
-
const turnCancelledRef = (0,
|
|
36115
|
-
const isSubmittingQueryRef = (0,
|
|
36116
|
-
const lastPromptRef = (0,
|
|
36117
|
-
const lastTurnUserItemRef = (0,
|
|
36118
|
-
const
|
|
36119
|
-
const
|
|
36120
|
-
const
|
|
36296
|
+
const [initError, setInitError] = (0, import_react135.useState)(null);
|
|
36297
|
+
const abortControllerRef = (0, import_react135.useRef)(null);
|
|
36298
|
+
const flushBufferedStreamEventsRef = (0, import_react135.useRef)(/* @__PURE__ */ new Set());
|
|
36299
|
+
const turnCancelledRef = (0, import_react135.useRef)(false);
|
|
36300
|
+
const isSubmittingQueryRef = (0, import_react135.useRef)(false);
|
|
36301
|
+
const lastPromptRef = (0, import_react135.useRef)(null);
|
|
36302
|
+
const lastTurnUserItemRef = (0, import_react135.useRef)(null);
|
|
36303
|
+
const canUndoLastLoggedUserMessageRef = (0, import_react135.useRef)(false);
|
|
36304
|
+
const turnSawContentEventRef = (0, import_react135.useRef)(false);
|
|
36305
|
+
const lastPromptErroredRef = (0, import_react135.useRef)(false);
|
|
36306
|
+
const commitItem = (0, import_react135.useCallback)(
|
|
36121
36307
|
(item, userMessageTimestamp) => {
|
|
36122
36308
|
if (item.type === "gemini" && !item.timestamp) {
|
|
36123
36309
|
item.timestamp = Date.now();
|
|
@@ -36127,17 +36313,17 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36127
36313
|
[addItem]
|
|
36128
36314
|
);
|
|
36129
36315
|
const dualOutput = useDualOutput();
|
|
36130
|
-
const [isResponding, setIsResponding] = (0,
|
|
36131
|
-
const activeModelStreamsRef = (0,
|
|
36132
|
-
const [thought, setThought] = (0,
|
|
36133
|
-
const historyRef = (0,
|
|
36134
|
-
(0,
|
|
36316
|
+
const [isResponding, setIsResponding] = (0, import_react135.useState)(false);
|
|
36317
|
+
const activeModelStreamsRef = (0, import_react135.useRef)(0);
|
|
36318
|
+
const [thought, setThought] = (0, import_react135.useState)(null);
|
|
36319
|
+
const historyRef = (0, import_react135.useRef)(history);
|
|
36320
|
+
(0, import_react135.useLayoutEffect)(() => {
|
|
36135
36321
|
historyRef.current = history;
|
|
36136
36322
|
}, [history]);
|
|
36137
|
-
const auxiliaryAbortRefsRef = (0,
|
|
36323
|
+
const auxiliaryAbortRefsRef = (0, import_react135.useRef)(/* @__PURE__ */ new Set());
|
|
36138
36324
|
const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
|
|
36139
36325
|
const [pendingThoughtItem, pendingThoughtItemRef, setPendingThoughtItem] = useStateAndRef(null);
|
|
36140
|
-
const thoughtStartTimeRef = (0,
|
|
36326
|
+
const thoughtStartTimeRef = (0, import_react135.useRef)(null);
|
|
36141
36327
|
const [
|
|
36142
36328
|
pendingRetryErrorItem,
|
|
36143
36329
|
pendingRetryErrorItemRef,
|
|
@@ -36148,21 +36334,25 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36148
36334
|
pendingRetryCountdownItemRef,
|
|
36149
36335
|
setPendingRetryCountdownItem
|
|
36150
36336
|
] = useStateAndRef(null);
|
|
36151
|
-
const retryCountdownTimerRef = (0,
|
|
36337
|
+
const retryCountdownTimerRef = (0, import_react135.useRef)(
|
|
36152
36338
|
null
|
|
36153
36339
|
);
|
|
36154
|
-
const processedMemoryToolsRef = (0,
|
|
36155
|
-
const submitPromptOnCompleteRef = (0,
|
|
36156
|
-
const modelOverrideRef = (0,
|
|
36157
|
-
const inlineModelOverrideActiveRef = (0,
|
|
36158
|
-
const
|
|
36159
|
-
|
|
36340
|
+
const processedMemoryToolsRef = (0, import_react135.useRef)(/* @__PURE__ */ new Set());
|
|
36341
|
+
const submitPromptOnCompleteRef = (0, import_react135.useRef)(null);
|
|
36342
|
+
const modelOverrideRef = (0, import_react135.useRef)(void 0);
|
|
36343
|
+
const inlineModelOverrideActiveRef = (0, import_react135.useRef)(false);
|
|
36344
|
+
const canUseToolResultFullTurnModel = (0, import_react135.useCallback)((model) => {
|
|
36345
|
+
const current = modelOverrideRef.current;
|
|
36346
|
+
return !inlineModelOverrideActiveRef.current && (!current?.endsWith("\0") || current === model);
|
|
36347
|
+
}, []);
|
|
36348
|
+
const handledProviderToolCallIdsRef = (0, import_react135.useRef)(/* @__PURE__ */ new Set());
|
|
36349
|
+
const duplicateProviderToolCallResponseIdsRef = (0, import_react135.useRef)(
|
|
36160
36350
|
/* @__PURE__ */ new Set()
|
|
36161
36351
|
);
|
|
36162
|
-
const pendingDuplicateToolResponsesRef = (0,
|
|
36163
|
-
const immediateDuplicateToolResponsesRef = (0,
|
|
36164
|
-
const streamingResponseLengthRef = (0,
|
|
36165
|
-
const [isReceivingContent, setIsReceivingContent] = (0,
|
|
36352
|
+
const pendingDuplicateToolResponsesRef = (0, import_react135.useRef)([]);
|
|
36353
|
+
const immediateDuplicateToolResponsesRef = (0, import_react135.useRef)(null);
|
|
36354
|
+
const streamingResponseLengthRef = (0, import_react135.useRef)(0);
|
|
36355
|
+
const [isReceivingContent, setIsReceivingContent] = (0, import_react135.useState)(false);
|
|
36166
36356
|
const {
|
|
36167
36357
|
startNewPrompt,
|
|
36168
36358
|
getPromptCount,
|
|
@@ -36185,13 +36375,14 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36185
36375
|
},
|
|
36186
36376
|
config,
|
|
36187
36377
|
getPreferredEditor,
|
|
36188
|
-
onEditorClose
|
|
36378
|
+
onEditorClose,
|
|
36379
|
+
canUseToolResultFullTurnModel
|
|
36189
36380
|
);
|
|
36190
|
-
const pendingToolCallGroupDisplay = (0,
|
|
36381
|
+
const pendingToolCallGroupDisplay = (0, import_react135.useMemo)(
|
|
36191
36382
|
() => toolCalls.length ? mapToDisplay(toolCalls, config.getProjectRoot()) : void 0,
|
|
36192
36383
|
[toolCalls, config]
|
|
36193
36384
|
);
|
|
36194
|
-
const activeToolPtyId = (0,
|
|
36385
|
+
const activeToolPtyId = (0, import_react135.useMemo)(() => {
|
|
36195
36386
|
const executingShellTool = toolCalls?.find(
|
|
36196
36387
|
(tc) => tc.status === "executing" && tc.request.name === "run_shell_command"
|
|
36197
36388
|
);
|
|
@@ -36200,18 +36391,18 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36200
36391
|
}
|
|
36201
36392
|
return void 0;
|
|
36202
36393
|
}, [toolCalls]);
|
|
36203
|
-
const loopDetectedRef = (0,
|
|
36394
|
+
const loopDetectedRef = (0, import_react135.useRef)(false);
|
|
36204
36395
|
const [
|
|
36205
36396
|
loopDetectionConfirmationRequest,
|
|
36206
36397
|
setLoopDetectionConfirmationRequest
|
|
36207
|
-
] = (0,
|
|
36208
|
-
const stopRetryCountdownTimer = (0,
|
|
36398
|
+
] = (0, import_react135.useState)(null);
|
|
36399
|
+
const stopRetryCountdownTimer = (0, import_react135.useCallback)(() => {
|
|
36209
36400
|
if (retryCountdownTimerRef.current) {
|
|
36210
36401
|
clearInterval(retryCountdownTimerRef.current);
|
|
36211
36402
|
retryCountdownTimerRef.current = null;
|
|
36212
36403
|
}
|
|
36213
36404
|
}, []);
|
|
36214
|
-
const clearRetryCountdown = (0,
|
|
36405
|
+
const clearRetryCountdown = (0, import_react135.useCallback)(() => {
|
|
36215
36406
|
stopRetryCountdownTimer();
|
|
36216
36407
|
skipRetryDelayRef.current = null;
|
|
36217
36408
|
setPendingRetryErrorItem(null);
|
|
@@ -36221,8 +36412,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36221
36412
|
setPendingRetryCountdownItem,
|
|
36222
36413
|
stopRetryCountdownTimer
|
|
36223
36414
|
]);
|
|
36224
|
-
const skipRetryDelayRef = (0,
|
|
36225
|
-
const startRetryCountdown = (0,
|
|
36415
|
+
const skipRetryDelayRef = (0, import_react135.useRef)(null);
|
|
36416
|
+
const startRetryCountdown = (0, import_react135.useCallback)(
|
|
36226
36417
|
(retryInfo) => {
|
|
36227
36418
|
stopRetryCountdownTimer();
|
|
36228
36419
|
skipRetryDelayRef.current = retryInfo.skipDelay;
|
|
@@ -36263,8 +36454,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36263
36454
|
stopRetryCountdownTimer
|
|
36264
36455
|
]
|
|
36265
36456
|
);
|
|
36266
|
-
(0,
|
|
36267
|
-
const onExec = (0,
|
|
36457
|
+
(0, import_react135.useEffect)(() => () => stopRetryCountdownTimer(), [stopRetryCountdownTimer]);
|
|
36458
|
+
const onExec = (0, import_react135.useCallback)(async (done) => {
|
|
36268
36459
|
setIsResponding(true);
|
|
36269
36460
|
await done;
|
|
36270
36461
|
setIsResponding(false);
|
|
@@ -36281,12 +36472,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36281
36472
|
terminalHeight
|
|
36282
36473
|
);
|
|
36283
36474
|
const activePtyId = activeShellPtyId || activeToolPtyId;
|
|
36284
|
-
(0,
|
|
36475
|
+
(0, import_react135.useEffect)(() => {
|
|
36285
36476
|
if (!activePtyId) {
|
|
36286
36477
|
setShellInputFocused(false);
|
|
36287
36478
|
}
|
|
36288
36479
|
}, [activePtyId, setShellInputFocused]);
|
|
36289
|
-
const streamingState = (0,
|
|
36480
|
+
const streamingState = (0, import_react135.useMemo)(() => {
|
|
36290
36481
|
if (toolCalls.some((tc) => tc.status === "awaiting_approval")) {
|
|
36291
36482
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
36292
36483
|
}
|
|
@@ -36304,7 +36495,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36304
36495
|
}
|
|
36305
36496
|
return "idle" /* Idle */;
|
|
36306
36497
|
}, [isResponding, toolCalls]);
|
|
36307
|
-
(0,
|
|
36498
|
+
(0, import_react135.useEffect)(() => {
|
|
36308
36499
|
if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
|
|
36309
36500
|
const lastUserMessageIndex = findLastUserItemIndex(history);
|
|
36310
36501
|
const turnCount = lastUserMessageIndex === -1 ? 0 : history.length - lastUserMessageIndex;
|
|
@@ -36316,7 +36507,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36316
36507
|
}
|
|
36317
36508
|
}
|
|
36318
36509
|
}, [streamingState, config, history]);
|
|
36319
|
-
const cancelOngoingRequest = (0,
|
|
36510
|
+
const cancelOngoingRequest = (0, import_react135.useCallback)(() => {
|
|
36320
36511
|
if (streamingState !== "responding" /* Responding */) {
|
|
36321
36512
|
return;
|
|
36322
36513
|
}
|
|
@@ -36369,6 +36560,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36369
36560
|
onCancelSubmit({
|
|
36370
36561
|
pendingItem: pendingItemAtCancel,
|
|
36371
36562
|
lastTurnUserItem: lastTurnUserItemRef.current,
|
|
36563
|
+
canUndoLastLoggedUserMessage: canUndoLastLoggedUserMessageRef.current,
|
|
36372
36564
|
turnProducedMeaningfulContent: turnSawContentEventRef.current
|
|
36373
36565
|
});
|
|
36374
36566
|
} finally {
|
|
@@ -36387,7 +36579,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36387
36579
|
config,
|
|
36388
36580
|
getPromptCount
|
|
36389
36581
|
]);
|
|
36390
|
-
const applyVisionBridgeIfNeeded = (0,
|
|
36582
|
+
const applyVisionBridgeIfNeeded = (0, import_react135.useCallback)(
|
|
36391
36583
|
async (parts, timestamp, signal) => {
|
|
36392
36584
|
if (parts === null || !hasImageParts(parts)) {
|
|
36393
36585
|
return { parts, shouldProceed: true };
|
|
@@ -36452,15 +36644,17 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36452
36644
|
},
|
|
36453
36645
|
[addItem, config]
|
|
36454
36646
|
);
|
|
36455
|
-
const prepareQueryForGemini = (0,
|
|
36456
|
-
async (query, userMessageTimestamp, abortSignal, prompt_id, submitType) => {
|
|
36647
|
+
const prepareQueryForGemini = (0, import_react135.useCallback)(
|
|
36648
|
+
async (query, userMessageTimestamp, abortSignal, prompt_id, submitType, submittedPrompt, preserveTurnOwnership) => {
|
|
36457
36649
|
if (turnCancelledRef.current) {
|
|
36458
36650
|
return { queryToSend: null, shouldProceed: false };
|
|
36459
36651
|
}
|
|
36460
36652
|
if (typeof query === "string" && query.trim().length === 0) {
|
|
36461
36653
|
return { queryToSend: null, shouldProceed: false };
|
|
36462
36654
|
}
|
|
36463
|
-
|
|
36655
|
+
if (!preserveTurnOwnership) {
|
|
36656
|
+
lastTurnUserItemRef.current = null;
|
|
36657
|
+
}
|
|
36464
36658
|
let localQueryToSendToGemini = null;
|
|
36465
36659
|
if (typeof query === "string") {
|
|
36466
36660
|
const trimmedQuery = query.trim();
|
|
@@ -36478,6 +36672,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36478
36672
|
}
|
|
36479
36673
|
onDebugMessage(`Received user query (${trimmedQuery.length} chars)`);
|
|
36480
36674
|
await logger?.logMessage("user" /* USER */, trimmedQuery);
|
|
36675
|
+
canUndoLastLoggedUserMessageRef.current = !preserveTurnOwnership && logger != null;
|
|
36481
36676
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
36482
36677
|
if (slashCommandResult) {
|
|
36483
36678
|
switch (slashCommandResult.type) {
|
|
@@ -36551,10 +36746,13 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36551
36746
|
},
|
|
36552
36747
|
userMessageTimestamp
|
|
36553
36748
|
);
|
|
36554
|
-
|
|
36555
|
-
|
|
36556
|
-
|
|
36557
|
-
|
|
36749
|
+
if (!preserveTurnOwnership) {
|
|
36750
|
+
lastTurnUserItemRef.current = {
|
|
36751
|
+
id: insertedId,
|
|
36752
|
+
text: trimmedQuery,
|
|
36753
|
+
...submittedPrompt === void 0 ? {} : { submittedPrompt }
|
|
36754
|
+
};
|
|
36755
|
+
}
|
|
36558
36756
|
await new Promise((r) => setImmediate(r));
|
|
36559
36757
|
}
|
|
36560
36758
|
if (isAtCommand(trimmedQuery)) {
|
|
@@ -36603,7 +36801,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36603
36801
|
applyVisionBridgeIfNeeded
|
|
36604
36802
|
]
|
|
36605
36803
|
);
|
|
36606
|
-
const handleContentEvent = (0,
|
|
36804
|
+
const handleContentEvent = (0, import_react135.useCallback)(
|
|
36607
36805
|
(eventValue, currentGeminiMessageBuffer, userMessageTimestamp) => {
|
|
36608
36806
|
if (turnCancelledRef.current) {
|
|
36609
36807
|
return "";
|
|
@@ -36728,7 +36926,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36728
36926
|
terminalWidthRef
|
|
36729
36927
|
]
|
|
36730
36928
|
);
|
|
36731
|
-
const mergeThought = (0,
|
|
36929
|
+
const mergeThought = (0, import_react135.useCallback)(
|
|
36732
36930
|
(incoming) => {
|
|
36733
36931
|
setThought((prev) => {
|
|
36734
36932
|
const incomingDescription = incoming.description ? clampLoadingThoughtDescription(incoming.description) : incoming.description;
|
|
@@ -36757,7 +36955,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36757
36955
|
},
|
|
36758
36956
|
[setThought]
|
|
36759
36957
|
);
|
|
36760
|
-
const handleThoughtEvent = (0,
|
|
36958
|
+
const handleThoughtEvent = (0, import_react135.useCallback)(
|
|
36761
36959
|
(eventValue, currentThoughtBuffer, userMessageTimestamp) => {
|
|
36762
36960
|
if (turnCancelledRef.current) {
|
|
36763
36961
|
return "";
|
|
@@ -36819,7 +37017,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36819
37017
|
},
|
|
36820
37018
|
[addItem, mergeThought, pendingThoughtItemRef, setPendingThoughtItem]
|
|
36821
37019
|
);
|
|
36822
|
-
const commitPendingThought = (0,
|
|
37020
|
+
const commitPendingThought = (0, import_react135.useCallback)(
|
|
36823
37021
|
(userMessageTimestamp) => {
|
|
36824
37022
|
if (pendingThoughtItemRef.current) {
|
|
36825
37023
|
const item = { ...pendingThoughtItemRef.current };
|
|
@@ -36833,7 +37031,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36833
37031
|
},
|
|
36834
37032
|
[addItem, pendingThoughtItemRef, setPendingThoughtItem]
|
|
36835
37033
|
);
|
|
36836
|
-
const handleUserCancelledEvent = (0,
|
|
37034
|
+
const handleUserCancelledEvent = (0, import_react135.useCallback)(
|
|
36837
37035
|
(userMessageTimestamp) => {
|
|
36838
37036
|
if (turnCancelledRef.current) {
|
|
36839
37037
|
return;
|
|
@@ -36873,7 +37071,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36873
37071
|
clearRetryCountdown
|
|
36874
37072
|
]
|
|
36875
37073
|
);
|
|
36876
|
-
const handleErrorEvent = (0,
|
|
37074
|
+
const handleErrorEvent = (0, import_react135.useCallback)(
|
|
36877
37075
|
(eventValue, userMessageTimestamp) => {
|
|
36878
37076
|
lastPromptErroredRef.current = true;
|
|
36879
37077
|
commitPendingThought(userMessageTimestamp);
|
|
@@ -36916,7 +37114,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36916
37114
|
clearRetryCountdown
|
|
36917
37115
|
]
|
|
36918
37116
|
);
|
|
36919
|
-
const handleCitationEvent = (0,
|
|
37117
|
+
const handleCitationEvent = (0, import_react135.useCallback)(
|
|
36920
37118
|
(text, userMessageTimestamp) => {
|
|
36921
37119
|
if (!showCitations(settings)) {
|
|
36922
37120
|
return;
|
|
@@ -36935,7 +37133,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36935
37133
|
settings
|
|
36936
37134
|
]
|
|
36937
37135
|
);
|
|
36938
|
-
const handleFinishedEvent = (0,
|
|
37136
|
+
const handleFinishedEvent = (0, import_react135.useCallback)(
|
|
36939
37137
|
(event, userMessageTimestamp) => {
|
|
36940
37138
|
const finishReason = event.value.reason;
|
|
36941
37139
|
if (!finishReason) {
|
|
@@ -36976,8 +37174,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36976
37174
|
},
|
|
36977
37175
|
[addItem, clearRetryCountdown]
|
|
36978
37176
|
);
|
|
36979
|
-
const autonomousLoopTickResolverRef = (0,
|
|
36980
|
-
const handleChatCompressionEvent = (0,
|
|
37177
|
+
const autonomousLoopTickResolverRef = (0, import_react135.useRef)(null);
|
|
37178
|
+
const handleChatCompressionEvent = (0, import_react135.useCallback)(
|
|
36981
37179
|
(eventValue, userMessageTimestamp) => {
|
|
36982
37180
|
autonomousLoopTickResolverRef.current?.resetCache();
|
|
36983
37181
|
if (pendingHistoryItemRef.current) {
|
|
@@ -36996,7 +37194,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36996
37194
|
},
|
|
36997
37195
|
[addItem, commitItem, config, pendingHistoryItemRef, setPendingHistoryItem]
|
|
36998
37196
|
);
|
|
36999
|
-
const handleMaxSessionTurnsEvent = (0,
|
|
37197
|
+
const handleMaxSessionTurnsEvent = (0, import_react135.useCallback)(
|
|
37000
37198
|
() => addItem(
|
|
37001
37199
|
{
|
|
37002
37200
|
type: "info",
|
|
@@ -37006,7 +37204,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37006
37204
|
),
|
|
37007
37205
|
[addItem, config]
|
|
37008
37206
|
);
|
|
37009
|
-
const handleSessionTokenLimitExceededEvent = (0,
|
|
37207
|
+
const handleSessionTokenLimitExceededEvent = (0, import_react135.useCallback)(
|
|
37010
37208
|
(value) => addItem(
|
|
37011
37209
|
{
|
|
37012
37210
|
type: "error",
|
|
@@ -37021,7 +37219,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37021
37219
|
),
|
|
37022
37220
|
[addItem]
|
|
37023
37221
|
);
|
|
37024
|
-
const handleLoopDetectionConfirmation = (0,
|
|
37222
|
+
const handleLoopDetectionConfirmation = (0, import_react135.useCallback)(
|
|
37025
37223
|
(result) => {
|
|
37026
37224
|
setLoopDetectionConfirmationRequest(null);
|
|
37027
37225
|
if (result.userSelection === "disable") {
|
|
@@ -37045,12 +37243,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37045
37243
|
},
|
|
37046
37244
|
[config, addItem]
|
|
37047
37245
|
);
|
|
37048
|
-
const handleLoopDetectedEvent = (0,
|
|
37246
|
+
const handleLoopDetectedEvent = (0, import_react135.useCallback)(() => {
|
|
37049
37247
|
setLoopDetectionConfirmationRequest({
|
|
37050
37248
|
onComplete: handleLoopDetectionConfirmation
|
|
37051
37249
|
});
|
|
37052
37250
|
}, [handleLoopDetectionConfirmation]);
|
|
37053
|
-
const handleUserPromptSubmitBlockedEvent = (0,
|
|
37251
|
+
const handleUserPromptSubmitBlockedEvent = (0, import_react135.useCallback)(
|
|
37054
37252
|
(value, userMessageTimestamp) => {
|
|
37055
37253
|
if (pendingHistoryItemRef.current) {
|
|
37056
37254
|
commitItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -37067,7 +37265,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37067
37265
|
},
|
|
37068
37266
|
[addItem, commitItem, pendingHistoryItemRef, setPendingHistoryItem]
|
|
37069
37267
|
);
|
|
37070
|
-
const handleStopHookLoopEvent = (0,
|
|
37268
|
+
const handleStopHookLoopEvent = (0, import_react135.useCallback)(
|
|
37071
37269
|
(value, userMessageTimestamp) => {
|
|
37072
37270
|
if (pendingHistoryItemRef.current) {
|
|
37073
37271
|
commitItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -37101,7 +37299,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37101
37299
|
},
|
|
37102
37300
|
[addItem, commitItem, config, pendingHistoryItemRef, setPendingHistoryItem]
|
|
37103
37301
|
);
|
|
37104
|
-
const handleActiveGoalEvent = (0,
|
|
37302
|
+
const handleActiveGoalEvent = (0, import_react135.useCallback)(
|
|
37105
37303
|
(activeGoal) => {
|
|
37106
37304
|
const sessionId = config.getSessionId();
|
|
37107
37305
|
const currentActiveGoal = getActiveGoal(sessionId);
|
|
@@ -37119,7 +37317,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37119
37317
|
},
|
|
37120
37318
|
[config]
|
|
37121
37319
|
);
|
|
37122
|
-
const processGeminiStreamEvents = (0,
|
|
37320
|
+
const processGeminiStreamEvents = (0, import_react135.useCallback)(
|
|
37123
37321
|
async (stream, userMessageTimestamp, signal) => {
|
|
37124
37322
|
let geminiMessageBuffer = "";
|
|
37125
37323
|
let thoughtBuffer = "";
|
|
@@ -37347,6 +37545,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37347
37545
|
case "active_goal" /* ActiveGoal */:
|
|
37348
37546
|
handleActiveGoalEvent(event.value);
|
|
37349
37547
|
break;
|
|
37548
|
+
case "goal_state" /* GoalState */:
|
|
37549
|
+
break;
|
|
37350
37550
|
default: {
|
|
37351
37551
|
const unreachable = event;
|
|
37352
37552
|
return unreachable;
|
|
@@ -37459,7 +37659,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37459
37659
|
dualOutput
|
|
37460
37660
|
]
|
|
37461
37661
|
);
|
|
37462
|
-
const resolveSteeredMessages = (0,
|
|
37662
|
+
const resolveSteeredMessages = (0, import_react135.useCallback)(
|
|
37463
37663
|
async (messages, signal) => {
|
|
37464
37664
|
const resolvedSegments = [];
|
|
37465
37665
|
const resolvedForRecording = [];
|
|
@@ -37628,7 +37828,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37628
37828
|
onDebugMessage
|
|
37629
37829
|
]
|
|
37630
37830
|
);
|
|
37631
|
-
const resolveDrainedSteerMessages = (0,
|
|
37831
|
+
const resolveDrainedSteerMessages = (0, import_react135.useCallback)(
|
|
37632
37832
|
async (messages, signal) => {
|
|
37633
37833
|
try {
|
|
37634
37834
|
const resolved = await resolveSteeredMessages(messages, signal);
|
|
@@ -37665,7 +37865,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37665
37865
|
},
|
|
37666
37866
|
[midTurnRestoreRef, onDebugMessage, resolveSteeredMessages]
|
|
37667
37867
|
);
|
|
37668
|
-
const drainSteerAtBoundary = (0,
|
|
37868
|
+
const drainSteerAtBoundary = (0, import_react135.useCallback)(
|
|
37669
37869
|
async (signal) => {
|
|
37670
37870
|
const messages = midTurnDrainRef?.current?.() ?? [];
|
|
37671
37871
|
if (messages.length === 0) return void 0;
|
|
@@ -37673,10 +37873,11 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37673
37873
|
},
|
|
37674
37874
|
[midTurnDrainRef, resolveDrainedSteerMessages]
|
|
37675
37875
|
);
|
|
37676
|
-
const submitQuery = (0,
|
|
37876
|
+
const submitQuery = (0, import_react135.useCallback)(
|
|
37677
37877
|
async (query, submitType = "userQuery" /* UserQuery */, prompt_id, metadata) => {
|
|
37678
37878
|
const allowConcurrentBtwDuringResponse = submitType === "userQuery" /* UserQuery */ && streamingState === "responding" /* Responding */ && typeof query === "string" && isBtwCommand(query);
|
|
37679
37879
|
const isTurnContinuation = submitType === "toolResult" /* ToolResult */ || submitType === "steer" /* Steer */;
|
|
37880
|
+
const submittedPrompt = submitType === "userQuery" /* UserQuery */ ? metadata?.submittedPrompt : void 0;
|
|
37680
37881
|
if (isSubmittingQueryRef.current && !isTurnContinuation && !allowConcurrentBtwDuringResponse) {
|
|
37681
37882
|
metadata?.onDeliveryFailed?.();
|
|
37682
37883
|
return;
|
|
@@ -37689,6 +37890,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37689
37890
|
loopDetectedRef.current = false;
|
|
37690
37891
|
if (!isTurnContinuation && !allowConcurrentBtwDuringResponse) {
|
|
37691
37892
|
lastTurnUserItemRef.current = null;
|
|
37893
|
+
canUndoLastLoggedUserMessageRef.current = false;
|
|
37692
37894
|
turnSawContentEventRef.current = false;
|
|
37693
37895
|
handledProviderToolCallIdsRef.current.clear();
|
|
37694
37896
|
duplicateProviderToolCallResponseIdsRef.current.clear();
|
|
@@ -37735,7 +37937,9 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37735
37937
|
userMessageTimestamp,
|
|
37736
37938
|
abortSignal,
|
|
37737
37939
|
prompt_id,
|
|
37738
|
-
submitType
|
|
37940
|
+
submitType,
|
|
37941
|
+
submittedPrompt,
|
|
37942
|
+
allowConcurrentBtwDuringResponse
|
|
37739
37943
|
);
|
|
37740
37944
|
if (!shouldProceed || queryToSend === null) {
|
|
37741
37945
|
isSubmittingQueryRef.current = false;
|
|
@@ -37793,17 +37997,19 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37793
37997
|
);
|
|
37794
37998
|
dualOutput.emitUserMessage(userParts);
|
|
37795
37999
|
}
|
|
38000
|
+
const sendOptions = {
|
|
38001
|
+
type: submitType,
|
|
38002
|
+
notificationDisplayText: metadata?.notificationDisplayText,
|
|
38003
|
+
modelOverride: modelOverrideRef.current,
|
|
38004
|
+
steerInput: metadata?.steerInput,
|
|
38005
|
+
...submittedPrompt !== void 0 ? { submittedPrompt } : {},
|
|
38006
|
+
...!allowConcurrentBtwDuringResponse && midTurnDrainRef ? { getSteerInput: drainSteerAtBoundary } : {}
|
|
38007
|
+
};
|
|
37796
38008
|
const stream = geminiClient.sendMessageStream(
|
|
37797
38009
|
finalQueryToSend,
|
|
37798
38010
|
abortSignal,
|
|
37799
38011
|
prompt_id,
|
|
37800
|
-
|
|
37801
|
-
type: submitType,
|
|
37802
|
-
notificationDisplayText: metadata?.notificationDisplayText,
|
|
37803
|
-
modelOverride: modelOverrideRef.current,
|
|
37804
|
-
steerInput: metadata?.steerInput,
|
|
37805
|
-
...!allowConcurrentBtwDuringResponse && midTurnDrainRef ? { getSteerInput: drainSteerAtBoundary } : {}
|
|
37806
|
-
}
|
|
38012
|
+
sendOptions
|
|
37807
38013
|
);
|
|
37808
38014
|
const processingStatus = await processGeminiStreamEvents(
|
|
37809
38015
|
stream,
|
|
@@ -37857,6 +38063,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37857
38063
|
}
|
|
37858
38064
|
if (retryCountdownTimerRef.current) {
|
|
37859
38065
|
clearRetryCountdown();
|
|
38066
|
+
} else if (pendingRetryErrorItemRef.current && !lastPromptErroredRef.current) {
|
|
38067
|
+
clearRetryCountdown();
|
|
37860
38068
|
}
|
|
37861
38069
|
const loopDetected = loopDetectedRef.current;
|
|
37862
38070
|
if (loopDetected) {
|
|
@@ -37956,7 +38164,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37956
38164
|
midTurnDrainRef
|
|
37957
38165
|
]
|
|
37958
38166
|
);
|
|
37959
|
-
const retryLastPrompt = (0,
|
|
38167
|
+
const retryLastPrompt = (0, import_react135.useCallback)(async () => {
|
|
37960
38168
|
if (skipRetryDelayRef.current) {
|
|
37961
38169
|
skipRetryDelayRef.current();
|
|
37962
38170
|
skipRetryDelayRef.current = null;
|
|
@@ -37980,7 +38188,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37980
38188
|
clearRetryCountdown();
|
|
37981
38189
|
await submitQuery(lastPrompt, "retry" /* Retry */);
|
|
37982
38190
|
}, [streamingState, addItem, clearRetryCountdown, submitQuery]);
|
|
37983
|
-
const handleApprovalModeChange = (0,
|
|
38191
|
+
const handleApprovalModeChange = (0, import_react135.useCallback)(
|
|
37984
38192
|
async (newApprovalMode) => {
|
|
37985
38193
|
if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "auto-edit" /* AUTO_EDIT */) {
|
|
37986
38194
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
@@ -38015,7 +38223,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38015
38223
|
},
|
|
38016
38224
|
[toolCalls]
|
|
38017
38225
|
);
|
|
38018
|
-
const handleCompletedTools = (0,
|
|
38226
|
+
const handleCompletedTools = (0, import_react135.useCallback)(
|
|
38019
38227
|
async (completedToolCallsFromScheduler) => {
|
|
38020
38228
|
const completedAndReadyToSubmitTools = completedToolCallsFromScheduler.filter(
|
|
38021
38229
|
(tc) => {
|
|
@@ -38326,7 +38534,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38326
38534
|
resolveDrainedSteerMessages
|
|
38327
38535
|
]
|
|
38328
38536
|
);
|
|
38329
|
-
const pendingHistoryItems = (0,
|
|
38537
|
+
const pendingHistoryItems = (0, import_react135.useMemo)(
|
|
38330
38538
|
() => [
|
|
38331
38539
|
// Reasoning renders above the streaming answer.
|
|
38332
38540
|
pendingThoughtItem,
|
|
@@ -38343,7 +38551,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38343
38551
|
pendingToolCallGroupDisplay
|
|
38344
38552
|
]
|
|
38345
38553
|
);
|
|
38346
|
-
(0,
|
|
38554
|
+
(0, import_react135.useEffect)(() => {
|
|
38347
38555
|
const saveRestorableToolCalls = /* @__PURE__ */ __name(async () => {
|
|
38348
38556
|
if (!config.getFileCheckpointingEnabled()) {
|
|
38349
38557
|
return;
|
|
@@ -38414,14 +38622,14 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38414
38622
|
}, "saveRestorableToolCalls");
|
|
38415
38623
|
saveRestorableToolCalls();
|
|
38416
38624
|
}, [toolCalls, config, onDebugMessage, history, geminiClient, storage]);
|
|
38417
|
-
const notificationQueueRef = (0,
|
|
38418
|
-
const [notificationTrigger, setNotificationTrigger] = (0,
|
|
38419
|
-
const getAutonomousLoopTickResolver = (0,
|
|
38625
|
+
const notificationQueueRef = (0, import_react135.useRef)([]);
|
|
38626
|
+
const [notificationTrigger, setNotificationTrigger] = (0, import_react135.useState)(0);
|
|
38627
|
+
const getAutonomousLoopTickResolver = (0, import_react135.useCallback)(() => {
|
|
38420
38628
|
autonomousLoopTickResolverRef.current ??= new AutonomousLoopTickResolver();
|
|
38421
38629
|
return autonomousLoopTickResolverRef.current;
|
|
38422
38630
|
}, []);
|
|
38423
|
-
const notificationQueueSessionIdRef = (0,
|
|
38424
|
-
(0,
|
|
38631
|
+
const notificationQueueSessionIdRef = (0, import_react135.useRef)(sessionStates.sessionId);
|
|
38632
|
+
(0, import_react135.useEffect)(() => {
|
|
38425
38633
|
if (notificationQueueSessionIdRef.current === sessionStates.sessionId) {
|
|
38426
38634
|
return;
|
|
38427
38635
|
}
|
|
@@ -38429,9 +38637,9 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38429
38637
|
notificationQueueRef.current = [];
|
|
38430
38638
|
autonomousLoopTickResolverRef.current?.resetCache();
|
|
38431
38639
|
}, [sessionStates.sessionId]);
|
|
38432
|
-
const cronSessionIdRef = (0,
|
|
38640
|
+
const cronSessionIdRef = (0, import_react135.useRef)(sessionStates.sessionId);
|
|
38433
38641
|
cronSessionIdRef.current = sessionStates.sessionId;
|
|
38434
|
-
(0,
|
|
38642
|
+
(0, import_react135.useEffect)(() => {
|
|
38435
38643
|
if (!isConfigInitialized) return;
|
|
38436
38644
|
if (!config.isCronEnabled()) return;
|
|
38437
38645
|
const scheduler = config.getCronScheduler();
|
|
@@ -38480,11 +38688,11 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38480
38688
|
const summary = scheduler.getExitSummary();
|
|
38481
38689
|
scheduler.stop();
|
|
38482
38690
|
if (summary) {
|
|
38483
|
-
|
|
38691
|
+
process15.stderr.write(summary + "\n");
|
|
38484
38692
|
}
|
|
38485
38693
|
};
|
|
38486
38694
|
}, [config, getAutonomousLoopTickResolver, isConfigInitialized]);
|
|
38487
|
-
(0,
|
|
38695
|
+
(0, import_react135.useEffect)(() => {
|
|
38488
38696
|
const registry = config.getBackgroundTaskRegistry();
|
|
38489
38697
|
registry.setNotificationCallback((displayText, modelText) => {
|
|
38490
38698
|
notificationQueueRef.current.push({
|
|
@@ -38498,7 +38706,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38498
38706
|
registry.setNotificationCallback(void 0);
|
|
38499
38707
|
};
|
|
38500
38708
|
}, [config]);
|
|
38501
|
-
(0,
|
|
38709
|
+
(0, import_react135.useEffect)(() => {
|
|
38502
38710
|
const registry = config.getBackgroundShellRegistry();
|
|
38503
38711
|
registry.setNotificationCallback((displayText, modelText) => {
|
|
38504
38712
|
notificationQueueRef.current.push({
|
|
@@ -38512,7 +38720,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38512
38720
|
registry.setNotificationCallback(void 0);
|
|
38513
38721
|
};
|
|
38514
38722
|
}, [config]);
|
|
38515
|
-
(0,
|
|
38723
|
+
(0, import_react135.useEffect)(() => {
|
|
38516
38724
|
const registry = config.getMonitorRegistry();
|
|
38517
38725
|
registry.setNotificationCallback((displayText, modelText, meta) => {
|
|
38518
38726
|
if (meta.status === "running" && typeof registry.get === "function") {
|
|
@@ -38531,7 +38739,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38531
38739
|
registry.setNotificationCallback(void 0);
|
|
38532
38740
|
};
|
|
38533
38741
|
}, [config]);
|
|
38534
|
-
(0,
|
|
38742
|
+
(0, import_react135.useEffect)(() => {
|
|
38535
38743
|
if (streamingState === "idle" /* Idle */ && !isSubmittingQueryRef.current && notificationQueueRef.current.length > 0) {
|
|
38536
38744
|
runOutsideAgentContext(() => {
|
|
38537
38745
|
const queue = notificationQueueRef.current;
|
|
@@ -38579,9 +38787,9 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38579
38787
|
});
|
|
38580
38788
|
}
|
|
38581
38789
|
}, [streamingState, submitQuery, notificationTrigger, addItem, config]);
|
|
38582
|
-
const teammateQueueRef = (0,
|
|
38583
|
-
const [teammateTrigger, setTeammateTrigger] = (0,
|
|
38584
|
-
(0,
|
|
38790
|
+
const teammateQueueRef = (0, import_react135.useRef)([]);
|
|
38791
|
+
const [teammateTrigger, setTeammateTrigger] = (0, import_react135.useState)(0);
|
|
38792
|
+
(0, import_react135.useEffect)(() => {
|
|
38585
38793
|
let boundManager = null;
|
|
38586
38794
|
const handleManagerChange = /* @__PURE__ */ __name((manager) => {
|
|
38587
38795
|
if (boundManager && boundManager !== manager) {
|
|
@@ -38611,7 +38819,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38611
38819
|
}
|
|
38612
38820
|
};
|
|
38613
38821
|
}, [config]);
|
|
38614
|
-
(0,
|
|
38822
|
+
(0, import_react135.useEffect)(() => {
|
|
38615
38823
|
if (streamingState === "idle" /* Idle */ && !isSubmittingQueryRef.current && teammateQueueRef.current.length > 0) {
|
|
38616
38824
|
runOutsideAgentContext(() => {
|
|
38617
38825
|
const batch = teammateQueueRef.current.splice(0);
|
|
@@ -38648,7 +38856,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38648
38856
|
|
|
38649
38857
|
// packages/cli/src/ui/hooks/vim.ts
|
|
38650
38858
|
init_esbuild_shims();
|
|
38651
|
-
var
|
|
38859
|
+
var import_react136 = __toESM(require_react(), 1);
|
|
38652
38860
|
import { execFile as execFile7, execFileSync as execFileSync2 } from "child_process";
|
|
38653
38861
|
var DIGIT_MULTIPLIER = 10;
|
|
38654
38862
|
var DEFAULT_COUNT = 1;
|
|
@@ -38884,26 +39092,26 @@ __name(findCharInLineReverse, "findCharInLineReverse");
|
|
|
38884
39092
|
function useVim(buffer, onSubmit) {
|
|
38885
39093
|
const { vimEnabled, vimMode } = useVimModeState();
|
|
38886
39094
|
const { setVimMode } = useVimModeActions();
|
|
38887
|
-
const [state, dispatch] = (0,
|
|
38888
|
-
const bufferRef = (0,
|
|
38889
|
-
const stateRef = (0,
|
|
39095
|
+
const [state, dispatch] = (0, import_react136.useReducer)(vimReducer, initialVimState);
|
|
39096
|
+
const bufferRef = (0, import_react136.useRef)(buffer);
|
|
39097
|
+
const stateRef = (0, import_react136.useRef)(state);
|
|
38890
39098
|
bufferRef.current = buffer;
|
|
38891
39099
|
stateRef.current = state;
|
|
38892
|
-
(0,
|
|
39100
|
+
(0, import_react136.useEffect)(() => {
|
|
38893
39101
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
38894
39102
|
}, [vimMode]);
|
|
38895
|
-
const updateMode = (0,
|
|
39103
|
+
const updateMode = (0, import_react136.useCallback)(
|
|
38896
39104
|
(mode) => {
|
|
38897
39105
|
setVimMode(mode);
|
|
38898
39106
|
dispatch({ type: "SET_MODE", mode });
|
|
38899
39107
|
},
|
|
38900
39108
|
[setVimMode]
|
|
38901
39109
|
);
|
|
38902
|
-
const getCurrentCount = (0,
|
|
39110
|
+
const getCurrentCount = (0, import_react136.useCallback)(
|
|
38903
39111
|
() => stateRef.current.count || DEFAULT_COUNT,
|
|
38904
39112
|
[]
|
|
38905
39113
|
);
|
|
38906
|
-
const yankRange = (0,
|
|
39114
|
+
const yankRange = (0, import_react136.useCallback)(
|
|
38907
39115
|
(startRow, startCol, endRow, endCol, linewise) => {
|
|
38908
39116
|
const lines = bufferRef.current.lines;
|
|
38909
39117
|
let text = "";
|
|
@@ -38918,7 +39126,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38918
39126
|
},
|
|
38919
39127
|
[]
|
|
38920
39128
|
);
|
|
38921
|
-
const executeCommand = (0,
|
|
39129
|
+
const executeCommand = (0, import_react136.useCallback)(
|
|
38922
39130
|
(cmdType, count) => {
|
|
38923
39131
|
switch (cmdType) {
|
|
38924
39132
|
case CMD_TYPES.DELETE_WORD_FORWARD:
|
|
@@ -39319,7 +39527,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39319
39527
|
return { text, linewise: movement === "j" || movement === "k" };
|
|
39320
39528
|
}
|
|
39321
39529
|
__name(extractMovementText, "extractMovementText");
|
|
39322
|
-
const executeFind = (0,
|
|
39530
|
+
const executeFind = (0, import_react136.useCallback)(
|
|
39323
39531
|
(findType, char, count = 1) => {
|
|
39324
39532
|
const [startRow, startCol] = buffer.cursor;
|
|
39325
39533
|
const line = buffer.lines[startRow] ?? "";
|
|
@@ -39355,7 +39563,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39355
39563
|
},
|
|
39356
39564
|
[buffer, dispatch]
|
|
39357
39565
|
);
|
|
39358
|
-
const handleCharRead = (0,
|
|
39566
|
+
const handleCharRead = (0, import_react136.useCallback)(
|
|
39359
39567
|
(char) => {
|
|
39360
39568
|
const readType = state.pendingCharRead;
|
|
39361
39569
|
if (!readType) return false;
|
|
@@ -39398,7 +39606,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39398
39606
|
},
|
|
39399
39607
|
[state.pendingCharRead, buffer, dispatch, executeFind]
|
|
39400
39608
|
);
|
|
39401
|
-
const handleInsertModeInput = (0,
|
|
39609
|
+
const handleInsertModeInput = (0, import_react136.useCallback)(
|
|
39402
39610
|
(normalizedKey) => {
|
|
39403
39611
|
if (normalizedKey.name === "escape") {
|
|
39404
39612
|
buffer.vimEscapeInsertMode();
|
|
@@ -39429,7 +39637,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39429
39637
|
},
|
|
39430
39638
|
[buffer, dispatch, updateMode, onSubmit]
|
|
39431
39639
|
);
|
|
39432
|
-
const normalizeKey = (0,
|
|
39640
|
+
const normalizeKey = (0, import_react136.useCallback)(
|
|
39433
39641
|
(key) => ({
|
|
39434
39642
|
name: key.name || "",
|
|
39435
39643
|
sequence: key.sequence || "",
|
|
@@ -39440,7 +39648,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39440
39648
|
}),
|
|
39441
39649
|
[]
|
|
39442
39650
|
);
|
|
39443
|
-
const handleChangeMovement = (0,
|
|
39651
|
+
const handleChangeMovement = (0, import_react136.useCallback)(
|
|
39444
39652
|
(movement) => {
|
|
39445
39653
|
const count = getCurrentCount();
|
|
39446
39654
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -39461,7 +39669,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39461
39669
|
},
|
|
39462
39670
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
39463
39671
|
);
|
|
39464
|
-
const handleDeleteMovement = (0,
|
|
39672
|
+
const handleDeleteMovement = (0, import_react136.useCallback)(
|
|
39465
39673
|
(movement) => {
|
|
39466
39674
|
const count = getCurrentCount();
|
|
39467
39675
|
const [row, col] = bufferRef.current.cursor;
|
|
@@ -39496,7 +39704,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39496
39704
|
},
|
|
39497
39705
|
[getCurrentCount, dispatch, buffer]
|
|
39498
39706
|
);
|
|
39499
|
-
const handleYankMovement = (0,
|
|
39707
|
+
const handleYankMovement = (0, import_react136.useCallback)(
|
|
39500
39708
|
(movement) => {
|
|
39501
39709
|
const count = getCurrentCount();
|
|
39502
39710
|
const [row, col] = bufferRef.current.cursor;
|
|
@@ -39530,7 +39738,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39530
39738
|
},
|
|
39531
39739
|
[getCurrentCount, dispatch]
|
|
39532
39740
|
);
|
|
39533
|
-
const handleOperatorMotion = (0,
|
|
39741
|
+
const handleOperatorMotion = (0, import_react136.useCallback)(
|
|
39534
39742
|
(operator, motion) => {
|
|
39535
39743
|
const count = getCurrentCount();
|
|
39536
39744
|
const commandMap = {
|
|
@@ -39562,7 +39770,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39562
39770
|
},
|
|
39563
39771
|
[getCurrentCount, executeCommand, dispatch]
|
|
39564
39772
|
);
|
|
39565
|
-
const handleInput = (0,
|
|
39773
|
+
const handleInput = (0, import_react136.useCallback)(
|
|
39566
39774
|
(key) => {
|
|
39567
39775
|
if (!vimEnabled) {
|
|
39568
39776
|
return false;
|
|
@@ -40284,7 +40492,7 @@ __name(buildWorkflowSteeringNotice, "buildWorkflowSteeringNotice");
|
|
|
40284
40492
|
|
|
40285
40493
|
// packages/cli/src/ui/hooks/useAwaySummary.ts
|
|
40286
40494
|
init_esbuild_shims();
|
|
40287
|
-
var
|
|
40495
|
+
var import_react137 = __toESM(require_react(), 1);
|
|
40288
40496
|
var DEFAULT_AWAY_THRESHOLD_MINUTES = 5;
|
|
40289
40497
|
var MIN_USER_MESSAGES_TO_FIRE = 3;
|
|
40290
40498
|
var MIN_USER_MESSAGES_SINCE_LAST_RECAP = 2;
|
|
@@ -40316,15 +40524,15 @@ function useAwaySummary(options) {
|
|
|
40316
40524
|
history,
|
|
40317
40525
|
awayThresholdMinutes
|
|
40318
40526
|
} = options;
|
|
40319
|
-
const blurredAtRef = (0,
|
|
40320
|
-
const recapPendingRef = (0,
|
|
40321
|
-
const inFlightRef = (0,
|
|
40322
|
-
const isIdleRef = (0,
|
|
40527
|
+
const blurredAtRef = (0, import_react137.useRef)(null);
|
|
40528
|
+
const recapPendingRef = (0, import_react137.useRef)(false);
|
|
40529
|
+
const inFlightRef = (0, import_react137.useRef)(null);
|
|
40530
|
+
const isIdleRef = (0, import_react137.useRef)(isIdle);
|
|
40323
40531
|
isIdleRef.current = isIdle;
|
|
40324
|
-
const historyRef = (0,
|
|
40532
|
+
const historyRef = (0, import_react137.useRef)(history);
|
|
40325
40533
|
historyRef.current = history;
|
|
40326
40534
|
const thresholdMs = (awayThresholdMinutes && awayThresholdMinutes > 0 ? awayThresholdMinutes : DEFAULT_AWAY_THRESHOLD_MINUTES) * 60 * 1e3;
|
|
40327
|
-
(0,
|
|
40535
|
+
(0, import_react137.useEffect)(() => {
|
|
40328
40536
|
if (!enabled || !config) {
|
|
40329
40537
|
inFlightRef.current?.abort();
|
|
40330
40538
|
inFlightRef.current = null;
|
|
@@ -40376,7 +40584,7 @@ function useAwaySummary(options) {
|
|
|
40376
40584
|
recapPendingRef.current = false;
|
|
40377
40585
|
});
|
|
40378
40586
|
}, [enabled, config, isFocused, isIdle, addItem, thresholdMs]);
|
|
40379
|
-
(0,
|
|
40587
|
+
(0, import_react137.useEffect)(
|
|
40380
40588
|
() => () => {
|
|
40381
40589
|
inFlightRef.current?.abort();
|
|
40382
40590
|
},
|
|
@@ -40387,14 +40595,14 @@ __name(useAwaySummary, "useAwaySummary");
|
|
|
40387
40595
|
|
|
40388
40596
|
// packages/cli/src/ui/hooks/useBracketedPaste.ts
|
|
40389
40597
|
init_esbuild_shims();
|
|
40390
|
-
var
|
|
40598
|
+
var import_react138 = __toESM(require_react(), 1);
|
|
40391
40599
|
var ENABLE_BRACKETED_PASTE = "\x1B[?2004h";
|
|
40392
40600
|
var DISABLE_BRACKETED_PASTE = "\x1B[?2004l";
|
|
40393
40601
|
var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
40394
40602
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
40395
40603
|
process.stdout.write(DISABLE_BRACKETED_PASTE);
|
|
40396
40604
|
}, "cleanup");
|
|
40397
|
-
(0,
|
|
40605
|
+
(0, import_react138.useEffect)(() => {
|
|
40398
40606
|
process.stdout.write(ENABLE_BRACKETED_PASTE);
|
|
40399
40607
|
process.on("exit", cleanup);
|
|
40400
40608
|
process.on("SIGINT", cleanup);
|
|
@@ -40413,23 +40621,23 @@ init_esbuild_shims();
|
|
|
40413
40621
|
|
|
40414
40622
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
40415
40623
|
init_esbuild_shims();
|
|
40416
|
-
var
|
|
40624
|
+
var import_react139 = __toESM(require_react(), 1);
|
|
40417
40625
|
var WITTY_LOADING_PHRASES = ["I'm Feeling Lucky"];
|
|
40418
40626
|
var PHRASE_CHANGE_INTERVAL_MS = 15e3;
|
|
40419
40627
|
var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases) => {
|
|
40420
40628
|
const currentLanguage = getCurrentLanguage();
|
|
40421
|
-
const loadingPhrases = (0,
|
|
40629
|
+
const loadingPhrases = (0, import_react139.useMemo)(() => {
|
|
40422
40630
|
if (customPhrases && customPhrases.length > 0) {
|
|
40423
40631
|
return customPhrases;
|
|
40424
40632
|
}
|
|
40425
40633
|
const translatedPhrases = ta("WITTY_LOADING_PHRASES");
|
|
40426
40634
|
return translatedPhrases.length > 0 ? translatedPhrases : WITTY_LOADING_PHRASES;
|
|
40427
40635
|
}, [customPhrases, currentLanguage]);
|
|
40428
|
-
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0,
|
|
40636
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0, import_react139.useState)(
|
|
40429
40637
|
loadingPhrases[0]
|
|
40430
40638
|
);
|
|
40431
|
-
const phraseIntervalRef = (0,
|
|
40432
|
-
(0,
|
|
40639
|
+
const phraseIntervalRef = (0, import_react139.useRef)(null);
|
|
40640
|
+
(0, import_react139.useEffect)(() => {
|
|
40433
40641
|
if (isWaiting) {
|
|
40434
40642
|
setCurrentLoadingPhrase(t("Waiting for user confirmation..."));
|
|
40435
40643
|
if (phraseIntervalRef.current) {
|
|
@@ -40466,9 +40674,9 @@ var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases
|
|
|
40466
40674
|
}, "usePhraseCycler");
|
|
40467
40675
|
|
|
40468
40676
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
40469
|
-
var
|
|
40677
|
+
var import_react140 = __toESM(require_react(), 1);
|
|
40470
40678
|
var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhrases, currentCandidatesTokens, currentStreamingChars, isToolExecuting2 = false) => {
|
|
40471
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
40679
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react140.useState)(0);
|
|
40472
40680
|
const isTimerActive = streamingState === "responding" /* Responding */;
|
|
40473
40681
|
const elapsedTimeFromTimer = useTimer(
|
|
40474
40682
|
isTimerActive,
|
|
@@ -40482,17 +40690,17 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
40482
40690
|
isWaiting,
|
|
40483
40691
|
customWittyPhrases
|
|
40484
40692
|
);
|
|
40485
|
-
const [retainedElapsedTime, setRetainedElapsedTime] = (0,
|
|
40486
|
-
const [taskStartTokens, setTaskStartTokensState] = (0,
|
|
40487
|
-
const [taskStartStreamingChars, setTaskStartStreamingCharsState] = (0,
|
|
40488
|
-
const taskStartTokensRef = (0,
|
|
40489
|
-
const taskStartStreamingCharsRef = (0,
|
|
40490
|
-
const pauseStartTokensRef = (0,
|
|
40491
|
-
const pauseStartStreamingCharsRef = (0,
|
|
40492
|
-
const pauseBaseTaskStartTokensRef = (0,
|
|
40493
|
-
const pauseBaseTaskStartStreamingCharsRef = (0,
|
|
40494
|
-
const prevStreamingStateRef = (0,
|
|
40495
|
-
(0,
|
|
40693
|
+
const [retainedElapsedTime, setRetainedElapsedTime] = (0, import_react140.useState)(0);
|
|
40694
|
+
const [taskStartTokens, setTaskStartTokensState] = (0, import_react140.useState)(0);
|
|
40695
|
+
const [taskStartStreamingChars, setTaskStartStreamingCharsState] = (0, import_react140.useState)(0);
|
|
40696
|
+
const taskStartTokensRef = (0, import_react140.useRef)(0);
|
|
40697
|
+
const taskStartStreamingCharsRef = (0, import_react140.useRef)(0);
|
|
40698
|
+
const pauseStartTokensRef = (0, import_react140.useRef)(null);
|
|
40699
|
+
const pauseStartStreamingCharsRef = (0, import_react140.useRef)(null);
|
|
40700
|
+
const pauseBaseTaskStartTokensRef = (0, import_react140.useRef)(0);
|
|
40701
|
+
const pauseBaseTaskStartStreamingCharsRef = (0, import_react140.useRef)(0);
|
|
40702
|
+
const prevStreamingStateRef = (0, import_react140.useRef)(null);
|
|
40703
|
+
(0, import_react140.useEffect)(() => {
|
|
40496
40704
|
const currentTokens = currentCandidatesTokens ?? 0;
|
|
40497
40705
|
const currentChars = currentStreamingChars ?? 0;
|
|
40498
40706
|
const setTaskStartTokens = /* @__PURE__ */ __name((tokens) => {
|
|
@@ -40563,7 +40771,7 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
40563
40771
|
|
|
40564
40772
|
// packages/cli/src/ui/hooks/useTerminalProgress.ts
|
|
40565
40773
|
init_esbuild_shims();
|
|
40566
|
-
var
|
|
40774
|
+
var import_react141 = __toESM(require_react(), 1);
|
|
40567
40775
|
var PROGRESS_CLEAR = wrapForMultiplexer(`${OSC_PREFIX}9;4;0;${BEL}`);
|
|
40568
40776
|
var PROGRESS_INDETERMINATE = wrapForMultiplexer(`${OSC_PREFIX}9;4;3;;${BEL}`);
|
|
40569
40777
|
function isProgressBarSupported() {
|
|
@@ -40578,13 +40786,13 @@ function isProgressBarSupported() {
|
|
|
40578
40786
|
__name(isProgressBarSupported, "isProgressBarSupported");
|
|
40579
40787
|
function useTerminalProgress(streamingState, hasToolExecuting) {
|
|
40580
40788
|
const { stdout } = use_stdout_default();
|
|
40581
|
-
const writeProgress = (0,
|
|
40789
|
+
const writeProgress = (0, import_react141.useCallback)(
|
|
40582
40790
|
(seq) => {
|
|
40583
40791
|
stdout?.write(seq);
|
|
40584
40792
|
},
|
|
40585
40793
|
[stdout]
|
|
40586
40794
|
);
|
|
40587
|
-
(0,
|
|
40795
|
+
(0, import_react141.useEffect)(() => {
|
|
40588
40796
|
if (!isProgressBarSupported()) return;
|
|
40589
40797
|
if (streamingState === "responding" /* Responding */ && hasToolExecuting) {
|
|
40590
40798
|
writeProgress(PROGRESS_INDETERMINATE);
|
|
@@ -40595,7 +40803,7 @@ function useTerminalProgress(streamingState, hasToolExecuting) {
|
|
|
40595
40803
|
writeProgress(PROGRESS_CLEAR);
|
|
40596
40804
|
};
|
|
40597
40805
|
}, [streamingState, hasToolExecuting, writeProgress]);
|
|
40598
|
-
(0,
|
|
40806
|
+
(0, import_react141.useEffect)(() => {
|
|
40599
40807
|
if (!isProgressBarSupported()) return;
|
|
40600
40808
|
const clearOnExit = /* @__PURE__ */ __name(() => {
|
|
40601
40809
|
stdout?.write(PROGRESS_CLEAR);
|
|
@@ -40610,23 +40818,23 @@ __name(useTerminalProgress, "useTerminalProgress");
|
|
|
40610
40818
|
|
|
40611
40819
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
40612
40820
|
init_esbuild_shims();
|
|
40613
|
-
var
|
|
40614
|
-
import * as
|
|
40821
|
+
var import_react142 = __toESM(require_react(), 1);
|
|
40822
|
+
import * as process16 from "node:process";
|
|
40615
40823
|
var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
40616
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
40617
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
40618
|
-
const [isRestarting, setIsRestarting] = (0,
|
|
40824
|
+
const [isTrusted, setIsTrusted] = (0, import_react142.useState)(void 0);
|
|
40825
|
+
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0, import_react142.useState)(false);
|
|
40826
|
+
const [isRestarting, setIsRestarting] = (0, import_react142.useState)(false);
|
|
40619
40827
|
const folderTrust = settings.merged.security?.folderTrust?.enabled;
|
|
40620
|
-
(0,
|
|
40828
|
+
(0, import_react142.useEffect)(() => {
|
|
40621
40829
|
const { isTrusted: trusted } = isWorkspaceTrusted(settings.merged);
|
|
40622
40830
|
setIsTrusted(trusted);
|
|
40623
40831
|
setIsFolderTrustDialogOpen(trusted === void 0);
|
|
40624
40832
|
onTrustChange(trusted);
|
|
40625
40833
|
}, [folderTrust, onTrustChange, settings.merged]);
|
|
40626
|
-
const handleFolderTrustSelect = (0,
|
|
40834
|
+
const handleFolderTrustSelect = (0, import_react142.useCallback)(
|
|
40627
40835
|
(choice) => {
|
|
40628
40836
|
const trustedFolders = loadTrustedFolders();
|
|
40629
|
-
const cwd3 =
|
|
40837
|
+
const cwd3 = process16.cwd();
|
|
40630
40838
|
let trustLevel;
|
|
40631
40839
|
const wasTrusted = isTrusted ?? true;
|
|
40632
40840
|
switch (choice) {
|
|
@@ -40642,7 +40850,15 @@ var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
|
40642
40850
|
default:
|
|
40643
40851
|
return;
|
|
40644
40852
|
}
|
|
40645
|
-
|
|
40853
|
+
try {
|
|
40854
|
+
trustedFolders.setValue(cwd3, trustLevel);
|
|
40855
|
+
} catch (error) {
|
|
40856
|
+
writeStderrLineSafe("Error saving trusted folders file.");
|
|
40857
|
+
writeStderrLineSafe(
|
|
40858
|
+
error instanceof Error ? error.message : String(error)
|
|
40859
|
+
);
|
|
40860
|
+
return;
|
|
40861
|
+
}
|
|
40646
40862
|
const currentIsTrusted = trustLevel === "TRUST_FOLDER" /* TRUST_FOLDER */ || trustLevel === "TRUST_PARENT" /* TRUST_PARENT */;
|
|
40647
40863
|
setIsTrusted(currentIsTrusted);
|
|
40648
40864
|
onTrustChange(currentIsTrusted);
|
|
@@ -40666,7 +40882,7 @@ var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
|
40666
40882
|
|
|
40667
40883
|
// packages/cli/src/ui/hooks/useMcpApproval.ts
|
|
40668
40884
|
init_esbuild_shims();
|
|
40669
|
-
var
|
|
40885
|
+
var import_react143 = __toESM(require_react(), 1);
|
|
40670
40886
|
function sourceLabel(scope) {
|
|
40671
40887
|
switch (scope) {
|
|
40672
40888
|
case "workspace":
|
|
@@ -40702,8 +40918,8 @@ function summarize(config) {
|
|
|
40702
40918
|
}
|
|
40703
40919
|
__name(summarize, "summarize");
|
|
40704
40920
|
var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
40705
|
-
const [queue, setQueue] = (0,
|
|
40706
|
-
const computePending = (0,
|
|
40921
|
+
const [queue, setQueue] = (0, import_react143.useState)([]);
|
|
40922
|
+
const computePending = (0, import_react143.useCallback)(() => {
|
|
40707
40923
|
if (config.getApprovalMode() === "yolo" /* YOLO */) return [];
|
|
40708
40924
|
const servers = config.getMcpServers() ?? {};
|
|
40709
40925
|
const approvals = loadMcpApprovals();
|
|
@@ -40715,10 +40931,10 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40715
40931
|
source: sourceLabel(c.scope)
|
|
40716
40932
|
}));
|
|
40717
40933
|
}, [config]);
|
|
40718
|
-
(0,
|
|
40934
|
+
(0, import_react143.useEffect)(() => {
|
|
40719
40935
|
setQueue(computePending());
|
|
40720
40936
|
}, [computePending]);
|
|
40721
|
-
(0,
|
|
40937
|
+
(0, import_react143.useEffect)(() => {
|
|
40722
40938
|
const onPendingChanged = /* @__PURE__ */ __name(() => {
|
|
40723
40939
|
setQueue(computePending());
|
|
40724
40940
|
}, "onPendingChanged");
|
|
@@ -40727,7 +40943,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40727
40943
|
appEvents.off("mcp-pending-approval-changed" /* McpPendingApprovalChanged */, onPendingChanged);
|
|
40728
40944
|
};
|
|
40729
40945
|
}, [computePending]);
|
|
40730
|
-
const reconnect = (0,
|
|
40946
|
+
const reconnect = (0, import_react143.useCallback)(
|
|
40731
40947
|
(name) => {
|
|
40732
40948
|
config.approveMcpServerForSession(name);
|
|
40733
40949
|
const registry = config.getToolRegistry();
|
|
@@ -40739,7 +40955,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40739
40955
|
},
|
|
40740
40956
|
[config]
|
|
40741
40957
|
);
|
|
40742
|
-
const handleMcpApprovalSelect = (0,
|
|
40958
|
+
const handleMcpApprovalSelect = (0, import_react143.useCallback)(
|
|
40743
40959
|
async (choice) => {
|
|
40744
40960
|
const approvals = loadMcpApprovals();
|
|
40745
40961
|
const root = config.getWorkingDir();
|
|
@@ -40791,7 +41007,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40791
41007
|
|
|
40792
41008
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
40793
41009
|
init_esbuild_shims();
|
|
40794
|
-
var
|
|
41010
|
+
var import_react144 = __toESM(require_react(), 1);
|
|
40795
41011
|
|
|
40796
41012
|
// packages/cli/src/services/command-migration-tool.ts
|
|
40797
41013
|
init_esbuild_shims();
|
|
@@ -40862,9 +41078,9 @@ __name(migrateTomlCommands, "migrateTomlCommands");
|
|
|
40862
41078
|
|
|
40863
41079
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
40864
41080
|
function useCommandMigration(settings, storage) {
|
|
40865
|
-
const [showMigrationNudge, setShowMigrationNudge] = (0,
|
|
40866
|
-
const [tomlFiles, setTomlFiles] = (0,
|
|
40867
|
-
(0,
|
|
41081
|
+
const [showMigrationNudge, setShowMigrationNudge] = (0, import_react144.useState)(false);
|
|
41082
|
+
const [tomlFiles, setTomlFiles] = (0, import_react144.useState)([]);
|
|
41083
|
+
(0, import_react144.useEffect)(() => {
|
|
40868
41084
|
let cancelled = false;
|
|
40869
41085
|
const checkTomlCommands = /* @__PURE__ */ __name(async () => {
|
|
40870
41086
|
const allFiles = [];
|
|
@@ -40932,15 +41148,23 @@ __name(sendNotification, "sendNotification");
|
|
|
40932
41148
|
|
|
40933
41149
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
40934
41150
|
init_esbuild_shims();
|
|
40935
|
-
var
|
|
41151
|
+
var import_react145 = __toESM(require_react(), 1);
|
|
41152
|
+
var BRANCH_POLL_INTERVAL_MS = 5e3;
|
|
40936
41153
|
function useGitBranchName(cwd3) {
|
|
40937
|
-
const [branchName, setBranchName] = (0,
|
|
40938
|
-
(0,
|
|
41154
|
+
const [branchName, setBranchName] = (0, import_react145.useState)(void 0);
|
|
41155
|
+
const branchNameRef = (0, import_react145.useRef)(branchName);
|
|
41156
|
+
branchNameRef.current = branchName;
|
|
41157
|
+
(0, import_react145.useEffect)(() => {
|
|
40939
41158
|
let cancelled = false;
|
|
40940
41159
|
let dispose;
|
|
41160
|
+
let pollTimer;
|
|
41161
|
+
let refreshGeneration = 0;
|
|
40941
41162
|
const refresh = /* @__PURE__ */ __name(async () => {
|
|
41163
|
+
const generation = ++refreshGeneration;
|
|
40942
41164
|
const name = await resolveBranchName(cwd3);
|
|
40943
|
-
if (!cancelled
|
|
41165
|
+
if (!cancelled && generation === refreshGeneration && name !== branchNameRef.current) {
|
|
41166
|
+
setBranchName(name);
|
|
41167
|
+
}
|
|
40944
41168
|
}, "refresh");
|
|
40945
41169
|
const init = /* @__PURE__ */ __name(async () => {
|
|
40946
41170
|
await refresh();
|
|
@@ -40954,12 +41178,20 @@ function useGitBranchName(cwd3) {
|
|
|
40954
41178
|
} else {
|
|
40955
41179
|
dispose = disposer;
|
|
40956
41180
|
}
|
|
41181
|
+
if (!cancelled) {
|
|
41182
|
+
pollTimer = setInterval(() => {
|
|
41183
|
+
void refresh().catch(() => {
|
|
41184
|
+
});
|
|
41185
|
+
}, BRANCH_POLL_INTERVAL_MS);
|
|
41186
|
+
pollTimer.unref?.();
|
|
41187
|
+
}
|
|
40957
41188
|
}, "init");
|
|
40958
41189
|
void init().catch(() => {
|
|
40959
41190
|
});
|
|
40960
41191
|
return () => {
|
|
40961
41192
|
cancelled = true;
|
|
40962
41193
|
dispose?.();
|
|
41194
|
+
if (pollTimer) clearInterval(pollTimer);
|
|
40963
41195
|
};
|
|
40964
41196
|
}, [cwd3]);
|
|
40965
41197
|
return branchName;
|
|
@@ -40968,13 +41200,13 @@ __name(useGitBranchName, "useGitBranchName");
|
|
|
40968
41200
|
|
|
40969
41201
|
// packages/cli/src/ui/hooks/useWorktreeSession.ts
|
|
40970
41202
|
init_esbuild_shims();
|
|
40971
|
-
var
|
|
41203
|
+
var import_react146 = __toESM(require_react(), 1);
|
|
40972
41204
|
import fs19 from "node:fs";
|
|
40973
41205
|
import fsPromises from "node:fs/promises";
|
|
40974
41206
|
import path14 from "node:path";
|
|
40975
41207
|
function useWorktreeSession(config) {
|
|
40976
|
-
const [session, setSession] = (0,
|
|
40977
|
-
(0,
|
|
41208
|
+
const [session, setSession] = (0, import_react146.useState)(null);
|
|
41209
|
+
(0, import_react146.useEffect)(() => {
|
|
40978
41210
|
let cancelled = false;
|
|
40979
41211
|
const safeLoad = /* @__PURE__ */ __name(async () => {
|
|
40980
41212
|
try {
|
|
@@ -41014,7 +41246,7 @@ __name(useWorktreeSession, "useWorktreeSession");
|
|
|
41014
41246
|
|
|
41015
41247
|
// packages/cli/src/ui/hooks/useExtensionUpdates.ts
|
|
41016
41248
|
init_esbuild_shims();
|
|
41017
|
-
var
|
|
41249
|
+
var import_react147 = __toESM(require_react(), 1);
|
|
41018
41250
|
function confirmationRequestsReducer(state, action) {
|
|
41019
41251
|
switch (action.type) {
|
|
41020
41252
|
case "add":
|
|
@@ -41031,8 +41263,8 @@ var useConfirmUpdateRequests = /* @__PURE__ */ __name(() => {
|
|
|
41031
41263
|
const [
|
|
41032
41264
|
confirmUpdateExtensionRequests,
|
|
41033
41265
|
dispatchConfirmUpdateExtensionRequests
|
|
41034
|
-
] = (0,
|
|
41035
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
41266
|
+
] = (0, import_react147.useReducer)(confirmationRequestsReducer, []);
|
|
41267
|
+
const addConfirmUpdateExtensionRequest = (0, import_react147.useCallback)(
|
|
41036
41268
|
(original) => {
|
|
41037
41269
|
const wrappedRequest = {
|
|
41038
41270
|
prompt: original.prompt,
|
|
@@ -41070,11 +41302,11 @@ function settingInputRequestsReducer(state, action) {
|
|
|
41070
41302
|
}
|
|
41071
41303
|
__name(settingInputRequestsReducer, "settingInputRequestsReducer");
|
|
41072
41304
|
var useSettingInputRequests = /* @__PURE__ */ __name(() => {
|
|
41073
|
-
const [settingInputRequests, dispatchSettingInputRequests] = (0,
|
|
41305
|
+
const [settingInputRequests, dispatchSettingInputRequests] = (0, import_react147.useReducer)(
|
|
41074
41306
|
settingInputRequestsReducer,
|
|
41075
41307
|
[]
|
|
41076
41308
|
);
|
|
41077
|
-
const addSettingInputRequest = (0,
|
|
41309
|
+
const addSettingInputRequest = (0, import_react147.useCallback)(
|
|
41078
41310
|
(original) => {
|
|
41079
41311
|
const wrappedRequest = {
|
|
41080
41312
|
settingName: original.settingName,
|
|
@@ -41121,11 +41353,11 @@ function pluginChoiceRequestsReducer(state, action) {
|
|
|
41121
41353
|
}
|
|
41122
41354
|
__name(pluginChoiceRequestsReducer, "pluginChoiceRequestsReducer");
|
|
41123
41355
|
var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
41124
|
-
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0,
|
|
41356
|
+
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0, import_react147.useReducer)(
|
|
41125
41357
|
pluginChoiceRequestsReducer,
|
|
41126
41358
|
[]
|
|
41127
41359
|
);
|
|
41128
|
-
const addPluginChoiceRequest = (0,
|
|
41360
|
+
const addPluginChoiceRequest = (0, import_react147.useCallback)(
|
|
41129
41361
|
(original) => {
|
|
41130
41362
|
const wrappedRequest = {
|
|
41131
41363
|
marketplaceName: original.marketplaceName,
|
|
@@ -41159,12 +41391,12 @@ var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
|
41159
41391
|
};
|
|
41160
41392
|
}, "usePluginChoiceRequests");
|
|
41161
41393
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd3) => {
|
|
41162
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
41394
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react147.useReducer)(
|
|
41163
41395
|
extensionUpdatesReducer,
|
|
41164
41396
|
initialExtensionUpdatesState
|
|
41165
41397
|
);
|
|
41166
41398
|
const extensions = extensionManager.getLoadedExtensions();
|
|
41167
|
-
(0,
|
|
41399
|
+
(0, import_react147.useEffect)(() => {
|
|
41168
41400
|
(async () => {
|
|
41169
41401
|
const extensionsToCheck = extensions.filter((extension) => {
|
|
41170
41402
|
const currentStatus = extensionsUpdateState.extensionStatuses.get(
|
|
@@ -41192,7 +41424,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
41192
41424
|
extensionsUpdateState.extensionStatuses,
|
|
41193
41425
|
dispatchExtensionStateUpdate
|
|
41194
41426
|
]);
|
|
41195
|
-
(0,
|
|
41427
|
+
(0, import_react147.useEffect)(() => {
|
|
41196
41428
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
41197
41429
|
return;
|
|
41198
41430
|
}
|
|
@@ -41261,7 +41493,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
41261
41493
|
);
|
|
41262
41494
|
}
|
|
41263
41495
|
}, [extensions, extensionManager, extensionsUpdateState, addItem, cwd3]);
|
|
41264
|
-
const extensionsUpdateStateComputed = (0,
|
|
41496
|
+
const extensionsUpdateStateComputed = (0, import_react147.useMemo)(() => {
|
|
41265
41497
|
const result = /* @__PURE__ */ new Map();
|
|
41266
41498
|
for (const [
|
|
41267
41499
|
key,
|
|
@@ -41280,11 +41512,11 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
41280
41512
|
|
|
41281
41513
|
// packages/cli/src/ui/components/TranscriptView.tsx
|
|
41282
41514
|
init_esbuild_shims();
|
|
41283
|
-
var
|
|
41515
|
+
var import_react150 = __toESM(require_react(), 1);
|
|
41284
41516
|
|
|
41285
41517
|
// packages/cli/src/ui/components/AlternateScreen.tsx
|
|
41286
41518
|
init_esbuild_shims();
|
|
41287
|
-
var
|
|
41519
|
+
var import_react148 = __toESM(require_react(), 1);
|
|
41288
41520
|
var import_jsx_runtime132 = __toESM(require_jsx_runtime(), 1);
|
|
41289
41521
|
var ENTER_ALT_SCREEN = "\x1B[?1049h";
|
|
41290
41522
|
var EXIT_ALT_SCREEN = "\x1B[?1049l";
|
|
@@ -41297,7 +41529,7 @@ var AlternateScreen = /* @__PURE__ */ __name(({
|
|
|
41297
41529
|
}) => {
|
|
41298
41530
|
const writeRaw = useTerminalOutput();
|
|
41299
41531
|
const { rows } = useTerminalSize();
|
|
41300
|
-
(0,
|
|
41532
|
+
(0, import_react148.useEffect)(() => {
|
|
41301
41533
|
if (disabled || !process.stdout.isTTY) return;
|
|
41302
41534
|
const safeWrite = /* @__PURE__ */ __name((data) => {
|
|
41303
41535
|
try {
|
|
@@ -41318,7 +41550,7 @@ var AlternateScreen = /* @__PURE__ */ __name(({
|
|
|
41318
41550
|
|
|
41319
41551
|
// packages/cli/src/ui/components/shared/ErrorBoundary.tsx
|
|
41320
41552
|
init_esbuild_shims();
|
|
41321
|
-
var
|
|
41553
|
+
var import_react149 = __toESM(require_react(), 1);
|
|
41322
41554
|
var import_jsx_runtime133 = __toESM(require_jsx_runtime(), 1);
|
|
41323
41555
|
function normalizeError(error) {
|
|
41324
41556
|
if (error instanceof Error) {
|
|
@@ -41327,7 +41559,7 @@ function normalizeError(error) {
|
|
|
41327
41559
|
return new Error(String(error));
|
|
41328
41560
|
}
|
|
41329
41561
|
__name(normalizeError, "normalizeError");
|
|
41330
|
-
var ErrorBoundary = class extends
|
|
41562
|
+
var ErrorBoundary = class extends import_react149.Component {
|
|
41331
41563
|
static {
|
|
41332
41564
|
__name(this, "ErrorBoundary");
|
|
41333
41565
|
}
|
|
@@ -41386,11 +41618,11 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
41386
41618
|
const headerHeight = 1;
|
|
41387
41619
|
const footerHeight = 1;
|
|
41388
41620
|
const contentHeight = Math.max(rows - headerHeight - footerHeight, 1);
|
|
41389
|
-
const estimatedItemHeight = (0,
|
|
41621
|
+
const estimatedItemHeight = (0, import_react150.useCallback)(
|
|
41390
41622
|
(index) => estimateTranscriptItemHeight(items[index]),
|
|
41391
41623
|
[items]
|
|
41392
41624
|
);
|
|
41393
|
-
const renderItem = (0,
|
|
41625
|
+
const renderItem = (0, import_react150.useCallback)(
|
|
41394
41626
|
({ item }) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
41395
41627
|
HistoryItemDisplay,
|
|
41396
41628
|
{
|
|
@@ -41403,7 +41635,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
41403
41635
|
[columns]
|
|
41404
41636
|
);
|
|
41405
41637
|
const title = t("Transcript");
|
|
41406
|
-
const content = (0,
|
|
41638
|
+
const content = (0, import_react150.useMemo)(
|
|
41407
41639
|
() => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(OverflowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
41408
41640
|
ScrollableListWithForwardRef,
|
|
41409
41641
|
{
|
|
@@ -41418,7 +41650,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
41418
41650
|
) }),
|
|
41419
41651
|
[items, renderItem, estimatedItemHeight, contentHeight]
|
|
41420
41652
|
);
|
|
41421
|
-
const errorFallback = (0,
|
|
41653
|
+
const errorFallback = (0, import_react150.useCallback)(
|
|
41422
41654
|
(error) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [
|
|
41423
41655
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text, { color: theme.status.error, bold: true, children: t("Failed to render transcript.") }),
|
|
41424
41656
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text, { color: theme.text.secondary, children: sanitizeTerminalText(error.message) }),
|
|
@@ -41429,7 +41661,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
41429
41661
|
] }),
|
|
41430
41662
|
[]
|
|
41431
41663
|
);
|
|
41432
|
-
const onRenderError = (0,
|
|
41664
|
+
const onRenderError = (0, import_react150.useCallback)((error, info) => {
|
|
41433
41665
|
debugLogger39.error(
|
|
41434
41666
|
`render error: ${error.message}`,
|
|
41435
41667
|
info.componentStack ?? ""
|
|
@@ -41453,19 +41685,19 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
41453
41685
|
] }) })
|
|
41454
41686
|
] }) });
|
|
41455
41687
|
}, "TranscriptViewImpl");
|
|
41456
|
-
var TranscriptView = (0,
|
|
41688
|
+
var TranscriptView = (0, import_react150.memo)(TranscriptViewImpl);
|
|
41457
41689
|
TranscriptView.displayName = "TranscriptView";
|
|
41458
41690
|
|
|
41459
41691
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
41460
41692
|
init_esbuild_shims();
|
|
41461
|
-
var
|
|
41693
|
+
var import_react151 = __toESM(require_react(), 1);
|
|
41462
41694
|
function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
41463
|
-
const [welcomeBackInfo, setWelcomeBackInfo] = (0,
|
|
41464
|
-
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0,
|
|
41465
|
-
const [welcomeBackChoice, setWelcomeBackChoice] = (0,
|
|
41466
|
-
const [shouldFillInput, setShouldFillInput] = (0,
|
|
41467
|
-
const [inputFillText, setInputFillText] = (0,
|
|
41468
|
-
const checkWelcomeBack = (0,
|
|
41695
|
+
const [welcomeBackInfo, setWelcomeBackInfo] = (0, import_react151.useState)(null);
|
|
41696
|
+
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0, import_react151.useState)(false);
|
|
41697
|
+
const [welcomeBackChoice, setWelcomeBackChoice] = (0, import_react151.useState)(null);
|
|
41698
|
+
const [shouldFillInput, setShouldFillInput] = (0, import_react151.useState)(false);
|
|
41699
|
+
const [inputFillText, setInputFillText] = (0, import_react151.useState)(null);
|
|
41700
|
+
const checkWelcomeBack = (0, import_react151.useCallback)(async () => {
|
|
41469
41701
|
if (settings.ui?.enableWelcomeBack === false) {
|
|
41470
41702
|
return;
|
|
41471
41703
|
}
|
|
@@ -41484,7 +41716,7 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
41484
41716
|
config.getDebugLogger().debug("Welcome back check failed:", error);
|
|
41485
41717
|
}
|
|
41486
41718
|
}, [config, settings.ui?.enableWelcomeBack]);
|
|
41487
|
-
const handleWelcomeBackSelection = (0,
|
|
41719
|
+
const handleWelcomeBackSelection = (0, import_react151.useCallback)(
|
|
41488
41720
|
(choice) => {
|
|
41489
41721
|
setWelcomeBackChoice(choice);
|
|
41490
41722
|
setShowWelcomeBackDialog(false);
|
|
@@ -41508,21 +41740,21 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
41508
41740
|
},
|
|
41509
41741
|
[config, welcomeBackInfo]
|
|
41510
41742
|
);
|
|
41511
|
-
const handleWelcomeBackClose = (0,
|
|
41743
|
+
const handleWelcomeBackClose = (0, import_react151.useCallback)(() => {
|
|
41512
41744
|
setWelcomeBackChoice("restart");
|
|
41513
41745
|
setShowWelcomeBackDialog(false);
|
|
41514
41746
|
}, []);
|
|
41515
|
-
const clearInputFill = (0,
|
|
41747
|
+
const clearInputFill = (0, import_react151.useCallback)(() => {
|
|
41516
41748
|
setShouldFillInput(false);
|
|
41517
41749
|
setInputFillText(null);
|
|
41518
41750
|
}, []);
|
|
41519
|
-
(0,
|
|
41751
|
+
(0, import_react151.useEffect)(() => {
|
|
41520
41752
|
if (shouldFillInput && inputFillText) {
|
|
41521
41753
|
buffer.setText(inputFillText);
|
|
41522
41754
|
clearInputFill();
|
|
41523
41755
|
}
|
|
41524
41756
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
41525
|
-
(0,
|
|
41757
|
+
(0, import_react151.useEffect)(() => {
|
|
41526
41758
|
checkWelcomeBack();
|
|
41527
41759
|
}, [checkWelcomeBack]);
|
|
41528
41760
|
return {
|
|
@@ -41543,9 +41775,9 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
41543
41775
|
|
|
41544
41776
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
41545
41777
|
init_esbuild_shims();
|
|
41546
|
-
var
|
|
41778
|
+
var import_react152 = __toESM(require_react(), 1);
|
|
41547
41779
|
function useDialogClose(options) {
|
|
41548
|
-
const closeAnyOpenDialog = (0,
|
|
41780
|
+
const closeAnyOpenDialog = (0, import_react152.useCallback)(() => {
|
|
41549
41781
|
if (options.isThemeDialogOpen) {
|
|
41550
41782
|
options.handleThemeSelect(void 0, "User" /* User */);
|
|
41551
41783
|
return true;
|
|
@@ -41617,14 +41849,14 @@ __name(useDialogClose, "useDialogClose");
|
|
|
41617
41849
|
|
|
41618
41850
|
// packages/cli/src/ui/hooks/useInitializationAuthError.ts
|
|
41619
41851
|
init_esbuild_shims();
|
|
41620
|
-
var
|
|
41852
|
+
var import_react153 = __toESM(require_react(), 1);
|
|
41621
41853
|
var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError) => {
|
|
41622
|
-
const hasHandled = (0,
|
|
41623
|
-
const authErrorRef = (0,
|
|
41624
|
-
const onAuthErrorRef = (0,
|
|
41854
|
+
const hasHandled = (0, import_react153.useRef)(false);
|
|
41855
|
+
const authErrorRef = (0, import_react153.useRef)(authError);
|
|
41856
|
+
const onAuthErrorRef = (0, import_react153.useRef)(onAuthError);
|
|
41625
41857
|
authErrorRef.current = authError;
|
|
41626
41858
|
onAuthErrorRef.current = onAuthError;
|
|
41627
|
-
(0,
|
|
41859
|
+
(0, import_react153.useEffect)(() => {
|
|
41628
41860
|
if (hasHandled.current) {
|
|
41629
41861
|
return;
|
|
41630
41862
|
}
|
|
@@ -41637,13 +41869,13 @@ var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError)
|
|
|
41637
41869
|
|
|
41638
41870
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
41639
41871
|
init_esbuild_shims();
|
|
41640
|
-
var
|
|
41872
|
+
var import_react154 = __toESM(require_react(), 1);
|
|
41641
41873
|
function useSubagentCreateDialog() {
|
|
41642
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
41643
|
-
const openSubagentCreateDialog = (0,
|
|
41874
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react154.useState)(false);
|
|
41875
|
+
const openSubagentCreateDialog = (0, import_react154.useCallback)(() => {
|
|
41644
41876
|
setIsSubagentCreateDialogOpen(true);
|
|
41645
41877
|
}, []);
|
|
41646
|
-
const closeSubagentCreateDialog = (0,
|
|
41878
|
+
const closeSubagentCreateDialog = (0, import_react154.useCallback)(() => {
|
|
41647
41879
|
setIsSubagentCreateDialogOpen(false);
|
|
41648
41880
|
}, []);
|
|
41649
41881
|
return {
|
|
@@ -41656,13 +41888,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
41656
41888
|
|
|
41657
41889
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
41658
41890
|
init_esbuild_shims();
|
|
41659
|
-
var
|
|
41891
|
+
var import_react155 = __toESM(require_react(), 1);
|
|
41660
41892
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41661
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
41662
|
-
const openAgentsManagerDialog = (0,
|
|
41893
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react155.useState)(false);
|
|
41894
|
+
const openAgentsManagerDialog = (0, import_react155.useCallback)(() => {
|
|
41663
41895
|
setIsAgentsManagerDialogOpen(true);
|
|
41664
41896
|
}, []);
|
|
41665
|
-
const closeAgentsManagerDialog = (0,
|
|
41897
|
+
const closeAgentsManagerDialog = (0, import_react155.useCallback)(() => {
|
|
41666
41898
|
setIsAgentsManagerDialogOpen(false);
|
|
41667
41899
|
}, []);
|
|
41668
41900
|
return {
|
|
@@ -41674,13 +41906,13 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41674
41906
|
|
|
41675
41907
|
// packages/cli/src/ui/hooks/useSkillsManagerDialog.ts
|
|
41676
41908
|
init_esbuild_shims();
|
|
41677
|
-
var
|
|
41909
|
+
var import_react156 = __toESM(require_react(), 1);
|
|
41678
41910
|
var useSkillsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41679
|
-
const [isSkillsManagerDialogOpen, setIsSkillsManagerDialogOpen] = (0,
|
|
41680
|
-
const openSkillsManagerDialog = (0,
|
|
41911
|
+
const [isSkillsManagerDialogOpen, setIsSkillsManagerDialogOpen] = (0, import_react156.useState)(false);
|
|
41912
|
+
const openSkillsManagerDialog = (0, import_react156.useCallback)(() => {
|
|
41681
41913
|
setIsSkillsManagerDialogOpen(true);
|
|
41682
41914
|
}, []);
|
|
41683
|
-
const closeSkillsManagerDialog = (0,
|
|
41915
|
+
const closeSkillsManagerDialog = (0, import_react156.useCallback)(() => {
|
|
41684
41916
|
setIsSkillsManagerDialogOpen(false);
|
|
41685
41917
|
}, []);
|
|
41686
41918
|
return {
|
|
@@ -41692,13 +41924,13 @@ var useSkillsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41692
41924
|
|
|
41693
41925
|
// packages/cli/src/ui/hooks/useExtensionsManagerDialog.ts
|
|
41694
41926
|
init_esbuild_shims();
|
|
41695
|
-
var
|
|
41927
|
+
var import_react157 = __toESM(require_react(), 1);
|
|
41696
41928
|
var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41697
|
-
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0,
|
|
41698
|
-
const openExtensionsManagerDialog = (0,
|
|
41929
|
+
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0, import_react157.useState)(false);
|
|
41930
|
+
const openExtensionsManagerDialog = (0, import_react157.useCallback)(() => {
|
|
41699
41931
|
setIsExtensionsManagerDialogOpen(true);
|
|
41700
41932
|
}, []);
|
|
41701
|
-
const closeExtensionsManagerDialog = (0,
|
|
41933
|
+
const closeExtensionsManagerDialog = (0, import_react157.useCallback)(() => {
|
|
41702
41934
|
setIsExtensionsManagerDialogOpen(false);
|
|
41703
41935
|
}, []);
|
|
41704
41936
|
return {
|
|
@@ -41710,13 +41942,13 @@ var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41710
41942
|
|
|
41711
41943
|
// packages/cli/src/ui/hooks/useMcpDialog.ts
|
|
41712
41944
|
init_esbuild_shims();
|
|
41713
|
-
var
|
|
41945
|
+
var import_react158 = __toESM(require_react(), 1);
|
|
41714
41946
|
var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
41715
|
-
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0,
|
|
41716
|
-
const openMcpDialog = (0,
|
|
41947
|
+
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0, import_react158.useState)(false);
|
|
41948
|
+
const openMcpDialog = (0, import_react158.useCallback)(() => {
|
|
41717
41949
|
setIsMcpDialogOpen(true);
|
|
41718
41950
|
}, []);
|
|
41719
|
-
const closeMcpDialog = (0,
|
|
41951
|
+
const closeMcpDialog = (0, import_react158.useCallback)(() => {
|
|
41720
41952
|
setIsMcpDialogOpen(false);
|
|
41721
41953
|
}, []);
|
|
41722
41954
|
return {
|
|
@@ -41728,13 +41960,13 @@ var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
|
41728
41960
|
|
|
41729
41961
|
// packages/cli/src/ui/hooks/useHooksDialog.ts
|
|
41730
41962
|
init_esbuild_shims();
|
|
41731
|
-
var
|
|
41963
|
+
var import_react159 = __toESM(require_react(), 1);
|
|
41732
41964
|
var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
41733
|
-
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0,
|
|
41734
|
-
const openHooksDialog = (0,
|
|
41965
|
+
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0, import_react159.useState)(false);
|
|
41966
|
+
const openHooksDialog = (0, import_react159.useCallback)(() => {
|
|
41735
41967
|
setIsHooksDialogOpen(true);
|
|
41736
41968
|
}, []);
|
|
41737
|
-
const closeHooksDialog = (0,
|
|
41969
|
+
const closeHooksDialog = (0, import_react159.useCallback)(() => {
|
|
41738
41970
|
setIsHooksDialogOpen(false);
|
|
41739
41971
|
}, []);
|
|
41740
41972
|
return {
|
|
@@ -41746,23 +41978,23 @@ var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
|
41746
41978
|
|
|
41747
41979
|
// packages/cli/src/ui/hooks/useStatsDialog.ts
|
|
41748
41980
|
init_esbuild_shims();
|
|
41749
|
-
var
|
|
41981
|
+
var import_react160 = __toESM(require_react(), 1);
|
|
41750
41982
|
var useStatsDialog = /* @__PURE__ */ __name(() => {
|
|
41751
|
-
const [isStatsDialogOpen, setIsStatsDialogOpen] = (0,
|
|
41752
|
-
const openStatsDialog = (0,
|
|
41753
|
-
const closeStatsDialog = (0,
|
|
41983
|
+
const [isStatsDialogOpen, setIsStatsDialogOpen] = (0, import_react160.useState)(false);
|
|
41984
|
+
const openStatsDialog = (0, import_react160.useCallback)(() => setIsStatsDialogOpen(true), []);
|
|
41985
|
+
const closeStatsDialog = (0, import_react160.useCallback)(() => setIsStatsDialogOpen(false), []);
|
|
41754
41986
|
return { isStatsDialogOpen, openStatsDialog, closeStatsDialog };
|
|
41755
41987
|
}, "useStatsDialog");
|
|
41756
41988
|
|
|
41757
41989
|
// packages/cli/src/ui/hooks/useMemoryDialog.ts
|
|
41758
41990
|
init_esbuild_shims();
|
|
41759
|
-
var
|
|
41991
|
+
var import_react161 = __toESM(require_react(), 1);
|
|
41760
41992
|
var useMemoryDialog = /* @__PURE__ */ __name(() => {
|
|
41761
|
-
const [isMemoryDialogOpen, setIsMemoryDialogOpen] = (0,
|
|
41762
|
-
const openMemoryDialog = (0,
|
|
41993
|
+
const [isMemoryDialogOpen, setIsMemoryDialogOpen] = (0, import_react161.useState)(false);
|
|
41994
|
+
const openMemoryDialog = (0, import_react161.useCallback)(() => {
|
|
41763
41995
|
setIsMemoryDialogOpen(true);
|
|
41764
41996
|
}, []);
|
|
41765
|
-
const closeMemoryDialog = (0,
|
|
41997
|
+
const closeMemoryDialog = (0, import_react161.useCallback)(() => {
|
|
41766
41998
|
setIsMemoryDialogOpen(false);
|
|
41767
41999
|
}, []);
|
|
41768
42000
|
return {
|
|
@@ -41774,7 +42006,7 @@ var useMemoryDialog = /* @__PURE__ */ __name(() => {
|
|
|
41774
42006
|
|
|
41775
42007
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
41776
42008
|
init_esbuild_shims();
|
|
41777
|
-
var
|
|
42009
|
+
var import_react162 = __toESM(require_react(), 1);
|
|
41778
42010
|
var LONG_TASK_NOTIFICATION_THRESHOLD_SECONDS = 20;
|
|
41779
42011
|
var NOTIFICATION_TITLE = "Qwen Code";
|
|
41780
42012
|
var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
@@ -41789,16 +42021,16 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
41789
42021
|
const terminalBellEnabled = settings?.merged?.general?.terminalBell ?? true;
|
|
41790
42022
|
const notificationMode = settings?.merged?.general?.notificationMode === "task-complete" ? "task-complete" : "all";
|
|
41791
42023
|
const approvalNotificationsEnabled = notificationMode === "all";
|
|
41792
|
-
const awaitingNotificationSentRef = (0,
|
|
41793
|
-
const respondingElapsedRef = (0,
|
|
41794
|
-
const idleNotificationSentRef = (0,
|
|
41795
|
-
const awaitingToolName = (0,
|
|
42024
|
+
const awaitingNotificationSentRef = (0, import_react162.useRef)(false);
|
|
42025
|
+
const respondingElapsedRef = (0, import_react162.useRef)(0);
|
|
42026
|
+
const idleNotificationSentRef = (0, import_react162.useRef)(false);
|
|
42027
|
+
const awaitingToolName = (0, import_react162.useMemo)(() => {
|
|
41796
42028
|
const awaitingTool = pendingToolCalls?.find(
|
|
41797
42029
|
(tc) => tc.status === "awaiting_approval"
|
|
41798
42030
|
);
|
|
41799
42031
|
return awaitingTool?.request.name;
|
|
41800
42032
|
}, [pendingToolCalls]);
|
|
41801
|
-
(0,
|
|
42033
|
+
(0, import_react162.useEffect)(() => {
|
|
41802
42034
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current && terminalBellEnabled && approvalNotificationsEnabled) {
|
|
41803
42035
|
const message = awaitingToolName ? `Qwen Code needs your permission to use ${awaitingToolName}` : "Qwen Code is waiting for your input";
|
|
41804
42036
|
sendNotification(
|
|
@@ -41819,7 +42051,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
41819
42051
|
terminal,
|
|
41820
42052
|
awaitingToolName
|
|
41821
42053
|
]);
|
|
41822
|
-
(0,
|
|
42054
|
+
(0, import_react162.useEffect)(() => {
|
|
41823
42055
|
if (streamingState === "responding" /* Responding */) {
|
|
41824
42056
|
respondingElapsedRef.current = elapsedTime;
|
|
41825
42057
|
idleNotificationSentRef.current = false;
|
|
@@ -41972,7 +42204,7 @@ __name(buildTerminalNotification, "buildTerminalNotification");
|
|
|
41972
42204
|
|
|
41973
42205
|
// packages/cli/src/ui/hooks/useContextualTips.ts
|
|
41974
42206
|
init_esbuild_shims();
|
|
41975
|
-
var
|
|
42207
|
+
var import_react163 = __toESM(require_react(), 1);
|
|
41976
42208
|
function useContextualTips({
|
|
41977
42209
|
streamingState,
|
|
41978
42210
|
lastPromptTokenCount,
|
|
@@ -41982,9 +42214,9 @@ function useContextualTips({
|
|
|
41982
42214
|
addItem,
|
|
41983
42215
|
hideTips
|
|
41984
42216
|
}) {
|
|
41985
|
-
const prevStreamingState = (0,
|
|
41986
|
-
const hadResponsePhase = (0,
|
|
41987
|
-
(0,
|
|
42217
|
+
const prevStreamingState = (0, import_react163.useRef)("idle" /* Idle */);
|
|
42218
|
+
const hadResponsePhase = (0, import_react163.useRef)(false);
|
|
42219
|
+
(0, import_react163.useEffect)(() => {
|
|
41988
42220
|
if (streamingState === "responding" /* Responding */ || prevStreamingState.current === "responding" /* Responding */ && streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */) {
|
|
41989
42221
|
hadResponsePhase.current = true;
|
|
41990
42222
|
}
|
|
@@ -42120,7 +42352,7 @@ function getResponseCandidateTokens(pendingGeminiHistoryItems) {
|
|
|
42120
42352
|
__name(getResponseCandidateTokens, "getResponseCandidateTokens");
|
|
42121
42353
|
function useStableStickyTodos(todos) {
|
|
42122
42354
|
const renderKey = getStickyTodosRenderKey(todos);
|
|
42123
|
-
const stableTodosRef = (0,
|
|
42355
|
+
const stableTodosRef = (0, import_react164.useRef)(null);
|
|
42124
42356
|
if (stableTodosRef.current?.renderKey !== renderKey) {
|
|
42125
42357
|
stableTodosRef.current = { renderKey, todos };
|
|
42126
42358
|
}
|
|
@@ -42150,30 +42382,30 @@ __name(shouldAutoOpenSkillReview, "shouldAutoOpenSkillReview");
|
|
|
42150
42382
|
var SHELL_WIDTH_FRACTION = 0.89;
|
|
42151
42383
|
var SHELL_HEIGHT_PADDING = 10;
|
|
42152
42384
|
var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
42153
|
-
const { settings, config, initializationResult } = props;
|
|
42154
|
-
const extensionRefreshState = (0,
|
|
42385
|
+
const { settings, config, initializationResult, initialUseVirtualViewport } = props;
|
|
42386
|
+
const extensionRefreshState = (0, import_react164.useMemo)(
|
|
42155
42387
|
() => props.extensionRefreshState ?? new ExtensionRefreshState(),
|
|
42156
42388
|
[props.extensionRefreshState]
|
|
42157
42389
|
);
|
|
42158
42390
|
const historyManager = useHistory();
|
|
42159
|
-
const historyRef = (0,
|
|
42391
|
+
const historyRef = (0, import_react164.useRef)(historyManager.history);
|
|
42160
42392
|
historyRef.current = historyManager.history;
|
|
42161
42393
|
useMemoryMonitor(historyManager);
|
|
42162
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
42163
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
42164
|
-
const [themeError, setThemeError] = (0,
|
|
42394
|
+
const [debugMessage, setDebugMessage] = (0, import_react164.useState)("");
|
|
42395
|
+
const [quittingMessages, setQuittingMessages] = (0, import_react164.useState)(null);
|
|
42396
|
+
const [themeError, setThemeError] = (0, import_react164.useState)(
|
|
42165
42397
|
initializationResult.themeError
|
|
42166
42398
|
);
|
|
42167
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
42168
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
42169
|
-
const [geminiMdFileCount, setGeminiMdFileCount] = (0,
|
|
42399
|
+
const [isProcessing, setIsProcessing] = (0, import_react164.useState)(false);
|
|
42400
|
+
const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react164.useState)(false);
|
|
42401
|
+
const [geminiMdFileCount, setGeminiMdFileCount] = (0, import_react164.useState)(
|
|
42170
42402
|
initializationResult.geminiMdFileCount
|
|
42171
42403
|
);
|
|
42172
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
42173
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
42174
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
42175
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
42176
|
-
const [isTrustedFolder, setIsTrustedFolder] = (0,
|
|
42404
|
+
const [shellModeActive, setShellModeActive] = (0, import_react164.useState)(false);
|
|
42405
|
+
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react164.useState)(false);
|
|
42406
|
+
const [historyRemountKey, setHistoryRemountKey] = (0, import_react164.useState)(0);
|
|
42407
|
+
const [updateInfo, setUpdateInfo] = (0, import_react164.useState)(null);
|
|
42408
|
+
const [isTrustedFolder, setIsTrustedFolder] = (0, import_react164.useState)(
|
|
42177
42409
|
config.isTrustedFolder()
|
|
42178
42410
|
);
|
|
42179
42411
|
const extensionManager = config.getExtensionManager();
|
|
@@ -42232,31 +42464,31 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42232
42464
|
config,
|
|
42233
42465
|
historyManager.addItem
|
|
42234
42466
|
);
|
|
42235
|
-
const [isTrustDialogOpen, setTrustDialogOpen] = (0,
|
|
42236
|
-
const openTrustDialog = (0,
|
|
42237
|
-
const closeTrustDialog = (0,
|
|
42238
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
42239
|
-
const openPermissionsDialog = (0,
|
|
42467
|
+
const [isTrustDialogOpen, setTrustDialogOpen] = (0, import_react164.useState)(false);
|
|
42468
|
+
const openTrustDialog = (0, import_react164.useCallback)(() => setTrustDialogOpen(true), []);
|
|
42469
|
+
const closeTrustDialog = (0, import_react164.useCallback)(() => setTrustDialogOpen(false), []);
|
|
42470
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react164.useState)(false);
|
|
42471
|
+
const openPermissionsDialog = (0, import_react164.useCallback)(
|
|
42240
42472
|
() => setPermissionsDialogOpen(true),
|
|
42241
42473
|
[]
|
|
42242
42474
|
);
|
|
42243
|
-
const closePermissionsDialog = (0,
|
|
42475
|
+
const closePermissionsDialog = (0, import_react164.useCallback)(
|
|
42244
42476
|
() => setPermissionsDialogOpen(false),
|
|
42245
42477
|
[]
|
|
42246
42478
|
);
|
|
42247
|
-
const [currentModel, setCurrentModel] = (0,
|
|
42248
|
-
const [isConfigInitialized, setConfigInitialized] = (0,
|
|
42249
|
-
const [userMessages, setUserMessages] = (0,
|
|
42250
|
-
const [transcriptFreeze, setTranscriptFreeze] = (0,
|
|
42479
|
+
const [currentModel, setCurrentModel] = (0, import_react164.useState)(() => config.getModel());
|
|
42480
|
+
const [isConfigInitialized, setConfigInitialized] = (0, import_react164.useState)(false);
|
|
42481
|
+
const [userMessages, setUserMessages] = (0, import_react164.useState)([]);
|
|
42482
|
+
const [transcriptFreeze, setTranscriptFreeze] = (0, import_react164.useState)(null);
|
|
42251
42483
|
const isTranscriptOpen = transcriptFreeze != null;
|
|
42252
|
-
const isTranscriptOpenRef = (0,
|
|
42484
|
+
const isTranscriptOpenRef = (0, import_react164.useRef)(isTranscriptOpen);
|
|
42253
42485
|
isTranscriptOpenRef.current = isTranscriptOpen;
|
|
42254
|
-
const closeTranscript = (0,
|
|
42486
|
+
const closeTranscript = (0, import_react164.useCallback)(() => {
|
|
42255
42487
|
setTranscriptFreeze(null);
|
|
42256
42488
|
}, []);
|
|
42257
|
-
const [thoughtExpanded, setThoughtExpanded] = (0,
|
|
42258
|
-
const [expandedThoughtHeadIds, setExpandedThoughtHeadIds] = (0,
|
|
42259
|
-
const toggleThoughtExpanded = (0,
|
|
42489
|
+
const [thoughtExpanded, setThoughtExpanded] = (0, import_react164.useState)(false);
|
|
42490
|
+
const [expandedThoughtHeadIds, setExpandedThoughtHeadIds] = (0, import_react164.useState)(() => /* @__PURE__ */ new Set());
|
|
42491
|
+
const toggleThoughtExpanded = (0, import_react164.useCallback)((headId) => {
|
|
42260
42492
|
setExpandedThoughtHeadIds((prev) => {
|
|
42261
42493
|
const next = new Set(prev);
|
|
42262
42494
|
if (next.has(headId)) {
|
|
@@ -42270,10 +42502,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42270
42502
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
42271
42503
|
const { stdin, setRawMode } = use_stdin_default();
|
|
42272
42504
|
const { stdout } = use_stdout_default();
|
|
42273
|
-
const writeRaw = (0,
|
|
42274
|
-
|
|
42505
|
+
const writeRaw = (0, import_react164.useCallback)((data) => {
|
|
42506
|
+
process17.stdout.write(data);
|
|
42275
42507
|
}, []);
|
|
42276
|
-
const terminal = (0,
|
|
42508
|
+
const terminal = (0, import_react164.useMemo)(
|
|
42277
42509
|
() => buildTerminalNotification(writeRaw),
|
|
42278
42510
|
[writeRaw]
|
|
42279
42511
|
);
|
|
@@ -42287,10 +42519,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42287
42519
|
const branchName = useGitBranchName(
|
|
42288
42520
|
worktreeSession?.worktreePath ?? config.getTargetDir()
|
|
42289
42521
|
);
|
|
42290
|
-
const [showWorktreeExitDialog, setShowWorktreeExitDialog] = (0,
|
|
42291
|
-
const [workflowKeywordActive, setWorkflowKeywordActive] = (0,
|
|
42292
|
-
const pendingWorktreeNoticeRef = (0,
|
|
42293
|
-
const activeWorktree = (0,
|
|
42522
|
+
const [showWorktreeExitDialog, setShowWorktreeExitDialog] = (0, import_react164.useState)(false);
|
|
42523
|
+
const [workflowKeywordActive, setWorkflowKeywordActive] = (0, import_react164.useState)(false);
|
|
42524
|
+
const pendingWorktreeNoticeRef = (0, import_react164.useRef)(null);
|
|
42525
|
+
const activeWorktree = (0, import_react164.useMemo)(
|
|
42294
42526
|
() => worktreeSession ? {
|
|
42295
42527
|
slug: worktreeSession.slug,
|
|
42296
42528
|
branch: worktreeSession.worktreeBranch,
|
|
@@ -42301,20 +42533,20 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42301
42533
|
} : null,
|
|
42302
42534
|
[worktreeSession]
|
|
42303
42535
|
);
|
|
42304
|
-
const mainControlsRef = (0,
|
|
42305
|
-
const lastTitleRef = (0,
|
|
42306
|
-
const [startupWarnings, setStartupWarnings] = (0,
|
|
42536
|
+
const mainControlsRef = (0, import_react164.useRef)(null);
|
|
42537
|
+
const lastTitleRef = (0, import_react164.useRef)(null);
|
|
42538
|
+
const [startupWarnings, setStartupWarnings] = (0, import_react164.useState)(
|
|
42307
42539
|
() => props.startupWarnings || []
|
|
42308
42540
|
);
|
|
42309
42541
|
const staticExtraHeight = 3;
|
|
42310
|
-
(0,
|
|
42542
|
+
(0, import_react164.useEffect)(() => {
|
|
42311
42543
|
void loadLowlight().catch((err) => {
|
|
42312
42544
|
debugLogger40.warn(
|
|
42313
42545
|
`Failed to load lowlight chunk; code blocks will render as plain text: ${err instanceof Error ? err.message : String(err)}`
|
|
42314
42546
|
);
|
|
42315
42547
|
});
|
|
42316
42548
|
}, []);
|
|
42317
|
-
(0,
|
|
42549
|
+
(0, import_react164.useEffect)(() => {
|
|
42318
42550
|
(async () => {
|
|
42319
42551
|
profileCheckpoint("config_initialize_start");
|
|
42320
42552
|
await config.initialize();
|
|
@@ -42404,7 +42636,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42404
42636
|
await ideClient.disconnect();
|
|
42405
42637
|
});
|
|
42406
42638
|
}, [config]);
|
|
42407
|
-
(0,
|
|
42639
|
+
(0, import_react164.useEffect)(() => {
|
|
42408
42640
|
if (!isConfigInitialized) return void 0;
|
|
42409
42641
|
const geminiClient2 = config.getGeminiClient();
|
|
42410
42642
|
if (!geminiClient2) return void 0;
|
|
@@ -42468,11 +42700,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42468
42700
|
clearTimeout(finalizeCap);
|
|
42469
42701
|
};
|
|
42470
42702
|
}, [isConfigInitialized, config]);
|
|
42471
|
-
const isIdleRef = (0,
|
|
42472
|
-
const availableTerminalHeightRef = (0,
|
|
42473
|
-
const terminalWidthRef = (0,
|
|
42474
|
-
const updateHandlerRef = (0,
|
|
42475
|
-
(0,
|
|
42703
|
+
const isIdleRef = (0, import_react164.useRef)(true);
|
|
42704
|
+
const availableTerminalHeightRef = (0, import_react164.useRef)(0);
|
|
42705
|
+
const terminalWidthRef = (0, import_react164.useRef)(0);
|
|
42706
|
+
const updateHandlerRef = (0, import_react164.useRef)(null);
|
|
42707
|
+
(0, import_react164.useEffect)(() => {
|
|
42476
42708
|
const handler = setUpdateHandler(
|
|
42477
42709
|
historyManager.addItem,
|
|
42478
42710
|
setUpdateInfo,
|
|
@@ -42481,13 +42713,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42481
42713
|
updateHandlerRef.current = handler;
|
|
42482
42714
|
return () => handler?.cleanup();
|
|
42483
42715
|
}, [historyManager.addItem]);
|
|
42484
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
42716
|
+
const { inputWidth, suggestionsWidth } = (0, import_react164.useMemo)(() => {
|
|
42485
42717
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
42486
42718
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
42487
42719
|
}, [terminalWidth]);
|
|
42488
42720
|
const mainAreaWidth = Math.min(terminalWidth - 4, 100);
|
|
42489
42721
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
42490
|
-
const isValidPath = (0,
|
|
42722
|
+
const isValidPath = (0, import_react164.useCallback)((filePath) => {
|
|
42491
42723
|
try {
|
|
42492
42724
|
return fs20.existsSync(filePath) && fs20.statSync(filePath).isFile();
|
|
42493
42725
|
} catch (_e) {
|
|
@@ -42495,6 +42727,27 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42495
42727
|
}
|
|
42496
42728
|
}, []);
|
|
42497
42729
|
const preferredEditor = usePreferredEditor();
|
|
42730
|
+
const restoredSubmissionRef = (0, import_react164.useRef)(null);
|
|
42731
|
+
const submittedPromptProvenanceUnavailableRef = (0, import_react164.useRef)(false);
|
|
42732
|
+
const setBufferTextRef = (0, import_react164.useRef)(null);
|
|
42733
|
+
const invalidateSubmittedPromptProvenance = (0, import_react164.useCallback)(() => {
|
|
42734
|
+
restoredSubmissionRef.current = null;
|
|
42735
|
+
submittedPromptProvenanceUnavailableRef.current = true;
|
|
42736
|
+
}, []);
|
|
42737
|
+
const handleBufferChange = (0, import_react164.useCallback)((text) => {
|
|
42738
|
+
if (text.length === 0) {
|
|
42739
|
+
if (restoredSubmissionRef.current !== null || submittedPromptProvenanceUnavailableRef.current) {
|
|
42740
|
+
setBufferTextRef.current?.("", { clearUndoHistory: true });
|
|
42741
|
+
}
|
|
42742
|
+
restoredSubmissionRef.current = null;
|
|
42743
|
+
submittedPromptProvenanceUnavailableRef.current = false;
|
|
42744
|
+
return;
|
|
42745
|
+
}
|
|
42746
|
+
if (restoredSubmissionRef.current !== null && restoredSubmissionRef.current.modelText !== text) {
|
|
42747
|
+
restoredSubmissionRef.current = null;
|
|
42748
|
+
submittedPromptProvenanceUnavailableRef.current = true;
|
|
42749
|
+
}
|
|
42750
|
+
}, []);
|
|
42498
42751
|
const buffer = useTextBuffer({
|
|
42499
42752
|
initialText: "",
|
|
42500
42753
|
viewport: { height: 10, width: inputWidth },
|
|
@@ -42502,22 +42755,25 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42502
42755
|
setRawMode,
|
|
42503
42756
|
isValidPath,
|
|
42504
42757
|
shellModeActive,
|
|
42505
|
-
preferredEditor
|
|
42758
|
+
preferredEditor,
|
|
42759
|
+
onChange: handleBufferChange
|
|
42506
42760
|
});
|
|
42507
|
-
const
|
|
42761
|
+
const setBufferText = buffer.setText;
|
|
42762
|
+
setBufferTextRef.current = setBufferText;
|
|
42763
|
+
const restoredPromptStashTargetsRef = (0, import_react164.useRef)(/* @__PURE__ */ new Set());
|
|
42508
42764
|
const promptStashTargetDir = config.getTargetDir();
|
|
42509
|
-
(0,
|
|
42765
|
+
(0, import_react164.useEffect)(() => {
|
|
42510
42766
|
if (restoredPromptStashTargetsRef.current.has(promptStashTargetDir)) {
|
|
42511
42767
|
return;
|
|
42512
42768
|
}
|
|
42513
42769
|
restoredPromptStashTargetsRef.current.add(promptStashTargetDir);
|
|
42514
|
-
restorePromptStash(
|
|
42515
|
-
|
|
42516
|
-
|
|
42517
|
-
|
|
42518
|
-
);
|
|
42770
|
+
restorePromptStash(promptStashTargetDir, buffer.text, (text) => {
|
|
42771
|
+
restoredSubmissionRef.current = null;
|
|
42772
|
+
submittedPromptProvenanceUnavailableRef.current = true;
|
|
42773
|
+
buffer.setText(text);
|
|
42774
|
+
});
|
|
42519
42775
|
}, [buffer, promptStashTargetDir]);
|
|
42520
|
-
(0,
|
|
42776
|
+
(0, import_react164.useEffect)(() => {
|
|
42521
42777
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
42522
42778
|
const pastMessagesRaw = await logger?.getPreviousUserMessages() || [];
|
|
42523
42779
|
const currentSessionUserMessages = realUserPromptTexts(
|
|
@@ -42531,12 +42787,18 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42531
42787
|
}, "fetchUserMessages");
|
|
42532
42788
|
fetchUserMessages();
|
|
42533
42789
|
}, [historyManager.history, logger]);
|
|
42534
|
-
const remountStaticHistory = (0,
|
|
42790
|
+
const remountStaticHistory = (0, import_react164.useCallback)(() => {
|
|
42535
42791
|
setHistoryRemountKey((prev) => prev + 1);
|
|
42536
42792
|
}, []);
|
|
42537
|
-
const useTerminalBuffer =
|
|
42793
|
+
const [useTerminalBuffer] = (0, import_react164.useState)(
|
|
42794
|
+
() => initialUseVirtualViewport ?? shouldUseVirtualViewport(
|
|
42795
|
+
settings.merged.ui?.useTerminalBuffer,
|
|
42796
|
+
config.getScreenReader(),
|
|
42797
|
+
isInteractiveTerminal()
|
|
42798
|
+
)
|
|
42799
|
+
);
|
|
42538
42800
|
const showScrollbar = settings.merged.ui?.showScrollbar ?? true;
|
|
42539
|
-
const refreshStatic = (0,
|
|
42801
|
+
const refreshStatic = (0, import_react164.useCallback)(() => {
|
|
42540
42802
|
if (isTranscriptOpenRef.current) {
|
|
42541
42803
|
return;
|
|
42542
42804
|
}
|
|
@@ -42545,15 +42807,15 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42545
42807
|
}
|
|
42546
42808
|
remountStaticHistory();
|
|
42547
42809
|
}, [useTerminalBuffer, remountStaticHistory, stdout]);
|
|
42548
|
-
const prevTranscriptOpenRef = (0,
|
|
42810
|
+
const prevTranscriptOpenRef = (0, import_react164.useRef)(isTranscriptOpen);
|
|
42549
42811
|
const wasOpenPrevRender = prevTranscriptOpenRef.current;
|
|
42550
42812
|
prevTranscriptOpenRef.current = isTranscriptOpen;
|
|
42551
|
-
const transcriptCloseCountRef = (0,
|
|
42813
|
+
const transcriptCloseCountRef = (0, import_react164.useRef)(0);
|
|
42552
42814
|
if (wasOpenPrevRender && !isTranscriptOpen) {
|
|
42553
42815
|
transcriptCloseCountRef.current += 1;
|
|
42554
42816
|
}
|
|
42555
42817
|
const transcriptCloseCount = transcriptCloseCountRef.current;
|
|
42556
|
-
(0,
|
|
42818
|
+
(0, import_react164.useEffect)(() => {
|
|
42557
42819
|
if (transcriptCloseCount === 0 || useTerminalBuffer) {
|
|
42558
42820
|
return void 0;
|
|
42559
42821
|
}
|
|
@@ -42566,8 +42828,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42566
42828
|
}, 0);
|
|
42567
42829
|
return () => clearTimeout(id);
|
|
42568
42830
|
}, [transcriptCloseCount, useTerminalBuffer, stdout, remountStaticHistory]);
|
|
42569
|
-
const lastNotifiedModelRef = (0,
|
|
42570
|
-
(0,
|
|
42831
|
+
const lastNotifiedModelRef = (0, import_react164.useRef)(currentModel);
|
|
42832
|
+
(0, import_react164.useEffect)(() => {
|
|
42571
42833
|
const unsubscribe = config.onModelChange((model) => {
|
|
42572
42834
|
if (lastNotifiedModelRef.current === model) {
|
|
42573
42835
|
return;
|
|
@@ -42605,7 +42867,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42605
42867
|
const { onAuthError, openAuthDialog, closeAuthDialog } = authActions;
|
|
42606
42868
|
const { isAuthDialogOpen, isAuthenticating, pendingAuthType } = authState;
|
|
42607
42869
|
useInitializationAuthError(initializationResult.authError, onAuthError);
|
|
42608
|
-
(0,
|
|
42870
|
+
(0, import_react164.useEffect)(() => {
|
|
42609
42871
|
const currentAuthType = config.getModelsConfig().getCurrentAuthType();
|
|
42610
42872
|
if (settings.merged.security?.auth?.enforcedType && currentAuthType && settings.merged.security?.auth.enforcedType !== currentAuthType) {
|
|
42611
42873
|
onAuthError(
|
|
@@ -42619,7 +42881,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42619
42881
|
);
|
|
42620
42882
|
}
|
|
42621
42883
|
}, [settings.merged.security?.auth?.enforcedType, config, onAuthError]);
|
|
42622
|
-
const [editorError, setEditorError] = (0,
|
|
42884
|
+
const [editorError, setEditorError] = (0, import_react164.useState)(null);
|
|
42623
42885
|
const {
|
|
42624
42886
|
isEditorDialogOpen,
|
|
42625
42887
|
openEditorDialog,
|
|
@@ -42627,18 +42889,18 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42627
42889
|
exitEditorDialog
|
|
42628
42890
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
42629
42891
|
const { isSettingsDialogOpen, openSettingsDialog, closeSettingsDialog } = useSettingsCommand();
|
|
42630
|
-
const [isStatusLineDialogOpen, setStatusLineDialogOpen] = (0,
|
|
42631
|
-
const openStatusLineDialog = (0,
|
|
42892
|
+
const [isStatusLineDialogOpen, setStatusLineDialogOpen] = (0, import_react164.useState)(false);
|
|
42893
|
+
const openStatusLineDialog = (0, import_react164.useCallback)(
|
|
42632
42894
|
() => setStatusLineDialogOpen(true),
|
|
42633
42895
|
[]
|
|
42634
42896
|
);
|
|
42635
|
-
const closeStatusLineDialog = (0,
|
|
42897
|
+
const closeStatusLineDialog = (0, import_react164.useCallback)(
|
|
42636
42898
|
() => setStatusLineDialogOpen(false),
|
|
42637
42899
|
[]
|
|
42638
42900
|
);
|
|
42639
|
-
const [statusLineSettingsVersion, setStatusLineSettingsVersion] = (0,
|
|
42640
|
-
const [statusLineConfigOverride, setStatusLineConfigOverride] = (0,
|
|
42641
|
-
const notifyStatusLineSettingsChanged = (0,
|
|
42901
|
+
const [statusLineSettingsVersion, setStatusLineSettingsVersion] = (0, import_react164.useState)(0);
|
|
42902
|
+
const [statusLineConfigOverride, setStatusLineConfigOverride] = (0, import_react164.useState)(void 0);
|
|
42903
|
+
const notifyStatusLineSettingsChanged = (0, import_react164.useCallback)(
|
|
42642
42904
|
(newConfig) => {
|
|
42643
42905
|
setStatusLineConfigOverride(newConfig);
|
|
42644
42906
|
setStatusLineSettingsVersion((version) => version + 1);
|
|
@@ -42657,8 +42919,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42657
42919
|
closeModelDialog
|
|
42658
42920
|
} = useModelCommand();
|
|
42659
42921
|
const { activeArenaDialog, openArenaDialog, closeArenaDialog } = useArenaCommand();
|
|
42660
|
-
const [sessionName, setSessionName] = (0,
|
|
42661
|
-
(0,
|
|
42922
|
+
const [sessionName, setSessionName] = (0, import_react164.useState)(null);
|
|
42923
|
+
(0, import_react164.useEffect)(() => {
|
|
42662
42924
|
const chatRecordingService = config.getChatRecordingService();
|
|
42663
42925
|
if (!chatRecordingService?.setTitleRecordedCallback) return;
|
|
42664
42926
|
const existingCallback = chatRecordingService.getTitleRecordedCallback();
|
|
@@ -42675,7 +42937,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42675
42937
|
};
|
|
42676
42938
|
}, [config]);
|
|
42677
42939
|
const addHistoryItem = historyManager.addItem;
|
|
42678
|
-
(0,
|
|
42940
|
+
(0, import_react164.useEffect)(() => {
|
|
42679
42941
|
if (typeof config.onChatRecordingFailure !== "function") return;
|
|
42680
42942
|
return config.onChatRecordingFailure(() => {
|
|
42681
42943
|
addHistoryItem(
|
|
@@ -42719,12 +42981,17 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42719
42981
|
config,
|
|
42720
42982
|
addItem: historyManager.addItem
|
|
42721
42983
|
});
|
|
42722
|
-
const [isHelpDialogOpen, setHelpDialogOpen] = (0,
|
|
42723
|
-
const [activeHelpTab, setHelpTab] = (0,
|
|
42724
|
-
const openHelpDialog = (0,
|
|
42725
|
-
const closeHelpDialog = (0,
|
|
42984
|
+
const [isHelpDialogOpen, setHelpDialogOpen] = (0, import_react164.useState)(false);
|
|
42985
|
+
const [activeHelpTab, setHelpTab] = (0, import_react164.useState)("general");
|
|
42986
|
+
const openHelpDialog = (0, import_react164.useCallback)(() => setHelpDialogOpen(true), []);
|
|
42987
|
+
const closeHelpDialog = (0, import_react164.useCallback)(() => setHelpDialogOpen(false), []);
|
|
42726
42988
|
const { vimEnabled, vimMode } = useVimModeState();
|
|
42727
42989
|
const { toggleVimEnabled } = useVimModeActions();
|
|
42990
|
+
(0, import_react164.useLayoutEffect)(() => {
|
|
42991
|
+
if (vimEnabled && buffer.text.length > 0) {
|
|
42992
|
+
invalidateSubmittedPromptProvenance();
|
|
42993
|
+
}
|
|
42994
|
+
}, [buffer.text, invalidateSubmittedPromptProvenance, vimEnabled]);
|
|
42728
42995
|
const {
|
|
42729
42996
|
isSubagentCreateDialogOpen,
|
|
42730
42997
|
openSubagentCreateDialog,
|
|
@@ -42748,31 +43015,31 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42748
43015
|
const { isMcpDialogOpen, openMcpDialog, closeMcpDialog } = useMcpDialog();
|
|
42749
43016
|
const { isHooksDialogOpen, openHooksDialog, closeHooksDialog } = useHooksDialog();
|
|
42750
43017
|
const { isStatsDialogOpen, openStatsDialog, closeStatsDialog } = useStatsDialog();
|
|
42751
|
-
const openRewindSelectorRef = (0,
|
|
43018
|
+
const openRewindSelectorRef = (0, import_react164.useRef)(() => {
|
|
42752
43019
|
});
|
|
42753
|
-
const cancelOngoingRequestRef = (0,
|
|
43020
|
+
const cancelOngoingRequestRef = (0, import_react164.useRef)(() => {
|
|
42754
43021
|
});
|
|
42755
|
-
const [isDiffDialogOpen, setIsDiffDialogOpen] = (0,
|
|
42756
|
-
const openDiffDialog = (0,
|
|
43022
|
+
const [isDiffDialogOpen, setIsDiffDialogOpen] = (0, import_react164.useState)(false);
|
|
43023
|
+
const openDiffDialog = (0, import_react164.useCallback)(() => {
|
|
42757
43024
|
setIsDiffDialogOpen(true);
|
|
42758
43025
|
}, []);
|
|
42759
|
-
const closeDiffDialog = (0,
|
|
43026
|
+
const closeDiffDialog = (0, import_react164.useCallback)(() => {
|
|
42760
43027
|
setIsDiffDialogOpen(false);
|
|
42761
43028
|
}, []);
|
|
42762
|
-
const [isSkillReviewDialogOpen, setIsSkillReviewDialogOpen] = (0,
|
|
42763
|
-
const [skillReviewPending, setSkillReviewPending] = (0,
|
|
42764
|
-
const skillReviewDismissedTaskIdsRef = (0,
|
|
42765
|
-
const dismissSkillReviewDialog = (0,
|
|
43029
|
+
const [isSkillReviewDialogOpen, setIsSkillReviewDialogOpen] = (0, import_react164.useState)(false);
|
|
43030
|
+
const [skillReviewPending, setSkillReviewPending] = (0, import_react164.useState)(null);
|
|
43031
|
+
const skillReviewDismissedTaskIdsRef = (0, import_react164.useRef)(/* @__PURE__ */ new Set());
|
|
43032
|
+
const dismissSkillReviewDialog = (0, import_react164.useCallback)(() => {
|
|
42766
43033
|
if (skillReviewPending) {
|
|
42767
43034
|
skillReviewDismissedTaskIdsRef.current.add(skillReviewPending.taskId);
|
|
42768
43035
|
}
|
|
42769
43036
|
setIsSkillReviewDialogOpen(false);
|
|
42770
43037
|
}, [skillReviewPending]);
|
|
42771
|
-
const closeSkillReviewDialog = (0,
|
|
43038
|
+
const closeSkillReviewDialog = (0, import_react164.useCallback)(
|
|
42772
43039
|
() => setIsSkillReviewDialogOpen(false),
|
|
42773
43040
|
[]
|
|
42774
43041
|
);
|
|
42775
|
-
const acceptPendingSkill = (0,
|
|
43042
|
+
const acceptPendingSkill = (0, import_react164.useCallback)(
|
|
42776
43043
|
(skillName) => {
|
|
42777
43044
|
if (!skillReviewPending) return;
|
|
42778
43045
|
void config.getMemoryManager().acceptPendingSkillFromTask(skillReviewPending.taskId, skillName).catch(() => {
|
|
@@ -42780,7 +43047,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42780
43047
|
},
|
|
42781
43048
|
[config, skillReviewPending]
|
|
42782
43049
|
);
|
|
42783
|
-
const rejectPendingSkill = (0,
|
|
43050
|
+
const rejectPendingSkill = (0, import_react164.useCallback)(
|
|
42784
43051
|
(skillName) => {
|
|
42785
43052
|
if (!skillReviewPending) return;
|
|
42786
43053
|
void config.getMemoryManager().rejectPendingSkillFromTask(skillReviewPending.taskId, skillName).catch(() => {
|
|
@@ -42788,7 +43055,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42788
43055
|
},
|
|
42789
43056
|
[config, skillReviewPending]
|
|
42790
43057
|
);
|
|
42791
|
-
(0,
|
|
43058
|
+
(0, import_react164.useEffect)(() => {
|
|
42792
43059
|
const mgr = config.getMemoryManager();
|
|
42793
43060
|
const projectRoot = config.getProjectRoot();
|
|
42794
43061
|
let lastSig = "";
|
|
@@ -42822,7 +43089,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42822
43089
|
refresh();
|
|
42823
43090
|
return unsub;
|
|
42824
43091
|
}, [config]);
|
|
42825
|
-
const slashCommandActions = (0,
|
|
43092
|
+
const slashCommandActions = (0, import_react164.useMemo)(
|
|
42826
43093
|
() => ({
|
|
42827
43094
|
openAuthDialog,
|
|
42828
43095
|
openThemeDialog,
|
|
@@ -42846,7 +43113,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42846
43113
|
config.getGeminiClient()?.requestShutdown();
|
|
42847
43114
|
setTimeout(async () => {
|
|
42848
43115
|
await runExitCleanup();
|
|
42849
|
-
|
|
43116
|
+
process17.exit(0);
|
|
42850
43117
|
}, 100);
|
|
42851
43118
|
}, "quit"),
|
|
42852
43119
|
setDebugMessage,
|
|
@@ -42932,13 +43199,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42932
43199
|
setSessionName,
|
|
42933
43200
|
extensionRefreshState
|
|
42934
43201
|
);
|
|
42935
|
-
const onDebugMessage = (0,
|
|
43202
|
+
const onDebugMessage = (0, import_react164.useCallback)(
|
|
42936
43203
|
(message) => {
|
|
42937
43204
|
config.getDebugLogger().debug(message);
|
|
42938
43205
|
},
|
|
42939
43206
|
[config]
|
|
42940
43207
|
);
|
|
42941
|
-
const handleWorktreeExit = (0,
|
|
43208
|
+
const handleWorktreeExit = (0, import_react164.useCallback)(
|
|
42942
43209
|
async (choice) => {
|
|
42943
43210
|
if (choice === "cancel") {
|
|
42944
43211
|
setShowWorktreeExitDialog(false);
|
|
@@ -43003,7 +43270,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43003
43270
|
},
|
|
43004
43271
|
[activeWorktree, config, handleSlashCommand, historyManager]
|
|
43005
43272
|
);
|
|
43006
|
-
const performMemoryRefresh = (0,
|
|
43273
|
+
const performMemoryRefresh = (0, import_react164.useCallback)(async () => {
|
|
43007
43274
|
if (config.isSafeMode()) {
|
|
43008
43275
|
config.setUserMemory("");
|
|
43009
43276
|
config.setGeminiMdFileCount(0);
|
|
@@ -43029,7 +43296,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43029
43296
|
);
|
|
43030
43297
|
try {
|
|
43031
43298
|
const { memoryContent, fileCount, conditionalRules, projectRoot } = await loadHierarchicalGeminiMemory(
|
|
43032
|
-
|
|
43299
|
+
process17.cwd(),
|
|
43033
43300
|
settings.merged.context?.loadFromIncludeDirectories ? config.getWorkspaceContext().getDirectories() : [],
|
|
43034
43301
|
config.getFileService(),
|
|
43035
43302
|
config.getExtensionContextFilePaths(),
|
|
@@ -43075,10 +43342,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43075
43342
|
debugLogger40.error("Error refreshing memory:", error);
|
|
43076
43343
|
}
|
|
43077
43344
|
}, [config, historyManager, settings.merged]);
|
|
43078
|
-
const cancelHandlerRef = (0,
|
|
43345
|
+
const cancelHandlerRef = (0, import_react164.useRef)(() => {
|
|
43079
43346
|
});
|
|
43080
|
-
const midTurnDrainRef = (0,
|
|
43081
|
-
const midTurnRestoreRef = (0,
|
|
43347
|
+
const midTurnDrainRef = (0, import_react164.useRef)(null);
|
|
43348
|
+
const midTurnRestoreRef = (0, import_react164.useRef)(null);
|
|
43082
43349
|
const {
|
|
43083
43350
|
streamingState,
|
|
43084
43351
|
submitQuery,
|
|
@@ -43121,13 +43388,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43121
43388
|
);
|
|
43122
43389
|
cancelOngoingRequestRef.current = cancelOngoingRequest;
|
|
43123
43390
|
isIdleRef.current = streamingState === "idle" /* Idle */;
|
|
43124
|
-
(0,
|
|
43391
|
+
(0, import_react164.useEffect)(() => {
|
|
43125
43392
|
if (streamingState === "idle" /* Idle */) {
|
|
43126
43393
|
updateHandlerRef.current?.flush();
|
|
43127
43394
|
setWorkflowKeywordActive(false);
|
|
43128
43395
|
}
|
|
43129
43396
|
}, [streamingState]);
|
|
43130
|
-
(0,
|
|
43397
|
+
(0, import_react164.useEffect)(() => {
|
|
43131
43398
|
if (shouldAutoOpenSkillReview({
|
|
43132
43399
|
pending: skillReviewPending,
|
|
43133
43400
|
streamingState,
|
|
@@ -43139,7 +43406,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43139
43406
|
}
|
|
43140
43407
|
}, [skillReviewPending, streamingState, isMemoryDialogOpen, config]);
|
|
43141
43408
|
const tipsDisabled = !!(settings.merged.ui?.hideTips || config.getScreenReader());
|
|
43142
|
-
const tipHistory = (0,
|
|
43409
|
+
const tipHistory = (0, import_react164.useMemo)(
|
|
43143
43410
|
() => tipsDisabled ? null : getTipHistory(),
|
|
43144
43411
|
[tipsDisabled]
|
|
43145
43412
|
);
|
|
@@ -43152,7 +43419,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43152
43419
|
addItem: historyManager.addItem,
|
|
43153
43420
|
hideTips: tipsDisabled
|
|
43154
43421
|
});
|
|
43155
|
-
const [hasTabConsumer, setHasTabConsumer] = (0,
|
|
43422
|
+
const [hasTabConsumer, setHasTabConsumer] = (0, import_react164.useState)(false);
|
|
43156
43423
|
const agentViewState = useAgentViewState();
|
|
43157
43424
|
const {
|
|
43158
43425
|
dialogOpen: bgTasksDialogOpen,
|
|
@@ -43160,11 +43427,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43160
43427
|
livePanelFocused: bgLivePanelFocused
|
|
43161
43428
|
} = useBackgroundTaskViewState();
|
|
43162
43429
|
const { closeDialog: closeBgTasksDialog } = useBackgroundTaskViewActions();
|
|
43163
|
-
const [promptSuggestion, setPromptSuggestion] = (0,
|
|
43164
|
-
const prevStreamingStateRef = (0,
|
|
43165
|
-
const speculationRef = (0,
|
|
43166
|
-
const suggestionAbortRef = (0,
|
|
43167
|
-
const abortPromptSuggestion = (0,
|
|
43430
|
+
const [promptSuggestion, setPromptSuggestion] = (0, import_react164.useState)(null);
|
|
43431
|
+
const prevStreamingStateRef = (0, import_react164.useRef)("idle" /* Idle */);
|
|
43432
|
+
const speculationRef = (0, import_react164.useRef)(IDLE_SPECULATION);
|
|
43433
|
+
const suggestionAbortRef = (0, import_react164.useRef)(null);
|
|
43434
|
+
const abortPromptSuggestion = (0, import_react164.useCallback)(() => {
|
|
43168
43435
|
suggestionAbortRef.current?.abort();
|
|
43169
43436
|
suggestionAbortRef.current = null;
|
|
43170
43437
|
if (speculationRef.current.status !== "idle") {
|
|
@@ -43188,26 +43455,42 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43188
43455
|
popAllMessages,
|
|
43189
43456
|
restoreMessages,
|
|
43190
43457
|
drainQueue,
|
|
43191
|
-
|
|
43458
|
+
popNextTurn
|
|
43192
43459
|
} = useMessageQueue();
|
|
43460
|
+
const submitUserQuery = (0, import_react164.useCallback)(
|
|
43461
|
+
(submission) => submitQuery(
|
|
43462
|
+
submission.modelText,
|
|
43463
|
+
"userQuery" /* UserQuery */,
|
|
43464
|
+
void 0,
|
|
43465
|
+
submission.submittedPrompt === void 0 ? void 0 : { submittedPrompt: submission.submittedPrompt }
|
|
43466
|
+
),
|
|
43467
|
+
[submitQuery]
|
|
43468
|
+
);
|
|
43469
|
+
const popAllQueuedMessages = (0, import_react164.useCallback)(() => {
|
|
43470
|
+
const submission = popAllMessages();
|
|
43471
|
+
if (submission === null) return null;
|
|
43472
|
+
restoredSubmissionRef.current = submission;
|
|
43473
|
+
submittedPromptProvenanceUnavailableRef.current = false;
|
|
43474
|
+
return submission.modelText;
|
|
43475
|
+
}, [popAllMessages]);
|
|
43193
43476
|
midTurnDrainRef.current = drainQueue;
|
|
43194
43477
|
midTurnRestoreRef.current = restoreMessages;
|
|
43195
43478
|
const remoteInput = useRemoteInput();
|
|
43196
|
-
(0,
|
|
43479
|
+
(0, import_react164.useEffect)(() => {
|
|
43197
43480
|
if (!remoteInput) return;
|
|
43198
43481
|
remoteInput.setSubmitFn((text) => submitQuery(text));
|
|
43199
43482
|
}, [remoteInput, submitQuery]);
|
|
43200
|
-
(0,
|
|
43483
|
+
(0, import_react164.useEffect)(() => {
|
|
43201
43484
|
if (!remoteInput) return;
|
|
43202
43485
|
if (streamingState === "idle" /* Idle */) {
|
|
43203
43486
|
remoteInput.notifyIdle();
|
|
43204
43487
|
}
|
|
43205
43488
|
}, [remoteInput, streamingState]);
|
|
43206
43489
|
const dualOutput = useDualOutput();
|
|
43207
|
-
const confirmRequestMap = (0,
|
|
43208
|
-
const confirmCallIdMap = (0,
|
|
43209
|
-
const confirmEmitted = (0,
|
|
43210
|
-
(0,
|
|
43490
|
+
const confirmRequestMap = (0, import_react164.useRef)(/* @__PURE__ */ new Map());
|
|
43491
|
+
const confirmCallIdMap = (0, import_react164.useRef)(/* @__PURE__ */ new Map());
|
|
43492
|
+
const confirmEmitted = (0, import_react164.useRef)(/* @__PURE__ */ new Set());
|
|
43493
|
+
(0, import_react164.useEffect)(() => {
|
|
43211
43494
|
if (!dualOutput || !dualOutput.isConnected) return;
|
|
43212
43495
|
for (const tc of pendingToolCalls) {
|
|
43213
43496
|
if (tc.status === "awaiting_approval" && !confirmEmitted.current.has(tc.request.callId)) {
|
|
@@ -43236,11 +43519,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43236
43519
|
}
|
|
43237
43520
|
}
|
|
43238
43521
|
}, [dualOutput, pendingToolCalls]);
|
|
43239
|
-
const pendingToolCallsRef = (0,
|
|
43522
|
+
const pendingToolCallsRef = (0, import_react164.useRef)(pendingToolCalls);
|
|
43240
43523
|
pendingToolCallsRef.current = pendingToolCalls;
|
|
43241
|
-
const dualOutputRef = (0,
|
|
43524
|
+
const dualOutputRef = (0, import_react164.useRef)(dualOutput);
|
|
43242
43525
|
dualOutputRef.current = dualOutput;
|
|
43243
|
-
(0,
|
|
43526
|
+
(0, import_react164.useEffect)(() => {
|
|
43244
43527
|
if (!remoteInput) return;
|
|
43245
43528
|
remoteInput.setConfirmationHandler(
|
|
43246
43529
|
(requestId, allowed) => {
|
|
@@ -43280,8 +43563,22 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
43280
43563
|
});
|
|
43281
43564
|
};
|
|
43282
43565
|
}, [remoteInput]);
|
|
43283
|
-
const handleFinalSubmit = (0,
|
|
43566
|
+
const handleFinalSubmit = (0, import_react164.useCallback)(
|
|
43284
43567
|
(submittedValue, options) => {
|
|
43568
|
+
const consumesComposerState = options !== void 0;
|
|
43569
|
+
const restoredSubmission = consumesComposerState ? restoredSubmissionRef.current : null;
|
|
43570
|
+
const submittedPromptProvenanceUnavailable = consumesComposerState && submittedPromptProvenanceUnavailableRef.current;
|
|
43571
|
+
if (consumesComposerState) {
|
|
43572
|
+
restoredSubmissionRef.current = null;
|
|
43573
|
+
submittedPromptProvenanceUnavailableRef.current = false;
|
|
43574
|
+
}
|
|
43575
|
+
const submittedPromptCandidate = options?.submittedPrompt;
|
|
43576
|
+
const provenanceEnabled = !vimEnabled && submittedPromptCandidate !== void 0;
|
|
43577
|
+
const trimmedSubmittedPrompt = submittedPromptCandidate?.trim();
|
|
43578
|
+
const submittedPrompt = submittedPromptProvenanceUnavailable || !provenanceEnabled ? void 0 : restoredSubmission === null ? trimmedSubmittedPrompt || void 0 : restoredSubmission.modelText === submittedValue ? restoredSubmission.submittedPrompt : void 0;
|
|
43579
|
+
if (restoredSubmission !== null || submittedPromptProvenanceUnavailable) {
|
|
43580
|
+
setBufferText("", { clearUndoHistory: true });
|
|
43581
|
+
}
|
|
43285
43582
|
if (agentViewState.activeView !== "main") {
|
|
43286
43583
|
const agent = agentViewState.agents.get(agentViewState.activeView);
|
|
43287
43584
|
if (agent) {
|
|
@@ -43327,11 +43624,14 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43327
43624
|
` + submittedValue;
|
|
43328
43625
|
}
|
|
43329
43626
|
if (options?.deferUntilIdle) {
|
|
43330
|
-
addMessage(submittedValue, true);
|
|
43627
|
+
addMessage(submittedValue, true, submittedPrompt);
|
|
43331
43628
|
return;
|
|
43332
43629
|
}
|
|
43333
43630
|
if (streamingState === "responding" /* Responding */ && isBtwCommand(submittedValue)) {
|
|
43334
|
-
void
|
|
43631
|
+
void submitUserQuery({
|
|
43632
|
+
modelText: submittedValue,
|
|
43633
|
+
submittedPrompt
|
|
43634
|
+
});
|
|
43335
43635
|
return;
|
|
43336
43636
|
}
|
|
43337
43637
|
const spec = speculationRef.current;
|
|
@@ -43405,7 +43705,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43405
43705
|
setPromptSuggestion(result.nextSuggestion);
|
|
43406
43706
|
}
|
|
43407
43707
|
}).catch(() => {
|
|
43408
|
-
addMessage(submittedValue);
|
|
43708
|
+
addMessage(submittedValue, false, submittedPrompt);
|
|
43409
43709
|
});
|
|
43410
43710
|
speculationRef.current = IDLE_SPECULATION;
|
|
43411
43711
|
return;
|
|
@@ -43416,25 +43716,30 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43416
43716
|
speculationRef.current = IDLE_SPECULATION;
|
|
43417
43717
|
}
|
|
43418
43718
|
if (streamingState === "idle" /* Idle */ && !isProcessing && isSlashCommand(submittedValue)) {
|
|
43419
|
-
void
|
|
43719
|
+
void submitUserQuery({
|
|
43720
|
+
modelText: submittedValue,
|
|
43721
|
+
submittedPrompt
|
|
43722
|
+
});
|
|
43420
43723
|
return;
|
|
43421
43724
|
}
|
|
43422
|
-
addMessage(submittedValue);
|
|
43725
|
+
addMessage(submittedValue, false, submittedPrompt);
|
|
43423
43726
|
},
|
|
43424
43727
|
[
|
|
43425
43728
|
addMessage,
|
|
43426
43729
|
agentViewState,
|
|
43427
43730
|
streamingState,
|
|
43428
43731
|
isProcessing,
|
|
43429
|
-
|
|
43732
|
+
submitUserQuery,
|
|
43430
43733
|
handleSlashCommand,
|
|
43431
43734
|
config,
|
|
43432
43735
|
geminiClient,
|
|
43433
43736
|
historyManager,
|
|
43434
|
-
settings.merged.ui?.disableWorkflowKeywordTrigger
|
|
43737
|
+
settings.merged.ui?.disableWorkflowKeywordTrigger,
|
|
43738
|
+
setBufferText,
|
|
43739
|
+
vimEnabled
|
|
43435
43740
|
]
|
|
43436
43741
|
);
|
|
43437
|
-
const handleArenaModelsSelected = (0,
|
|
43742
|
+
const handleArenaModelsSelected = (0, import_react164.useCallback)(
|
|
43438
43743
|
(models) => {
|
|
43439
43744
|
const value = models.join(",");
|
|
43440
43745
|
buffer.setText(`/arena start --models ${value} `);
|
|
@@ -43449,15 +43754,15 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43449
43754
|
handleWelcomeBackSelection,
|
|
43450
43755
|
handleWelcomeBackClose
|
|
43451
43756
|
} = useWelcomeBack(config, handleFinalSubmit, buffer, settings.merged);
|
|
43452
|
-
const pendingHistoryItems = (0,
|
|
43757
|
+
const pendingHistoryItems = (0, import_react164.useMemo)(
|
|
43453
43758
|
() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
|
|
43454
43759
|
[pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]
|
|
43455
43760
|
);
|
|
43456
|
-
const historyForTranscriptRef = (0,
|
|
43761
|
+
const historyForTranscriptRef = (0, import_react164.useRef)(historyManager.history);
|
|
43457
43762
|
historyForTranscriptRef.current = historyManager.history;
|
|
43458
|
-
const pendingForTranscriptRef = (0,
|
|
43763
|
+
const pendingForTranscriptRef = (0, import_react164.useRef)(pendingHistoryItems);
|
|
43459
43764
|
pendingForTranscriptRef.current = pendingHistoryItems;
|
|
43460
|
-
const openTranscript = (0,
|
|
43765
|
+
const openTranscript = (0, import_react164.useCallback)(() => {
|
|
43461
43766
|
setTranscriptFreeze({
|
|
43462
43767
|
// Share MainContent's visibility predicate so the transcript shows exactly
|
|
43463
43768
|
// what the main view shows. Items collapsed on session resume
|
|
@@ -43469,7 +43774,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43469
43774
|
pendingItems: [...pendingForTranscriptRef.current]
|
|
43470
43775
|
});
|
|
43471
43776
|
}, []);
|
|
43472
|
-
const transcriptItems = (0,
|
|
43777
|
+
const transcriptItems = (0, import_react164.useMemo)(() => {
|
|
43473
43778
|
if (!transcriptFreeze) return EMPTY_HISTORY_ITEMS;
|
|
43474
43779
|
return [
|
|
43475
43780
|
...transcriptFreeze.committedItems,
|
|
@@ -43481,7 +43786,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43481
43786
|
}))
|
|
43482
43787
|
];
|
|
43483
43788
|
}, [transcriptFreeze]);
|
|
43484
|
-
const rawStickyTodos = (0,
|
|
43789
|
+
const rawStickyTodos = (0, import_react164.useMemo)(
|
|
43485
43790
|
() => getStickyTodos(historyManager.history, pendingHistoryItems),
|
|
43486
43791
|
[historyManager.history, pendingHistoryItems]
|
|
43487
43792
|
);
|
|
@@ -43489,7 +43794,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43489
43794
|
const hasExecutingTool = isToolExecuting(pendingHistoryItems);
|
|
43490
43795
|
const hasPendingCompression = isCompressionPending(pendingHistoryItems);
|
|
43491
43796
|
useTerminalProgress(streamingState, hasExecutingTool);
|
|
43492
|
-
cancelHandlerRef.current = (0,
|
|
43797
|
+
cancelHandlerRef.current = (0, import_react164.useCallback)(
|
|
43493
43798
|
(info) => {
|
|
43494
43799
|
const pendingHistoryItems2 = [
|
|
43495
43800
|
...pendingSlashCommandHistoryItems,
|
|
@@ -43501,9 +43806,13 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43501
43806
|
const draftWasEmpty = buffer.text.length === 0;
|
|
43502
43807
|
const popped = popAllMessages();
|
|
43503
43808
|
if (popped) {
|
|
43809
|
+
restoredSubmissionRef.current = popped;
|
|
43810
|
+
submittedPromptProvenanceUnavailableRef.current = false;
|
|
43504
43811
|
const currentText = buffer.text;
|
|
43505
|
-
buffer.setText(
|
|
43506
|
-
|
|
43812
|
+
buffer.setText(
|
|
43813
|
+
currentText ? `${popped.modelText}
|
|
43814
|
+
${currentText}` : popped.modelText
|
|
43815
|
+
);
|
|
43507
43816
|
}
|
|
43508
43817
|
if (!draftWasEmpty) {
|
|
43509
43818
|
debugLogger40.debug("auto-restore bail: buffer was non-empty");
|
|
@@ -43522,6 +43831,14 @@ ${currentText}` : popped);
|
|
|
43522
43831
|
);
|
|
43523
43832
|
return;
|
|
43524
43833
|
}
|
|
43834
|
+
const restoreCancelledPrompt = /* @__PURE__ */ __name(() => {
|
|
43835
|
+
restoredSubmissionRef.current = {
|
|
43836
|
+
modelText: cancelledTurnUserItem.text,
|
|
43837
|
+
...cancelledTurnUserItem.submittedPrompt === void 0 ? {} : { submittedPrompt: cancelledTurnUserItem.submittedPrompt }
|
|
43838
|
+
};
|
|
43839
|
+
submittedPromptProvenanceUnavailableRef.current = false;
|
|
43840
|
+
buffer.setText(cancelledTurnUserItem.text);
|
|
43841
|
+
}, "restoreCancelledPrompt");
|
|
43525
43842
|
if (pendingHistoryItems2.some((item) => item.type === "tool_group")) {
|
|
43526
43843
|
debugLogger40.debug(
|
|
43527
43844
|
"auto-restore bail: tool execution is pending or committed"
|
|
@@ -43532,7 +43849,7 @@ ${currentText}` : popped);
|
|
|
43532
43849
|
debugLogger40.debug(
|
|
43533
43850
|
"auto-restore: preserving streamed output and restoring prompt text"
|
|
43534
43851
|
);
|
|
43535
|
-
|
|
43852
|
+
restoreCancelledPrompt();
|
|
43536
43853
|
return;
|
|
43537
43854
|
}
|
|
43538
43855
|
if (pendingHistoryItems2.some((item) => !isSyntheticHistoryItem(item))) {
|
|
@@ -43551,7 +43868,7 @@ ${currentText}` : popped);
|
|
|
43551
43868
|
debugLogger40.debug(
|
|
43552
43869
|
"auto-restore: preserving committed output and restoring prompt text"
|
|
43553
43870
|
);
|
|
43554
|
-
|
|
43871
|
+
restoreCancelledPrompt();
|
|
43555
43872
|
return;
|
|
43556
43873
|
}
|
|
43557
43874
|
const lastUserItem = history[lastUserIdx];
|
|
@@ -43572,11 +43889,13 @@ ${currentText}` : popped);
|
|
|
43572
43889
|
);
|
|
43573
43890
|
historyManager.truncateToItem(lastUserItem.id);
|
|
43574
43891
|
refreshStatic();
|
|
43575
|
-
|
|
43892
|
+
restoreCancelledPrompt();
|
|
43576
43893
|
geminiClient?.stripOrphanedUserEntriesFromHistory?.();
|
|
43577
|
-
|
|
43578
|
-
|
|
43579
|
-
|
|
43894
|
+
if (info?.canUndoLastLoggedUserMessage) {
|
|
43895
|
+
void logger?.removeLastUserMessage().catch((err) => {
|
|
43896
|
+
debugLogger40.debug("Failed to undo cancelled prompt from log:", err);
|
|
43897
|
+
});
|
|
43898
|
+
}
|
|
43580
43899
|
},
|
|
43581
43900
|
[
|
|
43582
43901
|
buffer,
|
|
@@ -43589,7 +43908,7 @@ ${currentText}` : popped);
|
|
|
43589
43908
|
pendingGeminiHistoryItems
|
|
43590
43909
|
]
|
|
43591
43910
|
);
|
|
43592
|
-
const handleClearScreen = (0,
|
|
43911
|
+
const handleClearScreen = (0, import_react164.useCallback)(() => {
|
|
43593
43912
|
historyManager.clearItems();
|
|
43594
43913
|
clearScreen();
|
|
43595
43914
|
remountStaticHistory();
|
|
@@ -43612,13 +43931,13 @@ ${currentText}` : popped);
|
|
|
43612
43931
|
history: historyManager.history,
|
|
43613
43932
|
awayThresholdMinutes: settings.merged.general?.sessionRecapAwayThresholdMinutes
|
|
43614
43933
|
});
|
|
43615
|
-
const contextFileNames = (0,
|
|
43934
|
+
const contextFileNames = (0, import_react164.useMemo)(() => {
|
|
43616
43935
|
const fromSettings = settings.merged.context?.fileName;
|
|
43617
43936
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllGeminiMdFilenames();
|
|
43618
43937
|
}, [settings.merged.context?.fileName]);
|
|
43619
|
-
const initialPrompt = (0,
|
|
43620
|
-
const initialPromptSubmitted = (0,
|
|
43621
|
-
(0,
|
|
43938
|
+
const initialPrompt = (0, import_react164.useMemo)(() => config.getQuestion(), [config]);
|
|
43939
|
+
const initialPromptSubmitted = (0, import_react164.useRef)(false);
|
|
43940
|
+
(0, import_react164.useEffect)(() => {
|
|
43622
43941
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && welcomeBackChoice !== "restart" && geminiClient?.isInitialized?.()) {
|
|
43623
43942
|
handleFinalSubmit(initialPrompt);
|
|
43624
43943
|
initialPromptSubmitted.current = true;
|
|
@@ -43636,7 +43955,7 @@ ${currentText}` : popped);
|
|
|
43636
43955
|
geminiClient
|
|
43637
43956
|
]);
|
|
43638
43957
|
const followupSuggestionsEnabled = settings.merged.ui?.enableFollowupSuggestions !== false;
|
|
43639
|
-
(0,
|
|
43958
|
+
(0, import_react164.useEffect)(() => {
|
|
43640
43959
|
if (!followupSuggestionsEnabled) {
|
|
43641
43960
|
suggestionAbortRef.current?.abort();
|
|
43642
43961
|
setPromptSuggestion(null);
|
|
@@ -43705,17 +44024,17 @@ ${currentText}` : popped);
|
|
|
43705
44024
|
isPermissionsDialogOpen,
|
|
43706
44025
|
settingInputRequests
|
|
43707
44026
|
]);
|
|
43708
|
-
(0,
|
|
44027
|
+
(0, import_react164.useEffect)(() => {
|
|
43709
44028
|
if (!promptSuggestion && speculationRef.current.status !== "idle") {
|
|
43710
44029
|
abortSpeculation(speculationRef.current).catch(() => {
|
|
43711
44030
|
});
|
|
43712
44031
|
speculationRef.current = IDLE_SPECULATION;
|
|
43713
44032
|
}
|
|
43714
44033
|
}, [promptSuggestion]);
|
|
43715
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
43716
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
43717
|
-
const [startupIdeConnectionStatus, setStartupIdeConnectionStatus] = (0,
|
|
43718
|
-
(0,
|
|
44034
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react164.useState)(false);
|
|
44035
|
+
const [currentIDE, setCurrentIDE] = (0, import_react164.useState)(null);
|
|
44036
|
+
const [startupIdeConnectionStatus, setStartupIdeConnectionStatus] = (0, import_react164.useState)({ state: "idle" });
|
|
44037
|
+
(0, import_react164.useEffect)(() => {
|
|
43719
44038
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
43720
44039
|
const ideClient = await IdeClient.getInstance();
|
|
43721
44040
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -43731,40 +44050,40 @@ ${currentText}` : popped);
|
|
|
43731
44050
|
tomlFiles: commandMigrationTomlFiles,
|
|
43732
44051
|
setShowMigrationNudge: setShowCommandMigrationNudge
|
|
43733
44052
|
} = useCommandMigration(settings, config.storage);
|
|
43734
|
-
const [showToolDescriptions, setShowToolDescriptions] = (0,
|
|
44053
|
+
const [showToolDescriptions, setShowToolDescriptions] = (0, import_react164.useState)(false);
|
|
43735
44054
|
const configuredRenderMode = settings.merged.ui?.renderMode;
|
|
43736
|
-
const [renderMode, setRenderMode] = (0,
|
|
44055
|
+
const [renderMode, setRenderMode] = (0, import_react164.useState)(
|
|
43737
44056
|
configuredRenderMode === "raw" ? "raw" : "render"
|
|
43738
44057
|
);
|
|
43739
|
-
const renderModeConfigMountedRef = (0,
|
|
43740
|
-
(0,
|
|
44058
|
+
const renderModeConfigMountedRef = (0, import_react164.useRef)(false);
|
|
44059
|
+
(0, import_react164.useEffect)(() => {
|
|
43741
44060
|
if (!renderModeConfigMountedRef.current) {
|
|
43742
44061
|
renderModeConfigMountedRef.current = true;
|
|
43743
44062
|
return;
|
|
43744
44063
|
}
|
|
43745
44064
|
setRenderMode(configuredRenderMode === "raw" ? "raw" : "render");
|
|
43746
44065
|
}, [configuredRenderMode]);
|
|
43747
|
-
const renderModeMountedRef = (0,
|
|
43748
|
-
(0,
|
|
44066
|
+
const renderModeMountedRef = (0, import_react164.useRef)(false);
|
|
44067
|
+
(0, import_react164.useEffect)(() => {
|
|
43749
44068
|
if (!renderModeMountedRef.current) {
|
|
43750
44069
|
renderModeMountedRef.current = true;
|
|
43751
44070
|
return;
|
|
43752
44071
|
}
|
|
43753
44072
|
refreshStatic();
|
|
43754
44073
|
}, [renderMode, refreshStatic]);
|
|
43755
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0,
|
|
43756
|
-
const ctrlCTimerRef = (0,
|
|
43757
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0,
|
|
43758
|
-
const ctrlDTimerRef = (0,
|
|
43759
|
-
const [escapePressedOnce, setEscapePressedOnce] = (0,
|
|
43760
|
-
const escapeTimerRef = (0,
|
|
43761
|
-
const dialogsVisibleRef = (0,
|
|
43762
|
-
const [isRewindSelectorOpen, setIsRewindSelectorOpen] = (0,
|
|
43763
|
-
const [rewindEscPending, setRewindEscPending] = (0,
|
|
43764
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
43765
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
43766
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
43767
|
-
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0,
|
|
44074
|
+
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0, import_react164.useState)(false);
|
|
44075
|
+
const ctrlCTimerRef = (0, import_react164.useRef)(null);
|
|
44076
|
+
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0, import_react164.useState)(false);
|
|
44077
|
+
const ctrlDTimerRef = (0, import_react164.useRef)(null);
|
|
44078
|
+
const [escapePressedOnce, setEscapePressedOnce] = (0, import_react164.useState)(false);
|
|
44079
|
+
const escapeTimerRef = (0, import_react164.useRef)(null);
|
|
44080
|
+
const dialogsVisibleRef = (0, import_react164.useRef)(false);
|
|
44081
|
+
const [isRewindSelectorOpen, setIsRewindSelectorOpen] = (0, import_react164.useState)(false);
|
|
44082
|
+
const [rewindEscPending, setRewindEscPending] = (0, import_react164.useState)(false);
|
|
44083
|
+
const [constrainHeight, setConstrainHeight] = (0, import_react164.useState)(true);
|
|
44084
|
+
const [ideContextState, setIdeContextState] = (0, import_react164.useState)();
|
|
44085
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react164.useState)(false);
|
|
44086
|
+
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react164.useState)(false);
|
|
43768
44087
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings, setIsTrustedFolder);
|
|
43769
44088
|
const {
|
|
43770
44089
|
isMcpApprovalDialogOpen,
|
|
@@ -43793,7 +44112,7 @@ ${currentText}` : popped);
|
|
|
43793
44112
|
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);
|
|
43794
44113
|
dialogsVisibleRef.current = dialogsVisible;
|
|
43795
44114
|
const needsBlockingInput = dialogsVisible || streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
43796
|
-
(0,
|
|
44115
|
+
(0, import_react164.useEffect)(() => {
|
|
43797
44116
|
if (needsBlockingInput && isTranscriptOpen) {
|
|
43798
44117
|
closeTranscript();
|
|
43799
44118
|
}
|
|
@@ -43809,12 +44128,12 @@ ${currentText}` : popped);
|
|
|
43809
44128
|
stickyTodoWidth,
|
|
43810
44129
|
stickyTodoMaxVisibleItems
|
|
43811
44130
|
) : "hidden";
|
|
43812
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
44131
|
+
const [controlsHeight, setControlsHeight] = (0, import_react164.useState)(0);
|
|
43813
44132
|
const liveAgentPanelLayoutKey = getLiveAgentPanelLayoutKey(
|
|
43814
44133
|
bgTaskEntries,
|
|
43815
44134
|
bgLivePanelFocused
|
|
43816
44135
|
);
|
|
43817
|
-
(0,
|
|
44136
|
+
(0, import_react164.useLayoutEffect)(() => {
|
|
43818
44137
|
if (!mainControlsRef.current) {
|
|
43819
44138
|
setControlsHeight(
|
|
43820
44139
|
(previousHeight) => previousHeight === 0 ? previousHeight : 0
|
|
@@ -43861,7 +44180,7 @@ ${currentText}` : popped);
|
|
|
43861
44180
|
pager: settings.merged.tools?.shell?.pager,
|
|
43862
44181
|
showColor: settings.merged.tools?.shell?.showColor
|
|
43863
44182
|
});
|
|
43864
|
-
(0,
|
|
44183
|
+
(0, import_react164.useEffect)(() => {
|
|
43865
44184
|
if (activePtyId) {
|
|
43866
44185
|
ShellExecutionService.resizePty(
|
|
43867
44186
|
activePtyId,
|
|
@@ -43870,19 +44189,18 @@ ${currentText}` : popped);
|
|
|
43870
44189
|
);
|
|
43871
44190
|
}
|
|
43872
44191
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
43873
|
-
useResizeSettleRepaint(terminalWidth, refreshStatic);
|
|
43874
44192
|
useWakeRepaint(refreshStatic);
|
|
43875
|
-
(0,
|
|
44193
|
+
(0, import_react164.useEffect)(() => {
|
|
43876
44194
|
if (ideNeedsRestart) {
|
|
43877
44195
|
setShowIdeRestartPrompt(true);
|
|
43878
44196
|
}
|
|
43879
44197
|
}, [ideNeedsRestart]);
|
|
43880
|
-
(0,
|
|
44198
|
+
(0, import_react164.useEffect)(() => {
|
|
43881
44199
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
43882
44200
|
setIdeContextState(ideContextStore.get());
|
|
43883
44201
|
return unsubscribe;
|
|
43884
44202
|
}, []);
|
|
43885
|
-
(0,
|
|
44203
|
+
(0, import_react164.useEffect)(() => {
|
|
43886
44204
|
const listener = /* @__PURE__ */ __name((status) => {
|
|
43887
44205
|
setStartupIdeConnectionStatus(status);
|
|
43888
44206
|
}, "listener");
|
|
@@ -43891,10 +44209,10 @@ ${currentText}` : popped);
|
|
|
43891
44209
|
appEvents.off("startup-ide-connection-status-changed" /* StartupIdeConnectionStatusChanged */, listener);
|
|
43892
44210
|
};
|
|
43893
44211
|
}, []);
|
|
43894
|
-
const handleEscapePromptChange = (0,
|
|
44212
|
+
const handleEscapePromptChange = (0, import_react164.useCallback)((showPrompt) => {
|
|
43895
44213
|
setShowEscapePrompt(showPrompt);
|
|
43896
44214
|
}, []);
|
|
43897
|
-
const openRewindSelector = (0,
|
|
44215
|
+
const openRewindSelector = (0, import_react164.useCallback)(() => {
|
|
43898
44216
|
if (streamingState !== "idle" /* Idle */) return;
|
|
43899
44217
|
if (dialogsVisibleRef.current) return;
|
|
43900
44218
|
if (config.getIdeMode()) {
|
|
@@ -43912,10 +44230,10 @@ ${currentText}` : popped);
|
|
|
43912
44230
|
setIsRewindSelectorOpen(true);
|
|
43913
44231
|
}, [streamingState, config, historyManager]);
|
|
43914
44232
|
openRewindSelectorRef.current = openRewindSelector;
|
|
43915
|
-
const closeRewindSelector = (0,
|
|
44233
|
+
const closeRewindSelector = (0, import_react164.useCallback)(() => {
|
|
43916
44234
|
setIsRewindSelectorOpen(false);
|
|
43917
44235
|
}, []);
|
|
43918
|
-
const handleRewindConfirm = (0,
|
|
44236
|
+
const handleRewindConfirm = (0, import_react164.useCallback)(
|
|
43919
44237
|
async (userItem, option) => {
|
|
43920
44238
|
try {
|
|
43921
44239
|
const needsConversation = option === "conversation" || option === "both";
|
|
@@ -44017,6 +44335,8 @@ ${currentText}` : popped);
|
|
|
44017
44335
|
historyManager.loadHistory(truncatedUi);
|
|
44018
44336
|
refreshStatic();
|
|
44019
44337
|
if (userItem.type === "user" && userItem.text) {
|
|
44338
|
+
restoredSubmissionRef.current = null;
|
|
44339
|
+
submittedPromptProvenanceUnavailableRef.current = true;
|
|
44020
44340
|
buffer.setText(userItem.text);
|
|
44021
44341
|
}
|
|
44022
44342
|
historyManager.addItem(
|
|
@@ -44077,7 +44397,7 @@ ${currentText}` : popped);
|
|
|
44077
44397
|
openRewindSelector,
|
|
44078
44398
|
(pending) => setRewindEscPending(pending)
|
|
44079
44399
|
);
|
|
44080
|
-
const handleIdePromptComplete = (0,
|
|
44400
|
+
const handleIdePromptComplete = (0, import_react164.useCallback)(
|
|
44081
44401
|
(result) => {
|
|
44082
44402
|
if (result.userSelection === "yes") {
|
|
44083
44403
|
if (result.isExtensionPreInstalled) {
|
|
@@ -44093,7 +44413,7 @@ ${currentText}` : popped);
|
|
|
44093
44413
|
},
|
|
44094
44414
|
[handleSlashCommand, settings]
|
|
44095
44415
|
);
|
|
44096
|
-
const handleCommandMigrationComplete = (0,
|
|
44416
|
+
const handleCommandMigrationComplete = (0, import_react164.useCallback)(
|
|
44097
44417
|
async (result) => {
|
|
44098
44418
|
setShowCommandMigrationNudge(false);
|
|
44099
44419
|
if (result.userSelection === "yes") {
|
|
@@ -44185,7 +44505,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44185
44505
|
pendingToolCalls
|
|
44186
44506
|
});
|
|
44187
44507
|
const workflowBellEnabled = settings.merged.general?.terminalBell ?? true;
|
|
44188
|
-
(0,
|
|
44508
|
+
(0, import_react164.useEffect)(() => {
|
|
44189
44509
|
const registry = config.getWorkflowRunRegistry?.();
|
|
44190
44510
|
if (!registry?.setNotificationCallback) return;
|
|
44191
44511
|
registry.setNotificationCallback((entry) => {
|
|
@@ -44235,7 +44555,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44235
44555
|
showWorktreeExitDialog,
|
|
44236
44556
|
closeWorktreeExitDialog: /* @__PURE__ */ __name(() => setShowWorktreeExitDialog(false), "closeWorktreeExitDialog")
|
|
44237
44557
|
});
|
|
44238
|
-
const handleExit = (0,
|
|
44558
|
+
const handleExit = (0, import_react164.useCallback)(
|
|
44239
44559
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
44240
44560
|
if (pressedOnce) {
|
|
44241
44561
|
if (timerRef.current) {
|
|
@@ -44288,7 +44608,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44288
44608
|
activeWorktree
|
|
44289
44609
|
]
|
|
44290
44610
|
);
|
|
44291
|
-
const handleGlobalKeypress = (0,
|
|
44611
|
+
const handleGlobalKeypress = (0, import_react164.useCallback)(
|
|
44292
44612
|
(key) => {
|
|
44293
44613
|
if (settings.merged.general?.debugKeystrokeLogging) {
|
|
44294
44614
|
debugLogger40.debug("[DEBUG] Keystroke:", JSON.stringify(key));
|
|
@@ -44478,7 +44798,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44478
44798
|
]
|
|
44479
44799
|
);
|
|
44480
44800
|
useKeypress(handleGlobalKeypress, { isActive: true });
|
|
44481
|
-
(0,
|
|
44801
|
+
(0, import_react164.useEffect)(() => {
|
|
44482
44802
|
if (settings.merged.ui?.hideWindowTitle) {
|
|
44483
44803
|
return;
|
|
44484
44804
|
}
|
|
@@ -44487,7 +44807,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44487
44807
|
lastTitleRef.current = null;
|
|
44488
44808
|
const folderName2 = basename3(config.getTargetDir());
|
|
44489
44809
|
writeTerminalTitle(
|
|
44490
|
-
(value) =>
|
|
44810
|
+
(value) => process17.stdout.write(value),
|
|
44491
44811
|
formatSessionWindowTitle(null, folderName2)
|
|
44492
44812
|
);
|
|
44493
44813
|
}
|
|
@@ -44497,7 +44817,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44497
44817
|
const title = formatSessionWindowTitle(sessionName, folderName);
|
|
44498
44818
|
if (lastTitleRef.current !== title) {
|
|
44499
44819
|
lastTitleRef.current = title;
|
|
44500
|
-
writeTerminalTitle((value) =>
|
|
44820
|
+
writeTerminalTitle((value) => process17.stdout.write(value), title);
|
|
44501
44821
|
}
|
|
44502
44822
|
}, [
|
|
44503
44823
|
sessionName,
|
|
@@ -44505,9 +44825,9 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44505
44825
|
settings.merged.ui?.showStatusInTitle,
|
|
44506
44826
|
config
|
|
44507
44827
|
]);
|
|
44508
|
-
const queueDrainingRef = (0,
|
|
44509
|
-
const [queueDrainNonce, setQueueDrainNonce] = (0,
|
|
44510
|
-
(0,
|
|
44828
|
+
const queueDrainingRef = (0, import_react164.useRef)(false);
|
|
44829
|
+
const [queueDrainNonce, setQueueDrainNonce] = (0, import_react164.useState)(0);
|
|
44830
|
+
(0, import_react164.useEffect)(() => {
|
|
44511
44831
|
if (queueDrainingRef.current) return;
|
|
44512
44832
|
if (!shouldDrainMessageQueue({
|
|
44513
44833
|
isConfigInitialized,
|
|
@@ -44519,11 +44839,10 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44519
44839
|
return;
|
|
44520
44840
|
}
|
|
44521
44841
|
if (isTranscriptOpenRef.current) return;
|
|
44522
|
-
const
|
|
44523
|
-
const submission = plainPrompts.length > 0 ? plainPrompts.join("\n\n") : popNextSegment();
|
|
44842
|
+
const submission = popNextTurn();
|
|
44524
44843
|
if (submission === null) return;
|
|
44525
44844
|
queueDrainingRef.current = true;
|
|
44526
|
-
Promise.resolve(
|
|
44845
|
+
Promise.resolve(submitUserQuery(submission)).finally(() => {
|
|
44527
44846
|
queueDrainingRef.current = false;
|
|
44528
44847
|
setQueueDrainNonce((n) => n + 1);
|
|
44529
44848
|
});
|
|
@@ -44535,13 +44854,12 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44535
44854
|
// Re-run the drain when the transcript closes so queued messages resume.
|
|
44536
44855
|
isTranscriptOpen,
|
|
44537
44856
|
messageQueue,
|
|
44538
|
-
|
|
44539
|
-
|
|
44540
|
-
submitQuery,
|
|
44857
|
+
popNextTurn,
|
|
44858
|
+
submitUserQuery,
|
|
44541
44859
|
queueDrainNonce
|
|
44542
44860
|
]);
|
|
44543
44861
|
const nightly = props.version.includes("nightly");
|
|
44544
|
-
const uiState = (0,
|
|
44862
|
+
const uiState = (0, import_react164.useMemo)(
|
|
44545
44863
|
() => ({
|
|
44546
44864
|
history: historyManager.history,
|
|
44547
44865
|
historyManager,
|
|
@@ -44834,7 +45152,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44834
45152
|
isDiffDialogOpen
|
|
44835
45153
|
]
|
|
44836
45154
|
);
|
|
44837
|
-
const uiActions = (0,
|
|
45155
|
+
const uiActions = (0, import_react164.useMemo)(
|
|
44838
45156
|
() => ({
|
|
44839
45157
|
openThemeDialog,
|
|
44840
45158
|
openEditorDialog,
|
|
@@ -44875,7 +45193,8 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44875
45193
|
handleFinalSubmit,
|
|
44876
45194
|
handleRetryLastPrompt: retryLastPrompt,
|
|
44877
45195
|
handleClearScreen,
|
|
44878
|
-
popAllQueuedMessages
|
|
45196
|
+
popAllQueuedMessages,
|
|
45197
|
+
invalidateSubmittedPromptProvenance,
|
|
44879
45198
|
// Welcome back dialog
|
|
44880
45199
|
handleWelcomeBackSelection,
|
|
44881
45200
|
handleWelcomeBackClose,
|
|
@@ -44965,7 +45284,8 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44965
45284
|
handleFinalSubmit,
|
|
44966
45285
|
retryLastPrompt,
|
|
44967
45286
|
handleClearScreen,
|
|
44968
|
-
|
|
45287
|
+
popAllQueuedMessages,
|
|
45288
|
+
invalidateSubmittedPromptProvenance,
|
|
44969
45289
|
handleWelcomeBackSelection,
|
|
44970
45290
|
handleWelcomeBackClose,
|
|
44971
45291
|
handleWorktreeExit,
|
|
@@ -45015,11 +45335,11 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
45015
45335
|
closeDiffDialog
|
|
45016
45336
|
]
|
|
45017
45337
|
);
|
|
45018
|
-
const renderModeValue = (0,
|
|
45338
|
+
const renderModeValue = (0, import_react164.useMemo)(
|
|
45019
45339
|
() => ({ renderMode, setRenderMode }),
|
|
45020
45340
|
[renderMode, setRenderMode]
|
|
45021
45341
|
);
|
|
45022
|
-
const thoughtExpandedValue = (0,
|
|
45342
|
+
const thoughtExpandedValue = (0, import_react164.useMemo)(
|
|
45023
45343
|
() => ({
|
|
45024
45344
|
allExpanded: thoughtExpanded,
|
|
45025
45345
|
expandedHeadIds: expandedThoughtHeadIds,
|
|
@@ -45027,7 +45347,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
45027
45347
|
}),
|
|
45028
45348
|
[thoughtExpanded, expandedThoughtHeadIds, toggleThoughtExpanded]
|
|
45029
45349
|
);
|
|
45030
|
-
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)(
|
|
45350
|
+
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)(
|
|
45031
45351
|
AppContext.Provider,
|
|
45032
45352
|
{
|
|
45033
45353
|
value: {
|
|
@@ -45051,14 +45371,14 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
45051
45371
|
) })
|
|
45052
45372
|
) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(App, {}) }) }) }) })
|
|
45053
45373
|
}
|
|
45054
|
-
) }) }) });
|
|
45374
|
+
) }) }) }) });
|
|
45055
45375
|
}, "AppContainer");
|
|
45056
45376
|
|
|
45057
45377
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
45058
45378
|
init_esbuild_shims();
|
|
45059
|
-
var
|
|
45379
|
+
var import_react165 = __toESM(require_react(), 1);
|
|
45060
45380
|
function useKittyKeyboardProtocol() {
|
|
45061
|
-
const [status] = (0,
|
|
45381
|
+
const [status] = (0, import_react165.useState)({
|
|
45062
45382
|
supported: isKittyProtocolSupported(),
|
|
45063
45383
|
enabled: isKittyProtocolEnabled(),
|
|
45064
45384
|
checking: false
|
|
@@ -45312,6 +45632,11 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
45312
45632
|
}
|
|
45313
45633
|
}
|
|
45314
45634
|
const initialCapturedInput = stopAndGetCapturedInput();
|
|
45635
|
+
const useVP = shouldUseVirtualViewport(
|
|
45636
|
+
settings.merged.ui?.useTerminalBuffer,
|
|
45637
|
+
config.getScreenReader(),
|
|
45638
|
+
isInteractiveTerminal()
|
|
45639
|
+
);
|
|
45315
45640
|
const AppWrapper = /* @__PURE__ */ __name(() => {
|
|
45316
45641
|
const kittyProtocolStatus = useKittyKeyboardProtocol();
|
|
45317
45642
|
const nodeMajorVersion = parseInt(process.versions.node.split(".")[0], 10);
|
|
@@ -45331,13 +45656,13 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
45331
45656
|
startupWarnings,
|
|
45332
45657
|
version,
|
|
45333
45658
|
initializationResult,
|
|
45659
|
+
initialUseVirtualViewport: useVP,
|
|
45334
45660
|
extensionRefreshState: options.extensionRefreshState
|
|
45335
45661
|
}
|
|
45336
45662
|
) }) }) }) })
|
|
45337
45663
|
}
|
|
45338
45664
|
) }) }) });
|
|
45339
45665
|
}, "AppWrapper");
|
|
45340
|
-
const useVP = settings.merged.ui?.useTerminalBuffer ?? false;
|
|
45341
45666
|
const stdoutMaxListeners = process.stdout.getMaxListeners();
|
|
45342
45667
|
if (useVP) {
|
|
45343
45668
|
process.stdout.setMaxListeners(0);
|
|
@@ -45359,7 +45684,7 @@ ${error.stack ?? ""}`
|
|
|
45359
45684
|
}
|
|
45360
45685
|
);
|
|
45361
45686
|
const instance = render_default(
|
|
45362
|
-
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
45687
|
+
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_react166.default.StrictMode, { children: appTree }) : appTree,
|
|
45363
45688
|
{
|
|
45364
45689
|
exitOnCtrlC: false,
|
|
45365
45690
|
isScreenReaderEnabled: config.getScreenReader(),
|