@qwen-code/qwen-code 0.23.1-preview.2 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/computer-use/SKILL.md +189 -116
- package/bundled/goal-draft/SKILL.md +23 -13
- package/bundled/qc-helper/docs/_meta.ts +1 -0
- package/bundled/qc-helper/docs/configuration/model-providers.md +47 -1
- package/bundled/qc-helper/docs/configuration/settings.md +50 -0
- package/bundled/qc-helper/docs/conversations-recovery.md +102 -0
- package/bundled/qc-helper/docs/features/channels/overview.md +1 -1
- package/bundled/qc-helper/docs/features/computer-use.md +9 -7
- package/bundled/qc-helper/docs/features/followup-suggestions.md +2 -2
- package/bundled/qc-helper/docs/features/goals.md +15 -3
- package/bundled/qc-helper/docs/qwen-serve.md +19 -1
- package/chunks/{MaxSizedBox-IYIQ43IZ.js → MaxSizedBox-UDO6Y7RB.js} +20 -20
- package/chunks/{StandaloneSessionPicker-AWB2OHX6.js → StandaloneSessionPicker-D4CUOO4H.js} +38 -38
- package/chunks/{acp-startup-profiler-BAL4LJTN.js → acp-startup-profiler-KEU6VAYR.js} +2 -2
- package/chunks/{acpAgent-ZC57OLS4.js → acpAgent-KWLJFADK.js} +118 -91
- package/chunks/{agent-GEBPAEJS.js → agent-GSUPGEOL.js} +13 -13
- package/chunks/{agent-headless-63ZEYAJK.js → agent-headless-HNYCQUJB.js} +13 -13
- package/chunks/{anthropicContentGenerator-6XDHXIII.js → anthropicContentGenerator-I7LQZH26.js} +30 -7
- package/chunks/{askUserQuestion-3KAYLLMM.js → askUserQuestion-I5W5S3D6.js} +1 -1
- package/chunks/{bridge-MHWO5I5T.js → bridge-B7CV6RVI.js} +23 -23
- package/chunks/{channel-management-service-NFRZXQFO.js → channel-management-service-TRTLQTSV.js} +4 -4
- package/chunks/{channel-settings-store-T7PMIHKC.js → channel-settings-store-FW45IRUP.js} +31 -31
- package/chunks/{channel-worker-group-O2BWK5F7.js → channel-worker-group-PIYPVCTF.js} +6 -6
- package/chunks/{channel-worker-manager-4WP7VJOD.js → channel-worker-manager-FQHEDTD2.js} +6 -6
- package/chunks/{channel-worker-supervisor-CCUXD6J5.js → channel-worker-supervisor-XJPZZ3VK.js} +3 -3
- package/chunks/{chunk-KTLT7VCX.js → chunk-25CBAK3H.js} +2 -2
- package/chunks/{chunk-SHX2HIE7.js → chunk-27LTEY6D.js} +1 -1
- package/chunks/{chunk-ZT3XUGSU.js → chunk-2TMJRF46.js} +86 -9
- package/chunks/{chunk-HWZOOSEB.js → chunk-2YS3NU4A.js} +3 -3
- package/chunks/chunk-2Z3T52OC.js +82 -0
- package/chunks/{chunk-QW7BUOSI.js → chunk-2ZFO5JD7.js} +20 -3
- package/chunks/{chunk-RH344FKI.js → chunk-3BTHHXXE.js} +1 -1
- package/chunks/{chunk-OFB36ZBA.js → chunk-3LPJ776W.js} +1 -1
- package/chunks/{chunk-GEV66YGE.js → chunk-3VDLQUR2.js} +1 -1
- package/chunks/{chunk-RRCNEW2A.js → chunk-3VWPPK5Q.js} +58 -4
- package/chunks/{chunk-L36LLVA5.js → chunk-3YQMUBTS.js} +3 -3
- package/chunks/{chunk-LTCI6ZOJ.js → chunk-45ROPFQY.js} +1 -1
- package/chunks/{chunk-W4LL5RZO.js → chunk-4ALNJDHL.js} +52 -13
- package/chunks/{chunk-4OCYWXKF.js → chunk-5CVY5Q2P.js} +3 -3
- package/chunks/{chunk-ZRVFHLLK.js → chunk-5DQ4YTIZ.js} +1 -1
- package/chunks/{chunk-FWH4736Q.js → chunk-5IL2BZHW.js} +3 -3
- package/chunks/{chunk-537SQ2AI.js → chunk-5WC2ECUK.js} +104 -16
- package/chunks/{chunk-3K65MUKD.js → chunk-65I7S4Z3.js} +2 -1
- package/chunks/{chunk-RUMSY4ES.js → chunk-66JBCTJF.js} +8 -7
- package/chunks/{chunk-YLFICBYK.js → chunk-6JXHO7LG.js} +3 -3
- package/chunks/{chunk-TDHVOZ65.js → chunk-6QILGINT.js} +2 -2
- package/chunks/{chunk-WQBR7LN5.js → chunk-6QV7Z74P.js} +1 -1
- package/chunks/{chunk-RSU3I6UL.js → chunk-6SADVYQQ.js} +1 -1
- package/chunks/{chunk-AIMZIXZM.js → chunk-6TPVIESH.js} +5 -7
- package/chunks/{chunk-2LD5U7Q3.js → chunk-6YEOCHSE.js} +29 -1
- package/chunks/{chunk-7PMKXGRP.js → chunk-75LBC7SV.js} +66 -9
- package/chunks/{chunk-B5FF3LRF.js → chunk-7SL55L5H.js} +22 -15
- package/chunks/{chunk-I7UNCY24.js → chunk-ARYNBBBM.js} +3 -3
- package/chunks/{chunk-QQGAR64U.js → chunk-B3EL44K3.js} +4 -4
- package/chunks/{chunk-KAZWXVI3.js → chunk-CABDNUJ4.js} +2 -2
- package/chunks/{chunk-R7TKFIQO.js → chunk-CALNF3Z3.js} +1 -1
- package/chunks/{chunk-75UQFGFE.js → chunk-CHVU543W.js} +1 -1
- package/chunks/{chunk-C4NXRR7T.js → chunk-CIKL2DQP.js} +2 -2
- package/chunks/{chunk-LD53HMPV.js → chunk-CRZBDVP2.js} +1 -0
- package/chunks/{chunk-SHK2SIR5.js → chunk-D6AQNMUA.js} +4 -4
- package/chunks/{chunk-EPZWBYQI.js → chunk-DO5SMV52.js} +8 -6
- package/chunks/{chunk-P5Z7VD23.js → chunk-DXQ6Z7AH.js} +106 -39
- package/chunks/{chunk-3RMVM33U.js → chunk-DZ6D4B3K.js} +5 -5
- package/chunks/{chunk-T7TP5UQL.js → chunk-E7XSUYCZ.js} +4 -4
- package/chunks/{chunk-2C3XDBGL.js → chunk-EEKU6COG.js} +4 -4
- package/chunks/{chunk-AX23QSX3.js → chunk-EHTKOO6W.js} +4 -4
- package/chunks/{chunk-XNC2TCUO.js → chunk-ENZDGHGJ.js} +4 -4
- package/chunks/{chunk-733KQL63.js → chunk-EOET4H7C.js} +3 -3
- package/chunks/{chunk-37SOBIA3.js → chunk-ERXNTINK.js} +1 -1
- package/chunks/{chunk-F47DITLZ.js → chunk-FAWTMDX7.js} +14 -0
- package/chunks/{chunk-5JLQWQK6.js → chunk-FV4DM2M4.js} +2 -2
- package/chunks/{chunk-UTVIIA7N.js → chunk-FW4E4QPG.js} +1 -1
- package/chunks/{chunk-REDVV5NC.js → chunk-FWRRUITH.js} +7 -7
- package/chunks/{chunk-5V4B3EWA.js → chunk-GM44O6F7.js} +1 -1
- package/chunks/{chunk-Z6DDPSGJ.js → chunk-GNY7B3CA.js} +1 -1
- package/chunks/{chunk-ERMAXPXA.js → chunk-HIXUUCGY.js} +187 -12
- package/chunks/{chunk-EJNYBDYC.js → chunk-HNLMYDQE.js} +1 -1
- package/chunks/{chunk-XX4MBBFW.js → chunk-HUX2DOTF.js} +3 -3
- package/chunks/{chunk-RCUWMVN3.js → chunk-HZ2HUXX7.js} +1 -1
- package/chunks/{chunk-RD3VPM4E.js → chunk-IKG2YVRZ.js} +2 -2
- package/chunks/{chunk-IMWCUWQT.js → chunk-J3TJH52D.js} +1 -1
- package/chunks/{chunk-ZJ2LM2SI.js → chunk-JGDRB4FP.js} +104 -33
- package/chunks/{chunk-ANVC5CSK.js → chunk-L7V52QEZ.js} +10 -10
- package/chunks/{chunk-MFCWL4LI.js → chunk-LNCNUMJ5.js} +451 -396
- package/chunks/{chunk-AUJOWIT5.js → chunk-LZGFVUWZ.js} +3 -3
- package/chunks/{chunk-6KYWU726.js → chunk-M73KHGNR.js} +13 -66
- package/chunks/{chunk-ADJD4LZF.js → chunk-MA5OUNN6.js} +1 -1
- package/chunks/{chunk-I67KJGM6.js → chunk-MFYH2VXV.js} +3 -3
- package/chunks/{chunk-PLUAIHZO.js → chunk-N7YQEKGX.js} +6 -6
- package/chunks/{chunk-JOV46WGX.js → chunk-NB3NDQQK.js} +1 -1
- package/chunks/chunk-NOO4QFXM.js +171 -0
- package/chunks/{chunk-VYCJITND.js → chunk-O2JBJQCF.js} +1 -1
- package/chunks/{chunk-RQNAO42A.js → chunk-OESZTXTG.js} +1 -1
- package/chunks/{chunk-UKADFFL2.js → chunk-OFVAS4AR.js} +1 -1
- package/chunks/{chunk-Y3C5COGI.js → chunk-OPMKGOLD.js} +1 -1
- package/chunks/{chunk-TSLRORQR.js → chunk-PDUMGZ2P.js} +1467 -1323
- package/chunks/{chunk-Z6KFLEG7.js → chunk-PSPAM24S.js} +1 -0
- package/chunks/{chunk-5FYGZ7E3.js → chunk-QK4K76T6.js} +2 -2
- package/chunks/{chunk-NUQFUXOG.js → chunk-QTNCGZHQ.js} +2 -0
- package/chunks/{chunk-WFXD5OZH.js → chunk-QZOXVQPK.js} +1 -1
- package/chunks/{chunk-QJVZLILI.js → chunk-R7OO56VZ.js} +1 -1
- package/chunks/{chunk-KP5QK3FB.js → chunk-RNYENHN5.js} +397 -54
- package/chunks/{chunk-22QOQKG4.js → chunk-RXT4QBDX.js} +1 -1
- package/chunks/{chunk-LYHYXJJ3.js → chunk-S6QVI3MV.js} +3 -3
- package/chunks/{chunk-NXWYCSPL.js → chunk-SOA4HKRJ.js} +1 -1
- package/chunks/{chunk-IGOIYZBG.js → chunk-T2IHCZLS.js} +2 -2
- package/chunks/{chunk-C55CR5I4.js → chunk-TGC4264Q.js} +6 -6
- package/chunks/{chunk-EGRFCIXD.js → chunk-TWAMIEQ2.js} +79 -18
- package/chunks/{chunk-PMGWY6ZP.js → chunk-TWWS7XUW.js} +13 -10
- package/chunks/{chunk-RGAQDQ3Z.js → chunk-UHUT4IDM.js} +18 -9
- package/chunks/{chunk-HPE4LEWX.js → chunk-USN6VNTO.js} +1 -1
- package/chunks/{chunk-BNWIX6BM.js → chunk-UXDVUFKU.js} +3 -3
- package/chunks/{chunk-HY3DXYZK.js → chunk-UYDQYDW2.js} +1 -1
- package/chunks/{chunk-3K456UJF.js → chunk-VF6D6EGV.js} +12 -4
- package/chunks/{chunk-ZNI3V2XA.js → chunk-WAASYFPK.js} +2 -2
- package/chunks/{chunk-OHOO527W.js → chunk-WG7BL3FY.js} +52 -2
- package/chunks/{chunk-C7M445SS.js → chunk-WJDXKQIO.js} +1 -1
- package/chunks/{chunk-HZS3JRQW.js → chunk-WNISCNTA.js} +40 -2
- package/chunks/{chunk-AWDF462I.js → chunk-WQMUGQ6G.js} +2 -2
- package/chunks/{chunk-VU7O7CGQ.js → chunk-XDNFODER.js} +1 -1
- package/chunks/{chunk-65GHQ4FX.js → chunk-XVTCSVBK.js} +514 -47
- package/chunks/{chunk-SI6Q52UI.js → chunk-XZ3Z43XL.js} +3 -3
- package/chunks/{chunk-SD7Y2PMC.js → chunk-YAC7H4K3.js} +2 -2
- package/chunks/{chunk-FXYNIZPW.js → chunk-YCEKI7QX.js} +51 -10
- package/chunks/{chunk-7IKXTGZT.js → chunk-YI2YCNSP.js} +1 -1
- package/chunks/{chunk-E4VX6LXB.js → chunk-YZTGGCEE.js} +10 -2
- package/chunks/{chunk-VMFPZXRT.js → chunk-ZNO5BUAD.js} +43 -31
- package/chunks/{chunk-WLZRMF3C.js → chunk-ZPL2TZNA.js} +353 -11
- package/chunks/{chunk-TXAEXF2B.js → chunk-ZU2T5JIS.js} +21 -8
- package/chunks/{config-utils-F4CFJ4MW.js → config-utils-KTDSQ4MU.js} +24 -24
- package/chunks/{contextCommand-OIIGGOMU.js → contextCommand-UQ3KRYGK.js} +22 -22
- package/chunks/{core-runtime-JEHLOGMB.js → core-runtime-JR34JAFH.js} +20 -20
- package/chunks/{create-sub-session-MVFBE5RA.js → create-sub-session-RGPJOI4S.js} +21 -21
- package/chunks/{daemon-LCUELM6E.js → daemon-UI6SQSBV.js} +1 -1
- package/chunks/{daemon-git-worktree-guard-5FTKLJOU.js → daemon-git-worktree-guard-H3OA26KQ.js} +20 -20
- package/chunks/{daemon-status-provider-P6A5MPMW.js → daemon-status-provider-6WZLKSZU.js} +27 -27
- package/chunks/{daemon-trust-policy-ZJ3NFYUO.js → daemon-trust-policy-3EDP2BYD.js} +27 -27
- package/chunks/{daemon-trust-policy-monitor-6SDLEW7S.js → daemon-trust-policy-monitor-CRHZPK52.js} +27 -27
- package/chunks/{deferred-core-runtime-DWOXIU5S.js → deferred-core-runtime-LO5NTQQ4.js} +20 -20
- package/chunks/{discovery-TUM3ZQ6U.js → discovery-XP4RMDUM.js} +4 -2
- package/chunks/{dist-NXW4DUUX.js → dist-24TCWK5H.js} +1 -1
- package/chunks/{dist-I74QLLQS.js → dist-5I4HLUTO.js} +1 -1
- package/chunks/{dist-XINEKB5A.js → dist-FDISN4AK.js} +1 -1
- package/chunks/{dist-VCAS67N5.js → dist-M4CBX53H.js} +1 -1
- package/chunks/{dist-AI25RVRA.js → dist-NQ2636VT.js} +1 -1
- package/chunks/{dist-3H3WODVS.js → dist-OR2ZQTXZ.js} +1 -1
- package/chunks/{dist-P6YWBITG.js → dist-STAGIFNB.js} +430 -51
- package/chunks/{dist-YNQU4CKC.js → dist-WZTUKIDR.js} +2 -2
- package/chunks/{dist-T4PRA5EZ.js → dist-XJ25G6OH.js} +1 -1
- package/chunks/{edit-WPVXLL3T.js → edit-LB7Z7XK5.js} +13 -13
- package/chunks/{enter-worktree-5A6VW6BN.js → enter-worktree-YFTKHXHZ.js} +2 -2
- package/chunks/{enterPlanMode-JSODW7E2.js → enterPlanMode-P6TVUFIY.js} +13 -13
- package/chunks/{environment-5LLJ3I3W.js → environment-QATJNNKI.js} +23 -23
- package/chunks/{errors-IQT3YZEP.js → errors-3XJ37PS2.js} +22 -22
- package/chunks/{exit-worktree-QV7E7KP6.js → exit-worktree-NF2XEMES.js} +3 -3
- package/chunks/{exitPlanMode-DDVFYNW4.js → exitPlanMode-A3OKL5UO.js} +13 -13
- package/chunks/{fast-path-PAUQQEVU.js → fast-path-DBIT5YQQ.js} +3 -3
- package/chunks/{fast-path-settings-ISEJPRYE.js → fast-path-settings-SATXY3PD.js} +3 -3
- package/chunks/{glob-SQ7CTZ7F.js → glob-73EDTXUE.js} +13 -13
- package/chunks/{goal-tools-UWZRCLQB.js → goal-tools-DFI6YMSD.js} +13 -13
- package/chunks/{handleAutoUpdate-RUPZZTSG.js → handleAutoUpdate-2FUNJO3B.js} +23 -23
- package/chunks/{i18n-SF5MPWEB.js → i18n-FDIA6KFI.js} +23 -21
- package/chunks/{image-gen-Q3RUTVKR.js → image-gen-XP4NNIYG.js} +4 -4
- package/chunks/{initializer-CK4WPYZG.js → initializer-4MJTJOTW.js} +27 -27
- package/chunks/{installationInfo-IRPQEYRF.js → installationInfo-232RA2OK.js} +20 -20
- package/chunks/{list-E3PS3EBJ.js → list-WN6WSGEB.js} +30 -30
- package/chunks/{llm-JQKBOYAF.js → llm-UDFWQWZA.js} +62 -62
- package/chunks/{llm-content-generator-2QWGBW42.js → llm-content-generator-VLMZ2A7A.js} +23 -8
- package/chunks/{loadedSettingsAdapter-DGXGVYZS.js → loadedSettingsAdapter-OBQEIXM7.js} +27 -27
- package/chunks/{loggingContentGenerator-ZYURLJKK.js → loggingContentGenerator-RGVUMUVX.js} +14 -14
- package/chunks/{managed-npm-update-HTHR63EA.js → managed-npm-update-QBAJYCFU.js} +20 -20
- package/chunks/{mcp-I7G2AEWS.js → mcp-OTIZZCPY.js} +27 -27
- package/chunks/{monitor-4R76BCRZ.js → monitor-BV5XF6LL.js} +13 -13
- package/chunks/{nonInteractiveCli-24OQ3VP2.js → nonInteractiveCli-W6MUKDVJ.js} +64 -61
- package/chunks/{notebook-edit-PPSH7FEX.js → notebook-edit-HGBEKGTE.js} +13 -13
- package/chunks/{openaiContentGenerator-K7V5EO7F.js → openaiContentGenerator-NSU3ERBH.js} +8 -8
- package/chunks/{pidfile-TGIUY2GG.js → pidfile-LE3TU4GE.js} +20 -20
- package/chunks/{processUtils-3USXUQWX.js → processUtils-YFBGJK67.js} +2 -2
- package/chunks/{prompt-terminal-ledger-XHVZRXJI.js → prompt-terminal-ledger-4W4W7DSO.js} +21 -21
- package/chunks/{qwenContentGenerator-MPBOQB64.js → qwenContentGenerator-HTA57WFC.js} +16 -16
- package/chunks/{qwenOAuth2-BS5D2LYV.js → qwenOAuth2-KX6LVYQ3.js} +4 -4
- package/chunks/{read-file-R256LDWQ.js → read-file-KHPQ2MB6.js} +2 -2
- package/chunks/{resumeHistoryUtils-S43LTFHD.js → resumeHistoryUtils-K7RV3QBN.js} +23 -23
- package/chunks/{ripGrep-L7HPZ75Y.js → ripGrep-NBBVCMG4.js} +3 -3
- package/chunks/{run-qwen-serve-CTFL5R6U.js → run-qwen-serve-A3JBOZCM.js} +58 -60
- package/chunks/{runtime-FS5TL6P7.js → runtime-7YOU2KJ3.js} +32 -32
- package/chunks/{scheduled-tasks-QXPV3Q35.js → scheduled-tasks-52LXK7LN.js} +25 -25
- package/chunks/{scheduler-EXU5HMVK.js → scheduler-J44M72VM.js} +22 -22
- package/chunks/{send-message-GQKXGMPI.js → send-message-AWKUDJBH.js} +1 -1
- package/chunks/{serve-ITJC7WNN.js → serve-TRC6XJUB.js} +27 -27
- package/chunks/{server-6JQY3PTU.js → server-YPNTJLX2.js} +1296 -822
- package/chunks/{session-PJDEKXD4.js → session-FMMIBFYX.js} +63 -62
- package/chunks/{session-attachments-root-L37ORSST.js → session-attachments-root-LDJMNK7K.js} +20 -20
- package/chunks/{session-pr-refresh-WIFD52YL.js → session-pr-refresh-NLR4EK2J.js} +24 -24
- package/chunks/{settings-LO6J5SAZ.js → settings-A46L577J.js} +26 -26
- package/chunks/{shell-ANAFVYGR.js → shell-Q5LSQPPY.js} +13 -13
- package/chunks/{skill-SHJWKSPH.js → skill-75KPJRCM.js} +2 -2
- package/chunks/{skill-settings-GX3XHZ5Q.js → skill-settings-775YT4YR.js} +26 -26
- package/chunks/{spawnChannel-WE42VBKM.js → spawnChannel-XY73I5CU.js} +20 -20
- package/chunks/{standalone-update-CWDIKJRP.js → standalone-update-L46XXNQ2.js} +22 -22
- package/chunks/{start-opentui-ui-BBHGFOTF.js → start-opentui-ui-WLV43247.js} +1991 -986
- package/chunks/{startInteractiveUI-FQX7LUYP.js → startInteractiveUI-F5DKMLOV.js} +1119 -1478
- package/chunks/{team-create-WKTPCH6D.js → team-create-2PATB77U.js} +13 -13
- package/chunks/{team-plan-approval-Y23DL7WR.js → team-plan-approval-QTANEWOS.js} +13 -13
- package/chunks/{terminal-image-renderer-B646HBDW.js → terminal-image-renderer-OGULCFNF.js} +20 -20
- package/chunks/{theme-manager-BNWESY26.js → theme-manager-CNO3QERP.js} +20 -20
- package/chunks/{tool-search-PVQ5O5Y2.js → tool-search-VXWEOZE7.js} +2 -2
- package/chunks/{total-session-admission-P5Z43KNW.js → total-session-admission-4KAADZPB.js} +24 -24
- package/chunks/{trustedFolders-FH2LT2MZ.js → trustedFolders-PPJSOPOT.js} +21 -21
- package/chunks/{update-relaunch-WOWTKJSN.js → update-relaunch-4PT4MW7B.js} +5 -5
- package/chunks/{updateCheck-3MYFMM35.js → updateCheck-WAVFLWNG.js} +22 -22
- package/chunks/{useAutoAcceptIndicator-Q7ZRRRKO.js → useAutoAcceptIndicator-XNED4NRB.js} +29 -29
- package/chunks/{validateNonInterActiveAuth-MYEWJX3G.js → validateNonInterActiveAuth-J676DUQ2.js} +59 -58
- package/chunks/{version-RO2FPO76.js → version-J6SRRQB2.js} +1 -1
- package/chunks/{web-fetch-QAKY2LUA.js → web-fetch-FMZZYX44.js} +5 -5
- package/chunks/{web-search-XA5Z4ZCD.js → web-search-3G2KXCX5.js} +18 -7
- package/chunks/{workflow-QFIOCMDM.js → workflow-PPZZICQ7.js} +15 -15
- package/chunks/{workspace-providers-status-B2UD7RAG.js → workspace-providers-status-IIYTAQST.js} +29 -29
- package/chunks/{workspace-registration-store-VZLRTI3Q.js → workspace-registration-store-VHCDXAV7.js} +1 -1
- package/chunks/{workspace-registry-GYOGG6TM.js → workspace-registry-I7VQIPS2.js} +24 -24
- package/chunks/{workspace-runtime-coordinator-7KRXGQ4V.js → workspace-runtime-coordinator-DBGNY32G.js} +24 -24
- package/chunks/{workspace-service-DJEYGJE4.js → workspace-service-QSKB2T54.js} +31 -31
- package/chunks/{workspace-skills-status-MOKNESUC.js → workspace-skills-status-T7GPT65J.js} +27 -27
- package/chunks/{workspace-trust-reconciler-AXOSUTQW.js → workspace-trust-reconciler-2PKRDAU4.js} +31 -31
- package/chunks/{write-file-QOYVHAKK.js → write-file-L76CGFTQ.js} +14 -14
- package/chunks/{zoom-image-UCCLGFNC.js → zoom-image-TDJJY2VZ.js} +2 -2
- package/cli.js +13 -13
- package/export-transcript-document.js +126 -122
- package/package.json +3 -3
- package/web-shell/assets/{abnfDiagram-VCTEODGH-CTstZpXw.js → abnfDiagram-VCTEODGH-DHc6plZn.js} +1 -1
- package/web-shell/assets/{arc-DKW0mbPo.js → arc-BQ9m8TDV.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-DkMpJ42t.js → architectureDiagram-5GKGNRK7-D5ap3oVB.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-7Cp1_4i3.js → blockDiagram-NRAW4CY4-BIbnyNph.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-BfaoSlBK.js → c4Diagram-UCG6FXSJ-BRsdx_iG.js} +1 -1
- package/web-shell/assets/channel-uMMdTrYk.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-_n1qzAio.js → chunk-2Q5K7J3B-3lf1fNlx.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-0cira5ZV.js → chunk-5VM5RSS4-DP8VNRc4.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-DseRXSHC.js → chunk-F27PBJKO-DrohDmZ6.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-BehQWin0.js → chunk-G27WJ6UU-UZ2QhSx6.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-B5ftg1Bb.js → chunk-JWPE2WC7-BIMHVcZK.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-D7rnbVdk.js → chunk-LCL6LL3I-izRxdSDd.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-2Bp-Orju.js → chunk-POPQ4Y6H-CXADD4PP.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-CD2goGva.js → chunk-SVP7TREG-B96d8Y_1.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-DzQt-Rji.js → chunk-XXDRQBXY-CF2sVQpv.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-DcY-26Ig.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-DcY-26Ig.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-C-BZXSUn.js → cose-bilkent-JH36ORCC-CT6tXVAS.js} +1 -1
- package/web-shell/assets/csv-CX7rUNeC.svg +1 -0
- package/web-shell/assets/{cynefin-OW5HDTMX-BTcvowe1.js → cynefin-OW5HDTMX-X1NS4vtV.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-BoUE6K81.js → cynefinDiagram-5FMLGOSQ-DNsKNOT4.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-BHxy9xeB.js → dagre-3AP2YEHR-9-AHKqsb.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-DMiJIvDT.js → diagram-S7CK7UJ4-Bjgms7j6.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-DXV09Aes.js → diagram-UQ7AKVKN-h6bCprbE.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-CocpRomV.js → diagram-VSXAHHWV-4SbQXVLt.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-DL7nqtb4.js → diagram-VX7I27RA-B5gPCzzB.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-CPZ2Jux_.js → diagram-Z3DM3KII-DFJXIA3A.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-BX-eVNsX.js → ebnfDiagram-PWID7BFC-FwyaU7VY.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-CPy_Ir6y.js → erDiagram-SSCWMZ5O-8vJQh2te.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-eknAOte9.js → flowDiagram-A5DVABFB-BzA_1gMN.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-crAxw_t7.js → ganttDiagram-EL5Y4UJY-Co-ABbVX.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-M29pa3Tc.js → gitGraphDiagram-WWUBYQGX-DW_FcyrX.js} +1 -1
- package/web-shell/assets/{index-C9R-iojE.js → index-BbMXfhNG.js} +1 -1
- package/web-shell/assets/{index-B4TLaxWs.js → index-Bu-rZoJ-.js} +462 -454
- package/web-shell/assets/index-CsPwZ1ut.css +36 -0
- package/web-shell/assets/{infoDiagram-RXCK75RN-XqspXdOU.js → infoDiagram-RXCK75RN-BEgfhUFN.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-C5KFS-7j.js → ishikawaDiagram-5VMMS53U-DCsMxQmc.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-Cc57LVRo.js → journeyDiagram-EYS64GPL-DyIEYoHz.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-C81OG-AI.js → kanban-definition-3QL26DDD-CkxjqCNr.js} +1 -1
- package/web-shell/assets/{layout-CFVu37BB.js → layout-BEWc0Al9.js} +1 -1
- package/web-shell/assets/{linear-ChBxdtWf.js → linear-CNuNxirL.js} +1 -1
- package/web-shell/assets/{mermaid.core-CMLfue0w.js → mermaid.core-DZBre674.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-DFsvJThp.js → mindmap-definition-FBJOCRG2-CpafFz_F.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-BzpRzM4F.js → pegDiagram-XKGWAZYB-DfZqk_dq.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-Cv0Kankl.js → pieDiagram-E7YTZNPT-S0UWXlgC.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-Bh2BJ3Ay.js → quadrantDiagram-AXDQQJYC-dd37_Ohj.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-y8rNDdDS.js → railroadDiagram-O6MQD6OU-CH8NJZ7u.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-C0m2DKJ_.js → requirementDiagram-EFPCY7ZU-CFdqWYih.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-BzdGnSF4.js → sankeyDiagram-P5KCCOFB-CsddcEGD.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-DPzAVmzz.js → sequenceDiagram-WJ2MYXX4-BZ270mGw.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-LcHG28Zh.js → sizeCapture-X5ZJPWSS-CGaS4DBV.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-C1Bzy3IT.js → stateDiagram-HBIQ2CUA-COpIzMu6.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-D6qEVAji.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-Bftk8V64.js → swimlanes-XN3QIQJK-CMF889m3.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-mem5Jj4m.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-BfXHcN1A.js → timeline-definition-24CTP7MA-BelnxYz5.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-DRSlI9-V.js → vennDiagram-4TSXK5OY-CU-NRqIB.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-CaLmqGau.js → wardleyDiagram-VM6X3IG4-CDNKqWh-.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-8lgUT6e8.js → xychartDiagram-S5SC5T6Z-CLqguL5D.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/chunk-3UMWOKJC.js +0 -78
- package/chunks/chunk-IQAFKVXS.js +0 -22
- package/web-shell/assets/channel-CQx7VSAp.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-C-Uz8hHk.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-C-Uz8hHk.js +0 -1
- package/web-shell/assets/index-CCrkEbzz.css +0 -36
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-LuuL5byY.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-COmnNq8s.js +0 -8
|
@@ -2,19 +2,23 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
reportChatRecordingFailureToAdapter
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CALNF3Z3.js";
|
|
6
6
|
import {
|
|
7
7
|
StreamJsonOutputAdapter
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3VWPPK5Q.js";
|
|
9
9
|
import {
|
|
10
|
-
ICON
|
|
11
|
-
|
|
10
|
+
ICON,
|
|
11
|
+
SHELL_COMMAND_NAME
|
|
12
|
+
} from "./chunk-E7XSUYCZ.js";
|
|
12
13
|
import {
|
|
13
14
|
theme
|
|
14
15
|
} from "./chunk-4LIPOIXS.js";
|
|
15
16
|
import {
|
|
16
17
|
require_jsx_runtime
|
|
17
18
|
} from "./chunk-SV5PQVQE.js";
|
|
19
|
+
import {
|
|
20
|
+
themeManager
|
|
21
|
+
} from "./chunk-2XRE4KE4.js";
|
|
18
22
|
import {
|
|
19
23
|
Box_default,
|
|
20
24
|
Text
|
|
@@ -24,35 +28,48 @@ import {
|
|
|
24
28
|
} from "./chunk-5QWWOFGG.js";
|
|
25
29
|
import {
|
|
26
30
|
createLoadedSettingsAdapter
|
|
27
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-FW4E4QPG.js";
|
|
28
32
|
import {
|
|
29
33
|
SettingScope,
|
|
30
34
|
settingExistsInScope
|
|
31
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-66JBCTJF.js";
|
|
32
36
|
import {
|
|
33
37
|
t
|
|
34
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-CRZBDVP2.js";
|
|
35
39
|
import {
|
|
40
|
+
INITIAL_FOLLOWUP_STATE,
|
|
36
41
|
Logger,
|
|
37
42
|
applyProviderInstallPlan,
|
|
38
43
|
buildInstallPlan,
|
|
44
|
+
createFollowupController,
|
|
39
45
|
getDefaultBaseUrlForProtocol,
|
|
40
46
|
getDefaultModelIds,
|
|
41
47
|
resolveBaseUrl,
|
|
42
48
|
shouldShowStep
|
|
43
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-ZU2T5JIS.js";
|
|
44
50
|
import {
|
|
45
51
|
qwenOAuth2Events,
|
|
46
52
|
sanitizeForOsc
|
|
47
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-XDNFODER.js";
|
|
48
54
|
import {
|
|
55
|
+
ShellExecutionService,
|
|
49
56
|
allowEditorTypeInSandbox,
|
|
50
|
-
checkHasEditorType
|
|
51
|
-
|
|
57
|
+
checkHasEditorType,
|
|
58
|
+
compactToolResultDisplayForHistory,
|
|
59
|
+
isSignalTermination
|
|
60
|
+
} from "./chunk-PDUMGZ2P.js";
|
|
61
|
+
import {
|
|
62
|
+
formatMemoryUsage
|
|
63
|
+
} from "./chunk-CHEIIBT3.js";
|
|
52
64
|
import {
|
|
53
65
|
AuthEvent,
|
|
54
|
-
|
|
55
|
-
|
|
66
|
+
PromptSuggestionEvent,
|
|
67
|
+
logAuth,
|
|
68
|
+
logPromptSuggestion
|
|
69
|
+
} from "./chunk-6QV7Z74P.js";
|
|
70
|
+
import {
|
|
71
|
+
isBinary
|
|
72
|
+
} from "./chunk-7VEYUF3N.js";
|
|
56
73
|
import {
|
|
57
74
|
createDebugLogger,
|
|
58
75
|
getErrorMessage
|
|
@@ -1002,6 +1019,374 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem, onAuthCh
|
|
|
1002
1019
|
};
|
|
1003
1020
|
}, "useAuthCommand");
|
|
1004
1021
|
|
|
1022
|
+
// packages/cli/src/ui/hooks/shellCommandProcessor.ts
|
|
1023
|
+
init_esbuild_shims();
|
|
1024
|
+
var import_react4 = __toESM(require_react(), 1);
|
|
1025
|
+
import crypto from "node:crypto";
|
|
1026
|
+
import path from "node:path";
|
|
1027
|
+
import os from "node:os";
|
|
1028
|
+
import fs from "node:fs";
|
|
1029
|
+
var OUTPUT_UPDATE_INTERVAL_MS = 1e3;
|
|
1030
|
+
var MAX_OUTPUT_LENGTH = 1e4;
|
|
1031
|
+
var debugLogger3 = createDebugLogger("SHELL_COMMAND_PROCESSOR");
|
|
1032
|
+
function copyString(value) {
|
|
1033
|
+
return value.split("").join("");
|
|
1034
|
+
}
|
|
1035
|
+
__name(copyString, "copyString");
|
|
1036
|
+
function addShellCommandToLlmHistory(llmClient, rawQuery, resultText) {
|
|
1037
|
+
const modelContent = resultText.length > MAX_OUTPUT_LENGTH ? copyString(resultText.substring(0, MAX_OUTPUT_LENGTH)) + "\n... (truncated)" : resultText;
|
|
1038
|
+
llmClient.addHistory({
|
|
1039
|
+
role: "user",
|
|
1040
|
+
parts: [
|
|
1041
|
+
{
|
|
1042
|
+
text: `I ran the following shell command:
|
|
1043
|
+
\`\`\`sh
|
|
1044
|
+
${rawQuery}
|
|
1045
|
+
\`\`\`
|
|
1046
|
+
|
|
1047
|
+
This produced the following result:
|
|
1048
|
+
\`\`\`
|
|
1049
|
+
${modelContent}
|
|
1050
|
+
\`\`\``
|
|
1051
|
+
}
|
|
1052
|
+
]
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
__name(addShellCommandToLlmHistory, "addShellCommandToLlmHistory");
|
|
1056
|
+
var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPendingHistoryItem, onExec, onDebugMessage, config, llmClient, setShellInputFocused, terminalWidth, terminalHeight) => {
|
|
1057
|
+
const [activeShellPtyId, setActiveShellPtyId] = (0, import_react4.useState)(null);
|
|
1058
|
+
const handleShellCommand = (0, import_react4.useCallback)(
|
|
1059
|
+
(rawQuery, abortSignal) => {
|
|
1060
|
+
if (typeof rawQuery !== "string" || rawQuery.trim() === "") {
|
|
1061
|
+
return false;
|
|
1062
|
+
}
|
|
1063
|
+
const userMessageTimestamp = Date.now();
|
|
1064
|
+
const callId = `shell-${userMessageTimestamp}`;
|
|
1065
|
+
addItemToHistory(
|
|
1066
|
+
{ type: "user_shell", text: rawQuery },
|
|
1067
|
+
userMessageTimestamp
|
|
1068
|
+
);
|
|
1069
|
+
const isWindows = os.platform() === "win32";
|
|
1070
|
+
const targetDir = config.getTargetDir();
|
|
1071
|
+
let commandToExecute = rawQuery;
|
|
1072
|
+
let pwdFilePath;
|
|
1073
|
+
if (!isWindows) {
|
|
1074
|
+
let command = rawQuery.trim();
|
|
1075
|
+
const pwdFileName = `shell_pwd_${crypto.randomBytes(6).toString("hex")}.tmp`;
|
|
1076
|
+
pwdFilePath = path.join(os.tmpdir(), pwdFileName);
|
|
1077
|
+
const trailingBackslashes = /\\+$/.exec(command)?.[0].length ?? 0;
|
|
1078
|
+
if (trailingBackslashes % 2 === 1) {
|
|
1079
|
+
command += "\n";
|
|
1080
|
+
}
|
|
1081
|
+
if (!command.endsWith(";") && !command.endsWith("&")) {
|
|
1082
|
+
command += ";";
|
|
1083
|
+
}
|
|
1084
|
+
commandToExecute = `{ ${command}
|
|
1085
|
+
}; __code=$?; pwd > "${pwdFilePath}"; exit $__code`;
|
|
1086
|
+
}
|
|
1087
|
+
const executeCommand = /* @__PURE__ */ __name(async (resolve) => {
|
|
1088
|
+
let lastUpdateTime = Date.now();
|
|
1089
|
+
let cumulativeStdout = "";
|
|
1090
|
+
let isBinaryStream = false;
|
|
1091
|
+
let binaryBytesReceived = 0;
|
|
1092
|
+
const initialToolDisplay = {
|
|
1093
|
+
callId,
|
|
1094
|
+
name: SHELL_COMMAND_NAME,
|
|
1095
|
+
description: rawQuery,
|
|
1096
|
+
status: "Executing" /* Executing */,
|
|
1097
|
+
resultDisplay: "",
|
|
1098
|
+
confirmationDetails: void 0
|
|
1099
|
+
};
|
|
1100
|
+
setPendingHistoryItem({
|
|
1101
|
+
type: "tool_group",
|
|
1102
|
+
tools: [initialToolDisplay],
|
|
1103
|
+
isUserInitiated: true
|
|
1104
|
+
});
|
|
1105
|
+
let executionPid;
|
|
1106
|
+
const abortHandler = /* @__PURE__ */ __name(() => {
|
|
1107
|
+
onDebugMessage(
|
|
1108
|
+
`Aborting shell command (PID: ${executionPid ?? "unknown"})`
|
|
1109
|
+
);
|
|
1110
|
+
}, "abortHandler");
|
|
1111
|
+
abortSignal.addEventListener("abort", abortHandler, { once: true });
|
|
1112
|
+
onDebugMessage(`Executing in ${targetDir}: ${commandToExecute}`);
|
|
1113
|
+
const cleanupShellCommand = /* @__PURE__ */ __name(() => {
|
|
1114
|
+
abortSignal.removeEventListener("abort", abortHandler);
|
|
1115
|
+
if (pwdFilePath && fs.existsSync(pwdFilePath)) {
|
|
1116
|
+
fs.unlinkSync(pwdFilePath);
|
|
1117
|
+
}
|
|
1118
|
+
setActiveShellPtyId(null);
|
|
1119
|
+
setShellInputFocused(false);
|
|
1120
|
+
resolve();
|
|
1121
|
+
}, "cleanupShellCommand");
|
|
1122
|
+
try {
|
|
1123
|
+
const activeTheme = themeManager.getActiveTheme();
|
|
1124
|
+
const shellExecutionConfig = {
|
|
1125
|
+
...config.getShellExecutionConfig(),
|
|
1126
|
+
terminalWidth,
|
|
1127
|
+
terminalHeight,
|
|
1128
|
+
defaultFg: activeTheme.colors.Foreground,
|
|
1129
|
+
defaultBg: activeTheme.colors.Background
|
|
1130
|
+
};
|
|
1131
|
+
const { pid, result } = await ShellExecutionService.execute(
|
|
1132
|
+
commandToExecute,
|
|
1133
|
+
targetDir,
|
|
1134
|
+
(event) => {
|
|
1135
|
+
let shouldUpdate = false;
|
|
1136
|
+
switch (event.type) {
|
|
1137
|
+
case "data":
|
|
1138
|
+
if (isBinaryStream) break;
|
|
1139
|
+
if (config.getShouldUseNodePtyShell()) {
|
|
1140
|
+
cumulativeStdout = event.chunk;
|
|
1141
|
+
shouldUpdate = true;
|
|
1142
|
+
} else if (typeof event.chunk === "string" && typeof cumulativeStdout === "string") {
|
|
1143
|
+
cumulativeStdout += event.chunk;
|
|
1144
|
+
}
|
|
1145
|
+
break;
|
|
1146
|
+
case "binary_detected":
|
|
1147
|
+
isBinaryStream = true;
|
|
1148
|
+
shouldUpdate = true;
|
|
1149
|
+
break;
|
|
1150
|
+
case "binary_progress":
|
|
1151
|
+
isBinaryStream = true;
|
|
1152
|
+
binaryBytesReceived = event.bytesReceived;
|
|
1153
|
+
break;
|
|
1154
|
+
default: {
|
|
1155
|
+
throw new Error("An unhandled ShellOutputEvent was found.");
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
let currentDisplayOutput;
|
|
1159
|
+
if (isBinaryStream) {
|
|
1160
|
+
if (binaryBytesReceived > 0) {
|
|
1161
|
+
currentDisplayOutput = `[Receiving binary output... ${formatMemoryUsage(
|
|
1162
|
+
binaryBytesReceived
|
|
1163
|
+
)} received]`;
|
|
1164
|
+
} else {
|
|
1165
|
+
currentDisplayOutput = "[Binary output detected. Halting stream...]";
|
|
1166
|
+
}
|
|
1167
|
+
} else {
|
|
1168
|
+
currentDisplayOutput = cumulativeStdout;
|
|
1169
|
+
}
|
|
1170
|
+
if (shouldUpdate || Date.now() - lastUpdateTime > OUTPUT_UPDATE_INTERVAL_MS) {
|
|
1171
|
+
setPendingHistoryItem((prevItem) => {
|
|
1172
|
+
if (prevItem?.type === "tool_group") {
|
|
1173
|
+
return {
|
|
1174
|
+
...prevItem,
|
|
1175
|
+
tools: prevItem.tools.map(
|
|
1176
|
+
(tool) => tool.callId === callId ? {
|
|
1177
|
+
...tool,
|
|
1178
|
+
resultDisplay: typeof currentDisplayOutput === "string" ? compactToolResultDisplayForHistory(
|
|
1179
|
+
currentDisplayOutput
|
|
1180
|
+
) : compactToolResultDisplayForHistory({
|
|
1181
|
+
ansiOutput: currentDisplayOutput
|
|
1182
|
+
})
|
|
1183
|
+
} : tool
|
|
1184
|
+
)
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1187
|
+
return prevItem;
|
|
1188
|
+
});
|
|
1189
|
+
lastUpdateTime = Date.now();
|
|
1190
|
+
}
|
|
1191
|
+
},
|
|
1192
|
+
abortSignal,
|
|
1193
|
+
config.getShouldUseNodePtyShell(),
|
|
1194
|
+
shellExecutionConfig
|
|
1195
|
+
);
|
|
1196
|
+
debugLogger3.debug(terminalHeight, terminalWidth);
|
|
1197
|
+
executionPid = pid;
|
|
1198
|
+
if (pid) {
|
|
1199
|
+
setActiveShellPtyId(pid);
|
|
1200
|
+
setPendingHistoryItem((prevItem) => {
|
|
1201
|
+
if (prevItem?.type === "tool_group") {
|
|
1202
|
+
return {
|
|
1203
|
+
...prevItem,
|
|
1204
|
+
tools: prevItem.tools.map(
|
|
1205
|
+
(tool) => tool.callId === callId ? { ...tool, ptyId: pid } : tool
|
|
1206
|
+
)
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
return prevItem;
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
result.then((result2) => {
|
|
1213
|
+
setPendingHistoryItem(null);
|
|
1214
|
+
let mainContent;
|
|
1215
|
+
if (isBinary(result2.rawOutput)) {
|
|
1216
|
+
mainContent = "[Command produced binary output, which is not shown.]";
|
|
1217
|
+
} else {
|
|
1218
|
+
mainContent = result2.output.trim() || "(Command produced no output)";
|
|
1219
|
+
}
|
|
1220
|
+
let finalOutput = mainContent;
|
|
1221
|
+
let finalStatus = "Success" /* Success */;
|
|
1222
|
+
if (result2.error) {
|
|
1223
|
+
finalStatus = "Error" /* Error */;
|
|
1224
|
+
finalOutput = `${result2.error.message}
|
|
1225
|
+
${finalOutput}`;
|
|
1226
|
+
} else if (result2.aborted) {
|
|
1227
|
+
finalStatus = "Canceled" /* Canceled */;
|
|
1228
|
+
finalOutput = `Command was cancelled.
|
|
1229
|
+
${finalOutput}`;
|
|
1230
|
+
} else if (isSignalTermination(result2.signal)) {
|
|
1231
|
+
finalStatus = "Error" /* Error */;
|
|
1232
|
+
finalOutput = `Command terminated by signal: ${result2.signal}.
|
|
1233
|
+
${finalOutput}`;
|
|
1234
|
+
} else if (result2.exitCode !== 0) {
|
|
1235
|
+
finalStatus = "Error" /* Error */;
|
|
1236
|
+
finalOutput = `Command exited with code ${result2.exitCode}.
|
|
1237
|
+
${finalOutput}`;
|
|
1238
|
+
}
|
|
1239
|
+
if (pwdFilePath && fs.existsSync(pwdFilePath)) {
|
|
1240
|
+
const finalPwd = fs.readFileSync(pwdFilePath, "utf8").trim();
|
|
1241
|
+
if (finalPwd && finalPwd !== targetDir) {
|
|
1242
|
+
const warning = `WARNING: shell mode is stateless; the directory change to '${finalPwd}' will not persist.`;
|
|
1243
|
+
finalOutput = `${warning}
|
|
1244
|
+
|
|
1245
|
+
${finalOutput}`;
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
const finalToolDisplay = {
|
|
1249
|
+
...initialToolDisplay,
|
|
1250
|
+
status: finalStatus,
|
|
1251
|
+
resultDisplay: compactToolResultDisplayForHistory(finalOutput)
|
|
1252
|
+
};
|
|
1253
|
+
addItemToHistory(
|
|
1254
|
+
{
|
|
1255
|
+
type: "tool_group",
|
|
1256
|
+
tools: [finalToolDisplay],
|
|
1257
|
+
isUserInitiated: true
|
|
1258
|
+
},
|
|
1259
|
+
userMessageTimestamp
|
|
1260
|
+
);
|
|
1261
|
+
addShellCommandToLlmHistory(llmClient, rawQuery, finalOutput);
|
|
1262
|
+
}).catch((err) => {
|
|
1263
|
+
setPendingHistoryItem(null);
|
|
1264
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
1265
|
+
addItemToHistory(
|
|
1266
|
+
{
|
|
1267
|
+
type: "error",
|
|
1268
|
+
text: `An unexpected error occurred: ${errorMessage}`
|
|
1269
|
+
},
|
|
1270
|
+
userMessageTimestamp
|
|
1271
|
+
);
|
|
1272
|
+
}).finally(() => {
|
|
1273
|
+
cleanupShellCommand();
|
|
1274
|
+
});
|
|
1275
|
+
} catch (err) {
|
|
1276
|
+
setPendingHistoryItem(null);
|
|
1277
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
1278
|
+
addItemToHistory(
|
|
1279
|
+
{
|
|
1280
|
+
type: "error",
|
|
1281
|
+
text: `An unexpected error occurred: ${errorMessage}`
|
|
1282
|
+
},
|
|
1283
|
+
userMessageTimestamp
|
|
1284
|
+
);
|
|
1285
|
+
cleanupShellCommand();
|
|
1286
|
+
}
|
|
1287
|
+
}, "executeCommand");
|
|
1288
|
+
const execPromise = new Promise((resolve) => {
|
|
1289
|
+
executeCommand(resolve);
|
|
1290
|
+
});
|
|
1291
|
+
onExec(execPromise);
|
|
1292
|
+
return true;
|
|
1293
|
+
},
|
|
1294
|
+
[
|
|
1295
|
+
config,
|
|
1296
|
+
onDebugMessage,
|
|
1297
|
+
addItemToHistory,
|
|
1298
|
+
setPendingHistoryItem,
|
|
1299
|
+
onExec,
|
|
1300
|
+
llmClient,
|
|
1301
|
+
setShellInputFocused,
|
|
1302
|
+
terminalHeight,
|
|
1303
|
+
terminalWidth
|
|
1304
|
+
]
|
|
1305
|
+
);
|
|
1306
|
+
return { handleShellCommand, activeShellPtyId };
|
|
1307
|
+
}, "useShellCommandProcessor");
|
|
1308
|
+
|
|
1309
|
+
// packages/cli/src/ui/hooks/useFollowupSuggestions.tsx
|
|
1310
|
+
init_esbuild_shims();
|
|
1311
|
+
var import_react5 = __toESM(require_react(), 1);
|
|
1312
|
+
function useFollowupSuggestionsCLI(options = {}) {
|
|
1313
|
+
const { enabled = true, onAccept, config, isFocused = true } = options;
|
|
1314
|
+
const [state, setState] = (0, import_react5.useState)(INITIAL_FOLLOWUP_STATE);
|
|
1315
|
+
const onAcceptRef = (0, import_react5.useRef)(onAccept);
|
|
1316
|
+
onAcceptRef.current = onAccept;
|
|
1317
|
+
const configRef = (0, import_react5.useRef)(config);
|
|
1318
|
+
configRef.current = config;
|
|
1319
|
+
const firstKeystrokeAtRef = (0, import_react5.useRef)(0);
|
|
1320
|
+
const prevShownAtRef = (0, import_react5.useRef)(0);
|
|
1321
|
+
const wasFocusedWhenShownRef = (0, import_react5.useRef)(true);
|
|
1322
|
+
(0, import_react5.useEffect)(() => {
|
|
1323
|
+
if (state.shownAt > 0 && state.shownAt !== prevShownAtRef.current) {
|
|
1324
|
+
prevShownAtRef.current = state.shownAt;
|
|
1325
|
+
wasFocusedWhenShownRef.current = isFocused;
|
|
1326
|
+
firstKeystrokeAtRef.current = 0;
|
|
1327
|
+
} else if (state.shownAt === 0) {
|
|
1328
|
+
prevShownAtRef.current = 0;
|
|
1329
|
+
}
|
|
1330
|
+
}, [state.shownAt, isFocused]);
|
|
1331
|
+
const recordKeystroke = (0, import_react5.useCallback)(() => {
|
|
1332
|
+
if (firstKeystrokeAtRef.current === 0 && state.isVisible) {
|
|
1333
|
+
firstKeystrokeAtRef.current = Date.now();
|
|
1334
|
+
}
|
|
1335
|
+
}, [state.isVisible]);
|
|
1336
|
+
const onOutcome = (0, import_react5.useCallback)(
|
|
1337
|
+
(params) => {
|
|
1338
|
+
const cfg = configRef.current;
|
|
1339
|
+
if (!cfg) return;
|
|
1340
|
+
logPromptSuggestion(
|
|
1341
|
+
cfg,
|
|
1342
|
+
new PromptSuggestionEvent({
|
|
1343
|
+
outcome: params.outcome,
|
|
1344
|
+
accept_method: params.accept_method,
|
|
1345
|
+
accept_source: params.accept_source,
|
|
1346
|
+
...params.outcome === "accepted" ? { time_to_accept_ms: params.time_ms } : { time_to_ignore_ms: params.time_ms },
|
|
1347
|
+
// Skip for fallback accepts: the suggestion was never shown via the
|
|
1348
|
+
// timer (shownAt stayed 0), so `prevShownAtRef` still holds a previous
|
|
1349
|
+
// suggestion's timestamp and the delta would be meaningless.
|
|
1350
|
+
...params.accept_source !== "fallback" && firstKeystrokeAtRef.current > 0 && prevShownAtRef.current > 0 && {
|
|
1351
|
+
time_to_first_keystroke_ms: firstKeystrokeAtRef.current - prevShownAtRef.current
|
|
1352
|
+
},
|
|
1353
|
+
suggestion_length: params.suggestion_length,
|
|
1354
|
+
similarity: params.outcome === "accepted" ? 1 : 0,
|
|
1355
|
+
was_focused_when_shown: wasFocusedWhenShownRef.current
|
|
1356
|
+
})
|
|
1357
|
+
);
|
|
1358
|
+
},
|
|
1359
|
+
[]
|
|
1360
|
+
);
|
|
1361
|
+
const controller = (0, import_react5.useMemo)(
|
|
1362
|
+
() => createFollowupController({
|
|
1363
|
+
enabled,
|
|
1364
|
+
onStateChange: setState,
|
|
1365
|
+
getOnAccept: /* @__PURE__ */ __name(() => onAcceptRef.current, "getOnAccept"),
|
|
1366
|
+
onOutcome
|
|
1367
|
+
}),
|
|
1368
|
+
[enabled, onOutcome]
|
|
1369
|
+
);
|
|
1370
|
+
(0, import_react5.useEffect)(() => {
|
|
1371
|
+
if (!enabled) {
|
|
1372
|
+
controller.clear();
|
|
1373
|
+
}
|
|
1374
|
+
return () => controller.cleanup();
|
|
1375
|
+
}, [controller, enabled]);
|
|
1376
|
+
return (0, import_react5.useMemo)(
|
|
1377
|
+
() => ({
|
|
1378
|
+
state,
|
|
1379
|
+
setSuggestion: controller.setSuggestion,
|
|
1380
|
+
accept: controller.accept,
|
|
1381
|
+
dismiss: controller.dismiss,
|
|
1382
|
+
clear: controller.clear,
|
|
1383
|
+
recordKeystroke
|
|
1384
|
+
}),
|
|
1385
|
+
[state, controller, recordKeystroke]
|
|
1386
|
+
);
|
|
1387
|
+
}
|
|
1388
|
+
__name(useFollowupSuggestionsCLI, "useFollowupSuggestionsCLI");
|
|
1389
|
+
|
|
1005
1390
|
// packages/cli/src/ui/components/mcp/utils.ts
|
|
1006
1391
|
init_esbuild_shims();
|
|
1007
1392
|
|
|
@@ -1234,7 +1619,7 @@ var TableRow = /* @__PURE__ */ __name(({ cells }) => /* @__PURE__ */ (0, import_
|
|
|
1234
1619
|
|
|
1235
1620
|
// packages/cli/src/ui/auth/useProviderSetupFlow.ts
|
|
1236
1621
|
init_esbuild_shims();
|
|
1237
|
-
var
|
|
1622
|
+
var import_react6 = __toESM(require_react(), 1);
|
|
1238
1623
|
var STEP_ORDER = [
|
|
1239
1624
|
"protocol",
|
|
1240
1625
|
"baseUrl",
|
|
@@ -1251,28 +1636,28 @@ function getVisibleSteps(config) {
|
|
|
1251
1636
|
}
|
|
1252
1637
|
__name(getVisibleSteps, "getVisibleSteps");
|
|
1253
1638
|
function useProviderSetupFlow(onSubmit) {
|
|
1254
|
-
const [provider, setProvider] = (0,
|
|
1255
|
-
const [visibleSteps, setVisibleSteps] = (0,
|
|
1256
|
-
const [stepIndex, setStepIndex] = (0,
|
|
1257
|
-
const [protocol, setProtocol] = (0,
|
|
1258
|
-
const [baseUrl, setBaseUrl] = (0,
|
|
1259
|
-
const [baseUrlPlaceholder, setBaseUrlPlaceholder] = (0,
|
|
1260
|
-
const [baseUrlOptionIndex, setBaseUrlOptionIndex] = (0,
|
|
1261
|
-
const [baseUrlError, setBaseUrlError] = (0,
|
|
1262
|
-
const [apiKey, setApiKey] = (0,
|
|
1263
|
-
const [apiKeyError, setApiKeyError] = (0,
|
|
1264
|
-
const [modelIds, setModelIds] = (0,
|
|
1265
|
-
const [modelIdsError, setModelIdsError] = (0,
|
|
1266
|
-
const [thinkingEnabled, setThinkingEnabled] = (0,
|
|
1267
|
-
const [modalityEnabled, setModalityEnabled] = (0,
|
|
1268
|
-
const [modalityImage, setModalityImage] = (0,
|
|
1269
|
-
const [modalityVideo, setModalityVideo] = (0,
|
|
1270
|
-
const [modalityAudio, setModalityAudio] = (0,
|
|
1271
|
-
const [modalityPdf, setModalityPdf] = (0,
|
|
1272
|
-
const [contextWindowSize, setContextWindowSize] = (0,
|
|
1273
|
-
const [focusedConfigIndex, setFocusedConfigIndex] = (0,
|
|
1639
|
+
const [provider, setProvider] = (0, import_react6.useState)(null);
|
|
1640
|
+
const [visibleSteps, setVisibleSteps] = (0, import_react6.useState)([]);
|
|
1641
|
+
const [stepIndex, setStepIndex] = (0, import_react6.useState)(0);
|
|
1642
|
+
const [protocol, setProtocol] = (0, import_react6.useState)("openai" /* USE_OPENAI */);
|
|
1643
|
+
const [baseUrl, setBaseUrl] = (0, import_react6.useState)("");
|
|
1644
|
+
const [baseUrlPlaceholder, setBaseUrlPlaceholder] = (0, import_react6.useState)("");
|
|
1645
|
+
const [baseUrlOptionIndex, setBaseUrlOptionIndex] = (0, import_react6.useState)(0);
|
|
1646
|
+
const [baseUrlError, setBaseUrlError] = (0, import_react6.useState)(null);
|
|
1647
|
+
const [apiKey, setApiKey] = (0, import_react6.useState)("");
|
|
1648
|
+
const [apiKeyError, setApiKeyError] = (0, import_react6.useState)(null);
|
|
1649
|
+
const [modelIds, setModelIds] = (0, import_react6.useState)("");
|
|
1650
|
+
const [modelIdsError, setModelIdsError] = (0, import_react6.useState)(null);
|
|
1651
|
+
const [thinkingEnabled, setThinkingEnabled] = (0, import_react6.useState)(false);
|
|
1652
|
+
const [modalityEnabled, setModalityEnabled] = (0, import_react6.useState)(false);
|
|
1653
|
+
const [modalityImage, setModalityImage] = (0, import_react6.useState)(true);
|
|
1654
|
+
const [modalityVideo, setModalityVideo] = (0, import_react6.useState)(true);
|
|
1655
|
+
const [modalityAudio, setModalityAudio] = (0, import_react6.useState)(false);
|
|
1656
|
+
const [modalityPdf, setModalityPdf] = (0, import_react6.useState)(false);
|
|
1657
|
+
const [contextWindowSize, setContextWindowSize] = (0, import_react6.useState)("");
|
|
1658
|
+
const [focusedConfigIndex, setFocusedConfigIndex] = (0, import_react6.useState)(0);
|
|
1274
1659
|
const currentStep = visibleSteps[stepIndex] ?? null;
|
|
1275
|
-
const start = (0,
|
|
1660
|
+
const start = (0, import_react6.useCallback)(
|
|
1276
1661
|
(config, initialProtocol, existingEnv, existingModelIds) => {
|
|
1277
1662
|
setProvider(config);
|
|
1278
1663
|
const steps = getVisibleSteps(config);
|
|
@@ -1309,12 +1694,12 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1309
1694
|
},
|
|
1310
1695
|
[]
|
|
1311
1696
|
);
|
|
1312
|
-
const reset = (0,
|
|
1697
|
+
const reset = (0, import_react6.useCallback)(() => {
|
|
1313
1698
|
setProvider(null);
|
|
1314
1699
|
setVisibleSteps([]);
|
|
1315
1700
|
setStepIndex(0);
|
|
1316
1701
|
}, []);
|
|
1317
|
-
const goBack = (0,
|
|
1702
|
+
const goBack = (0, import_react6.useCallback)(() => {
|
|
1318
1703
|
if (stepIndex > 0) {
|
|
1319
1704
|
setStepIndex((i) => i - 1);
|
|
1320
1705
|
return true;
|
|
@@ -1322,10 +1707,10 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1322
1707
|
reset();
|
|
1323
1708
|
return false;
|
|
1324
1709
|
}, [stepIndex, reset]);
|
|
1325
|
-
const goNext = (0,
|
|
1710
|
+
const goNext = (0, import_react6.useCallback)(() => {
|
|
1326
1711
|
setStepIndex((i) => Math.min(i + 1, visibleSteps.length - 1));
|
|
1327
1712
|
}, [visibleSteps]);
|
|
1328
|
-
const selectProtocol = (0,
|
|
1713
|
+
const selectProtocol = (0, import_react6.useCallback)(
|
|
1329
1714
|
(selectedProtocol) => {
|
|
1330
1715
|
setProtocol(selectedProtocol);
|
|
1331
1716
|
setBaseUrl("");
|
|
@@ -1336,7 +1721,7 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1336
1721
|
},
|
|
1337
1722
|
[goNext]
|
|
1338
1723
|
);
|
|
1339
|
-
const selectBaseUrl = (0,
|
|
1724
|
+
const selectBaseUrl = (0, import_react6.useCallback)(
|
|
1340
1725
|
(selectedUrl) => {
|
|
1341
1726
|
setBaseUrl(selectedUrl);
|
|
1342
1727
|
setBaseUrlError(null);
|
|
@@ -1344,7 +1729,7 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1344
1729
|
},
|
|
1345
1730
|
[goNext]
|
|
1346
1731
|
);
|
|
1347
|
-
const submitBaseUrl = (0,
|
|
1732
|
+
const submitBaseUrl = (0, import_react6.useCallback)(() => {
|
|
1348
1733
|
const effective = baseUrl.trim() || baseUrlPlaceholder.trim();
|
|
1349
1734
|
if (!effective) {
|
|
1350
1735
|
setBaseUrlError(t("Base URL cannot be empty."));
|
|
@@ -1361,15 +1746,15 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1361
1746
|
goNext();
|
|
1362
1747
|
return true;
|
|
1363
1748
|
}, [baseUrl, baseUrlPlaceholder, goNext]);
|
|
1364
|
-
const changeBaseUrl = (0,
|
|
1749
|
+
const changeBaseUrl = (0, import_react6.useCallback)((value) => {
|
|
1365
1750
|
setBaseUrl(value);
|
|
1366
1751
|
setBaseUrlError(null);
|
|
1367
1752
|
}, []);
|
|
1368
|
-
const changeApiKey = (0,
|
|
1753
|
+
const changeApiKey = (0, import_react6.useCallback)((value) => {
|
|
1369
1754
|
setApiKey(value);
|
|
1370
1755
|
setApiKeyError(null);
|
|
1371
1756
|
}, []);
|
|
1372
|
-
const buildCurrentInputs = (0,
|
|
1757
|
+
const buildCurrentInputs = (0, import_react6.useCallback)(
|
|
1373
1758
|
(overrides) => ({
|
|
1374
1759
|
protocol: provider?.protocolOptions ? protocol : void 0,
|
|
1375
1760
|
baseUrl: baseUrl.trim(),
|
|
@@ -1379,7 +1764,7 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1379
1764
|
}),
|
|
1380
1765
|
[provider, protocol, baseUrl, apiKey, modelIds]
|
|
1381
1766
|
);
|
|
1382
|
-
const submitOrNext = (0,
|
|
1767
|
+
const submitOrNext = (0, import_react6.useCallback)(
|
|
1383
1768
|
(overrides) => {
|
|
1384
1769
|
if (stepIndex >= visibleSteps.length - 1) {
|
|
1385
1770
|
if (provider) void onSubmit(provider, buildCurrentInputs(overrides));
|
|
@@ -1389,7 +1774,7 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1389
1774
|
},
|
|
1390
1775
|
[stepIndex, visibleSteps, provider, onSubmit, buildCurrentInputs, goNext]
|
|
1391
1776
|
);
|
|
1392
|
-
const submitApiKey = (0,
|
|
1777
|
+
const submitApiKey = (0, import_react6.useCallback)(
|
|
1393
1778
|
(keyOverride) => {
|
|
1394
1779
|
const trimmed = (keyOverride ?? apiKey).trim();
|
|
1395
1780
|
if (!trimmed) {
|
|
@@ -1410,7 +1795,7 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1410
1795
|
},
|
|
1411
1796
|
[apiKey, provider, baseUrl, submitOrNext]
|
|
1412
1797
|
);
|
|
1413
|
-
const highlightBaseUrl = (0,
|
|
1798
|
+
const highlightBaseUrl = (0, import_react6.useCallback)(
|
|
1414
1799
|
(url) => {
|
|
1415
1800
|
if (provider && Array.isArray(provider.baseUrl)) {
|
|
1416
1801
|
const idx = provider.baseUrl.findIndex((o) => o.url === url);
|
|
@@ -1419,14 +1804,14 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1419
1804
|
},
|
|
1420
1805
|
[provider]
|
|
1421
1806
|
);
|
|
1422
|
-
const changeModelIds = (0,
|
|
1807
|
+
const changeModelIds = (0, import_react6.useCallback)((value) => {
|
|
1423
1808
|
setModelIds(value);
|
|
1424
1809
|
setModelIdsError(null);
|
|
1425
1810
|
}, []);
|
|
1426
|
-
const clearModelIdsError = (0,
|
|
1811
|
+
const clearModelIdsError = (0, import_react6.useCallback)(() => {
|
|
1427
1812
|
setModelIdsError(null);
|
|
1428
1813
|
}, []);
|
|
1429
|
-
const submitModelIds = (0,
|
|
1814
|
+
const submitModelIds = (0, import_react6.useCallback)(
|
|
1430
1815
|
(overrides) => {
|
|
1431
1816
|
const normalized = overrides?.modelIds ?? normalizeModelIds(modelIds);
|
|
1432
1817
|
if (normalized.length === 0) {
|
|
@@ -1441,13 +1826,13 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1441
1826
|
[modelIds, submitOrNext]
|
|
1442
1827
|
);
|
|
1443
1828
|
const advancedOptionCount = modalityEnabled ? 7 : 3;
|
|
1444
|
-
const moveAdvancedFocusUp = (0,
|
|
1829
|
+
const moveAdvancedFocusUp = (0, import_react6.useCallback)(() => {
|
|
1445
1830
|
setFocusedConfigIndex((v) => v <= 0 ? advancedOptionCount - 1 : v - 1);
|
|
1446
1831
|
}, [advancedOptionCount]);
|
|
1447
|
-
const moveAdvancedFocusDown = (0,
|
|
1832
|
+
const moveAdvancedFocusDown = (0, import_react6.useCallback)(() => {
|
|
1448
1833
|
setFocusedConfigIndex((v) => v >= advancedOptionCount - 1 ? 0 : v + 1);
|
|
1449
1834
|
}, [advancedOptionCount]);
|
|
1450
|
-
const toggleFocusedAdvancedOption = (0,
|
|
1835
|
+
const toggleFocusedAdvancedOption = (0, import_react6.useCallback)(() => {
|
|
1451
1836
|
switch (focusedConfigIndex) {
|
|
1452
1837
|
case 0:
|
|
1453
1838
|
setThinkingEnabled((v) => !v);
|
|
@@ -1471,13 +1856,13 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1471
1856
|
break;
|
|
1472
1857
|
}
|
|
1473
1858
|
}, [focusedConfigIndex]);
|
|
1474
|
-
const submitAdvancedConfig = (0,
|
|
1859
|
+
const submitAdvancedConfig = (0, import_react6.useCallback)(() => {
|
|
1475
1860
|
goNext();
|
|
1476
1861
|
}, [goNext]);
|
|
1477
|
-
const changeContextWindowSize = (0,
|
|
1862
|
+
const changeContextWindowSize = (0, import_react6.useCallback)((value) => {
|
|
1478
1863
|
setContextWindowSize(value.replace(/[^0-9]/g, ""));
|
|
1479
1864
|
}, []);
|
|
1480
|
-
const submit = (0,
|
|
1865
|
+
const submit = (0, import_react6.useCallback)(() => {
|
|
1481
1866
|
if (!provider) return;
|
|
1482
1867
|
const multimodal = modalityEnabled ? {
|
|
1483
1868
|
image: modalityImage || void 0,
|
|
@@ -1505,7 +1890,7 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1505
1890
|
onSubmit,
|
|
1506
1891
|
buildCurrentInputs
|
|
1507
1892
|
]);
|
|
1508
|
-
const getPreviewJson = (0,
|
|
1893
|
+
const getPreviewJson = (0, import_react6.useCallback)(() => {
|
|
1509
1894
|
if (!provider) return "";
|
|
1510
1895
|
const envKey = typeof provider.envKey === "function" ? provider.envKey(protocol, baseUrl.trim()) : provider.envKey;
|
|
1511
1896
|
const normalizedIds = normalizeModelIds(modelIds);
|
|
@@ -1655,342 +2040,14 @@ var EditorSettingsManager = class {
|
|
|
1655
2040
|
};
|
|
1656
2041
|
var editorSettingsManager = new EditorSettingsManager();
|
|
1657
2042
|
|
|
1658
|
-
// packages/cli/src/ui/statusLinePresets.ts
|
|
1659
|
-
init_esbuild_shims();
|
|
1660
|
-
import nodePath from "node:path";
|
|
1661
|
-
var STATUS_LINE_PRESET_ITEM_IDS = [
|
|
1662
|
-
"project-name",
|
|
1663
|
-
"git-branch",
|
|
1664
|
-
"model-with-reasoning",
|
|
1665
|
-
"model",
|
|
1666
|
-
"context-remaining",
|
|
1667
|
-
"total-input-tokens",
|
|
1668
|
-
"total-output-tokens",
|
|
1669
|
-
"current-dir",
|
|
1670
|
-
"pull-request-number",
|
|
1671
|
-
"branch-changes",
|
|
1672
|
-
"context-used",
|
|
1673
|
-
"run-state",
|
|
1674
|
-
"qwen-version",
|
|
1675
|
-
"context-window-size",
|
|
1676
|
-
"used-tokens",
|
|
1677
|
-
"session-id"
|
|
1678
|
-
];
|
|
1679
|
-
function aggregateModelTokens(metrics) {
|
|
1680
|
-
let totalInputTokens = 0;
|
|
1681
|
-
let totalOutputTokens = 0;
|
|
1682
|
-
for (const modelMetrics of Object.values(metrics.models)) {
|
|
1683
|
-
totalInputTokens += modelMetrics.tokens.prompt;
|
|
1684
|
-
totalOutputTokens += modelMetrics.tokens.candidates;
|
|
1685
|
-
}
|
|
1686
|
-
return { totalInputTokens, totalOutputTokens };
|
|
1687
|
-
}
|
|
1688
|
-
__name(aggregateModelTokens, "aggregateModelTokens");
|
|
1689
|
-
var STATUS_LINE_PRESET_ITEMS = [
|
|
1690
|
-
{
|
|
1691
|
-
id: "project-name",
|
|
1692
|
-
label: "project-name",
|
|
1693
|
-
description: "Project name when available",
|
|
1694
|
-
defaultSelected: true
|
|
1695
|
-
},
|
|
1696
|
-
{
|
|
1697
|
-
id: "git-branch",
|
|
1698
|
-
label: "git-branch",
|
|
1699
|
-
description: "Current Git branch when available",
|
|
1700
|
-
defaultSelected: true
|
|
1701
|
-
},
|
|
1702
|
-
{
|
|
1703
|
-
id: "model-with-reasoning",
|
|
1704
|
-
label: "model-with-reasoning",
|
|
1705
|
-
description: "Current model name with reasoning level when available",
|
|
1706
|
-
defaultSelected: true
|
|
1707
|
-
},
|
|
1708
|
-
{
|
|
1709
|
-
id: "model",
|
|
1710
|
-
label: "model-only",
|
|
1711
|
-
description: "Current model name without reasoning level"
|
|
1712
|
-
},
|
|
1713
|
-
{
|
|
1714
|
-
id: "context-remaining",
|
|
1715
|
-
label: "context-remaining",
|
|
1716
|
-
description: "Percentage of context window remaining"
|
|
1717
|
-
},
|
|
1718
|
-
{
|
|
1719
|
-
id: "total-input-tokens",
|
|
1720
|
-
label: "total-input-tokens",
|
|
1721
|
-
description: "Total input tokens used in session"
|
|
1722
|
-
},
|
|
1723
|
-
{
|
|
1724
|
-
id: "total-output-tokens",
|
|
1725
|
-
label: "total-output-tokens",
|
|
1726
|
-
description: "Total output tokens used in session"
|
|
1727
|
-
},
|
|
1728
|
-
{
|
|
1729
|
-
id: "current-dir",
|
|
1730
|
-
label: "current-dir",
|
|
1731
|
-
description: "Current working directory"
|
|
1732
|
-
},
|
|
1733
|
-
{
|
|
1734
|
-
id: "pull-request-number",
|
|
1735
|
-
label: "pull-request-number",
|
|
1736
|
-
description: "Open pull request number for the current branch"
|
|
1737
|
-
},
|
|
1738
|
-
{
|
|
1739
|
-
id: "branch-changes",
|
|
1740
|
-
label: "branch-changes",
|
|
1741
|
-
description: "Session file changes added and removed"
|
|
1742
|
-
},
|
|
1743
|
-
{
|
|
1744
|
-
id: "context-used",
|
|
1745
|
-
label: "context-used",
|
|
1746
|
-
description: "Percentage of context window used",
|
|
1747
|
-
defaultSelected: true
|
|
1748
|
-
},
|
|
1749
|
-
{
|
|
1750
|
-
id: "run-state",
|
|
1751
|
-
label: "run-state",
|
|
1752
|
-
description: "Compact session run-state text"
|
|
1753
|
-
},
|
|
1754
|
-
{
|
|
1755
|
-
id: "qwen-version",
|
|
1756
|
-
label: "qwen-version",
|
|
1757
|
-
description: "Qwen Code application version"
|
|
1758
|
-
},
|
|
1759
|
-
{
|
|
1760
|
-
id: "context-window-size",
|
|
1761
|
-
label: "context-window-size",
|
|
1762
|
-
description: "Total context window size in tokens"
|
|
1763
|
-
},
|
|
1764
|
-
{
|
|
1765
|
-
id: "used-tokens",
|
|
1766
|
-
label: "used-tokens",
|
|
1767
|
-
description: "Current prompt tokens used"
|
|
1768
|
-
},
|
|
1769
|
-
{
|
|
1770
|
-
id: "session-id",
|
|
1771
|
-
label: "session-id",
|
|
1772
|
-
description: "Current session identifier"
|
|
1773
|
-
}
|
|
1774
|
-
];
|
|
1775
|
-
var STATUS_LINE_PRESET_ITEM_ID_SET = new Set(
|
|
1776
|
-
STATUS_LINE_PRESET_ITEM_IDS
|
|
1777
|
-
);
|
|
1778
|
-
function orderStatusLinePresetItems(items) {
|
|
1779
|
-
const selectedItems = new Set(
|
|
1780
|
-
items.filter(
|
|
1781
|
-
(item) => typeof item === "string" && STATUS_LINE_PRESET_ITEM_ID_SET.has(item)
|
|
1782
|
-
)
|
|
1783
|
-
);
|
|
1784
|
-
return STATUS_LINE_PRESET_ITEM_IDS.filter((item) => selectedItems.has(item));
|
|
1785
|
-
}
|
|
1786
|
-
__name(orderStatusLinePresetItems, "orderStatusLinePresetItems");
|
|
1787
|
-
var DEFAULT_STATUS_LINE_PRESET_CONFIG = {
|
|
1788
|
-
type: "preset",
|
|
1789
|
-
useThemeColors: true,
|
|
1790
|
-
items: orderStatusLinePresetItems(
|
|
1791
|
-
STATUS_LINE_PRESET_ITEMS.filter((item) => item.defaultSelected).map(
|
|
1792
|
-
(item) => item.id
|
|
1793
|
-
)
|
|
1794
|
-
)
|
|
1795
|
-
};
|
|
1796
|
-
function normalizeStatusLinePresetConfig(raw) {
|
|
1797
|
-
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
1798
|
-
return void 0;
|
|
1799
|
-
}
|
|
1800
|
-
const candidate = raw;
|
|
1801
|
-
if (candidate["type"] !== "preset") {
|
|
1802
|
-
return void 0;
|
|
1803
|
-
}
|
|
1804
|
-
const hasItemsArray = Array.isArray(candidate["items"]);
|
|
1805
|
-
const items = hasItemsArray ? orderStatusLinePresetItems(candidate["items"]) : [];
|
|
1806
|
-
return {
|
|
1807
|
-
type: "preset",
|
|
1808
|
-
useThemeColors: typeof candidate["useThemeColors"] === "boolean" ? candidate["useThemeColors"] : true,
|
|
1809
|
-
items: hasItemsArray ? items : [...DEFAULT_STATUS_LINE_PRESET_CONFIG.items],
|
|
1810
|
-
hideContextIndicator: typeof candidate["hideContextIndicator"] === "boolean" ? candidate["hideContextIndicator"] : void 0
|
|
1811
|
-
};
|
|
1812
|
-
}
|
|
1813
|
-
__name(normalizeStatusLinePresetConfig, "normalizeStatusLinePresetConfig");
|
|
1814
|
-
function formatPercent(value) {
|
|
1815
|
-
if (!Number.isFinite(value)) {
|
|
1816
|
-
return "0%";
|
|
1817
|
-
}
|
|
1818
|
-
const rounded = Math.round(value * 10) / 10;
|
|
1819
|
-
return `${Number.isInteger(rounded) ? rounded.toFixed(0) : rounded}%`;
|
|
1820
|
-
}
|
|
1821
|
-
__name(formatPercent, "formatPercent");
|
|
1822
|
-
function formatTokenCount(value) {
|
|
1823
|
-
if (!Number.isFinite(value) || value <= 0) {
|
|
1824
|
-
return "0";
|
|
1825
|
-
}
|
|
1826
|
-
if (value >= 1e6) {
|
|
1827
|
-
return `${(value / 1e6).toFixed(1)}m`;
|
|
1828
|
-
}
|
|
1829
|
-
if (value >= 1e3) {
|
|
1830
|
-
return `${(value / 1e3).toFixed(1)}k`;
|
|
1831
|
-
}
|
|
1832
|
-
return String(Math.round(value));
|
|
1833
|
-
}
|
|
1834
|
-
__name(formatTokenCount, "formatTokenCount");
|
|
1835
|
-
function getRunStateLabel(state) {
|
|
1836
|
-
switch (state) {
|
|
1837
|
-
case "idle" /* Idle */:
|
|
1838
|
-
return "Ready";
|
|
1839
|
-
case "responding" /* Responding */:
|
|
1840
|
-
return "Working";
|
|
1841
|
-
case "waiting_for_confirmation" /* WaitingForConfirmation */:
|
|
1842
|
-
return "Confirm";
|
|
1843
|
-
default:
|
|
1844
|
-
return "Working";
|
|
1845
|
-
}
|
|
1846
|
-
}
|
|
1847
|
-
__name(getRunStateLabel, "getRunStateLabel");
|
|
1848
|
-
function stripProviderPrefix(name) {
|
|
1849
|
-
return name.replace(/^\[[^\]]*\]\s*/, "");
|
|
1850
|
-
}
|
|
1851
|
-
__name(stripProviderPrefix, "stripProviderPrefix");
|
|
1852
|
-
function formatModelWithReasoning(modelDisplayName, reasoning) {
|
|
1853
|
-
const cleanName = stripProviderPrefix(modelDisplayName);
|
|
1854
|
-
if (reasoning === false) {
|
|
1855
|
-
return `${cleanName} reasoning off`;
|
|
1856
|
-
}
|
|
1857
|
-
if (reasoning?.effort) {
|
|
1858
|
-
return `${cleanName} ${reasoning.effort}`;
|
|
1859
|
-
}
|
|
1860
|
-
return cleanName;
|
|
1861
|
-
}
|
|
1862
|
-
__name(formatModelWithReasoning, "formatModelWithReasoning");
|
|
1863
|
-
function inferPullRequestNumber(branch) {
|
|
1864
|
-
if (!branch) {
|
|
1865
|
-
return void 0;
|
|
1866
|
-
}
|
|
1867
|
-
const match = branch.match(
|
|
1868
|
-
/(?:^|[/_-])(?:pr|pull|pull-request)[/_-]?#?(\d+)(?:$|[/_-])/i
|
|
1869
|
-
);
|
|
1870
|
-
return match?.[1];
|
|
1871
|
-
}
|
|
1872
|
-
__name(inferPullRequestNumber, "inferPullRequestNumber");
|
|
1873
|
-
function buildStatusLinePresetData(params) {
|
|
1874
|
-
const usedPercentage = params.contextWindowSize > 0 ? Math.min(
|
|
1875
|
-
100,
|
|
1876
|
-
Math.max(
|
|
1877
|
-
0,
|
|
1878
|
-
Math.round(
|
|
1879
|
-
params.currentUsage / params.contextWindowSize * 1e3
|
|
1880
|
-
) / 10
|
|
1881
|
-
)
|
|
1882
|
-
) : 0;
|
|
1883
|
-
return {
|
|
1884
|
-
sessionId: params.sessionId,
|
|
1885
|
-
version: params.version || "unknown",
|
|
1886
|
-
modelDisplayName: params.modelDisplayName || "unknown",
|
|
1887
|
-
reasoning: params.reasoning,
|
|
1888
|
-
currentDir: params.currentDir,
|
|
1889
|
-
projectName: nodePath.basename(params.currentDir) || void 0,
|
|
1890
|
-
branch: params.branch,
|
|
1891
|
-
pullRequestNumber: params.pullRequestNumber,
|
|
1892
|
-
contextWindowSize: params.contextWindowSize,
|
|
1893
|
-
usedPercentage,
|
|
1894
|
-
remainingPercentage: Math.round((100 - usedPercentage) * 10) / 10,
|
|
1895
|
-
currentUsage: params.currentUsage,
|
|
1896
|
-
totalInputTokens: params.totalInputTokens,
|
|
1897
|
-
totalOutputTokens: params.totalOutputTokens,
|
|
1898
|
-
totalLinesAdded: params.totalLinesAdded,
|
|
1899
|
-
totalLinesRemoved: params.totalLinesRemoved,
|
|
1900
|
-
streamingState: params.streamingState
|
|
1901
|
-
};
|
|
1902
|
-
}
|
|
1903
|
-
__name(buildStatusLinePresetData, "buildStatusLinePresetData");
|
|
1904
|
-
function formatPresetItem(item, data) {
|
|
1905
|
-
switch (item) {
|
|
1906
|
-
case "model-with-reasoning":
|
|
1907
|
-
return formatModelWithReasoning(data.modelDisplayName, data.reasoning);
|
|
1908
|
-
case "model":
|
|
1909
|
-
return stripProviderPrefix(data.modelDisplayName);
|
|
1910
|
-
case "context-remaining":
|
|
1911
|
-
if (data.contextWindowSize > 0) {
|
|
1912
|
-
return `Context ${formatPercent(data.remainingPercentage)} left`;
|
|
1913
|
-
}
|
|
1914
|
-
return void 0;
|
|
1915
|
-
case "current-dir":
|
|
1916
|
-
return data.currentDir;
|
|
1917
|
-
case "context-used":
|
|
1918
|
-
if (data.contextWindowSize > 0 && data.usedPercentage > 0) {
|
|
1919
|
-
return `${formatTokenCount(data.contextWindowSize)} Context ${formatPercent(data.usedPercentage)} used`;
|
|
1920
|
-
}
|
|
1921
|
-
return void 0;
|
|
1922
|
-
case "git-branch":
|
|
1923
|
-
if (data.branch) {
|
|
1924
|
-
return `git:(${data.branch})`;
|
|
1925
|
-
}
|
|
1926
|
-
return void 0;
|
|
1927
|
-
case "project-name":
|
|
1928
|
-
if (data.projectName) {
|
|
1929
|
-
return `\u279C ${data.projectName}`;
|
|
1930
|
-
}
|
|
1931
|
-
return void 0;
|
|
1932
|
-
case "pull-request-number": {
|
|
1933
|
-
const prNumber = data.pullRequestNumber ?? inferPullRequestNumber(data.branch);
|
|
1934
|
-
if (prNumber) {
|
|
1935
|
-
return `#${prNumber}`;
|
|
1936
|
-
}
|
|
1937
|
-
return void 0;
|
|
1938
|
-
}
|
|
1939
|
-
case "branch-changes":
|
|
1940
|
-
if (data.totalLinesAdded > 0 || data.totalLinesRemoved > 0) {
|
|
1941
|
-
return `+${data.totalLinesAdded} -${data.totalLinesRemoved}`;
|
|
1942
|
-
}
|
|
1943
|
-
return void 0;
|
|
1944
|
-
case "run-state":
|
|
1945
|
-
return getRunStateLabel(data.streamingState);
|
|
1946
|
-
case "qwen-version":
|
|
1947
|
-
return `v${data.version}`;
|
|
1948
|
-
case "context-window-size":
|
|
1949
|
-
if (data.contextWindowSize > 0) {
|
|
1950
|
-
return `${formatTokenCount(data.contextWindowSize)} window`;
|
|
1951
|
-
}
|
|
1952
|
-
return void 0;
|
|
1953
|
-
case "used-tokens":
|
|
1954
|
-
if (data.currentUsage > 0) {
|
|
1955
|
-
return `${formatTokenCount(data.currentUsage)} used`;
|
|
1956
|
-
}
|
|
1957
|
-
return void 0;
|
|
1958
|
-
case "total-input-tokens":
|
|
1959
|
-
return `${formatTokenCount(data.totalInputTokens)} total in`;
|
|
1960
|
-
case "total-output-tokens":
|
|
1961
|
-
return `${formatTokenCount(data.totalOutputTokens)} total out`;
|
|
1962
|
-
case "session-id":
|
|
1963
|
-
return data.sessionId || void 0;
|
|
1964
|
-
default: {
|
|
1965
|
-
item;
|
|
1966
|
-
return void 0;
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
}
|
|
1970
|
-
__name(formatPresetItem, "formatPresetItem");
|
|
1971
|
-
function buildStatusLinePresetParts(config, data) {
|
|
1972
|
-
const parts = [];
|
|
1973
|
-
for (const item of orderStatusLinePresetItems(config.items)) {
|
|
1974
|
-
const text = formatPresetItem(item, data);
|
|
1975
|
-
if (text) {
|
|
1976
|
-
parts.push(text);
|
|
1977
|
-
}
|
|
1978
|
-
}
|
|
1979
|
-
return parts;
|
|
1980
|
-
}
|
|
1981
|
-
__name(buildStatusLinePresetParts, "buildStatusLinePresetParts");
|
|
1982
|
-
function buildStatusLinePresetLines(config, data) {
|
|
1983
|
-
const line = buildStatusLinePresetParts(config, data).join(" \xB7 ");
|
|
1984
|
-
return line ? [line] : [];
|
|
1985
|
-
}
|
|
1986
|
-
__name(buildStatusLinePresetLines, "buildStatusLinePresetLines");
|
|
1987
|
-
|
|
1988
2043
|
export {
|
|
1989
2044
|
computeWindowTitle,
|
|
1990
2045
|
writeTerminalTitle,
|
|
1991
2046
|
formatSessionWindowTitle,
|
|
1992
2047
|
titleStatusPrefix,
|
|
1993
2048
|
useLogger,
|
|
2049
|
+
addShellCommandToLlmHistory,
|
|
2050
|
+
useShellCommandProcessor,
|
|
1994
2051
|
VISIBLE_TOOLS_COUNT,
|
|
1995
2052
|
VISIBLE_RESOURCES_COUNT,
|
|
1996
2053
|
groupServersBySource,
|
|
@@ -2017,13 +2074,7 @@ export {
|
|
|
2017
2074
|
useProviderSetupFlow,
|
|
2018
2075
|
EDITOR_DISPLAY_NAMES,
|
|
2019
2076
|
editorSettingsManager,
|
|
2020
|
-
|
|
2021
|
-
STATUS_LINE_PRESET_ITEMS,
|
|
2022
|
-
orderStatusLinePresetItems,
|
|
2023
|
-
DEFAULT_STATUS_LINE_PRESET_CONFIG,
|
|
2024
|
-
normalizeStatusLinePresetConfig,
|
|
2025
|
-
buildStatusLinePresetData,
|
|
2026
|
-
buildStatusLinePresetLines,
|
|
2077
|
+
useFollowupSuggestionsCLI,
|
|
2027
2078
|
DualOutputBridge,
|
|
2028
2079
|
RemoteInputWatcher
|
|
2029
2080
|
};
|
|
@@ -2044,11 +2095,15 @@ export {
|
|
|
2044
2095
|
*/
|
|
2045
2096
|
/**
|
|
2046
2097
|
* @license
|
|
2047
|
-
* Copyright
|
|
2098
|
+
* Copyright 2025 Qwen Team
|
|
2048
2099
|
* SPDX-License-Identifier: Apache-2.0
|
|
2100
|
+
*
|
|
2101
|
+
* Prompt Suggestion Hook for CLI
|
|
2102
|
+
*
|
|
2103
|
+
* Thin React wrapper around the framework-agnostic controller from core.
|
|
2049
2104
|
*/
|
|
2050
2105
|
/**
|
|
2051
2106
|
* @license
|
|
2052
|
-
* Copyright 2026 Qwen
|
|
2107
|
+
* Copyright 2026 Qwen Team
|
|
2053
2108
|
* SPDX-License-Identifier: Apache-2.0
|
|
2054
2109
|
*/
|