@qwen-code/qwen-code 0.20.1-jobbench-claude-prompt.0 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/qc-helper/docs/configuration/settings.md +1 -1
- package/bundled/qc-helper/docs/features/auto-mode.md +19 -16
- package/bundled/qc-helper/docs/features/commands.md +54 -0
- package/bundled/qc-helper/docs/features/sub-agents.md +16 -7
- package/bundled/qc-helper/docs/integration-github-action.md +10 -10
- package/bundled/qc-helper/docs/qwen-serve.md +2 -1
- package/bundled/review/DESIGN.md +2 -2
- package/bundled/review/SKILL.md +4 -4
- package/chunks/{MaxSizedBox-BGLP6FQT.js → MaxSizedBox-4WZYPSRU.js} +40 -36
- package/chunks/{StandaloneSessionPicker-K6I4ZEHD.js → StandaloneSessionPicker-PE4JAIFA.js} +58 -54
- package/chunks/{acpAgent-PKKBOEP4.js → acpAgent-BVIKGJ2C.js} +1503 -520
- package/chunks/{agent-Y7XOSZY5.js → agent-DHLFAOUV.js} +36 -32
- package/chunks/{agent-headless-NXRPEYGF.js → agent-headless-ZP5WTNXZ.js} +36 -32
- package/chunks/{anthropicContentGenerator-BWBAZGTW.js → anthropicContentGenerator-NMSS7IMV.js} +11 -11
- package/chunks/{artifact-tool-IUJ7QWCX.js → artifact-tool-56T5IMBP.js} +3 -3
- package/chunks/{askUserQuestion-IUMUUTDQ.js → askUserQuestion-E25OBIC2.js} +3 -3
- package/chunks/{bridge-DCMYGFJ2.js → bridge-XAK7JKMD.js} +41 -37
- package/chunks/{build-SSCNEHZZ.js → build-GHIZ4MSZ.js} +1 -1
- package/chunks/{ca-2SL2BXTK.js → ca-N6VVUFVB.js} +611 -201
- package/chunks/{channel-worker-group-53CMOPFT.js → channel-worker-group-LFBT7K64.js} +5 -5
- package/chunks/{channel-worker-manager-UTXILKC2.js → channel-worker-manager-3RUPERG2.js} +5 -5
- package/chunks/{channel-worker-supervisor-ZGO2W2MD.js → channel-worker-supervisor-A3KVATD3.js} +4 -4
- package/chunks/{chunk-C5L66QPF.js → chunk-27CLX4FV.js} +1 -1
- package/chunks/{chunk-2HOVDT7W.js → chunk-2LI23QA6.js} +1 -1
- package/chunks/chunk-2RFKHEXL.js +74 -0
- package/chunks/{chunk-5244PA32.js → chunk-3KQSDUK3.js} +3 -3
- package/chunks/{chunk-MEDHWB34.js → chunk-3LH5Q2AR.js} +8 -8
- package/chunks/{chunk-E6XTP5ZF.js → chunk-3SXF4GMQ.js} +1 -1
- package/chunks/chunk-43T5WDQ7.js +127 -0
- package/chunks/{chunk-6UTNZOZG.js → chunk-4BRH6FP5.js} +31 -6
- package/chunks/{chunk-NYMHN4ZK.js → chunk-4DSBFQMI.js} +2 -2
- package/chunks/{chunk-JD3MKVKL.js → chunk-4K56OJFJ.js} +1 -1
- package/chunks/{chunk-KTUQMDEP.js → chunk-4K7VDKAD.js} +1 -1
- package/chunks/{chunk-QKYTTBYW.js → chunk-4LVZNIDO.js} +1 -1
- package/chunks/{chunk-EKVLDUP4.js → chunk-52T5UHAZ.js} +2 -2
- package/chunks/{chunk-ZEOZL37W.js → chunk-57FIIFJN.js} +1 -1
- package/chunks/{chunk-SWRMKMVY.js → chunk-5EA5NVXS.js} +1 -1
- package/chunks/chunk-5G2SK2OO.js +20600 -0
- package/chunks/{chunk-6EFTQYW7.js → chunk-5I5BM454.js} +1 -1
- package/chunks/{chunk-GMGDLUC7.js → chunk-6IL7KRLE.js} +1 -1
- package/chunks/{chunk-26LLB6FM.js → chunk-6NHK6HS7.js} +2 -2
- package/chunks/{chunk-6UTRTWUF.js → chunk-6PRNSLMB.js} +11 -6
- package/chunks/chunk-6PVPNMXU.js +29 -0
- package/chunks/{chunk-BDBMYST4.js → chunk-6X4GWOPW.js} +1 -1
- package/chunks/{chunk-4ODB7WIB.js → chunk-6ZBPS62S.js} +1 -1
- package/chunks/{chunk-SMR34EQM.js → chunk-766HLFAG.js} +54 -33
- package/chunks/{chunk-J5CK6QYL.js → chunk-76OFFG6L.js} +137 -5
- package/chunks/{chunk-AU2GX7QQ.js → chunk-7LH6CHKG.js} +1 -1
- package/chunks/{chunk-A2F633L4.js → chunk-7NDXG4MB.js} +60 -35
- package/chunks/{chunk-QCCOKIGW.js → chunk-7SWFAKVH.js} +22 -22
- package/chunks/{chunk-AYCDXHZB.js → chunk-7Z6JQEL6.js} +1 -1
- package/chunks/{chunk-CMFMPPKV.js → chunk-AZD6KAV7.js} +3 -3
- package/chunks/{chunk-7YBZGNEC.js → chunk-BKZEHVPV.js} +176 -168
- package/chunks/{chunk-M2DASLLB.js → chunk-BWQRDISK.js} +1 -1
- package/chunks/{chunk-EELSDL62.js → chunk-BZAEENUV.js} +3 -3
- package/chunks/{chunk-DFQGFXMQ.js → chunk-CHXKGIMK.js} +1 -1
- package/chunks/{chunk-W2LKWG6I.js → chunk-D53NR4GO.js} +562 -301
- package/chunks/{chunk-P5OX37TK.js → chunk-D6ZOVZLF.js} +5 -1
- package/chunks/{chunk-NBMIC7DR.js → chunk-D7WXIW7H.js} +4 -4
- package/chunks/{chunk-VT3KBCIU.js → chunk-DPRMI6NU.js} +1 -1
- package/chunks/{chunk-JXWFXSLN.js → chunk-DRIXALGM.js} +2 -2
- package/chunks/{chunk-5SCI6E3E.js → chunk-E4IMU4Y5.js} +1 -1
- package/chunks/{chunk-EMMNRTQX.js → chunk-EC2ET5ZZ.js} +1 -1
- package/chunks/{chunk-NNDKJNCC.js → chunk-EFIOE2EH.js} +3 -3
- package/chunks/{chunk-7H2JMOPS.js → chunk-EWXXMRMP.js} +3 -3
- package/chunks/{chunk-NEEB7UEN.js → chunk-FFFM6NJV.js} +1 -2
- package/chunks/{chunk-3PG4G7SK.js → chunk-G6LRTI62.js} +4 -4
- package/chunks/{chunk-RTEHQUAD.js → chunk-GEB2CGUV.js} +11024 -7988
- package/chunks/{chunk-OONJNQ42.js → chunk-GPSKDNEE.js} +3 -3
- package/chunks/{chunk-FNGK2Z5B.js → chunk-H4AR2JQF.js} +3 -3
- package/chunks/chunk-HTR4WV6U.js +327 -0
- package/chunks/chunk-IS2SBY6T.js +2256 -0
- package/chunks/{chunk-G45X5TRN.js → chunk-JCW2R7WC.js} +1 -72
- package/chunks/{chunk-4E33SVWA.js → chunk-JHFVJQRO.js} +1 -1
- package/chunks/{chunk-BL7EEZ4Y.js → chunk-JIBBZH37.js} +27 -23
- package/chunks/{chunk-UJEZQ562.js → chunk-JJEFX6U5.js} +3 -3
- package/chunks/{chunk-UTBTCPKF.js → chunk-JKFHJK5U.js} +4 -4
- package/chunks/{chunk-XSSAJZXG.js → chunk-JO7FGOSY.js} +5 -5
- package/chunks/{chunk-CAKC64KX.js → chunk-JTUAAVUT.js} +2 -2
- package/chunks/{chunk-MAQQGNQ5.js → chunk-JYS55H6Z.js} +66 -7
- package/chunks/{chunk-D742634K.js → chunk-KDPIV6WC.js} +29 -2
- package/chunks/{chunk-EIAK6Q2B.js → chunk-KHOVYUHX.js} +2 -2
- package/chunks/{chunk-OLMETXLX.js → chunk-KQQ757OQ.js} +2 -2
- package/chunks/{chunk-7AB5URLY.js → chunk-KSZZBDVD.js} +165 -48
- package/chunks/chunk-KWK7UE6L.js +6194 -0
- package/chunks/{chunk-OOCI5VVU.js → chunk-LIZRAKPB.js} +1 -1
- package/chunks/{chunk-2T2FG7OX.js → chunk-LPMBFOWH.js} +73 -68
- package/chunks/{chunk-UNIQ7KNW.js → chunk-LYEKAAEH.js} +5 -5
- package/chunks/chunk-M7WBGLYP.js +151 -0
- package/chunks/{chunk-LB7ZIQ6C.js → chunk-MTSYH4MB.js} +3 -3
- package/chunks/{chunk-7YK65ZFC.js → chunk-N5ARKAVE.js} +8 -8
- package/chunks/chunk-NABLFI57.js +82 -0
- package/chunks/{chunk-PXVAFBEI.js → chunk-NNFK277W.js} +1 -1
- package/chunks/{chunk-467G3SV5.js → chunk-NPQDJGKU.js} +1 -1
- package/chunks/chunk-OQ5SYCPE.js +10017 -0
- package/chunks/{chunk-C27BYUX6.js → chunk-OQB4EXO4.js} +14 -11
- package/chunks/{chunk-WCPQTUDI.js → chunk-OUDZVU7H.js} +242 -1607
- package/chunks/{chunk-C44MIZ2K.js → chunk-PBED7USE.js} +1 -1
- package/chunks/{chunk-C5Z652G4.js → chunk-PIHKWN7M.js} +1 -1
- package/chunks/{chunk-NL37SKPP.js → chunk-PPIHLGNE.js} +2 -2
- package/chunks/{chunk-ORDXX5SE.js → chunk-PSVSP2OS.js} +6 -6
- package/chunks/{chunk-SKQD5RCT.js → chunk-Q2V2ADXF.js} +7 -7
- package/chunks/{chunk-JDI67JFB.js → chunk-Q2YKNMLS.js} +3 -3
- package/chunks/{chunk-L4PEDXOX.js → chunk-Q3GGJDYN.js} +5 -5
- package/chunks/{chunk-PBATSWUQ.js → chunk-QBUDF33N.js} +1 -1
- package/chunks/{chunk-OMH3276Y.js → chunk-QD6BRERJ.js} +7 -7
- package/chunks/{chunk-Y2ENGUD6.js → chunk-QKTHJXCS.js} +1 -1
- package/chunks/{chunk-BVLROR2T.js → chunk-QLJUC7TG.js} +1 -1
- package/chunks/{chunk-UEY4AYUL.js → chunk-QNLNLENL.js} +2 -2
- package/chunks/{chunk-2F7HITKF.js → chunk-QSJ6JIF5.js} +4 -4
- package/chunks/{chunk-2R7OXGYM.js → chunk-QUHJRRUA.js} +126 -30
- package/chunks/{chunk-WJYCCJ3Q.js → chunk-R3BCL5XW.js} +10 -4
- package/chunks/{chunk-YXBZOR3D.js → chunk-R7MPKABX.js} +307 -86
- package/chunks/{chunk-RFIAR4YL.js → chunk-RV4C2ZFG.js} +1 -1
- package/chunks/{chunk-NIJEXGV6.js → chunk-RVLZCXEE.js} +79 -10
- package/chunks/{chunk-NRPP5TOB.js → chunk-RYSMKY43.js} +4 -4
- package/chunks/{chunk-XBAYQWDL.js → chunk-S3YQCNJE.js} +3 -3
- package/chunks/{chunk-3P4TUBON.js → chunk-SP32MK6J.js} +2 -2
- package/chunks/{chunk-JNWZQ27S.js → chunk-SP5WRGVG.js} +3 -3
- package/chunks/{chunk-FSL5W5TI.js → chunk-T2L47JJK.js} +3 -3
- package/chunks/{chunk-TB6UDU4T.js → chunk-THJNPLI4.js} +16 -16
- package/chunks/{chunk-3XZIXCJY.js → chunk-TPR35HHZ.js} +6 -6
- package/chunks/{chunk-L4BZXQR3.js → chunk-TXRKCFWS.js} +6 -6
- package/chunks/chunk-U7ZFW55U.js +2098 -0
- package/chunks/{chunk-W7H223ZZ.js → chunk-UGYMA4EI.js} +1 -1
- package/chunks/{chunk-X6YQWCIJ.js → chunk-UH3WSE5L.js} +13 -1
- package/chunks/{chunk-R3VWUU2E.js → chunk-VYPFXUCB.js} +1 -1
- package/chunks/{chunk-IMVIN5UC.js → chunk-WCFTQD7H.js} +11 -11
- package/chunks/chunk-WHGVTP7Q.js +1049 -0
- package/chunks/{chunk-PC2QR5QO.js → chunk-WML6JOGQ.js} +31 -19
- package/chunks/{chunk-D2VIDMVM.js → chunk-X6N25LXS.js} +2 -2
- package/chunks/{chunk-YHRBVZ53.js → chunk-X7XWGRDT.js} +4 -4
- package/chunks/chunk-XHATNRQA.js +1500 -0
- package/chunks/{chunk-2RDNKVZ2.js → chunk-Y2DAH52F.js} +7 -6
- package/chunks/{chunk-S35ZDXOS.js → chunk-YM3SZTH4.js} +2 -1
- package/chunks/{chunk-GKY2OJ7R.js → chunk-ZHERRXZJ.js} +1 -1
- package/chunks/{computer-use-KQVQD3IW.js → computer-use-MV4K6WJM.js} +41 -37
- package/chunks/{config-utils-6FXFJUYB.js → config-utils-WYUQ7II4.js} +3 -3
- package/chunks/{contextCommand-IOC5HY6R.js → contextCommand-TQD36VNX.js} +38 -34
- package/chunks/{create-sub-session-X5RVIHCK.js → create-sub-session-AZ77LBL3.js} +3 -3
- package/chunks/{create-sub-session-IOAGEN3O.js → create-sub-session-JOW4BKMC.js} +36 -32
- package/chunks/{cron-create-AC5FFLN7.js → cron-create-KTWJM7QT.js} +5 -5
- package/chunks/{cron-delete-JEB3FAHA.js → cron-delete-2P3I5ULL.js} +5 -5
- package/chunks/{cron-list-NBYPCNIB.js → cron-list-PXDPGEDQ.js} +5 -5
- package/chunks/{daemon-RG2MAI6T.js → daemon-KLPTQIE4.js} +138 -81
- package/chunks/daemon-status-provider-TII4SMCZ.js +81 -0
- package/chunks/{de-I7ZIYXZC.js → de-4IBXM7CN.js} +5 -1
- package/chunks/{dist-2BHAYBKP.js → dist-HMU6CYS4.js} +2 -2
- package/chunks/{dist-AU7NQQRP.js → dist-OAV7LJGJ.js} +1 -1
- package/chunks/{dist-FUTEXY6A.js → dist-OMW6WDEO.js} +1 -1
- package/chunks/{dist-2MIU4UUH.js → dist-PJLG2XYX.js} +1 -1
- package/chunks/{dist-53PZYC5B.js → dist-UIFWIFRO.js} +2 -2
- package/chunks/{dist-WGTQO7F2.js → dist-XRYV6TJP.js} +65 -25
- package/chunks/{earlyInputCapture-7AA4D4RF.js → earlyInputCapture-2V57RG6H.js} +37 -33
- package/chunks/{edit-RQXZUTEU.js → edit-TTUH7PWR.js} +43 -41
- package/chunks/{en-XE34GKAA.js → en-USMCCJAJ.js} +5 -1
- package/chunks/{enter-worktree-BPYKHGTX.js → enter-worktree-D4IVCXYB.js} +41 -37
- package/chunks/{enterPlanMode-VJ3KR5HM.js → enterPlanMode-WRUJTVYN.js} +47 -38
- package/chunks/{environment-PZYHWWG5.js → environment-SEPKXB2C.js} +38 -34
- package/chunks/{errors-NZ6JOKJB.js → errors-YSVGBLBU.js} +38 -34
- package/chunks/{exit-worktree-TZNABJPX.js → exit-worktree-MZ4JSSP6.js} +41 -37
- package/chunks/{exitPlanMode-RZMERKLI.js → exitPlanMode-HAZLSSOJ.js} +41 -37
- package/chunks/{fast-path-F5UWH7GI.js → fast-path-EVBVIE2U.js} +4 -3
- package/chunks/{fast-path-settings-DAOVFADC.js → fast-path-settings-XB3CPUJT.js} +2 -2
- package/chunks/{fr-X7KDVZIY.js → fr-WVHEBDDB.js} +5 -1
- package/chunks/{gemini-2QJRGIKD.js → gemini-APQ76464.js} +100 -95
- package/chunks/{geminiContentGenerator-Q7IAYVM4.js → geminiContentGenerator-LB4MA2LI.js} +5 -5
- package/chunks/{getMachineId-bsd-EXV7SWPA.js → getMachineId-bsd-QFVLPUPT.js} +1 -1
- package/chunks/{getMachineId-darwin-IUOMFXU3.js → getMachineId-darwin-DGMQQE2E.js} +1 -1
- package/chunks/{getMachineId-linux-K7XJYFHL.js → getMachineId-linux-R4Z6CSWC.js} +1 -1
- package/chunks/{getMachineId-unsupported-EA5FDRJ6.js → getMachineId-unsupported-Z3SBVBUV.js} +1 -1
- package/chunks/{getMachineId-win-KBA6RAI5.js → getMachineId-win-SCK5UFDT.js} +1 -1
- package/chunks/{glob-MP7IPPNS.js → glob-LABYMYKG.js} +43 -39
- package/chunks/{grep-OHN54Z7A.js → grep-HKIKJCAS.js} +43 -39
- package/chunks/{handleAutoUpdate-EGCO46FV.js → handleAutoUpdate-RWAAL2UM.js} +40 -36
- package/chunks/{i18n-4LK42EK5.js → i18n-ZUVDAJIJ.js} +37 -33
- package/chunks/{initializer-DAL5QAZU.js → initializer-7YUHIC36.js} +43 -39
- package/chunks/{installationInfo-HOKGVMMQ.js → installationInfo-DVEOMWDE.js} +39 -33
- package/chunks/{ja-2ICT3KXF.js → ja-KY4ROZTE.js} +5 -1
- package/chunks/{keychain-token-storage-DWRJMNH3.js → keychain-token-storage-6ACJDYIB.js} +3 -3
- package/chunks/list-WHCZSIR2.js +82 -0
- package/chunks/{loadedSettingsAdapter-I42UOUE7.js → loadedSettingsAdapter-YCWN6AK3.js} +42 -38
- package/chunks/{loop-wakeup-HMHCT5GU.js → loop-wakeup-RNMRVA66.js} +6 -6
- package/chunks/{ls-IW5HYDG4.js → ls-J2ZI5XYK.js} +5 -5
- package/chunks/{lsp-4RL52YIZ.js → lsp-UMS3NUB5.js} +3 -3
- package/chunks/managed-npm-update-PG3463CJ.js +333 -0
- package/chunks/{mcp-62XOYOXZ.js → mcp-VLHDCKAN.js} +42 -38
- package/chunks/{monitor-YIHFTVM7.js → monitor-GG4F4YM6.js} +41 -37
- package/chunks/nonInteractiveCli-UYXYV4YX.js +133 -0
- package/chunks/{notebook-edit-XK4J36D3.js → notebook-edit-US4VLN6Q.js} +44 -42
- package/chunks/{openaiContentGenerator-OEIKDARY.js → openaiContentGenerator-CVEDTMDB.js} +20 -18
- package/chunks/{pidfile-2XVZMMKS.js → pidfile-QQ45OIOY.js} +37 -33
- package/chunks/{processUtils-SYFMMDPV.js → processUtils-3WMHLQE5.js} +2 -2
- package/chunks/{pt-JJ4XPIBP.js → pt-OK455PLH.js} +5 -1
- package/chunks/{qwenContentGenerator-LTTPUWV3.js → qwenContentGenerator-Y2GRNYZQ.js} +42 -38
- package/chunks/{qwenOAuth2-U3X6UBDP.js → qwenOAuth2-J2X6E5VO.js} +18 -16
- package/chunks/{read-file-P6IEAOBS.js → read-file-C7Z266CU.js} +13 -11
- package/chunks/{read-mcp-resource-OIBCNIX7.js → read-mcp-resource-F6HYMDUY.js} +3 -3
- package/chunks/{record-artifact-HDMK4LHG.js → record-artifact-7GCFLDD7.js} +3 -3
- package/chunks/{resumeHistoryUtils-WMJ5TUPF.js → resumeHistoryUtils-KBQWX77U.js} +43 -39
- package/chunks/{ripGrep-US5HKBSM.js → ripGrep-RW26MTQ3.js} +36 -32
- package/chunks/{ru-STR4KTW7.js → ru-7SPDGMGD.js} +5 -1
- package/chunks/{run-qwen-serve-MIFJODT4.js → run-qwen-serve-MXFMOMEL.js} +104 -82
- package/chunks/{runtime-SK5QH53T.js → runtime-APNO3V6D.js} +48 -42
- package/chunks/{scheduler-4TIUONHH.js → scheduler-L6FYCGVO.js} +36 -32
- package/chunks/sdk-exporters-grpc-ETLH47EP.js +23214 -0
- package/chunks/sdk-exporters-http-IDGLRBGP.js +563 -0
- package/chunks/sdk-impl-5ESZBGJQ.js +9186 -0
- package/chunks/{send-message-WXVVK4DB.js → send-message-PYIJ2PZL.js} +6 -4
- package/chunks/{serve-F6VZULAL.js → serve-6QBXDVWT.js} +42 -38
- package/chunks/{server-UJEZDWGO.js → server-5TJJEMVQ.js} +1006 -305
- package/chunks/{session-PFCYZOZJ.js → session-BWEUHKQB.js} +92 -176
- package/chunks/{settings-7UHALRNO.js → settings-O7IUQNRR.js} +45 -41
- package/chunks/{shell-DY7EASPT.js → shell-R5L4NQYY.js} +36 -32
- package/chunks/{skill-DOZBVXRT.js → skill-ITEOSNW6.js} +24 -20
- package/chunks/{spawnChannel-HT7EQ4SL.js → spawnChannel-E7NTWSGW.js} +38 -34
- package/chunks/{src-VJO75DQQ.js → src-FFXGUTNL.js} +303 -237
- package/chunks/{standalone-update-5ERAJGLE.js → standalone-update-JCJOXW4P.js} +38 -34
- package/chunks/{startInteractiveUI-HYMIOBH7.js → startInteractiveUI-IJSBLZFO.js} +1057 -864
- package/chunks/{syntheticOutput-HCUFXSIA.js → syntheticOutput-H7RTI5KL.js} +4 -4
- package/chunks/{task-create-RIY5JTFC.js → task-create-7474AJJD.js} +10 -8
- package/chunks/{task-list-XBUCV3CO.js → task-list-633HGOIB.js} +6 -6
- package/chunks/{task-stop-QDFCCYR5.js → task-stop-MNUGHPIA.js} +3 -3
- package/chunks/{task-update-7PXKJQOI.js → task-update-66GQB5LI.js} +10 -8
- package/chunks/{team-create-NF3FCZE2.js → team-create-OVSZTJZO.js} +44 -40
- package/chunks/{team-delete-TNSSE2S5.js → team-delete-BB3CG3QF.js} +6 -6
- package/chunks/{team-plan-approval-P5U7U4NW.js → team-plan-approval-SLEVDLT5.js} +41 -37
- package/chunks/{theme-manager-WD73RXOX.js → theme-manager-V6ZQISHM.js} +37 -33
- package/chunks/{todoWrite-OMAIGB6V.js → todoWrite-KRAUN54W.js} +5 -5
- package/chunks/{tool-search-TDMA733L.js → tool-search-KYIF6C6E.js} +21 -17
- package/chunks/{total-session-admission-H3XZPCNC.js → total-session-admission-EU77XTL7.js} +42 -38
- package/chunks/{tree-sitter-VJEPTDMU.js → tree-sitter-4D7QS7F6.js} +1 -1
- package/chunks/{tree-sitter-bash-WFKBO43W.js → tree-sitter-bash-VEJGF5XF.js} +1 -1
- package/chunks/{trustedFolders-NEFWXHU2.js → trustedFolders-DDEF3ADH.js} +37 -33
- package/chunks/{update-relaunch-T2XQQC4W.js → update-relaunch-XEZTDP6K.js} +17 -17
- package/chunks/updateCheck-KZ5LZ545.js +89 -0
- package/chunks/{useAutoAcceptIndicator-5FLFR3BY.js → useAutoAcceptIndicator-47EZERGQ.js} +47 -43
- package/chunks/{validateNonInterActiveAuth-Z23SJ4D4.js → validateNonInterActiveAuth-J2DM4LWZ.js} +79 -75
- package/chunks/{version-PLKW23RX.js → version-PN7WYXHP.js} +1 -1
- package/chunks/{web-fetch-QNI3EEXN.js → web-fetch-WRI5QRFR.js} +100 -42
- package/chunks/{web-search-DLYTQBNN.js → web-search-2HCXNAVX.js} +111 -60
- package/chunks/{workflow-A3WFSQKU.js → workflow-U5XBPGQZ.js} +48 -43
- package/chunks/{workspace-providers-status-6K34OJLQ.js → workspace-providers-status-2T54GIJZ.js} +45 -41
- package/chunks/{workspace-registration-store-6FPLTQG3.js → workspace-registration-store-F3V4KBIW.js} +8 -2
- package/chunks/{workspace-registry-JZRIJXJS.js → workspace-registry-U6QVZ5BU.js} +42 -38
- package/chunks/{workspace-service-PQDLBZV3.js → workspace-service-734D36QD.js} +49 -45
- package/chunks/{workspace-skills-status-RKCPZVT2.js → workspace-skills-status-5ABUKOAQ.js} +43 -39
- package/chunks/write-file-CIH4I4CS.js +66 -0
- package/chunks/{zh-TW-4RR3YHNN.js → zh-TW-BM47YBFH.js} +5 -1
- package/chunks/{zh-6ANG2HTL.js → zh-WY5DWYZD.js} +5 -1
- package/cli-entry.js +164 -12
- package/cli.js +18 -11
- package/locales/ca.js +772 -203
- package/locales/de.js +8 -2
- package/locales/en.js +8 -2
- package/locales/fr.js +8 -2
- package/locales/ja.js +8 -2
- package/locales/pt.js +8 -2
- package/locales/ru.js +8 -2
- package/locales/zh-TW.js +8 -2
- package/locales/zh.js +8 -2
- package/package.json +3 -3
- package/web-shell/assets/{arc-Buk1besA.js → arc-ByltRugA.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-B1aUKYDC.js → architectureDiagram-3BPJPVTR-CCRTto5d.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-CRTdg3Zx.js → blockDiagram-GPEHLZMM-Jfy36u1L.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-DFdRMp5g.js → c4Diagram-AAUBKEIU-4d5FfEZ0.js} +1 -1
- package/web-shell/assets/channel-4N2UIFcG.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-4rYQdkEI.js → chunk-2J33WTMH-BPwxCEro.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-Coi-pQJy.js → chunk-4BX2VUAB-jY7ZmJWY.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-BtBjz02t.js → chunk-55IACEB6-C98HgCsS.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-CGYOWorl.js → chunk-727SXJPM-cDu-ge-q.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-CH5AKhqx.js → chunk-AQP2D5EJ-BKdJwxXK.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-Cd50-w85.js → chunk-FMBD7UC4-DnuxqwMu.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-C2wF3KCK.js → chunk-ND2GUHAM-C4fZNPv0.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-pCeRTaWi.js → chunk-QZHKN3VN-Cf4XWOmz.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-Q4dYOtsh.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Q4dYOtsh.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-B-_fAB6D.js → cose-bilkent-S5V4N54A-C82mFiqj.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-ChSPNHpL.js → dagre-BM42HDAG-Df8KACER.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-BX7cFOF3.js → diagram-2AECGRRQ-EzNs7s_2.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-BQUTW92n.js → diagram-5GNKFQAL-BRLNvreg.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-BkYPh3e4.js → diagram-KO2AKTUF-2HLYHRjC.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-Cl6jsNyx.js → diagram-LMA3HP47-DeH0NzSp.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-DRWoHz8n.js → diagram-OG6HWLK6-k5Gn47-G.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-CGvFcZco.js → erDiagram-TEJ5UH35-gPHFo79f.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-vms6oVdv.js → flowDiagram-I6XJVG4X-DYBOiTRW.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-ukT_sfmi.js → ganttDiagram-6RSMTGT7-cxjAuic9.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Bn2ZE2Ut.js → gitGraphDiagram-PVQCEYII-3nPqpmCP.js} +1 -1
- package/web-shell/assets/index-B7jzUZ_s.css +5 -0
- package/web-shell/assets/{index-wFXp7W68.js → index-Cl8d-1bK.js} +1 -1
- package/web-shell/assets/index-gE8OWwj_.js +1197 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-DHJdSi7x.js → infoDiagram-5YYISTIA-Dph21pR5.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DOvd2Wph.js → ishikawaDiagram-YF4QCWOH-Cjg1hSaG.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-CH_urMCT.js → journeyDiagram-JHISSGLW-CR-IzvnU.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-FKiBdgbH.js → kanban-definition-UN3LZRKU-BYmuybuC.js} +1 -1
- package/web-shell/assets/{linear-0ZVQFVKf.js → linear-CngEEoy8.js} +1 -1
- package/web-shell/assets/{mermaid.core-DJ05ZZIK.js → mermaid.core-G6fbZRPf.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-BPuUhkUm.js → mindmap-definition-RKZ34NQL-BtnqnUwJ.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-yLFKcXyG.js → pieDiagram-4H26LBE5-XTq6UHIA.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-irWqc1pE.js → quadrantDiagram-W4KKPZXB-D1J5PrsS.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-B_4uMoIV.js → requirementDiagram-4Y6WPE33-CLcBUy3t.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-ciA4GPwk.js → sankeyDiagram-5OEKKPKP-iwKV02_6.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CRdZvy0U.js → sequenceDiagram-3UESZ5HK-7NFYQcEX.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-DaYIkCCn.js → stateDiagram-AJRCARHV-Bvm4Wih6.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-xXU_zO2Z.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-oBUKv6iH.js → timeline-definition-PNZ67QCA-B4FZFE9O.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-CGW9Sdmb.js → vennDiagram-CIIHVFJN-CvMBpmtL.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-CvwKJOCm.js → wardley-L42UT6IY-E3ag2327.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-Ipc260sN.js → wardleyDiagram-YWT4CUSO-BEXWlgxC.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-D6-CM7pK.js → xychartDiagram-2RQKCTM6-CICK05gI.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/chunk-6YS6TQB3.js +0 -45
- package/chunks/chunk-ETD6K42I.js +0 -358
- package/chunks/chunk-HAL7YT4M.js +0 -74639
- package/chunks/chunk-W7FJ3N32.js +0 -49
- package/chunks/daemon-status-provider-DYDVT4S5.js +0 -77
- package/chunks/list-M5NNXMQQ.js +0 -78
- package/chunks/nonInteractiveCli-Z73R2B3B.js +0 -129
- package/chunks/updateCheck-G5JYMVJZ.js +0 -73
- package/chunks/write-file-LHZENZ2A.js +0 -599
- package/web-shell/assets/channel-04R0vLbG.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-Bw9SOwAV.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Bw9SOwAV.js +0 -1
- package/web-shell/assets/index-DgkKrjw3.js +0 -1187
- package/web-shell/assets/index-Rv6mOAN9.css +0 -5
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DWBoO4UY.js +0 -1
- package/chunks/{chunk-PEJWA3QQ.js → chunk-QZJY47IE.js} +5 -5
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
buildPermissionSuggestions
|
|
5
|
+
} from "./chunk-43T5WDQ7.js";
|
|
6
|
+
import {
|
|
7
|
+
startPostRenderPrefetches
|
|
8
|
+
} from "./chunk-JIBBZH37.js";
|
|
9
|
+
import {
|
|
10
|
+
stopAndGetCapturedInput
|
|
11
|
+
} from "./chunk-E4IMU4Y5.js";
|
|
12
|
+
import {
|
|
13
|
+
useAutoAcceptIndicator
|
|
14
|
+
} from "./chunk-BZAEENUV.js";
|
|
3
15
|
import {
|
|
4
16
|
classifyApiError
|
|
5
17
|
} from "./chunk-V7RNNPGC.js";
|
|
6
18
|
import {
|
|
7
19
|
TUI_CHAT_RECORDING_FAILURE_MESSAGE,
|
|
8
20
|
reportChatRecordingFailureToAdapter
|
|
9
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-SP32MK6J.js";
|
|
10
22
|
import {
|
|
11
23
|
MAX_SUGGESTIONS_TO_SHOW,
|
|
12
24
|
buildMcpResourceRef,
|
|
@@ -16,10 +28,10 @@ import {
|
|
|
16
28
|
matchMcpServerPrefix,
|
|
17
29
|
resolveAtCommandQuery,
|
|
18
30
|
sanitizeDisplayText
|
|
19
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-X7XWGRDT.js";
|
|
20
32
|
import {
|
|
21
33
|
StreamJsonOutputAdapter
|
|
22
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-Q3GGJDYN.js";
|
|
23
35
|
import {
|
|
24
36
|
BuiltinCommandLoader,
|
|
25
37
|
BundledSkillLoader,
|
|
@@ -55,16 +67,20 @@ import {
|
|
|
55
67
|
resetBackgroundStateForSessionSwitch,
|
|
56
68
|
serializeUserPromptExpansionPrompt,
|
|
57
69
|
supportsMatchers
|
|
58
|
-
} from "./chunk-
|
|
59
|
-
import {
|
|
60
|
-
startPostRenderPrefetches
|
|
61
|
-
} from "./chunk-BL7EEZ4Y.js";
|
|
70
|
+
} from "./chunk-LPMBFOWH.js";
|
|
62
71
|
import {
|
|
63
72
|
EXTENSION_RELOAD_FAILED_REASON,
|
|
64
73
|
ExtensionRefreshState,
|
|
65
74
|
appEvents,
|
|
75
|
+
cleanupReviewWorktreeLeases,
|
|
66
76
|
loadHierarchicalGeminiMemory
|
|
67
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-D53NR4GO.js";
|
|
78
|
+
import {
|
|
79
|
+
disableKittyProtocol,
|
|
80
|
+
isKittyProtocolEnabled,
|
|
81
|
+
isKittyProtocolSupported
|
|
82
|
+
} from "./chunk-5DTTYNB7.js";
|
|
83
|
+
import "./chunk-3LH5Q2AR.js";
|
|
68
84
|
import {
|
|
69
85
|
AboutBox,
|
|
70
86
|
BaseSelectionList,
|
|
@@ -140,20 +156,41 @@ import {
|
|
|
140
156
|
useTextBuffer,
|
|
141
157
|
useUIActions,
|
|
142
158
|
useUIState
|
|
143
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-KSZZBDVD.js";
|
|
160
|
+
import {
|
|
161
|
+
KeypressProvider,
|
|
162
|
+
useFocus,
|
|
163
|
+
useKeypress,
|
|
164
|
+
useKeypressContext
|
|
165
|
+
} from "./chunk-Q2V2ADXF.js";
|
|
144
166
|
import {
|
|
145
167
|
getCommandDisplayName,
|
|
146
168
|
getCommandSourceBadge
|
|
147
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-PBED7USE.js";
|
|
148
170
|
import {
|
|
149
171
|
computeSessionStats,
|
|
150
172
|
levelLabel
|
|
151
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-JTUAAVUT.js";
|
|
174
|
+
import {
|
|
175
|
+
BEL,
|
|
176
|
+
OSC_PREFIX,
|
|
177
|
+
cleanupOldClipboardImages,
|
|
178
|
+
clipboardHasImage,
|
|
179
|
+
detectTerminal,
|
|
180
|
+
generateKittyId,
|
|
181
|
+
oscGhosttyNotify,
|
|
182
|
+
oscITerm2Notify,
|
|
183
|
+
oscKittyNotify,
|
|
184
|
+
saveClipboardImage,
|
|
185
|
+
wrapForMultiplexer,
|
|
186
|
+
writeOsc52
|
|
187
|
+
} from "./chunk-4LVZNIDO.js";
|
|
188
|
+
import "./chunk-4WGODMVR.js";
|
|
152
189
|
import {
|
|
153
190
|
MaxSizedBox,
|
|
154
191
|
OverflowProvider,
|
|
155
192
|
useOverflowState
|
|
156
|
-
} from "./chunk-
|
|
193
|
+
} from "./chunk-SP5WRGVG.js";
|
|
157
194
|
import {
|
|
158
195
|
GeminiRespondingSpinner,
|
|
159
196
|
GeminiSpinner,
|
|
@@ -166,56 +203,13 @@ import {
|
|
|
166
203
|
expandCollapsedHistory,
|
|
167
204
|
isCollapsibleTool,
|
|
168
205
|
useStreamingContext
|
|
169
|
-
} from "./chunk-
|
|
206
|
+
} from "./chunk-PSVSP2OS.js";
|
|
170
207
|
import {
|
|
171
208
|
theme
|
|
172
|
-
} from "./chunk-
|
|
173
|
-
import {
|
|
174
|
-
stopAndGetCapturedInput
|
|
175
|
-
} from "./chunk-5SCI6E3E.js";
|
|
176
|
-
import {
|
|
177
|
-
disableKittyProtocol,
|
|
178
|
-
isKittyProtocolEnabled,
|
|
179
|
-
isKittyProtocolSupported
|
|
180
|
-
} from "./chunk-5DTTYNB7.js";
|
|
181
|
-
import {
|
|
182
|
-
useAutoAcceptIndicator
|
|
183
|
-
} from "./chunk-EELSDL62.js";
|
|
184
|
-
import {
|
|
185
|
-
KeypressProvider,
|
|
186
|
-
useFocus,
|
|
187
|
-
useKeypress,
|
|
188
|
-
useKeypressContext
|
|
189
|
-
} from "./chunk-SKQD5RCT.js";
|
|
190
|
-
import {
|
|
191
|
-
BEL,
|
|
192
|
-
OSC_PREFIX,
|
|
193
|
-
cleanupOldClipboardImages,
|
|
194
|
-
clipboardHasImage,
|
|
195
|
-
detectTerminal,
|
|
196
|
-
generateKittyId,
|
|
197
|
-
oscGhosttyNotify,
|
|
198
|
-
oscITerm2Notify,
|
|
199
|
-
oscKittyNotify,
|
|
200
|
-
saveClipboardImage,
|
|
201
|
-
wrapForMultiplexer,
|
|
202
|
-
writeOsc52
|
|
203
|
-
} from "./chunk-QKYTTBYW.js";
|
|
209
|
+
} from "./chunk-6IL7KRLE.js";
|
|
204
210
|
import {
|
|
205
211
|
require_jsx_runtime
|
|
206
212
|
} from "./chunk-SV5PQVQE.js";
|
|
207
|
-
import "./chunk-MEDHWB34.js";
|
|
208
|
-
import "./chunk-4WGODMVR.js";
|
|
209
|
-
import {
|
|
210
|
-
setUpdateHandler
|
|
211
|
-
} from "./chunk-SMR34EQM.js";
|
|
212
|
-
import "./chunk-UNIQ7KNW.js";
|
|
213
|
-
import {
|
|
214
|
-
AUTO_THEME_NAME,
|
|
215
|
-
DEFAULT_THEME,
|
|
216
|
-
themeManager
|
|
217
|
-
} from "./chunk-AYCDXHZB.js";
|
|
218
|
-
import "./chunk-KW7NOTN6.js";
|
|
219
213
|
import {
|
|
220
214
|
Box_default,
|
|
221
215
|
Static,
|
|
@@ -229,32 +223,43 @@ import {
|
|
|
229
223
|
use_is_screen_reader_enabled_default,
|
|
230
224
|
use_stdin_default,
|
|
231
225
|
use_stdout_default
|
|
232
|
-
} from "./chunk-
|
|
226
|
+
} from "./chunk-FFFM6NJV.js";
|
|
233
227
|
import {
|
|
234
228
|
require_react
|
|
235
229
|
} from "./chunk-5QWWOFGG.js";
|
|
236
|
-
import "./chunk-
|
|
237
|
-
import {
|
|
238
|
-
getErrorMessage as getErrorMessage2
|
|
239
|
-
} from "./chunk-LB7ZIQ6C.js";
|
|
240
|
-
import "./chunk-WCPQTUDI.js";
|
|
230
|
+
import "./chunk-OUDZVU7H.js";
|
|
241
231
|
import "./chunk-NHDKSOEY.js";
|
|
242
|
-
import "./chunk-D742634K.js";
|
|
243
|
-
import "./chunk-5244PA32.js";
|
|
244
|
-
import "./chunk-YAF2MQZ6.js";
|
|
245
232
|
import {
|
|
246
233
|
relaunchApp
|
|
247
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-CHXKGIMK.js";
|
|
235
|
+
import {
|
|
236
|
+
setUpdateHandler
|
|
237
|
+
} from "./chunk-766HLFAG.js";
|
|
238
|
+
import "./chunk-3KQSDUK3.js";
|
|
239
|
+
import "./chunk-YAF2MQZ6.js";
|
|
240
|
+
import "./chunk-LYEKAAEH.js";
|
|
241
|
+
import {
|
|
242
|
+
AUTO_THEME_NAME,
|
|
243
|
+
DEFAULT_THEME,
|
|
244
|
+
themeManager
|
|
245
|
+
} from "./chunk-7Z6JQEL6.js";
|
|
246
|
+
import "./chunk-KW7NOTN6.js";
|
|
247
|
+
import "./chunk-R3BCL5XW.js";
|
|
248
|
+
import "./chunk-6H67XLET.js";
|
|
249
|
+
import "./chunk-JKFHJK5U.js";
|
|
250
|
+
import {
|
|
251
|
+
getErrorMessage as getErrorMessage2
|
|
252
|
+
} from "./chunk-MTSYH4MB.js";
|
|
248
253
|
import {
|
|
249
254
|
openQwenAsrRealtimeStream,
|
|
250
255
|
openVoiceStream,
|
|
251
256
|
openVoiceStreamWithRetry
|
|
252
|
-
} from "./chunk-
|
|
257
|
+
} from "./chunk-ZHERRXZJ.js";
|
|
253
258
|
import {
|
|
254
259
|
recordGoalStatusItem,
|
|
255
260
|
restoreGoalFromHistory
|
|
256
|
-
} from "./chunk-
|
|
257
|
-
import "./chunk-
|
|
261
|
+
} from "./chunk-6PRNSLMB.js";
|
|
262
|
+
import "./chunk-4K7VDKAD.js";
|
|
258
263
|
import {
|
|
259
264
|
cpLen,
|
|
260
265
|
cpSlice,
|
|
@@ -267,67 +272,64 @@ import {
|
|
|
267
272
|
stripUnsafeCharacters,
|
|
268
273
|
toCodePoints
|
|
269
274
|
} from "./chunk-RS7MT2QG.js";
|
|
270
|
-
import "./chunk-
|
|
275
|
+
import "./chunk-NNFK277W.js";
|
|
271
276
|
import {
|
|
272
277
|
stringWidth
|
|
273
278
|
} from "./chunk-H2XVO6NE.js";
|
|
279
|
+
import "./chunk-QHTIBUWB.js";
|
|
274
280
|
import {
|
|
275
281
|
isHistoryItemVisibleAfterRestore
|
|
276
282
|
} from "./chunk-QTERJVPZ.js";
|
|
277
|
-
import "./chunk-QHTIBUWB.js";
|
|
278
283
|
import "./chunk-L573Z2QZ.js";
|
|
279
284
|
import "./chunk-RXFQM6FQ.js";
|
|
280
|
-
import "./chunk-WJYCCJ3Q.js";
|
|
281
|
-
import "./chunk-6H67XLET.js";
|
|
282
|
-
import {
|
|
283
|
-
createLoadedSettingsAdapter
|
|
284
|
-
} from "./chunk-EMMNRTQX.js";
|
|
285
285
|
import {
|
|
286
286
|
getExtendedSystemInfo
|
|
287
|
-
} from "./chunk-
|
|
287
|
+
} from "./chunk-QSJ6JIF5.js";
|
|
288
288
|
import {
|
|
289
289
|
formatDuration,
|
|
290
290
|
formatMemoryUsage,
|
|
291
291
|
formatRelativeTime,
|
|
292
292
|
formatTokenCount
|
|
293
293
|
} from "./chunk-E5Z2AVNV.js";
|
|
294
|
-
import "./chunk-6RLROE6G.js";
|
|
295
|
-
import "./chunk-COH43MRJ.js";
|
|
296
294
|
import {
|
|
297
295
|
isInlineModelOverrideAllowed
|
|
298
|
-
} from "./chunk-
|
|
296
|
+
} from "./chunk-TPR35HHZ.js";
|
|
299
297
|
import {
|
|
300
298
|
assertVoiceBaseUrlNetworkAllowed,
|
|
301
299
|
isKeytermEcho,
|
|
302
300
|
isStreamingVoiceModel,
|
|
303
301
|
resolveVoiceStreamConfig,
|
|
304
302
|
transcribeVoiceAudio
|
|
305
|
-
} from "./chunk-
|
|
303
|
+
} from "./chunk-EFIOE2EH.js";
|
|
306
304
|
import {
|
|
307
305
|
formatUnsupportedVoiceModelMessage,
|
|
308
306
|
isSelectableVoiceModel
|
|
309
|
-
} from "./chunk-
|
|
310
|
-
import "./chunk-
|
|
311
|
-
import "./chunk-
|
|
307
|
+
} from "./chunk-3SXF4GMQ.js";
|
|
308
|
+
import "./chunk-QLJUC7TG.js";
|
|
309
|
+
import "./chunk-4BRH6FP5.js";
|
|
312
310
|
import {
|
|
313
311
|
requestConsentInteractive,
|
|
314
312
|
requestConsentOrFail
|
|
315
|
-
} from "./chunk-
|
|
313
|
+
} from "./chunk-G6LRTI62.js";
|
|
316
314
|
import "./chunk-57OAHC2Y.js";
|
|
317
|
-
import "./chunk-
|
|
318
|
-
import "./chunk-
|
|
315
|
+
import "./chunk-QD6BRERJ.js";
|
|
316
|
+
import "./chunk-6ZBPS62S.js";
|
|
319
317
|
import "./chunk-V6WHFGST.js";
|
|
320
318
|
import {
|
|
321
|
-
|
|
322
|
-
} from "./chunk-
|
|
323
|
-
import "./chunk-
|
|
324
|
-
import "./chunk-
|
|
319
|
+
createLoadedSettingsAdapter
|
|
320
|
+
} from "./chunk-EC2ET5ZZ.js";
|
|
321
|
+
import "./chunk-6RLROE6G.js";
|
|
322
|
+
import "./chunk-COH43MRJ.js";
|
|
323
|
+
import "./chunk-QKTHJXCS.js";
|
|
325
324
|
import "./chunk-TJTKSVIV.js";
|
|
326
325
|
import "./chunk-M5GB774H.js";
|
|
327
|
-
import "./chunk-
|
|
328
|
-
import "./chunk-
|
|
329
|
-
import "./chunk-
|
|
326
|
+
import "./chunk-RV4C2ZFG.js";
|
|
327
|
+
import "./chunk-2LI23QA6.js";
|
|
328
|
+
import "./chunk-RVLZCXEE.js";
|
|
330
329
|
import "./chunk-UDXSXLER.js";
|
|
330
|
+
import {
|
|
331
|
+
loadMcpApprovals
|
|
332
|
+
} from "./chunk-Y2DAH52F.js";
|
|
331
333
|
import {
|
|
332
334
|
CORRUPTED_SUFFIX,
|
|
333
335
|
SettingScope,
|
|
@@ -350,27 +352,31 @@ import {
|
|
|
350
352
|
settingExistsInScope,
|
|
351
353
|
validateSettingValue,
|
|
352
354
|
writeOutputLanguageAndRegisterPath
|
|
353
|
-
} from "./chunk-
|
|
355
|
+
} from "./chunk-7SWFAKVH.js";
|
|
354
356
|
import "./chunk-RKUWKYED.js";
|
|
355
|
-
import "./chunk-GOXKNSDZ.js";
|
|
356
|
-
import "./chunk-IDS7MSUP.js";
|
|
357
357
|
import {
|
|
358
358
|
getCurrentLanguage,
|
|
359
359
|
localizeToolDisplayName,
|
|
360
360
|
t,
|
|
361
361
|
ta
|
|
362
|
-
} from "./chunk-
|
|
363
|
-
import "./chunk-
|
|
362
|
+
} from "./chunk-WCFTQD7H.js";
|
|
363
|
+
import "./chunk-52T5UHAZ.js";
|
|
364
|
+
import "./chunk-XHATNRQA.js";
|
|
365
|
+
import "./chunk-KDPIV6WC.js";
|
|
366
|
+
import "./chunk-GOXKNSDZ.js";
|
|
364
367
|
import "./chunk-QRUIS3DN.js";
|
|
368
|
+
import "./chunk-2RFKHEXL.js";
|
|
369
|
+
import "./chunk-IDS7MSUP.js";
|
|
370
|
+
import "./chunk-XFSFZCM5.js";
|
|
365
371
|
import "./chunk-URK542T4.js";
|
|
366
372
|
import {
|
|
367
373
|
getCliVersion
|
|
368
|
-
} from "./chunk-
|
|
374
|
+
} from "./chunk-27CLX4FV.js";
|
|
369
375
|
import "./chunk-VJNBRRZG.js";
|
|
370
376
|
import {
|
|
371
377
|
isWorkspaceTrusted,
|
|
372
378
|
loadTrustedFolders
|
|
373
|
-
} from "./chunk-
|
|
379
|
+
} from "./chunk-S3YQCNJE.js";
|
|
374
380
|
import {
|
|
375
381
|
require_strip_json_comments
|
|
376
382
|
} from "./chunk-ALGGS7UH.js";
|
|
@@ -379,7 +385,6 @@ import {
|
|
|
379
385
|
clearScreen,
|
|
380
386
|
writeStderrLine
|
|
381
387
|
} from "./chunk-OWAK7LMW.js";
|
|
382
|
-
import "./chunk-XFSFZCM5.js";
|
|
383
388
|
import {
|
|
384
389
|
ALIBABA_PROVIDERS,
|
|
385
390
|
AsyncFzf,
|
|
@@ -430,6 +435,7 @@ import {
|
|
|
430
435
|
detectAutonomousSentinel,
|
|
431
436
|
fetchGitDiff,
|
|
432
437
|
fetchGitDiffHunks,
|
|
438
|
+
finalizeToolResponses,
|
|
433
439
|
findExistingProviderModels,
|
|
434
440
|
findProviderByCredentials,
|
|
435
441
|
findProviderById,
|
|
@@ -444,7 +450,6 @@ import {
|
|
|
444
450
|
getExtensionDisplayName,
|
|
445
451
|
getGitBranch,
|
|
446
452
|
getProjectSummaryInfo,
|
|
447
|
-
getStartupContextLength,
|
|
448
453
|
getTimeRangeBounds,
|
|
449
454
|
getToolResponseDisplayText,
|
|
450
455
|
getWelcomeBackState,
|
|
@@ -457,7 +462,6 @@ import {
|
|
|
457
462
|
isSessionRuntimeActive,
|
|
458
463
|
isSettledStatus,
|
|
459
464
|
isSuccessStatus,
|
|
460
|
-
isSystemReminderContent,
|
|
461
465
|
isTerminalStatus,
|
|
462
466
|
loadUsageHistory,
|
|
463
467
|
markDuplicateProviderToolCallResponseSent,
|
|
@@ -487,42 +491,57 @@ import {
|
|
|
487
491
|
validateWorkflowName,
|
|
488
492
|
watchRepoBranch,
|
|
489
493
|
writeRuntimeStatus
|
|
490
|
-
} from "./chunk-
|
|
491
|
-
import "./chunk-5M6IDOMF.js";
|
|
494
|
+
} from "./chunk-GEB2CGUV.js";
|
|
492
495
|
import "./chunk-T4TZQJ7W.js";
|
|
493
496
|
import "./chunk-H6XPXXMH.js";
|
|
494
|
-
import "./chunk-
|
|
495
|
-
import "./chunk-
|
|
497
|
+
import "./chunk-5M6IDOMF.js";
|
|
498
|
+
import "./chunk-T2L47JJK.js";
|
|
499
|
+
import "./chunk-GPSKDNEE.js";
|
|
500
|
+
import "./chunk-X6N25LXS.js";
|
|
501
|
+
import "./chunk-E2UVIFI2.js";
|
|
502
|
+
import "./chunk-Q2YKNMLS.js";
|
|
496
503
|
import "./chunk-XU457J4V.js";
|
|
497
504
|
import "./chunk-VDDGDZMA.js";
|
|
498
|
-
import "./chunk-
|
|
499
|
-
import "./chunk-
|
|
500
|
-
import "./chunk-
|
|
501
|
-
import "./chunk-E2UVIFI2.js";
|
|
505
|
+
import "./chunk-KHOVYUHX.js";
|
|
506
|
+
import "./chunk-SZRN75WQ.js";
|
|
507
|
+
import "./chunk-6PVPNMXU.js";
|
|
502
508
|
import {
|
|
503
509
|
resolveModelId
|
|
504
|
-
} from "./chunk-
|
|
505
|
-
import "./chunk-SZRN75WQ.js";
|
|
506
|
-
import "./chunk-HTO4JFDZ.js";
|
|
510
|
+
} from "./chunk-PIHKWN7M.js";
|
|
507
511
|
import "./chunk-CPBF7KYF.js";
|
|
508
|
-
import
|
|
509
|
-
APPROVAL_MODES
|
|
510
|
-
} from "./chunk-ETD6K42I.js";
|
|
511
|
-
import "./chunk-6AM5D4ME.js";
|
|
512
|
-
import "./chunk-G45X5TRN.js";
|
|
512
|
+
import "./chunk-NABLFI57.js";
|
|
513
513
|
import {
|
|
514
514
|
HOOKS_CONFIG_FIELDS
|
|
515
|
-
} from "./chunk-
|
|
515
|
+
} from "./chunk-QBUDF33N.js";
|
|
516
|
+
import "./chunk-LIZRAKPB.js";
|
|
517
|
+
import {
|
|
518
|
+
APPROVAL_MODES,
|
|
519
|
+
getStartupContextLength,
|
|
520
|
+
isSystemReminderContent,
|
|
521
|
+
runOutsideAgentContext
|
|
522
|
+
} from "./chunk-WHGVTP7Q.js";
|
|
523
|
+
import "./chunk-6AM5D4ME.js";
|
|
524
|
+
import "./chunk-JCW2R7WC.js";
|
|
516
525
|
import {
|
|
517
526
|
isPathWithinRoot
|
|
518
|
-
} from "./chunk-
|
|
519
|
-
import "./chunk-
|
|
527
|
+
} from "./chunk-57FIIFJN.js";
|
|
528
|
+
import "./chunk-HTO4JFDZ.js";
|
|
529
|
+
import {
|
|
530
|
+
REASONING_EFFORT_TIERS
|
|
531
|
+
} from "./chunk-XVNQMZ2I.js";
|
|
532
|
+
import {
|
|
533
|
+
getUnsupportedImageFormatWarning,
|
|
534
|
+
isSupportedImageMimeType
|
|
535
|
+
} from "./chunk-FODK6UMO.js";
|
|
536
|
+
import "./chunk-GLNBDYUX.js";
|
|
520
537
|
import {
|
|
521
538
|
qwenOAuth2Events
|
|
522
|
-
} from "./chunk-
|
|
523
|
-
import "./chunk-7H2JMOPS.js";
|
|
524
|
-
import "./chunk-NL37SKPP.js";
|
|
539
|
+
} from "./chunk-TXRKCFWS.js";
|
|
525
540
|
import "./chunk-JESCGQM3.js";
|
|
541
|
+
import "./chunk-EWXXMRMP.js";
|
|
542
|
+
import "./chunk-PPIHLGNE.js";
|
|
543
|
+
import "./chunk-DJ2GSRLV.js";
|
|
544
|
+
import "./chunk-5I5BM454.js";
|
|
526
545
|
import {
|
|
527
546
|
ApiCancelEvent,
|
|
528
547
|
AuthEvent,
|
|
@@ -564,9 +583,7 @@ import {
|
|
|
564
583
|
runVisionBridge,
|
|
565
584
|
shouldRunVisionBridge,
|
|
566
585
|
splitImageParts
|
|
567
|
-
} from "./chunk-
|
|
568
|
-
import "./chunk-4WKAA4KS.js";
|
|
569
|
-
import "./chunk-CR3C7WXL.js";
|
|
586
|
+
} from "./chunk-5G2SK2OO.js";
|
|
570
587
|
import "./chunk-VGC4I5JJ.js";
|
|
571
588
|
import {
|
|
572
589
|
AUTO_MEMORY_INDEX_FILENAME,
|
|
@@ -574,36 +591,30 @@ import {
|
|
|
574
591
|
getAutoMemoryRoot,
|
|
575
592
|
getUserAutoMemoryRoot,
|
|
576
593
|
isAnyAutoMemPath
|
|
577
|
-
} from "./chunk-
|
|
578
|
-
import "./chunk-UEY4AYUL.js";
|
|
579
|
-
import {
|
|
580
|
-
atomicWriteFileSync
|
|
581
|
-
} from "./chunk-BDBMYST4.js";
|
|
582
|
-
import "./chunk-467G3SV5.js";
|
|
583
|
-
import {
|
|
584
|
-
ToolNames,
|
|
585
|
-
isShellProgressData
|
|
586
|
-
} from "./chunk-S35ZDXOS.js";
|
|
587
|
-
import {
|
|
588
|
-
REASONING_EFFORT_TIERS
|
|
589
|
-
} from "./chunk-XVNQMZ2I.js";
|
|
590
|
-
import {
|
|
591
|
-
getUnsupportedImageFormatWarning,
|
|
592
|
-
isSupportedImageMimeType
|
|
593
|
-
} from "./chunk-FODK6UMO.js";
|
|
594
|
-
import "./chunk-GLNBDYUX.js";
|
|
595
|
-
import "./chunk-DJ2GSRLV.js";
|
|
596
|
-
import "./chunk-6EFTQYW7.js";
|
|
594
|
+
} from "./chunk-4K56OJFJ.js";
|
|
597
595
|
import {
|
|
598
596
|
DEFAULT_TOKEN_LIMIT
|
|
599
|
-
} from "./chunk-
|
|
597
|
+
} from "./chunk-JYS55H6Z.js";
|
|
600
598
|
import "./chunk-A4UCTEB5.js";
|
|
601
599
|
import "./chunk-XWRJCPHC.js";
|
|
600
|
+
import "./chunk-QNLNLENL.js";
|
|
601
|
+
import {
|
|
602
|
+
atomicWriteFileSync
|
|
603
|
+
} from "./chunk-6X4GWOPW.js";
|
|
602
604
|
import {
|
|
603
605
|
FinishReason
|
|
604
606
|
} from "./chunk-TYQMGACW.js";
|
|
605
607
|
import "./chunk-TYAMGABM.js";
|
|
606
608
|
import "./chunk-FCMNKVXT.js";
|
|
609
|
+
import "./chunk-IS2SBY6T.js";
|
|
610
|
+
import "./chunk-HTR4WV6U.js";
|
|
611
|
+
import "./chunk-M7WBGLYP.js";
|
|
612
|
+
import "./chunk-U7ZFW55U.js";
|
|
613
|
+
import "./chunk-NPQDJGKU.js";
|
|
614
|
+
import {
|
|
615
|
+
ToolNames,
|
|
616
|
+
isShellProgressData
|
|
617
|
+
} from "./chunk-YM3SZTH4.js";
|
|
607
618
|
import {
|
|
608
619
|
Storage,
|
|
609
620
|
UnauthorizedError,
|
|
@@ -615,21 +626,21 @@ import {
|
|
|
615
626
|
isNodeError,
|
|
616
627
|
shortenPath,
|
|
617
628
|
tildeifyPath
|
|
618
|
-
} from "./chunk-
|
|
619
|
-
import "./chunk-
|
|
620
|
-
import {
|
|
621
|
-
registerCleanup,
|
|
622
|
-
runExitCleanup
|
|
623
|
-
} from "./chunk-P5OX37TK.js";
|
|
629
|
+
} from "./chunk-OQB4EXO4.js";
|
|
630
|
+
import "./chunk-DPRMI6NU.js";
|
|
624
631
|
import {
|
|
625
632
|
finalizeStartupProfile,
|
|
626
633
|
profileCheckpoint
|
|
627
634
|
} from "./chunk-QSWDGAIC.js";
|
|
628
635
|
import "./chunk-Q7YDKOGY.js";
|
|
636
|
+
import {
|
|
637
|
+
registerCleanup,
|
|
638
|
+
runExitCleanup
|
|
639
|
+
} from "./chunk-D6ZOVZLF.js";
|
|
629
640
|
import "./chunk-75DOP5OR.js";
|
|
630
641
|
import "./chunk-DMTGGOSA.js";
|
|
631
642
|
import "./chunk-YQ3U5MUC.js";
|
|
632
|
-
import "./chunk-
|
|
643
|
+
import "./chunk-THJNPLI4.js";
|
|
633
644
|
import {
|
|
634
645
|
init_esbuild_shims
|
|
635
646
|
} from "./chunk-5O2XNYP6.js";
|
|
@@ -641,7 +652,7 @@ import {
|
|
|
641
652
|
// packages/cli/src/ui/startInteractiveUI.tsx
|
|
642
653
|
init_esbuild_shims();
|
|
643
654
|
import { basename as basename4 } from "node:path";
|
|
644
|
-
var
|
|
655
|
+
var import_react167 = __toESM(require_react(), 1);
|
|
645
656
|
|
|
646
657
|
// packages/cli/src/dualOutput/DualOutputBridge.ts
|
|
647
658
|
init_esbuild_shims();
|
|
@@ -834,7 +845,7 @@ var DualOutputBridge = class {
|
|
|
834
845
|
* Emits a `can_use_tool` permission request so an external consumer can
|
|
835
846
|
* approve or deny the tool call. Pairs with {@link emitControlResponse}.
|
|
836
847
|
*/
|
|
837
|
-
emitPermissionRequest(requestId, toolName, toolUseId, input, blockedPath = null) {
|
|
848
|
+
emitPermissionRequest(requestId, toolName, toolUseId, input, blockedPath = null, permissionSuggestions = null) {
|
|
838
849
|
if (!this.active) return;
|
|
839
850
|
this.disableIfBufferOverflowed();
|
|
840
851
|
if (!this.active) return;
|
|
@@ -844,7 +855,8 @@ var DualOutputBridge = class {
|
|
|
844
855
|
toolName,
|
|
845
856
|
toolUseId,
|
|
846
857
|
input,
|
|
847
|
-
blockedPath
|
|
858
|
+
blockedPath,
|
|
859
|
+
permissionSuggestions
|
|
848
860
|
);
|
|
849
861
|
} catch (err) {
|
|
850
862
|
debugLogger.error("DualOutput emitPermissionRequest error:", err);
|
|
@@ -1256,7 +1268,7 @@ var useRemoteInput = /* @__PURE__ */ __name(() => (0, import_react2.useContext)(
|
|
|
1256
1268
|
|
|
1257
1269
|
// packages/cli/src/ui/AppContainer.tsx
|
|
1258
1270
|
init_esbuild_shims();
|
|
1259
|
-
var
|
|
1271
|
+
var import_react165 = __toESM(require_react(), 1);
|
|
1260
1272
|
|
|
1261
1273
|
// packages/cli/src/ui/App.tsx
|
|
1262
1274
|
init_esbuild_shims();
|
|
@@ -1386,30 +1398,15 @@ var useAppContext = /* @__PURE__ */ __name(() => {
|
|
|
1386
1398
|
return context;
|
|
1387
1399
|
}, "useAppContext");
|
|
1388
1400
|
|
|
1389
|
-
// packages/cli/src/ui/components/UpdateNotification.tsx
|
|
1390
|
-
init_esbuild_shims();
|
|
1391
|
-
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
1392
|
-
var UpdateNotification = /* @__PURE__ */ __name(({ message }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1393
|
-
Box_default,
|
|
1394
|
-
{
|
|
1395
|
-
borderStyle: "round",
|
|
1396
|
-
borderColor: theme.status.warning,
|
|
1397
|
-
paddingX: 1,
|
|
1398
|
-
marginY: 1,
|
|
1399
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: theme.status.warning, children: message })
|
|
1400
|
-
}
|
|
1401
|
-
), "UpdateNotification");
|
|
1402
|
-
|
|
1403
1401
|
// packages/cli/src/ui/components/Notifications.tsx
|
|
1404
|
-
var
|
|
1402
|
+
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
1405
1403
|
var Notifications = /* @__PURE__ */ __name(() => {
|
|
1406
1404
|
const { startupWarnings } = useAppContext();
|
|
1407
|
-
const { initError, streamingState
|
|
1405
|
+
const { initError, streamingState } = useUIState();
|
|
1408
1406
|
const showStartupWarnings = startupWarnings.length > 0;
|
|
1409
1407
|
const showInitError = initError && streamingState !== "responding" /* Responding */;
|
|
1410
|
-
return /* @__PURE__ */ (0,
|
|
1411
|
-
|
|
1412
|
-
showStartupWarnings && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
1409
|
+
showStartupWarnings && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1413
1410
|
Box_default,
|
|
1414
1411
|
{
|
|
1415
1412
|
borderStyle: "round",
|
|
@@ -1417,10 +1414,10 @@ var Notifications = /* @__PURE__ */ __name(() => {
|
|
|
1417
1414
|
paddingX: 1,
|
|
1418
1415
|
marginY: 1,
|
|
1419
1416
|
flexDirection: "column",
|
|
1420
|
-
children: startupWarnings.map((warning, index) => /* @__PURE__ */ (0,
|
|
1417
|
+
children: startupWarnings.map((warning, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: theme.status.warning, children: warning }, index))
|
|
1421
1418
|
}
|
|
1422
1419
|
),
|
|
1423
|
-
showInitError && /* @__PURE__ */ (0,
|
|
1420
|
+
showInitError && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1424
1421
|
Box_default,
|
|
1425
1422
|
{
|
|
1426
1423
|
borderStyle: "round",
|
|
@@ -1428,11 +1425,11 @@ var Notifications = /* @__PURE__ */ __name(() => {
|
|
|
1428
1425
|
paddingX: 1,
|
|
1429
1426
|
marginBottom: 1,
|
|
1430
1427
|
children: [
|
|
1431
|
-
/* @__PURE__ */ (0,
|
|
1428
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text, { color: theme.status.error, children: [
|
|
1432
1429
|
"Initialization Error: ",
|
|
1433
1430
|
initError
|
|
1434
1431
|
] }),
|
|
1435
|
-
/* @__PURE__ */ (0,
|
|
1432
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text, { color: theme.status.error, children: [
|
|
1436
1433
|
" ",
|
|
1437
1434
|
"Please check API key and configuration."
|
|
1438
1435
|
] })
|
|
@@ -1442,6 +1439,20 @@ var Notifications = /* @__PURE__ */ __name(() => {
|
|
|
1442
1439
|
] });
|
|
1443
1440
|
}, "Notifications");
|
|
1444
1441
|
|
|
1442
|
+
// packages/cli/src/ui/components/UpdateNotification.tsx
|
|
1443
|
+
init_esbuild_shims();
|
|
1444
|
+
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
|
1445
|
+
var UpdateNotification = /* @__PURE__ */ __name(({ message }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1446
|
+
Box_default,
|
|
1447
|
+
{
|
|
1448
|
+
borderStyle: "round",
|
|
1449
|
+
borderColor: theme.status.warning,
|
|
1450
|
+
paddingX: 1,
|
|
1451
|
+
marginY: 1,
|
|
1452
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: theme.status.warning, children: message })
|
|
1453
|
+
}
|
|
1454
|
+
), "UpdateNotification");
|
|
1455
|
+
|
|
1445
1456
|
// packages/cli/src/ui/components/MainContent.tsx
|
|
1446
1457
|
init_esbuild_shims();
|
|
1447
1458
|
var import_react14 = __toESM(require_react(), 1);
|
|
@@ -30880,7 +30891,13 @@ var Footer = /* @__PURE__ */ __name(() => {
|
|
|
30880
30891
|
t("IDE connecting... context may be unavailable")
|
|
30881
30892
|
] }) : uiState.startupIdeConnectionStatus.state === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text, { color: theme.status.warning, children: t("IDE connection unavailable: {{message}}", {
|
|
30882
30893
|
message: uiState.startupIdeConnectionStatus.message
|
|
30883
|
-
}) }) : uiState.streamingState === "responding" /* Responding */ ? /* @__PURE__ */ (0, import_jsx_runtime116.
|
|
30894
|
+
}) }) : uiState.streamingState === "responding" /* Responding */ ? /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
30895
|
+
t("Enter to steer \xB7 Ctrl+Q to queue"),
|
|
30896
|
+
showAutoAcceptIndicator !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(import_jsx_runtime116.Fragment, { children: [
|
|
30897
|
+
" \xB7 ",
|
|
30898
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(AutoAcceptIndicator, { approvalMode: showAutoAcceptIndicator })
|
|
30899
|
+
] })
|
|
30900
|
+
] }) : showAutoAcceptIndicator !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(AutoAcceptIndicator, { approvalMode: showAutoAcceptIndicator }) : suppressHint ? null : /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text, { color: theme.text.secondary, children: t("? for shortcuts") });
|
|
30884
30901
|
const rightItems = [];
|
|
30885
30902
|
if (sandboxInfo) {
|
|
30886
30903
|
rightItems.push({
|
|
@@ -31460,6 +31477,7 @@ var ScreenReaderAppLayout = /* @__PURE__ */ __name(() => {
|
|
|
31460
31477
|
const dialogHeight = uiState.constrainHeight ? dialogMaxHeight : void 0;
|
|
31461
31478
|
const shouldShowStickyTodos = uiState.stickyTodos !== null && !uiState.dialogsVisible && !uiState.isFeedbackDialogOpen && uiState.streamingState === "responding" /* Responding */;
|
|
31462
31479
|
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Box_default, { flexDirection: "column", width: "90%", height: "100%", children: [
|
|
31480
|
+
!uiState.dialogsVisible && uiState.updateInfo && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(UpdateNotification, { message: uiState.updateInfo.message }),
|
|
31463
31481
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Notifications, {}),
|
|
31464
31482
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Footer, {}),
|
|
31465
31483
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Box_default, { flexGrow: 1, overflow: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(MainContent, {}) }),
|
|
@@ -32541,12 +32559,14 @@ var DefaultAppLayout = /* @__PURE__ */ __name(() => {
|
|
|
32541
32559
|
isAgentTab ? /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
|
|
32542
32560
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(AgentChatView, { agentId: activeView }),
|
|
32543
32561
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(Box_default, { flexDirection: "column", ref: uiState.mainControlsRef, children: [
|
|
32562
|
+
!uiState.dialogsVisible && uiState.updateInfo && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(UpdateNotification, { message: uiState.updateInfo.message }),
|
|
32544
32563
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(AgentComposer, { agentId: activeView }, activeView),
|
|
32545
32564
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(ExitWarning, {})
|
|
32546
32565
|
] })
|
|
32547
32566
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
|
|
32548
32567
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(MainContent, {}),
|
|
32549
32568
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(Box_default, { flexDirection: "column", ref: uiState.mainControlsRef, children: [
|
|
32569
|
+
!uiState.dialogsVisible && uiState.updateInfo && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(UpdateNotification, { message: uiState.updateInfo.message }),
|
|
32550
32570
|
uiState.dialogsVisible ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
32551
32571
|
Box_default,
|
|
32552
32572
|
{
|
|
@@ -32751,14 +32771,46 @@ function useResizeSettleRepaint(terminalWidth, refreshStatic) {
|
|
|
32751
32771
|
}
|
|
32752
32772
|
__name(useResizeSettleRepaint, "useResizeSettleRepaint");
|
|
32753
32773
|
|
|
32754
|
-
// packages/cli/src/ui/hooks/
|
|
32774
|
+
// packages/cli/src/ui/hooks/use-wake-repaint.ts
|
|
32755
32775
|
init_esbuild_shims();
|
|
32756
32776
|
var import_react118 = __toESM(require_react(), 1);
|
|
32777
|
+
var HEARTBEAT_INTERVAL_MS = 5e3;
|
|
32778
|
+
var WAKE_THRESHOLD_MS = HEARTBEAT_INTERVAL_MS * 2;
|
|
32779
|
+
function useWakeRepaint(repaint) {
|
|
32780
|
+
const repaintRef = (0, import_react118.useRef)(repaint);
|
|
32781
|
+
repaintRef.current = repaint;
|
|
32782
|
+
(0, import_react118.useEffect)(() => {
|
|
32783
|
+
let lastTick = Date.now();
|
|
32784
|
+
const timer = setInterval(() => {
|
|
32785
|
+
const now = Date.now();
|
|
32786
|
+
const elapsed = now - lastTick;
|
|
32787
|
+
lastTick = now;
|
|
32788
|
+
if (elapsed > WAKE_THRESHOLD_MS) {
|
|
32789
|
+
repaintRef.current();
|
|
32790
|
+
}
|
|
32791
|
+
}, HEARTBEAT_INTERVAL_MS);
|
|
32792
|
+
timer.unref?.();
|
|
32793
|
+
const onSigcont = /* @__PURE__ */ __name(() => {
|
|
32794
|
+
lastTick = Date.now();
|
|
32795
|
+
repaintRef.current();
|
|
32796
|
+
}, "onSigcont");
|
|
32797
|
+
process.on("SIGCONT", onSigcont);
|
|
32798
|
+
return () => {
|
|
32799
|
+
clearInterval(timer);
|
|
32800
|
+
process.removeListener("SIGCONT", onSigcont);
|
|
32801
|
+
};
|
|
32802
|
+
}, []);
|
|
32803
|
+
}
|
|
32804
|
+
__name(useWakeRepaint, "useWakeRepaint");
|
|
32805
|
+
|
|
32806
|
+
// packages/cli/src/ui/hooks/useThemeCommand.ts
|
|
32807
|
+
init_esbuild_shims();
|
|
32808
|
+
var import_react119 = __toESM(require_react(), 1);
|
|
32757
32809
|
import process13 from "node:process";
|
|
32758
32810
|
var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, addItem, initialThemeError) => {
|
|
32759
|
-
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0,
|
|
32760
|
-
const [themeBeforeDialogOpen, setThemeBeforeDialogOpen] = (0,
|
|
32761
|
-
const openThemeDialog = (0,
|
|
32811
|
+
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0, import_react119.useState)(!!initialThemeError);
|
|
32812
|
+
const [themeBeforeDialogOpen, setThemeBeforeDialogOpen] = (0, import_react119.useState)(themeManager.getActiveTheme().name);
|
|
32813
|
+
const openThemeDialog = (0, import_react119.useCallback)(() => {
|
|
32762
32814
|
if (process13.env["NO_COLOR"]) {
|
|
32763
32815
|
addItem(
|
|
32764
32816
|
{
|
|
@@ -32774,7 +32826,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
32774
32826
|
setThemeBeforeDialogOpen(themeManager.getActiveTheme().name);
|
|
32775
32827
|
setIsThemeDialogOpen(true);
|
|
32776
32828
|
}, [addItem]);
|
|
32777
|
-
const applyTheme = (0,
|
|
32829
|
+
const applyTheme = (0, import_react119.useCallback)(
|
|
32778
32830
|
(themeName) => {
|
|
32779
32831
|
if (!themeManager.setActiveTheme(themeName)) {
|
|
32780
32832
|
setIsThemeDialogOpen(true);
|
|
@@ -32789,13 +32841,13 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
32789
32841
|
},
|
|
32790
32842
|
[setThemeError]
|
|
32791
32843
|
);
|
|
32792
|
-
const handleThemeHighlight = (0,
|
|
32844
|
+
const handleThemeHighlight = (0, import_react119.useCallback)(
|
|
32793
32845
|
(themeName) => {
|
|
32794
32846
|
applyTheme(themeName);
|
|
32795
32847
|
},
|
|
32796
32848
|
[applyTheme]
|
|
32797
32849
|
);
|
|
32798
|
-
const handleThemeSelect = (0,
|
|
32850
|
+
const handleThemeSelect = (0, import_react119.useCallback)(
|
|
32799
32851
|
(themeName, scope) => {
|
|
32800
32852
|
if (themeName === void 0) {
|
|
32801
32853
|
applyTheme(themeBeforeDialogOpen);
|
|
@@ -32842,7 +32894,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
32842
32894
|
|
|
32843
32895
|
// packages/cli/src/ui/hooks/useFeedbackDialog.ts
|
|
32844
32896
|
init_esbuild_shims();
|
|
32845
|
-
var
|
|
32897
|
+
var import_react120 = __toESM(require_react(), 1);
|
|
32846
32898
|
import * as fs15 from "node:fs";
|
|
32847
32899
|
var import_strip_json_comments = __toESM(require_strip_json_comments(), 1);
|
|
32848
32900
|
var FEEDBACK_SHOW_PROBABILITY = 0.25;
|
|
@@ -32888,20 +32940,20 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
32888
32940
|
history,
|
|
32889
32941
|
sessionStats
|
|
32890
32942
|
}) => {
|
|
32891
|
-
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = (0,
|
|
32892
|
-
const [isFeedbackDismissedTemporarily, setIsFeedbackDismissedTemporarily] = (0,
|
|
32893
|
-
const openFeedbackDialog = (0,
|
|
32943
|
+
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = (0, import_react120.useState)(false);
|
|
32944
|
+
const [isFeedbackDismissedTemporarily, setIsFeedbackDismissedTemporarily] = (0, import_react120.useState)(false);
|
|
32945
|
+
const openFeedbackDialog = (0, import_react120.useCallback)(() => {
|
|
32894
32946
|
setIsFeedbackDialogOpen(true);
|
|
32895
32947
|
}, []);
|
|
32896
|
-
const closeFeedbackDialog = (0,
|
|
32948
|
+
const closeFeedbackDialog = (0, import_react120.useCallback)(
|
|
32897
32949
|
() => setIsFeedbackDialogOpen(false),
|
|
32898
32950
|
[]
|
|
32899
32951
|
);
|
|
32900
|
-
const temporaryCloseFeedbackDialog = (0,
|
|
32952
|
+
const temporaryCloseFeedbackDialog = (0, import_react120.useCallback)(() => {
|
|
32901
32953
|
setIsFeedbackDialogOpen(false);
|
|
32902
32954
|
setIsFeedbackDismissedTemporarily(true);
|
|
32903
32955
|
}, []);
|
|
32904
|
-
const submitFeedback = (0,
|
|
32956
|
+
const submitFeedback = (0, import_react120.useCallback)(
|
|
32905
32957
|
(rating) => {
|
|
32906
32958
|
if (rating >= FEEDBACK_OPTIONS.GOOD && rating <= FEEDBACK_OPTIONS.FINE) {
|
|
32907
32959
|
const feedbackEvent = new UserFeedbackEvent(
|
|
@@ -32921,7 +32973,7 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
32921
32973
|
},
|
|
32922
32974
|
[closeFeedbackDialog, sessionStats.sessionId, config, settings]
|
|
32923
32975
|
);
|
|
32924
|
-
(0,
|
|
32976
|
+
(0, import_react120.useEffect)(() => {
|
|
32925
32977
|
const checkAndShowFeedback = /* @__PURE__ */ __name(() => {
|
|
32926
32978
|
if (streamingState === "idle" /* Idle */ && history.length > 0) {
|
|
32927
32979
|
if (!config.getUsageStatisticsEnabled() || settings.merged.ui?.enableUserFeedback === false || !lastMessageIsAIResponse(history) || Math.random() > FEEDBACK_SHOW_PROBABILITY || !meetsMinimumSessionRequirements(sessionStats) || isFeedbackDismissedTemporarily) {
|
|
@@ -32943,7 +32995,7 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
32943
32995
|
settings.merged.ui?.enableUserFeedback,
|
|
32944
32996
|
config
|
|
32945
32997
|
]);
|
|
32946
|
-
(0,
|
|
32998
|
+
(0, import_react120.useEffect)(() => {
|
|
32947
32999
|
if (streamingState === "responding" /* Responding */ && isFeedbackDismissedTemporarily) {
|
|
32948
33000
|
setIsFeedbackDismissedTemporarily(false);
|
|
32949
33001
|
}
|
|
@@ -32959,13 +33011,13 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
32959
33011
|
|
|
32960
33012
|
// packages/cli/src/ui/hooks/useEditorSettings.ts
|
|
32961
33013
|
init_esbuild_shims();
|
|
32962
|
-
var
|
|
33014
|
+
var import_react121 = __toESM(require_react(), 1);
|
|
32963
33015
|
var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError, addItem) => {
|
|
32964
|
-
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0,
|
|
32965
|
-
const openEditorDialog = (0,
|
|
33016
|
+
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0, import_react121.useState)(false);
|
|
33017
|
+
const openEditorDialog = (0, import_react121.useCallback)(() => {
|
|
32966
33018
|
setIsEditorDialogOpen(true);
|
|
32967
33019
|
}, []);
|
|
32968
|
-
const handleEditorSelect = (0,
|
|
33020
|
+
const handleEditorSelect = (0, import_react121.useCallback)(
|
|
32969
33021
|
(editorType, scope) => {
|
|
32970
33022
|
if (editorType && (!checkHasEditorType(editorType) || !allowEditorTypeInSandbox(editorType))) {
|
|
32971
33023
|
return;
|
|
@@ -32987,7 +33039,7 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
32987
33039
|
},
|
|
32988
33040
|
[loadedSettings, setEditorError, addItem]
|
|
32989
33041
|
);
|
|
32990
|
-
const exitEditorDialog = (0,
|
|
33042
|
+
const exitEditorDialog = (0, import_react121.useCallback)(() => {
|
|
32991
33043
|
setIsEditorDialogOpen(false);
|
|
32992
33044
|
}, []);
|
|
32993
33045
|
return {
|
|
@@ -33000,13 +33052,13 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
33000
33052
|
|
|
33001
33053
|
// packages/cli/src/ui/hooks/useSettingsCommand.ts
|
|
33002
33054
|
init_esbuild_shims();
|
|
33003
|
-
var
|
|
33055
|
+
var import_react122 = __toESM(require_react(), 1);
|
|
33004
33056
|
function useSettingsCommand() {
|
|
33005
|
-
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0,
|
|
33006
|
-
const openSettingsDialog = (0,
|
|
33057
|
+
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0, import_react122.useState)(false);
|
|
33058
|
+
const openSettingsDialog = (0, import_react122.useCallback)(() => {
|
|
33007
33059
|
setIsSettingsDialogOpen(true);
|
|
33008
33060
|
}, []);
|
|
33009
|
-
const closeSettingsDialog = (0,
|
|
33061
|
+
const closeSettingsDialog = (0, import_react122.useCallback)(() => {
|
|
33010
33062
|
setIsSettingsDialogOpen(false);
|
|
33011
33063
|
}, []);
|
|
33012
33064
|
return {
|
|
@@ -33019,14 +33071,14 @@ __name(useSettingsCommand, "useSettingsCommand");
|
|
|
33019
33071
|
|
|
33020
33072
|
// packages/cli/src/ui/hooks/useModelCommand.ts
|
|
33021
33073
|
init_esbuild_shims();
|
|
33022
|
-
var
|
|
33074
|
+
var import_react123 = __toESM(require_react(), 1);
|
|
33023
33075
|
var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
33024
|
-
const [isModelDialogOpen, setIsModelDialogOpen] = (0,
|
|
33025
|
-
const [isFastModelMode, setIsFastModelMode] = (0,
|
|
33026
|
-
const [isVoiceModelMode, setIsVoiceModelMode] = (0,
|
|
33027
|
-
const [isVisionModelMode, setIsVisionModelMode] = (0,
|
|
33028
|
-
const [modelDialogPersistScope, setModelDialogPersistScope] = (0,
|
|
33029
|
-
const openModelDialog = (0,
|
|
33076
|
+
const [isModelDialogOpen, setIsModelDialogOpen] = (0, import_react123.useState)(false);
|
|
33077
|
+
const [isFastModelMode, setIsFastModelMode] = (0, import_react123.useState)(false);
|
|
33078
|
+
const [isVoiceModelMode, setIsVoiceModelMode] = (0, import_react123.useState)(false);
|
|
33079
|
+
const [isVisionModelMode, setIsVisionModelMode] = (0, import_react123.useState)(false);
|
|
33080
|
+
const [modelDialogPersistScope, setModelDialogPersistScope] = (0, import_react123.useState)(void 0);
|
|
33081
|
+
const openModelDialog = (0, import_react123.useCallback)(
|
|
33030
33082
|
(options) => {
|
|
33031
33083
|
const voiceModelMode = options?.voiceModelMode ?? false;
|
|
33032
33084
|
const visionModelMode = options?.visionModelMode ?? false;
|
|
@@ -33040,7 +33092,7 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
33040
33092
|
},
|
|
33041
33093
|
[]
|
|
33042
33094
|
);
|
|
33043
|
-
const closeModelDialog = (0,
|
|
33095
|
+
const closeModelDialog = (0, import_react123.useCallback)(() => {
|
|
33044
33096
|
setIsModelDialogOpen(false);
|
|
33045
33097
|
setIsFastModelMode(false);
|
|
33046
33098
|
setIsVoiceModelMode(false);
|
|
@@ -33060,13 +33112,13 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
33060
33112
|
|
|
33061
33113
|
// packages/cli/src/ui/hooks/useApprovalModeCommand.ts
|
|
33062
33114
|
init_esbuild_shims();
|
|
33063
|
-
var
|
|
33115
|
+
var import_react124 = __toESM(require_react(), 1);
|
|
33064
33116
|
var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) => {
|
|
33065
|
-
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0,
|
|
33066
|
-
const openApprovalModeDialog = (0,
|
|
33117
|
+
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0, import_react124.useState)(false);
|
|
33118
|
+
const openApprovalModeDialog = (0, import_react124.useCallback)(() => {
|
|
33067
33119
|
setIsApprovalModeDialogOpen(true);
|
|
33068
33120
|
}, []);
|
|
33069
|
-
const handleApprovalModeSelect = (0,
|
|
33121
|
+
const handleApprovalModeSelect = (0, import_react124.useCallback)(
|
|
33070
33122
|
(mode, scope) => {
|
|
33071
33123
|
try {
|
|
33072
33124
|
if (!mode) {
|
|
@@ -33092,13 +33144,13 @@ var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) =>
|
|
|
33092
33144
|
|
|
33093
33145
|
// packages/cli/src/ui/hooks/use-effort-command.ts
|
|
33094
33146
|
init_esbuild_shims();
|
|
33095
|
-
var
|
|
33147
|
+
var import_react125 = __toESM(require_react(), 1);
|
|
33096
33148
|
var useEffortCommand = /* @__PURE__ */ __name((loadedSettings, config, addItem) => {
|
|
33097
|
-
const [isEffortDialogOpen, setIsEffortDialogOpen] = (0,
|
|
33098
|
-
const openEffortDialog = (0,
|
|
33149
|
+
const [isEffortDialogOpen, setIsEffortDialogOpen] = (0, import_react125.useState)(false);
|
|
33150
|
+
const openEffortDialog = (0, import_react125.useCallback)(() => {
|
|
33099
33151
|
setIsEffortDialogOpen(true);
|
|
33100
33152
|
}, []);
|
|
33101
|
-
const handleEffortSelect = (0,
|
|
33153
|
+
const handleEffortSelect = (0, import_react125.useCallback)(
|
|
33102
33154
|
(effort) => {
|
|
33103
33155
|
try {
|
|
33104
33156
|
if (!effort) {
|
|
@@ -33150,7 +33202,7 @@ var useEffortCommand = /* @__PURE__ */ __name((loadedSettings, config, addItem)
|
|
|
33150
33202
|
|
|
33151
33203
|
// packages/cli/src/ui/hooks/useBranchCommand.ts
|
|
33152
33204
|
init_esbuild_shims();
|
|
33153
|
-
var
|
|
33205
|
+
var import_react126 = __toESM(require_react(), 1);
|
|
33154
33206
|
import { randomUUID } from "node:crypto";
|
|
33155
33207
|
function deriveFirstPrompt(messages) {
|
|
33156
33208
|
for (const record of messages) {
|
|
@@ -33170,7 +33222,7 @@ function deriveFirstPrompt(messages) {
|
|
|
33170
33222
|
__name(deriveFirstPrompt, "deriveFirstPrompt");
|
|
33171
33223
|
function useBranchCommand(options) {
|
|
33172
33224
|
const { config, historyManager, startNewSession, setSessionName, remount } = options;
|
|
33173
|
-
const handleBranch = (0,
|
|
33225
|
+
const handleBranch = (0, import_react126.useCallback)(
|
|
33174
33226
|
async (name) => {
|
|
33175
33227
|
if (!config) return;
|
|
33176
33228
|
const oldSessionId = config.getSessionId();
|
|
@@ -33301,19 +33353,19 @@ __name(useBranchCommand, "useBranchCommand");
|
|
|
33301
33353
|
|
|
33302
33354
|
// packages/cli/src/ui/hooks/useResumeCommand.ts
|
|
33303
33355
|
init_esbuild_shims();
|
|
33304
|
-
var
|
|
33356
|
+
var import_react127 = __toESM(require_react(), 1);
|
|
33305
33357
|
var BACKGROUND_WORK_SWITCH_BLOCKED_MESSAGE = "Stop the current session's running background tasks before resuming another session.";
|
|
33306
33358
|
function useResumeCommand(options) {
|
|
33307
|
-
const [isResumeDialogOpen, setIsResumeDialogOpen] = (0,
|
|
33308
|
-
const [resumeMatchedSessions, setResumeMatchedSessions] = (0,
|
|
33309
|
-
const openResumeDialog = (0,
|
|
33359
|
+
const [isResumeDialogOpen, setIsResumeDialogOpen] = (0, import_react127.useState)(false);
|
|
33360
|
+
const [resumeMatchedSessions, setResumeMatchedSessions] = (0, import_react127.useState)();
|
|
33361
|
+
const openResumeDialog = (0, import_react127.useCallback)(
|
|
33310
33362
|
(matchedSessions) => {
|
|
33311
33363
|
setResumeMatchedSessions(matchedSessions);
|
|
33312
33364
|
setIsResumeDialogOpen(true);
|
|
33313
33365
|
},
|
|
33314
33366
|
[]
|
|
33315
33367
|
);
|
|
33316
|
-
const closeResumeDialog = (0,
|
|
33368
|
+
const closeResumeDialog = (0, import_react127.useCallback)(() => {
|
|
33317
33369
|
setIsResumeDialogOpen(false);
|
|
33318
33370
|
setResumeMatchedSessions(void 0);
|
|
33319
33371
|
}, []);
|
|
@@ -33326,7 +33378,7 @@ function useResumeCommand(options) {
|
|
|
33326
33378
|
remount
|
|
33327
33379
|
} = options;
|
|
33328
33380
|
const { addItem, clearItems, loadHistory } = historyManager;
|
|
33329
|
-
const handleResume = (0,
|
|
33381
|
+
const handleResume = (0, import_react127.useCallback)(
|
|
33330
33382
|
async (sessionId) => {
|
|
33331
33383
|
if (!config) {
|
|
33332
33384
|
return;
|
|
@@ -33442,18 +33494,18 @@ __name(useResumeCommand, "useResumeCommand");
|
|
|
33442
33494
|
|
|
33443
33495
|
// packages/cli/src/ui/hooks/useDeleteCommand.ts
|
|
33444
33496
|
init_esbuild_shims();
|
|
33445
|
-
var
|
|
33497
|
+
var import_react128 = __toESM(require_react(), 1);
|
|
33446
33498
|
function useDeleteCommand(options) {
|
|
33447
|
-
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = (0,
|
|
33448
|
-
const openDeleteDialog = (0,
|
|
33499
|
+
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = (0, import_react128.useState)(false);
|
|
33500
|
+
const openDeleteDialog = (0, import_react128.useCallback)(() => {
|
|
33449
33501
|
setIsDeleteDialogOpen(true);
|
|
33450
33502
|
}, []);
|
|
33451
|
-
const closeDeleteDialog = (0,
|
|
33503
|
+
const closeDeleteDialog = (0, import_react128.useCallback)(() => {
|
|
33452
33504
|
setIsDeleteDialogOpen(false);
|
|
33453
33505
|
}, []);
|
|
33454
33506
|
const { config, addItem } = options ?? {};
|
|
33455
|
-
const isDeletingManyRef = (0,
|
|
33456
|
-
const handleDelete = (0,
|
|
33507
|
+
const isDeletingManyRef = (0, import_react128.useRef)(false);
|
|
33508
|
+
const handleDelete = (0, import_react128.useCallback)(
|
|
33457
33509
|
async (sessionId) => {
|
|
33458
33510
|
if (!config) {
|
|
33459
33511
|
return;
|
|
@@ -33512,7 +33564,7 @@ function useDeleteCommand(options) {
|
|
|
33512
33564
|
},
|
|
33513
33565
|
[closeDeleteDialog, config, addItem]
|
|
33514
33566
|
);
|
|
33515
|
-
const handleDeleteMany = (0,
|
|
33567
|
+
const handleDeleteMany = (0, import_react128.useCallback)(
|
|
33516
33568
|
async (sessionIds) => {
|
|
33517
33569
|
if (!config) {
|
|
33518
33570
|
return;
|
|
@@ -33644,7 +33696,7 @@ __name(useDeleteCommand, "useDeleteCommand");
|
|
|
33644
33696
|
|
|
33645
33697
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
33646
33698
|
init_esbuild_shims();
|
|
33647
|
-
var
|
|
33699
|
+
var import_react129 = __toESM(require_react(), 1);
|
|
33648
33700
|
var debugLogger33 = createDebugLogger("SLASH_COMMAND_PROCESSOR");
|
|
33649
33701
|
function hasUserPromptExpansionHooks(config) {
|
|
33650
33702
|
return !!config && !config.getDisableAllHooks?.() && (config.hasHooksForEvent?.("UserPromptExpansion") ?? false);
|
|
@@ -33676,33 +33728,33 @@ function getSkillCommandName(command) {
|
|
|
33676
33728
|
}
|
|
33677
33729
|
__name(getSkillCommandName, "getSkillCommandName");
|
|
33678
33730
|
var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, isProcessing, setIsProcessing, isIdleRef, setGeminiMdFileCount, actions, extensionsUpdateState, isConfigInitialized, logger, updateItem, setSessionName, extensionRefreshState) => {
|
|
33679
|
-
const fallbackExtensionRefreshStateRef = (0,
|
|
33731
|
+
const fallbackExtensionRefreshStateRef = (0, import_react129.useRef)(
|
|
33680
33732
|
null
|
|
33681
33733
|
);
|
|
33682
33734
|
if (!fallbackExtensionRefreshStateRef.current) {
|
|
33683
33735
|
fallbackExtensionRefreshStateRef.current = new ExtensionRefreshState();
|
|
33684
33736
|
}
|
|
33685
33737
|
const activeExtensionRefreshState = extensionRefreshState ?? fallbackExtensionRefreshStateRef.current;
|
|
33686
|
-
const historyRef = (0,
|
|
33687
|
-
(0,
|
|
33738
|
+
const historyRef = (0, import_react129.useRef)(history);
|
|
33739
|
+
(0, import_react129.useLayoutEffect)(() => {
|
|
33688
33740
|
historyRef.current = history;
|
|
33689
33741
|
}, [history]);
|
|
33690
33742
|
const { stats: sessionStats, startNewSession } = useSessionStats();
|
|
33691
|
-
const [commands, setCommands] = (0,
|
|
33692
|
-
const [recentCommands, setRecentCommands] = (0,
|
|
33693
|
-
const [reloadTrigger, setReloadTrigger] = (0,
|
|
33694
|
-
const commandReloadResolversRef = (0,
|
|
33695
|
-
const extensionContentRefreshTimerRef = (0,
|
|
33696
|
-
const extensionContentRefreshRunningRef = (0,
|
|
33697
|
-
const extensionContentRefreshPendingRef = (0,
|
|
33698
|
-
const mountedRef = (0,
|
|
33699
|
-
(0,
|
|
33743
|
+
const [commands, setCommands] = (0, import_react129.useState)([]);
|
|
33744
|
+
const [recentCommands, setRecentCommands] = (0, import_react129.useState)(/* @__PURE__ */ new Map());
|
|
33745
|
+
const [reloadTrigger, setReloadTrigger] = (0, import_react129.useState)(0);
|
|
33746
|
+
const commandReloadResolversRef = (0, import_react129.useRef)([]);
|
|
33747
|
+
const extensionContentRefreshTimerRef = (0, import_react129.useRef)(null);
|
|
33748
|
+
const extensionContentRefreshRunningRef = (0, import_react129.useRef)(false);
|
|
33749
|
+
const extensionContentRefreshPendingRef = (0, import_react129.useRef)(false);
|
|
33750
|
+
const mountedRef = (0, import_react129.useRef)(true);
|
|
33751
|
+
(0, import_react129.useEffect)(() => {
|
|
33700
33752
|
mountedRef.current = true;
|
|
33701
33753
|
return () => {
|
|
33702
33754
|
mountedRef.current = false;
|
|
33703
33755
|
};
|
|
33704
33756
|
}, []);
|
|
33705
|
-
const resolveCommandReloads = (0,
|
|
33757
|
+
const resolveCommandReloads = (0, import_react129.useCallback)((completedTrigger) => {
|
|
33706
33758
|
if (commandReloadResolversRef.current.length === 0) {
|
|
33707
33759
|
return;
|
|
33708
33760
|
}
|
|
@@ -33716,7 +33768,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33716
33768
|
}
|
|
33717
33769
|
commandReloadResolversRef.current = remaining;
|
|
33718
33770
|
}, []);
|
|
33719
|
-
const reloadCommands = (0,
|
|
33771
|
+
const reloadCommands = (0, import_react129.useCallback)(() => {
|
|
33720
33772
|
if (!config) {
|
|
33721
33773
|
return Promise.resolve();
|
|
33722
33774
|
}
|
|
@@ -33731,14 +33783,14 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33731
33783
|
});
|
|
33732
33784
|
});
|
|
33733
33785
|
}, [config]);
|
|
33734
|
-
const clearPendingExtensionContentRefresh = (0,
|
|
33786
|
+
const clearPendingExtensionContentRefresh = (0, import_react129.useCallback)(() => {
|
|
33735
33787
|
if (!extensionContentRefreshTimerRef.current) {
|
|
33736
33788
|
return;
|
|
33737
33789
|
}
|
|
33738
33790
|
clearTimeout(extensionContentRefreshTimerRef.current);
|
|
33739
33791
|
extensionContentRefreshTimerRef.current = null;
|
|
33740
33792
|
}, []);
|
|
33741
|
-
const showExtensionContentRefreshError = (0,
|
|
33793
|
+
const showExtensionContentRefreshError = (0, import_react129.useCallback)(
|
|
33742
33794
|
(error) => {
|
|
33743
33795
|
if (!mountedRef.current) {
|
|
33744
33796
|
return;
|
|
@@ -33758,7 +33810,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33758
33810
|
},
|
|
33759
33811
|
[addItem]
|
|
33760
33812
|
);
|
|
33761
|
-
const runExtensionContentRefresh = (0,
|
|
33813
|
+
const runExtensionContentRefresh = (0, import_react129.useCallback)(async () => {
|
|
33762
33814
|
if (!config) {
|
|
33763
33815
|
return;
|
|
33764
33816
|
}
|
|
@@ -33802,23 +33854,23 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33802
33854
|
reloadCommands,
|
|
33803
33855
|
showExtensionContentRefreshError
|
|
33804
33856
|
]);
|
|
33805
|
-
const [shellConfirmationRequest, setShellConfirmationRequest] = (0,
|
|
33806
|
-
const [confirmationRequest, setConfirmationRequest] = (0,
|
|
33807
|
-
const [sessionShellAllowlist, setSessionShellAllowlist] = (0,
|
|
33857
|
+
const [shellConfirmationRequest, setShellConfirmationRequest] = (0, import_react129.useState)(null);
|
|
33858
|
+
const [confirmationRequest, setConfirmationRequest] = (0, import_react129.useState)(null);
|
|
33859
|
+
const [sessionShellAllowlist, setSessionShellAllowlist] = (0, import_react129.useState)(
|
|
33808
33860
|
/* @__PURE__ */ new Set()
|
|
33809
33861
|
);
|
|
33810
|
-
const [pendingItem, setPendingItem] = (0,
|
|
33862
|
+
const [pendingItem, setPendingItem] = (0, import_react129.useState)(
|
|
33811
33863
|
null
|
|
33812
33864
|
);
|
|
33813
|
-
const [btwItem, setBtwItem] = (0,
|
|
33814
|
-
const btwAbortControllerRef = (0,
|
|
33815
|
-
const cancelBtw = (0,
|
|
33865
|
+
const [btwItem, setBtwItem] = (0, import_react129.useState)(null);
|
|
33866
|
+
const btwAbortControllerRef = (0, import_react129.useRef)(null);
|
|
33867
|
+
const cancelBtw = (0, import_react129.useCallback)(() => {
|
|
33816
33868
|
btwAbortControllerRef.current?.abort();
|
|
33817
33869
|
btwAbortControllerRef.current = null;
|
|
33818
33870
|
setBtwItem(null);
|
|
33819
33871
|
}, []);
|
|
33820
|
-
const abortControllerRef = (0,
|
|
33821
|
-
const cancelSlashCommand = (0,
|
|
33872
|
+
const abortControllerRef = (0, import_react129.useRef)(null);
|
|
33873
|
+
const cancelSlashCommand = (0, import_react129.useCallback)(() => {
|
|
33822
33874
|
cancelBtw();
|
|
33823
33875
|
if (!abortControllerRef.current) {
|
|
33824
33876
|
return;
|
|
@@ -33842,14 +33894,14 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33842
33894
|
},
|
|
33843
33895
|
{ isActive: isProcessing }
|
|
33844
33896
|
);
|
|
33845
|
-
const pendingHistoryItems = (0,
|
|
33897
|
+
const pendingHistoryItems = (0, import_react129.useMemo)(() => {
|
|
33846
33898
|
const items = [];
|
|
33847
33899
|
if (pendingItem != null) {
|
|
33848
33900
|
items.push(pendingItem);
|
|
33849
33901
|
}
|
|
33850
33902
|
return items;
|
|
33851
33903
|
}, [pendingItem]);
|
|
33852
|
-
const addMessage = (0,
|
|
33904
|
+
const addMessage = (0, import_react129.useCallback)(
|
|
33853
33905
|
(message) => {
|
|
33854
33906
|
let historyItemContent;
|
|
33855
33907
|
if (message.type === "about" /* ABOUT */) {
|
|
@@ -33909,7 +33961,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33909
33961
|
},
|
|
33910
33962
|
[addItem]
|
|
33911
33963
|
);
|
|
33912
|
-
const commandContext = (0,
|
|
33964
|
+
const commandContext = (0, import_react129.useMemo)(
|
|
33913
33965
|
() => ({
|
|
33914
33966
|
services: {
|
|
33915
33967
|
config,
|
|
@@ -33981,7 +34033,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33981
34033
|
activeExtensionRefreshState
|
|
33982
34034
|
]
|
|
33983
34035
|
);
|
|
33984
|
-
(0,
|
|
34036
|
+
(0, import_react129.useEffect)(() => {
|
|
33985
34037
|
if (!config) {
|
|
33986
34038
|
return;
|
|
33987
34039
|
}
|
|
@@ -33999,7 +34051,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33999
34051
|
})();
|
|
34000
34052
|
};
|
|
34001
34053
|
}, [config, reloadCommands]);
|
|
34002
|
-
(0,
|
|
34054
|
+
(0, import_react129.useEffect)(() => {
|
|
34003
34055
|
if (!config) {
|
|
34004
34056
|
return;
|
|
34005
34057
|
}
|
|
@@ -34024,7 +34076,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34024
34076
|
}
|
|
34025
34077
|
};
|
|
34026
34078
|
}, [config, reloadCommands]);
|
|
34027
|
-
(0,
|
|
34079
|
+
(0, import_react129.useEffect)(() => {
|
|
34028
34080
|
if (!isConfigInitialized) {
|
|
34029
34081
|
return;
|
|
34030
34082
|
}
|
|
@@ -34039,7 +34091,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34039
34091
|
reloadCommands();
|
|
34040
34092
|
});
|
|
34041
34093
|
}, [config, isConfigInitialized, reloadCommands]);
|
|
34042
|
-
(0,
|
|
34094
|
+
(0, import_react129.useEffect)(() => {
|
|
34043
34095
|
const listener = /* @__PURE__ */ __name((reason) => {
|
|
34044
34096
|
clearPendingExtensionContentRefresh();
|
|
34045
34097
|
addItem(
|
|
@@ -34066,7 +34118,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34066
34118
|
addItem,
|
|
34067
34119
|
clearPendingExtensionContentRefresh
|
|
34068
34120
|
]);
|
|
34069
|
-
(0,
|
|
34121
|
+
(0, import_react129.useEffect)(() => {
|
|
34070
34122
|
activeExtensionRefreshState.on(
|
|
34071
34123
|
"extensions-reload-started" /* ExtensionsReloadStarted */,
|
|
34072
34124
|
clearPendingExtensionContentRefresh
|
|
@@ -34086,7 +34138,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34086
34138
|
);
|
|
34087
34139
|
};
|
|
34088
34140
|
}, [activeExtensionRefreshState, clearPendingExtensionContentRefresh]);
|
|
34089
|
-
(0,
|
|
34141
|
+
(0, import_react129.useEffect)(() => {
|
|
34090
34142
|
if (!config) {
|
|
34091
34143
|
return;
|
|
34092
34144
|
}
|
|
@@ -34112,7 +34164,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34112
34164
|
activeExtensionRefreshState,
|
|
34113
34165
|
runExtensionContentRefresh
|
|
34114
34166
|
]);
|
|
34115
|
-
(0,
|
|
34167
|
+
(0, import_react129.useEffect)(() => {
|
|
34116
34168
|
const controller = new AbortController();
|
|
34117
34169
|
const load = /* @__PURE__ */ __name(async () => {
|
|
34118
34170
|
try {
|
|
@@ -34209,7 +34261,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34209
34261
|
settings,
|
|
34210
34262
|
resolveCommandReloads
|
|
34211
34263
|
]);
|
|
34212
|
-
const handleSlashCommand = (0,
|
|
34264
|
+
const handleSlashCommand = (0, import_react129.useCallback)(
|
|
34213
34265
|
async (rawQuery, oneTimeShellAllowlist, overwriteConfirmed, existingInvocationItemId) => {
|
|
34214
34266
|
if (typeof rawQuery !== "string") {
|
|
34215
34267
|
return false;
|
|
@@ -34765,11 +34817,11 @@ ${commandToExecute.subCommands.map((sc) => ` - ${sc.name}: ${sc.description ||
|
|
|
34765
34817
|
|
|
34766
34818
|
// packages/cli/src/ui/hooks/useDoublePress.ts
|
|
34767
34819
|
init_esbuild_shims();
|
|
34768
|
-
var
|
|
34820
|
+
var import_react130 = __toESM(require_react(), 1);
|
|
34769
34821
|
var DOUBLE_PRESS_TIMEOUT_MS = 800;
|
|
34770
34822
|
function useDoublePress(onDoublePress, onPending) {
|
|
34771
|
-
const timeoutRef = (0,
|
|
34772
|
-
(0,
|
|
34823
|
+
const timeoutRef = (0, import_react130.useRef)(null);
|
|
34824
|
+
(0, import_react130.useEffect)(
|
|
34773
34825
|
() => () => {
|
|
34774
34826
|
if (timeoutRef.current !== null) {
|
|
34775
34827
|
clearTimeout(timeoutRef.current);
|
|
@@ -34778,7 +34830,7 @@ function useDoublePress(onDoublePress, onPending) {
|
|
|
34778
34830
|
},
|
|
34779
34831
|
[]
|
|
34780
34832
|
);
|
|
34781
|
-
return (0,
|
|
34833
|
+
return (0, import_react130.useCallback)(() => {
|
|
34782
34834
|
if (timeoutRef.current !== null) {
|
|
34783
34835
|
clearTimeout(timeoutRef.current);
|
|
34784
34836
|
timeoutRef.current = null;
|
|
@@ -34842,10 +34894,10 @@ __name(formatSessionWindowTitle, "formatSessionWindowTitle");
|
|
|
34842
34894
|
|
|
34843
34895
|
// packages/cli/src/ui/hooks/useLogger.ts
|
|
34844
34896
|
init_esbuild_shims();
|
|
34845
|
-
var
|
|
34897
|
+
var import_react131 = __toESM(require_react(), 1);
|
|
34846
34898
|
var useLogger = /* @__PURE__ */ __name((storage, sessionId) => {
|
|
34847
|
-
const [logger, setLogger] = (0,
|
|
34848
|
-
(0,
|
|
34899
|
+
const [logger, setLogger] = (0, import_react131.useState)(null);
|
|
34900
|
+
(0, import_react131.useEffect)(() => {
|
|
34849
34901
|
if (!sessionId) {
|
|
34850
34902
|
return;
|
|
34851
34903
|
}
|
|
@@ -34866,11 +34918,11 @@ var useLogger = /* @__PURE__ */ __name((storage, sessionId) => {
|
|
|
34866
34918
|
|
|
34867
34919
|
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
34868
34920
|
init_esbuild_shims();
|
|
34869
|
-
var
|
|
34921
|
+
var import_react136 = __toESM(require_react(), 1);
|
|
34870
34922
|
|
|
34871
34923
|
// packages/cli/src/ui/hooks/shellCommandProcessor.ts
|
|
34872
34924
|
init_esbuild_shims();
|
|
34873
|
-
var
|
|
34925
|
+
var import_react132 = __toESM(require_react(), 1);
|
|
34874
34926
|
import crypto2 from "node:crypto";
|
|
34875
34927
|
import path10 from "node:path";
|
|
34876
34928
|
import os5 from "node:os";
|
|
@@ -34903,8 +34955,8 @@ ${modelContent}
|
|
|
34903
34955
|
}
|
|
34904
34956
|
__name(addShellCommandToGeminiHistory, "addShellCommandToGeminiHistory");
|
|
34905
34957
|
var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPendingHistoryItem, onExec, onDebugMessage, config, geminiClient, setShellInputFocused, terminalWidth, terminalHeight) => {
|
|
34906
|
-
const [activeShellPtyId, setActiveShellPtyId] = (0,
|
|
34907
|
-
const handleShellCommand = (0,
|
|
34958
|
+
const [activeShellPtyId, setActiveShellPtyId] = (0, import_react132.useState)(null);
|
|
34959
|
+
const handleShellCommand = (0, import_react132.useCallback)(
|
|
34908
34960
|
(rawQuery, abortSignal) => {
|
|
34909
34961
|
if (typeof rawQuery !== "string" || rawQuery.trim() === "") {
|
|
34910
34962
|
return false;
|
|
@@ -35158,11 +35210,11 @@ ${finalOutput}`;
|
|
|
35158
35210
|
|
|
35159
35211
|
// packages/cli/src/ui/hooks/useStateAndRef.ts
|
|
35160
35212
|
init_esbuild_shims();
|
|
35161
|
-
var
|
|
35213
|
+
var import_react133 = __toESM(require_react(), 1);
|
|
35162
35214
|
var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
35163
|
-
const [state, setState] =
|
|
35164
|
-
const ref =
|
|
35165
|
-
const setStateInternal =
|
|
35215
|
+
const [state, setState] = import_react133.default.useState(initialValue);
|
|
35216
|
+
const ref = import_react133.default.useRef(initialValue);
|
|
35217
|
+
const setStateInternal = import_react133.default.useCallback(
|
|
35166
35218
|
(newStateOrCallback) => {
|
|
35167
35219
|
let newValue;
|
|
35168
35220
|
if (typeof newStateOrCallback === "function") {
|
|
@@ -35180,12 +35232,12 @@ var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
|
35180
35232
|
|
|
35181
35233
|
// packages/cli/src/ui/hooks/useReactToolScheduler.ts
|
|
35182
35234
|
init_esbuild_shims();
|
|
35183
|
-
var
|
|
35235
|
+
var import_react134 = __toESM(require_react(), 1);
|
|
35184
35236
|
import * as path11 from "node:path";
|
|
35185
35237
|
var debugLogger35 = createDebugLogger("REACT_TOOL_SCHEDULER");
|
|
35186
35238
|
function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorClose) {
|
|
35187
|
-
const [toolCallsForDisplay, setToolCallsForDisplay] = (0,
|
|
35188
|
-
const outputUpdateHandler = (0,
|
|
35239
|
+
const [toolCallsForDisplay, setToolCallsForDisplay] = (0, import_react134.useState)([]);
|
|
35240
|
+
const outputUpdateHandler = (0, import_react134.useCallback)(
|
|
35189
35241
|
(toolCallId, outputChunk) => {
|
|
35190
35242
|
if (isShellProgressData(outputChunk)) {
|
|
35191
35243
|
return;
|
|
@@ -35203,13 +35255,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35203
35255
|
},
|
|
35204
35256
|
[]
|
|
35205
35257
|
);
|
|
35206
|
-
const allToolCallsCompleteHandler = (0,
|
|
35258
|
+
const allToolCallsCompleteHandler = (0, import_react134.useCallback)(
|
|
35207
35259
|
async (completedToolCalls) => {
|
|
35208
35260
|
await onComplete(completedToolCalls);
|
|
35209
35261
|
},
|
|
35210
35262
|
[onComplete]
|
|
35211
35263
|
);
|
|
35212
|
-
const toolCallsUpdateHandler = (0,
|
|
35264
|
+
const toolCallsUpdateHandler = (0, import_react134.useCallback)(
|
|
35213
35265
|
(updatedCoreToolCalls) => {
|
|
35214
35266
|
setToolCallsForDisplay(
|
|
35215
35267
|
(prevTrackedCalls) => updatedCoreToolCalls.map((coreTc) => {
|
|
@@ -35236,10 +35288,9 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35236
35288
|
},
|
|
35237
35289
|
[setToolCallsForDisplay]
|
|
35238
35290
|
);
|
|
35239
|
-
const scheduler = (0,
|
|
35291
|
+
const scheduler = (0, import_react134.useMemo)(
|
|
35240
35292
|
() => new CoreToolScheduler({
|
|
35241
35293
|
config,
|
|
35242
|
-
chatRecordingService: config.getChatRecordingService(),
|
|
35243
35294
|
outputUpdateHandler,
|
|
35244
35295
|
onAllToolCallsComplete: allToolCallsCompleteHandler,
|
|
35245
35296
|
onToolCallsUpdate: toolCallsUpdateHandler,
|
|
@@ -35255,7 +35306,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35255
35306
|
onEditorClose
|
|
35256
35307
|
]
|
|
35257
35308
|
);
|
|
35258
|
-
const schedule = (0,
|
|
35309
|
+
const schedule = (0, import_react134.useCallback)(
|
|
35259
35310
|
(request, signal, modelOverride) => {
|
|
35260
35311
|
if (!modelOverride?.endsWith("\0")) {
|
|
35261
35312
|
void scheduler.schedule(request, signal);
|
|
@@ -35282,13 +35333,6 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35282
35333
|
message,
|
|
35283
35334
|
message
|
|
35284
35335
|
);
|
|
35285
|
-
config.getChatRecordingService()?.recordToolResult(responseParts, {
|
|
35286
|
-
callId: toolRequest.callId,
|
|
35287
|
-
status: "error",
|
|
35288
|
-
resultDisplay: message,
|
|
35289
|
-
error: toolError,
|
|
35290
|
-
errorType: "unhandled_exception" /* UNHANDLED_EXCEPTION */
|
|
35291
|
-
});
|
|
35292
35336
|
return {
|
|
35293
35337
|
status: "error",
|
|
35294
35338
|
request: toolRequest,
|
|
@@ -35311,7 +35355,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35311
35355
|
},
|
|
35312
35356
|
[allToolCallsCompleteHandler, config, scheduler]
|
|
35313
35357
|
);
|
|
35314
|
-
const markToolsAsSubmitted = (0,
|
|
35358
|
+
const markToolsAsSubmitted = (0, import_react134.useCallback)(
|
|
35315
35359
|
(callIdsToMark) => {
|
|
35316
35360
|
setToolCallsForDisplay(
|
|
35317
35361
|
(prevCalls) => prevCalls.map(
|
|
@@ -35477,6 +35521,78 @@ __name(mapToDisplay, "mapToDisplay");
|
|
|
35477
35521
|
import { promises as fs17 } from "node:fs";
|
|
35478
35522
|
import path12 from "node:path";
|
|
35479
35523
|
import process14 from "node:process";
|
|
35524
|
+
|
|
35525
|
+
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
35526
|
+
init_esbuild_shims();
|
|
35527
|
+
var import_react135 = __toESM(require_react(), 1);
|
|
35528
|
+
var GOAL_COMMAND_RE = /^\/goal(?:\s|$)/;
|
|
35529
|
+
function useMessageQueue() {
|
|
35530
|
+
const [queuedMessages, setQueuedMessages] = (0, import_react135.useState)([]);
|
|
35531
|
+
const queueRef = (0, import_react135.useRef)([]);
|
|
35532
|
+
const addMessage = (0, import_react135.useCallback)((message, deferUntilIdle = false) => {
|
|
35533
|
+
const trimmedMessage = message.trim();
|
|
35534
|
+
if (trimmedMessage.length > 0) {
|
|
35535
|
+
queueRef.current = [
|
|
35536
|
+
...queueRef.current,
|
|
35537
|
+
{ text: trimmedMessage, deferUntilIdle }
|
|
35538
|
+
];
|
|
35539
|
+
setQueuedMessages(queueRef.current);
|
|
35540
|
+
}
|
|
35541
|
+
}, []);
|
|
35542
|
+
const clearQueue = (0, import_react135.useCallback)(() => {
|
|
35543
|
+
queueRef.current = [];
|
|
35544
|
+
setQueuedMessages([]);
|
|
35545
|
+
}, []);
|
|
35546
|
+
const getQueuedMessagesText = (0, import_react135.useCallback)(() => {
|
|
35547
|
+
if (queuedMessages.length === 0) return "";
|
|
35548
|
+
return queuedMessages.map(({ text }) => text).join("\n\n");
|
|
35549
|
+
}, [queuedMessages]);
|
|
35550
|
+
const popAllMessages = (0, import_react135.useCallback)(() => {
|
|
35551
|
+
const current = queueRef.current;
|
|
35552
|
+
if (current.length === 0) return null;
|
|
35553
|
+
queueRef.current = [];
|
|
35554
|
+
setQueuedMessages([]);
|
|
35555
|
+
return current.map(({ text }) => text).join("\n\n");
|
|
35556
|
+
}, []);
|
|
35557
|
+
const restoreMessages = (0, import_react135.useCallback)((messages) => {
|
|
35558
|
+
const restored = messages.map((text) => text.trim()).filter(Boolean).map((text) => ({ text, deferUntilIdle: false }));
|
|
35559
|
+
if (restored.length === 0) return;
|
|
35560
|
+
queueRef.current = [...restored, ...queueRef.current];
|
|
35561
|
+
setQueuedMessages(queueRef.current);
|
|
35562
|
+
}, []);
|
|
35563
|
+
const drainQueue = (0, import_react135.useCallback)((includeDeferred = false) => {
|
|
35564
|
+
const current = queueRef.current;
|
|
35565
|
+
if (current.length === 0) return [];
|
|
35566
|
+
const shouldDrain = /* @__PURE__ */ __name((message) => (!isSlashCommand(message.text) || !includeDeferred && GOAL_COMMAND_RE.test(message.text)) && (includeDeferred || !message.deferUntilIdle), "shouldDrain");
|
|
35567
|
+
const drained = current.filter(shouldDrain);
|
|
35568
|
+
if (drained.length === 0) return [];
|
|
35569
|
+
const rest = current.filter((message) => !shouldDrain(message));
|
|
35570
|
+
queueRef.current = rest;
|
|
35571
|
+
setQueuedMessages(rest);
|
|
35572
|
+
return drained.map(({ text }) => text);
|
|
35573
|
+
}, []);
|
|
35574
|
+
const popNextSegment = (0, import_react135.useCallback)(() => {
|
|
35575
|
+
const current = queueRef.current;
|
|
35576
|
+
if (current.length === 0) return null;
|
|
35577
|
+
const [head, ...rest] = current;
|
|
35578
|
+
queueRef.current = rest;
|
|
35579
|
+
setQueuedMessages(rest);
|
|
35580
|
+
return head.text;
|
|
35581
|
+
}, []);
|
|
35582
|
+
return {
|
|
35583
|
+
messageQueue: queuedMessages.map(({ text }) => text),
|
|
35584
|
+
addMessage,
|
|
35585
|
+
clearQueue,
|
|
35586
|
+
getQueuedMessagesText,
|
|
35587
|
+
popAllMessages,
|
|
35588
|
+
restoreMessages,
|
|
35589
|
+
drainQueue,
|
|
35590
|
+
popNextSegment
|
|
35591
|
+
};
|
|
35592
|
+
}
|
|
35593
|
+
__name(useMessageQueue, "useMessageQueue");
|
|
35594
|
+
|
|
35595
|
+
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
35480
35596
|
var debugLogger36 = createDebugLogger("GEMINI_STREAM");
|
|
35481
35597
|
function applyModelOverride(modelOverrideRef, inlineActiveRef, value, isInline) {
|
|
35482
35598
|
modelOverrideRef.current = value;
|
|
@@ -35619,16 +35735,16 @@ function charIndexAfterLine(text, keptLines) {
|
|
|
35619
35735
|
}
|
|
35620
35736
|
__name(charIndexAfterLine, "charIndexAfterLine");
|
|
35621
35737
|
var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, config, isConfigInitialized, settings, onDebugMessage, handleSlashCommand, shellModeActive, getPreferredEditor, onAuthError, performMemoryRefresh, modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError, onEditorClose, onCancelSubmit, setShellInputFocused, terminalWidth, terminalHeight, midTurnDrainRef, logger, availableTerminalHeightRef, terminalWidthRef, midTurnRestoreRef) => {
|
|
35622
|
-
const [initError, setInitError] = (0,
|
|
35623
|
-
const abortControllerRef = (0,
|
|
35624
|
-
const flushBufferedStreamEventsRef = (0,
|
|
35625
|
-
const turnCancelledRef = (0,
|
|
35626
|
-
const isSubmittingQueryRef = (0,
|
|
35627
|
-
const lastPromptRef = (0,
|
|
35628
|
-
const lastTurnUserItemRef = (0,
|
|
35629
|
-
const turnSawContentEventRef = (0,
|
|
35630
|
-
const lastPromptErroredRef = (0,
|
|
35631
|
-
const commitItem = (0,
|
|
35738
|
+
const [initError, setInitError] = (0, import_react136.useState)(null);
|
|
35739
|
+
const abortControllerRef = (0, import_react136.useRef)(null);
|
|
35740
|
+
const flushBufferedStreamEventsRef = (0, import_react136.useRef)(/* @__PURE__ */ new Set());
|
|
35741
|
+
const turnCancelledRef = (0, import_react136.useRef)(false);
|
|
35742
|
+
const isSubmittingQueryRef = (0, import_react136.useRef)(false);
|
|
35743
|
+
const lastPromptRef = (0, import_react136.useRef)(null);
|
|
35744
|
+
const lastTurnUserItemRef = (0, import_react136.useRef)(null);
|
|
35745
|
+
const turnSawContentEventRef = (0, import_react136.useRef)(false);
|
|
35746
|
+
const lastPromptErroredRef = (0, import_react136.useRef)(false);
|
|
35747
|
+
const commitItem = (0, import_react136.useCallback)(
|
|
35632
35748
|
(item, userMessageTimestamp) => {
|
|
35633
35749
|
if (item.type === "gemini" && !item.timestamp) {
|
|
35634
35750
|
item.timestamp = Date.now();
|
|
@@ -35638,17 +35754,17 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35638
35754
|
[addItem]
|
|
35639
35755
|
);
|
|
35640
35756
|
const dualOutput = useDualOutput();
|
|
35641
|
-
const [isResponding, setIsResponding] = (0,
|
|
35642
|
-
const activeModelStreamsRef = (0,
|
|
35643
|
-
const [thought, setThought] = (0,
|
|
35644
|
-
const historyRef = (0,
|
|
35645
|
-
(0,
|
|
35757
|
+
const [isResponding, setIsResponding] = (0, import_react136.useState)(false);
|
|
35758
|
+
const activeModelStreamsRef = (0, import_react136.useRef)(0);
|
|
35759
|
+
const [thought, setThought] = (0, import_react136.useState)(null);
|
|
35760
|
+
const historyRef = (0, import_react136.useRef)(history);
|
|
35761
|
+
(0, import_react136.useLayoutEffect)(() => {
|
|
35646
35762
|
historyRef.current = history;
|
|
35647
35763
|
}, [history]);
|
|
35648
|
-
const auxiliaryAbortRefsRef = (0,
|
|
35764
|
+
const auxiliaryAbortRefsRef = (0, import_react136.useRef)(/* @__PURE__ */ new Set());
|
|
35649
35765
|
const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
|
|
35650
35766
|
const [pendingThoughtItem, pendingThoughtItemRef, setPendingThoughtItem] = useStateAndRef(null);
|
|
35651
|
-
const thoughtStartTimeRef = (0,
|
|
35767
|
+
const thoughtStartTimeRef = (0, import_react136.useRef)(null);
|
|
35652
35768
|
const [
|
|
35653
35769
|
pendingRetryErrorItem,
|
|
35654
35770
|
pendingRetryErrorItemRef,
|
|
@@ -35659,21 +35775,21 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35659
35775
|
pendingRetryCountdownItemRef,
|
|
35660
35776
|
setPendingRetryCountdownItem
|
|
35661
35777
|
] = useStateAndRef(null);
|
|
35662
|
-
const retryCountdownTimerRef = (0,
|
|
35778
|
+
const retryCountdownTimerRef = (0, import_react136.useRef)(
|
|
35663
35779
|
null
|
|
35664
35780
|
);
|
|
35665
|
-
const processedMemoryToolsRef = (0,
|
|
35666
|
-
const submitPromptOnCompleteRef = (0,
|
|
35667
|
-
const modelOverrideRef = (0,
|
|
35668
|
-
const inlineModelOverrideActiveRef = (0,
|
|
35669
|
-
const handledProviderToolCallIdsRef = (0,
|
|
35670
|
-
const duplicateProviderToolCallResponseIdsRef = (0,
|
|
35781
|
+
const processedMemoryToolsRef = (0, import_react136.useRef)(/* @__PURE__ */ new Set());
|
|
35782
|
+
const submitPromptOnCompleteRef = (0, import_react136.useRef)(null);
|
|
35783
|
+
const modelOverrideRef = (0, import_react136.useRef)(void 0);
|
|
35784
|
+
const inlineModelOverrideActiveRef = (0, import_react136.useRef)(false);
|
|
35785
|
+
const handledProviderToolCallIdsRef = (0, import_react136.useRef)(/* @__PURE__ */ new Set());
|
|
35786
|
+
const duplicateProviderToolCallResponseIdsRef = (0, import_react136.useRef)(
|
|
35671
35787
|
/* @__PURE__ */ new Set()
|
|
35672
35788
|
);
|
|
35673
|
-
const pendingDuplicateToolResponsesRef = (0,
|
|
35674
|
-
const immediateDuplicateToolResponsesRef = (0,
|
|
35675
|
-
const streamingResponseLengthRef = (0,
|
|
35676
|
-
const [isReceivingContent, setIsReceivingContent] = (0,
|
|
35789
|
+
const pendingDuplicateToolResponsesRef = (0, import_react136.useRef)([]);
|
|
35790
|
+
const immediateDuplicateToolResponsesRef = (0, import_react136.useRef)(null);
|
|
35791
|
+
const streamingResponseLengthRef = (0, import_react136.useRef)(0);
|
|
35792
|
+
const [isReceivingContent, setIsReceivingContent] = (0, import_react136.useState)(false);
|
|
35677
35793
|
const {
|
|
35678
35794
|
startNewPrompt,
|
|
35679
35795
|
getPromptCount,
|
|
@@ -35698,11 +35814,11 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35698
35814
|
getPreferredEditor,
|
|
35699
35815
|
onEditorClose
|
|
35700
35816
|
);
|
|
35701
|
-
const pendingToolCallGroupDisplay = (0,
|
|
35817
|
+
const pendingToolCallGroupDisplay = (0, import_react136.useMemo)(
|
|
35702
35818
|
() => toolCalls.length ? mapToDisplay(toolCalls, config.getProjectRoot()) : void 0,
|
|
35703
35819
|
[toolCalls, config]
|
|
35704
35820
|
);
|
|
35705
|
-
const activeToolPtyId = (0,
|
|
35821
|
+
const activeToolPtyId = (0, import_react136.useMemo)(() => {
|
|
35706
35822
|
const executingShellTool = toolCalls?.find(
|
|
35707
35823
|
(tc) => tc.status === "executing" && tc.request.name === "run_shell_command"
|
|
35708
35824
|
);
|
|
@@ -35711,18 +35827,18 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35711
35827
|
}
|
|
35712
35828
|
return void 0;
|
|
35713
35829
|
}, [toolCalls]);
|
|
35714
|
-
const loopDetectedRef = (0,
|
|
35830
|
+
const loopDetectedRef = (0, import_react136.useRef)(false);
|
|
35715
35831
|
const [
|
|
35716
35832
|
loopDetectionConfirmationRequest,
|
|
35717
35833
|
setLoopDetectionConfirmationRequest
|
|
35718
|
-
] = (0,
|
|
35719
|
-
const stopRetryCountdownTimer = (0,
|
|
35834
|
+
] = (0, import_react136.useState)(null);
|
|
35835
|
+
const stopRetryCountdownTimer = (0, import_react136.useCallback)(() => {
|
|
35720
35836
|
if (retryCountdownTimerRef.current) {
|
|
35721
35837
|
clearInterval(retryCountdownTimerRef.current);
|
|
35722
35838
|
retryCountdownTimerRef.current = null;
|
|
35723
35839
|
}
|
|
35724
35840
|
}, []);
|
|
35725
|
-
const clearRetryCountdown = (0,
|
|
35841
|
+
const clearRetryCountdown = (0, import_react136.useCallback)(() => {
|
|
35726
35842
|
stopRetryCountdownTimer();
|
|
35727
35843
|
skipRetryDelayRef.current = null;
|
|
35728
35844
|
setPendingRetryErrorItem(null);
|
|
@@ -35732,8 +35848,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35732
35848
|
setPendingRetryCountdownItem,
|
|
35733
35849
|
stopRetryCountdownTimer
|
|
35734
35850
|
]);
|
|
35735
|
-
const skipRetryDelayRef = (0,
|
|
35736
|
-
const startRetryCountdown = (0,
|
|
35851
|
+
const skipRetryDelayRef = (0, import_react136.useRef)(null);
|
|
35852
|
+
const startRetryCountdown = (0, import_react136.useCallback)(
|
|
35737
35853
|
(retryInfo) => {
|
|
35738
35854
|
stopRetryCountdownTimer();
|
|
35739
35855
|
skipRetryDelayRef.current = retryInfo.skipDelay;
|
|
@@ -35774,8 +35890,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35774
35890
|
stopRetryCountdownTimer
|
|
35775
35891
|
]
|
|
35776
35892
|
);
|
|
35777
|
-
(0,
|
|
35778
|
-
const onExec = (0,
|
|
35893
|
+
(0, import_react136.useEffect)(() => () => stopRetryCountdownTimer(), [stopRetryCountdownTimer]);
|
|
35894
|
+
const onExec = (0, import_react136.useCallback)(async (done) => {
|
|
35779
35895
|
setIsResponding(true);
|
|
35780
35896
|
await done;
|
|
35781
35897
|
setIsResponding(false);
|
|
@@ -35792,12 +35908,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35792
35908
|
terminalHeight
|
|
35793
35909
|
);
|
|
35794
35910
|
const activePtyId = activeShellPtyId || activeToolPtyId;
|
|
35795
|
-
(0,
|
|
35911
|
+
(0, import_react136.useEffect)(() => {
|
|
35796
35912
|
if (!activePtyId) {
|
|
35797
35913
|
setShellInputFocused(false);
|
|
35798
35914
|
}
|
|
35799
35915
|
}, [activePtyId, setShellInputFocused]);
|
|
35800
|
-
const streamingState = (0,
|
|
35916
|
+
const streamingState = (0, import_react136.useMemo)(() => {
|
|
35801
35917
|
if (toolCalls.some((tc) => tc.status === "awaiting_approval")) {
|
|
35802
35918
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
35803
35919
|
}
|
|
@@ -35815,7 +35931,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35815
35931
|
}
|
|
35816
35932
|
return "idle" /* Idle */;
|
|
35817
35933
|
}, [isResponding, toolCalls]);
|
|
35818
|
-
(0,
|
|
35934
|
+
(0, import_react136.useEffect)(() => {
|
|
35819
35935
|
if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
|
|
35820
35936
|
const lastUserMessageIndex = history.findLastIndex(
|
|
35821
35937
|
(item) => item.type === "user" /* USER */
|
|
@@ -35829,7 +35945,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35829
35945
|
}
|
|
35830
35946
|
}
|
|
35831
35947
|
}, [streamingState, config, history]);
|
|
35832
|
-
const cancelOngoingRequest = (0,
|
|
35948
|
+
const cancelOngoingRequest = (0, import_react136.useCallback)(() => {
|
|
35833
35949
|
if (streamingState !== "responding" /* Responding */) {
|
|
35834
35950
|
return;
|
|
35835
35951
|
}
|
|
@@ -35900,7 +36016,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35900
36016
|
config,
|
|
35901
36017
|
getPromptCount
|
|
35902
36018
|
]);
|
|
35903
|
-
const applyVisionBridgeIfNeeded = (0,
|
|
36019
|
+
const applyVisionBridgeIfNeeded = (0, import_react136.useCallback)(
|
|
35904
36020
|
async (parts, timestamp, signal) => {
|
|
35905
36021
|
if (parts === null || !hasImageParts(parts)) {
|
|
35906
36022
|
return { parts, shouldProceed: true };
|
|
@@ -35965,7 +36081,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35965
36081
|
},
|
|
35966
36082
|
[addItem, config]
|
|
35967
36083
|
);
|
|
35968
|
-
const prepareQueryForGemini = (0,
|
|
36084
|
+
const prepareQueryForGemini = (0, import_react136.useCallback)(
|
|
35969
36085
|
async (query, userMessageTimestamp, abortSignal, prompt_id, submitType) => {
|
|
35970
36086
|
if (turnCancelledRef.current) {
|
|
35971
36087
|
return { queryToSend: null, shouldProceed: false };
|
|
@@ -36116,7 +36232,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36116
36232
|
applyVisionBridgeIfNeeded
|
|
36117
36233
|
]
|
|
36118
36234
|
);
|
|
36119
|
-
const handleContentEvent = (0,
|
|
36235
|
+
const handleContentEvent = (0, import_react136.useCallback)(
|
|
36120
36236
|
(eventValue, currentGeminiMessageBuffer, userMessageTimestamp) => {
|
|
36121
36237
|
if (turnCancelledRef.current) {
|
|
36122
36238
|
return "";
|
|
@@ -36241,7 +36357,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36241
36357
|
terminalWidthRef
|
|
36242
36358
|
]
|
|
36243
36359
|
);
|
|
36244
|
-
const mergeThought = (0,
|
|
36360
|
+
const mergeThought = (0, import_react136.useCallback)(
|
|
36245
36361
|
(incoming) => {
|
|
36246
36362
|
setThought((prev) => {
|
|
36247
36363
|
const incomingDescription = incoming.description ? clampLoadingThoughtDescription(incoming.description) : incoming.description;
|
|
@@ -36270,7 +36386,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36270
36386
|
},
|
|
36271
36387
|
[setThought]
|
|
36272
36388
|
);
|
|
36273
|
-
const handleThoughtEvent = (0,
|
|
36389
|
+
const handleThoughtEvent = (0, import_react136.useCallback)(
|
|
36274
36390
|
(eventValue, currentThoughtBuffer, userMessageTimestamp) => {
|
|
36275
36391
|
if (turnCancelledRef.current) {
|
|
36276
36392
|
return "";
|
|
@@ -36332,7 +36448,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36332
36448
|
},
|
|
36333
36449
|
[addItem, mergeThought, pendingThoughtItemRef, setPendingThoughtItem]
|
|
36334
36450
|
);
|
|
36335
|
-
const commitPendingThought = (0,
|
|
36451
|
+
const commitPendingThought = (0, import_react136.useCallback)(
|
|
36336
36452
|
(userMessageTimestamp) => {
|
|
36337
36453
|
if (pendingThoughtItemRef.current) {
|
|
36338
36454
|
const item = { ...pendingThoughtItemRef.current };
|
|
@@ -36346,7 +36462,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36346
36462
|
},
|
|
36347
36463
|
[addItem, pendingThoughtItemRef, setPendingThoughtItem]
|
|
36348
36464
|
);
|
|
36349
|
-
const handleUserCancelledEvent = (0,
|
|
36465
|
+
const handleUserCancelledEvent = (0, import_react136.useCallback)(
|
|
36350
36466
|
(userMessageTimestamp) => {
|
|
36351
36467
|
if (turnCancelledRef.current) {
|
|
36352
36468
|
return;
|
|
@@ -36386,7 +36502,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36386
36502
|
clearRetryCountdown
|
|
36387
36503
|
]
|
|
36388
36504
|
);
|
|
36389
|
-
const handleErrorEvent = (0,
|
|
36505
|
+
const handleErrorEvent = (0, import_react136.useCallback)(
|
|
36390
36506
|
(eventValue, userMessageTimestamp) => {
|
|
36391
36507
|
lastPromptErroredRef.current = true;
|
|
36392
36508
|
commitPendingThought(userMessageTimestamp);
|
|
@@ -36429,7 +36545,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36429
36545
|
clearRetryCountdown
|
|
36430
36546
|
]
|
|
36431
36547
|
);
|
|
36432
|
-
const handleCitationEvent = (0,
|
|
36548
|
+
const handleCitationEvent = (0, import_react136.useCallback)(
|
|
36433
36549
|
(text, userMessageTimestamp) => {
|
|
36434
36550
|
if (!showCitations(settings)) {
|
|
36435
36551
|
return;
|
|
@@ -36448,7 +36564,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36448
36564
|
settings
|
|
36449
36565
|
]
|
|
36450
36566
|
);
|
|
36451
|
-
const handleFinishedEvent = (0,
|
|
36567
|
+
const handleFinishedEvent = (0, import_react136.useCallback)(
|
|
36452
36568
|
(event, userMessageTimestamp) => {
|
|
36453
36569
|
const finishReason = event.value.reason;
|
|
36454
36570
|
if (!finishReason) {
|
|
@@ -36489,8 +36605,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36489
36605
|
},
|
|
36490
36606
|
[addItem, clearRetryCountdown]
|
|
36491
36607
|
);
|
|
36492
|
-
const autonomousLoopTickResolverRef = (0,
|
|
36493
|
-
const handleChatCompressionEvent = (0,
|
|
36608
|
+
const autonomousLoopTickResolverRef = (0, import_react136.useRef)(null);
|
|
36609
|
+
const handleChatCompressionEvent = (0, import_react136.useCallback)(
|
|
36494
36610
|
(eventValue, userMessageTimestamp) => {
|
|
36495
36611
|
autonomousLoopTickResolverRef.current?.resetCache();
|
|
36496
36612
|
if (pendingHistoryItemRef.current) {
|
|
@@ -36509,7 +36625,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36509
36625
|
},
|
|
36510
36626
|
[addItem, commitItem, config, pendingHistoryItemRef, setPendingHistoryItem]
|
|
36511
36627
|
);
|
|
36512
|
-
const handleMaxSessionTurnsEvent = (0,
|
|
36628
|
+
const handleMaxSessionTurnsEvent = (0, import_react136.useCallback)(
|
|
36513
36629
|
() => addItem(
|
|
36514
36630
|
{
|
|
36515
36631
|
type: "info",
|
|
@@ -36519,7 +36635,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36519
36635
|
),
|
|
36520
36636
|
[addItem, config]
|
|
36521
36637
|
);
|
|
36522
|
-
const handleSessionTokenLimitExceededEvent = (0,
|
|
36638
|
+
const handleSessionTokenLimitExceededEvent = (0, import_react136.useCallback)(
|
|
36523
36639
|
(value) => addItem(
|
|
36524
36640
|
{
|
|
36525
36641
|
type: "error",
|
|
@@ -36534,7 +36650,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36534
36650
|
),
|
|
36535
36651
|
[addItem]
|
|
36536
36652
|
);
|
|
36537
|
-
const handleLoopDetectionConfirmation = (0,
|
|
36653
|
+
const handleLoopDetectionConfirmation = (0, import_react136.useCallback)(
|
|
36538
36654
|
(result) => {
|
|
36539
36655
|
setLoopDetectionConfirmationRequest(null);
|
|
36540
36656
|
if (result.userSelection === "disable") {
|
|
@@ -36558,12 +36674,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36558
36674
|
},
|
|
36559
36675
|
[config, addItem]
|
|
36560
36676
|
);
|
|
36561
|
-
const handleLoopDetectedEvent = (0,
|
|
36677
|
+
const handleLoopDetectedEvent = (0, import_react136.useCallback)(() => {
|
|
36562
36678
|
setLoopDetectionConfirmationRequest({
|
|
36563
36679
|
onComplete: handleLoopDetectionConfirmation
|
|
36564
36680
|
});
|
|
36565
36681
|
}, [handleLoopDetectionConfirmation]);
|
|
36566
|
-
const handleUserPromptSubmitBlockedEvent = (0,
|
|
36682
|
+
const handleUserPromptSubmitBlockedEvent = (0, import_react136.useCallback)(
|
|
36567
36683
|
(value, userMessageTimestamp) => {
|
|
36568
36684
|
if (pendingHistoryItemRef.current) {
|
|
36569
36685
|
commitItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -36580,7 +36696,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36580
36696
|
},
|
|
36581
36697
|
[addItem, commitItem, pendingHistoryItemRef, setPendingHistoryItem]
|
|
36582
36698
|
);
|
|
36583
|
-
const handleStopHookLoopEvent = (0,
|
|
36699
|
+
const handleStopHookLoopEvent = (0, import_react136.useCallback)(
|
|
36584
36700
|
(value, userMessageTimestamp) => {
|
|
36585
36701
|
if (pendingHistoryItemRef.current) {
|
|
36586
36702
|
commitItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -36614,7 +36730,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36614
36730
|
},
|
|
36615
36731
|
[addItem, commitItem, config, pendingHistoryItemRef, setPendingHistoryItem]
|
|
36616
36732
|
);
|
|
36617
|
-
const handleActiveGoalEvent = (0,
|
|
36733
|
+
const handleActiveGoalEvent = (0, import_react136.useCallback)(
|
|
36618
36734
|
(activeGoal) => {
|
|
36619
36735
|
const sessionId = config.getSessionId();
|
|
36620
36736
|
const currentActiveGoal = getActiveGoal(sessionId);
|
|
@@ -36632,7 +36748,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36632
36748
|
},
|
|
36633
36749
|
[config]
|
|
36634
36750
|
);
|
|
36635
|
-
const processGeminiStreamEvents = (0,
|
|
36751
|
+
const processGeminiStreamEvents = (0, import_react136.useCallback)(
|
|
36636
36752
|
async (stream, userMessageTimestamp, signal) => {
|
|
36637
36753
|
let geminiMessageBuffer = "";
|
|
36638
36754
|
let thoughtBuffer = "";
|
|
@@ -36746,7 +36862,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36746
36862
|
flushBufferedStreamEvents();
|
|
36747
36863
|
toolCallRequests.length = 0;
|
|
36748
36864
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
36749
|
-
|
|
36865
|
+
return 1 /* UserCancelled */;
|
|
36750
36866
|
case "error" /* Error */:
|
|
36751
36867
|
flushBufferedStreamEvents();
|
|
36752
36868
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
@@ -36871,11 +36987,11 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36871
36987
|
commitPendingThought(userMessageTimestamp);
|
|
36872
36988
|
discardBufferedStreamEvents();
|
|
36873
36989
|
flushBufferedStreamEventsRef.current.delete(flushBufferedStreamEvents);
|
|
36990
|
+
dualOutput?.finalizeAssistantMessage();
|
|
36874
36991
|
}
|
|
36875
|
-
dualOutput?.finalizeAssistantMessage();
|
|
36876
36992
|
if (toolCallRequests.length > 0 && !signal.aborted && !loopDetectedRef.current) {
|
|
36877
36993
|
const executableToolCallRequests = [];
|
|
36878
|
-
const
|
|
36994
|
+
const duplicateResponses = [];
|
|
36879
36995
|
let duplicatePromptId;
|
|
36880
36996
|
const historyCallIdsWithResponse = geminiClient ? geminiClient.getHistoryFunctionResponseIds() : /* @__PURE__ */ new Set();
|
|
36881
36997
|
const handledProviderIds = /* @__PURE__ */ new Set([
|
|
@@ -36911,26 +37027,27 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36911
37027
|
`[processGeminiStreamEvents] Suppressing duplicate provider tool-call id: ${providerCallId} (tool: ${request.name})`
|
|
36912
37028
|
);
|
|
36913
37029
|
dualOutput?.emitToolResult(request, response);
|
|
36914
|
-
|
|
37030
|
+
duplicateResponses.push({ request, response });
|
|
36915
37031
|
duplicatePromptId ??= request.prompt_id;
|
|
36916
37032
|
continue;
|
|
36917
37033
|
}
|
|
36918
37034
|
handledProviderToolCallIdsRef.current.add(providerCallId);
|
|
36919
37035
|
executableToolCallRequests.push(request);
|
|
36920
37036
|
}
|
|
36921
|
-
if (
|
|
37037
|
+
if (duplicateResponses.length > 0) {
|
|
36922
37038
|
if (executableToolCallRequests.length > 0) {
|
|
36923
37039
|
pendingDuplicateToolResponsesRef.current.push({
|
|
36924
37040
|
executableCallIds: new Set(
|
|
36925
37041
|
executableToolCallRequests.map((request) => request.callId)
|
|
36926
37042
|
),
|
|
36927
37043
|
promptId: duplicatePromptId ?? executableToolCallRequests[0]?.prompt_id,
|
|
36928
|
-
|
|
37044
|
+
callOrder: toolCallRequests.map((request) => request.callId),
|
|
37045
|
+
duplicateResponses
|
|
36929
37046
|
});
|
|
36930
37047
|
} else {
|
|
36931
37048
|
immediateDuplicateToolResponsesRef.current = {
|
|
36932
37049
|
promptId: duplicatePromptId,
|
|
36933
|
-
|
|
37050
|
+
responses: duplicateResponses
|
|
36934
37051
|
};
|
|
36935
37052
|
}
|
|
36936
37053
|
}
|
|
@@ -36971,14 +37088,38 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36971
37088
|
dualOutput
|
|
36972
37089
|
]
|
|
36973
37090
|
);
|
|
36974
|
-
const resolveSteeredMessages = (0,
|
|
37091
|
+
const resolveSteeredMessages = (0, import_react136.useCallback)(
|
|
36975
37092
|
async (messages, signal) => {
|
|
36976
|
-
const
|
|
37093
|
+
const resolvedSegments = [];
|
|
36977
37094
|
const resolvedForRecording = [];
|
|
37095
|
+
const restoreMessages = [];
|
|
37096
|
+
let pendingGoalSegmentIndex;
|
|
36978
37097
|
const timestamp = Date.now();
|
|
36979
37098
|
for (let index = 0; index < messages.length; index += 1) {
|
|
36980
|
-
if (signal.aborted)
|
|
37099
|
+
if (signal.aborted) {
|
|
37100
|
+
restoreMessages.push(...messages.slice(index));
|
|
37101
|
+
break;
|
|
37102
|
+
}
|
|
36981
37103
|
const message = messages[index];
|
|
37104
|
+
if (GOAL_COMMAND_RE.test(message)) {
|
|
37105
|
+
const activeGoalBeforeCommand = getActiveGoal(config.getSessionId());
|
|
37106
|
+
const result = await handleSlashCommand(message);
|
|
37107
|
+
const activeGoalAfterCommand = getActiveGoal(config.getSessionId());
|
|
37108
|
+
if (result && result.type === "submit_prompt") {
|
|
37109
|
+
if (pendingGoalSegmentIndex !== void 0) {
|
|
37110
|
+
resolvedSegments[pendingGoalSegmentIndex] = [];
|
|
37111
|
+
}
|
|
37112
|
+
pendingGoalSegmentIndex = resolvedSegments.length;
|
|
37113
|
+
resolvedSegments.push(normalizePartList(result.content));
|
|
37114
|
+
} else if (activeGoalBeforeCommand?.hookId !== activeGoalAfterCommand?.hookId) {
|
|
37115
|
+
if (pendingGoalSegmentIndex !== void 0) {
|
|
37116
|
+
resolvedSegments[pendingGoalSegmentIndex] = [];
|
|
37117
|
+
pendingGoalSegmentIndex = void 0;
|
|
37118
|
+
}
|
|
37119
|
+
}
|
|
37120
|
+
continue;
|
|
37121
|
+
}
|
|
37122
|
+
restoreMessages.push(message);
|
|
36982
37123
|
const sideEffects = [];
|
|
36983
37124
|
let resolvedQuery = [{ text: message }];
|
|
36984
37125
|
if (isAtCommand(message)) {
|
|
@@ -37041,7 +37182,10 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37041
37182
|
} finally {
|
|
37042
37183
|
clearTimeout(timeoutId);
|
|
37043
37184
|
}
|
|
37044
|
-
if (signal.aborted)
|
|
37185
|
+
if (signal.aborted) {
|
|
37186
|
+
restoreMessages.push(...messages.slice(index + 1));
|
|
37187
|
+
break;
|
|
37188
|
+
}
|
|
37045
37189
|
}
|
|
37046
37190
|
const bridgeResult = await applyVisionBridgeIfNeeded(
|
|
37047
37191
|
resolvedQuery,
|
|
@@ -37049,7 +37193,10 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37049
37193
|
signal
|
|
37050
37194
|
);
|
|
37051
37195
|
if (!bridgeResult.shouldProceed) {
|
|
37052
|
-
if (signal.aborted)
|
|
37196
|
+
if (signal.aborted) {
|
|
37197
|
+
restoreMessages.push(...messages.slice(index + 1));
|
|
37198
|
+
break;
|
|
37199
|
+
}
|
|
37053
37200
|
continue;
|
|
37054
37201
|
}
|
|
37055
37202
|
const messageParts = normalizePartList(
|
|
@@ -37067,19 +37214,24 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37067
37214
|
)
|
|
37068
37215
|
);
|
|
37069
37216
|
}
|
|
37070
|
-
|
|
37071
|
-
resolvedMessages.push({ text: "\n\n" });
|
|
37072
|
-
}
|
|
37073
|
-
resolvedMessages.push(...messageParts);
|
|
37217
|
+
resolvedSegments.push(messageParts);
|
|
37074
37218
|
resolvedForRecording.push({
|
|
37075
37219
|
message,
|
|
37076
37220
|
parts: messageParts,
|
|
37077
37221
|
sideEffects
|
|
37078
37222
|
});
|
|
37079
37223
|
}
|
|
37080
|
-
|
|
37224
|
+
const resolvedMessages = [];
|
|
37225
|
+
for (const segment of resolvedSegments) {
|
|
37226
|
+
if (segment.length === 0) continue;
|
|
37227
|
+
if (resolvedMessages.length > 0) {
|
|
37228
|
+
resolvedMessages.push({ text: "\n\n" });
|
|
37229
|
+
}
|
|
37230
|
+
resolvedMessages.push(...segment);
|
|
37231
|
+
}
|
|
37081
37232
|
return {
|
|
37082
37233
|
parts: resolvedMessages,
|
|
37234
|
+
restoreMessages,
|
|
37083
37235
|
accept: /* @__PURE__ */ __name(() => {
|
|
37084
37236
|
for (const { message, parts, sideEffects } of resolvedForRecording) {
|
|
37085
37237
|
for (const sideEffect of sideEffects) sideEffect();
|
|
@@ -37092,17 +37244,25 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37092
37244
|
}, "accept")
|
|
37093
37245
|
};
|
|
37094
37246
|
},
|
|
37095
|
-
[
|
|
37247
|
+
[
|
|
37248
|
+
addItem,
|
|
37249
|
+
applyVisionBridgeIfNeeded,
|
|
37250
|
+
config,
|
|
37251
|
+
handleSlashCommand,
|
|
37252
|
+
onDebugMessage
|
|
37253
|
+
]
|
|
37096
37254
|
);
|
|
37097
|
-
const resolveDrainedSteerMessages = (0,
|
|
37255
|
+
const resolveDrainedSteerMessages = (0, import_react136.useCallback)(
|
|
37098
37256
|
async (messages, signal) => {
|
|
37099
37257
|
try {
|
|
37100
37258
|
const resolved = await resolveSteeredMessages(messages, signal);
|
|
37101
37259
|
if (signal.aborted) {
|
|
37102
|
-
|
|
37260
|
+
if (resolved.restoreMessages.length > 0) {
|
|
37261
|
+
midTurnRestoreRef?.current?.(resolved.restoreMessages);
|
|
37262
|
+
}
|
|
37103
37263
|
return void 0;
|
|
37104
37264
|
}
|
|
37105
|
-
if (
|
|
37265
|
+
if (resolved.parts.length === 0) return void 0;
|
|
37106
37266
|
let settled = false;
|
|
37107
37267
|
return {
|
|
37108
37268
|
parts: resolved.parts,
|
|
@@ -37114,7 +37274,9 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37114
37274
|
restore: /* @__PURE__ */ __name(() => {
|
|
37115
37275
|
if (settled) return;
|
|
37116
37276
|
settled = true;
|
|
37117
|
-
|
|
37277
|
+
if (resolved.restoreMessages.length > 0) {
|
|
37278
|
+
midTurnRestoreRef?.current?.(resolved.restoreMessages);
|
|
37279
|
+
}
|
|
37118
37280
|
}, "restore")
|
|
37119
37281
|
};
|
|
37120
37282
|
} catch (error) {
|
|
@@ -37127,7 +37289,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37127
37289
|
},
|
|
37128
37290
|
[midTurnRestoreRef, onDebugMessage, resolveSteeredMessages]
|
|
37129
37291
|
);
|
|
37130
|
-
const drainSteerAtBoundary = (0,
|
|
37292
|
+
const drainSteerAtBoundary = (0, import_react136.useCallback)(
|
|
37131
37293
|
async (signal) => {
|
|
37132
37294
|
const messages = midTurnDrainRef?.current?.() ?? [];
|
|
37133
37295
|
if (messages.length === 0) return void 0;
|
|
@@ -37135,7 +37297,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37135
37297
|
},
|
|
37136
37298
|
[midTurnDrainRef, resolveDrainedSteerMessages]
|
|
37137
37299
|
);
|
|
37138
|
-
const submitQuery = (0,
|
|
37300
|
+
const submitQuery = (0, import_react136.useCallback)(
|
|
37139
37301
|
async (query, submitType = "userQuery" /* UserQuery */, prompt_id, metadata) => {
|
|
37140
37302
|
const allowConcurrentBtwDuringResponse = submitType === "userQuery" /* UserQuery */ && streamingState === "responding" /* Responding */ && typeof query === "string" && isBtwCommand(query);
|
|
37141
37303
|
const isTurnContinuation = submitType === "toolResult" /* ToolResult */ || submitType === "steer" /* Steer */;
|
|
@@ -37246,6 +37408,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37246
37408
|
if (!isTurnContinuation) {
|
|
37247
37409
|
streamingResponseLengthRef.current = 0;
|
|
37248
37410
|
}
|
|
37411
|
+
let cleanupReviewLease = false;
|
|
37249
37412
|
try {
|
|
37250
37413
|
if (dualOutput && submitType !== "toolResult" /* ToolResult */) {
|
|
37251
37414
|
const rawParts = typeof finalQueryToSend === "string" ? [finalQueryToSend] : Array.isArray(finalQueryToSend) ? finalQueryToSend : [finalQueryToSend];
|
|
@@ -37272,6 +37435,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37272
37435
|
abortSignal
|
|
37273
37436
|
);
|
|
37274
37437
|
if (processingStatus === 1 /* UserCancelled */) {
|
|
37438
|
+
cleanupReviewLease = true;
|
|
37275
37439
|
submitPromptOnCompleteRef.current = null;
|
|
37276
37440
|
isSubmittingQueryRef.current = false;
|
|
37277
37441
|
metadata?.onDeliveryFailed?.();
|
|
@@ -37284,8 +37448,33 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37284
37448
|
const immediateDuplicateToolResponses = immediateDuplicateToolResponsesRef.current;
|
|
37285
37449
|
if (immediateDuplicateToolResponses) {
|
|
37286
37450
|
immediateDuplicateToolResponsesRef.current = null;
|
|
37451
|
+
const finalized = await finalizeToolResponses(
|
|
37452
|
+
config,
|
|
37453
|
+
immediateDuplicateToolResponses.responses.map(
|
|
37454
|
+
({ request, response }) => ({
|
|
37455
|
+
callId: request.callId,
|
|
37456
|
+
toolName: request.name,
|
|
37457
|
+
responseParts: response.responseParts,
|
|
37458
|
+
persistedOutputFiles: response.persistedOutputFiles
|
|
37459
|
+
})
|
|
37460
|
+
)
|
|
37461
|
+
);
|
|
37462
|
+
const responseParts = finalized.flatMap(
|
|
37463
|
+
(entry) => entry.responseParts
|
|
37464
|
+
);
|
|
37465
|
+
immediateDuplicateToolResponses.responses.forEach(
|
|
37466
|
+
({ request, response }, index) => {
|
|
37467
|
+
config.getChatRecordingService?.()?.recordToolResult?.(finalized[index].responseParts, {
|
|
37468
|
+
callId: request.callId,
|
|
37469
|
+
status: response.error ? "error" : "success",
|
|
37470
|
+
resultDisplay: response.resultDisplay,
|
|
37471
|
+
error: response.error,
|
|
37472
|
+
errorType: response.errorType
|
|
37473
|
+
});
|
|
37474
|
+
}
|
|
37475
|
+
);
|
|
37287
37476
|
await submitQuery(
|
|
37288
|
-
|
|
37477
|
+
responseParts,
|
|
37289
37478
|
"toolResult" /* ToolResult */,
|
|
37290
37479
|
immediateDuplicateToolResponses.promptId
|
|
37291
37480
|
);
|
|
@@ -37295,6 +37484,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37295
37484
|
}
|
|
37296
37485
|
const loopDetected = loopDetectedRef.current;
|
|
37297
37486
|
if (loopDetected) {
|
|
37487
|
+
cleanupReviewLease = true;
|
|
37298
37488
|
loopDetectedRef.current = false;
|
|
37299
37489
|
handleLoopDetectedEvent();
|
|
37300
37490
|
}
|
|
@@ -37328,6 +37518,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37328
37518
|
}
|
|
37329
37519
|
}
|
|
37330
37520
|
} catch (error) {
|
|
37521
|
+
cleanupReviewLease = true;
|
|
37331
37522
|
metadata?.onDeliveryFailed?.();
|
|
37332
37523
|
if (error instanceof UnauthorizedError) {
|
|
37333
37524
|
onAuthError("Session expired or is unauthorized.");
|
|
@@ -37344,6 +37535,13 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37344
37535
|
});
|
|
37345
37536
|
}
|
|
37346
37537
|
} finally {
|
|
37538
|
+
if (cleanupReviewLease) {
|
|
37539
|
+
cleanupReviewWorktreeLeases({
|
|
37540
|
+
sessionId: config.getSessionId(),
|
|
37541
|
+
promptId: prompt_id,
|
|
37542
|
+
repositoryRoot: config.getProjectRoot()
|
|
37543
|
+
});
|
|
37544
|
+
}
|
|
37347
37545
|
submitPromptOnCompleteRef.current = null;
|
|
37348
37546
|
activeModelStreamsRef.current = Math.max(
|
|
37349
37547
|
0,
|
|
@@ -37382,7 +37580,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37382
37580
|
midTurnDrainRef
|
|
37383
37581
|
]
|
|
37384
37582
|
);
|
|
37385
|
-
const retryLastPrompt = (0,
|
|
37583
|
+
const retryLastPrompt = (0, import_react136.useCallback)(async () => {
|
|
37386
37584
|
if (skipRetryDelayRef.current) {
|
|
37387
37585
|
skipRetryDelayRef.current();
|
|
37388
37586
|
skipRetryDelayRef.current = null;
|
|
@@ -37406,7 +37604,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37406
37604
|
clearRetryCountdown();
|
|
37407
37605
|
await submitQuery(lastPrompt, "retry" /* Retry */);
|
|
37408
37606
|
}, [streamingState, addItem, clearRetryCountdown, submitQuery]);
|
|
37409
|
-
const handleApprovalModeChange = (0,
|
|
37607
|
+
const handleApprovalModeChange = (0, import_react136.useCallback)(
|
|
37410
37608
|
async (newApprovalMode) => {
|
|
37411
37609
|
if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "auto-edit" /* AUTO_EDIT */) {
|
|
37412
37610
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
@@ -37441,7 +37639,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37441
37639
|
},
|
|
37442
37640
|
[toolCalls]
|
|
37443
37641
|
);
|
|
37444
|
-
const handleCompletedTools = (0,
|
|
37642
|
+
const handleCompletedTools = (0, import_react136.useCallback)(
|
|
37445
37643
|
async (completedToolCallsFromScheduler) => {
|
|
37446
37644
|
const completedAndReadyToSubmitTools = completedToolCallsFromScheduler.filter(
|
|
37447
37645
|
(tc) => {
|
|
@@ -37521,8 +37719,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37521
37719
|
}
|
|
37522
37720
|
return !isReady;
|
|
37523
37721
|
});
|
|
37524
|
-
const
|
|
37525
|
-
(batch) => batch.
|
|
37722
|
+
const pendingDuplicateResponses = readyDuplicateBatches.flatMap(
|
|
37723
|
+
(batch) => batch.duplicateResponses
|
|
37526
37724
|
);
|
|
37527
37725
|
const pendingDuplicatePromptId = readyDuplicateBatches[0]?.promptId;
|
|
37528
37726
|
for (const toolCall of geminiTools) {
|
|
@@ -37531,9 +37729,67 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37531
37729
|
toolCall.request.args
|
|
37532
37730
|
);
|
|
37533
37731
|
}
|
|
37534
|
-
if (geminiTools.length === 0 &&
|
|
37732
|
+
if (geminiTools.length === 0 && pendingDuplicateResponses.length === 0) {
|
|
37535
37733
|
return;
|
|
37536
37734
|
}
|
|
37735
|
+
const executableQueues = /* @__PURE__ */ new Map();
|
|
37736
|
+
for (const toolCall of geminiTools) {
|
|
37737
|
+
const queue = executableQueues.get(toolCall.request.callId) ?? [];
|
|
37738
|
+
queue.push({
|
|
37739
|
+
request: toolCall.request,
|
|
37740
|
+
response: toolCall.response,
|
|
37741
|
+
status: toolCall.status
|
|
37742
|
+
});
|
|
37743
|
+
executableQueues.set(toolCall.request.callId, queue);
|
|
37744
|
+
}
|
|
37745
|
+
const duplicateQueues = /* @__PURE__ */ new Map();
|
|
37746
|
+
for (const duplicate of pendingDuplicateResponses) {
|
|
37747
|
+
const queue = duplicateQueues.get(duplicate.request.callId) ?? [];
|
|
37748
|
+
queue.push({
|
|
37749
|
+
...duplicate,
|
|
37750
|
+
status: duplicate.response.error ? "error" : "success"
|
|
37751
|
+
});
|
|
37752
|
+
duplicateQueues.set(duplicate.request.callId, queue);
|
|
37753
|
+
}
|
|
37754
|
+
const orderedResponses = [];
|
|
37755
|
+
for (const batch of readyDuplicateBatches) {
|
|
37756
|
+
for (const callId of batch.callOrder) {
|
|
37757
|
+
const executable = executableQueues.get(callId)?.shift();
|
|
37758
|
+
if (executable) {
|
|
37759
|
+
orderedResponses.push(executable);
|
|
37760
|
+
continue;
|
|
37761
|
+
}
|
|
37762
|
+
const duplicate = duplicateQueues.get(callId)?.shift();
|
|
37763
|
+
if (duplicate) orderedResponses.push(duplicate);
|
|
37764
|
+
}
|
|
37765
|
+
}
|
|
37766
|
+
for (const queue of executableQueues.values()) {
|
|
37767
|
+
orderedResponses.push(...queue);
|
|
37768
|
+
}
|
|
37769
|
+
for (const queue of duplicateQueues.values()) {
|
|
37770
|
+
orderedResponses.push(...queue);
|
|
37771
|
+
}
|
|
37772
|
+
const finalizedResponses = await finalizeToolResponses(
|
|
37773
|
+
config,
|
|
37774
|
+
orderedResponses.map(({ request, response }) => ({
|
|
37775
|
+
callId: request.callId,
|
|
37776
|
+
toolName: request.name,
|
|
37777
|
+
responseParts: response.responseParts,
|
|
37778
|
+
persistedOutputFiles: response.persistedOutputFiles
|
|
37779
|
+
}))
|
|
37780
|
+
);
|
|
37781
|
+
const responsesToSend = finalizedResponses.flatMap(
|
|
37782
|
+
(entry) => entry.responseParts
|
|
37783
|
+
);
|
|
37784
|
+
orderedResponses.forEach(({ request, response, status }, index) => {
|
|
37785
|
+
config.getChatRecordingService?.()?.recordToolResult?.(finalizedResponses[index].responseParts, {
|
|
37786
|
+
callId: request.callId,
|
|
37787
|
+
status,
|
|
37788
|
+
resultDisplay: response.resultDisplay,
|
|
37789
|
+
error: response.error,
|
|
37790
|
+
errorType: response.errorType
|
|
37791
|
+
});
|
|
37792
|
+
});
|
|
37537
37793
|
if (turnCancelledRef.current || abortControllerRef.current?.signal.aborted) {
|
|
37538
37794
|
markToolsAsSubmitted(
|
|
37539
37795
|
geminiTools.map((toolCall) => toolCall.request.callId)
|
|
@@ -37543,14 +37799,11 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37543
37799
|
const allToolsCancelled = geminiTools.every(
|
|
37544
37800
|
(tc) => tc.status === "cancelled"
|
|
37545
37801
|
);
|
|
37546
|
-
if (allToolsCancelled &&
|
|
37802
|
+
if (allToolsCancelled && pendingDuplicateResponses.length === 0) {
|
|
37547
37803
|
if (geminiClient) {
|
|
37548
|
-
const combinedParts = geminiTools.flatMap(
|
|
37549
|
-
(toolCall) => toolCall.response.responseParts
|
|
37550
|
-
);
|
|
37551
37804
|
geminiClient.addHistory({
|
|
37552
37805
|
role: "user",
|
|
37553
|
-
parts:
|
|
37806
|
+
parts: responsesToSend
|
|
37554
37807
|
});
|
|
37555
37808
|
config.getArenaAgentClient()?.reportCancelled();
|
|
37556
37809
|
}
|
|
@@ -37560,10 +37813,6 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37560
37813
|
markToolsAsSubmitted(callIdsToMarkAsSubmitted2);
|
|
37561
37814
|
return;
|
|
37562
37815
|
}
|
|
37563
|
-
const responsesToSend = geminiTools.flatMap(
|
|
37564
|
-
(toolCall) => toolCall.response.responseParts
|
|
37565
|
-
);
|
|
37566
|
-
responsesToSend.push(...pendingDuplicateResponseParts);
|
|
37567
37816
|
const callIdsToMarkAsSubmitted = geminiTools.map(
|
|
37568
37817
|
(toolCall) => toolCall.request.callId
|
|
37569
37818
|
);
|
|
@@ -37692,7 +37941,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37692
37941
|
resolveDrainedSteerMessages
|
|
37693
37942
|
]
|
|
37694
37943
|
);
|
|
37695
|
-
const pendingHistoryItems = (0,
|
|
37944
|
+
const pendingHistoryItems = (0, import_react136.useMemo)(
|
|
37696
37945
|
() => [
|
|
37697
37946
|
// Reasoning renders above the streaming answer.
|
|
37698
37947
|
pendingThoughtItem,
|
|
@@ -37709,7 +37958,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37709
37958
|
pendingToolCallGroupDisplay
|
|
37710
37959
|
]
|
|
37711
37960
|
);
|
|
37712
|
-
(0,
|
|
37961
|
+
(0, import_react136.useEffect)(() => {
|
|
37713
37962
|
const saveRestorableToolCalls = /* @__PURE__ */ __name(async () => {
|
|
37714
37963
|
if (!config.getFileCheckpointingEnabled()) {
|
|
37715
37964
|
return;
|
|
@@ -37780,14 +38029,14 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37780
38029
|
}, "saveRestorableToolCalls");
|
|
37781
38030
|
saveRestorableToolCalls();
|
|
37782
38031
|
}, [toolCalls, config, onDebugMessage, history, geminiClient, storage]);
|
|
37783
|
-
const notificationQueueRef = (0,
|
|
37784
|
-
const [notificationTrigger, setNotificationTrigger] = (0,
|
|
37785
|
-
const getAutonomousLoopTickResolver = (0,
|
|
38032
|
+
const notificationQueueRef = (0, import_react136.useRef)([]);
|
|
38033
|
+
const [notificationTrigger, setNotificationTrigger] = (0, import_react136.useState)(0);
|
|
38034
|
+
const getAutonomousLoopTickResolver = (0, import_react136.useCallback)(() => {
|
|
37786
38035
|
autonomousLoopTickResolverRef.current ??= new AutonomousLoopTickResolver();
|
|
37787
38036
|
return autonomousLoopTickResolverRef.current;
|
|
37788
38037
|
}, []);
|
|
37789
|
-
const notificationQueueSessionIdRef = (0,
|
|
37790
|
-
(0,
|
|
38038
|
+
const notificationQueueSessionIdRef = (0, import_react136.useRef)(sessionStates.sessionId);
|
|
38039
|
+
(0, import_react136.useEffect)(() => {
|
|
37791
38040
|
if (notificationQueueSessionIdRef.current === sessionStates.sessionId) {
|
|
37792
38041
|
return;
|
|
37793
38042
|
}
|
|
@@ -37795,9 +38044,9 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37795
38044
|
notificationQueueRef.current = [];
|
|
37796
38045
|
autonomousLoopTickResolverRef.current?.resetCache();
|
|
37797
38046
|
}, [sessionStates.sessionId]);
|
|
37798
|
-
const cronSessionIdRef = (0,
|
|
38047
|
+
const cronSessionIdRef = (0, import_react136.useRef)(sessionStates.sessionId);
|
|
37799
38048
|
cronSessionIdRef.current = sessionStates.sessionId;
|
|
37800
|
-
(0,
|
|
38049
|
+
(0, import_react136.useEffect)(() => {
|
|
37801
38050
|
if (!isConfigInitialized) return;
|
|
37802
38051
|
if (!config.isCronEnabled()) return;
|
|
37803
38052
|
const scheduler = config.getCronScheduler();
|
|
@@ -37850,7 +38099,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37850
38099
|
}
|
|
37851
38100
|
};
|
|
37852
38101
|
}, [config, getAutonomousLoopTickResolver, isConfigInitialized]);
|
|
37853
|
-
(0,
|
|
38102
|
+
(0, import_react136.useEffect)(() => {
|
|
37854
38103
|
const registry = config.getBackgroundTaskRegistry();
|
|
37855
38104
|
registry.setNotificationCallback((displayText, modelText) => {
|
|
37856
38105
|
notificationQueueRef.current.push({
|
|
@@ -37864,7 +38113,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37864
38113
|
registry.setNotificationCallback(void 0);
|
|
37865
38114
|
};
|
|
37866
38115
|
}, [config]);
|
|
37867
|
-
(0,
|
|
38116
|
+
(0, import_react136.useEffect)(() => {
|
|
37868
38117
|
const registry = config.getBackgroundShellRegistry();
|
|
37869
38118
|
registry.setNotificationCallback((displayText, modelText) => {
|
|
37870
38119
|
notificationQueueRef.current.push({
|
|
@@ -37878,7 +38127,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37878
38127
|
registry.setNotificationCallback(void 0);
|
|
37879
38128
|
};
|
|
37880
38129
|
}, [config]);
|
|
37881
|
-
(0,
|
|
38130
|
+
(0, import_react136.useEffect)(() => {
|
|
37882
38131
|
const registry = config.getMonitorRegistry();
|
|
37883
38132
|
registry.setNotificationCallback((displayText, modelText, meta) => {
|
|
37884
38133
|
if (meta.status === "running" && typeof registry.get === "function") {
|
|
@@ -37896,42 +38145,47 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37896
38145
|
registry.setNotificationCallback(void 0);
|
|
37897
38146
|
};
|
|
37898
38147
|
}, [config]);
|
|
37899
|
-
(0,
|
|
38148
|
+
(0, import_react136.useEffect)(() => {
|
|
37900
38149
|
if (streamingState === "idle" /* Idle */ && !isSubmittingQueryRef.current && notificationQueueRef.current.length > 0) {
|
|
37901
|
-
|
|
37902
|
-
|
|
37903
|
-
|
|
37904
|
-
|
|
37905
|
-
|
|
37906
|
-
|
|
37907
|
-
|
|
37908
|
-
|
|
37909
|
-
|
|
37910
|
-
|
|
37911
|
-
|
|
37912
|
-
|
|
38150
|
+
runOutsideAgentContext(() => {
|
|
38151
|
+
const queue = notificationQueueRef.current;
|
|
38152
|
+
const targetType = queue[0].sendMessageType;
|
|
38153
|
+
if (targetType === "cron" /* Cron */) {
|
|
38154
|
+
const item = queue.shift();
|
|
38155
|
+
addItem(
|
|
38156
|
+
{ type: "notification", text: item.displayText },
|
|
38157
|
+
Date.now()
|
|
38158
|
+
);
|
|
38159
|
+
submitQuery(item.modelText, item.sendMessageType, void 0, {
|
|
38160
|
+
notificationDisplayText: item.displayText,
|
|
38161
|
+
onDelivered: item.onDelivered,
|
|
38162
|
+
onDeliveryFailed: item.onDeliveryFailed
|
|
38163
|
+
});
|
|
38164
|
+
return;
|
|
38165
|
+
}
|
|
38166
|
+
let splitIdx = 0;
|
|
38167
|
+
while (splitIdx < queue.length && queue[splitIdx].sendMessageType === targetType) {
|
|
38168
|
+
splitIdx++;
|
|
38169
|
+
}
|
|
38170
|
+
const batch = queue.splice(0, splitIdx);
|
|
38171
|
+
const now = Date.now();
|
|
38172
|
+
for (const item of batch) {
|
|
38173
|
+
addItem(
|
|
38174
|
+
{ type: "notification", text: item.displayText },
|
|
38175
|
+
now
|
|
38176
|
+
);
|
|
38177
|
+
}
|
|
38178
|
+
const combinedModelText = batch.map((e) => e.modelText).join("\n\n");
|
|
38179
|
+
const combinedDisplayText = batch.map((e) => e.displayText).join("; ");
|
|
38180
|
+
submitQuery(combinedModelText, targetType, void 0, {
|
|
38181
|
+
notificationDisplayText: combinedDisplayText
|
|
37913
38182
|
});
|
|
37914
|
-
return;
|
|
37915
|
-
}
|
|
37916
|
-
let splitIdx = 0;
|
|
37917
|
-
while (splitIdx < queue.length && queue[splitIdx].sendMessageType === targetType) {
|
|
37918
|
-
splitIdx++;
|
|
37919
|
-
}
|
|
37920
|
-
const batch = queue.splice(0, splitIdx);
|
|
37921
|
-
const now = Date.now();
|
|
37922
|
-
for (const item of batch) {
|
|
37923
|
-
addItem({ type: "notification", text: item.displayText }, now);
|
|
37924
|
-
}
|
|
37925
|
-
const combinedModelText = batch.map((e) => e.modelText).join("\n\n");
|
|
37926
|
-
const combinedDisplayText = batch.map((e) => e.displayText).join("; ");
|
|
37927
|
-
submitQuery(combinedModelText, targetType, void 0, {
|
|
37928
|
-
notificationDisplayText: combinedDisplayText
|
|
37929
38183
|
});
|
|
37930
38184
|
}
|
|
37931
38185
|
}, [streamingState, submitQuery, notificationTrigger, addItem]);
|
|
37932
|
-
const teammateQueueRef = (0,
|
|
37933
|
-
const [teammateTrigger, setTeammateTrigger] = (0,
|
|
37934
|
-
(0,
|
|
38186
|
+
const teammateQueueRef = (0, import_react136.useRef)([]);
|
|
38187
|
+
const [teammateTrigger, setTeammateTrigger] = (0, import_react136.useState)(0);
|
|
38188
|
+
(0, import_react136.useEffect)(() => {
|
|
37935
38189
|
let boundManager = null;
|
|
37936
38190
|
const handleManagerChange = /* @__PURE__ */ __name((manager) => {
|
|
37937
38191
|
if (boundManager && boundManager !== manager) {
|
|
@@ -37961,7 +38215,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37961
38215
|
}
|
|
37962
38216
|
};
|
|
37963
38217
|
}, [config]);
|
|
37964
|
-
(0,
|
|
38218
|
+
(0, import_react136.useEffect)(() => {
|
|
37965
38219
|
if (streamingState === "idle" /* Idle */ && !isSubmittingQueryRef.current && teammateQueueRef.current.length > 0) {
|
|
37966
38220
|
const batch = teammateQueueRef.current.splice(0);
|
|
37967
38221
|
for (const entry of batch) {
|
|
@@ -37996,7 +38250,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37996
38250
|
|
|
37997
38251
|
// packages/cli/src/ui/hooks/vim.ts
|
|
37998
38252
|
init_esbuild_shims();
|
|
37999
|
-
var
|
|
38253
|
+
var import_react137 = __toESM(require_react(), 1);
|
|
38000
38254
|
import { execFile as execFile7, execFileSync as execFileSync2 } from "child_process";
|
|
38001
38255
|
var DIGIT_MULTIPLIER = 10;
|
|
38002
38256
|
var DEFAULT_COUNT = 1;
|
|
@@ -38232,26 +38486,26 @@ __name(findCharInLineReverse, "findCharInLineReverse");
|
|
|
38232
38486
|
function useVim(buffer, onSubmit) {
|
|
38233
38487
|
const { vimEnabled, vimMode } = useVimModeState();
|
|
38234
38488
|
const { setVimMode } = useVimModeActions();
|
|
38235
|
-
const [state, dispatch] = (0,
|
|
38236
|
-
const bufferRef = (0,
|
|
38237
|
-
const stateRef = (0,
|
|
38489
|
+
const [state, dispatch] = (0, import_react137.useReducer)(vimReducer, initialVimState);
|
|
38490
|
+
const bufferRef = (0, import_react137.useRef)(buffer);
|
|
38491
|
+
const stateRef = (0, import_react137.useRef)(state);
|
|
38238
38492
|
bufferRef.current = buffer;
|
|
38239
38493
|
stateRef.current = state;
|
|
38240
|
-
(0,
|
|
38494
|
+
(0, import_react137.useEffect)(() => {
|
|
38241
38495
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
38242
38496
|
}, [vimMode]);
|
|
38243
|
-
const updateMode = (0,
|
|
38497
|
+
const updateMode = (0, import_react137.useCallback)(
|
|
38244
38498
|
(mode) => {
|
|
38245
38499
|
setVimMode(mode);
|
|
38246
38500
|
dispatch({ type: "SET_MODE", mode });
|
|
38247
38501
|
},
|
|
38248
38502
|
[setVimMode]
|
|
38249
38503
|
);
|
|
38250
|
-
const getCurrentCount = (0,
|
|
38504
|
+
const getCurrentCount = (0, import_react137.useCallback)(
|
|
38251
38505
|
() => stateRef.current.count || DEFAULT_COUNT,
|
|
38252
38506
|
[]
|
|
38253
38507
|
);
|
|
38254
|
-
const yankRange = (0,
|
|
38508
|
+
const yankRange = (0, import_react137.useCallback)(
|
|
38255
38509
|
(startRow, startCol, endRow, endCol, linewise) => {
|
|
38256
38510
|
const lines = bufferRef.current.lines;
|
|
38257
38511
|
let text = "";
|
|
@@ -38266,7 +38520,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38266
38520
|
},
|
|
38267
38521
|
[]
|
|
38268
38522
|
);
|
|
38269
|
-
const executeCommand = (0,
|
|
38523
|
+
const executeCommand = (0, import_react137.useCallback)(
|
|
38270
38524
|
(cmdType, count) => {
|
|
38271
38525
|
switch (cmdType) {
|
|
38272
38526
|
case CMD_TYPES.DELETE_WORD_FORWARD:
|
|
@@ -38667,7 +38921,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38667
38921
|
return { text, linewise: movement === "j" || movement === "k" };
|
|
38668
38922
|
}
|
|
38669
38923
|
__name(extractMovementText, "extractMovementText");
|
|
38670
|
-
const executeFind = (0,
|
|
38924
|
+
const executeFind = (0, import_react137.useCallback)(
|
|
38671
38925
|
(findType, char, count = 1) => {
|
|
38672
38926
|
const [startRow, startCol] = buffer.cursor;
|
|
38673
38927
|
const line = buffer.lines[startRow] ?? "";
|
|
@@ -38703,7 +38957,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38703
38957
|
},
|
|
38704
38958
|
[buffer, dispatch]
|
|
38705
38959
|
);
|
|
38706
|
-
const handleCharRead = (0,
|
|
38960
|
+
const handleCharRead = (0, import_react137.useCallback)(
|
|
38707
38961
|
(char) => {
|
|
38708
38962
|
const readType = state.pendingCharRead;
|
|
38709
38963
|
if (!readType) return false;
|
|
@@ -38746,7 +39000,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38746
39000
|
},
|
|
38747
39001
|
[state.pendingCharRead, buffer, dispatch, executeFind]
|
|
38748
39002
|
);
|
|
38749
|
-
const handleInsertModeInput = (0,
|
|
39003
|
+
const handleInsertModeInput = (0, import_react137.useCallback)(
|
|
38750
39004
|
(normalizedKey) => {
|
|
38751
39005
|
if (normalizedKey.name === "escape") {
|
|
38752
39006
|
buffer.vimEscapeInsertMode();
|
|
@@ -38777,7 +39031,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38777
39031
|
},
|
|
38778
39032
|
[buffer, dispatch, updateMode, onSubmit]
|
|
38779
39033
|
);
|
|
38780
|
-
const normalizeKey = (0,
|
|
39034
|
+
const normalizeKey = (0, import_react137.useCallback)(
|
|
38781
39035
|
(key) => ({
|
|
38782
39036
|
name: key.name || "",
|
|
38783
39037
|
sequence: key.sequence || "",
|
|
@@ -38788,7 +39042,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38788
39042
|
}),
|
|
38789
39043
|
[]
|
|
38790
39044
|
);
|
|
38791
|
-
const handleChangeMovement = (0,
|
|
39045
|
+
const handleChangeMovement = (0, import_react137.useCallback)(
|
|
38792
39046
|
(movement) => {
|
|
38793
39047
|
const count = getCurrentCount();
|
|
38794
39048
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -38809,7 +39063,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38809
39063
|
},
|
|
38810
39064
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
38811
39065
|
);
|
|
38812
|
-
const handleDeleteMovement = (0,
|
|
39066
|
+
const handleDeleteMovement = (0, import_react137.useCallback)(
|
|
38813
39067
|
(movement) => {
|
|
38814
39068
|
const count = getCurrentCount();
|
|
38815
39069
|
const [row, col] = bufferRef.current.cursor;
|
|
@@ -38844,7 +39098,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38844
39098
|
},
|
|
38845
39099
|
[getCurrentCount, dispatch, buffer]
|
|
38846
39100
|
);
|
|
38847
|
-
const handleYankMovement = (0,
|
|
39101
|
+
const handleYankMovement = (0, import_react137.useCallback)(
|
|
38848
39102
|
(movement) => {
|
|
38849
39103
|
const count = getCurrentCount();
|
|
38850
39104
|
const [row, col] = bufferRef.current.cursor;
|
|
@@ -38878,7 +39132,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38878
39132
|
},
|
|
38879
39133
|
[getCurrentCount, dispatch]
|
|
38880
39134
|
);
|
|
38881
|
-
const handleOperatorMotion = (0,
|
|
39135
|
+
const handleOperatorMotion = (0, import_react137.useCallback)(
|
|
38882
39136
|
(operator, motion) => {
|
|
38883
39137
|
const count = getCurrentCount();
|
|
38884
39138
|
const commandMap = {
|
|
@@ -38910,7 +39164,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38910
39164
|
},
|
|
38911
39165
|
[getCurrentCount, executeCommand, dispatch]
|
|
38912
39166
|
);
|
|
38913
|
-
const handleInput = (0,
|
|
39167
|
+
const handleInput = (0, import_react137.useCallback)(
|
|
38914
39168
|
(key) => {
|
|
38915
39169
|
if (!vimEnabled) {
|
|
38916
39170
|
return false;
|
|
@@ -39632,7 +39886,7 @@ __name(buildWorkflowSteeringNotice, "buildWorkflowSteeringNotice");
|
|
|
39632
39886
|
|
|
39633
39887
|
// packages/cli/src/ui/hooks/useAwaySummary.ts
|
|
39634
39888
|
init_esbuild_shims();
|
|
39635
|
-
var
|
|
39889
|
+
var import_react138 = __toESM(require_react(), 1);
|
|
39636
39890
|
var DEFAULT_AWAY_THRESHOLD_MINUTES = 5;
|
|
39637
39891
|
var MIN_USER_MESSAGES_TO_FIRE = 3;
|
|
39638
39892
|
var MIN_USER_MESSAGES_SINCE_LAST_RECAP = 2;
|
|
@@ -39663,15 +39917,15 @@ function useAwaySummary(options) {
|
|
|
39663
39917
|
history,
|
|
39664
39918
|
awayThresholdMinutes
|
|
39665
39919
|
} = options;
|
|
39666
|
-
const blurredAtRef = (0,
|
|
39667
|
-
const recapPendingRef = (0,
|
|
39668
|
-
const inFlightRef = (0,
|
|
39669
|
-
const isIdleRef = (0,
|
|
39920
|
+
const blurredAtRef = (0, import_react138.useRef)(null);
|
|
39921
|
+
const recapPendingRef = (0, import_react138.useRef)(false);
|
|
39922
|
+
const inFlightRef = (0, import_react138.useRef)(null);
|
|
39923
|
+
const isIdleRef = (0, import_react138.useRef)(isIdle);
|
|
39670
39924
|
isIdleRef.current = isIdle;
|
|
39671
|
-
const historyRef = (0,
|
|
39925
|
+
const historyRef = (0, import_react138.useRef)(history);
|
|
39672
39926
|
historyRef.current = history;
|
|
39673
39927
|
const thresholdMs = (awayThresholdMinutes && awayThresholdMinutes > 0 ? awayThresholdMinutes : DEFAULT_AWAY_THRESHOLD_MINUTES) * 60 * 1e3;
|
|
39674
|
-
(0,
|
|
39928
|
+
(0, import_react138.useEffect)(() => {
|
|
39675
39929
|
if (!enabled || !config) {
|
|
39676
39930
|
inFlightRef.current?.abort();
|
|
39677
39931
|
inFlightRef.current = null;
|
|
@@ -39723,7 +39977,7 @@ function useAwaySummary(options) {
|
|
|
39723
39977
|
recapPendingRef.current = false;
|
|
39724
39978
|
});
|
|
39725
39979
|
}, [enabled, config, isFocused, isIdle, addItem, thresholdMs]);
|
|
39726
|
-
(0,
|
|
39980
|
+
(0, import_react138.useEffect)(
|
|
39727
39981
|
() => () => {
|
|
39728
39982
|
inFlightRef.current?.abort();
|
|
39729
39983
|
},
|
|
@@ -39734,14 +39988,14 @@ __name(useAwaySummary, "useAwaySummary");
|
|
|
39734
39988
|
|
|
39735
39989
|
// packages/cli/src/ui/hooks/useBracketedPaste.ts
|
|
39736
39990
|
init_esbuild_shims();
|
|
39737
|
-
var
|
|
39991
|
+
var import_react139 = __toESM(require_react(), 1);
|
|
39738
39992
|
var ENABLE_BRACKETED_PASTE = "\x1B[?2004h";
|
|
39739
39993
|
var DISABLE_BRACKETED_PASTE = "\x1B[?2004l";
|
|
39740
39994
|
var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
39741
39995
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
39742
39996
|
process.stdout.write(DISABLE_BRACKETED_PASTE);
|
|
39743
39997
|
}, "cleanup");
|
|
39744
|
-
(0,
|
|
39998
|
+
(0, import_react139.useEffect)(() => {
|
|
39745
39999
|
process.stdout.write(ENABLE_BRACKETED_PASTE);
|
|
39746
40000
|
process.on("exit", cleanup);
|
|
39747
40001
|
process.on("SIGINT", cleanup);
|
|
@@ -39760,23 +40014,23 @@ init_esbuild_shims();
|
|
|
39760
40014
|
|
|
39761
40015
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
39762
40016
|
init_esbuild_shims();
|
|
39763
|
-
var
|
|
40017
|
+
var import_react140 = __toESM(require_react(), 1);
|
|
39764
40018
|
var WITTY_LOADING_PHRASES = ["I'm Feeling Lucky"];
|
|
39765
40019
|
var PHRASE_CHANGE_INTERVAL_MS = 15e3;
|
|
39766
40020
|
var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases) => {
|
|
39767
40021
|
const currentLanguage = getCurrentLanguage();
|
|
39768
|
-
const loadingPhrases = (0,
|
|
40022
|
+
const loadingPhrases = (0, import_react140.useMemo)(() => {
|
|
39769
40023
|
if (customPhrases && customPhrases.length > 0) {
|
|
39770
40024
|
return customPhrases;
|
|
39771
40025
|
}
|
|
39772
40026
|
const translatedPhrases = ta("WITTY_LOADING_PHRASES");
|
|
39773
40027
|
return translatedPhrases.length > 0 ? translatedPhrases : WITTY_LOADING_PHRASES;
|
|
39774
40028
|
}, [customPhrases, currentLanguage]);
|
|
39775
|
-
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0,
|
|
40029
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0, import_react140.useState)(
|
|
39776
40030
|
loadingPhrases[0]
|
|
39777
40031
|
);
|
|
39778
|
-
const phraseIntervalRef = (0,
|
|
39779
|
-
(0,
|
|
40032
|
+
const phraseIntervalRef = (0, import_react140.useRef)(null);
|
|
40033
|
+
(0, import_react140.useEffect)(() => {
|
|
39780
40034
|
if (isWaiting) {
|
|
39781
40035
|
setCurrentLoadingPhrase(t("Waiting for user confirmation..."));
|
|
39782
40036
|
if (phraseIntervalRef.current) {
|
|
@@ -39813,9 +40067,9 @@ var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases
|
|
|
39813
40067
|
}, "usePhraseCycler");
|
|
39814
40068
|
|
|
39815
40069
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
39816
|
-
var
|
|
40070
|
+
var import_react141 = __toESM(require_react(), 1);
|
|
39817
40071
|
var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhrases, currentCandidatesTokens, currentStreamingChars, isToolExecuting2 = false) => {
|
|
39818
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
40072
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react141.useState)(0);
|
|
39819
40073
|
const isTimerActive = streamingState === "responding" /* Responding */;
|
|
39820
40074
|
const elapsedTimeFromTimer = useTimer(
|
|
39821
40075
|
isTimerActive,
|
|
@@ -39829,17 +40083,17 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
39829
40083
|
isWaiting,
|
|
39830
40084
|
customWittyPhrases
|
|
39831
40085
|
);
|
|
39832
|
-
const [retainedElapsedTime, setRetainedElapsedTime] = (0,
|
|
39833
|
-
const [taskStartTokens, setTaskStartTokensState] = (0,
|
|
39834
|
-
const [taskStartStreamingChars, setTaskStartStreamingCharsState] = (0,
|
|
39835
|
-
const taskStartTokensRef = (0,
|
|
39836
|
-
const taskStartStreamingCharsRef = (0,
|
|
39837
|
-
const pauseStartTokensRef = (0,
|
|
39838
|
-
const pauseStartStreamingCharsRef = (0,
|
|
39839
|
-
const pauseBaseTaskStartTokensRef = (0,
|
|
39840
|
-
const pauseBaseTaskStartStreamingCharsRef = (0,
|
|
39841
|
-
const prevStreamingStateRef = (0,
|
|
39842
|
-
(0,
|
|
40086
|
+
const [retainedElapsedTime, setRetainedElapsedTime] = (0, import_react141.useState)(0);
|
|
40087
|
+
const [taskStartTokens, setTaskStartTokensState] = (0, import_react141.useState)(0);
|
|
40088
|
+
const [taskStartStreamingChars, setTaskStartStreamingCharsState] = (0, import_react141.useState)(0);
|
|
40089
|
+
const taskStartTokensRef = (0, import_react141.useRef)(0);
|
|
40090
|
+
const taskStartStreamingCharsRef = (0, import_react141.useRef)(0);
|
|
40091
|
+
const pauseStartTokensRef = (0, import_react141.useRef)(null);
|
|
40092
|
+
const pauseStartStreamingCharsRef = (0, import_react141.useRef)(null);
|
|
40093
|
+
const pauseBaseTaskStartTokensRef = (0, import_react141.useRef)(0);
|
|
40094
|
+
const pauseBaseTaskStartStreamingCharsRef = (0, import_react141.useRef)(0);
|
|
40095
|
+
const prevStreamingStateRef = (0, import_react141.useRef)(null);
|
|
40096
|
+
(0, import_react141.useEffect)(() => {
|
|
39843
40097
|
const currentTokens = currentCandidatesTokens ?? 0;
|
|
39844
40098
|
const currentChars = currentStreamingChars ?? 0;
|
|
39845
40099
|
const setTaskStartTokens = /* @__PURE__ */ __name((tokens) => {
|
|
@@ -39910,7 +40164,7 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
39910
40164
|
|
|
39911
40165
|
// packages/cli/src/ui/hooks/useTerminalProgress.ts
|
|
39912
40166
|
init_esbuild_shims();
|
|
39913
|
-
var
|
|
40167
|
+
var import_react142 = __toESM(require_react(), 1);
|
|
39914
40168
|
var PROGRESS_CLEAR = wrapForMultiplexer(`${OSC_PREFIX}9;4;0;${BEL}`);
|
|
39915
40169
|
var PROGRESS_INDETERMINATE = wrapForMultiplexer(`${OSC_PREFIX}9;4;3;;${BEL}`);
|
|
39916
40170
|
function isProgressBarSupported() {
|
|
@@ -39925,13 +40179,13 @@ function isProgressBarSupported() {
|
|
|
39925
40179
|
__name(isProgressBarSupported, "isProgressBarSupported");
|
|
39926
40180
|
function useTerminalProgress(streamingState, hasToolExecuting) {
|
|
39927
40181
|
const { stdout } = use_stdout_default();
|
|
39928
|
-
const writeProgress = (0,
|
|
40182
|
+
const writeProgress = (0, import_react142.useCallback)(
|
|
39929
40183
|
(seq) => {
|
|
39930
40184
|
stdout?.write(seq);
|
|
39931
40185
|
},
|
|
39932
40186
|
[stdout]
|
|
39933
40187
|
);
|
|
39934
|
-
(0,
|
|
40188
|
+
(0, import_react142.useEffect)(() => {
|
|
39935
40189
|
if (!isProgressBarSupported()) return;
|
|
39936
40190
|
if (streamingState === "responding" /* Responding */ && hasToolExecuting) {
|
|
39937
40191
|
writeProgress(PROGRESS_INDETERMINATE);
|
|
@@ -39942,7 +40196,7 @@ function useTerminalProgress(streamingState, hasToolExecuting) {
|
|
|
39942
40196
|
writeProgress(PROGRESS_CLEAR);
|
|
39943
40197
|
};
|
|
39944
40198
|
}, [streamingState, hasToolExecuting, writeProgress]);
|
|
39945
|
-
(0,
|
|
40199
|
+
(0, import_react142.useEffect)(() => {
|
|
39946
40200
|
if (!isProgressBarSupported()) return;
|
|
39947
40201
|
const clearOnExit = /* @__PURE__ */ __name(() => {
|
|
39948
40202
|
stdout?.write(PROGRESS_CLEAR);
|
|
@@ -39957,20 +40211,20 @@ __name(useTerminalProgress, "useTerminalProgress");
|
|
|
39957
40211
|
|
|
39958
40212
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
39959
40213
|
init_esbuild_shims();
|
|
39960
|
-
var
|
|
40214
|
+
var import_react143 = __toESM(require_react(), 1);
|
|
39961
40215
|
import * as process15 from "node:process";
|
|
39962
40216
|
var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
39963
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
39964
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
39965
|
-
const [isRestarting, setIsRestarting] = (0,
|
|
40217
|
+
const [isTrusted, setIsTrusted] = (0, import_react143.useState)(void 0);
|
|
40218
|
+
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0, import_react143.useState)(false);
|
|
40219
|
+
const [isRestarting, setIsRestarting] = (0, import_react143.useState)(false);
|
|
39966
40220
|
const folderTrust = settings.merged.security?.folderTrust?.enabled;
|
|
39967
|
-
(0,
|
|
40221
|
+
(0, import_react143.useEffect)(() => {
|
|
39968
40222
|
const { isTrusted: trusted } = isWorkspaceTrusted(settings.merged);
|
|
39969
40223
|
setIsTrusted(trusted);
|
|
39970
40224
|
setIsFolderTrustDialogOpen(trusted === void 0);
|
|
39971
40225
|
onTrustChange(trusted);
|
|
39972
40226
|
}, [folderTrust, onTrustChange, settings.merged]);
|
|
39973
|
-
const handleFolderTrustSelect = (0,
|
|
40227
|
+
const handleFolderTrustSelect = (0, import_react143.useCallback)(
|
|
39974
40228
|
(choice) => {
|
|
39975
40229
|
const trustedFolders = loadTrustedFolders();
|
|
39976
40230
|
const cwd3 = process15.cwd();
|
|
@@ -40013,7 +40267,7 @@ var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
|
40013
40267
|
|
|
40014
40268
|
// packages/cli/src/ui/hooks/useMcpApproval.ts
|
|
40015
40269
|
init_esbuild_shims();
|
|
40016
|
-
var
|
|
40270
|
+
var import_react144 = __toESM(require_react(), 1);
|
|
40017
40271
|
function sourceLabel(scope) {
|
|
40018
40272
|
switch (scope) {
|
|
40019
40273
|
case "workspace":
|
|
@@ -40049,8 +40303,8 @@ function summarize(config) {
|
|
|
40049
40303
|
}
|
|
40050
40304
|
__name(summarize, "summarize");
|
|
40051
40305
|
var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
40052
|
-
const [queue, setQueue] = (0,
|
|
40053
|
-
const computePending = (0,
|
|
40306
|
+
const [queue, setQueue] = (0, import_react144.useState)([]);
|
|
40307
|
+
const computePending = (0, import_react144.useCallback)(() => {
|
|
40054
40308
|
if (config.getApprovalMode() === "yolo" /* YOLO */) return [];
|
|
40055
40309
|
const servers = config.getMcpServers() ?? {};
|
|
40056
40310
|
const approvals = loadMcpApprovals();
|
|
@@ -40062,10 +40316,10 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40062
40316
|
source: sourceLabel(c.scope)
|
|
40063
40317
|
}));
|
|
40064
40318
|
}, [config]);
|
|
40065
|
-
(0,
|
|
40319
|
+
(0, import_react144.useEffect)(() => {
|
|
40066
40320
|
setQueue(computePending());
|
|
40067
40321
|
}, [computePending]);
|
|
40068
|
-
(0,
|
|
40322
|
+
(0, import_react144.useEffect)(() => {
|
|
40069
40323
|
const onPendingChanged = /* @__PURE__ */ __name(() => {
|
|
40070
40324
|
setQueue(computePending());
|
|
40071
40325
|
}, "onPendingChanged");
|
|
@@ -40074,7 +40328,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40074
40328
|
appEvents.off("mcp-pending-approval-changed" /* McpPendingApprovalChanged */, onPendingChanged);
|
|
40075
40329
|
};
|
|
40076
40330
|
}, [computePending]);
|
|
40077
|
-
const reconnect = (0,
|
|
40331
|
+
const reconnect = (0, import_react144.useCallback)(
|
|
40078
40332
|
(name) => {
|
|
40079
40333
|
config.approveMcpServerForSession(name);
|
|
40080
40334
|
const registry = config.getToolRegistry();
|
|
@@ -40086,7 +40340,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40086
40340
|
},
|
|
40087
40341
|
[config]
|
|
40088
40342
|
);
|
|
40089
|
-
const handleMcpApprovalSelect = (0,
|
|
40343
|
+
const handleMcpApprovalSelect = (0, import_react144.useCallback)(
|
|
40090
40344
|
async (choice) => {
|
|
40091
40345
|
const approvals = loadMcpApprovals();
|
|
40092
40346
|
const root = config.getWorkingDir();
|
|
@@ -40138,7 +40392,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40138
40392
|
|
|
40139
40393
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
40140
40394
|
init_esbuild_shims();
|
|
40141
|
-
var
|
|
40395
|
+
var import_react145 = __toESM(require_react(), 1);
|
|
40142
40396
|
|
|
40143
40397
|
// packages/cli/src/services/command-migration-tool.ts
|
|
40144
40398
|
init_esbuild_shims();
|
|
@@ -40209,9 +40463,9 @@ __name(migrateTomlCommands, "migrateTomlCommands");
|
|
|
40209
40463
|
|
|
40210
40464
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
40211
40465
|
function useCommandMigration(settings, storage) {
|
|
40212
|
-
const [showMigrationNudge, setShowMigrationNudge] = (0,
|
|
40213
|
-
const [tomlFiles, setTomlFiles] = (0,
|
|
40214
|
-
(0,
|
|
40466
|
+
const [showMigrationNudge, setShowMigrationNudge] = (0, import_react145.useState)(false);
|
|
40467
|
+
const [tomlFiles, setTomlFiles] = (0, import_react145.useState)([]);
|
|
40468
|
+
(0, import_react145.useEffect)(() => {
|
|
40215
40469
|
let cancelled = false;
|
|
40216
40470
|
const checkTomlCommands = /* @__PURE__ */ __name(async () => {
|
|
40217
40471
|
const allFiles = [];
|
|
@@ -40277,81 +40531,12 @@ function sendNotification(opts, terminal, enabled) {
|
|
|
40277
40531
|
}
|
|
40278
40532
|
__name(sendNotification, "sendNotification");
|
|
40279
40533
|
|
|
40280
|
-
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
40281
|
-
init_esbuild_shims();
|
|
40282
|
-
var import_react144 = __toESM(require_react(), 1);
|
|
40283
|
-
function useMessageQueue() {
|
|
40284
|
-
const [queuedMessages, setQueuedMessages] = (0, import_react144.useState)([]);
|
|
40285
|
-
const queueRef = (0, import_react144.useRef)([]);
|
|
40286
|
-
const addMessage = (0, import_react144.useCallback)((message, deferUntilIdle = false) => {
|
|
40287
|
-
const trimmedMessage = message.trim();
|
|
40288
|
-
if (trimmedMessage.length > 0) {
|
|
40289
|
-
queueRef.current = [
|
|
40290
|
-
...queueRef.current,
|
|
40291
|
-
{ text: trimmedMessage, deferUntilIdle }
|
|
40292
|
-
];
|
|
40293
|
-
setQueuedMessages(queueRef.current);
|
|
40294
|
-
}
|
|
40295
|
-
}, []);
|
|
40296
|
-
const clearQueue = (0, import_react144.useCallback)(() => {
|
|
40297
|
-
queueRef.current = [];
|
|
40298
|
-
setQueuedMessages([]);
|
|
40299
|
-
}, []);
|
|
40300
|
-
const getQueuedMessagesText = (0, import_react144.useCallback)(() => {
|
|
40301
|
-
if (queuedMessages.length === 0) return "";
|
|
40302
|
-
return queuedMessages.map(({ text }) => text).join("\n\n");
|
|
40303
|
-
}, [queuedMessages]);
|
|
40304
|
-
const popAllMessages = (0, import_react144.useCallback)(() => {
|
|
40305
|
-
const current = queueRef.current;
|
|
40306
|
-
if (current.length === 0) return null;
|
|
40307
|
-
queueRef.current = [];
|
|
40308
|
-
setQueuedMessages([]);
|
|
40309
|
-
return current.map(({ text }) => text).join("\n\n");
|
|
40310
|
-
}, []);
|
|
40311
|
-
const restoreMessages = (0, import_react144.useCallback)((messages) => {
|
|
40312
|
-
const restored = messages.map((text) => text.trim()).filter(Boolean).map((text) => ({ text, deferUntilIdle: false }));
|
|
40313
|
-
if (restored.length === 0) return;
|
|
40314
|
-
queueRef.current = [...restored, ...queueRef.current];
|
|
40315
|
-
setQueuedMessages(queueRef.current);
|
|
40316
|
-
}, []);
|
|
40317
|
-
const drainQueue = (0, import_react144.useCallback)((includeDeferred = false) => {
|
|
40318
|
-
const current = queueRef.current;
|
|
40319
|
-
if (current.length === 0) return [];
|
|
40320
|
-
const shouldDrain = /* @__PURE__ */ __name((message) => !isSlashCommand(message.text) && (includeDeferred || !message.deferUntilIdle), "shouldDrain");
|
|
40321
|
-
const drained = current.filter(shouldDrain);
|
|
40322
|
-
if (drained.length === 0) return [];
|
|
40323
|
-
const rest = current.filter((message) => !shouldDrain(message));
|
|
40324
|
-
queueRef.current = rest;
|
|
40325
|
-
setQueuedMessages(rest);
|
|
40326
|
-
return drained.map(({ text }) => text);
|
|
40327
|
-
}, []);
|
|
40328
|
-
const popNextSegment = (0, import_react144.useCallback)(() => {
|
|
40329
|
-
const current = queueRef.current;
|
|
40330
|
-
if (current.length === 0) return null;
|
|
40331
|
-
const [head, ...rest] = current;
|
|
40332
|
-
queueRef.current = rest;
|
|
40333
|
-
setQueuedMessages(rest);
|
|
40334
|
-
return head.text;
|
|
40335
|
-
}, []);
|
|
40336
|
-
return {
|
|
40337
|
-
messageQueue: queuedMessages.map(({ text }) => text),
|
|
40338
|
-
addMessage,
|
|
40339
|
-
clearQueue,
|
|
40340
|
-
getQueuedMessagesText,
|
|
40341
|
-
popAllMessages,
|
|
40342
|
-
restoreMessages,
|
|
40343
|
-
drainQueue,
|
|
40344
|
-
popNextSegment
|
|
40345
|
-
};
|
|
40346
|
-
}
|
|
40347
|
-
__name(useMessageQueue, "useMessageQueue");
|
|
40348
|
-
|
|
40349
40534
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
40350
40535
|
init_esbuild_shims();
|
|
40351
|
-
var
|
|
40536
|
+
var import_react146 = __toESM(require_react(), 1);
|
|
40352
40537
|
function useGitBranchName(cwd3) {
|
|
40353
|
-
const [branchName, setBranchName] = (0,
|
|
40354
|
-
(0,
|
|
40538
|
+
const [branchName, setBranchName] = (0, import_react146.useState)(void 0);
|
|
40539
|
+
(0, import_react146.useEffect)(() => {
|
|
40355
40540
|
let cancelled = false;
|
|
40356
40541
|
let dispose;
|
|
40357
40542
|
const refresh = /* @__PURE__ */ __name(async () => {
|
|
@@ -40384,13 +40569,13 @@ __name(useGitBranchName, "useGitBranchName");
|
|
|
40384
40569
|
|
|
40385
40570
|
// packages/cli/src/ui/hooks/useWorktreeSession.ts
|
|
40386
40571
|
init_esbuild_shims();
|
|
40387
|
-
var
|
|
40572
|
+
var import_react147 = __toESM(require_react(), 1);
|
|
40388
40573
|
import fs19 from "node:fs";
|
|
40389
40574
|
import fsPromises from "node:fs/promises";
|
|
40390
40575
|
import path14 from "node:path";
|
|
40391
40576
|
function useWorktreeSession(config) {
|
|
40392
|
-
const [session, setSession] = (0,
|
|
40393
|
-
(0,
|
|
40577
|
+
const [session, setSession] = (0, import_react147.useState)(null);
|
|
40578
|
+
(0, import_react147.useEffect)(() => {
|
|
40394
40579
|
let cancelled = false;
|
|
40395
40580
|
const safeLoad = /* @__PURE__ */ __name(async () => {
|
|
40396
40581
|
try {
|
|
@@ -40430,7 +40615,7 @@ __name(useWorktreeSession, "useWorktreeSession");
|
|
|
40430
40615
|
|
|
40431
40616
|
// packages/cli/src/ui/hooks/useExtensionUpdates.ts
|
|
40432
40617
|
init_esbuild_shims();
|
|
40433
|
-
var
|
|
40618
|
+
var import_react148 = __toESM(require_react(), 1);
|
|
40434
40619
|
function confirmationRequestsReducer(state, action) {
|
|
40435
40620
|
switch (action.type) {
|
|
40436
40621
|
case "add":
|
|
@@ -40447,8 +40632,8 @@ var useConfirmUpdateRequests = /* @__PURE__ */ __name(() => {
|
|
|
40447
40632
|
const [
|
|
40448
40633
|
confirmUpdateExtensionRequests,
|
|
40449
40634
|
dispatchConfirmUpdateExtensionRequests
|
|
40450
|
-
] = (0,
|
|
40451
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
40635
|
+
] = (0, import_react148.useReducer)(confirmationRequestsReducer, []);
|
|
40636
|
+
const addConfirmUpdateExtensionRequest = (0, import_react148.useCallback)(
|
|
40452
40637
|
(original) => {
|
|
40453
40638
|
const wrappedRequest = {
|
|
40454
40639
|
prompt: original.prompt,
|
|
@@ -40486,11 +40671,11 @@ function settingInputRequestsReducer(state, action) {
|
|
|
40486
40671
|
}
|
|
40487
40672
|
__name(settingInputRequestsReducer, "settingInputRequestsReducer");
|
|
40488
40673
|
var useSettingInputRequests = /* @__PURE__ */ __name(() => {
|
|
40489
|
-
const [settingInputRequests, dispatchSettingInputRequests] = (0,
|
|
40674
|
+
const [settingInputRequests, dispatchSettingInputRequests] = (0, import_react148.useReducer)(
|
|
40490
40675
|
settingInputRequestsReducer,
|
|
40491
40676
|
[]
|
|
40492
40677
|
);
|
|
40493
|
-
const addSettingInputRequest = (0,
|
|
40678
|
+
const addSettingInputRequest = (0, import_react148.useCallback)(
|
|
40494
40679
|
(original) => {
|
|
40495
40680
|
const wrappedRequest = {
|
|
40496
40681
|
settingName: original.settingName,
|
|
@@ -40537,11 +40722,11 @@ function pluginChoiceRequestsReducer(state, action) {
|
|
|
40537
40722
|
}
|
|
40538
40723
|
__name(pluginChoiceRequestsReducer, "pluginChoiceRequestsReducer");
|
|
40539
40724
|
var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
40540
|
-
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0,
|
|
40725
|
+
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0, import_react148.useReducer)(
|
|
40541
40726
|
pluginChoiceRequestsReducer,
|
|
40542
40727
|
[]
|
|
40543
40728
|
);
|
|
40544
|
-
const addPluginChoiceRequest = (0,
|
|
40729
|
+
const addPluginChoiceRequest = (0, import_react148.useCallback)(
|
|
40545
40730
|
(original) => {
|
|
40546
40731
|
const wrappedRequest = {
|
|
40547
40732
|
marketplaceName: original.marketplaceName,
|
|
@@ -40575,12 +40760,12 @@ var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
|
40575
40760
|
};
|
|
40576
40761
|
}, "usePluginChoiceRequests");
|
|
40577
40762
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd3) => {
|
|
40578
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
40763
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react148.useReducer)(
|
|
40579
40764
|
extensionUpdatesReducer,
|
|
40580
40765
|
initialExtensionUpdatesState
|
|
40581
40766
|
);
|
|
40582
40767
|
const extensions = extensionManager.getLoadedExtensions();
|
|
40583
|
-
(0,
|
|
40768
|
+
(0, import_react148.useEffect)(() => {
|
|
40584
40769
|
(async () => {
|
|
40585
40770
|
const extensionsToCheck = extensions.filter((extension) => {
|
|
40586
40771
|
const currentStatus = extensionsUpdateState.extensionStatuses.get(
|
|
@@ -40608,7 +40793,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
40608
40793
|
extensionsUpdateState.extensionStatuses,
|
|
40609
40794
|
dispatchExtensionStateUpdate
|
|
40610
40795
|
]);
|
|
40611
|
-
(0,
|
|
40796
|
+
(0, import_react148.useEffect)(() => {
|
|
40612
40797
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
40613
40798
|
return;
|
|
40614
40799
|
}
|
|
@@ -40677,7 +40862,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
40677
40862
|
);
|
|
40678
40863
|
}
|
|
40679
40864
|
}, [extensions, extensionManager, extensionsUpdateState, addItem, cwd3]);
|
|
40680
|
-
const extensionsUpdateStateComputed = (0,
|
|
40865
|
+
const extensionsUpdateStateComputed = (0, import_react148.useMemo)(() => {
|
|
40681
40866
|
const result = /* @__PURE__ */ new Map();
|
|
40682
40867
|
for (const [
|
|
40683
40868
|
key,
|
|
@@ -40696,11 +40881,11 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
40696
40881
|
|
|
40697
40882
|
// packages/cli/src/ui/components/TranscriptView.tsx
|
|
40698
40883
|
init_esbuild_shims();
|
|
40699
|
-
var
|
|
40884
|
+
var import_react151 = __toESM(require_react(), 1);
|
|
40700
40885
|
|
|
40701
40886
|
// packages/cli/src/ui/components/AlternateScreen.tsx
|
|
40702
40887
|
init_esbuild_shims();
|
|
40703
|
-
var
|
|
40888
|
+
var import_react149 = __toESM(require_react(), 1);
|
|
40704
40889
|
var import_jsx_runtime132 = __toESM(require_jsx_runtime(), 1);
|
|
40705
40890
|
var ENTER_ALT_SCREEN = "\x1B[?1049h";
|
|
40706
40891
|
var EXIT_ALT_SCREEN = "\x1B[?1049l";
|
|
@@ -40713,7 +40898,7 @@ var AlternateScreen = /* @__PURE__ */ __name(({
|
|
|
40713
40898
|
}) => {
|
|
40714
40899
|
const writeRaw = useTerminalOutput();
|
|
40715
40900
|
const { rows } = useTerminalSize();
|
|
40716
|
-
(0,
|
|
40901
|
+
(0, import_react149.useEffect)(() => {
|
|
40717
40902
|
if (disabled || !process.stdout.isTTY) return;
|
|
40718
40903
|
const safeWrite = /* @__PURE__ */ __name((data) => {
|
|
40719
40904
|
try {
|
|
@@ -40734,9 +40919,9 @@ var AlternateScreen = /* @__PURE__ */ __name(({
|
|
|
40734
40919
|
|
|
40735
40920
|
// packages/cli/src/ui/components/shared/ErrorBoundary.tsx
|
|
40736
40921
|
init_esbuild_shims();
|
|
40737
|
-
var
|
|
40922
|
+
var import_react150 = __toESM(require_react(), 1);
|
|
40738
40923
|
var import_jsx_runtime133 = __toESM(require_jsx_runtime(), 1);
|
|
40739
|
-
var ErrorBoundary = class extends
|
|
40924
|
+
var ErrorBoundary = class extends import_react150.Component {
|
|
40740
40925
|
static {
|
|
40741
40926
|
__name(this, "ErrorBoundary");
|
|
40742
40927
|
}
|
|
@@ -40795,11 +40980,11 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
40795
40980
|
const headerHeight = 1;
|
|
40796
40981
|
const footerHeight = 1;
|
|
40797
40982
|
const contentHeight = Math.max(rows - headerHeight - footerHeight, 1);
|
|
40798
|
-
const estimatedItemHeight = (0,
|
|
40983
|
+
const estimatedItemHeight = (0, import_react151.useCallback)(
|
|
40799
40984
|
(index) => estimateTranscriptItemHeight(items[index]),
|
|
40800
40985
|
[items]
|
|
40801
40986
|
);
|
|
40802
|
-
const renderItem = (0,
|
|
40987
|
+
const renderItem = (0, import_react151.useCallback)(
|
|
40803
40988
|
({ item }) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
40804
40989
|
HistoryItemDisplay,
|
|
40805
40990
|
{
|
|
@@ -40812,7 +40997,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
40812
40997
|
[columns]
|
|
40813
40998
|
);
|
|
40814
40999
|
const title = t("Transcript");
|
|
40815
|
-
const content = (0,
|
|
41000
|
+
const content = (0, import_react151.useMemo)(
|
|
40816
41001
|
() => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(OverflowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
40817
41002
|
ScrollableListWithForwardRef,
|
|
40818
41003
|
{
|
|
@@ -40827,7 +41012,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
40827
41012
|
) }),
|
|
40828
41013
|
[items, renderItem, estimatedItemHeight, contentHeight]
|
|
40829
41014
|
);
|
|
40830
|
-
const errorFallback = (0,
|
|
41015
|
+
const errorFallback = (0, import_react151.useCallback)(
|
|
40831
41016
|
(error) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [
|
|
40832
41017
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text, { color: theme.status.error, bold: true, children: t("Failed to render transcript.") }),
|
|
40833
41018
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text, { color: theme.text.secondary, children: sanitizeTerminalText(error.message) }),
|
|
@@ -40838,7 +41023,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
40838
41023
|
] }),
|
|
40839
41024
|
[]
|
|
40840
41025
|
);
|
|
40841
|
-
const onRenderError = (0,
|
|
41026
|
+
const onRenderError = (0, import_react151.useCallback)((error, info) => {
|
|
40842
41027
|
debugLogger39.error(
|
|
40843
41028
|
`render error: ${error.message}`,
|
|
40844
41029
|
info.componentStack ?? ""
|
|
@@ -40862,19 +41047,19 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
40862
41047
|
] }) })
|
|
40863
41048
|
] }) });
|
|
40864
41049
|
}, "TranscriptViewImpl");
|
|
40865
|
-
var TranscriptView = (0,
|
|
41050
|
+
var TranscriptView = (0, import_react151.memo)(TranscriptViewImpl);
|
|
40866
41051
|
TranscriptView.displayName = "TranscriptView";
|
|
40867
41052
|
|
|
40868
41053
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
40869
41054
|
init_esbuild_shims();
|
|
40870
|
-
var
|
|
41055
|
+
var import_react152 = __toESM(require_react(), 1);
|
|
40871
41056
|
function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
40872
|
-
const [welcomeBackInfo, setWelcomeBackInfo] = (0,
|
|
40873
|
-
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0,
|
|
40874
|
-
const [welcomeBackChoice, setWelcomeBackChoice] = (0,
|
|
40875
|
-
const [shouldFillInput, setShouldFillInput] = (0,
|
|
40876
|
-
const [inputFillText, setInputFillText] = (0,
|
|
40877
|
-
const checkWelcomeBack = (0,
|
|
41057
|
+
const [welcomeBackInfo, setWelcomeBackInfo] = (0, import_react152.useState)(null);
|
|
41058
|
+
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0, import_react152.useState)(false);
|
|
41059
|
+
const [welcomeBackChoice, setWelcomeBackChoice] = (0, import_react152.useState)(null);
|
|
41060
|
+
const [shouldFillInput, setShouldFillInput] = (0, import_react152.useState)(false);
|
|
41061
|
+
const [inputFillText, setInputFillText] = (0, import_react152.useState)(null);
|
|
41062
|
+
const checkWelcomeBack = (0, import_react152.useCallback)(async () => {
|
|
40878
41063
|
if (settings.ui?.enableWelcomeBack === false) {
|
|
40879
41064
|
return;
|
|
40880
41065
|
}
|
|
@@ -40893,7 +41078,7 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
40893
41078
|
config.getDebugLogger().debug("Welcome back check failed:", error);
|
|
40894
41079
|
}
|
|
40895
41080
|
}, [config, settings.ui?.enableWelcomeBack]);
|
|
40896
|
-
const handleWelcomeBackSelection = (0,
|
|
41081
|
+
const handleWelcomeBackSelection = (0, import_react152.useCallback)(
|
|
40897
41082
|
(choice) => {
|
|
40898
41083
|
setWelcomeBackChoice(choice);
|
|
40899
41084
|
setShowWelcomeBackDialog(false);
|
|
@@ -40917,21 +41102,21 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
40917
41102
|
},
|
|
40918
41103
|
[config, welcomeBackInfo]
|
|
40919
41104
|
);
|
|
40920
|
-
const handleWelcomeBackClose = (0,
|
|
41105
|
+
const handleWelcomeBackClose = (0, import_react152.useCallback)(() => {
|
|
40921
41106
|
setWelcomeBackChoice("restart");
|
|
40922
41107
|
setShowWelcomeBackDialog(false);
|
|
40923
41108
|
}, []);
|
|
40924
|
-
const clearInputFill = (0,
|
|
41109
|
+
const clearInputFill = (0, import_react152.useCallback)(() => {
|
|
40925
41110
|
setShouldFillInput(false);
|
|
40926
41111
|
setInputFillText(null);
|
|
40927
41112
|
}, []);
|
|
40928
|
-
(0,
|
|
41113
|
+
(0, import_react152.useEffect)(() => {
|
|
40929
41114
|
if (shouldFillInput && inputFillText) {
|
|
40930
41115
|
buffer.setText(inputFillText);
|
|
40931
41116
|
clearInputFill();
|
|
40932
41117
|
}
|
|
40933
41118
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
40934
|
-
(0,
|
|
41119
|
+
(0, import_react152.useEffect)(() => {
|
|
40935
41120
|
checkWelcomeBack();
|
|
40936
41121
|
}, [checkWelcomeBack]);
|
|
40937
41122
|
return {
|
|
@@ -40952,9 +41137,9 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
40952
41137
|
|
|
40953
41138
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
40954
41139
|
init_esbuild_shims();
|
|
40955
|
-
var
|
|
41140
|
+
var import_react153 = __toESM(require_react(), 1);
|
|
40956
41141
|
function useDialogClose(options) {
|
|
40957
|
-
const closeAnyOpenDialog = (0,
|
|
41142
|
+
const closeAnyOpenDialog = (0, import_react153.useCallback)(() => {
|
|
40958
41143
|
if (options.isThemeDialogOpen) {
|
|
40959
41144
|
options.handleThemeSelect(void 0, "User" /* User */);
|
|
40960
41145
|
return true;
|
|
@@ -41026,14 +41211,14 @@ __name(useDialogClose, "useDialogClose");
|
|
|
41026
41211
|
|
|
41027
41212
|
// packages/cli/src/ui/hooks/useInitializationAuthError.ts
|
|
41028
41213
|
init_esbuild_shims();
|
|
41029
|
-
var
|
|
41214
|
+
var import_react154 = __toESM(require_react(), 1);
|
|
41030
41215
|
var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError) => {
|
|
41031
|
-
const hasHandled = (0,
|
|
41032
|
-
const authErrorRef = (0,
|
|
41033
|
-
const onAuthErrorRef = (0,
|
|
41216
|
+
const hasHandled = (0, import_react154.useRef)(false);
|
|
41217
|
+
const authErrorRef = (0, import_react154.useRef)(authError);
|
|
41218
|
+
const onAuthErrorRef = (0, import_react154.useRef)(onAuthError);
|
|
41034
41219
|
authErrorRef.current = authError;
|
|
41035
41220
|
onAuthErrorRef.current = onAuthError;
|
|
41036
|
-
(0,
|
|
41221
|
+
(0, import_react154.useEffect)(() => {
|
|
41037
41222
|
if (hasHandled.current) {
|
|
41038
41223
|
return;
|
|
41039
41224
|
}
|
|
@@ -41046,13 +41231,13 @@ var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError)
|
|
|
41046
41231
|
|
|
41047
41232
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
41048
41233
|
init_esbuild_shims();
|
|
41049
|
-
var
|
|
41234
|
+
var import_react155 = __toESM(require_react(), 1);
|
|
41050
41235
|
function useSubagentCreateDialog() {
|
|
41051
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
41052
|
-
const openSubagentCreateDialog = (0,
|
|
41236
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react155.useState)(false);
|
|
41237
|
+
const openSubagentCreateDialog = (0, import_react155.useCallback)(() => {
|
|
41053
41238
|
setIsSubagentCreateDialogOpen(true);
|
|
41054
41239
|
}, []);
|
|
41055
|
-
const closeSubagentCreateDialog = (0,
|
|
41240
|
+
const closeSubagentCreateDialog = (0, import_react155.useCallback)(() => {
|
|
41056
41241
|
setIsSubagentCreateDialogOpen(false);
|
|
41057
41242
|
}, []);
|
|
41058
41243
|
return {
|
|
@@ -41065,13 +41250,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
41065
41250
|
|
|
41066
41251
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
41067
41252
|
init_esbuild_shims();
|
|
41068
|
-
var
|
|
41253
|
+
var import_react156 = __toESM(require_react(), 1);
|
|
41069
41254
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41070
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
41071
|
-
const openAgentsManagerDialog = (0,
|
|
41255
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react156.useState)(false);
|
|
41256
|
+
const openAgentsManagerDialog = (0, import_react156.useCallback)(() => {
|
|
41072
41257
|
setIsAgentsManagerDialogOpen(true);
|
|
41073
41258
|
}, []);
|
|
41074
|
-
const closeAgentsManagerDialog = (0,
|
|
41259
|
+
const closeAgentsManagerDialog = (0, import_react156.useCallback)(() => {
|
|
41075
41260
|
setIsAgentsManagerDialogOpen(false);
|
|
41076
41261
|
}, []);
|
|
41077
41262
|
return {
|
|
@@ -41083,13 +41268,13 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41083
41268
|
|
|
41084
41269
|
// packages/cli/src/ui/hooks/useSkillsManagerDialog.ts
|
|
41085
41270
|
init_esbuild_shims();
|
|
41086
|
-
var
|
|
41271
|
+
var import_react157 = __toESM(require_react(), 1);
|
|
41087
41272
|
var useSkillsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41088
|
-
const [isSkillsManagerDialogOpen, setIsSkillsManagerDialogOpen] = (0,
|
|
41089
|
-
const openSkillsManagerDialog = (0,
|
|
41273
|
+
const [isSkillsManagerDialogOpen, setIsSkillsManagerDialogOpen] = (0, import_react157.useState)(false);
|
|
41274
|
+
const openSkillsManagerDialog = (0, import_react157.useCallback)(() => {
|
|
41090
41275
|
setIsSkillsManagerDialogOpen(true);
|
|
41091
41276
|
}, []);
|
|
41092
|
-
const closeSkillsManagerDialog = (0,
|
|
41277
|
+
const closeSkillsManagerDialog = (0, import_react157.useCallback)(() => {
|
|
41093
41278
|
setIsSkillsManagerDialogOpen(false);
|
|
41094
41279
|
}, []);
|
|
41095
41280
|
return {
|
|
@@ -41101,13 +41286,13 @@ var useSkillsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41101
41286
|
|
|
41102
41287
|
// packages/cli/src/ui/hooks/useExtensionsManagerDialog.ts
|
|
41103
41288
|
init_esbuild_shims();
|
|
41104
|
-
var
|
|
41289
|
+
var import_react158 = __toESM(require_react(), 1);
|
|
41105
41290
|
var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41106
|
-
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0,
|
|
41107
|
-
const openExtensionsManagerDialog = (0,
|
|
41291
|
+
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0, import_react158.useState)(false);
|
|
41292
|
+
const openExtensionsManagerDialog = (0, import_react158.useCallback)(() => {
|
|
41108
41293
|
setIsExtensionsManagerDialogOpen(true);
|
|
41109
41294
|
}, []);
|
|
41110
|
-
const closeExtensionsManagerDialog = (0,
|
|
41295
|
+
const closeExtensionsManagerDialog = (0, import_react158.useCallback)(() => {
|
|
41111
41296
|
setIsExtensionsManagerDialogOpen(false);
|
|
41112
41297
|
}, []);
|
|
41113
41298
|
return {
|
|
@@ -41119,13 +41304,13 @@ var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41119
41304
|
|
|
41120
41305
|
// packages/cli/src/ui/hooks/useMcpDialog.ts
|
|
41121
41306
|
init_esbuild_shims();
|
|
41122
|
-
var
|
|
41307
|
+
var import_react159 = __toESM(require_react(), 1);
|
|
41123
41308
|
var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
41124
|
-
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0,
|
|
41125
|
-
const openMcpDialog = (0,
|
|
41309
|
+
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0, import_react159.useState)(false);
|
|
41310
|
+
const openMcpDialog = (0, import_react159.useCallback)(() => {
|
|
41126
41311
|
setIsMcpDialogOpen(true);
|
|
41127
41312
|
}, []);
|
|
41128
|
-
const closeMcpDialog = (0,
|
|
41313
|
+
const closeMcpDialog = (0, import_react159.useCallback)(() => {
|
|
41129
41314
|
setIsMcpDialogOpen(false);
|
|
41130
41315
|
}, []);
|
|
41131
41316
|
return {
|
|
@@ -41137,13 +41322,13 @@ var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
|
41137
41322
|
|
|
41138
41323
|
// packages/cli/src/ui/hooks/useHooksDialog.ts
|
|
41139
41324
|
init_esbuild_shims();
|
|
41140
|
-
var
|
|
41325
|
+
var import_react160 = __toESM(require_react(), 1);
|
|
41141
41326
|
var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
41142
|
-
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0,
|
|
41143
|
-
const openHooksDialog = (0,
|
|
41327
|
+
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0, import_react160.useState)(false);
|
|
41328
|
+
const openHooksDialog = (0, import_react160.useCallback)(() => {
|
|
41144
41329
|
setIsHooksDialogOpen(true);
|
|
41145
41330
|
}, []);
|
|
41146
|
-
const closeHooksDialog = (0,
|
|
41331
|
+
const closeHooksDialog = (0, import_react160.useCallback)(() => {
|
|
41147
41332
|
setIsHooksDialogOpen(false);
|
|
41148
41333
|
}, []);
|
|
41149
41334
|
return {
|
|
@@ -41155,23 +41340,23 @@ var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
|
41155
41340
|
|
|
41156
41341
|
// packages/cli/src/ui/hooks/useStatsDialog.ts
|
|
41157
41342
|
init_esbuild_shims();
|
|
41158
|
-
var
|
|
41343
|
+
var import_react161 = __toESM(require_react(), 1);
|
|
41159
41344
|
var useStatsDialog = /* @__PURE__ */ __name(() => {
|
|
41160
|
-
const [isStatsDialogOpen, setIsStatsDialogOpen] = (0,
|
|
41161
|
-
const openStatsDialog = (0,
|
|
41162
|
-
const closeStatsDialog = (0,
|
|
41345
|
+
const [isStatsDialogOpen, setIsStatsDialogOpen] = (0, import_react161.useState)(false);
|
|
41346
|
+
const openStatsDialog = (0, import_react161.useCallback)(() => setIsStatsDialogOpen(true), []);
|
|
41347
|
+
const closeStatsDialog = (0, import_react161.useCallback)(() => setIsStatsDialogOpen(false), []);
|
|
41163
41348
|
return { isStatsDialogOpen, openStatsDialog, closeStatsDialog };
|
|
41164
41349
|
}, "useStatsDialog");
|
|
41165
41350
|
|
|
41166
41351
|
// packages/cli/src/ui/hooks/useMemoryDialog.ts
|
|
41167
41352
|
init_esbuild_shims();
|
|
41168
|
-
var
|
|
41353
|
+
var import_react162 = __toESM(require_react(), 1);
|
|
41169
41354
|
var useMemoryDialog = /* @__PURE__ */ __name(() => {
|
|
41170
|
-
const [isMemoryDialogOpen, setIsMemoryDialogOpen] = (0,
|
|
41171
|
-
const openMemoryDialog = (0,
|
|
41355
|
+
const [isMemoryDialogOpen, setIsMemoryDialogOpen] = (0, import_react162.useState)(false);
|
|
41356
|
+
const openMemoryDialog = (0, import_react162.useCallback)(() => {
|
|
41172
41357
|
setIsMemoryDialogOpen(true);
|
|
41173
41358
|
}, []);
|
|
41174
|
-
const closeMemoryDialog = (0,
|
|
41359
|
+
const closeMemoryDialog = (0, import_react162.useCallback)(() => {
|
|
41175
41360
|
setIsMemoryDialogOpen(false);
|
|
41176
41361
|
}, []);
|
|
41177
41362
|
return {
|
|
@@ -41183,7 +41368,7 @@ var useMemoryDialog = /* @__PURE__ */ __name(() => {
|
|
|
41183
41368
|
|
|
41184
41369
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
41185
41370
|
init_esbuild_shims();
|
|
41186
|
-
var
|
|
41371
|
+
var import_react163 = __toESM(require_react(), 1);
|
|
41187
41372
|
var LONG_TASK_NOTIFICATION_THRESHOLD_SECONDS = 20;
|
|
41188
41373
|
var NOTIFICATION_TITLE = "Qwen Code";
|
|
41189
41374
|
var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
@@ -41198,16 +41383,16 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
41198
41383
|
const terminalBellEnabled = settings?.merged?.general?.terminalBell ?? true;
|
|
41199
41384
|
const notificationMode = settings?.merged?.general?.notificationMode === "task-complete" ? "task-complete" : "all";
|
|
41200
41385
|
const approvalNotificationsEnabled = notificationMode === "all";
|
|
41201
|
-
const awaitingNotificationSentRef = (0,
|
|
41202
|
-
const respondingElapsedRef = (0,
|
|
41203
|
-
const idleNotificationSentRef = (0,
|
|
41204
|
-
const awaitingToolName = (0,
|
|
41386
|
+
const awaitingNotificationSentRef = (0, import_react163.useRef)(false);
|
|
41387
|
+
const respondingElapsedRef = (0, import_react163.useRef)(0);
|
|
41388
|
+
const idleNotificationSentRef = (0, import_react163.useRef)(false);
|
|
41389
|
+
const awaitingToolName = (0, import_react163.useMemo)(() => {
|
|
41205
41390
|
const awaitingTool = pendingToolCalls?.find(
|
|
41206
41391
|
(tc) => tc.status === "awaiting_approval"
|
|
41207
41392
|
);
|
|
41208
41393
|
return awaitingTool?.request.name;
|
|
41209
41394
|
}, [pendingToolCalls]);
|
|
41210
|
-
(0,
|
|
41395
|
+
(0, import_react163.useEffect)(() => {
|
|
41211
41396
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current && terminalBellEnabled && approvalNotificationsEnabled) {
|
|
41212
41397
|
const message = awaitingToolName ? `Qwen Code needs your permission to use ${awaitingToolName}` : "Qwen Code is waiting for your input";
|
|
41213
41398
|
sendNotification(
|
|
@@ -41228,7 +41413,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
41228
41413
|
terminal,
|
|
41229
41414
|
awaitingToolName
|
|
41230
41415
|
]);
|
|
41231
|
-
(0,
|
|
41416
|
+
(0, import_react163.useEffect)(() => {
|
|
41232
41417
|
if (streamingState === "responding" /* Responding */) {
|
|
41233
41418
|
respondingElapsedRef.current = elapsedTime;
|
|
41234
41419
|
idleNotificationSentRef.current = false;
|
|
@@ -41381,7 +41566,7 @@ __name(buildTerminalNotification, "buildTerminalNotification");
|
|
|
41381
41566
|
|
|
41382
41567
|
// packages/cli/src/ui/hooks/useContextualTips.ts
|
|
41383
41568
|
init_esbuild_shims();
|
|
41384
|
-
var
|
|
41569
|
+
var import_react164 = __toESM(require_react(), 1);
|
|
41385
41570
|
function useContextualTips({
|
|
41386
41571
|
streamingState,
|
|
41387
41572
|
lastPromptTokenCount,
|
|
@@ -41391,9 +41576,9 @@ function useContextualTips({
|
|
|
41391
41576
|
addItem,
|
|
41392
41577
|
hideTips
|
|
41393
41578
|
}) {
|
|
41394
|
-
const prevStreamingState = (0,
|
|
41395
|
-
const hadResponsePhase = (0,
|
|
41396
|
-
(0,
|
|
41579
|
+
const prevStreamingState = (0, import_react164.useRef)("idle" /* Idle */);
|
|
41580
|
+
const hadResponsePhase = (0, import_react164.useRef)(false);
|
|
41581
|
+
(0, import_react164.useEffect)(() => {
|
|
41397
41582
|
if (streamingState === "responding" /* Responding */ || prevStreamingState.current === "responding" /* Responding */ && streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */) {
|
|
41398
41583
|
hadResponsePhase.current = true;
|
|
41399
41584
|
}
|
|
@@ -41529,7 +41714,7 @@ function getResponseCandidateTokens(pendingGeminiHistoryItems) {
|
|
|
41529
41714
|
__name(getResponseCandidateTokens, "getResponseCandidateTokens");
|
|
41530
41715
|
function useStableStickyTodos(todos) {
|
|
41531
41716
|
const renderKey = getStickyTodosRenderKey(todos);
|
|
41532
|
-
const stableTodosRef = (0,
|
|
41717
|
+
const stableTodosRef = (0, import_react165.useRef)(null);
|
|
41533
41718
|
if (stableTodosRef.current?.renderKey !== renderKey) {
|
|
41534
41719
|
stableTodosRef.current = { renderKey, todos };
|
|
41535
41720
|
}
|
|
@@ -41560,29 +41745,29 @@ var SHELL_WIDTH_FRACTION = 0.89;
|
|
|
41560
41745
|
var SHELL_HEIGHT_PADDING = 10;
|
|
41561
41746
|
var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
41562
41747
|
const { settings, config, initializationResult } = props;
|
|
41563
|
-
const extensionRefreshState = (0,
|
|
41748
|
+
const extensionRefreshState = (0, import_react165.useMemo)(
|
|
41564
41749
|
() => props.extensionRefreshState ?? new ExtensionRefreshState(),
|
|
41565
41750
|
[props.extensionRefreshState]
|
|
41566
41751
|
);
|
|
41567
41752
|
const historyManager = useHistory();
|
|
41568
|
-
const historyRef = (0,
|
|
41753
|
+
const historyRef = (0, import_react165.useRef)(historyManager.history);
|
|
41569
41754
|
historyRef.current = historyManager.history;
|
|
41570
41755
|
useMemoryMonitor(historyManager);
|
|
41571
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
41572
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
41573
|
-
const [themeError, setThemeError] = (0,
|
|
41756
|
+
const [debugMessage, setDebugMessage] = (0, import_react165.useState)("");
|
|
41757
|
+
const [quittingMessages, setQuittingMessages] = (0, import_react165.useState)(null);
|
|
41758
|
+
const [themeError, setThemeError] = (0, import_react165.useState)(
|
|
41574
41759
|
initializationResult.themeError
|
|
41575
41760
|
);
|
|
41576
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
41577
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
41578
|
-
const [geminiMdFileCount, setGeminiMdFileCount] = (0,
|
|
41761
|
+
const [isProcessing, setIsProcessing] = (0, import_react165.useState)(false);
|
|
41762
|
+
const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react165.useState)(false);
|
|
41763
|
+
const [geminiMdFileCount, setGeminiMdFileCount] = (0, import_react165.useState)(
|
|
41579
41764
|
initializationResult.geminiMdFileCount
|
|
41580
41765
|
);
|
|
41581
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
41582
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
41583
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
41584
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
41585
|
-
const [isTrustedFolder, setIsTrustedFolder] = (0,
|
|
41766
|
+
const [shellModeActive, setShellModeActive] = (0, import_react165.useState)(false);
|
|
41767
|
+
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react165.useState)(false);
|
|
41768
|
+
const [historyRemountKey, setHistoryRemountKey] = (0, import_react165.useState)(0);
|
|
41769
|
+
const [updateInfo, setUpdateInfo] = (0, import_react165.useState)(null);
|
|
41770
|
+
const [isTrustedFolder, setIsTrustedFolder] = (0, import_react165.useState)(
|
|
41586
41771
|
config.isTrustedFolder()
|
|
41587
41772
|
);
|
|
41588
41773
|
const extensionManager = config.getExtensionManager();
|
|
@@ -41641,31 +41826,31 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41641
41826
|
config,
|
|
41642
41827
|
historyManager.addItem
|
|
41643
41828
|
);
|
|
41644
|
-
const [isTrustDialogOpen, setTrustDialogOpen] = (0,
|
|
41645
|
-
const openTrustDialog = (0,
|
|
41646
|
-
const closeTrustDialog = (0,
|
|
41647
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
41648
|
-
const openPermissionsDialog = (0,
|
|
41829
|
+
const [isTrustDialogOpen, setTrustDialogOpen] = (0, import_react165.useState)(false);
|
|
41830
|
+
const openTrustDialog = (0, import_react165.useCallback)(() => setTrustDialogOpen(true), []);
|
|
41831
|
+
const closeTrustDialog = (0, import_react165.useCallback)(() => setTrustDialogOpen(false), []);
|
|
41832
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react165.useState)(false);
|
|
41833
|
+
const openPermissionsDialog = (0, import_react165.useCallback)(
|
|
41649
41834
|
() => setPermissionsDialogOpen(true),
|
|
41650
41835
|
[]
|
|
41651
41836
|
);
|
|
41652
|
-
const closePermissionsDialog = (0,
|
|
41837
|
+
const closePermissionsDialog = (0, import_react165.useCallback)(
|
|
41653
41838
|
() => setPermissionsDialogOpen(false),
|
|
41654
41839
|
[]
|
|
41655
41840
|
);
|
|
41656
|
-
const [currentModel, setCurrentModel] = (0,
|
|
41657
|
-
const [isConfigInitialized, setConfigInitialized] = (0,
|
|
41658
|
-
const [userMessages, setUserMessages] = (0,
|
|
41659
|
-
const [transcriptFreeze, setTranscriptFreeze] = (0,
|
|
41841
|
+
const [currentModel, setCurrentModel] = (0, import_react165.useState)(() => config.getModel());
|
|
41842
|
+
const [isConfigInitialized, setConfigInitialized] = (0, import_react165.useState)(false);
|
|
41843
|
+
const [userMessages, setUserMessages] = (0, import_react165.useState)([]);
|
|
41844
|
+
const [transcriptFreeze, setTranscriptFreeze] = (0, import_react165.useState)(null);
|
|
41660
41845
|
const isTranscriptOpen = transcriptFreeze != null;
|
|
41661
|
-
const isTranscriptOpenRef = (0,
|
|
41846
|
+
const isTranscriptOpenRef = (0, import_react165.useRef)(isTranscriptOpen);
|
|
41662
41847
|
isTranscriptOpenRef.current = isTranscriptOpen;
|
|
41663
|
-
const closeTranscript = (0,
|
|
41848
|
+
const closeTranscript = (0, import_react165.useCallback)(() => {
|
|
41664
41849
|
setTranscriptFreeze(null);
|
|
41665
41850
|
}, []);
|
|
41666
|
-
const [thoughtExpanded, setThoughtExpanded] = (0,
|
|
41667
|
-
const [expandedThoughtHeadIds, setExpandedThoughtHeadIds] = (0,
|
|
41668
|
-
const toggleThoughtExpanded = (0,
|
|
41851
|
+
const [thoughtExpanded, setThoughtExpanded] = (0, import_react165.useState)(false);
|
|
41852
|
+
const [expandedThoughtHeadIds, setExpandedThoughtHeadIds] = (0, import_react165.useState)(() => /* @__PURE__ */ new Set());
|
|
41853
|
+
const toggleThoughtExpanded = (0, import_react165.useCallback)((headId) => {
|
|
41669
41854
|
setExpandedThoughtHeadIds((prev) => {
|
|
41670
41855
|
const next = new Set(prev);
|
|
41671
41856
|
if (next.has(headId)) {
|
|
@@ -41679,10 +41864,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41679
41864
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
41680
41865
|
const { stdin, setRawMode } = use_stdin_default();
|
|
41681
41866
|
const { stdout } = use_stdout_default();
|
|
41682
|
-
const writeRaw = (0,
|
|
41867
|
+
const writeRaw = (0, import_react165.useCallback)((data) => {
|
|
41683
41868
|
process16.stdout.write(data);
|
|
41684
41869
|
}, []);
|
|
41685
|
-
const terminal = (0,
|
|
41870
|
+
const terminal = (0, import_react165.useMemo)(
|
|
41686
41871
|
() => buildTerminalNotification(writeRaw),
|
|
41687
41872
|
[writeRaw]
|
|
41688
41873
|
);
|
|
@@ -41692,12 +41877,14 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41692
41877
|
seedPromptCount
|
|
41693
41878
|
} = useSessionStats();
|
|
41694
41879
|
const logger = useLogger(config.storage, sessionStats.sessionId);
|
|
41695
|
-
const branchName = useGitBranchName(config.getTargetDir());
|
|
41696
41880
|
const worktreeSession = useWorktreeSession(config);
|
|
41697
|
-
const
|
|
41698
|
-
|
|
41699
|
-
|
|
41700
|
-
const
|
|
41881
|
+
const branchName = useGitBranchName(
|
|
41882
|
+
worktreeSession?.worktreePath ?? config.getTargetDir()
|
|
41883
|
+
);
|
|
41884
|
+
const [showWorktreeExitDialog, setShowWorktreeExitDialog] = (0, import_react165.useState)(false);
|
|
41885
|
+
const [workflowKeywordActive, setWorkflowKeywordActive] = (0, import_react165.useState)(false);
|
|
41886
|
+
const pendingWorktreeNoticeRef = (0, import_react165.useRef)(null);
|
|
41887
|
+
const activeWorktree = (0, import_react165.useMemo)(
|
|
41701
41888
|
() => worktreeSession ? {
|
|
41702
41889
|
slug: worktreeSession.slug,
|
|
41703
41890
|
branch: worktreeSession.worktreeBranch,
|
|
@@ -41708,20 +41895,20 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41708
41895
|
} : null,
|
|
41709
41896
|
[worktreeSession]
|
|
41710
41897
|
);
|
|
41711
|
-
const mainControlsRef = (0,
|
|
41712
|
-
const lastTitleRef = (0,
|
|
41713
|
-
const [startupWarnings, setStartupWarnings] = (0,
|
|
41898
|
+
const mainControlsRef = (0, import_react165.useRef)(null);
|
|
41899
|
+
const lastTitleRef = (0, import_react165.useRef)(null);
|
|
41900
|
+
const [startupWarnings, setStartupWarnings] = (0, import_react165.useState)(
|
|
41714
41901
|
() => props.startupWarnings || []
|
|
41715
41902
|
);
|
|
41716
41903
|
const staticExtraHeight = 3;
|
|
41717
|
-
(0,
|
|
41904
|
+
(0, import_react165.useEffect)(() => {
|
|
41718
41905
|
void loadLowlight().catch((err) => {
|
|
41719
41906
|
debugLogger40.warn(
|
|
41720
41907
|
`Failed to load lowlight chunk; code blocks will render as plain text: ${err instanceof Error ? err.message : String(err)}`
|
|
41721
41908
|
);
|
|
41722
41909
|
});
|
|
41723
41910
|
}, []);
|
|
41724
|
-
(0,
|
|
41911
|
+
(0, import_react165.useEffect)(() => {
|
|
41725
41912
|
(async () => {
|
|
41726
41913
|
profileCheckpoint("config_initialize_start");
|
|
41727
41914
|
await config.initialize();
|
|
@@ -41811,7 +41998,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41811
41998
|
await ideClient.disconnect();
|
|
41812
41999
|
});
|
|
41813
42000
|
}, [config]);
|
|
41814
|
-
(0,
|
|
42001
|
+
(0, import_react165.useEffect)(() => {
|
|
41815
42002
|
if (!isConfigInitialized) return void 0;
|
|
41816
42003
|
const geminiClient2 = config.getGeminiClient();
|
|
41817
42004
|
if (!geminiClient2) return void 0;
|
|
@@ -41875,11 +42062,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41875
42062
|
clearTimeout(finalizeCap);
|
|
41876
42063
|
};
|
|
41877
42064
|
}, [isConfigInitialized, config]);
|
|
41878
|
-
const isIdleRef = (0,
|
|
41879
|
-
const availableTerminalHeightRef = (0,
|
|
41880
|
-
const terminalWidthRef = (0,
|
|
41881
|
-
const updateHandlerRef = (0,
|
|
41882
|
-
(0,
|
|
42065
|
+
const isIdleRef = (0, import_react165.useRef)(true);
|
|
42066
|
+
const availableTerminalHeightRef = (0, import_react165.useRef)(0);
|
|
42067
|
+
const terminalWidthRef = (0, import_react165.useRef)(0);
|
|
42068
|
+
const updateHandlerRef = (0, import_react165.useRef)(null);
|
|
42069
|
+
(0, import_react165.useEffect)(() => {
|
|
41883
42070
|
const handler = setUpdateHandler(
|
|
41884
42071
|
historyManager.addItem,
|
|
41885
42072
|
setUpdateInfo,
|
|
@@ -41888,13 +42075,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41888
42075
|
updateHandlerRef.current = handler;
|
|
41889
42076
|
return () => handler?.cleanup();
|
|
41890
42077
|
}, [historyManager.addItem]);
|
|
41891
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
42078
|
+
const { inputWidth, suggestionsWidth } = (0, import_react165.useMemo)(() => {
|
|
41892
42079
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
41893
42080
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
41894
42081
|
}, [terminalWidth]);
|
|
41895
42082
|
const mainAreaWidth = Math.min(terminalWidth - 4, 100);
|
|
41896
42083
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
41897
|
-
const isValidPath = (0,
|
|
42084
|
+
const isValidPath = (0, import_react165.useCallback)((filePath) => {
|
|
41898
42085
|
try {
|
|
41899
42086
|
return fs20.existsSync(filePath) && fs20.statSync(filePath).isFile();
|
|
41900
42087
|
} catch (_e) {
|
|
@@ -41911,9 +42098,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41911
42098
|
shellModeActive,
|
|
41912
42099
|
preferredEditor
|
|
41913
42100
|
});
|
|
41914
|
-
const restoredPromptStashTargetsRef = (0,
|
|
42101
|
+
const restoredPromptStashTargetsRef = (0, import_react165.useRef)(/* @__PURE__ */ new Set());
|
|
41915
42102
|
const promptStashTargetDir = config.getTargetDir();
|
|
41916
|
-
(0,
|
|
42103
|
+
(0, import_react165.useEffect)(() => {
|
|
41917
42104
|
if (restoredPromptStashTargetsRef.current.has(promptStashTargetDir)) {
|
|
41918
42105
|
return;
|
|
41919
42106
|
}
|
|
@@ -41924,7 +42111,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41924
42111
|
(text) => buffer.setText(text)
|
|
41925
42112
|
);
|
|
41926
42113
|
}, [buffer, promptStashTargetDir]);
|
|
41927
|
-
(0,
|
|
42114
|
+
(0, import_react165.useEffect)(() => {
|
|
41928
42115
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
41929
42116
|
const pastMessagesRaw = await logger?.getPreviousUserMessages() || [];
|
|
41930
42117
|
const currentSessionUserMessages = historyManager.history.filter(
|
|
@@ -41938,12 +42125,12 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41938
42125
|
}, "fetchUserMessages");
|
|
41939
42126
|
fetchUserMessages();
|
|
41940
42127
|
}, [historyManager.history, logger]);
|
|
41941
|
-
const remountStaticHistory = (0,
|
|
42128
|
+
const remountStaticHistory = (0, import_react165.useCallback)(() => {
|
|
41942
42129
|
setHistoryRemountKey((prev) => prev + 1);
|
|
41943
42130
|
}, []);
|
|
41944
42131
|
const useTerminalBuffer = settings.merged.ui?.useTerminalBuffer ?? false;
|
|
41945
42132
|
const showScrollbar = settings.merged.ui?.showScrollbar ?? true;
|
|
41946
|
-
const refreshStatic = (0,
|
|
42133
|
+
const refreshStatic = (0, import_react165.useCallback)(() => {
|
|
41947
42134
|
if (isTranscriptOpenRef.current) {
|
|
41948
42135
|
return;
|
|
41949
42136
|
}
|
|
@@ -41952,15 +42139,15 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41952
42139
|
}
|
|
41953
42140
|
remountStaticHistory();
|
|
41954
42141
|
}, [useTerminalBuffer, remountStaticHistory, stdout]);
|
|
41955
|
-
const prevTranscriptOpenRef = (0,
|
|
42142
|
+
const prevTranscriptOpenRef = (0, import_react165.useRef)(isTranscriptOpen);
|
|
41956
42143
|
const wasOpenPrevRender = prevTranscriptOpenRef.current;
|
|
41957
42144
|
prevTranscriptOpenRef.current = isTranscriptOpen;
|
|
41958
|
-
const transcriptCloseCountRef = (0,
|
|
42145
|
+
const transcriptCloseCountRef = (0, import_react165.useRef)(0);
|
|
41959
42146
|
if (wasOpenPrevRender && !isTranscriptOpen) {
|
|
41960
42147
|
transcriptCloseCountRef.current += 1;
|
|
41961
42148
|
}
|
|
41962
42149
|
const transcriptCloseCount = transcriptCloseCountRef.current;
|
|
41963
|
-
(0,
|
|
42150
|
+
(0, import_react165.useEffect)(() => {
|
|
41964
42151
|
if (transcriptCloseCount === 0 || useTerminalBuffer) {
|
|
41965
42152
|
return void 0;
|
|
41966
42153
|
}
|
|
@@ -41973,8 +42160,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41973
42160
|
}, 0);
|
|
41974
42161
|
return () => clearTimeout(id);
|
|
41975
42162
|
}, [transcriptCloseCount, useTerminalBuffer, stdout, remountStaticHistory]);
|
|
41976
|
-
const lastNotifiedModelRef = (0,
|
|
41977
|
-
(0,
|
|
42163
|
+
const lastNotifiedModelRef = (0, import_react165.useRef)(currentModel);
|
|
42164
|
+
(0, import_react165.useEffect)(() => {
|
|
41978
42165
|
const unsubscribe = config.onModelChange((model) => {
|
|
41979
42166
|
if (lastNotifiedModelRef.current === model) {
|
|
41980
42167
|
return;
|
|
@@ -42012,7 +42199,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42012
42199
|
const { onAuthError, openAuthDialog, closeAuthDialog } = authActions;
|
|
42013
42200
|
const { isAuthDialogOpen, isAuthenticating, pendingAuthType } = authState;
|
|
42014
42201
|
useInitializationAuthError(initializationResult.authError, onAuthError);
|
|
42015
|
-
(0,
|
|
42202
|
+
(0, import_react165.useEffect)(() => {
|
|
42016
42203
|
const currentAuthType = config.getModelsConfig().getCurrentAuthType();
|
|
42017
42204
|
if (settings.merged.security?.auth?.enforcedType && currentAuthType && settings.merged.security?.auth.enforcedType !== currentAuthType) {
|
|
42018
42205
|
onAuthError(
|
|
@@ -42026,7 +42213,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42026
42213
|
);
|
|
42027
42214
|
}
|
|
42028
42215
|
}, [settings.merged.security?.auth?.enforcedType, config, onAuthError]);
|
|
42029
|
-
const [editorError, setEditorError] = (0,
|
|
42216
|
+
const [editorError, setEditorError] = (0, import_react165.useState)(null);
|
|
42030
42217
|
const {
|
|
42031
42218
|
isEditorDialogOpen,
|
|
42032
42219
|
openEditorDialog,
|
|
@@ -42034,18 +42221,18 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42034
42221
|
exitEditorDialog
|
|
42035
42222
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
42036
42223
|
const { isSettingsDialogOpen, openSettingsDialog, closeSettingsDialog } = useSettingsCommand();
|
|
42037
|
-
const [isStatusLineDialogOpen, setStatusLineDialogOpen] = (0,
|
|
42038
|
-
const openStatusLineDialog = (0,
|
|
42224
|
+
const [isStatusLineDialogOpen, setStatusLineDialogOpen] = (0, import_react165.useState)(false);
|
|
42225
|
+
const openStatusLineDialog = (0, import_react165.useCallback)(
|
|
42039
42226
|
() => setStatusLineDialogOpen(true),
|
|
42040
42227
|
[]
|
|
42041
42228
|
);
|
|
42042
|
-
const closeStatusLineDialog = (0,
|
|
42229
|
+
const closeStatusLineDialog = (0, import_react165.useCallback)(
|
|
42043
42230
|
() => setStatusLineDialogOpen(false),
|
|
42044
42231
|
[]
|
|
42045
42232
|
);
|
|
42046
|
-
const [statusLineSettingsVersion, setStatusLineSettingsVersion] = (0,
|
|
42047
|
-
const [statusLineConfigOverride, setStatusLineConfigOverride] = (0,
|
|
42048
|
-
const notifyStatusLineSettingsChanged = (0,
|
|
42233
|
+
const [statusLineSettingsVersion, setStatusLineSettingsVersion] = (0, import_react165.useState)(0);
|
|
42234
|
+
const [statusLineConfigOverride, setStatusLineConfigOverride] = (0, import_react165.useState)(void 0);
|
|
42235
|
+
const notifyStatusLineSettingsChanged = (0, import_react165.useCallback)(
|
|
42049
42236
|
(newConfig) => {
|
|
42050
42237
|
setStatusLineConfigOverride(newConfig);
|
|
42051
42238
|
setStatusLineSettingsVersion((version) => version + 1);
|
|
@@ -42063,8 +42250,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42063
42250
|
closeModelDialog
|
|
42064
42251
|
} = useModelCommand();
|
|
42065
42252
|
const { activeArenaDialog, openArenaDialog, closeArenaDialog } = useArenaCommand();
|
|
42066
|
-
const [sessionName, setSessionName] = (0,
|
|
42067
|
-
(0,
|
|
42253
|
+
const [sessionName, setSessionName] = (0, import_react165.useState)(null);
|
|
42254
|
+
(0, import_react165.useEffect)(() => {
|
|
42068
42255
|
const chatRecordingService = config.getChatRecordingService();
|
|
42069
42256
|
if (!chatRecordingService?.setTitleRecordedCallback) return;
|
|
42070
42257
|
const existingCallback = chatRecordingService.getTitleRecordedCallback();
|
|
@@ -42081,7 +42268,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42081
42268
|
};
|
|
42082
42269
|
}, [config]);
|
|
42083
42270
|
const addHistoryItem = historyManager.addItem;
|
|
42084
|
-
(0,
|
|
42271
|
+
(0, import_react165.useEffect)(() => {
|
|
42085
42272
|
if (typeof config.onChatRecordingFailure !== "function") return;
|
|
42086
42273
|
return config.onChatRecordingFailure(() => {
|
|
42087
42274
|
addHistoryItem(
|
|
@@ -42125,10 +42312,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42125
42312
|
config,
|
|
42126
42313
|
addItem: historyManager.addItem
|
|
42127
42314
|
});
|
|
42128
|
-
const [isHelpDialogOpen, setHelpDialogOpen] = (0,
|
|
42129
|
-
const [activeHelpTab, setHelpTab] = (0,
|
|
42130
|
-
const openHelpDialog = (0,
|
|
42131
|
-
const closeHelpDialog = (0,
|
|
42315
|
+
const [isHelpDialogOpen, setHelpDialogOpen] = (0, import_react165.useState)(false);
|
|
42316
|
+
const [activeHelpTab, setHelpTab] = (0, import_react165.useState)("general");
|
|
42317
|
+
const openHelpDialog = (0, import_react165.useCallback)(() => setHelpDialogOpen(true), []);
|
|
42318
|
+
const closeHelpDialog = (0, import_react165.useCallback)(() => setHelpDialogOpen(false), []);
|
|
42132
42319
|
const { vimEnabled, vimMode } = useVimModeState();
|
|
42133
42320
|
const { toggleVimEnabled } = useVimModeActions();
|
|
42134
42321
|
const {
|
|
@@ -42154,31 +42341,31 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42154
42341
|
const { isMcpDialogOpen, openMcpDialog, closeMcpDialog } = useMcpDialog();
|
|
42155
42342
|
const { isHooksDialogOpen, openHooksDialog, closeHooksDialog } = useHooksDialog();
|
|
42156
42343
|
const { isStatsDialogOpen, openStatsDialog, closeStatsDialog } = useStatsDialog();
|
|
42157
|
-
const openRewindSelectorRef = (0,
|
|
42344
|
+
const openRewindSelectorRef = (0, import_react165.useRef)(() => {
|
|
42158
42345
|
});
|
|
42159
|
-
const cancelOngoingRequestRef = (0,
|
|
42346
|
+
const cancelOngoingRequestRef = (0, import_react165.useRef)(() => {
|
|
42160
42347
|
});
|
|
42161
|
-
const [isDiffDialogOpen, setIsDiffDialogOpen] = (0,
|
|
42162
|
-
const openDiffDialog = (0,
|
|
42348
|
+
const [isDiffDialogOpen, setIsDiffDialogOpen] = (0, import_react165.useState)(false);
|
|
42349
|
+
const openDiffDialog = (0, import_react165.useCallback)(() => {
|
|
42163
42350
|
setIsDiffDialogOpen(true);
|
|
42164
42351
|
}, []);
|
|
42165
|
-
const closeDiffDialog = (0,
|
|
42352
|
+
const closeDiffDialog = (0, import_react165.useCallback)(() => {
|
|
42166
42353
|
setIsDiffDialogOpen(false);
|
|
42167
42354
|
}, []);
|
|
42168
|
-
const [isSkillReviewDialogOpen, setIsSkillReviewDialogOpen] = (0,
|
|
42169
|
-
const [skillReviewPending, setSkillReviewPending] = (0,
|
|
42170
|
-
const skillReviewDismissedTaskIdsRef = (0,
|
|
42171
|
-
const dismissSkillReviewDialog = (0,
|
|
42355
|
+
const [isSkillReviewDialogOpen, setIsSkillReviewDialogOpen] = (0, import_react165.useState)(false);
|
|
42356
|
+
const [skillReviewPending, setSkillReviewPending] = (0, import_react165.useState)(null);
|
|
42357
|
+
const skillReviewDismissedTaskIdsRef = (0, import_react165.useRef)(/* @__PURE__ */ new Set());
|
|
42358
|
+
const dismissSkillReviewDialog = (0, import_react165.useCallback)(() => {
|
|
42172
42359
|
if (skillReviewPending) {
|
|
42173
42360
|
skillReviewDismissedTaskIdsRef.current.add(skillReviewPending.taskId);
|
|
42174
42361
|
}
|
|
42175
42362
|
setIsSkillReviewDialogOpen(false);
|
|
42176
42363
|
}, [skillReviewPending]);
|
|
42177
|
-
const closeSkillReviewDialog = (0,
|
|
42364
|
+
const closeSkillReviewDialog = (0, import_react165.useCallback)(
|
|
42178
42365
|
() => setIsSkillReviewDialogOpen(false),
|
|
42179
42366
|
[]
|
|
42180
42367
|
);
|
|
42181
|
-
const acceptPendingSkill = (0,
|
|
42368
|
+
const acceptPendingSkill = (0, import_react165.useCallback)(
|
|
42182
42369
|
(skillName) => {
|
|
42183
42370
|
if (!skillReviewPending) return;
|
|
42184
42371
|
void config.getMemoryManager().acceptPendingSkillFromTask(skillReviewPending.taskId, skillName).catch(() => {
|
|
@@ -42186,7 +42373,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42186
42373
|
},
|
|
42187
42374
|
[config, skillReviewPending]
|
|
42188
42375
|
);
|
|
42189
|
-
const rejectPendingSkill = (0,
|
|
42376
|
+
const rejectPendingSkill = (0, import_react165.useCallback)(
|
|
42190
42377
|
(skillName) => {
|
|
42191
42378
|
if (!skillReviewPending) return;
|
|
42192
42379
|
void config.getMemoryManager().rejectPendingSkillFromTask(skillReviewPending.taskId, skillName).catch(() => {
|
|
@@ -42194,7 +42381,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42194
42381
|
},
|
|
42195
42382
|
[config, skillReviewPending]
|
|
42196
42383
|
);
|
|
42197
|
-
(0,
|
|
42384
|
+
(0, import_react165.useEffect)(() => {
|
|
42198
42385
|
const mgr = config.getMemoryManager();
|
|
42199
42386
|
const projectRoot = config.getProjectRoot();
|
|
42200
42387
|
let lastSig = "";
|
|
@@ -42228,7 +42415,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42228
42415
|
refresh();
|
|
42229
42416
|
return unsub;
|
|
42230
42417
|
}, [config]);
|
|
42231
|
-
const slashCommandActions = (0,
|
|
42418
|
+
const slashCommandActions = (0, import_react165.useMemo)(
|
|
42232
42419
|
() => ({
|
|
42233
42420
|
openAuthDialog,
|
|
42234
42421
|
openThemeDialog,
|
|
@@ -42338,13 +42525,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42338
42525
|
setSessionName,
|
|
42339
42526
|
extensionRefreshState
|
|
42340
42527
|
);
|
|
42341
|
-
const onDebugMessage = (0,
|
|
42528
|
+
const onDebugMessage = (0, import_react165.useCallback)(
|
|
42342
42529
|
(message) => {
|
|
42343
42530
|
config.getDebugLogger().debug(message);
|
|
42344
42531
|
},
|
|
42345
42532
|
[config]
|
|
42346
42533
|
);
|
|
42347
|
-
const handleWorktreeExit = (0,
|
|
42534
|
+
const handleWorktreeExit = (0, import_react165.useCallback)(
|
|
42348
42535
|
async (choice) => {
|
|
42349
42536
|
if (choice === "cancel") {
|
|
42350
42537
|
setShowWorktreeExitDialog(false);
|
|
@@ -42409,7 +42596,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42409
42596
|
},
|
|
42410
42597
|
[activeWorktree, config, handleSlashCommand, historyManager]
|
|
42411
42598
|
);
|
|
42412
|
-
const performMemoryRefresh = (0,
|
|
42599
|
+
const performMemoryRefresh = (0, import_react165.useCallback)(async () => {
|
|
42413
42600
|
if (config.isSafeMode()) {
|
|
42414
42601
|
config.setUserMemory("");
|
|
42415
42602
|
config.setGeminiMdFileCount(0);
|
|
@@ -42481,10 +42668,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42481
42668
|
debugLogger40.error("Error refreshing memory:", error);
|
|
42482
42669
|
}
|
|
42483
42670
|
}, [config, historyManager, settings.merged]);
|
|
42484
|
-
const cancelHandlerRef = (0,
|
|
42671
|
+
const cancelHandlerRef = (0, import_react165.useRef)(() => {
|
|
42485
42672
|
});
|
|
42486
|
-
const midTurnDrainRef = (0,
|
|
42487
|
-
const midTurnRestoreRef = (0,
|
|
42673
|
+
const midTurnDrainRef = (0, import_react165.useRef)(null);
|
|
42674
|
+
const midTurnRestoreRef = (0, import_react165.useRef)(null);
|
|
42488
42675
|
const {
|
|
42489
42676
|
streamingState,
|
|
42490
42677
|
submitQuery,
|
|
@@ -42527,13 +42714,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42527
42714
|
);
|
|
42528
42715
|
cancelOngoingRequestRef.current = cancelOngoingRequest;
|
|
42529
42716
|
isIdleRef.current = streamingState === "idle" /* Idle */;
|
|
42530
|
-
(0,
|
|
42717
|
+
(0, import_react165.useEffect)(() => {
|
|
42531
42718
|
if (streamingState === "idle" /* Idle */) {
|
|
42532
42719
|
updateHandlerRef.current?.flush();
|
|
42533
42720
|
setWorkflowKeywordActive(false);
|
|
42534
42721
|
}
|
|
42535
42722
|
}, [streamingState]);
|
|
42536
|
-
(0,
|
|
42723
|
+
(0, import_react165.useEffect)(() => {
|
|
42537
42724
|
if (shouldAutoOpenSkillReview({
|
|
42538
42725
|
pending: skillReviewPending,
|
|
42539
42726
|
streamingState,
|
|
@@ -42545,7 +42732,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42545
42732
|
}
|
|
42546
42733
|
}, [skillReviewPending, streamingState, isMemoryDialogOpen, config]);
|
|
42547
42734
|
const tipsDisabled = !!(settings.merged.ui?.hideTips || config.getScreenReader());
|
|
42548
|
-
const tipHistory = (0,
|
|
42735
|
+
const tipHistory = (0, import_react165.useMemo)(
|
|
42549
42736
|
() => tipsDisabled ? null : getTipHistory(),
|
|
42550
42737
|
[tipsDisabled]
|
|
42551
42738
|
);
|
|
@@ -42558,7 +42745,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42558
42745
|
addItem: historyManager.addItem,
|
|
42559
42746
|
hideTips: tipsDisabled
|
|
42560
42747
|
});
|
|
42561
|
-
const [hasTabConsumer, setHasTabConsumer] = (0,
|
|
42748
|
+
const [hasTabConsumer, setHasTabConsumer] = (0, import_react165.useState)(false);
|
|
42562
42749
|
const agentViewState = useAgentViewState();
|
|
42563
42750
|
const {
|
|
42564
42751
|
dialogOpen: bgTasksDialogOpen,
|
|
@@ -42566,11 +42753,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42566
42753
|
livePanelFocused: bgLivePanelFocused
|
|
42567
42754
|
} = useBackgroundTaskViewState();
|
|
42568
42755
|
const { closeDialog: closeBgTasksDialog } = useBackgroundTaskViewActions();
|
|
42569
|
-
const [promptSuggestion, setPromptSuggestion] = (0,
|
|
42570
|
-
const prevStreamingStateRef = (0,
|
|
42571
|
-
const speculationRef = (0,
|
|
42572
|
-
const suggestionAbortRef = (0,
|
|
42573
|
-
const abortPromptSuggestion = (0,
|
|
42756
|
+
const [promptSuggestion, setPromptSuggestion] = (0, import_react165.useState)(null);
|
|
42757
|
+
const prevStreamingStateRef = (0, import_react165.useRef)("idle" /* Idle */);
|
|
42758
|
+
const speculationRef = (0, import_react165.useRef)(IDLE_SPECULATION);
|
|
42759
|
+
const suggestionAbortRef = (0, import_react165.useRef)(null);
|
|
42760
|
+
const abortPromptSuggestion = (0, import_react165.useCallback)(() => {
|
|
42574
42761
|
suggestionAbortRef.current?.abort();
|
|
42575
42762
|
suggestionAbortRef.current = null;
|
|
42576
42763
|
if (speculationRef.current.status !== "idle") {
|
|
@@ -42599,21 +42786,21 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42599
42786
|
midTurnDrainRef.current = drainQueue;
|
|
42600
42787
|
midTurnRestoreRef.current = restoreMessages;
|
|
42601
42788
|
const remoteInput = useRemoteInput();
|
|
42602
|
-
(0,
|
|
42789
|
+
(0, import_react165.useEffect)(() => {
|
|
42603
42790
|
if (!remoteInput) return;
|
|
42604
42791
|
remoteInput.setSubmitFn((text) => submitQuery(text));
|
|
42605
42792
|
}, [remoteInput, submitQuery]);
|
|
42606
|
-
(0,
|
|
42793
|
+
(0, import_react165.useEffect)(() => {
|
|
42607
42794
|
if (!remoteInput) return;
|
|
42608
42795
|
if (streamingState === "idle" /* Idle */) {
|
|
42609
42796
|
remoteInput.notifyIdle();
|
|
42610
42797
|
}
|
|
42611
42798
|
}, [remoteInput, streamingState]);
|
|
42612
42799
|
const dualOutput = useDualOutput();
|
|
42613
|
-
const confirmRequestMap = (0,
|
|
42614
|
-
const confirmCallIdMap = (0,
|
|
42615
|
-
const confirmEmitted = (0,
|
|
42616
|
-
(0,
|
|
42800
|
+
const confirmRequestMap = (0, import_react165.useRef)(/* @__PURE__ */ new Map());
|
|
42801
|
+
const confirmCallIdMap = (0, import_react165.useRef)(/* @__PURE__ */ new Map());
|
|
42802
|
+
const confirmEmitted = (0, import_react165.useRef)(/* @__PURE__ */ new Set());
|
|
42803
|
+
(0, import_react165.useEffect)(() => {
|
|
42617
42804
|
if (!dualOutput || !dualOutput.isConnected) return;
|
|
42618
42805
|
for (const tc of pendingToolCalls) {
|
|
42619
42806
|
if (tc.status === "awaiting_approval" && !confirmEmitted.current.has(tc.request.callId)) {
|
|
@@ -42625,7 +42812,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42625
42812
|
requestId,
|
|
42626
42813
|
tc.request.name,
|
|
42627
42814
|
tc.request.callId,
|
|
42628
|
-
tc.request.args
|
|
42815
|
+
tc.request.args,
|
|
42816
|
+
null,
|
|
42817
|
+
buildPermissionSuggestions(tc.confirmationDetails)
|
|
42629
42818
|
);
|
|
42630
42819
|
}
|
|
42631
42820
|
}
|
|
@@ -42640,11 +42829,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42640
42829
|
}
|
|
42641
42830
|
}
|
|
42642
42831
|
}, [dualOutput, pendingToolCalls]);
|
|
42643
|
-
const pendingToolCallsRef = (0,
|
|
42832
|
+
const pendingToolCallsRef = (0, import_react165.useRef)(pendingToolCalls);
|
|
42644
42833
|
pendingToolCallsRef.current = pendingToolCalls;
|
|
42645
|
-
const dualOutputRef = (0,
|
|
42834
|
+
const dualOutputRef = (0, import_react165.useRef)(dualOutput);
|
|
42646
42835
|
dualOutputRef.current = dualOutput;
|
|
42647
|
-
(0,
|
|
42836
|
+
(0, import_react165.useEffect)(() => {
|
|
42648
42837
|
if (!remoteInput) return;
|
|
42649
42838
|
remoteInput.setConfirmationHandler(
|
|
42650
42839
|
(requestId, allowed) => {
|
|
@@ -42684,7 +42873,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42684
42873
|
});
|
|
42685
42874
|
};
|
|
42686
42875
|
}, [remoteInput]);
|
|
42687
|
-
const handleFinalSubmit = (0,
|
|
42876
|
+
const handleFinalSubmit = (0, import_react165.useCallback)(
|
|
42688
42877
|
(submittedValue, options) => {
|
|
42689
42878
|
if (agentViewState.activeView !== "main") {
|
|
42690
42879
|
const agent = agentViewState.agents.get(agentViewState.activeView);
|
|
@@ -42830,7 +43019,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
42830
43019
|
settings.merged.ui?.disableWorkflowKeywordTrigger
|
|
42831
43020
|
]
|
|
42832
43021
|
);
|
|
42833
|
-
const handleArenaModelsSelected = (0,
|
|
43022
|
+
const handleArenaModelsSelected = (0, import_react165.useCallback)(
|
|
42834
43023
|
(models) => {
|
|
42835
43024
|
const value = models.join(",");
|
|
42836
43025
|
buffer.setText(`/arena start --models ${value} `);
|
|
@@ -42845,15 +43034,15 @@ ${buildWorkflowSteeringNotice()}
|
|
|
42845
43034
|
handleWelcomeBackSelection,
|
|
42846
43035
|
handleWelcomeBackClose
|
|
42847
43036
|
} = useWelcomeBack(config, handleFinalSubmit, buffer, settings.merged);
|
|
42848
|
-
const pendingHistoryItems = (0,
|
|
43037
|
+
const pendingHistoryItems = (0, import_react165.useMemo)(
|
|
42849
43038
|
() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
|
|
42850
43039
|
[pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]
|
|
42851
43040
|
);
|
|
42852
|
-
const historyForTranscriptRef = (0,
|
|
43041
|
+
const historyForTranscriptRef = (0, import_react165.useRef)(historyManager.history);
|
|
42853
43042
|
historyForTranscriptRef.current = historyManager.history;
|
|
42854
|
-
const pendingForTranscriptRef = (0,
|
|
43043
|
+
const pendingForTranscriptRef = (0, import_react165.useRef)(pendingHistoryItems);
|
|
42855
43044
|
pendingForTranscriptRef.current = pendingHistoryItems;
|
|
42856
|
-
const openTranscript = (0,
|
|
43045
|
+
const openTranscript = (0, import_react165.useCallback)(() => {
|
|
42857
43046
|
setTranscriptFreeze({
|
|
42858
43047
|
// Share MainContent's visibility predicate so the transcript shows exactly
|
|
42859
43048
|
// what the main view shows. Items collapsed on session resume
|
|
@@ -42865,7 +43054,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
42865
43054
|
pendingItems: [...pendingForTranscriptRef.current]
|
|
42866
43055
|
});
|
|
42867
43056
|
}, []);
|
|
42868
|
-
const transcriptItems = (0,
|
|
43057
|
+
const transcriptItems = (0, import_react165.useMemo)(() => {
|
|
42869
43058
|
if (!transcriptFreeze) return EMPTY_HISTORY_ITEMS;
|
|
42870
43059
|
return [
|
|
42871
43060
|
...transcriptFreeze.committedItems,
|
|
@@ -42877,7 +43066,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
42877
43066
|
}))
|
|
42878
43067
|
];
|
|
42879
43068
|
}, [transcriptFreeze]);
|
|
42880
|
-
const rawStickyTodos = (0,
|
|
43069
|
+
const rawStickyTodos = (0, import_react165.useMemo)(
|
|
42881
43070
|
() => getStickyTodos(historyManager.history, pendingHistoryItems),
|
|
42882
43071
|
[historyManager.history, pendingHistoryItems]
|
|
42883
43072
|
);
|
|
@@ -42885,7 +43074,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
42885
43074
|
const hasExecutingTool = isToolExecuting(pendingHistoryItems);
|
|
42886
43075
|
const hasPendingCompression = isCompressionPending(pendingHistoryItems);
|
|
42887
43076
|
useTerminalProgress(streamingState, hasExecutingTool);
|
|
42888
|
-
cancelHandlerRef.current = (0,
|
|
43077
|
+
cancelHandlerRef.current = (0, import_react165.useCallback)(
|
|
42889
43078
|
(info) => {
|
|
42890
43079
|
const pendingHistoryItems2 = [
|
|
42891
43080
|
...pendingSlashCommandHistoryItems,
|
|
@@ -42985,7 +43174,7 @@ ${currentText}` : popped);
|
|
|
42985
43174
|
pendingGeminiHistoryItems
|
|
42986
43175
|
]
|
|
42987
43176
|
);
|
|
42988
|
-
const handleClearScreen = (0,
|
|
43177
|
+
const handleClearScreen = (0, import_react165.useCallback)(() => {
|
|
42989
43178
|
historyManager.clearItems();
|
|
42990
43179
|
clearScreen();
|
|
42991
43180
|
remountStaticHistory();
|
|
@@ -43008,13 +43197,13 @@ ${currentText}` : popped);
|
|
|
43008
43197
|
history: historyManager.history,
|
|
43009
43198
|
awayThresholdMinutes: settings.merged.general?.sessionRecapAwayThresholdMinutes
|
|
43010
43199
|
});
|
|
43011
|
-
const contextFileNames = (0,
|
|
43200
|
+
const contextFileNames = (0, import_react165.useMemo)(() => {
|
|
43012
43201
|
const fromSettings = settings.merged.context?.fileName;
|
|
43013
43202
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllGeminiMdFilenames();
|
|
43014
43203
|
}, [settings.merged.context?.fileName]);
|
|
43015
|
-
const initialPrompt = (0,
|
|
43016
|
-
const initialPromptSubmitted = (0,
|
|
43017
|
-
(0,
|
|
43204
|
+
const initialPrompt = (0, import_react165.useMemo)(() => config.getQuestion(), [config]);
|
|
43205
|
+
const initialPromptSubmitted = (0, import_react165.useRef)(false);
|
|
43206
|
+
(0, import_react165.useEffect)(() => {
|
|
43018
43207
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && welcomeBackChoice !== "restart" && geminiClient?.isInitialized?.()) {
|
|
43019
43208
|
handleFinalSubmit(initialPrompt);
|
|
43020
43209
|
initialPromptSubmitted.current = true;
|
|
@@ -43032,7 +43221,7 @@ ${currentText}` : popped);
|
|
|
43032
43221
|
geminiClient
|
|
43033
43222
|
]);
|
|
43034
43223
|
const followupSuggestionsEnabled = settings.merged.ui?.enableFollowupSuggestions !== false;
|
|
43035
|
-
(0,
|
|
43224
|
+
(0, import_react165.useEffect)(() => {
|
|
43036
43225
|
if (!followupSuggestionsEnabled) {
|
|
43037
43226
|
suggestionAbortRef.current?.abort();
|
|
43038
43227
|
setPromptSuggestion(null);
|
|
@@ -43101,17 +43290,17 @@ ${currentText}` : popped);
|
|
|
43101
43290
|
isPermissionsDialogOpen,
|
|
43102
43291
|
settingInputRequests
|
|
43103
43292
|
]);
|
|
43104
|
-
(0,
|
|
43293
|
+
(0, import_react165.useEffect)(() => {
|
|
43105
43294
|
if (!promptSuggestion && speculationRef.current.status !== "idle") {
|
|
43106
43295
|
abortSpeculation(speculationRef.current).catch(() => {
|
|
43107
43296
|
});
|
|
43108
43297
|
speculationRef.current = IDLE_SPECULATION;
|
|
43109
43298
|
}
|
|
43110
43299
|
}, [promptSuggestion]);
|
|
43111
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
43112
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
43113
|
-
const [startupIdeConnectionStatus, setStartupIdeConnectionStatus] = (0,
|
|
43114
|
-
(0,
|
|
43300
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react165.useState)(false);
|
|
43301
|
+
const [currentIDE, setCurrentIDE] = (0, import_react165.useState)(null);
|
|
43302
|
+
const [startupIdeConnectionStatus, setStartupIdeConnectionStatus] = (0, import_react165.useState)({ state: "idle" });
|
|
43303
|
+
(0, import_react165.useEffect)(() => {
|
|
43115
43304
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
43116
43305
|
const ideClient = await IdeClient.getInstance();
|
|
43117
43306
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -43127,40 +43316,40 @@ ${currentText}` : popped);
|
|
|
43127
43316
|
tomlFiles: commandMigrationTomlFiles,
|
|
43128
43317
|
setShowMigrationNudge: setShowCommandMigrationNudge
|
|
43129
43318
|
} = useCommandMigration(settings, config.storage);
|
|
43130
|
-
const [showToolDescriptions, setShowToolDescriptions] = (0,
|
|
43319
|
+
const [showToolDescriptions, setShowToolDescriptions] = (0, import_react165.useState)(false);
|
|
43131
43320
|
const configuredRenderMode = settings.merged.ui?.renderMode;
|
|
43132
|
-
const [renderMode, setRenderMode] = (0,
|
|
43321
|
+
const [renderMode, setRenderMode] = (0, import_react165.useState)(
|
|
43133
43322
|
configuredRenderMode === "raw" ? "raw" : "render"
|
|
43134
43323
|
);
|
|
43135
|
-
const renderModeConfigMountedRef = (0,
|
|
43136
|
-
(0,
|
|
43324
|
+
const renderModeConfigMountedRef = (0, import_react165.useRef)(false);
|
|
43325
|
+
(0, import_react165.useEffect)(() => {
|
|
43137
43326
|
if (!renderModeConfigMountedRef.current) {
|
|
43138
43327
|
renderModeConfigMountedRef.current = true;
|
|
43139
43328
|
return;
|
|
43140
43329
|
}
|
|
43141
43330
|
setRenderMode(configuredRenderMode === "raw" ? "raw" : "render");
|
|
43142
43331
|
}, [configuredRenderMode]);
|
|
43143
|
-
const renderModeMountedRef = (0,
|
|
43144
|
-
(0,
|
|
43332
|
+
const renderModeMountedRef = (0, import_react165.useRef)(false);
|
|
43333
|
+
(0, import_react165.useEffect)(() => {
|
|
43145
43334
|
if (!renderModeMountedRef.current) {
|
|
43146
43335
|
renderModeMountedRef.current = true;
|
|
43147
43336
|
return;
|
|
43148
43337
|
}
|
|
43149
43338
|
refreshStatic();
|
|
43150
43339
|
}, [renderMode, refreshStatic]);
|
|
43151
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0,
|
|
43152
|
-
const ctrlCTimerRef = (0,
|
|
43153
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0,
|
|
43154
|
-
const ctrlDTimerRef = (0,
|
|
43155
|
-
const [escapePressedOnce, setEscapePressedOnce] = (0,
|
|
43156
|
-
const escapeTimerRef = (0,
|
|
43157
|
-
const dialogsVisibleRef = (0,
|
|
43158
|
-
const [isRewindSelectorOpen, setIsRewindSelectorOpen] = (0,
|
|
43159
|
-
const [rewindEscPending, setRewindEscPending] = (0,
|
|
43160
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
43161
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
43162
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
43163
|
-
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0,
|
|
43340
|
+
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0, import_react165.useState)(false);
|
|
43341
|
+
const ctrlCTimerRef = (0, import_react165.useRef)(null);
|
|
43342
|
+
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0, import_react165.useState)(false);
|
|
43343
|
+
const ctrlDTimerRef = (0, import_react165.useRef)(null);
|
|
43344
|
+
const [escapePressedOnce, setEscapePressedOnce] = (0, import_react165.useState)(false);
|
|
43345
|
+
const escapeTimerRef = (0, import_react165.useRef)(null);
|
|
43346
|
+
const dialogsVisibleRef = (0, import_react165.useRef)(false);
|
|
43347
|
+
const [isRewindSelectorOpen, setIsRewindSelectorOpen] = (0, import_react165.useState)(false);
|
|
43348
|
+
const [rewindEscPending, setRewindEscPending] = (0, import_react165.useState)(false);
|
|
43349
|
+
const [constrainHeight, setConstrainHeight] = (0, import_react165.useState)(true);
|
|
43350
|
+
const [ideContextState, setIdeContextState] = (0, import_react165.useState)();
|
|
43351
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react165.useState)(false);
|
|
43352
|
+
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react165.useState)(false);
|
|
43164
43353
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings, setIsTrustedFolder);
|
|
43165
43354
|
const {
|
|
43166
43355
|
isMcpApprovalDialogOpen,
|
|
@@ -43189,7 +43378,7 @@ ${currentText}` : popped);
|
|
|
43189
43378
|
const dialogsVisible = showWelcomeBackDialog || shouldShowIdePrompt || shouldShowCommandMigrationNudge || isFolderTrustDialogOpen || isMcpApprovalDialogOpen || !!shellConfirmationRequest || !!confirmationRequest || confirmUpdateExtensionRequests.length > 0 || !!providerUpdateRequest || settingInputRequests.length > 0 || pluginChoiceRequests.length > 0 || !!loopDetectionConfirmationRequest || isThemeDialogOpen || isSettingsDialogOpen || isStatusLineDialogOpen || isMemoryDialogOpen || isModelDialogOpen || isTrustDialogOpen || activeArenaDialog !== null || isPermissionsDialogOpen || isAuthDialogOpen || isAuthenticating || isEditorDialogOpen || showIdeRestartPrompt || isSubagentCreateDialogOpen || isAgentsManagerDialogOpen || isSkillsManagerDialogOpen || isMcpDialogOpen || isHooksDialogOpen || isStatsDialogOpen || isApprovalModeDialogOpen || isEffortDialogOpen || isResumeDialogOpen || isDeleteDialogOpen || isHelpDialogOpen || isExtensionsManagerDialogOpen || isRewindSelectorOpen || isDiffDialogOpen || isSkillReviewDialogOpen || bgTasksDialogOpen || showWorktreeExitDialog || !!(settings.corruptedPath && !settings.corruptionDialogDismissed);
|
|
43190
43379
|
dialogsVisibleRef.current = dialogsVisible;
|
|
43191
43380
|
const needsBlockingInput = dialogsVisible || streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
43192
|
-
(0,
|
|
43381
|
+
(0, import_react165.useEffect)(() => {
|
|
43193
43382
|
if (needsBlockingInput && isTranscriptOpen) {
|
|
43194
43383
|
closeTranscript();
|
|
43195
43384
|
}
|
|
@@ -43205,12 +43394,12 @@ ${currentText}` : popped);
|
|
|
43205
43394
|
stickyTodoWidth,
|
|
43206
43395
|
stickyTodoMaxVisibleItems
|
|
43207
43396
|
) : "hidden";
|
|
43208
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
43397
|
+
const [controlsHeight, setControlsHeight] = (0, import_react165.useState)(0);
|
|
43209
43398
|
const liveAgentPanelLayoutKey = getLiveAgentPanelLayoutKey(
|
|
43210
43399
|
bgTaskEntries,
|
|
43211
43400
|
bgLivePanelFocused
|
|
43212
43401
|
);
|
|
43213
|
-
(0,
|
|
43402
|
+
(0, import_react165.useLayoutEffect)(() => {
|
|
43214
43403
|
if (!mainControlsRef.current) {
|
|
43215
43404
|
setControlsHeight(
|
|
43216
43405
|
(previousHeight) => previousHeight === 0 ? previousHeight : 0
|
|
@@ -43229,10 +43418,13 @@ ${currentText}` : popped);
|
|
|
43229
43418
|
dialogsVisible,
|
|
43230
43419
|
stickyTodosLayoutKey,
|
|
43231
43420
|
liveAgentPanelLayoutKey,
|
|
43232
|
-
// Composer height also
|
|
43233
|
-
// re-measured during a streaming turn and the VP
|
|
43421
|
+
// Composer and update notification height also shift with these; without
|
|
43422
|
+
// them the footer isn't re-measured during a streaming turn and the VP
|
|
43423
|
+
// viewport bottom clips.
|
|
43234
43424
|
// (elapsedTime/currentLoadingPhrase excluded: they tick without changing rows.)
|
|
43235
43425
|
streamingState,
|
|
43426
|
+
updateInfo,
|
|
43427
|
+
agentViewState.activeView,
|
|
43236
43428
|
embeddedShellFocused,
|
|
43237
43429
|
messageQueue.length,
|
|
43238
43430
|
isInputActive
|
|
@@ -43254,7 +43446,7 @@ ${currentText}` : popped);
|
|
|
43254
43446
|
pager: settings.merged.tools?.shell?.pager,
|
|
43255
43447
|
showColor: settings.merged.tools?.shell?.showColor
|
|
43256
43448
|
});
|
|
43257
|
-
(0,
|
|
43449
|
+
(0, import_react165.useEffect)(() => {
|
|
43258
43450
|
if (activePtyId) {
|
|
43259
43451
|
ShellExecutionService.resizePty(
|
|
43260
43452
|
activePtyId,
|
|
@@ -43264,17 +43456,18 @@ ${currentText}` : popped);
|
|
|
43264
43456
|
}
|
|
43265
43457
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
43266
43458
|
useResizeSettleRepaint(terminalWidth, refreshStatic);
|
|
43267
|
-
(
|
|
43459
|
+
useWakeRepaint(refreshStatic);
|
|
43460
|
+
(0, import_react165.useEffect)(() => {
|
|
43268
43461
|
if (ideNeedsRestart) {
|
|
43269
43462
|
setShowIdeRestartPrompt(true);
|
|
43270
43463
|
}
|
|
43271
43464
|
}, [ideNeedsRestart]);
|
|
43272
|
-
(0,
|
|
43465
|
+
(0, import_react165.useEffect)(() => {
|
|
43273
43466
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
43274
43467
|
setIdeContextState(ideContextStore.get());
|
|
43275
43468
|
return unsubscribe;
|
|
43276
43469
|
}, []);
|
|
43277
|
-
(0,
|
|
43470
|
+
(0, import_react165.useEffect)(() => {
|
|
43278
43471
|
const listener = /* @__PURE__ */ __name((status) => {
|
|
43279
43472
|
setStartupIdeConnectionStatus(status);
|
|
43280
43473
|
}, "listener");
|
|
@@ -43283,10 +43476,10 @@ ${currentText}` : popped);
|
|
|
43283
43476
|
appEvents.off("startup-ide-connection-status-changed" /* StartupIdeConnectionStatusChanged */, listener);
|
|
43284
43477
|
};
|
|
43285
43478
|
}, []);
|
|
43286
|
-
const handleEscapePromptChange = (0,
|
|
43479
|
+
const handleEscapePromptChange = (0, import_react165.useCallback)((showPrompt) => {
|
|
43287
43480
|
setShowEscapePrompt(showPrompt);
|
|
43288
43481
|
}, []);
|
|
43289
|
-
const openRewindSelector = (0,
|
|
43482
|
+
const openRewindSelector = (0, import_react165.useCallback)(() => {
|
|
43290
43483
|
if (streamingState !== "idle" /* Idle */) return;
|
|
43291
43484
|
if (dialogsVisibleRef.current) return;
|
|
43292
43485
|
if (config.getIdeMode()) {
|
|
@@ -43304,10 +43497,10 @@ ${currentText}` : popped);
|
|
|
43304
43497
|
setIsRewindSelectorOpen(true);
|
|
43305
43498
|
}, [streamingState, config, historyManager]);
|
|
43306
43499
|
openRewindSelectorRef.current = openRewindSelector;
|
|
43307
|
-
const closeRewindSelector = (0,
|
|
43500
|
+
const closeRewindSelector = (0, import_react165.useCallback)(() => {
|
|
43308
43501
|
setIsRewindSelectorOpen(false);
|
|
43309
43502
|
}, []);
|
|
43310
|
-
const handleRewindConfirm = (0,
|
|
43503
|
+
const handleRewindConfirm = (0, import_react165.useCallback)(
|
|
43311
43504
|
async (userItem, option) => {
|
|
43312
43505
|
try {
|
|
43313
43506
|
const needsConversation = option === "conversation" || option === "both";
|
|
@@ -43469,7 +43662,7 @@ ${currentText}` : popped);
|
|
|
43469
43662
|
openRewindSelector,
|
|
43470
43663
|
(pending) => setRewindEscPending(pending)
|
|
43471
43664
|
);
|
|
43472
|
-
const handleIdePromptComplete = (0,
|
|
43665
|
+
const handleIdePromptComplete = (0, import_react165.useCallback)(
|
|
43473
43666
|
(result) => {
|
|
43474
43667
|
if (result.userSelection === "yes") {
|
|
43475
43668
|
if (result.isExtensionPreInstalled) {
|
|
@@ -43485,7 +43678,7 @@ ${currentText}` : popped);
|
|
|
43485
43678
|
},
|
|
43486
43679
|
[handleSlashCommand, settings]
|
|
43487
43680
|
);
|
|
43488
|
-
const handleCommandMigrationComplete = (0,
|
|
43681
|
+
const handleCommandMigrationComplete = (0, import_react165.useCallback)(
|
|
43489
43682
|
async (result) => {
|
|
43490
43683
|
setShowCommandMigrationNudge(false);
|
|
43491
43684
|
if (result.userSelection === "yes") {
|
|
@@ -43577,7 +43770,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43577
43770
|
pendingToolCalls
|
|
43578
43771
|
});
|
|
43579
43772
|
const workflowBellEnabled = settings.merged.general?.terminalBell ?? true;
|
|
43580
|
-
(0,
|
|
43773
|
+
(0, import_react165.useEffect)(() => {
|
|
43581
43774
|
const registry = config.getWorkflowRunRegistry?.();
|
|
43582
43775
|
if (!registry?.setNotificationCallback) return;
|
|
43583
43776
|
registry.setNotificationCallback((entry) => {
|
|
@@ -43627,7 +43820,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43627
43820
|
showWorktreeExitDialog,
|
|
43628
43821
|
closeWorktreeExitDialog: /* @__PURE__ */ __name(() => setShowWorktreeExitDialog(false), "closeWorktreeExitDialog")
|
|
43629
43822
|
});
|
|
43630
|
-
const handleExit = (0,
|
|
43823
|
+
const handleExit = (0, import_react165.useCallback)(
|
|
43631
43824
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
43632
43825
|
if (pressedOnce) {
|
|
43633
43826
|
if (timerRef.current) {
|
|
@@ -43680,7 +43873,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43680
43873
|
activeWorktree
|
|
43681
43874
|
]
|
|
43682
43875
|
);
|
|
43683
|
-
const handleGlobalKeypress = (0,
|
|
43876
|
+
const handleGlobalKeypress = (0, import_react165.useCallback)(
|
|
43684
43877
|
(key) => {
|
|
43685
43878
|
if (settings.merged.general?.debugKeystrokeLogging) {
|
|
43686
43879
|
debugLogger40.debug("[DEBUG] Keystroke:", JSON.stringify(key));
|
|
@@ -43870,7 +44063,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43870
44063
|
]
|
|
43871
44064
|
);
|
|
43872
44065
|
useKeypress(handleGlobalKeypress, { isActive: true });
|
|
43873
|
-
(0,
|
|
44066
|
+
(0, import_react165.useEffect)(() => {
|
|
43874
44067
|
if (settings.merged.ui?.hideWindowTitle) {
|
|
43875
44068
|
return;
|
|
43876
44069
|
}
|
|
@@ -43897,9 +44090,9 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43897
44090
|
settings.merged.ui?.showStatusInTitle,
|
|
43898
44091
|
config
|
|
43899
44092
|
]);
|
|
43900
|
-
const queueDrainingRef = (0,
|
|
43901
|
-
const [queueDrainNonce, setQueueDrainNonce] = (0,
|
|
43902
|
-
(0,
|
|
44093
|
+
const queueDrainingRef = (0, import_react165.useRef)(false);
|
|
44094
|
+
const [queueDrainNonce, setQueueDrainNonce] = (0, import_react165.useState)(0);
|
|
44095
|
+
(0, import_react165.useEffect)(() => {
|
|
43903
44096
|
if (queueDrainingRef.current) return;
|
|
43904
44097
|
if (!shouldDrainMessageQueue({
|
|
43905
44098
|
isConfigInitialized,
|
|
@@ -43933,7 +44126,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43933
44126
|
queueDrainNonce
|
|
43934
44127
|
]);
|
|
43935
44128
|
const nightly = props.version.includes("nightly");
|
|
43936
|
-
const uiState = (0,
|
|
44129
|
+
const uiState = (0, import_react165.useMemo)(
|
|
43937
44130
|
() => ({
|
|
43938
44131
|
history: historyManager.history,
|
|
43939
44132
|
historyManager,
|
|
@@ -44224,7 +44417,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44224
44417
|
isDiffDialogOpen
|
|
44225
44418
|
]
|
|
44226
44419
|
);
|
|
44227
|
-
const uiActions = (0,
|
|
44420
|
+
const uiActions = (0, import_react165.useMemo)(
|
|
44228
44421
|
() => ({
|
|
44229
44422
|
openThemeDialog,
|
|
44230
44423
|
openEditorDialog,
|
|
@@ -44405,11 +44598,11 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44405
44598
|
closeDiffDialog
|
|
44406
44599
|
]
|
|
44407
44600
|
);
|
|
44408
|
-
const renderModeValue = (0,
|
|
44601
|
+
const renderModeValue = (0, import_react165.useMemo)(
|
|
44409
44602
|
() => ({ renderMode, setRenderMode }),
|
|
44410
44603
|
[renderMode, setRenderMode]
|
|
44411
44604
|
);
|
|
44412
|
-
const thoughtExpandedValue = (0,
|
|
44605
|
+
const thoughtExpandedValue = (0, import_react165.useMemo)(
|
|
44413
44606
|
() => ({
|
|
44414
44607
|
allExpanded: thoughtExpanded,
|
|
44415
44608
|
expandedHeadIds: expandedThoughtHeadIds,
|
|
@@ -44446,9 +44639,9 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44446
44639
|
|
|
44447
44640
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
44448
44641
|
init_esbuild_shims();
|
|
44449
|
-
var
|
|
44642
|
+
var import_react166 = __toESM(require_react(), 1);
|
|
44450
44643
|
function useKittyKeyboardProtocol() {
|
|
44451
|
-
const [status] = (0,
|
|
44644
|
+
const [status] = (0, import_react166.useState)({
|
|
44452
44645
|
supported: isKittyProtocolSupported(),
|
|
44453
44646
|
enabled: isKittyProtocolEnabled(),
|
|
44454
44647
|
checking: false
|
|
@@ -44733,7 +44926,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
44733
44926
|
process.stdout.setMaxListeners(0);
|
|
44734
44927
|
}
|
|
44735
44928
|
const instance = render_default(
|
|
44736
|
-
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
44929
|
+
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_react167.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(AppWrapper, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(AppWrapper, {}),
|
|
44737
44930
|
{
|
|
44738
44931
|
exitOnCtrlC: false,
|
|
44739
44932
|
isScreenReaderEnabled: config.getScreenReader(),
|