@qwen-code/qwen-code 0.20.0-preview.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/qc-helper/docs/configuration/settings.md +1 -1
- package/bundled/qc-helper/docs/features/auto-mode.md +16 -19
- package/bundled/qc-helper/docs/features/commands.md +0 -54
- package/bundled/qc-helper/docs/features/sub-agents.md +7 -16
- package/bundled/qc-helper/docs/integration-github-action.md +10 -10
- package/bundled/qc-helper/docs/qwen-serve.md +1 -2
- package/bundled/review/DESIGN.md +2 -2
- package/bundled/review/SKILL.md +4 -4
- package/chunks/{MaxSizedBox-53BTJ3JK.js → MaxSizedBox-B5YGZSYE.js} +34 -41
- package/chunks/{StandaloneSessionPicker-VMFIXQ44.js → StandaloneSessionPicker-CEGO2AZX.js} +50 -57
- package/chunks/{acpAgent-5WYAVSFG.js → acpAgent-YUR43TLG.js} +496 -1487
- package/chunks/{agent-44FM7PBX.js → agent-H4JIDL7S.js} +30 -37
- package/chunks/agent-headless-TTBEREQV.js +61 -0
- package/chunks/{anthropicContentGenerator-NMSS7IMV.js → anthropicContentGenerator-HVKLXOOU.js} +12 -13
- package/chunks/{artifact-tool-56T5IMBP.js → artifact-tool-WBCAMD3O.js} +3 -3
- package/chunks/{askUserQuestion-E25OBIC2.js → askUserQuestion-6DZC4UV5.js} +3 -3
- package/chunks/{bridge-IQZT3KU2.js → bridge-VL7ITBU5.js} +35 -42
- package/chunks/{build-GHIZ4MSZ.js → build-SSCNEHZZ.js} +1 -1
- package/chunks/{ca-N6VVUFVB.js → ca-2SL2BXTK.js} +201 -611
- package/chunks/{channel-worker-group-LFBT7K64.js → channel-worker-group-53CMOPFT.js} +5 -5
- package/chunks/{channel-worker-manager-3RUPERG2.js → channel-worker-manager-UTXILKC2.js} +5 -5
- package/chunks/{channel-worker-supervisor-A3KVATD3.js → channel-worker-supervisor-ZGO2W2MD.js} +4 -4
- package/chunks/{chunk-2LI23QA6.js → chunk-2HOVDT7W.js} +1 -1
- package/chunks/{chunk-JWJVZHT5.js → chunk-2LL7TXB4.js} +2 -2
- package/chunks/{chunk-22OH7L7I.js → chunk-333CXMNJ.js} +5 -5
- package/chunks/{chunk-J3VSRG5Y.js → chunk-33XUAINQ.js} +21 -61
- package/chunks/{chunk-S4BT3PX3.js → chunk-4EP2PYYL.js} +5 -5
- package/chunks/{chunk-CJTAUXKG.js → chunk-4ILMYHEI.js} +3 -3
- package/chunks/{chunk-JIHHXJFH.js → chunk-4N3KMAIL.js} +32 -128
- package/chunks/{chunk-6ZBPS62S.js → chunk-4ODB7WIB.js} +1 -1
- package/chunks/{chunk-YDLVKCZJ.js → chunk-4XNLIGVA.js} +298 -576
- package/chunks/{chunk-Q6DEGTYO.js → chunk-542SK7KV.js} +1608 -243
- package/chunks/{chunk-EPN5MKRH.js → chunk-5JBR5XIK.js} +2 -2
- package/chunks/{chunk-E4IMU4Y5.js → chunk-5SCI6E3E.js} +1 -1
- package/chunks/{chunk-IE7TPOXP.js → chunk-6AFUCL3D.js} +1 -1
- package/chunks/{chunk-5I5BM454.js → chunk-6EFTQYW7.js} +1 -1
- package/chunks/{chunk-45AIVIUL.js → chunk-7PZ2ATFZ.js} +29 -54
- package/chunks/{chunk-VI7UU7ZI.js → chunk-7RMOXZTC.js} +4 -4
- package/chunks/{chunk-C3YZ5CLY.js → chunk-7SXZC7ID.js} +6 -7
- package/chunks/{chunk-X6KLM4LZ.js → chunk-A5LYNIW7.js} +8 -8
- package/chunks/{chunk-GZBHRTNM.js → chunk-AJSJ5TTU.js} +1 -1
- package/chunks/{chunk-IT27F3ES.js → chunk-AKX4WPPP.js} +86 -307
- package/chunks/{chunk-EJFHUF3D.js → chunk-ANPINBOF.js} +5 -5
- package/chunks/{chunk-JJEFX6U5.js → chunk-AQIEINAY.js} +1766 -28
- package/chunks/{chunk-7Z6JQEL6.js → chunk-AYCDXHZB.js} +1 -1
- package/chunks/{chunk-BKZEHVPV.js → chunk-B3KGZCQN.js} +169 -177
- package/chunks/{chunk-6X4GWOPW.js → chunk-BDBMYST4.js} +1 -1
- package/chunks/{chunk-BEKZWVJJ.js → chunk-BMWMT5Y2.js} +373 -3
- package/chunks/{chunk-5MZSD2JX.js → chunk-BRRF37CO.js} +6 -6
- package/chunks/{chunk-QLJUC7TG.js → chunk-BVLROR2T.js} +1 -1
- package/chunks/{chunk-OQB4EXO4.js → chunk-C27BYUX6.js} +11 -14
- package/chunks/{chunk-VTKWURCJ.js → chunk-CB2HFGRV.js} +6 -31
- package/chunks/chunk-CPCVCKKF.js +358 -0
- package/chunks/{chunk-OAGG6CRR.js → chunk-CV63PP6U.js} +1 -1
- package/chunks/{chunk-XFWD3PCA.js → chunk-CZF3E5GF.js} +1 -1
- package/chunks/{chunk-QF4DPYPH.js → chunk-D22SX43D.js} +1 -1
- package/chunks/{chunk-X6N25LXS.js → chunk-D2VIDMVM.js} +2 -2
- package/chunks/{chunk-7KZ2KYAD.js → chunk-DBE4QFZS.js} +23 -27
- package/chunks/{chunk-VHYCUGOT.js → chunk-DP5GXXNZ.js} +1 -5
- package/chunks/{chunk-Q2YKNMLS.js → chunk-EAUYY7SS.js} +3 -3
- package/chunks/{chunk-KHOVYUHX.js → chunk-EIAK6Q2B.js} +2 -2
- package/chunks/{chunk-NPQDJGKU.js → chunk-EZVDJFZ7.js} +1 -1
- package/chunks/{chunk-FODK6UMO.js → chunk-FEOZBUMT.js} +27 -0
- package/chunks/{chunk-6NHK6HS7.js → chunk-FLSVD6BS.js} +3 -3
- package/chunks/{chunk-XP32LURS.js → chunk-FQD7GFSV.js} +3 -3
- package/chunks/{chunk-T2L47JJK.js → chunk-FSL5W5TI.js} +3 -3
- package/chunks/{chunk-JCW2R7WC.js → chunk-G45X5TRN.js} +72 -1
- package/chunks/{chunk-ZHERRXZJ.js → chunk-GKY2OJ7R.js} +1 -1
- package/chunks/{chunk-6IL7KRLE.js → chunk-GMGDLUC7.js} +1 -1
- package/chunks/{chunk-E5MVGARW.js → chunk-HZPN55E5.js} +1 -1
- package/chunks/{chunk-LMQNDPVP.js → chunk-I2PYAYFM.js} +3 -3
- package/chunks/{chunk-JD5FHQ3N.js → chunk-IR46U7RB.js} +3 -3
- package/chunks/{chunk-BXXWWCLA.js → chunk-IVPSS6EL.js} +4 -4
- package/chunks/{chunk-4K56OJFJ.js → chunk-JD3MKVKL.js} +1 -1
- package/chunks/{chunk-SP5WRGVG.js → chunk-JNWZQ27S.js} +3 -3
- package/chunks/{chunk-RUNR5DAE.js → chunk-KDC6GNQR.js} +4 -4
- package/chunks/{chunk-JT7HACMQ.js → chunk-KG3XV6FH.js} +2 -29
- package/chunks/{chunk-BRHHXGWL.js → chunk-KOR3XKCA.js} +4 -10
- package/chunks/{chunk-H4OWOFZL.js → chunk-KQNM4EO7.js} +5 -137
- package/chunks/{chunk-4K7VDKAD.js → chunk-KTUQMDEP.js} +1 -1
- package/chunks/{chunk-6RQ5IPUX.js → chunk-KX6UK4VJ.js} +19929 -22391
- package/chunks/{chunk-JYS55H6Z.js → chunk-MAQQGNQ5.js} +7 -66
- package/chunks/{chunk-GOWMC4CS.js → chunk-MJ6S23WZ.js} +4 -4
- package/chunks/{chunk-D7WXIW7H.js → chunk-NBMIC7DR.js} +4 -4
- package/chunks/{chunk-NYPUWHHC.js → chunk-NDMQLV4Y.js} +4 -4
- package/chunks/{chunk-FFFM6NJV.js → chunk-NEEB7UEN.js} +2 -1
- package/chunks/{chunk-6AWRQ4T2.js → chunk-NGFEPAE6.js} +6 -8
- package/chunks/{chunk-RVLZCXEE.js → chunk-NIJEXGV6.js} +10 -79
- package/chunks/{chunk-6OHCY3OB.js → chunk-O3OCNYY5.js} +2 -2
- package/chunks/{chunk-J63IP5ZT.js → chunk-O3Z73NBP.js} +7 -7
- package/chunks/{chunk-RWCQJC5W.js → chunk-OEO2ERWK.js} +33 -54
- package/chunks/{chunk-KQQ757OQ.js → chunk-OLMETXLX.js} +2 -2
- package/chunks/{chunk-LIZRAKPB.js → chunk-OOCI5VVU.js} +1 -1
- package/chunks/{chunk-GPSKDNEE.js → chunk-OONJNQ42.js} +3 -3
- package/chunks/{chunk-YM3SZTH4.js → chunk-OP4MOGXF.js} +1 -8
- package/chunks/{chunk-CHLNJN3C.js → chunk-OWCALFEG.js} +1 -1
- package/chunks/{chunk-5JX7FPHW.js → chunk-OYZWQNWG.js} +2 -2
- package/chunks/{chunk-QBUDF33N.js → chunk-PBATSWUQ.js} +1 -1
- package/chunks/{chunk-DKZISEDB.js → chunk-PBWEWI4N.js} +69 -76
- package/chunks/{chunk-DORJSBMF.js → chunk-PF4CHQOJ.js} +6 -6
- package/chunks/{chunk-SOMSZ6W3.js → chunk-PGEPSDJI.js} +8 -13
- package/chunks/{chunk-4LVZNIDO.js → chunk-QKYTTBYW.js} +1 -1
- package/chunks/{chunk-VYPFXUCB.js → chunk-R3VWUU2E.js} +1 -1
- package/chunks/{chunk-RV4C2ZFG.js → chunk-RFIAR4YL.js} +1 -1
- package/chunks/{chunk-66RKDODM.js → chunk-S2PD3EZD.js} +1 -1
- package/chunks/{chunk-RAUHV362.js → chunk-S2W2LVDU.js} +3 -3
- package/chunks/{chunk-VLBJ7ZUG.js → chunk-S2XVRHDN.js} +1 -1
- package/chunks/chunk-SEKHYHMS.js +45 -0
- package/chunks/{chunk-KNTYRZD4.js → chunk-SJMV7ZBK.js} +8 -8
- package/chunks/{chunk-THJNPLI4.js → chunk-TB6UDU4T.js} +16 -16
- package/chunks/{chunk-CMRYLH67.js → chunk-TIH2ZTOC.js} +2 -2
- package/chunks/{chunk-K4VB66QF.js → chunk-TKLLK6XQ.js} +11 -11
- package/chunks/{chunk-QTROYZUC.js → chunk-TMQ6XQCX.js} +53 -170
- package/chunks/{chunk-QNLNLENL.js → chunk-UEY4AYUL.js} +2 -2
- package/chunks/{chunk-FSXCGBXB.js → chunk-VDWBQ5AW.js} +1 -1
- package/chunks/{chunk-45DNGJKC.js → chunk-VEXFOTEO.js} +3 -3
- package/chunks/{chunk-A7CUSHP7.js → chunk-VZQUV7VK.js} +1 -1
- package/chunks/chunk-W7FJ3N32.js +49 -0
- package/chunks/{chunk-UGYMA4EI.js → chunk-W7H223ZZ.js} +1 -1
- package/chunks/{chunk-UH3WSE5L.js → chunk-X6YQWCIJ.js} +1 -13
- package/chunks/{chunk-H4AR2JQF.js → chunk-XVVH63JG.js} +3 -3
- package/chunks/{chunk-QKTHJXCS.js → chunk-Y2ENGUD6.js} +1 -1
- package/chunks/{chunk-QD6BRERJ.js → chunk-YWEW33JY.js} +7 -7
- package/chunks/{chunk-57FIIFJN.js → chunk-ZEOZL37W.js} +1 -1
- package/chunks/chunk-ZFKNWQGQ.js +74639 -0
- package/chunks/{computer-use-FMEBQMCB.js → computer-use-NIWQNUZF.js} +35 -42
- package/chunks/{config-utils-WYUQ7II4.js → config-utils-AHQ6YZ66.js} +3 -3
- package/chunks/contextCommand-L2COEUHS.js +66 -0
- package/chunks/{create-sub-session-MLELTOCW.js → create-sub-session-MGNX52P3.js} +30 -37
- package/chunks/{create-sub-session-AZ77LBL3.js → create-sub-session-P26FE5GG.js} +3 -3
- package/chunks/{cron-create-KTWJM7QT.js → cron-create-JWFHBDRQ.js} +5 -5
- package/chunks/{cron-delete-2P3I5ULL.js → cron-delete-GDX4E26G.js} +5 -5
- package/chunks/{cron-list-PXDPGEDQ.js → cron-list-USMAIWPT.js} +5 -5
- package/chunks/{daemon-KLPTQIE4.js → daemon-RG2MAI6T.js} +81 -138
- package/chunks/daemon-status-provider-NL4IAG7B.js +74 -0
- package/chunks/{de-4IBXM7CN.js → de-I7ZIYXZC.js} +1 -5
- package/chunks/{dist-HMU6CYS4.js → dist-2BHAYBKP.js} +2 -2
- package/chunks/{dist-PJLG2XYX.js → dist-2MIU4UUH.js} +1 -1
- package/chunks/{dist-UIFWIFRO.js → dist-53PZYC5B.js} +2 -2
- package/chunks/{dist-OAV7LJGJ.js → dist-AU7NQQRP.js} +1 -1
- package/chunks/{dist-OMW6WDEO.js → dist-FUTEXY6A.js} +1 -1
- package/chunks/{dist-XRYV6TJP.js → dist-WGTQO7F2.js} +25 -65
- package/chunks/{earlyInputCapture-N3J42S2G.js → earlyInputCapture-L6I2A22T.js} +31 -38
- package/chunks/{edit-T6GO7VPW.js → edit-3QV3JZJL.js} +37 -42
- package/chunks/{en-USMCCJAJ.js → en-XE34GKAA.js} +1 -5
- package/chunks/{enter-worktree-OL3FMR3A.js → enter-worktree-4GMMF7EG.js} +35 -42
- package/chunks/{enterPlanMode-LEP7BSBX.js → enterPlanMode-L5UWBAUC.js} +36 -48
- package/chunks/{environment-6LNBH2LJ.js → environment-3OV7UQOT.js} +32 -39
- package/chunks/{errors-IM3H4DNG.js → errors-LEOF5QG4.js} +32 -39
- package/chunks/{exit-worktree-6MOANJMY.js → exit-worktree-DDP57JLV.js} +35 -42
- package/chunks/{exitPlanMode-VLBSWDJK.js → exitPlanMode-CJBLGPIP.js} +35 -42
- package/chunks/{fast-path-3Z3JY4BL.js → fast-path-M6RP2ING.js} +3 -4
- package/chunks/{fast-path-settings-XB3CPUJT.js → fast-path-settings-DAOVFADC.js} +2 -2
- package/chunks/{fr-WVHEBDDB.js → fr-X7KDVZIY.js} +1 -5
- package/chunks/{gemini-VDE6O6CX.js → gemini-H4PHBJTL.js} +89 -97
- package/chunks/{geminiContentGenerator-NN4ZWALY.js → geminiContentGenerator-VURJYPWP.js} +5 -5
- package/chunks/{getMachineId-bsd-QFVLPUPT.js → getMachineId-bsd-EXV7SWPA.js} +1 -1
- package/chunks/{getMachineId-darwin-DGMQQE2E.js → getMachineId-darwin-IUOMFXU3.js} +1 -1
- package/chunks/{getMachineId-linux-R4Z6CSWC.js → getMachineId-linux-K7XJYFHL.js} +1 -1
- package/chunks/{getMachineId-unsupported-Z3SBVBUV.js → getMachineId-unsupported-EA5FDRJ6.js} +1 -1
- package/chunks/{getMachineId-win-SCK5UFDT.js → getMachineId-win-KBA6RAI5.js} +1 -1
- package/chunks/{glob-7AZHIY3Z.js → glob-2KUSRAVQ.js} +35 -42
- package/chunks/{grep-E2KEORSD.js → grep-B5RXVESV.js} +35 -42
- package/chunks/handleAutoUpdate-QQVIWXKT.js +67 -0
- package/chunks/{i18n-VP4NCTZN.js → i18n-N6OBDORT.js} +31 -38
- package/chunks/initializer-6WCFNDLL.js +72 -0
- package/chunks/installationInfo-6J3WPXNS.js +64 -0
- package/chunks/{ja-KY4ROZTE.js → ja-2ICT3KXF.js} +1 -5
- package/chunks/{keychain-token-storage-6ACJDYIB.js → keychain-token-storage-DWRJMNH3.js} +3 -3
- package/chunks/list-HOWQSWP6.js +75 -0
- package/chunks/loadedSettingsAdapter-AO4YBRXZ.js +69 -0
- package/chunks/{loop-wakeup-RNMRVA66.js → loop-wakeup-5GLTUBHA.js} +6 -6
- package/chunks/{ls-J2ZI5XYK.js → ls-FHBY3Y7I.js} +5 -5
- package/chunks/{lsp-UMS3NUB5.js → lsp-B6VMEW6Y.js} +3 -3
- package/chunks/mcp-QH7QNXOH.js +69 -0
- package/chunks/{monitor-NDYKU5VS.js → monitor-GLJZDNPS.js} +35 -42
- package/chunks/nonInteractiveCli-TI7EMPXD.js +126 -0
- package/chunks/{notebook-edit-GF3HSMXN.js → notebook-edit-AVCIWS4F.js} +38 -43
- package/chunks/{openaiContentGenerator-GE2I3C2T.js → openaiContentGenerator-B7W24G3D.js} +17 -22
- package/chunks/{pidfile-KS4IGGNX.js → pidfile-UEHAT6DH.js} +31 -38
- package/chunks/{processUtils-TEQQ47A2.js → processUtils-XZPY2PBB.js} +2 -2
- package/chunks/{pt-OK455PLH.js → pt-JJ4XPIBP.js} +1 -5
- package/chunks/{qwenContentGenerator-NDYOEIUY.js → qwenContentGenerator-6GUTWJIC.js} +35 -44
- package/chunks/{qwenOAuth2-CXDOBPSK.js → qwenOAuth2-GASEEWGU.js} +15 -18
- package/chunks/{read-file-QDVJX75S.js → read-file-SQJONF6A.js} +11 -13
- package/chunks/{read-mcp-resource-F6HYMDUY.js → read-mcp-resource-AKCL7I43.js} +3 -3
- package/chunks/{record-artifact-7GCFLDD7.js → record-artifact-PEUB7727.js} +3 -3
- package/chunks/{resumeHistoryUtils-5EAQ76W4.js → resumeHistoryUtils-PFQ2A23X.js} +36 -43
- package/chunks/ripGrep-QCK22GDU.js +59 -0
- package/chunks/{ru-7SPDGMGD.js → ru-STR4KTW7.js} +1 -5
- package/chunks/{run-qwen-serve-TC6M3WTJ.js → run-qwen-serve-OZGR3FQA.js} +82 -104
- package/chunks/{runtime-BB73E3Z3.js → runtime-SNVAP6EH.js} +40 -49
- package/chunks/{scheduler-NDU5OFSJ.js → scheduler-Z7QLMUWA.js} +30 -37
- package/chunks/{send-message-PYIJ2PZL.js → send-message-3RHE7HSM.js} +4 -6
- package/chunks/{serve-BTIRWZJ4.js → serve-BT7KS6SC.js} +36 -43
- package/chunks/{server-JKAQBE2E.js → server-SO64U3X5.js} +284 -988
- package/chunks/{session-66QFVVDS.js → session-2KL2WQAH.js} +173 -92
- package/chunks/{settings-NBN6GY7E.js → settings-KITVOUSV.js} +39 -46
- package/chunks/{shell-JDSLAQVH.js → shell-BITUVH2R.js} +30 -37
- package/chunks/{skill-TNMHTO3C.js → skill-SOQHY455.js} +20 -24
- package/chunks/{spawnChannel-TFLHHXOC.js → spawnChannel-2BU3AULL.js} +32 -39
- package/chunks/{src-YFXMPRBL.js → src-43LM7JLB.js} +209 -279
- package/chunks/{standalone-update-2CQVQRSC.js → standalone-update-YG5JUYCM.js} +32 -39
- package/chunks/{startInteractiveUI-6C6PENRW.js → startInteractiveUI-3RGTGEX5.js} +895 -1092
- package/chunks/{syntheticOutput-H7RTI5KL.js → syntheticOutput-FG5PQKIR.js} +4 -4
- package/chunks/{task-create-7474AJJD.js → task-create-HX32YXO7.js} +8 -10
- package/chunks/{task-list-633HGOIB.js → task-list-QWSY4ZIU.js} +6 -6
- package/chunks/{task-stop-MNUGHPIA.js → task-stop-GWC6UWAL.js} +3 -3
- package/chunks/{task-update-66GQB5LI.js → task-update-NCTAB73Q.js} +8 -10
- package/chunks/{team-create-IPBHD26Z.js → team-create-FXN3PEBP.js} +35 -42
- package/chunks/{team-delete-BB3CG3QF.js → team-delete-KK37HTOG.js} +6 -6
- package/chunks/{team-plan-approval-WIGEJXXM.js → team-plan-approval-GEIZ356Q.js} +35 -42
- package/chunks/theme-manager-IAETOI25.js +63 -0
- package/chunks/{todoWrite-KRAUN54W.js → todoWrite-ERCAMLFS.js} +5 -5
- package/chunks/{tool-search-J3CBYJRB.js → tool-search-XKK7DNOK.js} +17 -21
- package/chunks/total-session-admission-BJLDHKJN.js +69 -0
- package/chunks/{trustedFolders-5FJRCHGN.js → trustedFolders-5XCVNEUU.js} +31 -38
- package/chunks/{update-relaunch-S5APSFJS.js → update-relaunch-FMVZK6XF.js} +17 -17
- package/chunks/updateCheck-YZZB7YBU.js +70 -0
- package/chunks/{useAutoAcceptIndicator-WZVJ52U3.js → useAutoAcceptIndicator-ZSQX4I2H.js} +40 -47
- package/chunks/{validateNonInterActiveAuth-64SVMELJ.js → validateNonInterActiveAuth-PRVEB6GG.js} +72 -79
- package/chunks/{version-SQL27GUA.js → version-AZMG6KWL.js} +1 -1
- package/chunks/{web-fetch-K7QCHIOJ.js → web-fetch-EPGJ5OQQ.js} +41 -100
- package/chunks/{workflow-BFTW72A5.js → workflow-UTNVPW22.js} +39 -47
- package/chunks/workspace-providers-status-EADV364W.js +72 -0
- package/chunks/{workspace-registration-store-VAVPVIF3.js → workspace-registration-store-F3ZX3YHT.js} +2 -8
- package/chunks/workspace-registry-W6VMFYZU.js +73 -0
- package/chunks/workspace-service-F3KIN2UN.js +84 -0
- package/chunks/workspace-skills-status-YVICUR5Y.js +71 -0
- package/chunks/write-file-CVGF2OKV.js +596 -0
- package/chunks/{zh-WY5DWYZD.js → zh-6ANG2HTL.js} +1 -5
- package/chunks/{zh-TW-BM47YBFH.js → zh-TW-4RR3YHNN.js} +1 -5
- package/cli-entry.js +12 -164
- package/cli.js +11 -18
- package/locales/ca.js +203 -772
- package/locales/de.js +2 -8
- package/locales/en.js +2 -8
- package/locales/fr.js +2 -8
- package/locales/ja.js +2 -8
- package/locales/pt.js +2 -8
- package/locales/ru.js +2 -8
- package/locales/zh-TW.js +2 -8
- package/locales/zh.js +2 -8
- package/package.json +3 -3
- package/web-shell/assets/{arc-ByltRugA.js → arc-Buk1besA.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-CCRTto5d.js → architectureDiagram-3BPJPVTR-B1aUKYDC.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-Jfy36u1L.js → blockDiagram-GPEHLZMM-CRTdg3Zx.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-4d5FfEZ0.js → c4Diagram-AAUBKEIU-DFdRMp5g.js} +1 -1
- package/web-shell/assets/channel-04R0vLbG.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-BPwxCEro.js → chunk-2J33WTMH-4rYQdkEI.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-jY7ZmJWY.js → chunk-4BX2VUAB-Coi-pQJy.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-C98HgCsS.js → chunk-55IACEB6-BtBjz02t.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-cDu-ge-q.js → chunk-727SXJPM-CGYOWorl.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-BKdJwxXK.js → chunk-AQP2D5EJ-CH5AKhqx.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-DnuxqwMu.js → chunk-FMBD7UC4-Cd50-w85.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-C4fZNPv0.js → chunk-ND2GUHAM-C2wF3KCK.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-Cf4XWOmz.js → chunk-QZHKN3VN-pCeRTaWi.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-Bw9SOwAV.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Bw9SOwAV.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-C82mFiqj.js → cose-bilkent-S5V4N54A-B-_fAB6D.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-Df8KACER.js → dagre-BM42HDAG-ChSPNHpL.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-EzNs7s_2.js → diagram-2AECGRRQ-BX7cFOF3.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-BRLNvreg.js → diagram-5GNKFQAL-BQUTW92n.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-2HLYHRjC.js → diagram-KO2AKTUF-BkYPh3e4.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-DeH0NzSp.js → diagram-LMA3HP47-Cl6jsNyx.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-k5Gn47-G.js → diagram-OG6HWLK6-DRWoHz8n.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-gPHFo79f.js → erDiagram-TEJ5UH35-CGvFcZco.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-DYBOiTRW.js → flowDiagram-I6XJVG4X-vms6oVdv.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-cxjAuic9.js → ganttDiagram-6RSMTGT7-ukT_sfmi.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-3nPqpmCP.js → gitGraphDiagram-PVQCEYII-Bn2ZE2Ut.js} +1 -1
- package/web-shell/assets/index-DgkKrjw3.js +1187 -0
- package/web-shell/assets/index-Rv6mOAN9.css +5 -0
- package/web-shell/assets/{index-Cl8d-1bK.js → index-wFXp7W68.js} +1 -1
- package/web-shell/assets/{infoDiagram-5YYISTIA-Dph21pR5.js → infoDiagram-5YYISTIA-DHJdSi7x.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-Cjg1hSaG.js → ishikawaDiagram-YF4QCWOH-DOvd2Wph.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-CR-IzvnU.js → journeyDiagram-JHISSGLW-CH_urMCT.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-BYmuybuC.js → kanban-definition-UN3LZRKU-FKiBdgbH.js} +1 -1
- package/web-shell/assets/{linear-CngEEoy8.js → linear-0ZVQFVKf.js} +1 -1
- package/web-shell/assets/{mermaid.core-G6fbZRPf.js → mermaid.core-DJ05ZZIK.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-BtnqnUwJ.js → mindmap-definition-RKZ34NQL-BPuUhkUm.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-XTq6UHIA.js → pieDiagram-4H26LBE5-yLFKcXyG.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-D1J5PrsS.js → quadrantDiagram-W4KKPZXB-irWqc1pE.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-CLcBUy3t.js → requirementDiagram-4Y6WPE33-B_4uMoIV.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-iwKV02_6.js → sankeyDiagram-5OEKKPKP-ciA4GPwk.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-7NFYQcEX.js → sequenceDiagram-3UESZ5HK-CRdZvy0U.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-Bvm4Wih6.js → stateDiagram-AJRCARHV-DaYIkCCn.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DWBoO4UY.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-B4FZFE9O.js → timeline-definition-PNZ67QCA-oBUKv6iH.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-CvMBpmtL.js → vennDiagram-CIIHVFJN-CGW9Sdmb.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-E3ag2327.js → wardley-L42UT6IY-CvwKJOCm.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BEXWlgxC.js → wardleyDiagram-YWT4CUSO-Ipc260sN.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-CICK05gI.js → xychartDiagram-2RQKCTM6-D6-CM7pK.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/agent-headless-CDBMKM44.js +0 -68
- package/chunks/chunk-2RFKHEXL.js +0 -74
- package/chunks/chunk-43T5WDQ7.js +0 -127
- package/chunks/chunk-6PVPNMXU.js +0 -29
- package/chunks/chunk-7362QS5B.js +0 -2256
- package/chunks/chunk-FMXMKPI5.js +0 -1780
- package/chunks/chunk-GLNBDYUX.js +0 -38
- package/chunks/chunk-HTR4WV6U.js +0 -327
- package/chunks/chunk-KWK7UE6L.js +0 -6194
- package/chunks/chunk-M7WBGLYP.js +0 -151
- package/chunks/chunk-NABLFI57.js +0 -82
- package/chunks/chunk-OQ5SYCPE.js +0 -10017
- package/chunks/chunk-OZYV6F53.js +0 -391
- package/chunks/chunk-TJQXJJX7.js +0 -121
- package/chunks/chunk-U7ZFW55U.js +0 -2098
- package/chunks/chunk-WHGVTP7Q.js +0 -1049
- package/chunks/chunk-XHATNRQA.js +0 -1500
- package/chunks/chunk-ZJVVETCV.js +0 -20600
- package/chunks/contextCommand-5YK3QNNJ.js +0 -73
- package/chunks/daemon-status-provider-FXMOD242.js +0 -81
- package/chunks/handleAutoUpdate-BCNVTQWW.js +0 -74
- package/chunks/initializer-5UB4SRPK.js +0 -79
- package/chunks/installationInfo-LNYJCXN3.js +0 -73
- package/chunks/list-NIZ77KPE.js +0 -82
- package/chunks/loadedSettingsAdapter-IQPRO2SO.js +0 -76
- package/chunks/managed-npm-update-GFRDCD77.js +0 -333
- package/chunks/mcp-TCUL7LT2.js +0 -76
- package/chunks/nonInteractiveCli-UHSHJDFD.js +0 -133
- package/chunks/ripGrep-WANMXNVT.js +0 -66
- package/chunks/sdk-exporters-grpc-ETLH47EP.js +0 -23214
- package/chunks/sdk-exporters-http-T3POX73F.js +0 -563
- package/chunks/sdk-impl-NSLPDH6I.js +0 -9193
- package/chunks/theme-manager-OZYKJG3W.js +0 -70
- package/chunks/total-session-admission-CNBQRM44.js +0 -76
- package/chunks/updateCheck-BPSMOZXS.js +0 -89
- package/chunks/web-search-KQPQFM7A.js +0 -731
- package/chunks/workspace-providers-status-4PLI2VFC.js +0 -79
- package/chunks/workspace-registry-I4ZRHGBS.js +0 -80
- package/chunks/workspace-service-RXYBWBDJ.js +0 -91
- package/chunks/workspace-skills-status-35Z2FU4I.js +0 -78
- package/chunks/write-file-KCL5RI2I.js +0 -66
- package/web-shell/assets/channel-4N2UIFcG.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-Q4dYOtsh.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Q4dYOtsh.js +0 -1
- package/web-shell/assets/index-B7jzUZ_s.css +0 -5
- package/web-shell/assets/index-gE8OWwj_.js +0 -1197
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-xXU_zO2Z.js +0 -1
- package/chunks/{chunk-QZJY47IE.js → chunk-PEJWA3QQ.js} +5 -5
|
@@ -1,86 +1,15 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import {
|
|
4
|
-
buildPermissionSuggestions
|
|
5
|
-
} from "./chunk-43T5WDQ7.js";
|
|
6
|
-
import {
|
|
7
|
-
startPostRenderPrefetches
|
|
8
|
-
} from "./chunk-7KZ2KYAD.js";
|
|
9
|
-
import {
|
|
10
|
-
stopAndGetCapturedInput
|
|
11
|
-
} from "./chunk-E4IMU4Y5.js";
|
|
12
|
-
import {
|
|
13
|
-
useAutoAcceptIndicator
|
|
14
|
-
} from "./chunk-XP32LURS.js";
|
|
15
|
-
import {
|
|
16
|
-
classifyApiError
|
|
17
|
-
} from "./chunk-V7RNNPGC.js";
|
|
18
3
|
import {
|
|
19
4
|
TUI_CHAT_RECORDING_FAILURE_MESSAGE,
|
|
20
5
|
reportChatRecordingFailureToAdapter
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import {
|
|
23
|
-
MAX_SUGGESTIONS_TO_SHOW,
|
|
24
|
-
buildMcpResourceRef,
|
|
25
|
-
buildMcpServerRef,
|
|
26
|
-
getExtensionSuggestions,
|
|
27
|
-
handleAtCommand,
|
|
28
|
-
matchMcpServerPrefix,
|
|
29
|
-
resolveAtCommandQuery,
|
|
30
|
-
sanitizeDisplayText
|
|
31
|
-
} from "./chunk-BXXWWCLA.js";
|
|
6
|
+
} from "./chunk-O3OCNYY5.js";
|
|
32
7
|
import {
|
|
33
8
|
StreamJsonOutputAdapter
|
|
34
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4EP2PYYL.js";
|
|
35
10
|
import {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
CommandService,
|
|
39
|
-
DISPLAY_HOOK_EVENTS,
|
|
40
|
-
FileCommandLoader,
|
|
41
|
-
MAX_STACKED_SKILLS,
|
|
42
|
-
McpPromptLoader,
|
|
43
|
-
SavedWorkflowLoader,
|
|
44
|
-
SkillCommandLoader,
|
|
45
|
-
addConfigToMatcherGroup,
|
|
46
|
-
appendUserPromptExpansionAdditionalContext,
|
|
47
|
-
copyToClipboard,
|
|
48
|
-
createEmptyHookEventInfo,
|
|
49
|
-
findMidInputSlashCommand,
|
|
50
|
-
findSlashCommandTokens,
|
|
51
|
-
formatApprovalModeDescription,
|
|
52
|
-
formatApprovalModeName,
|
|
53
|
-
formatUserPromptExpansionBlockedMessage,
|
|
54
|
-
getAllConfigs,
|
|
55
|
-
getBestSlashCommandMatch,
|
|
56
|
-
getTranslatedSourceDisplayMap,
|
|
57
|
-
hasBlockingBackgroundWork,
|
|
58
|
-
hasSlashCommandPathSeparator,
|
|
59
|
-
isAtCommand,
|
|
60
|
-
isBtwCommand,
|
|
61
|
-
isMidInputCompletableCommand,
|
|
62
|
-
isSlashCommand,
|
|
63
|
-
normalizePartList,
|
|
64
|
-
parseSlashCommand,
|
|
65
|
-
parseStackedSlashCommands,
|
|
66
|
-
refreshExtensionContentRuntime,
|
|
67
|
-
resetBackgroundStateForSessionSwitch,
|
|
68
|
-
serializeUserPromptExpansionPrompt,
|
|
69
|
-
supportsMatchers
|
|
70
|
-
} from "./chunk-DKZISEDB.js";
|
|
71
|
-
import {
|
|
72
|
-
EXTENSION_RELOAD_FAILED_REASON,
|
|
73
|
-
ExtensionRefreshState,
|
|
74
|
-
appEvents,
|
|
75
|
-
cleanupReviewWorktreeLeases,
|
|
76
|
-
loadHierarchicalGeminiMemory
|
|
77
|
-
} from "./chunk-YDLVKCZJ.js";
|
|
78
|
-
import {
|
|
79
|
-
disableKittyProtocol,
|
|
80
|
-
isKittyProtocolEnabled,
|
|
81
|
-
isKittyProtocolSupported
|
|
82
|
-
} from "./chunk-5DTTYNB7.js";
|
|
83
|
-
import "./chunk-X6KLM4LZ.js";
|
|
11
|
+
startPostRenderPrefetches
|
|
12
|
+
} from "./chunk-DBE4QFZS.js";
|
|
84
13
|
import {
|
|
85
14
|
AboutBox,
|
|
86
15
|
BaseSelectionList,
|
|
@@ -156,21 +85,100 @@ import {
|
|
|
156
85
|
useTextBuffer,
|
|
157
86
|
useUIActions,
|
|
158
87
|
useUIState
|
|
159
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-TMQ6XQCX.js";
|
|
89
|
+
import {
|
|
90
|
+
GeminiRespondingSpinner,
|
|
91
|
+
GeminiSpinner,
|
|
92
|
+
SCREEN_READER_USER_PREFIX,
|
|
93
|
+
SHELL_COMMAND_NAME,
|
|
94
|
+
StreamingContext,
|
|
95
|
+
applyCollapsePolicyAndSummary,
|
|
96
|
+
buildResumedHistoryItems,
|
|
97
|
+
build_default,
|
|
98
|
+
expandCollapsedHistory,
|
|
99
|
+
isCollapsibleTool,
|
|
100
|
+
useStreamingContext
|
|
101
|
+
} from "./chunk-PF4CHQOJ.js";
|
|
102
|
+
import {
|
|
103
|
+
stopAndGetCapturedInput
|
|
104
|
+
} from "./chunk-5SCI6E3E.js";
|
|
105
|
+
import {
|
|
106
|
+
useAutoAcceptIndicator
|
|
107
|
+
} from "./chunk-FQD7GFSV.js";
|
|
160
108
|
import {
|
|
161
109
|
KeypressProvider,
|
|
162
110
|
useFocus,
|
|
163
111
|
useKeypress,
|
|
164
112
|
useKeypressContext
|
|
165
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-O3Z73NBP.js";
|
|
114
|
+
import {
|
|
115
|
+
classifyApiError
|
|
116
|
+
} from "./chunk-V7RNNPGC.js";
|
|
117
|
+
import {
|
|
118
|
+
MAX_SUGGESTIONS_TO_SHOW,
|
|
119
|
+
buildMcpResourceRef,
|
|
120
|
+
buildMcpServerRef,
|
|
121
|
+
getExtensionSuggestions,
|
|
122
|
+
handleAtCommand,
|
|
123
|
+
matchMcpServerPrefix,
|
|
124
|
+
resolveAtCommandQuery,
|
|
125
|
+
sanitizeDisplayText
|
|
126
|
+
} from "./chunk-IVPSS6EL.js";
|
|
127
|
+
import {
|
|
128
|
+
BuiltinCommandLoader,
|
|
129
|
+
BundledSkillLoader,
|
|
130
|
+
CommandService,
|
|
131
|
+
DISPLAY_HOOK_EVENTS,
|
|
132
|
+
FileCommandLoader,
|
|
133
|
+
MAX_STACKED_SKILLS,
|
|
134
|
+
McpPromptLoader,
|
|
135
|
+
SavedWorkflowLoader,
|
|
136
|
+
SkillCommandLoader,
|
|
137
|
+
addConfigToMatcherGroup,
|
|
138
|
+
appendUserPromptExpansionAdditionalContext,
|
|
139
|
+
copyToClipboard,
|
|
140
|
+
createEmptyHookEventInfo,
|
|
141
|
+
findMidInputSlashCommand,
|
|
142
|
+
findSlashCommandTokens,
|
|
143
|
+
formatApprovalModeDescription,
|
|
144
|
+
formatApprovalModeName,
|
|
145
|
+
formatUserPromptExpansionBlockedMessage,
|
|
146
|
+
getAllConfigs,
|
|
147
|
+
getBestSlashCommandMatch,
|
|
148
|
+
getTranslatedSourceDisplayMap,
|
|
149
|
+
hasBlockingBackgroundWork,
|
|
150
|
+
hasSlashCommandPathSeparator,
|
|
151
|
+
isAtCommand,
|
|
152
|
+
isBtwCommand,
|
|
153
|
+
isMidInputCompletableCommand,
|
|
154
|
+
isSlashCommand,
|
|
155
|
+
normalizePartList,
|
|
156
|
+
parseSlashCommand,
|
|
157
|
+
parseStackedSlashCommands,
|
|
158
|
+
refreshExtensionContentRuntime,
|
|
159
|
+
resetBackgroundStateForSessionSwitch,
|
|
160
|
+
serializeUserPromptExpansionPrompt,
|
|
161
|
+
supportsMatchers
|
|
162
|
+
} from "./chunk-PBWEWI4N.js";
|
|
163
|
+
import {
|
|
164
|
+
EXTENSION_RELOAD_FAILED_REASON,
|
|
165
|
+
ExtensionRefreshState,
|
|
166
|
+
appEvents,
|
|
167
|
+
loadHierarchicalGeminiMemory
|
|
168
|
+
} from "./chunk-4XNLIGVA.js";
|
|
166
169
|
import {
|
|
167
170
|
getCommandDisplayName,
|
|
168
171
|
getCommandSourceBadge
|
|
169
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-HZPN55E5.js";
|
|
170
173
|
import {
|
|
171
174
|
computeSessionStats,
|
|
172
175
|
levelLabel
|
|
173
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-2LL7TXB4.js";
|
|
177
|
+
import {
|
|
178
|
+
disableKittyProtocol,
|
|
179
|
+
isKittyProtocolEnabled,
|
|
180
|
+
isKittyProtocolSupported
|
|
181
|
+
} from "./chunk-5DTTYNB7.js";
|
|
174
182
|
import {
|
|
175
183
|
BEL,
|
|
176
184
|
OSC_PREFIX,
|
|
@@ -184,32 +192,27 @@ import {
|
|
|
184
192
|
saveClipboardImage,
|
|
185
193
|
wrapForMultiplexer,
|
|
186
194
|
writeOsc52
|
|
187
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-QKYTTBYW.js";
|
|
196
|
+
import "./chunk-A5LYNIW7.js";
|
|
188
197
|
import "./chunk-4WGODMVR.js";
|
|
198
|
+
import "./chunk-ANPINBOF.js";
|
|
199
|
+
import "./chunk-KW7NOTN6.js";
|
|
189
200
|
import {
|
|
190
201
|
MaxSizedBox,
|
|
191
202
|
OverflowProvider,
|
|
192
203
|
useOverflowState
|
|
193
|
-
} from "./chunk-
|
|
194
|
-
import {
|
|
195
|
-
GeminiRespondingSpinner,
|
|
196
|
-
GeminiSpinner,
|
|
197
|
-
SCREEN_READER_USER_PREFIX,
|
|
198
|
-
SHELL_COMMAND_NAME,
|
|
199
|
-
StreamingContext,
|
|
200
|
-
applyCollapsePolicyAndSummary,
|
|
201
|
-
buildResumedHistoryItems,
|
|
202
|
-
build_default,
|
|
203
|
-
expandCollapsedHistory,
|
|
204
|
-
isCollapsibleTool,
|
|
205
|
-
useStreamingContext
|
|
206
|
-
} from "./chunk-DORJSBMF.js";
|
|
204
|
+
} from "./chunk-JNWZQ27S.js";
|
|
207
205
|
import {
|
|
208
206
|
theme
|
|
209
|
-
} from "./chunk-
|
|
207
|
+
} from "./chunk-GMGDLUC7.js";
|
|
210
208
|
import {
|
|
211
209
|
require_jsx_runtime
|
|
212
210
|
} from "./chunk-SV5PQVQE.js";
|
|
211
|
+
import {
|
|
212
|
+
AUTO_THEME_NAME,
|
|
213
|
+
DEFAULT_THEME,
|
|
214
|
+
themeManager
|
|
215
|
+
} from "./chunk-AYCDXHZB.js";
|
|
213
216
|
import {
|
|
214
217
|
Box_default,
|
|
215
218
|
Static,
|
|
@@ -223,43 +226,33 @@ import {
|
|
|
223
226
|
use_is_screen_reader_enabled_default,
|
|
224
227
|
use_stdin_default,
|
|
225
228
|
use_stdout_default
|
|
226
|
-
} from "./chunk-
|
|
229
|
+
} from "./chunk-NEEB7UEN.js";
|
|
227
230
|
import {
|
|
228
231
|
require_react
|
|
229
232
|
} from "./chunk-5QWWOFGG.js";
|
|
230
|
-
import "./chunk-
|
|
233
|
+
import "./chunk-KDC6GNQR.js";
|
|
234
|
+
import "./chunk-542SK7KV.js";
|
|
231
235
|
import "./chunk-NHDKSOEY.js";
|
|
232
236
|
import {
|
|
233
237
|
relaunchApp
|
|
234
|
-
} from "./chunk-
|
|
238
|
+
} from "./chunk-AJSJ5TTU.js";
|
|
235
239
|
import {
|
|
236
240
|
setUpdateHandler
|
|
237
|
-
} from "./chunk-
|
|
238
|
-
import "./chunk-
|
|
241
|
+
} from "./chunk-OEO2ERWK.js";
|
|
242
|
+
import "./chunk-KG3XV6FH.js";
|
|
243
|
+
import "./chunk-S2W2LVDU.js";
|
|
239
244
|
import "./chunk-YAF2MQZ6.js";
|
|
240
|
-
import "./chunk-EJFHUF3D.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-BRHHXGWL.js";
|
|
248
|
-
import "./chunk-6H67XLET.js";
|
|
249
|
-
import "./chunk-RUNR5DAE.js";
|
|
250
|
-
import {
|
|
251
|
-
getErrorMessage as getErrorMessage2
|
|
252
|
-
} from "./chunk-45DNGJKC.js";
|
|
253
245
|
import {
|
|
254
246
|
openQwenAsrRealtimeStream,
|
|
255
247
|
openVoiceStream,
|
|
256
248
|
openVoiceStreamWithRetry
|
|
257
|
-
} from "./chunk-
|
|
249
|
+
} from "./chunk-GKY2OJ7R.js";
|
|
258
250
|
import {
|
|
259
251
|
recordGoalStatusItem,
|
|
260
252
|
restoreGoalFromHistory
|
|
261
|
-
} from "./chunk-
|
|
262
|
-
import "./chunk-
|
|
253
|
+
} from "./chunk-PGEPSDJI.js";
|
|
254
|
+
import "./chunk-KTUQMDEP.js";
|
|
255
|
+
import "./chunk-D22SX43D.js";
|
|
263
256
|
import {
|
|
264
257
|
cpLen,
|
|
265
258
|
cpSlice,
|
|
@@ -272,7 +265,6 @@ import {
|
|
|
272
265
|
stripUnsafeCharacters,
|
|
273
266
|
toCodePoints
|
|
274
267
|
} from "./chunk-RS7MT2QG.js";
|
|
275
|
-
import "./chunk-QF4DPYPH.js";
|
|
276
268
|
import {
|
|
277
269
|
stringWidth
|
|
278
270
|
} from "./chunk-H2XVO6NE.js";
|
|
@@ -282,9 +274,14 @@ import {
|
|
|
282
274
|
} from "./chunk-QTERJVPZ.js";
|
|
283
275
|
import "./chunk-L573Z2QZ.js";
|
|
284
276
|
import "./chunk-RXFQM6FQ.js";
|
|
277
|
+
import "./chunk-KOR3XKCA.js";
|
|
278
|
+
import "./chunk-6H67XLET.js";
|
|
279
|
+
import {
|
|
280
|
+
getErrorMessage as getErrorMessage2
|
|
281
|
+
} from "./chunk-VEXFOTEO.js";
|
|
285
282
|
import {
|
|
286
283
|
getExtendedSystemInfo
|
|
287
|
-
} from "./chunk-
|
|
284
|
+
} from "./chunk-NDMQLV4Y.js";
|
|
288
285
|
import {
|
|
289
286
|
formatDuration,
|
|
290
287
|
formatMemoryUsage,
|
|
@@ -293,43 +290,44 @@ import {
|
|
|
293
290
|
} from "./chunk-E5Z2AVNV.js";
|
|
294
291
|
import {
|
|
295
292
|
isInlineModelOverrideAllowed
|
|
296
|
-
} from "./chunk-
|
|
293
|
+
} from "./chunk-NGFEPAE6.js";
|
|
297
294
|
import {
|
|
298
295
|
assertVoiceBaseUrlNetworkAllowed,
|
|
299
296
|
isKeytermEcho,
|
|
300
297
|
isStreamingVoiceModel,
|
|
301
298
|
resolveVoiceStreamConfig,
|
|
302
299
|
transcribeVoiceAudio
|
|
303
|
-
} from "./chunk-
|
|
300
|
+
} from "./chunk-IR46U7RB.js";
|
|
304
301
|
import {
|
|
305
302
|
formatUnsupportedVoiceModelMessage,
|
|
306
303
|
isSelectableVoiceModel
|
|
307
|
-
} from "./chunk-
|
|
308
|
-
import "./chunk-
|
|
309
|
-
import "./chunk-
|
|
304
|
+
} from "./chunk-S2PD3EZD.js";
|
|
305
|
+
import "./chunk-BVLROR2T.js";
|
|
306
|
+
import "./chunk-6RLROE6G.js";
|
|
307
|
+
import "./chunk-COH43MRJ.js";
|
|
308
|
+
import "./chunk-CB2HFGRV.js";
|
|
310
309
|
import {
|
|
311
310
|
requestConsentInteractive,
|
|
312
311
|
requestConsentOrFail
|
|
313
|
-
} from "./chunk-
|
|
312
|
+
} from "./chunk-MJ6S23WZ.js";
|
|
314
313
|
import "./chunk-57OAHC2Y.js";
|
|
315
|
-
import "./chunk-
|
|
316
|
-
import "./chunk-
|
|
314
|
+
import "./chunk-YWEW33JY.js";
|
|
315
|
+
import "./chunk-4ODB7WIB.js";
|
|
317
316
|
import "./chunk-V6WHFGST.js";
|
|
318
317
|
import {
|
|
319
318
|
createLoadedSettingsAdapter
|
|
320
|
-
} from "./chunk-
|
|
321
|
-
import "./chunk-
|
|
322
|
-
import "./chunk-
|
|
323
|
-
import "./chunk-QKTHJXCS.js";
|
|
319
|
+
} from "./chunk-CZF3E5GF.js";
|
|
320
|
+
import "./chunk-W7FJ3N32.js";
|
|
321
|
+
import "./chunk-Y2ENGUD6.js";
|
|
324
322
|
import "./chunk-TJTKSVIV.js";
|
|
325
323
|
import "./chunk-M5GB774H.js";
|
|
326
|
-
import "./chunk-
|
|
327
|
-
import "./chunk-
|
|
328
|
-
import "./chunk-
|
|
324
|
+
import "./chunk-RFIAR4YL.js";
|
|
325
|
+
import "./chunk-2HOVDT7W.js";
|
|
326
|
+
import "./chunk-NIJEXGV6.js";
|
|
329
327
|
import "./chunk-UDXSXLER.js";
|
|
330
328
|
import {
|
|
331
329
|
loadMcpApprovals
|
|
332
|
-
} from "./chunk-
|
|
330
|
+
} from "./chunk-7SXZC7ID.js";
|
|
333
331
|
import {
|
|
334
332
|
CORRUPTED_SUFFIX,
|
|
335
333
|
SettingScope,
|
|
@@ -352,31 +350,26 @@ import {
|
|
|
352
350
|
settingExistsInScope,
|
|
353
351
|
validateSettingValue,
|
|
354
352
|
writeOutputLanguageAndRegisterPath
|
|
355
|
-
} from "./chunk-
|
|
353
|
+
} from "./chunk-33XUAINQ.js";
|
|
356
354
|
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-
|
|
364
|
-
import "./chunk-XHATNRQA.js";
|
|
365
|
-
import "./chunk-JT7HACMQ.js";
|
|
366
|
-
import "./chunk-GOXKNSDZ.js";
|
|
362
|
+
} from "./chunk-TKLLK6XQ.js";
|
|
363
|
+
import "./chunk-TIH2ZTOC.js";
|
|
367
364
|
import "./chunk-QRUIS3DN.js";
|
|
368
|
-
import "./chunk-2RFKHEXL.js";
|
|
369
|
-
import "./chunk-IDS7MSUP.js";
|
|
370
|
-
import "./chunk-XFSFZCM5.js";
|
|
371
|
-
import "./chunk-URK542T4.js";
|
|
372
365
|
import {
|
|
373
366
|
getCliVersion
|
|
374
|
-
} from "./chunk-
|
|
367
|
+
} from "./chunk-OWCALFEG.js";
|
|
375
368
|
import "./chunk-VJNBRRZG.js";
|
|
376
369
|
import {
|
|
377
370
|
isWorkspaceTrusted,
|
|
378
371
|
loadTrustedFolders
|
|
379
|
-
} from "./chunk-
|
|
372
|
+
} from "./chunk-I2PYAYFM.js";
|
|
380
373
|
import {
|
|
381
374
|
require_strip_json_comments
|
|
382
375
|
} from "./chunk-ALGGS7UH.js";
|
|
@@ -385,6 +378,8 @@ import {
|
|
|
385
378
|
clearScreen,
|
|
386
379
|
writeStderrLine
|
|
387
380
|
} from "./chunk-OWAK7LMW.js";
|
|
381
|
+
import "./chunk-XFSFZCM5.js";
|
|
382
|
+
import "./chunk-URK542T4.js";
|
|
388
383
|
import {
|
|
389
384
|
ALIBABA_PROVIDERS,
|
|
390
385
|
AsyncFzf,
|
|
@@ -435,7 +430,6 @@ import {
|
|
|
435
430
|
detectAutonomousSentinel,
|
|
436
431
|
fetchGitDiff,
|
|
437
432
|
fetchGitDiffHunks,
|
|
438
|
-
finalizeToolResponses,
|
|
439
433
|
findExistingProviderModels,
|
|
440
434
|
findProviderByCredentials,
|
|
441
435
|
findProviderById,
|
|
@@ -450,6 +444,7 @@ import {
|
|
|
450
444
|
getExtensionDisplayName,
|
|
451
445
|
getGitBranch,
|
|
452
446
|
getProjectSummaryInfo,
|
|
447
|
+
getStartupContextLength,
|
|
453
448
|
getTimeRangeBounds,
|
|
454
449
|
getToolResponseDisplayText,
|
|
455
450
|
getWelcomeBackState,
|
|
@@ -462,6 +457,7 @@ import {
|
|
|
462
457
|
isSessionRuntimeActive,
|
|
463
458
|
isSettledStatus,
|
|
464
459
|
isSuccessStatus,
|
|
460
|
+
isSystemReminderContent,
|
|
465
461
|
isTerminalStatus,
|
|
466
462
|
loadUsageHistory,
|
|
467
463
|
markDuplicateProviderToolCallResponseSent,
|
|
@@ -480,6 +476,7 @@ import {
|
|
|
480
476
|
resolveBaseUrl,
|
|
481
477
|
resolveBranchName,
|
|
482
478
|
resolveMetadataKey,
|
|
479
|
+
resolveModelId,
|
|
483
480
|
restoreWorktreeContext,
|
|
484
481
|
saveWelcomeBackRestartChoice,
|
|
485
482
|
saveWorkflowScript,
|
|
@@ -491,57 +488,38 @@ import {
|
|
|
491
488
|
validateWorkflowName,
|
|
492
489
|
watchRepoBranch,
|
|
493
490
|
writeRuntimeStatus
|
|
494
|
-
} from "./chunk-
|
|
491
|
+
} from "./chunk-KX6UK4VJ.js";
|
|
492
|
+
import "./chunk-5M6IDOMF.js";
|
|
495
493
|
import "./chunk-T4TZQJ7W.js";
|
|
496
494
|
import "./chunk-H6XPXXMH.js";
|
|
497
|
-
import "./chunk-
|
|
498
|
-
import "./chunk-
|
|
499
|
-
import "./chunk-
|
|
500
|
-
import "./chunk-
|
|
495
|
+
import "./chunk-EAUYY7SS.js";
|
|
496
|
+
import "./chunk-FSL5W5TI.js";
|
|
497
|
+
import "./chunk-OONJNQ42.js";
|
|
498
|
+
import "./chunk-D2VIDMVM.js";
|
|
501
499
|
import "./chunk-E2UVIFI2.js";
|
|
502
|
-
import "./chunk-Q2YKNMLS.js";
|
|
503
500
|
import "./chunk-XU457J4V.js";
|
|
504
501
|
import "./chunk-VDDGDZMA.js";
|
|
505
|
-
import "./chunk-
|
|
502
|
+
import "./chunk-EIAK6Q2B.js";
|
|
506
503
|
import "./chunk-SZRN75WQ.js";
|
|
507
|
-
import "./chunk-
|
|
508
|
-
import {
|
|
509
|
-
resolveModelId
|
|
510
|
-
} from "./chunk-TJQXJJX7.js";
|
|
504
|
+
import "./chunk-HTO4JFDZ.js";
|
|
511
505
|
import "./chunk-CPBF7KYF.js";
|
|
512
|
-
import "./chunk-NABLFI57.js";
|
|
513
|
-
import {
|
|
514
|
-
HOOKS_CONFIG_FIELDS
|
|
515
|
-
} from "./chunk-QBUDF33N.js";
|
|
516
|
-
import "./chunk-LIZRAKPB.js";
|
|
517
506
|
import {
|
|
518
|
-
APPROVAL_MODES
|
|
519
|
-
|
|
520
|
-
isSystemReminderContent,
|
|
521
|
-
runOutsideAgentContext
|
|
522
|
-
} from "./chunk-WHGVTP7Q.js";
|
|
507
|
+
APPROVAL_MODES
|
|
508
|
+
} from "./chunk-CPCVCKKF.js";
|
|
523
509
|
import "./chunk-6AM5D4ME.js";
|
|
524
|
-
import "./chunk-
|
|
525
|
-
import {
|
|
526
|
-
isPathWithinRoot
|
|
527
|
-
} from "./chunk-57FIIFJN.js";
|
|
528
|
-
import "./chunk-HTO4JFDZ.js";
|
|
510
|
+
import "./chunk-G45X5TRN.js";
|
|
529
511
|
import {
|
|
530
|
-
|
|
531
|
-
} from "./chunk-
|
|
512
|
+
HOOKS_CONFIG_FIELDS
|
|
513
|
+
} from "./chunk-PBATSWUQ.js";
|
|
532
514
|
import {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
import "./chunk-GLNBDYUX.js";
|
|
515
|
+
isPathWithinRoot
|
|
516
|
+
} from "./chunk-ZEOZL37W.js";
|
|
517
|
+
import "./chunk-OOCI5VVU.js";
|
|
537
518
|
import {
|
|
538
519
|
qwenOAuth2Events
|
|
539
|
-
} from "./chunk-
|
|
520
|
+
} from "./chunk-BRRF37CO.js";
|
|
521
|
+
import "./chunk-BMWMT5Y2.js";
|
|
540
522
|
import "./chunk-JESCGQM3.js";
|
|
541
|
-
import "./chunk-OZYV6F53.js";
|
|
542
|
-
import "./chunk-BEKZWVJJ.js";
|
|
543
|
-
import "./chunk-DJ2GSRLV.js";
|
|
544
|
-
import "./chunk-5I5BM454.js";
|
|
545
523
|
import {
|
|
546
524
|
ApiCancelEvent,
|
|
547
525
|
AuthEvent,
|
|
@@ -583,7 +561,9 @@ import {
|
|
|
583
561
|
runVisionBridge,
|
|
584
562
|
shouldRunVisionBridge,
|
|
585
563
|
splitImageParts
|
|
586
|
-
} from "./chunk-
|
|
564
|
+
} from "./chunk-ZFKNWQGQ.js";
|
|
565
|
+
import "./chunk-4WKAA4KS.js";
|
|
566
|
+
import "./chunk-CR3C7WXL.js";
|
|
587
567
|
import "./chunk-VGC4I5JJ.js";
|
|
588
568
|
import {
|
|
589
569
|
AUTO_MEMORY_INDEX_FILENAME,
|
|
@@ -591,30 +571,35 @@ import {
|
|
|
591
571
|
getAutoMemoryRoot,
|
|
592
572
|
getUserAutoMemoryRoot,
|
|
593
573
|
isAnyAutoMemPath
|
|
594
|
-
} from "./chunk-
|
|
574
|
+
} from "./chunk-JD3MKVKL.js";
|
|
575
|
+
import "./chunk-UEY4AYUL.js";
|
|
576
|
+
import {
|
|
577
|
+
atomicWriteFileSync
|
|
578
|
+
} from "./chunk-BDBMYST4.js";
|
|
579
|
+
import "./chunk-EZVDJFZ7.js";
|
|
580
|
+
import {
|
|
581
|
+
ToolNames,
|
|
582
|
+
isShellProgressData
|
|
583
|
+
} from "./chunk-OP4MOGXF.js";
|
|
584
|
+
import {
|
|
585
|
+
REASONING_EFFORT_TIERS
|
|
586
|
+
} from "./chunk-XVNQMZ2I.js";
|
|
587
|
+
import {
|
|
588
|
+
getUnsupportedImageFormatWarning,
|
|
589
|
+
isSupportedImageMimeType
|
|
590
|
+
} from "./chunk-FEOZBUMT.js";
|
|
591
|
+
import "./chunk-DJ2GSRLV.js";
|
|
592
|
+
import "./chunk-6EFTQYW7.js";
|
|
595
593
|
import {
|
|
596
594
|
DEFAULT_TOKEN_LIMIT
|
|
597
|
-
} from "./chunk-
|
|
595
|
+
} from "./chunk-MAQQGNQ5.js";
|
|
598
596
|
import "./chunk-A4UCTEB5.js";
|
|
599
597
|
import "./chunk-XWRJCPHC.js";
|
|
600
|
-
import "./chunk-QNLNLENL.js";
|
|
601
|
-
import {
|
|
602
|
-
atomicWriteFileSync
|
|
603
|
-
} from "./chunk-6X4GWOPW.js";
|
|
604
598
|
import {
|
|
605
599
|
FinishReason
|
|
606
600
|
} from "./chunk-TYQMGACW.js";
|
|
607
601
|
import "./chunk-TYAMGABM.js";
|
|
608
602
|
import "./chunk-FCMNKVXT.js";
|
|
609
|
-
import "./chunk-7362QS5B.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";
|
|
618
603
|
import {
|
|
619
604
|
Storage,
|
|
620
605
|
UnauthorizedError,
|
|
@@ -626,8 +611,8 @@ import {
|
|
|
626
611
|
isNodeError,
|
|
627
612
|
shortenPath,
|
|
628
613
|
tildeifyPath
|
|
629
|
-
} from "./chunk-
|
|
630
|
-
import "./chunk-
|
|
614
|
+
} from "./chunk-C27BYUX6.js";
|
|
615
|
+
import "./chunk-VZQUV7VK.js";
|
|
631
616
|
import {
|
|
632
617
|
finalizeStartupProfile,
|
|
633
618
|
profileCheckpoint
|
|
@@ -636,11 +621,11 @@ import "./chunk-Q7YDKOGY.js";
|
|
|
636
621
|
import {
|
|
637
622
|
registerCleanup,
|
|
638
623
|
runExitCleanup
|
|
639
|
-
} from "./chunk-
|
|
624
|
+
} from "./chunk-DP5GXXNZ.js";
|
|
640
625
|
import "./chunk-75DOP5OR.js";
|
|
641
626
|
import "./chunk-DMTGGOSA.js";
|
|
642
627
|
import "./chunk-YQ3U5MUC.js";
|
|
643
|
-
import "./chunk-
|
|
628
|
+
import "./chunk-TB6UDU4T.js";
|
|
644
629
|
import {
|
|
645
630
|
init_esbuild_shims
|
|
646
631
|
} from "./chunk-5O2XNYP6.js";
|
|
@@ -652,7 +637,7 @@ import {
|
|
|
652
637
|
// packages/cli/src/ui/startInteractiveUI.tsx
|
|
653
638
|
init_esbuild_shims();
|
|
654
639
|
import { basename as basename4 } from "node:path";
|
|
655
|
-
var
|
|
640
|
+
var import_react166 = __toESM(require_react(), 1);
|
|
656
641
|
|
|
657
642
|
// packages/cli/src/dualOutput/DualOutputBridge.ts
|
|
658
643
|
init_esbuild_shims();
|
|
@@ -845,7 +830,7 @@ var DualOutputBridge = class {
|
|
|
845
830
|
* Emits a `can_use_tool` permission request so an external consumer can
|
|
846
831
|
* approve or deny the tool call. Pairs with {@link emitControlResponse}.
|
|
847
832
|
*/
|
|
848
|
-
emitPermissionRequest(requestId, toolName, toolUseId, input, blockedPath = null
|
|
833
|
+
emitPermissionRequest(requestId, toolName, toolUseId, input, blockedPath = null) {
|
|
849
834
|
if (!this.active) return;
|
|
850
835
|
this.disableIfBufferOverflowed();
|
|
851
836
|
if (!this.active) return;
|
|
@@ -855,8 +840,7 @@ var DualOutputBridge = class {
|
|
|
855
840
|
toolName,
|
|
856
841
|
toolUseId,
|
|
857
842
|
input,
|
|
858
|
-
blockedPath
|
|
859
|
-
permissionSuggestions
|
|
843
|
+
blockedPath
|
|
860
844
|
);
|
|
861
845
|
} catch (err) {
|
|
862
846
|
debugLogger.error("DualOutput emitPermissionRequest error:", err);
|
|
@@ -1268,7 +1252,7 @@ var useRemoteInput = /* @__PURE__ */ __name(() => (0, import_react2.useContext)(
|
|
|
1268
1252
|
|
|
1269
1253
|
// packages/cli/src/ui/AppContainer.tsx
|
|
1270
1254
|
init_esbuild_shims();
|
|
1271
|
-
var
|
|
1255
|
+
var import_react164 = __toESM(require_react(), 1);
|
|
1272
1256
|
|
|
1273
1257
|
// packages/cli/src/ui/App.tsx
|
|
1274
1258
|
init_esbuild_shims();
|
|
@@ -1398,15 +1382,30 @@ var useAppContext = /* @__PURE__ */ __name(() => {
|
|
|
1398
1382
|
return context;
|
|
1399
1383
|
}, "useAppContext");
|
|
1400
1384
|
|
|
1401
|
-
// packages/cli/src/ui/components/
|
|
1385
|
+
// packages/cli/src/ui/components/UpdateNotification.tsx
|
|
1386
|
+
init_esbuild_shims();
|
|
1402
1387
|
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
1388
|
+
var UpdateNotification = /* @__PURE__ */ __name(({ message }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1389
|
+
Box_default,
|
|
1390
|
+
{
|
|
1391
|
+
borderStyle: "round",
|
|
1392
|
+
borderColor: theme.status.warning,
|
|
1393
|
+
paddingX: 1,
|
|
1394
|
+
marginY: 1,
|
|
1395
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: theme.status.warning, children: message })
|
|
1396
|
+
}
|
|
1397
|
+
), "UpdateNotification");
|
|
1398
|
+
|
|
1399
|
+
// packages/cli/src/ui/components/Notifications.tsx
|
|
1400
|
+
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
|
1403
1401
|
var Notifications = /* @__PURE__ */ __name(() => {
|
|
1404
1402
|
const { startupWarnings } = useAppContext();
|
|
1405
|
-
const { initError, streamingState } = useUIState();
|
|
1403
|
+
const { initError, streamingState, updateInfo } = useUIState();
|
|
1406
1404
|
const showStartupWarnings = startupWarnings.length > 0;
|
|
1407
1405
|
const showInitError = initError && streamingState !== "responding" /* Responding */;
|
|
1408
|
-
return /* @__PURE__ */ (0,
|
|
1409
|
-
|
|
1406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1407
|
+
updateInfo && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(UpdateNotification, { message: updateInfo.message }),
|
|
1408
|
+
showStartupWarnings && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1410
1409
|
Box_default,
|
|
1411
1410
|
{
|
|
1412
1411
|
borderStyle: "round",
|
|
@@ -1414,10 +1413,10 @@ var Notifications = /* @__PURE__ */ __name(() => {
|
|
|
1414
1413
|
paddingX: 1,
|
|
1415
1414
|
marginY: 1,
|
|
1416
1415
|
flexDirection: "column",
|
|
1417
|
-
children: startupWarnings.map((warning, index) => /* @__PURE__ */ (0,
|
|
1416
|
+
children: startupWarnings.map((warning, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: theme.status.warning, children: warning }, index))
|
|
1418
1417
|
}
|
|
1419
1418
|
),
|
|
1420
|
-
showInitError && /* @__PURE__ */ (0,
|
|
1419
|
+
showInitError && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
1421
1420
|
Box_default,
|
|
1422
1421
|
{
|
|
1423
1422
|
borderStyle: "round",
|
|
@@ -1425,11 +1424,11 @@ var Notifications = /* @__PURE__ */ __name(() => {
|
|
|
1425
1424
|
paddingX: 1,
|
|
1426
1425
|
marginBottom: 1,
|
|
1427
1426
|
children: [
|
|
1428
|
-
/* @__PURE__ */ (0,
|
|
1427
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: theme.status.error, children: [
|
|
1429
1428
|
"Initialization Error: ",
|
|
1430
1429
|
initError
|
|
1431
1430
|
] }),
|
|
1432
|
-
/* @__PURE__ */ (0,
|
|
1431
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: theme.status.error, children: [
|
|
1433
1432
|
" ",
|
|
1434
1433
|
"Please check API key and configuration."
|
|
1435
1434
|
] })
|
|
@@ -1439,20 +1438,6 @@ var Notifications = /* @__PURE__ */ __name(() => {
|
|
|
1439
1438
|
] });
|
|
1440
1439
|
}, "Notifications");
|
|
1441
1440
|
|
|
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
|
-
|
|
1456
1441
|
// packages/cli/src/ui/components/MainContent.tsx
|
|
1457
1442
|
init_esbuild_shims();
|
|
1458
1443
|
var import_react14 = __toESM(require_react(), 1);
|
|
@@ -30891,13 +30876,7 @@ var Footer = /* @__PURE__ */ __name(() => {
|
|
|
30891
30876
|
t("IDE connecting... context may be unavailable")
|
|
30892
30877
|
] }) : uiState.startupIdeConnectionStatus.state === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text, { color: theme.status.warning, children: t("IDE connection unavailable: {{message}}", {
|
|
30893
30878
|
message: uiState.startupIdeConnectionStatus.message
|
|
30894
|
-
}) }) : uiState.streamingState === "responding" /* Responding */ ? /* @__PURE__ */ (0, import_jsx_runtime116.
|
|
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") });
|
|
30879
|
+
}) }) : uiState.streamingState === "responding" /* Responding */ ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text, { color: theme.text.secondary, children: t("Enter to steer \xB7 Ctrl+Q to queue") }) : 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") });
|
|
30901
30880
|
const rightItems = [];
|
|
30902
30881
|
if (sandboxInfo) {
|
|
30903
30882
|
rightItems.push({
|
|
@@ -31477,7 +31456,6 @@ var ScreenReaderAppLayout = /* @__PURE__ */ __name(() => {
|
|
|
31477
31456
|
const dialogHeight = uiState.constrainHeight ? dialogMaxHeight : void 0;
|
|
31478
31457
|
const shouldShowStickyTodos = uiState.stickyTodos !== null && !uiState.dialogsVisible && !uiState.isFeedbackDialogOpen && uiState.streamingState === "responding" /* Responding */;
|
|
31479
31458
|
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 }),
|
|
31481
31459
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Notifications, {}),
|
|
31482
31460
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Footer, {}),
|
|
31483
31461
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Box_default, { flexGrow: 1, overflow: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(MainContent, {}) }),
|
|
@@ -32559,14 +32537,12 @@ var DefaultAppLayout = /* @__PURE__ */ __name(() => {
|
|
|
32559
32537
|
isAgentTab ? /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
|
|
32560
32538
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(AgentChatView, { agentId: activeView }),
|
|
32561
32539
|
/* @__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 }),
|
|
32563
32540
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(AgentComposer, { agentId: activeView }, activeView),
|
|
32564
32541
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(ExitWarning, {})
|
|
32565
32542
|
] })
|
|
32566
32543
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
|
|
32567
32544
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(MainContent, {}),
|
|
32568
32545
|
/* @__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 }),
|
|
32570
32546
|
uiState.dialogsVisible ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
32571
32547
|
Box_default,
|
|
32572
32548
|
{
|
|
@@ -32771,46 +32747,14 @@ function useResizeSettleRepaint(terminalWidth, refreshStatic) {
|
|
|
32771
32747
|
}
|
|
32772
32748
|
__name(useResizeSettleRepaint, "useResizeSettleRepaint");
|
|
32773
32749
|
|
|
32774
|
-
// packages/cli/src/ui/hooks/use-wake-repaint.ts
|
|
32775
|
-
init_esbuild_shims();
|
|
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
32750
|
// packages/cli/src/ui/hooks/useThemeCommand.ts
|
|
32807
32751
|
init_esbuild_shims();
|
|
32808
|
-
var
|
|
32752
|
+
var import_react118 = __toESM(require_react(), 1);
|
|
32809
32753
|
import process13 from "node:process";
|
|
32810
32754
|
var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, addItem, initialThemeError) => {
|
|
32811
|
-
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0,
|
|
32812
|
-
const [themeBeforeDialogOpen, setThemeBeforeDialogOpen] = (0,
|
|
32813
|
-
const openThemeDialog = (0,
|
|
32755
|
+
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0, import_react118.useState)(!!initialThemeError);
|
|
32756
|
+
const [themeBeforeDialogOpen, setThemeBeforeDialogOpen] = (0, import_react118.useState)(themeManager.getActiveTheme().name);
|
|
32757
|
+
const openThemeDialog = (0, import_react118.useCallback)(() => {
|
|
32814
32758
|
if (process13.env["NO_COLOR"]) {
|
|
32815
32759
|
addItem(
|
|
32816
32760
|
{
|
|
@@ -32826,7 +32770,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
32826
32770
|
setThemeBeforeDialogOpen(themeManager.getActiveTheme().name);
|
|
32827
32771
|
setIsThemeDialogOpen(true);
|
|
32828
32772
|
}, [addItem]);
|
|
32829
|
-
const applyTheme = (0,
|
|
32773
|
+
const applyTheme = (0, import_react118.useCallback)(
|
|
32830
32774
|
(themeName) => {
|
|
32831
32775
|
if (!themeManager.setActiveTheme(themeName)) {
|
|
32832
32776
|
setIsThemeDialogOpen(true);
|
|
@@ -32841,13 +32785,13 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
32841
32785
|
},
|
|
32842
32786
|
[setThemeError]
|
|
32843
32787
|
);
|
|
32844
|
-
const handleThemeHighlight = (0,
|
|
32788
|
+
const handleThemeHighlight = (0, import_react118.useCallback)(
|
|
32845
32789
|
(themeName) => {
|
|
32846
32790
|
applyTheme(themeName);
|
|
32847
32791
|
},
|
|
32848
32792
|
[applyTheme]
|
|
32849
32793
|
);
|
|
32850
|
-
const handleThemeSelect = (0,
|
|
32794
|
+
const handleThemeSelect = (0, import_react118.useCallback)(
|
|
32851
32795
|
(themeName, scope) => {
|
|
32852
32796
|
if (themeName === void 0) {
|
|
32853
32797
|
applyTheme(themeBeforeDialogOpen);
|
|
@@ -32894,7 +32838,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
32894
32838
|
|
|
32895
32839
|
// packages/cli/src/ui/hooks/useFeedbackDialog.ts
|
|
32896
32840
|
init_esbuild_shims();
|
|
32897
|
-
var
|
|
32841
|
+
var import_react119 = __toESM(require_react(), 1);
|
|
32898
32842
|
import * as fs15 from "node:fs";
|
|
32899
32843
|
var import_strip_json_comments = __toESM(require_strip_json_comments(), 1);
|
|
32900
32844
|
var FEEDBACK_SHOW_PROBABILITY = 0.25;
|
|
@@ -32940,20 +32884,20 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
32940
32884
|
history,
|
|
32941
32885
|
sessionStats
|
|
32942
32886
|
}) => {
|
|
32943
|
-
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = (0,
|
|
32944
|
-
const [isFeedbackDismissedTemporarily, setIsFeedbackDismissedTemporarily] = (0,
|
|
32945
|
-
const openFeedbackDialog = (0,
|
|
32887
|
+
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = (0, import_react119.useState)(false);
|
|
32888
|
+
const [isFeedbackDismissedTemporarily, setIsFeedbackDismissedTemporarily] = (0, import_react119.useState)(false);
|
|
32889
|
+
const openFeedbackDialog = (0, import_react119.useCallback)(() => {
|
|
32946
32890
|
setIsFeedbackDialogOpen(true);
|
|
32947
32891
|
}, []);
|
|
32948
|
-
const closeFeedbackDialog = (0,
|
|
32892
|
+
const closeFeedbackDialog = (0, import_react119.useCallback)(
|
|
32949
32893
|
() => setIsFeedbackDialogOpen(false),
|
|
32950
32894
|
[]
|
|
32951
32895
|
);
|
|
32952
|
-
const temporaryCloseFeedbackDialog = (0,
|
|
32896
|
+
const temporaryCloseFeedbackDialog = (0, import_react119.useCallback)(() => {
|
|
32953
32897
|
setIsFeedbackDialogOpen(false);
|
|
32954
32898
|
setIsFeedbackDismissedTemporarily(true);
|
|
32955
32899
|
}, []);
|
|
32956
|
-
const submitFeedback = (0,
|
|
32900
|
+
const submitFeedback = (0, import_react119.useCallback)(
|
|
32957
32901
|
(rating) => {
|
|
32958
32902
|
if (rating >= FEEDBACK_OPTIONS.GOOD && rating <= FEEDBACK_OPTIONS.FINE) {
|
|
32959
32903
|
const feedbackEvent = new UserFeedbackEvent(
|
|
@@ -32973,7 +32917,7 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
32973
32917
|
},
|
|
32974
32918
|
[closeFeedbackDialog, sessionStats.sessionId, config, settings]
|
|
32975
32919
|
);
|
|
32976
|
-
(0,
|
|
32920
|
+
(0, import_react119.useEffect)(() => {
|
|
32977
32921
|
const checkAndShowFeedback = /* @__PURE__ */ __name(() => {
|
|
32978
32922
|
if (streamingState === "idle" /* Idle */ && history.length > 0) {
|
|
32979
32923
|
if (!config.getUsageStatisticsEnabled() || settings.merged.ui?.enableUserFeedback === false || !lastMessageIsAIResponse(history) || Math.random() > FEEDBACK_SHOW_PROBABILITY || !meetsMinimumSessionRequirements(sessionStats) || isFeedbackDismissedTemporarily) {
|
|
@@ -32995,7 +32939,7 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
32995
32939
|
settings.merged.ui?.enableUserFeedback,
|
|
32996
32940
|
config
|
|
32997
32941
|
]);
|
|
32998
|
-
(0,
|
|
32942
|
+
(0, import_react119.useEffect)(() => {
|
|
32999
32943
|
if (streamingState === "responding" /* Responding */ && isFeedbackDismissedTemporarily) {
|
|
33000
32944
|
setIsFeedbackDismissedTemporarily(false);
|
|
33001
32945
|
}
|
|
@@ -33011,13 +32955,13 @@ var useFeedbackDialog = /* @__PURE__ */ __name(({
|
|
|
33011
32955
|
|
|
33012
32956
|
// packages/cli/src/ui/hooks/useEditorSettings.ts
|
|
33013
32957
|
init_esbuild_shims();
|
|
33014
|
-
var
|
|
32958
|
+
var import_react120 = __toESM(require_react(), 1);
|
|
33015
32959
|
var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError, addItem) => {
|
|
33016
|
-
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0,
|
|
33017
|
-
const openEditorDialog = (0,
|
|
32960
|
+
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0, import_react120.useState)(false);
|
|
32961
|
+
const openEditorDialog = (0, import_react120.useCallback)(() => {
|
|
33018
32962
|
setIsEditorDialogOpen(true);
|
|
33019
32963
|
}, []);
|
|
33020
|
-
const handleEditorSelect = (0,
|
|
32964
|
+
const handleEditorSelect = (0, import_react120.useCallback)(
|
|
33021
32965
|
(editorType, scope) => {
|
|
33022
32966
|
if (editorType && (!checkHasEditorType(editorType) || !allowEditorTypeInSandbox(editorType))) {
|
|
33023
32967
|
return;
|
|
@@ -33039,7 +32983,7 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
33039
32983
|
},
|
|
33040
32984
|
[loadedSettings, setEditorError, addItem]
|
|
33041
32985
|
);
|
|
33042
|
-
const exitEditorDialog = (0,
|
|
32986
|
+
const exitEditorDialog = (0, import_react120.useCallback)(() => {
|
|
33043
32987
|
setIsEditorDialogOpen(false);
|
|
33044
32988
|
}, []);
|
|
33045
32989
|
return {
|
|
@@ -33052,13 +32996,13 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
33052
32996
|
|
|
33053
32997
|
// packages/cli/src/ui/hooks/useSettingsCommand.ts
|
|
33054
32998
|
init_esbuild_shims();
|
|
33055
|
-
var
|
|
32999
|
+
var import_react121 = __toESM(require_react(), 1);
|
|
33056
33000
|
function useSettingsCommand() {
|
|
33057
|
-
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0,
|
|
33058
|
-
const openSettingsDialog = (0,
|
|
33001
|
+
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0, import_react121.useState)(false);
|
|
33002
|
+
const openSettingsDialog = (0, import_react121.useCallback)(() => {
|
|
33059
33003
|
setIsSettingsDialogOpen(true);
|
|
33060
33004
|
}, []);
|
|
33061
|
-
const closeSettingsDialog = (0,
|
|
33005
|
+
const closeSettingsDialog = (0, import_react121.useCallback)(() => {
|
|
33062
33006
|
setIsSettingsDialogOpen(false);
|
|
33063
33007
|
}, []);
|
|
33064
33008
|
return {
|
|
@@ -33071,14 +33015,14 @@ __name(useSettingsCommand, "useSettingsCommand");
|
|
|
33071
33015
|
|
|
33072
33016
|
// packages/cli/src/ui/hooks/useModelCommand.ts
|
|
33073
33017
|
init_esbuild_shims();
|
|
33074
|
-
var
|
|
33018
|
+
var import_react122 = __toESM(require_react(), 1);
|
|
33075
33019
|
var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
33076
|
-
const [isModelDialogOpen, setIsModelDialogOpen] = (0,
|
|
33077
|
-
const [isFastModelMode, setIsFastModelMode] = (0,
|
|
33078
|
-
const [isVoiceModelMode, setIsVoiceModelMode] = (0,
|
|
33079
|
-
const [isVisionModelMode, setIsVisionModelMode] = (0,
|
|
33080
|
-
const [modelDialogPersistScope, setModelDialogPersistScope] = (0,
|
|
33081
|
-
const openModelDialog = (0,
|
|
33020
|
+
const [isModelDialogOpen, setIsModelDialogOpen] = (0, import_react122.useState)(false);
|
|
33021
|
+
const [isFastModelMode, setIsFastModelMode] = (0, import_react122.useState)(false);
|
|
33022
|
+
const [isVoiceModelMode, setIsVoiceModelMode] = (0, import_react122.useState)(false);
|
|
33023
|
+
const [isVisionModelMode, setIsVisionModelMode] = (0, import_react122.useState)(false);
|
|
33024
|
+
const [modelDialogPersistScope, setModelDialogPersistScope] = (0, import_react122.useState)(void 0);
|
|
33025
|
+
const openModelDialog = (0, import_react122.useCallback)(
|
|
33082
33026
|
(options) => {
|
|
33083
33027
|
const voiceModelMode = options?.voiceModelMode ?? false;
|
|
33084
33028
|
const visionModelMode = options?.visionModelMode ?? false;
|
|
@@ -33092,7 +33036,7 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
33092
33036
|
},
|
|
33093
33037
|
[]
|
|
33094
33038
|
);
|
|
33095
|
-
const closeModelDialog = (0,
|
|
33039
|
+
const closeModelDialog = (0, import_react122.useCallback)(() => {
|
|
33096
33040
|
setIsModelDialogOpen(false);
|
|
33097
33041
|
setIsFastModelMode(false);
|
|
33098
33042
|
setIsVoiceModelMode(false);
|
|
@@ -33112,13 +33056,13 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
33112
33056
|
|
|
33113
33057
|
// packages/cli/src/ui/hooks/useApprovalModeCommand.ts
|
|
33114
33058
|
init_esbuild_shims();
|
|
33115
|
-
var
|
|
33059
|
+
var import_react123 = __toESM(require_react(), 1);
|
|
33116
33060
|
var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) => {
|
|
33117
|
-
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0,
|
|
33118
|
-
const openApprovalModeDialog = (0,
|
|
33061
|
+
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0, import_react123.useState)(false);
|
|
33062
|
+
const openApprovalModeDialog = (0, import_react123.useCallback)(() => {
|
|
33119
33063
|
setIsApprovalModeDialogOpen(true);
|
|
33120
33064
|
}, []);
|
|
33121
|
-
const handleApprovalModeSelect = (0,
|
|
33065
|
+
const handleApprovalModeSelect = (0, import_react123.useCallback)(
|
|
33122
33066
|
(mode, scope) => {
|
|
33123
33067
|
try {
|
|
33124
33068
|
if (!mode) {
|
|
@@ -33144,13 +33088,13 @@ var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) =>
|
|
|
33144
33088
|
|
|
33145
33089
|
// packages/cli/src/ui/hooks/use-effort-command.ts
|
|
33146
33090
|
init_esbuild_shims();
|
|
33147
|
-
var
|
|
33091
|
+
var import_react124 = __toESM(require_react(), 1);
|
|
33148
33092
|
var useEffortCommand = /* @__PURE__ */ __name((loadedSettings, config, addItem) => {
|
|
33149
|
-
const [isEffortDialogOpen, setIsEffortDialogOpen] = (0,
|
|
33150
|
-
const openEffortDialog = (0,
|
|
33093
|
+
const [isEffortDialogOpen, setIsEffortDialogOpen] = (0, import_react124.useState)(false);
|
|
33094
|
+
const openEffortDialog = (0, import_react124.useCallback)(() => {
|
|
33151
33095
|
setIsEffortDialogOpen(true);
|
|
33152
33096
|
}, []);
|
|
33153
|
-
const handleEffortSelect = (0,
|
|
33097
|
+
const handleEffortSelect = (0, import_react124.useCallback)(
|
|
33154
33098
|
(effort) => {
|
|
33155
33099
|
try {
|
|
33156
33100
|
if (!effort) {
|
|
@@ -33202,7 +33146,7 @@ var useEffortCommand = /* @__PURE__ */ __name((loadedSettings, config, addItem)
|
|
|
33202
33146
|
|
|
33203
33147
|
// packages/cli/src/ui/hooks/useBranchCommand.ts
|
|
33204
33148
|
init_esbuild_shims();
|
|
33205
|
-
var
|
|
33149
|
+
var import_react125 = __toESM(require_react(), 1);
|
|
33206
33150
|
import { randomUUID } from "node:crypto";
|
|
33207
33151
|
function deriveFirstPrompt(messages) {
|
|
33208
33152
|
for (const record of messages) {
|
|
@@ -33222,7 +33166,7 @@ function deriveFirstPrompt(messages) {
|
|
|
33222
33166
|
__name(deriveFirstPrompt, "deriveFirstPrompt");
|
|
33223
33167
|
function useBranchCommand(options) {
|
|
33224
33168
|
const { config, historyManager, startNewSession, setSessionName, remount } = options;
|
|
33225
|
-
const handleBranch = (0,
|
|
33169
|
+
const handleBranch = (0, import_react125.useCallback)(
|
|
33226
33170
|
async (name) => {
|
|
33227
33171
|
if (!config) return;
|
|
33228
33172
|
const oldSessionId = config.getSessionId();
|
|
@@ -33353,19 +33297,19 @@ __name(useBranchCommand, "useBranchCommand");
|
|
|
33353
33297
|
|
|
33354
33298
|
// packages/cli/src/ui/hooks/useResumeCommand.ts
|
|
33355
33299
|
init_esbuild_shims();
|
|
33356
|
-
var
|
|
33300
|
+
var import_react126 = __toESM(require_react(), 1);
|
|
33357
33301
|
var BACKGROUND_WORK_SWITCH_BLOCKED_MESSAGE = "Stop the current session's running background tasks before resuming another session.";
|
|
33358
33302
|
function useResumeCommand(options) {
|
|
33359
|
-
const [isResumeDialogOpen, setIsResumeDialogOpen] = (0,
|
|
33360
|
-
const [resumeMatchedSessions, setResumeMatchedSessions] = (0,
|
|
33361
|
-
const openResumeDialog = (0,
|
|
33303
|
+
const [isResumeDialogOpen, setIsResumeDialogOpen] = (0, import_react126.useState)(false);
|
|
33304
|
+
const [resumeMatchedSessions, setResumeMatchedSessions] = (0, import_react126.useState)();
|
|
33305
|
+
const openResumeDialog = (0, import_react126.useCallback)(
|
|
33362
33306
|
(matchedSessions) => {
|
|
33363
33307
|
setResumeMatchedSessions(matchedSessions);
|
|
33364
33308
|
setIsResumeDialogOpen(true);
|
|
33365
33309
|
},
|
|
33366
33310
|
[]
|
|
33367
33311
|
);
|
|
33368
|
-
const closeResumeDialog = (0,
|
|
33312
|
+
const closeResumeDialog = (0, import_react126.useCallback)(() => {
|
|
33369
33313
|
setIsResumeDialogOpen(false);
|
|
33370
33314
|
setResumeMatchedSessions(void 0);
|
|
33371
33315
|
}, []);
|
|
@@ -33378,7 +33322,7 @@ function useResumeCommand(options) {
|
|
|
33378
33322
|
remount
|
|
33379
33323
|
} = options;
|
|
33380
33324
|
const { addItem, clearItems, loadHistory } = historyManager;
|
|
33381
|
-
const handleResume = (0,
|
|
33325
|
+
const handleResume = (0, import_react126.useCallback)(
|
|
33382
33326
|
async (sessionId) => {
|
|
33383
33327
|
if (!config) {
|
|
33384
33328
|
return;
|
|
@@ -33494,18 +33438,18 @@ __name(useResumeCommand, "useResumeCommand");
|
|
|
33494
33438
|
|
|
33495
33439
|
// packages/cli/src/ui/hooks/useDeleteCommand.ts
|
|
33496
33440
|
init_esbuild_shims();
|
|
33497
|
-
var
|
|
33441
|
+
var import_react127 = __toESM(require_react(), 1);
|
|
33498
33442
|
function useDeleteCommand(options) {
|
|
33499
|
-
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = (0,
|
|
33500
|
-
const openDeleteDialog = (0,
|
|
33443
|
+
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = (0, import_react127.useState)(false);
|
|
33444
|
+
const openDeleteDialog = (0, import_react127.useCallback)(() => {
|
|
33501
33445
|
setIsDeleteDialogOpen(true);
|
|
33502
33446
|
}, []);
|
|
33503
|
-
const closeDeleteDialog = (0,
|
|
33447
|
+
const closeDeleteDialog = (0, import_react127.useCallback)(() => {
|
|
33504
33448
|
setIsDeleteDialogOpen(false);
|
|
33505
33449
|
}, []);
|
|
33506
33450
|
const { config, addItem } = options ?? {};
|
|
33507
|
-
const isDeletingManyRef = (0,
|
|
33508
|
-
const handleDelete = (0,
|
|
33451
|
+
const isDeletingManyRef = (0, import_react127.useRef)(false);
|
|
33452
|
+
const handleDelete = (0, import_react127.useCallback)(
|
|
33509
33453
|
async (sessionId) => {
|
|
33510
33454
|
if (!config) {
|
|
33511
33455
|
return;
|
|
@@ -33564,7 +33508,7 @@ function useDeleteCommand(options) {
|
|
|
33564
33508
|
},
|
|
33565
33509
|
[closeDeleteDialog, config, addItem]
|
|
33566
33510
|
);
|
|
33567
|
-
const handleDeleteMany = (0,
|
|
33511
|
+
const handleDeleteMany = (0, import_react127.useCallback)(
|
|
33568
33512
|
async (sessionIds) => {
|
|
33569
33513
|
if (!config) {
|
|
33570
33514
|
return;
|
|
@@ -33696,7 +33640,7 @@ __name(useDeleteCommand, "useDeleteCommand");
|
|
|
33696
33640
|
|
|
33697
33641
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
33698
33642
|
init_esbuild_shims();
|
|
33699
|
-
var
|
|
33643
|
+
var import_react128 = __toESM(require_react(), 1);
|
|
33700
33644
|
var debugLogger33 = createDebugLogger("SLASH_COMMAND_PROCESSOR");
|
|
33701
33645
|
function hasUserPromptExpansionHooks(config) {
|
|
33702
33646
|
return !!config && !config.getDisableAllHooks?.() && (config.hasHooksForEvent?.("UserPromptExpansion") ?? false);
|
|
@@ -33728,33 +33672,33 @@ function getSkillCommandName(command) {
|
|
|
33728
33672
|
}
|
|
33729
33673
|
__name(getSkillCommandName, "getSkillCommandName");
|
|
33730
33674
|
var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, isProcessing, setIsProcessing, isIdleRef, setGeminiMdFileCount, actions, extensionsUpdateState, isConfigInitialized, logger, updateItem, setSessionName, extensionRefreshState) => {
|
|
33731
|
-
const fallbackExtensionRefreshStateRef = (0,
|
|
33675
|
+
const fallbackExtensionRefreshStateRef = (0, import_react128.useRef)(
|
|
33732
33676
|
null
|
|
33733
33677
|
);
|
|
33734
33678
|
if (!fallbackExtensionRefreshStateRef.current) {
|
|
33735
33679
|
fallbackExtensionRefreshStateRef.current = new ExtensionRefreshState();
|
|
33736
33680
|
}
|
|
33737
33681
|
const activeExtensionRefreshState = extensionRefreshState ?? fallbackExtensionRefreshStateRef.current;
|
|
33738
|
-
const historyRef = (0,
|
|
33739
|
-
(0,
|
|
33682
|
+
const historyRef = (0, import_react128.useRef)(history);
|
|
33683
|
+
(0, import_react128.useLayoutEffect)(() => {
|
|
33740
33684
|
historyRef.current = history;
|
|
33741
33685
|
}, [history]);
|
|
33742
33686
|
const { stats: sessionStats, startNewSession } = useSessionStats();
|
|
33743
|
-
const [commands, setCommands] = (0,
|
|
33744
|
-
const [recentCommands, setRecentCommands] = (0,
|
|
33745
|
-
const [reloadTrigger, setReloadTrigger] = (0,
|
|
33746
|
-
const commandReloadResolversRef = (0,
|
|
33747
|
-
const extensionContentRefreshTimerRef = (0,
|
|
33748
|
-
const extensionContentRefreshRunningRef = (0,
|
|
33749
|
-
const extensionContentRefreshPendingRef = (0,
|
|
33750
|
-
const mountedRef = (0,
|
|
33751
|
-
(0,
|
|
33687
|
+
const [commands, setCommands] = (0, import_react128.useState)([]);
|
|
33688
|
+
const [recentCommands, setRecentCommands] = (0, import_react128.useState)(/* @__PURE__ */ new Map());
|
|
33689
|
+
const [reloadTrigger, setReloadTrigger] = (0, import_react128.useState)(0);
|
|
33690
|
+
const commandReloadResolversRef = (0, import_react128.useRef)([]);
|
|
33691
|
+
const extensionContentRefreshTimerRef = (0, import_react128.useRef)(null);
|
|
33692
|
+
const extensionContentRefreshRunningRef = (0, import_react128.useRef)(false);
|
|
33693
|
+
const extensionContentRefreshPendingRef = (0, import_react128.useRef)(false);
|
|
33694
|
+
const mountedRef = (0, import_react128.useRef)(true);
|
|
33695
|
+
(0, import_react128.useEffect)(() => {
|
|
33752
33696
|
mountedRef.current = true;
|
|
33753
33697
|
return () => {
|
|
33754
33698
|
mountedRef.current = false;
|
|
33755
33699
|
};
|
|
33756
33700
|
}, []);
|
|
33757
|
-
const resolveCommandReloads = (0,
|
|
33701
|
+
const resolveCommandReloads = (0, import_react128.useCallback)((completedTrigger) => {
|
|
33758
33702
|
if (commandReloadResolversRef.current.length === 0) {
|
|
33759
33703
|
return;
|
|
33760
33704
|
}
|
|
@@ -33768,7 +33712,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33768
33712
|
}
|
|
33769
33713
|
commandReloadResolversRef.current = remaining;
|
|
33770
33714
|
}, []);
|
|
33771
|
-
const reloadCommands = (0,
|
|
33715
|
+
const reloadCommands = (0, import_react128.useCallback)(() => {
|
|
33772
33716
|
if (!config) {
|
|
33773
33717
|
return Promise.resolve();
|
|
33774
33718
|
}
|
|
@@ -33783,14 +33727,14 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33783
33727
|
});
|
|
33784
33728
|
});
|
|
33785
33729
|
}, [config]);
|
|
33786
|
-
const clearPendingExtensionContentRefresh = (0,
|
|
33730
|
+
const clearPendingExtensionContentRefresh = (0, import_react128.useCallback)(() => {
|
|
33787
33731
|
if (!extensionContentRefreshTimerRef.current) {
|
|
33788
33732
|
return;
|
|
33789
33733
|
}
|
|
33790
33734
|
clearTimeout(extensionContentRefreshTimerRef.current);
|
|
33791
33735
|
extensionContentRefreshTimerRef.current = null;
|
|
33792
33736
|
}, []);
|
|
33793
|
-
const showExtensionContentRefreshError = (0,
|
|
33737
|
+
const showExtensionContentRefreshError = (0, import_react128.useCallback)(
|
|
33794
33738
|
(error) => {
|
|
33795
33739
|
if (!mountedRef.current) {
|
|
33796
33740
|
return;
|
|
@@ -33810,7 +33754,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33810
33754
|
},
|
|
33811
33755
|
[addItem]
|
|
33812
33756
|
);
|
|
33813
|
-
const runExtensionContentRefresh = (0,
|
|
33757
|
+
const runExtensionContentRefresh = (0, import_react128.useCallback)(async () => {
|
|
33814
33758
|
if (!config) {
|
|
33815
33759
|
return;
|
|
33816
33760
|
}
|
|
@@ -33854,23 +33798,23 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33854
33798
|
reloadCommands,
|
|
33855
33799
|
showExtensionContentRefreshError
|
|
33856
33800
|
]);
|
|
33857
|
-
const [shellConfirmationRequest, setShellConfirmationRequest] = (0,
|
|
33858
|
-
const [confirmationRequest, setConfirmationRequest] = (0,
|
|
33859
|
-
const [sessionShellAllowlist, setSessionShellAllowlist] = (0,
|
|
33801
|
+
const [shellConfirmationRequest, setShellConfirmationRequest] = (0, import_react128.useState)(null);
|
|
33802
|
+
const [confirmationRequest, setConfirmationRequest] = (0, import_react128.useState)(null);
|
|
33803
|
+
const [sessionShellAllowlist, setSessionShellAllowlist] = (0, import_react128.useState)(
|
|
33860
33804
|
/* @__PURE__ */ new Set()
|
|
33861
33805
|
);
|
|
33862
|
-
const [pendingItem, setPendingItem] = (0,
|
|
33806
|
+
const [pendingItem, setPendingItem] = (0, import_react128.useState)(
|
|
33863
33807
|
null
|
|
33864
33808
|
);
|
|
33865
|
-
const [btwItem, setBtwItem] = (0,
|
|
33866
|
-
const btwAbortControllerRef = (0,
|
|
33867
|
-
const cancelBtw = (0,
|
|
33809
|
+
const [btwItem, setBtwItem] = (0, import_react128.useState)(null);
|
|
33810
|
+
const btwAbortControllerRef = (0, import_react128.useRef)(null);
|
|
33811
|
+
const cancelBtw = (0, import_react128.useCallback)(() => {
|
|
33868
33812
|
btwAbortControllerRef.current?.abort();
|
|
33869
33813
|
btwAbortControllerRef.current = null;
|
|
33870
33814
|
setBtwItem(null);
|
|
33871
33815
|
}, []);
|
|
33872
|
-
const abortControllerRef = (0,
|
|
33873
|
-
const cancelSlashCommand = (0,
|
|
33816
|
+
const abortControllerRef = (0, import_react128.useRef)(null);
|
|
33817
|
+
const cancelSlashCommand = (0, import_react128.useCallback)(() => {
|
|
33874
33818
|
cancelBtw();
|
|
33875
33819
|
if (!abortControllerRef.current) {
|
|
33876
33820
|
return;
|
|
@@ -33894,14 +33838,14 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33894
33838
|
},
|
|
33895
33839
|
{ isActive: isProcessing }
|
|
33896
33840
|
);
|
|
33897
|
-
const pendingHistoryItems = (0,
|
|
33841
|
+
const pendingHistoryItems = (0, import_react128.useMemo)(() => {
|
|
33898
33842
|
const items = [];
|
|
33899
33843
|
if (pendingItem != null) {
|
|
33900
33844
|
items.push(pendingItem);
|
|
33901
33845
|
}
|
|
33902
33846
|
return items;
|
|
33903
33847
|
}, [pendingItem]);
|
|
33904
|
-
const addMessage = (0,
|
|
33848
|
+
const addMessage = (0, import_react128.useCallback)(
|
|
33905
33849
|
(message) => {
|
|
33906
33850
|
let historyItemContent;
|
|
33907
33851
|
if (message.type === "about" /* ABOUT */) {
|
|
@@ -33961,7 +33905,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
33961
33905
|
},
|
|
33962
33906
|
[addItem]
|
|
33963
33907
|
);
|
|
33964
|
-
const commandContext = (0,
|
|
33908
|
+
const commandContext = (0, import_react128.useMemo)(
|
|
33965
33909
|
() => ({
|
|
33966
33910
|
services: {
|
|
33967
33911
|
config,
|
|
@@ -34033,7 +33977,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34033
33977
|
activeExtensionRefreshState
|
|
34034
33978
|
]
|
|
34035
33979
|
);
|
|
34036
|
-
(0,
|
|
33980
|
+
(0, import_react128.useEffect)(() => {
|
|
34037
33981
|
if (!config) {
|
|
34038
33982
|
return;
|
|
34039
33983
|
}
|
|
@@ -34051,7 +33995,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34051
33995
|
})();
|
|
34052
33996
|
};
|
|
34053
33997
|
}, [config, reloadCommands]);
|
|
34054
|
-
(0,
|
|
33998
|
+
(0, import_react128.useEffect)(() => {
|
|
34055
33999
|
if (!config) {
|
|
34056
34000
|
return;
|
|
34057
34001
|
}
|
|
@@ -34076,7 +34020,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34076
34020
|
}
|
|
34077
34021
|
};
|
|
34078
34022
|
}, [config, reloadCommands]);
|
|
34079
|
-
(0,
|
|
34023
|
+
(0, import_react128.useEffect)(() => {
|
|
34080
34024
|
if (!isConfigInitialized) {
|
|
34081
34025
|
return;
|
|
34082
34026
|
}
|
|
@@ -34091,7 +34035,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34091
34035
|
reloadCommands();
|
|
34092
34036
|
});
|
|
34093
34037
|
}, [config, isConfigInitialized, reloadCommands]);
|
|
34094
|
-
(0,
|
|
34038
|
+
(0, import_react128.useEffect)(() => {
|
|
34095
34039
|
const listener = /* @__PURE__ */ __name((reason) => {
|
|
34096
34040
|
clearPendingExtensionContentRefresh();
|
|
34097
34041
|
addItem(
|
|
@@ -34118,7 +34062,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34118
34062
|
addItem,
|
|
34119
34063
|
clearPendingExtensionContentRefresh
|
|
34120
34064
|
]);
|
|
34121
|
-
(0,
|
|
34065
|
+
(0, import_react128.useEffect)(() => {
|
|
34122
34066
|
activeExtensionRefreshState.on(
|
|
34123
34067
|
"extensions-reload-started" /* ExtensionsReloadStarted */,
|
|
34124
34068
|
clearPendingExtensionContentRefresh
|
|
@@ -34138,7 +34082,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34138
34082
|
);
|
|
34139
34083
|
};
|
|
34140
34084
|
}, [activeExtensionRefreshState, clearPendingExtensionContentRefresh]);
|
|
34141
|
-
(0,
|
|
34085
|
+
(0, import_react128.useEffect)(() => {
|
|
34142
34086
|
if (!config) {
|
|
34143
34087
|
return;
|
|
34144
34088
|
}
|
|
@@ -34164,7 +34108,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34164
34108
|
activeExtensionRefreshState,
|
|
34165
34109
|
runExtensionContentRefresh
|
|
34166
34110
|
]);
|
|
34167
|
-
(0,
|
|
34111
|
+
(0, import_react128.useEffect)(() => {
|
|
34168
34112
|
const controller = new AbortController();
|
|
34169
34113
|
const load = /* @__PURE__ */ __name(async () => {
|
|
34170
34114
|
try {
|
|
@@ -34261,7 +34205,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
34261
34205
|
settings,
|
|
34262
34206
|
resolveCommandReloads
|
|
34263
34207
|
]);
|
|
34264
|
-
const handleSlashCommand = (0,
|
|
34208
|
+
const handleSlashCommand = (0, import_react128.useCallback)(
|
|
34265
34209
|
async (rawQuery, oneTimeShellAllowlist, overwriteConfirmed, existingInvocationItemId) => {
|
|
34266
34210
|
if (typeof rawQuery !== "string") {
|
|
34267
34211
|
return false;
|
|
@@ -34817,11 +34761,11 @@ ${commandToExecute.subCommands.map((sc) => ` - ${sc.name}: ${sc.description ||
|
|
|
34817
34761
|
|
|
34818
34762
|
// packages/cli/src/ui/hooks/useDoublePress.ts
|
|
34819
34763
|
init_esbuild_shims();
|
|
34820
|
-
var
|
|
34764
|
+
var import_react129 = __toESM(require_react(), 1);
|
|
34821
34765
|
var DOUBLE_PRESS_TIMEOUT_MS = 800;
|
|
34822
34766
|
function useDoublePress(onDoublePress, onPending) {
|
|
34823
|
-
const timeoutRef = (0,
|
|
34824
|
-
(0,
|
|
34767
|
+
const timeoutRef = (0, import_react129.useRef)(null);
|
|
34768
|
+
(0, import_react129.useEffect)(
|
|
34825
34769
|
() => () => {
|
|
34826
34770
|
if (timeoutRef.current !== null) {
|
|
34827
34771
|
clearTimeout(timeoutRef.current);
|
|
@@ -34830,7 +34774,7 @@ function useDoublePress(onDoublePress, onPending) {
|
|
|
34830
34774
|
},
|
|
34831
34775
|
[]
|
|
34832
34776
|
);
|
|
34833
|
-
return (0,
|
|
34777
|
+
return (0, import_react129.useCallback)(() => {
|
|
34834
34778
|
if (timeoutRef.current !== null) {
|
|
34835
34779
|
clearTimeout(timeoutRef.current);
|
|
34836
34780
|
timeoutRef.current = null;
|
|
@@ -34894,10 +34838,10 @@ __name(formatSessionWindowTitle, "formatSessionWindowTitle");
|
|
|
34894
34838
|
|
|
34895
34839
|
// packages/cli/src/ui/hooks/useLogger.ts
|
|
34896
34840
|
init_esbuild_shims();
|
|
34897
|
-
var
|
|
34841
|
+
var import_react130 = __toESM(require_react(), 1);
|
|
34898
34842
|
var useLogger = /* @__PURE__ */ __name((storage, sessionId) => {
|
|
34899
|
-
const [logger, setLogger] = (0,
|
|
34900
|
-
(0,
|
|
34843
|
+
const [logger, setLogger] = (0, import_react130.useState)(null);
|
|
34844
|
+
(0, import_react130.useEffect)(() => {
|
|
34901
34845
|
if (!sessionId) {
|
|
34902
34846
|
return;
|
|
34903
34847
|
}
|
|
@@ -34918,11 +34862,11 @@ var useLogger = /* @__PURE__ */ __name((storage, sessionId) => {
|
|
|
34918
34862
|
|
|
34919
34863
|
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
34920
34864
|
init_esbuild_shims();
|
|
34921
|
-
var
|
|
34865
|
+
var import_react134 = __toESM(require_react(), 1);
|
|
34922
34866
|
|
|
34923
34867
|
// packages/cli/src/ui/hooks/shellCommandProcessor.ts
|
|
34924
34868
|
init_esbuild_shims();
|
|
34925
|
-
var
|
|
34869
|
+
var import_react131 = __toESM(require_react(), 1);
|
|
34926
34870
|
import crypto2 from "node:crypto";
|
|
34927
34871
|
import path10 from "node:path";
|
|
34928
34872
|
import os5 from "node:os";
|
|
@@ -34955,8 +34899,8 @@ ${modelContent}
|
|
|
34955
34899
|
}
|
|
34956
34900
|
__name(addShellCommandToGeminiHistory, "addShellCommandToGeminiHistory");
|
|
34957
34901
|
var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPendingHistoryItem, onExec, onDebugMessage, config, geminiClient, setShellInputFocused, terminalWidth, terminalHeight) => {
|
|
34958
|
-
const [activeShellPtyId, setActiveShellPtyId] = (0,
|
|
34959
|
-
const handleShellCommand = (0,
|
|
34902
|
+
const [activeShellPtyId, setActiveShellPtyId] = (0, import_react131.useState)(null);
|
|
34903
|
+
const handleShellCommand = (0, import_react131.useCallback)(
|
|
34960
34904
|
(rawQuery, abortSignal) => {
|
|
34961
34905
|
if (typeof rawQuery !== "string" || rawQuery.trim() === "") {
|
|
34962
34906
|
return false;
|
|
@@ -35210,11 +35154,11 @@ ${finalOutput}`;
|
|
|
35210
35154
|
|
|
35211
35155
|
// packages/cli/src/ui/hooks/useStateAndRef.ts
|
|
35212
35156
|
init_esbuild_shims();
|
|
35213
|
-
var
|
|
35157
|
+
var import_react132 = __toESM(require_react(), 1);
|
|
35214
35158
|
var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
35215
|
-
const [state, setState] =
|
|
35216
|
-
const ref =
|
|
35217
|
-
const setStateInternal =
|
|
35159
|
+
const [state, setState] = import_react132.default.useState(initialValue);
|
|
35160
|
+
const ref = import_react132.default.useRef(initialValue);
|
|
35161
|
+
const setStateInternal = import_react132.default.useCallback(
|
|
35218
35162
|
(newStateOrCallback) => {
|
|
35219
35163
|
let newValue;
|
|
35220
35164
|
if (typeof newStateOrCallback === "function") {
|
|
@@ -35232,12 +35176,12 @@ var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
|
35232
35176
|
|
|
35233
35177
|
// packages/cli/src/ui/hooks/useReactToolScheduler.ts
|
|
35234
35178
|
init_esbuild_shims();
|
|
35235
|
-
var
|
|
35179
|
+
var import_react133 = __toESM(require_react(), 1);
|
|
35236
35180
|
import * as path11 from "node:path";
|
|
35237
35181
|
var debugLogger35 = createDebugLogger("REACT_TOOL_SCHEDULER");
|
|
35238
35182
|
function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorClose) {
|
|
35239
|
-
const [toolCallsForDisplay, setToolCallsForDisplay] = (0,
|
|
35240
|
-
const outputUpdateHandler = (0,
|
|
35183
|
+
const [toolCallsForDisplay, setToolCallsForDisplay] = (0, import_react133.useState)([]);
|
|
35184
|
+
const outputUpdateHandler = (0, import_react133.useCallback)(
|
|
35241
35185
|
(toolCallId, outputChunk) => {
|
|
35242
35186
|
if (isShellProgressData(outputChunk)) {
|
|
35243
35187
|
return;
|
|
@@ -35255,13 +35199,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35255
35199
|
},
|
|
35256
35200
|
[]
|
|
35257
35201
|
);
|
|
35258
|
-
const allToolCallsCompleteHandler = (0,
|
|
35202
|
+
const allToolCallsCompleteHandler = (0, import_react133.useCallback)(
|
|
35259
35203
|
async (completedToolCalls) => {
|
|
35260
35204
|
await onComplete(completedToolCalls);
|
|
35261
35205
|
},
|
|
35262
35206
|
[onComplete]
|
|
35263
35207
|
);
|
|
35264
|
-
const toolCallsUpdateHandler = (0,
|
|
35208
|
+
const toolCallsUpdateHandler = (0, import_react133.useCallback)(
|
|
35265
35209
|
(updatedCoreToolCalls) => {
|
|
35266
35210
|
setToolCallsForDisplay(
|
|
35267
35211
|
(prevTrackedCalls) => updatedCoreToolCalls.map((coreTc) => {
|
|
@@ -35288,9 +35232,10 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35288
35232
|
},
|
|
35289
35233
|
[setToolCallsForDisplay]
|
|
35290
35234
|
);
|
|
35291
|
-
const scheduler = (0,
|
|
35235
|
+
const scheduler = (0, import_react133.useMemo)(
|
|
35292
35236
|
() => new CoreToolScheduler({
|
|
35293
35237
|
config,
|
|
35238
|
+
chatRecordingService: config.getChatRecordingService(),
|
|
35294
35239
|
outputUpdateHandler,
|
|
35295
35240
|
onAllToolCallsComplete: allToolCallsCompleteHandler,
|
|
35296
35241
|
onToolCallsUpdate: toolCallsUpdateHandler,
|
|
@@ -35306,7 +35251,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35306
35251
|
onEditorClose
|
|
35307
35252
|
]
|
|
35308
35253
|
);
|
|
35309
|
-
const schedule = (0,
|
|
35254
|
+
const schedule = (0, import_react133.useCallback)(
|
|
35310
35255
|
(request, signal, modelOverride) => {
|
|
35311
35256
|
if (!modelOverride?.endsWith("\0")) {
|
|
35312
35257
|
void scheduler.schedule(request, signal);
|
|
@@ -35333,6 +35278,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35333
35278
|
message,
|
|
35334
35279
|
message
|
|
35335
35280
|
);
|
|
35281
|
+
config.getChatRecordingService()?.recordToolResult(responseParts, {
|
|
35282
|
+
callId: toolRequest.callId,
|
|
35283
|
+
status: "error",
|
|
35284
|
+
resultDisplay: message,
|
|
35285
|
+
error: toolError,
|
|
35286
|
+
errorType: "unhandled_exception" /* UNHANDLED_EXCEPTION */
|
|
35287
|
+
});
|
|
35336
35288
|
return {
|
|
35337
35289
|
status: "error",
|
|
35338
35290
|
request: toolRequest,
|
|
@@ -35355,7 +35307,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
35355
35307
|
},
|
|
35356
35308
|
[allToolCallsCompleteHandler, config, scheduler]
|
|
35357
35309
|
);
|
|
35358
|
-
const markToolsAsSubmitted = (0,
|
|
35310
|
+
const markToolsAsSubmitted = (0, import_react133.useCallback)(
|
|
35359
35311
|
(callIdsToMark) => {
|
|
35360
35312
|
setToolCallsForDisplay(
|
|
35361
35313
|
(prevCalls) => prevCalls.map(
|
|
@@ -35521,78 +35473,6 @@ __name(mapToDisplay, "mapToDisplay");
|
|
|
35521
35473
|
import { promises as fs17 } from "node:fs";
|
|
35522
35474
|
import path12 from "node:path";
|
|
35523
35475
|
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
|
|
35596
35476
|
var debugLogger36 = createDebugLogger("GEMINI_STREAM");
|
|
35597
35477
|
function applyModelOverride(modelOverrideRef, inlineActiveRef, value, isInline) {
|
|
35598
35478
|
modelOverrideRef.current = value;
|
|
@@ -35735,16 +35615,16 @@ function charIndexAfterLine(text, keptLines) {
|
|
|
35735
35615
|
}
|
|
35736
35616
|
__name(charIndexAfterLine, "charIndexAfterLine");
|
|
35737
35617
|
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) => {
|
|
35738
|
-
const [initError, setInitError] = (0,
|
|
35739
|
-
const abortControllerRef = (0,
|
|
35740
|
-
const flushBufferedStreamEventsRef = (0,
|
|
35741
|
-
const turnCancelledRef = (0,
|
|
35742
|
-
const isSubmittingQueryRef = (0,
|
|
35743
|
-
const lastPromptRef = (0,
|
|
35744
|
-
const lastTurnUserItemRef = (0,
|
|
35745
|
-
const turnSawContentEventRef = (0,
|
|
35746
|
-
const lastPromptErroredRef = (0,
|
|
35747
|
-
const commitItem = (0,
|
|
35618
|
+
const [initError, setInitError] = (0, import_react134.useState)(null);
|
|
35619
|
+
const abortControllerRef = (0, import_react134.useRef)(null);
|
|
35620
|
+
const flushBufferedStreamEventsRef = (0, import_react134.useRef)(/* @__PURE__ */ new Set());
|
|
35621
|
+
const turnCancelledRef = (0, import_react134.useRef)(false);
|
|
35622
|
+
const isSubmittingQueryRef = (0, import_react134.useRef)(false);
|
|
35623
|
+
const lastPromptRef = (0, import_react134.useRef)(null);
|
|
35624
|
+
const lastTurnUserItemRef = (0, import_react134.useRef)(null);
|
|
35625
|
+
const turnSawContentEventRef = (0, import_react134.useRef)(false);
|
|
35626
|
+
const lastPromptErroredRef = (0, import_react134.useRef)(false);
|
|
35627
|
+
const commitItem = (0, import_react134.useCallback)(
|
|
35748
35628
|
(item, userMessageTimestamp) => {
|
|
35749
35629
|
if (item.type === "gemini" && !item.timestamp) {
|
|
35750
35630
|
item.timestamp = Date.now();
|
|
@@ -35754,17 +35634,17 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35754
35634
|
[addItem]
|
|
35755
35635
|
);
|
|
35756
35636
|
const dualOutput = useDualOutput();
|
|
35757
|
-
const [isResponding, setIsResponding] = (0,
|
|
35758
|
-
const activeModelStreamsRef = (0,
|
|
35759
|
-
const [thought, setThought] = (0,
|
|
35760
|
-
const historyRef = (0,
|
|
35761
|
-
(0,
|
|
35637
|
+
const [isResponding, setIsResponding] = (0, import_react134.useState)(false);
|
|
35638
|
+
const activeModelStreamsRef = (0, import_react134.useRef)(0);
|
|
35639
|
+
const [thought, setThought] = (0, import_react134.useState)(null);
|
|
35640
|
+
const historyRef = (0, import_react134.useRef)(history);
|
|
35641
|
+
(0, import_react134.useLayoutEffect)(() => {
|
|
35762
35642
|
historyRef.current = history;
|
|
35763
35643
|
}, [history]);
|
|
35764
|
-
const auxiliaryAbortRefsRef = (0,
|
|
35644
|
+
const auxiliaryAbortRefsRef = (0, import_react134.useRef)(/* @__PURE__ */ new Set());
|
|
35765
35645
|
const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
|
|
35766
35646
|
const [pendingThoughtItem, pendingThoughtItemRef, setPendingThoughtItem] = useStateAndRef(null);
|
|
35767
|
-
const thoughtStartTimeRef = (0,
|
|
35647
|
+
const thoughtStartTimeRef = (0, import_react134.useRef)(null);
|
|
35768
35648
|
const [
|
|
35769
35649
|
pendingRetryErrorItem,
|
|
35770
35650
|
pendingRetryErrorItemRef,
|
|
@@ -35775,21 +35655,21 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35775
35655
|
pendingRetryCountdownItemRef,
|
|
35776
35656
|
setPendingRetryCountdownItem
|
|
35777
35657
|
] = useStateAndRef(null);
|
|
35778
|
-
const retryCountdownTimerRef = (0,
|
|
35658
|
+
const retryCountdownTimerRef = (0, import_react134.useRef)(
|
|
35779
35659
|
null
|
|
35780
35660
|
);
|
|
35781
|
-
const processedMemoryToolsRef = (0,
|
|
35782
|
-
const submitPromptOnCompleteRef = (0,
|
|
35783
|
-
const modelOverrideRef = (0,
|
|
35784
|
-
const inlineModelOverrideActiveRef = (0,
|
|
35785
|
-
const handledProviderToolCallIdsRef = (0,
|
|
35786
|
-
const duplicateProviderToolCallResponseIdsRef = (0,
|
|
35661
|
+
const processedMemoryToolsRef = (0, import_react134.useRef)(/* @__PURE__ */ new Set());
|
|
35662
|
+
const submitPromptOnCompleteRef = (0, import_react134.useRef)(null);
|
|
35663
|
+
const modelOverrideRef = (0, import_react134.useRef)(void 0);
|
|
35664
|
+
const inlineModelOverrideActiveRef = (0, import_react134.useRef)(false);
|
|
35665
|
+
const handledProviderToolCallIdsRef = (0, import_react134.useRef)(/* @__PURE__ */ new Set());
|
|
35666
|
+
const duplicateProviderToolCallResponseIdsRef = (0, import_react134.useRef)(
|
|
35787
35667
|
/* @__PURE__ */ new Set()
|
|
35788
35668
|
);
|
|
35789
|
-
const pendingDuplicateToolResponsesRef = (0,
|
|
35790
|
-
const immediateDuplicateToolResponsesRef = (0,
|
|
35791
|
-
const streamingResponseLengthRef = (0,
|
|
35792
|
-
const [isReceivingContent, setIsReceivingContent] = (0,
|
|
35669
|
+
const pendingDuplicateToolResponsesRef = (0, import_react134.useRef)([]);
|
|
35670
|
+
const immediateDuplicateToolResponsesRef = (0, import_react134.useRef)(null);
|
|
35671
|
+
const streamingResponseLengthRef = (0, import_react134.useRef)(0);
|
|
35672
|
+
const [isReceivingContent, setIsReceivingContent] = (0, import_react134.useState)(false);
|
|
35793
35673
|
const {
|
|
35794
35674
|
startNewPrompt,
|
|
35795
35675
|
getPromptCount,
|
|
@@ -35814,11 +35694,11 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35814
35694
|
getPreferredEditor,
|
|
35815
35695
|
onEditorClose
|
|
35816
35696
|
);
|
|
35817
|
-
const pendingToolCallGroupDisplay = (0,
|
|
35697
|
+
const pendingToolCallGroupDisplay = (0, import_react134.useMemo)(
|
|
35818
35698
|
() => toolCalls.length ? mapToDisplay(toolCalls, config.getProjectRoot()) : void 0,
|
|
35819
35699
|
[toolCalls, config]
|
|
35820
35700
|
);
|
|
35821
|
-
const activeToolPtyId = (0,
|
|
35701
|
+
const activeToolPtyId = (0, import_react134.useMemo)(() => {
|
|
35822
35702
|
const executingShellTool = toolCalls?.find(
|
|
35823
35703
|
(tc) => tc.status === "executing" && tc.request.name === "run_shell_command"
|
|
35824
35704
|
);
|
|
@@ -35827,18 +35707,18 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35827
35707
|
}
|
|
35828
35708
|
return void 0;
|
|
35829
35709
|
}, [toolCalls]);
|
|
35830
|
-
const loopDetectedRef = (0,
|
|
35710
|
+
const loopDetectedRef = (0, import_react134.useRef)(false);
|
|
35831
35711
|
const [
|
|
35832
35712
|
loopDetectionConfirmationRequest,
|
|
35833
35713
|
setLoopDetectionConfirmationRequest
|
|
35834
|
-
] = (0,
|
|
35835
|
-
const stopRetryCountdownTimer = (0,
|
|
35714
|
+
] = (0, import_react134.useState)(null);
|
|
35715
|
+
const stopRetryCountdownTimer = (0, import_react134.useCallback)(() => {
|
|
35836
35716
|
if (retryCountdownTimerRef.current) {
|
|
35837
35717
|
clearInterval(retryCountdownTimerRef.current);
|
|
35838
35718
|
retryCountdownTimerRef.current = null;
|
|
35839
35719
|
}
|
|
35840
35720
|
}, []);
|
|
35841
|
-
const clearRetryCountdown = (0,
|
|
35721
|
+
const clearRetryCountdown = (0, import_react134.useCallback)(() => {
|
|
35842
35722
|
stopRetryCountdownTimer();
|
|
35843
35723
|
skipRetryDelayRef.current = null;
|
|
35844
35724
|
setPendingRetryErrorItem(null);
|
|
@@ -35848,8 +35728,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35848
35728
|
setPendingRetryCountdownItem,
|
|
35849
35729
|
stopRetryCountdownTimer
|
|
35850
35730
|
]);
|
|
35851
|
-
const skipRetryDelayRef = (0,
|
|
35852
|
-
const startRetryCountdown = (0,
|
|
35731
|
+
const skipRetryDelayRef = (0, import_react134.useRef)(null);
|
|
35732
|
+
const startRetryCountdown = (0, import_react134.useCallback)(
|
|
35853
35733
|
(retryInfo) => {
|
|
35854
35734
|
stopRetryCountdownTimer();
|
|
35855
35735
|
skipRetryDelayRef.current = retryInfo.skipDelay;
|
|
@@ -35890,8 +35770,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35890
35770
|
stopRetryCountdownTimer
|
|
35891
35771
|
]
|
|
35892
35772
|
);
|
|
35893
|
-
(0,
|
|
35894
|
-
const onExec = (0,
|
|
35773
|
+
(0, import_react134.useEffect)(() => () => stopRetryCountdownTimer(), [stopRetryCountdownTimer]);
|
|
35774
|
+
const onExec = (0, import_react134.useCallback)(async (done) => {
|
|
35895
35775
|
setIsResponding(true);
|
|
35896
35776
|
await done;
|
|
35897
35777
|
setIsResponding(false);
|
|
@@ -35908,12 +35788,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35908
35788
|
terminalHeight
|
|
35909
35789
|
);
|
|
35910
35790
|
const activePtyId = activeShellPtyId || activeToolPtyId;
|
|
35911
|
-
(0,
|
|
35791
|
+
(0, import_react134.useEffect)(() => {
|
|
35912
35792
|
if (!activePtyId) {
|
|
35913
35793
|
setShellInputFocused(false);
|
|
35914
35794
|
}
|
|
35915
35795
|
}, [activePtyId, setShellInputFocused]);
|
|
35916
|
-
const streamingState = (0,
|
|
35796
|
+
const streamingState = (0, import_react134.useMemo)(() => {
|
|
35917
35797
|
if (toolCalls.some((tc) => tc.status === "awaiting_approval")) {
|
|
35918
35798
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
35919
35799
|
}
|
|
@@ -35931,7 +35811,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35931
35811
|
}
|
|
35932
35812
|
return "idle" /* Idle */;
|
|
35933
35813
|
}, [isResponding, toolCalls]);
|
|
35934
|
-
(0,
|
|
35814
|
+
(0, import_react134.useEffect)(() => {
|
|
35935
35815
|
if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
|
|
35936
35816
|
const lastUserMessageIndex = history.findLastIndex(
|
|
35937
35817
|
(item) => item.type === "user" /* USER */
|
|
@@ -35945,7 +35825,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
35945
35825
|
}
|
|
35946
35826
|
}
|
|
35947
35827
|
}, [streamingState, config, history]);
|
|
35948
|
-
const cancelOngoingRequest = (0,
|
|
35828
|
+
const cancelOngoingRequest = (0, import_react134.useCallback)(() => {
|
|
35949
35829
|
if (streamingState !== "responding" /* Responding */) {
|
|
35950
35830
|
return;
|
|
35951
35831
|
}
|
|
@@ -36016,7 +35896,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36016
35896
|
config,
|
|
36017
35897
|
getPromptCount
|
|
36018
35898
|
]);
|
|
36019
|
-
const applyVisionBridgeIfNeeded = (0,
|
|
35899
|
+
const applyVisionBridgeIfNeeded = (0, import_react134.useCallback)(
|
|
36020
35900
|
async (parts, timestamp, signal) => {
|
|
36021
35901
|
if (parts === null || !hasImageParts(parts)) {
|
|
36022
35902
|
return { parts, shouldProceed: true };
|
|
@@ -36081,7 +35961,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36081
35961
|
},
|
|
36082
35962
|
[addItem, config]
|
|
36083
35963
|
);
|
|
36084
|
-
const prepareQueryForGemini = (0,
|
|
35964
|
+
const prepareQueryForGemini = (0, import_react134.useCallback)(
|
|
36085
35965
|
async (query, userMessageTimestamp, abortSignal, prompt_id, submitType) => {
|
|
36086
35966
|
if (turnCancelledRef.current) {
|
|
36087
35967
|
return { queryToSend: null, shouldProceed: false };
|
|
@@ -36232,7 +36112,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36232
36112
|
applyVisionBridgeIfNeeded
|
|
36233
36113
|
]
|
|
36234
36114
|
);
|
|
36235
|
-
const handleContentEvent = (0,
|
|
36115
|
+
const handleContentEvent = (0, import_react134.useCallback)(
|
|
36236
36116
|
(eventValue, currentGeminiMessageBuffer, userMessageTimestamp) => {
|
|
36237
36117
|
if (turnCancelledRef.current) {
|
|
36238
36118
|
return "";
|
|
@@ -36357,7 +36237,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36357
36237
|
terminalWidthRef
|
|
36358
36238
|
]
|
|
36359
36239
|
);
|
|
36360
|
-
const mergeThought = (0,
|
|
36240
|
+
const mergeThought = (0, import_react134.useCallback)(
|
|
36361
36241
|
(incoming) => {
|
|
36362
36242
|
setThought((prev) => {
|
|
36363
36243
|
const incomingDescription = incoming.description ? clampLoadingThoughtDescription(incoming.description) : incoming.description;
|
|
@@ -36386,7 +36266,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36386
36266
|
},
|
|
36387
36267
|
[setThought]
|
|
36388
36268
|
);
|
|
36389
|
-
const handleThoughtEvent = (0,
|
|
36269
|
+
const handleThoughtEvent = (0, import_react134.useCallback)(
|
|
36390
36270
|
(eventValue, currentThoughtBuffer, userMessageTimestamp) => {
|
|
36391
36271
|
if (turnCancelledRef.current) {
|
|
36392
36272
|
return "";
|
|
@@ -36448,7 +36328,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36448
36328
|
},
|
|
36449
36329
|
[addItem, mergeThought, pendingThoughtItemRef, setPendingThoughtItem]
|
|
36450
36330
|
);
|
|
36451
|
-
const commitPendingThought = (0,
|
|
36331
|
+
const commitPendingThought = (0, import_react134.useCallback)(
|
|
36452
36332
|
(userMessageTimestamp) => {
|
|
36453
36333
|
if (pendingThoughtItemRef.current) {
|
|
36454
36334
|
const item = { ...pendingThoughtItemRef.current };
|
|
@@ -36462,7 +36342,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36462
36342
|
},
|
|
36463
36343
|
[addItem, pendingThoughtItemRef, setPendingThoughtItem]
|
|
36464
36344
|
);
|
|
36465
|
-
const handleUserCancelledEvent = (0,
|
|
36345
|
+
const handleUserCancelledEvent = (0, import_react134.useCallback)(
|
|
36466
36346
|
(userMessageTimestamp) => {
|
|
36467
36347
|
if (turnCancelledRef.current) {
|
|
36468
36348
|
return;
|
|
@@ -36502,7 +36382,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36502
36382
|
clearRetryCountdown
|
|
36503
36383
|
]
|
|
36504
36384
|
);
|
|
36505
|
-
const handleErrorEvent = (0,
|
|
36385
|
+
const handleErrorEvent = (0, import_react134.useCallback)(
|
|
36506
36386
|
(eventValue, userMessageTimestamp) => {
|
|
36507
36387
|
lastPromptErroredRef.current = true;
|
|
36508
36388
|
commitPendingThought(userMessageTimestamp);
|
|
@@ -36545,7 +36425,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36545
36425
|
clearRetryCountdown
|
|
36546
36426
|
]
|
|
36547
36427
|
);
|
|
36548
|
-
const handleCitationEvent = (0,
|
|
36428
|
+
const handleCitationEvent = (0, import_react134.useCallback)(
|
|
36549
36429
|
(text, userMessageTimestamp) => {
|
|
36550
36430
|
if (!showCitations(settings)) {
|
|
36551
36431
|
return;
|
|
@@ -36564,7 +36444,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36564
36444
|
settings
|
|
36565
36445
|
]
|
|
36566
36446
|
);
|
|
36567
|
-
const handleFinishedEvent = (0,
|
|
36447
|
+
const handleFinishedEvent = (0, import_react134.useCallback)(
|
|
36568
36448
|
(event, userMessageTimestamp) => {
|
|
36569
36449
|
const finishReason = event.value.reason;
|
|
36570
36450
|
if (!finishReason) {
|
|
@@ -36605,8 +36485,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36605
36485
|
},
|
|
36606
36486
|
[addItem, clearRetryCountdown]
|
|
36607
36487
|
);
|
|
36608
|
-
const autonomousLoopTickResolverRef = (0,
|
|
36609
|
-
const handleChatCompressionEvent = (0,
|
|
36488
|
+
const autonomousLoopTickResolverRef = (0, import_react134.useRef)(null);
|
|
36489
|
+
const handleChatCompressionEvent = (0, import_react134.useCallback)(
|
|
36610
36490
|
(eventValue, userMessageTimestamp) => {
|
|
36611
36491
|
autonomousLoopTickResolverRef.current?.resetCache();
|
|
36612
36492
|
if (pendingHistoryItemRef.current) {
|
|
@@ -36625,7 +36505,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36625
36505
|
},
|
|
36626
36506
|
[addItem, commitItem, config, pendingHistoryItemRef, setPendingHistoryItem]
|
|
36627
36507
|
);
|
|
36628
|
-
const handleMaxSessionTurnsEvent = (0,
|
|
36508
|
+
const handleMaxSessionTurnsEvent = (0, import_react134.useCallback)(
|
|
36629
36509
|
() => addItem(
|
|
36630
36510
|
{
|
|
36631
36511
|
type: "info",
|
|
@@ -36635,7 +36515,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36635
36515
|
),
|
|
36636
36516
|
[addItem, config]
|
|
36637
36517
|
);
|
|
36638
|
-
const handleSessionTokenLimitExceededEvent = (0,
|
|
36518
|
+
const handleSessionTokenLimitExceededEvent = (0, import_react134.useCallback)(
|
|
36639
36519
|
(value) => addItem(
|
|
36640
36520
|
{
|
|
36641
36521
|
type: "error",
|
|
@@ -36650,7 +36530,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36650
36530
|
),
|
|
36651
36531
|
[addItem]
|
|
36652
36532
|
);
|
|
36653
|
-
const handleLoopDetectionConfirmation = (0,
|
|
36533
|
+
const handleLoopDetectionConfirmation = (0, import_react134.useCallback)(
|
|
36654
36534
|
(result) => {
|
|
36655
36535
|
setLoopDetectionConfirmationRequest(null);
|
|
36656
36536
|
if (result.userSelection === "disable") {
|
|
@@ -36674,12 +36554,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36674
36554
|
},
|
|
36675
36555
|
[config, addItem]
|
|
36676
36556
|
);
|
|
36677
|
-
const handleLoopDetectedEvent = (0,
|
|
36557
|
+
const handleLoopDetectedEvent = (0, import_react134.useCallback)(() => {
|
|
36678
36558
|
setLoopDetectionConfirmationRequest({
|
|
36679
36559
|
onComplete: handleLoopDetectionConfirmation
|
|
36680
36560
|
});
|
|
36681
36561
|
}, [handleLoopDetectionConfirmation]);
|
|
36682
|
-
const handleUserPromptSubmitBlockedEvent = (0,
|
|
36562
|
+
const handleUserPromptSubmitBlockedEvent = (0, import_react134.useCallback)(
|
|
36683
36563
|
(value, userMessageTimestamp) => {
|
|
36684
36564
|
if (pendingHistoryItemRef.current) {
|
|
36685
36565
|
commitItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -36696,7 +36576,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36696
36576
|
},
|
|
36697
36577
|
[addItem, commitItem, pendingHistoryItemRef, setPendingHistoryItem]
|
|
36698
36578
|
);
|
|
36699
|
-
const handleStopHookLoopEvent = (0,
|
|
36579
|
+
const handleStopHookLoopEvent = (0, import_react134.useCallback)(
|
|
36700
36580
|
(value, userMessageTimestamp) => {
|
|
36701
36581
|
if (pendingHistoryItemRef.current) {
|
|
36702
36582
|
commitItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -36730,7 +36610,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36730
36610
|
},
|
|
36731
36611
|
[addItem, commitItem, config, pendingHistoryItemRef, setPendingHistoryItem]
|
|
36732
36612
|
);
|
|
36733
|
-
const handleActiveGoalEvent = (0,
|
|
36613
|
+
const handleActiveGoalEvent = (0, import_react134.useCallback)(
|
|
36734
36614
|
(activeGoal) => {
|
|
36735
36615
|
const sessionId = config.getSessionId();
|
|
36736
36616
|
const currentActiveGoal = getActiveGoal(sessionId);
|
|
@@ -36748,7 +36628,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36748
36628
|
},
|
|
36749
36629
|
[config]
|
|
36750
36630
|
);
|
|
36751
|
-
const processGeminiStreamEvents = (0,
|
|
36631
|
+
const processGeminiStreamEvents = (0, import_react134.useCallback)(
|
|
36752
36632
|
async (stream, userMessageTimestamp, signal) => {
|
|
36753
36633
|
let geminiMessageBuffer = "";
|
|
36754
36634
|
let thoughtBuffer = "";
|
|
@@ -36862,7 +36742,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36862
36742
|
flushBufferedStreamEvents();
|
|
36863
36743
|
toolCallRequests.length = 0;
|
|
36864
36744
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
36865
|
-
|
|
36745
|
+
break;
|
|
36866
36746
|
case "error" /* Error */:
|
|
36867
36747
|
flushBufferedStreamEvents();
|
|
36868
36748
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
@@ -36987,11 +36867,11 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
36987
36867
|
commitPendingThought(userMessageTimestamp);
|
|
36988
36868
|
discardBufferedStreamEvents();
|
|
36989
36869
|
flushBufferedStreamEventsRef.current.delete(flushBufferedStreamEvents);
|
|
36990
|
-
dualOutput?.finalizeAssistantMessage();
|
|
36991
36870
|
}
|
|
36871
|
+
dualOutput?.finalizeAssistantMessage();
|
|
36992
36872
|
if (toolCallRequests.length > 0 && !signal.aborted && !loopDetectedRef.current) {
|
|
36993
36873
|
const executableToolCallRequests = [];
|
|
36994
|
-
const
|
|
36874
|
+
const duplicateResponseParts = [];
|
|
36995
36875
|
let duplicatePromptId;
|
|
36996
36876
|
const historyCallIdsWithResponse = geminiClient ? geminiClient.getHistoryFunctionResponseIds() : /* @__PURE__ */ new Set();
|
|
36997
36877
|
const handledProviderIds = /* @__PURE__ */ new Set([
|
|
@@ -37027,27 +36907,26 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37027
36907
|
`[processGeminiStreamEvents] Suppressing duplicate provider tool-call id: ${providerCallId} (tool: ${request.name})`
|
|
37028
36908
|
);
|
|
37029
36909
|
dualOutput?.emitToolResult(request, response);
|
|
37030
|
-
|
|
36910
|
+
duplicateResponseParts.push(...response.responseParts);
|
|
37031
36911
|
duplicatePromptId ??= request.prompt_id;
|
|
37032
36912
|
continue;
|
|
37033
36913
|
}
|
|
37034
36914
|
handledProviderToolCallIdsRef.current.add(providerCallId);
|
|
37035
36915
|
executableToolCallRequests.push(request);
|
|
37036
36916
|
}
|
|
37037
|
-
if (
|
|
36917
|
+
if (duplicateResponseParts.length > 0) {
|
|
37038
36918
|
if (executableToolCallRequests.length > 0) {
|
|
37039
36919
|
pendingDuplicateToolResponsesRef.current.push({
|
|
37040
36920
|
executableCallIds: new Set(
|
|
37041
36921
|
executableToolCallRequests.map((request) => request.callId)
|
|
37042
36922
|
),
|
|
37043
36923
|
promptId: duplicatePromptId ?? executableToolCallRequests[0]?.prompt_id,
|
|
37044
|
-
|
|
37045
|
-
duplicateResponses
|
|
36924
|
+
responseParts: duplicateResponseParts
|
|
37046
36925
|
});
|
|
37047
36926
|
} else {
|
|
37048
36927
|
immediateDuplicateToolResponsesRef.current = {
|
|
37049
36928
|
promptId: duplicatePromptId,
|
|
37050
|
-
|
|
36929
|
+
responseParts: duplicateResponseParts
|
|
37051
36930
|
};
|
|
37052
36931
|
}
|
|
37053
36932
|
}
|
|
@@ -37088,38 +36967,14 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37088
36967
|
dualOutput
|
|
37089
36968
|
]
|
|
37090
36969
|
);
|
|
37091
|
-
const resolveSteeredMessages = (0,
|
|
36970
|
+
const resolveSteeredMessages = (0, import_react134.useCallback)(
|
|
37092
36971
|
async (messages, signal) => {
|
|
37093
|
-
const
|
|
36972
|
+
const resolvedMessages = [];
|
|
37094
36973
|
const resolvedForRecording = [];
|
|
37095
|
-
const restoreMessages = [];
|
|
37096
|
-
let pendingGoalSegmentIndex;
|
|
37097
36974
|
const timestamp = Date.now();
|
|
37098
36975
|
for (let index = 0; index < messages.length; index += 1) {
|
|
37099
|
-
if (signal.aborted)
|
|
37100
|
-
restoreMessages.push(...messages.slice(index));
|
|
37101
|
-
break;
|
|
37102
|
-
}
|
|
36976
|
+
if (signal.aborted) break;
|
|
37103
36977
|
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);
|
|
37123
36978
|
const sideEffects = [];
|
|
37124
36979
|
let resolvedQuery = [{ text: message }];
|
|
37125
36980
|
if (isAtCommand(message)) {
|
|
@@ -37182,10 +37037,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37182
37037
|
} finally {
|
|
37183
37038
|
clearTimeout(timeoutId);
|
|
37184
37039
|
}
|
|
37185
|
-
if (signal.aborted)
|
|
37186
|
-
restoreMessages.push(...messages.slice(index + 1));
|
|
37187
|
-
break;
|
|
37188
|
-
}
|
|
37040
|
+
if (signal.aborted) break;
|
|
37189
37041
|
}
|
|
37190
37042
|
const bridgeResult = await applyVisionBridgeIfNeeded(
|
|
37191
37043
|
resolvedQuery,
|
|
@@ -37193,10 +37045,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37193
37045
|
signal
|
|
37194
37046
|
);
|
|
37195
37047
|
if (!bridgeResult.shouldProceed) {
|
|
37196
|
-
if (signal.aborted)
|
|
37197
|
-
restoreMessages.push(...messages.slice(index + 1));
|
|
37198
|
-
break;
|
|
37199
|
-
}
|
|
37048
|
+
if (signal.aborted) break;
|
|
37200
37049
|
continue;
|
|
37201
37050
|
}
|
|
37202
37051
|
const messageParts = normalizePartList(
|
|
@@ -37214,24 +37063,19 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37214
37063
|
)
|
|
37215
37064
|
);
|
|
37216
37065
|
}
|
|
37217
|
-
|
|
37066
|
+
if (resolvedMessages.length > 0 && messageParts.length > 0) {
|
|
37067
|
+
resolvedMessages.push({ text: "\n\n" });
|
|
37068
|
+
}
|
|
37069
|
+
resolvedMessages.push(...messageParts);
|
|
37218
37070
|
resolvedForRecording.push({
|
|
37219
37071
|
message,
|
|
37220
37072
|
parts: messageParts,
|
|
37221
37073
|
sideEffects
|
|
37222
37074
|
});
|
|
37223
37075
|
}
|
|
37224
|
-
|
|
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
|
-
}
|
|
37076
|
+
if (signal.aborted) return void 0;
|
|
37232
37077
|
return {
|
|
37233
37078
|
parts: resolvedMessages,
|
|
37234
|
-
restoreMessages,
|
|
37235
37079
|
accept: /* @__PURE__ */ __name(() => {
|
|
37236
37080
|
for (const { message, parts, sideEffects } of resolvedForRecording) {
|
|
37237
37081
|
for (const sideEffect of sideEffects) sideEffect();
|
|
@@ -37244,25 +37088,17 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37244
37088
|
}, "accept")
|
|
37245
37089
|
};
|
|
37246
37090
|
},
|
|
37247
|
-
[
|
|
37248
|
-
addItem,
|
|
37249
|
-
applyVisionBridgeIfNeeded,
|
|
37250
|
-
config,
|
|
37251
|
-
handleSlashCommand,
|
|
37252
|
-
onDebugMessage
|
|
37253
|
-
]
|
|
37091
|
+
[addItem, applyVisionBridgeIfNeeded, config, onDebugMessage]
|
|
37254
37092
|
);
|
|
37255
|
-
const resolveDrainedSteerMessages = (0,
|
|
37093
|
+
const resolveDrainedSteerMessages = (0, import_react134.useCallback)(
|
|
37256
37094
|
async (messages, signal) => {
|
|
37257
37095
|
try {
|
|
37258
37096
|
const resolved = await resolveSteeredMessages(messages, signal);
|
|
37259
37097
|
if (signal.aborted) {
|
|
37260
|
-
|
|
37261
|
-
midTurnRestoreRef?.current?.(resolved.restoreMessages);
|
|
37262
|
-
}
|
|
37098
|
+
midTurnRestoreRef?.current?.(messages);
|
|
37263
37099
|
return void 0;
|
|
37264
37100
|
}
|
|
37265
|
-
if (resolved.parts.length === 0) return void 0;
|
|
37101
|
+
if (!resolved || resolved.parts.length === 0) return void 0;
|
|
37266
37102
|
let settled = false;
|
|
37267
37103
|
return {
|
|
37268
37104
|
parts: resolved.parts,
|
|
@@ -37274,9 +37110,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37274
37110
|
restore: /* @__PURE__ */ __name(() => {
|
|
37275
37111
|
if (settled) return;
|
|
37276
37112
|
settled = true;
|
|
37277
|
-
|
|
37278
|
-
midTurnRestoreRef?.current?.(resolved.restoreMessages);
|
|
37279
|
-
}
|
|
37113
|
+
midTurnRestoreRef?.current?.(messages);
|
|
37280
37114
|
}, "restore")
|
|
37281
37115
|
};
|
|
37282
37116
|
} catch (error) {
|
|
@@ -37289,7 +37123,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37289
37123
|
},
|
|
37290
37124
|
[midTurnRestoreRef, onDebugMessage, resolveSteeredMessages]
|
|
37291
37125
|
);
|
|
37292
|
-
const drainSteerAtBoundary = (0,
|
|
37126
|
+
const drainSteerAtBoundary = (0, import_react134.useCallback)(
|
|
37293
37127
|
async (signal) => {
|
|
37294
37128
|
const messages = midTurnDrainRef?.current?.() ?? [];
|
|
37295
37129
|
if (messages.length === 0) return void 0;
|
|
@@ -37297,7 +37131,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37297
37131
|
},
|
|
37298
37132
|
[midTurnDrainRef, resolveDrainedSteerMessages]
|
|
37299
37133
|
);
|
|
37300
|
-
const submitQuery = (0,
|
|
37134
|
+
const submitQuery = (0, import_react134.useCallback)(
|
|
37301
37135
|
async (query, submitType = "userQuery" /* UserQuery */, prompt_id, metadata) => {
|
|
37302
37136
|
const allowConcurrentBtwDuringResponse = submitType === "userQuery" /* UserQuery */ && streamingState === "responding" /* Responding */ && typeof query === "string" && isBtwCommand(query);
|
|
37303
37137
|
const isTurnContinuation = submitType === "toolResult" /* ToolResult */ || submitType === "steer" /* Steer */;
|
|
@@ -37408,7 +37242,6 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37408
37242
|
if (!isTurnContinuation) {
|
|
37409
37243
|
streamingResponseLengthRef.current = 0;
|
|
37410
37244
|
}
|
|
37411
|
-
let cleanupReviewLease = false;
|
|
37412
37245
|
try {
|
|
37413
37246
|
if (dualOutput && submitType !== "toolResult" /* ToolResult */) {
|
|
37414
37247
|
const rawParts = typeof finalQueryToSend === "string" ? [finalQueryToSend] : Array.isArray(finalQueryToSend) ? finalQueryToSend : [finalQueryToSend];
|
|
@@ -37435,7 +37268,6 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37435
37268
|
abortSignal
|
|
37436
37269
|
);
|
|
37437
37270
|
if (processingStatus === 1 /* UserCancelled */) {
|
|
37438
|
-
cleanupReviewLease = true;
|
|
37439
37271
|
submitPromptOnCompleteRef.current = null;
|
|
37440
37272
|
isSubmittingQueryRef.current = false;
|
|
37441
37273
|
metadata?.onDeliveryFailed?.();
|
|
@@ -37448,33 +37280,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37448
37280
|
const immediateDuplicateToolResponses = immediateDuplicateToolResponsesRef.current;
|
|
37449
37281
|
if (immediateDuplicateToolResponses) {
|
|
37450
37282
|
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
|
-
);
|
|
37476
37283
|
await submitQuery(
|
|
37477
|
-
responseParts,
|
|
37284
|
+
immediateDuplicateToolResponses.responseParts,
|
|
37478
37285
|
"toolResult" /* ToolResult */,
|
|
37479
37286
|
immediateDuplicateToolResponses.promptId
|
|
37480
37287
|
);
|
|
@@ -37484,7 +37291,6 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37484
37291
|
}
|
|
37485
37292
|
const loopDetected = loopDetectedRef.current;
|
|
37486
37293
|
if (loopDetected) {
|
|
37487
|
-
cleanupReviewLease = true;
|
|
37488
37294
|
loopDetectedRef.current = false;
|
|
37489
37295
|
handleLoopDetectedEvent();
|
|
37490
37296
|
}
|
|
@@ -37518,7 +37324,6 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37518
37324
|
}
|
|
37519
37325
|
}
|
|
37520
37326
|
} catch (error) {
|
|
37521
|
-
cleanupReviewLease = true;
|
|
37522
37327
|
metadata?.onDeliveryFailed?.();
|
|
37523
37328
|
if (error instanceof UnauthorizedError) {
|
|
37524
37329
|
onAuthError("Session expired or is unauthorized.");
|
|
@@ -37535,13 +37340,6 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37535
37340
|
});
|
|
37536
37341
|
}
|
|
37537
37342
|
} finally {
|
|
37538
|
-
if (cleanupReviewLease) {
|
|
37539
|
-
cleanupReviewWorktreeLeases({
|
|
37540
|
-
sessionId: config.getSessionId(),
|
|
37541
|
-
promptId: prompt_id,
|
|
37542
|
-
repositoryRoot: config.getProjectRoot()
|
|
37543
|
-
});
|
|
37544
|
-
}
|
|
37545
37343
|
submitPromptOnCompleteRef.current = null;
|
|
37546
37344
|
activeModelStreamsRef.current = Math.max(
|
|
37547
37345
|
0,
|
|
@@ -37580,7 +37378,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37580
37378
|
midTurnDrainRef
|
|
37581
37379
|
]
|
|
37582
37380
|
);
|
|
37583
|
-
const retryLastPrompt = (0,
|
|
37381
|
+
const retryLastPrompt = (0, import_react134.useCallback)(async () => {
|
|
37584
37382
|
if (skipRetryDelayRef.current) {
|
|
37585
37383
|
skipRetryDelayRef.current();
|
|
37586
37384
|
skipRetryDelayRef.current = null;
|
|
@@ -37604,7 +37402,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37604
37402
|
clearRetryCountdown();
|
|
37605
37403
|
await submitQuery(lastPrompt, "retry" /* Retry */);
|
|
37606
37404
|
}, [streamingState, addItem, clearRetryCountdown, submitQuery]);
|
|
37607
|
-
const handleApprovalModeChange = (0,
|
|
37405
|
+
const handleApprovalModeChange = (0, import_react134.useCallback)(
|
|
37608
37406
|
async (newApprovalMode) => {
|
|
37609
37407
|
if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "auto-edit" /* AUTO_EDIT */) {
|
|
37610
37408
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
@@ -37639,7 +37437,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37639
37437
|
},
|
|
37640
37438
|
[toolCalls]
|
|
37641
37439
|
);
|
|
37642
|
-
const handleCompletedTools = (0,
|
|
37440
|
+
const handleCompletedTools = (0, import_react134.useCallback)(
|
|
37643
37441
|
async (completedToolCallsFromScheduler) => {
|
|
37644
37442
|
const completedAndReadyToSubmitTools = completedToolCallsFromScheduler.filter(
|
|
37645
37443
|
(tc) => {
|
|
@@ -37719,8 +37517,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37719
37517
|
}
|
|
37720
37518
|
return !isReady;
|
|
37721
37519
|
});
|
|
37722
|
-
const
|
|
37723
|
-
(batch) => batch.
|
|
37520
|
+
const pendingDuplicateResponseParts = readyDuplicateBatches.flatMap(
|
|
37521
|
+
(batch) => batch.responseParts
|
|
37724
37522
|
);
|
|
37725
37523
|
const pendingDuplicatePromptId = readyDuplicateBatches[0]?.promptId;
|
|
37726
37524
|
for (const toolCall of geminiTools) {
|
|
@@ -37729,67 +37527,9 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37729
37527
|
toolCall.request.args
|
|
37730
37528
|
);
|
|
37731
37529
|
}
|
|
37732
|
-
if (geminiTools.length === 0 &&
|
|
37530
|
+
if (geminiTools.length === 0 && pendingDuplicateResponseParts.length === 0) {
|
|
37733
37531
|
return;
|
|
37734
37532
|
}
|
|
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
|
-
});
|
|
37793
37533
|
if (turnCancelledRef.current || abortControllerRef.current?.signal.aborted) {
|
|
37794
37534
|
markToolsAsSubmitted(
|
|
37795
37535
|
geminiTools.map((toolCall) => toolCall.request.callId)
|
|
@@ -37799,11 +37539,14 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37799
37539
|
const allToolsCancelled = geminiTools.every(
|
|
37800
37540
|
(tc) => tc.status === "cancelled"
|
|
37801
37541
|
);
|
|
37802
|
-
if (allToolsCancelled &&
|
|
37542
|
+
if (allToolsCancelled && pendingDuplicateResponseParts.length === 0) {
|
|
37803
37543
|
if (geminiClient) {
|
|
37544
|
+
const combinedParts = geminiTools.flatMap(
|
|
37545
|
+
(toolCall) => toolCall.response.responseParts
|
|
37546
|
+
);
|
|
37804
37547
|
geminiClient.addHistory({
|
|
37805
37548
|
role: "user",
|
|
37806
|
-
parts:
|
|
37549
|
+
parts: combinedParts
|
|
37807
37550
|
});
|
|
37808
37551
|
config.getArenaAgentClient()?.reportCancelled();
|
|
37809
37552
|
}
|
|
@@ -37813,6 +37556,10 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37813
37556
|
markToolsAsSubmitted(callIdsToMarkAsSubmitted2);
|
|
37814
37557
|
return;
|
|
37815
37558
|
}
|
|
37559
|
+
const responsesToSend = geminiTools.flatMap(
|
|
37560
|
+
(toolCall) => toolCall.response.responseParts
|
|
37561
|
+
);
|
|
37562
|
+
responsesToSend.push(...pendingDuplicateResponseParts);
|
|
37816
37563
|
const callIdsToMarkAsSubmitted = geminiTools.map(
|
|
37817
37564
|
(toolCall) => toolCall.request.callId
|
|
37818
37565
|
);
|
|
@@ -37941,7 +37688,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37941
37688
|
resolveDrainedSteerMessages
|
|
37942
37689
|
]
|
|
37943
37690
|
);
|
|
37944
|
-
const pendingHistoryItems = (0,
|
|
37691
|
+
const pendingHistoryItems = (0, import_react134.useMemo)(
|
|
37945
37692
|
() => [
|
|
37946
37693
|
// Reasoning renders above the streaming answer.
|
|
37947
37694
|
pendingThoughtItem,
|
|
@@ -37958,7 +37705,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
37958
37705
|
pendingToolCallGroupDisplay
|
|
37959
37706
|
]
|
|
37960
37707
|
);
|
|
37961
|
-
(0,
|
|
37708
|
+
(0, import_react134.useEffect)(() => {
|
|
37962
37709
|
const saveRestorableToolCalls = /* @__PURE__ */ __name(async () => {
|
|
37963
37710
|
if (!config.getFileCheckpointingEnabled()) {
|
|
37964
37711
|
return;
|
|
@@ -38029,14 +37776,14 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38029
37776
|
}, "saveRestorableToolCalls");
|
|
38030
37777
|
saveRestorableToolCalls();
|
|
38031
37778
|
}, [toolCalls, config, onDebugMessage, history, geminiClient, storage]);
|
|
38032
|
-
const notificationQueueRef = (0,
|
|
38033
|
-
const [notificationTrigger, setNotificationTrigger] = (0,
|
|
38034
|
-
const getAutonomousLoopTickResolver = (0,
|
|
37779
|
+
const notificationQueueRef = (0, import_react134.useRef)([]);
|
|
37780
|
+
const [notificationTrigger, setNotificationTrigger] = (0, import_react134.useState)(0);
|
|
37781
|
+
const getAutonomousLoopTickResolver = (0, import_react134.useCallback)(() => {
|
|
38035
37782
|
autonomousLoopTickResolverRef.current ??= new AutonomousLoopTickResolver();
|
|
38036
37783
|
return autonomousLoopTickResolverRef.current;
|
|
38037
37784
|
}, []);
|
|
38038
|
-
const notificationQueueSessionIdRef = (0,
|
|
38039
|
-
(0,
|
|
37785
|
+
const notificationQueueSessionIdRef = (0, import_react134.useRef)(sessionStates.sessionId);
|
|
37786
|
+
(0, import_react134.useEffect)(() => {
|
|
38040
37787
|
if (notificationQueueSessionIdRef.current === sessionStates.sessionId) {
|
|
38041
37788
|
return;
|
|
38042
37789
|
}
|
|
@@ -38044,9 +37791,9 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38044
37791
|
notificationQueueRef.current = [];
|
|
38045
37792
|
autonomousLoopTickResolverRef.current?.resetCache();
|
|
38046
37793
|
}, [sessionStates.sessionId]);
|
|
38047
|
-
const cronSessionIdRef = (0,
|
|
37794
|
+
const cronSessionIdRef = (0, import_react134.useRef)(sessionStates.sessionId);
|
|
38048
37795
|
cronSessionIdRef.current = sessionStates.sessionId;
|
|
38049
|
-
(0,
|
|
37796
|
+
(0, import_react134.useEffect)(() => {
|
|
38050
37797
|
if (!isConfigInitialized) return;
|
|
38051
37798
|
if (!config.isCronEnabled()) return;
|
|
38052
37799
|
const scheduler = config.getCronScheduler();
|
|
@@ -38099,7 +37846,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38099
37846
|
}
|
|
38100
37847
|
};
|
|
38101
37848
|
}, [config, getAutonomousLoopTickResolver, isConfigInitialized]);
|
|
38102
|
-
(0,
|
|
37849
|
+
(0, import_react134.useEffect)(() => {
|
|
38103
37850
|
const registry = config.getBackgroundTaskRegistry();
|
|
38104
37851
|
registry.setNotificationCallback((displayText, modelText) => {
|
|
38105
37852
|
notificationQueueRef.current.push({
|
|
@@ -38113,7 +37860,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38113
37860
|
registry.setNotificationCallback(void 0);
|
|
38114
37861
|
};
|
|
38115
37862
|
}, [config]);
|
|
38116
|
-
(0,
|
|
37863
|
+
(0, import_react134.useEffect)(() => {
|
|
38117
37864
|
const registry = config.getBackgroundShellRegistry();
|
|
38118
37865
|
registry.setNotificationCallback((displayText, modelText) => {
|
|
38119
37866
|
notificationQueueRef.current.push({
|
|
@@ -38127,7 +37874,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38127
37874
|
registry.setNotificationCallback(void 0);
|
|
38128
37875
|
};
|
|
38129
37876
|
}, [config]);
|
|
38130
|
-
(0,
|
|
37877
|
+
(0, import_react134.useEffect)(() => {
|
|
38131
37878
|
const registry = config.getMonitorRegistry();
|
|
38132
37879
|
registry.setNotificationCallback((displayText, modelText, meta) => {
|
|
38133
37880
|
if (meta.status === "running" && typeof registry.get === "function") {
|
|
@@ -38145,47 +37892,42 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38145
37892
|
registry.setNotificationCallback(void 0);
|
|
38146
37893
|
};
|
|
38147
37894
|
}, [config]);
|
|
38148
|
-
(0,
|
|
37895
|
+
(0, import_react134.useEffect)(() => {
|
|
38149
37896
|
if (streamingState === "idle" /* Idle */ && !isSubmittingQueryRef.current && notificationQueueRef.current.length > 0) {
|
|
38150
|
-
|
|
38151
|
-
|
|
38152
|
-
|
|
38153
|
-
|
|
38154
|
-
|
|
38155
|
-
|
|
38156
|
-
|
|
38157
|
-
|
|
38158
|
-
|
|
38159
|
-
|
|
38160
|
-
|
|
38161
|
-
|
|
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
|
|
37897
|
+
const queue = notificationQueueRef.current;
|
|
37898
|
+
const targetType = queue[0].sendMessageType;
|
|
37899
|
+
if (targetType === "cron" /* Cron */) {
|
|
37900
|
+
const item = queue.shift();
|
|
37901
|
+
addItem(
|
|
37902
|
+
{ type: "notification", text: item.displayText },
|
|
37903
|
+
Date.now()
|
|
37904
|
+
);
|
|
37905
|
+
submitQuery(item.modelText, item.sendMessageType, void 0, {
|
|
37906
|
+
notificationDisplayText: item.displayText,
|
|
37907
|
+
onDelivered: item.onDelivered,
|
|
37908
|
+
onDeliveryFailed: item.onDeliveryFailed
|
|
38182
37909
|
});
|
|
37910
|
+
return;
|
|
37911
|
+
}
|
|
37912
|
+
let splitIdx = 0;
|
|
37913
|
+
while (splitIdx < queue.length && queue[splitIdx].sendMessageType === targetType) {
|
|
37914
|
+
splitIdx++;
|
|
37915
|
+
}
|
|
37916
|
+
const batch = queue.splice(0, splitIdx);
|
|
37917
|
+
const now = Date.now();
|
|
37918
|
+
for (const item of batch) {
|
|
37919
|
+
addItem({ type: "notification", text: item.displayText }, now);
|
|
37920
|
+
}
|
|
37921
|
+
const combinedModelText = batch.map((e) => e.modelText).join("\n\n");
|
|
37922
|
+
const combinedDisplayText = batch.map((e) => e.displayText).join("; ");
|
|
37923
|
+
submitQuery(combinedModelText, targetType, void 0, {
|
|
37924
|
+
notificationDisplayText: combinedDisplayText
|
|
38183
37925
|
});
|
|
38184
37926
|
}
|
|
38185
37927
|
}, [streamingState, submitQuery, notificationTrigger, addItem]);
|
|
38186
|
-
const teammateQueueRef = (0,
|
|
38187
|
-
const [teammateTrigger, setTeammateTrigger] = (0,
|
|
38188
|
-
(0,
|
|
37928
|
+
const teammateQueueRef = (0, import_react134.useRef)([]);
|
|
37929
|
+
const [teammateTrigger, setTeammateTrigger] = (0, import_react134.useState)(0);
|
|
37930
|
+
(0, import_react134.useEffect)(() => {
|
|
38189
37931
|
let boundManager = null;
|
|
38190
37932
|
const handleManagerChange = /* @__PURE__ */ __name((manager) => {
|
|
38191
37933
|
if (boundManager && boundManager !== manager) {
|
|
@@ -38215,7 +37957,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38215
37957
|
}
|
|
38216
37958
|
};
|
|
38217
37959
|
}, [config]);
|
|
38218
|
-
(0,
|
|
37960
|
+
(0, import_react134.useEffect)(() => {
|
|
38219
37961
|
if (streamingState === "idle" /* Idle */ && !isSubmittingQueryRef.current && teammateQueueRef.current.length > 0) {
|
|
38220
37962
|
const batch = teammateQueueRef.current.splice(0);
|
|
38221
37963
|
for (const entry of batch) {
|
|
@@ -38250,7 +37992,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
38250
37992
|
|
|
38251
37993
|
// packages/cli/src/ui/hooks/vim.ts
|
|
38252
37994
|
init_esbuild_shims();
|
|
38253
|
-
var
|
|
37995
|
+
var import_react135 = __toESM(require_react(), 1);
|
|
38254
37996
|
import { execFile as execFile7, execFileSync as execFileSync2 } from "child_process";
|
|
38255
37997
|
var DIGIT_MULTIPLIER = 10;
|
|
38256
37998
|
var DEFAULT_COUNT = 1;
|
|
@@ -38486,26 +38228,26 @@ __name(findCharInLineReverse, "findCharInLineReverse");
|
|
|
38486
38228
|
function useVim(buffer, onSubmit) {
|
|
38487
38229
|
const { vimEnabled, vimMode } = useVimModeState();
|
|
38488
38230
|
const { setVimMode } = useVimModeActions();
|
|
38489
|
-
const [state, dispatch] = (0,
|
|
38490
|
-
const bufferRef = (0,
|
|
38491
|
-
const stateRef = (0,
|
|
38231
|
+
const [state, dispatch] = (0, import_react135.useReducer)(vimReducer, initialVimState);
|
|
38232
|
+
const bufferRef = (0, import_react135.useRef)(buffer);
|
|
38233
|
+
const stateRef = (0, import_react135.useRef)(state);
|
|
38492
38234
|
bufferRef.current = buffer;
|
|
38493
38235
|
stateRef.current = state;
|
|
38494
|
-
(0,
|
|
38236
|
+
(0, import_react135.useEffect)(() => {
|
|
38495
38237
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
38496
38238
|
}, [vimMode]);
|
|
38497
|
-
const updateMode = (0,
|
|
38239
|
+
const updateMode = (0, import_react135.useCallback)(
|
|
38498
38240
|
(mode) => {
|
|
38499
38241
|
setVimMode(mode);
|
|
38500
38242
|
dispatch({ type: "SET_MODE", mode });
|
|
38501
38243
|
},
|
|
38502
38244
|
[setVimMode]
|
|
38503
38245
|
);
|
|
38504
|
-
const getCurrentCount = (0,
|
|
38246
|
+
const getCurrentCount = (0, import_react135.useCallback)(
|
|
38505
38247
|
() => stateRef.current.count || DEFAULT_COUNT,
|
|
38506
38248
|
[]
|
|
38507
38249
|
);
|
|
38508
|
-
const yankRange = (0,
|
|
38250
|
+
const yankRange = (0, import_react135.useCallback)(
|
|
38509
38251
|
(startRow, startCol, endRow, endCol, linewise) => {
|
|
38510
38252
|
const lines = bufferRef.current.lines;
|
|
38511
38253
|
let text = "";
|
|
@@ -38520,7 +38262,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38520
38262
|
},
|
|
38521
38263
|
[]
|
|
38522
38264
|
);
|
|
38523
|
-
const executeCommand = (0,
|
|
38265
|
+
const executeCommand = (0, import_react135.useCallback)(
|
|
38524
38266
|
(cmdType, count) => {
|
|
38525
38267
|
switch (cmdType) {
|
|
38526
38268
|
case CMD_TYPES.DELETE_WORD_FORWARD:
|
|
@@ -38921,7 +38663,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38921
38663
|
return { text, linewise: movement === "j" || movement === "k" };
|
|
38922
38664
|
}
|
|
38923
38665
|
__name(extractMovementText, "extractMovementText");
|
|
38924
|
-
const executeFind = (0,
|
|
38666
|
+
const executeFind = (0, import_react135.useCallback)(
|
|
38925
38667
|
(findType, char, count = 1) => {
|
|
38926
38668
|
const [startRow, startCol] = buffer.cursor;
|
|
38927
38669
|
const line = buffer.lines[startRow] ?? "";
|
|
@@ -38957,7 +38699,7 @@ function useVim(buffer, onSubmit) {
|
|
|
38957
38699
|
},
|
|
38958
38700
|
[buffer, dispatch]
|
|
38959
38701
|
);
|
|
38960
|
-
const handleCharRead = (0,
|
|
38702
|
+
const handleCharRead = (0, import_react135.useCallback)(
|
|
38961
38703
|
(char) => {
|
|
38962
38704
|
const readType = state.pendingCharRead;
|
|
38963
38705
|
if (!readType) return false;
|
|
@@ -39000,7 +38742,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39000
38742
|
},
|
|
39001
38743
|
[state.pendingCharRead, buffer, dispatch, executeFind]
|
|
39002
38744
|
);
|
|
39003
|
-
const handleInsertModeInput = (0,
|
|
38745
|
+
const handleInsertModeInput = (0, import_react135.useCallback)(
|
|
39004
38746
|
(normalizedKey) => {
|
|
39005
38747
|
if (normalizedKey.name === "escape") {
|
|
39006
38748
|
buffer.vimEscapeInsertMode();
|
|
@@ -39031,7 +38773,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39031
38773
|
},
|
|
39032
38774
|
[buffer, dispatch, updateMode, onSubmit]
|
|
39033
38775
|
);
|
|
39034
|
-
const normalizeKey = (0,
|
|
38776
|
+
const normalizeKey = (0, import_react135.useCallback)(
|
|
39035
38777
|
(key) => ({
|
|
39036
38778
|
name: key.name || "",
|
|
39037
38779
|
sequence: key.sequence || "",
|
|
@@ -39042,7 +38784,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39042
38784
|
}),
|
|
39043
38785
|
[]
|
|
39044
38786
|
);
|
|
39045
|
-
const handleChangeMovement = (0,
|
|
38787
|
+
const handleChangeMovement = (0, import_react135.useCallback)(
|
|
39046
38788
|
(movement) => {
|
|
39047
38789
|
const count = getCurrentCount();
|
|
39048
38790
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -39063,7 +38805,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39063
38805
|
},
|
|
39064
38806
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
39065
38807
|
);
|
|
39066
|
-
const handleDeleteMovement = (0,
|
|
38808
|
+
const handleDeleteMovement = (0, import_react135.useCallback)(
|
|
39067
38809
|
(movement) => {
|
|
39068
38810
|
const count = getCurrentCount();
|
|
39069
38811
|
const [row, col] = bufferRef.current.cursor;
|
|
@@ -39098,7 +38840,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39098
38840
|
},
|
|
39099
38841
|
[getCurrentCount, dispatch, buffer]
|
|
39100
38842
|
);
|
|
39101
|
-
const handleYankMovement = (0,
|
|
38843
|
+
const handleYankMovement = (0, import_react135.useCallback)(
|
|
39102
38844
|
(movement) => {
|
|
39103
38845
|
const count = getCurrentCount();
|
|
39104
38846
|
const [row, col] = bufferRef.current.cursor;
|
|
@@ -39132,7 +38874,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39132
38874
|
},
|
|
39133
38875
|
[getCurrentCount, dispatch]
|
|
39134
38876
|
);
|
|
39135
|
-
const handleOperatorMotion = (0,
|
|
38877
|
+
const handleOperatorMotion = (0, import_react135.useCallback)(
|
|
39136
38878
|
(operator, motion) => {
|
|
39137
38879
|
const count = getCurrentCount();
|
|
39138
38880
|
const commandMap = {
|
|
@@ -39164,7 +38906,7 @@ function useVim(buffer, onSubmit) {
|
|
|
39164
38906
|
},
|
|
39165
38907
|
[getCurrentCount, executeCommand, dispatch]
|
|
39166
38908
|
);
|
|
39167
|
-
const handleInput = (0,
|
|
38909
|
+
const handleInput = (0, import_react135.useCallback)(
|
|
39168
38910
|
(key) => {
|
|
39169
38911
|
if (!vimEnabled) {
|
|
39170
38912
|
return false;
|
|
@@ -39886,7 +39628,7 @@ __name(buildWorkflowSteeringNotice, "buildWorkflowSteeringNotice");
|
|
|
39886
39628
|
|
|
39887
39629
|
// packages/cli/src/ui/hooks/useAwaySummary.ts
|
|
39888
39630
|
init_esbuild_shims();
|
|
39889
|
-
var
|
|
39631
|
+
var import_react136 = __toESM(require_react(), 1);
|
|
39890
39632
|
var DEFAULT_AWAY_THRESHOLD_MINUTES = 5;
|
|
39891
39633
|
var MIN_USER_MESSAGES_TO_FIRE = 3;
|
|
39892
39634
|
var MIN_USER_MESSAGES_SINCE_LAST_RECAP = 2;
|
|
@@ -39917,15 +39659,15 @@ function useAwaySummary(options) {
|
|
|
39917
39659
|
history,
|
|
39918
39660
|
awayThresholdMinutes
|
|
39919
39661
|
} = options;
|
|
39920
|
-
const blurredAtRef = (0,
|
|
39921
|
-
const recapPendingRef = (0,
|
|
39922
|
-
const inFlightRef = (0,
|
|
39923
|
-
const isIdleRef = (0,
|
|
39662
|
+
const blurredAtRef = (0, import_react136.useRef)(null);
|
|
39663
|
+
const recapPendingRef = (0, import_react136.useRef)(false);
|
|
39664
|
+
const inFlightRef = (0, import_react136.useRef)(null);
|
|
39665
|
+
const isIdleRef = (0, import_react136.useRef)(isIdle);
|
|
39924
39666
|
isIdleRef.current = isIdle;
|
|
39925
|
-
const historyRef = (0,
|
|
39667
|
+
const historyRef = (0, import_react136.useRef)(history);
|
|
39926
39668
|
historyRef.current = history;
|
|
39927
39669
|
const thresholdMs = (awayThresholdMinutes && awayThresholdMinutes > 0 ? awayThresholdMinutes : DEFAULT_AWAY_THRESHOLD_MINUTES) * 60 * 1e3;
|
|
39928
|
-
(0,
|
|
39670
|
+
(0, import_react136.useEffect)(() => {
|
|
39929
39671
|
if (!enabled || !config) {
|
|
39930
39672
|
inFlightRef.current?.abort();
|
|
39931
39673
|
inFlightRef.current = null;
|
|
@@ -39977,7 +39719,7 @@ function useAwaySummary(options) {
|
|
|
39977
39719
|
recapPendingRef.current = false;
|
|
39978
39720
|
});
|
|
39979
39721
|
}, [enabled, config, isFocused, isIdle, addItem, thresholdMs]);
|
|
39980
|
-
(0,
|
|
39722
|
+
(0, import_react136.useEffect)(
|
|
39981
39723
|
() => () => {
|
|
39982
39724
|
inFlightRef.current?.abort();
|
|
39983
39725
|
},
|
|
@@ -39988,14 +39730,14 @@ __name(useAwaySummary, "useAwaySummary");
|
|
|
39988
39730
|
|
|
39989
39731
|
// packages/cli/src/ui/hooks/useBracketedPaste.ts
|
|
39990
39732
|
init_esbuild_shims();
|
|
39991
|
-
var
|
|
39733
|
+
var import_react137 = __toESM(require_react(), 1);
|
|
39992
39734
|
var ENABLE_BRACKETED_PASTE = "\x1B[?2004h";
|
|
39993
39735
|
var DISABLE_BRACKETED_PASTE = "\x1B[?2004l";
|
|
39994
39736
|
var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
39995
39737
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
39996
39738
|
process.stdout.write(DISABLE_BRACKETED_PASTE);
|
|
39997
39739
|
}, "cleanup");
|
|
39998
|
-
(0,
|
|
39740
|
+
(0, import_react137.useEffect)(() => {
|
|
39999
39741
|
process.stdout.write(ENABLE_BRACKETED_PASTE);
|
|
40000
39742
|
process.on("exit", cleanup);
|
|
40001
39743
|
process.on("SIGINT", cleanup);
|
|
@@ -40014,23 +39756,23 @@ init_esbuild_shims();
|
|
|
40014
39756
|
|
|
40015
39757
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
40016
39758
|
init_esbuild_shims();
|
|
40017
|
-
var
|
|
39759
|
+
var import_react138 = __toESM(require_react(), 1);
|
|
40018
39760
|
var WITTY_LOADING_PHRASES = ["I'm Feeling Lucky"];
|
|
40019
39761
|
var PHRASE_CHANGE_INTERVAL_MS = 15e3;
|
|
40020
39762
|
var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases) => {
|
|
40021
39763
|
const currentLanguage = getCurrentLanguage();
|
|
40022
|
-
const loadingPhrases = (0,
|
|
39764
|
+
const loadingPhrases = (0, import_react138.useMemo)(() => {
|
|
40023
39765
|
if (customPhrases && customPhrases.length > 0) {
|
|
40024
39766
|
return customPhrases;
|
|
40025
39767
|
}
|
|
40026
39768
|
const translatedPhrases = ta("WITTY_LOADING_PHRASES");
|
|
40027
39769
|
return translatedPhrases.length > 0 ? translatedPhrases : WITTY_LOADING_PHRASES;
|
|
40028
39770
|
}, [customPhrases, currentLanguage]);
|
|
40029
|
-
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0,
|
|
39771
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0, import_react138.useState)(
|
|
40030
39772
|
loadingPhrases[0]
|
|
40031
39773
|
);
|
|
40032
|
-
const phraseIntervalRef = (0,
|
|
40033
|
-
(0,
|
|
39774
|
+
const phraseIntervalRef = (0, import_react138.useRef)(null);
|
|
39775
|
+
(0, import_react138.useEffect)(() => {
|
|
40034
39776
|
if (isWaiting) {
|
|
40035
39777
|
setCurrentLoadingPhrase(t("Waiting for user confirmation..."));
|
|
40036
39778
|
if (phraseIntervalRef.current) {
|
|
@@ -40067,9 +39809,9 @@ var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases
|
|
|
40067
39809
|
}, "usePhraseCycler");
|
|
40068
39810
|
|
|
40069
39811
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
40070
|
-
var
|
|
39812
|
+
var import_react139 = __toESM(require_react(), 1);
|
|
40071
39813
|
var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhrases, currentCandidatesTokens, currentStreamingChars, isToolExecuting2 = false) => {
|
|
40072
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
39814
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react139.useState)(0);
|
|
40073
39815
|
const isTimerActive = streamingState === "responding" /* Responding */;
|
|
40074
39816
|
const elapsedTimeFromTimer = useTimer(
|
|
40075
39817
|
isTimerActive,
|
|
@@ -40083,17 +39825,17 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
40083
39825
|
isWaiting,
|
|
40084
39826
|
customWittyPhrases
|
|
40085
39827
|
);
|
|
40086
|
-
const [retainedElapsedTime, setRetainedElapsedTime] = (0,
|
|
40087
|
-
const [taskStartTokens, setTaskStartTokensState] = (0,
|
|
40088
|
-
const [taskStartStreamingChars, setTaskStartStreamingCharsState] = (0,
|
|
40089
|
-
const taskStartTokensRef = (0,
|
|
40090
|
-
const taskStartStreamingCharsRef = (0,
|
|
40091
|
-
const pauseStartTokensRef = (0,
|
|
40092
|
-
const pauseStartStreamingCharsRef = (0,
|
|
40093
|
-
const pauseBaseTaskStartTokensRef = (0,
|
|
40094
|
-
const pauseBaseTaskStartStreamingCharsRef = (0,
|
|
40095
|
-
const prevStreamingStateRef = (0,
|
|
40096
|
-
(0,
|
|
39828
|
+
const [retainedElapsedTime, setRetainedElapsedTime] = (0, import_react139.useState)(0);
|
|
39829
|
+
const [taskStartTokens, setTaskStartTokensState] = (0, import_react139.useState)(0);
|
|
39830
|
+
const [taskStartStreamingChars, setTaskStartStreamingCharsState] = (0, import_react139.useState)(0);
|
|
39831
|
+
const taskStartTokensRef = (0, import_react139.useRef)(0);
|
|
39832
|
+
const taskStartStreamingCharsRef = (0, import_react139.useRef)(0);
|
|
39833
|
+
const pauseStartTokensRef = (0, import_react139.useRef)(null);
|
|
39834
|
+
const pauseStartStreamingCharsRef = (0, import_react139.useRef)(null);
|
|
39835
|
+
const pauseBaseTaskStartTokensRef = (0, import_react139.useRef)(0);
|
|
39836
|
+
const pauseBaseTaskStartStreamingCharsRef = (0, import_react139.useRef)(0);
|
|
39837
|
+
const prevStreamingStateRef = (0, import_react139.useRef)(null);
|
|
39838
|
+
(0, import_react139.useEffect)(() => {
|
|
40097
39839
|
const currentTokens = currentCandidatesTokens ?? 0;
|
|
40098
39840
|
const currentChars = currentStreamingChars ?? 0;
|
|
40099
39841
|
const setTaskStartTokens = /* @__PURE__ */ __name((tokens) => {
|
|
@@ -40164,7 +39906,7 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
40164
39906
|
|
|
40165
39907
|
// packages/cli/src/ui/hooks/useTerminalProgress.ts
|
|
40166
39908
|
init_esbuild_shims();
|
|
40167
|
-
var
|
|
39909
|
+
var import_react140 = __toESM(require_react(), 1);
|
|
40168
39910
|
var PROGRESS_CLEAR = wrapForMultiplexer(`${OSC_PREFIX}9;4;0;${BEL}`);
|
|
40169
39911
|
var PROGRESS_INDETERMINATE = wrapForMultiplexer(`${OSC_PREFIX}9;4;3;;${BEL}`);
|
|
40170
39912
|
function isProgressBarSupported() {
|
|
@@ -40179,13 +39921,13 @@ function isProgressBarSupported() {
|
|
|
40179
39921
|
__name(isProgressBarSupported, "isProgressBarSupported");
|
|
40180
39922
|
function useTerminalProgress(streamingState, hasToolExecuting) {
|
|
40181
39923
|
const { stdout } = use_stdout_default();
|
|
40182
|
-
const writeProgress = (0,
|
|
39924
|
+
const writeProgress = (0, import_react140.useCallback)(
|
|
40183
39925
|
(seq) => {
|
|
40184
39926
|
stdout?.write(seq);
|
|
40185
39927
|
},
|
|
40186
39928
|
[stdout]
|
|
40187
39929
|
);
|
|
40188
|
-
(0,
|
|
39930
|
+
(0, import_react140.useEffect)(() => {
|
|
40189
39931
|
if (!isProgressBarSupported()) return;
|
|
40190
39932
|
if (streamingState === "responding" /* Responding */ && hasToolExecuting) {
|
|
40191
39933
|
writeProgress(PROGRESS_INDETERMINATE);
|
|
@@ -40196,7 +39938,7 @@ function useTerminalProgress(streamingState, hasToolExecuting) {
|
|
|
40196
39938
|
writeProgress(PROGRESS_CLEAR);
|
|
40197
39939
|
};
|
|
40198
39940
|
}, [streamingState, hasToolExecuting, writeProgress]);
|
|
40199
|
-
(0,
|
|
39941
|
+
(0, import_react140.useEffect)(() => {
|
|
40200
39942
|
if (!isProgressBarSupported()) return;
|
|
40201
39943
|
const clearOnExit = /* @__PURE__ */ __name(() => {
|
|
40202
39944
|
stdout?.write(PROGRESS_CLEAR);
|
|
@@ -40211,20 +39953,20 @@ __name(useTerminalProgress, "useTerminalProgress");
|
|
|
40211
39953
|
|
|
40212
39954
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
40213
39955
|
init_esbuild_shims();
|
|
40214
|
-
var
|
|
39956
|
+
var import_react141 = __toESM(require_react(), 1);
|
|
40215
39957
|
import * as process15 from "node:process";
|
|
40216
39958
|
var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
40217
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
40218
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
40219
|
-
const [isRestarting, setIsRestarting] = (0,
|
|
39959
|
+
const [isTrusted, setIsTrusted] = (0, import_react141.useState)(void 0);
|
|
39960
|
+
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0, import_react141.useState)(false);
|
|
39961
|
+
const [isRestarting, setIsRestarting] = (0, import_react141.useState)(false);
|
|
40220
39962
|
const folderTrust = settings.merged.security?.folderTrust?.enabled;
|
|
40221
|
-
(0,
|
|
39963
|
+
(0, import_react141.useEffect)(() => {
|
|
40222
39964
|
const { isTrusted: trusted } = isWorkspaceTrusted(settings.merged);
|
|
40223
39965
|
setIsTrusted(trusted);
|
|
40224
39966
|
setIsFolderTrustDialogOpen(trusted === void 0);
|
|
40225
39967
|
onTrustChange(trusted);
|
|
40226
39968
|
}, [folderTrust, onTrustChange, settings.merged]);
|
|
40227
|
-
const handleFolderTrustSelect = (0,
|
|
39969
|
+
const handleFolderTrustSelect = (0, import_react141.useCallback)(
|
|
40228
39970
|
(choice) => {
|
|
40229
39971
|
const trustedFolders = loadTrustedFolders();
|
|
40230
39972
|
const cwd3 = process15.cwd();
|
|
@@ -40267,7 +40009,7 @@ var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
|
40267
40009
|
|
|
40268
40010
|
// packages/cli/src/ui/hooks/useMcpApproval.ts
|
|
40269
40011
|
init_esbuild_shims();
|
|
40270
|
-
var
|
|
40012
|
+
var import_react142 = __toESM(require_react(), 1);
|
|
40271
40013
|
function sourceLabel(scope) {
|
|
40272
40014
|
switch (scope) {
|
|
40273
40015
|
case "workspace":
|
|
@@ -40303,8 +40045,8 @@ function summarize(config) {
|
|
|
40303
40045
|
}
|
|
40304
40046
|
__name(summarize, "summarize");
|
|
40305
40047
|
var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
40306
|
-
const [queue, setQueue] = (0,
|
|
40307
|
-
const computePending = (0,
|
|
40048
|
+
const [queue, setQueue] = (0, import_react142.useState)([]);
|
|
40049
|
+
const computePending = (0, import_react142.useCallback)(() => {
|
|
40308
40050
|
if (config.getApprovalMode() === "yolo" /* YOLO */) return [];
|
|
40309
40051
|
const servers = config.getMcpServers() ?? {};
|
|
40310
40052
|
const approvals = loadMcpApprovals();
|
|
@@ -40316,10 +40058,10 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40316
40058
|
source: sourceLabel(c.scope)
|
|
40317
40059
|
}));
|
|
40318
40060
|
}, [config]);
|
|
40319
|
-
(0,
|
|
40061
|
+
(0, import_react142.useEffect)(() => {
|
|
40320
40062
|
setQueue(computePending());
|
|
40321
40063
|
}, [computePending]);
|
|
40322
|
-
(0,
|
|
40064
|
+
(0, import_react142.useEffect)(() => {
|
|
40323
40065
|
const onPendingChanged = /* @__PURE__ */ __name(() => {
|
|
40324
40066
|
setQueue(computePending());
|
|
40325
40067
|
}, "onPendingChanged");
|
|
@@ -40328,7 +40070,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40328
40070
|
appEvents.off("mcp-pending-approval-changed" /* McpPendingApprovalChanged */, onPendingChanged);
|
|
40329
40071
|
};
|
|
40330
40072
|
}, [computePending]);
|
|
40331
|
-
const reconnect = (0,
|
|
40073
|
+
const reconnect = (0, import_react142.useCallback)(
|
|
40332
40074
|
(name) => {
|
|
40333
40075
|
config.approveMcpServerForSession(name);
|
|
40334
40076
|
const registry = config.getToolRegistry();
|
|
@@ -40340,7 +40082,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40340
40082
|
},
|
|
40341
40083
|
[config]
|
|
40342
40084
|
);
|
|
40343
|
-
const handleMcpApprovalSelect = (0,
|
|
40085
|
+
const handleMcpApprovalSelect = (0, import_react142.useCallback)(
|
|
40344
40086
|
async (choice) => {
|
|
40345
40087
|
const approvals = loadMcpApprovals();
|
|
40346
40088
|
const root = config.getWorkingDir();
|
|
@@ -40392,7 +40134,7 @@ var useMcpApproval = /* @__PURE__ */ __name((config) => {
|
|
|
40392
40134
|
|
|
40393
40135
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
40394
40136
|
init_esbuild_shims();
|
|
40395
|
-
var
|
|
40137
|
+
var import_react143 = __toESM(require_react(), 1);
|
|
40396
40138
|
|
|
40397
40139
|
// packages/cli/src/services/command-migration-tool.ts
|
|
40398
40140
|
init_esbuild_shims();
|
|
@@ -40463,9 +40205,9 @@ __name(migrateTomlCommands, "migrateTomlCommands");
|
|
|
40463
40205
|
|
|
40464
40206
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
40465
40207
|
function useCommandMigration(settings, storage) {
|
|
40466
|
-
const [showMigrationNudge, setShowMigrationNudge] = (0,
|
|
40467
|
-
const [tomlFiles, setTomlFiles] = (0,
|
|
40468
|
-
(0,
|
|
40208
|
+
const [showMigrationNudge, setShowMigrationNudge] = (0, import_react143.useState)(false);
|
|
40209
|
+
const [tomlFiles, setTomlFiles] = (0, import_react143.useState)([]);
|
|
40210
|
+
(0, import_react143.useEffect)(() => {
|
|
40469
40211
|
let cancelled = false;
|
|
40470
40212
|
const checkTomlCommands = /* @__PURE__ */ __name(async () => {
|
|
40471
40213
|
const allFiles = [];
|
|
@@ -40531,12 +40273,81 @@ function sendNotification(opts, terminal, enabled) {
|
|
|
40531
40273
|
}
|
|
40532
40274
|
__name(sendNotification, "sendNotification");
|
|
40533
40275
|
|
|
40276
|
+
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
40277
|
+
init_esbuild_shims();
|
|
40278
|
+
var import_react144 = __toESM(require_react(), 1);
|
|
40279
|
+
function useMessageQueue() {
|
|
40280
|
+
const [queuedMessages, setQueuedMessages] = (0, import_react144.useState)([]);
|
|
40281
|
+
const queueRef = (0, import_react144.useRef)([]);
|
|
40282
|
+
const addMessage = (0, import_react144.useCallback)((message, deferUntilIdle = false) => {
|
|
40283
|
+
const trimmedMessage = message.trim();
|
|
40284
|
+
if (trimmedMessage.length > 0) {
|
|
40285
|
+
queueRef.current = [
|
|
40286
|
+
...queueRef.current,
|
|
40287
|
+
{ text: trimmedMessage, deferUntilIdle }
|
|
40288
|
+
];
|
|
40289
|
+
setQueuedMessages(queueRef.current);
|
|
40290
|
+
}
|
|
40291
|
+
}, []);
|
|
40292
|
+
const clearQueue = (0, import_react144.useCallback)(() => {
|
|
40293
|
+
queueRef.current = [];
|
|
40294
|
+
setQueuedMessages([]);
|
|
40295
|
+
}, []);
|
|
40296
|
+
const getQueuedMessagesText = (0, import_react144.useCallback)(() => {
|
|
40297
|
+
if (queuedMessages.length === 0) return "";
|
|
40298
|
+
return queuedMessages.map(({ text }) => text).join("\n\n");
|
|
40299
|
+
}, [queuedMessages]);
|
|
40300
|
+
const popAllMessages = (0, import_react144.useCallback)(() => {
|
|
40301
|
+
const current = queueRef.current;
|
|
40302
|
+
if (current.length === 0) return null;
|
|
40303
|
+
queueRef.current = [];
|
|
40304
|
+
setQueuedMessages([]);
|
|
40305
|
+
return current.map(({ text }) => text).join("\n\n");
|
|
40306
|
+
}, []);
|
|
40307
|
+
const restoreMessages = (0, import_react144.useCallback)((messages) => {
|
|
40308
|
+
const restored = messages.map((text) => text.trim()).filter(Boolean).map((text) => ({ text, deferUntilIdle: false }));
|
|
40309
|
+
if (restored.length === 0) return;
|
|
40310
|
+
queueRef.current = [...restored, ...queueRef.current];
|
|
40311
|
+
setQueuedMessages(queueRef.current);
|
|
40312
|
+
}, []);
|
|
40313
|
+
const drainQueue = (0, import_react144.useCallback)((includeDeferred = false) => {
|
|
40314
|
+
const current = queueRef.current;
|
|
40315
|
+
if (current.length === 0) return [];
|
|
40316
|
+
const shouldDrain = /* @__PURE__ */ __name((message) => !isSlashCommand(message.text) && (includeDeferred || !message.deferUntilIdle), "shouldDrain");
|
|
40317
|
+
const drained = current.filter(shouldDrain);
|
|
40318
|
+
if (drained.length === 0) return [];
|
|
40319
|
+
const rest = current.filter((message) => !shouldDrain(message));
|
|
40320
|
+
queueRef.current = rest;
|
|
40321
|
+
setQueuedMessages(rest);
|
|
40322
|
+
return drained.map(({ text }) => text);
|
|
40323
|
+
}, []);
|
|
40324
|
+
const popNextSegment = (0, import_react144.useCallback)(() => {
|
|
40325
|
+
const current = queueRef.current;
|
|
40326
|
+
if (current.length === 0) return null;
|
|
40327
|
+
const [head, ...rest] = current;
|
|
40328
|
+
queueRef.current = rest;
|
|
40329
|
+
setQueuedMessages(rest);
|
|
40330
|
+
return head.text;
|
|
40331
|
+
}, []);
|
|
40332
|
+
return {
|
|
40333
|
+
messageQueue: queuedMessages.map(({ text }) => text),
|
|
40334
|
+
addMessage,
|
|
40335
|
+
clearQueue,
|
|
40336
|
+
getQueuedMessagesText,
|
|
40337
|
+
popAllMessages,
|
|
40338
|
+
restoreMessages,
|
|
40339
|
+
drainQueue,
|
|
40340
|
+
popNextSegment
|
|
40341
|
+
};
|
|
40342
|
+
}
|
|
40343
|
+
__name(useMessageQueue, "useMessageQueue");
|
|
40344
|
+
|
|
40534
40345
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
40535
40346
|
init_esbuild_shims();
|
|
40536
|
-
var
|
|
40347
|
+
var import_react145 = __toESM(require_react(), 1);
|
|
40537
40348
|
function useGitBranchName(cwd3) {
|
|
40538
|
-
const [branchName, setBranchName] = (0,
|
|
40539
|
-
(0,
|
|
40349
|
+
const [branchName, setBranchName] = (0, import_react145.useState)(void 0);
|
|
40350
|
+
(0, import_react145.useEffect)(() => {
|
|
40540
40351
|
let cancelled = false;
|
|
40541
40352
|
let dispose;
|
|
40542
40353
|
const refresh = /* @__PURE__ */ __name(async () => {
|
|
@@ -40569,13 +40380,13 @@ __name(useGitBranchName, "useGitBranchName");
|
|
|
40569
40380
|
|
|
40570
40381
|
// packages/cli/src/ui/hooks/useWorktreeSession.ts
|
|
40571
40382
|
init_esbuild_shims();
|
|
40572
|
-
var
|
|
40383
|
+
var import_react146 = __toESM(require_react(), 1);
|
|
40573
40384
|
import fs19 from "node:fs";
|
|
40574
40385
|
import fsPromises from "node:fs/promises";
|
|
40575
40386
|
import path14 from "node:path";
|
|
40576
40387
|
function useWorktreeSession(config) {
|
|
40577
|
-
const [session, setSession] = (0,
|
|
40578
|
-
(0,
|
|
40388
|
+
const [session, setSession] = (0, import_react146.useState)(null);
|
|
40389
|
+
(0, import_react146.useEffect)(() => {
|
|
40579
40390
|
let cancelled = false;
|
|
40580
40391
|
const safeLoad = /* @__PURE__ */ __name(async () => {
|
|
40581
40392
|
try {
|
|
@@ -40615,7 +40426,7 @@ __name(useWorktreeSession, "useWorktreeSession");
|
|
|
40615
40426
|
|
|
40616
40427
|
// packages/cli/src/ui/hooks/useExtensionUpdates.ts
|
|
40617
40428
|
init_esbuild_shims();
|
|
40618
|
-
var
|
|
40429
|
+
var import_react147 = __toESM(require_react(), 1);
|
|
40619
40430
|
function confirmationRequestsReducer(state, action) {
|
|
40620
40431
|
switch (action.type) {
|
|
40621
40432
|
case "add":
|
|
@@ -40632,8 +40443,8 @@ var useConfirmUpdateRequests = /* @__PURE__ */ __name(() => {
|
|
|
40632
40443
|
const [
|
|
40633
40444
|
confirmUpdateExtensionRequests,
|
|
40634
40445
|
dispatchConfirmUpdateExtensionRequests
|
|
40635
|
-
] = (0,
|
|
40636
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
40446
|
+
] = (0, import_react147.useReducer)(confirmationRequestsReducer, []);
|
|
40447
|
+
const addConfirmUpdateExtensionRequest = (0, import_react147.useCallback)(
|
|
40637
40448
|
(original) => {
|
|
40638
40449
|
const wrappedRequest = {
|
|
40639
40450
|
prompt: original.prompt,
|
|
@@ -40671,11 +40482,11 @@ function settingInputRequestsReducer(state, action) {
|
|
|
40671
40482
|
}
|
|
40672
40483
|
__name(settingInputRequestsReducer, "settingInputRequestsReducer");
|
|
40673
40484
|
var useSettingInputRequests = /* @__PURE__ */ __name(() => {
|
|
40674
|
-
const [settingInputRequests, dispatchSettingInputRequests] = (0,
|
|
40485
|
+
const [settingInputRequests, dispatchSettingInputRequests] = (0, import_react147.useReducer)(
|
|
40675
40486
|
settingInputRequestsReducer,
|
|
40676
40487
|
[]
|
|
40677
40488
|
);
|
|
40678
|
-
const addSettingInputRequest = (0,
|
|
40489
|
+
const addSettingInputRequest = (0, import_react147.useCallback)(
|
|
40679
40490
|
(original) => {
|
|
40680
40491
|
const wrappedRequest = {
|
|
40681
40492
|
settingName: original.settingName,
|
|
@@ -40722,11 +40533,11 @@ function pluginChoiceRequestsReducer(state, action) {
|
|
|
40722
40533
|
}
|
|
40723
40534
|
__name(pluginChoiceRequestsReducer, "pluginChoiceRequestsReducer");
|
|
40724
40535
|
var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
40725
|
-
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0,
|
|
40536
|
+
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0, import_react147.useReducer)(
|
|
40726
40537
|
pluginChoiceRequestsReducer,
|
|
40727
40538
|
[]
|
|
40728
40539
|
);
|
|
40729
|
-
const addPluginChoiceRequest = (0,
|
|
40540
|
+
const addPluginChoiceRequest = (0, import_react147.useCallback)(
|
|
40730
40541
|
(original) => {
|
|
40731
40542
|
const wrappedRequest = {
|
|
40732
40543
|
marketplaceName: original.marketplaceName,
|
|
@@ -40760,12 +40571,12 @@ var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
|
40760
40571
|
};
|
|
40761
40572
|
}, "usePluginChoiceRequests");
|
|
40762
40573
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd3) => {
|
|
40763
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
40574
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react147.useReducer)(
|
|
40764
40575
|
extensionUpdatesReducer,
|
|
40765
40576
|
initialExtensionUpdatesState
|
|
40766
40577
|
);
|
|
40767
40578
|
const extensions = extensionManager.getLoadedExtensions();
|
|
40768
|
-
(0,
|
|
40579
|
+
(0, import_react147.useEffect)(() => {
|
|
40769
40580
|
(async () => {
|
|
40770
40581
|
const extensionsToCheck = extensions.filter((extension) => {
|
|
40771
40582
|
const currentStatus = extensionsUpdateState.extensionStatuses.get(
|
|
@@ -40793,7 +40604,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
40793
40604
|
extensionsUpdateState.extensionStatuses,
|
|
40794
40605
|
dispatchExtensionStateUpdate
|
|
40795
40606
|
]);
|
|
40796
|
-
(0,
|
|
40607
|
+
(0, import_react147.useEffect)(() => {
|
|
40797
40608
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
40798
40609
|
return;
|
|
40799
40610
|
}
|
|
@@ -40862,7 +40673,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
40862
40673
|
);
|
|
40863
40674
|
}
|
|
40864
40675
|
}, [extensions, extensionManager, extensionsUpdateState, addItem, cwd3]);
|
|
40865
|
-
const extensionsUpdateStateComputed = (0,
|
|
40676
|
+
const extensionsUpdateStateComputed = (0, import_react147.useMemo)(() => {
|
|
40866
40677
|
const result = /* @__PURE__ */ new Map();
|
|
40867
40678
|
for (const [
|
|
40868
40679
|
key,
|
|
@@ -40881,11 +40692,11 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
40881
40692
|
|
|
40882
40693
|
// packages/cli/src/ui/components/TranscriptView.tsx
|
|
40883
40694
|
init_esbuild_shims();
|
|
40884
|
-
var
|
|
40695
|
+
var import_react150 = __toESM(require_react(), 1);
|
|
40885
40696
|
|
|
40886
40697
|
// packages/cli/src/ui/components/AlternateScreen.tsx
|
|
40887
40698
|
init_esbuild_shims();
|
|
40888
|
-
var
|
|
40699
|
+
var import_react148 = __toESM(require_react(), 1);
|
|
40889
40700
|
var import_jsx_runtime132 = __toESM(require_jsx_runtime(), 1);
|
|
40890
40701
|
var ENTER_ALT_SCREEN = "\x1B[?1049h";
|
|
40891
40702
|
var EXIT_ALT_SCREEN = "\x1B[?1049l";
|
|
@@ -40898,7 +40709,7 @@ var AlternateScreen = /* @__PURE__ */ __name(({
|
|
|
40898
40709
|
}) => {
|
|
40899
40710
|
const writeRaw = useTerminalOutput();
|
|
40900
40711
|
const { rows } = useTerminalSize();
|
|
40901
|
-
(0,
|
|
40712
|
+
(0, import_react148.useEffect)(() => {
|
|
40902
40713
|
if (disabled || !process.stdout.isTTY) return;
|
|
40903
40714
|
const safeWrite = /* @__PURE__ */ __name((data) => {
|
|
40904
40715
|
try {
|
|
@@ -40919,9 +40730,9 @@ var AlternateScreen = /* @__PURE__ */ __name(({
|
|
|
40919
40730
|
|
|
40920
40731
|
// packages/cli/src/ui/components/shared/ErrorBoundary.tsx
|
|
40921
40732
|
init_esbuild_shims();
|
|
40922
|
-
var
|
|
40733
|
+
var import_react149 = __toESM(require_react(), 1);
|
|
40923
40734
|
var import_jsx_runtime133 = __toESM(require_jsx_runtime(), 1);
|
|
40924
|
-
var ErrorBoundary = class extends
|
|
40735
|
+
var ErrorBoundary = class extends import_react149.Component {
|
|
40925
40736
|
static {
|
|
40926
40737
|
__name(this, "ErrorBoundary");
|
|
40927
40738
|
}
|
|
@@ -40980,11 +40791,11 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
40980
40791
|
const headerHeight = 1;
|
|
40981
40792
|
const footerHeight = 1;
|
|
40982
40793
|
const contentHeight = Math.max(rows - headerHeight - footerHeight, 1);
|
|
40983
|
-
const estimatedItemHeight = (0,
|
|
40794
|
+
const estimatedItemHeight = (0, import_react150.useCallback)(
|
|
40984
40795
|
(index) => estimateTranscriptItemHeight(items[index]),
|
|
40985
40796
|
[items]
|
|
40986
40797
|
);
|
|
40987
|
-
const renderItem = (0,
|
|
40798
|
+
const renderItem = (0, import_react150.useCallback)(
|
|
40988
40799
|
({ item }) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
40989
40800
|
HistoryItemDisplay,
|
|
40990
40801
|
{
|
|
@@ -40997,7 +40808,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
40997
40808
|
[columns]
|
|
40998
40809
|
);
|
|
40999
40810
|
const title = t("Transcript");
|
|
41000
|
-
const content = (0,
|
|
40811
|
+
const content = (0, import_react150.useMemo)(
|
|
41001
40812
|
() => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(OverflowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
41002
40813
|
ScrollableListWithForwardRef,
|
|
41003
40814
|
{
|
|
@@ -41012,7 +40823,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
41012
40823
|
) }),
|
|
41013
40824
|
[items, renderItem, estimatedItemHeight, contentHeight]
|
|
41014
40825
|
);
|
|
41015
|
-
const errorFallback = (0,
|
|
40826
|
+
const errorFallback = (0, import_react150.useCallback)(
|
|
41016
40827
|
(error) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [
|
|
41017
40828
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text, { color: theme.status.error, bold: true, children: t("Failed to render transcript.") }),
|
|
41018
40829
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text, { color: theme.text.secondary, children: sanitizeTerminalText(error.message) }),
|
|
@@ -41023,7 +40834,7 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
41023
40834
|
] }),
|
|
41024
40835
|
[]
|
|
41025
40836
|
);
|
|
41026
|
-
const onRenderError = (0,
|
|
40837
|
+
const onRenderError = (0, import_react150.useCallback)((error, info) => {
|
|
41027
40838
|
debugLogger39.error(
|
|
41028
40839
|
`render error: ${error.message}`,
|
|
41029
40840
|
info.componentStack ?? ""
|
|
@@ -41047,19 +40858,19 @@ var TranscriptViewImpl = /* @__PURE__ */ __name(({
|
|
|
41047
40858
|
] }) })
|
|
41048
40859
|
] }) });
|
|
41049
40860
|
}, "TranscriptViewImpl");
|
|
41050
|
-
var TranscriptView = (0,
|
|
40861
|
+
var TranscriptView = (0, import_react150.memo)(TranscriptViewImpl);
|
|
41051
40862
|
TranscriptView.displayName = "TranscriptView";
|
|
41052
40863
|
|
|
41053
40864
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
41054
40865
|
init_esbuild_shims();
|
|
41055
|
-
var
|
|
40866
|
+
var import_react151 = __toESM(require_react(), 1);
|
|
41056
40867
|
function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
41057
|
-
const [welcomeBackInfo, setWelcomeBackInfo] = (0,
|
|
41058
|
-
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0,
|
|
41059
|
-
const [welcomeBackChoice, setWelcomeBackChoice] = (0,
|
|
41060
|
-
const [shouldFillInput, setShouldFillInput] = (0,
|
|
41061
|
-
const [inputFillText, setInputFillText] = (0,
|
|
41062
|
-
const checkWelcomeBack = (0,
|
|
40868
|
+
const [welcomeBackInfo, setWelcomeBackInfo] = (0, import_react151.useState)(null);
|
|
40869
|
+
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0, import_react151.useState)(false);
|
|
40870
|
+
const [welcomeBackChoice, setWelcomeBackChoice] = (0, import_react151.useState)(null);
|
|
40871
|
+
const [shouldFillInput, setShouldFillInput] = (0, import_react151.useState)(false);
|
|
40872
|
+
const [inputFillText, setInputFillText] = (0, import_react151.useState)(null);
|
|
40873
|
+
const checkWelcomeBack = (0, import_react151.useCallback)(async () => {
|
|
41063
40874
|
if (settings.ui?.enableWelcomeBack === false) {
|
|
41064
40875
|
return;
|
|
41065
40876
|
}
|
|
@@ -41078,7 +40889,7 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
41078
40889
|
config.getDebugLogger().debug("Welcome back check failed:", error);
|
|
41079
40890
|
}
|
|
41080
40891
|
}, [config, settings.ui?.enableWelcomeBack]);
|
|
41081
|
-
const handleWelcomeBackSelection = (0,
|
|
40892
|
+
const handleWelcomeBackSelection = (0, import_react151.useCallback)(
|
|
41082
40893
|
(choice) => {
|
|
41083
40894
|
setWelcomeBackChoice(choice);
|
|
41084
40895
|
setShowWelcomeBackDialog(false);
|
|
@@ -41102,21 +40913,21 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
41102
40913
|
},
|
|
41103
40914
|
[config, welcomeBackInfo]
|
|
41104
40915
|
);
|
|
41105
|
-
const handleWelcomeBackClose = (0,
|
|
40916
|
+
const handleWelcomeBackClose = (0, import_react151.useCallback)(() => {
|
|
41106
40917
|
setWelcomeBackChoice("restart");
|
|
41107
40918
|
setShowWelcomeBackDialog(false);
|
|
41108
40919
|
}, []);
|
|
41109
|
-
const clearInputFill = (0,
|
|
40920
|
+
const clearInputFill = (0, import_react151.useCallback)(() => {
|
|
41110
40921
|
setShouldFillInput(false);
|
|
41111
40922
|
setInputFillText(null);
|
|
41112
40923
|
}, []);
|
|
41113
|
-
(0,
|
|
40924
|
+
(0, import_react151.useEffect)(() => {
|
|
41114
40925
|
if (shouldFillInput && inputFillText) {
|
|
41115
40926
|
buffer.setText(inputFillText);
|
|
41116
40927
|
clearInputFill();
|
|
41117
40928
|
}
|
|
41118
40929
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
41119
|
-
(0,
|
|
40930
|
+
(0, import_react151.useEffect)(() => {
|
|
41120
40931
|
checkWelcomeBack();
|
|
41121
40932
|
}, [checkWelcomeBack]);
|
|
41122
40933
|
return {
|
|
@@ -41137,9 +40948,9 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
41137
40948
|
|
|
41138
40949
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
41139
40950
|
init_esbuild_shims();
|
|
41140
|
-
var
|
|
40951
|
+
var import_react152 = __toESM(require_react(), 1);
|
|
41141
40952
|
function useDialogClose(options) {
|
|
41142
|
-
const closeAnyOpenDialog = (0,
|
|
40953
|
+
const closeAnyOpenDialog = (0, import_react152.useCallback)(() => {
|
|
41143
40954
|
if (options.isThemeDialogOpen) {
|
|
41144
40955
|
options.handleThemeSelect(void 0, "User" /* User */);
|
|
41145
40956
|
return true;
|
|
@@ -41211,14 +41022,14 @@ __name(useDialogClose, "useDialogClose");
|
|
|
41211
41022
|
|
|
41212
41023
|
// packages/cli/src/ui/hooks/useInitializationAuthError.ts
|
|
41213
41024
|
init_esbuild_shims();
|
|
41214
|
-
var
|
|
41025
|
+
var import_react153 = __toESM(require_react(), 1);
|
|
41215
41026
|
var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError) => {
|
|
41216
|
-
const hasHandled = (0,
|
|
41217
|
-
const authErrorRef = (0,
|
|
41218
|
-
const onAuthErrorRef = (0,
|
|
41027
|
+
const hasHandled = (0, import_react153.useRef)(false);
|
|
41028
|
+
const authErrorRef = (0, import_react153.useRef)(authError);
|
|
41029
|
+
const onAuthErrorRef = (0, import_react153.useRef)(onAuthError);
|
|
41219
41030
|
authErrorRef.current = authError;
|
|
41220
41031
|
onAuthErrorRef.current = onAuthError;
|
|
41221
|
-
(0,
|
|
41032
|
+
(0, import_react153.useEffect)(() => {
|
|
41222
41033
|
if (hasHandled.current) {
|
|
41223
41034
|
return;
|
|
41224
41035
|
}
|
|
@@ -41231,13 +41042,13 @@ var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError)
|
|
|
41231
41042
|
|
|
41232
41043
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
41233
41044
|
init_esbuild_shims();
|
|
41234
|
-
var
|
|
41045
|
+
var import_react154 = __toESM(require_react(), 1);
|
|
41235
41046
|
function useSubagentCreateDialog() {
|
|
41236
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
41237
|
-
const openSubagentCreateDialog = (0,
|
|
41047
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react154.useState)(false);
|
|
41048
|
+
const openSubagentCreateDialog = (0, import_react154.useCallback)(() => {
|
|
41238
41049
|
setIsSubagentCreateDialogOpen(true);
|
|
41239
41050
|
}, []);
|
|
41240
|
-
const closeSubagentCreateDialog = (0,
|
|
41051
|
+
const closeSubagentCreateDialog = (0, import_react154.useCallback)(() => {
|
|
41241
41052
|
setIsSubagentCreateDialogOpen(false);
|
|
41242
41053
|
}, []);
|
|
41243
41054
|
return {
|
|
@@ -41250,13 +41061,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
41250
41061
|
|
|
41251
41062
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
41252
41063
|
init_esbuild_shims();
|
|
41253
|
-
var
|
|
41064
|
+
var import_react155 = __toESM(require_react(), 1);
|
|
41254
41065
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41255
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
41256
|
-
const openAgentsManagerDialog = (0,
|
|
41066
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react155.useState)(false);
|
|
41067
|
+
const openAgentsManagerDialog = (0, import_react155.useCallback)(() => {
|
|
41257
41068
|
setIsAgentsManagerDialogOpen(true);
|
|
41258
41069
|
}, []);
|
|
41259
|
-
const closeAgentsManagerDialog = (0,
|
|
41070
|
+
const closeAgentsManagerDialog = (0, import_react155.useCallback)(() => {
|
|
41260
41071
|
setIsAgentsManagerDialogOpen(false);
|
|
41261
41072
|
}, []);
|
|
41262
41073
|
return {
|
|
@@ -41268,13 +41079,13 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41268
41079
|
|
|
41269
41080
|
// packages/cli/src/ui/hooks/useSkillsManagerDialog.ts
|
|
41270
41081
|
init_esbuild_shims();
|
|
41271
|
-
var
|
|
41082
|
+
var import_react156 = __toESM(require_react(), 1);
|
|
41272
41083
|
var useSkillsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41273
|
-
const [isSkillsManagerDialogOpen, setIsSkillsManagerDialogOpen] = (0,
|
|
41274
|
-
const openSkillsManagerDialog = (0,
|
|
41084
|
+
const [isSkillsManagerDialogOpen, setIsSkillsManagerDialogOpen] = (0, import_react156.useState)(false);
|
|
41085
|
+
const openSkillsManagerDialog = (0, import_react156.useCallback)(() => {
|
|
41275
41086
|
setIsSkillsManagerDialogOpen(true);
|
|
41276
41087
|
}, []);
|
|
41277
|
-
const closeSkillsManagerDialog = (0,
|
|
41088
|
+
const closeSkillsManagerDialog = (0, import_react156.useCallback)(() => {
|
|
41278
41089
|
setIsSkillsManagerDialogOpen(false);
|
|
41279
41090
|
}, []);
|
|
41280
41091
|
return {
|
|
@@ -41286,13 +41097,13 @@ var useSkillsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41286
41097
|
|
|
41287
41098
|
// packages/cli/src/ui/hooks/useExtensionsManagerDialog.ts
|
|
41288
41099
|
init_esbuild_shims();
|
|
41289
|
-
var
|
|
41100
|
+
var import_react157 = __toESM(require_react(), 1);
|
|
41290
41101
|
var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
41291
|
-
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0,
|
|
41292
|
-
const openExtensionsManagerDialog = (0,
|
|
41102
|
+
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0, import_react157.useState)(false);
|
|
41103
|
+
const openExtensionsManagerDialog = (0, import_react157.useCallback)(() => {
|
|
41293
41104
|
setIsExtensionsManagerDialogOpen(true);
|
|
41294
41105
|
}, []);
|
|
41295
|
-
const closeExtensionsManagerDialog = (0,
|
|
41106
|
+
const closeExtensionsManagerDialog = (0, import_react157.useCallback)(() => {
|
|
41296
41107
|
setIsExtensionsManagerDialogOpen(false);
|
|
41297
41108
|
}, []);
|
|
41298
41109
|
return {
|
|
@@ -41304,13 +41115,13 @@ var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
41304
41115
|
|
|
41305
41116
|
// packages/cli/src/ui/hooks/useMcpDialog.ts
|
|
41306
41117
|
init_esbuild_shims();
|
|
41307
|
-
var
|
|
41118
|
+
var import_react158 = __toESM(require_react(), 1);
|
|
41308
41119
|
var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
41309
|
-
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0,
|
|
41310
|
-
const openMcpDialog = (0,
|
|
41120
|
+
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0, import_react158.useState)(false);
|
|
41121
|
+
const openMcpDialog = (0, import_react158.useCallback)(() => {
|
|
41311
41122
|
setIsMcpDialogOpen(true);
|
|
41312
41123
|
}, []);
|
|
41313
|
-
const closeMcpDialog = (0,
|
|
41124
|
+
const closeMcpDialog = (0, import_react158.useCallback)(() => {
|
|
41314
41125
|
setIsMcpDialogOpen(false);
|
|
41315
41126
|
}, []);
|
|
41316
41127
|
return {
|
|
@@ -41322,13 +41133,13 @@ var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
|
41322
41133
|
|
|
41323
41134
|
// packages/cli/src/ui/hooks/useHooksDialog.ts
|
|
41324
41135
|
init_esbuild_shims();
|
|
41325
|
-
var
|
|
41136
|
+
var import_react159 = __toESM(require_react(), 1);
|
|
41326
41137
|
var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
41327
|
-
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0,
|
|
41328
|
-
const openHooksDialog = (0,
|
|
41138
|
+
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0, import_react159.useState)(false);
|
|
41139
|
+
const openHooksDialog = (0, import_react159.useCallback)(() => {
|
|
41329
41140
|
setIsHooksDialogOpen(true);
|
|
41330
41141
|
}, []);
|
|
41331
|
-
const closeHooksDialog = (0,
|
|
41142
|
+
const closeHooksDialog = (0, import_react159.useCallback)(() => {
|
|
41332
41143
|
setIsHooksDialogOpen(false);
|
|
41333
41144
|
}, []);
|
|
41334
41145
|
return {
|
|
@@ -41340,23 +41151,23 @@ var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
|
41340
41151
|
|
|
41341
41152
|
// packages/cli/src/ui/hooks/useStatsDialog.ts
|
|
41342
41153
|
init_esbuild_shims();
|
|
41343
|
-
var
|
|
41154
|
+
var import_react160 = __toESM(require_react(), 1);
|
|
41344
41155
|
var useStatsDialog = /* @__PURE__ */ __name(() => {
|
|
41345
|
-
const [isStatsDialogOpen, setIsStatsDialogOpen] = (0,
|
|
41346
|
-
const openStatsDialog = (0,
|
|
41347
|
-
const closeStatsDialog = (0,
|
|
41156
|
+
const [isStatsDialogOpen, setIsStatsDialogOpen] = (0, import_react160.useState)(false);
|
|
41157
|
+
const openStatsDialog = (0, import_react160.useCallback)(() => setIsStatsDialogOpen(true), []);
|
|
41158
|
+
const closeStatsDialog = (0, import_react160.useCallback)(() => setIsStatsDialogOpen(false), []);
|
|
41348
41159
|
return { isStatsDialogOpen, openStatsDialog, closeStatsDialog };
|
|
41349
41160
|
}, "useStatsDialog");
|
|
41350
41161
|
|
|
41351
41162
|
// packages/cli/src/ui/hooks/useMemoryDialog.ts
|
|
41352
41163
|
init_esbuild_shims();
|
|
41353
|
-
var
|
|
41164
|
+
var import_react161 = __toESM(require_react(), 1);
|
|
41354
41165
|
var useMemoryDialog = /* @__PURE__ */ __name(() => {
|
|
41355
|
-
const [isMemoryDialogOpen, setIsMemoryDialogOpen] = (0,
|
|
41356
|
-
const openMemoryDialog = (0,
|
|
41166
|
+
const [isMemoryDialogOpen, setIsMemoryDialogOpen] = (0, import_react161.useState)(false);
|
|
41167
|
+
const openMemoryDialog = (0, import_react161.useCallback)(() => {
|
|
41357
41168
|
setIsMemoryDialogOpen(true);
|
|
41358
41169
|
}, []);
|
|
41359
|
-
const closeMemoryDialog = (0,
|
|
41170
|
+
const closeMemoryDialog = (0, import_react161.useCallback)(() => {
|
|
41360
41171
|
setIsMemoryDialogOpen(false);
|
|
41361
41172
|
}, []);
|
|
41362
41173
|
return {
|
|
@@ -41368,7 +41179,7 @@ var useMemoryDialog = /* @__PURE__ */ __name(() => {
|
|
|
41368
41179
|
|
|
41369
41180
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
41370
41181
|
init_esbuild_shims();
|
|
41371
|
-
var
|
|
41182
|
+
var import_react162 = __toESM(require_react(), 1);
|
|
41372
41183
|
var LONG_TASK_NOTIFICATION_THRESHOLD_SECONDS = 20;
|
|
41373
41184
|
var NOTIFICATION_TITLE = "Qwen Code";
|
|
41374
41185
|
var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
@@ -41383,16 +41194,16 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
41383
41194
|
const terminalBellEnabled = settings?.merged?.general?.terminalBell ?? true;
|
|
41384
41195
|
const notificationMode = settings?.merged?.general?.notificationMode === "task-complete" ? "task-complete" : "all";
|
|
41385
41196
|
const approvalNotificationsEnabled = notificationMode === "all";
|
|
41386
|
-
const awaitingNotificationSentRef = (0,
|
|
41387
|
-
const respondingElapsedRef = (0,
|
|
41388
|
-
const idleNotificationSentRef = (0,
|
|
41389
|
-
const awaitingToolName = (0,
|
|
41197
|
+
const awaitingNotificationSentRef = (0, import_react162.useRef)(false);
|
|
41198
|
+
const respondingElapsedRef = (0, import_react162.useRef)(0);
|
|
41199
|
+
const idleNotificationSentRef = (0, import_react162.useRef)(false);
|
|
41200
|
+
const awaitingToolName = (0, import_react162.useMemo)(() => {
|
|
41390
41201
|
const awaitingTool = pendingToolCalls?.find(
|
|
41391
41202
|
(tc) => tc.status === "awaiting_approval"
|
|
41392
41203
|
);
|
|
41393
41204
|
return awaitingTool?.request.name;
|
|
41394
41205
|
}, [pendingToolCalls]);
|
|
41395
|
-
(0,
|
|
41206
|
+
(0, import_react162.useEffect)(() => {
|
|
41396
41207
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current && terminalBellEnabled && approvalNotificationsEnabled) {
|
|
41397
41208
|
const message = awaitingToolName ? `Qwen Code needs your permission to use ${awaitingToolName}` : "Qwen Code is waiting for your input";
|
|
41398
41209
|
sendNotification(
|
|
@@ -41413,7 +41224,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
41413
41224
|
terminal,
|
|
41414
41225
|
awaitingToolName
|
|
41415
41226
|
]);
|
|
41416
|
-
(0,
|
|
41227
|
+
(0, import_react162.useEffect)(() => {
|
|
41417
41228
|
if (streamingState === "responding" /* Responding */) {
|
|
41418
41229
|
respondingElapsedRef.current = elapsedTime;
|
|
41419
41230
|
idleNotificationSentRef.current = false;
|
|
@@ -41566,7 +41377,7 @@ __name(buildTerminalNotification, "buildTerminalNotification");
|
|
|
41566
41377
|
|
|
41567
41378
|
// packages/cli/src/ui/hooks/useContextualTips.ts
|
|
41568
41379
|
init_esbuild_shims();
|
|
41569
|
-
var
|
|
41380
|
+
var import_react163 = __toESM(require_react(), 1);
|
|
41570
41381
|
function useContextualTips({
|
|
41571
41382
|
streamingState,
|
|
41572
41383
|
lastPromptTokenCount,
|
|
@@ -41576,9 +41387,9 @@ function useContextualTips({
|
|
|
41576
41387
|
addItem,
|
|
41577
41388
|
hideTips
|
|
41578
41389
|
}) {
|
|
41579
|
-
const prevStreamingState = (0,
|
|
41580
|
-
const hadResponsePhase = (0,
|
|
41581
|
-
(0,
|
|
41390
|
+
const prevStreamingState = (0, import_react163.useRef)("idle" /* Idle */);
|
|
41391
|
+
const hadResponsePhase = (0, import_react163.useRef)(false);
|
|
41392
|
+
(0, import_react163.useEffect)(() => {
|
|
41582
41393
|
if (streamingState === "responding" /* Responding */ || prevStreamingState.current === "responding" /* Responding */ && streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */) {
|
|
41583
41394
|
hadResponsePhase.current = true;
|
|
41584
41395
|
}
|
|
@@ -41714,7 +41525,7 @@ function getResponseCandidateTokens(pendingGeminiHistoryItems) {
|
|
|
41714
41525
|
__name(getResponseCandidateTokens, "getResponseCandidateTokens");
|
|
41715
41526
|
function useStableStickyTodos(todos) {
|
|
41716
41527
|
const renderKey = getStickyTodosRenderKey(todos);
|
|
41717
|
-
const stableTodosRef = (0,
|
|
41528
|
+
const stableTodosRef = (0, import_react164.useRef)(null);
|
|
41718
41529
|
if (stableTodosRef.current?.renderKey !== renderKey) {
|
|
41719
41530
|
stableTodosRef.current = { renderKey, todos };
|
|
41720
41531
|
}
|
|
@@ -41745,29 +41556,29 @@ var SHELL_WIDTH_FRACTION = 0.89;
|
|
|
41745
41556
|
var SHELL_HEIGHT_PADDING = 10;
|
|
41746
41557
|
var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
41747
41558
|
const { settings, config, initializationResult } = props;
|
|
41748
|
-
const extensionRefreshState = (0,
|
|
41559
|
+
const extensionRefreshState = (0, import_react164.useMemo)(
|
|
41749
41560
|
() => props.extensionRefreshState ?? new ExtensionRefreshState(),
|
|
41750
41561
|
[props.extensionRefreshState]
|
|
41751
41562
|
);
|
|
41752
41563
|
const historyManager = useHistory();
|
|
41753
|
-
const historyRef = (0,
|
|
41564
|
+
const historyRef = (0, import_react164.useRef)(historyManager.history);
|
|
41754
41565
|
historyRef.current = historyManager.history;
|
|
41755
41566
|
useMemoryMonitor(historyManager);
|
|
41756
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
41757
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
41758
|
-
const [themeError, setThemeError] = (0,
|
|
41567
|
+
const [debugMessage, setDebugMessage] = (0, import_react164.useState)("");
|
|
41568
|
+
const [quittingMessages, setQuittingMessages] = (0, import_react164.useState)(null);
|
|
41569
|
+
const [themeError, setThemeError] = (0, import_react164.useState)(
|
|
41759
41570
|
initializationResult.themeError
|
|
41760
41571
|
);
|
|
41761
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
41762
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
41763
|
-
const [geminiMdFileCount, setGeminiMdFileCount] = (0,
|
|
41572
|
+
const [isProcessing, setIsProcessing] = (0, import_react164.useState)(false);
|
|
41573
|
+
const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react164.useState)(false);
|
|
41574
|
+
const [geminiMdFileCount, setGeminiMdFileCount] = (0, import_react164.useState)(
|
|
41764
41575
|
initializationResult.geminiMdFileCount
|
|
41765
41576
|
);
|
|
41766
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
41767
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
41768
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
41769
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
41770
|
-
const [isTrustedFolder, setIsTrustedFolder] = (0,
|
|
41577
|
+
const [shellModeActive, setShellModeActive] = (0, import_react164.useState)(false);
|
|
41578
|
+
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react164.useState)(false);
|
|
41579
|
+
const [historyRemountKey, setHistoryRemountKey] = (0, import_react164.useState)(0);
|
|
41580
|
+
const [updateInfo, setUpdateInfo] = (0, import_react164.useState)(null);
|
|
41581
|
+
const [isTrustedFolder, setIsTrustedFolder] = (0, import_react164.useState)(
|
|
41771
41582
|
config.isTrustedFolder()
|
|
41772
41583
|
);
|
|
41773
41584
|
const extensionManager = config.getExtensionManager();
|
|
@@ -41826,31 +41637,31 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41826
41637
|
config,
|
|
41827
41638
|
historyManager.addItem
|
|
41828
41639
|
);
|
|
41829
|
-
const [isTrustDialogOpen, setTrustDialogOpen] = (0,
|
|
41830
|
-
const openTrustDialog = (0,
|
|
41831
|
-
const closeTrustDialog = (0,
|
|
41832
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
41833
|
-
const openPermissionsDialog = (0,
|
|
41640
|
+
const [isTrustDialogOpen, setTrustDialogOpen] = (0, import_react164.useState)(false);
|
|
41641
|
+
const openTrustDialog = (0, import_react164.useCallback)(() => setTrustDialogOpen(true), []);
|
|
41642
|
+
const closeTrustDialog = (0, import_react164.useCallback)(() => setTrustDialogOpen(false), []);
|
|
41643
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react164.useState)(false);
|
|
41644
|
+
const openPermissionsDialog = (0, import_react164.useCallback)(
|
|
41834
41645
|
() => setPermissionsDialogOpen(true),
|
|
41835
41646
|
[]
|
|
41836
41647
|
);
|
|
41837
|
-
const closePermissionsDialog = (0,
|
|
41648
|
+
const closePermissionsDialog = (0, import_react164.useCallback)(
|
|
41838
41649
|
() => setPermissionsDialogOpen(false),
|
|
41839
41650
|
[]
|
|
41840
41651
|
);
|
|
41841
|
-
const [currentModel, setCurrentModel] = (0,
|
|
41842
|
-
const [isConfigInitialized, setConfigInitialized] = (0,
|
|
41843
|
-
const [userMessages, setUserMessages] = (0,
|
|
41844
|
-
const [transcriptFreeze, setTranscriptFreeze] = (0,
|
|
41652
|
+
const [currentModel, setCurrentModel] = (0, import_react164.useState)(() => config.getModel());
|
|
41653
|
+
const [isConfigInitialized, setConfigInitialized] = (0, import_react164.useState)(false);
|
|
41654
|
+
const [userMessages, setUserMessages] = (0, import_react164.useState)([]);
|
|
41655
|
+
const [transcriptFreeze, setTranscriptFreeze] = (0, import_react164.useState)(null);
|
|
41845
41656
|
const isTranscriptOpen = transcriptFreeze != null;
|
|
41846
|
-
const isTranscriptOpenRef = (0,
|
|
41657
|
+
const isTranscriptOpenRef = (0, import_react164.useRef)(isTranscriptOpen);
|
|
41847
41658
|
isTranscriptOpenRef.current = isTranscriptOpen;
|
|
41848
|
-
const closeTranscript = (0,
|
|
41659
|
+
const closeTranscript = (0, import_react164.useCallback)(() => {
|
|
41849
41660
|
setTranscriptFreeze(null);
|
|
41850
41661
|
}, []);
|
|
41851
|
-
const [thoughtExpanded, setThoughtExpanded] = (0,
|
|
41852
|
-
const [expandedThoughtHeadIds, setExpandedThoughtHeadIds] = (0,
|
|
41853
|
-
const toggleThoughtExpanded = (0,
|
|
41662
|
+
const [thoughtExpanded, setThoughtExpanded] = (0, import_react164.useState)(false);
|
|
41663
|
+
const [expandedThoughtHeadIds, setExpandedThoughtHeadIds] = (0, import_react164.useState)(() => /* @__PURE__ */ new Set());
|
|
41664
|
+
const toggleThoughtExpanded = (0, import_react164.useCallback)((headId) => {
|
|
41854
41665
|
setExpandedThoughtHeadIds((prev) => {
|
|
41855
41666
|
const next = new Set(prev);
|
|
41856
41667
|
if (next.has(headId)) {
|
|
@@ -41864,10 +41675,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41864
41675
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
41865
41676
|
const { stdin, setRawMode } = use_stdin_default();
|
|
41866
41677
|
const { stdout } = use_stdout_default();
|
|
41867
|
-
const writeRaw = (0,
|
|
41678
|
+
const writeRaw = (0, import_react164.useCallback)((data) => {
|
|
41868
41679
|
process16.stdout.write(data);
|
|
41869
41680
|
}, []);
|
|
41870
|
-
const terminal = (0,
|
|
41681
|
+
const terminal = (0, import_react164.useMemo)(
|
|
41871
41682
|
() => buildTerminalNotification(writeRaw),
|
|
41872
41683
|
[writeRaw]
|
|
41873
41684
|
);
|
|
@@ -41877,14 +41688,12 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41877
41688
|
seedPromptCount
|
|
41878
41689
|
} = useSessionStats();
|
|
41879
41690
|
const logger = useLogger(config.storage, sessionStats.sessionId);
|
|
41691
|
+
const branchName = useGitBranchName(config.getTargetDir());
|
|
41880
41692
|
const worktreeSession = useWorktreeSession(config);
|
|
41881
|
-
const
|
|
41882
|
-
|
|
41883
|
-
);
|
|
41884
|
-
const
|
|
41885
|
-
const [workflowKeywordActive, setWorkflowKeywordActive] = (0, import_react165.useState)(false);
|
|
41886
|
-
const pendingWorktreeNoticeRef = (0, import_react165.useRef)(null);
|
|
41887
|
-
const activeWorktree = (0, import_react165.useMemo)(
|
|
41693
|
+
const [showWorktreeExitDialog, setShowWorktreeExitDialog] = (0, import_react164.useState)(false);
|
|
41694
|
+
const [workflowKeywordActive, setWorkflowKeywordActive] = (0, import_react164.useState)(false);
|
|
41695
|
+
const pendingWorktreeNoticeRef = (0, import_react164.useRef)(null);
|
|
41696
|
+
const activeWorktree = (0, import_react164.useMemo)(
|
|
41888
41697
|
() => worktreeSession ? {
|
|
41889
41698
|
slug: worktreeSession.slug,
|
|
41890
41699
|
branch: worktreeSession.worktreeBranch,
|
|
@@ -41895,20 +41704,20 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41895
41704
|
} : null,
|
|
41896
41705
|
[worktreeSession]
|
|
41897
41706
|
);
|
|
41898
|
-
const mainControlsRef = (0,
|
|
41899
|
-
const lastTitleRef = (0,
|
|
41900
|
-
const [startupWarnings, setStartupWarnings] = (0,
|
|
41707
|
+
const mainControlsRef = (0, import_react164.useRef)(null);
|
|
41708
|
+
const lastTitleRef = (0, import_react164.useRef)(null);
|
|
41709
|
+
const [startupWarnings, setStartupWarnings] = (0, import_react164.useState)(
|
|
41901
41710
|
() => props.startupWarnings || []
|
|
41902
41711
|
);
|
|
41903
41712
|
const staticExtraHeight = 3;
|
|
41904
|
-
(0,
|
|
41713
|
+
(0, import_react164.useEffect)(() => {
|
|
41905
41714
|
void loadLowlight().catch((err) => {
|
|
41906
41715
|
debugLogger40.warn(
|
|
41907
41716
|
`Failed to load lowlight chunk; code blocks will render as plain text: ${err instanceof Error ? err.message : String(err)}`
|
|
41908
41717
|
);
|
|
41909
41718
|
});
|
|
41910
41719
|
}, []);
|
|
41911
|
-
(0,
|
|
41720
|
+
(0, import_react164.useEffect)(() => {
|
|
41912
41721
|
(async () => {
|
|
41913
41722
|
profileCheckpoint("config_initialize_start");
|
|
41914
41723
|
await config.initialize();
|
|
@@ -41998,7 +41807,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
41998
41807
|
await ideClient.disconnect();
|
|
41999
41808
|
});
|
|
42000
41809
|
}, [config]);
|
|
42001
|
-
(0,
|
|
41810
|
+
(0, import_react164.useEffect)(() => {
|
|
42002
41811
|
if (!isConfigInitialized) return void 0;
|
|
42003
41812
|
const geminiClient2 = config.getGeminiClient();
|
|
42004
41813
|
if (!geminiClient2) return void 0;
|
|
@@ -42062,11 +41871,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42062
41871
|
clearTimeout(finalizeCap);
|
|
42063
41872
|
};
|
|
42064
41873
|
}, [isConfigInitialized, config]);
|
|
42065
|
-
const isIdleRef = (0,
|
|
42066
|
-
const availableTerminalHeightRef = (0,
|
|
42067
|
-
const terminalWidthRef = (0,
|
|
42068
|
-
const updateHandlerRef = (0,
|
|
42069
|
-
(0,
|
|
41874
|
+
const isIdleRef = (0, import_react164.useRef)(true);
|
|
41875
|
+
const availableTerminalHeightRef = (0, import_react164.useRef)(0);
|
|
41876
|
+
const terminalWidthRef = (0, import_react164.useRef)(0);
|
|
41877
|
+
const updateHandlerRef = (0, import_react164.useRef)(null);
|
|
41878
|
+
(0, import_react164.useEffect)(() => {
|
|
42070
41879
|
const handler = setUpdateHandler(
|
|
42071
41880
|
historyManager.addItem,
|
|
42072
41881
|
setUpdateInfo,
|
|
@@ -42075,13 +41884,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42075
41884
|
updateHandlerRef.current = handler;
|
|
42076
41885
|
return () => handler?.cleanup();
|
|
42077
41886
|
}, [historyManager.addItem]);
|
|
42078
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
41887
|
+
const { inputWidth, suggestionsWidth } = (0, import_react164.useMemo)(() => {
|
|
42079
41888
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
42080
41889
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
42081
41890
|
}, [terminalWidth]);
|
|
42082
41891
|
const mainAreaWidth = Math.min(terminalWidth - 4, 100);
|
|
42083
41892
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
42084
|
-
const isValidPath = (0,
|
|
41893
|
+
const isValidPath = (0, import_react164.useCallback)((filePath) => {
|
|
42085
41894
|
try {
|
|
42086
41895
|
return fs20.existsSync(filePath) && fs20.statSync(filePath).isFile();
|
|
42087
41896
|
} catch (_e) {
|
|
@@ -42098,9 +41907,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42098
41907
|
shellModeActive,
|
|
42099
41908
|
preferredEditor
|
|
42100
41909
|
});
|
|
42101
|
-
const restoredPromptStashTargetsRef = (0,
|
|
41910
|
+
const restoredPromptStashTargetsRef = (0, import_react164.useRef)(/* @__PURE__ */ new Set());
|
|
42102
41911
|
const promptStashTargetDir = config.getTargetDir();
|
|
42103
|
-
(0,
|
|
41912
|
+
(0, import_react164.useEffect)(() => {
|
|
42104
41913
|
if (restoredPromptStashTargetsRef.current.has(promptStashTargetDir)) {
|
|
42105
41914
|
return;
|
|
42106
41915
|
}
|
|
@@ -42111,7 +41920,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42111
41920
|
(text) => buffer.setText(text)
|
|
42112
41921
|
);
|
|
42113
41922
|
}, [buffer, promptStashTargetDir]);
|
|
42114
|
-
(0,
|
|
41923
|
+
(0, import_react164.useEffect)(() => {
|
|
42115
41924
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
42116
41925
|
const pastMessagesRaw = await logger?.getPreviousUserMessages() || [];
|
|
42117
41926
|
const currentSessionUserMessages = historyManager.history.filter(
|
|
@@ -42125,12 +41934,12 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42125
41934
|
}, "fetchUserMessages");
|
|
42126
41935
|
fetchUserMessages();
|
|
42127
41936
|
}, [historyManager.history, logger]);
|
|
42128
|
-
const remountStaticHistory = (0,
|
|
41937
|
+
const remountStaticHistory = (0, import_react164.useCallback)(() => {
|
|
42129
41938
|
setHistoryRemountKey((prev) => prev + 1);
|
|
42130
41939
|
}, []);
|
|
42131
41940
|
const useTerminalBuffer = settings.merged.ui?.useTerminalBuffer ?? false;
|
|
42132
41941
|
const showScrollbar = settings.merged.ui?.showScrollbar ?? true;
|
|
42133
|
-
const refreshStatic = (0,
|
|
41942
|
+
const refreshStatic = (0, import_react164.useCallback)(() => {
|
|
42134
41943
|
if (isTranscriptOpenRef.current) {
|
|
42135
41944
|
return;
|
|
42136
41945
|
}
|
|
@@ -42139,15 +41948,15 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42139
41948
|
}
|
|
42140
41949
|
remountStaticHistory();
|
|
42141
41950
|
}, [useTerminalBuffer, remountStaticHistory, stdout]);
|
|
42142
|
-
const prevTranscriptOpenRef = (0,
|
|
41951
|
+
const prevTranscriptOpenRef = (0, import_react164.useRef)(isTranscriptOpen);
|
|
42143
41952
|
const wasOpenPrevRender = prevTranscriptOpenRef.current;
|
|
42144
41953
|
prevTranscriptOpenRef.current = isTranscriptOpen;
|
|
42145
|
-
const transcriptCloseCountRef = (0,
|
|
41954
|
+
const transcriptCloseCountRef = (0, import_react164.useRef)(0);
|
|
42146
41955
|
if (wasOpenPrevRender && !isTranscriptOpen) {
|
|
42147
41956
|
transcriptCloseCountRef.current += 1;
|
|
42148
41957
|
}
|
|
42149
41958
|
const transcriptCloseCount = transcriptCloseCountRef.current;
|
|
42150
|
-
(0,
|
|
41959
|
+
(0, import_react164.useEffect)(() => {
|
|
42151
41960
|
if (transcriptCloseCount === 0 || useTerminalBuffer) {
|
|
42152
41961
|
return void 0;
|
|
42153
41962
|
}
|
|
@@ -42160,8 +41969,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42160
41969
|
}, 0);
|
|
42161
41970
|
return () => clearTimeout(id);
|
|
42162
41971
|
}, [transcriptCloseCount, useTerminalBuffer, stdout, remountStaticHistory]);
|
|
42163
|
-
const lastNotifiedModelRef = (0,
|
|
42164
|
-
(0,
|
|
41972
|
+
const lastNotifiedModelRef = (0, import_react164.useRef)(currentModel);
|
|
41973
|
+
(0, import_react164.useEffect)(() => {
|
|
42165
41974
|
const unsubscribe = config.onModelChange((model) => {
|
|
42166
41975
|
if (lastNotifiedModelRef.current === model) {
|
|
42167
41976
|
return;
|
|
@@ -42199,7 +42008,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42199
42008
|
const { onAuthError, openAuthDialog, closeAuthDialog } = authActions;
|
|
42200
42009
|
const { isAuthDialogOpen, isAuthenticating, pendingAuthType } = authState;
|
|
42201
42010
|
useInitializationAuthError(initializationResult.authError, onAuthError);
|
|
42202
|
-
(0,
|
|
42011
|
+
(0, import_react164.useEffect)(() => {
|
|
42203
42012
|
const currentAuthType = config.getModelsConfig().getCurrentAuthType();
|
|
42204
42013
|
if (settings.merged.security?.auth?.enforcedType && currentAuthType && settings.merged.security?.auth.enforcedType !== currentAuthType) {
|
|
42205
42014
|
onAuthError(
|
|
@@ -42213,7 +42022,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42213
42022
|
);
|
|
42214
42023
|
}
|
|
42215
42024
|
}, [settings.merged.security?.auth?.enforcedType, config, onAuthError]);
|
|
42216
|
-
const [editorError, setEditorError] = (0,
|
|
42025
|
+
const [editorError, setEditorError] = (0, import_react164.useState)(null);
|
|
42217
42026
|
const {
|
|
42218
42027
|
isEditorDialogOpen,
|
|
42219
42028
|
openEditorDialog,
|
|
@@ -42221,18 +42030,18 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42221
42030
|
exitEditorDialog
|
|
42222
42031
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
42223
42032
|
const { isSettingsDialogOpen, openSettingsDialog, closeSettingsDialog } = useSettingsCommand();
|
|
42224
|
-
const [isStatusLineDialogOpen, setStatusLineDialogOpen] = (0,
|
|
42225
|
-
const openStatusLineDialog = (0,
|
|
42033
|
+
const [isStatusLineDialogOpen, setStatusLineDialogOpen] = (0, import_react164.useState)(false);
|
|
42034
|
+
const openStatusLineDialog = (0, import_react164.useCallback)(
|
|
42226
42035
|
() => setStatusLineDialogOpen(true),
|
|
42227
42036
|
[]
|
|
42228
42037
|
);
|
|
42229
|
-
const closeStatusLineDialog = (0,
|
|
42038
|
+
const closeStatusLineDialog = (0, import_react164.useCallback)(
|
|
42230
42039
|
() => setStatusLineDialogOpen(false),
|
|
42231
42040
|
[]
|
|
42232
42041
|
);
|
|
42233
|
-
const [statusLineSettingsVersion, setStatusLineSettingsVersion] = (0,
|
|
42234
|
-
const [statusLineConfigOverride, setStatusLineConfigOverride] = (0,
|
|
42235
|
-
const notifyStatusLineSettingsChanged = (0,
|
|
42042
|
+
const [statusLineSettingsVersion, setStatusLineSettingsVersion] = (0, import_react164.useState)(0);
|
|
42043
|
+
const [statusLineConfigOverride, setStatusLineConfigOverride] = (0, import_react164.useState)(void 0);
|
|
42044
|
+
const notifyStatusLineSettingsChanged = (0, import_react164.useCallback)(
|
|
42236
42045
|
(newConfig) => {
|
|
42237
42046
|
setStatusLineConfigOverride(newConfig);
|
|
42238
42047
|
setStatusLineSettingsVersion((version) => version + 1);
|
|
@@ -42250,8 +42059,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42250
42059
|
closeModelDialog
|
|
42251
42060
|
} = useModelCommand();
|
|
42252
42061
|
const { activeArenaDialog, openArenaDialog, closeArenaDialog } = useArenaCommand();
|
|
42253
|
-
const [sessionName, setSessionName] = (0,
|
|
42254
|
-
(0,
|
|
42062
|
+
const [sessionName, setSessionName] = (0, import_react164.useState)(null);
|
|
42063
|
+
(0, import_react164.useEffect)(() => {
|
|
42255
42064
|
const chatRecordingService = config.getChatRecordingService();
|
|
42256
42065
|
if (!chatRecordingService?.setTitleRecordedCallback) return;
|
|
42257
42066
|
const existingCallback = chatRecordingService.getTitleRecordedCallback();
|
|
@@ -42268,7 +42077,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42268
42077
|
};
|
|
42269
42078
|
}, [config]);
|
|
42270
42079
|
const addHistoryItem = historyManager.addItem;
|
|
42271
|
-
(0,
|
|
42080
|
+
(0, import_react164.useEffect)(() => {
|
|
42272
42081
|
if (typeof config.onChatRecordingFailure !== "function") return;
|
|
42273
42082
|
return config.onChatRecordingFailure(() => {
|
|
42274
42083
|
addHistoryItem(
|
|
@@ -42312,10 +42121,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42312
42121
|
config,
|
|
42313
42122
|
addItem: historyManager.addItem
|
|
42314
42123
|
});
|
|
42315
|
-
const [isHelpDialogOpen, setHelpDialogOpen] = (0,
|
|
42316
|
-
const [activeHelpTab, setHelpTab] = (0,
|
|
42317
|
-
const openHelpDialog = (0,
|
|
42318
|
-
const closeHelpDialog = (0,
|
|
42124
|
+
const [isHelpDialogOpen, setHelpDialogOpen] = (0, import_react164.useState)(false);
|
|
42125
|
+
const [activeHelpTab, setHelpTab] = (0, import_react164.useState)("general");
|
|
42126
|
+
const openHelpDialog = (0, import_react164.useCallback)(() => setHelpDialogOpen(true), []);
|
|
42127
|
+
const closeHelpDialog = (0, import_react164.useCallback)(() => setHelpDialogOpen(false), []);
|
|
42319
42128
|
const { vimEnabled, vimMode } = useVimModeState();
|
|
42320
42129
|
const { toggleVimEnabled } = useVimModeActions();
|
|
42321
42130
|
const {
|
|
@@ -42341,31 +42150,31 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42341
42150
|
const { isMcpDialogOpen, openMcpDialog, closeMcpDialog } = useMcpDialog();
|
|
42342
42151
|
const { isHooksDialogOpen, openHooksDialog, closeHooksDialog } = useHooksDialog();
|
|
42343
42152
|
const { isStatsDialogOpen, openStatsDialog, closeStatsDialog } = useStatsDialog();
|
|
42344
|
-
const openRewindSelectorRef = (0,
|
|
42153
|
+
const openRewindSelectorRef = (0, import_react164.useRef)(() => {
|
|
42345
42154
|
});
|
|
42346
|
-
const cancelOngoingRequestRef = (0,
|
|
42155
|
+
const cancelOngoingRequestRef = (0, import_react164.useRef)(() => {
|
|
42347
42156
|
});
|
|
42348
|
-
const [isDiffDialogOpen, setIsDiffDialogOpen] = (0,
|
|
42349
|
-
const openDiffDialog = (0,
|
|
42157
|
+
const [isDiffDialogOpen, setIsDiffDialogOpen] = (0, import_react164.useState)(false);
|
|
42158
|
+
const openDiffDialog = (0, import_react164.useCallback)(() => {
|
|
42350
42159
|
setIsDiffDialogOpen(true);
|
|
42351
42160
|
}, []);
|
|
42352
|
-
const closeDiffDialog = (0,
|
|
42161
|
+
const closeDiffDialog = (0, import_react164.useCallback)(() => {
|
|
42353
42162
|
setIsDiffDialogOpen(false);
|
|
42354
42163
|
}, []);
|
|
42355
|
-
const [isSkillReviewDialogOpen, setIsSkillReviewDialogOpen] = (0,
|
|
42356
|
-
const [skillReviewPending, setSkillReviewPending] = (0,
|
|
42357
|
-
const skillReviewDismissedTaskIdsRef = (0,
|
|
42358
|
-
const dismissSkillReviewDialog = (0,
|
|
42164
|
+
const [isSkillReviewDialogOpen, setIsSkillReviewDialogOpen] = (0, import_react164.useState)(false);
|
|
42165
|
+
const [skillReviewPending, setSkillReviewPending] = (0, import_react164.useState)(null);
|
|
42166
|
+
const skillReviewDismissedTaskIdsRef = (0, import_react164.useRef)(/* @__PURE__ */ new Set());
|
|
42167
|
+
const dismissSkillReviewDialog = (0, import_react164.useCallback)(() => {
|
|
42359
42168
|
if (skillReviewPending) {
|
|
42360
42169
|
skillReviewDismissedTaskIdsRef.current.add(skillReviewPending.taskId);
|
|
42361
42170
|
}
|
|
42362
42171
|
setIsSkillReviewDialogOpen(false);
|
|
42363
42172
|
}, [skillReviewPending]);
|
|
42364
|
-
const closeSkillReviewDialog = (0,
|
|
42173
|
+
const closeSkillReviewDialog = (0, import_react164.useCallback)(
|
|
42365
42174
|
() => setIsSkillReviewDialogOpen(false),
|
|
42366
42175
|
[]
|
|
42367
42176
|
);
|
|
42368
|
-
const acceptPendingSkill = (0,
|
|
42177
|
+
const acceptPendingSkill = (0, import_react164.useCallback)(
|
|
42369
42178
|
(skillName) => {
|
|
42370
42179
|
if (!skillReviewPending) return;
|
|
42371
42180
|
void config.getMemoryManager().acceptPendingSkillFromTask(skillReviewPending.taskId, skillName).catch(() => {
|
|
@@ -42373,7 +42182,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42373
42182
|
},
|
|
42374
42183
|
[config, skillReviewPending]
|
|
42375
42184
|
);
|
|
42376
|
-
const rejectPendingSkill = (0,
|
|
42185
|
+
const rejectPendingSkill = (0, import_react164.useCallback)(
|
|
42377
42186
|
(skillName) => {
|
|
42378
42187
|
if (!skillReviewPending) return;
|
|
42379
42188
|
void config.getMemoryManager().rejectPendingSkillFromTask(skillReviewPending.taskId, skillName).catch(() => {
|
|
@@ -42381,7 +42190,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42381
42190
|
},
|
|
42382
42191
|
[config, skillReviewPending]
|
|
42383
42192
|
);
|
|
42384
|
-
(0,
|
|
42193
|
+
(0, import_react164.useEffect)(() => {
|
|
42385
42194
|
const mgr = config.getMemoryManager();
|
|
42386
42195
|
const projectRoot = config.getProjectRoot();
|
|
42387
42196
|
let lastSig = "";
|
|
@@ -42415,7 +42224,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42415
42224
|
refresh();
|
|
42416
42225
|
return unsub;
|
|
42417
42226
|
}, [config]);
|
|
42418
|
-
const slashCommandActions = (0,
|
|
42227
|
+
const slashCommandActions = (0, import_react164.useMemo)(
|
|
42419
42228
|
() => ({
|
|
42420
42229
|
openAuthDialog,
|
|
42421
42230
|
openThemeDialog,
|
|
@@ -42525,13 +42334,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42525
42334
|
setSessionName,
|
|
42526
42335
|
extensionRefreshState
|
|
42527
42336
|
);
|
|
42528
|
-
const onDebugMessage = (0,
|
|
42337
|
+
const onDebugMessage = (0, import_react164.useCallback)(
|
|
42529
42338
|
(message) => {
|
|
42530
42339
|
config.getDebugLogger().debug(message);
|
|
42531
42340
|
},
|
|
42532
42341
|
[config]
|
|
42533
42342
|
);
|
|
42534
|
-
const handleWorktreeExit = (0,
|
|
42343
|
+
const handleWorktreeExit = (0, import_react164.useCallback)(
|
|
42535
42344
|
async (choice) => {
|
|
42536
42345
|
if (choice === "cancel") {
|
|
42537
42346
|
setShowWorktreeExitDialog(false);
|
|
@@ -42596,7 +42405,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42596
42405
|
},
|
|
42597
42406
|
[activeWorktree, config, handleSlashCommand, historyManager]
|
|
42598
42407
|
);
|
|
42599
|
-
const performMemoryRefresh = (0,
|
|
42408
|
+
const performMemoryRefresh = (0, import_react164.useCallback)(async () => {
|
|
42600
42409
|
if (config.isSafeMode()) {
|
|
42601
42410
|
config.setUserMemory("");
|
|
42602
42411
|
config.setGeminiMdFileCount(0);
|
|
@@ -42668,10 +42477,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42668
42477
|
debugLogger40.error("Error refreshing memory:", error);
|
|
42669
42478
|
}
|
|
42670
42479
|
}, [config, historyManager, settings.merged]);
|
|
42671
|
-
const cancelHandlerRef = (0,
|
|
42480
|
+
const cancelHandlerRef = (0, import_react164.useRef)(() => {
|
|
42672
42481
|
});
|
|
42673
|
-
const midTurnDrainRef = (0,
|
|
42674
|
-
const midTurnRestoreRef = (0,
|
|
42482
|
+
const midTurnDrainRef = (0, import_react164.useRef)(null);
|
|
42483
|
+
const midTurnRestoreRef = (0, import_react164.useRef)(null);
|
|
42675
42484
|
const {
|
|
42676
42485
|
streamingState,
|
|
42677
42486
|
submitQuery,
|
|
@@ -42714,13 +42523,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42714
42523
|
);
|
|
42715
42524
|
cancelOngoingRequestRef.current = cancelOngoingRequest;
|
|
42716
42525
|
isIdleRef.current = streamingState === "idle" /* Idle */;
|
|
42717
|
-
(0,
|
|
42526
|
+
(0, import_react164.useEffect)(() => {
|
|
42718
42527
|
if (streamingState === "idle" /* Idle */) {
|
|
42719
42528
|
updateHandlerRef.current?.flush();
|
|
42720
42529
|
setWorkflowKeywordActive(false);
|
|
42721
42530
|
}
|
|
42722
42531
|
}, [streamingState]);
|
|
42723
|
-
(0,
|
|
42532
|
+
(0, import_react164.useEffect)(() => {
|
|
42724
42533
|
if (shouldAutoOpenSkillReview({
|
|
42725
42534
|
pending: skillReviewPending,
|
|
42726
42535
|
streamingState,
|
|
@@ -42732,7 +42541,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42732
42541
|
}
|
|
42733
42542
|
}, [skillReviewPending, streamingState, isMemoryDialogOpen, config]);
|
|
42734
42543
|
const tipsDisabled = !!(settings.merged.ui?.hideTips || config.getScreenReader());
|
|
42735
|
-
const tipHistory = (0,
|
|
42544
|
+
const tipHistory = (0, import_react164.useMemo)(
|
|
42736
42545
|
() => tipsDisabled ? null : getTipHistory(),
|
|
42737
42546
|
[tipsDisabled]
|
|
42738
42547
|
);
|
|
@@ -42745,7 +42554,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42745
42554
|
addItem: historyManager.addItem,
|
|
42746
42555
|
hideTips: tipsDisabled
|
|
42747
42556
|
});
|
|
42748
|
-
const [hasTabConsumer, setHasTabConsumer] = (0,
|
|
42557
|
+
const [hasTabConsumer, setHasTabConsumer] = (0, import_react164.useState)(false);
|
|
42749
42558
|
const agentViewState = useAgentViewState();
|
|
42750
42559
|
const {
|
|
42751
42560
|
dialogOpen: bgTasksDialogOpen,
|
|
@@ -42753,11 +42562,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42753
42562
|
livePanelFocused: bgLivePanelFocused
|
|
42754
42563
|
} = useBackgroundTaskViewState();
|
|
42755
42564
|
const { closeDialog: closeBgTasksDialog } = useBackgroundTaskViewActions();
|
|
42756
|
-
const [promptSuggestion, setPromptSuggestion] = (0,
|
|
42757
|
-
const prevStreamingStateRef = (0,
|
|
42758
|
-
const speculationRef = (0,
|
|
42759
|
-
const suggestionAbortRef = (0,
|
|
42760
|
-
const abortPromptSuggestion = (0,
|
|
42565
|
+
const [promptSuggestion, setPromptSuggestion] = (0, import_react164.useState)(null);
|
|
42566
|
+
const prevStreamingStateRef = (0, import_react164.useRef)("idle" /* Idle */);
|
|
42567
|
+
const speculationRef = (0, import_react164.useRef)(IDLE_SPECULATION);
|
|
42568
|
+
const suggestionAbortRef = (0, import_react164.useRef)(null);
|
|
42569
|
+
const abortPromptSuggestion = (0, import_react164.useCallback)(() => {
|
|
42761
42570
|
suggestionAbortRef.current?.abort();
|
|
42762
42571
|
suggestionAbortRef.current = null;
|
|
42763
42572
|
if (speculationRef.current.status !== "idle") {
|
|
@@ -42786,21 +42595,21 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42786
42595
|
midTurnDrainRef.current = drainQueue;
|
|
42787
42596
|
midTurnRestoreRef.current = restoreMessages;
|
|
42788
42597
|
const remoteInput = useRemoteInput();
|
|
42789
|
-
(0,
|
|
42598
|
+
(0, import_react164.useEffect)(() => {
|
|
42790
42599
|
if (!remoteInput) return;
|
|
42791
42600
|
remoteInput.setSubmitFn((text) => submitQuery(text));
|
|
42792
42601
|
}, [remoteInput, submitQuery]);
|
|
42793
|
-
(0,
|
|
42602
|
+
(0, import_react164.useEffect)(() => {
|
|
42794
42603
|
if (!remoteInput) return;
|
|
42795
42604
|
if (streamingState === "idle" /* Idle */) {
|
|
42796
42605
|
remoteInput.notifyIdle();
|
|
42797
42606
|
}
|
|
42798
42607
|
}, [remoteInput, streamingState]);
|
|
42799
42608
|
const dualOutput = useDualOutput();
|
|
42800
|
-
const confirmRequestMap = (0,
|
|
42801
|
-
const confirmCallIdMap = (0,
|
|
42802
|
-
const confirmEmitted = (0,
|
|
42803
|
-
(0,
|
|
42609
|
+
const confirmRequestMap = (0, import_react164.useRef)(/* @__PURE__ */ new Map());
|
|
42610
|
+
const confirmCallIdMap = (0, import_react164.useRef)(/* @__PURE__ */ new Map());
|
|
42611
|
+
const confirmEmitted = (0, import_react164.useRef)(/* @__PURE__ */ new Set());
|
|
42612
|
+
(0, import_react164.useEffect)(() => {
|
|
42804
42613
|
if (!dualOutput || !dualOutput.isConnected) return;
|
|
42805
42614
|
for (const tc of pendingToolCalls) {
|
|
42806
42615
|
if (tc.status === "awaiting_approval" && !confirmEmitted.current.has(tc.request.callId)) {
|
|
@@ -42812,9 +42621,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42812
42621
|
requestId,
|
|
42813
42622
|
tc.request.name,
|
|
42814
42623
|
tc.request.callId,
|
|
42815
|
-
tc.request.args
|
|
42816
|
-
null,
|
|
42817
|
-
buildPermissionSuggestions(tc.confirmationDetails)
|
|
42624
|
+
tc.request.args
|
|
42818
42625
|
);
|
|
42819
42626
|
}
|
|
42820
42627
|
}
|
|
@@ -42829,11 +42636,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42829
42636
|
}
|
|
42830
42637
|
}
|
|
42831
42638
|
}, [dualOutput, pendingToolCalls]);
|
|
42832
|
-
const pendingToolCallsRef = (0,
|
|
42639
|
+
const pendingToolCallsRef = (0, import_react164.useRef)(pendingToolCalls);
|
|
42833
42640
|
pendingToolCallsRef.current = pendingToolCalls;
|
|
42834
|
-
const dualOutputRef = (0,
|
|
42641
|
+
const dualOutputRef = (0, import_react164.useRef)(dualOutput);
|
|
42835
42642
|
dualOutputRef.current = dualOutput;
|
|
42836
|
-
(0,
|
|
42643
|
+
(0, import_react164.useEffect)(() => {
|
|
42837
42644
|
if (!remoteInput) return;
|
|
42838
42645
|
remoteInput.setConfirmationHandler(
|
|
42839
42646
|
(requestId, allowed) => {
|
|
@@ -42873,7 +42680,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
42873
42680
|
});
|
|
42874
42681
|
};
|
|
42875
42682
|
}, [remoteInput]);
|
|
42876
|
-
const handleFinalSubmit = (0,
|
|
42683
|
+
const handleFinalSubmit = (0, import_react164.useCallback)(
|
|
42877
42684
|
(submittedValue, options) => {
|
|
42878
42685
|
if (agentViewState.activeView !== "main") {
|
|
42879
42686
|
const agent = agentViewState.agents.get(agentViewState.activeView);
|
|
@@ -43019,7 +42826,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43019
42826
|
settings.merged.ui?.disableWorkflowKeywordTrigger
|
|
43020
42827
|
]
|
|
43021
42828
|
);
|
|
43022
|
-
const handleArenaModelsSelected = (0,
|
|
42829
|
+
const handleArenaModelsSelected = (0, import_react164.useCallback)(
|
|
43023
42830
|
(models) => {
|
|
43024
42831
|
const value = models.join(",");
|
|
43025
42832
|
buffer.setText(`/arena start --models ${value} `);
|
|
@@ -43034,15 +42841,15 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43034
42841
|
handleWelcomeBackSelection,
|
|
43035
42842
|
handleWelcomeBackClose
|
|
43036
42843
|
} = useWelcomeBack(config, handleFinalSubmit, buffer, settings.merged);
|
|
43037
|
-
const pendingHistoryItems = (0,
|
|
42844
|
+
const pendingHistoryItems = (0, import_react164.useMemo)(
|
|
43038
42845
|
() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
|
|
43039
42846
|
[pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]
|
|
43040
42847
|
);
|
|
43041
|
-
const historyForTranscriptRef = (0,
|
|
42848
|
+
const historyForTranscriptRef = (0, import_react164.useRef)(historyManager.history);
|
|
43042
42849
|
historyForTranscriptRef.current = historyManager.history;
|
|
43043
|
-
const pendingForTranscriptRef = (0,
|
|
42850
|
+
const pendingForTranscriptRef = (0, import_react164.useRef)(pendingHistoryItems);
|
|
43044
42851
|
pendingForTranscriptRef.current = pendingHistoryItems;
|
|
43045
|
-
const openTranscript = (0,
|
|
42852
|
+
const openTranscript = (0, import_react164.useCallback)(() => {
|
|
43046
42853
|
setTranscriptFreeze({
|
|
43047
42854
|
// Share MainContent's visibility predicate so the transcript shows exactly
|
|
43048
42855
|
// what the main view shows. Items collapsed on session resume
|
|
@@ -43054,7 +42861,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43054
42861
|
pendingItems: [...pendingForTranscriptRef.current]
|
|
43055
42862
|
});
|
|
43056
42863
|
}, []);
|
|
43057
|
-
const transcriptItems = (0,
|
|
42864
|
+
const transcriptItems = (0, import_react164.useMemo)(() => {
|
|
43058
42865
|
if (!transcriptFreeze) return EMPTY_HISTORY_ITEMS;
|
|
43059
42866
|
return [
|
|
43060
42867
|
...transcriptFreeze.committedItems,
|
|
@@ -43066,7 +42873,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43066
42873
|
}))
|
|
43067
42874
|
];
|
|
43068
42875
|
}, [transcriptFreeze]);
|
|
43069
|
-
const rawStickyTodos = (0,
|
|
42876
|
+
const rawStickyTodos = (0, import_react164.useMemo)(
|
|
43070
42877
|
() => getStickyTodos(historyManager.history, pendingHistoryItems),
|
|
43071
42878
|
[historyManager.history, pendingHistoryItems]
|
|
43072
42879
|
);
|
|
@@ -43074,7 +42881,7 @@ ${buildWorkflowSteeringNotice()}
|
|
|
43074
42881
|
const hasExecutingTool = isToolExecuting(pendingHistoryItems);
|
|
43075
42882
|
const hasPendingCompression = isCompressionPending(pendingHistoryItems);
|
|
43076
42883
|
useTerminalProgress(streamingState, hasExecutingTool);
|
|
43077
|
-
cancelHandlerRef.current = (0,
|
|
42884
|
+
cancelHandlerRef.current = (0, import_react164.useCallback)(
|
|
43078
42885
|
(info) => {
|
|
43079
42886
|
const pendingHistoryItems2 = [
|
|
43080
42887
|
...pendingSlashCommandHistoryItems,
|
|
@@ -43174,7 +42981,7 @@ ${currentText}` : popped);
|
|
|
43174
42981
|
pendingGeminiHistoryItems
|
|
43175
42982
|
]
|
|
43176
42983
|
);
|
|
43177
|
-
const handleClearScreen = (0,
|
|
42984
|
+
const handleClearScreen = (0, import_react164.useCallback)(() => {
|
|
43178
42985
|
historyManager.clearItems();
|
|
43179
42986
|
clearScreen();
|
|
43180
42987
|
remountStaticHistory();
|
|
@@ -43197,13 +43004,13 @@ ${currentText}` : popped);
|
|
|
43197
43004
|
history: historyManager.history,
|
|
43198
43005
|
awayThresholdMinutes: settings.merged.general?.sessionRecapAwayThresholdMinutes
|
|
43199
43006
|
});
|
|
43200
|
-
const contextFileNames = (0,
|
|
43007
|
+
const contextFileNames = (0, import_react164.useMemo)(() => {
|
|
43201
43008
|
const fromSettings = settings.merged.context?.fileName;
|
|
43202
43009
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllGeminiMdFilenames();
|
|
43203
43010
|
}, [settings.merged.context?.fileName]);
|
|
43204
|
-
const initialPrompt = (0,
|
|
43205
|
-
const initialPromptSubmitted = (0,
|
|
43206
|
-
(0,
|
|
43011
|
+
const initialPrompt = (0, import_react164.useMemo)(() => config.getQuestion(), [config]);
|
|
43012
|
+
const initialPromptSubmitted = (0, import_react164.useRef)(false);
|
|
43013
|
+
(0, import_react164.useEffect)(() => {
|
|
43207
43014
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && welcomeBackChoice !== "restart" && geminiClient?.isInitialized?.()) {
|
|
43208
43015
|
handleFinalSubmit(initialPrompt);
|
|
43209
43016
|
initialPromptSubmitted.current = true;
|
|
@@ -43221,7 +43028,7 @@ ${currentText}` : popped);
|
|
|
43221
43028
|
geminiClient
|
|
43222
43029
|
]);
|
|
43223
43030
|
const followupSuggestionsEnabled = settings.merged.ui?.enableFollowupSuggestions !== false;
|
|
43224
|
-
(0,
|
|
43031
|
+
(0, import_react164.useEffect)(() => {
|
|
43225
43032
|
if (!followupSuggestionsEnabled) {
|
|
43226
43033
|
suggestionAbortRef.current?.abort();
|
|
43227
43034
|
setPromptSuggestion(null);
|
|
@@ -43290,17 +43097,17 @@ ${currentText}` : popped);
|
|
|
43290
43097
|
isPermissionsDialogOpen,
|
|
43291
43098
|
settingInputRequests
|
|
43292
43099
|
]);
|
|
43293
|
-
(0,
|
|
43100
|
+
(0, import_react164.useEffect)(() => {
|
|
43294
43101
|
if (!promptSuggestion && speculationRef.current.status !== "idle") {
|
|
43295
43102
|
abortSpeculation(speculationRef.current).catch(() => {
|
|
43296
43103
|
});
|
|
43297
43104
|
speculationRef.current = IDLE_SPECULATION;
|
|
43298
43105
|
}
|
|
43299
43106
|
}, [promptSuggestion]);
|
|
43300
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
43301
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
43302
|
-
const [startupIdeConnectionStatus, setStartupIdeConnectionStatus] = (0,
|
|
43303
|
-
(0,
|
|
43107
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react164.useState)(false);
|
|
43108
|
+
const [currentIDE, setCurrentIDE] = (0, import_react164.useState)(null);
|
|
43109
|
+
const [startupIdeConnectionStatus, setStartupIdeConnectionStatus] = (0, import_react164.useState)({ state: "idle" });
|
|
43110
|
+
(0, import_react164.useEffect)(() => {
|
|
43304
43111
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
43305
43112
|
const ideClient = await IdeClient.getInstance();
|
|
43306
43113
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -43316,40 +43123,40 @@ ${currentText}` : popped);
|
|
|
43316
43123
|
tomlFiles: commandMigrationTomlFiles,
|
|
43317
43124
|
setShowMigrationNudge: setShowCommandMigrationNudge
|
|
43318
43125
|
} = useCommandMigration(settings, config.storage);
|
|
43319
|
-
const [showToolDescriptions, setShowToolDescriptions] = (0,
|
|
43126
|
+
const [showToolDescriptions, setShowToolDescriptions] = (0, import_react164.useState)(false);
|
|
43320
43127
|
const configuredRenderMode = settings.merged.ui?.renderMode;
|
|
43321
|
-
const [renderMode, setRenderMode] = (0,
|
|
43128
|
+
const [renderMode, setRenderMode] = (0, import_react164.useState)(
|
|
43322
43129
|
configuredRenderMode === "raw" ? "raw" : "render"
|
|
43323
43130
|
);
|
|
43324
|
-
const renderModeConfigMountedRef = (0,
|
|
43325
|
-
(0,
|
|
43131
|
+
const renderModeConfigMountedRef = (0, import_react164.useRef)(false);
|
|
43132
|
+
(0, import_react164.useEffect)(() => {
|
|
43326
43133
|
if (!renderModeConfigMountedRef.current) {
|
|
43327
43134
|
renderModeConfigMountedRef.current = true;
|
|
43328
43135
|
return;
|
|
43329
43136
|
}
|
|
43330
43137
|
setRenderMode(configuredRenderMode === "raw" ? "raw" : "render");
|
|
43331
43138
|
}, [configuredRenderMode]);
|
|
43332
|
-
const renderModeMountedRef = (0,
|
|
43333
|
-
(0,
|
|
43139
|
+
const renderModeMountedRef = (0, import_react164.useRef)(false);
|
|
43140
|
+
(0, import_react164.useEffect)(() => {
|
|
43334
43141
|
if (!renderModeMountedRef.current) {
|
|
43335
43142
|
renderModeMountedRef.current = true;
|
|
43336
43143
|
return;
|
|
43337
43144
|
}
|
|
43338
43145
|
refreshStatic();
|
|
43339
43146
|
}, [renderMode, refreshStatic]);
|
|
43340
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0,
|
|
43341
|
-
const ctrlCTimerRef = (0,
|
|
43342
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0,
|
|
43343
|
-
const ctrlDTimerRef = (0,
|
|
43344
|
-
const [escapePressedOnce, setEscapePressedOnce] = (0,
|
|
43345
|
-
const escapeTimerRef = (0,
|
|
43346
|
-
const dialogsVisibleRef = (0,
|
|
43347
|
-
const [isRewindSelectorOpen, setIsRewindSelectorOpen] = (0,
|
|
43348
|
-
const [rewindEscPending, setRewindEscPending] = (0,
|
|
43349
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
43350
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
43351
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
43352
|
-
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0,
|
|
43147
|
+
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0, import_react164.useState)(false);
|
|
43148
|
+
const ctrlCTimerRef = (0, import_react164.useRef)(null);
|
|
43149
|
+
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0, import_react164.useState)(false);
|
|
43150
|
+
const ctrlDTimerRef = (0, import_react164.useRef)(null);
|
|
43151
|
+
const [escapePressedOnce, setEscapePressedOnce] = (0, import_react164.useState)(false);
|
|
43152
|
+
const escapeTimerRef = (0, import_react164.useRef)(null);
|
|
43153
|
+
const dialogsVisibleRef = (0, import_react164.useRef)(false);
|
|
43154
|
+
const [isRewindSelectorOpen, setIsRewindSelectorOpen] = (0, import_react164.useState)(false);
|
|
43155
|
+
const [rewindEscPending, setRewindEscPending] = (0, import_react164.useState)(false);
|
|
43156
|
+
const [constrainHeight, setConstrainHeight] = (0, import_react164.useState)(true);
|
|
43157
|
+
const [ideContextState, setIdeContextState] = (0, import_react164.useState)();
|
|
43158
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react164.useState)(false);
|
|
43159
|
+
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react164.useState)(false);
|
|
43353
43160
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings, setIsTrustedFolder);
|
|
43354
43161
|
const {
|
|
43355
43162
|
isMcpApprovalDialogOpen,
|
|
@@ -43378,7 +43185,7 @@ ${currentText}` : popped);
|
|
|
43378
43185
|
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);
|
|
43379
43186
|
dialogsVisibleRef.current = dialogsVisible;
|
|
43380
43187
|
const needsBlockingInput = dialogsVisible || streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
43381
|
-
(0,
|
|
43188
|
+
(0, import_react164.useEffect)(() => {
|
|
43382
43189
|
if (needsBlockingInput && isTranscriptOpen) {
|
|
43383
43190
|
closeTranscript();
|
|
43384
43191
|
}
|
|
@@ -43394,12 +43201,12 @@ ${currentText}` : popped);
|
|
|
43394
43201
|
stickyTodoWidth,
|
|
43395
43202
|
stickyTodoMaxVisibleItems
|
|
43396
43203
|
) : "hidden";
|
|
43397
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
43204
|
+
const [controlsHeight, setControlsHeight] = (0, import_react164.useState)(0);
|
|
43398
43205
|
const liveAgentPanelLayoutKey = getLiveAgentPanelLayoutKey(
|
|
43399
43206
|
bgTaskEntries,
|
|
43400
43207
|
bgLivePanelFocused
|
|
43401
43208
|
);
|
|
43402
|
-
(0,
|
|
43209
|
+
(0, import_react164.useLayoutEffect)(() => {
|
|
43403
43210
|
if (!mainControlsRef.current) {
|
|
43404
43211
|
setControlsHeight(
|
|
43405
43212
|
(previousHeight) => previousHeight === 0 ? previousHeight : 0
|
|
@@ -43418,13 +43225,10 @@ ${currentText}` : popped);
|
|
|
43418
43225
|
dialogsVisible,
|
|
43419
43226
|
stickyTodosLayoutKey,
|
|
43420
43227
|
liveAgentPanelLayoutKey,
|
|
43421
|
-
// Composer
|
|
43422
|
-
//
|
|
43423
|
-
// viewport bottom clips.
|
|
43228
|
+
// Composer height also shifts with these; without them the footer isn't
|
|
43229
|
+
// re-measured during a streaming turn and the VP viewport bottom clips.
|
|
43424
43230
|
// (elapsedTime/currentLoadingPhrase excluded: they tick without changing rows.)
|
|
43425
43231
|
streamingState,
|
|
43426
|
-
updateInfo,
|
|
43427
|
-
agentViewState.activeView,
|
|
43428
43232
|
embeddedShellFocused,
|
|
43429
43233
|
messageQueue.length,
|
|
43430
43234
|
isInputActive
|
|
@@ -43446,7 +43250,7 @@ ${currentText}` : popped);
|
|
|
43446
43250
|
pager: settings.merged.tools?.shell?.pager,
|
|
43447
43251
|
showColor: settings.merged.tools?.shell?.showColor
|
|
43448
43252
|
});
|
|
43449
|
-
(0,
|
|
43253
|
+
(0, import_react164.useEffect)(() => {
|
|
43450
43254
|
if (activePtyId) {
|
|
43451
43255
|
ShellExecutionService.resizePty(
|
|
43452
43256
|
activePtyId,
|
|
@@ -43456,18 +43260,17 @@ ${currentText}` : popped);
|
|
|
43456
43260
|
}
|
|
43457
43261
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
43458
43262
|
useResizeSettleRepaint(terminalWidth, refreshStatic);
|
|
43459
|
-
|
|
43460
|
-
(0, import_react165.useEffect)(() => {
|
|
43263
|
+
(0, import_react164.useEffect)(() => {
|
|
43461
43264
|
if (ideNeedsRestart) {
|
|
43462
43265
|
setShowIdeRestartPrompt(true);
|
|
43463
43266
|
}
|
|
43464
43267
|
}, [ideNeedsRestart]);
|
|
43465
|
-
(0,
|
|
43268
|
+
(0, import_react164.useEffect)(() => {
|
|
43466
43269
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
43467
43270
|
setIdeContextState(ideContextStore.get());
|
|
43468
43271
|
return unsubscribe;
|
|
43469
43272
|
}, []);
|
|
43470
|
-
(0,
|
|
43273
|
+
(0, import_react164.useEffect)(() => {
|
|
43471
43274
|
const listener = /* @__PURE__ */ __name((status) => {
|
|
43472
43275
|
setStartupIdeConnectionStatus(status);
|
|
43473
43276
|
}, "listener");
|
|
@@ -43476,10 +43279,10 @@ ${currentText}` : popped);
|
|
|
43476
43279
|
appEvents.off("startup-ide-connection-status-changed" /* StartupIdeConnectionStatusChanged */, listener);
|
|
43477
43280
|
};
|
|
43478
43281
|
}, []);
|
|
43479
|
-
const handleEscapePromptChange = (0,
|
|
43282
|
+
const handleEscapePromptChange = (0, import_react164.useCallback)((showPrompt) => {
|
|
43480
43283
|
setShowEscapePrompt(showPrompt);
|
|
43481
43284
|
}, []);
|
|
43482
|
-
const openRewindSelector = (0,
|
|
43285
|
+
const openRewindSelector = (0, import_react164.useCallback)(() => {
|
|
43483
43286
|
if (streamingState !== "idle" /* Idle */) return;
|
|
43484
43287
|
if (dialogsVisibleRef.current) return;
|
|
43485
43288
|
if (config.getIdeMode()) {
|
|
@@ -43497,10 +43300,10 @@ ${currentText}` : popped);
|
|
|
43497
43300
|
setIsRewindSelectorOpen(true);
|
|
43498
43301
|
}, [streamingState, config, historyManager]);
|
|
43499
43302
|
openRewindSelectorRef.current = openRewindSelector;
|
|
43500
|
-
const closeRewindSelector = (0,
|
|
43303
|
+
const closeRewindSelector = (0, import_react164.useCallback)(() => {
|
|
43501
43304
|
setIsRewindSelectorOpen(false);
|
|
43502
43305
|
}, []);
|
|
43503
|
-
const handleRewindConfirm = (0,
|
|
43306
|
+
const handleRewindConfirm = (0, import_react164.useCallback)(
|
|
43504
43307
|
async (userItem, option) => {
|
|
43505
43308
|
try {
|
|
43506
43309
|
const needsConversation = option === "conversation" || option === "both";
|
|
@@ -43662,7 +43465,7 @@ ${currentText}` : popped);
|
|
|
43662
43465
|
openRewindSelector,
|
|
43663
43466
|
(pending) => setRewindEscPending(pending)
|
|
43664
43467
|
);
|
|
43665
|
-
const handleIdePromptComplete = (0,
|
|
43468
|
+
const handleIdePromptComplete = (0, import_react164.useCallback)(
|
|
43666
43469
|
(result) => {
|
|
43667
43470
|
if (result.userSelection === "yes") {
|
|
43668
43471
|
if (result.isExtensionPreInstalled) {
|
|
@@ -43678,7 +43481,7 @@ ${currentText}` : popped);
|
|
|
43678
43481
|
},
|
|
43679
43482
|
[handleSlashCommand, settings]
|
|
43680
43483
|
);
|
|
43681
|
-
const handleCommandMigrationComplete = (0,
|
|
43484
|
+
const handleCommandMigrationComplete = (0, import_react164.useCallback)(
|
|
43682
43485
|
async (result) => {
|
|
43683
43486
|
setShowCommandMigrationNudge(false);
|
|
43684
43487
|
if (result.userSelection === "yes") {
|
|
@@ -43770,7 +43573,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43770
43573
|
pendingToolCalls
|
|
43771
43574
|
});
|
|
43772
43575
|
const workflowBellEnabled = settings.merged.general?.terminalBell ?? true;
|
|
43773
|
-
(0,
|
|
43576
|
+
(0, import_react164.useEffect)(() => {
|
|
43774
43577
|
const registry = config.getWorkflowRunRegistry?.();
|
|
43775
43578
|
if (!registry?.setNotificationCallback) return;
|
|
43776
43579
|
registry.setNotificationCallback((entry) => {
|
|
@@ -43820,7 +43623,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43820
43623
|
showWorktreeExitDialog,
|
|
43821
43624
|
closeWorktreeExitDialog: /* @__PURE__ */ __name(() => setShowWorktreeExitDialog(false), "closeWorktreeExitDialog")
|
|
43822
43625
|
});
|
|
43823
|
-
const handleExit = (0,
|
|
43626
|
+
const handleExit = (0, import_react164.useCallback)(
|
|
43824
43627
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
43825
43628
|
if (pressedOnce) {
|
|
43826
43629
|
if (timerRef.current) {
|
|
@@ -43873,7 +43676,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
43873
43676
|
activeWorktree
|
|
43874
43677
|
]
|
|
43875
43678
|
);
|
|
43876
|
-
const handleGlobalKeypress = (0,
|
|
43679
|
+
const handleGlobalKeypress = (0, import_react164.useCallback)(
|
|
43877
43680
|
(key) => {
|
|
43878
43681
|
if (settings.merged.general?.debugKeystrokeLogging) {
|
|
43879
43682
|
debugLogger40.debug("[DEBUG] Keystroke:", JSON.stringify(key));
|
|
@@ -44063,7 +43866,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44063
43866
|
]
|
|
44064
43867
|
);
|
|
44065
43868
|
useKeypress(handleGlobalKeypress, { isActive: true });
|
|
44066
|
-
(0,
|
|
43869
|
+
(0, import_react164.useEffect)(() => {
|
|
44067
43870
|
if (settings.merged.ui?.hideWindowTitle) {
|
|
44068
43871
|
return;
|
|
44069
43872
|
}
|
|
@@ -44090,9 +43893,9 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44090
43893
|
settings.merged.ui?.showStatusInTitle,
|
|
44091
43894
|
config
|
|
44092
43895
|
]);
|
|
44093
|
-
const queueDrainingRef = (0,
|
|
44094
|
-
const [queueDrainNonce, setQueueDrainNonce] = (0,
|
|
44095
|
-
(0,
|
|
43896
|
+
const queueDrainingRef = (0, import_react164.useRef)(false);
|
|
43897
|
+
const [queueDrainNonce, setQueueDrainNonce] = (0, import_react164.useState)(0);
|
|
43898
|
+
(0, import_react164.useEffect)(() => {
|
|
44096
43899
|
if (queueDrainingRef.current) return;
|
|
44097
43900
|
if (!shouldDrainMessageQueue({
|
|
44098
43901
|
isConfigInitialized,
|
|
@@ -44126,7 +43929,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44126
43929
|
queueDrainNonce
|
|
44127
43930
|
]);
|
|
44128
43931
|
const nightly = props.version.includes("nightly");
|
|
44129
|
-
const uiState = (0,
|
|
43932
|
+
const uiState = (0, import_react164.useMemo)(
|
|
44130
43933
|
() => ({
|
|
44131
43934
|
history: historyManager.history,
|
|
44132
43935
|
historyManager,
|
|
@@ -44417,7 +44220,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44417
44220
|
isDiffDialogOpen
|
|
44418
44221
|
]
|
|
44419
44222
|
);
|
|
44420
|
-
const uiActions = (0,
|
|
44223
|
+
const uiActions = (0, import_react164.useMemo)(
|
|
44421
44224
|
() => ({
|
|
44422
44225
|
openThemeDialog,
|
|
44423
44226
|
openEditorDialog,
|
|
@@ -44598,11 +44401,11 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44598
44401
|
closeDiffDialog
|
|
44599
44402
|
]
|
|
44600
44403
|
);
|
|
44601
|
-
const renderModeValue = (0,
|
|
44404
|
+
const renderModeValue = (0, import_react164.useMemo)(
|
|
44602
44405
|
() => ({ renderMode, setRenderMode }),
|
|
44603
44406
|
[renderMode, setRenderMode]
|
|
44604
44407
|
);
|
|
44605
|
-
const thoughtExpandedValue = (0,
|
|
44408
|
+
const thoughtExpandedValue = (0, import_react164.useMemo)(
|
|
44606
44409
|
() => ({
|
|
44607
44410
|
allExpanded: thoughtExpanded,
|
|
44608
44411
|
expandedHeadIds: expandedThoughtHeadIds,
|
|
@@ -44639,9 +44442,9 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
|
|
|
44639
44442
|
|
|
44640
44443
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
44641
44444
|
init_esbuild_shims();
|
|
44642
|
-
var
|
|
44445
|
+
var import_react165 = __toESM(require_react(), 1);
|
|
44643
44446
|
function useKittyKeyboardProtocol() {
|
|
44644
|
-
const [status] = (0,
|
|
44447
|
+
const [status] = (0, import_react165.useState)({
|
|
44645
44448
|
supported: isKittyProtocolSupported(),
|
|
44646
44449
|
enabled: isKittyProtocolEnabled(),
|
|
44647
44450
|
checking: false
|
|
@@ -44926,7 +44729,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
44926
44729
|
process.stdout.setMaxListeners(0);
|
|
44927
44730
|
}
|
|
44928
44731
|
const instance = render_default(
|
|
44929
|
-
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
44732
|
+
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_react166.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(AppWrapper, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(AppWrapper, {}),
|
|
44930
44733
|
{
|
|
44931
44734
|
exitOnCtrlC: false,
|
|
44932
44735
|
isScreenReaderEnabled: config.getScreenReader(),
|