@qwen-code/qwen-code 0.21.2 → 0.21.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/qc-helper/docs/configuration/settings.md +41 -38
- package/bundled/qc-helper/docs/features/channels/github.md +7 -0
- package/bundled/qc-helper/docs/features/channels/gitlab.md +6 -0
- package/bundled/qc-helper/docs/features/code-review.md +78 -23
- package/bundled/qc-helper/docs/features/commands.md +2 -0
- package/bundled/qc-helper/docs/features/hooks.md +115 -18
- package/bundled/qc-helper/docs/features/memory.md +27 -0
- package/bundled/qc-helper/docs/features/skills.md +46 -1
- package/bundled/qc-helper/docs/features/sub-agents.md +42 -9
- package/bundled/qc-helper/docs/features/tool-use-summaries.md +7 -7
- package/bundled/qc-helper/docs/qwen-serve.md +21 -1
- package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +13 -13
- package/bundled/qc-helper/docs/support/troubleshooting.md +6 -1
- package/bundled/review/DESIGN.md +167 -32
- package/bundled/review/SKILL.md +156 -32
- package/chunks/{MaxSizedBox-TQBQ247P.js → MaxSizedBox-OJR636GP.js} +40 -38
- package/chunks/{StandaloneSessionPicker-2HPTKCLX.js → StandaloneSessionPicker-AMMBF5UY.js} +62 -59
- package/chunks/{acp-startup-profiler-2C4A5ZTJ.js → acp-startup-profiler-3RICG2YW.js} +2 -2
- package/chunks/{acpAgent-PS6EDGH3.js → acpAgent-M57LVIQA.js} +662 -560
- package/chunks/{agent-VDOUB35F.js → agent-PE37ARLM.js} +36 -34
- package/chunks/{agent-headless-EO53EFS2.js → agent-headless-45ASME4R.js} +36 -34
- package/chunks/{anthropicContentGenerator-OFHSZJBF.js → anthropicContentGenerator-WCBYB6JG.js} +337 -27
- package/chunks/{artifact-tool-RDN2W7ND.js → artifact-tool-TBOYEKTY.js} +2 -2
- package/chunks/{askUserQuestion-OZERWH5R.js → askUserQuestion-23Y5WZFJ.js} +2 -2
- package/chunks/{bridge-W7AZSRZQ.js → bridge-K3ZRPO4D.js} +42 -40
- package/chunks/{ca-6W3SK7OQ.js → ca-4OJN75WT.js} +46 -5
- package/chunks/{channel-management-service-5S7YCWX5.js → channel-management-service-IXJ2MZTS.js} +7 -7
- package/chunks/{channel-settings-store-JFVRSNER.js → channel-settings-store-PEAR3IME.js} +43 -41
- package/chunks/{channel-worker-group-OVWGYMZS.js → channel-worker-group-NDG4WOOZ.js} +8 -8
- package/chunks/{channel-worker-manager-H55GKOQA.js → channel-worker-manager-ZCW6UW34.js} +8 -8
- package/chunks/{channel-worker-supervisor-CABBXYHK.js → channel-worker-supervisor-ATGFTZRN.js} +4 -4
- package/chunks/{chunk-W3UKBMSI.js → chunk-22YFMJBW.js} +84 -8
- package/chunks/{chunk-6MPDY6ZG.js → chunk-24ER7UV4.js} +1 -1
- package/chunks/{chunk-QDK4F2N5.js → chunk-2DNKEBXY.js} +1 -1
- package/chunks/{chunk-D6MDRSZ6.js → chunk-2LZCLQIS.js} +22 -11
- package/chunks/{chunk-JYBU6YUE.js → chunk-2M5N3DHY.js} +1 -1
- package/chunks/{chunk-KR32NIAN.js → chunk-2MI7ZTRT.js} +10 -10
- package/chunks/{chunk-LHKCY7DY.js → chunk-2UISUFHQ.js} +3 -3
- package/chunks/{chunk-JXVC2PL3.js → chunk-33FNCQSY.js} +2 -2
- package/chunks/{chunk-NBD76HUW.js → chunk-3LGZEYOF.js} +2 -2
- package/chunks/{chunk-CO2U743O.js → chunk-3MWNROHB.js} +4 -4
- package/chunks/{chunk-E2BHWIDT.js → chunk-3RXUYQJI.js} +6 -2
- package/chunks/{chunk-E5Z2AVNV.js → chunk-3SH53ANB.js} +0 -11
- package/chunks/{chunk-LYI2PZDK.js → chunk-3XF4WT3B.js} +2 -2
- package/chunks/{chunk-N4ACHWNH.js → chunk-432XCUHF.js} +1 -1
- package/chunks/{chunk-FNDXMN7I.js → chunk-4AGGSHCH.js} +774 -205
- package/chunks/{chunk-DUNI4EBW.js → chunk-4K3RV3OA.js} +80 -50
- package/chunks/{chunk-L2E5GFAG.js → chunk-4LKVQFHM.js} +2 -2
- package/chunks/{chunk-YDLJGZHL.js → chunk-4NFY2S7N.js} +0 -33
- package/chunks/{chunk-JLZ3RBQG.js → chunk-5JPVOYWA.js} +144 -11
- package/chunks/{chunk-6TAASXWL.js → chunk-5VYFXHY2.js} +3 -3
- package/chunks/{chunk-EU5TBFJI.js → chunk-6NE5NTHJ.js} +2 -2
- package/chunks/{chunk-XQK4XXTN.js → chunk-6O5DVH27.js} +1 -1
- package/chunks/{chunk-2RFKHEXL.js → chunk-6PLDPT2C.js} +1 -1
- package/chunks/{chunk-3APUUXRF.js → chunk-A5YZ3FA2.js} +2 -1
- package/chunks/{chunk-SHN4KHDK.js → chunk-A6SX5TAH.js} +3 -3
- package/chunks/{chunk-SZ3KHTDR.js → chunk-AKA24BGO.js} +1 -1
- package/chunks/{chunk-Q3T5KA2V.js → chunk-BFHXDAR7.js} +1 -1
- package/chunks/{chunk-L55JWS76.js → chunk-BGXZBI5B.js} +1 -1
- package/chunks/{chunk-P5VC5USY.js → chunk-BKGA75MU.js} +1 -1
- package/chunks/{chunk-2KKCCLPT.js → chunk-BKXTHMOZ.js} +1 -1
- package/chunks/{chunk-V4XNUDPE.js → chunk-BSKUTHLO.js} +15 -7
- package/chunks/{chunk-MM7TH7ZM.js → chunk-CFDR3GNL.js} +18 -3
- package/chunks/{chunk-E2FN6SM7.js → chunk-CIUUYB23.js} +5 -5
- package/chunks/{chunk-A7Y5H4TX.js → chunk-D2GPKXCQ.js} +7 -7
- package/chunks/{chunk-JCJ7LKNA.js → chunk-DIEFUBV6.js} +1644 -1570
- package/chunks/{chunk-GL4JOZXU.js → chunk-DSGJLHM3.js} +4 -4
- package/chunks/{chunk-675H6PLP.js → chunk-DYA25Y7U.js} +1 -1
- package/chunks/{chunk-3I6DUGQD.js → chunk-E4WHKETF.js} +32 -4
- package/chunks/{chunk-CU47KXB5.js → chunk-EGYJRIDF.js} +6 -6
- package/chunks/{chunk-6CQWRWUC.js → chunk-EIMKVOSF.js} +3 -3
- package/chunks/{chunk-QTERJVPZ.js → chunk-EKTCKZV5.js} +1 -0
- package/chunks/{chunk-NHFEMWAZ.js → chunk-FF75UUB2.js} +1 -1
- package/chunks/{chunk-L32VV3ZJ.js → chunk-FG63DZQA.js} +12 -12
- package/chunks/{chunk-FCYYAB4S.js → chunk-FHPKHXHT.js} +3 -3
- package/chunks/{chunk-GJ2GBPBD.js → chunk-FXVHVCNA.js} +5 -5
- package/chunks/{chunk-56Z7QEAQ.js → chunk-GMSBXEH4.js} +16 -16
- package/chunks/chunk-GOFAQQZA.js +132 -0
- package/chunks/{chunk-YUFIEIWC.js → chunk-GTM6IHBB.js} +2 -2
- package/chunks/{chunk-HIVKI6O6.js → chunk-H35Q5CEG.js} +9 -7
- package/chunks/{chunk-FJ5WUMUQ.js → chunk-H36SETQS.js} +1 -1
- package/chunks/{chunk-AUOULH6Q.js → chunk-H6FIBBXK.js} +1610 -2196
- package/chunks/{chunk-VEMNQMHA.js → chunk-H6ZYP74A.js} +5 -13
- package/chunks/{chunk-TTJZAIFP.js → chunk-HEBW74ZW.js} +3 -3
- package/chunks/{chunk-6FMJLI5M.js → chunk-HFVW54NL.js} +41 -6
- package/chunks/{chunk-44F4LBWZ.js → chunk-HIXVWF7I.js} +56 -18
- package/chunks/{chunk-EQNUDTL6.js → chunk-HUIQ4FYC.js} +2 -2
- package/chunks/{chunk-5NNHICSA.js → chunk-I7JDGNG6.js} +3 -3
- package/chunks/{chunk-PVNQRENX.js → chunk-IF6K42YJ.js} +1 -1
- package/chunks/{chunk-PJOHNFIY.js → chunk-IWGTGH4G.js} +5 -5
- package/chunks/{chunk-B4AJNNOL.js → chunk-J26HHFI5.js} +1 -1
- package/chunks/{chunk-CNTR4GR6.js → chunk-JELIWHXD.js} +1 -1
- package/chunks/{chunk-V25K5ID7.js → chunk-K2J5JZ6B.js} +1 -1
- package/chunks/{chunk-IGTHU3T4.js → chunk-KKN2IE7Q.js} +1 -1
- package/chunks/{chunk-TZTAV5RH.js → chunk-KVUBYJDM.js} +2 -2
- package/chunks/{chunk-3F2WDAV6.js → chunk-KXWERR6P.js} +14 -14
- package/chunks/{chunk-JJPKFJBT.js → chunk-L7FTDKCD.js} +3 -3
- package/chunks/chunk-LBOVL47Y.js +29 -0
- package/chunks/{chunk-FS674JW4.js → chunk-LBWNSLJK.js} +3 -3
- package/chunks/{chunk-I5BT7ADR.js → chunk-LGT3YMLN.js} +4 -4
- package/chunks/{chunk-UV6KF7T3.js → chunk-LZV2BZPL.js} +3 -3
- package/chunks/{chunk-P755N4CS.js → chunk-M5LIY7Y6.js} +6 -6
- package/chunks/{chunk-YGE3IXJP.js → chunk-M744OFVE.js} +1 -1
- package/chunks/{chunk-NTDH4IML.js → chunk-MCXMWLFT.js} +7 -7
- package/chunks/chunk-MISUEWB4.js +8749 -0
- package/chunks/{chunk-TEGJSJDF.js → chunk-MOHAWIAW.js} +2 -2
- package/chunks/{chunk-KXDONCPU.js → chunk-MTR4JWQJ.js} +4 -4
- package/chunks/{chunk-RSVPYAGK.js → chunk-MUEJ4R3E.js} +5 -5
- package/chunks/{chunk-PCK4B6LR.js → chunk-N42C2FU3.js} +1 -1
- package/chunks/{chunk-WWCMSZII.js → chunk-NW57GHNL.js} +71 -7
- package/chunks/{chunk-PQNHRFJC.js → chunk-NYX53SV4.js} +0 -2
- package/chunks/{chunk-QARJNL2V.js → chunk-O2ZYHG33.js} +5 -4
- package/chunks/{chunk-V7RNNPGC.js → chunk-P5Y23G2L.js} +18 -1
- package/chunks/{chunk-GURGAJTX.js → chunk-PDDYAXL2.js} +4 -1
- package/chunks/chunk-PWCQRLM5.js +1170 -0
- package/chunks/{chunk-VMX5RZQH.js → chunk-Q3G5L5KF.js} +18 -9
- package/chunks/{chunk-DQ2O5QOJ.js → chunk-QDWLUXKP.js} +1 -1
- package/chunks/chunk-QL4TN4HS.js +59 -0
- package/chunks/{chunk-E6CJ2SMM.js → chunk-QMBEW7EW.js} +2 -2
- package/chunks/{chunk-U4VTUMMK.js → chunk-QONSRAEV.js} +1 -1
- package/chunks/{chunk-DEEABGH2.js → chunk-QPSYIV2O.js} +3320 -536
- package/chunks/{chunk-Q5WZTTWE.js → chunk-QWDVZH24.js} +6 -8
- package/chunks/{chunk-2LEOZTBT.js → chunk-QWW6I2UO.js} +111 -26
- package/chunks/{chunk-LOY7RWQG.js → chunk-QYPT3QUD.js} +3 -3
- package/chunks/{chunk-6PQPKTXP.js → chunk-R7XNRHYD.js} +1 -1
- package/chunks/{chunk-7SJN2IWT.js → chunk-RCXCGZG6.js} +5 -5
- package/chunks/{chunk-HX6RLYUO.js → chunk-RL6J3BPE.js} +4 -4
- package/chunks/{chunk-Z3S5EMOW.js → chunk-RPYYTL7E.js} +60 -12
- package/chunks/{chunk-MB32MS4U.js → chunk-RR224BUP.js} +215 -174
- package/chunks/{chunk-H6I4PGRV.js → chunk-SKSF3LGQ.js} +4 -4
- package/chunks/{chunk-77V3VIKL.js → chunk-SQ3YD5MI.js} +9 -9
- package/chunks/{chunk-CBBP4BMC.js → chunk-SRY26X4H.js} +72 -206
- package/chunks/{chunk-RDJOB6S3.js → chunk-TXABHVZD.js} +1 -1
- package/chunks/{chunk-R2XWGR75.js → chunk-TYERNYH4.js} +2 -2
- package/chunks/chunk-TZTBZ25J.js +222 -0
- package/chunks/{chunk-45IOTAUS.js → chunk-U25CMJYY.js} +1 -1
- package/chunks/{chunk-7ULQIS27.js → chunk-UEJESCS7.js} +1 -1
- package/chunks/{chunk-HC45LTEN.js → chunk-UH7Z7Y45.js} +1 -1
- package/chunks/{chunk-CPZAH673.js → chunk-UKZEXS6K.js} +2 -0
- package/chunks/{chunk-54YCNSK5.js → chunk-UQDFEU47.js} +4113 -10152
- package/chunks/{chunk-XP4L6KS3.js → chunk-URN76TKR.js} +2 -2
- package/chunks/{chunk-XUGZYLDH.js → chunk-UWSXFI6E.js} +1 -1
- package/chunks/{chunk-AOHY3QJ3.js → chunk-VA5NLVPT.js} +3 -3
- package/chunks/{chunk-PZEXDV3H.js → chunk-VUNRNRN6.js} +71 -43
- package/chunks/{chunk-FANRZEAJ.js → chunk-VWOVHOTT.js} +1 -1
- package/chunks/{chunk-QTHQ6Z5X.js → chunk-WK4TJUEA.js} +1 -1
- package/chunks/{chunk-ZPZ7ZJEE.js → chunk-WUC6ZFXO.js} +1 -1
- package/chunks/{chunk-7KAXXBER.js → chunk-WY2ENRDN.js} +3 -3
- package/chunks/{chunk-TIRRPCFS.js → chunk-X6QNZOTC.js} +1 -1
- package/chunks/{chunk-KWHKHSIS.js → chunk-X6WUYMOV.js} +8 -8
- package/chunks/{chunk-IIUGIWWY.js → chunk-XC2VAFVZ.js} +1 -1
- package/chunks/{chunk-D4HTUMGX.js → chunk-XC656O42.js} +3 -3
- package/chunks/{chunk-RG64CDT2.js → chunk-XMJO6C44.js} +131 -48
- package/chunks/{chunk-ZMOJ7ISP.js → chunk-XUMAD5IT.js} +1 -1
- package/chunks/{chunk-THVU3RNH.js → chunk-YAVY33G4.js} +1 -1
- package/chunks/{chunk-YANIWTRZ.js → chunk-YPUHMQXV.js} +1 -1
- package/chunks/{chunk-QCXGC7QB.js → chunk-YU6TBRTA.js} +3 -3
- package/chunks/{chunk-OFZKFPYG.js → chunk-YWMDTMAU.js} +3 -3
- package/chunks/{chunk-DSFHVTWD.js → chunk-YXEVDA66.js} +2 -2
- package/chunks/{chunk-JE2CEOBO.js → chunk-ZGSUFIL5.js} +4 -4
- package/chunks/{chunk-BBIQAX4V.js → chunk-ZJES4C3I.js} +30 -18
- package/chunks/{computer-use-5QWCFNKD.js → computer-use-UJMK6JQU.js} +36 -34
- package/chunks/{config-utils-WADIDWGG.js → config-utils-7COTJMWK.js} +4 -4
- package/chunks/{contextCommand-4Z7T7TUM.js → contextCommand-4YABGF4S.js} +40 -38
- package/chunks/{core-runtime-6N4EFC2Q.js → core-runtime-7M4VM3DA.js} +36 -34
- package/chunks/{create-sub-session-AEREHZBQ.js → create-sub-session-HOFDW4N7.js} +39 -37
- package/chunks/{create-sub-session-62YZWVAY.js → create-sub-session-J32WC64U.js} +2 -2
- package/chunks/{cron-create-6E7GIQTG.js → cron-create-HMFSHIAR.js} +4 -4
- package/chunks/{cron-delete-JD26XY3W.js → cron-delete-ZJFHOX57.js} +4 -4
- package/chunks/{cron-list-CUWFB44G.js → cron-list-ZEX2NBMN.js} +4 -4
- package/chunks/{daemon-PCNCI5YU.js → daemon-CCIX4BMG.js} +47 -6
- package/chunks/{daemon-status-provider-DDF7C5M7.js → daemon-status-provider-W2U5Q3J5.js} +47 -45
- package/chunks/{daemon-trust-policy-Q4KSOJTR.js → daemon-trust-policy-IFICWPXP.js} +42 -40
- package/chunks/{daemon-trust-policy-monitor-V6FTE3IY.js → daemon-trust-policy-monitor-GX7EO6FW.js} +42 -40
- package/chunks/{de-SY6O76BF.js → de-A6TI4LBB.js} +46 -5
- package/chunks/{deferred-core-runtime-GHJ5GQHK.js → deferred-core-runtime-U36OOOKE.js} +36 -34
- package/chunks/display-image-VS3TXYQH.js +184 -0
- package/chunks/{dist-ZHXOBXDN.js → dist-3BMEUGTG.js} +1 -1
- package/chunks/{dist-26BIMQT6.js → dist-4KAX7CCL.js} +289 -27
- package/chunks/{dist-OAOC5OV4.js → dist-7JGAAQSC.js} +2 -2
- package/chunks/{dist-SL2LUMML.js → dist-A7H2KKUC.js} +1 -1
- package/chunks/{dist-2PERFI23.js → dist-DPPHJAVL.js} +3 -3
- package/chunks/{dist-PVEAFLHY.js → dist-HVBMEYWK.js} +1 -1
- package/chunks/{dist-ULIG4M5H.js → dist-NEBRI7WO.js} +67 -15
- package/chunks/{dist-WGMNT3JQ.js → dist-SFQ34F4M.js} +24 -6
- package/chunks/{earlyInputCapture-TQXLLISD.js → earlyInputCapture-5ZWDH3SB.js} +37 -35
- package/chunks/{edit-FJEUV6KZ.js → edit-J7SW6UP6.js} +36 -34
- package/chunks/{en-NBK3JKCE.js → en-L4UQDLWW.js} +57 -6
- package/chunks/{enter-worktree-7GE3TZ4P.js → enter-worktree-NRLOHRB6.js} +36 -34
- package/chunks/{enterPlanMode-KR5TMPCJ.js → enterPlanMode-GDSTEFSM.js} +36 -34
- package/chunks/{environment-SWL3CMB3.js → environment-KHYEKG5W.js} +39 -37
- package/chunks/{errors-XQE7BGZV.js → errors-VNLAJV3O.js} +39 -37
- package/chunks/{exit-worktree-CHKTYNCV.js → exit-worktree-ARVID7DF.js} +36 -34
- package/chunks/{exitPlanMode-QYAG6LWX.js → exitPlanMode-4ZFY7KUH.js} +36 -34
- package/chunks/{fast-path-Z2K7W6DC.js → fast-path-KA65VREJ.js} +9 -5
- package/chunks/{fr-4KG5V7UT.js → fr-QF7RI5ZE.js} +46 -5
- package/chunks/{gemini-YU4XKEDG.js → gemini-5PMCNPF7.js} +149 -90
- package/chunks/{geminiContentGenerator-ZZX6NBO4.js → geminiContentGenerator-NFSYJ4HA.js} +6 -6
- package/chunks/{glob-VYF5CXSX.js → glob-F3EAUDAX.js} +36 -34
- package/chunks/{goal-tools-HGO6VXPB.js → goal-tools-SPQ5M6D3.js} +3 -3
- package/chunks/{grep-5DP5ZUTW.js → grep-UJMPVZER.js} +36 -34
- package/chunks/{handleAutoUpdate-UVBJ56DL.js → handleAutoUpdate-MG4FRZPN.js} +42 -40
- package/chunks/{i18n-UQNYHEUD.js → i18n-EVHV4ZF3.js} +38 -36
- package/chunks/{image-gen-WHPIZNWF.js → image-gen-UC7XVHI7.js} +9 -9
- package/chunks/{initializer-GMIICF4W.js → initializer-O5B6HUBI.js} +43 -41
- package/chunks/{installationInfo-4MGG4WVI.js → installationInfo-2LIKCNVX.js} +37 -35
- package/chunks/{ja-F3GSQXMF.js → ja-URQESVGW.js} +46 -5
- package/chunks/{keychain-token-storage-IKO4G53C.js → keychain-token-storage-7BT4TQ2A.js} +2 -2
- package/chunks/{kittyProtocolDetector-MBRTDRBK.js → kittyProtocolDetector-BFLAKYXH.js} +1 -1
- package/chunks/{list-CPN2W334.js → list-BPKIE3Z4.js} +45 -43
- package/chunks/{list-agents-PXJ7ZUFB.js → list-agents-TWEGRJWO.js} +2 -2
- package/chunks/{loadedSettingsAdapter-ZQAV5NDO.js → loadedSettingsAdapter-NGLFF4V4.js} +42 -40
- package/chunks/{loggingContentGenerator-5E7W4IEP.js → loggingContentGenerator-7TFESRG5.js} +52 -37
- package/chunks/{loop-wakeup-Y26NQZ5I.js → loop-wakeup-6LLEOQYV.js} +5 -5
- package/chunks/{ls-ONQTTMQR.js → ls-H5WX22VK.js} +4 -4
- package/chunks/{lsp-YGHHRGMD.js → lsp-G6FXYEIS.js} +2 -2
- package/chunks/{managed-npm-update-MKKAXYXA.js → managed-npm-update-CLZGGV7F.js} +39 -37
- package/chunks/{mcp-V5NTJF6X.js → mcp-X5OZOOXX.js} +42 -40
- package/chunks/{monitor-CO3ASY6E.js → monitor-TGSVSAZZ.js} +36 -34
- package/chunks/nonInteractiveCli-GUMJ5JLG.js +150 -0
- package/chunks/{notebook-edit-Z7AEE6FM.js → notebook-edit-EZISE7IC.js} +36 -34
- package/chunks/{openaiContentGenerator-CA3MQOP3.js → openaiContentGenerator-ZAKS5A6P.js} +18 -18
- package/chunks/{pidfile-NL7MKDRU.js → pidfile-PCMBX4LR.js} +37 -35
- package/chunks/{processUtils-PB5K2DYH.js → processUtils-2CSVE5BW.js} +2 -2
- package/chunks/{pt-EQ33KWEN.js → pt-EEEQXRUI.js} +46 -5
- package/chunks/{qwenContentGenerator-JYFNDCOS.js → qwenContentGenerator-S3H6PIC4.js} +42 -40
- package/chunks/{qwenOAuth2-W2ALKQDD.js → qwenOAuth2-MNU425VE.js} +8 -8
- package/chunks/{read-file-IEOR5H5W.js → read-file-HXJXHBI6.js} +10 -10
- package/chunks/{read-mcp-resource-U2IJN5HM.js → read-mcp-resource-DRZSI3HE.js} +2 -2
- package/chunks/{record-artifact-MGPJ7EG4.js → record-artifact-IPIRWMFY.js} +3 -3
- package/chunks/{resumeHistoryUtils-BNBTP5AS.js → resumeHistoryUtils-4QAMC2S6.js} +44 -42
- package/chunks/{ripGrep-UMQODKEB.js → ripGrep-MCETPF2E.js} +36 -34
- package/chunks/{ru-7OZAUKGG.js → ru-WGZDYQAB.js} +46 -5
- package/chunks/{run-qwen-serve-RN2R6QQW.js → run-qwen-serve-3NMODTXV.js} +219 -55
- package/chunks/{runtime-QFJ2MJF5.js → runtime-AQOV7DVP.js} +49 -45
- package/chunks/{scheduler-AMYUFOZI.js → scheduler-DN7SZ6ZE.js} +36 -34
- package/chunks/{sdk-exporters-http-4BQANSJ6.js → sdk-exporters-http-IKNWQJNV.js} +2 -2
- package/chunks/{sdk-impl-Z4VXWVFX.js → sdk-impl-7CUUMQDB.js} +2 -2
- package/chunks/{send-message-PMP4ATVM.js → send-message-HGCVVDTZ.js} +5 -4
- package/chunks/{serve-EIIYJVX3.js → serve-WZB45HVT.js} +42 -40
- package/chunks/{server-EP2LLAPD.js → server-GOTZFEEZ.js} +616 -387
- package/chunks/{session-GMPZBLOW.js → session-23LOFLWN.js} +149 -87
- package/chunks/{settings-LN7RNKBS.js → settings-LI2ORVXC.js} +41 -39
- package/chunks/{shell-EM2OWU5X.js → shell-GLC6OP3C.js} +36 -34
- package/chunks/{skill-T5VPSK73.js → skill-C7W6M4GO.js} +27 -14
- package/chunks/{skill-settings-GMR3GMNY.js → skill-settings-W25NCK5I.js} +41 -39
- package/chunks/{spawnChannel-YPCU62DI.js → spawnChannel-OHJLEBLD.js} +38 -36
- package/chunks/{standalone-update-JAKIM2NF.js → standalone-update-E4V5V7WT.js} +39 -37
- package/chunks/{startInteractiveUI-YETQWGYF.js → startInteractiveUI-FKILLW7Q.js} +1815 -1034
- package/chunks/{syntheticOutput-D7E6ZFKR.js → syntheticOutput-EYL7DWO7.js} +3 -3
- package/chunks/{task-create-NFCYD43L.js → task-create-CSCEG4SM.js} +10 -9
- package/chunks/{task-list-TAVMGEVD.js → task-list-6CVQPORX.js} +6 -6
- package/chunks/{task-stop-ZDF2UJRM.js → task-stop-Y5ZTFVRX.js} +2 -2
- package/chunks/{task-update-6L7LHGEX.js → task-update-C52LNFU5.js} +10 -9
- package/chunks/{team-create-LFJ6HGNY.js → team-create-HBIJ7NHT.js} +36 -34
- package/chunks/{team-delete-DPGGRQBU.js → team-delete-CE7DC53R.js} +6 -6
- package/chunks/{team-plan-approval-C2KLSDGO.js → team-plan-approval-IBJOKS4J.js} +36 -34
- package/chunks/terminal-image-renderer-BOQJPVLB.js +89 -0
- package/chunks/{theme-manager-JQ3ZGBP5.js → theme-manager-NSS7VLUD.js} +37 -35
- package/chunks/{todoWrite-2UO5G6G6.js → todoWrite-YKAA57W2.js} +107 -36
- package/chunks/{tool-search-FAZBFRJZ.js → tool-search-DEAS54VG.js} +13 -12
- package/chunks/{total-session-admission-5CALIVYO.js → total-session-admission-4LWTX3WD.js} +43 -41
- package/chunks/{trustedFolders-KOPSP44S.js → trustedFolders-NF3J2TA7.js} +38 -36
- package/chunks/{update-relaunch-6QL2TICS.js → update-relaunch-WUHRH5V3.js} +5 -5
- package/chunks/{updateCheck-4Q6RIKFW.js → updateCheck-7EG4BLBH.js} +41 -39
- package/chunks/{useAutoAcceptIndicator-Q5BMKZV3.js → useAutoAcceptIndicator-ZRV56GVP.js} +46 -44
- package/chunks/{validateNonInterActiveAuth-GKOC5F6Z.js → validateNonInterActiveAuth-WC2FPE3I.js} +86 -84
- package/chunks/{version-VSATY2LD.js → version-6SS7KCUP.js} +1 -1
- package/chunks/{web-fetch-JCLKL6NL.js → web-fetch-Y5QQMPKA.js} +13 -13
- package/chunks/{web-search-DSQTFUBX.js → web-search-QKKEU723.js} +8 -8
- package/chunks/{workflow-M6QAVKVJ.js → workflow-PWIU6Q2M.js} +418 -304
- package/chunks/{workspace-providers-status-YKLTLMJA.js → workspace-providers-status-B2DM6FNK.js} +45 -43
- package/chunks/{workspace-registration-store-5DMGKU64.js → workspace-registration-store-7Y33TTHJ.js} +2 -2
- package/chunks/{workspace-registry-PTYUSYXX.js → workspace-registry-TSNJKLPC.js} +43 -41
- package/chunks/{workspace-service-25ML3T47.js → workspace-service-4I2QHDX4.js} +50 -48
- package/chunks/{workspace-skills-status-YKZWOYRX.js → workspace-skills-status-HVXNWVGR.js} +44 -42
- package/chunks/{workspace-trust-reconciler-5FI2S3OS.js → workspace-trust-reconciler-RDBBGMWP.js} +49 -47
- package/chunks/{write-file-AY7VLP5X.js → write-file-RQ4DG5RY.js} +36 -34
- package/chunks/{zh-H3YDK5QW.js → zh-72XPUG5P.js} +54 -6
- package/chunks/{zh-TW-JYCP7XUA.js → zh-TW-LTB4SRH3.js} +54 -6
- package/chunks/{zoom-image-S4LJZMD5.js → zoom-image-O5YCB7WN.js} +10 -10
- package/cli.js +32 -48
- package/locales/ca.js +60 -4
- package/locales/de.js +62 -4
- package/locales/en.js +76 -6
- package/locales/fr.js +64 -4
- package/locales/ja.js +61 -4
- package/locales/pt.js +60 -4
- package/locales/ru.js +63 -4
- package/locales/zh-TW.js +67 -6
- package/locales/zh.js +67 -6
- package/package.json +3 -3
- package/web-shell/assets/{arc-xjArKHU2.js → arc-Bd7d781i.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-BgrQDNYG.js → architectureDiagram-3BPJPVTR-CpnOJqNE.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-CXxWC-1_.js → blockDiagram-GPEHLZMM-NxVTiWnk.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-Dx1tLm3v.js → c4Diagram-AAUBKEIU-BWT75l82.js} +1 -1
- package/web-shell/assets/channel-A434sWK5.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-CBxjogVR.js → chunk-2J33WTMH-Dzz03hk6.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-izb-rY5W.js → chunk-4BX2VUAB-DRF-egfm.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-NzLyvSb8.js → chunk-55IACEB6-Co15vq5x.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-DVyKb0dl.js → chunk-727SXJPM-DHSUk1J7.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-BtqL7NzB.js → chunk-AQP2D5EJ-Br8u_E2R.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-iNpdKIO0.js → chunk-FMBD7UC4-DXbPTnqF.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-DI7cbFmX.js → chunk-ND2GUHAM-BleQdi4d.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-3Y_-xFYs.js → chunk-QZHKN3VN-CqgBf-95.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-CwPuhldB.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CwPuhldB.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A--raRatZn.js → cose-bilkent-S5V4N54A-WS7b13Yg.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-B8SU70mO.js → dagre-BM42HDAG-v_55ki8o.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-ewgoakXo.js → diagram-2AECGRRQ-DaYAjbdK.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-Bm_JLTnS.js → diagram-5GNKFQAL-D_Hy-L64.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-DEIUjUy9.js → diagram-KO2AKTUF-dB06cZyD.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-C2Wmrpj-.js → diagram-LMA3HP47-DzSluD4F.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-CtYe6bFx.js → diagram-OG6HWLK6-Cvb6CeXQ.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-DfpHcWLV.js → erDiagram-TEJ5UH35-7eB2Hmov.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-CAiUhio5.js → flowDiagram-I6XJVG4X-B08iGCw_.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-CYc7ezr4.js → ganttDiagram-6RSMTGT7-BgsrCHq-.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-70lbkcRS.js → gitGraphDiagram-PVQCEYII-DQLurQ2i.js} +1 -1
- package/web-shell/assets/{index-Ww86nT9f.js → index-B_1Z0Mgr.js} +1 -1
- package/web-shell/assets/index-Bi1dP2mU.css +5 -0
- package/web-shell/assets/index-DJ-z1Oba.js +1756 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-C7e8DWPa.js → infoDiagram-5YYISTIA-DXZGO8qB.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-BYLr2op-.js → ishikawaDiagram-YF4QCWOH-g7gbuH2w.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-hEibAHKX.js → journeyDiagram-JHISSGLW-euefICGn.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-F2rt8Uhp.js → kanban-definition-UN3LZRKU-Dws8-mjG.js} +1 -1
- package/web-shell/assets/{linear-DPhyNezd.js → linear-C63F0tyh.js} +1 -1
- package/web-shell/assets/{mermaid.core-ZUtnug0n.js → mermaid.core-fLrhp_4-.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-DDWcMoi8.js → mindmap-definition-RKZ34NQL-qRkydfT-.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-CTRKzw1_.js → pieDiagram-4H26LBE5-BZ0wQaKN.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-CAEwYG_z.js → quadrantDiagram-W4KKPZXB-Fjq6GbSZ.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-CRjnH9D9.js → requirementDiagram-4Y6WPE33-CqWvjLHU.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-LPQT_sOd.js → sankeyDiagram-5OEKKPKP-VcXX6PVZ.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-Ht2Iqvb0.js → sequenceDiagram-3UESZ5HK-BJSRtxFr.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-CIUdqOXu.js → stateDiagram-AJRCARHV-Dt9zUwmZ.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-CCxQt56w.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-BcilneZF.js → timeline-definition-PNZ67QCA-DQwlNRws.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-BljwiiH1.js → vennDiagram-CIIHVFJN-DwxjUEtQ.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-DeKjkYjq.js → wardley-L42UT6IY-D3QdMSpJ.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-L3U1H7KG.js → wardleyDiagram-YWT4CUSO-BddN8oK8.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-IJnWsgMT.js → xychartDiagram-2RQKCTM6-BUNuBrRJ.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/chunk-4KP2F2TE.js +0 -82
- package/chunks/chunk-HGT6JR3U.js +0 -177
- package/chunks/nonInteractiveCli-ZJYEOO7U.js +0 -148
- package/web-shell/assets/channel-B1cyk94G.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-BpBYZoRE.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-BpBYZoRE.js +0 -1
- package/web-shell/assets/index-C1k3PDuU.css +0 -5
- package/web-shell/assets/index-DZLIXILO.js +0 -1750
- package/web-shell/assets/insert-DmRbh9Rv.svg +0 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BmqqQZ6w.js +0 -1
package/chunks/{anthropicContentGenerator-OFHSZJBF.js → anthropicContentGenerator-WCBYB6JG.js}
RENAMED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-DGEIYUC3.js";
|
|
10
10
|
import {
|
|
11
11
|
RequestTokenizer
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-H36SETQS.js";
|
|
13
13
|
import "./chunk-MPHPFVKK.js";
|
|
14
14
|
import {
|
|
15
15
|
resolveRequestTimeout
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
convertSchema,
|
|
28
28
|
safeJsonParse,
|
|
29
29
|
setGenAiUsageProvenance
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-WK4TJUEA.js";
|
|
31
31
|
import {
|
|
32
32
|
runtimeDiagnostics,
|
|
33
33
|
setToolCallPreparations
|
|
@@ -37,8 +37,8 @@ import {
|
|
|
37
37
|
reportAnthropicFollowingRequest,
|
|
38
38
|
reportAnthropicRequest,
|
|
39
39
|
reportAnthropicResponse
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import "./chunk-
|
|
40
|
+
} from "./chunk-URN76TKR.js";
|
|
41
|
+
import "./chunk-2DNKEBXY.js";
|
|
42
42
|
import "./chunk-5WV5S2GT.js";
|
|
43
43
|
import "./chunk-XWRJCPHC.js";
|
|
44
44
|
import {
|
|
@@ -54,10 +54,10 @@ import {
|
|
|
54
54
|
import {
|
|
55
55
|
buildRuntimeFetchOptions,
|
|
56
56
|
redactProxyError
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-BFHXDAR7.js";
|
|
58
58
|
import {
|
|
59
59
|
createDebugLogger
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-3RXUYQJI.js";
|
|
61
61
|
import {
|
|
62
62
|
require_ms
|
|
63
63
|
} from "./chunk-YQ3U5MUC.js";
|
|
@@ -4250,11 +4250,21 @@ var AnthropicContentConverter = class {
|
|
|
4250
4250
|
}
|
|
4251
4251
|
schemaCompliance;
|
|
4252
4252
|
enableCacheControl;
|
|
4253
|
+
/**
|
|
4254
|
+
* Per-request tool ID sanitization state (see {@link resolveToolUseId}).
|
|
4255
|
+
* The converter instance is long-lived across requests (constructed once
|
|
4256
|
+
* per generator), so this state is reset at the top of every
|
|
4257
|
+
* `convertGeminiRequestToAnthropic` call rather than at construction.
|
|
4258
|
+
*/
|
|
4259
|
+
toolIdMap = /* @__PURE__ */ new Map();
|
|
4260
|
+
usedToolIds = /* @__PURE__ */ new Set();
|
|
4261
|
+
generatedToolIdCounter = 0;
|
|
4253
4262
|
constructor(_model, schemaCompliance = "auto", enableCacheControl = true) {
|
|
4254
4263
|
this.schemaCompliance = schemaCompliance;
|
|
4255
4264
|
this.enableCacheControl = enableCacheControl;
|
|
4256
4265
|
}
|
|
4257
4266
|
convertGeminiRequestToAnthropic(request, options = {}) {
|
|
4267
|
+
this.resetToolIdState();
|
|
4258
4268
|
let messages = [];
|
|
4259
4269
|
const systemText = this.extractTextFromContentUnion(
|
|
4260
4270
|
request.config?.systemInstruction
|
|
@@ -4275,19 +4285,39 @@ var AnthropicContentConverter = class {
|
|
|
4275
4285
|
if (options.dropUnsignedAssistantThinking) {
|
|
4276
4286
|
messages = this.dropUnsignedThinkingFromAssistantMessages(messages);
|
|
4277
4287
|
}
|
|
4288
|
+
if (!options.injectThinkingOnToolUseTurns) {
|
|
4289
|
+
messages = dropEmptyTextThinkingBlocks(messages);
|
|
4290
|
+
}
|
|
4278
4291
|
if (options.stripAssistantThinking) {
|
|
4279
4292
|
this.stripThinkingFromAssistantMessages(messages);
|
|
4280
4293
|
}
|
|
4281
4294
|
messages = mergeConsecutiveUserMessages(messages);
|
|
4295
|
+
if (options.stripTrailingAssistantPrefill) {
|
|
4296
|
+
this.stripTrailingAssistantPrefill(messages);
|
|
4297
|
+
}
|
|
4282
4298
|
const enableCacheControl = options.enableCacheControl ?? this.enableCacheControl;
|
|
4283
4299
|
const useGlobalCacheScope = options.useGlobalCacheScope ?? false;
|
|
4300
|
+
const cacheRetention = options.cacheRetention ?? "ephemeral";
|
|
4301
|
+
const cacheRetentionByBlock = options.cacheRetentionByBlock ?? {};
|
|
4284
4302
|
const system = enableCacheControl ? this.buildSystemWithCacheControl(
|
|
4285
4303
|
systemText,
|
|
4286
4304
|
useGlobalCacheScope,
|
|
4287
|
-
options.staticSystemPrefix
|
|
4305
|
+
options.staticSystemPrefix,
|
|
4306
|
+
this.resolveCacheRetention(
|
|
4307
|
+
"system",
|
|
4308
|
+
cacheRetention,
|
|
4309
|
+
cacheRetentionByBlock
|
|
4310
|
+
)
|
|
4288
4311
|
) : systemText;
|
|
4289
4312
|
if (enableCacheControl) {
|
|
4290
|
-
this.addCacheControlToMessages(
|
|
4313
|
+
this.addCacheControlToMessages(
|
|
4314
|
+
messages,
|
|
4315
|
+
this.resolveCacheRetention(
|
|
4316
|
+
"user.last",
|
|
4317
|
+
cacheRetention,
|
|
4318
|
+
cacheRetentionByBlock
|
|
4319
|
+
)
|
|
4320
|
+
);
|
|
4291
4321
|
}
|
|
4292
4322
|
return {
|
|
4293
4323
|
system,
|
|
@@ -4334,9 +4364,18 @@ var AnthropicContentConverter = class {
|
|
|
4334
4364
|
const useGlobalCacheScope = options.useGlobalCacheScope ?? false;
|
|
4335
4365
|
if (enableCacheControl && tools.length > 0) {
|
|
4336
4366
|
const lastToolIndex = tools.length - 1;
|
|
4367
|
+
const resolvedRetention = this.resolveCacheRetention(
|
|
4368
|
+
"tool",
|
|
4369
|
+
options.cacheRetention ?? "ephemeral",
|
|
4370
|
+
options.cacheRetentionByBlock ?? {}
|
|
4371
|
+
);
|
|
4337
4372
|
tools[lastToolIndex] = {
|
|
4338
4373
|
...tools[lastToolIndex],
|
|
4339
|
-
cache_control:
|
|
4374
|
+
cache_control: {
|
|
4375
|
+
type: "ephemeral",
|
|
4376
|
+
...useGlobalCacheScope ? { scope: "global" } : {},
|
|
4377
|
+
...resolvedRetention === "1h" ? { ttl: "1h" } : {}
|
|
4378
|
+
}
|
|
4340
4379
|
};
|
|
4341
4380
|
}
|
|
4342
4381
|
return tools;
|
|
@@ -4427,7 +4466,6 @@ var AnthropicContentConverter = class {
|
|
|
4427
4466
|
const parts = content.parts || [];
|
|
4428
4467
|
const role = content.role === "model" ? "assistant" : "user";
|
|
4429
4468
|
const contentBlocks = [];
|
|
4430
|
-
let toolCallIndex = 0;
|
|
4431
4469
|
for (const part of parts) {
|
|
4432
4470
|
if (typeof part === "string") {
|
|
4433
4471
|
contentBlocks.push({ type: "text", text: part });
|
|
@@ -4456,11 +4494,10 @@ var AnthropicContentConverter = class {
|
|
|
4456
4494
|
if (role === "assistant") {
|
|
4457
4495
|
contentBlocks.push({
|
|
4458
4496
|
type: "tool_use",
|
|
4459
|
-
id: part.functionCall.id
|
|
4497
|
+
id: this.resolveToolUseId(part.functionCall.id),
|
|
4460
4498
|
name: normalizeMcpToolName(part.functionCall.name || ""),
|
|
4461
4499
|
input: part.functionCall.args || {}
|
|
4462
4500
|
});
|
|
4463
|
-
toolCallIndex += 1;
|
|
4464
4501
|
}
|
|
4465
4502
|
}
|
|
4466
4503
|
if (part.functionResponse) {
|
|
@@ -4473,6 +4510,13 @@ var AnthropicContentConverter = class {
|
|
|
4473
4510
|
}
|
|
4474
4511
|
}
|
|
4475
4512
|
if (contentBlocks.length > 0) {
|
|
4513
|
+
if (role === "user" && contentBlocks.some((b) => b.type === "tool_result")) {
|
|
4514
|
+
contentBlocks.sort((a, b) => {
|
|
4515
|
+
if (a.type === "tool_result" && b.type !== "tool_result") return -1;
|
|
4516
|
+
if (a.type !== "tool_result" && b.type === "tool_result") return 1;
|
|
4517
|
+
return 0;
|
|
4518
|
+
});
|
|
4519
|
+
}
|
|
4476
4520
|
messages.push({ role, content: contentBlocks });
|
|
4477
4521
|
}
|
|
4478
4522
|
}
|
|
@@ -4498,11 +4542,68 @@ var AnthropicContentConverter = class {
|
|
|
4498
4542
|
}
|
|
4499
4543
|
return {
|
|
4500
4544
|
type: "tool_result",
|
|
4501
|
-
tool_use_id: response.id
|
|
4545
|
+
tool_use_id: this.resolveToolUseId(response.id),
|
|
4502
4546
|
content,
|
|
4503
4547
|
...response.response && Object.prototype.hasOwnProperty.call(response.response, "error") ? { is_error: true } : {}
|
|
4504
4548
|
};
|
|
4505
4549
|
}
|
|
4550
|
+
resetToolIdState() {
|
|
4551
|
+
this.toolIdMap.clear();
|
|
4552
|
+
this.usedToolIds.clear();
|
|
4553
|
+
this.generatedToolIdCounter = 0;
|
|
4554
|
+
}
|
|
4555
|
+
/**
|
|
4556
|
+
* Resolve a `functionCall.id` / `functionResponse.id` into a wire-safe
|
|
4557
|
+
* `tool_use.id` / `tool_result.tool_use_id`. Anthropic validates both
|
|
4558
|
+
* fields against `^[a-zA-Z0-9_-]+$` server-side (HTTP 400 otherwise) and
|
|
4559
|
+
* rejects the empty string the same way, since `+` requires at least one
|
|
4560
|
+
* character. The Gemini lingua-franca's `id` field has no such
|
|
4561
|
+
* constraint -- it can carry another provider's ID scheme, a
|
|
4562
|
+
* composite/namespaced ID, or be entirely absent.
|
|
4563
|
+
*
|
|
4564
|
+
* The same source ID always resolves to the same wire ID within a
|
|
4565
|
+
* request (memoized in `toolIdMap`), so a `tool_use`/`tool_result` pair
|
|
4566
|
+
* that shares a source ID still links up correctly after sanitization.
|
|
4567
|
+
* State is scoped to a single `convertGeminiRequestToAnthropic` call
|
|
4568
|
+
* (reset via {@link resetToolIdState}), since the converter instance
|
|
4569
|
+
* itself is long-lived across requests.
|
|
4570
|
+
*/
|
|
4571
|
+
resolveToolUseId(rawId) {
|
|
4572
|
+
const sourceId = typeof rawId === "string" ? rawId.trim() : "";
|
|
4573
|
+
const existingId = sourceId ? this.toolIdMap.get(sourceId) : void 0;
|
|
4574
|
+
if (existingId) {
|
|
4575
|
+
return existingId;
|
|
4576
|
+
}
|
|
4577
|
+
const baseId = sourceId ? this.sanitizeToolUseId(sourceId) : this.nextGeneratedToolId();
|
|
4578
|
+
const uniqueId = this.makeUniqueToolUseId(baseId);
|
|
4579
|
+
if (sourceId) {
|
|
4580
|
+
this.toolIdMap.set(sourceId, uniqueId);
|
|
4581
|
+
}
|
|
4582
|
+
return uniqueId;
|
|
4583
|
+
}
|
|
4584
|
+
sanitizeToolUseId(id) {
|
|
4585
|
+
const cleaned = id.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
4586
|
+
return cleaned || this.nextGeneratedToolId();
|
|
4587
|
+
}
|
|
4588
|
+
nextGeneratedToolId() {
|
|
4589
|
+
const id = `tool_${this.generatedToolIdCounter}`;
|
|
4590
|
+
this.generatedToolIdCounter += 1;
|
|
4591
|
+
return id;
|
|
4592
|
+
}
|
|
4593
|
+
makeUniqueToolUseId(baseId) {
|
|
4594
|
+
if (!this.usedToolIds.has(baseId)) {
|
|
4595
|
+
this.usedToolIds.add(baseId);
|
|
4596
|
+
return baseId;
|
|
4597
|
+
}
|
|
4598
|
+
let suffix = 1;
|
|
4599
|
+
let candidate = `${baseId}_${suffix}`;
|
|
4600
|
+
while (this.usedToolIds.has(candidate)) {
|
|
4601
|
+
suffix += 1;
|
|
4602
|
+
candidate = `${baseId}_${suffix}`;
|
|
4603
|
+
}
|
|
4604
|
+
this.usedToolIds.add(candidate);
|
|
4605
|
+
return candidate;
|
|
4606
|
+
}
|
|
4506
4607
|
createMediaBlockFromPart(part) {
|
|
4507
4608
|
if (part.inlineData?.mimeType && part.inlineData?.data) {
|
|
4508
4609
|
if (this.isSupportedAnthropicImageMimeType(part.inlineData.mimeType)) {
|
|
@@ -4629,6 +4730,44 @@ var AnthropicContentConverter = class {
|
|
|
4629
4730
|
isContentObject(content) {
|
|
4630
4731
|
return typeof content === "object" && content !== null && "role" in content && "parts" in content && Array.isArray(content["parts"]);
|
|
4631
4732
|
}
|
|
4733
|
+
/**
|
|
4734
|
+
* Resolve the effective {@link CacheRetention} for one cache anchor,
|
|
4735
|
+
* normalized so retention is monotonically non-increasing in wire order.
|
|
4736
|
+
*
|
|
4737
|
+
* Render order is `tools` -> `system` -> `messages`, so this converter's
|
|
4738
|
+
* three anchors sit on the wire in exactly that order: `tool` -> `system`
|
|
4739
|
+
* -> `user.last`. Anthropic requires "cache entries with longer TTL must
|
|
4740
|
+
* appear before shorter TTLs" — an anchor at the spec's 5-minute default
|
|
4741
|
+
* (no `ttl`) is a short-TTL entry for this rule's purposes, so a raw
|
|
4742
|
+
* per-anchor override like `cacheRetentionByBlock: { system: '1h' }`
|
|
4743
|
+
* would otherwise leave the (still 5m-default) `tool` anchor ahead of a
|
|
4744
|
+
* 1h `system` anchor on the wire — an ordering violation Anthropic 400s
|
|
4745
|
+
* on.
|
|
4746
|
+
*
|
|
4747
|
+
* Resolving with a scan instead of a straight per-anchor lookup avoids
|
|
4748
|
+
* that: `anchor` resolves to `'1h'` if `anchor` itself OR any anchor
|
|
4749
|
+
* later on the wire resolves to `'1h'`. That makes every
|
|
4750
|
+
* `cacheRetentionByBlock` configuration legal — anchors before a `'1h'`
|
|
4751
|
+
* anchor are promoted to `'1h'` too — without adding a new error surface
|
|
4752
|
+
* or rejecting any input. `{ tool: '1h' }` alone is unaffected (nothing
|
|
4753
|
+
* follows it that needs promoting); `{ system: '1h' }` alone now also
|
|
4754
|
+
* promotes `tool` to `'1h'`, which is exactly the "cache my big system
|
|
4755
|
+
* prompt for an hour" usage the per-anchor override exists for.
|
|
4756
|
+
*/
|
|
4757
|
+
resolveCacheRetention(anchor, cacheRetention, cacheRetentionByBlock) {
|
|
4758
|
+
const wireOrder = [
|
|
4759
|
+
"tool",
|
|
4760
|
+
"system",
|
|
4761
|
+
"user.last"
|
|
4762
|
+
];
|
|
4763
|
+
const anchorIndex = wireOrder.indexOf(anchor);
|
|
4764
|
+
for (let i = wireOrder.length - 1; i >= anchorIndex; i--) {
|
|
4765
|
+
if ((cacheRetentionByBlock[wireOrder[i]] ?? cacheRetention) === "1h") {
|
|
4766
|
+
return "1h";
|
|
4767
|
+
}
|
|
4768
|
+
}
|
|
4769
|
+
return "ephemeral";
|
|
4770
|
+
}
|
|
4632
4771
|
/**
|
|
4633
4772
|
* Build system content blocks with cache_control.
|
|
4634
4773
|
* Anthropic prompt caching requires cache_control on system content.
|
|
@@ -4654,11 +4793,15 @@ var AnthropicContentConverter = class {
|
|
|
4654
4793
|
* The split only shapes the outgoing request; stored history and
|
|
4655
4794
|
* non-Anthropic transports keep seeing a single system string.
|
|
4656
4795
|
*/
|
|
4657
|
-
buildSystemWithCacheControl(systemText, useGlobalCacheScope, staticSystemPrefix) {
|
|
4796
|
+
buildSystemWithCacheControl(systemText, useGlobalCacheScope, staticSystemPrefix, cacheRetention = "ephemeral") {
|
|
4658
4797
|
if (!systemText) {
|
|
4659
4798
|
return systemText;
|
|
4660
4799
|
}
|
|
4661
|
-
const scopedCacheControl =
|
|
4800
|
+
const scopedCacheControl = {
|
|
4801
|
+
type: "ephemeral",
|
|
4802
|
+
...useGlobalCacheScope ? { scope: "global" } : {},
|
|
4803
|
+
...cacheRetention === "1h" ? { ttl: "1h" } : {}
|
|
4804
|
+
};
|
|
4662
4805
|
if (staticSystemPrefix && systemText.length > staticSystemPrefix.length && systemText.startsWith(staticSystemPrefix)) {
|
|
4663
4806
|
return [
|
|
4664
4807
|
{
|
|
@@ -4669,7 +4812,16 @@ var AnthropicContentConverter = class {
|
|
|
4669
4812
|
{
|
|
4670
4813
|
type: "text",
|
|
4671
4814
|
text: systemText.slice(staticSystemPrefix.length),
|
|
4672
|
-
|
|
4815
|
+
// Deliberately never carries `scope: 'global'` (see class doc
|
|
4816
|
+
// above — the suffix varies per session, cross-session reuse
|
|
4817
|
+
// has ~zero hit rate). `cacheRetention` still applies: the
|
|
4818
|
+
// suffix is cached within a session, and a caller that asked
|
|
4819
|
+
// for the 1h tier benefits from it surviving longer gaps
|
|
4820
|
+
// between turns even on this volatile block.
|
|
4821
|
+
cache_control: {
|
|
4822
|
+
type: "ephemeral",
|
|
4823
|
+
...cacheRetention === "1h" ? { ttl: "1h" } : {}
|
|
4824
|
+
}
|
|
4673
4825
|
}
|
|
4674
4826
|
];
|
|
4675
4827
|
}
|
|
@@ -4831,6 +4983,43 @@ var AnthropicContentConverter = class {
|
|
|
4831
4983
|
message.content = [emptyThinking, ...blocks];
|
|
4832
4984
|
}
|
|
4833
4985
|
}
|
|
4986
|
+
/**
|
|
4987
|
+
* Strip a trailing empty-content assistant message, or append a
|
|
4988
|
+
* synthetic user turn to satisfy Anthropic's "must end with a user
|
|
4989
|
+
* message" requirement (Opus/Sonnet 4.6+, every 5.x family) when the
|
|
4990
|
+
* conversation would otherwise end on a non-empty assistant message.
|
|
4991
|
+
* See {@link ConvertGeminiRequestToAnthropicOptions.stripTrailingAssistantPrefill}.
|
|
4992
|
+
*/
|
|
4993
|
+
stripTrailingAssistantPrefill(messages) {
|
|
4994
|
+
while (messages.length > 0) {
|
|
4995
|
+
const last = messages[messages.length - 1];
|
|
4996
|
+
if (last.role !== "assistant") return;
|
|
4997
|
+
if (!this.isEmptyAssistantMessage(last)) break;
|
|
4998
|
+
messages.pop();
|
|
4999
|
+
}
|
|
5000
|
+
if (messages.length > 0 && messages[messages.length - 1].role === "assistant") {
|
|
5001
|
+
messages.push({
|
|
5002
|
+
role: "user",
|
|
5003
|
+
content: [{ type: "text", text: "Continue." }]
|
|
5004
|
+
});
|
|
5005
|
+
}
|
|
5006
|
+
}
|
|
5007
|
+
isEmptyAssistantMessage(message) {
|
|
5008
|
+
const content = message.content;
|
|
5009
|
+
if (!content) return true;
|
|
5010
|
+
if (typeof content === "string") return content.trim().length === 0;
|
|
5011
|
+
if (!Array.isArray(content) || content.length === 0) return true;
|
|
5012
|
+
for (const block of content) {
|
|
5013
|
+
const type = block.type;
|
|
5014
|
+
if (type === "text") {
|
|
5015
|
+
const text = block.text;
|
|
5016
|
+
if (typeof text === "string" && text.trim().length > 0) return false;
|
|
5017
|
+
} else {
|
|
5018
|
+
return false;
|
|
5019
|
+
}
|
|
5020
|
+
}
|
|
5021
|
+
return true;
|
|
5022
|
+
}
|
|
4834
5023
|
/**
|
|
4835
5024
|
* Add cache_control to the last user message's content.
|
|
4836
5025
|
* This enables prompt caching for the conversation context.
|
|
@@ -4843,7 +5032,7 @@ var AnthropicContentConverter = class {
|
|
|
4843
5032
|
* system prefix and tool prefixes (which DO repeat across sessions) carry
|
|
4844
5033
|
* `scope: 'global'` instead.
|
|
4845
5034
|
*/
|
|
4846
|
-
addCacheControlToMessages(messages) {
|
|
5035
|
+
addCacheControlToMessages(messages, cacheRetention = "ephemeral") {
|
|
4847
5036
|
for (let i = messages.length - 1; i >= 0; i--) {
|
|
4848
5037
|
const msg = messages[i];
|
|
4849
5038
|
if (msg.role === "user") {
|
|
@@ -4855,7 +5044,8 @@ var AnthropicContentConverter = class {
|
|
|
4855
5044
|
const isEmptyText = type === "text" && (!("text" in lastContent) || !lastContent.text);
|
|
4856
5045
|
if ((type === "text" || type === "tool_result") && !isEmptyText) {
|
|
4857
5046
|
lastContent.cache_control = {
|
|
4858
|
-
type: "ephemeral"
|
|
5047
|
+
type: "ephemeral",
|
|
5048
|
+
...cacheRetention === "1h" ? { ttl: "1h" } : {}
|
|
4859
5049
|
};
|
|
4860
5050
|
}
|
|
4861
5051
|
}
|
|
@@ -4904,6 +5094,16 @@ function mergeConsecutiveAssistantMessages(messages) {
|
|
|
4904
5094
|
return merged;
|
|
4905
5095
|
}
|
|
4906
5096
|
__name(mergeConsecutiveAssistantMessages, "mergeConsecutiveAssistantMessages");
|
|
5097
|
+
function makeToolResultDeduper() {
|
|
5098
|
+
const seen = /* @__PURE__ */ new Set();
|
|
5099
|
+
return (id) => {
|
|
5100
|
+
if (!id) return true;
|
|
5101
|
+
if (seen.has(id)) return false;
|
|
5102
|
+
seen.add(id);
|
|
5103
|
+
return true;
|
|
5104
|
+
};
|
|
5105
|
+
}
|
|
5106
|
+
__name(makeToolResultDeduper, "makeToolResultDeduper");
|
|
4907
5107
|
function cleanOrphanedToolCalls(messages) {
|
|
4908
5108
|
const validToolUseBlocks = /* @__PURE__ */ new WeakSet();
|
|
4909
5109
|
const validToolResultBlocks = /* @__PURE__ */ new WeakSet();
|
|
@@ -4921,6 +5121,12 @@ function cleanOrphanedToolCalls(messages) {
|
|
|
4921
5121
|
}
|
|
4922
5122
|
}
|
|
4923
5123
|
if (toolUseBlocks.size === 0) continue;
|
|
5124
|
+
if (i === messages.length - 1) {
|
|
5125
|
+
for (const block of toolUseBlocks.values()) {
|
|
5126
|
+
validToolUseBlocks.add(block);
|
|
5127
|
+
}
|
|
5128
|
+
continue;
|
|
5129
|
+
}
|
|
4924
5130
|
for (let j = i + 1; j < messages.length; j++) {
|
|
4925
5131
|
const nextMessage = messages[j];
|
|
4926
5132
|
if (!nextMessage || nextMessage.role !== "user" || !Array.isArray(nextMessage.content)) {
|
|
@@ -4958,20 +5164,33 @@ function cleanOrphanedToolCalls(messages) {
|
|
|
4958
5164
|
cleaned.push(message);
|
|
4959
5165
|
continue;
|
|
4960
5166
|
}
|
|
5167
|
+
let toolUseRemoved = false;
|
|
5168
|
+
const keepToolResult = makeToolResultDeduper();
|
|
4961
5169
|
const filtered = blocks.filter((b) => {
|
|
4962
5170
|
const t = b.type;
|
|
4963
5171
|
if (t === "tool_use") {
|
|
4964
5172
|
const id = b.id;
|
|
4965
|
-
|
|
5173
|
+
const keep = !id || validToolUseBlocks.has(b);
|
|
5174
|
+
if (!keep) toolUseRemoved = true;
|
|
5175
|
+
return keep;
|
|
4966
5176
|
}
|
|
4967
5177
|
if (t === "tool_result") {
|
|
4968
5178
|
const id = b.tool_use_id;
|
|
4969
|
-
|
|
5179
|
+
if (!id) return true;
|
|
5180
|
+
if (!validToolResultBlocks.has(b)) return false;
|
|
5181
|
+
return keepToolResult(id);
|
|
4970
5182
|
}
|
|
4971
5183
|
return true;
|
|
4972
5184
|
});
|
|
4973
|
-
|
|
4974
|
-
|
|
5185
|
+
const survivingToolUse = filtered.some(
|
|
5186
|
+
(b) => b.type === "tool_use"
|
|
5187
|
+
);
|
|
5188
|
+
const finalBlocks = toolUseRemoved && !survivingToolUse && message.role === "assistant" ? filtered.filter((b) => {
|
|
5189
|
+
const t = b.type;
|
|
5190
|
+
return t !== "thinking" && t !== "redacted_thinking";
|
|
5191
|
+
}) : filtered;
|
|
5192
|
+
if (finalBlocks.length > 0) {
|
|
5193
|
+
cleaned.push({ ...message, content: finalBlocks });
|
|
4975
5194
|
} else {
|
|
4976
5195
|
debugLogger.debug(
|
|
4977
5196
|
"cleanOrphanedToolCalls: dropping message with only orphaned tool blocks"
|
|
@@ -4981,6 +5200,38 @@ function cleanOrphanedToolCalls(messages) {
|
|
|
4981
5200
|
return cleaned;
|
|
4982
5201
|
}
|
|
4983
5202
|
__name(cleanOrphanedToolCalls, "cleanOrphanedToolCalls");
|
|
5203
|
+
function dropEmptyTextThinkingBlocks(messages) {
|
|
5204
|
+
let latestAssistantIdx = -1;
|
|
5205
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
5206
|
+
if (messages[i].role === "assistant") {
|
|
5207
|
+
latestAssistantIdx = i;
|
|
5208
|
+
break;
|
|
5209
|
+
}
|
|
5210
|
+
}
|
|
5211
|
+
const out = [];
|
|
5212
|
+
for (let i = 0; i < messages.length; i++) {
|
|
5213
|
+
const msg = messages[i];
|
|
5214
|
+
if (msg.role !== "assistant" || !Array.isArray(msg.content)) {
|
|
5215
|
+
out.push(msg);
|
|
5216
|
+
continue;
|
|
5217
|
+
}
|
|
5218
|
+
if (i === latestAssistantIdx) {
|
|
5219
|
+
out.push(msg);
|
|
5220
|
+
continue;
|
|
5221
|
+
}
|
|
5222
|
+
const blocks = msg.content;
|
|
5223
|
+
const filtered = blocks.filter((raw) => {
|
|
5224
|
+
const bType = raw.type;
|
|
5225
|
+
const bThinkingRaw = raw.thinking;
|
|
5226
|
+
const bThinking = typeof bThinkingRaw === "string" ? bThinkingRaw : void 0;
|
|
5227
|
+
return !(bType === "thinking" && (bThinking === void 0 || bThinking.length === 0));
|
|
5228
|
+
});
|
|
5229
|
+
if (filtered.length === 0) continue;
|
|
5230
|
+
out.push({ role: msg.role, content: filtered });
|
|
5231
|
+
}
|
|
5232
|
+
return out;
|
|
5233
|
+
}
|
|
5234
|
+
__name(dropEmptyTextThinkingBlocks, "dropEmptyTextThinkingBlocks");
|
|
4984
5235
|
function mergeConsecutiveUserMessages(messages) {
|
|
4985
5236
|
const merged = [];
|
|
4986
5237
|
for (const message of messages) {
|
|
@@ -4990,10 +5241,14 @@ function mergeConsecutiveUserMessages(messages) {
|
|
|
4990
5241
|
...lastMessage.content,
|
|
4991
5242
|
...message.content
|
|
4992
5243
|
];
|
|
5244
|
+
const keepToolResult = makeToolResultDeduper();
|
|
5245
|
+
const toolResults = combined.filter((b) => {
|
|
5246
|
+
if (b.type !== "tool_result") return false;
|
|
5247
|
+
const id = b.tool_use_id;
|
|
5248
|
+
return keepToolResult(id);
|
|
5249
|
+
});
|
|
4993
5250
|
lastMessage.content = [
|
|
4994
|
-
...
|
|
4995
|
-
(b) => b.type === "tool_result"
|
|
4996
|
-
),
|
|
5251
|
+
...toolResults,
|
|
4997
5252
|
...combined.filter(
|
|
4998
5253
|
(b) => b.type !== "tool_result"
|
|
4999
5254
|
)
|
|
@@ -5253,6 +5508,9 @@ var AnthropicContentGenerator = class {
|
|
|
5253
5508
|
if (this.hasGlobalCacheScopeOnWire(anthropicRequest)) {
|
|
5254
5509
|
betas.push("prompt-caching-scope-2026-01-05");
|
|
5255
5510
|
}
|
|
5511
|
+
if (this.hasExtendedCacheTtlOnWire(anthropicRequest)) {
|
|
5512
|
+
betas.push("extended-cache-ttl-2025-04-11");
|
|
5513
|
+
}
|
|
5256
5514
|
if (betas.length === 0) return void 0;
|
|
5257
5515
|
const unique = Array.from(new Set(betas));
|
|
5258
5516
|
return { "anthropic-beta": unique.join(",") };
|
|
@@ -5312,6 +5570,47 @@ var AnthropicContentGenerator = class {
|
|
|
5312
5570
|
}
|
|
5313
5571
|
return false;
|
|
5314
5572
|
}
|
|
5573
|
+
/**
|
|
5574
|
+
* Whether the assembled request body carries any
|
|
5575
|
+
* `cache_control: { ..., ttl: '1h' }` entry. Scans the system block,
|
|
5576
|
+
* tools array, and message content blocks — every place the converter
|
|
5577
|
+
* attaches `cache_control` (system text, last tool, trailing user
|
|
5578
|
+
* message). Used to gate the `extended-cache-ttl-2025-04-11` beta
|
|
5579
|
+
* header defensively: live verification found the header has no
|
|
5580
|
+
* observable effect on this proxy/Vertex backend (identical
|
|
5581
|
+
* `ephemeral_1h_input_tokens` with and without it), but a hard
|
|
5582
|
+
* requirement can't be ruled out for every Anthropic-compatible
|
|
5583
|
+
* backend, so it is sent whenever the body actually requests the 1h
|
|
5584
|
+
* tier -- same single-source-of-truth pattern as
|
|
5585
|
+
* {@link hasGlobalCacheScopeOnWire}.
|
|
5586
|
+
*/
|
|
5587
|
+
hasExtendedCacheTtlOnWire(req) {
|
|
5588
|
+
const hasTtl1h = /* @__PURE__ */ __name((block) => {
|
|
5589
|
+
if (!block || typeof block !== "object") return false;
|
|
5590
|
+
const cc = block.cache_control;
|
|
5591
|
+
if (!cc || typeof cc !== "object") return false;
|
|
5592
|
+
return cc.ttl === "1h";
|
|
5593
|
+
}, "hasTtl1h");
|
|
5594
|
+
if (Array.isArray(req.system)) {
|
|
5595
|
+
for (const block of req.system) {
|
|
5596
|
+
if (hasTtl1h(block)) return true;
|
|
5597
|
+
}
|
|
5598
|
+
}
|
|
5599
|
+
if (Array.isArray(req.tools)) {
|
|
5600
|
+
for (const tool of req.tools) {
|
|
5601
|
+
if (hasTtl1h(tool)) return true;
|
|
5602
|
+
}
|
|
5603
|
+
}
|
|
5604
|
+
if (Array.isArray(req.messages)) {
|
|
5605
|
+
for (const message of req.messages) {
|
|
5606
|
+
if (!Array.isArray(message.content)) continue;
|
|
5607
|
+
for (const block of message.content) {
|
|
5608
|
+
if (hasTtl1h(block)) return true;
|
|
5609
|
+
}
|
|
5610
|
+
}
|
|
5611
|
+
}
|
|
5612
|
+
return false;
|
|
5613
|
+
}
|
|
5315
5614
|
/**
|
|
5316
5615
|
* Read every customHeaders entry whose key (case-insensitively) is
|
|
5317
5616
|
* `anthropic-beta` and yield the comma-separated flags from each. Multiple
|
|
@@ -5341,8 +5640,11 @@ var AnthropicContentGenerator = class {
|
|
|
5341
5640
|
const deepseekThinkingOn = isDeepSeek && !!thinking;
|
|
5342
5641
|
const stripAssistantThinking = isDeepSeek && !thinking;
|
|
5343
5642
|
const dropUnsignedAssistantThinking = !isDeepSeek && !!thinking && this.modelSupportsAdaptiveThinking() && !isAnthropicNativeBaseUrl(this.contentGeneratorConfig);
|
|
5643
|
+
const stripTrailingAssistantPrefill = this.modelSupportsAdaptiveThinking();
|
|
5344
5644
|
const enableCacheControl = this.contentGeneratorConfig.enableCacheControl !== false;
|
|
5345
5645
|
const useGlobalCacheScope = this.useGlobalCacheScope();
|
|
5646
|
+
const cacheRetention = this.contentGeneratorConfig.cacheRetention;
|
|
5647
|
+
const cacheRetentionByBlock = this.contentGeneratorConfig.cacheRetentionByBlock;
|
|
5346
5648
|
const { system, messages } = this.converter.convertGeminiRequestToAnthropic(
|
|
5347
5649
|
request,
|
|
5348
5650
|
{
|
|
@@ -5353,8 +5655,11 @@ var AnthropicContentGenerator = class {
|
|
|
5353
5655
|
injectThinkingOnToolUseTurns: deepseekThinkingOn,
|
|
5354
5656
|
dropUnsignedAssistantThinking,
|
|
5355
5657
|
stripAssistantThinking,
|
|
5658
|
+
stripTrailingAssistantPrefill,
|
|
5356
5659
|
enableCacheControl,
|
|
5357
5660
|
useGlobalCacheScope,
|
|
5661
|
+
cacheRetention,
|
|
5662
|
+
cacheRetentionByBlock,
|
|
5358
5663
|
// Read per request (not latched at construction): the client
|
|
5359
5664
|
// re-records the prefix whenever it rebuilds the system prompt
|
|
5360
5665
|
// (memory refresh, model change), and the converter fails open to
|
|
@@ -5365,7 +5670,12 @@ var AnthropicContentGenerator = class {
|
|
|
5365
5670
|
);
|
|
5366
5671
|
const tools = request.config?.tools ? await this.converter.convertGeminiToolsToAnthropic(
|
|
5367
5672
|
request.config.tools,
|
|
5368
|
-
{
|
|
5673
|
+
{
|
|
5674
|
+
enableCacheControl,
|
|
5675
|
+
useGlobalCacheScope,
|
|
5676
|
+
cacheRetention,
|
|
5677
|
+
cacheRetentionByBlock
|
|
5678
|
+
}
|
|
5369
5679
|
) : void 0;
|
|
5370
5680
|
const toolChoice = this.resolveToolChoice(request, tools);
|
|
5371
5681
|
return {
|
|
@@ -5546,7 +5856,7 @@ var AnthropicContentGenerator = class {
|
|
|
5546
5856
|
this.budgetDropWarned = true;
|
|
5547
5857
|
}
|
|
5548
5858
|
if (this.modelSupportsAdaptiveThinking()) {
|
|
5549
|
-
return { type: "adaptive" };
|
|
5859
|
+
return { type: "adaptive", display: "summarized" };
|
|
5550
5860
|
}
|
|
5551
5861
|
const budgetTokens = effectiveEffort === "low" ? 16e3 : effectiveEffort === "max" ? 128e3 : effectiveEffort === "xhigh" ? 96e3 : effectiveEffort === "high" ? 64e3 : 32e3;
|
|
5552
5862
|
return {
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
BaseToolInvocation,
|
|
9
9
|
ToolDisplayNames,
|
|
10
10
|
ToolNames
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CFDR3GNL.js";
|
|
12
12
|
import {
|
|
13
13
|
Storage,
|
|
14
14
|
createDebugLogger,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
makeRelative,
|
|
19
19
|
shortenPath,
|
|
20
20
|
unescapePath
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-3RXUYQJI.js";
|
|
22
22
|
import "./chunk-QUGAUQGJ.js";
|
|
23
23
|
import {
|
|
24
24
|
init_esbuild_shims
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
BaseToolInvocation,
|
|
7
7
|
ToolDisplayNames,
|
|
8
8
|
ToolNames
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CFDR3GNL.js";
|
|
10
10
|
import {
|
|
11
11
|
createDebugLogger
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3RXUYQJI.js";
|
|
13
13
|
import "./chunk-QUGAUQGJ.js";
|
|
14
14
|
import {
|
|
15
15
|
init_esbuild_shims
|