@qwen-code/qwen-code 0.23.1-preview.2 → 0.23.2-nightly.20260909.2e212144d3
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/README.md +35 -15
- 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/auth.md +1 -1
- package/bundled/qc-helper/docs/configuration/model-providers.md +66 -16
- 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/_meta.ts +1 -0
- package/bundled/qc-helper/docs/features/channels/dingtalk.md +1 -1
- package/bundled/qc-helper/docs/features/channels/github.md +1 -9
- package/bundled/qc-helper/docs/features/channels/overview.md +27 -52
- package/bundled/qc-helper/docs/features/channels/qqbot.md +1 -2
- package/bundled/qc-helper/docs/features/commands.md +79 -17
- package/bundled/qc-helper/docs/features/computer-use.md +9 -7
- package/bundled/qc-helper/docs/features/cross-session-protocol.md +291 -0
- package/bundled/qc-helper/docs/features/followup-suggestions.md +2 -2
- package/bundled/qc-helper/docs/features/goals.md +17 -3
- package/bundled/qc-helper/docs/features/sub-agents.md +8 -0
- package/bundled/qc-helper/docs/qwen-serve.md +80 -48
- package/chunks/{MaxSizedBox-IYIQ43IZ.js → MaxSizedBox-ZBGWYJZW.js} +29 -28
- package/chunks/{StandaloneSessionPicker-AWB2OHX6.js → StandaloneSessionPicker-NR5ACIJZ.js} +48 -47
- package/chunks/{acp-startup-profiler-BAL4LJTN.js → acp-startup-profiler-KEU6VAYR.js} +2 -2
- package/chunks/{acpAgent-ZC57OLS4.js → acpAgent-DM6XRCDQ.js} +361 -210
- package/chunks/{agent-GEBPAEJS.js → agent-EF3IIYE3.js} +20 -20
- package/chunks/{agent-headless-63ZEYAJK.js → agent-headless-5J2KFYR4.js} +20 -20
- package/chunks/{anthropicContentGenerator-6XDHXIII.js → anthropicContentGenerator-VIW2FG7G.js} +32 -9
- package/chunks/{artifact-tool-P52OKKEF.js → artifact-tool-G5LHNECG.js} +1 -1
- package/chunks/{askUserQuestion-3KAYLLMM.js → askUserQuestion-R3TXY77M.js} +1 -1
- package/chunks/{bridge-MHWO5I5T.js → bridge-LEMQM6QE.js} +32 -31
- package/chunks/{channel-management-service-NFRZXQFO.js → channel-management-service-TGF6XFXT.js} +4 -4
- package/chunks/{channel-settings-store-T7PMIHKC.js → channel-settings-store-FV365JSF.js} +40 -39
- package/chunks/{channel-worker-group-O2BWK5F7.js → channel-worker-group-SQ5FRWOH.js} +7 -7
- package/chunks/{channel-worker-manager-4WP7VJOD.js → channel-worker-manager-TU4ZNWOE.js} +7 -7
- package/chunks/{channel-worker-supervisor-CCUXD6J5.js → channel-worker-supervisor-EMITFMCP.js} +4 -4
- package/chunks/{chunk-3SH53ANB.js → chunk-22GORRNY.js} +12 -0
- package/chunks/{chunk-OFB36ZBA.js → chunk-2HYOOFDS.js} +10 -7
- package/chunks/chunk-2Z3T52OC.js +82 -0
- package/chunks/{chunk-LYHYXJJ3.js → chunk-34VPADLG.js} +3 -3
- package/chunks/{chunk-C7M445SS.js → chunk-3A2IMUDH.js} +14 -2
- package/chunks/{chunk-P5Z7VD23.js → chunk-3O77M472.js} +294 -87
- package/chunks/{chunk-4OCYWXKF.js → chunk-43EUMPKQ.js} +3 -3
- package/chunks/{chunk-W4LL5RZO.js → chunk-4ALNJDHL.js} +52 -13
- package/chunks/{chunk-VMFPZXRT.js → chunk-4DIMJKWU.js} +64 -43
- package/chunks/{chunk-ZRVFHLLK.js → chunk-5DQ4YTIZ.js} +1 -1
- package/chunks/{chunk-VYCJITND.js → chunk-5HV2HPO7.js} +1 -1
- package/chunks/{chunk-22QOQKG4.js → chunk-5WBA3DEF.js} +1 -1
- package/chunks/{chunk-3K65MUKD.js → chunk-65I7S4Z3.js} +2 -1
- package/chunks/{chunk-I7UNCY24.js → chunk-6GAYNM3F.js} +3 -3
- package/chunks/{chunk-2C3XDBGL.js → chunk-6S7YYUUH.js} +4 -4
- package/chunks/{chunk-Y3C5COGI.js → chunk-6VIATHL7.js} +1 -1
- package/chunks/{chunk-XNC2TCUO.js → chunk-76I36BEM.js} +4 -4
- package/chunks/{chunk-B54PFQS5.js → chunk-7CLLH5TI.js} +1 -1
- package/chunks/{chunk-RGAQDQ3Z.js → chunk-7IDZFJAV.js} +18 -9
- package/chunks/{chunk-5Z4FCEPY.js → chunk-7K4GGN3D.js} +606 -109
- package/chunks/{chunk-WLZRMF3C.js → chunk-7KZVXJ4U.js} +353 -11
- package/chunks/{chunk-REDVV5NC.js → chunk-7WCJEY3A.js} +7 -7
- package/chunks/{chunk-I67KJGM6.js → chunk-A7QZIGRB.js} +3 -3
- package/chunks/{chunk-SHX2HIE7.js → chunk-ATBLEXXV.js} +7 -2
- package/chunks/{chunk-RH344FKI.js → chunk-AUTUFD5X.js} +1 -1
- package/chunks/chunk-AXMWHKXA.js +42 -0
- package/chunks/{chunk-WFXD5OZH.js → chunk-AXWTG6R7.js} +2 -5
- package/chunks/{chunk-TSLRORQR.js → chunk-BDAVT6K2.js} +1809 -1588
- package/chunks/{chunk-HWZOOSEB.js → chunk-BDP3NTWD.js} +3 -3
- package/chunks/{chunk-RD3VPM4E.js → chunk-BZUHZCUO.js} +2 -2
- package/chunks/{chunk-HPE4LEWX.js → chunk-C24ZDDNY.js} +1 -1
- package/chunks/{chunk-R7TKFIQO.js → chunk-CALNF3Z3.js} +1 -1
- package/chunks/{chunk-RPFJJ33Z.js → chunk-CALTQWTZ.js} +1 -1
- package/chunks/{chunk-BF3RUIVP.js → chunk-CH2YDT6X.js} +36 -38
- package/chunks/{chunk-LD53HMPV.js → chunk-CRZBDVP2.js} +1 -0
- package/chunks/{chunk-GEV66YGE.js → chunk-D6AGS266.js} +1 -1
- package/chunks/{chunk-EPZWBYQI.js → chunk-D7DFZAK2.js} +19 -11
- package/chunks/{chunk-5V4B3EWA.js → chunk-DARWOZY6.js} +1 -1
- package/chunks/{chunk-XX4MBBFW.js → chunk-DGNRLJ6S.js} +4 -4
- package/chunks/{chunk-UTVIIA7N.js → chunk-DVOCOIS5.js} +1 -1
- package/chunks/{chunk-RQNAO42A.js → chunk-E4LXNQAK.js} +1 -1
- package/chunks/{chunk-EGRFCIXD.js → chunk-EATP5QCN.js} +84 -25
- package/chunks/{chunk-3RMVM33U.js → chunk-EDSU3VUG.js} +12 -5
- package/chunks/{chunk-733KQL63.js → chunk-EE5ZD4XU.js} +3 -3
- package/chunks/{chunk-QQGAR64U.js → chunk-EN3Q2S3J.js} +4 -4
- package/chunks/{chunk-PLUAIHZO.js → chunk-EOLGAQ25.js} +17 -16
- package/chunks/{chunk-37SOBIA3.js → chunk-ERXNTINK.js} +1 -1
- package/chunks/{chunk-L36LLVA5.js → chunk-EYCW6UF2.js} +7 -7
- package/chunks/{chunk-ZELCTN6Y.js → chunk-F23YN37B.js} +10 -0
- package/chunks/{chunk-FPGTNKCP.js → chunk-F3M6P6IQ.js} +199 -1
- package/chunks/{chunk-B44JBZBB.js → chunk-F4SAL7WM.js} +91 -3
- package/chunks/{chunk-F47DITLZ.js → chunk-FAWTMDX7.js} +14 -0
- package/chunks/{chunk-SI6Q52UI.js → chunk-FEEVHJOR.js} +3 -3
- package/chunks/{chunk-75UQFGFE.js → chunk-FN4KHWCL.js} +1 -1
- package/chunks/{chunk-WQBR7LN5.js → chunk-FRS3P7MQ.js} +15 -2
- package/chunks/{chunk-5JLQWQK6.js → chunk-FV4DM2M4.js} +2 -2
- package/chunks/{chunk-Z6DDPSGJ.js → chunk-GNY7B3CA.js} +1 -1
- package/chunks/{chunk-FDOGGKAA.js → chunk-GSFV5RQW.js} +2 -0
- package/chunks/{chunk-XBVNNDPK.js → chunk-GSYD7MYP.js} +8 -3
- package/chunks/{chunk-ERMAXPXA.js → chunk-HIXUUCGY.js} +187 -12
- package/chunks/{chunk-EJNYBDYC.js → chunk-HNLMYDQE.js} +1 -1
- package/chunks/{chunk-3K456UJF.js → chunk-HSO6D4KX.js} +93 -28
- package/chunks/{chunk-ANVC5CSK.js → chunk-HUJJFSMO.js} +10 -10
- package/chunks/{chunk-C4NXRR7T.js → chunk-HW4MRP4V.js} +2 -2
- package/chunks/{chunk-PMGWY6ZP.js → chunk-HWLLUDIA.js} +113 -18
- package/chunks/{chunk-RCUWMVN3.js → chunk-HZ2HUXX7.js} +1 -1
- package/chunks/{chunk-7PMKXGRP.js → chunk-IKK6NNS6.js} +91 -31
- package/chunks/{chunk-IMWCUWQT.js → chunk-J3TJH52D.js} +1 -1
- package/chunks/{chunk-BNWIX6BM.js → chunk-JFAGT5YG.js} +3 -3
- package/chunks/{chunk-RSU3I6UL.js → chunk-JGTMTJSQ.js} +1 -1
- package/chunks/{chunk-LTCI6ZOJ.js → chunk-JYGIJA4W.js} +1 -1
- package/chunks/{chunk-537SQ2AI.js → chunk-KECCLCXM.js} +146 -24
- package/chunks/{chunk-KAZWXVI3.js → chunk-KEPC5BOL.js} +5 -5
- package/chunks/{chunk-HZS3JRQW.js → chunk-L5VHJYHH.js} +40 -2
- package/chunks/{chunk-KTLT7VCX.js → chunk-LKBOBUA2.js} +2 -2
- package/chunks/{chunk-TDHVOZ65.js → chunk-LOBKNYPR.js} +2 -2
- package/chunks/{chunk-QW7BUOSI.js → chunk-LOVGQ3HZ.js} +26 -9
- package/chunks/{chunk-5FYGZ7E3.js → chunk-MUF4UGPB.js} +2 -2
- package/chunks/chunk-N3Z6Q7KC.js +384 -0
- package/chunks/{chunk-JOV46WGX.js → chunk-NB3NDQQK.js} +1 -1
- package/chunks/chunk-NFXXBWSE.js +463 -0
- package/chunks/chunk-NOO4QFXM.js +171 -0
- package/chunks/{chunk-PQSCGZT2.js → chunk-NPKCVSXX.js} +26 -2
- package/chunks/{chunk-FXYNIZPW.js → chunk-NV4YYXFT.js} +51 -10
- package/chunks/{chunk-FWH4736Q.js → chunk-O6BFERWN.js} +3 -3
- package/chunks/{chunk-UKADFFL2.js → chunk-OFVAS4AR.js} +1 -1
- package/chunks/{chunk-C55CR5I4.js → chunk-OVTPETDL.js} +6 -6
- package/chunks/chunk-PLEBBGHL.js +1401 -0
- package/chunks/{chunk-Z6KFLEG7.js → chunk-PSPAM24S.js} +1 -0
- package/chunks/{chunk-RRCNEW2A.js → chunk-PWR6BQ3U.js} +58 -4
- package/chunks/{chunk-SHK2SIR5.js → chunk-QA2B26PL.js} +4 -4
- package/chunks/{chunk-NFIDVZND.js → chunk-QB3KS3N3.js} +2 -21
- package/chunks/{chunk-NUQFUXOG.js → chunk-QTNCGZHQ.js} +2 -0
- package/chunks/{chunk-QJVZLILI.js → chunk-R7OO56VZ.js} +1 -1
- package/chunks/{chunk-MFCWL4LI.js → chunk-SK6VACCM.js} +936 -481
- package/chunks/{chunk-SD7Y2PMC.js → chunk-SM66GFKJ.js} +2 -2
- package/chunks/{chunk-ADJD4LZF.js → chunk-SNMUO5Z7.js} +1 -1
- package/chunks/{chunk-NXWYCSPL.js → chunk-SOA4HKRJ.js} +1 -1
- package/chunks/{chunk-IRKQ4YYX.js → chunk-SVWWF5TZ.js} +29 -1
- package/chunks/{chunk-YLFICBYK.js → chunk-SYKPMH2X.js} +3 -3
- package/chunks/{chunk-5HBA2Z7V.js → chunk-TGNNLRC3.js} +2 -3
- package/chunks/{chunk-AX23QSX3.js → chunk-TRQNRP2H.js} +4 -4
- package/chunks/{chunk-AUJOWIT5.js → chunk-UQOP2APG.js} +4 -24
- package/chunks/{chunk-HY3DXYZK.js → chunk-UYDQYDW2.js} +1 -1
- package/chunks/{chunk-IGOIYZBG.js → chunk-VAWM3A5N.js} +2 -2
- package/chunks/{chunk-6KYWU726.js → chunk-VJJXG73H.js} +417 -292
- package/chunks/{chunk-ZNI3V2XA.js → chunk-VJWJOKOQ.js} +2 -2
- package/chunks/{chunk-AWDF462I.js → chunk-VR6Y23FW.js} +2 -2
- package/chunks/{chunk-T7TP5UQL.js → chunk-VX2NR3SD.js} +21 -6
- package/chunks/{chunk-65GHQ4FX.js → chunk-WDVV3LRM.js} +707 -216
- package/chunks/{chunk-KP5QK3FB.js → chunk-WEU6O6VN.js} +397 -54
- package/chunks/{chunk-OHOO527W.js → chunk-WG7BL3FY.js} +52 -2
- package/chunks/{chunk-VU7O7CGQ.js → chunk-XDNFODER.js} +1 -1
- package/chunks/{chunk-YHDGABDC.js → chunk-XKBFYTCD.js} +1 -1
- package/chunks/{chunk-RUMSY4ES.js → chunk-Y7YHAY32.js} +28 -10
- package/chunks/{chunk-7IKXTGZT.js → chunk-YI2YCNSP.js} +1 -1
- package/chunks/{chunk-B5FF3LRF.js → chunk-YIE6REQ5.js} +29 -17
- package/chunks/{chunk-E4VX6LXB.js → chunk-YZTGGCEE.js} +10 -2
- package/chunks/{chunk-TXAEXF2B.js → chunk-ZEFWBG2C.js} +737 -1136
- package/chunks/{chunk-AIMZIXZM.js → chunk-ZM2TCZZ7.js} +5 -7
- package/chunks/{chunk-ZT3XUGSU.js → chunk-ZZ7RVOTU.js} +135 -26
- package/chunks/{config-utils-F4CFJ4MW.js → config-utils-SXFK3G4X.js} +33 -32
- package/chunks/{contextCommand-OIIGGOMU.js → contextCommand-QFPD26QO.js} +31 -30
- package/chunks/{core-runtime-JEHLOGMB.js → core-runtime-VXKNBODM.js} +35 -33
- package/chunks/{create-sub-session-MVFBE5RA.js → create-sub-session-7WSQETFR.js} +30 -29
- package/chunks/{daemon-LCUELM6E.js → daemon-U2456K5H.js} +2 -2
- package/chunks/{daemon-git-worktree-guard-5FTKLJOU.js → daemon-git-worktree-guard-I4DCSDUS.js} +29 -28
- package/chunks/{daemon-status-provider-P6A5MPMW.js → daemon-status-provider-5UV56RI4.js} +36 -35
- package/chunks/{daemon-trust-policy-ZJ3NFYUO.js → daemon-trust-policy-DKIBWTKU.js} +36 -35
- package/chunks/{daemon-trust-policy-monitor-6SDLEW7S.js → daemon-trust-policy-monitor-CPSD7UKT.js} +36 -35
- package/chunks/{deferred-core-runtime-DWOXIU5S.js → deferred-core-runtime-D2RF35BL.js} +29 -28
- package/chunks/{discovery-TUM3ZQ6U.js → discovery-XP4RMDUM.js} +4 -2
- package/chunks/{dist-P6YWBITG.js → dist-6YDUH3BB.js} +817 -152
- package/chunks/{dist-T4PRA5EZ.js → dist-BNQVF565.js} +2 -8
- package/chunks/{dist-AI25RVRA.js → dist-F34J4FZX.js} +1 -1
- package/chunks/{dist-3H3WODVS.js → dist-F6JLAJLE.js} +1 -1
- package/chunks/{dist-NXW4DUUX.js → dist-K5GHMXIG.js} +2 -2
- package/chunks/{dist-YNQU4CKC.js → dist-NP7QKLVG.js} +2 -2
- package/chunks/{dist-VCAS67N5.js → dist-UFTFGI6I.js} +1 -1
- package/chunks/{dist-I74QLLQS.js → dist-XLV33CLY.js} +1 -2
- package/chunks/{dist-XINEKB5A.js → dist-ZDNJK74R.js} +3 -7
- package/chunks/{edit-WPVXLL3T.js → edit-4IBADZ3O.js} +20 -20
- package/chunks/{enter-worktree-5A6VW6BN.js → enter-worktree-YFTKHXHZ.js} +2 -2
- package/chunks/{enterPlanMode-JSODW7E2.js → enterPlanMode-YN3GPQU5.js} +20 -20
- package/chunks/{environment-5LLJ3I3W.js → environment-E272IJMF.js} +32 -31
- package/chunks/{errors-IQT3YZEP.js → errors-CVAH3RWQ.js} +31 -30
- package/chunks/{exit-worktree-QV7E7KP6.js → exit-worktree-NF2XEMES.js} +3 -3
- package/chunks/{exitPlanMode-DDVFYNW4.js → exitPlanMode-24J5IHGC.js} +20 -20
- package/chunks/{fast-path-PAUQQEVU.js → fast-path-M5IDBMXF.js} +4 -4
- package/chunks/{fast-path-settings-ISEJPRYE.js → fast-path-settings-SATXY3PD.js} +3 -3
- package/chunks/{glob-SQ7CTZ7F.js → glob-ERBD7JYP.js} +20 -20
- package/chunks/{goal-tools-UWZRCLQB.js → goal-tools-245ULLQT.js} +20 -20
- package/chunks/{handleAutoUpdate-RUPZZTSG.js → handleAutoUpdate-JDZHHZKK.js} +32 -31
- package/chunks/{i18n-SF5MPWEB.js → i18n-LA4D5IXM.js} +32 -29
- package/chunks/{image-gen-Q3RUTVKR.js → image-gen-XP4NNIYG.js} +4 -4
- package/chunks/{initializer-CK4WPYZG.js → initializer-SHPTSWUZ.js} +36 -35
- package/chunks/{installationInfo-IRPQEYRF.js → installationInfo-QEQEPB3G.js} +29 -28
- package/chunks/{list-E3PS3EBJ.js → list-IBHCQWTF.js} +39 -38
- package/chunks/{list-agents-I5TRH3J7.js → list-agents-EDPZCGKN.js} +5 -4
- package/chunks/{llm-JQKBOYAF.js → llm-JAWCQLA4.js} +81 -75
- package/chunks/{llm-content-generator-2QWGBW42.js → llm-content-generator-GOV3A23T.js} +23 -8
- package/chunks/{loadedSettingsAdapter-DGXGVYZS.js → loadedSettingsAdapter-RVE2GNVU.js} +36 -35
- package/chunks/{loggingContentGenerator-ZYURLJKK.js → loggingContentGenerator-SSHNN5YW.js} +22 -22
- package/chunks/{managed-npm-update-HTHR63EA.js → managed-npm-update-BHSTITQO.js} +29 -28
- package/chunks/{mcp-I7G2AEWS.js → mcp-6ZZ7P2HU.js} +36 -35
- package/chunks/{monitor-4R76BCRZ.js → monitor-RKK6GSHG.js} +20 -20
- package/chunks/{nonInteractiveCli-24OQ3VP2.js → nonInteractiveCli-UQHP3G6P.js} +76 -72
- package/chunks/{notebook-edit-PPSH7FEX.js → notebook-edit-YM47A7WO.js} +20 -20
- package/chunks/{open-with-auth-D6JD6LDS.js → open-with-auth-6MVIHMXB.js} +1 -1
- package/chunks/{openaiContentGenerator-K7V5EO7F.js → openaiContentGenerator-FHKDWNI2.js} +11 -11
- package/chunks/{pidfile-TGIUY2GG.js → pidfile-SIIEJEEH.js} +32 -29
- package/chunks/{processUtils-3USXUQWX.js → processUtils-JF7CWBJC.js} +2 -2
- package/chunks/{prompt-terminal-ledger-XHVZRXJI.js → prompt-terminal-ledger-FXXHAEQU.js} +30 -29
- package/chunks/{qwenContentGenerator-MPBOQB64.js → qwenContentGenerator-KFJ77JP6.js} +24 -24
- package/chunks/{qwenOAuth2-BS5D2LYV.js → qwenOAuth2-KX6LVYQ3.js} +4 -4
- package/chunks/{read-file-R256LDWQ.js → read-file-S2NOCBIL.js} +4 -4
- package/chunks/{resumeHistoryUtils-S43LTFHD.js → resumeHistoryUtils-QHHPSQWU.js} +33 -32
- package/chunks/{ripGrep-L7HPZ75Y.js → ripGrep-F6TNOJUO.js} +5 -5
- package/chunks/{run-qwen-serve-CTFL5R6U.js → run-qwen-serve-KYBDQRDD.js} +229 -79
- package/chunks/{runtime-FS5TL6P7.js → runtime-3WNOFLCR.js} +43 -40
- package/chunks/{scheduled-tasks-QXPV3Q35.js → scheduled-tasks-RNBH56DJ.js} +34 -33
- package/chunks/{scheduler-EXU5HMVK.js → scheduler-ERMW7Q7B.js} +31 -30
- package/chunks/{send-message-GQKXGMPI.js → send-message-V5T3NMFM.js} +4 -4
- package/chunks/{serve-ITJC7WNN.js → serve-7NV46RMP.js} +36 -35
- package/chunks/{server-6JQY3PTU.js → server-6RZJR5QF.js} +1358 -932
- package/chunks/{session-PJDEKXD4.js → session-Z4EV7NVV.js} +107 -78
- package/chunks/{session-attachments-root-L37ORSST.js → session-attachments-root-SG5FC52X.js} +29 -28
- package/chunks/{session-pr-refresh-WIFD52YL.js → session-pr-refresh-ILC4Z3ZM.js} +33 -32
- package/chunks/{settings-LO6J5SAZ.js → settings-Y47SPE3X.js} +35 -34
- package/chunks/{shell-ANAFVYGR.js → shell-YBVCOPVO.js} +20 -20
- package/chunks/{skill-SHJWKSPH.js → skill-AXC63EBA.js} +4 -4
- package/chunks/{skill-settings-GX3XHZ5Q.js → skill-settings-AFPAYGLO.js} +35 -34
- package/chunks/{spawnChannel-WE42VBKM.js → spawnChannel-ZFL4J2V3.js} +29 -28
- package/chunks/{standalone-update-CWDIKJRP.js → standalone-update-Y2OZPLNJ.js} +31 -30
- package/chunks/{start-opentui-ui-BBHGFOTF.js → start-opentui-ui-G6TKT4LI.js} +2270 -1026
- package/chunks/{startInteractiveUI-FQX7LUYP.js → startInteractiveUI-YTNDPW7J.js} +1789 -2211
- package/chunks/{task-create-PMAFST2T.js → task-create-MWXJFRRM.js} +3 -3
- package/chunks/{task-list-R2HSY2NC.js → task-list-EYO3FE57.js} +2 -2
- package/chunks/{task-update-JYC57USF.js → task-update-2JJJRHMT.js} +3 -3
- package/chunks/{team-create-WKTPCH6D.js → team-create-BUFLGGSH.js} +20 -20
- package/chunks/{team-delete-CBHVBTPB.js → team-delete-IQZ6XGFI.js} +2 -2
- package/chunks/{team-plan-approval-Y23DL7WR.js → team-plan-approval-OUWWM42U.js} +20 -20
- package/chunks/{terminal-image-renderer-B646HBDW.js → terminal-image-renderer-WH2WV5ES.js} +29 -28
- package/chunks/{theme-manager-BNWESY26.js → theme-manager-5UDRARM2.js} +29 -28
- package/chunks/{tool-search-PVQ5O5Y2.js → tool-search-MCDIRPHN.js} +4 -4
- package/chunks/{total-session-admission-P5Z43KNW.js → total-session-admission-VL27U74Z.js} +33 -32
- package/chunks/{trustedFolders-FH2LT2MZ.js → trustedFolders-MSXT4VDD.js} +30 -29
- package/chunks/{update-relaunch-WOWTKJSN.js → update-relaunch-JKLEWVCB.js} +5 -5
- package/chunks/{updateCheck-3MYFMM35.js → updateCheck-ARTHAJT2.js} +31 -30
- package/chunks/{useAutoAcceptIndicator-Q7ZRRRKO.js → useAutoAcceptIndicator-YEAAGYVU.js} +38 -37
- package/chunks/{validateNonInterActiveAuth-MYEWJX3G.js → validateNonInterActiveAuth-EMRQKH5S.js} +71 -69
- package/chunks/{version-RO2FPO76.js → version-HFQU35WD.js} +3 -1
- package/chunks/{web-fetch-QAKY2LUA.js → web-fetch-QBXAO6VF.js} +7 -7
- package/chunks/{web-search-XA5Z4ZCD.js → web-search-2URQXA3A.js} +201 -13
- package/chunks/{web-shell-static-POZHGGXE.js → web-shell-static-BFDESDD4.js} +5 -4
- package/chunks/{workflow-QFIOCMDM.js → workflow-JDD6WDAH.js} +211 -75
- package/chunks/{workspace-providers-status-B2UD7RAG.js → workspace-providers-status-B4IKR6YJ.js} +38 -37
- package/chunks/{workspace-registration-store-VZLRTI3Q.js → workspace-registration-store-PJ3YHR45.js} +1 -2
- package/chunks/{workspace-registry-GYOGG6TM.js → workspace-registry-WVYJ5UGB.js} +33 -32
- package/chunks/{workspace-runtime-coordinator-7KRXGQ4V.js → workspace-runtime-coordinator-DXL5YVAG.js} +33 -32
- package/chunks/{workspace-service-DJEYGJE4.js → workspace-service-QNGAMVH7.js} +40 -39
- package/chunks/{workspace-skills-status-MOKNESUC.js → workspace-skills-status-BEISJIII.js} +36 -35
- package/chunks/{workspace-trust-reconciler-AXOSUTQW.js → workspace-trust-reconciler-ORYJF5L4.js} +40 -39
- package/chunks/{write-file-QOYVHAKK.js → write-file-DWLKFBTJ.js} +21 -21
- package/chunks/{zoom-image-UCCLGFNC.js → zoom-image-BYVIXSNQ.js} +4 -4
- package/cli.js +13 -13
- package/export-transcript-document.js +123 -119
- package/package.json +4 -4
- package/web-shell/assets/{abnfDiagram-VCTEODGH-CTstZpXw.js → abnfDiagram-VCTEODGH-C_8kzsly.js} +1 -1
- package/web-shell/assets/{arc-DKW0mbPo.js → arc-CDg7Zfpm.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-DkMpJ42t.js → architectureDiagram-5GKGNRK7-DZzdCWyF.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-7Cp1_4i3.js → blockDiagram-NRAW4CY4-DI3B4gyR.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-BfaoSlBK.js → c4Diagram-UCG6FXSJ-CfOgwHZW.js} +1 -1
- package/web-shell/assets/channel-e4xwS72w.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-_n1qzAio.js → chunk-2Q5K7J3B-B_PUth0g.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-0cira5ZV.js → chunk-5VM5RSS4-CrKtvBIL.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-DseRXSHC.js → chunk-F27PBJKO-B4z2n8Py.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-BehQWin0.js → chunk-G27WJ6UU-BUtrFEO8.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-B5ftg1Bb.js → chunk-JWPE2WC7-Cqw3aXW0.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-D7rnbVdk.js → chunk-LCL6LL3I-CZolnvls.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-2Bp-Orju.js → chunk-POPQ4Y6H-DivgasCa.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-CD2goGva.js → chunk-SVP7TREG--seyb1B6.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-DzQt-Rji.js → chunk-XXDRQBXY-D7pHtuVM.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-CzXfUUOt.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-CzXfUUOt.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-C-BZXSUn.js → cose-bilkent-JH36ORCC-4MWaRF_3.js} +1 -1
- package/web-shell/assets/csv-CX7rUNeC.svg +1 -0
- package/web-shell/assets/{cynefin-OW5HDTMX-BTcvowe1.js → cynefin-OW5HDTMX-nhJhAjgD.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-BoUE6K81.js → cynefinDiagram-5FMLGOSQ-NF-PwXlq.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-BHxy9xeB.js → dagre-3AP2YEHR-Bu0ncdWP.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-DMiJIvDT.js → diagram-S7CK7UJ4-CsvhFHZC.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-DXV09Aes.js → diagram-UQ7AKVKN-Ck61sIB3.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-CocpRomV.js → diagram-VSXAHHWV-D0171zrb.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-DL7nqtb4.js → diagram-VX7I27RA-DvdxY4UL.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-CPZ2Jux_.js → diagram-Z3DM3KII-CGGpseiB.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-BX-eVNsX.js → ebnfDiagram-PWID7BFC-K8-QMvY8.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-CPy_Ir6y.js → erDiagram-SSCWMZ5O-D316nAem.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-eknAOte9.js → flowDiagram-A5DVABFB-B7siy_mn.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-crAxw_t7.js → ganttDiagram-EL5Y4UJY-BZQDxzTu.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-M29pa3Tc.js → gitGraphDiagram-WWUBYQGX-DZynLCSV.js} +1 -1
- package/web-shell/assets/{index-C9R-iojE.js → index-9ie6xLTM.js} +1 -1
- package/web-shell/assets/index-DirkXQEg.js +2164 -0
- package/web-shell/assets/index-DzdST_7L.css +36 -0
- package/web-shell/assets/{infoDiagram-RXCK75RN-XqspXdOU.js → infoDiagram-RXCK75RN-B0gr769A.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-C5KFS-7j.js → ishikawaDiagram-5VMMS53U-0pQFfjvX.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-Cc57LVRo.js → journeyDiagram-EYS64GPL-DEGtClWb.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-C81OG-AI.js → kanban-definition-3QL26DDD-CnN8gPzw.js} +1 -1
- package/web-shell/assets/{layout-CFVu37BB.js → layout-C_70RhaT.js} +1 -1
- package/web-shell/assets/{linear-ChBxdtWf.js → linear-BJ2ZLmcq.js} +1 -1
- package/web-shell/assets/{mermaid.core-CMLfue0w.js → mermaid.core-RlY0zPNC.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-DFsvJThp.js → mindmap-definition-FBJOCRG2-CpVAxTNl.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-BzpRzM4F.js → pegDiagram-XKGWAZYB-DmrSv3hD.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-Cv0Kankl.js → pieDiagram-E7YTZNPT-CJmgp8KJ.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-Bh2BJ3Ay.js → quadrantDiagram-AXDQQJYC-UsgOyNco.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-y8rNDdDS.js → railroadDiagram-O6MQD6OU-DQ6gMs_W.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-C0m2DKJ_.js → requirementDiagram-EFPCY7ZU-DhqadamF.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-BzdGnSF4.js → sankeyDiagram-P5KCCOFB-R4WnURaE.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-DPzAVmzz.js → sequenceDiagram-WJ2MYXX4-D7BwMi_D.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-LcHG28Zh.js → sizeCapture-X5ZJPWSS-Bqngz088.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-C1Bzy3IT.js → stateDiagram-HBIQ2CUA-DwaXPGqn.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-8GCQZAvv.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-Bftk8V64.js → swimlanes-XN3QIQJK-BsaLeRDY.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-BoRBF2Yw.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-BfXHcN1A.js → timeline-definition-24CTP7MA-NJ9G-NUU.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-DRSlI9-V.js → vennDiagram-4TSXK5OY-Ca3W4rSq.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-CaLmqGau.js → wardleyDiagram-VM6X3IG4-OabvjC-6.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-8lgUT6e8.js → xychartDiagram-S5SC5T6Z-C7rbjvpc.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/chunk-2LD5U7Q3.js +0 -114
- package/chunks/chunk-3UMWOKJC.js +0 -78
- package/chunks/chunk-IQAFKVXS.js +0 -22
- package/chunks/chunk-X35VIWWJ.js +0 -276
- package/chunks/chunk-ZJ2LM2SI.js +0 -198
- 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-B4TLaxWs.js +0 -2142
- 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-PWR6BQ3U.js";
|
|
9
9
|
import {
|
|
10
|
-
ICON
|
|
11
|
-
|
|
10
|
+
ICON,
|
|
11
|
+
SHELL_COMMAND_NAME
|
|
12
|
+
} from "./chunk-VX2NR3SD.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
|
|
@@ -22,37 +26,64 @@ import {
|
|
|
22
26
|
import {
|
|
23
27
|
require_react
|
|
24
28
|
} from "./chunk-5QWWOFGG.js";
|
|
29
|
+
import {
|
|
30
|
+
getCachedStringWidth,
|
|
31
|
+
toCodePoints
|
|
32
|
+
} from "./chunk-47ECGEJC.js";
|
|
25
33
|
import {
|
|
26
34
|
createLoadedSettingsAdapter
|
|
27
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-DVOCOIS5.js";
|
|
28
36
|
import {
|
|
29
37
|
SettingScope,
|
|
30
38
|
settingExistsInScope
|
|
31
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-Y7YHAY32.js";
|
|
32
40
|
import {
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
getCurrentLanguage,
|
|
42
|
+
t,
|
|
43
|
+
ta
|
|
44
|
+
} from "./chunk-CRZBDVP2.js";
|
|
35
45
|
import {
|
|
46
|
+
INITIAL_FOLLOWUP_STATE,
|
|
36
47
|
Logger,
|
|
37
48
|
applyProviderInstallPlan,
|
|
49
|
+
createFollowupController
|
|
50
|
+
} from "./chunk-ZEFWBG2C.js";
|
|
51
|
+
import {
|
|
38
52
|
buildInstallPlan,
|
|
39
53
|
getDefaultBaseUrlForProtocol,
|
|
40
54
|
getDefaultModelIds,
|
|
41
55
|
resolveBaseUrl,
|
|
42
56
|
shouldShowStep
|
|
43
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-PLEBBGHL.js";
|
|
44
58
|
import {
|
|
45
59
|
qwenOAuth2Events,
|
|
46
60
|
sanitizeForOsc
|
|
47
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-XDNFODER.js";
|
|
48
62
|
import {
|
|
63
|
+
ShellExecutionService,
|
|
64
|
+
TERMINAL_CSI_REGEX,
|
|
65
|
+
TERMINAL_OSC_REGEX,
|
|
66
|
+
TERMINAL_SHIFT_DCS_REGEX,
|
|
49
67
|
allowEditorTypeInSandbox,
|
|
50
|
-
checkHasEditorType
|
|
51
|
-
|
|
68
|
+
checkHasEditorType,
|
|
69
|
+
compactToolResultDisplayForHistory,
|
|
70
|
+
isSignalTermination,
|
|
71
|
+
resolveBranchName,
|
|
72
|
+
stripTerminalControlSequences,
|
|
73
|
+
watchRepoBranch
|
|
74
|
+
} from "./chunk-BDAVT6K2.js";
|
|
75
|
+
import {
|
|
76
|
+
formatMemoryUsage
|
|
77
|
+
} from "./chunk-CHEIIBT3.js";
|
|
52
78
|
import {
|
|
53
79
|
AuthEvent,
|
|
54
|
-
|
|
55
|
-
|
|
80
|
+
PromptSuggestionEvent,
|
|
81
|
+
logAuth,
|
|
82
|
+
logPromptSuggestion
|
|
83
|
+
} from "./chunk-FRS3P7MQ.js";
|
|
84
|
+
import {
|
|
85
|
+
isBinary
|
|
86
|
+
} from "./chunk-7VEYUF3N.js";
|
|
56
87
|
import {
|
|
57
88
|
createDebugLogger,
|
|
58
89
|
getErrorMessage
|
|
@@ -418,9 +449,9 @@ var DualOutputBridge = class {
|
|
|
418
449
|
}
|
|
419
450
|
}
|
|
420
451
|
this.active = false;
|
|
421
|
-
this.shutdownPromise = new Promise((
|
|
452
|
+
this.shutdownPromise = new Promise((resolve2) => {
|
|
422
453
|
if (this.stream.closed || this.stream.destroyed) {
|
|
423
|
-
|
|
454
|
+
resolve2();
|
|
424
455
|
return;
|
|
425
456
|
}
|
|
426
457
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
@@ -429,7 +460,7 @@ var DualOutputBridge = class {
|
|
|
429
460
|
}, "cleanup");
|
|
430
461
|
const onClose = /* @__PURE__ */ __name(() => {
|
|
431
462
|
cleanup();
|
|
432
|
-
|
|
463
|
+
resolve2();
|
|
433
464
|
}, "onClose");
|
|
434
465
|
const onError = /* @__PURE__ */ __name((err) => {
|
|
435
466
|
debugLogger.debug("DualOutput: stream error during shutdown:", err);
|
|
@@ -441,7 +472,7 @@ var DualOutputBridge = class {
|
|
|
441
472
|
} catch (err) {
|
|
442
473
|
cleanup();
|
|
443
474
|
debugLogger.debug("DualOutput: stream end error during shutdown:", err);
|
|
444
|
-
|
|
475
|
+
resolve2();
|
|
445
476
|
}
|
|
446
477
|
});
|
|
447
478
|
return this.shutdownPromise;
|
|
@@ -596,7 +627,7 @@ var RemoteInputWatcher = class {
|
|
|
596
627
|
debugLogger2.warn(`RemoteInput: failed to parse line: ${trimmed}`);
|
|
597
628
|
}
|
|
598
629
|
});
|
|
599
|
-
return new Promise((
|
|
630
|
+
return new Promise((resolve2) => {
|
|
600
631
|
rl.on("close", () => {
|
|
601
632
|
this.bytesRead = consumeUntil;
|
|
602
633
|
if (nextConsumedPrefixHash !== null) {
|
|
@@ -604,7 +635,7 @@ var RemoteInputWatcher = class {
|
|
|
604
635
|
}
|
|
605
636
|
this.reading = false;
|
|
606
637
|
this.processQueue();
|
|
607
|
-
|
|
638
|
+
resolve2();
|
|
608
639
|
});
|
|
609
640
|
});
|
|
610
641
|
}
|
|
@@ -1002,6 +1033,828 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem, onAuthCh
|
|
|
1002
1033
|
};
|
|
1003
1034
|
}, "useAuthCommand");
|
|
1004
1035
|
|
|
1036
|
+
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
1037
|
+
init_esbuild_shims();
|
|
1038
|
+
var import_react4 = __toESM(require_react(), 1);
|
|
1039
|
+
var BRANCH_POLL_INTERVAL_MS = 5e3;
|
|
1040
|
+
function useGitBranchName(cwd) {
|
|
1041
|
+
const [branchName, setBranchName] = (0, import_react4.useState)(void 0);
|
|
1042
|
+
const branchNameRef = (0, import_react4.useRef)(branchName);
|
|
1043
|
+
branchNameRef.current = branchName;
|
|
1044
|
+
(0, import_react4.useEffect)(() => {
|
|
1045
|
+
let cancelled = false;
|
|
1046
|
+
let dispose;
|
|
1047
|
+
let pollTimer;
|
|
1048
|
+
let refreshGeneration = 0;
|
|
1049
|
+
const refresh = /* @__PURE__ */ __name(async () => {
|
|
1050
|
+
const generation = ++refreshGeneration;
|
|
1051
|
+
const name = await resolveBranchName(cwd);
|
|
1052
|
+
if (!cancelled && generation === refreshGeneration && name !== branchNameRef.current) {
|
|
1053
|
+
setBranchName(name);
|
|
1054
|
+
}
|
|
1055
|
+
}, "refresh");
|
|
1056
|
+
const init = /* @__PURE__ */ __name(async () => {
|
|
1057
|
+
await refresh();
|
|
1058
|
+
if (cancelled) return;
|
|
1059
|
+
const disposer = await watchRepoBranch(cwd, () => {
|
|
1060
|
+
void refresh().catch(() => {
|
|
1061
|
+
});
|
|
1062
|
+
});
|
|
1063
|
+
if (cancelled) {
|
|
1064
|
+
disposer();
|
|
1065
|
+
} else {
|
|
1066
|
+
dispose = disposer;
|
|
1067
|
+
}
|
|
1068
|
+
if (!cancelled) {
|
|
1069
|
+
pollTimer = setInterval(() => {
|
|
1070
|
+
void refresh().catch(() => {
|
|
1071
|
+
});
|
|
1072
|
+
}, BRANCH_POLL_INTERVAL_MS);
|
|
1073
|
+
pollTimer.unref?.();
|
|
1074
|
+
}
|
|
1075
|
+
}, "init");
|
|
1076
|
+
void init().catch(() => {
|
|
1077
|
+
});
|
|
1078
|
+
return () => {
|
|
1079
|
+
cancelled = true;
|
|
1080
|
+
dispose?.();
|
|
1081
|
+
if (pollTimer) clearInterval(pollTimer);
|
|
1082
|
+
};
|
|
1083
|
+
}, [cwd]);
|
|
1084
|
+
return branchName;
|
|
1085
|
+
}
|
|
1086
|
+
__name(useGitBranchName, "useGitBranchName");
|
|
1087
|
+
|
|
1088
|
+
// packages/cli/src/ui/hooks/shellCommandProcessor.ts
|
|
1089
|
+
init_esbuild_shims();
|
|
1090
|
+
var import_react5 = __toESM(require_react(), 1);
|
|
1091
|
+
import crypto from "node:crypto";
|
|
1092
|
+
import path from "node:path";
|
|
1093
|
+
import os from "node:os";
|
|
1094
|
+
import fs from "node:fs";
|
|
1095
|
+
var OUTPUT_UPDATE_INTERVAL_MS = 1e3;
|
|
1096
|
+
var MAX_OUTPUT_LENGTH = 1e4;
|
|
1097
|
+
var debugLogger3 = createDebugLogger("SHELL_COMMAND_PROCESSOR");
|
|
1098
|
+
function copyString(value) {
|
|
1099
|
+
return value.split("").join("");
|
|
1100
|
+
}
|
|
1101
|
+
__name(copyString, "copyString");
|
|
1102
|
+
function addShellCommandToLlmHistory(llmClient, rawQuery, resultText) {
|
|
1103
|
+
const modelContent = resultText.length > MAX_OUTPUT_LENGTH ? copyString(resultText.substring(0, MAX_OUTPUT_LENGTH)) + "\n... (truncated)" : resultText;
|
|
1104
|
+
llmClient.addHistory({
|
|
1105
|
+
role: "user",
|
|
1106
|
+
parts: [
|
|
1107
|
+
{
|
|
1108
|
+
text: `I ran the following shell command:
|
|
1109
|
+
\`\`\`sh
|
|
1110
|
+
${rawQuery}
|
|
1111
|
+
\`\`\`
|
|
1112
|
+
|
|
1113
|
+
This produced the following result:
|
|
1114
|
+
\`\`\`
|
|
1115
|
+
${modelContent}
|
|
1116
|
+
\`\`\``
|
|
1117
|
+
}
|
|
1118
|
+
]
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1121
|
+
__name(addShellCommandToLlmHistory, "addShellCommandToLlmHistory");
|
|
1122
|
+
var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPendingHistoryItem, onExec, onDebugMessage, config, llmClient, setShellInputFocused, terminalWidth, terminalHeight) => {
|
|
1123
|
+
const [activeShellPtyId, setActiveShellPtyId] = (0, import_react5.useState)(null);
|
|
1124
|
+
const handleShellCommand = (0, import_react5.useCallback)(
|
|
1125
|
+
(rawQuery, abortSignal) => {
|
|
1126
|
+
if (typeof rawQuery !== "string" || rawQuery.trim() === "") {
|
|
1127
|
+
return false;
|
|
1128
|
+
}
|
|
1129
|
+
const userMessageTimestamp = Date.now();
|
|
1130
|
+
const callId = `shell-${userMessageTimestamp}`;
|
|
1131
|
+
addItemToHistory(
|
|
1132
|
+
{ type: "user_shell", text: rawQuery },
|
|
1133
|
+
userMessageTimestamp
|
|
1134
|
+
);
|
|
1135
|
+
const isWindows = os.platform() === "win32";
|
|
1136
|
+
const targetDir = config.getTargetDir();
|
|
1137
|
+
let commandToExecute = rawQuery;
|
|
1138
|
+
let pwdFilePath;
|
|
1139
|
+
if (!isWindows) {
|
|
1140
|
+
let command = rawQuery.trim();
|
|
1141
|
+
const pwdFileName = `shell_pwd_${crypto.randomBytes(6).toString("hex")}.tmp`;
|
|
1142
|
+
pwdFilePath = path.join(os.tmpdir(), pwdFileName);
|
|
1143
|
+
const trailingBackslashes = /\\+$/.exec(command)?.[0].length ?? 0;
|
|
1144
|
+
if (trailingBackslashes % 2 === 1) {
|
|
1145
|
+
command += "\n";
|
|
1146
|
+
}
|
|
1147
|
+
if (!command.endsWith(";") && !command.endsWith("&")) {
|
|
1148
|
+
command += ";";
|
|
1149
|
+
}
|
|
1150
|
+
commandToExecute = `{ ${command}
|
|
1151
|
+
}; __code=$?; pwd > "${pwdFilePath}"; exit $__code`;
|
|
1152
|
+
}
|
|
1153
|
+
const executeCommand = /* @__PURE__ */ __name(async (resolve2) => {
|
|
1154
|
+
let lastUpdateTime = Date.now();
|
|
1155
|
+
let cumulativeStdout = "";
|
|
1156
|
+
let isBinaryStream = false;
|
|
1157
|
+
let binaryBytesReceived = 0;
|
|
1158
|
+
const initialToolDisplay = {
|
|
1159
|
+
callId,
|
|
1160
|
+
name: SHELL_COMMAND_NAME,
|
|
1161
|
+
description: rawQuery,
|
|
1162
|
+
status: "Executing" /* Executing */,
|
|
1163
|
+
resultDisplay: "",
|
|
1164
|
+
confirmationDetails: void 0
|
|
1165
|
+
};
|
|
1166
|
+
setPendingHistoryItem({
|
|
1167
|
+
type: "tool_group",
|
|
1168
|
+
tools: [initialToolDisplay],
|
|
1169
|
+
isUserInitiated: true
|
|
1170
|
+
});
|
|
1171
|
+
let executionPid;
|
|
1172
|
+
const abortHandler = /* @__PURE__ */ __name(() => {
|
|
1173
|
+
onDebugMessage(
|
|
1174
|
+
`Aborting shell command (PID: ${executionPid ?? "unknown"})`
|
|
1175
|
+
);
|
|
1176
|
+
}, "abortHandler");
|
|
1177
|
+
abortSignal.addEventListener("abort", abortHandler, { once: true });
|
|
1178
|
+
onDebugMessage(`Executing in ${targetDir}: ${commandToExecute}`);
|
|
1179
|
+
const cleanupShellCommand = /* @__PURE__ */ __name(() => {
|
|
1180
|
+
abortSignal.removeEventListener("abort", abortHandler);
|
|
1181
|
+
if (pwdFilePath && fs.existsSync(pwdFilePath)) {
|
|
1182
|
+
fs.unlinkSync(pwdFilePath);
|
|
1183
|
+
}
|
|
1184
|
+
setActiveShellPtyId(null);
|
|
1185
|
+
setShellInputFocused(false);
|
|
1186
|
+
resolve2();
|
|
1187
|
+
}, "cleanupShellCommand");
|
|
1188
|
+
try {
|
|
1189
|
+
const activeTheme = themeManager.getActiveTheme();
|
|
1190
|
+
const shellExecutionConfig = {
|
|
1191
|
+
...config.getShellExecutionConfig(),
|
|
1192
|
+
terminalWidth,
|
|
1193
|
+
terminalHeight,
|
|
1194
|
+
defaultFg: activeTheme.colors.Foreground,
|
|
1195
|
+
defaultBg: activeTheme.colors.Background
|
|
1196
|
+
};
|
|
1197
|
+
const { pid, result } = await ShellExecutionService.execute(
|
|
1198
|
+
commandToExecute,
|
|
1199
|
+
targetDir,
|
|
1200
|
+
(event) => {
|
|
1201
|
+
let shouldUpdate = false;
|
|
1202
|
+
switch (event.type) {
|
|
1203
|
+
case "data":
|
|
1204
|
+
if (isBinaryStream) break;
|
|
1205
|
+
if (config.getShouldUseNodePtyShell()) {
|
|
1206
|
+
cumulativeStdout = event.chunk;
|
|
1207
|
+
shouldUpdate = true;
|
|
1208
|
+
} else if (typeof event.chunk === "string" && typeof cumulativeStdout === "string") {
|
|
1209
|
+
cumulativeStdout += event.chunk;
|
|
1210
|
+
}
|
|
1211
|
+
break;
|
|
1212
|
+
case "binary_detected":
|
|
1213
|
+
isBinaryStream = true;
|
|
1214
|
+
shouldUpdate = true;
|
|
1215
|
+
break;
|
|
1216
|
+
case "binary_progress":
|
|
1217
|
+
isBinaryStream = true;
|
|
1218
|
+
binaryBytesReceived = event.bytesReceived;
|
|
1219
|
+
break;
|
|
1220
|
+
default: {
|
|
1221
|
+
throw new Error("An unhandled ShellOutputEvent was found.");
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
let currentDisplayOutput;
|
|
1225
|
+
if (isBinaryStream) {
|
|
1226
|
+
if (binaryBytesReceived > 0) {
|
|
1227
|
+
currentDisplayOutput = `[Receiving binary output... ${formatMemoryUsage(
|
|
1228
|
+
binaryBytesReceived
|
|
1229
|
+
)} received]`;
|
|
1230
|
+
} else {
|
|
1231
|
+
currentDisplayOutput = "[Binary output detected. Halting stream...]";
|
|
1232
|
+
}
|
|
1233
|
+
} else {
|
|
1234
|
+
currentDisplayOutput = cumulativeStdout;
|
|
1235
|
+
}
|
|
1236
|
+
if (shouldUpdate || Date.now() - lastUpdateTime > OUTPUT_UPDATE_INTERVAL_MS) {
|
|
1237
|
+
setPendingHistoryItem((prevItem) => {
|
|
1238
|
+
if (prevItem?.type === "tool_group") {
|
|
1239
|
+
return {
|
|
1240
|
+
...prevItem,
|
|
1241
|
+
tools: prevItem.tools.map(
|
|
1242
|
+
(tool) => tool.callId === callId ? {
|
|
1243
|
+
...tool,
|
|
1244
|
+
resultDisplay: typeof currentDisplayOutput === "string" ? compactToolResultDisplayForHistory(
|
|
1245
|
+
currentDisplayOutput
|
|
1246
|
+
) : compactToolResultDisplayForHistory({
|
|
1247
|
+
ansiOutput: currentDisplayOutput
|
|
1248
|
+
})
|
|
1249
|
+
} : tool
|
|
1250
|
+
)
|
|
1251
|
+
};
|
|
1252
|
+
}
|
|
1253
|
+
return prevItem;
|
|
1254
|
+
});
|
|
1255
|
+
lastUpdateTime = Date.now();
|
|
1256
|
+
}
|
|
1257
|
+
},
|
|
1258
|
+
abortSignal,
|
|
1259
|
+
config.getShouldUseNodePtyShell(),
|
|
1260
|
+
shellExecutionConfig
|
|
1261
|
+
);
|
|
1262
|
+
debugLogger3.debug(terminalHeight, terminalWidth);
|
|
1263
|
+
executionPid = pid;
|
|
1264
|
+
if (pid) {
|
|
1265
|
+
setActiveShellPtyId(pid);
|
|
1266
|
+
setPendingHistoryItem((prevItem) => {
|
|
1267
|
+
if (prevItem?.type === "tool_group") {
|
|
1268
|
+
return {
|
|
1269
|
+
...prevItem,
|
|
1270
|
+
tools: prevItem.tools.map(
|
|
1271
|
+
(tool) => tool.callId === callId ? { ...tool, ptyId: pid } : tool
|
|
1272
|
+
)
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
return prevItem;
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
result.then((result2) => {
|
|
1279
|
+
setPendingHistoryItem(null);
|
|
1280
|
+
let mainContent;
|
|
1281
|
+
if (isBinary(result2.rawOutput)) {
|
|
1282
|
+
mainContent = "[Command produced binary output, which is not shown.]";
|
|
1283
|
+
} else {
|
|
1284
|
+
mainContent = result2.output.trim() || "(Command produced no output)";
|
|
1285
|
+
}
|
|
1286
|
+
let finalOutput = mainContent;
|
|
1287
|
+
let finalStatus = "Success" /* Success */;
|
|
1288
|
+
if (result2.error) {
|
|
1289
|
+
finalStatus = "Error" /* Error */;
|
|
1290
|
+
finalOutput = `${result2.error.message}
|
|
1291
|
+
${finalOutput}`;
|
|
1292
|
+
} else if (result2.aborted) {
|
|
1293
|
+
finalStatus = "Canceled" /* Canceled */;
|
|
1294
|
+
finalOutput = `Command was cancelled.
|
|
1295
|
+
${finalOutput}`;
|
|
1296
|
+
} else if (isSignalTermination(result2.signal)) {
|
|
1297
|
+
finalStatus = "Error" /* Error */;
|
|
1298
|
+
finalOutput = `Command terminated by signal: ${result2.signal}.
|
|
1299
|
+
${finalOutput}`;
|
|
1300
|
+
} else if (result2.exitCode !== 0) {
|
|
1301
|
+
finalStatus = "Error" /* Error */;
|
|
1302
|
+
finalOutput = `Command exited with code ${result2.exitCode}.
|
|
1303
|
+
${finalOutput}`;
|
|
1304
|
+
}
|
|
1305
|
+
if (pwdFilePath && fs.existsSync(pwdFilePath)) {
|
|
1306
|
+
const finalPwd = fs.readFileSync(pwdFilePath, "utf8").trim();
|
|
1307
|
+
if (finalPwd && finalPwd !== targetDir) {
|
|
1308
|
+
const warning = `WARNING: shell mode is stateless; the directory change to '${finalPwd}' will not persist.`;
|
|
1309
|
+
finalOutput = `${warning}
|
|
1310
|
+
|
|
1311
|
+
${finalOutput}`;
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
const finalToolDisplay = {
|
|
1315
|
+
...initialToolDisplay,
|
|
1316
|
+
status: finalStatus,
|
|
1317
|
+
resultDisplay: compactToolResultDisplayForHistory(finalOutput)
|
|
1318
|
+
};
|
|
1319
|
+
addItemToHistory(
|
|
1320
|
+
{
|
|
1321
|
+
type: "tool_group",
|
|
1322
|
+
tools: [finalToolDisplay],
|
|
1323
|
+
isUserInitiated: true
|
|
1324
|
+
},
|
|
1325
|
+
userMessageTimestamp
|
|
1326
|
+
);
|
|
1327
|
+
addShellCommandToLlmHistory(llmClient, rawQuery, finalOutput);
|
|
1328
|
+
}).catch((err) => {
|
|
1329
|
+
setPendingHistoryItem(null);
|
|
1330
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
1331
|
+
addItemToHistory(
|
|
1332
|
+
{
|
|
1333
|
+
type: "error",
|
|
1334
|
+
text: `An unexpected error occurred: ${errorMessage}`
|
|
1335
|
+
},
|
|
1336
|
+
userMessageTimestamp
|
|
1337
|
+
);
|
|
1338
|
+
}).finally(() => {
|
|
1339
|
+
cleanupShellCommand();
|
|
1340
|
+
});
|
|
1341
|
+
} catch (err) {
|
|
1342
|
+
setPendingHistoryItem(null);
|
|
1343
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
1344
|
+
addItemToHistory(
|
|
1345
|
+
{
|
|
1346
|
+
type: "error",
|
|
1347
|
+
text: `An unexpected error occurred: ${errorMessage}`
|
|
1348
|
+
},
|
|
1349
|
+
userMessageTimestamp
|
|
1350
|
+
);
|
|
1351
|
+
cleanupShellCommand();
|
|
1352
|
+
}
|
|
1353
|
+
}, "executeCommand");
|
|
1354
|
+
const execPromise = new Promise((resolve2) => {
|
|
1355
|
+
executeCommand(resolve2);
|
|
1356
|
+
});
|
|
1357
|
+
onExec(execPromise);
|
|
1358
|
+
return true;
|
|
1359
|
+
},
|
|
1360
|
+
[
|
|
1361
|
+
config,
|
|
1362
|
+
onDebugMessage,
|
|
1363
|
+
addItemToHistory,
|
|
1364
|
+
setPendingHistoryItem,
|
|
1365
|
+
onExec,
|
|
1366
|
+
llmClient,
|
|
1367
|
+
setShellInputFocused,
|
|
1368
|
+
terminalHeight,
|
|
1369
|
+
terminalWidth
|
|
1370
|
+
]
|
|
1371
|
+
);
|
|
1372
|
+
return { handleShellCommand, activeShellPtyId };
|
|
1373
|
+
}, "useShellCommandProcessor");
|
|
1374
|
+
|
|
1375
|
+
// packages/cli/src/ui/components/stats-helpers.tsx
|
|
1376
|
+
init_esbuild_shims();
|
|
1377
|
+
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
1378
|
+
var TAB_DEFS = [
|
|
1379
|
+
{ tab: "session", label: /* @__PURE__ */ __name(() => t("Session"), "label") },
|
|
1380
|
+
{ tab: "activity", label: /* @__PURE__ */ __name(() => t("Activity"), "label") },
|
|
1381
|
+
{ tab: "efficiency", label: /* @__PURE__ */ __name(() => t("Efficiency"), "label") }
|
|
1382
|
+
];
|
|
1383
|
+
var RANGE_CYCLE = ["all", "month", "week", "today"];
|
|
1384
|
+
function getHeatmapColors() {
|
|
1385
|
+
return {
|
|
1386
|
+
0: "#161b22",
|
|
1387
|
+
1: "#0e4429",
|
|
1388
|
+
2: "#006d32",
|
|
1389
|
+
3: "#26a641",
|
|
1390
|
+
4: "#39d353"
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
__name(getHeatmapColors, "getHeatmapColors");
|
|
1394
|
+
function getSeriesColors() {
|
|
1395
|
+
return [
|
|
1396
|
+
theme.text.link,
|
|
1397
|
+
theme.status.error,
|
|
1398
|
+
theme.text.accent,
|
|
1399
|
+
theme.status.success,
|
|
1400
|
+
theme.status.warning,
|
|
1401
|
+
theme.text.code
|
|
1402
|
+
];
|
|
1403
|
+
}
|
|
1404
|
+
__name(getSeriesColors, "getSeriesColors");
|
|
1405
|
+
function getRangeLabel(range) {
|
|
1406
|
+
const labels = {
|
|
1407
|
+
today: t("Today"),
|
|
1408
|
+
all: t("All time"),
|
|
1409
|
+
week: t("Last 7 days"),
|
|
1410
|
+
month: t("Last 30 days")
|
|
1411
|
+
};
|
|
1412
|
+
return labels[range] ?? range;
|
|
1413
|
+
}
|
|
1414
|
+
__name(getRangeLabel, "getRangeLabel");
|
|
1415
|
+
function fmtTokens(n) {
|
|
1416
|
+
if (n >= 1e6) return `${(n / 1e6).toFixed(1)}m`;
|
|
1417
|
+
if (n >= 1e3) return `${(n / 1e3).toFixed(1)}k`;
|
|
1418
|
+
return `${n}`;
|
|
1419
|
+
}
|
|
1420
|
+
__name(fmtTokens, "fmtTokens");
|
|
1421
|
+
function fmtDurationShort(ms) {
|
|
1422
|
+
const totalMinutes = Math.floor(ms / 6e4);
|
|
1423
|
+
const days = Math.floor(totalMinutes / 1440);
|
|
1424
|
+
const hours = Math.floor(totalMinutes % 1440 / 60);
|
|
1425
|
+
const minutes = totalMinutes % 60;
|
|
1426
|
+
const d = t("d");
|
|
1427
|
+
const h = t("h");
|
|
1428
|
+
const m = t("m");
|
|
1429
|
+
if (days > 0) return `${days}${d} ${hours}${h} ${minutes}${m}`;
|
|
1430
|
+
if (hours > 0) return `${hours}${h} ${minutes}${m}`;
|
|
1431
|
+
return `${minutes}${m}`;
|
|
1432
|
+
}
|
|
1433
|
+
__name(fmtDurationShort, "fmtDurationShort");
|
|
1434
|
+
function fmtSuccessBar(rate) {
|
|
1435
|
+
const filled = Math.max(0, Math.min(10, Math.round(rate / 10)));
|
|
1436
|
+
return "\u2588".repeat(filled) + "\u2591".repeat(10 - filled);
|
|
1437
|
+
}
|
|
1438
|
+
__name(fmtSuccessBar, "fmtSuccessBar");
|
|
1439
|
+
function getSuccessColor(rate) {
|
|
1440
|
+
if (rate >= 95) return theme.status.success;
|
|
1441
|
+
if (rate >= 80) return theme.status.warning;
|
|
1442
|
+
return theme.status.error;
|
|
1443
|
+
}
|
|
1444
|
+
__name(getSuccessColor, "getSuccessColor");
|
|
1445
|
+
function getCacheColor(rate) {
|
|
1446
|
+
if (rate >= 85) return theme.status.success;
|
|
1447
|
+
if (rate >= 70) return theme.status.warning;
|
|
1448
|
+
return theme.status.error;
|
|
1449
|
+
}
|
|
1450
|
+
__name(getCacheColor, "getCacheColor");
|
|
1451
|
+
var TableRow = /* @__PURE__ */ __name(({ cells }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { children: cells.map((cell, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { width: cell.width, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: cell.color, bold: cell.bold, children: cell.text }) }, i)) }), "TableRow");
|
|
1452
|
+
|
|
1453
|
+
// packages/cli/src/ui/hooks/useFollowupSuggestions.tsx
|
|
1454
|
+
init_esbuild_shims();
|
|
1455
|
+
var import_react6 = __toESM(require_react(), 1);
|
|
1456
|
+
function useFollowupSuggestionsCLI(options = {}) {
|
|
1457
|
+
const { enabled = true, onAccept, config, isFocused = true } = options;
|
|
1458
|
+
const [state, setState] = (0, import_react6.useState)(INITIAL_FOLLOWUP_STATE);
|
|
1459
|
+
const onAcceptRef = (0, import_react6.useRef)(onAccept);
|
|
1460
|
+
onAcceptRef.current = onAccept;
|
|
1461
|
+
const configRef = (0, import_react6.useRef)(config);
|
|
1462
|
+
configRef.current = config;
|
|
1463
|
+
const firstKeystrokeAtRef = (0, import_react6.useRef)(0);
|
|
1464
|
+
const prevShownAtRef = (0, import_react6.useRef)(0);
|
|
1465
|
+
const wasFocusedWhenShownRef = (0, import_react6.useRef)(true);
|
|
1466
|
+
(0, import_react6.useEffect)(() => {
|
|
1467
|
+
if (state.shownAt > 0 && state.shownAt !== prevShownAtRef.current) {
|
|
1468
|
+
prevShownAtRef.current = state.shownAt;
|
|
1469
|
+
wasFocusedWhenShownRef.current = isFocused;
|
|
1470
|
+
firstKeystrokeAtRef.current = 0;
|
|
1471
|
+
} else if (state.shownAt === 0) {
|
|
1472
|
+
prevShownAtRef.current = 0;
|
|
1473
|
+
}
|
|
1474
|
+
}, [state.shownAt, isFocused]);
|
|
1475
|
+
const recordKeystroke = (0, import_react6.useCallback)(() => {
|
|
1476
|
+
if (firstKeystrokeAtRef.current === 0 && state.isVisible) {
|
|
1477
|
+
firstKeystrokeAtRef.current = Date.now();
|
|
1478
|
+
}
|
|
1479
|
+
}, [state.isVisible]);
|
|
1480
|
+
const onOutcome = (0, import_react6.useCallback)(
|
|
1481
|
+
(params) => {
|
|
1482
|
+
const cfg = configRef.current;
|
|
1483
|
+
if (!cfg) return;
|
|
1484
|
+
logPromptSuggestion(
|
|
1485
|
+
cfg,
|
|
1486
|
+
new PromptSuggestionEvent({
|
|
1487
|
+
outcome: params.outcome,
|
|
1488
|
+
accept_method: params.accept_method,
|
|
1489
|
+
accept_source: params.accept_source,
|
|
1490
|
+
...params.outcome === "accepted" ? { time_to_accept_ms: params.time_ms } : { time_to_ignore_ms: params.time_ms },
|
|
1491
|
+
// Skip for fallback accepts: the suggestion was never shown via the
|
|
1492
|
+
// timer (shownAt stayed 0), so `prevShownAtRef` still holds a previous
|
|
1493
|
+
// suggestion's timestamp and the delta would be meaningless.
|
|
1494
|
+
...params.accept_source !== "fallback" && firstKeystrokeAtRef.current > 0 && prevShownAtRef.current > 0 && {
|
|
1495
|
+
time_to_first_keystroke_ms: firstKeystrokeAtRef.current - prevShownAtRef.current
|
|
1496
|
+
},
|
|
1497
|
+
suggestion_length: params.suggestion_length,
|
|
1498
|
+
similarity: params.outcome === "accepted" ? 1 : 0,
|
|
1499
|
+
was_focused_when_shown: wasFocusedWhenShownRef.current
|
|
1500
|
+
})
|
|
1501
|
+
);
|
|
1502
|
+
},
|
|
1503
|
+
[]
|
|
1504
|
+
);
|
|
1505
|
+
const controller = (0, import_react6.useMemo)(
|
|
1506
|
+
() => createFollowupController({
|
|
1507
|
+
enabled,
|
|
1508
|
+
onStateChange: setState,
|
|
1509
|
+
getOnAccept: /* @__PURE__ */ __name(() => onAcceptRef.current, "getOnAccept"),
|
|
1510
|
+
onOutcome
|
|
1511
|
+
}),
|
|
1512
|
+
[enabled, onOutcome]
|
|
1513
|
+
);
|
|
1514
|
+
(0, import_react6.useEffect)(() => {
|
|
1515
|
+
if (!enabled) {
|
|
1516
|
+
controller.clear();
|
|
1517
|
+
}
|
|
1518
|
+
return () => controller.cleanup();
|
|
1519
|
+
}, [controller, enabled]);
|
|
1520
|
+
return (0, import_react6.useMemo)(
|
|
1521
|
+
() => ({
|
|
1522
|
+
state,
|
|
1523
|
+
setSuggestion: controller.setSuggestion,
|
|
1524
|
+
accept: controller.accept,
|
|
1525
|
+
dismiss: controller.dismiss,
|
|
1526
|
+
clear: controller.clear,
|
|
1527
|
+
recordKeystroke
|
|
1528
|
+
}),
|
|
1529
|
+
[state, controller, recordKeystroke]
|
|
1530
|
+
);
|
|
1531
|
+
}
|
|
1532
|
+
__name(useFollowupSuggestionsCLI, "useFollowupSuggestionsCLI");
|
|
1533
|
+
|
|
1534
|
+
// packages/cli/src/ui/components/AsciiArt.ts
|
|
1535
|
+
init_esbuild_shims();
|
|
1536
|
+
var shortAsciiLogo = `
|
|
1537
|
+
\u2584\u2584\u2584\u2584\u2584\u2584 \u2584\u2584 \u2584\u2584 \u2584\u2584\u2584\u2584\u2584\u2584\u2584 \u2584\u2584\u2584 \u2584\u2584
|
|
1538
|
+
\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551
|
|
1539
|
+
\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551
|
|
1540
|
+
\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551
|
|
1541
|
+
\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551
|
|
1542
|
+
\u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D
|
|
1543
|
+
`;
|
|
1544
|
+
|
|
1545
|
+
// packages/cli/src/ui/utils/customBanner.ts
|
|
1546
|
+
init_esbuild_shims();
|
|
1547
|
+
import * as fs2 from "node:fs";
|
|
1548
|
+
import * as path2 from "node:path";
|
|
1549
|
+
var debugLogger4 = createDebugLogger("BANNER");
|
|
1550
|
+
var MAX_FILE_BYTES = 64 * 1024;
|
|
1551
|
+
var MAX_ART_LINES = 200;
|
|
1552
|
+
var MAX_ART_COLS = 200;
|
|
1553
|
+
var MAX_TITLE_LENGTH = 80;
|
|
1554
|
+
var MAX_SUBTITLE_LENGTH = 160;
|
|
1555
|
+
function resolveCustomBanner(settings) {
|
|
1556
|
+
const ui = settings.merged.ui;
|
|
1557
|
+
const cache = /* @__PURE__ */ new Map();
|
|
1558
|
+
const title = sanitizeTitle(ui?.customBannerTitle);
|
|
1559
|
+
const subtitle = sanitizeSubtitle(ui?.customBannerSubtitle);
|
|
1560
|
+
const scoped = collectScopedTiers(settings);
|
|
1561
|
+
return {
|
|
1562
|
+
asciiArt: {
|
|
1563
|
+
small: scoped.small && resolveTier(scoped.small.source, scoped.small.dir, cache),
|
|
1564
|
+
large: scoped.large && resolveTier(scoped.large.source, scoped.large.dir, cache)
|
|
1565
|
+
},
|
|
1566
|
+
title,
|
|
1567
|
+
subtitle
|
|
1568
|
+
};
|
|
1569
|
+
}
|
|
1570
|
+
__name(resolveCustomBanner, "resolveCustomBanner");
|
|
1571
|
+
function collectScopedTiers(settings) {
|
|
1572
|
+
const order = [
|
|
1573
|
+
settings.system,
|
|
1574
|
+
...settings.isTrusted ? [settings.workspace] : [],
|
|
1575
|
+
settings.user,
|
|
1576
|
+
settings.systemDefaults
|
|
1577
|
+
];
|
|
1578
|
+
let small;
|
|
1579
|
+
let large;
|
|
1580
|
+
for (const file of order) {
|
|
1581
|
+
if (small && large) break;
|
|
1582
|
+
const raw = file.settings.ui?.customAsciiArt;
|
|
1583
|
+
if (raw === void 0 || raw === null) continue;
|
|
1584
|
+
const tiers = normalizeTiers(raw);
|
|
1585
|
+
if (!tiers) continue;
|
|
1586
|
+
const dir = file.path ? path2.dirname(file.path) : "";
|
|
1587
|
+
const considerTier = /* @__PURE__ */ __name((tier, label) => {
|
|
1588
|
+
if (tier === void 0) return void 0;
|
|
1589
|
+
const isPathSource = typeof tier === "object";
|
|
1590
|
+
if (isPathSource && !dir) {
|
|
1591
|
+
debugLogger4.warn(
|
|
1592
|
+
`Ignoring ui.customAsciiArt.${label}: {path} entry has no owning settings file directory to resolve against.`
|
|
1593
|
+
);
|
|
1594
|
+
return void 0;
|
|
1595
|
+
}
|
|
1596
|
+
return { source: tier, dir };
|
|
1597
|
+
}, "considerTier");
|
|
1598
|
+
if (!small) {
|
|
1599
|
+
const next = considerTier(tiers.small, "small");
|
|
1600
|
+
if (next) small = next;
|
|
1601
|
+
}
|
|
1602
|
+
if (!large) {
|
|
1603
|
+
const next = considerTier(tiers.large, "large");
|
|
1604
|
+
if (next) large = next;
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
return { small, large };
|
|
1608
|
+
}
|
|
1609
|
+
__name(collectScopedTiers, "collectScopedTiers");
|
|
1610
|
+
function normalizeTiers(value) {
|
|
1611
|
+
if (typeof value === "string") {
|
|
1612
|
+
return { small: value, large: value };
|
|
1613
|
+
}
|
|
1614
|
+
if (!value || typeof value !== "object") {
|
|
1615
|
+
debugLogger4.warn(
|
|
1616
|
+
"Ignoring ui.customAsciiArt: expected a string, {path}, or {small,large} object."
|
|
1617
|
+
);
|
|
1618
|
+
return void 0;
|
|
1619
|
+
}
|
|
1620
|
+
const hasPath = "path" in value && typeof value.path === "string";
|
|
1621
|
+
const hasTierKeys = "small" in value || "large" in value;
|
|
1622
|
+
if (hasPath && hasTierKeys) {
|
|
1623
|
+
debugLogger4.warn(
|
|
1624
|
+
"Ignoring ui.customAsciiArt: object combines `path` with `small` / `large`. Use one shape or the other."
|
|
1625
|
+
);
|
|
1626
|
+
return void 0;
|
|
1627
|
+
}
|
|
1628
|
+
if (hasPath) {
|
|
1629
|
+
return { small: value, large: value };
|
|
1630
|
+
}
|
|
1631
|
+
if (hasTierKeys) {
|
|
1632
|
+
const tiered = value;
|
|
1633
|
+
return {
|
|
1634
|
+
small: validateSource(tiered.small),
|
|
1635
|
+
large: validateSource(tiered.large)
|
|
1636
|
+
};
|
|
1637
|
+
}
|
|
1638
|
+
debugLogger4.warn(
|
|
1639
|
+
"Ignoring ui.customAsciiArt: expected a string, {path}, or {small,large} object."
|
|
1640
|
+
);
|
|
1641
|
+
return void 0;
|
|
1642
|
+
}
|
|
1643
|
+
__name(normalizeTiers, "normalizeTiers");
|
|
1644
|
+
function validateSource(source) {
|
|
1645
|
+
if (source === void 0 || source === null) return void 0;
|
|
1646
|
+
if (typeof source === "string") return source;
|
|
1647
|
+
if (typeof source === "object" && "path" in source && typeof source.path === "string") {
|
|
1648
|
+
return { path: source.path };
|
|
1649
|
+
}
|
|
1650
|
+
debugLogger4.warn(
|
|
1651
|
+
"Ignoring ui.customAsciiArt tier: expected a string or {path} object."
|
|
1652
|
+
);
|
|
1653
|
+
return void 0;
|
|
1654
|
+
}
|
|
1655
|
+
__name(validateSource, "validateSource");
|
|
1656
|
+
function resolveTier(source, ownerDir, cache) {
|
|
1657
|
+
if (source === void 0) return void 0;
|
|
1658
|
+
if (typeof source === "string") {
|
|
1659
|
+
const trimmed = source.trim();
|
|
1660
|
+
if (!trimmed) return void 0;
|
|
1661
|
+
const key = `inline:${source}`;
|
|
1662
|
+
return memo(cache, key, () => sanitizeArt(source));
|
|
1663
|
+
}
|
|
1664
|
+
const resolvedPath = path2.isAbsolute(source.path) ? source.path : path2.resolve(ownerDir, source.path);
|
|
1665
|
+
return memo(cache, `path:${resolvedPath}`, () => {
|
|
1666
|
+
const raw = readArtFile(resolvedPath);
|
|
1667
|
+
if (raw === void 0) return void 0;
|
|
1668
|
+
return sanitizeArt(raw);
|
|
1669
|
+
});
|
|
1670
|
+
}
|
|
1671
|
+
__name(resolveTier, "resolveTier");
|
|
1672
|
+
function memo(cache, key, compute) {
|
|
1673
|
+
const hit = cache.get(key);
|
|
1674
|
+
if (hit) return hit.value;
|
|
1675
|
+
const value = compute();
|
|
1676
|
+
cache.set(key, { value });
|
|
1677
|
+
return value;
|
|
1678
|
+
}
|
|
1679
|
+
__name(memo, "memo");
|
|
1680
|
+
function readArtFile(absolutePath) {
|
|
1681
|
+
let fd;
|
|
1682
|
+
try {
|
|
1683
|
+
let preOpenStat;
|
|
1684
|
+
try {
|
|
1685
|
+
preOpenStat = fs2.lstatSync(absolutePath);
|
|
1686
|
+
} catch (err) {
|
|
1687
|
+
debugLogger4.warn(
|
|
1688
|
+
`Failed to stat ui.customAsciiArt at ${absolutePath}: ${err.message}`
|
|
1689
|
+
);
|
|
1690
|
+
return void 0;
|
|
1691
|
+
}
|
|
1692
|
+
if (!preOpenStat.isFile()) {
|
|
1693
|
+
debugLogger4.warn(
|
|
1694
|
+
`Ignoring ui.customAsciiArt: ${absolutePath} is not a regular file.`
|
|
1695
|
+
);
|
|
1696
|
+
return void 0;
|
|
1697
|
+
}
|
|
1698
|
+
const flags = typeof fs2.constants.O_NOFOLLOW === "number" ? fs2.constants.O_RDONLY | fs2.constants.O_NOFOLLOW : fs2.constants.O_RDONLY;
|
|
1699
|
+
fd = fs2.openSync(absolutePath, flags);
|
|
1700
|
+
const stat = fs2.fstatSync(fd);
|
|
1701
|
+
if (!stat.isFile()) {
|
|
1702
|
+
debugLogger4.warn(
|
|
1703
|
+
`Ignoring ui.customAsciiArt: ${absolutePath} is not a regular file.`
|
|
1704
|
+
);
|
|
1705
|
+
return void 0;
|
|
1706
|
+
}
|
|
1707
|
+
const size = Math.min(stat.size, MAX_FILE_BYTES);
|
|
1708
|
+
const buffer = Buffer.alloc(size);
|
|
1709
|
+
fs2.readSync(fd, buffer, 0, size, 0);
|
|
1710
|
+
if (stat.size > MAX_FILE_BYTES) {
|
|
1711
|
+
debugLogger4.warn(
|
|
1712
|
+
`Truncated ui.customAsciiArt at ${absolutePath}: file is ${stat.size} bytes, capped at ${MAX_FILE_BYTES}.`
|
|
1713
|
+
);
|
|
1714
|
+
}
|
|
1715
|
+
return buffer.toString("utf8");
|
|
1716
|
+
} catch (err) {
|
|
1717
|
+
debugLogger4.warn(
|
|
1718
|
+
`Failed to read ui.customAsciiArt at ${absolutePath}: ${err.message}`
|
|
1719
|
+
);
|
|
1720
|
+
return void 0;
|
|
1721
|
+
} finally {
|
|
1722
|
+
if (fd !== void 0) {
|
|
1723
|
+
try {
|
|
1724
|
+
fs2.closeSync(fd);
|
|
1725
|
+
} catch {
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
__name(readArtFile, "readArtFile");
|
|
1731
|
+
function sanitizeArt(input) {
|
|
1732
|
+
let s = input.replace(/\r\n?/g, "\n");
|
|
1733
|
+
s = s.replace(TERMINAL_OSC_REGEX, " ").replace(TERMINAL_CSI_REGEX, " ").replace(TERMINAL_SHIFT_DCS_REGEX, " ");
|
|
1734
|
+
s = s.replace(/[\x00-\x08\x0b-\x1f\x7f-\x9f]/g, " ");
|
|
1735
|
+
const rawLines = s.split("\n");
|
|
1736
|
+
const truncatedRows = rawLines.length > MAX_ART_LINES;
|
|
1737
|
+
const limitedLines = truncatedRows ? rawLines.slice(0, MAX_ART_LINES) : rawLines;
|
|
1738
|
+
let truncatedCols = false;
|
|
1739
|
+
const cappedLines = limitedLines.map((line) => {
|
|
1740
|
+
const detabbed = line.replace(/\t/g, " ");
|
|
1741
|
+
const trimmed = detabbed.replace(/\s+$/u, "");
|
|
1742
|
+
if (getCachedStringWidth(trimmed) <= MAX_ART_COLS) {
|
|
1743
|
+
return trimmed;
|
|
1744
|
+
}
|
|
1745
|
+
truncatedCols = true;
|
|
1746
|
+
const codePoints = toCodePoints(trimmed);
|
|
1747
|
+
let kept = "";
|
|
1748
|
+
for (const cp of codePoints) {
|
|
1749
|
+
if (getCachedStringWidth(kept + cp) > MAX_ART_COLS) break;
|
|
1750
|
+
kept += cp;
|
|
1751
|
+
}
|
|
1752
|
+
return kept;
|
|
1753
|
+
});
|
|
1754
|
+
while (cappedLines.length > 0 && cappedLines[cappedLines.length - 1] === "") {
|
|
1755
|
+
cappedLines.pop();
|
|
1756
|
+
}
|
|
1757
|
+
if (cappedLines.length === 0) return "";
|
|
1758
|
+
if (truncatedRows) {
|
|
1759
|
+
debugLogger4.warn(`Truncated ui.customAsciiArt to ${MAX_ART_LINES} lines.`);
|
|
1760
|
+
}
|
|
1761
|
+
if (truncatedCols) {
|
|
1762
|
+
debugLogger4.warn(
|
|
1763
|
+
`Truncated ui.customAsciiArt to ${MAX_ART_COLS} columns per line.`
|
|
1764
|
+
);
|
|
1765
|
+
}
|
|
1766
|
+
return cappedLines.join("\n");
|
|
1767
|
+
}
|
|
1768
|
+
__name(sanitizeArt, "sanitizeArt");
|
|
1769
|
+
function sanitizeTitle(raw) {
|
|
1770
|
+
return sanitizeSingleLine(raw, MAX_TITLE_LENGTH, "ui.customBannerTitle");
|
|
1771
|
+
}
|
|
1772
|
+
__name(sanitizeTitle, "sanitizeTitle");
|
|
1773
|
+
function sanitizeSubtitle(raw) {
|
|
1774
|
+
return sanitizeSingleLine(
|
|
1775
|
+
raw,
|
|
1776
|
+
MAX_SUBTITLE_LENGTH,
|
|
1777
|
+
"ui.customBannerSubtitle"
|
|
1778
|
+
);
|
|
1779
|
+
}
|
|
1780
|
+
__name(sanitizeSubtitle, "sanitizeSubtitle");
|
|
1781
|
+
function sanitizeSingleLine(raw, maxLength, fieldLabel) {
|
|
1782
|
+
if (typeof raw !== "string") return void 0;
|
|
1783
|
+
let t2 = stripTerminalControlSequences(raw).replace(/\s+/g, " ").trim();
|
|
1784
|
+
if (!t2) return void 0;
|
|
1785
|
+
if (t2.length > maxLength) {
|
|
1786
|
+
debugLogger4.warn(`Truncated ${fieldLabel} to ${maxLength} characters.`);
|
|
1787
|
+
t2 = t2.slice(0, maxLength);
|
|
1788
|
+
}
|
|
1789
|
+
return t2;
|
|
1790
|
+
}
|
|
1791
|
+
__name(sanitizeSingleLine, "sanitizeSingleLine");
|
|
1792
|
+
function pickAsciiArtTier(small, large, availableWidth, logoGap, minInfoPanelWidth, measureWidth) {
|
|
1793
|
+
for (const candidate of [large, small]) {
|
|
1794
|
+
if (!candidate) continue;
|
|
1795
|
+
const w = measureWidth(candidate);
|
|
1796
|
+
if (availableWidth >= w + logoGap + minInfoPanelWidth) {
|
|
1797
|
+
return candidate;
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
return void 0;
|
|
1801
|
+
}
|
|
1802
|
+
__name(pickAsciiArtTier, "pickAsciiArtTier");
|
|
1803
|
+
|
|
1804
|
+
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
1805
|
+
init_esbuild_shims();
|
|
1806
|
+
var import_react7 = __toESM(require_react(), 1);
|
|
1807
|
+
var WITTY_LOADING_PHRASES = ["I'm Feeling Lucky"];
|
|
1808
|
+
var PHRASE_CHANGE_INTERVAL_MS = 15e3;
|
|
1809
|
+
var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases) => {
|
|
1810
|
+
const currentLanguage = getCurrentLanguage();
|
|
1811
|
+
const loadingPhrases = (0, import_react7.useMemo)(() => {
|
|
1812
|
+
if (customPhrases && customPhrases.length > 0) {
|
|
1813
|
+
return customPhrases;
|
|
1814
|
+
}
|
|
1815
|
+
const translatedPhrases = ta("WITTY_LOADING_PHRASES");
|
|
1816
|
+
return translatedPhrases.length > 0 ? translatedPhrases : WITTY_LOADING_PHRASES;
|
|
1817
|
+
}, [customPhrases, currentLanguage]);
|
|
1818
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0, import_react7.useState)(
|
|
1819
|
+
loadingPhrases[0]
|
|
1820
|
+
);
|
|
1821
|
+
const phraseIntervalRef = (0, import_react7.useRef)(null);
|
|
1822
|
+
(0, import_react7.useEffect)(() => {
|
|
1823
|
+
if (isWaiting) {
|
|
1824
|
+
setCurrentLoadingPhrase(t("Waiting for user confirmation..."));
|
|
1825
|
+
if (phraseIntervalRef.current) {
|
|
1826
|
+
clearInterval(phraseIntervalRef.current);
|
|
1827
|
+
phraseIntervalRef.current = null;
|
|
1828
|
+
}
|
|
1829
|
+
} else if (isActive) {
|
|
1830
|
+
if (phraseIntervalRef.current) {
|
|
1831
|
+
clearInterval(phraseIntervalRef.current);
|
|
1832
|
+
}
|
|
1833
|
+
const initialRandomIndex = Math.floor(
|
|
1834
|
+
Math.random() * loadingPhrases.length
|
|
1835
|
+
);
|
|
1836
|
+
setCurrentLoadingPhrase(loadingPhrases[initialRandomIndex]);
|
|
1837
|
+
phraseIntervalRef.current = setInterval(() => {
|
|
1838
|
+
const randomIndex = Math.floor(Math.random() * loadingPhrases.length);
|
|
1839
|
+
setCurrentLoadingPhrase(loadingPhrases[randomIndex]);
|
|
1840
|
+
}, PHRASE_CHANGE_INTERVAL_MS);
|
|
1841
|
+
} else {
|
|
1842
|
+
if (phraseIntervalRef.current) {
|
|
1843
|
+
clearInterval(phraseIntervalRef.current);
|
|
1844
|
+
phraseIntervalRef.current = null;
|
|
1845
|
+
}
|
|
1846
|
+
setCurrentLoadingPhrase(loadingPhrases[0]);
|
|
1847
|
+
}
|
|
1848
|
+
return () => {
|
|
1849
|
+
if (phraseIntervalRef.current) {
|
|
1850
|
+
clearInterval(phraseIntervalRef.current);
|
|
1851
|
+
phraseIntervalRef.current = null;
|
|
1852
|
+
}
|
|
1853
|
+
};
|
|
1854
|
+
}, [isActive, isWaiting, loadingPhrases]);
|
|
1855
|
+
return currentLoadingPhrase;
|
|
1856
|
+
}, "usePhraseCycler");
|
|
1857
|
+
|
|
1005
1858
|
// packages/cli/src/ui/components/mcp/utils.ts
|
|
1006
1859
|
init_esbuild_shims();
|
|
1007
1860
|
|
|
@@ -1154,87 +2007,9 @@ function getScopeMessageForSetting(settingKey, selectedScope, settings) {
|
|
|
1154
2007
|
}
|
|
1155
2008
|
__name(getScopeMessageForSetting, "getScopeMessageForSetting");
|
|
1156
2009
|
|
|
1157
|
-
// packages/cli/src/ui/components/stats-helpers.tsx
|
|
1158
|
-
init_esbuild_shims();
|
|
1159
|
-
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
1160
|
-
var TAB_DEFS = [
|
|
1161
|
-
{ tab: "session", label: /* @__PURE__ */ __name(() => t("Session"), "label") },
|
|
1162
|
-
{ tab: "activity", label: /* @__PURE__ */ __name(() => t("Activity"), "label") },
|
|
1163
|
-
{ tab: "efficiency", label: /* @__PURE__ */ __name(() => t("Efficiency"), "label") }
|
|
1164
|
-
];
|
|
1165
|
-
var RANGE_CYCLE = ["all", "month", "week", "today"];
|
|
1166
|
-
function getHeatmapColors() {
|
|
1167
|
-
return {
|
|
1168
|
-
0: "#161b22",
|
|
1169
|
-
1: "#0e4429",
|
|
1170
|
-
2: "#006d32",
|
|
1171
|
-
3: "#26a641",
|
|
1172
|
-
4: "#39d353"
|
|
1173
|
-
};
|
|
1174
|
-
}
|
|
1175
|
-
__name(getHeatmapColors, "getHeatmapColors");
|
|
1176
|
-
function getSeriesColors() {
|
|
1177
|
-
return [
|
|
1178
|
-
theme.text.link,
|
|
1179
|
-
theme.status.error,
|
|
1180
|
-
theme.text.accent,
|
|
1181
|
-
theme.status.success,
|
|
1182
|
-
theme.status.warning,
|
|
1183
|
-
theme.text.code
|
|
1184
|
-
];
|
|
1185
|
-
}
|
|
1186
|
-
__name(getSeriesColors, "getSeriesColors");
|
|
1187
|
-
function getRangeLabel(range) {
|
|
1188
|
-
const labels = {
|
|
1189
|
-
today: t("Today"),
|
|
1190
|
-
all: t("All time"),
|
|
1191
|
-
week: t("Last 7 days"),
|
|
1192
|
-
month: t("Last 30 days")
|
|
1193
|
-
};
|
|
1194
|
-
return labels[range] ?? range;
|
|
1195
|
-
}
|
|
1196
|
-
__name(getRangeLabel, "getRangeLabel");
|
|
1197
|
-
function fmtTokens(n) {
|
|
1198
|
-
if (n >= 1e6) return `${(n / 1e6).toFixed(1)}m`;
|
|
1199
|
-
if (n >= 1e3) return `${(n / 1e3).toFixed(1)}k`;
|
|
1200
|
-
return `${n}`;
|
|
1201
|
-
}
|
|
1202
|
-
__name(fmtTokens, "fmtTokens");
|
|
1203
|
-
function fmtDurationShort(ms) {
|
|
1204
|
-
const totalMinutes = Math.floor(ms / 6e4);
|
|
1205
|
-
const days = Math.floor(totalMinutes / 1440);
|
|
1206
|
-
const hours = Math.floor(totalMinutes % 1440 / 60);
|
|
1207
|
-
const minutes = totalMinutes % 60;
|
|
1208
|
-
const d = t("d");
|
|
1209
|
-
const h = t("h");
|
|
1210
|
-
const m = t("m");
|
|
1211
|
-
if (days > 0) return `${days}${d} ${hours}${h} ${minutes}${m}`;
|
|
1212
|
-
if (hours > 0) return `${hours}${h} ${minutes}${m}`;
|
|
1213
|
-
return `${minutes}${m}`;
|
|
1214
|
-
}
|
|
1215
|
-
__name(fmtDurationShort, "fmtDurationShort");
|
|
1216
|
-
function fmtSuccessBar(rate) {
|
|
1217
|
-
const filled = Math.max(0, Math.min(10, Math.round(rate / 10)));
|
|
1218
|
-
return "\u2588".repeat(filled) + "\u2591".repeat(10 - filled);
|
|
1219
|
-
}
|
|
1220
|
-
__name(fmtSuccessBar, "fmtSuccessBar");
|
|
1221
|
-
function getSuccessColor(rate) {
|
|
1222
|
-
if (rate >= 95) return theme.status.success;
|
|
1223
|
-
if (rate >= 80) return theme.status.warning;
|
|
1224
|
-
return theme.status.error;
|
|
1225
|
-
}
|
|
1226
|
-
__name(getSuccessColor, "getSuccessColor");
|
|
1227
|
-
function getCacheColor(rate) {
|
|
1228
|
-
if (rate >= 85) return theme.status.success;
|
|
1229
|
-
if (rate >= 70) return theme.status.warning;
|
|
1230
|
-
return theme.status.error;
|
|
1231
|
-
}
|
|
1232
|
-
__name(getCacheColor, "getCacheColor");
|
|
1233
|
-
var TableRow = /* @__PURE__ */ __name(({ cells }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { children: cells.map((cell, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { width: cell.width, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: cell.color, bold: cell.bold, children: cell.text }) }, i)) }), "TableRow");
|
|
1234
|
-
|
|
1235
2010
|
// packages/cli/src/ui/auth/useProviderSetupFlow.ts
|
|
1236
2011
|
init_esbuild_shims();
|
|
1237
|
-
var
|
|
2012
|
+
var import_react8 = __toESM(require_react(), 1);
|
|
1238
2013
|
var STEP_ORDER = [
|
|
1239
2014
|
"protocol",
|
|
1240
2015
|
"baseUrl",
|
|
@@ -1251,28 +2026,28 @@ function getVisibleSteps(config) {
|
|
|
1251
2026
|
}
|
|
1252
2027
|
__name(getVisibleSteps, "getVisibleSteps");
|
|
1253
2028
|
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,
|
|
2029
|
+
const [provider, setProvider] = (0, import_react8.useState)(null);
|
|
2030
|
+
const [visibleSteps, setVisibleSteps] = (0, import_react8.useState)([]);
|
|
2031
|
+
const [stepIndex, setStepIndex] = (0, import_react8.useState)(0);
|
|
2032
|
+
const [protocol, setProtocol] = (0, import_react8.useState)("openai" /* USE_OPENAI */);
|
|
2033
|
+
const [baseUrl, setBaseUrl] = (0, import_react8.useState)("");
|
|
2034
|
+
const [baseUrlPlaceholder, setBaseUrlPlaceholder] = (0, import_react8.useState)("");
|
|
2035
|
+
const [baseUrlOptionIndex, setBaseUrlOptionIndex] = (0, import_react8.useState)(0);
|
|
2036
|
+
const [baseUrlError, setBaseUrlError] = (0, import_react8.useState)(null);
|
|
2037
|
+
const [apiKey, setApiKey] = (0, import_react8.useState)("");
|
|
2038
|
+
const [apiKeyError, setApiKeyError] = (0, import_react8.useState)(null);
|
|
2039
|
+
const [modelIds, setModelIds] = (0, import_react8.useState)("");
|
|
2040
|
+
const [modelIdsError, setModelIdsError] = (0, import_react8.useState)(null);
|
|
2041
|
+
const [thinkingEnabled, setThinkingEnabled] = (0, import_react8.useState)(false);
|
|
2042
|
+
const [modalityEnabled, setModalityEnabled] = (0, import_react8.useState)(false);
|
|
2043
|
+
const [modalityImage, setModalityImage] = (0, import_react8.useState)(true);
|
|
2044
|
+
const [modalityVideo, setModalityVideo] = (0, import_react8.useState)(true);
|
|
2045
|
+
const [modalityAudio, setModalityAudio] = (0, import_react8.useState)(false);
|
|
2046
|
+
const [modalityPdf, setModalityPdf] = (0, import_react8.useState)(false);
|
|
2047
|
+
const [contextWindowSize, setContextWindowSize] = (0, import_react8.useState)("");
|
|
2048
|
+
const [focusedConfigIndex, setFocusedConfigIndex] = (0, import_react8.useState)(0);
|
|
1274
2049
|
const currentStep = visibleSteps[stepIndex] ?? null;
|
|
1275
|
-
const start = (0,
|
|
2050
|
+
const start = (0, import_react8.useCallback)(
|
|
1276
2051
|
(config, initialProtocol, existingEnv, existingModelIds) => {
|
|
1277
2052
|
setProvider(config);
|
|
1278
2053
|
const steps = getVisibleSteps(config);
|
|
@@ -1309,12 +2084,12 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1309
2084
|
},
|
|
1310
2085
|
[]
|
|
1311
2086
|
);
|
|
1312
|
-
const reset = (0,
|
|
2087
|
+
const reset = (0, import_react8.useCallback)(() => {
|
|
1313
2088
|
setProvider(null);
|
|
1314
2089
|
setVisibleSteps([]);
|
|
1315
2090
|
setStepIndex(0);
|
|
1316
2091
|
}, []);
|
|
1317
|
-
const goBack = (0,
|
|
2092
|
+
const goBack = (0, import_react8.useCallback)(() => {
|
|
1318
2093
|
if (stepIndex > 0) {
|
|
1319
2094
|
setStepIndex((i) => i - 1);
|
|
1320
2095
|
return true;
|
|
@@ -1322,10 +2097,10 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1322
2097
|
reset();
|
|
1323
2098
|
return false;
|
|
1324
2099
|
}, [stepIndex, reset]);
|
|
1325
|
-
const goNext = (0,
|
|
2100
|
+
const goNext = (0, import_react8.useCallback)(() => {
|
|
1326
2101
|
setStepIndex((i) => Math.min(i + 1, visibleSteps.length - 1));
|
|
1327
2102
|
}, [visibleSteps]);
|
|
1328
|
-
const selectProtocol = (0,
|
|
2103
|
+
const selectProtocol = (0, import_react8.useCallback)(
|
|
1329
2104
|
(selectedProtocol) => {
|
|
1330
2105
|
setProtocol(selectedProtocol);
|
|
1331
2106
|
setBaseUrl("");
|
|
@@ -1336,7 +2111,7 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1336
2111
|
},
|
|
1337
2112
|
[goNext]
|
|
1338
2113
|
);
|
|
1339
|
-
const selectBaseUrl = (0,
|
|
2114
|
+
const selectBaseUrl = (0, import_react8.useCallback)(
|
|
1340
2115
|
(selectedUrl) => {
|
|
1341
2116
|
setBaseUrl(selectedUrl);
|
|
1342
2117
|
setBaseUrlError(null);
|
|
@@ -1344,7 +2119,7 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1344
2119
|
},
|
|
1345
2120
|
[goNext]
|
|
1346
2121
|
);
|
|
1347
|
-
const submitBaseUrl = (0,
|
|
2122
|
+
const submitBaseUrl = (0, import_react8.useCallback)(() => {
|
|
1348
2123
|
const effective = baseUrl.trim() || baseUrlPlaceholder.trim();
|
|
1349
2124
|
if (!effective) {
|
|
1350
2125
|
setBaseUrlError(t("Base URL cannot be empty."));
|
|
@@ -1361,15 +2136,15 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1361
2136
|
goNext();
|
|
1362
2137
|
return true;
|
|
1363
2138
|
}, [baseUrl, baseUrlPlaceholder, goNext]);
|
|
1364
|
-
const changeBaseUrl = (0,
|
|
2139
|
+
const changeBaseUrl = (0, import_react8.useCallback)((value) => {
|
|
1365
2140
|
setBaseUrl(value);
|
|
1366
2141
|
setBaseUrlError(null);
|
|
1367
2142
|
}, []);
|
|
1368
|
-
const changeApiKey = (0,
|
|
2143
|
+
const changeApiKey = (0, import_react8.useCallback)((value) => {
|
|
1369
2144
|
setApiKey(value);
|
|
1370
2145
|
setApiKeyError(null);
|
|
1371
2146
|
}, []);
|
|
1372
|
-
const buildCurrentInputs = (0,
|
|
2147
|
+
const buildCurrentInputs = (0, import_react8.useCallback)(
|
|
1373
2148
|
(overrides) => ({
|
|
1374
2149
|
protocol: provider?.protocolOptions ? protocol : void 0,
|
|
1375
2150
|
baseUrl: baseUrl.trim(),
|
|
@@ -1379,7 +2154,7 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1379
2154
|
}),
|
|
1380
2155
|
[provider, protocol, baseUrl, apiKey, modelIds]
|
|
1381
2156
|
);
|
|
1382
|
-
const submitOrNext = (0,
|
|
2157
|
+
const submitOrNext = (0, import_react8.useCallback)(
|
|
1383
2158
|
(overrides) => {
|
|
1384
2159
|
if (stepIndex >= visibleSteps.length - 1) {
|
|
1385
2160
|
if (provider) void onSubmit(provider, buildCurrentInputs(overrides));
|
|
@@ -1389,7 +2164,7 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1389
2164
|
},
|
|
1390
2165
|
[stepIndex, visibleSteps, provider, onSubmit, buildCurrentInputs, goNext]
|
|
1391
2166
|
);
|
|
1392
|
-
const submitApiKey = (0,
|
|
2167
|
+
const submitApiKey = (0, import_react8.useCallback)(
|
|
1393
2168
|
(keyOverride) => {
|
|
1394
2169
|
const trimmed = (keyOverride ?? apiKey).trim();
|
|
1395
2170
|
if (!trimmed) {
|
|
@@ -1410,7 +2185,7 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1410
2185
|
},
|
|
1411
2186
|
[apiKey, provider, baseUrl, submitOrNext]
|
|
1412
2187
|
);
|
|
1413
|
-
const highlightBaseUrl = (0,
|
|
2188
|
+
const highlightBaseUrl = (0, import_react8.useCallback)(
|
|
1414
2189
|
(url) => {
|
|
1415
2190
|
if (provider && Array.isArray(provider.baseUrl)) {
|
|
1416
2191
|
const idx = provider.baseUrl.findIndex((o) => o.url === url);
|
|
@@ -1419,14 +2194,14 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1419
2194
|
},
|
|
1420
2195
|
[provider]
|
|
1421
2196
|
);
|
|
1422
|
-
const changeModelIds = (0,
|
|
2197
|
+
const changeModelIds = (0, import_react8.useCallback)((value) => {
|
|
1423
2198
|
setModelIds(value);
|
|
1424
2199
|
setModelIdsError(null);
|
|
1425
2200
|
}, []);
|
|
1426
|
-
const clearModelIdsError = (0,
|
|
2201
|
+
const clearModelIdsError = (0, import_react8.useCallback)(() => {
|
|
1427
2202
|
setModelIdsError(null);
|
|
1428
2203
|
}, []);
|
|
1429
|
-
const submitModelIds = (0,
|
|
2204
|
+
const submitModelIds = (0, import_react8.useCallback)(
|
|
1430
2205
|
(overrides) => {
|
|
1431
2206
|
const normalized = overrides?.modelIds ?? normalizeModelIds(modelIds);
|
|
1432
2207
|
if (normalized.length === 0) {
|
|
@@ -1441,13 +2216,13 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1441
2216
|
[modelIds, submitOrNext]
|
|
1442
2217
|
);
|
|
1443
2218
|
const advancedOptionCount = modalityEnabled ? 7 : 3;
|
|
1444
|
-
const moveAdvancedFocusUp = (0,
|
|
2219
|
+
const moveAdvancedFocusUp = (0, import_react8.useCallback)(() => {
|
|
1445
2220
|
setFocusedConfigIndex((v) => v <= 0 ? advancedOptionCount - 1 : v - 1);
|
|
1446
2221
|
}, [advancedOptionCount]);
|
|
1447
|
-
const moveAdvancedFocusDown = (0,
|
|
2222
|
+
const moveAdvancedFocusDown = (0, import_react8.useCallback)(() => {
|
|
1448
2223
|
setFocusedConfigIndex((v) => v >= advancedOptionCount - 1 ? 0 : v + 1);
|
|
1449
2224
|
}, [advancedOptionCount]);
|
|
1450
|
-
const toggleFocusedAdvancedOption = (0,
|
|
2225
|
+
const toggleFocusedAdvancedOption = (0, import_react8.useCallback)(() => {
|
|
1451
2226
|
switch (focusedConfigIndex) {
|
|
1452
2227
|
case 0:
|
|
1453
2228
|
setThinkingEnabled((v) => !v);
|
|
@@ -1471,13 +2246,13 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1471
2246
|
break;
|
|
1472
2247
|
}
|
|
1473
2248
|
}, [focusedConfigIndex]);
|
|
1474
|
-
const submitAdvancedConfig = (0,
|
|
2249
|
+
const submitAdvancedConfig = (0, import_react8.useCallback)(() => {
|
|
1475
2250
|
goNext();
|
|
1476
2251
|
}, [goNext]);
|
|
1477
|
-
const changeContextWindowSize = (0,
|
|
2252
|
+
const changeContextWindowSize = (0, import_react8.useCallback)((value) => {
|
|
1478
2253
|
setContextWindowSize(value.replace(/[^0-9]/g, ""));
|
|
1479
2254
|
}, []);
|
|
1480
|
-
const submit = (0,
|
|
2255
|
+
const submit = (0, import_react8.useCallback)(() => {
|
|
1481
2256
|
if (!provider) return;
|
|
1482
2257
|
const multimodal = modalityEnabled ? {
|
|
1483
2258
|
image: modalityImage || void 0,
|
|
@@ -1505,7 +2280,7 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
1505
2280
|
onSubmit,
|
|
1506
2281
|
buildCurrentInputs
|
|
1507
2282
|
]);
|
|
1508
|
-
const getPreviewJson = (0,
|
|
2283
|
+
const getPreviewJson = (0, import_react8.useCallback)(() => {
|
|
1509
2284
|
if (!provider) return "";
|
|
1510
2285
|
const envKey = typeof provider.envKey === "function" ? provider.envKey(protocol, baseUrl.trim()) : provider.envKey;
|
|
1511
2286
|
const normalizedIds = normalizeModelIds(modelIds);
|
|
@@ -1655,342 +2430,14 @@ var EditorSettingsManager = class {
|
|
|
1655
2430
|
};
|
|
1656
2431
|
var editorSettingsManager = new EditorSettingsManager();
|
|
1657
2432
|
|
|
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
2433
|
export {
|
|
1989
2434
|
computeWindowTitle,
|
|
1990
2435
|
writeTerminalTitle,
|
|
1991
2436
|
formatSessionWindowTitle,
|
|
1992
2437
|
titleStatusPrefix,
|
|
1993
2438
|
useLogger,
|
|
2439
|
+
addShellCommandToLlmHistory,
|
|
2440
|
+
useShellCommandProcessor,
|
|
1994
2441
|
VISIBLE_TOOLS_COUNT,
|
|
1995
2442
|
VISIBLE_RESOURCES_COUNT,
|
|
1996
2443
|
groupServersBySource,
|
|
@@ -2017,13 +2464,12 @@ export {
|
|
|
2017
2464
|
useProviderSetupFlow,
|
|
2018
2465
|
EDITOR_DISPLAY_NAMES,
|
|
2019
2466
|
editorSettingsManager,
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
buildStatusLinePresetLines,
|
|
2467
|
+
useFollowupSuggestionsCLI,
|
|
2468
|
+
shortAsciiLogo,
|
|
2469
|
+
resolveCustomBanner,
|
|
2470
|
+
pickAsciiArtTier,
|
|
2471
|
+
usePhraseCycler,
|
|
2472
|
+
useGitBranchName,
|
|
2027
2473
|
DualOutputBridge,
|
|
2028
2474
|
RemoteInputWatcher
|
|
2029
2475
|
};
|
|
@@ -2044,11 +2490,20 @@ export {
|
|
|
2044
2490
|
*/
|
|
2045
2491
|
/**
|
|
2046
2492
|
* @license
|
|
2047
|
-
* Copyright
|
|
2493
|
+
* Copyright 2025 Qwen Team
|
|
2494
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
2495
|
+
*
|
|
2496
|
+
* Prompt Suggestion Hook for CLI
|
|
2497
|
+
*
|
|
2498
|
+
* Thin React wrapper around the framework-agnostic controller from core.
|
|
2499
|
+
*/
|
|
2500
|
+
/**
|
|
2501
|
+
* @license
|
|
2502
|
+
* Copyright 2025 Qwen Code
|
|
2048
2503
|
* SPDX-License-Identifier: Apache-2.0
|
|
2049
2504
|
*/
|
|
2050
2505
|
/**
|
|
2051
2506
|
* @license
|
|
2052
|
-
* Copyright 2026 Qwen
|
|
2507
|
+
* Copyright 2026 Qwen Team
|
|
2053
2508
|
* SPDX-License-Identifier: Apache-2.0
|
|
2054
2509
|
*/
|