@qwen-code/qwen-code 0.23.5-preview.0 → 0.24.0-nightly.20260917.f822124af5
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/goal-draft/SKILL.md +5 -5
- package/bundled/qc-helper/docs/configuration/auth.md +1 -0
- package/bundled/qc-helper/docs/configuration/model-providers.md +43 -14
- package/bundled/qc-helper/docs/configuration/settings.md +2 -1
- package/bundled/qc-helper/docs/extension/introduction.md +2 -0
- package/bundled/qc-helper/docs/features/_meta.ts +1 -0
- package/bundled/qc-helper/docs/features/goals.md +11 -11
- package/bundled/qc-helper/docs/features/hooks.md +8 -10
- package/bundled/qc-helper/docs/features/omni-fixed-policies-preset.json +242 -0
- package/bundled/qc-helper/docs/features/omni-media-policies.md +443 -0
- package/bundled/qc-helper/docs/overview.md +1 -1
- package/bundled/qc-helper/docs/quickstart.md +2 -3
- package/bundled/review/SKILL.md +1 -1
- package/bundled/workflow-authoring/SKILL.md +22 -7
- package/chunks/MaxSizedBox-4VDYUHUI.js +148 -0
- package/chunks/{StandaloneSessionPicker-V635V72I.js → StandaloneSessionPicker-SGMGJOH3.js} +115 -91
- package/chunks/acp-subagent-executor-EGAATYQA.js +164 -0
- package/chunks/{acpAgent-3DPWZTNC.js → acpAgent-2JQ2N2T5.js} +361 -229
- package/chunks/{agent-KIHGINKN.js → agent-QWNE3MPD.js} +59 -49
- package/chunks/agent-headless-GRSMZK5Z.js +104 -0
- package/chunks/{anthropicContentGenerator-4FGOM5LK.js → anthropicContentGenerator-INV24RMG.js} +30 -27
- package/chunks/{artifact-tool-MUTNH4NI.js → artifact-tool-3MWM6SN2.js} +11 -7
- package/chunks/{askUserQuestion-AKIRLVB5.js → askUserQuestion-YFFBB4K3.js} +6 -4
- package/chunks/bridge-R65BJ2YL.js +156 -0
- package/chunks/{build-5KWQBWEQ.js → build-5OQN7CDU.js} +1 -1
- package/chunks/caption-audio-UXXLI3JZ.js +443 -0
- package/chunks/caption-image-B7O4TUFP.js +247 -0
- package/chunks/{channel-management-service-RRILWSXX.js → channel-management-service-GRJG5R46.js} +1 -1
- package/chunks/channel-settings-store-TBLCDTV2.js +158 -0
- package/chunks/{channel-worker-group-3DUJFZJR.js → channel-worker-group-SCSKCSBJ.js} +4 -4
- package/chunks/{channel-worker-manager-E5UW2VLA.js → channel-worker-manager-AHCZCKON.js} +4 -4
- package/chunks/{channel-worker-supervisor-VN33GSEC.js → channel-worker-supervisor-BGUAVITB.js} +3 -3
- package/chunks/{chunk-5NUKK2DT.js → chunk-25FMWESU.js} +47 -8
- package/chunks/{chunk-VVI7MK3V.js → chunk-2A6RZKP2.js} +9 -7
- package/chunks/{chunk-3WWPEFMX.js → chunk-2FQM443D.js} +82 -4
- package/chunks/{chunk-D3KVGQUV.js → chunk-37XDTMFG.js} +4 -4
- package/chunks/{chunk-TDKUXSJO.js → chunk-3MW6PPA5.js} +1 -1
- package/chunks/{chunk-4LIPOIXS.js → chunk-3NHJLWOD.js} +1 -1
- package/chunks/{chunk-AQP3H22J.js → chunk-3ZGIRRAE.js} +1 -1
- package/chunks/{chunk-WSJI6ODG.js → chunk-422D2UIO.js} +210 -150
- package/chunks/chunk-43QUA4MC.js +135 -0
- package/chunks/{chunk-Q2SAQTEJ.js → chunk-4B7U3KQP.js} +1 -1
- package/chunks/{chunk-SFL6U7U7.js → chunk-4JFRCIMW.js} +2 -2
- package/chunks/{chunk-IVFTLUZD.js → chunk-4SZ2636R.js} +3 -3
- package/chunks/{chunk-6OTF7TTE.js → chunk-4VYTH6OF.js} +24 -1
- package/chunks/{chunk-7CLLH5TI.js → chunk-4YS7RMCB.js} +6 -4
- package/chunks/{chunk-BW2SMO6L.js → chunk-5FHOPPLZ.js} +1 -1
- package/chunks/{chunk-QIPLWW6Q.js → chunk-5MYQ66UF.js} +1 -1
- package/chunks/{chunk-TXTCM3TC.js → chunk-5VDOVBNG.js} +18 -14
- package/chunks/{chunk-L2A5VBDL.js → chunk-67ZCKSV6.js} +9 -9
- package/chunks/chunk-6C3D7BKK.js +153 -0
- package/chunks/{chunk-DC4ZNGH4.js → chunk-6DB6UHY3.js} +3 -3
- package/chunks/{chunk-AXPOOQAW.js → chunk-736AZVPL.js} +2 -2
- package/chunks/{chunk-M22WLKLI.js → chunk-77ORAIEF.js} +7 -7
- package/chunks/{chunk-BUQN5LTI.js → chunk-7PQ65Z5F.js} +2 -2
- package/chunks/{chunk-CXY6BICQ.js → chunk-A5EGR6ZS.js} +204 -120
- package/chunks/{chunk-VQDWCQOE.js → chunk-ANKISCKU.js} +1 -0
- package/chunks/{chunk-7D4CV7JH.js → chunk-APHDK7GV.js} +116 -4
- package/chunks/{chunk-B5TJK7B3.js → chunk-ARKOX7HM.js} +1 -1
- package/chunks/{chunk-NXUZFW3G.js → chunk-AUFTA63J.js} +1 -1
- package/chunks/{chunk-36SDZ2Q4.js → chunk-B3HGO6BB.js} +7 -5
- package/chunks/{chunk-6USYH3EU.js → chunk-B3XJFEEH.js} +5 -3
- package/chunks/{chunk-AEWCOE64.js → chunk-B5WYAQ4I.js} +2 -2
- package/chunks/{chunk-GSKX53AN.js → chunk-BA6AXQDA.js} +1 -1
- package/chunks/{chunk-Y2KJC55Y.js → chunk-BBHLWLIK.js} +4 -4
- package/chunks/chunk-BKVPLSEI.js +133 -0
- package/chunks/chunk-BQMSZSG6.js +21 -0
- package/chunks/{chunk-3LMDSCLU.js → chunk-C4FISGDN.js} +2 -2
- package/chunks/{chunk-SFHX5G2S.js → chunk-C4MMZVYX.js} +80 -15
- package/chunks/{chunk-4JFLRHNE.js → chunk-C4QWV63F.js} +1 -1
- package/chunks/{chunk-XFFRI3WM.js → chunk-CA63HYHU.js} +4 -2
- package/chunks/{chunk-FBY32737.js → chunk-CJNWKJFH.js} +4 -4
- package/chunks/{chunk-QT6Z2IBF.js → chunk-CYFQLCCG.js} +2 -2
- package/chunks/{chunk-X7AYIXC7.js → chunk-DJLCK66M.js} +5 -3
- package/chunks/chunk-DJYHML3Y.js +121 -0
- package/chunks/{chunk-MO4XID7S.js → chunk-DNDECZXY.js} +3 -3
- package/chunks/{chunk-H6L4NEAT.js → chunk-DQCGGSDO.js} +1 -1
- package/chunks/{chunk-347O2YZJ.js → chunk-DUWQ5Q6R.js} +115 -67
- package/chunks/{chunk-FEDFZBGR.js → chunk-E6A52AP2.js} +28 -17
- package/chunks/{chunk-TIGXX4PA.js → chunk-EKBQJ627.js} +2 -2
- package/chunks/{chunk-RSWBT7AZ.js → chunk-ERIBG3BX.js} +35 -551
- package/chunks/{chunk-PPJSG2PU.js → chunk-EVZT24AF.js} +6 -142
- package/chunks/{chunk-YZXSDPOQ.js → chunk-F7L4ZMKS.js} +84 -40
- package/chunks/{chunk-HX4WXX3H.js → chunk-FGAWVV4X.js} +101 -75
- package/chunks/chunk-FT3O44AZ.js +1635 -0
- package/chunks/chunk-FTKXJMQV.js +255 -0
- package/chunks/{chunk-5FK4MSHB.js → chunk-FWP5GZRY.js} +6 -4
- package/chunks/{chunk-TRZ22SG5.js → chunk-FXPP7VLM.js} +6 -4
- package/chunks/{chunk-INN5ORKX.js → chunk-G25IQMCV.js} +1 -1
- package/chunks/{chunk-OWUAZXXN.js → chunk-GHG4PQY2.js} +3 -3
- package/chunks/{chunk-FASYATAZ.js → chunk-GL5TRVMS.js} +1 -1
- package/chunks/{chunk-G45B3INR.js → chunk-GVTAFLWB.js} +2 -2
- package/chunks/{chunk-G6UUOCUT.js → chunk-GXNXX7A2.js} +7 -1
- package/chunks/{chunk-GI7SLDOI.js → chunk-HUUBCY33.js} +6 -6
- package/chunks/chunk-I7MIPRIQ.js +181 -0
- package/chunks/{chunk-NQ272MQG.js → chunk-IAKJXTGS.js} +7 -5
- package/chunks/{chunk-V4JJAVHQ.js → chunk-ID7XHHY5.js} +2 -2
- package/chunks/{chunk-IXO2OCIP.js → chunk-IIHFUREY.js} +12 -8
- package/chunks/{chunk-IZ2U57NY.js → chunk-IITTKFWM.js} +4 -2
- package/chunks/chunk-IVPSLX4P.js +578 -0
- package/chunks/{chunk-BTICBRPL.js → chunk-IWMYX5LB.js} +3 -3
- package/chunks/{chunk-UZSB57EV.js → chunk-JR2WFCQG.js} +29 -17
- package/chunks/{chunk-GJKP6XOB.js → chunk-JWV5GI77.js} +16 -19
- package/chunks/chunk-JYGESWZM.js +149 -0
- package/chunks/{chunk-KVC7HZWK.js → chunk-JYTJ5FCM.js} +1 -1
- package/chunks/{chunk-SOLRBF7L.js → chunk-JZUSFW64.js} +10 -10
- package/chunks/{chunk-CDDP4ONL.js → chunk-K2T5PKFS.js} +60 -134
- package/chunks/{chunk-EIBECN2J.js → chunk-K5VVDHDV.js} +5 -5
- package/chunks/{chunk-NKTMUPHJ.js → chunk-KDM4KSVG.js} +14 -4
- package/chunks/{chunk-3WILPKTJ.js → chunk-KKPIFWTZ.js} +11 -6
- package/chunks/{chunk-3HTUE6ZR.js → chunk-KPK6NQVR.js} +4 -4
- package/chunks/{chunk-CXONOVBN.js → chunk-KS6F6LZQ.js} +8 -6
- package/chunks/{chunk-D7JMO2GP.js → chunk-KSECLXYH.js} +1 -1
- package/chunks/chunk-KSEKRQJO.js +253 -0
- package/chunks/{chunk-KEM7MWS7.js → chunk-KWZ2DDOC.js} +765 -428
- package/chunks/{chunk-U4AASWUQ.js → chunk-L4GF4IK2.js} +3 -3
- package/chunks/{chunk-CQPM66MG.js → chunk-L7HFHYGB.js} +4 -4
- package/chunks/{chunk-DJXSOEFB.js → chunk-LAE6RY3L.js} +1 -1
- package/chunks/{chunk-WNQIJTOP.js → chunk-LDM3JQZF.js} +243 -17
- package/chunks/{chunk-KVQ3QL4K.js → chunk-LLTRNLK2.js} +3 -3
- package/chunks/{chunk-IKBEIDOH.js → chunk-LVXTBFWP.js} +13 -13
- package/chunks/{chunk-AKRSSKUT.js → chunk-LWALWKFU.js} +10 -10
- package/chunks/{chunk-WL36KHUQ.js → chunk-LWV4RLBT.js} +11 -9
- package/chunks/{chunk-3BZI5GDP.js → chunk-M5YIHMXP.js} +6 -4
- package/chunks/{chunk-6WXVEDT2.js → chunk-MC2RYJMU.js} +5 -3
- package/chunks/chunk-MNU36NGH.js +233 -0
- package/chunks/{chunk-ZMYKNKET.js → chunk-MQWZWHTY.js} +3 -3
- package/chunks/{chunk-M4U2LTD2.js → chunk-MS4SXNJ6.js} +1 -1
- package/chunks/{chunk-QHSOINX6.js → chunk-MZKXPQWL.js} +2 -2
- package/chunks/{chunk-36NRLIR6.js → chunk-NBLWUMYE.js} +13 -11
- package/chunks/{chunk-DRAX5YAI.js → chunk-NFC4WTY2.js} +6 -4
- package/chunks/chunk-NX6JUO42.js +102 -0
- package/chunks/chunk-O345BAI3.js +42 -0
- package/chunks/{chunk-YM6KUQ2S.js → chunk-O4A2B6V2.js} +3 -3
- package/chunks/chunk-O55EKI4S.js +7668 -0
- package/chunks/{chunk-3UGMLA4V.js → chunk-OA5H5PPQ.js} +10 -10
- package/chunks/{chunk-DX6JTDMR.js → chunk-OB57Y2WH.js} +1 -1
- package/chunks/{chunk-4QPVZA5J.js → chunk-OOSOAFCT.js} +3 -3
- package/chunks/{chunk-E2VSBAFA.js → chunk-OXBD7VUE.js} +5 -5
- package/chunks/{chunk-M23GFJ5B.js → chunk-OY5GQPMU.js} +1 -1
- package/chunks/chunk-PF3RVYRK.js +108 -0
- package/chunks/{chunk-XWJFDJZK.js → chunk-PJSZXERN.js} +1 -1
- package/chunks/{chunk-GSAOVDTH.js → chunk-POMFSBEC.js} +4 -4
- package/chunks/{chunk-EWNKP4V4.js → chunk-PPVM7YLS.js} +1 -1
- package/chunks/{chunk-WK6DEH3Q.js → chunk-PQQV3OBW.js} +6 -4
- package/chunks/{chunk-ZSTCM3MX.js → chunk-Q5N5NEVT.js} +1 -1
- package/chunks/{chunk-HYHSMTRA.js → chunk-QCTWNYL6.js} +4 -4
- package/chunks/{chunk-KFFCDLKV.js → chunk-QE36VXWP.js} +1 -1
- package/chunks/{chunk-3LLEB5CU.js → chunk-QG73VXTF.js} +2 -2
- package/chunks/{chunk-QMENOK5T.js → chunk-QJJN2VJY.js} +10 -8
- package/chunks/{chunk-XICCGDWF.js → chunk-QKYAXSNG.js} +2 -2
- package/chunks/{chunk-V545KI73.js → chunk-QPTE6BKL.js} +1 -1
- package/chunks/{chunk-2GP6BQ2J.js → chunk-RA6PKQVM.js} +2 -2
- package/chunks/{chunk-TPY6HW55.js → chunk-RFAX4WKE.js} +13 -7
- package/chunks/chunk-RSFNJ6UU.js +1252 -0
- package/chunks/{chunk-EDIDYZBT.js → chunk-RVT5L74D.js} +1 -1
- package/chunks/{chunk-FCPJXKDG.js → chunk-RXDTMGUH.js} +9 -9
- package/chunks/{chunk-P42KMMU6.js → chunk-RZZLNI74.js} +27 -25
- package/chunks/{chunk-ZFHKUQZ4.js → chunk-S2R4L34O.js} +12 -5
- package/chunks/chunk-S34QJ6IR.js +290 -0
- package/chunks/chunk-S5BHLTHK.js +190 -0
- package/chunks/{chunk-2XRE4KE4.js → chunk-S7BE3FMA.js} +1 -1
- package/chunks/{chunk-7O5PYQ3M.js → chunk-SBP43AO6.js} +1 -1
- package/chunks/chunk-SLHYLVRW.js +1377 -0
- package/chunks/{chunk-SSWTA7CH.js → chunk-SLV3GU2S.js} +12 -12
- package/chunks/chunk-SLVJ55G3.js +11397 -0
- package/chunks/{chunk-5VQR2DD7.js → chunk-SQRZJD25.js} +5 -3
- package/chunks/{chunk-K4XMAIRX.js → chunk-SRFYBJ4P.js} +14 -14
- package/chunks/{chunk-Y4NNIGYO.js → chunk-SSFOFDNL.js} +1 -1
- package/chunks/{chunk-NFXXBWSE.js → chunk-SU64336V.js} +2 -2
- package/chunks/{chunk-RRI764F7.js → chunk-SWHBXWVS.js} +45 -26
- package/chunks/{chunk-BHVF3R6B.js → chunk-TAMBGU42.js} +4 -4
- package/chunks/chunk-TFDCK56Y.js +154 -0
- package/chunks/{chunk-Q54O3EIA.js → chunk-TNTYSST7.js} +55 -33
- package/chunks/{chunk-JRHKM3YQ.js → chunk-TS4JJ7NN.js} +2 -2
- package/chunks/{chunk-VEXUA6DX.js → chunk-TWD6EZLA.js} +13 -11
- package/chunks/{chunk-WZWTY7SG.js → chunk-TZ4QKMPU.js} +6 -6
- package/chunks/{chunk-C4HBZQNH.js → chunk-U3MTHCJF.js} +1 -1
- package/chunks/{chunk-VU3XMZ5I.js → chunk-U3VIKF53.js} +3 -3
- package/chunks/{chunk-BHG3H6OZ.js → chunk-U4KO33OD.js} +1 -1
- package/chunks/{chunk-2C5TR6HN.js → chunk-UANUZBL2.js} +1 -1
- package/chunks/{chunk-Y53DG2HA.js → chunk-UIWUFHRJ.js} +1 -1
- package/chunks/{chunk-UQGRJTDK.js → chunk-UP3XL4VB.js} +3 -3
- package/chunks/{chunk-43Y26NPF.js → chunk-UR27ZXFZ.js} +3 -3
- package/chunks/{chunk-LO2UWNO5.js → chunk-UXC6MURF.js} +3 -3
- package/chunks/chunk-UXEI7POA.js +273 -0
- package/chunks/chunk-V2XJJTAB.js +228 -0
- package/chunks/chunk-VDNCKE2O.js +24 -0
- package/chunks/{chunk-YQQ2U7AS.js → chunk-VLBL6Q7X.js} +1 -1
- package/chunks/{chunk-HNFKYKHH.js → chunk-VNQTV5NC.js} +104 -26
- package/chunks/chunk-VPGRGNNH.js +578 -0
- package/chunks/{chunk-TKF4JINY.js → chunk-VVQ57VLE.js} +1 -1
- package/chunks/{chunk-AUX2FL5T.js → chunk-W2UTVLT2.js} +641 -11
- package/chunks/{chunk-SYMXYRM5.js → chunk-W7JWIIRC.js} +1 -1
- package/chunks/{chunk-WBSJ6VPZ.js → chunk-WDVSRQIQ.js} +3 -3
- package/chunks/{chunk-AZCTY64Z.js → chunk-WEUQIY3Q.js} +1 -1
- package/chunks/{chunk-FX6PZBOV.js → chunk-WHBL5HJF.js} +4 -4
- package/chunks/chunk-WL2V7PTE.js +78 -0
- package/chunks/{chunk-OSG23MR3.js → chunk-X3T5IOX6.js} +2 -2
- package/chunks/{chunk-OZEV3R3S.js → chunk-XYAB5R6E.js} +3 -3
- package/chunks/chunk-XZA32HII.js +19 -0
- package/chunks/{chunk-4FLUQWJ4.js → chunk-Y3Q5OK4D.js} +1 -1
- package/chunks/chunk-YDERQ7ZV.js +248 -0
- package/chunks/{chunk-QGEISOJ2.js → chunk-YKM7SY3N.js} +3 -3
- package/chunks/{chunk-HXUI5D4H.js → chunk-YRNAZIDX.js} +1 -1
- package/chunks/{chunk-MFDKHGTD.js → chunk-YRNLF4SV.js} +3 -1
- package/chunks/{chunk-3XBUCOWS.js → chunk-YSD6IY6F.js} +2 -2
- package/chunks/{chunk-CH2YDT6X.js → chunk-YVYK3JYU.js} +5 -3
- package/chunks/{chunk-YL3UJML3.js → chunk-YWDVNBGE.js} +4 -4
- package/chunks/{chunk-KAYC5FBN.js → chunk-Z3DLUFMT.js} +1595 -1399
- package/chunks/chunk-Z547XC3A.js +44 -0
- package/chunks/{chunk-B6RMK4ED.js → chunk-Z5UFM7P6.js} +9 -7
- package/chunks/chunk-ZAX2LW35.js +1330 -0
- package/chunks/{chunk-C3T6HPNM.js → chunk-ZGADNVME.js} +5 -5
- package/chunks/{chunk-M3JGHRMQ.js → chunk-ZJ7KIWG5.js} +1 -1
- package/chunks/{chunk-SYROIHU7.js → chunk-ZRQGTRHA.js} +4 -2
- package/chunks/{chunk-NCPFOLM2.js → chunk-ZTBP4SFC.js} +78 -18
- package/chunks/{chunk-ZAFYHRVY.js → chunk-ZYDMQCQP.js} +4 -274
- package/chunks/{chunk-YP2K3WOS.js → chunk-ZYLZNSBW.js} +7 -4
- package/chunks/clip-audio-SH4L7AEY.js +255 -0
- package/chunks/clip-image-BQRPECIS.js +239 -0
- package/chunks/clip-video-JIRMV5IH.js +277 -0
- package/chunks/{codex-subagent-executor-AEAIQZDC.js → codex-subagent-executor-BQZZ3Z4E.js} +92 -68
- package/chunks/config-3X4AXU45.js +21 -0
- package/chunks/config-T5RO4NJV.js +17 -0
- package/chunks/config-utils-65HZJG2Y.js +151 -0
- package/chunks/contextCommand-P2WZOTZP.js +144 -0
- package/chunks/convert-image-D52K2FFB.js +231 -0
- package/chunks/{core-runtime-ZI4RTOJQ.js → core-runtime-G7RWUDR5.js} +94 -67
- package/chunks/{create-sub-session-MSGNIM37.js → create-sub-session-6EDEANCD.js} +7 -5
- package/chunks/{create-sub-session-BBWFQARJ.js → create-sub-session-C6OHZMEI.js} +90 -66
- package/chunks/{cron-create-U2JJ5CCF.js → cron-create-GS7ORRO6.js} +8 -5
- package/chunks/{cron-delete-7DM4LJWD.js → cron-delete-3GGDNNXD.js} +8 -5
- package/chunks/{cron-list-VCUSZK2Y.js → cron-list-EX27DW4H.js} +8 -5
- package/chunks/{daemon-INCM4VBX.js → daemon-62G2N3ZH.js} +1 -1
- package/chunks/{daemon-git-worktree-guard-KECEMV6A.js → daemon-git-worktree-guard-Y5MRUXHR.js} +90 -66
- package/chunks/daemon-status-provider-ORUXPQJO.js +155 -0
- package/chunks/daemon-trust-policy-CG35YJC5.js +150 -0
- package/chunks/{daemon-trust-policy-monitor-546N5ZVL.js → daemon-trust-policy-monitor-PT2ZJL3A.js} +96 -72
- package/chunks/deferred-core-runtime-K74JXKVR.js +153 -0
- package/chunks/{display-image-QTHALY6N.js → display-image-L3A755PZ.js} +10 -7
- package/chunks/{dist-BNW423XT.js → dist-CXDHIHN4.js} +5 -0
- package/chunks/downsample-audio-LPDWX6GF.js +217 -0
- package/chunks/downsample-image-A5JEYIV5.js +249 -0
- package/chunks/downscale-video-4W5BX5KO.js +249 -0
- package/chunks/{earlyInputCapture-BXP7V2P3.js → earlyInputCapture-UJ3KFVZQ.js} +3 -2
- package/chunks/{edit-CMSQB7NP.js → edit-VBS2GF24.js} +68 -56
- package/chunks/{en-56QLKXS2.js → en-FCK6MBTI.js} +16 -0
- package/chunks/{enter-worktree-DA6A4XC5.js → enter-worktree-QK7DR5EF.js} +12 -9
- package/chunks/{enterPlanMode-UDPMNESD.js → enterPlanMode-WC33QFGB.js} +62 -51
- package/chunks/environment-HN47IXJZ.js +167 -0
- package/chunks/errors-JC3V3RJA.js +151 -0
- package/chunks/{exec-RPKEY6HP.js → exec-7CFNHYCV.js} +31 -9
- package/chunks/{exit-worktree-4H6Z2VQI.js → exit-worktree-62COYIHF.js} +14 -10
- package/chunks/exitPlanMode-7R7DYPUV.js +102 -0
- package/chunks/extract-audio-GSSZQV6G.js +229 -0
- package/chunks/extract-keyframes-Q6DRMQAJ.js +621 -0
- package/chunks/{fast-path-F2CYDDZ4.js → fast-path-WN7SASHV.js} +6 -6
- package/chunks/{fast-path-settings-N2VGRGDJ.js → fast-path-settings-ASPHHCAG.js} +2 -2
- package/chunks/ffmpeg-N4LIIVNR.js +21 -0
- package/chunks/{glob-Z2JMJKKN.js → glob-HHM36TVT.js} +63 -51
- package/chunks/{goal-tools-HXVVLGCV.js → goal-tools-JTF7S4FP.js} +59 -49
- package/chunks/{grep-H2I33VAO.js → grep-JB5DGQ3B.js} +13 -9
- package/chunks/handleAutoUpdate-GGFSWLAH.js +147 -0
- package/chunks/i18n-NYQWDZWJ.js +164 -0
- package/chunks/{image-gen-HIAZCB5T.js → image-gen-LX3C4V3R.js} +16 -11
- package/chunks/initializer-6IZ4SNMM.js +151 -0
- package/chunks/installationInfo-K4KMCK7Q.js +145 -0
- package/chunks/{keychain-token-storage-NQ5XWIPX.js → keychain-token-storage-ZZNRE6D4.js} +3 -2
- package/chunks/list-KAWCG4I6.js +154 -0
- package/chunks/{list-agents-EWDCEPIW.js → list-agents-HS6HH4DJ.js} +10 -7
- package/chunks/{llm-LSUBOJAR.js → llm-UAZU4HC5.js} +162 -135
- package/chunks/{llm-content-generator-MLIONRXE.js → llm-content-generator-M3MT4BP3.js} +11 -9
- package/chunks/loadedSettingsAdapter-XKUVLEYR.js +152 -0
- package/chunks/{loggingContentGenerator-TUPEXFMM.js → loggingContentGenerator-2WW2O46K.js} +74 -63
- package/chunks/{loop-wakeup-ZBVRI6VH.js → loop-wakeup-4B7OY3TV.js} +9 -6
- package/chunks/{ls-6ZB3BEIR.js → ls-EZ5PSWU2.js} +8 -5
- package/chunks/{lsp-M54FQARP.js → lsp-DYFFHKB3.js} +6 -3
- package/chunks/{managed-npm-update-WEA5XMFZ.js → managed-npm-update-VRSID5W3.js} +91 -67
- package/chunks/mcp-DQEPGE5B.js +148 -0
- package/chunks/memory-side-query-DRV7FXK4.js +221 -0
- package/chunks/model-call-collection-HXYIVZDO.js +171 -0
- package/chunks/model-configuration-5FJL5BJE.js +161 -0
- package/chunks/modelConfigUtils-UE3FDHG3.js +140 -0
- package/chunks/{monitor-CI7YE7MT.js → monitor-IRKGV3RU.js} +63 -51
- package/chunks/nonInteractiveCli-LF5DTTUJ.js +235 -0
- package/chunks/nonInteractiveToolExecutor-KGIGCNUC.js +101 -0
- package/chunks/{notebook-edit-3WCVRNGL.js → notebook-edit-E2NGGRVT.js} +63 -52
- package/chunks/ocr-image-Q4HYJ3U7.js +252 -0
- package/chunks/omni-EHZU5MVU.js +147 -0
- package/chunks/{openaiContentGenerator-OGILGUZE.js → openaiContentGenerator-VZ4QWOSU.js} +36 -31
- package/chunks/{openaiResponsesContentGenerator-NXOXUPFM.js → openaiResponsesContentGenerator-OQFPKE6V.js} +15 -12
- package/chunks/pidfile-OQREIPGE.js +151 -0
- package/chunks/{processUtils-O4II3RYH.js → processUtils-VFFEEP7L.js} +2 -2
- package/chunks/prompt-terminal-ledger-46ELXYOX.js +143 -0
- package/chunks/{qwenContentGenerator-I4LRYADV.js → qwenContentGenerator-H3CWSIV5.js} +70 -60
- package/chunks/{qwenOAuth2-3J66TOT5.js → qwenOAuth2-GD3UIYUP.js} +9 -8
- package/chunks/reactive-degrade-KRTLV22M.js +375 -0
- package/chunks/read-file-BSZJVJ4F.js +37 -0
- package/chunks/{read-mcp-resource-LPSWXVOD.js → read-mcp-resource-INJIV3UC.js} +8 -4
- package/chunks/recall-media-memory-tool-PEE2BWRY.js +198 -0
- package/chunks/{record-artifact-L3CFJOMA.js → record-artifact-KKW3AIMJ.js} +6 -4
- package/chunks/record-source-OZ7JQFJK.js +24 -0
- package/chunks/{report-findings-LY5HQY4K.js → report-findings-OZSLWYAS.js} +7 -5
- package/chunks/{request-shutdown-53SNYGVR.js → request-shutdown-NMWMWGNR.js} +12 -9
- package/chunks/resumeHistoryUtils-P33LLL4M.js +156 -0
- package/chunks/ripGrep-2FWQ6RU3.js +43 -0
- package/chunks/{run-qwen-serve-ZVEKGS7Y.js → run-qwen-serve-HMQ2QCS7.js} +85 -73
- package/chunks/runtime-5X746HBH.js +188 -0
- package/chunks/sandbox-5FENHQ3J.js +170 -0
- package/chunks/sandboxConfig-7V6K3L4N.js +138 -0
- package/chunks/scheduled-tasks-Z4YOCKQV.js +167 -0
- package/chunks/scheduler-64LTQG3P.js +160 -0
- package/chunks/{sdk-exporters-http-DR4G663K.js → sdk-exporters-http-SWXTEEVT.js} +3 -2
- package/chunks/{sdk-impl-SJR26MQF.js → sdk-impl-FK4JY6LX.js} +5 -4
- package/chunks/{send-message-DN76MXDX.js → send-message-SNCXOZA7.js} +16 -13
- package/chunks/serve-C56AM3HW.js +156 -0
- package/chunks/{server-UHMKPCAZ.js → server-5NPGYNJG.js} +2169 -529
- package/chunks/{session-ZLUK7E4P.js → session-JOY4PHTN.js} +152 -128
- package/chunks/session-attachments-root-765GPAJU.js +141 -0
- package/chunks/{session-pr-refresh-3OMTQWCZ.js → session-pr-refresh-JUKB3A7P.js} +95 -71
- package/chunks/{settings-P4DHIIUP.js → settings-P326ULSH.js} +95 -71
- package/chunks/{shell-IMFUVQQ5.js → shell-747O3UYW.js} +59 -49
- package/chunks/{skill-NB5RJGZW.js → skill-DOHHQC32.js} +22 -17
- package/chunks/skill-settings-RI5JR6ZG.js +164 -0
- package/chunks/spawnChannel-745P6IB6.js +152 -0
- package/chunks/standalone-update-JC4E4UEO.js +156 -0
- package/chunks/{start-opentui-ui-JKAIWGF7.js → start-opentui-ui-RC62XZUC.js} +1611 -800
- package/chunks/{startInteractiveUI-YRPOT6GH.js → startInteractiveUI-PIBA3ADH.js} +521 -374
- package/chunks/storage-VZECDJNX.js +17 -0
- package/chunks/{syntheticOutput-EX5L5GYI.js → syntheticOutput-SSXJ2NEY.js} +5 -3
- package/chunks/task-create-FD3EJI7F.js +30 -0
- package/chunks/{task-list-ZLJSMRFA.js → task-list-GA5GOR74.js} +9 -6
- package/chunks/{task-stop-MD7P6QGK.js → task-stop-3MXTDL7H.js} +6 -3
- package/chunks/{task-update-3LSYQDRW.js → task-update-YHFYE7L6.js} +16 -13
- package/chunks/{team-create-2XTBYRJF.js → team-create-PJYGG3AE.js} +62 -51
- package/chunks/{team-delete-RIDINW6I.js → team-delete-V2CROTI6.js} +9 -6
- package/chunks/{team-plan-approval-CFNWW7ZQ.js → team-plan-approval-B36IMXRL.js} +61 -50
- package/chunks/terminal-image-renderer-7OSAIRLS.js +156 -0
- package/chunks/theme-manager-PVMU3VN5.js +140 -0
- package/chunks/{todoWrite-XSTG2VT5.js → todoWrite-LT75PK2W.js} +8 -5
- package/chunks/tool-result-media-S6D7T7TZ.js +45 -0
- package/chunks/{tool-search-ZHTJU2MV.js → tool-search-MNRENFML.js} +43 -21
- package/chunks/total-session-admission-XOFLP43R.js +151 -0
- package/chunks/transcribe-audio-AJQZPNEV.js +30 -0
- package/chunks/trustedFolders-SBORXKH4.js +160 -0
- package/chunks/understand-video-segments-5TMRDQUB.js +438 -0
- package/chunks/{update-relaunch-LI7GRP36.js → update-relaunch-FVAD6CYB.js} +5 -5
- package/chunks/updateCheck-PK4QHA67.js +156 -0
- package/chunks/upload-cache-5YULQVZZ.js +17 -0
- package/chunks/upload-config-AZ63YJU2.js +25 -0
- package/chunks/useAutoAcceptIndicator-SPTOOUWR.js +158 -0
- package/chunks/{validateNonInterActiveAuth-YFPCYYNL.js → validateNonInterActiveAuth-XXHRLXWV.js} +144 -120
- package/chunks/{version-4MTL4JVU.js → version-AGTZHZNY.js} +1 -1
- package/chunks/{web-fetch-O6RG6ISB.js → web-fetch-KMXKLQKY.js} +27 -20
- package/chunks/{web-search-JHAXVEMD.js → web-search-OLBQWW2Y.js} +14 -11
- package/chunks/{web-shell-static-FFWCUUZS.js → web-shell-static-XSCCMXKQ.js} +3 -3
- package/chunks/{workflow-O7L6VDYU.js → workflow-2LC5ZV4Z.js} +214 -73
- package/chunks/workspace-providers-status-4IJHDGCM.js +154 -0
- package/chunks/{workspace-registration-store-7G4E7YPY.js → workspace-registration-store-M4LBEY5A.js} +1 -1
- package/chunks/workspace-registry-D4HQ3TWX.js +160 -0
- package/chunks/workspace-runtime-coordinator-ZG3IRRQ6.js +163 -0
- package/chunks/workspace-service-7ORHK4P4.js +165 -0
- package/chunks/workspace-skills-status-J43O7A5Q.js +151 -0
- package/chunks/{workspace-trust-reconciler-XEBW5FUL.js → workspace-trust-reconciler-7ZMDX27O.js} +99 -75
- package/chunks/write-file-MWN2PNMG.js +107 -0
- package/chunks/{zh-TW-S3YTQ4DS.js → zh-TW-SRB5QSER.js} +16 -0
- package/chunks/{zh-F76MZTL3.js → zh-UBQIFP4A.js} +16 -0
- package/chunks/{zoom-image-RDPRTP4B.js → zoom-image-H7MLEC2E.js} +18 -13
- package/cli.js +14 -14
- package/export-transcript-document.js +52 -52
- package/locales/en.js +18 -0
- package/locales/zh-TW.js +17 -0
- package/locales/zh.js +17 -0
- package/package.json +3 -3
- package/web-shell/assets/{abnfDiagram-VCTEODGH-RxykUDmi.js → abnfDiagram-VCTEODGH-L57MVQ_O.js} +1 -1
- package/web-shell/assets/{arc-CZpgGCJC.js → arc-Cdl4BCU9.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-BHSMzNDT.js → architectureDiagram-5GKGNRK7-wLGfVuoB.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-Bn4mF9SZ.js → blockDiagram-NRAW4CY4-LXdTypiA.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-CBM-Bj6t.js → c4Diagram-UCG6FXSJ-Ci95CJAD.js} +1 -1
- package/web-shell/assets/channel-DwdlDVan.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-D5Fin58O.js → chunk-2Q5K7J3B-CTb0CG3P.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-CY05weF7.js → chunk-5VM5RSS4-BIyA8dbi.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-3neZnj5Y.js → chunk-F27PBJKO-BlcPeoaN.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-Cd7EU4BE.js → chunk-G27WJ6UU-KdH5H1ne.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-DwK1mqFw.js → chunk-JWPE2WC7-DEh0r7ty.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-Sl7vY22C.js → chunk-LCL6LL3I-DwD-l0mq.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-BXNzpbVg.js → chunk-POPQ4Y6H-D_ybAWGG.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-DjjButcp.js → chunk-SVP7TREG-Bk6Dq0yA.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-DNOiCjOJ.js → chunk-XXDRQBXY-D4vL2YuW.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-CIyD-qft.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-CIyD-qft.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-BUnker7a.js → cose-bilkent-JH36ORCC-BditfMcM.js} +1 -1
- package/web-shell/assets/{cynefin-OW5HDTMX-DcUgdWE5.js → cynefin-OW5HDTMX-DAlaYMkD.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-CvDKsZsL.js → cynefinDiagram-5FMLGOSQ-B9jOfS3X.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-jpCmUbr1.js → dagre-3AP2YEHR-DO6EyeMX.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-DBe_bKE5.js → diagram-S7CK7UJ4-DIwGJ7mC.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-oXvPpDgs.js → diagram-UQ7AKVKN-DT5RqZBV.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-BD7-_SGh.js → diagram-VSXAHHWV-DJBMayCs.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-DOJL0wub.js → diagram-VX7I27RA-BllSiq1w.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-DRIiodDD.js → diagram-Z3DM3KII-Vw1NsAH3.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-Db31Ulmb.js → ebnfDiagram-PWID7BFC-TY7loKI3.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-CVHhwI2_.js → erDiagram-SSCWMZ5O-BYrxi-FK.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-DWOFy1FK.js → flowDiagram-A5DVABFB-BTQ4IRh-.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-C0sxQtPd.js → ganttDiagram-EL5Y4UJY-96GXN9_Z.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-CNituBYC.js → gitGraphDiagram-WWUBYQGX-BgIxQjuh.js} +1 -1
- package/web-shell/assets/{index-B15NlwB8.js → index-BvmsVGIg.js} +472 -465
- package/web-shell/assets/{index-BSrS0tQ6.css → index-D0aLpdAG.css} +2 -2
- package/web-shell/assets/{index-gm9tLk7h.js → index-SPar5CcF.js} +1 -1
- package/web-shell/assets/{infoDiagram-RXCK75RN-CxhJYtIR.js → infoDiagram-RXCK75RN-BlyUMpEA.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-By2mchUy.js → ishikawaDiagram-5VMMS53U-94uLMZ3k.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-CVH-OweI.js → journeyDiagram-EYS64GPL-DbnJfG3S.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-Cc9dQXLy.js → kanban-definition-3QL26DDD-gjWM2ioU.js} +1 -1
- package/web-shell/assets/{layout-C_60ysHw.js → layout-CmDpGoK-.js} +1 -1
- package/web-shell/assets/{linear-BvAVfqwu.js → linear-DksWgqn0.js} +1 -1
- package/web-shell/assets/{mermaid.core-C3CoBKAc.js → mermaid.core-DCpE5atR.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-Cuu8Q8LM.js → mindmap-definition-FBJOCRG2-DanEOvck.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-DmAeyDO2.js → pegDiagram-XKGWAZYB-V2ee76OP.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-B7vbB_xv.js → pieDiagram-E7YTZNPT-CYvmbkkp.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-BqOBkRR7.js → quadrantDiagram-AXDQQJYC-BRkw6ha0.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-sI06lZIu.js → railroadDiagram-O6MQD6OU-D_YmVT7T.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-Bg13d10S.js → requirementDiagram-EFPCY7ZU-DTF9UgWw.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-WFOzZHrR.js → sankeyDiagram-P5KCCOFB-znmuOvtK.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-CCdRbA4E.js → sequenceDiagram-WJ2MYXX4-B8CE9gDr.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-BH5F3bGg.js → sizeCapture-X5ZJPWSS-BqE_jooQ.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-NwS2X3QB.js → stateDiagram-HBIQ2CUA-4AmlCOLW.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-DwExf4Jm.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-Bm38pM28.js → swimlanes-XN3QIQJK-B40gtZOq.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-CXXUsHPj.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-Do-agLSo.js → timeline-definition-24CTP7MA-B23KIwTc.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-aggLfZzl.js → vennDiagram-4TSXK5OY-eyJpBjg6.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-D5JR3mXX.js → wardleyDiagram-VM6X3IG4-BBjaaHeP.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-DhtLDuXs.js → xychartDiagram-S5SC5T6Z-Cq3Bnvj4.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/MaxSizedBox-FCF6M53W.js +0 -124
- package/chunks/acp-subagent-executor-TND6W2O5.js +0 -140
- package/chunks/agent-headless-EJ4QOUSM.js +0 -94
- package/chunks/bridge-MUX5YJZT.js +0 -132
- package/chunks/channel-settings-store-7CBIRZER.js +0 -134
- package/chunks/chunk-FIJODK52.js +0 -154
- package/chunks/chunk-OALXNGUA.js +0 -2137
- package/chunks/chunk-PF7GAP6K.js +0 -16861
- package/chunks/config-utils-KX2YS725.js +0 -127
- package/chunks/contextCommand-RV6Y5LNJ.js +0 -120
- package/chunks/daemon-status-provider-NULJNAEV.js +0 -131
- package/chunks/daemon-trust-policy-S4KWGPV3.js +0 -126
- package/chunks/deferred-core-runtime-T23ZT443.js +0 -128
- package/chunks/environment-TSQJUTPV.js +0 -143
- package/chunks/errors-RIVYJS6T.js +0 -127
- package/chunks/exitPlanMode-BYBBFN2T.js +0 -92
- package/chunks/handleAutoUpdate-FZP45KOR.js +0 -123
- package/chunks/i18n-OTB62AKW.js +0 -140
- package/chunks/initializer-4JXZEC4B.js +0 -127
- package/chunks/installationInfo-2IJV5QKC.js +0 -121
- package/chunks/list-KQSQ4A5G.js +0 -130
- package/chunks/loadedSettingsAdapter-TZTTNRHI.js +0 -124
- package/chunks/mcp-TFDTUPIA.js +0 -124
- package/chunks/model-configuration-ZCAKKIOF.js +0 -137
- package/chunks/modelConfigUtils-J3ZPW7ZK.js +0 -116
- package/chunks/nonInteractiveCli-GPT3TVOK.js +0 -211
- package/chunks/pidfile-GBTBIGHF.js +0 -127
- package/chunks/prompt-terminal-ledger-ILIXZI3E.js +0 -119
- package/chunks/read-file-G4XKW2CS.js +0 -31
- package/chunks/record-source-2GSY5JD5.js +0 -22
- package/chunks/resumeHistoryUtils-YPJU4XFE.js +0 -132
- package/chunks/ripGrep-AAKMALLM.js +0 -39
- package/chunks/runtime-SJCRYNPA.js +0 -164
- package/chunks/sandbox-UIXL423Z.js +0 -146
- package/chunks/sandboxConfig-CY343YNJ.js +0 -114
- package/chunks/scheduled-tasks-5UGBEVNZ.js +0 -143
- package/chunks/scheduler-GCZYLZ2P.js +0 -136
- package/chunks/serve-2XXQLVK2.js +0 -132
- package/chunks/session-attachments-root-DHQM5IEZ.js +0 -117
- package/chunks/skill-settings-IXG5CTQO.js +0 -140
- package/chunks/spawnChannel-Q3YALTCJ.js +0 -128
- package/chunks/standalone-update-H5OJ7MM7.js +0 -132
- package/chunks/task-create-75HVPEAH.js +0 -28
- package/chunks/terminal-image-renderer-UDPJPGPQ.js +0 -132
- package/chunks/theme-manager-SK57EKMO.js +0 -116
- package/chunks/total-session-admission-UUZBDQCG.js +0 -127
- package/chunks/trustedFolders-4LDBLNTS.js +0 -136
- package/chunks/updateCheck-PKSSORPO.js +0 -132
- package/chunks/useAutoAcceptIndicator-I32UEQPI.js +0 -134
- package/chunks/workspace-providers-status-WRX6CJM4.js +0 -130
- package/chunks/workspace-registry-SXIMGT4D.js +0 -136
- package/chunks/workspace-runtime-coordinator-7DOEHXYT.js +0 -139
- package/chunks/workspace-service-HDXOZMYC.js +0 -141
- package/chunks/workspace-skills-status-VN4L37CA.js +0 -127
- package/chunks/write-file-LKX4ETIO.js +0 -97
- package/web-shell/assets/channel-DFYs_LlK.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-DnGrKXoM.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-DnGrKXoM.js +0 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-1aU2JZXO.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Dp-u6kQG.js +0 -8
- package/chunks/{chunk-XAJZFGD2.js → chunk-PXXYQOZO.js} +8 -8
- package/chunks/{chunk-WVURIAEE.js → chunk-SVWWF5TZ.js} +3 -3
- package/chunks/{dist-G5UMXIGF.js → dist-I6D6XOWV.js} +1 -1
- package/chunks/{dist-UXVNLQHG.js → dist-VIKOMAGG.js} +3 -3
|
@@ -30,15 +30,52 @@ import {
|
|
|
30
30
|
useProviderSetupFlow,
|
|
31
31
|
useTimer,
|
|
32
32
|
writeTerminalTitle
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-422D2UIO.js";
|
|
34
|
+
import "./chunk-RA6PKQVM.js";
|
|
35
|
+
import "./chunk-QCTWNYL6.js";
|
|
36
36
|
import {
|
|
37
37
|
startPostRenderPrefetches
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-LVXTBFWP.js";
|
|
39
|
+
import {
|
|
40
|
+
STATUS_LINE_PRESET_ITEMS,
|
|
41
|
+
SessionStatsProvider,
|
|
42
|
+
TOOL_DISPLAY_BY_NAME,
|
|
43
|
+
TOOL_SUCCESS_RATE_HIGH,
|
|
44
|
+
TOOL_SUCCESS_RATE_MEDIUM,
|
|
45
|
+
computeHeaderCap,
|
|
46
|
+
findPrevWordStart,
|
|
47
|
+
findPrevWordStartInLine,
|
|
48
|
+
flattenModelsBySource,
|
|
49
|
+
formatDuration as formatDuration2,
|
|
50
|
+
formatInlineToolArgsJson,
|
|
51
|
+
formatTokenCount as formatTokenCount2,
|
|
52
|
+
getArenaStatusLabel,
|
|
53
|
+
getStatusColor,
|
|
54
|
+
getWordBoundaries,
|
|
55
|
+
keyMatchers,
|
|
56
|
+
useSessionStats
|
|
57
|
+
} from "./chunk-SLVJ55G3.js";
|
|
58
|
+
import {
|
|
59
|
+
ICON,
|
|
60
|
+
SPINNER_FRAMES,
|
|
61
|
+
SPINNER_INTERVAL_MS,
|
|
62
|
+
TOOL_STATUS,
|
|
63
|
+
WAITING_SPINNER_FRAME,
|
|
64
|
+
applyCollapsePolicyAndSummary,
|
|
65
|
+
buildResumedHistoryItems,
|
|
66
|
+
coalesceFindingsHistoryItems,
|
|
67
|
+
isFindingsListDisplay,
|
|
68
|
+
shouldDisplayGoalStateCause,
|
|
69
|
+
waitForGoalRuntime,
|
|
70
|
+
wrapAnsi
|
|
71
|
+
} from "./chunk-NBLWUMYE.js";
|
|
72
|
+
import {
|
|
73
|
+
stopAndGetCapturedInput
|
|
74
|
+
} from "./chunk-PPVM7YLS.js";
|
|
39
75
|
import {
|
|
40
76
|
emitAutoModeEntryNotices
|
|
41
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-ID7XHHY5.js";
|
|
78
|
+
import "./chunk-77ORAIEF.js";
|
|
42
79
|
import {
|
|
43
80
|
fireSessionDeleteHook
|
|
44
81
|
} from "./chunk-L34XSHIZ.js";
|
|
@@ -47,7 +84,7 @@ import {
|
|
|
47
84
|
handleAtCommand,
|
|
48
85
|
normalizeDescription,
|
|
49
86
|
sanitizeDisplayText
|
|
50
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-LDM3JQZF.js";
|
|
51
88
|
import {
|
|
52
89
|
BuiltinCommandLoader,
|
|
53
90
|
BundledSkillLoader,
|
|
@@ -86,28 +123,11 @@ import {
|
|
|
86
123
|
resetBackgroundStateForSessionSwitch,
|
|
87
124
|
serializeUserPromptExpansionPrompt,
|
|
88
125
|
supportsMatchers
|
|
89
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-FGAWVV4X.js";
|
|
90
127
|
import {
|
|
91
128
|
EXTENSION_RELOAD_FAILED_REASON,
|
|
92
129
|
ExtensionRefreshState
|
|
93
|
-
} from "./chunk-
|
|
94
|
-
import "./chunk-NYX53SV4.js";
|
|
95
|
-
import "./chunk-TPY6HW55.js";
|
|
96
|
-
import {
|
|
97
|
-
STATUS_LINE_PRESET_ITEMS,
|
|
98
|
-
SessionStatsProvider,
|
|
99
|
-
TOOL_DISPLAY_BY_NAME,
|
|
100
|
-
TOOL_SUCCESS_RATE_HIGH,
|
|
101
|
-
TOOL_SUCCESS_RATE_MEDIUM,
|
|
102
|
-
flattenModelsBySource,
|
|
103
|
-
formatDuration as formatDuration2,
|
|
104
|
-
formatTokenCount as formatTokenCount2,
|
|
105
|
-
getArenaStatusLabel,
|
|
106
|
-
getStatusColor,
|
|
107
|
-
keyMatchers,
|
|
108
|
-
useSessionStats
|
|
109
|
-
} from "./chunk-OALXNGUA.js";
|
|
110
|
-
import "./chunk-M22WLKLI.js";
|
|
130
|
+
} from "./chunk-A5EGR6ZS.js";
|
|
111
131
|
import {
|
|
112
132
|
calculateCost,
|
|
113
133
|
computeSessionStats,
|
|
@@ -120,140 +140,133 @@ import {
|
|
|
120
140
|
getSystemInfoFields,
|
|
121
141
|
levelLabel,
|
|
122
142
|
redactProxy
|
|
123
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-BBHLWLIK.js";
|
|
144
|
+
import {
|
|
145
|
+
contextUsageLabel,
|
|
146
|
+
formatDuration,
|
|
147
|
+
formatPercentageUsed,
|
|
148
|
+
formatTokenCount
|
|
149
|
+
} from "./chunk-WEUQIY3Q.js";
|
|
150
|
+
import "./chunk-NYX53SV4.js";
|
|
124
151
|
import {
|
|
125
152
|
CTRL_EXIT_PROMPT_DURATION_MS,
|
|
126
153
|
cleanupOldClipboardImages,
|
|
127
154
|
clipboardHasImage,
|
|
128
155
|
saveClipboardImage
|
|
129
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-X3T5IOX6.js";
|
|
157
|
+
import "./chunk-RFAX4WKE.js";
|
|
130
158
|
import "./chunk-4WGODMVR.js";
|
|
131
|
-
import
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
SPINNER_INTERVAL_MS,
|
|
135
|
-
TOOL_STATUS,
|
|
136
|
-
applyCollapsePolicyAndSummary,
|
|
137
|
-
buildResumedHistoryItems,
|
|
138
|
-
coalesceFindingsHistoryItems,
|
|
139
|
-
isFindingsListDisplay,
|
|
140
|
-
shouldDisplayGoalStateCause,
|
|
141
|
-
waitForGoalRuntime,
|
|
142
|
-
wrapAnsi
|
|
143
|
-
} from "./chunk-36NRLIR6.js";
|
|
144
|
-
import {
|
|
145
|
-
contextUsageLabel,
|
|
146
|
-
formatDuration,
|
|
147
|
-
formatPercentageUsed,
|
|
148
|
-
formatTokenCount
|
|
149
|
-
} from "./chunk-AZCTY64Z.js";
|
|
150
|
-
import "./chunk-4LIPOIXS.js";
|
|
159
|
+
import "./chunk-KW7NOTN6.js";
|
|
160
|
+
import "./chunk-XYAB5R6E.js";
|
|
161
|
+
import "./chunk-3NHJLWOD.js";
|
|
151
162
|
import {
|
|
152
163
|
require_jsx_runtime
|
|
153
164
|
} from "./chunk-SV5PQVQE.js";
|
|
154
165
|
import {
|
|
155
166
|
require_constants,
|
|
156
167
|
require_react_reconciler
|
|
157
|
-
} from "./chunk-
|
|
168
|
+
} from "./chunk-ZTBP4SFC.js";
|
|
158
169
|
import {
|
|
159
170
|
require_react
|
|
160
171
|
} from "./chunk-5QWWOFGG.js";
|
|
161
|
-
import
|
|
162
|
-
|
|
163
|
-
} from "./chunk-EWNKP4V4.js";
|
|
164
|
-
import "./chunk-C4HBZQNH.js";
|
|
172
|
+
import "./chunk-TS4JJ7NN.js";
|
|
173
|
+
import "./chunk-U3MTHCJF.js";
|
|
165
174
|
import {
|
|
166
175
|
setUpdateHandler
|
|
167
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-HUUBCY33.js";
|
|
168
177
|
import "./chunk-EKTCKZV5.js";
|
|
178
|
+
import "./chunk-UP3XL4VB.js";
|
|
179
|
+
import "./chunk-YAF2MQZ6.js";
|
|
169
180
|
import {
|
|
170
181
|
AUTO_THEME_NAME,
|
|
171
182
|
themeManager
|
|
172
|
-
} from "./chunk-
|
|
173
|
-
import "./chunk-
|
|
174
|
-
import "./chunk-
|
|
183
|
+
} from "./chunk-S7BE3FMA.js";
|
|
184
|
+
import "./chunk-MQWZWHTY.js";
|
|
185
|
+
import "./chunk-6H67XLET.js";
|
|
186
|
+
import "./chunk-CJNWKJFH.js";
|
|
175
187
|
import {
|
|
176
188
|
getErrorMessage as getErrorMessage2
|
|
177
|
-
} from "./chunk-
|
|
178
|
-
import "./chunk-
|
|
179
|
-
import "./chunk-
|
|
180
|
-
import "./chunk-YAF2MQZ6.js";
|
|
181
|
-
import "./chunk-B5TJK7B3.js";
|
|
189
|
+
} from "./chunk-Z5UFM7P6.js";
|
|
190
|
+
import "./chunk-CYFQLCCG.js";
|
|
191
|
+
import "./chunk-ARKOX7HM.js";
|
|
182
192
|
import "./chunk-24FVUD5P.js";
|
|
183
|
-
import "./chunk-
|
|
184
|
-
import "./chunk-
|
|
185
|
-
import "./chunk-
|
|
186
|
-
import "./chunk-M3JGHRMQ.js";
|
|
187
|
-
import "./chunk-VFFQAOPR.js";
|
|
193
|
+
import "./chunk-VNQTV5NC.js";
|
|
194
|
+
import "./chunk-ZJ7KIWG5.js";
|
|
195
|
+
import "./chunk-SSFOFDNL.js";
|
|
188
196
|
import {
|
|
189
197
|
cpLen,
|
|
198
|
+
cpSlice,
|
|
190
199
|
escapeAnsiCtrlCodes,
|
|
191
200
|
getAsciiArtWidth,
|
|
192
201
|
getCachedStringWidth,
|
|
193
202
|
sanitizeMultilineForDisplay,
|
|
194
203
|
sanitizeSensitiveText,
|
|
195
204
|
sanitizeTerminalText,
|
|
205
|
+
stripUnsafeCharacters,
|
|
196
206
|
toCodePoints,
|
|
197
207
|
truncateToWidth
|
|
198
208
|
} from "./chunk-47ECGEJC.js";
|
|
199
|
-
import "./chunk-Y4NNIGYO.js";
|
|
200
209
|
import "./chunk-2MIN6GRR.js";
|
|
201
210
|
import "./chunk-QHTIBUWB.js";
|
|
211
|
+
import "./chunk-VFFQAOPR.js";
|
|
202
212
|
import "./chunk-TXASDT2M.js";
|
|
213
|
+
import "./chunk-4VQBQLIZ.js";
|
|
203
214
|
import "./chunk-PB7JBAHF.js";
|
|
204
215
|
import "./chunk-DMEUXLSS.js";
|
|
205
|
-
import "./chunk-4VQBQLIZ.js";
|
|
206
|
-
import "./chunk-7D4CV7JH.js";
|
|
207
216
|
import {
|
|
208
217
|
isValidSessionId
|
|
209
218
|
} from "./chunk-ZEZKIS2K.js";
|
|
210
219
|
import {
|
|
211
220
|
formatUnsupportedVoiceModelMessage,
|
|
212
221
|
isSelectableVoiceModel
|
|
213
|
-
} from "./chunk-
|
|
214
|
-
import "./chunk-
|
|
222
|
+
} from "./chunk-JYTJ5FCM.js";
|
|
223
|
+
import "./chunk-UIWUFHRJ.js";
|
|
224
|
+
import "./chunk-APHDK7GV.js";
|
|
225
|
+
import {
|
|
226
|
+
createLoadedSettingsAdapter,
|
|
227
|
+
getRawModelProviders
|
|
228
|
+
} from "./chunk-I7MIPRIQ.js";
|
|
215
229
|
import {
|
|
216
230
|
getExtendedSystemInfo
|
|
217
|
-
} from "./chunk-
|
|
218
|
-
import "./chunk-
|
|
231
|
+
} from "./chunk-WHBL5HJF.js";
|
|
232
|
+
import "./chunk-QG73VXTF.js";
|
|
233
|
+
import "./chunk-KWYTSSTJ.js";
|
|
234
|
+
import "./chunk-WCCLLK7X.js";
|
|
235
|
+
import "./chunk-LYD3T3H7.js";
|
|
219
236
|
import {
|
|
220
237
|
getReasoningEffortsForConfig
|
|
221
|
-
} from "./chunk-
|
|
222
|
-
import "./chunk-
|
|
223
|
-
import "./chunk-
|
|
224
|
-
import "./chunk-
|
|
225
|
-
import "./chunk-
|
|
226
|
-
import "./chunk-
|
|
238
|
+
} from "./chunk-OOSOAFCT.js";
|
|
239
|
+
import "./chunk-JR2WFCQG.js";
|
|
240
|
+
import "./chunk-Y3Q5OK4D.js";
|
|
241
|
+
import "./chunk-KSECLXYH.js";
|
|
242
|
+
import "./chunk-TZ4QKMPU.js";
|
|
243
|
+
import "./chunk-OXBD7VUE.js";
|
|
227
244
|
import "./chunk-57OAHC2Y.js";
|
|
228
|
-
import "./chunk-
|
|
229
|
-
import "./chunk-
|
|
245
|
+
import "./chunk-W7JWIIRC.js";
|
|
246
|
+
import "./chunk-L4GF4IK2.js";
|
|
230
247
|
import "./chunk-LFKXIOGC.js";
|
|
231
|
-
import {
|
|
232
|
-
createLoadedSettingsAdapter
|
|
233
|
-
} from "./chunk-FIJODK52.js";
|
|
234
|
-
import "./chunk-KWYTSSTJ.js";
|
|
235
|
-
import "./chunk-WCCLLK7X.js";
|
|
236
|
-
import "./chunk-LYD3T3H7.js";
|
|
237
248
|
import "./chunk-V6WHFGST.js";
|
|
249
|
+
import "./chunk-SU64336V.js";
|
|
250
|
+
import "./chunk-ESBYWATJ.js";
|
|
251
|
+
import {
|
|
252
|
+
loadMcpApprovals
|
|
253
|
+
} from "./chunk-LWV4RLBT.js";
|
|
254
|
+
import "./chunk-2AUM35J5.js";
|
|
255
|
+
import "./chunk-4JFRCIMW.js";
|
|
238
256
|
import "./chunk-RN6A53UJ.js";
|
|
239
257
|
import "./chunk-6PLDPT2C.js";
|
|
240
258
|
import "./chunk-FYJ7W2PI.js";
|
|
241
259
|
import "./chunk-STUJ7IMZ.js";
|
|
242
260
|
import "./chunk-L3SNMEDW.js";
|
|
243
|
-
import "./chunk-GYTKQYDB.js";
|
|
244
261
|
import "./chunk-GDWE23OR.js";
|
|
245
|
-
import "./chunk-
|
|
262
|
+
import "./chunk-GYTKQYDB.js";
|
|
246
263
|
import "./chunk-RKFGE7JH.js";
|
|
264
|
+
import "./chunk-CJ3DHN5I.js";
|
|
247
265
|
import "./chunk-UDG5EZJI.js";
|
|
248
266
|
import "./chunk-M5GB774H.js";
|
|
249
267
|
import "./chunk-3VUENPWF.js";
|
|
250
|
-
import "./chunk-NFXXBWSE.js";
|
|
251
|
-
import "./chunk-ESBYWATJ.js";
|
|
252
268
|
import "./chunk-PZRXWQUA.js";
|
|
253
269
|
import "./chunk-IJOS26LH.js";
|
|
254
|
-
import {
|
|
255
|
-
loadMcpApprovals
|
|
256
|
-
} from "./chunk-WL36KHUQ.js";
|
|
257
270
|
import {
|
|
258
271
|
getDefaultValue,
|
|
259
272
|
getDialogSettingKeys,
|
|
@@ -270,23 +283,29 @@ import {
|
|
|
270
283
|
saveModifiedSettings,
|
|
271
284
|
setPendingSettingValueAny,
|
|
272
285
|
validateSettingValue
|
|
273
|
-
} from "./chunk-
|
|
274
|
-
import "./chunk-RKUWKYED.js";
|
|
286
|
+
} from "./chunk-SWHBXWVS.js";
|
|
275
287
|
import {
|
|
276
288
|
TOGGLE_TYPES,
|
|
277
289
|
isNumericSettingType
|
|
278
|
-
} from "./chunk-
|
|
290
|
+
} from "./chunk-W2UTVLT2.js";
|
|
291
|
+
import "./chunk-RKUWKYED.js";
|
|
279
292
|
import "./chunk-BW4333PP.js";
|
|
280
293
|
import "./chunk-IDS7MSUP.js";
|
|
281
294
|
import {
|
|
282
295
|
t
|
|
283
|
-
} from "./chunk-
|
|
296
|
+
} from "./chunk-POMFSBEC.js";
|
|
284
297
|
import "./chunk-5EJZE3FP.js";
|
|
285
|
-
import "./chunk-
|
|
286
|
-
import "./chunk-
|
|
287
|
-
import "./chunk-
|
|
288
|
-
import "./chunk-
|
|
289
|
-
import "./chunk-
|
|
298
|
+
import "./chunk-KDM4KSVG.js";
|
|
299
|
+
import "./chunk-4VYTH6OF.js";
|
|
300
|
+
import "./chunk-XFSFZCM5.js";
|
|
301
|
+
import "./chunk-2EAZ43JQ.js";
|
|
302
|
+
import "./chunk-NF5J2WFA.js";
|
|
303
|
+
import {
|
|
304
|
+
formatVersionLabel,
|
|
305
|
+
getCliVersion
|
|
306
|
+
} from "./chunk-3ZGIRRAE.js";
|
|
307
|
+
import "./chunk-W3N5XAZ6.js";
|
|
308
|
+
import "./chunk-IAKJXTGS.js";
|
|
290
309
|
import "./chunk-NPQ5ZKRP.js";
|
|
291
310
|
import "./chunk-MR3PXB6E.js";
|
|
292
311
|
import {
|
|
@@ -294,32 +313,38 @@ import {
|
|
|
294
313
|
Fzf,
|
|
295
314
|
buildSessionRecoveryPlan,
|
|
296
315
|
generatePromptSuggestion
|
|
297
|
-
} from "./chunk-
|
|
316
|
+
} from "./chunk-DUWQ5Q6R.js";
|
|
298
317
|
import "./chunk-GELRJXE2.js";
|
|
299
318
|
import "./chunk-32CM56LO.js";
|
|
300
|
-
import "./chunk-
|
|
301
|
-
import "./chunk-2EAZ43JQ.js";
|
|
302
|
-
import "./chunk-NF5J2WFA.js";
|
|
303
|
-
import {
|
|
304
|
-
formatVersionLabel,
|
|
305
|
-
getCliVersion
|
|
306
|
-
} from "./chunk-AQP3H22J.js";
|
|
307
|
-
import "./chunk-W3N5XAZ6.js";
|
|
308
|
-
import "./chunk-6WXVEDT2.js";
|
|
319
|
+
import "./chunk-MC2RYJMU.js";
|
|
309
320
|
import "./chunk-LJZSMWOH.js";
|
|
310
|
-
import "./chunk-
|
|
311
|
-
import "./chunk-
|
|
312
|
-
import "./chunk-
|
|
313
|
-
import "./chunk-
|
|
314
|
-
import "./chunk-
|
|
321
|
+
import "./chunk-DJLCK66M.js";
|
|
322
|
+
import "./chunk-M5YIHMXP.js";
|
|
323
|
+
import "./chunk-TWD6EZLA.js";
|
|
324
|
+
import "./chunk-IIHFUREY.js";
|
|
325
|
+
import "./chunk-LAE6RY3L.js";
|
|
326
|
+
import "./chunk-5VDOVBNG.js";
|
|
327
|
+
import "./chunk-FXPP7VLM.js";
|
|
328
|
+
import "./chunk-7PQ65Z5F.js";
|
|
315
329
|
import "./chunk-ZPJWUGCS.js";
|
|
316
|
-
import "./chunk-
|
|
317
|
-
import "./chunk-
|
|
318
|
-
import "./chunk-
|
|
319
|
-
import "./chunk-
|
|
320
|
-
import "./chunk-
|
|
321
|
-
import "./chunk-
|
|
322
|
-
import "./chunk-
|
|
330
|
+
import "./chunk-O4A2B6V2.js";
|
|
331
|
+
import "./chunk-C4MMZVYX.js";
|
|
332
|
+
import "./chunk-SQRZJD25.js";
|
|
333
|
+
import "./chunk-FT3O44AZ.js";
|
|
334
|
+
import "./chunk-DJYHML3Y.js";
|
|
335
|
+
import "./chunk-Z547XC3A.js";
|
|
336
|
+
import "./chunk-V2XJJTAB.js";
|
|
337
|
+
import "./chunk-ZAX2LW35.js";
|
|
338
|
+
import "./chunk-UXEI7POA.js";
|
|
339
|
+
import "./chunk-SLHYLVRW.js";
|
|
340
|
+
import "./chunk-YDERQ7ZV.js";
|
|
341
|
+
import "./chunk-UXC6MURF.js";
|
|
342
|
+
import "./chunk-RSFNJ6UU.js";
|
|
343
|
+
import "./chunk-JYGESWZM.js";
|
|
344
|
+
import "./chunk-TFDCK56Y.js";
|
|
345
|
+
import "./chunk-FTKXJMQV.js";
|
|
346
|
+
import "./chunk-S5BHLTHK.js";
|
|
347
|
+
import "./chunk-KSEKRQJO.js";
|
|
323
348
|
import {
|
|
324
349
|
CoreToolScheduler,
|
|
325
350
|
DISPLAY_MODE,
|
|
@@ -351,40 +376,31 @@ import {
|
|
|
351
376
|
parseRule,
|
|
352
377
|
parseVisionModelSetting,
|
|
353
378
|
refreshMemoryInstruction
|
|
354
|
-
} from "./chunk-
|
|
379
|
+
} from "./chunk-Z3DLUFMT.js";
|
|
355
380
|
import "./chunk-GOFAQQZA.js";
|
|
356
381
|
import "./chunk-65I7S4Z3.js";
|
|
357
382
|
import "./chunk-HEOH7JZY.js";
|
|
358
383
|
import "./chunk-TWPJO254.js";
|
|
359
384
|
import "./chunk-CQ35AJ4Z.js";
|
|
360
|
-
import "./chunk-
|
|
361
|
-
import "./chunk-
|
|
362
|
-
import "./chunk-
|
|
363
|
-
import "./chunk-
|
|
364
|
-
import {
|
|
365
|
-
resolveModelId
|
|
366
|
-
} from "./chunk-DX6JTDMR.js";
|
|
367
|
-
import "./chunk-VQDWCQOE.js";
|
|
385
|
+
import "./chunk-4YS7RMCB.js";
|
|
386
|
+
import "./chunk-PQQV3OBW.js";
|
|
387
|
+
import "./chunk-ANKISCKU.js";
|
|
388
|
+
import "./chunk-4SZ2636R.js";
|
|
368
389
|
import "./chunk-5EZRLTLQ.js";
|
|
369
390
|
import "./chunk-QHWCP53L.js";
|
|
370
|
-
import "./chunk-
|
|
371
|
-
import "./chunk-QJNDUTOL.js";
|
|
391
|
+
import "./chunk-C4FISGDN.js";
|
|
372
392
|
import "./chunk-O6GEWCJA.js";
|
|
373
393
|
import {
|
|
374
394
|
writeRuntimeStatus
|
|
375
|
-
} from "./chunk-
|
|
376
|
-
import
|
|
377
|
-
registerSession
|
|
378
|
-
} from "./chunk-OWUAZXXN.js";
|
|
379
|
-
import "./chunk-CH2YDT6X.js";
|
|
395
|
+
} from "./chunk-KS6F6LZQ.js";
|
|
396
|
+
import "./chunk-6PVPNMXU.js";
|
|
380
397
|
import {
|
|
381
|
-
|
|
382
|
-
} from "./chunk-
|
|
383
|
-
import "./chunk-
|
|
384
|
-
import "./chunk-
|
|
385
|
-
import "./chunk-
|
|
386
|
-
import "./chunk-
|
|
387
|
-
import "./chunk-ELRMZTPF.js";
|
|
398
|
+
resolveModelId
|
|
399
|
+
} from "./chunk-OB57Y2WH.js";
|
|
400
|
+
import "./chunk-RZZLNI74.js";
|
|
401
|
+
import "./chunk-IWMYX5LB.js";
|
|
402
|
+
import "./chunk-QJNDUTOL.js";
|
|
403
|
+
import "./chunk-QPTE6BKL.js";
|
|
388
404
|
import "./chunk-U6H3XTFA.js";
|
|
389
405
|
import {
|
|
390
406
|
resolveBundleDir
|
|
@@ -392,41 +408,47 @@ import {
|
|
|
392
408
|
import {
|
|
393
409
|
formatMemoryUsage
|
|
394
410
|
} from "./chunk-CHEIIBT3.js";
|
|
395
|
-
import
|
|
411
|
+
import {
|
|
412
|
+
registerSession
|
|
413
|
+
} from "./chunk-GHG4PQY2.js";
|
|
414
|
+
import "./chunk-YVYK3JYU.js";
|
|
415
|
+
import "./chunk-Q5N5NEVT.js";
|
|
416
|
+
import "./chunk-ADN5KESB.js";
|
|
417
|
+
import "./chunk-SK3RZOPS.js";
|
|
418
|
+
import "./chunk-EVZT24AF.js";
|
|
419
|
+
import "./chunk-ELRMZTPF.js";
|
|
420
|
+
import "./chunk-B5WYAQ4I.js";
|
|
396
421
|
import {
|
|
397
422
|
APPROVAL_MODES
|
|
398
423
|
} from "./chunk-JX6XHPTX.js";
|
|
399
|
-
import "./chunk-
|
|
400
|
-
import "./chunk-
|
|
401
|
-
import "./chunk-
|
|
402
|
-
import "./chunk-
|
|
424
|
+
import "./chunk-6C3D7BKK.js";
|
|
425
|
+
import "./chunk-O345BAI3.js";
|
|
426
|
+
import "./chunk-MNU36NGH.js";
|
|
427
|
+
import "./chunk-B3HGO6BB.js";
|
|
403
428
|
import {
|
|
404
429
|
NO_EXEC_CONFIG
|
|
405
|
-
} from "./chunk-
|
|
430
|
+
} from "./chunk-AUFTA63J.js";
|
|
431
|
+
import "./chunk-NX6JUO42.js";
|
|
432
|
+
import "./chunk-MLXTMF7H.js";
|
|
433
|
+
import "./chunk-BQMSZSG6.js";
|
|
434
|
+
import "./chunk-VNOVK4I7.js";
|
|
406
435
|
import {
|
|
407
436
|
clampInlineMediaPart
|
|
408
437
|
} from "./chunk-WFNEY5G7.js";
|
|
409
|
-
import "./chunk-
|
|
410
|
-
import "./chunk-BW2SMO6L.js";
|
|
438
|
+
import "./chunk-5FHOPPLZ.js";
|
|
411
439
|
import "./chunk-S6LOFUVP.js";
|
|
412
|
-
import "./chunk-
|
|
413
|
-
import "./chunk-
|
|
414
|
-
import "./chunk-
|
|
440
|
+
import "./chunk-BKVPLSEI.js";
|
|
441
|
+
import "./chunk-ZYLZNSBW.js";
|
|
442
|
+
import "./chunk-S7UQ3V2H.js";
|
|
443
|
+
import "./chunk-QE36VXWP.js";
|
|
444
|
+
import "./chunk-2A6RZKP2.js";
|
|
445
|
+
import "./chunk-WDVSRQIQ.js";
|
|
446
|
+
import "./chunk-GXNXX7A2.js";
|
|
415
447
|
import {
|
|
416
448
|
isPathWithinRoot
|
|
417
|
-
} from "./chunk-
|
|
449
|
+
} from "./chunk-IITTKFWM.js";
|
|
418
450
|
import "./chunk-Z72PLR74.js";
|
|
419
451
|
import "./chunk-NUQ4GK5I.js";
|
|
420
|
-
import "./chunk-DC4ZNGH4.js";
|
|
421
|
-
import "./chunk-NAVJD2PQ.js";
|
|
422
|
-
import "./chunk-3WILPKTJ.js";
|
|
423
|
-
import "./chunk-DRAX5YAI.js";
|
|
424
|
-
import "./chunk-VNOVK4I7.js";
|
|
425
|
-
import "./chunk-S7UQ3V2H.js";
|
|
426
|
-
import "./chunk-DJ2GSRLV.js";
|
|
427
|
-
import "./chunk-3XBUCOWS.js";
|
|
428
|
-
import "./chunk-M4U2LTD2.js";
|
|
429
|
-
import "./chunk-KFFCDLKV.js";
|
|
430
452
|
import "./chunk-KP2FHIFR.js";
|
|
431
453
|
import {
|
|
432
454
|
ALIBABA_PROVIDERS,
|
|
@@ -438,10 +460,18 @@ import {
|
|
|
438
460
|
findProviderByCredentials,
|
|
439
461
|
findProviderById,
|
|
440
462
|
getDefaultModelIds,
|
|
463
|
+
getModelsForProviderProtocol,
|
|
441
464
|
isImageGenerationCapable,
|
|
442
465
|
resolveMetadataKey
|
|
443
|
-
} from "./chunk-
|
|
444
|
-
import "./chunk-
|
|
466
|
+
} from "./chunk-KWZ2DDOC.js";
|
|
467
|
+
import "./chunk-6DB6UHY3.js";
|
|
468
|
+
import "./chunk-NAVJD2PQ.js";
|
|
469
|
+
import "./chunk-KKPIFWTZ.js";
|
|
470
|
+
import "./chunk-NFC4WTY2.js";
|
|
471
|
+
import "./chunk-YSD6IY6F.js";
|
|
472
|
+
import "./chunk-DJ2GSRLV.js";
|
|
473
|
+
import "./chunk-MS4SXNJ6.js";
|
|
474
|
+
import "./chunk-GVTAFLWB.js";
|
|
445
475
|
import {
|
|
446
476
|
AuthEvent,
|
|
447
477
|
ModelSlashCommandEvent,
|
|
@@ -465,52 +495,58 @@ import {
|
|
|
465
495
|
shouldRunVisionBridge,
|
|
466
496
|
splitImageParts,
|
|
467
497
|
uiTelemetryService
|
|
468
|
-
} from "./chunk-
|
|
498
|
+
} from "./chunk-K2T5PKFS.js";
|
|
469
499
|
import "./chunk-5ETULJLP.js";
|
|
470
500
|
import "./chunk-VGC4I5JJ.js";
|
|
501
|
+
import "./chunk-RVT5L74D.js";
|
|
502
|
+
import "./chunk-HD7O6WLV.js";
|
|
471
503
|
import {
|
|
472
504
|
getAllGeminiMdFilenames,
|
|
473
505
|
getUnsupportedImageFormatWarning,
|
|
474
506
|
isSupportedImageMimeType
|
|
475
|
-
} from "./chunk-
|
|
476
|
-
import "./chunk-EDIDYZBT.js";
|
|
477
|
-
import "./chunk-HD7O6WLV.js";
|
|
507
|
+
} from "./chunk-25FMWESU.js";
|
|
478
508
|
import "./chunk-CFMZLE3L.js";
|
|
509
|
+
import "./chunk-43QUA4MC.js";
|
|
479
510
|
import "./chunk-WZAD4ZNJ.js";
|
|
480
|
-
import "./chunk-
|
|
481
|
-
import "./chunk-XFFRI3WM.js";
|
|
511
|
+
import "./chunk-EKBQJ627.js";
|
|
482
512
|
import {
|
|
483
513
|
REASONING_EFFORT_TIERS,
|
|
484
514
|
applyReasoningEffort
|
|
485
|
-
} from "./chunk-
|
|
486
|
-
import "./chunk-
|
|
515
|
+
} from "./chunk-JWV5GI77.js";
|
|
516
|
+
import "./chunk-XZA32HII.js";
|
|
517
|
+
import "./chunk-CA63HYHU.js";
|
|
518
|
+
import "./chunk-SBP43AO6.js";
|
|
487
519
|
import "./chunk-HHJLM3WQ.js";
|
|
488
520
|
import {
|
|
489
521
|
isBinary,
|
|
490
522
|
redactUrlCredentials
|
|
491
|
-
} from "./chunk-
|
|
523
|
+
} from "./chunk-B3XJFEEH.js";
|
|
492
524
|
import "./chunk-74TONY4F.js";
|
|
493
|
-
import "./chunk-
|
|
525
|
+
import "./chunk-ZRQGTRHA.js";
|
|
494
526
|
import {
|
|
495
|
-
ToolNames,
|
|
496
527
|
isShellProgressData
|
|
497
|
-
} from "./chunk-
|
|
528
|
+
} from "./chunk-VPGRGNNH.js";
|
|
529
|
+
import {
|
|
530
|
+
ToolNames
|
|
531
|
+
} from "./chunk-ERIBG3BX.js";
|
|
498
532
|
import {
|
|
499
533
|
Storage,
|
|
500
534
|
createDebugLogger,
|
|
501
535
|
escapePath,
|
|
502
|
-
getErrorMessage,
|
|
503
536
|
isDebugLogFileEnabled,
|
|
504
537
|
shortenPath,
|
|
505
538
|
tildeifyPath
|
|
506
|
-
} from "./chunk-
|
|
539
|
+
} from "./chunk-ZYDMQCQP.js";
|
|
540
|
+
import {
|
|
541
|
+
getErrorMessage
|
|
542
|
+
} from "./chunk-S34QJ6IR.js";
|
|
507
543
|
import "./chunk-TBWQLLFO.js";
|
|
508
|
-
import "./chunk-
|
|
544
|
+
import "./chunk-5MYQ66UF.js";
|
|
509
545
|
import "./chunk-BSIOCNDK.js";
|
|
510
546
|
import {
|
|
511
547
|
registerCleanup,
|
|
512
548
|
runExitCleanup
|
|
513
|
-
} from "./chunk-
|
|
549
|
+
} from "./chunk-DQCGGSDO.js";
|
|
514
550
|
import {
|
|
515
551
|
profileCheckpoint
|
|
516
552
|
} from "./chunk-QILD6R27.js";
|
|
@@ -562,7 +598,7 @@ var require_jsx_dev_runtime = __commonJS({
|
|
|
562
598
|
|
|
563
599
|
// packages/cli/src/ui/opentui/start-opentui-ui.tsx
|
|
564
600
|
init_esbuild_shims();
|
|
565
|
-
var
|
|
601
|
+
var import_react64 = __toESM(require_react(), 1);
|
|
566
602
|
import { stat as stat2 } from "node:fs/promises";
|
|
567
603
|
import { basename as basename3 } from "node:path";
|
|
568
604
|
|
|
@@ -41082,7 +41118,7 @@ __name(useUpdateNoticeFlush, "useUpdateNoticeFlush");
|
|
|
41082
41118
|
|
|
41083
41119
|
// packages/cli/src/ui/opentui/opentui-app-shell.tsx
|
|
41084
41120
|
init_esbuild_shims();
|
|
41085
|
-
var
|
|
41121
|
+
var import_react59 = __toESM(require_react(), 1);
|
|
41086
41122
|
|
|
41087
41123
|
// packages/cli/src/ui/opentui/live-session.ts
|
|
41088
41124
|
init_esbuild_shims();
|
|
@@ -41921,6 +41957,7 @@ async function* livePromptEvents(config, prompt, signal, options) {
|
|
|
41921
41957
|
}, "mapOutputChunk");
|
|
41922
41958
|
let completed = [];
|
|
41923
41959
|
const descriptionSeen = /* @__PURE__ */ new Set();
|
|
41960
|
+
const queuedSeen = /* @__PURE__ */ new Set();
|
|
41924
41961
|
const scheduler = new CoreToolScheduler({
|
|
41925
41962
|
config,
|
|
41926
41963
|
getPreferredEditor: /* @__PURE__ */ __name(() => void 0, "getPreferredEditor"),
|
|
@@ -41973,6 +42010,14 @@ async function* livePromptEvents(config, prompt, signal, options) {
|
|
|
41973
42010
|
confirmationDetails: c2.confirmationDetails
|
|
41974
42011
|
});
|
|
41975
42012
|
}
|
|
42013
|
+
for (const c2 of calls) {
|
|
42014
|
+
const callId = c2.request.callId;
|
|
42015
|
+
const queued = c2.status === "scheduled";
|
|
42016
|
+
if (queuedSeen.has(callId) === queued) continue;
|
|
42017
|
+
if (queued) queuedSeen.add(callId);
|
|
42018
|
+
else queuedSeen.delete(callId);
|
|
42019
|
+
live.push({ type: "tool-queued", id: callId, queued });
|
|
42020
|
+
}
|
|
41976
42021
|
}, "onToolCallsUpdate"),
|
|
41977
42022
|
onAllToolCallsComplete: /* @__PURE__ */ __name(async (calls) => {
|
|
41978
42023
|
completed = calls;
|
|
@@ -43034,6 +43079,10 @@ function transcribeSession(jsonl, opts = {}) {
|
|
|
43034
43079
|
tool: name,
|
|
43035
43080
|
title: opts.toolTitle?.(name) ?? name
|
|
43036
43081
|
});
|
|
43082
|
+
const args = formatToolArgs(
|
|
43083
|
+
p2.functionCall.args
|
|
43084
|
+
);
|
|
43085
|
+
if (args) events.push({ type: "tool-args", id, args });
|
|
43037
43086
|
} else if (p2.text) {
|
|
43038
43087
|
events.push({ type: "text", delta: p2.text });
|
|
43039
43088
|
}
|
|
@@ -43597,7 +43646,11 @@ async function executeUserShell(config, rawQuery, emit, signal, terminalSize) {
|
|
|
43597
43646
|
}
|
|
43598
43647
|
if (!usePty && !isBinaryStream && Date.now() - lastUpdate > OUTPUT_UPDATE_INTERVAL_MS && cumulative.length > emittedLength) {
|
|
43599
43648
|
emittedLength = cumulative.length;
|
|
43600
|
-
emit({
|
|
43649
|
+
emit({
|
|
43650
|
+
type: "tool-output",
|
|
43651
|
+
id: callId,
|
|
43652
|
+
output: compactToolResultDisplayForHistory(cumulative)
|
|
43653
|
+
});
|
|
43601
43654
|
lastUpdate = Date.now();
|
|
43602
43655
|
}
|
|
43603
43656
|
}, "onOutputEvent");
|
|
@@ -43652,7 +43705,11 @@ ${prefixText}`;
|
|
|
43652
43705
|
}
|
|
43653
43706
|
const mainContent = isBinary(res.rawOutput) ? "[Command produced binary output, which is not shown.]" : res.output.trim() || "(Command produced no output)";
|
|
43654
43707
|
const finalOutput = `${prefixText}${mainContent}`;
|
|
43655
|
-
emit({
|
|
43708
|
+
emit({
|
|
43709
|
+
type: "tool-result",
|
|
43710
|
+
id: callId,
|
|
43711
|
+
display: compactToolResultDisplayForHistory(finalOutput)
|
|
43712
|
+
});
|
|
43656
43713
|
emit({
|
|
43657
43714
|
type: "tool-end",
|
|
43658
43715
|
id: callId,
|
|
@@ -43881,8 +43938,8 @@ function tailWindowPhysical(rows, width, maxRows) {
|
|
|
43881
43938
|
}
|
|
43882
43939
|
__name(tailWindowPhysical, "tailWindowPhysical");
|
|
43883
43940
|
var TOOL_CARD_DESCRIPTION_ROWS = 5;
|
|
43884
|
-
var PENDING_CARD_VIEWPORT_RESERVE_ROWS =
|
|
43885
|
-
var DIALOG_EXPANDED_RESERVE_ROWS =
|
|
43941
|
+
var PENDING_CARD_VIEWPORT_RESERVE_ROWS = 43;
|
|
43942
|
+
var DIALOG_EXPANDED_RESERVE_ROWS = 18;
|
|
43886
43943
|
var CARD_DESC_WRAP_RATIO = 0.7;
|
|
43887
43944
|
function pendingCardMaxRows(terminalHeight, descriptionWidth, width) {
|
|
43888
43945
|
const h3 = Math.floor(terminalHeight);
|
|
@@ -44022,6 +44079,13 @@ function toolStatusMeta(item) {
|
|
|
44022
44079
|
};
|
|
44023
44080
|
}
|
|
44024
44081
|
if (!item.done) {
|
|
44082
|
+
if (item.queued) {
|
|
44083
|
+
return {
|
|
44084
|
+
glyph: TOOL_STATUS.PENDING,
|
|
44085
|
+
color: C2.green,
|
|
44086
|
+
strikethrough: false
|
|
44087
|
+
};
|
|
44088
|
+
}
|
|
44025
44089
|
return {
|
|
44026
44090
|
glyph: TOOL_STATUS.EXECUTING,
|
|
44027
44091
|
color: C2.text,
|
|
@@ -45494,7 +45558,7 @@ var OpenTuiErrorBoundary = class extends import_react18.Component {
|
|
|
45494
45558
|
|
|
45495
45559
|
// packages/cli/src/ui/opentui/opentui-dialog-mount.tsx
|
|
45496
45560
|
init_esbuild_shims();
|
|
45497
|
-
var
|
|
45561
|
+
var import_react47 = __toESM(require_react(), 1);
|
|
45498
45562
|
|
|
45499
45563
|
// packages/cli/src/ui/opentui/help-overlay.tsx
|
|
45500
45564
|
init_esbuild_shims();
|
|
@@ -49965,7 +50029,7 @@ __name(OpenTuiPermissionsDialog, "OpenTuiPermissionsDialog");
|
|
|
49965
50029
|
|
|
49966
50030
|
// packages/cli/src/ui/opentui/dialogs-auth.tsx
|
|
49967
50031
|
init_esbuild_shims();
|
|
49968
|
-
var
|
|
50032
|
+
var import_react37 = __toESM(require_react(), 1);
|
|
49969
50033
|
|
|
49970
50034
|
// packages/cli/src/ui/opentui/input-prompt-key.ts
|
|
49971
50035
|
init_esbuild_shims();
|
|
@@ -50661,12 +50725,226 @@ function historyDownDecision(history, lineCount, cursorLine, cursorCol, lastLine
|
|
|
50661
50725
|
}
|
|
50662
50726
|
__name(historyDownDecision, "historyDownDecision");
|
|
50663
50727
|
|
|
50664
|
-
// packages/cli/src/ui/opentui/
|
|
50728
|
+
// packages/cli/src/ui/opentui/line-edit.ts
|
|
50665
50729
|
init_esbuild_shims();
|
|
50666
50730
|
var import_react34 = __toESM(require_react(), 1);
|
|
50731
|
+
function endOfLine(text) {
|
|
50732
|
+
return { text, cursor: cpLen(text) };
|
|
50733
|
+
}
|
|
50734
|
+
__name(endOfLine, "endOfLine");
|
|
50735
|
+
function clampCaret(state) {
|
|
50736
|
+
const end = cpLen(state.text);
|
|
50737
|
+
const cursor = state.cursor < 0 ? 0 : Math.min(state.cursor, end);
|
|
50738
|
+
return cursor === state.cursor ? state : { text: state.text, cursor };
|
|
50739
|
+
}
|
|
50740
|
+
__name(clampCaret, "clampCaret");
|
|
50741
|
+
function caretForAcceptedValue(state, accepted) {
|
|
50742
|
+
if (accepted === state.text) return clampCaret(state);
|
|
50743
|
+
const proposed = toCodePoints(state.text);
|
|
50744
|
+
const current = toCodePoints(accepted);
|
|
50745
|
+
const caret0 = Math.min(state.cursor, proposed.length);
|
|
50746
|
+
let p2 = 0;
|
|
50747
|
+
let c2 = 0;
|
|
50748
|
+
let dropped = 0;
|
|
50749
|
+
while (p2 < proposed.length && c2 < current.length) {
|
|
50750
|
+
if (proposed[p2] === current[c2]) {
|
|
50751
|
+
p2++;
|
|
50752
|
+
c2++;
|
|
50753
|
+
} else if (p2 < caret0) {
|
|
50754
|
+
p2++;
|
|
50755
|
+
dropped++;
|
|
50756
|
+
} else {
|
|
50757
|
+
break;
|
|
50758
|
+
}
|
|
50759
|
+
}
|
|
50760
|
+
let cursor = caret0 - dropped;
|
|
50761
|
+
if (c2 < current.length) {
|
|
50762
|
+
let shared = 0;
|
|
50763
|
+
while (shared < proposed.length && shared < current.length && proposed[shared] === current[shared]) {
|
|
50764
|
+
shared++;
|
|
50765
|
+
}
|
|
50766
|
+
cursor = Math.min(state.cursor, shared);
|
|
50767
|
+
}
|
|
50768
|
+
return {
|
|
50769
|
+
text: accepted,
|
|
50770
|
+
cursor: Math.max(0, Math.min(cursor, current.length))
|
|
50771
|
+
};
|
|
50772
|
+
}
|
|
50773
|
+
__name(caretForAcceptedValue, "caretForAcceptedValue");
|
|
50774
|
+
function lineBounds(text, cursor) {
|
|
50775
|
+
const codePoints = toCodePoints(text);
|
|
50776
|
+
let start = cursor;
|
|
50777
|
+
while (start > 0 && codePoints[start - 1] !== "\n") start--;
|
|
50778
|
+
let end = cursor;
|
|
50779
|
+
while (end < codePoints.length && codePoints[end] !== "\n") end++;
|
|
50780
|
+
return { start, end, line: codePoints.slice(start, end).join("") };
|
|
50781
|
+
}
|
|
50782
|
+
__name(lineBounds, "lineBounds");
|
|
50783
|
+
function caretSpans(state) {
|
|
50784
|
+
const clamped = clampCaret(state);
|
|
50785
|
+
const { start, end } = lineBounds(clamped.text, clamped.cursor);
|
|
50786
|
+
return {
|
|
50787
|
+
before: cpSlice(clamped.text, start, clamped.cursor),
|
|
50788
|
+
at: cpSlice(
|
|
50789
|
+
clamped.text,
|
|
50790
|
+
clamped.cursor,
|
|
50791
|
+
Math.min(clamped.cursor + 1, end)
|
|
50792
|
+
),
|
|
50793
|
+
after: cpSlice(clamped.text, clamped.cursor + 1, end)
|
|
50794
|
+
};
|
|
50795
|
+
}
|
|
50796
|
+
__name(caretSpans, "caretSpans");
|
|
50797
|
+
function insertAtCaret(state, inserted) {
|
|
50798
|
+
const { text, cursor } = clampCaret(state);
|
|
50799
|
+
const clean = stripUnsafeCharacters(
|
|
50800
|
+
inserted.replace(/\r\n/g, "\n").replace(/\r/g, "\n")
|
|
50801
|
+
);
|
|
50802
|
+
const width = cpLen(clean);
|
|
50803
|
+
if (width === 0) return state;
|
|
50804
|
+
return {
|
|
50805
|
+
text: cpSlice(text, 0, cursor) + clean + cpSlice(text, cursor),
|
|
50806
|
+
cursor: cursor + width
|
|
50807
|
+
};
|
|
50808
|
+
}
|
|
50809
|
+
__name(insertAtCaret, "insertAtCaret");
|
|
50810
|
+
function backspaceAtCaret(state) {
|
|
50811
|
+
const { text, cursor } = clampCaret(state);
|
|
50812
|
+
if (cursor === 0) return state;
|
|
50813
|
+
return {
|
|
50814
|
+
text: cpSlice(text, 0, cursor - 1) + cpSlice(text, cursor),
|
|
50815
|
+
cursor: cursor - 1
|
|
50816
|
+
};
|
|
50817
|
+
}
|
|
50818
|
+
__name(backspaceAtCaret, "backspaceAtCaret");
|
|
50819
|
+
function deleteAtCaret(state) {
|
|
50820
|
+
const { text, cursor } = clampCaret(state);
|
|
50821
|
+
if (cursor >= cpLen(text)) return state;
|
|
50822
|
+
return {
|
|
50823
|
+
text: cpSlice(text, 0, cursor) + cpSlice(text, cursor + 1),
|
|
50824
|
+
cursor
|
|
50825
|
+
};
|
|
50826
|
+
}
|
|
50827
|
+
__name(deleteAtCaret, "deleteAtCaret");
|
|
50828
|
+
function moveCaretLeft(state) {
|
|
50829
|
+
const { cursor } = clampCaret(state);
|
|
50830
|
+
return cursor === 0 ? state : { ...state, cursor: cursor - 1 };
|
|
50831
|
+
}
|
|
50832
|
+
__name(moveCaretLeft, "moveCaretLeft");
|
|
50833
|
+
function moveCaretRight(state) {
|
|
50834
|
+
const clamped = clampCaret(state);
|
|
50835
|
+
return clamped.cursor >= cpLen(clamped.text) ? clamped : { ...clamped, cursor: clamped.cursor + 1 };
|
|
50836
|
+
}
|
|
50837
|
+
__name(moveCaretRight, "moveCaretRight");
|
|
50838
|
+
function moveCaretHome(state) {
|
|
50839
|
+
const clamped = clampCaret(state);
|
|
50840
|
+
return {
|
|
50841
|
+
text: clamped.text,
|
|
50842
|
+
cursor: lineBounds(clamped.text, clamped.cursor).start
|
|
50843
|
+
};
|
|
50844
|
+
}
|
|
50845
|
+
__name(moveCaretHome, "moveCaretHome");
|
|
50846
|
+
function moveCaretLineEnd(state) {
|
|
50847
|
+
const clamped = clampCaret(state);
|
|
50848
|
+
return {
|
|
50849
|
+
text: clamped.text,
|
|
50850
|
+
cursor: lineBounds(clamped.text, clamped.cursor).end
|
|
50851
|
+
};
|
|
50852
|
+
}
|
|
50853
|
+
__name(moveCaretLineEnd, "moveCaretLineEnd");
|
|
50854
|
+
function moveCaretEnd(state) {
|
|
50855
|
+
const clamped = clampCaret(state);
|
|
50856
|
+
const end = cpLen(clamped.text);
|
|
50857
|
+
return clamped.cursor === end ? clamped : { text: clamped.text, cursor: end };
|
|
50858
|
+
}
|
|
50859
|
+
__name(moveCaretEnd, "moveCaretEnd");
|
|
50860
|
+
function deleteWordLeftAtCaret(state) {
|
|
50861
|
+
const { text, cursor } = clampCaret(state);
|
|
50862
|
+
const { start, line } = lineBounds(text, cursor);
|
|
50863
|
+
const col = cursor - start;
|
|
50864
|
+
if (col === 0) return cursor === 0 ? state : backspaceAtCaret(state);
|
|
50865
|
+
const boundary = findPrevWordStart(getWordBoundaries(line), col);
|
|
50866
|
+
const fallback = findPrevWordStartInLine(line, col);
|
|
50867
|
+
const target = start + (boundary ?? fallback ?? 0);
|
|
50868
|
+
return {
|
|
50869
|
+
text: cpSlice(text, 0, target) + cpSlice(text, cursor),
|
|
50870
|
+
cursor: target
|
|
50871
|
+
};
|
|
50872
|
+
}
|
|
50873
|
+
__name(deleteWordLeftAtCaret, "deleteWordLeftAtCaret");
|
|
50874
|
+
function applyLineKey(state, key) {
|
|
50875
|
+
const { name, ctrl, meta, sequence } = key;
|
|
50876
|
+
const modified = ctrl || meta;
|
|
50877
|
+
const next = clampCaret(state);
|
|
50878
|
+
if (name === "left" && !modified) return moveCaretLeft(next);
|
|
50879
|
+
if (ctrl && name === "b") return moveCaretLeft(next);
|
|
50880
|
+
if (name === "right" && !modified) return moveCaretRight(next);
|
|
50881
|
+
if (ctrl && name === "f") return moveCaretRight(next);
|
|
50882
|
+
if (name === "home" || ctrl && name === "a") return moveCaretHome(next);
|
|
50883
|
+
if (name === "end") return moveCaretLineEnd(next);
|
|
50884
|
+
if (ctrl && name === "e") return moveCaretEnd(next);
|
|
50885
|
+
if (ctrl && name === "w") return deleteWordLeftAtCaret(next);
|
|
50886
|
+
if (isDeleteWordBackwardSequence(sequence) || modified && (name === "backspace" || sequence === "\x7F")) {
|
|
50887
|
+
return deleteWordLeftAtCaret(next);
|
|
50888
|
+
}
|
|
50889
|
+
if (name === "backspace" || sequence === "\x7F" || ctrl && name === "h") {
|
|
50890
|
+
return backspaceAtCaret(next);
|
|
50891
|
+
}
|
|
50892
|
+
if (name === "delete" && !modified) return deleteAtCaret(next);
|
|
50893
|
+
return null;
|
|
50894
|
+
}
|
|
50895
|
+
__name(applyLineKey, "applyLineKey");
|
|
50896
|
+
function useLineEdit(value, onChange, mountKey) {
|
|
50897
|
+
const [, repaint] = (0, import_react34.useState)(0);
|
|
50898
|
+
const settledRef = (0, import_react34.useRef)(false);
|
|
50899
|
+
const mirror = (0, import_react34.useRef)(endOfLine(value));
|
|
50900
|
+
const mounted = (0, import_react34.useRef)(mountKey);
|
|
50901
|
+
if (mounted.current !== mountKey) {
|
|
50902
|
+
mounted.current = mountKey;
|
|
50903
|
+
mirror.current = endOfLine(value);
|
|
50904
|
+
settledRef.current = false;
|
|
50905
|
+
} else {
|
|
50906
|
+
mirror.current = caretForAcceptedValue(mirror.current, value);
|
|
50907
|
+
}
|
|
50908
|
+
const commit = /* @__PURE__ */ __name((next) => {
|
|
50909
|
+
const changed = next.text !== mirror.current.text;
|
|
50910
|
+
mirror.current = next;
|
|
50911
|
+
repaint((frame) => frame + 1);
|
|
50912
|
+
if (changed) onChange(next.text);
|
|
50913
|
+
}, "commit");
|
|
50914
|
+
return {
|
|
50915
|
+
get text() {
|
|
50916
|
+
return mirror.current.text;
|
|
50917
|
+
},
|
|
50918
|
+
get caret() {
|
|
50919
|
+
return mirror.current.cursor;
|
|
50920
|
+
},
|
|
50921
|
+
handleKey: /* @__PURE__ */ __name((key) => {
|
|
50922
|
+
const edited = applyLineKey(mirror.current, key);
|
|
50923
|
+
if (!edited) return false;
|
|
50924
|
+
commit(edited);
|
|
50925
|
+
return true;
|
|
50926
|
+
}, "handleKey"),
|
|
50927
|
+
insert: /* @__PURE__ */ __name((text) => {
|
|
50928
|
+
if (settledRef.current) return;
|
|
50929
|
+
const edited = insertAtCaret(mirror.current, text);
|
|
50930
|
+
if (edited !== mirror.current) commit(edited);
|
|
50931
|
+
}, "insert"),
|
|
50932
|
+
settle: /* @__PURE__ */ __name(() => {
|
|
50933
|
+
settledRef.current = true;
|
|
50934
|
+
}, "settle"),
|
|
50935
|
+
get settled() {
|
|
50936
|
+
return settledRef.current;
|
|
50937
|
+
}
|
|
50938
|
+
};
|
|
50939
|
+
}
|
|
50940
|
+
__name(useLineEdit, "useLineEdit");
|
|
50941
|
+
|
|
50942
|
+
// packages/cli/src/ui/opentui/dialogs-misc.tsx
|
|
50943
|
+
init_esbuild_shims();
|
|
50944
|
+
var import_react35 = __toESM(require_react(), 1);
|
|
50667
50945
|
function useEsc(onClose) {
|
|
50668
50946
|
const renderer = useRenderer();
|
|
50669
|
-
(0,
|
|
50947
|
+
(0, import_react35.useLayoutEffect)(() => {
|
|
50670
50948
|
const onRaw = /* @__PURE__ */ __name((seq) => {
|
|
50671
50949
|
if (seq !== "\x1B") return false;
|
|
50672
50950
|
onClose();
|
|
@@ -50720,20 +50998,20 @@ function nextEnabledIndex(items, current, delta) {
|
|
|
50720
50998
|
__name(nextEnabledIndex, "nextEnabledIndex");
|
|
50721
50999
|
function OpenTuiEditorDialog({ settings, onClose, notify }) {
|
|
50722
51000
|
useEsc(onClose);
|
|
50723
|
-
const editors = (0,
|
|
51001
|
+
const editors = (0, import_react35.useMemo)(
|
|
50724
51002
|
() => editorSettingsManager.getAvailableEditorDisplays(),
|
|
50725
51003
|
[]
|
|
50726
51004
|
);
|
|
50727
|
-
const [mode, setMode] = (0,
|
|
50728
|
-
const [scope, setScope] = (0,
|
|
51005
|
+
const [mode, setMode] = (0, import_react35.useState)("editor");
|
|
51006
|
+
const [scope, setScope] = (0, import_react35.useState)("User" /* User */);
|
|
50729
51007
|
const scopeIndexOf = /* @__PURE__ */ __name((s) => {
|
|
50730
51008
|
const pref = settings.forScope(s).settings.general?.preferredEditor;
|
|
50731
51009
|
const idx = pref ? editors.findIndex((e) => e.type === pref) : 0;
|
|
50732
51010
|
return idx >= 0 ? idx : 0;
|
|
50733
51011
|
}, "scopeIndexOf");
|
|
50734
|
-
const [sel, setSel] = (0,
|
|
50735
|
-
const scopeItems = (0,
|
|
50736
|
-
const [scopeSel, setScopeSel] = (0,
|
|
51012
|
+
const [sel, setSel] = (0, import_react35.useState)(() => scopeIndexOf("User" /* User */));
|
|
51013
|
+
const scopeItems = (0, import_react35.useMemo)(() => getScopeItems(), []);
|
|
51014
|
+
const [scopeSel, setScopeSel] = (0, import_react35.useState)(0);
|
|
50737
51015
|
const highlightScope = /* @__PURE__ */ __name((idx) => {
|
|
50738
51016
|
const item = scopeItems[idx];
|
|
50739
51017
|
if (!item) return;
|
|
@@ -50847,12 +51125,12 @@ function OpenTuiTrustDialog({ config, onClose }) {
|
|
|
50847
51125
|
__name(OpenTuiTrustDialog, "OpenTuiTrustDialog");
|
|
50848
51126
|
function OpenTuiDeleteDialog({ config, onClose, notify }) {
|
|
50849
51127
|
useEsc(onClose);
|
|
50850
|
-
const [rows, setRows] = (0,
|
|
50851
|
-
const [loading, setLoading] = (0,
|
|
50852
|
-
const [cursor, setCursor] = (0,
|
|
50853
|
-
const [busy, setBusy] = (0,
|
|
51128
|
+
const [rows, setRows] = (0, import_react35.useState)([]);
|
|
51129
|
+
const [loading, setLoading] = (0, import_react35.useState)(true);
|
|
51130
|
+
const [cursor, setCursor] = (0, import_react35.useState)(0);
|
|
51131
|
+
const [busy, setBusy] = (0, import_react35.useState)(false);
|
|
50854
51132
|
const currentSessionId = config?.getSessionId?.() ?? "";
|
|
50855
|
-
(0,
|
|
51133
|
+
(0, import_react35.useEffect)(() => {
|
|
50856
51134
|
let alive = true;
|
|
50857
51135
|
const svc = config?.getSessionService?.();
|
|
50858
51136
|
if (!svc) {
|
|
@@ -50935,10 +51213,10 @@ function OpenTuiResumeDialog({
|
|
|
50935
51213
|
onSelect
|
|
50936
51214
|
}) {
|
|
50937
51215
|
useEsc(onClose);
|
|
50938
|
-
const [rows, setRows] = (0,
|
|
50939
|
-
const [loading, setLoading] = (0,
|
|
50940
|
-
const [cursor, setCursor] = (0,
|
|
50941
|
-
(0,
|
|
51216
|
+
const [rows, setRows] = (0, import_react35.useState)(matchedSessions ?? []);
|
|
51217
|
+
const [loading, setLoading] = (0, import_react35.useState)(!matchedSessions);
|
|
51218
|
+
const [cursor, setCursor] = (0, import_react35.useState)(0);
|
|
51219
|
+
(0, import_react35.useEffect)(() => {
|
|
50942
51220
|
if (matchedSessions) {
|
|
50943
51221
|
setRows(matchedSessions);
|
|
50944
51222
|
setLoading(false);
|
|
@@ -51005,8 +51283,8 @@ function OpenTuiRewindDialog({ onClose }) {
|
|
|
51005
51283
|
__name(OpenTuiRewindDialog, "OpenTuiRewindDialog");
|
|
51006
51284
|
function OpenTuiDiffDialog({ onClose }) {
|
|
51007
51285
|
useEsc(onClose);
|
|
51008
|
-
const [lines, setLines] = (0,
|
|
51009
|
-
(0,
|
|
51286
|
+
const [lines, setLines] = (0, import_react35.useState)([]);
|
|
51287
|
+
(0, import_react35.useEffect)(() => {
|
|
51010
51288
|
let alive = true;
|
|
51011
51289
|
import("node:child_process").then(({ execFile }) => {
|
|
51012
51290
|
execFile(
|
|
@@ -51049,9 +51327,9 @@ function OpenTuiSubagentCreateDialog({ onClose }) {
|
|
|
51049
51327
|
__name(OpenTuiSubagentCreateDialog, "OpenTuiSubagentCreateDialog");
|
|
51050
51328
|
function OpenTuiSubagentListDialog({ config, onClose }) {
|
|
51051
51329
|
useEsc(onClose);
|
|
51052
|
-
const [rows, setRows] = (0,
|
|
51053
|
-
const [loading, setLoading] = (0,
|
|
51054
|
-
(0,
|
|
51330
|
+
const [rows, setRows] = (0, import_react35.useState)([]);
|
|
51331
|
+
const [loading, setLoading] = (0, import_react35.useState)(true);
|
|
51332
|
+
(0, import_react35.useEffect)(() => {
|
|
51055
51333
|
let alive = true;
|
|
51056
51334
|
const mgr = config?.getSubagentManager?.();
|
|
51057
51335
|
if (!mgr) {
|
|
@@ -51114,12 +51392,6 @@ var PROTOCOL_ITEMS = [
|
|
|
51114
51392
|
description: t("Standard OpenAI API format (most common)"),
|
|
51115
51393
|
value: "openai" /* USE_OPENAI */
|
|
51116
51394
|
},
|
|
51117
|
-
{
|
|
51118
|
-
key: "openai-responses" /* USE_OPENAI_RESPONSES */,
|
|
51119
|
-
label: t("OpenAI Responses"),
|
|
51120
|
-
description: t("OpenAI Responses API \u2014 streaming reasoning + tool use"),
|
|
51121
|
-
value: "openai-responses" /* USE_OPENAI_RESPONSES */
|
|
51122
|
-
},
|
|
51123
51395
|
{
|
|
51124
51396
|
key: "anthropic" /* USE_ANTHROPIC */,
|
|
51125
51397
|
label: t("Anthropic-compatible"),
|
|
@@ -51149,6 +51421,7 @@ function providerToItem(config) {
|
|
|
51149
51421
|
__name(providerToItem, "providerToItem");
|
|
51150
51422
|
function getStepLabel(step, p2) {
|
|
51151
51423
|
if (step === "protocol") return t("Protocol");
|
|
51424
|
+
if (step === "wireApi") return t("API");
|
|
51152
51425
|
if (step === "baseUrl") {
|
|
51153
51426
|
if (p2.uiLabels?.baseUrlStepTitle) return t(p2.uiLabels.baseUrlStepTitle);
|
|
51154
51427
|
return Array.isArray(p2.baseUrl) ? t("Endpoint") : t("Base URL");
|
|
@@ -51195,50 +51468,80 @@ function RadioList({ items, cursor }) {
|
|
|
51195
51468
|
}) });
|
|
51196
51469
|
}
|
|
51197
51470
|
__name(RadioList, "RadioList");
|
|
51198
|
-
function
|
|
51471
|
+
function FieldText({
|
|
51199
51472
|
value,
|
|
51473
|
+
caret,
|
|
51200
51474
|
placeholder,
|
|
51201
51475
|
active
|
|
51202
51476
|
}) {
|
|
51203
|
-
|
|
51204
|
-
|
|
51205
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
51206
|
-
|
|
51477
|
+
if (value.length === 0 && placeholder) {
|
|
51478
|
+
if (!active) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: placeholder });
|
|
51479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
51480
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { bg: C2.accent, children: placeholder.slice(0, 1) }),
|
|
51481
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: placeholder.slice(1) })
|
|
51482
|
+
] });
|
|
51483
|
+
}
|
|
51484
|
+
const spans = caretSpans({ text: value, cursor: caret });
|
|
51485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
51486
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: sanitizeTerminalText(spans.before) }),
|
|
51487
|
+
active ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { bg: C2.accent, children: sanitizeTerminalText(spans.at) || " " }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: sanitizeTerminalText(spans.at) }),
|
|
51488
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: sanitizeTerminalText(spans.after) })
|
|
51207
51489
|
] });
|
|
51208
51490
|
}
|
|
51491
|
+
__name(FieldText, "FieldText");
|
|
51492
|
+
function InputLine({
|
|
51493
|
+
value,
|
|
51494
|
+
caret,
|
|
51495
|
+
placeholder,
|
|
51496
|
+
active
|
|
51497
|
+
}) {
|
|
51498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { flexDirection: "row", marginTop: 1, paddingLeft: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51499
|
+
FieldText,
|
|
51500
|
+
{
|
|
51501
|
+
value,
|
|
51502
|
+
caret,
|
|
51503
|
+
placeholder,
|
|
51504
|
+
active
|
|
51505
|
+
}
|
|
51506
|
+
) });
|
|
51507
|
+
}
|
|
51209
51508
|
__name(InputLine, "InputLine");
|
|
51210
|
-
function useLineInputKeys(value, onChange, onSubmit) {
|
|
51509
|
+
function useLineInputKeys(value, onChange, onSubmit, retrySeq) {
|
|
51510
|
+
const line = useLineEdit(value, onChange, retrySeq);
|
|
51211
51511
|
useKeyboard((key) => {
|
|
51512
|
+
if (line.settled) return;
|
|
51212
51513
|
const o = toOriginalKey(key);
|
|
51213
51514
|
if (o.name === "return" || o.name === "enter") {
|
|
51214
|
-
onSubmit();
|
|
51215
|
-
return;
|
|
51216
|
-
}
|
|
51217
|
-
if (o.name === "backspace" || o.name === "delete") {
|
|
51218
|
-
onChange(value.slice(0, -1));
|
|
51515
|
+
if (onSubmit(line.text)) line.settle();
|
|
51219
51516
|
return;
|
|
51220
51517
|
}
|
|
51221
|
-
if (isPrintableKeyInput(key)) {
|
|
51222
|
-
|
|
51518
|
+
if (!line.handleKey(o) && isPrintableKeyInput(key)) {
|
|
51519
|
+
line.insert(key.sequence);
|
|
51223
51520
|
}
|
|
51224
51521
|
});
|
|
51225
51522
|
usePaste((event) => {
|
|
51226
51523
|
const text = normalizePastedText(decodePasteBytes(event.bytes));
|
|
51227
51524
|
if (!text) return;
|
|
51228
51525
|
event.preventDefault();
|
|
51229
|
-
|
|
51526
|
+
line.insert(text);
|
|
51230
51527
|
});
|
|
51528
|
+
return line.caret;
|
|
51231
51529
|
}
|
|
51232
51530
|
__name(useLineInputKeys, "useLineInputKeys");
|
|
51233
51531
|
function ProtocolStep({ flow }) {
|
|
51234
51532
|
const provider = flow.state.provider;
|
|
51235
|
-
const items = (0,
|
|
51533
|
+
const items = (0, import_react37.useMemo)(() => {
|
|
51236
51534
|
const protocolOpts = provider.protocolOptions ?? [provider.protocol];
|
|
51237
51535
|
return PROTOCOL_ITEMS.filter(
|
|
51238
51536
|
(p2) => protocolOpts.includes(p2.value)
|
|
51239
51537
|
);
|
|
51240
51538
|
}, [provider]);
|
|
51241
|
-
const [cursor, setCursor] = (0,
|
|
51539
|
+
const [cursor, setCursor] = (0, import_react37.useState)(
|
|
51540
|
+
Math.max(
|
|
51541
|
+
0,
|
|
51542
|
+
items.findIndex((item) => item.value === flow.state.protocol)
|
|
51543
|
+
)
|
|
51544
|
+
);
|
|
51242
51545
|
useKeyboard((key) => {
|
|
51243
51546
|
const o = toOriginalKey(key);
|
|
51244
51547
|
if (o.name === "up") {
|
|
@@ -51256,6 +51559,31 @@ function ProtocolStep({ flow }) {
|
|
|
51256
51559
|
] });
|
|
51257
51560
|
}
|
|
51258
51561
|
__name(ProtocolStep, "ProtocolStep");
|
|
51562
|
+
function ApiStep({ flow }) {
|
|
51563
|
+
const items = [
|
|
51564
|
+
{
|
|
51565
|
+
key: "chat-completions",
|
|
51566
|
+
label: t("Chat Completions"),
|
|
51567
|
+
value: "chat-completions"
|
|
51568
|
+
},
|
|
51569
|
+
{ key: "responses", label: t("Responses"), value: "responses" }
|
|
51570
|
+
];
|
|
51571
|
+
const [cursor, setCursor] = (0, import_react37.useState)(
|
|
51572
|
+
flow.state.wireApi === "responses" ? 1 : 0
|
|
51573
|
+
);
|
|
51574
|
+
useKeyboard((key) => {
|
|
51575
|
+
const o = toOriginalKey(key);
|
|
51576
|
+
if (o.name === "up") setCursor(0);
|
|
51577
|
+
else if (o.name === "down") setCursor(1);
|
|
51578
|
+
else if (o.name === "return")
|
|
51579
|
+
flow.selectWireApi(items[cursor].value);
|
|
51580
|
+
});
|
|
51581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
51582
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioList, { items, cursor }),
|
|
51583
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: NAV_HINT_SELECT }) })
|
|
51584
|
+
] });
|
|
51585
|
+
}
|
|
51586
|
+
__name(ApiStep, "ApiStep");
|
|
51259
51587
|
function BaseUrlSelectStep({
|
|
51260
51588
|
provider,
|
|
51261
51589
|
flow
|
|
@@ -51267,7 +51595,7 @@ function BaseUrlSelectStep({
|
|
|
51267
51595
|
description: opt.url,
|
|
51268
51596
|
value: opt.url
|
|
51269
51597
|
}));
|
|
51270
|
-
const [cursor, setCursor] = (0,
|
|
51598
|
+
const [cursor, setCursor] = (0, import_react37.useState)(flow.state.baseUrlOptionIndex);
|
|
51271
51599
|
useKeyboard((key) => {
|
|
51272
51600
|
const o = toOriginalKey(key);
|
|
51273
51601
|
if (o.name === "up" || o.name === "down") {
|
|
@@ -51288,12 +51616,14 @@ function BaseUrlSelectStep({
|
|
|
51288
51616
|
__name(BaseUrlSelectStep, "BaseUrlSelectStep");
|
|
51289
51617
|
function BaseUrlInputStep({
|
|
51290
51618
|
flow,
|
|
51291
|
-
documentationUrl
|
|
51619
|
+
documentationUrl,
|
|
51620
|
+
retrySeq
|
|
51292
51621
|
}) {
|
|
51293
|
-
useLineInputKeys(
|
|
51622
|
+
const caret = useLineInputKeys(
|
|
51294
51623
|
flow.state.baseUrl,
|
|
51295
51624
|
flow.changeBaseUrl,
|
|
51296
|
-
() => flow.submitBaseUrl()
|
|
51625
|
+
(text) => flow.submitBaseUrl(text),
|
|
51626
|
+
retrySeq
|
|
51297
51627
|
);
|
|
51298
51628
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", marginTop: 1, children: [
|
|
51299
51629
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: t("Enter the API endpoint for this protocol.") }),
|
|
@@ -51301,6 +51631,7 @@ function BaseUrlInputStep({
|
|
|
51301
51631
|
InputLine,
|
|
51302
51632
|
{
|
|
51303
51633
|
value: flow.state.baseUrl,
|
|
51634
|
+
caret,
|
|
51304
51635
|
placeholder: flow.state.baseUrlPlaceholder || "https://api.openai.com/v1",
|
|
51305
51636
|
active: true
|
|
51306
51637
|
}
|
|
@@ -51319,13 +51650,15 @@ function BaseUrlInputStep({
|
|
|
51319
51650
|
__name(BaseUrlInputStep, "BaseUrlInputStep");
|
|
51320
51651
|
function ApiKeyStep({
|
|
51321
51652
|
provider,
|
|
51322
|
-
flow
|
|
51653
|
+
flow,
|
|
51654
|
+
retrySeq
|
|
51323
51655
|
}) {
|
|
51324
51656
|
const docUrl = resolveDocumentationUrl(provider, flow.state.baseUrl);
|
|
51325
|
-
useLineInputKeys(
|
|
51657
|
+
const caret = useLineInputKeys(
|
|
51326
51658
|
flow.state.apiKey,
|
|
51327
51659
|
flow.changeApiKey,
|
|
51328
|
-
() => flow.submitApiKey(
|
|
51660
|
+
(text) => flow.submitApiKey(text),
|
|
51661
|
+
retrySeq
|
|
51329
51662
|
);
|
|
51330
51663
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", marginTop: 1, children: [
|
|
51331
51664
|
docUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.purple, children: `${t("Documentation")}: ${docUrl}` }) }),
|
|
@@ -51333,6 +51666,7 @@ function ApiKeyStep({
|
|
|
51333
51666
|
InputLine,
|
|
51334
51667
|
{
|
|
51335
51668
|
value: flow.state.apiKey,
|
|
51669
|
+
caret,
|
|
51336
51670
|
placeholder: provider.apiKeyPlaceholder ?? "sk-...",
|
|
51337
51671
|
active: true
|
|
51338
51672
|
}
|
|
@@ -51349,56 +51683,66 @@ function uniqueIds(ids) {
|
|
|
51349
51683
|
__name(uniqueIds, "uniqueIds");
|
|
51350
51684
|
function ModelsStep({
|
|
51351
51685
|
provider,
|
|
51352
|
-
flow
|
|
51686
|
+
flow,
|
|
51687
|
+
retrySeq
|
|
51353
51688
|
}) {
|
|
51354
|
-
const modelOptions = (0,
|
|
51689
|
+
const modelOptions = (0, import_react37.useMemo)(
|
|
51355
51690
|
() => provider.models?.map((m3) => m3.id) ?? [],
|
|
51356
51691
|
[provider.models]
|
|
51357
51692
|
);
|
|
51358
51693
|
const hasSelectableModels = modelOptions.length > 0;
|
|
51359
|
-
const selectedModelIds = (0,
|
|
51694
|
+
const selectedModelIds = (0, import_react37.useMemo)(
|
|
51360
51695
|
() => normalizeModelIds(flow.state.modelIds),
|
|
51361
51696
|
[flow.state.modelIds]
|
|
51362
51697
|
);
|
|
51363
|
-
const recommendedIds = (0,
|
|
51364
|
-
const [focus, setFocus] = (0,
|
|
51365
|
-
const [customText, setCustomText] = (0,
|
|
51698
|
+
const recommendedIds = (0, import_react37.useMemo)(() => new Set(modelOptions), [modelOptions]);
|
|
51699
|
+
const [focus, setFocus] = (0, import_react37.useState)(MODEL_CUSTOM_INPUT_FOCUS_INDEX);
|
|
51700
|
+
const [customText, setCustomText] = (0, import_react37.useState)(
|
|
51366
51701
|
() => selectedModelIds.filter((id) => !recommendedIds.has(id)).join(", ")
|
|
51367
51702
|
);
|
|
51368
|
-
const [checked, setChecked] = (0,
|
|
51703
|
+
const [checked, setChecked] = (0, import_react37.useState)(
|
|
51369
51704
|
() => new Set(selectedModelIds.filter((id) => recommendedIds.has(id)))
|
|
51370
51705
|
);
|
|
51371
|
-
const
|
|
51372
|
-
|
|
51706
|
+
const checkedRef = (0, import_react37.useRef)(checked);
|
|
51707
|
+
const syncModelIds = (0, import_react37.useCallback)(
|
|
51708
|
+
(custom2, keys) => {
|
|
51373
51709
|
flow.changeModelIds(
|
|
51374
|
-
uniqueIds([...normalizeModelIds(
|
|
51710
|
+
uniqueIds([...normalizeModelIds(custom2), ...keys]).join(", ")
|
|
51375
51711
|
);
|
|
51376
51712
|
},
|
|
51377
51713
|
[flow]
|
|
51378
51714
|
);
|
|
51379
|
-
const updateCustom = (0,
|
|
51715
|
+
const updateCustom = (0, import_react37.useCallback)(
|
|
51380
51716
|
(next) => {
|
|
51381
51717
|
setCustomText(next);
|
|
51382
|
-
syncModelIds(next,
|
|
51718
|
+
syncModelIds(next, checkedRef.current);
|
|
51383
51719
|
},
|
|
51384
|
-
[
|
|
51720
|
+
[syncModelIds]
|
|
51385
51721
|
);
|
|
51386
|
-
const
|
|
51722
|
+
const custom = useLineEdit(customText, updateCustom, retrySeq);
|
|
51723
|
+
const toggleRecommended = (0, import_react37.useCallback)(
|
|
51387
51724
|
(id) => {
|
|
51388
|
-
const next = new Set(
|
|
51725
|
+
const next = new Set(checkedRef.current);
|
|
51389
51726
|
if (next.has(id)) next.delete(id);
|
|
51390
51727
|
else next.add(id);
|
|
51728
|
+
checkedRef.current = next;
|
|
51391
51729
|
setChecked(next);
|
|
51392
|
-
syncModelIds(
|
|
51730
|
+
syncModelIds(custom.text, next);
|
|
51393
51731
|
},
|
|
51394
|
-
[
|
|
51732
|
+
[custom, syncModelIds]
|
|
51395
51733
|
);
|
|
51396
|
-
const submit = (0,
|
|
51397
|
-
flow.submitModelIds({
|
|
51398
|
-
modelIds: uniqueIds([
|
|
51399
|
-
|
|
51400
|
-
|
|
51734
|
+
const submit = (0, import_react37.useCallback)(() => {
|
|
51735
|
+
if (flow.submitModelIds({
|
|
51736
|
+
modelIds: uniqueIds([
|
|
51737
|
+
...normalizeModelIds(custom.text),
|
|
51738
|
+
...checkedRef.current
|
|
51739
|
+
])
|
|
51740
|
+
})) {
|
|
51741
|
+
custom.settle();
|
|
51742
|
+
}
|
|
51743
|
+
}, [custom, flow]);
|
|
51401
51744
|
useKeyboard((key) => {
|
|
51745
|
+
if (custom.settled) return;
|
|
51402
51746
|
const o = toOriginalKey(key);
|
|
51403
51747
|
if (focus >= 0) {
|
|
51404
51748
|
if (o.name === "tab") {
|
|
@@ -51423,12 +51767,8 @@ function ModelsStep({
|
|
|
51423
51767
|
submit();
|
|
51424
51768
|
return;
|
|
51425
51769
|
}
|
|
51426
|
-
if (
|
|
51427
|
-
|
|
51428
|
-
return;
|
|
51429
|
-
}
|
|
51430
|
-
if (isPrintableKeyInput(key)) {
|
|
51431
|
-
updateCustom(customText + key.sequence);
|
|
51770
|
+
if (!custom.handleKey(o) && isPrintableKeyInput(key)) {
|
|
51771
|
+
custom.insert(key.sequence);
|
|
51432
51772
|
}
|
|
51433
51773
|
});
|
|
51434
51774
|
usePaste((event) => {
|
|
@@ -51436,13 +51776,21 @@ function ModelsStep({
|
|
|
51436
51776
|
const text = normalizePastedText(decodePasteBytes(event.bytes));
|
|
51437
51777
|
if (!text) return;
|
|
51438
51778
|
event.preventDefault();
|
|
51439
|
-
|
|
51779
|
+
custom.insert(text);
|
|
51440
51780
|
});
|
|
51441
51781
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", marginTop: 1, children: [
|
|
51442
51782
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: t(
|
|
51443
51783
|
"Enter model IDs directly. Use commas to configure multiple models."
|
|
51444
51784
|
) }),
|
|
51445
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51785
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51786
|
+
InputLine,
|
|
51787
|
+
{
|
|
51788
|
+
value: customText,
|
|
51789
|
+
caret: custom.caret,
|
|
51790
|
+
placeholder: "model-id",
|
|
51791
|
+
active: focus < 0
|
|
51792
|
+
}
|
|
51793
|
+
),
|
|
51446
51794
|
flow.state.modelIdsError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.red, children: flow.state.modelIdsError }) }),
|
|
51447
51795
|
hasSelectableModels ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
51448
51796
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: t("Recommended models") }) }),
|
|
@@ -51475,7 +51823,9 @@ function AdvancedConfigStep({ flow }) {
|
|
|
51475
51823
|
} = flow.state;
|
|
51476
51824
|
const ctxIdx = modalityEnabled ? 6 : 2;
|
|
51477
51825
|
const onCtxRow = focusedConfigIndex === ctxIdx;
|
|
51826
|
+
const ctxField = useLineEdit(contextWindowSize, flow.changeContextWindowSize);
|
|
51478
51827
|
useKeyboard((key) => {
|
|
51828
|
+
if (ctxField.settled) return;
|
|
51479
51829
|
const o = toOriginalKey(key);
|
|
51480
51830
|
if (o.name === "up" || o.ctrl && o.name === "p") {
|
|
51481
51831
|
flow.moveAdvancedFocusUp();
|
|
@@ -51486,22 +51836,17 @@ function AdvancedConfigStep({ flow }) {
|
|
|
51486
51836
|
return;
|
|
51487
51837
|
}
|
|
51488
51838
|
if (o.name === "space") {
|
|
51489
|
-
if (onCtxRow)
|
|
51839
|
+
if (onCtxRow) ctxField.insert(" ");
|
|
51490
51840
|
else flow.toggleFocusedAdvancedOption();
|
|
51491
51841
|
return;
|
|
51492
51842
|
}
|
|
51493
51843
|
if (o.name === "return") {
|
|
51494
51844
|
flow.submitAdvancedConfig();
|
|
51845
|
+
ctxField.settle();
|
|
51495
51846
|
return;
|
|
51496
51847
|
}
|
|
51497
|
-
if (onCtxRow) {
|
|
51498
|
-
|
|
51499
|
-
flow.changeContextWindowSize(contextWindowSize.slice(0, -1));
|
|
51500
|
-
return;
|
|
51501
|
-
}
|
|
51502
|
-
if (isPrintableKeyInput(key)) {
|
|
51503
|
-
flow.changeContextWindowSize(contextWindowSize + key.sequence);
|
|
51504
|
-
}
|
|
51848
|
+
if (onCtxRow && !ctxField.handleKey(o) && isPrintableKeyInput(key)) {
|
|
51849
|
+
ctxField.insert(key.sequence);
|
|
51505
51850
|
}
|
|
51506
51851
|
});
|
|
51507
51852
|
usePaste((event) => {
|
|
@@ -51509,7 +51854,7 @@ function AdvancedConfigStep({ flow }) {
|
|
|
51509
51854
|
const text = normalizePastedText(decodePasteBytes(event.bytes));
|
|
51510
51855
|
if (!text) return;
|
|
51511
51856
|
event.preventDefault();
|
|
51512
|
-
|
|
51857
|
+
ctxField.insert(text);
|
|
51513
51858
|
});
|
|
51514
51859
|
const checkmark = /* @__PURE__ */ __name((v3) => v3 ? ICON.RADIO_FILLED : ICON.CIRCLE_EMPTY, "checkmark");
|
|
51515
51860
|
const cursor = /* @__PURE__ */ __name((index) => focusedConfigIndex === index ? "\u203A" : " ", "cursor");
|
|
@@ -51560,8 +51905,15 @@ function AdvancedConfigStep({ flow }) {
|
|
|
51560
51905
|
children: `${cursor(ctxIdx)} ${t("Context window")}: `
|
|
51561
51906
|
}
|
|
51562
51907
|
),
|
|
51563
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51564
|
-
|
|
51908
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51909
|
+
FieldText,
|
|
51910
|
+
{
|
|
51911
|
+
value: contextWindowSize,
|
|
51912
|
+
caret: ctxField.caret,
|
|
51913
|
+
placeholder: "auto",
|
|
51914
|
+
active: onCtxRow
|
|
51915
|
+
}
|
|
51916
|
+
)
|
|
51565
51917
|
] }),
|
|
51566
51918
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { paddingLeft: 4, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: t("Max input tokens (leave empty to auto-detect from model name).") }) }),
|
|
51567
51919
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: t(
|
|
@@ -51577,17 +51929,22 @@ function ReviewStep({ flow }) {
|
|
|
51577
51929
|
});
|
|
51578
51930
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", marginTop: 1, children: [
|
|
51579
51931
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: t("The following JSON will be saved to settings.json:") }),
|
|
51580
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: flow.state.previewJson }) }),
|
|
51932
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginTop: 1, children: flow.state.previewError ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.red, children: flow.state.previewError }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: flow.state.previewJson }) }),
|
|
51581
51933
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: t("Enter to save, Esc to go back") }) })
|
|
51582
51934
|
] });
|
|
51583
51935
|
}
|
|
51584
51936
|
__name(ReviewStep, "ReviewStep");
|
|
51585
|
-
function SetupSteps({
|
|
51937
|
+
function SetupSteps({
|
|
51938
|
+
flow,
|
|
51939
|
+
retrySeq
|
|
51940
|
+
}) {
|
|
51586
51941
|
const { provider, step } = flow.state;
|
|
51587
51942
|
if (!provider || !step) return null;
|
|
51588
51943
|
switch (step) {
|
|
51589
51944
|
case "protocol":
|
|
51590
51945
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProtocolStep, { flow });
|
|
51946
|
+
case "wireApi":
|
|
51947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ApiStep, { flow });
|
|
51591
51948
|
case "baseUrl":
|
|
51592
51949
|
return Array.isArray(provider.baseUrl) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseUrlSelectStep, { provider, flow }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51593
51950
|
BaseUrlInputStep,
|
|
@@ -51596,13 +51953,14 @@ function SetupSteps({ flow }) {
|
|
|
51596
51953
|
documentationUrl: resolveDocumentationUrl(
|
|
51597
51954
|
provider,
|
|
51598
51955
|
flow.state.baseUrl
|
|
51599
|
-
)
|
|
51956
|
+
),
|
|
51957
|
+
retrySeq
|
|
51600
51958
|
}
|
|
51601
51959
|
);
|
|
51602
51960
|
case "apiKey":
|
|
51603
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ApiKeyStep, { provider, flow });
|
|
51961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ApiKeyStep, { provider, flow, retrySeq });
|
|
51604
51962
|
case "models":
|
|
51605
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModelsStep, { provider, flow });
|
|
51963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModelsStep, { provider, flow, retrySeq });
|
|
51606
51964
|
case "advancedConfig":
|
|
51607
51965
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AdvancedConfigStep, { flow });
|
|
51608
51966
|
case "review":
|
|
@@ -51626,26 +51984,42 @@ function AuthDialogFlow({
|
|
|
51626
51984
|
notify,
|
|
51627
51985
|
initialError
|
|
51628
51986
|
}) {
|
|
51629
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
51987
|
+
const [errorMessage, setErrorMessage] = (0, import_react37.useState)(
|
|
51630
51988
|
initialError ?? null
|
|
51631
51989
|
);
|
|
51632
|
-
const [
|
|
51633
|
-
const
|
|
51634
|
-
const [
|
|
51635
|
-
const [
|
|
51636
|
-
const
|
|
51990
|
+
const [retrySeq, setRetrySeq] = (0, import_react37.useState)(0);
|
|
51991
|
+
const stepRef = (0, import_react37.useRef)(null);
|
|
51992
|
+
const [viewLevel, setViewLevel] = (0, import_react37.useState)("main");
|
|
51993
|
+
const [_viewStack, setViewStack] = (0, import_react37.useState)([]);
|
|
51994
|
+
const [mainIndex, setMainIndex] = (0, import_react37.useState)(null);
|
|
51995
|
+
const [subMenuIndex, setSubMenuIndex] = (0, import_react37.useState)({});
|
|
51996
|
+
const handleProviderSubmit = (0, import_react37.useCallback)(
|
|
51637
51997
|
async (providerConfig, inputs) => {
|
|
51638
|
-
|
|
51998
|
+
let protocol = inputs.protocol ?? providerConfig.protocol;
|
|
51999
|
+
const stepAtSubmit = stepRef.current;
|
|
52000
|
+
const reArmField = /* @__PURE__ */ __name(() => {
|
|
52001
|
+
if (stepRef.current === stepAtSubmit) setRetrySeq((n) => n + 1);
|
|
52002
|
+
}, "reArmField");
|
|
51639
52003
|
try {
|
|
51640
52004
|
const plan = buildInstallPlan(
|
|
51641
52005
|
providerConfig,
|
|
51642
52006
|
inputs,
|
|
51643
|
-
|
|
52007
|
+
getModelsForProviderProtocol(
|
|
52008
|
+
settings.merged.modelProviders,
|
|
52009
|
+
inputs.protocol ?? providerConfig.protocol,
|
|
52010
|
+
settings.merged.providerProtocol
|
|
52011
|
+
),
|
|
52012
|
+
{
|
|
52013
|
+
authType: settings.merged.security?.auth?.selectedType,
|
|
52014
|
+
id: settings.merged.model?.name,
|
|
52015
|
+
baseUrl: settings.merged.model?.baseUrl
|
|
52016
|
+
}
|
|
51644
52017
|
);
|
|
52018
|
+
protocol = plan.authType;
|
|
51645
52019
|
await applyProviderInstallPlan(plan, {
|
|
51646
52020
|
settings: createLoadedSettingsAdapter(settings),
|
|
51647
52021
|
reloadModelProviders: /* @__PURE__ */ __name((mp) => config.reloadModelProvidersConfig(mp), "reloadModelProviders"),
|
|
51648
|
-
syncAuthState: /* @__PURE__ */ __name((authType, modelId, baseUrl) => config.
|
|
52022
|
+
syncAuthState: /* @__PURE__ */ __name((authType, modelId, baseUrl) => config.syncModelSelection(authType, modelId, baseUrl), "syncAuthState"),
|
|
51649
52023
|
refreshAuth: /* @__PURE__ */ __name((authType) => config.refreshAuth(authType), "refreshAuth")
|
|
51650
52024
|
});
|
|
51651
52025
|
if (!plan.modelSelection && !config.getAuthType()) {
|
|
@@ -51654,6 +52028,7 @@ function AuthDialogFlow({
|
|
|
51654
52028
|
"Service models saved. Configure a conversation model to start chatting."
|
|
51655
52029
|
)
|
|
51656
52030
|
);
|
|
52031
|
+
reArmField();
|
|
51657
52032
|
return;
|
|
51658
52033
|
}
|
|
51659
52034
|
notify?.(
|
|
@@ -51672,21 +52047,33 @@ function AuthDialogFlow({
|
|
|
51672
52047
|
message: getErrorMessage(error)
|
|
51673
52048
|
});
|
|
51674
52049
|
setErrorMessage(msg);
|
|
52050
|
+
reArmField();
|
|
51675
52051
|
logAuth(config, new AuthEvent(protocol, "manual", "error", msg));
|
|
51676
52052
|
}
|
|
51677
52053
|
},
|
|
51678
52054
|
[settings, config, notify, onClose]
|
|
51679
52055
|
);
|
|
51680
|
-
const setupFlow = useProviderSetupFlow(
|
|
51681
|
-
|
|
51682
|
-
|
|
52056
|
+
const setupFlow = useProviderSetupFlow(
|
|
52057
|
+
handleProviderSubmit,
|
|
52058
|
+
settings.merged.modelProviders,
|
|
52059
|
+
settings.merged.providerProtocol,
|
|
52060
|
+
{
|
|
52061
|
+
authType: settings.merged.security?.auth?.selectedType,
|
|
52062
|
+
id: settings.merged.model?.name,
|
|
52063
|
+
baseUrl: settings.merged.model?.baseUrl
|
|
52064
|
+
},
|
|
52065
|
+
getRawModelProviders(settings)
|
|
52066
|
+
);
|
|
52067
|
+
stepRef.current = setupFlow.state.step;
|
|
52068
|
+
const clearErrors = (0, import_react37.useCallback)(() => setErrorMessage(null), []);
|
|
52069
|
+
const pushView = (0, import_react37.useCallback)(
|
|
51683
52070
|
(view) => {
|
|
51684
52071
|
setViewStack((prev) => [...prev, viewLevel]);
|
|
51685
52072
|
setViewLevel(view);
|
|
51686
52073
|
},
|
|
51687
52074
|
[viewLevel]
|
|
51688
52075
|
);
|
|
51689
|
-
const goBack = (0,
|
|
52076
|
+
const goBack = (0, import_react37.useCallback)(() => {
|
|
51690
52077
|
clearErrors();
|
|
51691
52078
|
if (viewLevel === "provider-setup") {
|
|
51692
52079
|
if (setupFlow.goBack()) return;
|
|
@@ -51698,29 +52085,36 @@ function AuthDialogFlow({
|
|
|
51698
52085
|
return next;
|
|
51699
52086
|
});
|
|
51700
52087
|
}, [viewLevel, setupFlow, clearErrors]);
|
|
51701
|
-
const alibabaItems = (0,
|
|
51702
|
-
const thirdPartyItems = (0,
|
|
52088
|
+
const alibabaItems = (0, import_react37.useMemo)(() => ALIBABA_PROVIDERS.map(providerToItem), []);
|
|
52089
|
+
const thirdPartyItems = (0, import_react37.useMemo)(
|
|
51703
52090
|
() => THIRD_PARTY_PROVIDERS.map(providerToItem),
|
|
51704
52091
|
[]
|
|
51705
52092
|
);
|
|
51706
52093
|
const existingEnv = settings.merged.env ?? {};
|
|
52094
|
+
const findSavedModels = /* @__PURE__ */ __name((providerConfig) => findExistingProviderModels(
|
|
52095
|
+
providerConfig,
|
|
52096
|
+
settings.merged.modelProviders,
|
|
52097
|
+
settings.merged.providerProtocol,
|
|
52098
|
+
{
|
|
52099
|
+
authType: settings.merged.security?.auth?.selectedType,
|
|
52100
|
+
id: settings.merged.model?.name,
|
|
52101
|
+
baseUrl: settings.merged.model?.baseUrl
|
|
52102
|
+
}
|
|
52103
|
+
), "findSavedModels");
|
|
51707
52104
|
const getExistingModelIds = /* @__PURE__ */ __name((providerConfig) => {
|
|
51708
|
-
const saved =
|
|
51709
|
-
providerConfig,
|
|
51710
|
-
settings.merged.modelProviders
|
|
51711
|
-
);
|
|
52105
|
+
const saved = findSavedModels(providerConfig);
|
|
51712
52106
|
if (!saved) return [];
|
|
51713
52107
|
const builtinIds = new Set(getDefaultModelIds(providerConfig));
|
|
51714
52108
|
return saved.models.map((m3) => m3.id).filter((id) => !builtinIds.has(id));
|
|
51715
52109
|
}, "getExistingModelIds");
|
|
51716
|
-
const handleProviderSelect = (0,
|
|
52110
|
+
const handleProviderSelect = (0, import_react37.useCallback)(
|
|
51717
52111
|
(providerId) => {
|
|
51718
52112
|
clearErrors();
|
|
51719
52113
|
const providerConfig = findProviderById(providerId);
|
|
51720
52114
|
if (!providerConfig) return;
|
|
51721
52115
|
setupFlow.start(
|
|
51722
52116
|
providerConfig,
|
|
51723
|
-
|
|
52117
|
+
findSavedModels(providerConfig)?.protocol,
|
|
51724
52118
|
existingEnv,
|
|
51725
52119
|
getExistingModelIds(providerConfig)
|
|
51726
52120
|
);
|
|
@@ -51739,12 +52133,12 @@ function AuthDialogFlow({
|
|
|
51739
52133
|
contentGenConfig?.baseUrl,
|
|
51740
52134
|
contentGenConfig?.apiKeyEnvKey
|
|
51741
52135
|
);
|
|
51742
|
-
const defaultMainIndex = (0,
|
|
52136
|
+
const defaultMainIndex = (0, import_react37.useMemo)(() => {
|
|
51743
52137
|
if (matchedProvider?.uiGroup === "third-party") return 1;
|
|
51744
52138
|
if (matchedProvider?.uiGroup === "custom") return 2;
|
|
51745
52139
|
return 0;
|
|
51746
52140
|
}, [matchedProvider]);
|
|
51747
|
-
const handleMainSelect = (0,
|
|
52141
|
+
const handleMainSelect = (0, import_react37.useCallback)(
|
|
51748
52142
|
(value) => {
|
|
51749
52143
|
clearErrors();
|
|
51750
52144
|
switch (value) {
|
|
@@ -51757,7 +52151,7 @@ function AuthDialogFlow({
|
|
|
51757
52151
|
case "CUSTOM_PROVIDER":
|
|
51758
52152
|
setupFlow.start(
|
|
51759
52153
|
customProvider,
|
|
51760
|
-
|
|
52154
|
+
findSavedModels(customProvider)?.protocol,
|
|
51761
52155
|
existingEnv,
|
|
51762
52156
|
getExistingModelIds(customProvider)
|
|
51763
52157
|
);
|
|
@@ -51804,7 +52198,7 @@ function AuthDialogFlow({
|
|
|
51804
52198
|
}
|
|
51805
52199
|
});
|
|
51806
52200
|
const renderer = useRenderer();
|
|
51807
|
-
(0,
|
|
52201
|
+
(0, import_react37.useLayoutEffect)(() => {
|
|
51808
52202
|
const onRaw = /* @__PURE__ */ __name((seq) => {
|
|
51809
52203
|
if (seq !== "\x1B") return false;
|
|
51810
52204
|
if (viewLevel !== "main") {
|
|
@@ -51838,7 +52232,7 @@ function AuthDialogFlow({
|
|
|
51838
52232
|
config,
|
|
51839
52233
|
onClose
|
|
51840
52234
|
]);
|
|
51841
|
-
const viewTitle = (0,
|
|
52235
|
+
const viewTitle = (0, import_react37.useMemo)(() => {
|
|
51842
52236
|
if (viewLevel !== "provider-setup") {
|
|
51843
52237
|
return VIEW_TITLES[viewLevel] ?? VIEW_TITLES["main"];
|
|
51844
52238
|
}
|
|
@@ -51870,7 +52264,7 @@ function AuthDialogFlow({
|
|
|
51870
52264
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioList, { items: activeSubMenu, cursor: subCursor }),
|
|
51871
52265
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: NAV_HINT_SELECT }) })
|
|
51872
52266
|
] }),
|
|
51873
|
-
viewLevel === "provider-setup" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SetupSteps, { flow: setupFlow }),
|
|
52267
|
+
viewLevel === "provider-setup" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SetupSteps, { flow: setupFlow, retrySeq }),
|
|
51874
52268
|
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.red, children: errorMessage }) })
|
|
51875
52269
|
] });
|
|
51876
52270
|
}
|
|
@@ -51878,7 +52272,7 @@ __name(AuthDialogFlow, "AuthDialogFlow");
|
|
|
51878
52272
|
|
|
51879
52273
|
// packages/cli/src/ui/opentui/dialogs-arena.tsx
|
|
51880
52274
|
init_esbuild_shims();
|
|
51881
|
-
var
|
|
52275
|
+
var import_react39 = __toESM(require_react(), 1);
|
|
51882
52276
|
var MODEL_PROVIDERS_DOCUMENTATION_URL = "https://qwenlm.github.io/qwen-code-docs/en/users/configuration/settings/#modelproviders";
|
|
51883
52277
|
var STATUS_REFRESH_INTERVAL_MS = 2e3;
|
|
51884
52278
|
var IN_PROCESS_REFRESH_INTERVAL_MS = 1e3;
|
|
@@ -51944,7 +52338,7 @@ function ArenaFrame({
|
|
|
51944
52338
|
}
|
|
51945
52339
|
__name(ArenaFrame, "ArenaFrame");
|
|
51946
52340
|
function ArenaStart({ config, onClose, onFillInput }) {
|
|
51947
|
-
const modelItems = (0,
|
|
52341
|
+
const modelItems = (0, import_react39.useMemo)(() => {
|
|
51948
52342
|
const all = config?.getAllConfiguredModels?.() ?? [];
|
|
51949
52343
|
return all.filter((m3) => !m3.isRuntimeModel && !m3.imageOnly).map((m3) => {
|
|
51950
52344
|
const token = `${m3.authType}:${m3.id}`;
|
|
@@ -51955,9 +52349,9 @@ function ArenaStart({ config, onClose, onFillInput }) {
|
|
|
51955
52349
|
};
|
|
51956
52350
|
});
|
|
51957
52351
|
}, [config]);
|
|
51958
|
-
const [cursor, setCursor] = (0,
|
|
51959
|
-
const [checked, setChecked] = (0,
|
|
51960
|
-
const [error, setError] = (0,
|
|
52352
|
+
const [cursor, setCursor] = (0, import_react39.useState)(0);
|
|
52353
|
+
const [checked, setChecked] = (0, import_react39.useState)(/* @__PURE__ */ new Set());
|
|
52354
|
+
const [error, setError] = (0, import_react39.useState)(null);
|
|
51961
52355
|
const hasDisabledQwenOauth = modelItems.some((m3) => m3.disabled);
|
|
51962
52356
|
const selectableCount = modelItems.filter((m3) => !m3.disabled).length;
|
|
51963
52357
|
const needsMoreModels = selectableCount < 2;
|
|
@@ -52031,11 +52425,11 @@ __name(agentElapsedMs, "agentElapsedMs");
|
|
|
52031
52425
|
function ArenaStatus({ config, onClose }) {
|
|
52032
52426
|
const manager = config?.getArenaManager?.() ?? null;
|
|
52033
52427
|
const { width } = useTerminalDimensions();
|
|
52034
|
-
const [, setTick] = (0,
|
|
52428
|
+
const [, setTick] = (0, import_react39.useState)(0);
|
|
52035
52429
|
const backend3 = manager?.getBackend();
|
|
52036
52430
|
const isInProcess = backend3?.type === DISPLAY_MODE.IN_PROCESS;
|
|
52037
52431
|
const inProcessBackend = isInProcess ? backend3 : null;
|
|
52038
|
-
(0,
|
|
52432
|
+
(0, import_react39.useEffect)(() => {
|
|
52039
52433
|
const interval = isInProcess ? IN_PROCESS_REFRESH_INTERVAL_MS : STATUS_REFRESH_INTERVAL_MS;
|
|
52040
52434
|
const timer = setInterval(() => setTick((t3) => t3 + 1), interval);
|
|
52041
52435
|
return () => clearInterval(timer);
|
|
@@ -52116,7 +52510,7 @@ function ArenaStatus({ config, onClose }) {
|
|
|
52116
52510
|
}
|
|
52117
52511
|
__name(ArenaStatus, "ArenaStatus");
|
|
52118
52512
|
function ArenaStop({ config, onClose, notify }) {
|
|
52119
|
-
const [processing, setProcessing] = (0,
|
|
52513
|
+
const [processing, setProcessing] = (0, import_react39.useState)(false);
|
|
52120
52514
|
const preserveDefault = config?.getAgentsSettings?.().arena?.preserveArtifacts ?? false;
|
|
52121
52515
|
const items = [
|
|
52122
52516
|
{
|
|
@@ -52130,7 +52524,7 @@ function ArenaStop({ config, onClose, notify }) {
|
|
|
52130
52524
|
desc: "Keep worktrees and session files for later inspection"
|
|
52131
52525
|
}
|
|
52132
52526
|
];
|
|
52133
|
-
const [sel, setSel] = (0,
|
|
52527
|
+
const [sel, setSel] = (0, import_react39.useState)(preserveDefault ? 1 : 0);
|
|
52134
52528
|
const runStop = /* @__PURE__ */ __name(async (action) => {
|
|
52135
52529
|
if (processing) return;
|
|
52136
52530
|
setProcessing(true);
|
|
@@ -52262,17 +52656,17 @@ function AgentDetailedDiff({ result }) {
|
|
|
52262
52656
|
__name(AgentDetailedDiff, "AgentDetailedDiff");
|
|
52263
52657
|
function ArenaSelect({ config, onClose, notify }) {
|
|
52264
52658
|
const manager = config?.getArenaManager?.() ?? null;
|
|
52265
|
-
const agents = (0,
|
|
52659
|
+
const agents = (0, import_react39.useMemo)(() => manager?.getAgentStates() ?? [], [manager]);
|
|
52266
52660
|
const result = manager?.getResult();
|
|
52267
|
-
const [sel, setSel] = (0,
|
|
52661
|
+
const [sel, setSel] = (0, import_react39.useState)(
|
|
52268
52662
|
() => Math.max(
|
|
52269
52663
|
0,
|
|
52270
52664
|
agents.findIndex((a) => isSuccessStatus(a.status))
|
|
52271
52665
|
)
|
|
52272
52666
|
);
|
|
52273
|
-
const [showPreview, setShowPreview] = (0,
|
|
52274
|
-
const [showDetailedDiff, setShowDetailedDiff] = (0,
|
|
52275
|
-
const rows = (0,
|
|
52667
|
+
const [showPreview, setShowPreview] = (0, import_react39.useState)(false);
|
|
52668
|
+
const [showDetailedDiff, setShowDetailedDiff] = (0, import_react39.useState)(false);
|
|
52669
|
+
const rows = (0, import_react39.useMemo)(
|
|
52276
52670
|
() => agents.map((agent) => {
|
|
52277
52671
|
let additions = 0;
|
|
52278
52672
|
let deletions = 0;
|
|
@@ -52441,7 +52835,7 @@ __name(OpenTuiArenaDialog, "OpenTuiArenaDialog");
|
|
|
52441
52835
|
|
|
52442
52836
|
// packages/cli/src/ui/opentui/dialogs-memory-status.tsx
|
|
52443
52837
|
init_esbuild_shims();
|
|
52444
|
-
var
|
|
52838
|
+
var import_react41 = __toESM(require_react(), 1);
|
|
52445
52839
|
import fs4 from "node:fs";
|
|
52446
52840
|
import path5 from "node:path";
|
|
52447
52841
|
function resolvePreferredMemoryFile(dir) {
|
|
@@ -52458,7 +52852,7 @@ function resolvePreferredMemoryFile(dir) {
|
|
|
52458
52852
|
__name(resolvePreferredMemoryFile, "resolvePreferredMemoryFile");
|
|
52459
52853
|
function useEsc2(onClose) {
|
|
52460
52854
|
const renderer = useRenderer();
|
|
52461
|
-
(0,
|
|
52855
|
+
(0, import_react41.useLayoutEffect)(() => {
|
|
52462
52856
|
const onRaw = /* @__PURE__ */ __name((seq) => {
|
|
52463
52857
|
if (seq !== "\x1B") return false;
|
|
52464
52858
|
onClose();
|
|
@@ -52560,10 +52954,10 @@ __name(OpenTuiStatusLineDialog, "OpenTuiStatusLineDialog");
|
|
|
52560
52954
|
|
|
52561
52955
|
// packages/cli/src/ui/opentui/dialogs-modes.tsx
|
|
52562
52956
|
init_esbuild_shims();
|
|
52563
|
-
var
|
|
52957
|
+
var import_react43 = __toESM(require_react(), 1);
|
|
52564
52958
|
function useEsc3(onClose) {
|
|
52565
52959
|
const renderer = useRenderer();
|
|
52566
|
-
(0,
|
|
52960
|
+
(0, import_react43.useLayoutEffect)(() => {
|
|
52567
52961
|
const onRaw = /* @__PURE__ */ __name((seq) => {
|
|
52568
52962
|
if (seq !== "\x1B") return false;
|
|
52569
52963
|
onClose();
|
|
@@ -52635,7 +53029,7 @@ function OpenTuiApprovalModeDialog(props) {
|
|
|
52635
53029
|
const { config, settings, onClose, onApprovalModeChanged } = props;
|
|
52636
53030
|
const modes = APPROVAL_MODES;
|
|
52637
53031
|
const current = config?.getApprovalMode?.();
|
|
52638
|
-
const [sel, setSel] = (0,
|
|
53032
|
+
const [sel, setSel] = (0, import_react43.useState)(
|
|
52639
53033
|
Math.max(0, modes.indexOf(current))
|
|
52640
53034
|
);
|
|
52641
53035
|
useEsc3(onClose);
|
|
@@ -52678,7 +53072,7 @@ function OpenTuiEffortDialog(props) {
|
|
|
52678
53072
|
const tiers = config ? [...getReasoningEffortsForConfig(config)] : REASONING_EFFORT_TIERS;
|
|
52679
53073
|
const currentEffort = config?.getReasoningEffort?.();
|
|
52680
53074
|
const configuredIndex = currentEffort ? tiers.indexOf(currentEffort) : -1;
|
|
52681
|
-
const [sel, setSel] = (0,
|
|
53075
|
+
const [sel, setSel] = (0, import_react43.useState)(Math.max(0, configuredIndex));
|
|
52682
53076
|
useEsc3(onClose);
|
|
52683
53077
|
const pick = /* @__PURE__ */ __name(() => {
|
|
52684
53078
|
const effort = tiers[sel];
|
|
@@ -52723,12 +53117,12 @@ function containsStyle(styles, name) {
|
|
|
52723
53117
|
__name(containsStyle, "containsStyle");
|
|
52724
53118
|
function OpenTuiOutputStyleDialog(props) {
|
|
52725
53119
|
const { config, settings, onClose, notify } = props;
|
|
52726
|
-
const [styles, setStyles] = (0,
|
|
52727
|
-
const onCloseRef = (0,
|
|
53120
|
+
const [styles, setStyles] = (0, import_react43.useState)();
|
|
53121
|
+
const onCloseRef = (0, import_react43.useRef)(onClose);
|
|
52728
53122
|
onCloseRef.current = onClose;
|
|
52729
|
-
const notifyRef = (0,
|
|
53123
|
+
const notifyRef = (0, import_react43.useRef)(notify);
|
|
52730
53124
|
notifyRef.current = notify;
|
|
52731
|
-
(0,
|
|
53125
|
+
(0, import_react43.useEffect)(() => {
|
|
52732
53126
|
let cancelled = false;
|
|
52733
53127
|
void loadSessionOutputStyles(config).then(
|
|
52734
53128
|
(loaded) => {
|
|
@@ -52764,8 +53158,8 @@ function OpenTuiOutputStyleDialog(props) {
|
|
|
52764
53158
|
style
|
|
52765
53159
|
}))
|
|
52766
53160
|
] : [];
|
|
52767
|
-
const [sel, setSel] = (0,
|
|
52768
|
-
(0,
|
|
53161
|
+
const [sel, setSel] = (0, import_react43.useState)(0);
|
|
53162
|
+
(0, import_react43.useEffect)(() => {
|
|
52769
53163
|
if (!styles) return;
|
|
52770
53164
|
const wanted = current?.toLowerCase();
|
|
52771
53165
|
const index = items.findIndex((item) => item.key.toLowerCase() === wanted);
|
|
@@ -52795,7 +53189,7 @@ __name(OpenTuiOutputStyleDialog, "OpenTuiOutputStyleDialog");
|
|
|
52795
53189
|
|
|
52796
53190
|
// packages/cli/src/ui/opentui/dialogs-hooks.tsx
|
|
52797
53191
|
init_esbuild_shims();
|
|
52798
|
-
var
|
|
53192
|
+
var import_react45 = __toESM(require_react(), 1);
|
|
52799
53193
|
var MAX_ROWS = 12;
|
|
52800
53194
|
var DETAIL_LABEL_WIDTH = 18;
|
|
52801
53195
|
function summarizeHookEvents(rows) {
|
|
@@ -52927,35 +53321,35 @@ function OpenTuiHooksDialog({
|
|
|
52927
53321
|
onClose,
|
|
52928
53322
|
notice
|
|
52929
53323
|
}) {
|
|
52930
|
-
const listing = (0,
|
|
53324
|
+
const listing = (0, import_react45.useMemo)(
|
|
52931
53325
|
() => config ? buildHooksListing(config) : emptyListing(settings),
|
|
52932
53326
|
[config, settings]
|
|
52933
53327
|
);
|
|
52934
|
-
const [view, setView] = (0,
|
|
52935
|
-
const events = (0,
|
|
53328
|
+
const [view, setView] = (0, import_react45.useState)({ step: "events" });
|
|
53329
|
+
const events = (0, import_react45.useMemo)(
|
|
52936
53330
|
() => summarizeHookEvents(listing.rows),
|
|
52937
53331
|
[listing.rows]
|
|
52938
53332
|
);
|
|
52939
|
-
const eventItems = (0,
|
|
53333
|
+
const eventItems = (0, import_react45.useMemo)(
|
|
52940
53334
|
() => events.map((summary) => ({ key: summary.event, value: summary.event })),
|
|
52941
53335
|
[events]
|
|
52942
53336
|
);
|
|
52943
53337
|
const matcherEvent = view.step === "matchers" ? view.event : void 0;
|
|
52944
|
-
const matchers = (0,
|
|
53338
|
+
const matchers = (0, import_react45.useMemo)(
|
|
52945
53339
|
() => matcherEvent === void 0 ? [] : summarizeHookMatchers(listing.rows, matcherEvent),
|
|
52946
53340
|
[listing.rows, matcherEvent]
|
|
52947
53341
|
);
|
|
52948
|
-
const matcherItems = (0,
|
|
53342
|
+
const matcherItems = (0, import_react45.useMemo)(
|
|
52949
53343
|
() => matchers.map((group) => ({ key: group.matcher, value: group.matcher })),
|
|
52950
53344
|
[matchers]
|
|
52951
53345
|
);
|
|
52952
53346
|
const handlerEvent = view.step === "handlers" || view.step === "detail" ? view.event : void 0;
|
|
52953
53347
|
const handlerMatcher = view.step === "handlers" || view.step === "detail" ? view.matcher : void 0;
|
|
52954
|
-
const handlerRows = (0,
|
|
53348
|
+
const handlerRows = (0, import_react45.useMemo)(
|
|
52955
53349
|
() => handlerEvent === void 0 ? [] : selectHookRows(listing.rows, handlerEvent, handlerMatcher),
|
|
52956
53350
|
[listing.rows, handlerEvent, handlerMatcher]
|
|
52957
53351
|
);
|
|
52958
|
-
const handlerItems = (0,
|
|
53352
|
+
const handlerItems = (0, import_react45.useMemo)(
|
|
52959
53353
|
() => handlerRows.map((_2, index) => ({ key: String(index), value: index })),
|
|
52960
53354
|
[handlerRows]
|
|
52961
53355
|
);
|
|
@@ -53160,12 +53554,12 @@ function OpenTuiDialogMount(props) {
|
|
|
53160
53554
|
const { request, host, config, settings, commands, onClose, notify } = props;
|
|
53161
53555
|
const isHelp = request.dialog === "help";
|
|
53162
53556
|
const dimensions = useTerminalDimensions();
|
|
53163
|
-
const [permissions, setPermissions] = (0,
|
|
53557
|
+
const [permissions, setPermissions] = (0, import_react47.useState)(
|
|
53164
53558
|
() => request.dialog === "permissions" ? buildPermissionsData(config) : null
|
|
53165
53559
|
);
|
|
53166
53560
|
const reloadPermissions = /* @__PURE__ */ __name(() => setPermissions(buildPermissionsData(config)), "reloadPermissions");
|
|
53167
|
-
const [mcpServers, setMcpServers] = (0,
|
|
53168
|
-
(0,
|
|
53561
|
+
const [mcpServers, setMcpServers] = (0, import_react47.useState)([]);
|
|
53562
|
+
(0, import_react47.useEffect)(() => {
|
|
53169
53563
|
if (request.dialog !== "mcp") return;
|
|
53170
53564
|
let alive = true;
|
|
53171
53565
|
const initial = buildMcpServers(config);
|
|
@@ -53189,14 +53583,14 @@ function OpenTuiDialogMount(props) {
|
|
|
53189
53583
|
}
|
|
53190
53584
|
);
|
|
53191
53585
|
}, "runMcpAction");
|
|
53192
|
-
const [extRows, setExtRows] = (0,
|
|
53586
|
+
const [extRows, setExtRows] = (0, import_react47.useState)(
|
|
53193
53587
|
() => request.dialog === "extensions_manage" ? buildExtensionRows(config) : []
|
|
53194
53588
|
);
|
|
53195
|
-
const [extBusy, setExtBusy] = (0,
|
|
53196
|
-
const [extStatus, setExtStatus] = (0,
|
|
53589
|
+
const [extBusy, setExtBusy] = (0, import_react47.useState)(false);
|
|
53590
|
+
const [extStatus, setExtStatus] = (0, import_react47.useState)(
|
|
53197
53591
|
null
|
|
53198
53592
|
);
|
|
53199
|
-
const [extDiscoverFilter, setExtDiscoverFilter] = (0,
|
|
53593
|
+
const [extDiscoverFilter, setExtDiscoverFilter] = (0, import_react47.useState)(
|
|
53200
53594
|
null
|
|
53201
53595
|
);
|
|
53202
53596
|
const reloadExtensions = /* @__PURE__ */ __name(() => setExtRows(buildExtensionRows(config)), "reloadExtensions");
|
|
@@ -53249,16 +53643,16 @@ function OpenTuiDialogMount(props) {
|
|
|
53249
53643
|
}
|
|
53250
53644
|
}
|
|
53251
53645
|
}, "runExtensionAction");
|
|
53252
|
-
const [modelError, setModelError] = (0,
|
|
53253
|
-
const modelSelectionCommittedRef = (0,
|
|
53254
|
-
const modelCloseLatchRef = (0,
|
|
53255
|
-
const modelSelectionInFlightRef = (0,
|
|
53256
|
-
const [helpTab, setHelpTab] = (0,
|
|
53257
|
-
const [helpScroll, setHelpScroll] = (0,
|
|
53646
|
+
const [modelError, setModelError] = (0, import_react47.useState)(null);
|
|
53647
|
+
const modelSelectionCommittedRef = (0, import_react47.useRef)(false);
|
|
53648
|
+
const modelCloseLatchRef = (0, import_react47.useRef)(false);
|
|
53649
|
+
const modelSelectionInFlightRef = (0, import_react47.useRef)(false);
|
|
53650
|
+
const [helpTab, setHelpTab] = (0, import_react47.useState)("general");
|
|
53651
|
+
const [helpScroll, setHelpScroll] = (0, import_react47.useState)(0);
|
|
53258
53652
|
const dialogWidth = dialogAreaWidth(dimensions.width);
|
|
53259
53653
|
const helpBodyRows = computeHelpBodyRows(dimensions.height);
|
|
53260
53654
|
const helpWindowRows = helpCommandWindowRows(helpBodyRows);
|
|
53261
|
-
const helpMaxScroll = (0,
|
|
53655
|
+
const helpMaxScroll = (0, import_react47.useMemo)(() => {
|
|
53262
53656
|
if (helpTab === "general") return 0;
|
|
53263
53657
|
const lines = helpTab === "custom-commands" ? buildHelpCustomCommandLines(commands, dialogWidth) : buildHelpCommandsLines(commands, dialogWidth);
|
|
53264
53658
|
return helpScrollMax(lines, helpWindowRows);
|
|
@@ -53555,7 +53949,15 @@ function OpenTuiDialogMount(props) {
|
|
|
53555
53949
|
entries,
|
|
53556
53950
|
mode: request.mode
|
|
53557
53951
|
});
|
|
53558
|
-
const reportModel = /* @__PURE__ */ __name((text) =>
|
|
53952
|
+
const reportModel = /* @__PURE__ */ __name((text) => {
|
|
53953
|
+
const item = { type: "info" /* INFO */, text };
|
|
53954
|
+
host.addItem(item, Date.now());
|
|
53955
|
+
config.getChatRecordingService?.()?.recordSlashCommand({
|
|
53956
|
+
phase: "result",
|
|
53957
|
+
rawCommand: "/model",
|
|
53958
|
+
outputHistoryItems: [{ ...item }]
|
|
53959
|
+
});
|
|
53960
|
+
}, "reportModel");
|
|
53559
53961
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
53560
53962
|
OpenTuiModelDialog,
|
|
53561
53963
|
{
|
|
@@ -53620,7 +54022,7 @@ __name(OpenTuiDialogMount, "OpenTuiDialogMount");
|
|
|
53620
54022
|
|
|
53621
54023
|
// packages/cli/src/ui/opentui/input-prompt.tsx
|
|
53622
54024
|
init_esbuild_shims();
|
|
53623
|
-
var
|
|
54025
|
+
var import_react49 = __toESM(require_react(), 1);
|
|
53624
54026
|
import path6 from "node:path";
|
|
53625
54027
|
|
|
53626
54028
|
// packages/cli/src/ui/opentui/input-history.ts
|
|
@@ -53769,8 +54171,8 @@ function OpenTuiInputPrompt(props) {
|
|
|
53769
54171
|
} = props;
|
|
53770
54172
|
const { width } = useTerminalDimensions();
|
|
53771
54173
|
const renderer = useRenderer();
|
|
53772
|
-
const editorRef = (0,
|
|
53773
|
-
(0,
|
|
54174
|
+
const editorRef = (0, import_react49.useRef)(null);
|
|
54175
|
+
(0, import_react49.useEffect)(() => {
|
|
53774
54176
|
if (!props.composerHandle) return;
|
|
53775
54177
|
props.composerHandle.current = {
|
|
53776
54178
|
getText: /* @__PURE__ */ __name(() => editorRef.current?.plainText ?? "", "getText"),
|
|
@@ -53782,36 +54184,36 @@ function OpenTuiInputPrompt(props) {
|
|
|
53782
54184
|
if (props.composerHandle) props.composerHandle.current = null;
|
|
53783
54185
|
};
|
|
53784
54186
|
}, [props.composerHandle]);
|
|
53785
|
-
const userMessagesRef = (0,
|
|
54187
|
+
const userMessagesRef = (0, import_react49.useRef)(userMessages);
|
|
53786
54188
|
userMessagesRef.current = userMessages;
|
|
53787
|
-
const recentSlashCommandsRef = (0,
|
|
54189
|
+
const recentSlashCommandsRef = (0, import_react49.useRef)(recentSlashCommands);
|
|
53788
54190
|
recentSlashCommandsRef.current = recentSlashCommands;
|
|
53789
|
-
const historyRef = (0,
|
|
54191
|
+
const historyRef = (0, import_react49.useRef)(null);
|
|
53790
54192
|
if (!historyRef.current) {
|
|
53791
54193
|
historyRef.current = new InputHistory(() => userMessagesRef.current);
|
|
53792
54194
|
}
|
|
53793
|
-
const escapeRef = (0,
|
|
54195
|
+
const escapeRef = (0, import_react49.useRef)(null);
|
|
53794
54196
|
if (!escapeRef.current) {
|
|
53795
54197
|
escapeRef.current = new EscapeClearModel();
|
|
53796
54198
|
}
|
|
53797
|
-
const [textVersion, setTextVersion] = (0,
|
|
53798
|
-
const [suggestions, setSuggestions] = (0,
|
|
53799
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
53800
|
-
const [loadingSuggestions, setLoadingSuggestions] = (0,
|
|
53801
|
-
const [escapeArmed, setEscapeArmed] = (0,
|
|
53802
|
-
const [attachments, setAttachments] = (0,
|
|
53803
|
-
const completionModeRef = (0,
|
|
53804
|
-
const historyRestoredTextRef = (0,
|
|
53805
|
-
const dismissedUntilChangeRef = (0,
|
|
53806
|
-
const fileSearchRef = (0,
|
|
53807
|
-
const fileSearchReadyRef = (0,
|
|
53808
|
-
const atSearchSeqRef = (0,
|
|
53809
|
-
const commandsRef = (0,
|
|
53810
|
-
const slashRangeRef = (0,
|
|
53811
|
-
const slashSearchSeqRef = (0,
|
|
53812
|
-
const suggestionNavigatedRef = (0,
|
|
53813
|
-
const pendingPastesRef = (0,
|
|
53814
|
-
const activePlaceholderIdsRef = (0,
|
|
54199
|
+
const [textVersion, setTextVersion] = (0, import_react49.useState)(0);
|
|
54200
|
+
const [suggestions, setSuggestions] = (0, import_react49.useState)([]);
|
|
54201
|
+
const [activeIndex, setActiveIndex] = (0, import_react49.useState)(0);
|
|
54202
|
+
const [loadingSuggestions, setLoadingSuggestions] = (0, import_react49.useState)(false);
|
|
54203
|
+
const [escapeArmed, setEscapeArmed] = (0, import_react49.useState)(false);
|
|
54204
|
+
const [attachments, setAttachments] = (0, import_react49.useState)([]);
|
|
54205
|
+
const completionModeRef = (0, import_react49.useRef)("IDLE" /* IDLE */);
|
|
54206
|
+
const historyRestoredTextRef = (0, import_react49.useRef)(null);
|
|
54207
|
+
const dismissedUntilChangeRef = (0, import_react49.useRef)(null);
|
|
54208
|
+
const fileSearchRef = (0, import_react49.useRef)(null);
|
|
54209
|
+
const fileSearchReadyRef = (0, import_react49.useRef)(null);
|
|
54210
|
+
const atSearchSeqRef = (0, import_react49.useRef)(0);
|
|
54211
|
+
const commandsRef = (0, import_react49.useRef)([]);
|
|
54212
|
+
const slashRangeRef = (0, import_react49.useRef)(null);
|
|
54213
|
+
const slashSearchSeqRef = (0, import_react49.useRef)(0);
|
|
54214
|
+
const suggestionNavigatedRef = (0, import_react49.useRef)(false);
|
|
54215
|
+
const pendingPastesRef = (0, import_react49.useRef)(/* @__PURE__ */ new Map());
|
|
54216
|
+
const activePlaceholderIdsRef = (0, import_react49.useRef)(/* @__PURE__ */ new Map());
|
|
53815
54217
|
const {
|
|
53816
54218
|
state: followupState,
|
|
53817
54219
|
accept: acceptFollowup,
|
|
@@ -53828,13 +54230,13 @@ function OpenTuiInputPrompt(props) {
|
|
|
53828
54230
|
setTextVersion((v3) => v3 + 1);
|
|
53829
54231
|
}, "onAccept")
|
|
53830
54232
|
});
|
|
53831
|
-
(0,
|
|
54233
|
+
(0, import_react49.useEffect)(() => {
|
|
53832
54234
|
setFollowupSuggestion(promptSuggestion ?? null);
|
|
53833
54235
|
}, [setFollowupSuggestion, promptSuggestion]);
|
|
53834
54236
|
const availableSuggestion = followupState.isVisible || promptSuggestion ? followupState.suggestion ?? promptSuggestion ?? null : null;
|
|
53835
54237
|
const chrome = shellModeActive ? { prefix: "!", color: C2.accent } : promptChrome(approvalMode);
|
|
53836
54238
|
const borderColor = chrome.color ?? C2.accent;
|
|
53837
|
-
(0,
|
|
54239
|
+
(0, import_react49.useEffect)(() => {
|
|
53838
54240
|
let cancelled = false;
|
|
53839
54241
|
loadInteractiveCommands(config ?? null).then((commands) => {
|
|
53840
54242
|
if (!cancelled) commandsRef.current = commands;
|
|
@@ -53845,7 +54247,7 @@ function OpenTuiInputPrompt(props) {
|
|
|
53845
54247
|
};
|
|
53846
54248
|
}, [config]);
|
|
53847
54249
|
const projectRoot = config?.getTargetDir() ?? process.cwd();
|
|
53848
|
-
const ensureFileSearch = (0,
|
|
54250
|
+
const ensureFileSearch = (0, import_react49.useCallback)(() => {
|
|
53849
54251
|
if (fileSearchReadyRef.current) return fileSearchReadyRef.current;
|
|
53850
54252
|
const searcher = FileSearchFactory.create({
|
|
53851
54253
|
projectRoot,
|
|
@@ -53865,7 +54267,7 @@ function OpenTuiInputPrompt(props) {
|
|
|
53865
54267
|
});
|
|
53866
54268
|
return fileSearchReadyRef.current;
|
|
53867
54269
|
}, [config, projectRoot]);
|
|
53868
|
-
(0,
|
|
54270
|
+
(0, import_react49.useEffect)(
|
|
53869
54271
|
() => () => {
|
|
53870
54272
|
void fileSearchRef.current?.dispose?.();
|
|
53871
54273
|
fileSearchRef.current = null;
|
|
@@ -53873,7 +54275,7 @@ function OpenTuiInputPrompt(props) {
|
|
|
53873
54275
|
},
|
|
53874
54276
|
[]
|
|
53875
54277
|
);
|
|
53876
|
-
const currentCompletionTarget = (0,
|
|
54278
|
+
const currentCompletionTarget = (0, import_react49.useCallback)(() => {
|
|
53877
54279
|
const el = editorRef.current;
|
|
53878
54280
|
if (!el) return null;
|
|
53879
54281
|
const text = el.plainText;
|
|
@@ -53888,7 +54290,7 @@ function OpenTuiInputPrompt(props) {
|
|
|
53888
54290
|
commandsRef.current
|
|
53889
54291
|
);
|
|
53890
54292
|
}, []);
|
|
53891
|
-
const refreshCompletion = (0,
|
|
54293
|
+
const refreshCompletion = (0, import_react49.useCallback)(() => {
|
|
53892
54294
|
const el = editorRef.current;
|
|
53893
54295
|
if (!el) return;
|
|
53894
54296
|
const text = el.plainText;
|
|
@@ -53963,7 +54365,7 @@ function OpenTuiInputPrompt(props) {
|
|
|
53963
54365
|
}
|
|
53964
54366
|
});
|
|
53965
54367
|
}, [ensureFileSearch, config, currentCompletionTarget]);
|
|
53966
|
-
(0,
|
|
54368
|
+
(0, import_react49.useEffect)(() => {
|
|
53967
54369
|
const el = editorRef.current;
|
|
53968
54370
|
if (!el || textVersion === 0) return;
|
|
53969
54371
|
if (historyRestoredTextRef.current !== null && el.plainText !== historyRestoredTextRef.current) {
|
|
@@ -53971,10 +54373,10 @@ function OpenTuiInputPrompt(props) {
|
|
|
53971
54373
|
}
|
|
53972
54374
|
refreshCompletion();
|
|
53973
54375
|
}, [textVersion, refreshCompletion]);
|
|
53974
|
-
(0,
|
|
54376
|
+
(0, import_react49.useEffect)(() => {
|
|
53975
54377
|
refreshCompletion();
|
|
53976
54378
|
}, [recentSlashCommands, refreshCompletion]);
|
|
53977
|
-
const applyTextToEditor = (0,
|
|
54379
|
+
const applyTextToEditor = (0, import_react49.useCallback)((line, cursorCol) => {
|
|
53978
54380
|
const el = editorRef.current;
|
|
53979
54381
|
if (!el) return;
|
|
53980
54382
|
const cursor = el.logicalCursor;
|
|
@@ -53988,7 +54390,7 @@ function OpenTuiInputPrompt(props) {
|
|
|
53988
54390
|
}
|
|
53989
54391
|
setTextVersion((v3) => v3 + 1);
|
|
53990
54392
|
}, []);
|
|
53991
|
-
const acceptSuggestion = (0,
|
|
54393
|
+
const acceptSuggestion = (0, import_react49.useCallback)(
|
|
53992
54394
|
(index, viaEnter) => {
|
|
53993
54395
|
const el = editorRef.current;
|
|
53994
54396
|
const suggestion = suggestions[index];
|
|
@@ -54045,7 +54447,7 @@ function OpenTuiInputPrompt(props) {
|
|
|
54045
54447
|
onPromptSuggestionDismiss
|
|
54046
54448
|
]
|
|
54047
54449
|
);
|
|
54048
|
-
const handleClipboardImage = (0,
|
|
54450
|
+
const handleClipboardImage = (0, import_react49.useCallback)(async () => {
|
|
54049
54451
|
try {
|
|
54050
54452
|
if (!await clipboardHasImage()) return;
|
|
54051
54453
|
const imagePath = await saveClipboardImage(Storage.getGlobalTempDir());
|
|
@@ -54063,7 +54465,7 @@ function OpenTuiInputPrompt(props) {
|
|
|
54063
54465
|
} catch {
|
|
54064
54466
|
}
|
|
54065
54467
|
}, []);
|
|
54066
|
-
(0,
|
|
54468
|
+
(0, import_react49.useLayoutEffect)(() => {
|
|
54067
54469
|
const onRawInput = /* @__PURE__ */ __name((sequence) => {
|
|
54068
54470
|
if (!focus) return false;
|
|
54069
54471
|
if (isDeleteWordBackwardSequence(sequence)) {
|
|
@@ -54114,7 +54516,7 @@ function OpenTuiInputPrompt(props) {
|
|
|
54114
54516
|
renderer.addInputHandler(onRawInput);
|
|
54115
54517
|
return () => renderer.removeInputHandler(onRawInput);
|
|
54116
54518
|
}, [renderer, focus]);
|
|
54117
|
-
(0,
|
|
54519
|
+
(0, import_react49.useLayoutEffect)(() => {
|
|
54118
54520
|
const onPaste = /* @__PURE__ */ __name((event) => {
|
|
54119
54521
|
if (!focus) return;
|
|
54120
54522
|
const el = editorRef.current;
|
|
@@ -54394,11 +54796,11 @@ ${current}` : popped);
|
|
|
54394
54796
|
return;
|
|
54395
54797
|
}
|
|
54396
54798
|
});
|
|
54397
|
-
(0,
|
|
54799
|
+
(0, import_react49.useEffect)(() => {
|
|
54398
54800
|
const el = editorRef.current;
|
|
54399
54801
|
if (el) el.textColor = C2.text;
|
|
54400
54802
|
}, []);
|
|
54401
|
-
(0,
|
|
54803
|
+
(0, import_react49.useEffect)(() => {
|
|
54402
54804
|
const el = editorRef.current;
|
|
54403
54805
|
if (el) {
|
|
54404
54806
|
el.keyBindings = [
|
|
@@ -54417,7 +54819,7 @@ ${current}` : popped);
|
|
|
54417
54819
|
activeIndex
|
|
54418
54820
|
);
|
|
54419
54821
|
const showDropdown = loadingSuggestions || suggestions.length > 0 && visible.length > 0;
|
|
54420
|
-
(0,
|
|
54822
|
+
(0, import_react49.useEffect)(() => {
|
|
54421
54823
|
onSuggestionsVisibilityChange?.(showDropdown);
|
|
54422
54824
|
}, [showDropdown, onSuggestionsVisibilityChange]);
|
|
54423
54825
|
const fullLabelWidth = /* @__PURE__ */ __name((s) => [s.label ?? s.value, s.argumentHint, s.sourceBadge].filter(Boolean).join(" ").length, "fullLabelWidth");
|
|
@@ -54542,7 +54944,7 @@ __name(OpenTuiInputPrompt, "OpenTuiInputPrompt");
|
|
|
54542
54944
|
|
|
54543
54945
|
// packages/cli/src/ui/opentui/opentui-header.tsx
|
|
54544
54946
|
init_esbuild_shims();
|
|
54545
|
-
var
|
|
54947
|
+
var import_react51 = __toESM(require_react(), 1);
|
|
54546
54948
|
var LOGO_GRADIENT = ["#4796E4", "#847ACE", "#C3677F"];
|
|
54547
54949
|
function lerpHex(a, b3, t3) {
|
|
54548
54950
|
const pa = [1, 3, 5].map((i) => parseInt(a.slice(i, i + 2), 16));
|
|
@@ -54666,7 +55068,7 @@ __name(buildBanner, "buildBanner");
|
|
|
54666
55068
|
function OpenTuiBanner({ config, settings }) {
|
|
54667
55069
|
const { width } = useTerminalDimensions();
|
|
54668
55070
|
const showBanner = !config.getScreenReader() && !settings.merged.ui?.hideBanner;
|
|
54669
|
-
const banner = (0,
|
|
55071
|
+
const banner = (0, import_react51.useMemo)(
|
|
54670
55072
|
() => showBanner ? buildBanner(config, settings, width) : null,
|
|
54671
55073
|
[showBanner, config, settings, width]
|
|
54672
55074
|
);
|
|
@@ -54676,36 +55078,39 @@ __name(OpenTuiBanner, "OpenTuiBanner");
|
|
|
54676
55078
|
|
|
54677
55079
|
// packages/cli/src/ui/opentui/opentui-footer.tsx
|
|
54678
55080
|
init_esbuild_shims();
|
|
54679
|
-
var
|
|
55081
|
+
var import_react53 = __toESM(require_react(), 1);
|
|
54680
55082
|
import nodePath2 from "node:path";
|
|
54681
|
-
function Spinner() {
|
|
54682
|
-
const [frame, setFrame] = (0,
|
|
54683
|
-
(0,
|
|
55083
|
+
function Spinner({ waiting }) {
|
|
55084
|
+
const [frame, setFrame] = (0, import_react53.useState)(0);
|
|
55085
|
+
(0, import_react53.useEffect)(() => {
|
|
55086
|
+
if (waiting) return;
|
|
54684
55087
|
const spin = setInterval(() => setFrame((f2) => f2 + 1), SPINNER_INTERVAL_MS);
|
|
54685
55088
|
return () => clearInterval(spin);
|
|
54686
|
-
}, []);
|
|
54687
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { width: 2, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: SPINNER_FRAMES[frame % SPINNER_FRAMES.length] }) });
|
|
55089
|
+
}, [waiting]);
|
|
55090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { width: 2, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: waiting ? WAITING_SPINNER_FRAME : SPINNER_FRAMES[frame % SPINNER_FRAMES.length] }) });
|
|
54688
55091
|
}
|
|
54689
55092
|
__name(Spinner, "Spinner");
|
|
54690
55093
|
function OpenTuiLoadingIndicator({
|
|
54691
55094
|
streaming,
|
|
55095
|
+
waiting = false,
|
|
54692
55096
|
streamingCharsRef,
|
|
54693
|
-
isReceivingContent = false
|
|
55097
|
+
isReceivingContent = false,
|
|
55098
|
+
showPhrase = true
|
|
54694
55099
|
}) {
|
|
54695
55100
|
const { width } = useTerminalDimensions();
|
|
54696
|
-
const phrase = usePhraseCycler(streaming,
|
|
54697
|
-
const elapsedTime = useTimer(streaming, 0);
|
|
54698
|
-
const fallbackRef = (0,
|
|
55101
|
+
const phrase = usePhraseCycler(streaming, waiting);
|
|
55102
|
+
const elapsedTime = useTimer(streaming, 0, waiting);
|
|
55103
|
+
const fallbackRef = (0, import_react53.useRef)(0);
|
|
54699
55104
|
const animatedChars = useAnimationFrame(
|
|
54700
55105
|
streamingCharsRef ?? fallbackRef,
|
|
54701
55106
|
streamingCharsRef && streaming ? 100 : null
|
|
54702
55107
|
);
|
|
54703
|
-
if (!streaming) return null;
|
|
55108
|
+
if (!streaming && !waiting) return null;
|
|
54704
55109
|
const isNarrow = isNarrowWidth(width);
|
|
54705
55110
|
const outputTokens = Math.round(animatedChars / 4);
|
|
54706
55111
|
const showTokens = !isNarrow && outputTokens > 0;
|
|
54707
55112
|
const timeStr = elapsedTime < 60 ? `${Math.floor(Math.max(0, elapsedTime))}s` : formatDuration(elapsedTime * 1e3);
|
|
54708
|
-
const suffix2 = t("({{time}}{{tokens}} \xB7 esc to cancel)", {
|
|
55113
|
+
const suffix2 = waiting ? "" : t("({{time}}{{tokens}} \xB7 esc to cancel)", {
|
|
54709
55114
|
time: timeStr,
|
|
54710
55115
|
tokens: showTokens ? ` \xB7 ${isReceivingContent ? "\u2193" : "\u2191"} ${formatTokenCount(
|
|
54711
55116
|
outputTokens
|
|
@@ -54715,13 +55120,13 @@ function OpenTuiLoadingIndicator({
|
|
|
54715
55120
|
0,
|
|
54716
55121
|
width - 5 - (isNarrow ? 0 : getCachedStringWidth(suffix2))
|
|
54717
55122
|
);
|
|
54718
|
-
const phraseText = truncateToWidth(phrase, phraseBudget);
|
|
55123
|
+
const phraseText = showPhrase ? truncateToWidth(phrase, phraseBudget) : "";
|
|
54719
55124
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { paddingLeft: 2, flexDirection: isNarrow ? "column" : "row", children: [
|
|
54720
55125
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "row", children: [
|
|
54721
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, {}),
|
|
54722
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: isNarrow ? phraseText : `${phraseText} ${suffix2}` })
|
|
55126
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { waiting }),
|
|
55127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: isNarrow || !suffix2 ? phraseText : `${phraseText} ${suffix2}` })
|
|
54723
55128
|
] }),
|
|
54724
|
-
isNarrow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: suffix2 })
|
|
55129
|
+
isNarrow && suffix2 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: suffix2 }) : null
|
|
54725
55130
|
] });
|
|
54726
55131
|
}
|
|
54727
55132
|
__name(OpenTuiLoadingIndicator, "OpenTuiLoadingIndicator");
|
|
@@ -54779,9 +55184,41 @@ function OpenTuiFooter({
|
|
|
54779
55184
|
}
|
|
54780
55185
|
__name(OpenTuiFooter, "OpenTuiFooter");
|
|
54781
55186
|
|
|
55187
|
+
// packages/cli/src/ui/opentui/queued-message.tsx
|
|
55188
|
+
init_esbuild_shims();
|
|
55189
|
+
var import_react55 = __toESM(require_react(), 1);
|
|
55190
|
+
var MAX_DISPLAYED_QUEUED_MESSAGES = 3;
|
|
55191
|
+
var NUM_TIMES_QUEUE_HINT_SHOWN = 3;
|
|
55192
|
+
var QUEUE_ROW_INDENT = 2;
|
|
55193
|
+
var OpenTuiQueuedMessageDisplay = /* @__PURE__ */ __name(({
|
|
55194
|
+
messageQueue
|
|
55195
|
+
}) => {
|
|
55196
|
+
const { width } = useTerminalDimensions();
|
|
55197
|
+
const hintSeenCountRef = (0, import_react55.useRef)(0);
|
|
55198
|
+
const wasEmptyRef = (0, import_react55.useRef)(true);
|
|
55199
|
+
if (messageQueue.length === 0) {
|
|
55200
|
+
wasEmptyRef.current = true;
|
|
55201
|
+
return null;
|
|
55202
|
+
}
|
|
55203
|
+
if (wasEmptyRef.current) {
|
|
55204
|
+
hintSeenCountRef.current++;
|
|
55205
|
+
wasEmptyRef.current = false;
|
|
55206
|
+
}
|
|
55207
|
+
const shouldShowHint = hintSeenCountRef.current <= NUM_TIMES_QUEUE_HINT_SHOWN;
|
|
55208
|
+
const rowBudget = Math.max(0, width - QUEUE_ROW_INDENT);
|
|
55209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", marginTop: 1, children: [
|
|
55210
|
+
messageQueue.slice(0, MAX_DISPLAYED_QUEUED_MESSAGES).map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { paddingLeft: QUEUE_ROW_INDENT, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: truncateToWidth(
|
|
55211
|
+
sanitizeTerminalText(message.replace(/\s+/g, " ")),
|
|
55212
|
+
rowBudget
|
|
55213
|
+
) }) }, index)),
|
|
55214
|
+
messageQueue.length > MAX_DISPLAYED_QUEUED_MESSAGES && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { paddingLeft: QUEUE_ROW_INDENT, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: `... (+${messageQueue.length - MAX_DISPLAYED_QUEUED_MESSAGES} more)` }) }),
|
|
55215
|
+
shouldShowHint && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { paddingLeft: QUEUE_ROW_INDENT, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, attributes: 4, children: t("Ctrl+Q to queue \xB7 \u2191 to edit queued messages") }) })
|
|
55216
|
+
] });
|
|
55217
|
+
}, "OpenTuiQueuedMessageDisplay");
|
|
55218
|
+
|
|
54782
55219
|
// packages/cli/src/ui/opentui/dialogs-confirm.tsx
|
|
54783
55220
|
init_esbuild_shims();
|
|
54784
|
-
var
|
|
55221
|
+
var import_react57 = __toESM(require_react(), 1);
|
|
54785
55222
|
|
|
54786
55223
|
// packages/cli/src/ui/opentui/diff-render.ts
|
|
54787
55224
|
init_esbuild_shims();
|
|
@@ -54879,6 +55316,16 @@ __name(renderDiffBody, "renderDiffBody");
|
|
|
54879
55316
|
|
|
54880
55317
|
// packages/cli/src/ui/opentui/dialogs-confirm.tsx
|
|
54881
55318
|
var MAX_BODY_ROWS = 20;
|
|
55319
|
+
var CUSTOM_FIELD_WIDTH = 50;
|
|
55320
|
+
function customFieldWindow(line, caret, cap) {
|
|
55321
|
+
const drawn = truncateToWidth(line, Math.max(1, cap - 1));
|
|
55322
|
+
return {
|
|
55323
|
+
line: drawn,
|
|
55324
|
+
...caretSpans({ text: drawn, cursor: caret }),
|
|
55325
|
+
caretInside: caret <= cpLen(drawn)
|
|
55326
|
+
};
|
|
55327
|
+
}
|
|
55328
|
+
__name(customFieldWindow, "customFieldWindow");
|
|
54882
55329
|
var EXPANDED_BODY_RESERVE_ROWS = 20;
|
|
54883
55330
|
function allowOnceOrAlways(permissionRules, showAlwaysAllow) {
|
|
54884
55331
|
const options = [
|
|
@@ -54997,7 +55444,7 @@ function buildConfirmationPrompt(details, isTrustedFolder) {
|
|
|
54997
55444
|
}
|
|
54998
55445
|
__name(buildConfirmationPrompt, "buildConfirmationPrompt");
|
|
54999
55446
|
function DiffBody({ fileDiff }) {
|
|
55000
|
-
const lines = (0,
|
|
55447
|
+
const lines = (0, import_react57.useMemo)(() => renderDiffBody(fileDiff), [fileDiff]);
|
|
55001
55448
|
const window = tailWindow(lines, MAX_BODY_ROWS);
|
|
55002
55449
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", children: [
|
|
55003
55450
|
window.hiddenCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -55012,14 +55459,14 @@ function DiffBody({ fileDiff }) {
|
|
|
55012
55459
|
}
|
|
55013
55460
|
__name(DiffBody, "DiffBody");
|
|
55014
55461
|
function TextBody({ text }) {
|
|
55015
|
-
const [expanded, setExpanded] = (0,
|
|
55462
|
+
const [expanded, setExpanded] = (0, import_react57.useState)(false);
|
|
55016
55463
|
const { width, height } = useTerminalDimensions();
|
|
55017
|
-
const rows = (0,
|
|
55018
|
-
const window = (0,
|
|
55464
|
+
const rows = (0, import_react57.useMemo)(() => sanitizeTerminalText(text).split("\n"), [text]);
|
|
55465
|
+
const window = (0, import_react57.useMemo)(
|
|
55019
55466
|
() => headWindowPhysical(rows, width, MAX_BODY_ROWS),
|
|
55020
55467
|
[rows, width]
|
|
55021
55468
|
);
|
|
55022
|
-
const expandedWindow = (0,
|
|
55469
|
+
const expandedWindow = (0, import_react57.useMemo)(
|
|
55023
55470
|
() => tailWindowPhysical(
|
|
55024
55471
|
rows,
|
|
55025
55472
|
width,
|
|
@@ -55099,7 +55546,7 @@ function ConfirmationBody({
|
|
|
55099
55546
|
}
|
|
55100
55547
|
__name(ConfirmationBody, "ConfirmationBody");
|
|
55101
55548
|
function OutcomeSelect(props) {
|
|
55102
|
-
const items = (0,
|
|
55549
|
+
const items = (0, import_react57.useMemo)(
|
|
55103
55550
|
() => props.options.map((option, index) => ({
|
|
55104
55551
|
key: `${option.value}-${index}`,
|
|
55105
55552
|
value: option.value,
|
|
@@ -55127,11 +55574,15 @@ function OutcomeSelect(props) {
|
|
|
55127
55574
|
);
|
|
55128
55575
|
}
|
|
55129
55576
|
__name(OutcomeSelect, "OutcomeSelect");
|
|
55577
|
+
function InlineConfirmation(props) {
|
|
55578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { flexDirection: "column", marginLeft: 2, padding: 1, children: props.children });
|
|
55579
|
+
}
|
|
55580
|
+
__name(InlineConfirmation, "InlineConfirmation");
|
|
55130
55581
|
function OpenTuiToolConfirmation(props) {
|
|
55131
55582
|
const { call, config, onSettled } = props;
|
|
55132
55583
|
const details = call.confirmationDetails;
|
|
55133
|
-
const settledRef = (0,
|
|
55134
|
-
const settle = (0,
|
|
55584
|
+
const settledRef = (0, import_react57.useRef)(false);
|
|
55585
|
+
const settle = (0, import_react57.useCallback)(
|
|
55135
55586
|
(outcome, payload) => {
|
|
55136
55587
|
if (settledRef.current) return;
|
|
55137
55588
|
settledRef.current = true;
|
|
@@ -55146,140 +55597,422 @@ function OpenTuiToolConfirmation(props) {
|
|
|
55146
55597
|
}
|
|
55147
55598
|
});
|
|
55148
55599
|
if (details.type === "ask_user_question") {
|
|
55149
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55150
|
-
|
|
55151
|
-
|
|
55152
|
-
|
|
55153
|
-
{
|
|
55154
|
-
|
|
55155
|
-
|
|
55156
|
-
|
|
55157
|
-
|
|
55158
|
-
} else {
|
|
55159
|
-
settle("proceed_once" /* ProceedOnce */, { answers });
|
|
55160
|
-
}
|
|
55600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InlineConfirmation, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55601
|
+
AskUserQuestionFlow,
|
|
55602
|
+
{
|
|
55603
|
+
details,
|
|
55604
|
+
onAnswered: (answers) => {
|
|
55605
|
+
if (answers === null) {
|
|
55606
|
+
settle("cancel" /* Cancel */);
|
|
55607
|
+
} else {
|
|
55608
|
+
settle("proceed_once" /* ProceedOnce */, { answers });
|
|
55161
55609
|
}
|
|
55162
55610
|
}
|
|
55163
|
-
|
|
55164
|
-
|
|
55611
|
+
}
|
|
55612
|
+
) });
|
|
55165
55613
|
}
|
|
55166
55614
|
const prompt = buildConfirmationPrompt(details, config.isTrustedFolder());
|
|
55167
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
55168
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, attributes: 1, children: sanitizeTerminalText(details.title) }),
|
|
55169
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginTop: 1, marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfirmationBody, { details }) }),
|
|
55170
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: sanitizeTerminalText(prompt.question) }),
|
|
55615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(InlineConfirmation, { children: [
|
|
55171
55616
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55172
|
-
|
|
55617
|
+
"box",
|
|
55173
55618
|
{
|
|
55174
|
-
|
|
55175
|
-
|
|
55619
|
+
flexDirection: "column",
|
|
55620
|
+
marginLeft: 1,
|
|
55621
|
+
paddingLeft: 1,
|
|
55622
|
+
marginBottom: 1,
|
|
55623
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfirmationBody, { details })
|
|
55176
55624
|
}
|
|
55177
55625
|
),
|
|
55626
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: sanitizeTerminalText(prompt.question) }) }),
|
|
55178
55627
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55179
|
-
|
|
55628
|
+
OutcomeSelect,
|
|
55180
55629
|
{
|
|
55181
|
-
|
|
55630
|
+
options: prompt.options,
|
|
55631
|
+
onChoose: (outcome) => settle(outcome)
|
|
55182
55632
|
}
|
|
55183
55633
|
)
|
|
55184
|
-
] })
|
|
55634
|
+
] });
|
|
55185
55635
|
}
|
|
55186
55636
|
__name(OpenTuiToolConfirmation, "OpenTuiToolConfirmation");
|
|
55187
55637
|
function AskUserQuestionFlow(props) {
|
|
55188
55638
|
const { details, onAnswered } = props;
|
|
55189
|
-
const
|
|
55190
|
-
const
|
|
55191
|
-
const
|
|
55192
|
-
const
|
|
55193
|
-
const
|
|
55194
|
-
const
|
|
55195
|
-
|
|
55196
|
-
|
|
55197
|
-
|
|
55198
|
-
|
|
55199
|
-
|
|
55200
|
-
|
|
55201
|
-
|
|
55202
|
-
|
|
55203
|
-
|
|
55204
|
-
|
|
55205
|
-
|
|
55206
|
-
|
|
55207
|
-
|
|
55208
|
-
|
|
55639
|
+
const questions = details.questions;
|
|
55640
|
+
const hasMultipleQuestions = questions.length > 1;
|
|
55641
|
+
const totalTabs = hasMultipleQuestions ? questions.length + 1 : questions.length;
|
|
55642
|
+
const [tab, setTab] = (0, import_react57.useState)(0);
|
|
55643
|
+
const [selected, setSelected] = (0, import_react57.useState)(0);
|
|
55644
|
+
const [picked, setPicked] = (0, import_react57.useState)({});
|
|
55645
|
+
const [checked, setChecked] = (0, import_react57.useState)({});
|
|
55646
|
+
const [typed, setTyped] = (0, import_react57.useState)({});
|
|
55647
|
+
const [typedChecked, setTypedChecked] = (0, import_react57.useState)({});
|
|
55648
|
+
const typedRef = (0, import_react57.useRef)({});
|
|
55649
|
+
const tabRef = (0, import_react57.useRef)(0);
|
|
55650
|
+
const selectedRef = (0, import_react57.useRef)(0);
|
|
55651
|
+
const checkedRef = (0, import_react57.useRef)({});
|
|
55652
|
+
const pickedRef = (0, import_react57.useRef)({});
|
|
55653
|
+
const typedCheckedRef = (0, import_react57.useRef)({});
|
|
55654
|
+
const advanceTimer = (0, import_react57.useRef)(null);
|
|
55655
|
+
const { width } = useTerminalDimensions();
|
|
55656
|
+
const viewOf = /* @__PURE__ */ __name((tabIdx, selIdx) => {
|
|
55657
|
+
const onSubmit = hasMultipleQuestions && tabIdx === totalTabs - 1;
|
|
55658
|
+
const q3 = onSubmit ? void 0 : questions[tabIdx];
|
|
55659
|
+
return {
|
|
55660
|
+
isSubmitTab: onSubmit,
|
|
55661
|
+
question: q3,
|
|
55662
|
+
isMultiSelect: q3?.multiSelect === true,
|
|
55663
|
+
// The free-text row sits after the predefined options.
|
|
55664
|
+
totalOptions: q3 ? q3.options.length + 1 : 2,
|
|
55665
|
+
isCustomRow: q3 !== void 0 && selIdx === q3.options.length
|
|
55666
|
+
};
|
|
55667
|
+
}, "viewOf");
|
|
55668
|
+
const { isSubmitTab, question, isMultiSelect, isCustomRow } = viewOf(
|
|
55669
|
+
tab,
|
|
55670
|
+
selected
|
|
55671
|
+
);
|
|
55672
|
+
const typedValue = /* @__PURE__ */ __name((idx) => typedRef.current[idx] ?? typed[idx] ?? "", "typedValue");
|
|
55673
|
+
const checkedLabels = /* @__PURE__ */ __name((idx) => checkedRef.current[idx] ?? checked[idx] ?? [], "checkedLabels");
|
|
55674
|
+
const pickedValue = /* @__PURE__ */ __name((idx) => pickedRef.current[idx] ?? picked[idx], "pickedValue");
|
|
55675
|
+
const typedCheckedFor = /* @__PURE__ */ __name((idx) => typedCheckedRef.current[idx] ?? typedChecked[idx] ?? false, "typedCheckedFor");
|
|
55676
|
+
const customValue = typedValue(tab);
|
|
55677
|
+
const isCustomAnswer = question !== void 0 && !isMultiSelect && pickedValue(tab) !== void 0 && !question.options.some((option) => option.label === pickedValue(tab));
|
|
55678
|
+
const answerFor = /* @__PURE__ */ __name((idx) => {
|
|
55679
|
+
const current = questions[idx];
|
|
55680
|
+
if (!current?.multiSelect) return pickedValue(idx);
|
|
55681
|
+
const labels = [...checkedLabels(idx)];
|
|
55682
|
+
const own = typedValue(idx).trim();
|
|
55683
|
+
if (typedCheckedFor(idx) && own) labels.push(own);
|
|
55684
|
+
return labels.length > 0 ? labels.join(", ") : void 0;
|
|
55685
|
+
}, "answerFor");
|
|
55686
|
+
const moveToTab = /* @__PURE__ */ __name((next) => {
|
|
55687
|
+
tabRef.current = next;
|
|
55688
|
+
setTab(next);
|
|
55689
|
+
}, "moveToTab");
|
|
55690
|
+
const moveToOption = /* @__PURE__ */ __name((next) => {
|
|
55691
|
+
selectedRef.current = next;
|
|
55692
|
+
setSelected(next);
|
|
55693
|
+
}, "moveToOption");
|
|
55694
|
+
const toggleChecked = /* @__PURE__ */ __name((idx, label) => {
|
|
55695
|
+
const current = checkedLabels(idx);
|
|
55696
|
+
const next = current.includes(label) ? current.filter((value) => value !== label) : [...current, label];
|
|
55697
|
+
checkedRef.current = { ...checkedRef.current, [idx]: next };
|
|
55698
|
+
setChecked((prev) => ({ ...prev, [idx]: next }));
|
|
55699
|
+
}, "toggleChecked");
|
|
55700
|
+
const markTypedChecked = /* @__PURE__ */ __name((idx, on2) => {
|
|
55701
|
+
typedCheckedRef.current = { ...typedCheckedRef.current, [idx]: on2 };
|
|
55702
|
+
setTypedChecked((prev) => ({ ...prev, [idx]: on2 }));
|
|
55703
|
+
}, "markTypedChecked");
|
|
55704
|
+
const cancelPendingAdvance = /* @__PURE__ */ __name(() => {
|
|
55705
|
+
if (advanceTimer.current) clearTimeout(advanceTimer.current);
|
|
55706
|
+
advanceTimer.current = null;
|
|
55707
|
+
}, "cancelPendingAdvance");
|
|
55708
|
+
const answerIsLocked = /* @__PURE__ */ __name(() => advanceTimer.current !== null, "answerIsLocked");
|
|
55709
|
+
const selectAndAdvance = /* @__PURE__ */ __name((value) => {
|
|
55710
|
+
if (answerIsLocked()) return false;
|
|
55711
|
+
const idx = tabRef.current;
|
|
55712
|
+
pickedRef.current = { ...pickedRef.current, [idx]: value };
|
|
55713
|
+
setPicked((prev) => ({ ...prev, [idx]: value }));
|
|
55714
|
+
if (!hasMultipleQuestions) {
|
|
55715
|
+
onAnswered({ [idx]: value });
|
|
55716
|
+
return true;
|
|
55717
|
+
}
|
|
55718
|
+
if (idx >= totalTabs - 1) return true;
|
|
55719
|
+
advanceTimer.current = setTimeout(() => {
|
|
55720
|
+
advanceTimer.current = null;
|
|
55721
|
+
moveToTab(Math.min(tabRef.current + 1, totalTabs - 1));
|
|
55722
|
+
moveToOption(0);
|
|
55723
|
+
}, 150);
|
|
55724
|
+
return true;
|
|
55725
|
+
}, "selectAndAdvance");
|
|
55726
|
+
const submitAll = /* @__PURE__ */ __name(() => {
|
|
55727
|
+
const answers = {};
|
|
55728
|
+
questions.forEach((_2, idx) => {
|
|
55729
|
+
const answer = answerFor(idx);
|
|
55730
|
+
if (answer !== void 0) answers[idx] = answer;
|
|
55731
|
+
});
|
|
55732
|
+
onAnswered(answers);
|
|
55733
|
+
}, "submitAll");
|
|
55734
|
+
const multiAnswer = /* @__PURE__ */ __name((includeTyped, value) => {
|
|
55735
|
+
const labels = [...checkedLabels(tabRef.current)];
|
|
55736
|
+
const own = value.trim();
|
|
55737
|
+
if (includeTyped && own) labels.push(own);
|
|
55738
|
+
return labels.length > 0 ? labels.join(", ") : void 0;
|
|
55739
|
+
}, "multiAnswer");
|
|
55740
|
+
const writeCustomValue = /* @__PURE__ */ __name((next) => {
|
|
55741
|
+
const idx = tabRef.current;
|
|
55742
|
+
typedRef.current = { ...typedRef.current, [idx]: next };
|
|
55743
|
+
setTyped((prev) => ({ ...prev, [idx]: next }));
|
|
55744
|
+
if (questions[idx]?.multiSelect === true) {
|
|
55745
|
+
markTypedChecked(idx, next.trim().length > 0);
|
|
55746
|
+
}
|
|
55747
|
+
}, "writeCustomValue");
|
|
55748
|
+
const custom = useLineEdit(
|
|
55749
|
+
customValue,
|
|
55750
|
+
writeCustomValue,
|
|
55751
|
+
`${isCustomRow}:${tab}`
|
|
55752
|
+
);
|
|
55753
|
+
const submitCustomRow = /* @__PURE__ */ __name(() => {
|
|
55754
|
+
const idx = tabRef.current;
|
|
55755
|
+
const current = typedValue(idx);
|
|
55756
|
+
const value = current.trim();
|
|
55757
|
+
const isMulti = questions[idx]?.multiSelect === true;
|
|
55758
|
+
if (isMulti) {
|
|
55759
|
+
markTypedChecked(idx, value.length > 0);
|
|
55760
|
+
}
|
|
55761
|
+
if (!value) return;
|
|
55762
|
+
const answer = isMulti ? multiAnswer(true, current) : value;
|
|
55763
|
+
if (answer === void 0) return;
|
|
55764
|
+
if (selectAndAdvance(answer)) custom.settle();
|
|
55765
|
+
}, "submitCustomRow");
|
|
55766
|
+
(0, import_react57.useEffect)(
|
|
55767
|
+
() => () => {
|
|
55768
|
+
if (advanceTimer.current) clearTimeout(advanceTimer.current);
|
|
55209
55769
|
},
|
|
55210
|
-
[
|
|
55770
|
+
[]
|
|
55211
55771
|
);
|
|
55212
|
-
const
|
|
55213
|
-
() => (
|
|
55214
|
-
|
|
55215
|
-
|
|
55216
|
-
|
|
55217
|
-
|
|
55772
|
+
const answeredHeaders = questions.filter(
|
|
55773
|
+
(_2, idx) => answerFor(idx) !== void 0
|
|
55774
|
+
).length;
|
|
55775
|
+
const rowOverhead = 2 + // the dialog's own padding
|
|
55776
|
+
(isSubmitTab ? 2 : 1) + // "▸ " when Submit is the active tab
|
|
55777
|
+
getCachedStringWidth(t("Submit")) + questions.length + // gap={1} between each chip and the Submit chip
|
|
55778
|
+
2 * questions.length + // "▸ " or " " before each header
|
|
55779
|
+
2 * answeredHeaders;
|
|
55780
|
+
const headerCap = computeHeaderCap(
|
|
55781
|
+
questions.map((q3) => getCachedStringWidth(q3.header)),
|
|
55782
|
+
width - 2 - rowOverhead
|
|
55218
55783
|
);
|
|
55219
|
-
const
|
|
55220
|
-
items,
|
|
55221
|
-
numbers: false,
|
|
55222
|
-
// For single-select we commit directly on Enter; for multi-select Enter is
|
|
55223
|
-
// handled by the keyboard hook below (it submits the accumulated set), so
|
|
55224
|
-
// onSelect must stay unset in that mode to avoid a double commit.
|
|
55225
|
-
onSelect: isMulti ? void 0 : (value) => commitQuestion(value),
|
|
55226
|
-
resyncKey: index
|
|
55227
|
-
});
|
|
55784
|
+
const fieldIsMine = /* @__PURE__ */ __name(() => tabRef.current === tab && !custom.settled, "fieldIsMine");
|
|
55228
55785
|
useKeyboard((key) => {
|
|
55229
|
-
if (!isMulti) return;
|
|
55230
55786
|
const original = toOriginalKey(key);
|
|
55231
|
-
const
|
|
55232
|
-
|
|
55233
|
-
|
|
55234
|
-
|
|
55235
|
-
|
|
55236
|
-
|
|
55237
|
-
|
|
55238
|
-
|
|
55239
|
-
|
|
55787
|
+
const {
|
|
55788
|
+
isSubmitTab: onReview,
|
|
55789
|
+
question: asked,
|
|
55790
|
+
isMultiSelect: multi,
|
|
55791
|
+
totalOptions: optionCount,
|
|
55792
|
+
isCustomRow: onCustomRow
|
|
55793
|
+
} = viewOf(tabRef.current, selectedRef.current);
|
|
55794
|
+
if (onCustomRow) {
|
|
55795
|
+
if (original.name === "up" || original.ctrl && original.name === "p") {
|
|
55796
|
+
moveToOption(Math.max(0, selectedRef.current - 1));
|
|
55797
|
+
} else if (original.name === "down" || original.ctrl && original.name === "n") {
|
|
55798
|
+
moveToOption(Math.min(optionCount - 1, selectedRef.current + 1));
|
|
55799
|
+
} else if (original.name === "return") {
|
|
55800
|
+
submitCustomRow();
|
|
55801
|
+
} else if (fieldIsMine() && // Only a multi-select answer is recomputed from the typed value, so
|
|
55802
|
+
// only one can be widened after its Enter has been recorded. A
|
|
55803
|
+
// single-select field whose submit the pause rejected stays editable.
|
|
55804
|
+
!(multi && answerIsLocked()) && !custom.handleKey(original) && isPrintableKeyInput(key)) {
|
|
55805
|
+
custom.insert(key.sequence);
|
|
55806
|
+
}
|
|
55807
|
+
return;
|
|
55808
|
+
}
|
|
55809
|
+
if (hasMultipleQuestions && original.name === "left" && tabRef.current > 0) {
|
|
55810
|
+
cancelPendingAdvance();
|
|
55811
|
+
moveToTab(tabRef.current - 1);
|
|
55812
|
+
moveToOption(0);
|
|
55813
|
+
return;
|
|
55814
|
+
}
|
|
55815
|
+
if (hasMultipleQuestions && original.name === "right" && tabRef.current < totalTabs - 1) {
|
|
55816
|
+
cancelPendingAdvance();
|
|
55817
|
+
moveToTab(tabRef.current + 1);
|
|
55818
|
+
moveToOption(0);
|
|
55819
|
+
return;
|
|
55820
|
+
}
|
|
55821
|
+
if (matchesCommand("selectionUp" /* SELECTION_UP */, key)) {
|
|
55822
|
+
moveToOption(Math.max(0, selectedRef.current - 1));
|
|
55823
|
+
return;
|
|
55824
|
+
}
|
|
55825
|
+
if (matchesCommand("selectionDown" /* SELECTION_DOWN */, key)) {
|
|
55826
|
+
moveToOption(Math.min(optionCount - 1, selectedRef.current + 1));
|
|
55827
|
+
return;
|
|
55828
|
+
}
|
|
55829
|
+
const numKey = /^[1-9]\d*$/.test(original.sequence) ? Number(original.sequence) : NaN;
|
|
55830
|
+
if (Number.isSafeInteger(numKey) && numKey <= optionCount) {
|
|
55831
|
+
const target = numKey - 1;
|
|
55832
|
+
moveToOption(target);
|
|
55833
|
+
const option = !multi ? asked?.options[target] : void 0;
|
|
55834
|
+
if (option) selectAndAdvance(option.label);
|
|
55835
|
+
return;
|
|
55836
|
+
}
|
|
55837
|
+
if (original.name === "space" && multi && asked && !answerIsLocked()) {
|
|
55838
|
+
const option = asked.options[selectedRef.current];
|
|
55839
|
+
if (option) toggleChecked(tabRef.current, option.label);
|
|
55240
55840
|
return;
|
|
55241
55841
|
}
|
|
55242
55842
|
if (original.name === "return") {
|
|
55243
|
-
if (
|
|
55244
|
-
|
|
55843
|
+
if (onReview) {
|
|
55844
|
+
if (selectedRef.current === 0) submitAll();
|
|
55845
|
+
else onAnswered(null);
|
|
55846
|
+
return;
|
|
55847
|
+
}
|
|
55848
|
+
if (multi) {
|
|
55849
|
+
const idx = tabRef.current;
|
|
55850
|
+
const answer = multiAnswer(typedCheckedFor(idx), typedValue(idx));
|
|
55851
|
+
if (answer !== void 0) selectAndAdvance(answer);
|
|
55852
|
+
return;
|
|
55853
|
+
}
|
|
55854
|
+
const option = asked?.options[selectedRef.current];
|
|
55855
|
+
if (option) selectAndAdvance(option.label);
|
|
55245
55856
|
}
|
|
55246
55857
|
});
|
|
55247
|
-
(
|
|
55248
|
-
|
|
55858
|
+
usePaste((event) => {
|
|
55859
|
+
const { isCustomRow: onCustomRow } = viewOf(
|
|
55860
|
+
tabRef.current,
|
|
55861
|
+
selectedRef.current
|
|
55862
|
+
);
|
|
55863
|
+
if (!onCustomRow || !fieldIsMine() || answerIsLocked()) return;
|
|
55864
|
+
const text = normalizePastedText(decodePasteBytes(event.bytes));
|
|
55865
|
+
if (!text) return;
|
|
55866
|
+
event.preventDefault();
|
|
55867
|
+
custom.insert(text);
|
|
55868
|
+
});
|
|
55869
|
+
(0, import_react57.useEffect)(() => {
|
|
55870
|
+
if (questions.length === 0 || question?.options.length === 0) {
|
|
55249
55871
|
onAnswered(null);
|
|
55250
55872
|
}
|
|
55251
|
-
}, [
|
|
55873
|
+
}, [questions.length, question, onAnswered]);
|
|
55874
|
+
const chipRow = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "row", gap: 1, marginBottom: 1, children: [
|
|
55875
|
+
questions.map((q3, idx) => {
|
|
55876
|
+
const active = !isSubmitTab && idx === tab;
|
|
55877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55878
|
+
"text",
|
|
55879
|
+
{
|
|
55880
|
+
fg: active ? C2.accent : C2.dim,
|
|
55881
|
+
attributes: active ? 1 : 0,
|
|
55882
|
+
children: (active ? "\u25B8 " : " ") + truncateToWidth(sanitizeTerminalText(q3.header), headerCap) + (answerFor(idx) !== void 0 ? " \u2713" : "")
|
|
55883
|
+
},
|
|
55884
|
+
idx
|
|
55885
|
+
);
|
|
55886
|
+
}),
|
|
55887
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55888
|
+
"text",
|
|
55889
|
+
{
|
|
55890
|
+
fg: isSubmitTab ? C2.accent : C2.dim,
|
|
55891
|
+
attributes: isSubmitTab ? 1 : 0,
|
|
55892
|
+
children: (isSubmitTab ? "\u25B8 " : " ") + t("Submit")
|
|
55893
|
+
}
|
|
55894
|
+
)
|
|
55895
|
+
] });
|
|
55896
|
+
if (isSubmitTab) {
|
|
55897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
55898
|
+
hasMultipleQuestions ? chipRow : null,
|
|
55899
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", marginBottom: 1, children: [
|
|
55900
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, attributes: 1, children: t("Your answers:") }),
|
|
55901
|
+
questions.map((q3, idx) => {
|
|
55902
|
+
const answer = answerFor(idx);
|
|
55903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "row", marginLeft: 2, children: [
|
|
55904
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: sanitizeTerminalText(q3.header) + ": " }),
|
|
55905
|
+
answer ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.accent, children: sanitizeTerminalText(answer) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: t("(not answered)") })
|
|
55906
|
+
] }, idx);
|
|
55907
|
+
})
|
|
55908
|
+
] }),
|
|
55909
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginTop: 1, marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: t("Ready to submit your answers?") }) }),
|
|
55910
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", children: [
|
|
55911
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55912
|
+
"text",
|
|
55913
|
+
{
|
|
55914
|
+
fg: selected === 0 ? C2.accent : C2.text,
|
|
55915
|
+
attributes: selected === 0 ? 1 : 0,
|
|
55916
|
+
children: (selected === 0 ? "\u276F " : " ") + `1. ${t("Submit answers")}`
|
|
55917
|
+
}
|
|
55918
|
+
),
|
|
55919
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55920
|
+
"text",
|
|
55921
|
+
{
|
|
55922
|
+
fg: selected === 1 ? C2.accent : C2.text,
|
|
55923
|
+
attributes: selected === 1 ? 1 : 0,
|
|
55924
|
+
children: (selected === 1 ? "\u276F " : " ") + `2. ${t("Cancel")}`
|
|
55925
|
+
}
|
|
55926
|
+
)
|
|
55927
|
+
] }),
|
|
55928
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55929
|
+
FooterHint,
|
|
55930
|
+
{
|
|
55931
|
+
text: t("\u2191/\u2193: Navigate | \u2190/\u2192: Switch tabs | Enter: Select")
|
|
55932
|
+
}
|
|
55933
|
+
)
|
|
55934
|
+
] });
|
|
55935
|
+
}
|
|
55252
55936
|
if (!question) return null;
|
|
55253
|
-
|
|
55254
|
-
|
|
55255
|
-
|
|
55256
|
-
|
|
55257
|
-
|
|
55258
|
-
|
|
55259
|
-
|
|
55260
|
-
|
|
55937
|
+
const customMark = isMultiSelect ? typedChecked[tab] ? "[\u2713] " : "[ ] " : "";
|
|
55938
|
+
const customEmphasis = isCustomAnswer || typedChecked[tab] === true;
|
|
55939
|
+
const customLabel = `${question.options.length + 1}. `;
|
|
55940
|
+
const placeholder = t("Type something...");
|
|
55941
|
+
const caretLine = caretSpans({ text: customValue, cursor: custom.caret });
|
|
55942
|
+
const fieldCap = Math.max(
|
|
55943
|
+
1,
|
|
55944
|
+
Math.min(
|
|
55945
|
+
CUSTOM_FIELD_WIDTH,
|
|
55946
|
+
// The inline confirmation's own two columns of margin and two of padding;
|
|
55947
|
+
// `headerCap` charges the same four, split across `rowOverhead`.
|
|
55948
|
+
width - 4 - getCachedStringWidth(`\u276F ${customMark}${customLabel}> `)
|
|
55949
|
+
)
|
|
55950
|
+
);
|
|
55951
|
+
const customField = customFieldWindow(
|
|
55952
|
+
caretLine.before + caretLine.at + caretLine.after,
|
|
55953
|
+
cpLen(caretLine.before),
|
|
55954
|
+
fieldCap
|
|
55955
|
+
);
|
|
55956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
55957
|
+
hasMultipleQuestions ? chipRow : null,
|
|
55958
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", marginBottom: 1, children: [
|
|
55959
|
+
!hasMultipleQuestions ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.accent, attributes: 1, children: sanitizeTerminalText(question.header) }) }) : null,
|
|
55960
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: sanitizeTerminalText(question.question) })
|
|
55261
55961
|
] }),
|
|
55262
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
55263
|
-
|
|
55264
|
-
|
|
55265
|
-
|
|
55266
|
-
|
|
55267
|
-
|
|
55268
|
-
|
|
55269
|
-
|
|
55270
|
-
|
|
55271
|
-
|
|
55272
|
-
|
|
55273
|
-
|
|
55274
|
-
|
|
55275
|
-
|
|
55962
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", marginBottom: 1, children: [
|
|
55963
|
+
question.options.map((option, idx) => {
|
|
55964
|
+
const isSelected = selected === idx;
|
|
55965
|
+
const isChecked = isMultiSelect && (checked[tab] ?? []).includes(option.label);
|
|
55966
|
+
const isAnswered = !isMultiSelect && picked[tab] === option.label;
|
|
55967
|
+
const highlighted = isSelected || isAnswered || isChecked;
|
|
55968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", children: [
|
|
55969
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55970
|
+
"text",
|
|
55971
|
+
{
|
|
55972
|
+
fg: highlighted ? C2.accent : C2.text,
|
|
55973
|
+
attributes: highlighted ? 1 : 0,
|
|
55974
|
+
children: (isSelected ? "\u276F " : " ") + (isMultiSelect ? isChecked ? "[\u2713] " : "[ ] " : "") + `${idx + 1}. ${sanitizeTerminalText(option.label)}` + (isAnswered ? " \u2713" : "")
|
|
55975
|
+
}
|
|
55976
|
+
),
|
|
55977
|
+
option.description ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55978
|
+
"box",
|
|
55979
|
+
{
|
|
55980
|
+
marginLeft: 2 + (isMultiSelect ? 4 : 0) + String(idx + 1).length + 2,
|
|
55981
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: sanitizeTerminalText(option.description) })
|
|
55982
|
+
}
|
|
55983
|
+
) : null
|
|
55984
|
+
] }, idx);
|
|
55985
|
+
}),
|
|
55986
|
+
isCustomRow ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "row", children: [
|
|
55987
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.accent, attributes: 1, children: "\u276F " + customMark + customLabel }),
|
|
55988
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.accent, children: "> " }),
|
|
55989
|
+
customValue ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
55990
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: sanitizeTerminalText(customField.before) }),
|
|
55991
|
+
customField.caretInside ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { bg: C2.accent, children: sanitizeTerminalText(customField.at) || " " }) : null,
|
|
55992
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: sanitizeTerminalText(customField.after) })
|
|
55993
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
55994
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { bg: C2.accent, children: placeholder.slice(0, 1) }),
|
|
55995
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: placeholder.slice(1) })
|
|
55996
|
+
] })
|
|
55997
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55998
|
+
"text",
|
|
55999
|
+
{
|
|
56000
|
+
fg: customEmphasis ? C2.accent : customValue ? C2.text : C2.dim,
|
|
56001
|
+
attributes: customEmphasis ? 1 : 0,
|
|
56002
|
+
children: " " + customMark + customLabel + (customValue ? sanitizeTerminalText(customField.line) : placeholder) + (isCustomAnswer ? " \u2713" : "")
|
|
55276
56003
|
}
|
|
55277
|
-
|
|
55278
|
-
|
|
56004
|
+
)
|
|
56005
|
+
] }),
|
|
55279
56006
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55280
56007
|
FooterHint,
|
|
55281
56008
|
{
|
|
55282
|
-
text:
|
|
56009
|
+
text: hasMultipleQuestions ? isMultiSelect ? t(
|
|
56010
|
+
"\u2191/\u2193: Navigate | \u2190/\u2192: Switch tabs | Space: Toggle | Enter: Confirm | Esc: Cancel"
|
|
56011
|
+
) : t(
|
|
56012
|
+
"\u2191/\u2193: Navigate | \u2190/\u2192: Switch tabs | Enter: Select | Esc: Cancel"
|
|
56013
|
+
) : isMultiSelect ? t(
|
|
56014
|
+
"\u2191/\u2193: Navigate | Space: Toggle | Enter: Confirm | Esc: Cancel"
|
|
56015
|
+
) : t("\u2191/\u2193: Navigate | Enter: Select | Esc: Cancel")
|
|
55283
56016
|
}
|
|
55284
56017
|
)
|
|
55285
56018
|
] });
|
|
@@ -55287,7 +56020,7 @@ function AskUserQuestionFlow(props) {
|
|
|
55287
56020
|
__name(AskUserQuestionFlow, "AskUserQuestionFlow");
|
|
55288
56021
|
function OpenTuiShellConfirmation(props) {
|
|
55289
56022
|
const { commands, onResolve } = props;
|
|
55290
|
-
const options = (0,
|
|
56023
|
+
const options = (0, import_react57.useMemo)(
|
|
55291
56024
|
() => [
|
|
55292
56025
|
{
|
|
55293
56026
|
label: t("Yes, allow once"),
|
|
@@ -55334,7 +56067,7 @@ function OpenTuiShellConfirmation(props) {
|
|
|
55334
56067
|
__name(OpenTuiShellConfirmation, "OpenTuiShellConfirmation");
|
|
55335
56068
|
function OpenTuiActionConfirmation(props) {
|
|
55336
56069
|
const { prompt, onResolve } = props;
|
|
55337
|
-
const options = (0,
|
|
56070
|
+
const options = (0, import_react57.useMemo)(
|
|
55338
56071
|
() => [
|
|
55339
56072
|
{ key: "yes", value: true },
|
|
55340
56073
|
{ key: "no", value: false }
|
|
@@ -55463,7 +56196,7 @@ function OpenTuiApp(props) {
|
|
|
55463
56196
|
isReceivingContent,
|
|
55464
56197
|
onInterrupt,
|
|
55465
56198
|
approvalMode,
|
|
55466
|
-
|
|
56199
|
+
messageQueue,
|
|
55467
56200
|
onPopQueue,
|
|
55468
56201
|
waitingToolCalls,
|
|
55469
56202
|
onToolCallSettled,
|
|
@@ -55472,31 +56205,32 @@ function OpenTuiApp(props) {
|
|
|
55472
56205
|
onPromptSuggestionDismiss,
|
|
55473
56206
|
onPromptSuggestionAbort
|
|
55474
56207
|
} = props;
|
|
55475
|
-
const
|
|
56208
|
+
const queueLength = messageQueue?.length ?? 0;
|
|
56209
|
+
const [dialog, setDialog] = (0, import_react59.useState)(
|
|
55476
56210
|
props.initialDialog ?? null
|
|
55477
56211
|
);
|
|
55478
|
-
const [noticeText, setNoticeText] = (0,
|
|
55479
|
-
const [commandList, setCommandList] = (0,
|
|
56212
|
+
const [noticeText, setNoticeText] = (0, import_react59.useState)(null);
|
|
56213
|
+
const [commandList, setCommandList] = (0, import_react59.useState)(
|
|
55480
56214
|
commands ?? []
|
|
55481
56215
|
);
|
|
55482
|
-
const notify = (0,
|
|
55483
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
55484
|
-
const shellControllersRef = (0,
|
|
56216
|
+
const notify = (0, import_react59.useCallback)((text) => setNoticeText(text), []);
|
|
56217
|
+
const [shellModeActive, setShellModeActive] = (0, import_react59.useState)(false);
|
|
56218
|
+
const shellControllersRef = (0, import_react59.useRef)(/* @__PURE__ */ new Set());
|
|
55485
56219
|
const { width: terminalWidth, height: terminalHeight } = useTerminalDimensions();
|
|
55486
|
-
const toggleShellMode = (0,
|
|
56220
|
+
const toggleShellMode = (0, import_react59.useCallback)(
|
|
55487
56221
|
() => setShellModeActive((active) => !active),
|
|
55488
56222
|
[]
|
|
55489
56223
|
);
|
|
55490
|
-
const [showSuggestions, setShowSuggestions] = (0,
|
|
55491
|
-
const onSuggestionsVisibilityChange = (0,
|
|
56224
|
+
const [showSuggestions, setShowSuggestions] = (0, import_react59.useState)(false);
|
|
56225
|
+
const onSuggestionsVisibilityChange = (0, import_react59.useCallback)(
|
|
55492
56226
|
(visible) => setShowSuggestions(visible),
|
|
55493
56227
|
[]
|
|
55494
56228
|
);
|
|
55495
|
-
const [currentApprovalMode, setCurrentApprovalMode] = (0,
|
|
55496
|
-
(0,
|
|
56229
|
+
const [currentApprovalMode, setCurrentApprovalMode] = (0, import_react59.useState)(approvalMode);
|
|
56230
|
+
(0, import_react59.useEffect)(() => {
|
|
55497
56231
|
setCurrentApprovalMode(approvalMode);
|
|
55498
56232
|
}, [approvalMode]);
|
|
55499
|
-
const addInfoItem = (0,
|
|
56233
|
+
const addInfoItem = (0, import_react59.useCallback)(
|
|
55500
56234
|
(item) => {
|
|
55501
56235
|
if (item.type === "info" /* INFO */) {
|
|
55502
56236
|
onTranscriptEvent?.({ type: "info", text: item.text });
|
|
@@ -55504,7 +56238,7 @@ function OpenTuiApp(props) {
|
|
|
55504
56238
|
},
|
|
55505
56239
|
[onTranscriptEvent]
|
|
55506
56240
|
);
|
|
55507
|
-
const adoptApprovalMode = (0,
|
|
56241
|
+
const adoptApprovalMode = (0, import_react59.useCallback)(
|
|
55508
56242
|
(next) => {
|
|
55509
56243
|
setCurrentApprovalMode(next);
|
|
55510
56244
|
if (next === "auto" /* AUTO */ && currentApprovalMode !== "auto" /* AUTO */) {
|
|
@@ -55525,7 +56259,7 @@ function OpenTuiApp(props) {
|
|
|
55525
56259
|
onToolCallSettled
|
|
55526
56260
|
]
|
|
55527
56261
|
);
|
|
55528
|
-
const cycleApprovalMode = (0,
|
|
56262
|
+
const cycleApprovalMode = (0, import_react59.useCallback)(() => {
|
|
55529
56263
|
const next = nextApprovalMode(config.getApprovalMode());
|
|
55530
56264
|
try {
|
|
55531
56265
|
config.setApprovalMode(next);
|
|
@@ -55541,12 +56275,12 @@ function OpenTuiApp(props) {
|
|
|
55541
56275
|
key.preventDefault();
|
|
55542
56276
|
cycleApprovalMode();
|
|
55543
56277
|
});
|
|
55544
|
-
(0,
|
|
56278
|
+
(0, import_react59.useEffect)(() => {
|
|
55545
56279
|
if (approvalMode === "auto" /* AUTO */) {
|
|
55546
56280
|
emitAutoModeEntryNotices({ config, settings, addItem: addInfoItem });
|
|
55547
56281
|
}
|
|
55548
56282
|
}, []);
|
|
55549
|
-
const runShellCommand = (0,
|
|
56283
|
+
const runShellCommand = (0, import_react59.useCallback)(
|
|
55550
56284
|
(command) => {
|
|
55551
56285
|
const emit = props.onTranscriptEvent;
|
|
55552
56286
|
if (!emit) return;
|
|
@@ -55577,7 +56311,7 @@ function OpenTuiApp(props) {
|
|
|
55577
56311
|
},
|
|
55578
56312
|
[config, props.onTranscriptEvent, terminalWidth, terminalHeight]
|
|
55579
56313
|
);
|
|
55580
|
-
(0,
|
|
56314
|
+
(0, import_react59.useEffect)(
|
|
55581
56315
|
() => () => {
|
|
55582
56316
|
for (const controller of shellControllersRef.current) {
|
|
55583
56317
|
controller.abort();
|
|
@@ -55585,7 +56319,7 @@ function OpenTuiApp(props) {
|
|
|
55585
56319
|
},
|
|
55586
56320
|
[]
|
|
55587
56321
|
);
|
|
55588
|
-
const handleSelectSetting = (0,
|
|
56322
|
+
const handleSelectSetting = (0, import_react59.useCallback)((name) => {
|
|
55589
56323
|
if (name === "ui.theme") setDialog({ dialog: "theme" });
|
|
55590
56324
|
else if (name === "general.preferredEditor")
|
|
55591
56325
|
setDialog({ dialog: "editor" });
|
|
@@ -55594,15 +56328,15 @@ function OpenTuiApp(props) {
|
|
|
55594
56328
|
setDialog({ dialog: "model", mode: "vision" });
|
|
55595
56329
|
else setDialog(null);
|
|
55596
56330
|
}, []);
|
|
55597
|
-
const fillComposer = (0,
|
|
56331
|
+
const fillComposer = (0, import_react59.useCallback)(
|
|
55598
56332
|
(text) => {
|
|
55599
56333
|
injectCapturedInput(() => props.composerHandle?.current ?? null, text);
|
|
55600
56334
|
},
|
|
55601
56335
|
[props.composerHandle]
|
|
55602
56336
|
);
|
|
55603
|
-
const [modals, setModals] = (0,
|
|
55604
|
-
const modalSeq = (0,
|
|
55605
|
-
const confirmations = (0,
|
|
56337
|
+
const [modals, setModals] = (0, import_react59.useState)([]);
|
|
56338
|
+
const modalSeq = (0, import_react59.useRef)(0);
|
|
56339
|
+
const confirmations = (0, import_react59.useMemo)(
|
|
55606
56340
|
() => ({
|
|
55607
56341
|
presentShell: /* @__PURE__ */ __name((commandsToRun) => new Promise((resolve4) => {
|
|
55608
56342
|
modalSeq.current += 1;
|
|
@@ -55627,14 +56361,14 @@ function OpenTuiApp(props) {
|
|
|
55627
56361
|
[]
|
|
55628
56362
|
);
|
|
55629
56363
|
const activeModal = modals[0] ?? null;
|
|
55630
|
-
const closeShellModal = (0,
|
|
56364
|
+
const closeShellModal = (0, import_react59.useCallback)(
|
|
55631
56365
|
(modal, resolution) => {
|
|
55632
56366
|
setModals((prev) => prev.filter((m3) => m3.id !== modal.id));
|
|
55633
56367
|
modal.resolve(resolution);
|
|
55634
56368
|
},
|
|
55635
56369
|
[]
|
|
55636
56370
|
);
|
|
55637
|
-
const closeActionModal = (0,
|
|
56371
|
+
const closeActionModal = (0, import_react59.useCallback)(
|
|
55638
56372
|
(modal, confirmed) => {
|
|
55639
56373
|
setModals((prev) => prev.filter((m3) => m3.id !== modal.id));
|
|
55640
56374
|
modal.resolve(confirmed);
|
|
@@ -55643,8 +56377,8 @@ function OpenTuiApp(props) {
|
|
|
55643
56377
|
);
|
|
55644
56378
|
const activeToolCall = waitingToolCalls?.[0] ?? null;
|
|
55645
56379
|
const mcpApproval = useMcpApproval(config);
|
|
55646
|
-
const contextFilesAnnouncedRef = (0,
|
|
55647
|
-
const transcript = (0,
|
|
56380
|
+
const contextFilesAnnouncedRef = (0, import_react59.useRef)(false);
|
|
56381
|
+
const transcript = (0, import_react59.useMemo)(() => {
|
|
55648
56382
|
const reset = /* @__PURE__ */ __name((events) => {
|
|
55649
56383
|
contextFilesAnnouncedRef.current = false;
|
|
55650
56384
|
onTranscriptReset?.(events);
|
|
@@ -55657,7 +56391,7 @@ function OpenTuiApp(props) {
|
|
|
55657
56391
|
append: /* @__PURE__ */ __name((event) => onTranscriptEvent?.(event), "append")
|
|
55658
56392
|
};
|
|
55659
56393
|
}, [onTranscriptReset, onTranscriptEvent]);
|
|
55660
|
-
const host = (0,
|
|
56394
|
+
const host = (0, import_react59.useMemo)(
|
|
55661
56395
|
() => new OpenTuiAppHost({
|
|
55662
56396
|
config,
|
|
55663
56397
|
settings,
|
|
@@ -55686,27 +56420,27 @@ function OpenTuiApp(props) {
|
|
|
55686
56420
|
getSessionStats
|
|
55687
56421
|
]
|
|
55688
56422
|
);
|
|
55689
|
-
(0,
|
|
55690
|
-
(0,
|
|
55691
|
-
(0,
|
|
56423
|
+
(0, import_react59.useSyncExternalStore)(
|
|
56424
|
+
(0, import_react59.useCallback)((cb) => host.subscribe(cb), [host]),
|
|
56425
|
+
(0, import_react59.useCallback)(() => host.getVersion(), [host])
|
|
55692
56426
|
);
|
|
55693
|
-
(0,
|
|
56427
|
+
(0, import_react59.useEffect)(() => {
|
|
55694
56428
|
host.setStreaming(!!streaming);
|
|
55695
56429
|
}, [host, streaming]);
|
|
55696
|
-
const gateway = (0,
|
|
55697
|
-
const reloadRef = (0,
|
|
55698
|
-
const deferredCommandsRef = (0,
|
|
55699
|
-
const [deferredRevision, setDeferredRevision] = (0,
|
|
55700
|
-
const drainingRef = (0,
|
|
55701
|
-
const streamingRef = (0,
|
|
55702
|
-
(0,
|
|
56430
|
+
const gateway = (0, import_react59.useMemo)(() => new OpenTuiSlashGateway(), []);
|
|
56431
|
+
const reloadRef = (0, import_react59.useRef)(null);
|
|
56432
|
+
const deferredCommandsRef = (0, import_react59.useRef)([]);
|
|
56433
|
+
const [deferredRevision, setDeferredRevision] = (0, import_react59.useState)(0);
|
|
56434
|
+
const drainingRef = (0, import_react59.useRef)(false);
|
|
56435
|
+
const streamingRef = (0, import_react59.useRef)(streaming);
|
|
56436
|
+
(0, import_react59.useEffect)(() => {
|
|
55703
56437
|
streamingRef.current = streaming;
|
|
55704
56438
|
}, [streaming]);
|
|
55705
|
-
const dialogRef = (0,
|
|
55706
|
-
(0,
|
|
56439
|
+
const dialogRef = (0, import_react59.useRef)(dialog);
|
|
56440
|
+
(0, import_react59.useEffect)(() => {
|
|
55707
56441
|
dialogRef.current = dialog;
|
|
55708
56442
|
}, [dialog]);
|
|
55709
|
-
(0,
|
|
56443
|
+
(0, import_react59.useEffect)(() => {
|
|
55710
56444
|
const dispatcher = new OpenTuiSlashDispatcher(
|
|
55711
56445
|
host,
|
|
55712
56446
|
{ config, settings, logger, extensionRefreshState },
|
|
@@ -55741,7 +56475,7 @@ function OpenTuiApp(props) {
|
|
|
55741
56475
|
commands,
|
|
55742
56476
|
extensionRefreshState
|
|
55743
56477
|
]);
|
|
55744
|
-
const applyOutcome = (0,
|
|
56478
|
+
const applyOutcome = (0, import_react59.useCallback)(
|
|
55745
56479
|
(outcome) => {
|
|
55746
56480
|
switch (outcome.kind) {
|
|
55747
56481
|
case "handled":
|
|
@@ -55779,7 +56513,7 @@ function OpenTuiApp(props) {
|
|
|
55779
56513
|
},
|
|
55780
56514
|
[onSubmitPrompt, onQuit, onInterrupt, onPopQueue, notify]
|
|
55781
56515
|
);
|
|
55782
|
-
const onSubmit = (0,
|
|
56516
|
+
const onSubmit = (0, import_react59.useCallback)(
|
|
55783
56517
|
async (text, imagePaths) => {
|
|
55784
56518
|
setNoticeText(null);
|
|
55785
56519
|
const submission = normalizeQuitSubmission(text);
|
|
@@ -55853,7 +56587,7 @@ function OpenTuiApp(props) {
|
|
|
55853
56587
|
addInfoItem
|
|
55854
56588
|
]
|
|
55855
56589
|
);
|
|
55856
|
-
(0,
|
|
56590
|
+
(0, import_react59.useEffect)(() => {
|
|
55857
56591
|
if (isExitInProgress()) return;
|
|
55858
56592
|
if (streaming || dialog || shellControllersRef.current.size > 0 || deferredCommandsRef.current.length === 0) {
|
|
55859
56593
|
return;
|
|
@@ -55920,138 +56654,166 @@ function OpenTuiApp(props) {
|
|
|
55920
56654
|
onSubmitPrompt,
|
|
55921
56655
|
runShellCommand
|
|
55922
56656
|
]);
|
|
55923
|
-
const userMessages = (0,
|
|
56657
|
+
const userMessages = (0, import_react59.useMemo)(
|
|
55924
56658
|
() => host.getHistory().filter((item) => item.type === "user").map((item) => item.text ?? ""),
|
|
55925
56659
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55926
56660
|
[host, host.getVersion()]
|
|
55927
56661
|
);
|
|
56662
|
+
const showLoadingPhrases = config.getAccessibility()?.enableLoadingPhrases !== false;
|
|
55928
56663
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55929
56664
|
OpenTuiErrorBoundary,
|
|
55930
56665
|
{
|
|
55931
56666
|
recordForExitEcho: true,
|
|
55932
56667
|
onError: (error) => onRenderError?.(error),
|
|
55933
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column",
|
|
55934
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
55935
|
-
|
|
55936
|
-
!dialog && !activeModal && !activeToolCall && !mcpApproval.isMcpApprovalDialogOpen && updateNotice ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { children: updateNotice }) : null,
|
|
55937
|
-
noticeText ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { children: noticeText }) : null,
|
|
55938
|
-
mcpApproval.isMcpApprovalDialogOpen && mcpApproval.currentMcpApproval ? (
|
|
55939
|
-
// ink ranks the gated-server approval above both the shell and the
|
|
55940
|
-
// tool confirmation, so it takes the slot outright.
|
|
55941
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55942
|
-
OpenTuiMcpApprovalDialog,
|
|
55943
|
-
{
|
|
55944
|
-
server: mcpApproval.currentMcpApproval,
|
|
55945
|
-
pendingServers: mcpApproval.pendingMcpApprovals,
|
|
55946
|
-
remaining: mcpApproval.mcpApprovalRemaining,
|
|
55947
|
-
onSelect: mcpApproval.handleMcpApprovalSelect
|
|
55948
|
-
},
|
|
55949
|
-
`mcp-${mcpApproval.currentMcpApproval.name}`
|
|
55950
|
-
)
|
|
55951
|
-
) : activeToolCall ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55952
|
-
OpenTuiToolConfirmation,
|
|
55953
|
-
{
|
|
55954
|
-
call: activeToolCall,
|
|
55955
|
-
config,
|
|
55956
|
-
onSettled: () => onToolCallSettled?.(activeToolCall.callId)
|
|
55957
|
-
},
|
|
55958
|
-
activeToolCall.callId
|
|
55959
|
-
) : activeModal ? activeModal.kind === "shell" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55960
|
-
OpenTuiShellConfirmation,
|
|
55961
|
-
{
|
|
55962
|
-
commands: activeModal.commands,
|
|
55963
|
-
onResolve: (resolution) => closeShellModal(activeModal, resolution)
|
|
55964
|
-
},
|
|
55965
|
-
`shell-${activeModal.id}`
|
|
55966
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55967
|
-
OpenTuiActionConfirmation,
|
|
56668
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", height: terminalHeight, flexShrink: 0, children: [
|
|
56669
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
56670
|
+
"scrollbox",
|
|
55968
56671
|
{
|
|
55969
|
-
|
|
55970
|
-
|
|
55971
|
-
|
|
55972
|
-
|
|
55973
|
-
|
|
55974
|
-
|
|
55975
|
-
|
|
55976
|
-
|
|
55977
|
-
|
|
55978
|
-
|
|
55979
|
-
|
|
55980
|
-
|
|
55981
|
-
|
|
55982
|
-
|
|
55983
|
-
|
|
55984
|
-
|
|
55985
|
-
|
|
56672
|
+
flexGrow: 1,
|
|
56673
|
+
flexShrink: 1,
|
|
56674
|
+
minHeight: 0,
|
|
56675
|
+
stickyScroll: true,
|
|
56676
|
+
stickyStart: "bottom",
|
|
56677
|
+
focusable: false,
|
|
56678
|
+
children: [
|
|
56679
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(OpenTuiBanner, { config, settings }),
|
|
56680
|
+
renderMain ? renderMain() : null,
|
|
56681
|
+
!dialog && !activeModal && !activeToolCall && !mcpApproval.isMcpApprovalDialogOpen && updateNotice ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { children: updateNotice }) : null,
|
|
56682
|
+
noticeText ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { children: noticeText }) : null
|
|
56683
|
+
]
|
|
56684
|
+
}
|
|
56685
|
+
),
|
|
56686
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", flexShrink: 0, children: [
|
|
56687
|
+
mcpApproval.isMcpApprovalDialogOpen && mcpApproval.currentMcpApproval ? (
|
|
56688
|
+
// ink ranks the gated-server approval above both the shell and the
|
|
56689
|
+
// tool confirmation, so it takes the slot outright.
|
|
56690
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56691
|
+
OpenTuiMcpApprovalDialog,
|
|
56692
|
+
{
|
|
56693
|
+
server: mcpApproval.currentMcpApproval,
|
|
56694
|
+
pendingServers: mcpApproval.pendingMcpApprovals,
|
|
56695
|
+
remaining: mcpApproval.mcpApprovalRemaining,
|
|
56696
|
+
onSelect: mcpApproval.handleMcpApprovalSelect
|
|
56697
|
+
},
|
|
56698
|
+
`mcp-${mcpApproval.currentMcpApproval.name}`
|
|
56699
|
+
)
|
|
56700
|
+
) : activeToolCall ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", children: [
|
|
56701
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56702
|
+
OpenTuiToolConfirmation,
|
|
56703
|
+
{
|
|
56704
|
+
call: activeToolCall,
|
|
56705
|
+
config,
|
|
56706
|
+
onSettled: () => onToolCallSettled?.(activeToolCall.callId)
|
|
56707
|
+
},
|
|
56708
|
+
activeToolCall.callId
|
|
56709
|
+
),
|
|
56710
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56711
|
+
OpenTuiLoadingIndicator,
|
|
56712
|
+
{
|
|
56713
|
+
streaming: Boolean(streaming),
|
|
56714
|
+
waiting: true,
|
|
56715
|
+
showPhrase: showLoadingPhrases
|
|
56716
|
+
}
|
|
56717
|
+
) })
|
|
56718
|
+
] }, "tool-confirm-area") : activeModal ? activeModal.kind === "shell" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56719
|
+
OpenTuiShellConfirmation,
|
|
55986
56720
|
{
|
|
55987
|
-
|
|
55988
|
-
|
|
55989
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55990
|
-
OpenTuiDialogMount,
|
|
55991
|
-
{
|
|
55992
|
-
request: dialog,
|
|
55993
|
-
host,
|
|
55994
|
-
config,
|
|
55995
|
-
settings,
|
|
55996
|
-
commands: commandList,
|
|
55997
|
-
onClose: () => setDialog(null),
|
|
55998
|
-
notify,
|
|
55999
|
-
fillInput: fillComposer,
|
|
56000
|
-
onSelectSetting: handleSelectSetting,
|
|
56001
|
-
onApprovalModeChanged: adoptApprovalMode,
|
|
56002
|
-
availableTerminalHeight: props.availableTerminalHeight
|
|
56003
|
-
},
|
|
56004
|
-
dialog.dialog
|
|
56005
|
-
)
|
|
56721
|
+
commands: activeModal.commands,
|
|
56722
|
+
onResolve: (resolution) => closeShellModal(activeModal, resolution)
|
|
56006
56723
|
},
|
|
56007
|
-
|
|
56008
|
-
)
|
|
56009
|
-
|
|
56010
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56011
|
-
OpenTuiLoadingIndicator,
|
|
56724
|
+
`shell-${activeModal.id}`
|
|
56725
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56726
|
+
OpenTuiActionConfirmation,
|
|
56012
56727
|
{
|
|
56013
|
-
|
|
56014
|
-
|
|
56015
|
-
|
|
56016
|
-
}
|
|
56017
|
-
)
|
|
56018
|
-
|
|
56019
|
-
|
|
56020
|
-
|
|
56021
|
-
|
|
56022
|
-
|
|
56728
|
+
prompt: activeModal.prompt,
|
|
56729
|
+
onResolve: (confirmed) => closeActionModal(activeModal, confirmed)
|
|
56730
|
+
},
|
|
56731
|
+
`action-${activeModal.id}`
|
|
56732
|
+
) : dialog ? (
|
|
56733
|
+
// ink's layout wraps every popup in a two-column margin and caps its
|
|
56734
|
+
// width, so a dialog's border runs from column 2 to column 97 instead
|
|
56735
|
+
// of spanning the terminal. The confirmations stay outside: their
|
|
56736
|
+
// body reads the terminal width to estimate line wrapping.
|
|
56737
|
+
//
|
|
56738
|
+
// The keys on this branch and the composer's are load-bearing: both
|
|
56739
|
+
// are a `<box>` in the same slot, so without them React reuses one
|
|
56740
|
+
// instance and diffs props — and @opentui's margin/width setters
|
|
56741
|
+
// ignore the `null` its reconciler passes for a removed prop, leaving
|
|
56742
|
+
// the previous branch's layout stuck on the node.
|
|
56743
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56744
|
+
"box",
|
|
56745
|
+
{
|
|
56746
|
+
marginLeft: 2,
|
|
56747
|
+
width: dialogAreaWidth(terminalWidth),
|
|
56748
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56749
|
+
OpenTuiDialogMount,
|
|
56750
|
+
{
|
|
56751
|
+
request: dialog,
|
|
56752
|
+
host,
|
|
56753
|
+
config,
|
|
56754
|
+
settings,
|
|
56755
|
+
commands: commandList,
|
|
56756
|
+
onClose: () => setDialog(null),
|
|
56757
|
+
notify,
|
|
56758
|
+
fillInput: fillComposer,
|
|
56759
|
+
onSelectSetting: handleSelectSetting,
|
|
56760
|
+
onApprovalModeChanged: adoptApprovalMode,
|
|
56761
|
+
availableTerminalHeight: props.availableTerminalHeight
|
|
56762
|
+
},
|
|
56763
|
+
dialog.dialog
|
|
56764
|
+
)
|
|
56023
56765
|
},
|
|
56024
|
-
|
|
56766
|
+
"dialog-area"
|
|
56767
|
+
)
|
|
56768
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", marginTop: 1, children: [
|
|
56769
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56770
|
+
OpenTuiLoadingIndicator,
|
|
56771
|
+
{
|
|
56772
|
+
streaming: Boolean(streaming),
|
|
56773
|
+
streamingCharsRef,
|
|
56774
|
+
isReceivingContent,
|
|
56775
|
+
showPhrase: showLoadingPhrases
|
|
56776
|
+
}
|
|
56777
|
+
),
|
|
56778
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(OpenTuiQueuedMessageDisplay, { messageQueue: messageQueue ?? [] }),
|
|
56779
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56780
|
+
OpenTuiInputPrompt,
|
|
56781
|
+
{
|
|
56782
|
+
onSubmit: (text, imagePaths) => {
|
|
56783
|
+
void onSubmit(text, imagePaths);
|
|
56784
|
+
},
|
|
56785
|
+
userMessages,
|
|
56786
|
+
config,
|
|
56787
|
+
focus: true,
|
|
56788
|
+
streaming,
|
|
56789
|
+
onInterrupt,
|
|
56790
|
+
approvalMode: currentApprovalMode,
|
|
56791
|
+
queueLength,
|
|
56792
|
+
onPopQueue,
|
|
56793
|
+
composerHandle: props.composerHandle,
|
|
56794
|
+
promptSuggestion,
|
|
56795
|
+
onPromptSuggestionDismiss,
|
|
56796
|
+
onPromptSuggestionAbort,
|
|
56797
|
+
shellModeActive,
|
|
56798
|
+
onToggleShellMode: toggleShellMode,
|
|
56799
|
+
onSuggestionsVisibilityChange,
|
|
56800
|
+
onCycleApprovalMode: cycleApprovalMode
|
|
56801
|
+
}
|
|
56802
|
+
)
|
|
56803
|
+
] }, "composer"),
|
|
56804
|
+
exitHint || !dialog && !activeModal && !activeToolCall && !mcpApproval.isMcpApprovalDialogOpen && !showSuggestions ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56805
|
+
OpenTuiFooter,
|
|
56806
|
+
{
|
|
56025
56807
|
config,
|
|
56026
|
-
|
|
56027
|
-
streaming,
|
|
56028
|
-
onInterrupt,
|
|
56808
|
+
streaming: Boolean(streaming),
|
|
56029
56809
|
approvalMode: currentApprovalMode,
|
|
56030
56810
|
queueLength,
|
|
56031
|
-
|
|
56032
|
-
composerHandle: props.composerHandle,
|
|
56033
|
-
promptSuggestion,
|
|
56034
|
-
onPromptSuggestionDismiss,
|
|
56035
|
-
onPromptSuggestionAbort,
|
|
56811
|
+
sessionName: host.sessionName,
|
|
56036
56812
|
shellModeActive,
|
|
56037
|
-
|
|
56038
|
-
onSuggestionsVisibilityChange,
|
|
56039
|
-
onCycleApprovalMode: cycleApprovalMode
|
|
56813
|
+
exitHint
|
|
56040
56814
|
}
|
|
56041
|
-
)
|
|
56042
|
-
] }
|
|
56043
|
-
exitHint || !dialog && !activeModal && !activeToolCall && !showSuggestions ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56044
|
-
OpenTuiFooter,
|
|
56045
|
-
{
|
|
56046
|
-
config,
|
|
56047
|
-
streaming: Boolean(streaming),
|
|
56048
|
-
approvalMode: currentApprovalMode,
|
|
56049
|
-
queueLength,
|
|
56050
|
-
sessionName: host.sessionName,
|
|
56051
|
-
shellModeActive,
|
|
56052
|
-
exitHint
|
|
56053
|
-
}
|
|
56054
|
-
) : null
|
|
56815
|
+
) : null
|
|
56816
|
+
] })
|
|
56055
56817
|
] })
|
|
56056
56818
|
}
|
|
56057
56819
|
);
|
|
@@ -56060,7 +56822,7 @@ __name(OpenTuiApp, "OpenTuiApp");
|
|
|
56060
56822
|
|
|
56061
56823
|
// packages/cli/src/ui/opentui/followup-generation.ts
|
|
56062
56824
|
init_esbuild_shims();
|
|
56063
|
-
var
|
|
56825
|
+
var import_react61 = __toESM(require_react(), 1);
|
|
56064
56826
|
function useFollowupSuggestionGeneration({
|
|
56065
56827
|
config,
|
|
56066
56828
|
settings,
|
|
@@ -56068,12 +56830,12 @@ function useFollowupSuggestionGeneration({
|
|
|
56068
56830
|
items,
|
|
56069
56831
|
waitingCalls
|
|
56070
56832
|
}) {
|
|
56071
|
-
const [promptSuggestion, setPromptSuggestion] = (0,
|
|
56072
|
-
const abortRef = (0,
|
|
56073
|
-
const streamingRef = (0,
|
|
56833
|
+
const [promptSuggestion, setPromptSuggestion] = (0, import_react61.useState)(null);
|
|
56834
|
+
const abortRef = (0, import_react61.useRef)(null);
|
|
56835
|
+
const streamingRef = (0, import_react61.useRef)(streaming);
|
|
56074
56836
|
const followupEnabled = settings.merged.ui?.enableFollowupSuggestions !== false;
|
|
56075
56837
|
const cacheSharingEnabled = settings.merged.ui?.enableCacheSharing !== false;
|
|
56076
|
-
(0,
|
|
56838
|
+
(0, import_react61.useEffect)(() => {
|
|
56077
56839
|
const wasStreaming = streamingRef.current;
|
|
56078
56840
|
if (!followupEnabled || wasStreaming !== streaming) {
|
|
56079
56841
|
abortRef.current?.abort();
|
|
@@ -56110,7 +56872,7 @@ function useFollowupSuggestionGeneration({
|
|
|
56110
56872
|
items,
|
|
56111
56873
|
waitingCalls
|
|
56112
56874
|
]);
|
|
56113
|
-
(0,
|
|
56875
|
+
(0, import_react61.useEffect)(
|
|
56114
56876
|
() => () => {
|
|
56115
56877
|
abortRef.current?.abort();
|
|
56116
56878
|
},
|
|
@@ -56262,7 +57024,7 @@ var OpenTuiRuntime = class _OpenTuiRuntime {
|
|
|
56262
57024
|
|
|
56263
57025
|
// packages/cli/src/ui/opentui/transcript-view.tsx
|
|
56264
57026
|
init_esbuild_shims();
|
|
56265
|
-
var
|
|
57027
|
+
var import_react62 = __toESM(require_react(), 1);
|
|
56266
57028
|
|
|
56267
57029
|
// packages/cli/src/ui/opentui/live-session-model.ts
|
|
56268
57030
|
init_esbuild_shims();
|
|
@@ -56372,13 +57134,14 @@ function foldLiveEvent(prev, ev) {
|
|
|
56372
57134
|
const i = findToolIndex(items, ev.id);
|
|
56373
57135
|
if (i >= 0) {
|
|
56374
57136
|
const t3 = items[i];
|
|
57137
|
+
const structured = ev.type === "tool-result" ? ev : void 0;
|
|
56375
57138
|
const next = {
|
|
56376
57139
|
...t3,
|
|
56377
|
-
output: ev.type === "tool-output" ? ev.output : ev.display
|
|
57140
|
+
output: ev.type === "tool-output" ? ev.output : ev.display,
|
|
57141
|
+
diff: structured?.diff,
|
|
57142
|
+
todos: structured?.todos,
|
|
57143
|
+
ansi: structured?.ansi
|
|
56378
57144
|
};
|
|
56379
|
-
if (ev.type === "tool-result" && ev.diff) next.diff = ev.diff;
|
|
56380
|
-
if (ev.type === "tool-result" && ev.todos) next.todos = ev.todos;
|
|
56381
|
-
if (ev.type === "tool-result" && ev.ansi) next.ansi = ev.ansi;
|
|
56382
57145
|
if (ev.type === "tool-result" && ev.visionBridgeNotice) {
|
|
56383
57146
|
next.visionBridgeNotice = ev.visionBridgeNotice;
|
|
56384
57147
|
}
|
|
@@ -56429,6 +57192,14 @@ function foldLiveEvent(prev, ev) {
|
|
|
56429
57192
|
}
|
|
56430
57193
|
return items;
|
|
56431
57194
|
}
|
|
57195
|
+
case "tool-queued": {
|
|
57196
|
+
const i = findToolIndex(items, ev.id);
|
|
57197
|
+
if (i >= 0) {
|
|
57198
|
+
const t3 = items[i];
|
|
57199
|
+
items[i] = { ...t3, queued: ev.queued };
|
|
57200
|
+
}
|
|
57201
|
+
return items;
|
|
57202
|
+
}
|
|
56432
57203
|
case "task-start":
|
|
56433
57204
|
if (last?.kind === "assistant" && last.streaming)
|
|
56434
57205
|
items[items.length - 1] = { ...last, streaming: false };
|
|
@@ -56706,11 +57477,19 @@ function describeGoalCard(snapshot, cause) {
|
|
|
56706
57477
|
if (!lifecycle) return { state: "hidden" };
|
|
56707
57478
|
const stats = [];
|
|
56708
57479
|
const turnCount = goal.turnCount ?? 0;
|
|
56709
|
-
if (turnCount > 0)
|
|
56710
|
-
|
|
57480
|
+
if (turnCount > 0) {
|
|
57481
|
+
const turns = goal.turnBudget ?? turnCount;
|
|
57482
|
+
stats.push(
|
|
57483
|
+
`${turnCount}${goal.turnBudget === void 0 ? "" : `/${goal.turnBudget}`} ${turns === 1 ? "turn" : "turns"}`
|
|
57484
|
+
);
|
|
57485
|
+
}
|
|
56711
57486
|
const activeTimeMs = goal.activeTimeMs ?? 0;
|
|
56712
|
-
if (activeTimeMs > 0)
|
|
56713
|
-
|
|
57487
|
+
if (activeTimeMs > 0) {
|
|
57488
|
+
const used = formatDuration(activeTimeMs, { hideTrailingZeros: true });
|
|
57489
|
+
stats.push(
|
|
57490
|
+
goal.activeTimeBudgetMs === void 0 ? used : `${used}/${formatDuration(goal.activeTimeBudgetMs, { hideTrailingZeros: true })}`
|
|
57491
|
+
);
|
|
57492
|
+
}
|
|
56714
57493
|
const tokensUsed = goal.tokensUsed ?? 0;
|
|
56715
57494
|
if (tokensUsed > 0) {
|
|
56716
57495
|
const used = formatTokenCount2(tokensUsed);
|
|
@@ -56719,8 +57498,6 @@ function describeGoalCard(snapshot, cause) {
|
|
|
56719
57498
|
);
|
|
56720
57499
|
}
|
|
56721
57500
|
const reason = (goal.status ?? "active") !== "active" || activity === "verifying" ? goal.lastReason?.trim() : void 0;
|
|
56722
|
-
const checkpointLine = goalCheckpointHealthLine(goal);
|
|
56723
|
-
const checkpoint = checkpointLine === void 0 ? void 0 : `Checkpoint: ${checkpointLine}`;
|
|
56724
57501
|
return {
|
|
56725
57502
|
state: "card",
|
|
56726
57503
|
icon: lifecycle.icon,
|
|
@@ -56728,8 +57505,7 @@ function describeGoalCard(snapshot, cause) {
|
|
|
56728
57505
|
title: lifecycle.title,
|
|
56729
57506
|
subtitle: stats.length > 0 ? stats.join(" \xB7 ") : null,
|
|
56730
57507
|
objective: goal.objective ?? "",
|
|
56731
|
-
reason
|
|
56732
|
-
...checkpoint ? { checkpoint } : {}
|
|
57508
|
+
reason
|
|
56733
57509
|
};
|
|
56734
57510
|
}
|
|
56735
57511
|
__name(describeGoalCard, "describeGoalCard");
|
|
@@ -57365,9 +58141,14 @@ function OpenTuiTranscriptView({
|
|
|
57365
58141
|
items,
|
|
57366
58142
|
availableWidth = 80,
|
|
57367
58143
|
availableTerminalHeight = 24,
|
|
57368
|
-
thoughtsExpanded = false
|
|
58144
|
+
thoughtsExpanded = false,
|
|
58145
|
+
showToolCallArgs = false,
|
|
58146
|
+
awaitingCallId
|
|
57369
58147
|
}) {
|
|
57370
58148
|
const maxRows = maxHistoryItemRows(availableTerminalHeight);
|
|
58149
|
+
const awaitingId = items.find(
|
|
58150
|
+
(item) => item.kind === "tool" && item.confirm === "pending" && !item.done && item.id === awaitingCallId
|
|
58151
|
+
)?.id;
|
|
57371
58152
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { flexDirection: "column", marginLeft: 2, marginRight: 2, children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57372
58153
|
"box",
|
|
57373
58154
|
{
|
|
@@ -57380,7 +58161,9 @@ function OpenTuiTranscriptView({
|
|
|
57380
58161
|
maxRows,
|
|
57381
58162
|
terminalHeight: availableTerminalHeight,
|
|
57382
58163
|
width: availableWidth,
|
|
57383
|
-
thoughtsExpanded
|
|
58164
|
+
thoughtsExpanded,
|
|
58165
|
+
showToolCallArgs,
|
|
58166
|
+
awaitingApproval: item.id === awaitingId
|
|
57384
58167
|
}
|
|
57385
58168
|
)
|
|
57386
58169
|
},
|
|
@@ -57393,7 +58176,9 @@ function TranscriptItem({
|
|
|
57393
58176
|
maxRows,
|
|
57394
58177
|
terminalHeight,
|
|
57395
58178
|
width,
|
|
57396
|
-
thoughtsExpanded
|
|
58179
|
+
thoughtsExpanded,
|
|
58180
|
+
showToolCallArgs,
|
|
58181
|
+
awaitingApproval
|
|
57397
58182
|
}) {
|
|
57398
58183
|
switch (item.kind) {
|
|
57399
58184
|
case "user":
|
|
@@ -57409,7 +58194,10 @@ function TranscriptItem({
|
|
|
57409
58194
|
item,
|
|
57410
58195
|
maxRows,
|
|
57411
58196
|
terminalHeight,
|
|
57412
|
-
width
|
|
58197
|
+
width,
|
|
58198
|
+
fullDetail: thoughtsExpanded,
|
|
58199
|
+
showToolCallArgs,
|
|
58200
|
+
awaitingApproval
|
|
57413
58201
|
}
|
|
57414
58202
|
);
|
|
57415
58203
|
case "task":
|
|
@@ -57495,7 +58283,7 @@ function ThinkingRow({
|
|
|
57495
58283
|
item,
|
|
57496
58284
|
allExpanded
|
|
57497
58285
|
}) {
|
|
57498
|
-
const [clickedOpen, setClickedOpen] = (0,
|
|
58286
|
+
const [clickedOpen, setClickedOpen] = (0, import_react62.useState)(false);
|
|
57499
58287
|
const expanded = allExpanded || clickedOpen;
|
|
57500
58288
|
const meta = thinkingMeta(item.done, expanded, false, item.durationMs);
|
|
57501
58289
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
@@ -57522,7 +58310,10 @@ function ToolCard({
|
|
|
57522
58310
|
item,
|
|
57523
58311
|
maxRows,
|
|
57524
58312
|
terminalHeight,
|
|
57525
|
-
width
|
|
58313
|
+
width,
|
|
58314
|
+
fullDetail,
|
|
58315
|
+
showToolCallArgs,
|
|
58316
|
+
awaitingApproval
|
|
57526
58317
|
}) {
|
|
57527
58318
|
const status = toolStatusMeta(item);
|
|
57528
58319
|
const name = toolCardName(item.tool);
|
|
@@ -57535,6 +58326,13 @@ function ToolCard({
|
|
|
57535
58326
|
item.confirm === "pending" && !item.done ? pendingCardMaxRows(terminalHeight, getCachedStringWidth(text), width) : TOOL_CARD_DESCRIPTION_ROWS
|
|
57536
58327
|
);
|
|
57537
58328
|
const suffix2 = toolCardSummarySuffix(item.done, item.summary);
|
|
58329
|
+
const innerWidth = width - STATUS_INDICATOR_WIDTH;
|
|
58330
|
+
const argsRow = showToolCallArgs && item.args ? formatInlineToolArgsJson(
|
|
58331
|
+
item.args,
|
|
58332
|
+
description,
|
|
58333
|
+
fullDetail,
|
|
58334
|
+
innerWidth > 0 ? innerWidth : void 0
|
|
58335
|
+
) : void 0;
|
|
57538
58336
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "column", children: [
|
|
57539
58337
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("box", { flexDirection: "row", children: [
|
|
57540
58338
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { width: STATUS_INDICATOR_WIDTH, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -57547,10 +58345,15 @@ function ToolCard({
|
|
|
57547
58345
|
) }),
|
|
57548
58346
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, attributes: status.strikethrough ? 129 : 1, children: name }),
|
|
57549
58347
|
cap.description ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, ...selectionProps(), children: ` ${sanitizeTerminalText(cap.description)}` }) : null,
|
|
57550
|
-
suffix2 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: sanitizeTerminalText(suffix2) }) : null
|
|
58348
|
+
suffix2 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: sanitizeTerminalText(suffix2) }) : null,
|
|
58349
|
+
awaitingApproval ? (
|
|
58350
|
+
// ink's TrailingIndicator: a primary-coloured arrow at the end of the
|
|
58351
|
+
// awaiting call's own row, not a row of its own.
|
|
58352
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, children: " \u2190" })
|
|
58353
|
+
) : null
|
|
57551
58354
|
] }),
|
|
57552
58355
|
cap.hiddenRows > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: hiddenTailLinesLabel(cap.hiddenRows) }),
|
|
57553
|
-
|
|
58356
|
+
argsRow ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { paddingLeft: STATUS_INDICATOR_WIDTH, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, ...selectionProps(), children: argsRow }) }) : null,
|
|
57554
58357
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolCardBody, { item, maxRows, width })
|
|
57555
58358
|
] });
|
|
57556
58359
|
}
|
|
@@ -57647,8 +58450,8 @@ function RetryRows({
|
|
|
57647
58450
|
delayMs,
|
|
57648
58451
|
startedAt
|
|
57649
58452
|
}) {
|
|
57650
|
-
const [now, setNow] = (0,
|
|
57651
|
-
(0,
|
|
58453
|
+
const [now, setNow] = (0, import_react62.useState)(() => Date.now());
|
|
58454
|
+
(0, import_react62.useEffect)(() => {
|
|
57652
58455
|
const timer = setInterval(() => setNow(Date.now()), 1e3);
|
|
57653
58456
|
return () => clearInterval(timer);
|
|
57654
58457
|
}, []);
|
|
@@ -57693,8 +58496,7 @@ function GoalCard({
|
|
|
57693
58496
|
view.subtitle ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, children: ` \xB7 ${view.subtitle}` }) : null
|
|
57694
58497
|
] }),
|
|
57695
58498
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.text, ...selectionProps(), children: ` ${sanitizeTerminalText(view.objective)}` }),
|
|
57696
|
-
view.reason ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, ...selectionProps(), children: ` ${sanitizeTerminalText(view.reason)}` }) : null
|
|
57697
|
-
view.checkpoint ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.yellow, ...selectionProps(), children: ` ${sanitizeTerminalText(view.checkpoint)}` }) : null
|
|
58499
|
+
view.reason ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { fg: C2.dim, ...selectionProps(), children: ` ${sanitizeTerminalText(view.reason)}` }) : null
|
|
57698
58500
|
] });
|
|
57699
58501
|
}
|
|
57700
58502
|
__name(GoalCard, "GoalCard");
|
|
@@ -57893,7 +58695,7 @@ __name(ArenaSessionRow, "ArenaSessionRow");
|
|
|
57893
58695
|
|
|
57894
58696
|
// packages/cli/src/ui/opentui/live-turn.ts
|
|
57895
58697
|
init_esbuild_shims();
|
|
57896
|
-
var
|
|
58698
|
+
var import_react63 = __toESM(require_react(), 1);
|
|
57897
58699
|
import { readFileSync } from "node:fs";
|
|
57898
58700
|
var IMAGE_MIME_BY_EXTENSION = {
|
|
57899
58701
|
bmp: "image/bmp",
|
|
@@ -57933,51 +58735,58 @@ function foldBatch(events) {
|
|
|
57933
58735
|
__name(foldBatch, "foldBatch");
|
|
57934
58736
|
function useOpenTuiLiveTurn(options) {
|
|
57935
58737
|
const { config } = options;
|
|
57936
|
-
const [items, setItems] = (0,
|
|
57937
|
-
const [streaming, setStreaming] = (0,
|
|
57938
|
-
const [waitingCalls, setWaitingCalls] = (0,
|
|
58738
|
+
const [items, setItems] = (0, import_react63.useState)([]);
|
|
58739
|
+
const [streaming, setStreaming] = (0, import_react63.useState)(false);
|
|
58740
|
+
const [waitingCalls, setWaitingCalls] = (0, import_react63.useState)(
|
|
57939
58741
|
[]
|
|
57940
58742
|
);
|
|
57941
|
-
const queueRef = (0,
|
|
57942
|
-
const [
|
|
57943
|
-
const
|
|
57944
|
-
const
|
|
57945
|
-
const
|
|
57946
|
-
const
|
|
57947
|
-
const
|
|
57948
|
-
const
|
|
57949
|
-
const
|
|
58743
|
+
const queueRef = (0, import_react63.useRef)([]);
|
|
58744
|
+
const [queue, setQueue] = (0, import_react63.useState)([]);
|
|
58745
|
+
const syncQueue = (0, import_react63.useCallback)(() => setQueue([...queueRef.current]), []);
|
|
58746
|
+
const abortRef = (0, import_react63.useRef)(null);
|
|
58747
|
+
const streamingRef = (0, import_react63.useRef)(false);
|
|
58748
|
+
const streamingCharsRef = (0, import_react63.useRef)(0);
|
|
58749
|
+
const receivingRef = (0, import_react63.useRef)(false);
|
|
58750
|
+
const [isReceivingContent, setIsReceivingContent] = (0, import_react63.useState)(false);
|
|
58751
|
+
const turnSeqRef = (0, import_react63.useRef)(0);
|
|
58752
|
+
const waitingCallsRef = (0, import_react63.useRef)([]);
|
|
57950
58753
|
waitingCallsRef.current = waitingCalls;
|
|
57951
|
-
const setBusy = (0,
|
|
58754
|
+
const setBusy = (0, import_react63.useCallback)((busy) => {
|
|
57952
58755
|
if (streamingRef.current === busy) return;
|
|
57953
58756
|
streamingRef.current = busy;
|
|
57954
58757
|
setStreaming(busy);
|
|
57955
58758
|
}, []);
|
|
57956
|
-
const setReceiving = (0,
|
|
58759
|
+
const setReceiving = (0, import_react63.useCallback)((receiving) => {
|
|
57957
58760
|
if (receivingRef.current === receiving) return;
|
|
57958
58761
|
receivingRef.current = receiving;
|
|
57959
58762
|
setIsReceivingContent(receiving);
|
|
57960
58763
|
}, []);
|
|
57961
|
-
const apply = (0,
|
|
58764
|
+
const apply = (0, import_react63.useCallback)((ev) => {
|
|
57962
58765
|
setItems((prev) => foldLiveEvent(prev, ev));
|
|
57963
58766
|
}, []);
|
|
57964
|
-
const pushQueue = (0,
|
|
57965
|
-
|
|
57966
|
-
|
|
57967
|
-
|
|
57968
|
-
|
|
58767
|
+
const pushQueue = (0, import_react63.useCallback)(
|
|
58768
|
+
(text) => {
|
|
58769
|
+
queueRef.current.push(text);
|
|
58770
|
+
syncQueue();
|
|
58771
|
+
},
|
|
58772
|
+
[syncQueue]
|
|
58773
|
+
);
|
|
58774
|
+
const drainQueue = (0, import_react63.useCallback)(() => {
|
|
57969
58775
|
const drained = queueRef.current;
|
|
57970
58776
|
queueRef.current = [];
|
|
57971
|
-
|
|
58777
|
+
syncQueue();
|
|
57972
58778
|
return drained;
|
|
57973
|
-
}, []);
|
|
57974
|
-
const restoreQueue = (0,
|
|
57975
|
-
|
|
57976
|
-
|
|
57977
|
-
|
|
57978
|
-
|
|
57979
|
-
|
|
57980
|
-
|
|
58779
|
+
}, [syncQueue]);
|
|
58780
|
+
const restoreQueue = (0, import_react63.useCallback)(
|
|
58781
|
+
(texts) => {
|
|
58782
|
+
const restored = texts.map((text) => text.trim()).filter(Boolean);
|
|
58783
|
+
if (restored.length === 0) return;
|
|
58784
|
+
queueRef.current = [...restored, ...queueRef.current];
|
|
58785
|
+
syncQueue();
|
|
58786
|
+
},
|
|
58787
|
+
[syncQueue]
|
|
58788
|
+
);
|
|
58789
|
+
const runTurn = (0, import_react63.useCallback)(
|
|
57981
58790
|
async (prompt, promptId, turnOptions) => {
|
|
57982
58791
|
const seq = ++turnSeqRef.current;
|
|
57983
58792
|
const abort = new AbortController();
|
|
@@ -58042,7 +58851,7 @@ function useOpenTuiLiveTurn(options) {
|
|
|
58042
58851
|
if (rest.length > 0) {
|
|
58043
58852
|
const [text, ...remaining] = rest;
|
|
58044
58853
|
queueRef.current = remaining;
|
|
58045
|
-
|
|
58854
|
+
syncQueue();
|
|
58046
58855
|
apply({ type: "user", text });
|
|
58047
58856
|
void runTurn(text, nextLivePromptId(config), {
|
|
58048
58857
|
submittedPrompt: text
|
|
@@ -58051,9 +58860,9 @@ function useOpenTuiLiveTurn(options) {
|
|
|
58051
58860
|
}
|
|
58052
58861
|
}
|
|
58053
58862
|
},
|
|
58054
|
-
[config, apply, drainQueue, restoreQueue, setBusy, setReceiving]
|
|
58863
|
+
[config, apply, drainQueue, restoreQueue, setBusy, setReceiving, syncQueue]
|
|
58055
58864
|
);
|
|
58056
|
-
const submit = (0,
|
|
58865
|
+
const submit = (0, import_react63.useCallback)(
|
|
58057
58866
|
(content, imagePaths, options2) => {
|
|
58058
58867
|
const text = typeof content === "string" ? content : collectText(normalizeParts(content));
|
|
58059
58868
|
if (streamingRef.current) {
|
|
@@ -58077,10 +58886,10 @@ function useOpenTuiLiveTurn(options) {
|
|
|
58077
58886
|
},
|
|
58078
58887
|
[config, apply, pushQueue, runTurn]
|
|
58079
58888
|
);
|
|
58080
|
-
const interrupt = (0,
|
|
58889
|
+
const interrupt = (0, import_react63.useCallback)(() => {
|
|
58081
58890
|
abortRef.current?.abort();
|
|
58082
58891
|
}, []);
|
|
58083
|
-
const resetTranscript = (0,
|
|
58892
|
+
const resetTranscript = (0, import_react63.useCallback)(
|
|
58084
58893
|
(events) => {
|
|
58085
58894
|
turnSeqRef.current += 1;
|
|
58086
58895
|
const abort = abortRef.current;
|
|
@@ -58091,29 +58900,29 @@ function useOpenTuiLiveTurn(options) {
|
|
|
58091
58900
|
}
|
|
58092
58901
|
abort?.abort();
|
|
58093
58902
|
queueRef.current = [];
|
|
58094
|
-
|
|
58903
|
+
syncQueue();
|
|
58095
58904
|
waitingCallsRef.current = [];
|
|
58096
58905
|
setWaitingCalls([]);
|
|
58097
58906
|
setBusy(false);
|
|
58098
58907
|
setItems(foldBatch(events));
|
|
58099
58908
|
},
|
|
58100
|
-
[setBusy]
|
|
58909
|
+
[setBusy, syncQueue]
|
|
58101
58910
|
);
|
|
58102
|
-
const settleWaitingCall = (0,
|
|
58911
|
+
const settleWaitingCall = (0, import_react63.useCallback)((callId) => {
|
|
58103
58912
|
setWaitingCalls((prev) => prev.filter((c2) => c2.callId !== callId));
|
|
58104
58913
|
}, []);
|
|
58105
|
-
const popQueue = (0,
|
|
58914
|
+
const popQueue = (0, import_react63.useCallback)(() => {
|
|
58106
58915
|
if (queueRef.current.length === 0) return null;
|
|
58107
58916
|
return drainQueue().join("\n\n");
|
|
58108
58917
|
}, [drainQueue]);
|
|
58109
|
-
(0,
|
|
58918
|
+
(0, import_react63.useEffect)(() => () => abortRef.current?.abort(), []);
|
|
58110
58919
|
return {
|
|
58111
58920
|
items,
|
|
58112
58921
|
streaming,
|
|
58113
58922
|
streamingCharsRef,
|
|
58114
58923
|
isReceivingContent,
|
|
58115
58924
|
waitingCalls,
|
|
58116
|
-
|
|
58925
|
+
messageQueue: queue,
|
|
58117
58926
|
popQueue,
|
|
58118
58927
|
submit,
|
|
58119
58928
|
interrupt,
|
|
@@ -58198,29 +59007,29 @@ function OpenTuiEntryApp({
|
|
|
58198
59007
|
items: live.items,
|
|
58199
59008
|
waitingCalls: live.waitingCalls
|
|
58200
59009
|
});
|
|
58201
|
-
const statsRef = (0,
|
|
58202
|
-
(0,
|
|
59010
|
+
const statsRef = (0, import_react64.useRef)(stats);
|
|
59011
|
+
(0, import_react64.useEffect)(() => {
|
|
58203
59012
|
statsRef.current = stats;
|
|
58204
59013
|
}, [stats]);
|
|
58205
|
-
const getSessionStats = (0,
|
|
58206
|
-
const composerHandle = (0,
|
|
58207
|
-
(0,
|
|
59014
|
+
const getSessionStats = (0, import_react64.useCallback)(() => statsRef.current, []);
|
|
59015
|
+
const composerHandle = (0, import_react64.useRef)(null);
|
|
59016
|
+
(0, import_react64.useEffect)(
|
|
58208
59017
|
() => armCapturedInputInjection(() => composerHandle.current, capturedText),
|
|
58209
59018
|
[capturedText]
|
|
58210
59019
|
);
|
|
58211
|
-
(0,
|
|
59020
|
+
(0, import_react64.useEffect)(() => {
|
|
58212
59021
|
const resumeEvents = resumeEventsFromConfig(config);
|
|
58213
59022
|
if (resumeEvents) resetTranscript(resumeEvents);
|
|
58214
59023
|
for (const warning of startupWarnings) {
|
|
58215
59024
|
applyEvent({ type: "warning", text: warning });
|
|
58216
59025
|
}
|
|
58217
59026
|
}, []);
|
|
58218
|
-
const [updateNotice, setUpdateNotice] = (0,
|
|
58219
|
-
const isIdleRef = (0,
|
|
58220
|
-
(0,
|
|
59027
|
+
const [updateNotice, setUpdateNotice] = (0, import_react64.useState)(null);
|
|
59028
|
+
const isIdleRef = (0, import_react64.useRef)(true);
|
|
59029
|
+
(0, import_react64.useEffect)(() => {
|
|
58221
59030
|
isIdleRef.current = !live.streaming;
|
|
58222
59031
|
}, [live.streaming]);
|
|
58223
|
-
const addUpdateItem = (0,
|
|
59032
|
+
const addUpdateItem = (0, import_react64.useCallback)(
|
|
58224
59033
|
(item) => {
|
|
58225
59034
|
if (item.type === "info" /* INFO */) {
|
|
58226
59035
|
applyEvent({ type: "info", text: item.text });
|
|
@@ -58232,25 +59041,25 @@ function OpenTuiEntryApp({
|
|
|
58232
59041
|
},
|
|
58233
59042
|
[applyEvent]
|
|
58234
59043
|
);
|
|
58235
|
-
const setUpdateInfo = (0,
|
|
59044
|
+
const setUpdateInfo = (0, import_react64.useCallback)((info) => {
|
|
58236
59045
|
setUpdateNotice(info?.message ?? null);
|
|
58237
59046
|
}, []);
|
|
58238
59047
|
useUpdateNoticeFlush(addUpdateItem, setUpdateInfo, isIdleRef, live.streaming);
|
|
58239
|
-
const [exitHint, setExitHint] = (0,
|
|
58240
|
-
const exitGuard = (0,
|
|
59048
|
+
const [exitHint, setExitHint] = (0, import_react64.useState)(null);
|
|
59049
|
+
const exitGuard = (0, import_react64.useMemo)(
|
|
58241
59050
|
() => createExitGuard({ onWindowExpired: /* @__PURE__ */ __name(() => setExitHint(null), "onWindowExpired") }),
|
|
58242
59051
|
[]
|
|
58243
59052
|
);
|
|
58244
|
-
(0,
|
|
58245
|
-
const streamingRef = (0,
|
|
58246
|
-
(0,
|
|
59053
|
+
(0, import_react64.useEffect)(() => () => exitGuard.dispose(), [exitGuard]);
|
|
59054
|
+
const streamingRef = (0, import_react64.useRef)(live.streaming);
|
|
59055
|
+
(0, import_react64.useEffect)(() => {
|
|
58247
59056
|
streamingRef.current = live.streaming;
|
|
58248
59057
|
}, [live.streaming]);
|
|
58249
|
-
const waitingCallsRef = (0,
|
|
58250
|
-
(0,
|
|
59058
|
+
const waitingCallsRef = (0, import_react64.useRef)(live.waitingCalls);
|
|
59059
|
+
(0, import_react64.useEffect)(() => {
|
|
58251
59060
|
waitingCallsRef.current = live.waitingCalls;
|
|
58252
59061
|
}, [live.waitingCalls]);
|
|
58253
|
-
const [thoughtsExpanded, setThoughtsExpanded] = (0,
|
|
59062
|
+
const [thoughtsExpanded, setThoughtsExpanded] = (0, import_react64.useState)(false);
|
|
58254
59063
|
useKeyboard((key) => {
|
|
58255
59064
|
if (!matchesCommand("toggleThinkingExpanded" /* TOGGLE_THINKING_EXPANDED */, key)) return;
|
|
58256
59065
|
key.preventDefault();
|
|
@@ -58276,19 +59085,21 @@ function OpenTuiEntryApp({
|
|
|
58276
59085
|
setExitHint(exitGuardHint(guardKey));
|
|
58277
59086
|
}
|
|
58278
59087
|
});
|
|
58279
|
-
const renderMain = (0,
|
|
58280
|
-
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { flexDirection: "column",
|
|
59088
|
+
const renderMain = (0, import_react64.useCallback)(
|
|
59089
|
+
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("box", { flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
58281
59090
|
OpenTuiTranscriptView,
|
|
58282
59091
|
{
|
|
58283
59092
|
items: live.items,
|
|
58284
59093
|
availableWidth: Math.max(0, width - 4),
|
|
58285
59094
|
availableTerminalHeight: height,
|
|
58286
|
-
thoughtsExpanded
|
|
59095
|
+
thoughtsExpanded,
|
|
59096
|
+
showToolCallArgs: settings.merged.ui?.showToolCallArgs === true,
|
|
59097
|
+
awaitingCallId: live.waitingCalls[0]?.callId
|
|
58287
59098
|
}
|
|
58288
59099
|
) }),
|
|
58289
|
-
[live.items, width, height, thoughtsExpanded]
|
|
59100
|
+
[live.items, live.waitingCalls, width, height, thoughtsExpanded, settings]
|
|
58290
59101
|
);
|
|
58291
|
-
const handleRenderError = (0,
|
|
59102
|
+
const handleRenderError = (0, import_react64.useCallback)(
|
|
58292
59103
|
(error) => {
|
|
58293
59104
|
debugLogger4.error(
|
|
58294
59105
|
`[FATAL_RENDER_ERROR] ${error.message}
|
|
@@ -58300,15 +59111,15 @@ ${error.stack ?? ""}`
|
|
|
58300
59111
|
},
|
|
58301
59112
|
[config]
|
|
58302
59113
|
);
|
|
58303
|
-
const handleStartNewSession = (0,
|
|
59114
|
+
const handleStartNewSession = (0, import_react64.useCallback)(
|
|
58304
59115
|
(sessionId) => startNewSession(sessionId),
|
|
58305
59116
|
[startNewSession]
|
|
58306
59117
|
);
|
|
58307
|
-
const handleSubmitPrompt = (0,
|
|
59118
|
+
const handleSubmitPrompt = (0, import_react64.useCallback)(
|
|
58308
59119
|
(content, imagePaths, options) => submit(content, imagePaths, options),
|
|
58309
59120
|
[submit]
|
|
58310
59121
|
);
|
|
58311
|
-
const handleQuit = (0,
|
|
59122
|
+
const handleQuit = (0, import_react64.useCallback)(() => {
|
|
58312
59123
|
void exitSession(config, 0);
|
|
58313
59124
|
}, [config]);
|
|
58314
59125
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -58335,7 +59146,7 @@ ${error.stack ?? ""}`
|
|
|
58335
59146
|
isReceivingContent: live.isReceivingContent,
|
|
58336
59147
|
onInterrupt: interrupt,
|
|
58337
59148
|
approvalMode: config.getApprovalMode(),
|
|
58338
|
-
|
|
59149
|
+
messageQueue: live.messageQueue,
|
|
58339
59150
|
onPopQueue: live.popQueue,
|
|
58340
59151
|
waitingToolCalls: live.waitingCalls,
|
|
58341
59152
|
onToolCallSettled: live.settleWaitingCall,
|
|
@@ -58385,7 +59196,7 @@ async function startOpenTuiUI(config, settings, startupWarnings, workspaceRoot =
|
|
|
58385
59196
|
// children must sit in the props object: the provider declares it as a
|
|
58386
59197
|
// required prop, which createElement's rest-children overloads can't fill.
|
|
58387
59198
|
// eslint-disable-next-line react/no-children-prop
|
|
58388
|
-
(0,
|
|
59199
|
+
(0, import_react64.createElement)(SessionStatsProvider, {
|
|
58389
59200
|
sessionId: config.getSessionId(),
|
|
58390
59201
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
58391
59202
|
OpenTuiEntryApp,
|